clew-code 0.4.9 → 0.6.0

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 (4) hide show
  1. package/README.md +118 -16
  2. package/dist/main.js +2616 -2260
  3. package/package.json +164 -162
  4. package/scripts/agent-room.ts +741 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- <img src="assets/clew-logo-long.png" alt="Clew Code" width="520" />
3
+ <img src="https://raw.githubusercontent.com/ClewCode/ClewCode/main/assets/clew-logo-long.png" alt="Clew Code" width="520" />
4
4
 
5
5
  ### *The agent that works where you do.*
6
6
 
@@ -22,12 +22,12 @@
22
22
  ---
23
23
 
24
24
  <p align="center">
25
- <img src="assets/screenshots/clew-code-repl.png" alt="Clew Code REPL" width="680" />
25
+ <img src="https://raw.githubusercontent.com/ClewCode/ClewCode/main/assets/screenshots/clew-code-repl.png" alt="Clew Code REPL" width="680" />
26
26
  </p>
27
27
 
28
28
  ---
29
29
 
30
- Clew Code is a terminal-native AI coding agent that lives in your repo, works with your API keys, and **doesn't phone home**. It reads your code, writes files, runs commands, and talks to any LLM you bring — all on your machine, no telemetry, no vendor lock-in.
30
+ Clew Code is a terminal-native AI coding agent that lives in your repo, works with your API keys, and **doesn't phone home**. It reads your code, writes files, runs commands, and talks to any LLM you bring — Claude, GPT, Gemini, DeepSeek, local Ollama models, and 20+ others — all on your machine, no telemetry, no vendor lock-in.
31
31
 
32
32
  If you want a coding assistant that feels local, fast, and doesn't ship your context to a third-party server, this is it.
33
33
 
@@ -38,6 +38,7 @@ If you want a coding assistant that feels local, fast, and doesn't ship your con
38
38
  - [Prerequisites](#prerequisites)
39
39
  - [Quick Install](#quick-install)
40
40
  - [Getting Started](#getting-started)
41
+ - [Usage Examples](#usage-examples)
41
42
  - [Features](#features)
42
43
  - [Use Cases](#use-cases)
43
44
  - [CLI Quick Reference](#cli-quick-reference)
@@ -80,6 +81,8 @@ irm https://raw.githubusercontent.com/ClewCode/ClewCode/main/scripts/install.ps1
80
81
  npm install -g clew-code
81
82
  ```
82
83
 
84
+ This installs two equivalent binaries: `clew` and `clewcode`.
85
+
83
86
  ---
84
87
 
85
88
  ## Getting Started
@@ -88,10 +91,76 @@ npm install -g clew-code
88
91
  cd your-project
89
92
  clew # Launch the REPL
90
93
  clew -p "fix the tests" # One-shot mode
91
- clew --resume last # Pick up where you left off
94
+ clew --resume last # Pick up where you left off
92
95
  ```
93
96
 
94
- First launch walks you through provider setup. After that, use `/model` to switch providers mid-session.
97
+ First launch walks you through provider setup — pick a provider (Claude, OpenAI, Gemini, OpenRouter, etc.) and enter an API key. This is saved to your local config, never committed. After that, use `/model` to switch providers mid-session.
98
+
99
+ ---
100
+
101
+ ## Usage Examples
102
+
103
+ ### Ask questions about a codebase
104
+
105
+ ```
106
+ > how does authentication work in this repo?
107
+ > where is the retry logic for API calls defined?
108
+ ```
109
+
110
+ Clew Code searches and reads files on its own — no need to paste code in.
111
+
112
+ ### Make a change
113
+
114
+ ```
115
+ > refactor the UserCard component to use the new Avatar component
116
+ ```
117
+
118
+ It reads the relevant files, edits them, and shows a diff-style summary of what changed. Prompts for permission before writing, unless you've set an auto-approve rule.
119
+
120
+ ### Fix and verify
121
+
122
+ ```
123
+ > fix the bug in src/utils/parser.ts where empty arrays throw
124
+ > run the test suite and fix any failures
125
+ ```
126
+
127
+ Combines file edits with the Bash tool (`npm test` / `bun test`), looping until tests pass or it needs your input.
128
+
129
+ ### Slash commands
130
+
131
+ ```
132
+ /help # list all commands
133
+ /model # switch LLM provider/model mid-session
134
+ /code-review # review the current diff for bugs
135
+ /debug # structured debugging workflow
136
+ /loop 5m /deploy-checklist # run a command on a recurring interval
137
+ ```
138
+
139
+ Run `/help` inside the REPL for the full, current list — commands grow over time via skills and plugins.
140
+
141
+ ### Multi-file / multi-step work
142
+
143
+ ```
144
+ > migrate all usages of the old Logger class to the new one across src/
145
+ ```
146
+
147
+ For larger jobs, Clew Code plans the work (`/plan`, or automatically for complex asks), then executes step by step, checking in at natural checkpoints. `/rewind` restores code or conversation to any prior checkpoint if something goes wrong.
148
+
149
+ ### Research a codebase or topic
150
+
151
+ ```
152
+ > /research "How does auth work in this repo?"
153
+ ```
154
+
155
+ Searches code, docs, and the web, then compiles a dossier with source references.
156
+
157
+ ### Connect external tools (MCP)
158
+
159
+ ```
160
+ > list open PRs assigned to me and summarize what's blocking each one
161
+ ```
162
+
163
+ Wire in GitHub, Slack, a database, or any [Model Context Protocol](https://modelcontextprotocol.io) server via `/mcp`, and use it from the same session.
95
164
 
96
165
  ---
97
166
 
@@ -104,7 +173,7 @@ First launch walks you through provider setup. After that, use `/model` to switc
104
173
  </tr>
105
174
  <tr>
106
175
  <td><strong>Persistent Memory</strong></td>
107
- <td>SQLite-backed, MiMo-inspired store with importance ranking, confidence scoring, and cross-session persistence. Auto-consolidation via Dream + Distill.</td>
176
+ <td>SQLite-backed store with importance ranking, confidence scoring, and cross-session persistence. Auto-consolidation via Dream + Distill.</td>
108
177
  </tr>
109
178
  <tr>
110
179
  <td><strong>76+ Tools</strong></td>
@@ -144,7 +213,7 @@ First launch walks you through provider setup. After that, use `/model` to switc
144
213
  </tr>
145
214
  <tr>
146
215
  <td><strong>Multi-Agent Architecture</strong></td>
147
- <td>Agents, Subagents, LAN Peers, Process Peers. Personal profile turns Clew into a command center that delegates to Codex workers.</td>
216
+ <td>Agents, Subagents, LAN Peers, Process Peers. Personal profile turns Clew into a command center that delegates to worker agents.</td>
148
217
  </tr>
149
218
  </table>
150
219
 
@@ -241,7 +310,7 @@ Clew Code runs entirely on your machine. No code or context leaves your network
241
310
  - Prompts for permission before read, write, or terminal execution
242
311
  - Fine-tune auto-approve rules per workspace
243
312
  - Permission scopes: default, ask, plan, auto
244
- - Guardian system for auto-review using secondary LLM
313
+ - Guardian system for auto-review using a secondary LLM
245
314
 
246
315
  ---
247
316
 
@@ -292,27 +361,54 @@ Also available on the [GitHub Wiki](https://github.com/ClewCode/ClewCode/wiki).
292
361
  └──────┘└──────────┘└──────────────┘
293
362
  ```
294
363
 
364
+ - **Entry**: `src/main.tsx` → `src/replLauncher.tsx` boots the Ink/React 19 REPL
365
+ - **REPL screen**: `src/screens/REPL.tsx` routes input to commands or the query engine
366
+ - **Query loop**: `src/QueryEngine.ts` — message construction, tool loop, provider routing, streaming
367
+ - **Providers**: `src/services/ai/` — 29 providers behind one interface, normalized errors/usage
368
+ - **Tools**: `src/tools/<ToolName>/`, each extending `Tool` from `src/Tool.ts`, registered in `src/tools.ts`
369
+ - **Services**: `src/services/` — MCP client, autonomous task queue, memory consolidation, session search, plugin lifecycle hooks, and more
370
+
371
+ Full detail, including the tool inventory and service list: [AGENTS.md](AGENTS.md).
372
+
295
373
  ---
296
374
 
297
375
  ## Development
298
376
 
299
377
  ```bash
300
- bun run dev # Live-reload REPL
378
+ git clone https://github.com/ClewCode/ClewCode.git
379
+ cd ClewCode
380
+ bun install
381
+ bun run dev # Live-reload REPL (with feature flags)
382
+ bun run dev:channels # Dev with development channels loaded
301
383
  bun run build # Production build to dist/
384
+ bun run start # Run the compiled build
302
385
  bun test # Vitest suite
303
- bun run check:ci # Biome lint + format check
304
- bun x tsc --noEmit # TypeScript check
386
+ bun test --bail # Stop on first failure
387
+ npx vitest run path/to/file.test.ts # Single file
388
+ npx vitest run -t "test name" # By test name
389
+ bun run check:ci # Biome lint + format check (no autofix)
390
+ bun run lint # Biome lint with autofix
391
+ bun run check # Lint + format with autofix
392
+ bun x tsc --noEmit # TypeScript check only
305
393
  ```
306
394
 
307
- ### Full Pre-Commit
395
+ ### Full Pre-Push Gate
308
396
 
309
397
  ```bash
310
398
  bun run check:ci && bun x tsc --noEmit && bun test --bail
311
399
  ```
312
400
 
313
- ### Shadow `.js` Files
401
+ Or run the `/clew-verify` skill, which runs the full gate and a real CLI smoke test — green tests alone don't prove an Ink TUI feature actually works.
402
+
403
+ ### ✅ Shadow `.js` Files — Resolved
404
+
405
+ The JS→TS migration is complete. All 401 `.js` shadow files that sat alongside `.ts`/`.tsx` twins have been removed. **Zero shadow pairs remain** — the `/js-shadow-sync` skill has been removed.
406
+
407
+ Any `.js` file still in `src/` is a genuine JS source module (no `.ts` twin exists).
408
+
409
+ ### Release
314
410
 
315
- `src/` has ~410 `.js` files alongside `.ts` twins (leftover from JS TS migration). Bun resolves `.js` import specifiers to the real `.js` file on disk it does **not** prefer the `.ts` source. If you're making a runtime fix, check for a `.js` sibling and edit **both** files.
411
+ Pushing a `v*` tag triggers the GitHub Actions release and npm publish. Before tagging: bump `package.json`, update `CHANGELOG.md`, run the full gate above. See [AGENTS.md § Release](AGENTS.md#release) or run the `/clew-release` skill.
316
412
 
317
413
  ---
318
414
 
@@ -322,13 +418,19 @@ Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines
322
418
 
323
419
  - Report bugs via [GitHub Issues](https://github.com/ClewCode/ClewCode/issues)
324
420
  - Discuss ideas in [GitHub Discussions](https://github.com/ClewCode/ClewCode/discussions)
325
- - Read [AGENTS.md](AGENTS.md) for architecture and code conventions
421
+ - Read [AGENTS.md](AGENTS.md) for full architecture and code conventions
326
422
 
327
423
  ---
328
424
 
329
425
  ## Star History
330
426
 
331
- [![Star History Chart](https://api.star-history.com/svg?repos=ClewCode/ClewCode&type=Date)](https://star-history.com/#ClewCode/ClewCode&Date)
427
+ <a href="https://www.star-history.com/?repos=ClewCode%2FClewCode&type=date&legend=top-left">
428
+ <picture>
429
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=ClewCode/ClewCode&type=date&theme=dark&legend=top-left&sealed_token=WOidmKAjTf9NlhzAYdnD299FcNzk3PFmRMroFl8z5CwNew4tB6fhqDAyJqdL3zexXKCpw_12pZ3EOxGEbHT5pMKdM4a2K40Q7Y0ox5ei_IutRqkuUMOdkQ" />
430
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=ClewCode/ClewCode&type=date&legend=top-left&sealed_token=WOidmKAjTf9NlhzAYdnD299FcNzk3PFmRMroFl8z5CwNew4tB6fhqDAyJqdL3zexXKCpw_12pZ3EOxGEbHT5pMKdM4a2K40Q7Y0ox5ei_IutRqkuUMOdkQ" />
431
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=ClewCode/ClewCode&type=date&legend=top-left&sealed_token=WOidmKAjTf9NlhzAYdnD299FcNzk3PFmRMroFl8z5CwNew4tB6fhqDAyJqdL3zexXKCpw_12pZ3EOxGEbHT5pMKdM4a2K40Q7Y0ox5ei_IutRqkuUMOdkQ" />
432
+ </picture>
433
+ </a>
332
434
 
333
435
  ---
334
436