muonroi-cli 1.8.3 → 1.8.4

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.
Files changed (39) hide show
  1. package/LICENSE +9 -21
  2. package/README.md +133 -122
  3. package/dist/src/cli/cost-forensics.js +12 -12
  4. package/dist/src/council/prompts.js +20 -20
  5. package/dist/src/generated/version.d.ts +1 -1
  6. package/dist/src/generated/version.js +1 -1
  7. package/dist/src/mcp/oauth-callback.js +2 -2
  8. package/dist/src/mcp/setup-guide-text.d.ts +1 -1
  9. package/dist/src/mcp/setup-guide-text.js +77 -76
  10. package/dist/src/ops/doctor.js +7 -7
  11. package/dist/src/orchestrator/prompts.js +159 -159
  12. package/dist/src/orchestrator/tool-engine.d.ts +4 -0
  13. package/dist/src/orchestrator/tool-engine.js +49 -0
  14. package/dist/src/pil/layer1-intent.js +37 -37
  15. package/dist/src/pil/layer2_5-ponytail.js +8 -8
  16. package/dist/src/product-loop/done-gate.js +3 -3
  17. package/dist/src/product-loop/loop-driver.js +18 -18
  18. package/dist/src/product-loop/progress-snapshot.js +4 -4
  19. package/dist/src/providers/mcp-vision-bridge.js +48 -48
  20. package/dist/src/reporter/index.js +1 -1
  21. package/dist/src/scaffold/bb-ecosystem-apply.js +47 -47
  22. package/dist/src/scaffold/bb-quality-gate.js +5 -5
  23. package/dist/src/scaffold/continuation-prompt.js +60 -60
  24. package/dist/src/scaffold/init-new.js +453 -453
  25. package/dist/src/self-qa/agentic-loop.js +19 -19
  26. package/dist/src/storage/interaction-log.js +5 -5
  27. package/dist/src/storage/migrations.js +125 -125
  28. package/dist/src/storage/session-experience-store.js +4 -4
  29. package/dist/src/storage/sessions.js +43 -43
  30. package/dist/src/storage/transcript.js +100 -100
  31. package/dist/src/storage/usage.js +14 -14
  32. package/dist/src/storage/workspaces.js +12 -12
  33. package/dist/src/ui/slash/council-inspect.js +4 -4
  34. package/dist/src/ui/use-app-logic.js +0 -0
  35. package/dist/src/utils/clipboard-image.js +23 -23
  36. package/dist/src/utils/install-manager.js +12 -10
  37. package/dist/src/utils/side-question.js +2 -2
  38. package/dist/src/utils/skills.js +3 -3
  39. package/package.json +2 -2
package/LICENSE CHANGED
@@ -1,21 +1,9 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 muonroi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Copyright (c) 2026 muonroi. All rights reserved.
2
+
3
+ Commercial / Proprietary License
4
+
5
+ This software and associated documentation files (the "Software") are proprietary to muonroi.
6
+
7
+ Unauthorized copying, modification, distribution, transmission, performance, display or other use of this Software, via any medium, is strictly prohibited.
8
+
9
+ The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
package/README.md CHANGED
@@ -1,122 +1,133 @@
1
- <p align="center">
2
- <h1 align="center">muonroi-cli</h1>
3
- <p align="center">
4
- <em>An AI coding agent where models argue with each other before answering.</em>
5
- </p>
6
- <p align="center">
7
- <a href="https://github.com/muonroi/muonroi-cli/actions/workflows/ci-matrix.yml"><img alt="CI" src="https://github.com/muonroi/muonroi-cli/actions/workflows/ci-matrix.yml/badge.svg"></a>
8
- <a href="https://www.npmjs.com/package/muonroi-cli"><img alt="npm" src="https://img.shields.io/npm/v/muonroi-cli.svg"></a>
9
- <img alt="Providers" src="https://img.shields.io/badge/providers-7%20supported-blue">
10
- <img alt="License" src="https://img.shields.io/badge/license-MIT-yellow">
11
- <img alt="Runtime" src="https://img.shields.io/badge/runtime-Bun%201.3%2B-orange">
12
- </p>
13
- </p>
14
-
15
- ---
16
-
17
- > Routes each task to the optimal model, runs adversarial multi-model debates for high-stakes decisions, and persists behavioral memory across sessions. Bring your own API keys. Total cost: ~$5/month.
18
-
19
- <p align="center">
20
- <img src="https://raw.githubusercontent.com/muonroi/muonroi-cli/master/docs/demo.gif" alt="Council debate — REST vs gRPC decision" width="840" />
21
- </p>
22
-
23
- ## Quick Start
24
-
25
- ### Install
26
-
27
- **Recommended — prebuilt standalone binary (zero runtime deps, no prereqs):**
28
-
29
- Linux / macOS:
30
- ```bash
31
- curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.sh | bash
32
- ```
33
-
34
- Windows PowerShell:
35
- ```powershell
36
- irm https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.ps1 | iex
37
- ```
38
-
39
- The installers download a `bun --compile` binary from GitHub Releases — single executable, all native deps bundled, no Node/Bun/build tools required.
40
-
41
- **Bun runtime (requires Bun ≥ 1.x):**
42
- ```bash
43
- bun add -g muonroi-cli
44
- muonroi-cli
45
- ```
46
-
47
- > **⚠ Why no `npm install -g`?** The TUI engine (`@opentui/core`) uses Bun-only `import ... with { type: "file" }` for Tree-sitter syntax highlight queries (`.scm` files). Node ESM cannot load these, so running under bare Node throws `ERR_UNKNOWN_FILE_EXTENSION`. Use the standalone installer (above) or `bun add -g`.
48
-
49
- ### First run
50
-
51
- On first launch the CLI shows a wizard that:
52
- 1. Lists supported providers (currently **DeepSeek** and **SiliconFlow**).
53
- 2. Offers four ways to add credentials: paste an API key, import an encrypted bundle (`keys export`/`keys import`), sync from Bitwarden, or skip and add later via `/providers` inside the TUI.
54
-
55
- After setup, role routing auto-balances across enabled providers:
56
-
57
- ```json
58
- // ~/.muonroi-cli/user-settings.json (generated by the wizardedit if needed)
59
- {
60
- "defaultProvider": "deepseek",
61
- "providers": {
62
- "deepseek": { "enabled": true },
63
- "siliconflow": { "enabled": true }
64
- },
65
- "roleModels": {
66
- "leader": "deepseek-v4-pro",
67
- "implement": "deepseek-v4-flash",
68
- "verify": "deepseek-v4-pro",
69
- "research": "deepseek-v4-flash"
70
- }
71
- }
72
- ```
73
-
74
- ### Moving keys between devices
75
-
76
- ```bash
77
- # Source device — encrypts every stored key into one passphrase-protected file
78
- muonroi-cli keys export ~/muonroi-keys.json
79
-
80
- # Move the file via any channel (USB, Drive, AirDrop, email...)
81
-
82
- # Target device — same passphrase rehydrates the OS keychain
83
- muonroi-cli keys import ~/muonroi-keys.json
84
- ```
85
-
86
- Inside the TUI press `/providers` then `B` to sync directly from a Bitwarden vault instead.
87
-
88
- ### Updates
89
-
90
- The CLI checks npm once per day on startup and prompts when a newer version is available. Set `autoUpdate: true` in `user-settings.json` to skip the prompt and update silently. Manual: `muonroi-cli update`.
91
-
92
- ## Documentation
93
-
94
- Full documentation at **[docs.muonroi.com/docs/cli](https://docs.muonroi.com/docs/cli/overview)**
95
-
96
- | Topic | Link |
97
- |---|---|
98
- | Overview & architecture | [CLI Overview](https://docs.muonroi.com/docs/cli/overview) |
99
- | Multi-Model Council | [Council Debate Guide](https://docs.muonroi.com/docs/cli/guides/council-debate) |
100
- | Prompt Intelligence Layer | [PIL Pipeline Guide](https://docs.muonroi.com/docs/cli/guides/pil-pipeline) |
101
- | Experience Engine | [Experience Engine Guide](https://docs.muonroi.com/docs/cli/guides/experience-engine) |
102
- | Agent Harness | [Agent Harness Guide](https://docs.muonroi.com/docs/cli/guides/agent-harness) |
103
- | Settings reference | [CLI Settings Reference](https://docs.muonroi.com/docs/cli/reference/cli-settings-reference) |
104
- | Commands reference | [Commands Reference](https://docs.muonroi.com/docs/cli/reference/commands-reference) |
105
- | Providers reference | [Providers Reference](https://docs.muonroi.com/docs/cli/reference/providers-reference) |
106
-
107
- ## Development
108
-
109
- ```bash
110
- git clone https://github.com/muonroi/muonroi-cli.git
111
- cd muonroi-cli && bun install
112
-
113
- bun run dev # run from source
114
- bun run typecheck # type check
115
- bun run test # vitest
116
- bun run lint # biome check
117
- bun run build:binary # standalone binary
118
- ```
119
-
120
- ## License
121
-
122
- MIT
1
+ <p align="center">
2
+ <h1 align="center">muonroi-cli</h1>
3
+ <p align="center">
4
+ <em>An AI coding agent where models argue with each other before answering.</em>
5
+ </p>
6
+ <p align="center">
7
+ <a href="https://github.com/muonroi/muonroi-cli/actions/workflows/ci-matrix.yml"><img alt="CI" src="https://github.com/muonroi/muonroi-cli/actions/workflows/ci-matrix.yml/badge.svg"></a>
8
+ <a href="https://www.npmjs.com/package/muonroi-cli"><img alt="npm" src="https://img.shields.io/npm/v/muonroi-cli.svg"></a>
9
+ <img alt="Providers" src="https://img.shields.io/badge/providers-7%20supported-blue">
10
+ <img alt="License" src="https://img.shields.io/badge/license-MIT-yellow">
11
+ <img alt="Runtime" src="https://img.shields.io/badge/runtime-Bun%201.3%2B-orange">
12
+ </p>
13
+ </p>
14
+
15
+ ---
16
+
17
+ > Routes each task to the optimal model, runs adversarial multi-model debates for high-stakes decisions, and persists behavioral memory across sessions. Bring your own API keys. Total cost: ~$5/month.
18
+
19
+ <p align="center">
20
+ <img src="https://raw.githubusercontent.com/muonroi/muonroi-cli/master/docs/demo.gif" alt="Council debate — REST vs gRPC decision" width="840" />
21
+ </p>
22
+
23
+ ## Quick Start
24
+
25
+ ### Install
26
+
27
+ **Recommended — install globally via NPM (requires Node.js 20) or Bun (requires Bun ≥ 1.x):**
28
+
29
+ Using NPM:
30
+ ```bash
31
+ npm install -g muonroi-cli
32
+ ```
33
+
34
+ Using Bun:
35
+ ```bash
36
+ bun add -g muonroi-cli
37
+ ```
38
+
39
+ Once installed, run:
40
+ ```bash
41
+ muonroi-cli
42
+ ```
43
+
44
+ **Alternative — Prebuilt standalone binary (requires access to the GitHub repository):**
45
+
46
+ Linux / macOS:
47
+ ```bash
48
+ # Note: Requires github authorization if the repository is private
49
+ curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.sh | bash
50
+ ```
51
+
52
+ Windows PowerShell:
53
+ ```powershell
54
+ # Note: Requires github authorization if the repository is private
55
+ irm https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.ps1 | iex
56
+ ```
57
+
58
+ The installers download a `bun --compile` binary from GitHub Releases single executable, all native deps bundled, no Node/Bun/build tools required.
59
+
60
+ ### First run
61
+
62
+ On first launch the CLI shows a wizard that:
63
+ 1. Lists supported providers (currently **DeepSeek** and **SiliconFlow**).
64
+ 2. Offers four ways to add credentials: paste an API key, import an encrypted bundle (`keys export`/`keys import`), sync from Bitwarden, or skip and add later via `/providers` inside the TUI.
65
+
66
+ After setup, role routing auto-balances across enabled providers:
67
+
68
+ ```json
69
+ // ~/.muonroi-cli/user-settings.json (generated by the wizard — edit if needed)
70
+ {
71
+ "defaultProvider": "deepseek",
72
+ "providers": {
73
+ "deepseek": { "enabled": true },
74
+ "siliconflow": { "enabled": true }
75
+ },
76
+ "roleModels": {
77
+ "leader": "deepseek-v4-pro",
78
+ "implement": "deepseek-v4-flash",
79
+ "verify": "deepseek-v4-pro",
80
+ "research": "deepseek-v4-flash"
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### Moving keys between devices
86
+
87
+ ```bash
88
+ # Source device — encrypts every stored key into one passphrase-protected file
89
+ muonroi-cli keys export ~/muonroi-keys.json
90
+
91
+ # Move the file via any channel (USB, Drive, AirDrop, email...)
92
+
93
+ # Target device — same passphrase rehydrates the OS keychain
94
+ muonroi-cli keys import ~/muonroi-keys.json
95
+ ```
96
+
97
+ Inside the TUI press `/providers` then `B` to sync directly from a Bitwarden vault instead.
98
+
99
+ ### Updates
100
+
101
+ The CLI checks npm once per day on startup and prompts when a newer version is available. Set `autoUpdate: true` in `user-settings.json` to skip the prompt and update silently. Manual: `muonroi-cli update`.
102
+
103
+ ## Documentation
104
+
105
+ Full documentation at **[docs.muonroi.com/docs/cli](https://docs.muonroi.com/docs/cli/overview)**
106
+
107
+ | Topic | Link |
108
+ |---|---|
109
+ | Overview & architecture | [CLI Overview](https://docs.muonroi.com/docs/cli/overview) |
110
+ | Multi-Model Council | [Council Debate Guide](https://docs.muonroi.com/docs/cli/guides/council-debate) |
111
+ | Prompt Intelligence Layer | [PIL Pipeline Guide](https://docs.muonroi.com/docs/cli/guides/pil-pipeline) |
112
+ | Experience Engine | [Experience Engine Guide](https://docs.muonroi.com/docs/cli/guides/experience-engine) |
113
+ | Agent Harness | [Agent Harness Guide](https://docs.muonroi.com/docs/cli/guides/agent-harness) |
114
+ | Settings reference | [CLI Settings Reference](https://docs.muonroi.com/docs/cli/reference/cli-settings-reference) |
115
+ | Commands reference | [Commands Reference](https://docs.muonroi.com/docs/cli/reference/commands-reference) |
116
+ | Providers reference | [Providers Reference](https://docs.muonroi.com/docs/cli/reference/providers-reference) |
117
+
118
+ ## Development
119
+
120
+ ```bash
121
+ git clone https://github.com/muonroi/muonroi-cli.git
122
+ cd muonroi-cli && bun install
123
+
124
+ bun run dev # run from source
125
+ bun run typecheck # type check
126
+ bun run test # vitest
127
+ bun run lint # biome check
128
+ bun run build:binary # standalone binary
129
+ ```
130
+
131
+ ## License
132
+
133
+ MIT
@@ -46,21 +46,21 @@ export function collectCostForensics(sessionId) {
46
46
  const chain = getSessionChain(sessionId);
47
47
  const placeholders = chain.map(() => "?").join(",");
48
48
  const rows = db
49
- .prepare(`
50
- SELECT id, source, model, message_seq, input_tokens, output_tokens,
51
- cache_read_tokens, cache_creation_tokens, cost_micros, created_at,
52
- provider_options_shape
53
- FROM usage_events
54
- WHERE session_id IN (${placeholders})
55
- ORDER BY id ASC
49
+ .prepare(`
50
+ SELECT id, source, model, message_seq, input_tokens, output_tokens,
51
+ cache_read_tokens, cache_creation_tokens, cost_micros, created_at,
52
+ provider_options_shape
53
+ FROM usage_events
54
+ WHERE session_id IN (${placeholders})
55
+ ORDER BY id ASC
56
56
  `)
57
57
  .all(...chain);
58
58
  const counts = db
59
- .prepare(`
60
- SELECT event_type, COUNT(*) AS c
61
- FROM interaction_logs
62
- WHERE session_id IN (${placeholders})
63
- GROUP BY event_type
59
+ .prepare(`
60
+ SELECT event_type, COUNT(*) AS c
61
+ FROM interaction_logs
62
+ WHERE session_id IN (${placeholders})
63
+ GROUP BY event_type
64
64
  `)
65
65
  .all(...chain);
66
66
  const countMap = new Map(counts.map((r) => [r.event_type, r.c]));
@@ -548,33 +548,33 @@ export function buildSynthesisPrompt(ctx) {
548
548
  }
549
549
  let extraContext = "";
550
550
  if (ctx.refineContext) {
551
- extraContext += `
552
- ## User Refinements
553
- ${ctx.refineContext}
551
+ extraContext += `
552
+ ## User Refinements
553
+ ${ctx.refineContext}
554
554
  `;
555
555
  }
556
556
  if (ctx.planEmphasis) {
557
- extraContext += `
558
- ## Additional Instruction
559
- The user has requested a concrete action plan with executable steps. Each action item MUST be an object with these fields:
560
- {
561
- "step": "<imperative action>",
562
- "owner_lens": "<which stance owns this — frontend / backend / architecture / etc>",
563
- "time_estimate": "<rough — e.g. '2h', '1d', '~30min'>",
564
- "depends_on": ["<step keys this requires>"] or [],
565
- "acceptance_criteria": "<how we know it's done>"
566
- }
567
- Order action items by dependency: predecessors first, dependents after.
568
- Risks MUST be objects with: {"description", "severity": "High|Medium|Low", "mitigation"}.
569
- Do NOT emit loose strings for these fields — the user needs structured plan output.
557
+ extraContext += `
558
+ ## Additional Instruction
559
+ The user has requested a concrete action plan with executable steps. Each action item MUST be an object with these fields:
560
+ {
561
+ "step": "<imperative action>",
562
+ "owner_lens": "<which stance owns this — frontend / backend / architecture / etc>",
563
+ "time_estimate": "<rough — e.g. '2h', '1d', '~30min'>",
564
+ "depends_on": ["<step keys this requires>"] or [],
565
+ "acceptance_criteria": "<how we know it's done>"
566
+ }
567
+ Order action items by dependency: predecessors first, dependents after.
568
+ Risks MUST be objects with: {"description", "severity": "High|Medium|Low", "mitigation"}.
569
+ Do NOT emit loose strings for these fields — the user needs structured plan output.
570
570
  `;
571
571
  }
572
572
  return {
573
573
  system,
574
- prompt: `Final positions:
575
- ${ctx.finalPositions}
576
-
577
- Full discussion:
574
+ prompt: `Final positions:
575
+ ${ctx.finalPositions}
576
+
577
+ Full discussion:
578
578
  ${ctx.allExchanges}${extraContext}`,
579
579
  };
580
580
  }
@@ -1,2 +1,2 @@
1
- export declare const PACKAGE_VERSION = "1.8.3";
1
+ export declare const PACKAGE_VERSION = "1.8.4";
2
2
  export declare const PACKAGE_DESCRIPTION = "BYOK AI coding agent with multi-model council debate, role-based routing, and auto-compact.";
@@ -1,5 +1,5 @@
1
1
  // AUTO-GENERATED by scripts/sync-version.cjs. DO NOT EDIT BY HAND.
2
2
  // Sourced from package.json at build time so it survives bun --compile bundling.
3
- export const PACKAGE_VERSION = "1.8.3";
3
+ export const PACKAGE_VERSION = "1.8.4";
4
4
  export const PACKAGE_DESCRIPTION = "BYOK AI coding agent with multi-model council debate, role-based routing, and auto-compact.";
5
5
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
1
  import http from "node:http";
2
2
  import { URL } from "node:url";
3
- const SUCCESS_HTML = `<!DOCTYPE html><html><body style="font-family:system-ui;text-align:center;padding:60px">
4
- <h2>Authorization successful</h2><p>You can close this tab and return to the terminal.</p>
3
+ const SUCCESS_HTML = `<!DOCTYPE html><html><body style="font-family:system-ui;text-align:center;padding:60px">
4
+ <h2>Authorization successful</h2><p>You can close this tab and return to the terminal.</p>
5
5
  </body></html>`;
6
6
  export function startOAuthCallbackServer(opts) {
7
7
  const callbackPath = opts.path ?? "/callback";
@@ -6,4 +6,4 @@
6
6
  * and the muonroi-tools MCP server (src/mcp/tools-server.ts, for external agents).
7
7
  * Keeping it here avoids duplicating ~70 lines across the two.
8
8
  */
9
- export declare const SETUP_GUIDE_TEXT = "# muonroi-cli Setup Guide\n\n## Install (zero runtime deps \u2014 recommended)\nLinux / macOS:\n curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.sh | bash\n\nWindows PowerShell:\n irm https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.ps1 | iex\n\nBun (requires Bun >= 1.3):\n bun add -g muonroi-cli\n\nNPM (requires Node >= 20):\n npm install -g muonroi-cli\n\nThe installers fetch a pre-compiled single binary from GitHub Releases.\n\n## First run\n- Wizard appears automatically.\n- Lists supported providers (DeepSeek + SiliconFlow ready; others via BYOK).\n- Four credential options: paste key, Bitwarden sync (B in /providers), keys export/import (encrypted bundle), or skip for later.\n- Keys land in OS keychain (keytar). Settings written to ~/.muonroi-cli/user-settings.json.\n- Role routing (leader/implement/verify/research) is configured for you.\n\nAfter setup: run `muonroi-cli doctor` to validate.\n\n## Essential commands\n- Interactive TUI: `muonroi-cli` (or `node dist/index.js` after build)\n- Headless one-shot: `muonroi-cli --prompt \"your task\" --max-tool-rounds 8`\n- Health + MCP nudge: `muonroi-cli doctor`\n- Update: `muonroi-cli update` (or set \"autoUpdate\": true in user-settings)\n- Keys move between machines: `muonroi-cli keys export file.json` then import on target\n- Native tools MCP (for external agents): `muonroi-cli tools-mcp` (stdio)\n- Harness driver MCP: `muonroi-cli mcp-driver`\n\n## MCP integration (for Claude Desktop, Cursor, other agents)\nAdd to your MCP client config:\n\n{\n \"mcpServers\": {\n \"muonroi-tools\": {\n \"command\": \"bun\",\n \"args\": [\"run\", \"/absolute/path/to/muonroi-cli/src/index.ts\", \"tools-mcp\"]\n }\n }\n}\n\n(Use absolute path. After `bun run build`: \"node\", \"dist/index.js\", \"tools-mcp\")\n\nThe CLI's OWN inner agent exposes these as NATIVE in-process tools (no MCP self-spawn):\n- setup_guide (this document)\n- ee_query / ee_health / ee_feedback \u2014 Experience Engine semantic recall + compaction checkpoints + feedback for learning\n- usage_forensics <id-prefix> \u2014 per-session cost/token forensics (peak input, cache hits, anomalies)\n- lsp_query \u2014 goToDefinition, findReferences, hover, symbols, call hierarchy etc.\n- selfverify_* \u2014 Tier-1 heuristic + Tier-2 agentic self-QA harness runs (start/poll/result/cancel/list)\n\nFor BB/.NET template recipes and package docs, also connect an external \"muonroi-docs\" MCP server if available (provides docs_search + setup_guide for the templates).\n\n## Development\ngit clone https://github.com/muonroi/muonroi-cli.git\ncd muonroi-cli && bun install\n\nbun run dev # run from source (TUI)\nbun run typecheck # tsc --noEmit\nbun run test # vitest (unit + headless)\nbunx vitest -c vitest.harness.config.ts run tests/harness/ # TUI E2E (named-pipes on Win, fd3/4 on POSIX)\nbun run build # or build:binary for standalone exe\n\nSee AGENTS.md (quick ref + rules), CLAUDE.md (harness verification), README.md.\n\n## Verify\nmuonroi-cli doctor\n# Checks runtimes, catalog load, keychain, MCP servers enabled, council research MCP nudge, EE reachability, recent error rate.\n# Any \"warn\" entries tell you exactly what to enable (e.g. tavily for web research in council).\n\nFor BB-aware scaffolding (/ideal on a muonroi-building-block target): ensure dotnet SDK + the three Muonroi.*.Template packages are installed via NuGet; doctor surfaces missing feed/template cases.\n";
9
+ export declare const SETUP_GUIDE_TEXT = "# muonroi-cli Setup Guide\n\n## Install (Recommended \u2014 NPM/Bun global install)\nNPM (requires Node >= 20):\n npm install -g muonroi-cli\n\nBun (requires Bun >= 1.3):\n bun add -g muonroi-cli\n\n## Install (Alternative \u2014 Prebuilt standalone binary, requires repo access)\nLinux / macOS:\n curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.sh | bash\n\nWindows PowerShell:\n irm https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.ps1 | iex\n\nThe installers fetch a pre-compiled single binary from GitHub Releases.\n\n## First run\n- Wizard appears automatically.\n- Lists supported providers (DeepSeek + SiliconFlow ready; others via BYOK).\n- Four credential options: paste key, Bitwarden sync (B in /providers), keys export/import (encrypted bundle), or skip for later.\n- Keys land in OS keychain (keytar). Settings written to ~/.muonroi-cli/user-settings.json.\n- Role routing (leader/implement/verify/research) is configured for you.\n\nAfter setup: run `muonroi-cli doctor` to validate.\n\n## Essential commands\n- Interactive TUI: `muonroi-cli` (or `node dist/index.js` after build)\n- Headless one-shot: `muonroi-cli --prompt \"your task\" --max-tool-rounds 8`\n- Health + MCP nudge: `muonroi-cli doctor`\n- Update: `muonroi-cli update` (or set \"autoUpdate\": true in user-settings)\n- Keys move between machines: `muonroi-cli keys export file.json` then import on target\n- Native tools MCP (for external agents): `muonroi-cli tools-mcp` (stdio)\n- Harness driver MCP: `muonroi-cli mcp-driver`\n\n## MCP integration (for Claude Desktop, Cursor, other agents)\nAdd to your MCP client config:\n\n{\n \"mcpServers\": {\n \"muonroi-tools\": {\n \"command\": \"bun\",\n \"args\": [\"run\", \"/absolute/path/to/muonroi-cli/src/index.ts\", \"tools-mcp\"]\n }\n }\n}\n\n(Use absolute path. After `bun run build`: \"node\", \"dist/index.js\", \"tools-mcp\")\n\nThe CLI's OWN inner agent exposes these as NATIVE in-process tools (no MCP self-spawn):\n- setup_guide (this document)\n- ee_query / ee_health / ee_feedback \u2014 Experience Engine semantic recall + compaction checkpoints + feedback for learning\n- usage_forensics <id-prefix> \u2014 per-session cost/token forensics (peak input, cache hits, anomalies)\n- lsp_query \u2014 goToDefinition, findReferences, hover, symbols, call hierarchy etc.\n- selfverify_* \u2014 Tier-1 heuristic + Tier-2 agentic self-QA harness runs (start/poll/result/cancel/list)\n\nFor BB/.NET template recipes and package docs, also connect an external \"muonroi-docs\" MCP server if available (provides docs_search + setup_guide for the templates).\n\n## Development\ngit clone https://github.com/muonroi/muonroi-cli.git\ncd muonroi-cli && bun install\n\nbun run dev # run from source (TUI)\nbun run typecheck # tsc --noEmit\nbun run test # vitest (unit + headless)\nbunx vitest -c vitest.harness.config.ts run tests/harness/ # TUI E2E (named-pipes on Win, fd3/4 on POSIX)\nbun run build # or build:binary for standalone exe\n\nSee AGENTS.md (quick ref + rules), CLAUDE.md (harness verification), README.md.\n\n## Verify\nmuonroi-cli doctor\n# Checks runtimes, catalog load, keychain, MCP servers enabled, council research MCP nudge, EE reachability, recent error rate.\n# Any \"warn\" entries tell you exactly what to enable (e.g. tavily for web research in council).\n\nFor BB-aware scaffolding (/ideal on a muonroi-building-block target): ensure dotnet SDK + the three Muonroi.*.Template packages are installed via NuGet; doctor surfaces missing feed/template cases.\n";
@@ -6,81 +6,82 @@
6
6
  * and the muonroi-tools MCP server (src/mcp/tools-server.ts, for external agents).
7
7
  * Keeping it here avoids duplicating ~70 lines across the two.
8
8
  */
9
- export const SETUP_GUIDE_TEXT = `# muonroi-cli Setup Guide
10
-
11
- ## Install (zero runtime deps recommended)
12
- Linux / macOS:
13
- curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.sh | bash
14
-
15
- Windows PowerShell:
16
- irm https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.ps1 | iex
17
-
18
- Bun (requires Bun >= 1.3):
19
- bun add -g muonroi-cli
20
-
21
- NPM (requires Node >= 20):
22
- npm install -g muonroi-cli
23
-
24
- The installers fetch a pre-compiled single binary from GitHub Releases.
25
-
26
- ## First run
27
- - Wizard appears automatically.
28
- - Lists supported providers (DeepSeek + SiliconFlow ready; others via BYOK).
29
- - Four credential options: paste key, Bitwarden sync (B in /providers), keys export/import (encrypted bundle), or skip for later.
30
- - Keys land in OS keychain (keytar). Settings written to ~/.muonroi-cli/user-settings.json.
31
- - Role routing (leader/implement/verify/research) is configured for you.
32
-
33
- After setup: run \`muonroi-cli doctor\` to validate.
34
-
35
- ## Essential commands
36
- - Interactive TUI: \`muonroi-cli\` (or \`node dist/index.js\` after build)
37
- - Headless one-shot: \`muonroi-cli --prompt "your task" --max-tool-rounds 8\`
38
- - Health + MCP nudge: \`muonroi-cli doctor\`
39
- - Update: \`muonroi-cli update\` (or set "autoUpdate": true in user-settings)
40
- - Keys move between machines: \`muonroi-cli keys export file.json\` then import on target
41
- - Native tools MCP (for external agents): \`muonroi-cli tools-mcp\` (stdio)
42
- - Harness driver MCP: \`muonroi-cli mcp-driver\`
43
-
44
- ## MCP integration (for Claude Desktop, Cursor, other agents)
45
- Add to your MCP client config:
46
-
47
- {
48
- "mcpServers": {
49
- "muonroi-tools": {
50
- "command": "bun",
51
- "args": ["run", "/absolute/path/to/muonroi-cli/src/index.ts", "tools-mcp"]
52
- }
53
- }
54
- }
55
-
56
- (Use absolute path. After \`bun run build\`: "node", "dist/index.js", "tools-mcp")
57
-
58
- The CLI's OWN inner agent exposes these as NATIVE in-process tools (no MCP self-spawn):
59
- - setup_guide (this document)
60
- - ee_query / ee_health / ee_feedback — Experience Engine semantic recall + compaction checkpoints + feedback for learning
61
- - usage_forensics <id-prefix>per-session cost/token forensics (peak input, cache hits, anomalies)
62
- - lsp_querygoToDefinition, findReferences, hover, symbols, call hierarchy etc.
63
- - selfverify_*Tier-1 heuristic + Tier-2 agentic self-QA harness runs (start/poll/result/cancel/list)
64
-
65
- For BB/.NET template recipes and package docs, also connect an external "muonroi-docs" MCP server if available (provides docs_search + setup_guide for the templates).
66
-
67
- ## Development
68
- git clone https://github.com/muonroi/muonroi-cli.git
69
- cd muonroi-cli && bun install
70
-
71
- bun run dev # run from source (TUI)
72
- bun run typecheck # tsc --noEmit
73
- bun run test # vitest (unit + headless)
74
- bunx vitest -c vitest.harness.config.ts run tests/harness/ # TUI E2E (named-pipes on Win, fd3/4 on POSIX)
75
- bun run build # or build:binary for standalone exe
76
-
77
- See AGENTS.md (quick ref + rules), CLAUDE.md (harness verification), README.md.
78
-
79
- ## Verify
80
- muonroi-cli doctor
81
- # Checks runtimes, catalog load, keychain, MCP servers enabled, council research MCP nudge, EE reachability, recent error rate.
82
- # Any "warn" entries tell you exactly what to enable (e.g. tavily for web research in council).
83
-
84
- For BB-aware scaffolding (/ideal on a muonroi-building-block target): ensure dotnet SDK + the three Muonroi.*.Template packages are installed via NuGet; doctor surfaces missing feed/template cases.
9
+ export const SETUP_GUIDE_TEXT = `# muonroi-cli Setup Guide
10
+
11
+ ## Install (Recommended NPM/Bun global install)
12
+ NPM (requires Node >= 20):
13
+ npm install -g muonroi-cli
14
+
15
+ Bun (requires Bun >= 1.3):
16
+ bun add -g muonroi-cli
17
+
18
+ ## Install (Alternative — Prebuilt standalone binary, requires repo access)
19
+ Linux / macOS:
20
+ curl -fsSL https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.sh | bash
21
+
22
+ Windows PowerShell:
23
+ irm https://raw.githubusercontent.com/muonroi/muonroi-cli/master/install.ps1 | iex
24
+
25
+ The installers fetch a pre-compiled single binary from GitHub Releases.
26
+
27
+ ## First run
28
+ - Wizard appears automatically.
29
+ - Lists supported providers (DeepSeek + SiliconFlow ready; others via BYOK).
30
+ - Four credential options: paste key, Bitwarden sync (B in /providers), keys export/import (encrypted bundle), or skip for later.
31
+ - Keys land in OS keychain (keytar). Settings written to ~/.muonroi-cli/user-settings.json.
32
+ - Role routing (leader/implement/verify/research) is configured for you.
33
+
34
+ After setup: run \`muonroi-cli doctor\` to validate.
35
+
36
+ ## Essential commands
37
+ - Interactive TUI: \`muonroi-cli\` (or \`node dist/index.js\` after build)
38
+ - Headless one-shot: \`muonroi-cli --prompt "your task" --max-tool-rounds 8\`
39
+ - Health + MCP nudge: \`muonroi-cli doctor\`
40
+ - Update: \`muonroi-cli update\` (or set "autoUpdate": true in user-settings)
41
+ - Keys move between machines: \`muonroi-cli keys export file.json\` then import on target
42
+ - Native tools MCP (for external agents): \`muonroi-cli tools-mcp\` (stdio)
43
+ - Harness driver MCP: \`muonroi-cli mcp-driver\`
44
+
45
+ ## MCP integration (for Claude Desktop, Cursor, other agents)
46
+ Add to your MCP client config:
47
+
48
+ {
49
+ "mcpServers": {
50
+ "muonroi-tools": {
51
+ "command": "bun",
52
+ "args": ["run", "/absolute/path/to/muonroi-cli/src/index.ts", "tools-mcp"]
53
+ }
54
+ }
55
+ }
56
+
57
+ (Use absolute path. After \`bun run build\`: "node", "dist/index.js", "tools-mcp")
58
+
59
+ The CLI's OWN inner agent exposes these as NATIVE in-process tools (no MCP self-spawn):
60
+ - setup_guide (this document)
61
+ - ee_query / ee_health / ee_feedback Experience Engine semantic recall + compaction checkpoints + feedback for learning
62
+ - usage_forensics <id-prefix> per-session cost/token forensics (peak input, cache hits, anomalies)
63
+ - lsp_querygoToDefinition, findReferences, hover, symbols, call hierarchy etc.
64
+ - selfverify_* — Tier-1 heuristic + Tier-2 agentic self-QA harness runs (start/poll/result/cancel/list)
65
+
66
+ For BB/.NET template recipes and package docs, also connect an external "muonroi-docs" MCP server if available (provides docs_search + setup_guide for the templates).
67
+
68
+ ## Development
69
+ git clone https://github.com/muonroi/muonroi-cli.git
70
+ cd muonroi-cli && bun install
71
+
72
+ bun run dev # run from source (TUI)
73
+ bun run typecheck # tsc --noEmit
74
+ bun run test # vitest (unit + headless)
75
+ bunx vitest -c vitest.harness.config.ts run tests/harness/ # TUI E2E (named-pipes on Win, fd3/4 on POSIX)
76
+ bun run build # or build:binary for standalone exe
77
+
78
+ See AGENTS.md (quick ref + rules), CLAUDE.md (harness verification), README.md.
79
+
80
+ ## Verify
81
+ muonroi-cli doctor
82
+ # Checks runtimes, catalog load, keychain, MCP servers enabled, council research MCP nudge, EE reachability, recent error rate.
83
+ # Any "warn" entries tell you exactly what to enable (e.g. tavily for web research in council).
84
+
85
+ For BB-aware scaffolding (/ideal on a muonroi-building-block target): ensure dotnet SDK + the three Muonroi.*.Template packages are installed via NuGet; doctor surfaces missing feed/template cases.
85
86
  `;
86
87
  //# sourceMappingURL=setup-guide-text.js.map
@@ -169,9 +169,9 @@ async function checkBrainEmptiness() {
169
169
  // Count ee_injection events with event_subtype='no_match' in last 30 days
170
170
  const cutoff = new Date(Date.now() - 30 * 86_400_000).toISOString();
171
171
  const row = db
172
- .prepare(`SELECT COUNT(*) as cnt FROM interaction_logs
173
- WHERE event_type = 'ee_injection'
174
- AND event_subtype = 'no_match'
172
+ .prepare(`SELECT COUNT(*) as cnt FROM interaction_logs
173
+ WHERE event_type = 'ee_injection'
174
+ AND event_subtype = 'no_match'
175
175
  AND created_at >= ?`)
176
176
  .get(cutoff);
177
177
  const noMatchCount = row?.cnt ?? 0;
@@ -293,10 +293,10 @@ async function checkCouncilMcpNudge() {
293
293
  // 2. Query DB for [Council Memory] records with URL or research topics
294
294
  const db = getDatabase();
295
295
  const rows = db
296
- .prepare(`SELECT message_json FROM messages
297
- WHERE role = 'system'
298
- AND message_json LIKE '%[Council Memory]%'
299
- ORDER BY created_at DESC
296
+ .prepare(`SELECT message_json FROM messages
297
+ WHERE role = 'system'
298
+ AND message_json LIKE '%[Council Memory]%'
299
+ ORDER BY created_at DESC
300
300
  LIMIT 50`)
301
301
  .all();
302
302
  let qualifyingCount = 0;