@aiready/core 0.23.4 → 0.23.6

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 (109) hide show
  1. package/dist/{chunk-NGHT7JOG.mjs → chunk-Q55AMEFV.mjs} +63 -0
  2. package/dist/{client-D-cn9ydj.d.mts → client-CKcjnPXt.d.mts} +79 -1
  3. package/dist/{client-D-cn9ydj.d.ts → client-CKcjnPXt.d.ts} +79 -1
  4. package/dist/client.d.mts +1 -1
  5. package/dist/client.d.ts +1 -1
  6. package/dist/client.js +66 -0
  7. package/dist/client.mjs +9 -1
  8. package/dist/index.d.mts +10 -2
  9. package/dist/index.d.ts +10 -2
  10. package/dist/index.js +159 -21
  11. package/dist/index.mjs +102 -22
  12. package/package.json +1 -1
  13. package/dist/__tests__/parser-factory.test.d.ts +0 -5
  14. package/dist/__tests__/parser-factory.test.d.ts.map +0 -1
  15. package/dist/__tests__/parser-factory.test.js +0 -70
  16. package/dist/__tests__/parser-factory.test.js.map +0 -1
  17. package/dist/__tests__/python-parser.test.d.ts +0 -5
  18. package/dist/__tests__/python-parser.test.d.ts.map +0 -1
  19. package/dist/__tests__/python-parser.test.js +0 -194
  20. package/dist/__tests__/python-parser.test.js.map +0 -1
  21. package/dist/__tests__/scoring.test.d.ts +0 -2
  22. package/dist/__tests__/scoring.test.d.ts.map +0 -1
  23. package/dist/__tests__/scoring.test.js +0 -197
  24. package/dist/__tests__/scoring.test.js.map +0 -1
  25. package/dist/chunk-3YI4IS3D.mjs +0 -601
  26. package/dist/chunk-5HIXDC3X.mjs +0 -716
  27. package/dist/chunk-5V3L53AE.mjs +0 -805
  28. package/dist/chunk-CKVKHN3G.mjs +0 -660
  29. package/dist/chunk-COHIBX3Q.mjs +0 -635
  30. package/dist/chunk-CWRCDSKZ.mjs +0 -417
  31. package/dist/chunk-D3D3NCRR.mjs +0 -556
  32. package/dist/chunk-HCFYP7UD.mjs +0 -805
  33. package/dist/chunk-HFLFBA6F.mjs +0 -417
  34. package/dist/chunk-HKSARRCD.mjs +0 -365
  35. package/dist/chunk-JJ5JL5FX.mjs +0 -417
  36. package/dist/chunk-KDSTXVLQ.mjs +0 -724
  37. package/dist/chunk-KI7XORTN.mjs +0 -417
  38. package/dist/chunk-LTMHFNFK.mjs +0 -690
  39. package/dist/chunk-LTNXTXRI.mjs +0 -659
  40. package/dist/chunk-M22BXHBR.mjs +0 -805
  41. package/dist/chunk-MH3A3LX6.mjs +0 -615
  42. package/dist/chunk-OQ6IGDXG.mjs +0 -553
  43. package/dist/chunk-QAFB3HXQ.mjs +0 -590
  44. package/dist/chunk-QQBKXHLU.mjs +0 -678
  45. package/dist/chunk-RDHYGES7.mjs +0 -678
  46. package/dist/chunk-SWTDBVYJ.mjs +0 -660
  47. package/dist/chunk-UIWL5JQB.mjs +0 -417
  48. package/dist/chunk-UQGI67WR.mjs +0 -417
  49. package/dist/chunk-UTZOO4XO.mjs +0 -553
  50. package/dist/chunk-X4F46I5L.mjs +0 -635
  51. package/dist/chunk-XKK7YHPX.mjs +0 -619
  52. package/dist/chunk-YCA4FTEK.mjs +0 -600
  53. package/dist/chunk-ZSZRRTJM.mjs +0 -719
  54. package/dist/client-BgmiMoil.d.mts +0 -1344
  55. package/dist/client-BgmiMoil.d.ts +0 -1344
  56. package/dist/client-BxGrPuuN.d.mts +0 -1191
  57. package/dist/client-BxGrPuuN.d.ts +0 -1191
  58. package/dist/client-D9seCH4K.d.mts +0 -1334
  59. package/dist/client-D9seCH4K.d.ts +0 -1334
  60. package/dist/client-DIXIh7rw.d.mts +0 -1193
  61. package/dist/client-DIXIh7rw.d.ts +0 -1193
  62. package/dist/client-DVHXWOHw.d.mts +0 -1245
  63. package/dist/client-DVHXWOHw.d.ts +0 -1245
  64. package/dist/index.d.ts.map +0 -1
  65. package/dist/index.js.map +0 -1
  66. package/dist/parsers/parser-factory.d.ts +0 -69
  67. package/dist/parsers/parser-factory.d.ts.map +0 -1
  68. package/dist/parsers/parser-factory.js +0 -116
  69. package/dist/parsers/parser-factory.js.map +0 -1
  70. package/dist/parsers/python-parser.d.ts +0 -47
  71. package/dist/parsers/python-parser.d.ts.map +0 -1
  72. package/dist/parsers/python-parser.js +0 -243
  73. package/dist/parsers/python-parser.js.map +0 -1
  74. package/dist/parsers/typescript-parser.d.ts +0 -22
  75. package/dist/parsers/typescript-parser.d.ts.map +0 -1
  76. package/dist/parsers/typescript-parser.js +0 -242
  77. package/dist/parsers/typescript-parser.js.map +0 -1
  78. package/dist/scoring.d.ts +0 -120
  79. package/dist/scoring.d.ts.map +0 -1
  80. package/dist/scoring.js +0 -197
  81. package/dist/scoring.js.map +0 -1
  82. package/dist/types/language.d.ts +0 -172
  83. package/dist/types/language.d.ts.map +0 -1
  84. package/dist/types/language.js +0 -45
  85. package/dist/types/language.js.map +0 -1
  86. package/dist/types.d.ts +0 -122
  87. package/dist/types.d.ts.map +0 -1
  88. package/dist/types.js +0 -2
  89. package/dist/types.js.map +0 -1
  90. package/dist/utils/ast-parser.d.ts +0 -59
  91. package/dist/utils/ast-parser.d.ts.map +0 -1
  92. package/dist/utils/ast-parser.js +0 -213
  93. package/dist/utils/ast-parser.js.map +0 -1
  94. package/dist/utils/cli-helpers.d.ts +0 -54
  95. package/dist/utils/cli-helpers.d.ts.map +0 -1
  96. package/dist/utils/cli-helpers.js +0 -78
  97. package/dist/utils/cli-helpers.js.map +0 -1
  98. package/dist/utils/config.d.ts +0 -9
  99. package/dist/utils/config.d.ts.map +0 -1
  100. package/dist/utils/config.js +0 -80
  101. package/dist/utils/config.js.map +0 -1
  102. package/dist/utils/file-scanner.d.ts +0 -16
  103. package/dist/utils/file-scanner.d.ts.map +0 -1
  104. package/dist/utils/file-scanner.js +0 -104
  105. package/dist/utils/file-scanner.js.map +0 -1
  106. package/dist/utils/metrics.d.ts +0 -6
  107. package/dist/utils/metrics.d.ts.map +0 -1
  108. package/dist/utils/metrics.js +0 -8
  109. package/dist/utils/metrics.js.map +0 -1
@@ -1,54 +0,0 @@
1
- /**
2
- * Common CLI configuration interface
3
- */
4
- export interface CLIOptions {
5
- rootDir: string;
6
- include?: string[];
7
- exclude?: string[];
8
- [key: string]: any;
9
- }
10
- /**
11
- * Resolve output file path, defaulting to .aiready directory
12
- * Creates parent directories if they don't exist.
13
- * @param userPath - User-provided output path (optional)
14
- * @param defaultFilename - Default filename to use
15
- * @param workingDir - Working directory (default: process.cwd())
16
- * @returns Resolved absolute path
17
- */
18
- export declare function resolveOutputPath(
19
- userPath: string | undefined,
20
- defaultFilename: string,
21
- workingDir?: string
22
- ): string;
23
- /**
24
- * Load and merge configuration with CLI options
25
- */
26
- export declare function loadMergedConfig<T extends Record<string, any>>(
27
- directory: string,
28
- defaults: T,
29
- cliOptions: Partial<T>
30
- ): Promise<
31
- T & {
32
- rootDir: string;
33
- }
34
- >;
35
- /**
36
- * Handle JSON output for CLI commands
37
- */
38
- export declare function handleJSONOutput(
39
- data: any,
40
- outputFile?: string,
41
- successMessage?: string
42
- ): void;
43
- /**
44
- * Common error handler for CLI commands
45
- */
46
- export declare function handleCLIError(
47
- error: unknown,
48
- commandName: string
49
- ): never;
50
- /**
51
- * Calculate elapsed time and format for display
52
- */
53
- export declare function getElapsedTime(startTime: number): string;
54
- //# sourceMappingURL=cli-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/cli-helpers.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,eAAe,EAAE,MAAM,EACvB,UAAU,GAAE,MAAsB,GACjC,MAAM,CAmBR;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClE,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,EACX,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAelC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,GAAG,EACT,UAAU,CAAC,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CAYN;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,KAAK,CAGzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -1,78 +0,0 @@
1
- import { writeFileSync, mkdirSync, existsSync } from 'fs';
2
- import { join, dirname } from 'path';
3
- import { loadConfig, mergeConfigWithDefaults } from '../index';
4
- /**
5
- * Resolve output file path, defaulting to .aiready directory
6
- * Creates parent directories if they don't exist.
7
- * @param userPath - User-provided output path (optional)
8
- * @param defaultFilename - Default filename to use
9
- * @param workingDir - Working directory (default: process.cwd())
10
- * @returns Resolved absolute path
11
- */
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;
32
- }
33
- /**
34
- * Load and merge configuration with CLI options
35
- */
36
- export async function loadMergedConfig(directory, defaults, cliOptions) {
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;
48
- }
49
- /**
50
- * Handle JSON output for CLI commands
51
- */
52
- export function handleJSONOutput(data, outputFile, successMessage) {
53
- if (outputFile) {
54
- // Ensure directory exists
55
- const dir = dirname(outputFile);
56
- if (!existsSync(dir)) {
57
- mkdirSync(dir, { recursive: true });
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
- }
64
- }
65
- /**
66
- * Common error handler for CLI commands
67
- */
68
- export function handleCLIError(error, commandName) {
69
- console.error(`❌ ${commandName} failed:`, error);
70
- process.exit(1);
71
- }
72
- /**
73
- * Calculate elapsed time and format for display
74
- */
75
- export function getElapsedTime(startTime) {
76
- return ((Date.now() - startTime) / 1000).toFixed(2);
77
- }
78
- //# sourceMappingURL=cli-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-helpers.js","sourceRoot":"","sources":["../../src/utils/cli-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAY/D;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAA4B,EAC5B,eAAuB,EACvB,aAAqB,OAAO,CAAC,GAAG,EAAE;IAElC,IAAI,UAAkB,CAAC;IAEvB,IAAI,QAAQ,EAAE,CAAC;QACb,qCAAq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I,EAAE,CAAC,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,sBAAsB,UAAU,EAAE,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc,EAAE,WAAmB;IAChE,OAAO,CAAC,KAAK,CAAC,KAAK,WAAW,UAAU,EAAE,KAAK,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { AIReadyConfig } from '../types';
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAW9C,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA4C/E;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,aAAa,GAAG,IAAI,EAChC,QAAQ,EAAE,GAAG,GACZ,GAAG,CA+BL"}
@@ -1,80 +0,0 @@
1
- import { readFileSync, existsSync } from 'fs';
2
- import { join, resolve, dirname } from 'path';
3
- import { pathToFileURL } from 'url';
4
- const CONFIG_FILES = [
5
- 'aiready.json',
6
- 'aiready.config.json',
7
- '.aiready.json',
8
- '.aireadyrc.json',
9
- 'aiready.config.js',
10
- '.aireadyrc.js',
11
- ];
12
- export async function loadConfig(rootDir) {
13
- // Search upwards from the provided directory to find the nearest config
14
- let currentDir = resolve(rootDir);
15
- while (true) {
16
- for (const configFile of CONFIG_FILES) {
17
- const configPath = join(currentDir, configFile);
18
- if (existsSync(configPath)) {
19
- try {
20
- let config;
21
- if (configFile.endsWith('.js')) {
22
- // For JS files, use dynamic ES import
23
- const fileUrl = pathToFileURL(configPath).href;
24
- const module = await import(`${fileUrl}?t=${Date.now()}`);
25
- config = module.default || module;
26
- } else {
27
- // For JSON files, parse them
28
- const content = readFileSync(configPath, 'utf-8');
29
- config = JSON.parse(content);
30
- }
31
- // Basic validation
32
- if (typeof config !== 'object' || config === null) {
33
- throw new Error('Config must be an object');
34
- }
35
- return config;
36
- } catch (error) {
37
- const errorMessage =
38
- error instanceof Error ? error.message : String(error);
39
- throw new Error(
40
- `Failed to load config from ${configPath}: ${errorMessage}`
41
- );
42
- }
43
- }
44
- }
45
- const parent = dirname(currentDir);
46
- if (parent === currentDir) {
47
- break; // Reached filesystem root
48
- }
49
- currentDir = parent;
50
- }
51
- return null;
52
- }
53
- export function mergeConfigWithDefaults(userConfig, defaults) {
54
- if (!userConfig) return defaults;
55
- const result = { ...defaults };
56
- // Merge scan options
57
- if (userConfig.scan) {
58
- if (userConfig.scan.include) result.include = userConfig.scan.include;
59
- if (userConfig.scan.exclude) result.exclude = userConfig.scan.exclude;
60
- }
61
- // Merge tool-specific options
62
- if (userConfig.tools) {
63
- for (const [toolName, toolConfig] of Object.entries(userConfig.tools)) {
64
- if (typeof toolConfig === 'object' && toolConfig !== null) {
65
- // For pattern-detect and context-analyzer tools, merge options directly into result
66
- if (toolName === 'pattern-detect' || toolName === 'context-analyzer') {
67
- Object.assign(result, toolConfig);
68
- }
69
- // Add other tool configs under their names for future use
70
- result[toolName] = { ...result[toolName], ...toolConfig };
71
- }
72
- }
73
- }
74
- // Merge output preferences
75
- if (userConfig.output) {
76
- result.output = { ...result.output, ...userConfig.output };
77
- }
78
- return result;
79
- }
80
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,YAAY,GAAG;IACnB,cAAc;IACd,qBAAqB;IACrB,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;CAChB,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,wEAAwE;IACxE,IAAI,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAElC,OAAO,IAAI,EAAE,CAAC;QACZ,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;YACtC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAEhD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC;oBACH,IAAI,MAAqB,CAAC;oBAE1B,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC/B,sCAAsC;wBACtC,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;wBAC/C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,OAAO,MAAM,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;wBAC1D,MAAM,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC;oBACpC,C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OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;IACxE,CAAC;IAED,8BAA8B;IAC9B,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACtE,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;gBAC1D,oFAAoF;gBACpF,IAAI,QAAQ,KAAK,gBAAgB,IAAI,QAAQ,KAAK,kBAAkB,EAAE,CAAC;oBACrE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBACpC,CAAC;gBACD,0DAA0D;gBAC1D,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,EAAE,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;IAC7D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { ScanOptions } from '../types';
2
- export declare const DEFAULT_EXCLUDE: string[];
3
- /**
4
- * Scan files in a directory using glob patterns
5
- *
6
- * Note: This scanner supports multiple languages (.ts, .tsx, .js, .jsx, .py, .java, etc.)
7
- * Individual tools can filter to their supported languages if needed.
8
- *
9
- * @param options - Scan configuration
10
- * @returns Array of absolute file paths matching the patterns
11
- */
12
- export declare function scanFiles(options: ScanOptions): Promise<string[]>;
13
- export declare function readFileContent(filePath: string): Promise<string>;
14
- export declare function getFileExtension(filePath: string): string;
15
- export declare function isSourceFile(filePath: string): boolean;
16
- //# sourceMappingURL=file-scanner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-scanner.d.ts","sourceRoot":"","sources":["../../src/utils/file-scanner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,eAAe,UAkD3B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoCvE;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGtD"}
@@ -1,104 +0,0 @@
1
- import { glob } from 'glob';
2
- import { readFile } from 'fs/promises';
3
- import { existsSync } from 'fs';
4
- import { join } from 'path';
5
- export const DEFAULT_EXCLUDE = [
6
- // Dependencies
7
- '**/node_modules/**',
8
- // Build outputs
9
- '**/dist/**',
10
- '**/build/**',
11
- '**/out/**',
12
- '**/output/**',
13
- '**/target/**',
14
- '**/bin/**',
15
- '**/obj/**',
16
- '**/cdk.out/**',
17
- // Framework-specific build dirs
18
- '**/.next/**',
19
- '**/.nuxt/**',
20
- '**/.vuepress/**',
21
- '**/.cache/**',
22
- '**/.turbo/**',
23
- // Test files and coverage
24
- '**/*.test.*',
25
- '**/*.spec.*',
26
- '**/__tests__/**',
27
- '**/test/**',
28
- '**/tests/**',
29
- '**/coverage/**',
30
- '**/.nyc_output/**',
31
- '**/.jest/**',
32
- // Version control and IDE
33
- '**/.git/**',
34
- '**/.svn/**',
35
- '**/.hg/**',
36
- '**/.vscode/**',
37
- '**/.idea/**',
38
- '**/*.swp',
39
- '**/*.swo',
40
- // Build artifacts and minified files
41
- '**/*.min.js',
42
- '**/*.min.css',
43
- '**/*.bundle.js',
44
- '**/*.tsbuildinfo',
45
- // Logs and temporary files
46
- '**/logs/**',
47
- '**/*.log',
48
- '**/.DS_Store',
49
- ];
50
- /**
51
- * Scan files in a directory using glob patterns
52
- *
53
- * Note: This scanner supports multiple languages (.ts, .tsx, .js, .jsx, .py, .java, etc.)
54
- * Individual tools can filter to their supported languages if needed.
55
- *
56
- * @param options - Scan configuration
57
- * @returns Array of absolute file paths matching the patterns
58
- */
59
- export async function scanFiles(options) {
60
- const {
61
- rootDir,
62
- include = ['**/*.{ts,tsx,js,jsx,py,java,go,rs,cs}'], // Multi-language support
63
- exclude,
64
- } = options;
65
- // Always merge user excludes with defaults to ensure critical paths like
66
- // cdk.out, node_modules, build dirs are excluded
67
- // Load .aireadyignore from repository root if present and merge
68
- const ignoreFilePath = join(rootDir || '.', '.aireadyignore');
69
- let ignoreFromFile = [];
70
- if (existsSync(ignoreFilePath)) {
71
- try {
72
- const txt = await readFile(ignoreFilePath, 'utf-8');
73
- ignoreFromFile = txt
74
- .split(/\r?\n/)
75
- .map((s) => s.trim())
76
- .filter(Boolean)
77
- .filter((l) => !l.startsWith('#'))
78
- .filter((l) => !l.startsWith('!')); // ignore negations for now
79
- } catch (e) {
80
- // noop - fall back to defaults if file can't be read
81
- ignoreFromFile = [];
82
- }
83
- }
84
- const finalExclude = [
85
- ...new Set([...(exclude || []), ...ignoreFromFile, ...DEFAULT_EXCLUDE]),
86
- ];
87
- const files = await glob(include, {
88
- cwd: rootDir,
89
- ignore: finalExclude,
90
- absolute: true,
91
- });
92
- return files;
93
- }
94
- export async function readFileContent(filePath) {
95
- return readFile(filePath, 'utf-8');
96
- }
97
- export function getFileExtension(filePath) {
98
- return filePath.split('.').pop() || '';
99
- }
100
- export function isSourceFile(filePath) {
101
- const ext = getFileExtension(filePath);
102
- return ['ts', 'tsx', 'js', 'jsx', 'py', 'java', 'go', 'rs'].includes(ext);
103
- }
104
- //# sourceMappingURL=file-scanner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file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AAC;IACvC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5E,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Estimate token count for text (rough approximation)
3
- * ~1 token ≈ 4 characters for code
4
- */
5
- export declare function estimateTokens(text: string): number;
6
- //# sourceMappingURL=metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/utils/metrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Estimate token count for text (rough approximation)
3
- * ~1 token ≈ 4 characters for code
4
- */
5
- export function estimateTokens(text) {
6
- return Math.ceil(text.length / 4);
7
- }
8
- //# sourceMappingURL=metrics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/utils/metrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC"}