agentweaver 0.1.8 → 0.1.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 (55) hide show
  1. package/README.md +71 -25
  2. package/dist/artifacts.js +25 -1
  3. package/dist/errors.js +7 -0
  4. package/dist/executors/configs/fetch-gitlab-diff-config.js +3 -0
  5. package/dist/executors/configs/opencode-config.js +6 -0
  6. package/dist/executors/fetch-gitlab-diff-executor.js +26 -0
  7. package/dist/executors/jira-fetch-executor.js +8 -2
  8. package/dist/executors/opencode-executor.js +35 -0
  9. package/dist/gitlab.js +199 -5
  10. package/dist/index.js +215 -144
  11. package/dist/interactive-ui.js +363 -37
  12. package/dist/jira.js +116 -14
  13. package/dist/pipeline/auto-flow.js +1 -1
  14. package/dist/pipeline/declarative-flows.js +44 -6
  15. package/dist/pipeline/flow-catalog.js +73 -0
  16. package/dist/pipeline/flow-specs/auto.json +183 -1
  17. package/dist/pipeline/flow-specs/gitlab-diff-review.json +226 -0
  18. package/dist/pipeline/flow-specs/gitlab-review.json +1 -31
  19. package/dist/pipeline/flow-specs/opencode/auto-opencode.json +1365 -0
  20. package/dist/pipeline/flow-specs/opencode/bugz/bug-analyze-opencode.json +382 -0
  21. package/dist/pipeline/flow-specs/opencode/bugz/bug-fix-opencode.json +56 -0
  22. package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-diff-review-opencode.json +308 -0
  23. package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-review-opencode.json +437 -0
  24. package/dist/pipeline/flow-specs/opencode/gitlab/mr-description-opencode.json +117 -0
  25. package/dist/pipeline/flow-specs/opencode/go/run-go-linter-loop-opencode.json +321 -0
  26. package/dist/pipeline/flow-specs/opencode/go/run-go-tests-loop-opencode.json +321 -0
  27. package/dist/pipeline/flow-specs/opencode/implement-opencode.json +64 -0
  28. package/dist/pipeline/flow-specs/opencode/plan-opencode.json +603 -0
  29. package/dist/pipeline/flow-specs/opencode/review/review-fix-opencode.json +209 -0
  30. package/dist/pipeline/flow-specs/opencode/review/review-opencode.json +452 -0
  31. package/dist/pipeline/flow-specs/opencode/task-describe-opencode.json +148 -0
  32. package/dist/pipeline/flow-specs/plan.json +183 -1
  33. package/dist/pipeline/node-registry.js +80 -8
  34. package/dist/pipeline/nodes/fetch-gitlab-diff-node.js +34 -0
  35. package/dist/pipeline/nodes/flow-run-node.js +2 -2
  36. package/dist/pipeline/nodes/jira-fetch-node.js +26 -2
  37. package/dist/pipeline/nodes/opencode-prompt-node.js +32 -0
  38. package/dist/pipeline/nodes/planning-questions-form-node.js +69 -0
  39. package/dist/pipeline/nodes/user-input-node.js +9 -1
  40. package/dist/pipeline/prompt-registry.js +3 -1
  41. package/dist/pipeline/registry.js +10 -0
  42. package/dist/pipeline/spec-loader.js +48 -3
  43. package/dist/pipeline/spec-types.js +43 -1
  44. package/dist/pipeline/spec-validator.js +53 -7
  45. package/dist/pipeline/value-resolver.js +15 -1
  46. package/dist/prompts.js +47 -12
  47. package/dist/runtime/process-runner.js +45 -1
  48. package/dist/scope.js +24 -32
  49. package/dist/structured-artifact-schemas.json +154 -1
  50. package/dist/structured-artifacts.js +2 -0
  51. package/dist/user-input.js +7 -0
  52. package/package.json +1 -1
  53. package/dist/pipeline/flow-specs/preflight.json +0 -206
  54. package/dist/pipeline/flow-specs/run-linter-loop.json +0 -155
  55. package/dist/pipeline/flow-specs/run-tests-loop.json +0 -155
@@ -0,0 +1,321 @@
1
+ {
2
+ "kind": "run-go-linter-loop-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "run_go_linter_try_1",
7
+ "steps": [
8
+ {
9
+ "id": "run_go_linter",
10
+ "node": "local-script-check",
11
+ "params": {
12
+ "argv": {
13
+ "list": [
14
+ {
15
+ "ref": "params.runGoLinterScript"
16
+ }
17
+ ]
18
+ },
19
+ "outputFile": {
20
+ "artifact": {
21
+ "kind": "run-go-linter-result-json-file",
22
+ "taskKey": {
23
+ "ref": "params.taskKey"
24
+ },
25
+ "iteration": {
26
+ "const": 1
27
+ }
28
+ }
29
+ },
30
+ "labelText": {
31
+ "const": "Running run_go_linter.py locally (attempt 1)"
32
+ }
33
+ },
34
+ "expect": [
35
+ {
36
+ "kind": "require-file",
37
+ "when": {
38
+ "not": {
39
+ "ref": "context.dryRun"
40
+ }
41
+ },
42
+ "path": {
43
+ "artifact": {
44
+ "kind": "run-go-linter-result-json-file",
45
+ "taskKey": {
46
+ "ref": "params.taskKey"
47
+ },
48
+ "iteration": {
49
+ "const": 1
50
+ }
51
+ }
52
+ },
53
+ "message": "run-go-linter-loop did not produce the structured linter result artifact."
54
+ }
55
+ ],
56
+ "stopFlowIf": {
57
+ "equals": [
58
+ {
59
+ "ref": "steps.run_go_linter_try_1.run_go_linter.outputs.parsed.ok"
60
+ },
61
+ {
62
+ "const": true
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "id": "fix_go_linter",
69
+ "when": {
70
+ "equals": [
71
+ {
72
+ "ref": "steps.run_go_linter_try_1.run_go_linter.outputs.parsed.ok"
73
+ },
74
+ {
75
+ "const": false
76
+ }
77
+ ]
78
+ },
79
+ "node": "opencode-prompt",
80
+ "prompt": {
81
+ "templateRef": "run-go-linter-loop-fix",
82
+ "vars": {
83
+ "linter_result_json_file": {
84
+ "artifact": {
85
+ "kind": "run-go-linter-result-json-file",
86
+ "taskKey": {
87
+ "ref": "params.taskKey"
88
+ },
89
+ "iteration": {
90
+ "const": 1
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "extraPrompt": {
96
+ "appendPrompt": {
97
+ "base": {
98
+ "ref": "params.extraPrompt"
99
+ },
100
+ "suffix": {
101
+ "template": "Последний результат run_go_linter.py сохранён в {result_file}. exitCode={exit_code}, summary={summary}.\nПолный raw-вывод последнего запуска:\n{raw_output}\nИсправь только то, что мешает успешному прохождению проверки.",
102
+ "vars": {
103
+ "result_file": {
104
+ "artifact": {
105
+ "kind": "run-go-linter-result-json-file",
106
+ "taskKey": {
107
+ "ref": "params.taskKey"
108
+ },
109
+ "iteration": {
110
+ "const": 1
111
+ }
112
+ }
113
+ },
114
+ "exit_code": {
115
+ "ref": "steps.run_go_linter_try_1.run_go_linter.outputs.parsed.exitCode"
116
+ },
117
+ "summary": {
118
+ "ref": "steps.run_go_linter_try_1.run_go_linter.outputs.parsed.summary"
119
+ },
120
+ "raw_output": {
121
+ "ref": "steps.run_go_linter_try_1.run_go_linter.outputs.parsed.details.raw"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "format": "task-prompt"
128
+ },
129
+ "params": {
130
+ "labelText": {
131
+ "const": "Running OpenCode Go linter loop fix (attempt 1)"
132
+ },
133
+ "model": {
134
+ "const": "minimax-coding-plan/MiniMax-M2.7"
135
+ }
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "repeat": {
142
+ "var": "attempt",
143
+ "from": 2,
144
+ "to": 5
145
+ },
146
+ "phases": [
147
+ {
148
+ "id": "run_go_linter_try_${attempt}",
149
+ "when": {
150
+ "equals": [
151
+ {
152
+ "ref": "steps.run_go_linter_try_${attempt_minus_one}.run_go_linter.outputs.parsed.ok"
153
+ },
154
+ {
155
+ "const": false
156
+ }
157
+ ]
158
+ },
159
+ "steps": [
160
+ {
161
+ "id": "run_go_linter",
162
+ "node": "local-script-check",
163
+ "params": {
164
+ "argv": {
165
+ "list": [
166
+ {
167
+ "ref": "params.runGoLinterScript"
168
+ }
169
+ ]
170
+ },
171
+ "outputFile": {
172
+ "artifact": {
173
+ "kind": "run-go-linter-result-json-file",
174
+ "taskKey": {
175
+ "ref": "params.taskKey"
176
+ },
177
+ "iteration": {
178
+ "ref": "repeat.attempt"
179
+ }
180
+ }
181
+ },
182
+ "labelText": {
183
+ "template": "Running run_go_linter.py locally (attempt ${attempt})"
184
+ }
185
+ },
186
+ "expect": [
187
+ {
188
+ "kind": "require-file",
189
+ "when": {
190
+ "not": {
191
+ "ref": "context.dryRun"
192
+ }
193
+ },
194
+ "path": {
195
+ "artifact": {
196
+ "kind": "run-go-linter-result-json-file",
197
+ "taskKey": {
198
+ "ref": "params.taskKey"
199
+ },
200
+ "iteration": {
201
+ "ref": "repeat.attempt"
202
+ }
203
+ }
204
+ },
205
+ "message": "run-go-linter-loop did not produce the structured linter result artifact."
206
+ }
207
+ ],
208
+ "stopFlowIf": {
209
+ "equals": [
210
+ {
211
+ "ref": "steps.run_go_linter_try_${attempt}.run_go_linter.outputs.parsed.ok"
212
+ },
213
+ {
214
+ "const": true
215
+ }
216
+ ]
217
+ }
218
+ },
219
+ {
220
+ "id": "fix_go_linter",
221
+ "when": {
222
+ "equals": [
223
+ {
224
+ "ref": "steps.run_go_linter_try_${attempt}.run_go_linter.outputs.parsed.ok"
225
+ },
226
+ {
227
+ "const": false
228
+ }
229
+ ]
230
+ },
231
+ "node": "opencode-prompt",
232
+ "prompt": {
233
+ "templateRef": "run-go-linter-loop-fix",
234
+ "vars": {
235
+ "linter_result_json_file": {
236
+ "artifact": {
237
+ "kind": "run-go-linter-result-json-file",
238
+ "taskKey": {
239
+ "ref": "params.taskKey"
240
+ },
241
+ "iteration": {
242
+ "ref": "repeat.attempt"
243
+ }
244
+ }
245
+ }
246
+ },
247
+ "extraPrompt": {
248
+ "appendPrompt": {
249
+ "base": {
250
+ "ref": "params.extraPrompt"
251
+ },
252
+ "suffix": {
253
+ "template": "Последний результат run_go_linter.py сохранён в {result_file}. exitCode={exit_code}, summary={summary}.\nПолный raw-вывод последнего запуска:\n{raw_output}\nИсправь только то, что мешает успешному прохождению проверки.",
254
+ "vars": {
255
+ "result_file": {
256
+ "artifact": {
257
+ "kind": "run-go-linter-result-json-file",
258
+ "taskKey": {
259
+ "ref": "params.taskKey"
260
+ },
261
+ "iteration": {
262
+ "ref": "repeat.attempt"
263
+ }
264
+ }
265
+ },
266
+ "exit_code": {
267
+ "ref": "steps.run_go_linter_try_${attempt}.run_go_linter.outputs.parsed.exitCode"
268
+ },
269
+ "summary": {
270
+ "ref": "steps.run_go_linter_try_${attempt}.run_go_linter.outputs.parsed.summary"
271
+ },
272
+ "raw_output": {
273
+ "ref": "steps.run_go_linter_try_${attempt}.run_go_linter.outputs.parsed.details.raw"
274
+ }
275
+ }
276
+ }
277
+ }
278
+ },
279
+ "format": "task-prompt"
280
+ },
281
+ "params": {
282
+ "labelText": {
283
+ "template": "Running OpenCode Go linter loop fix (attempt ${attempt})"
284
+ },
285
+ "model": {
286
+ "const": "minimax-coding-plan/MiniMax-M2.7"
287
+ }
288
+ }
289
+ }
290
+ ]
291
+ }
292
+ ]
293
+ },
294
+ {
295
+ "id": "run_go_linter_failed",
296
+ "steps": [
297
+ {
298
+ "id": "assert_run_go_linter_success",
299
+ "node": "file-check",
300
+ "params": {
301
+ "path": {
302
+ "ref": "params.runGoLinterScript"
303
+ }
304
+ },
305
+ "expect": [
306
+ {
307
+ "kind": "step-output",
308
+ "value": {
309
+ "ref": "steps.run_go_linter_try_5.run_go_linter.outputs.parsed.ok"
310
+ },
311
+ "equals": {
312
+ "const": true
313
+ },
314
+ "message": "run-go-linter-loop exhausted all attempts without a successful run_go_linter.py execution."
315
+ }
316
+ ]
317
+ }
318
+ ]
319
+ }
320
+ ]
321
+ }
@@ -0,0 +1,321 @@
1
+ {
2
+ "kind": "run-go-tests-loop-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "run_go_tests_try_1",
7
+ "steps": [
8
+ {
9
+ "id": "run_go_tests",
10
+ "node": "local-script-check",
11
+ "params": {
12
+ "argv": {
13
+ "list": [
14
+ {
15
+ "ref": "params.runGoTestsScript"
16
+ }
17
+ ]
18
+ },
19
+ "outputFile": {
20
+ "artifact": {
21
+ "kind": "run-go-tests-result-json-file",
22
+ "taskKey": {
23
+ "ref": "params.taskKey"
24
+ },
25
+ "iteration": {
26
+ "const": 1
27
+ }
28
+ }
29
+ },
30
+ "labelText": {
31
+ "const": "Running run_go_tests.py locally (attempt 1)"
32
+ }
33
+ },
34
+ "expect": [
35
+ {
36
+ "kind": "require-file",
37
+ "when": {
38
+ "not": {
39
+ "ref": "context.dryRun"
40
+ }
41
+ },
42
+ "path": {
43
+ "artifact": {
44
+ "kind": "run-go-tests-result-json-file",
45
+ "taskKey": {
46
+ "ref": "params.taskKey"
47
+ },
48
+ "iteration": {
49
+ "const": 1
50
+ }
51
+ }
52
+ },
53
+ "message": "run-go-tests-loop did not produce the structured tests result artifact."
54
+ }
55
+ ],
56
+ "stopFlowIf": {
57
+ "equals": [
58
+ {
59
+ "ref": "steps.run_go_tests_try_1.run_go_tests.outputs.parsed.ok"
60
+ },
61
+ {
62
+ "const": true
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "id": "fix_go_tests",
69
+ "when": {
70
+ "equals": [
71
+ {
72
+ "ref": "steps.run_go_tests_try_1.run_go_tests.outputs.parsed.ok"
73
+ },
74
+ {
75
+ "const": false
76
+ }
77
+ ]
78
+ },
79
+ "node": "opencode-prompt",
80
+ "prompt": {
81
+ "templateRef": "run-go-tests-loop-fix",
82
+ "vars": {
83
+ "tests_result_json_file": {
84
+ "artifact": {
85
+ "kind": "run-go-tests-result-json-file",
86
+ "taskKey": {
87
+ "ref": "params.taskKey"
88
+ },
89
+ "iteration": {
90
+ "const": 1
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "extraPrompt": {
96
+ "appendPrompt": {
97
+ "base": {
98
+ "ref": "params.extraPrompt"
99
+ },
100
+ "suffix": {
101
+ "template": "Последний результат run_go_tests.py сохранён в {result_file}. exitCode={exit_code}, summary={summary}.\nПолный raw-вывод последнего запуска:\n{raw_output}\nИсправь только то, что мешает успешному прохождению проверки.",
102
+ "vars": {
103
+ "result_file": {
104
+ "artifact": {
105
+ "kind": "run-go-tests-result-json-file",
106
+ "taskKey": {
107
+ "ref": "params.taskKey"
108
+ },
109
+ "iteration": {
110
+ "const": 1
111
+ }
112
+ }
113
+ },
114
+ "exit_code": {
115
+ "ref": "steps.run_go_tests_try_1.run_go_tests.outputs.parsed.exitCode"
116
+ },
117
+ "summary": {
118
+ "ref": "steps.run_go_tests_try_1.run_go_tests.outputs.parsed.summary"
119
+ },
120
+ "raw_output": {
121
+ "ref": "steps.run_go_tests_try_1.run_go_tests.outputs.parsed.details.raw"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "format": "task-prompt"
128
+ },
129
+ "params": {
130
+ "labelText": {
131
+ "const": "Running OpenCode Go tests loop fix (attempt 1)"
132
+ },
133
+ "model": {
134
+ "const": "minimax-coding-plan/MiniMax-M2.7"
135
+ }
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ "repeat": {
142
+ "var": "attempt",
143
+ "from": 2,
144
+ "to": 5
145
+ },
146
+ "phases": [
147
+ {
148
+ "id": "run_go_tests_try_${attempt}",
149
+ "when": {
150
+ "equals": [
151
+ {
152
+ "ref": "steps.run_go_tests_try_${attempt_minus_one}.run_go_tests.outputs.parsed.ok"
153
+ },
154
+ {
155
+ "const": false
156
+ }
157
+ ]
158
+ },
159
+ "steps": [
160
+ {
161
+ "id": "run_go_tests",
162
+ "node": "local-script-check",
163
+ "params": {
164
+ "argv": {
165
+ "list": [
166
+ {
167
+ "ref": "params.runGoTestsScript"
168
+ }
169
+ ]
170
+ },
171
+ "outputFile": {
172
+ "artifact": {
173
+ "kind": "run-go-tests-result-json-file",
174
+ "taskKey": {
175
+ "ref": "params.taskKey"
176
+ },
177
+ "iteration": {
178
+ "ref": "repeat.attempt"
179
+ }
180
+ }
181
+ },
182
+ "labelText": {
183
+ "template": "Running run_go_tests.py locally (attempt ${attempt})"
184
+ }
185
+ },
186
+ "expect": [
187
+ {
188
+ "kind": "require-file",
189
+ "when": {
190
+ "not": {
191
+ "ref": "context.dryRun"
192
+ }
193
+ },
194
+ "path": {
195
+ "artifact": {
196
+ "kind": "run-go-tests-result-json-file",
197
+ "taskKey": {
198
+ "ref": "params.taskKey"
199
+ },
200
+ "iteration": {
201
+ "ref": "repeat.attempt"
202
+ }
203
+ }
204
+ },
205
+ "message": "run-go-tests-loop did not produce the structured tests result artifact."
206
+ }
207
+ ],
208
+ "stopFlowIf": {
209
+ "equals": [
210
+ {
211
+ "ref": "steps.run_go_tests_try_${attempt}.run_go_tests.outputs.parsed.ok"
212
+ },
213
+ {
214
+ "const": true
215
+ }
216
+ ]
217
+ }
218
+ },
219
+ {
220
+ "id": "fix_go_tests",
221
+ "when": {
222
+ "equals": [
223
+ {
224
+ "ref": "steps.run_go_tests_try_${attempt}.run_go_tests.outputs.parsed.ok"
225
+ },
226
+ {
227
+ "const": false
228
+ }
229
+ ]
230
+ },
231
+ "node": "opencode-prompt",
232
+ "prompt": {
233
+ "templateRef": "run-go-tests-loop-fix",
234
+ "vars": {
235
+ "tests_result_json_file": {
236
+ "artifact": {
237
+ "kind": "run-go-tests-result-json-file",
238
+ "taskKey": {
239
+ "ref": "params.taskKey"
240
+ },
241
+ "iteration": {
242
+ "ref": "repeat.attempt"
243
+ }
244
+ }
245
+ }
246
+ },
247
+ "extraPrompt": {
248
+ "appendPrompt": {
249
+ "base": {
250
+ "ref": "params.extraPrompt"
251
+ },
252
+ "suffix": {
253
+ "template": "Последний результат run_go_tests.py сохранён в {result_file}. exitCode={exit_code}, summary={summary}.\nПолный raw-вывод последнего запуска:\n{raw_output}\nИсправь только то, что мешает успешному прохождению проверки.",
254
+ "vars": {
255
+ "result_file": {
256
+ "artifact": {
257
+ "kind": "run-go-tests-result-json-file",
258
+ "taskKey": {
259
+ "ref": "params.taskKey"
260
+ },
261
+ "iteration": {
262
+ "ref": "repeat.attempt"
263
+ }
264
+ }
265
+ },
266
+ "exit_code": {
267
+ "ref": "steps.run_go_tests_try_${attempt}.run_go_tests.outputs.parsed.exitCode"
268
+ },
269
+ "summary": {
270
+ "ref": "steps.run_go_tests_try_${attempt}.run_go_tests.outputs.parsed.summary"
271
+ },
272
+ "raw_output": {
273
+ "ref": "steps.run_go_tests_try_${attempt}.run_go_tests.outputs.parsed.details.raw"
274
+ }
275
+ }
276
+ }
277
+ }
278
+ },
279
+ "format": "task-prompt"
280
+ },
281
+ "params": {
282
+ "labelText": {
283
+ "template": "Running OpenCode Go tests loop fix (attempt ${attempt})"
284
+ },
285
+ "model": {
286
+ "const": "minimax-coding-plan/MiniMax-M2.7"
287
+ }
288
+ }
289
+ }
290
+ ]
291
+ }
292
+ ]
293
+ },
294
+ {
295
+ "id": "run_go_tests_failed",
296
+ "steps": [
297
+ {
298
+ "id": "assert_run_go_tests_success",
299
+ "node": "file-check",
300
+ "params": {
301
+ "path": {
302
+ "ref": "params.runGoTestsScript"
303
+ }
304
+ },
305
+ "expect": [
306
+ {
307
+ "kind": "step-output",
308
+ "value": {
309
+ "ref": "steps.run_go_tests_try_5.run_go_tests.outputs.parsed.ok"
310
+ },
311
+ "equals": {
312
+ "const": true
313
+ },
314
+ "message": "run-go-tests-loop exhausted all attempts without a successful run_go_tests.py execution."
315
+ }
316
+ ]
317
+ }
318
+ ]
319
+ }
320
+ ]
321
+ }