@muhaven/mcp 0.2.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,117 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] — 2026-05-24
11
+
12
+ ### Added
13
+
14
+ - **Wave 5 Option D OPEN-D — `muhaven-broker start` / `update` session-key
15
+ CLI.** Automates the manual last mile after a dashboard mint / revoke so
16
+ the operator no longer hand-edits `MUHAVEN_BROKER_SESSION_KEY` + restarts
17
+ the daemon:
18
+ - `muhaven-broker start --session <key|->` — bring the daemon UP on a
19
+ provided key (when it is NOT running). Refuses if a daemon is already
20
+ bound to the endpoint (points the operator at `update`).
21
+ - `muhaven-broker update --session <key|->` — ROTATE the key on a
22
+ (possibly) running daemon: stop → swap → restart, **reusing the
23
+ existing device-flow JWT** (a key rotation does not force a fresh
24
+ device-code login). Fully stops the old daemon before the new one binds
25
+ the endpoint.
26
+ - Both accept `--session -` to read the key from stdin (keeps it out of
27
+ `ps` / shell history), and when run WITHOUT `--session` ask
28
+ interactively ("Do you have a session key from the dashboard? [Y/n]" →
29
+ masked paste). Non-TTY (CI / piped) never hangs — it requires
30
+ `--session` instead.
31
+ - `setup` gained the same interactive prompt: with no
32
+ `MUHAVEN_BROKER_SESSION_KEY` set, it asks whether you have a
33
+ dashboard-minted key (paste it) or mints a fresh one (the
34
+ fresh-install default). Scripted runs (env var set, or non-TTY) keep
35
+ the prior self-mint behavior.
36
+ - **Key-persistence model: Option B (operator decision 2026-05-24).** The
37
+ resolved key is injected ONLY into the spawned daemon's child env — it
38
+ never touches disk. The daemon (`loadBrokerConfig`) and the keystore are
39
+ unchanged; the broker wire protocol is unchanged (no protocol bump). The
40
+ session key is validated (`0x` + 64 hex) and NEVER logged / echoed /
41
+ embedded in an error message.
42
+
43
+ ### Changed
44
+
45
+ - `runStop` (`broker/stop.ts`) gained an optional `clearJwtOnStop` flag
46
+ (default `true`, preserving the `stop` subcommand's behavior). `update`
47
+ passes `false` so the JWT survives the key rotation.
48
+
49
+ ## [0.3.0] — 2026-05-23
50
+
51
+ ### Added
52
+
53
+ - **Wave 5 Option D Commit 3 — MCP-side MODE.ENABLE UserOp pipeline.**
54
+ Closes the `paymaster_rejected → AA23 reverted 0x` smoke gap by
55
+ installing the PermissionValidator atomically with the first Path D
56
+ buy. On a freshly-minted Scoped session (`enable_status='pending'`
57
+ on the backend mirror), `position.buy` now:
58
+ - Fetches install material (`enableData` + `enableSig` +
59
+ `validatorNonce`) from the backend's
60
+ `GET /agent/policy/scoped-session/:id/install-material` subroute,
61
+ gated by `BROKER_CALLBACK_SERVICE_SECRET`.
62
+ - Calls the broker daemon's NEW `current_nonce` IPC verb to read the
63
+ kernel's live `currentNonce()` and pre-checks it against the
64
+ stored `validatorNonce`; mismatch surfaces as fallback
65
+ `enable_sig_stale` with a re-mint remediation.
66
+ - Composes the UserOp with `composeKernelV3NonceKey({mode:'enable'})`
67
+ (byte 0 of the 24-byte composite flips `0x00` → `0x01`) AND
68
+ wraps the 66-byte session-key signature with NEW
69
+ `wrapEnableModeSignature(...)` — a byte-exact mirror of
70
+ `@zerodev/sdk::getEncodedPluginsData`. The byte-equality is
71
+ pinned by 5 regression fixtures importing the canonical SDK as a
72
+ `devDep` (test-only — `@zerodev/sdk` is NOT in the runtime
73
+ bundle).
74
+ - After receipt, calls the broker daemon's NEW
75
+ `notify_userop_landed` IPC verb so the broker can POST the
76
+ backend's `validator-enabled` callback route. The chain indexer
77
+ is the authoritative source-of-truth; the callback is a fast-path
78
+ optimization.
79
+ - **Broker protocol bump 0.4.0 → 0.5.0.** Additive surface only —
80
+ legacy 0.4.0 callers continue to work. New verbs: `current_nonce`,
81
+ `notify_userop_landed`. New optional `enableData`/`enableSig`/
82
+ `validatorNonce` on `PolicySnapshotWire` with an all-or-none
83
+ refinement. New error codes: `chain_rpc_failed`, `callback_unconfigured`.
84
+ - **Broker daemon outbound egress (narrow, operator-approved
85
+ threat-model relaxation).** Until C3 the broker had ZERO outbound
86
+ channels; C3 adds exactly TWO via the NEW `BrokerOutbound` module:
87
+ - Chain RPC `eth_call` to `MUHAVEN_BROKER_RPC_URL` (fallback
88
+ `MUHAVEN_BUNDLER_URL`) for `kernel.currentNonce()` reads.
89
+ - HTTPS POST to backend's `validator-enabled` route with
90
+ `BROKER_CALLBACK_SERVICE_SECRET` bearer, exponential 5s/15s/60s/5m
91
+ backoff (`MUHAVEN_BROKER_ORIGIN` header per the ZeroDev
92
+ allowlist gotcha codified in earlier commits).
93
+ - Per-(sessionId, txHash, accountAddress) in-process dedup folds
94
+ flood IPC into a single retry loop.
95
+ - New fallback codes on `position.buy` Path D probe:
96
+ `install_material_unavailable`, `install_material_malformed`,
97
+ `enable_sig_stale`, `validator_install_failed_re_walk_required`,
98
+ `broker_chain_rpc_failed`.
99
+ - New broker config knobs: `MUHAVEN_BROKER_RPC_URL`,
100
+ `BROKER_CALLBACK_SERVICE_SECRET`, `MUHAVEN_BROKER_ORIGIN`.
101
+
102
+ ### Changed
103
+
104
+ - `composeKernelV3NonceKey` now accepts a `mode: 'default'|'enable'`
105
+ parameter. Default-omitted = `'default'` (backwards-compatible
106
+ with 0.2.x callers).
107
+ - `BackendClient` gains a `getServiceSecret(path, secret, query?)`
108
+ method (refactored `exchange` to share `runFetch`). Used only by
109
+ the install-material subroute.
110
+ - `daemon.ts` JSDoc header rewrites the "zero-egress" invariant to
111
+ document the C3 narrow outbound channels load-bearingly.
112
+
113
+ ### Notes
114
+
115
+ - 28 files changed, +4029 / -20 LOC.
116
+ - 18 new unit tests (5 byte-equality fixtures + 8 use-case + 6
117
+ watchdog + 6 indexer + 12 protocol parser + 5 daemon).
118
+ - @muhaven/mcp 0.3.0 publish requires `npm publish` after
119
+ `pnpm clean && pnpm build && pnpm test`.
120
+
10
121
  ## [0.2.9] — 2026-05-23
11
122
 
12
123
  ### Added