@aiready/core 0.23.2 → 0.23.4

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 (79) hide show
  1. package/dist/__tests__/parser-factory.test.d.ts +1 -1
  2. package/dist/__tests__/parser-factory.test.js +62 -50
  3. package/dist/__tests__/python-parser.test.d.ts +1 -1
  4. package/dist/__tests__/python-parser.test.js +111 -109
  5. package/dist/__tests__/scoring.test.d.ts +1 -1
  6. package/dist/__tests__/scoring.test.js +193 -176
  7. package/dist/chunk-3YI4IS3D.mjs +191 -173
  8. package/dist/chunk-5HIXDC3X.mjs +273 -251
  9. package/dist/chunk-5V3L53AE.mjs +805 -0
  10. package/dist/chunk-CKVKHN3G.mjs +228 -211
  11. package/dist/chunk-COHIBX3Q.mjs +213 -195
  12. package/dist/chunk-CWRCDSKZ.mjs +91 -82
  13. package/dist/chunk-D3D3NCRR.mjs +147 -129
  14. package/dist/chunk-HCFYP7UD.mjs +805 -0
  15. package/dist/chunk-HFLFBA6F.mjs +79 -72
  16. package/dist/chunk-HKSARRCD.mjs +66 -58
  17. package/dist/chunk-JJ5JL5FX.mjs +91 -82
  18. package/dist/chunk-KDSTXVLQ.mjs +724 -0
  19. package/dist/chunk-KI7XORTN.mjs +91 -82
  20. package/dist/chunk-LTMHFNFK.mjs +690 -0
  21. package/dist/chunk-LTNXTXRI.mjs +228 -211
  22. package/dist/chunk-M22BXHBR.mjs +805 -0
  23. package/dist/chunk-MH3A3LX6.mjs +200 -182
  24. package/dist/chunk-NGHT7JOG.mjs +697 -0
  25. package/dist/chunk-OQ6IGDXG.mjs +147 -129
  26. package/dist/chunk-QAFB3HXQ.mjs +181 -165
  27. package/dist/chunk-QQBKXHLU.mjs +678 -0
  28. package/dist/chunk-RDHYGES7.mjs +678 -0
  29. package/dist/chunk-SWTDBVYJ.mjs +228 -213
  30. package/dist/chunk-UIWL5JQB.mjs +79 -72
  31. package/dist/chunk-UQGI67WR.mjs +79 -72
  32. package/dist/chunk-UTZOO4XO.mjs +147 -131
  33. package/dist/chunk-X4F46I5L.mjs +213 -195
  34. package/dist/chunk-XKK7YHPX.mjs +204 -186
  35. package/dist/chunk-YCA4FTEK.mjs +190 -172
  36. package/dist/chunk-ZSZRRTJM.mjs +719 -0
  37. package/dist/client-BgmiMoil.d.mts +1344 -0
  38. package/dist/client-BgmiMoil.d.ts +1344 -0
  39. package/dist/client-BxGrPuuN.d.mts +1191 -0
  40. package/dist/client-BxGrPuuN.d.ts +1191 -0
  41. package/dist/client-D-cn9ydj.d.mts +1136 -0
  42. package/dist/client-D-cn9ydj.d.ts +1136 -0
  43. package/dist/client-D9seCH4K.d.mts +1334 -0
  44. package/dist/client-D9seCH4K.d.ts +1334 -0
  45. package/dist/client-DIXIh7rw.d.mts +1193 -0
  46. package/dist/client-DIXIh7rw.d.ts +1193 -0
  47. package/dist/client-DVHXWOHw.d.mts +1245 -0
  48. package/dist/client-DVHXWOHw.d.ts +1245 -0
  49. package/dist/client.d.mts +2 -1098
  50. package/dist/client.d.ts +2 -1098
  51. package/dist/client.js +23 -43
  52. package/dist/client.mjs +3 -25
  53. package/dist/index.d.mts +329 -107
  54. package/dist/index.d.ts +329 -107
  55. package/dist/index.js +329 -340
  56. package/dist/index.mjs +305 -322
  57. package/dist/parsers/parser-factory.d.ts +45 -45
  58. package/dist/parsers/parser-factory.js +86 -84
  59. package/dist/parsers/python-parser.d.ts +33 -28
  60. package/dist/parsers/python-parser.js +224 -222
  61. package/dist/parsers/typescript-parser.d.ts +15 -10
  62. package/dist/parsers/typescript-parser.js +223 -197
  63. package/dist/scoring.d.ts +59 -49
  64. package/dist/scoring.js +129 -127
  65. package/dist/types/language.d.ts +104 -93
  66. package/dist/types/language.js +23 -23
  67. package/dist/types.d.ts +105 -87
  68. package/dist/types.js +1 -1
  69. package/dist/utils/ast-parser.d.ts +42 -33
  70. package/dist/utils/ast-parser.js +159 -162
  71. package/dist/utils/cli-helpers.d.ts +27 -10
  72. package/dist/utils/cli-helpers.js +45 -43
  73. package/dist/utils/config.d.ts +8 -3
  74. package/dist/utils/config.js +67 -69
  75. package/dist/utils/file-scanner.d.ts +1 -1
  76. package/dist/utils/file-scanner.js +80 -76
  77. package/dist/utils/metrics.d.ts +1 -1
  78. package/dist/utils/metrics.js +2 -2
  79. package/package.json +1 -1
@@ -3,214 +3,211 @@ import { parse } from '@typescript-eslint/typescript-estree';
3
3
  * Parse TypeScript/JavaScript file and extract exports with their import dependencies
4
4
  */
5
5
  export function parseFileExports(code, filePath) {
6
- try {
7
- const ast = parse(code, {
8
- loc: true,
9
- range: true,
10
- jsx: filePath.endsWith('.tsx') || filePath.endsWith('.jsx'),
11
- filePath,
12
- });
13
- const imports = extractFileImports(ast);
14
- const exports = extractExportsWithDependencies(ast, imports);
15
- return { exports, imports };
16
- }
17
- catch (error) {
18
- // Fallback to empty if parsing fails
19
- return { exports: [], imports: [] };
20
- }
6
+ try {
7
+ const ast = parse(code, {
8
+ loc: true,
9
+ range: true,
10
+ jsx: filePath.endsWith('.tsx') || filePath.endsWith('.jsx'),
11
+ filePath,
12
+ });
13
+ const imports = extractFileImports(ast);
14
+ const exports = extractExportsWithDependencies(ast, imports);
15
+ return { exports, imports };
16
+ } catch (error) {
17
+ // Fallback to empty if parsing fails
18
+ return { exports: [], imports: [] };
19
+ }
21
20
  }
22
21
  /**
23
22
  * Extract all imports from the file
24
23
  */
25
24
  function extractFileImports(ast) {
26
- const imports = [];
27
- for (const node of ast.body) {
28
- if (node.type === 'ImportDeclaration') {
29
- const source = node.source.value;
30
- const specifiers = [];
31
- const isTypeOnly = node.importKind === 'type';
32
- for (const spec of node.specifiers) {
33
- if (spec.type === 'ImportSpecifier') {
34
- const imported = spec.imported;
35
- const importName = imported.type === 'Identifier' ? imported.name : imported.value;
36
- specifiers.push(importName);
37
- }
38
- else if (spec.type === 'ImportDefaultSpecifier') {
39
- specifiers.push('default');
40
- }
41
- else if (spec.type === 'ImportNamespaceSpecifier') {
42
- specifiers.push('*');
43
- }
44
- }
45
- imports.push({ source, specifiers, isTypeOnly });
25
+ const imports = [];
26
+ for (const node of ast.body) {
27
+ if (node.type === 'ImportDeclaration') {
28
+ const source = node.source.value;
29
+ const specifiers = [];
30
+ const isTypeOnly = node.importKind === 'type';
31
+ for (const spec of node.specifiers) {
32
+ if (spec.type === 'ImportSpecifier') {
33
+ const imported = spec.imported;
34
+ const importName =
35
+ imported.type === 'Identifier' ? imported.name : imported.value;
36
+ specifiers.push(importName);
37
+ } else if (spec.type === 'ImportDefaultSpecifier') {
38
+ specifiers.push('default');
39
+ } else if (spec.type === 'ImportNamespaceSpecifier') {
40
+ specifiers.push('*');
46
41
  }
42
+ }
43
+ imports.push({ source, specifiers, isTypeOnly });
47
44
  }
48
- return imports;
45
+ }
46
+ return imports;
49
47
  }
50
48
  /**
51
49
  * Extract exports and their import dependencies
52
50
  */
53
51
  function extractExportsWithDependencies(ast, fileImports) {
54
- const exports = [];
55
- const importedNames = new Set(fileImports.flatMap(imp => imp.specifiers));
56
- for (const node of ast.body) {
57
- if (node.type === 'ExportNamedDeclaration') {
58
- if (node.declaration) {
59
- const exportNodes = extractFromDeclaration(node.declaration);
60
- for (const exp of exportNodes) {
61
- const usedImports = findUsedImports(node.declaration, importedNames);
62
- const typeReferences = extractTypeReferences(node.declaration);
63
- exports.push({
64
- ...exp,
65
- imports: usedImports,
66
- dependencies: [],
67
- typeReferences,
68
- loc: node.loc,
69
- });
70
- }
71
- }
72
- }
73
- else if (node.type === 'ExportDefaultDeclaration') {
74
- const usedImports = findUsedImports(node.declaration, importedNames);
75
- const typeReferences = extractTypeReferences(node.declaration);
76
- exports.push({
77
- name: 'default',
78
- type: 'default',
79
- imports: usedImports,
80
- dependencies: [],
81
- typeReferences,
82
- loc: node.loc,
83
- });
52
+ const exports = [];
53
+ const importedNames = new Set(fileImports.flatMap((imp) => imp.specifiers));
54
+ for (const node of ast.body) {
55
+ if (node.type === 'ExportNamedDeclaration') {
56
+ if (node.declaration) {
57
+ const exportNodes = extractFromDeclaration(node.declaration);
58
+ for (const exp of exportNodes) {
59
+ const usedImports = findUsedImports(node.declaration, importedNames);
60
+ const typeReferences = extractTypeReferences(node.declaration);
61
+ exports.push({
62
+ ...exp,
63
+ imports: usedImports,
64
+ dependencies: [],
65
+ typeReferences,
66
+ loc: node.loc,
67
+ });
84
68
  }
69
+ }
70
+ } else if (node.type === 'ExportDefaultDeclaration') {
71
+ const usedImports = findUsedImports(node.declaration, importedNames);
72
+ const typeReferences = extractTypeReferences(node.declaration);
73
+ exports.push({
74
+ name: 'default',
75
+ type: 'default',
76
+ imports: usedImports,
77
+ dependencies: [],
78
+ typeReferences,
79
+ loc: node.loc,
80
+ });
85
81
  }
86
- return exports;
82
+ }
83
+ return exports;
87
84
  }
88
85
  /**
89
86
  * Extract export information from a declaration
90
87
  */
91
88
  function extractFromDeclaration(declaration) {
92
- const results = [];
93
- if (declaration.type === 'FunctionDeclaration' && 'id' in declaration && declaration.id) {
94
- results.push({ name: declaration.id.name, type: 'function' });
95
- }
96
- else if (declaration.type === 'ClassDeclaration' && 'id' in declaration && declaration.id) {
97
- results.push({ name: declaration.id.name, type: 'class' });
98
- }
99
- else if (declaration.type === 'VariableDeclaration') {
100
- for (const declarator of declaration.declarations) {
101
- if (declarator.id.type === 'Identifier') {
102
- results.push({ name: declarator.id.name, type: 'const' });
103
- }
104
- }
105
- }
106
- else if (declaration.type === 'TSTypeAliasDeclaration') {
107
- results.push({ name: declaration.id.name, type: 'type' });
108
- }
109
- else if (declaration.type === 'TSInterfaceDeclaration') {
110
- results.push({ name: declaration.id.name, type: 'interface' });
89
+ const results = [];
90
+ if (
91
+ declaration.type === 'FunctionDeclaration' &&
92
+ 'id' in declaration &&
93
+ declaration.id
94
+ ) {
95
+ results.push({ name: declaration.id.name, type: 'function' });
96
+ } else if (
97
+ declaration.type === 'ClassDeclaration' &&
98
+ 'id' in declaration &&
99
+ declaration.id
100
+ ) {
101
+ results.push({ name: declaration.id.name, type: 'class' });
102
+ } else if (declaration.type === 'VariableDeclaration') {
103
+ for (const declarator of declaration.declarations) {
104
+ if (declarator.id.type === 'Identifier') {
105
+ results.push({ name: declarator.id.name, type: 'const' });
106
+ }
111
107
  }
112
- return results;
108
+ } else if (declaration.type === 'TSTypeAliasDeclaration') {
109
+ results.push({ name: declaration.id.name, type: 'type' });
110
+ } else if (declaration.type === 'TSInterfaceDeclaration') {
111
+ results.push({ name: declaration.id.name, type: 'interface' });
112
+ }
113
+ return results;
113
114
  }
114
115
  /**
115
116
  * Find which imports are used within a node
116
117
  */
117
118
  function findUsedImports(node, importedNames) {
118
- const usedImports = new Set();
119
- function visit(n) {
120
- if (n.type === 'Identifier' && importedNames.has(n.name)) {
121
- usedImports.add(n.name);
122
- }
123
- // Recursively visit child nodes
124
- for (const key in n) {
125
- const value = n[key];
126
- if (value && typeof value === 'object') {
127
- if (Array.isArray(value)) {
128
- value.forEach(child => {
129
- if (child && typeof child === 'object' && 'type' in child) {
130
- visit(child);
131
- }
132
- });
133
- }
134
- else if ('type' in value) {
135
- visit(value);
136
- }
119
+ const usedImports = new Set();
120
+ function visit(n) {
121
+ if (n.type === 'Identifier' && importedNames.has(n.name)) {
122
+ usedImports.add(n.name);
123
+ }
124
+ // Recursively visit child nodes
125
+ for (const key in n) {
126
+ const value = n[key];
127
+ if (value && typeof value === 'object') {
128
+ if (Array.isArray(value)) {
129
+ value.forEach((child) => {
130
+ if (child && typeof child === 'object' && 'type' in child) {
131
+ visit(child);
137
132
  }
133
+ });
134
+ } else if ('type' in value) {
135
+ visit(value);
138
136
  }
137
+ }
139
138
  }
140
- visit(node);
141
- return Array.from(usedImports);
139
+ }
140
+ visit(node);
141
+ return Array.from(usedImports);
142
142
  }
143
143
  /**
144
144
  * Calculate import-based similarity between two exports (Jaccard index)
145
145
  */
146
146
  export function calculateImportSimilarity(export1, export2) {
147
- if (export1.imports.length === 0 && export2.imports.length === 0) {
148
- return 1; // Both have no imports = perfectly similar
149
- }
150
- const set1 = new Set(export1.imports);
151
- const set2 = new Set(export2.imports);
152
- const intersection = new Set([...set1].filter(x => set2.has(x)));
153
- const union = new Set([...set1, ...set2]);
154
- return intersection.size / union.size;
147
+ if (export1.imports.length === 0 && export2.imports.length === 0) {
148
+ return 1; // Both have no imports = perfectly similar
149
+ }
150
+ const set1 = new Set(export1.imports);
151
+ const set2 = new Set(export2.imports);
152
+ const intersection = new Set([...set1].filter((x) => set2.has(x)));
153
+ const union = new Set([...set1, ...set2]);
154
+ return intersection.size / union.size;
155
155
  }
156
156
  /**
157
157
  * Extract TypeScript type references from a node
158
158
  * Collects all type identifiers used in type annotations
159
159
  */
160
160
  function extractTypeReferences(node) {
161
- const types = new Set();
162
- function visit(n) {
163
- if (!n || typeof n !== 'object')
164
- return;
165
- // Type references
166
- if (n.type === 'TSTypeReference' && n.typeName) {
167
- if (n.typeName.type === 'Identifier') {
168
- types.add(n.typeName.name);
169
- }
170
- else if (n.typeName.type === 'TSQualifiedName') {
171
- // Handle qualified names like A.B.C
172
- let current = n.typeName;
173
- while (current.type === 'TSQualifiedName') {
174
- if (current.right?.type === 'Identifier') {
175
- types.add(current.right.name);
176
- }
177
- current = current.left;
178
- }
179
- if (current.type === 'Identifier') {
180
- types.add(current.name);
181
- }
182
- }
161
+ const types = new Set();
162
+ function visit(n) {
163
+ if (!n || typeof n !== 'object') return;
164
+ // Type references
165
+ if (n.type === 'TSTypeReference' && n.typeName) {
166
+ if (n.typeName.type === 'Identifier') {
167
+ types.add(n.typeName.name);
168
+ } else if (n.typeName.type === 'TSQualifiedName') {
169
+ // Handle qualified names like A.B.C
170
+ let current = n.typeName;
171
+ while (current.type === 'TSQualifiedName') {
172
+ if (current.right?.type === 'Identifier') {
173
+ types.add(current.right.name);
174
+ }
175
+ current = current.left;
183
176
  }
184
- // Interface references
185
- if (n.type === 'TSInterfaceHeritage' && n.expression) {
186
- if (n.expression.type === 'Identifier') {
187
- types.add(n.expression.name);
188
- }
189
- }
190
- // Recursively visit children
191
- for (const key of Object.keys(n)) {
192
- const value = n[key];
193
- if (Array.isArray(value)) {
194
- value.forEach(visit);
195
- }
196
- else if (value && typeof value === 'object') {
197
- visit(value);
198
- }
177
+ if (current.type === 'Identifier') {
178
+ types.add(current.name);
199
179
  }
180
+ }
181
+ }
182
+ // Interface references
183
+ if (n.type === 'TSInterfaceHeritage' && n.expression) {
184
+ if (n.expression.type === 'Identifier') {
185
+ types.add(n.expression.name);
186
+ }
187
+ }
188
+ // Recursively visit children
189
+ for (const key of Object.keys(n)) {
190
+ const value = n[key];
191
+ if (Array.isArray(value)) {
192
+ value.forEach(visit);
193
+ } else if (value && typeof value === 'object') {
194
+ visit(value);
195
+ }
200
196
  }
201
- visit(node);
202
- return Array.from(types);
197
+ }
198
+ visit(node);
199
+ return Array.from(types);
203
200
  }
204
201
  export function parseCode(code, language) {
205
- // Deprecated: Use parseFileExports instead
206
- return null;
202
+ // Deprecated: Use parseFileExports instead
203
+ return null;
207
204
  }
208
205
  export function extractFunctions(ast) {
209
- // Deprecated
210
- return [];
206
+ // Deprecated
207
+ return [];
211
208
  }
212
209
  export function extractImports(ast) {
213
- // Deprecated
214
- return [];
210
+ // Deprecated
211
+ return [];
215
212
  }
216
- //# sourceMappingURL=ast-parser.js.map
213
+ //# sourceMappingURL=ast-parser.js.map
@@ -2,10 +2,10 @@
2
2
  * Common CLI configuration interface
3
3
  */
4
4
  export interface CLIOptions {
5
- rootDir: string;
6
- include?: string[];
7
- exclude?: string[];
8
- [key: string]: any;
5
+ rootDir: string;
6
+ include?: string[];
7
+ exclude?: string[];
8
+ [key: string]: any;
9
9
  }
10
10
  /**
11
11
  * Resolve output file path, defaulting to .aiready directory
@@ -15,23 +15,40 @@ export interface CLIOptions {
15
15
  * @param workingDir - Working directory (default: process.cwd())
16
16
  * @returns Resolved absolute path
17
17
  */
18
- export declare function resolveOutputPath(userPath: string | undefined, defaultFilename: string, workingDir?: string): string;
18
+ export declare function resolveOutputPath(
19
+ userPath: string | undefined,
20
+ defaultFilename: string,
21
+ workingDir?: string
22
+ ): string;
19
23
  /**
20
24
  * Load and merge configuration with CLI options
21
25
  */
22
- export declare function loadMergedConfig<T extends Record<string, any>>(directory: string, defaults: T, cliOptions: Partial<T>): Promise<T & {
26
+ export declare function loadMergedConfig<T extends Record<string, any>>(
27
+ directory: string,
28
+ defaults: T,
29
+ cliOptions: Partial<T>
30
+ ): Promise<
31
+ T & {
23
32
  rootDir: string;
24
- }>;
33
+ }
34
+ >;
25
35
  /**
26
36
  * Handle JSON output for CLI commands
27
37
  */
28
- export declare function handleJSONOutput(data: any, outputFile?: string, successMessage?: string): void;
38
+ export declare function handleJSONOutput(
39
+ data: any,
40
+ outputFile?: string,
41
+ successMessage?: string
42
+ ): void;
29
43
  /**
30
44
  * Common error handler for CLI commands
31
45
  */
32
- export declare function handleCLIError(error: unknown, commandName: string): never;
46
+ export declare function handleCLIError(
47
+ error: unknown,
48
+ commandName: string
49
+ ): never;
33
50
  /**
34
51
  * Calculate elapsed time and format for display
35
52
  */
36
53
  export declare function getElapsedTime(startTime: number): string;
37
- //# sourceMappingURL=cli-helpers.d.ts.map
54
+ //# sourceMappingURL=cli-helpers.d.ts.map
@@ -9,68 +9,70 @@ import { loadConfig, mergeConfigWithDefaults } from '../index';
9
9
  * @param workingDir - Working directory (default: process.cwd())
10
10
  * @returns Resolved absolute path
11
11
  */
12
- export function resolveOutputPath(userPath, defaultFilename, workingDir = process.cwd()) {
13
- let outputPath;
14
- if (userPath) {
15
- // User provided a path, use it as-is
16
- outputPath = userPath;
17
- }
18
- else {
19
- // Default to .aiready directory
20
- const aireadyDir = join(workingDir, '.aiready');
21
- outputPath = join(aireadyDir, defaultFilename);
22
- }
23
- // Ensure parent directory exists (works for both default and custom paths)
24
- const parentDir = dirname(outputPath);
25
- if (!existsSync(parentDir)) {
26
- mkdirSync(parentDir, { recursive: true });
27
- }
28
- return outputPath;
12
+ export function resolveOutputPath(
13
+ userPath,
14
+ defaultFilename,
15
+ workingDir = process.cwd()
16
+ ) {
17
+ let outputPath;
18
+ if (userPath) {
19
+ // User provided a path, use it as-is
20
+ outputPath = userPath;
21
+ } else {
22
+ // Default to .aiready directory
23
+ const aireadyDir = join(workingDir, '.aiready');
24
+ outputPath = join(aireadyDir, defaultFilename);
25
+ }
26
+ // Ensure parent directory exists (works for both default and custom paths)
27
+ const parentDir = dirname(outputPath);
28
+ if (!existsSync(parentDir)) {
29
+ mkdirSync(parentDir, { recursive: true });
30
+ }
31
+ return outputPath;
29
32
  }
30
33
  /**
31
34
  * Load and merge configuration with CLI options
32
35
  */
33
36
  export async function loadMergedConfig(directory, defaults, cliOptions) {
34
- // Load config file if it exists
35
- const config = await loadConfig(directory);
36
- // Merge config with defaults
37
- const mergedConfig = mergeConfigWithDefaults(config, defaults);
38
- // Override with CLI options (CLI takes precedence)
39
- const result = {
40
- ...mergedConfig,
41
- ...cliOptions,
42
- rootDir: directory,
43
- };
44
- return result;
37
+ // Load config file if it exists
38
+ const config = await loadConfig(directory);
39
+ // Merge config with defaults
40
+ const mergedConfig = mergeConfigWithDefaults(config, defaults);
41
+ // Override with CLI options (CLI takes precedence)
42
+ const result = {
43
+ ...mergedConfig,
44
+ ...cliOptions,
45
+ rootDir: directory,
46
+ };
47
+ return result;
45
48
  }
46
49
  /**
47
50
  * Handle JSON output for CLI commands
48
51
  */
49
52
  export function handleJSONOutput(data, outputFile, successMessage) {
50
- if (outputFile) {
51
- // Ensure directory exists
52
- const dir = dirname(outputFile);
53
- if (!existsSync(dir)) {
54
- mkdirSync(dir, { recursive: true });
55
- }
56
- writeFileSync(outputFile, JSON.stringify(data, null, 2));
57
- console.log(successMessage || `✅ Results saved to ${outputFile}`);
58
- }
59
- else {
60
- console.log(JSON.stringify(data, null, 2));
53
+ if (outputFile) {
54
+ // Ensure directory exists
55
+ const dir = dirname(outputFile);
56
+ if (!existsSync(dir)) {
57
+ mkdirSync(dir, { recursive: true });
61
58
  }
59
+ writeFileSync(outputFile, JSON.stringify(data, null, 2));
60
+ console.log(successMessage || `✅ Results saved to ${outputFile}`);
61
+ } else {
62
+ console.log(JSON.stringify(data, null, 2));
63
+ }
62
64
  }
63
65
  /**
64
66
  * Common error handler for CLI commands
65
67
  */
66
68
  export function handleCLIError(error, commandName) {
67
- console.error(`❌ ${commandName} failed:`, error);
68
- process.exit(1);
69
+ console.error(`❌ ${commandName} failed:`, error);
70
+ process.exit(1);
69
71
  }
70
72
  /**
71
73
  * Calculate elapsed time and format for display
72
74
  */
73
75
  export function getElapsedTime(startTime) {
74
- return ((Date.now() - startTime) / 1000).toFixed(2);
76
+ return ((Date.now() - startTime) / 1000).toFixed(2);
75
77
  }
76
- //# sourceMappingURL=cli-helpers.js.map
78
+ //# sourceMappingURL=cli-helpers.js.map
@@ -1,4 +1,9 @@
1
1
  import type { AIReadyConfig } from '../types';
2
- export declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
3
- export declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
4
- //# sourceMappingURL=config.d.ts.map
2
+ export declare function loadConfig(
3
+ rootDir: string
4
+ ): Promise<AIReadyConfig | null>;
5
+ export declare function mergeConfigWithDefaults(
6
+ userConfig: AIReadyConfig | null,
7
+ defaults: any
8
+ ): any;
9
+ //# sourceMappingURL=config.d.ts.map