@bamptee/aia-code 0.4.0 → 0.6.0
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/package.json
CHANGED
package/src/constants.js
CHANGED
|
@@ -32,9 +32,14 @@ export const FEATURE_STEPS = [
|
|
|
32
32
|
'tech-spec',
|
|
33
33
|
'challenge',
|
|
34
34
|
'dev-plan',
|
|
35
|
+
'implement',
|
|
35
36
|
'review',
|
|
36
37
|
];
|
|
37
38
|
|
|
39
|
+
export const APPLY_STEPS = new Set([
|
|
40
|
+
'implement',
|
|
41
|
+
]);
|
|
42
|
+
|
|
38
43
|
export const STEP_STATUS = {
|
|
39
44
|
PENDING: 'pending',
|
|
40
45
|
IN_PROGRESS: 'in-progress',
|
|
@@ -8,10 +8,10 @@ export async function generate(prompt, model, { verbose = false, apply = false }
|
|
|
8
8
|
if (apply) {
|
|
9
9
|
args.push('--allowedTools', 'Edit', 'Write', 'Bash', 'Read', 'Glob', 'Grep');
|
|
10
10
|
}
|
|
11
|
-
if (verbose) {
|
|
11
|
+
if (verbose || apply) {
|
|
12
12
|
args.push('--verbose');
|
|
13
13
|
}
|
|
14
14
|
args.push('-');
|
|
15
15
|
|
|
16
|
-
return runCli('claude', args, { stdin: prompt, verbose });
|
|
16
|
+
return runCli('claude', args, { stdin: prompt, verbose: verbose || apply, apply });
|
|
17
17
|
}
|
|
@@ -2,8 +2,12 @@ import { spawn } from 'node:child_process';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
4
|
const DEFAULT_IDLE_TIMEOUT_MS = 180_000;
|
|
5
|
+
const AGENT_IDLE_TIMEOUT_MS = 600_000;
|
|
5
6
|
|
|
6
|
-
export function runCli(command, args, { stdin: stdinData, verbose = false,
|
|
7
|
+
export function runCli(command, args, { stdin: stdinData, verbose = false, apply = false, idleTimeoutMs } = {}) {
|
|
8
|
+
if (!idleTimeoutMs) {
|
|
9
|
+
idleTimeoutMs = apply ? AGENT_IDLE_TIMEOUT_MS : DEFAULT_IDLE_TIMEOUT_MS;
|
|
10
|
+
}
|
|
7
11
|
return new Promise((resolve, reject) => {
|
|
8
12
|
const child = spawn(command, args, {
|
|
9
13
|
stdio: ['pipe', 'pipe', 'pipe'],
|
package/src/providers/gemini.js
CHANGED
package/src/providers/openai.js
CHANGED
|
@@ -6,9 +6,9 @@ export async function generate(prompt, model, { verbose = false, apply = false }
|
|
|
6
6
|
args.push('-c', `model="${model}"`);
|
|
7
7
|
}
|
|
8
8
|
if (apply) {
|
|
9
|
-
args.push('-c', 'approval_policy="
|
|
9
|
+
args.push('-c', 'approval_policy="on-failure"');
|
|
10
10
|
}
|
|
11
11
|
args.push('-');
|
|
12
12
|
|
|
13
|
-
return runCli('codex', args, { stdin: prompt, verbose });
|
|
13
|
+
return runCli('codex', args, { stdin: prompt, verbose: verbose || apply, apply });
|
|
14
14
|
}
|
package/src/services/feature.js
CHANGED
|
@@ -5,13 +5,7 @@ import { AIA_DIR, FEATURE_STEPS } from '../constants.js';
|
|
|
5
5
|
|
|
6
6
|
const FEATURE_FILES = [
|
|
7
7
|
'status.yaml',
|
|
8
|
-
|
|
9
|
-
'ba-spec.md',
|
|
10
|
-
'questions.md',
|
|
11
|
-
'tech-spec.md',
|
|
12
|
-
'challenge.md',
|
|
13
|
-
'dev-plan.md',
|
|
14
|
-
'review.md',
|
|
8
|
+
...FEATURE_STEPS.map((s) => `${s}.md`),
|
|
15
9
|
];
|
|
16
10
|
|
|
17
11
|
const FEATURE_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
package/src/services/runner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { AIA_DIR, FEATURE_STEPS, STEP_STATUS } from '../constants.js';
|
|
4
|
+
import { AIA_DIR, FEATURE_STEPS, APPLY_STEPS, STEP_STATUS } from '../constants.js';
|
|
5
5
|
import { resolveModel } from '../models.js';
|
|
6
6
|
import { buildPrompt } from '../prompt-builder.js';
|
|
7
7
|
import { callModel } from './model-call.js';
|
|
@@ -23,12 +23,14 @@ export async function runStep(step, feature, { description, verbose = false, app
|
|
|
23
23
|
|
|
24
24
|
await updateStepStatus(feature, step, STEP_STATUS.IN_PROGRESS, root);
|
|
25
25
|
|
|
26
|
+
const shouldApply = apply || APPLY_STEPS.has(step);
|
|
27
|
+
|
|
26
28
|
try {
|
|
27
29
|
const model = await resolveModel(step, root);
|
|
28
30
|
const prompt = await buildPrompt(feature, step, { description, root });
|
|
29
31
|
|
|
30
32
|
const start = performance.now();
|
|
31
|
-
const output = await callModel(model, prompt, { verbose, apply });
|
|
33
|
+
const output = await callModel(model, prompt, { verbose, apply: shouldApply });
|
|
32
34
|
const duration = performance.now() - start;
|
|
33
35
|
|
|
34
36
|
const outputPath = path.join(root, AIA_DIR, 'features', feature, `${step}.md`);
|