agentweaver 0.1.0 → 0.1.3

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 (77) hide show
  1. package/README.md +30 -5
  2. package/dist/artifacts.js +24 -2
  3. package/dist/executors/claude-executor.js +46 -0
  4. package/dist/executors/claude-summary-executor.js +31 -0
  5. package/dist/executors/codex-docker-executor.js +27 -0
  6. package/dist/executors/codex-local-executor.js +25 -0
  7. package/dist/executors/command-check-executor.js +14 -0
  8. package/dist/executors/configs/claude-config.js +12 -0
  9. package/dist/executors/configs/claude-summary-config.js +8 -0
  10. package/dist/executors/configs/codex-docker-config.js +10 -0
  11. package/dist/executors/configs/codex-local-config.js +8 -0
  12. package/dist/executors/configs/jira-fetch-config.js +4 -0
  13. package/dist/executors/configs/process-config.js +3 -0
  14. package/dist/executors/configs/verify-build-config.js +7 -0
  15. package/dist/executors/jira-fetch-executor.js +11 -0
  16. package/dist/executors/process-executor.js +21 -0
  17. package/dist/executors/types.js +1 -0
  18. package/dist/executors/verify-build-executor.js +22 -0
  19. package/dist/index.js +456 -699
  20. package/dist/interactive-ui.js +536 -182
  21. package/dist/jira.js +3 -1
  22. package/dist/pipeline/auto-flow.js +9 -0
  23. package/dist/pipeline/build-failure-summary.js +6 -0
  24. package/dist/pipeline/checks.js +15 -0
  25. package/dist/pipeline/context.js +19 -0
  26. package/dist/pipeline/declarative-flow-runner.js +246 -0
  27. package/dist/pipeline/declarative-flows.js +24 -0
  28. package/dist/pipeline/flow-runner.js +13 -0
  29. package/dist/pipeline/flow-specs/auto.json +471 -0
  30. package/dist/pipeline/flow-specs/implement.json +47 -0
  31. package/dist/pipeline/flow-specs/plan.json +88 -0
  32. package/dist/pipeline/flow-specs/preflight.json +174 -0
  33. package/dist/pipeline/flow-specs/review-fix.json +76 -0
  34. package/dist/pipeline/flow-specs/review.json +233 -0
  35. package/dist/pipeline/flow-specs/test-fix.json +24 -0
  36. package/dist/pipeline/flow-specs/test-linter-fix.json +24 -0
  37. package/dist/pipeline/flow-specs/test.json +19 -0
  38. package/dist/pipeline/flow-types.js +1 -0
  39. package/dist/pipeline/flows/implement-flow.js +47 -0
  40. package/dist/pipeline/flows/plan-flow.js +42 -0
  41. package/dist/pipeline/flows/preflight-flow.js +19 -0
  42. package/dist/pipeline/flows/review-fix-flow.js +62 -0
  43. package/dist/pipeline/flows/review-flow.js +124 -0
  44. package/dist/pipeline/flows/test-fix-flow.js +12 -0
  45. package/dist/pipeline/flows/test-flow.js +32 -0
  46. package/dist/pipeline/node-registry.js +71 -0
  47. package/dist/pipeline/node-runner.js +20 -0
  48. package/dist/pipeline/nodes/build-failure-summary-node.js +71 -0
  49. package/dist/pipeline/nodes/claude-prompt-node.js +54 -0
  50. package/dist/pipeline/nodes/claude-summary-node.js +38 -0
  51. package/dist/pipeline/nodes/codex-docker-prompt-node.js +32 -0
  52. package/dist/pipeline/nodes/codex-local-prompt-node.js +32 -0
  53. package/dist/pipeline/nodes/command-check-node.js +10 -0
  54. package/dist/pipeline/nodes/file-check-node.js +15 -0
  55. package/dist/pipeline/nodes/implement-codex-node.js +16 -0
  56. package/dist/pipeline/nodes/jira-fetch-node.js +25 -0
  57. package/dist/pipeline/nodes/plan-codex-node.js +32 -0
  58. package/dist/pipeline/nodes/review-claude-node.js +38 -0
  59. package/dist/pipeline/nodes/review-reply-codex-node.js +40 -0
  60. package/dist/pipeline/nodes/summary-file-load-node.js +16 -0
  61. package/dist/pipeline/nodes/task-summary-node.js +42 -0
  62. package/dist/pipeline/nodes/verify-build-node.js +14 -0
  63. package/dist/pipeline/prompt-registry.js +22 -0
  64. package/dist/pipeline/prompt-runtime.js +18 -0
  65. package/dist/pipeline/registry.js +23 -0
  66. package/dist/pipeline/spec-compiler.js +200 -0
  67. package/dist/pipeline/spec-loader.js +14 -0
  68. package/dist/pipeline/spec-types.js +1 -0
  69. package/dist/pipeline/spec-validator.js +290 -0
  70. package/dist/pipeline/types.js +10 -0
  71. package/dist/pipeline/value-resolver.js +199 -0
  72. package/dist/prompts.js +1 -3
  73. package/dist/runtime/command-resolution.js +139 -0
  74. package/dist/runtime/docker-runtime.js +51 -0
  75. package/dist/runtime/process-runner.js +112 -0
  76. package/dist/tui.js +73 -0
  77. package/package.json +3 -2
@@ -0,0 +1,174 @@
1
+ {
2
+ "kind": "interactive-preflight-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "preflight",
7
+ "steps": [
8
+ {
9
+ "id": "check_commands",
10
+ "node": "command-check",
11
+ "params": {
12
+ "commands": {
13
+ "const": [
14
+ { "commandName": "codex", "envVarName": "CODEX_BIN" },
15
+ { "commandName": "claude", "envVarName": "CLAUDE_BIN" }
16
+ ]
17
+ }
18
+ }
19
+ },
20
+ {
21
+ "id": "fetch_jira_if_needed",
22
+ "when": {
23
+ "any": [
24
+ { "ref": "params.forceRefresh" },
25
+ {
26
+ "not": {
27
+ "exists": {
28
+ "artifact": {
29
+ "kind": "jira-task-file",
30
+ "taskKey": { "ref": "params.taskKey" }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ ]
36
+ },
37
+ "node": "jira-fetch",
38
+ "params": {
39
+ "jiraApiUrl": { "ref": "params.jiraApiUrl" },
40
+ "outputFile": {
41
+ "artifact": {
42
+ "kind": "jira-task-file",
43
+ "taskKey": { "ref": "params.taskKey" }
44
+ }
45
+ }
46
+ },
47
+ "expect": [
48
+ {
49
+ "kind": "require-file",
50
+ "path": {
51
+ "artifact": {
52
+ "kind": "jira-task-file",
53
+ "taskKey": { "ref": "params.taskKey" }
54
+ }
55
+ },
56
+ "message": "Jira fetch node did not produce the Jira task file."
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "id": "load_existing_task_summary",
62
+ "when": {
63
+ "all": [
64
+ {
65
+ "not": { "ref": "params.forceRefresh" }
66
+ },
67
+ {
68
+ "exists": {
69
+ "artifact": {
70
+ "kind": "jira-task-file",
71
+ "taskKey": { "ref": "params.taskKey" }
72
+ }
73
+ }
74
+ },
75
+ {
76
+ "exists": {
77
+ "artifact": {
78
+ "kind": "task-summary-file",
79
+ "taskKey": { "ref": "params.taskKey" }
80
+ }
81
+ }
82
+ }
83
+ ]
84
+ },
85
+ "node": "summary-file-load",
86
+ "params": {
87
+ "path": {
88
+ "artifact": {
89
+ "kind": "task-summary-file",
90
+ "taskKey": { "ref": "params.taskKey" }
91
+ }
92
+ }
93
+ }
94
+ },
95
+ {
96
+ "id": "generate_task_summary",
97
+ "when": {
98
+ "any": [
99
+ { "ref": "params.forceRefresh" },
100
+ {
101
+ "not": {
102
+ "exists": {
103
+ "artifact": {
104
+ "kind": "task-summary-file",
105
+ "taskKey": { "ref": "params.taskKey" }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ ]
111
+ },
112
+ "node": "claude-prompt",
113
+ "prompt": {
114
+ "templateRef": "task-summary",
115
+ "vars": {
116
+ "jira_task_file": {
117
+ "artifact": {
118
+ "kind": "jira-task-file",
119
+ "taskKey": { "ref": "params.taskKey" }
120
+ }
121
+ },
122
+ "task_summary_file": {
123
+ "artifact": {
124
+ "kind": "task-summary-file",
125
+ "taskKey": { "ref": "params.taskKey" }
126
+ }
127
+ }
128
+ },
129
+ "format": "plain"
130
+ },
131
+ "params": {
132
+ "labelText": { "const": "Preparing task summary" },
133
+ "outputFile": {
134
+ "artifact": {
135
+ "kind": "task-summary-file",
136
+ "taskKey": { "ref": "params.taskKey" }
137
+ }
138
+ },
139
+ "model": { "const": "haiku" }
140
+ },
141
+ "expect": [
142
+ {
143
+ "kind": "require-artifacts",
144
+ "when": { "not": { "ref": "context.dryRun" } },
145
+ "paths": {
146
+ "list": [
147
+ {
148
+ "artifact": {
149
+ "kind": "task-summary-file",
150
+ "taskKey": { "ref": "params.taskKey" }
151
+ }
152
+ }
153
+ ]
154
+ },
155
+ "message": "Claude summary did not produce the task summary artifact."
156
+ }
157
+ ],
158
+ "after": [
159
+ {
160
+ "kind": "set-summary-from-file",
161
+ "when": { "not": { "ref": "context.dryRun" } },
162
+ "path": {
163
+ "artifact": {
164
+ "kind": "task-summary-file",
165
+ "taskKey": { "ref": "params.taskKey" }
166
+ }
167
+ }
168
+ }
169
+ ]
170
+ }
171
+ ]
172
+ }
173
+ ]
174
+ }
@@ -0,0 +1,76 @@
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": "run_codex_review_fix",
13
+ "node": "codex-local-prompt",
14
+ "prompt": {
15
+ "templateRef": "review-fix",
16
+ "vars": {
17
+ "review_reply_file": {
18
+ "artifact": {
19
+ "kind": "review-reply-file",
20
+ "taskKey": { "ref": "params.taskKey" },
21
+ "iteration": { "ref": "params.latestIteration" }
22
+ }
23
+ },
24
+ "items": { "ref": "params.reviewFixPoints" },
25
+ "review_fix_file": {
26
+ "artifact": {
27
+ "kind": "review-fix-file",
28
+ "taskKey": { "ref": "params.taskKey" },
29
+ "iteration": { "ref": "params.latestIteration" }
30
+ }
31
+ }
32
+ },
33
+ "extraPrompt": { "ref": "params.extraPrompt" },
34
+ "format": "task-prompt"
35
+ },
36
+ "params": {
37
+ "labelText": {
38
+ "template": "Running Codex review-fix mode locally (iteration {iteration})",
39
+ "vars": {
40
+ "iteration": { "ref": "params.latestIteration" }
41
+ }
42
+ },
43
+ "model": { "const": "gpt-5.4" }
44
+ },
45
+ "expect": [
46
+ {
47
+ "kind": "require-artifacts",
48
+ "when": { "not": { "ref": "context.dryRun" } },
49
+ "paths": {
50
+ "list": [
51
+ {
52
+ "artifact": {
53
+ "kind": "review-fix-file",
54
+ "taskKey": { "ref": "params.taskKey" },
55
+ "iteration": { "ref": "params.latestIteration" }
56
+ }
57
+ }
58
+ ]
59
+ },
60
+ "message": "Review-fix mode did not produce the required review-fix artifact."
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "id": "verify_build_after_review_fix",
66
+ "when": { "ref": "params.runFollowupVerify" },
67
+ "node": "verify-build",
68
+ "params": {
69
+ "dockerComposeFile": { "ref": "params.dockerComposeFile" },
70
+ "labelText": { "const": "Running build verification in isolated Docker" }
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ }
@@ -0,0 +1,233 @@
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
+ "plan_file": {
27
+ "artifact": {
28
+ "kind": "plan-file",
29
+ "taskKey": { "ref": "params.taskKey" }
30
+ }
31
+ },
32
+ "review_file": {
33
+ "artifact": {
34
+ "kind": "review-file",
35
+ "taskKey": { "ref": "params.taskKey" },
36
+ "iteration": { "ref": "params.iteration" }
37
+ }
38
+ }
39
+ },
40
+ "extraPrompt": { "ref": "params.extraPrompt" },
41
+ "format": "task-prompt"
42
+ },
43
+ "params": {
44
+ "labelText": {
45
+ "template": "Running Claude review mode (iteration {iteration})",
46
+ "vars": {
47
+ "iteration": { "ref": "params.iteration" }
48
+ }
49
+ },
50
+ "model": { "const": "opus" }
51
+ },
52
+ "expect": [
53
+ {
54
+ "kind": "require-artifacts",
55
+ "when": { "not": { "ref": "context.dryRun" } },
56
+ "paths": {
57
+ "list": [
58
+ {
59
+ "artifact": {
60
+ "kind": "review-file",
61
+ "taskKey": { "ref": "params.taskKey" },
62
+ "iteration": { "ref": "params.iteration" }
63
+ }
64
+ }
65
+ ]
66
+ },
67
+ "message": "Claude review did not produce the required review artifact."
68
+ }
69
+ ]
70
+ },
71
+ {
72
+ "id": "summarize_review",
73
+ "when": { "not": { "ref": "context.dryRun" } },
74
+ "node": "claude-prompt",
75
+ "prompt": {
76
+ "templateRef": "review-summary",
77
+ "vars": {
78
+ "review_file": {
79
+ "artifact": {
80
+ "kind": "review-file",
81
+ "taskKey": { "ref": "params.taskKey" },
82
+ "iteration": { "ref": "params.iteration" }
83
+ }
84
+ },
85
+ "review_summary_file": {
86
+ "artifact": {
87
+ "kind": "review-summary-file",
88
+ "taskKey": { "ref": "params.taskKey" },
89
+ "iteration": { "ref": "params.iteration" }
90
+ }
91
+ }
92
+ },
93
+ "format": "plain"
94
+ },
95
+ "params": {
96
+ "labelText": { "const": "Preparing Claude review summary" },
97
+ "summaryTitle": { "const": "Claude Comments" },
98
+ "model": { "const": "haiku" },
99
+ "outputFile": {
100
+ "artifact": {
101
+ "kind": "review-summary-file",
102
+ "taskKey": { "ref": "params.taskKey" },
103
+ "iteration": { "ref": "params.iteration" }
104
+ }
105
+ }
106
+ }
107
+ },
108
+ {
109
+ "id": "run_codex_review_reply",
110
+ "node": "codex-local-prompt",
111
+ "prompt": {
112
+ "templateRef": "review-reply",
113
+ "vars": {
114
+ "review_file": {
115
+ "artifact": {
116
+ "kind": "review-file",
117
+ "taskKey": { "ref": "params.taskKey" },
118
+ "iteration": { "ref": "params.iteration" }
119
+ }
120
+ },
121
+ "jira_task_file": {
122
+ "artifact": {
123
+ "kind": "jira-task-file",
124
+ "taskKey": { "ref": "params.taskKey" }
125
+ }
126
+ },
127
+ "design_file": {
128
+ "artifact": {
129
+ "kind": "design-file",
130
+ "taskKey": { "ref": "params.taskKey" }
131
+ }
132
+ },
133
+ "plan_file": {
134
+ "artifact": {
135
+ "kind": "plan-file",
136
+ "taskKey": { "ref": "params.taskKey" }
137
+ }
138
+ },
139
+ "review_reply_file": {
140
+ "artifact": {
141
+ "kind": "review-reply-file",
142
+ "taskKey": { "ref": "params.taskKey" },
143
+ "iteration": { "ref": "params.iteration" }
144
+ }
145
+ }
146
+ },
147
+ "extraPrompt": { "ref": "params.extraPrompt" },
148
+ "format": "task-prompt"
149
+ },
150
+ "params": {
151
+ "labelText": {
152
+ "template": "Running Codex review reply mode (iteration {iteration})",
153
+ "vars": {
154
+ "iteration": { "ref": "params.iteration" }
155
+ }
156
+ },
157
+ "model": { "const": "gpt-5.4" }
158
+ },
159
+ "expect": [
160
+ {
161
+ "kind": "require-artifacts",
162
+ "when": { "not": { "ref": "context.dryRun" } },
163
+ "paths": {
164
+ "list": [
165
+ {
166
+ "artifact": {
167
+ "kind": "review-reply-file",
168
+ "taskKey": { "ref": "params.taskKey" },
169
+ "iteration": { "ref": "params.iteration" }
170
+ }
171
+ }
172
+ ]
173
+ },
174
+ "message": "Codex review reply did not produce the required review-reply artifact."
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "id": "summarize_review_reply",
180
+ "when": { "not": { "ref": "context.dryRun" } },
181
+ "node": "claude-prompt",
182
+ "prompt": {
183
+ "templateRef": "review-reply-summary",
184
+ "vars": {
185
+ "review_reply_file": {
186
+ "artifact": {
187
+ "kind": "review-reply-file",
188
+ "taskKey": { "ref": "params.taskKey" },
189
+ "iteration": { "ref": "params.iteration" }
190
+ }
191
+ },
192
+ "review_reply_summary_file": {
193
+ "artifact": {
194
+ "kind": "review-reply-summary-file",
195
+ "taskKey": { "ref": "params.taskKey" },
196
+ "iteration": { "ref": "params.iteration" }
197
+ }
198
+ }
199
+ },
200
+ "format": "plain"
201
+ },
202
+ "params": {
203
+ "labelText": { "const": "Preparing Codex reply summary" },
204
+ "summaryTitle": { "const": "Codex Reply Summary" },
205
+ "model": { "const": "haiku" },
206
+ "outputFile": {
207
+ "artifact": {
208
+ "kind": "review-reply-summary-file",
209
+ "taskKey": { "ref": "params.taskKey" },
210
+ "iteration": { "ref": "params.iteration" }
211
+ }
212
+ }
213
+ }
214
+ },
215
+ {
216
+ "id": "check_ready_to_merge",
217
+ "node": "file-check",
218
+ "params": {
219
+ "path": {
220
+ "artifact": {
221
+ "kind": "ready-to-merge-file",
222
+ "taskKey": { "ref": "params.taskKey" }
223
+ }
224
+ },
225
+ "panelTitle": { "const": "Ready To Merge" },
226
+ "foundMessage": { "const": "Изменения готовы к merge\nФайл ready-to-merge.md создан." },
227
+ "tone": { "const": "green" }
228
+ }
229
+ }
230
+ ]
231
+ }
232
+ ]
233
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "kind": "test-fix-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "test-fix",
7
+ "steps": [
8
+ {
9
+ "id": "run_codex_test_fix",
10
+ "node": "codex-local-prompt",
11
+ "prompt": {
12
+ "templateRef": "test-fix",
13
+ "extraPrompt": { "ref": "params.extraPrompt" },
14
+ "format": "task-prompt"
15
+ },
16
+ "params": {
17
+ "labelText": { "const": "Running Codex test-fix mode locally" },
18
+ "model": { "const": "gpt-5.4" }
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "kind": "test-linter-fix-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "test-linter-fix",
7
+ "steps": [
8
+ {
9
+ "id": "run_codex_test_linter_fix",
10
+ "node": "codex-local-prompt",
11
+ "prompt": {
12
+ "templateRef": "test-linter-fix",
13
+ "extraPrompt": { "ref": "params.extraPrompt" },
14
+ "format": "task-prompt"
15
+ },
16
+ "params": {
17
+ "labelText": { "const": "Running Codex test-linter-fix mode locally" },
18
+ "model": { "const": "gpt-5.4" }
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "kind": "test-flow",
3
+ "version": 1,
4
+ "phases": [
5
+ {
6
+ "id": "test",
7
+ "steps": [
8
+ {
9
+ "id": "verify_build",
10
+ "node": "verify-build",
11
+ "params": {
12
+ "dockerComposeFile": { "ref": "params.dockerComposeFile" },
13
+ "labelText": { "const": "Running build verification in isolated Docker" }
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ import { runFlow } from "../flow-runner.js";
2
+ import { runNode } from "../node-runner.js";
3
+ import { codexLocalPromptNode } from "../nodes/codex-local-prompt-node.js";
4
+ import { verifyBuildNode } from "../nodes/verify-build-node.js";
5
+ export const implementFlowDefinition = {
6
+ kind: "implement-flow",
7
+ version: 1,
8
+ steps: [
9
+ {
10
+ id: "run_codex_implement",
11
+ async run(context, params) {
12
+ await runNode(codexLocalPromptNode, context, {
13
+ prompt: params.prompt,
14
+ labelText: "Running Codex implementation mode locally",
15
+ });
16
+ return { completed: true };
17
+ },
18
+ },
19
+ {
20
+ id: "verify_build_after_implement",
21
+ async run(context, params) {
22
+ if (!params.runFollowupVerify) {
23
+ return {
24
+ completed: true,
25
+ metadata: { skipped: true },
26
+ };
27
+ }
28
+ try {
29
+ await runNode(verifyBuildNode, context, {
30
+ dockerComposeFile: params.dockerComposeFile,
31
+ labelText: "Running build verification in isolated Docker",
32
+ });
33
+ }
34
+ catch (error) {
35
+ if (params.onVerifyBuildFailure) {
36
+ await params.onVerifyBuildFailure(String(error.output ?? ""));
37
+ }
38
+ throw error;
39
+ }
40
+ return { completed: true };
41
+ },
42
+ },
43
+ ],
44
+ };
45
+ export async function runImplementFlow(context, params) {
46
+ await runFlow(implementFlowDefinition, context, params);
47
+ }
@@ -0,0 +1,42 @@
1
+ import { designFile, planArtifacts, planFile, qaFile } from "../../artifacts.js";
2
+ import { PLAN_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
3
+ import { runFlow } from "../flow-runner.js";
4
+ import { runNode } from "../node-runner.js";
5
+ import { jiraFetchNode } from "../nodes/jira-fetch-node.js";
6
+ import { planCodexNode } from "../nodes/plan-codex-node.js";
7
+ export const planFlowDefinition = {
8
+ kind: "plan-flow",
9
+ version: 1,
10
+ steps: [
11
+ {
12
+ id: "fetch_jira",
13
+ async run(context, params) {
14
+ await runNode(jiraFetchNode, context, {
15
+ jiraApiUrl: params.jiraApiUrl,
16
+ outputFile: params.jiraTaskFile,
17
+ });
18
+ return { completed: true };
19
+ },
20
+ },
21
+ {
22
+ id: "run_codex_plan",
23
+ async run(context, params) {
24
+ const prompt = formatPrompt(formatTemplate(PLAN_PROMPT_TEMPLATE, {
25
+ jira_task_file: params.jiraTaskFile,
26
+ design_file: designFile(params.taskKey),
27
+ plan_file: planFile(params.taskKey),
28
+ qa_file: qaFile(params.taskKey),
29
+ }), params.extraPrompt);
30
+ await runNode(planCodexNode, context, {
31
+ prompt,
32
+ command: params.codexCmd,
33
+ requiredArtifacts: planArtifacts(params.taskKey),
34
+ });
35
+ return { completed: true };
36
+ },
37
+ },
38
+ ],
39
+ };
40
+ export async function runPlanFlow(context, params) {
41
+ await runFlow(planFlowDefinition, context, params);
42
+ }
@@ -0,0 +1,19 @@
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
+ }