Skip to content

Commit 7fdd489

Browse files
author
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
1 parent 500868f commit 7fdd489

11 files changed

Lines changed: 1692 additions & 480 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ All notable changes to this project are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.1] - 2026-10-26
9+
10+
### Added
11+
12+
- Live model catalog sync: the plugin reads the account's chat catalog
13+
(`GET https://api.meta.ai/v1/models`) with the stored subscription key and declares it on the
14+
route, so Muse Wonder and future chat models appear in the picker. Non-chat families
15+
(`muse-image-*`, `muse-voice-*`, `sam-*`) are filtered; the Muse Spark rows keep the shipped
16+
catalog fidelity; a model list edited by the user is never overwritten.
17+
- Live sign-in status: an exact `GET /muse-code/status` route reports `pending`, `authorized`,
18+
`failed`, or `idle`.
19+
- The Settings > Models card was rebuilt as a proper panel: title, coloured status dot
20+
(**Signed in**, **Waiting for Meta…**, **Sign-in failed**), the device code as a monospace
21+
badge, and separate primary/secondary actions. The card polls the status route and flips to
22+
**Signed in** without a reload.
23+
24+
### Fixed
25+
26+
- `/muse-login` no longer leaves the chat on "sign-in started": after opening the browser it waits
27+
for Meta's confirmation (bounded) and answers with the final state or the failure reason.
28+
829
## [0.2.0] - 2026-10-26
930

1031
### Changed

‎CITATION.cff‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cff-version: 1.2.0
22
message: "If you use this software, please cite it as below."
33
title: "dsh-muse-code"
4-
version: 0.2.0
4+
version: 0.2.1
55
date-released: "2026-10-26"
66
url: "https://github.com/TheStreamCode/dsh-muse-code"
77
repository-code: "https://github.com/TheStreamCode/dsh-muse-code"

‎README.md‎

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,43 +47,52 @@ bundle.
4747
## Quick start
4848

4949
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.
5959
5. Pick a Muse model in the model picker, for example `Muse Spark 1.3`.
6060

6161
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.
6363

6464
## Where the sign-in lives
6565

6666
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.
7277

7378
## Features
7479

7580
- Declares the shipped `meta` provider route in the `llm-pi-ai` settings section, labeled
7681
**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.
8293
- Leaves credential handling to DSH: the shipped flow stores the sign-in as an OAuth credential
8394
record and re-mints Meta's short-lived inference key automatically, so the route keeps
8495
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.
8796

8897
## Requirements
8998

@@ -98,22 +107,25 @@ composer, CLI surfaces, or a page whose origin cannot reach the Host.
98107
| Setting | Purpose | Default |
99108
| --- | --- | --- |
100109
| `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 |
103113
| `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` |
105115

106116
The `MUSE_CODE_SUB_TOKEN` reference from the 0.1.x releases is no longer used by this bundle;
107117
see the upgrade note under Troubleshooting.
108118

109119
## Privacy and security
110120

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.
117129
- The stored credential is the `llm-pi-ai/meta` record in the DSH credential store. It never
118130
appears in configuration or logs.
119131
- To remove access, remove the bundle, remove the declared provider from **Settings → Models**
@@ -153,8 +165,21 @@ flow.
153165

154166
### The browser did not open
155167

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**.
158183

159184
### Meta denies the login, or the subscription is inactive
160185

0 commit comments

Comments
 (0)