agentweaver 0.1.9 → 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 (26) hide show
  1. package/README.md +60 -28
  2. package/dist/artifacts.js +1 -1
  3. package/dist/errors.js +7 -0
  4. package/dist/index.js +66 -34
  5. package/dist/interactive-ui.js +351 -44
  6. package/dist/pipeline/declarative-flows.js +7 -4
  7. package/dist/pipeline/flow-catalog.js +28 -21
  8. package/dist/pipeline/flow-specs/opencode/auto-opencode.json +1365 -0
  9. package/dist/pipeline/flow-specs/opencode/bugz/bug-analyze-opencode.json +382 -0
  10. package/dist/pipeline/flow-specs/opencode/bugz/bug-fix-opencode.json +56 -0
  11. package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-diff-review-opencode.json +308 -0
  12. package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-review-opencode.json +437 -0
  13. package/dist/pipeline/flow-specs/opencode/gitlab/mr-description-opencode.json +117 -0
  14. package/dist/pipeline/flow-specs/opencode/go/run-go-linter-loop-opencode.json +321 -0
  15. package/dist/pipeline/flow-specs/opencode/go/run-go-tests-loop-opencode.json +321 -0
  16. package/dist/pipeline/flow-specs/opencode/implement-opencode.json +64 -0
  17. package/dist/pipeline/flow-specs/{plan-opencode.json → opencode/plan-opencode.json} +4 -4
  18. package/dist/pipeline/flow-specs/opencode/review/review-fix-opencode.json +209 -0
  19. package/dist/pipeline/flow-specs/opencode/review/review-opencode.json +452 -0
  20. package/dist/pipeline/flow-specs/opencode/task-describe-opencode.json +148 -0
  21. package/dist/pipeline/spec-loader.js +18 -7
  22. package/dist/runtime/process-runner.js +45 -1
  23. package/package.json +1 -1
  24. package/dist/pipeline/flow-specs/preflight.json +0 -206
  25. package/dist/pipeline/flow-specs/run-linter-loop.json +0 -155
  26. package/dist/pipeline/flow-specs/run-tests-loop.json +0 -155
@@ -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
+ }
@@ -0,0 +1,148 @@
1
+ {
2
+ "kind": "task-describe-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "task_describe",
7
+ "steps": [
8
+ {
9
+ "id": "fetch_jira",
10
+ "node": "jira-fetch",
11
+ "params": {
12
+ "jiraApiUrl": {
13
+ "ref": "params.jiraApiUrl"
14
+ },
15
+ "outputFile": {
16
+ "artifact": {
17
+ "kind": "jira-task-file",
18
+ "taskKey": {
19
+ "ref": "params.taskKey"
20
+ }
21
+ }
22
+ }
23
+ },
24
+ "expect": [
25
+ {
26
+ "kind": "require-file",
27
+ "path": {
28
+ "artifact": {
29
+ "kind": "jira-task-file",
30
+ "taskKey": {
31
+ "ref": "params.taskKey"
32
+ }
33
+ }
34
+ },
35
+ "message": "Jira fetch node did not produce the Jira task file."
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "id": "run_codex_task_describe",
41
+ "node": "opencode-prompt",
42
+ "prompt": {
43
+ "templateRef": "task-describe",
44
+ "vars": {
45
+ "jira_task_file": {
46
+ "artifact": {
47
+ "kind": "jira-task-file",
48
+ "taskKey": {
49
+ "ref": "params.taskKey"
50
+ }
51
+ }
52
+ },
53
+ "jira_description_file": {
54
+ "artifact": {
55
+ "kind": "jira-description-file",
56
+ "taskKey": {
57
+ "ref": "params.taskKey"
58
+ }
59
+ }
60
+ },
61
+ "jira_description_json_file": {
62
+ "artifact": {
63
+ "kind": "jira-description-json-file",
64
+ "taskKey": {
65
+ "ref": "params.taskKey"
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "extraPrompt": {
71
+ "ref": "params.extraPrompt"
72
+ },
73
+ "format": "task-prompt"
74
+ },
75
+ "params": {
76
+ "labelText": {
77
+ "const": "Running OpenCode task description mode"
78
+ },
79
+ "model": {
80
+ "const": "minimax-coding-plan/MiniMax-M2.7"
81
+ },
82
+ "requiredArtifacts": {
83
+ "list": [
84
+ {
85
+ "artifact": {
86
+ "kind": "jira-description-file",
87
+ "taskKey": {
88
+ "ref": "params.taskKey"
89
+ }
90
+ }
91
+ },
92
+ {
93
+ "artifact": {
94
+ "kind": "jira-description-json-file",
95
+ "taskKey": {
96
+ "ref": "params.taskKey"
97
+ }
98
+ }
99
+ }
100
+ ]
101
+ }
102
+ },
103
+ "expect": [
104
+ {
105
+ "kind": "require-file",
106
+ "when": {
107
+ "not": {
108
+ "ref": "context.dryRun"
109
+ }
110
+ },
111
+ "path": {
112
+ "artifact": {
113
+ "kind": "jira-description-file",
114
+ "taskKey": {
115
+ "ref": "params.taskKey"
116
+ }
117
+ }
118
+ },
119
+ "message": "Task describe mode did not produce the Jira description artifact."
120
+ },
121
+ {
122
+ "kind": "require-structured-artifacts",
123
+ "when": {
124
+ "not": {
125
+ "ref": "context.dryRun"
126
+ }
127
+ },
128
+ "items": [
129
+ {
130
+ "path": {
131
+ "artifact": {
132
+ "kind": "jira-description-json-file",
133
+ "taskKey": {
134
+ "ref": "params.taskKey"
135
+ }
136
+ }
137
+ },
138
+ "schemaId": "jira-description/v1"
139
+ }
140
+ ],
141
+ "message": "Task describe mode produced invalid structured artifacts."
142
+ }
143
+ ]
144
+ }
145
+ ]
146
+ }
147
+ ]
148
+ }
@@ -22,20 +22,31 @@ export function listBuiltInFlowSpecFiles() {
22
22
  if (!existsSync(BUILT_IN_FLOW_SPECS_DIR)) {
23
23
  return [];
24
24
  }
25
- return readdirSync(BUILT_IN_FLOW_SPECS_DIR, { withFileTypes: true })
26
- .filter((entry) => entry.isFile() && entry.name.endsWith(".json"))
27
- .map((entry) => entry.name)
25
+ return collectJsonFilesRecursively(BUILT_IN_FLOW_SPECS_DIR)
26
+ .map((filePath) => path.relative(BUILT_IN_FLOW_SPECS_DIR, filePath))
28
27
  .sort((left, right) => left.localeCompare(right));
29
28
  }
29
+ function collectJsonFilesRecursively(directory) {
30
+ const entries = readdirSync(directory, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name));
31
+ const files = [];
32
+ for (const entry of entries) {
33
+ const entryPath = path.join(directory, entry.name);
34
+ if (entry.isDirectory()) {
35
+ files.push(...collectJsonFilesRecursively(entryPath));
36
+ continue;
37
+ }
38
+ if (entry.isFile() && entry.name.endsWith(".json")) {
39
+ files.push(entryPath);
40
+ }
41
+ }
42
+ return files;
43
+ }
30
44
  export function listProjectFlowSpecFiles(cwd) {
31
45
  const directory = projectFlowSpecsDir(cwd);
32
46
  if (!existsSync(directory)) {
33
47
  return [];
34
48
  }
35
- return readdirSync(directory, { withFileTypes: true })
36
- .filter((entry) => entry.isFile() && entry.name.endsWith(".json"))
37
- .map((entry) => path.join(directory, entry.name))
38
- .sort((left, right) => left.localeCompare(right));
49
+ return collectJsonFilesRecursively(directory);
39
50
  }
40
51
  export function loadFlowSpecSync(source) {
41
52
  return parseFlowSpec(source.source === "built-in" ? resolveBuiltInFlowSpecPath(source.fileName) : source.filePath);