@synergenius/flow-weaver-pack-weaver 0.9.199 → 0.9.201
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.js +5 -5
- package/dist/ai-chat-provider.js.map +1 -1
- package/dist/bot/acceptance-merge.d.ts +21 -0
- package/dist/bot/acceptance-merge.d.ts.map +1 -0
- package/dist/bot/acceptance-merge.js +46 -0
- package/dist/bot/acceptance-merge.js.map +1 -0
- package/dist/bot/ai-client.d.ts +14 -2
- package/dist/bot/ai-client.d.ts.map +1 -1
- package/dist/bot/ai-client.js +71 -24
- package/dist/bot/ai-client.js.map +1 -1
- package/dist/bot/assistant-tools.js +3 -3
- package/dist/bot/assistant-tools.js.map +1 -1
- package/dist/bot/audit-logger.d.ts.map +1 -1
- package/dist/bot/audit-logger.js +34 -14
- package/dist/bot/audit-logger.js.map +1 -1
- package/dist/bot/audit-trail.d.ts +67 -0
- package/dist/bot/audit-trail.d.ts.map +1 -0
- package/dist/bot/audit-trail.js +153 -0
- package/dist/bot/audit-trail.js.map +1 -0
- package/dist/bot/behavior-defaults.d.ts +1 -1
- package/dist/bot/behavior-defaults.d.ts.map +1 -1
- package/dist/bot/behavior-defaults.js +7 -3
- package/dist/bot/behavior-defaults.js.map +1 -1
- package/dist/bot/capability-registry.d.ts +9 -0
- package/dist/bot/capability-registry.d.ts.map +1 -1
- package/dist/bot/capability-registry.js +81 -27
- package/dist/bot/capability-registry.js.map +1 -1
- package/dist/bot/capability-types.d.ts +10 -0
- package/dist/bot/capability-types.d.ts.map +1 -1
- package/dist/bot/cli-provider.d.ts.map +1 -1
- package/dist/bot/cli-provider.js +8 -7
- package/dist/bot/cli-provider.js.map +1 -1
- package/dist/bot/preflight.d.ts +48 -0
- package/dist/bot/preflight.d.ts.map +1 -0
- package/dist/bot/preflight.js +247 -0
- package/dist/bot/preflight.js.map +1 -0
- package/dist/bot/provider-shim.d.ts +74 -0
- package/dist/bot/provider-shim.d.ts.map +1 -0
- package/dist/bot/provider-shim.js +176 -0
- package/dist/bot/provider-shim.js.map +1 -0
- package/dist/bot/runner.d.ts +2 -0
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +60 -17
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/step-executor.d.ts.map +1 -1
- package/dist/bot/step-executor.js +72 -115
- package/dist/bot/step-executor.js.map +1 -1
- package/dist/bot/swarm-controller.d.ts +2 -0
- package/dist/bot/swarm-controller.d.ts.map +1 -1
- package/dist/bot/swarm-controller.js +92 -20
- package/dist/bot/swarm-controller.js.map +1 -1
- package/dist/bot/task-create-handler.d.ts +37 -0
- package/dist/bot/task-create-handler.d.ts.map +1 -0
- package/dist/bot/task-create-handler.js +124 -0
- package/dist/bot/task-create-handler.js.map +1 -0
- package/dist/bot/task-store.d.ts +1 -0
- package/dist/bot/task-store.d.ts.map +1 -1
- package/dist/bot/task-store.js +67 -0
- package/dist/bot/task-store.js.map +1 -1
- package/dist/bot/types.d.ts +1 -1
- package/dist/bot/types.d.ts.map +1 -1
- package/dist/bot/weaver-tools.d.ts.map +1 -1
- package/dist/bot/weaver-tools.js +7 -39
- package/dist/bot/weaver-tools.js.map +1 -1
- package/dist/node-types/agent-execute.d.ts +25 -8
- package/dist/node-types/agent-execute.d.ts.map +1 -1
- package/dist/node-types/agent-execute.js +89 -23
- package/dist/node-types/agent-execute.js.map +1 -1
- package/dist/node-types/bot-report.d.ts.map +1 -1
- package/dist/node-types/bot-report.js +24 -3
- package/dist/node-types/bot-report.js.map +1 -1
- package/dist/node-types/plan-task.d.ts +8 -17
- package/dist/node-types/plan-task.d.ts.map +1 -1
- package/dist/node-types/plan-task.js +217 -256
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/node-types/review-result.js +8 -6
- package/dist/node-types/review-result.js.map +1 -1
- package/dist/palindrome.d.ts +9 -0
- package/dist/palindrome.d.ts.map +1 -0
- package/dist/palindrome.js +14 -0
- package/dist/palindrome.js.map +1 -0
- package/dist/ui/approval-card.js +91 -82
- package/dist/ui/bot-activity.js +73 -56
- package/dist/ui/bot-config.js +48 -31
- package/dist/ui/bot-dashboard.js +52 -36
- package/dist/ui/bot-panel.js +230 -228
- package/dist/ui/bot-slot-card.js +100 -90
- package/dist/ui/bot-status.js +37 -15
- package/dist/ui/budget-bar.js +57 -31
- package/dist/ui/capability-editor.js +447 -378
- package/dist/ui/chat-task-result.js +78 -71
- package/dist/ui/decision-log.js +68 -81
- package/dist/ui/genesis-block.js +86 -95
- package/dist/ui/instance-stream-view.js +722 -0
- package/dist/ui/profile-card.js +96 -221
- package/dist/ui/profile-editor.js +532 -575
- package/dist/ui/settings-section.js +41 -45
- package/dist/ui/swarm-controls.js +212 -135
- package/dist/ui/swarm-dashboard.js +3992 -2715
- package/dist/ui/task-detail-view.js +415 -521
- package/dist/ui/task-editor.js +339 -390
- package/dist/ui/task-pool-list.js +60 -55
- package/dist/workflows/src/palindrome.d.ts +11 -0
- package/dist/workflows/src/palindrome.d.ts.map +1 -0
- package/dist/workflows/src/palindrome.js +16 -0
- package/dist/workflows/src/palindrome.js.map +1 -0
- package/dist/workflows/tests/palindrome.test.d.ts +2 -0
- package/dist/workflows/tests/palindrome.test.d.ts.map +1 -0
- package/dist/workflows/tests/palindrome.test.js +41 -0
- package/dist/workflows/tests/palindrome.test.js.map +1 -0
- package/dist/workflows/weaver-bot-batch.js +1 -1
- package/dist/workflows/weaver-bot-batch.js.map +1 -1
- package/dist/workflows/weaver-bot.js +1 -1
- package/dist/workflows/weaver-bot.js.map +1 -1
- package/flowweaver.manifest.json +1 -1
- package/package.json +8 -2
- package/src/ai-chat-provider.ts +5 -5
- package/src/bot/acceptance-merge.ts +62 -0
- package/src/bot/ai-client.ts +77 -21
- package/src/bot/assistant-tools.ts +3 -3
- package/src/bot/audit-logger.ts +42 -14
- package/src/bot/audit-trail.ts +211 -0
- package/src/bot/behavior-defaults.ts +7 -2
- package/src/bot/capability-registry.ts +84 -28
- package/src/bot/capability-types.ts +11 -0
- package/src/bot/cli-provider.ts +8 -7
- package/src/bot/preflight.ts +285 -0
- package/src/bot/provider-shim.ts +218 -0
- package/src/bot/runner.ts +68 -20
- package/src/bot/step-executor.ts +69 -127
- package/src/bot/swarm-controller.ts +94 -20
- package/src/bot/task-create-handler.ts +164 -0
- package/src/bot/task-store.ts +83 -0
- package/src/bot/types.ts +4 -1
- package/src/bot/weaver-tools.ts +7 -45
- package/src/node-types/agent-execute.ts +102 -16
- package/src/node-types/bot-report.ts +24 -3
- package/src/node-types/plan-task.ts +238 -280
- package/src/node-types/review-result.ts +8 -6
- package/src/palindrome.ts +14 -0
- package/src/ui/approval-card.tsx +78 -62
- package/src/ui/bot-activity.tsx +12 -10
- package/src/ui/bot-config.tsx +12 -10
- package/src/ui/bot-dashboard.tsx +13 -11
- package/src/ui/bot-panel.tsx +189 -171
- package/src/ui/bot-slot-card.tsx +125 -70
- package/src/ui/bot-status.tsx +4 -4
- package/src/ui/budget-bar.tsx +86 -25
- package/src/ui/capability-editor.tsx +392 -257
- package/src/ui/chat-task-result.tsx +81 -78
- package/src/ui/decision-log.tsx +76 -73
- package/src/ui/genesis-block.tsx +91 -61
- package/src/ui/instance-stream-view.tsx +861 -0
- package/src/ui/profile-card.tsx +195 -168
- package/src/ui/profile-editor.tsx +453 -370
- package/src/ui/settings-section.tsx +46 -39
- package/src/ui/swarm-controls.tsx +252 -123
- package/src/ui/swarm-dashboard.tsx +999 -466
- package/src/ui/task-detail-view.tsx +485 -428
- package/src/ui/task-editor.tsx +329 -271
- package/src/ui/task-pool-list.tsx +68 -62
- package/src/workflows/src/palindrome.ts +16 -0
- package/src/workflows/tests/palindrome.test.ts +49 -0
- package/src/workflows/weaver-bot-batch.ts +1 -1
- package/src/workflows/weaver-bot.ts +1 -1
- package/dist/ui/bot-constants.d.ts +0 -14
- package/dist/ui/bot-constants.d.ts.map +0 -1
- package/dist/ui/bot-constants.js +0 -189
- package/dist/ui/bot-constants.js.map +0 -1
- package/dist/ui/steer-api.d.ts +0 -7
- package/dist/ui/steer-api.d.ts.map +0 -1
- package/dist/ui/steer-api.js +0 -11
- package/dist/ui/steer-api.js.map +0 -1
- package/dist/ui/trace-to-timeline.d.ts +0 -91
- package/dist/ui/trace-to-timeline.d.ts.map +0 -1
- package/dist/ui/trace-to-timeline.js +0 -116
- package/dist/ui/trace-to-timeline.js.map +0 -1
- package/dist/ui/use-stream-timeline.d.ts +0 -50
- package/dist/ui/use-stream-timeline.d.ts.map +0 -1
- package/dist/ui/use-stream-timeline.js +0 -245
- package/dist/ui/use-stream-timeline.js.map +0 -1
package/dist/ui/bot-panel.js
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2
19
|
|
|
3
20
|
// src/ui/bot-panel.tsx
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ScrollArea,
|
|
14
|
-
StatusIcon,
|
|
15
|
-
usePackWorkspace
|
|
16
|
-
} = require("@fw/plugin-ui-kit");
|
|
21
|
+
var bot_panel_exports = {};
|
|
22
|
+
__export(bot_panel_exports, {
|
|
23
|
+
BotPanel: () => BotPanel,
|
|
24
|
+
default: () => bot_panel_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(bot_panel_exports);
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
var import_plugin_ui_kit = require("@fw/plugin-ui-kit");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
17
30
|
function parseToolResult(raw) {
|
|
18
31
|
if (typeof raw === "string") {
|
|
19
32
|
try {
|
|
@@ -64,20 +77,20 @@ function formatCost(n) {
|
|
|
64
77
|
}
|
|
65
78
|
var POLL_INTERVAL_MS = 5e3;
|
|
66
79
|
function BotPanel() {
|
|
67
|
-
const ctx = usePackWorkspace();
|
|
80
|
+
const ctx = (0, import_plugin_ui_kit.usePackWorkspace)();
|
|
68
81
|
const { callTool } = ctx;
|
|
69
82
|
const packId = ctx.packId;
|
|
70
|
-
const [swarm, setSwarm] = useState(null);
|
|
71
|
-
const [loading, setLoading] = useState(true);
|
|
72
|
-
const [error, setError] = useState(null);
|
|
73
|
-
const mountedRef = useRef(true);
|
|
74
|
-
useEffect(() => {
|
|
83
|
+
const [swarm, setSwarm] = (0, import_react.useState)(null);
|
|
84
|
+
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
85
|
+
const [error, setError] = (0, import_react.useState)(null);
|
|
86
|
+
const mountedRef = (0, import_react.useRef)(true);
|
|
87
|
+
(0, import_react.useEffect)(() => {
|
|
75
88
|
mountedRef.current = true;
|
|
76
89
|
return () => {
|
|
77
90
|
mountedRef.current = false;
|
|
78
91
|
};
|
|
79
92
|
}, []);
|
|
80
|
-
const fetchStatus = useCallback(async () => {
|
|
93
|
+
const fetchStatus = (0, import_react.useCallback)(async () => {
|
|
81
94
|
try {
|
|
82
95
|
setError(null);
|
|
83
96
|
const raw = await callTool("fw_weaver_swarm_status", {});
|
|
@@ -92,12 +105,12 @@ function BotPanel() {
|
|
|
92
105
|
if (mountedRef.current) setLoading(false);
|
|
93
106
|
}
|
|
94
107
|
}, [callTool]);
|
|
95
|
-
useEffect(() => {
|
|
108
|
+
(0, import_react.useEffect)(() => {
|
|
96
109
|
fetchStatus();
|
|
97
110
|
const timer = setInterval(fetchStatus, POLL_INTERVAL_MS);
|
|
98
111
|
return () => clearInterval(timer);
|
|
99
112
|
}, [fetchStatus]);
|
|
100
|
-
const handleOpenDashboard = useCallback(() => {
|
|
113
|
+
const handleOpenDashboard = (0, import_react.useCallback)(() => {
|
|
101
114
|
ctx.openWindow({
|
|
102
115
|
type: "custom",
|
|
103
116
|
title: "Weaver",
|
|
@@ -111,240 +124,229 @@ function BotPanel() {
|
|
|
111
124
|
data: { packId }
|
|
112
125
|
});
|
|
113
126
|
}, [ctx, packId]);
|
|
114
|
-
const header =
|
|
115
|
-
Flex,
|
|
127
|
+
const header = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
128
|
+
import_plugin_ui_kit.Flex,
|
|
116
129
|
{
|
|
117
130
|
variant: "row-center-space-between-nowrap-8",
|
|
118
|
-
style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)", flexShrink: 0 }
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)", flexShrink: 0 },
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-6", children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Icon, { name: "smartToy", size: 16, color: "color-text-medium" }),
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-thick", color: "color-text-high", children: "Weaver" })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
import_plugin_ui_kit.IconButton,
|
|
139
|
+
{
|
|
140
|
+
icon: "reset",
|
|
141
|
+
size: "xs",
|
|
142
|
+
variant: "clear",
|
|
143
|
+
onClick: fetchStatus,
|
|
144
|
+
title: "Refresh"
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
]
|
|
148
|
+
}
|
|
133
149
|
);
|
|
134
150
|
if (loading) {
|
|
135
|
-
return
|
|
136
|
-
Flex,
|
|
151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
152
|
+
import_plugin_ui_kit.Flex,
|
|
137
153
|
{
|
|
138
154
|
variant: "column-stretch-start-nowrap-0",
|
|
139
|
-
style: { width: "100%", height: "100%" }
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
155
|
+
style: { width: "100%", height: "100%" },
|
|
156
|
+
children: [
|
|
157
|
+
header,
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
159
|
+
import_plugin_ui_kit.Flex,
|
|
160
|
+
{
|
|
161
|
+
variant: "column-center-center-nowrap-8",
|
|
162
|
+
style: { flex: 1 },
|
|
163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-regular", color: "color-text-subtle", children: "Loading swarm status..." })
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
]
|
|
167
|
+
}
|
|
150
168
|
);
|
|
151
169
|
}
|
|
152
170
|
if (error) {
|
|
153
|
-
return
|
|
154
|
-
Flex,
|
|
171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
172
|
+
import_plugin_ui_kit.Flex,
|
|
155
173
|
{
|
|
156
174
|
variant: "column-stretch-start-nowrap-0",
|
|
157
|
-
style: { width: "100%", height: "100%" }
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
style: { width: "100%", height: "100%" },
|
|
176
|
+
children: [
|
|
177
|
+
header,
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
179
|
+
import_plugin_ui_kit.Flex,
|
|
180
|
+
{
|
|
181
|
+
variant: "column-center-center-nowrap-8",
|
|
182
|
+
style: { flex: 1 },
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-regular", color: "color-status-negative", children: error }),
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Button, { size: "xs", variant: "outlined", onClick: fetchStatus, children: "Retry" })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
169
191
|
);
|
|
170
192
|
}
|
|
171
193
|
const swarmStatus = swarm?.status ?? "idle";
|
|
172
|
-
const statusRow =
|
|
173
|
-
Flex,
|
|
194
|
+
const statusRow = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
195
|
+
import_plugin_ui_kit.Flex,
|
|
174
196
|
{
|
|
175
197
|
variant: "row-center-space-between-nowrap-8",
|
|
176
|
-
style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)" }
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)" },
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-6", children: [
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
202
|
+
import_plugin_ui_kit.StatusIcon,
|
|
203
|
+
{
|
|
204
|
+
status: statusToIconStatus(swarmStatus),
|
|
205
|
+
size: "sm"
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-thick", color: "color-text-high", children: statusLabel(swarmStatus) })
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
211
|
+
import_plugin_ui_kit.Button,
|
|
212
|
+
{
|
|
213
|
+
size: "xs",
|
|
214
|
+
variant: "outlined",
|
|
215
|
+
color: "primary",
|
|
216
|
+
onClick: handleOpenDashboard,
|
|
217
|
+
children: "Open Dashboard"
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
]
|
|
221
|
+
}
|
|
197
222
|
);
|
|
198
|
-
const statsRow =
|
|
199
|
-
Flex,
|
|
223
|
+
const statsRow = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
224
|
+
import_plugin_ui_kit.Flex,
|
|
200
225
|
{
|
|
201
226
|
variant: "row-center-space-between-nowrap-8",
|
|
202
|
-
style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)", backgroundColor: "var(--color-surface-low)" }
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Failed")
|
|
223
|
-
),
|
|
224
|
-
React.createElement(
|
|
225
|
-
Flex,
|
|
226
|
-
{ variant: "column-center-center-nowrap-1" },
|
|
227
|
-
React.createElement(
|
|
228
|
-
Typography,
|
|
229
|
-
{ variant: "smallCaption-thick", color: "color-text-high" },
|
|
230
|
-
formatTokens(swarm?.totalTokensUsed ?? 0)
|
|
231
|
-
),
|
|
232
|
-
React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Tokens")
|
|
233
|
-
),
|
|
234
|
-
React.createElement(
|
|
235
|
-
Flex,
|
|
236
|
-
{ variant: "column-center-center-nowrap-1" },
|
|
237
|
-
React.createElement(
|
|
238
|
-
Typography,
|
|
239
|
-
{ variant: "smallCaption-thick", color: "color-text-high" },
|
|
240
|
-
formatCost(swarm?.totalCost ?? 0)
|
|
241
|
-
),
|
|
242
|
-
React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Cost")
|
|
243
|
-
)
|
|
227
|
+
style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)", backgroundColor: "var(--color-surface-low)" },
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-center-center-nowrap-1", children: [
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-thick", color: "color-text-high", children: String(swarm?.tasksCompleted ?? 0) }),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: "Done" })
|
|
232
|
+
] }),
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-center-center-nowrap-1", children: [
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-thick", color: "color-text-high", children: String(swarm?.runsIncomplete ?? 0) }),
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: "Failed" })
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-center-center-nowrap-1", children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-thick", color: "color-text-high", children: formatTokens(swarm?.totalTokensUsed ?? 0) }),
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: "Tokens" })
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-center-center-nowrap-1", children: [
|
|
242
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-thick", color: "color-text-high", children: formatCost(swarm?.totalCost ?? 0) }),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: "Cost" })
|
|
244
|
+
] })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
244
247
|
);
|
|
245
248
|
const instanceEntries = Object.values(swarm?.instances ?? {});
|
|
246
249
|
const hasBots = instanceEntries.length > 0;
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
// Bot icon
|
|
256
|
-
React.createElement(
|
|
257
|
-
Flex,
|
|
258
|
-
{
|
|
259
|
-
variant: "row-center-center-nowrap-0",
|
|
260
|
-
style: {
|
|
261
|
-
width: 26,
|
|
262
|
-
height: 26,
|
|
263
|
-
borderRadius: "var(--border-radius-compact)",
|
|
264
|
-
flexShrink: 0,
|
|
265
|
-
background: "var(--color-surface-low)"
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
React.createElement(Icon, { name: "smartToy", size: 14, color: "color-text-medium" })
|
|
269
|
-
),
|
|
270
|
-
// Name + status + task
|
|
271
|
-
React.createElement(
|
|
272
|
-
Flex,
|
|
273
|
-
{
|
|
274
|
-
variant: "column-start-start-nowrap-1",
|
|
275
|
-
style: { flex: 1, minWidth: 0 }
|
|
276
|
-
},
|
|
277
|
-
React.createElement(
|
|
278
|
-
Flex,
|
|
279
|
-
{ variant: "row-center-start-nowrap-4" },
|
|
280
|
-
React.createElement(Typography, {
|
|
281
|
-
variant: "caption-thick",
|
|
282
|
-
color: "color-text-high"
|
|
283
|
-
}, inst.profileId ? `${inst.instanceId} (${inst.profileId})` : inst.instanceId),
|
|
284
|
-
React.createElement(StatusIcon, {
|
|
285
|
-
status: statusToIconStatus(inst.status),
|
|
286
|
-
size: "sm"
|
|
287
|
-
}),
|
|
288
|
-
React.createElement(Typography, {
|
|
289
|
-
variant: "smallCaption-regular",
|
|
290
|
-
color: "color-text-subtle"
|
|
291
|
-
}, statusLabel(inst.status))
|
|
292
|
-
),
|
|
293
|
-
inst.currentTaskId ? React.createElement(Typography, {
|
|
294
|
-
variant: "smallCaption-regular",
|
|
295
|
-
color: "color-text-medium",
|
|
296
|
-
truncate: true
|
|
297
|
-
}, `Task: ${inst.currentTaskId}`) : null
|
|
298
|
-
),
|
|
299
|
-
// Per-instance stats
|
|
300
|
-
React.createElement(
|
|
301
|
-
Flex,
|
|
250
|
+
const content = hasBots ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.ScrollArea, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
251
|
+
import_plugin_ui_kit.Flex,
|
|
252
|
+
{
|
|
253
|
+
variant: "column-stretch-start-nowrap-6",
|
|
254
|
+
style: { padding: "8px 12px" },
|
|
255
|
+
children: instanceEntries.map((inst) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
256
|
+
import_plugin_ui_kit.Flex,
|
|
302
257
|
{
|
|
303
|
-
variant: "
|
|
304
|
-
style: {
|
|
258
|
+
variant: "row-center-start-nowrap-8",
|
|
259
|
+
style: { padding: "8px", borderRadius: "var(--border-radius-regular)", border: "1px solid var(--color-border-default)" },
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
262
|
+
import_plugin_ui_kit.Flex,
|
|
263
|
+
{
|
|
264
|
+
variant: "row-center-center-nowrap-0",
|
|
265
|
+
style: {
|
|
266
|
+
width: 26,
|
|
267
|
+
height: 26,
|
|
268
|
+
borderRadius: "var(--border-radius-compact)",
|
|
269
|
+
flexShrink: 0,
|
|
270
|
+
background: "var(--color-surface-low)"
|
|
271
|
+
},
|
|
272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Icon, { name: "smartToy", size: 14, color: "color-text-medium" })
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
276
|
+
import_plugin_ui_kit.Flex,
|
|
277
|
+
{
|
|
278
|
+
variant: "column-start-start-nowrap-1",
|
|
279
|
+
style: { flex: 1, minWidth: 0 },
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-4", children: [
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-thick", color: "color-text-high", children: inst.profileId ? `${inst.instanceId} (${inst.profileId})` : inst.instanceId }),
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
284
|
+
import_plugin_ui_kit.StatusIcon,
|
|
285
|
+
{
|
|
286
|
+
status: statusToIconStatus(inst.status),
|
|
287
|
+
size: "sm"
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: statusLabel(inst.status) })
|
|
291
|
+
] }),
|
|
292
|
+
inst.currentTaskId && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
293
|
+
import_plugin_ui_kit.Typography,
|
|
294
|
+
{
|
|
295
|
+
variant: "smallCaption-regular",
|
|
296
|
+
color: "color-text-medium",
|
|
297
|
+
truncate: true,
|
|
298
|
+
children: [
|
|
299
|
+
"Task: ",
|
|
300
|
+
inst.currentTaskId
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
308
|
+
import_plugin_ui_kit.Flex,
|
|
309
|
+
{
|
|
310
|
+
variant: "column-end-end-nowrap-1",
|
|
311
|
+
style: { flexShrink: 0 },
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: formatTokens(inst.tokensUsed) }),
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: formatCost(inst.cost) })
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
]
|
|
305
319
|
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
React.createElement(
|
|
312
|
-
Typography,
|
|
313
|
-
{ variant: "smallCaption-regular", color: "color-text-subtle" },
|
|
314
|
-
formatCost(inst.cost)
|
|
315
|
-
)
|
|
316
|
-
)
|
|
317
|
-
)
|
|
318
|
-
);
|
|
319
|
-
const content = hasBots ? React.createElement(
|
|
320
|
-
ScrollArea,
|
|
321
|
-
{ style: { flex: 1 } },
|
|
322
|
-
React.createElement(Flex, {
|
|
323
|
-
variant: "column-stretch-start-nowrap-6",
|
|
324
|
-
style: { padding: "8px 12px" }
|
|
325
|
-
}, ...botCards)
|
|
326
|
-
) : React.createElement(
|
|
327
|
-
Flex,
|
|
320
|
+
inst.instanceId
|
|
321
|
+
))
|
|
322
|
+
}
|
|
323
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
324
|
+
import_plugin_ui_kit.Flex,
|
|
328
325
|
{
|
|
329
326
|
variant: "column-center-center-nowrap-0",
|
|
330
|
-
style: { flex: 1 }
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
327
|
+
style: { flex: 1 },
|
|
328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
329
|
+
import_plugin_ui_kit.EmptyState,
|
|
330
|
+
{
|
|
331
|
+
icon: "smartToy",
|
|
332
|
+
message: swarmStatus === "idle" ? "Idle" : "No instances active",
|
|
333
|
+
description: "Open the dashboard to configure and start the swarm."
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
}
|
|
337
337
|
);
|
|
338
|
-
return
|
|
339
|
-
Flex,
|
|
338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
339
|
+
import_plugin_ui_kit.Flex,
|
|
340
340
|
{
|
|
341
341
|
variant: "column-stretch-start-nowrap-0",
|
|
342
|
-
style: { width: "100%", height: "100%", overflow: "hidden" }
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
342
|
+
style: { width: "100%", height: "100%", overflow: "hidden" },
|
|
343
|
+
children: [
|
|
344
|
+
header,
|
|
345
|
+
statusRow,
|
|
346
|
+
statsRow,
|
|
347
|
+
content
|
|
348
|
+
]
|
|
349
|
+
}
|
|
348
350
|
);
|
|
349
351
|
}
|
|
350
|
-
|
|
352
|
+
var bot_panel_default = BotPanel;
|