@aiready/core 0.23.5 → 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.
- package/dist/{client-BF9NjhE8.d.mts → client-CKcjnPXt.d.mts} +1 -0
- package/dist/{client-BF9NjhE8.d.ts → client-CKcjnPXt.d.ts} +1 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +74 -13
- package/dist/index.mjs +74 -13
- package/package.json +1 -1
- package/dist/__tests__/parser-factory.test.d.ts +0 -5
- package/dist/__tests__/parser-factory.test.d.ts.map +0 -1
- package/dist/__tests__/parser-factory.test.js +0 -70
- package/dist/__tests__/parser-factory.test.js.map +0 -1
- package/dist/__tests__/python-parser.test.d.ts +0 -5
- package/dist/__tests__/python-parser.test.d.ts.map +0 -1
- package/dist/__tests__/python-parser.test.js +0 -194
- package/dist/__tests__/python-parser.test.js.map +0 -1
- package/dist/__tests__/scoring.test.d.ts +0 -2
- package/dist/__tests__/scoring.test.d.ts.map +0 -1
- package/dist/__tests__/scoring.test.js +0 -197
- package/dist/__tests__/scoring.test.js.map +0 -1
- package/dist/chunk-3YI4IS3D.mjs +0 -601
- package/dist/chunk-5HIXDC3X.mjs +0 -716
- package/dist/chunk-5V3L53AE.mjs +0 -805
- package/dist/chunk-CKVKHN3G.mjs +0 -660
- package/dist/chunk-COHIBX3Q.mjs +0 -635
- package/dist/chunk-CWRCDSKZ.mjs +0 -417
- package/dist/chunk-D3D3NCRR.mjs +0 -556
- package/dist/chunk-HCFYP7UD.mjs +0 -805
- package/dist/chunk-HFLFBA6F.mjs +0 -417
- package/dist/chunk-HKSARRCD.mjs +0 -365
- package/dist/chunk-JJ5JL5FX.mjs +0 -417
- package/dist/chunk-KDSTXVLQ.mjs +0 -724
- package/dist/chunk-KI7XORTN.mjs +0 -417
- package/dist/chunk-LTMHFNFK.mjs +0 -690
- package/dist/chunk-LTNXTXRI.mjs +0 -659
- package/dist/chunk-M22BXHBR.mjs +0 -805
- package/dist/chunk-MH3A3LX6.mjs +0 -615
- package/dist/chunk-NGHT7JOG.mjs +0 -697
- package/dist/chunk-OQ6IGDXG.mjs +0 -553
- package/dist/chunk-QAFB3HXQ.mjs +0 -590
- package/dist/chunk-QQBKXHLU.mjs +0 -678
- package/dist/chunk-RDHYGES7.mjs +0 -678
- package/dist/chunk-SWTDBVYJ.mjs +0 -660
- package/dist/chunk-UIWL5JQB.mjs +0 -417
- package/dist/chunk-UQGI67WR.mjs +0 -417
- package/dist/chunk-UTZOO4XO.mjs +0 -553
- package/dist/chunk-X4F46I5L.mjs +0 -635
- package/dist/chunk-XKK7YHPX.mjs +0 -619
- package/dist/chunk-YCA4FTEK.mjs +0 -600
- package/dist/chunk-ZSZRRTJM.mjs +0 -719
- package/dist/client-BgmiMoil.d.mts +0 -1344
- package/dist/client-BgmiMoil.d.ts +0 -1344
- package/dist/client-BxGrPuuN.d.mts +0 -1191
- package/dist/client-BxGrPuuN.d.ts +0 -1191
- package/dist/client-D-cn9ydj.d.mts +0 -1136
- package/dist/client-D-cn9ydj.d.ts +0 -1136
- package/dist/client-D9seCH4K.d.mts +0 -1334
- package/dist/client-D9seCH4K.d.ts +0 -1334
- package/dist/client-DIXIh7rw.d.mts +0 -1193
- package/dist/client-DIXIh7rw.d.ts +0 -1193
- package/dist/client-DVHXWOHw.d.mts +0 -1245
- package/dist/client-DVHXWOHw.d.ts +0 -1245
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/parsers/parser-factory.d.ts +0 -69
- package/dist/parsers/parser-factory.d.ts.map +0 -1
- package/dist/parsers/parser-factory.js +0 -116
- package/dist/parsers/parser-factory.js.map +0 -1
- package/dist/parsers/python-parser.d.ts +0 -47
- package/dist/parsers/python-parser.d.ts.map +0 -1
- package/dist/parsers/python-parser.js +0 -243
- package/dist/parsers/python-parser.js.map +0 -1
- package/dist/parsers/typescript-parser.d.ts +0 -22
- package/dist/parsers/typescript-parser.d.ts.map +0 -1
- package/dist/parsers/typescript-parser.js +0 -242
- package/dist/parsers/typescript-parser.js.map +0 -1
- package/dist/scoring.d.ts +0 -120
- package/dist/scoring.d.ts.map +0 -1
- package/dist/scoring.js +0 -197
- package/dist/scoring.js.map +0 -1
- package/dist/types/language.d.ts +0 -172
- package/dist/types/language.d.ts.map +0 -1
- package/dist/types/language.js +0 -45
- package/dist/types/language.js.map +0 -1
- package/dist/types.d.ts +0 -122
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/ast-parser.d.ts +0 -59
- package/dist/utils/ast-parser.d.ts.map +0 -1
- package/dist/utils/ast-parser.js +0 -213
- package/dist/utils/ast-parser.js.map +0 -1
- package/dist/utils/cli-helpers.d.ts +0 -54
- package/dist/utils/cli-helpers.d.ts.map +0 -1
- package/dist/utils/cli-helpers.js +0 -78
- package/dist/utils/cli-helpers.js.map +0 -1
- package/dist/utils/config.d.ts +0 -9
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js +0 -80
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/file-scanner.d.ts +0 -16
- package/dist/utils/file-scanner.d.ts.map +0 -1
- package/dist/utils/file-scanner.js +0 -104
- package/dist/utils/file-scanner.js.map +0 -1
- package/dist/utils/metrics.d.ts +0 -6
- package/dist/utils/metrics.d.ts.map +0 -1
- package/dist/utils/metrics.js +0 -8
- package/dist/utils/metrics.js.map +0 -1
package/dist/chunk-5V3L53AE.mjs
DELETED
|
@@ -1,805 +0,0 @@
|
|
|
1
|
-
// src/types/schema.ts
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
4
|
-
Severity2['Critical'] = 'critical';
|
|
5
|
-
Severity2['Major'] = 'major';
|
|
6
|
-
Severity2['Minor'] = 'minor';
|
|
7
|
-
Severity2['Info'] = 'info';
|
|
8
|
-
return Severity2;
|
|
9
|
-
})(Severity || {});
|
|
10
|
-
var SeveritySchema = z.nativeEnum(Severity);
|
|
11
|
-
var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
12
|
-
ToolName2['PatternDetect'] = 'pattern-detect';
|
|
13
|
-
ToolName2['ContextAnalyzer'] = 'context-analyzer';
|
|
14
|
-
ToolName2['NamingConsistency'] = 'naming-consistency';
|
|
15
|
-
ToolName2['AiSignalClarity'] = 'ai-signal-clarity';
|
|
16
|
-
ToolName2['AgentGrounding'] = 'agent-grounding';
|
|
17
|
-
ToolName2['TestabilityIndex'] = 'testability-index';
|
|
18
|
-
ToolName2['DocDrift'] = 'doc-drift';
|
|
19
|
-
ToolName2['DependencyHealth'] = 'dependency-health';
|
|
20
|
-
ToolName2['ChangeAmplification'] = 'change-amplification';
|
|
21
|
-
ToolName2['CognitiveLoad'] = 'cognitive-load';
|
|
22
|
-
ToolName2['PatternEntropy'] = 'pattern-entropy';
|
|
23
|
-
ToolName2['ConceptCohesion'] = 'concept-cohesion';
|
|
24
|
-
ToolName2['SemanticDistance'] = 'semantic-distance';
|
|
25
|
-
return ToolName2;
|
|
26
|
-
})(ToolName || {});
|
|
27
|
-
var ToolNameSchema = z.nativeEnum(ToolName);
|
|
28
|
-
var FRIENDLY_TOOL_NAMES = {
|
|
29
|
-
['pattern-detect' /* PatternDetect */]: 'Semantic Duplicates',
|
|
30
|
-
['context-analyzer' /* ContextAnalyzer */]: 'Context Fragmentation',
|
|
31
|
-
['naming-consistency' /* NamingConsistency */]: 'Naming Consistency',
|
|
32
|
-
['ai-signal-clarity' /* AiSignalClarity */]: 'AI Signal Clarity',
|
|
33
|
-
['agent-grounding' /* AgentGrounding */]: 'Agent Grounding',
|
|
34
|
-
['testability-index' /* TestabilityIndex */]: 'Testability Index',
|
|
35
|
-
['doc-drift' /* DocDrift */]: 'Documentation Health',
|
|
36
|
-
['dependency-health' /* DependencyHealth */]: 'Dependency Health',
|
|
37
|
-
['change-amplification' /* ChangeAmplification */]: 'Change Amplification',
|
|
38
|
-
['cognitive-load' /* CognitiveLoad */]: 'Cognitive Load',
|
|
39
|
-
['pattern-entropy' /* PatternEntropy */]: 'Pattern Entropy',
|
|
40
|
-
['concept-cohesion' /* ConceptCohesion */]: 'Concept Cohesion',
|
|
41
|
-
['semantic-distance' /* SemanticDistance */]: 'Semantic Distance',
|
|
42
|
-
};
|
|
43
|
-
var IssueType = /* @__PURE__ */ ((IssueType2) => {
|
|
44
|
-
IssueType2['DuplicatePattern'] = 'duplicate-pattern';
|
|
45
|
-
IssueType2['PatternInconsistency'] = 'pattern-inconsistency';
|
|
46
|
-
IssueType2['ContextFragmentation'] = 'context-fragmentation';
|
|
47
|
-
IssueType2['DependencyHealth'] = 'dependency-health';
|
|
48
|
-
IssueType2['CircularDependency'] = 'circular-dependency';
|
|
49
|
-
IssueType2['DocDrift'] = 'doc-drift';
|
|
50
|
-
IssueType2['NamingInconsistency'] = 'naming-inconsistency';
|
|
51
|
-
IssueType2['NamingQuality'] = 'naming-quality';
|
|
52
|
-
IssueType2['ArchitectureInconsistency'] = 'architecture-inconsistency';
|
|
53
|
-
IssueType2['DeadCode'] = 'dead-code';
|
|
54
|
-
IssueType2['MissingTypes'] = 'missing-types';
|
|
55
|
-
IssueType2['MagicLiteral'] = 'magic-literal';
|
|
56
|
-
IssueType2['BooleanTrap'] = 'boolean-trap';
|
|
57
|
-
IssueType2['AiSignalClarity'] = 'ai-signal-clarity';
|
|
58
|
-
IssueType2['LowTestability'] = 'low-testability';
|
|
59
|
-
IssueType2['AgentNavigationFailure'] = 'agent-navigation-failure';
|
|
60
|
-
IssueType2['AmbiguousApi'] = 'ambiguous-api';
|
|
61
|
-
IssueType2['ChangeAmplification'] = 'change-amplification';
|
|
62
|
-
return IssueType2;
|
|
63
|
-
})(IssueType || {});
|
|
64
|
-
var IssueTypeSchema = z.nativeEnum(IssueType);
|
|
65
|
-
var AnalysisStatus = /* @__PURE__ */ ((AnalysisStatus2) => {
|
|
66
|
-
AnalysisStatus2['Processing'] = 'processing';
|
|
67
|
-
AnalysisStatus2['Completed'] = 'completed';
|
|
68
|
-
AnalysisStatus2['Failed'] = 'failed';
|
|
69
|
-
return AnalysisStatus2;
|
|
70
|
-
})(AnalysisStatus || {});
|
|
71
|
-
var AnalysisStatusSchema = z.nativeEnum(AnalysisStatus);
|
|
72
|
-
var ModelTier = /* @__PURE__ */ ((ModelTier2) => {
|
|
73
|
-
ModelTier2['Compact'] = 'compact';
|
|
74
|
-
ModelTier2['Standard'] = 'standard';
|
|
75
|
-
ModelTier2['Extended'] = 'extended';
|
|
76
|
-
ModelTier2['Frontier'] = 'frontier';
|
|
77
|
-
return ModelTier2;
|
|
78
|
-
})(ModelTier || {});
|
|
79
|
-
var ModelTierSchema = z.nativeEnum(ModelTier);
|
|
80
|
-
var LocationSchema = z.object({
|
|
81
|
-
file: z.string(),
|
|
82
|
-
line: z.number(),
|
|
83
|
-
column: z.number().optional(),
|
|
84
|
-
endLine: z.number().optional(),
|
|
85
|
-
endColumn: z.number().optional(),
|
|
86
|
-
});
|
|
87
|
-
var IssueSchema = z.object({
|
|
88
|
-
type: IssueTypeSchema,
|
|
89
|
-
severity: SeveritySchema,
|
|
90
|
-
message: z.string(),
|
|
91
|
-
location: LocationSchema,
|
|
92
|
-
suggestion: z.string().optional(),
|
|
93
|
-
});
|
|
94
|
-
var MetricsSchema = z.object({
|
|
95
|
-
tokenCost: z.number().optional(),
|
|
96
|
-
complexityScore: z.number().optional(),
|
|
97
|
-
consistencyScore: z.number().optional(),
|
|
98
|
-
docFreshnessScore: z.number().optional(),
|
|
99
|
-
// AI agent readiness metrics (v0.12+)
|
|
100
|
-
aiSignalClarityScore: z.number().optional(),
|
|
101
|
-
agentGroundingScore: z.number().optional(),
|
|
102
|
-
testabilityScore: z.number().optional(),
|
|
103
|
-
docDriftScore: z.number().optional(),
|
|
104
|
-
dependencyHealthScore: z.number().optional(),
|
|
105
|
-
modelContextTier: ModelTierSchema.optional(),
|
|
106
|
-
// Business value metrics
|
|
107
|
-
estimatedMonthlyCost: z.number().optional(),
|
|
108
|
-
estimatedDeveloperHours: z.number().optional(),
|
|
109
|
-
comprehensionDifficultyIndex: z.number().optional(),
|
|
110
|
-
// Extended metrics for specific spokes
|
|
111
|
-
totalSymbols: z.number().optional(),
|
|
112
|
-
totalExports: z.number().optional(),
|
|
113
|
-
});
|
|
114
|
-
var AnalysisResultSchema = z.object({
|
|
115
|
-
fileName: z.string(),
|
|
116
|
-
issues: z.array(IssueSchema),
|
|
117
|
-
metrics: MetricsSchema,
|
|
118
|
-
});
|
|
119
|
-
var SpokeSummarySchema = z
|
|
120
|
-
.object({
|
|
121
|
-
totalFiles: z.number().optional(),
|
|
122
|
-
totalIssues: z.number().optional(),
|
|
123
|
-
criticalIssues: z.number().optional(),
|
|
124
|
-
majorIssues: z.number().optional(),
|
|
125
|
-
score: z.number().optional(),
|
|
126
|
-
})
|
|
127
|
-
.catchall(z.any());
|
|
128
|
-
var SpokeOutputSchema = z.object({
|
|
129
|
-
results: z.array(AnalysisResultSchema),
|
|
130
|
-
summary: SpokeSummarySchema,
|
|
131
|
-
metadata: z
|
|
132
|
-
.object({
|
|
133
|
-
toolName: z.string(),
|
|
134
|
-
version: z.string().optional(),
|
|
135
|
-
timestamp: z.string().optional(),
|
|
136
|
-
config: z.any().optional(),
|
|
137
|
-
})
|
|
138
|
-
.catchall(z.any())
|
|
139
|
-
.optional(),
|
|
140
|
-
});
|
|
141
|
-
var UnifiedReportSchema = z
|
|
142
|
-
.object({
|
|
143
|
-
summary: z.object({
|
|
144
|
-
totalFiles: z.number(),
|
|
145
|
-
totalIssues: z.number(),
|
|
146
|
-
criticalIssues: z.number(),
|
|
147
|
-
majorIssues: z.number(),
|
|
148
|
-
businessImpact: z
|
|
149
|
-
.object({
|
|
150
|
-
estimatedMonthlyWaste: z.number().optional(),
|
|
151
|
-
potentialSavings: z.number().optional(),
|
|
152
|
-
productivityHours: z.number().optional(),
|
|
153
|
-
})
|
|
154
|
-
.optional(),
|
|
155
|
-
}),
|
|
156
|
-
results: z.array(AnalysisResultSchema),
|
|
157
|
-
scoring: z
|
|
158
|
-
.object({
|
|
159
|
-
overall: z.number(),
|
|
160
|
-
rating: z.string(),
|
|
161
|
-
timestamp: z.string(),
|
|
162
|
-
breakdown: z.array(
|
|
163
|
-
z
|
|
164
|
-
.object({
|
|
165
|
-
toolName: z.union([ToolNameSchema, z.string()]),
|
|
166
|
-
score: z.number(),
|
|
167
|
-
})
|
|
168
|
-
.catchall(z.any())
|
|
169
|
-
),
|
|
170
|
-
})
|
|
171
|
-
.optional(),
|
|
172
|
-
})
|
|
173
|
-
.catchall(z.any());
|
|
174
|
-
|
|
175
|
-
// src/types.ts
|
|
176
|
-
var GLOBAL_INFRA_OPTIONS = [
|
|
177
|
-
'rootDir',
|
|
178
|
-
// Essential for every tool
|
|
179
|
-
'include',
|
|
180
|
-
'exclude',
|
|
181
|
-
'onProgress',
|
|
182
|
-
'progressCallback',
|
|
183
|
-
'includeTests',
|
|
184
|
-
'useSmartDefaults',
|
|
185
|
-
'streamResults',
|
|
186
|
-
'batchSize',
|
|
187
|
-
'costConfig',
|
|
188
|
-
'tools',
|
|
189
|
-
'toolConfigs',
|
|
190
|
-
];
|
|
191
|
-
var COMMON_FINE_TUNING_OPTIONS = [
|
|
192
|
-
'maxDepth',
|
|
193
|
-
'minSimilarity',
|
|
194
|
-
'minLines',
|
|
195
|
-
'minCohesion',
|
|
196
|
-
// AI Signal Clarity options
|
|
197
|
-
'checkMagicLiterals',
|
|
198
|
-
'checkBooleanTraps',
|
|
199
|
-
'checkAmbiguousNames',
|
|
200
|
-
'checkUndocumentedExports',
|
|
201
|
-
'checkImplicitSideEffects',
|
|
202
|
-
'checkDeepCallbacks',
|
|
203
|
-
];
|
|
204
|
-
var GLOBAL_SCAN_OPTIONS = [...GLOBAL_INFRA_OPTIONS];
|
|
205
|
-
|
|
206
|
-
// src/types/language.ts
|
|
207
|
-
var Language = /* @__PURE__ */ ((Language2) => {
|
|
208
|
-
Language2['TypeScript'] = 'typescript';
|
|
209
|
-
Language2['JavaScript'] = 'javascript';
|
|
210
|
-
Language2['Python'] = 'python';
|
|
211
|
-
Language2['Java'] = 'java';
|
|
212
|
-
Language2['Go'] = 'go';
|
|
213
|
-
Language2['Rust'] = 'rust';
|
|
214
|
-
Language2['CSharp'] = 'csharp';
|
|
215
|
-
return Language2;
|
|
216
|
-
})(Language || {});
|
|
217
|
-
var LANGUAGE_EXTENSIONS = {
|
|
218
|
-
'.ts': 'typescript' /* TypeScript */,
|
|
219
|
-
'.tsx': 'typescript' /* TypeScript */,
|
|
220
|
-
'.js': 'javascript' /* JavaScript */,
|
|
221
|
-
'.jsx': 'javascript' /* JavaScript */,
|
|
222
|
-
'.py': 'python' /* Python */,
|
|
223
|
-
'.java': 'java' /* Java */,
|
|
224
|
-
'.go': 'go' /* Go */,
|
|
225
|
-
'.rs': 'rust' /* Rust */,
|
|
226
|
-
'.cs': 'csharp' /* CSharp */,
|
|
227
|
-
};
|
|
228
|
-
var ParseError = class extends Error {
|
|
229
|
-
constructor(message, filePath, loc) {
|
|
230
|
-
super(message);
|
|
231
|
-
this.filePath = filePath;
|
|
232
|
-
this.loc = loc;
|
|
233
|
-
this.name = 'ParseError';
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// src/scoring-types.ts
|
|
238
|
-
var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
|
|
239
|
-
RecommendationPriority2['High'] = 'high';
|
|
240
|
-
RecommendationPriority2['Medium'] = 'medium';
|
|
241
|
-
RecommendationPriority2['Low'] = 'low';
|
|
242
|
-
return RecommendationPriority2;
|
|
243
|
-
})(RecommendationPriority || {});
|
|
244
|
-
var ReadinessRating = /* @__PURE__ */ ((ReadinessRating2) => {
|
|
245
|
-
ReadinessRating2['Excellent'] = 'Excellent';
|
|
246
|
-
ReadinessRating2['Good'] = 'Good';
|
|
247
|
-
ReadinessRating2['Fair'] = 'Fair';
|
|
248
|
-
ReadinessRating2['NeedsWork'] = 'Needs Work';
|
|
249
|
-
ReadinessRating2['Critical'] = 'Critical';
|
|
250
|
-
return ReadinessRating2;
|
|
251
|
-
})(ReadinessRating || {});
|
|
252
|
-
var TOOL_NAME_MAP = {
|
|
253
|
-
pd: 'pattern-detect',
|
|
254
|
-
patterns: 'pattern-detect',
|
|
255
|
-
'pattern-detect': 'pattern-detect',
|
|
256
|
-
ca: 'context-analyzer',
|
|
257
|
-
context: 'context-analyzer',
|
|
258
|
-
'context-analyzer': 'context-analyzer',
|
|
259
|
-
nc: 'naming-consistency',
|
|
260
|
-
naming: 'naming-consistency',
|
|
261
|
-
'naming-consistency': 'naming-consistency',
|
|
262
|
-
asc: 'ai-signal-clarity',
|
|
263
|
-
signal: 'ai-signal-clarity',
|
|
264
|
-
clarity: 'ai-signal-clarity',
|
|
265
|
-
'ai-signal-clarity': 'ai-signal-clarity',
|
|
266
|
-
ag: 'agent-grounding',
|
|
267
|
-
grounding: 'agent-grounding',
|
|
268
|
-
'agent-grounding': 'agent-grounding',
|
|
269
|
-
ti: 'testability-index',
|
|
270
|
-
testability: 'testability-index',
|
|
271
|
-
'testability-index': 'testability-index',
|
|
272
|
-
dd: 'doc-drift',
|
|
273
|
-
docs: 'doc-drift',
|
|
274
|
-
'doc-drift': 'doc-drift',
|
|
275
|
-
dh: 'dependency-health',
|
|
276
|
-
deps: 'dependency-health',
|
|
277
|
-
'dependency-health': 'dependency-health',
|
|
278
|
-
ca2: 'change-amplification',
|
|
279
|
-
coupling: 'change-amplification',
|
|
280
|
-
'change-amplification': 'change-amplification',
|
|
281
|
-
};
|
|
282
|
-
var DEFAULT_TOOL_WEIGHTS = {
|
|
283
|
-
'pattern-detect': 15,
|
|
284
|
-
'context-analyzer': 20,
|
|
285
|
-
'naming-consistency': 10,
|
|
286
|
-
'ai-signal-clarity': 15,
|
|
287
|
-
'agent-grounding': 10,
|
|
288
|
-
'testability-index': 10,
|
|
289
|
-
'doc-drift': 10,
|
|
290
|
-
'dependency-health': 5,
|
|
291
|
-
'change-amplification': 5,
|
|
292
|
-
};
|
|
293
|
-
var ScoringProfile = /* @__PURE__ */ ((ScoringProfile2) => {
|
|
294
|
-
ScoringProfile2['Default'] = 'default';
|
|
295
|
-
ScoringProfile2['Strict'] = 'strict';
|
|
296
|
-
ScoringProfile2['Relaxed'] = 'relaxed';
|
|
297
|
-
ScoringProfile2['Enterprise'] = 'enterprise';
|
|
298
|
-
ScoringProfile2['Minimal'] = 'minimal';
|
|
299
|
-
return ScoringProfile2;
|
|
300
|
-
})(ScoringProfile || {});
|
|
301
|
-
var SCORING_PROFILES = {
|
|
302
|
-
['default' /* Default */]: DEFAULT_TOOL_WEIGHTS,
|
|
303
|
-
['strict' /* Strict */]: {
|
|
304
|
-
...DEFAULT_TOOL_WEIGHTS,
|
|
305
|
-
'ai-signal-clarity': 20,
|
|
306
|
-
'context-analyzer': 25,
|
|
307
|
-
},
|
|
308
|
-
['relaxed' /* Relaxed */]: {
|
|
309
|
-
...DEFAULT_TOOL_WEIGHTS,
|
|
310
|
-
'context-analyzer': 10,
|
|
311
|
-
'doc-drift': 15,
|
|
312
|
-
},
|
|
313
|
-
['enterprise' /* Enterprise */]: {
|
|
314
|
-
...DEFAULT_TOOL_WEIGHTS,
|
|
315
|
-
'context-analyzer': 25,
|
|
316
|
-
'change-amplification': 10,
|
|
317
|
-
},
|
|
318
|
-
['minimal' /* Minimal */]: {
|
|
319
|
-
...DEFAULT_TOOL_WEIGHTS,
|
|
320
|
-
'pattern-detect': 10,
|
|
321
|
-
'context-analyzer': 10,
|
|
322
|
-
'ai-signal-clarity': 10,
|
|
323
|
-
},
|
|
324
|
-
};
|
|
325
|
-
var CONTEXT_TIER_THRESHOLDS = {
|
|
326
|
-
compact: 4e3,
|
|
327
|
-
standard: 8e3,
|
|
328
|
-
extended: 32e3,
|
|
329
|
-
frontier: 1e5,
|
|
330
|
-
};
|
|
331
|
-
var SIZE_ADJUSTED_THRESHOLDS = {
|
|
332
|
-
tiny: 75,
|
|
333
|
-
small: 70,
|
|
334
|
-
medium: 65,
|
|
335
|
-
large: 60,
|
|
336
|
-
enterprise: 55,
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
// src/scoring-utils.ts
|
|
340
|
-
function getRating(score) {
|
|
341
|
-
if (score >= 90) return 'Excellent';
|
|
342
|
-
if (score >= 75) return 'Good';
|
|
343
|
-
if (score >= 60) return 'Fair';
|
|
344
|
-
if (score >= 40) return 'Needs Work';
|
|
345
|
-
return 'Critical';
|
|
346
|
-
}
|
|
347
|
-
function getRatingWithContext(score, projectContext) {
|
|
348
|
-
const rating = getRating(score);
|
|
349
|
-
let description = '';
|
|
350
|
-
const recommendations = [];
|
|
351
|
-
switch (rating) {
|
|
352
|
-
case 'Excellent':
|
|
353
|
-
description =
|
|
354
|
-
'Your codebase is well-prepared for AI-assisted development.';
|
|
355
|
-
break;
|
|
356
|
-
case 'Good':
|
|
357
|
-
description = 'Your codebase is reasonably prepared for AI assistance.';
|
|
358
|
-
if (projectContext?.fileCount && projectContext.fileCount > 1e3) {
|
|
359
|
-
recommendations.push(
|
|
360
|
-
'Consider running context-analyzer to optimize context usage'
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
break;
|
|
364
|
-
case 'Fair':
|
|
365
|
-
description =
|
|
366
|
-
'Your codebase has some areas that could confuse AI assistants.';
|
|
367
|
-
recommendations.push('Focus on reducing duplicate patterns');
|
|
368
|
-
recommendations.push('Add more documentation to key exports');
|
|
369
|
-
break;
|
|
370
|
-
case 'Needs Work':
|
|
371
|
-
description =
|
|
372
|
-
'Your codebase needs improvement for effective AI assistance.';
|
|
373
|
-
recommendations.push('Review and address the critical issues');
|
|
374
|
-
recommendations.push('Add documentation to undocumented exports');
|
|
375
|
-
break;
|
|
376
|
-
case 'Critical':
|
|
377
|
-
description =
|
|
378
|
-
'Your codebase has significant issues that will limit AI effectiveness.';
|
|
379
|
-
recommendations.push('Prioritize addressing major issues');
|
|
380
|
-
recommendations.push('Consider breaking up large files');
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
return { rating, description, recommendations };
|
|
384
|
-
}
|
|
385
|
-
function getRatingDisplay(rating) {
|
|
386
|
-
const displays = {
|
|
387
|
-
Excellent: { label: 'Excellent', color: 'green', emoji: '\u{1F389}' },
|
|
388
|
-
Good: { label: 'Good', color: 'blue', emoji: '\u2705' },
|
|
389
|
-
Fair: { label: 'Fair', color: 'yellow', emoji: '\u26A0\uFE0F' },
|
|
390
|
-
'Needs Work': { label: 'Needs Work', color: 'orange', emoji: '\u{1F527}' },
|
|
391
|
-
Critical: { label: 'Critical', color: 'red', emoji: '\u{1F6A8}' },
|
|
392
|
-
};
|
|
393
|
-
return displays[rating] || { label: rating, color: 'gray', emoji: '\u2753' };
|
|
394
|
-
}
|
|
395
|
-
function formatScore(result) {
|
|
396
|
-
const display = getRatingDisplay(result.rating);
|
|
397
|
-
const lines = [
|
|
398
|
-
'',
|
|
399
|
-
`${display.emoji} AI Readiness: ${display.label} (${result.overall}/100)`,
|
|
400
|
-
`Timestamp: ${result.timestamp}`,
|
|
401
|
-
'',
|
|
402
|
-
'Breakdown:',
|
|
403
|
-
];
|
|
404
|
-
result.breakdown.forEach((tool) => {
|
|
405
|
-
const toolDisplay = getRatingDisplay(getRating(tool.score));
|
|
406
|
-
lines.push(` ${toolDisplay.emoji} ${tool.toolName}: ${tool.score}/100`);
|
|
407
|
-
});
|
|
408
|
-
return lines.join('\n');
|
|
409
|
-
}
|
|
410
|
-
function formatToolScore(output) {
|
|
411
|
-
const lines = [`Tool: ${output.toolName}`, `Score: ${output.score}/100`, ''];
|
|
412
|
-
if (output.factors && output.factors.length > 0) {
|
|
413
|
-
lines.push('Factors:');
|
|
414
|
-
output.factors.forEach((factor) => {
|
|
415
|
-
const impactSign = factor.impact >= 0 ? '+' : '';
|
|
416
|
-
lines.push(
|
|
417
|
-
` ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}`
|
|
418
|
-
);
|
|
419
|
-
});
|
|
420
|
-
lines.push('');
|
|
421
|
-
}
|
|
422
|
-
if (output.recommendations && output.recommendations.length > 0) {
|
|
423
|
-
lines.push('Recommendations:');
|
|
424
|
-
output.recommendations.forEach((rec) => {
|
|
425
|
-
lines.push(
|
|
426
|
-
` [${rec.priority}] ${rec.action} (impact: +${rec.estimatedImpact})`
|
|
427
|
-
);
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
return lines.join('\n');
|
|
431
|
-
}
|
|
432
|
-
function getProjectSizeTier(fileCount) {
|
|
433
|
-
if (fileCount < 50) return 'tiny';
|
|
434
|
-
if (fileCount < 200) return 'small';
|
|
435
|
-
if (fileCount < 500) return 'medium';
|
|
436
|
-
if (fileCount < 2e3) return 'large';
|
|
437
|
-
return 'enterprise';
|
|
438
|
-
}
|
|
439
|
-
function getRecommendedThreshold(fileCount, modelTier = 'standard') {
|
|
440
|
-
const sizeTier = getProjectSizeTier(fileCount);
|
|
441
|
-
const SIZE_ADJUSTED_THRESHOLDS2 = {
|
|
442
|
-
tiny: 75,
|
|
443
|
-
small: 70,
|
|
444
|
-
medium: 65,
|
|
445
|
-
large: 60,
|
|
446
|
-
enterprise: 55,
|
|
447
|
-
};
|
|
448
|
-
const base = SIZE_ADJUSTED_THRESHOLDS2[sizeTier];
|
|
449
|
-
const modelBonus =
|
|
450
|
-
modelTier === 'frontier' ? -3 : modelTier === 'extended' ? -2 : 0;
|
|
451
|
-
return base + modelBonus;
|
|
452
|
-
}
|
|
453
|
-
function normalizeToolName(shortName) {
|
|
454
|
-
const TOOL_NAME_MAP2 = {
|
|
455
|
-
pd: 'pattern-detect',
|
|
456
|
-
patterns: 'pattern-detect',
|
|
457
|
-
'pattern-detect': 'pattern-detect',
|
|
458
|
-
ca: 'context-analyzer',
|
|
459
|
-
context: 'context-analyzer',
|
|
460
|
-
'context-analyzer': 'context-analyzer',
|
|
461
|
-
nc: 'naming-consistency',
|
|
462
|
-
naming: 'naming-consistency',
|
|
463
|
-
'naming-consistency': 'naming-consistency',
|
|
464
|
-
asc: 'ai-signal-clarity',
|
|
465
|
-
signal: 'ai-signal-clarity',
|
|
466
|
-
clarity: 'ai-signal-clarity',
|
|
467
|
-
'ai-signal-clarity': 'ai-signal-clarity',
|
|
468
|
-
ag: 'agent-grounding',
|
|
469
|
-
grounding: 'agent-grounding',
|
|
470
|
-
'agent-grounding': 'agent-grounding',
|
|
471
|
-
ti: 'testability-index',
|
|
472
|
-
testability: 'testability-index',
|
|
473
|
-
'testability-index': 'testability-index',
|
|
474
|
-
dd: 'doc-drift',
|
|
475
|
-
docs: 'doc-drift',
|
|
476
|
-
'doc-drift': 'doc-drift',
|
|
477
|
-
dh: 'dependency-health',
|
|
478
|
-
deps: 'dependency-health',
|
|
479
|
-
'dependency-health': 'dependency-health',
|
|
480
|
-
ca2: 'change-amplification',
|
|
481
|
-
coupling: 'change-amplification',
|
|
482
|
-
'change-amplification': 'change-amplification',
|
|
483
|
-
};
|
|
484
|
-
return TOOL_NAME_MAP2[shortName.toLowerCase()] || shortName;
|
|
485
|
-
}
|
|
486
|
-
function getToolWeight(
|
|
487
|
-
toolName,
|
|
488
|
-
toolConfig,
|
|
489
|
-
cliOverride,
|
|
490
|
-
profile = 'default' /* Default */
|
|
491
|
-
) {
|
|
492
|
-
if (cliOverride !== void 0) return cliOverride;
|
|
493
|
-
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
494
|
-
const DEFAULT_TOOL_WEIGHTS2 = {
|
|
495
|
-
'pattern-detect': 15,
|
|
496
|
-
'context-analyzer': 20,
|
|
497
|
-
'naming-consistency': 10,
|
|
498
|
-
'ai-signal-clarity': 15,
|
|
499
|
-
'agent-grounding': 10,
|
|
500
|
-
'testability-index': 10,
|
|
501
|
-
'doc-drift': 10,
|
|
502
|
-
'dependency-health': 5,
|
|
503
|
-
'change-amplification': 5,
|
|
504
|
-
};
|
|
505
|
-
return DEFAULT_TOOL_WEIGHTS2[toolName] ?? 5;
|
|
506
|
-
}
|
|
507
|
-
function parseWeightString(weightStr) {
|
|
508
|
-
const weights = /* @__PURE__ */ new Map();
|
|
509
|
-
if (!weightStr) return weights;
|
|
510
|
-
const pairs = weightStr.split(',');
|
|
511
|
-
for (const pair of pairs) {
|
|
512
|
-
const [toolShortName, weightValueStr] = pair.split(':');
|
|
513
|
-
if (toolShortName && weightValueStr) {
|
|
514
|
-
const toolName = normalizeToolName(toolShortName.trim());
|
|
515
|
-
const weight = parseInt(weightValueStr.trim(), 10);
|
|
516
|
-
if (!isNaN(weight) && weight > 0) {
|
|
517
|
-
weights.set(toolName, weight);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
return weights;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
// src/scoring.ts
|
|
525
|
-
function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
526
|
-
if (toolOutputs.size === 0) {
|
|
527
|
-
throw new Error('No tool outputs provided for scoring');
|
|
528
|
-
}
|
|
529
|
-
const ScoringProfile2 = {
|
|
530
|
-
Default: 'default',
|
|
531
|
-
Strict: 'strict',
|
|
532
|
-
Relaxed: 'relaxed',
|
|
533
|
-
Enterprise: 'enterprise',
|
|
534
|
-
Minimal: 'minimal',
|
|
535
|
-
};
|
|
536
|
-
const profile = config?.scoring?.profile || ScoringProfile2.Default;
|
|
537
|
-
const weights = /* @__PURE__ */ new Map();
|
|
538
|
-
if (cliWeights) {
|
|
539
|
-
cliWeights.forEach((weight, tool) => weights.set(tool, weight));
|
|
540
|
-
}
|
|
541
|
-
if (config?.scoring?.weights) {
|
|
542
|
-
Object.entries(config.scoring.weights).forEach(([tool, weight]) => {
|
|
543
|
-
if (!weights.has(tool)) {
|
|
544
|
-
weights.set(tool, weight);
|
|
545
|
-
}
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
const DEFAULT_TOOL_WEIGHTS2 = {
|
|
549
|
-
'pattern-detect': 15,
|
|
550
|
-
'context-analyzer': 20,
|
|
551
|
-
'naming-consistency': 10,
|
|
552
|
-
'ai-signal-clarity': 15,
|
|
553
|
-
'agent-grounding': 10,
|
|
554
|
-
'testability-index': 10,
|
|
555
|
-
'doc-drift': 10,
|
|
556
|
-
'dependency-health': 5,
|
|
557
|
-
'change-amplification': 5,
|
|
558
|
-
};
|
|
559
|
-
toolOutputs.forEach((_, tool) => {
|
|
560
|
-
if (!weights.has(tool)) {
|
|
561
|
-
weights.set(tool, DEFAULT_TOOL_WEIGHTS2[tool] ?? 5);
|
|
562
|
-
}
|
|
563
|
-
});
|
|
564
|
-
let totalWeight = 0;
|
|
565
|
-
let weightedSum = 0;
|
|
566
|
-
toolOutputs.forEach((output, tool) => {
|
|
567
|
-
const weight = weights.get(tool) || 5;
|
|
568
|
-
totalWeight += weight;
|
|
569
|
-
weightedSum += output.score * weight;
|
|
570
|
-
});
|
|
571
|
-
const overall = Math.round(weightedSum / totalWeight);
|
|
572
|
-
const getRating2 = (score) => {
|
|
573
|
-
if (score >= 90) return 'Excellent';
|
|
574
|
-
if (score >= 75) return 'Good';
|
|
575
|
-
if (score >= 60) return 'Fair';
|
|
576
|
-
if (score >= 40) return 'Needs Work';
|
|
577
|
-
return 'Critical';
|
|
578
|
-
};
|
|
579
|
-
const result = {
|
|
580
|
-
overall,
|
|
581
|
-
rating: getRating2(overall),
|
|
582
|
-
timestamp: /* @__PURE__ */ new Date().toISOString(),
|
|
583
|
-
toolsUsed: Array.from(toolOutputs.keys()),
|
|
584
|
-
breakdown: Array.from(toolOutputs.values()),
|
|
585
|
-
calculation: {
|
|
586
|
-
formula: `\u03A3(score_i \xD7 weight_i) / \u03A3(weight_i)`,
|
|
587
|
-
weights: Object.fromEntries(weights),
|
|
588
|
-
normalized: `${overall} = ${weightedSum.toFixed(1)} / ${totalWeight}`,
|
|
589
|
-
},
|
|
590
|
-
};
|
|
591
|
-
return result;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// src/utils/visualization.ts
|
|
595
|
-
function generateHTML(graph) {
|
|
596
|
-
const payload = JSON.stringify(graph, null, 2);
|
|
597
|
-
return `<!doctype html>
|
|
598
|
-
<html>
|
|
599
|
-
<head>
|
|
600
|
-
<meta charset="utf-8" />
|
|
601
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
602
|
-
<title>AIReady Visualization</title>
|
|
603
|
-
<style>
|
|
604
|
-
html,body { height: 100%; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f172a; color: #e2e8f0 }
|
|
605
|
-
#container { display:flex; height:100vh }
|
|
606
|
-
#panel { width: 320px; padding: 16px; background: #071130; box-shadow: -2px 0 8px rgba(0,0,0,0.3); overflow:auto }
|
|
607
|
-
#canvasWrap { flex:1; display:flex; align-items:center; justify-content:center }
|
|
608
|
-
canvas { background: #0b1220; border-radius:8px }
|
|
609
|
-
.stat { margin-bottom:12px }
|
|
610
|
-
</style>
|
|
611
|
-
</head>
|
|
612
|
-
<body>
|
|
613
|
-
<div id="container">
|
|
614
|
-
<div id="canvasWrap"><canvas id="canvas" width="1200" height="800"></canvas></div>
|
|
615
|
-
<div id="panel">
|
|
616
|
-
<h2>AIReady Visualization</h2>
|
|
617
|
-
<div class="stat"><strong>Files:</strong> <span id="stat-files"></span></div>
|
|
618
|
-
<div class="stat"><strong>Dependencies:</strong> <span id="stat-deps"></span></div>
|
|
619
|
-
<div class="stat"><strong>Legend</strong></div>
|
|
620
|
-
<div style="font-size:13px;line-height:1.3;color:#cbd5e1;margin-top:8px">
|
|
621
|
-
<div style="margin-bottom:8px"><span style="display:inline-block;width:12px;height:12px;background:#ff4d4f;margin-right:8px;border:1px solid rgba(255,255,255,0.06)"></span><strong>Critical</strong>: highest severity issues.</div>
|
|
622
|
-
<div style="margin-bottom:8px"><span style="display:inline-block;width:12px;height:12px;background:#ff9900;margin-right:8px;border:1px solid rgba(255,255,255,0.06)"></span><strong>Major</strong>: important issues.</div>
|
|
623
|
-
<div style="margin-bottom:8px"><span style="display:inline-block;width:12px;height:12px;background:#ffd666;margin-right:8px;border:1px solid rgba(255,255,255,0.06)"></span><strong>Minor</strong>: low priority issues.</div>
|
|
624
|
-
<div style="margin-bottom:8px"><span style="display:inline-block;width:12px;height:12px;background:#91d5ff;margin-right:8px;border:1px solid rgba(255,255,255,0.06)"></span><strong>Info</strong>: informational notes.</div>
|
|
625
|
-
<div style="margin-top:10px;color:#94a3b8"><strong>Node size</strong>: larger = higher token cost, more issues or dependency weight.</div>
|
|
626
|
-
<div style="margin-top:6px;color:#94a3b8"><strong>Proximity</strong>: nodes that are spatially close are more contextually related; relatedness is represented by distance and size rather than explicit edges.</div>
|
|
627
|
-
<div style="margin-top:6px;color:#94a3b8"><strong>Edge colors</strong>: <span style="color:#fb7e81">Similarity</span>, <span style="color:#84c1ff">Dependency</span>, <span style="color:#ffa500">Reference</span>, default <span style="color:#334155">Other</span>.</div>
|
|
628
|
-
</div>
|
|
629
|
-
</div>
|
|
630
|
-
</div>
|
|
631
|
-
|
|
632
|
-
<script>
|
|
633
|
-
const graphData = ${payload};
|
|
634
|
-
document.getElementById('stat-files').textContent = graphData.metadata.totalFiles;
|
|
635
|
-
document.getElementById('stat-deps').textContent = graphData.metadata.totalDependencies;
|
|
636
|
-
|
|
637
|
-
const canvas = document.getElementById('canvas');
|
|
638
|
-
const ctx = canvas.getContext('2d');
|
|
639
|
-
|
|
640
|
-
const nodes = graphData.nodes.map((n, i) => ({
|
|
641
|
-
...n,
|
|
642
|
-
x: canvas.width / 2 + Math.cos(i / graphData.nodes.length * Math.PI * 2) * (Math.min(canvas.width, canvas.height) / 3),
|
|
643
|
-
y: canvas.height / 2 + Math.sin(i / graphData.nodes.length * Math.PI * 2) * (Math.min(canvas.width, canvas.height) / 3),
|
|
644
|
-
}));
|
|
645
|
-
|
|
646
|
-
function draw() {
|
|
647
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
648
|
-
|
|
649
|
-
graphData.edges.forEach(edge => {
|
|
650
|
-
const s = nodes.find(n => n.id === edge.source);
|
|
651
|
-
const t = nodes.find(n => n.id === edge.target);
|
|
652
|
-
if (!s || !t) return;
|
|
653
|
-
if (edge.type === 'related') return;
|
|
654
|
-
if (edge.type === 'similarity') {
|
|
655
|
-
ctx.strokeStyle = '#fb7e81';
|
|
656
|
-
ctx.lineWidth = 1.2;
|
|
657
|
-
} else if (edge.type === 'dependency') {
|
|
658
|
-
ctx.strokeStyle = '#84c1ff';
|
|
659
|
-
ctx.lineWidth = 1.0;
|
|
660
|
-
} else if (edge.type === 'reference') {
|
|
661
|
-
ctx.strokeStyle = '#ffa500';
|
|
662
|
-
ctx.lineWidth = 0.9;
|
|
663
|
-
} else {
|
|
664
|
-
ctx.strokeStyle = '#334155';
|
|
665
|
-
ctx.lineWidth = 0.8;
|
|
666
|
-
}
|
|
667
|
-
ctx.beginPath();
|
|
668
|
-
ctx.moveTo(s.x, s.y);
|
|
669
|
-
ctx.lineTo(t.x, t.y);
|
|
670
|
-
ctx.stroke();
|
|
671
|
-
});
|
|
672
|
-
|
|
673
|
-
const groups = {};
|
|
674
|
-
nodes.forEach(n => {
|
|
675
|
-
const g = n.group || '__default';
|
|
676
|
-
if (!groups[g]) groups[g] = { minX: n.x, minY: n.y, maxX: n.x, maxY: n.y };
|
|
677
|
-
groups[g].minX = Math.min(groups[g].minX, n.x);
|
|
678
|
-
groups[g].minY = Math.min(groups[g].minY, n.y);
|
|
679
|
-
groups[g].maxX = Math.max(groups[g].maxX, n.x);
|
|
680
|
-
groups[g].maxY = Math.max(groups[g].maxY, n.y);
|
|
681
|
-
});
|
|
682
|
-
|
|
683
|
-
const groupRelations = {};
|
|
684
|
-
graphData.edges.forEach(edge => {
|
|
685
|
-
const sNode = nodes.find(n => n.id === edge.source);
|
|
686
|
-
const tNode = nodes.find(n => n.id === edge.target);
|
|
687
|
-
if (!sNode || !tNode) return;
|
|
688
|
-
const g1 = sNode.group || '__default';
|
|
689
|
-
const g2 = tNode.group || '__default';
|
|
690
|
-
if (g1 === g2) return;
|
|
691
|
-
const key = g1 < g2 ? g1 + '::' + g2 : g2 + '::' + g1;
|
|
692
|
-
groupRelations[key] = (groupRelations[key] || 0) + 1;
|
|
693
|
-
});
|
|
694
|
-
|
|
695
|
-
Object.keys(groupRelations).forEach(k => {
|
|
696
|
-
const count = groupRelations[k];
|
|
697
|
-
const [ga, gb] = k.split('::');
|
|
698
|
-
if (!groups[ga] || !groups[gb]) return;
|
|
699
|
-
const ax = (groups[ga].minX + groups[ga].maxX) / 2;
|
|
700
|
-
const ay = (groups[ga].minY + groups[ga].maxY) / 2;
|
|
701
|
-
const bx = (groups[gb].minX + groups[gb].maxX) / 2;
|
|
702
|
-
const by = (groups[gb].minY + groups[gb].maxY) / 2;
|
|
703
|
-
ctx.beginPath();
|
|
704
|
-
ctx.strokeStyle = 'rgba(148,163,184,0.25)';
|
|
705
|
-
ctx.lineWidth = Math.min(6, 0.6 + Math.sqrt(count));
|
|
706
|
-
ctx.moveTo(ax, ay);
|
|
707
|
-
ctx.lineTo(bx, by);
|
|
708
|
-
ctx.stroke();
|
|
709
|
-
});
|
|
710
|
-
|
|
711
|
-
Object.keys(groups).forEach(g => {
|
|
712
|
-
if (g === '__default') return;
|
|
713
|
-
const box = groups[g];
|
|
714
|
-
const pad = 16;
|
|
715
|
-
const x = box.minX - pad;
|
|
716
|
-
const y = box.minY - pad;
|
|
717
|
-
const w = (box.maxX - box.minX) + pad * 2;
|
|
718
|
-
const h = (box.maxY - box.minY) + pad * 2;
|
|
719
|
-
ctx.save();
|
|
720
|
-
ctx.fillStyle = 'rgba(30,64,175,0.04)';
|
|
721
|
-
ctx.strokeStyle = 'rgba(30,64,175,0.12)';
|
|
722
|
-
ctx.lineWidth = 1.2;
|
|
723
|
-
const r = 8;
|
|
724
|
-
ctx.beginPath();
|
|
725
|
-
ctx.moveTo(x + r, y);
|
|
726
|
-
ctx.arcTo(x + w, y, x + w, y + h, r);
|
|
727
|
-
ctx.arcTo(x + w, y + h, x, y + h, r);
|
|
728
|
-
ctx.arcTo(x, y + h, x, y, r);
|
|
729
|
-
ctx.arcTo(x, y, x + w, y, r);
|
|
730
|
-
ctx.closePath();
|
|
731
|
-
ctx.fill();
|
|
732
|
-
ctx.stroke();
|
|
733
|
-
ctx.restore();
|
|
734
|
-
ctx.fillStyle = '#94a3b8';
|
|
735
|
-
ctx.font = '11px sans-serif';
|
|
736
|
-
ctx.fillText(g, x + 8, y + 14);
|
|
737
|
-
});
|
|
738
|
-
|
|
739
|
-
nodes.forEach(n => {
|
|
740
|
-
const sizeVal = (n.size || n.value || 1);
|
|
741
|
-
const r = 6 + (sizeVal / 2);
|
|
742
|
-
ctx.beginPath();
|
|
743
|
-
ctx.fillStyle = n.color || '#60a5fa';
|
|
744
|
-
ctx.arc(n.x, n.y, r, 0, Math.PI * 2);
|
|
745
|
-
ctx.fill();
|
|
746
|
-
|
|
747
|
-
ctx.fillStyle = '#e2e8f0';
|
|
748
|
-
ctx.font = '11px sans-serif';
|
|
749
|
-
ctx.textAlign = 'center';
|
|
750
|
-
ctx.fillText(n.label || n.id.split('/').slice(-1)[0], n.x, n.y + r + 12);
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
draw();
|
|
755
|
-
</script>
|
|
756
|
-
</body>
|
|
757
|
-
</html>`;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
export {
|
|
761
|
-
Severity,
|
|
762
|
-
SeveritySchema,
|
|
763
|
-
ToolName,
|
|
764
|
-
ToolNameSchema,
|
|
765
|
-
FRIENDLY_TOOL_NAMES,
|
|
766
|
-
IssueType,
|
|
767
|
-
IssueTypeSchema,
|
|
768
|
-
AnalysisStatus,
|
|
769
|
-
AnalysisStatusSchema,
|
|
770
|
-
ModelTier,
|
|
771
|
-
ModelTierSchema,
|
|
772
|
-
LocationSchema,
|
|
773
|
-
IssueSchema,
|
|
774
|
-
MetricsSchema,
|
|
775
|
-
AnalysisResultSchema,
|
|
776
|
-
SpokeSummarySchema,
|
|
777
|
-
SpokeOutputSchema,
|
|
778
|
-
UnifiedReportSchema,
|
|
779
|
-
GLOBAL_INFRA_OPTIONS,
|
|
780
|
-
COMMON_FINE_TUNING_OPTIONS,
|
|
781
|
-
GLOBAL_SCAN_OPTIONS,
|
|
782
|
-
Language,
|
|
783
|
-
LANGUAGE_EXTENSIONS,
|
|
784
|
-
ParseError,
|
|
785
|
-
RecommendationPriority,
|
|
786
|
-
ReadinessRating,
|
|
787
|
-
TOOL_NAME_MAP,
|
|
788
|
-
DEFAULT_TOOL_WEIGHTS,
|
|
789
|
-
ScoringProfile,
|
|
790
|
-
SCORING_PROFILES,
|
|
791
|
-
CONTEXT_TIER_THRESHOLDS,
|
|
792
|
-
SIZE_ADJUSTED_THRESHOLDS,
|
|
793
|
-
getRating,
|
|
794
|
-
getRatingWithContext,
|
|
795
|
-
getRatingDisplay,
|
|
796
|
-
formatScore,
|
|
797
|
-
formatToolScore,
|
|
798
|
-
getProjectSizeTier,
|
|
799
|
-
getRecommendedThreshold,
|
|
800
|
-
normalizeToolName,
|
|
801
|
-
getToolWeight,
|
|
802
|
-
parseWeightString,
|
|
803
|
-
calculateOverallScore,
|
|
804
|
-
generateHTML,
|
|
805
|
-
};
|