@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.
Files changed (102) hide show
  1. package/dist/ai-chat-provider.d.ts.map +1 -1
  2. package/dist/ai-chat-provider.js +17 -11
  3. package/dist/ai-chat-provider.js.map +1 -1
  4. package/dist/bot/ai-router.js +5 -5
  5. package/dist/bot/ai-router.js.map +1 -1
  6. package/dist/bot/assistant-tools.d.ts.map +1 -1
  7. package/dist/bot/assistant-tools.js +6 -7
  8. package/dist/bot/assistant-tools.js.map +1 -1
  9. package/dist/bot/capability-registry.d.ts.map +1 -1
  10. package/dist/bot/capability-registry.js +37 -14
  11. package/dist/bot/capability-registry.js.map +1 -1
  12. package/dist/bot/dashboard.js +1 -1
  13. package/dist/bot/dashboard.js.map +1 -1
  14. package/dist/bot/index.d.ts +1 -1
  15. package/dist/bot/index.d.ts.map +1 -1
  16. package/dist/bot/index.js.map +1 -1
  17. package/dist/bot/instance-manager.js +3 -3
  18. package/dist/bot/instance-manager.js.map +1 -1
  19. package/dist/bot/profile-store.d.ts.map +1 -1
  20. package/dist/bot/profile-store.js +11 -9
  21. package/dist/bot/profile-store.js.map +1 -1
  22. package/dist/bot/profile-types.d.ts +2 -2
  23. package/dist/bot/profile-types.d.ts.map +1 -1
  24. package/dist/bot/runner.d.ts +1 -0
  25. package/dist/bot/runner.d.ts.map +1 -1
  26. package/dist/bot/runner.js +6 -2
  27. package/dist/bot/runner.js.map +1 -1
  28. package/dist/bot/step-executor.d.ts.map +1 -1
  29. package/dist/bot/step-executor.js +10 -0
  30. package/dist/bot/step-executor.js.map +1 -1
  31. package/dist/bot/swarm-controller.d.ts +3 -5
  32. package/dist/bot/swarm-controller.d.ts.map +1 -1
  33. package/dist/bot/swarm-controller.js +157 -74
  34. package/dist/bot/swarm-controller.js.map +1 -1
  35. package/dist/bot/task-prompt-builder.d.ts +2 -3
  36. package/dist/bot/task-prompt-builder.d.ts.map +1 -1
  37. package/dist/bot/task-prompt-builder.js +81 -67
  38. package/dist/bot/task-prompt-builder.js.map +1 -1
  39. package/dist/bot/task-store.d.ts +3 -3
  40. package/dist/bot/task-store.d.ts.map +1 -1
  41. package/dist/bot/task-store.js +89 -75
  42. package/dist/bot/task-store.js.map +1 -1
  43. package/dist/bot/task-types.d.ts +54 -26
  44. package/dist/bot/task-types.d.ts.map +1 -1
  45. package/dist/bot/task-types.js +6 -2
  46. package/dist/bot/task-types.js.map +1 -1
  47. package/dist/bot/types.d.ts +2 -0
  48. package/dist/bot/types.d.ts.map +1 -1
  49. package/dist/bot/weaver-tools.d.ts.map +1 -1
  50. package/dist/bot/weaver-tools.js +10 -0
  51. package/dist/bot/weaver-tools.js.map +1 -1
  52. package/dist/cli-handlers.d.ts +0 -1
  53. package/dist/cli-handlers.d.ts.map +1 -1
  54. package/dist/cli-handlers.js +5 -9
  55. package/dist/cli-handlers.js.map +1 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/node-types/agent-execute.d.ts.map +1 -1
  60. package/dist/node-types/agent-execute.js +95 -63
  61. package/dist/node-types/agent-execute.js.map +1 -1
  62. package/dist/node-types/plan-task.js +8 -8
  63. package/dist/node-types/plan-task.js.map +1 -1
  64. package/dist/ui/bot-panel.js +1 -1
  65. package/dist/ui/capability-editor.js +37 -14
  66. package/dist/ui/chat-task-result.js +1 -7
  67. package/dist/ui/profile-editor.js +37 -14
  68. package/dist/ui/swarm-controls.js +2 -2
  69. package/dist/ui/swarm-dashboard.js +72 -109
  70. package/dist/ui/task-detail-view.js +21 -42
  71. package/dist/ui/task-editor.js +13 -50
  72. package/dist/ui/task-pool-list.js +0 -2
  73. package/flowweaver.manifest.json +1 -1
  74. package/package.json +1 -1
  75. package/src/ai-chat-provider.ts +15 -11
  76. package/src/bot/ai-router.ts +5 -5
  77. package/src/bot/assistant-tools.ts +6 -7
  78. package/src/bot/capability-registry.ts +37 -14
  79. package/src/bot/dashboard.ts +1 -1
  80. package/src/bot/index.ts +5 -1
  81. package/src/bot/instance-manager.ts +3 -3
  82. package/src/bot/profile-store.ts +12 -10
  83. package/src/bot/profile-types.ts +2 -2
  84. package/src/bot/runner.ts +6 -2
  85. package/src/bot/step-executor.ts +11 -0
  86. package/src/bot/swarm-controller.ts +164 -78
  87. package/src/bot/task-prompt-builder.ts +86 -71
  88. package/src/bot/task-store.ts +101 -78
  89. package/src/bot/task-types.ts +81 -36
  90. package/src/bot/types.ts +2 -0
  91. package/src/bot/weaver-tools.ts +11 -0
  92. package/src/cli-handlers.ts +5 -9
  93. package/src/index.ts +6 -0
  94. package/src/node-types/agent-execute.ts +99 -62
  95. package/src/node-types/plan-task.ts +8 -8
  96. package/src/ui/bot-panel.tsx +3 -3
  97. package/src/ui/chat-task-result.tsx +5 -14
  98. package/src/ui/swarm-controls.tsx +3 -3
  99. package/src/ui/swarm-dashboard.tsx +3 -3
  100. package/src/ui/task-detail-view.tsx +29 -52
  101. package/src/ui/task-editor.tsx +14 -51
  102. package/src/ui/task-pool-list.tsx +1 -3
@@ -29,7 +29,7 @@ interface TaskEditorProps {
29
29
  onDelete?: () => void;
30
30
  }
31
31
 
32
- type TaskStatus = 'open' | 'pending' | 'in-progress' | 'blocked' | 'done' | 'cancelled';
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
- lastError?: string;
50
- runSummaries: unknown[];
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 || maxAttempts !== '3' || budgetTokens || budgetCost);
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, maxAttempts, budgetTokens, budgetCost, taskData]);
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
- runSummaries: [],
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 runSummaries and lastError from existing data)
285
+ // Update context (preserve runHistory from existing data)
303
286
  patch.context = {
304
287
  files,
305
288
  notes: notes.trim(),
306
- runSummaries: taskData?.context?.runSummaries || [],
307
- lastError: taskData?.context?.lastError,
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, maxAttempts, budgetTokens, budgetCost, notes, files, dependsOn, taskData, callTool, onSave]);
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?.lastError && React.createElement(Field, { label: 'Last error', align: 'start' },
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-negative',
577
+ variant: 'smallCaption-regular', color: 'color-status-caution',
615
578
  style: { fontFamily: 'var(--font-mono, monospace)', whiteSpace: 'pre-wrap' },
616
- }, taskData.context.lastError),
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' | 'pending' | 'in-progress' | 'blocked' | 'done' | 'cancelled';
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