@swarmclawai/swarmclaw 0.8.8 → 0.9.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.
Files changed (608) hide show
  1. package/Dockerfile.sandbox-browser +29 -0
  2. package/README.md +35 -18
  3. package/bin/update-cmd.js +28 -2
  4. package/bin/update-cmd.test.js +49 -12
  5. package/bundled-skills/google-workspace/SKILL.md +94 -0
  6. package/next.config.ts +0 -14
  7. package/package.json +17 -7
  8. package/scripts/easy-setup.mjs +145 -0
  9. package/scripts/easy-update.mjs +151 -0
  10. package/scripts/ensure-sandbox-browser-image.mjs +102 -0
  11. package/scripts/postinstall.mjs +54 -3
  12. package/scripts/sandbox-browser-entrypoint.sh +82 -0
  13. package/src/app/activity/page.tsx +96 -0
  14. package/src/app/agents/[id]/page.tsx +43 -0
  15. package/src/app/agents/layout.tsx +40 -0
  16. package/src/app/agents/page.tsx +34 -0
  17. package/src/app/api/agents/[id]/route.ts +18 -3
  18. package/src/app/api/agents/[id]/thread/route.ts +2 -2
  19. package/src/app/api/agents/route.ts +5 -3
  20. package/src/app/api/agents/trash/route.ts +14 -1
  21. package/src/app/api/approvals/route.test.ts +24 -46
  22. package/src/app/api/approvals/route.ts +9 -1
  23. package/src/app/api/auth/route.ts +2 -2
  24. package/src/app/api/chatrooms/[id]/chat/route.test.ts +2 -2
  25. package/src/app/api/chatrooms/[id]/chat/route.ts +7 -7
  26. package/src/app/api/chatrooms/[id]/moderate/route.ts +1 -1
  27. package/src/app/api/chats/[id]/browser/route.ts +16 -1
  28. package/src/app/api/chats/[id]/chat/route.test.ts +5 -5
  29. package/src/app/api/chats/[id]/chat/route.ts +105 -94
  30. package/src/app/api/chats/[id]/checkpoints/route.ts +8 -3
  31. package/src/app/api/chats/[id]/devserver/route.ts +1 -1
  32. package/src/app/api/chats/[id]/mailbox/route.ts +1 -1
  33. package/src/app/api/chats/[id]/messages/route.ts +2 -2
  34. package/src/app/api/chats/[id]/route.ts +8 -3
  35. package/src/app/api/chats/[id]/stop/route.ts +2 -2
  36. package/src/app/api/chats/heartbeat/route.ts +2 -2
  37. package/src/app/api/chats/route.ts +8 -8
  38. package/src/app/api/clawhub/install/route.ts +2 -2
  39. package/src/app/api/clawhub/search/route.ts +1 -1
  40. package/src/app/api/connectors/[id]/route.ts +1 -1
  41. package/src/app/api/connectors/route.ts +2 -2
  42. package/src/app/api/daemon/health-check/route.ts +1 -1
  43. package/src/app/api/daemon/route.ts +3 -3
  44. package/src/app/api/gateways/[id]/health/route.ts +2 -2
  45. package/src/app/api/gateways/[id]/route.ts +1 -1
  46. package/src/app/api/gateways/route.ts +2 -2
  47. package/src/app/api/knowledge/[id]/route.ts +1 -1
  48. package/src/app/api/knowledge/route.ts +1 -1
  49. package/src/app/api/memory/[id]/route.ts +2 -2
  50. package/src/app/api/memory/graph/route.ts +1 -1
  51. package/src/app/api/memory/maintenance/route.ts +2 -2
  52. package/src/app/api/memory/route.ts +2 -2
  53. package/src/app/api/notifications/route.ts +1 -1
  54. package/src/app/api/openclaw/agent-files/route.ts +2 -2
  55. package/src/app/api/openclaw/approvals/route.ts +1 -1
  56. package/src/app/api/openclaw/config-sync/route.ts +1 -1
  57. package/src/app/api/openclaw/cron/route.ts +1 -1
  58. package/src/app/api/openclaw/deploy/route.ts +1 -1
  59. package/src/app/api/openclaw/discover/route.ts +1 -1
  60. package/src/app/api/openclaw/doctor/route.ts +1 -1
  61. package/src/app/api/openclaw/dotenv-keys/route.ts +1 -1
  62. package/src/app/api/openclaw/exec-config/route.ts +1 -1
  63. package/src/app/api/openclaw/gateway/route.ts +1 -1
  64. package/src/app/api/openclaw/history/route.ts +2 -2
  65. package/src/app/api/openclaw/media/route.ts +1 -1
  66. package/src/app/api/openclaw/models/route.ts +1 -1
  67. package/src/app/api/openclaw/permissions/route.ts +2 -2
  68. package/src/app/api/openclaw/sandbox-env/route.ts +1 -1
  69. package/src/app/api/openclaw/skills/install/route.ts +1 -1
  70. package/src/app/api/openclaw/skills/remove/route.ts +1 -1
  71. package/src/app/api/openclaw/skills/route.ts +3 -3
  72. package/src/app/api/openclaw/sync/route.ts +1 -1
  73. package/src/app/api/orchestrator/run/route.ts +2 -2
  74. package/src/app/api/perf/route.ts +1 -1
  75. package/src/app/api/plugins/marketplace/route.ts +1 -1
  76. package/src/app/api/preview-server/route.ts +1 -1
  77. package/src/app/api/providers/openclaw/health/route.ts +1 -1
  78. package/src/app/api/runs/[id]/route.ts +1 -1
  79. package/src/app/api/runs/route.ts +1 -1
  80. package/src/app/api/schedules/[id]/route.ts +1 -1
  81. package/src/app/api/schedules/[id]/run/route.ts +5 -5
  82. package/src/app/api/schedules/route.ts +2 -2
  83. package/src/app/api/settings/route.ts +10 -3
  84. package/src/app/api/setup/doctor/route.ts +46 -16
  85. package/src/app/api/skills/[id]/route.ts +1 -1
  86. package/src/app/api/skills/import/route.ts +1 -1
  87. package/src/app/api/skills/route.ts +1 -1
  88. package/src/app/api/tasks/[id]/route.ts +5 -5
  89. package/src/app/api/tasks/bulk/route.ts +2 -2
  90. package/src/app/api/tasks/route.ts +5 -5
  91. package/src/app/api/wallets/[id]/approve/route.ts +2 -2
  92. package/src/app/api/wallets/[id]/route.ts +3 -3
  93. package/src/app/api/wallets/[id]/send/route.ts +2 -2
  94. package/src/app/api/wallets/route.ts +2 -2
  95. package/src/app/api/webhooks/[id]/route.ts +4 -4
  96. package/src/app/chatrooms/page.tsx +36 -0
  97. package/src/app/connectors/layout.tsx +21 -0
  98. package/src/app/connectors/page.tsx +27 -0
  99. package/src/app/home/page.tsx +650 -0
  100. package/src/app/knowledge/layout.tsx +21 -0
  101. package/src/app/knowledge/page.tsx +27 -0
  102. package/src/app/layout.tsx +4 -1
  103. package/src/app/login/page.tsx +9 -0
  104. package/src/app/logs/layout.tsx +16 -0
  105. package/src/app/logs/page.tsx +16 -0
  106. package/src/app/mcp-servers/layout.tsx +21 -0
  107. package/src/app/mcp-servers/page.tsx +27 -0
  108. package/src/app/memory/layout.tsx +21 -0
  109. package/src/{components/memory/memory-browser.tsx → app/memory/page.tsx} +13 -27
  110. package/src/app/page.tsx +3 -108
  111. package/src/app/plugins/layout.tsx +21 -0
  112. package/src/app/plugins/page.tsx +27 -0
  113. package/src/app/projects/page.tsx +18 -0
  114. package/src/app/providers/layout.tsx +21 -0
  115. package/src/app/providers/page.tsx +27 -0
  116. package/src/app/runs/layout.tsx +16 -0
  117. package/src/app/runs/page.tsx +16 -0
  118. package/src/app/schedules/layout.tsx +21 -0
  119. package/src/app/schedules/page.tsx +27 -0
  120. package/src/app/secrets/layout.tsx +21 -0
  121. package/src/app/secrets/page.tsx +27 -0
  122. package/src/{components/shared/settings/settings-page.tsx → app/settings/page.tsx} +122 -124
  123. package/src/app/setup/page.tsx +17 -0
  124. package/src/app/skills/layout.tsx +21 -0
  125. package/src/app/skills/page.tsx +27 -0
  126. package/src/app/tasks/layout.tsx +21 -0
  127. package/src/{components/tasks/task-board.tsx → app/tasks/page.tsx} +13 -20
  128. package/src/app/usage/page.tsx +557 -0
  129. package/src/app/user/page.tsx +7 -0
  130. package/src/app/wallets/page.tsx +12 -0
  131. package/src/app/webhooks/layout.tsx +21 -0
  132. package/src/app/webhooks/page.tsx +27 -0
  133. package/src/cli/index.js +5 -5
  134. package/src/cli/spec.js +7 -1
  135. package/src/components/agents/agent-card.tsx +6 -5
  136. package/src/components/agents/agent-chat-list.tsx +13 -14
  137. package/src/components/agents/agent-files-editor.tsx +1 -1
  138. package/src/components/agents/agent-list.tsx +2 -3
  139. package/src/components/agents/agent-sheet.tsx +32 -13
  140. package/src/components/agents/cron-job-form.tsx +1 -1
  141. package/src/components/agents/exec-config-panel.tsx +1 -1
  142. package/src/components/agents/inspector-panel.tsx +125 -8
  143. package/src/components/agents/openclaw-skills-panel.tsx +1 -1
  144. package/src/components/agents/permission-preset-selector.tsx +1 -1
  145. package/src/components/agents/personality-builder.tsx +1 -1
  146. package/src/components/agents/sandbox-env-panel.tsx +2 -2
  147. package/src/components/agents/skill-install-dialog.tsx +1 -1
  148. package/src/components/agents/soul-library-picker.tsx +1 -1
  149. package/src/components/agents/trash-list.tsx +1 -1
  150. package/src/components/auth/access-key-gate.tsx +1 -1
  151. package/src/components/auth/setup-wizard.tsx +1 -1
  152. package/src/components/auth/user-picker.tsx +1 -1
  153. package/src/components/canvas/canvas-panel.tsx +1 -1
  154. package/src/components/chat/chat-area.tsx +23 -21
  155. package/src/components/chat/chat-card.tsx +5 -14
  156. package/src/components/chat/chat-header.tsx +30 -31
  157. package/src/components/chat/chat-list.tsx +12 -10
  158. package/src/components/chat/chat-tool-toggles.tsx +1 -1
  159. package/src/components/chat/checkpoint-timeline.tsx +10 -58
  160. package/src/components/chat/delegation-banner.tsx +1 -1
  161. package/src/components/chat/file-path-chip.tsx +1 -1
  162. package/src/components/chat/heartbeat-history-panel.tsx +3 -2
  163. package/src/components/chat/message-bubble.tsx +29 -147
  164. package/src/components/chat/message-list.tsx +7 -46
  165. package/src/components/chat/session-debug-panel.tsx +7 -11
  166. package/src/components/chat/streaming-bubble.tsx +3 -256
  167. package/src/components/chat/swarm-panel.tsx +4 -8
  168. package/src/components/chat/tool-call-bubble.tsx +27 -5
  169. package/src/components/chat/tool-events-section.tsx +259 -0
  170. package/src/components/chat/tool-request-banner.tsx +3 -20
  171. package/src/components/chatrooms/agent-hover-card.tsx +4 -3
  172. package/src/components/chatrooms/chatroom-input.tsx +1 -1
  173. package/src/components/chatrooms/chatroom-message.tsx +3 -5
  174. package/src/components/chatrooms/chatroom-tool-request-banner.tsx +1 -1
  175. package/src/components/chatrooms/chatroom-view.tsx +8 -6
  176. package/src/components/connectors/connector-health.tsx +1 -1
  177. package/src/components/connectors/connector-list.tsx +11 -9
  178. package/src/components/connectors/connector-sheet.tsx +1 -1
  179. package/src/components/gateways/gateway-sheet.tsx +1 -1
  180. package/src/components/input/chat-input.tsx +3 -2
  181. package/src/components/knowledge/knowledge-list.tsx +5 -6
  182. package/src/components/knowledge/knowledge-sheet.tsx +1 -1
  183. package/src/components/layout/daemon-indicator.tsx +3 -2
  184. package/src/components/layout/dashboard-shell.tsx +276 -0
  185. package/src/components/layout/error-boundary.tsx +58 -0
  186. package/src/components/layout/main-content.tsx +20 -0
  187. package/src/components/layout/mobile-drawer.tsx +227 -0
  188. package/src/components/layout/mobile-header.tsx +3 -2
  189. package/src/components/layout/nav-item.tsx +76 -0
  190. package/src/components/layout/sidebar-panel-shell.tsx +43 -0
  191. package/src/components/layout/sidebar-rail.tsx +449 -0
  192. package/src/components/logs/log-list.tsx +2 -2
  193. package/src/components/mcp-servers/mcp-server-list.tsx +5 -4
  194. package/src/components/mcp-servers/mcp-server-sheet.tsx +1 -1
  195. package/src/components/memory/memory-card.tsx +2 -10
  196. package/src/components/memory/memory-detail.tsx +7 -5
  197. package/src/components/memory/memory-graph-view.tsx +1 -1
  198. package/src/components/openclaw/openclaw-deploy-panel.tsx +1 -1
  199. package/src/components/plugins/plugin-list.tsx +7 -12
  200. package/src/components/plugins/plugin-sheet.tsx +1 -1
  201. package/src/components/projects/project-detail.tsx +16 -16
  202. package/src/components/providers/provider-list.tsx +17 -12
  203. package/src/components/providers/provider-sheet.tsx +1 -1
  204. package/src/components/runs/run-list.tsx +5 -11
  205. package/src/components/schedules/schedule-card.tsx +8 -7
  206. package/src/components/schedules/schedule-list.tsx +10 -12
  207. package/src/components/schedules/schedule-sheet.tsx +3 -3
  208. package/src/components/secrets/secret-sheet.tsx +1 -1
  209. package/src/components/secrets/secrets-list.tsx +1 -1
  210. package/src/components/settings/gateway-connection-panel.tsx +1 -1
  211. package/src/components/settings/gateway-disconnect-overlay.tsx +4 -3
  212. package/src/components/shared/agent-switch-dialog.tsx +10 -8
  213. package/src/components/shared/command-palette.tsx +11 -12
  214. package/src/components/shared/confirm-dialog.tsx +12 -11
  215. package/src/components/shared/dir-browser.tsx +9 -14
  216. package/src/components/shared/empty-state.tsx +10 -8
  217. package/src/components/shared/model-combobox.tsx +1 -1
  218. package/src/components/shared/notification-center.tsx +2 -10
  219. package/src/components/shared/profile-sheet.tsx +1 -1
  220. package/src/components/shared/search-dialog.tsx +22 -16
  221. package/src/components/shared/settings-sheet.tsx +1 -1
  222. package/src/components/skills/clawhub-browser.tsx +1 -1
  223. package/src/components/skills/skill-list.tsx +1 -1
  224. package/src/components/skills/skill-sheet.tsx +1 -1
  225. package/src/components/tasks/task-card.tsx +16 -64
  226. package/src/components/tasks/task-list.tsx +5 -6
  227. package/src/components/ui/button.tsx +6 -0
  228. package/src/components/ui/chart-card.tsx +20 -0
  229. package/src/components/ui/filter-pill.tsx +27 -0
  230. package/src/components/ui/info-chip.tsx +43 -0
  231. package/src/components/ui/search-input.tsx +48 -0
  232. package/src/components/ui/section-header.tsx +32 -0
  233. package/src/components/ui/stat-card.tsx +38 -0
  234. package/src/components/ui/status-dot.tsx +37 -0
  235. package/src/components/usage/usage-list.tsx +1 -1
  236. package/src/components/wallets/wallet-approval-dialog.tsx +2 -2
  237. package/src/components/wallets/wallet-panel.tsx +6 -5
  238. package/src/components/wallets/wallet-section.tsx +2 -2
  239. package/src/components/webhooks/webhook-sheet.tsx +1 -1
  240. package/src/hooks/use-app-bootstrap.ts +3 -3
  241. package/src/hooks/use-openclaw-gateway.ts +1 -1
  242. package/src/instrumentation.ts +10 -2
  243. package/src/lib/agent-default-tools.test.ts +3 -3
  244. package/src/lib/agent-default-tools.ts +1 -15
  245. package/src/lib/agent-sandbox-defaults.test.ts +37 -0
  246. package/src/lib/agent-sandbox-defaults.ts +91 -0
  247. package/src/lib/agents.ts +1 -1
  248. package/src/lib/{api-client.ts → app/api-client.ts} +1 -1
  249. package/src/lib/app/navigation.ts +59 -0
  250. package/src/lib/app/view-constants.ts +187 -0
  251. package/src/lib/{chat-streaming-state.ts → chat/chat-streaming-state.ts} +1 -1
  252. package/src/lib/{chat.ts → chat/chat.ts} +2 -2
  253. package/src/lib/{chats.ts → chat/chats.ts} +2 -2
  254. package/src/lib/format-display.ts +73 -0
  255. package/src/lib/memory.ts +1 -1
  256. package/src/lib/{notification-sounds.ts → notifications/notification-sounds.ts} +1 -1
  257. package/src/lib/{notification-utils.test.ts → notifications/notification-utils.test.ts} +1 -1
  258. package/src/lib/{live-tool-events.test.ts → observability/live-tool-events.test.ts} +1 -1
  259. package/src/lib/{local-observability.test.ts → observability/local-observability.test.ts} +1 -1
  260. package/src/lib/{openclaw-agent-id.test.ts → openclaw/openclaw-agent-id.test.ts} +1 -1
  261. package/src/lib/{openclaw-endpoint.test.ts → openclaw/openclaw-endpoint.test.ts} +1 -1
  262. package/src/lib/projects.ts +1 -1
  263. package/src/lib/provider-config.ts +1 -1
  264. package/src/lib/provider-model-discovery-client.ts +1 -1
  265. package/src/lib/providers/claude-cli.ts +1 -1
  266. package/src/lib/providers/codex-cli.ts +1 -1
  267. package/src/lib/providers/openclaw.ts +4 -4
  268. package/src/lib/providers/opencode-cli.ts +1 -1
  269. package/src/lib/{runtime-env.test.ts → runtime/runtime-env.test.ts} +1 -1
  270. package/src/lib/{runtime-loop.ts → runtime/runtime-loop.ts} +2 -2
  271. package/src/lib/sandbox-defaults.ts +17 -0
  272. package/src/lib/{schedules.ts → schedules/schedules.ts} +2 -2
  273. package/src/lib/server/{agent-assignment.test.ts → agents/agent-assignment.test.ts} +1 -1
  274. package/src/lib/server/{agent-assignment.ts → agents/agent-assignment.ts} +1 -1
  275. package/src/lib/server/agents/agent-cascade.ts +228 -0
  276. package/src/lib/server/{agent-registry.ts → agents/agent-registry.ts} +1 -1
  277. package/src/lib/server/{agent-runtime-config.test.ts → agents/agent-runtime-config.test.ts} +2 -2
  278. package/src/lib/server/{agent-runtime-config.ts → agents/agent-runtime-config.ts} +3 -3
  279. package/src/lib/server/{agent-thread-session.test.ts → agents/agent-thread-session.test.ts} +6 -6
  280. package/src/lib/server/{agent-thread-session.ts → agents/agent-thread-session.ts} +6 -6
  281. package/src/lib/server/{assistant-control.test.ts → agents/assistant-control.test.ts} +1 -1
  282. package/src/lib/server/{delegation-jobs-advanced.test.ts → agents/delegation-jobs-advanced.test.ts} +2 -2
  283. package/src/lib/server/{delegation-jobs.test.ts → agents/delegation-jobs.test.ts} +2 -2
  284. package/src/lib/server/{delegation-jobs.ts → agents/delegation-jobs.ts} +2 -2
  285. package/src/lib/server/{main-agent-loop-advanced.test.ts → agents/main-agent-loop-advanced.test.ts} +3 -3
  286. package/src/lib/server/{main-agent-loop.test.ts → agents/main-agent-loop.test.ts} +181 -6
  287. package/src/lib/server/{main-agent-loop.ts → agents/main-agent-loop.ts} +29 -27
  288. package/src/lib/server/{orchestrator-lg.ts → agents/orchestrator-lg.ts} +13 -115
  289. package/src/lib/server/{orchestrator.ts → agents/orchestrator.ts} +8 -8
  290. package/src/lib/server/{subagent-lineage.test.ts → agents/subagent-lineage.test.ts} +3 -3
  291. package/src/lib/server/{subagent-lineage.ts → agents/subagent-lineage.ts} +1 -1
  292. package/src/lib/server/{subagent-runtime.test.ts → agents/subagent-runtime.test.ts} +8 -8
  293. package/src/lib/server/{subagent-runtime.ts → agents/subagent-runtime.ts} +12 -9
  294. package/src/lib/server/{subagent-swarm.test.ts → agents/subagent-swarm.test.ts} +31 -1
  295. package/src/lib/server/{subagent-swarm.ts → agents/subagent-swarm.ts} +22 -5
  296. package/src/lib/server/approvals.test.ts +31 -222
  297. package/src/lib/server/approvals.ts +19 -649
  298. package/src/lib/server/autonomy-runtime.test.ts +4 -5
  299. package/src/lib/server/browser-state.ts +12 -0
  300. package/src/lib/server/build-llm.ts +1 -1
  301. package/src/lib/server/{chat-execution-advanced.test.ts → chat-execution/chat-execution-advanced.test.ts} +26 -3
  302. package/src/lib/server/{chat-execution-connector-delivery.ts → chat-execution/chat-execution-connector-delivery.ts} +1 -1
  303. package/src/lib/server/{chat-execution-disabled.test.ts → chat-execution/chat-execution-disabled.test.ts} +3 -3
  304. package/src/lib/server/{chat-execution-eval-history.test.ts → chat-execution/chat-execution-eval-history.test.ts} +3 -3
  305. package/src/lib/server/{chat-execution-heartbeat.test.ts → chat-execution/chat-execution-heartbeat.test.ts} +10 -21
  306. package/src/lib/server/{chat-execution-session-sync.test.ts → chat-execution/chat-execution-session-sync.test.ts} +4 -4
  307. package/src/lib/server/{chat-execution-tool-events.test.ts → chat-execution/chat-execution-tool-events.test.ts} +1 -1
  308. package/src/lib/server/{chat-execution-utils.test.ts → chat-execution/chat-execution-utils.test.ts} +1 -1
  309. package/src/lib/server/{chat-execution-utils.ts → chat-execution/chat-execution-utils.ts} +3 -3
  310. package/src/lib/server/{chat-execution.ts → chat-execution/chat-execution.ts} +88 -81
  311. package/src/lib/server/{chat-streaming-utils.ts → chat-execution/chat-streaming-utils.ts} +35 -5
  312. package/src/lib/server/{chat-turn-tool-routing.ts → chat-execution/chat-turn-tool-routing.ts} +102 -7
  313. package/src/lib/server/{stream-agent-chat.test.ts → chat-execution/stream-agent-chat.test.ts} +194 -5
  314. package/src/lib/server/{stream-agent-chat.ts → chat-execution/stream-agent-chat.ts} +459 -171
  315. package/src/lib/server/{stream-continuation.ts → chat-execution/stream-continuation.ts} +360 -17
  316. package/src/lib/server/chat-execution/tool-event-tracker.test.ts +36 -0
  317. package/src/lib/server/chat-execution/tool-event-tracker.ts +34 -0
  318. package/src/lib/server/chat-execution/tool-result-guard.ts +99 -0
  319. package/src/lib/server/{chatroom-health.test.ts → chatrooms/chatroom-health.test.ts} +1 -1
  320. package/src/lib/server/{chatroom-health.ts → chatrooms/chatroom-health.ts} +2 -2
  321. package/src/lib/server/{chatroom-helpers.test.ts → chatrooms/chatroom-helpers.test.ts} +1 -1
  322. package/src/lib/server/{chatroom-helpers.ts → chatrooms/chatroom-helpers.ts} +7 -7
  323. package/src/lib/server/{chatroom-orchestration.ts → chatrooms/chatroom-orchestration.ts} +2 -2
  324. package/src/lib/server/{chatroom-session-persistence.test.ts → chatrooms/chatroom-session-persistence.test.ts} +2 -2
  325. package/src/lib/server/{mailbox-utils.ts → chatrooms/mailbox-utils.ts} +2 -2
  326. package/src/lib/server/{session-mailbox.test.ts → chatrooms/session-mailbox.test.ts} +4 -4
  327. package/src/lib/server/{session-mailbox.ts → chatrooms/session-mailbox.ts} +2 -2
  328. package/src/lib/server/connectors/access.ts +3 -24
  329. package/src/lib/server/connectors/commands.ts +1 -1
  330. package/src/lib/server/connectors/manager.test.ts +3 -3
  331. package/src/lib/server/connectors/manager.ts +92 -87
  332. package/src/lib/server/connectors/openclaw.ts +1 -1
  333. package/src/lib/server/connectors/policy.ts +8 -2
  334. package/src/lib/server/connectors/response-media.ts +1 -1
  335. package/src/lib/server/connectors/runtime-state.ts +2 -0
  336. package/src/lib/server/connectors/session-consolidation.ts +46 -0
  337. package/src/lib/server/connectors/session.ts +33 -5
  338. package/src/lib/server/connectors/whatsapp.ts +19 -8
  339. package/src/lib/server/context-manager.test.ts +34 -2
  340. package/src/lib/server/context-manager.ts +131 -16
  341. package/src/lib/server/create-notification.ts +2 -2
  342. package/src/lib/server/eval/agent-regression-advanced.test.ts +6 -9
  343. package/src/lib/server/eval/agent-regression.test.ts +4 -13
  344. package/src/lib/server/eval/agent-regression.ts +5 -19
  345. package/src/lib/server/eval/runner.ts +1 -1
  346. package/src/lib/server/evm-swap.ts +2 -2
  347. package/src/lib/server/integrity-monitor.ts +1 -1
  348. package/src/lib/server/knowledge-db.test.ts +1 -1
  349. package/src/lib/server/langgraph-checkpoint.test.ts +64 -0
  350. package/src/lib/server/langgraph-checkpoint.ts +306 -129
  351. package/src/lib/server/memory/file-watcher.ts +131 -0
  352. package/src/lib/server/{memory-consolidation.ts → memory/memory-consolidation.ts} +2 -2
  353. package/src/lib/server/{memory-db.test.ts → memory/memory-db.test.ts} +2 -2
  354. package/src/lib/server/{memory-db.ts → memory/memory-db.ts} +16 -14
  355. package/src/lib/server/{memory-graph.test.ts → memory/memory-graph.test.ts} +2 -2
  356. package/src/lib/server/{memory-integration.test.ts → memory/memory-integration.test.ts} +6 -6
  357. package/src/lib/server/{memory-policy.test.ts → memory/memory-policy.test.ts} +1 -1
  358. package/src/lib/server/{memory-retrieval.test.ts → memory/memory-retrieval.test.ts} +1 -1
  359. package/src/lib/server/{memory-tiers.test.ts → memory/memory-tiers.test.ts} +1 -1
  360. package/src/lib/server/{session-archive-memory.test.ts → memory/session-archive-memory.test.ts} +1 -1
  361. package/src/lib/server/{session-archive-memory.ts → memory/session-archive-memory.ts} +3 -3
  362. package/src/lib/server/memory/temporal-decay.ts +48 -0
  363. package/src/lib/server/mmr.ts +53 -19
  364. package/src/lib/server/{openclaw-agent-resolver.test.ts → openclaw/agent-resolver.test.ts} +1 -1
  365. package/src/lib/server/{openclaw-agent-resolver.ts → openclaw/agent-resolver.ts} +3 -3
  366. package/src/lib/server/{openclaw-approvals.ts → openclaw/approvals.ts} +1 -1
  367. package/src/lib/server/{openclaw-config-sync.ts → openclaw/config-sync.ts} +1 -1
  368. package/src/lib/server/{openclaw-deploy.test.ts → openclaw/deploy.test.ts} +1 -1
  369. package/src/lib/server/{openclaw-deploy.ts → openclaw/deploy.ts} +4 -4
  370. package/src/lib/server/{openclaw-doctor.ts → openclaw/doctor.ts} +1 -1
  371. package/src/lib/server/{openclaw-exec-config.ts → openclaw/exec-config.ts} +1 -1
  372. package/src/lib/server/{openclaw-gateway.test.ts → openclaw/gateway.test.ts} +2 -2
  373. package/src/lib/server/{openclaw-gateway.ts → openclaw/gateway.ts} +5 -5
  374. package/src/lib/server/{openclaw-health.test.ts → openclaw/health.test.ts} +1 -1
  375. package/src/lib/server/{openclaw-health.ts → openclaw/health.ts} +2 -2
  376. package/src/lib/server/{openclaw-models.ts → openclaw/models.ts} +1 -1
  377. package/src/lib/server/{openclaw-permission-presets.ts → openclaw/permission-presets.ts} +2 -2
  378. package/src/lib/server/{openclaw-skills-normalize.test.ts → openclaw/skills-normalize.test.ts} +1 -1
  379. package/src/lib/server/{openclaw-sync.ts → openclaw/sync.ts} +5 -5
  380. package/src/lib/server/plugins.test.ts +10 -0
  381. package/src/lib/server/{alert-dispatch.ts → runtime/alert-dispatch.ts} +1 -1
  382. package/src/lib/server/runtime/daemon-policy.test.ts +62 -0
  383. package/src/lib/server/{daemon-policy.ts → runtime/daemon-policy.ts} +7 -3
  384. package/src/lib/server/{daemon-state-connectors.test.ts → runtime/daemon-state-connectors.test.ts} +7 -7
  385. package/src/lib/server/{daemon-state.test.ts → runtime/daemon-state.test.ts} +2 -2
  386. package/src/lib/server/{daemon-state.ts → runtime/daemon-state.ts} +29 -78
  387. package/src/lib/server/{devserver-launch.test.ts → runtime/devserver-launch.test.ts} +1 -1
  388. package/src/lib/server/{heartbeat-blocked-suppression.test.ts → runtime/heartbeat-blocked-suppression.test.ts} +1 -1
  389. package/src/lib/server/{heartbeat-service-timer.test.ts → runtime/heartbeat-service-timer.test.ts} +6 -6
  390. package/src/lib/server/{heartbeat-service.test.ts → runtime/heartbeat-service.test.ts} +2 -2
  391. package/src/lib/server/{heartbeat-service.ts → runtime/heartbeat-service.ts} +97 -26
  392. package/src/lib/server/{heartbeat-source.test.ts → runtime/heartbeat-source.test.ts} +1 -1
  393. package/src/lib/server/{heartbeat-wake.test.ts → runtime/heartbeat-wake.test.ts} +1 -1
  394. package/src/lib/server/{heartbeat-wake.ts → runtime/heartbeat-wake.ts} +16 -8
  395. package/src/lib/server/{perf.ts → runtime/perf.ts} +18 -15
  396. package/src/lib/server/runtime/process-manager.test.ts +86 -0
  397. package/src/lib/server/{process-manager.ts → runtime/process-manager.ts} +119 -5
  398. package/src/lib/server/{queue-advanced.test.ts → runtime/queue-advanced.test.ts} +1 -1
  399. package/src/lib/server/{queue-followups.test.ts → runtime/queue-followups.test.ts} +1 -1
  400. package/src/lib/server/{queue-reconcile.test.ts → runtime/queue-reconcile.test.ts} +2 -2
  401. package/src/lib/server/{queue-recovery.test.ts → runtime/queue-recovery.test.ts} +8 -8
  402. package/src/lib/server/{queue.test.ts → runtime/queue.test.ts} +9 -9
  403. package/src/lib/server/{queue.ts → runtime/queue.ts} +16 -16
  404. package/src/lib/server/{runtime-settings.test.ts → runtime/runtime-settings.test.ts} +4 -4
  405. package/src/lib/server/{runtime-settings.ts → runtime/runtime-settings.ts} +2 -2
  406. package/src/lib/server/{runtime-storage-write-paths.test.ts → runtime/runtime-storage-write-paths.test.ts} +5 -15
  407. package/src/lib/server/{scheduler.ts → runtime/scheduler.ts} +22 -12
  408. package/src/lib/server/{session-run-manager.test.ts → runtime/session-run-manager.test.ts} +90 -4
  409. package/src/lib/server/{session-run-manager.ts → runtime/session-run-manager.ts} +143 -17
  410. package/src/lib/server/{wake-dispatcher.test.ts → runtime/wake-dispatcher.test.ts} +2 -2
  411. package/src/lib/server/{wake-dispatcher.ts → runtime/wake-dispatcher.ts} +6 -6
  412. package/src/lib/server/{wake-mode.test.ts → runtime/wake-mode.test.ts} +2 -2
  413. package/src/lib/server/{watch-jobs-advanced.test.ts → runtime/watch-jobs-advanced.test.ts} +5 -5
  414. package/src/lib/server/{watch-jobs.test.ts → runtime/watch-jobs.test.ts} +4 -4
  415. package/src/lib/server/{watch-jobs.ts → runtime/watch-jobs.ts} +5 -5
  416. package/src/lib/server/sandbox/bridge-auth-registry.ts +26 -0
  417. package/src/lib/server/sandbox/browser-bridge.test.ts +56 -0
  418. package/src/lib/server/sandbox/browser-bridge.ts +220 -0
  419. package/src/lib/server/sandbox/browser-runtime.ts +314 -0
  420. package/src/lib/server/sandbox/constants.ts +24 -0
  421. package/src/lib/server/sandbox/docker-detect.ts +44 -0
  422. package/src/lib/server/sandbox/docker.ts +107 -0
  423. package/src/lib/server/sandbox/fs-bridge.test.ts +59 -0
  424. package/src/lib/server/sandbox/fs-bridge.ts +128 -0
  425. package/src/lib/server/sandbox/novnc-auth.test.ts +28 -0
  426. package/src/lib/server/sandbox/novnc-auth.ts +77 -0
  427. package/src/lib/server/sandbox/prune.ts +58 -0
  428. package/src/lib/server/sandbox/registry.test.ts +52 -0
  429. package/src/lib/server/sandbox/registry.ts +110 -0
  430. package/src/lib/server/sandbox/session-runtime.test.ts +71 -0
  431. package/src/lib/server/sandbox/session-runtime.ts +307 -0
  432. package/src/lib/server/{schedule-normalization.test.ts → schedules/schedule-normalization.test.ts} +2 -2
  433. package/src/lib/server/{schedule-normalization.ts → schedules/schedule-normalization.ts} +55 -3
  434. package/src/lib/server/{schedule-service.ts → schedules/schedule-service.ts} +3 -3
  435. package/src/lib/server/session-tools/autonomy-tools.test.ts +10 -8
  436. package/src/lib/server/session-tools/context.ts +41 -0
  437. package/src/lib/server/session-tools/crud.ts +9 -9
  438. package/src/lib/server/session-tools/delegate.ts +11 -1
  439. package/src/lib/server/session-tools/discovery-approvals.test.ts +6 -109
  440. package/src/lib/server/session-tools/discovery.ts +46 -88
  441. package/src/lib/server/session-tools/file-access-policy.ts +129 -0
  442. package/src/lib/server/session-tools/google-workspace.test.ts +153 -0
  443. package/src/lib/server/session-tools/google-workspace.ts +419 -0
  444. package/src/lib/server/session-tools/human-loop.ts +4 -4
  445. package/src/lib/server/session-tools/index.ts +46 -54
  446. package/src/lib/server/session-tools/mailbox.ts +2 -2
  447. package/src/lib/server/session-tools/manage-schedules-advanced.test.ts +8 -8
  448. package/src/lib/server/session-tools/manage-tasks-advanced.test.ts +1 -1
  449. package/src/lib/server/session-tools/memory.ts +4 -4
  450. package/src/lib/server/session-tools/monitor.ts +1 -1
  451. package/src/lib/server/session-tools/normalize-tool-args.ts +1 -1
  452. package/src/lib/server/session-tools/openclaw-nodes.test.ts +1 -1
  453. package/src/lib/server/session-tools/openclaw-nodes.ts +1 -1
  454. package/src/lib/server/session-tools/platform.ts +1 -1
  455. package/src/lib/server/session-tools/plugin-creator.ts +16 -116
  456. package/src/lib/server/session-tools/primitive-tools.test.ts +63 -20
  457. package/src/lib/server/session-tools/sandbox.ts +268 -92
  458. package/src/lib/server/session-tools/schedule.ts +3 -3
  459. package/src/lib/server/session-tools/session-tools-wiring.test.ts +5 -5
  460. package/src/lib/server/session-tools/shell.ts +161 -10
  461. package/src/lib/server/session-tools/subagent.ts +119 -11
  462. package/src/lib/server/session-tools/wallet-tool.test.ts +12 -116
  463. package/src/lib/server/session-tools/wallet.ts +13 -137
  464. package/src/lib/server/session-tools/web-browser-config.test.ts +22 -0
  465. package/src/lib/server/session-tools/web-inputs.test.ts +24 -0
  466. package/src/lib/server/session-tools/web-utils.ts +85 -20
  467. package/src/lib/server/session-tools/web.ts +137 -26
  468. package/src/lib/server/{clawhub-client.test.ts → skills/clawhub-client.test.ts} +9 -9
  469. package/src/lib/server/skills/discovered-skill-prompt.test.ts +62 -0
  470. package/src/lib/server/skills/discovered-skill-prompt.ts +56 -0
  471. package/src/lib/server/skills/skill-discovery.test.ts +16 -0
  472. package/src/lib/server/{skill-discovery.ts → skills/skill-discovery.ts} +10 -5
  473. package/src/lib/server/{skill-eligibility.test.ts → skills/skill-eligibility.test.ts} +1 -1
  474. package/src/lib/server/{skill-prompt-budget.test.ts → skills/skill-prompt-budget.test.ts} +1 -1
  475. package/src/lib/server/{skill-prompt-budget.ts → skills/skill-prompt-budget.ts} +1 -1
  476. package/src/lib/server/{skills-normalize.test.ts → skills/skills-normalize.test.ts} +1 -1
  477. package/src/lib/server/solana.ts +16 -2
  478. package/src/lib/server/storage-item-access.test.ts +36 -0
  479. package/src/lib/server/storage.ts +71 -30
  480. package/src/lib/server/{task-followups.test.ts → tasks/task-followups.test.ts} +3 -3
  481. package/src/lib/server/{task-followups.ts → tasks/task-followups.ts} +5 -5
  482. package/src/lib/server/{task-lifecycle.test.ts → tasks/task-lifecycle.test.ts} +1 -1
  483. package/src/lib/server/{task-lifecycle.ts → tasks/task-lifecycle.ts} +2 -2
  484. package/src/lib/server/{task-mention.test.ts → tasks/task-mention.test.ts} +1 -1
  485. package/src/lib/server/{task-quality-gate.test.ts → tasks/task-quality-gate.test.ts} +1 -1
  486. package/src/lib/server/{task-reports.ts → tasks/task-reports.ts} +1 -1
  487. package/src/lib/server/{task-result.test.ts → tasks/task-result.test.ts} +1 -1
  488. package/src/lib/server/{task-resume.ts → tasks/task-resume.ts} +1 -1
  489. package/src/lib/server/{task-service.test.ts → tasks/task-service.test.ts} +1 -1
  490. package/src/lib/server/{task-service.ts → tasks/task-service.ts} +3 -3
  491. package/src/lib/server/{task-validation.test.ts → tasks/task-validation.test.ts} +1 -1
  492. package/src/lib/server/{task-validation.ts → tasks/task-validation.ts} +2 -2
  493. package/src/lib/server/tool-aliases.ts +1 -0
  494. package/src/lib/server/tool-capability-policy.ts +1 -0
  495. package/src/lib/server/tool-loop-detection.ts +10 -10
  496. package/src/lib/server/tool-planning.test.ts +10 -0
  497. package/src/lib/server/tool-planning.ts +17 -0
  498. package/src/lib/server/universal-tool-access.ts +68 -0
  499. package/src/lib/server/{wallet-execution.test.ts → wallet/wallet-execution.test.ts} +13 -13
  500. package/src/lib/server/{wallet-portfolio.test.ts → wallet/wallet-portfolio.test.ts} +1 -1
  501. package/src/lib/server/{wallet-portfolio.ts → wallet/wallet-portfolio.ts} +21 -8
  502. package/src/lib/server/{wallet-service.test.ts → wallet/wallet-service.test.ts} +1 -1
  503. package/src/lib/server/{wallet-service.ts → wallet/wallet-service.ts} +6 -6
  504. package/src/lib/tasks.ts +1 -1
  505. package/src/lib/time-format.ts +41 -0
  506. package/src/lib/tool-definitions.ts +2 -1
  507. package/src/lib/upload.ts +1 -1
  508. package/src/lib/validation/schemas.test.ts +2 -2
  509. package/src/lib/validation/schemas.ts +39 -1
  510. package/src/lib/{wallet-transactions.test.ts → wallet/wallet-transactions.test.ts} +1 -1
  511. package/src/lib/{wallet.test.ts → wallet/wallet.test.ts} +1 -1
  512. package/src/proxy.ts +1 -1
  513. package/src/stores/slices/agent-slice.ts +13 -14
  514. package/src/stores/slices/auth-slice.ts +1 -1
  515. package/src/stores/slices/data-slice.ts +5 -23
  516. package/src/stores/slices/session-slice.ts +22 -31
  517. package/src/stores/slices/task-slice.ts +1 -1
  518. package/src/stores/slices/ui-slice.ts +1 -1
  519. package/src/stores/use-app-store.test.ts +84 -0
  520. package/src/stores/use-approval-store.ts +1 -1
  521. package/src/stores/use-chat-store.ts +11 -10
  522. package/src/stores/use-chatroom-store.ts +1 -1
  523. package/src/types/index.ts +80 -20
  524. package/src/{components/shared → views}/settings/plugin-manager.tsx +1 -1
  525. package/src/{components/shared → views}/settings/section-capability-policy.tsx +6 -94
  526. package/src/{components/shared → views}/settings/section-embedding.tsx +1 -1
  527. package/src/{components/shared → views}/settings/section-heartbeat.tsx +2 -2
  528. package/src/{components/shared → views}/settings/section-orchestrator.tsx +1 -1
  529. package/src/{components/shared → views}/settings/section-providers.tsx +1 -1
  530. package/src/{components/shared → views}/settings/section-runtime-loop.tsx +15 -1
  531. package/src/{components/shared → views}/settings/section-secrets.tsx +1 -1
  532. package/src/{components/shared → views}/settings/section-storage.tsx +3 -8
  533. package/src/{components/shared → views}/settings/settings-sheet.tsx +3 -2
  534. package/src/{components/shared → views}/settings/storage-browser.tsx +2 -7
  535. package/src/app/api/chats/[id]/fork/route.ts +0 -42
  536. package/src/app/api/chats/[id]/restore/route.ts +0 -35
  537. package/src/app/api/tasks/[id]/approve/route.ts +0 -78
  538. package/src/components/activity/activity-feed.tsx +0 -101
  539. package/src/components/chat/session-approval-card.tsx +0 -80
  540. package/src/components/chat/task-approval-card.tsx +0 -78
  541. package/src/components/home/home-view.tsx +0 -706
  542. package/src/components/layout/app-layout.tsx +0 -1507
  543. package/src/components/tasks/approvals-panel.tsx +0 -673
  544. package/src/components/usage/metrics-dashboard.tsx +0 -598
  545. package/src/hooks/use-view-router.ts +0 -102
  546. package/src/lib/approval-display.test.ts +0 -45
  547. package/src/lib/approval-display.ts +0 -82
  548. package/src/lib/server/approval-connector-notify.test.ts +0 -253
  549. package/src/lib/server/approvals-auto-approve.test.ts +0 -801
  550. package/src/lib/view-routes.test.ts +0 -100
  551. package/src/lib/view-routes.ts +0 -48
  552. /package/src/lib/{api-client.test.ts → app/api-client.test.ts} +0 -0
  553. /package/src/lib/{optimistic.ts → app/optimistic.ts} +0 -0
  554. /package/src/lib/{safe-storage.ts → app/safe-storage.ts} +0 -0
  555. /package/src/lib/{chat-artifact-summary.ts → chat/chat-artifact-summary.ts} +0 -0
  556. /package/src/lib/{chat-display.test.ts → chat/chat-display.test.ts} +0 -0
  557. /package/src/lib/{chat-display.ts → chat/chat-display.ts} +0 -0
  558. /package/src/lib/{chat-streaming-state.test.ts → chat/chat-streaming-state.test.ts} +0 -0
  559. /package/src/lib/{session-summary.test.ts → chat/session-summary.test.ts} +0 -0
  560. /package/src/lib/{session-summary.ts → chat/session-summary.ts} +0 -0
  561. /package/src/lib/{tool-event-summary.test.ts → chat/tool-event-summary.test.ts} +0 -0
  562. /package/src/lib/{tool-event-summary.ts → chat/tool-event-summary.ts} +0 -0
  563. /package/src/lib/{notification-utils.ts → notifications/notification-utils.ts} +0 -0
  564. /package/src/lib/{live-tool-events.ts → observability/live-tool-events.ts} +0 -0
  565. /package/src/lib/{local-observability.ts → observability/local-observability.ts} +0 -0
  566. /package/src/lib/{openclaw-agent-id.ts → openclaw/openclaw-agent-id.ts} +0 -0
  567. /package/src/lib/{openclaw-endpoint.ts → openclaw/openclaw-endpoint.ts} +0 -0
  568. /package/src/lib/{heartbeat-defaults.ts → runtime/heartbeat-defaults.ts} +0 -0
  569. /package/src/lib/{runtime-env.ts → runtime/runtime-env.ts} +0 -0
  570. /package/src/lib/{cron-human.ts → schedules/cron-human.ts} +0 -0
  571. /package/src/lib/{schedule-dedupe-advanced.test.ts → schedules/schedule-dedupe-advanced.test.ts} +0 -0
  572. /package/src/lib/{schedule-dedupe.test.ts → schedules/schedule-dedupe.test.ts} +0 -0
  573. /package/src/lib/{schedule-dedupe.ts → schedules/schedule-dedupe.ts} +0 -0
  574. /package/src/lib/{schedule-name.ts → schedules/schedule-name.ts} +0 -0
  575. /package/src/lib/{schedule-origin.test.ts → schedules/schedule-origin.test.ts} +0 -0
  576. /package/src/lib/{schedule-origin.ts → schedules/schedule-origin.ts} +0 -0
  577. /package/src/lib/{schedule-templates.ts → schedules/schedule-templates.ts} +0 -0
  578. /package/src/lib/server/{agent-availability.ts → agents/agent-availability.ts} +0 -0
  579. /package/src/lib/server/{assistant-control.ts → agents/assistant-control.ts} +0 -0
  580. /package/src/lib/server/{autonomy-contract.ts → agents/autonomy-contract.ts} +0 -0
  581. /package/src/lib/server/{guardian.ts → agents/guardian.ts} +0 -0
  582. /package/src/lib/server/{orchestrator-lg-structure.test.ts → agents/orchestrator-lg-structure.test.ts} +0 -0
  583. /package/src/lib/server/{chat-execution-tool-events.ts → chat-execution/chat-execution-tool-events.ts} +0 -0
  584. /package/src/lib/server/{chatroom-routing.ts → chatrooms/chatroom-routing.ts} +0 -0
  585. /package/src/lib/server/{memory-graph.ts → memory/memory-graph.ts} +0 -0
  586. /package/src/lib/server/{memory-policy.ts → memory/memory-policy.ts} +0 -0
  587. /package/src/lib/server/{memory-tiers.ts → memory/memory-tiers.ts} +0 -0
  588. /package/src/lib/server/{openclaw-history-merge.ts → openclaw/history-merge.ts} +0 -0
  589. /package/src/lib/server/{openclaw-skills-normalize.ts → openclaw/skills-normalize.ts} +0 -0
  590. /package/src/lib/server/{devserver-launch.ts → runtime/devserver-launch.ts} +0 -0
  591. /package/src/lib/server/{heartbeat-source.ts → runtime/heartbeat-source.ts} +0 -0
  592. /package/src/lib/server/{system-events.ts → runtime/system-events.ts} +0 -0
  593. /package/src/lib/server/{wake-mode.ts → runtime/wake-mode.ts} +0 -0
  594. /package/src/lib/server/{clawhub-client.ts → skills/clawhub-client.ts} +0 -0
  595. /package/src/lib/server/{skill-eligibility.ts → skills/skill-eligibility.ts} +0 -0
  596. /package/src/lib/server/{skills-normalize.ts → skills/skills-normalize.ts} +0 -0
  597. /package/src/lib/server/{task-mention.ts → tasks/task-mention.ts} +0 -0
  598. /package/src/lib/server/{task-quality-gate.ts → tasks/task-quality-gate.ts} +0 -0
  599. /package/src/lib/server/{task-result.ts → tasks/task-result.ts} +0 -0
  600. /package/src/lib/{wallet-transactions.ts → wallet/wallet-transactions.ts} +0 -0
  601. /package/src/lib/{wallet.ts → wallet/wallet.ts} +0 -0
  602. /package/src/{components/shared → views}/settings/section-memory.tsx +0 -0
  603. /package/src/{components/shared → views}/settings/section-theme.tsx +0 -0
  604. /package/src/{components/shared → views}/settings/section-user-preferences.tsx +0 -0
  605. /package/src/{components/shared → views}/settings/section-voice.tsx +0 -0
  606. /package/src/{components/shared → views}/settings/section-web-search.tsx +0 -0
  607. /package/src/{components/shared → views}/settings/types.ts +0 -0
  608. /package/src/{components/shared → views}/settings/utils.ts +0 -0
@@ -0,0 +1,29 @@
1
+ FROM debian:bookworm-slim@sha256:98f4b71de414932439ac6ac690d7060df1f27161073c5036a7553723881bffbe
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update \
6
+ && apt-get install -y --no-install-recommends \
7
+ bash \
8
+ ca-certificates \
9
+ chromium \
10
+ curl \
11
+ fonts-liberation \
12
+ fonts-noto-color-emoji \
13
+ novnc \
14
+ socat \
15
+ websockify \
16
+ x11vnc \
17
+ xvfb \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ COPY scripts/sandbox-browser-entrypoint.sh /usr/local/bin/swarmclaw-sandbox-browser
21
+ RUN chmod +x /usr/local/bin/swarmclaw-sandbox-browser
22
+
23
+ RUN useradd --create-home --shell /bin/bash sandbox
24
+ USER sandbox
25
+ WORKDIR /home/sandbox
26
+
27
+ EXPOSE 9222 5900 6080
28
+
29
+ CMD ["swarmclaw-sandbox-browser"]
package/README.md CHANGED
@@ -116,7 +116,7 @@ Skill source and runbook: [`swarmclaw/SKILL.md`](swarmclaw/SKILL.md).
116
116
  - **OpenAI Codex CLI** (optional, for `codex-cli` provider) — [Install](https://github.com/openai/codex)
117
117
  - **OpenCode CLI** (optional, for `opencode-cli` provider) — [Install](https://github.com/opencode-ai/opencode)
118
118
  - **Gemini CLI** (optional, for `delegate` backend `gemini`) — install and authenticate `gemini` on your host
119
- - **Deno** (required for `sandbox_exec`) — auto-installed by `npm run quickstart` / `npm run setup:easy` when missing
119
+ - **Docker Desktop** (optional, recommended) — enables container sandboxes for shell, browser, and `sandbox_exec`; without Docker, SwarmClaw falls back to host execution
120
120
 
121
121
  ## Quick Start
122
122
 
@@ -129,16 +129,21 @@ npm i -g @swarmclawai/swarmclaw
129
129
  pnpm add -g @swarmclawai/swarmclaw
130
130
  yarn global add @swarmclawai/swarmclaw
131
131
  bun add -g @swarmclawai/swarmclaw
132
- swarmclaw
132
+ swarmclaw server
133
133
  ```
134
134
 
135
+ `swarmclaw` by itself opens the CLI. `swarmclaw server` launches the packaged standalone server on `http://localhost:3456`.
136
+ Global install runs `postinstall`, which rebuilds `better-sqlite3` and prepares the sandbox browser image when Docker is available.
137
+ If Docker is not installed yet, SwarmClaw keeps running and falls back to host execution for shell, browser, and `sandbox_exec`.
138
+ No Deno install is required for the local `sandbox_exec` path.
139
+
135
140
  ### One-off run
136
141
 
137
142
  ```bash
138
- npx @swarmclawai/swarmclaw
139
- pnpm dlx @swarmclawai/swarmclaw
140
- yarn dlx @swarmclawai/swarmclaw
141
- bunx @swarmclawai/swarmclaw
143
+ npx @swarmclawai/swarmclaw server
144
+ pnpm dlx @swarmclawai/swarmclaw server
145
+ yarn dlx @swarmclawai/swarmclaw server
146
+ bunx @swarmclawai/swarmclaw server
142
147
  ```
143
148
 
144
149
  ### Install script
@@ -148,7 +153,9 @@ curl -fsSL https://raw.githubusercontent.com/swarmclawai/swarmclaw/main/install.
148
153
  ```
149
154
 
150
155
  The installer resolves the latest stable release tag and installs that version by default.
151
- To pin a version: `SWARMCLAW_VERSION=v0.8.7 curl ... | bash`
156
+ It also builds the production bundle so `npm run start` is ready immediately after install.
157
+ No Deno install is required; local sandbox execution is Docker-first with automatic host Node fallback.
158
+ To pin a version: `SWARMCLAW_VERSION=v0.9.0 curl ... | bash`
152
159
 
153
160
  Or run locally from the repo (friendly for non-technical users):
154
161
 
@@ -160,11 +167,17 @@ npm run quickstart
160
167
 
161
168
  `npm run quickstart` will:
162
169
  - Check Node/npm versions
163
- - Install Deno if the sandbox runtime is missing
164
170
  - Install dependencies
171
+ - Prepare the Docker sandbox/browser runtime when Docker is available
165
172
  - Prepare `.env.local` and `data/`
166
173
  - Start the app at `http://localhost:3456`
167
174
 
175
+ For the packaged production server, use:
176
+
177
+ ```bash
178
+ npm run quickstart:prod
179
+ ```
180
+
168
181
  If you prefer another package manager for local development:
169
182
 
170
183
  ```bash
@@ -173,7 +186,9 @@ yarn install && yarn dev
173
186
  bun install && bun run dev
174
187
  ```
175
188
 
176
- `postinstall` rebuilds `better-sqlite3` natively. If you install with `--ignore-scripts`, run `npm rebuild better-sqlite3` manually.
189
+ `postinstall` rebuilds `better-sqlite3` natively and prepares the sandbox browser image when Docker is available.
190
+ If Docker is missing, SwarmClaw falls back to host execution until Docker is installed.
191
+ If you install with `--ignore-scripts`, run `npm rebuild better-sqlite3` manually and then `node ./scripts/ensure-sandbox-browser-image.mjs`.
177
192
 
178
193
  On first launch, SwarmClaw will:
179
194
  1. Generate an **access key** and display it in the terminal
@@ -374,7 +389,7 @@ Agents can use the following tools when enabled:
374
389
  | Image Generation | Generate images from prompts (`generate_image`) via OpenAI, Stability, Replicate, fal.ai, Together, Fireworks, BFL, or custom endpoints; saved to uploads |
375
390
  | Email | Send outbound email via SMTP (`email`) with `send`/`status` actions |
376
391
  | Calendar | Manage Google/Outlook events (`calendar`) with list/create/update/delete/status actions |
377
- | Sandbox | Run JS/TS in a Deno sandbox when custom code is necessary. If Deno is unavailable it fails closed with guidance; for simple API calls, prefer HTTP Request. |
392
+ | Sandbox | Run JS/TS in a Docker-preferred Node.js sandbox when custom code is necessary. New and existing agents default to sandbox-enabled configs. If Docker is unavailable, SwarmClaw falls back to host execution; for simple API calls, prefer HTTP Request. |
378
393
  | MCP Servers | Connect to external Model Context Protocol servers. Tools from MCP servers are injected as first-class agent tools |
379
394
 
380
395
  ### Platform Tools
@@ -630,6 +645,7 @@ docker compose up -d
630
645
  ```
631
646
 
632
647
  Data is persisted in `data/` and `.env.local` via volume mounts. Updates: `git pull && docker compose up -d --build`.
648
+ In Docker deployments, local shell, browser, and `sandbox_exec` execution fall back to host execution inside the app container unless you separately provide Docker access to that container.
633
649
 
634
650
  For prebuilt images (recommended for non-technical users after releases):
635
651
 
@@ -690,7 +706,7 @@ npm run dev:webpack
690
706
  ### First-Run Helpers
691
707
 
692
708
  ```bash
693
- npm run setup:easy # setup only (installs Deno if missing; does not start server)
709
+ npm run setup:easy # setup only (prepares sandbox/browser runtime when Docker is available; does not start server)
694
710
  npm run quickstart # setup + start dev server
695
711
  npm run quickstart:prod # setup + build + start production server
696
712
  npm run update:easy # safe update helper for local installs
@@ -701,7 +717,7 @@ npm run update:easy # safe update helper for local installs
701
717
  SwarmClaw uses tag-based releases (`vX.Y.Z`) as the stable channel.
702
718
 
703
719
  ```bash
704
- # example patch release (v0.8.7 style)
720
+ # example release
705
721
  npm version patch
706
722
  git push origin main --follow-tags
707
723
  ```
@@ -711,14 +727,15 @@ On `v*` tags, GitHub Actions will:
711
727
  2. Create a GitHub Release
712
728
  3. Build and publish Docker images to `ghcr.io/swarmclawai/swarmclaw` (`:vX.Y.Z`, `:latest`, `:sha-*`)
713
729
 
714
- #### v0.8.7 Release Readiness Notes
730
+ #### v0.9.0 Release Readiness Notes
715
731
 
716
- Before shipping `v0.8.7`, confirm the following user-facing changes are reflected in docs:
732
+ Before shipping `v0.9.0`, confirm the following user-facing changes are reflected in docs:
717
733
 
718
- 1. Install/update docs note that `v0.8.7` repairs the committed npm lockfile so `npm ci` succeeds again on clean GitHub Actions and operator installs.
719
- 2. Site and README install/version strings are updated to `v0.8.7`, including install snippets, release notes index text, and sidebar/footer labels.
720
- 3. Release notes make it explicit that this patch is a packaging/install integrity fix on top of the `v0.8.6` runtime changes, not a new behavior rollout.
721
- 4. The release branch and `main` stay aligned so the shipped tag points at the same commit users see on the default branch.
734
+ 1. Install docs make it explicit that global npm installs use `swarmclaw server`, and that package-manager installs plus the curl installer prepare the sandbox/browser runtime automatically when Docker is available.
735
+ 2. Sandbox docs say local `sandbox_exec` no longer requires Deno, defaults to sandbox-enabled agent configs, and falls back to host Node when Docker is unavailable.
736
+ 3. Release docs mention the OpenClaw-style sandbox/runtime refresh, heartbeat deferral improvements, and the HMR-safe live chat route fix.
737
+ 4. Site and README install/version strings are updated to `v0.9.0`, including pinned install snippets, release notes index text, and sidebar/footer labels.
738
+ 5. The release tag, npm package version, and generated GitHub release install snippet all agree on the non-prefixed npm version (`0.9.0`) versus the git tag (`v0.9.0`).
722
739
 
723
740
  ## CLI
724
741
 
package/bin/update-cmd.js CHANGED
@@ -36,10 +36,32 @@ function getLatestStableTag() {
36
36
  return tags.find((t) => RELEASE_TAG_RE.test(t)) || null
37
37
  }
38
38
 
39
+ function rebuildStandaloneServer(
40
+ execImpl = execFileSync,
41
+ logger = { log, logError },
42
+ ) {
43
+ const serverCmdPath = path.join(PKG_ROOT, 'bin', 'server-cmd.js')
44
+ logger.log('Rebuilding the standalone server bundle...')
45
+ try {
46
+ execImpl(process.execPath, [serverCmdPath, '--build'], {
47
+ cwd: PKG_ROOT,
48
+ stdio: 'inherit',
49
+ timeout: 10 * 60_000,
50
+ })
51
+ logger.log('Standalone server bundle rebuilt.')
52
+ return 0
53
+ } catch (err) {
54
+ logger.logError(`Standalone rebuild failed: ${err.message}`)
55
+ logger.logError('Retry manually with: swarmclaw server --build')
56
+ return 1
57
+ }
58
+ }
59
+
39
60
  function runRegistrySelfUpdate(
40
61
  packageManager = PACKAGE_MANAGER,
41
62
  execImpl = execFileSync,
42
63
  logger = { log, logError },
64
+ rebuildImpl = execFileSync,
43
65
  ) {
44
66
  const update = getGlobalUpdateSpec(packageManager, PACKAGE_NAME)
45
67
  logger.log(`No git checkout detected. Updating the global ${PACKAGE_NAME} install via ${packageManager}...`)
@@ -50,13 +72,17 @@ function runRegistrySelfUpdate(
50
72
  timeout: 120_000,
51
73
  })
52
74
  logger.log(`Global update complete via ${packageManager}.`)
53
- logger.log('Restart the server to apply changes: swarmclaw server stop && swarmclaw server start')
54
- return 0
55
75
  } catch (err) {
56
76
  logger.logError(`Registry update failed: ${err.message}`)
57
77
  logger.logError(`Retry manually with: ${update.display}`)
58
78
  return 1
59
79
  }
80
+
81
+ const rebuildExitCode = rebuildStandaloneServer(rebuildImpl, logger)
82
+ if (rebuildExitCode !== 0) return rebuildExitCode
83
+
84
+ logger.log('Restart the server to apply changes: swarmclaw server stop && swarmclaw server start')
85
+ return 0
60
86
  }
61
87
 
62
88
  function main() {
@@ -3,36 +3,53 @@
3
3
 
4
4
  const test = require('node:test')
5
5
  const assert = require('node:assert/strict')
6
+ const path = require('node:path')
6
7
 
7
8
  const { runRegistrySelfUpdate } = require('./update-cmd.js')
8
9
 
9
- test('runRegistrySelfUpdate executes the manager-specific global update command', () => {
10
+ test('runRegistrySelfUpdate executes the manager-specific global update command and rebuilds the standalone server', () => {
10
11
  const messages = []
11
- let captured = null
12
+ const captured = []
12
13
 
13
14
  const exitCode = runRegistrySelfUpdate(
14
15
  'pnpm',
15
16
  (command, args, options) => {
16
- captured = { command, args, options }
17
+ captured.push({ command, args, options })
17
18
  },
18
19
  {
19
20
  log: (message) => messages.push(`log:${message}`),
20
21
  logError: (message) => messages.push(`err:${message}`),
21
22
  },
23
+ (command, args, options) => {
24
+ captured.push({ command, args, options })
25
+ },
22
26
  )
23
27
 
24
28
  assert.equal(exitCode, 0)
25
- assert.deepEqual(captured, {
26
- command: 'pnpm',
27
- args: ['add', '-g', '@swarmclawai/swarmclaw@latest'],
28
- options: {
29
- cwd: process.cwd(),
30
- stdio: 'inherit',
31
- timeout: 120_000,
32
- },
33
- })
29
+ assert.deepEqual(captured, [
30
+ {
31
+ command: 'pnpm',
32
+ args: ['add', '-g', '@swarmclawai/swarmclaw@latest'],
33
+ options: {
34
+ cwd: process.cwd(),
35
+ stdio: 'inherit',
36
+ timeout: 120_000,
37
+ },
38
+ },
39
+ {
40
+ command: process.execPath,
41
+ args: [path.join(process.cwd(), 'bin', 'server-cmd.js'), '--build'],
42
+ options: {
43
+ cwd: process.cwd(),
44
+ stdio: 'inherit',
45
+ timeout: 600_000,
46
+ },
47
+ },
48
+ ])
34
49
  assert.match(messages.join('\n'), /updating the global @swarmclawai\/swarmclaw install via pnpm/i)
35
50
  assert.match(messages.join('\n'), /global update complete via pnpm/i)
51
+ assert.match(messages.join('\n'), /rebuilding the standalone server bundle/i)
52
+ assert.match(messages.join('\n'), /standalone server bundle rebuilt/i)
36
53
  })
37
54
 
38
55
  test('runRegistrySelfUpdate reports a manual retry command when the registry update fails', () => {
@@ -53,3 +70,23 @@ test('runRegistrySelfUpdate reports a manual retry command when the registry upd
53
70
  assert.match(messages.join('\n'), /registry update failed: spawn bun ENOENT/i)
54
71
  assert.match(messages.join('\n'), /retry manually with: bun add -g @swarmclawai\/swarmclaw@latest/i)
55
72
  })
73
+
74
+ test('runRegistrySelfUpdate reports a manual rebuild command when the rebuild step fails', () => {
75
+ const messages = []
76
+
77
+ const exitCode = runRegistrySelfUpdate(
78
+ 'npm',
79
+ () => {},
80
+ {
81
+ log: (message) => messages.push(`log:${message}`),
82
+ logError: (message) => messages.push(`err:${message}`),
83
+ },
84
+ () => {
85
+ throw new Error('build failed')
86
+ },
87
+ )
88
+
89
+ assert.equal(exitCode, 1)
90
+ assert.match(messages.join('\n'), /standalone rebuild failed: build failed/i)
91
+ assert.match(messages.join('\n'), /retry manually with: swarmclaw server --build/i)
92
+ })
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: google-workspace
3
+ description: Use Google Workspace CLI (`gws`) for Drive, Docs, Sheets, Gmail, Calendar, Chat, and related Workspace API tasks.
4
+ homepage: https://github.com/googleworkspace/cli
5
+ metadata:
6
+ openclaw:
7
+ requires:
8
+ bins: [gws]
9
+ ---
10
+
11
+ # Google Workspace CLI
12
+
13
+ Use `gws` when the task is about Google Workspace resources or Google Workspace API automation.
14
+
15
+ Prefer `gws` over generic HTTP calls when possible because it already knows the Workspace API surface and returns structured JSON by default.
16
+
17
+ ## Rules
18
+
19
+ 1. Start with read/list/get commands before mutating Workspace state.
20
+ 2. Confirm IDs first: document IDs, spreadsheet IDs, file IDs, message IDs, calendar IDs, space IDs.
21
+ 3. Do not run interactive auth flows from an agent tool call. If auth is missing, report that `gws` needs to be configured in plugin settings or via a manual terminal login.
22
+ 4. Keep commands machine-readable. Prefer JSON output and parse it instead of scraping human text.
23
+ 5. For large list operations, limit the scope first, then page or filter.
24
+
25
+ ## Common Commands
26
+
27
+ Check installation and health:
28
+
29
+ ```bash
30
+ gws doctor
31
+ ```
32
+
33
+ Inspect help for a resource or method:
34
+
35
+ ```bash
36
+ gws help
37
+ gws drive help
38
+ gws drive files help
39
+ ```
40
+
41
+ Google Docs:
42
+
43
+ ```bash
44
+ gws docs get --document-id <DOC_ID>
45
+ ```
46
+
47
+ Google Drive:
48
+
49
+ ```bash
50
+ gws drive files list --params '{"pageSize":10}'
51
+ gws drive files get --file-id <FILE_ID>
52
+ ```
53
+
54
+ Google Sheets:
55
+
56
+ ```bash
57
+ gws sheets spreadsheets get --spreadsheet-id <SPREADSHEET_ID>
58
+ ```
59
+
60
+ Gmail:
61
+
62
+ ```bash
63
+ gws gmail users messages list --user-id me --params '{"maxResults":10}'
64
+ gws gmail users messages get --user-id me --message-id <MESSAGE_ID>
65
+ ```
66
+
67
+ Google Calendar:
68
+
69
+ ```bash
70
+ gws calendar events list --calendar-id primary --params '{"maxResults":10,"singleEvents":true}'
71
+ ```
72
+
73
+ Google Chat:
74
+
75
+ ```bash
76
+ gws chat spaces messages list --parent spaces/<SPACE_ID>
77
+ ```
78
+
79
+ ## Tool Usage In SwarmClaw
80
+
81
+ When using the `google_workspace` tool:
82
+
83
+ - Put the `gws` command after the binary into `args`, for example:
84
+ `{"args":["drive","files","list"],"params":{"pageSize":5}}`
85
+ - Use `params` for `--params`
86
+ - Use `jsonInput` for `--json`
87
+ - Use `pageAll: true` when you intentionally want all pages
88
+ - Use `dryRun: true` before risky mutations if you are unsure
89
+
90
+ ## Error Handling
91
+
92
+ - If `gws` is missing: tell the user to install Google Workspace CLI.
93
+ - If auth is missing or expired: tell the user to configure the plugin settings or authenticate `gws` manually.
94
+ - If a command fails because an ID is missing: switch to a list/search command first and find the right ID.
package/next.config.ts CHANGED
@@ -3,7 +3,6 @@ import { execSync } from "child_process";
3
3
  import { networkInterfaces } from "os";
4
4
  import path from "path";
5
5
  import { fileURLToPath } from "url";
6
- import { DIRECT_NAV_SEGMENTS } from "./view-route-paths";
7
6
 
8
7
  const PROJECT_ROOT = path.dirname(fileURLToPath(import.meta.url))
9
8
 
@@ -76,19 +75,6 @@ const nextConfig: NextConfig = {
76
75
  'qrcode',
77
76
  ],
78
77
  allowedDevOrigins: getAllowedDevOrigins(),
79
- async rewrites() {
80
- const views = DIRECT_NAV_SEGMENTS.join('|')
81
- return [
82
- {
83
- source: `/:view(${views})`,
84
- destination: '/',
85
- },
86
- {
87
- source: `/:view(${views})/:id`,
88
- destination: '/',
89
- },
90
- ]
91
- },
92
78
  };
93
79
 
94
80
  export default nextConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmclawai/swarmclaw",
3
- "version": "0.8.8",
3
+ "version": "0.9.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
  "publishConfig": {
@@ -29,9 +29,15 @@
29
29
  },
30
30
  "files": [
31
31
  "bin/",
32
+ "bundled-skills/",
32
33
  "src/",
33
34
  "public/",
35
+ "Dockerfile.sandbox-browser",
36
+ "scripts/easy-setup.mjs",
37
+ "scripts/easy-update.mjs",
38
+ "scripts/ensure-sandbox-browser-image.mjs",
34
39
  "scripts/postinstall.mjs",
40
+ "scripts/sandbox-browser-entrypoint.sh",
35
41
  "next.config.ts",
36
42
  "tsconfig.json",
37
43
  "postcss.config.mjs",
@@ -42,15 +48,16 @@
42
48
  "quickstart": "node ./scripts/easy-setup.mjs --start",
43
49
  "quickstart:prod": "node ./scripts/easy-setup.mjs --prod",
44
50
  "update:easy": "node ./scripts/easy-update.mjs",
45
- "dev": "next dev --webpack --hostname 0.0.0.0 -p 3456",
51
+ "dev": "next dev --turbopack --hostname 0.0.0.0 -p 3456",
46
52
  "dev:webpack": "next dev --webpack --hostname 0.0.0.0 -p 3456",
47
- "dev:clean": "rm -rf .next && next dev --hostname 0.0.0.0 -p 3456",
53
+ "dev:clean": "rm -rf .next && next dev --turbopack --hostname 0.0.0.0 -p 3456",
48
54
  "build": "next build",
49
55
  "build:ci": "NEXT_DISABLE_ESLINT=1 next build",
50
56
  "start": "node .next/standalone/server.js",
51
57
  "start:standalone": "node .next/standalone/server.js",
52
58
  "smoke:browser": "node ./scripts/browser-route-smoke.mjs",
53
59
  "smoke:browser:workbench": "node ./scripts/browser-workbench-smoke.mjs",
60
+ "sandbox:build:browser": "docker build -f Dockerfile.sandbox-browser -t swarmclaw-sandbox-browser:bookworm-slim .",
54
61
  "benchmark:autonomy": "node ./scripts/benchmark-autonomy-harness.mjs",
55
62
  "benchmark:agent-regression": "node --import tsx ./scripts/run-agent-regression-suite.ts",
56
63
  "lint": "eslint",
@@ -59,15 +66,15 @@
59
66
  "lint:baseline:update": "node ./scripts/lint-baseline.mjs update",
60
67
  "cli": "node ./bin/swarmclaw.js",
61
68
  "test:cli": "node --test src/cli/*.test.js bin/*.test.js",
62
- "test:openclaw": "tsx --test src/lib/openclaw-agent-id.test.ts src/lib/openclaw-endpoint.test.ts src/lib/server/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/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/task-quality-gate.test.ts src/lib/server/task-validation.test.ts src/lib/server/tool-capability-policy.test.ts",
69
+ "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/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/tasks/task-quality-gate.test.ts src/lib/server/tasks/task-validation.test.ts src/lib/server/tool-capability-policy.test.ts",
63
70
  "test:mcp:conformance": "node --import tsx ./scripts/mcp-conformance-check.ts",
64
71
  "postinstall": "node ./scripts/postinstall.mjs"
65
72
  },
66
73
  "dependencies": {
67
74
  "@huggingface/transformers": "^3.8.1",
68
75
  "@langchain/anthropic": "^1.3.18",
69
- "@langchain/core": "^1.1.26",
70
- "@langchain/langgraph": "^1.1.5",
76
+ "@langchain/core": "^1.1.31",
77
+ "@langchain/langgraph": "^1.2.2",
71
78
  "@langchain/openai": "^1.2.8",
72
79
  "@multiavatar/multiavatar": "^1.0.7",
73
80
  "@playwright/mcp": "^0.0.68",
@@ -88,6 +95,7 @@
88
95
  "grammy": "^1.40.0",
89
96
  "highlight.js": "^11.11.1",
90
97
  "imapflow": "^1.2.11",
98
+ "langchain": "^1.2.30",
91
99
  "lucide-react": "^0.574.0",
92
100
  "mailparser": "^3.9.3",
93
101
  "next": "16.1.6",
@@ -133,6 +141,8 @@
133
141
  "optionalDependencies": {
134
142
  "botbuilder": "^4.23.3",
135
143
  "googleapis": "^171.4.0",
136
- "matrix-bot-sdk": "^0.8.0"
144
+ "matrix-bot-sdk": "^0.8.0",
145
+ "opusscript": "0.0.8",
146
+ "utf-8-validate": "5.0.10"
137
147
  }
138
148
  }
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from 'node:fs'
4
+ import path from 'node:path'
5
+ import { spawnSync } from 'node:child_process'
6
+
7
+ const args = new Set(process.argv.slice(2))
8
+ const startAfterSetup = args.has('--start') || args.has('--prod')
9
+ const productionMode = args.has('--prod')
10
+ const skipInstall = args.has('--skip-install')
11
+ const cwd = process.cwd()
12
+
13
+ function log(message) {
14
+ process.stdout.write(`[setup] ${message}\n`)
15
+ }
16
+
17
+ function fail(message, code = 1) {
18
+ process.stderr.write(`[setup] ERROR: ${message}\n`)
19
+ process.exit(code)
20
+ }
21
+
22
+ function run(command, commandArgs, options = {}) {
23
+ const printable = `${command} ${commandArgs.join(' ')}`.trim()
24
+ log(`$ ${printable}`)
25
+ const result = spawnSync(command, commandArgs, {
26
+ cwd,
27
+ stdio: 'inherit',
28
+ ...options,
29
+ })
30
+ if (result.error) fail(result.error.message)
31
+ if ((result.status ?? 1) !== 0) {
32
+ fail(`Command failed: ${printable}`, result.status ?? 1)
33
+ }
34
+ }
35
+
36
+ function runOptional(command, commandArgs, options = {}) {
37
+ const printable = `${command} ${commandArgs.join(' ')}`.trim()
38
+ log(`$ ${printable}`)
39
+ const result = spawnSync(command, commandArgs, {
40
+ cwd,
41
+ stdio: 'inherit',
42
+ ...options,
43
+ })
44
+ if (result.error || (result.status ?? 1) !== 0) {
45
+ log(`Optional step failed: ${printable}`)
46
+ return false
47
+ }
48
+ return true
49
+ }
50
+
51
+ function ensureNodeVersion() {
52
+ const version = process.versions.node
53
+ const [majorRaw, minorRaw] = version.split('.')
54
+ const major = Number.parseInt(majorRaw || '0', 10)
55
+ const minor = Number.parseInt(minorRaw || '0', 10)
56
+ if (major < 22 || (major === 22 && minor < 6)) {
57
+ fail(`Detected Node ${version}. SwarmClaw requires Node 22.6 or newer.`)
58
+ }
59
+ log(`Node ${version} detected.`)
60
+ }
61
+
62
+ function ensureNpm() {
63
+ const result = spawnSync('npm', ['--version'], { cwd, encoding: 'utf8' })
64
+ if (result.error || (result.status ?? 1) !== 0) {
65
+ fail('npm was not found. Install npm and rerun this setup command.')
66
+ }
67
+ log(`npm ${String(result.stdout || '').trim()} detected.`)
68
+ }
69
+
70
+ function commandExists(name) {
71
+ const lookup = process.platform === 'win32' ? 'where' : 'which'
72
+ const result = spawnSync(lookup, [name], { cwd, encoding: 'utf8' })
73
+ return !result.error && (result.status ?? 1) === 0
74
+ }
75
+
76
+ function ensureProjectRoot() {
77
+ const pkgPath = path.join(cwd, 'package.json')
78
+ if (!fs.existsSync(pkgPath)) {
79
+ fail(`package.json was not found in ${cwd}. Run this command from the SwarmClaw project root.`)
80
+ }
81
+ }
82
+
83
+ function ensureEnvFile() {
84
+ const envPath = path.join(cwd, '.env.local')
85
+ if (!fs.existsSync(envPath)) {
86
+ fs.writeFileSync(
87
+ envPath,
88
+ '# SwarmClaw local environment variables\n# ACCESS_KEY and CREDENTIAL_SECRET are auto-generated on first app run.\n',
89
+ 'utf8',
90
+ )
91
+ log('Created .env.local.')
92
+ } else {
93
+ log('.env.local already exists.')
94
+ }
95
+ }
96
+
97
+ function ensureDataDir() {
98
+ const dataDir = path.join(cwd, 'data')
99
+ fs.mkdirSync(dataDir, { recursive: true })
100
+ log(`Data directory ready at ${dataDir}.`)
101
+ }
102
+
103
+ function printNextSteps() {
104
+ process.stdout.write('\n')
105
+ log('Setup complete.')
106
+ process.stdout.write('\n')
107
+ process.stdout.write('Next steps:\n')
108
+ process.stdout.write('1. Run `npm run dev`.\n')
109
+ process.stdout.write('2. Open http://localhost:3456 in your browser.\n')
110
+ process.stdout.write('3. Copy the access key printed in the terminal and finish the setup wizard.\n')
111
+ process.stdout.write(' Or run `npx swarmclaw setup init` for interactive CLI setup.\n')
112
+ process.stdout.write('4. For updates later, run `npm run update:easy`.\n')
113
+ }
114
+
115
+ function main() {
116
+ ensureProjectRoot()
117
+ ensureNodeVersion()
118
+ ensureNpm()
119
+ ensureDataDir()
120
+ ensureEnvFile()
121
+
122
+ if (!skipInstall) {
123
+ run('npm', ['install'])
124
+ } else {
125
+ log('Skipping dependency install (--skip-install).')
126
+ }
127
+
128
+ runOptional('node', ['./scripts/ensure-sandbox-browser-image.mjs'])
129
+ if (!commandExists('docker')) {
130
+ log('Docker not detected. SwarmClaw will fall back to host execution until Docker Desktop is installed.')
131
+ }
132
+
133
+ if (productionMode) {
134
+ run('npm', ['run', 'build'])
135
+ }
136
+
137
+ if (startAfterSetup) {
138
+ run('npm', ['run', productionMode ? 'start' : 'dev'])
139
+ return
140
+ }
141
+
142
+ printNextSteps()
143
+ }
144
+
145
+ main()