@synergenius/flow-weaver-pack-weaver 0.9.152 → 0.9.153

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 (93) hide show
  1. package/dist/ai-chat-provider.js +4 -4
  2. package/dist/ai-chat-provider.js.map +1 -1
  3. package/dist/bot/ai-client.d.ts +30 -0
  4. package/dist/bot/ai-client.d.ts.map +1 -1
  5. package/dist/bot/ai-client.js +37 -0
  6. package/dist/bot/ai-client.js.map +1 -1
  7. package/dist/bot/behavior-defaults.d.ts.map +1 -1
  8. package/dist/bot/behavior-defaults.js +7 -2
  9. package/dist/bot/behavior-defaults.js.map +1 -1
  10. package/dist/bot/capability-registry.d.ts.map +1 -1
  11. package/dist/bot/capability-registry.js +46 -33
  12. package/dist/bot/capability-registry.js.map +1 -1
  13. package/dist/bot/file-validator.d.ts +7 -0
  14. package/dist/bot/file-validator.d.ts.map +1 -1
  15. package/dist/bot/file-validator.js +76 -0
  16. package/dist/bot/file-validator.js.map +1 -1
  17. package/dist/bot/instance-manager.d.ts +22 -7
  18. package/dist/bot/instance-manager.d.ts.map +1 -1
  19. package/dist/bot/instance-manager.js +69 -7
  20. package/dist/bot/instance-manager.js.map +1 -1
  21. package/dist/bot/orchestrator.d.ts +11 -9
  22. package/dist/bot/orchestrator.d.ts.map +1 -1
  23. package/dist/bot/orchestrator.js +56 -107
  24. package/dist/bot/orchestrator.js.map +1 -1
  25. package/dist/bot/runner.d.ts +29 -0
  26. package/dist/bot/runner.d.ts.map +1 -1
  27. package/dist/bot/runner.js +114 -73
  28. package/dist/bot/runner.js.map +1 -1
  29. package/dist/bot/step-executor.d.ts.map +1 -1
  30. package/dist/bot/step-executor.js +28 -9
  31. package/dist/bot/step-executor.js.map +1 -1
  32. package/dist/bot/swarm-controller.d.ts +7 -6
  33. package/dist/bot/swarm-controller.d.ts.map +1 -1
  34. package/dist/bot/swarm-controller.js +64 -74
  35. package/dist/bot/swarm-controller.js.map +1 -1
  36. package/dist/bot/task-types.d.ts +1 -0
  37. package/dist/bot/task-types.d.ts.map +1 -1
  38. package/dist/bot/weaver-tools.d.ts +1 -1
  39. package/dist/bot/weaver-tools.d.ts.map +1 -1
  40. package/dist/bot/weaver-tools.js +6 -1
  41. package/dist/bot/weaver-tools.js.map +1 -1
  42. package/dist/node-types/agent-execute.js +2 -2
  43. package/dist/node-types/agent-execute.js.map +1 -1
  44. package/dist/node-types/bot-report.d.ts.map +1 -1
  45. package/dist/node-types/bot-report.js +5 -2
  46. package/dist/node-types/bot-report.js.map +1 -1
  47. package/dist/node-types/build-context.js +2 -1
  48. package/dist/node-types/build-context.js.map +1 -1
  49. package/dist/node-types/exec-validate-retry.d.ts +3 -3
  50. package/dist/node-types/exec-validate-retry.d.ts.map +1 -1
  51. package/dist/node-types/exec-validate-retry.js +13 -184
  52. package/dist/node-types/exec-validate-retry.js.map +1 -1
  53. package/dist/node-types/load-config.d.ts +1 -0
  54. package/dist/node-types/load-config.d.ts.map +1 -1
  55. package/dist/node-types/load-config.js +1 -0
  56. package/dist/node-types/load-config.js.map +1 -1
  57. package/dist/node-types/plan-task.d.ts +7 -5
  58. package/dist/node-types/plan-task.d.ts.map +1 -1
  59. package/dist/node-types/plan-task.js +282 -83
  60. package/dist/node-types/plan-task.js.map +1 -1
  61. package/dist/ui/bot-panel.js +1 -1
  62. package/dist/ui/capability-editor.js +46 -33
  63. package/dist/ui/profile-editor.js +44 -31
  64. package/dist/ui/swarm-dashboard.js +69 -36
  65. package/dist/ui/task-detail-view.js +22 -2
  66. package/dist/workflows/weaver-bot.d.ts +2 -2
  67. package/dist/workflows/weaver-bot.d.ts.map +1 -1
  68. package/dist/workflows/weaver-bot.js +5 -4
  69. package/dist/workflows/weaver-bot.js.map +1 -1
  70. package/flowweaver.manifest.json +1 -1
  71. package/package.json +1 -1
  72. package/src/ai-chat-provider.ts +4 -4
  73. package/src/bot/ai-client.ts +65 -0
  74. package/src/bot/behavior-defaults.ts +5 -2
  75. package/src/bot/capability-registry.ts +46 -33
  76. package/src/bot/file-validator.ts +97 -0
  77. package/src/bot/instance-manager.ts +77 -7
  78. package/src/bot/orchestrator.ts +63 -126
  79. package/src/bot/runner.ts +124 -70
  80. package/src/bot/step-executor.ts +30 -9
  81. package/src/bot/swarm-controller.ts +65 -76
  82. package/src/bot/task-types.ts +1 -0
  83. package/src/bot/weaver-tools.ts +7 -1
  84. package/src/node-types/agent-execute.ts +2 -2
  85. package/src/node-types/bot-report.ts +5 -2
  86. package/src/node-types/build-context.ts +2 -1
  87. package/src/node-types/exec-validate-retry.ts +14 -203
  88. package/src/node-types/load-config.ts +1 -0
  89. package/src/node-types/plan-task.ts +313 -88
  90. package/src/ui/bot-panel.tsx +1 -1
  91. package/src/ui/swarm-dashboard.tsx +3 -3
  92. package/src/ui/task-detail-view.tsx +25 -2
  93. package/src/workflows/weaver-bot.ts +5 -4
@@ -247,35 +247,28 @@ var CAP_ROLE_ORCHESTRATOR = {
247
247
  You DECOMPOSE and ASSIGN. You never write code or create files directly.
248
248
 
249
249
  Your job:
250
- 1. Analyze the objective and understand the project scope
251
- 2. Create a PROJECT BRIEF (a concise description of what we're building, how pieces connect, conventions to follow)
252
- 3. Break the objective into focused subtasks using task_create. The prompt contains "Task ID: <id>" \u2014 use that exact ID value as parentId in every task_create call so subtasks appear as children.
253
- 4. ALWAYS set assignedProfile on every subtask to one of these three:
254
- - "developer" \u2192 code writing, file creation, implementation
255
- - "reviewer" \u2192 code review, quality checks, security audit
256
- - "ops" \u2192 project setup, dependencies, config, infrastructure
257
- NEVER set assignedProfile to "orchestrator". You are the orchestrator \u2014 assigning to yourself creates an infinite loop. Only "developer", "reviewer", or "ops".
258
- 5. Set dependencies so tasks execute in the right order
259
- Use the EXACT title of a previous subtask as the dependsOn value. The system resolves titles to real task IDs at execution time. Example: dependsOn: ["Setup: Initialize project structure"]
260
- 6. Include the project brief in every subtask's description
250
+ 1. Analyze the objective
251
+ 2. Break it into focused subtasks via task_create. Set parentId to "@self" on every subtask.
252
+ 3. ALWAYS set assignedProfile: "developer", "reviewer", or "ops".
253
+ NEVER set assignedProfile to "orchestrator" \u2014 assigning to yourself creates an infinite loop.
254
+ 4. Use the EXACT title of a previous subtask as dependsOn. The system resolves titles to real task IDs.
255
+ 5. Include a project brief in every subtask: "PROJECT: [what]. FILES: [exact paths from workspace root]. CONVENTIONS: [patterns]."
261
256
 
262
- CRITICAL: You do NOT have write_file, patch_file, or run_shell. You cannot execute code \u2014 only plan and delegate to developer/reviewer/ops.
257
+ CRITICAL: You do NOT have write_file, patch_file, or run_shell. Only plan and delegate.
263
258
 
264
- ### Project Brief Format
265
- Include this at the TOP of every subtask description:
266
- "PROJECT: [what we're building]. STRUCTURE: [file layout]. CONVENTIONS: [naming, patterns, exports]."
259
+ ### Design Phase (MANDATORY)
260
+ Your FIRST subtask MUST be a design task assigned to ops that creates a .design.md file in the project root. This is the single source of truth. It must contain:
261
+ - Module map, TypeScript interfaces (copy-paste ready), export contracts (function signatures)
262
+ - Dependency graph, conventions (naming, error handling, patterns)
263
+ Every subsequent developer task MUST read .design.md before writing code.
267
264
 
268
265
  ### Subtask Quality
269
- Each subtask must be:
270
- - Focused (one file or one concern)
271
- - Self-contained (has enough context to execute independently)
272
- - Properly routed (assignedProfile is set)
273
- - Ordered (dependsOn reflects real dependencies)
266
+ Each subtask: focused (one concern), self-contained, properly routed, ordered by dependsOn.
274
267
 
275
268
  ### Example
276
- For a task with Task ID "abc123":
277
- { operation: "task_create", args: { title: "Setup project", parentId: "abc123", assignedProfile: "ops", dependsOn: [] } }
278
- { operation: "task_create", args: { title: "Write code", parentId: "abc123", assignedProfile: "developer", dependsOn: ["Setup project"] } }`
269
+ { operation: "task_create", args: { title: "Design: Create project contract", parentId: "@self", assignedProfile: "ops", complexity: "complex", description: "Create todo-app/.design.md with module map, TypeScript interfaces, export contracts.", dependsOn: [] } }
270
+ { operation: "task_create", args: { title: "Setup project", parentId: "@self", assignedProfile: "ops", dependsOn: ["Design: Create project contract"] } }
271
+ { operation: "task_create", args: { title: "Write code", parentId: "@self", assignedProfile: "developer", dependsOn: ["Setup project"] } }`
279
272
  };
280
273
  var CAP_ROLE_DEVELOPER = {
281
274
  name: "role-developer",
@@ -284,17 +277,28 @@ var CAP_ROLE_DEVELOPER = {
284
277
  You WRITE CODE. Execute the task directly using write_file, patch_file, and run_shell.
285
278
 
286
279
  Your job:
287
- 1. Read the task description (including the project brief)
288
- 2. Create a plan with CONCRETE file operations (write_file, patch_file, run_shell)
289
- 3. Execute every step \u2014 produce actual files on disk
290
- 4. Verify your work compiles and is correct
280
+ 1. Read .design.md in the project root to understand interfaces and contracts
281
+ 2. Read files created by previous tasks (your dependencies are done \u2014 their files are on disk)
282
+ 3. Write code that MATCHES the contracts in .design.md exactly \u2014 same types, same function signatures, same exports
283
+ 4. Verify your imports resolve to real exports in existing files
291
284
 
292
285
  You do NOT have task_create. You cannot create subtasks or delegate.
293
286
  If the task seems too large, do your best \u2014 the orchestrator already decomposed it for you.
294
287
 
288
+ ### File Paths
289
+ All paths in write_file/patch_file are RELATIVE TO THE WORKSPACE ROOT. If the task says "inside todo-app/", your paths MUST start with todo-app/ (e.g., todo-app/src/cli.ts, NOT src/cli.ts).
290
+
291
+ ### Code Quality
292
+ - Write COMPLETE, WORKING code. No TODOs, no placeholders, no empty function bodies, no "// implement later".
293
+ - Every function must be fully implemented with real logic.
294
+ - Use proper TypeScript types. Use strict mode patterns.
295
+ - Export everything that other files will import.
296
+ - Handle edge cases (empty input, file not found, invalid args).
297
+ - Use ESM-compatible patterns: import.meta.url instead of __dirname, import.meta.filename instead of __filename. Use fileURLToPath(import.meta.url) for path resolution.
298
+
295
299
  ### Output Requirements
296
300
  Your plan MUST include at least one write_file, patch_file, or run_shell step.
297
- A plan with only "respond" steps is a FAILURE \u2014 you must produce artifacts.`
301
+ A plan with only read_file, list_files, or respond steps is a FAILURE \u2014 you must produce artifacts.`
298
302
  };
299
303
  var CAP_ROLE_REVIEWER = {
300
304
  name: "role-reviewer",
@@ -318,10 +322,19 @@ var CAP_ROLE_OPS = {
318
322
  You SET UP infrastructure \u2014 package.json, tsconfig.json, directory structure, dependencies.
319
323
 
320
324
  Your job:
321
- 1. Initialize project structure (create config files, directories)
322
- 2. Install dependencies with run_shell
323
- 3. Ensure the project builds and tests can run
325
+ 1. Create the project directory first: run_shell with mkdir -p <project>/src
326
+ 2. Write config files (package.json, tsconfig.json) using write_file
327
+ 3. Install dependencies with run_shell (npm install)
328
+ 4. Ensure the project structure is ready for developers
329
+
330
+ ### File Paths
331
+ All paths are RELATIVE TO THE WORKSPACE ROOT. If the project is in a subfolder (e.g., todo-app/), ALL your paths must include that prefix: todo-app/package.json, todo-app/tsconfig.json, todo-app/src/.
324
332
 
333
+ ### Design Tasks
334
+ When the task is a Design task, create a .design.md file with detailed TypeScript interfaces, module exports, and dependency graph. This file must contain copy-paste ready interface definitions that developers will implement exactly.
335
+
336
+ ### Output Requirements
337
+ Your plan MUST include write_file and/or run_shell steps that create real files.
325
338
  You do NOT have task_create. You execute infrastructure tasks directly.`
326
339
  };
327
340
  var CAP_FILE_OPS = {
@@ -943,6 +943,25 @@ function TaskDetailView({ taskId, onBack, onEdit }) {
943
943
  if (!data) return;
944
944
  const t = data.task ?? data;
945
945
  setTask(t);
946
+ const rs = t.context;
947
+ const summaries = rs?.runSummaries;
948
+ if (summaries?.length) {
949
+ setHistory((prev) => {
950
+ if (prev.length > 0) return prev;
951
+ return summaries.map((s) => ({
952
+ id: s.runId,
953
+ runId: s.runId,
954
+ outcome: s.outcome,
955
+ summary: s.summary,
956
+ report: s.report,
957
+ filesModified: s.filesModified,
958
+ durationMs: s.durationMs,
959
+ cost: s.cost,
960
+ tokensUsed: s.tokensUsed,
961
+ error: s.error
962
+ }));
963
+ });
964
+ }
946
965
  if (data.subtasks && Array.isArray(data.subtasks)) {
947
966
  setSubtasks(data.subtasks);
948
967
  } else if (t.isParent) {
@@ -959,13 +978,14 @@ function TaskDetailView({ taskId, onBack, onEdit }) {
959
978
  try {
960
979
  const raw = await callTool("fw_weaver_history", { taskId });
961
980
  const data = typeof raw === "string" ? JSON.parse(raw) : raw;
962
- if (Array.isArray(data)) {
981
+ if (Array.isArray(data) && data.length > 0) {
963
982
  setHistory(
964
983
  data.map((r) => {
965
984
  const costObj = r.cost && typeof r.cost === "object" ? r.cost : void 0;
966
985
  return { ...r, costDetail: costObj, cost: costObj?.totalCost };
967
986
  })
968
987
  );
988
+ return;
969
989
  }
970
990
  } catch {
971
991
  }
@@ -1380,7 +1400,7 @@ function TaskDetailView({ taskId, onBack, onEdit }) {
1380
1400
  React6.createElement(
1381
1401
  Flex5,
1382
1402
  { variant: "row-center-start-nowrap-6" },
1383
- task.status === "failed" && React6.createElement(Button2, {
1403
+ (task.status === "failed" || task.status === "open" && task.attempt >= task.maxAttempts) && React6.createElement(Button2, {
1384
1404
  size: "xs",
1385
1405
  variant: "fill",
1386
1406
  color: "primary",
@@ -2738,35 +2758,28 @@ var CAP_ROLE_ORCHESTRATOR = {
2738
2758
  You DECOMPOSE and ASSIGN. You never write code or create files directly.
2739
2759
 
2740
2760
  Your job:
2741
- 1. Analyze the objective and understand the project scope
2742
- 2. Create a PROJECT BRIEF (a concise description of what we're building, how pieces connect, conventions to follow)
2743
- 3. Break the objective into focused subtasks using task_create. The prompt contains "Task ID: <id>" \u2014 use that exact ID value as parentId in every task_create call so subtasks appear as children.
2744
- 4. ALWAYS set assignedProfile on every subtask to one of these three:
2745
- - "developer" \u2192 code writing, file creation, implementation
2746
- - "reviewer" \u2192 code review, quality checks, security audit
2747
- - "ops" \u2192 project setup, dependencies, config, infrastructure
2748
- NEVER set assignedProfile to "orchestrator". You are the orchestrator \u2014 assigning to yourself creates an infinite loop. Only "developer", "reviewer", or "ops".
2749
- 5. Set dependencies so tasks execute in the right order
2750
- Use the EXACT title of a previous subtask as the dependsOn value. The system resolves titles to real task IDs at execution time. Example: dependsOn: ["Setup: Initialize project structure"]
2751
- 6. Include the project brief in every subtask's description
2761
+ 1. Analyze the objective
2762
+ 2. Break it into focused subtasks via task_create. Set parentId to "@self" on every subtask.
2763
+ 3. ALWAYS set assignedProfile: "developer", "reviewer", or "ops".
2764
+ NEVER set assignedProfile to "orchestrator" \u2014 assigning to yourself creates an infinite loop.
2765
+ 4. Use the EXACT title of a previous subtask as dependsOn. The system resolves titles to real task IDs.
2766
+ 5. Include a project brief in every subtask: "PROJECT: [what]. FILES: [exact paths from workspace root]. CONVENTIONS: [patterns]."
2752
2767
 
2753
- CRITICAL: You do NOT have write_file, patch_file, or run_shell. You cannot execute code \u2014 only plan and delegate to developer/reviewer/ops.
2768
+ CRITICAL: You do NOT have write_file, patch_file, or run_shell. Only plan and delegate.
2754
2769
 
2755
- ### Project Brief Format
2756
- Include this at the TOP of every subtask description:
2757
- "PROJECT: [what we're building]. STRUCTURE: [file layout]. CONVENTIONS: [naming, patterns, exports]."
2770
+ ### Design Phase (MANDATORY)
2771
+ Your FIRST subtask MUST be a design task assigned to ops that creates a .design.md file in the project root. This is the single source of truth. It must contain:
2772
+ - Module map, TypeScript interfaces (copy-paste ready), export contracts (function signatures)
2773
+ - Dependency graph, conventions (naming, error handling, patterns)
2774
+ Every subsequent developer task MUST read .design.md before writing code.
2758
2775
 
2759
2776
  ### Subtask Quality
2760
- Each subtask must be:
2761
- - Focused (one file or one concern)
2762
- - Self-contained (has enough context to execute independently)
2763
- - Properly routed (assignedProfile is set)
2764
- - Ordered (dependsOn reflects real dependencies)
2777
+ Each subtask: focused (one concern), self-contained, properly routed, ordered by dependsOn.
2765
2778
 
2766
2779
  ### Example
2767
- For a task with Task ID "abc123":
2768
- { operation: "task_create", args: { title: "Setup project", parentId: "abc123", assignedProfile: "ops", dependsOn: [] } }
2769
- { operation: "task_create", args: { title: "Write code", parentId: "abc123", assignedProfile: "developer", dependsOn: ["Setup project"] } }`
2780
+ { operation: "task_create", args: { title: "Design: Create project contract", parentId: "@self", assignedProfile: "ops", complexity: "complex", description: "Create todo-app/.design.md with module map, TypeScript interfaces, export contracts.", dependsOn: [] } }
2781
+ { operation: "task_create", args: { title: "Setup project", parentId: "@self", assignedProfile: "ops", dependsOn: ["Design: Create project contract"] } }
2782
+ { operation: "task_create", args: { title: "Write code", parentId: "@self", assignedProfile: "developer", dependsOn: ["Setup project"] } }`
2770
2783
  };
2771
2784
  var CAP_ROLE_DEVELOPER = {
2772
2785
  name: "role-developer",
@@ -2775,17 +2788,28 @@ var CAP_ROLE_DEVELOPER = {
2775
2788
  You WRITE CODE. Execute the task directly using write_file, patch_file, and run_shell.
2776
2789
 
2777
2790
  Your job:
2778
- 1. Read the task description (including the project brief)
2779
- 2. Create a plan with CONCRETE file operations (write_file, patch_file, run_shell)
2780
- 3. Execute every step \u2014 produce actual files on disk
2781
- 4. Verify your work compiles and is correct
2791
+ 1. Read .design.md in the project root to understand interfaces and contracts
2792
+ 2. Read files created by previous tasks (your dependencies are done \u2014 their files are on disk)
2793
+ 3. Write code that MATCHES the contracts in .design.md exactly \u2014 same types, same function signatures, same exports
2794
+ 4. Verify your imports resolve to real exports in existing files
2782
2795
 
2783
2796
  You do NOT have task_create. You cannot create subtasks or delegate.
2784
2797
  If the task seems too large, do your best \u2014 the orchestrator already decomposed it for you.
2785
2798
 
2799
+ ### File Paths
2800
+ All paths in write_file/patch_file are RELATIVE TO THE WORKSPACE ROOT. If the task says "inside todo-app/", your paths MUST start with todo-app/ (e.g., todo-app/src/cli.ts, NOT src/cli.ts).
2801
+
2802
+ ### Code Quality
2803
+ - Write COMPLETE, WORKING code. No TODOs, no placeholders, no empty function bodies, no "// implement later".
2804
+ - Every function must be fully implemented with real logic.
2805
+ - Use proper TypeScript types. Use strict mode patterns.
2806
+ - Export everything that other files will import.
2807
+ - Handle edge cases (empty input, file not found, invalid args).
2808
+ - Use ESM-compatible patterns: import.meta.url instead of __dirname, import.meta.filename instead of __filename. Use fileURLToPath(import.meta.url) for path resolution.
2809
+
2786
2810
  ### Output Requirements
2787
2811
  Your plan MUST include at least one write_file, patch_file, or run_shell step.
2788
- A plan with only "respond" steps is a FAILURE \u2014 you must produce artifacts.`
2812
+ A plan with only read_file, list_files, or respond steps is a FAILURE \u2014 you must produce artifacts.`
2789
2813
  };
2790
2814
  var CAP_ROLE_REVIEWER = {
2791
2815
  name: "role-reviewer",
@@ -2809,10 +2833,19 @@ var CAP_ROLE_OPS = {
2809
2833
  You SET UP infrastructure \u2014 package.json, tsconfig.json, directory structure, dependencies.
2810
2834
 
2811
2835
  Your job:
2812
- 1. Initialize project structure (create config files, directories)
2813
- 2. Install dependencies with run_shell
2814
- 3. Ensure the project builds and tests can run
2836
+ 1. Create the project directory first: run_shell with mkdir -p <project>/src
2837
+ 2. Write config files (package.json, tsconfig.json) using write_file
2838
+ 3. Install dependencies with run_shell (npm install)
2839
+ 4. Ensure the project structure is ready for developers
2840
+
2841
+ ### File Paths
2842
+ All paths are RELATIVE TO THE WORKSPACE ROOT. If the project is in a subfolder (e.g., todo-app/), ALL your paths must include that prefix: todo-app/package.json, todo-app/tsconfig.json, todo-app/src/.
2815
2843
 
2844
+ ### Design Tasks
2845
+ When the task is a Design task, create a .design.md file with detailed TypeScript interfaces, module exports, and dependency graph. This file must contain copy-paste ready interface definitions that developers will implement exactly.
2846
+
2847
+ ### Output Requirements
2848
+ Your plan MUST include write_file and/or run_shell steps that create real files.
2816
2849
  You do NOT have task_create. You execute infrastructure tasks directly.`
2817
2850
  };
2818
2851
  var CAP_FILE_OPS = {
@@ -4349,7 +4382,7 @@ function SwarmDashboard() {
4349
4382
  React11.createElement(Tabs2, {
4350
4383
  tabs: [
4351
4384
  { id: "tasks", title: `Tasks (${tasks.length})` },
4352
- { id: "bots", title: hasSwarmInstances ? `Instances (${swarmInstanceEntries.length})` : `Bots (${registeredBots.length})` },
4385
+ { id: "bots", title: hasSwarmInstances ? `Workers (${swarmInstanceEntries.length})` : `Bots (${registeredBots.length})` },
4353
4386
  { id: "profiles", title: `Profiles (${profiles.length})` },
4354
4387
  { id: "config", title: "Config" }
4355
4388
  ],
@@ -4490,7 +4523,7 @@ function SwarmDashboard() {
4490
4523
  variant: "smallCaption-regular",
4491
4524
  color: "color-text-subtle",
4492
4525
  style: { width: "120px", flexShrink: 0 }
4493
- }, "Instance"),
4526
+ }, "Worker"),
4494
4527
  React11.createElement(Typography10, {
4495
4528
  variant: "smallCaption-regular",
4496
4529
  color: "color-text-subtle",
@@ -4530,7 +4563,7 @@ function SwarmDashboard() {
4530
4563
  key: inst.instanceId,
4531
4564
  bot: {
4532
4565
  botId: inst.instanceId,
4533
- botName: `${inst.profileId} #${inst.index}`,
4566
+ botName: inst.profileId ? `${inst.instanceId} (${inst.profileId})` : inst.instanceId,
4534
4567
  status: inst.status,
4535
4568
  currentTaskId: inst.currentTaskId,
4536
4569
  currentRunId: inst.currentRunId,
@@ -437,6 +437,25 @@ function TaskDetailView({ taskId, onBack, onEdit }) {
437
437
  if (!data) return;
438
438
  const t = data.task ?? data;
439
439
  setTask(t);
440
+ const rs = t.context;
441
+ const summaries = rs?.runSummaries;
442
+ if (summaries?.length) {
443
+ setHistory((prev) => {
444
+ if (prev.length > 0) return prev;
445
+ return summaries.map((s) => ({
446
+ id: s.runId,
447
+ runId: s.runId,
448
+ outcome: s.outcome,
449
+ summary: s.summary,
450
+ report: s.report,
451
+ filesModified: s.filesModified,
452
+ durationMs: s.durationMs,
453
+ cost: s.cost,
454
+ tokensUsed: s.tokensUsed,
455
+ error: s.error
456
+ }));
457
+ });
458
+ }
440
459
  if (data.subtasks && Array.isArray(data.subtasks)) {
441
460
  setSubtasks(data.subtasks);
442
461
  } else if (t.isParent) {
@@ -453,13 +472,14 @@ function TaskDetailView({ taskId, onBack, onEdit }) {
453
472
  try {
454
473
  const raw = await callTool("fw_weaver_history", { taskId });
455
474
  const data = typeof raw === "string" ? JSON.parse(raw) : raw;
456
- if (Array.isArray(data)) {
475
+ if (Array.isArray(data) && data.length > 0) {
457
476
  setHistory(
458
477
  data.map((r) => {
459
478
  const costObj = r.cost && typeof r.cost === "object" ? r.cost : void 0;
460
479
  return { ...r, costDetail: costObj, cost: costObj?.totalCost };
461
480
  })
462
481
  );
482
+ return;
463
483
  }
464
484
  } catch {
465
485
  }
@@ -874,7 +894,7 @@ function TaskDetailView({ taskId, onBack, onEdit }) {
874
894
  React2.createElement(
875
895
  Flex,
876
896
  { variant: "row-center-start-nowrap-6" },
877
- task.status === "failed" && React2.createElement(Button, {
897
+ (task.status === "failed" || task.status === "open" && task.attempt >= task.maxAttempts) && React2.createElement(Button, {
878
898
  size: "xs",
879
899
  variant: "fill",
880
900
  color: "primary",
@@ -42,10 +42,10 @@
42
42
  * @connect readWf.onSuccess -> report.execute
43
43
  * @connect abort.onSuccess -> report.execute
44
44
  * @connect notify.onSuccess -> report.execute
45
- * @connect gitOps.ctx -> report.mainCtx
45
+ * @connect mergePlan.ctx -> report.mainCtx
46
46
  * @connect readWf.ctx -> report.readCtx
47
47
  * @connect abort.ctx -> report.abortCtx
48
- * @connect execRetry.ctx -> report.failCtx
48
+ * @connect plan.ctx -> report.failCtx
49
49
  * @connect report.summary -> Exit.summary
50
50
  * @param execute [order:-1] - Execute
51
51
  * @param taskJson [order:0] - TaskJson
@@ -1 +1 @@
1
- {"version":3,"file":"weaver-bot.d.ts","sourceRoot":"","sources":["../../src/workflows/weaver-bot.ts"],"names":[],"mappings":"AAuaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACzE,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAwqD7E"}
1
+ {"version":3,"file":"weaver-bot.d.ts","sourceRoot":"","sources":["../../src/workflows/weaver-bot.ts"],"names":[],"mappings":"AAuaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EACzE,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAyqD7E"}
@@ -299,10 +299,10 @@ class GeneratedExecutionContext {
299
299
  * @connect readWf.onSuccess -> report.execute
300
300
  * @connect abort.onSuccess -> report.execute
301
301
  * @connect notify.onSuccess -> report.execute
302
- * @connect gitOps.ctx -> report.mainCtx
302
+ * @connect mergePlan.ctx -> report.mainCtx
303
303
  * @connect readWf.ctx -> report.readCtx
304
304
  * @connect abort.ctx -> report.abortCtx
305
- * @connect execRetry.ctx -> report.failCtx
305
+ * @connect plan.ctx -> report.failCtx
306
306
  * @connect report.summary -> Exit.summary
307
307
  * @param execute [order:-1] - Execute
308
308
  * @param taskJson [order:0] - TaskJson
@@ -1926,16 +1926,17 @@ export async function weaverBot(execute, params, __abortSignal__) {
1926
1926
  try {
1927
1927
  const report_execute = (readWfIdx !== undefined ? await ctx.getVariable({ id: 'readWf', portName: 'onSuccess', executionIndex: readWfIdx }) : false) || (abortIdx !== undefined ? await ctx.getVariable({ id: 'abort', portName: 'onSuccess', executionIndex: abortIdx }) : false) || (notifyIdx !== undefined ? await ctx.getVariable({ id: 'notify', portName: 'onSuccess', executionIndex: notifyIdx }) : false) || (gitOpsIdx !== undefined ? await ctx.getVariable({ id: 'gitOps', portName: 'onSuccess', executionIndex: gitOpsIdx }) : false) || (receiveIdx !== undefined ? await ctx.getVariable({ id: 'receive', portName: 'onFailure', executionIndex: receiveIdx }) : false) || (planIdx !== undefined ? await ctx.getVariable({ id: 'plan', portName: 'onFailure', executionIndex: planIdx }) : false) || (execRetryIdx !== undefined ? await ctx.getVariable({ id: 'execRetry', portName: 'onFailure', executionIndex: execRetryIdx }) : false);
1928
1928
  await ctx.setVariable({ id: 'report', portName: 'execute', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_execute);
1929
- const report_mainCtx = gitOpsIdx !== undefined ? await ctx.getVariable({ id: 'gitOps', portName: 'ctx', executionIndex: gitOpsIdx }) : undefined;
1929
+ const report_mainCtx = mergePlanIdx !== undefined ? await ctx.getVariable({ id: 'mergePlan', portName: 'ctx', executionIndex: mergePlanIdx }) : undefined;
1930
1930
  await ctx.setVariable({ id: 'report', portName: 'mainCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_mainCtx);
1931
1931
  const report_readCtx = readWfIdx !== undefined ? await ctx.getVariable({ id: 'readWf', portName: 'ctx', executionIndex: readWfIdx }) : undefined;
1932
1932
  await ctx.setVariable({ id: 'report', portName: 'readCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_readCtx);
1933
1933
  const report_abortCtx = abortIdx !== undefined ? await ctx.getVariable({ id: 'abort', portName: 'ctx', executionIndex: abortIdx }) : undefined;
1934
1934
  await ctx.setVariable({ id: 'report', portName: 'abortCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_abortCtx);
1935
- const report_failCtx = execRetryIdx !== undefined ? await ctx.getVariable({ id: 'execRetry', portName: 'ctx', executionIndex: execRetryIdx }) : undefined;
1935
+ const report_failCtx = planIdx !== undefined ? await ctx.getVariable({ id: 'plan', portName: 'ctx', executionIndex: planIdx }) : undefined;
1936
1936
  await ctx.setVariable({ id: 'report', portName: 'failCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_failCtx);
1937
1937
  const reportResult = await weaverBotReport(report_execute, report_mainCtx, report_readCtx, report_abortCtx, report_failCtx);
1938
1938
  await ctx.setVariable({ id: 'report', portName: 'summary', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.summary);
1939
+ await ctx.setVariable({ id: 'report', portName: 'report', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.report);
1939
1940
  await ctx.setVariable({ id: 'report', portName: 'reportJson', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.reportJson);
1940
1941
  await ctx.setVariable({ id: 'report', portName: 'onFailure', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.onFailure);
1941
1942
  await ctx.setVariable({ id: 'report', portName: 'onSuccess', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.onSuccess);