@swarmclawai/swarmclaw 1.2.8 → 1.2.9
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 +30 -6
- package/package.json +2 -2
- package/src/app/agents/[id]/page.tsx +1 -18
- package/src/app/api/agents/thread-route.test.ts +0 -1
- package/src/app/api/approvals/route.test.ts +6 -22
- package/src/app/api/connectors/route.ts +2 -2
- package/src/app/api/portability/export/route.ts +8 -0
- package/src/app/api/portability/import/route.test.ts +80 -0
- package/src/app/api/portability/import/route.ts +28 -0
- package/src/app/api/settings/route.ts +0 -2
- package/src/app/api/wallets/[id]/route.ts +15 -157
- package/src/app/api/wallets/generate/route.ts +22 -0
- package/src/app/api/wallets/route.test.ts +147 -0
- package/src/app/api/wallets/route.ts +13 -95
- package/src/app/autonomy/page.tsx +2 -57
- package/src/app/protocols/page.tsx +2 -21
- package/src/app/settings/page.tsx +0 -9
- package/src/app/wallets/page.tsx +105 -5
- package/src/cli/index.js +21 -33
- package/src/cli/spec.js +19 -30
- package/src/components/agents/agent-sheet.tsx +2 -40
- package/src/components/agents/inspector-panel.tsx +0 -83
- package/src/components/chat/chat-card.tsx +0 -31
- package/src/components/chat/message-bubble.tsx +1 -108
- package/src/components/connectors/connector-sheet.tsx +25 -1
- package/src/components/layout/sidebar-rail.tsx +6 -10
- package/src/components/projects/project-detail.tsx +3 -35
- package/src/components/projects/tabs/overview-tab.tsx +3 -59
- package/src/components/projects/tabs/work-tab.tsx +7 -77
- package/src/components/protocols/structured-session-launcher.tsx +1 -22
- package/src/components/shared/connector-platform-icon.tsx +1 -0
- package/src/components/tasks/task-card.tsx +4 -34
- package/src/components/tasks/task-sheet.tsx +6 -36
- package/src/components/wallets/wallet-list.tsx +150 -0
- package/src/lib/app/navigation.test.ts +0 -13
- package/src/lib/app/navigation.ts +2 -7
- package/src/lib/app/view-constants.ts +14 -19
- package/src/lib/server/agents/agent-thread-session.ts +0 -1
- package/src/lib/server/agents/delegation-advisory.test.ts +0 -1
- package/src/lib/server/agents/delegation-jobs.test.ts +0 -69
- package/src/lib/server/agents/delegation-jobs.ts +0 -25
- package/src/lib/server/agents/main-agent-loop.ts +1 -49
- package/src/lib/server/agents/subagent-runtime.ts +0 -1
- package/src/lib/server/approval-match.ts +0 -85
- package/src/lib/server/approvals.test.ts +6 -6
- package/src/lib/server/approvals.ts +0 -6
- package/src/lib/server/autonomy/supervisor-reflection.test.ts +0 -1
- package/src/lib/server/builtin-extensions.ts +0 -2
- package/src/lib/server/capability-router.test.ts +0 -2
- package/src/lib/server/chat-execution/chat-execution-tool-events.test.ts +14 -14
- package/src/lib/server/chat-execution/chat-execution-types.ts +0 -2
- package/src/lib/server/chat-execution/chat-execution-utils.ts +0 -2
- package/src/lib/server/chat-execution/chat-streaming-utils.ts +2 -30
- package/src/lib/server/chat-execution/chat-turn-finalization.ts +1 -36
- package/src/lib/server/chat-execution/chat-turn-preparation.ts +2 -22
- package/src/lib/server/chat-execution/iteration-event-handler.ts +0 -24
- package/src/lib/server/chat-execution/message-classifier.test.ts +0 -45
- package/src/lib/server/chat-execution/message-classifier.ts +1 -16
- package/src/lib/server/chat-execution/prompt-builder.test.ts +0 -1
- package/src/lib/server/chat-execution/prompt-builder.ts +0 -30
- package/src/lib/server/chat-execution/prompt-sections.ts +0 -1
- package/src/lib/server/chat-execution/situational-awareness.test.ts +2 -73
- package/src/lib/server/chat-execution/situational-awareness.ts +4 -38
- package/src/lib/server/chat-execution/stream-agent-chat.test.ts +8 -123
- package/src/lib/server/chat-execution/stream-agent-chat.ts +1 -5
- package/src/lib/server/chat-execution/stream-continuation.test.ts +4 -52
- package/src/lib/server/chat-execution/stream-continuation.ts +6 -48
- package/src/lib/server/chatrooms/session-mailbox.ts +0 -10
- package/src/lib/server/chats/chat-session-service.ts +3 -5
- package/src/lib/server/connectors/connector-inbound.ts +0 -1
- package/src/lib/server/connectors/connector-lifecycle.ts +19 -3
- package/src/lib/server/connectors/connector-service.ts +39 -9
- package/src/lib/server/connectors/swarmdock-bidding.ts +74 -0
- package/src/lib/server/connectors/swarmdock-payloads.test.ts +85 -0
- package/src/lib/server/connectors/swarmdock-secret.test.ts +128 -0
- package/src/lib/server/connectors/swarmdock-secret.ts +152 -0
- package/src/lib/server/connectors/swarmdock-tasks.ts +119 -0
- package/src/lib/server/connectors/swarmdock.ts +255 -0
- package/src/lib/server/execution-brief.test.ts +2 -25
- package/src/lib/server/execution-brief.ts +12 -35
- package/src/lib/server/execution-engine/task-attempt.ts +0 -1
- package/src/lib/server/persistence/storage-context.ts +0 -5
- package/src/lib/server/portability/export.ts +109 -0
- package/src/lib/server/portability/import.ts +159 -0
- package/src/lib/server/protocols/protocol-normalization.ts +0 -4
- package/src/lib/server/protocols/protocol-queries.ts +0 -6
- package/src/lib/server/protocols/protocol-run-lifecycle.ts +4 -32
- package/src/lib/server/protocols/protocol-service.ts +0 -1
- package/src/lib/server/protocols/protocol-step-helpers.ts +0 -4
- package/src/lib/server/protocols/protocol-step-processors.ts +0 -6
- package/src/lib/server/protocols/protocol-swarm.ts +0 -2
- package/src/lib/server/protocols/protocol-types.ts +0 -2
- package/src/lib/server/provider-health.ts +0 -9
- package/src/lib/server/runtime/daemon-state/core.ts +0 -9
- package/src/lib/server/runtime/daemon-state.test.ts +0 -35
- package/src/lib/server/runtime/heartbeat-service.ts +3 -23
- package/src/lib/server/runtime/queue/core.ts +11 -33
- package/src/lib/server/runtime/runtime-storage-write-paths.test.ts +6 -6
- package/src/lib/server/runtime/scheduler.ts +0 -13
- package/src/lib/server/runtime/session-run-manager/drain.ts +0 -24
- package/src/lib/server/runtime/session-run-manager/enqueue.ts +0 -1
- package/src/lib/server/runtime/session-run-manager/queries.ts +0 -1
- package/src/lib/server/runtime/session-run-manager/recovery.ts +0 -1
- package/src/lib/server/runtime/session-run-manager.test.ts +0 -28
- package/src/lib/server/session-tools/crud.ts +0 -14
- package/src/lib/server/session-tools/delegate.ts +0 -4
- package/src/lib/server/session-tools/index.ts +0 -4
- package/src/lib/server/session-tools/team-context.ts +0 -3
- package/src/lib/server/storage-normalization.ts +8 -0
- package/src/lib/server/storage.ts +18 -45
- package/src/lib/server/tasks/task-checkout.ts +59 -0
- package/src/lib/server/tasks/task-lifecycle.ts +2 -0
- package/src/lib/server/tasks/task-route-service.ts +4 -26
- package/src/lib/server/tasks/task-service.ts +0 -7
- package/src/lib/server/tool-aliases.ts +0 -1
- package/src/lib/server/tool-capability-policy-advanced.test.ts +4 -4
- package/src/lib/server/tool-capability-policy.ts +0 -2
- package/src/lib/server/tool-planning.ts +0 -12
- package/src/lib/server/universal-tool-access.ts +0 -1
- package/src/lib/server/wallets/wallet-crypto.ts +33 -0
- package/src/lib/server/wallets/wallet-repository.ts +24 -0
- package/src/lib/server/wallets/wallet-service.ts +119 -0
- package/src/lib/server/working-state/extraction.ts +8 -42
- package/src/lib/server/working-state/normalization.ts +10 -103
- package/src/lib/server/working-state/service.ts +12 -21
- package/src/lib/strip-internal-metadata.test.ts +1 -1
- package/src/lib/strip-internal-metadata.ts +1 -1
- package/src/lib/tool-definitions.ts +0 -1
- package/src/lib/validation/schemas.ts +33 -2
- package/src/stores/slices/data-slice.ts +5 -1
- package/src/stores/slices/ui-slice.ts +0 -4
- package/src/types/agent.ts +0 -84
- package/src/types/app-settings.ts +0 -2
- package/src/types/approval.ts +0 -2
- package/src/types/connector.ts +1 -0
- package/src/types/index.ts +1 -1
- package/src/types/message.ts +0 -1
- package/src/types/misc.ts +0 -2
- package/src/types/protocol.ts +0 -2
- package/src/types/run.ts +0 -3
- package/src/types/session.ts +1 -51
- package/src/types/swarmdock.ts +29 -0
- package/src/types/task.ts +7 -3
- package/src/types/working-state.ts +2 -9
- package/src/views/settings/section-runtime-loop.tsx +0 -14
- package/src/app/api/canvas/[sessionId]/route.ts +0 -35
- package/src/app/api/missions/[id]/actions/route.ts +0 -31
- package/src/app/api/missions/[id]/events/route.ts +0 -14
- package/src/app/api/missions/[id]/route.ts +0 -10
- package/src/app/api/missions/route.test.ts +0 -244
- package/src/app/api/missions/route.ts +0 -57
- package/src/app/api/wallets/[id]/approve/route.ts +0 -79
- package/src/app/api/wallets/[id]/balance-history/route.ts +0 -18
- package/src/app/api/wallets/[id]/send/route.ts +0 -113
- package/src/app/api/wallets/[id]/transactions/route.ts +0 -18
- package/src/app/missions/[id]/page.tsx +0 -3
- package/src/app/missions/page.tsx +0 -685
- package/src/components/canvas/canvas-panel.tsx +0 -267
- package/src/components/wallets/wallet-approval-dialog.tsx +0 -107
- package/src/components/wallets/wallet-panel.tsx +0 -1010
- package/src/components/wallets/wallet-section.tsx +0 -260
- package/src/features/missions/queries.ts +0 -23
- package/src/lib/canvas-content.test.ts +0 -360
- package/src/lib/canvas-content.ts +0 -198
- package/src/lib/server/canvas-content.test.ts +0 -32
- package/src/lib/server/canvas-content.ts +0 -6
- package/src/lib/server/ethereum.ts +0 -591
- package/src/lib/server/evm-swap.ts +0 -476
- package/src/lib/server/missions/mission-intent.test.ts +0 -63
- package/src/lib/server/missions/mission-intent.ts +0 -569
- package/src/lib/server/missions/mission-repository.ts +0 -74
- package/src/lib/server/missions/mission-service/actions.ts +0 -6
- package/src/lib/server/missions/mission-service/bindings.ts +0 -9
- package/src/lib/server/missions/mission-service/context.ts +0 -4
- package/src/lib/server/missions/mission-service/core.ts +0 -2271
- package/src/lib/server/missions/mission-service/queries.ts +0 -12
- package/src/lib/server/missions/mission-service/recovery.ts +0 -5
- package/src/lib/server/missions/mission-service/ticks.ts +0 -9
- package/src/lib/server/missions/mission-service.test.ts +0 -888
- package/src/lib/server/missions/mission-service.ts +0 -6
- package/src/lib/server/session-tools/canvas.ts +0 -105
- package/src/lib/server/session-tools/wallet-tool.test.ts +0 -150
- package/src/lib/server/session-tools/wallet.ts +0 -1287
- package/src/lib/server/solana.ts +0 -327
- package/src/lib/server/wallet/wallet-execution.test.ts +0 -198
- package/src/lib/server/wallet/wallet-portfolio.test.ts +0 -98
- package/src/lib/server/wallet/wallet-portfolio.ts +0 -772
- package/src/lib/server/wallet/wallet-service.test.ts +0 -81
- package/src/lib/server/wallet/wallet-service.ts +0 -225
- package/src/lib/wallet/wallet-transactions.test.ts +0 -75
- package/src/lib/wallet/wallet-transactions.ts +0 -43
- package/src/lib/wallet/wallet.test.ts +0 -333
- package/src/lib/wallet/wallet.ts +0 -183
- package/src/types/mission.ts +0 -185
- package/src/views/settings/section-wallets.tsx +0 -35
package/src/cli/index.js
CHANGED
|
@@ -105,14 +105,6 @@ const COMMAND_GROUPS = [
|
|
|
105
105
|
cmd('moderate', 'POST', '/chatrooms/:id/moderate', 'Run moderation action on a chatroom', { expectsJsonBody: true }),
|
|
106
106
|
],
|
|
107
107
|
},
|
|
108
|
-
{
|
|
109
|
-
name: 'canvas',
|
|
110
|
-
description: 'Read/update per-session canvas content',
|
|
111
|
-
commands: [
|
|
112
|
-
cmd('get', 'GET', '/canvas/:sessionId', 'Get current canvas content for a session'),
|
|
113
|
-
cmd('set', 'POST', '/canvas/:sessionId', 'Set/clear canvas content for a session', { expectsJsonBody: true }),
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
108
|
{
|
|
117
109
|
name: 'connectors',
|
|
118
110
|
description: 'Manage chat connectors',
|
|
@@ -307,16 +299,7 @@ const COMMAND_GROUPS = [
|
|
|
307
299
|
cmd('get', 'GET', '/memory-images/:filename', 'Download memory image by filename', { responseType: 'binary' }),
|
|
308
300
|
],
|
|
309
301
|
},
|
|
310
|
-
|
|
311
|
-
name: 'missions',
|
|
312
|
-
description: 'Inspect and control durable missions',
|
|
313
|
-
commands: [
|
|
314
|
-
cmd('list', 'GET', '/missions', 'List missions (use --query status=, --query phase=, --query source=, --query sessionId=, --query agentId=, --query projectId=)'),
|
|
315
|
-
cmd('get', 'GET', '/missions/:id', 'Get mission detail by id'),
|
|
316
|
-
cmd('events', 'GET', '/missions/:id/events', 'Get mission event timeline', { expectsQueryHint: true }),
|
|
317
|
-
cmd('action', 'POST', '/missions/:id/actions', 'Run a mission control action (resume, replan, retry_verification, wait, cancel)', { expectsJsonBody: true }),
|
|
318
|
-
],
|
|
319
|
-
},
|
|
302
|
+
|
|
320
303
|
{
|
|
321
304
|
name: 'notifications',
|
|
322
305
|
description: 'Manage in-app notifications',
|
|
@@ -696,21 +679,6 @@ const COMMAND_GROUPS = [
|
|
|
696
679
|
}),
|
|
697
680
|
],
|
|
698
681
|
},
|
|
699
|
-
{
|
|
700
|
-
name: 'wallets',
|
|
701
|
-
description: 'Manage agent wallets and wallet transactions',
|
|
702
|
-
commands: [
|
|
703
|
-
cmd('list', 'GET', '/wallets', 'List wallets'),
|
|
704
|
-
cmd('get', 'GET', '/wallets/:id', 'Get wallet by id'),
|
|
705
|
-
cmd('create', 'POST', '/wallets', 'Create wallet', { expectsJsonBody: true }),
|
|
706
|
-
cmd('update', 'PATCH', '/wallets/:id', 'Update wallet settings', { expectsJsonBody: true }),
|
|
707
|
-
cmd('delete', 'DELETE', '/wallets/:id', 'Delete wallet'),
|
|
708
|
-
cmd('send', 'POST', '/wallets/:id/send', 'Send funds from wallet', { expectsJsonBody: true }),
|
|
709
|
-
cmd('approve', 'POST', '/wallets/:id/approve', 'Approve or deny a pending wallet transaction', { expectsJsonBody: true }),
|
|
710
|
-
cmd('transactions', 'GET', '/wallets/:id/transactions', 'List wallet transactions'),
|
|
711
|
-
cmd('balance-history', 'GET', '/wallets/:id/balance-history', 'Get wallet balance history'),
|
|
712
|
-
],
|
|
713
|
-
},
|
|
714
682
|
{
|
|
715
683
|
name: 'upload',
|
|
716
684
|
description: 'Upload raw file/blob',
|
|
@@ -769,6 +737,26 @@ const COMMAND_GROUPS = [
|
|
|
769
737
|
cmd('history', 'GET', '/webhooks/:id/history', 'Get webhook delivery history'),
|
|
770
738
|
],
|
|
771
739
|
},
|
|
740
|
+
{
|
|
741
|
+
name: 'portability',
|
|
742
|
+
description: 'Export and import agent configurations',
|
|
743
|
+
commands: [
|
|
744
|
+
cmd('export', 'GET', '/portability/export', 'Export agents, skills, and schedules as a portable JSON manifest'),
|
|
745
|
+
cmd('import', 'POST', '/portability/import', 'Import a portable JSON manifest', { expectsJsonBody: true }),
|
|
746
|
+
],
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
name: 'wallets',
|
|
750
|
+
description: 'Manage agent wallets',
|
|
751
|
+
commands: [
|
|
752
|
+
cmd('list', 'GET', '/wallets', 'List wallets'),
|
|
753
|
+
cmd('get', 'GET', '/wallets/:id', 'Get wallet by id'),
|
|
754
|
+
cmd('create', 'POST', '/wallets', 'Create a wallet', { expectsJsonBody: true }),
|
|
755
|
+
cmd('generate', 'POST', '/wallets/generate', 'Generate a new wallet for an agent', { expectsJsonBody: true }),
|
|
756
|
+
cmd('update', 'PATCH', '/wallets/:id', 'Update wallet settings', { expectsJsonBody: true }),
|
|
757
|
+
cmd('delete', 'DELETE', '/wallets/:id', 'Delete a wallet'),
|
|
758
|
+
],
|
|
759
|
+
},
|
|
772
760
|
]
|
|
773
761
|
|
|
774
762
|
const GROUP_MAP = new Map(COMMAND_GROUPS.map((group) => [group.name, group]))
|
package/src/cli/spec.js
CHANGED
|
@@ -59,13 +59,6 @@ const COMMAND_GROUPS = {
|
|
|
59
59
|
pin: { description: 'Toggle pin on a chatroom message', method: 'POST', path: '/chatrooms/:id/pins', params: ['id'] },
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
|
-
canvas: {
|
|
63
|
-
description: 'Session canvas content',
|
|
64
|
-
commands: {
|
|
65
|
-
get: { description: 'Get current canvas content for a session', method: 'GET', path: '/canvas/:sessionId', params: ['sessionId'] },
|
|
66
|
-
set: { description: 'Set/clear canvas content for a session', method: 'POST', path: '/canvas/:sessionId', params: ['sessionId'] },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
62
|
connectors: {
|
|
70
63
|
description: 'Manage chat connectors',
|
|
71
64
|
commands: {
|
|
@@ -214,15 +207,7 @@ const COMMAND_GROUPS = {
|
|
|
214
207
|
clear: { description: 'Clear log file', method: 'DELETE', path: '/logs' },
|
|
215
208
|
},
|
|
216
209
|
},
|
|
217
|
-
|
|
218
|
-
description: 'Inspect and control durable missions',
|
|
219
|
-
commands: {
|
|
220
|
-
list: { description: 'List missions (supports --query status=,phase=,source=,sessionId=,agentId=,projectId=)', method: 'GET', path: '/missions' },
|
|
221
|
-
get: { description: 'Get mission detail by id', method: 'GET', path: '/missions/:id', params: ['id'] },
|
|
222
|
-
events: { description: 'Get mission event timeline', method: 'GET', path: '/missions/:id/events', params: ['id'] },
|
|
223
|
-
action: { description: 'Run a mission control action (resume, replan, retry_verification, wait, cancel)', method: 'POST', path: '/missions/:id/actions', params: ['id'] },
|
|
224
|
-
},
|
|
225
|
-
},
|
|
210
|
+
|
|
226
211
|
memory: {
|
|
227
212
|
description: 'Agent memory entries',
|
|
228
213
|
commands: {
|
|
@@ -526,26 +511,30 @@ const COMMAND_GROUPS = {
|
|
|
526
511
|
events: { description: 'Get run event history by run id', method: 'GET', path: '/runs/:id/events', params: ['id'] },
|
|
527
512
|
},
|
|
528
513
|
},
|
|
529
|
-
wallets: {
|
|
530
|
-
description: 'Agent wallet operations',
|
|
531
|
-
commands: {
|
|
532
|
-
list: { description: 'List wallets', method: 'GET', path: '/wallets' },
|
|
533
|
-
get: { description: 'Get wallet by id', method: 'GET', path: '/wallets/:id', params: ['id'] },
|
|
534
|
-
create: { description: 'Create wallet', method: 'POST', path: '/wallets' },
|
|
535
|
-
update: { description: 'Update wallet settings', method: 'PATCH', path: '/wallets/:id', params: ['id'] },
|
|
536
|
-
delete: { description: 'Delete wallet', method: 'DELETE', path: '/wallets/:id', params: ['id'] },
|
|
537
|
-
send: { description: 'Send funds from wallet', method: 'POST', path: '/wallets/:id/send', params: ['id'] },
|
|
538
|
-
approve: { description: 'Approve or deny pending wallet transaction', method: 'POST', path: '/wallets/:id/approve', params: ['id'] },
|
|
539
|
-
transactions: { description: 'List wallet transactions', method: 'GET', path: '/wallets/:id/transactions', params: ['id'] },
|
|
540
|
-
'balance-history': { description: 'Get wallet balance history', method: 'GET', path: '/wallets/:id/balance-history', params: ['id'] },
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
514
|
webhooks: {
|
|
544
515
|
description: 'Inbound webhook triggers',
|
|
545
516
|
commands: {
|
|
546
517
|
trigger: { description: 'Trigger webhook by id', method: 'POST', path: '/webhooks/:id', params: ['id'], waitable: true },
|
|
547
518
|
},
|
|
548
519
|
},
|
|
520
|
+
portability: {
|
|
521
|
+
description: 'Export and import agent configurations',
|
|
522
|
+
commands: {
|
|
523
|
+
export: { description: 'Export agents, skills, and schedules as a portable JSON manifest', method: 'GET', path: '/portability/export' },
|
|
524
|
+
import: { description: 'Import a portable JSON manifest', method: 'POST', path: '/portability/import', body: true },
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
wallets: {
|
|
528
|
+
description: 'Manage agent wallets',
|
|
529
|
+
commands: {
|
|
530
|
+
list: { description: 'List wallets', method: 'GET', path: '/wallets' },
|
|
531
|
+
get: { description: 'Get wallet by id', method: 'GET', path: '/wallets/:id', params: ['id'] },
|
|
532
|
+
create: { description: 'Create a wallet', method: 'POST', path: '/wallets' },
|
|
533
|
+
generate: { description: 'Generate a new wallet for an agent', method: 'POST', path: '/wallets/generate', body: true },
|
|
534
|
+
update: { description: 'Update wallet settings', method: 'PATCH', path: '/wallets/:id', params: ['id'], body: true },
|
|
535
|
+
delete: { description: 'Delete a wallet', method: 'DELETE', path: '/wallets/:id', params: ['id'] },
|
|
536
|
+
},
|
|
537
|
+
},
|
|
549
538
|
}
|
|
550
539
|
|
|
551
540
|
const GROUP_NAMES = Object.keys(COMMAND_GROUPS)
|
|
@@ -10,8 +10,7 @@ import { sleep } from '@/lib/shared-utils'
|
|
|
10
10
|
import { BottomSheet } from '@/components/shared/bottom-sheet'
|
|
11
11
|
import { toast } from 'sonner'
|
|
12
12
|
import { ModelCombobox } from '@/components/shared/model-combobox'
|
|
13
|
-
import type { ProviderType, ClaudeSkill,
|
|
14
|
-
import { WalletSection } from '@/components/wallets/wallet-section'
|
|
13
|
+
import type { ProviderType, ClaudeSkill, AgentPackManifest, AgentRoutingStrategy, AgentRoutingTarget } from '@/types'
|
|
15
14
|
import { AVAILABLE_TOOLS, PLATFORM_TOOLS } from '@/lib/tool-definitions'
|
|
16
15
|
import { NATIVE_CAPABILITY_PROVIDER_IDS, NON_LANGGRAPH_PROVIDER_IDS, WORKER_ONLY_PROVIDER_IDS } from '@/lib/provider-sets'
|
|
17
16
|
import { isOrchestratorProviderEligible } from '@/lib/orchestrator-config'
|
|
@@ -49,14 +48,6 @@ const AUTO_SYNC_MODEL_PROVIDER_IDS = new Set<ProviderType>([
|
|
|
49
48
|
const CONNECTION_TEST_TIMEOUT_MS = 40_000
|
|
50
49
|
type AgentProviderId = string
|
|
51
50
|
|
|
52
|
-
type SafeAgentWallet = Omit<AgentWallet, 'encryptedPrivateKey'> & {
|
|
53
|
-
balanceAtomic?: string
|
|
54
|
-
balanceLamports?: number
|
|
55
|
-
balanceFormatted?: string
|
|
56
|
-
balanceSymbol?: string
|
|
57
|
-
isActive?: boolean
|
|
58
|
-
}
|
|
59
|
-
|
|
60
51
|
function SectionCard({
|
|
61
52
|
title,
|
|
62
53
|
description,
|
|
@@ -266,7 +257,6 @@ export function AgentSheet() {
|
|
|
266
257
|
const [dailyBudget, setDailyBudget] = useState('')
|
|
267
258
|
const [monthlyBudget, setMonthlyBudget] = useState('')
|
|
268
259
|
const [budgetAction, setBudgetAction] = useState<'warn' | 'block'>('warn')
|
|
269
|
-
const [agentWallets, setAgentWallets] = useState<SafeAgentWallet[]>([])
|
|
270
260
|
const [addingKey, setAddingKey] = useState(false)
|
|
271
261
|
const [newKeyName, setNewKeyName] = useState('')
|
|
272
262
|
const [newKeyValue, setNewKeyValue] = useState('')
|
|
@@ -297,21 +287,6 @@ export function AgentSheet() {
|
|
|
297
287
|
e.target.value = ''
|
|
298
288
|
}
|
|
299
289
|
|
|
300
|
-
const loadAgentWallets = useCallback(async (agentId: string) => {
|
|
301
|
-
try {
|
|
302
|
-
const wallets = await api<Record<string, SafeAgentWallet>>('GET', `/wallets?agentId=${encodeURIComponent(agentId)}`)
|
|
303
|
-
const matches = Object.values(wallets)
|
|
304
|
-
.filter((wallet) => wallet.agentId === agentId)
|
|
305
|
-
.sort((a, b) => {
|
|
306
|
-
if ((a.isActive ? 1 : 0) !== (b.isActive ? 1 : 0)) return a.isActive ? -1 : 1
|
|
307
|
-
return a.chain.localeCompare(b.chain)
|
|
308
|
-
})
|
|
309
|
-
setAgentWallets(matches)
|
|
310
|
-
} catch {
|
|
311
|
-
setAgentWallets([])
|
|
312
|
-
}
|
|
313
|
-
}, [])
|
|
314
|
-
|
|
315
290
|
const agentSelectableProviders = useMemo(
|
|
316
291
|
() => buildAgentSelectableProviders(providers, providerConfigs),
|
|
317
292
|
[providers, providerConfigs],
|
|
@@ -487,7 +462,6 @@ export function AgentSheet() {
|
|
|
487
462
|
setDailyBudget(typeof editing.dailyBudget === 'number' && editing.dailyBudget > 0 ? String(editing.dailyBudget) : '')
|
|
488
463
|
setMonthlyBudget(typeof editing.monthlyBudget === 'number' && editing.monthlyBudget > 0 ? String(editing.monthlyBudget) : '')
|
|
489
464
|
setBudgetAction(editing.budgetAction || 'warn')
|
|
490
|
-
void loadAgentWallets(editing.id)
|
|
491
465
|
} else if (useAppStore.getState().agentPrefill) {
|
|
492
466
|
// Duplicate mode — prefill from source agent, then clear
|
|
493
467
|
const src = useAppStore.getState().agentPrefill!
|
|
@@ -567,7 +541,6 @@ export function AgentSheet() {
|
|
|
567
541
|
setDailyBudget(typeof src.dailyBudget === 'number' && src.dailyBudget > 0 ? String(src.dailyBudget) : '')
|
|
568
542
|
setMonthlyBudget(typeof src.monthlyBudget === 'number' && src.monthlyBudget > 0 ? String(src.monthlyBudget) : '')
|
|
569
543
|
setBudgetAction(src.budgetAction || 'warn')
|
|
570
|
-
setAgentWallets([])
|
|
571
544
|
} else {
|
|
572
545
|
setName('')
|
|
573
546
|
setDescription('')
|
|
@@ -634,7 +607,6 @@ export function AgentSheet() {
|
|
|
634
607
|
setDailyBudget('')
|
|
635
608
|
setMonthlyBudget('')
|
|
636
609
|
setBudgetAction('warn')
|
|
637
|
-
setAgentWallets([])
|
|
638
610
|
}
|
|
639
611
|
}
|
|
640
612
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2657,7 +2629,7 @@ export function AgentSheet() {
|
|
|
2657
2629
|
|
|
2658
2630
|
<SectionCard
|
|
2659
2631
|
title="Utilities"
|
|
2660
|
-
description="Import and export agents
|
|
2632
|
+
description="Import and export agents."
|
|
2661
2633
|
className="mb-0 border-white/[0.05] bg-white/[0.01]"
|
|
2662
2634
|
>
|
|
2663
2635
|
<div className="flex flex-wrap gap-3">
|
|
@@ -2681,16 +2653,6 @@ export function AgentSheet() {
|
|
|
2681
2653
|
</button>
|
|
2682
2654
|
)}
|
|
2683
2655
|
</div>
|
|
2684
|
-
{editing && (
|
|
2685
|
-
<div className="mt-6">
|
|
2686
|
-
<WalletSection
|
|
2687
|
-
agentId={editing.id}
|
|
2688
|
-
wallets={agentWallets}
|
|
2689
|
-
activeWalletId={editing.activeWalletId || null}
|
|
2690
|
-
onWalletCreated={() => loadAgentWallets(editing.id)}
|
|
2691
|
-
/>
|
|
2692
|
-
</div>
|
|
2693
|
-
)}
|
|
2694
2656
|
</SectionCard>
|
|
2695
2657
|
</AdvancedSettingsSection>
|
|
2696
2658
|
)}
|
|
@@ -6,7 +6,6 @@ import type { Agent, MemoryEntry, Session } from '@/types'
|
|
|
6
6
|
import { useAppStore } from '@/stores/use-app-store'
|
|
7
7
|
import { useChatStore } from '@/stores/use-chat-store'
|
|
8
8
|
import { api } from '@/lib/app/api-client'
|
|
9
|
-
import { dedup } from '@/lib/shared-utils'
|
|
10
9
|
import { AgentAvatar } from './agent-avatar'
|
|
11
10
|
import { AgentFilesEditor } from './agent-files-editor'
|
|
12
11
|
import { OpenClawSkillsPanel } from './openclaw-skills-panel'
|
|
@@ -205,25 +204,6 @@ function ToggleSwitch({ on, onChange, disabled }: { on: boolean; onChange: () =>
|
|
|
205
204
|
)
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
// --- Wallet helpers (extracted from chat-header) ---
|
|
209
|
-
|
|
210
|
-
function getAgentWalletIds(agent: { walletIds?: string[]; walletId?: string | null } | null | undefined): string[] {
|
|
211
|
-
const ids = Array.isArray(agent?.walletIds)
|
|
212
|
-
? agent.walletIds.filter((value): value is string => typeof value === 'string' && value.trim().length > 0)
|
|
213
|
-
: []
|
|
214
|
-
const legacy = typeof agent?.walletId === 'string' && agent.walletId.trim()
|
|
215
|
-
? [agent.walletId.trim()]
|
|
216
|
-
: []
|
|
217
|
-
return dedup([...ids, ...legacy])
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function getAgentActiveWalletId(agent: { activeWalletId?: string | null; walletIds?: string[]; walletId?: string | null } | null | undefined): string | null {
|
|
221
|
-
const walletIds = getAgentWalletIds(agent)
|
|
222
|
-
if (typeof agent?.activeWalletId === 'string' && walletIds.includes(agent.activeWalletId)) return agent.activeWalletId
|
|
223
|
-
if (typeof agent?.walletId === 'string' && walletIds.includes(agent.walletId)) return agent.walletId
|
|
224
|
-
return walletIds[0] || null
|
|
225
|
-
}
|
|
226
|
-
|
|
227
207
|
// --- Main component ---
|
|
228
208
|
|
|
229
209
|
export function InspectorPanel({ agent, session, onEditAgent, onDuplicateAgent, onClearHistory, onDeleteAgent, onDeleteChat, isMainChat }: Props) {
|
|
@@ -345,7 +325,6 @@ function DashboardTab({ agent, session }: { agent: Agent; session: Session }) {
|
|
|
345
325
|
<IdentityCard agent={agent} />
|
|
346
326
|
{agent.provider === 'openclaw' && <OpenClawActionsSection agent={agent} />}
|
|
347
327
|
<HeartbeatSection agent={agent} session={session} />
|
|
348
|
-
<WalletSection agent={agent} />
|
|
349
328
|
<ToolsSection agent={agent} session={session} />
|
|
350
329
|
<AudioSection />
|
|
351
330
|
<MemorySection agentId={agent.id} />
|
|
@@ -613,68 +592,6 @@ function HeartbeatSection({ agent, session }: { agent: Agent; session: Session }
|
|
|
613
592
|
)
|
|
614
593
|
}
|
|
615
594
|
|
|
616
|
-
// ─── Wallet Section ──────────────────────────────────────────────
|
|
617
|
-
|
|
618
|
-
function WalletSection({ agent }: { agent: Agent }) {
|
|
619
|
-
const setWalletPanelAgentId = useAppStore((s) => s.setWalletPanelAgentId)
|
|
620
|
-
const navigateTo = useNavigate()
|
|
621
|
-
const agentWalletIds = useMemo(() => getAgentWalletIds(agent), [agent])
|
|
622
|
-
const activeWalletId = useMemo(() => getAgentActiveWalletId(agent), [agent])
|
|
623
|
-
const [walletBalance, setWalletBalance] = useState<{ formatted: string; symbol: string; assets?: number } | null>(null)
|
|
624
|
-
|
|
625
|
-
useEffect(() => {
|
|
626
|
-
if (!activeWalletId) return
|
|
627
|
-
let cancelled = false
|
|
628
|
-
api<{ balanceFormatted?: string; balanceSymbol?: string; portfolioSummary?: { nonZeroAssets?: number } }>('GET', `/wallets/${activeWalletId}?cached=1`)
|
|
629
|
-
.then((data) => {
|
|
630
|
-
if (cancelled) return
|
|
631
|
-
if (data.balanceFormatted && data.balanceSymbol) {
|
|
632
|
-
setWalletBalance({
|
|
633
|
-
formatted: data.balanceFormatted,
|
|
634
|
-
symbol: data.balanceSymbol,
|
|
635
|
-
assets: typeof data.portfolioSummary?.nonZeroAssets === 'number' ? data.portfolioSummary.nonZeroAssets : undefined,
|
|
636
|
-
})
|
|
637
|
-
}
|
|
638
|
-
})
|
|
639
|
-
.catch(() => {})
|
|
640
|
-
return () => { cancelled = true }
|
|
641
|
-
}, [activeWalletId])
|
|
642
|
-
|
|
643
|
-
if (agentWalletIds.length === 0) return null
|
|
644
|
-
|
|
645
|
-
const handleClick = () => {
|
|
646
|
-
setWalletPanelAgentId(agent.id)
|
|
647
|
-
navigateTo('wallets')
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
return (
|
|
651
|
-
<div className={panelCardClass('p-4')}>
|
|
652
|
-
<SectionLabel>Wallet</SectionLabel>
|
|
653
|
-
<button
|
|
654
|
-
type="button"
|
|
655
|
-
onClick={handleClick}
|
|
656
|
-
className="flex items-center gap-2 w-full bg-transparent border-none cursor-pointer text-left group"
|
|
657
|
-
>
|
|
658
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="text-text-3/50 shrink-0">
|
|
659
|
-
<rect x="2" y="6" width="20" height="14" rx="2" />
|
|
660
|
-
<path d="M22 10H18a2 2 0 0 0 0 4h4" />
|
|
661
|
-
</svg>
|
|
662
|
-
{walletBalance ? (
|
|
663
|
-
<span className="text-[13px] text-text-2 font-600 group-hover:text-accent-bright transition-colors">
|
|
664
|
-
{walletBalance.formatted} {walletBalance.symbol}
|
|
665
|
-
{walletBalance.assets && walletBalance.assets > 1 ? ` +${walletBalance.assets - 1} assets` : ''}
|
|
666
|
-
</span>
|
|
667
|
-
) : (
|
|
668
|
-
<span className="text-[13px] text-text-3/50 group-hover:text-text-3 transition-colors">View wallet</span>
|
|
669
|
-
)}
|
|
670
|
-
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="ml-auto text-text-3/30 group-hover:text-text-3/60 transition-colors shrink-0">
|
|
671
|
-
<polyline points="9 18 15 12 9 6" />
|
|
672
|
-
</svg>
|
|
673
|
-
</button>
|
|
674
|
-
</div>
|
|
675
|
-
)
|
|
676
|
-
}
|
|
677
|
-
|
|
678
595
|
// ─── Tools Section ───────────────────────────────────────────────
|
|
679
596
|
|
|
680
597
|
function ToolsSection({ agent, session }: { agent: Agent; session: Session }) {
|
|
@@ -15,7 +15,6 @@ import { AgentAvatar } from '@/components/agents/agent-avatar'
|
|
|
15
15
|
import { timeAgoShort } from '@/lib/time-format'
|
|
16
16
|
import { toast } from 'sonner'
|
|
17
17
|
import { getEnabledCapabilityIds } from '@/lib/capability-selection'
|
|
18
|
-
import { getMissionPath } from '@/lib/app/navigation'
|
|
19
18
|
|
|
20
19
|
function shortPath(p: string): string {
|
|
21
20
|
return (p || '').replace(/^\/Users\/\w+/, '~')
|
|
@@ -80,7 +79,6 @@ export function ChatCard({ session, active, onClick }: Props) {
|
|
|
80
79
|
: session.name
|
|
81
80
|
const connector = getSessionConnector(session, connectors)
|
|
82
81
|
const queuedCount = Math.max(session.queuedCount ?? 0, optimisticQueuedCount)
|
|
83
|
-
const mission = session.missionSummary || null
|
|
84
82
|
const loopIsOngoing = appSettings.loopMode === 'ongoing'
|
|
85
83
|
const explicitOptIn = session.heartbeatEnabled === true || agent?.heartbeatEnabled === true
|
|
86
84
|
const intervalRaw = session.heartbeatIntervalSec ?? agent?.heartbeatIntervalSec ?? appSettings.heartbeatIntervalSec ?? DEFAULT_HEARTBEAT_INTERVAL_SEC
|
|
@@ -199,35 +197,6 @@ export function ChatCard({ session, active, onClick }: Props) {
|
|
|
199
197
|
<span className="w-1.5 h-1.5 rounded-full bg-amber-400" />
|
|
200
198
|
{queuedCount} queued {queuedCount === 1 ? 'message' : 'messages'} waiting
|
|
201
199
|
</div>
|
|
202
|
-
) : mission ? (
|
|
203
|
-
<div className="mt-1 flex items-center gap-2">
|
|
204
|
-
<div className={`min-w-0 truncate text-[13px] leading-relaxed flex items-center gap-1.5 ${
|
|
205
|
-
mission.status === 'waiting' || mission.status === 'failed' || mission.status === 'cancelled'
|
|
206
|
-
? 'text-amber-300/75'
|
|
207
|
-
: mission.status === 'completed'
|
|
208
|
-
? 'text-emerald-300/75'
|
|
209
|
-
: 'text-sky-300/75'
|
|
210
|
-
}`}>
|
|
211
|
-
<span className={`w-1.5 h-1.5 rounded-full ${
|
|
212
|
-
mission.status === 'waiting' || mission.status === 'failed' || mission.status === 'cancelled'
|
|
213
|
-
? 'bg-amber-400'
|
|
214
|
-
: mission.status === 'completed'
|
|
215
|
-
? 'bg-emerald-400'
|
|
216
|
-
: 'bg-sky-400'
|
|
217
|
-
}`} />
|
|
218
|
-
<span className="truncate">{mission.waitingReason || mission.currentStep || mission.objective}</span>
|
|
219
|
-
</div>
|
|
220
|
-
<button
|
|
221
|
-
type="button"
|
|
222
|
-
onClick={(event) => {
|
|
223
|
-
event.stopPropagation()
|
|
224
|
-
router.push(getMissionPath(mission.id))
|
|
225
|
-
}}
|
|
226
|
-
className="shrink-0 rounded-[8px] border border-white/[0.08] px-2 py-1 text-[10px] font-700 uppercase tracking-[0.08em] text-text-2 transition-colors hover:bg-white/[0.05]"
|
|
227
|
-
>
|
|
228
|
-
Mission
|
|
229
|
-
</button>
|
|
230
|
-
</div>
|
|
231
200
|
) : (
|
|
232
201
|
<div className="text-[13px] text-text-2/50 truncate mt-1 leading-relaxed">{preview}</div>
|
|
233
202
|
)}
|
|
@@ -337,23 +337,6 @@ export const MessageBubble = memo(function MessageBubble({ message, assistantNam
|
|
|
337
337
|
return null
|
|
338
338
|
}, [message.text, isUser])
|
|
339
339
|
|
|
340
|
-
const walletRequest = useMemo(() => {
|
|
341
|
-
if (isUser) return null
|
|
342
|
-
try {
|
|
343
|
-
const data = JSON.parse(message.text)
|
|
344
|
-
if (data.type === 'extension_wallet_transfer_request') return data
|
|
345
|
-
} catch { /* ignore */ }
|
|
346
|
-
return null
|
|
347
|
-
}, [message.text, isUser])
|
|
348
|
-
|
|
349
|
-
const walletActionRequest = useMemo(() => {
|
|
350
|
-
if (isUser) return null
|
|
351
|
-
try {
|
|
352
|
-
const data = JSON.parse(message.text)
|
|
353
|
-
if (data.type === 'extension_wallet_action_request') return data
|
|
354
|
-
} catch { /* ignore */ }
|
|
355
|
-
return null
|
|
356
|
-
}, [message.text, isUser])
|
|
357
340
|
const currentUser = useAppStore((s) => s.currentUser)
|
|
358
341
|
const isDesktop = useMediaQuery('(min-width: 768px)')
|
|
359
342
|
const setPreviewContent = useChatStore((s) => s.setPreviewContent)
|
|
@@ -560,8 +543,6 @@ export const MessageBubble = memo(function MessageBubble({ message, assistantNam
|
|
|
560
543
|
const hasPrimaryAttachments = Boolean(message.imagePath || message.imageUrl || message.attachedFiles?.length)
|
|
561
544
|
const shouldRenderBubbleShell = hasPrimaryAttachments
|
|
562
545
|
|| Boolean(allToolMedia)
|
|
563
|
-
|| Boolean(walletRequest)
|
|
564
|
-
|| Boolean(walletActionRequest)
|
|
565
546
|
|| Boolean(installRequest)
|
|
566
547
|
|| Boolean(scaffoldRequest)
|
|
567
548
|
|| isExtensionUI
|
|
@@ -703,95 +684,7 @@ export const MessageBubble = memo(function MessageBubble({ message, assistantNam
|
|
|
703
684
|
) : shouldRenderBubbleShell ? (
|
|
704
685
|
/* Message bubble */
|
|
705
686
|
<div className={`${isStructured ? 'max-w-[92%] md:max-w-[85%]' : 'max-w-[85%] md:max-w-[72%]'} ${isUser ? 'bubble-user px-5 py-3.5' : isHeartbeat ? 'bubble-ai px-4 py-3' : 'bubble-ai px-5 py-3.5'}`}>
|
|
706
|
-
{
|
|
707
|
-
<div className="flex flex-col gap-3 p-4 rounded-[18px] bg-sky-500/[0.03] border border-sky-500/20 shadow-[0_0_20px_rgba(14,165,233,0.05)]">
|
|
708
|
-
<div className="flex items-center gap-2 mb-1">
|
|
709
|
-
<div className="w-5 h-5 rounded-full bg-sky-500/20 flex items-center justify-center text-sky-400">
|
|
710
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
|
711
|
-
<path d="M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
|
712
|
-
</svg>
|
|
713
|
-
</div>
|
|
714
|
-
<span className="text-[11px] font-700 uppercase tracking-wider text-sky-400/80">Wallet Transfer Request</span>
|
|
715
|
-
</div>
|
|
716
|
-
<p className="text-[13px] text-text-2/90 leading-relaxed">{walletRequest.message}</p>
|
|
717
|
-
<div className="p-3 rounded-[12px] bg-black/40 border border-white/5 flex flex-col gap-2">
|
|
718
|
-
<div className="flex justify-between items-center">
|
|
719
|
-
<span className="text-[11px] text-text-3/60 font-600 uppercase">Amount</span>
|
|
720
|
-
<span className="text-[13px] font-700 text-sky-400">{walletRequest.amountDisplay || `${walletRequest.amountSol} SOL`}</span>
|
|
721
|
-
</div>
|
|
722
|
-
<div className="flex flex-col gap-1">
|
|
723
|
-
<span className="text-[11px] text-text-3/60 font-600 uppercase">To Address</span>
|
|
724
|
-
<span className="text-[11px] font-mono text-text-2/70 break-all">{walletRequest.toAddress}</span>
|
|
725
|
-
</div>
|
|
726
|
-
{walletRequest.memo && (
|
|
727
|
-
<div className="flex flex-col gap-1 border-t border-white/5 pt-2">
|
|
728
|
-
<span className="text-[11px] text-text-3/60 font-600 uppercase">Memo</span>
|
|
729
|
-
<span className="text-[12px] text-text-3/80 italic">"{walletRequest.memo}"</span>
|
|
730
|
-
</div>
|
|
731
|
-
)}
|
|
732
|
-
</div>
|
|
733
|
-
<div className="flex gap-2 mt-1">
|
|
734
|
-
<button
|
|
735
|
-
onClick={() => useChatStore.getState().sendMessage(`I approve this transfer of ${walletRequest.amountDisplay || `${walletRequest.amountSol} SOL`} to ${walletRequest.toAddress}. Proceed with wallet_tool and set approved=true.`)}
|
|
736
|
-
className="px-4 py-2 rounded-[12px] bg-sky-500 text-black text-[13px] font-700 hover:bg-sky-400 transition-all active:scale-[0.98]"
|
|
737
|
-
>
|
|
738
|
-
Approve & Send
|
|
739
|
-
</button>
|
|
740
|
-
<button
|
|
741
|
-
onClick={() => useChatStore.getState().sendMessage(`I do not approve this transaction. Cancel it.`)}
|
|
742
|
-
className="px-4 py-2 rounded-[12px] bg-white/[0.05] hover:bg-white/[0.1] text-text-2 text-[13px] font-600 transition-all border border-white/10"
|
|
743
|
-
>
|
|
744
|
-
Reject
|
|
745
|
-
</button>
|
|
746
|
-
</div>
|
|
747
|
-
</div>
|
|
748
|
-
) : walletActionRequest ? (
|
|
749
|
-
<div className="flex flex-col gap-3 p-4 rounded-[18px] bg-violet-500/[0.03] border border-violet-500/20 shadow-[0_0_20px_rgba(139,92,246,0.05)]">
|
|
750
|
-
<div className="flex items-center gap-2 mb-1">
|
|
751
|
-
<div className="w-5 h-5 rounded-full bg-violet-500/20 flex items-center justify-center text-violet-400">
|
|
752
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
|
|
753
|
-
<path d="M12 2v8" />
|
|
754
|
-
<path d="M8 6h8" />
|
|
755
|
-
<path d="m5 19 4-4 3 3 7-7" />
|
|
756
|
-
</svg>
|
|
757
|
-
</div>
|
|
758
|
-
<span className="text-[11px] font-700 uppercase tracking-wider text-violet-400/80">Wallet Action Request</span>
|
|
759
|
-
</div>
|
|
760
|
-
<p className="text-[13px] text-text-2/90 leading-relaxed">{walletActionRequest.message}</p>
|
|
761
|
-
<div className="p-3 rounded-[12px] bg-black/40 border border-white/5 flex flex-col gap-2">
|
|
762
|
-
<div className="flex justify-between items-center gap-3">
|
|
763
|
-
<span className="text-[11px] text-text-3/60 font-600 uppercase">Action</span>
|
|
764
|
-
<span className="text-[13px] font-700 text-violet-400">{walletActionRequest.action || 'wallet_action'}</span>
|
|
765
|
-
</div>
|
|
766
|
-
{(walletActionRequest.chain || walletActionRequest.network) && (
|
|
767
|
-
<div className="flex justify-between items-center gap-3">
|
|
768
|
-
<span className="text-[11px] text-text-3/60 font-600 uppercase">Chain</span>
|
|
769
|
-
<span className="text-[12px] text-text-2/80">{[walletActionRequest.chain, walletActionRequest.network].filter(Boolean).join(' / ')}</span>
|
|
770
|
-
</div>
|
|
771
|
-
)}
|
|
772
|
-
{walletActionRequest.summary && (
|
|
773
|
-
<div className="flex flex-col gap-1 border-t border-white/5 pt-2">
|
|
774
|
-
<span className="text-[11px] text-text-3/60 font-600 uppercase">Summary</span>
|
|
775
|
-
<span className="text-[12px] text-text-2/80 whitespace-pre-wrap break-words">{walletActionRequest.summary}</span>
|
|
776
|
-
</div>
|
|
777
|
-
)}
|
|
778
|
-
</div>
|
|
779
|
-
<div className="flex gap-2 mt-1">
|
|
780
|
-
<button
|
|
781
|
-
onClick={() => useChatStore.getState().sendMessage(`I approve this wallet action (${walletActionRequest.action || 'wallet_action'}). Proceed with wallet_tool and set approved=true.`)}
|
|
782
|
-
className="px-4 py-2 rounded-[12px] bg-violet-500 text-black text-[13px] font-700 hover:bg-violet-400 transition-all active:scale-[0.98]"
|
|
783
|
-
>
|
|
784
|
-
Approve Action
|
|
785
|
-
</button>
|
|
786
|
-
<button
|
|
787
|
-
onClick={() => useChatStore.getState().sendMessage('I do not approve this wallet action. Cancel it.')}
|
|
788
|
-
className="px-4 py-2 rounded-[12px] bg-white/[0.05] hover:bg-white/[0.1] text-text-2 text-[13px] font-600 transition-all border border-white/10"
|
|
789
|
-
>
|
|
790
|
-
Reject
|
|
791
|
-
</button>
|
|
792
|
-
</div>
|
|
793
|
-
</div>
|
|
794
|
-
) : installRequest ? (
|
|
687
|
+
{installRequest ? (
|
|
795
688
|
<div className="flex flex-col gap-3 p-4 rounded-[18px] bg-emerald-500/[0.03] border border-emerald-500/20 shadow-[0_0_20px_rgba(16,185,129,0.05)]">
|
|
796
689
|
<div className="flex items-center gap-2 mb-1">
|
|
797
690
|
<div className="w-5 h-5 rounded-full bg-emerald-500/20 flex items-center justify-center text-emerald-400">
|
|
@@ -96,6 +96,8 @@ const FIELD_HINTS: Record<string, string> = {
|
|
|
96
96
|
dmAddressingMode: 'Control whether DMs need to address the agent by name before it replies',
|
|
97
97
|
ownerSenderId: 'Optional sender ID that should route to the main owner thread for direct agent connectors',
|
|
98
98
|
scopes: 'Press Enter after each scope to add it',
|
|
99
|
+
walletAddress: 'Base L2 Ethereum address for receiving USDC payments from completed tasks',
|
|
100
|
+
maxBudget: 'USDC with 6 decimal places. $1.00 = 1000000, $5.00 = 5000000',
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
const BOOLEAN_SELECT_OPTIONS: ConnectorConfigOption[] = [
|
|
@@ -344,6 +346,26 @@ const PLATFORMS: {
|
|
|
344
346
|
{ key: 'signalCliHttpUrl', label: 'HTTP API URL', placeholder: 'http://localhost:8080', help: 'Only needed for http mode', section: 'advanced' },
|
|
345
347
|
],
|
|
346
348
|
},
|
|
349
|
+
{
|
|
350
|
+
id: 'swarmdock',
|
|
351
|
+
label: 'SwarmDock',
|
|
352
|
+
color: '#F59E0B',
|
|
353
|
+
setupSteps: [
|
|
354
|
+
'Generate an Ed25519 keypair for agent identity',
|
|
355
|
+
'Set your Base L2 wallet address for receiving USDC payments',
|
|
356
|
+
'Configure skills and auto-discovery preferences',
|
|
357
|
+
],
|
|
358
|
+
tokenLabel: 'SwarmDock Identity Key',
|
|
359
|
+
tokenHelp: 'Encrypted Ed25519 private key used to authenticate this agent on SwarmDock.',
|
|
360
|
+
configFields: [
|
|
361
|
+
{ key: 'apiUrl', label: 'API URL', placeholder: 'https://api.swarmdock.ai', help: 'SwarmDock marketplace API endpoint' },
|
|
362
|
+
{ key: 'walletAddress', label: 'Base L2 Wallet Address', placeholder: '0x...', help: 'USDC wallet on Base L2 for payments' },
|
|
363
|
+
{ key: 'agentDescription', label: 'Marketplace Description', placeholder: 'Specialized in...', help: 'Description on your SwarmDock profile' },
|
|
364
|
+
{ key: 'skills', label: 'Skills (comma-separated)', placeholder: 'data-analysis,web-design', help: 'Skill IDs for task matching' },
|
|
365
|
+
{ key: 'autoDiscover', label: 'Auto-Discover Tasks', placeholder: 'false', help: 'Automatically bid on matching tasks' },
|
|
366
|
+
{ key: 'maxBudget', label: 'Max Budget (USDC micro-units)', placeholder: '5000000', help: '$1 = 1000000, $5 = 5000000' },
|
|
367
|
+
],
|
|
368
|
+
},
|
|
347
369
|
]
|
|
348
370
|
|
|
349
371
|
const COMMON_CONFIG_FIELDS: ConnectorConfigField[] = [
|
|
@@ -1181,7 +1203,9 @@ export function ConnectorSheet() {
|
|
|
1181
1203
|
try {
|
|
1182
1204
|
const cred = await createCredentialMutation.mutateAsync({
|
|
1183
1205
|
provider: platform,
|
|
1184
|
-
name: newCredName.trim() ||
|
|
1206
|
+
name: newCredName.trim() || (platform === 'swarmdock'
|
|
1207
|
+
? `${platformConfig.label} Identity Key`
|
|
1208
|
+
: `${platformConfig.label} Bot Token`),
|
|
1185
1209
|
apiKey: newCredValue.trim(),
|
|
1186
1210
|
})
|
|
1187
1211
|
await credentialsQuery.refetch()
|
|
@@ -270,11 +270,7 @@ export function SidebarRail({
|
|
|
270
270
|
<path d="M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2" /><rect x="9" y="3" width="6" height="4" rx="1" /><path d="M9 14l2 2 4-4" />
|
|
271
271
|
</svg>
|
|
272
272
|
</NavItem>
|
|
273
|
-
|
|
274
|
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
275
|
-
<path d="M12 3 4 7v5c0 5 3.4 8.8 8 10 4.6-1.2 8-5 8-10V7l-8-4Z" /><path d="m9.5 12 1.8 1.8L15 10" />
|
|
276
|
-
</svg>
|
|
277
|
-
</NavItem>
|
|
273
|
+
|
|
278
274
|
<NavItem view="schedules" label="Schedules" expanded={railExpanded} isActive={isNavActive('schedules')} onClick={() => handleNavClick('schedules')}>
|
|
279
275
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
280
276
|
<circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" />
|
|
@@ -343,6 +339,11 @@ export function SidebarRail({
|
|
|
343
339
|
<rect x="3" y="11" width="18" height="11" rx="2" ry="2" /><path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
|
344
340
|
</svg>
|
|
345
341
|
</NavItem>
|
|
342
|
+
<NavItem view="wallets" label="Wallets" expanded={railExpanded} isActive={isNavActive('wallets')} onClick={() => handleNavClick('wallets')}>
|
|
343
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
344
|
+
<rect x="2" y="6" width="20" height="14" rx="2" /><path d="M22 10H18a2 2 0 0 0 0 4h4" /><path d="M6 6V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2" />
|
|
345
|
+
</svg>
|
|
346
|
+
</NavItem>
|
|
346
347
|
<NavItem view="providers" label="Providers" expanded={railExpanded} isActive={isNavActive('providers')} onClick={() => handleNavClick('providers')}>
|
|
347
348
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
348
349
|
<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" />
|
|
@@ -365,11 +366,6 @@ export function SidebarRail({
|
|
|
365
366
|
<path d="M12 16h.01" />
|
|
366
367
|
</svg>
|
|
367
368
|
</NavItem>
|
|
368
|
-
<NavItem view="wallets" label="Wallets" expanded={railExpanded} isActive={isNavActive('wallets')} onClick={() => handleNavClick('wallets')}>
|
|
369
|
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
370
|
-
<rect x="2" y="6" width="20" height="14" rx="2" /><path d="M22 10H18a2 2 0 0 0 0 4h4" /><path d="M6 6V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2" />
|
|
371
|
-
</svg>
|
|
372
|
-
</NavItem>
|
|
373
369
|
<NavItem view="logs" label="Logs" expanded={railExpanded} isActive={isNavActive('logs')} onClick={() => handleNavClick('logs')}>
|
|
374
370
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
375
371
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" />
|