clew-code 0.3.2 → 0.3.4

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 (49) hide show
  1. package/README.md +196 -114
  2. package/dist/generated/version.json +1 -1
  3. package/dist/main.js +2963 -3272
  4. package/package.json +5 -5
  5. package/scripts/bun-run.mjs +33 -0
  6. package/scripts/postbuild-inject-macro.mjs +36 -0
  7. package/docs/.nojekyll +0 -0
  8. package/docs/_config.yml +0 -3
  9. package/docs/architecture.html +0 -90
  10. package/docs/assets/clew-agent-loop.png +0 -0
  11. package/docs/assets/clew-general-architecture.png +0 -0
  12. package/docs/assets/clew-mcp-architecture.png +0 -0
  13. package/docs/assets/clew-p2p-swarm.png +0 -0
  14. package/docs/assets/clew.svg +0 -33
  15. package/docs/changelog.html +0 -141
  16. package/docs/cli-reference.html +0 -89
  17. package/docs/commands.html +0 -161
  18. package/docs/configuration.html +0 -85
  19. package/docs/contributing.html +0 -91
  20. package/docs/css/styles.css +0 -545
  21. package/docs/daemon.html +0 -62
  22. package/docs/features/bridge-mode.html +0 -62
  23. package/docs/features/evals.html +0 -58
  24. package/docs/features/searxng-search.html +0 -59
  25. package/docs/features/sentry-setup.html +0 -62
  26. package/docs/generated/providers.html +0 -625
  27. package/docs/generated/tools.html +0 -559
  28. package/docs/index.html +0 -182
  29. package/docs/installation.html +0 -77
  30. package/docs/internals/claude-ai-backend-dependencies.md +0 -278
  31. package/docs/internals/growthbook-ab-testing.html +0 -70
  32. package/docs/internals/hidden-features.html +0 -82
  33. package/docs/internals/long-term-memory-design.md +0 -173
  34. package/docs/js/main.js +0 -438
  35. package/docs/loop.html +0 -69
  36. package/docs/mcp.html +0 -99
  37. package/docs/models.html +0 -81
  38. package/docs/permission-model.html +0 -86
  39. package/docs/personal-profile.html +0 -113
  40. package/docs/plugins.html +0 -84
  41. package/docs/providers.html +0 -625
  42. package/docs/quick-start.html +0 -81
  43. package/docs/research-memory.html +0 -71
  44. package/docs/security.html +0 -71
  45. package/docs/skills.html +0 -67
  46. package/docs/swarm.html +0 -78
  47. package/docs/tools.html +0 -559
  48. package/docs/troubleshooting.html +0 -86
  49. package/docs/voice-mode.html +0 -79
package/docs/models.html DELETED
@@ -1,81 +0,0 @@
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>Models — Clew Code</title>
7
- <meta name="description" href="Model configuration and selection in Clew Code.">
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">Models</span></div>
22
-
23
- <h1>Models</h1>
24
- <p class="sub">Select and configure AI models from any supported provider. Switch mid-session without restarting.</p>
25
-
26
- <h2 id="switching">Switching Models</h2>
27
- <p>Use the <code>/model</code> command in the REPL:</p>
28
- <pre><code class="language-bash">❯ /model # interactive provider/model picker
29
- ❯ /model openai # switch to OpenAI provider
30
- ❯ /model gpt-5.5 # set specific model
31
- ❯ /model list # list available models from all providers
32
- </code></pre>
33
-
34
- <h2 id="capabilities">Capability Tags</h2>
35
- <p>The <code>/model list</code> command fetches live model lists from provider APIs and displays capability tags:</p>
36
- <pre><code>deepseek-v4-flash [200K ctx, tools, reason, free]
37
- gpt-5.5 [128K ctx, vision, tools]
38
- claude-sonnet-5 [200K ctx, vision, tools, reason]
39
- gemini-2.0-flash [1M ctx, vision, tools, free]
40
- </code></pre>
41
- <p>Tags include context window size, vision support, tool calling, reasoning, and free tier availability.</p>
42
-
43
- <h2 id="reasoning">Reasoning Effort</h2>
44
- <p>For models that support configurable reasoning (DeepSeek, NVIDIA, OpenRouter, etc.):</p>
45
- <pre><code class="language-bash">❯ /effort low
46
- ❯ /effort medium
47
- ❯ /effort high
48
- </code></pre>
49
-
50
- <h2 id="local">Local Models (Ollama)</h2>
51
- <p>Run models locally with Ollama:</p>
52
- <pre><code class="language-bash">❯ /model ollama/llama3.3
53
- ❯ /model ollama/mistral
54
- ❯ /model ollama/codellama
55
- </code></pre>
56
- <p>Set the Ollama host:</p>
57
- <pre><code class="language-bash">export OLLAMA_HOST=http://localhost:11434
58
- </code></pre>
59
-
60
- <h2 id="image-gen">Image Generation Models</h2>
61
- <p><code>GenerateImage</code> auto-discovers image-capable models from provider APIs on first use:</p>
62
- <table>
63
- <thead><tr><th>Provider</th><th>Models Discovered</th><th>API Key</th></tr></thead>
64
- <tbody>
65
- <tr><td>OpenAI</td><td><code>dall-e-3</code>, future DALL-E versions</td><td><code>OPENAI_API_KEY</code></td></tr>
66
- <tr><td>OpenRouter</td><td><code>gemini-3.1-flash-image-preview</code>, <code>flux.2-pro</code>, <code>recraft-v3</code>, etc.</td><td><code>OPENROUTER_API_KEY</code></td></tr>
67
- <tr><td>Google</td><td><code>imagen-3.0-generate-002</code>, future Imagen versions</td><td><code>GOOGLE_API_KEY</code></td></tr>
68
- </tbody>
69
- </table>
70
- <p>To override auto-discovery, add <code>"capabilities": { "imageGen": { "defaultModel": "...", "apiType": "..." } }</code> to the provider in <code>providers.json</code>.</p>
71
-
72
- <h2 id="provider-defaults">Provider Defaults</h2>
73
- <p>Each provider has a default model. The first time you switch to a provider, its default model is selected automatically. Override with:</p>
74
- <pre><code class="language-bash">❯ /model deepseek-v4-flash
75
- </code></pre>
76
- </div>
77
- </div>
78
-
79
- <script src="js/main.js"></script>
80
- </body>
81
- </html>
@@ -1,86 +0,0 @@
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>Permission Model — Clew Code</title>
7
- <meta name="description" href="Permission modes and security model in Clew Code.">
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">Permission Model</span></div>
22
-
23
- <h1>Permission Model</h1>
24
- <p class="sub">Clew Code provides 7 permission modes with granular allow/deny rules for safe AI-assisted development.</p>
25
-
26
- <h2 id="modes">Permission Modes</h2>
27
- <table>
28
- <thead>
29
- <tr><th>Mode</th><th>Description</th></tr>
30
- </thead>
31
- <tbody>
32
- <tr><td><code>default</code></td><td>Ask for every tool execution. Maximum safety.</td></tr>
33
- <tr><td><code>ask</code></td><td>Prompt for confirmation on each action.</td></tr>
34
- <tr><td><code>plan</code></td><td>Full-access planning with bypass permissions. Read, write, edit freely during planning.</td></tr>
35
- <tr><td><code>auto</code></td><td>Auto-approve safe tools (read, grep, glob). Ask for destructive operations.</td></tr>
36
- <tr><td><code>acceptEdits</code></td><td>Auto-approve file edits within allowed patterns.</td></tr>
37
- <tr><td><code>bypassPermissions</code></td><td>Full access — all tools approved automatically.</td></tr>
38
- <tr><td><code>dontAsk</code></td><td>Execute everything without prompting. Use with caution.</td></tr>
39
- </tbody>
40
- </table>
41
-
42
- <h2 id="switching">Switching Modes</h2>
43
- <p>Use the <code>/permissions</code> command in the REPL:</p>
44
- <pre><code class="language-bash">❯ /permissions plan # enter full-access plan mode
45
- ❯ /permissions auto # auto-approve safe operations
46
- ❯ /permissions default # back to asking for each action
47
- </code></pre>
48
-
49
- <h2 id="rules">Allow/Deny Rules</h2>
50
- <p>Configure granular rules in <code>.clew/settings.json</code>:</p>
51
- <pre><code class="language-json">{
52
- "allow": [
53
- "bash: npm run dev",
54
- "bash: git status",
55
- "write: src/**"
56
- ],
57
- "deny": [
58
- "bash: rm -rf",
59
- "bash: git push --force"
60
- ]
61
- }
62
- </code></pre>
63
- <p>Rules support glob pattern matching against tool names and arguments.</p>
64
-
65
- <h2 id="safety">Safety Gates</h2>
66
- <p>The <code>safetyGate</code> system validates:</p>
67
- <ul>
68
- <li>Command paths — prevents execution of dangerous commands</li>
69
- <li>File paths — blocks writes outside project boundaries</li>
70
- <li>Destructive operations — requires explicit approval</li>
71
- <li>Bash output cap — 100 MB limit to prevent runaway processes</li>
72
- </ul>
73
-
74
- <h2 id="plan-mode">Plan Mode</h2>
75
- <p>Plan mode is a special full-access mode for architectural work:</p>
76
- <ul>
77
- <li>Read, write, and edit files without permission prompts</li>
78
- <li>Plan files persist to <code>.clew/plans/</code> with progress snapshots</li>
79
- <li>Exit with <code>ExitPlanMode</code> to present the plan for approval</li>
80
- </ul>
81
- </div>
82
- </div>
83
-
84
- <script src="js/main.js"></script>
85
- </body>
86
- </html>
@@ -1,113 +0,0 @@
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>Personal Profile — Clew Code</title>
7
- <meta name="description" content="Use Clew Code as a personal AI control center with delegation, memory, and skill creation.">
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">Personal Profile</span></div>
22
-
23
- <h1>Personal Profile</h1>
24
- <p class="sub">Personal profile turns Clew into a personal AI control center — plan, delegate, learn, and automate across sessions.</p>
25
-
26
- <h2 id="overview">Overview</h2>
27
- <p>Personal profile is designed for non-coding work: planning, research, personal automation, and overseeing delegated coding tasks. It uses memory across sessions, delegates coding to worker agents, and creates skills from experience.</p>
28
-
29
- <p>Switch with: <code>/profile personal</code> (or <code>/profile coding</code> to switch back).</p>
30
-
31
- <h2 id="capabilities">Key Capabilities</h2>
32
-
33
- <h3>Delegation</h3>
34
- <p>In personal profile, coding work is <strong>delegated</strong> — not done directly. Use the built-in <code>/delegate</code> skill (aliases: <code>/code</code>, <code>/worker</code>) to spawn a Codex worker via <code>process_peer</code> with a structured task description.</p>
35
- <p>The delegate handles the implementation; you review the results and report back to the user.</p>
36
-
37
- <h3>Memory-Driven Learning</h3>
38
- <p>Personal profile reads and writes memory proactively:</p>
39
- <ul>
40
- <li>On every session start, recalls user preferences and context from memory</li>
41
- <li>Writes to memory when learning preferences, corrections, or recurring patterns</li>
42
- <li>Connects dots across sessions — the user never repeats themselves</li>
43
- </ul>
44
-
45
- <h3>Skill Creation</h3>
46
- <p>When a multi-step process repeats, personal profile can create a reusable skill:</p>
47
- <ul>
48
- <li>Use <code>/skillify</code> to capture the current session's process as a skill</li>
49
- <li>Skills are saved to <code>.clew/skills/&lt;name&gt;/SKILL.md</code> (repo) or <code>~/.claude/skills/&lt;name&gt;/SKILL.md</code> (personal)</li>
50
- <li>Invoke with <code>/&lt;skill-name&gt;</code> anytime</li>
51
- </ul>
52
-
53
- <h3>Scheduling &amp; Autonomy</h3>
54
- <p>Background capabilities available in personal profile:</p>
55
- <ul>
56
- <li><code>/cron</code> — schedule recurring tasks (daily reports, reminders, audits)</li>
57
- <li><code>/loop</code> — repeated polling or watch tasks</li>
58
- <li><code>/task</code> — manage the persistent task queue</li>
59
- <li><code>/daemon</code> — 24/7 autonomous agent loop</li>
60
- </ul>
61
-
62
- <h2 id="workflow">Typical Workflow</h2>
63
-
64
- <ol>
65
- <li><strong>User asks for something</strong> (code, research, planning, automation)</li>
66
- <li><strong>Personal profile classifies the request</strong> — coding or non-coding?</li>
67
- <li><strong>Non-coding</strong> — handle directly (plan, research, answer, configure)</li>
68
- <li><strong>Coding</strong> — use <code>process_peer</code> to delegate to a Codex worker with a clear task brief</li>
69
- <li><strong>Review results</strong> — summarize what the worker did, what passed, what failed</li>
70
- <li><strong>Learn</strong> — if the process was repeatable, create a skill</li>
71
- <li><strong>Remember</strong> — save any preferences or decisions to memory</li>
72
- </ol>
73
-
74
- <h2 id="delegate-skill">The /delegate Skill</h2>
75
- <p>The built-in <code>/delegate</code> skill wraps the delegation workflow:</p>
76
- <ul>
77
- <li>Understand the requirement and plan the approach</li>
78
- <li>Create a structured task with goal, scope, files, constraints</li>
79
- <li>Spawn a Codex worker via <code>process_peer</code> with appropriate timeout</li>
80
- <li>Report results back: changes, pass/fail, blockers, next steps</li>
81
- </ul>
82
-
83
- <p>Invoke with: <code>/delegate Implement a login form</code> or use aliases <code>/code</code> or <code>/worker</code>.</p>
84
-
85
- <h2 id="comparison">Coding vs Personal Profile</h2>
86
- <table>
87
- <thead>
88
- <tr><th>Aspect</th><th>Coding</th><th>Personal</th></tr>
89
- </thead>
90
- <tbody>
91
- <tr><td>Primary role</td><td>Code implementation</td><td>Control center &amp; assistant</td></tr>
92
- <tr><td>Coding work</td><td>Direct file editing</td><td>Delegate to worker</td></tr>
93
- <tr><td>Memory usage</td><td>Project context</td><td>User preferences + cross-session</td></tr>
94
- <tr><td>Skill creation</td><td>Manual</td><td>Proactive + automatic</td></tr>
95
- <tr><td>Permission mode</td><td>As configured</td><td>Defaults to <code>ask</code></td></tr>
96
- <tr><td>Autonomy</td><td>Turn-based</td><td>Proactive, scheduled, daemon</td></tr>
97
- </tbody>
98
- </table>
99
-
100
- <h2 id="configuration">Configuration</h2>
101
-
102
- <p>Set the default profile in settings:</p>
103
- <pre><code>clew config set profile personal</code></pre>
104
-
105
- <p>Or pass at startup:</p>
106
- <pre><code>clew --profile personal</code></pre>
107
-
108
- </div>
109
- </div>
110
-
111
- <script src="js/main.js"></script>
112
- </body>
113
- </html>
package/docs/plugins.html DELETED
@@ -1,84 +0,0 @@
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>Plugins — Clew Code</title>
7
- <meta name="description" href="Plugin system, marketplace, and hooks in Clew Code.">
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">Plugins</span></div>
22
-
23
- <h1>Plugins</h1>
24
- <p class="sub">Extend Clew Code without touching source code. Plugins can add tools, hook into lifecycle events, and integrate with external systems.</p>
25
-
26
- <h2 id="overview">Overview</h2>
27
- <p>Plugins are self-contained packages with a manifest file that declare hooks, tools, and configurations. They are hot-reloadable — no restart needed.</p>
28
-
29
- <h2 id="lifecycle">Lifecycle Hooks</h2>
30
- <p>Plugins can hook into every stage of the agent lifecycle:</p>
31
- <table>
32
- <thead>
33
- <tr><th>Hook</th><th>Trigger</th></tr>
34
- </thead>
35
- <tbody>
36
- <tr><td><code>PreToolUse</code></td><td>Before a tool is executed</td></tr>
37
- <tr><td><code>PostToolUse</code></td><td>After a tool completes</td></tr>
38
- <tr><td><code>PreBash</code></td><td>Before a bash command runs</td></tr>
39
- <tr><td><code>PostPrompt</code></td><td>After a prompt is processed</td></tr>
40
- <tr><td><code>PreAcceptEdit</code></td><td>Before a file edit is applied</td></tr>
41
- </tbody>
42
- </table>
43
-
44
- <h2 id="commands">Plugin Commands</h2>
45
- <table>
46
- <thead>
47
- <tr><th>Command</th><th>Description</th></tr>
48
- </thead>
49
- <tbody>
50
- <tr><td><code>/plugin install &lt;name&gt;</code></td><td>Install a plugin from the marketplace</td></tr>
51
- <tr><td><code>/plugin list</code></td><td>List installed plugins</td></tr>
52
- <tr><td><code>/plugin remove &lt;name&gt;</code></td><td>Remove a plugin</td></tr>
53
- <tr><td><code>/plugin marketplace</code></td><td>Browse the plugin marketplace</td></tr>
54
- <tr><td><code>/hooks</code></td><td>View active hooks</td></tr>
55
- </tbody>
56
- </table>
57
-
58
- <h2 id="plugin-manifest">Plugin Manifest</h2>
59
- <p>Plugins declare themselves via a manifest:</p>
60
- <pre><code class="language-json">{
61
- "name": "my-plugin",
62
- "version": "1.0.0",
63
- "hooks": {
64
- "PreToolUse": "./pre-tool.js",
65
- "PostToolUse": "./post-tool.js"
66
- },
67
- "tools": [
68
- {
69
- "name": "my_custom_tool",
70
- "description": "A custom tool",
71
- "schema": { ... }
72
- }
73
- ]
74
- }
75
- </code></pre>
76
-
77
- <h2 id="marketplace">Plugin Marketplace</h2>
78
- <p>Discover and install community plugins via the built-in marketplace browser. Use <code>/plugin marketplace</code> to explore available plugins.</p>
79
- </div>
80
- </div>
81
-
82
- <script src="js/main.js"></script>
83
- </body>
84
- </html>