@swarmclawai/swarmclaw 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -13
- package/bin/update-cmd.js +28 -2
- package/bin/update-cmd.test.js +49 -12
- package/bundled-skills/google-workspace/SKILL.md +94 -0
- package/next.config.ts +0 -14
- package/package.json +11 -7
- package/src/app/activity/page.tsx +96 -0
- package/src/app/agents/[id]/page.tsx +43 -0
- package/src/app/agents/layout.tsx +40 -0
- package/src/app/agents/page.tsx +34 -0
- package/src/app/api/agents/[id]/route.ts +14 -3
- package/src/app/api/agents/[id]/thread/route.ts +2 -2
- package/src/app/api/agents/route.ts +3 -3
- package/src/app/api/agents/trash/route.ts +14 -1
- package/src/app/api/approvals/route.test.ts +24 -46
- package/src/app/api/approvals/route.ts +9 -1
- package/src/app/api/auth/route.ts +2 -2
- package/src/app/api/chatrooms/[id]/chat/route.test.ts +2 -2
- package/src/app/api/chatrooms/[id]/chat/route.ts +7 -7
- package/src/app/api/chatrooms/[id]/moderate/route.ts +1 -1
- package/src/app/api/chats/[id]/chat/route.test.ts +5 -5
- package/src/app/api/chats/[id]/chat/route.ts +1 -1
- package/src/app/api/chats/[id]/checkpoints/route.ts +8 -3
- package/src/app/api/chats/[id]/devserver/route.ts +1 -1
- package/src/app/api/chats/[id]/mailbox/route.ts +1 -1
- package/src/app/api/chats/[id]/messages/route.ts +2 -2
- package/src/app/api/chats/[id]/route.ts +3 -3
- package/src/app/api/chats/[id]/stop/route.ts +2 -2
- package/src/app/api/chats/heartbeat/route.ts +2 -2
- package/src/app/api/chats/route.ts +8 -8
- package/src/app/api/clawhub/install/route.ts +2 -2
- package/src/app/api/clawhub/search/route.ts +1 -1
- package/src/app/api/connectors/[id]/route.ts +1 -1
- package/src/app/api/connectors/route.ts +2 -2
- package/src/app/api/daemon/health-check/route.ts +1 -1
- package/src/app/api/daemon/route.ts +3 -3
- package/src/app/api/gateways/[id]/health/route.ts +2 -2
- package/src/app/api/gateways/[id]/route.ts +1 -1
- package/src/app/api/gateways/route.ts +2 -2
- package/src/app/api/knowledge/[id]/route.ts +1 -1
- package/src/app/api/knowledge/route.ts +1 -1
- package/src/app/api/memory/[id]/route.ts +2 -2
- package/src/app/api/memory/graph/route.ts +1 -1
- package/src/app/api/memory/maintenance/route.ts +2 -2
- package/src/app/api/memory/route.ts +2 -2
- package/src/app/api/notifications/route.ts +1 -1
- package/src/app/api/openclaw/agent-files/route.ts +2 -2
- package/src/app/api/openclaw/approvals/route.ts +1 -1
- package/src/app/api/openclaw/config-sync/route.ts +1 -1
- package/src/app/api/openclaw/cron/route.ts +1 -1
- package/src/app/api/openclaw/deploy/route.ts +1 -1
- package/src/app/api/openclaw/discover/route.ts +1 -1
- package/src/app/api/openclaw/doctor/route.ts +1 -1
- package/src/app/api/openclaw/dotenv-keys/route.ts +1 -1
- package/src/app/api/openclaw/exec-config/route.ts +1 -1
- package/src/app/api/openclaw/gateway/route.ts +1 -1
- package/src/app/api/openclaw/history/route.ts +2 -2
- package/src/app/api/openclaw/media/route.ts +1 -1
- package/src/app/api/openclaw/models/route.ts +1 -1
- package/src/app/api/openclaw/permissions/route.ts +2 -2
- package/src/app/api/openclaw/sandbox-env/route.ts +1 -1
- package/src/app/api/openclaw/skills/install/route.ts +1 -1
- package/src/app/api/openclaw/skills/remove/route.ts +1 -1
- package/src/app/api/openclaw/skills/route.ts +3 -3
- package/src/app/api/openclaw/sync/route.ts +1 -1
- package/src/app/api/orchestrator/run/route.ts +2 -2
- package/src/app/api/perf/route.ts +1 -1
- package/src/app/api/plugins/marketplace/route.ts +1 -1
- package/src/app/api/preview-server/route.ts +1 -1
- package/src/app/api/providers/openclaw/health/route.ts +1 -1
- package/src/app/api/runs/[id]/route.ts +1 -1
- package/src/app/api/runs/route.ts +1 -1
- package/src/app/api/schedules/[id]/route.ts +1 -1
- package/src/app/api/schedules/[id]/run/route.ts +5 -5
- package/src/app/api/schedules/route.ts +2 -2
- package/src/app/api/settings/route.ts +10 -3
- package/src/app/api/setup/doctor/route.ts +43 -0
- package/src/app/api/skills/[id]/route.ts +1 -1
- package/src/app/api/skills/import/route.ts +1 -1
- package/src/app/api/skills/route.ts +1 -1
- package/src/app/api/tasks/[id]/route.ts +5 -5
- package/src/app/api/tasks/bulk/route.ts +2 -2
- package/src/app/api/tasks/route.ts +5 -5
- package/src/app/api/wallets/[id]/approve/route.ts +2 -2
- package/src/app/api/wallets/[id]/route.ts +3 -3
- package/src/app/api/wallets/[id]/send/route.ts +2 -2
- package/src/app/api/wallets/route.ts +2 -2
- package/src/app/api/webhooks/[id]/route.ts +4 -4
- package/src/app/chatrooms/page.tsx +36 -0
- package/src/app/connectors/layout.tsx +21 -0
- package/src/app/connectors/page.tsx +27 -0
- package/src/app/home/page.tsx +650 -0
- package/src/app/knowledge/layout.tsx +21 -0
- package/src/app/knowledge/page.tsx +27 -0
- package/src/app/layout.tsx +4 -1
- package/src/app/login/page.tsx +9 -0
- package/src/app/logs/layout.tsx +16 -0
- package/src/app/logs/page.tsx +16 -0
- package/src/app/mcp-servers/layout.tsx +21 -0
- package/src/app/mcp-servers/page.tsx +27 -0
- package/src/app/memory/layout.tsx +21 -0
- package/src/{components/memory/memory-browser.tsx → app/memory/page.tsx} +13 -27
- package/src/app/page.tsx +3 -108
- package/src/app/plugins/layout.tsx +21 -0
- package/src/app/plugins/page.tsx +27 -0
- package/src/app/projects/page.tsx +18 -0
- package/src/app/providers/layout.tsx +21 -0
- package/src/app/providers/page.tsx +27 -0
- package/src/app/runs/layout.tsx +16 -0
- package/src/app/runs/page.tsx +16 -0
- package/src/app/schedules/layout.tsx +21 -0
- package/src/app/schedules/page.tsx +27 -0
- package/src/app/secrets/layout.tsx +21 -0
- package/src/app/secrets/page.tsx +27 -0
- package/src/{components/shared/settings/settings-page.tsx → app/settings/page.tsx} +122 -124
- package/src/app/setup/page.tsx +17 -0
- package/src/app/skills/layout.tsx +21 -0
- package/src/app/skills/page.tsx +27 -0
- package/src/app/tasks/layout.tsx +21 -0
- package/src/{components/tasks/task-board.tsx → app/tasks/page.tsx} +13 -20
- package/src/app/usage/page.tsx +557 -0
- package/src/app/user/page.tsx +7 -0
- package/src/app/wallets/page.tsx +12 -0
- package/src/app/webhooks/layout.tsx +21 -0
- package/src/app/webhooks/page.tsx +27 -0
- package/src/cli/index.js +5 -5
- package/src/cli/spec.js +7 -1
- package/src/components/agents/agent-card.tsx +6 -5
- package/src/components/agents/agent-chat-list.tsx +13 -14
- package/src/components/agents/agent-files-editor.tsx +1 -1
- package/src/components/agents/agent-list.tsx +2 -3
- package/src/components/agents/agent-sheet.tsx +32 -13
- package/src/components/agents/cron-job-form.tsx +1 -1
- package/src/components/agents/exec-config-panel.tsx +1 -1
- package/src/components/agents/inspector-panel.tsx +123 -7
- package/src/components/agents/openclaw-skills-panel.tsx +1 -1
- package/src/components/agents/permission-preset-selector.tsx +1 -1
- package/src/components/agents/personality-builder.tsx +1 -1
- package/src/components/agents/sandbox-env-panel.tsx +1 -1
- package/src/components/agents/skill-install-dialog.tsx +1 -1
- package/src/components/agents/soul-library-picker.tsx +1 -1
- package/src/components/agents/trash-list.tsx +1 -1
- package/src/components/auth/access-key-gate.tsx +1 -1
- package/src/components/auth/setup-wizard.tsx +1 -1
- package/src/components/auth/user-picker.tsx +1 -1
- package/src/components/canvas/canvas-panel.tsx +1 -1
- package/src/components/chat/chat-area.tsx +23 -21
- package/src/components/chat/chat-card.tsx +5 -14
- package/src/components/chat/chat-header.tsx +30 -31
- package/src/components/chat/chat-list.tsx +12 -10
- package/src/components/chat/chat-tool-toggles.tsx +1 -1
- package/src/components/chat/checkpoint-timeline.tsx +10 -58
- package/src/components/chat/delegation-banner.tsx +1 -1
- package/src/components/chat/file-path-chip.tsx +1 -1
- package/src/components/chat/heartbeat-history-panel.tsx +3 -2
- package/src/components/chat/message-bubble.tsx +29 -147
- package/src/components/chat/message-list.tsx +7 -46
- package/src/components/chat/session-debug-panel.tsx +7 -11
- package/src/components/chat/streaming-bubble.tsx +3 -256
- package/src/components/chat/swarm-panel.tsx +4 -8
- package/src/components/chat/tool-call-bubble.tsx +27 -5
- package/src/components/chat/tool-events-section.tsx +259 -0
- package/src/components/chat/tool-request-banner.tsx +3 -20
- package/src/components/chatrooms/agent-hover-card.tsx +4 -3
- package/src/components/chatrooms/chatroom-input.tsx +1 -1
- package/src/components/chatrooms/chatroom-message.tsx +3 -5
- package/src/components/chatrooms/chatroom-tool-request-banner.tsx +1 -1
- package/src/components/chatrooms/chatroom-view.tsx +8 -6
- package/src/components/connectors/connector-health.tsx +1 -1
- package/src/components/connectors/connector-list.tsx +11 -9
- package/src/components/connectors/connector-sheet.tsx +1 -1
- package/src/components/gateways/gateway-sheet.tsx +1 -1
- package/src/components/input/chat-input.tsx +3 -2
- package/src/components/knowledge/knowledge-list.tsx +5 -6
- package/src/components/knowledge/knowledge-sheet.tsx +1 -1
- package/src/components/layout/daemon-indicator.tsx +3 -2
- package/src/components/layout/dashboard-shell.tsx +276 -0
- package/src/components/layout/error-boundary.tsx +58 -0
- package/src/components/layout/main-content.tsx +20 -0
- package/src/components/layout/mobile-drawer.tsx +227 -0
- package/src/components/layout/mobile-header.tsx +3 -2
- package/src/components/layout/nav-item.tsx +76 -0
- package/src/components/layout/sidebar-panel-shell.tsx +43 -0
- package/src/components/layout/sidebar-rail.tsx +449 -0
- package/src/components/logs/log-list.tsx +2 -2
- package/src/components/mcp-servers/mcp-server-list.tsx +5 -4
- package/src/components/mcp-servers/mcp-server-sheet.tsx +1 -1
- package/src/components/memory/memory-card.tsx +2 -10
- package/src/components/memory/memory-detail.tsx +7 -5
- package/src/components/memory/memory-graph-view.tsx +1 -1
- package/src/components/openclaw/openclaw-deploy-panel.tsx +1 -1
- package/src/components/plugins/plugin-list.tsx +7 -12
- package/src/components/plugins/plugin-sheet.tsx +1 -1
- package/src/components/projects/project-detail.tsx +16 -16
- package/src/components/providers/provider-list.tsx +17 -12
- package/src/components/providers/provider-sheet.tsx +1 -1
- package/src/components/runs/run-list.tsx +5 -11
- package/src/components/schedules/schedule-card.tsx +8 -7
- package/src/components/schedules/schedule-list.tsx +10 -12
- package/src/components/schedules/schedule-sheet.tsx +3 -3
- package/src/components/secrets/secret-sheet.tsx +1 -1
- package/src/components/secrets/secrets-list.tsx +1 -1
- package/src/components/settings/gateway-connection-panel.tsx +1 -1
- package/src/components/settings/gateway-disconnect-overlay.tsx +4 -3
- package/src/components/shared/agent-switch-dialog.tsx +10 -8
- package/src/components/shared/command-palette.tsx +11 -12
- package/src/components/shared/confirm-dialog.tsx +12 -11
- package/src/components/shared/dir-browser.tsx +9 -14
- package/src/components/shared/empty-state.tsx +10 -8
- package/src/components/shared/model-combobox.tsx +1 -1
- package/src/components/shared/notification-center.tsx +2 -10
- package/src/components/shared/profile-sheet.tsx +1 -1
- package/src/components/shared/search-dialog.tsx +22 -16
- package/src/components/shared/settings-sheet.tsx +1 -1
- package/src/components/skills/clawhub-browser.tsx +1 -1
- package/src/components/skills/skill-list.tsx +1 -1
- package/src/components/skills/skill-sheet.tsx +1 -1
- package/src/components/tasks/task-card.tsx +16 -64
- package/src/components/tasks/task-list.tsx +5 -6
- package/src/components/ui/button.tsx +6 -0
- package/src/components/ui/chart-card.tsx +20 -0
- package/src/components/ui/filter-pill.tsx +27 -0
- package/src/components/ui/info-chip.tsx +43 -0
- package/src/components/ui/search-input.tsx +48 -0
- package/src/components/ui/section-header.tsx +32 -0
- package/src/components/ui/stat-card.tsx +38 -0
- package/src/components/ui/status-dot.tsx +37 -0
- package/src/components/usage/usage-list.tsx +1 -1
- package/src/components/wallets/wallet-approval-dialog.tsx +2 -2
- package/src/components/wallets/wallet-panel.tsx +6 -5
- package/src/components/wallets/wallet-section.tsx +2 -2
- package/src/components/webhooks/webhook-sheet.tsx +1 -1
- package/src/hooks/use-app-bootstrap.ts +3 -3
- package/src/hooks/use-openclaw-gateway.ts +1 -1
- package/src/instrumentation.ts +10 -2
- package/src/lib/agent-default-tools.test.ts +3 -3
- package/src/lib/agent-default-tools.ts +1 -15
- package/src/lib/agents.ts +1 -1
- package/src/lib/{api-client.ts → app/api-client.ts} +1 -1
- package/src/lib/app/navigation.ts +59 -0
- package/src/lib/app/view-constants.ts +187 -0
- package/src/lib/{chat-streaming-state.ts → chat/chat-streaming-state.ts} +1 -1
- package/src/lib/{chat.ts → chat/chat.ts} +2 -2
- package/src/lib/{chats.ts → chat/chats.ts} +2 -2
- package/src/lib/format-display.ts +73 -0
- package/src/lib/memory.ts +1 -1
- package/src/lib/{notification-sounds.ts → notifications/notification-sounds.ts} +1 -1
- package/src/lib/{notification-utils.test.ts → notifications/notification-utils.test.ts} +1 -1
- package/src/lib/{live-tool-events.test.ts → observability/live-tool-events.test.ts} +1 -1
- package/src/lib/{local-observability.test.ts → observability/local-observability.test.ts} +1 -1
- package/src/lib/{openclaw-agent-id.test.ts → openclaw/openclaw-agent-id.test.ts} +1 -1
- package/src/lib/{openclaw-endpoint.test.ts → openclaw/openclaw-endpoint.test.ts} +1 -1
- package/src/lib/projects.ts +1 -1
- package/src/lib/provider-config.ts +1 -1
- package/src/lib/provider-model-discovery-client.ts +1 -1
- package/src/lib/providers/claude-cli.ts +1 -1
- package/src/lib/providers/codex-cli.ts +1 -1
- package/src/lib/providers/openclaw.ts +4 -4
- package/src/lib/providers/opencode-cli.ts +1 -1
- package/src/lib/{runtime-env.test.ts → runtime/runtime-env.test.ts} +1 -1
- package/src/lib/{runtime-loop.ts → runtime/runtime-loop.ts} +2 -2
- package/src/lib/{schedules.ts → schedules/schedules.ts} +2 -2
- package/src/lib/server/{agent-assignment.test.ts → agents/agent-assignment.test.ts} +1 -1
- package/src/lib/server/{agent-assignment.ts → agents/agent-assignment.ts} +1 -1
- package/src/lib/server/agents/agent-cascade.ts +228 -0
- package/src/lib/server/{agent-registry.ts → agents/agent-registry.ts} +1 -1
- package/src/lib/server/{agent-runtime-config.test.ts → agents/agent-runtime-config.test.ts} +2 -2
- package/src/lib/server/{agent-runtime-config.ts → agents/agent-runtime-config.ts} +3 -3
- package/src/lib/server/{agent-thread-session.test.ts → agents/agent-thread-session.test.ts} +6 -6
- package/src/lib/server/{agent-thread-session.ts → agents/agent-thread-session.ts} +6 -6
- package/src/lib/server/{assistant-control.test.ts → agents/assistant-control.test.ts} +1 -1
- package/src/lib/server/{delegation-jobs-advanced.test.ts → agents/delegation-jobs-advanced.test.ts} +2 -2
- package/src/lib/server/{delegation-jobs.test.ts → agents/delegation-jobs.test.ts} +2 -2
- package/src/lib/server/{delegation-jobs.ts → agents/delegation-jobs.ts} +2 -2
- package/src/lib/server/{main-agent-loop-advanced.test.ts → agents/main-agent-loop-advanced.test.ts} +3 -3
- package/src/lib/server/{main-agent-loop.test.ts → agents/main-agent-loop.test.ts} +6 -6
- package/src/lib/server/{main-agent-loop.ts → agents/main-agent-loop.ts} +3 -3
- package/src/lib/server/{orchestrator-lg.ts → agents/orchestrator-lg.ts} +13 -115
- package/src/lib/server/{orchestrator.ts → agents/orchestrator.ts} +8 -8
- package/src/lib/server/{subagent-lineage.test.ts → agents/subagent-lineage.test.ts} +3 -3
- package/src/lib/server/{subagent-lineage.ts → agents/subagent-lineage.ts} +1 -1
- package/src/lib/server/{subagent-runtime.test.ts → agents/subagent-runtime.test.ts} +8 -8
- package/src/lib/server/{subagent-runtime.ts → agents/subagent-runtime.ts} +12 -9
- package/src/lib/server/{subagent-swarm.test.ts → agents/subagent-swarm.test.ts} +31 -1
- package/src/lib/server/{subagent-swarm.ts → agents/subagent-swarm.ts} +22 -5
- package/src/lib/server/approvals.test.ts +31 -222
- package/src/lib/server/approvals.ts +19 -649
- package/src/lib/server/autonomy-runtime.test.ts +4 -5
- package/src/lib/server/build-llm.ts +1 -1
- package/src/lib/server/{chat-execution-advanced.test.ts → chat-execution/chat-execution-advanced.test.ts} +26 -3
- package/src/lib/server/{chat-execution-connector-delivery.ts → chat-execution/chat-execution-connector-delivery.ts} +1 -1
- package/src/lib/server/{chat-execution-disabled.test.ts → chat-execution/chat-execution-disabled.test.ts} +3 -3
- package/src/lib/server/{chat-execution-eval-history.test.ts → chat-execution/chat-execution-eval-history.test.ts} +3 -3
- package/src/lib/server/{chat-execution-heartbeat.test.ts → chat-execution/chat-execution-heartbeat.test.ts} +10 -21
- package/src/lib/server/{chat-execution-session-sync.test.ts → chat-execution/chat-execution-session-sync.test.ts} +4 -4
- package/src/lib/server/{chat-execution-tool-events.test.ts → chat-execution/chat-execution-tool-events.test.ts} +1 -1
- package/src/lib/server/{chat-execution-utils.test.ts → chat-execution/chat-execution-utils.test.ts} +1 -1
- package/src/lib/server/{chat-execution-utils.ts → chat-execution/chat-execution-utils.ts} +3 -3
- package/src/lib/server/{chat-execution.ts → chat-execution/chat-execution.ts} +85 -81
- package/src/lib/server/{chat-streaming-utils.ts → chat-execution/chat-streaming-utils.ts} +35 -5
- package/src/lib/server/{chat-turn-tool-routing.ts → chat-execution/chat-turn-tool-routing.ts} +102 -7
- package/src/lib/server/{stream-agent-chat.test.ts → chat-execution/stream-agent-chat.test.ts} +182 -4
- package/src/lib/server/{stream-agent-chat.ts → chat-execution/stream-agent-chat.ts} +393 -166
- package/src/lib/server/{stream-continuation.ts → chat-execution/stream-continuation.ts} +360 -17
- package/src/lib/server/chat-execution/tool-event-tracker.test.ts +36 -0
- package/src/lib/server/chat-execution/tool-event-tracker.ts +34 -0
- package/src/lib/server/chat-execution/tool-result-guard.ts +99 -0
- package/src/lib/server/{chatroom-health.test.ts → chatrooms/chatroom-health.test.ts} +1 -1
- package/src/lib/server/{chatroom-health.ts → chatrooms/chatroom-health.ts} +2 -2
- package/src/lib/server/{chatroom-helpers.test.ts → chatrooms/chatroom-helpers.test.ts} +1 -1
- package/src/lib/server/{chatroom-helpers.ts → chatrooms/chatroom-helpers.ts} +7 -7
- package/src/lib/server/{chatroom-orchestration.ts → chatrooms/chatroom-orchestration.ts} +2 -2
- package/src/lib/server/{chatroom-session-persistence.test.ts → chatrooms/chatroom-session-persistence.test.ts} +2 -2
- package/src/lib/server/{mailbox-utils.ts → chatrooms/mailbox-utils.ts} +2 -2
- package/src/lib/server/{session-mailbox.test.ts → chatrooms/session-mailbox.test.ts} +4 -4
- package/src/lib/server/{session-mailbox.ts → chatrooms/session-mailbox.ts} +2 -2
- package/src/lib/server/connectors/access.ts +3 -24
- package/src/lib/server/connectors/commands.ts +1 -1
- package/src/lib/server/connectors/manager.test.ts +3 -3
- package/src/lib/server/connectors/manager.ts +92 -87
- package/src/lib/server/connectors/openclaw.ts +1 -1
- package/src/lib/server/connectors/policy.ts +8 -2
- package/src/lib/server/connectors/response-media.ts +1 -1
- package/src/lib/server/connectors/runtime-state.ts +2 -0
- package/src/lib/server/connectors/session-consolidation.ts +46 -0
- package/src/lib/server/connectors/session.ts +33 -5
- package/src/lib/server/connectors/whatsapp.ts +19 -8
- package/src/lib/server/context-manager.ts +91 -10
- package/src/lib/server/create-notification.ts +2 -2
- package/src/lib/server/eval/agent-regression-advanced.test.ts +6 -9
- package/src/lib/server/eval/agent-regression.test.ts +4 -13
- package/src/lib/server/eval/agent-regression.ts +5 -19
- package/src/lib/server/eval/runner.ts +1 -1
- package/src/lib/server/evm-swap.ts +2 -2
- package/src/lib/server/integrity-monitor.ts +1 -1
- package/src/lib/server/knowledge-db.test.ts +1 -1
- package/src/lib/server/langgraph-checkpoint.test.ts +64 -0
- package/src/lib/server/langgraph-checkpoint.ts +306 -129
- package/src/lib/server/memory/file-watcher.ts +131 -0
- package/src/lib/server/{memory-consolidation.ts → memory/memory-consolidation.ts} +2 -2
- package/src/lib/server/{memory-db.test.ts → memory/memory-db.test.ts} +2 -2
- package/src/lib/server/{memory-db.ts → memory/memory-db.ts} +16 -14
- package/src/lib/server/{memory-graph.test.ts → memory/memory-graph.test.ts} +2 -2
- package/src/lib/server/{memory-integration.test.ts → memory/memory-integration.test.ts} +6 -6
- package/src/lib/server/{memory-policy.test.ts → memory/memory-policy.test.ts} +1 -1
- package/src/lib/server/{memory-retrieval.test.ts → memory/memory-retrieval.test.ts} +1 -1
- package/src/lib/server/{memory-tiers.test.ts → memory/memory-tiers.test.ts} +1 -1
- package/src/lib/server/{session-archive-memory.test.ts → memory/session-archive-memory.test.ts} +1 -1
- package/src/lib/server/{session-archive-memory.ts → memory/session-archive-memory.ts} +3 -3
- package/src/lib/server/memory/temporal-decay.ts +48 -0
- package/src/lib/server/mmr.ts +53 -19
- package/src/lib/server/{openclaw-agent-resolver.test.ts → openclaw/agent-resolver.test.ts} +1 -1
- package/src/lib/server/{openclaw-agent-resolver.ts → openclaw/agent-resolver.ts} +3 -3
- package/src/lib/server/{openclaw-approvals.ts → openclaw/approvals.ts} +1 -1
- package/src/lib/server/{openclaw-config-sync.ts → openclaw/config-sync.ts} +1 -1
- package/src/lib/server/{openclaw-deploy.test.ts → openclaw/deploy.test.ts} +1 -1
- package/src/lib/server/{openclaw-deploy.ts → openclaw/deploy.ts} +4 -4
- package/src/lib/server/{openclaw-doctor.ts → openclaw/doctor.ts} +1 -1
- package/src/lib/server/{openclaw-exec-config.ts → openclaw/exec-config.ts} +1 -1
- package/src/lib/server/{openclaw-gateway.test.ts → openclaw/gateway.test.ts} +2 -2
- package/src/lib/server/{openclaw-gateway.ts → openclaw/gateway.ts} +5 -5
- package/src/lib/server/{openclaw-health.test.ts → openclaw/health.test.ts} +1 -1
- package/src/lib/server/{openclaw-health.ts → openclaw/health.ts} +2 -2
- package/src/lib/server/{openclaw-models.ts → openclaw/models.ts} +1 -1
- package/src/lib/server/{openclaw-permission-presets.ts → openclaw/permission-presets.ts} +2 -2
- package/src/lib/server/{openclaw-skills-normalize.test.ts → openclaw/skills-normalize.test.ts} +1 -1
- package/src/lib/server/{openclaw-sync.ts → openclaw/sync.ts} +5 -5
- package/src/lib/server/plugins.test.ts +10 -0
- package/src/lib/server/{alert-dispatch.ts → runtime/alert-dispatch.ts} +1 -1
- package/src/lib/server/runtime/daemon-policy.test.ts +62 -0
- package/src/lib/server/{daemon-policy.ts → runtime/daemon-policy.ts} +7 -3
- package/src/lib/server/{daemon-state-connectors.test.ts → runtime/daemon-state-connectors.test.ts} +7 -7
- package/src/lib/server/{daemon-state.test.ts → runtime/daemon-state.test.ts} +2 -2
- package/src/lib/server/{daemon-state.ts → runtime/daemon-state.ts} +29 -78
- package/src/lib/server/{devserver-launch.test.ts → runtime/devserver-launch.test.ts} +1 -1
- package/src/lib/server/{heartbeat-blocked-suppression.test.ts → runtime/heartbeat-blocked-suppression.test.ts} +1 -1
- package/src/lib/server/{heartbeat-service-timer.test.ts → runtime/heartbeat-service-timer.test.ts} +6 -6
- package/src/lib/server/{heartbeat-service.test.ts → runtime/heartbeat-service.test.ts} +2 -2
- package/src/lib/server/{heartbeat-service.ts → runtime/heartbeat-service.ts} +97 -26
- package/src/lib/server/{heartbeat-source.test.ts → runtime/heartbeat-source.test.ts} +1 -1
- package/src/lib/server/{heartbeat-wake.test.ts → runtime/heartbeat-wake.test.ts} +1 -1
- package/src/lib/server/{heartbeat-wake.ts → runtime/heartbeat-wake.ts} +9 -7
- package/src/lib/server/{perf.ts → runtime/perf.ts} +18 -15
- package/src/lib/server/{process-manager.ts → runtime/process-manager.ts} +55 -4
- package/src/lib/server/{queue-advanced.test.ts → runtime/queue-advanced.test.ts} +1 -1
- package/src/lib/server/{queue-followups.test.ts → runtime/queue-followups.test.ts} +1 -1
- package/src/lib/server/{queue-reconcile.test.ts → runtime/queue-reconcile.test.ts} +2 -2
- package/src/lib/server/{queue-recovery.test.ts → runtime/queue-recovery.test.ts} +8 -8
- package/src/lib/server/{queue.test.ts → runtime/queue.test.ts} +9 -9
- package/src/lib/server/{queue.ts → runtime/queue.ts} +16 -16
- package/src/lib/server/{runtime-settings.test.ts → runtime/runtime-settings.test.ts} +4 -4
- package/src/lib/server/{runtime-settings.ts → runtime/runtime-settings.ts} +2 -2
- package/src/lib/server/{runtime-storage-write-paths.test.ts → runtime/runtime-storage-write-paths.test.ts} +5 -15
- package/src/lib/server/{scheduler.ts → runtime/scheduler.ts} +22 -12
- package/src/lib/server/{session-run-manager.test.ts → runtime/session-run-manager.test.ts} +4 -4
- package/src/lib/server/{session-run-manager.ts → runtime/session-run-manager.ts} +23 -16
- package/src/lib/server/{wake-dispatcher.test.ts → runtime/wake-dispatcher.test.ts} +2 -2
- package/src/lib/server/{wake-dispatcher.ts → runtime/wake-dispatcher.ts} +6 -6
- package/src/lib/server/{wake-mode.test.ts → runtime/wake-mode.test.ts} +2 -2
- package/src/lib/server/{watch-jobs-advanced.test.ts → runtime/watch-jobs-advanced.test.ts} +5 -5
- package/src/lib/server/{watch-jobs.test.ts → runtime/watch-jobs.test.ts} +4 -4
- package/src/lib/server/{watch-jobs.ts → runtime/watch-jobs.ts} +5 -5
- package/src/lib/server/sandbox/docker-detect.ts +44 -0
- package/src/lib/server/{schedule-normalization.test.ts → schedules/schedule-normalization.test.ts} +2 -2
- package/src/lib/server/{schedule-normalization.ts → schedules/schedule-normalization.ts} +55 -3
- package/src/lib/server/{schedule-service.ts → schedules/schedule-service.ts} +3 -3
- package/src/lib/server/session-tools/autonomy-tools.test.ts +1 -1
- package/src/lib/server/session-tools/context.ts +47 -0
- package/src/lib/server/session-tools/crud.ts +9 -9
- package/src/lib/server/session-tools/delegate.ts +11 -1
- package/src/lib/server/session-tools/discovery-approvals.test.ts +6 -109
- package/src/lib/server/session-tools/discovery.ts +46 -88
- package/src/lib/server/session-tools/file-access-policy.ts +129 -0
- package/src/lib/server/session-tools/google-workspace.test.ts +153 -0
- package/src/lib/server/session-tools/google-workspace.ts +419 -0
- package/src/lib/server/session-tools/human-loop.ts +4 -4
- package/src/lib/server/session-tools/index.ts +46 -54
- package/src/lib/server/session-tools/mailbox.ts +2 -2
- package/src/lib/server/session-tools/manage-schedules-advanced.test.ts +8 -8
- package/src/lib/server/session-tools/manage-tasks-advanced.test.ts +1 -1
- package/src/lib/server/session-tools/memory.ts +4 -4
- package/src/lib/server/session-tools/monitor.ts +1 -1
- package/src/lib/server/session-tools/normalize-tool-args.ts +1 -1
- package/src/lib/server/session-tools/openclaw-nodes.test.ts +1 -1
- package/src/lib/server/session-tools/openclaw-nodes.ts +1 -1
- package/src/lib/server/session-tools/platform.ts +1 -1
- package/src/lib/server/session-tools/plugin-creator.ts +16 -116
- package/src/lib/server/session-tools/primitive-tools.test.ts +63 -20
- package/src/lib/server/session-tools/schedule.ts +3 -3
- package/src/lib/server/session-tools/shell.ts +89 -3
- package/src/lib/server/session-tools/subagent.ts +119 -11
- package/src/lib/server/session-tools/wallet-tool.test.ts +12 -116
- package/src/lib/server/session-tools/wallet.ts +13 -137
- package/src/lib/server/session-tools/web-browser-config.test.ts +4 -0
- package/src/lib/server/session-tools/web-utils.ts +30 -6
- package/src/lib/server/session-tools/web.ts +2 -1
- package/src/lib/server/{clawhub-client.test.ts → skills/clawhub-client.test.ts} +9 -9
- package/src/lib/server/skills/discovered-skill-prompt.test.ts +62 -0
- package/src/lib/server/skills/discovered-skill-prompt.ts +56 -0
- package/src/lib/server/skills/skill-discovery.test.ts +16 -0
- package/src/lib/server/{skill-discovery.ts → skills/skill-discovery.ts} +10 -5
- package/src/lib/server/{skill-eligibility.test.ts → skills/skill-eligibility.test.ts} +1 -1
- package/src/lib/server/{skill-prompt-budget.test.ts → skills/skill-prompt-budget.test.ts} +1 -1
- package/src/lib/server/{skill-prompt-budget.ts → skills/skill-prompt-budget.ts} +1 -1
- package/src/lib/server/{skills-normalize.test.ts → skills/skills-normalize.test.ts} +1 -1
- package/src/lib/server/solana.ts +16 -2
- package/src/lib/server/storage-item-access.test.ts +36 -0
- package/src/lib/server/storage.ts +6 -6
- package/src/lib/server/{task-followups.test.ts → tasks/task-followups.test.ts} +3 -3
- package/src/lib/server/{task-followups.ts → tasks/task-followups.ts} +5 -5
- package/src/lib/server/{task-lifecycle.test.ts → tasks/task-lifecycle.test.ts} +1 -1
- package/src/lib/server/{task-lifecycle.ts → tasks/task-lifecycle.ts} +2 -2
- package/src/lib/server/{task-mention.test.ts → tasks/task-mention.test.ts} +1 -1
- package/src/lib/server/{task-quality-gate.test.ts → tasks/task-quality-gate.test.ts} +1 -1
- package/src/lib/server/{task-reports.ts → tasks/task-reports.ts} +1 -1
- package/src/lib/server/{task-result.test.ts → tasks/task-result.test.ts} +1 -1
- package/src/lib/server/{task-resume.ts → tasks/task-resume.ts} +1 -1
- package/src/lib/server/{task-service.test.ts → tasks/task-service.test.ts} +1 -1
- package/src/lib/server/{task-service.ts → tasks/task-service.ts} +3 -3
- package/src/lib/server/{task-validation.test.ts → tasks/task-validation.test.ts} +1 -1
- package/src/lib/server/{task-validation.ts → tasks/task-validation.ts} +2 -2
- package/src/lib/server/tool-aliases.ts +1 -0
- package/src/lib/server/tool-capability-policy.ts +1 -0
- package/src/lib/server/tool-loop-detection.ts +10 -10
- package/src/lib/server/tool-planning.test.ts +10 -0
- package/src/lib/server/tool-planning.ts +17 -0
- package/src/lib/server/universal-tool-access.ts +68 -0
- package/src/lib/server/{wallet-execution.test.ts → wallet/wallet-execution.test.ts} +13 -13
- package/src/lib/server/{wallet-portfolio.test.ts → wallet/wallet-portfolio.test.ts} +1 -1
- package/src/lib/server/{wallet-portfolio.ts → wallet/wallet-portfolio.ts} +21 -8
- package/src/lib/server/{wallet-service.test.ts → wallet/wallet-service.test.ts} +1 -1
- package/src/lib/server/{wallet-service.ts → wallet/wallet-service.ts} +6 -6
- package/src/lib/tasks.ts +1 -1
- package/src/lib/time-format.ts +41 -0
- package/src/lib/tool-definitions.ts +1 -0
- package/src/lib/upload.ts +1 -1
- package/src/lib/validation/schemas.test.ts +2 -2
- package/src/lib/validation/schemas.ts +1 -1
- package/src/lib/{wallet-transactions.test.ts → wallet/wallet-transactions.test.ts} +1 -1
- package/src/lib/{wallet.test.ts → wallet/wallet.test.ts} +1 -1
- package/src/proxy.ts +1 -1
- package/src/stores/slices/agent-slice.ts +13 -14
- package/src/stores/slices/auth-slice.ts +1 -1
- package/src/stores/slices/data-slice.ts +5 -23
- package/src/stores/slices/session-slice.ts +22 -31
- package/src/stores/slices/task-slice.ts +1 -1
- package/src/stores/slices/ui-slice.ts +1 -1
- package/src/stores/use-app-store.test.ts +84 -0
- package/src/stores/use-approval-store.ts +1 -1
- package/src/stores/use-chat-store.ts +11 -10
- package/src/stores/use-chatroom-store.ts +1 -1
- package/src/types/index.ts +45 -20
- package/src/{components/shared → views}/settings/plugin-manager.tsx +1 -1
- package/src/{components/shared → views}/settings/section-capability-policy.tsx +6 -94
- package/src/{components/shared → views}/settings/section-embedding.tsx +1 -1
- package/src/{components/shared → views}/settings/section-heartbeat.tsx +2 -2
- package/src/{components/shared → views}/settings/section-orchestrator.tsx +1 -1
- package/src/{components/shared → views}/settings/section-providers.tsx +1 -1
- package/src/{components/shared → views}/settings/section-runtime-loop.tsx +15 -1
- package/src/{components/shared → views}/settings/section-secrets.tsx +1 -1
- package/src/{components/shared → views}/settings/section-storage.tsx +3 -8
- package/src/{components/shared → views}/settings/settings-sheet.tsx +3 -2
- package/src/{components/shared → views}/settings/storage-browser.tsx +2 -7
- package/src/app/api/chats/[id]/fork/route.ts +0 -42
- package/src/app/api/chats/[id]/restore/route.ts +0 -35
- package/src/app/api/tasks/[id]/approve/route.ts +0 -78
- package/src/components/activity/activity-feed.tsx +0 -101
- package/src/components/chat/session-approval-card.tsx +0 -80
- package/src/components/chat/task-approval-card.tsx +0 -78
- package/src/components/home/home-view.tsx +0 -706
- package/src/components/layout/app-layout.tsx +0 -1507
- package/src/components/tasks/approvals-panel.tsx +0 -673
- package/src/components/usage/metrics-dashboard.tsx +0 -598
- package/src/hooks/use-view-router.ts +0 -102
- package/src/lib/approval-display.test.ts +0 -45
- package/src/lib/approval-display.ts +0 -82
- package/src/lib/server/approval-connector-notify.test.ts +0 -253
- package/src/lib/server/approvals-auto-approve.test.ts +0 -801
- package/src/lib/view-routes.test.ts +0 -100
- package/src/lib/view-routes.ts +0 -48
- /package/src/lib/{api-client.test.ts → app/api-client.test.ts} +0 -0
- /package/src/lib/{optimistic.ts → app/optimistic.ts} +0 -0
- /package/src/lib/{safe-storage.ts → app/safe-storage.ts} +0 -0
- /package/src/lib/{chat-artifact-summary.ts → chat/chat-artifact-summary.ts} +0 -0
- /package/src/lib/{chat-display.test.ts → chat/chat-display.test.ts} +0 -0
- /package/src/lib/{chat-display.ts → chat/chat-display.ts} +0 -0
- /package/src/lib/{chat-streaming-state.test.ts → chat/chat-streaming-state.test.ts} +0 -0
- /package/src/lib/{session-summary.test.ts → chat/session-summary.test.ts} +0 -0
- /package/src/lib/{session-summary.ts → chat/session-summary.ts} +0 -0
- /package/src/lib/{tool-event-summary.test.ts → chat/tool-event-summary.test.ts} +0 -0
- /package/src/lib/{tool-event-summary.ts → chat/tool-event-summary.ts} +0 -0
- /package/src/lib/{notification-utils.ts → notifications/notification-utils.ts} +0 -0
- /package/src/lib/{live-tool-events.ts → observability/live-tool-events.ts} +0 -0
- /package/src/lib/{local-observability.ts → observability/local-observability.ts} +0 -0
- /package/src/lib/{openclaw-agent-id.ts → openclaw/openclaw-agent-id.ts} +0 -0
- /package/src/lib/{openclaw-endpoint.ts → openclaw/openclaw-endpoint.ts} +0 -0
- /package/src/lib/{heartbeat-defaults.ts → runtime/heartbeat-defaults.ts} +0 -0
- /package/src/lib/{runtime-env.ts → runtime/runtime-env.ts} +0 -0
- /package/src/lib/{cron-human.ts → schedules/cron-human.ts} +0 -0
- /package/src/lib/{schedule-dedupe-advanced.test.ts → schedules/schedule-dedupe-advanced.test.ts} +0 -0
- /package/src/lib/{schedule-dedupe.test.ts → schedules/schedule-dedupe.test.ts} +0 -0
- /package/src/lib/{schedule-dedupe.ts → schedules/schedule-dedupe.ts} +0 -0
- /package/src/lib/{schedule-name.ts → schedules/schedule-name.ts} +0 -0
- /package/src/lib/{schedule-origin.test.ts → schedules/schedule-origin.test.ts} +0 -0
- /package/src/lib/{schedule-origin.ts → schedules/schedule-origin.ts} +0 -0
- /package/src/lib/{schedule-templates.ts → schedules/schedule-templates.ts} +0 -0
- /package/src/lib/server/{agent-availability.ts → agents/agent-availability.ts} +0 -0
- /package/src/lib/server/{assistant-control.ts → agents/assistant-control.ts} +0 -0
- /package/src/lib/server/{autonomy-contract.ts → agents/autonomy-contract.ts} +0 -0
- /package/src/lib/server/{guardian.ts → agents/guardian.ts} +0 -0
- /package/src/lib/server/{orchestrator-lg-structure.test.ts → agents/orchestrator-lg-structure.test.ts} +0 -0
- /package/src/lib/server/{chat-execution-tool-events.ts → chat-execution/chat-execution-tool-events.ts} +0 -0
- /package/src/lib/server/{chatroom-routing.ts → chatrooms/chatroom-routing.ts} +0 -0
- /package/src/lib/server/{memory-graph.ts → memory/memory-graph.ts} +0 -0
- /package/src/lib/server/{memory-policy.ts → memory/memory-policy.ts} +0 -0
- /package/src/lib/server/{memory-tiers.ts → memory/memory-tiers.ts} +0 -0
- /package/src/lib/server/{openclaw-history-merge.ts → openclaw/history-merge.ts} +0 -0
- /package/src/lib/server/{openclaw-skills-normalize.ts → openclaw/skills-normalize.ts} +0 -0
- /package/src/lib/server/{devserver-launch.ts → runtime/devserver-launch.ts} +0 -0
- /package/src/lib/server/{heartbeat-source.ts → runtime/heartbeat-source.ts} +0 -0
- /package/src/lib/server/{system-events.ts → runtime/system-events.ts} +0 -0
- /package/src/lib/server/{wake-mode.ts → runtime/wake-mode.ts} +0 -0
- /package/src/lib/server/{clawhub-client.ts → skills/clawhub-client.ts} +0 -0
- /package/src/lib/server/{skill-eligibility.ts → skills/skill-eligibility.ts} +0 -0
- /package/src/lib/server/{skills-normalize.ts → skills/skills-normalize.ts} +0 -0
- /package/src/lib/server/{task-mention.ts → tasks/task-mention.ts} +0 -0
- /package/src/lib/server/{task-quality-gate.ts → tasks/task-quality-gate.ts} +0 -0
- /package/src/lib/server/{task-result.ts → tasks/task-result.ts} +0 -0
- /package/src/lib/{wallet-transactions.ts → wallet/wallet-transactions.ts} +0 -0
- /package/src/lib/{wallet.ts → wallet/wallet.ts} +0 -0
- /package/src/{components/shared → views}/settings/section-memory.tsx +0 -0
- /package/src/{components/shared → views}/settings/section-theme.tsx +0 -0
- /package/src/{components/shared → views}/settings/section-user-preferences.tsx +0 -0
- /package/src/{components/shared → views}/settings/section-voice.tsx +0 -0
- /package/src/{components/shared → views}/settings/section-web-search.tsx +0 -0
- /package/src/{components/shared → views}/settings/types.ts +0 -0
- /package/src/{components/shared → views}/settings/utils.ts +0 -0
package/README.md
CHANGED
|
@@ -129,16 +129,18 @@ 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
|
+
|
|
135
137
|
### One-off run
|
|
136
138
|
|
|
137
139
|
```bash
|
|
138
|
-
npx @swarmclawai/swarmclaw
|
|
139
|
-
pnpm dlx @swarmclawai/swarmclaw
|
|
140
|
-
yarn dlx @swarmclawai/swarmclaw
|
|
141
|
-
bunx @swarmclawai/swarmclaw
|
|
140
|
+
npx @swarmclawai/swarmclaw server
|
|
141
|
+
pnpm dlx @swarmclawai/swarmclaw server
|
|
142
|
+
yarn dlx @swarmclawai/swarmclaw server
|
|
143
|
+
bunx @swarmclawai/swarmclaw server
|
|
142
144
|
```
|
|
143
145
|
|
|
144
146
|
### Install script
|
|
@@ -148,7 +150,8 @@ curl -fsSL https://raw.githubusercontent.com/swarmclawai/swarmclaw/main/install.
|
|
|
148
150
|
```
|
|
149
151
|
|
|
150
152
|
The installer resolves the latest stable release tag and installs that version by default.
|
|
151
|
-
|
|
153
|
+
It also builds the production bundle so `npm run start` is ready immediately after install.
|
|
154
|
+
To pin a version: `SWARMCLAW_VERSION=v0.8.9 curl ... | bash`
|
|
152
155
|
|
|
153
156
|
Or run locally from the repo (friendly for non-technical users):
|
|
154
157
|
|
|
@@ -165,6 +168,12 @@ npm run quickstart
|
|
|
165
168
|
- Prepare `.env.local` and `data/`
|
|
166
169
|
- Start the app at `http://localhost:3456`
|
|
167
170
|
|
|
171
|
+
For the packaged production server, use:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm run quickstart:prod
|
|
175
|
+
```
|
|
176
|
+
|
|
168
177
|
If you prefer another package manager for local development:
|
|
169
178
|
|
|
170
179
|
```bash
|
|
@@ -701,7 +710,7 @@ npm run update:easy # safe update helper for local installs
|
|
|
701
710
|
SwarmClaw uses tag-based releases (`vX.Y.Z`) as the stable channel.
|
|
702
711
|
|
|
703
712
|
```bash
|
|
704
|
-
# example patch release (v0.8.
|
|
713
|
+
# example patch release (v0.8.9 style)
|
|
705
714
|
npm version patch
|
|
706
715
|
git push origin main --follow-tags
|
|
707
716
|
```
|
|
@@ -711,14 +720,15 @@ On `v*` tags, GitHub Actions will:
|
|
|
711
720
|
2. Create a GitHub Release
|
|
712
721
|
3. Build and publish Docker images to `ghcr.io/swarmclawai/swarmclaw` (`:vX.Y.Z`, `:latest`, `:sha-*`)
|
|
713
722
|
|
|
714
|
-
#### v0.8.
|
|
723
|
+
#### v0.8.9 Release Readiness Notes
|
|
715
724
|
|
|
716
|
-
Before shipping `v0.8.
|
|
725
|
+
Before shipping `v0.8.9`, confirm the following user-facing changes are reflected in docs:
|
|
717
726
|
|
|
718
|
-
1. Install
|
|
719
|
-
2.
|
|
720
|
-
3.
|
|
721
|
-
4.
|
|
727
|
+
1. Install docs make it explicit that global npm installs use `swarmclaw server`, not the Next dev server, and that the curl installer prebuilds the production bundle.
|
|
728
|
+
2. Update docs note that repository updates rebuild with `npm run build` and packaged installs can use `swarmclaw update` to rebuild the standalone server after upgrading.
|
|
729
|
+
3. Site and README install/version strings are updated to `v0.8.9`, including install snippets, release notes index text, and sidebar/footer labels.
|
|
730
|
+
4. Release notes mention the browser resilience changes and the installer/update build alignment, then absorb any final release bullets from the remaining in-flight work before tagging.
|
|
731
|
+
5. The release branch and `main` stay aligned so the shipped tag points at the same commit users see on the default branch.
|
|
722
732
|
|
|
723
733
|
## CLI
|
|
724
734
|
|
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() {
|
package/bin/update-cmd.test.js
CHANGED
|
@@ -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
|
-
|
|
12
|
+
const captured = []
|
|
12
13
|
|
|
13
14
|
const exitCode = runRegistrySelfUpdate(
|
|
14
15
|
'pnpm',
|
|
15
16
|
(command, args, options) => {
|
|
16
|
-
captured
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|
|
3
|
+
"version": "0.8.9",
|
|
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,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"bin/",
|
|
32
|
+
"bundled-skills/",
|
|
32
33
|
"src/",
|
|
33
34
|
"public/",
|
|
34
35
|
"scripts/postinstall.mjs",
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
"quickstart": "node ./scripts/easy-setup.mjs --start",
|
|
43
44
|
"quickstart:prod": "node ./scripts/easy-setup.mjs --prod",
|
|
44
45
|
"update:easy": "node ./scripts/easy-update.mjs",
|
|
45
|
-
"dev": "next dev --
|
|
46
|
+
"dev": "next dev --turbopack --hostname 0.0.0.0 -p 3456",
|
|
46
47
|
"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",
|
|
48
|
+
"dev:clean": "rm -rf .next && next dev --turbopack --hostname 0.0.0.0 -p 3456",
|
|
48
49
|
"build": "next build",
|
|
49
50
|
"build:ci": "NEXT_DISABLE_ESLINT=1 next build",
|
|
50
51
|
"start": "node .next/standalone/server.js",
|
|
@@ -59,15 +60,15 @@
|
|
|
59
60
|
"lint:baseline:update": "node ./scripts/lint-baseline.mjs update",
|
|
60
61
|
"cli": "node ./bin/swarmclaw.js",
|
|
61
62
|
"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
|
|
63
|
+
"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
64
|
"test:mcp:conformance": "node --import tsx ./scripts/mcp-conformance-check.ts",
|
|
64
65
|
"postinstall": "node ./scripts/postinstall.mjs"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
68
|
"@huggingface/transformers": "^3.8.1",
|
|
68
69
|
"@langchain/anthropic": "^1.3.18",
|
|
69
|
-
"@langchain/core": "^1.1.
|
|
70
|
-
"@langchain/langgraph": "^1.
|
|
70
|
+
"@langchain/core": "^1.1.31",
|
|
71
|
+
"@langchain/langgraph": "^1.2.2",
|
|
71
72
|
"@langchain/openai": "^1.2.8",
|
|
72
73
|
"@multiavatar/multiavatar": "^1.0.7",
|
|
73
74
|
"@playwright/mcp": "^0.0.68",
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
"grammy": "^1.40.0",
|
|
89
90
|
"highlight.js": "^11.11.1",
|
|
90
91
|
"imapflow": "^1.2.11",
|
|
92
|
+
"langchain": "^1.2.30",
|
|
91
93
|
"lucide-react": "^0.574.0",
|
|
92
94
|
"mailparser": "^3.9.3",
|
|
93
95
|
"next": "16.1.6",
|
|
@@ -133,6 +135,8 @@
|
|
|
133
135
|
"optionalDependencies": {
|
|
134
136
|
"botbuilder": "^4.23.3",
|
|
135
137
|
"googleapis": "^171.4.0",
|
|
136
|
-
"matrix-bot-sdk": "^0.8.0"
|
|
138
|
+
"matrix-bot-sdk": "^0.8.0",
|
|
139
|
+
"opusscript": "0.0.8",
|
|
140
|
+
"utf-8-validate": "5.0.10"
|
|
137
141
|
}
|
|
138
142
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react'
|
|
4
|
+
import { useAppStore } from '@/stores/use-app-store'
|
|
5
|
+
import { useNow } from '@/hooks/use-now'
|
|
6
|
+
import { useWs } from '@/hooks/use-ws'
|
|
7
|
+
import { MainContent } from '@/components/layout/main-content'
|
|
8
|
+
import { timeAgo } from '@/lib/time-format'
|
|
9
|
+
import type { ActivityEntry } from '@/types'
|
|
10
|
+
|
|
11
|
+
const ENTITY_ICONS: Record<string, string> = {
|
|
12
|
+
agent: 'A', task: 'T', connector: 'C', session: 'S', webhook: 'W', schedule: 'R',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ACTION_COLORS: Record<string, string> = {
|
|
16
|
+
created: 'bg-emerald-500/15 text-emerald-400',
|
|
17
|
+
updated: 'bg-blue-500/15 text-blue-400',
|
|
18
|
+
deleted: 'bg-red-500/15 text-red-400',
|
|
19
|
+
started: 'bg-green-500/15 text-green-400',
|
|
20
|
+
stopped: 'bg-gray-500/15 text-gray-400',
|
|
21
|
+
queued: 'bg-amber-500/15 text-amber-400',
|
|
22
|
+
completed: 'bg-emerald-500/15 text-emerald-400',
|
|
23
|
+
failed: 'bg-red-500/15 text-red-400',
|
|
24
|
+
approved: 'bg-green-500/15 text-green-400',
|
|
25
|
+
rejected: 'bg-red-500/15 text-red-400',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ENTITY_TYPES = ['', 'agent', 'task', 'connector', 'session', 'webhook', 'schedule'] as const
|
|
29
|
+
|
|
30
|
+
export default function ActivityPage() {
|
|
31
|
+
const now = useNow()
|
|
32
|
+
const entries = useAppStore((s) => s.activityEntries)
|
|
33
|
+
const loadActivity = useAppStore((s) => s.loadActivity)
|
|
34
|
+
const [filterType, setFilterType] = useState('')
|
|
35
|
+
|
|
36
|
+
useEffect(() => { loadActivity({ entityType: filterType || undefined, limit: 100 }) }, [filterType, loadActivity])
|
|
37
|
+
useWs('activity', () => loadActivity({ entityType: filterType || undefined, limit: 100 }), 10_000)
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<MainContent>
|
|
41
|
+
<div className="flex-1 flex flex-col h-full overflow-hidden">
|
|
42
|
+
<div className="flex items-center justify-between px-8 pt-6 pb-4 shrink-0">
|
|
43
|
+
<div>
|
|
44
|
+
<h1 className="font-display text-[28px] font-800 tracking-[-0.03em]">Activity</h1>
|
|
45
|
+
<p className="text-[13px] text-text-3 mt-1">Audit trail of all entity mutations</p>
|
|
46
|
+
</div>
|
|
47
|
+
<select
|
|
48
|
+
value={filterType}
|
|
49
|
+
onChange={(e) => setFilterType(e.target.value)}
|
|
50
|
+
className="px-3 py-2 rounded-[10px] text-[13px] font-600 cursor-pointer transition-all border bg-transparent border-white/[0.06] text-text-3 hover:bg-white/[0.03] appearance-none"
|
|
51
|
+
style={{ fontFamily: 'inherit', minWidth: 130 }}
|
|
52
|
+
>
|
|
53
|
+
<option value="">All Types</option>
|
|
54
|
+
{ENTITY_TYPES.filter(Boolean).map((t) => (
|
|
55
|
+
<option key={t} value={t}>{t.charAt(0).toUpperCase() + t.slice(1)}s</option>
|
|
56
|
+
))}
|
|
57
|
+
</select>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div className="flex-1 overflow-y-auto px-8 pb-6">
|
|
61
|
+
{entries.length === 0 ? (
|
|
62
|
+
<div className="text-center text-text-3 text-[14px] mt-16">No activity yet</div>
|
|
63
|
+
) : (
|
|
64
|
+
<div className="space-y-1">
|
|
65
|
+
{entries.map((entry: ActivityEntry, idx: number) => (
|
|
66
|
+
<div
|
|
67
|
+
key={entry.id}
|
|
68
|
+
className="flex items-start gap-3 py-3 border-b border-white/[0.04]"
|
|
69
|
+
style={{
|
|
70
|
+
animation: 'fade-up 0.5s var(--ease-spring) both',
|
|
71
|
+
animationDelay: `${Math.min(idx * 0.03, 0.5)}s`
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<div className="w-8 h-8 rounded-[8px] bg-surface-2 flex items-center justify-center text-[12px] font-700 text-text-3 shrink-0">
|
|
75
|
+
{ENTITY_ICONS[entry.entityType] || '?'}
|
|
76
|
+
</div>
|
|
77
|
+
<div className="flex-1 min-w-0">
|
|
78
|
+
<div className="flex items-center gap-2 mb-1">
|
|
79
|
+
<span className={`px-1.5 py-0.5 rounded-[5px] text-[10px] font-600 ${ACTION_COLORS[entry.action] || 'bg-white/[0.06] text-text-3'}`}>
|
|
80
|
+
{entry.action}
|
|
81
|
+
</span>
|
|
82
|
+
<span className="text-[10px] text-text-3/50 font-mono">{entry.entityType}</span>
|
|
83
|
+
<span className="text-[10px] text-text-3/40">{entry.actor}</span>
|
|
84
|
+
</div>
|
|
85
|
+
<p className="text-[13px] text-text-2 leading-[1.4] truncate">{entry.summary}</p>
|
|
86
|
+
</div>
|
|
87
|
+
<span className="text-[11px] text-text-3/50 shrink-0 pt-1">{timeAgo(entry.timestamp, now)}</span>
|
|
88
|
+
</div>
|
|
89
|
+
))}
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</MainContent>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react'
|
|
4
|
+
import { useParams } from 'next/navigation'
|
|
5
|
+
import { useAppStore } from '@/stores/use-app-store'
|
|
6
|
+
import { selectActiveSessionId } from '@/stores/slices/session-slice'
|
|
7
|
+
import { ChatArea } from '@/components/chat/chat-area'
|
|
8
|
+
import { CanvasPanel } from '@/components/canvas/canvas-panel'
|
|
9
|
+
|
|
10
|
+
export default function AgentChatPage() {
|
|
11
|
+
const { id } = useParams<{ id: string }>()
|
|
12
|
+
const setCurrentAgent = useAppStore((s) => s.setCurrentAgent)
|
|
13
|
+
const activeSessionId = useAppStore(selectActiveSessionId)
|
|
14
|
+
const sessions = useAppStore((s) => s.sessions)
|
|
15
|
+
const agents = useAppStore((s) => s.agents)
|
|
16
|
+
const [canvasDismissedFor, setCanvasDismissedFor] = useState<string | null>(null)
|
|
17
|
+
|
|
18
|
+
// Sync URL param to store
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (id) {
|
|
21
|
+
void setCurrentAgent(decodeURIComponent(id))
|
|
22
|
+
}
|
|
23
|
+
}, [id, setCurrentAgent])
|
|
24
|
+
|
|
25
|
+
const currentSession = activeSessionId ? sessions[activeSessionId] : null
|
|
26
|
+
const hasCanvas = !!(currentSession?.canvasContent && canvasDismissedFor !== activeSessionId)
|
|
27
|
+
const canvasAgentName = currentSession?.agentId && agents[currentSession.agentId] ? agents[currentSession.agentId].name : undefined
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex-1 flex h-full min-h-0 min-w-0">
|
|
31
|
+
<div className="flex-1 min-h-0 min-w-0 overflow-hidden">
|
|
32
|
+
<ChatArea key={id} />
|
|
33
|
+
</div>
|
|
34
|
+
{hasCanvas && activeSessionId && (
|
|
35
|
+
<CanvasPanel
|
|
36
|
+
sessionId={activeSessionId}
|
|
37
|
+
agentName={canvasAgentName}
|
|
38
|
+
onClose={() => activeSessionId && setCanvasDismissedFor(activeSessionId)}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import { SidebarPanelShell } from '@/components/layout/sidebar-panel-shell'
|
|
5
|
+
import { MainContent } from '@/components/layout/main-content'
|
|
6
|
+
import { AgentChatList } from '@/components/agents/agent-chat-list'
|
|
7
|
+
import { AgentList } from '@/components/agents/agent-list'
|
|
8
|
+
import { useAppStore } from '@/stores/use-app-store'
|
|
9
|
+
|
|
10
|
+
export default function AgentsLayout({ children }: { children: React.ReactNode }) {
|
|
11
|
+
const [agentViewMode, setAgentViewMode] = useState<'chat' | 'config'>('chat')
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<SidebarPanelShell
|
|
16
|
+
title="Agents"
|
|
17
|
+
createLabel="Agent"
|
|
18
|
+
onNew={() => useAppStore.getState().setAgentSheetOpen(true)}
|
|
19
|
+
headerContent={
|
|
20
|
+
<div className="flex gap-1 px-4 pb-2">
|
|
21
|
+
{(['chat', 'config'] as const).map((mode) => (
|
|
22
|
+
<button
|
|
23
|
+
key={mode}
|
|
24
|
+
onClick={() => setAgentViewMode(mode)}
|
|
25
|
+
className={`px-3 py-1.5 rounded-[8px] text-[11px] font-600 capitalize cursor-pointer transition-all
|
|
26
|
+
${agentViewMode === mode ? 'bg-accent-soft text-accent-bright' : 'bg-transparent text-text-3 hover:text-text-2'}`}
|
|
27
|
+
style={{ fontFamily: 'inherit' }}
|
|
28
|
+
>
|
|
29
|
+
{mode}
|
|
30
|
+
</button>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
{agentViewMode === 'chat' ? <AgentChatList inSidebar /> : <AgentList inSidebar />}
|
|
36
|
+
</SidebarPanelShell>
|
|
37
|
+
<MainContent>{children}</MainContent>
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react'
|
|
4
|
+
import { useRouter } from 'next/navigation'
|
|
5
|
+
import { useAppStore } from '@/stores/use-app-store'
|
|
6
|
+
import { useMediaQuery } from '@/hooks/use-media-query'
|
|
7
|
+
import { getViewPath } from '@/lib/app/navigation'
|
|
8
|
+
import { AgentChatList } from '@/components/agents/agent-chat-list'
|
|
9
|
+
|
|
10
|
+
export default function AgentsPage() {
|
|
11
|
+
const isDesktop = useMediaQuery('(min-width: 768px)')
|
|
12
|
+
const router = useRouter()
|
|
13
|
+
const agents = useAppStore((s) => s.agents)
|
|
14
|
+
const appSettings = useAppStore((s) => s.appSettings)
|
|
15
|
+
const redirected = useRef(false)
|
|
16
|
+
|
|
17
|
+
const defaultAgent = appSettings.defaultAgentId && agents[appSettings.defaultAgentId]
|
|
18
|
+
? agents[appSettings.defaultAgentId]
|
|
19
|
+
: Object.values(agents)[0] || null
|
|
20
|
+
|
|
21
|
+
// On desktop, auto-redirect to the default (or first) agent instead of showing a placeholder
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!isDesktop || redirected.current) return
|
|
24
|
+
if (defaultAgent) {
|
|
25
|
+
redirected.current = true
|
|
26
|
+
router.replace(getViewPath('agents', defaultAgent.id))
|
|
27
|
+
}
|
|
28
|
+
}, [isDesktop, defaultAgent, router])
|
|
29
|
+
|
|
30
|
+
if (!isDesktop) return <AgentChatList />
|
|
31
|
+
|
|
32
|
+
// Brief flash while redirecting, or no agents exist yet
|
|
33
|
+
return null
|
|
34
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server'
|
|
2
2
|
import { loadAgents, saveAgents, loadSessions, logActivity, upsertStoredItem, upsertStoredItems } from '@/lib/server/storage'
|
|
3
|
-
import { normalizeProviderEndpoint } from '@/lib/openclaw-endpoint'
|
|
3
|
+
import { normalizeProviderEndpoint } from '@/lib/openclaw/openclaw-endpoint'
|
|
4
4
|
import { mutateItem, notFound, type CollectionOps } from '@/lib/server/collection-helpers'
|
|
5
|
-
import { ensureAgentThreadSession } from '@/lib/server/agent-thread-session'
|
|
5
|
+
import { ensureAgentThreadSession } from '@/lib/server/agents/agent-thread-session'
|
|
6
|
+
import { suspendAgentReferences } from '@/lib/server/agents/agent-cascade'
|
|
7
|
+
import { notify } from '@/lib/server/ws-hub'
|
|
6
8
|
|
|
7
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
10
|
const ops: CollectionOps<any> = { load: () => loadAgents({ includeTrashed: true }), save: saveAgents, topic: 'agents', table: 'agents' }
|
|
@@ -110,6 +112,7 @@ export async function DELETE(_req: Request, { params }: { params: Promise<{ id:
|
|
|
110
112
|
for (const session of Object.values(sessions) as Array<Record<string, unknown>>) {
|
|
111
113
|
if (!session || session.agentId !== id) continue
|
|
112
114
|
session.agentId = null
|
|
115
|
+
session.heartbeatEnabled = false
|
|
113
116
|
detached.push([session.id as string, session])
|
|
114
117
|
}
|
|
115
118
|
if (detached.length > 0) {
|
|
@@ -117,5 +120,13 @@ export async function DELETE(_req: Request, { params }: { params: Promise<{ id:
|
|
|
117
120
|
}
|
|
118
121
|
const detachedSessions = detached.length
|
|
119
122
|
|
|
120
|
-
|
|
123
|
+
// Cascade: suspend tasks, schedules, watch jobs, connectors, webhooks, chatrooms
|
|
124
|
+
const cascade = suspendAgentReferences(id)
|
|
125
|
+
if (cascade.tasks) notify('tasks')
|
|
126
|
+
if (cascade.schedules) notify('schedules')
|
|
127
|
+
if (cascade.connectors) notify('connectors')
|
|
128
|
+
if (cascade.webhooks) notify('webhooks')
|
|
129
|
+
if (cascade.chatrooms) notify('chatrooms')
|
|
130
|
+
|
|
131
|
+
return NextResponse.json({ ok: true, detachedSessions, ...cascade })
|
|
121
132
|
}
|