clew-code 0.2.21 → 0.2.22

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 (66) hide show
  1. package/dist/main.js +1861 -1856
  2. package/docs/architecture.html +91 -148
  3. package/docs/assets/clew-agent-loop.png +0 -0
  4. package/docs/assets/clew-general-architecture.png +0 -0
  5. package/docs/assets/clew-mcp-architecture.png +0 -0
  6. package/docs/assets/clew-p2p-swarm.png +0 -0
  7. package/docs/changelog.html +150 -0
  8. package/docs/cli-reference.html +90 -0
  9. package/docs/commands.html +156 -265
  10. package/docs/configuration.html +85 -147
  11. package/docs/contributing.html +91 -0
  12. package/docs/css/styles.css +425 -425
  13. package/docs/daemon.html +62 -129
  14. package/docs/features/bridge-mode.html +61 -66
  15. package/docs/features/evals.html +57 -149
  16. package/docs/features/searxng-search.html +58 -118
  17. package/docs/features/sentry-setup.html +61 -124
  18. package/docs/index.html +137 -125
  19. package/docs/installation.html +77 -105
  20. package/docs/internals/growthbook-ab-testing.html +69 -91
  21. package/docs/internals/hidden-features.html +81 -143
  22. package/docs/js/main.js +29 -0
  23. package/docs/loop.html +69 -181
  24. package/docs/mcp.html +99 -247
  25. package/docs/models.html +69 -110
  26. package/docs/permission-model.html +86 -102
  27. package/docs/plugins.html +84 -102
  28. package/docs/providers.html +87 -127
  29. package/docs/quick-start.html +81 -93
  30. package/docs/research-memory.html +71 -102
  31. package/docs/security.html +71 -0
  32. package/docs/skills.html +67 -117
  33. package/docs/swarm.html +78 -236
  34. package/docs/tools.html +152 -151
  35. package/docs/troubleshooting.html +86 -106
  36. package/docs/voice-mode.html +79 -0
  37. package/package.json +1 -1
  38. package/docs/architecture.th.html +0 -79
  39. package/docs/clew-code-architecture.html +0 -1126
  40. package/docs/commands.th.html +0 -269
  41. package/docs/configuration.th.html +0 -108
  42. package/docs/daemon.th.html +0 -73
  43. package/docs/features/bridge-mode.th.html +0 -62
  44. package/docs/features/evals.th.html +0 -62
  45. package/docs/features/searxng-search.th.html +0 -67
  46. package/docs/features/sentry-setup.th.html +0 -69
  47. package/docs/features/swarm.html +0 -156
  48. package/docs/generated/providers.html +0 -625
  49. package/docs/generated/tools.html +0 -558
  50. package/docs/index.th.html +0 -292
  51. package/docs/installation.th.html +0 -105
  52. package/docs/internals/growthbook-ab-testing.th.html +0 -60
  53. package/docs/internals/hidden-features.th.html +0 -107
  54. package/docs/loop.th.html +0 -227
  55. package/docs/mcp.th.html +0 -207
  56. package/docs/models.th.html +0 -61
  57. package/docs/permission-model.th.html +0 -67
  58. package/docs/plugins.th.html +0 -79
  59. package/docs/prompts-and-features.html +0 -806
  60. package/docs/providers.th.html +0 -81
  61. package/docs/quick-start.th.html +0 -89
  62. package/docs/research-memory.th.html +0 -72
  63. package/docs/skills.th.html +0 -90
  64. package/docs/swarm.th.html +0 -280
  65. package/docs/tools.th.html +0 -84
  66. package/docs/troubleshooting.th.html +0 -85
@@ -1,148 +1,91 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Architecture — Clew</title>
7
- <meta name="description" content="Runtime architecture, layered design, and data flow for Clew CLI.">
8
- <link rel="preconnect" href="https://fonts.googleapis.com">
9
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
- <link rel="stylesheet" href="css/styles.css">
12
- <link rel="icon" type="image/svg+xml" href="./assets/clew.svg">
13
- </head>
14
- <body>
15
- <header class="header"></header>
16
- <div class="app"><aside class="sidebar" id="sidebar"></aside><div class="sidebar-overlay" id="sidebarOverlay"></div>
17
- <div class="content-wrap"><main class="content">
18
- <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span>Architecture</span></div>
19
- <h1>Architecture</h1>
20
- <p class="section-subtitle">Clew is a terminal-based AI coding assistant — a React/Ink TUI, Commander.js CLI, multi-provider AI engine, and extensible tool/plugin runtime all in one process.</p>
21
-
22
- <h2>Layered Design</h2>
23
- <p>The application is structured as four cooperative layers:</p>
24
-
25
- <h3>1. Terminal UI (React 19 + Ink 6)</h3>
26
- <p>Renders the interactive REPL: prompt input, streaming markdown output, status bar with context meter, arc spinner, permission dialogs, file explorer, inline images, buddy (duck) companion, and fullscreen mode. Components live in <code>src/components/</code>, state management in <code>src/state/</code>, and React context in <code>src/context/</code>.</p>
27
-
28
- <h3>2. CLI &amp; Command Layer (Commander.js 13)</h3>
29
- <p>Entry point at <code>src/main.tsx</code> — parses CLI flags (<code>--model</code>, <code>--print</code>, <code>--permission-mode</code>, <code>--mcp-config</code>, etc.), loads config, initializes providers and telemetry, then launches the REPL or print-mode query. Slash commands are registered in <code>src/commands.ts</code> and implemented under <code>src/commands/</code>. Commands are categorized as <code>local</code> (runs in-terminal), <code>prompt</code> (skills that expand to text), or <code>local-jsx</code> (Ink UI panels).</p>
30
-
31
- <h3>3. AI Provider &amp; Adapter Layer</h3>
32
- <p><strong>ProviderManager</strong> (<code>src/services/ai/ProviderManager.ts</code>) resolves API keys, selects models, and manages provider config. Provider metadata is declared in <code>src/services/ai/providers.json</code> — currently <strong>29 providers</strong> (10 dedicated classes + 18 OpenAI-compatible) with model listings, capabilities, base URLs, and env key mappings. Non-Anthropic providers are wrapped by the <strong>AnthropicAdapter</strong> or <strong>GoogleAdapter</strong>, which normalize content blocks (<code>contentBlockUtils.ts</code>), tool calls (<code>toolCallParser.ts</code>), errors (<code>errorNormalizer.ts</code>), and usage (<code>usageNormalizer.ts</code>) to a uniform format.</p>
33
-
34
- <h3>4. Tool Execution &amp; Query Loop</h3>
35
- <p>Tools use Zod schemas and are executed by the <strong>StreamingToolExecutor</strong> (<code>src/services/tools/StreamingToolExecutor.ts</code>). Permission gating via hooks in <code>src/utils/permissions/permissions.ts</code>. The query loop in <code>src/query.ts</code> + <code>src/QueryEngine.ts</code> orchestrates message building, context management, streaming, and tool call cycling. MCP tools (<code>src/services/mcp/</code>) are discovered at runtime and merged into the tool pool.</p>
36
-
37
- <h2>Data Flow</h2>
38
- <pre><code> Terminal input
39
- |
40
- v
41
- + Query Engine (query.ts + QueryEngine.ts)
42
- | Message building and context assembly
43
- | Tool call loop (model tool results)
44
- | Streaming response handling
45
- |
46
- + Provider Manager Adapter AI Model API
47
- | 29 providers via providers.json
48
- | AnthropicAdapter / GoogleAdapter normalization
49
- |
50
- + Tool Executor (StreamingToolExecutor)
51
- | Permission check (permissions.ts)
52
- | Pre/Post tool hooks (plugins)
53
- | Tool execution result
54
- |
55
- + Terminal UI (React/Ink)
56
- Streaming text and tool renders
57
- Status bar, spinner, context meter
58
- Permission dialogs</code></pre>
59
-
60
- <h2>Key Subsystems</h2>
61
-
62
- <h3>MCP (Model Context Protocol)</h3>
63
- <p><code>src/services/mcp/</code> — manages external MCP server connections, tool discovery, resource access, and paginated <code>tools/list</code> responses. Servers configured via <code>--mcp-config</code> or <code>/mcp</code> command. See <a href="mcp.html">MCP</a> for detailed setup and configuration.</p>
64
-
65
- <h3>Plugins &amp; Hooks</h3>
66
- <p><code>src/services/plugins/</code> — plugin loading, installation, marketplace reconciliation, and hook dispatch. Hook points: <code>PreToolUse</code>, <code>PostToolUse</code>, <code>PreBash</code>, <code>PostPrompt</code>, <code>PreAcceptEdit</code>. Plugins can provide commands, agents, skills, MCP servers, and LSP integrations.</p>
67
-
68
- <h3>LSP (Language Server Protocol)</h3>
69
- <p><code>src/services/lsp/</code> — language-aware code intelligence via LSP servers. Diagnostics, completions, and symbol navigation. Enable with <code>ENABLE_LSP_TOOL=1</code>.</p>
70
-
71
- <h3>Bridge Mode</h3>
72
- <p><code>src/bridge/bridgeMain.ts</code> WebSocket remote control and collaboration. Gated behind <code>BRIDGE_MODE=1</code>. Remote clients can send commands and receive responses.</p>
73
-
74
- <h3>Session System</h3>
75
- <p><code>src/services/SessionLifecycle/</code> — cross-session context persistence. <code>src/services/SessionMemory/</code> — persistent knowledge with cross-lingual semantic search and auto-memory capture.</p>
76
-
77
- <h3>GrowthBook Feature Flags</h3>
78
- <p><code>src/services/analytics/growthbook.js</code> — A/B testing and feature flag platform. Initialized at startup, evaluates flags locally with caching.</p>
79
-
80
- <h3>Agent Runtime</h3>
81
- <p><code>src/agentRuntime/</code> — manages multi-agent orchestration. The <strong>orchestrator</strong> coordinates agent sessions, <strong>runStore</strong> persists agent run data, <strong>toolGateway</strong> routes tools between agents, and <strong>workflowRegistry</strong> / <strong>agentRegistry</strong> declare named workflows and agent configurations.</p>
82
-
83
- <h3>Autonomous / Daemon</h3>
84
- <p><code>src/services/autonomous/</code> — enables 24/7 background execution. The <strong>taskQueue</strong> is a file-backed queue with priorities, leases, and dead-letter handling. <strong>agentLoop</strong> runs the continuous dequeue spawn worker monitor retry cycle. <strong>daemonMode</strong> provides the supervisor-managed background process entry point, and <strong>supervisorIntegration</strong> handles health checks and auto-respawn. See <a href="daemon.html">Daemon Mode</a> for detailed configuration and usage.</p>
85
-
86
- <h3>Coordinator (Multi-Agent)</h3>
87
- <p><code>src/coordinator/</code> — supports multi-agent collaboration. <strong>coordinatorMode</strong> delegates tasks to sub-agents, and <strong>workerAgent</strong> provides standalone workers for delegated subtasks.</p>
88
-
89
- <h3>Memory</h3>
90
- <p><code>src/memory/</code> — local embedding-free memory with SQLite FTS5 full-text search. Token-aware chunking (3000 tokens), truth priority scoring, secret redaction, and auto-ingest from <code>.clew/memory/</code>. See <a href="research-memory.html">Memory</a> for detailed usage.</p>
91
-
92
- <h3>Voice Mode</h3>
93
- <p><code>src/voice/</code> — compile-time gated voice input support (<code>VOICE_MODE=1</code>). Provides speech-to-text and voice command processing for hands-free operation.</p>
94
-
95
- <h3>State Management</h3>
96
- <p>The app uses a lightweight observable store pattern (<code>createStore&lt;T&gt;</code> in <code>src/state/store.ts</code>). Stores are plain functions with <code>getState</code>, <code>setState</code>, and <code>subscribe</code>. React components subscribe via the <strong>AppState</strong> React context (<code>src/state/AppState.tsx</code>).</p>
97
-
98
- <h2>Important Source Paths</h2>
99
- <table>
100
- <tr><th>Path</th><th>Role</th></tr>
101
- <tr><td><code>src/main.tsx</code></td><td>CLI entry, Commander program, option parsing, REPL launch</td></tr>
102
- <tr><td><code>src/query.ts</code></td><td>Core query processing, message building, tool call loop</td></tr>
103
- <tr><td><code>src/QueryEngine.ts</code></td><td>Query orchestration, caching, deduplication, rate limiting</td></tr>
104
- <tr><td><code>src/commands.ts</code></td><td>Slash command registry (80+ commands)</td></tr>
105
- <tr><td><code>src/tools.ts</code></td><td>Tool registry (40+ built-in tools)</td></tr>
106
- <tr><td><code>src/Tool.ts</code></td><td>Base tool types, schemas, buildTool() helper</td></tr>
107
- <tr><td><code>src/services/ai/ProviderManager.ts</code></td><td>Provider selection, API key resolution</td></tr>
108
- <tr><td><code>src/services/ai/providers.json</code></td><td>Declarative provider config (29 providers)</td></tr>
109
- <tr><td><code>src/services/ai/adapter/</code></td><td>AnthropicAdapter, GoogleAdapter</td></tr>
110
- <tr><td><code>src/services/tools/StreamingToolExecutor.ts</code></td><td>Streaming tool execution</td></tr>
111
- <tr><td><code>src/utils/permissions/permissions.ts</code></td><td>Permission evaluation logic</td></tr>
112
- <tr><td><code>src/services/mcp/</code></td><td>MCP server management</td></tr>
113
- <tr><td><code>src/services/plugins/</code></td><td>Plugin loader and hook dispatch</td></tr>
114
- <tr><td><code>src/state/store.ts</code></td><td>Lightweight observable store (createStore&lt;T&gt;)</td></tr>
115
- <tr><td><code>src/state/AppState.tsx</code></td><td>Root app state (React context)</td></tr>
116
- <tr><td><code>src/state/AppStateStore.ts</code></td><td>App state store implementation</td></tr>
117
- <tr><td><code>src/state/selectors.ts</code></td><td>State selectors</td></tr>
118
- <tr><td><code>src/agentRuntime/</code></td><td>Agent orchestration, run store, tool gateway</td></tr>
119
- <tr><td><code>src/services/autonomous/</code></td><td>Task queue, agent loop, daemon mode, supervisor</td></tr>
120
- <tr><td><code>src/coordinator/</code></td><td>Multi-agent coordinator and worker agents</td></tr>
121
- <tr><td><code>src/research/</code></td><td>Deep research, dossier generation, truth checking</td></tr>
122
- <tr><td><code>src/memory/</code></td><td>SQLite FTS5 memory search (14 files)</td></tr>
123
- <tr><td><code>src/voice/</code></td><td>Voice mode support (compile-time gated)</td></tr>
124
- <tr><td><code>src/entrypoints/init.ts</code></td><td>Startup initialization (Sentry, configs, telemetry)</td></tr>
125
- <tr><td><code>src/entrypoints/cli.tsx</code></td><td>Alternative CLI entry point (Commander-based)</td></tr>
126
- <tr><td><code>src/entrypoints/mcp.ts</code></td><td>MCP server entry point</td></tr>
127
- </table>
128
-
129
- <h2>Build System</h2>
130
- <p>Built with Bun bundler — <code>bun run build</code> outputs a single binary to <code>dist/</code>. TypeScript with strict mode and ESM/NodeNext module resolution. External dependencies include Electron, chromium-bidi, AWS SDK, Google Auth, and platform-specific native modules. Lint/format via Biome 2.4.</p>
131
-
132
- <footer class="footer">
133
- <span>Clew Code 0.2.14 — Open Source</span>
134
- <div class="footer-links">
135
- <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
136
- <a href="https://github.com/ClewCode/ClewCode/issues">Issues</a>
137
- </div>
138
- </footer>
139
- </main>
140
- <nav class="toc-sidebar"></nav>
141
- </div>
142
- </div>
143
- <script src="js/main.js"></script>
144
- </body>
145
- </html>
146
- dy>
147
- </html>
148
-
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Architecture — Clew Code</title>
7
+ <meta name="description" href="Codebase architecture of Clew Code.">
8
+ <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
+ <link rel="stylesheet" href="css/styles.css">
12
+ </head>
13
+ <body>
14
+ <header class="header"></header>
15
+ <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
+ <aside id="sidebar" class="sidebar"></aside>
17
+
18
+ <div class="content-wrap">
19
+ <div class="content">
20
+
21
+ <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">Architecture</span></div>
22
+
23
+ <h1>Architecture</h1>
24
+ <p class="sub">Clew Code is a single-entry Bun bundle built with TypeScript (ESM, strict mode).</p>
25
+
26
+ <h2 id="layers">Layer Overview</h2>
27
+ <p>The architecture is layered: CLI entrypoint → Orchestrator → Context/Tools/Policy/Provider → Session logger.</p>
28
+
29
+ <pre><code>CLI (parseArgs)
30
+
31
+ Orchestrator (Agent loop)
32
+
33
+ Context ── Tools ── Policy ── Provider
34
+
35
+ Session Logger
36
+ </code></pre>
37
+
38
+ <h2 id="sourcelayout">Source Layout</h2>
39
+ <pre><code>src/
40
+ ├── main.tsx # Entry point
41
+ ├── query.ts / QueryEngine.ts
42
+ ├── agentRuntime/ # Background agent orchestration
43
+ ├── commands/ # Slash command implementations
44
+ ├── tools/ # 50+ built-in tools
45
+ ├── services/
46
+ │ ├── ai/ # Provider manager + 27 providers
47
+ │ ├── mcp/ # MCP client + auth + transports
48
+ │ ├── plugins/ # Plugin hooks + marketplace
49
+ │ ├── autonomous/ # Agent loop + task queue + cron
50
+ │ ├── lsp/ # LSP integration
51
+ │ └── Supervisor/ # Agent supervisor IPC
52
+ ├── mesh/ # MeshServer + MeshDiscovery
53
+ ├── bridge/ # WebSocket bridge + relay
54
+ ├── components/ # Ink terminal UI components
55
+ ├── state/ # AppState management
56
+ └── hooks/ # React hooks
57
+ </code></pre>
58
+
59
+ <h2 id="execution-layers">Execution Layers</h2>
60
+ <p>Clew Code has several agent execution layers:</p>
61
+
62
+ <table>
63
+ <thead>
64
+ <tr><th>Layer</th><th>Duration</th><th>Use Case</th></tr>
65
+ </thead>
66
+ <tbody>
67
+ <tr><td>Agent</td><td>Session-long</td><td>Main chat, custom agents in <code>.clew/agents/*.md</code></td></tr>
68
+ <tr><td>Subagent</td><td>One-shot</td><td>Explore codebase, test triage, review</td></tr>
69
+ <tr><td>Teammate/Swarm</td><td>Multi-turn</td><td>Coordinated long-running agent teams</td></tr>
70
+ <tr><td>LAN Mesh</td><td>Persistent</td><td>Cross-machine coordination via <code>/mesh</code></td></tr>
71
+ <tr><td>Process Mesh</td><td>One-shot</td><td>External CLI workers (Codex exec/pty)</td></tr>
72
+ <tr><td>ACP</td><td>External</td><td>Editor/IDE/agent Clew protocol boundary</td></tr>
73
+ </tbody>
74
+ </table>
75
+
76
+ <h2 id="key-concepts">Key Concepts</h2>
77
+
78
+ <h3>Multi-Pass Compaction</h3>
79
+ <p>Automatic chunk-based context compression with recursive re-compaction when context exceeds the model window. Trigger manually with <code>/compact</code>.</p>
80
+
81
+ <h3>Plan Mode</h3>
82
+ <p>Full-access planning mode with bypass permissions. Plans persist to <code>.clew/plans/</code> with progress snapshots.</p>
83
+
84
+ <h3>Provider Manager</h3>
85
+ <p>The ProviderManager routes all LLM calls through a unified interface. Each provider has an adapter that normalizes requests and responses. The provider can be switched mid-session via <code>/model</code>.</p>
86
+ </div>
87
+ </div>
88
+
89
+ <script src="js/main.js"></script>
90
+ </body>
91
+ </html>
Binary file
Binary file
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Changelog — Clew Code</title>
7
+ <meta name="description" content="Release history and changelog for Clew Code.">
8
+ <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
+ <link rel="stylesheet" href="css/styles.css">
12
+ </head>
13
+ <body>
14
+ <header class="header"></header>
15
+ <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
+ <aside id="sidebar" class="sidebar"></aside>
17
+
18
+ <div class="content-wrap">
19
+ <div class="content">
20
+
21
+ <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">Changelog</span></div>
22
+
23
+ <h1>Changelog</h1>
24
+
25
+ <h2 id="0.2.21">v0.2.21 — 2026-06-14</h2>
26
+ <h3>Fixed</h3>
27
+ <ul>
28
+ <li><strong>Detect package manager from install path</strong> — now correctly detects whether to use <code>bun</code> or <code>npm</code> based on the installation path, not the runtime.</li>
29
+ <li><strong>Polish UI rendering</strong> — fixed empty-state edge cases and visual glitches.</li>
30
+ </ul>
31
+
32
+ <h2 id="0.2.20">v0.2.20 — 2026-06-14</h2>
33
+ <h3>Fixed</h3>
34
+ <ul>
35
+ <li><strong>mesh-spawn</strong> — spawn <code>cmd.exe</code> directly with <code>/k</code> and set title inside command instead of using <code>start</code>.</li>
36
+ <li><strong>mesh-spawn cd fix</strong> — execute <code>cd</code> before running clew command to bypass cmd.exe quote stripping.</li>
37
+ </ul>
38
+
39
+ <h2 id="0.2.16">v0.2.16 — 2026-06-14</h2>
40
+ <h3>Fixed</h3>
41
+ <ul>
42
+ <li><strong>Auto-relaunch after update</strong> — <code>UpdateDialog.startInstall()</code> now spawns a detached child process immediately after install completes. No more manual restart required.</li>
43
+ </ul>
44
+
45
+ <h2 id="0.2.15">v0.2.15 — 2026-06-14</h2>
46
+ <h3>Added</h3>
47
+ <ul>
48
+ <li><strong>ACP + Mesh integration</strong> — <code>AcpMeshBoundary</code> for routing editor ACP and REST ACP through the process peer / mesh layer with <code>AbortSignal</code> and <code>onProgress</code> support.</li>
49
+ <li><strong>AcpRunController</strong> — lifecycle owner for ACP runs: creates run, wires <code>AbortController</code>, executes through mesh boundary, maps results to terminal state.</li>
50
+ <li><strong>WebSocket transport</strong> — <code>ACPWebSocketServer.ts</code> — Bun-native WebSocket server bridging remote editor connections via NDJSON stream.</li>
51
+ <li><strong>SSE streaming</strong> — <code>GET /runs/:id/stream</code> endpoint with 500ms polling and keepalive.</li>
52
+ </ul>
53
+ <h3>Changed</h3>
54
+ <ul>
55
+ <li><strong>Editor ACP shapes fixed</strong> — <code>PromptResponse</code> now returns only <code>{ stopReason }</code>, <code>sessionUpdate</code> uses <code>SessionNotification</code> shape.</li>
56
+ </ul>
57
+
58
+ <h2 id="0.2.14">v0.2.14 — 2026-06-14</h2>
59
+ <h3>Added</h3>
60
+ <ul>
61
+ <li><strong>Peer task queue system</strong> — queuing commands when busy with priority levels, auto-dequeue, SSE queue events.</li>
62
+ <li><strong>Peer health monitoring</strong> — healthy/lagging/offline states, latency tracking.</li>
63
+ <li><strong>Long-term memory system</strong> — auto-extraction, session consolidation, cross-session history, timeline queries.</li>
64
+ <li><strong>Gemini Code Assist provider</strong> — OAuth-based provider integration.</li>
65
+ <li><strong>Dashboard Monitor</strong> — real-time agent and daemon monitoring with tabbed views.</li>
66
+ </ul>
67
+ <h3>Changed</h3>
68
+ <ul>
69
+ <li><strong>peer → swarm rename</strong> — all <code>/peer</code> commands migrated to <code>/swarm</code>.</li>
70
+ </ul>
71
+
72
+ <h2 id="0.2.13">v0.2.13 — 2026-06-13</h2>
73
+ <h3>Changed</h3>
74
+ <ul>
75
+ <li>Formatting pass across codebase via Biome.</li>
76
+ <li>bun.lock synchronized with updated dependencies.</li>
77
+ </ul>
78
+
79
+ <h2 id="0.2.12">v0.2.12 — 2026-06-13</h2>
80
+ <h3>Added</h3>
81
+ <ul>
82
+ <li><strong>Provider consolidation</strong> — GoogleProvider and ClewGatewayProvider now extend OpenAICompatibleProvider, removing 679 lines of duplicated code.</li>
83
+ <li>Zod v4 migration (<code>.passthrough()</code> → <code>.loose()</code>).</li>
84
+ <li>PR command refactored to use <code>--json</code> + <code>JSON.parse</code>.</li>
85
+ </ul>
86
+
87
+ <h2 id="0.2.11">v0.2.11 — 2026-06-13</h2>
88
+ <h3>Added</h3>
89
+ <ul>
90
+ <li>Further swarm/peer system refinements.</li>
91
+ <li>Bug fixes and performance improvements.</li>
92
+ </ul>
93
+
94
+ <h2 id="0.2.7">v0.2.7 — 2026-06-11</h2>
95
+ <h3>Added</h3>
96
+ <ul>
97
+ <li><strong>process_peer PTY terminal box</strong> — terminal-style progress box with ANSI-preserving output tail.</li>
98
+ <li><strong><code>/mesh run codex &lt;task&gt;</code></strong> — one-shot Codex process peer from chat.</li>
99
+ <li><strong>Auto-update dialog</strong> — npm update notification before app starts.</li>
100
+ <li><strong>Rich model fetching</strong> — API models now carry context window, vision, tools, reasoning, free tags.</li>
101
+ <li><strong><code>/model list</code> capability tags</strong> — <code>[200K ctx, vision, tools, reason, free]</code> per model.</li>
102
+ <li><strong>Cost in status line</strong> — shows session cost when &gt;$0.</li>
103
+ </ul>
104
+
105
+ <h2 id="0.2.6">v0.2.6 — 2026-06-10</h2>
106
+ <h3>Added</h3>
107
+ <ul>
108
+ <li><strong>Peer HTTP heartbeat</strong> — 60s liveness checks, offline peers detected immediately.</li>
109
+ <li><strong><code>/agents</code> visual polish</strong> — redesigned dashboard.</li>
110
+ <li><strong>Auto-updater</strong> — switched from Anthropic GCS to npm registry.</li>
111
+ </ul>
112
+ <h3>Removed</h3>
113
+ <ul>
114
+ <li>GitHub Copilot provider and all references cleaned out.</li>
115
+ </ul>
116
+
117
+ <h2 id="0.2.5">v0.2.5 — 2026-06-10</h2>
118
+ <h3>Added</h3>
119
+ <ul>
120
+ <li><strong>Rebranded to Clew Code</strong> — docs, UI copy, and package updated.</li>
121
+ <li><strong>Memory search</strong> — <code>/memory search</code> for stored entries.</li>
122
+ <li><strong>Peer tools</strong> — 14 AI coordination tools, peer help, connection count in footer.</li>
123
+ </ul>
124
+
125
+ <h2 id="0.2.4">v0.2.4 — 2026-06-08</h2>
126
+ <h3>Added</h3>
127
+ <ul>
128
+ <li><strong>Peer-to-peer</strong> — UDP multicast discovery, file registry, 14 AI coordination tools, interactive PeerMenu.</li>
129
+ <li><strong>Autonomous agents</strong> — agent loop, supervisor integration, task queue, Loop Lock.</li>
130
+ <li><strong>Workflow Rainbow</strong> — per-character gradient highlight for "workflow" keyword.</li>
131
+ </ul>
132
+
133
+ <h2 id="0.2.3">v0.2.3 — 2026-06-07</h2>
134
+ <h3>Added</h3>
135
+ <ul>
136
+ <li><code>/effort</code> works with any provider exposing <code>reasoningEffort</code>.</li>
137
+ <li><code>/model</code> fetches live model list from provider APIs.</li>
138
+ <li>Relay server for cross-network remote control.</li>
139
+ <li>Bridge v2: provider-agnostic remote control.</li>
140
+ <li><code>/pr create/list/view/review/merge/status</code>.</li>
141
+ <li>Security: PowerShell rules, malformed tool call guard, 100 MB bash output cap.</li>
142
+ </ul>
143
+
144
+ <p><a href="https://github.com/ClewCode/ClewCode/blob/main/CHANGELOG.md">View full changelog on GitHub →</a></p>
145
+ </div>
146
+ </div>
147
+
148
+ <script src="js/main.js"></script>
149
+ </body>
150
+ </html>
@@ -0,0 +1,90 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>CLI Reference — Clew Code</title>
7
+ <meta name="description" content="Command-line interface reference for Clew Code.">
8
+ <link rel="icon" type="image/svg+xml" href="assets/clew.svg">
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
11
+ <link rel="stylesheet" href="css/styles.css">
12
+ </head>
13
+ <body>
14
+ <header class="header"></header>
15
+ <div id="sidebarOverlay" class="sidebar-overlay"></div>
16
+ <aside id="sidebar" class="sidebar"></aside>
17
+
18
+ <div class="content-wrap">
19
+ <div class="content">
20
+
21
+ <div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">CLI Reference</span></div>
22
+
23
+ <h1>CLI Reference</h1>
24
+ <p class="sub">Complete reference for Clew Code command-line flags and arguments.</p>
25
+
26
+ <h2 id="usage">Usage</h2>
27
+ <pre><code class="language-bash">clew [flags]
28
+ clew [command] [flags]
29
+ </code></pre>
30
+
31
+ <h2 id="global">Global Flags</h2>
32
+ <table>
33
+ <thead>
34
+ <tr><th>Flag</th><th>Description</th></tr>
35
+ </thead>
36
+ <tbody>
37
+ <tr><td><code>-p, --prompt &lt;text&gt;</code></td><td>One-shot mode: run a prompt in non-interactive mode and exit</td></tr>
38
+ <tr><td><code>--resume &lt;id&gt;</code></td><td>Resume a previous session by ID. Use <code>last</code> for the most recent session</td></tr>
39
+ <tr><td><code>--version</code></td><td>Print version and exit</td></tr>
40
+ <tr><td><code>--help</code></td><td>Show help message</td></tr>
41
+ </tbody>
42
+ </table>
43
+
44
+ <h2 id="exec">Exec Commands</h2>
45
+ <table>
46
+ <thead>
47
+ <tr><th>Command</th><th>Description</th></tr>
48
+ </thead>
49
+ <tbody>
50
+ <tr><td><code>clew . &lt;prompt&gt;</code></td><td>Run prompt in current directory</td></tr>
51
+ <tr><td><code>clew acp serve</code></td><td>Start ACP WebSocket server (default port: 3099)</td></tr>
52
+ </tbody>
53
+ </table>
54
+
55
+ <h2 id="env">Environment Variables</h2>
56
+ <table>
57
+ <thead>
58
+ <tr><th>Variable</th><th>Description</th></tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr><td><code>ANTHROPIC_API_KEY</code></td><td>Anthropic Claude API key</td></tr>
62
+ <tr><td><code>OPENAI_API_KEY</code></td><td>OpenAI API key</td></tr>
63
+ <tr><td><code>GOOGLE_API_KEY</code></td><td>Google Gemini API key</td></tr>
64
+ <tr><td><code>DEEPSEEK_API_KEY</code></td><td>DeepSeek API key</td></tr>
65
+ <tr><td><code>GROQ_API_KEY</code></td><td>Groq API key</td></tr>
66
+ <tr><td><code>MISTRAL_API_KEY</code></td><td>Mistral API key</td></tr>
67
+ <tr><td><code>OPENROUTER_API_KEY</code></td><td>OpenRouter API key</td></tr>
68
+ <tr><td><code>OLLAMA_HOST</code></td><td>Ollama server URL (default: http://localhost:11434)</td></tr>
69
+ <tr><td><code>SEARXNG_URL</code></td><td>SearXNG instance URL</td></tr>
70
+ <tr><td><code>SENTRY_DSN</code></td><td>Sentry DSN for error tracking</td></tr>
71
+ <tr><td><code>GROWTHBOOK_API_KEY</code></td><td>GrowthBook API key for feature flags</td></tr>
72
+ </tbody>
73
+ </table>
74
+
75
+ <h2 id="exit-codes">Exit Codes</h2>
76
+ <table>
77
+ <thead>
78
+ <tr><th>Code</th><th>Meaning</th></tr>
79
+ </thead>
80
+ <tbody>
81
+ <tr><td><code>0</code></td><td>Success</td></tr>
82
+ <tr><td><code>1</code></td><td>General error</td></tr>
83
+ </tbody>
84
+ </table>
85
+ </div>
86
+ </div>
87
+
88
+ <script src="js/main.js"></script>
89
+ </body>
90
+ </html>