@synergenius/flow-weaver-pack-weaver 0.9.159 → 0.9.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-chat-provider.d.ts.map +1 -1
- package/dist/ai-chat-provider.js +17 -11
- package/dist/ai-chat-provider.js.map +1 -1
- package/dist/bot/ai-router.js +5 -5
- package/dist/bot/ai-router.js.map +1 -1
- package/dist/bot/assistant-tools.d.ts.map +1 -1
- package/dist/bot/assistant-tools.js +6 -7
- package/dist/bot/assistant-tools.js.map +1 -1
- package/dist/bot/capability-registry.d.ts.map +1 -1
- package/dist/bot/capability-registry.js +37 -14
- package/dist/bot/capability-registry.js.map +1 -1
- package/dist/bot/dashboard.js +1 -1
- package/dist/bot/dashboard.js.map +1 -1
- package/dist/bot/index.d.ts +1 -1
- package/dist/bot/index.d.ts.map +1 -1
- package/dist/bot/index.js.map +1 -1
- package/dist/bot/instance-manager.js +3 -3
- package/dist/bot/instance-manager.js.map +1 -1
- package/dist/bot/profile-store.d.ts.map +1 -1
- package/dist/bot/profile-store.js +11 -9
- package/dist/bot/profile-store.js.map +1 -1
- package/dist/bot/profile-types.d.ts +2 -2
- package/dist/bot/profile-types.d.ts.map +1 -1
- package/dist/bot/runner.d.ts +1 -0
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +6 -2
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/step-executor.d.ts.map +1 -1
- package/dist/bot/step-executor.js +10 -0
- package/dist/bot/step-executor.js.map +1 -1
- package/dist/bot/swarm-controller.d.ts +3 -5
- package/dist/bot/swarm-controller.d.ts.map +1 -1
- package/dist/bot/swarm-controller.js +157 -74
- package/dist/bot/swarm-controller.js.map +1 -1
- package/dist/bot/task-prompt-builder.d.ts +2 -3
- package/dist/bot/task-prompt-builder.d.ts.map +1 -1
- package/dist/bot/task-prompt-builder.js +81 -67
- package/dist/bot/task-prompt-builder.js.map +1 -1
- package/dist/bot/task-store.d.ts +3 -3
- package/dist/bot/task-store.d.ts.map +1 -1
- package/dist/bot/task-store.js +89 -75
- package/dist/bot/task-store.js.map +1 -1
- package/dist/bot/task-types.d.ts +54 -26
- package/dist/bot/task-types.d.ts.map +1 -1
- package/dist/bot/task-types.js +6 -2
- package/dist/bot/task-types.js.map +1 -1
- package/dist/bot/types.d.ts +2 -0
- 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 +10 -0
- package/dist/bot/weaver-tools.js.map +1 -1
- package/dist/cli-handlers.d.ts +0 -1
- package/dist/cli-handlers.d.ts.map +1 -1
- package/dist/cli-handlers.js +5 -9
- package/dist/cli-handlers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node-types/agent-execute.d.ts.map +1 -1
- package/dist/node-types/agent-execute.js +95 -63
- package/dist/node-types/agent-execute.js.map +1 -1
- package/dist/node-types/plan-task.js +8 -8
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/ui/bot-panel.js +1 -1
- package/dist/ui/capability-editor.js +37 -14
- package/dist/ui/chat-task-result.js +1 -7
- package/dist/ui/profile-editor.js +37 -14
- package/dist/ui/swarm-controls.js +2 -2
- package/dist/ui/swarm-dashboard.js +72 -109
- package/dist/ui/task-detail-view.js +21 -42
- package/dist/ui/task-editor.js +13 -50
- package/dist/ui/task-pool-list.js +0 -2
- package/flowweaver.manifest.json +1 -1
- package/package.json +1 -1
- package/src/ai-chat-provider.ts +15 -11
- package/src/bot/ai-router.ts +5 -5
- package/src/bot/assistant-tools.ts +6 -7
- package/src/bot/capability-registry.ts +37 -14
- package/src/bot/dashboard.ts +1 -1
- package/src/bot/index.ts +5 -1
- package/src/bot/instance-manager.ts +3 -3
- package/src/bot/profile-store.ts +12 -10
- package/src/bot/profile-types.ts +2 -2
- package/src/bot/runner.ts +6 -2
- package/src/bot/step-executor.ts +11 -0
- package/src/bot/swarm-controller.ts +164 -78
- package/src/bot/task-prompt-builder.ts +86 -71
- package/src/bot/task-store.ts +101 -78
- package/src/bot/task-types.ts +81 -36
- package/src/bot/types.ts +2 -0
- package/src/bot/weaver-tools.ts +11 -0
- package/src/cli-handlers.ts +5 -9
- package/src/index.ts +6 -0
- package/src/node-types/agent-execute.ts +99 -62
- package/src/node-types/plan-task.ts +8 -8
- package/src/ui/bot-panel.tsx +3 -3
- package/src/ui/chat-task-result.tsx +5 -14
- package/src/ui/swarm-controls.tsx +3 -3
- package/src/ui/swarm-dashboard.tsx +3 -3
- package/src/ui/task-detail-view.tsx +29 -52
- package/src/ui/task-editor.tsx +14 -51
- package/src/ui/task-pool-list.tsx +1 -3
package/src/ui/task-editor.tsx
CHANGED
|
@@ -29,7 +29,7 @@ interface TaskEditorProps {
|
|
|
29
29
|
onDelete?: () => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
type TaskStatus = 'open' | '
|
|
32
|
+
type TaskStatus = 'open' | 'in-progress' | 'done' | 'cancelled';
|
|
33
33
|
|
|
34
34
|
interface TaskData {
|
|
35
35
|
id: string;
|
|
@@ -39,15 +39,13 @@ interface TaskData {
|
|
|
39
39
|
priority: number;
|
|
40
40
|
complexity?: 'trivial' | 'simple' | 'moderate' | 'complex';
|
|
41
41
|
assignedProfile?: string;
|
|
42
|
-
maxAttempts: number;
|
|
43
|
-
budgetTokens?: number;
|
|
44
42
|
budgetCost?: number;
|
|
45
43
|
dependsOn: string[];
|
|
46
44
|
context: {
|
|
47
45
|
files: string[];
|
|
48
46
|
notes: string;
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
runHistory: unknown[];
|
|
48
|
+
stagnationCount: number;
|
|
51
49
|
};
|
|
52
50
|
tokensUsed: number;
|
|
53
51
|
costUsed: number;
|
|
@@ -78,9 +76,7 @@ const COMPLEXITY_OPTIONS = [
|
|
|
78
76
|
|
|
79
77
|
const STATUS_COLOR: Record<string, string> = {
|
|
80
78
|
'open': 'color-brand-alt',
|
|
81
|
-
'pending': 'color-brand-alt',
|
|
82
79
|
'in-progress': 'color-status-info',
|
|
83
|
-
'blocked': 'color-status-caution',
|
|
84
80
|
'done': 'color-status-positive',
|
|
85
81
|
'cancelled': 'color-status-negative',
|
|
86
82
|
};
|
|
@@ -99,8 +95,6 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
99
95
|
const [priority, setPriority] = useState('0');
|
|
100
96
|
const [complexity, setComplexity] = useState('');
|
|
101
97
|
const [assignedProfile, setAssignedProfile] = useState('');
|
|
102
|
-
const [maxAttempts, setMaxAttempts] = useState('3');
|
|
103
|
-
const [budgetTokens, setBudgetTokens] = useState('');
|
|
104
98
|
const [budgetCost, setBudgetCost] = useState('');
|
|
105
99
|
const [notes, setNotes] = useState('');
|
|
106
100
|
const [files, setFiles] = useState<string[]>([]);
|
|
@@ -167,8 +161,6 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
167
161
|
setPriority(String(t.priority ?? 0));
|
|
168
162
|
setComplexity(t.complexity || '');
|
|
169
163
|
setAssignedProfile(t.assignedProfile || '');
|
|
170
|
-
setMaxAttempts(String(t.maxAttempts ?? 3));
|
|
171
|
-
setBudgetTokens(t.budgetTokens != null ? String(t.budgetTokens) : '');
|
|
172
164
|
setBudgetCost(t.budgetCost != null ? String(t.budgetCost) : '');
|
|
173
165
|
setNotes(t.context?.notes || '');
|
|
174
166
|
setFiles(t.context?.files || []);
|
|
@@ -188,7 +180,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
188
180
|
const isDirty = useCallback(() => {
|
|
189
181
|
if (mode === 'create') {
|
|
190
182
|
return !!(title.trim() || description.trim() || notes.trim() || files.length > 0 || dependsOn.length > 0
|
|
191
|
-
|| priority !== '0' || complexity || assignedProfile ||
|
|
183
|
+
|| priority !== '0' || complexity || assignedProfile || budgetCost);
|
|
192
184
|
}
|
|
193
185
|
// Edit mode: compare against loaded data
|
|
194
186
|
if (!taskData) return false;
|
|
@@ -199,10 +191,8 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
199
191
|
|| priority !== String(taskData.priority ?? 0)
|
|
200
192
|
|| complexity !== (taskData.complexity || '')
|
|
201
193
|
|| assignedProfile !== (taskData.assignedProfile || '')
|
|
202
|
-
|| maxAttempts !== String(taskData.maxAttempts ?? 3)
|
|
203
|
-
|| budgetTokens !== (taskData.budgetTokens != null ? String(taskData.budgetTokens) : '')
|
|
204
194
|
|| budgetCost !== (taskData.budgetCost != null ? String(taskData.budgetCost) : '');
|
|
205
|
-
}, [mode, title, description, notes, files, dependsOn, priority, complexity, assignedProfile,
|
|
195
|
+
}, [mode, title, description, notes, files, dependsOn, priority, complexity, assignedProfile, budgetCost, taskData]);
|
|
206
196
|
|
|
207
197
|
const handleBack = useCallback(async () => {
|
|
208
198
|
if (isDirty()) {
|
|
@@ -252,11 +242,9 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
252
242
|
title: title.trim(),
|
|
253
243
|
description: description.trim(),
|
|
254
244
|
priority: parseInt(priority, 10) || 0,
|
|
255
|
-
maxAttempts: parseInt(maxAttempts, 10) || 3,
|
|
256
245
|
};
|
|
257
246
|
if (complexity) args.complexity = complexity;
|
|
258
247
|
if (assignedProfile) args.assignedProfile = assignedProfile;
|
|
259
|
-
if (budgetTokens) args.budgetTokens = parseInt(budgetTokens, 10);
|
|
260
248
|
if (budgetCost) args.budgetCost = parseFloat(budgetCost);
|
|
261
249
|
if (dependsOn.length > 0) args.dependsOn = dependsOn;
|
|
262
250
|
|
|
@@ -271,7 +259,8 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
271
259
|
context: {
|
|
272
260
|
notes: notes.trim(),
|
|
273
261
|
files,
|
|
274
|
-
|
|
262
|
+
runHistory: [],
|
|
263
|
+
stagnationCount: 0,
|
|
275
264
|
},
|
|
276
265
|
});
|
|
277
266
|
}
|
|
@@ -284,27 +273,21 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
284
273
|
title: title.trim(),
|
|
285
274
|
description: description.trim(),
|
|
286
275
|
priority: parseInt(priority, 10) || 0,
|
|
287
|
-
maxAttempts: parseInt(maxAttempts, 10) || 3,
|
|
288
276
|
complexity: complexity || undefined,
|
|
289
277
|
assignedProfile: assignedProfile || null,
|
|
290
278
|
};
|
|
291
|
-
if (budgetTokens) {
|
|
292
|
-
patch.budgetTokens = parseInt(budgetTokens, 10);
|
|
293
|
-
} else {
|
|
294
|
-
patch.budgetTokens = undefined;
|
|
295
|
-
}
|
|
296
279
|
if (budgetCost) {
|
|
297
280
|
patch.budgetCost = parseFloat(budgetCost);
|
|
298
281
|
} else {
|
|
299
282
|
patch.budgetCost = undefined;
|
|
300
283
|
}
|
|
301
284
|
|
|
302
|
-
// Update context (preserve
|
|
285
|
+
// Update context (preserve runHistory from existing data)
|
|
303
286
|
patch.context = {
|
|
304
287
|
files,
|
|
305
288
|
notes: notes.trim(),
|
|
306
|
-
|
|
307
|
-
|
|
289
|
+
runHistory: taskData?.context?.runHistory || [],
|
|
290
|
+
stagnationCount: (taskData?.context as Record<string, unknown>)?.stagnationCount ?? 0,
|
|
308
291
|
};
|
|
309
292
|
|
|
310
293
|
await callTool('fw_weaver_task_update', patch);
|
|
@@ -314,7 +297,7 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
314
297
|
} catch (err: unknown) {
|
|
315
298
|
toast(err instanceof Error ? err.message : `Failed to ${mode} task`, { type: 'error' });
|
|
316
299
|
}
|
|
317
|
-
}, [mode, taskId, title, description, priority, complexity, assignedProfile,
|
|
300
|
+
}, [mode, taskId, title, description, priority, complexity, assignedProfile, budgetCost, notes, files, dependsOn, taskData, callTool, onSave]);
|
|
318
301
|
|
|
319
302
|
// --- Delete (cancel task) ---
|
|
320
303
|
const handleDelete = useCallback(async () => {
|
|
@@ -450,26 +433,6 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
450
433
|
}),
|
|
451
434
|
),
|
|
452
435
|
|
|
453
|
-
// -- Max Attempts --
|
|
454
|
-
React.createElement(Field, { label: 'Max Attempts' },
|
|
455
|
-
React.createElement(Input, {
|
|
456
|
-
type: 'number', size: 'small',
|
|
457
|
-
placeholder: '3',
|
|
458
|
-
value: maxAttempts,
|
|
459
|
-
onChange: (v: string) => setMaxAttempts(v),
|
|
460
|
-
}),
|
|
461
|
-
),
|
|
462
|
-
|
|
463
|
-
// -- Budget Tokens --
|
|
464
|
-
React.createElement(Field, { label: 'Budget Tokens' },
|
|
465
|
-
React.createElement(Input, {
|
|
466
|
-
type: 'number', size: 'small',
|
|
467
|
-
placeholder: 'Optional token limit',
|
|
468
|
-
value: budgetTokens,
|
|
469
|
-
onChange: (v: string) => setBudgetTokens(v),
|
|
470
|
-
}),
|
|
471
|
-
),
|
|
472
|
-
|
|
473
436
|
// -- Budget Cost --
|
|
474
437
|
React.createElement(Field, { label: 'Budget Cost' },
|
|
475
438
|
React.createElement(Input, {
|
|
@@ -609,11 +572,11 @@ function TaskEditor({ mode, taskId, onSave, onCancel, onDelete }: TaskEditorProp
|
|
|
609
572
|
React.createElement(Typography, { variant: 'smallCaption-regular', color: 'color-text-medium' },
|
|
610
573
|
`$${(taskData.costUsed ?? 0).toFixed(3)}`),
|
|
611
574
|
),
|
|
612
|
-
taskData.context?.
|
|
575
|
+
(taskData.context?.runHistory as Array<{ remainingWork?: string }> | undefined)?.slice(-1)?.[0]?.remainingWork && React.createElement(Field, { label: 'Remaining work', align: 'start' },
|
|
613
576
|
React.createElement(Typography, {
|
|
614
|
-
variant: 'smallCaption-regular', color: 'color-status-
|
|
577
|
+
variant: 'smallCaption-regular', color: 'color-status-caution',
|
|
615
578
|
style: { fontFamily: 'var(--font-mono, monospace)', whiteSpace: 'pre-wrap' },
|
|
616
|
-
}, taskData.context.
|
|
579
|
+
}, (taskData.context.runHistory as Array<{ remainingWork?: string }>).slice(-1)[0]?.remainingWork),
|
|
617
580
|
),
|
|
618
581
|
),
|
|
619
582
|
|
|
@@ -11,7 +11,7 @@ const { Flex, Typography, Icon, StatusIcon, Chip, ScrollArea, Badge, EmptyState
|
|
|
11
11
|
|
|
12
12
|
// --- Types ---
|
|
13
13
|
|
|
14
|
-
type TaskStatus = 'open' | '
|
|
14
|
+
type TaskStatus = 'open' | 'in-progress' | 'done' | 'cancelled';
|
|
15
15
|
|
|
16
16
|
interface Task {
|
|
17
17
|
id: string;
|
|
@@ -33,10 +33,8 @@ interface TaskPoolListProps {
|
|
|
33
33
|
|
|
34
34
|
const statusToIcon: Record<TaskStatus, string> = {
|
|
35
35
|
'open': 'pending',
|
|
36
|
-
'pending': 'pending',
|
|
37
36
|
'in-progress': 'running',
|
|
38
37
|
'done': 'completed',
|
|
39
|
-
'blocked': 'pending',
|
|
40
38
|
'cancelled': 'failed',
|
|
41
39
|
};
|
|
42
40
|
|