agentweaver 0.1.15 → 0.1.16

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 (94) hide show
  1. package/README.md +26 -9
  2. package/dist/artifact-manifest.js +219 -0
  3. package/dist/artifacts.js +15 -0
  4. package/dist/doctor/checks/env-diagnostics.js +25 -0
  5. package/dist/doctor/checks/flow-readiness.js +15 -18
  6. package/dist/flow-state.js +75 -15
  7. package/dist/index.js +391 -175
  8. package/dist/interactive/blessed-session.js +361 -0
  9. package/dist/interactive/controller.js +1293 -0
  10. package/dist/interactive/create-interactive-session.js +5 -0
  11. package/dist/interactive/ink/index.js +576 -0
  12. package/dist/interactive/progress.js +245 -0
  13. package/dist/interactive/selectors.js +14 -0
  14. package/dist/interactive/session.js +1 -0
  15. package/dist/interactive/state.js +34 -0
  16. package/dist/interactive/tree.js +155 -0
  17. package/dist/interactive/types.js +1 -0
  18. package/dist/interactive/view-model.js +1 -0
  19. package/dist/interactive-ui.js +159 -194
  20. package/dist/pipeline/context.js +1 -0
  21. package/dist/pipeline/declarative-flow-runner.js +212 -6
  22. package/dist/pipeline/declarative-flows.js +27 -0
  23. package/dist/pipeline/execution-routing-config.js +15 -0
  24. package/dist/pipeline/flow-catalog.js +19 -3
  25. package/dist/pipeline/flow-run-resume.js +29 -0
  26. package/dist/pipeline/flow-specs/auto-common.json +89 -360
  27. package/dist/pipeline/flow-specs/auto-golang.json +58 -363
  28. package/dist/pipeline/flow-specs/auto-simple.json +141 -0
  29. package/dist/pipeline/flow-specs/bugz/bug-analyze.json +2 -0
  30. package/dist/pipeline/flow-specs/bugz/bug-fix.json +1 -0
  31. package/dist/pipeline/flow-specs/design-review/design-review-loop.json +304 -0
  32. package/dist/pipeline/flow-specs/design-review.json +10 -0
  33. package/dist/pipeline/flow-specs/gitlab/gitlab-diff-review.json +11 -0
  34. package/dist/pipeline/flow-specs/gitlab/gitlab-review.json +2 -0
  35. package/dist/pipeline/flow-specs/gitlab/mr-description.json +1 -0
  36. package/dist/pipeline/flow-specs/go/run-go-linter-loop.json +2 -0
  37. package/dist/pipeline/flow-specs/go/run-go-tests-loop.json +2 -0
  38. package/dist/pipeline/flow-specs/implement.json +13 -6
  39. package/dist/pipeline/flow-specs/instant-task.json +177 -0
  40. package/dist/pipeline/flow-specs/normalize-task-source.json +311 -0
  41. package/dist/pipeline/flow-specs/plan-revise.json +7 -1
  42. package/dist/pipeline/flow-specs/plan.json +48 -70
  43. package/dist/pipeline/flow-specs/review/review-fix.json +24 -4
  44. package/dist/pipeline/flow-specs/review/review-loop.json +351 -45
  45. package/dist/pipeline/flow-specs/review/review-project-loop.json +590 -0
  46. package/dist/pipeline/flow-specs/review/review-project.json +12 -0
  47. package/dist/pipeline/flow-specs/review/review.json +37 -31
  48. package/dist/pipeline/flow-specs/task-describe.json +2 -0
  49. package/dist/pipeline/flow-specs/task-source/jira-fetch.json +70 -0
  50. package/dist/pipeline/flow-specs/task-source/manual-input.json +216 -0
  51. package/dist/pipeline/node-registry.js +41 -1
  52. package/dist/pipeline/node-runner.js +3 -2
  53. package/dist/pipeline/nodes/build-review-fix-prompt-node.js +5 -1
  54. package/dist/pipeline/nodes/clear-ready-to-merge-node.js +11 -0
  55. package/dist/pipeline/nodes/commit-message-form-node.js +8 -0
  56. package/dist/pipeline/nodes/design-review-verdict-node.js +36 -0
  57. package/dist/pipeline/nodes/ensure-summary-json-node.js +13 -2
  58. package/dist/pipeline/nodes/fetch-gitlab-diff-node.js +19 -2
  59. package/dist/pipeline/nodes/fetch-gitlab-review-node.js +19 -2
  60. package/dist/pipeline/nodes/flow-run-node.js +226 -7
  61. package/dist/pipeline/nodes/git-commit-form-node.js +8 -0
  62. package/dist/pipeline/nodes/gitlab-review-artifacts-node.js +19 -2
  63. package/dist/pipeline/nodes/jira-fetch-node.js +50 -4
  64. package/dist/pipeline/nodes/llm-prompt-node.js +32 -12
  65. package/dist/pipeline/nodes/planning-bundle-node.js +10 -0
  66. package/dist/pipeline/nodes/review-verdict-node.js +86 -0
  67. package/dist/pipeline/nodes/select-files-form-node.js +8 -0
  68. package/dist/pipeline/nodes/structured-summary-node.js +24 -0
  69. package/dist/pipeline/nodes/user-input-node.js +38 -3
  70. package/dist/pipeline/nodes/write-selection-file-node.js +20 -4
  71. package/dist/pipeline/prompt-registry.js +3 -1
  72. package/dist/pipeline/prompt-runtime.js +4 -1
  73. package/dist/pipeline/review-iteration.js +26 -0
  74. package/dist/pipeline/spec-compiler.js +2 -0
  75. package/dist/pipeline/spec-types.js +3 -0
  76. package/dist/pipeline/spec-validator.js +14 -0
  77. package/dist/pipeline/value-resolver.js +74 -1
  78. package/dist/prompts.js +36 -14
  79. package/dist/review-severity.js +45 -0
  80. package/dist/runtime/artifact-registry.js +402 -0
  81. package/dist/runtime/design-review-input-contract.js +17 -16
  82. package/dist/runtime/env-loader.js +3 -0
  83. package/dist/runtime/execution-routing-store.js +134 -0
  84. package/dist/runtime/execution-routing.js +227 -0
  85. package/dist/runtime/interactive-execution-routing.js +462 -0
  86. package/dist/runtime/plan-revise-input-contract.js +35 -32
  87. package/dist/runtime/planning-bundle.js +123 -0
  88. package/dist/runtime/ready-to-merge.js +22 -1
  89. package/dist/runtime/review-input-contract.js +100 -0
  90. package/dist/structured-artifact-schema-registry.js +9 -0
  91. package/dist/structured-artifact-schemas.json +140 -1
  92. package/dist/structured-artifacts.js +77 -6
  93. package/dist/user-input.js +70 -3
  94. package/package.json +6 -3
@@ -1,393 +1,111 @@
1
1
  {
2
2
  "kind": "auto-flow",
3
3
  "version": 1,
4
- "description": "End-to-end resumable pipeline without language-specific checks. Runs: plan (with Jira fetch and Q&A) → implement → review loop. Simplified alternative to auto-golang for projects that do not need Go linter/test loops.",
4
+ "description": "End-to-end resumable pipeline without language-specific checks. Runs: Jira fetch task source normalization plan → design-review loop → implement → review loop. Planning gate requires design-review approval, or an explicit user decision to continue after the maximum revision attempts, before implementation.",
5
5
  "phases": [
6
6
  {
7
- "id": "plan",
7
+ "id": "source",
8
8
  "steps": [
9
9
  {
10
- "id": "fetch_jira",
11
- "node": "jira-fetch",
10
+ "id": "fetch_jira_source",
11
+ "node": "flow-run",
12
12
  "params": {
13
+ "fileName": { "const": "jira-fetch.json" },
14
+ "labelText": { "const": "Fetching Jira task source" },
13
15
  "jiraApiUrl": { "ref": "params.jiraApiUrl" },
14
- "outputFile": {
15
- "artifact": {
16
- "kind": "jira-task-file",
17
- "taskKey": { "ref": "params.taskKey" }
18
- }
19
- },
20
- "attachmentsManifestFile": {
21
- "artifact": {
22
- "kind": "jira-attachments-manifest-file",
23
- "taskKey": { "ref": "params.taskKey" }
24
- }
25
- },
26
- "attachmentsContextFile": {
27
- "artifact": {
28
- "kind": "jira-attachments-context-file",
29
- "taskKey": { "ref": "params.taskKey" }
30
- }
31
- }
32
- },
33
- "expect": [
34
- {
35
- "kind": "require-file",
36
- "path": {
37
- "artifact": {
38
- "kind": "jira-task-file",
39
- "taskKey": { "ref": "params.taskKey" }
40
- }
41
- },
42
- "message": "Jira fetch node did not produce the Jira task file."
43
- },
44
- {
45
- "kind": "require-file",
46
- "path": {
47
- "artifact": {
48
- "kind": "jira-attachments-manifest-file",
49
- "taskKey": { "ref": "params.taskKey" }
50
- }
51
- },
52
- "message": "Jira fetch node did not produce the Jira attachments manifest file."
53
- },
54
- {
55
- "kind": "require-file",
56
- "path": {
57
- "artifact": {
58
- "kind": "jira-attachments-context-file",
59
- "taskKey": { "ref": "params.taskKey" }
60
- }
61
- },
62
- "message": "Jira fetch node did not produce the Jira attachments context file."
63
- }
64
- ]
65
- },
66
- {
67
- "id": "generate_planning_questions",
68
- "node": "llm-prompt",
69
- "prompt": {
70
- "templateRef": "plan-questions",
71
- "vars": {
72
- "jira_task_file": {
73
- "artifact": {
74
- "kind": "jira-task-file",
75
- "taskKey": { "ref": "params.taskKey" }
76
- }
77
- },
78
- "jira_attachments_manifest_file": {
79
- "artifact": {
80
- "kind": "jira-attachments-manifest-file",
81
- "taskKey": { "ref": "params.taskKey" }
82
- }
83
- },
84
- "jira_attachments_context_file": {
85
- "artifact": {
86
- "kind": "jira-attachments-context-file",
87
- "taskKey": { "ref": "params.taskKey" }
88
- }
89
- },
90
- "planning_questions_json_file": {
91
- "artifact": {
92
- "kind": "planning-questions-json-file",
93
- "taskKey": { "ref": "params.taskKey" }
94
- }
95
- }
96
- },
97
- "extraPrompt": { "ref": "params.extraPrompt" },
98
- "format": "task-prompt"
99
- },
100
- "params": {
101
- "labelText": { "const": "Generating planning questions" },
102
- "model": { "ref": "params.llmModel" },
103
- "executor": { "ref": "params.llmExecutor" },
104
- "requiredArtifacts": {
105
- "list": [
106
- {
107
- "artifact": {
108
- "kind": "planning-questions-json-file",
109
- "taskKey": { "ref": "params.taskKey" }
110
- }
111
- }
112
- ]
113
- }
114
- },
115
- "expect": [
116
- {
117
- "kind": "require-artifacts",
118
- "when": { "not": { "ref": "context.dryRun" } },
119
- "paths": {
120
- "list": [
121
- {
122
- "artifact": {
123
- "kind": "planning-questions-json-file",
124
- "taskKey": { "ref": "params.taskKey" }
125
- }
126
- }
127
- ]
128
- },
129
- "message": "Planning questions step did not produce the questions artifact."
130
- },
131
- {
132
- "kind": "require-structured-artifacts",
133
- "when": { "not": { "ref": "context.dryRun" } },
134
- "items": [
135
- {
136
- "path": {
137
- "artifact": {
138
- "kind": "planning-questions-json-file",
139
- "taskKey": { "ref": "params.taskKey" }
140
- }
141
- },
142
- "schemaId": "planning-questions/v1"
143
- }
144
- ],
145
- "message": "Planning questions step produced invalid structured artifacts."
146
- }
147
- ]
148
- },
16
+ "taskKey": { "ref": "params.taskKey" }
17
+ }
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "id": "normalize",
23
+ "steps": [
149
24
  {
150
- "id": "build_planning_questions_form",
151
- "node": "planning-questions-form",
25
+ "id": "run_normalize_source",
26
+ "node": "flow-run",
152
27
  "params": {
153
- "planningQuestionsJsonFile": {
154
- "artifact": {
155
- "kind": "planning-questions-json-file",
156
- "taskKey": { "ref": "params.taskKey" }
157
- }
158
- },
159
- "formId": { "const": "planning-questions" },
160
- "title": { "const": "Planning Questions" },
161
- "description": {
162
- "const": "Reply to model questions if they are needed for accurate design and plan. If there are no questions, the step will complete automatically."
163
- }
28
+ "fileName": { "const": "normalize-task-source.json" },
29
+ "labelText": { "const": "Normalizing task source" },
30
+ "taskKey": { "ref": "params.taskKey" },
31
+ "iteration": { "ref": "params.taskContextIteration" },
32
+ "llmExecutor": { "ref": "params.llmExecutor" },
33
+ "llmModel": { "ref": "params.llmModel" },
34
+ "extraPrompt": { "ref": "params.extraPrompt" }
164
35
  }
165
- },
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "id": "plan",
41
+ "steps": [
166
42
  {
167
- "id": "notify_planning_questions",
168
- "when": { "not": { "equals": [{ "ref": "steps.plan.build_planning_questions_form.value.questionCount" }, { "const": 0 }] } },
169
- "node": "telegram-notify",
43
+ "id": "run_plan_flow",
44
+ "node": "flow-run",
170
45
  "params": {
171
- "message": {
172
- "template": "Planning questions generated for {taskKey}. Please review and answer if needed.",
173
- "vars": {
174
- "taskKey": { "ref": "params.taskKey" }
175
- }
176
- }
46
+ "fileName": { "const": "plan.json" },
47
+ "labelText": { "const": "Running planning flow" },
48
+ "taskKey": { "ref": "params.taskKey" },
49
+ "taskContextIteration": { "ref": "params.taskContextIteration" },
50
+ "designIteration": { "ref": "params.designIteration" },
51
+ "planIteration": { "ref": "params.planIteration" },
52
+ "qaIteration": { "ref": "params.qaIteration" },
53
+ "llmExecutor": { "ref": "params.llmExecutor" },
54
+ "llmModel": { "ref": "params.llmModel" },
55
+ "extraPrompt": { "ref": "params.extraPrompt" },
56
+ "mdLang": { "ref": "params.mdLang" }
177
57
  }
178
- },
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ "id": "design_review_loop",
63
+ "steps": [
179
64
  {
180
- "id": "collect_planning_answers",
181
- "node": "user-input",
65
+ "id": "run_design_review_loop",
66
+ "node": "flow-run",
182
67
  "params": {
183
- "formId": { "ref": "steps.plan.build_planning_questions_form.value.formId" },
184
- "title": { "ref": "steps.plan.build_planning_questions_form.value.title" },
185
- "description": { "ref": "steps.plan.build_planning_questions_form.value.description" },
186
- "submitLabel": { "const": "Continue planning" },
187
- "fields": { "ref": "steps.plan.build_planning_questions_form.value.fields" },
188
- "outputFile": {
189
- "artifact": {
190
- "kind": "planning-answers-json-file",
191
- "taskKey": { "ref": "params.taskKey" }
192
- }
193
- }
194
- },
195
- "expect": [
196
- {
197
- "kind": "require-structured-artifacts",
198
- "items": [
199
- {
200
- "path": {
201
- "artifact": {
202
- "kind": "planning-answers-json-file",
203
- "taskKey": { "ref": "params.taskKey" }
204
- }
205
- },
206
- "schemaId": "user-input/v1"
207
- }
208
- ],
209
- "message": "Planning answers input is missing or invalid."
210
- }
211
- ]
212
- },
213
- {
214
- "id": "run_plan",
215
- "node": "llm-prompt",
216
- "prompt": {
217
- "templateRef": "plan",
218
- "vars": {
219
- "jira_task_file": {
220
- "artifact": {
221
- "kind": "jira-task-file",
222
- "taskKey": { "ref": "params.taskKey" }
223
- }
224
- },
225
- "jira_attachments_manifest_file": {
226
- "artifact": {
227
- "kind": "jira-attachments-manifest-file",
228
- "taskKey": { "ref": "params.taskKey" }
229
- }
230
- },
231
- "jira_attachments_context_file": {
232
- "artifact": {
233
- "kind": "jira-attachments-context-file",
234
- "taskKey": { "ref": "params.taskKey" }
235
- }
236
- },
237
- "design_file": {
238
- "artifact": {
239
- "kind": "design-file",
240
- "taskKey": { "ref": "params.taskKey" },
241
- "iteration": { "ref": "params.designIteration" }
242
- }
243
- },
244
- "design_json_file": {
245
- "artifact": {
246
- "kind": "design-json-file",
247
- "taskKey": { "ref": "params.taskKey" },
248
- "iteration": { "ref": "params.designIteration" }
249
- }
250
- },
251
- "plan_file": {
252
- "artifact": {
253
- "kind": "plan-file",
254
- "taskKey": { "ref": "params.taskKey" },
255
- "iteration": { "ref": "params.planIteration" }
256
- }
257
- },
258
- "plan_json_file": {
259
- "artifact": {
260
- "kind": "plan-json-file",
261
- "taskKey": { "ref": "params.taskKey" },
262
- "iteration": { "ref": "params.planIteration" }
263
- }
264
- },
265
- "qa_file": {
266
- "artifact": {
267
- "kind": "qa-file",
268
- "taskKey": { "ref": "params.taskKey" },
269
- "iteration": { "ref": "params.qaIteration" }
270
- }
271
- },
272
- "qa_json_file": {
273
- "artifact": {
274
- "kind": "qa-json-file",
275
- "taskKey": { "ref": "params.taskKey" },
276
- "iteration": { "ref": "params.qaIteration" }
277
- }
278
- }
279
- },
280
- "extraPrompt": {
281
- "appendPrompt": {
282
- "base": { "ref": "params.extraPrompt" },
283
- "suffix": { "ref": "steps.plan.collect_planning_answers.value.promptSuffix" }
284
- }
285
- },
286
- "format": "task-prompt"
68
+ "fileName": { "const": "design-review-loop.json" },
69
+ "labelText": { "const": "Running design-review loop" },
70
+ "taskKey": { "ref": "params.taskKey" },
71
+ "workspaceDir": { "ref": "params.workspaceDir" },
72
+ "extraPrompt": { "ref": "params.extraPrompt" },
73
+ "llmExecutor": { "ref": "params.llmExecutor" },
74
+ "llmModel": { "ref": "params.llmModel" }
287
75
  },
288
- "params": {
289
- "labelText": { "const": "Running planning mode" },
290
- "model": { "ref": "params.llmModel" },
291
- "executor": { "ref": "params.llmExecutor" }
76
+ "stopFlowIf": {
77
+ "equals": [
78
+ { "ref": "steps.design_review_loop.run_design_review_loop.value.executionState.terminationOutcome" },
79
+ { "const": "stopped" }
80
+ ]
292
81
  },
293
- "expect": [
294
- {
295
- "kind": "require-artifacts",
296
- "when": { "not": { "ref": "context.dryRun" } },
297
- "paths": {
298
- "artifactList": {
299
- "kind": "plan-artifacts",
300
- "taskKey": { "ref": "params.taskKey" }
301
- }
302
- },
303
- "message": "Plan mode did not produce the required artifacts."
304
- },
305
- {
306
- "kind": "require-structured-artifacts",
307
- "when": { "not": { "ref": "context.dryRun" } },
308
- "items": [
309
- {
310
- "path": {
311
- "artifact": {
312
- "kind": "design-json-file",
313
- "taskKey": { "ref": "params.taskKey" },
314
- "iteration": { "ref": "params.designIteration" }
315
- }
316
- },
317
- "schemaId": "implementation-design/v1"
318
- },
319
- {
320
- "path": {
321
- "artifact": {
322
- "kind": "plan-json-file",
323
- "taskKey": { "ref": "params.taskKey" },
324
- "iteration": { "ref": "params.planIteration" }
325
- }
326
- },
327
- "schemaId": "implementation-plan/v1"
328
- },
329
- {
330
- "path": {
331
- "artifact": {
332
- "kind": "qa-json-file",
333
- "taskKey": { "ref": "params.taskKey" },
334
- "iteration": { "ref": "params.qaIteration" }
335
- }
336
- },
337
- "schemaId": "qa-plan/v1"
338
- }
339
- ],
340
- "message": "Plan mode produced invalid structured artifacts."
341
- }
342
- ]
343
- },
344
- {
345
- "id": "notify_plan_complete",
346
- "node": "telegram-notify",
347
- "params": {
348
- "message": {
349
- "template": "Plan phase for {taskKey} complete.",
350
- "vars": {
351
- "taskKey": { "ref": "params.taskKey" }
352
- }
353
- }
354
- }
82
+ "stopFlowOutcome": "stopped"
355
83
  }
356
84
  ]
357
85
  },
358
86
  {
359
87
  "id": "implement",
360
88
  "steps": [
89
+ {
90
+ "id": "resolve_planning_bundle",
91
+ "node": "planning-bundle",
92
+ "params": {
93
+ "taskKey": { "ref": "params.taskKey" }
94
+ }
95
+ },
361
96
  {
362
97
  "id": "run_implement",
363
98
  "node": "llm-prompt",
99
+ "routingGroup": "implementation",
364
100
  "prompt": {
365
101
  "templateRef": "implement",
366
102
  "vars": {
367
- "design_file": {
368
- "artifact": {
369
- "kind": "design-file",
370
- "taskKey": { "ref": "params.taskKey" }
371
- }
372
- },
373
- "design_json_file": {
374
- "artifact": {
375
- "kind": "design-json-file",
376
- "taskKey": { "ref": "params.taskKey" }
377
- }
378
- },
379
- "plan_file": {
380
- "artifact": {
381
- "kind": "plan-file",
382
- "taskKey": { "ref": "params.taskKey" }
383
- }
384
- },
385
- "plan_json_file": {
386
- "artifact": {
387
- "kind": "plan-json-file",
388
- "taskKey": { "ref": "params.taskKey" }
389
- }
390
- }
103
+ "design_file": { "ref": "steps.implement.resolve_planning_bundle.value.designFile" },
104
+ "design_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.designJsonFile" },
105
+ "plan_file": { "ref": "steps.implement.resolve_planning_bundle.value.planFile" },
106
+ "plan_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.planJsonFile" },
107
+ "qa_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaFile" },
108
+ "qa_json_file": { "ref": "steps.implement.resolve_planning_bundle.value.qaJsonFile" }
391
109
  },
392
110
  "extraPrompt": { "ref": "params.extraPrompt" },
393
111
  "format": "task-prompt"
@@ -418,13 +136,24 @@
418
136
  {
419
137
  "id": "run_review_loop",
420
138
  "node": "flow-run",
139
+ "stopFlowIf": {
140
+ "not": {
141
+ "equals": [
142
+ { "ref": "steps.review-loop.run_review_loop.value.executionState.terminationOutcome" },
143
+ { "const": "success" }
144
+ ]
145
+ }
146
+ },
147
+ "stopFlowOutcome": "stopped",
421
148
  "params": {
422
149
  "fileName": { "const": "review-loop.json" },
423
150
  "labelText": { "const": "Running review-loop" },
424
151
  "taskKey": { "ref": "params.taskKey" },
152
+ "baseIteration": { "ref": "params.baseIteration" },
425
153
  "workspaceDir": { "ref": "params.workspaceDir" },
426
154
  "extraPrompt": { "ref": "params.extraPrompt" },
427
155
  "reviewFixPoints": { "ref": "params.reviewFixPoints" },
156
+ "reviewBlockingSeverities": { "ref": "params.reviewBlockingSeverities" },
428
157
  "llmExecutor": { "ref": "params.llmExecutor" },
429
158
  "llmModel": { "ref": "params.llmModel" }
430
159
  }
@@ -444,4 +173,4 @@
444
173
  ]
445
174
  }
446
175
  ]
447
- }
176
+ }