@rozek/nanoclaw 0.0.4 → 0.0.6

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 (132) hide show
  1. package/container/agent-runner/package-lock.json +1524 -0
  2. package/dist/cli.js +75 -4
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +34 -0
  6. package/dist/index.js.map +1 -1
  7. package/package.json +7 -1
  8. package/.claude/settings.json +0 -1
  9. package/.claude/skills/add-compact/SKILL.md +0 -135
  10. package/.claude/skills/add-discord/SKILL.md +0 -203
  11. package/.claude/skills/add-gmail/SKILL.md +0 -220
  12. package/.claude/skills/add-image-vision/SKILL.md +0 -94
  13. package/.claude/skills/add-ollama-tool/SKILL.md +0 -153
  14. package/.claude/skills/add-parallel/SKILL.md +0 -290
  15. package/.claude/skills/add-pdf-reader/SKILL.md +0 -104
  16. package/.claude/skills/add-reactions/SKILL.md +0 -117
  17. package/.claude/skills/add-slack/SKILL.md +0 -207
  18. package/.claude/skills/add-telegram/SKILL.md +0 -222
  19. package/.claude/skills/add-telegram-swarm/SKILL.md +0 -384
  20. package/.claude/skills/add-voice-transcription/SKILL.md +0 -148
  21. package/.claude/skills/add-whatsapp/SKILL.md +0 -372
  22. package/.claude/skills/convert-to-apple-container/SKILL.md +0 -175
  23. package/.claude/skills/customize/SKILL.md +0 -110
  24. package/.claude/skills/debug/SKILL.md +0 -349
  25. package/.claude/skills/get-qodo-rules/SKILL.md +0 -122
  26. package/.claude/skills/get-qodo-rules/references/output-format.md +0 -41
  27. package/.claude/skills/get-qodo-rules/references/pagination.md +0 -33
  28. package/.claude/skills/get-qodo-rules/references/repository-scope.md +0 -26
  29. package/.claude/skills/qodo-pr-resolver/SKILL.md +0 -326
  30. package/.claude/skills/qodo-pr-resolver/resources/providers.md +0 -329
  31. package/.claude/skills/setup/SKILL.md +0 -218
  32. package/.claude/skills/update-nanoclaw/SKILL.md +0 -235
  33. package/.claude/skills/update-skills/SKILL.md +0 -130
  34. package/.claude/skills/use-local-whisper/SKILL.md +0 -152
  35. package/.claude/skills/x-integration/SKILL.md +0 -417
  36. package/.claude/skills/x-integration/agent.ts +0 -243
  37. package/.claude/skills/x-integration/host.ts +0 -159
  38. package/.claude/skills/x-integration/lib/browser.ts +0 -148
  39. package/.claude/skills/x-integration/lib/config.ts +0 -62
  40. package/.claude/skills/x-integration/scripts/like.ts +0 -56
  41. package/.claude/skills/x-integration/scripts/post.ts +0 -66
  42. package/.claude/skills/x-integration/scripts/quote.ts +0 -80
  43. package/.claude/skills/x-integration/scripts/reply.ts +0 -74
  44. package/.claude/skills/x-integration/scripts/retweet.ts +0 -62
  45. package/.claude/skills/x-integration/scripts/setup.ts +0 -87
  46. package/.env.example +0 -1
  47. package/.github/CODEOWNERS +0 -10
  48. package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
  49. package/.github/workflows/bump-version.yml +0 -32
  50. package/.github/workflows/ci.yml +0 -25
  51. package/.github/workflows/merge-forward-skills.yml +0 -160
  52. package/.github/workflows/update-tokens.yml +0 -42
  53. package/.husky/pre-commit +0 -1
  54. package/.mcp.json +0 -3
  55. package/.nvmrc +0 -1
  56. package/.prettierrc +0 -3
  57. package/CHANGELOG.md +0 -8
  58. package/CONTRIBUTING.md +0 -23
  59. package/CONTRIBUTORS.md +0 -15
  60. package/NanoClaw_with_Web-Support.md +0 -325
  61. package/README_zh.md +0 -200
  62. package/assets/nanoclaw-favicon.png +0 -0
  63. package/assets/nanoclaw-icon.png +0 -0
  64. package/assets/nanoclaw-logo-dark.png +0 -0
  65. package/assets/nanoclaw-logo.png +0 -0
  66. package/assets/nanoclaw-profile.jpeg +0 -0
  67. package/assets/nanoclaw-sales.png +0 -0
  68. package/assets/social-preview.jpg +0 -0
  69. package/config-examples/mount-allowlist.json +0 -25
  70. package/docs/APPLE-CONTAINER-NETWORKING.md +0 -90
  71. package/docs/DEBUG_CHECKLIST.md +0 -143
  72. package/docs/REQUIREMENTS.md +0 -196
  73. package/docs/SDK_DEEP_DIVE.md +0 -643
  74. package/docs/SECURITY.md +0 -122
  75. package/docs/SPEC.md +0 -785
  76. package/docs/docker-sandboxes.md +0 -359
  77. package/docs/nanoclaw-architecture-final.md +0 -1063
  78. package/docs/nanorepo-architecture.md +0 -168
  79. package/docs/skills-as-branches.md +0 -662
  80. package/groups/global/CLAUDE.md +0 -58
  81. package/groups/main/CLAUDE.md +0 -246
  82. package/launchd/com.nanoclaw.plist +0 -32
  83. package/repo-tokens/README.md +0 -113
  84. package/repo-tokens/action.yml +0 -186
  85. package/repo-tokens/badge.svg +0 -23
  86. package/repo-tokens/examples/green.svg +0 -14
  87. package/repo-tokens/examples/red.svg +0 -14
  88. package/repo-tokens/examples/yellow-green.svg +0 -14
  89. package/repo-tokens/examples/yellow.svg +0 -14
  90. package/scripts/run-migrations.ts +0 -105
  91. package/setup.sh +0 -161
  92. package/src/channels/index.ts +0 -15
  93. package/src/channels/registry.test.ts +0 -42
  94. package/src/channels/registry.ts +0 -32
  95. package/src/channels/web.ts +0 -1931
  96. package/src/cli.ts +0 -210
  97. package/src/config.ts +0 -73
  98. package/src/container-runner.test.ts +0 -210
  99. package/src/container-runner.ts +0 -768
  100. package/src/container-runtime.test.ts +0 -149
  101. package/src/container-runtime.ts +0 -127
  102. package/src/credential-proxy.test.ts +0 -192
  103. package/src/credential-proxy.ts +0 -125
  104. package/src/db.test.ts +0 -484
  105. package/src/db.ts +0 -803
  106. package/src/env.ts +0 -42
  107. package/src/formatting.test.ts +0 -256
  108. package/src/group-folder.test.ts +0 -43
  109. package/src/group-folder.ts +0 -44
  110. package/src/group-queue.test.ts +0 -484
  111. package/src/group-queue.ts +0 -379
  112. package/src/index.ts +0 -854
  113. package/src/ipc-auth.test.ts +0 -679
  114. package/src/ipc.ts +0 -461
  115. package/src/logger.ts +0 -16
  116. package/src/mount-security.ts +0 -419
  117. package/src/remote-control.test.ts +0 -397
  118. package/src/remote-control.ts +0 -224
  119. package/src/router.ts +0 -52
  120. package/src/routing.test.ts +0 -170
  121. package/src/sender-allowlist.test.ts +0 -216
  122. package/src/sender-allowlist.ts +0 -128
  123. package/src/session-commands.test.ts +0 -247
  124. package/src/session-commands.ts +0 -163
  125. package/src/task-scheduler.test.ts +0 -129
  126. package/src/task-scheduler.ts +0 -328
  127. package/src/timezone.test.ts +0 -29
  128. package/src/timezone.ts +0 -16
  129. package/src/types.ts +0 -109
  130. package/tsconfig.json +0 -20
  131. package/vitest.config.ts +0 -7
  132. package/vitest.skills.config.ts +0 -7
package/docs/SECURITY.md DELETED
@@ -1,122 +0,0 @@
1
- # NanoClaw Security Model
2
-
3
- ## Trust Model
4
-
5
- | Entity | Trust Level | Rationale |
6
- |--------|-------------|-----------|
7
- | Main group | Trusted | Private self-chat, admin control |
8
- | Non-main groups | Untrusted | Other users may be malicious |
9
- | Container agents | Sandboxed | Isolated execution environment |
10
- | WhatsApp messages | User input | Potential prompt injection |
11
-
12
- ## Security Boundaries
13
-
14
- ### 1. Container Isolation (Primary Boundary)
15
-
16
- Agents execute in containers (lightweight Linux VMs), providing:
17
- - **Process isolation** - Container processes cannot affect the host
18
- - **Filesystem isolation** - Only explicitly mounted directories are visible
19
- - **Non-root execution** - Runs as unprivileged `node` user (uid 1000)
20
- - **Ephemeral containers** - Fresh environment per invocation (`--rm`)
21
-
22
- This is the primary security boundary. Rather than relying on application-level permission checks, the attack surface is limited by what's mounted.
23
-
24
- ### 2. Mount Security
25
-
26
- **External Allowlist** - Mount permissions stored at `~/.config/nanoclaw/mount-allowlist.json`, which is:
27
- - Outside project root
28
- - Never mounted into containers
29
- - Cannot be modified by agents
30
-
31
- **Default Blocked Patterns:**
32
- ```
33
- .ssh, .gnupg, .aws, .azure, .gcloud, .kube, .docker,
34
- credentials, .env, .netrc, .npmrc, id_rsa, id_ed25519,
35
- private_key, .secret
36
- ```
37
-
38
- **Protections:**
39
- - Symlink resolution before validation (prevents traversal attacks)
40
- - Container path validation (rejects `..` and absolute paths)
41
- - `nonMainReadOnly` option forces read-only for non-main groups
42
-
43
- **Read-Only Project Root:**
44
-
45
- The main group's project root is mounted read-only. Writable paths the agent needs (group folder, IPC, `.claude/`) are mounted separately. This prevents the agent from modifying host application code (`src/`, `dist/`, `package.json`, etc.) which would bypass the sandbox entirely on next restart.
46
-
47
- ### 3. Session Isolation
48
-
49
- Each group has isolated Claude sessions at `data/sessions/{group}/.claude/`:
50
- - Groups cannot see other groups' conversation history
51
- - Session data includes full message history and file contents read
52
- - Prevents cross-group information disclosure
53
-
54
- ### 4. IPC Authorization
55
-
56
- Messages and task operations are verified against group identity:
57
-
58
- | Operation | Main Group | Non-Main Group |
59
- |-----------|------------|----------------|
60
- | Send message to own chat | ✓ | ✓ |
61
- | Send message to other chats | ✓ | ✗ |
62
- | Schedule task for self | ✓ | ✓ |
63
- | Schedule task for others | ✓ | ✗ |
64
- | View all tasks | ✓ | Own only |
65
- | Manage other groups | ✓ | ✗ |
66
-
67
- ### 5. Credential Isolation (Credential Proxy)
68
-
69
- Real API credentials **never enter containers**. Instead, the host runs an HTTP credential proxy that injects authentication headers transparently.
70
-
71
- **How it works:**
72
- 1. Host starts a credential proxy on `CREDENTIAL_PROXY_PORT` (default: 3001)
73
- 2. Containers receive `ANTHROPIC_BASE_URL=http://host.docker.internal:<port>` and `ANTHROPIC_API_KEY=placeholder`
74
- 3. The SDK sends API requests to the proxy with the placeholder key
75
- 4. The proxy strips placeholder auth, injects real credentials (`x-api-key` or `Authorization: Bearer`), and forwards to `api.anthropic.com`
76
- 5. Agents cannot discover real credentials — not in environment, stdin, files, or `/proc`
77
-
78
- **NOT Mounted:**
79
- - WhatsApp session (`store/auth/`) - host only
80
- - Mount allowlist - external, never mounted
81
- - Any credentials matching blocked patterns
82
- - `.env` is shadowed with `/dev/null` in the project root mount
83
-
84
- ## Privilege Comparison
85
-
86
- | Capability | Main Group | Non-Main Group |
87
- |------------|------------|----------------|
88
- | Project root access | `/workspace/project` (ro) | None |
89
- | Group folder | `/workspace/group` (rw) | `/workspace/group` (rw) |
90
- | Global memory | Implicit via project | `/workspace/global` (ro) |
91
- | Additional mounts | Configurable | Read-only unless allowed |
92
- | Network access | Unrestricted | Unrestricted |
93
- | MCP tools | All | All |
94
-
95
- ## Security Architecture Diagram
96
-
97
- ```
98
- ┌──────────────────────────────────────────────────────────────────┐
99
- │ UNTRUSTED ZONE │
100
- │ WhatsApp Messages (potentially malicious) │
101
- └────────────────────────────────┬─────────────────────────────────┘
102
-
103
- ▼ Trigger check, input escaping
104
- ┌──────────────────────────────────────────────────────────────────┐
105
- │ HOST PROCESS (TRUSTED) │
106
- │ • Message routing │
107
- │ • IPC authorization │
108
- │ • Mount validation (external allowlist) │
109
- │ • Container lifecycle │
110
- │ • Credential proxy (injects auth headers) │
111
- └────────────────────────────────┬─────────────────────────────────┘
112
-
113
- ▼ Explicit mounts only, no secrets
114
- ┌──────────────────────────────────────────────────────────────────┐
115
- │ CONTAINER (ISOLATED/SANDBOXED) │
116
- │ • Agent execution │
117
- │ • Bash commands (sandboxed) │
118
- │ • File operations (limited to mounts) │
119
- │ • API calls routed through credential proxy │
120
- │ • No real credentials in environment or filesystem │
121
- └──────────────────────────────────────────────────────────────────┘
122
- ```