@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.
Files changed (112) hide show
  1. package/README.md +24 -17
  2. package/next.config.ts +1 -0
  3. package/package.json +3 -2
  4. package/scripts/easy-setup.mjs +1 -1
  5. package/scripts/postinstall.mjs +1 -1
  6. package/skills/swarmclaw.md +115 -0
  7. package/skills/tools/browser.md +131 -0
  8. package/skills/tools/execute.md +98 -0
  9. package/skills/tools/files.md +98 -0
  10. package/skills/tools/memory.md +104 -0
  11. package/skills/tools/platform.md +144 -0
  12. package/skills/tools/skills.md +83 -0
  13. package/src/app/api/chats/[id]/messages/route.ts +23 -19
  14. package/src/app/api/chats/messages-route.test.ts +105 -51
  15. package/src/app/api/mcp-servers/[id]/test/route.ts +3 -2
  16. package/src/app/api/openclaw/deploy/route.ts +2 -0
  17. package/src/app/api/setup/doctor/route.ts +4 -4
  18. package/src/components/agents/agent-chat-list.tsx +23 -1
  19. package/src/components/agents/inspector-panel.tsx +165 -48
  20. package/src/components/chat/chat-area.tsx +38 -9
  21. package/src/components/chat/message-list.tsx +33 -19
  22. package/src/components/gateways/gateway-sheet.tsx +5 -2
  23. package/src/lib/agent-execute-defaults.test.ts +24 -0
  24. package/src/lib/agent-execute-defaults.ts +62 -0
  25. package/src/lib/chat/queued-message-queue.test.ts +134 -1
  26. package/src/lib/chat/queued-message-queue.ts +77 -2
  27. package/src/lib/server/agents/agent-service.ts +5 -0
  28. package/src/lib/server/builtin-extensions.ts +1 -0
  29. package/src/lib/server/chat-execution/chat-execution-advanced.test.ts +1 -1
  30. package/src/lib/server/chat-execution/chat-execution-tool-events.test.ts +1 -0
  31. package/src/lib/server/chat-execution/chat-execution-utils.ts +2 -2
  32. package/src/lib/server/chat-execution/chat-turn-preparation.ts +79 -42
  33. package/src/lib/server/chat-execution/chat-turn-stream-execution.ts +4 -0
  34. package/src/lib/server/chat-execution/continuation-evaluator.ts +8 -0
  35. package/src/lib/server/chat-execution/memory-mutation-tools.ts +1 -1
  36. package/src/lib/server/chat-execution/message-classifier.ts +11 -1
  37. package/src/lib/server/chat-execution/prompt-builder.test.ts +28 -0
  38. package/src/lib/server/chat-execution/prompt-builder.ts +14 -1
  39. package/src/lib/server/chat-execution/prompt-mode.test.ts +24 -0
  40. package/src/lib/server/chat-execution/prompt-mode.ts +5 -1
  41. package/src/lib/server/chat-execution/stream-agent-chat.test.ts +6 -4
  42. package/src/lib/server/chat-execution/stream-agent-chat.ts +45 -16
  43. package/src/lib/server/chatrooms/chatroom-routing.test.ts +4 -0
  44. package/src/lib/server/connectors/discord.ts +2 -2
  45. package/src/lib/server/connectors/matrix.ts +3 -2
  46. package/src/lib/server/connectors/signal.ts +5 -4
  47. package/src/lib/server/connectors/slack.ts +10 -9
  48. package/src/lib/server/connectors/teams.ts +3 -2
  49. package/src/lib/server/connectors/telegram.ts +4 -4
  50. package/src/lib/server/connectors/whatsapp.ts +2 -2
  51. package/src/lib/server/daemon/controller.ts +7 -0
  52. package/src/lib/server/gateways/gateway-profile-service.ts +19 -1
  53. package/src/lib/server/messages/message-repository.test.ts +70 -0
  54. package/src/lib/server/messages/message-repository.ts +11 -6
  55. package/src/lib/server/openclaw/deploy.ts +32 -2
  56. package/src/lib/server/plugins-advanced.test.ts +1 -2
  57. package/src/lib/server/provider-health.ts +1 -1
  58. package/src/lib/server/runtime/process-manager.ts +13 -9
  59. package/src/lib/server/runtime/session-run-manager/queries.ts +15 -0
  60. package/src/lib/server/runtime/session-run-manager.test.ts +58 -0
  61. package/src/lib/server/sandbox/session-runtime.test.ts +18 -1
  62. package/src/lib/server/sandbox/session-runtime.ts +40 -28
  63. package/src/lib/server/session-tools/autonomy-tools.test.ts +7 -9
  64. package/src/lib/server/session-tools/context.ts +1 -1
  65. package/src/lib/server/session-tools/credential-env.ts +109 -0
  66. package/src/lib/server/session-tools/crud.ts +3 -3
  67. package/src/lib/server/session-tools/edit_file.ts +3 -2
  68. package/src/lib/server/session-tools/execute.test.ts +58 -0
  69. package/src/lib/server/session-tools/execute.ts +334 -0
  70. package/src/lib/server/session-tools/files-tool.ts +635 -0
  71. package/src/lib/server/session-tools/index.ts +14 -4
  72. package/src/lib/server/session-tools/memory-tool.ts +242 -0
  73. package/src/lib/server/session-tools/memory.ts +1 -1
  74. package/src/lib/server/session-tools/openclaw-nodes.ts +3 -2
  75. package/src/lib/server/session-tools/openclaw-workspace.ts +3 -2
  76. package/src/lib/server/session-tools/platform-tool.ts +617 -0
  77. package/src/lib/server/session-tools/session-info.ts +3 -2
  78. package/src/lib/server/session-tools/session-tools-wiring.test.ts +3 -4
  79. package/src/lib/server/session-tools/shell.ts +7 -122
  80. package/src/lib/server/session-tools/skills-tool.ts +396 -0
  81. package/src/lib/server/session-tools/web.ts +2 -2
  82. package/src/lib/server/storage-normalization.ts +2 -0
  83. package/src/lib/server/tool-aliases.ts +2 -1
  84. package/src/lib/server/tool-capability-policy-advanced.test.ts +9 -2
  85. package/src/lib/server/tool-capability-policy.test.ts +2 -1
  86. package/src/lib/server/tool-capability-policy.ts +60 -33
  87. package/src/lib/server/tool-planning.ts +11 -0
  88. package/src/lib/setup-defaults.ts +5 -0
  89. package/src/lib/tool-definitions.ts +1 -0
  90. package/src/lib/validation/schemas.test.ts +16 -0
  91. package/src/lib/validation/schemas.ts +16 -0
  92. package/src/stores/use-chat-store.test.ts +231 -0
  93. package/src/stores/use-chat-store.ts +62 -13
  94. package/src/types/agent.ts +348 -0
  95. package/src/types/app-settings.ts +175 -0
  96. package/src/types/approval.ts +27 -0
  97. package/src/types/connector.ts +187 -0
  98. package/src/types/extension.ts +386 -0
  99. package/src/types/index.ts +16 -3555
  100. package/src/types/message.ts +57 -0
  101. package/src/types/misc.ts +739 -0
  102. package/src/types/mission.ts +185 -0
  103. package/src/types/protocol.ts +422 -0
  104. package/src/types/provider.ts +52 -0
  105. package/src/types/run.ts +183 -0
  106. package/src/types/schedule.ts +59 -0
  107. package/src/types/session.ts +265 -0
  108. package/src/types/skill.ts +157 -0
  109. package/src/types/task.ts +140 -0
  110. package/src/types/working-state.ts +211 -0
  111. package/src/views/settings/section-heartbeat.tsx +2 -2
  112. package/src/lib/server/session-tools/sandbox.ts +0 -281
@@ -0,0 +1,348 @@
1
+ import type { ProviderId, ProviderType, OllamaMode } from './provider'
2
+ import type { SessionResetMode, IdentityContinuityState } from './session'
3
+ import type { SkillAllowlistMode } from './skill'
4
+
5
+ // --- Agent / Delegation ---
6
+
7
+ export type AgentRole = 'worker' | 'coordinator'
8
+ export type DelegationTargetMode = 'all' | 'selected'
9
+
10
+ export interface AgentOrgChart {
11
+ parentId?: string | null
12
+ teamLabel?: string | null
13
+ teamColor?: string | null
14
+ x?: number | null
15
+ y?: number | null
16
+ }
17
+
18
+ export interface Agent {
19
+ id: string
20
+ name: string
21
+ openclawAgentId?: string | null
22
+ description: string
23
+ soul?: string
24
+ identityState?: IdentityContinuityState | null
25
+ emoji?: string
26
+ creature?: string
27
+ vibe?: string
28
+ theme?: string
29
+ avatar?: string
30
+ systemPrompt: string
31
+ provider: ProviderId
32
+ model: string
33
+ ollamaMode?: OllamaMode | null
34
+ credentialId?: string | null
35
+ fallbackCredentialIds?: string[]
36
+ apiEndpoint?: string | null
37
+ gatewayProfileId?: string | null
38
+ preferredGatewayTags?: string[]
39
+ preferredGatewayUseCase?: string | null
40
+ routingStrategy?: AgentRoutingStrategy | null
41
+ routingTargets?: AgentRoutingTarget[]
42
+ role?: AgentRole // default 'worker' — coordinators get enhanced delegation prompts
43
+ delegationEnabled?: boolean
44
+ delegationTargetMode?: DelegationTargetMode
45
+ delegationTargetAgentIds?: string[]
46
+ tools?: string[]
47
+ extensions?: string[]
48
+ skills?: string[] // e.g. ['frontend-design'] — pinned Claude Code skills to mention explicitly
49
+ skillIds?: string[] // IDs of pinned managed skills to keep always-on for this agent
50
+ mcpServerIds?: string[] // IDs of configured MCP servers to inject tools from
51
+ mcpDisabledTools?: string[] // MCP tool names disabled for this agent (denylist)
52
+ orgChart?: AgentOrgChart | null
53
+ capabilities?: string[] // e.g. ['frontend', 'screenshots', 'research', 'devops']
54
+ threadSessionId?: string | null // persistent shortcut chat session for agent-centric UI
55
+ heartbeatEnabled?: boolean
56
+ heartbeatIntervalSec?: number | null
57
+ heartbeatInterval?: string | number | null
58
+ heartbeatPrompt?: string | null
59
+ heartbeatModel?: string | null
60
+ heartbeatAckMaxChars?: number | null
61
+ heartbeatShowOk?: boolean | null
62
+ heartbeatShowAlerts?: boolean | null
63
+ heartbeatTarget?: 'last' | 'none' | string | null
64
+ heartbeatGoal?: string | null
65
+ heartbeatNextAction?: string | null
66
+ heartbeatLightContext?: boolean | null
67
+ sessionResetMode?: SessionResetMode | null
68
+ sessionIdleTimeoutSec?: number | null
69
+ sessionMaxAgeSec?: number | null
70
+ sessionDailyResetAt?: string | null
71
+ sessionResetTimezone?: string | null
72
+ thinkingLevel?: 'minimal' | 'low' | 'medium' | 'high'
73
+ memoryScopeMode?: 'auto' | 'all' | 'global' | 'agent' | 'session' | 'project' | null
74
+ memoryTierPreference?: 'working' | 'durable' | 'archive' | 'blended' | null
75
+ elevenLabsVoiceId?: string | null
76
+ projectId?: string
77
+ avatarSeed?: string
78
+ avatarUrl?: string | null
79
+ pinned?: boolean
80
+ lastUsedAt?: number
81
+ totalCost?: number
82
+ disabled?: boolean
83
+ trashedAt?: number
84
+ openclawSkillMode?: SkillAllowlistMode
85
+ openclawAllowedSkills?: string[]
86
+ walletIds?: string[]
87
+ activeWalletId?: string | null
88
+ /** @deprecated Use walletIds + activeWalletId */
89
+ walletId?: string | null
90
+ responseStyle?: 'concise' | 'normal' | 'detailed' | null
91
+ responseMaxChars?: number | null
92
+ monthlyBudget?: number | null
93
+ dailyBudget?: number | null
94
+ hourlyBudget?: number | null
95
+ autoRecovery?: boolean
96
+ proactiveMemory?: boolean
97
+ /** Auto-refresh a reviewed skill draft from meaningful chat turns for this agent. */
98
+ autoDraftSkillSuggestions?: boolean
99
+ /** Controls whether file operations are confined to the workspace or allowed anywhere on the host. Default: 'workspace'. */
100
+ filesystemScope?: 'workspace' | 'machine' | null
101
+ /** Per-agent filesystem restrictions. Globs matched against resolved paths. */
102
+ fileAccessPolicy?: {
103
+ /** If set, only these paths (globs) are writable. Others are blocked. */
104
+ allowedPaths?: string[]
105
+ /** These paths (globs) are always blocked even if allowedPaths matches. */
106
+ blockedPaths?: string[]
107
+ } | null
108
+
109
+ /** Docker-backed browser sandbox settings and legacy execution sandbox compatibility fields. */
110
+ sandboxConfig?: {
111
+ enabled: boolean
112
+ mode?: 'off' | 'non-main' | 'all' // default: 'all' when enabled, modeled after OpenClaw
113
+ scope?: 'session' | 'agent' // default: 'session'
114
+ workspaceAccess?: 'ro' | 'rw' // default: 'rw'
115
+ image?: string // default: 'node:22-slim'
116
+ network?: 'none' | 'bridge' // default: 'none'
117
+ memoryMb?: number // default: 512
118
+ cpus?: number // default: 1.0
119
+ readonlyRoot?: boolean // default: false
120
+ workdir?: string // default: '/workspace'
121
+ containerPrefix?: string // default: 'swarmclaw-sb-'
122
+ pidsLimit?: number // default: 256
123
+ setupCommand?: string
124
+ browser?: {
125
+ enabled?: boolean
126
+ image?: string
127
+ containerPrefix?: string
128
+ network?: 'none' | 'bridge'
129
+ cdpPort?: number
130
+ vncPort?: number
131
+ noVncPort?: number
132
+ headless?: boolean
133
+ enableNoVnc?: boolean
134
+ mountUploads?: boolean
135
+ autoStartTimeoutMs?: number
136
+ } | null
137
+ prune?: {
138
+ idleHours?: number
139
+ maxAgeDays?: number
140
+ } | null
141
+ } | null
142
+
143
+ /** Configuration for the `execute` tool (just-bash sandbox or explicit host bash). */
144
+ executeConfig?: {
145
+ backend?: 'sandbox' | 'host'
146
+ network?: { enabled: boolean; allowedUrls?: string[] }
147
+ runtimes?: { python?: boolean; javascript?: boolean; sqlite?: boolean }
148
+ timeout?: number
149
+ credentials?: string[]
150
+ } | null
151
+
152
+ budgetAction?: 'warn' | 'block'
153
+ /** Runtime-enriched: current month's spend. Populated by GET /api/agents when monthlyBudget is set. */
154
+ monthlySpend?: number
155
+ /** Runtime-enriched: current day's spend. Populated by GET /api/agents when dailyBudget is set. */
156
+ dailySpend?: number
157
+ /** Runtime-enriched: trailing 1-hour spend. Populated by GET /api/agents when hourlyBudget is set. */
158
+ hourlySpend?: number
159
+ maxFollowupChain?: number
160
+
161
+ // Orchestrator Mode
162
+ orchestratorEnabled?: boolean
163
+ orchestratorMission?: string
164
+ orchestratorWakeInterval?: string | number | null
165
+ orchestratorGovernance?: 'autonomous' | 'approval-required' | 'notify-only'
166
+ orchestratorMaxCyclesPerDay?: number | null
167
+ orchestratorLastWakeAt?: number | null
168
+ orchestratorCycleCount?: number
169
+
170
+ createdAt: number
171
+ updatedAt: number
172
+ }
173
+
174
+ // --- Agent Wallets ---
175
+
176
+ export type WalletChain = 'solana' | 'ethereum'
177
+
178
+ export interface AgentWallet {
179
+ id: string
180
+ agentId: string
181
+ chain: WalletChain
182
+ publicKey: string
183
+ encryptedPrivateKey: string // AES-256-GCM via encryptKey()
184
+ label?: string
185
+ spendingLimitAtomic?: string
186
+ dailyLimitAtomic?: string
187
+ /** @deprecated Use spendingLimitAtomic */
188
+ spendingLimitLamports?: number
189
+ /** @deprecated Use dailyLimitAtomic */
190
+ dailyLimitLamports?: number
191
+ requireApproval: boolean // default true; can be globally overridden by app settings
192
+ createdAt: number
193
+ updatedAt: number
194
+ }
195
+
196
+ export interface WalletAssetBalance {
197
+ id: string
198
+ chain: WalletChain
199
+ networkId: string
200
+ networkLabel: string
201
+ symbol: string
202
+ name?: string
203
+ decimals: number
204
+ balanceAtomic: string
205
+ balanceFormatted?: string
206
+ balanceDisplay?: string
207
+ isNative: boolean
208
+ contractAddress?: string
209
+ tokenMint?: string
210
+ explorerUrl?: string
211
+ }
212
+
213
+ export interface WalletPortfolioSummary {
214
+ totalAssets: number
215
+ nonZeroAssets: number
216
+ tokenAssets: number
217
+ networkCount: number
218
+ }
219
+
220
+ export type WalletTransactionType = 'send' | 'receive' | 'swap'
221
+ export type WalletTransactionStatus = 'pending_approval' | 'pending' | 'confirmed' | 'failed' | 'denied'
222
+
223
+ export interface WalletTransaction {
224
+ id: string
225
+ walletId: string
226
+ agentId: string
227
+ chain: WalletChain
228
+ type: WalletTransactionType
229
+ signature: string
230
+ fromAddress: string
231
+ toAddress: string
232
+ amountAtomic?: string
233
+ feeAtomic?: string
234
+ /** @deprecated Use amountAtomic */
235
+ amountLamports?: number
236
+ /** @deprecated Use feeAtomic */
237
+ feeLamports?: number
238
+ status: WalletTransactionStatus
239
+ memo?: string // agent's reason for tx
240
+ approvedBy?: 'user' | 'auto'
241
+ tokenMint?: string // null = native chain asset
242
+ timestamp: number
243
+ }
244
+
245
+ export interface WalletBalanceSnapshot {
246
+ id: string
247
+ walletId: string
248
+ balanceAtomic?: string
249
+ /** @deprecated Use balanceAtomic */
250
+ balanceLamports?: number
251
+ timestamp: number
252
+ }
253
+
254
+ export type AgentTool = 'browser'
255
+
256
+ export interface ClaudeSkill {
257
+ id: string
258
+ name: string
259
+ description: string
260
+ }
261
+
262
+ // --- Agent Routing / Packs ---
263
+
264
+ export type AgentRoutingStrategy = 'single' | 'balanced' | 'economy' | 'premium' | 'reasoning'
265
+ export type AgentRoutingTargetRole = 'primary' | 'economy' | 'premium' | 'reasoning' | 'backup'
266
+
267
+ export interface AgentRoutingTarget {
268
+ id: string
269
+ label?: string
270
+ role?: AgentRoutingTargetRole
271
+ provider: ProviderId
272
+ model: string
273
+ ollamaMode?: OllamaMode | null
274
+ credentialId?: string | null
275
+ fallbackCredentialIds?: string[]
276
+ apiEndpoint?: string | null
277
+ gatewayProfileId?: string | null
278
+ preferredGatewayTags?: string[]
279
+ preferredGatewayUseCase?: string | null
280
+ priority?: number
281
+ }
282
+
283
+ export interface AgentPackEntry {
284
+ id: string
285
+ name: string
286
+ description?: string
287
+ provider: ProviderId
288
+ model: string
289
+ ollamaMode?: OllamaMode | null
290
+ credentialId?: string | null
291
+ fallbackCredentialIds?: string[]
292
+ apiEndpoint?: string | null
293
+ gatewayProfileId?: string | null
294
+ routingStrategy?: AgentRoutingStrategy | null
295
+ routingTargets?: AgentRoutingTarget[]
296
+ tools?: string[]
297
+ extensions?: string[]
298
+ capabilities?: string[]
299
+ elevenLabsVoiceId?: string | null
300
+ soul?: string
301
+ systemPrompt?: string
302
+ }
303
+
304
+ export interface AgentPackManifest {
305
+ schemaVersion: 1
306
+ kind: 'swarmclaw-agent-pack'
307
+ name: string
308
+ description?: string
309
+ exportedAt: number
310
+ recommendedProviders?: ProviderType[]
311
+ agents: AgentPackEntry[]
312
+ }
313
+
314
+ // --- External Agents ---
315
+
316
+ export type ExternalAgentSourceType = 'codex' | 'claude' | 'opencode' | 'openclaw' | 'custom'
317
+ export type ExternalAgentStatus = 'online' | 'idle' | 'offline' | 'stale'
318
+
319
+ export interface ExternalAgentRuntime {
320
+ id: string
321
+ name: string
322
+ sourceType: ExternalAgentSourceType
323
+ status: ExternalAgentStatus
324
+ provider?: ProviderId | null
325
+ model?: string | null
326
+ workspace?: string | null
327
+ transport?: 'http' | 'ws' | 'cli' | 'gateway' | 'custom' | null
328
+ endpoint?: string | null
329
+ agentId?: string | null
330
+ gatewayProfileId?: string | null
331
+ capabilities?: string[]
332
+ labels?: string[]
333
+ lifecycleState?: 'active' | 'draining' | 'cordoned'
334
+ gatewayTags?: string[]
335
+ gatewayUseCase?: string | null
336
+ version?: string | null
337
+ lastHealthNote?: string | null
338
+ metadata?: Record<string, unknown> | null
339
+ tokenStats?: {
340
+ inputTokens?: number
341
+ outputTokens?: number
342
+ totalTokens?: number
343
+ } | null
344
+ lastHeartbeatAt?: number | null
345
+ lastSeenAt?: number | null
346
+ createdAt: number
347
+ updatedAt: number
348
+ }
@@ -0,0 +1,175 @@
1
+ import type { SessionResetMode } from './session'
2
+
3
+ // --- App Settings ---
4
+ export type LoopMode = 'bounded' | 'ongoing'
5
+ export type AutonomyEstopLevel = 'none' | 'autonomy' | 'all'
6
+
7
+ export interface GoalContract {
8
+ objective: string
9
+ constraints?: string[]
10
+ budgetUsd?: number | null
11
+ deadlineAt?: number | null
12
+ successMetric?: string | null
13
+ }
14
+
15
+ export interface WhatsAppApprovedContact {
16
+ id: string
17
+ label: string
18
+ phone: string
19
+ }
20
+
21
+ export interface AppSettings {
22
+ userPrompt?: string
23
+ userName?: string
24
+ setupCompleted?: boolean
25
+ embeddingProvider?: 'local' | 'openai' | 'ollama' | null
26
+ embeddingModel?: string | null
27
+ embeddingCredentialId?: string | null
28
+ embeddingEndpoint?: string | null
29
+ loopMode?: LoopMode
30
+ agentLoopRecursionLimit?: number
31
+ delegationMaxDepth?: number
32
+ ongoingLoopMaxIterations?: number
33
+ ongoingLoopMaxRuntimeMinutes?: number
34
+ maxFollowupChain?: number
35
+ shellCommandTimeoutSec?: number
36
+ claudeCodeTimeoutSec?: number
37
+ cliProcessTimeoutSec?: number
38
+ streamIdleStallSec?: number
39
+ requiredToolKickoffSec?: number
40
+ userAvatarSeed?: string
41
+ elevenLabsEnabled?: boolean
42
+ elevenLabsApiKey?: string | null
43
+ elevenLabsApiKeyConfigured?: boolean
44
+ elevenLabsVoiceId?: string | null
45
+ speechRecognitionLang?: string | null
46
+ tavilyApiKey?: string | null
47
+ tavilyApiKeyConfigured?: boolean
48
+ braveApiKey?: string | null
49
+ braveApiKeyConfigured?: boolean
50
+ heartbeatPrompt?: string | null
51
+ heartbeatIntervalSec?: number | null
52
+ heartbeatInterval?: string | number | null
53
+ heartbeatModel?: string | null
54
+ heartbeatAckMaxChars?: number | null
55
+ heartbeatShowOk?: boolean | null
56
+ heartbeatShowAlerts?: boolean | null
57
+ heartbeatTarget?: 'last' | 'none' | string | null
58
+ heartbeatActiveStart?: string | null
59
+ heartbeatActiveEnd?: string | null
60
+ heartbeatTimezone?: string | null
61
+ heartbeatLightContext?: boolean | null
62
+ sessionResetMode?: SessionResetMode | null
63
+ sessionIdleTimeoutSec?: number | null
64
+ sessionMaxAgeSec?: number | null
65
+ sessionDailyResetAt?: string | null
66
+ sessionResetTimezone?: string | null
67
+ untrustedContentGuardMode?: 'off' | 'warn' | 'block'
68
+ // Task resiliency and supervision
69
+ defaultTaskMaxAttempts?: number
70
+ taskRetryBackoffSec?: number
71
+ taskStallTimeoutMin?: number
72
+ // Safety rails
73
+ safetyRequireApprovalForOutbound?: boolean
74
+ safetyMaxDailySpendUsd?: number | null
75
+ safetyBlockedTools?: string[]
76
+ walletApprovalsEnabled?: boolean
77
+ capabilityPolicyMode?: 'permissive' | 'balanced' | 'strict'
78
+ capabilityBlockedTools?: string[]
79
+ capabilityBlockedCategories?: string[]
80
+ capabilityAllowedTools?: string[]
81
+ taskManagementEnabled?: boolean
82
+ projectManagementEnabled?: boolean
83
+ // Memory governance
84
+ memoryWorkingTtlHours?: number
85
+ memoryDefaultConfidence?: number
86
+ memoryPruneEnabled?: boolean
87
+ memorySummaryEnabled?: boolean
88
+ // Capability router preferences
89
+ autonomyPreferredDelegates?: Array<'claude' | 'codex' | 'opencode'>
90
+ autonomyPreferToolRouting?: boolean
91
+ // Continuous eval
92
+ autonomyEvalEnabled?: boolean
93
+ autonomyEvalCron?: string | null
94
+ supervisorEnabled?: boolean
95
+ supervisorRuntimeScope?: 'chat' | 'task' | 'both'
96
+ supervisorNoProgressLimit?: number
97
+ supervisorRepeatedToolLimit?: number
98
+ autonomyResumeApprovalsEnabled?: boolean
99
+ missionHumanLoopEnabled?: boolean
100
+ reflectionEnabled?: boolean
101
+ reflectionAutoWriteMemory?: boolean
102
+ memoryReferenceDepth?: number
103
+ maxMemoriesPerLookup?: number
104
+ maxLinkedMemoriesExpanded?: number
105
+ memoryMaxDepth?: number
106
+ memoryMaxPerLookup?: number
107
+ // Chat UX
108
+ suggestionsEnabled?: boolean
109
+ runtimeSkillRetrievalMode?: 'keyword' | 'embedding'
110
+ runtimeSkillTopK?: number
111
+ // Globally approved WhatsApp contacts for connector DMs
112
+ whatsappApprovedContacts?: WhatsAppApprovedContact[]
113
+ // Voice conversation
114
+ voiceAutoSendDelaySec?: number
115
+ // Default agent for main chat on startup
116
+ defaultAgentId?: string | null
117
+ // Theme
118
+ themeHue?: string
119
+ // Web search provider
120
+ webSearchProvider?: 'duckduckgo' | 'google' | 'bing' | 'searxng' | 'tavily' | 'brave'
121
+ searxngUrl?: string
122
+ // Task custom field definitions
123
+ taskCustomFieldDefs?: Array<{ key: string; label: string; type: 'text' | 'number' | 'select'; options?: string[] }>
124
+ // OpenClaw sync settings
125
+ openclawWorkspacePath?: string | null
126
+ openclawAutoSyncMemory?: boolean
127
+ openclawAutoSyncSchedules?: boolean
128
+ // Outbound ops alert webhook
129
+ alertWebhookUrl?: string | null
130
+ alertWebhookType?: 'discord' | 'slack' | 'custom' | null
131
+ alertWebhookEvents?: ('error' | 'warning')[]
132
+ // Deterministic LLM response cache
133
+ responseCacheEnabled?: boolean
134
+ responseCacheTtlSec?: number
135
+ responseCacheMaxEntries?: number
136
+ // Task quality gate defaults
137
+ taskQualityGateEnabled?: boolean
138
+ taskQualityGateMinResultChars?: number
139
+ taskQualityGateMinEvidenceItems?: number
140
+ taskQualityGateRequireVerification?: boolean
141
+ taskQualityGateRequireArtifact?: boolean
142
+ taskQualityGateRequireReport?: boolean
143
+ // Integrity monitor
144
+ integrityMonitorEnabled?: boolean
145
+ // Background daemon
146
+ daemonAutostartEnabled?: boolean
147
+ // Tool loop detection thresholds
148
+ toolLoopFrequencyWarn?: number
149
+ toolLoopFrequencyCritical?: number
150
+ toolLoopCircuitBreaker?: number
151
+ // Per-extension settings (keyed by extensionId)
152
+ extensionSettings?: Record<string, Record<string, unknown>>
153
+ }
154
+
155
+ export interface EstopState {
156
+ level: AutonomyEstopLevel
157
+ reason?: string | null
158
+ engagedAt?: number | null
159
+ engagedBy?: string | null
160
+ resumeApprovalId?: string | null
161
+ updatedAt: number
162
+ }
163
+
164
+ export interface GuardianCheckpoint {
165
+ id: string
166
+ cwd: string
167
+ head: string
168
+ branch?: string | null
169
+ status: string
170
+ createdAt: number
171
+ createdBy: string
172
+ approvalId?: string | null
173
+ restorePreparedAt?: number | null
174
+ restoredAt?: number | null
175
+ }
@@ -0,0 +1,27 @@
1
+ // --- Approvals ---
2
+
3
+ export type ApprovalCategory =
4
+ | 'tool_access'
5
+ | 'wallet_transfer'
6
+ | 'wallet_action'
7
+ | 'extension_scaffold'
8
+ | 'extension_install'
9
+ | 'task_tool'
10
+ | 'human_loop'
11
+ | 'connector_sender'
12
+
13
+ export interface ApprovalRequest {
14
+ id: string
15
+ category: ApprovalCategory
16
+ agentId?: string | null
17
+ sessionId?: string | null
18
+ taskId?: string | null
19
+ title: string
20
+ description?: string
21
+ data: Record<string, unknown>
22
+ createdAt: number
23
+ updatedAt: number
24
+ status: 'pending' | 'approved' | 'rejected'
25
+ }
26
+
27
+ export type Approvals = Record<string, ApprovalRequest>