@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,44 @@
|
|
|
1
|
+
import { error as colorError } from './colors.js';
|
|
2
|
+
const errorCodes = {
|
|
3
|
+
AGENT_INIT_FAILED: {
|
|
4
|
+
message: 'Failed to initialize agent',
|
|
5
|
+
suggestion: 'Check agent configuration and API keys.',
|
|
6
|
+
},
|
|
7
|
+
AGENT_EXECUTION_FAILED: {
|
|
8
|
+
message: 'Agent execution failed',
|
|
9
|
+
suggestion: 'Review agent logs and input parameters.',
|
|
10
|
+
},
|
|
11
|
+
PROVIDER_ERROR: {
|
|
12
|
+
message: 'AI provider error',
|
|
13
|
+
suggestion: 'Check API key and provider availability.',
|
|
14
|
+
},
|
|
15
|
+
PARSE_FAILURE: {
|
|
16
|
+
message: 'Failed to parse response',
|
|
17
|
+
suggestion: 'Verify response format and structure.',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export function formatError(code, message, details) {
|
|
21
|
+
const entry = errorCodes[code];
|
|
22
|
+
return {
|
|
23
|
+
code,
|
|
24
|
+
message: entry?.message ?? message,
|
|
25
|
+
suggestion: entry?.suggestion,
|
|
26
|
+
details,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function printError(err) {
|
|
30
|
+
console.error(colorError(`✗ [${err.code}] ${err.message}`));
|
|
31
|
+
if (err.details) {
|
|
32
|
+
console.error(` Details: ${err.details}`);
|
|
33
|
+
}
|
|
34
|
+
if (err.suggestion) {
|
|
35
|
+
console.error(` Suggestion: ${err.suggestion}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function printSuccess(message) {
|
|
39
|
+
console.log(`✓ ${message}`);
|
|
40
|
+
}
|
|
41
|
+
export function printWarning(message) {
|
|
42
|
+
console.warn(`⚠ ${message}`);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=error-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-formatter.js","sourceRoot":"","sources":["../../src/utils/error-formatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAQ,MAAM,UAAU,CAAC;AASrD,MAAM,UAAU,GAA4D;IAC1E,iBAAiB,EAAE;QACjB,OAAO,EAAE,4BAA4B;QACrC,UAAU,EAAE,yCAAyC;KACtD;IACD,sBAAsB,EAAE;QACtB,OAAO,EAAE,wBAAwB;QACjC,UAAU,EAAE,yCAAyC;KACtD;IACD,cAAc,EAAE;QACd,OAAO,EAAE,mBAAmB;QAC5B,UAAU,EAAE,0CAA0C;KACvD;IACD,aAAa,EAAE;QACb,OAAO,EAAE,0BAA0B;QACnC,UAAU,EAAE,uCAAuC;KACpD;CACF,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,OAAe,EAAE,OAAgB;IACzE,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,OAAO;QAClC,UAAU,EAAE,KAAK,EAAE,UAAU;QAC7B,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAmB;IAC5C,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC5D,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,SAE1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW;IACzB,iCAAiC;AACnC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class ProgressBar {
|
|
2
|
+
private current;
|
|
3
|
+
private total;
|
|
4
|
+
private width;
|
|
5
|
+
constructor(total: number);
|
|
6
|
+
update(current: number): void;
|
|
7
|
+
increment(): void;
|
|
8
|
+
private render;
|
|
9
|
+
complete(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function spinner(message: string): NodeJS.Timeout;
|
|
12
|
+
export declare function clearSpinner(id: NodeJS.Timeout): void;
|
|
13
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/utils/progress.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAM;gBAEP,KAAK,EAAE,MAAM;IAIzB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK7B,SAAS,IAAI,IAAI;IAIjB,OAAO,CAAC,MAAM;IAQd,QAAQ,IAAI,IAAI;CAIjB;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAOvD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAGrD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export class ProgressBar {
|
|
2
|
+
current = 0;
|
|
3
|
+
total;
|
|
4
|
+
width = 30;
|
|
5
|
+
constructor(total) {
|
|
6
|
+
this.total = total;
|
|
7
|
+
}
|
|
8
|
+
update(current) {
|
|
9
|
+
this.current = Math.min(current, this.total);
|
|
10
|
+
this.render();
|
|
11
|
+
}
|
|
12
|
+
increment() {
|
|
13
|
+
this.update(this.current + 1);
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const percentage = (this.current / this.total) * 100;
|
|
17
|
+
const filled = Math.round((this.current / this.total) * this.width);
|
|
18
|
+
const bar = '█'.repeat(filled) + '░'.repeat(this.width - filled);
|
|
19
|
+
const pct = percentage.toFixed(1);
|
|
20
|
+
process.stdout.write(`\r[${bar}] ${pct}%`);
|
|
21
|
+
}
|
|
22
|
+
complete() {
|
|
23
|
+
this.update(this.total);
|
|
24
|
+
process.stdout.write('\n');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function spinner(message) {
|
|
28
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
29
|
+
let i = 0;
|
|
30
|
+
return setInterval(() => {
|
|
31
|
+
process.stdout.write(`\r${frames[i % frames.length]} ${message}`);
|
|
32
|
+
i += 1;
|
|
33
|
+
}, 80);
|
|
34
|
+
}
|
|
35
|
+
export function clearSpinner(id) {
|
|
36
|
+
clearInterval(id);
|
|
37
|
+
process.stdout.write('\r\x1b[K');
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/utils/progress.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IACd,OAAO,GAAG,CAAC,CAAC;IACZ,KAAK,CAAS;IACd,KAAK,GAAG,EAAE,CAAC;IAEnB,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,SAAS;QACP,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAChC,CAAC;IAEO,MAAM;QACZ,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC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0",
|
|
5
|
+
"description": "CLI interface for Omaikit - multi-agent development toolkit",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"bin": {
|
|
12
|
+
"omaikit": "dist/bin/index.js"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && tsc-alias",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"type-check": "tsc --noEmit",
|
|
18
|
+
"test": "vitest",
|
|
19
|
+
"prepare": "tsc && tsc-alias"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"omaikit",
|
|
23
|
+
"cli",
|
|
24
|
+
"agent",
|
|
25
|
+
"development"
|
|
26
|
+
],
|
|
27
|
+
"author": "Omaikit",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@omaikit/models": "*",
|
|
31
|
+
"@omaikit/config": "*",
|
|
32
|
+
"@omaikit/analysis": "*",
|
|
33
|
+
"@omaikit/agents": "*"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^5.3.3",
|
|
37
|
+
"vitest": "^1.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|