Muse2API Cookie Import Extension — Installation Guide
====================================================

This extension does one thing: it syncs the muse.ai login cookies
from your browser to your muse2api service. No Python, no terminal needed.


1. Unpack
---------
Unpack muse2api-extension.zip into a directory you will not delete, e.g.:

    Windows : D:\muse2api-extension
    macOS   : ~/Documents/muse2api-extension

After unpacking you should see three files: manifest.json, popup.html, popup.js.


2. Load it in Chrome / Edge
----------------------------
Chrome:
  1. Type chrome://extensions in the address bar, press Enter
  2. Turn on the "Developer mode" switch in the top-right corner
  3. Click "Load unpacked" in the top-left
  4. Select the folder you unpacked in step 1 (the folder, not a single file inside it)
  5. A puzzle-piece icon appears in the toolbar; pin it for convenience (optional but handy)

Edge:
  1. Type edge://extensions in the address bar, press Enter
  2. Turn on "Developer mode" in the bottom-left
  3. Click "Load unpacked"
  4. Same as above from here

Other Chromium-based browsers (Brave / Vivaldi / 360 Speed, etc.) work similarly.


3. Usage
--------
1. Open https://muse.ai/ in this browser and log in,
   until you can see the chat UI.
2. On the muse2api admin page, copy the BASE URL and API Key from the top of the "Account Pool" page.
3. Click the extension icon in the browser toolbar and fill in both values (only needed once — they are remembered).
4. Click "Read and import". Done when you see the success message.


4. FAQ
------
Q: It says "No muse.ai cookies found"
A: This browser is not logged in to muse.ai yet. Open https://muse.ai/ and log in first.

Q: It says "core items such as hatch_sess are missing"
A: Same as above — login is incomplete. Make sure the chat UI is visible, then retry.

Q: It says "Wrong API Key (service returned 401)"
A: Copy the API Key from the admin page again. Note that keys start with m2a_.

Q: Cross-origin / network error
A: Check whether the service URL uses https and whether the service itself is reachable
   (try opening <service-url>/admin directly in the browser).

Q: Will my cookies be sent anywhere else?
A: No. The extension only has the cookies and storage permissions, and the code is right
   there in popup.js for you to read: it sends a single POST to the service URL you entered, nothing else.


5. Uninstall
------------
chrome://extensions -> find "Muse2API Cookie Import" -> Remove.
