@actrun_ai/tastekit-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.
Files changed (57) hide show
  1. package/dist/cli.d.ts +8 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +67 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/compile.d.ts +3 -0
  6. package/dist/commands/compile.d.ts.map +1 -0
  7. package/dist/commands/compile.js +61 -0
  8. package/dist/commands/compile.js.map +1 -0
  9. package/dist/commands/completion.d.ts +9 -0
  10. package/dist/commands/completion.d.ts.map +1 -0
  11. package/dist/commands/completion.js +191 -0
  12. package/dist/commands/completion.js.map +1 -0
  13. package/dist/commands/drift.d.ts +3 -0
  14. package/dist/commands/drift.d.ts.map +1 -0
  15. package/dist/commands/drift.js +175 -0
  16. package/dist/commands/drift.js.map +1 -0
  17. package/dist/commands/eval.d.ts +3 -0
  18. package/dist/commands/eval.d.ts.map +1 -0
  19. package/dist/commands/eval.js +147 -0
  20. package/dist/commands/eval.js.map +1 -0
  21. package/dist/commands/export.d.ts +3 -0
  22. package/dist/commands/export.d.ts.map +1 -0
  23. package/dist/commands/export.js +279 -0
  24. package/dist/commands/export.js.map +1 -0
  25. package/dist/commands/import.d.ts +3 -0
  26. package/dist/commands/import.d.ts.map +1 -0
  27. package/dist/commands/import.js +315 -0
  28. package/dist/commands/import.js.map +1 -0
  29. package/dist/commands/init.d.ts +5 -0
  30. package/dist/commands/init.d.ts.map +1 -0
  31. package/dist/commands/init.js +213 -0
  32. package/dist/commands/init.js.map +1 -0
  33. package/dist/commands/mcp.d.ts +3 -0
  34. package/dist/commands/mcp.d.ts.map +1 -0
  35. package/dist/commands/mcp.js +226 -0
  36. package/dist/commands/mcp.js.map +1 -0
  37. package/dist/commands/onboard.d.ts +6 -0
  38. package/dist/commands/onboard.d.ts.map +1 -0
  39. package/dist/commands/onboard.js +186 -0
  40. package/dist/commands/onboard.js.map +1 -0
  41. package/dist/commands/simulate.d.ts +3 -0
  42. package/dist/commands/simulate.d.ts.map +1 -0
  43. package/dist/commands/simulate.js +14 -0
  44. package/dist/commands/simulate.js.map +1 -0
  45. package/dist/commands/skills.d.ts +3 -0
  46. package/dist/commands/skills.d.ts.map +1 -0
  47. package/dist/commands/skills.js +419 -0
  48. package/dist/commands/skills.js.map +1 -0
  49. package/dist/commands/trust.d.ts +3 -0
  50. package/dist/commands/trust.d.ts.map +1 -0
  51. package/dist/commands/trust.js +183 -0
  52. package/dist/commands/trust.js.map +1 -0
  53. package/dist/ui.d.ts +70 -0
  54. package/dist/ui.d.ts.map +1 -0
  55. package/dist/ui.js +144 -0
  56. package/dist/ui.js.map +1 -0
  57. package/package.json +51 -0
package/dist/ui.d.ts ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Shared UI utilities for TasteKit CLI.
3
+ *
4
+ * Centralizes formatting, error handling, and output patterns
5
+ * used across all CLI commands.
6
+ */
7
+ import type { Command } from 'commander';
8
+ import type { Ora } from 'ora';
9
+ export interface GlobalOptions {
10
+ json: boolean;
11
+ verbose: boolean;
12
+ }
13
+ /**
14
+ * Extract --json and --verbose from the root program options.
15
+ */
16
+ export declare function getGlobalOptions(cmd: Command): GlobalOptions;
17
+ /**
18
+ * Return a chalk-colored string for a risk/severity level.
19
+ */
20
+ export declare function riskColor(level: string): string;
21
+ /**
22
+ * Print a bold section header with surrounding newlines.
23
+ */
24
+ export declare function header(title: string): void;
25
+ /**
26
+ * Print a labeled detail line (indented).
27
+ */
28
+ export declare function detail(label: string, value: string): void;
29
+ /**
30
+ * Print a "Run <cmd> to <desc>" hint.
31
+ */
32
+ export declare function hint(cmd: string, desc: string): void;
33
+ /**
34
+ * Print a block of next-step hints.
35
+ */
36
+ export declare function nextSteps(hints: Array<{
37
+ cmd: string;
38
+ desc: string;
39
+ }>): void;
40
+ interface Column {
41
+ label: string;
42
+ width: number;
43
+ align?: 'left' | 'right';
44
+ }
45
+ /**
46
+ * Print a simple columnar table with header and rows.
47
+ *
48
+ * Color is applied AFTER padding so ANSI codes don't break alignment.
49
+ * Each cell value should be a plain string; use `colorFn` in the row data
50
+ * if you need color on specific cells (apply after this renders).
51
+ */
52
+ export declare function table(columns: Column[], rows: string[][]): void;
53
+ /**
54
+ * Print data as formatted JSON and exit.
55
+ */
56
+ export declare function jsonOutput(data: unknown): never;
57
+ /**
58
+ * Log a message only when --verbose is active.
59
+ */
60
+ export declare function verbose(msg: string, globals: GlobalOptions): void;
61
+ /**
62
+ * Unified error handler for catch blocks.
63
+ *
64
+ * - Stops spinner if provided (fail or stop)
65
+ * - Prints error message in red
66
+ * - Exits with code 1
67
+ */
68
+ export declare function handleError(error: unknown, spinner?: Ora): never;
69
+ export {};
70
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAM/B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAkB5D;AAMD;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa/C;AAMD;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAK3E;AAMD,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,CAkB/D;AAMD;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,CAG/C;AAMD;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAIjE;AAMD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,KAAK,CAQhE"}
package/dist/ui.js ADDED
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Shared UI utilities for TasteKit CLI.
3
+ *
4
+ * Centralizes formatting, error handling, and output patterns
5
+ * used across all CLI commands.
6
+ */
7
+ import chalk from 'chalk';
8
+ /**
9
+ * Extract --json and --verbose from the root program options.
10
+ */
11
+ export function getGlobalOptions(cmd) {
12
+ let current = cmd;
13
+ let json = false;
14
+ let verbose = false;
15
+ // Commander nests options by command level. Walk parents so both
16
+ // `tastekit --json skills list` and `tastekit skills list --json` work.
17
+ while (current) {
18
+ const opts = current.opts();
19
+ json = json || Boolean(opts.json);
20
+ verbose = verbose || Boolean(opts.verbose);
21
+ current = current.parent;
22
+ }
23
+ return {
24
+ json,
25
+ verbose,
26
+ };
27
+ }
28
+ // ---------------------------------------------------------------------------
29
+ // Colors & risk
30
+ // ---------------------------------------------------------------------------
31
+ /**
32
+ * Return a chalk-colored string for a risk/severity level.
33
+ */
34
+ export function riskColor(level) {
35
+ switch (level) {
36
+ case 'high':
37
+ case 'critical':
38
+ case 'error':
39
+ return chalk.red(level);
40
+ case 'medium':
41
+ case 'med':
42
+ case 'warn':
43
+ return chalk.yellow(level);
44
+ default:
45
+ return chalk.green(level);
46
+ }
47
+ }
48
+ // ---------------------------------------------------------------------------
49
+ // Section formatting
50
+ // ---------------------------------------------------------------------------
51
+ /**
52
+ * Print a bold section header with surrounding newlines.
53
+ */
54
+ export function header(title) {
55
+ console.log(chalk.bold(`\n${title}\n`));
56
+ }
57
+ /**
58
+ * Print a labeled detail line (indented).
59
+ */
60
+ export function detail(label, value) {
61
+ console.log(` ${chalk.gray(label + ':')} ${value}`);
62
+ }
63
+ /**
64
+ * Print a "Run <cmd> to <desc>" hint.
65
+ */
66
+ export function hint(cmd, desc) {
67
+ console.log(chalk.cyan(' Run ') + chalk.bold(cmd) + chalk.cyan(` to ${desc}`));
68
+ }
69
+ /**
70
+ * Print a block of next-step hints.
71
+ */
72
+ export function nextSteps(hints) {
73
+ console.log('\nNext steps:');
74
+ for (const h of hints) {
75
+ hint(h.cmd, h.desc);
76
+ }
77
+ }
78
+ /**
79
+ * Print a simple columnar table with header and rows.
80
+ *
81
+ * Color is applied AFTER padding so ANSI codes don't break alignment.
82
+ * Each cell value should be a plain string; use `colorFn` in the row data
83
+ * if you need color on specific cells (apply after this renders).
84
+ */
85
+ export function table(columns, rows) {
86
+ // Header
87
+ const headerLine = columns
88
+ .map(c => c.label.padEnd(c.width))
89
+ .join(' ');
90
+ console.log(chalk.gray(' ' + headerLine));
91
+ console.log(chalk.gray(' ' + columns.map(c => '─'.repeat(c.width)).join(' ')));
92
+ // Rows
93
+ for (const row of rows) {
94
+ const line = columns
95
+ .map((c, i) => {
96
+ const val = (row[i] ?? '').slice(0, c.width);
97
+ return c.align === 'right' ? val.padStart(c.width) : val.padEnd(c.width);
98
+ })
99
+ .join(' ');
100
+ console.log(' ' + line);
101
+ }
102
+ }
103
+ // ---------------------------------------------------------------------------
104
+ // JSON output
105
+ // ---------------------------------------------------------------------------
106
+ /**
107
+ * Print data as formatted JSON and exit.
108
+ */
109
+ export function jsonOutput(data) {
110
+ console.log(JSON.stringify(data, null, 2));
111
+ process.exit(0);
112
+ }
113
+ // ---------------------------------------------------------------------------
114
+ // Verbose logging
115
+ // ---------------------------------------------------------------------------
116
+ /**
117
+ * Log a message only when --verbose is active.
118
+ */
119
+ export function verbose(msg, globals) {
120
+ if (globals.verbose) {
121
+ console.error(chalk.gray(`[verbose] ${msg}`));
122
+ }
123
+ }
124
+ // ---------------------------------------------------------------------------
125
+ // Error handling
126
+ // ---------------------------------------------------------------------------
127
+ /**
128
+ * Unified error handler for catch blocks.
129
+ *
130
+ * - Stops spinner if provided (fail or stop)
131
+ * - Prints error message in red
132
+ * - Exits with code 1
133
+ */
134
+ export function handleError(error, spinner) {
135
+ const message = error instanceof Error ? error.message : String(error);
136
+ if (spinner) {
137
+ spinner.fail(chalk.red(message));
138
+ }
139
+ else {
140
+ console.error(chalk.red(message));
141
+ }
142
+ process.exit(1);
143
+ }
144
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,IAAI,OAAO,GAA+B,GAAG,CAAC;IAC9C,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,iEAAiE;IACjE,wEAAwE;IACxE,OAAO,OAAO,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,GAAG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACl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
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@actrun_ai/tastekit-cli",
3
+ "version": "0.1.0",
4
+ "description": "TasteKit CLI - command-line interface for taste compilation and management",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "TasteKit Contributors",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/tastekit/tastekit.git",
11
+ "directory": "packages/cli"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "bin": {
22
+ "tastekit": "./dist/cli.js"
23
+ },
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "test": "pnpm run build && vitest run",
27
+ "test:integration": "pnpm run build && vitest run tests/integration",
28
+ "lint": "eslint src/",
29
+ "clean": "rm -rf dist"
30
+ },
31
+ "dependencies": {
32
+ "@actrun_ai/tastekit-adapters": "workspace:*",
33
+ "@actrun_ai/tastekit-core": "workspace:*",
34
+ "chalk": "^5.3.0",
35
+ "commander": "^12.0.0",
36
+ "inquirer": "^10.0.0",
37
+ "ora": "^8.0.0",
38
+ "uuid": "^13.0.0",
39
+ "yaml": "^2.8.2"
40
+ },
41
+ "optionalDependencies": {
42
+ "@actrun_ai/tastekit-voice": "workspace:*"
43
+ },
44
+ "devDependencies": {
45
+ "@types/inquirer": "^9.0.0",
46
+ "@types/node": "^22.0.0",
47
+ "@types/uuid": "^11.0.0",
48
+ "typescript": "^5.6.0",
49
+ "vitest": "^2.0.0"
50
+ }
51
+ }