@synergenius/flow-weaver-pack-weaver 0.9.53 → 0.9.55

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.
@@ -0,0 +1,155 @@
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/genesis-block.tsx
21
+ var genesis_block_exports = {};
22
+ __export(genesis_block_exports, {
23
+ GenesisBlock: () => GenesisBlock,
24
+ default: () => genesis_block_default
25
+ });
26
+ module.exports = __toCommonJS(genesis_block_exports);
27
+ var React = require("react");
28
+ var { useState, useCallback } = React;
29
+ var { CollapsibleBlock, Flex, Typography, Icon, Badge, Tag, Button, toast, formatTimestamp } = require("@fw/plugin-ui-kit");
30
+ var OUTCOME_BADGE_VARIANTS = {
31
+ applied: "success",
32
+ "rolled-back": "error",
33
+ rejected: "warning",
34
+ stabilized: "success",
35
+ "no-change": "default",
36
+ error: "error"
37
+ };
38
+ var OUTCOME_STATUS = {
39
+ applied: "completed",
40
+ stabilized: "completed",
41
+ "rolled-back": "error",
42
+ rejected: "error",
43
+ error: "error",
44
+ "no-change": "completed"
45
+ };
46
+ function GenesisBlock({ cycle, callTool }) {
47
+ const [expanded, setExpanded] = useState(false);
48
+ const [rollingBack, setRollingBack] = useState(false);
49
+ const handleRollback = useCallback(async () => {
50
+ setRollingBack(true);
51
+ try {
52
+ await callTool("fw_weaver_genesis_rollback", { cycleId: cycle.id });
53
+ toast("Genesis cycle rolled back", { type: "success" });
54
+ } catch (err) {
55
+ toast(err instanceof Error ? err.message : "Failed to rollback", { type: "error" });
56
+ }
57
+ setRollingBack(false);
58
+ }, [callTool, cycle.id]);
59
+ const summary = cycle.proposal?.summary ?? `Genesis cycle ${cycle.id.slice(0, 8)}`;
60
+ const badgeVariant = OUTCOME_BADGE_VARIANTS[cycle.outcome] ?? "default";
61
+ const status = OUTCOME_STATUS[cycle.outcome] ?? "pending";
62
+ return React.createElement(
63
+ CollapsibleBlock,
64
+ {
65
+ status,
66
+ icon: React.createElement(Icon, { name: "autorenew", size: 14, color: "color-brand-main" }),
67
+ label: React.createElement(Typography, {
68
+ variant: "caption-thick",
69
+ color: "color-text-high",
70
+ style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0 }
71
+ }, summary),
72
+ headerSuffix: React.createElement(
73
+ Flex,
74
+ { variant: "row-center-start-nowrap-8" },
75
+ React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, formatTimestamp(cycle.timestamp)),
76
+ React.createElement(Badge, { variant: badgeVariant }, cycle.outcome)
77
+ ),
78
+ expanded,
79
+ onToggle: () => setExpanded((v) => !v)
80
+ },
81
+ // Proposal
82
+ cycle.proposal && React.createElement(
83
+ Flex,
84
+ {
85
+ variant: "column-start-start-nowrap-6",
86
+ style: { padding: "10px 12px", borderBottom: "1px solid var(--color-border-default)" }
87
+ },
88
+ React.createElement(
89
+ Typography,
90
+ { variant: "caption-bold", color: "color-text-subtle" },
91
+ `Proposal \xB7 ${cycle.proposal.impactLevel}`
92
+ ),
93
+ React.createElement(
94
+ Typography,
95
+ { variant: "smallCaption-regular", color: "color-text-medium" },
96
+ cycle.proposal.rationale
97
+ ),
98
+ ...cycle.proposal.operations.map(
99
+ (op, i) => React.createElement(
100
+ Flex,
101
+ { key: i, variant: "row-center-start-nowrap-6", style: { fontSize: "11px" } },
102
+ React.createElement(Tag, { size: "small", color: "info" }, op.type),
103
+ React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-medium" }, op.rationale)
104
+ )
105
+ )
106
+ ),
107
+ // Diff
108
+ cycle.diffSummary && React.createElement(
109
+ Flex,
110
+ {
111
+ variant: "column-start-start-nowrap-6",
112
+ style: { padding: "10px 12px", borderBottom: "1px solid var(--color-border-default)" }
113
+ },
114
+ React.createElement(Typography, { variant: "caption-bold", color: "color-text-subtle" }, "Changes"),
115
+ React.createElement("pre", {
116
+ style: {
117
+ fontSize: "11px",
118
+ fontFamily: "monospace",
119
+ lineHeight: 1.4,
120
+ padding: "8px",
121
+ borderRadius: "var(--border-radius-compact, 4px)",
122
+ backgroundColor: "var(--color-surface-raised)",
123
+ color: "var(--color-text-medium)",
124
+ whiteSpace: "pre-wrap",
125
+ wordBreak: "break-word",
126
+ maxHeight: "200px",
127
+ overflow: "auto",
128
+ margin: 0,
129
+ width: "100%"
130
+ }
131
+ }, cycle.diffSummary)
132
+ ),
133
+ // Error
134
+ cycle.error && React.createElement("div", {
135
+ style: { padding: "10px 12px", borderBottom: "1px solid var(--color-border-default)" }
136
+ }, React.createElement(Typography, { variant: "smallCaption-regular", color: "color-status-negative" }, cycle.error)),
137
+ // Rollback action
138
+ cycle.outcome === "applied" && React.createElement(
139
+ Flex,
140
+ {
141
+ variant: "row-center-start-nowrap-8",
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
+ )
153
+ );
154
+ }
155
+ var genesis_block_default = GenesisBlock;
@@ -0,0 +1,82 @@
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/queue-input.tsx
21
+ var queue_input_exports = {};
22
+ __export(queue_input_exports, {
23
+ QueueInput: () => QueueInput,
24
+ default: () => queue_input_default
25
+ });
26
+ module.exports = __toCommonJS(queue_input_exports);
27
+ var React = require("react");
28
+ var { useState, useCallback } = React;
29
+ var { Flex, IconButton, Input, toast } = require("@fw/plugin-ui-kit");
30
+ function QueueInput({ callTool, onTaskAdded }) {
31
+ const [newTask, setNewTask] = useState("");
32
+ const [adding, setAdding] = useState(false);
33
+ const handleAdd = useCallback(async () => {
34
+ const instruction = newTask.trim();
35
+ if (!instruction) return;
36
+ setAdding(true);
37
+ try {
38
+ await callTool("fw_weaver_queue", { action: "add", task: instruction });
39
+ setNewTask("");
40
+ onTaskAdded?.();
41
+ toast("Task added to queue", { type: "success" });
42
+ } catch (err) {
43
+ toast(err instanceof Error ? err.message : "Failed to add task", { type: "error" });
44
+ }
45
+ setAdding(false);
46
+ }, [callTool, newTask, onTaskAdded]);
47
+ return React.createElement(
48
+ Flex,
49
+ {
50
+ variant: "row-center-start-nowrap-6",
51
+ style: {
52
+ flexShrink: 0,
53
+ padding: "8px 16px",
54
+ borderTop: "1px solid var(--color-border-default)",
55
+ width: "100%",
56
+ boxSizing: "border-box"
57
+ }
58
+ },
59
+ React.createElement(Input, {
60
+ type: "text",
61
+ size: "medium",
62
+ placeholder: "Add a task...",
63
+ value: newTask,
64
+ onChange: setNewTask,
65
+ onEnter: handleAdd,
66
+ disabled: adding,
67
+ defaultBoxStyle: { flex: 1, minWidth: 0 },
68
+ inputBoxStyle: { maxWidth: "none" }
69
+ }),
70
+ React.createElement(IconButton, {
71
+ icon: "add",
72
+ size: "md",
73
+ variant: "fill",
74
+ color: "primary",
75
+ "aria-label": "Add task",
76
+ onClick: handleAdd,
77
+ loading: adding,
78
+ disabled: adding || !newTask.trim()
79
+ })
80
+ );
81
+ }
82
+ var queue_input_default = QueueInput;
@@ -0,0 +1,174 @@
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/session-bar.tsx
21
+ var session_bar_exports = {};
22
+ __export(session_bar_exports, {
23
+ SessionBar: () => SessionBar,
24
+ default: () => session_bar_default
25
+ });
26
+ module.exports = __toCommonJS(session_bar_exports);
27
+ var React = require("react");
28
+ var { useState, useEffect, useCallback, useRef } = React;
29
+ var { Flex, Typography, Icon, Button, Badge, toast, formatDuration, formatCost } = require("@fw/plugin-ui-kit");
30
+ function SessionBar({ callTool, dispatchEvent }) {
31
+ const [session, setSession] = useState(null);
32
+ const [elapsed, setElapsed] = useState(0);
33
+ const [starting, setStarting] = useState(false);
34
+ const [stopping, setStopping] = useState(false);
35
+ const [pausing, setPausing] = useState(false);
36
+ const prevActiveRef = useRef(false);
37
+ const pollStatus = useCallback(async () => {
38
+ try {
39
+ const result = await callTool("fw_weaver_session", { action: "status" });
40
+ const isActive2 = result.status !== "no active session" && result.status !== "idle";
41
+ setSession(isActive2 ? result : null);
42
+ if (prevActiveRef.current && !isActive2) {
43
+ dispatchEvent("fw:refresh-bot-workspace");
44
+ }
45
+ prevActiveRef.current = isActive2;
46
+ } catch {
47
+ }
48
+ }, [callTool, dispatchEvent]);
49
+ useEffect(() => {
50
+ pollStatus();
51
+ const interval = setInterval(pollStatus, 5e3);
52
+ return () => clearInterval(interval);
53
+ }, [pollStatus]);
54
+ useEffect(() => {
55
+ if (!session?.startedAt || session.status === "idle") return;
56
+ const tick = () => setElapsed(Date.now() - (session.startedAt ?? Date.now()));
57
+ tick();
58
+ const interval = setInterval(tick, 1e3);
59
+ return () => clearInterval(interval);
60
+ }, [session?.startedAt, session?.status]);
61
+ const [startError, setStartError] = useState(null);
62
+ const handleStart = useCallback(async () => {
63
+ setStarting(true);
64
+ setStartError(null);
65
+ try {
66
+ const result = await callTool("fw_weaver_session", { action: "start" });
67
+ const data = result;
68
+ if (data?.error) {
69
+ setStartError(data.error);
70
+ toast(data.error, { type: "error" });
71
+ setStarting(false);
72
+ return;
73
+ }
74
+ toast("Session started", { type: "success" });
75
+ dispatchEvent("fw:refresh-bot-workspace");
76
+ await pollStatus();
77
+ } catch (err) {
78
+ const msg = err instanceof Error ? err.message : "Failed to start session";
79
+ setStartError(msg);
80
+ toast(msg, { type: "error" });
81
+ }
82
+ setStarting(false);
83
+ }, [callTool, pollStatus, dispatchEvent]);
84
+ const handleStop = useCallback(async () => {
85
+ setStopping(true);
86
+ try {
87
+ await callTool("fw_weaver_session", { action: "stop" });
88
+ toast("Session ended", { type: "info" });
89
+ await pollStatus();
90
+ } catch (err) {
91
+ toast(err instanceof Error ? err.message : "Failed to stop session", { type: "error" });
92
+ }
93
+ setStopping(false);
94
+ }, [callTool, pollStatus]);
95
+ const handlePause = useCallback(async () => {
96
+ setPausing(true);
97
+ try {
98
+ await callTool("fw_weaver_steer", { command: "pause" });
99
+ toast("Session paused", { type: "info" });
100
+ } catch (err) {
101
+ toast(err instanceof Error ? err.message : "Failed to pause session", { type: "error" });
102
+ }
103
+ setPausing(false);
104
+ }, [callTool]);
105
+ const isActive = session && session.status !== "idle" && session.status !== "no active session";
106
+ if (!isActive) {
107
+ return React.createElement(
108
+ Flex,
109
+ {
110
+ variant: "row-center-space-between-nowrap-10",
111
+ style: { flexShrink: 0, padding: "8px 16px", backgroundColor: "transparent", borderBottom: "1px solid var(--color-border-default)" }
112
+ },
113
+ React.createElement(Icon, { name: "smartToy", size: 14, color: "color-text-subtle" }),
114
+ React.createElement(
115
+ Flex,
116
+ { variant: "row-center-start-nowrap-12", style: { flex: 1, fontSize: "12px" } },
117
+ React.createElement(Typography, {
118
+ variant: "caption-regular",
119
+ color: startError ? "color-status-negative" : "color-text-subtle"
120
+ }, startError ?? "No active session")
121
+ ),
122
+ React.createElement(
123
+ Flex,
124
+ { variant: "row-center-start-nowrap-6", style: { flexShrink: 0 } },
125
+ React.createElement(Button, {
126
+ size: "sm",
127
+ variant: "clear",
128
+ onClick: handleStart,
129
+ loading: starting,
130
+ disabled: starting
131
+ }, "Start Session")
132
+ )
133
+ );
134
+ }
135
+ return React.createElement(
136
+ Flex,
137
+ {
138
+ variant: "row-center-space-between-nowrap-10",
139
+ style: { flexShrink: 0, padding: "8px 16px", backgroundColor: "var(--color-brand-main-alpha-10)", borderBottom: "1px solid var(--color-brand-main)" }
140
+ },
141
+ React.createElement(Badge, { variant: "success" }, "Session"),
142
+ React.createElement(
143
+ Flex,
144
+ {
145
+ variant: "row-center-start-nowrap-12",
146
+ style: { flex: 1, fontSize: "12px", color: "var(--color-text-medium)" }
147
+ },
148
+ session.completedTasks != null && React.createElement("span", null, `${session.completedTasks} tasks done`),
149
+ session.totalCost != null && session.totalCost > 0 && React.createElement("span", null, formatCost(session.totalCost)),
150
+ session.startedAt && React.createElement("span", null, `${formatDuration(elapsed)} elapsed`),
151
+ session.currentTask && React.createElement("span", { style: { opacity: 0.7 } }, `\xB7 ${session.currentTask}`)
152
+ ),
153
+ React.createElement(
154
+ Flex,
155
+ { variant: "row-center-start-nowrap-6", style: { flexShrink: 0 } },
156
+ React.createElement(Button, {
157
+ size: "sm",
158
+ variant: "clear",
159
+ onClick: handlePause,
160
+ loading: pausing,
161
+ disabled: pausing || stopping
162
+ }, "Pause"),
163
+ React.createElement(Button, {
164
+ size: "sm",
165
+ variant: "clear",
166
+ color: "danger",
167
+ onClick: handleStop,
168
+ loading: stopping,
169
+ disabled: stopping || pausing
170
+ }, "End")
171
+ )
172
+ );
173
+ }
174
+ var session_bar_default = SessionBar;
@@ -0,0 +1,104 @@
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/settings-section.tsx
21
+ var settings_section_exports = {};
22
+ __export(settings_section_exports, {
23
+ SettingsSection: () => SettingsSection,
24
+ default: () => settings_section_default
25
+ });
26
+ module.exports = __toCommonJS(settings_section_exports);
27
+ var React = require("react");
28
+ var { useState, useEffect, useCallback } = React;
29
+ var { Flex, Typography, Button, CollapsibleSection, KeyValueRow, toast } = require("@fw/plugin-ui-kit");
30
+ function SettingsSection({ callTool, dispatchEvent }) {
31
+ const [providers, setProviders] = useState([]);
32
+ const [insights, setInsights] = useState(null);
33
+ const handleClear = useCallback(() => {
34
+ if (!confirm("Clear all bot run history? This action cannot be undone.")) return;
35
+ callTool("fw_weaver_history", { clear: true }).then(() => {
36
+ dispatchEvent("fw:refresh-bot-workspace");
37
+ toast("Run history cleared", { type: "success" });
38
+ }).catch(() => {
39
+ toast("Failed to clear history", { type: "error" });
40
+ });
41
+ }, [callTool, dispatchEvent]);
42
+ useEffect(() => {
43
+ Promise.all([
44
+ callTool("fw_weaver_providers"),
45
+ callTool("fw_weaver_insights")
46
+ ]).then(([prov, ins]) => {
47
+ if (prov) setProviders(Array.isArray(prov) ? prov : []);
48
+ if (ins) setInsights(ins);
49
+ });
50
+ }, [callTool]);
51
+ const activeProvider = providers.find((p) => p.envVarsSet) ?? providers[0];
52
+ const trustScore = insights?.trust?.score;
53
+ const trustDisplay = trustScore != null ? (trustScore <= 1 ? (trustScore * 100).toFixed(0) : Math.round(trustScore)) + "%" : "\u2014";
54
+ return React.createElement(
55
+ CollapsibleSection,
56
+ {
57
+ title: "Settings",
58
+ variant: "list",
59
+ defaultExpanded: false
60
+ },
61
+ React.createElement(
62
+ Flex,
63
+ { variant: "column-start-start-nowrap-4", style: { width: "100%" } },
64
+ activeProvider && React.createElement(KeyValueRow, {
65
+ keyName: "Provider",
66
+ value: `${activeProvider.name} (${activeProvider.source})`,
67
+ size: "small"
68
+ }),
69
+ insights?.trust && React.createElement(KeyValueRow, {
70
+ keyName: "Trust",
71
+ value: `Phase ${insights.trust.phase} \xB7 ${trustDisplay}`,
72
+ size: "small"
73
+ }),
74
+ insights?.health && React.createElement(KeyValueRow, {
75
+ keyName: "Health",
76
+ value: `${insights.health.overall}/100`,
77
+ size: "small"
78
+ }),
79
+ insights?.cost && React.createElement(KeyValueRow, {
80
+ keyName: "Cost (7d)",
81
+ value: `$${insights.cost.last7Days?.toFixed(2) ?? "0.00"} \xB7 ${insights.cost.trend ?? "stable"}`,
82
+ size: "small"
83
+ }),
84
+ React.createElement(
85
+ Flex,
86
+ {
87
+ variant: "row-center-space-between-nowrap-8",
88
+ style: { width: "100%", marginTop: "4px" }
89
+ },
90
+ React.createElement(Button, {
91
+ size: "xs",
92
+ variant: "outlined",
93
+ color: "danger",
94
+ onClick: handleClear
95
+ }, "Clear Run History"),
96
+ React.createElement(Typography, {
97
+ variant: "smallCaption-regular",
98
+ color: "color-text-subtle"
99
+ }, "Edit settings in .weaver.json")
100
+ )
101
+ )
102
+ );
103
+ }
104
+ var settings_section_default = SettingsSection;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Steer API for the workspace — sends steering commands via the pack tool API.
3
+ * Uses the workspace context's callTool instead of a hardcoded pack-tool URL.
4
+ */
5
+ export type SteerCommand = 'pause' | 'resume' | 'cancel' | 'redirect';
6
+ export declare function sendSteerCommand(callTool: (tool: string, args?: Record<string, unknown>) => Promise<unknown>, command: SteerCommand, payload?: string): Promise<void>;
7
+ //# sourceMappingURL=steer-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steer-api.d.ts","sourceRoot":"","sources":["../../src/ui/steer-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtE,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,EAC5E,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAKf"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Steer API for the workspace — sends steering commands via the pack tool API.
3
+ * Uses the workspace context's callTool instead of a hardcoded pack-tool URL.
4
+ */
5
+ export async function sendSteerCommand(callTool, command, payload) {
6
+ await callTool('fw_weaver_steer', {
7
+ command,
8
+ ...(payload ? { payload } : {}),
9
+ });
10
+ }
11
+ //# sourceMappingURL=steer-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steer-api.js","sourceRoot":"","sources":["../../src/ui/steer-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAA4E,EAC5E,OAAqB,EACrB,OAAgB;IAEhB,MAAM,QAAQ,CAAC,iBAAiB,EAAE;QAChC,OAAO;QACP,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,85 @@
1
+ interface TimelineEntry {
2
+ id: string;
3
+ timestamp: Date;
4
+ type: 'task-started' | 'node-started' | 'node-completed' | 'node-failed' | 'agent-request' | 'user-action' | 'task-completed' | 'task-failed';
5
+ nodeId?: string;
6
+ label: string;
7
+ detail?: string;
8
+ outputs?: Array<{
9
+ portLabel: string;
10
+ value: unknown;
11
+ }>;
12
+ duration?: number;
13
+ color?: string;
14
+ icon?: string;
15
+ }
16
+ export interface HistoricalTraceEvent {
17
+ type: 'node-start' | 'node-complete' | 'node-error';
18
+ nodeId: string;
19
+ nodeType?: string;
20
+ timestamp: number;
21
+ durationMs?: number;
22
+ error?: string;
23
+ }
24
+ export interface HistoricalStepLog {
25
+ step: string;
26
+ status: 'ok' | 'blocked' | 'error';
27
+ detail?: string;
28
+ }
29
+ export interface HistoricalPlan {
30
+ summary: string;
31
+ steps: Array<{
32
+ id: string;
33
+ operation: string;
34
+ description: string;
35
+ args?: Record<string, unknown>;
36
+ }>;
37
+ }
38
+ export interface HistoricalAuditEvent {
39
+ type: string;
40
+ timestamp: string;
41
+ runId: string;
42
+ data?: Record<string, unknown>;
43
+ }
44
+ export interface HistoricalCostSummary {
45
+ totalInputTokens: number;
46
+ totalOutputTokens: number;
47
+ totalCost: number;
48
+ model: string;
49
+ provider: string;
50
+ entries: Array<{
51
+ step: string;
52
+ model: string;
53
+ estimatedCost: number;
54
+ }>;
55
+ }
56
+ export interface HistoricalRun {
57
+ id: string;
58
+ botId?: string;
59
+ botName?: string;
60
+ workflowFile?: string;
61
+ instruction?: string;
62
+ outcome: string;
63
+ success?: boolean;
64
+ durationMs?: number;
65
+ duration?: number;
66
+ summary?: string;
67
+ outputs?: Record<string, unknown>;
68
+ startedAt?: string;
69
+ finishedAt?: string;
70
+ provider?: string;
71
+ cost?: number;
72
+ trace?: HistoricalTraceEvent[];
73
+ nodeMeta?: Record<string, {
74
+ label?: string;
75
+ color?: string;
76
+ icon?: string;
77
+ }>;
78
+ stepLog?: HistoricalStepLog[];
79
+ plan?: HistoricalPlan;
80
+ costDetail?: HistoricalCostSummary;
81
+ auditTrail?: HistoricalAuditEvent[];
82
+ }
83
+ export declare function traceToTimeline(run: HistoricalRun): TimelineEntry[];
84
+ export {};
85
+ //# sourceMappingURL=trace-to-timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-to-timeline.d.ts","sourceRoot":"","sources":["../../src/ui/trace-to-timeline.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,GAAG,gBAAgB,GAAG,aAAa,CAAC;IAC9I,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,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