@delegance/claude-autopilot 1.2.4 → 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 +10 -0
- package/src/core/git/touched-files.ts +24 -2
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -17,6 +17,16 @@ import { runDoctor } from './preflight.ts';
|
|
|
17
17
|
|
|
18
18
|
const args = process.argv.slice(2);
|
|
19
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
|
+
|
|
20
30
|
const SUBCOMMANDS = ['init', 'run', 'watch', 'hook', 'autoregress', 'doctor', 'preflight', 'setup', 'help', '--help', '-h'] as const;
|
|
21
31
|
const VALUE_FLAGS = ['base', 'config', 'files', 'format', 'output', 'debounce'];
|
|
22
32
|
|
|
@@ -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
|
}
|