@swarmclawai/swarmclaw 0.5.2 → 0.6.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/README.md +42 -7
- package/bin/swarmclaw.js +76 -16
- package/next.config.ts +11 -1
- package/package.json +4 -2
- package/public/screenshots/agents.png +0 -0
- package/public/screenshots/dashboard.png +0 -0
- package/public/screenshots/providers.png +0 -0
- package/public/screenshots/tasks.png +0 -0
- package/scripts/postinstall.mjs +18 -0
- package/src/app/api/chatrooms/[id]/chat/route.ts +410 -0
- package/src/app/api/chatrooms/[id]/members/route.ts +82 -0
- package/src/app/api/chatrooms/[id]/pins/route.ts +39 -0
- package/src/app/api/chatrooms/[id]/reactions/route.ts +42 -0
- package/src/app/api/chatrooms/[id]/route.ts +84 -0
- package/src/app/api/chatrooms/route.ts +50 -0
- package/src/app/api/credentials/route.ts +2 -3
- package/src/app/api/knowledge/[id]/route.ts +13 -2
- package/src/app/api/knowledge/route.ts +8 -1
- package/src/app/api/memory/route.ts +8 -0
- package/src/app/api/notifications/[id]/route.ts +27 -0
- package/src/app/api/notifications/route.ts +68 -0
- package/src/app/api/orchestrator/run/route.ts +1 -1
- package/src/app/api/plugins/install/route.ts +2 -2
- package/src/app/api/search/route.ts +155 -0
- package/src/app/api/sessions/[id]/chat/route.ts +2 -0
- package/src/app/api/sessions/[id]/edit-resend/route.ts +1 -1
- package/src/app/api/sessions/[id]/fork/route.ts +1 -1
- package/src/app/api/sessions/route.ts +3 -3
- package/src/app/api/settings/route.ts +9 -0
- package/src/app/api/setup/check-provider/route.ts +3 -16
- package/src/app/api/skills/[id]/route.ts +6 -0
- package/src/app/api/skills/route.ts +6 -0
- package/src/app/api/tasks/[id]/route.ts +20 -0
- package/src/app/api/tasks/bulk/route.ts +100 -0
- package/src/app/api/tasks/route.ts +1 -0
- package/src/app/api/usage/route.ts +45 -0
- package/src/app/api/webhooks/[id]/route.ts +15 -1
- package/src/app/globals.css +58 -15
- package/src/app/page.tsx +142 -13
- package/src/cli/index.js +42 -0
- package/src/cli/index.test.js +30 -0
- package/src/cli/spec.js +32 -0
- package/src/components/agents/agent-avatar.tsx +57 -10
- package/src/components/agents/agent-card.tsx +48 -15
- package/src/components/agents/agent-chat-list.tsx +123 -10
- package/src/components/agents/agent-list.tsx +50 -19
- package/src/components/agents/agent-sheet.tsx +56 -63
- package/src/components/auth/access-key-gate.tsx +10 -3
- package/src/components/auth/setup-wizard.tsx +2 -2
- package/src/components/auth/user-picker.tsx +31 -3
- package/src/components/chat/activity-moment.tsx +169 -0
- package/src/components/chat/chat-header.tsx +2 -0
- package/src/components/chat/chat-tool-toggles.tsx +1 -1
- package/src/components/chat/file-path-chip.tsx +125 -0
- package/src/components/chat/markdown-utils.ts +9 -0
- package/src/components/chat/message-bubble.tsx +46 -295
- package/src/components/chat/message-list.tsx +50 -1
- package/src/components/chat/streaming-bubble.tsx +36 -46
- package/src/components/chat/suggestions-bar.tsx +1 -1
- package/src/components/chat/thinking-indicator.tsx +72 -10
- package/src/components/chat/tool-call-bubble.tsx +66 -70
- package/src/components/chat/tool-request-banner.tsx +31 -7
- package/src/components/chat/transfer-agent-picker.tsx +63 -0
- package/src/components/chatrooms/agent-hover-card.tsx +124 -0
- package/src/components/chatrooms/chatroom-input.tsx +320 -0
- package/src/components/chatrooms/chatroom-list.tsx +123 -0
- package/src/components/chatrooms/chatroom-message.tsx +427 -0
- package/src/components/chatrooms/chatroom-sheet.tsx +215 -0
- package/src/components/chatrooms/chatroom-tool-request-banner.tsx +134 -0
- package/src/components/chatrooms/chatroom-typing-bar.tsx +88 -0
- package/src/components/chatrooms/chatroom-view.tsx +344 -0
- package/src/components/chatrooms/reaction-picker.tsx +273 -0
- package/src/components/connectors/connector-sheet.tsx +34 -47
- package/src/components/home/home-view.tsx +501 -0
- package/src/components/input/chat-input.tsx +79 -41
- package/src/components/knowledge/knowledge-list.tsx +31 -1
- package/src/components/knowledge/knowledge-sheet.tsx +83 -2
- package/src/components/layout/app-layout.tsx +209 -83
- package/src/components/layout/mobile-header.tsx +2 -0
- package/src/components/layout/update-banner.tsx +2 -2
- package/src/components/logs/log-list.tsx +2 -2
- package/src/components/mcp-servers/mcp-server-sheet.tsx +1 -1
- package/src/components/memory/memory-agent-list.tsx +143 -0
- package/src/components/memory/memory-browser.tsx +205 -0
- package/src/components/memory/memory-card.tsx +34 -7
- package/src/components/memory/memory-detail.tsx +359 -120
- package/src/components/memory/memory-sheet.tsx +157 -23
- package/src/components/plugins/plugin-list.tsx +1 -1
- package/src/components/plugins/plugin-sheet.tsx +1 -1
- package/src/components/projects/project-detail.tsx +509 -0
- package/src/components/projects/project-list.tsx +195 -59
- package/src/components/providers/provider-list.tsx +2 -2
- package/src/components/providers/provider-sheet.tsx +3 -3
- package/src/components/schedules/schedule-card.tsx +3 -2
- package/src/components/schedules/schedule-list.tsx +1 -1
- package/src/components/schedules/schedule-sheet.tsx +25 -25
- package/src/components/secrets/secret-sheet.tsx +47 -24
- package/src/components/secrets/secrets-list.tsx +18 -8
- package/src/components/sessions/new-session-sheet.tsx +33 -65
- package/src/components/sessions/session-card.tsx +45 -14
- package/src/components/sessions/session-list.tsx +35 -18
- package/src/components/shared/agent-picker-list.tsx +90 -0
- package/src/components/shared/agent-switch-dialog.tsx +156 -0
- package/src/components/shared/attachment-chip.tsx +165 -0
- package/src/components/shared/avatar.tsx +10 -1
- package/src/components/shared/check-icon.tsx +12 -0
- package/src/components/shared/confirm-dialog.tsx +1 -1
- package/src/components/shared/empty-state.tsx +32 -0
- package/src/components/shared/file-preview.tsx +34 -0
- package/src/components/shared/form-styles.ts +2 -0
- package/src/components/shared/keyboard-shortcuts-dialog.tsx +116 -0
- package/src/components/shared/notification-center.tsx +223 -0
- package/src/components/shared/profile-sheet.tsx +115 -0
- package/src/components/shared/reply-quote.tsx +26 -0
- package/src/components/shared/search-dialog.tsx +296 -0
- package/src/components/shared/section-label.tsx +12 -0
- package/src/components/shared/settings/plugin-manager.tsx +1 -1
- package/src/components/shared/settings/section-providers.tsx +1 -1
- package/src/components/shared/settings/section-secrets.tsx +1 -1
- package/src/components/shared/settings/section-theme.tsx +95 -0
- package/src/components/shared/settings/section-user-preferences.tsx +39 -0
- package/src/components/shared/settings/settings-page.tsx +180 -27
- package/src/components/shared/settings/settings-sheet.tsx +9 -73
- package/src/components/shared/sheet-footer.tsx +33 -0
- package/src/components/skills/skill-list.tsx +61 -30
- package/src/components/skills/skill-sheet.tsx +81 -2
- package/src/components/tasks/task-board.tsx +448 -26
- package/src/components/tasks/task-card.tsx +46 -9
- package/src/components/tasks/task-column.tsx +62 -3
- package/src/components/tasks/task-list.tsx +12 -4
- package/src/components/tasks/task-sheet.tsx +89 -72
- package/src/components/ui/hover-card.tsx +52 -0
- package/src/components/usage/metrics-dashboard.tsx +78 -0
- package/src/components/usage/usage-list.tsx +1 -1
- package/src/components/webhooks/webhook-sheet.tsx +1 -1
- package/src/hooks/use-view-router.ts +69 -19
- package/src/instrumentation.ts +15 -1
- package/src/lib/chat.ts +2 -0
- package/src/lib/cron-human.ts +114 -0
- package/src/lib/memory.ts +3 -0
- package/src/lib/server/chat-execution.ts +24 -4
- package/src/lib/server/connectors/manager.ts +11 -0
- package/src/lib/server/context-manager.ts +225 -13
- package/src/lib/server/create-notification.ts +42 -0
- package/src/lib/server/daemon-state.ts +165 -10
- package/src/lib/server/execution-log.ts +1 -0
- package/src/lib/server/heartbeat-service.ts +40 -5
- package/src/lib/server/heartbeat-wake.ts +110 -0
- package/src/lib/server/langgraph-checkpoint.ts +1 -0
- package/src/lib/server/memory-consolidation.ts +92 -0
- package/src/lib/server/memory-db.ts +51 -6
- package/src/lib/server/openclaw-gateway.ts +9 -1
- package/src/lib/server/provider-health.ts +125 -0
- package/src/lib/server/queue.ts +5 -4
- package/src/lib/server/scheduler.ts +8 -0
- package/src/lib/server/session-run-manager.ts +4 -0
- package/src/lib/server/session-tools/chatroom.ts +136 -0
- package/src/lib/server/session-tools/context-mgmt.ts +36 -18
- package/src/lib/server/session-tools/index.ts +2 -0
- package/src/lib/server/session-tools/memory.ts +6 -1
- package/src/lib/server/storage.ts +80 -29
- package/src/lib/server/stream-agent-chat.ts +153 -47
- package/src/lib/server/system-events.ts +49 -0
- package/src/lib/server/ws-hub.ts +11 -0
- package/src/lib/soul-suggestions.ts +109 -0
- package/src/lib/tasks.ts +4 -1
- package/src/lib/view-routes.ts +36 -1
- package/src/lib/ws-client.ts +14 -4
- package/src/proxy.ts +79 -2
- package/src/stores/use-app-store.ts +94 -3
- package/src/stores/use-chat-store.ts +48 -3
- package/src/stores/use-chatroom-store.ts +276 -0
- package/src/types/index.ts +69 -2
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@ Inspired by [OpenClaw](https://github.com/openclaw).
|
|
|
20
20
|
- Always use the access key authentication (generated on first run)
|
|
21
21
|
- Never expose port 3456 without a reverse proxy + TLS
|
|
22
22
|
- Review agent system prompts before giving them shell or browser tools
|
|
23
|
+
- Repeated failed access key attempts are rate-limited to slow brute-force attacks
|
|
23
24
|
|
|
24
25
|
## Features
|
|
25
26
|
|
|
@@ -39,7 +40,10 @@ Inspired by [OpenClaw](https://github.com/openclaw).
|
|
|
39
40
|
- **Loop Runtime Controls** — Switch between bounded and ongoing loops with configurable step caps, runtime guards, heartbeat cadence, and timeout budgets
|
|
40
41
|
- **Session Run Queue** — Per-session queued runs with followup/steer/collect modes, collect coalescing for bursty inputs, and run-state APIs
|
|
41
42
|
- **Chat Iteration Workflow** — Edit-and-resend user turns, fork a new session from any message, bookmark key messages, use contextual follow-up suggestion chips, and auto-continue after tool access grants
|
|
43
|
+
- **Agent Chatrooms** — Multi-agent room conversations with `@mention` routing, chained agent replies, reactions, and file/image-aware chat context
|
|
42
44
|
- **Live Chat Telemetry** — Thinking/tool/responding stream phases, live main-loop status badges, connector activity presence, tone indicator, and optional sound notifications
|
|
45
|
+
- **Global Search Palette** — `Cmd/Ctrl+K` search across agents, tasks, sessions, schedules, webhooks, and skills from anywhere in the app
|
|
46
|
+
- **Notification Center** — Real-time in-app notifications for task/schedule/daemon events with unread tracking, mark-all/clear-read controls, and optional action links
|
|
43
47
|
- **Preview-Rich Chat UI** — Side preview panel for tool outputs (image/browser/html/code), inline code/PDF previews for attachments, and image lightbox support
|
|
44
48
|
- **Voice Settings** — Per-instance ElevenLabs API key + voice ID for TTS replies, plus configurable speech recognition language for chat input
|
|
45
49
|
- **Chat Connectors** — Bridge agents to Discord, Slack, Telegram, WhatsApp, BlueBubbles (iMessage), Signal, Microsoft Teams, Google Chat, Matrix, and OpenClaw with media-aware inbound handling
|
|
@@ -48,6 +52,7 @@ Inspired by [OpenClaw](https://github.com/openclaw).
|
|
|
48
52
|
- **Context Management** — Auto-compaction of conversation history when approaching context limits, with manual `context_status` and `context_summarize` tools for agents
|
|
49
53
|
- **Memory** — Per-agent and per-session memory with hybrid FTS5 + vector embeddings search, relevance-based memory recall injected into runs, and periodic auto-journaling for durable execution context
|
|
50
54
|
- **Cost Tracking** — Per-message token counting and cost estimation displayed in the chat header
|
|
55
|
+
- **Provider Health Metrics** — Usage dashboard surfaces provider request volume, success rates, models used, and last-used timestamps
|
|
51
56
|
- **Model Failover** — Automatic key rotation on rate limits and auth errors with configurable fallback credentials
|
|
52
57
|
- **Plugin System** — Extend agent behavior with JS plugins (hooks: beforeAgentStart, afterAgentComplete, beforeToolExec, afterToolExec, onMessage)
|
|
53
58
|
- **Secrets Vault** — Encrypted storage for API keys and service tokens
|
|
@@ -81,7 +86,7 @@ curl -fsSL https://raw.githubusercontent.com/swarmclawai/swarmclaw/main/install.
|
|
|
81
86
|
```
|
|
82
87
|
|
|
83
88
|
The installer resolves the latest stable release tag and installs that version by default.
|
|
84
|
-
To pin a version: `SWARMCLAW_VERSION=v0.
|
|
89
|
+
To pin a version: `SWARMCLAW_VERSION=v0.6.0 curl ... | bash`
|
|
85
90
|
|
|
86
91
|
Or run locally from the repo (friendly for non-technical users):
|
|
87
92
|
|
|
@@ -97,6 +102,8 @@ npm run quickstart
|
|
|
97
102
|
- Prepare `.env.local` and `data/`
|
|
98
103
|
- Start the app at `http://localhost:3456`
|
|
99
104
|
|
|
105
|
+
`postinstall` rebuilds `better-sqlite3` natively. If you install with `--ignore-scripts`, run `npm rebuild better-sqlite3` manually.
|
|
106
|
+
|
|
100
107
|
On first launch, SwarmClaw will:
|
|
101
108
|
1. Generate an **access key** and display it in the terminal
|
|
102
109
|
2. Save it to `.env.local`
|
|
@@ -161,8 +168,10 @@ src/
|
|
|
161
168
|
│ ├── agents/ # Agent builder UI
|
|
162
169
|
│ ├── auth/ # Access key gate + user picker
|
|
163
170
|
│ ├── chat/ # Message rendering, streaming, code blocks
|
|
171
|
+
│ ├── chatrooms/ # Multi-agent chatroom UI
|
|
164
172
|
│ ├── connectors/ # Discord/Slack/Telegram/WhatsApp config
|
|
165
173
|
│ ├── layout/ # App shell, sidebar, mobile header
|
|
174
|
+
│ ├── memory/ # Memory browser and maintenance UI
|
|
166
175
|
│ ├── providers/ # Provider management
|
|
167
176
|
│ ├── schedules/ # Cron scheduler
|
|
168
177
|
│ ├── skills/ # Skills manager
|
|
@@ -171,7 +180,7 @@ src/
|
|
|
171
180
|
├── lib/
|
|
172
181
|
│ ├── providers/ # LLM provider implementations
|
|
173
182
|
│ └── server/ # Storage, orchestrator, connectors, tools
|
|
174
|
-
├── stores/ # Zustand state (app store, chat store)
|
|
183
|
+
├── stores/ # Zustand state (app store, chat store, chatroom store)
|
|
175
184
|
└── types/ # TypeScript interfaces
|
|
176
185
|
```
|
|
177
186
|
|
|
@@ -288,6 +297,7 @@ Agents with platform tools enabled can manage the SwarmClaw instance:
|
|
|
288
297
|
| Manage Documents | Upload/search/get/delete indexed docs for lightweight RAG workflows |
|
|
289
298
|
| Manage Webhooks | Register external webhook endpoints that trigger agent sessions |
|
|
290
299
|
| Manage Connectors | Manage chat platform bridges |
|
|
300
|
+
| Manage Chatrooms | Create/list/update chatrooms, manage members, and post room messages for multi-agent collaboration |
|
|
291
301
|
| Manage Sessions | Enable `sessions_tool` for list/history/status/send/spawn/stop, plus `context_status` and `context_summarize` for context window management |
|
|
292
302
|
| Manage Secrets | Store and retrieve encrypted reusable secrets |
|
|
293
303
|
|
|
@@ -313,6 +323,8 @@ Token usage and estimated costs are tracked per message for API-based providers
|
|
|
313
323
|
|
|
314
324
|
The daemon auto-processes queued tasks from the scheduler on a 30-second interval. It also runs recurring health checks that detect stale heartbeat sessions and can send proactive WhatsApp alerts when issues are detected. Toggle the daemon from the sidebar indicator or via API.
|
|
315
325
|
|
|
326
|
+
Daemon runtime also triggers memory consolidation (daily summary generation plus recurring dedupe/prune maintenance).
|
|
327
|
+
|
|
316
328
|
- **API:** `GET /api/daemon` (status), `POST /api/daemon` with `{"action": "start"}` or `{"action": "stop"}`
|
|
317
329
|
- Auto-starts on first authenticated runtime traffic (`/api/auth` or `/api/daemon`) unless `SWARMCLAW_DAEMON_AUTOSTART=0`
|
|
318
330
|
|
|
@@ -327,7 +339,7 @@ For autonomous long-running missions, enable the **Main Loop** on a session. Thi
|
|
|
327
339
|
- `autonomous`: Agent executes safe actions without confirmation, only asks when blocked by permissions/credentials
|
|
328
340
|
- `assist`: Agent asks before irreversible external actions (sending messages, purchases, account mutations)
|
|
329
341
|
- **API:** `POST /api/sessions/[id]/main-loop` with `{"tick":true}` to trigger a mission tick
|
|
330
|
-
- **CLI:** `swarmclaw sessions main-loop
|
|
342
|
+
- **CLI:** `swarmclaw sessions main-loop <id>` to inspect loop state, or `swarmclaw sessions main-loop-action <id> --data '{"action":"nudge"}'` to control it
|
|
331
343
|
|
|
332
344
|
Use this for background agents that should "keep working" on a goal until blocked or complete.
|
|
333
345
|
|
|
@@ -530,7 +542,7 @@ git push origin main --follow-tags
|
|
|
530
542
|
```
|
|
531
543
|
|
|
532
544
|
On `v*` tags, GitHub Actions will:
|
|
533
|
-
1. Run
|
|
545
|
+
1. Run release gates (`npm run test:cli`, `npm run test:openclaw`, `npm run build:ci`)
|
|
534
546
|
2. Create a GitHub Release
|
|
535
547
|
3. Build and publish Docker images to `ghcr.io/swarmclawai/swarmclaw` (`:vX.Y.Z`, `:latest`, `:sha-*`)
|
|
536
548
|
|
|
@@ -556,9 +568,18 @@ swarmclaw [global-options] <group> <command> [command-options]
|
|
|
556
568
|
|
|
557
569
|
| Flag | Description |
|
|
558
570
|
|-|-|
|
|
559
|
-
|
|
|
560
|
-
|
|
|
561
|
-
| `--
|
|
571
|
+
| `--base-url <url>` | API base URL (default: `http://localhost:3456`) |
|
|
572
|
+
| `--access-key <key>` | Access key override (else `SWARMCLAW_API_KEY` or `platform-api-key.txt`) |
|
|
573
|
+
| `--data <json\|@file\|->` | Request JSON body |
|
|
574
|
+
| `--query key=value` | Query parameter (repeatable) |
|
|
575
|
+
| `--header key=value` | Extra HTTP header (repeatable) |
|
|
576
|
+
| `--json` | Compact JSON output |
|
|
577
|
+
| `--wait` | Wait for run/task completion when IDs are returned |
|
|
578
|
+
| `--timeout-ms <ms>` | Request/wait timeout (default `300000`) |
|
|
579
|
+
| `--interval-ms <ms>` | Poll interval for `--wait` (default `2000`) |
|
|
580
|
+
| `--out <file>` | Write binary response to file |
|
|
581
|
+
|
|
582
|
+
Routing note: `swarmclaw` uses a hybrid router. Some legacy rich commands still support `-u/--url`, `-k/--key`, and `--raw`; mapped API commands use the options above.
|
|
562
583
|
|
|
563
584
|
### Command Groups
|
|
564
585
|
|
|
@@ -570,7 +591,9 @@ Notable setup/operations groups include:
|
|
|
570
591
|
| `setup` | Setup helpers like provider checks and `doctor` diagnostics |
|
|
571
592
|
| `version` | Version status and update helpers |
|
|
572
593
|
| `sessions` | Session lifecycle, chat, browser/devserver controls, mailbox |
|
|
594
|
+
| `chatrooms` | Multi-agent chatrooms (members, reactions, streamed room chat) |
|
|
573
595
|
| `memory` | Memory CRUD and maintenance utilities |
|
|
596
|
+
| `notifications` | In-app notification listing and read-state controls |
|
|
574
597
|
|
|
575
598
|
### Examples
|
|
576
599
|
|
|
@@ -592,6 +615,18 @@ swarmclaw setup init --provider openai --api-key "$OPENAI_API_KEY"
|
|
|
592
615
|
|
|
593
616
|
# run memory maintenance analysis
|
|
594
617
|
swarmclaw memory maintenance
|
|
618
|
+
|
|
619
|
+
# list chatrooms
|
|
620
|
+
swarmclaw chatrooms list
|
|
621
|
+
|
|
622
|
+
# send a room message and stream agent replies
|
|
623
|
+
swarmclaw chatrooms chat <chatroomId> --data '{"text":"@all status update?"}'
|
|
624
|
+
|
|
625
|
+
# react to a room message
|
|
626
|
+
swarmclaw chatrooms react <chatroomId> --data '{"messageId":"<messageId>","emoji":"👍"}'
|
|
627
|
+
|
|
628
|
+
# pin/unpin a room message
|
|
629
|
+
swarmclaw chatrooms pin <chatroomId> --data '{"messageId":"<messageId>"}'
|
|
595
630
|
```
|
|
596
631
|
|
|
597
632
|
## Credits
|
package/bin/swarmclaw.js
CHANGED
|
@@ -4,28 +4,88 @@
|
|
|
4
4
|
const path = require('node:path')
|
|
5
5
|
const { spawnSync } = require('node:child_process')
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
// Legacy TS CLI groups/actions that provide richer, command-specific options.
|
|
8
|
+
const TS_CLI_ACTIONS = Object.freeze({
|
|
9
|
+
agents: new Set(['list', 'get']),
|
|
10
|
+
tasks: new Set(['list', 'get', 'create', 'update', 'delete', 'archive']),
|
|
11
|
+
schedules: new Set(['list', 'get', 'create']),
|
|
12
|
+
runs: new Set(['list', 'get']),
|
|
13
|
+
sessions: new Set(['list', 'get', 'create', 'update', 'delete', 'history', 'mailbox', 'stop']),
|
|
14
|
+
memory: new Set(['get', 'search', 'store', 'maintenance']),
|
|
15
|
+
'memory-images': new Set(['get']),
|
|
16
|
+
setup: new Set(['init', 'check-provider', 'doctor', 'openclaw-device']),
|
|
17
|
+
connectors: new Set(['list', 'get', 'create', 'update', 'delete', 'start', 'stop', 'repair']),
|
|
18
|
+
webhooks: new Set(['list', 'get', 'create', 'update', 'delete', 'trigger']),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
function shouldUseLegacyTsCli(argv) {
|
|
22
|
+
const group = argv[0]
|
|
23
|
+
const action = argv[1]
|
|
24
|
+
|
|
25
|
+
// Default to mapped CLI for top-level help/version and unknown groups.
|
|
26
|
+
if (!group || group.startsWith('-')) return false
|
|
14
27
|
|
|
28
|
+
const actions = TS_CLI_ACTIONS[group]
|
|
29
|
+
if (!actions) return false
|
|
30
|
+
|
|
31
|
+
// Prefer mapped CLI for group help so all API-backed actions are discoverable.
|
|
32
|
+
if (!action || action === 'help' || action.startsWith('-')) return false
|
|
33
|
+
|
|
34
|
+
return actions.has(action)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function runLegacyTsCli(argv) {
|
|
38
|
+
const cliPath = path.join(__dirname, '..', 'src', 'cli', 'index.ts')
|
|
15
39
|
const child = spawnSync(
|
|
16
40
|
process.execPath,
|
|
17
|
-
['--no-warnings', '--experimental-strip-types', cliPath, ...
|
|
18
|
-
{
|
|
19
|
-
stdio: 'inherit',
|
|
20
|
-
},
|
|
41
|
+
['--no-warnings', '--experimental-strip-types', cliPath, ...argv],
|
|
42
|
+
{ stdio: 'inherit' },
|
|
21
43
|
)
|
|
22
44
|
|
|
23
45
|
if (child.error) {
|
|
24
46
|
process.stderr.write(`${child.error.message}\n`)
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
return 1
|
|
48
|
+
}
|
|
49
|
+
if (typeof child.status === 'number') return child.status
|
|
50
|
+
return 1
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function runMappedCli(argv) {
|
|
54
|
+
const cliPath = path.join(__dirname, '..', 'src', 'cli', 'index.js')
|
|
55
|
+
const cliModule = await import(cliPath)
|
|
56
|
+
const runCli = cliModule.runCli || (cliModule.default && cliModule.default.runCli)
|
|
57
|
+
if (typeof runCli !== 'function') {
|
|
58
|
+
throw new Error('Unable to load API-mapped CLI runtime')
|
|
30
59
|
}
|
|
60
|
+
return runCli(argv)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function main() {
|
|
64
|
+
const argv = process.argv.slice(2)
|
|
65
|
+
const top = argv[0]
|
|
66
|
+
|
|
67
|
+
// Route 'server' and 'update' subcommands to CJS scripts (no TS dependency).
|
|
68
|
+
if (top === 'server') {
|
|
69
|
+
require('./server-cmd.js')
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
if (top === 'update') {
|
|
73
|
+
require('./update-cmd.js')
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const code = shouldUseLegacyTsCli(argv)
|
|
78
|
+
? runLegacyTsCli(argv)
|
|
79
|
+
: await runMappedCli(argv)
|
|
80
|
+
|
|
81
|
+
process.exitCode = typeof code === 'number' ? code : 1
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (require.main === module) {
|
|
85
|
+
void main()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
module.exports = {
|
|
89
|
+
TS_CLI_ACTIONS,
|
|
90
|
+
shouldUseLegacyTsCli,
|
|
31
91
|
}
|
package/next.config.ts
CHANGED
|
@@ -11,6 +11,11 @@ function getGitSha(): string {
|
|
|
11
11
|
|
|
12
12
|
const nextConfig: NextConfig = {
|
|
13
13
|
output: 'standalone',
|
|
14
|
+
turbopack: {
|
|
15
|
+
// Pin workspace root to the project directory so a stale lockfile
|
|
16
|
+
// in a parent folder (e.g. ~/) doesn't confuse native module resolution.
|
|
17
|
+
root: process.cwd(),
|
|
18
|
+
},
|
|
14
19
|
experimental: {
|
|
15
20
|
// Disable Turbopack persistent cache — concurrent HMR writes cause
|
|
16
21
|
// "Another write batch or compaction is already active" errors
|
|
@@ -36,9 +41,14 @@ const nextConfig: NextConfig = {
|
|
|
36
41
|
'0.0.0.0',
|
|
37
42
|
],
|
|
38
43
|
async rewrites() {
|
|
44
|
+
const views = 'agents|chatrooms|schedules|memory|tasks|secrets|providers|skills|connectors|webhooks|mcp-servers|knowledge|plugins|usage|runs|logs|settings|projects|activity'
|
|
39
45
|
return [
|
|
40
46
|
{
|
|
41
|
-
source:
|
|
47
|
+
source: `/:view(${views})`,
|
|
48
|
+
destination: '/',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
source: `/:view(${views})/:id`,
|
|
42
52
|
destination: '/',
|
|
43
53
|
},
|
|
44
54
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmclawai/swarmclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Self-hosted AI agent orchestration dashboard — manage LLM providers, orchestrate agent swarms, schedule tasks, and bridge agents to chat platforms.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"bin/",
|
|
28
28
|
"src/",
|
|
29
29
|
"public/",
|
|
30
|
+
"scripts/postinstall.mjs",
|
|
30
31
|
"next.config.ts",
|
|
31
32
|
"tsconfig.json",
|
|
32
33
|
"postcss.config.mjs",
|
|
@@ -50,7 +51,8 @@
|
|
|
50
51
|
"lint:baseline:update": "node ./scripts/lint-baseline.mjs update",
|
|
51
52
|
"cli": "node ./bin/swarmclaw.js",
|
|
52
53
|
"test:cli": "node --test src/cli/index.test.js",
|
|
53
|
-
"test:openclaw": "tsx --test src/lib/server/connectors/openclaw.test.ts src/lib/openclaw-endpoint.test.ts src/lib/server/gateway/protocol.test.ts src/lib/server/tool-capability-policy.test.ts"
|
|
54
|
+
"test:openclaw": "tsx --test src/lib/server/connectors/openclaw.test.ts src/lib/openclaw-endpoint.test.ts src/lib/server/gateway/protocol.test.ts src/lib/server/tool-capability-policy.test.ts",
|
|
55
|
+
"postinstall": "node ./scripts/postinstall.mjs"
|
|
54
56
|
},
|
|
55
57
|
"dependencies": {
|
|
56
58
|
"@huggingface/transformers": "^3.8.1",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from 'node:child_process'
|
|
4
|
+
|
|
5
|
+
const result = spawnSync('npm', ['rebuild', 'better-sqlite3', '--silent'], {
|
|
6
|
+
stdio: 'ignore',
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
if (result.error) {
|
|
10
|
+
// Ignore optional native rebuild failures for install resilience.
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!process.env.CI) {
|
|
14
|
+
process.stdout.write('\n')
|
|
15
|
+
process.stdout.write('Thanks for installing SwarmClaw.\n')
|
|
16
|
+
process.stdout.write('If it helps you, please star the repo: https://github.com/swarmclawai/swarmclaw\n')
|
|
17
|
+
process.stdout.write('\n')
|
|
18
|
+
}
|