@swarmclawai/swarmclaw 1.3.4 → 1.3.6
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 +20 -76
- package/package.json +3 -2
- package/skills/swarmclaw.md +17 -0
- package/src/app/api/agents/[id]/dream/route.ts +45 -0
- package/src/app/api/knowledge/[id]/route.ts +48 -49
- package/src/app/api/knowledge/hygiene/route.ts +13 -0
- package/src/app/api/knowledge/route.ts +70 -42
- package/src/app/api/knowledge/sources/[id]/archive/route.ts +15 -0
- package/src/app/api/knowledge/sources/[id]/restore/route.ts +10 -0
- package/src/app/api/knowledge/sources/[id]/route.ts +1 -0
- package/src/app/api/knowledge/sources/[id]/supersede/route.ts +26 -0
- package/src/app/api/knowledge/sources/[id]/sync/route.ts +17 -0
- package/src/app/api/knowledge/sources/route.ts +1 -0
- package/src/app/api/knowledge/upload/route.ts +3 -51
- package/src/app/api/memory/dream/[id]/route.ts +19 -0
- package/src/app/api/memory/dream/route.ts +34 -0
- package/src/app/knowledge/layout.tsx +1 -1
- package/src/app/knowledge/page.tsx +2 -22
- package/src/app/protocols/page.tsx +21 -2
- package/src/cli/index.js +16 -0
- package/src/cli/spec.js +5 -0
- package/src/components/agents/agent-sheet.tsx +65 -0
- package/src/components/chat/message-bubble.tsx +10 -0
- package/src/components/knowledge/grounding-panel.tsx +99 -0
- package/src/components/knowledge/knowledge-detail.tsx +402 -0
- package/src/components/knowledge/knowledge-list.tsx +351 -126
- package/src/components/knowledge/knowledge-sheet.tsx +208 -119
- package/src/components/memory/dream-history.tsx +155 -0
- package/src/components/memory/memory-card.tsx +7 -0
- package/src/components/memory/memory-detail.tsx +46 -0
- package/src/components/runs/run-list.tsx +23 -0
- package/src/lib/server/api-routes.test.ts +43 -2
- package/src/lib/server/chat-execution/chat-execution-disabled.test.ts +14 -31
- package/src/lib/server/chat-execution/chat-execution-eval-history.test.ts +11 -34
- package/src/lib/server/chat-execution/chat-execution-grounding.test.ts +108 -0
- package/src/lib/server/chat-execution/chat-execution-session-sync.test.ts +35 -36
- package/src/lib/server/chat-execution/chat-execution-types.ts +8 -1
- package/src/lib/server/chat-execution/chat-execution.ts +1 -0
- package/src/lib/server/chat-execution/chat-turn-finalization.ts +21 -1
- package/src/lib/server/chat-execution/chat-turn-stream-execution.ts +6 -1
- package/src/lib/server/chat-execution/post-stream-finalization.ts +15 -3
- package/src/lib/server/chat-execution/prompt-sections.ts +29 -3
- package/src/lib/server/chat-execution/stream-agent-chat.ts +6 -1
- package/src/lib/server/execution-engine/task-attempt.ts +8 -2
- package/src/lib/server/knowledge-import.ts +159 -0
- package/src/lib/server/knowledge-sources.test.ts +261 -0
- package/src/lib/server/knowledge-sources.ts +1284 -0
- package/src/lib/server/memory/dream-cycles.ts +49 -0
- package/src/lib/server/memory/dream-idle-callback.ts +38 -0
- package/src/lib/server/memory/dream-service.ts +315 -0
- package/src/lib/server/memory/memory-db.ts +37 -2
- package/src/lib/server/protocols/protocol-agent-turn.ts +7 -0
- package/src/lib/server/protocols/protocol-run-lifecycle.ts +19 -6
- package/src/lib/server/protocols/protocol-service.test.ts +99 -0
- package/src/lib/server/protocols/protocol-step-helpers.ts +7 -1
- package/src/lib/server/protocols/protocol-step-processors.ts +16 -3
- package/src/lib/server/protocols/protocol-types.ts +4 -0
- package/src/lib/server/runtime/daemon-state/core.ts +6 -1
- package/src/lib/server/runtime/run-ledger.test.ts +120 -0
- package/src/lib/server/runtime/run-ledger.ts +27 -1
- package/src/lib/server/runtime/session-run-manager/drain.ts +5 -0
- package/src/lib/server/runtime/session-run-manager/state.ts +19 -2
- package/src/lib/server/storage-normalization.ts +5 -0
- package/src/lib/server/storage.ts +15 -0
- package/src/lib/server/test-utils/run-with-temp-data-dir.ts +15 -2
- package/src/stores/slices/ui-slice.ts +4 -0
- package/src/types/agent.ts +7 -0
- package/src/types/dream.ts +45 -0
- package/src/types/index.ts +1 -0
- package/src/types/message.ts +3 -0
- package/src/types/misc.ts +131 -0
- package/src/types/protocol.ts +4 -0
- package/src/types/run.ts +4 -1
package/src/types/protocol.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MessageToolEvent } from './message'
|
|
2
|
+
import type { KnowledgeCitation, KnowledgeRetrievalTrace } from './misc'
|
|
2
3
|
|
|
3
4
|
// --- Structured Session Runs / Protocols ---
|
|
4
5
|
|
|
@@ -140,6 +141,8 @@ export interface ProtocolRunPhaseStateResponse {
|
|
|
140
141
|
agentId: string
|
|
141
142
|
text: string
|
|
142
143
|
toolEvents?: MessageToolEvent[]
|
|
144
|
+
citations?: KnowledgeCitation[]
|
|
145
|
+
retrievalTrace?: KnowledgeRetrievalTrace | null
|
|
143
146
|
}
|
|
144
147
|
|
|
145
148
|
export interface ProtocolRunPhaseState {
|
|
@@ -417,4 +420,5 @@ export interface ProtocolRunEvent {
|
|
|
417
420
|
taskId?: string | null
|
|
418
421
|
createdAt: number
|
|
419
422
|
data?: Record<string, unknown> | null
|
|
423
|
+
citations?: KnowledgeCitation[]
|
|
420
424
|
}
|
package/src/types/run.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSEEvent } from './misc'
|
|
1
|
+
import type { KnowledgeCitation, KnowledgeRetrievalTrace, SSEEvent } from './misc'
|
|
2
2
|
|
|
3
3
|
// --- Session Runs ---
|
|
4
4
|
|
|
@@ -71,6 +71,7 @@ export interface SessionRunRecord {
|
|
|
71
71
|
totalInputTokens?: number
|
|
72
72
|
totalOutputTokens?: number
|
|
73
73
|
estimatedCost?: number
|
|
74
|
+
retrievalSummary?: { citationCount: number; sourceIds: string[] } | null
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
export interface SessionQueuedTurn {
|
|
@@ -107,6 +108,8 @@ export interface RunEventRecord {
|
|
|
107
108
|
status?: SessionRunStatus
|
|
108
109
|
summary?: string
|
|
109
110
|
event: SSEEvent
|
|
111
|
+
citations?: KnowledgeCitation[]
|
|
112
|
+
retrievalTrace?: KnowledgeRetrievalTrace | null
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
export type RuntimeFailureFamily =
|