@aiready/core 0.23.1 → 0.23.3

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 -1094
  50. package/dist/client.d.ts +2 -1094
  51. package/dist/client.js +23 -43
  52. package/dist/client.mjs +3 -25
  53. package/dist/index.d.mts +380 -108
  54. package/dist/index.d.ts +380 -108
  55. package/dist/index.js +609 -445
  56. package/dist/index.mjs +587 -429
  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 +2 -2
package/dist/types.d.ts CHANGED
@@ -1,104 +1,122 @@
1
1
  export interface AnalysisResult {
2
- fileName: string;
3
- issues: Issue[];
4
- metrics: Metrics;
2
+ fileName: string;
3
+ issues: Issue[];
4
+ metrics: Metrics;
5
5
  }
6
6
  export interface Issue {
7
- type: IssueType;
8
- severity: 'critical' | 'major' | 'minor' | 'info';
9
- message: string;
10
- location: Location;
11
- suggestion?: string;
7
+ type: IssueType;
8
+ severity: 'critical' | 'major' | 'minor' | 'info';
9
+ message: string;
10
+ location: Location;
11
+ suggestion?: string;
12
12
  }
13
- export type IssueType = 'duplicate-pattern' | 'context-fragmentation' | 'doc-drift' | 'naming-inconsistency' | 'naming-quality' | 'pattern-inconsistency' | 'architecture-inconsistency' | 'dead-code' | 'circular-dependency' | 'missing-types';
13
+ export type IssueType =
14
+ | 'duplicate-pattern'
15
+ | 'context-fragmentation'
16
+ | 'doc-drift'
17
+ | 'naming-inconsistency'
18
+ | 'naming-quality'
19
+ | 'pattern-inconsistency'
20
+ | 'architecture-inconsistency'
21
+ | 'dead-code'
22
+ | 'circular-dependency'
23
+ | 'missing-types';
14
24
  export interface Location {
15
- file: string;
16
- line: number;
17
- column?: number;
18
- endLine?: number;
19
- endColumn?: number;
25
+ file: string;
26
+ line: number;
27
+ column?: number;
28
+ endLine?: number;
29
+ endColumn?: number;
20
30
  }
21
31
  export interface Metrics {
22
- tokenCost?: number;
23
- complexityScore?: number;
24
- consistencyScore?: number;
25
- docFreshnessScore?: number;
32
+ tokenCost?: number;
33
+ complexityScore?: number;
34
+ consistencyScore?: number;
35
+ docFreshnessScore?: number;
26
36
  }
27
37
  export interface ScanOptions {
28
- rootDir: string;
29
- include?: string[];
30
- exclude?: string[];
31
- maxDepth?: number;
38
+ rootDir: string;
39
+ include?: string[];
40
+ exclude?: string[];
41
+ maxDepth?: number;
32
42
  }
33
43
  export interface AIReadyConfig {
34
- scan?: {
35
- include?: string[];
36
- exclude?: string[];
37
- tools?: string[];
38
- };
39
- tools?: {
40
- 'pattern-detect'?: {
41
- enabled?: boolean;
42
- scoreWeight?: number;
43
- minSimilarity?: number;
44
- minLines?: number;
45
- batchSize?: number;
46
- approx?: boolean;
47
- minSharedTokens?: number;
48
- maxCandidatesPerBlock?: number;
49
- streamResults?: boolean;
50
- maxResults?: number;
51
- };
52
- 'context-analyzer'?: {
53
- enabled?: boolean;
54
- scoreWeight?: number;
55
- maxDepth?: number;
56
- maxContextBudget?: number;
57
- minCohesion?: number;
58
- maxFragmentation?: number;
59
- focus?: 'fragmentation' | 'cohesion' | 'depth' | 'all';
60
- includeNodeModules?: boolean;
61
- maxResults?: number;
62
- domainKeywords?: string[];
63
- domainPatterns?: string[];
64
- pathDomainMap?: Record<string, string>;
65
- };
66
- 'consistency'?: {
67
- enabled?: boolean;
68
- scoreWeight?: number;
69
- acceptedAbbreviations?: string[];
70
- shortWords?: string[];
71
- disableChecks?: ('single-letter' | 'abbreviation' | 'convention-mix' | 'unclear' | 'poor-naming')[];
72
- };
73
- [toolName: string]: {
74
- enabled?: boolean;
75
- scoreWeight?: number;
76
- [key: string]: any;
77
- } | undefined;
44
+ scan?: {
45
+ include?: string[];
46
+ exclude?: string[];
47
+ tools?: string[];
48
+ };
49
+ tools?: {
50
+ 'pattern-detect'?: {
51
+ enabled?: boolean;
52
+ scoreWeight?: number;
53
+ minSimilarity?: number;
54
+ minLines?: number;
55
+ batchSize?: number;
56
+ approx?: boolean;
57
+ minSharedTokens?: number;
58
+ maxCandidatesPerBlock?: number;
59
+ streamResults?: boolean;
60
+ maxResults?: number;
78
61
  };
79
- scoring?: {
80
- threshold?: number;
81
- showBreakdown?: boolean;
82
- compareBaseline?: string;
83
- saveTo?: string;
62
+ 'context-analyzer'?: {
63
+ enabled?: boolean;
64
+ scoreWeight?: number;
65
+ maxDepth?: number;
66
+ maxContextBudget?: number;
67
+ minCohesion?: number;
68
+ maxFragmentation?: number;
69
+ focus?: 'fragmentation' | 'cohesion' | 'depth' | 'all';
70
+ includeNodeModules?: boolean;
71
+ maxResults?: number;
72
+ domainKeywords?: string[];
73
+ domainPatterns?: string[];
74
+ pathDomainMap?: Record<string, string>;
84
75
  };
85
- output?: {
86
- format?: 'console' | 'json' | 'html';
87
- file?: string;
76
+ consistency?: {
77
+ enabled?: boolean;
78
+ scoreWeight?: number;
79
+ acceptedAbbreviations?: string[];
80
+ shortWords?: string[];
81
+ disableChecks?: (
82
+ | 'single-letter'
83
+ | 'abbreviation'
84
+ | 'convention-mix'
85
+ | 'unclear'
86
+ | 'poor-naming'
87
+ )[];
88
88
  };
89
+ [toolName: string]:
90
+ | {
91
+ enabled?: boolean;
92
+ scoreWeight?: number;
93
+ [key: string]: any;
94
+ }
95
+ | undefined;
96
+ };
97
+ scoring?: {
98
+ threshold?: number;
99
+ showBreakdown?: boolean;
100
+ compareBaseline?: string;
101
+ saveTo?: string;
102
+ };
103
+ output?: {
104
+ format?: 'console' | 'json' | 'html';
105
+ file?: string;
106
+ };
89
107
  }
90
108
  export interface Report {
91
- summary: {
92
- totalFiles: number;
93
- totalIssues: number;
94
- criticalIssues: number;
95
- majorIssues: number;
96
- };
97
- results: AnalysisResult[];
98
- metrics: {
99
- overallScore: number;
100
- tokenCostTotal: number;
101
- avgConsistency: number;
102
- };
109
+ summary: {
110
+ totalFiles: number;
111
+ totalIssues: number;
112
+ criticalIssues: number;
113
+ majorIssues: number;
114
+ };
115
+ results: AnalysisResult[];
116
+ metrics: {
117
+ overallScore: number;
118
+ tokenCostTotal: number;
119
+ avgConsistency: number;
120
+ };
103
121
  }
104
- //# sourceMappingURL=types.d.ts.map
122
+ //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -1,50 +1,59 @@
1
1
  export interface ExportWithImports {
2
- name: string;
3
- type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default';
4
- imports: string[];
5
- dependencies: string[];
6
- typeReferences: string[];
7
- loc?: {
8
- start: {
9
- line: number;
10
- column: number;
11
- };
12
- end: {
13
- line: number;
14
- column: number;
15
- };
2
+ name: string;
3
+ type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default';
4
+ imports: string[];
5
+ dependencies: string[];
6
+ typeReferences: string[];
7
+ loc?: {
8
+ start: {
9
+ line: number;
10
+ column: number;
16
11
  };
12
+ end: {
13
+ line: number;
14
+ column: number;
15
+ };
16
+ };
17
17
  }
18
18
  export interface FileImport {
19
- source: string;
20
- specifiers: string[];
21
- isTypeOnly: boolean;
19
+ source: string;
20
+ specifiers: string[];
21
+ isTypeOnly: boolean;
22
22
  }
23
23
  /**
24
24
  * Parse TypeScript/JavaScript file and extract exports with their import dependencies
25
25
  */
26
- export declare function parseFileExports(code: string, filePath: string): {
27
- exports: ExportWithImports[];
28
- imports: FileImport[];
26
+ export declare function parseFileExports(
27
+ code: string,
28
+ filePath: string
29
+ ): {
30
+ exports: ExportWithImports[];
31
+ imports: FileImport[];
29
32
  };
30
33
  /**
31
34
  * Calculate import-based similarity between two exports (Jaccard index)
32
35
  */
33
- export declare function calculateImportSimilarity(export1: ExportWithImports, export2: ExportWithImports): number;
36
+ export declare function calculateImportSimilarity(
37
+ export1: ExportWithImports,
38
+ export2: ExportWithImports
39
+ ): number;
34
40
  export interface ASTNode {
35
- type: string;
36
- loc?: {
37
- start: {
38
- line: number;
39
- column: number;
40
- };
41
- end: {
42
- line: number;
43
- column: number;
44
- };
41
+ type: string;
42
+ loc?: {
43
+ start: {
44
+ line: number;
45
+ column: number;
46
+ };
47
+ end: {
48
+ line: number;
49
+ column: number;
45
50
  };
51
+ };
46
52
  }
47
- export declare function parseCode(code: string, language: string): ASTNode | null;
53
+ export declare function parseCode(
54
+ code: string,
55
+ language: string
56
+ ): ASTNode | null;
48
57
  export declare function extractFunctions(ast: ASTNode): ASTNode[];
49
58
  export declare function extractImports(ast: ASTNode): string[];
50
- //# sourceMappingURL=ast-parser.d.ts.map
59
+ //# sourceMappingURL=ast-parser.d.ts.map