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,64 @@
1
+ {
2
+ "kind": "implement-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "implement",
7
+ "steps": [
8
+ {
9
+ "id": "run_codex_implement",
10
+ "node": "opencode-prompt",
11
+ "prompt": {
12
+ "templateRef": "implement",
13
+ "vars": {
14
+ "design_file": {
15
+ "artifact": {
16
+ "kind": "design-file",
17
+ "taskKey": {
18
+ "ref": "params.taskKey"
19
+ }
20
+ }
21
+ },
22
+ "design_json_file": {
23
+ "artifact": {
24
+ "kind": "design-json-file",
25
+ "taskKey": {
26
+ "ref": "params.taskKey"
27
+ }
28
+ }
29
+ },
30
+ "plan_file": {
31
+ "artifact": {
32
+ "kind": "plan-file",
33
+ "taskKey": {
34
+ "ref": "params.taskKey"
35
+ }
36
+ }
37
+ },
38
+ "plan_json_file": {
39
+ "artifact": {
40
+ "kind": "plan-json-file",
41
+ "taskKey": {
42
+ "ref": "params.taskKey"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ "extraPrompt": {
48
+ "ref": "params.extraPrompt"
49
+ },
50
+ "format": "task-prompt"
51
+ },
52
+ "params": {
53
+ "labelText": {
54
+ "const": "Running OpenCode implementation mode locally"
55
+ },
56
+ "model": {
57
+ "const": "minimax-coding-plan/MiniMax-M2.7"
58
+ }
59
+ }
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,603 @@
1
+ {
2
+ "kind": "plan-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "plan-opencode",
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
+ "attachmentsManifestFile": {
24
+ "artifact": {
25
+ "kind": "jira-attachments-manifest-file",
26
+ "taskKey": {
27
+ "ref": "params.taskKey"
28
+ }
29
+ }
30
+ },
31
+ "attachmentsContextFile": {
32
+ "artifact": {
33
+ "kind": "jira-attachments-context-file",
34
+ "taskKey": {
35
+ "ref": "params.taskKey"
36
+ }
37
+ }
38
+ }
39
+ },
40
+ "expect": [
41
+ {
42
+ "kind": "require-file",
43
+ "path": {
44
+ "artifact": {
45
+ "kind": "jira-task-file",
46
+ "taskKey": {
47
+ "ref": "params.taskKey"
48
+ }
49
+ }
50
+ },
51
+ "message": "Jira fetch node did not produce the Jira task file."
52
+ },
53
+ {
54
+ "kind": "require-file",
55
+ "path": {
56
+ "artifact": {
57
+ "kind": "jira-attachments-manifest-file",
58
+ "taskKey": {
59
+ "ref": "params.taskKey"
60
+ }
61
+ }
62
+ },
63
+ "message": "Jira fetch node did not produce the Jira attachments manifest file."
64
+ },
65
+ {
66
+ "kind": "require-file",
67
+ "path": {
68
+ "artifact": {
69
+ "kind": "jira-attachments-context-file",
70
+ "taskKey": {
71
+ "ref": "params.taskKey"
72
+ }
73
+ }
74
+ },
75
+ "message": "Jira fetch node did not produce the Jira attachments context file."
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ "id": "load_existing_task_summary",
81
+ "when": {
82
+ "all": [
83
+ {
84
+ "not": {
85
+ "ref": "params.forceRefresh"
86
+ }
87
+ },
88
+ {
89
+ "exists": {
90
+ "artifact": {
91
+ "kind": "task-summary-file",
92
+ "taskKey": {
93
+ "ref": "params.taskKey"
94
+ }
95
+ }
96
+ }
97
+ }
98
+ ]
99
+ },
100
+ "node": "summary-file-load",
101
+ "params": {
102
+ "path": {
103
+ "artifact": {
104
+ "kind": "task-summary-file",
105
+ "taskKey": {
106
+ "ref": "params.taskKey"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ },
112
+ {
113
+ "id": "generate_task_summary",
114
+ "when": {
115
+ "any": [
116
+ {
117
+ "ref": "params.forceRefresh"
118
+ },
119
+ {
120
+ "not": {
121
+ "exists": {
122
+ "artifact": {
123
+ "kind": "task-summary-file",
124
+ "taskKey": {
125
+ "ref": "params.taskKey"
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ ]
132
+ },
133
+ "node": "opencode-prompt",
134
+ "prompt": {
135
+ "templateRef": "task-summary",
136
+ "vars": {
137
+ "jira_task_file": {
138
+ "artifact": {
139
+ "kind": "jira-task-file",
140
+ "taskKey": {
141
+ "ref": "params.taskKey"
142
+ }
143
+ }
144
+ },
145
+ "task_summary_file": {
146
+ "artifact": {
147
+ "kind": "task-summary-file",
148
+ "taskKey": {
149
+ "ref": "params.taskKey"
150
+ }
151
+ }
152
+ },
153
+ "task_summary_json_file": {
154
+ "artifact": {
155
+ "kind": "task-summary-json-file",
156
+ "taskKey": {
157
+ "ref": "params.taskKey"
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "format": "plain"
163
+ },
164
+ "params": {
165
+ "labelText": {
166
+ "const": "Preparing task summary"
167
+ },
168
+ "outputFile": {
169
+ "artifact": {
170
+ "kind": "task-summary-file",
171
+ "taskKey": {
172
+ "ref": "params.taskKey"
173
+ }
174
+ }
175
+ },
176
+ "requiredArtifacts": {
177
+ "list": [
178
+ {
179
+ "artifact": {
180
+ "kind": "task-summary-json-file",
181
+ "taskKey": {
182
+ "ref": "params.taskKey"
183
+ }
184
+ }
185
+ }
186
+ ]
187
+ },
188
+ "model": {
189
+ "const": "minimax-coding-plan/MiniMax-M2.7"
190
+ }
191
+ },
192
+ "expect": [
193
+ {
194
+ "kind": "require-artifacts",
195
+ "when": {
196
+ "not": {
197
+ "ref": "context.dryRun"
198
+ }
199
+ },
200
+ "paths": {
201
+ "list": [
202
+ {
203
+ "artifact": {
204
+ "kind": "task-summary-file",
205
+ "taskKey": {
206
+ "ref": "params.taskKey"
207
+ }
208
+ }
209
+ }
210
+ ]
211
+ },
212
+ "message": "Claude summary did not produce the task summary artifact."
213
+ },
214
+ {
215
+ "kind": "require-structured-artifacts",
216
+ "when": {
217
+ "not": {
218
+ "ref": "context.dryRun"
219
+ }
220
+ },
221
+ "items": [
222
+ {
223
+ "path": {
224
+ "artifact": {
225
+ "kind": "task-summary-json-file",
226
+ "taskKey": {
227
+ "ref": "params.taskKey"
228
+ }
229
+ }
230
+ },
231
+ "schemaId": "task-summary/v1"
232
+ }
233
+ ],
234
+ "message": "Claude summary produced invalid structured artifacts."
235
+ }
236
+ ],
237
+ "after": [
238
+ {
239
+ "kind": "set-summary-from-file",
240
+ "when": {
241
+ "not": {
242
+ "ref": "context.dryRun"
243
+ }
244
+ },
245
+ "path": {
246
+ "artifact": {
247
+ "kind": "task-summary-file",
248
+ "taskKey": {
249
+ "ref": "params.taskKey"
250
+ }
251
+ }
252
+ }
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "id": "generate_planning_questions",
258
+ "node": "opencode-prompt",
259
+ "prompt": {
260
+ "templateRef": "plan-questions",
261
+ "vars": {
262
+ "jira_task_file": {
263
+ "artifact": {
264
+ "kind": "jira-task-file",
265
+ "taskKey": {
266
+ "ref": "params.taskKey"
267
+ }
268
+ }
269
+ },
270
+ "jira_attachments_manifest_file": {
271
+ "artifact": {
272
+ "kind": "jira-attachments-manifest-file",
273
+ "taskKey": {
274
+ "ref": "params.taskKey"
275
+ }
276
+ }
277
+ },
278
+ "jira_attachments_context_file": {
279
+ "artifact": {
280
+ "kind": "jira-attachments-context-file",
281
+ "taskKey": {
282
+ "ref": "params.taskKey"
283
+ }
284
+ }
285
+ },
286
+ "planning_questions_json_file": {
287
+ "artifact": {
288
+ "kind": "planning-questions-json-file",
289
+ "taskKey": {
290
+ "ref": "params.taskKey"
291
+ }
292
+ }
293
+ }
294
+ },
295
+ "extraPrompt": {
296
+ "ref": "params.extraPrompt"
297
+ },
298
+ "format": "task-prompt"
299
+ },
300
+ "params": {
301
+ "labelText": {
302
+ "const": "Generating planning questions"
303
+ },
304
+ "model": {
305
+ "const": "minimax-coding-plan/MiniMax-M2.7"
306
+ },
307
+ "requiredArtifacts": {
308
+ "list": [
309
+ {
310
+ "artifact": {
311
+ "kind": "planning-questions-json-file",
312
+ "taskKey": {
313
+ "ref": "params.taskKey"
314
+ }
315
+ }
316
+ }
317
+ ]
318
+ }
319
+ },
320
+ "expect": [
321
+ {
322
+ "kind": "require-artifacts",
323
+ "when": {
324
+ "not": {
325
+ "ref": "context.dryRun"
326
+ }
327
+ },
328
+ "paths": {
329
+ "list": [
330
+ {
331
+ "artifact": {
332
+ "kind": "planning-questions-json-file",
333
+ "taskKey": {
334
+ "ref": "params.taskKey"
335
+ }
336
+ }
337
+ }
338
+ ]
339
+ },
340
+ "message": "Planning questions step did not produce the questions artifact."
341
+ },
342
+ {
343
+ "kind": "require-structured-artifacts",
344
+ "when": {
345
+ "not": {
346
+ "ref": "context.dryRun"
347
+ }
348
+ },
349
+ "items": [
350
+ {
351
+ "path": {
352
+ "artifact": {
353
+ "kind": "planning-questions-json-file",
354
+ "taskKey": {
355
+ "ref": "params.taskKey"
356
+ }
357
+ }
358
+ },
359
+ "schemaId": "planning-questions/v1"
360
+ }
361
+ ],
362
+ "message": "Planning questions step produced invalid structured artifacts."
363
+ }
364
+ ]
365
+ },
366
+ {
367
+ "id": "build_planning_questions_form",
368
+ "node": "planning-questions-form",
369
+ "params": {
370
+ "planningQuestionsJsonFile": {
371
+ "artifact": {
372
+ "kind": "planning-questions-json-file",
373
+ "taskKey": {
374
+ "ref": "params.taskKey"
375
+ }
376
+ }
377
+ },
378
+ "formId": {
379
+ "const": "planning-questions"
380
+ },
381
+ "title": {
382
+ "const": "Planning Questions"
383
+ },
384
+ "description": {
385
+ "const": "Ответьте на вопросы модели, если они нужны для точного design/plan. Если вопросов нет, шаг завершится автоматически."
386
+ }
387
+ }
388
+ },
389
+ {
390
+ "id": "collect_planning_answers",
391
+ "node": "user-input",
392
+ "params": {
393
+ "formId": {
394
+ "ref": "steps.plan-opencode.build_planning_questions_form.value.formId"
395
+ },
396
+ "title": {
397
+ "ref": "steps.plan-opencode.build_planning_questions_form.value.title"
398
+ },
399
+ "description": {
400
+ "ref": "steps.plan-opencode.build_planning_questions_form.value.description"
401
+ },
402
+ "submitLabel": {
403
+ "const": "Continue planning"
404
+ },
405
+ "fields": {
406
+ "ref": "steps.plan-opencode.build_planning_questions_form.value.fields"
407
+ },
408
+ "outputFile": {
409
+ "artifact": {
410
+ "kind": "planning-answers-json-file",
411
+ "taskKey": {
412
+ "ref": "params.taskKey"
413
+ }
414
+ }
415
+ }
416
+ },
417
+ "expect": [
418
+ {
419
+ "kind": "require-structured-artifacts",
420
+ "items": [
421
+ {
422
+ "path": {
423
+ "artifact": {
424
+ "kind": "planning-answers-json-file",
425
+ "taskKey": {
426
+ "ref": "params.taskKey"
427
+ }
428
+ }
429
+ },
430
+ "schemaId": "user-input/v1"
431
+ }
432
+ ],
433
+ "message": "Planning answers input is missing or invalid."
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "id": "run_opencode_plan",
439
+ "node": "opencode-prompt",
440
+ "prompt": {
441
+ "templateRef": "plan",
442
+ "vars": {
443
+ "jira_task_file": {
444
+ "artifact": {
445
+ "kind": "jira-task-file",
446
+ "taskKey": {
447
+ "ref": "params.taskKey"
448
+ }
449
+ }
450
+ },
451
+ "jira_attachments_manifest_file": {
452
+ "artifact": {
453
+ "kind": "jira-attachments-manifest-file",
454
+ "taskKey": {
455
+ "ref": "params.taskKey"
456
+ }
457
+ }
458
+ },
459
+ "jira_attachments_context_file": {
460
+ "artifact": {
461
+ "kind": "jira-attachments-context-file",
462
+ "taskKey": {
463
+ "ref": "params.taskKey"
464
+ }
465
+ }
466
+ },
467
+ "design_file": {
468
+ "artifact": {
469
+ "kind": "design-file",
470
+ "taskKey": {
471
+ "ref": "params.taskKey"
472
+ }
473
+ }
474
+ },
475
+ "design_json_file": {
476
+ "artifact": {
477
+ "kind": "design-json-file",
478
+ "taskKey": {
479
+ "ref": "params.taskKey"
480
+ }
481
+ }
482
+ },
483
+ "plan_file": {
484
+ "artifact": {
485
+ "kind": "plan-file",
486
+ "taskKey": {
487
+ "ref": "params.taskKey"
488
+ }
489
+ }
490
+ },
491
+ "plan_json_file": {
492
+ "artifact": {
493
+ "kind": "plan-json-file",
494
+ "taskKey": {
495
+ "ref": "params.taskKey"
496
+ }
497
+ }
498
+ },
499
+ "qa_file": {
500
+ "artifact": {
501
+ "kind": "qa-file",
502
+ "taskKey": {
503
+ "ref": "params.taskKey"
504
+ }
505
+ }
506
+ },
507
+ "qa_json_file": {
508
+ "artifact": {
509
+ "kind": "qa-json-file",
510
+ "taskKey": {
511
+ "ref": "params.taskKey"
512
+ }
513
+ }
514
+ }
515
+ },
516
+ "extraPrompt": {
517
+ "appendPrompt": {
518
+ "base": {
519
+ "ref": "params.extraPrompt"
520
+ },
521
+ "suffix": {
522
+ "ref": "steps.plan-opencode.collect_planning_answers.value.promptSuffix"
523
+ }
524
+ }
525
+ },
526
+ "format": "task-prompt"
527
+ },
528
+ "params": {
529
+ "labelText": {
530
+ "const": "Running OpenCode planning mode"
531
+ },
532
+ "model": {
533
+ "const": "minimax-coding-plan/MiniMax-M2.7"
534
+ }
535
+ },
536
+ "expect": [
537
+ {
538
+ "kind": "require-artifacts",
539
+ "when": {
540
+ "not": {
541
+ "ref": "context.dryRun"
542
+ }
543
+ },
544
+ "paths": {
545
+ "artifactList": {
546
+ "kind": "plan-artifacts",
547
+ "taskKey": {
548
+ "ref": "params.taskKey"
549
+ }
550
+ }
551
+ },
552
+ "message": "Plan mode did not produce the required artifacts."
553
+ },
554
+ {
555
+ "kind": "require-structured-artifacts",
556
+ "when": {
557
+ "not": {
558
+ "ref": "context.dryRun"
559
+ }
560
+ },
561
+ "items": [
562
+ {
563
+ "path": {
564
+ "artifact": {
565
+ "kind": "design-json-file",
566
+ "taskKey": {
567
+ "ref": "params.taskKey"
568
+ }
569
+ }
570
+ },
571
+ "schemaId": "implementation-design/v1"
572
+ },
573
+ {
574
+ "path": {
575
+ "artifact": {
576
+ "kind": "plan-json-file",
577
+ "taskKey": {
578
+ "ref": "params.taskKey"
579
+ }
580
+ }
581
+ },
582
+ "schemaId": "implementation-plan/v1"
583
+ },
584
+ {
585
+ "path": {
586
+ "artifact": {
587
+ "kind": "qa-json-file",
588
+ "taskKey": {
589
+ "ref": "params.taskKey"
590
+ }
591
+ }
592
+ },
593
+ "schemaId": "qa-plan/v1"
594
+ }
595
+ ],
596
+ "message": "Plan mode produced invalid structured artifacts."
597
+ }
598
+ ]
599
+ }
600
+ ]
601
+ }
602
+ ]
603
+ }