agentweaver 0.1.10 → 0.1.12
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.
- package/README.md +218 -224
- package/dist/artifacts.js +109 -55
- package/dist/executors/{codex-local-executor.js → codex-executor.js} +6 -5
- package/dist/executors/configs/{codex-local-config.js → codex-config.js} +1 -1
- package/dist/executors/configs/jira-fetch-config.js +2 -0
- package/dist/executors/configs/telegram-notifier-config.js +3 -0
- package/dist/executors/fetch-gitlab-diff-executor.js +1 -1
- package/dist/executors/fetch-gitlab-review-executor.js +1 -1
- package/dist/executors/git-commit-executor.js +25 -0
- package/dist/executors/jira-fetch-executor.js +1 -0
- package/dist/executors/opencode-executor.js +22 -11
- package/dist/executors/process-executor.js +3 -0
- package/dist/executors/telegram-notifier-executor.js +54 -0
- package/dist/flow-state.js +46 -1
- package/dist/gitlab.js +13 -8
- package/dist/index.js +477 -514
- package/dist/interactive-ui.js +609 -88
- package/dist/jira.js +109 -5
- package/dist/pipeline/auto-flow.js +6 -6
- package/dist/pipeline/context.js +1 -0
- package/dist/pipeline/flow-catalog.js +34 -4
- package/dist/pipeline/flow-model-settings.js +77 -0
- package/dist/pipeline/flow-specs/auto-common.json +446 -0
- package/dist/pipeline/flow-specs/auto-golang.json +563 -0
- package/dist/pipeline/flow-specs/{bug-analyze.json → bugz/bug-analyze.json} +43 -25
- package/dist/pipeline/flow-specs/{bug-fix.json → bugz/bug-fix.json} +5 -4
- package/dist/pipeline/flow-specs/git-commit.json +196 -0
- package/dist/pipeline/flow-specs/{gitlab-diff-review.json → gitlab/gitlab-diff-review.json} +20 -50
- package/dist/pipeline/flow-specs/{gitlab-review.json → gitlab/gitlab-review.json} +65 -133
- package/dist/pipeline/flow-specs/{mr-description.json → gitlab/mr-description.json} +17 -10
- package/dist/pipeline/flow-specs/{run-go-linter-loop.json → go/run-go-linter-loop.json} +40 -14
- package/dist/pipeline/flow-specs/{run-go-tests-loop.json → go/run-go-tests-loop.json} +40 -14
- package/dist/pipeline/flow-specs/implement.json +5 -4
- package/dist/pipeline/flow-specs/plan.json +40 -148
- package/dist/pipeline/flow-specs/{review-fix.json → review/review-fix.json} +74 -13
- package/dist/pipeline/flow-specs/review/review-loop.json +282 -0
- package/dist/pipeline/flow-specs/review/review-project.json +87 -0
- package/dist/pipeline/flow-specs/review/review.json +126 -0
- package/dist/pipeline/flow-specs/task-describe.json +252 -11
- package/dist/pipeline/launch-profile-config.js +38 -0
- package/dist/pipeline/node-registry.js +75 -45
- package/dist/pipeline/nodes/build-failure-summary-node.js +16 -29
- package/dist/pipeline/nodes/build-review-fix-prompt-node.js +36 -0
- package/dist/pipeline/nodes/codex-prompt-node.js +41 -0
- package/dist/pipeline/nodes/commit-message-form-node.js +79 -0
- package/dist/pipeline/nodes/git-commit-form-node.js +138 -0
- package/dist/pipeline/nodes/git-commit-node.js +28 -0
- package/dist/pipeline/nodes/git-status-node.js +221 -0
- package/dist/pipeline/nodes/gitlab-review-artifacts-node.js +10 -6
- package/dist/pipeline/nodes/jira-context-node.js +10 -0
- package/dist/pipeline/nodes/jira-fetch-node.js +3 -0
- package/dist/pipeline/nodes/llm-prompt-node.js +62 -0
- package/dist/pipeline/nodes/plan-codex-node.js +1 -1
- package/dist/pipeline/nodes/read-file-node.js +11 -0
- package/dist/pipeline/nodes/review-findings-form-node.js +48 -14
- package/dist/pipeline/nodes/select-files-form-node.js +72 -0
- package/dist/pipeline/nodes/telegram-notifier-node.js +28 -0
- package/dist/pipeline/nodes/user-input-node.js +43 -8
- package/dist/pipeline/nodes/write-selection-file-node.js +46 -0
- package/dist/pipeline/prompt-registry.js +3 -4
- package/dist/pipeline/prompt-runtime.js +13 -3
- package/dist/pipeline/registry.js +6 -8
- package/dist/pipeline/spec-compiler.js +5 -0
- package/dist/pipeline/spec-types.js +9 -3
- package/dist/pipeline/spec-validator.js +4 -0
- package/dist/pipeline/types.js +1 -0
- package/dist/pipeline/value-resolver.js +50 -38
- package/dist/prompts.js +119 -110
- package/dist/runtime/agentweaver-home.js +8 -0
- package/dist/runtime/command-resolution.js +0 -38
- package/dist/runtime/env-loader.js +43 -0
- package/dist/runtime/process-runner.js +9 -3
- package/dist/structured-artifact-schema-registry.js +54 -0
- package/dist/structured-artifact-schemas.json +22 -20
- package/dist/structured-artifacts.js +3 -43
- package/dist/user-input.js +38 -3
- package/package.json +2 -6
- package/Dockerfile.codex +0 -56
- package/dist/executors/claude-executor.js +0 -46
- package/dist/executors/codex-docker-executor.js +0 -27
- package/dist/executors/configs/claude-config.js +0 -12
- package/dist/executors/configs/codex-docker-config.js +0 -10
- package/dist/executors/configs/verify-build-config.js +0 -7
- package/dist/executors/verify-build-executor.js +0 -123
- package/dist/pipeline/flow-specs/auto.json +0 -979
- package/dist/pipeline/flow-specs/opencode/auto-opencode.json +0 -1365
- package/dist/pipeline/flow-specs/opencode/bugz/bug-analyze-opencode.json +0 -382
- package/dist/pipeline/flow-specs/opencode/bugz/bug-fix-opencode.json +0 -56
- package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-diff-review-opencode.json +0 -308
- package/dist/pipeline/flow-specs/opencode/gitlab/gitlab-review-opencode.json +0 -437
- package/dist/pipeline/flow-specs/opencode/gitlab/mr-description-opencode.json +0 -117
- package/dist/pipeline/flow-specs/opencode/go/run-go-linter-loop-opencode.json +0 -321
- package/dist/pipeline/flow-specs/opencode/go/run-go-tests-loop-opencode.json +0 -321
- package/dist/pipeline/flow-specs/opencode/implement-opencode.json +0 -64
- package/dist/pipeline/flow-specs/opencode/plan-opencode.json +0 -603
- package/dist/pipeline/flow-specs/opencode/review/review-fix-opencode.json +0 -209
- package/dist/pipeline/flow-specs/opencode/review/review-opencode.json +0 -452
- package/dist/pipeline/flow-specs/opencode/task-describe-opencode.json +0 -148
- package/dist/pipeline/flow-specs/review-project.json +0 -243
- package/dist/pipeline/flow-specs/review.json +0 -312
- package/dist/pipeline/flows/preflight-flow.js +0 -19
- package/dist/pipeline/nodes/claude-prompt-node.js +0 -54
- package/dist/pipeline/nodes/codex-docker-prompt-node.js +0 -32
- package/dist/pipeline/nodes/codex-local-prompt-node.js +0 -32
- package/dist/pipeline/nodes/review-claude-node.js +0 -38
- package/dist/pipeline/nodes/review-reply-codex-node.js +0 -40
- package/dist/pipeline/nodes/verify-build-node.js +0 -15
- package/dist/runtime/docker-runtime.js +0 -51
- package/docker-compose.yml +0 -445
- package/verify_build.sh +0 -105
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"kind": "review-flow",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"phases": [
|
|
5
|
-
{
|
|
6
|
-
"id": "review",
|
|
7
|
-
"steps": [
|
|
8
|
-
{
|
|
9
|
-
"id": "run_claude_review",
|
|
10
|
-
"node": "claude-prompt",
|
|
11
|
-
"prompt": {
|
|
12
|
-
"templateRef": "review",
|
|
13
|
-
"vars": {
|
|
14
|
-
"jira_task_file": {
|
|
15
|
-
"artifact": {
|
|
16
|
-
"kind": "jira-task-file",
|
|
17
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"design_file": {
|
|
21
|
-
"artifact": {
|
|
22
|
-
"kind": "design-file",
|
|
23
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"design_json_file": {
|
|
27
|
-
"artifact": {
|
|
28
|
-
"kind": "design-json-file",
|
|
29
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"plan_file": {
|
|
33
|
-
"artifact": {
|
|
34
|
-
"kind": "plan-file",
|
|
35
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"plan_json_file": {
|
|
39
|
-
"artifact": {
|
|
40
|
-
"kind": "plan-json-file",
|
|
41
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"review_file": {
|
|
45
|
-
"artifact": {
|
|
46
|
-
"kind": "review-file",
|
|
47
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
48
|
-
"iteration": { "ref": "params.iteration" }
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"review_json_file": {
|
|
52
|
-
"artifact": {
|
|
53
|
-
"kind": "review-json-file",
|
|
54
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
55
|
-
"iteration": { "ref": "params.iteration" }
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"extraPrompt": { "ref": "params.extraPrompt" },
|
|
60
|
-
"format": "task-prompt"
|
|
61
|
-
},
|
|
62
|
-
"params": {
|
|
63
|
-
"labelText": {
|
|
64
|
-
"template": "Running Claude review mode (iteration {iteration})",
|
|
65
|
-
"vars": {
|
|
66
|
-
"iteration": { "ref": "params.iteration" }
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
"model": { "const": "opus" }
|
|
70
|
-
},
|
|
71
|
-
"expect": [
|
|
72
|
-
{
|
|
73
|
-
"kind": "require-artifacts",
|
|
74
|
-
"when": { "not": { "ref": "context.dryRun" } },
|
|
75
|
-
"paths": {
|
|
76
|
-
"list": [
|
|
77
|
-
{
|
|
78
|
-
"artifact": {
|
|
79
|
-
"kind": "review-file",
|
|
80
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
81
|
-
"iteration": { "ref": "params.iteration" }
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"message": "Claude review did not produce the required review artifact."
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"kind": "require-structured-artifacts",
|
|
90
|
-
"when": { "not": { "ref": "context.dryRun" } },
|
|
91
|
-
"items": [
|
|
92
|
-
{
|
|
93
|
-
"path": {
|
|
94
|
-
"artifact": {
|
|
95
|
-
"kind": "review-json-file",
|
|
96
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
97
|
-
"iteration": { "ref": "params.iteration" }
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"schemaId": "review-findings/v1"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"message": "Claude review produced invalid structured artifacts."
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"id": "summarize_review",
|
|
109
|
-
"when": { "not": { "ref": "context.dryRun" } },
|
|
110
|
-
"node": "claude-prompt",
|
|
111
|
-
"prompt": {
|
|
112
|
-
"templateRef": "review-summary",
|
|
113
|
-
"vars": {
|
|
114
|
-
"review_file": {
|
|
115
|
-
"artifact": {
|
|
116
|
-
"kind": "review-file",
|
|
117
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
118
|
-
"iteration": { "ref": "params.iteration" }
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"review_summary_file": {
|
|
122
|
-
"artifact": {
|
|
123
|
-
"kind": "review-summary-file",
|
|
124
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
125
|
-
"iteration": { "ref": "params.iteration" }
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"format": "plain"
|
|
130
|
-
},
|
|
131
|
-
"params": {
|
|
132
|
-
"labelText": { "const": "Preparing Claude review summary" },
|
|
133
|
-
"summaryTitle": { "const": "Claude Comments" },
|
|
134
|
-
"model": { "const": "haiku" },
|
|
135
|
-
"outputFile": {
|
|
136
|
-
"artifact": {
|
|
137
|
-
"kind": "review-summary-file",
|
|
138
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
139
|
-
"iteration": { "ref": "params.iteration" }
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"id": "run_codex_review_reply",
|
|
146
|
-
"node": "codex-local-prompt",
|
|
147
|
-
"prompt": {
|
|
148
|
-
"templateRef": "review-reply",
|
|
149
|
-
"vars": {
|
|
150
|
-
"review_file": {
|
|
151
|
-
"artifact": {
|
|
152
|
-
"kind": "review-file",
|
|
153
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
154
|
-
"iteration": { "ref": "params.iteration" }
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"review_json_file": {
|
|
158
|
-
"artifact": {
|
|
159
|
-
"kind": "review-json-file",
|
|
160
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
161
|
-
"iteration": { "ref": "params.iteration" }
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"jira_task_file": {
|
|
165
|
-
"artifact": {
|
|
166
|
-
"kind": "jira-task-file",
|
|
167
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"design_file": {
|
|
171
|
-
"artifact": {
|
|
172
|
-
"kind": "design-file",
|
|
173
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
"design_json_file": {
|
|
177
|
-
"artifact": {
|
|
178
|
-
"kind": "design-json-file",
|
|
179
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
"plan_file": {
|
|
183
|
-
"artifact": {
|
|
184
|
-
"kind": "plan-file",
|
|
185
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
"plan_json_file": {
|
|
189
|
-
"artifact": {
|
|
190
|
-
"kind": "plan-json-file",
|
|
191
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
"review_reply_file": {
|
|
195
|
-
"artifact": {
|
|
196
|
-
"kind": "review-reply-file",
|
|
197
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
198
|
-
"iteration": { "ref": "params.iteration" }
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
"review_reply_json_file": {
|
|
202
|
-
"artifact": {
|
|
203
|
-
"kind": "review-reply-json-file",
|
|
204
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
205
|
-
"iteration": { "ref": "params.iteration" }
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
"extraPrompt": { "ref": "params.extraPrompt" },
|
|
210
|
-
"format": "task-prompt"
|
|
211
|
-
},
|
|
212
|
-
"params": {
|
|
213
|
-
"labelText": {
|
|
214
|
-
"template": "Running Codex review reply mode (iteration {iteration})",
|
|
215
|
-
"vars": {
|
|
216
|
-
"iteration": { "ref": "params.iteration" }
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
"model": { "const": "gpt-5.4" }
|
|
220
|
-
},
|
|
221
|
-
"expect": [
|
|
222
|
-
{
|
|
223
|
-
"kind": "require-artifacts",
|
|
224
|
-
"when": { "not": { "ref": "context.dryRun" } },
|
|
225
|
-
"paths": {
|
|
226
|
-
"list": [
|
|
227
|
-
{
|
|
228
|
-
"artifact": {
|
|
229
|
-
"kind": "review-reply-file",
|
|
230
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
231
|
-
"iteration": { "ref": "params.iteration" }
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
]
|
|
235
|
-
},
|
|
236
|
-
"message": "Codex review reply did not produce the required review-reply artifact."
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"kind": "require-structured-artifacts",
|
|
240
|
-
"when": { "not": { "ref": "context.dryRun" } },
|
|
241
|
-
"items": [
|
|
242
|
-
{
|
|
243
|
-
"path": {
|
|
244
|
-
"artifact": {
|
|
245
|
-
"kind": "review-reply-json-file",
|
|
246
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
247
|
-
"iteration": { "ref": "params.iteration" }
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
"schemaId": "review-reply/v1"
|
|
251
|
-
}
|
|
252
|
-
],
|
|
253
|
-
"message": "Codex review reply produced invalid structured artifacts."
|
|
254
|
-
}
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"id": "summarize_review_reply",
|
|
259
|
-
"when": { "not": { "ref": "context.dryRun" } },
|
|
260
|
-
"node": "claude-prompt",
|
|
261
|
-
"prompt": {
|
|
262
|
-
"templateRef": "review-reply-summary",
|
|
263
|
-
"vars": {
|
|
264
|
-
"review_reply_file": {
|
|
265
|
-
"artifact": {
|
|
266
|
-
"kind": "review-reply-file",
|
|
267
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
268
|
-
"iteration": { "ref": "params.iteration" }
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
"review_reply_summary_file": {
|
|
272
|
-
"artifact": {
|
|
273
|
-
"kind": "review-reply-summary-file",
|
|
274
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
275
|
-
"iteration": { "ref": "params.iteration" }
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
"format": "plain"
|
|
280
|
-
},
|
|
281
|
-
"params": {
|
|
282
|
-
"labelText": { "const": "Preparing Codex reply summary" },
|
|
283
|
-
"summaryTitle": { "const": "Codex Reply Summary" },
|
|
284
|
-
"model": { "const": "haiku" },
|
|
285
|
-
"outputFile": {
|
|
286
|
-
"artifact": {
|
|
287
|
-
"kind": "review-reply-summary-file",
|
|
288
|
-
"taskKey": { "ref": "params.taskKey" },
|
|
289
|
-
"iteration": { "ref": "params.iteration" }
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"id": "check_ready_to_merge",
|
|
296
|
-
"node": "file-check",
|
|
297
|
-
"params": {
|
|
298
|
-
"path": {
|
|
299
|
-
"artifact": {
|
|
300
|
-
"kind": "ready-to-merge-file",
|
|
301
|
-
"taskKey": { "ref": "params.taskKey" }
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
"panelTitle": { "const": "Ready To Merge" },
|
|
305
|
-
"foundMessage": { "const": "Изменения готовы к merge\nФайл ready-to-merge.md создан." },
|
|
306
|
-
"tone": { "const": "green" }
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
]
|
|
310
|
-
}
|
|
311
|
-
]
|
|
312
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { loadDeclarativeFlow } from "../declarative-flows.js";
|
|
2
|
-
import { runExpandedPhase } from "../declarative-flow-runner.js";
|
|
3
|
-
export async function runPreflightFlow(context, params) {
|
|
4
|
-
const flow = loadDeclarativeFlow("preflight.json");
|
|
5
|
-
const executionState = {
|
|
6
|
-
flowKind: flow.kind,
|
|
7
|
-
flowVersion: flow.version,
|
|
8
|
-
terminated: false,
|
|
9
|
-
phases: [],
|
|
10
|
-
};
|
|
11
|
-
for (const phase of flow.phases) {
|
|
12
|
-
await runExpandedPhase(phase, context, params, flow.constants, {
|
|
13
|
-
executionState,
|
|
14
|
-
flowKind: flow.kind,
|
|
15
|
-
flowVersion: flow.version,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return executionState;
|
|
19
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { requireArtifacts } from "../../artifacts.js";
|
|
3
|
-
import { printInfo, printPrompt, printSummary } from "../../tui.js";
|
|
4
|
-
import { toExecutorContext } from "../types.js";
|
|
5
|
-
export const claudePromptNode = {
|
|
6
|
-
kind: "claude-prompt",
|
|
7
|
-
version: 1,
|
|
8
|
-
async run(context, params) {
|
|
9
|
-
printInfo(params.labelText);
|
|
10
|
-
printPrompt("Claude", params.prompt);
|
|
11
|
-
const executor = context.executors.get("claude");
|
|
12
|
-
const value = await executor.execute(toExecutorContext(context), {
|
|
13
|
-
prompt: params.prompt,
|
|
14
|
-
...(params.command ? { command: params.command } : {}),
|
|
15
|
-
...(params.model ? { model: params.model } : {}),
|
|
16
|
-
env: { ...context.env },
|
|
17
|
-
}, executor.defaultConfig);
|
|
18
|
-
const outputs = [
|
|
19
|
-
...(params.requiredArtifacts ?? []).map((path) => ({ kind: "artifact", path, required: true })),
|
|
20
|
-
...(params.outputFile ? [{ kind: "artifact", path: params.outputFile, required: true }] : []),
|
|
21
|
-
];
|
|
22
|
-
if (!params.outputFile) {
|
|
23
|
-
return { value, outputs };
|
|
24
|
-
}
|
|
25
|
-
requireArtifacts([params.outputFile], params.missingArtifactsMessage ?? `Claude prompt did not produce ${params.outputFile}.`);
|
|
26
|
-
const artifactText = readFileSync(params.outputFile, "utf8").trim();
|
|
27
|
-
if (params.summaryTitle) {
|
|
28
|
-
printSummary(params.summaryTitle, artifactText);
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
value: {
|
|
32
|
-
...value,
|
|
33
|
-
artifactText,
|
|
34
|
-
},
|
|
35
|
-
outputs,
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
checks(_context, params) {
|
|
39
|
-
const requiredArtifacts = [
|
|
40
|
-
...(params.requiredArtifacts ?? []),
|
|
41
|
-
...(params.outputFile ? [params.outputFile] : []),
|
|
42
|
-
];
|
|
43
|
-
if (requiredArtifacts.length === 0) {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
return [
|
|
47
|
-
{
|
|
48
|
-
kind: "require-artifacts",
|
|
49
|
-
paths: requiredArtifacts,
|
|
50
|
-
message: params.missingArtifactsMessage ?? "Claude prompt node did not produce required artifacts.",
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
},
|
|
54
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { printInfo, printPrompt } from "../../tui.js";
|
|
2
|
-
import { toExecutorContext } from "../types.js";
|
|
3
|
-
export const codexDockerPromptNode = {
|
|
4
|
-
kind: "codex-docker-prompt",
|
|
5
|
-
version: 1,
|
|
6
|
-
async run(context, params) {
|
|
7
|
-
printInfo(params.labelText);
|
|
8
|
-
printPrompt("Codex", params.prompt);
|
|
9
|
-
const executor = context.executors.get("codex-docker");
|
|
10
|
-
const value = await executor.execute(toExecutorContext(context), {
|
|
11
|
-
dockerComposeFile: params.dockerComposeFile,
|
|
12
|
-
prompt: params.prompt,
|
|
13
|
-
...(params.model ? { model: params.model } : {}),
|
|
14
|
-
}, executor.defaultConfig);
|
|
15
|
-
return {
|
|
16
|
-
value,
|
|
17
|
-
outputs: (params.requiredArtifacts ?? []).map((path) => ({ kind: "artifact", path, required: true })),
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
checks(_context, params) {
|
|
21
|
-
if (!params.requiredArtifacts || params.requiredArtifacts.length === 0) {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
return [
|
|
25
|
-
{
|
|
26
|
-
kind: "require-artifacts",
|
|
27
|
-
paths: params.requiredArtifacts,
|
|
28
|
-
message: params.missingArtifactsMessage ?? "Codex docker node did not produce required artifacts.",
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { printInfo, printPrompt } from "../../tui.js";
|
|
2
|
-
import { toExecutorContext } from "../types.js";
|
|
3
|
-
export const codexLocalPromptNode = {
|
|
4
|
-
kind: "codex-local-prompt",
|
|
5
|
-
version: 1,
|
|
6
|
-
async run(context, params) {
|
|
7
|
-
printInfo(params.labelText);
|
|
8
|
-
printPrompt("Codex", params.prompt);
|
|
9
|
-
const executor = context.executors.get("codex-local");
|
|
10
|
-
const value = await executor.execute(toExecutorContext(context), {
|
|
11
|
-
prompt: params.prompt,
|
|
12
|
-
...(params.model ? { model: params.model } : {}),
|
|
13
|
-
env: { ...context.env },
|
|
14
|
-
}, executor.defaultConfig);
|
|
15
|
-
return {
|
|
16
|
-
value,
|
|
17
|
-
outputs: (params.requiredArtifacts ?? []).map((path) => ({ kind: "artifact", path, required: true })),
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
checks(_context, params) {
|
|
21
|
-
if (!params.requiredArtifacts || params.requiredArtifacts.length === 0) {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
return [
|
|
25
|
-
{
|
|
26
|
-
kind: "require-artifacts",
|
|
27
|
-
paths: params.requiredArtifacts,
|
|
28
|
-
message: params.missingArtifactsMessage ?? "Codex local node did not produce required artifacts.",
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { artifactFile, designFile, planFile } from "../../artifacts.js";
|
|
2
|
-
import { REVIEW_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
|
|
3
|
-
import { printInfo, printPrompt } from "../../tui.js";
|
|
4
|
-
import { toExecutorContext } from "../types.js";
|
|
5
|
-
export const reviewClaudeNode = {
|
|
6
|
-
kind: "review-claude",
|
|
7
|
-
version: 1,
|
|
8
|
-
async run(context, params) {
|
|
9
|
-
const reviewFile = artifactFile("review", params.taskKey, params.iteration);
|
|
10
|
-
const prompt = formatPrompt(formatTemplate(REVIEW_PROMPT_TEMPLATE, {
|
|
11
|
-
jira_task_file: params.jiraTaskFile,
|
|
12
|
-
design_file: designFile(params.taskKey),
|
|
13
|
-
plan_file: planFile(params.taskKey),
|
|
14
|
-
review_file: reviewFile,
|
|
15
|
-
}), params.extraPrompt);
|
|
16
|
-
printInfo(`Running Claude review mode (iteration ${params.iteration})`);
|
|
17
|
-
printPrompt("Claude", prompt);
|
|
18
|
-
const executor = context.executors.get("claude");
|
|
19
|
-
const value = await executor.execute(toExecutorContext(context), {
|
|
20
|
-
prompt,
|
|
21
|
-
command: params.claudeCmd,
|
|
22
|
-
env: { ...context.env },
|
|
23
|
-
}, executor.defaultConfig);
|
|
24
|
-
return {
|
|
25
|
-
value,
|
|
26
|
-
outputs: [{ kind: "artifact", path: reviewFile, required: true }],
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
checks(_context, params) {
|
|
30
|
-
return [
|
|
31
|
-
{
|
|
32
|
-
kind: "require-artifacts",
|
|
33
|
-
paths: [artifactFile("review", params.taskKey, params.iteration)],
|
|
34
|
-
message: "Claude review did not produce the required review artifact.",
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
},
|
|
38
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { artifactFile, designFile, planFile } from "../../artifacts.js";
|
|
2
|
-
import { REVIEW_REPLY_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
|
|
3
|
-
import { printInfo, printPrompt } from "../../tui.js";
|
|
4
|
-
import { toExecutorContext } from "../types.js";
|
|
5
|
-
export const reviewReplyCodexNode = {
|
|
6
|
-
kind: "review-reply-codex",
|
|
7
|
-
version: 1,
|
|
8
|
-
async run(context, params) {
|
|
9
|
-
const reviewFile = artifactFile("review", params.taskKey, params.iteration);
|
|
10
|
-
const reviewReplyFile = artifactFile("review-reply", params.taskKey, params.iteration);
|
|
11
|
-
const prompt = formatPrompt(formatTemplate(REVIEW_REPLY_PROMPT_TEMPLATE, {
|
|
12
|
-
review_file: reviewFile,
|
|
13
|
-
jira_task_file: params.jiraTaskFile,
|
|
14
|
-
design_file: designFile(params.taskKey),
|
|
15
|
-
plan_file: planFile(params.taskKey),
|
|
16
|
-
review_reply_file: reviewReplyFile,
|
|
17
|
-
}), params.extraPrompt);
|
|
18
|
-
printInfo(`Running Codex review reply mode (iteration ${params.iteration})`);
|
|
19
|
-
printPrompt("Codex", prompt);
|
|
20
|
-
const executor = context.executors.get("codex-local");
|
|
21
|
-
const value = await executor.execute(toExecutorContext(context), {
|
|
22
|
-
prompt,
|
|
23
|
-
command: params.codexCmd,
|
|
24
|
-
env: { ...context.env },
|
|
25
|
-
}, executor.defaultConfig);
|
|
26
|
-
return {
|
|
27
|
-
value,
|
|
28
|
-
outputs: [{ kind: "artifact", path: reviewReplyFile, required: true }],
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
checks(_context, params) {
|
|
32
|
-
return [
|
|
33
|
-
{
|
|
34
|
-
kind: "require-artifacts",
|
|
35
|
-
paths: [artifactFile("review-reply", params.taskKey, params.iteration)],
|
|
36
|
-
message: "Codex review reply did not produce the required review-reply artifact.",
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { printInfo } from "../../tui.js";
|
|
2
|
-
import { toExecutorContext } from "../types.js";
|
|
3
|
-
export const verifyBuildNode = {
|
|
4
|
-
kind: "verify-build",
|
|
5
|
-
version: 1,
|
|
6
|
-
async run(context, params) {
|
|
7
|
-
printInfo(params.labelText);
|
|
8
|
-
const executor = context.executors.get("verify-build");
|
|
9
|
-
const value = await executor.execute(toExecutorContext(context), {
|
|
10
|
-
dockerComposeFile: params.dockerComposeFile,
|
|
11
|
-
...(params.service ? { service: params.service } : {}),
|
|
12
|
-
}, executor.defaultConfig);
|
|
13
|
-
return { value };
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
export function agentweaverHome(packageRoot) {
|
|
5
|
-
const configured = process.env.AGENTWEAVER_HOME?.trim();
|
|
6
|
-
if (configured) {
|
|
7
|
-
return path.resolve(configured);
|
|
8
|
-
}
|
|
9
|
-
return packageRoot;
|
|
10
|
-
}
|
|
11
|
-
export function defaultDockerComposeFile(packageRoot) {
|
|
12
|
-
return path.join(agentweaverHome(packageRoot), "docker-compose.yml");
|
|
13
|
-
}
|
|
14
|
-
function defaultCodexHomeDir(packageRoot) {
|
|
15
|
-
return path.join(agentweaverHome(packageRoot), ".codex-home");
|
|
16
|
-
}
|
|
17
|
-
function ensureRuntimeBindPath(targetPath, isDir) {
|
|
18
|
-
mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
19
|
-
if (isDir) {
|
|
20
|
-
mkdirSync(targetPath, { recursive: true });
|
|
21
|
-
}
|
|
22
|
-
else if (!existsSync(targetPath)) {
|
|
23
|
-
writeFileSync(targetPath, "", "utf8");
|
|
24
|
-
}
|
|
25
|
-
return targetPath;
|
|
26
|
-
}
|
|
27
|
-
function defaultHostSshDir(packageRoot) {
|
|
28
|
-
const candidate = path.join(os.homedir(), ".ssh");
|
|
29
|
-
if (existsSync(candidate)) {
|
|
30
|
-
return candidate;
|
|
31
|
-
}
|
|
32
|
-
return ensureRuntimeBindPath(path.join(agentweaverHome(packageRoot), ".runtime", "ssh"), true);
|
|
33
|
-
}
|
|
34
|
-
function defaultHostGitconfig(packageRoot) {
|
|
35
|
-
const candidate = path.join(os.homedir(), ".gitconfig");
|
|
36
|
-
if (existsSync(candidate)) {
|
|
37
|
-
return candidate;
|
|
38
|
-
}
|
|
39
|
-
return ensureRuntimeBindPath(path.join(agentweaverHome(packageRoot), ".runtime", "gitconfig"), false);
|
|
40
|
-
}
|
|
41
|
-
export function dockerRuntimeEnv(packageRoot) {
|
|
42
|
-
const env = { ...process.env };
|
|
43
|
-
env.AGENTWEAVER_HOME ??= agentweaverHome(packageRoot);
|
|
44
|
-
env.PROJECT_DIR ??= process.cwd();
|
|
45
|
-
env.CODEX_HOME_DIR ??= ensureRuntimeBindPath(defaultCodexHomeDir(packageRoot), true);
|
|
46
|
-
env.HOST_SSH_DIR ??= defaultHostSshDir(packageRoot);
|
|
47
|
-
env.HOST_GITCONFIG ??= defaultHostGitconfig(packageRoot);
|
|
48
|
-
env.LOCAL_UID ??= typeof process.getuid === "function" ? String(process.getuid()) : "1000";
|
|
49
|
-
env.LOCAL_GID ??= typeof process.getgid === "function" ? String(process.getgid()) : "1000";
|
|
50
|
-
return env;
|
|
51
|
-
}
|