You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7fdd489
Browse filesBrowse the repository at this point in the historyBrowse files
Michael Gasperini
committed
feat(login): sync the live catalog and report the sign-in status
- read GET https://api.meta.ai/v1/models with the stored subscription key and
declare the chat catalog on the `meta` route, so Muse Wonder and future chat
models appear in the picker; non-chat families are filtered and a model list
edited by the user is never overwritten
- add GET /muse-code/status (pending/authorized/failed/idle) and rebuild the
Settings > Models card: coloured status dot, monospace code badge, primary and
secondary actions, and live polling that flips to "Signed in"
- /muse-login now waits for Meta's confirmation and answers with the final
state instead of leaving the chat on "sign-in started"
- unref the status poll timer so the chain cannot pin a Node process open
Copy file name to clipboardExpand all lines: README.md
+58-33Lines changed: 58 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,43 +47,52 @@ bundle.
47
47
## Quick start
48
48
49
49
1. Install the bundle and restart DSH.
50
-
2. Open **Settings → Models** and find **Muse Code (Meta subscription)**. Its models are the
51
-
ones DSH's Meta catalog advertises: Muse Spark 1.1, 1.2, and 1.3, plus their `-contributor`
52
-
variants.
53
-
3. Press **Sign in**in the Muse Code area of that page. The Host starts DSH's Meta device-code
54
-
flow, opens the verification page in your default browser, and shows the code to confirm.
55
-
Without the page (CLI or a page that cannot reach the Host), run `/muse-login` in any chat and
56
-
follow the printed URL and code instead.
57
-
4. Confirm the code on Meta's page and approve the login. DSH stores the credential and keeps it
58
-
fresh; the Muse Code models are selectable as soon as Meta confirms.
50
+
2. Open **Settings → Models**: the **Muse Code (Meta subscription)** card shows the subscription
51
+
status and the models the account catalog serves — Muse Spark 1.1/1.2/1.3 (+ `-contributor`)
52
+
and the Muse Wonder family, plus any future chat model the account lists.
53
+
3. Press **Sign in**on that card. The Host starts DSH's Meta device-code flow, opens the
54
+
verification page in your default browser, and shows the code. The card follows the attempt
55
+
and switches to **Signed in** when Meta confirms. Without the page (CLI, or a page that cannot
56
+
reach the Host), run `/muse-login` in a chat instead.
57
+
4. Confirm the code on Meta's page and approve. DSH stores the credential and keeps it fresh;
58
+
`/muse-login` answers with the final state ("Muse Code is signed in") once Meta confirms.
59
59
5. Pick a Muse model in the model picker, for example `Muse Spark 1.3`.
60
60
61
61
The credential lives in the DSH credential store as the `llm-pi-ai/meta` record. It is never
62
-
written to `cordis.patch.yml`, which carries only the route's display name.
62
+
written to `cordis.patch.yml`, which carries only the route's display name and its model list.
63
63
64
64
## Where the sign-in lives
65
65
66
66
DSH 0.2.1 exposes no generic Remote method for starting a provider OAuth flow, so the Settings
67
-
page cannot call the authorization seam directly. The bundle therefore registers an exact local
68
-
Web route (`POST /muse-code/login`) on the Host's own HTTP server; the **Sign in** control under
69
-
Settings → Models calls it, and the Host both opens the verification page and answers with the
70
-
code and the instructions. The same flow is available as the `/muse-login` command for the
71
-
composer, CLI surfaces, or a page whose origin cannot reach the Host.
67
+
page cannot call the authorization seam directly. The bundle therefore registers exact local Web
68
+
routes on the Host's own HTTP server:
69
+
70
+
-`POST /muse-code/login` starts the sign-in and answers with the code and the Meta URL;
71
+
-`GET /muse-code/status` reports `pending`, `authorized`, `failed`, or `idle`, which is what lets
72
+
the card flip to **Signed in** without a reload.
73
+
74
+
The `/muse-login` command runs the same flow and waits for Meta's confirmation before answering,
75
+
so the chat shows the final state instead of leaving the prompt waiting. A page whose origin
76
+
cannot reach the Host falls back to that command.
72
77
73
78
## Features
74
79
75
80
- Declares the shipped `meta` provider route in the `llm-pi-ai` settings section, labeled
76
81
**Muse Code (Meta subscription)**, so Settings → Models and the model picker show it. An
77
-
existing `meta` profile is left untouched.
78
-
- Adds a **Sign in** control under Settings → Models, backed by the local
79
-
`POST /muse-code/login` route, and the `/muse-login` chat command. Both start DSH's own
80
-
device-code flow (`llm-pi-ai/meta`), open the verification page in the default browser, and
81
-
return the code so the surface can show it.
82
+
existing `meta` profile without a model list is left untouched apart from that list.
83
+
- Syncs the account's live chat catalog (`GET https://api.meta.ai/v1/models`, authenticated with
84
+
the stored subscription key) into the route, so the Muse Wonder family and future chat models
85
+
are selectable without waiting for a DSH catalog update. Non-chat families (`muse-image-*`,
86
+
`muse-voice-*`, `sam-*`) are filtered out; the five Muse Spark rows keep the shipped catalog's
87
+
names, context window, output cap, and reasoning levels. A model list you edited yourself is
88
+
never overwritten.
89
+
- Adds a **Sign in** card under Settings → Models with the live status, the device code, and a
90
+
direct Meta page link, backed by the routes above, plus the `/muse-login` chat command. Both
91
+
start DSH's own device-code flow (`llm-pi-ai/meta`) and open the verification page in the
92
+
default browser.
82
93
- Leaves credential handling to DSH: the shipped flow stores the sign-in as an OAuth credential
83
94
record and re-mints Meta's short-lived inference key automatically, so the route keeps
84
95
working after the key rotates.
85
-
- Serves the models DSH advertises for the Meta provider, with text and image input, a
86
-
1,048,576-token context window, and the reasoning levels each model supports.
87
96
88
97
## Requirements
89
98
@@ -98,22 +107,25 @@ composer, CLI surfaces, or a page whose origin cannot reach the Host.
98
107
| Setting | Purpose | Default |
99
108
| --- | --- | --- |
100
109
|`meta` provider route | Declared by the bundle in the `llm-pi-ai` settings section; shown under Settings → Models and in the model picker. | declared on first boot |
101
-
|**Sign in** control | Starts the shipped Meta device-code flow from Settings → Models, opens the browser, and shows the code. Backed by `POST /muse-code/login` on the local Host. | available after install |
102
-
|`/muse-login`| The same sign-in from a chat or CLI surface, printing the URL and code. | available after install |
110
+
|**Sign in** card | Starts the shipped Meta device-code flow, opens the browser, shows the code, and follows the live status until **Signed in**. Backed by `POST /muse-code/login` and `GET /muse-code/status` on the local Host. | available after install |
111
+
|`/muse-login`| The same sign-in from a chat or CLI surface; waits for Meta's confirmation and reports the final state. | available after install |
112
+
| Live model catalog | Chat models the account serves (`GET /v1/models`), written into the declared route when it has no model list of its own. | synced after sign-in |
103
113
|`META_API_KEY`| Optional Meta Model API key that DSH's Meta provider accepts instead of the subscription sign-in. | unset |
104
-
| Model | Any model the Meta provider advertises; availability depends on the subscription plan. |`muse-spark-1.3`|
114
+
| Model | Any model the route serves; availability depends on the subscription plan. |`muse-spark-1.3`|
105
115
106
116
The `MUSE_CODE_SUB_TOKEN` reference from the 0.1.x releases is no longer used by this bundle;
107
117
see the upgrade note under Troubleshooting.
108
118
109
119
## Privacy and security
110
120
111
-
- The bundle itself calls no endpoint and stores no secret. The sign-in, the credential record,
112
-
and the inference requests belong to DSH: requests go to `https://api.meta.ai/v1`, and the
113
-
verification page is opened on `https://auth.meta.com`.
114
-
- The local `POST /muse-code/login` route only starts that flow and answers with the verification
115
-
URL and the one-time code; it transmits no credential and is reachable only on the Host's own
116
-
loopback listener.
121
+
- The bundle talks to one endpoint: `GET https://api.meta.ai/v1/models`, authenticated with the
122
+
stored subscription key, to sync the account's chat catalog into the route. It stores no
123
+
secret, and the sign-in, the credential record, and the inference requests belong to DSH:
124
+
requests go to `https://api.meta.ai/v1`, and the verification page is opened on
125
+
`https://auth.meta.com`.
126
+
- The local `POST /muse-code/login`, `GET /muse-code/login`, and `GET /muse-code/status` routes
127
+
only start the flow and report its state; they transmit no credential and are reachable only
128
+
on the Host's own loopback listener.
117
129
- The stored credential is the `llm-pi-ai/meta` record in the DSH credential store. It never
118
130
appears in configuration or logs.
119
131
- To remove access, remove the bundle, remove the declared provider from **Settings → Models**
@@ -153,8 +165,21 @@ flow.
153
165
154
166
### The browser did not open
155
167
156
-
The Host opens it best-effort through the platform's URI handler. Both the control and the
157
-
command print the verification URL and the code, so open the URL manually and enter the code.
168
+
The Host opens it best-effort through the platform's URI handler. The card and the command show
169
+
the code and the sign-in page link, so open the page manually and enter the code.
170
+
171
+
### The Muse Code card stays on "Waiting for Meta…"
172
+
173
+
Meta has not confirmed the code yet, or the page could not reach the Host's status route. Approve
174
+
the code on Meta's page; if the card never changes, use `/muse-login` in a chat, which waits for
175
+
the confirmation itself.
176
+
177
+
### Muse Wonder (or another catalog model) is missing
178
+
179
+
The live catalog sync only fills a route that has no model list of its own. If you edited the
180
+
provider's models under **Settings → Models → Edit**, remove that list (or reset it) and restart
181
+
DSH so the sync can refill it from the account catalog. The sync also needs the stored credential:
182
+
sign in again first if the card is not **Signed in**.
158
183
159
184
### Meta denies the login, or the subscription is inactive
0 commit comments