clew-code 0.2.11 → 0.2.14

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 (52) hide show
  1. package/dist/main.js +2596 -2527
  2. package/docs/architecture.html +148 -148
  3. package/docs/architecture.th.html +79 -79
  4. package/docs/clew-code-architecture.html +6 -6
  5. package/docs/commands.html +225 -224
  6. package/docs/commands.th.html +132 -131
  7. package/docs/configuration.html +147 -147
  8. package/docs/configuration.th.html +108 -108
  9. package/docs/daemon.html +129 -129
  10. package/docs/daemon.th.html +73 -73
  11. package/docs/features/bridge-mode.html +99 -99
  12. package/docs/features/bridge-mode.th.html +90 -90
  13. package/docs/features/evals.html +182 -182
  14. package/docs/features/evals.th.html +90 -90
  15. package/docs/features/peer.html +178 -178
  16. package/docs/features/searxng-search.html +151 -151
  17. package/docs/features/searxng-search.th.html +95 -95
  18. package/docs/features/sentry-setup.html +157 -157
  19. package/docs/features/sentry-setup.th.html +97 -97
  20. package/docs/index.html +298 -299
  21. package/docs/index.th.html +292 -292
  22. package/docs/installation.html +105 -105
  23. package/docs/installation.th.html +105 -105
  24. package/docs/internals/growthbook-ab-testing.html +113 -113
  25. package/docs/internals/growthbook-ab-testing.th.html +81 -81
  26. package/docs/internals/hidden-features.html +175 -149
  27. package/docs/internals/hidden-features.th.html +135 -109
  28. package/docs/loop.html +181 -181
  29. package/docs/loop.th.html +227 -227
  30. package/docs/mcp.html +247 -247
  31. package/docs/mcp.th.html +207 -207
  32. package/docs/models.html +110 -111
  33. package/docs/models.th.html +61 -61
  34. package/docs/peer.html +236 -236
  35. package/docs/peer.th.html +280 -280
  36. package/docs/permission-model.html +102 -102
  37. package/docs/permission-model.th.html +67 -67
  38. package/docs/plugins.html +102 -102
  39. package/docs/plugins.th.html +79 -79
  40. package/docs/providers.html +126 -126
  41. package/docs/providers.th.html +80 -80
  42. package/docs/quick-start.html +93 -93
  43. package/docs/quick-start.th.html +1 -1
  44. package/docs/research-memory.html +82 -82
  45. package/docs/research-memory.th.html +72 -72
  46. package/docs/skills.html +117 -117
  47. package/docs/skills.th.html +90 -90
  48. package/docs/tools.html +170 -170
  49. package/docs/tools.th.html +84 -84
  50. package/docs/troubleshooting.html +106 -106
  51. package/docs/troubleshooting.th.html +85 -85
  52. package/package.json +162 -164
package/docs/tools.html CHANGED
@@ -1,170 +1,170 @@
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>78 built-in tools</strong> (353 files across 78 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</td></tr>
69
- <tr><td><code>ComputerUse</code> (ComputerUseTool)</td><td>Windows-only computer use automation (feature-gated: ENABLE_COMPUTER_USE)</td></tr>
70
- </table>
71
-
72
- <h2>Agent &amp; Task Management</h2>
73
- <table>
74
- <tr><th>Tool</th><th>Description</th></tr>
75
- <tr><td><code>Skill</code> (SkillTool)</td><td>Invoke skills and prompt-type commands by name</td></tr>
76
- <tr><td><code>AskUserQuestion</code> (AskUserQuestionTool)</td><td>Ask the user interactive questions during execution</td></tr>
77
- <tr><td><code>SendMessage</code> (SendMessageTool)</td><td>Send messages between agents in coordinator mode</td></tr>
78
- <tr><td><code>EnterPlanMode</code> (EnterPlanModeTool)</td><td>Enter structured plan mode for complex tasks</td></tr>
79
- <tr><td><code>ExitPlanMode</code> (ExitPlanModeV2Tool)</td><td>Exit plan mode and proceed with implementation</td></tr>
80
- <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Create/exit isolated git worktrees (feature-gated)</td></tr>
81
- <tr><td><code>TaskCreate / TaskGet / TaskUpdate / TaskList</code></td><td>Structured task tracking (V2 todo system)</td></tr>
82
- <tr><td><code>TodoWrite</code> (TodoWriteTool)</td><td>Write todo items for task tracking</td></tr>
83
- <tr><td><code>Config</code> (ConfigTool)</td><td>Configuration management (ant-only)</td></tr>
84
- <tr><td><code>Brief</code> (BriefTool)</td><td>Generate brief summaries</td></tr>
85
- </table>
86
-
87
- <h2>Scheduled Tasks</h2>
88
- <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>
89
-
90
- <table>
91
- <tr><th>User action</th><th>Behavior</th></tr>
92
- <tr><td><code>/task</code></td><td>Open the interactive scheduled task form</td></tr>
93
- <tr><td>Select <code>Daily</code> around <code>09:00</code></td><td>Create a recurring daily task</td></tr>
94
- <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>
95
- <tr><td>Select <code>In N minutes</code> with <code>10</code></td><td>Create a one-shot reminder</td></tr>
96
- <tr><td>Select <code>Custom cron</code></td><td>Use a standard 5-field cron expression</td></tr>
97
- <tr><td><code>/task scheduled</code></td><td>Open the same form explicitly</td></tr>
98
- </table>
99
-
100
- <ul>
101
- <li><strong>Durable</strong> storage persists tasks to <code>.claude/scheduled_tasks.json</code> across sessions.</li>
102
- <li><strong>Session-only</strong> storage keeps tasks in memory for the current session only.</li>
103
- <li>Recurring tasks auto-expire after 30 days unless they are system-created permanent tasks.</li>
104
- <li>One-shot tasks auto-delete after firing.</li>
105
- <li>Natural language scheduling can still use the model-facing cron tools directly.</li>
106
- </ul>
107
-
108
- <pre><code>/task
109
- Name: Server status
110
- Schedule: Daily
111
- Time: 20:00
112
- Prompt: Check the server status
113
- Storage: Durable</code></pre>
114
-
115
- <h2>MCP (Model Context Protocol)</h2>
116
- <table>
117
- <tr><th>Tool</th><th>Description</th></tr>
118
- <tr><td><code>ListMcpResources</code> (ListMcpResourcesTool)</td><td>List available resources from connected MCP servers</td></tr>
119
- <tr><td><code>ReadMcpResource</code> (ReadMcpResourceTool)</td><td>Read resources exposed by MCP servers</td></tr>
120
- <tr><td>MCP-provided tools</td><td>Dynamically loaded tools from MCP servers (filesystem, database, APIs)</td></tr>
121
- </table>
122
-
123
- <h2>Feature-Gated Tools</h2>
124
- <table>
125
- <tr><th>Tool</th><th>Flag</th><th>Description</th></tr>
126
- <tr><td><code>LSP</code> (LSPTool)</td><td><code>ENABLE_LSP_TOOL=1</code></td><td>Language Server Protocol integration</td></tr>
127
- <tr><td><code>ComputerUse</code></td><td><code>ENABLE_COMPUTER_USE=1</code> (Win)</td><td>Windows GUI automation</td></tr>
128
- <tr><td><code>ToolSearch</code></td><td><code>STATSIG</code> feature</td><td>Deferred/lazy-loaded tool discovery</td></tr>
129
- <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Worktree mode</td><td>Git worktree isolation</td></tr>
130
- <tr><td><code>TeamCreate / TeamDelete / RequestShutdown</code></td><td>Agent swarms</td><td>Multi-agent team management</td></tr>
131
- <tr><td><code>SubscribePrActivity / UnsubscribePrActivity</code></td><td>Agent swarms</td><td>PR activity monitoring</td></tr>
132
- <tr><td><code>CronCreate / CronDelete / CronList</code></td><td><code>AGENT_TRIGGERS</code></td><td>Scheduled task triggers</td></tr>
133
- <tr><td><code>PushNotification</code></td><td><code>KAIROS</code></td><td>Push notification support</td></tr>
134
- </table>
135
-
136
- <h2>Tool Safety &amp; Permissions</h2>
137
- <p>Each tool declares:</p>
138
- <ul>
139
- <li><strong>isEnabled()</strong> — Whether the tool is available in the current build</li>
140
- <li><strong>isConcurrencySafe()</strong> — Can run in parallel with other tools</li>
141
- <li><strong>isReadOnly()</strong> — Does not modify filesystem</li>
142
- <li><strong>isDestructive()</strong> — Performs irreversible operations</li>
143
- <li><strong>checkPermissions()</strong> — Tool-specific permission logic</li>
144
- <li><strong>validateInput()</strong> — Input validation before execution</li>
145
- <li><strong>maxResultSizeChars</strong> — Max result size before disk persistence</li>
146
- </ul>
147
-
148
- <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>
149
-
150
- <div class="callout callout-info">
151
- <strong>CLAUDE_CODE_SIMPLE mode</strong>
152
- Setting <code>CLAUDE_CODE_SIMPLE=1</code> or using <code>--bare</code> limits tools to a minimal set: <code>Bash</code>, <code>Read</code>, <code>Edit</code>.
153
- </div>
154
-
155
- <footer class="footer">
156
- <span>Clew Code v0.2.7 — Open Source</span>
157
- <div class="footer-links">
158
- <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
159
- <a href="https://github.com/ClewCode/ClewCode/issues">Issues</a>
160
- </div>
161
- </footer>
162
- </main>
163
- <nav class="toc-sidebar"></nav>
164
- </div>
165
- </div>
166
- <script src="js/main.js"></script>
167
- </body>
168
- </html>
169
-
170
-
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>78 built-in tools</strong> (353 files across 78 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</td></tr>
69
+ <tr><td><code>ComputerUse</code> (ComputerUseTool)</td><td>Windows-only computer use automation (feature-gated: ENABLE_COMPUTER_USE)</td></tr>
70
+ </table>
71
+
72
+ <h2>Agent &amp; Task Management</h2>
73
+ <table>
74
+ <tr><th>Tool</th><th>Description</th></tr>
75
+ <tr><td><code>Skill</code> (SkillTool)</td><td>Invoke skills and prompt-type commands by name</td></tr>
76
+ <tr><td><code>AskUserQuestion</code> (AskUserQuestionTool)</td><td>Ask the user interactive questions during execution</td></tr>
77
+ <tr><td><code>SendMessage</code> (SendMessageTool)</td><td>Send messages between agents in coordinator mode</td></tr>
78
+ <tr><td><code>EnterPlanMode</code> (EnterPlanModeTool)</td><td>Enter structured plan mode for complex tasks</td></tr>
79
+ <tr><td><code>ExitPlanMode</code> (ExitPlanModeV2Tool)</td><td>Exit plan mode and proceed with implementation</td></tr>
80
+ <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Create/exit isolated git worktrees (feature-gated)</td></tr>
81
+ <tr><td><code>TaskCreate / TaskGet / TaskUpdate / TaskList</code></td><td>Structured task tracking (V2 todo system)</td></tr>
82
+ <tr><td><code>TodoWrite</code> (TodoWriteTool)</td><td>Write todo items for task tracking</td></tr>
83
+ <tr><td><code>Config</code> (ConfigTool)</td><td>Configuration management (ant-only)</td></tr>
84
+ <tr><td><code>Brief</code> (BriefTool)</td><td>Generate brief summaries</td></tr>
85
+ </table>
86
+
87
+ <h2>Scheduled Tasks</h2>
88
+ <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>
89
+
90
+ <table>
91
+ <tr><th>User action</th><th>Behavior</th></tr>
92
+ <tr><td><code>/task</code></td><td>Open the interactive scheduled task form</td></tr>
93
+ <tr><td>Select <code>Daily</code> around <code>09:00</code></td><td>Create a recurring daily task</td></tr>
94
+ <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>
95
+ <tr><td>Select <code>In N minutes</code> with <code>10</code></td><td>Create a one-shot reminder</td></tr>
96
+ <tr><td>Select <code>Custom cron</code></td><td>Use a standard 5-field cron expression</td></tr>
97
+ <tr><td><code>/task scheduled</code></td><td>Open the same form explicitly</td></tr>
98
+ </table>
99
+
100
+ <ul>
101
+ <li><strong>Durable</strong> storage persists tasks to <code>.claude/scheduled_tasks.json</code> across sessions.</li>
102
+ <li><strong>Session-only</strong> storage keeps tasks in memory for the current session only.</li>
103
+ <li>Recurring tasks auto-expire after 30 days unless they are system-created permanent tasks.</li>
104
+ <li>One-shot tasks auto-delete after firing.</li>
105
+ <li>Natural language scheduling can still use the model-facing cron tools directly.</li>
106
+ </ul>
107
+
108
+ <pre><code>/task
109
+ Name: Server status
110
+ Schedule: Daily
111
+ Time: 20:00
112
+ Prompt: Check the server status
113
+ Storage: Durable</code></pre>
114
+
115
+ <h2>MCP (Model Context Protocol)</h2>
116
+ <table>
117
+ <tr><th>Tool</th><th>Description</th></tr>
118
+ <tr><td><code>ListMcpResources</code> (ListMcpResourcesTool)</td><td>List available resources from connected MCP servers</td></tr>
119
+ <tr><td><code>ReadMcpResource</code> (ReadMcpResourceTool)</td><td>Read resources exposed by MCP servers</td></tr>
120
+ <tr><td>MCP-provided tools</td><td>Dynamically loaded tools from MCP servers (filesystem, database, APIs)</td></tr>
121
+ </table>
122
+
123
+ <h2>Feature-Gated Tools</h2>
124
+ <table>
125
+ <tr><th>Tool</th><th>Flag</th><th>Description</th></tr>
126
+ <tr><td><code>LSP</code> (LSPTool)</td><td><code>ENABLE_LSP_TOOL=1</code></td><td>Language Server Protocol integration</td></tr>
127
+ <tr><td><code>ComputerUse</code></td><td><code>ENABLE_COMPUTER_USE=1</code> (Win)</td><td>Windows GUI automation</td></tr>
128
+ <tr><td><code>ToolSearch</code></td><td><code>STATSIG</code> feature</td><td>Deferred/lazy-loaded tool discovery</td></tr>
129
+ <tr><td><code>EnterWorktree / ExitWorktree</code></td><td>Worktree mode</td><td>Git worktree isolation</td></tr>
130
+ <tr><td><code>TeamCreate / TeamDelete / RequestShutdown</code></td><td>Agent swarms</td><td>Multi-agent team management</td></tr>
131
+ <tr><td><code>SubscribePrActivity / UnsubscribePrActivity</code></td><td>Agent swarms</td><td>PR activity monitoring</td></tr>
132
+ <tr><td><code>CronCreate / CronDelete / CronList</code></td><td><code>AGENT_TRIGGERS</code></td><td>Scheduled task triggers</td></tr>
133
+ <tr><td><code>PushNotification</code></td><td><code>KAIROS</code></td><td>Push notification support</td></tr>
134
+ </table>
135
+
136
+ <h2>Tool Safety &amp; Permissions</h2>
137
+ <p>Each tool declares:</p>
138
+ <ul>
139
+ <li><strong>isEnabled()</strong> — Whether the tool is available in the current build</li>
140
+ <li><strong>isConcurrencySafe()</strong> — Can run in parallel with other tools</li>
141
+ <li><strong>isReadOnly()</strong> — Does not modify filesystem</li>
142
+ <li><strong>isDestructive()</strong> — Performs irreversible operations</li>
143
+ <li><strong>checkPermissions()</strong> — Tool-specific permission logic</li>
144
+ <li><strong>validateInput()</strong> — Input validation before execution</li>
145
+ <li><strong>maxResultSizeChars</strong> — Max result size before disk persistence</li>
146
+ </ul>
147
+
148
+ <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>
149
+
150
+ <div class="callout callout-info">
151
+ <strong>CLAUDE_CODE_SIMPLE mode</strong>
152
+ Setting <code>CLAUDE_CODE_SIMPLE=1</code> or using <code>--bare</code> limits tools to a minimal set: <code>Bash</code>, <code>Read</code>, <code>Edit</code>.
153
+ </div>
154
+
155
+ <footer class="footer">
156
+ <span>Clew Code 0.2.13 — Open Source</span>
157
+ <div class="footer-links">
158
+ <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
159
+ <a href="https://github.com/ClewCode/ClewCode/issues">Issues</a>
160
+ </div>
161
+ </footer>
162
+ </main>
163
+ <nav class="toc-sidebar"></nav>
164
+ </div>
165
+ </div>
166
+ <script src="js/main.js"></script>
167
+ </body>
168
+ </html>
169
+
170
+
@@ -1,84 +1,84 @@
1
- <!DOCTYPE html>
2
- <html lang="th">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>เครื่องมือ — Clew</title>
7
- <meta name="description" content="ข้อมูลอ้างอิงเครื่องมือในตัวของ Clew — การดำเนินการไฟล์, เชลล์, ค้นหา, เอเจนต์, MCP, และระบบอัตโนมัติ">
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&family=Noto+Sans+Thai: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.th.html">หน้าแรก</a><span class="sep">/</span><span>เครื่องมือ</span></div>
19
- <h1>เครื่องมือ</h1>
20
- <p class="section-subtitle">Clew มีเครื่องมือในตัว 50+ รายการ พร้อมเครื่องมือ MCP ที่โหลดแบบไดนามิก เครื่องมือถูกเรียกโดยโมเดล AI ผ่านบล็อก <code>tool_use</code></p>
21
-
22
- <h2>วิธีการทำงานของเครื่องมือ</h2>
23
- <p>เครื่องมือถูกกำหนดด้วย Zod schemas ใน <code>src/Tool.ts</code> ผ่านตัวช่วย <code>buildTool()</code> และลงทะเบียนใน <code>src/tools.ts</code></p>
24
-
25
- <pre><code>โมเดลส่ง tool_use
26
- ปรับมาตรฐานการเรียกใช้เครื่องมือ (toolCallParser.ts)
27
- ตรวจสอบสิทธิ์ (permissions.ts)
28
- ฮุค PreToolUse (ปลั๊กอิน)
29
- ดำเนินการเครื่องมือ (StreamingToolExecutor)
30
- ฮุค PostToolUse (ปลั๊กอิน)
31
- ส่งคืนผลลัพธ์เป็น tool_result
32
- วนซ้ำคำถามต่อไป</code></pre>
33
-
34
- <h2>การดำเนินการไฟล์และโค้ด</h2>
35
- <table>
36
- <tr><th>เครื่องมือ</th><th>คำอธิบาย</th></tr>
37
- <tr><td><code>Read</code></td><td>อ่านไฟล์พร้อมหมายเลขบรรทัด, รองรับรูปภาพ, PDF, Jupyter notebooks</td></tr>
38
- <tr><td><code>Write</code></td><td>สร้างไฟล์ใหม่พร้อมเนื้อหาเต็ม</td></tr>
39
- <tr><td><code>Edit</code></td><td>แก้ไขแบบแทนที่สตริงที่แน่นอน</td></tr>
40
- <tr><td><code>Glob</code></td><td>ค้นหาไฟล์ด้วย pattern, เรียงตามเวลาแก้ไข</td></tr>
41
- <tr><td><code>Grep</code></td><td>ค้นหาเนื้อหาด้วย regex พร้อมบรรทัดบริบท</td></tr>
42
- <tr><td><code>NotebookEdit</code></td><td>แก้ไขเซลล์ Jupyter notebook</td></tr>
43
- </table>
44
-
45
- <h2>เชลล์และระบบ</h2>
46
- <table>
47
- <tr><th>เครื่องมือ</th><th>คำอธิบาย</th></tr>
48
- <tr><td><code>Bash</code></td><td>รันคำสั่ง shell พร้อม timeout, background, sandbox</td></tr>
49
- <tr><td><code>Monitor</code></td><td>สตรีม stdout/stderr จากงานพื้นหลังแบบเรียลไทม์</td></tr>
50
- <tr><td><code>TaskOutput</code></td><td>รับผลลัพธ์จากงานที่กำลังรันหรือเสร็จแล้ว</td></tr>
51
- </table>
52
-
53
- <h2>ค้นหาและเว็บ</h2>
54
- <table>
55
- <tr><th>เครื่องมือ</th><th>คำอธิบาย</th></tr>
56
- <tr><td><code>WebSearch</code></td><td>ค้นหาเว็บหลายผู้ให้บริการ (Tavily, Brave, Serper, SearXNG, DuckDuckGo)</td></tr>
57
- <tr><td><code>WebFetch</code></td><td>ดึงและวิเคราะห์เนื้อหาจาก URL</td></tr>
58
- <tr><td><code>SessionSearch</code></td><td>ค้นหาข้อความเต็มในประวัติเซสชันที่ผ่านมา</td></tr>
59
- </table>
60
-
61
- <h2>ความปลอดภัยและสิทธิ์ของเครื่องมือ</h2>
62
- <p>แต่ละเครื่องมือประกาศ:</p>
63
- <ul>
64
- <li><strong>isEnabled()</strong> — พร้อมใช้งานใน build ปัจจุบันหรือไม่</li>
65
- <li><strong>isConcurrencySafe()</strong> — รันพร้อมกับเครื่องมืออื่นได้หรือไม่</li>
66
- <li><strong>isReadOnly()</strong> — ไม่แก้ไขระบบไฟล์</li>
67
- <li><strong>isDestructive()</strong> — ดำเนินการที่ไม่สามารถย้อนกลับ</li>
68
- </ul>
69
-
70
- <footer class="footer">
71
- <span>Clew Code v0.2.7 — โอเพนซอร์ส</span>
72
- <div class="footer-links">
73
- <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
74
- <a href="https://github.com/ClewCode/ClewCode/issues">ปัญหา</a>
75
- </div>
76
- </footer>
77
- </main>
78
- <nav class="toc-sidebar"></nav>
79
- </div>
80
- </div>
81
- <script src="js/main.js"></script>
82
- </body>
83
- </html>
84
-
1
+ <!DOCTYPE html>
2
+ <html lang="th">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>เครื่องมือ — Clew</title>
7
+ <meta name="description" content="ข้อมูลอ้างอิงเครื่องมือในตัวของ Clew — การดำเนินการไฟล์, เชลล์, ค้นหา, เอเจนต์, MCP, และระบบอัตโนมัติ">
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&family=Noto+Sans+Thai: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.th.html">หน้าแรก</a><span class="sep">/</span><span>เครื่องมือ</span></div>
19
+ <h1>เครื่องมือ</h1>
20
+ <p class="section-subtitle">Clew มีเครื่องมือในตัว 50+ รายการ พร้อมเครื่องมือ MCP ที่โหลดแบบไดนามิก เครื่องมือถูกเรียกโดยโมเดล AI ผ่านบล็อก <code>tool_use</code></p>
21
+
22
+ <h2>วิธีการทำงานของเครื่องมือ</h2>
23
+ <p>เครื่องมือถูกกำหนดด้วย Zod schemas ใน <code>src/Tool.ts</code> ผ่านตัวช่วย <code>buildTool()</code> และลงทะเบียนใน <code>src/tools.ts</code></p>
24
+
25
+ <pre><code>โมเดลส่ง tool_use
26
+ ปรับมาตรฐานการเรียกใช้เครื่องมือ (toolCallParser.ts)
27
+ ตรวจสอบสิทธิ์ (permissions.ts)
28
+ ฮุค PreToolUse (ปลั๊กอิน)
29
+ ดำเนินการเครื่องมือ (StreamingToolExecutor)
30
+ ฮุค PostToolUse (ปลั๊กอิน)
31
+ ส่งคืนผลลัพธ์เป็น tool_result
32
+ วนซ้ำคำถามต่อไป</code></pre>
33
+
34
+ <h2>การดำเนินการไฟล์และโค้ด</h2>
35
+ <table>
36
+ <tr><th>เครื่องมือ</th><th>คำอธิบาย</th></tr>
37
+ <tr><td><code>Read</code></td><td>อ่านไฟล์พร้อมหมายเลขบรรทัด, รองรับรูปภาพ, PDF, Jupyter notebooks</td></tr>
38
+ <tr><td><code>Write</code></td><td>สร้างไฟล์ใหม่พร้อมเนื้อหาเต็ม</td></tr>
39
+ <tr><td><code>Edit</code></td><td>แก้ไขแบบแทนที่สตริงที่แน่นอน</td></tr>
40
+ <tr><td><code>Glob</code></td><td>ค้นหาไฟล์ด้วย pattern, เรียงตามเวลาแก้ไข</td></tr>
41
+ <tr><td><code>Grep</code></td><td>ค้นหาเนื้อหาด้วย regex พร้อมบรรทัดบริบท</td></tr>
42
+ <tr><td><code>NotebookEdit</code></td><td>แก้ไขเซลล์ Jupyter notebook</td></tr>
43
+ </table>
44
+
45
+ <h2>เชลล์และระบบ</h2>
46
+ <table>
47
+ <tr><th>เครื่องมือ</th><th>คำอธิบาย</th></tr>
48
+ <tr><td><code>Bash</code></td><td>รันคำสั่ง shell พร้อม timeout, background, sandbox</td></tr>
49
+ <tr><td><code>Monitor</code></td><td>สตรีม stdout/stderr จากงานพื้นหลังแบบเรียลไทม์</td></tr>
50
+ <tr><td><code>TaskOutput</code></td><td>รับผลลัพธ์จากงานที่กำลังรันหรือเสร็จแล้ว</td></tr>
51
+ </table>
52
+
53
+ <h2>ค้นหาและเว็บ</h2>
54
+ <table>
55
+ <tr><th>เครื่องมือ</th><th>คำอธิบาย</th></tr>
56
+ <tr><td><code>WebSearch</code></td><td>ค้นหาเว็บหลายผู้ให้บริการ (Tavily, Brave, Serper, SearXNG, DuckDuckGo)</td></tr>
57
+ <tr><td><code>WebFetch</code></td><td>ดึงและวิเคราะห์เนื้อหาจาก URL</td></tr>
58
+ <tr><td><code>SessionSearch</code></td><td>ค้นหาข้อความเต็มในประวัติเซสชันที่ผ่านมา</td></tr>
59
+ </table>
60
+
61
+ <h2>ความปลอดภัยและสิทธิ์ของเครื่องมือ</h2>
62
+ <p>แต่ละเครื่องมือประกาศ:</p>
63
+ <ul>
64
+ <li><strong>isEnabled()</strong> — พร้อมใช้งานใน build ปัจจุบันหรือไม่</li>
65
+ <li><strong>isConcurrencySafe()</strong> — รันพร้อมกับเครื่องมืออื่นได้หรือไม่</li>
66
+ <li><strong>isReadOnly()</strong> — ไม่แก้ไขระบบไฟล์</li>
67
+ <li><strong>isDestructive()</strong> — ดำเนินการที่ไม่สามารถย้อนกลับ</li>
68
+ </ul>
69
+
70
+ <footer class="footer">
71
+ <span>Clew Code 0.2.13 — โอเพนซอร์ส</span>
72
+ <div class="footer-links">
73
+ <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
74
+ <a href="https://github.com/ClewCode/ClewCode/issues">ปัญหา</a>
75
+ </div>
76
+ </footer>
77
+ </main>
78
+ <nav class="toc-sidebar"></nav>
79
+ </div>
80
+ </div>
81
+ <script src="js/main.js"></script>
82
+ </body>
83
+ </html>
84
+