@synergenius/flow-weaver-pack-weaver 0.9.62 → 0.9.78
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/dist/ai-chat-provider.d.ts +12 -0
- package/dist/ai-chat-provider.d.ts.map +1 -1
- package/dist/ai-chat-provider.js +173 -19
- package/dist/ai-chat-provider.js.map +1 -1
- package/dist/bot/agent-loop.d.ts +20 -0
- package/dist/bot/agent-loop.d.ts.map +1 -0
- package/dist/bot/agent-loop.js +331 -0
- package/dist/bot/agent-loop.js.map +1 -0
- package/dist/bot/ai-router.d.ts +19 -0
- package/dist/bot/ai-router.d.ts.map +1 -0
- package/dist/bot/ai-router.js +104 -0
- package/dist/bot/ai-router.js.map +1 -0
- package/dist/bot/bot-registry.js +2 -2
- package/dist/bot/bot-registry.js.map +1 -1
- package/dist/bot/conversation-store.d.ts +1 -0
- package/dist/bot/conversation-store.d.ts.map +1 -1
- package/dist/bot/conversation-store.js.map +1 -1
- package/dist/bot/improve-loop.js.map +1 -1
- package/dist/bot/instance-manager.d.ts +31 -0
- package/dist/bot/instance-manager.d.ts.map +1 -0
- package/dist/bot/instance-manager.js +115 -0
- package/dist/bot/instance-manager.js.map +1 -0
- package/dist/bot/orchestrator.d.ts +36 -0
- package/dist/bot/orchestrator.d.ts.map +1 -0
- package/dist/bot/orchestrator.js +176 -0
- package/dist/bot/orchestrator.js.map +1 -0
- package/dist/bot/profile-store.d.ts +36 -0
- package/dist/bot/profile-store.d.ts.map +1 -0
- package/dist/bot/profile-store.js +208 -0
- package/dist/bot/profile-store.js.map +1 -0
- package/dist/bot/profile-types.d.ts +126 -0
- package/dist/bot/profile-types.d.ts.map +1 -0
- package/dist/bot/profile-types.js +7 -0
- package/dist/bot/profile-types.js.map +1 -0
- package/dist/bot/session-state.d.ts +25 -0
- package/dist/bot/session-state.d.ts.map +1 -0
- package/dist/bot/session-state.js +110 -0
- package/dist/bot/session-state.js.map +1 -0
- package/dist/bot/swarm-controller.d.ts +37 -21
- package/dist/bot/swarm-controller.d.ts.map +1 -1
- package/dist/bot/swarm-controller.js +344 -163
- package/dist/bot/swarm-controller.js.map +1 -1
- package/dist/bot/task-prompt-builder.d.ts +2 -1
- package/dist/bot/task-prompt-builder.d.ts.map +1 -1
- package/dist/bot/task-prompt-builder.js +33 -10
- package/dist/bot/task-prompt-builder.js.map +1 -1
- package/dist/bot/task-queue.d.ts +46 -0
- package/dist/bot/task-queue.d.ts.map +1 -0
- package/dist/bot/task-queue.js +237 -0
- package/dist/bot/task-queue.js.map +1 -0
- package/dist/bot/task-store.d.ts +1 -6
- package/dist/bot/task-store.d.ts.map +1 -1
- package/dist/bot/task-store.js +27 -78
- package/dist/bot/task-store.js.map +1 -1
- package/dist/bot/task-types.d.ts +8 -4
- package/dist/bot/task-types.d.ts.map +1 -1
- package/dist/cli-handlers.d.ts.map +1 -1
- package/dist/cli-handlers.js +2 -3
- package/dist/cli-handlers.js.map +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +749 -0
- package/dist/cli.js.map +1 -0
- package/dist/docs/docs/weaver-bot-usage.md +35 -18
- package/dist/docs/docs/weaver-config.md +20 -0
- package/dist/docs/docs/weaver-task-queue.md +31 -19
- package/dist/docs/weaver-config.md +15 -9
- package/dist/mcp-tools.d.ts +17 -0
- package/dist/mcp-tools.d.ts.map +1 -1
- package/dist/mcp-tools.js +98 -232
- package/dist/mcp-tools.js.map +1 -1
- package/dist/node-types/orchestrator-dispatch.d.ts +17 -0
- package/dist/node-types/orchestrator-dispatch.d.ts.map +1 -0
- package/dist/node-types/orchestrator-dispatch.js +63 -0
- package/dist/node-types/orchestrator-dispatch.js.map +1 -0
- package/dist/node-types/orchestrator-load-state.d.ts +16 -0
- package/dist/node-types/orchestrator-load-state.d.ts.map +1 -0
- package/dist/node-types/orchestrator-load-state.js +60 -0
- package/dist/node-types/orchestrator-load-state.js.map +1 -0
- package/dist/node-types/orchestrator-route.d.ts +16 -0
- package/dist/node-types/orchestrator-route.d.ts.map +1 -0
- package/dist/node-types/orchestrator-route.js +28 -0
- package/dist/node-types/orchestrator-route.js.map +1 -0
- package/dist/node-types/receive-task.d.ts +2 -3
- package/dist/node-types/receive-task.d.ts.map +1 -1
- package/dist/node-types/receive-task.js +3 -28
- package/dist/node-types/receive-task.js.map +1 -1
- package/dist/templates/weaver-template.d.ts +11 -0
- package/dist/templates/weaver-template.d.ts.map +1 -0
- package/dist/templates/weaver-template.js +53 -0
- package/dist/templates/weaver-template.js.map +1 -0
- package/dist/ui/bot-constants.d.ts +14 -0
- package/dist/ui/bot-constants.d.ts.map +1 -0
- package/dist/ui/bot-constants.js +189 -0
- package/dist/ui/bot-constants.js.map +1 -0
- package/dist/ui/bot-panel.js +51 -90
- package/dist/ui/bot-slot-card.js +87 -122
- package/dist/ui/budget-bar.js +5 -3
- package/dist/ui/chat-task-result.js +4 -7
- package/dist/ui/decision-log.js +136 -0
- package/dist/ui/profile-card.js +158 -0
- package/dist/ui/profile-editor.js +597 -0
- package/dist/ui/swarm-controls.js +36 -27
- package/dist/ui/swarm-dashboard.js +2034 -736
- package/dist/ui/task-create-form.js +39 -116
- package/dist/ui/task-detail-view.js +490 -239
- package/dist/ui/task-pool-list.js +69 -94
- package/dist/workflows/orchestrator.d.ts +21 -0
- package/dist/workflows/orchestrator.d.ts.map +1 -0
- package/dist/workflows/orchestrator.js +281 -0
- package/dist/workflows/orchestrator.js.map +1 -0
- package/dist/workflows/weaver-bot-session.d.ts +65 -0
- package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
- package/dist/workflows/weaver-bot-session.js +68 -0
- package/dist/workflows/weaver-bot-session.js.map +1 -0
- package/dist/workflows/weaver.d.ts +24 -0
- package/dist/workflows/weaver.d.ts.map +1 -0
- package/dist/workflows/weaver.js +28 -0
- package/dist/workflows/weaver.js.map +1 -0
- package/flowweaver.manifest.json +253 -66
- package/package.json +1 -1
- package/src/ai-chat-provider.ts +184 -18
- package/src/bot/ai-router.ts +132 -0
- package/src/bot/bot-registry.ts +2 -2
- package/src/bot/conversation-store.ts +2 -1
- package/src/bot/improve-loop.ts +6 -6
- package/src/bot/instance-manager.ts +128 -0
- package/src/bot/orchestrator.ts +244 -0
- package/src/bot/profile-store.ts +225 -0
- package/src/bot/profile-types.ts +141 -0
- package/src/bot/swarm-controller.ts +385 -186
- package/src/bot/task-prompt-builder.ts +37 -6
- package/src/bot/task-store.ts +28 -89
- package/src/bot/task-types.ts +10 -4
- package/src/cli-handlers.ts +2 -3
- package/src/docs/weaver-bot-usage.md +35 -18
- package/src/docs/weaver-config.md +20 -0
- package/src/docs/weaver-task-queue.md +31 -19
- package/src/mcp-tools.ts +129 -320
- package/src/node-types/orchestrator-dispatch.ts +71 -0
- package/src/node-types/orchestrator-load-state.ts +66 -0
- package/src/node-types/orchestrator-route.ts +33 -0
- package/src/node-types/receive-task.ts +3 -26
- package/src/ui/bot-constants.ts +192 -0
- package/src/ui/bot-panel.tsx +55 -79
- package/src/ui/bot-slot-card.tsx +69 -117
- package/src/ui/budget-bar.tsx +5 -3
- package/src/ui/chat-task-result.tsx +6 -9
- package/src/ui/decision-log.tsx +148 -0
- package/src/ui/profile-card.tsx +157 -0
- package/src/ui/profile-editor.tsx +384 -0
- package/src/ui/swarm-controls.tsx +35 -31
- package/src/ui/swarm-dashboard.tsx +409 -80
- package/src/ui/task-create-form.tsx +29 -119
- package/src/ui/task-detail-view.tsx +461 -215
- package/src/ui/task-pool-list.tsx +74 -95
- package/src/workflows/orchestrator.ts +302 -0
- package/dist/docs/weaver-bot-usage.md +0 -34
- package/dist/docs/weaver-genesis.md +0 -32
- package/dist/docs/weaver-task-queue.md +0 -34
- package/src/bot/error-guide.ts +0 -4
- package/src/bot/retry-utils.ts +0 -4
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { WeaverEnv, WeaverContext } from '../bot/types.js';
|
|
2
|
-
import { TaskStore } from '../bot/task-store.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
* Receives a task
|
|
6
|
-
*
|
|
7
|
-
* WeaverContext that threads through the bot pipeline.
|
|
4
|
+
* Receives a pre-supplied task and creates the WeaverContext that
|
|
5
|
+
* threads through the bot pipeline.
|
|
8
6
|
*
|
|
9
7
|
* @flowWeaver nodeType
|
|
10
8
|
* @label Receive Task
|
|
@@ -28,7 +26,6 @@ export async function weaverReceiveTask(
|
|
|
28
26
|
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
// If taskJson is pre-supplied, use it directly
|
|
32
29
|
if (taskJson) {
|
|
33
30
|
try {
|
|
34
31
|
const parsed = JSON.parse(taskJson);
|
|
@@ -38,29 +35,9 @@ export async function weaverReceiveTask(
|
|
|
38
35
|
context.hasTask = true;
|
|
39
36
|
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
40
37
|
}
|
|
41
|
-
} catch { /*
|
|
38
|
+
} catch { /* invalid JSON — no task */ }
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
// Check task queue via TaskStore
|
|
45
|
-
try {
|
|
46
|
-
const store = new TaskStore(env.projectDir);
|
|
47
|
-
const claimed = await store.claimNext('weaver-bot');
|
|
48
|
-
|
|
49
|
-
if (claimed) {
|
|
50
|
-
const botTask = {
|
|
51
|
-
instruction: claimed.title,
|
|
52
|
-
mode: 'create',
|
|
53
|
-
targets: undefined as string[] | undefined,
|
|
54
|
-
options: undefined as Record<string, unknown> | undefined,
|
|
55
|
-
queueId: claimed.id,
|
|
56
|
-
};
|
|
57
|
-
console.log(`\x1b[36m→ Task from queue [${claimed.id}]: ${claimed.title.slice(0, 80)}\x1b[0m`);
|
|
58
|
-
context.taskJson = JSON.stringify(botTask);
|
|
59
|
-
context.hasTask = true;
|
|
60
|
-
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
61
|
-
}
|
|
62
|
-
} catch (err) { if (process.env.WEAVER_VERBOSE) console.error('[receive-task] queue error:', err); }
|
|
63
|
-
|
|
64
41
|
console.log('\x1b[33m→ No task found\x1b[0m');
|
|
65
42
|
return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
|
|
66
43
|
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for bot panel components: icon catalog, colors, helpers.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* ── Categorised icon catalog ──────────────────────────────────────── */
|
|
6
|
+
|
|
7
|
+
export const ICON_CATALOG: { category: string; icons: string[] }[] = [
|
|
8
|
+
{
|
|
9
|
+
category: 'Actions',
|
|
10
|
+
icons: [
|
|
11
|
+
'playArrow',
|
|
12
|
+
'stop',
|
|
13
|
+
'pause',
|
|
14
|
+
'restart',
|
|
15
|
+
'send',
|
|
16
|
+
'check',
|
|
17
|
+
'edit',
|
|
18
|
+
'copy',
|
|
19
|
+
'add',
|
|
20
|
+
'reset',
|
|
21
|
+
'resume',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
category: 'AI & Science',
|
|
26
|
+
icons: ['smartToy', 'psychology', 'autoAwesome', 'modelTraining', 'biotech', 'science', 'ai'],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
category: 'Data & Storage',
|
|
30
|
+
icons: ['database', 'dataObject', 'dataArray', 'tableChart', 'token', 'dns', 'cloudStorage'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
category: 'Logic & Flow',
|
|
34
|
+
icons: [
|
|
35
|
+
'altRoute',
|
|
36
|
+
'callSplit',
|
|
37
|
+
'callMerge',
|
|
38
|
+
'rule',
|
|
39
|
+
'filterAlt',
|
|
40
|
+
'sort',
|
|
41
|
+
'loop',
|
|
42
|
+
'repeat',
|
|
43
|
+
'compareArrows',
|
|
44
|
+
'swapHoriz',
|
|
45
|
+
'syncAlt',
|
|
46
|
+
'changeCircle',
|
|
47
|
+
'allInclusive',
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
category: 'Cloud & Network',
|
|
52
|
+
icons: [
|
|
53
|
+
'cloudSync',
|
|
54
|
+
'cloudUpload',
|
|
55
|
+
'cloudDownload',
|
|
56
|
+
'cloudDone',
|
|
57
|
+
'api',
|
|
58
|
+
'webhook',
|
|
59
|
+
'public',
|
|
60
|
+
'router',
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
category: 'Communication',
|
|
65
|
+
icons: ['email', 'chat', 'forum', 'notifications', 'campaign', 'rssFeed', 'sms'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
category: 'Security',
|
|
69
|
+
icons: [
|
|
70
|
+
'key',
|
|
71
|
+
'shield',
|
|
72
|
+
'security',
|
|
73
|
+
'vpnKey',
|
|
74
|
+
'adminPanel',
|
|
75
|
+
'policy',
|
|
76
|
+
'verified',
|
|
77
|
+
'lockClosed',
|
|
78
|
+
'lockOpened',
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
category: 'Time',
|
|
83
|
+
icons: [
|
|
84
|
+
'timer',
|
|
85
|
+
'alarm',
|
|
86
|
+
'hourglassEmpty',
|
|
87
|
+
'pendingActions',
|
|
88
|
+
'update',
|
|
89
|
+
'watchLater',
|
|
90
|
+
'scheduled',
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
category: 'Tasks & Workflow',
|
|
95
|
+
icons: [
|
|
96
|
+
'task',
|
|
97
|
+
'taskAlt',
|
|
98
|
+
'checklist',
|
|
99
|
+
'assignment',
|
|
100
|
+
'publish',
|
|
101
|
+
'build',
|
|
102
|
+
'construction',
|
|
103
|
+
'engineering',
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
category: 'Analytics',
|
|
108
|
+
icons: [
|
|
109
|
+
'analytics',
|
|
110
|
+
'insights',
|
|
111
|
+
'barChart',
|
|
112
|
+
'pieChart',
|
|
113
|
+
'trendingUp',
|
|
114
|
+
'showChart',
|
|
115
|
+
'leaderboard',
|
|
116
|
+
'monitoring',
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
category: 'Flow Nodes',
|
|
121
|
+
icons: [
|
|
122
|
+
'schema',
|
|
123
|
+
'hub',
|
|
124
|
+
'deviceHub',
|
|
125
|
+
'source',
|
|
126
|
+
'trigger',
|
|
127
|
+
'pulse',
|
|
128
|
+
'step',
|
|
129
|
+
'event',
|
|
130
|
+
'outlinedFlow',
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
category: 'Files & Documents',
|
|
135
|
+
icons: [
|
|
136
|
+
'file',
|
|
137
|
+
'filePresent',
|
|
138
|
+
'fileCopy',
|
|
139
|
+
'textSnippet',
|
|
140
|
+
'attachFile',
|
|
141
|
+
'uploadFile',
|
|
142
|
+
'save',
|
|
143
|
+
'upload',
|
|
144
|
+
'download',
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
category: 'General',
|
|
149
|
+
icons: [
|
|
150
|
+
'rocketLaunch',
|
|
151
|
+
'code',
|
|
152
|
+
'terminal',
|
|
153
|
+
'logs',
|
|
154
|
+
'info',
|
|
155
|
+
'help',
|
|
156
|
+
'list',
|
|
157
|
+
'category',
|
|
158
|
+
'hash',
|
|
159
|
+
'calendar',
|
|
160
|
+
'history',
|
|
161
|
+
'integration',
|
|
162
|
+
'layers',
|
|
163
|
+
'link',
|
|
164
|
+
'search',
|
|
165
|
+
'outlinedSettings',
|
|
166
|
+
'outlinedBug',
|
|
167
|
+
'collaboration',
|
|
168
|
+
'person',
|
|
169
|
+
'people',
|
|
170
|
+
'backup',
|
|
171
|
+
'healthAndSafety',
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
|
|
176
|
+
export const BOT_COLORS = [
|
|
177
|
+
{ label: 'Blue', token: 'color-node-blue-icon' },
|
|
178
|
+
{ label: 'Purple', token: 'color-node-purple-icon' },
|
|
179
|
+
{ label: 'Cyan', token: 'color-node-cyan-icon' },
|
|
180
|
+
{ label: 'Orange', token: 'color-node-orange-icon' },
|
|
181
|
+
{ label: 'Pink', token: 'color-node-pink-icon' },
|
|
182
|
+
{ label: 'Green', token: 'color-node-green-icon' },
|
|
183
|
+
{ label: 'Brand', token: 'color-brand-main' },
|
|
184
|
+
{ label: 'Accent', token: 'color-brand-alt' },
|
|
185
|
+
{ label: 'Positive', token: 'color-status-positive' },
|
|
186
|
+
{ label: 'Info', token: 'color-status-info' },
|
|
187
|
+
];
|
|
188
|
+
|
|
189
|
+
/** Convert camelCase icon name to searchable words: "cloudSync" -> "cloud sync" */
|
|
190
|
+
export function iconToWords(name: string): string {
|
|
191
|
+
return name.replace(/([A-Z])/g, ' $1').toLowerCase();
|
|
192
|
+
}
|
package/src/ui/bot-panel.tsx
CHANGED
|
@@ -14,27 +14,30 @@ const React = require('react');
|
|
|
14
14
|
const { useState, useEffect, useCallback, useRef } = React;
|
|
15
15
|
const {
|
|
16
16
|
Flex, Typography, Button, IconButton, Icon, EmptyState,
|
|
17
|
-
ScrollArea, usePackWorkspace,
|
|
17
|
+
ScrollArea, StatusIcon, usePackWorkspace,
|
|
18
18
|
} = require('@fw/plugin-ui-kit');
|
|
19
19
|
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Types
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
|
|
24
|
-
interface
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
interface InstanceInfo {
|
|
25
|
+
instanceId: string;
|
|
26
|
+
profileId: string;
|
|
27
|
+
index: number;
|
|
27
28
|
status: 'idle' | 'executing' | 'paused' | 'stopped';
|
|
28
29
|
currentTaskId?: string;
|
|
29
30
|
currentRunId?: string;
|
|
30
31
|
startedAt?: string;
|
|
31
32
|
tokensUsed: number;
|
|
32
33
|
cost: number;
|
|
34
|
+
tasksCompleted: number;
|
|
35
|
+
tasksFailed: number;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
interface SwarmStatus {
|
|
36
39
|
status: 'idle' | 'running' | 'paused' | 'stopping';
|
|
37
|
-
|
|
40
|
+
instances: Record<string, InstanceInfo>;
|
|
38
41
|
maxConcurrent: number;
|
|
39
42
|
tasksCompleted: number;
|
|
40
43
|
tasksFailed: number;
|
|
@@ -54,12 +57,12 @@ function parseToolResult(raw: unknown): unknown {
|
|
|
54
57
|
return raw;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
function
|
|
60
|
+
function statusToIconStatus(status: string): 'pending' | 'running' | 'completed' | 'failed' {
|
|
58
61
|
switch (status) {
|
|
59
|
-
case 'executing': case 'running': return '
|
|
60
|
-
case 'paused': return '
|
|
61
|
-
case 'stopped': case 'stopping': return '
|
|
62
|
-
default: return '
|
|
62
|
+
case 'executing': case 'running': return 'running';
|
|
63
|
+
case 'paused': return 'pending';
|
|
64
|
+
case 'stopped': case 'stopping': return 'failed';
|
|
65
|
+
default: return 'completed';
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
|
|
@@ -139,10 +142,10 @@ function BotPanel() {
|
|
|
139
142
|
type: 'custom',
|
|
140
143
|
title: 'Swarm Dashboard',
|
|
141
144
|
icon: 'dashboard',
|
|
142
|
-
contentType: 'workspace',
|
|
145
|
+
contentType: 'bot-workspace',
|
|
143
146
|
displayState: 'docked',
|
|
144
147
|
dockZone: 'center',
|
|
145
|
-
definitionId: 'workspace',
|
|
148
|
+
definitionId: 'bot-workspace',
|
|
146
149
|
size: { width: 1000, height: 700 },
|
|
147
150
|
singleton: true,
|
|
148
151
|
data: { packId },
|
|
@@ -153,23 +156,17 @@ function BotPanel() {
|
|
|
153
156
|
|
|
154
157
|
// Header
|
|
155
158
|
const header = React.createElement(Flex, {
|
|
156
|
-
variant: 'row-center-between-nowrap-8',
|
|
159
|
+
variant: 'row-center-space-between-nowrap-8',
|
|
157
160
|
style: { padding: '8px 12px', borderBottom: '1px solid var(--color-border-default)', flexShrink: 0 },
|
|
158
161
|
},
|
|
159
162
|
React.createElement(Flex, { variant: 'row-center-start-nowrap-6' },
|
|
160
163
|
React.createElement(Icon, { name: 'smartToy', size: 16, color: 'color-text-medium' }),
|
|
161
164
|
React.createElement(Typography, { variant: 'caption-thick', color: 'color-text-high' }, 'Swarm'),
|
|
162
165
|
),
|
|
163
|
-
React.createElement(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}),
|
|
168
|
-
React.createElement(IconButton, {
|
|
169
|
-
icon: 'dashboard', size: 'xs', variant: 'clear',
|
|
170
|
-
onClick: handleOpenDashboard, title: 'Open Dashboard',
|
|
171
|
-
}),
|
|
172
|
-
),
|
|
166
|
+
React.createElement(IconButton, {
|
|
167
|
+
icon: 'reset', size: 'xs', variant: 'clear',
|
|
168
|
+
onClick: fetchStatus, title: 'Refresh',
|
|
169
|
+
}),
|
|
173
170
|
);
|
|
174
171
|
|
|
175
172
|
// Loading state
|
|
@@ -181,7 +178,7 @@ function BotPanel() {
|
|
|
181
178
|
header,
|
|
182
179
|
React.createElement(Flex, {
|
|
183
180
|
variant: 'column-center-center-nowrap-8',
|
|
184
|
-
style: { flex: 1
|
|
181
|
+
style: { flex: 1 },
|
|
185
182
|
},
|
|
186
183
|
React.createElement(Typography, { variant: 'caption-regular', color: 'color-text-subtle' }, 'Loading swarm status...'),
|
|
187
184
|
),
|
|
@@ -197,9 +194,9 @@ function BotPanel() {
|
|
|
197
194
|
header,
|
|
198
195
|
React.createElement(Flex, {
|
|
199
196
|
variant: 'column-center-center-nowrap-8',
|
|
200
|
-
style: { flex: 1
|
|
197
|
+
style: { flex: 1 },
|
|
201
198
|
},
|
|
202
|
-
React.createElement(Typography, { variant: 'caption-regular', color: 'color-
|
|
199
|
+
React.createElement(Typography, { variant: 'caption-regular', color: 'color-status-negative' }, error),
|
|
203
200
|
React.createElement(Button, { size: 'xs', variant: 'outlined', onClick: fetchStatus }, 'Retry'),
|
|
204
201
|
),
|
|
205
202
|
);
|
|
@@ -207,20 +204,16 @@ function BotPanel() {
|
|
|
207
204
|
|
|
208
205
|
// Swarm status indicator
|
|
209
206
|
const swarmStatus = swarm?.status ?? 'idle';
|
|
210
|
-
const statusDot = React.createElement('div', {
|
|
211
|
-
style: {
|
|
212
|
-
width: 8, height: 8, borderRadius: '50%',
|
|
213
|
-
backgroundColor: statusColor(swarmStatus),
|
|
214
|
-
flexShrink: 0,
|
|
215
|
-
},
|
|
216
|
-
});
|
|
217
207
|
|
|
218
208
|
const statusRow = React.createElement(Flex, {
|
|
219
|
-
variant: 'row-center-between-nowrap-8',
|
|
209
|
+
variant: 'row-center-space-between-nowrap-8',
|
|
220
210
|
style: { padding: '8px 12px', borderBottom: '1px solid var(--color-border-default)' },
|
|
221
211
|
},
|
|
222
212
|
React.createElement(Flex, { variant: 'row-center-start-nowrap-6' },
|
|
223
|
-
|
|
213
|
+
React.createElement(StatusIcon, {
|
|
214
|
+
status: statusToIconStatus(swarmStatus),
|
|
215
|
+
size: 'sm',
|
|
216
|
+
}),
|
|
224
217
|
React.createElement(Typography, { variant: 'caption-thick', color: 'color-text-high' },
|
|
225
218
|
statusLabel(swarmStatus),
|
|
226
219
|
),
|
|
@@ -233,12 +226,8 @@ function BotPanel() {
|
|
|
233
226
|
|
|
234
227
|
// Quick stats
|
|
235
228
|
const statsRow = React.createElement(Flex, {
|
|
236
|
-
variant: 'row-center-between-nowrap-8',
|
|
237
|
-
style: {
|
|
238
|
-
padding: '8px 12px',
|
|
239
|
-
borderBottom: '1px solid var(--color-border-default)',
|
|
240
|
-
backgroundColor: 'var(--color-surface-low)',
|
|
241
|
-
},
|
|
229
|
+
variant: 'row-center-space-between-nowrap-8',
|
|
230
|
+
style: { padding: '8px 12px', borderBottom: '1px solid var(--color-border-default)', backgroundColor: 'var(--color-surface-low)' },
|
|
242
231
|
},
|
|
243
232
|
React.createElement(Flex, { variant: 'column-center-center-nowrap-1' },
|
|
244
233
|
React.createElement(Typography, { variant: 'smallCaption-thick', color: 'color-text-high' },
|
|
@@ -267,33 +256,22 @@ function BotPanel() {
|
|
|
267
256
|
);
|
|
268
257
|
|
|
269
258
|
// Bot list
|
|
270
|
-
const
|
|
271
|
-
const hasBots =
|
|
272
|
-
|
|
273
|
-
const botCards = botEntries.map((bot: BotSlotInfo) => {
|
|
274
|
-
const botDot = React.createElement('div', {
|
|
275
|
-
style: {
|
|
276
|
-
width: 6, height: 6, borderRadius: '50%',
|
|
277
|
-
backgroundColor: statusColor(bot.status),
|
|
278
|
-
flexShrink: 0,
|
|
279
|
-
},
|
|
280
|
-
});
|
|
259
|
+
const instanceEntries = Object.values(swarm?.instances ?? {}) as InstanceInfo[];
|
|
260
|
+
const hasBots = instanceEntries.length > 0;
|
|
281
261
|
|
|
282
|
-
|
|
283
|
-
|
|
262
|
+
const botCards = instanceEntries.map((inst: InstanceInfo) =>
|
|
263
|
+
React.createElement(Flex, {
|
|
264
|
+
key: inst.instanceId,
|
|
284
265
|
variant: 'row-center-start-nowrap-8',
|
|
285
|
-
style: {
|
|
286
|
-
padding: '6px 8px',
|
|
287
|
-
borderRadius: 'var(--border-radius-secondary)',
|
|
288
|
-
border: '1px solid var(--color-border-default)',
|
|
289
|
-
},
|
|
266
|
+
style: { padding: '8px', borderRadius: 'var(--border-radius-regular)', border: '1px solid var(--color-border-default)' },
|
|
290
267
|
},
|
|
291
268
|
// Bot icon
|
|
292
|
-
React.createElement(
|
|
269
|
+
React.createElement(Flex, {
|
|
270
|
+
variant: 'row-center-center-nowrap-0',
|
|
293
271
|
style: {
|
|
294
272
|
width: 26, height: 26,
|
|
295
273
|
borderRadius: 'var(--border-radius-compact)',
|
|
296
|
-
|
|
274
|
+
flexShrink: 0,
|
|
297
275
|
background: 'var(--color-surface-low)',
|
|
298
276
|
},
|
|
299
277
|
},
|
|
@@ -308,48 +286,46 @@ function BotPanel() {
|
|
|
308
286
|
React.createElement(Flex, { variant: 'row-center-start-nowrap-4' },
|
|
309
287
|
React.createElement(Typography, {
|
|
310
288
|
variant: 'caption-thick', color: 'color-text-high',
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
289
|
+
}, `${inst.profileId} #${inst.index}`),
|
|
290
|
+
React.createElement(StatusIcon, {
|
|
291
|
+
status: statusToIconStatus(inst.status),
|
|
292
|
+
size: 'sm',
|
|
293
|
+
}),
|
|
314
294
|
React.createElement(Typography, {
|
|
315
295
|
variant: 'smallCaption-regular', color: 'color-text-subtle',
|
|
316
|
-
}, statusLabel(
|
|
296
|
+
}, statusLabel(inst.status)),
|
|
317
297
|
),
|
|
318
|
-
|
|
298
|
+
inst.currentTaskId ? React.createElement(Typography, {
|
|
319
299
|
variant: 'smallCaption-regular', color: 'color-text-medium',
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap',
|
|
323
|
-
maxWidth: '100%',
|
|
324
|
-
},
|
|
325
|
-
}, `Task: ${bot.currentTaskId}`) : null,
|
|
300
|
+
truncate: true,
|
|
301
|
+
}, `Task: ${inst.currentTaskId}`) : null,
|
|
326
302
|
),
|
|
327
303
|
|
|
328
|
-
// Per-
|
|
304
|
+
// Per-instance stats
|
|
329
305
|
React.createElement(Flex, {
|
|
330
306
|
variant: 'column-end-end-nowrap-1',
|
|
331
307
|
style: { flexShrink: 0 },
|
|
332
308
|
},
|
|
333
309
|
React.createElement(Typography, { variant: 'smallCaption-regular', color: 'color-text-subtle' },
|
|
334
|
-
formatTokens(
|
|
310
|
+
formatTokens(inst.tokensUsed),
|
|
335
311
|
),
|
|
336
312
|
React.createElement(Typography, { variant: 'smallCaption-regular', color: 'color-text-subtle' },
|
|
337
|
-
formatCost(
|
|
313
|
+
formatCost(inst.cost),
|
|
338
314
|
),
|
|
339
315
|
),
|
|
340
|
-
)
|
|
341
|
-
|
|
316
|
+
),
|
|
317
|
+
);
|
|
342
318
|
|
|
343
319
|
const content = hasBots
|
|
344
320
|
? React.createElement(ScrollArea, { style: { flex: 1 } },
|
|
345
321
|
React.createElement(Flex, {
|
|
346
|
-
variant: 'column-stretch-start-nowrap-
|
|
322
|
+
variant: 'column-stretch-start-nowrap-6',
|
|
347
323
|
style: { padding: '8px 12px' },
|
|
348
324
|
}, ...botCards),
|
|
349
325
|
)
|
|
350
326
|
: React.createElement(Flex, {
|
|
351
327
|
variant: 'column-center-center-nowrap-0',
|
|
352
|
-
style: { flex: 1
|
|
328
|
+
style: { flex: 1 },
|
|
353
329
|
},
|
|
354
330
|
React.createElement(EmptyState, {
|
|
355
331
|
icon: 'smartToy',
|