@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
package/dist/ui/bot-slot-card.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/ui/bot-slot-card.tsx
|
|
@@ -24,20 +34,8 @@ __export(bot_slot_card_exports, {
|
|
|
24
34
|
default: () => bot_slot_card_default
|
|
25
35
|
});
|
|
26
36
|
module.exports = __toCommonJS(bot_slot_card_exports);
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var statusToDot = {
|
|
30
|
-
idle: "neutral",
|
|
31
|
-
executing: "info",
|
|
32
|
-
paused: "caution",
|
|
33
|
-
stopped: "negative"
|
|
34
|
-
};
|
|
35
|
-
var statusToIcon = {
|
|
36
|
-
idle: "pending",
|
|
37
|
-
executing: "running",
|
|
38
|
-
paused: "pause",
|
|
39
|
-
stopped: "stop"
|
|
40
|
-
};
|
|
37
|
+
var import_react = __toESM(require("react"), 1);
|
|
38
|
+
var import_plugin_ui_kit = require("@fw/plugin-ui-kit");
|
|
41
39
|
var statusToLabel = {
|
|
42
40
|
idle: "Idle",
|
|
43
41
|
executing: "Executing",
|
|
@@ -53,124 +51,91 @@ function formatCost(n) {
|
|
|
53
51
|
if (n < 0.01 && n > 0) return "<$0.01";
|
|
54
52
|
return `$${n.toFixed(2)}`;
|
|
55
53
|
}
|
|
56
|
-
function BotSlotCard({ bot, currentTaskTitle, onPause, onResume, onStop }) {
|
|
54
|
+
function BotSlotCard({ bot, currentTaskTitle, profileName, botDisplayName, botIcon, botColor, onPause, onResume, onStop }) {
|
|
57
55
|
const { botId, botName, status, currentTaskId, tokensUsed, cost } = bot;
|
|
58
|
-
const dotStatus = statusToDot[status] ?? "neutral";
|
|
59
|
-
const iconName = statusToIcon[status] ?? "pending";
|
|
60
|
-
const label = statusToLabel[status] ?? status;
|
|
61
56
|
const isExecuting = status === "executing";
|
|
62
57
|
const isPaused = status === "paused";
|
|
63
|
-
const
|
|
64
|
-
const taskText = isExecuting ? currentTaskTitle || currentTaskId || "
|
|
65
|
-
|
|
66
|
-
Flex,
|
|
58
|
+
const label = statusToLabel[status] ?? status;
|
|
59
|
+
const taskText = isExecuting ? currentTaskTitle || currentTaskId || "-" : "-";
|
|
60
|
+
return import_react.default.createElement(
|
|
61
|
+
import_plugin_ui_kit.Flex,
|
|
67
62
|
{
|
|
68
|
-
variant: "row-center-
|
|
69
|
-
style: {
|
|
63
|
+
variant: "row-center-start-nowrap-8",
|
|
64
|
+
style: { padding: "6px 16px", minHeight: "38px", borderBottom: "1px solid var(--color-border-default)" }
|
|
70
65
|
},
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
icon: "playArrow",
|
|
84
|
-
size: "xs",
|
|
85
|
-
variant: "clear",
|
|
86
|
-
onClick: (e) => {
|
|
87
|
-
e.stopPropagation();
|
|
88
|
-
onResume(botId);
|
|
89
|
-
},
|
|
90
|
-
title: "Resume bot"
|
|
91
|
-
}) : null,
|
|
92
|
-
// Stop button (available when executing or paused)
|
|
93
|
-
(isExecuting || isPaused) && onStop ? React.createElement(IconButton, {
|
|
94
|
-
icon: "stop",
|
|
95
|
-
size: "xs",
|
|
96
|
-
variant: "clear",
|
|
97
|
-
onClick: (e) => {
|
|
98
|
-
e.stopPropagation();
|
|
99
|
-
onStop(botId);
|
|
66
|
+
// Instance name
|
|
67
|
+
import_react.default.createElement(import_plugin_ui_kit.Typography, {
|
|
68
|
+
variant: "smallCaption-regular",
|
|
69
|
+
color: "color-text-high",
|
|
70
|
+
style: { width: "120px", flexShrink: 0 }
|
|
71
|
+
}, profileName ? `${profileName} #${botId.split("-").pop() ?? "0"}` : botName),
|
|
72
|
+
// Bot (icon + name)
|
|
73
|
+
import_react.default.createElement(
|
|
74
|
+
import_plugin_ui_kit.Flex,
|
|
75
|
+
{
|
|
76
|
+
variant: "row-center-start-nowrap-4",
|
|
77
|
+
style: { width: "110px", flexShrink: 0, color: botColor ? `var(--${botColor})` : void 0 }
|
|
100
78
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"div",
|
|
107
|
-
{
|
|
108
|
-
style: {
|
|
109
|
-
width: "120px",
|
|
110
|
-
minWidth: "120px",
|
|
111
|
-
padding: "8px",
|
|
112
|
-
borderRadius: "var(--border-radius-secondary)",
|
|
113
|
-
border: "1px solid var(--color-border-default)",
|
|
114
|
-
backgroundColor: "var(--color-surface-elevated)",
|
|
115
|
-
display: "flex",
|
|
116
|
-
flexDirection: "column",
|
|
117
|
-
gap: "4px",
|
|
118
|
-
flexShrink: 0
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
// Row 1: Status icon + bot name
|
|
122
|
-
React.createElement(
|
|
123
|
-
Flex,
|
|
124
|
-
{ variant: "row-center-start-nowrap-4" },
|
|
125
|
-
React.createElement(Icon, {
|
|
126
|
-
name: iconName,
|
|
127
|
-
size: 12,
|
|
128
|
-
color: iconColor
|
|
129
|
-
}),
|
|
130
|
-
React.createElement(Typography, {
|
|
131
|
-
variant: "caption-thick",
|
|
132
|
-
color: "color-text-high",
|
|
133
|
-
style: {
|
|
134
|
-
overflow: "hidden",
|
|
135
|
-
textOverflow: "ellipsis",
|
|
136
|
-
whiteSpace: "nowrap",
|
|
137
|
-
flex: 1,
|
|
138
|
-
minWidth: 0
|
|
139
|
-
}
|
|
140
|
-
}, botName)
|
|
79
|
+
import_react.default.createElement(import_plugin_ui_kit.Icon, { name: botIcon || "smartToy", size: 12 }),
|
|
80
|
+
import_react.default.createElement(import_plugin_ui_kit.Typography, {
|
|
81
|
+
variant: "smallCaption-regular",
|
|
82
|
+
color: "color-text-subtle"
|
|
83
|
+
}, botDisplayName || "-")
|
|
141
84
|
),
|
|
142
|
-
//
|
|
143
|
-
|
|
85
|
+
// Status
|
|
86
|
+
import_react.default.createElement(import_plugin_ui_kit.Typography, {
|
|
144
87
|
variant: "smallCaption-regular",
|
|
145
|
-
color:
|
|
146
|
-
style: {
|
|
88
|
+
color: isExecuting ? "color-brand-main" : "color-text-subtle",
|
|
89
|
+
style: { width: "70px", flexShrink: 0 }
|
|
147
90
|
}, label),
|
|
148
|
-
//
|
|
149
|
-
|
|
91
|
+
// Current task
|
|
92
|
+
import_react.default.createElement(import_plugin_ui_kit.Typography, {
|
|
150
93
|
variant: "smallCaption-regular",
|
|
151
|
-
color: "color-text-medium",
|
|
152
|
-
style: {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
94
|
+
color: isExecuting ? "color-text-medium" : "color-text-subtle",
|
|
95
|
+
style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
96
|
+
}, taskText),
|
|
97
|
+
// Tokens
|
|
98
|
+
import_react.default.createElement(import_plugin_ui_kit.Typography, {
|
|
99
|
+
variant: "smallCaption-regular",
|
|
100
|
+
color: "color-text-subtle",
|
|
101
|
+
style: { width: "50px", flexShrink: 0, textAlign: "right" }
|
|
102
|
+
}, formatTokens(tokensUsed)),
|
|
103
|
+
// Cost
|
|
104
|
+
import_react.default.createElement(import_plugin_ui_kit.Typography, {
|
|
105
|
+
variant: "smallCaption-regular",
|
|
106
|
+
color: "color-text-subtle",
|
|
107
|
+
style: { width: "50px", flexShrink: 0, textAlign: "right" }
|
|
108
|
+
}, formatCost(cost)),
|
|
109
|
+
// Actions
|
|
110
|
+
import_react.default.createElement(
|
|
111
|
+
import_plugin_ui_kit.Flex,
|
|
112
|
+
{
|
|
113
|
+
variant: "row-center-end-nowrap-1",
|
|
114
|
+
style: { width: "50px", flexShrink: 0 }
|
|
115
|
+
},
|
|
116
|
+
isExecuting && onPause && import_react.default.createElement(import_plugin_ui_kit.IconButton, {
|
|
117
|
+
icon: "pause",
|
|
118
|
+
size: "xs",
|
|
119
|
+
variant: "clear",
|
|
120
|
+
onClick: () => onPause(botId),
|
|
121
|
+
title: "Pause"
|
|
122
|
+
}),
|
|
123
|
+
isPaused && onResume && import_react.default.createElement(import_plugin_ui_kit.IconButton, {
|
|
124
|
+
icon: "playArrow",
|
|
125
|
+
size: "xs",
|
|
126
|
+
variant: "clear",
|
|
127
|
+
onClick: () => onResume(botId),
|
|
128
|
+
title: "Resume"
|
|
129
|
+
}),
|
|
130
|
+
(isExecuting || isPaused) && onStop && import_react.default.createElement(import_plugin_ui_kit.IconButton, {
|
|
131
|
+
icon: "stop",
|
|
132
|
+
size: "xs",
|
|
133
|
+
variant: "clear",
|
|
134
|
+
color: "danger",
|
|
135
|
+
onClick: () => onStop(botId),
|
|
136
|
+
title: "Stop"
|
|
137
|
+
})
|
|
138
|
+
)
|
|
173
139
|
);
|
|
174
140
|
}
|
|
175
141
|
var bot_slot_card_default = BotSlotCard;
|
|
176
|
-
module.exports = BotSlotCard;
|
package/dist/ui/budget-bar.js
CHANGED
|
@@ -43,11 +43,13 @@ function BudgetBar({ label, used, limit, unit }) {
|
|
|
43
43
|
)
|
|
44
44
|
),
|
|
45
45
|
React.createElement(
|
|
46
|
-
|
|
46
|
+
Flex,
|
|
47
47
|
{
|
|
48
|
-
|
|
48
|
+
variant: "row-start-start-nowrap-0",
|
|
49
|
+
style: { width: "100%", height: "4px", borderRadius: "2px", backgroundColor: "var(--color-surface-raised)", overflow: "hidden" }
|
|
49
50
|
},
|
|
50
|
-
React.createElement(
|
|
51
|
+
React.createElement(Flex, {
|
|
52
|
+
variant: "row-start-start-nowrap-0",
|
|
51
53
|
style: { width: `${pct}%`, height: "100%", borderRadius: "2px", backgroundColor: color, transition: "width 0.3s" }
|
|
52
54
|
})
|
|
53
55
|
)
|
|
@@ -92,7 +92,6 @@ function ChatTaskResult({ result, args, callTool, openWorkspace }) {
|
|
|
92
92
|
{
|
|
93
93
|
variant: "row-center-start-nowrap-10",
|
|
94
94
|
style: {
|
|
95
|
-
padding: "8px 12px",
|
|
96
95
|
borderRadius: "var(--border-radius-regular)",
|
|
97
96
|
border: "1px solid var(--color-border-default)",
|
|
98
97
|
backgroundColor: "var(--color-surface-low)"
|
|
@@ -108,7 +107,7 @@ function ChatTaskResult({ result, args, callTool, openWorkspace }) {
|
|
|
108
107
|
const doneCount = subtasks.filter((s) => s.status === "done").length;
|
|
109
108
|
const totalCount = subtasks.length;
|
|
110
109
|
const hasSubtasks = task.isParent && totalCount > 0;
|
|
111
|
-
const botLabel = task.currentBotId ? `Bot: ${task.currentBotId}` : task.
|
|
110
|
+
const botLabel = task.currentBotId ? `Bot: ${task.currentBotId}` : task.assignedProfile ? `Profile: ${task.assignedProfile}` : null;
|
|
112
111
|
const handleOpenDashboard = useCallback(() => {
|
|
113
112
|
openWorkspace({
|
|
114
113
|
packId: "@synergenius/flow-weaver-pack-weaver",
|
|
@@ -120,7 +119,6 @@ function ChatTaskResult({ result, args, callTool, openWorkspace }) {
|
|
|
120
119
|
{
|
|
121
120
|
variant: "row-center-start-nowrap-10",
|
|
122
121
|
style: {
|
|
123
|
-
padding: "8px 12px",
|
|
124
122
|
borderRadius: "var(--border-radius-regular)",
|
|
125
123
|
border: "1px solid var(--color-border-default)",
|
|
126
124
|
backgroundColor: "var(--color-surface-low)"
|
|
@@ -142,14 +140,13 @@ function ChatTaskResult({ result, args, callTool, openWorkspace }) {
|
|
|
142
140
|
React.createElement(Typography, {
|
|
143
141
|
variant: "caption-thick",
|
|
144
142
|
color: "color-text-high",
|
|
145
|
-
|
|
143
|
+
truncate: true
|
|
146
144
|
}, task.title),
|
|
147
145
|
// Status + subtask progress + bot
|
|
148
146
|
React.createElement(
|
|
149
147
|
Flex,
|
|
150
148
|
{
|
|
151
|
-
variant: "row-center-start-
|
|
152
|
-
style: { flexWrap: "wrap", gap: "4px 8px" }
|
|
149
|
+
variant: "row-center-start-wrap-8"
|
|
153
150
|
},
|
|
154
151
|
// Status label
|
|
155
152
|
React.createElement(Typography, {
|
|
@@ -165,7 +162,7 @@ function ChatTaskResult({ result, args, callTool, openWorkspace }) {
|
|
|
165
162
|
botLabel && React.createElement(Typography, {
|
|
166
163
|
variant: "smallCaption-regular",
|
|
167
164
|
color: "color-text-low",
|
|
168
|
-
|
|
165
|
+
truncate: true
|
|
169
166
|
}, botLabel)
|
|
170
167
|
)
|
|
171
168
|
),
|
|
@@ -0,0 +1,136 @@
|
|
|
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);
|
|
19
|
+
|
|
20
|
+
// src/ui/decision-log.tsx
|
|
21
|
+
var decision_log_exports = {};
|
|
22
|
+
__export(decision_log_exports, {
|
|
23
|
+
DecisionLog: () => DecisionLog,
|
|
24
|
+
default: () => decision_log_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(decision_log_exports);
|
|
27
|
+
var React = require("react");
|
|
28
|
+
var {
|
|
29
|
+
Flex,
|
|
30
|
+
Typography,
|
|
31
|
+
ScrollArea,
|
|
32
|
+
Tag,
|
|
33
|
+
SectionTitle
|
|
34
|
+
} = require("@fw/plugin-ui-kit");
|
|
35
|
+
var methodColors = {
|
|
36
|
+
"exact-match": "info",
|
|
37
|
+
"single-eligible": "positive",
|
|
38
|
+
"ai-routed": "secondary",
|
|
39
|
+
"round-robin": "secondary",
|
|
40
|
+
"manual": "caution"
|
|
41
|
+
};
|
|
42
|
+
var methodLabels = {
|
|
43
|
+
"exact-match": "exact",
|
|
44
|
+
"single-eligible": "single",
|
|
45
|
+
"ai-routed": "ai",
|
|
46
|
+
"round-robin": "robin",
|
|
47
|
+
"manual": "manual"
|
|
48
|
+
};
|
|
49
|
+
function formatTime(ts) {
|
|
50
|
+
const d = new Date(ts);
|
|
51
|
+
return d.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
52
|
+
}
|
|
53
|
+
function truncate(text, max) {
|
|
54
|
+
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
55
|
+
}
|
|
56
|
+
function DecisionLog({ decisions }) {
|
|
57
|
+
if (!decisions || decisions.length === 0) {
|
|
58
|
+
return React.createElement(
|
|
59
|
+
Flex,
|
|
60
|
+
{
|
|
61
|
+
variant: "column-stretch-start-nowrap-4"
|
|
62
|
+
},
|
|
63
|
+
React.createElement(SectionTitle, null, "Decision Log"),
|
|
64
|
+
React.createElement(Typography, {
|
|
65
|
+
variant: "smallCaption-regular",
|
|
66
|
+
color: "color-text-subtle"
|
|
67
|
+
}, "No routing decisions yet.")
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const sorted = [...decisions].sort((a, b) => b.timestamp - a.timestamp);
|
|
71
|
+
return React.createElement(
|
|
72
|
+
Flex,
|
|
73
|
+
{
|
|
74
|
+
variant: "column-stretch-start-nowrap-4"
|
|
75
|
+
},
|
|
76
|
+
React.createElement(SectionTitle, null, "Decision Log"),
|
|
77
|
+
React.createElement(
|
|
78
|
+
ScrollArea,
|
|
79
|
+
{
|
|
80
|
+
style: { maxHeight: "260px" }
|
|
81
|
+
},
|
|
82
|
+
React.createElement(
|
|
83
|
+
Flex,
|
|
84
|
+
{
|
|
85
|
+
variant: "column-stretch-start-nowrap-0"
|
|
86
|
+
},
|
|
87
|
+
...sorted.map((d) => {
|
|
88
|
+
const methodLabel = d.method === "ai-routed" && d.confidence != null ? `ai ${d.confidence}%` : methodLabels[d.method] || d.method;
|
|
89
|
+
return React.createElement(
|
|
90
|
+
Flex,
|
|
91
|
+
{
|
|
92
|
+
key: d.id,
|
|
93
|
+
variant: "column-stretch-start-nowrap-2",
|
|
94
|
+
style: {
|
|
95
|
+
padding: "6px 8px",
|
|
96
|
+
borderBottom: "1px solid var(--color-border-default)"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
// Main line: time, title, instance, method
|
|
100
|
+
React.createElement(
|
|
101
|
+
Flex,
|
|
102
|
+
{ variant: "row-center-start-nowrap-8" },
|
|
103
|
+
React.createElement(Typography, {
|
|
104
|
+
variant: "smallCaption-regular",
|
|
105
|
+
color: "color-text-subtle",
|
|
106
|
+
style: { flexShrink: 0, fontFamily: "var(--font-mono, monospace)", fontSize: "11px" }
|
|
107
|
+
}, formatTime(d.timestamp)),
|
|
108
|
+
React.createElement(Typography, {
|
|
109
|
+
variant: "smallCaption-regular",
|
|
110
|
+
color: "color-text-high",
|
|
111
|
+
style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
|
|
112
|
+
}, `"${truncate(d.taskTitle, 40)}"`),
|
|
113
|
+
React.createElement(Typography, {
|
|
114
|
+
variant: "smallCaption-regular",
|
|
115
|
+
color: "color-text-medium",
|
|
116
|
+
style: { flexShrink: 0 }
|
|
117
|
+
}, `\u2192 ${d.assignedInstanceId}`),
|
|
118
|
+
React.createElement(Tag, {
|
|
119
|
+
size: "small",
|
|
120
|
+
color: methodColors[d.method] || "secondary"
|
|
121
|
+
}, methodLabel)
|
|
122
|
+
),
|
|
123
|
+
// Reason line
|
|
124
|
+
React.createElement(Typography, {
|
|
125
|
+
variant: "smallCaption-regular",
|
|
126
|
+
color: "color-text-subtle",
|
|
127
|
+
style: { paddingLeft: "70px" }
|
|
128
|
+
}, d.reason)
|
|
129
|
+
);
|
|
130
|
+
})
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
var decision_log_default = DecisionLog;
|
|
136
|
+
module.exports = DecisionLog;
|
|
@@ -0,0 +1,158 @@
|
|
|
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);
|
|
19
|
+
|
|
20
|
+
// src/ui/profile-card.tsx
|
|
21
|
+
var profile_card_exports = {};
|
|
22
|
+
__export(profile_card_exports, {
|
|
23
|
+
ProfileCard: () => ProfileCard,
|
|
24
|
+
default: () => profile_card_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(profile_card_exports);
|
|
27
|
+
var React = require("react");
|
|
28
|
+
var {
|
|
29
|
+
Flex,
|
|
30
|
+
Typography,
|
|
31
|
+
Icon,
|
|
32
|
+
Chip,
|
|
33
|
+
IconButton,
|
|
34
|
+
Tag
|
|
35
|
+
} = require("@fw/plugin-ui-kit");
|
|
36
|
+
function ProfileCard({ profile, activeInstances, onEdit, onDelete }) {
|
|
37
|
+
const {
|
|
38
|
+
id,
|
|
39
|
+
name,
|
|
40
|
+
description,
|
|
41
|
+
icon,
|
|
42
|
+
color,
|
|
43
|
+
capabilities,
|
|
44
|
+
preferences,
|
|
45
|
+
maxInstances
|
|
46
|
+
} = profile;
|
|
47
|
+
const budgetParts = [];
|
|
48
|
+
if (preferences.maxCostPerRun) budgetParts.push(`$${preferences.maxCostPerRun.toFixed(2)}/run`);
|
|
49
|
+
if (preferences.maxCostPerTask) budgetParts.push(`$${preferences.maxCostPerTask.toFixed(2)}/task`);
|
|
50
|
+
const budgetText = budgetParts.length > 0 ? budgetParts.join(" / ") : null;
|
|
51
|
+
return React.createElement(
|
|
52
|
+
Flex,
|
|
53
|
+
{
|
|
54
|
+
variant: "column-stretch-start-nowrap-6",
|
|
55
|
+
style: {
|
|
56
|
+
padding: "10px 12px",
|
|
57
|
+
borderRadius: "8px",
|
|
58
|
+
border: "1px solid var(--color-border-default)",
|
|
59
|
+
backgroundColor: "var(--color-surface-elevated)"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
// Row 1: Icon + Name + Edit/Delete buttons
|
|
63
|
+
React.createElement(
|
|
64
|
+
Flex,
|
|
65
|
+
{ variant: "row-center-start-nowrap-8" },
|
|
66
|
+
React.createElement(
|
|
67
|
+
Flex,
|
|
68
|
+
{
|
|
69
|
+
variant: "row-center-center-nowrap-0",
|
|
70
|
+
style: { color: `var(--${color})`, flexShrink: 0 }
|
|
71
|
+
},
|
|
72
|
+
React.createElement(Icon, { name: icon || "smartToy", size: 18 })
|
|
73
|
+
),
|
|
74
|
+
React.createElement(Typography, {
|
|
75
|
+
variant: "caption-thick",
|
|
76
|
+
color: "color-text-high",
|
|
77
|
+
style: { flex: 1, minWidth: 0 }
|
|
78
|
+
}, name),
|
|
79
|
+
onEdit && React.createElement(IconButton, {
|
|
80
|
+
icon: "edit",
|
|
81
|
+
size: "xs",
|
|
82
|
+
variant: "clear",
|
|
83
|
+
onClick: () => onEdit(id),
|
|
84
|
+
title: "Edit profile"
|
|
85
|
+
}),
|
|
86
|
+
onDelete && React.createElement(IconButton, {
|
|
87
|
+
icon: "delete",
|
|
88
|
+
size: "xs",
|
|
89
|
+
variant: "clear",
|
|
90
|
+
color: "danger",
|
|
91
|
+
onClick: () => onDelete(id),
|
|
92
|
+
title: "Delete profile"
|
|
93
|
+
})
|
|
94
|
+
),
|
|
95
|
+
// Description
|
|
96
|
+
description && React.createElement(Typography, {
|
|
97
|
+
variant: "smallCaption-regular",
|
|
98
|
+
color: "color-text-medium"
|
|
99
|
+
}, description),
|
|
100
|
+
// Divider
|
|
101
|
+
React.createElement(Flex, {
|
|
102
|
+
variant: "row-center-start-nowrap-0",
|
|
103
|
+
style: { borderTop: "1px solid var(--color-border-default)", margin: "2px 0" }
|
|
104
|
+
}),
|
|
105
|
+
// Capabilities
|
|
106
|
+
capabilities.length > 0 && React.createElement(
|
|
107
|
+
Flex,
|
|
108
|
+
{ variant: "row-center-start-wrap-4" },
|
|
109
|
+
React.createElement(Typography, {
|
|
110
|
+
variant: "smallCaption-regular",
|
|
111
|
+
color: "color-text-subtle",
|
|
112
|
+
style: { flexShrink: 0 }
|
|
113
|
+
}, "Capabilities:"),
|
|
114
|
+
...capabilities.map(
|
|
115
|
+
(cap) => React.createElement(
|
|
116
|
+
"span",
|
|
117
|
+
{ key: cap.name, title: cap.description },
|
|
118
|
+
React.createElement(Chip, { label: cap.name, size: "small", color: "color-brand-main" })
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
),
|
|
122
|
+
// Cost strategy
|
|
123
|
+
React.createElement(
|
|
124
|
+
Flex,
|
|
125
|
+
{ variant: "row-center-start-wrap-12" },
|
|
126
|
+
React.createElement(Typography, {
|
|
127
|
+
variant: "smallCaption-regular",
|
|
128
|
+
color: "color-text-subtle"
|
|
129
|
+
}, `Cost strategy: ${preferences.costStrategy}`)
|
|
130
|
+
),
|
|
131
|
+
// Instances + Approval + Budget
|
|
132
|
+
React.createElement(
|
|
133
|
+
Flex,
|
|
134
|
+
{ variant: "row-center-start-wrap-12" },
|
|
135
|
+
React.createElement(Typography, {
|
|
136
|
+
variant: "smallCaption-regular",
|
|
137
|
+
color: "color-text-subtle"
|
|
138
|
+
}, `Instances: ${activeInstances}/${maxInstances} active`),
|
|
139
|
+
React.createElement(Tag, {
|
|
140
|
+
size: "small",
|
|
141
|
+
color: preferences.requireApproval ? "caution" : "positive"
|
|
142
|
+
}, preferences.requireApproval ? "Approval required" : "Auto-approve")
|
|
143
|
+
),
|
|
144
|
+
// Budget line
|
|
145
|
+
budgetText && React.createElement(Typography, {
|
|
146
|
+
variant: "smallCaption-regular",
|
|
147
|
+
color: "color-text-subtle"
|
|
148
|
+
}, `Budget: ${budgetText}`),
|
|
149
|
+
// Instructions
|
|
150
|
+
preferences.instructions && React.createElement(Typography, {
|
|
151
|
+
variant: "smallCaption-regular",
|
|
152
|
+
color: "color-text-subtle",
|
|
153
|
+
style: { fontStyle: "italic" }
|
|
154
|
+
}, preferences.instructions)
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
var profile_card_default = ProfileCard;
|
|
158
|
+
module.exports = ProfileCard;
|