@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
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* live status (polls fw_weaver_task_get every 3s), subtask progress for
|
|
6
6
|
* parent tasks, assigned bot, and an "Open Dashboard" button.
|
|
7
7
|
*
|
|
8
|
-
* Runs in the pack sandbox
|
|
8
|
+
* Runs in the pack sandbox.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const { Flex, Typography, StatusIcon, Button } = require('@fw/plugin-ui-kit');
|
|
10
|
+
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
|
11
|
+
import { Flex, Typography, StatusIcon, Button } from '@fw/plugin-ui-kit';
|
|
13
12
|
|
|
14
13
|
// ---------------------------------------------------------------------------
|
|
15
14
|
// Types
|
|
@@ -131,18 +130,20 @@ function ChatTaskResult(props: ChatTaskResultProps | null) {
|
|
|
131
130
|
|
|
132
131
|
// If we couldn't parse a task, show a minimal fallback
|
|
133
132
|
if (!task) {
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
variant
|
|
145
|
-
|
|
133
|
+
return (
|
|
134
|
+
<Flex
|
|
135
|
+
variant="row-center-start-nowrap-10"
|
|
136
|
+
style={{
|
|
137
|
+
borderRadius: 'var(--border-radius-regular)',
|
|
138
|
+
border: '1px solid var(--color-border-default)',
|
|
139
|
+
backgroundColor: 'var(--color-surface-low)',
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
<StatusIcon status="pending" size="sm" />
|
|
143
|
+
<Typography variant="caption-thick" color="color-text-medium">
|
|
144
|
+
Task created
|
|
145
|
+
</Typography>
|
|
146
|
+
</Flex>
|
|
146
147
|
);
|
|
147
148
|
}
|
|
148
149
|
|
|
@@ -163,68 +164,70 @@ function ChatTaskResult(props: ChatTaskResultProps | null) {
|
|
|
163
164
|
});
|
|
164
165
|
}, [openWorkspace, task.id]);
|
|
165
166
|
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
status
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
color
|
|
225
|
-
|
|
226
|
-
|
|
167
|
+
return (
|
|
168
|
+
<Flex
|
|
169
|
+
variant="row-center-start-nowrap-10"
|
|
170
|
+
style={{
|
|
171
|
+
borderRadius: 'var(--border-radius-regular)',
|
|
172
|
+
border: '1px solid var(--color-border-default)',
|
|
173
|
+
backgroundColor: 'var(--color-surface-low)',
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
{/* Status icon */}
|
|
177
|
+
<StatusIcon status={statusToIcon(task.status)} size="sm" />
|
|
178
|
+
|
|
179
|
+
{/* Title + meta column */}
|
|
180
|
+
<Flex
|
|
181
|
+
variant="column-start-start-nowrap-2"
|
|
182
|
+
style={{ flex: 1, minWidth: 0 }}
|
|
183
|
+
>
|
|
184
|
+
{/* Title row */}
|
|
185
|
+
<Typography variant="caption-thick" color="color-text-high" truncate={true}>
|
|
186
|
+
{task.title}
|
|
187
|
+
</Typography>
|
|
188
|
+
|
|
189
|
+
{/* Status + subtask progress + bot */}
|
|
190
|
+
<Flex variant="row-center-start-wrap-8">
|
|
191
|
+
{/* Status label */}
|
|
192
|
+
<Typography
|
|
193
|
+
variant="smallCaption-regular"
|
|
194
|
+
color={
|
|
195
|
+
task.status === 'done' ? 'color-text-positive' :
|
|
196
|
+
task.status === 'cancelled' ? 'color-text-negative' :
|
|
197
|
+
task.status === 'in-progress' ? 'color-text-info' :
|
|
198
|
+
'color-text-medium'
|
|
199
|
+
}
|
|
200
|
+
>
|
|
201
|
+
{statusLabel(task.status)}
|
|
202
|
+
</Typography>
|
|
203
|
+
|
|
204
|
+
{/* Subtask progress */}
|
|
205
|
+
{hasSubtasks && (
|
|
206
|
+
<Typography variant="smallCaption-regular" color="color-text-medium">
|
|
207
|
+
{`${doneCount}/${totalCount} done`}
|
|
208
|
+
</Typography>
|
|
209
|
+
)}
|
|
210
|
+
|
|
211
|
+
{/* Bot */}
|
|
212
|
+
{botLabel && (
|
|
213
|
+
<Typography
|
|
214
|
+
variant="smallCaption-regular"
|
|
215
|
+
color="color-text-low"
|
|
216
|
+
truncate={true}
|
|
217
|
+
>
|
|
218
|
+
{botLabel}
|
|
219
|
+
</Typography>
|
|
220
|
+
)}
|
|
221
|
+
</Flex>
|
|
222
|
+
</Flex>
|
|
223
|
+
|
|
224
|
+
{/* Open Dashboard button */}
|
|
225
|
+
<Button size="xs" variant="clear" color="secondary" onClick={handleOpenDashboard}>
|
|
226
|
+
Open Dashboard
|
|
227
|
+
</Button>
|
|
228
|
+
</Flex>
|
|
227
229
|
);
|
|
228
230
|
}
|
|
229
231
|
|
|
230
|
-
|
|
232
|
+
export { ChatTaskResult };
|
|
233
|
+
export default ChatTaskResult;
|
package/src/ui/decision-log.tsx
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Each decision shows timestamp, task title, assigned instance, routing method,
|
|
5
5
|
* and the reasoning. AI-routed decisions also show confidence percentage.
|
|
6
|
-
*
|
|
7
|
-
* Pattern: CommonJS require for platform deps, React.createElement throughout.
|
|
8
6
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import {
|
|
11
9
|
Flex, Typography, ScrollArea, Chip, SectionTitle,
|
|
12
|
-
}
|
|
10
|
+
} from '@fw/plugin-ui-kit';
|
|
13
11
|
|
|
14
12
|
// ---------------------------------------------------------------------------
|
|
15
13
|
// Types
|
|
@@ -68,82 +66,87 @@ function truncate(text: string, max: number): string {
|
|
|
68
66
|
|
|
69
67
|
function DecisionLog({ decisions }: DecisionLogProps) {
|
|
70
68
|
if (!decisions || decisions.length === 0) {
|
|
71
|
-
return
|
|
72
|
-
variant
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
return (
|
|
70
|
+
<Flex variant="column-stretch-start-nowrap-4">
|
|
71
|
+
<SectionTitle>Decision Log</SectionTitle>
|
|
72
|
+
<Typography variant="smallCaption-regular" color="color-text-subtle">
|
|
73
|
+
No routing decisions yet.
|
|
74
|
+
</Typography>
|
|
75
|
+
</Flex>
|
|
78
76
|
);
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
// Show newest first
|
|
82
80
|
const sorted = [...decisions].sort((a, b) => b.timestamp - a.timestamp);
|
|
83
81
|
|
|
84
|
-
return
|
|
85
|
-
variant
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
143
|
-
|
|
82
|
+
return (
|
|
83
|
+
<Flex variant="column-stretch-start-nowrap-4">
|
|
84
|
+
<SectionTitle>Decision Log</SectionTitle>
|
|
85
|
+
<ScrollArea style={{ maxHeight: '260px' }}>
|
|
86
|
+
<Flex variant="column-stretch-start-nowrap-0">
|
|
87
|
+
{sorted.map((d: Decision) => {
|
|
88
|
+
const methodLabel = d.method === 'ai-routed' && d.confidence != null
|
|
89
|
+
? `ai ${d.confidence}%`
|
|
90
|
+
: methodLabels[d.method] || d.method;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Flex
|
|
94
|
+
key={d.id}
|
|
95
|
+
variant="column-stretch-start-nowrap-2"
|
|
96
|
+
style={{
|
|
97
|
+
padding: '6px 8px',
|
|
98
|
+
borderBottom: '1px solid var(--color-border-default)',
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
{/* Main line: time, title, instance, method */}
|
|
102
|
+
<Flex variant="row-center-start-nowrap-8">
|
|
103
|
+
<Typography
|
|
104
|
+
variant="smallCaption-regular"
|
|
105
|
+
color="color-text-subtle"
|
|
106
|
+
style={{ flexShrink: 0, fontFamily: 'var(--font-mono, monospace)', fontSize: '11px' }}
|
|
107
|
+
>
|
|
108
|
+
{formatTime(d.timestamp)}
|
|
109
|
+
</Typography>
|
|
110
|
+
|
|
111
|
+
<Typography
|
|
112
|
+
variant="smallCaption-regular"
|
|
113
|
+
color="color-text-high"
|
|
114
|
+
style={{ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}
|
|
115
|
+
>
|
|
116
|
+
{`"${truncate(d.taskTitle, 40)}"`}
|
|
117
|
+
</Typography>
|
|
118
|
+
|
|
119
|
+
<Typography
|
|
120
|
+
variant="smallCaption-regular"
|
|
121
|
+
color="color-text-medium"
|
|
122
|
+
style={{ flexShrink: 0 }}
|
|
123
|
+
>
|
|
124
|
+
{`\u2192 ${d.assignedInstanceId}`}
|
|
125
|
+
</Typography>
|
|
126
|
+
|
|
127
|
+
<Chip
|
|
128
|
+
label={methodLabel}
|
|
129
|
+
size="small"
|
|
130
|
+
color={methodColors[d.method] || 'color-brand-alt'}
|
|
131
|
+
/>
|
|
132
|
+
</Flex>
|
|
133
|
+
|
|
134
|
+
{/* Reason line */}
|
|
135
|
+
<Typography
|
|
136
|
+
variant="smallCaption-regular"
|
|
137
|
+
color="color-text-subtle"
|
|
138
|
+
style={{ paddingLeft: '70px' }}
|
|
139
|
+
>
|
|
140
|
+
{d.reason}
|
|
141
|
+
</Typography>
|
|
142
|
+
</Flex>
|
|
143
|
+
);
|
|
144
|
+
})}
|
|
145
|
+
</Flex>
|
|
146
|
+
</ScrollArea>
|
|
147
|
+
</Flex>
|
|
144
148
|
);
|
|
145
149
|
}
|
|
146
150
|
|
|
147
151
|
export { DecisionLog };
|
|
148
152
|
export default DecisionLog;
|
|
149
|
-
module.exports = DecisionLog;
|
package/src/ui/genesis-block.tsx
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* GenesisBlock — displays a genesis self-evolution cycle in the timeline.
|
|
3
3
|
* Collapsible: shows summary when collapsed, full proposal + diff when expanded.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { CollapsibleBlock, Flex, Typography, Icon, Badge, Chip, Button, toast, formatTimestamp } = require('@fw/plugin-ui-kit');
|
|
5
|
+
import React, { useState, useCallback } from 'react';
|
|
6
|
+
import { CollapsibleBlock, Flex, Typography, Icon, Badge, Chip, Button, toast, formatTimestamp } from '@fw/plugin-ui-kit';
|
|
8
7
|
|
|
9
8
|
interface GenesisOperation {
|
|
10
9
|
type: string;
|
|
@@ -73,64 +72,95 @@ function GenesisBlock({ cycle, callTool }: GenesisBlockProps) {
|
|
|
73
72
|
const badgeVariant = OUTCOME_BADGE_VARIANTS[cycle.outcome] ?? 'default';
|
|
74
73
|
const status = OUTCOME_STATUS[cycle.outcome] ?? 'pending';
|
|
75
74
|
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
75
|
+
return (
|
|
76
|
+
<CollapsibleBlock
|
|
77
|
+
status={status}
|
|
78
|
+
icon={<Icon name="autorenew" size={14} color="color-brand-main" />}
|
|
79
|
+
label={
|
|
80
|
+
<Typography
|
|
81
|
+
variant="caption-thick"
|
|
82
|
+
color="color-text-high"
|
|
83
|
+
style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 }}
|
|
84
|
+
>
|
|
85
|
+
{summary}
|
|
86
|
+
</Typography>
|
|
87
|
+
}
|
|
88
|
+
headerSuffix={
|
|
89
|
+
<Flex variant="row-center-start-nowrap-8">
|
|
90
|
+
<Typography variant="smallCaption-regular" color="color-text-subtle">
|
|
91
|
+
{formatTimestamp(cycle.timestamp)}
|
|
92
|
+
</Typography>
|
|
93
|
+
<Badge variant={badgeVariant}>{cycle.outcome}</Badge>
|
|
94
|
+
</Flex>
|
|
95
|
+
}
|
|
96
|
+
expanded={expanded}
|
|
97
|
+
onToggle={() => setExpanded((v: boolean) => !v)}
|
|
98
|
+
>
|
|
99
|
+
{/* Proposal */}
|
|
100
|
+
{cycle.proposal && (
|
|
101
|
+
<Flex
|
|
102
|
+
variant="column-start-start-nowrap-6"
|
|
103
|
+
style={{ padding: '10px 12px', borderBottom: '1px solid var(--color-border-default)' }}
|
|
104
|
+
>
|
|
105
|
+
<Typography variant="caption-bold" color="color-text-subtle">
|
|
106
|
+
{`Proposal · ${cycle.proposal.impactLevel}`}
|
|
107
|
+
</Typography>
|
|
108
|
+
<Typography variant="smallCaption-regular" color="color-text-medium">
|
|
109
|
+
{cycle.proposal.rationale}
|
|
110
|
+
</Typography>
|
|
111
|
+
{cycle.proposal.operations.map((op: GenesisOperation, i: number) => (
|
|
112
|
+
<Flex key={i} variant="row-center-start-nowrap-6" style={{ fontSize: '11px' }}>
|
|
113
|
+
<Chip label={op.type} size="small" color="color-status-info" />
|
|
114
|
+
<Typography variant="smallCaption-regular" color="color-text-medium">
|
|
115
|
+
{op.rationale}
|
|
116
|
+
</Typography>
|
|
117
|
+
</Flex>
|
|
118
|
+
))}
|
|
119
|
+
</Flex>
|
|
120
|
+
)}
|
|
121
|
+
{/* Diff */}
|
|
122
|
+
{cycle.diffSummary && (
|
|
123
|
+
<Flex
|
|
124
|
+
variant="column-start-start-nowrap-6"
|
|
125
|
+
style={{ padding: '10px 12px', borderBottom: '1px solid var(--color-border-default)' }}
|
|
126
|
+
>
|
|
127
|
+
<Typography variant="caption-bold" color="color-text-subtle">Changes</Typography>
|
|
128
|
+
<pre
|
|
129
|
+
style={{
|
|
130
|
+
fontSize: '11px', fontFamily: 'monospace', lineHeight: 1.4, padding: '8px',
|
|
131
|
+
borderRadius: 'var(--border-radius-compact, 4px)', backgroundColor: 'var(--color-surface-raised)',
|
|
132
|
+
color: 'var(--color-text-medium)', whiteSpace: 'pre-wrap', wordBreak: 'break-word',
|
|
133
|
+
maxHeight: '200px', overflow: 'auto', margin: 0, width: '100%',
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
{cycle.diffSummary}
|
|
137
|
+
</pre>
|
|
138
|
+
</Flex>
|
|
139
|
+
)}
|
|
140
|
+
{/* Error */}
|
|
141
|
+
{cycle.error && (
|
|
142
|
+
<div style={{ padding: '10px 12px', borderBottom: '1px solid var(--color-border-default)' }}>
|
|
143
|
+
<Typography variant="smallCaption-regular" color="color-status-negative">
|
|
144
|
+
{cycle.error}
|
|
145
|
+
</Typography>
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
{/* Rollback action */}
|
|
149
|
+
{cycle.outcome === 'applied' && (
|
|
150
|
+
<Flex variant="row-center-start-nowrap-8" style={{ padding: '10px 12px' }}>
|
|
151
|
+
<Button
|
|
152
|
+
size="xs"
|
|
153
|
+
variant="outlined"
|
|
154
|
+
color="danger"
|
|
155
|
+
onClick={handleRollback}
|
|
156
|
+
loading={rollingBack}
|
|
157
|
+
disabled={rollingBack}
|
|
158
|
+
>
|
|
159
|
+
Rollback
|
|
160
|
+
</Button>
|
|
161
|
+
</Flex>
|
|
162
|
+
)}
|
|
163
|
+
</CollapsibleBlock>
|
|
134
164
|
);
|
|
135
165
|
}
|
|
136
166
|
|