@delegance/claude-autopilot 1.2.3 → 1.2.5
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 +1 -1
- package/src/cli/index.ts +15 -3
- package/src/cli/preflight.ts +0 -15
- package/src/core/git/touched-files.ts +24 -2
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* autopilot watch re-run pipeline on every file save (debounced)
|
|
11
11
|
* autopilot doctor check prerequisites (alias: preflight)
|
|
12
12
|
*/
|
|
13
|
-
import { runInit } from './init.ts';
|
|
14
13
|
import { runCommand } from './run.ts';
|
|
15
14
|
import { runWatch } from './watch.ts';
|
|
16
15
|
import { runSetup } from './setup.ts';
|
|
@@ -18,6 +17,16 @@ import { runDoctor } from './preflight.ts';
|
|
|
18
17
|
|
|
19
18
|
const args = process.argv.slice(2);
|
|
20
19
|
|
|
20
|
+
// Version flag — resolve from package.json at runtime
|
|
21
|
+
if (args[0] === '--version' || args[0] === '-v') {
|
|
22
|
+
const { createRequire } = await import('node:module');
|
|
23
|
+
const { fileURLToPath } = await import('node:url');
|
|
24
|
+
const require = createRequire(fileURLToPath(import.meta.url));
|
|
25
|
+
const pkg = require('../../package.json') as { version: string };
|
|
26
|
+
console.log(pkg.version);
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
const SUBCOMMANDS = ['init', 'run', 'watch', 'hook', 'autoregress', 'doctor', 'preflight', 'setup', 'help', '--help', '-h'] as const;
|
|
22
31
|
const VALUE_FLAGS = ['base', 'config', 'files', 'format', 'output', 'debounce'];
|
|
23
32
|
|
|
@@ -72,9 +81,12 @@ Options (autoregress):
|
|
|
72
81
|
}
|
|
73
82
|
|
|
74
83
|
switch (subcommand) {
|
|
75
|
-
case 'init':
|
|
76
|
-
|
|
84
|
+
case 'init': {
|
|
85
|
+
console.log('\x1b[33m[init] autopilot init is deprecated — use: npx autopilot setup\x1b[0m\n');
|
|
86
|
+
const force = args.includes('--force');
|
|
87
|
+
await runSetup({ force });
|
|
77
88
|
break;
|
|
89
|
+
}
|
|
78
90
|
|
|
79
91
|
case 'doctor':
|
|
80
92
|
case 'preflight': {
|
package/src/cli/preflight.ts
CHANGED
|
@@ -120,21 +120,6 @@ export async function runDoctor(): Promise<DoctorResult> {
|
|
|
120
120
|
: undefined,
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
// 9. superpowers plugin
|
|
124
|
-
const home = process.env.HOME ?? '';
|
|
125
|
-
const superpowersPaths = [
|
|
126
|
-
path.join(home, '.claude', 'plugins', 'cache', 'claude-plugins-official', 'superpowers'),
|
|
127
|
-
path.join(home, '.claude', 'plugins', 'cache', 'superpowers-marketplace', 'superpowers'),
|
|
128
|
-
path.join(home, '.claude', 'plugins', 'superpowers'),
|
|
129
|
-
];
|
|
130
|
-
const superpowersOk = superpowersPaths.some(p => fs.existsSync(p));
|
|
131
|
-
checks.push({
|
|
132
|
-
name: 'superpowers plugin',
|
|
133
|
-
result: superpowersOk ? 'pass' : 'warn',
|
|
134
|
-
message: !superpowersOk
|
|
135
|
-
? 'superpowers plugin not detected — install: /plugin install superpowers@claude-plugins-official'
|
|
136
|
-
: undefined,
|
|
137
|
-
});
|
|
138
123
|
|
|
139
124
|
// Print results
|
|
140
125
|
console.log('\n\x1b[1m[doctor] Autopilot prerequisite check\x1b[0m\n');
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { runSafe } from '../shell.ts';
|
|
2
2
|
|
|
3
|
+
const IGNORE_PREFIXES = [
|
|
4
|
+
'node_modules/',
|
|
5
|
+
'dist/',
|
|
6
|
+
'build/',
|
|
7
|
+
'.next/',
|
|
8
|
+
'.nuxt/',
|
|
9
|
+
'out/',
|
|
10
|
+
'coverage/',
|
|
11
|
+
'.turbo/',
|
|
12
|
+
'.cache/',
|
|
13
|
+
'vendor/',
|
|
14
|
+
'__pycache__/',
|
|
15
|
+
'.venv/',
|
|
16
|
+
'venv/',
|
|
17
|
+
'target/', // Rust/Java
|
|
18
|
+
'.gradle/',
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
function isIgnored(file: string): boolean {
|
|
22
|
+
return IGNORE_PREFIXES.some(p => file.startsWith(p));
|
|
23
|
+
}
|
|
24
|
+
|
|
3
25
|
export interface TouchedFilesOptions {
|
|
4
26
|
cwd?: string;
|
|
5
27
|
base?: string; // e.g. 'HEAD~1', 'main', a SHA — defaults to HEAD~1
|
|
@@ -30,7 +52,7 @@ export function resolveGitTouchedFiles(options: TouchedFilesOptions = {}): strin
|
|
|
30
52
|
}
|
|
31
53
|
|
|
32
54
|
function parseFileList(output: string): string[] {
|
|
33
|
-
return [...new Set(output.split('\n').map(l => l.trim()).filter(Boolean))];
|
|
55
|
+
return [...new Set(output.split('\n').map(l => l.trim()).filter(Boolean).filter(f => !isIgnored(f)))];
|
|
34
56
|
}
|
|
35
57
|
|
|
36
58
|
function parseStatusOutput(output: string): string[] {
|
|
@@ -47,5 +69,5 @@ function parseStatusOutput(output: string): string[] {
|
|
|
47
69
|
files.add(parts.trim());
|
|
48
70
|
}
|
|
49
71
|
}
|
|
50
|
-
return [...files];
|
|
72
|
+
return [...files].filter(f => !isIgnored(f));
|
|
51
73
|
}
|