@synergenius/flow-weaver-pack-weaver 0.9.142 → 0.9.145

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 (61) hide show
  1. package/dist/bot/behavior-defaults.d.ts +2 -2
  2. package/dist/bot/behavior-defaults.d.ts.map +1 -1
  3. package/dist/bot/behavior-defaults.js +11 -6
  4. package/dist/bot/behavior-defaults.js.map +1 -1
  5. package/dist/bot/capability-registry.d.ts +2 -0
  6. package/dist/bot/capability-registry.d.ts.map +1 -1
  7. package/dist/bot/capability-registry.js +97 -0
  8. package/dist/bot/capability-registry.js.map +1 -1
  9. package/dist/bot/profile-store.d.ts.map +1 -1
  10. package/dist/bot/profile-store.js +7 -0
  11. package/dist/bot/profile-store.js.map +1 -1
  12. package/dist/bot/runner.d.ts.map +1 -1
  13. package/dist/bot/runner.js +53 -8
  14. package/dist/bot/runner.js.map +1 -1
  15. package/dist/bot/step-executor.d.ts.map +1 -1
  16. package/dist/bot/step-executor.js +3 -0
  17. package/dist/bot/step-executor.js.map +1 -1
  18. package/dist/bot/swarm-controller.d.ts.map +1 -1
  19. package/dist/bot/swarm-controller.js +7 -3
  20. package/dist/bot/swarm-controller.js.map +1 -1
  21. package/dist/bot/task-prompt-builder.js +8 -0
  22. package/dist/bot/task-prompt-builder.js.map +1 -1
  23. package/dist/bot/task-types.d.ts +2 -0
  24. package/dist/bot/task-types.d.ts.map +1 -1
  25. package/dist/bot/types.d.ts +4 -0
  26. package/dist/bot/types.d.ts.map +1 -1
  27. package/dist/node-types/bot-report.d.ts +3 -1
  28. package/dist/node-types/bot-report.d.ts.map +1 -1
  29. package/dist/node-types/bot-report.js +60 -9
  30. package/dist/node-types/bot-report.js.map +1 -1
  31. package/dist/node-types/report.d.ts +3 -1
  32. package/dist/node-types/report.d.ts.map +1 -1
  33. package/dist/node-types/report.js +7 -3
  34. package/dist/node-types/report.js.map +1 -1
  35. package/dist/ui/capability-editor.js +84 -0
  36. package/dist/ui/profile-editor.js +87 -3
  37. package/dist/ui/swarm-dashboard.js +96 -7
  38. package/dist/ui/task-detail-view.js +9 -4
  39. package/dist/ui/trace-to-timeline.d.ts +2 -0
  40. package/dist/ui/trace-to-timeline.d.ts.map +1 -1
  41. package/dist/ui/trace-to-timeline.js.map +1 -1
  42. package/dist/ui/use-stream-timeline.d.ts +2 -0
  43. package/dist/ui/use-stream-timeline.d.ts.map +1 -1
  44. package/dist/ui/use-stream-timeline.js +7 -5
  45. package/dist/ui/use-stream-timeline.js.map +1 -1
  46. package/flowweaver.manifest.json +1 -1
  47. package/package.json +1 -1
  48. package/src/bot/behavior-defaults.ts +12 -5
  49. package/src/bot/capability-registry.ts +104 -0
  50. package/src/bot/profile-store.ts +7 -0
  51. package/src/bot/runner.ts +55 -9
  52. package/src/bot/step-executor.ts +3 -0
  53. package/src/bot/swarm-controller.ts +7 -3
  54. package/src/bot/task-prompt-builder.ts +10 -0
  55. package/src/bot/task-types.ts +2 -0
  56. package/src/bot/types.ts +4 -0
  57. package/src/node-types/bot-report.ts +61 -10
  58. package/src/node-types/report.ts +8 -4
  59. package/src/ui/task-detail-view.tsx +3 -0
  60. package/src/ui/trace-to-timeline.ts +2 -0
  61. package/src/ui/use-stream-timeline.ts +8 -5
@@ -1 +1 @@
1
- {"version":3,"file":"use-stream-timeline.js","sourceRoot":"","sources":["../../src/ui/use-stream-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AAqCvD,MAAM,UAAU,iBAAiB,CAAC,MAAqB,EAAE,MAAe;IACtE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,IAAqB,CAAC,CAAC;IAE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CAAC,IAAgC,IAAI,CAAC,CAAC;gBAC1D,MAAM,OAAO,GAAI,QAAQ,CAAC,OAAkB,IAAI,EAAE,CAAC;gBACnD,MAAM,KAAK,GACR,QAAQ,CAAC,KAAuE,IAAI,EAAE,CAAC;gBAC1F,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAChC,IAAI,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBAC5B,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;gBAC5C,gBAAgB,GAAG,IAAI,CAAC;YAC1B,CAAC;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,yBAAyB,EAAE,CAAC;gBACpD,gBAAgB,GAAG,KAAK,CAAC;YAC3B,CAAC;QACH,CAAC;QAED,IAAI,MAAM,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC1D,KAAK,GAAG,WAAW,CAAC;QACtB,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACtE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAErB,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;AACzF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifestVersion": 2,
3
3
  "name": "@synergenius/flow-weaver-pack-weaver",
4
- "version": "0.9.142",
4
+ "version": "0.9.145",
5
5
  "description": "AI bot for Flow Weaver. Execute tasks, run workflows, evolve autonomously.",
6
6
  "engineVersion": ">=0.22.10",
7
7
  "categories": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver-pack-weaver",
3
- "version": "0.9.142",
3
+ "version": "0.9.145",
4
4
  "description": "AI bot for Flow Weaver. Execute tasks, run workflows, evolve autonomously.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { CostStrategy, ModelTier, ModelTierMap, ProfileBehavior, PhaseBehavior, PhaseDescriptor } from './profile-types.js';
10
+ import { PROFILE_CAPABILITIES } from './capability-registry.js';
10
11
 
11
12
  // ---------------------------------------------------------------------------
12
13
  // Built-in tier maps — known providers
@@ -139,11 +140,11 @@ const STRATEGY_PHASE_OVERRIDES: Record<CostStrategy, Record<string, Partial<Phas
139
140
  // Default capabilities per strategy
140
141
  // ---------------------------------------------------------------------------
141
142
 
142
- /** Default capability pools per cost strategy. */
143
+ /** Default capability pools per cost strategy (legacy fallback when no profile role). */
143
144
  export const STRATEGY_CAPABILITIES: Record<CostStrategy, string[]> = {
144
- frugal: ['core', 'file-ops', 'shell', 'context'],
145
- balanced: ['core', 'file-ops', 'shell', 'task-mgmt', 'fw-grammar', 'fw-validate', 'context'],
146
- performance: ['core', 'file-ops', 'shell', 'task-mgmt', 'fw-grammar', 'fw-validate', 'fw-genesis', 'fw-cli', 'code-review', 'web', 'context'],
145
+ frugal: ['core', 'role-developer', 'file-ops', 'shell', 'context'],
146
+ balanced: ['core', 'role-developer', 'file-ops', 'shell', 'fw-grammar', 'fw-validate', 'context'],
147
+ performance: ['core', 'role-developer', 'file-ops', 'shell', 'fw-grammar', 'fw-validate', 'fw-genesis', 'fw-cli', 'code-review', 'web', 'context'],
147
148
  };
148
149
 
149
150
  /** Default budget per strategy (USD per task). */
@@ -171,6 +172,7 @@ const STRATEGY_DEFAULTS: Record<CostStrategy, { escalation: ProfileBehavior['esc
171
172
  export function buildDefaultBehavior(
172
173
  strategy: CostStrategy,
173
174
  phaseDescriptors?: PhaseDescriptor[],
175
+ profileRole?: string,
174
176
  ): ProfileBehavior {
175
177
  const descriptors = phaseDescriptors ?? DEFAULT_PHASE_DESCRIPTORS;
176
178
  // Base tier: frugal=fast, balanced/performance=standard.
@@ -191,8 +193,13 @@ export function buildDefaultBehavior(
191
193
  }
192
194
  }
193
195
 
196
+ // Use profile-role-based capabilities if available, fall back to strategy-based
197
+ const capabilities = (profileRole && PROFILE_CAPABILITIES[profileRole])
198
+ ? PROFILE_CAPABILITIES[profileRole]
199
+ : STRATEGY_CAPABILITIES[strategy];
200
+
194
201
  return {
195
- capabilities: STRATEGY_CAPABILITIES[strategy],
202
+ capabilities,
196
203
  budget: STRATEGY_BUDGETS[strategy],
197
204
  phases,
198
205
  ...STRATEGY_DEFAULTS[strategy],
@@ -36,6 +36,92 @@ Do NOT describe what you would do — actually do it by calling tools.
36
36
  - Be concise — let tool results speak.`,
37
37
  };
38
38
 
39
+ // ---------------------------------------------------------------------------
40
+ // Role capabilities — define bot identity and primary directive
41
+ // ---------------------------------------------------------------------------
42
+
43
+ const CAP_ROLE_ORCHESTRATOR: CapabilityDefinition = {
44
+ name: 'role-orchestrator',
45
+ description: 'Orchestrator role: decomposes objectives into tasks, assigns profiles, creates project briefs.',
46
+ tools: [OP_TASK_CREATE, OP_LIST_FILES, OP_READ_FILE],
47
+ prompt: `## YOUR ROLE: Orchestrator
48
+ You DECOMPOSE and ASSIGN. You never write code or create files directly.
49
+
50
+ Your job:
51
+ 1. Analyze the objective and understand the project scope
52
+ 2. Create a PROJECT BRIEF (a concise description of what we're building, how pieces connect, conventions to follow)
53
+ 3. Break the objective into focused subtasks using task_create
54
+ 4. ALWAYS set assignedProfile on every subtask:
55
+ - Code writing, file creation → "developer"
56
+ - Code review, quality checks → "reviewer"
57
+ - Project setup, dependencies, config → "ops"
58
+ 5. Set dependencies so tasks execute in the right order
59
+ 6. Include the project brief in every subtask's description
60
+
61
+ You do NOT have write_file, patch_file, or run_shell. You cannot execute — only plan and delegate.
62
+
63
+ ### Project Brief Format
64
+ Include this at the TOP of every subtask description:
65
+ "PROJECT: [what we're building]. STRUCTURE: [file layout]. CONVENTIONS: [naming, patterns, exports]."
66
+
67
+ ### Subtask Quality
68
+ Each subtask must be:
69
+ - Focused (one file or one concern)
70
+ - Self-contained (has enough context to execute independently)
71
+ - Properly routed (assignedProfile is set)
72
+ - Ordered (dependsOn reflects real dependencies)`,
73
+ };
74
+
75
+ const CAP_ROLE_DEVELOPER: CapabilityDefinition = {
76
+ name: 'role-developer',
77
+ description: 'Developer role: writes code, creates files, runs commands. Executes directly, never decomposes.',
78
+ prompt: `## YOUR ROLE: Developer
79
+ You WRITE CODE. Execute the task directly using write_file, patch_file, and run_shell.
80
+
81
+ Your job:
82
+ 1. Read the task description (including the project brief)
83
+ 2. Create a plan with CONCRETE file operations (write_file, patch_file, run_shell)
84
+ 3. Execute every step — produce actual files on disk
85
+ 4. Verify your work compiles and is correct
86
+
87
+ You do NOT have task_create. You cannot create subtasks or delegate.
88
+ If the task seems too large, do your best — the orchestrator already decomposed it for you.
89
+
90
+ ### Output Requirements
91
+ Your plan MUST include at least one write_file, patch_file, or run_shell step.
92
+ A plan with only "respond" steps is a FAILURE — you must produce artifacts.`,
93
+ };
94
+
95
+ const CAP_ROLE_REVIEWER: CapabilityDefinition = {
96
+ name: 'role-reviewer',
97
+ description: 'Reviewer role: reads and evaluates code quality, security, correctness.',
98
+ prompt: `## YOUR ROLE: Reviewer
99
+ You READ and EVALUATE code. Check quality, security, correctness, and consistency.
100
+
101
+ Your job:
102
+ 1. Read the files that were created/modified
103
+ 2. Check against the task description and project conventions
104
+ 3. Report findings with file:line and severity
105
+ 4. Use patch_file to fix minor issues directly
106
+ 5. For major issues, document them clearly in your report
107
+
108
+ You do NOT have task_create or write_file. You can only read and patch.`,
109
+ };
110
+
111
+ const CAP_ROLE_OPS: CapabilityDefinition = {
112
+ name: 'role-ops',
113
+ description: 'Ops role: sets up project infrastructure, configs, dependencies.',
114
+ prompt: `## YOUR ROLE: Ops
115
+ You SET UP infrastructure — package.json, tsconfig.json, directory structure, dependencies.
116
+
117
+ Your job:
118
+ 1. Initialize project structure (create config files, directories)
119
+ 2. Install dependencies with run_shell
120
+ 3. Ensure the project builds and tests can run
121
+
122
+ You do NOT have task_create. You execute infrastructure tasks directly.`,
123
+ };
124
+
39
125
  const CAP_FILE_OPS: CapabilityDefinition = {
40
126
  name: 'file-ops',
41
127
  description: 'File read/write/patch operations and best practices for file manipulation.',
@@ -363,6 +449,12 @@ When you discover a new convention, remember it for future bots.`,
363
449
  /** All built-in capability definitions. */
364
450
  export const BUILT_IN_CAPABILITIES: readonly CapabilityDefinition[] = [
365
451
  CAP_CORE,
452
+ // Role capabilities
453
+ CAP_ROLE_ORCHESTRATOR,
454
+ CAP_ROLE_DEVELOPER,
455
+ CAP_ROLE_REVIEWER,
456
+ CAP_ROLE_OPS,
457
+ // Tool capabilities
366
458
  CAP_FILE_OPS,
367
459
  CAP_SHELL,
368
460
  CAP_TASK_MGMT,
@@ -383,6 +475,18 @@ export const BUILT_IN_CAPABILITIES: readonly CapabilityDefinition[] = [
383
475
  CAP_MEMORY,
384
476
  ];
385
477
 
478
+ // ---------------------------------------------------------------------------
479
+ // Per-profile capability pools — defines what each role CAN use
480
+ // ---------------------------------------------------------------------------
481
+
482
+ /** Capability pools per profile role. Triage selects from these per task. */
483
+ export const PROFILE_CAPABILITIES: Record<string, string[]> = {
484
+ orchestrator: ['core', 'role-orchestrator', 'decomposition', 'routing', 'task-mgmt', 'context'],
485
+ developer: ['core', 'role-developer', 'file-ops', 'shell', 'verification', 'cross-file-check', 'fw-grammar', 'fw-validate', 'context'],
486
+ reviewer: ['core', 'role-reviewer', 'code-review', 'security', 'context'],
487
+ ops: ['core', 'role-ops', 'file-ops', 'shell', 'project-setup', 'verification', 'context'],
488
+ };
489
+
386
490
  const capabilityMap = new Map<string, CapabilityDefinition>(
387
491
  BUILT_IN_CAPABILITIES.map(c => [c.name, c]),
388
492
  );
@@ -3,6 +3,7 @@ import * as path from 'node:path';
3
3
  import * as crypto from 'node:crypto';
4
4
  import type { BotProfile, CreateProfileInput, Capability } from './profile-types.js';
5
5
  import { buildDefaultBehavior } from './behavior-defaults.js';
6
+ import { PROFILE_CAPABILITIES } from './capability-registry.js';
6
7
 
7
8
  // ---------------------------------------------------------------------------
8
9
  // Default profiles — enterprise-ready starting kit
@@ -152,6 +153,7 @@ const DEFAULT_PROFILES: Record<string, Array<Omit<CreateProfileInput, 'botId'>>>
152
153
  // Standard tier for plan+execute. 3 retries then block.
153
154
  // Iron Law: investigate before fixing → reportConcerns on.
154
155
  behavior: {
156
+ capabilities: PROFILE_CAPABILITIES.developer,
155
157
  phases: {
156
158
  plan: { enabled: true, tier: 'standard' as const },
157
159
  execute: { enabled: true, tier: 'standard' as const },
@@ -185,6 +187,7 @@ const DEFAULT_PROFILES: Record<string, Array<Omit<CreateProfileInput, 'botId'>>>
185
187
  // Finding classification: AUTO-FIX / ASK / INFORM → requireEvidence.
186
188
  // Low retries — if review fails twice, escalate to human.
187
189
  behavior: {
190
+ capabilities: PROFILE_CAPABILITIES.reviewer,
188
191
  phases: {
189
192
  plan: { enabled: true, tier: 'fast' as const },
190
193
  execute: { enabled: false, tier: 'standard' as const },
@@ -217,6 +220,7 @@ const DEFAULT_PROFILES: Record<string, Array<Omit<CreateProfileInput, 'botId'>>>
217
220
  // Blocked from src/ and lib/ — ops touches config, scripts, CI only.
218
221
  // Reassign on exhaustion — don't block, escalate to human.
219
222
  behavior: {
223
+ capabilities: PROFILE_CAPABILITIES.ops,
220
224
  phases: {
221
225
  plan: { enabled: true, tier: 'standard' as const },
222
226
  execute: { enabled: true, tier: 'standard' as const },
@@ -253,10 +257,13 @@ const DEFAULT_PROFILES: Record<string, Array<Omit<CreateProfileInput, 'botId'>>>
253
257
 
254
258
  ## Rules
255
259
  - You do NOT write code yourself. You create tasks for other bots.
260
+ - CRITICAL: Every subtask MUST have assignedProfile set to "developer", "reviewer", or "ops". NEVER leave it empty or set it to "orchestrator".
256
261
  - Every subtask needs: title, description, assignedProfile, complexity.
262
+ - Code/file tasks → assignedProfile: "developer". Setup/infra → assignedProfile: "ops". Review → assignedProfile: "reviewer".
257
263
  - Structure as: setup → independent implementations → integration → review.
258
264
  - If a task is simple enough (single file, clear scope), don't decompose further.`,
259
265
  behavior: {
266
+ capabilities: PROFILE_CAPABILITIES.orchestrator,
260
267
  phases: {
261
268
  plan: { enabled: true, tier: 'fast' as const },
262
269
  execute: { enabled: true, tier: 'fast' as const },
package/src/bot/runner.ts CHANGED
@@ -255,7 +255,6 @@ export async function runWorkflow(
255
255
  const nodeLabels = new Map<string, string>(); // nodeTypeName | instanceId → label
256
256
  const nodeVisuals = new Map<string, { color?: string; icon?: string }>(); // nodeTypeName | instanceId → visual meta
257
257
  const portLabels = new Map<string, string>(); // "nodeTypeName.portName" → label
258
- const portFormats = new Map<string, string>(); // "nodeTypeName.portName" → format hint
259
258
  try {
260
259
  const parserMod = '@synergenius/flow-weaver';
261
260
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -268,9 +267,8 @@ export async function runWorkflow(
268
267
  // Extract output port labels: outputs is Record<string, PortConfig>
269
268
  if (nt.outputs && typeof nt.outputs === 'object') {
270
269
  for (const [portName, portCfg] of Object.entries(nt.outputs)) {
271
- const cfg = portCfg as { label?: string; customMetadata?: Record<string, string | boolean | number> } | undefined;
270
+ const cfg = portCfg as { label?: string } | undefined;
272
271
  if (cfg?.label) portLabels.set(`${nt.name}.${portName}`, cfg.label);
273
- if (cfg?.customMetadata?.format) portFormats.set(`${nt.name}.${portName}`, String(cfg.customMetadata.format));
274
272
  }
275
273
  }
276
274
  }
@@ -290,7 +288,7 @@ export async function runWorkflow(
290
288
  // Track node start times, node types, and outputs so we can attach them on completion.
291
289
  const nodeStartTimes = new Map<string, number>();
292
290
  const nodeTypes = new Map<string, string>(); // nodeId → nodeTypeName
293
- const nodeOutputs = new Map<string, Array<{ portLabel: string; value: unknown; format?: string }>>();
291
+ const nodeOutputs = new Map<string, Array<{ portLabel: string; value: unknown }>>();
294
292
 
295
293
  /** Try to parse JSON strings into objects so the UI renders them as structured JSON. */
296
294
  function resolveOutputValue(value: unknown): unknown {
@@ -322,11 +320,9 @@ export async function runWorkflow(
322
320
  const nodeTypeName = ident.nodeTypeName as string | undefined;
323
321
  if (nodeId && portName) {
324
322
  if (nodeTypeName) nodeTypes.set(nodeId, nodeTypeName);
325
- const resolvedNt = nodeTypeName ?? nodeTypes.get(nodeId);
326
- const label = resolvePortLabel(resolvedNt, portName);
327
- const format = resolvedNt ? portFormats.get(`${resolvedNt}.${portName}`) : undefined;
323
+ const label = resolvePortLabel(nodeTypeName ?? nodeTypes.get(nodeId), portName);
328
324
  const outputs = nodeOutputs.get(nodeId) ?? [];
329
- outputs.push({ portLabel: label, value: resolveOutputValue(traceEvent.data.value), ...(format ? { format } : {}) });
325
+ outputs.push({ portLabel: label, value: resolveOutputValue(traceEvent.data.value) });
330
326
  nodeOutputs.set(nodeId, outputs);
331
327
  }
332
328
  }
@@ -443,6 +439,54 @@ export async function runWorkflow(
443
439
  }
444
440
  } catch { /* extraction is best-effort */ }
445
441
 
442
+ // Build markdown report from the extracted context data
443
+ let report: string | undefined;
444
+ try {
445
+ const ctxStr = result?.ctx as string | undefined;
446
+ if (ctxStr) {
447
+ const ctx = JSON.parse(ctxStr);
448
+ const md: string[] = [];
449
+ md.push(`## ${success ? 'Task Completed' : 'Task Failed'}`);
450
+ md.push('');
451
+
452
+ // Steps
453
+ if (stepLog && stepLog.length > 0) {
454
+ md.push('### Steps');
455
+ md.push('');
456
+ for (const s of stepLog) {
457
+ const icon = s.status === 'ok' ? '**ok**' : s.status === 'error' ? '**error**' : '**blocked**';
458
+ md.push(`- ${s.step} (${icon})${s.detail ? `: ${s.detail}` : ''}`);
459
+ }
460
+ md.push('');
461
+ }
462
+
463
+ // Files
464
+ const files: string[] = ctx.filesModified ? JSON.parse(ctx.filesModified) : [];
465
+ if (files.length > 0) {
466
+ md.push('### Files Modified');
467
+ md.push('');
468
+ for (const f of files) md.push(`- \`${f}\``);
469
+ md.push('');
470
+ }
471
+
472
+ // Review
473
+ if (ctx.reviewJson) {
474
+ const review = JSON.parse(ctx.reviewJson) as Record<string, string>;
475
+ if (review.intent || review.execution || review.result || review.completeness) {
476
+ md.push('### Review');
477
+ md.push('');
478
+ for (const key of ['intent', 'execution', 'result', 'completeness']) {
479
+ if (review[key]) md.push(`- **${key}:** ${review[key]}`);
480
+ }
481
+ if (review.reason) md.push(`\n${review.reason}`);
482
+ md.push('');
483
+ }
484
+ }
485
+
486
+ if (md.length > 2) report = md.join('\n');
487
+ }
488
+ } catch { /* report generation is best-effort */ }
489
+
446
490
  await notifier({
447
491
  type: 'workflow-complete',
448
492
  workflowFile: absPath,
@@ -455,6 +499,7 @@ export async function runWorkflow(
455
499
  persistCost(costSummary, absPath, providerConfig.name, verbose);
456
500
  recordRun(store, {
457
501
  id: runId, workflowFile: absPath, startedAt, success, outcome: outcome as RunOutcome, summary,
502
+ report,
458
503
  functionName: execResult.functionName, executionTime: execResult.executionTime,
459
504
  dryRun: false, provider: providerConfig.name, params: options?.params, stepLog,
460
505
  trace: collectedTrace.length > 0 ? collectedTrace : undefined,
@@ -466,13 +511,14 @@ export async function runWorkflow(
466
511
  botId: options?.botId,
467
512
  }, verbose);
468
513
 
469
- logEvent?.({ type: 'bot-completed', timestamp: Date.now(), data: { success, outcome, summary } });
514
+ logEvent?.({ type: 'bot-completed', timestamp: Date.now(), data: { success, outcome, summary, report } });
470
515
 
471
516
  auditEmit('run-complete', { success, outcome, summary });
472
517
 
473
518
  return {
474
519
  success,
475
520
  summary,
521
+ report,
476
522
  outcome,
477
523
  functionName: execResult.functionName,
478
524
  executionTime: execResult.executionTime,
@@ -398,6 +398,7 @@ export async function executeStep(
398
398
  if (!title) return { blocked: true, blockReason: 'task_create requires a "title" argument.' };
399
399
 
400
400
  const store = new TaskStore(projectDir);
401
+ const assignedProfile = args.assignedProfile as string | undefined;
401
402
  const input: CreateTaskInput = {
402
403
  title,
403
404
  description: (args.description as string) ?? title,
@@ -405,6 +406,7 @@ export async function executeStep(
405
406
  priority: (args.priority as number) ?? 0,
406
407
  parentId: args.parentId as string | undefined,
407
408
  dependsOn: (args.dependsOn as string[]) ?? [],
409
+ assignedProfile,
408
410
  };
409
411
 
410
412
  // Support inline subtasks
@@ -415,6 +417,7 @@ export async function executeStep(
415
417
  description: (s.description as string) ?? '',
416
418
  complexity: (s.complexity as 'trivial' | 'simple' | 'moderate' | 'complex') ?? 'simple',
417
419
  priority: (s.priority as number) ?? 0,
420
+ assignedProfile: (s.assignedProfile as string) ?? assignedProfile ?? 'developer',
418
421
  }));
419
422
  }
420
423
 
@@ -429,11 +429,15 @@ export class SwarmController {
429
429
  await this._checkSteering(inst.instanceId);
430
430
  }
431
431
 
432
- // Route unassigned tasks to orchestrator profile for decomposition
432
+ // Route unassigned tasks: top-level orchestrator, subtasks developer (fallback)
433
433
  const unassignedTasks = await this.taskStore.list({ status: ['open', 'pending'] });
434
434
  for (const t of unassignedTasks) {
435
435
  if (!t.assignedProfile && !t.isParent) {
436
- await this.taskStore.update(t.id, { assignedProfile: 'orchestrator' });
436
+ // Top-level tasks (no parent) go to orchestrator for decomposition.
437
+ // Subtasks without a profile default to developer — the orchestrator
438
+ // should have set assignedProfile, but if it didn't, assume code work.
439
+ const defaultProfile = t.parentId ? 'developer' : 'orchestrator';
440
+ await this.taskStore.update(t.id, { assignedProfile: defaultProfile });
437
441
  }
438
442
  }
439
443
 
@@ -652,7 +656,7 @@ export class SwarmController {
652
656
  // Build behavior config from profile preferences, adjusted for task complexity.
653
657
  // Trivial tasks get cheaper models and fewer retries; complex tasks are unchanged.
654
658
  const baseBehavior: ProfileBehavior = profile.preferences.behavior
655
- ?? buildDefaultBehavior(profile.preferences.costStrategy);
659
+ ?? buildDefaultBehavior(profile.preferences.costStrategy, undefined, profile.id);
656
660
  const behavior = adjustBehaviorForComplexity(baseBehavior, task.complexity);
657
661
  const behaviorJson = JSON.stringify(behavior);
658
662
 
@@ -96,6 +96,11 @@ function buildFull(
96
96
  sections.push(buildPreferencesSection(preferences));
97
97
  }
98
98
 
99
+ // Project brief from parent (propagated for cross-task coherence)
100
+ if (parentTask?.context.projectBrief) {
101
+ sections.push(`### Project Brief\n${parentTask.context.projectBrief}`);
102
+ }
103
+
99
104
  // Parent context
100
105
  if (parentTask) {
101
106
  sections.push(buildParentSection(parentTask, siblingTasks));
@@ -230,6 +235,11 @@ function buildWithTruncation(
230
235
  sections.push(buildPreferencesSection(preferences));
231
236
  }
232
237
 
238
+ // Project brief from parent (propagated for cross-task coherence)
239
+ if (parentTask?.context.projectBrief && !flags.parentTitleOnly) {
240
+ sections.push(`### Project Brief\n${parentTask.context.projectBrief}`);
241
+ }
242
+
233
243
  // Parent context
234
244
  if (parentTask) {
235
245
  if (flags.parentTitleOnly) {
@@ -20,6 +20,8 @@ export interface TaskContext {
20
20
  notes: string;
21
21
  runSummaries: RunSummary[];
22
22
  lastError?: string;
23
+ /** Project brief propagated from parent task for cross-task coherence. */
24
+ projectBrief?: string;
23
25
  }
24
26
 
25
27
  /**
package/src/bot/types.ts CHANGED
@@ -167,6 +167,8 @@ export interface WorkflowResult {
167
167
  success: boolean;
168
168
  summary: string;
169
169
  outcome: string;
170
+ /** Optional markdown report for rich UI display. */
171
+ report?: string;
170
172
  functionName?: string;
171
173
  executionTime?: number;
172
174
  cost?: RunCostSummary;
@@ -191,6 +193,8 @@ export interface RunRecord {
191
193
  success: boolean;
192
194
  outcome: RunOutcome;
193
195
  summary: string;
196
+ /** Optional markdown report for rich UI display. */
197
+ report?: string;
194
198
  functionName?: string;
195
199
  executionTime?: number;
196
200
  params?: Record<string, unknown>;
@@ -16,7 +16,8 @@ import { TaskStore } from '../bot/task-store.js';
16
16
  * @input [abortCtx] [order:2] - Context from abort path (JSON, optional)
17
17
  * @input [failCtx] [order:3] - Context from failure paths (exec/plan fail, JSON, optional)
18
18
  * @output summary [order:0] - Summary text
19
- * @output reportJson [order:1] [hidden] - Full report (JSON)
19
+ * @output report [order:1] - Markdown report
20
+ * @output reportJson [order:2] [hidden] - Full report (JSON)
20
21
  * @output onFailure [hidden]
21
22
  */
22
23
  export async function weaverBotReport(
@@ -25,24 +26,24 @@ export async function weaverBotReport(
25
26
  readCtx?: string,
26
27
  abortCtx?: string,
27
28
  failCtx?: string,
28
- ): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string; reportJson: string }> {
29
+ ): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string; report: string; reportJson: string }> {
29
30
  const ctxStr = mainCtx ?? readCtx ?? abortCtx ?? failCtx;
30
31
 
31
32
  if (!execute) {
32
- const report = { task: {}, path: 'unknown', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
33
- return { onSuccess: true, onFailure: false, summary: '', reportJson: JSON.stringify(report) };
33
+ const reportObj = { task: {}, path: 'unknown', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
34
+ return { onSuccess: true, onFailure: false, summary: '', report: '', reportJson: JSON.stringify(reportObj) };
34
35
  }
35
36
  if (!ctxStr) {
36
- const report = { task: {}, path: 'no-context', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
37
- return { onSuccess: false, onFailure: true, summary: 'No context received', reportJson: JSON.stringify(report) };
37
+ const reportObj = { task: {}, path: 'no-context', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
38
+ return { onSuccess: false, onFailure: true, summary: 'No context received', report: '', reportJson: JSON.stringify(reportObj) };
38
39
  }
39
40
 
40
41
  let context: WeaverContext;
41
42
  try {
42
43
  context = JSON.parse(ctxStr) as WeaverContext;
43
44
  } catch {
44
- const report = { task: {}, path: 'parse-error', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
45
- return { onSuccess: false, onFailure: true, summary: 'Failed to parse context', reportJson: JSON.stringify(report) };
45
+ const reportObj = { task: {}, path: 'parse-error', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
46
+ return { onSuccess: false, onFailure: true, summary: 'Failed to parse context', report: '', reportJson: JSON.stringify(reportObj) };
46
47
  }
47
48
 
48
49
  const safeJsonParse = <T>(str: string | undefined, fallback: T): T => {
@@ -125,7 +126,7 @@ export async function weaverBotReport(
125
126
  } catch (err) { if (process.env.WEAVER_VERBOSE) console.error('[bot-report] queue update failed:', err); }
126
127
  }
127
128
 
128
- const report = {
129
+ const reportObj = {
129
130
  task,
130
131
  path: pathName,
131
132
  result,
@@ -134,7 +135,57 @@ export async function weaverBotReport(
134
135
  timestamp: Date.now(),
135
136
  };
136
137
 
138
+ // Build markdown report
139
+ const md: string[] = [];
140
+ md.push(`## ${success ? 'Task Completed' : 'Task Failed'}`);
141
+ md.push('');
142
+ if (result?.summary) md.push(result.summary);
143
+ if (!reviewPassed && reviewReason) md.push(`\n> Review: ${reviewReason}`);
144
+ md.push('');
145
+
146
+ // Steps
147
+ const stepLog = safeJsonParse<Array<{ step: string; status: string; detail?: string }>>(context.stepLogJson, []);
148
+ if (stepLog.length > 0) {
149
+ md.push('### Steps');
150
+ md.push('');
151
+ for (const s of stepLog) {
152
+ const icon = s.status === 'ok' ? '**ok**' : s.status === 'error' ? '**error**' : '**blocked**';
153
+ md.push(`- ${s.step} (${icon})${s.detail ? `: ${s.detail}` : ''}`);
154
+ }
155
+ md.push('');
156
+ }
157
+
158
+ // Files
159
+ if (files.length > 0) {
160
+ md.push('### Files Modified');
161
+ md.push('');
162
+ for (const f of files) md.push(`- \`${f}\``);
163
+ md.push('');
164
+ }
165
+
166
+ // Review
167
+ if (context.reviewJson) {
168
+ const review = safeJsonParse<Record<string, string>>(context.reviewJson, {});
169
+ if (review.intent || review.execution || review.result || review.completeness) {
170
+ md.push('### Review');
171
+ md.push('');
172
+ for (const key of ['intent', 'execution', 'result', 'completeness']) {
173
+ if (review[key]) md.push(`- **${key}:** ${review[key]}`);
174
+ }
175
+ if (review.reason) md.push(`\n${review.reason}`);
176
+ md.push('');
177
+ }
178
+ }
179
+
180
+ // Git
181
+ if (gitResult && !gitResult.skipped) {
182
+ md.push('### Git');
183
+ md.push('');
184
+ md.push('Changes committed');
185
+ md.push('');
186
+ }
187
+
137
188
  console.log(`\n\x1b[1m${success ? '\x1b[32m' : '\x1b[31m'}Bot Report: ${summary}\x1b[0m\n`);
138
189
 
139
- return { onSuccess: success, onFailure: !success, summary, reportJson: JSON.stringify(report) };
190
+ return { onSuccess: success, onFailure: !success, summary, report: md.join('\n'), reportJson: JSON.stringify(reportObj) };
140
191
  }
@@ -10,16 +10,20 @@ import type { WeaverContext } from '../bot/types.js';
10
10
  * @icon summarize
11
11
  * @color cyan
12
12
  * @input ctx [order:0] - Weaver context (JSON)
13
- * @output summary [order:0, format:md] - Summary
13
+ * @output summary [order:0] - Summary string
14
+ * @output report [order:1] - Markdown report
14
15
  * @output onFailure [hidden]
15
16
  */
16
- export function weaverReport(ctx: string): { summary: string } {
17
+ export function weaverReport(ctx: string): { summary: string; report: string } {
17
18
  const context = JSON.parse(ctx) as WeaverContext;
18
19
  const result = JSON.parse(context.resultJson!);
19
20
  const relPath = path.relative(context.env.projectDir, context.targetPath!);
20
21
 
21
- console.log(`\x1b[32m✓ Weaver: ${result.outcome} (${relPath})\x1b[0m`);
22
+ // Plain one-liner for notifications, task lists, logs
23
+ const summaryLine = `Weaver: ${result.outcome} (${relPath})${result.summary ? ' — ' + result.summary : ''}`;
24
+ console.log(`\x1b[32m✓ ${summaryLine}\x1b[0m`);
22
25
 
26
+ // Markdown report for rich UI display
23
27
  const md: string[] = [];
24
28
  md.push(`## ${result.outcome === 'success' ? 'Task Completed' : 'Task Failed'}`);
25
29
  md.push('');
@@ -71,5 +75,5 @@ export function weaverReport(ctx: string): { summary: string } {
71
75
  if (context.env.providerInfo?.model) meta.push(`**Model:** ${context.env.providerInfo.model}`);
72
76
  if (meta.length > 0) md.push(meta.join(' | '));
73
77
 
74
- return { summary: md.join('\n') };
78
+ return { summary: summaryLine, report: md.join('\n') };
75
79
  }