vralphy 0.6.0 → 0.6.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.
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +47 -16
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +77 -12
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +47 -16
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/spec.d.ts +3 -0
- package/dist/commands/spec.d.ts.map +1 -1
- package/dist/commands/spec.js +76 -15
- package/dist/commands/spec.js.map +1 -1
- package/dist/index.js +72 -20
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +23 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +63 -4
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/config.test.js +2 -2
- package/dist/lib/config.test.js.map +1 -1
- package/dist/lib/engines/base.d.ts +57 -8
- package/dist/lib/engines/base.d.ts.map +1 -1
- package/dist/lib/engines/base.js +58 -5
- package/dist/lib/engines/base.js.map +1 -1
- package/dist/lib/engines/claude.d.ts +5 -2
- package/dist/lib/engines/claude.d.ts.map +1 -1
- package/dist/lib/engines/claude.js +58 -12
- package/dist/lib/engines/claude.js.map +1 -1
- package/dist/lib/engines/codex.d.ts +5 -2
- package/dist/lib/engines/codex.d.ts.map +1 -1
- package/dist/lib/engines/codex.js +58 -12
- package/dist/lib/engines/codex.js.map +1 -1
- package/dist/lib/engines/index.d.ts +11 -1
- package/dist/lib/engines/index.d.ts.map +1 -1
- package/dist/lib/engines/index.js +16 -0
- package/dist/lib/engines/index.js.map +1 -1
- package/dist/lib/engines/opencode.d.ts +5 -2
- package/dist/lib/engines/opencode.d.ts.map +1 -1
- package/dist/lib/engines/opencode.js +49 -11
- package/dist/lib/engines/opencode.js.map +1 -1
- package/dist/lib/init.d.ts +17 -1
- package/dist/lib/init.d.ts.map +1 -1
- package/dist/lib/init.js +242 -55
- package/dist/lib/init.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,38 +10,46 @@ import { specCommand } from './commands/spec.js';
|
|
|
10
10
|
import { initCommand } from './commands/init.js';
|
|
11
11
|
import { cleanupCommand } from './commands/cleanup.js';
|
|
12
12
|
import { detectEngines } from './lib/engines/index.js';
|
|
13
|
+
import { listSkills } from './lib/skills.js';
|
|
14
|
+
import { listAgents } from './lib/agents.js';
|
|
15
|
+
import { getSkillsDir, getAgentsDir } from './lib/config.js';
|
|
13
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
17
|
const __dirname = dirname(__filename);
|
|
15
18
|
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
16
19
|
const program = new Command();
|
|
17
20
|
program
|
|
18
21
|
.name('vralphy')
|
|
19
|
-
.description('
|
|
22
|
+
.description('CLI tool implementing the Ralph Playbook methodology')
|
|
20
23
|
.version(packageJson.version);
|
|
21
24
|
program
|
|
22
|
-
.option('--engine <engine>', 'Engine
|
|
23
|
-
.option('--model <model>', '
|
|
24
|
-
.option('--
|
|
25
|
-
.option('--
|
|
25
|
+
.option('--engine <engine>', 'Engine selection (claude|opencode|codex)')
|
|
26
|
+
.option('--model <model>', 'Primary model (default: opus)')
|
|
27
|
+
.option('--executor <model>', 'Executor/subagent model (default: sonnet)')
|
|
28
|
+
.option('--skills <path>', 'Skills directory')
|
|
29
|
+
.option('--agents <path>', 'Agents directory')
|
|
30
|
+
.option('--config <path>', 'Config file (default: vralphy.config.json)')
|
|
31
|
+
.option('--reasoning-effort <level>', 'Reasoning effort level (e.g., high, xhigh)')
|
|
32
|
+
.option('--verbose', 'Verbose output', false)
|
|
33
|
+
.option('--dry-run', 'Show what would execute without running', false);
|
|
26
34
|
program
|
|
27
|
-
.command('
|
|
28
|
-
.description('Run
|
|
35
|
+
.command('build [iterations]')
|
|
36
|
+
.description('Run build mode (default command)')
|
|
29
37
|
.action(async (iterations) => {
|
|
30
38
|
const opts = program.opts();
|
|
31
39
|
const config = await resolveConfig(opts);
|
|
32
|
-
await
|
|
40
|
+
await buildCommand(config, { iterations: iterations ? parseInt(iterations, 10) : undefined });
|
|
33
41
|
});
|
|
34
42
|
program
|
|
35
|
-
.command('
|
|
36
|
-
.description('Run
|
|
43
|
+
.command('plan [iterations]')
|
|
44
|
+
.description('Run plan mode')
|
|
37
45
|
.action(async (iterations) => {
|
|
38
46
|
const opts = program.opts();
|
|
39
47
|
const config = await resolveConfig(opts);
|
|
40
|
-
await
|
|
48
|
+
await planCommand(config, { iterations: iterations ? parseInt(iterations, 10) : undefined });
|
|
41
49
|
});
|
|
42
50
|
program
|
|
43
51
|
.command('spec [topic]')
|
|
44
|
-
.description('
|
|
52
|
+
.description('Interactive spec creation')
|
|
45
53
|
.action(async (topic) => {
|
|
46
54
|
const opts = program.opts();
|
|
47
55
|
const config = await resolveConfig(opts);
|
|
@@ -49,16 +57,23 @@ program
|
|
|
49
57
|
});
|
|
50
58
|
program
|
|
51
59
|
.command('init')
|
|
52
|
-
.description('Initialize project')
|
|
53
|
-
.option('--from <path>', 'Initialize from
|
|
60
|
+
.description('Initialize project for vralphy')
|
|
61
|
+
.option('--from <path>', 'Initialize from existing project')
|
|
62
|
+
.option('--no-ai', 'Skip AI generation, use template fallback')
|
|
63
|
+
.option('--approve', 'Review AGENTS.md before saving')
|
|
64
|
+
.option('--engine <engine>', 'Specify engine for AI generation (claude|opencode|codex)')
|
|
54
65
|
.action(async (cmdOpts) => {
|
|
55
|
-
|
|
66
|
+
const globalOpts = program.opts();
|
|
67
|
+
// Commander parses --no-ai as ai: false, so we convert to noAi: true
|
|
68
|
+
const noAi = cmdOpts.ai === false;
|
|
69
|
+
await initCommand({ ...cmdOpts, noAi, verbose: globalOpts.verbose });
|
|
56
70
|
});
|
|
57
71
|
program
|
|
58
72
|
.command('cleanup')
|
|
59
73
|
.description('Remove vralphy from project')
|
|
60
|
-
.option('--from <path>', 'Clean up from
|
|
61
|
-
.option('--
|
|
74
|
+
.option('--from <path>', 'Clean up from existing project')
|
|
75
|
+
.option('--remove-specs', 'Also remove specs/ directory')
|
|
76
|
+
.option('--force', 'Skip confirmation prompt')
|
|
62
77
|
.action(async (cmdOpts) => {
|
|
63
78
|
await cleanupCommand(cmdOpts);
|
|
64
79
|
});
|
|
@@ -72,11 +87,48 @@ program
|
|
|
72
87
|
console.log(` - ${engine}`);
|
|
73
88
|
}
|
|
74
89
|
if (available.length === 0) {
|
|
75
|
-
console.log(' (none - install claude
|
|
90
|
+
console.log(' (none found - install claude or opencode CLI)');
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
program
|
|
94
|
+
.command('skills')
|
|
95
|
+
.description('List available skills')
|
|
96
|
+
.action(async () => {
|
|
97
|
+
const opts = program.opts();
|
|
98
|
+
const config = await resolveConfig(opts);
|
|
99
|
+
const skillsDir = getSkillsDir(config.engine, config.skillsDir);
|
|
100
|
+
const skills = await listSkills(skillsDir);
|
|
101
|
+
if (skills.length === 0) {
|
|
102
|
+
console.log(`No skills found in: ${skillsDir}`);
|
|
103
|
+
console.log('Create .md files with frontmatter to add skills.');
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
console.log('Available skills:');
|
|
107
|
+
for (const skill of skills) {
|
|
108
|
+
console.log(` - ${skill.name}${skill.description ? `: ${skill.description}` : ''}`);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
program
|
|
112
|
+
.command('agents')
|
|
113
|
+
.description('List available agents')
|
|
114
|
+
.action(async () => {
|
|
115
|
+
const opts = program.opts();
|
|
116
|
+
const config = await resolveConfig(opts);
|
|
117
|
+
const agentsDir = getAgentsDir(config.engine, config.agentsDir);
|
|
118
|
+
const agents = await listAgents(agentsDir);
|
|
119
|
+
if (agents.length === 0) {
|
|
120
|
+
console.log(`No agents found in: ${agentsDir}`);
|
|
121
|
+
console.log('Create .md files with frontmatter to add agents.');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
console.log('Available agents:');
|
|
125
|
+
for (const agent of agents) {
|
|
126
|
+
const model = agent.model ? ` (${agent.model})` : '';
|
|
127
|
+
console.log(` - ${agent.name}${model}${agent.description ? `: ${agent.description}` : ''}`);
|
|
76
128
|
}
|
|
77
129
|
});
|
|
78
|
-
|
|
79
|
-
|
|
130
|
+
program
|
|
131
|
+
.action(async () => {
|
|
80
132
|
const opts = program.opts();
|
|
81
133
|
const config = await resolveConfig(opts);
|
|
82
134
|
await buildCommand(config, {});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAiB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI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AC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -2,16 +2,39 @@ import { EngineName } from './engines/index.js';
|
|
|
2
2
|
export interface VralphyConfig {
|
|
3
3
|
engine: EngineName;
|
|
4
4
|
model: string;
|
|
5
|
+
executor: string;
|
|
6
|
+
skillsDir: string;
|
|
7
|
+
agentsDir: string;
|
|
5
8
|
verbose: boolean;
|
|
6
9
|
dryRun: boolean;
|
|
10
|
+
reasoningEffort?: string;
|
|
7
11
|
}
|
|
8
12
|
export interface ConfigOptions {
|
|
9
13
|
engine?: string;
|
|
10
14
|
model?: string;
|
|
15
|
+
executor?: string;
|
|
16
|
+
skills?: string;
|
|
17
|
+
agents?: string;
|
|
11
18
|
config?: string;
|
|
19
|
+
reasoningEffort?: string;
|
|
12
20
|
verbose?: boolean;
|
|
13
21
|
dryRun?: boolean;
|
|
14
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve configuration from multiple sources
|
|
25
|
+
* Priority: CLI flags > env vars > config file > defaults
|
|
26
|
+
*/
|
|
15
27
|
export declare function resolveConfig(cliOptions: ConfigOptions): Promise<VralphyConfig>;
|
|
28
|
+
/**
|
|
29
|
+
* Determine skills directory based on engine
|
|
30
|
+
*/
|
|
31
|
+
export declare function getSkillsDir(engine: EngineName, customPath?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Determine agents directory based on engine
|
|
34
|
+
*/
|
|
35
|
+
export declare function getAgentsDir(engine: EngineName, customPath?: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Find project root by looking for common markers
|
|
38
|
+
*/
|
|
16
39
|
export declare function findProjectRoot(startDir?: string): string;
|
|
17
40
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA6BD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAmBrF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAe5E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAe5E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAgBxE"}
|
package/dist/lib/config.js
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { readFile } from 'fs/promises';
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
|
+
import { validateModelForEngine } from './engines/base.js';
|
|
4
5
|
const DEFAULT_CONFIG = {
|
|
5
6
|
engine: 'claude',
|
|
6
|
-
model: '
|
|
7
|
+
model: 'opus',
|
|
8
|
+
executor: 'sonnet',
|
|
9
|
+
skillsDir: '.claude/skills',
|
|
10
|
+
agentsDir: 'agents',
|
|
7
11
|
verbose: false,
|
|
8
12
|
dryRun: false,
|
|
13
|
+
reasoningEffort: undefined,
|
|
9
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Load config from file if it exists
|
|
17
|
+
*/
|
|
10
18
|
async function loadConfigFile(path) {
|
|
11
|
-
if (!existsSync(path))
|
|
19
|
+
if (!existsSync(path)) {
|
|
12
20
|
return {};
|
|
21
|
+
}
|
|
13
22
|
try {
|
|
14
23
|
const content = await readFile(path, 'utf-8');
|
|
15
24
|
return JSON.parse(content);
|
|
@@ -18,20 +27,70 @@ async function loadConfigFile(path) {
|
|
|
18
27
|
return {};
|
|
19
28
|
}
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve configuration from multiple sources
|
|
32
|
+
* Priority: CLI flags > env vars > config file > defaults
|
|
33
|
+
*/
|
|
21
34
|
export async function resolveConfig(cliOptions) {
|
|
22
35
|
const configPath = cliOptions.config ?? 'vralphy.config.json';
|
|
23
36
|
const fileConfig = await loadConfigFile(configPath);
|
|
24
|
-
|
|
37
|
+
const config = {
|
|
25
38
|
engine: (cliOptions.engine ?? process.env.VRALPHY_ENGINE ?? fileConfig.engine ?? DEFAULT_CONFIG.engine),
|
|
26
39
|
model: cliOptions.model ?? process.env.VRALPHY_MODEL ?? fileConfig.model ?? DEFAULT_CONFIG.model,
|
|
40
|
+
executor: cliOptions.executor ?? process.env.VRALPHY_EXECUTOR ?? fileConfig.executor ?? DEFAULT_CONFIG.executor,
|
|
41
|
+
skillsDir: cliOptions.skills ?? fileConfig.skillsDir ?? DEFAULT_CONFIG.skillsDir,
|
|
42
|
+
agentsDir: cliOptions.agents ?? fileConfig.agentsDir ?? DEFAULT_CONFIG.agentsDir,
|
|
27
43
|
verbose: cliOptions.verbose ?? fileConfig.verbose ?? DEFAULT_CONFIG.verbose,
|
|
28
44
|
dryRun: cliOptions.dryRun ?? fileConfig.dryRun ?? DEFAULT_CONFIG.dryRun,
|
|
45
|
+
reasoningEffort: cliOptions.reasoningEffort ?? process.env.VRALPHY_REASONING_EFFORT ?? fileConfig.reasoningEffort ?? DEFAULT_CONFIG.reasoningEffort,
|
|
46
|
+
};
|
|
47
|
+
// Validate model is compatible with engine
|
|
48
|
+
validateModelForEngine(config.model, config.engine);
|
|
49
|
+
return config;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Determine skills directory based on engine
|
|
53
|
+
*/
|
|
54
|
+
export function getSkillsDir(engine, customPath) {
|
|
55
|
+
if (customPath)
|
|
56
|
+
return customPath;
|
|
57
|
+
const engineDirs = {
|
|
58
|
+
claude: '.claude/skills',
|
|
59
|
+
opencode: '.opencode/skills',
|
|
60
|
+
codex: '.codex/skills',
|
|
61
|
+
};
|
|
62
|
+
const engineDir = engineDirs[engine];
|
|
63
|
+
if (existsSync(engineDir))
|
|
64
|
+
return engineDir;
|
|
65
|
+
if (existsSync('skills'))
|
|
66
|
+
return 'skills';
|
|
67
|
+
return engineDir;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Determine agents directory based on engine
|
|
71
|
+
*/
|
|
72
|
+
export function getAgentsDir(engine, customPath) {
|
|
73
|
+
if (customPath)
|
|
74
|
+
return customPath;
|
|
75
|
+
const engineDirs = {
|
|
76
|
+
claude: '.claude/agents',
|
|
77
|
+
opencode: '.opencode/agents',
|
|
78
|
+
codex: '.codex/agents',
|
|
29
79
|
};
|
|
80
|
+
const engineDir = engineDirs[engine];
|
|
81
|
+
if (existsSync(engineDir))
|
|
82
|
+
return engineDir;
|
|
83
|
+
if (existsSync('agents'))
|
|
84
|
+
return 'agents';
|
|
85
|
+
return engineDir;
|
|
30
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Find project root by looking for common markers
|
|
89
|
+
*/
|
|
31
90
|
export function findProjectRoot(startDir = process.cwd()) {
|
|
32
91
|
let dir = startDir;
|
|
33
92
|
while (dir !== '/') {
|
|
34
|
-
const markers = ['package.json', 'Cargo.toml', 'go.mod', '.git'];
|
|
93
|
+
const markers = ['package.json', 'Cargo.toml', 'go.mod', '.git', 'AGENTS.md'];
|
|
35
94
|
for (const marker of markers) {
|
|
36
95
|
if (existsSync(join(dir, marker))) {
|
|
37
96
|
return dir;
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAyB3D,MAAM,cAAc,GAAkB;IACpC,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,eAAe,EAAE,SAA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AAM,UAAU,eAAe,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAC9D,IAAI,GAAG,GAAG,QAAQ,CAAC;IAEnB,OAAO,GAAG,KAAK,GAAG,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,CAAC,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAE9E,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;gBAClC,OAAO,GAAG,CAAC;YACb,CAAC;QACH,CAAC;QAED,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/lib/config.test.js
CHANGED
|
@@ -12,11 +12,11 @@ describe('resolveConfig', () => {
|
|
|
12
12
|
it('respects CLI options over defaults', async () => {
|
|
13
13
|
const config = await resolveConfig({
|
|
14
14
|
engine: 'opencode',
|
|
15
|
-
model: '
|
|
15
|
+
model: 'gpt-4o',
|
|
16
16
|
verbose: true,
|
|
17
17
|
});
|
|
18
18
|
expect(config.engine).toBe('opencode');
|
|
19
|
-
expect(config.model).toBe('
|
|
19
|
+
expect(config.model).toBe('gpt-4o');
|
|
20
20
|
expect(config.verbose).toBe(true);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.test.js","sourceRoot":"","sources":["../../src/lib/config.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,iDAAiD,EAAE,KAAK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AAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Base engine interface that all engines must implement
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export interface ExecuteOptions {
|
|
5
|
+
model: string;
|
|
6
|
+
executor: string;
|
|
7
|
+
headless: boolean;
|
|
8
|
+
skipPermissions: boolean;
|
|
9
|
+
verbose: boolean;
|
|
10
|
+
skills?: string[];
|
|
11
|
+
agents?: string[];
|
|
12
|
+
reasoningEffort?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Chunk {
|
|
15
|
+
type: 'text' | 'tool_use' | 'error' | 'done';
|
|
16
|
+
content?: string;
|
|
17
|
+
tool?: string;
|
|
18
|
+
error?: string;
|
|
8
19
|
}
|
|
9
|
-
export interface
|
|
20
|
+
export interface EngineFlags {
|
|
10
21
|
model?: string;
|
|
11
22
|
skipPermissions?: boolean;
|
|
23
|
+
verbose?: boolean;
|
|
24
|
+
reasoningEffort?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Engine {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Execute prompt with streaming output
|
|
30
|
+
*/
|
|
31
|
+
execute(prompt: string, options: ExecuteOptions): AsyncIterable<Chunk>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if engine CLI is available
|
|
34
|
+
*/
|
|
35
|
+
isAvailable(): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Get engine-specific CLI flags
|
|
38
|
+
*/
|
|
39
|
+
getFlags(options: EngineFlags): string[];
|
|
40
|
+
/**
|
|
41
|
+
* Whether engine supports interactive mode (AskUserQuestion)
|
|
42
|
+
*/
|
|
43
|
+
supportsInteractive(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Get the CLI command name
|
|
46
|
+
*/
|
|
47
|
+
getCommand(): string;
|
|
12
48
|
}
|
|
13
49
|
/**
|
|
14
|
-
*
|
|
50
|
+
* Model aliases per engine
|
|
51
|
+
*/
|
|
52
|
+
export declare const MODEL_ALIASES_BY_ENGINE: Record<string, Record<string, string>>;
|
|
53
|
+
/**
|
|
54
|
+
* Backward compatibility: global aliases (Claude-only for now)
|
|
55
|
+
*/
|
|
56
|
+
export declare const MODEL_ALIASES: Record<string, string>;
|
|
57
|
+
/**
|
|
58
|
+
* Resolve model alias to full model ID
|
|
59
|
+
* Falls back to string if not found (allows full model IDs)
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveModel(model: string, engine?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Validate that a model is compatible with the specified engine
|
|
15
64
|
*/
|
|
16
|
-
export declare function
|
|
65
|
+
export declare function validateModelForEngine(model: string, engine: string): void;
|
|
17
66
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/lib/engines/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/lib/engines/base.ts"],"names":[],"mappings":"AAAA;;GA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AO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAkC,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAiB,GAAG,MAAM,CAM7E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAmB1E"}
|
package/dist/lib/engines/base.js
CHANGED
|
@@ -1,9 +1,62 @@
|
|
|
1
|
-
import { spawnSync } from 'child_process';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* Base engine interface that all engines must implement
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Model aliases per engine
|
|
6
|
+
*/
|
|
7
|
+
export const MODEL_ALIASES_BY_ENGINE = {
|
|
8
|
+
claude: {
|
|
9
|
+
opus: 'opus',
|
|
10
|
+
sonnet: 'sonnet',
|
|
11
|
+
haiku: 'haiku',
|
|
12
|
+
},
|
|
13
|
+
opencode: {
|
|
14
|
+
// OpenAI models
|
|
15
|
+
'gpt-4o': 'gpt-4o',
|
|
16
|
+
'gpt-4': 'gpt-4-turbo',
|
|
17
|
+
'o1': 'o1', // Reasoning model
|
|
18
|
+
'o1-mini': 'o1-mini', // Smaller reasoning model
|
|
19
|
+
'o1-preview': 'o1-preview',
|
|
20
|
+
},
|
|
21
|
+
codex: {
|
|
22
|
+
// Codex/DeepSeek models
|
|
23
|
+
'deepseek-chat': 'deepseek-chat',
|
|
24
|
+
'deepseek-r1': 'deepseek-r1', // Reasoning model
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Backward compatibility: global aliases (Claude-only for now)
|
|
29
|
+
*/
|
|
30
|
+
export const MODEL_ALIASES = MODEL_ALIASES_BY_ENGINE.claude;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve model alias to full model ID
|
|
33
|
+
* Falls back to string if not found (allows full model IDs)
|
|
34
|
+
*/
|
|
35
|
+
export function resolveModel(model, engine = 'claude') {
|
|
36
|
+
const engineAliases = MODEL_ALIASES_BY_ENGINE[engine];
|
|
37
|
+
if (engineAliases) {
|
|
38
|
+
return engineAliases[model.toLowerCase()] ?? model;
|
|
39
|
+
}
|
|
40
|
+
return model;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validate that a model is compatible with the specified engine
|
|
44
|
+
*/
|
|
45
|
+
export function validateModelForEngine(model, engine) {
|
|
46
|
+
const engineAliases = MODEL_ALIASES_BY_ENGINE[engine];
|
|
47
|
+
if (!engineAliases) {
|
|
48
|
+
return; // Unknown engine, skip validation
|
|
49
|
+
}
|
|
50
|
+
const normalizedModel = model.toLowerCase();
|
|
51
|
+
const isFullModelId = model.includes('/') || model.includes('-');
|
|
52
|
+
// Error if it looks like an alias for a different engine
|
|
53
|
+
for (const [otherEngine, aliases] of Object.entries(MODEL_ALIASES_BY_ENGINE)) {
|
|
54
|
+
if (otherEngine === engine)
|
|
55
|
+
continue;
|
|
56
|
+
if (normalizedModel in aliases) {
|
|
57
|
+
throw new Error(`Model '${model}' is a ${otherEngine} alias but you're using engine '${engine}'. ` +
|
|
58
|
+
`Use --engine ${otherEngine} or choose a compatible model.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
8
61
|
}
|
|
9
62
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/lib/engines/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/lib/engines/base.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwDH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA2C;IAC7E,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAA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AAO,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,UAAU,KAAK,UAAU,WAAW,mCAAmC,MAAM,KAAK;gBAClF,gBAAgB,WAAW,gCAAgC,CAC5D,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Engine,
|
|
1
|
+
import { Engine, ExecuteOptions, Chunk, EngineFlags } from './base.js';
|
|
2
2
|
export declare class ClaudeEngine implements Engine {
|
|
3
3
|
readonly name = "claude";
|
|
4
|
-
|
|
4
|
+
execute(prompt: string, options: ExecuteOptions): AsyncIterable<Chunk>;
|
|
5
5
|
isAvailable(): Promise<boolean>;
|
|
6
|
+
getFlags(options: EngineFlags): string[];
|
|
7
|
+
supportsInteractive(): boolean;
|
|
8
|
+
getCommand(): string;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/lib/engines/claude.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/lib/engines/claude.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAgB,MAAM,WAAW,CAAC;AAErF,qBAAa,YAAa,YAAW,MAAM;IACzC,QAAQ,CAAC,IAAI,YAAY;IAElB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC;IAyCvE,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBrC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE;IAuBxC,mBAAmB,IAAI,OAAO;IAI9B,UAAU,IAAI,MAAM;CAGrB"}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
-
import {
|
|
2
|
+
import { resolveModel } from './base.js';
|
|
3
3
|
export class ClaudeEngine {
|
|
4
4
|
name = 'claude';
|
|
5
|
-
async
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
async *execute(prompt, options) {
|
|
6
|
+
const flags = this.getFlags({
|
|
7
|
+
model: options.model,
|
|
8
|
+
skipPermissions: options.skipPermissions,
|
|
9
|
+
reasoningEffort: options.reasoningEffort,
|
|
10
|
+
});
|
|
11
|
+
const args = ['-p', ...flags];
|
|
12
|
+
const child = spawn('claude', args, {
|
|
13
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
14
|
+
});
|
|
15
|
+
child.stdin.write(prompt);
|
|
16
|
+
child.stdin.end();
|
|
17
|
+
// Stream stderr to terminal
|
|
18
|
+
child.stderr.on('data', (data) => {
|
|
19
|
+
process.stderr.write(data);
|
|
20
|
+
});
|
|
21
|
+
// Stream stdout to terminal and yield chunks
|
|
22
|
+
for await (const data of child.stdout) {
|
|
23
|
+
const text = data.toString();
|
|
24
|
+
process.stdout.write(text);
|
|
25
|
+
yield { type: 'text', content: text };
|
|
9
26
|
}
|
|
10
|
-
|
|
11
|
-
const child = spawn('claude', args, {
|
|
12
|
-
stdio: ['pipe', 'inherit', 'inherit'],
|
|
13
|
-
});
|
|
14
|
-
child.stdin.write(prompt);
|
|
15
|
-
child.stdin.end();
|
|
27
|
+
await new Promise((resolve, reject) => {
|
|
16
28
|
child.on('close', (code) => {
|
|
17
29
|
if (code === 0) {
|
|
18
30
|
resolve();
|
|
@@ -23,9 +35,43 @@ export class ClaudeEngine {
|
|
|
23
35
|
});
|
|
24
36
|
child.on('error', reject);
|
|
25
37
|
});
|
|
38
|
+
yield { type: 'done' };
|
|
26
39
|
}
|
|
27
40
|
async isAvailable() {
|
|
28
|
-
return
|
|
41
|
+
return new Promise((resolve) => {
|
|
42
|
+
const child = spawn('claude', ['--version'], {
|
|
43
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
44
|
+
});
|
|
45
|
+
child.on('close', (code) => {
|
|
46
|
+
resolve(code === 0);
|
|
47
|
+
});
|
|
48
|
+
child.on('error', () => {
|
|
49
|
+
resolve(false);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
getFlags(options) {
|
|
54
|
+
const flags = [];
|
|
55
|
+
if (options.model) {
|
|
56
|
+
flags.push('--model', resolveModel(options.model, 'claude'));
|
|
57
|
+
}
|
|
58
|
+
if (options.skipPermissions) {
|
|
59
|
+
flags.push('--dangerously-skip-permissions');
|
|
60
|
+
}
|
|
61
|
+
if (options.verbose) {
|
|
62
|
+
flags.push('--verbose');
|
|
63
|
+
}
|
|
64
|
+
if (options.reasoningEffort) {
|
|
65
|
+
// Claude CLI does not support reasoning-effort parameter yet
|
|
66
|
+
console.warn('Warning: Claude CLI does not support reasoning-effort parameter. Ignoring.');
|
|
67
|
+
}
|
|
68
|
+
return flags;
|
|
69
|
+
}
|
|
70
|
+
supportsInteractive() {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
getCommand() {
|
|
74
|
+
return 'claude';
|
|
29
75
|
}
|
|
30
76
|
}
|
|
31
77
|
//# sourceMappingURL=claude.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/lib/engines/claude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/lib/engines/claude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAA8C,YAAY,EAAE,MAAM,WAAW,CAAC;AAErF,MAAM,OAAO,YAAY;IACd,IAAI,GAAG,QAAQ,CAAC;IAEzB,KAAK,CAAC,CAAC,OAAO,CAAC,MAAc,EAAE,OAAuB;QAC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