@omaikit/cli 0.1.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/dist/bin/index.d.ts +6 -0
- package/dist/bin/index.d.ts.map +1 -0
- package/dist/bin/index.js +155 -0
- package/dist/bin/index.js.map +1 -0
- package/dist/commands/code.d.ts +9 -0
- package/dist/commands/code.d.ts.map +1 -0
- package/dist/commands/code.js +128 -0
- package/dist/commands/code.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +11 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +80 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/plan.d.ts +9 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +170 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/test.d.ts +11 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +147 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/handlers/index.d.ts +5 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +7 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/cancellation-handler.d.ts +14 -0
- package/dist/orchestrator/cancellation-handler.d.ts.map +1 -0
- package/dist/orchestrator/cancellation-handler.js +27 -0
- package/dist/orchestrator/cancellation-handler.js.map +1 -0
- package/dist/orchestrator/event-bus.d.ts +15 -0
- package/dist/orchestrator/event-bus.d.ts.map +1 -0
- package/dist/orchestrator/event-bus.js +20 -0
- package/dist/orchestrator/event-bus.js.map +1 -0
- package/dist/orchestrator/orchestrator.d.ts +22 -0
- package/dist/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator.js +53 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/orchestrator/state-machine.d.ts +16 -0
- package/dist/orchestrator/state-machine.d.ts.map +1 -0
- package/dist/orchestrator/state-machine.js +33 -0
- package/dist/orchestrator/state-machine.js.map +1 -0
- package/dist/orchestrator.d.ts +7 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +9 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/utils/colors.d.ts +21 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/colors.js +41 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +11 -0
- package/dist/utils/error-formatter.d.ts.map +1 -0
- package/dist/utils/error-formatter.js +44 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/progress.d.ts +13 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +39 -0
- package/dist/utils/progress.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";AACA;;GAEG"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Omaikit CLI entry point
|
|
4
|
+
*/
|
|
5
|
+
import { bold, cyan } from '../utils/colors.js';
|
|
6
|
+
import { formatError, printError } from '../utils/error-formatter.js';
|
|
7
|
+
import planCommand from '../commands/plan.js';
|
|
8
|
+
import initCommand from '../commands/init.js';
|
|
9
|
+
import codeCommand from '../commands/code.js';
|
|
10
|
+
const VERSION = '0.1.0';
|
|
11
|
+
function parseArgs(args) {
|
|
12
|
+
const result = {};
|
|
13
|
+
for (let i = 2; i < args.length; i++) {
|
|
14
|
+
const arg = args[i];
|
|
15
|
+
if (arg === '--help' || arg === '-h') {
|
|
16
|
+
result.help = true;
|
|
17
|
+
}
|
|
18
|
+
else if (arg === '--version' || arg === '-v') {
|
|
19
|
+
result.version = true;
|
|
20
|
+
}
|
|
21
|
+
else if (arg === '--project-type' || arg === '-p') {
|
|
22
|
+
result.projectType = args[++i];
|
|
23
|
+
}
|
|
24
|
+
else if (arg === '--tech-stack' || arg === '-t') {
|
|
25
|
+
result.techStack = args[++i]?.split(',').map((s) => s.trim()) ?? [];
|
|
26
|
+
}
|
|
27
|
+
else if (arg === '--output' || arg === '-o') {
|
|
28
|
+
result.output = args[++i];
|
|
29
|
+
}
|
|
30
|
+
else if (arg === '--plan') {
|
|
31
|
+
result.planFile = args[++i];
|
|
32
|
+
}
|
|
33
|
+
else if (arg === '--task') {
|
|
34
|
+
result.taskId = args[++i];
|
|
35
|
+
}
|
|
36
|
+
else if (arg === '--force' || arg === '-f') {
|
|
37
|
+
result.force = true;
|
|
38
|
+
}
|
|
39
|
+
else if (arg === '--root' || arg === '--path') {
|
|
40
|
+
result.rootPath = args[++i];
|
|
41
|
+
}
|
|
42
|
+
else if (!arg.startsWith('-')) {
|
|
43
|
+
if (!result.command) {
|
|
44
|
+
result.command = arg;
|
|
45
|
+
}
|
|
46
|
+
else if (!result.description) {
|
|
47
|
+
result.description = arg;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
function printHelp() {
|
|
54
|
+
console.log(bold(`Omaikit CLI v${VERSION}`));
|
|
55
|
+
console.log('Multi-Agent Development Toolkit');
|
|
56
|
+
console.log('');
|
|
57
|
+
console.log(bold('Usage:'));
|
|
58
|
+
console.log(' omaikit <command> [options]');
|
|
59
|
+
console.log('');
|
|
60
|
+
console.log(bold('Commands:'));
|
|
61
|
+
console.log(' init Initialize project context');
|
|
62
|
+
console.log(' plan <description> Generate a project plan');
|
|
63
|
+
console.log(' code [plan] Generate code from a plan');
|
|
64
|
+
console.log(' test <plan> Generate tests from a plan');
|
|
65
|
+
console.log(' analyze <path> Analyze existing codebase');
|
|
66
|
+
console.log(' review <path> Review code quality');
|
|
67
|
+
console.log('');
|
|
68
|
+
console.log(bold('Options:'));
|
|
69
|
+
console.log(' -p, --project-type Project type (e.g., web, api, cli)');
|
|
70
|
+
console.log(' -t, --tech-stack Comma-separated tech stack (e.g., typescript,node,express)');
|
|
71
|
+
console.log(' -o, --output Output directory for generated files');
|
|
72
|
+
console.log(' --plan Plan file path for code generation');
|
|
73
|
+
console.log(' --task Task ID or title to generate');
|
|
74
|
+
console.log(' -f, --force Force overwrite existing output');
|
|
75
|
+
console.log(' --root Project root path for init');
|
|
76
|
+
console.log(' -h, --help Show this help message');
|
|
77
|
+
console.log(' -v, --version Show version');
|
|
78
|
+
console.log('');
|
|
79
|
+
console.log(bold('Examples:'));
|
|
80
|
+
console.log(' omaikit init');
|
|
81
|
+
console.log(' omaikit plan "Build a REST API"');
|
|
82
|
+
console.log(' omaikit plan "Web app" --project-type web --tech-stack react,typescript');
|
|
83
|
+
console.log(' omaikit plan "CLI tool" --output ./my-plan.json');
|
|
84
|
+
console.log(' omaikit code P-0.json');
|
|
85
|
+
}
|
|
86
|
+
async function main() {
|
|
87
|
+
const args = parseArgs(process.argv);
|
|
88
|
+
// Handle version flag
|
|
89
|
+
if (args.version) {
|
|
90
|
+
console.log(`Omaikit v${VERSION}`);
|
|
91
|
+
process.exit(0);
|
|
92
|
+
}
|
|
93
|
+
// Handle help flag or no command
|
|
94
|
+
if (args.help || !args.command) {
|
|
95
|
+
printHelp();
|
|
96
|
+
process.exit(args.command ? 0 : 1);
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
switch (args.command.toLowerCase()) {
|
|
100
|
+
case 'init': {
|
|
101
|
+
await initCommand({ rootPath: args.rootPath, description: args.description });
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case 'plan': {
|
|
105
|
+
if (!args.description) {
|
|
106
|
+
const err = formatError('INVALID_ARGS', 'Description is required for plan command');
|
|
107
|
+
printError(err);
|
|
108
|
+
console.log('');
|
|
109
|
+
console.log('Usage: omaikit plan <description> [options]');
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
await planCommand(args.description, {
|
|
113
|
+
projectType: args.projectType,
|
|
114
|
+
techStack: args.techStack,
|
|
115
|
+
output: args.output,
|
|
116
|
+
});
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
case 'code': {
|
|
120
|
+
await codeCommand({
|
|
121
|
+
planFile: args.planFile ?? args.description,
|
|
122
|
+
outputDir: args.output,
|
|
123
|
+
taskId: args.taskId,
|
|
124
|
+
force: args.force,
|
|
125
|
+
});
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case 'test':
|
|
129
|
+
case 'analyze':
|
|
130
|
+
case 'review':
|
|
131
|
+
console.log(cyan(`\n🚀 ${args.command} command is coming soon!\n`));
|
|
132
|
+
process.exit(0);
|
|
133
|
+
break;
|
|
134
|
+
default: {
|
|
135
|
+
const err = formatError('UNKNOWN_COMMAND', `Unknown command: ${args.command}`);
|
|
136
|
+
printError(err);
|
|
137
|
+
console.log('');
|
|
138
|
+
console.log("Run 'omaikit --help' for usage information");
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
const err = error;
|
|
145
|
+
const fmtErr = formatError('CLI_ERROR', err.message);
|
|
146
|
+
printError(fmtErr);
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Run CLI
|
|
151
|
+
main().catch((error) => {
|
|
152
|
+
console.error('Fatal error:', error);
|
|
153
|
+
process.exit(1);
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","s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W,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QACrD,UAAU,CAAC,MAAM,CAAC,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,UAAU;AACV,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CodeCommandOptions {
|
|
2
|
+
planFile?: string;
|
|
3
|
+
outputDir?: string;
|
|
4
|
+
taskId?: string;
|
|
5
|
+
force?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function codeCommand(options?: CodeCommandOptions): Promise<void>;
|
|
8
|
+
export default codeCommand;
|
|
9
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/commands/code.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiH7E;AAWD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { CoderAgent, Logger } from '@omaikit/agents';
|
|
2
|
+
import { PlanWriter, ContextWriter } from '@omaikit/analysis';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { bold, cyan, green, yellow } from '../utils/colors.js';
|
|
6
|
+
import { ProgressBar } from '../utils/progress.js';
|
|
7
|
+
import { formatError, printError } from '../utils/error-formatter.js';
|
|
8
|
+
function getLatestPlanFile() {
|
|
9
|
+
const planDir = path.join('.omaikit', 'plans');
|
|
10
|
+
if (!fs.existsSync(planDir)) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const indices = fs
|
|
14
|
+
.readdirSync(planDir)
|
|
15
|
+
.map((file) => /^P-(\d+)\.json$/i.exec(file))
|
|
16
|
+
.filter((match) => match !== null)
|
|
17
|
+
.map((match) => Number.parseInt(match[1], 10))
|
|
18
|
+
.filter((value) => !Number.isNaN(value));
|
|
19
|
+
if (indices.length === 0) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const latest = Math.max(...indices);
|
|
23
|
+
return path.join('plans', `P-${latest}.json`);
|
|
24
|
+
}
|
|
25
|
+
export async function codeCommand(options) {
|
|
26
|
+
const logger = new Logger();
|
|
27
|
+
const coder = new CoderAgent(logger);
|
|
28
|
+
const planWriter = new PlanWriter();
|
|
29
|
+
const contextWriter = new ContextWriter();
|
|
30
|
+
const progress = new ProgressBar(50);
|
|
31
|
+
try {
|
|
32
|
+
console.log(cyan('🧩 Generating code from plan...'));
|
|
33
|
+
console.log('');
|
|
34
|
+
const context = await contextWriter.readContext();
|
|
35
|
+
if (!context) {
|
|
36
|
+
const err = formatError('CONTEXT_MISSING', 'Project context not found. Run `omaikit init` first.');
|
|
37
|
+
printError(err);
|
|
38
|
+
if (process.env.VITEST !== undefined) {
|
|
39
|
+
throw new Error('Project context not found');
|
|
40
|
+
}
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const planFile = options?.planFile || getLatestPlanFile() || 'plan.json';
|
|
44
|
+
const plan = await planWriter.readPlan(planFile);
|
|
45
|
+
if (!plan) {
|
|
46
|
+
const err = formatError('CODE_COMMAND_ERROR', 'No plan found. Run `omaikit plan` first.');
|
|
47
|
+
printError(err);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
const tasks = selectTasks(plan, options?.taskId);
|
|
51
|
+
if (tasks.length === 0) {
|
|
52
|
+
const err = formatError('CODE_COMMAND_ERROR', 'No matching tasks found in plan.');
|
|
53
|
+
printError(err);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
await coder.init();
|
|
57
|
+
const projectRoot = context.project?.rootPath || process.cwd();
|
|
58
|
+
const writtenPaths = [];
|
|
59
|
+
let generatedLOC = 0;
|
|
60
|
+
let filesCreated = 0;
|
|
61
|
+
const newDependencies = new Set();
|
|
62
|
+
for (let i = 0; i < tasks.length; i++) {
|
|
63
|
+
const task = tasks[i];
|
|
64
|
+
const percent = Math.round(((i + 1) / tasks.length) * 100);
|
|
65
|
+
progress.update(percent);
|
|
66
|
+
console.log(yellow(` → Generating code for task: ${task.title}`));
|
|
67
|
+
const input = {
|
|
68
|
+
task,
|
|
69
|
+
plan,
|
|
70
|
+
projectContext: context,
|
|
71
|
+
force: options?.force,
|
|
72
|
+
};
|
|
73
|
+
const result = await coder.execute(input);
|
|
74
|
+
if (result.status === 'failed' || result.error) {
|
|
75
|
+
const err = formatError(result.error?.code || 'CODER_ERROR', result.error?.message || 'Code generation failed');
|
|
76
|
+
printError(err);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
const files = result.result.files || [];
|
|
80
|
+
files.forEach((file) => {
|
|
81
|
+
filesCreated += 1;
|
|
82
|
+
generatedLOC += file.content.split('\n').length;
|
|
83
|
+
(file.dependencies || []).forEach((dep) => newDependencies.add(dep));
|
|
84
|
+
});
|
|
85
|
+
files.forEach((file) => {
|
|
86
|
+
writtenPaths.push(path.join(projectRoot, file.path));
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
console.log('');
|
|
90
|
+
console.log(green(`✓ Code generated: ${projectRoot}`));
|
|
91
|
+
console.log('');
|
|
92
|
+
console.log(bold('📄 Generated Files'));
|
|
93
|
+
console.log(bold('═'.repeat(40)));
|
|
94
|
+
writtenPaths.slice(0, 10).forEach((filePath) => {
|
|
95
|
+
console.log(` ${cyan('•')} ${filePath}`);
|
|
96
|
+
});
|
|
97
|
+
if (writtenPaths.length > 10) {
|
|
98
|
+
console.log(` ${cyan('•')} ... and ${writtenPaths.length - 10} more`);
|
|
99
|
+
}
|
|
100
|
+
console.log('');
|
|
101
|
+
console.log(bold('📊 Summary'));
|
|
102
|
+
console.log(bold('═'.repeat(40)));
|
|
103
|
+
console.log(`Files Created: ${filesCreated}`);
|
|
104
|
+
console.log(`Total LOC: ${generatedLOC}`);
|
|
105
|
+
console.log(`Dependencies: ${Array.from(newDependencies).length}`);
|
|
106
|
+
console.log('');
|
|
107
|
+
console.log(green('✨ Next steps:'));
|
|
108
|
+
console.log(' 1. Review the generated files in your project root');
|
|
109
|
+
console.log(' 2. Run `omaikit test` to generate tests');
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const err = error;
|
|
113
|
+
const fmtErr = formatError('CODE_COMMAND_ERROR', err.message);
|
|
114
|
+
printError(fmtErr);
|
|
115
|
+
logger.error(err.message);
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function selectTasks(plan, taskId) {
|
|
120
|
+
const tasks = plan.milestones.flatMap((milestone) => milestone.tasks || []);
|
|
121
|
+
if (taskId) {
|
|
122
|
+
const match = tasks.find((t) => t.id === taskId || t.title === taskId);
|
|
123
|
+
return match ? [match] : [];
|
|
124
|
+
}
|
|
125
|
+
return tasks;
|
|
126
|
+
}
|
|
127
|
+
export default codeCommand;
|
|
128
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/commands/code.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,aAAa,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,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,MAAe;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC5E,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands module
|
|
3
|
+
*/
|
|
4
|
+
export { planCommand } from './plan.js';
|
|
5
|
+
export { codeCommand } from './code.js';
|
|
6
|
+
export { initCommand } from './init.js';
|
|
7
|
+
export { testCommand } from './test.js';
|
|
8
|
+
export declare function registerCommands(): void;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI commands module
|
|
3
|
+
*/
|
|
4
|
+
export { planCommand } from './plan.js';
|
|
5
|
+
export { codeCommand } from './code.js';
|
|
6
|
+
export { initCommand } from './init.js';
|
|
7
|
+
export { testCommand } from './test.js';
|
|
8
|
+
export function registerCommands() {
|
|
9
|
+
// TODO: Register CLI commands
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,UAAU,gBAAgB;IAC9B,8BAA8B;AAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC7E;AAgDD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Logger, ManagerAgent } from '@omaikit/agents';
|
|
2
|
+
import { loadConfig, saveConfig } from '@omaikit/config';
|
|
3
|
+
import * as readline from 'readline';
|
|
4
|
+
import { cyan, green, yellow } from '../utils/colors.js';
|
|
5
|
+
import { formatError, printError } from '../utils/error-formatter.js';
|
|
6
|
+
export async function initCommand(options) {
|
|
7
|
+
const logger = new Logger();
|
|
8
|
+
try {
|
|
9
|
+
console.log(cyan('🧭 Initializing project context...'));
|
|
10
|
+
const rootPath = options?.rootPath || process.cwd();
|
|
11
|
+
if (process.env.VITEST === undefined && process.env.NODE_ENV !== 'test') {
|
|
12
|
+
await ensureApiKey(logger);
|
|
13
|
+
}
|
|
14
|
+
const manager = new ManagerAgent(logger);
|
|
15
|
+
const result = await manager.execute({
|
|
16
|
+
action: 'init-context',
|
|
17
|
+
rootPath,
|
|
18
|
+
description: options?.description,
|
|
19
|
+
});
|
|
20
|
+
if (result.status === 'failed' || result.error) {
|
|
21
|
+
throw new Error(result.error?.message || 'Manager failed to generate context');
|
|
22
|
+
}
|
|
23
|
+
const filepath = result.data?.contextPath;
|
|
24
|
+
if (!filepath) {
|
|
25
|
+
throw new Error('Manager did not return context path');
|
|
26
|
+
}
|
|
27
|
+
console.log(green(`✓ Context saved to ${filepath}`));
|
|
28
|
+
console.log(yellow(' Next: run `omaikit plan` to generate a plan'));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const err = error;
|
|
32
|
+
const fmtErr = formatError('INIT_COMMAND_ERROR', err.message);
|
|
33
|
+
printError(fmtErr);
|
|
34
|
+
logger.error(err.message);
|
|
35
|
+
if (process.env.VITEST !== undefined) {
|
|
36
|
+
throw err;
|
|
37
|
+
}
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function ensureApiKey(logger) {
|
|
42
|
+
const cfg = loadConfig();
|
|
43
|
+
if (cfg.openaiApiKey || cfg.anthropicApiKey) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const key = await promptSecret('Enter your OPENAI_API_KEY: ');
|
|
47
|
+
if (!key) {
|
|
48
|
+
throw new Error('OPENAI_API_KEY is required to run init with AI analysis');
|
|
49
|
+
}
|
|
50
|
+
const updated = { ...cfg, openaiApiKey: key, provider: cfg.provider || 'openai' };
|
|
51
|
+
const savedPath = saveConfig(updated, 'global');
|
|
52
|
+
logger.info(`Saved API key to ${savedPath}`);
|
|
53
|
+
}
|
|
54
|
+
function promptSecret(prompt) {
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
const rl = readline.createInterface({
|
|
57
|
+
input: process.stdin,
|
|
58
|
+
output: process.stdout,
|
|
59
|
+
terminal: true,
|
|
60
|
+
});
|
|
61
|
+
const onData = (char) => {
|
|
62
|
+
const str = char.toString();
|
|
63
|
+
if (str === '\n' || str === '\r' || str === '\u0004') {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
readline.moveCursor(process.stdout, -1, 0);
|
|
67
|
+
readline.clearLine(process.stdout, 1);
|
|
68
|
+
process.stdout.write('*');
|
|
69
|
+
};
|
|
70
|
+
process.stdin.on('data', onData);
|
|
71
|
+
rl.question(prompt, (answer) => {
|
|
72
|
+
process.stdin.off('data', onData);
|
|
73
|
+
rl.close();
|
|
74
|
+
process.stdout.write('\n');
|
|
75
|
+
resolve(answer.trim());
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export default initCommand;
|
|
80
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQnE,MAAM,CAAC,KAA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,CAAC,QAAQ,EAAE,CAAC;YAC5B,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACrD,OAAO;YACT,CAAC;YACD,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3C,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,CAAC;QAEF,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEjC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAClC,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function planCommand(description: string, options?: {
|
|
2
|
+
projectType?: string;
|
|
3
|
+
techStack?: string[];
|
|
4
|
+
output?: string;
|
|
5
|
+
mode?: 'new' | 'update';
|
|
6
|
+
planId?: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export default planCommand;
|
|
9
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/commands/plan.ts"],"names":[],"mappings":"AAkDA,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IACR,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAAC,IAAI,CAAC,CA8Jf;AAGD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { Planner } from '@omaikit/agents';
|
|
2
|
+
import { Logger } from '@omaikit/agents';
|
|
3
|
+
import { PlanWriter, ContextWriter } from '@omaikit/analysis';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { cyan, bold, green, yellow } from '../utils/colors.js';
|
|
7
|
+
import { ProgressBar } from '../utils/progress.js';
|
|
8
|
+
import { formatError, printError } from '../utils/error-formatter.js';
|
|
9
|
+
const PLAN_DIR = path.join('.omaikit', 'plans');
|
|
10
|
+
function parsePlanIndex(filename) {
|
|
11
|
+
const match = /^P-(\d+)(?:\.json)?$/i.exec(filename);
|
|
12
|
+
if (!match) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return Number.parseInt(match[1], 10);
|
|
16
|
+
}
|
|
17
|
+
function getExistingPlanIndices(planDir) {
|
|
18
|
+
if (!fs.existsSync(planDir)) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
return fs
|
|
22
|
+
.readdirSync(planDir)
|
|
23
|
+
.map((file) => parsePlanIndex(file))
|
|
24
|
+
.filter((value) => value !== null);
|
|
25
|
+
}
|
|
26
|
+
function resolvePlanIndex(planDir, options) {
|
|
27
|
+
const existing = getExistingPlanIndices(planDir);
|
|
28
|
+
const maxExisting = existing.length ? Math.max(...existing) : -1;
|
|
29
|
+
if (options?.mode === 'update') {
|
|
30
|
+
if (options?.planId) {
|
|
31
|
+
const parsed = parsePlanIndex(options.planId) ?? Number.parseInt(options.planId, 10);
|
|
32
|
+
if (!Number.isNaN(parsed)) {
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return maxExisting >= 0 ? maxExisting : 0;
|
|
37
|
+
}
|
|
38
|
+
return maxExisting + 1;
|
|
39
|
+
}
|
|
40
|
+
export async function planCommand(description, options) {
|
|
41
|
+
const logger = new Logger();
|
|
42
|
+
const planner = new Planner(logger);
|
|
43
|
+
const writer = new PlanWriter();
|
|
44
|
+
const contextWriter = new ContextWriter();
|
|
45
|
+
const progress = new ProgressBar(50);
|
|
46
|
+
try {
|
|
47
|
+
console.log(cyan('🎯 Generating project plan...'));
|
|
48
|
+
console.log('');
|
|
49
|
+
const context = await contextWriter.readContext();
|
|
50
|
+
if (!context) {
|
|
51
|
+
const err = formatError('CONTEXT_MISSING', 'Project context not found. Run `omaikit init` first.');
|
|
52
|
+
printError(err);
|
|
53
|
+
if (process.env.VITEST !== undefined) {
|
|
54
|
+
throw new Error('Project context not found');
|
|
55
|
+
}
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
const input = {
|
|
59
|
+
description,
|
|
60
|
+
projectType: options?.projectType,
|
|
61
|
+
techStack: options?.techStack,
|
|
62
|
+
};
|
|
63
|
+
// Setup progress tracking
|
|
64
|
+
planner.onProgress((event) => {
|
|
65
|
+
if (event.status === 'parsing') {
|
|
66
|
+
progress.update(33);
|
|
67
|
+
console.log(yellow(' ⏳ Parsing response...'));
|
|
68
|
+
}
|
|
69
|
+
else if (event.status === 'validating') {
|
|
70
|
+
progress.update(66);
|
|
71
|
+
console.log(yellow(' ✓ Validating plan...'));
|
|
72
|
+
}
|
|
73
|
+
else if (event.status === 'complete') {
|
|
74
|
+
progress.update(100);
|
|
75
|
+
console.log(green(' ✓ Plan generated'));
|
|
76
|
+
}
|
|
77
|
+
else if (event.status === 'generating') {
|
|
78
|
+
console.log(cyan(' → Receiving plan from AI...'));
|
|
79
|
+
progress.update(10);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
// Execute planner
|
|
83
|
+
const result = await planner.execute(input);
|
|
84
|
+
if (result.error) {
|
|
85
|
+
const err = formatError(result.error.code, result.error.message);
|
|
86
|
+
printError(err);
|
|
87
|
+
if (process.env.VITEST !== undefined) {
|
|
88
|
+
throw new Error(result.error.message);
|
|
89
|
+
}
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
const plan = result.data?.plan ||
|
|
93
|
+
(result.data && result.data.title ? result.data : undefined);
|
|
94
|
+
if (!plan) {
|
|
95
|
+
const err = formatError('PLANNING_ERROR', 'Failed to generate plan');
|
|
96
|
+
printError(err);
|
|
97
|
+
if (process.env.VITEST !== undefined) {
|
|
98
|
+
throw new Error('Failed to generate plan');
|
|
99
|
+
}
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
const planOutput = { ...plan };
|
|
103
|
+
if ('projectContext' in planOutput) {
|
|
104
|
+
delete planOutput.projectContext;
|
|
105
|
+
}
|
|
106
|
+
if (!fs.existsSync(PLAN_DIR)) {
|
|
107
|
+
fs.mkdirSync(PLAN_DIR, { recursive: true });
|
|
108
|
+
}
|
|
109
|
+
const planIndex = resolvePlanIndex(PLAN_DIR, options);
|
|
110
|
+
const planId = `P-${planIndex}`;
|
|
111
|
+
const archiveFilename = `plans/${planId}.json`;
|
|
112
|
+
// Save plan
|
|
113
|
+
console.log('');
|
|
114
|
+
let filepath;
|
|
115
|
+
if (options?.output && path.isAbsolute(options.output)) {
|
|
116
|
+
const dirPath = path.dirname(options.output);
|
|
117
|
+
if (!fs.existsSync(dirPath)) {
|
|
118
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
119
|
+
}
|
|
120
|
+
fs.writeFileSync(options.output, JSON.stringify({ ...planOutput, id: planId }, null, 2), 'utf-8');
|
|
121
|
+
filepath = options.output;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const target = options?.output || archiveFilename;
|
|
125
|
+
filepath = await writer.writePlan({ ...planOutput, id: planId }, target);
|
|
126
|
+
}
|
|
127
|
+
console.log(green(`✓ Plan saved to ${filepath}`));
|
|
128
|
+
// Display summary
|
|
129
|
+
console.log('');
|
|
130
|
+
console.log(bold('📋 Plan Summary'));
|
|
131
|
+
console.log(bold('═'.repeat(40)));
|
|
132
|
+
console.log(`Title: ${cyan(plan.title)}`);
|
|
133
|
+
console.log(`Milestones: ${plan.milestones.length}`);
|
|
134
|
+
const totalTasks = plan.milestones.reduce((sum, m) => sum + m.tasks.length, 0);
|
|
135
|
+
console.log(`Total Tasks: ${totalTasks}`);
|
|
136
|
+
const totalEffort = plan.milestones.reduce((sum, m) => sum + m.tasks.reduce((ts, t) => ts + (t.estimatedEffort ?? t.effort ?? 0), 0), 0);
|
|
137
|
+
console.log(`Total Effort: ${totalEffort} hours (~${Math.ceil(totalEffort / 8)} days)`);
|
|
138
|
+
console.log('');
|
|
139
|
+
console.log(bold('Milestones:'));
|
|
140
|
+
for (const milestone of plan.milestones) {
|
|
141
|
+
const milestoneEffort = milestone.tasks.reduce((sum, t) => sum + (t.estimatedEffort ?? t.effort ?? 0), 0);
|
|
142
|
+
console.log(` ${cyan('→')} ${milestone.title} (${milestone.duration}d, ${milestoneEffort}h)`);
|
|
143
|
+
for (const task of milestone.tasks.slice(0, 3)) {
|
|
144
|
+
const effort = task.estimatedEffort ?? task.effort ?? 0;
|
|
145
|
+
console.log(` ${yellow('•')} ${task.title} (${effort}h)`);
|
|
146
|
+
}
|
|
147
|
+
if (milestone.tasks.length > 3) {
|
|
148
|
+
console.log(` ${yellow('•')} ... and ${milestone.tasks.length - 3} more`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
console.log('');
|
|
152
|
+
console.log(green('✨ Next steps:'));
|
|
153
|
+
console.log(' 1. Review the plan in the generated file');
|
|
154
|
+
console.log(' 2. Run `omaikit code` to generate code for tasks');
|
|
155
|
+
console.log(' 3. Run `omaikit test` to create test suite');
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
const err = error;
|
|
159
|
+
const fmtErr = formatError('COMMAND_ERROR', err.message);
|
|
160
|
+
printError(fmtErr);
|
|
161
|
+
logger.error(err.message);
|
|
162
|
+
if (process.env.VITEST !== undefined) {
|
|
163
|
+
throw err;
|
|
164
|
+
}
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Export for CLI integration
|
|
169
|
+
export default planCommand;
|
|
170
|
+
//# sourceMappingURL=plan.js.map
|