@swarmclawai/swarmclaw 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +39 -8
  2. package/bin/swarmclaw.js +76 -16
  3. package/next.config.ts +11 -1
  4. package/package.json +4 -2
  5. package/scripts/postinstall.mjs +18 -0
  6. package/src/app/api/chatrooms/[id]/chat/route.ts +410 -0
  7. package/src/app/api/chatrooms/[id]/members/route.ts +82 -0
  8. package/src/app/api/chatrooms/[id]/pins/route.ts +39 -0
  9. package/src/app/api/chatrooms/[id]/reactions/route.ts +42 -0
  10. package/src/app/api/chatrooms/[id]/route.ts +84 -0
  11. package/src/app/api/chatrooms/route.ts +50 -0
  12. package/src/app/api/credentials/route.ts +2 -3
  13. package/src/app/api/knowledge/[id]/route.ts +13 -2
  14. package/src/app/api/knowledge/route.ts +8 -1
  15. package/src/app/api/memory/route.ts +8 -0
  16. package/src/app/api/notifications/route.ts +4 -0
  17. package/src/app/api/orchestrator/run/route.ts +1 -1
  18. package/src/app/api/plugins/install/route.ts +2 -2
  19. package/src/app/api/search/route.ts +51 -1
  20. package/src/app/api/sessions/[id]/chat/route.ts +2 -0
  21. package/src/app/api/sessions/[id]/edit-resend/route.ts +1 -1
  22. package/src/app/api/sessions/[id]/fork/route.ts +1 -1
  23. package/src/app/api/sessions/route.ts +3 -3
  24. package/src/app/api/settings/route.ts +9 -0
  25. package/src/app/api/setup/check-provider/route.ts +3 -16
  26. package/src/app/api/skills/[id]/route.ts +6 -0
  27. package/src/app/api/skills/route.ts +6 -0
  28. package/src/app/api/tasks/[id]/route.ts +12 -0
  29. package/src/app/api/tasks/bulk/route.ts +100 -0
  30. package/src/app/api/tasks/route.ts +1 -0
  31. package/src/app/api/webhooks/[id]/route.ts +15 -1
  32. package/src/app/globals.css +58 -15
  33. package/src/app/page.tsx +142 -13
  34. package/src/cli/index.js +24 -0
  35. package/src/cli/index.test.js +30 -0
  36. package/src/cli/spec.js +16 -0
  37. package/src/components/agents/agent-avatar.tsx +57 -10
  38. package/src/components/agents/agent-card.tsx +48 -15
  39. package/src/components/agents/agent-chat-list.tsx +123 -10
  40. package/src/components/agents/agent-list.tsx +50 -19
  41. package/src/components/agents/agent-sheet.tsx +56 -63
  42. package/src/components/auth/access-key-gate.tsx +10 -3
  43. package/src/components/auth/setup-wizard.tsx +2 -2
  44. package/src/components/auth/user-picker.tsx +31 -3
  45. package/src/components/chat/activity-moment.tsx +169 -0
  46. package/src/components/chat/chat-header.tsx +2 -0
  47. package/src/components/chat/chat-tool-toggles.tsx +1 -1
  48. package/src/components/chat/file-path-chip.tsx +125 -0
  49. package/src/components/chat/markdown-utils.ts +9 -0
  50. package/src/components/chat/message-bubble.tsx +46 -295
  51. package/src/components/chat/message-list.tsx +50 -1
  52. package/src/components/chat/streaming-bubble.tsx +36 -46
  53. package/src/components/chat/suggestions-bar.tsx +1 -1
  54. package/src/components/chat/thinking-indicator.tsx +72 -10
  55. package/src/components/chat/tool-call-bubble.tsx +66 -70
  56. package/src/components/chat/tool-request-banner.tsx +31 -7
  57. package/src/components/chat/transfer-agent-picker.tsx +63 -0
  58. package/src/components/chatrooms/agent-hover-card.tsx +124 -0
  59. package/src/components/chatrooms/chatroom-input.tsx +320 -0
  60. package/src/components/chatrooms/chatroom-list.tsx +123 -0
  61. package/src/components/chatrooms/chatroom-message.tsx +427 -0
  62. package/src/components/chatrooms/chatroom-sheet.tsx +215 -0
  63. package/src/components/chatrooms/chatroom-tool-request-banner.tsx +134 -0
  64. package/src/components/chatrooms/chatroom-typing-bar.tsx +88 -0
  65. package/src/components/chatrooms/chatroom-view.tsx +344 -0
  66. package/src/components/chatrooms/reaction-picker.tsx +273 -0
  67. package/src/components/connectors/connector-sheet.tsx +34 -47
  68. package/src/components/home/home-view.tsx +501 -0
  69. package/src/components/input/chat-input.tsx +79 -41
  70. package/src/components/knowledge/knowledge-list.tsx +31 -1
  71. package/src/components/knowledge/knowledge-sheet.tsx +83 -2
  72. package/src/components/layout/app-layout.tsx +175 -95
  73. package/src/components/layout/update-banner.tsx +2 -2
  74. package/src/components/logs/log-list.tsx +2 -2
  75. package/src/components/mcp-servers/mcp-server-sheet.tsx +1 -1
  76. package/src/components/memory/memory-agent-list.tsx +143 -0
  77. package/src/components/memory/memory-browser.tsx +205 -0
  78. package/src/components/memory/memory-card.tsx +34 -7
  79. package/src/components/memory/memory-detail.tsx +359 -120
  80. package/src/components/memory/memory-sheet.tsx +157 -23
  81. package/src/components/plugins/plugin-list.tsx +1 -1
  82. package/src/components/plugins/plugin-sheet.tsx +1 -1
  83. package/src/components/projects/project-detail.tsx +509 -0
  84. package/src/components/projects/project-list.tsx +195 -59
  85. package/src/components/providers/provider-list.tsx +2 -2
  86. package/src/components/providers/provider-sheet.tsx +3 -3
  87. package/src/components/schedules/schedule-card.tsx +1 -1
  88. package/src/components/schedules/schedule-list.tsx +1 -1
  89. package/src/components/schedules/schedule-sheet.tsx +25 -25
  90. package/src/components/secrets/secret-sheet.tsx +47 -24
  91. package/src/components/secrets/secrets-list.tsx +18 -8
  92. package/src/components/sessions/new-session-sheet.tsx +33 -65
  93. package/src/components/sessions/session-card.tsx +45 -14
  94. package/src/components/sessions/session-list.tsx +35 -18
  95. package/src/components/shared/agent-picker-list.tsx +90 -0
  96. package/src/components/shared/agent-switch-dialog.tsx +156 -0
  97. package/src/components/shared/attachment-chip.tsx +165 -0
  98. package/src/components/shared/avatar.tsx +10 -1
  99. package/src/components/shared/check-icon.tsx +12 -0
  100. package/src/components/shared/confirm-dialog.tsx +1 -1
  101. package/src/components/shared/empty-state.tsx +32 -0
  102. package/src/components/shared/file-preview.tsx +34 -0
  103. package/src/components/shared/form-styles.ts +2 -0
  104. package/src/components/shared/keyboard-shortcuts-dialog.tsx +116 -0
  105. package/src/components/shared/notification-center.tsx +44 -6
  106. package/src/components/shared/profile-sheet.tsx +115 -0
  107. package/src/components/shared/reply-quote.tsx +26 -0
  108. package/src/components/shared/search-dialog.tsx +14 -5
  109. package/src/components/shared/section-label.tsx +12 -0
  110. package/src/components/shared/settings/plugin-manager.tsx +1 -1
  111. package/src/components/shared/settings/section-providers.tsx +1 -1
  112. package/src/components/shared/settings/section-secrets.tsx +1 -1
  113. package/src/components/shared/settings/section-theme.tsx +95 -0
  114. package/src/components/shared/settings/section-user-preferences.tsx +39 -0
  115. package/src/components/shared/settings/settings-page.tsx +180 -27
  116. package/src/components/shared/settings/settings-sheet.tsx +9 -73
  117. package/src/components/shared/sheet-footer.tsx +33 -0
  118. package/src/components/skills/skill-list.tsx +61 -30
  119. package/src/components/skills/skill-sheet.tsx +81 -2
  120. package/src/components/tasks/task-board.tsx +448 -26
  121. package/src/components/tasks/task-card.tsx +46 -9
  122. package/src/components/tasks/task-column.tsx +62 -3
  123. package/src/components/tasks/task-list.tsx +12 -4
  124. package/src/components/tasks/task-sheet.tsx +89 -72
  125. package/src/components/ui/hover-card.tsx +52 -0
  126. package/src/components/usage/usage-list.tsx +1 -1
  127. package/src/components/webhooks/webhook-sheet.tsx +1 -1
  128. package/src/hooks/use-view-router.ts +69 -19
  129. package/src/instrumentation.ts +15 -1
  130. package/src/lib/chat.ts +2 -0
  131. package/src/lib/memory.ts +3 -0
  132. package/src/lib/server/chat-execution.ts +24 -4
  133. package/src/lib/server/connectors/manager.ts +11 -0
  134. package/src/lib/server/context-manager.ts +225 -13
  135. package/src/lib/server/create-notification.ts +14 -2
  136. package/src/lib/server/daemon-state.ts +157 -10
  137. package/src/lib/server/execution-log.ts +1 -0
  138. package/src/lib/server/heartbeat-service.ts +40 -5
  139. package/src/lib/server/heartbeat-wake.ts +110 -0
  140. package/src/lib/server/langgraph-checkpoint.ts +1 -0
  141. package/src/lib/server/memory-consolidation.ts +92 -0
  142. package/src/lib/server/memory-db.ts +51 -6
  143. package/src/lib/server/openclaw-gateway.ts +9 -1
  144. package/src/lib/server/provider-health.ts +125 -0
  145. package/src/lib/server/queue.ts +5 -4
  146. package/src/lib/server/scheduler.ts +8 -0
  147. package/src/lib/server/session-run-manager.ts +4 -0
  148. package/src/lib/server/session-tools/chatroom.ts +136 -0
  149. package/src/lib/server/session-tools/context-mgmt.ts +36 -18
  150. package/src/lib/server/session-tools/index.ts +2 -0
  151. package/src/lib/server/session-tools/memory.ts +6 -1
  152. package/src/lib/server/storage.ts +53 -29
  153. package/src/lib/server/stream-agent-chat.ts +153 -47
  154. package/src/lib/server/system-events.ts +49 -0
  155. package/src/lib/server/ws-hub.ts +11 -0
  156. package/src/lib/soul-suggestions.ts +109 -0
  157. package/src/lib/tasks.ts +4 -1
  158. package/src/lib/view-routes.ts +36 -1
  159. package/src/lib/ws-client.ts +14 -4
  160. package/src/stores/use-app-store.ts +36 -2
  161. package/src/stores/use-chat-store.ts +48 -3
  162. package/src/stores/use-chatroom-store.ts +276 -0
  163. package/src/types/index.ts +56 -2
@@ -17,6 +17,7 @@ export interface Message {
17
17
  suppressed?: boolean
18
18
  bookmarked?: boolean
19
19
  suggestions?: string[]
20
+ replyToId?: string
20
21
  }
21
22
 
22
23
  export type ProviderType = 'claude-cli' | 'codex-cli' | 'opencode-cli' | 'openai' | 'ollama' | 'anthropic' | 'openclaw' | 'google' | 'deepseek' | 'groq' | 'together' | 'mistral' | 'xai' | 'fireworks'
@@ -182,11 +183,13 @@ export interface MarketplacePlugin {
182
183
  }
183
184
 
184
185
  export interface SSEEvent {
185
- t: 'd' | 'md' | 'r' | 'done' | 'err' | 'tool_call' | 'tool_result' | 'status'
186
+ t: 'd' | 'md' | 'r' | 'done' | 'err' | 'tool_call' | 'tool_result' | 'status' | 'thinking' | 'cr_agent_start' | 'cr_agent_done'
186
187
  text?: string
187
188
  toolName?: string
188
189
  toolInput?: string
189
190
  toolOutput?: string
191
+ agentId?: string
192
+ agentName?: string
190
193
  }
191
194
 
192
195
  export interface Directory {
@@ -253,6 +256,9 @@ export interface Agent {
253
256
  thinkingLevel?: 'minimal' | 'low' | 'medium' | 'high'
254
257
  projectId?: string
255
258
  avatarSeed?: string
259
+ pinned?: boolean
260
+ lastUsedAt?: number
261
+ totalCost?: number
256
262
  trashedAt?: number
257
263
  openclawSkillMode?: SkillAllowlistMode
258
264
  openclawAllowedSkills?: string[]
@@ -331,12 +337,50 @@ export interface MemoryEntry {
331
337
  image?: MemoryImage | null
332
338
  imagePath?: string | null
333
339
  linkedMemoryIds?: string[]
340
+ pinned?: boolean
341
+ sharedWith?: string[]
334
342
  createdAt: number
335
343
  updatedAt: number
336
344
  }
337
345
 
338
346
  export type SessionType = 'human' | 'orchestrated'
339
- export type AppView = 'agents' | 'schedules' | 'memory' | 'tasks' | 'secrets' | 'providers' | 'skills' | 'connectors' | 'webhooks' | 'mcp_servers' | 'knowledge' | 'plugins' | 'usage' | 'runs' | 'logs' | 'settings' | 'projects' | 'activity'
347
+ export type AppView = 'home' | 'agents' | 'chatrooms' | 'schedules' | 'memory' | 'tasks' | 'secrets' | 'providers' | 'skills' | 'connectors' | 'webhooks' | 'mcp_servers' | 'knowledge' | 'plugins' | 'usage' | 'runs' | 'logs' | 'settings' | 'projects' | 'activity'
348
+
349
+ // --- Chatrooms ---
350
+
351
+ export interface ChatroomReaction {
352
+ emoji: string
353
+ reactorId: string // 'user' or agentId
354
+ time: number
355
+ }
356
+
357
+ export interface ChatroomMessage {
358
+ id: string
359
+ senderId: string // 'user' or agentId
360
+ senderName: string
361
+ role: 'user' | 'assistant'
362
+ text: string
363
+ mentions: string[] // parsed agentIds
364
+ reactions: ChatroomReaction[]
365
+ toolEvents?: MessageToolEvent[]
366
+ time: number
367
+ attachedFiles?: string[]
368
+ imagePath?: string
369
+ replyToId?: string
370
+ }
371
+
372
+ export interface Chatroom {
373
+ id: string
374
+ name: string
375
+ description?: string
376
+ agentIds: string[]
377
+ messages: ChatroomMessage[]
378
+ pinnedMessageIds?: string[]
379
+ chatMode?: 'sequential' | 'parallel'
380
+ autoAddress?: boolean
381
+ createdAt: number
382
+ updatedAt: number
383
+ }
340
384
 
341
385
  // --- Activity / Audit Trail ---
342
386
 
@@ -382,8 +426,11 @@ export interface AppNotification {
382
426
  type: 'info' | 'success' | 'warning' | 'error'
383
427
  title: string
384
428
  message?: string
429
+ actionLabel?: string
430
+ actionUrl?: string
385
431
  entityType?: string
386
432
  entityId?: string
433
+ dedupKey?: string
387
434
  read: boolean
388
435
  createdAt: number
389
436
  }
@@ -455,6 +502,7 @@ export interface AppSettings {
455
502
  shellCommandTimeoutSec?: number
456
503
  claudeCodeTimeoutSec?: number
457
504
  cliProcessTimeoutSec?: number
505
+ userAvatarSeed?: string
458
506
  elevenLabsApiKey?: string | null
459
507
  elevenLabsVoiceId?: string | null
460
508
  speechRecognitionLang?: string | null
@@ -499,6 +547,10 @@ export interface AppSettings {
499
547
  memoryMaxPerLookup?: number
500
548
  // Voice conversation
501
549
  voiceAutoSendDelaySec?: number
550
+ // Default agent for main chat on startup
551
+ defaultAgentId?: string | null
552
+ // Theme
553
+ themeHue?: string
502
554
  // Web search provider
503
555
  webSearchProvider?: 'duckduckgo' | 'google' | 'bing' | 'searxng' | 'tavily' | 'brave'
504
556
  searxngUrl?: string
@@ -561,6 +613,8 @@ export interface Skill {
561
613
  description?: string
562
614
  sourceUrl?: string
563
615
  sourceFormat?: 'openclaw' | 'plain'
616
+ scope?: 'global' | 'agent'
617
+ agentIds?: string[]
564
618
  createdAt: number
565
619
  updatedAt: number
566
620
  }