@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.
Files changed (181) hide show
  1. package/dist/ai-chat-provider.js +5 -5
  2. package/dist/ai-chat-provider.js.map +1 -1
  3. package/dist/bot/acceptance-merge.d.ts +21 -0
  4. package/dist/bot/acceptance-merge.d.ts.map +1 -0
  5. package/dist/bot/acceptance-merge.js +46 -0
  6. package/dist/bot/acceptance-merge.js.map +1 -0
  7. package/dist/bot/ai-client.d.ts +14 -2
  8. package/dist/bot/ai-client.d.ts.map +1 -1
  9. package/dist/bot/ai-client.js +71 -24
  10. package/dist/bot/ai-client.js.map +1 -1
  11. package/dist/bot/assistant-tools.js +3 -3
  12. package/dist/bot/assistant-tools.js.map +1 -1
  13. package/dist/bot/audit-logger.d.ts.map +1 -1
  14. package/dist/bot/audit-logger.js +34 -14
  15. package/dist/bot/audit-logger.js.map +1 -1
  16. package/dist/bot/audit-trail.d.ts +67 -0
  17. package/dist/bot/audit-trail.d.ts.map +1 -0
  18. package/dist/bot/audit-trail.js +153 -0
  19. package/dist/bot/audit-trail.js.map +1 -0
  20. package/dist/bot/behavior-defaults.d.ts +1 -1
  21. package/dist/bot/behavior-defaults.d.ts.map +1 -1
  22. package/dist/bot/behavior-defaults.js +7 -3
  23. package/dist/bot/behavior-defaults.js.map +1 -1
  24. package/dist/bot/capability-registry.d.ts +9 -0
  25. package/dist/bot/capability-registry.d.ts.map +1 -1
  26. package/dist/bot/capability-registry.js +81 -27
  27. package/dist/bot/capability-registry.js.map +1 -1
  28. package/dist/bot/capability-types.d.ts +10 -0
  29. package/dist/bot/capability-types.d.ts.map +1 -1
  30. package/dist/bot/cli-provider.d.ts.map +1 -1
  31. package/dist/bot/cli-provider.js +8 -7
  32. package/dist/bot/cli-provider.js.map +1 -1
  33. package/dist/bot/preflight.d.ts +48 -0
  34. package/dist/bot/preflight.d.ts.map +1 -0
  35. package/dist/bot/preflight.js +247 -0
  36. package/dist/bot/preflight.js.map +1 -0
  37. package/dist/bot/provider-shim.d.ts +74 -0
  38. package/dist/bot/provider-shim.d.ts.map +1 -0
  39. package/dist/bot/provider-shim.js +176 -0
  40. package/dist/bot/provider-shim.js.map +1 -0
  41. package/dist/bot/runner.d.ts +2 -0
  42. package/dist/bot/runner.d.ts.map +1 -1
  43. package/dist/bot/runner.js +60 -17
  44. package/dist/bot/runner.js.map +1 -1
  45. package/dist/bot/step-executor.d.ts.map +1 -1
  46. package/dist/bot/step-executor.js +72 -115
  47. package/dist/bot/step-executor.js.map +1 -1
  48. package/dist/bot/swarm-controller.d.ts +2 -0
  49. package/dist/bot/swarm-controller.d.ts.map +1 -1
  50. package/dist/bot/swarm-controller.js +92 -20
  51. package/dist/bot/swarm-controller.js.map +1 -1
  52. package/dist/bot/task-create-handler.d.ts +37 -0
  53. package/dist/bot/task-create-handler.d.ts.map +1 -0
  54. package/dist/bot/task-create-handler.js +124 -0
  55. package/dist/bot/task-create-handler.js.map +1 -0
  56. package/dist/bot/task-store.d.ts +1 -0
  57. package/dist/bot/task-store.d.ts.map +1 -1
  58. package/dist/bot/task-store.js +67 -0
  59. package/dist/bot/task-store.js.map +1 -1
  60. package/dist/bot/types.d.ts +1 -1
  61. package/dist/bot/types.d.ts.map +1 -1
  62. package/dist/bot/weaver-tools.d.ts.map +1 -1
  63. package/dist/bot/weaver-tools.js +7 -39
  64. package/dist/bot/weaver-tools.js.map +1 -1
  65. package/dist/node-types/agent-execute.d.ts +25 -8
  66. package/dist/node-types/agent-execute.d.ts.map +1 -1
  67. package/dist/node-types/agent-execute.js +89 -23
  68. package/dist/node-types/agent-execute.js.map +1 -1
  69. package/dist/node-types/bot-report.d.ts.map +1 -1
  70. package/dist/node-types/bot-report.js +24 -3
  71. package/dist/node-types/bot-report.js.map +1 -1
  72. package/dist/node-types/plan-task.d.ts +8 -17
  73. package/dist/node-types/plan-task.d.ts.map +1 -1
  74. package/dist/node-types/plan-task.js +217 -256
  75. package/dist/node-types/plan-task.js.map +1 -1
  76. package/dist/node-types/review-result.js +8 -6
  77. package/dist/node-types/review-result.js.map +1 -1
  78. package/dist/palindrome.d.ts +9 -0
  79. package/dist/palindrome.d.ts.map +1 -0
  80. package/dist/palindrome.js +14 -0
  81. package/dist/palindrome.js.map +1 -0
  82. package/dist/ui/approval-card.js +91 -82
  83. package/dist/ui/bot-activity.js +73 -56
  84. package/dist/ui/bot-config.js +48 -31
  85. package/dist/ui/bot-dashboard.js +52 -36
  86. package/dist/ui/bot-panel.js +230 -228
  87. package/dist/ui/bot-slot-card.js +100 -90
  88. package/dist/ui/bot-status.js +37 -15
  89. package/dist/ui/budget-bar.js +57 -31
  90. package/dist/ui/capability-editor.js +447 -378
  91. package/dist/ui/chat-task-result.js +78 -71
  92. package/dist/ui/decision-log.js +68 -81
  93. package/dist/ui/genesis-block.js +86 -95
  94. package/dist/ui/instance-stream-view.js +722 -0
  95. package/dist/ui/profile-card.js +96 -221
  96. package/dist/ui/profile-editor.js +532 -575
  97. package/dist/ui/settings-section.js +41 -45
  98. package/dist/ui/swarm-controls.js +212 -135
  99. package/dist/ui/swarm-dashboard.js +3992 -2715
  100. package/dist/ui/task-detail-view.js +415 -521
  101. package/dist/ui/task-editor.js +339 -390
  102. package/dist/ui/task-pool-list.js +60 -55
  103. package/dist/workflows/src/palindrome.d.ts +11 -0
  104. package/dist/workflows/src/palindrome.d.ts.map +1 -0
  105. package/dist/workflows/src/palindrome.js +16 -0
  106. package/dist/workflows/src/palindrome.js.map +1 -0
  107. package/dist/workflows/tests/palindrome.test.d.ts +2 -0
  108. package/dist/workflows/tests/palindrome.test.d.ts.map +1 -0
  109. package/dist/workflows/tests/palindrome.test.js +41 -0
  110. package/dist/workflows/tests/palindrome.test.js.map +1 -0
  111. package/dist/workflows/weaver-bot-batch.js +1 -1
  112. package/dist/workflows/weaver-bot-batch.js.map +1 -1
  113. package/dist/workflows/weaver-bot.js +1 -1
  114. package/dist/workflows/weaver-bot.js.map +1 -1
  115. package/flowweaver.manifest.json +1 -1
  116. package/package.json +8 -2
  117. package/src/ai-chat-provider.ts +5 -5
  118. package/src/bot/acceptance-merge.ts +62 -0
  119. package/src/bot/ai-client.ts +77 -21
  120. package/src/bot/assistant-tools.ts +3 -3
  121. package/src/bot/audit-logger.ts +42 -14
  122. package/src/bot/audit-trail.ts +211 -0
  123. package/src/bot/behavior-defaults.ts +7 -2
  124. package/src/bot/capability-registry.ts +84 -28
  125. package/src/bot/capability-types.ts +11 -0
  126. package/src/bot/cli-provider.ts +8 -7
  127. package/src/bot/preflight.ts +285 -0
  128. package/src/bot/provider-shim.ts +218 -0
  129. package/src/bot/runner.ts +68 -20
  130. package/src/bot/step-executor.ts +69 -127
  131. package/src/bot/swarm-controller.ts +94 -20
  132. package/src/bot/task-create-handler.ts +164 -0
  133. package/src/bot/task-store.ts +83 -0
  134. package/src/bot/types.ts +4 -1
  135. package/src/bot/weaver-tools.ts +7 -45
  136. package/src/node-types/agent-execute.ts +102 -16
  137. package/src/node-types/bot-report.ts +24 -3
  138. package/src/node-types/plan-task.ts +238 -280
  139. package/src/node-types/review-result.ts +8 -6
  140. package/src/palindrome.ts +14 -0
  141. package/src/ui/approval-card.tsx +78 -62
  142. package/src/ui/bot-activity.tsx +12 -10
  143. package/src/ui/bot-config.tsx +12 -10
  144. package/src/ui/bot-dashboard.tsx +13 -11
  145. package/src/ui/bot-panel.tsx +189 -171
  146. package/src/ui/bot-slot-card.tsx +125 -70
  147. package/src/ui/bot-status.tsx +4 -4
  148. package/src/ui/budget-bar.tsx +86 -25
  149. package/src/ui/capability-editor.tsx +392 -257
  150. package/src/ui/chat-task-result.tsx +81 -78
  151. package/src/ui/decision-log.tsx +76 -73
  152. package/src/ui/genesis-block.tsx +91 -61
  153. package/src/ui/instance-stream-view.tsx +861 -0
  154. package/src/ui/profile-card.tsx +195 -168
  155. package/src/ui/profile-editor.tsx +453 -370
  156. package/src/ui/settings-section.tsx +46 -39
  157. package/src/ui/swarm-controls.tsx +252 -123
  158. package/src/ui/swarm-dashboard.tsx +999 -466
  159. package/src/ui/task-detail-view.tsx +485 -428
  160. package/src/ui/task-editor.tsx +329 -271
  161. package/src/ui/task-pool-list.tsx +68 -62
  162. package/src/workflows/src/palindrome.ts +16 -0
  163. package/src/workflows/tests/palindrome.test.ts +49 -0
  164. package/src/workflows/weaver-bot-batch.ts +1 -1
  165. package/src/workflows/weaver-bot.ts +1 -1
  166. package/dist/ui/bot-constants.d.ts +0 -14
  167. package/dist/ui/bot-constants.d.ts.map +0 -1
  168. package/dist/ui/bot-constants.js +0 -189
  169. package/dist/ui/bot-constants.js.map +0 -1
  170. package/dist/ui/steer-api.d.ts +0 -7
  171. package/dist/ui/steer-api.d.ts.map +0 -1
  172. package/dist/ui/steer-api.js +0 -11
  173. package/dist/ui/steer-api.js.map +0 -1
  174. package/dist/ui/trace-to-timeline.d.ts +0 -91
  175. package/dist/ui/trace-to-timeline.d.ts.map +0 -1
  176. package/dist/ui/trace-to-timeline.js +0 -116
  177. package/dist/ui/trace-to-timeline.js.map +0 -1
  178. package/dist/ui/use-stream-timeline.d.ts +0 -50
  179. package/dist/ui/use-stream-timeline.d.ts.map +0 -1
  180. package/dist/ui/use-stream-timeline.js +0 -245
  181. package/dist/ui/use-stream-timeline.js.map +0 -1
@@ -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 React = require("react");
5
- var { useState, useEffect, useCallback, useRef } = React;
6
- var {
7
- Flex,
8
- Typography,
9
- Button,
10
- IconButton,
11
- Icon,
12
- EmptyState,
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 = React.createElement(
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
- React.createElement(
121
- Flex,
122
- { variant: "row-center-start-nowrap-6" },
123
- React.createElement(Icon, { name: "smartToy", size: 16, color: "color-text-medium" }),
124
- React.createElement(Typography, { variant: "caption-thick", color: "color-text-high" }, "Weaver")
125
- ),
126
- React.createElement(IconButton, {
127
- icon: "reset",
128
- size: "xs",
129
- variant: "clear",
130
- onClick: fetchStatus,
131
- title: "Refresh"
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 React.createElement(
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
- header,
142
- React.createElement(
143
- Flex,
144
- {
145
- variant: "column-center-center-nowrap-8",
146
- style: { flex: 1 }
147
- },
148
- React.createElement(Typography, { variant: "caption-regular", color: "color-text-subtle" }, "Loading swarm status...")
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 React.createElement(
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
- header,
160
- React.createElement(
161
- Flex,
162
- {
163
- variant: "column-center-center-nowrap-8",
164
- style: { flex: 1 }
165
- },
166
- React.createElement(Typography, { variant: "caption-regular", color: "color-status-negative" }, error),
167
- React.createElement(Button, { size: "xs", variant: "outlined", onClick: fetchStatus }, "Retry")
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 = React.createElement(
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
- React.createElement(
179
- Flex,
180
- { variant: "row-center-start-nowrap-6" },
181
- React.createElement(StatusIcon, {
182
- status: statusToIconStatus(swarmStatus),
183
- size: "sm"
184
- }),
185
- React.createElement(
186
- Typography,
187
- { variant: "caption-thick", color: "color-text-high" },
188
- statusLabel(swarmStatus)
189
- )
190
- ),
191
- React.createElement(Button, {
192
- size: "xs",
193
- variant: "outlined",
194
- color: "primary",
195
- onClick: handleOpenDashboard
196
- }, "Open Dashboard")
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 = React.createElement(
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
- React.createElement(
205
- Flex,
206
- { variant: "column-center-center-nowrap-1" },
207
- React.createElement(
208
- Typography,
209
- { variant: "smallCaption-thick", color: "color-text-high" },
210
- String(swarm?.tasksCompleted ?? 0)
211
- ),
212
- React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Done")
213
- ),
214
- React.createElement(
215
- Flex,
216
- { variant: "column-center-center-nowrap-1" },
217
- React.createElement(
218
- Typography,
219
- { variant: "smallCaption-thick", color: "color-text-high" },
220
- String(swarm?.runsIncomplete ?? 0)
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 botCards = instanceEntries.map(
248
- (inst) => React.createElement(
249
- Flex,
250
- {
251
- key: inst.instanceId,
252
- variant: "row-center-start-nowrap-8",
253
- style: { padding: "8px", borderRadius: "var(--border-radius-regular)", border: "1px solid var(--color-border-default)" }
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: "column-end-end-nowrap-1",
304
- style: { flexShrink: 0 }
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
- React.createElement(
307
- Typography,
308
- { variant: "smallCaption-regular", color: "color-text-subtle" },
309
- formatTokens(inst.tokensUsed)
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
- React.createElement(EmptyState, {
333
- icon: "smartToy",
334
- message: swarmStatus === "idle" ? "Idle" : "No instances active",
335
- description: "Open the dashboard to configure and start the swarm."
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 React.createElement(
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
- header,
345
- statusRow,
346
- statsRow,
347
- content
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
- module.exports = BotPanel;
352
+ var bot_panel_default = BotPanel;