bosun 0.41.8 → 0.41.10

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 (58) hide show
  1. package/.env.example +1 -1
  2. package/README.md +23 -1
  3. package/agent/agent-event-bus.mjs +31 -2
  4. package/agent/agent-pool.mjs +275 -40
  5. package/agent/agent-prompts.mjs +9 -1
  6. package/agent/agent-supervisor.mjs +22 -0
  7. package/agent/autofix.mjs +1 -1
  8. package/agent/primary-agent.mjs +115 -5
  9. package/cli.mjs +3 -2
  10. package/config/config.mjs +47 -33
  11. package/config/context-shredding-config.mjs +1 -1
  12. package/config/repo-root.mjs +41 -33
  13. package/desktop/main.mjs +350 -25
  14. package/desktop/preload.cjs +8 -0
  15. package/desktop/preload.mjs +19 -0
  16. package/entrypoint.mjs +332 -0
  17. package/git/sdk-conflict-resolver.mjs +1 -1
  18. package/infra/health-status.mjs +72 -0
  19. package/infra/library-manager.mjs +58 -1
  20. package/infra/maintenance.mjs +1 -2
  21. package/infra/monitor.mjs +26 -8
  22. package/infra/session-tracker.mjs +30 -3
  23. package/package.json +12 -4
  24. package/server/bosun-mcp-server.mjs +1004 -0
  25. package/server/setup-web-server.mjs +288 -259
  26. package/server/ui-server.mjs +1323 -26
  27. package/shell/claude-shell.mjs +14 -1
  28. package/shell/codex-config.mjs +1 -1
  29. package/shell/codex-model-profiles.mjs +170 -30
  30. package/shell/codex-shell.mjs +63 -18
  31. package/shell/opencode-providers.mjs +20 -8
  32. package/task/task-executor.mjs +28 -0
  33. package/task/task-store.mjs +13 -4
  34. package/telegram/telegram-sentinel.mjs +54 -3
  35. package/tools/list-todos.mjs +7 -1
  36. package/ui/app.js +3 -2
  37. package/ui/components/agent-selector.js +127 -0
  38. package/ui/components/session-list.js +15 -10
  39. package/ui/demo-defaults.js +334 -336
  40. package/ui/modules/router.js +2 -0
  41. package/ui/modules/state.js +13 -5
  42. package/ui/tabs/chat.js +3 -0
  43. package/ui/tabs/library.js +284 -52
  44. package/ui/tabs/tasks.js +5 -13
  45. package/ui/tabs/workflows.js +766 -3
  46. package/workflow/workflow-engine.mjs +246 -5
  47. package/workflow/workflow-nodes/definitions.mjs +37 -0
  48. package/workflow/workflow-nodes.mjs +1014 -184
  49. package/workflow/workflow-templates.mjs +0 -5
  50. package/workflow-templates/_helpers.mjs +253 -0
  51. package/workflow-templates/agents.mjs +199 -226
  52. package/workflow-templates/github.mjs +106 -16
  53. package/workflow-templates/sub-workflows.mjs +233 -0
  54. package/workflow-templates/task-execution.mjs +125 -471
  55. package/workflow-templates/task-lifecycle.mjs +11 -48
  56. package/workspace/command-diagnostics.mjs +460 -0
  57. package/workspace/context-cache.mjs +396 -28
  58. package/workspace/worktree-manager.mjs +1 -1
@@ -9,6 +9,17 @@
9
9
  * selects the best agents/skills for each phase based on the task + node prompt.
10
10
  * Users can override by manually selecting skills in the workflow editor.
11
11
  *
12
+ * ## Composition
13
+ *
14
+ * All 6 task-type templates share identical structure (trigger → phase₁ →
15
+ * phase₂ → … → done) and identical agent config boilerplate. They are now
16
+ * built with `makeAgentPipeline()` — a factory that only requires:
17
+ * - taskPattern regex
18
+ * - ordered phase definitions (id + label + prompt)
19
+ *
20
+ * To add a new task type: call makeAgentPipeline() with your phases.
21
+ * To change agent defaults: update agentDefaults() in _helpers.mjs once.
22
+ *
12
23
  * Templates:
13
24
  * - Fullstack Task Workflow
14
25
  * - Backend Task Workflow
@@ -18,15 +29,13 @@
18
29
  * - Design Task Workflow
19
30
  */
20
31
 
21
- import { node, edge, resetLayout } from "./_helpers.mjs";
32
+ import { makeAgentPipeline } from "./_helpers.mjs";
22
33
 
23
34
  // ═══════════════════════════════════════════════════════════════════════════
24
35
  // Fullstack Task Workflow
25
36
  // ═══════════════════════════════════════════════════════════════════════════
26
37
 
27
- resetLayout();
28
-
29
- export const FULLSTACK_TASK_TEMPLATE = {
38
+ export const FULLSTACK_TASK_TEMPLATE = makeAgentPipeline({
30
39
  id: "template-task-fullstack",
31
40
  name: "Fullstack Task Workflow",
32
41
  description:
@@ -34,32 +43,13 @@ export const FULLSTACK_TASK_TEMPLATE = {
34
43
  "database models, and UI components. Runs four agent phases: " +
35
44
  "architecture planning, backend implementation, frontend implementation, " +
36
45
  "and integration testing.",
37
- category: "task-execution",
38
- enabled: true,
46
+ taskPattern: "full.?stack|end.to.end|api.*ui|server.*client|frontend.*backend|database.*component",
47
+ tags: ["fullstack", "task-type"],
39
48
  recommended: true,
40
- trigger: "trigger.task_assigned",
41
- variables: {
42
- taskTimeoutMs: 21600000,
43
- maxRetries: 2,
44
- maxContinues: 3,
45
- testCommand: "auto",
46
- buildCommand: "auto",
47
- lintCommand: "auto",
48
- },
49
- metadata: {
50
- author: "bosun",
51
- version: 1,
52
- createdAt: "2025-06-01T00:00:00Z",
53
- templateVersion: "1.0.0",
54
- tags: ["fullstack", "task-type"],
55
- resolveMode: "library",
56
- },
57
- nodes: [
58
- node("trigger", "trigger.task_assigned", "Task Assigned", {
59
- taskPattern: "full.?stack|end.to.end|api.*ui|server.*client|frontend.*backend|database.*component",
60
- }, { x: 400, y: 50 }),
61
-
62
- node("plan-architecture", "action.run_agent", "Plan Architecture", {
49
+ phases: [
50
+ {
51
+ id: "plan-architecture",
52
+ label: "Plan Architecture",
63
53
  prompt: `## Phase: Architecture Planning
64
54
 
65
55
  Analyse the task and produce a concrete plan covering:
@@ -70,19 +60,10 @@ Analyse the task and produce a concrete plan covering:
70
60
  5. Integration points and data flow
71
61
 
72
62
  Do NOT write code yet — produce only the plan.`,
73
- taskId: "{{taskId}}",
74
- sdk: "{{resolvedSdk}}",
75
- model: "{{resolvedModel}}",
76
- agentProfile: "{{agentProfile}}",
77
- cwd: "{{worktreePath}}",
78
- timeoutMs: "{{taskTimeoutMs}}",
79
- maxRetries: "{{maxRetries}}",
80
- maxContinues: "{{maxContinues}}",
81
- resolveMode: "library",
82
- failOnError: false,
83
- }, { x: 400, y: 180 }),
84
-
85
- node("implement-backend", "action.run_agent", "Implement Backend", {
63
+ },
64
+ {
65
+ id: "implement-backend",
66
+ label: "Implement Backend",
86
67
  prompt: `## Phase: Backend Implementation
87
68
 
88
69
  Implement the server-side / API changes from the architecture plan:
@@ -93,19 +74,10 @@ Implement the server-side / API changes from the architecture plan:
93
74
  - Run tests: {{testCommand}}
94
75
 
95
76
  Commit backend changes separately.`,
96
- taskId: "{{taskId}}",
97
- sdk: "{{resolvedSdk}}",
98
- model: "{{resolvedModel}}",
99
- agentProfile: "{{agentProfile}}",
100
- cwd: "{{worktreePath}}",
101
- timeoutMs: "{{taskTimeoutMs}}",
102
- maxRetries: "{{maxRetries}}",
103
- maxContinues: "{{maxContinues}}",
104
- resolveMode: "library",
105
- failOnError: false,
106
- }, { x: 400, y: 340 }),
107
-
108
- node("implement-frontend", "action.run_agent", "Implement Frontend", {
77
+ },
78
+ {
79
+ id: "implement-frontend",
80
+ label: "Implement Frontend",
109
81
  prompt: `## Phase: Frontend Implementation
110
82
 
111
83
  Implement the client-side / UI changes:
@@ -116,19 +88,10 @@ Implement the client-side / UI changes:
116
88
  - Run build: {{buildCommand}}
117
89
 
118
90
  Commit frontend changes separately.`,
119
- taskId: "{{taskId}}",
120
- sdk: "{{resolvedSdk}}",
121
- model: "{{resolvedModel}}",
122
- agentProfile: "{{agentProfile}}",
123
- cwd: "{{worktreePath}}",
124
- timeoutMs: "{{taskTimeoutMs}}",
125
- maxRetries: "{{maxRetries}}",
126
- maxContinues: "{{maxContinues}}",
127
- resolveMode: "library",
128
- failOnError: false,
129
- }, { x: 400, y: 500 }),
130
-
131
- node("integration-test", "action.run_agent", "Integration Test", {
91
+ },
92
+ {
93
+ id: "integration-test",
94
+ label: "Integration Test",
132
95
  prompt: `## Phase: Integration Testing
133
96
 
134
97
  Verify the full stack works end-to-end:
@@ -139,71 +102,30 @@ Verify the full stack works end-to-end:
139
102
  5. Ensure all tests pass before completing
140
103
 
141
104
  Push all changes and create/update the PR.`,
142
- taskId: "{{taskId}}",
143
- sdk: "{{resolvedSdk}}",
144
- model: "{{resolvedModel}}",
145
- agentProfile: "{{agentProfile}}",
146
- cwd: "{{worktreePath}}",
147
- timeoutMs: "{{taskTimeoutMs}}",
148
- maxRetries: "{{maxRetries}}",
149
- maxContinues: "{{maxContinues}}",
150
- resolveMode: "library",
151
- failOnError: false,
152
- }, { x: 400, y: 660 }),
153
-
154
- node("done", "notify.log", "Complete", {
155
- message: "Fullstack task completed — all layers implemented and tested.",
156
- }, { x: 400, y: 820 }),
105
+ },
157
106
  ],
158
- edges: [
159
- edge("trigger", "plan-architecture"),
160
- edge("plan-architecture", "implement-backend"),
161
- edge("implement-backend", "implement-frontend"),
162
- edge("implement-frontend", "integration-test"),
163
- edge("integration-test", "done"),
164
- ],
165
- };
107
+ doneMessage: "Fullstack task completed — all layers implemented and tested.",
108
+ });
166
109
 
167
110
 
168
111
  // ═══════════════════════════════════════════════════════════════════════════
169
112
  // Backend Task Workflow
170
113
  // ═══════════════════════════════════════════════════════════════════════════
171
114
 
172
- resetLayout();
173
-
174
- export const BACKEND_TASK_TEMPLATE = {
115
+ export const BACKEND_TASK_TEMPLATE = makeAgentPipeline({
175
116
  id: "template-task-backend",
176
117
  name: "Backend Task Workflow",
177
118
  description:
178
119
  "Specialised for server-side tasks — APIs, databases, services, " +
179
120
  "middleware. Runs three phases: plan, implement with TDD, and " +
180
121
  "verify with full test suite.",
181
- category: "task-execution",
182
- enabled: true,
122
+ taskPattern: "api|server|backend|database|model|migration|endpoint|middleware|service|graphql|rest|grpc",
123
+ tags: ["backend", "api", "server", "task-type"],
183
124
  recommended: true,
184
- trigger: "trigger.task_assigned",
185
- variables: {
186
- taskTimeoutMs: 21600000,
187
- maxRetries: 2,
188
- maxContinues: 3,
189
- testCommand: "auto",
190
- buildCommand: "auto",
191
- lintCommand: "auto",
192
- },
193
- metadata: {
194
- author: "bosun",
195
- version: 1,
196
- createdAt: "2025-06-01T00:00:00Z",
197
- templateVersion: "1.0.0",
198
- tags: ["backend", "api", "server", "task-type"],
199
- resolveMode: "library",
200
- },
201
- nodes: [
202
- node("trigger", "trigger.task_assigned", "Task Assigned", {
203
- taskPattern: "api|server|backend|database|model|migration|endpoint|middleware|service|graphql|rest|grpc",
204
- }, { x: 400, y: 50 }),
205
-
206
- node("plan", "action.run_agent", "Plan Backend", {
125
+ phases: [
126
+ {
127
+ id: "plan",
128
+ label: "Plan Backend",
207
129
  prompt: `## Phase: Backend Planning
208
130
 
209
131
  Analyse the task and produce a plan:
@@ -214,19 +136,10 @@ Analyse the task and produce a plan:
214
136
  5. Test plan (unit + integration)
215
137
 
216
138
  Do NOT write code yet.`,
217
- taskId: "{{taskId}}",
218
- sdk: "{{resolvedSdk}}",
219
- model: "{{resolvedModel}}",
220
- agentProfile: "{{agentProfile}}",
221
- cwd: "{{worktreePath}}",
222
- timeoutMs: "{{taskTimeoutMs}}",
223
- maxRetries: "{{maxRetries}}",
224
- maxContinues: "{{maxContinues}}",
225
- resolveMode: "library",
226
- failOnError: false,
227
- }, { x: 400, y: 180 }),
228
-
229
- node("implement-tdd", "action.run_agent", "Implement (TDD)", {
139
+ },
140
+ {
141
+ id: "implement-tdd",
142
+ label: "Implement (TDD)",
230
143
  prompt: `## Phase: Test-Driven Implementation
231
144
 
232
145
  1. Write tests FIRST for the planned changes
@@ -238,19 +151,10 @@ Do NOT write code yet.`,
238
151
  7. Run lint: {{lintCommand}}
239
152
 
240
153
  Commit with descriptive messages.`,
241
- taskId: "{{taskId}}",
242
- sdk: "{{resolvedSdk}}",
243
- model: "{{resolvedModel}}",
244
- agentProfile: "{{agentProfile}}",
245
- cwd: "{{worktreePath}}",
246
- timeoutMs: "{{taskTimeoutMs}}",
247
- maxRetries: "{{maxRetries}}",
248
- maxContinues: "{{maxContinues}}",
249
- resolveMode: "library",
250
- failOnError: false,
251
- }, { x: 400, y: 380 }),
252
-
253
- node("verify", "action.run_agent", "Verify & PR", {
154
+ },
155
+ {
156
+ id: "verify",
157
+ label: "Verify & PR",
254
158
  prompt: `## Phase: Verification
255
159
 
256
160
  1. Run the complete test suite: {{testCommand}}
@@ -258,70 +162,30 @@ Commit with descriptive messages.`,
258
162
  3. Ensure no regressions
259
163
  4. Push changes and create/update PR
260
164
  5. Include test results summary in PR description`,
261
- taskId: "{{taskId}}",
262
- sdk: "{{resolvedSdk}}",
263
- model: "{{resolvedModel}}",
264
- agentProfile: "{{agentProfile}}",
265
- cwd: "{{worktreePath}}",
266
- timeoutMs: "{{taskTimeoutMs}}",
267
- maxRetries: "{{maxRetries}}",
268
- maxContinues: "{{maxContinues}}",
269
- resolveMode: "library",
270
- failOnError: false,
271
- }, { x: 400, y: 560 }),
272
-
273
- node("done", "notify.log", "Complete", {
274
- message: "Backend task completed — API/service implemented and tested.",
275
- }, { x: 400, y: 720 }),
165
+ },
276
166
  ],
277
- edges: [
278
- edge("trigger", "plan"),
279
- edge("plan", "implement-tdd"),
280
- edge("implement-tdd", "verify"),
281
- edge("verify", "done"),
282
- ],
283
- };
167
+ doneMessage: "Backend task completed — API/service implemented and tested.",
168
+ });
284
169
 
285
170
 
286
171
  // ═══════════════════════════════════════════════════════════════════════════
287
172
  // Frontend Task Workflow
288
173
  // ═══════════════════════════════════════════════════════════════════════════
289
174
 
290
- resetLayout();
291
-
292
- export const FRONTEND_TASK_TEMPLATE = {
175
+ export const FRONTEND_TASK_TEMPLATE = makeAgentPipeline({
293
176
  id: "template-task-frontend",
294
177
  name: "Frontend Task Workflow",
295
178
  description:
296
179
  "Specialised for UI tasks — components, pages, styling, " +
297
180
  "accessibility. Runs three phases: design analysis, implement " +
298
181
  "with component tests, and visual verification.",
299
- category: "task-execution",
300
- enabled: true,
182
+ taskPattern: "frontend|ui|component|page|layout|style|css|responsive|accessibility|a11y|design.system",
183
+ tags: ["frontend", "ui", "css", "component", "task-type"],
301
184
  recommended: true,
302
- trigger: "trigger.task_assigned",
303
- variables: {
304
- taskTimeoutMs: 21600000,
305
- maxRetries: 2,
306
- maxContinues: 3,
307
- testCommand: "auto",
308
- buildCommand: "auto",
309
- lintCommand: "auto",
310
- },
311
- metadata: {
312
- author: "bosun",
313
- version: 1,
314
- createdAt: "2025-06-01T00:00:00Z",
315
- templateVersion: "1.0.0",
316
- tags: ["frontend", "ui", "css", "component", "task-type"],
317
- resolveMode: "library",
318
- },
319
- nodes: [
320
- node("trigger", "trigger.task_assigned", "Task Assigned", {
321
- taskPattern: "frontend|ui|component|page|layout|style|css|responsive|accessibility|a11y|design.system",
322
- }, { x: 400, y: 50 }),
323
-
324
- node("analyse-design", "action.run_agent", "Analyse Design", {
185
+ phases: [
186
+ {
187
+ id: "analyse-design",
188
+ label: "Analyse Design",
325
189
  prompt: `## Phase: Design Analysis
326
190
 
327
191
  Analyse the UI task requirements:
@@ -333,19 +197,10 @@ Analyse the UI task requirements:
333
197
  6. Component test plan
334
198
 
335
199
  Do NOT write code yet.`,
336
- taskId: "{{taskId}}",
337
- sdk: "{{resolvedSdk}}",
338
- model: "{{resolvedModel}}",
339
- agentProfile: "{{agentProfile}}",
340
- cwd: "{{worktreePath}}",
341
- timeoutMs: "{{taskTimeoutMs}}",
342
- maxRetries: "{{maxRetries}}",
343
- maxContinues: "{{maxContinues}}",
344
- resolveMode: "library",
345
- failOnError: false,
346
- }, { x: 400, y: 180 }),
347
-
348
- node("implement-ui", "action.run_agent", "Implement UI", {
200
+ },
201
+ {
202
+ id: "implement-ui",
203
+ label: "Implement UI",
349
204
  prompt: `## Phase: UI Implementation
350
205
 
351
206
  1. Create / update components per the design plan
@@ -357,19 +212,10 @@ Do NOT write code yet.`,
357
212
  7. Run lint: {{lintCommand}}
358
213
 
359
214
  Commit with descriptive messages.`,
360
- taskId: "{{taskId}}",
361
- sdk: "{{resolvedSdk}}",
362
- model: "{{resolvedModel}}",
363
- agentProfile: "{{agentProfile}}",
364
- cwd: "{{worktreePath}}",
365
- timeoutMs: "{{taskTimeoutMs}}",
366
- maxRetries: "{{maxRetries}}",
367
- maxContinues: "{{maxContinues}}",
368
- resolveMode: "library",
369
- failOnError: false,
370
- }, { x: 400, y: 380 }),
371
-
372
- node("verify-visual", "action.run_agent", "Verify & PR", {
215
+ },
216
+ {
217
+ id: "verify-visual",
218
+ label: "Verify & PR",
373
219
  prompt: `## Phase: Visual Verification
374
220
 
375
221
  1. Run the full test suite: {{testCommand}}
@@ -378,70 +224,31 @@ Commit with descriptive messages.`,
378
224
  4. Check responsive breakpoints
379
225
  5. Verify accessibility (screen reader, keyboard)
380
226
  6. Push changes and create/update PR`,
381
- taskId: "{{taskId}}",
382
- sdk: "{{resolvedSdk}}",
383
- model: "{{resolvedModel}}",
384
- agentProfile: "{{agentProfile}}",
385
- cwd: "{{worktreePath}}",
386
- timeoutMs: "{{taskTimeoutMs}}",
387
- maxRetries: "{{maxRetries}}",
388
- maxContinues: "{{maxContinues}}",
389
- resolveMode: "library",
390
- failOnError: false,
391
- }, { x: 400, y: 560 }),
392
-
393
- node("done", "notify.log", "Complete", {
394
- message: "Frontend task completed — UI implemented and verified.",
395
- }, { x: 400, y: 720 }),
227
+ },
396
228
  ],
397
- edges: [
398
- edge("trigger", "analyse-design"),
399
- edge("analyse-design", "implement-ui"),
400
- edge("implement-ui", "verify-visual"),
401
- edge("verify-visual", "done"),
402
- ],
403
- };
229
+ doneMessage: "Frontend task completed — UI implemented and verified.",
230
+ });
404
231
 
405
232
 
406
233
  // ═══════════════════════════════════════════════════════════════════════════
407
234
  // Debug Task Workflow
408
235
  // ═══════════════════════════════════════════════════════════════════════════
409
236
 
410
- resetLayout();
411
-
412
- export const DEBUG_TASK_TEMPLATE = {
237
+ export const DEBUG_TASK_TEMPLATE = makeAgentPipeline({
413
238
  id: "template-task-debug",
414
239
  name: "Debug Task Workflow",
415
240
  description:
416
241
  "Bug investigation and fix workflow. Starts with reproduction " +
417
242
  "and root-cause analysis, then implements a targeted fix with " +
418
243
  "regression tests.",
419
- category: "task-execution",
420
- enabled: true,
244
+ taskPattern: "bug|fix|error|crash|regression|broken|debug|issue|defect|hotfix|patch",
245
+ tags: ["debug", "bug", "fix", "error", "task-type"],
421
246
  recommended: true,
422
- trigger: "trigger.task_assigned",
423
- variables: {
424
- taskTimeoutMs: 21600000,
425
- maxRetries: 3,
426
- maxContinues: 4,
427
- testCommand: "auto",
428
- buildCommand: "auto",
429
- lintCommand: "auto",
430
- },
431
- metadata: {
432
- author: "bosun",
433
- version: 1,
434
- createdAt: "2025-06-01T00:00:00Z",
435
- templateVersion: "1.0.0",
436
- tags: ["debug", "bug", "fix", "error", "task-type"],
437
- resolveMode: "library",
438
- },
439
- nodes: [
440
- node("trigger", "trigger.task_assigned", "Task Assigned", {
441
- taskPattern: "bug|fix|error|crash|regression|broken|debug|issue|defect|hotfix|patch",
442
- }, { x: 400, y: 50 }),
443
-
444
- node("reproduce", "action.run_agent", "Reproduce & Analyse", {
247
+ variables: { maxRetries: 3, maxContinues: 4 },
248
+ phases: [
249
+ {
250
+ id: "reproduce",
251
+ label: "Reproduce & Analyse",
445
252
  prompt: `## Phase: Bug Reproduction & Root Cause Analysis
446
253
 
447
254
  1. Read the bug report carefully
@@ -451,19 +258,10 @@ export const DEBUG_TASK_TEMPLATE = {
451
258
  5. Document: what fails, where, why, and the minimal fix needed
452
259
 
453
260
  Do NOT fix the bug yet — only diagnose.`,
454
- taskId: "{{taskId}}",
455
- sdk: "{{resolvedSdk}}",
456
- model: "{{resolvedModel}}",
457
- agentProfile: "{{agentProfile}}",
458
- cwd: "{{worktreePath}}",
459
- timeoutMs: "{{taskTimeoutMs}}",
460
- maxRetries: "{{maxRetries}}",
461
- maxContinues: "{{maxContinues}}",
462
- resolveMode: "library",
463
- failOnError: false,
464
- }, { x: 400, y: 180 }),
465
-
466
- node("fix-and-test", "action.run_agent", "Fix & Regression Test", {
261
+ },
262
+ {
263
+ id: "fix-and-test",
264
+ label: "Fix & Regression Test",
467
265
  prompt: `## Phase: Fix Implementation with Regression Tests
468
266
 
469
267
  1. Write a regression test that demonstrates the bug (must fail before fix)
@@ -475,19 +273,10 @@ Do NOT fix the bug yet — only diagnose.`,
475
273
  7. Ensure no other tests broke
476
274
 
477
275
  Commit fix and test together with a clear commit message.`,
478
- taskId: "{{taskId}}",
479
- sdk: "{{resolvedSdk}}",
480
- model: "{{resolvedModel}}",
481
- agentProfile: "{{agentProfile}}",
482
- cwd: "{{worktreePath}}",
483
- timeoutMs: "{{taskTimeoutMs}}",
484
- maxRetries: "{{maxRetries}}",
485
- maxContinues: "{{maxContinues}}",
486
- resolveMode: "library",
487
- failOnError: false,
488
- }, { x: 400, y: 380 }),
489
-
490
- node("verify", "action.run_agent", "Verify & PR", {
276
+ },
277
+ {
278
+ id: "verify",
279
+ label: "Verify & PR",
491
280
  prompt: `## Phase: Final Verification
492
281
 
493
282
  1. Run complete test suite: {{testCommand}}
@@ -495,70 +284,30 @@ Commit fix and test together with a clear commit message.`,
495
284
  3. Confirm the original bug is fixed
496
285
  4. Confirm no regressions
497
286
  5. Push and create/update PR with root cause analysis in description`,
498
- taskId: "{{taskId}}",
499
- sdk: "{{resolvedSdk}}",
500
- model: "{{resolvedModel}}",
501
- agentProfile: "{{agentProfile}}",
502
- cwd: "{{worktreePath}}",
503
- timeoutMs: "{{taskTimeoutMs}}",
504
- maxRetries: "{{maxRetries}}",
505
- maxContinues: "{{maxContinues}}",
506
- resolveMode: "library",
507
- failOnError: false,
508
- }, { x: 400, y: 560 }),
509
-
510
- node("done", "notify.log", "Complete", {
511
- message: "Debug task completed — bug fixed with regression test.",
512
- }, { x: 400, y: 720 }),
287
+ },
513
288
  ],
514
- edges: [
515
- edge("trigger", "reproduce"),
516
- edge("reproduce", "fix-and-test"),
517
- edge("fix-and-test", "verify"),
518
- edge("verify", "done"),
519
- ],
520
- };
289
+ doneMessage: "Debug task completed — bug fixed with regression test.",
290
+ });
521
291
 
522
292
 
523
293
  // ═══════════════════════════════════════════════════════════════════════════
524
294
  // CI/CD Task Workflow
525
295
  // ═══════════════════════════════════════════════════════════════════════════
526
296
 
527
- resetLayout();
528
-
529
- export const CICD_TASK_TEMPLATE = {
297
+ export const CICD_TASK_TEMPLATE = makeAgentPipeline({
530
298
  id: "template-task-cicd",
531
299
  name: "CI/CD Task Workflow",
532
300
  description:
533
301
  "For pipeline, deployment, infrastructure, and build-system tasks. " +
534
302
  "Plans the change, implements with validation steps, then verifies " +
535
303
  "the pipeline works end-to-end.",
536
- category: "task-execution",
537
- enabled: true,
304
+ taskPattern: "ci|cd|pipeline|deploy|infrastructure|docker|kubernetes|k8s|terraform|github.action|build.system|release|devops",
305
+ tags: ["ci", "cd", "pipeline", "deploy", "infrastructure", "task-type"],
538
306
  recommended: true,
539
- trigger: "trigger.task_assigned",
540
- variables: {
541
- taskTimeoutMs: 21600000,
542
- maxRetries: 2,
543
- maxContinues: 3,
544
- testCommand: "auto",
545
- buildCommand: "auto",
546
- lintCommand: "auto",
547
- },
548
- metadata: {
549
- author: "bosun",
550
- version: 1,
551
- createdAt: "2025-06-01T00:00:00Z",
552
- templateVersion: "1.0.0",
553
- tags: ["ci", "cd", "pipeline", "deploy", "infrastructure", "task-type"],
554
- resolveMode: "library",
555
- },
556
- nodes: [
557
- node("trigger", "trigger.task_assigned", "Task Assigned", {
558
- taskPattern: "ci|cd|pipeline|deploy|infrastructure|docker|kubernetes|k8s|terraform|github.action|build.system|release|devops",
559
- }, { x: 400, y: 50 }),
560
-
561
- node("plan-pipeline", "action.run_agent", "Plan Pipeline Change", {
307
+ phases: [
308
+ {
309
+ id: "plan-pipeline",
310
+ label: "Plan Pipeline Change",
562
311
  prompt: `## Phase: CI/CD Planning
563
312
 
564
313
  Analyse the pipeline/infrastructure task:
@@ -569,19 +318,10 @@ Analyse the pipeline/infrastructure task:
569
318
  5. Test plan for verifying the change
570
319
 
571
320
  Do NOT make changes yet.`,
572
- taskId: "{{taskId}}",
573
- sdk: "{{resolvedSdk}}",
574
- model: "{{resolvedModel}}",
575
- agentProfile: "{{agentProfile}}",
576
- cwd: "{{worktreePath}}",
577
- timeoutMs: "{{taskTimeoutMs}}",
578
- maxRetries: "{{maxRetries}}",
579
- maxContinues: "{{maxContinues}}",
580
- resolveMode: "library",
581
- failOnError: false,
582
- }, { x: 400, y: 180 }),
583
-
584
- node("implement-pipeline", "action.run_agent", "Implement Pipeline", {
321
+ },
322
+ {
323
+ id: "implement-pipeline",
324
+ label: "Implement Pipeline",
585
325
  prompt: `## Phase: Pipeline Implementation
586
326
 
587
327
  1. Make the CI/CD / infrastructure changes per the plan
@@ -592,19 +332,10 @@ Do NOT make changes yet.`,
592
332
  6. Validate configuration syntax
593
333
 
594
334
  Commit changes with clear descriptions.`,
595
- taskId: "{{taskId}}",
596
- sdk: "{{resolvedSdk}}",
597
- model: "{{resolvedModel}}",
598
- agentProfile: "{{agentProfile}}",
599
- cwd: "{{worktreePath}}",
600
- timeoutMs: "{{taskTimeoutMs}}",
601
- maxRetries: "{{maxRetries}}",
602
- maxContinues: "{{maxContinues}}",
603
- resolveMode: "library",
604
- failOnError: false,
605
- }, { x: 400, y: 380 }),
606
-
607
- node("verify-pipeline", "action.run_agent", "Verify & PR", {
335
+ },
336
+ {
337
+ id: "verify-pipeline",
338
+ label: "Verify & PR",
608
339
  prompt: `## Phase: Pipeline Verification
609
340
 
610
341
  1. Run full test suite: {{testCommand}}
@@ -612,69 +343,29 @@ Commit changes with clear descriptions.`,
612
343
  3. Verify pipeline configuration is valid
613
344
  4. Push and create/update PR
614
345
  5. Include deployment / rollback instructions in PR description`,
615
- taskId: "{{taskId}}",
616
- sdk: "{{resolvedSdk}}",
617
- model: "{{resolvedModel}}",
618
- agentProfile: "{{agentProfile}}",
619
- cwd: "{{worktreePath}}",
620
- timeoutMs: "{{taskTimeoutMs}}",
621
- maxRetries: "{{maxRetries}}",
622
- maxContinues: "{{maxContinues}}",
623
- resolveMode: "library",
624
- failOnError: false,
625
- }, { x: 400, y: 560 }),
626
-
627
- node("done", "notify.log", "Complete", {
628
- message: "CI/CD task completed — pipeline updated and verified.",
629
- }, { x: 400, y: 720 }),
346
+ },
630
347
  ],
631
- edges: [
632
- edge("trigger", "plan-pipeline"),
633
- edge("plan-pipeline", "implement-pipeline"),
634
- edge("implement-pipeline", "verify-pipeline"),
635
- edge("verify-pipeline", "done"),
636
- ],
637
- };
348
+ doneMessage: "CI/CD task completed — pipeline updated and verified.",
349
+ });
638
350
 
639
351
 
640
352
  // ═══════════════════════════════════════════════════════════════════════════
641
353
  // Design Task Workflow
642
354
  // ═══════════════════════════════════════════════════════════════════════════
643
355
 
644
- resetLayout();
645
-
646
- export const DESIGN_TASK_TEMPLATE = {
356
+ export const DESIGN_TASK_TEMPLATE = makeAgentPipeline({
647
357
  id: "template-task-design",
648
358
  name: "Design Task Workflow",
649
359
  description:
650
360
  "For design-related tasks — mockups, wireframes, design tokens, " +
651
361
  "component library work. Analyses design requirements, implements " +
652
362
  "the design system changes, and verifies visual output.",
653
- category: "task-execution",
654
- enabled: true,
655
- trigger: "trigger.task_assigned",
656
- variables: {
657
- taskTimeoutMs: 21600000,
658
- maxRetries: 2,
659
- maxContinues: 3,
660
- testCommand: "auto",
661
- buildCommand: "auto",
662
- lintCommand: "auto",
663
- },
664
- metadata: {
665
- author: "bosun",
666
- version: 1,
667
- createdAt: "2025-06-01T00:00:00Z",
668
- templateVersion: "1.0.0",
669
- tags: ["design", "mockup", "wireframe", "design-system", "task-type"],
670
- resolveMode: "library",
671
- },
672
- nodes: [
673
- node("trigger", "trigger.task_assigned", "Task Assigned", {
674
- taskPattern: "design|mockup|wireframe|prototype|design.system|theme|color|typography|icon|illustration|ux",
675
- }, { x: 400, y: 50 }),
676
-
677
- node("analyse-requirements", "action.run_agent", "Analyse Design Req", {
363
+ taskPattern: "design|mockup|wireframe|prototype|design.system|theme|color|typography|icon|illustration|ux",
364
+ tags: ["design", "mockup", "wireframe", "design-system", "task-type"],
365
+ phases: [
366
+ {
367
+ id: "analyse-requirements",
368
+ label: "Analyse Design Req",
678
369
  prompt: `## Phase: Design Requirements Analysis
679
370
 
680
371
  1. Review the design task requirements
@@ -684,19 +375,10 @@ export const DESIGN_TASK_TEMPLATE = {
684
375
  5. List affected files and components
685
376
 
686
377
  Do NOT make changes yet.`,
687
- taskId: "{{taskId}}",
688
- sdk: "{{resolvedSdk}}",
689
- model: "{{resolvedModel}}",
690
- agentProfile: "{{agentProfile}}",
691
- cwd: "{{worktreePath}}",
692
- timeoutMs: "{{taskTimeoutMs}}",
693
- maxRetries: "{{maxRetries}}",
694
- maxContinues: "{{maxContinues}}",
695
- resolveMode: "library",
696
- failOnError: false,
697
- }, { x: 400, y: 180 }),
698
-
699
- node("implement-design", "action.run_agent", "Implement Design", {
378
+ },
379
+ {
380
+ id: "implement-design",
381
+ label: "Implement Design",
700
382
  prompt: `## Phase: Design Implementation
701
383
 
702
384
  1. Update design tokens (colors, spacing, typography) if needed
@@ -707,19 +389,10 @@ Do NOT make changes yet.`,
707
389
  6. Run lint: {{lintCommand}}
708
390
 
709
391
  Commit changes with descriptive messages.`,
710
- taskId: "{{taskId}}",
711
- sdk: "{{resolvedSdk}}",
712
- model: "{{resolvedModel}}",
713
- agentProfile: "{{agentProfile}}",
714
- cwd: "{{worktreePath}}",
715
- timeoutMs: "{{taskTimeoutMs}}",
716
- maxRetries: "{{maxRetries}}",
717
- maxContinues: "{{maxContinues}}",
718
- resolveMode: "library",
719
- failOnError: false,
720
- }, { x: 400, y: 380 }),
721
-
722
- node("verify-design", "action.run_agent", "Verify & PR", {
392
+ },
393
+ {
394
+ id: "verify-design",
395
+ label: "Verify & PR",
723
396
  prompt: `## Phase: Design Verification
724
397
 
725
398
  1. Run tests: {{testCommand}}
@@ -727,26 +400,7 @@ Commit changes with descriptive messages.`,
727
400
  3. Verify visual consistency
728
401
  4. Check design token values are correct
729
402
  5. Push and create/update PR`,
730
- taskId: "{{taskId}}",
731
- sdk: "{{resolvedSdk}}",
732
- model: "{{resolvedModel}}",
733
- agentProfile: "{{agentProfile}}",
734
- cwd: "{{worktreePath}}",
735
- timeoutMs: "{{taskTimeoutMs}}",
736
- maxRetries: "{{maxRetries}}",
737
- maxContinues: "{{maxContinues}}",
738
- resolveMode: "library",
739
- failOnError: false,
740
- }, { x: 400, y: 560 }),
741
-
742
- node("done", "notify.log", "Complete", {
743
- message: "Design task completed — design changes implemented and verified.",
744
- }, { x: 400, y: 720 }),
745
- ],
746
- edges: [
747
- edge("trigger", "analyse-requirements"),
748
- edge("analyse-requirements", "implement-design"),
749
- edge("implement-design", "verify-design"),
750
- edge("verify-design", "done"),
403
+ },
751
404
  ],
752
- };
405
+ doneMessage: "Design task completed — design changes implemented and verified.",
406
+ });