clew-code 0.2.21 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -45
- package/dist/main.js +2906 -2722
- package/docs/architecture.html +91 -148
- package/docs/assets/clew-agent-loop.png +0 -0
- package/docs/assets/clew-general-architecture.png +0 -0
- package/docs/assets/clew-mcp-architecture.png +0 -0
- package/docs/assets/clew-p2p-swarm.png +0 -0
- package/docs/changelog.html +150 -0
- package/docs/cli-reference.html +90 -0
- package/docs/commands.html +133 -241
- package/docs/configuration.html +85 -147
- package/docs/contributing.html +91 -0
- package/docs/css/styles.css +272 -152
- package/docs/daemon.html +62 -129
- package/docs/features/bridge-mode.html +61 -66
- package/docs/features/evals.html +57 -149
- package/docs/features/searxng-search.html +58 -118
- package/docs/features/sentry-setup.html +61 -124
- package/docs/index.html +185 -148
- package/docs/installation.html +77 -105
- package/docs/internals/growthbook-ab-testing.html +69 -91
- package/docs/internals/hidden-features.html +81 -143
- package/docs/js/main.js +29 -0
- package/docs/loop.html +69 -181
- package/docs/mcp.html +99 -247
- package/docs/models.html +63 -92
- package/docs/permission-model.html +86 -102
- package/docs/plugins.html +84 -102
- package/docs/providers.html +87 -127
- package/docs/quick-start.html +81 -93
- package/docs/research-memory.html +71 -102
- package/docs/security.html +71 -0
- package/docs/skills.html +67 -117
- package/docs/swarm.html +78 -236
- package/docs/tools.html +183 -171
- package/docs/troubleshooting.html +86 -106
- package/docs/voice-mode.html +79 -0
- package/package.json +1 -1
- package/docs/architecture.th.html +0 -79
- package/docs/clew-code-architecture.html +0 -1126
- package/docs/commands.th.html +0 -269
- package/docs/configuration.th.html +0 -108
- package/docs/daemon.th.html +0 -73
- package/docs/features/bridge-mode.th.html +0 -62
- package/docs/features/evals.th.html +0 -62
- package/docs/features/searxng-search.th.html +0 -67
- package/docs/features/sentry-setup.th.html +0 -69
- package/docs/features/swarm.html +0 -156
- package/docs/generated/providers.html +0 -625
- package/docs/generated/tools.html +0 -558
- package/docs/index.th.html +0 -292
- package/docs/installation.th.html +0 -105
- package/docs/internals/growthbook-ab-testing.th.html +0 -60
- package/docs/internals/hidden-features.th.html +0 -107
- package/docs/loop.th.html +0 -227
- package/docs/mcp.th.html +0 -207
- package/docs/models.th.html +0 -61
- package/docs/permission-model.th.html +0 -67
- package/docs/plugins.th.html +0 -79
- package/docs/prompts-and-features.html +0 -806
- package/docs/providers.th.html +0 -81
- package/docs/quick-start.th.html +0 -89
- package/docs/research-memory.th.html +0 -72
- package/docs/skills.th.html +0 -90
- package/docs/swarm.th.html +0 -280
- package/docs/tools.th.html +0 -84
- package/docs/troubleshooting.th.html +0 -85
|
@@ -0,0 +1,79 @@
|
|
|
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>Voice Mode — Clew Code</title>
|
|
7
|
+
<meta name="description" content="Voice input mode using microphone and OpenAI Whisper API.">
|
|
8
|
+
<link rel="icon" type="image/svg+xml" href="assets/clew.svg">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
11
|
+
<link rel="stylesheet" href="css/styles.css">
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<header class="header"></header>
|
|
15
|
+
<div id="sidebarOverlay" class="sidebar-overlay"></div>
|
|
16
|
+
<aside id="sidebar" class="sidebar"></aside>
|
|
17
|
+
|
|
18
|
+
<div class="content-wrap">
|
|
19
|
+
<div class="content">
|
|
20
|
+
|
|
21
|
+
<div class="breadcrumbs"><a href="index.html">Home</a><span class="sep">/</span><span class="current">Voice Mode</span></div>
|
|
22
|
+
|
|
23
|
+
<h1>Voice Mode</h1>
|
|
24
|
+
<p class="sub">Use your voice to interact with Clew Code via microphone input and OpenAI Whisper transcription.</p>
|
|
25
|
+
|
|
26
|
+
<h2 id="overview">Overview</h2>
|
|
27
|
+
<p>Voice mode captures audio from your microphone, transcribes it using OpenAI's Whisper API, and feeds the transcribed text to the agent as regular input.</p>
|
|
28
|
+
|
|
29
|
+
<h2 id="setup">Setup</h2>
|
|
30
|
+
<h3>1. Set OpenAI API Key</h3>
|
|
31
|
+
<pre><code class="language-bash">export OPENAI_API_KEY=sk-...
|
|
32
|
+
</code></pre>
|
|
33
|
+
|
|
34
|
+
<h3>2. Install SoX (required for recording)</h3>
|
|
35
|
+
<p><strong>macOS:</strong></p>
|
|
36
|
+
<pre><code class="language-bash">brew install sox
|
|
37
|
+
</code></pre>
|
|
38
|
+
<p><strong>Ubuntu/Debian:</strong></p>
|
|
39
|
+
<pre><code class="language-bash">sudo apt-get install sox
|
|
40
|
+
</code></pre>
|
|
41
|
+
<p><strong>Windows:</strong><br>
|
|
42
|
+
Download from <a href="https://sox.sourceforge.net">sox.sourceforge.net</a></p>
|
|
43
|
+
|
|
44
|
+
<h2 id="usage">Usage</h2>
|
|
45
|
+
<pre><code class="language-bash">❯ /voice # activate voice mode
|
|
46
|
+
❯ /voice status # check voice session status
|
|
47
|
+
❯ /voice off # deactivate voice mode
|
|
48
|
+
</code></pre>
|
|
49
|
+
<p>Once voice mode is active, press <strong>F2</strong> to start/stop recording.</p>
|
|
50
|
+
|
|
51
|
+
<h2 id="how-it-works">How It Works</h2>
|
|
52
|
+
<pre><code>User presses F2
|
|
53
|
+
↓
|
|
54
|
+
VoiceRecorder.start() → Microphone → PCM audio chunks
|
|
55
|
+
↓
|
|
56
|
+
VoiceRecorder.stop() → Buffer.concat → WAV conversion
|
|
57
|
+
↓
|
|
58
|
+
VoiceWhisper.transcribe() → OpenAI Whisper API
|
|
59
|
+
↓
|
|
60
|
+
Session.handleInput(transcribedText) → Normal command flow
|
|
61
|
+
</code></pre>
|
|
62
|
+
|
|
63
|
+
<h2 id="files">Key Files</h2>
|
|
64
|
+
<table>
|
|
65
|
+
<thead>
|
|
66
|
+
<tr><th>File</th><th>Purpose</th></tr>
|
|
67
|
+
</thead>
|
|
68
|
+
<tbody>
|
|
69
|
+
<tr><td><code>src/tools/voiceRecorder.ts</code></td><td>Microphone recording via node-record-lpcm16</td></tr>
|
|
70
|
+
<tr><td><code>src/tools/voiceWhisper.ts</code></td><td>OpenAI Whisper API for speech-to-text</td></tr>
|
|
71
|
+
<tr><td><code>src/tools/voiceTools.ts</code></td><td>Voice session management (start/stop/transcribe)</td></tr>
|
|
72
|
+
</tbody>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<script src="js/main.js"></script>
|
|
78
|
+
</body>
|
|
79
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,79 +0,0 @@
|
|
|
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 CLI">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&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 คือผู้ช่วยเขียนโค้ด AI บนเทอร์มินัล — React/Ink TUI, CLI Commander.js, เครื่องยนต์ AI หลายผู้ให้บริการ, และรันไทม์เครื่องมือ/ปลั๊กอินที่ขยายได้ในกระบวนการเดียว</p>
|
|
21
|
-
|
|
22
|
-
<h2>การออกแบบแบบชั้น</h2>
|
|
23
|
-
<p>แอปพลิเคชันถูกจัดโครงสร้างเป็นสี่ชั้นที่ทำงานร่วมกัน:</p>
|
|
24
|
-
|
|
25
|
-
<h3>1. Terminal UI (React 19 + Ink 6)</h3>
|
|
26
|
-
<p>แสดง REPL แบบโต้ตอบ: อินพุต prompt, ผลลัพธ์ markdown แบบสตรีม, แถบสถานะพร้อมมาตรวัดบริบท, สไปนเนอร์, กล่องโต้ตอบสิทธิ์, ตัวสำรวจไฟล์, และโหมดเต็มหน้าจอ</p>
|
|
27
|
-
|
|
28
|
-
<h3>2. CLI และชั้นคำสั่ง (Commander.js 13)</h3>
|
|
29
|
-
<p>จุดเข้าที่ <code>src/main.tsx</code> — แยกวิเคราะห์ CLI flags, โหลดการตั้งค่า, เริ่มต้นผู้ให้บริการและ telemetry, แล้วเปิด REPL หรือโหมดพิมพ์</p>
|
|
30
|
-
|
|
31
|
-
<h3>3. ชั้นผู้ให้บริการ AI และ Adapter</h3>
|
|
32
|
-
<p><strong>ProviderManager</strong> (<code>src/services/ai/ProviderManager.ts</code>) จัดการการแก้ไขคีย์ API, เลือกโมเดล, และจัดการการตั้งค่าผู้ให้บริการ ขณะนี้มี 27 ผู้ให้บริการ</p>
|
|
33
|
-
|
|
34
|
-
<h3>4. การดำเนินการเครื่องมือและ Query Loop</h3>
|
|
35
|
-
<p>เครื่องมือใช้ Zod schemas และดำเนินการโดย <strong>StreamingToolExecutor</strong> (<code>src/services/tools/StreamingToolExecutor.ts</code>)</p>
|
|
36
|
-
|
|
37
|
-
<h2>ระบบย่อยหลัก</h2>
|
|
38
|
-
|
|
39
|
-
<h3>MCP (Model Context Protocol)</h3>
|
|
40
|
-
<p><code>src/services/mcp/</code> — จัดการการเชื่อมต่อเซิร์ฟเวอร์ MCP ภายนอก, การค้นพบเครื่องมือ, การเข้าถึงทรัพยากร ดู <a href="mcp.th.html">MCP</a> สำหรับรายละเอียด</p>
|
|
41
|
-
|
|
42
|
-
<h3>ปลั๊กอินและฮุค</h3>
|
|
43
|
-
<p><code>src/services/plugins/</code> — การโหลดปลั๊กอิน, การติดตั้ง, การรวม marketplace, และการส่งฮุค</p>
|
|
44
|
-
|
|
45
|
-
<h3>โหมด Bridge</h3>
|
|
46
|
-
<p><code>src/bridge/bridgeMain.ts</code> — การควบคุมระยะไกลและการทำงานร่วมกันผ่าน WebSocket</p>
|
|
47
|
-
|
|
48
|
-
<h3>รันไทม์เอเจนต์</h3>
|
|
49
|
-
<p><code>src/agentRuntime/</code> — จัดการการจัดระเบียบหลายเอเจนต์</p>
|
|
50
|
-
|
|
51
|
-
<h3>อัตโนมัติ / Daemon</h3>
|
|
52
|
-
<p><code>src/services/autonomous/</code> — เปิดใช้งานการดำเนินการพื้นหลัง 24/7 คิวงาน, วนซ้ำเอเจนต์, โหมด daemon ดู <a href="daemon.th.html">โหมด Daemon</a></p>
|
|
53
|
-
|
|
54
|
-
<h2>พาธซอร์สที่สำคัญ</h2>
|
|
55
|
-
<table>
|
|
56
|
-
<tr><th>พาธ</th><th>บทบาท</th></tr>
|
|
57
|
-
<tr><td><code>src/main.tsx</code></td><td>จุดเข้า CLI, โปรแกรม Commander, การแยกวิเคราะห์ตัวเลือก, การเปิด REPL</td></tr>
|
|
58
|
-
<tr><td><code>src/query.ts</code></td><td>การประมวลผลคำถามหลัก, การสร้างข้อความ, วนซ้ำการเรียกใช้เครื่องมือ</td></tr>
|
|
59
|
-
<tr><td><code>src/commands.ts</code></td><td>ทะเบียนคำสั่ง slash (80+ คำสั่ง)</td></tr>
|
|
60
|
-
<tr><td><code>src/tools.ts</code></td><td>ทะเบียนเครื่องมือ (40+ เครื่องมือในตัว)</td></tr>
|
|
61
|
-
<tr><td><code>src/services/ai/ProviderManager.ts</code></td><td>การเลือกผู้ให้บริการ, การแก้ไขคีย์ API</td></tr>
|
|
62
|
-
<tr><td><code>src/services/ai/providers.json</code></td><td>การตั้งค่าผู้ให้บริการ (27 ผู้ให้บริการ)</td></tr>
|
|
63
|
-
</table>
|
|
64
|
-
|
|
65
|
-
<footer class="footer">
|
|
66
|
-
<span>Clew Code 0.2.14 — โอเพนซอร์ส</span>
|
|
67
|
-
<div class="footer-links">
|
|
68
|
-
<a href="https://github.com/ClewCode/ClewCode">GitHub</a>
|
|
69
|
-
<a href="https://github.com/ClewCode/ClewCode/issues">ปัญหา</a>
|
|
70
|
-
</div>
|
|
71
|
-
</footer>
|
|
72
|
-
</main>
|
|
73
|
-
<nav class="toc-sidebar"></nav>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
<script src="js/main.js"></script>
|
|
77
|
-
</body>
|
|
78
|
-
</html>
|
|
79
|
-
|