@rozek/nanoclaw 1.2.17
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/.claude/settings.json +1 -0
- package/.claude/skills/add-compact/SKILL.md +135 -0
- package/.claude/skills/add-discord/SKILL.md +203 -0
- package/.claude/skills/add-gmail/SKILL.md +220 -0
- package/.claude/skills/add-image-vision/SKILL.md +94 -0
- package/.claude/skills/add-ollama-tool/SKILL.md +153 -0
- package/.claude/skills/add-parallel/SKILL.md +290 -0
- package/.claude/skills/add-pdf-reader/SKILL.md +104 -0
- package/.claude/skills/add-reactions/SKILL.md +117 -0
- package/.claude/skills/add-slack/SKILL.md +207 -0
- package/.claude/skills/add-telegram/SKILL.md +222 -0
- package/.claude/skills/add-telegram-swarm/SKILL.md +384 -0
- package/.claude/skills/add-voice-transcription/SKILL.md +148 -0
- package/.claude/skills/add-whatsapp/SKILL.md +372 -0
- package/.claude/skills/convert-to-apple-container/SKILL.md +175 -0
- package/.claude/skills/customize/SKILL.md +110 -0
- package/.claude/skills/debug/SKILL.md +349 -0
- package/.claude/skills/get-qodo-rules/SKILL.md +122 -0
- package/.claude/skills/get-qodo-rules/references/output-format.md +41 -0
- package/.claude/skills/get-qodo-rules/references/pagination.md +33 -0
- package/.claude/skills/get-qodo-rules/references/repository-scope.md +26 -0
- package/.claude/skills/qodo-pr-resolver/SKILL.md +326 -0
- package/.claude/skills/qodo-pr-resolver/resources/providers.md +329 -0
- package/.claude/skills/setup/SKILL.md +218 -0
- package/.claude/skills/update-nanoclaw/SKILL.md +235 -0
- package/.claude/skills/update-skills/SKILL.md +130 -0
- package/.claude/skills/use-local-whisper/SKILL.md +152 -0
- package/.claude/skills/x-integration/SKILL.md +417 -0
- package/.claude/skills/x-integration/agent.ts +243 -0
- package/.claude/skills/x-integration/host.ts +159 -0
- package/.claude/skills/x-integration/lib/browser.ts +148 -0
- package/.claude/skills/x-integration/lib/config.ts +62 -0
- package/.claude/skills/x-integration/scripts/like.ts +56 -0
- package/.claude/skills/x-integration/scripts/post.ts +66 -0
- package/.claude/skills/x-integration/scripts/quote.ts +80 -0
- package/.claude/skills/x-integration/scripts/reply.ts +74 -0
- package/.claude/skills/x-integration/scripts/retweet.ts +62 -0
- package/.claude/skills/x-integration/scripts/setup.ts +87 -0
- package/.env.example +1 -0
- package/.github/CODEOWNERS +10 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- package/.github/workflows/bump-version.yml +32 -0
- package/.github/workflows/ci.yml +25 -0
- package/.github/workflows/merge-forward-skills.yml +160 -0
- package/.github/workflows/update-tokens.yml +42 -0
- package/.husky/pre-commit +1 -0
- package/.mcp.json +3 -0
- package/.nvmrc +1 -0
- package/.prettierrc +3 -0
- package/CHANGELOG.md +8 -0
- package/CLAUDE.md +64 -0
- package/CONTRIBUTING.md +23 -0
- package/CONTRIBUTORS.md +15 -0
- package/LICENSE +21 -0
- package/NanoClaw_with_Web-Support.md +290 -0
- package/README.md +261 -0
- package/README_zh.md +200 -0
- package/assets/nanoclaw-favicon.png +0 -0
- package/assets/nanoclaw-icon.png +0 -0
- package/assets/nanoclaw-logo-dark.png +0 -0
- package/assets/nanoclaw-logo.png +0 -0
- package/assets/nanoclaw-profile.jpeg +0 -0
- package/assets/nanoclaw-sales.png +0 -0
- package/assets/social-preview.jpg +0 -0
- package/config-examples/mount-allowlist.json +25 -0
- package/container/Dockerfile +70 -0
- package/container/agent-runner/package-lock.json +1524 -0
- package/container/agent-runner/package.json +21 -0
- package/container/agent-runner/src/index.ts +558 -0
- package/container/agent-runner/src/ipc-mcp-stdio.ts +338 -0
- package/container/agent-runner/tsconfig.json +15 -0
- package/container/build.sh +23 -0
- package/container/skills/agent-browser/SKILL.md +159 -0
- package/container/skills/capabilities/SKILL.md +100 -0
- package/container/skills/status/SKILL.md +104 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/index.js +9 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/registry.d.ts +13 -0
- package/dist/channels/registry.d.ts.map +1 -0
- package/dist/channels/registry.js +11 -0
- package/dist/channels/registry.js.map +1 -0
- package/dist/channels/registry.test.d.ts +2 -0
- package/dist/channels/registry.test.d.ts.map +1 -0
- package/dist/channels/registry.test.js +32 -0
- package/dist/channels/registry.test.js.map +1 -0
- package/dist/channels/web.d.ts +2 -0
- package/dist/channels/web.d.ts.map +1 -0
- package/dist/channels/web.js +1738 -0
- package/dist/channels/web.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +182 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +36 -0
- package/dist/config.js.map +1 -0
- package/dist/container-runner.d.ts +44 -0
- package/dist/container-runner.d.ts.map +1 -0
- package/dist/container-runner.js +467 -0
- package/dist/container-runner.js.map +1 -0
- package/dist/container-runner.test.d.ts +2 -0
- package/dist/container-runner.test.d.ts.map +1 -0
- package/dist/container-runner.test.js +150 -0
- package/dist/container-runner.test.js.map +1 -0
- package/dist/container-runtime.d.ts +22 -0
- package/dist/container-runtime.d.ts.map +1 -0
- package/dist/container-runtime.js +96 -0
- package/dist/container-runtime.js.map +1 -0
- package/dist/container-runtime.test.d.ts +2 -0
- package/dist/container-runtime.test.d.ts.map +1 -0
- package/dist/container-runtime.test.js +93 -0
- package/dist/container-runtime.test.js.map +1 -0
- package/dist/credential-proxy.d.ts +21 -0
- package/dist/credential-proxy.d.ts.map +1 -0
- package/dist/credential-proxy.js +95 -0
- package/dist/credential-proxy.js.map +1 -0
- package/dist/credential-proxy.test.d.ts +2 -0
- package/dist/credential-proxy.test.d.ts.map +1 -0
- package/dist/credential-proxy.test.js +134 -0
- package/dist/credential-proxy.test.js.map +1 -0
- package/dist/db.d.ts +115 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +549 -0
- package/dist/db.js.map +1 -0
- package/dist/db.test.d.ts +2 -0
- package/dist/db.test.d.ts.map +1 -0
- package/dist/db.test.js +360 -0
- package/dist/db.test.js.map +1 -0
- package/dist/env.d.ts +8 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +42 -0
- package/dist/env.js.map +1 -0
- package/dist/formatting.test.d.ts +2 -0
- package/dist/formatting.test.d.ts.map +1 -0
- package/dist/formatting.test.js +183 -0
- package/dist/formatting.test.js.map +1 -0
- package/dist/group-folder.d.ts +5 -0
- package/dist/group-folder.d.ts.map +1 -0
- package/dist/group-folder.js +44 -0
- package/dist/group-folder.js.map +1 -0
- package/dist/group-folder.test.d.ts +2 -0
- package/dist/group-folder.test.d.ts.map +1 -0
- package/dist/group-folder.test.js +29 -0
- package/dist/group-folder.test.js.map +1 -0
- package/dist/group-queue.d.ts +34 -0
- package/dist/group-queue.d.ts.map +1 -0
- package/dist/group-queue.js +263 -0
- package/dist/group-queue.js.map +1 -0
- package/dist/group-queue.test.d.ts +2 -0
- package/dist/group-queue.test.d.ts.map +1 -0
- package/dist/group-queue.test.js +341 -0
- package/dist/group-queue.test.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +518 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc-auth.test.d.ts +2 -0
- package/dist/ipc-auth.test.d.ts.map +1 -0
- package/dist/ipc-auth.test.js +434 -0
- package/dist/ipc-auth.test.js.map +1 -0
- package/dist/ipc.d.ts +32 -0
- package/dist/ipc.d.ts.map +1 -0
- package/dist/ipc.js +311 -0
- package/dist/ipc.js.map +1 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +14 -0
- package/dist/logger.js.map +1 -0
- package/dist/mount-security.d.ts +34 -0
- package/dist/mount-security.d.ts.map +1 -0
- package/dist/mount-security.js +325 -0
- package/dist/mount-security.js.map +1 -0
- package/dist/remote-control.d.ts +32 -0
- package/dist/remote-control.d.ts.map +1 -0
- package/dist/remote-control.js +185 -0
- package/dist/remote-control.js.map +1 -0
- package/dist/remote-control.test.d.ts +2 -0
- package/dist/remote-control.test.d.ts.map +1 -0
- package/dist/remote-control.test.js +321 -0
- package/dist/remote-control.test.js.map +1 -0
- package/dist/router.d.ts +8 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +37 -0
- package/dist/router.js.map +1 -0
- package/dist/routing.test.d.ts +2 -0
- package/dist/routing.test.d.ts.map +1 -0
- package/dist/routing.test.js +81 -0
- package/dist/routing.test.js.map +1 -0
- package/dist/sender-allowlist.d.ts +14 -0
- package/dist/sender-allowlist.d.ts.map +1 -0
- package/dist/sender-allowlist.js +79 -0
- package/dist/sender-allowlist.js.map +1 -0
- package/dist/sender-allowlist.test.d.ts +2 -0
- package/dist/sender-allowlist.test.d.ts.map +1 -0
- package/dist/sender-allowlist.test.js +186 -0
- package/dist/sender-allowlist.test.js.map +1 -0
- package/dist/session-commands.d.ts +47 -0
- package/dist/session-commands.d.ts.map +1 -0
- package/dist/session-commands.js +102 -0
- package/dist/session-commands.js.map +1 -0
- package/dist/session-commands.test.d.ts +2 -0
- package/dist/session-commands.test.d.ts.map +1 -0
- package/dist/session-commands.test.js +190 -0
- package/dist/session-commands.test.js.map +1 -0
- package/dist/task-scheduler.d.ts +22 -0
- package/dist/task-scheduler.d.ts.map +1 -0
- package/dist/task-scheduler.js +210 -0
- package/dist/task-scheduler.js.map +1 -0
- package/dist/task-scheduler.test.d.ts +2 -0
- package/dist/task-scheduler.test.d.ts.map +1 -0
- package/dist/task-scheduler.test.js +107 -0
- package/dist/task-scheduler.test.js.map +1 -0
- package/dist/timezone.d.ts +6 -0
- package/dist/timezone.d.ts.map +1 -0
- package/dist/timezone.js +17 -0
- package/dist/timezone.js.map +1 -0
- package/dist/timezone.test.d.ts +2 -0
- package/dist/timezone.test.d.ts.map +1 -0
- package/dist/timezone.test.js +23 -0
- package/dist/timezone.test.js.map +1 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/docs/APPLE-CONTAINER-NETWORKING.md +90 -0
- package/docs/DEBUG_CHECKLIST.md +143 -0
- package/docs/REQUIREMENTS.md +196 -0
- package/docs/SDK_DEEP_DIVE.md +643 -0
- package/docs/SECURITY.md +122 -0
- package/docs/SPEC.md +785 -0
- package/docs/docker-sandboxes.md +359 -0
- package/docs/nanoclaw-architecture-final.md +1063 -0
- package/docs/nanorepo-architecture.md +168 -0
- package/docs/skills-as-branches.md +662 -0
- package/groups/global/CLAUDE.md +58 -0
- package/groups/main/CLAUDE.md +246 -0
- package/launchd/com.nanoclaw.plist +32 -0
- package/package.json +45 -0
- package/repo-tokens/README.md +113 -0
- package/repo-tokens/action.yml +186 -0
- package/repo-tokens/badge.svg +23 -0
- package/repo-tokens/examples/green.svg +14 -0
- package/repo-tokens/examples/red.svg +14 -0
- package/repo-tokens/examples/yellow-green.svg +14 -0
- package/repo-tokens/examples/yellow.svg +14 -0
- package/scripts/run-migrations.ts +105 -0
- package/setup/container.ts +144 -0
- package/setup/environment.test.ts +121 -0
- package/setup/environment.ts +94 -0
- package/setup/groups.ts +229 -0
- package/setup/index.ts +58 -0
- package/setup/mounts.ts +115 -0
- package/setup/platform.test.ts +120 -0
- package/setup/platform.ts +132 -0
- package/setup/register.test.ts +257 -0
- package/setup/register.ts +177 -0
- package/setup/service.test.ts +187 -0
- package/setup/service.ts +362 -0
- package/setup/status.ts +16 -0
- package/setup/verify.ts +192 -0
- package/setup.sh +161 -0
- package/src/channels/index.ts +12 -0
- package/src/channels/registry.test.ts +42 -0
- package/src/channels/registry.ts +32 -0
- package/src/channels/web.ts +1856 -0
- package/src/cli.ts +209 -0
- package/src/config.ts +73 -0
- package/src/container-runner.test.ts +210 -0
- package/src/container-runner.ts +707 -0
- package/src/container-runtime.test.ts +149 -0
- package/src/container-runtime.ts +127 -0
- package/src/credential-proxy.test.ts +192 -0
- package/src/credential-proxy.ts +125 -0
- package/src/db.test.ts +484 -0
- package/src/db.ts +803 -0
- package/src/env.ts +42 -0
- package/src/formatting.test.ts +256 -0
- package/src/group-folder.test.ts +43 -0
- package/src/group-folder.ts +44 -0
- package/src/group-queue.test.ts +484 -0
- package/src/group-queue.ts +365 -0
- package/src/index.ts +731 -0
- package/src/ipc-auth.test.ts +679 -0
- package/src/ipc.ts +461 -0
- package/src/logger.ts +16 -0
- package/src/mount-security.ts +419 -0
- package/src/remote-control.test.ts +397 -0
- package/src/remote-control.ts +224 -0
- package/src/router.ts +52 -0
- package/src/routing.test.ts +170 -0
- package/src/sender-allowlist.test.ts +216 -0
- package/src/sender-allowlist.ts +128 -0
- package/src/session-commands.test.ts +247 -0
- package/src/session-commands.ts +163 -0
- package/src/task-scheduler.test.ts +129 -0
- package/src/task-scheduler.ts +295 -0
- package/src/timezone.test.ts +29 -0
- package/src/timezone.ts +16 -0
- package/src/types.ts +107 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +7 -0
- package/vitest.skills.config.ts +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/nanoclaw-logo.png" alt="NanoClaw" width="400">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
An AI assistant that runs agents securely in their own containers. Lightweight, built to be easily understood and completely customized for your needs.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://nanoclaw.dev">nanoclaw.dev</a> •
|
|
11
|
+
<a href="README_zh.md">中文</a> •
|
|
12
|
+
<a href="https://discord.gg/VDdww8qS42"><img src="https://img.shields.io/discord/1470188214710046894?label=Discord&logo=discord&v=2" alt="Discord" valign="middle"></a> •
|
|
13
|
+
<a href="repo-tokens"><img src="repo-tokens/badge.svg" alt="34.9k tokens, 17% of context window" valign="middle"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
> **Important:** this is my own fork of the original [qwibitai/nanoclaw](https://github.com/qwibitai/nanoclaw).
|
|
19
|
+
>
|
|
20
|
+
> It adds a **built-in web channel** (multi-session browser UI with Markdown Support + HTTP server) and a CLI entry point that lets you start NanoClaw with a single `npx @rozek/nanoclaw` command — no cloning or manual setup required. See [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md) for the full installation guide.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<h2 align="center">🐳 Now Runs in Docker Sandboxes</h2>
|
|
25
|
+
<p align="center">Every agent gets its own isolated container inside a micro VM.<br>Hypervisor-level isolation. Millisecond startup. No complex setup.</p>
|
|
26
|
+
|
|
27
|
+
**macOS (Apple Silicon)**
|
|
28
|
+
```bash
|
|
29
|
+
curl -fsSL https://nanoclaw.dev/install-docker-sandboxes.sh | bash
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Windows (WSL)**
|
|
33
|
+
```bash
|
|
34
|
+
curl -fsSL https://nanoclaw.dev/install-docker-sandboxes-windows.sh | bash
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> Currently supported on macOS (Apple Silicon) and Windows (x86). Linux support coming soon.
|
|
38
|
+
|
|
39
|
+
<p align="center"><a href="https://nanoclaw.dev/blog/nanoclaw-docker-sandboxes">Read the announcement →</a> · <a href="docs/docker-sandboxes.md">Manual setup guide →</a></p>
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Why I Built NanoClaw
|
|
44
|
+
|
|
45
|
+
[OpenClaw](https://github.com/openclaw/openclaw) is an impressive project, but I wouldn't have been able to sleep if I had given complex software I didn't understand full access to my life. OpenClaw has nearly half a million lines of code, 53 config files, and 70+ dependencies. Its security is at the application level (allowlists, pairing codes) rather than true OS-level isolation. Everything runs in one Node process with shared memory.
|
|
46
|
+
|
|
47
|
+
NanoClaw provides that same core functionality, but in a codebase small enough to understand: one process and a handful of files. Claude agents run in their own Linux containers with filesystem isolation, not merely behind permission checks.
|
|
48
|
+
|
|
49
|
+
## Quick Start
|
|
50
|
+
|
|
51
|
+
### With npx (this fork — recommended)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @rozek/nanoclaw
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then open **http://localhost:3099** in your browser. That's it.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Custom port, workspace, and token protection:
|
|
61
|
+
npx @rozek/nanoclaw --port 8080 --workspace ~/my-workspace --token mySecretToken
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
See [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md) for all options and prerequisites.
|
|
65
|
+
|
|
66
|
+
### From source (upstream workflow)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
gh repo fork rozek/nanoclaw --clone
|
|
70
|
+
cd nanoclaw
|
|
71
|
+
claude
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
<details>
|
|
75
|
+
<summary>Without GitHub CLI</summary>
|
|
76
|
+
|
|
77
|
+
1. Fork [rozek/nanoclaw](https://github.com/rozek/nanoclaw) on GitHub (click the Fork button)
|
|
78
|
+
2. `git clone https://github.com/<your-username>/nanoclaw.git`
|
|
79
|
+
3. `cd nanoclaw`
|
|
80
|
+
4. `claude`
|
|
81
|
+
|
|
82
|
+
</details>
|
|
83
|
+
|
|
84
|
+
Then run `/setup`. Claude Code handles everything: dependencies, authentication, container setup and service configuration.
|
|
85
|
+
|
|
86
|
+
> **Note:** Commands prefixed with `/` (like `/setup`, `/add-whatsapp`) are [Claude Code skills](https://code.claude.com/docs/en/skills). Type them inside the `claude` CLI prompt, not in your regular terminal. If you don't have Claude Code installed, get it at [claude.com/product/claude-code](https://claude.com/product/claude-code).
|
|
87
|
+
|
|
88
|
+
## Philosophy
|
|
89
|
+
|
|
90
|
+
**Small enough to understand.** One process, a few source files and no microservices. If you want to understand the full NanoClaw codebase, just ask Claude Code to walk you through it.
|
|
91
|
+
|
|
92
|
+
**Secure by isolation.** Agents run in Linux containers (Apple Container on macOS, or Docker) and they can only see what's explicitly mounted. Bash access is safe because commands run inside the container, not on your host.
|
|
93
|
+
|
|
94
|
+
**Built for the individual user.** NanoClaw isn't a monolithic framework; it's software that fits each user's exact needs. Instead of becoming bloatware, NanoClaw is designed to be bespoke. You make your own fork and have Claude Code modify it to match your needs.
|
|
95
|
+
|
|
96
|
+
**Customization = code changes.** No configuration sprawl. Want different behavior? Modify the code. The codebase is small enough that it's safe to make changes.
|
|
97
|
+
|
|
98
|
+
**AI-native.**
|
|
99
|
+
- No installation wizard; Claude Code guides setup.
|
|
100
|
+
- No monitoring dashboard; ask Claude what's happening.
|
|
101
|
+
- No debugging tools; describe the problem and Claude fixes it.
|
|
102
|
+
|
|
103
|
+
**Skills over features.** Instead of adding features (e.g. support for Telegram) to the codebase, contributors submit [claude code skills](https://code.claude.com/docs/en/skills) like `/add-telegram` that transform your fork. You end up with clean code that does exactly what you need.
|
|
104
|
+
|
|
105
|
+
**Best harness, best model.** NanoClaw runs on the Claude Agent SDK, which means you're running Claude Code directly. Claude Code is highly capable and its coding and problem-solving capabilities allow it to modify and expand NanoClaw and tailor it to each user.
|
|
106
|
+
|
|
107
|
+
## What It Supports
|
|
108
|
+
|
|
109
|
+
- **Built-in web channel** — Start with `npx @rozek/nanoclaw` and open your browser. No messaging app required. Full-featured chat UI with Markdown, math (KaTeX), syntax highlighting, and Mermaid diagrams. Multi-session, persistent, accessible from the LAN. *(Added in this fork — see [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md))*
|
|
110
|
+
- **Multi-channel messaging** - Talk to your assistant from WhatsApp, Telegram, Discord, Slack, or Gmail. Add channels with skills like `/add-whatsapp` or `/add-telegram`. Run one or many at the same time.
|
|
111
|
+
- **Isolated group context** - Each group has its own `CLAUDE.md` memory, isolated filesystem, and runs in its own container sandbox with only that filesystem mounted to it.
|
|
112
|
+
- **Main channel** - Your private channel (self-chat) for admin control; every group is completely isolated
|
|
113
|
+
- **Scheduled tasks** - Recurring jobs that run Claude and can message you back
|
|
114
|
+
- **Web access** - Search and fetch content from the Web
|
|
115
|
+
- **Container isolation** - Agents are sandboxed in [Docker Sandboxes](https://nanoclaw.dev/blog/nanoclaw-docker-sandboxes) (micro VM isolation), Apple Container (macOS), or Docker (macOS/Linux)
|
|
116
|
+
- **Agent Swarms** - Spin up teams of specialized agents that collaborate on complex tasks
|
|
117
|
+
- **Optional integrations** - Add Gmail (`/add-gmail`) and more via skills
|
|
118
|
+
|
|
119
|
+
## Usage
|
|
120
|
+
|
|
121
|
+
Talk to your assistant with the trigger word (default: `@Andy`):
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
@Andy send an overview of the sales pipeline every weekday morning at 9am (has access to my Obsidian vault folder)
|
|
125
|
+
@Andy review the git history for the past week each Friday and update the README if there's drift
|
|
126
|
+
@Andy every Monday at 8am, compile news on AI developments from Hacker News and TechCrunch and message me a briefing
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
From the main channel (your self-chat), you can manage groups and tasks:
|
|
130
|
+
```
|
|
131
|
+
@Andy list all scheduled tasks across groups
|
|
132
|
+
@Andy pause the Monday briefing task
|
|
133
|
+
@Andy join the Family Chat group
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Customizing
|
|
137
|
+
|
|
138
|
+
NanoClaw doesn't use configuration files. To make changes, just tell Claude Code what you want:
|
|
139
|
+
|
|
140
|
+
- "Change the trigger word to @Bob"
|
|
141
|
+
- "Remember in the future to make responses shorter and more direct"
|
|
142
|
+
- "Add a custom greeting when I say good morning"
|
|
143
|
+
- "Store conversation summaries weekly"
|
|
144
|
+
|
|
145
|
+
Or run `/customize` for guided changes.
|
|
146
|
+
|
|
147
|
+
The codebase is small enough that Claude can safely modify it.
|
|
148
|
+
|
|
149
|
+
## Contributing
|
|
150
|
+
|
|
151
|
+
**Don't add features. Add skills.**
|
|
152
|
+
|
|
153
|
+
If you want to add Telegram support, don't create a PR that adds Telegram to the core codebase. Instead, fork NanoClaw, make the code changes on a branch, and open a PR. We'll create a `skill/telegram` branch from your PR that other users can merge into their fork.
|
|
154
|
+
|
|
155
|
+
Users then run `/add-telegram` on their fork and get clean code that does exactly what they need, not a bloated system trying to support every use case.
|
|
156
|
+
|
|
157
|
+
### RFS (Request for Skills)
|
|
158
|
+
|
|
159
|
+
Skills we'd like to see:
|
|
160
|
+
|
|
161
|
+
**Communication Channels**
|
|
162
|
+
- `/add-signal` - Add Signal as a channel
|
|
163
|
+
|
|
164
|
+
**Session Management**
|
|
165
|
+
- `/clear` - Add a `/clear` command that compacts the conversation (summarizes context while preserving critical information in the same session). Requires figuring out how to trigger compaction programmatically via the Claude Agent SDK.
|
|
166
|
+
|
|
167
|
+
## Requirements
|
|
168
|
+
|
|
169
|
+
- macOS or Linux
|
|
170
|
+
- Node.js 20+
|
|
171
|
+
- [Claude Code](https://claude.ai/download)
|
|
172
|
+
- [Apple Container](https://github.com/apple/container) (macOS) or [Docker](https://docker.com/products/docker-desktop) (macOS/Linux)
|
|
173
|
+
|
|
174
|
+
## Architecture
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
Channels --> SQLite --> Polling loop --> Container (Claude Agent SDK) --> Response
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Single Node.js process. Channels are added via skills and self-register at startup — the orchestrator connects whichever ones have credentials present. Agents execute in isolated Linux containers with filesystem isolation. Only mounted directories are accessible. Per-group message queue with concurrency control. IPC via filesystem.
|
|
181
|
+
|
|
182
|
+
For the full architecture details, see [docs/SPEC.md](docs/SPEC.md).
|
|
183
|
+
|
|
184
|
+
Key files:
|
|
185
|
+
- `src/index.ts` - Orchestrator: state, message loop, agent invocation
|
|
186
|
+
- `src/cli.ts` - CLI entry point (enables `npx @rozek/nanoclaw`) *(added in this fork)*
|
|
187
|
+
- `src/channels/web.ts` - Built-in web channel: HTTP server + embedded browser UI *(added in this fork)*
|
|
188
|
+
- `src/channels/registry.ts` - Channel registry (self-registration at startup)
|
|
189
|
+
- `src/ipc.ts` - IPC watcher and task processing
|
|
190
|
+
- `src/router.ts` - Message formatting and outbound routing
|
|
191
|
+
- `src/group-queue.ts` - Per-group queue with global concurrency limit
|
|
192
|
+
- `src/container-runner.ts` - Spawns streaming agent containers
|
|
193
|
+
- `src/task-scheduler.ts` - Runs scheduled tasks
|
|
194
|
+
- `src/db.ts` - SQLite operations (messages, groups, sessions, state)
|
|
195
|
+
- `groups/*/CLAUDE.md` - Per-group memory
|
|
196
|
+
|
|
197
|
+
## FAQ
|
|
198
|
+
|
|
199
|
+
**Why Docker?**
|
|
200
|
+
|
|
201
|
+
Docker provides cross-platform support (macOS, Linux and even Windows via WSL2) and a mature ecosystem. On macOS, you can optionally switch to Apple Container via `/convert-to-apple-container` for a lighter-weight native runtime.
|
|
202
|
+
|
|
203
|
+
**Can I run this on Linux?**
|
|
204
|
+
|
|
205
|
+
Yes. Docker is the default runtime and works on both macOS and Linux. Just run `/setup`.
|
|
206
|
+
|
|
207
|
+
**Is this secure?**
|
|
208
|
+
|
|
209
|
+
Agents run in containers, not behind application-level permission checks. They can only access explicitly mounted directories. You should still review what you're running, but the codebase is small enough that you actually can. See [docs/SECURITY.md](docs/SECURITY.md) for the full security model.
|
|
210
|
+
|
|
211
|
+
**Should I protect the web UI with a token?**
|
|
212
|
+
|
|
213
|
+
Yes, if NanoClaw is accessible from your LAN or the internet. Pass `--token mySecretToken` to `npx @rozek/nanoclaw`. See [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md) for details.
|
|
214
|
+
|
|
215
|
+
**Why no configuration files?**
|
|
216
|
+
|
|
217
|
+
We don't want configuration sprawl. Every user should customize NanoClaw so that the code does exactly what they want, rather than configuring a generic system. If you prefer having config files, you can tell Claude to add them.
|
|
218
|
+
|
|
219
|
+
**Can I use third-party or open-source models?**
|
|
220
|
+
|
|
221
|
+
Yes. NanoClaw supports any Claude API-compatible model endpoint. Set these environment variables in your `.env` file:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
ANTHROPIC_BASE_URL=https://your-api-endpoint.com
|
|
225
|
+
ANTHROPIC_AUTH_TOKEN=your-token-here
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
This allows you to use:
|
|
229
|
+
- Local models via [Ollama](https://ollama.ai) with an API proxy
|
|
230
|
+
- Open-source models hosted on [Together AI](https://together.ai), [Fireworks](https://fireworks.ai), etc.
|
|
231
|
+
- Custom model deployments with Anthropic-compatible APIs
|
|
232
|
+
|
|
233
|
+
Note: The model must support the Anthropic API format for best compatibility.
|
|
234
|
+
|
|
235
|
+
**How do I debug issues?**
|
|
236
|
+
|
|
237
|
+
Ask Claude Code. "Why isn't the scheduler running?" "What's in the recent logs?" "Why did this message not get a response?" That's the AI-native approach that underlies NanoClaw.
|
|
238
|
+
|
|
239
|
+
**Why isn't the setup working for me?**
|
|
240
|
+
|
|
241
|
+
If you have issues, during setup, Claude will try to dynamically fix them. If that doesn't work, run `claude`, then run `/debug`. If Claude finds an issue that is likely affecting other users, open a PR to modify the setup SKILL.md.
|
|
242
|
+
|
|
243
|
+
**What changes will be accepted into the codebase?**
|
|
244
|
+
|
|
245
|
+
Only security fixes, bug fixes, and clear improvements will be accepted to the base configuration. That's all.
|
|
246
|
+
|
|
247
|
+
Everything else (new capabilities, OS compatibility, hardware support, enhancements) should be contributed as skills.
|
|
248
|
+
|
|
249
|
+
This keeps the base system minimal and lets every user customize their installation without inheriting features they don't want.
|
|
250
|
+
|
|
251
|
+
## Community
|
|
252
|
+
|
|
253
|
+
Questions? Ideas? [Join the Discord](https://discord.gg/VDdww8qS42).
|
|
254
|
+
|
|
255
|
+
## Changelog
|
|
256
|
+
|
|
257
|
+
See [CHANGELOG.md](CHANGELOG.md) for breaking changes and migration notes.
|
|
258
|
+
|
|
259
|
+
## License
|
|
260
|
+
|
|
261
|
+
MIT
|
package/README_zh.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/nanoclaw-logo.png" alt="NanoClaw" width="400">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
NanoClaw —— 您的专属 Claude 助手,在容器中安全运行。它轻巧易懂,并能根据您的个人需求灵活定制。
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://nanoclaw.dev">nanoclaw.dev</a> •
|
|
11
|
+
<a href="README.md">English</a> •
|
|
12
|
+
<a href="https://discord.gg/VDdww8qS42"><img src="https://img.shields.io/discord/1470188214710046894?label=Discord&logo=discord&v=2" alt="Discord" valign="middle"></a> •
|
|
13
|
+
<a href="repo-tokens"><img src="repo-tokens/badge.svg" alt="34.9k tokens, 17% of context window" valign="middle"></a>
|
|
14
|
+
</p>
|
|
15
|
+
通过 Claude Code,NanoClaw 可以动态重写自身代码,根据您的需求定制功能。
|
|
16
|
+
|
|
17
|
+
**新功能:** 首个支持 [Agent Swarms(智能体集群)](https://code.claude.com/docs/en/agent-teams) 的 AI 助手。可轻松组建智能体团队,在您的聊天中高效协作。
|
|
18
|
+
|
|
19
|
+
## 我为什么创建这个项目
|
|
20
|
+
|
|
21
|
+
[OpenClaw](https://github.com/openclaw/openclaw) 是一个令人印象深刻的项目,但我无法安心使用一个我不了解却能访问我个人隐私的软件。OpenClaw 有近 50 万行代码、53 个配置文件和 70+ 个依赖项。其安全性是应用级别的(通过白名单、配对码实现),而非操作系统级别的隔离。所有东西都在一个共享内存的 Node 进程中运行。
|
|
22
|
+
|
|
23
|
+
NanoClaw 用一个您能快速理解的代码库,为您提供了同样的核心功能。只有一个进程,少数几个文件。智能体(Agent)运行在具有文件系统隔离的真实 Linux 容器中,而不是依赖于权限检查。
|
|
24
|
+
|
|
25
|
+
## 快速开始
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/qwibitai/nanoclaw.git
|
|
29
|
+
cd nanoclaw
|
|
30
|
+
claude
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
然后运行 `/setup`。Claude Code 会处理一切:依赖安装、身份验证、容器设置、服务配置。
|
|
34
|
+
|
|
35
|
+
> **注意:** 以 `/` 开头的命令(如 `/setup`、`/add-whatsapp`)是 [Claude Code 技能](https://code.claude.com/docs/en/skills)。请在 `claude` CLI 提示符中输入,而非在普通终端中。
|
|
36
|
+
|
|
37
|
+
## 设计哲学
|
|
38
|
+
|
|
39
|
+
**小巧易懂:** 单一进程,少量源文件。无微服务、无消息队列、无复杂抽象层。让 Claude Code 引导您轻松上手。
|
|
40
|
+
|
|
41
|
+
**通过隔离保障安全:** 智能体运行在 Linux 容器(在 macOS 上是 Apple Container,或 Docker)中。它们只能看到被明确挂载的内容。即便通过 Bash 访问也十分安全,因为所有命令都在容器内执行,不会直接操作您的宿主机。
|
|
42
|
+
|
|
43
|
+
**为单一用户打造:** 这不是一个框架,是一个完全符合您个人需求的、可工作的软件。您可以 Fork 本项目,然后让 Claude Code 根据您的精确需求进行修改和适配。
|
|
44
|
+
|
|
45
|
+
**定制即代码修改:** 没有繁杂的配置文件。想要不同的行为?直接修改代码。代码库足够小,这样做是安全的。
|
|
46
|
+
|
|
47
|
+
**AI 原生:** 无安装向导(由 Claude Code 指导安装)。无需监控仪表盘,直接询问 Claude 即可了解系统状况。无调试工具(描述问题,Claude 会修复它)。
|
|
48
|
+
|
|
49
|
+
**技能(Skills)优于功能(Features):** 贡献者不应该向代码库添加新功能(例如支持 Telegram)。相反,他们应该贡献像 `/add-telegram` 这样的 [Claude Code 技能](https://code.claude.com/docs/en/skills),这些技能可以改造您的 fork。最终,您得到的是只做您需要事情的整洁代码。
|
|
50
|
+
|
|
51
|
+
**最好的工具套件,最好的模型:** 本项目运行在 Claude Agent SDK 之上,这意味着您直接运行的就是 Claude Code。Claude Code 高度强大,其编码和问题解决能力使其能够修改和扩展 NanoClaw,为每个用户量身定制。
|
|
52
|
+
|
|
53
|
+
## 功能支持
|
|
54
|
+
|
|
55
|
+
- **多渠道消息** - 通过 WhatsApp、Telegram、Discord、Slack 或 Gmail 与您的助手对话。使用 `/add-whatsapp` 或 `/add-telegram` 等技能添加渠道,可同时运行一个或多个。
|
|
56
|
+
- **隔离的群组上下文** - 每个群组都拥有独立的 `CLAUDE.md` 记忆和隔离的文件系统。它们在各自的容器沙箱中运行,且仅挂载所需的文件系统。
|
|
57
|
+
- **主频道** - 您的私有频道(self-chat),用于管理控制;其他所有群组都完全隔离
|
|
58
|
+
- **计划任务** - 运行 Claude 的周期性作业,并可以给您回发消息
|
|
59
|
+
- **网络访问** - 搜索和抓取网页内容
|
|
60
|
+
- **容器隔离** - 智能体在 Apple Container (macOS) 或 Docker (macOS/Linux) 的沙箱中运行
|
|
61
|
+
- **智能体集群(Agent Swarms)** - 启动多个专业智能体团队,协作完成复杂任务(首个支持此功能的个人 AI 助手)
|
|
62
|
+
- **可选集成** - 通过技能添加 Gmail (`/add-gmail`) 等更多功能
|
|
63
|
+
|
|
64
|
+
## 使用方法
|
|
65
|
+
|
|
66
|
+
使用触发词(默认为 `@Andy`)与您的助手对话:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
@Andy 每周一到周五早上9点,给我发一份销售渠道的概览(需要访问我的 Obsidian vault 文件夹)
|
|
70
|
+
@Andy 每周五回顾过去一周的 git 历史,如果与 README 有出入,就更新它
|
|
71
|
+
@Andy 每周一早上8点,从 Hacker News 和 TechCrunch 收集关于 AI 发展的资讯,然后发给我一份简报
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
在主频道(您的self-chat)中,可以管理群组和任务:
|
|
75
|
+
```
|
|
76
|
+
@Andy 列出所有群组的计划任务
|
|
77
|
+
@Andy 暂停周一简报任务
|
|
78
|
+
@Andy 加入"家庭聊天"群组
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 定制
|
|
82
|
+
|
|
83
|
+
没有需要学习的配置文件。直接告诉 Claude Code 您想要什么:
|
|
84
|
+
|
|
85
|
+
- "把触发词改成 @Bob"
|
|
86
|
+
- "记住以后回答要更简短直接"
|
|
87
|
+
- "当我说早上好的时候,加一个自定义的问候"
|
|
88
|
+
- "每周存储一次对话摘要"
|
|
89
|
+
|
|
90
|
+
或者运行 `/customize` 进行引导式修改。
|
|
91
|
+
|
|
92
|
+
代码库足够小,Claude 可以安全地修改它。
|
|
93
|
+
|
|
94
|
+
## 贡献
|
|
95
|
+
|
|
96
|
+
**不要添加功能,而是添加技能。**
|
|
97
|
+
|
|
98
|
+
如果您想添加 Telegram 支持,不要创建一个 PR 同时添加 Telegram 和 WhatsApp。而是贡献一个技能文件 (`.claude/skills/add-telegram/SKILL.md`),教 Claude Code 如何改造一个 NanoClaw 安装以使用 Telegram。
|
|
99
|
+
|
|
100
|
+
然后用户在自己的 fork 上运行 `/add-telegram`,就能得到只做他们需要事情的整洁代码,而不是一个试图支持所有用例的臃肿系统。
|
|
101
|
+
|
|
102
|
+
### RFS (技能征集)
|
|
103
|
+
|
|
104
|
+
我们希望看到的技能:
|
|
105
|
+
|
|
106
|
+
**通信渠道**
|
|
107
|
+
- `/add-signal` - 添加 Signal 作为渠道
|
|
108
|
+
|
|
109
|
+
**会话管理**
|
|
110
|
+
- `/clear` - 添加一个 `/clear` 命令,用于压缩会话(在同一会话中总结上下文,同时保留关键信息)。这需要研究如何通过 Claude Agent SDK 以编程方式触发压缩。
|
|
111
|
+
|
|
112
|
+
## 系统要求
|
|
113
|
+
|
|
114
|
+
- macOS 或 Linux
|
|
115
|
+
- Node.js 20+
|
|
116
|
+
- [Claude Code](https://claude.ai/download)
|
|
117
|
+
- [Apple Container](https://github.com/apple/container) (macOS) 或 [Docker](https://docker.com/products/docker-desktop) (macOS/Linux)
|
|
118
|
+
|
|
119
|
+
## 架构
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
渠道 --> SQLite --> 轮询循环 --> 容器 (Claude Agent SDK) --> 响应
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
单一 Node.js 进程。渠道通过技能添加,启动时自注册 — 编排器连接具有凭据的渠道。智能体在具有文件系统隔离的 Linux 容器中执行。每个群组的消息队列带有并发控制。通过文件系统进行 IPC。
|
|
126
|
+
|
|
127
|
+
完整架构详情请见 [docs/SPEC.md](docs/SPEC.md)。
|
|
128
|
+
|
|
129
|
+
关键文件:
|
|
130
|
+
- `src/index.ts` - 编排器:状态管理、消息循环、智能体调用
|
|
131
|
+
- `src/channels/registry.ts` - 渠道注册表(启动时自注册)
|
|
132
|
+
- `src/ipc.ts` - IPC 监听与任务处理
|
|
133
|
+
- `src/router.ts` - 消息格式化与出站路由
|
|
134
|
+
- `src/group-queue.ts` - 带全局并发限制的群组队列
|
|
135
|
+
- `src/container-runner.ts` - 生成流式智能体容器
|
|
136
|
+
- `src/task-scheduler.ts` - 运行计划任务
|
|
137
|
+
- `src/db.ts` - SQLite 操作(消息、群组、会话、状态)
|
|
138
|
+
- `groups/*/CLAUDE.md` - 各群组的记忆
|
|
139
|
+
|
|
140
|
+
## FAQ
|
|
141
|
+
|
|
142
|
+
**为什么是 Docker?**
|
|
143
|
+
|
|
144
|
+
Docker 提供跨平台支持(macOS 和 Linux)和成熟的生态系统。在 macOS 上,您可以选择通过运行 `/convert-to-apple-container` 切换到 Apple Container,以获得更轻量级的原生运行时体验。
|
|
145
|
+
|
|
146
|
+
**我可以在 Linux 上运行吗?**
|
|
147
|
+
|
|
148
|
+
可以。Docker 是默认的容器运行时,在 macOS 和 Linux 上都可以使用。只需运行 `/setup`。
|
|
149
|
+
|
|
150
|
+
**这个项目安全吗?**
|
|
151
|
+
|
|
152
|
+
智能体在容器中运行,而不是在应用级别的权限检查之后。它们只能访问被明确挂载的目录。您仍然应该审查您运行的代码,但这个代码库小到您真的可以做到。完整的安全模型请见 [docs/SECURITY.md](docs/SECURITY.md)。
|
|
153
|
+
|
|
154
|
+
**为什么没有配置文件?**
|
|
155
|
+
|
|
156
|
+
我们不希望配置泛滥。每个用户都应该定制它,让代码完全符合他们的需求,而不是去配置一个通用的系统。如果您喜欢用配置文件,告诉 Claude 让它加上。
|
|
157
|
+
|
|
158
|
+
**我可以使用第三方或开源模型吗?**
|
|
159
|
+
|
|
160
|
+
可以。NanoClaw 支持任何 API 兼容的模型端点。在 `.env` 文件中设置以下环境变量:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
ANTHROPIC_BASE_URL=https://your-api-endpoint.com
|
|
164
|
+
ANTHROPIC_AUTH_TOKEN=your-token-here
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
这使您能够使用:
|
|
168
|
+
- 通过 [Ollama](https://ollama.ai) 配合 API 代理运行的本地模型
|
|
169
|
+
- 托管在 [Together AI](https://together.ai)、[Fireworks](https://fireworks.ai) 等平台上的开源模型
|
|
170
|
+
- 兼容 Anthropic API 格式的自定义模型部署
|
|
171
|
+
|
|
172
|
+
注意:为获得最佳兼容性,模型需支持 Anthropic API 格式。
|
|
173
|
+
|
|
174
|
+
**我该如何调试问题?**
|
|
175
|
+
|
|
176
|
+
问 Claude Code。"为什么计划任务没有运行?" "最近的日志里有什么?" "为什么这条消息没有得到回应?" 这就是 AI 原生的方法。
|
|
177
|
+
|
|
178
|
+
**为什么我的安装不成功?**
|
|
179
|
+
|
|
180
|
+
如果遇到问题,安装过程中 Claude 会尝试动态修复。如果问题仍然存在,运行 `claude`,然后运行 `/debug`。如果 Claude 发现一个可能影响其他用户的问题,请开一个 PR 来修改 setup SKILL.md。
|
|
181
|
+
|
|
182
|
+
**什么样的代码更改会被接受?**
|
|
183
|
+
|
|
184
|
+
安全修复、bug 修复,以及对基础配置的明确改进。仅此而已。
|
|
185
|
+
|
|
186
|
+
其他一切(新功能、操作系统兼容性、硬件支持、增强功能)都应该作为技能来贡献。
|
|
187
|
+
|
|
188
|
+
这使得基础系统保持最小化,并让每个用户可以定制他们的安装,而无需继承他们不想要的功能。
|
|
189
|
+
|
|
190
|
+
## 社区
|
|
191
|
+
|
|
192
|
+
有任何疑问或建议?欢迎[加入 Discord 社区](https://discord.gg/VDdww8qS42)与我们交流。
|
|
193
|
+
|
|
194
|
+
## 更新日志
|
|
195
|
+
|
|
196
|
+
破坏性变更和迁移说明请见 [CHANGELOG.md](CHANGELOG.md)。
|
|
197
|
+
|
|
198
|
+
## 许可证
|
|
199
|
+
|
|
200
|
+
MIT
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"allowedRoots": [
|
|
3
|
+
{
|
|
4
|
+
"path": "~/projects",
|
|
5
|
+
"allowReadWrite": true,
|
|
6
|
+
"description": "Development projects"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"path": "~/repos",
|
|
10
|
+
"allowReadWrite": true,
|
|
11
|
+
"description": "Git repositories"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "~/Documents/work",
|
|
15
|
+
"allowReadWrite": false,
|
|
16
|
+
"description": "Work documents (read-only)"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"blockedPatterns": [
|
|
20
|
+
"password",
|
|
21
|
+
"secret",
|
|
22
|
+
"token"
|
|
23
|
+
],
|
|
24
|
+
"nonMainReadOnly": true
|
|
25
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# NanoClaw Agent Container
|
|
2
|
+
# Runs Claude Agent SDK in isolated Linux VM with browser automation
|
|
3
|
+
|
|
4
|
+
FROM node:22-slim
|
|
5
|
+
|
|
6
|
+
# Install system dependencies for Chromium
|
|
7
|
+
RUN apt-get update && apt-get install -y \
|
|
8
|
+
chromium \
|
|
9
|
+
fonts-liberation \
|
|
10
|
+
fonts-noto-cjk \
|
|
11
|
+
fonts-noto-color-emoji \
|
|
12
|
+
libgbm1 \
|
|
13
|
+
libnss3 \
|
|
14
|
+
libatk-bridge2.0-0 \
|
|
15
|
+
libgtk-3-0 \
|
|
16
|
+
libx11-xcb1 \
|
|
17
|
+
libxcomposite1 \
|
|
18
|
+
libxdamage1 \
|
|
19
|
+
libxrandr2 \
|
|
20
|
+
libasound2 \
|
|
21
|
+
libpangocairo-1.0-0 \
|
|
22
|
+
libcups2 \
|
|
23
|
+
libdrm2 \
|
|
24
|
+
libxshmfence1 \
|
|
25
|
+
curl \
|
|
26
|
+
git \
|
|
27
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
28
|
+
|
|
29
|
+
# Set Chromium path for agent-browser
|
|
30
|
+
ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
31
|
+
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
|
|
32
|
+
|
|
33
|
+
# Install agent-browser and claude-code globally
|
|
34
|
+
RUN npm install -g agent-browser @anthropic-ai/claude-code
|
|
35
|
+
|
|
36
|
+
# Create app directory
|
|
37
|
+
WORKDIR /app
|
|
38
|
+
|
|
39
|
+
# Copy package files first for better caching
|
|
40
|
+
COPY agent-runner/package*.json ./
|
|
41
|
+
|
|
42
|
+
# Install dependencies
|
|
43
|
+
RUN npm install
|
|
44
|
+
|
|
45
|
+
# Copy source code
|
|
46
|
+
COPY agent-runner/ ./
|
|
47
|
+
|
|
48
|
+
# Build TypeScript
|
|
49
|
+
RUN npm run build
|
|
50
|
+
|
|
51
|
+
# Create workspace directories
|
|
52
|
+
RUN mkdir -p /workspace/group /workspace/global /workspace/extra /workspace/ipc/messages /workspace/ipc/tasks /workspace/ipc/input
|
|
53
|
+
|
|
54
|
+
# Create entrypoint script
|
|
55
|
+
# Container input (prompt, group info) is passed via stdin JSON.
|
|
56
|
+
# Credentials are injected by the host's credential proxy — never passed here.
|
|
57
|
+
# Follow-up messages arrive via IPC files in /workspace/ipc/input/
|
|
58
|
+
RUN printf '#!/bin/bash\nset -e\ncd /app && npx tsc --outDir /tmp/dist 2>&1 >&2\nln -s /app/node_modules /tmp/dist/node_modules\nchmod -R a-w /tmp/dist\ncat > /tmp/input.json\nnode /tmp/dist/index.js < /tmp/input.json\n' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh
|
|
59
|
+
|
|
60
|
+
# Set ownership to node user (non-root) for writable directories
|
|
61
|
+
RUN chown -R node:node /workspace && chmod 777 /home/node
|
|
62
|
+
|
|
63
|
+
# Switch to non-root user (required for --dangerously-skip-permissions)
|
|
64
|
+
USER node
|
|
65
|
+
|
|
66
|
+
# Set working directory to group workspace
|
|
67
|
+
WORKDIR /workspace/group
|
|
68
|
+
|
|
69
|
+
# Entry point reads JSON from stdin, outputs JSON to stdout
|
|
70
|
+
ENTRYPOINT ["/app/entrypoint.sh"]
|