@delegance/claude-autopilot 5.2.0 → 5.2.1
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.
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
// src/cli/autoregress-bridge.ts
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
+
import * as fs from 'node:fs';
|
|
3
4
|
import { spawnSync } from 'node:child_process';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { findPackageRoot } from "./_pkg-root.js";
|
|
6
|
+
// Resolve autoregress.ts via the canonical package root walker — works under
|
|
7
|
+
// both source (src/cli/...) and compiled (dist/src/cli/...) layouts. The prior
|
|
8
|
+
// `path.resolve(__dirname, '../../scripts/autoregress.ts')` worked from source
|
|
9
|
+
// but resolved to `dist/scripts/autoregress.ts` under the compiled layout (the
|
|
10
|
+
// shipped scripts/ lives at the package root, not under dist/), so global
|
|
11
|
+
// installs got ERR_MODULE_NOT_FOUND on every `claude-autopilot autoregress`.
|
|
12
|
+
function resolveScript() {
|
|
13
|
+
const root = findPackageRoot(import.meta.url);
|
|
14
|
+
if (root) {
|
|
15
|
+
const p = path.join(root, 'scripts', 'autoregress.ts');
|
|
16
|
+
if (fs.existsSync(p))
|
|
17
|
+
return p;
|
|
18
|
+
}
|
|
19
|
+
// Last-resort fallback for non-standard layouts (linked dev installs, etc.)
|
|
20
|
+
return 'scripts/autoregress.ts';
|
|
21
|
+
}
|
|
7
22
|
const VALID_MODES = ['run', 'update', 'generate', 'diff'];
|
|
8
23
|
export function buildAutoregressArgs(args) {
|
|
9
24
|
const mode = args[0] && VALID_MODES.includes(args[0]) ? args[0] : 'run';
|
|
@@ -12,10 +27,11 @@ export function buildAutoregressArgs(args) {
|
|
|
12
27
|
}
|
|
13
28
|
export function runAutoregress(args) {
|
|
14
29
|
const resolvedArgs = buildAutoregressArgs(args);
|
|
15
|
-
const
|
|
30
|
+
const script = resolveScript();
|
|
31
|
+
const result = spawnSync(process.execPath, ['--import', 'tsx', script, ...resolvedArgs], { stdio: 'inherit', cwd: process.cwd() });
|
|
16
32
|
if (result.error) {
|
|
17
33
|
console.error(`[autoregress] failed to launch: ${result.error.message}`);
|
|
18
|
-
console.error(` script: ${
|
|
34
|
+
console.error(` script: ${script}`);
|
|
19
35
|
return 1;
|
|
20
36
|
}
|
|
21
37
|
return result.status ?? 1;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
// Detects a Python venv next to the project and prepends its bin/ to PATH so
|
|
5
|
+
// commands like `pytest -q` resolve to the venv's binary instead of failing
|
|
6
|
+
// with "command not found" or hitting an unrelated system Python. Surfaced by
|
|
7
|
+
// the 5.0.8 e2e test on randai-johnson — claude-autopilot pr ran the test
|
|
8
|
+
// command from PATH and reported "tests failed" even though the venv-installed
|
|
9
|
+
// pytest passed cleanly.
|
|
10
|
+
function venvAwareEnv(cwd) {
|
|
11
|
+
const root = cwd ?? process.cwd();
|
|
12
|
+
for (const candidate of ['.venv', 'venv', 'env']) {
|
|
13
|
+
const binDir = path.join(root, candidate, 'bin');
|
|
14
|
+
if (fs.existsSync(path.join(binDir, 'python')) || fs.existsSync(path.join(binDir, 'python3'))) {
|
|
15
|
+
return { ...process.env, PATH: `${binDir}${path.delimiter}${process.env.PATH ?? ''}` };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return process.env;
|
|
19
|
+
}
|
|
2
20
|
export async function runTestsPhase(input) {
|
|
3
21
|
const start = Date.now();
|
|
4
22
|
if (!input.testCommand) {
|
|
@@ -13,6 +31,7 @@ export async function runTestsPhase(input) {
|
|
|
13
31
|
timeout: 120000,
|
|
14
32
|
shell: process.env.SHELL ?? "/bin/sh",
|
|
15
33
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
34
|
+
env: venvAwareEnv(input.cwd),
|
|
16
35
|
});
|
|
17
36
|
}
|
|
18
37
|
catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delegance/claude-autopilot",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Autonomous development pipeline for Claude Code: brainstorm → spec → plan → implement → migrate → validate → PR → review → merge. Multi-model, local-first, every phase a skill you can intervene in.",
|
|
6
6
|
"keywords": [
|
|
@@ -22,3 +22,14 @@ chunking:
|
|
|
22
22
|
pipeline:
|
|
23
23
|
runReviewOnStaticFail: true
|
|
24
24
|
runReviewOnTestFail: true
|
|
25
|
+
# Optional: multi-model council. Uncomment + set ANTHROPIC_API_KEY and/or
|
|
26
|
+
# OPENAI_API_KEY. Both APIs supported — chat-completions and Responses API
|
|
27
|
+
# for codex/o-series models (auto-detected by name).
|
|
28
|
+
# Usage: claude-autopilot council --prompt "..." --context-file <path>
|
|
29
|
+
# council:
|
|
30
|
+
# models:
|
|
31
|
+
# - { adapter: claude, model: claude-opus-4-7, label: opus }
|
|
32
|
+
# - { adapter: openai, model: gpt-5.3-codex, label: codex }
|
|
33
|
+
# synthesizer: { adapter: claude, model: claude-sonnet-4-6, label: synth }
|
|
34
|
+
# timeout_ms: 30000
|
|
35
|
+
# min_successful_responses: 1
|