@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.
- package/dist/__tests__/parser-factory.test.d.ts +1 -1
- package/dist/__tests__/parser-factory.test.js +62 -50
- package/dist/__tests__/python-parser.test.d.ts +1 -1
- package/dist/__tests__/python-parser.test.js +111 -109
- package/dist/__tests__/scoring.test.d.ts +1 -1
- package/dist/__tests__/scoring.test.js +193 -176
- package/dist/chunk-3YI4IS3D.mjs +191 -173
- package/dist/chunk-5HIXDC3X.mjs +273 -251
- package/dist/chunk-5V3L53AE.mjs +805 -0
- package/dist/chunk-CKVKHN3G.mjs +228 -211
- package/dist/chunk-COHIBX3Q.mjs +213 -195
- package/dist/chunk-CWRCDSKZ.mjs +91 -82
- package/dist/chunk-D3D3NCRR.mjs +147 -129
- package/dist/chunk-HCFYP7UD.mjs +805 -0
- package/dist/chunk-HFLFBA6F.mjs +79 -72
- package/dist/chunk-HKSARRCD.mjs +66 -58
- package/dist/chunk-JJ5JL5FX.mjs +91 -82
- package/dist/chunk-KDSTXVLQ.mjs +724 -0
- package/dist/chunk-KI7XORTN.mjs +91 -82
- package/dist/chunk-LTMHFNFK.mjs +690 -0
- package/dist/chunk-LTNXTXRI.mjs +228 -211
- package/dist/chunk-M22BXHBR.mjs +805 -0
- package/dist/chunk-MH3A3LX6.mjs +200 -182
- package/dist/chunk-NGHT7JOG.mjs +697 -0
- package/dist/chunk-OQ6IGDXG.mjs +147 -129
- package/dist/chunk-QAFB3HXQ.mjs +181 -165
- package/dist/chunk-QQBKXHLU.mjs +678 -0
- package/dist/chunk-RDHYGES7.mjs +678 -0
- package/dist/chunk-SWTDBVYJ.mjs +228 -213
- package/dist/chunk-UIWL5JQB.mjs +79 -72
- package/dist/chunk-UQGI67WR.mjs +79 -72
- package/dist/chunk-UTZOO4XO.mjs +147 -131
- package/dist/chunk-X4F46I5L.mjs +213 -195
- package/dist/chunk-XKK7YHPX.mjs +204 -186
- package/dist/chunk-YCA4FTEK.mjs +190 -172
- package/dist/chunk-ZSZRRTJM.mjs +719 -0
- package/dist/client-BgmiMoil.d.mts +1344 -0
- package/dist/client-BgmiMoil.d.ts +1344 -0
- package/dist/client-BxGrPuuN.d.mts +1191 -0
- package/dist/client-BxGrPuuN.d.ts +1191 -0
- package/dist/client-D-cn9ydj.d.mts +1136 -0
- package/dist/client-D-cn9ydj.d.ts +1136 -0
- package/dist/client-D9seCH4K.d.mts +1334 -0
- package/dist/client-D9seCH4K.d.ts +1334 -0
- package/dist/client-DIXIh7rw.d.mts +1193 -0
- package/dist/client-DIXIh7rw.d.ts +1193 -0
- package/dist/client-DVHXWOHw.d.mts +1245 -0
- package/dist/client-DVHXWOHw.d.ts +1245 -0
- package/dist/client.d.mts +2 -1094
- package/dist/client.d.ts +2 -1094
- package/dist/client.js +23 -43
- package/dist/client.mjs +3 -25
- package/dist/index.d.mts +380 -108
- package/dist/index.d.ts +380 -108
- package/dist/index.js +609 -445
- package/dist/index.mjs +587 -429
- package/dist/parsers/parser-factory.d.ts +45 -45
- package/dist/parsers/parser-factory.js +86 -84
- package/dist/parsers/python-parser.d.ts +33 -28
- package/dist/parsers/python-parser.js +224 -222
- package/dist/parsers/typescript-parser.d.ts +15 -10
- package/dist/parsers/typescript-parser.js +223 -197
- package/dist/scoring.d.ts +59 -49
- package/dist/scoring.js +129 -127
- package/dist/types/language.d.ts +104 -93
- package/dist/types/language.js +23 -23
- package/dist/types.d.ts +105 -87
- package/dist/types.js +1 -1
- package/dist/utils/ast-parser.d.ts +42 -33
- package/dist/utils/ast-parser.js +159 -162
- package/dist/utils/cli-helpers.d.ts +27 -10
- package/dist/utils/cli-helpers.js +45 -43
- package/dist/utils/config.d.ts +8 -3
- package/dist/utils/config.js +67 -69
- package/dist/utils/file-scanner.d.ts +1 -1
- package/dist/utils/file-scanner.js +80 -76
- package/dist/utils/metrics.d.ts +1 -1
- package/dist/utils/metrics.js +2 -2
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,104 +1,122 @@
|
|
|
1
1
|
export interface AnalysisResult {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
fileName: string;
|
|
3
|
+
issues: Issue[];
|
|
4
|
+
metrics: Metrics;
|
|
5
5
|
}
|
|
6
6
|
export interface Issue {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
type: IssueType;
|
|
8
|
+
severity: 'critical' | 'major' | 'minor' | 'info';
|
|
9
|
+
message: string;
|
|
10
|
+
location: Location;
|
|
11
|
+
suggestion?: string;
|
|
12
12
|
}
|
|
13
|
-
export type IssueType =
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
file: string;
|
|
26
|
+
line: number;
|
|
27
|
+
column?: number;
|
|
28
|
+
endLine?: number;
|
|
29
|
+
endColumn?: number;
|
|
20
30
|
}
|
|
21
31
|
export interface Metrics {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
tokenCost?: number;
|
|
33
|
+
complexityScore?: number;
|
|
34
|
+
consistencyScore?: number;
|
|
35
|
+
docFreshnessScore?: number;
|
|
26
36
|
}
|
|
27
37
|
export interface ScanOptions {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
rootDir: string;
|
|
39
|
+
include?: string[];
|
|
40
|
+
exclude?: string[];
|
|
41
|
+
maxDepth?: number;
|
|
32
42
|
}
|
|
33
43
|
export interface AIReadyConfig {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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(
|
|
27
|
-
|
|
28
|
-
|
|
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(
|
|
36
|
+
export declare function calculateImportSimilarity(
|
|
37
|
+
export1: ExportWithImports,
|
|
38
|
+
export2: ExportWithImports
|
|
39
|
+
): number;
|
|
34
40
|
export interface ASTNode {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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(
|
|
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
|