@swarmclawai/swarmclaw 1.5.3 → 1.5.33
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/README.md +167 -147
- package/bin/swarmclaw.js +35 -1
- package/package.json +2 -2
- package/scripts/run-next-build.mjs +87 -2
- package/skills/swarmclaw/SKILL.md +151 -0
- package/src/app/api/agents/[id]/route.ts +8 -0
- package/src/app/api/agents/agents-route.test.ts +114 -0
- package/src/app/api/agents/route.ts +10 -0
- package/src/app/api/connectors/route.ts +25 -13
- package/src/app/api/credentials/[id]/route.ts +8 -1
- package/src/app/api/schedules/[id]/route.ts +8 -0
- package/src/app/api/secrets/[id]/route.ts +10 -0
- package/src/app/api/setup/check-provider/route.ts +45 -0
- package/src/app/api/setup/doctor/route.ts +5 -0
- package/src/cli/binary.test.js +11 -0
- package/src/cli/index.js +4 -4
- package/src/cli/index.test.js +5 -2
- package/src/cli/index.ts +1 -1
- package/src/components/agents/agent-sheet.tsx +16 -4
- package/src/components/agents/inspector-panel.tsx +5 -0
- package/src/components/auth/setup-wizard/step-agents.tsx +19 -1
- package/src/components/chat/activity-moment.tsx +3 -0
- package/src/components/chat/chat-header.tsx +23 -2
- package/src/components/chat/tool-call-bubble.tsx +20 -0
- package/src/components/layout/sidebar-rail.tsx +29 -0
- package/src/hooks/setup-done-detection.test.ts +4 -2
- package/src/hooks/setup-done-detection.ts +1 -1
- package/src/lib/orchestrator-config.ts +5 -0
- package/src/lib/provider-sets.ts +4 -4
- package/src/lib/providers/acp-client.ts +116 -0
- package/src/lib/providers/cli-utils.test.ts +9 -1
- package/src/lib/providers/cli-utils.ts +89 -4
- package/src/lib/providers/cursor-cli.ts +172 -0
- package/src/lib/providers/goose.ts +149 -0
- package/src/lib/providers/index.ts +29 -1
- package/src/lib/providers/qwen-code-cli.ts +152 -0
- package/src/lib/server/agents/agent-availability.ts +2 -2
- package/src/lib/server/agents/agent-thread-session.ts +8 -0
- package/src/lib/server/agents/task-session.ts +8 -0
- package/src/lib/server/capability-router.ts +8 -2
- package/src/lib/server/chat-execution/chat-execution-utils.ts +13 -0
- package/src/lib/server/chat-execution/chat-turn-finalization.ts +8 -0
- package/src/lib/server/chat-execution/chat-turn-preparation.ts +5 -1
- package/src/lib/server/chat-execution/chat-turn-tool-routing.ts +3 -0
- package/src/lib/server/chat-execution/iteration-timers.test.ts +84 -0
- package/src/lib/server/chat-execution/iteration-timers.ts +18 -1
- package/src/lib/server/chat-execution/prompt-sections.ts +3 -1
- package/src/lib/server/chat-execution/stream-agent-chat.ts +5 -0
- package/src/lib/server/chatrooms/chatroom-helpers.ts +13 -0
- package/src/lib/server/chats/chat-session-service.ts +18 -0
- package/src/lib/server/connectors/session.ts +8 -0
- package/src/lib/server/context-manager.ts +5 -0
- package/src/lib/server/provider-health.ts +13 -3
- package/src/lib/server/provider-model-discovery.test.ts +8 -0
- package/src/lib/server/provider-model-discovery.ts +1 -1
- package/src/lib/server/runtime/daemon-state/core.ts +2 -2
- package/src/lib/server/runtime/queue/core.ts +30 -4
- package/src/lib/server/runtime/session-run-manager/enqueue.ts +1 -1
- package/src/lib/server/session-reset-policy.test.ts +16 -0
- package/src/lib/server/session-reset-policy.ts +9 -1
- package/src/lib/server/session-tools/context.ts +2 -2
- package/src/lib/server/session-tools/delegate.ts +334 -14
- package/src/lib/server/session-tools/index.ts +5 -2
- package/src/lib/server/session-tools/session-info.ts +4 -1
- package/src/lib/server/storage-auth-docker.test.ts +244 -0
- package/src/lib/server/storage-auth.test.ts +150 -0
- package/src/lib/server/storage-auth.ts +57 -22
- package/src/lib/server/storage-normalization.ts +19 -0
- package/src/lib/server/storage.ts +3 -0
- package/src/lib/server/tasks/task-resume.ts +23 -1
- package/src/lib/server/tool-aliases.ts +1 -1
- package/src/lib/server/tool-capability-policy.ts +4 -1
- package/src/lib/setup-defaults.test.ts +6 -0
- package/src/lib/setup-defaults.ts +146 -0
- package/src/lib/tool-definitions.ts +1 -1
- package/src/types/misc.ts +4 -1
- package/src/types/provider.ts +1 -1
- package/src/types/session.ts +9 -0
package/README.md
CHANGED
|
@@ -13,48 +13,9 @@ SwarmClaw is a self-hosted AI runtime for OpenClaw and multi-agent work. It help
|
|
|
13
13
|
GitHub: https://github.com/swarmclawai/swarmclaw
|
|
14
14
|
Docs: https://swarmclaw.ai/docs
|
|
15
15
|
Website: https://swarmclaw.ai
|
|
16
|
+
Discord: https://discord.gg/sbEavS8cPV
|
|
16
17
|
Extension tutorial: https://swarmclaw.ai/docs/extension-tutorial
|
|
17
18
|
|
|
18
|
-
## Hosted Deploys
|
|
19
|
-
|
|
20
|
-
SwarmClaw now ships provider-ready deploy files at the repo root:
|
|
21
|
-
|
|
22
|
-
- `render.yaml` for Render Blueprint deploys from the public GHCR image
|
|
23
|
-
- `fly.toml` for Fly.io image-backed deploys
|
|
24
|
-
- `railway.json` for Railway-aligned health and restart defaults
|
|
25
|
-
|
|
26
|
-
The published image is:
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
ghcr.io/swarmclawai/swarmclaw:latest
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Hosted deployments should:
|
|
33
|
-
|
|
34
|
-
- mount persistent storage at `/app/data`
|
|
35
|
-
- manage secrets through the provider dashboard
|
|
36
|
-
- set `ACCESS_KEY` and `CREDENTIAL_SECRET`
|
|
37
|
-
- point health checks at `/api/healthz`
|
|
38
|
-
|
|
39
|
-
Full hosted deployment guides live at https://swarmclaw.ai/docs/deployment
|
|
40
|
-
|
|
41
|
-
## OpenTelemetry OTLP Export
|
|
42
|
-
|
|
43
|
-
SwarmClaw supports opt-in OTLP trace export for chat turns, direct model streams, tool execution, and structured-session runs.
|
|
44
|
-
|
|
45
|
-
Minimal configuration:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
OTEL_ENABLED=true
|
|
49
|
-
OTEL_SERVICE_NAME=swarmclaw
|
|
50
|
-
OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector:4318
|
|
51
|
-
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer your-token
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
If you need a trace-specific endpoint, set `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` directly instead.
|
|
55
|
-
|
|
56
|
-
Operational docs: https://swarmclaw.ai/docs/observability
|
|
57
|
-
|
|
58
19
|
## Screenshots
|
|
59
20
|
|
|
60
21
|
<table>
|
|
@@ -72,7 +33,7 @@ Operational docs: https://swarmclaw.ai/docs/observability
|
|
|
72
33
|
<table>
|
|
73
34
|
<tr>
|
|
74
35
|
<td align="center"><strong>Works<br>with</strong></td>
|
|
75
|
-
|
|
36
|
+
<td align="center"><img src="doc/assets/logos/openclaw.svg" width="32" alt="OpenClaw"><br><sub>OpenClaw</sub></td>
|
|
76
37
|
<td align="center"><img src="public/provider-logos/hermes-agent.png" width="32" alt="Hermes Agent"><br><sub>Hermes</sub></td>
|
|
77
38
|
<td align="center"><img src="doc/assets/logos/claude-code.svg" width="32" alt="Claude Code"><br><sub>Claude Code</sub></td>
|
|
78
39
|
<td align="center"><img src="doc/assets/logos/codex.svg" width="32" alt="Codex"><br><sub>Codex</sub></td>
|
|
@@ -95,6 +56,131 @@ Operational docs: https://swarmclaw.ai/docs/observability
|
|
|
95
56
|
</table>
|
|
96
57
|
</div>
|
|
97
58
|
|
|
59
|
+
## Requirements
|
|
60
|
+
|
|
61
|
+
- Node.js 22.6+ (`nvm use` will pick up the repo's `.nvmrc`, which matches CI)
|
|
62
|
+
- npm 10+ or another supported package manager
|
|
63
|
+
- Docker Desktop is recommended for sandbox browser execution
|
|
64
|
+
- Optional provider CLIs if you want delegated CLI backends such as Claude Code, Codex, OpenCode, or Gemini
|
|
65
|
+
|
|
66
|
+
## Quick Start
|
|
67
|
+
|
|
68
|
+
### Global install
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm i -g @swarmclawai/swarmclaw
|
|
72
|
+
swarmclaw
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
yarn global add @swarmclawai/swarmclaw
|
|
77
|
+
swarmclaw
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pnpm add -g @swarmclawai/swarmclaw
|
|
82
|
+
swarmclaw
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
bun add -g @swarmclawai/swarmclaw
|
|
87
|
+
swarmclaw
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Running `swarmclaw` starts the server on `http://localhost:3456`.
|
|
91
|
+
|
|
92
|
+
### From the repo
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/swarmclawai/swarmclaw.git
|
|
96
|
+
cd swarmclaw
|
|
97
|
+
nvm use
|
|
98
|
+
npm run quickstart
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`npm run quickstart` installs dependencies, prepares local config and runtime state, and starts SwarmClaw.
|
|
102
|
+
|
|
103
|
+
### Docker
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git clone https://github.com/swarmclawai/swarmclaw.git
|
|
107
|
+
cd swarmclaw
|
|
108
|
+
mkdir -p data
|
|
109
|
+
touch .env.local
|
|
110
|
+
docker compose up -d --build
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Then open `http://localhost:3456`.
|
|
114
|
+
|
|
115
|
+
## ClawHub Skill
|
|
116
|
+
|
|
117
|
+
Install the SwarmClaw skill for your [OpenClaw](https://openclaw.ai) agents:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
clawhub install swarmclaw
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
[Browse on ClawHub](https://clawhub.ai/skills/swarmclaw)
|
|
124
|
+
|
|
125
|
+
## Hosted Deploys
|
|
126
|
+
|
|
127
|
+
SwarmClaw now ships provider-ready deploy files at the repo root:
|
|
128
|
+
|
|
129
|
+
- `render.yaml` for Render Blueprint deploys from the public GHCR image
|
|
130
|
+
- `fly.toml` for Fly.io image-backed deploys
|
|
131
|
+
- `railway.json` for Railway-aligned health and restart defaults
|
|
132
|
+
|
|
133
|
+
The published image is:
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
ghcr.io/swarmclawai/swarmclaw:latest
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Hosted deployments should:
|
|
140
|
+
|
|
141
|
+
- mount persistent storage at `/app/data`
|
|
142
|
+
- manage secrets through the provider dashboard
|
|
143
|
+
- set `ACCESS_KEY` and `CREDENTIAL_SECRET`
|
|
144
|
+
- point health checks at `/api/healthz`
|
|
145
|
+
|
|
146
|
+
Full hosted deployment guides live at https://swarmclaw.ai/docs/deployment
|
|
147
|
+
|
|
148
|
+
## Core Capabilities
|
|
149
|
+
|
|
150
|
+
- **Providers**: OpenClaw, OpenAI, OpenRouter, Anthropic, Ollama, Hermes Agent, Google, DeepSeek, Groq, Together, Mistral, xAI, Fireworks, Nebius, DeepInfra, plus compatible custom endpoints.
|
|
151
|
+
- **OpenRouter**: <img src="public/provider-logos/openrouter.png" alt="OpenRouter logo" width="20" height="20" /> Use OpenRouter as a first-class built-in provider with its standard OpenAI-compatible endpoint and routed model IDs such as `openai/gpt-4.1-mini`.
|
|
152
|
+
- **Hermes Agent**: <img src="public/provider-logos/hermes-agent.png" alt="Hermes Agent logo" width="20" height="20" /> Connect Hermes through its OpenAI-compatible API server, locally or through a reachable remote `/v1` endpoint.
|
|
153
|
+
- **Delegation**: built-in delegation to Claude Code, Codex CLI, OpenCode CLI, Gemini CLI, and native SwarmClaw subagents.
|
|
154
|
+
- **Autonomy**: heartbeat loops, schedules, background jobs, task execution, supervisor recovery, and agent wakeups.
|
|
155
|
+
- **Orchestration**: durable structured execution with branching, repeat loops, parallel branches, explicit joins, restart-safe run state, and contextual launch from chats, chatrooms, tasks, schedules, and API flows.
|
|
156
|
+
- **Structured Sessions**: reusable bounded runs with templates, facilitators, participants, hidden live rooms, chatroom `/breakout`, durable transcripts, outputs, operator controls, and a visible protocols template gallery plus visual builder.
|
|
157
|
+
- **Memory**: hybrid recall, graph traversal, journaling, durable documents, project-scoped context, automatic reflection memory, communication preferences, profile and boundary memory, significant events, and open follow-up loops.
|
|
158
|
+
- **Wallets**: linked Base wallet generation, address management, approval-oriented limits, and agent payout identity.
|
|
159
|
+
- **Connectors**: Discord, Slack, Telegram, WhatsApp, Teams, Matrix, OpenClaw, SwarmDock, SwarmFeed, and more.
|
|
160
|
+
- **Extensions**: external tool extensions, UI modules, hooks, and install/update flows.
|
|
161
|
+
|
|
162
|
+
## What SwarmClaw Focuses On
|
|
163
|
+
|
|
164
|
+
- **Delegation, orchestrators, and background execution**: delegated work, orchestrator agents, subagents, durable jobs, checkpointing, and background task execution.
|
|
165
|
+
- **Structured Sessions and orchestration**: temporary bounded runs for one agent or many, launched from context and backed by durable templates, branching, loops, parallel joins, transcripts, outputs, operator controls, and chatroom breakout flows.
|
|
166
|
+
- **Autonomy and memory**: heartbeats, orchestrator wake cycles, schedules, long-running execution, durable memory, reflection memory, human-context learning, document recall, and project-aware context.
|
|
167
|
+
- **OpenClaw integration**: named gateway profiles, external runtimes, deploy helpers, config sync, approval handling, and OpenClaw agent file editing.
|
|
168
|
+
- **Runtime skills**: pinned skills, OpenClaw-compatible `SKILL.md` import, on-demand skill execution, and configurable keyword or embedding-based recommendation.
|
|
169
|
+
- **Conversation-to-skill drafts**: draft a reusable skill from a real chat, review it, then approve it into the skill library.
|
|
170
|
+
- **Crypto wallets**: agent-linked Solana and Ethereum wallets for balances, approvals, signing, simulation, and execution.
|
|
171
|
+
- **Operator tooling**: connectors, extensions, browser automation, shell/files/git tooling, and runtime guardrails.
|
|
172
|
+
|
|
173
|
+
## OpenClaw
|
|
174
|
+
|
|
175
|
+
SwarmClaw is built for OpenClaw operators who need more than one agent or one gateway.
|
|
176
|
+
|
|
177
|
+
- Bundle and use the official `openclaw` CLI directly from SwarmClaw.
|
|
178
|
+
- Connect each SwarmClaw agent to a different OpenClaw gateway profile.
|
|
179
|
+
- Discover, verify, and manage multiple gateways from one control plane.
|
|
180
|
+
- Deploy official-image OpenClaw runtimes locally, via VPS bundles, or over SSH.
|
|
181
|
+
- Edit OpenClaw agent files such as `SOUL.md`, `IDENTITY.md`, `USER.md`, `TOOLS.md`, and `AGENTS.md`.
|
|
182
|
+
- Import OpenClaw `SKILL.md` files and use them in SwarmClaw's runtime skill system.
|
|
183
|
+
|
|
98
184
|
## Use Cases
|
|
99
185
|
|
|
100
186
|
SwarmClaw is a general-purpose agent runtime. Here are some of the ways people use it.
|
|
@@ -230,6 +316,17 @@ These aren't exclusive templates — they're patterns you combine. A virtual com
|
|
|
230
316
|
|
|
231
317
|
The building blocks are the same: **agents, tools, memory, delegation, schedules, connectors, and skills**. SwarmClaw just gives you the control plane to wire them together.
|
|
232
318
|
|
|
319
|
+
## Skill Drafts From Conversations
|
|
320
|
+
|
|
321
|
+
- From any active chat, use **Draft Skill** in the chat header.
|
|
322
|
+
- Or open **Skills** and use **Draft From Current Chat**.
|
|
323
|
+
- New agents keep **Conversation Skill Drafting** enabled by default, and you can switch it off per agent.
|
|
324
|
+
- SwarmClaw turns useful work into a **draft suggestion**, not a live self-modifying skill.
|
|
325
|
+
- Learned skills stay **user/agent scoped** by default. They can harden repeated workflows and self-heal repeated external capability failures, but they do not auto-promote into the shared reviewed skill library.
|
|
326
|
+
- Review the suggested name, rationale, summary, and transcript snippet.
|
|
327
|
+
- Approve it to save it into the normal skill library, or dismiss it.
|
|
328
|
+
- Runtime skill recommendations can use **keyword** or **embedding** ranking from **Settings → Memory & AI → Skills**.
|
|
329
|
+
|
|
233
330
|
## SwarmDock Marketplace
|
|
234
331
|
|
|
235
332
|
SwarmClaw agents can register on [SwarmDock](https://swarmdock.ai) — a peer-to-peer marketplace where autonomous AI agents discover tasks, bid competitively, complete work, and earn USDC payments on Base L2. SwarmDock is the marketplace; SwarmClaw is the control plane.
|
|
@@ -255,6 +352,34 @@ SwarmClaw agents can join [SwarmFeed](https://swarmfeed.ai) — a social network
|
|
|
255
352
|
|
|
256
353
|
Read the docs at [swarmclaw.ai/docs/swarmfeed](https://swarmclaw.ai/docs/swarmfeed) and visit [swarmfeed.ai](https://swarmfeed.ai) for the platform itself.
|
|
257
354
|
|
|
355
|
+
## OpenTelemetry OTLP Export
|
|
356
|
+
|
|
357
|
+
SwarmClaw supports opt-in OTLP trace export for chat turns, direct model streams, tool execution, and structured-session runs.
|
|
358
|
+
|
|
359
|
+
Minimal configuration:
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
OTEL_ENABLED=true
|
|
363
|
+
OTEL_SERVICE_NAME=swarmclaw
|
|
364
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector:4318
|
|
365
|
+
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer your-token
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
If you need a trace-specific endpoint, set `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` directly instead.
|
|
369
|
+
|
|
370
|
+
Operational docs: https://swarmclaw.ai/docs/observability
|
|
371
|
+
|
|
372
|
+
## Releases
|
|
373
|
+
|
|
374
|
+
### v1.5.33 Highlights
|
|
375
|
+
|
|
376
|
+
- **CLI global flag compatibility**: legacy-routed commands now honor the documented `--access-key` and `--base-url` aliases even when they appear after the subcommand, so authenticated CLI automation works the same across binary entry points.
|
|
377
|
+
- **Docker build memory hardening**: production Next.js builds now size `--max-old-space-size` from the detected container/cgroup memory limit, with `SWARMCLAW_BUILD_MAX_OLD_SPACE_SIZE_MB` available as an explicit override for constrained Docker Desktop and CI environments.
|
|
378
|
+
|
|
379
|
+
### v1.5.31 Highlights
|
|
380
|
+
|
|
381
|
+
- **Fix Docker first-run crash**: resolved `EISDIR: illegal operation on a directory, read` error when running `docker compose up` without a pre-existing `.env.local` file. Docker was creating a directory mount instead of a file, which crashed Next.js on startup. Replaced the file bind mount with `env_file` directive using `required: false`.
|
|
382
|
+
|
|
258
383
|
### v1.5.3 Highlights
|
|
259
384
|
|
|
260
385
|
- **Copilot CLI v1.x compatibility**: the `copilot-cli` provider now handles the current event format (`assistant.message_delta`, `assistant.message`, updated `result` payload) while keeping backward compatibility with the legacy format. Also fixes `--resume` flag syntax. (Community contribution by [@borislavnnikolov](https://github.com/borislavnnikolov) -- PR #36)
|
|
@@ -319,116 +444,10 @@ Read the docs at [swarmclaw.ai/docs/swarmfeed](https://swarmclaw.ai/docs/swarmfe
|
|
|
319
444
|
- **Following tab fix**: SwarmFeed Following tab gracefully handles unregistered agents instead of showing a 401 error
|
|
320
445
|
- **Compose removal**: Removed manual compose UI from Feed page — agents post autonomously through their tools
|
|
321
446
|
|
|
322
|
-
## Releases
|
|
323
|
-
|
|
324
447
|
- GitHub releases: https://github.com/swarmclawai/swarmclaw/releases
|
|
325
448
|
- npm package: https://www.npmjs.com/package/@swarmclawai/swarmclaw
|
|
326
449
|
- Historical release notes: https://swarmclaw.ai/docs/release-notes
|
|
327
450
|
|
|
328
|
-
|
|
329
|
-
## What SwarmClaw Focuses On
|
|
330
|
-
|
|
331
|
-
- **Delegation, orchestrators, and background execution**: delegated work, orchestrator agents, subagents, durable jobs, checkpointing, and background task execution.
|
|
332
|
-
- **Structured Sessions and orchestration**: temporary bounded runs for one agent or many, launched from context and backed by durable templates, branching, loops, parallel joins, transcripts, outputs, operator controls, and chatroom breakout flows.
|
|
333
|
-
- **Autonomy and memory**: heartbeats, orchestrator wake cycles, schedules, long-running execution, durable memory, reflection memory, human-context learning, document recall, and project-aware context.
|
|
334
|
-
- **OpenClaw integration**: named gateway profiles, external runtimes, deploy helpers, config sync, approval handling, and OpenClaw agent file editing.
|
|
335
|
-
- **Runtime skills**: pinned skills, OpenClaw-compatible `SKILL.md` import, on-demand skill execution, and configurable keyword or embedding-based recommendation.
|
|
336
|
-
- **Conversation-to-skill drafts**: draft a reusable skill from a real chat, review it, then approve it into the skill library.
|
|
337
|
-
- **Crypto wallets**: agent-linked Solana and Ethereum wallets for balances, approvals, signing, simulation, and execution.
|
|
338
|
-
- **Operator tooling**: connectors, extensions, browser automation, shell/files/git tooling, and runtime guardrails.
|
|
339
|
-
|
|
340
|
-
## OpenClaw
|
|
341
|
-
|
|
342
|
-
SwarmClaw is built for OpenClaw operators who need more than one agent or one gateway.
|
|
343
|
-
|
|
344
|
-
- Bundle and use the official `openclaw` CLI directly from SwarmClaw.
|
|
345
|
-
- Connect each SwarmClaw agent to a different OpenClaw gateway profile.
|
|
346
|
-
- Discover, verify, and manage multiple gateways from one control plane.
|
|
347
|
-
- Deploy official-image OpenClaw runtimes locally, via VPS bundles, or over SSH.
|
|
348
|
-
- Edit OpenClaw agent files such as `SOUL.md`, `IDENTITY.md`, `USER.md`, `TOOLS.md`, and `AGENTS.md`.
|
|
349
|
-
- Import OpenClaw `SKILL.md` files and use them in SwarmClaw’s runtime skill system.
|
|
350
|
-
|
|
351
|
-
## Quick Start
|
|
352
|
-
|
|
353
|
-
### Global install
|
|
354
|
-
|
|
355
|
-
```bash
|
|
356
|
-
npm i -g @swarmclawai/swarmclaw
|
|
357
|
-
swarmclaw
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
yarn global add @swarmclawai/swarmclaw
|
|
362
|
-
swarmclaw
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
```bash
|
|
366
|
-
pnpm add -g @swarmclawai/swarmclaw
|
|
367
|
-
swarmclaw
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
```bash
|
|
371
|
-
bun add -g @swarmclawai/swarmclaw
|
|
372
|
-
swarmclaw
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
Running `swarmclaw` starts the server on `http://localhost:3456`.
|
|
376
|
-
|
|
377
|
-
### From the repo
|
|
378
|
-
|
|
379
|
-
```bash
|
|
380
|
-
git clone https://github.com/swarmclawai/swarmclaw.git
|
|
381
|
-
cd swarmclaw
|
|
382
|
-
nvm use
|
|
383
|
-
npm run quickstart
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
`npm run quickstart` installs dependencies, prepares local config and runtime state, and starts SwarmClaw.
|
|
387
|
-
|
|
388
|
-
### Docker
|
|
389
|
-
|
|
390
|
-
```bash
|
|
391
|
-
git clone https://github.com/swarmclawai/swarmclaw.git
|
|
392
|
-
cd swarmclaw
|
|
393
|
-
mkdir -p data
|
|
394
|
-
touch .env.local
|
|
395
|
-
docker compose up -d --build
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
Then open `http://localhost:3456`.
|
|
399
|
-
|
|
400
|
-
## Skill Drafts From Conversations
|
|
401
|
-
|
|
402
|
-
- From any active chat, use **Draft Skill** in the chat header.
|
|
403
|
-
- Or open **Skills** and use **Draft From Current Chat**.
|
|
404
|
-
- New agents keep **Conversation Skill Drafting** enabled by default, and you can switch it off per agent.
|
|
405
|
-
- SwarmClaw turns useful work into a **draft suggestion**, not a live self-modifying skill.
|
|
406
|
-
- Learned skills stay **user/agent scoped** by default. They can harden repeated workflows and self-heal repeated external capability failures, but they do not auto-promote into the shared reviewed skill library.
|
|
407
|
-
- Review the suggested name, rationale, summary, and transcript snippet.
|
|
408
|
-
- Approve it to save it into the normal skill library, or dismiss it.
|
|
409
|
-
- Runtime skill recommendations can use **keyword** or **embedding** ranking from **Settings → Memory & AI → Skills**.
|
|
410
|
-
|
|
411
|
-
## Core Capabilities
|
|
412
|
-
|
|
413
|
-
- **Providers**: OpenClaw, OpenAI, OpenRouter, Anthropic, Ollama, Hermes Agent, Google, DeepSeek, Groq, Together, Mistral, xAI, Fireworks, Nebius, DeepInfra, plus compatible custom endpoints.
|
|
414
|
-
- **OpenRouter**: <img src="public/provider-logos/openrouter.png" alt="OpenRouter logo" width="20" height="20" /> Use OpenRouter as a first-class built-in provider with its standard OpenAI-compatible endpoint and routed model IDs such as `openai/gpt-4.1-mini`.
|
|
415
|
-
- **Hermes Agent**: <img src="public/provider-logos/hermes-agent.png" alt="Hermes Agent logo" width="20" height="20" /> Connect Hermes through its OpenAI-compatible API server, locally or through a reachable remote `/v1` endpoint.
|
|
416
|
-
- **Delegation**: built-in delegation to Claude Code, Codex CLI, OpenCode CLI, Gemini CLI, and native SwarmClaw subagents.
|
|
417
|
-
- **Autonomy**: heartbeat loops, schedules, background jobs, task execution, supervisor recovery, and agent wakeups.
|
|
418
|
-
- **Orchestration**: durable structured execution with branching, repeat loops, parallel branches, explicit joins, restart-safe run state, and contextual launch from chats, chatrooms, tasks, schedules, and API flows.
|
|
419
|
-
- **Structured Sessions**: reusable bounded runs with templates, facilitators, participants, hidden live rooms, chatroom `/breakout`, durable transcripts, outputs, operator controls, and a visible protocols template gallery plus visual builder.
|
|
420
|
-
- **Memory**: hybrid recall, graph traversal, journaling, durable documents, project-scoped context, automatic reflection memory, communication preferences, profile and boundary memory, significant events, and open follow-up loops.
|
|
421
|
-
- **Wallets**: linked Base wallet generation, address management, approval-oriented limits, and agent payout identity.
|
|
422
|
-
- **Connectors**: Discord, Slack, Telegram, WhatsApp, Teams, Matrix, OpenClaw, SwarmDock, SwarmFeed, and more.
|
|
423
|
-
- **Extensions**: external tool extensions, UI modules, hooks, and install/update flows.
|
|
424
|
-
|
|
425
|
-
## Requirements
|
|
426
|
-
|
|
427
|
-
- Node.js 22.6+ (`nvm use` will pick up the repo's `.nvmrc`, which matches CI)
|
|
428
|
-
- npm 10+ or another supported package manager
|
|
429
|
-
- Docker Desktop is recommended for sandbox browser execution
|
|
430
|
-
- Optional provider CLIs if you want delegated CLI backends such as Claude Code, Codex, OpenCode, or Gemini
|
|
431
|
-
|
|
432
451
|
## Security Notes
|
|
433
452
|
|
|
434
453
|
- First run creates an access key; keep it private.
|
|
@@ -446,5 +465,6 @@ Then open `http://localhost:3456`.
|
|
|
446
465
|
- SwarmDock marketplace: https://swarmdock.ai
|
|
447
466
|
- SwarmFeed: https://swarmclaw.ai/docs/swarmfeed
|
|
448
467
|
- SwarmFeed platform: https://swarmfeed.ai
|
|
468
|
+
- SwarmVault: https://swarmvault.ai
|
|
449
469
|
- Extensions: https://swarmclaw.ai/docs/extensions
|
|
450
470
|
- CLI reference: https://swarmclaw.ai/docs/cli
|
package/bin/swarmclaw.js
CHANGED
|
@@ -19,6 +19,11 @@ const TS_CLI_ACTIONS = Object.freeze({
|
|
|
19
19
|
webhooks: new Set(['list', 'get', 'create', 'update', 'delete', 'trigger']),
|
|
20
20
|
})
|
|
21
21
|
|
|
22
|
+
const LEGACY_TS_CLI_ALIAS_MAP = Object.freeze({
|
|
23
|
+
'--base-url': '--url',
|
|
24
|
+
'--access-key': '--key',
|
|
25
|
+
})
|
|
26
|
+
|
|
22
27
|
function shouldUseLegacyTsCli(argv) {
|
|
23
28
|
const group = argv[0]
|
|
24
29
|
const action = argv[1]
|
|
@@ -62,9 +67,37 @@ function buildLegacyTsCliArgs(cliPath, argv, options = {}) {
|
|
|
62
67
|
return null
|
|
63
68
|
}
|
|
64
69
|
|
|
70
|
+
function normalizeLegacyTsCliArgv(argv) {
|
|
71
|
+
const normalized = []
|
|
72
|
+
|
|
73
|
+
for (const token of argv) {
|
|
74
|
+
if (!token.startsWith('--')) {
|
|
75
|
+
normalized.push(token)
|
|
76
|
+
continue
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const eqIndex = token.indexOf('=')
|
|
80
|
+
const flag = eqIndex > -1 ? token.slice(0, eqIndex) : token
|
|
81
|
+
const mappedFlag = LEGACY_TS_CLI_ALIAS_MAP[flag]
|
|
82
|
+
|
|
83
|
+
if (!mappedFlag) {
|
|
84
|
+
normalized.push(token)
|
|
85
|
+
continue
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (eqIndex > -1) {
|
|
89
|
+
normalized.push(`${mappedFlag}=${token.slice(eqIndex + 1)}`)
|
|
90
|
+
} else {
|
|
91
|
+
normalized.push(mappedFlag)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return normalized
|
|
96
|
+
}
|
|
97
|
+
|
|
65
98
|
function runLegacyTsCli(argv) {
|
|
66
99
|
const cliPath = path.join(__dirname, '..', 'src', 'cli', 'index.ts')
|
|
67
|
-
const args = buildLegacyTsCliArgs(cliPath, argv)
|
|
100
|
+
const args = buildLegacyTsCliArgs(cliPath, normalizeLegacyTsCliArgv(argv))
|
|
68
101
|
const env = normalizeLegacyCliEnv(process.env)
|
|
69
102
|
if (!args) {
|
|
70
103
|
process.stderr.write('Legacy CLI commands require Node 22.6+ or an available local tsx runtime.\n')
|
|
@@ -237,6 +270,7 @@ if (require.main === module) {
|
|
|
237
270
|
module.exports = {
|
|
238
271
|
buildLegacyTsCliArgs,
|
|
239
272
|
hasTsxRuntime,
|
|
273
|
+
normalizeLegacyTsCliArgv,
|
|
240
274
|
TS_CLI_ACTIONS,
|
|
241
275
|
normalizeLegacyCliEnv,
|
|
242
276
|
printPackageVersion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmclawai/swarmclaw",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.33",
|
|
4
4
|
"description": "Build and run autonomous AI agents with OpenClaw, Hermes, multiple model providers, orchestration, delegation, memory, skills, schedules, and chat connectors.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"lint:baseline:update": "node ./scripts/lint-baseline.mjs update",
|
|
73
73
|
"cli": "node ./bin/swarmclaw.js",
|
|
74
74
|
"test:cli": "node --test src/cli/*.test.js bin/*.test.js scripts/postinstall.test.mjs scripts/run-next-build.test.mjs scripts/run-next-typegen.test.mjs",
|
|
75
|
-
"test:setup": "tsx --test src/app/api/setup/check-provider/route.test.ts src/lib/server/provider-model-discovery.test.ts src/components/auth/setup-wizard/utils.test.ts src/components/auth/setup-wizard/types.test.ts src/hooks/setup-done-detection.test.ts src/lib/setup-defaults.test.ts",
|
|
75
|
+
"test:setup": "tsx --test src/app/api/setup/check-provider/route.test.ts src/lib/server/provider-model-discovery.test.ts src/components/auth/setup-wizard/utils.test.ts src/components/auth/setup-wizard/types.test.ts src/hooks/setup-done-detection.test.ts src/lib/setup-defaults.test.ts src/lib/server/storage-auth.test.ts src/lib/server/storage-auth-docker.test.ts",
|
|
76
76
|
"test:openclaw": "tsx --test src/lib/openclaw/openclaw-agent-id.test.ts src/lib/openclaw/openclaw-endpoint.test.ts src/lib/server/agents/agent-runtime-config.test.ts src/lib/server/build-llm.test.ts src/lib/server/connectors/connector-routing.test.ts src/lib/server/connectors/openclaw.test.ts src/lib/server/connectors/swarmdock.test.ts src/lib/server/gateway/protocol.test.ts src/lib/server/llm-response-cache.test.ts src/lib/server/mcp-conformance.test.ts src/lib/server/openclaw/agent-resolver.test.ts src/lib/server/openclaw/deploy.test.ts src/lib/server/openclaw/skills-normalize.test.ts src/lib/server/session-tools/openclaw-nodes.test.ts src/lib/server/session-tools/swarmdock.test.ts src/lib/server/tasks/task-quality-gate.test.ts src/lib/server/tasks/task-validation.test.ts src/lib/server/tool-capability-policy.test.ts src/lib/providers/openclaw-exports.test.ts src/app/api/openclaw/dashboard-url/route.test.ts",
|
|
77
77
|
"test:runtime": "tsx --test src/lib/server/knowledge-sources.test.ts src/lib/server/chat-execution/chat-execution-grounding.test.ts src/lib/server/protocols/protocol-service.test.ts src/lib/server/runtime/run-ledger.test.ts src/lib/server/observability/otel-config.test.ts src/lib/server/safe-parse-body.test.ts src/app/api/approvals/route.test.ts src/app/api/chats/chat-route.test.ts src/app/api/connectors/connector-doctor-route.test.ts src/app/api/healthz/route.test.ts src/app/api/logs/route.test.ts src/app/api/tts/route.test.ts",
|
|
78
78
|
"test:builder": "tsx --test src/features/protocols/builder/utils/nodes-to-template.test.ts src/features/protocols/builder/utils/template-to-nodes.test.ts src/features/protocols/builder/validators/dag-validator.test.ts",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import fs from 'node:fs'
|
|
4
|
+
import os from 'node:os'
|
|
4
5
|
import path from 'node:path'
|
|
5
6
|
import { spawnSync } from 'node:child_process'
|
|
6
7
|
import { createRequire } from 'node:module'
|
|
@@ -11,6 +12,17 @@ import { ensureBuildBootstrapPaths } from './build-bootstrap-env.mjs'
|
|
|
11
12
|
const require = createRequire(import.meta.url)
|
|
12
13
|
|
|
13
14
|
export const DEFAULT_MAX_OLD_SPACE_SIZE_MB = '8192'
|
|
15
|
+
export const MIN_MAX_OLD_SPACE_SIZE_MB = 1024
|
|
16
|
+
export const FALLBACK_MIN_MAX_OLD_SPACE_SIZE_MB = 512
|
|
17
|
+
export const RESERVED_BUILD_MEMORY_MB = 768
|
|
18
|
+
export const MAX_OLD_SPACE_RATIO = 0.75
|
|
19
|
+
export const LOW_MEMORY_RATIO = 0.6
|
|
20
|
+
export const BUILD_MAX_OLD_SPACE_SIZE_ENV = 'SWARMCLAW_BUILD_MAX_OLD_SPACE_SIZE_MB'
|
|
21
|
+
export const CGROUP_MEMORY_LIMIT_PATHS = [
|
|
22
|
+
'/sys/fs/cgroup/memory.max',
|
|
23
|
+
'/sys/fs/cgroup/memory/memory.limit_in_bytes',
|
|
24
|
+
]
|
|
25
|
+
export const UNBOUNDED_MEMORY_LIMIT_BYTES = 1n << 60n
|
|
14
26
|
export const TRACE_COPY_WARNING = 'Failed to copy traced files'
|
|
15
27
|
export const NEXT_STANDALONE_METADATA_RELATIVE_DIR = path.join(
|
|
16
28
|
'node_modules',
|
|
@@ -24,6 +36,74 @@ export const REQUIRED_NEXT_METADATA_FILES = [
|
|
|
24
36
|
'is-metadata-route.js',
|
|
25
37
|
]
|
|
26
38
|
|
|
39
|
+
function parsePositiveInteger(value) {
|
|
40
|
+
const parsed = Number.parseInt(String(value ?? '').trim(), 10)
|
|
41
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function readCgroupMemoryLimitBytes(
|
|
45
|
+
paths = CGROUP_MEMORY_LIMIT_PATHS,
|
|
46
|
+
existsSync = fs.existsSync,
|
|
47
|
+
readFileSync = fs.readFileSync,
|
|
48
|
+
) {
|
|
49
|
+
for (const filePath of paths) {
|
|
50
|
+
if (!existsSync(filePath)) continue
|
|
51
|
+
|
|
52
|
+
let raw = ''
|
|
53
|
+
try {
|
|
54
|
+
raw = String(readFileSync(filePath, 'utf8')).trim()
|
|
55
|
+
} catch {
|
|
56
|
+
continue
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!raw || raw === 'max') continue
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
const bytes = BigInt(raw)
|
|
63
|
+
if (bytes <= 0n || bytes >= UNBOUNDED_MEMORY_LIMIT_BYTES) continue
|
|
64
|
+
return Number(bytes)
|
|
65
|
+
} catch {
|
|
66
|
+
continue
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function deriveMaxOldSpaceSizeMb(memoryLimitBytes, defaultMaxOldSpaceSizeMb = DEFAULT_MAX_OLD_SPACE_SIZE_MB) {
|
|
74
|
+
const defaultMb = parsePositiveInteger(defaultMaxOldSpaceSizeMb) ?? Number.parseInt(DEFAULT_MAX_OLD_SPACE_SIZE_MB, 10)
|
|
75
|
+
const limitMb = Math.floor(Number(memoryLimitBytes) / (1024 * 1024))
|
|
76
|
+
if (!Number.isFinite(limitMb) || limitMb <= 0) return String(defaultMb)
|
|
77
|
+
|
|
78
|
+
const constrainedCandidate = Math.min(
|
|
79
|
+
defaultMb,
|
|
80
|
+
limitMb - RESERVED_BUILD_MEMORY_MB,
|
|
81
|
+
Math.floor(limitMb * MAX_OLD_SPACE_RATIO),
|
|
82
|
+
)
|
|
83
|
+
if (constrainedCandidate >= MIN_MAX_OLD_SPACE_SIZE_MB) {
|
|
84
|
+
return String(constrainedCandidate)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return String(Math.max(
|
|
88
|
+
FALLBACK_MIN_MAX_OLD_SPACE_SIZE_MB,
|
|
89
|
+
Math.min(defaultMb, Math.floor(limitMb * LOW_MEMORY_RATIO)),
|
|
90
|
+
))
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function resolveNextBuildMaxOldSpaceSizeMb(
|
|
94
|
+
env = process.env,
|
|
95
|
+
options = {},
|
|
96
|
+
) {
|
|
97
|
+
const explicit = parsePositiveInteger(env[BUILD_MAX_OLD_SPACE_SIZE_ENV])
|
|
98
|
+
if (explicit) return String(explicit)
|
|
99
|
+
|
|
100
|
+
const readLimitBytes = options.readCgroupMemoryLimitBytes ?? readCgroupMemoryLimitBytes
|
|
101
|
+
const totalMemFn = options.totalMem ?? os.totalmem
|
|
102
|
+
const memoryLimitBytes = readLimitBytes() ?? totalMemFn()
|
|
103
|
+
|
|
104
|
+
return deriveMaxOldSpaceSizeMb(memoryLimitBytes, DEFAULT_MAX_OLD_SPACE_SIZE_MB)
|
|
105
|
+
}
|
|
106
|
+
|
|
27
107
|
export function mergeNodeOptions(nodeOptions = '', maxOldSpaceSizeMb = DEFAULT_MAX_OLD_SPACE_SIZE_MB) {
|
|
28
108
|
const trimmed = nodeOptions.trim()
|
|
29
109
|
if (/(^|\s)--max-old-space-size(?:=|\s|$)/.test(trimmed)) return trimmed
|
|
@@ -120,12 +200,17 @@ export function repairStandaloneNextMetadata(cwd = process.cwd()) {
|
|
|
120
200
|
return true
|
|
121
201
|
}
|
|
122
202
|
|
|
123
|
-
export function runNextBuild(
|
|
203
|
+
export function runNextBuild(
|
|
204
|
+
args = process.argv.slice(2),
|
|
205
|
+
env = process.env,
|
|
206
|
+
cwd = process.cwd(),
|
|
207
|
+
maxOldSpaceSizeMb = resolveNextBuildMaxOldSpaceSizeMb(env),
|
|
208
|
+
) {
|
|
124
209
|
const nextBin = require.resolve('next/dist/bin/next')
|
|
125
210
|
return spawnSync(process.execPath, [nextBin, 'build', '--webpack', ...args], {
|
|
126
211
|
stdio: 'pipe',
|
|
127
212
|
encoding: 'utf-8',
|
|
128
|
-
env: buildNextBuildEnv(env,
|
|
213
|
+
env: buildNextBuildEnv(env, maxOldSpaceSizeMb, cwd),
|
|
129
214
|
cwd,
|
|
130
215
|
})
|
|
131
216
|
}
|