clew-code 0.2.7 → 0.2.9

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 (57) hide show
  1. package/README.md +292 -299
  2. package/dist/main.js +2745 -2869
  3. package/docs/architecture.html +148 -145
  4. package/docs/architecture.th.html +79 -78
  5. package/docs/clew-code-architecture.html +1125 -0
  6. package/docs/commands.html +224 -223
  7. package/docs/commands.th.html +131 -130
  8. package/docs/configuration.html +147 -145
  9. package/docs/configuration.th.html +108 -106
  10. package/docs/css/styles.css +48 -42
  11. package/docs/daemon.html +129 -128
  12. package/docs/daemon.th.html +73 -72
  13. package/docs/features/bridge-mode.html +99 -98
  14. package/docs/features/bridge-mode.th.html +90 -89
  15. package/docs/features/evals.html +182 -181
  16. package/docs/features/evals.th.html +90 -89
  17. package/docs/features/peer.html +178 -177
  18. package/docs/features/searxng-search.html +151 -150
  19. package/docs/features/searxng-search.th.html +95 -94
  20. package/docs/features/sentry-setup.html +157 -156
  21. package/docs/features/sentry-setup.th.html +97 -96
  22. package/docs/index.html +299 -298
  23. package/docs/index.th.html +292 -290
  24. package/docs/installation.html +105 -103
  25. package/docs/installation.th.html +105 -103
  26. package/docs/internals/growthbook-ab-testing.html +113 -112
  27. package/docs/internals/growthbook-ab-testing.th.html +81 -80
  28. package/docs/internals/hidden-features.html +149 -147
  29. package/docs/internals/hidden-features.th.html +109 -107
  30. package/docs/js/main.js +83 -3
  31. package/docs/loop.html +181 -180
  32. package/docs/loop.th.html +227 -226
  33. package/docs/mcp.html +247 -246
  34. package/docs/mcp.th.html +207 -206
  35. package/docs/models.html +111 -110
  36. package/docs/models.th.html +61 -60
  37. package/docs/peer.html +236 -235
  38. package/docs/peer.th.html +280 -279
  39. package/docs/permission-model.html +102 -101
  40. package/docs/permission-model.th.html +67 -66
  41. package/docs/plugins.html +102 -101
  42. package/docs/plugins.th.html +79 -78
  43. package/docs/providers.html +126 -117
  44. package/docs/providers.th.html +80 -78
  45. package/docs/quick-start.html +93 -92
  46. package/docs/quick-start.th.html +40 -39
  47. package/docs/research-memory.html +82 -79
  48. package/docs/research-memory.th.html +72 -71
  49. package/docs/skills.html +117 -116
  50. package/docs/skills.th.html +90 -89
  51. package/docs/tools.html +170 -169
  52. package/docs/tools.th.html +84 -83
  53. package/docs/troubleshooting.html +106 -105
  54. package/docs/troubleshooting.th.html +85 -84
  55. package/package.json +164 -162
  56. package/docs/taste.html +0 -436
  57. package/docs/taste.th.html +0 -236
@@ -1,89 +1,90 @@
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 สร้าง, ใช้, และแชร์สกิลระหว่างโปรเจกต์">
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">สกิลคือคำสั่งประเภท prompt ที่ใช้ซ้ำได้ ไฟล์ markdown ที่ให้คำแนะนำแบบมีโครงสร้างแก่โมเดล AI</p>
21
-
22
- <h2>ภาพรวม</h2>
23
- <p>สกิลคือคำสั่งประเภท <code>prompt</code> พวกมันขยายเป็นข้อความที่ส่งไปยังโมเดล ต่างจากปลั๊กอิน (ที่ให้โค้ด JavaScript) สกิลเป็นการสอนล้วนๆ</p>
24
-
25
- <h2>ตำแหน่งสกิล</h2>
26
- <p>สกิลถูกโหลดจากสี่แหล่ง (ลำดับ: bundled user project plugin):</p>
27
- <table>
28
- <tr><th>แหล่ง</th><th>พาธ</th><th>ขอบเขต</th></tr>
29
- <tr><td>Bundled</td><td>มาพร้อม Clew</td><td>ผู้ใช้ทั้งหมด</td></tr>
30
- <tr><td>ผู้ใช้</td><td><code>~/.claude/skills/&lt;name&gt;/SKILL.md</code></td><td>ส่วนตัว</td></tr>
31
- <tr><td>โปรเจกต์</td><td><code>.claude/skills/&lt;name&gt;/SKILL.md</code></td><td>ทีม (ใน repo)</td></tr>
32
- <tr><td>ปลั๊กอิน</td><td>ภายในไดเรกทอรีปลั๊กอิน</td><td>ผู้ใช้ปลั๊กอิน</td></tr>
33
- </table>
34
-
35
- <h2>โครงสร้างสกิล</h2>
36
- <pre><code>my-skill/
37
- SKILL.md # คำแนะนำสกิล (จำเป็น)
38
- assets/ # ไม่บังคับ: สคริปต์, เอกสารอ้างอิง, ตัวอย่าง</code></pre>
39
-
40
- <h2>การจัดการสกิล</h2>
41
- <pre><code>/skill # แสดงสกิลที่มีหรือรายละเอียดสกิล
42
- /skills # แสดงสกิลที่มี
43
- /skill-name # เรียกใช้สกิลโดยตรง</code></pre>
44
-
45
- <h2>Frontmatter สกิล</h2>
46
- <p>สกิลรองรับ YAML frontmatter สำหรับข้อมูลเมตาและการตั้งค่า:</p>
47
- <pre><code>---
48
- name: my-skill
49
- description: ทำงานกับข้อความเฉพาะทาง
50
- allowed-tools:
51
- - Read
52
- - Grep
53
- disallowed-tools:
54
- - Bash
55
- - Edit
56
- model: claude-sonnet-4-6
57
- effort: high
58
- user-invocable: true
59
- context: fork
60
- ---</code></pre>
61
-
62
- <h2>การสร้างสกิล</h2>
63
- <pre><code>mkdir -p ~/.claude/skills/my-skill
64
- touch ~/.claude/skills/my-skill/SKILL.md
65
- # แก้ไข SKILL.md ด้วย frontmatter และคำแนะนำ</code></pre>
66
-
67
- <h2>สกิลระดับโปรเจกต์</h2>
68
- <p>วางสกิลใน <code>.claude/skills/</code> ภายใน repository ของคุณเพื่อแชร์กับทีม:</p>
69
- <pre><code>.claude/
70
- skills/
71
- code-review/
72
- SKILL.md
73
- migration-workflow/
74
- SKILL.md</code></pre>
75
-
76
- <footer class="footer">
77
- <span>Clew Code v0.2.4 โอเพนซอร์ส</span>
78
- <div class="footer-links">
79
- <a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
80
- <a href="https://github.com/JonusNattapong/ClewCode/issues">ปัญหา</a>
81
- </div>
82
- </footer>
83
- </main>
84
- <nav class="toc-sidebar"></nav>
85
- </div>
86
- </div>
87
- <script src="js/main.js"></script>
88
- </body>
89
- </html>
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 — สร้าง, ใช้, และแชร์สกิลระหว่างโปรเจกต์">
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">สกิลคือคำสั่งประเภท prompt ที่ใช้ซ้ำได้ — ไฟล์ markdown ที่ให้คำแนะนำแบบมีโครงสร้างแก่โมเดล AI</p>
21
+
22
+ <h2>ภาพรวม</h2>
23
+ <p>สกิลคือคำสั่งประเภท <code>prompt</code> — พวกมันขยายเป็นข้อความที่ส่งไปยังโมเดล ต่างจากปลั๊กอิน (ที่ให้โค้ด JavaScript) สกิลเป็นการสอนล้วนๆ</p>
24
+
25
+ <h2>ตำแหน่งสกิล</h2>
26
+ <p>สกิลถูกโหลดจากสี่แหล่ง (ลำดับ: bundled user project plugin):</p>
27
+ <table>
28
+ <tr><th>แหล่ง</th><th>พาธ</th><th>ขอบเขต</th></tr>
29
+ <tr><td>Bundled</td><td>มาพร้อม Clew</td><td>ผู้ใช้ทั้งหมด</td></tr>
30
+ <tr><td>ผู้ใช้</td><td><code>~/.claude/skills/&lt;name&gt;/SKILL.md</code></td><td>ส่วนตัว</td></tr>
31
+ <tr><td>โปรเจกต์</td><td><code>.claude/skills/&lt;name&gt;/SKILL.md</code></td><td>ทีม (ใน repo)</td></tr>
32
+ <tr><td>ปลั๊กอิน</td><td>ภายในไดเรกทอรีปลั๊กอิน</td><td>ผู้ใช้ปลั๊กอิน</td></tr>
33
+ </table>
34
+
35
+ <h2>โครงสร้างสกิล</h2>
36
+ <pre><code>my-skill/
37
+ SKILL.md # คำแนะนำสกิล (จำเป็น)
38
+ assets/ # ไม่บังคับ: สคริปต์, เอกสารอ้างอิง, ตัวอย่าง</code></pre>
39
+
40
+ <h2>การจัดการสกิล</h2>
41
+ <pre><code>/skill # แสดงสกิลที่มีหรือรายละเอียดสกิล
42
+ /skills # แสดงสกิลที่มี
43
+ /skill-name # เรียกใช้สกิลโดยตรง</code></pre>
44
+
45
+ <h2>Frontmatter สกิล</h2>
46
+ <p>สกิลรองรับ YAML frontmatter สำหรับข้อมูลเมตาและการตั้งค่า:</p>
47
+ <pre><code>---
48
+ name: my-skill
49
+ description: ทำงานกับข้อความเฉพาะทาง
50
+ allowed-tools:
51
+ - Read
52
+ - Grep
53
+ disallowed-tools:
54
+ - Bash
55
+ - Edit
56
+ model: claude-sonnet-4-6
57
+ effort: high
58
+ user-invocable: true
59
+ context: fork
60
+ ---</code></pre>
61
+
62
+ <h2>การสร้างสกิล</h2>
63
+ <pre><code>mkdir -p ~/.claude/skills/my-skill
64
+ touch ~/.claude/skills/my-skill/SKILL.md
65
+ # แก้ไข SKILL.md ด้วย frontmatter และคำแนะนำ</code></pre>
66
+
67
+ <h2>สกิลระดับโปรเจกต์</h2>
68
+ <p>วางสกิลใน <code>.claude/skills/</code> ภายใน repository ของคุณเพื่อแชร์กับทีม:</p>
69
+ <pre><code>.claude/
70
+ skills/
71
+ code-review/
72
+ SKILL.md
73
+ migration-workflow/
74
+ SKILL.md</code></pre>
75
+
76
+ <footer class="footer">
77
+ <span>Clew Code v0.2.7 — โอเพนซอร์ส</span>
78
+ <div class="footer-links">
79
+ <a href="https://github.com/ClewCode/ClewCode">GitHub</a>
80
+ <a href="https://github.com/ClewCode/ClewCode/issues">ปัญหา</a>
81
+ </div>
82
+ </footer>
83
+ </main>
84
+ <nav class="toc-sidebar"></nav>
85
+ </div>
86
+ </div>
87
+ <script src="js/main.js"></script>
88
+ </body>
89
+ </html>
90
+
package/docs/tools.html CHANGED
@@ -1,169 +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 50+ built-in tools 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.</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>CodeIndex</code> (CodeIndexTool)</td><td>Fuzzy code search across indexed codebase (feature-gated: CODE_INDEX)</td></tr>
63
- <tr><td><code>ToolSearch</code> (ToolSearchTool)</td><td>Keyword search for deferred/lazy-loaded tools</td></tr>
64
- </table>
65
-
66
- <h2>Browser &amp; Automation</h2>
67
- <table>
68
- <tr><th>Tool</th><th>Description</th></tr>
69
- <tr><td><code>Browser</code> (BrowserTool)</td><td>Stealth Playwright browser navigate, click, type, screenshot, extract, fill forms</td></tr>
70
- <tr><td><code>ComputerUse</code> (ComputerUseTool)</td><td>Windows-only computer use automation (feature-gated: ENABLE_COMPUTER_USE)</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>.claude/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>CodeIndex</code></td><td><code>CODE_INDEX</code> feature</td><td>Fuzzy code search</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>CLAUDE_CODE_SIMPLE mode</strong>
153
- 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>.
154
- </div>
155
-
156
- <footer class="footer">
157
- <span>Clew Code v0.2.4 — Open Source</span>
158
- <div class="footer-links">
159
- <a href="https://github.com/JonusNattapong/ClewCode">GitHub</a>
160
- <a href="https://github.com/JonusNattapong/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>
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
+