@swarmclawai/swarmclaw 0.5.3 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +53 -9
  2. package/bin/server-cmd.js +1 -0
  3. package/bin/swarmclaw.js +76 -16
  4. package/next.config.ts +11 -1
  5. package/package.json +5 -2
  6. package/scripts/postinstall.mjs +18 -0
  7. package/src/app/api/canvas/[sessionId]/route.ts +31 -0
  8. package/src/app/api/chatrooms/[id]/chat/route.ts +284 -0
  9. package/src/app/api/chatrooms/[id]/members/route.ts +82 -0
  10. package/src/app/api/chatrooms/[id]/pins/route.ts +39 -0
  11. package/src/app/api/chatrooms/[id]/reactions/route.ts +42 -0
  12. package/src/app/api/chatrooms/[id]/route.ts +84 -0
  13. package/src/app/api/chatrooms/route.ts +50 -0
  14. package/src/app/api/connectors/[id]/route.ts +1 -0
  15. package/src/app/api/connectors/route.ts +2 -1
  16. package/src/app/api/credentials/route.ts +2 -3
  17. package/src/app/api/files/open/route.ts +43 -0
  18. package/src/app/api/knowledge/[id]/route.ts +13 -2
  19. package/src/app/api/knowledge/route.ts +8 -1
  20. package/src/app/api/memory/route.ts +8 -0
  21. package/src/app/api/notifications/route.ts +4 -0
  22. package/src/app/api/orchestrator/run/route.ts +1 -1
  23. package/src/app/api/plugins/install/route.ts +2 -2
  24. package/src/app/api/search/route.ts +53 -1
  25. package/src/app/api/sessions/[id]/chat/route.ts +2 -0
  26. package/src/app/api/sessions/[id]/edit-resend/route.ts +1 -1
  27. package/src/app/api/sessions/[id]/fork/route.ts +1 -1
  28. package/src/app/api/sessions/[id]/messages/route.ts +70 -2
  29. package/src/app/api/sessions/[id]/route.ts +4 -0
  30. package/src/app/api/sessions/route.ts +3 -3
  31. package/src/app/api/settings/route.ts +9 -0
  32. package/src/app/api/setup/check-provider/route.ts +3 -16
  33. package/src/app/api/skills/[id]/route.ts +6 -0
  34. package/src/app/api/skills/route.ts +6 -0
  35. package/src/app/api/tasks/[id]/route.ts +12 -0
  36. package/src/app/api/tasks/bulk/route.ts +100 -0
  37. package/src/app/api/tasks/metrics/route.ts +101 -0
  38. package/src/app/api/tasks/route.ts +18 -2
  39. package/src/app/api/tts/route.ts +3 -2
  40. package/src/app/api/tts/stream/route.ts +3 -2
  41. package/src/app/api/uploads/[filename]/route.ts +19 -34
  42. package/src/app/api/uploads/route.ts +94 -0
  43. package/src/app/api/webhooks/[id]/route.ts +15 -1
  44. package/src/app/globals.css +63 -15
  45. package/src/app/page.tsx +142 -13
  46. package/src/cli/index.js +40 -1
  47. package/src/cli/index.test.js +30 -0
  48. package/src/cli/spec.js +42 -0
  49. package/src/components/agents/agent-avatar.tsx +57 -10
  50. package/src/components/agents/agent-card.tsx +50 -17
  51. package/src/components/agents/agent-chat-list.tsx +148 -12
  52. package/src/components/agents/agent-list.tsx +50 -19
  53. package/src/components/agents/agent-sheet.tsx +120 -65
  54. package/src/components/agents/inspector-panel.tsx +81 -6
  55. package/src/components/agents/openclaw-skills-panel.tsx +32 -3
  56. package/src/components/agents/personality-builder.tsx +42 -14
  57. package/src/components/agents/soul-library-picker.tsx +89 -0
  58. package/src/components/auth/access-key-gate.tsx +10 -3
  59. package/src/components/auth/setup-wizard.tsx +2 -2
  60. package/src/components/auth/user-picker.tsx +31 -3
  61. package/src/components/canvas/canvas-panel.tsx +96 -0
  62. package/src/components/chat/activity-moment.tsx +173 -0
  63. package/src/components/chat/chat-area.tsx +46 -22
  64. package/src/components/chat/chat-header.tsx +457 -286
  65. package/src/components/chat/chat-preview-panel.tsx +1 -2
  66. package/src/components/chat/chat-tool-toggles.tsx +1 -1
  67. package/src/components/chat/delegation-banner.tsx +371 -0
  68. package/src/components/chat/file-path-chip.tsx +146 -0
  69. package/src/components/chat/heartbeat-history-panel.tsx +269 -0
  70. package/src/components/chat/markdown-utils.ts +9 -0
  71. package/src/components/chat/message-bubble.tsx +356 -315
  72. package/src/components/chat/message-list.tsx +230 -8
  73. package/src/components/chat/streaming-bubble.tsx +104 -47
  74. package/src/components/chat/suggestions-bar.tsx +1 -1
  75. package/src/components/chat/thinking-indicator.tsx +72 -10
  76. package/src/components/chat/tool-call-bubble.tsx +111 -73
  77. package/src/components/chat/tool-request-banner.tsx +31 -7
  78. package/src/components/chat/transfer-agent-picker.tsx +63 -0
  79. package/src/components/chatrooms/agent-hover-card.tsx +124 -0
  80. package/src/components/chatrooms/chatroom-input.tsx +320 -0
  81. package/src/components/chatrooms/chatroom-list.tsx +130 -0
  82. package/src/components/chatrooms/chatroom-message.tsx +432 -0
  83. package/src/components/chatrooms/chatroom-sheet.tsx +215 -0
  84. package/src/components/chatrooms/chatroom-tool-request-banner.tsx +134 -0
  85. package/src/components/chatrooms/chatroom-typing-bar.tsx +88 -0
  86. package/src/components/chatrooms/chatroom-view.tsx +344 -0
  87. package/src/components/chatrooms/reaction-picker.tsx +273 -0
  88. package/src/components/connectors/connector-list.tsx +168 -90
  89. package/src/components/connectors/connector-sheet.tsx +95 -56
  90. package/src/components/home/home-view.tsx +501 -0
  91. package/src/components/input/chat-input.tsx +107 -43
  92. package/src/components/knowledge/knowledge-list.tsx +31 -1
  93. package/src/components/knowledge/knowledge-sheet.tsx +83 -2
  94. package/src/components/layout/app-layout.tsx +194 -97
  95. package/src/components/layout/update-banner.tsx +2 -2
  96. package/src/components/logs/log-list.tsx +2 -2
  97. package/src/components/mcp-servers/mcp-server-sheet.tsx +1 -1
  98. package/src/components/memory/memory-agent-list.tsx +143 -0
  99. package/src/components/memory/memory-browser.tsx +205 -0
  100. package/src/components/memory/memory-card.tsx +34 -7
  101. package/src/components/memory/memory-detail.tsx +359 -120
  102. package/src/components/memory/memory-sheet.tsx +157 -23
  103. package/src/components/plugins/plugin-list.tsx +1 -1
  104. package/src/components/plugins/plugin-sheet.tsx +1 -1
  105. package/src/components/projects/project-detail.tsx +509 -0
  106. package/src/components/projects/project-list.tsx +195 -59
  107. package/src/components/providers/provider-list.tsx +2 -2
  108. package/src/components/providers/provider-sheet.tsx +3 -3
  109. package/src/components/schedules/schedule-card.tsx +1 -1
  110. package/src/components/schedules/schedule-list.tsx +1 -1
  111. package/src/components/schedules/schedule-sheet.tsx +259 -126
  112. package/src/components/secrets/secret-sheet.tsx +47 -24
  113. package/src/components/secrets/secrets-list.tsx +18 -8
  114. package/src/components/sessions/new-session-sheet.tsx +33 -65
  115. package/src/components/sessions/session-card.tsx +45 -14
  116. package/src/components/sessions/session-list.tsx +35 -18
  117. package/src/components/settings/gateway-disconnect-overlay.tsx +80 -0
  118. package/src/components/shared/agent-picker-list.tsx +90 -0
  119. package/src/components/shared/agent-switch-dialog.tsx +156 -0
  120. package/src/components/shared/attachment-chip.tsx +165 -0
  121. package/src/components/shared/avatar.tsx +10 -1
  122. package/src/components/shared/chatroom-picker-list.tsx +61 -0
  123. package/src/components/shared/check-icon.tsx +12 -0
  124. package/src/components/shared/confirm-dialog.tsx +1 -1
  125. package/src/components/shared/connector-platform-icon.tsx +51 -4
  126. package/src/components/shared/empty-state.tsx +32 -0
  127. package/src/components/shared/file-preview.tsx +34 -0
  128. package/src/components/shared/form-styles.ts +2 -0
  129. package/src/components/shared/icon-button.tsx +16 -2
  130. package/src/components/shared/keyboard-shortcuts-dialog.tsx +116 -0
  131. package/src/components/shared/notification-center.tsx +44 -6
  132. package/src/components/shared/profile-sheet.tsx +115 -0
  133. package/src/components/shared/reply-quote.tsx +26 -0
  134. package/src/components/shared/search-dialog.tsx +31 -15
  135. package/src/components/shared/section-label.tsx +12 -0
  136. package/src/components/shared/settings/plugin-manager.tsx +1 -1
  137. package/src/components/shared/settings/section-embedding.tsx +48 -13
  138. package/src/components/shared/settings/section-orchestrator.tsx +46 -15
  139. package/src/components/shared/settings/section-providers.tsx +1 -1
  140. package/src/components/shared/settings/section-secrets.tsx +1 -1
  141. package/src/components/shared/settings/section-storage.tsx +206 -0
  142. package/src/components/shared/settings/section-theme.tsx +95 -0
  143. package/src/components/shared/settings/section-user-preferences.tsx +57 -0
  144. package/src/components/shared/settings/section-voice.tsx +42 -21
  145. package/src/components/shared/settings/section-web-search.tsx +30 -6
  146. package/src/components/shared/settings/settings-page.tsx +182 -27
  147. package/src/components/shared/settings/settings-sheet.tsx +9 -73
  148. package/src/components/shared/settings/storage-browser.tsx +259 -0
  149. package/src/components/shared/sheet-footer.tsx +33 -0
  150. package/src/components/skills/skill-list.tsx +61 -30
  151. package/src/components/skills/skill-sheet.tsx +81 -2
  152. package/src/components/tasks/task-board.tsx +448 -26
  153. package/src/components/tasks/task-card.tsx +59 -9
  154. package/src/components/tasks/task-column.tsx +62 -3
  155. package/src/components/tasks/task-list.tsx +12 -4
  156. package/src/components/tasks/task-sheet.tsx +416 -74
  157. package/src/components/ui/hover-card.tsx +52 -0
  158. package/src/components/usage/metrics-dashboard.tsx +90 -6
  159. package/src/components/usage/usage-list.tsx +1 -1
  160. package/src/components/webhooks/webhook-sheet.tsx +1 -1
  161. package/src/hooks/use-continuous-speech.ts +10 -4
  162. package/src/hooks/use-view-router.ts +69 -19
  163. package/src/hooks/use-voice-conversation.ts +53 -10
  164. package/src/hooks/use-ws.ts +4 -2
  165. package/src/instrumentation.ts +15 -1
  166. package/src/lib/chat.ts +2 -0
  167. package/src/lib/memory.ts +3 -0
  168. package/src/lib/providers/anthropic.ts +13 -7
  169. package/src/lib/providers/index.ts +1 -0
  170. package/src/lib/providers/openai.ts +13 -7
  171. package/src/lib/server/chat-execution.ts +75 -15
  172. package/src/lib/server/chatroom-helpers.ts +146 -0
  173. package/src/lib/server/connectors/manager.ts +229 -7
  174. package/src/lib/server/context-manager.ts +225 -13
  175. package/src/lib/server/create-notification.ts +14 -2
  176. package/src/lib/server/daemon-state.ts +157 -10
  177. package/src/lib/server/execution-log.ts +1 -0
  178. package/src/lib/server/heartbeat-service.ts +48 -6
  179. package/src/lib/server/heartbeat-wake.ts +110 -0
  180. package/src/lib/server/langgraph-checkpoint.ts +1 -0
  181. package/src/lib/server/main-agent-loop.ts +1 -1
  182. package/src/lib/server/memory-consolidation.ts +105 -0
  183. package/src/lib/server/memory-db.ts +183 -10
  184. package/src/lib/server/mime.ts +51 -0
  185. package/src/lib/server/openclaw-gateway.ts +9 -1
  186. package/src/lib/server/orchestrator-lg.ts +2 -0
  187. package/src/lib/server/orchestrator.ts +5 -2
  188. package/src/lib/server/playwright-proxy.mjs +2 -3
  189. package/src/lib/server/prompt-runtime-context.ts +53 -0
  190. package/src/lib/server/provider-health.ts +125 -0
  191. package/src/lib/server/queue.ts +56 -10
  192. package/src/lib/server/scheduler.ts +8 -0
  193. package/src/lib/server/session-run-manager.ts +4 -0
  194. package/src/lib/server/session-tools/canvas.ts +67 -0
  195. package/src/lib/server/session-tools/chatroom.ts +136 -0
  196. package/src/lib/server/session-tools/connector.ts +83 -9
  197. package/src/lib/server/session-tools/context-mgmt.ts +36 -18
  198. package/src/lib/server/session-tools/crud.ts +21 -0
  199. package/src/lib/server/session-tools/delegate.ts +68 -4
  200. package/src/lib/server/session-tools/git.ts +71 -0
  201. package/src/lib/server/session-tools/http.ts +57 -0
  202. package/src/lib/server/session-tools/index.ts +10 -0
  203. package/src/lib/server/session-tools/memory.ts +7 -1
  204. package/src/lib/server/session-tools/search-providers.ts +16 -8
  205. package/src/lib/server/session-tools/subagent.ts +106 -0
  206. package/src/lib/server/session-tools/web.ts +115 -4
  207. package/src/lib/server/storage.ts +53 -29
  208. package/src/lib/server/stream-agent-chat.ts +185 -57
  209. package/src/lib/server/system-events.ts +49 -0
  210. package/src/lib/server/task-mention.ts +41 -0
  211. package/src/lib/server/ws-hub.ts +11 -0
  212. package/src/lib/sessions.ts +10 -0
  213. package/src/lib/soul-library.ts +103 -0
  214. package/src/lib/soul-suggestions.ts +109 -0
  215. package/src/lib/task-dedupe.ts +26 -0
  216. package/src/lib/tasks.ts +4 -1
  217. package/src/lib/tool-definitions.ts +2 -0
  218. package/src/lib/tts.ts +2 -2
  219. package/src/lib/view-routes.ts +36 -1
  220. package/src/lib/ws-client.ts +14 -4
  221. package/src/stores/use-app-store.ts +41 -3
  222. package/src/stores/use-chat-store.ts +113 -5
  223. package/src/stores/use-chatroom-store.ts +276 -0
  224. package/src/types/index.ts +88 -4
package/README.md CHANGED
@@ -30,19 +30,22 @@ Inspired by [OpenClaw](https://github.com/openclaw).
30
30
  - **Agent Builder** — Create agents with custom personalities (soul), system prompts, tools, and skills. AI-powered generation from a description
31
31
  - **Agent Inspector Panel** — Per-agent side panel for OpenClaw file editing (`SOUL.md`, `IDENTITY.md`, `USER.md`, etc.), guided personality editing, skill install/enable/remove, permission presets, sandbox env allowlist, and cron automations
32
32
  - **Agent Fleet Management** — Avatar seeds with generated avatars, running/approval fleet filters, soft-delete agent trash with restore/permanent delete, and approval counters in agent cards
33
- - **Agent Tools** — Shell, process control for long-running commands, files, edit file, send file, web search, web fetch, CLI delegation (Claude/Codex/OpenCode), Playwright browser automation, persistent memory, and sandboxed code execution (JS/TS via Deno, Python)
33
+ - **Agent Tools** — Shell, process control for long-running commands, files, edit file, send file, web search, web fetch, CLI delegation (Claude/Codex/OpenCode), Playwright browser automation, sub-agent spawning, canvas presentation, direct HTTP requests, git operations, persistent memory, and sandboxed code execution (JS/TS via Deno, Python)
34
34
  - **Platform Tools** — Agents can manage other agents, tasks, schedules, skills, connectors, sessions, and encrypted secrets via built-in platform tools
35
35
  - **Orchestration** — Multi-agent workflows powered by LangGraph with automatic sub-agent routing, checkpointed execution, and rich delegation cards that link to sub-agent chat threads
36
36
  - **Agentic Execution Policy** — Tool-first autonomous action loop with progress updates, evidence-driven answers, and better use of platform tools for long-lived work
37
+ - **Runtime Date/Time Grounding** — Session, orchestrator, chatroom, and connector prompts include authoritative current timestamp context to reduce stale-date behavior
37
38
  - **Task Board** — Queue and track agent tasks with status, comments, results, and archiving. Strict capability policy pauses tasks for human approval before tool execution
39
+ - **Task Metrics API** — Built-in analytics endpoint for WIP, cycle times, throughput velocity, completion/failure by agent, and priority distribution
38
40
  - **Background Daemon** — Auto-processes queued tasks and scheduled jobs with a 30s heartbeat plus recurring health monitoring
39
41
  - **Scheduling** — Cron-based agent scheduling with human-friendly presets
40
42
  - **Loop Runtime Controls** — Switch between bounded and ongoing loops with configurable step caps, runtime guards, heartbeat cadence, and timeout budgets
41
43
  - **Session Run Queue** — Per-session queued runs with followup/steer/collect modes, collect coalescing for bursty inputs, and run-state APIs
42
44
  - **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
45
+ - **Agent Chatrooms** — Multi-agent room conversations with `@mention` routing, chained agent replies, reactions, and file/image-aware chat context
43
46
  - **Live Chat Telemetry** — Thinking/tool/responding stream phases, live main-loop status badges, connector activity presence, tone indicator, and optional sound notifications
44
47
  - **Global Search Palette** — `Cmd/Ctrl+K` search across agents, tasks, sessions, schedules, webhooks, and skills from anywhere in the app
45
- - **Notification Center** — Real-time in-app notifications for task/schedule/daemon events with unread tracking and quick actions
48
+ - **Notification Center** — Real-time in-app notifications for task/schedule/daemon events with unread tracking, mark-all/clear-read controls, and optional action links
46
49
  - **Preview-Rich Chat UI** — Side preview panel for tool outputs (image/browser/html/code), inline code/PDF previews for attachments, and image lightbox support
47
50
  - **Voice Settings** — Per-instance ElevenLabs API key + voice ID for TTS replies, plus configurable speech recognition language for chat input
48
51
  - **Chat Connectors** — Bridge agents to Discord, Slack, Telegram, WhatsApp, BlueBubbles (iMessage), Signal, Microsoft Teams, Google Chat, Matrix, and OpenClaw with media-aware inbound handling
@@ -85,7 +88,7 @@ curl -fsSL https://raw.githubusercontent.com/swarmclawai/swarmclaw/main/install.
85
88
  ```
86
89
 
87
90
  The installer resolves the latest stable release tag and installs that version by default.
88
- To pin a version: `SWARMCLAW_VERSION=v0.5.3 curl ... | bash`
91
+ To pin a version: `SWARMCLAW_VERSION=v0.6.1 curl ... | bash`
89
92
 
90
93
  Or run locally from the repo (friendly for non-technical users):
91
94
 
@@ -101,6 +104,8 @@ npm run quickstart
101
104
  - Prepare `.env.local` and `data/`
102
105
  - Start the app at `http://localhost:3456`
103
106
 
107
+ `postinstall` rebuilds `better-sqlite3` natively. If you install with `--ignore-scripts`, run `npm rebuild better-sqlite3` manually.
108
+
104
109
  On first launch, SwarmClaw will:
105
110
  1. Generate an **access key** and display it in the terminal
106
111
  2. Save it to `.env.local`
@@ -165,8 +170,10 @@ src/
165
170
  │ ├── agents/ # Agent builder UI
166
171
  │ ├── auth/ # Access key gate + user picker
167
172
  │ ├── chat/ # Message rendering, streaming, code blocks
173
+ │ ├── chatrooms/ # Multi-agent chatroom UI
168
174
  │ ├── connectors/ # Discord/Slack/Telegram/WhatsApp config
169
175
  │ ├── layout/ # App shell, sidebar, mobile header
176
+ │ ├── memory/ # Memory browser and maintenance UI
170
177
  │ ├── providers/ # Provider management
171
178
  │ ├── schedules/ # Cron scheduler
172
179
  │ ├── skills/ # Skills manager
@@ -175,7 +182,7 @@ src/
175
182
  ├── lib/
176
183
  │ ├── providers/ # LLM provider implementations
177
184
  │ └── server/ # Storage, orchestrator, connectors, tools
178
- ├── stores/ # Zustand state (app store, chat store)
185
+ ├── stores/ # Zustand state (app store, chat store, chatroom store)
179
186
  └── types/ # TypeScript interfaces
180
187
  ```
181
188
 
@@ -274,7 +281,11 @@ Agents can use the following tools when enabled:
274
281
  | Web Search | Search the web via DuckDuckGo HTML scraping |
275
282
  | Web Fetch | Fetch and extract text content from URLs (uses cheerio) |
276
283
  | CLI Delegation | Delegate complex tasks to Claude Code, Codex CLI, or OpenCode CLI |
284
+ | Spawn Subagent | Delegate a sub-task to another agent and capture its response in the current run |
277
285
  | Browser | Playwright-powered web browsing via MCP (navigate, click, type, screenshot, PDF) |
286
+ | Canvas | Present/hide/snapshot live HTML content in a session canvas panel |
287
+ | HTTP Request | Make direct API calls with method, headers, body, redirect control, and timeout |
288
+ | Git | Run structured git subcommands (`status`, `diff`, `log`, `add`, `commit`, `push`, etc.) with repo safety checks |
278
289
  | Memory | Store and retrieve long-term memories with FTS5 + vector search, file references, image attachments, and linked memory graph traversal |
279
290
  | Sandbox | Run JS/TS (Deno) or Python code in an isolated sandbox. Created files are returned as downloadable artifacts |
280
291
  | MCP Servers | Connect to external Model Context Protocol servers. Tools from MCP servers are injected as first-class agent tools |
@@ -292,6 +303,7 @@ Agents with platform tools enabled can manage the SwarmClaw instance:
292
303
  | Manage Documents | Upload/search/get/delete indexed docs for lightweight RAG workflows |
293
304
  | Manage Webhooks | Register external webhook endpoints that trigger agent sessions |
294
305
  | Manage Connectors | Manage chat platform bridges |
306
+ | Manage Chatrooms | Create/list/update chatrooms, manage members, and post room messages for multi-agent collaboration |
295
307
  | Manage Sessions | Enable `sessions_tool` for list/history/status/send/spawn/stop, plus `context_status` and `context_summarize` for context window management |
296
308
  | Manage Secrets | Store and retrieve encrypted reusable secrets |
297
309
 
@@ -313,10 +325,19 @@ Token usage and estimated costs are tracked per message for API-based providers
313
325
  - **Data:** Stored in `data/swarmclaw.db` (usage table)
314
326
  - Cost estimates use published model pricing (updated manually in `src/lib/server/cost.ts`)
315
327
 
328
+ ## Task Metrics
329
+
330
+ Task analytics are available via API for dashboarding and release-readiness checks:
331
+
332
+ - **API endpoint:** `GET /api/tasks/metrics?range=24h|7d|30d`
333
+ - **Returns:** status totals, WIP count, completion velocity buckets, avg/p50/p90 cycle time, completion/failure by agent, and priority counts
334
+
316
335
  ## Background Daemon
317
336
 
318
337
  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.
319
338
 
339
+ Daemon runtime also triggers memory consolidation (daily summary generation plus recurring dedupe/prune maintenance).
340
+
320
341
  - **API:** `GET /api/daemon` (status), `POST /api/daemon` with `{"action": "start"}` or `{"action": "stop"}`
321
342
  - Auto-starts on first authenticated runtime traffic (`/api/auth` or `/api/daemon`) unless `SWARMCLAW_DAEMON_AUTOSTART=0`
322
343
 
@@ -331,7 +352,7 @@ For autonomous long-running missions, enable the **Main Loop** on a session. Thi
331
352
  - `autonomous`: Agent executes safe actions without confirmation, only asks when blocked by permissions/credentials
332
353
  - `assist`: Agent asks before irreversible external actions (sending messages, purchases, account mutations)
333
354
  - **API:** `POST /api/sessions/[id]/main-loop` with `{"tick":true}` to trigger a mission tick
334
- - **CLI:** `swarmclaw sessions main-loop --session-id <id>` (via daemon schedule)
355
+ - **CLI:** `swarmclaw sessions main-loop <id>` to inspect loop state, or `swarmclaw sessions main-loop-action <id> --data '{"action":"nudge"}'` to control it
335
356
 
336
357
  Use this for background agents that should "keep working" on a goal until blocked or complete.
337
358
 
@@ -534,7 +555,7 @@ git push origin main --follow-tags
534
555
  ```
535
556
 
536
557
  On `v*` tags, GitHub Actions will:
537
- 1. Run CI checks
558
+ 1. Run release gates (`npm run test:cli`, `npm run test:openclaw`, `npm run build:ci`)
538
559
  2. Create a GitHub Release
539
560
  3. Build and publish Docker images to `ghcr.io/swarmclawai/swarmclaw` (`:vX.Y.Z`, `:latest`, `:sha-*`)
540
561
 
@@ -560,9 +581,18 @@ swarmclaw [global-options] <group> <command> [command-options]
560
581
 
561
582
  | Flag | Description |
562
583
  |-|-|
563
- | `-u, --url <url>` | SwarmClaw base URL (default: `http://localhost:3456`) |
564
- | `-k, --key <key>` | Access key (or set `SWARMCLAW_ACCESS_KEY`) |
565
- | `--raw` | Print compact JSON output |
584
+ | `--base-url <url>` | API base URL (default: `http://localhost:3456`) |
585
+ | `--access-key <key>` | Access key override (else `SWARMCLAW_API_KEY` or `platform-api-key.txt`) |
586
+ | `--data <json\|@file\|->` | Request JSON body |
587
+ | `--query key=value` | Query parameter (repeatable) |
588
+ | `--header key=value` | Extra HTTP header (repeatable) |
589
+ | `--json` | Compact JSON output |
590
+ | `--wait` | Wait for run/task completion when IDs are returned |
591
+ | `--timeout-ms <ms>` | Request/wait timeout (default `300000`) |
592
+ | `--interval-ms <ms>` | Poll interval for `--wait` (default `2000`) |
593
+ | `--out <file>` | Write binary response to file |
594
+
595
+ 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.
566
596
 
567
597
  ### Command Groups
568
598
 
@@ -574,7 +604,9 @@ Notable setup/operations groups include:
574
604
  | `setup` | Setup helpers like provider checks and `doctor` diagnostics |
575
605
  | `version` | Version status and update helpers |
576
606
  | `sessions` | Session lifecycle, chat, browser/devserver controls, mailbox |
607
+ | `chatrooms` | Multi-agent chatrooms (members, reactions, streamed room chat) |
577
608
  | `memory` | Memory CRUD and maintenance utilities |
609
+ | `notifications` | In-app notification listing and read-state controls |
578
610
 
579
611
  ### Examples
580
612
 
@@ -596,6 +628,18 @@ swarmclaw setup init --provider openai --api-key "$OPENAI_API_KEY"
596
628
 
597
629
  # run memory maintenance analysis
598
630
  swarmclaw memory maintenance
631
+
632
+ # list chatrooms
633
+ swarmclaw chatrooms list
634
+
635
+ # send a room message and stream agent replies
636
+ swarmclaw chatrooms chat <chatroomId> --data '{"text":"@all status update?"}'
637
+
638
+ # react to a room message
639
+ swarmclaw chatrooms react <chatroomId> --data '{"messageId":"<messageId>","emoji":"👍"}'
640
+
641
+ # pin/unpin a room message
642
+ swarmclaw chatrooms pin <chatroomId> --data '{"messageId":"<messageId>"}'
599
643
  ```
600
644
 
601
645
  ## Credits
package/bin/server-cmd.js CHANGED
@@ -21,6 +21,7 @@ const DATA_DIR = path.join(SWARMCLAW_HOME, 'data')
21
21
  const BUILD_COPY_ENTRIES = [
22
22
  'src',
23
23
  'public',
24
+ 'scripts',
24
25
  'next.config.ts',
25
26
  'tsconfig.json',
26
27
  'postcss.config.mjs',
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
- // Route 'server' and 'update' subcommands to CJS scripts (no TS dependency)
8
- if (process.argv[2] === 'server') {
9
- require('./server-cmd.js')
10
- } else if (process.argv[2] === 'update') {
11
- require('./update-cmd.js')
12
- } else {
13
- const cliPath = path.join(__dirname, '..', 'src', 'cli', 'index.ts')
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, ...process.argv.slice(2)],
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
- process.exitCode = 1
26
- } else if (typeof child.status === 'number') {
27
- process.exitCode = child.status
28
- } else {
29
- process.exitCode = 1
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: '/:view(agents|schedules|memory|tasks|secrets|providers|skills|connectors|webhooks|mcp-servers|knowledge|plugins|usage|runs|logs|settings|projects)',
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.5.3",
3
+ "version": "0.6.2",
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",
@@ -82,6 +84,7 @@
82
84
  "radix-ui": "^1.4.3",
83
85
  "react": "19.2.3",
84
86
  "react-dom": "19.2.3",
87
+ "react-hot-toast": "^2.6.0",
85
88
  "react-icons": "^5.5.0",
86
89
  "react-markdown": "^10.1.0",
87
90
  "recharts": "^3.7.0",
@@ -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
+ }
@@ -0,0 +1,31 @@
1
+ import { NextResponse } from 'next/server'
2
+ import { loadSessions, saveSessions } from '@/lib/server/storage'
3
+ import { notify } from '@/lib/server/ws-hub'
4
+
5
+ export async function GET(_req: Request, { params }: { params: Promise<{ sessionId: string }> }) {
6
+ const { sessionId } = await params
7
+ const sessions = loadSessions()
8
+ const session = sessions[sessionId]
9
+ if (!session) return NextResponse.json({ error: 'Session not found' }, { status: 404 })
10
+
11
+ return NextResponse.json({
12
+ sessionId,
13
+ content: (session as Record<string, unknown>).canvasContent || null,
14
+ })
15
+ }
16
+
17
+ export async function POST(req: Request, { params }: { params: Promise<{ sessionId: string }> }) {
18
+ const { sessionId } = await params
19
+ const body = await req.json()
20
+ const sessions = loadSessions()
21
+ const session = sessions[sessionId]
22
+ if (!session) return NextResponse.json({ error: 'Session not found' }, { status: 404 })
23
+
24
+ ;(session as Record<string, unknown>).canvasContent = body.content || null
25
+ session.lastActiveAt = Date.now()
26
+ sessions[sessionId] = session
27
+ saveSessions(sessions)
28
+
29
+ notify(`canvas:${sessionId}`)
30
+ return NextResponse.json({ ok: true, sessionId })
31
+ }