clew-code 0.2.21 → 0.2.23

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 (67) hide show
  1. package/README.md +45 -45
  2. package/dist/main.js +2906 -2722
  3. package/docs/architecture.html +91 -148
  4. package/docs/assets/clew-agent-loop.png +0 -0
  5. package/docs/assets/clew-general-architecture.png +0 -0
  6. package/docs/assets/clew-mcp-architecture.png +0 -0
  7. package/docs/assets/clew-p2p-swarm.png +0 -0
  8. package/docs/changelog.html +150 -0
  9. package/docs/cli-reference.html +90 -0
  10. package/docs/commands.html +133 -241
  11. package/docs/configuration.html +85 -147
  12. package/docs/contributing.html +91 -0
  13. package/docs/css/styles.css +272 -152
  14. package/docs/daemon.html +62 -129
  15. package/docs/features/bridge-mode.html +61 -66
  16. package/docs/features/evals.html +57 -149
  17. package/docs/features/searxng-search.html +58 -118
  18. package/docs/features/sentry-setup.html +61 -124
  19. package/docs/index.html +185 -148
  20. package/docs/installation.html +77 -105
  21. package/docs/internals/growthbook-ab-testing.html +69 -91
  22. package/docs/internals/hidden-features.html +81 -143
  23. package/docs/js/main.js +29 -0
  24. package/docs/loop.html +69 -181
  25. package/docs/mcp.html +99 -247
  26. package/docs/models.html +63 -92
  27. package/docs/permission-model.html +86 -102
  28. package/docs/plugins.html +84 -102
  29. package/docs/providers.html +87 -127
  30. package/docs/quick-start.html +81 -93
  31. package/docs/research-memory.html +71 -102
  32. package/docs/security.html +71 -0
  33. package/docs/skills.html +67 -117
  34. package/docs/swarm.html +78 -236
  35. package/docs/tools.html +183 -171
  36. package/docs/troubleshooting.html +86 -106
  37. package/docs/voice-mode.html +79 -0
  38. package/package.json +1 -1
  39. package/docs/architecture.th.html +0 -79
  40. package/docs/clew-code-architecture.html +0 -1126
  41. package/docs/commands.th.html +0 -269
  42. package/docs/configuration.th.html +0 -108
  43. package/docs/daemon.th.html +0 -73
  44. package/docs/features/bridge-mode.th.html +0 -62
  45. package/docs/features/evals.th.html +0 -62
  46. package/docs/features/searxng-search.th.html +0 -67
  47. package/docs/features/sentry-setup.th.html +0 -69
  48. package/docs/features/swarm.html +0 -156
  49. package/docs/generated/providers.html +0 -625
  50. package/docs/generated/tools.html +0 -558
  51. package/docs/index.th.html +0 -292
  52. package/docs/installation.th.html +0 -105
  53. package/docs/internals/growthbook-ab-testing.th.html +0 -60
  54. package/docs/internals/hidden-features.th.html +0 -107
  55. package/docs/loop.th.html +0 -227
  56. package/docs/mcp.th.html +0 -207
  57. package/docs/models.th.html +0 -61
  58. package/docs/permission-model.th.html +0 -67
  59. package/docs/plugins.th.html +0 -79
  60. package/docs/prompts-and-features.html +0 -806
  61. package/docs/providers.th.html +0 -81
  62. package/docs/quick-start.th.html +0 -89
  63. package/docs/research-memory.th.html +0 -72
  64. package/docs/skills.th.html +0 -90
  65. package/docs/swarm.th.html +0 -280
  66. package/docs/tools.th.html +0 -84
  67. package/docs/troubleshooting.th.html +0 -85
package/docs/tools.html CHANGED
@@ -1,171 +1,183 @@
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>Tools — Clew</title>
7
- <meta name="description" content="Complete reference for built-in tools in Clew — file operations, shell, search, agents, MCP, and automation.">
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>Tools</span></div>
19
- <h1>Tools</h1>
20
- <p class="section-subtitle">Clew provides <strong>76+ built-in tools</strong> (353 files across 76 directories) plus dynamically loaded MCP tools. Tools are invoked by the AI model via <code>tool_use</code> blocks and executed through the <strong>StreamingToolExecutor</strong> with permission gating. The base tool type is defined in <code>src/Tool.ts</code> (782 lines) and tools are registered in <code>src/tools.ts</code>.</p>
21
-
22
- <h2>How Tools Work</h2>
23
- <p>Tools are defined with Zod schemas in <code>src/Tool.ts</code> via the <code>buildTool()</code> helper and registered in <code>src/tools.ts</code>. Each tool declares its input schema, output schema, concurrency safety, read-only status, and permission requirements.</p>
24
-
25
- <pre><code>Model emits tool_use
26
- Tool call normalization (toolCallParser.ts)
27
- Permission check (permissions.ts)
28
- PreToolUse hooks (plugins)
29
- Tool execution (StreamingToolExecutor)
30
- PostToolUse hooks (plugins)
31
- Result returned as tool_result
32
- Query loop continues</code></pre>
33
-
34
- <h2>File &amp; Code Operations</h2>
35
- <table>
36
- <tr><th>Tool</th><th>Description</th><th>Schemas</th></tr>
37
- <tr><td><code>Read</code> (FileReadTool)</td><td>Read files with line numbers, supports images, PDFs, Jupyter notebooks</td><td>Zod</td></tr>
38
- <tr><td><code>Write</code> (FileWriteTool)</td><td>Create new files with full content</td><td>Zod</td></tr>
39
- <tr><td><code>Edit</code> (FileEditTool)</td><td>Exact string replacement edits (surgical, diff-based)</td><td>Zod</td></tr>
40
- <tr><td><code>Glob</code> (GlobTool)</td><td>Fast file pattern matching, sorted by modification time</td><td>Zod</td></tr>
41
- <tr><td><code>Grep</code> (GrepTool)</td><td>Regex content search with context lines and multiline support</td><td>Zod</td></tr>
42
- <tr><td><code>NotebookEdit</code> (NotebookEditTool)</td><td>Edit Jupyter notebook cells (replace, insert, delete)</td><td>Zod</td></tr>
43
- <tr><td><code>JsonPath</code> (JsonPathTool)</td><td>Query, validate, format, and transform JSON data</td><td>Zod</td></tr>
44
- </table>
45
-
46
- <h2>Shell &amp; System</h2>
47
- <table>
48
- <tr><th>Tool</th><th>Description</th></tr>
49
- <tr><td><code>Bash</code> (BashTool)</td><td>Execute shell commands with timeout, background, sandbox support, and permission gating</td></tr>
50
- <tr><td><code>PowerShell</code> (PowerShellTool)</td><td>PowerShell execution on Windows (feature-gated)</td></tr>
51
- <tr><td><code>Monitor</code> (MonitorTool)</td><td>Stream stdout/stderr from background tasks in real-time</td></tr>
52
- <tr><td><code>TaskOutput</code> (TaskOutputTool)</td><td>Get output from running or completed tasks</td></tr>
53
- <tr><td><code>TaskStop</code> (TaskStopTool)</td><td>Stop running background tasks</td></tr>
54
- </table>
55
-
56
- <h2>Search &amp; Web</h2>
57
- <table>
58
- <tr><th>Tool</th><th>Description</th></tr>
59
- <tr><td><code>WebSearch</code> (WebSearchTool)</td><td>Multi-provider web search (Tavily, Brave, Serper, SearXNG, DuckDuckGo)</td></tr>
60
- <tr><td><code>WebFetch</code> (WebFetchTool)</td><td>Fetch and analyze content from specific URLs</td></tr>
61
- <tr><td><code>SessionSearch</code> (SessionSearchTool)</td><td>Full-text search across past session transcripts</td></tr>
62
- <tr><td><code> <tr><td><code>ToolSearch</code> (ToolSearchTool)</td><td>Keyword search for deferred/lazy-loaded tools</td></tr>
63
- </table>
64
-
65
- <h2>Browser &amp; Automation</h2>
66
- <table>
67
- <tr><th>Tool</th><th>Description</th></tr>
68
- <tr><td><code>Browser</code> (BrowserTool)</td><td>Stealth Playwright browser — navigate, click, type, screenshot, extract, fill forms, tab management (list_tabs, close_tab, switch_tab)</td></tr>
69
- <tr><td><code>ComputerUse</code> (ComputerUseTool)</td><td>Windows-only computer use automation (feature-gated: ENABLE_COMPUTER_USE)</td></tr>
70
- <tr><td><code>BrowserAgent</code> (BrowserAgentTool)</td><td>Autonomous web agent with vision (screenshot) and text (accessibility tree) modes via Playwright. Multi-step AI planning, anti-bot stealth, CAPTCHA detection, tab management.</td></tr>
71
- </table>
72
-
73
- <h2>Agent &amp; Task Management</h2>
74
- <table>
75
- <tr><th>Tool</th><th>Description</th></tr>
76
- <tr><td><code>Skill</code> (SkillTool)</td><td>Invoke skills and prompt-type commands by name</td></tr>
77
- <tr><td><code>AskUserQuestion</code> (AskUserQuestionTool)</td><td>Ask the user interactive questions during execution</td></tr>
78
- <tr><td><code>SendMessage</code> (SendMessageTool)</td><td>Send messages between agents in coordinator mode</td></tr>
79
- <tr><td><code>EnterPlanMode</code> (EnterPlanModeTool)</td><td>Enter structured plan mode for complex tasks</td></tr>
80
- <tr><td><code>ExitPlanMode</code> (ExitPlanModeV2Tool)</td><td>Exit plan mode and proceed with implementation</td></tr>
81
- <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Create/exit isolated git worktrees (feature-gated)</td></tr>
82
- <tr><td><code>TaskCreate / TaskGet / TaskUpdate / TaskList</code></td><td>Structured task tracking (V2 todo system)</td></tr>
83
- <tr><td><code>TodoWrite</code> (TodoWriteTool)</td><td>Write todo items for task tracking</td></tr>
84
- <tr><td><code>Config</code> (ConfigTool)</td><td>Configuration management (ant-only)</td></tr>
85
- <tr><td><code>Brief</code> (BriefTool)</td><td>Generate brief summaries</td></tr>
86
- </table>
87
-
88
- <h2>Scheduled Tasks</h2>
89
- <p>Scheduled tasks can be created from the interactive <code>/task</code> form. The form collects a name, project, schedule type, prompt, and storage mode, then creates the matching cron task through the same scheduling runtime used by <code>CronCreate</code>, <code>CronList</code>, and <code>CronDelete</code>.</p>
90
-
91
- <table>
92
- <tr><th>User action</th><th>Behavior</th></tr>
93
- <tr><td><code>/task</code></td><td>Open the interactive scheduled task form</td></tr>
94
- <tr><td>Select <code>Daily</code> around <code>09:00</code></td><td>Create a recurring daily task</td></tr>
95
- <tr><td>Select <code>Weekdays</code> around <code>09:00</code></td><td>Create a weekday cron such as <code>0 9 * * 1-5</code></td></tr>
96
- <tr><td>Select <code>In N minutes</code> with <code>10</code></td><td>Create a one-shot reminder</td></tr>
97
- <tr><td>Select <code>Custom cron</code></td><td>Use a standard 5-field cron expression</td></tr>
98
- <tr><td><code>/task scheduled</code></td><td>Open the same form explicitly</td></tr>
99
- </table>
100
-
101
- <ul>
102
- <li><strong>Durable</strong> storage persists tasks to <code>.clew/scheduled_tasks.json</code> across sessions.</li>
103
- <li><strong>Session-only</strong> storage keeps tasks in memory for the current session only.</li>
104
- <li>Recurring tasks auto-expire after 30 days unless they are system-created permanent tasks.</li>
105
- <li>One-shot tasks auto-delete after firing.</li>
106
- <li>Natural language scheduling can still use the model-facing cron tools directly.</li>
107
- </ul>
108
-
109
- <pre><code>/task
110
- Name: Server status
111
- Schedule: Daily
112
- Time: 20:00
113
- Prompt: Check the server status
114
- Storage: Durable</code></pre>
115
-
116
- <h2>MCP (Model Context Protocol)</h2>
117
- <table>
118
- <tr><th>Tool</th><th>Description</th></tr>
119
- <tr><td><code>ListMcpResources</code> (ListMcpResourcesTool)</td><td>List available resources from connected MCP servers</td></tr>
120
- <tr><td><code>ReadMcpResource</code> (ReadMcpResourceTool)</td><td>Read resources exposed by MCP servers</td></tr>
121
- <tr><td>MCP-provided tools</td><td>Dynamically loaded tools from MCP servers (filesystem, database, APIs)</td></tr>
122
- </table>
123
-
124
- <h2>Feature-Gated Tools</h2>
125
- <table>
126
- <tr><th>Tool</th><th>Flag</th><th>Description</th></tr>
127
- <tr><td><code>LSP</code> (LSPTool)</td><td><code>ENABLE_LSP_TOOL=1</code></td><td>Language Server Protocol integration</td></tr>
128
- <tr><td><code>ComputerUse</code></td><td><code>ENABLE_COMPUTER_USE=1</code> (Win)</td><td>Windows GUI automation</td></tr>
129
- <tr><td><code>ToolSearch</code></td><td><code>STATSIG</code> feature</td><td>Deferred/lazy-loaded tool discovery</td></tr>
130
- <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Worktree mode</td><td>Git worktree isolation</td></tr>
131
- <tr><td><code>TeamCreate / TeamDelete / RequestShutdown</code></td><td>Agent swarms</td><td>Multi-agent team management</td></tr>
132
- <tr><td><code>SubscribePrActivity / UnsubscribePrActivity</code></td><td>Agent swarms</td><td>PR activity monitoring</td></tr>
133
- <tr><td><code>CronCreate / CronDelete / CronList</code></td><td><code>AGENT_TRIGGERS</code></td><td>Scheduled task triggers</td></tr>
134
- <tr><td><code>PushNotification</code></td><td><code>KAIROS</code></td><td>Push notification support</td></tr>
135
- </table>
136
-
137
- <h2>Tool Safety &amp; Permissions</h2>
138
- <p>Each tool declares:</p>
139
- <ul>
140
- <li><strong>isEnabled()</strong> Whether the tool is available in the current build</li>
141
- <li><strong>isConcurrencySafe()</strong> Can run in parallel with other tools</li>
142
- <li><strong>isReadOnly()</strong> Does not modify filesystem</li>
143
- <li><strong>isDestructive()</strong> Performs irreversible operations</li>
144
- <li><strong>checkPermissions()</strong> Tool-specific permission logic</li>
145
- <li><strong>validateInput()</strong> — Input validation before execution</li>
146
- <li><strong>maxResultSizeChars</strong> — Max result size before disk persistence</li>
147
- </ul>
148
-
149
- <p>MCP tools from external servers are merged into the tool pool at runtime via <code>assembleToolPool()</code>. Tools are filtered by deny rules from the permission context.</p>
150
-
151
- <div class="callout callout-info">
152
- <strong>CLEW_CODE_SIMPLE mode</strong>
153
- Setting <code>CLEW_CODE_SIMPLE=1</code> or using <code>--bare</code> limits tools to a minimal set: <code>Bash</code>, <code>Read</code>, <code>Edit</code>.
154
- </div>
155
-
156
- <footer class="footer">
157
- <span>Clew Code 0.2.14 — Open Source</span>
158
- <div class="footer-links">
159
- <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
160
- <a href="https://github.com/ClewCode/ClewCode/issues">Issues</a>
161
- </div>
162
- </footer>
163
- </main>
164
- <nav class="toc-sidebar"></nav>
165
- </div>
166
- </div>
167
- <script src="js/main.js"></script>
168
- </body>
169
- </html>
170
-
171
-
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>Tools — Clew Code</title>
7
+ <meta name="description" href="50+ built-in tools available in 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">Tools</span></div>
22
+
23
+ <h1>Tools</h1>
24
+ <p class="sub">Clew Code ships with 50+ built-in tools for file operations, code search, shell commands, web access, browser automation, PR management, mesh networking, and more.</p>
25
+
26
+ <h2 id="file">File Tools</h2>
27
+ <table>
28
+ <thead>
29
+ <tr><th>Tool</th><th>Description</th></tr>
30
+ </thead>
31
+ <tbody>
32
+ <tr><td>Read</td><td>Read files (text, images, PDFs, notebooks)</td></tr>
33
+ <tr><td>Write</td><td>Create or overwrite files</td></tr>
34
+ <tr><td>Edit</td><td>Exact string replacements in files</td></tr>
35
+ <tr><td>Glob</td><td>Fast file pattern matching</td></tr>
36
+ <tr><td>Grep</td><td>Content search with ripgrep</td></tr>
37
+ <tr><td>NotebookEdit</td><td>Edit Jupyter notebook cells</td></tr>
38
+ </tbody>
39
+ </table>
40
+
41
+ <h2 id="shell">Shell &amp; Execution Tools</h2>
42
+ <table>
43
+ <thead>
44
+ <tr><th>Tool</th><th>Description</th></tr>
45
+ </thead>
46
+ <tbody>
47
+ <tr><td>Bash</td><td>Execute shell commands (with timeout and output cap)</td></tr>
48
+ <tr><td>Monitor</td><td>Stream background task output in real-time</td></tr>
49
+ </tbody>
50
+ </table>
51
+
52
+ <h2 id="web">Web Tools</h2>
53
+ <table>
54
+ <thead>
55
+ <tr><th>Tool</th><th>Description</th></tr>
56
+ </thead>
57
+ <tbody>
58
+ <tr><td>WebSearch</td><td>Web search with domain filtering</td></tr>
59
+ <tr><td>WebFetch</td><td>Fetch and analyze URL content</td></tr>
60
+ <tr><td>Browser</td><td>Stealth Playwright browser (navigate, click, fill, screenshot, etc.)</td></tr>
61
+ </tbody>
62
+ </table>
63
+
64
+ <h2 id="git">Git &amp; PR Tools</h2>
65
+ <table>
66
+ <thead>
67
+ <tr><th>Tool</th><th>Description</th></tr>
68
+ </thead>
69
+ <tbody>
70
+ <tr><td>PR</td><td>Full PR lifecycle (create, list, view, review, merge, status)</td></tr>
71
+ </tbody>
72
+ </table>
73
+
74
+ <h2 id="data">Data Tools</h2>
75
+ <table>
76
+ <thead>
77
+ <tr><th>Tool</th><th>Description</th></tr>
78
+ </thead>
79
+ <tbody>
80
+ <tr><td>JsonPath</td><td>Query, validate, format, minify JSON</td></tr>
81
+ </tbody>
82
+ </table>
83
+
84
+ <h2 id="mesh">Mesh Networking Tools</h2>
85
+ <p>15 LAN coordination tools available for agent-to-agent communication:</p>
86
+ <table>
87
+ <thead>
88
+ <tr><th>Tool</th><th>Description</th></tr>
89
+ </thead>
90
+ <tbody>
91
+ <tr><td>mesh_discover</td><td>Scan LAN for Clew instances</td></tr>
92
+ <tr><td>mesh_run</td><td>Execute shell command on a remote peer</td></tr>
93
+ <tr><td>mesh_spawn</td><td>Spawn a new local peer Clew instance</td></tr>
94
+ <tr><td>mesh_share</td><td>Advertise this instance as a worker</td></tr>
95
+ <tr><td>mesh_join</td><td>Connect to a remote peer</td></tr>
96
+ <tr><td>mesh_ping</td><td>Check if a peer is online</td></tr>
97
+ <tr><td>mesh_broadcast</td><td>Send task to all connected peers</td></tr>
98
+ <tr><td>mesh_send_message</td><td>Send a chat message to a peer</td></tr>
99
+ <tr><td>mesh_list_roles</td><td>List all peers with roles</td></tr>
100
+ <tr><td>mesh_list_messages</td><td>List chat history with a peer</td></tr>
101
+ <tr><td>mesh_set_name</td><td>Assign a custom name to a peer</td></tr>
102
+ <tr><td>mesh_set_role</td><td>Assign a role to a peer</td></tr>
103
+ <tr><td>mesh_disconnect</td><td>Remove a peer connection</td></tr>
104
+ <tr><td>mesh_info</td><td>Show detailed peer information</td></tr>
105
+ <tr><td>mesh_help</td><td>Mesh tool reference</td></tr>
106
+ </tbody>
107
+ </table>
108
+
109
+ <h2 id="mcp-tools">MCP Tools</h2>
110
+ <table>
111
+ <thead>
112
+ <tr><th>Tool</th><th>Description</th></tr>
113
+ </thead>
114
+ <tbody>
115
+ <tr><td>ListMcpResourcesTool</td><td>List available MCP resources</td></tr>
116
+ <tr><td>ReadMcpResourceTool</td><td>Read a specific MCP resource</td></tr>
117
+ </tbody>
118
+ </table>
119
+
120
+ <h2 id="process">Process Mesh Tools</h2>
121
+ <table>
122
+ <thead>
123
+ <tr><th>Tool</th><th>Description</th></tr>
124
+ </thead>
125
+ <tbody>
126
+ <tr><td>process_mesh</td><td>Run a local process-backed AI worker (Codex exec/pty)</td></tr>
127
+ </tbody>
128
+ </table>
129
+
130
+ <h2 id="task">Task &amp; Planning Tools</h2>
131
+ <table>
132
+ <thead>
133
+ <tr><th>Tool</th><th>Description</th></tr>
134
+ </thead>
135
+ <tbody>
136
+ <tr><td>TaskCreate</td><td>Create a structured task</td></tr>
137
+ <tr><td>TaskUpdate</td><td>Update task status</td></tr>
138
+ <tr><td>TaskList</td><td>List all tasks</td></tr>
139
+ <tr><td>TaskGet</td><td>Get task details</td></tr>
140
+ <tr><td>TaskStop</td><td>Stop a running task</td></tr>
141
+ <tr><td>EnterPlanMode</td><td>Enter full-access planning mode</td></tr>
142
+ <tr><td>ExitPlanMode</td><td>Exit planning mode with approval</td></tr>
143
+ <tr><td>EnterWorktree</td><td>Create and enter an isolated worktree</td></tr>
144
+ <tr><td>ExitWorktree</td><td>Exit and clean up a worktree</td></tr>
145
+ </tbody>
146
+ </table>
147
+
148
+ <h2 id="voice">Voice Tools</h2>
149
+ <table>
150
+ <thead>
151
+ <tr><th>Tool</th><th>Description</th></tr>
152
+ </thead>
153
+ <tbody>
154
+ <tr><td>Voice tools</td><td>Voice recording, transcription (Whisper), session management</td></tr>
155
+ </tbody>
156
+ </table>
157
+
158
+ <h2 id="generation">Generation Tools</h2>
159
+ <table>
160
+ <thead>
161
+ <tr><th>Tool</th><th>Description</th></tr>
162
+ </thead>
163
+ <tbody>
164
+ <tr><td>GenerateImage</td><td>Generate images via DALL-E 3, Imagen 3, or OpenRouter (Gemini Image / FLUX). Auto-discovers models from provider APIs. Saves images to <code>.clew/generated/</code>.</td></tr>
165
+ <tr><td>GenerateVideo</td><td>Generate videos via Runway Gen-4. Async polling with timeout. Saves videos to <code>.clew/generated/</code>. Requires <code>RUNWAY_API_KEY</code>.</td></tr>
166
+ </tbody>
167
+ </table>
168
+
169
+ <h2 id="skill">Skill Tools</h2>
170
+ <table>
171
+ <thead>
172
+ <tr><th>Tool</th><th>Description</th></tr>
173
+ </thead>
174
+ <tbody>
175
+ <tr><td>Skill</td><td>Execute a skill within the conversation</td></tr>
176
+ </tbody>
177
+ </table>
178
+ </div>
179
+ </div>
180
+
181
+ <script src="js/main.js"></script>
182
+ </body>
183
+ </html>
@@ -1,106 +1,86 @@
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>Troubleshooting — Clew</title>
7
- <meta name="description" content="Common issues and solutions for Clew — provider keys, build errors, MCP, plugins, and runtime problems.">
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>Troubleshooting</span></div>
19
- <h1>Troubleshooting</h1>
20
- <p class="section-subtitle">Start with <code>/doctor</code> — it checks runtime version, provider credentials, config integrity, plugin/MCP status, and Sentry telemetry.</p>
21
-
22
- <h2>Startup Issues</h2>
23
- <h3>"command not found: clew"</h3>
24
- <p>npm global install path may not be in <code>PATH</code>. Use <code>npx clew-code</code> or <code>bun x clew-code</code> as alternatives.</p>
25
-
26
- <h3>"Bun not found"</h3>
27
- <p>Clew requires <a href="https://bun.sh">Bun 1.3+</a> as the runtime for the npm package.</p>
28
-
29
- <h2>Provider Issues</h2>
30
-
31
- <h3>"No API key configured"</h3>
32
- <p>Set at least one provider API key as an environment variable. See <a href="providers.html">Providers</a> for the full list.</p>
33
- <pre><code>export ANTHROPIC_API_KEY=sk-ant-...
34
- export DEEPSEEK_API_KEY=sk-...</code></pre>
35
- <p>Run <code>/doctor</code> to verify configured providers.</p>
36
-
37
- <h3>"Rate limited" or "Quota exceeded"</h3>
38
- <p>Set a fallback model via CLI: <code>--fallback-model &lt;model&gt;</code>. Or use <code>/model</code> to switch to a different provider. For rate limit options during a session, use <code>/rate-limit-options</code>.</p>
39
-
40
- <h2>Build Issues</h2>
41
-
42
- <h3>TypeScript errors during build</h3>
43
- <pre><code>bun run build
44
- # TypeScript errors may exist in uncommitted code or external modules.
45
- # Run targeted checks:
46
- bun x tsc --noEmit
47
- bun test <targeted-path></code></pre>
48
-
49
- <h3>Windows-specific issues</h3>
50
- <ul>
51
- <li>ripgrep is bundled at <code>src/utils/vendor/ripgrep/x64-win32/rg.exe</code></li>
52
- <li>TTY polyfill may be needed for Ink compatibility</li>
53
- <li>PowerShell and Bash may behave differently for tool execution</li>
54
- <li>Windows argv normalization in <code>src/entry.ts</code></li>
55
- </ul>
56
-
57
- <h2>MCP Issues</h2>
58
-
59
- <h3>"MCP server connection failed"</h3>
60
- <p>Verify the server command exists and paths are correct. Check JSON config syntax with <code>/mcp</code> command.</p>
61
-
62
- <h3>MCP tools not appearing</h3>
63
- <p>Use <code>/mcp</code> to check server status. Tools are loaded at startup via <code>--mcp-config</code> or through <code>assembleToolPool()</code> during server connection. Verify the server implements <code>tools/list</code> correctly.</p>
64
-
65
- <h2>Plugin Issues</h2>
66
-
67
- <h3>Plugin not loading</h3>
68
- <p>Check plugin manifest format and location. Use <code>/plugin</code> and <code>/reload-plugins</code> to refresh. For directory-based plugins, use <code>--plugin-dir &lt;path&gt;</code>.</p>
69
-
70
- <h2>Feature Flags</h2>
71
- <p>Some features require compile-time or runtime flags:</p>
72
- <table>
73
- <tr><th>Feature</th><th>Required Flag</th></tr>
74
- <tr><td>Bridge mode</td><td><code>BRIDGE_MODE=1</code></td></tr>
75
- <tr><td>Voice mode</td><td><code>VOICE_MODE=1</code></td></tr>
76
- <tr><td>LSP tool</td><td><code>ENABLE_LSP_TOOL=1</code></td></tr>
77
- <tr><td>Computer Use</td><td><code>ENABLE_COMPUTER_USE=1</code> (Windows)</td></tr>
78
- <tr><td>Proactive features</td><td><code>KAIROS=1</code></td></tr>
79
- <tr><td>Agent triggers</td><td><code>AGENT_TRIGGERS=1</code></td></tr>
80
- <tr><td>Code index</td><td><code>CODE_INDEX=1</code></td></tr>
81
- </table>
82
-
83
- <h2>Getting Help</h2>
84
- <ul>
85
- <li><strong>In-app diagnostics:</strong> <code>/doctor</code> — comprehensive environment check</li>
86
- <li><strong>Status overview:</strong> <code>/status</code> — version, model, API connectivity, tool statuses</li>
87
- <li><strong>GitHub Issues:</strong> Report bugs and feature requests</li>
88
- <li><strong>Debug mode:</strong> Run with <code>DEBUG=1</code> or <code>DEBUG=provider:anthropic</code> for detailed logging</li>
89
- </ul>
90
-
91
- <footer class="footer">
92
- <span>Clew Code 0.2.14 — Open Source</span>
93
- <div class="footer-links">
94
- <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
95
- <a href="https://github.com/ClewCode/ClewCode/issues">Issues</a>
96
- <a href="https://npmjs.com/package/clew-code">npm</a>
97
- </div>
98
- </footer>
99
- </main>
100
- <nav class="toc-sidebar"></nav>
101
- </div>
102
- </div>
103
- <script src="js/main.js"></script>
104
- </body>
105
- </html>
106
-
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>Troubleshooting — Clew Code</title>
7
+ <meta name="description" href="Common issues and solutions 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">Troubleshooting</span></div>
22
+
23
+ <h1>Troubleshooting</h1>
24
+
25
+ <h2 id="no-provider">No Provider Configured</h2>
26
+ <p>If Clew doesn't start, set at least one provider API key in your environment:</p>
27
+ <pre><code class="language-bash">export ANTHROPIC_API_KEY=sk-ant-...
28
+ clew
29
+ </code></pre>
30
+ <p>Or use the <code>/model</code> command inside the REPL to switch providers.</p>
31
+
32
+ <h2 id="build-errors">Build Errors on Windows</h2>
33
+ <pre><code class="language-powershell">Remove-Item -Recurse -Force node_modules
34
+ bun install
35
+ bun run dev
36
+ </code></pre>
37
+
38
+ <h2 id="mesh-connectivity">Mesh / Peer Discovery Not Working</h2>
39
+ <ul>
40
+ <li>Ensure both instances are on the same LAN</li>
41
+ <li>Check that UDP multicast is not blocked by your firewall</li>
42
+ <li>Run <code>/mesh discover</code> with a longer timeout</li>
43
+ <li>Try sharing via file registry: <code>/mesh share</code></li>
44
+ </ul>
45
+
46
+ <h2 id="mcp-connection">MCP Server Connection Failures</h2>
47
+ <ul>
48
+ <li>Verify the server command exists (<code>which npx</code>, <code>which uvx</code>)</li>
49
+ <li>Check <code>.mcp.json</code> syntax</li>
50
+ <li>Run <code>/mcp list</code> to see all connected servers</li>
51
+ <li>For SSE servers, verify the remote URL is reachable</li>
52
+ </ul>
53
+
54
+ <h2 id="context-limit">Context Limit Reached</h2>
55
+ <p>Use the compact command to compress conversation history:</p>
56
+ <pre><code class="language-bash">❯ /compact
57
+ </code></pre>
58
+ <p>This triggers the multi-pass context compaction system.</p>
59
+
60
+ <h2 id="permission-denied">Permission Denied Errors</h2>
61
+ <p>Switch to a permissive mode or configure allow rules:</p>
62
+ <pre><code class="language-bash">❯ /permissions auto # auto-approve safe tools
63
+ /permissions plan # full bypass for planning
64
+ </code></pre>
65
+ <p>See <a href="permission-model.html">Permission Model</a> for details.</p>
66
+
67
+ <h2 id="provider-switch">Provider Switch Issues</h2>
68
+ <ul>
69
+ <li>Ensure the corresponding API key is set</li>
70
+ <li>Some models have tool-calling limitations</li>
71
+ <li>Run <code>/model list</code> to see available models with capability tags</li>
72
+ </ul>
73
+
74
+ <h2 id="logs">Getting Help</h2>
75
+ <ul>
76
+ <li>Run <code>/doctor</code> for system diagnostics</li>
77
+ <li>Run <code>/status</code> for session info</li>
78
+ <li>Check <code>.session/</code> for session logs</li>
79
+ <li><a href="https://github.com/ClewCode/ClewCode/issues">Open a GitHub issue</a></li>
80
+ </ul>
81
+ </div>
82
+ </div>
83
+
84
+ <script src="js/main.js"></script>
85
+ </body>
86
+ </html>