clawdbot 2026.1.4 → 2026.1.5

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 (70) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +26 -1
  3. package/dist/agents/pi-embedded-runner.js +2 -0
  4. package/dist/agents/pi-embedded-subscribe.js +18 -3
  5. package/dist/agents/pi-tools.js +45 -6
  6. package/dist/agents/tools/browser-tool.js +38 -89
  7. package/dist/agents/tools/cron-tool.js +8 -8
  8. package/dist/agents/workspace.js +8 -1
  9. package/dist/auto-reply/command-detection.js +26 -0
  10. package/dist/auto-reply/reply/agent-runner.js +15 -8
  11. package/dist/auto-reply/reply/commands.js +36 -25
  12. package/dist/auto-reply/reply/directive-handling.js +4 -2
  13. package/dist/auto-reply/reply/directives.js +12 -0
  14. package/dist/auto-reply/reply/session-updates.js +2 -4
  15. package/dist/auto-reply/reply.js +26 -4
  16. package/dist/browser/config.js +22 -4
  17. package/dist/browser/profiles-service.js +3 -1
  18. package/dist/browser/profiles.js +14 -3
  19. package/dist/canvas-host/a2ui/.bundle.hash +2 -0
  20. package/dist/cli/gateway-cli.js +2 -2
  21. package/dist/cli/profile.js +81 -0
  22. package/dist/cli/program.js +10 -1
  23. package/dist/cli/run-main.js +33 -0
  24. package/dist/commands/configure.js +5 -0
  25. package/dist/commands/onboard-providers.js +1 -1
  26. package/dist/commands/setup.js +4 -1
  27. package/dist/config/defaults.js +56 -0
  28. package/dist/config/io.js +47 -6
  29. package/dist/config/paths.js +2 -2
  30. package/dist/config/port-defaults.js +32 -0
  31. package/dist/config/sessions.js +3 -2
  32. package/dist/config/validation.js +2 -2
  33. package/dist/config/zod-schema.js +16 -0
  34. package/dist/discord/monitor.js +75 -266
  35. package/dist/entry.js +16 -0
  36. package/dist/gateway/call.js +8 -1
  37. package/dist/gateway/server-methods/chat.js +1 -1
  38. package/dist/gateway/server.js +14 -3
  39. package/dist/index.js +2 -2
  40. package/dist/infra/control-ui-assets.js +118 -0
  41. package/dist/infra/dotenv.js +15 -0
  42. package/dist/infra/shell-env.js +79 -0
  43. package/dist/infra/system-events.js +50 -23
  44. package/dist/macos/relay.js +8 -2
  45. package/dist/telegram/bot.js +24 -1
  46. package/dist/utils.js +8 -2
  47. package/dist/web/auto-reply.js +18 -21
  48. package/dist/web/inbound.js +5 -1
  49. package/dist/web/qr-image.js +4 -4
  50. package/dist/web/session.js +2 -3
  51. package/docs/agent.md +0 -2
  52. package/docs/assets/markdown.css +4 -1
  53. package/docs/audio.md +0 -2
  54. package/docs/clawd.md +0 -2
  55. package/docs/configuration.md +62 -3
  56. package/docs/docs.json +9 -1
  57. package/docs/faq.md +32 -7
  58. package/docs/gateway.md +28 -0
  59. package/docs/images.md +0 -2
  60. package/docs/index.md +2 -4
  61. package/docs/mac/icon.md +1 -1
  62. package/docs/nix.md +57 -11
  63. package/docs/onboarding.md +0 -2
  64. package/docs/refactor/webagent-session.md +0 -2
  65. package/docs/research/memory.md +1 -1
  66. package/docs/skills.md +0 -2
  67. package/docs/templates/AGENTS.md +2 -2
  68. package/docs/tools.md +15 -0
  69. package/docs/whatsapp.md +2 -0
  70. package/package.json +8 -8
package/docs/gateway.md CHANGED
@@ -49,6 +49,34 @@ pnpm gateway:watch
49
49
 
50
50
  Supported if you isolate state + config and use unique ports.
51
51
 
52
+ ### Dev profile (`--dev`)
53
+
54
+ Fast path: run a fully-isolated dev instance (config/state/workspace) without touching your primary setup.
55
+
56
+ ```bash
57
+ clawdbot --dev setup
58
+ clawdbot --dev gateway --allow-unconfigured
59
+ # then target the dev instance:
60
+ clawdbot --dev status
61
+ clawdbot --dev health
62
+ ```
63
+
64
+ Defaults (can be overridden via env/flags/config):
65
+ - `CLAWDBOT_STATE_DIR=~/.clawdbot-dev`
66
+ - `CLAWDBOT_CONFIG_PATH=~/.clawdbot-dev/clawdbot.json`
67
+ - `CLAWDBOT_GATEWAY_PORT=19001` (Gateway WS + HTTP)
68
+ - `bridge.port=19002` (derived: `gateway.port+1`)
69
+ - `browser.controlUrl=http://127.0.0.1:19003` (derived: `gateway.port+2`)
70
+ - `canvasHost.port=19005` (derived: `gateway.port+4`)
71
+ - `agent.workspace` default becomes `~/clawd-dev` when you run `setup`/`onboard` under `--dev`.
72
+
73
+ Derived ports (rules of thumb):
74
+ - Base port = `gateway.port` (or `CLAWDBOT_GATEWAY_PORT` / `--port`)
75
+ - `bridge.port = base + 1` (or `CLAWDBOT_BRIDGE_PORT` / config override)
76
+ - `browser.controlUrl port = base + 2` (or `CLAWDBOT_BROWSER_CONTROL_URL` / config override)
77
+ - `canvasHost.port = base + 4` (or `CLAWDBOT_CANVAS_HOST_PORT` / config override)
78
+ - Browser profile CDP ports auto-allocate from `browser.controlPort + 9 .. + 108` (persisted per profile).
79
+
52
80
  Checklist per instance:
53
81
  - unique `gateway.port`
54
82
  - unique `CLAWDBOT_CONFIG_PATH`
package/docs/images.md CHANGED
@@ -3,7 +3,6 @@ summary: "Image and media handling rules for send, gateway, and agent replies"
3
3
  read_when:
4
4
  - Modifying media pipeline or attachments
5
5
  ---
6
- <!-- {% raw %} -->
7
6
  # Image & Media Support — 2025-12-05
8
7
 
9
8
  CLAWDBOT is now **web-only** (Baileys). This document captures the current media handling rules for send, gateway, and agent replies.
@@ -49,4 +48,3 @@ CLAWDBOT is now **web-only** (Baileys). This document captures the current media
49
48
  - Cover send + reply flows for image/audio/document cases.
50
49
  - Validate recompression for images (size bound) and voice-note flag for audio.
51
50
  - Ensure multi-media replies fan out as sequential sends.
52
- <!-- {% endraw %} -->
package/docs/index.md CHANGED
@@ -3,17 +3,16 @@ summary: "Top-level overview of Clawdbot, features, and purpose"
3
3
  read_when:
4
4
  - Introducing Clawdbot to newcomers
5
5
  ---
6
- <!-- {% raw %} -->
7
6
  # CLAWDBOT 🦞
8
7
 
9
8
  > *"EXFOLIATE! EXFOLIATE!"* — A space lobster, probably
10
9
 
11
10
  <p align="center">
12
- <img src="whatsapp-clawd.jpg" alt="CLAWDBOT" width="420">
11
+ <img src="whatsapp-clawd.jpg" alt="CLAWDBOT" width="420" />
13
12
  </p>
14
13
 
15
14
  <p align="center">
16
- <strong>WhatsApp + Telegram + Discord + iMessage gateway for AI agents (Pi).</strong><br>
15
+ <strong>WhatsApp + Telegram + Discord + iMessage gateway for AI agents (Pi).</strong><br />
17
16
  Send a message, get an agent response — from your pocket.
18
17
  </p>
19
18
 
@@ -161,7 +160,6 @@ Example:
161
160
  ---
162
161
 
163
162
  *"We're all just playing with our own prompts."* — an AI, probably high on tokens
164
- <!-- {% endraw %} -->
165
163
 
166
164
  ## Credits
167
165
 
package/docs/mac/icon.md CHANGED
@@ -23,4 +23,4 @@ Shapes & sizes
23
23
 
24
24
  Behavioral notes
25
25
  - No external CLI/broker toggle for ears/working; keep it internal to the app’s own signals to avoid accidental flapping.
26
- - Keep TTLs short (<10s) so the icon returns to baseline quickly if a job hangs.
26
+ - Keep TTLs short (&lt;10s) so the icon returns to baseline quickly if a job hangs.
package/docs/nix.md CHANGED
@@ -1,26 +1,66 @@
1
1
  ---
2
- summary: "Running Clawdbot under Nix (config, state, and packaging expectations)"
2
+ summary: "Install Clawdbot declaratively with Nix"
3
3
  read_when:
4
- - Building Clawdbot with Nix
5
- - Debugging Nix-mode behavior
4
+ - You want reproducible, rollback-able installs
5
+ - You're already using Nix/NixOS/Home Manager
6
+ - You want everything pinned and managed declaratively
6
7
  ---
7
- # Nix mode
8
+
9
+ # Nix Installation
10
+
11
+ The recommended way to run Clawdbot with Nix is via **[nix-clawdbot](https://github.com/clawdbot/nix-clawdbot)** — a batteries-included Home Manager module.
12
+
13
+ ## Quick Start
14
+
15
+ Paste this to your AI agent (Claude, Cursor, etc.):
16
+
17
+ ```text
18
+ I want to set up nix-clawdbot on my Mac.
19
+ Repository: github:clawdbot/nix-clawdbot
20
+
21
+ What I need you to do:
22
+ 1. Check if Determinate Nix is installed (if not, install it)
23
+ 2. Create a local flake at ~/code/clawdbot-local using templates/agent-first/flake.nix
24
+ 3. Help me create a Telegram bot (@BotFather) and get my chat ID (@userinfobot)
25
+ 4. Set up secrets (bot token, Anthropic key) - plain files at ~/.secrets/ is fine
26
+ 5. Fill in the template placeholders and run home-manager switch
27
+ 6. Verify: launchd running, bot responds to messages
28
+
29
+ Reference the nix-clawdbot README for module options.
30
+ ```
31
+
32
+ > **📦 Full guide: [github.com/clawdbot/nix-clawdbot](https://github.com/clawdbot/nix-clawdbot)**
33
+ >
34
+ > The nix-clawdbot repo is the source of truth for Nix installation. This page is just a quick overview.
35
+
36
+ ## What you get
37
+
38
+ - Gateway + macOS app + tools (whisper, spotify, cameras) — all pinned
39
+ - Launchd service that survives reboots
40
+ - Plugin system with declarative config
41
+ - Instant rollback: `home-manager switch --rollback`
42
+
43
+ ---
44
+
45
+ ## Nix Mode Runtime Behavior
46
+
47
+ When `CLAWDBOT_NIX_MODE=1` is set (automatic with nix-clawdbot):
8
48
 
9
49
  Clawdbot supports a **Nix mode** that makes configuration deterministic and disables auto-install flows.
10
50
  Enable it by exporting:
11
51
 
12
- ```
52
+ ```bash
13
53
  CLAWDBOT_NIX_MODE=1
14
54
  ```
15
55
 
16
56
  On macOS, the GUI app does not automatically inherit shell env vars. You can
17
57
  also enable Nix mode via defaults:
18
58
 
19
- ```
59
+ ```bash
20
60
  defaults write com.clawdbot.mac clawdbot.nixMode -bool true
21
61
  ```
22
62
 
23
- ## Config + state paths
63
+ ### Config + state paths
24
64
 
25
65
  Clawdbot reads JSON5 config from `CLAWDBOT_CONFIG_PATH` and stores mutable data in `CLAWDBOT_STATE_DIR`.
26
66
 
@@ -30,11 +70,11 @@ Clawdbot reads JSON5 config from `CLAWDBOT_CONFIG_PATH` and stores mutable data
30
70
  When running under Nix, set these explicitly to Nix-managed locations so runtime state and config
31
71
  stay out of the immutable store.
32
72
 
33
- ## Runtime behavior in Nix mode
73
+ ### Runtime behavior in Nix mode
34
74
 
35
- - Auto-install and self-mutation flows should be disabled.
36
- - Missing dependencies should surface Nix-specific remediation messages.
37
- - UI surfaces a read-only Nix mode banner when present.
75
+ - Auto-install and self-mutation flows are disabled
76
+ - Missing dependencies surface Nix-specific remediation messages
77
+ - UI surfaces a read-only Nix mode banner when present
38
78
 
39
79
  ## Packaging note (macOS)
40
80
 
@@ -47,3 +87,9 @@ apps/macos/Sources/Clawdbot/Resources/Info.plist
47
87
  `scripts/package-mac-app.sh` copies this template into the app bundle and patches dynamic fields
48
88
  (bundle ID, version/build, Git SHA, Sparkle keys). This keeps the plist deterministic for SwiftPM
49
89
  packaging and Nix builds (which do not rely on a full Xcode toolchain).
90
+
91
+ ## Related
92
+
93
+ - [nix-clawdbot](https://github.com/clawdbot/nix-clawdbot) — full setup guide
94
+ - [Wizard](./wizard.md) — non-Nix CLI setup
95
+ - [Docker](./docker.md) — containerized setup
@@ -4,7 +4,6 @@ read_when:
4
4
  - Designing the macOS onboarding assistant
5
5
  - Implementing Anthropic auth or identity setup
6
6
  ---
7
- <!-- {% raw %} -->
8
7
  # Onboarding (macOS app)
9
8
 
10
9
  This doc describes the intended **first-run onboarding** for Clawdbot. The goal is a good “day 0” experience: pick where the Gateway runs, bind Claude (Anthropic) auth for the embedded agent runtime, and then let the **agent bootstrap itself** via a first-run ritual in the workspace.
@@ -182,4 +181,3 @@ chmod 600 ~/.clawdbot/credentials/oauth.json
182
181
  | `accessToken` | `access` |
183
182
  | `refreshToken` | `refresh` |
184
183
  | `expiresAt` | `expires` |
185
- <!-- {% endraw %} -->
@@ -3,7 +3,6 @@ summary: "WebChat session migration notes (Gateway WS-only)"
3
3
  read_when:
4
4
  - Changing WebChat Gateway methods/events
5
5
  ---
6
- <!-- {% raw %} -->
7
6
  # WebAgent session migration (WS-only)
8
7
 
9
8
  Context: web chat currently lives in a WKWebView that loads the pi-web bundle. Sends go over HTTP `/rpc` to the webchat server, and updates come from `/socket` snapshots based on session JSONL file changes. The Gateway itself already speaks WebSocket to the webchat server, and Pi writes the session JSONL files. This doc tracks the plan to move WebChat to a single Gateway WebSocket and drop the HTTP shim/file-watching.
@@ -43,4 +42,3 @@ Context: web chat currently lives in a WKWebView that loads the pi-web bundle. S
43
42
  - Streaming granularity: start with `state:"final"` only, or include token/tool deltas immediately?
44
43
  - Attachments over WS: text-only initially is OK; confirm before wiring binary/upload path.
45
44
  - Error shape: use `res ok:false` for validation/timeout, `chat state:"error"` for model/runtime failures.
46
- <!-- {% endraw %} -->
@@ -111,7 +111,7 @@ Example:
111
111
  ## Retain
112
112
  - W @Peter: Currently in Marrakech (Nov 27–Dec 1, 2025) for Andy’s birthday.
113
113
  - B @warelay: I fixed the Baileys WS crash by wrapping connection.update handlers in try/catch (see memory/2025-11-27.md).
114
- - O(c=0.95) @Peter: Prefers concise replies (<1500 chars) on WhatsApp; long content goes into files.
114
+ - O(c=0.95) @Peter: Prefers concise replies (&lt;1500 chars) on WhatsApp; long content goes into files.
115
115
  ```
116
116
 
117
117
  Minimal parsing:
package/docs/skills.md CHANGED
@@ -4,7 +4,6 @@ read_when:
4
4
  - Adding or modifying skills
5
5
  - Changing skill gating or load rules
6
6
  ---
7
- <!-- {% raw %} -->
8
7
  # Skills (Clawdbot)
9
8
 
10
9
  Clawdbot uses **AgentSkills-compatible** skill folders to teach the agent how to use tools. Each skill is a directory containing a `SKILL.md` with YAML frontmatter and instructions. Clawdbot loads **bundled skills** plus optional local overrides, and filters them at load time based on environment, config, and binary presence.
@@ -146,4 +145,3 @@ copy). Workspace skills are user-owned and override both on name conflicts.
146
145
  See `docs/skills-config.md` for the full configuration schema.
147
146
 
148
147
  ---
149
- <!-- {% endraw %} -->
@@ -103,7 +103,7 @@ When you receive a `HEARTBEAT` message, don't just reply `HEARTBEAT_OK` every ti
103
103
 
104
104
  **When to reach out:**
105
105
  - Important email arrived
106
- - Calendar event coming up (<2h)
106
+ - Calendar event coming up (&lt;2h)
107
107
  - Something interesting you found
108
108
  - It's been >8h since you said anything
109
109
 
@@ -111,7 +111,7 @@ When you receive a `HEARTBEAT` message, don't just reply `HEARTBEAT_OK` every ti
111
111
  - Late night (23:00-08:00) unless urgent
112
112
  - Human is clearly busy
113
113
  - Nothing new since last check
114
- - You just checked <30 minutes ago
114
+ - You just checked &lt;30 minutes ago
115
115
 
116
116
  **Proactive work you can do without asking:**
117
117
  - Read and organize memory files
package/docs/tools.md CHANGED
@@ -11,6 +11,21 @@ Clawdbot exposes **first-class agent tools** for browser, canvas, nodes, and cro
11
11
  These replace the old `clawdbot-*` skills: the tools are typed, no shelling,
12
12
  and the agent should rely on them directly.
13
13
 
14
+ ## Disabling tools
15
+
16
+ You can globally allow/deny tools via `agent.tools` in `clawdbot.json`
17
+ (deny wins). This prevents disallowed tools from being sent to providers.
18
+
19
+ ```json5
20
+ {
21
+ agent: {
22
+ tools: {
23
+ deny: ["browser"]
24
+ }
25
+ }
26
+ }
27
+ ```
28
+
14
29
  ## Tool inventory
15
30
 
16
31
  ### `bash`
package/docs/whatsapp.md CHANGED
@@ -33,6 +33,8 @@ WhatsApp requires a real mobile number for verification. VoIP and virtual number
33
33
 
34
34
  **Tip:** The number only needs to receive one verification SMS. After that, WhatsApp Web sessions persist via `creds.json`.
35
35
 
36
+ **WhatsApp Business:** You can use WhatsApp Business on the same phone with a different number. This is a great option if you want to keep your personal WhatsApp separate — just install WhatsApp Business and register it with Clawdbot's dedicated number.
37
+
36
38
  ## Login + credentials
37
39
  - Login command: `clawdbot login` (QR via Linked Devices).
38
40
  - Credentials stored in `~/.clawdbot/credentials/creds.json`.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "clawdbot",
3
- "version": "2026.1.4",
3
+ "version": "2026.1.5",
4
4
  "description": "WhatsApp gateway CLI (Baileys web) with Pi RPC agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
- "clawdbot": "dist/index.js"
8
+ "clawdbot": "dist/entry.js"
9
9
  },
10
10
  "files": [
11
11
  "dist/agents/**",
@@ -36,19 +36,19 @@
36
36
  "LICENSE"
37
37
  ],
38
38
  "scripts": {
39
- "dev": "tsx src/index.ts",
39
+ "dev": "tsx src/entry.ts",
40
40
  "docs:list": "tsx scripts/docs-list.ts",
41
41
  "docs:dev": "cd docs && mint dev",
42
- "docs:build": "cd docs && mint broken-links",
42
+ "docs:build": "cd docs && pnpm dlx mint broken-links",
43
43
  "build": "tsc -p tsconfig.json && tsx scripts/canvas-a2ui-copy.ts",
44
44
  "release:check": "tsx scripts/release-check.ts",
45
45
  "ui:install": "pnpm -C ui install",
46
46
  "ui:dev": "pnpm -C ui dev",
47
47
  "ui:build": "pnpm -C ui build",
48
- "start": "tsx src/index.ts",
49
- "clawdbot": "tsx src/index.ts",
50
- "gateway:watch": "tsx watch --clear-screen=false --include 'src/**/*.ts' src/index.ts gateway --force",
51
- "clawdbot:rpc": "tsx src/index.ts agent --mode rpc --json",
48
+ "start": "tsx src/entry.ts",
49
+ "clawdbot": "tsx src/entry.ts",
50
+ "gateway:watch": "tsx watch --clear-screen=false --include 'src/**/*.ts' src/entry.ts gateway --force",
51
+ "clawdbot:rpc": "tsx src/entry.ts agent --mode rpc --json",
52
52
  "lint": "biome check src test && oxlint --type-aware src test --ignore-pattern src/canvas-host/a2ui/a2ui.bundle.js",
53
53
  "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)",
54
54
  "lint:fix": "biome check --write --unsafe src && biome format --write src",