@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,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 React = require("react");
5
- var { useState, useEffect, useCallback, useRef } = React;
6
- var { Flex, Typography, StatusIcon, Button } = require("@fw/plugin-ui-kit");
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 React.createElement(
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
- React.createElement(StatusIcon, { status: "pending", size: "sm" }),
96
- React.createElement(Typography, {
97
- variant: "caption-thick",
98
- color: "color-text-medium"
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 React.createElement(
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
- // Title row
135
- React.createElement(Typography, {
136
- variant: "caption-thick",
137
- color: "color-text-high",
138
- truncate: true
139
- }, task.title),
140
- // Status + subtask progress + bot
141
- React.createElement(
142
- Flex,
143
- {
144
- variant: "row-center-start-wrap-8"
145
- },
146
- // Status label
147
- React.createElement(Typography, {
148
- variant: "smallCaption-regular",
149
- color: task.status === "done" ? "color-text-positive" : task.status === "cancelled" ? "color-text-negative" : task.status === "in-progress" ? "color-text-info" : "color-text-medium"
150
- }, statusLabel(task.status)),
151
- // Subtask progress
152
- hasSubtasks && React.createElement(Typography, {
153
- variant: "smallCaption-regular",
154
- color: "color-text-medium"
155
- }, `${doneCount}/${totalCount} done`),
156
- // Bot
157
- botLabel && React.createElement(Typography, {
158
- variant: "smallCaption-regular",
159
- color: "color-text-low",
160
- truncate: true
161
- }, botLabel)
162
- )
163
- ),
164
- // Open Dashboard button
165
- React.createElement(Button, {
166
- size: "xs",
167
- variant: "clear",
168
- color: "secondary",
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
- module.exports = ChatTaskResult;
180
+ var chat_task_result_default = ChatTaskResult;
@@ -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 React = require("react");
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 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
- );
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 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,
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-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, {
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: { 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(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;
@@ -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 React = require("react");
28
- var { useState, useCallback } = React;
29
- var { CollapsibleBlock, Flex, Typography, Icon, Badge, Chip, Button, toast, formatTimestamp } = require("@fw/plugin-ui-kit");
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 React.createElement(
63
- CollapsibleBlock,
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
63
+ import_plugin_ui_kit.CollapsibleBlock,
64
64
  {
65
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)
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
- // 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(Chip, { label: op.type, size: "small", color: "color-status-info" }),
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
- )
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;