@swarmclawai/swarmclaw 0.6.3 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/package.json +5 -1
- package/src/app/api/chatrooms/[id]/chat/route.ts +41 -2
- package/src/app/api/chatrooms/[id]/route.ts +15 -1
- package/src/app/api/chatrooms/route.ts +15 -2
- package/src/app/api/schedules/[id]/run/route.ts +3 -0
- package/src/app/api/tasks/route.ts +24 -0
- package/src/app/api/wallets/[id]/approve/route.ts +62 -0
- package/src/app/api/wallets/[id]/balance-history/route.ts +18 -0
- package/src/app/api/wallets/[id]/route.ts +118 -0
- package/src/app/api/wallets/[id]/send/route.ts +118 -0
- package/src/app/api/wallets/[id]/transactions/route.ts +18 -0
- package/src/app/api/wallets/route.ts +74 -0
- package/src/app/globals.css +8 -0
- package/src/app/page.tsx +7 -3
- package/src/cli/index.js +15 -0
- package/src/cli/spec.js +14 -0
- package/src/components/agents/agent-avatar.tsx +15 -1
- package/src/components/agents/agent-card.tsx +1 -0
- package/src/components/agents/agent-chat-list.tsx +1 -1
- package/src/components/agents/agent-sheet.tsx +112 -26
- package/src/components/auth/access-key-gate.tsx +22 -11
- package/src/components/chat/chat-area.tsx +2 -2
- package/src/components/chat/chat-header.tsx +48 -19
- package/src/components/chat/chat-tool-toggles.tsx +1 -1
- package/src/components/chat/delegation-banner.test.ts +27 -0
- package/src/components/chat/delegation-banner.tsx +109 -23
- package/src/components/chat/message-bubble.tsx +14 -3
- package/src/components/chat/message-list.tsx +5 -4
- package/src/components/chat/streaming-bubble.tsx +3 -2
- package/src/components/chat/thinking-indicator.tsx +3 -2
- package/src/components/chat/tool-call-bubble.test.ts +28 -0
- package/src/components/chat/tool-call-bubble.tsx +13 -1
- package/src/components/chat/transfer-agent-picker.tsx +1 -1
- package/src/components/chatrooms/agent-hover-card.tsx +1 -1
- package/src/components/chatrooms/chatroom-input.tsx +7 -6
- package/src/components/chatrooms/chatroom-message.tsx +1 -1
- package/src/components/chatrooms/chatroom-sheet.tsx +1 -1
- package/src/components/chatrooms/chatroom-typing-bar.tsx +1 -1
- package/src/components/chatrooms/chatroom-view.tsx +1 -1
- package/src/components/connectors/connector-list.tsx +1 -1
- package/src/components/home/home-view.tsx +2 -1
- package/src/components/input/chat-input.tsx +5 -4
- package/src/components/knowledge/knowledge-list.tsx +1 -1
- package/src/components/knowledge/knowledge-sheet.tsx +1 -1
- package/src/components/layout/app-layout.tsx +23 -9
- package/src/components/logs/log-list.tsx +7 -7
- package/src/components/memory/memory-agent-list.tsx +1 -1
- package/src/components/memory/memory-browser.tsx +1 -0
- package/src/components/memory/memory-card.tsx +3 -2
- package/src/components/memory/memory-detail.tsx +3 -3
- package/src/components/memory/memory-sheet.tsx +2 -2
- package/src/components/projects/project-detail.tsx +4 -4
- package/src/components/secrets/secret-sheet.tsx +1 -1
- package/src/components/secrets/secrets-list.tsx +1 -1
- package/src/components/sessions/new-session-sheet.tsx +4 -3
- package/src/components/sessions/session-card.tsx +1 -1
- package/src/components/shared/agent-picker-list.tsx +1 -1
- package/src/components/shared/agent-switch-dialog.tsx +1 -1
- package/src/components/shared/settings/section-user-preferences.tsx +4 -4
- package/src/components/skills/skill-list.tsx +1 -1
- package/src/components/skills/skill-sheet.tsx +1 -1
- package/src/components/tasks/task-board.tsx +3 -3
- package/src/components/tasks/task-sheet.tsx +21 -1
- package/src/components/wallets/wallet-approval-dialog.tsx +99 -0
- package/src/components/wallets/wallet-panel.tsx +616 -0
- package/src/components/wallets/wallet-section.tsx +100 -0
- package/src/hooks/use-media-query.ts +30 -4
- package/src/lib/api-client.ts +6 -18
- package/src/lib/fetch-timeout.ts +17 -0
- package/src/lib/notification-sounds.ts +4 -4
- package/src/lib/safe-storage.ts +42 -0
- package/src/lib/server/agent-registry.ts +2 -2
- package/src/lib/server/chat-execution.ts +35 -3
- package/src/lib/server/chatroom-health.ts +60 -0
- package/src/lib/server/chatroom-helpers.test.ts +94 -0
- package/src/lib/server/chatroom-helpers.ts +64 -11
- package/src/lib/server/connectors/inbound-audio-transcription.test.ts +191 -0
- package/src/lib/server/connectors/inbound-audio-transcription.ts +261 -0
- package/src/lib/server/connectors/manager.ts +80 -2
- package/src/lib/server/connectors/whatsapp-text.test.ts +29 -0
- package/src/lib/server/connectors/whatsapp-text.ts +26 -0
- package/src/lib/server/connectors/whatsapp.ts +8 -5
- package/src/lib/server/orchestrator-lg.ts +12 -2
- package/src/lib/server/orchestrator.ts +6 -1
- package/src/lib/server/queue-followups.test.ts +224 -0
- package/src/lib/server/queue.ts +226 -24
- package/src/lib/server/scheduler.ts +3 -0
- package/src/lib/server/session-tools/chatroom.ts +11 -2
- package/src/lib/server/session-tools/context-mgmt.ts +2 -2
- package/src/lib/server/session-tools/index.ts +6 -2
- package/src/lib/server/session-tools/memory.ts +1 -1
- package/src/lib/server/session-tools/shell.ts +1 -1
- package/src/lib/server/session-tools/wallet.ts +124 -0
- package/src/lib/server/session-tools/web-output.test.ts +29 -0
- package/src/lib/server/session-tools/web-output.ts +16 -0
- package/src/lib/server/session-tools/web.ts +7 -3
- package/src/lib/server/solana.ts +122 -0
- package/src/lib/server/storage.ts +38 -0
- package/src/lib/server/stream-agent-chat.ts +126 -63
- package/src/lib/server/task-mention.test.ts +41 -0
- package/src/lib/server/task-mention.ts +3 -2
- package/src/lib/tool-definitions.ts +1 -0
- package/src/lib/view-routes.ts +6 -1
- package/src/stores/use-app-store.ts +17 -11
- package/src/types/index.ts +60 -1
|
@@ -244,7 +244,7 @@ export function TaskSheet() {
|
|
|
244
244
|
<div className="mb-8">
|
|
245
245
|
<SectionLabel>Agent</SectionLabel>
|
|
246
246
|
<div className="flex items-center gap-2.5 px-4 py-3 rounded-[14px] border border-white/[0.06] bg-surface">
|
|
247
|
-
<AgentAvatar seed={taskAgent.avatarSeed || null} name={taskAgent.name} size={24} />
|
|
247
|
+
<AgentAvatar seed={taskAgent.avatarSeed || null} avatarUrl={taskAgent.avatarUrl} name={taskAgent.name} size={24} />
|
|
248
248
|
<span className="text-[14px] font-600 text-text">{taskAgent.name}</span>
|
|
249
249
|
</div>
|
|
250
250
|
</div>
|
|
@@ -366,6 +366,26 @@ export function TaskSheet() {
|
|
|
366
366
|
</div>
|
|
367
367
|
)}
|
|
368
368
|
|
|
369
|
+
{Array.isArray(editing.outputFiles) && editing.outputFiles.length > 0 && (
|
|
370
|
+
<div className="mb-8">
|
|
371
|
+
<SectionLabel>Output Files</SectionLabel>
|
|
372
|
+
<div className="flex flex-col gap-1.5">
|
|
373
|
+
{editing.outputFiles.map((fileRef) => (
|
|
374
|
+
<code key={fileRef} className="text-[12px] text-text-3 font-mono break-all">
|
|
375
|
+
{fileRef}
|
|
376
|
+
</code>
|
|
377
|
+
))}
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
)}
|
|
381
|
+
|
|
382
|
+
{editing.completionReportPath && (
|
|
383
|
+
<div className="mb-8">
|
|
384
|
+
<SectionLabel>Task Report</SectionLabel>
|
|
385
|
+
<code className="text-[12px] text-text-3 font-mono break-all">{editing.completionReportPath}</code>
|
|
386
|
+
</div>
|
|
387
|
+
)}
|
|
388
|
+
|
|
369
389
|
{/* CLI Sessions */}
|
|
370
390
|
{(editing.claudeResumeId || editing.codexResumeId || editing.opencodeResumeId || editing.cliResumeId) && (
|
|
371
391
|
<div className="mb-8">
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState, useCallback } from 'react'
|
|
4
|
+
import { api } from '@/lib/api-client'
|
|
5
|
+
import type { WalletTransaction } from '@/types'
|
|
6
|
+
|
|
7
|
+
interface WalletApprovalDialogProps {
|
|
8
|
+
transaction: WalletTransaction
|
|
9
|
+
walletAddress: string
|
|
10
|
+
onClose: () => void
|
|
11
|
+
onResolved: () => void
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function WalletApprovalDialog({ transaction, walletAddress, onClose, onResolved }: WalletApprovalDialogProps) {
|
|
15
|
+
const [submitting, setSubmitting] = useState(false)
|
|
16
|
+
const [error, setError] = useState<string | null>(null)
|
|
17
|
+
|
|
18
|
+
const handleDecision = useCallback(async (decision: 'approve' | 'deny') => {
|
|
19
|
+
setSubmitting(true)
|
|
20
|
+
setError(null)
|
|
21
|
+
try {
|
|
22
|
+
await api('POST', `/wallets/${transaction.walletId}/approve`, {
|
|
23
|
+
transactionId: transaction.id,
|
|
24
|
+
decision,
|
|
25
|
+
})
|
|
26
|
+
onResolved()
|
|
27
|
+
onClose()
|
|
28
|
+
} catch (err: unknown) {
|
|
29
|
+
setError(err instanceof Error ? err.message : String(err))
|
|
30
|
+
} finally {
|
|
31
|
+
setSubmitting(false)
|
|
32
|
+
}
|
|
33
|
+
}, [transaction, onResolved, onClose])
|
|
34
|
+
|
|
35
|
+
const amountSol = transaction.amountLamports / 1e9
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
|
39
|
+
<div className="absolute inset-0 bg-black/60 backdrop-blur-sm" onClick={onClose} />
|
|
40
|
+
<div className="relative w-full max-w-md rounded-[16px] border border-white/[0.08] bg-surface-1 shadow-2xl p-6 space-y-5">
|
|
41
|
+
<div className="flex items-center gap-2">
|
|
42
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="text-amber-400">
|
|
43
|
+
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
|
|
44
|
+
<line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12.01" y2="17" />
|
|
45
|
+
</svg>
|
|
46
|
+
<h3 className="font-display text-[15px] font-600 text-text-1">Transaction Approval</h3>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div className="p-4 rounded-[12px] bg-black/20 border border-white/[0.06] space-y-3">
|
|
50
|
+
<div className="flex items-center justify-between">
|
|
51
|
+
<span className="text-[11px] text-text-3/70 uppercase tracking-wide">Amount</span>
|
|
52
|
+
<span className="text-[16px] font-600 text-text-1">{amountSol.toFixed(4)} SOL</span>
|
|
53
|
+
</div>
|
|
54
|
+
<div>
|
|
55
|
+
<span className="text-[11px] text-text-3/70 uppercase tracking-wide block mb-1">From</span>
|
|
56
|
+
<code className="text-[10px] text-text-3 font-mono break-all">{walletAddress}</code>
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
<span className="text-[11px] text-text-3/70 uppercase tracking-wide block mb-1">To</span>
|
|
60
|
+
<code className="text-[10px] text-text-3 font-mono break-all">{transaction.toAddress}</code>
|
|
61
|
+
</div>
|
|
62
|
+
{transaction.memo && (
|
|
63
|
+
<div>
|
|
64
|
+
<span className="text-[11px] text-text-3/70 uppercase tracking-wide block mb-1">Reason</span>
|
|
65
|
+
<p className="text-[12px] text-text-2">{transaction.memo}</p>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<p className="text-[11px] text-amber-400/80">
|
|
71
|
+
Crypto transactions are irreversible. Verify the recipient address carefully.
|
|
72
|
+
</p>
|
|
73
|
+
|
|
74
|
+
{error && <p className="text-[11px] text-red-400">{error}</p>}
|
|
75
|
+
|
|
76
|
+
<div className="flex gap-3">
|
|
77
|
+
<button
|
|
78
|
+
type="button"
|
|
79
|
+
onClick={() => handleDecision('deny')}
|
|
80
|
+
disabled={submitting}
|
|
81
|
+
className="flex-1 px-4 py-2.5 rounded-[10px] border border-white/[0.08] bg-surface text-text-3 text-[12px] font-600 hover:text-red-400 hover:border-red-400/30 transition-colors cursor-pointer disabled:opacity-50"
|
|
82
|
+
style={{ fontFamily: 'inherit' }}
|
|
83
|
+
>
|
|
84
|
+
Deny
|
|
85
|
+
</button>
|
|
86
|
+
<button
|
|
87
|
+
type="button"
|
|
88
|
+
onClick={() => handleDecision('approve')}
|
|
89
|
+
disabled={submitting}
|
|
90
|
+
className="flex-1 px-4 py-2.5 rounded-[10px] bg-accent text-white text-[12px] font-600 hover:brightness-110 transition-all cursor-pointer disabled:opacity-50"
|
|
91
|
+
style={{ fontFamily: 'inherit' }}
|
|
92
|
+
>
|
|
93
|
+
{submitting ? 'Processing...' : 'Approve & Send'}
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
)
|
|
99
|
+
}
|