Skip to content

Commit 500868f

Browse files
TheStreamCodeMichael Gasperini
andauthored
feat(meta): integrate Muse Code through the shipped Meta provider (#5)
DeepSeek Harness already ships the `meta` pi-ai route and its device-code flow, so the bundle now integrates them instead of inserting a second `@deepseek-ai/dsh-llm-pi-ai` instance, which cannot activate because every instance declares the whole provider catalog. - declare the `meta` route in the `llm-pi-ai` settings section so the provider appears under Settings > Models and in the model picker - add the `/muse-login` command and a Sign in control under Settings > Models, backed by an exact local `POST/GET /muse-code/login` route - open the Meta verification page in the default browser and show the code - read the authorization seam's neutral notice shape (`message`/`url`/`code`) - ship the Client half as a browser classic script; the ESM `export {}` that tsc emitted aborted the Web boot - drop the hand-written route, `MUSE_CODE_SUB_TOKEN` handling, and the `muse-wonder` ids that DSH's catalog does not serve BREAKING CHANGE: 0.1.x embeddings and their credentials are replaced; see CHANGELOG and README for the 0.2.0 upgrade note. Co-authored-by: Michael Gasperini <michael@mikesoft.it>
1 parent e14f35d commit 500868f

22 files changed

Lines changed: 1994 additions & 837 deletions

‎AGENTS.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ sibling Muse plugins (`hermes-muse-code`, `openclaw-muse-code`, `opencode-muse-a
1010

1111
## Layout
1212

13-
- `src/` — bundle source: provider route wiring, device-code login, credential handling.
13+
- `src/` — bundle source: route declaration in the `llm-pi-ai` settings section, the
14+
`/muse-login` command, and the Client half's Settings → Models hint.
1415
- `lib/` — compiled output, committed because DSH bundle installs from Git may not run a build.
1516
Regenerate with `npm run build`; never edit by hand.
1617
- `test/` — `node:test` suite; new behavior needs a test.
17-
- `cordis.patch.yml` — bundle patch that inserts the model route and the auth plugin.
18-
- `AUTH_CONTRACT.md` — pinned device-flow and key-mint contract shared with the sibling plugins.
18+
- `cordis.patch.yml` — bundle patch that inserts the single integration row.
19+
- `AUTH_CONTRACT.md` — pinned device-flow and key-mint contract shared with the sibling plugins;
20+
DeepSeek Harness implements it, the bundle does not.
1921
- `.github/workflows/` — CI; do not weaken checks, pins, or permissions.
2022

2123
## Commands
@@ -35,6 +37,10 @@ any local credential file.
3537

3638
- Keep changes focused; no drive-by refactors, no new runtime dependencies without a stated
3739
reason.
40+
- The provider route and the device-code flow are DeepSeek Harness features: declare the shipped
41+
`meta` route and run the shipped `llm-pi-ai/meta` flow. Never insert a second
42+
`@deepseek-ai/dsh-llm-pi-ai` instance — every instance declares the whole provider catalog and
43+
the extra row cannot activate.
3844
- Public documentation, comments, and commit messages are in English.
3945
- Do not change `LICENSE`, `DISCLAIMER.md`, `AUTH_CONTRACT.md`, `SECURITY.md`,
4046
`CODE_OF_CONDUCT.md`, or release metadata unless the task is about them.

‎AUTH_CONTRACT.md‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Muse auth contract (v1)
22

3-
This bundle implements the same Meta device-code flow as the other Muse Code
4-
plugins. Change this file and the pinned constants/tests together:
3+
DeepSeek Harness implements this Meta device-code contract in its shipped pi-ai Meta
4+
provider (`llm-pi-ai/meta`); this bundle relies on that implementation. The sibling Muse Code
5+
plugins implement the same flow themselves, so change this file and the pinned values together
6+
with:
57

68
- `opencode-muse-auth`
79
- `hermes-muse-code`
@@ -20,14 +22,19 @@ plugins. Change this file and the pinned constants/tests together:
2022
| Credential reference | `MUSE_CODE_SUB_TOKEN` |
2123
| Inference base URL | `https://api.meta.ai/v1` |
2224

25+
DeepSeek Harness stores the same sign-in as the OAuth credential record `llm-pi-ai/meta` and
26+
re-mints its short-lived key, because the pi-ai adapter owns that flow. The pinned
27+
`MUSE_CODE_SUB_TOKEN` reference describes the sibling plugins' credential, not DSH's.
28+
2329
## Behaviour
2430

2531
- Device flow: request a device code, poll the token endpoint, accept
2632
`authorization_pending`, increase the interval on `slow_down`, stop on a
2733
terminal error or at `expires_in`.
2834
- Key mint: exchange the OAuth access token for the account-bound inference
2935
key; reject an inactive subscription or a pending payment.
30-
- Persistence: the key is stored through the DSH credential seam under
31-
`MUSE_CODE_SUB_TOKEN`; the OAuth access token stays in memory.
32-
- Any change to this contract bumps `AUTH_CONTRACT_VERSION` in the code and
36+
- Persistence: the sibling plugins store the key through the DSH credential seam under
37+
`MUSE_CODE_SUB_TOKEN` and keep the OAuth access token in memory. DeepSeek Harness stores the
38+
sign-in as the `llm-pi-ai/meta` credential record and renews the key from it.
39+
- Any change to this contract bumps the version constant in the implementations' code and
3340
requires updating the pinned tests in all four repositories.

‎CHANGELOG.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,48 @@ 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.0] - 2026-10-26
9+
10+
### Changed
11+
12+
- Integrate Muse Code through the `meta` provider that DeepSeek Harness ships, instead of
13+
inserting a second `@deepseek-ai/dsh-llm-pi-ai` instance. DSH declares every provider catalog
14+
per instance, so the second instance could not activate
15+
(`configurable provider "amazon-bedrock" is already declared`) and the `muse-code` route never
16+
existed.
17+
18+
### Added
19+
20+
- `/muse-login` command that runs the shipped `llm-pi-ai/meta` device-code flow and prints the
21+
verification URL and user code.
22+
- **Sign in** control under **Settings → Models**, backed by an exact local
23+
`POST /muse-code/login` route: DSH exposes no Remote method for provider OAuth flows, so the
24+
Host starts the flow and answers the page with the code and instructions.
25+
- The Host opens the verification page in the default browser for both entry points.
26+
- Automatic declaration of the `meta` route in the `llm-pi-ai` settings section, so the provider
27+
appears under **Settings → Models** and in the model picker labeled
28+
**Muse Code (Meta subscription)**.
29+
- Client half that adds the sign-in control and its footer hint under **Settings → Models**.
30+
31+
### Removed
32+
33+
- The hand-written `muse-code` route, its `MUSE_CODE_SUB_TOKEN` credential handling, and the
34+
bundle's own device-code client. DSH's Meta provider owns the sign-in, the credential record,
35+
and key renewal.
36+
- The `muse-wonder` model ids: models now follow the catalog DeepSeek Harness advertises for the
37+
Meta provider (`muse-spark-1.1`, `muse-spark-1.2`, `muse-spark-1.3`, and the `-contributor`
38+
variants).
39+
40+
### Fixed
41+
42+
- Read the authorization seam's neutral notice (`{ message, url, code }`), not the raw pi-ai
43+
event shape. The previous reader never recognized the device-code notice, so `/muse-login`
44+
reported "did not answer in time" while the flow was waiting normally.
45+
- Ship the Client half as a browser classic script (`client/client.js`, outside the TypeScript
46+
output). The Web UI concatenates client artifacts into plain script bundles, so the `export {}`
47+
that `tsc` emitted for `lib/client.js` broke the whole bundle with
48+
`Uncaught SyntaxError: Unexpected token 'export'` and aborted the Web boot.
49+
850
## [0.1.0] - 2026-10-21
951

1052
### Added
@@ -21,3 +63,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2163
- Unofficial-use risk notice for Meta subscription credentials (`DISCLAIMER.md`).
2264

2365
[0.1.0]: https://github.com/TheStreamCode/dsh-muse-code/releases/tag/v0.1.0
66+
[0.2.0]: https://github.com/TheStreamCode/dsh-muse-code/releases/tag/v0.2.0

‎CITATION.cff‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
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.1.0
5-
date-released: "2026-10-21"
4+
version: 0.2.0
5+
date-released: "2026-10-26"
66
url: "https://github.com/TheStreamCode/dsh-muse-code"
77
repository-code: "https://github.com/TheStreamCode/dsh-muse-code"
88
license: MIT
99
abstract: >-
10-
Unofficial DeepSeek Harness bundle that serves Meta Muse Code models through
11-
a Muse Code subscription credential, with a native Meta device-code login
12-
flow and the minted key stored in the DSH credential store.
10+
Unofficial DeepSeek Harness bundle that integrates Meta Muse Code models through
11+
the subscription: it declares the shipped Meta provider route for Settings > Models
12+
and the model picker, and adds the /muse-login command for the built-in device-code
13+
sign-in.
1314
keywords:
1415
- deepseek-harness
1516
- dsh-plugin

0 commit comments

Comments
 (0)