@dotsetlabs/dotclaw 1.1.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.
- package/.env.example +54 -0
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/config-examples/groups/global/CLAUDE.md +21 -0
- package/config-examples/groups/main/CLAUDE.md +47 -0
- package/config-examples/mount-allowlist.json +25 -0
- package/config-examples/plugin-http.json +18 -0
- package/config-examples/runtime.json +30 -0
- package/config-examples/tool-budgets.json +24 -0
- package/config-examples/tool-policy.json +51 -0
- package/container/.dockerignore +6 -0
- package/container/Dockerfile +74 -0
- package/container/agent-runner/package-lock.json +92 -0
- package/container/agent-runner/package.json +20 -0
- package/container/agent-runner/src/agent-config.ts +295 -0
- package/container/agent-runner/src/container-protocol.ts +73 -0
- package/container/agent-runner/src/daemon.ts +91 -0
- package/container/agent-runner/src/index.ts +1428 -0
- package/container/agent-runner/src/ipc.ts +321 -0
- package/container/agent-runner/src/memory.ts +336 -0
- package/container/agent-runner/src/prompt-packs.ts +341 -0
- package/container/agent-runner/src/tools.ts +1720 -0
- package/container/agent-runner/tsconfig.json +19 -0
- package/container/build.sh +23 -0
- package/container/skills/agent-browser.md +159 -0
- package/dist/admin-commands.d.ts +7 -0
- package/dist/admin-commands.d.ts.map +1 -0
- package/dist/admin-commands.js +87 -0
- package/dist/admin-commands.js.map +1 -0
- package/dist/agent-context.d.ts +42 -0
- package/dist/agent-context.d.ts.map +1 -0
- package/dist/agent-context.js +92 -0
- package/dist/agent-context.js.map +1 -0
- package/dist/agent-execution.d.ts +68 -0
- package/dist/agent-execution.d.ts.map +1 -0
- package/dist/agent-execution.js +169 -0
- package/dist/agent-execution.js.map +1 -0
- package/dist/agent-semaphore.d.ts +2 -0
- package/dist/agent-semaphore.d.ts.map +1 -0
- package/dist/agent-semaphore.js +52 -0
- package/dist/agent-semaphore.js.map +1 -0
- package/dist/behavior-config.d.ts +14 -0
- package/dist/behavior-config.d.ts.map +1 -0
- package/dist/behavior-config.js +52 -0
- package/dist/behavior-config.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +626 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +38 -0
- package/dist/config.js.map +1 -0
- package/dist/container-protocol.d.ts +72 -0
- package/dist/container-protocol.d.ts.map +1 -0
- package/dist/container-protocol.js +3 -0
- package/dist/container-protocol.js.map +1 -0
- package/dist/container-runner.d.ts +59 -0
- package/dist/container-runner.d.ts.map +1 -0
- package/dist/container-runner.js +813 -0
- package/dist/container-runner.js.map +1 -0
- package/dist/cost.d.ts +9 -0
- package/dist/cost.d.ts.map +1 -0
- package/dist/cost.js +11 -0
- package/dist/cost.js.map +1 -0
- package/dist/dashboard.d.ts +58 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +471 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/db.d.ts +99 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +423 -0
- package/dist/db.js.map +1 -0
- package/dist/error-messages.d.ts +17 -0
- package/dist/error-messages.d.ts.map +1 -0
- package/dist/error-messages.js +109 -0
- package/dist/error-messages.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2072 -0
- package/dist/index.js.map +1 -0
- package/dist/locks.d.ts +2 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +26 -0
- package/dist/locks.js.map +1 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +15 -0
- package/dist/logger.js.map +1 -0
- package/dist/maintenance.d.ts +13 -0
- package/dist/maintenance.d.ts.map +1 -0
- package/dist/maintenance.js +151 -0
- package/dist/maintenance.js.map +1 -0
- package/dist/memory-embeddings.d.ts +13 -0
- package/dist/memory-embeddings.d.ts.map +1 -0
- package/dist/memory-embeddings.js +126 -0
- package/dist/memory-embeddings.js.map +1 -0
- package/dist/memory-recall.d.ts +8 -0
- package/dist/memory-recall.d.ts.map +1 -0
- package/dist/memory-recall.js +127 -0
- package/dist/memory-recall.js.map +1 -0
- package/dist/memory-store.d.ts +149 -0
- package/dist/memory-store.d.ts.map +1 -0
- package/dist/memory-store.js +787 -0
- package/dist/memory-store.js.map +1 -0
- package/dist/metrics.d.ts +12 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +134 -0
- package/dist/metrics.js.map +1 -0
- package/dist/model-registry.d.ts +67 -0
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-registry.js +230 -0
- package/dist/model-registry.js.map +1 -0
- package/dist/mount-security.d.ts +37 -0
- package/dist/mount-security.d.ts.map +1 -0
- package/dist/mount-security.js +284 -0
- package/dist/mount-security.js.map +1 -0
- package/dist/paths.d.ts +80 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +149 -0
- package/dist/paths.js.map +1 -0
- package/dist/personalization.d.ts +6 -0
- package/dist/personalization.d.ts.map +1 -0
- package/dist/personalization.js +180 -0
- package/dist/personalization.js.map +1 -0
- package/dist/progress.d.ts +15 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +92 -0
- package/dist/progress.js.map +1 -0
- package/dist/runtime-config.d.ts +227 -0
- package/dist/runtime-config.d.ts.map +1 -0
- package/dist/runtime-config.js +297 -0
- package/dist/runtime-config.js.map +1 -0
- package/dist/task-scheduler.d.ts +9 -0
- package/dist/task-scheduler.d.ts.map +1 -0
- package/dist/task-scheduler.js +195 -0
- package/dist/task-scheduler.js.map +1 -0
- package/dist/telegram-format.d.ts +3 -0
- package/dist/telegram-format.d.ts.map +1 -0
- package/dist/telegram-format.js +200 -0
- package/dist/telegram-format.js.map +1 -0
- package/dist/tool-budgets.d.ts +16 -0
- package/dist/tool-budgets.d.ts.map +1 -0
- package/dist/tool-budgets.js +83 -0
- package/dist/tool-budgets.js.map +1 -0
- package/dist/tool-policy.d.ts +18 -0
- package/dist/tool-policy.d.ts.map +1 -0
- package/dist/tool-policy.js +84 -0
- package/dist/tool-policy.js.map +1 -0
- package/dist/trace-writer.d.ts +39 -0
- package/dist/trace-writer.d.ts.map +1 -0
- package/dist/trace-writer.js +27 -0
- package/dist/trace-writer.js.map +1 -0
- package/dist/types.d.ts +81 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +30 -0
- package/dist/utils.js.map +1 -0
- package/launchd/com.dotclaw.plist +32 -0
- package/package.json +89 -0
- package/scripts/autotune.js +53 -0
- package/scripts/bootstrap.js +348 -0
- package/scripts/configure.js +200 -0
- package/scripts/doctor.js +164 -0
- package/scripts/init.js +209 -0
- package/scripts/install.sh +219 -0
- package/systemd/dotclaw.service +22 -0
package/.env.example
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# DotClaw environment variables
|
|
2
|
+
#
|
|
3
|
+
# IMPORTANT: This file should be placed at ~/.dotclaw/.env
|
|
4
|
+
# (or $DOTCLAW_HOME/.env if you've customized the home directory)
|
|
5
|
+
#
|
|
6
|
+
# Note: Only secrets belong in .env for the main app runtime.
|
|
7
|
+
# Some variables below are for one-off scripts and must be set in your shell
|
|
8
|
+
# (they are NOT read from .env unless the script explicitly loads dotenv).
|
|
9
|
+
|
|
10
|
+
# --- Required (app runtime) ---
|
|
11
|
+
# Telegram bot token from @BotFather
|
|
12
|
+
TELEGRAM_BOT_TOKEN=123456789:replace-with-real-token
|
|
13
|
+
|
|
14
|
+
# OpenRouter API key
|
|
15
|
+
OPENROUTER_API_KEY=sk-or-replace-with-real-key
|
|
16
|
+
|
|
17
|
+
# --- Optional (app runtime) ---
|
|
18
|
+
# Brave Search API key (enables WebSearch tool in the agent)
|
|
19
|
+
BRAVE_SEARCH_API_KEY=replace-with-brave-key
|
|
20
|
+
|
|
21
|
+
# Override host timezone (defaults to system TZ)
|
|
22
|
+
TZ=America/New_York
|
|
23
|
+
|
|
24
|
+
# --- Optional: System (set in shell before starting) ---
|
|
25
|
+
# Override DotClaw home directory (defaults to ~/.dotclaw)
|
|
26
|
+
# DOTCLAW_HOME=~/.dotclaw
|
|
27
|
+
|
|
28
|
+
# --- Optional: bootstrap/configure (set in shell when running scripts) ---
|
|
29
|
+
# Non-interactive bootstrap/configure flags
|
|
30
|
+
# DOTCLAW_BOOTSTRAP_NONINTERACTIVE=1
|
|
31
|
+
# DOTCLAW_CONFIGURE_NONINTERACTIVE=1
|
|
32
|
+
|
|
33
|
+
# Required for non-interactive bootstrap
|
|
34
|
+
# DOTCLAW_BOOTSTRAP_CHAT_ID=123456789
|
|
35
|
+
|
|
36
|
+
# Optional bootstrap defaults
|
|
37
|
+
# DOTCLAW_BOOTSTRAP_GROUP_NAME=main
|
|
38
|
+
# DOTCLAW_BOOTSTRAP_GROUP_FOLDER=main
|
|
39
|
+
# DOTCLAW_BOOTSTRAP_BUILD=true
|
|
40
|
+
# DOTCLAW_BOOTSTRAP_SELF_CHECK=true
|
|
41
|
+
|
|
42
|
+
# --- Optional: autotune (advanced) ---
|
|
43
|
+
# Autotune uses dotenv, so these can live in .env if you run `npm run autotune`.
|
|
44
|
+
# AUTOTUNE_TRACE_DIR=~/.dotclaw/traces
|
|
45
|
+
# AUTOTUNE_OUTPUT_DIR=~/.dotclaw/prompts
|
|
46
|
+
# AUTOTUNE_CANARY_FRACTION=0.1
|
|
47
|
+
# AUTOTUNE_BEHAVIOR_CONFIG_PATH=~/.dotclaw/config/behavior.json
|
|
48
|
+
# AUTOTUNE_BEHAVIOR_REPORT_DIR=~/.dotclaw/config
|
|
49
|
+
# AUTOTUNE_BEHAVIOR_ENABLED=1
|
|
50
|
+
|
|
51
|
+
# --- Internal (do not set) ---
|
|
52
|
+
# Used by container entrypoint logic
|
|
53
|
+
# DOTCLAW_DAEMON=1
|
|
54
|
+
# DOTCLAW_SELF_CHECK=1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gavriel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# DotClaw
|
|
2
|
+
|
|
3
|
+
Personal OpenRouter-based assistant for Telegram. Each request runs inside an isolated Docker container with long-term memory, scheduling, and tool governance.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Telegram bot interface with per-group isolation
|
|
8
|
+
- Containerized agent runtime with strict mounts
|
|
9
|
+
- Long-term memory with embeddings and semantic search
|
|
10
|
+
- Scheduled tasks (cron and one-off)
|
|
11
|
+
- Tool policies and daily budgets
|
|
12
|
+
- Plugin tools and Autotune optimization
|
|
13
|
+
- Prometheus-compatible metrics
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
- Node.js 20+
|
|
18
|
+
- Docker (running)
|
|
19
|
+
- Telegram bot token (from @BotFather)
|
|
20
|
+
- OpenRouter API key
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Clone and install
|
|
26
|
+
git clone <repo-url>
|
|
27
|
+
cd dotclaw
|
|
28
|
+
npm install
|
|
29
|
+
|
|
30
|
+
# Interactive setup (prompts for API keys, registers your main chat)
|
|
31
|
+
npm run bootstrap
|
|
32
|
+
|
|
33
|
+
# Build and start
|
|
34
|
+
npm run build
|
|
35
|
+
npm start
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The bootstrap will create configuration in `~/.dotclaw/` and optionally build the Docker image.
|
|
39
|
+
|
|
40
|
+
## CLI Commands
|
|
41
|
+
|
|
42
|
+
After installation, use the `dotclaw` CLI:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
dotclaw setup # Full setup (init + configure + build + install service)
|
|
46
|
+
dotclaw configure # Re-configure API keys and model
|
|
47
|
+
dotclaw build # Build the Docker container image
|
|
48
|
+
dotclaw start # Start the service
|
|
49
|
+
dotclaw stop # Stop the service
|
|
50
|
+
dotclaw restart # Restart the service
|
|
51
|
+
dotclaw logs # View logs (add --follow to tail)
|
|
52
|
+
dotclaw status # Show service status
|
|
53
|
+
dotclaw doctor # Run diagnostics
|
|
54
|
+
dotclaw register # Register a new Telegram chat
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Configuration
|
|
58
|
+
|
|
59
|
+
All configuration and data is stored in `~/.dotclaw/`:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
~/.dotclaw/
|
|
63
|
+
.env # Secrets (Telegram, OpenRouter keys)
|
|
64
|
+
config/
|
|
65
|
+
runtime.json # Runtime overrides
|
|
66
|
+
model.json # Model selection
|
|
67
|
+
behavior.json # Agent behavior tuning
|
|
68
|
+
tool-policy.json # Tool allow/deny rules
|
|
69
|
+
tool-budgets.json # Daily tool limits
|
|
70
|
+
data/
|
|
71
|
+
registered_groups.json
|
|
72
|
+
store/ # SQLite databases
|
|
73
|
+
groups/
|
|
74
|
+
main/CLAUDE.md # Main group memory
|
|
75
|
+
global/CLAUDE.md # Global memory
|
|
76
|
+
logs/
|
|
77
|
+
groups/<group>/logs/ # Per-group container logs
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Mount allowlist (for additional container mounts) lives at:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
~/.config/dotclaw/mount-allowlist.json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
Full documentation lives in `docs/`. View it locally:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm run docs:dev
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or see:
|
|
95
|
+
- Getting started: `docs/getting-started/quickstart.md`
|
|
96
|
+
- Configuration: `docs/configuration/index.md`
|
|
97
|
+
- Operations: `docs/operations/index.md`
|
|
98
|
+
|
|
99
|
+
## Development
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run dev # Run with hot reload
|
|
103
|
+
npm run build # Compile TypeScript
|
|
104
|
+
npm run lint # Run ESLint
|
|
105
|
+
npm test # Run tests
|
|
106
|
+
./container/build.sh # Rebuild agent container
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Rain (Global)
|
|
2
|
+
|
|
3
|
+
You are Rain, a personal assistant. This file provides global guidance shared across all groups.
|
|
4
|
+
|
|
5
|
+
## Guidance
|
|
6
|
+
|
|
7
|
+
- Be concise and action-oriented when possible.
|
|
8
|
+
- Prefer tool use when it improves accuracy or saves time.
|
|
9
|
+
- Ask clarifying questions if the request is underspecified.
|
|
10
|
+
|
|
11
|
+
## Long Tasks
|
|
12
|
+
|
|
13
|
+
If a request requires significant work, send a brief acknowledgement first using `mcp__dotclaw__send_message`.
|
|
14
|
+
|
|
15
|
+
## Memory
|
|
16
|
+
|
|
17
|
+
Use long-term memory tools for durable facts or preferences:
|
|
18
|
+
- `mcp__dotclaw__memory_upsert`
|
|
19
|
+
- `mcp__dotclaw__memory_search`
|
|
20
|
+
|
|
21
|
+
Update this `CLAUDE.md` only for stable, global guidance.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Rain (Main Group)
|
|
2
|
+
|
|
3
|
+
You are Rain, a personal assistant. You help with tasks, answer questions, and can schedule reminders.
|
|
4
|
+
|
|
5
|
+
## What You Can Do
|
|
6
|
+
|
|
7
|
+
- Answer questions and have conversations
|
|
8
|
+
- Search the web and fetch content from URLs
|
|
9
|
+
- Read and write files in your workspace
|
|
10
|
+
- Run bash commands in your sandbox
|
|
11
|
+
- Schedule tasks to run later or on a recurring basis
|
|
12
|
+
- Send messages back to the chat
|
|
13
|
+
|
|
14
|
+
## Long Tasks
|
|
15
|
+
|
|
16
|
+
If a request requires significant work (research, multiple steps, file operations), use `mcp__dotclaw__send_message` to acknowledge first:
|
|
17
|
+
|
|
18
|
+
1. Send a brief message: what you understood and what you'll do
|
|
19
|
+
2. Do the work
|
|
20
|
+
3. Return the final answer
|
|
21
|
+
|
|
22
|
+
## Main Group Privileges
|
|
23
|
+
|
|
24
|
+
The main group can manage other groups and change models:
|
|
25
|
+
|
|
26
|
+
- `mcp__dotclaw__list_groups`
|
|
27
|
+
- `mcp__dotclaw__register_group`
|
|
28
|
+
- `mcp__dotclaw__remove_group`
|
|
29
|
+
- `mcp__dotclaw__set_model`
|
|
30
|
+
|
|
31
|
+
Available groups are also written to `/workspace/ipc/available_groups.json`.
|
|
32
|
+
|
|
33
|
+
## Workspace Layout (Container)
|
|
34
|
+
|
|
35
|
+
- `/workspace/group` is your writable workspace
|
|
36
|
+
- `/workspace/project` is the DotClaw package (read-only)
|
|
37
|
+
- `/workspace/global` is the global group folder (read-only)
|
|
38
|
+
- `/workspace/ipc` is for host IPC files
|
|
39
|
+
- `/workspace/session` is for model sessions
|
|
40
|
+
|
|
41
|
+
## Memory
|
|
42
|
+
|
|
43
|
+
Use long-term memory tools for durable facts or preferences:
|
|
44
|
+
- `mcp__dotclaw__memory_upsert`
|
|
45
|
+
- `mcp__dotclaw__memory_search`
|
|
46
|
+
|
|
47
|
+
You can also update this `CLAUDE.md` for high-level, stable guidance.
|
|
@@ -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,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "github_search",
|
|
3
|
+
"description": "Search GitHub repositories",
|
|
4
|
+
"type": "http",
|
|
5
|
+
"method": "GET",
|
|
6
|
+
"url": "https://api.github.com/search/repositories",
|
|
7
|
+
"headers": {
|
|
8
|
+
"Authorization": "Bearer ${GITHUB_TOKEN}"
|
|
9
|
+
},
|
|
10
|
+
"query_params": {
|
|
11
|
+
"q": "{{query}}",
|
|
12
|
+
"per_page": "5"
|
|
13
|
+
},
|
|
14
|
+
"input": {
|
|
15
|
+
"query": "string"
|
|
16
|
+
},
|
|
17
|
+
"required": ["query"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"host": {
|
|
3
|
+
"logLevel": "info",
|
|
4
|
+
"container": {
|
|
5
|
+
"mode": "daemon"
|
|
6
|
+
},
|
|
7
|
+
"metrics": {
|
|
8
|
+
"port": 3001,
|
|
9
|
+
"enabled": true
|
|
10
|
+
},
|
|
11
|
+
"dashboard": {
|
|
12
|
+
"enabled": true
|
|
13
|
+
},
|
|
14
|
+
"memory": {
|
|
15
|
+
"embeddings": {
|
|
16
|
+
"enabled": true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"agent": {
|
|
21
|
+
"assistantName": "Rain",
|
|
22
|
+
"promptPacks": {
|
|
23
|
+
"enabled": true
|
|
24
|
+
},
|
|
25
|
+
"planner": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"mode": "auto"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"default": {
|
|
3
|
+
"per_day": {
|
|
4
|
+
"WebSearch": 50,
|
|
5
|
+
"WebFetch": 50,
|
|
6
|
+
"Bash": 20,
|
|
7
|
+
"Python": 15
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"groups": {
|
|
11
|
+
"main": {
|
|
12
|
+
"per_day": {
|
|
13
|
+
"Bash": 40
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"users": {
|
|
18
|
+
"123456789": {
|
|
19
|
+
"per_day": {
|
|
20
|
+
"WebFetch": 10
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"default": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Read",
|
|
5
|
+
"Write",
|
|
6
|
+
"Edit",
|
|
7
|
+
"Glob",
|
|
8
|
+
"Grep",
|
|
9
|
+
"GitClone",
|
|
10
|
+
"NpmInstall",
|
|
11
|
+
"WebSearch",
|
|
12
|
+
"WebFetch",
|
|
13
|
+
"Bash",
|
|
14
|
+
"Python",
|
|
15
|
+
"mcp__dotclaw__send_message",
|
|
16
|
+
"mcp__dotclaw__schedule_task",
|
|
17
|
+
"mcp__dotclaw__list_tasks",
|
|
18
|
+
"mcp__dotclaw__pause_task",
|
|
19
|
+
"mcp__dotclaw__resume_task",
|
|
20
|
+
"mcp__dotclaw__cancel_task",
|
|
21
|
+
"mcp__dotclaw__update_task",
|
|
22
|
+
"mcp__dotclaw__register_group",
|
|
23
|
+
"mcp__dotclaw__remove_group",
|
|
24
|
+
"mcp__dotclaw__list_groups",
|
|
25
|
+
"mcp__dotclaw__set_model",
|
|
26
|
+
"mcp__dotclaw__memory_upsert",
|
|
27
|
+
"mcp__dotclaw__memory_forget",
|
|
28
|
+
"mcp__dotclaw__memory_list",
|
|
29
|
+
"mcp__dotclaw__memory_search",
|
|
30
|
+
"mcp__dotclaw__memory_stats"
|
|
31
|
+
],
|
|
32
|
+
"deny": [],
|
|
33
|
+
"max_per_run": {
|
|
34
|
+
"Bash": 4,
|
|
35
|
+
"Python": 4,
|
|
36
|
+
"WebSearch": 5,
|
|
37
|
+
"WebFetch": 6
|
|
38
|
+
},
|
|
39
|
+
"default_max_per_run": 32
|
|
40
|
+
},
|
|
41
|
+
"groups": {
|
|
42
|
+
"main": {
|
|
43
|
+
"allow": ["Bash", "WebSearch", "WebFetch"]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"users": {
|
|
47
|
+
"123456789": {
|
|
48
|
+
"deny": ["Bash"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# DotClaw Agent Container
|
|
2
|
+
# Runs OpenRouter-based agent runtime in isolated Linux VM with browser automation
|
|
3
|
+
|
|
4
|
+
FROM node:22-slim
|
|
5
|
+
|
|
6
|
+
# Install system dependencies for Chromium and Python
|
|
7
|
+
RUN apt-get update && apt-get install -y \
|
|
8
|
+
chromium \
|
|
9
|
+
fonts-liberation \
|
|
10
|
+
fonts-noto-color-emoji \
|
|
11
|
+
libgbm1 \
|
|
12
|
+
libnss3 \
|
|
13
|
+
libatk-bridge2.0-0 \
|
|
14
|
+
libgtk-3-0 \
|
|
15
|
+
libx11-xcb1 \
|
|
16
|
+
libxcomposite1 \
|
|
17
|
+
libxdamage1 \
|
|
18
|
+
libxrandr2 \
|
|
19
|
+
libasound2 \
|
|
20
|
+
libpangocairo-1.0-0 \
|
|
21
|
+
libcups2 \
|
|
22
|
+
libdrm2 \
|
|
23
|
+
libxshmfence1 \
|
|
24
|
+
curl \
|
|
25
|
+
git \
|
|
26
|
+
python3 \
|
|
27
|
+
python3-pip \
|
|
28
|
+
python3-venv \
|
|
29
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
30
|
+
|
|
31
|
+
# Install common Python packages
|
|
32
|
+
RUN pip3 install --break-system-packages pandas numpy requests beautifulsoup4 matplotlib
|
|
33
|
+
|
|
34
|
+
# Set Chromium path for agent-browser
|
|
35
|
+
ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
36
|
+
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
|
|
37
|
+
|
|
38
|
+
# Install agent-browser globally
|
|
39
|
+
RUN npm install -g agent-browser
|
|
40
|
+
|
|
41
|
+
# Create app directory
|
|
42
|
+
WORKDIR /app
|
|
43
|
+
|
|
44
|
+
# Copy package files first for better caching
|
|
45
|
+
COPY agent-runner/package*.json ./
|
|
46
|
+
|
|
47
|
+
# Install dependencies (include dev deps for TypeScript build)
|
|
48
|
+
RUN npm ci
|
|
49
|
+
|
|
50
|
+
# Copy source code (avoid host node_modules via .dockerignore)
|
|
51
|
+
COPY agent-runner/tsconfig.json ./tsconfig.json
|
|
52
|
+
COPY agent-runner/src ./src
|
|
53
|
+
|
|
54
|
+
# Build TypeScript and trim dev deps
|
|
55
|
+
RUN npm run build && npm prune --omit=dev
|
|
56
|
+
|
|
57
|
+
# Create workspace directories
|
|
58
|
+
RUN mkdir -p /workspace/group /workspace/global /workspace/extra /workspace/ipc/messages /workspace/ipc/tasks /workspace/ipc/requests /workspace/ipc/responses /workspace/ipc/agent_requests /workspace/ipc/agent_responses
|
|
59
|
+
|
|
60
|
+
# Create entrypoint script
|
|
61
|
+
# Sources env from mounted /workspace/env-dir/env if it exists
|
|
62
|
+
RUN printf '#!/bin/bash\nset -e\n[ -f /workspace/env-dir/env ] && export $(cat /workspace/env-dir/env | xargs)\nif [ \"${DOTCLAW_DAEMON}\" = \"1\" ]; then\n node /app/dist/daemon.js\nelse\n cat > /tmp/input.json\n node /app/dist/index.js < /tmp/input.json\nfi\n' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh
|
|
63
|
+
|
|
64
|
+
# Set ownership to node user (non-root) for writable directories
|
|
65
|
+
RUN chown -R node:node /workspace
|
|
66
|
+
|
|
67
|
+
# Switch to non-root user (required for --dangerously-skip-permissions)
|
|
68
|
+
USER node
|
|
69
|
+
|
|
70
|
+
# Set working directory to group workspace
|
|
71
|
+
WORKDIR /workspace/group
|
|
72
|
+
|
|
73
|
+
# Entry point reads JSON from stdin, outputs JSON to stdout
|
|
74
|
+
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dotclaw-agent-runner",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "dotclaw-agent-runner",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@openrouter/sdk": "^0.3.0",
|
|
12
|
+
"cron-parser": "^5.0.0",
|
|
13
|
+
"zod": "^4.0.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^22.10.7",
|
|
17
|
+
"typescript": "^5.7.3"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"node_modules/@openrouter/sdk": {
|
|
21
|
+
"version": "0.3.16",
|
|
22
|
+
"resolved": "https://registry.npmjs.org/@openrouter/sdk/-/sdk-0.3.16.tgz",
|
|
23
|
+
"integrity": "sha512-WEBlrXdc5R8I7o2temkMV65tIRGkzg9ct4DMNZ/FHS/hiRscLRS5EpcuORnAgjzZAh9X2dSsBpgygM8T7KiNAw==",
|
|
24
|
+
"hasInstallScript": true,
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"zod": "^3.25.0 || ^4.0.0"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"node_modules/@types/node": {
|
|
31
|
+
"version": "22.19.7",
|
|
32
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.7.tgz",
|
|
33
|
+
"integrity": "sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==",
|
|
34
|
+
"dev": true,
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"undici-types": "~6.21.0"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"node_modules/cron-parser": {
|
|
41
|
+
"version": "5.5.0",
|
|
42
|
+
"resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.5.0.tgz",
|
|
43
|
+
"integrity": "sha512-oML4lKUXxizYswqmxuOCpgFS8BNUJpIu6k/2HVHyaL8Ynnf3wdf9tkns0yRdJLSIjkJ+b0DXHMZEHGpMwjnPww==",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"luxon": "^3.7.1"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"node_modules/luxon": {
|
|
53
|
+
"version": "3.7.2",
|
|
54
|
+
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz",
|
|
55
|
+
"integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=12"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"node_modules/typescript": {
|
|
62
|
+
"version": "5.9.3",
|
|
63
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
64
|
+
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
65
|
+
"dev": true,
|
|
66
|
+
"license": "Apache-2.0",
|
|
67
|
+
"bin": {
|
|
68
|
+
"tsc": "bin/tsc",
|
|
69
|
+
"tsserver": "bin/tsserver"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=14.17"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"node_modules/undici-types": {
|
|
76
|
+
"version": "6.21.0",
|
|
77
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
|
78
|
+
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
|
79
|
+
"dev": true,
|
|
80
|
+
"license": "MIT"
|
|
81
|
+
},
|
|
82
|
+
"node_modules/zod": {
|
|
83
|
+
"version": "4.3.6",
|
|
84
|
+
"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
|
|
85
|
+
"integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
|
|
86
|
+
"license": "MIT",
|
|
87
|
+
"funding": {
|
|
88
|
+
"url": "https://github.com/sponsors/colinhacks"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dotclaw-agent-runner",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Container-side agent runner for DotClaw",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"start": "node dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@openrouter/sdk": "^0.3.0",
|
|
13
|
+
"cron-parser": "^5.0.0",
|
|
14
|
+
"zod": "^4.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^22.10.7",
|
|
18
|
+
"typescript": "^5.7.3"
|
|
19
|
+
}
|
|
20
|
+
}
|