@swarmclawai/swarmclaw 1.2.6 → 1.2.8
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 +24 -17
- package/next.config.ts +1 -0
- package/package.json +3 -2
- package/scripts/easy-setup.mjs +1 -1
- package/scripts/postinstall.mjs +1 -1
- package/skills/swarmclaw.md +115 -0
- package/skills/tools/browser.md +131 -0
- package/skills/tools/execute.md +98 -0
- package/skills/tools/files.md +98 -0
- package/skills/tools/memory.md +104 -0
- package/skills/tools/platform.md +144 -0
- package/skills/tools/skills.md +83 -0
- package/src/app/api/chats/[id]/messages/route.ts +23 -19
- package/src/app/api/chats/messages-route.test.ts +105 -51
- package/src/app/api/mcp-servers/[id]/test/route.ts +3 -2
- package/src/app/api/openclaw/deploy/route.ts +2 -0
- package/src/app/api/setup/doctor/route.ts +4 -4
- package/src/components/agents/agent-chat-list.tsx +23 -1
- package/src/components/agents/inspector-panel.tsx +165 -48
- package/src/components/chat/chat-area.tsx +38 -9
- package/src/components/chat/message-list.tsx +33 -19
- package/src/components/gateways/gateway-sheet.tsx +5 -2
- package/src/lib/agent-execute-defaults.test.ts +24 -0
- package/src/lib/agent-execute-defaults.ts +62 -0
- package/src/lib/chat/queued-message-queue.test.ts +134 -1
- package/src/lib/chat/queued-message-queue.ts +77 -2
- package/src/lib/server/agents/agent-service.ts +5 -0
- package/src/lib/server/builtin-extensions.ts +1 -0
- package/src/lib/server/chat-execution/chat-execution-advanced.test.ts +1 -1
- package/src/lib/server/chat-execution/chat-execution-tool-events.test.ts +1 -0
- package/src/lib/server/chat-execution/chat-execution-utils.ts +2 -2
- package/src/lib/server/chat-execution/chat-turn-preparation.ts +79 -42
- package/src/lib/server/chat-execution/chat-turn-stream-execution.ts +4 -0
- package/src/lib/server/chat-execution/continuation-evaluator.ts +8 -0
- package/src/lib/server/chat-execution/memory-mutation-tools.ts +1 -1
- package/src/lib/server/chat-execution/message-classifier.ts +11 -1
- package/src/lib/server/chat-execution/prompt-builder.test.ts +28 -0
- package/src/lib/server/chat-execution/prompt-builder.ts +14 -1
- package/src/lib/server/chat-execution/prompt-mode.test.ts +24 -0
- package/src/lib/server/chat-execution/prompt-mode.ts +5 -1
- package/src/lib/server/chat-execution/stream-agent-chat.test.ts +6 -4
- package/src/lib/server/chat-execution/stream-agent-chat.ts +45 -16
- package/src/lib/server/chatrooms/chatroom-routing.test.ts +4 -0
- package/src/lib/server/connectors/discord.ts +2 -2
- package/src/lib/server/connectors/matrix.ts +3 -2
- package/src/lib/server/connectors/signal.ts +5 -4
- package/src/lib/server/connectors/slack.ts +10 -9
- package/src/lib/server/connectors/teams.ts +3 -2
- package/src/lib/server/connectors/telegram.ts +4 -4
- package/src/lib/server/connectors/whatsapp.ts +2 -2
- package/src/lib/server/daemon/controller.ts +7 -0
- package/src/lib/server/gateways/gateway-profile-service.ts +19 -1
- package/src/lib/server/messages/message-repository.test.ts +70 -0
- package/src/lib/server/messages/message-repository.ts +11 -6
- package/src/lib/server/openclaw/deploy.ts +32 -2
- package/src/lib/server/plugins-advanced.test.ts +1 -2
- package/src/lib/server/provider-health.ts +1 -1
- package/src/lib/server/runtime/process-manager.ts +13 -9
- package/src/lib/server/runtime/session-run-manager/queries.ts +15 -0
- package/src/lib/server/runtime/session-run-manager.test.ts +58 -0
- package/src/lib/server/sandbox/session-runtime.test.ts +18 -1
- package/src/lib/server/sandbox/session-runtime.ts +40 -28
- package/src/lib/server/session-tools/autonomy-tools.test.ts +7 -9
- package/src/lib/server/session-tools/context.ts +1 -1
- package/src/lib/server/session-tools/credential-env.ts +109 -0
- package/src/lib/server/session-tools/crud.ts +3 -3
- package/src/lib/server/session-tools/edit_file.ts +3 -2
- package/src/lib/server/session-tools/execute.test.ts +58 -0
- package/src/lib/server/session-tools/execute.ts +334 -0
- package/src/lib/server/session-tools/files-tool.ts +635 -0
- package/src/lib/server/session-tools/index.ts +14 -4
- package/src/lib/server/session-tools/memory-tool.ts +242 -0
- package/src/lib/server/session-tools/memory.ts +1 -1
- package/src/lib/server/session-tools/openclaw-nodes.ts +3 -2
- package/src/lib/server/session-tools/openclaw-workspace.ts +3 -2
- package/src/lib/server/session-tools/platform-tool.ts +617 -0
- package/src/lib/server/session-tools/session-info.ts +3 -2
- package/src/lib/server/session-tools/session-tools-wiring.test.ts +3 -4
- package/src/lib/server/session-tools/shell.ts +7 -122
- package/src/lib/server/session-tools/skills-tool.ts +396 -0
- package/src/lib/server/session-tools/web.ts +2 -2
- package/src/lib/server/storage-normalization.ts +2 -0
- package/src/lib/server/tool-aliases.ts +2 -1
- package/src/lib/server/tool-capability-policy-advanced.test.ts +9 -2
- package/src/lib/server/tool-capability-policy.test.ts +2 -1
- package/src/lib/server/tool-capability-policy.ts +60 -33
- package/src/lib/server/tool-planning.ts +11 -0
- package/src/lib/setup-defaults.ts +5 -0
- package/src/lib/tool-definitions.ts +1 -0
- package/src/lib/validation/schemas.test.ts +16 -0
- package/src/lib/validation/schemas.ts +16 -0
- package/src/stores/use-chat-store.test.ts +231 -0
- package/src/stores/use-chat-store.ts +62 -13
- package/src/types/agent.ts +348 -0
- package/src/types/app-settings.ts +175 -0
- package/src/types/approval.ts +27 -0
- package/src/types/connector.ts +187 -0
- package/src/types/extension.ts +386 -0
- package/src/types/index.ts +16 -3555
- package/src/types/message.ts +57 -0
- package/src/types/misc.ts +739 -0
- package/src/types/mission.ts +185 -0
- package/src/types/protocol.ts +422 -0
- package/src/types/provider.ts +52 -0
- package/src/types/run.ts +183 -0
- package/src/types/schedule.ts +59 -0
- package/src/types/session.ts +265 -0
- package/src/types/skill.ts +157 -0
- package/src/types/task.ts +140 -0
- package/src/types/working-state.ts +211 -0
- package/src/views/settings/section-heartbeat.tsx +2 -2
- package/src/lib/server/session-tools/sandbox.ts +0 -281
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
import type { MessageToolEvent } from './message'
|
|
2
|
+
import type { MessageSource } from './connector'
|
|
3
|
+
import type { ExtensionDefinitionCost, ExtensionInvocationRecord } from './extension'
|
|
4
|
+
import type { SkillInstallOption, SkillRequirements } from './skill'
|
|
5
|
+
|
|
6
|
+
export interface SSEEvent {
|
|
7
|
+
t: 'd' | 'md' | 'r' | 'done' | 'err' | 'tool_call' | 'tool_result' | 'status' | 'thinking' | 'reset' | 'cr_agent_start' | 'cr_agent_done'
|
|
8
|
+
text?: string
|
|
9
|
+
toolName?: string
|
|
10
|
+
toolInput?: string
|
|
11
|
+
toolOutput?: string
|
|
12
|
+
toolCallId?: string
|
|
13
|
+
agentId?: string
|
|
14
|
+
agentName?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface Directory {
|
|
18
|
+
name: string
|
|
19
|
+
path: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface DevServerStatus {
|
|
23
|
+
running: boolean
|
|
24
|
+
url?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DeployResult {
|
|
28
|
+
ok: boolean
|
|
29
|
+
output?: string
|
|
30
|
+
error?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface UploadResult {
|
|
34
|
+
path: string
|
|
35
|
+
size: number
|
|
36
|
+
url: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface NetworkInfo {
|
|
40
|
+
ip: string
|
|
41
|
+
port: number
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface UsageRecord {
|
|
45
|
+
sessionId: string
|
|
46
|
+
messageIndex: number
|
|
47
|
+
model: string
|
|
48
|
+
provider: string
|
|
49
|
+
inputTokens: number
|
|
50
|
+
outputTokens: number
|
|
51
|
+
totalTokens: number
|
|
52
|
+
estimatedCost: number
|
|
53
|
+
timestamp: number
|
|
54
|
+
durationMs?: number
|
|
55
|
+
agentId?: string | null
|
|
56
|
+
projectId?: string | null
|
|
57
|
+
extensionDefinitionCosts?: ExtensionDefinitionCost[]
|
|
58
|
+
extensionInvocations?: ExtensionInvocationRecord[]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- Chatrooms ---
|
|
62
|
+
|
|
63
|
+
export interface ChatroomRoutingRule {
|
|
64
|
+
id: string
|
|
65
|
+
type: 'keyword' | 'capability'
|
|
66
|
+
pattern?: string
|
|
67
|
+
keywords?: string[]
|
|
68
|
+
agentId: string
|
|
69
|
+
priority: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ChatroomMember {
|
|
73
|
+
agentId: string
|
|
74
|
+
role: 'admin' | 'moderator' | 'member'
|
|
75
|
+
mutedUntil?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ChatroomReaction {
|
|
79
|
+
emoji: string
|
|
80
|
+
reactorId: string // 'user' or agentId
|
|
81
|
+
time: number
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ChatroomMessage {
|
|
85
|
+
id: string
|
|
86
|
+
senderId: string // 'user' or agentId
|
|
87
|
+
senderName: string
|
|
88
|
+
role: 'user' | 'assistant'
|
|
89
|
+
text: string
|
|
90
|
+
mentions: string[] // parsed agentIds
|
|
91
|
+
reactions: ChatroomReaction[]
|
|
92
|
+
toolEvents?: MessageToolEvent[]
|
|
93
|
+
time: number
|
|
94
|
+
attachedFiles?: string[]
|
|
95
|
+
imagePath?: string
|
|
96
|
+
replyToId?: string
|
|
97
|
+
targetAgentId?: string
|
|
98
|
+
source?: MessageSource
|
|
99
|
+
historyExcluded?: boolean
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface Chatroom {
|
|
103
|
+
id: string
|
|
104
|
+
name: string
|
|
105
|
+
description?: string
|
|
106
|
+
agentIds: string[]
|
|
107
|
+
members?: ChatroomMember[]
|
|
108
|
+
messages: ChatroomMessage[]
|
|
109
|
+
pinnedMessageIds?: string[]
|
|
110
|
+
chatMode?: 'sequential' | 'parallel'
|
|
111
|
+
autoAddress?: boolean
|
|
112
|
+
routingGuidance?: string | null
|
|
113
|
+
/** Legacy deterministic routing config kept only for migration/read compatibility. */
|
|
114
|
+
routingRules?: ChatroomRoutingRule[]
|
|
115
|
+
temporary?: boolean
|
|
116
|
+
topic?: string
|
|
117
|
+
hidden?: boolean
|
|
118
|
+
archivedAt?: number | null
|
|
119
|
+
protocolRunId?: string | null
|
|
120
|
+
parentChatroomId?: string | null
|
|
121
|
+
createdAt: number
|
|
122
|
+
updatedAt: number
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// --- Activity / Audit Trail ---
|
|
126
|
+
|
|
127
|
+
export interface ActivityEntry {
|
|
128
|
+
id: string
|
|
129
|
+
entityType: 'agent' | 'task' | 'connector' | 'session' | 'webhook' | 'schedule' | 'delegation' | 'swarm' | 'chatroom' | 'coordination'
|
|
130
|
+
entityId: string
|
|
131
|
+
action: 'created' | 'updated' | 'deleted' | 'started' | 'stopped' | 'queued' | 'completed' | 'failed' | 'archived' | 'restored' | 'approved' | 'rejected' | 'delegated' | 'queried' | 'spawned' | 'timeout' | 'cancelled' | 'incident' | 'running' | 'claimed'
|
|
132
|
+
actor: 'user' | 'agent' | 'system' | 'daemon'
|
|
133
|
+
actorId?: string
|
|
134
|
+
summary: string
|
|
135
|
+
detail?: Record<string, unknown>
|
|
136
|
+
timestamp: number
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// --- Webhook Retry Queue ---
|
|
140
|
+
|
|
141
|
+
export interface WebhookRetryEntry {
|
|
142
|
+
id: string
|
|
143
|
+
webhookId: string
|
|
144
|
+
event: string
|
|
145
|
+
payload: string
|
|
146
|
+
attempts: number
|
|
147
|
+
maxAttempts: number
|
|
148
|
+
nextRetryAt: number
|
|
149
|
+
deadLettered: boolean
|
|
150
|
+
createdAt: number
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface Project {
|
|
154
|
+
id: string
|
|
155
|
+
name: string
|
|
156
|
+
description: string
|
|
157
|
+
color?: string
|
|
158
|
+
objective?: string
|
|
159
|
+
audience?: string
|
|
160
|
+
priorities?: string[]
|
|
161
|
+
openObjectives?: string[]
|
|
162
|
+
capabilityHints?: string[]
|
|
163
|
+
credentialRequirements?: string[]
|
|
164
|
+
successMetrics?: string[]
|
|
165
|
+
heartbeatPrompt?: string
|
|
166
|
+
heartbeatIntervalSec?: number
|
|
167
|
+
createdAt: number
|
|
168
|
+
updatedAt: number
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// --- Notifications ---
|
|
172
|
+
|
|
173
|
+
export interface AppNotification {
|
|
174
|
+
id: string
|
|
175
|
+
type: 'info' | 'success' | 'warning' | 'error'
|
|
176
|
+
title: string
|
|
177
|
+
message?: string
|
|
178
|
+
actionLabel?: string
|
|
179
|
+
actionUrl?: string
|
|
180
|
+
entityType?: string
|
|
181
|
+
entityId?: string
|
|
182
|
+
dedupKey?: string
|
|
183
|
+
read: boolean
|
|
184
|
+
createdAt: number
|
|
185
|
+
updatedAt?: number
|
|
186
|
+
occurrenceCount?: number
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// --- Webhook Logs ---
|
|
190
|
+
|
|
191
|
+
export interface WebhookLogEntry {
|
|
192
|
+
id: string
|
|
193
|
+
webhookId: string
|
|
194
|
+
event: string
|
|
195
|
+
payload: string
|
|
196
|
+
status: 'success' | 'error'
|
|
197
|
+
sessionId?: string
|
|
198
|
+
runId?: string
|
|
199
|
+
error?: string
|
|
200
|
+
timestamp: number
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// --- Agent Secrets ---
|
|
204
|
+
|
|
205
|
+
export interface StoredSecret {
|
|
206
|
+
id: string
|
|
207
|
+
name: string
|
|
208
|
+
service: string // e.g. 'gmail', 'ahrefs', 'custom'
|
|
209
|
+
encryptedValue: string
|
|
210
|
+
scope: 'global' | 'agent'
|
|
211
|
+
agentIds: string[] // if scope === 'agent', which agents can use it
|
|
212
|
+
projectId?: string
|
|
213
|
+
createdAt: number
|
|
214
|
+
updatedAt: number
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface Webhook {
|
|
218
|
+
id: string
|
|
219
|
+
name: string
|
|
220
|
+
source: string
|
|
221
|
+
events: string[]
|
|
222
|
+
agentId?: string | null
|
|
223
|
+
secret?: string
|
|
224
|
+
isEnabled: boolean
|
|
225
|
+
createdAt: number
|
|
226
|
+
updatedAt: number
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface DocumentRevision {
|
|
230
|
+
id: string
|
|
231
|
+
documentId: string
|
|
232
|
+
version: number
|
|
233
|
+
content: string
|
|
234
|
+
createdAt: number
|
|
235
|
+
createdBy?: string | null
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface DocumentEntry {
|
|
239
|
+
id: string
|
|
240
|
+
title: string
|
|
241
|
+
fileName: string
|
|
242
|
+
sourcePath: string
|
|
243
|
+
content: string
|
|
244
|
+
method: string
|
|
245
|
+
textLength: number
|
|
246
|
+
currentVersion?: number
|
|
247
|
+
metadata?: Record<string, unknown>
|
|
248
|
+
createdAt: number
|
|
249
|
+
updatedAt: number
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// --- Browser Sessions ---
|
|
253
|
+
|
|
254
|
+
export type BrowserSessionStatus = 'active' | 'idle' | 'closed' | 'error'
|
|
255
|
+
|
|
256
|
+
export interface BrowserSessionTab {
|
|
257
|
+
index: number
|
|
258
|
+
title?: string | null
|
|
259
|
+
url?: string | null
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface BrowserSessionArtifact {
|
|
263
|
+
kind: 'snapshot' | 'screenshot' | 'download' | 'pdf'
|
|
264
|
+
path: string
|
|
265
|
+
url?: string | null
|
|
266
|
+
filename?: string | null
|
|
267
|
+
createdAt: number
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface BrowserObservationLink {
|
|
271
|
+
text: string
|
|
272
|
+
href: string
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface BrowserObservationFormField {
|
|
276
|
+
name?: string | null
|
|
277
|
+
label?: string | null
|
|
278
|
+
type: string
|
|
279
|
+
required?: boolean
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface BrowserObservationForm {
|
|
283
|
+
index: number
|
|
284
|
+
action?: string | null
|
|
285
|
+
method?: string | null
|
|
286
|
+
fields: BrowserObservationFormField[]
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface BrowserObservationTable {
|
|
290
|
+
index: number
|
|
291
|
+
headers: string[]
|
|
292
|
+
rowCount: number
|
|
293
|
+
rows?: string[][]
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface BrowserObservation {
|
|
297
|
+
capturedAt: number
|
|
298
|
+
url?: string | null
|
|
299
|
+
title?: string | null
|
|
300
|
+
textPreview?: string | null
|
|
301
|
+
activeTabIndex?: number | null
|
|
302
|
+
tabs?: BrowserSessionTab[]
|
|
303
|
+
links?: BrowserObservationLink[]
|
|
304
|
+
forms?: BrowserObservationForm[]
|
|
305
|
+
tables?: BrowserObservationTable[]
|
|
306
|
+
errors?: string[]
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface BrowserSandboxRuntimeInfo {
|
|
310
|
+
scopeKey?: string | null
|
|
311
|
+
containerName?: string | null
|
|
312
|
+
cdpEndpoint?: string | null
|
|
313
|
+
cdpPort?: number | null
|
|
314
|
+
noVncPort?: number | null
|
|
315
|
+
bridgeUrl?: string | null
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface BrowserSessionRecord {
|
|
319
|
+
id: string
|
|
320
|
+
sessionId: string
|
|
321
|
+
profileId: string
|
|
322
|
+
profileDir: string
|
|
323
|
+
status: BrowserSessionStatus
|
|
324
|
+
runtime?: 'host' | 'sandbox-browser' | null
|
|
325
|
+
sandbox?: BrowserSandboxRuntimeInfo | null
|
|
326
|
+
inheritedFromSessionId?: string | null
|
|
327
|
+
currentUrl?: string | null
|
|
328
|
+
pageTitle?: string | null
|
|
329
|
+
activeTabIndex?: number | null
|
|
330
|
+
tabs?: BrowserSessionTab[]
|
|
331
|
+
lastAction?: string | null
|
|
332
|
+
lastError?: string | null
|
|
333
|
+
lastObservation?: BrowserObservation | null
|
|
334
|
+
artifacts?: BrowserSessionArtifact[]
|
|
335
|
+
createdAt: number
|
|
336
|
+
updatedAt: number
|
|
337
|
+
lastUsedAt: number
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// --- Watch Jobs ---
|
|
341
|
+
|
|
342
|
+
export type WatchJobType = 'time' | 'http' | 'file' | 'task' | 'webhook' | 'page' | 'email' | 'mailbox' | 'approval'
|
|
343
|
+
export type WatchJobStatus = 'active' | 'triggered' | 'failed' | 'cancelled'
|
|
344
|
+
|
|
345
|
+
export interface WatchJob {
|
|
346
|
+
id: string
|
|
347
|
+
type: WatchJobType
|
|
348
|
+
status: WatchJobStatus
|
|
349
|
+
description?: string | null
|
|
350
|
+
sessionId?: string | null
|
|
351
|
+
agentId?: string | null
|
|
352
|
+
createdByAgentId?: string | null
|
|
353
|
+
browserProfileId?: string | null
|
|
354
|
+
resumeMessage: string
|
|
355
|
+
target: Record<string, unknown>
|
|
356
|
+
condition: Record<string, unknown>
|
|
357
|
+
runAt?: number | null
|
|
358
|
+
nextCheckAt?: number | null
|
|
359
|
+
intervalMs?: number | null
|
|
360
|
+
timeoutAt?: number | null
|
|
361
|
+
lastCheckedAt?: number | null
|
|
362
|
+
lastTriggeredAt?: number | null
|
|
363
|
+
lastError?: string | null
|
|
364
|
+
result?: Record<string, unknown> | null
|
|
365
|
+
createdAt: number
|
|
366
|
+
updatedAt: number
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// --- Delegation Jobs ---
|
|
370
|
+
|
|
371
|
+
export type DelegationJobKind = 'subagent' | 'delegate'
|
|
372
|
+
export type DelegationJobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled'
|
|
373
|
+
|
|
374
|
+
export interface DelegationJobCheckpoint {
|
|
375
|
+
at: number
|
|
376
|
+
note: string
|
|
377
|
+
status?: DelegationJobStatus
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface DelegationJobArtifact {
|
|
381
|
+
type: 'text' | 'file' | 'image' | 'link'
|
|
382
|
+
value: string
|
|
383
|
+
label?: string | null
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface DelegationJobRecord {
|
|
387
|
+
id: string
|
|
388
|
+
kind: DelegationJobKind
|
|
389
|
+
status: DelegationJobStatus
|
|
390
|
+
backend?: 'claude' | 'codex' | 'opencode' | 'gemini' | null
|
|
391
|
+
missionId?: string | null
|
|
392
|
+
parentMissionId?: string | null
|
|
393
|
+
parentSessionId?: string | null
|
|
394
|
+
childSessionId?: string | null
|
|
395
|
+
agentId?: string | null
|
|
396
|
+
agentName?: string | null
|
|
397
|
+
cwd?: string | null
|
|
398
|
+
task: string
|
|
399
|
+
result?: string | null
|
|
400
|
+
resultPreview?: string | null
|
|
401
|
+
error?: string | null
|
|
402
|
+
checkpoints?: DelegationJobCheckpoint[]
|
|
403
|
+
artifacts?: DelegationJobArtifact[]
|
|
404
|
+
resumeId?: string | null
|
|
405
|
+
resumeIds?: {
|
|
406
|
+
claudeCode?: string | null
|
|
407
|
+
codex?: string | null
|
|
408
|
+
opencode?: string | null
|
|
409
|
+
gemini?: string | null
|
|
410
|
+
}
|
|
411
|
+
requesterRunId?: string | null
|
|
412
|
+
childRunId?: string | null
|
|
413
|
+
createdAt: number
|
|
414
|
+
updatedAt: number
|
|
415
|
+
startedAt?: number | null
|
|
416
|
+
completedAt?: number | null
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// --- File & Memory References ---
|
|
420
|
+
|
|
421
|
+
export interface FileReference {
|
|
422
|
+
path: string
|
|
423
|
+
contextSnippet?: string
|
|
424
|
+
kind?: 'file' | 'folder' | 'project'
|
|
425
|
+
projectRoot?: string
|
|
426
|
+
projectName?: string
|
|
427
|
+
exists?: boolean
|
|
428
|
+
timestamp: number
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface MemoryReference {
|
|
432
|
+
type: 'project' | 'folder' | 'file' | 'task' | 'session' | 'url'
|
|
433
|
+
path?: string
|
|
434
|
+
projectRoot?: string
|
|
435
|
+
projectName?: string
|
|
436
|
+
title?: string
|
|
437
|
+
note?: string
|
|
438
|
+
exists?: boolean
|
|
439
|
+
timestamp: number
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface MemoryImage {
|
|
443
|
+
path: string
|
|
444
|
+
mimeType?: string
|
|
445
|
+
width?: number
|
|
446
|
+
height?: number
|
|
447
|
+
sizeBytes?: number
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export interface MemoryEntry {
|
|
451
|
+
id: string
|
|
452
|
+
agentId?: string | null
|
|
453
|
+
sessionId?: string | null
|
|
454
|
+
category: string
|
|
455
|
+
title: string
|
|
456
|
+
content: string
|
|
457
|
+
metadata?: Record<string, unknown>
|
|
458
|
+
references?: MemoryReference[]
|
|
459
|
+
filePaths?: FileReference[]
|
|
460
|
+
image?: MemoryImage | null
|
|
461
|
+
imagePath?: string | null
|
|
462
|
+
linkedMemoryIds?: string[]
|
|
463
|
+
pinned?: boolean
|
|
464
|
+
sharedWith?: string[]
|
|
465
|
+
accessCount?: number
|
|
466
|
+
lastAccessedAt?: number
|
|
467
|
+
contentHash?: string
|
|
468
|
+
reinforcementCount?: number
|
|
469
|
+
abstract?: string | null
|
|
470
|
+
createdAt: number
|
|
471
|
+
updatedAt: number
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// --- MCP Servers ---
|
|
475
|
+
|
|
476
|
+
export type McpTransport = 'stdio' | 'sse' | 'streamable-http'
|
|
477
|
+
|
|
478
|
+
export interface McpServerConfig {
|
|
479
|
+
id: string
|
|
480
|
+
name: string
|
|
481
|
+
transport: McpTransport
|
|
482
|
+
command?: string // for stdio transport
|
|
483
|
+
args?: string[] // for stdio transport
|
|
484
|
+
url?: string // for sse/streamable-http transport
|
|
485
|
+
env?: Record<string, string> // environment variables
|
|
486
|
+
headers?: Record<string, string> // HTTP headers for sse/streamable-http
|
|
487
|
+
createdAt: number
|
|
488
|
+
updatedAt: number
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// --- Gateways ---
|
|
492
|
+
|
|
493
|
+
export type GatewayProvider = 'openclaw'
|
|
494
|
+
export type GatewayHealthState = 'unknown' | 'healthy' | 'degraded' | 'offline' | 'pending'
|
|
495
|
+
export type OpenClawDeploymentMethod = 'local' | 'bundle' | 'ssh' | 'imported'
|
|
496
|
+
export type OpenClawDeploymentProvider =
|
|
497
|
+
| 'local'
|
|
498
|
+
| 'hetzner'
|
|
499
|
+
| 'digitalocean'
|
|
500
|
+
| 'vultr'
|
|
501
|
+
| 'linode'
|
|
502
|
+
| 'lightsail'
|
|
503
|
+
| 'gcp'
|
|
504
|
+
| 'azure'
|
|
505
|
+
| 'oci'
|
|
506
|
+
| 'generic'
|
|
507
|
+
| 'render'
|
|
508
|
+
| 'fly'
|
|
509
|
+
| 'railway'
|
|
510
|
+
export type OpenClawRemoteDeployTarget = 'docker' | 'render' | 'fly' | 'railway'
|
|
511
|
+
export type OpenClawUseCaseTemplate = 'local-dev' | 'single-vps' | 'private-tailnet' | 'browser-heavy' | 'team-control'
|
|
512
|
+
export type OpenClawExposurePreset = 'private-lan' | 'tailscale' | 'caddy' | 'nginx' | 'ssh-tunnel'
|
|
513
|
+
|
|
514
|
+
export interface OpenClawGatewayStats {
|
|
515
|
+
nodeCount?: number
|
|
516
|
+
connectedNodeCount?: number
|
|
517
|
+
pendingNodePairings?: number
|
|
518
|
+
pairedDeviceCount?: number
|
|
519
|
+
pendingDevicePairings?: number
|
|
520
|
+
externalRuntimeCount?: number
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export interface OpenClawDeploymentConfig {
|
|
524
|
+
method?: OpenClawDeploymentMethod | null
|
|
525
|
+
provider?: OpenClawDeploymentProvider | null
|
|
526
|
+
remoteTarget?: OpenClawRemoteDeployTarget | null
|
|
527
|
+
useCase?: OpenClawUseCaseTemplate | null
|
|
528
|
+
exposure?: OpenClawExposurePreset | null
|
|
529
|
+
managedBy?: 'swarmclaw' | 'manual' | null
|
|
530
|
+
localInstanceId?: string | null
|
|
531
|
+
localPort?: number | null
|
|
532
|
+
targetHost?: string | null
|
|
533
|
+
sshHost?: string | null
|
|
534
|
+
sshUser?: string | null
|
|
535
|
+
sshPort?: number | null
|
|
536
|
+
sshKeyPath?: string | null
|
|
537
|
+
sshTargetDir?: string | null
|
|
538
|
+
image?: string | null
|
|
539
|
+
version?: string | null
|
|
540
|
+
lastDeployAt?: number | null
|
|
541
|
+
lastDeployAction?: string | null
|
|
542
|
+
lastDeployProcessId?: string | null
|
|
543
|
+
lastDeploySummary?: string | null
|
|
544
|
+
lastVerifiedAt?: number | null
|
|
545
|
+
lastVerifiedOk?: boolean | null
|
|
546
|
+
lastVerifiedMessage?: string | null
|
|
547
|
+
lastBackupPath?: string | null
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export interface GatewayProfile {
|
|
551
|
+
id: string
|
|
552
|
+
name: string
|
|
553
|
+
provider: GatewayProvider
|
|
554
|
+
endpoint: string
|
|
555
|
+
wsUrl?: string | null
|
|
556
|
+
credentialId?: string | null
|
|
557
|
+
status: GatewayHealthState
|
|
558
|
+
notes?: string | null
|
|
559
|
+
tags?: string[]
|
|
560
|
+
lastError?: string | null
|
|
561
|
+
lastCheckedAt?: number | null
|
|
562
|
+
lastModelCount?: number | null
|
|
563
|
+
discoveredHost?: string | null
|
|
564
|
+
discoveredPort?: number | null
|
|
565
|
+
deployment?: OpenClawDeploymentConfig | null
|
|
566
|
+
stats?: OpenClawGatewayStats | null
|
|
567
|
+
isDefault?: boolean
|
|
568
|
+
createdAt: number
|
|
569
|
+
updatedAt: number
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
export interface OpenClawNode {
|
|
573
|
+
nodeId: string
|
|
574
|
+
displayName?: string
|
|
575
|
+
platform?: string
|
|
576
|
+
version?: string
|
|
577
|
+
coreVersion?: string
|
|
578
|
+
uiVersion?: string
|
|
579
|
+
deviceFamily?: string
|
|
580
|
+
modelIdentifier?: string
|
|
581
|
+
remoteIp?: string
|
|
582
|
+
caps?: string[]
|
|
583
|
+
commands?: string[]
|
|
584
|
+
pathEnv?: string[]
|
|
585
|
+
permissions?: string[]
|
|
586
|
+
connectedAtMs?: number
|
|
587
|
+
paired?: boolean
|
|
588
|
+
connected?: boolean
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export interface OpenClawNodePairRequest {
|
|
592
|
+
requestId: string
|
|
593
|
+
nodeId?: string
|
|
594
|
+
displayName?: string
|
|
595
|
+
platform?: string
|
|
596
|
+
remoteIp?: string
|
|
597
|
+
createdAtMs?: number
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export interface OpenClawPairedDevice {
|
|
601
|
+
deviceId: string
|
|
602
|
+
displayName?: string
|
|
603
|
+
role?: string
|
|
604
|
+
remoteIp?: string
|
|
605
|
+
platform?: string
|
|
606
|
+
tokens?: Array<{ role?: string; scopes?: string[]; createdAtMs?: number; rotatedAtMs?: number; revokedAtMs?: number }>
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export interface OpenClawDevicePairRequest {
|
|
610
|
+
requestId: string
|
|
611
|
+
deviceId?: string
|
|
612
|
+
displayName?: string
|
|
613
|
+
role?: string
|
|
614
|
+
platform?: string
|
|
615
|
+
remoteIp?: string
|
|
616
|
+
createdAtMs?: number
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export interface OpenClawPairingSnapshot {
|
|
620
|
+
pending?: OpenClawDevicePairRequest[]
|
|
621
|
+
paired?: OpenClawPairedDevice[]
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// --- ClawHub ---
|
|
625
|
+
|
|
626
|
+
export interface ClawHubSkill {
|
|
627
|
+
id: string
|
|
628
|
+
name: string
|
|
629
|
+
description: string
|
|
630
|
+
author: string
|
|
631
|
+
tags: string[]
|
|
632
|
+
downloads: number
|
|
633
|
+
stars?: number
|
|
634
|
+
url: string
|
|
635
|
+
version: string
|
|
636
|
+
changelog?: string
|
|
637
|
+
createdAt?: number
|
|
638
|
+
updatedAt?: number
|
|
639
|
+
metadata?: Record<string, unknown> | null
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// --- OpenClaw Execution Approvals ---
|
|
643
|
+
|
|
644
|
+
export interface PendingExecApproval {
|
|
645
|
+
id: string
|
|
646
|
+
agentId: string
|
|
647
|
+
sessionKey: string
|
|
648
|
+
command: string
|
|
649
|
+
cwd?: string
|
|
650
|
+
host?: string
|
|
651
|
+
security?: string
|
|
652
|
+
ask?: string
|
|
653
|
+
createdAtMs: number
|
|
654
|
+
expiresAtMs: number
|
|
655
|
+
resolving?: boolean
|
|
656
|
+
error?: string
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export type ExecApprovalDecision = 'allow-once' | 'allow-always' | 'deny'
|
|
660
|
+
|
|
661
|
+
// --- OpenClaw Skills ---
|
|
662
|
+
|
|
663
|
+
export interface OpenClawSkillEntry {
|
|
664
|
+
name: string
|
|
665
|
+
description?: string
|
|
666
|
+
source: 'bundled' | 'managed' | 'personal' | 'workspace'
|
|
667
|
+
eligible: boolean
|
|
668
|
+
requirements?: string[]
|
|
669
|
+
missing?: string[]
|
|
670
|
+
disabled?: boolean
|
|
671
|
+
installOptions?: SkillInstallOption[]
|
|
672
|
+
skillRequirements?: SkillRequirements
|
|
673
|
+
configChecks?: { key: string; ok: boolean }[]
|
|
674
|
+
skillKey?: string
|
|
675
|
+
baseDir?: string
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// --- Fleet Sidebar Filters (F16) ---
|
|
679
|
+
export type FleetFilter = 'all' | 'running' | 'approvals'
|
|
680
|
+
|
|
681
|
+
// --- Exec Approval Config (F8) ---
|
|
682
|
+
export interface ExecApprovalConfig {
|
|
683
|
+
security: 'deny' | 'allowlist' | 'full'
|
|
684
|
+
askMode: 'off' | 'on-miss' | 'always'
|
|
685
|
+
patterns: string[]
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export interface ExecApprovalSnapshot {
|
|
689
|
+
path: string
|
|
690
|
+
exists: boolean
|
|
691
|
+
hash: string
|
|
692
|
+
file: ExecApprovalConfig
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// --- Permission Presets (F9) ---
|
|
696
|
+
export type PermissionPreset = 'conservative' | 'collaborative' | 'autonomous'
|
|
697
|
+
|
|
698
|
+
// --- Personality Builder (F10) ---
|
|
699
|
+
export interface PersonalityDraft {
|
|
700
|
+
identity: { name?: string; creature?: string; vibe?: string; emoji?: string }
|
|
701
|
+
user: { name?: string; callThem?: string; pronouns?: string; timezone?: string; notes?: string; context?: string }
|
|
702
|
+
soul: { coreTruths?: string; boundaries?: string; vibe?: string; continuity?: string }
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// --- Cron Jobs (F12) ---
|
|
706
|
+
export interface GatewayCronJob {
|
|
707
|
+
id: string
|
|
708
|
+
name: string
|
|
709
|
+
agentId: string
|
|
710
|
+
enabled: boolean
|
|
711
|
+
schedule: { kind: 'at' | 'every' | 'cron'; value: string; timezone?: string }
|
|
712
|
+
payload: {
|
|
713
|
+
kind: 'systemEvent' | 'agentTurn'
|
|
714
|
+
text?: string
|
|
715
|
+
message?: string
|
|
716
|
+
model?: string
|
|
717
|
+
deliver?: { mode: 'none' | 'announce'; channel?: string }
|
|
718
|
+
}
|
|
719
|
+
sessionTarget: 'main' | 'isolated'
|
|
720
|
+
state?: { nextRun?: string; lastRun?: string; lastStatus?: string }
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// --- Rich Chat Traces (F13) ---
|
|
724
|
+
export interface ChatTraceBlock {
|
|
725
|
+
type: 'thinking' | 'tool-call' | 'tool-result'
|
|
726
|
+
content: string
|
|
727
|
+
label?: string
|
|
728
|
+
collapsed?: boolean
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// --- Chat History Sync (F18) ---
|
|
732
|
+
export interface GatewaySessionPreview {
|
|
733
|
+
sessionKey: string
|
|
734
|
+
epoch: number
|
|
735
|
+
messages: Array<{ role: string; content: string; ts: number }>
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// --- Gateway Reload Mode (F21) ---
|
|
739
|
+
export type GatewayReloadMode = 'hot' | 'hybrid' | 'full'
|