@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/dist/broker.d.cts CHANGED
@@ -1,3 +1,30 @@
1
+ /**
2
+ * `muhaven-broker start` / `muhaven-broker update` — install a
3
+ * DASHBOARD-minted Scoped session key onto the broker daemon in one shot.
4
+ *
5
+ * Wave 5 Option D OPEN-D (2026-05-24). Replaces the manual last mile after
6
+ * a dashboard mint / revoke:
7
+ *
8
+ * start — bring the daemon UP on a provided key (daemon NOT running).
9
+ * update — ROTATE the key on a (possibly) running daemon: stop → swap →
10
+ * restart → REUSE the existing JWT (a key rotation must not
11
+ * force a device-code re-login).
12
+ *
13
+ * Both resolve the key via the shared precedence (`--session` flag >
14
+ * interactive masked prompt > error — see `session-input.ts`). Both
15
+ * REQUIRE a key (unlike `setup`, which self-mints on the fresh-install
16
+ * path). The key is injected ONLY into the spawned daemon's child env
17
+ * (**Option B** — operator decision 2026-05-24); it never touches disk,
18
+ * so the daemon (`loadBrokerConfig`) and the keystore stay unchanged.
19
+ *
20
+ * The orchestrator is pure-ish: all IO (broker IPC, daemon spawn, stop,
21
+ * login, prompts) is injected via `BringUpDeps` so the decision tree is
22
+ * unit-testable without spawning real processes — mirrors the
23
+ * `runSetup` / `runStop` style.
24
+ */
25
+
26
+ type BringUpMode = 'start' | 'update';
27
+
1
28
  /**
2
29
  * `muhaven-broker` CLI subcommand router.
3
30
  *
@@ -8,6 +35,7 @@
8
35
  * doctor → environment + keystore capability report
9
36
  * --help, -h → usage
10
37
  */
38
+
11
39
  interface LoginFlags {
12
40
  noLaunchBrowser: boolean;
13
41
  brokerEndpoint?: string;
@@ -43,6 +71,8 @@ declare function runSetup(argv: readonly string[]): Promise<number>;
43
71
  * Wire `runStop` against the real BrokerClient + Node's process.kill.
44
72
  */
45
73
  declare function runStop(): Promise<number>;
74
+ /** Wire `muhaven-broker start` / `update` against the real cli helpers. */
75
+ declare function runStartOrUpdate(mode: BringUpMode, argv: readonly string[]): Promise<number>;
46
76
  declare function runCli(argv: readonly string[]): Promise<number>;
47
77
 
48
- export { getBrokerPackageVersion, parseLoginFlags, runCli, runDoctor, runLogin, runLogout, runSetup, runStop };
78
+ export { getBrokerPackageVersion, parseLoginFlags, runCli, runDoctor, runLogin, runLogout, runSetup, runStartOrUpdate, runStop };
package/dist/broker.d.ts CHANGED
@@ -1,3 +1,30 @@
1
+ /**
2
+ * `muhaven-broker start` / `muhaven-broker update` — install a
3
+ * DASHBOARD-minted Scoped session key onto the broker daemon in one shot.
4
+ *
5
+ * Wave 5 Option D OPEN-D (2026-05-24). Replaces the manual last mile after
6
+ * a dashboard mint / revoke:
7
+ *
8
+ * start — bring the daemon UP on a provided key (daemon NOT running).
9
+ * update — ROTATE the key on a (possibly) running daemon: stop → swap →
10
+ * restart → REUSE the existing JWT (a key rotation must not
11
+ * force a device-code re-login).
12
+ *
13
+ * Both resolve the key via the shared precedence (`--session` flag >
14
+ * interactive masked prompt > error — see `session-input.ts`). Both
15
+ * REQUIRE a key (unlike `setup`, which self-mints on the fresh-install
16
+ * path). The key is injected ONLY into the spawned daemon's child env
17
+ * (**Option B** — operator decision 2026-05-24); it never touches disk,
18
+ * so the daemon (`loadBrokerConfig`) and the keystore stay unchanged.
19
+ *
20
+ * The orchestrator is pure-ish: all IO (broker IPC, daemon spawn, stop,
21
+ * login, prompts) is injected via `BringUpDeps` so the decision tree is
22
+ * unit-testable without spawning real processes — mirrors the
23
+ * `runSetup` / `runStop` style.
24
+ */
25
+
26
+ type BringUpMode = 'start' | 'update';
27
+
1
28
  /**
2
29
  * `muhaven-broker` CLI subcommand router.
3
30
  *
@@ -8,6 +35,7 @@
8
35
  * doctor → environment + keystore capability report
9
36
  * --help, -h → usage
10
37
  */
38
+
11
39
  interface LoginFlags {
12
40
  noLaunchBrowser: boolean;
13
41
  brokerEndpoint?: string;
@@ -43,6 +71,8 @@ declare function runSetup(argv: readonly string[]): Promise<number>;
43
71
  * Wire `runStop` against the real BrokerClient + Node's process.kill.
44
72
  */
45
73
  declare function runStop(): Promise<number>;
74
+ /** Wire `muhaven-broker start` / `update` against the real cli helpers. */
75
+ declare function runStartOrUpdate(mode: BringUpMode, argv: readonly string[]): Promise<number>;
46
76
  declare function runCli(argv: readonly string[]): Promise<number>;
47
77
 
48
- export { getBrokerPackageVersion, parseLoginFlags, runCli, runDoctor, runLogin, runLogout, runSetup, runStop };
78
+ export { getBrokerPackageVersion, parseLoginFlags, runCli, runDoctor, runLogin, runLogout, runSetup, runStartOrUpdate, runStop };