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,209 @@
1
+ {
2
+ "kind": "review-fix-flow",
3
+ "version": 1,
4
+ "constants": {
5
+ "autoReviewFixExtraPrompt": "Исправлять только блокеры, критикалы и важные"
6
+ },
7
+ "phases": [
8
+ {
9
+ "id": "review-fix",
10
+ "steps": [
11
+ {
12
+ "id": "build_review_fix_selection_form",
13
+ "node": "review-findings-form",
14
+ "params": {
15
+ "reviewReplyJsonFile": {
16
+ "artifact": {
17
+ "kind": "review-reply-json-file",
18
+ "taskKey": {
19
+ "ref": "params.taskKey"
20
+ },
21
+ "iteration": {
22
+ "ref": "params.latestIteration"
23
+ }
24
+ }
25
+ },
26
+ "formId": {
27
+ "const": "review-fix-selection"
28
+ },
29
+ "title": {
30
+ "const": "Review-Fix Selection"
31
+ },
32
+ "description": {
33
+ "const": "Отметьте findings, которые нужно исправить в этой итерации review-fix. Можно включить режим исправления всех findings."
34
+ }
35
+ }
36
+ },
37
+ {
38
+ "id": "collect_review_fix_selection",
39
+ "node": "user-input",
40
+ "params": {
41
+ "formId": {
42
+ "ref": "steps.review-fix.build_review_fix_selection_form.value.formId"
43
+ },
44
+ "title": {
45
+ "ref": "steps.review-fix.build_review_fix_selection_form.value.title"
46
+ },
47
+ "description": {
48
+ "ref": "steps.review-fix.build_review_fix_selection_form.value.description"
49
+ },
50
+ "submitLabel": {
51
+ "const": "Run review-fix"
52
+ },
53
+ "fields": {
54
+ "ref": "steps.review-fix.build_review_fix_selection_form.value.fields"
55
+ },
56
+ "outputFile": {
57
+ "ref": "params.reviewFixSelectionJsonFile"
58
+ }
59
+ },
60
+ "expect": [
61
+ {
62
+ "kind": "require-structured-artifacts",
63
+ "items": [
64
+ {
65
+ "path": {
66
+ "ref": "params.reviewFixSelectionJsonFile"
67
+ },
68
+ "schemaId": "user-input/v1"
69
+ }
70
+ ],
71
+ "message": "Review-fix selection input is missing or invalid."
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "id": "run_codex_review_fix",
77
+ "node": "opencode-prompt",
78
+ "prompt": {
79
+ "templateRef": "review-fix",
80
+ "vars": {
81
+ "review_reply_file": {
82
+ "artifact": {
83
+ "kind": "review-reply-file",
84
+ "taskKey": {
85
+ "ref": "params.taskKey"
86
+ },
87
+ "iteration": {
88
+ "ref": "params.latestIteration"
89
+ }
90
+ }
91
+ },
92
+ "review_reply_json_file": {
93
+ "artifact": {
94
+ "kind": "review-reply-json-file",
95
+ "taskKey": {
96
+ "ref": "params.taskKey"
97
+ },
98
+ "iteration": {
99
+ "ref": "params.latestIteration"
100
+ }
101
+ }
102
+ },
103
+ "items": {
104
+ "ref": "params.reviewFixPoints"
105
+ },
106
+ "review_fix_file": {
107
+ "artifact": {
108
+ "kind": "review-fix-file",
109
+ "taskKey": {
110
+ "ref": "params.taskKey"
111
+ },
112
+ "iteration": {
113
+ "ref": "params.latestIteration"
114
+ }
115
+ }
116
+ },
117
+ "review_fix_json_file": {
118
+ "artifact": {
119
+ "kind": "review-fix-json-file",
120
+ "taskKey": {
121
+ "ref": "params.taskKey"
122
+ },
123
+ "iteration": {
124
+ "ref": "params.latestIteration"
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "extraPrompt": {
130
+ "appendPrompt": {
131
+ "base": {
132
+ "ref": "params.extraPrompt"
133
+ },
134
+ "suffix": {
135
+ "ref": "steps.review-fix.collect_review_fix_selection.value.promptSuffix"
136
+ }
137
+ }
138
+ },
139
+ "format": "task-prompt"
140
+ },
141
+ "params": {
142
+ "labelText": {
143
+ "template": "Running OpenCode review-fix mode locally (iteration {iteration})",
144
+ "vars": {
145
+ "iteration": {
146
+ "ref": "params.latestIteration"
147
+ }
148
+ }
149
+ },
150
+ "model": {
151
+ "const": "minimax-coding-plan/MiniMax-M2.7"
152
+ }
153
+ },
154
+ "expect": [
155
+ {
156
+ "kind": "require-artifacts",
157
+ "when": {
158
+ "not": {
159
+ "ref": "context.dryRun"
160
+ }
161
+ },
162
+ "paths": {
163
+ "list": [
164
+ {
165
+ "artifact": {
166
+ "kind": "review-fix-file",
167
+ "taskKey": {
168
+ "ref": "params.taskKey"
169
+ },
170
+ "iteration": {
171
+ "ref": "params.latestIteration"
172
+ }
173
+ }
174
+ }
175
+ ]
176
+ },
177
+ "message": "Review-fix mode did not produce the required review-fix artifact."
178
+ },
179
+ {
180
+ "kind": "require-structured-artifacts",
181
+ "when": {
182
+ "not": {
183
+ "ref": "context.dryRun"
184
+ }
185
+ },
186
+ "items": [
187
+ {
188
+ "path": {
189
+ "artifact": {
190
+ "kind": "review-fix-json-file",
191
+ "taskKey": {
192
+ "ref": "params.taskKey"
193
+ },
194
+ "iteration": {
195
+ "ref": "params.latestIteration"
196
+ }
197
+ }
198
+ },
199
+ "schemaId": "review-fix-report/v1"
200
+ }
201
+ ],
202
+ "message": "Review-fix mode produced invalid structured artifacts."
203
+ }
204
+ ]
205
+ }
206
+ ]
207
+ }
208
+ ]
209
+ }
@@ -0,0 +1,452 @@
1
+ {
2
+ "kind": "review-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "review",
7
+ "steps": [
8
+ {
9
+ "id": "run_review",
10
+ "node": "opencode-prompt",
11
+ "prompt": {
12
+ "templateRef": "review",
13
+ "vars": {
14
+ "jira_task_file": {
15
+ "artifact": {
16
+ "kind": "jira-task-file",
17
+ "taskKey": {
18
+ "ref": "params.taskKey"
19
+ }
20
+ }
21
+ },
22
+ "design_file": {
23
+ "artifact": {
24
+ "kind": "design-file",
25
+ "taskKey": {
26
+ "ref": "params.taskKey"
27
+ }
28
+ }
29
+ },
30
+ "design_json_file": {
31
+ "artifact": {
32
+ "kind": "design-json-file",
33
+ "taskKey": {
34
+ "ref": "params.taskKey"
35
+ }
36
+ }
37
+ },
38
+ "plan_file": {
39
+ "artifact": {
40
+ "kind": "plan-file",
41
+ "taskKey": {
42
+ "ref": "params.taskKey"
43
+ }
44
+ }
45
+ },
46
+ "plan_json_file": {
47
+ "artifact": {
48
+ "kind": "plan-json-file",
49
+ "taskKey": {
50
+ "ref": "params.taskKey"
51
+ }
52
+ }
53
+ },
54
+ "review_file": {
55
+ "artifact": {
56
+ "kind": "review-file",
57
+ "taskKey": {
58
+ "ref": "params.taskKey"
59
+ },
60
+ "iteration": {
61
+ "ref": "params.iteration"
62
+ }
63
+ }
64
+ },
65
+ "review_json_file": {
66
+ "artifact": {
67
+ "kind": "review-json-file",
68
+ "taskKey": {
69
+ "ref": "params.taskKey"
70
+ },
71
+ "iteration": {
72
+ "ref": "params.iteration"
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "extraPrompt": {
78
+ "ref": "params.extraPrompt"
79
+ },
80
+ "format": "task-prompt"
81
+ },
82
+ "params": {
83
+ "labelText": {
84
+ "template": "Running OpenCode review mode (iteration {iteration})",
85
+ "vars": {
86
+ "iteration": {
87
+ "ref": "params.iteration"
88
+ }
89
+ }
90
+ },
91
+ "model": {
92
+ "const": "minimax-coding-plan/MiniMax-M2.7"
93
+ }
94
+ },
95
+ "expect": [
96
+ {
97
+ "kind": "require-artifacts",
98
+ "when": {
99
+ "not": {
100
+ "ref": "context.dryRun"
101
+ }
102
+ },
103
+ "paths": {
104
+ "list": [
105
+ {
106
+ "artifact": {
107
+ "kind": "review-file",
108
+ "taskKey": {
109
+ "ref": "params.taskKey"
110
+ },
111
+ "iteration": {
112
+ "ref": "params.iteration"
113
+ }
114
+ }
115
+ }
116
+ ]
117
+ },
118
+ "message": "Review did not produce the required review artifact."
119
+ },
120
+ {
121
+ "kind": "require-structured-artifacts",
122
+ "when": {
123
+ "not": {
124
+ "ref": "context.dryRun"
125
+ }
126
+ },
127
+ "items": [
128
+ {
129
+ "path": {
130
+ "artifact": {
131
+ "kind": "review-json-file",
132
+ "taskKey": {
133
+ "ref": "params.taskKey"
134
+ },
135
+ "iteration": {
136
+ "ref": "params.iteration"
137
+ }
138
+ }
139
+ },
140
+ "schemaId": "review-findings/v1"
141
+ }
142
+ ],
143
+ "message": "Claude review produced invalid structured artifacts."
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "id": "summarize_review",
149
+ "when": {
150
+ "not": {
151
+ "ref": "context.dryRun"
152
+ }
153
+ },
154
+ "node": "opencode-prompt",
155
+ "prompt": {
156
+ "templateRef": "review-summary",
157
+ "vars": {
158
+ "review_file": {
159
+ "artifact": {
160
+ "kind": "review-file",
161
+ "taskKey": {
162
+ "ref": "params.taskKey"
163
+ },
164
+ "iteration": {
165
+ "ref": "params.iteration"
166
+ }
167
+ }
168
+ },
169
+ "review_summary_file": {
170
+ "artifact": {
171
+ "kind": "review-summary-file",
172
+ "taskKey": {
173
+ "ref": "params.taskKey"
174
+ },
175
+ "iteration": {
176
+ "ref": "params.iteration"
177
+ }
178
+ }
179
+ }
180
+ },
181
+ "format": "plain"
182
+ },
183
+ "params": {
184
+ "labelText": {
185
+ "const": "Preparing OpenCode review summary"
186
+ },
187
+ "summaryTitle": {
188
+ "const": "OpenCode Comments"
189
+ },
190
+ "model": {
191
+ "const": "minimax-coding-plan/MiniMax-M2.7"
192
+ },
193
+ "outputFile": {
194
+ "artifact": {
195
+ "kind": "review-summary-file",
196
+ "taskKey": {
197
+ "ref": "params.taskKey"
198
+ },
199
+ "iteration": {
200
+ "ref": "params.iteration"
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ {
207
+ "id": "run_review_reply",
208
+ "node": "opencode-prompt",
209
+ "prompt": {
210
+ "templateRef": "review-reply",
211
+ "vars": {
212
+ "review_file": {
213
+ "artifact": {
214
+ "kind": "review-file",
215
+ "taskKey": {
216
+ "ref": "params.taskKey"
217
+ },
218
+ "iteration": {
219
+ "ref": "params.iteration"
220
+ }
221
+ }
222
+ },
223
+ "review_json_file": {
224
+ "artifact": {
225
+ "kind": "review-json-file",
226
+ "taskKey": {
227
+ "ref": "params.taskKey"
228
+ },
229
+ "iteration": {
230
+ "ref": "params.iteration"
231
+ }
232
+ }
233
+ },
234
+ "jira_task_file": {
235
+ "artifact": {
236
+ "kind": "jira-task-file",
237
+ "taskKey": {
238
+ "ref": "params.taskKey"
239
+ }
240
+ }
241
+ },
242
+ "design_file": {
243
+ "artifact": {
244
+ "kind": "design-file",
245
+ "taskKey": {
246
+ "ref": "params.taskKey"
247
+ }
248
+ }
249
+ },
250
+ "design_json_file": {
251
+ "artifact": {
252
+ "kind": "design-json-file",
253
+ "taskKey": {
254
+ "ref": "params.taskKey"
255
+ }
256
+ }
257
+ },
258
+ "plan_file": {
259
+ "artifact": {
260
+ "kind": "plan-file",
261
+ "taskKey": {
262
+ "ref": "params.taskKey"
263
+ }
264
+ }
265
+ },
266
+ "plan_json_file": {
267
+ "artifact": {
268
+ "kind": "plan-json-file",
269
+ "taskKey": {
270
+ "ref": "params.taskKey"
271
+ }
272
+ }
273
+ },
274
+ "review_reply_file": {
275
+ "artifact": {
276
+ "kind": "review-reply-file",
277
+ "taskKey": {
278
+ "ref": "params.taskKey"
279
+ },
280
+ "iteration": {
281
+ "ref": "params.iteration"
282
+ }
283
+ }
284
+ },
285
+ "review_reply_json_file": {
286
+ "artifact": {
287
+ "kind": "review-reply-json-file",
288
+ "taskKey": {
289
+ "ref": "params.taskKey"
290
+ },
291
+ "iteration": {
292
+ "ref": "params.iteration"
293
+ }
294
+ }
295
+ }
296
+ },
297
+ "extraPrompt": {
298
+ "ref": "params.extraPrompt"
299
+ },
300
+ "format": "task-prompt"
301
+ },
302
+ "params": {
303
+ "labelText": {
304
+ "template": "Running OpenCode review reply mode (iteration {iteration})",
305
+ "vars": {
306
+ "iteration": {
307
+ "ref": "params.iteration"
308
+ }
309
+ }
310
+ },
311
+ "model": {
312
+ "const": "minimax-coding-plan/MiniMax-M2.7"
313
+ }
314
+ },
315
+ "expect": [
316
+ {
317
+ "kind": "require-artifacts",
318
+ "when": {
319
+ "not": {
320
+ "ref": "context.dryRun"
321
+ }
322
+ },
323
+ "paths": {
324
+ "list": [
325
+ {
326
+ "artifact": {
327
+ "kind": "review-reply-file",
328
+ "taskKey": {
329
+ "ref": "params.taskKey"
330
+ },
331
+ "iteration": {
332
+ "ref": "params.iteration"
333
+ }
334
+ }
335
+ }
336
+ ]
337
+ },
338
+ "message": "Review reply did not produce the required review-reply artifact."
339
+ },
340
+ {
341
+ "kind": "require-structured-artifacts",
342
+ "when": {
343
+ "not": {
344
+ "ref": "context.dryRun"
345
+ }
346
+ },
347
+ "items": [
348
+ {
349
+ "path": {
350
+ "artifact": {
351
+ "kind": "review-reply-json-file",
352
+ "taskKey": {
353
+ "ref": "params.taskKey"
354
+ },
355
+ "iteration": {
356
+ "ref": "params.iteration"
357
+ }
358
+ }
359
+ },
360
+ "schemaId": "review-reply/v1"
361
+ }
362
+ ],
363
+ "message": "Review reply produced invalid structured artifacts."
364
+ }
365
+ ]
366
+ },
367
+ {
368
+ "id": "summarize_review_reply",
369
+ "when": {
370
+ "not": {
371
+ "ref": "context.dryRun"
372
+ }
373
+ },
374
+ "node": "opencode-prompt",
375
+ "prompt": {
376
+ "templateRef": "review-reply-summary",
377
+ "vars": {
378
+ "review_reply_file": {
379
+ "artifact": {
380
+ "kind": "review-reply-file",
381
+ "taskKey": {
382
+ "ref": "params.taskKey"
383
+ },
384
+ "iteration": {
385
+ "ref": "params.iteration"
386
+ }
387
+ }
388
+ },
389
+ "review_reply_summary_file": {
390
+ "artifact": {
391
+ "kind": "review-reply-summary-file",
392
+ "taskKey": {
393
+ "ref": "params.taskKey"
394
+ },
395
+ "iteration": {
396
+ "ref": "params.iteration"
397
+ }
398
+ }
399
+ }
400
+ },
401
+ "format": "plain"
402
+ },
403
+ "params": {
404
+ "labelText": {
405
+ "const": "Preparing OpenCode reply summary"
406
+ },
407
+ "summaryTitle": {
408
+ "const": "OpenCode Reply Summary"
409
+ },
410
+ "model": {
411
+ "const": "minimax-coding-plan/MiniMax-M2.7"
412
+ },
413
+ "outputFile": {
414
+ "artifact": {
415
+ "kind": "review-reply-summary-file",
416
+ "taskKey": {
417
+ "ref": "params.taskKey"
418
+ },
419
+ "iteration": {
420
+ "ref": "params.iteration"
421
+ }
422
+ }
423
+ }
424
+ }
425
+ },
426
+ {
427
+ "id": "check_ready_to_merge",
428
+ "node": "file-check",
429
+ "params": {
430
+ "path": {
431
+ "artifact": {
432
+ "kind": "ready-to-merge-file",
433
+ "taskKey": {
434
+ "ref": "params.taskKey"
435
+ }
436
+ }
437
+ },
438
+ "panelTitle": {
439
+ "const": "Ready To Merge"
440
+ },
441
+ "foundMessage": {
442
+ "const": "Изменения готовы к merge\nФайл ready-to-merge.md создан."
443
+ },
444
+ "tone": {
445
+ "const": "green"
446
+ }
447
+ }
448
+ }
449
+ ]
450
+ }
451
+ ]
452
+ }