clew-code 0.2.6 → 0.2.8
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.
- package/README.md +292 -264
- package/dist/main.js +2835 -2950
- package/docs/architecture.html +148 -145
- package/docs/architecture.th.html +79 -78
- package/docs/clew-code-architecture.html +1125 -0
- package/docs/commands.html +224 -223
- package/docs/commands.th.html +131 -130
- package/docs/configuration.html +147 -145
- package/docs/configuration.th.html +108 -106
- package/docs/css/styles.css +48 -42
- package/docs/daemon.html +129 -128
- package/docs/daemon.th.html +73 -72
- package/docs/features/bridge-mode.html +99 -98
- package/docs/features/bridge-mode.th.html +90 -89
- package/docs/features/evals.html +182 -181
- package/docs/features/evals.th.html +90 -89
- package/docs/features/peer.html +178 -177
- package/docs/features/searxng-search.html +151 -150
- package/docs/features/searxng-search.th.html +95 -94
- package/docs/features/sentry-setup.html +157 -156
- package/docs/features/sentry-setup.th.html +97 -96
- package/docs/index.html +299 -298
- package/docs/index.th.html +292 -290
- package/docs/installation.html +105 -103
- package/docs/installation.th.html +105 -103
- package/docs/internals/growthbook-ab-testing.html +113 -112
- package/docs/internals/growthbook-ab-testing.th.html +81 -80
- package/docs/internals/hidden-features.html +149 -147
- package/docs/internals/hidden-features.th.html +109 -107
- package/docs/js/main.js +83 -3
- package/docs/loop.html +181 -180
- package/docs/loop.th.html +227 -226
- package/docs/mcp.html +247 -246
- package/docs/mcp.th.html +207 -206
- package/docs/models.html +111 -110
- package/docs/models.th.html +61 -60
- package/docs/peer.html +236 -235
- package/docs/peer.th.html +280 -279
- package/docs/permission-model.html +102 -101
- package/docs/permission-model.th.html +67 -66
- package/docs/plugins.html +102 -101
- package/docs/plugins.th.html +79 -78
- package/docs/providers.html +126 -117
- package/docs/providers.th.html +80 -78
- package/docs/quick-start.html +93 -92
- package/docs/quick-start.th.html +40 -39
- package/docs/research-memory.html +82 -79
- package/docs/research-memory.th.html +72 -71
- package/docs/skills.html +117 -116
- package/docs/skills.th.html +90 -89
- package/docs/tools.html +170 -169
- package/docs/tools.th.html +84 -83
- package/docs/troubleshooting.html +106 -105
- package/docs/troubleshooting.th.html +85 -84
- package/package.json +3 -1
- package/docs/taste.html +0 -436
- package/docs/taste.th.html +0 -236
package/docs/skills.th.html
CHANGED
|
@@ -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
|
|
7
|
-
<meta name="description" content="
|
|
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"
|
|
19
|
-
<h1
|
|
20
|
-
<p class="section-subtitle"
|
|
21
|
-
|
|
22
|
-
<h2
|
|
23
|
-
<p
|
|
24
|
-
|
|
25
|
-
<h2
|
|
26
|
-
<p
|
|
27
|
-
<table>
|
|
28
|
-
<tr><th
|
|
29
|
-
<tr><td>Bundled</td><td
|
|
30
|
-
<tr><td
|
|
31
|
-
<tr><td
|
|
32
|
-
<tr><td
|
|
33
|
-
</table>
|
|
34
|
-
|
|
35
|
-
<h2
|
|
36
|
-
<pre><code>my-skill/
|
|
37
|
-
SKILL.md #
|
|
38
|
-
assets/ #
|
|
39
|
-
|
|
40
|
-
<h2
|
|
41
|
-
<pre><code>/skill #
|
|
42
|
-
/skills #
|
|
43
|
-
/skill-name #
|
|
44
|
-
|
|
45
|
-
<h2>Frontmatter
|
|
46
|
-
<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
|
|
63
|
-
<pre><code>mkdir -p ~/.claude/skills/my-skill
|
|
64
|
-
touch ~/.claude/skills/my-skill/SKILL.md
|
|
65
|
-
#
|
|
66
|
-
|
|
67
|
-
<h2
|
|
68
|
-
<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.
|
|
78
|
-
<div class="footer-links">
|
|
79
|
-
<a href="https://github.com/
|
|
80
|
-
<a href="https://github.com/
|
|
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/<name>/SKILL.md</code></td><td>ส่วนตัว</td></tr>
|
|
31
|
+
<tr><td>โปรเจà¸à¸•์</td><td><code>.claude/skills/<name>/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
|
|
7
|
-
<meta name="description" content="Complete reference for built-in tools in 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&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
|
|
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 & 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 & 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 & 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>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
<tr><
|
|
69
|
-
<tr><td><code>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
<tr><
|
|
76
|
-
<tr><td><code>
|
|
77
|
-
<tr><td><code>
|
|
78
|
-
<tr><td><code>
|
|
79
|
-
<tr><td><code>
|
|
80
|
-
<tr><td><code>
|
|
81
|
-
<tr><td><code>
|
|
82
|
-
<tr><td><code>
|
|
83
|
-
<tr><td><code>
|
|
84
|
-
<tr><td><code>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<tr><
|
|
93
|
-
<tr><td
|
|
94
|
-
<tr><td>Select <code>
|
|
95
|
-
<tr><td>Select <code>
|
|
96
|
-
<tr><td>Select <code>
|
|
97
|
-
<tr><td
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<li><strong>
|
|
103
|
-
<li
|
|
104
|
-
<li>
|
|
105
|
-
<li>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
<tr><
|
|
119
|
-
<tr><td><code>
|
|
120
|
-
<tr><td
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
<tr><
|
|
127
|
-
<tr><td><code>
|
|
128
|
-
<tr><td><code>
|
|
129
|
-
<tr><td><code>
|
|
130
|
-
<tr><td><code>
|
|
131
|
-
<tr><td><code>
|
|
132
|
-
<tr><td><code>
|
|
133
|
-
<tr><td><code>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
<li><strong>
|
|
141
|
-
<li><strong>
|
|
142
|
-
<li><strong>
|
|
143
|
-
<li><strong>
|
|
144
|
-
<li><strong>
|
|
145
|
-
<li><strong>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
<a href="https://github.com/
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
</div>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
</
|
|
169
|
-
|
|
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 & 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 & 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 & 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 & 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 & 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 & 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
|
+
|