@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
|
@@ -1,9 +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/chat-task-result.tsx
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
21
|
+
var chat_task_result_exports = {};
|
|
22
|
+
__export(chat_task_result_exports, {
|
|
23
|
+
ChatTaskResult: () => ChatTaskResult,
|
|
24
|
+
default: () => chat_task_result_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(chat_task_result_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");
|
|
7
30
|
function parseResult(result) {
|
|
8
31
|
try {
|
|
9
32
|
const parsed = typeof result === "string" ? JSON.parse(result) : result;
|
|
@@ -50,16 +73,16 @@ function isTerminal(status) {
|
|
|
50
73
|
function ChatTaskResult(props) {
|
|
51
74
|
const { result = null, args = {}, callTool, openWorkspace } = props ?? {};
|
|
52
75
|
const initial = parseResult(result);
|
|
53
|
-
const [task, setTask] = useState(initial.task);
|
|
54
|
-
const [subtasks, setSubtasks] = useState(initial.subtasks);
|
|
55
|
-
const mountedRef = useRef(true);
|
|
56
|
-
useEffect(() => {
|
|
76
|
+
const [task, setTask] = (0, import_react.useState)(initial.task);
|
|
77
|
+
const [subtasks, setSubtasks] = (0, import_react.useState)(initial.subtasks);
|
|
78
|
+
const mountedRef = (0, import_react.useRef)(true);
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
57
80
|
mountedRef.current = true;
|
|
58
81
|
return () => {
|
|
59
82
|
mountedRef.current = false;
|
|
60
83
|
};
|
|
61
84
|
}, []);
|
|
62
|
-
useEffect(() => {
|
|
85
|
+
(0, import_react.useEffect)(() => {
|
|
63
86
|
if (!task?.id) return;
|
|
64
87
|
if (isTerminal(task.status)) return;
|
|
65
88
|
const poll = async () => {
|
|
@@ -82,92 +105,76 @@ function ChatTaskResult(props) {
|
|
|
82
105
|
};
|
|
83
106
|
}, [task?.id, task?.status, callTool]);
|
|
84
107
|
if (!task) {
|
|
85
|
-
return
|
|
86
|
-
Flex,
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
109
|
+
import_plugin_ui_kit.Flex,
|
|
87
110
|
{
|
|
88
111
|
variant: "row-center-start-nowrap-10",
|
|
89
112
|
style: {
|
|
90
113
|
borderRadius: "var(--border-radius-regular)",
|
|
91
114
|
border: "1px solid var(--color-border-default)",
|
|
92
115
|
backgroundColor: "var(--color-surface-low)"
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, "Task created")
|
|
116
|
+
},
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.StatusIcon, { status: "pending", size: "sm" }),
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-thick", color: "color-text-medium", children: "Task created" })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
100
122
|
);
|
|
101
123
|
}
|
|
102
124
|
const doneCount = subtasks.filter((s) => s.status === "done").length;
|
|
103
125
|
const totalCount = subtasks.length;
|
|
104
126
|
const hasSubtasks = task.isParent && totalCount > 0;
|
|
105
127
|
const botLabel = task.assignedProfile ? `Profile: ${task.assignedProfile}` : null;
|
|
106
|
-
const handleOpenDashboard = useCallback(() => {
|
|
128
|
+
const handleOpenDashboard = (0, import_react.useCallback)(() => {
|
|
107
129
|
openWorkspace({
|
|
108
130
|
packId: "@synergenius/flow-weaver-pack-weaver",
|
|
109
131
|
taskId: task.id
|
|
110
132
|
});
|
|
111
133
|
}, [openWorkspace, task.id]);
|
|
112
|
-
return
|
|
113
|
-
Flex,
|
|
134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
135
|
+
import_plugin_ui_kit.Flex,
|
|
114
136
|
{
|
|
115
137
|
variant: "row-center-start-nowrap-10",
|
|
116
138
|
style: {
|
|
117
139
|
borderRadius: "var(--border-radius-regular)",
|
|
118
140
|
border: "1px solid var(--color-border-default)",
|
|
119
141
|
backgroundColor: "var(--color-surface-low)"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
// Status icon
|
|
123
|
-
React.createElement(StatusIcon, {
|
|
124
|
-
status: statusToIcon(task.status),
|
|
125
|
-
size: "sm"
|
|
126
|
-
}),
|
|
127
|
-
// Title + meta column
|
|
128
|
-
React.createElement(
|
|
129
|
-
Flex,
|
|
130
|
-
{
|
|
131
|
-
variant: "column-start-start-nowrap-2",
|
|
132
|
-
style: { flex: 1, minWidth: 0 }
|
|
133
142
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
onClick: handleOpenDashboard
|
|
170
|
-
}, "Open Dashboard")
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.StatusIcon, { status: statusToIcon(task.status), size: "sm" }),
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
146
|
+
import_plugin_ui_kit.Flex,
|
|
147
|
+
{
|
|
148
|
+
variant: "column-start-start-nowrap-2",
|
|
149
|
+
style: { flex: 1, minWidth: 0 },
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-thick", color: "color-text-high", truncate: true, children: task.title }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-wrap-8", children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
import_plugin_ui_kit.Typography,
|
|
155
|
+
{
|
|
156
|
+
variant: "smallCaption-regular",
|
|
157
|
+
color: task.status === "done" ? "color-text-positive" : task.status === "cancelled" ? "color-text-negative" : task.status === "in-progress" ? "color-text-info" : "color-text-medium",
|
|
158
|
+
children: statusLabel(task.status)
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
hasSubtasks && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: `${doneCount}/${totalCount} done` }),
|
|
162
|
+
botLabel && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import_plugin_ui_kit.Typography,
|
|
164
|
+
{
|
|
165
|
+
variant: "smallCaption-regular",
|
|
166
|
+
color: "color-text-low",
|
|
167
|
+
truncate: true,
|
|
168
|
+
children: botLabel
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] })
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Button, { size: "xs", variant: "clear", color: "secondary", onClick: handleOpenDashboard, children: "Open Dashboard" })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
171
178
|
);
|
|
172
179
|
}
|
|
173
|
-
|
|
180
|
+
var chat_task_result_default = ChatTaskResult;
|
package/dist/ui/decision-log.js
CHANGED
|
@@ -24,14 +24,8 @@ __export(decision_log_exports, {
|
|
|
24
24
|
default: () => decision_log_default
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(decision_log_exports);
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
Flex,
|
|
30
|
-
Typography,
|
|
31
|
-
ScrollArea,
|
|
32
|
-
Chip,
|
|
33
|
-
SectionTitle
|
|
34
|
-
} = require("@fw/plugin-ui-kit");
|
|
27
|
+
var import_plugin_ui_kit = require("@fw/plugin-ui-kit");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
29
|
var methodColors = {
|
|
36
30
|
"exact-match": "color-status-info",
|
|
37
31
|
"single-eligible": "color-status-positive",
|
|
@@ -55,83 +49,76 @@ function truncate(text, max) {
|
|
|
55
49
|
}
|
|
56
50
|
function DecisionLog({ decisions }) {
|
|
57
51
|
if (!decisions || decisions.length === 0) {
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
|
|
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
|
-
);
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-stretch-start-nowrap-4", children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.SectionTitle, { children: "Decision Log" }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: "No routing decisions yet." })
|
|
55
|
+
] });
|
|
69
56
|
}
|
|
70
57
|
const sorted = [...decisions].sort((a, b) => b.timestamp - a.timestamp);
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
React.createElement(
|
|
78
|
-
ScrollArea,
|
|
79
|
-
{
|
|
80
|
-
style: { maxHeight: "260px" }
|
|
81
|
-
},
|
|
82
|
-
React.createElement(
|
|
83
|
-
Flex,
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "column-stretch-start-nowrap-4", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.SectionTitle, { children: "Decision Log" }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.ScrollArea, { style: { maxHeight: "260px" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Flex, { variant: "column-stretch-start-nowrap-0", children: sorted.map((d) => {
|
|
61
|
+
const methodLabel = d.method === "ai-routed" && d.confidence != null ? `ai ${d.confidence}%` : methodLabels[d.method] || d.method;
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
+
import_plugin_ui_kit.Flex,
|
|
84
64
|
{
|
|
85
|
-
variant: "column-stretch-start-nowrap-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
65
|
+
variant: "column-stretch-start-nowrap-2",
|
|
66
|
+
style: {
|
|
67
|
+
padding: "6px 8px",
|
|
68
|
+
borderBottom: "1px solid var(--color-border-default)"
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-8", children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_plugin_ui_kit.Typography,
|
|
74
|
+
{
|
|
75
|
+
variant: "smallCaption-regular",
|
|
76
|
+
color: "color-text-subtle",
|
|
77
|
+
style: { flexShrink: 0, fontFamily: "var(--font-mono, monospace)", fontSize: "11px" },
|
|
78
|
+
children: formatTime(d.timestamp)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_plugin_ui_kit.Typography,
|
|
83
|
+
{
|
|
84
|
+
variant: "smallCaption-regular",
|
|
85
|
+
color: "color-text-high",
|
|
86
|
+
style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
87
|
+
children: `"${truncate(d.taskTitle, 40)}"`
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
import_plugin_ui_kit.Typography,
|
|
92
|
+
{
|
|
93
|
+
variant: "smallCaption-regular",
|
|
94
|
+
color: "color-text-medium",
|
|
95
|
+
style: { flexShrink: 0 },
|
|
96
|
+
children: `\u2192 ${d.assignedInstanceId}`
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
|
+
import_plugin_ui_kit.Chip,
|
|
101
|
+
{
|
|
102
|
+
label: methodLabel,
|
|
103
|
+
size: "small",
|
|
104
|
+
color: methodColors[d.method] || "color-brand-alt"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
109
|
+
import_plugin_ui_kit.Typography,
|
|
110
|
+
{
|
|
104
111
|
variant: "smallCaption-regular",
|
|
105
112
|
color: "color-text-subtle",
|
|
106
|
-
style: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
style: { flexShrink: 0 }
|
|
117
|
-
}, `\u2192 ${d.assignedInstanceId}`),
|
|
118
|
-
React.createElement(Chip, {
|
|
119
|
-
label: methodLabel,
|
|
120
|
-
size: "small",
|
|
121
|
-
color: methodColors[d.method] || "color-brand-alt"
|
|
122
|
-
})
|
|
123
|
-
),
|
|
124
|
-
// Reason line
|
|
125
|
-
React.createElement(Typography, {
|
|
126
|
-
variant: "smallCaption-regular",
|
|
127
|
-
color: "color-text-subtle",
|
|
128
|
-
style: { paddingLeft: "70px" }
|
|
129
|
-
}, d.reason)
|
|
130
|
-
);
|
|
131
|
-
})
|
|
132
|
-
)
|
|
133
|
-
)
|
|
134
|
-
);
|
|
113
|
+
style: { paddingLeft: "70px" },
|
|
114
|
+
children: d.reason
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
d.id
|
|
120
|
+
);
|
|
121
|
+
}) }) })
|
|
122
|
+
] });
|
|
135
123
|
}
|
|
136
124
|
var decision_log_default = DecisionLog;
|
|
137
|
-
module.exports = DecisionLog;
|
package/dist/ui/genesis-block.js
CHANGED
|
@@ -24,9 +24,9 @@ __export(genesis_block_exports, {
|
|
|
24
24
|
default: () => genesis_block_default
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(genesis_block_exports);
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
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");
|
|
30
30
|
var OUTCOME_BADGE_VARIANTS = {
|
|
31
31
|
applied: "success",
|
|
32
32
|
"rolled-back": "error",
|
|
@@ -44,112 +44,103 @@ var OUTCOME_STATUS = {
|
|
|
44
44
|
"no-change": "completed"
|
|
45
45
|
};
|
|
46
46
|
function GenesisBlock({ cycle, callTool }) {
|
|
47
|
-
const [expanded, setExpanded] = useState(false);
|
|
48
|
-
const [rollingBack, setRollingBack] = useState(false);
|
|
49
|
-
const handleRollback = useCallback(async () => {
|
|
47
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
48
|
+
const [rollingBack, setRollingBack] = (0, import_react.useState)(false);
|
|
49
|
+
const handleRollback = (0, import_react.useCallback)(async () => {
|
|
50
50
|
setRollingBack(true);
|
|
51
51
|
try {
|
|
52
52
|
await callTool("fw_weaver_genesis_rollback", { cycleId: cycle.id });
|
|
53
|
-
toast("Genesis cycle rolled back", { type: "success" });
|
|
53
|
+
(0, import_plugin_ui_kit.toast)("Genesis cycle rolled back", { type: "success" });
|
|
54
54
|
} catch (err) {
|
|
55
|
-
toast(err instanceof Error ? err.message : "Failed to rollback", { type: "error" });
|
|
55
|
+
(0, import_plugin_ui_kit.toast)(err instanceof Error ? err.message : "Failed to rollback", { type: "error" });
|
|
56
56
|
}
|
|
57
57
|
setRollingBack(false);
|
|
58
58
|
}, [callTool, cycle.id]);
|
|
59
59
|
const summary = cycle.proposal?.summary ?? `Genesis cycle ${cycle.id.slice(0, 8)}`;
|
|
60
60
|
const badgeVariant = OUTCOME_BADGE_VARIANTS[cycle.outcome] ?? "default";
|
|
61
61
|
const status = OUTCOME_STATUS[cycle.outcome] ?? "pending";
|
|
62
|
-
return
|
|
63
|
-
CollapsibleBlock,
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
+
import_plugin_ui_kit.CollapsibleBlock,
|
|
64
64
|
{
|
|
65
65
|
status,
|
|
66
|
-
icon:
|
|
67
|
-
label:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, formatTimestamp(cycle.timestamp)),
|
|
76
|
-
React.createElement(Badge, { variant: badgeVariant }, cycle.outcome)
|
|
66
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Icon, { name: "autorenew", size: 14, color: "color-brand-main" }),
|
|
67
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_plugin_ui_kit.Typography,
|
|
69
|
+
{
|
|
70
|
+
variant: "caption-thick",
|
|
71
|
+
color: "color-text-high",
|
|
72
|
+
style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0 },
|
|
73
|
+
children: summary
|
|
74
|
+
}
|
|
77
75
|
),
|
|
76
|
+
headerSuffix: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-8", children: [
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-subtle", children: (0, import_plugin_ui_kit.formatTimestamp)(cycle.timestamp) }),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Badge, { variant: badgeVariant, children: cycle.outcome })
|
|
79
|
+
] }),
|
|
78
80
|
expanded,
|
|
79
|
-
onToggle: () => setExpanded((v) => !v)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
cycle.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
style: { padding: "10px 12px" }
|
|
143
|
-
},
|
|
144
|
-
React.createElement(Button, {
|
|
145
|
-
size: "xs",
|
|
146
|
-
variant: "outlined",
|
|
147
|
-
color: "danger",
|
|
148
|
-
onClick: handleRollback,
|
|
149
|
-
loading: rollingBack,
|
|
150
|
-
disabled: rollingBack
|
|
151
|
-
}, "Rollback")
|
|
152
|
-
)
|
|
81
|
+
onToggle: () => setExpanded((v) => !v),
|
|
82
|
+
children: [
|
|
83
|
+
cycle.proposal && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
84
|
+
import_plugin_ui_kit.Flex,
|
|
85
|
+
{
|
|
86
|
+
variant: "column-start-start-nowrap-6",
|
|
87
|
+
style: { padding: "10px 12px", borderBottom: "1px solid var(--color-border-default)" },
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-bold", color: "color-text-subtle", children: `Proposal \xB7 ${cycle.proposal.impactLevel}` }),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: cycle.proposal.rationale }),
|
|
91
|
+
cycle.proposal.operations.map((op, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-6", style: { fontSize: "11px" }, children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Chip, { label: op.type, size: "small", color: "color-status-info" }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-text-medium", children: op.rationale })
|
|
94
|
+
] }, i))
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
cycle.diffSummary && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
99
|
+
import_plugin_ui_kit.Flex,
|
|
100
|
+
{
|
|
101
|
+
variant: "column-start-start-nowrap-6",
|
|
102
|
+
style: { padding: "10px 12px", borderBottom: "1px solid var(--color-border-default)" },
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "caption-bold", color: "color-text-subtle", children: "Changes" }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
"pre",
|
|
107
|
+
{
|
|
108
|
+
style: {
|
|
109
|
+
fontSize: "11px",
|
|
110
|
+
fontFamily: "monospace",
|
|
111
|
+
lineHeight: 1.4,
|
|
112
|
+
padding: "8px",
|
|
113
|
+
borderRadius: "var(--border-radius-compact, 4px)",
|
|
114
|
+
backgroundColor: "var(--color-surface-raised)",
|
|
115
|
+
color: "var(--color-text-medium)",
|
|
116
|
+
whiteSpace: "pre-wrap",
|
|
117
|
+
wordBreak: "break-word",
|
|
118
|
+
maxHeight: "200px",
|
|
119
|
+
overflow: "auto",
|
|
120
|
+
margin: 0,
|
|
121
|
+
width: "100%"
|
|
122
|
+
},
|
|
123
|
+
children: cycle.diffSummary
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
cycle.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--color-border-default)" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Typography, { variant: "smallCaption-regular", color: "color-status-negative", children: cycle.error }) }),
|
|
130
|
+
cycle.outcome === "applied" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_ui_kit.Flex, { variant: "row-center-start-nowrap-8", style: { padding: "10px 12px" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
+
import_plugin_ui_kit.Button,
|
|
132
|
+
{
|
|
133
|
+
size: "xs",
|
|
134
|
+
variant: "outlined",
|
|
135
|
+
color: "danger",
|
|
136
|
+
onClick: handleRollback,
|
|
137
|
+
loading: rollingBack,
|
|
138
|
+
disabled: rollingBack,
|
|
139
|
+
children: "Rollback"
|
|
140
|
+
}
|
|
141
|
+
) })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
153
144
|
);
|
|
154
145
|
}
|
|
155
146
|
var genesis_block_default = GenesisBlock;
|