@swarmclawai/swarmclaw 0.7.6 → 0.7.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 +19 -10
- package/package.json +1 -1
- package/src/app/api/agents/[id]/route.ts +16 -0
- package/src/app/api/agents/route.ts +2 -0
- package/src/app/api/chats/[id]/route.ts +21 -1
- package/src/app/api/chats/route.ts +13 -1
- package/src/app/api/connectors/[id]/route.ts +20 -2
- package/src/app/api/connectors/route.ts +12 -8
- package/src/app/api/external-agents/[id]/heartbeat/route.ts +3 -0
- package/src/app/api/external-agents/[id]/route.ts +38 -6
- package/src/app/api/external-agents/route.ts +17 -1
- package/src/app/api/gateways/[id]/health/route.ts +8 -0
- package/src/app/api/gateways/[id]/route.ts +53 -1
- package/src/app/api/gateways/route.ts +53 -0
- package/src/app/api/openclaw/deploy/route.ts +139 -0
- package/src/app/api/projects/[id]/route.ts +6 -2
- package/src/app/api/projects/route.ts +4 -3
- package/src/app/api/secrets/[id]/route.ts +1 -0
- package/src/app/api/secrets/route.ts +2 -1
- package/src/app/api/settings/route.ts +2 -0
- package/src/cli/index.js +40 -0
- package/src/cli/index.test.js +68 -0
- package/src/cli/spec.js +60 -0
- package/src/components/agents/agent-sheet.tsx +281 -33
- package/src/components/auth/setup-wizard.tsx +75 -2
- package/src/components/chat/chat-area.tsx +36 -19
- package/src/components/chat/chat-header.tsx +4 -0
- package/src/components/chat/delegation-banner.test.ts +14 -1
- package/src/components/chat/delegation-banner.tsx +1 -1
- package/src/components/gateways/gateway-sheet.tsx +140 -8
- package/src/components/layout/app-layout.tsx +40 -23
- package/src/components/openclaw/openclaw-deploy-panel.tsx +591 -9
- package/src/components/projects/project-detail.tsx +217 -0
- package/src/components/projects/project-sheet.tsx +176 -4
- package/src/components/providers/provider-list.tsx +221 -17
- package/src/components/shared/settings/section-capability-policy.tsx +38 -0
- package/src/components/shared/settings/section-voice.tsx +11 -3
- package/src/components/tasks/approvals-panel.tsx +177 -18
- package/src/components/tasks/task-board.tsx +137 -23
- package/src/components/tasks/task-card.tsx +29 -0
- package/src/components/tasks/task-sheet.tsx +16 -4
- package/src/lib/server/agent-runtime-config.ts +142 -7
- package/src/lib/server/agent-thread-session.ts +9 -1
- package/src/lib/server/capability-router.test.ts +22 -0
- package/src/lib/server/capability-router.ts +54 -18
- package/src/lib/server/chat-execution.ts +33 -3
- package/src/lib/server/connectors/manager-reconnect.test.ts +47 -0
- package/src/lib/server/connectors/manager.ts +99 -74
- package/src/lib/server/daemon-state.ts +83 -46
- package/src/lib/server/elevenlabs.test.ts +59 -1
- package/src/lib/server/heartbeat-service.ts +5 -1
- package/src/lib/server/main-agent-loop.test.ts +260 -0
- package/src/lib/server/main-agent-loop.ts +559 -14
- package/src/lib/server/openclaw-deploy.test.ts +8 -0
- package/src/lib/server/openclaw-deploy.ts +679 -19
- package/src/lib/server/orchestrator-lg.ts +1 -0
- package/src/lib/server/orchestrator.ts +11 -0
- package/src/lib/server/plugins.ts +6 -1
- package/src/lib/server/project-context.ts +162 -0
- package/src/lib/server/project-utils.ts +150 -0
- package/src/lib/server/queue-followups.test.ts +147 -2
- package/src/lib/server/queue.ts +278 -8
- package/src/lib/server/session-run-manager.ts +31 -0
- package/src/lib/server/session-tools/connector-inputs.test.ts +37 -0
- package/src/lib/server/session-tools/connector.ts +26 -1
- package/src/lib/server/session-tools/context.ts +5 -0
- package/src/lib/server/session-tools/crud.ts +265 -76
- package/src/lib/server/session-tools/delegate-resume.test.ts +50 -0
- package/src/lib/server/session-tools/delegate.ts +38 -2
- package/src/lib/server/session-tools/manage-tasks.test.ts +114 -0
- package/src/lib/server/session-tools/memory.ts +14 -2
- package/src/lib/server/session-tools/platform-access.test.ts +58 -0
- package/src/lib/server/session-tools/platform.ts +60 -19
- package/src/lib/server/session-tools/web-inputs.test.ts +17 -0
- package/src/lib/server/session-tools/web.ts +153 -6
- package/src/lib/server/stream-agent-chat.test.ts +27 -2
- package/src/lib/server/stream-agent-chat.ts +104 -30
- package/src/lib/server/tool-aliases.ts +2 -0
- package/src/lib/server/tool-capability-policy.test.ts +24 -0
- package/src/lib/server/tool-capability-policy.ts +29 -1
- package/src/lib/server/tool-planning.test.ts +44 -0
- package/src/lib/server/tool-planning.ts +269 -0
- package/src/lib/setup-defaults.ts +2 -2
- package/src/lib/tool-definitions.ts +2 -1
- package/src/lib/validation/schemas.ts +9 -0
- package/src/types/index.ts +104 -0
|
@@ -48,7 +48,7 @@ export const SETUP_PROVIDERS: SetupProviderOption[] = [
|
|
|
48
48
|
{
|
|
49
49
|
id: 'openclaw',
|
|
50
50
|
name: 'OpenClaw',
|
|
51
|
-
description: '
|
|
51
|
+
description: 'Deploy or connect official-only local and remote OpenClaw gateways, then map starter agents across your swarm by role, tag, or use case.',
|
|
52
52
|
requiresKey: false,
|
|
53
53
|
supportsEndpoint: true,
|
|
54
54
|
allowMultiple: true,
|
|
@@ -481,7 +481,7 @@ export const STARTER_KITS: StarterKit[] = [
|
|
|
481
481
|
id: 'openclaw_fleet',
|
|
482
482
|
name: 'OpenClaw Fleet',
|
|
483
483
|
description: 'An OpenClaw-first starter setup for local or remote gateways.',
|
|
484
|
-
detail: 'Designed for users who want multiple OpenClaw-backed agents right away,
|
|
484
|
+
detail: 'Designed for users who want multiple OpenClaw-backed agents right away, with official-only local deploy, single-VPS, and private-tailnet defaults built into setup.',
|
|
485
485
|
recommendedFor: ['manual'],
|
|
486
486
|
badge: 'OpenClaw',
|
|
487
487
|
agents: [
|
|
@@ -36,7 +36,8 @@ export const AVAILABLE_TOOLS: ToolDefinition[] = [
|
|
|
36
36
|
* Granular CRUD tools are now unified under 'manage_platform'.
|
|
37
37
|
*/
|
|
38
38
|
export const PLATFORM_TOOLS: ToolDefinition[] = [
|
|
39
|
-
{ id: 'manage_platform', label: 'Platform', description: 'Unified management of agents, tasks, schedules, skills, documents, and secrets' },
|
|
39
|
+
{ id: 'manage_platform', label: 'Platform', description: 'Unified management of agents, projects, tasks, schedules, skills, documents, and secrets' },
|
|
40
|
+
{ id: 'manage_projects', label: 'Projects', description: 'Manage durable project context: objectives, priorities, heartbeat plans, credential needs, and linked resources' },
|
|
40
41
|
{ id: 'manage_connectors', label: 'Connectors', description: 'Manage chat platform bridges and send outbound messages' },
|
|
41
42
|
{ id: 'manage_chatrooms', label: 'Chatrooms', description: 'Manage SwarmClaw routing rules and multi-agent chatrooms' },
|
|
42
43
|
{ id: 'delegate_to_agent', label: 'Assign Agent', description: 'Delegate a task to another specific agent' },
|
|
@@ -10,6 +10,8 @@ const AgentRoutingTargetSchema = z.object({
|
|
|
10
10
|
fallbackCredentialIds: z.array(z.string()).optional().default([]),
|
|
11
11
|
apiEndpoint: z.string().nullable().optional().default(null),
|
|
12
12
|
gatewayProfileId: z.string().nullable().optional().default(null),
|
|
13
|
+
preferredGatewayTags: z.array(z.string()).optional().default([]),
|
|
14
|
+
preferredGatewayUseCase: z.string().nullable().optional().default(null),
|
|
13
15
|
priority: z.number().int().optional(),
|
|
14
16
|
})
|
|
15
17
|
|
|
@@ -23,6 +25,8 @@ export const AgentCreateSchema = z.object({
|
|
|
23
25
|
fallbackCredentialIds: z.array(z.string()).optional().default([]),
|
|
24
26
|
apiEndpoint: z.string().nullable().optional().default(null),
|
|
25
27
|
gatewayProfileId: z.string().nullable().optional().default(null),
|
|
28
|
+
preferredGatewayTags: z.array(z.string()).optional().default([]),
|
|
29
|
+
preferredGatewayUseCase: z.string().nullable().optional().default(null),
|
|
26
30
|
routingStrategy: z.enum(['single', 'balanced', 'economy', 'premium', 'reasoning']).nullable().optional().default(null),
|
|
27
31
|
routingTargets: z.array(AgentRoutingTargetSchema).optional().default([]),
|
|
28
32
|
isOrchestrator: z.boolean().optional().default(false),
|
|
@@ -89,6 +93,11 @@ export const ExternalAgentRegisterSchema = z.object({
|
|
|
89
93
|
gatewayProfileId: z.string().nullable().optional().default(null),
|
|
90
94
|
capabilities: z.array(z.string()).optional().default([]),
|
|
91
95
|
labels: z.array(z.string()).optional().default([]),
|
|
96
|
+
lifecycleState: z.enum(['active', 'draining', 'cordoned']).optional().default('active'),
|
|
97
|
+
gatewayTags: z.array(z.string()).optional().default([]),
|
|
98
|
+
gatewayUseCase: z.string().nullable().optional().default(null),
|
|
99
|
+
version: z.string().nullable().optional().default(null),
|
|
100
|
+
lastHealthNote: z.string().nullable().optional().default(null),
|
|
92
101
|
metadata: z.record(z.string(), z.unknown()).nullable().optional().default(null),
|
|
93
102
|
tokenStats: z.object({
|
|
94
103
|
inputTokens: z.number().nonnegative().optional(),
|
package/src/types/index.ts
CHANGED
|
@@ -93,6 +93,8 @@ export interface Session {
|
|
|
93
93
|
fallbackCredentialIds?: string[]
|
|
94
94
|
apiEndpoint?: string | null
|
|
95
95
|
gatewayProfileId?: string | null
|
|
96
|
+
routePreferredGatewayTags?: string[]
|
|
97
|
+
routePreferredGatewayUseCase?: string | null
|
|
96
98
|
claudeSessionId: string | null
|
|
97
99
|
codexThreadId?: string | null
|
|
98
100
|
opencodeSessionId?: string | null
|
|
@@ -303,10 +305,36 @@ export interface PluginHooks {
|
|
|
303
305
|
getOperatingGuidance?: () => string | string[] | null | undefined
|
|
304
306
|
}
|
|
305
307
|
|
|
308
|
+
export interface PluginToolPlanning {
|
|
309
|
+
/**
|
|
310
|
+
* Capability tags that the harness can use for prompt guidance and tool routing.
|
|
311
|
+
* Examples: research.search, research.fetch, browser.capture, artifact.pdf,
|
|
312
|
+
* delivery.media, delivery.voice_note.
|
|
313
|
+
*/
|
|
314
|
+
capabilities?: string[]
|
|
315
|
+
/**
|
|
316
|
+
* Concrete usage guidance that should be injected into the system prompt when
|
|
317
|
+
* this tool is enabled.
|
|
318
|
+
*/
|
|
319
|
+
disciplineGuidance?: string[]
|
|
320
|
+
/**
|
|
321
|
+
* Optional natural-language cues that indicate when this tool should be
|
|
322
|
+
* preferred or explicitly invoked. These are declarative hints so the harness
|
|
323
|
+
* does not need to hard-code every plugin-specific workflow centrally.
|
|
324
|
+
*/
|
|
325
|
+
requestMatchers?: Array<{
|
|
326
|
+
capability?: string
|
|
327
|
+
patterns?: string[]
|
|
328
|
+
requireLiteralUrl?: boolean
|
|
329
|
+
forbidLiteralUrl?: boolean
|
|
330
|
+
}>
|
|
331
|
+
}
|
|
332
|
+
|
|
306
333
|
export interface PluginToolDef {
|
|
307
334
|
name: string
|
|
308
335
|
description: string
|
|
309
336
|
parameters: Record<string, unknown>
|
|
337
|
+
planning?: PluginToolPlanning
|
|
310
338
|
execute: (args: Record<string, unknown>, ctx: { session: Session; message: string }) => Promise<string | object> | string | object
|
|
311
339
|
}
|
|
312
340
|
|
|
@@ -498,6 +526,8 @@ export interface Agent {
|
|
|
498
526
|
fallbackCredentialIds?: string[]
|
|
499
527
|
apiEndpoint?: string | null
|
|
500
528
|
gatewayProfileId?: string | null
|
|
529
|
+
preferredGatewayTags?: string[]
|
|
530
|
+
preferredGatewayUseCase?: string | null
|
|
501
531
|
routingStrategy?: AgentRoutingStrategy | null
|
|
502
532
|
routingTargets?: AgentRoutingTarget[]
|
|
503
533
|
isOrchestrator?: boolean
|
|
@@ -930,6 +960,15 @@ export interface Project {
|
|
|
930
960
|
name: string
|
|
931
961
|
description: string
|
|
932
962
|
color?: string
|
|
963
|
+
objective?: string
|
|
964
|
+
audience?: string
|
|
965
|
+
priorities?: string[]
|
|
966
|
+
openObjectives?: string[]
|
|
967
|
+
capabilityHints?: string[]
|
|
968
|
+
credentialRequirements?: string[]
|
|
969
|
+
successMetrics?: string[]
|
|
970
|
+
heartbeatPrompt?: string
|
|
971
|
+
heartbeatIntervalSec?: number
|
|
933
972
|
createdAt: number
|
|
934
973
|
updatedAt: number
|
|
935
974
|
}
|
|
@@ -1061,6 +1100,8 @@ export interface AppSettings {
|
|
|
1061
1100
|
capabilityBlockedTools?: string[]
|
|
1062
1101
|
capabilityBlockedCategories?: string[]
|
|
1063
1102
|
capabilityAllowedTools?: string[]
|
|
1103
|
+
taskManagementEnabled?: boolean
|
|
1104
|
+
projectManagementEnabled?: boolean
|
|
1064
1105
|
// Memory governance
|
|
1065
1106
|
memoryWorkingTtlHours?: number
|
|
1066
1107
|
memoryDefaultConfidence?: number
|
|
@@ -1124,6 +1165,7 @@ export interface OrchestratorSecret {
|
|
|
1124
1165
|
encryptedValue: string
|
|
1125
1166
|
scope: 'global' | 'agent'
|
|
1126
1167
|
agentIds: string[] // if scope === 'agent', which agents can use it
|
|
1168
|
+
projectId?: string
|
|
1127
1169
|
createdAt: number
|
|
1128
1170
|
updatedAt: number
|
|
1129
1171
|
}
|
|
@@ -1168,6 +1210,58 @@ export interface ProviderConfig {
|
|
|
1168
1210
|
|
|
1169
1211
|
export type GatewayProvider = 'openclaw'
|
|
1170
1212
|
export type GatewayHealthState = 'unknown' | 'healthy' | 'degraded' | 'offline' | 'pending'
|
|
1213
|
+
export type OpenClawDeploymentMethod = 'local' | 'bundle' | 'ssh' | 'imported'
|
|
1214
|
+
export type OpenClawDeploymentProvider =
|
|
1215
|
+
| 'local'
|
|
1216
|
+
| 'hetzner'
|
|
1217
|
+
| 'digitalocean'
|
|
1218
|
+
| 'vultr'
|
|
1219
|
+
| 'linode'
|
|
1220
|
+
| 'lightsail'
|
|
1221
|
+
| 'gcp'
|
|
1222
|
+
| 'azure'
|
|
1223
|
+
| 'oci'
|
|
1224
|
+
| 'generic'
|
|
1225
|
+
| 'render'
|
|
1226
|
+
| 'fly'
|
|
1227
|
+
| 'railway'
|
|
1228
|
+
export type OpenClawRemoteDeployTarget = 'docker' | 'render' | 'fly' | 'railway'
|
|
1229
|
+
export type OpenClawUseCaseTemplate = 'local-dev' | 'single-vps' | 'private-tailnet' | 'browser-heavy' | 'team-control'
|
|
1230
|
+
export type OpenClawExposurePreset = 'private-lan' | 'tailscale' | 'caddy' | 'nginx' | 'ssh-tunnel'
|
|
1231
|
+
|
|
1232
|
+
export interface OpenClawGatewayStats {
|
|
1233
|
+
nodeCount?: number
|
|
1234
|
+
connectedNodeCount?: number
|
|
1235
|
+
pendingNodePairings?: number
|
|
1236
|
+
pairedDeviceCount?: number
|
|
1237
|
+
pendingDevicePairings?: number
|
|
1238
|
+
externalRuntimeCount?: number
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
export interface OpenClawDeploymentConfig {
|
|
1242
|
+
method?: OpenClawDeploymentMethod | null
|
|
1243
|
+
provider?: OpenClawDeploymentProvider | null
|
|
1244
|
+
remoteTarget?: OpenClawRemoteDeployTarget | null
|
|
1245
|
+
useCase?: OpenClawUseCaseTemplate | null
|
|
1246
|
+
exposure?: OpenClawExposurePreset | null
|
|
1247
|
+
managedBy?: 'swarmclaw' | 'manual' | null
|
|
1248
|
+
targetHost?: string | null
|
|
1249
|
+
sshHost?: string | null
|
|
1250
|
+
sshUser?: string | null
|
|
1251
|
+
sshPort?: number | null
|
|
1252
|
+
sshKeyPath?: string | null
|
|
1253
|
+
sshTargetDir?: string | null
|
|
1254
|
+
image?: string | null
|
|
1255
|
+
version?: string | null
|
|
1256
|
+
lastDeployAt?: number | null
|
|
1257
|
+
lastDeployAction?: string | null
|
|
1258
|
+
lastDeployProcessId?: string | null
|
|
1259
|
+
lastDeploySummary?: string | null
|
|
1260
|
+
lastVerifiedAt?: number | null
|
|
1261
|
+
lastVerifiedOk?: boolean | null
|
|
1262
|
+
lastVerifiedMessage?: string | null
|
|
1263
|
+
lastBackupPath?: string | null
|
|
1264
|
+
}
|
|
1171
1265
|
|
|
1172
1266
|
export interface GatewayProfile {
|
|
1173
1267
|
id: string
|
|
@@ -1184,6 +1278,8 @@ export interface GatewayProfile {
|
|
|
1184
1278
|
lastModelCount?: number | null
|
|
1185
1279
|
discoveredHost?: string | null
|
|
1186
1280
|
discoveredPort?: number | null
|
|
1281
|
+
deployment?: OpenClawDeploymentConfig | null
|
|
1282
|
+
stats?: OpenClawGatewayStats | null
|
|
1187
1283
|
isDefault?: boolean
|
|
1188
1284
|
createdAt: number
|
|
1189
1285
|
updatedAt: number
|
|
@@ -1256,6 +1352,8 @@ export interface AgentRoutingTarget {
|
|
|
1256
1352
|
fallbackCredentialIds?: string[]
|
|
1257
1353
|
apiEndpoint?: string | null
|
|
1258
1354
|
gatewayProfileId?: string | null
|
|
1355
|
+
preferredGatewayTags?: string[]
|
|
1356
|
+
preferredGatewayUseCase?: string | null
|
|
1259
1357
|
priority?: number
|
|
1260
1358
|
}
|
|
1261
1359
|
|
|
@@ -1274,6 +1372,7 @@ export interface AgentPackEntry {
|
|
|
1274
1372
|
tools?: string[]
|
|
1275
1373
|
plugins?: string[]
|
|
1276
1374
|
capabilities?: string[]
|
|
1375
|
+
elevenLabsVoiceId?: string | null
|
|
1277
1376
|
soul?: string
|
|
1278
1377
|
systemPrompt?: string
|
|
1279
1378
|
}
|
|
@@ -1307,6 +1406,11 @@ export interface ExternalAgentRuntime {
|
|
|
1307
1406
|
gatewayProfileId?: string | null
|
|
1308
1407
|
capabilities?: string[]
|
|
1309
1408
|
labels?: string[]
|
|
1409
|
+
lifecycleState?: 'active' | 'draining' | 'cordoned'
|
|
1410
|
+
gatewayTags?: string[]
|
|
1411
|
+
gatewayUseCase?: string | null
|
|
1412
|
+
version?: string | null
|
|
1413
|
+
lastHealthNote?: string | null
|
|
1310
1414
|
metadata?: Record<string, unknown> | null
|
|
1311
1415
|
tokenStats?: {
|
|
1312
1416
|
inputTokens?: number
|