@aiready/core 0.23.20 → 0.23.22
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/chunk-2N7ISIKE.mjs +158 -0
- package/dist/chunk-ARUIZO7M.mjs +297 -0
- package/dist/chunk-CYC5EGEI.mjs +297 -0
- package/dist/{chunk-REU6OUBT.mjs → chunk-DBOPSRBC.mjs} +47 -22
- package/dist/chunk-E55RNGGK.mjs +852 -0
- package/dist/chunk-EZ7ECLAZ.mjs +299 -0
- package/dist/chunk-FNPULWG7.mjs +248 -0
- package/dist/chunk-FZTFKZUQ.mjs +250 -0
- package/dist/chunk-GTS642BQ.mjs +262 -0
- package/dist/chunk-IXPY5J4K.mjs +248 -0
- package/dist/chunk-JJQLYW6Z.mjs +111 -0
- package/dist/chunk-L6BKANJC.mjs +130 -0
- package/dist/chunk-LXEO5PG3.mjs +292 -0
- package/dist/chunk-LZHO636W.mjs +501 -0
- package/dist/chunk-MTK2IIDZ.mjs +262 -0
- package/dist/chunk-QDCQETSI.mjs +262 -0
- package/dist/chunk-QZNY7B2N.mjs +248 -0
- package/dist/chunk-RCZSMGCX.mjs +250 -0
- package/dist/chunk-SWZOT67M.mjs +250 -0
- package/dist/chunk-U3IY2CFC.mjs +36 -0
- package/dist/chunk-UBCM5Y6R.mjs +275 -0
- package/dist/chunk-UTCRW3N7.mjs +301 -0
- package/dist/{chunk-SQHS6PFL.mjs → chunk-UYLH35LA.mjs} +47 -22
- package/dist/{chunk-ZB3EHHAG.mjs → chunk-WVNVC2PP.mjs} +90 -60
- package/dist/chunk-WYOW6O3P.mjs +114 -0
- package/dist/{chunk-RMH2TPAT.mjs → chunk-YRSSR4KN.mjs} +87 -59
- package/dist/client/index.d.mts +2 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +922 -0
- package/dist/client/index.mjs +104 -0
- package/dist/client-2xbeKnrg.d.mts +1291 -0
- package/dist/client-2xbeKnrg.d.ts +1291 -0
- package/dist/client-4HLAGzFg.d.mts +1291 -0
- package/dist/client-4HLAGzFg.d.ts +1291 -0
- package/dist/client-B4TQwNa7.d.mts +1290 -0
- package/dist/client-B4TQwNa7.d.ts +1290 -0
- package/dist/client-Bdi4ty0v.d.mts +1294 -0
- package/dist/client-Bdi4ty0v.d.ts +1294 -0
- package/dist/client-BsKpUH3H.d.mts +1339 -0
- package/dist/client-BsKpUH3H.d.ts +1339 -0
- package/dist/client-Bv1zOaWF.d.mts +1291 -0
- package/dist/client-Bv1zOaWF.d.ts +1291 -0
- package/dist/client-Bz9YJMIX.d.mts +1290 -0
- package/dist/client-Bz9YJMIX.d.ts +1290 -0
- package/dist/client-CBpzm34X.d.mts +1291 -0
- package/dist/client-CBpzm34X.d.ts +1291 -0
- package/dist/client-CNu_tCZZ.d.mts +1305 -0
- package/dist/client-CNu_tCZZ.d.ts +1305 -0
- package/dist/client-CmEvxxQu.d.mts +1339 -0
- package/dist/client-CmEvxxQu.d.ts +1339 -0
- package/dist/client-Ctl_0z6F.d.mts +1294 -0
- package/dist/client-Ctl_0z6F.d.ts +1294 -0
- package/dist/client-DGMAxkZc.d.mts +1339 -0
- package/dist/client-DGMAxkZc.d.ts +1339 -0
- package/dist/client-DZq-CqcD.d.mts +1292 -0
- package/dist/client-DZq-CqcD.d.ts +1292 -0
- package/dist/{client-CYz0qxGB.d.mts → client-DcqGfDTt.d.mts} +90 -23
- package/dist/{client-CYz0qxGB.d.ts → client-DcqGfDTt.d.ts} +90 -23
- package/dist/{client-jGuH6TAG.d.mts → client-O8RvSRm0.d.mts} +18 -1
- package/dist/{client-jGuH6TAG.d.ts → client-O8RvSRm0.d.ts} +18 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +47 -13
- package/dist/client.mjs +6 -4
- package/dist/csharp-parser-4ZKCSX5B.mjs +9 -0
- package/dist/csharp-parser-5HKICCRR.mjs +9 -0
- package/dist/csharp-parser-JCKXIAJW.mjs +9 -0
- package/dist/go-parser-J4KIH4RG.mjs +9 -0
- package/dist/go-parser-TKXL3DVH.mjs +9 -0
- package/dist/go-parser-XOM232XZ.mjs +9 -0
- package/dist/index-Ctl_0z6F.d.mts +1294 -0
- package/dist/index-Ctl_0z6F.d.ts +1294 -0
- package/dist/index.d.mts +372 -165
- package/dist/index.d.ts +372 -165
- package/dist/index.js +3825 -3123
- package/dist/index.mjs +901 -2128
- package/dist/java-parser-3KHXOXRQ.mjs +9 -0
- package/dist/java-parser-MASGS4WB.mjs +9 -0
- package/dist/java-parser-T5LXD63J.mjs +9 -0
- package/dist/python-parser-FNFK2473.mjs +8 -0
- package/dist/typescript-parser-2GGNRNB5.mjs +7 -0
- package/dist/typescript-parser-3ENJ6C7H.mjs +7 -0
- package/dist/typescript-parser-4GI7DPSW.mjs +7 -0
- package/dist/typescript-parser-4H3HUBO4.mjs +7 -0
- package/dist/typescript-parser-K63IVZMF.mjs +7 -0
- package/dist/typescript-parser-ZJKROMQG.mjs +7 -0
- package/package.json +6 -6
- package/dist/chunk-2Y6WZCES.mjs +0 -859
- package/dist/chunk-5SHLHMH7.mjs +0 -760
- package/dist/chunk-CGOS2J6T.mjs +0 -807
- package/dist/chunk-FMNCV4CC.mjs +0 -859
- package/dist/chunk-Q55AMEFV.mjs +0 -760
- package/dist/chunk-ST75O5C5.mjs +0 -859
- package/dist/chunk-TJXR2CHZ.mjs +0 -799
- package/dist/client-BEoUYNLp.d.mts +0 -1191
- package/dist/client-BEoUYNLp.d.ts +0 -1191
- package/dist/client-BrIMPk89.d.mts +0 -1214
- package/dist/client-BrIMPk89.d.ts +0 -1214
- package/dist/client-C5BuGX4F.d.mts +0 -1205
- package/dist/client-C5BuGX4F.d.ts +0 -1205
- package/dist/client-CKcjnPXt.d.mts +0 -1214
- package/dist/client-CKcjnPXt.d.ts +0 -1214
- package/dist/client-CLulBnie.d.mts +0 -1182
- package/dist/client-CLulBnie.d.ts +0 -1182
- package/dist/client-CQwvp8ep.d.mts +0 -1182
- package/dist/client-CQwvp8ep.d.ts +0 -1182
- package/dist/client-DLvFR2qA.d.mts +0 -1197
- package/dist/client-DLvFR2qA.d.ts +0 -1197
- package/dist/client-PFPdeo-z.d.mts +0 -1186
- package/dist/client-PFPdeo-z.d.ts +0 -1186
- package/dist/client-WVCAIWdJ.d.mts +0 -1192
- package/dist/client-WVCAIWdJ.d.ts +0 -1192
- package/dist/client-pYldIAg2.d.mts +0 -1209
- package/dist/client-pYldIAg2.d.ts +0 -1209
- package/dist/client-wk2fgk1q.d.mts +0 -1184
- package/dist/client-wk2fgk1q.d.ts +0 -1184
package/dist/chunk-Q55AMEFV.mjs
DELETED
|
@@ -1,760 +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.object({
|
|
120
|
-
totalFiles: z.number().optional(),
|
|
121
|
-
totalIssues: z.number().optional(),
|
|
122
|
-
criticalIssues: z.number().optional(),
|
|
123
|
-
majorIssues: z.number().optional(),
|
|
124
|
-
score: z.number().optional()
|
|
125
|
-
}).catchall(z.any());
|
|
126
|
-
var SpokeOutputSchema = z.object({
|
|
127
|
-
results: z.array(AnalysisResultSchema),
|
|
128
|
-
summary: SpokeSummarySchema,
|
|
129
|
-
metadata: z.object({
|
|
130
|
-
toolName: z.string(),
|
|
131
|
-
version: z.string().optional(),
|
|
132
|
-
timestamp: z.string().optional(),
|
|
133
|
-
config: z.any().optional()
|
|
134
|
-
}).catchall(z.any()).optional()
|
|
135
|
-
});
|
|
136
|
-
var UnifiedReportSchema = z.object({
|
|
137
|
-
summary: z.object({
|
|
138
|
-
totalFiles: z.number(),
|
|
139
|
-
totalIssues: z.number(),
|
|
140
|
-
criticalIssues: z.number(),
|
|
141
|
-
majorIssues: z.number(),
|
|
142
|
-
businessImpact: z.object({
|
|
143
|
-
estimatedMonthlyWaste: z.number().optional(),
|
|
144
|
-
potentialSavings: z.number().optional(),
|
|
145
|
-
productivityHours: z.number().optional()
|
|
146
|
-
}).optional()
|
|
147
|
-
}),
|
|
148
|
-
results: z.array(AnalysisResultSchema),
|
|
149
|
-
scoring: z.object({
|
|
150
|
-
overall: z.number(),
|
|
151
|
-
rating: z.string(),
|
|
152
|
-
timestamp: z.string(),
|
|
153
|
-
breakdown: z.array(
|
|
154
|
-
z.object({
|
|
155
|
-
toolName: z.union([ToolNameSchema, z.string()]),
|
|
156
|
-
score: z.number()
|
|
157
|
-
}).catchall(z.any())
|
|
158
|
-
)
|
|
159
|
-
}).optional()
|
|
160
|
-
}).catchall(z.any());
|
|
161
|
-
|
|
162
|
-
// src/types/business.ts
|
|
163
|
-
import { z as z2 } from "zod";
|
|
164
|
-
var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
|
|
165
|
-
LeadSource2["ClawMoreHero"] = "clawmore-hero";
|
|
166
|
-
LeadSource2["ClawMoreWaitlist"] = "clawmore-waitlist";
|
|
167
|
-
LeadSource2["ClawMoreBeta"] = "clawmore-beta";
|
|
168
|
-
LeadSource2["AiReadyPlatform"] = "aiready-platform";
|
|
169
|
-
return LeadSource2;
|
|
170
|
-
})(LeadSource || {});
|
|
171
|
-
var LeadSourceSchema = z2.nativeEnum(LeadSource);
|
|
172
|
-
var LeadSchema = z2.object({
|
|
173
|
-
id: z2.string(),
|
|
174
|
-
email: z2.string().email(),
|
|
175
|
-
name: z2.string().min(1),
|
|
176
|
-
interest: z2.string().default("General"),
|
|
177
|
-
notes: z2.string().optional(),
|
|
178
|
-
timestamp: z2.string().datetime(),
|
|
179
|
-
source: LeadSourceSchema,
|
|
180
|
-
status: z2.enum(["new", "contacted", "qualified", "converted", "archived"]).default("new")
|
|
181
|
-
});
|
|
182
|
-
var LeadSubmissionSchema = LeadSchema.omit({
|
|
183
|
-
id: true,
|
|
184
|
-
timestamp: true,
|
|
185
|
-
status: true
|
|
186
|
-
});
|
|
187
|
-
var ManagedAccountSchema = z2.object({
|
|
188
|
-
id: z2.string(),
|
|
189
|
-
// Internal UUID
|
|
190
|
-
accountId: z2.string(),
|
|
191
|
-
// AWS Account ID
|
|
192
|
-
userId: z2.string(),
|
|
193
|
-
// Owner (caopengau@gmail.com)
|
|
194
|
-
stripeSubscriptionId: z2.string(),
|
|
195
|
-
// AI Token Management
|
|
196
|
-
tokenStrategy: z2.enum(["managed", "byok"]).default("managed"),
|
|
197
|
-
byokConfig: z2.object({
|
|
198
|
-
openaiKey: z2.string().optional(),
|
|
199
|
-
anthropicKey: z2.string().optional(),
|
|
200
|
-
openrouterKey: z2.string().optional()
|
|
201
|
-
}).optional(),
|
|
202
|
-
// Financials (in cents)
|
|
203
|
-
baseFeeCents: z2.number().default(2900),
|
|
204
|
-
includedComputeCents: z2.number().default(1500),
|
|
205
|
-
// $15.00 AWS included
|
|
206
|
-
includedTokenCents: z2.number().default(500),
|
|
207
|
-
// $5.00 Managed Tokens included
|
|
208
|
-
// Pre-paid Balance (credits)
|
|
209
|
-
prepaidTokenBalanceCents: z2.number().default(0),
|
|
210
|
-
// Users buy these in $10 packs
|
|
211
|
-
currentMonthlyTokenSpendCents: z2.number().default(0),
|
|
212
|
-
// Governance
|
|
213
|
-
status: z2.enum(["provisioning", "active", "warning", "quarantined", "suspended"]).default("provisioning"),
|
|
214
|
-
lastCostSyncAt: z2.string().datetime().optional(),
|
|
215
|
-
region: z2.string().default("ap-southeast-2"),
|
|
216
|
-
// Alerting thresholds (percentage of includedComputeCents)
|
|
217
|
-
alertThresholds: z2.array(z2.number()).default([50, 80, 100, 150])
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
// src/types.ts
|
|
221
|
-
var GLOBAL_INFRA_OPTIONS = [
|
|
222
|
-
"rootDir",
|
|
223
|
-
"include",
|
|
224
|
-
"exclude",
|
|
225
|
-
"tools",
|
|
226
|
-
"scoring"
|
|
227
|
-
];
|
|
228
|
-
var GLOBAL_SCAN_OPTIONS = [
|
|
229
|
-
"rootDir",
|
|
230
|
-
"include",
|
|
231
|
-
"exclude",
|
|
232
|
-
"config",
|
|
233
|
-
"threshold",
|
|
234
|
-
"output",
|
|
235
|
-
"format",
|
|
236
|
-
"parallel",
|
|
237
|
-
"showBreakdown"
|
|
238
|
-
];
|
|
239
|
-
var COMMON_FINE_TUNING_OPTIONS = [
|
|
240
|
-
"maxDepth",
|
|
241
|
-
"minSimilarity",
|
|
242
|
-
"threshold",
|
|
243
|
-
"showBreakdown"
|
|
244
|
-
];
|
|
245
|
-
|
|
246
|
-
// src/types/language.ts
|
|
247
|
-
var Language = /* @__PURE__ */ ((Language2) => {
|
|
248
|
-
Language2["TypeScript"] = "typescript";
|
|
249
|
-
Language2["JavaScript"] = "javascript";
|
|
250
|
-
Language2["Python"] = "python";
|
|
251
|
-
Language2["Java"] = "java";
|
|
252
|
-
Language2["Go"] = "go";
|
|
253
|
-
Language2["Rust"] = "rust";
|
|
254
|
-
Language2["CSharp"] = "csharp";
|
|
255
|
-
return Language2;
|
|
256
|
-
})(Language || {});
|
|
257
|
-
var LANGUAGE_EXTENSIONS = {
|
|
258
|
-
".ts": "typescript" /* TypeScript */,
|
|
259
|
-
".tsx": "typescript" /* TypeScript */,
|
|
260
|
-
".js": "javascript" /* JavaScript */,
|
|
261
|
-
".jsx": "javascript" /* JavaScript */,
|
|
262
|
-
".py": "python" /* Python */,
|
|
263
|
-
".java": "java" /* Java */,
|
|
264
|
-
".go": "go" /* Go */,
|
|
265
|
-
".rs": "rust" /* Rust */,
|
|
266
|
-
".cs": "csharp" /* CSharp */
|
|
267
|
-
};
|
|
268
|
-
var ParseError = class extends Error {
|
|
269
|
-
constructor(message, filePath, loc) {
|
|
270
|
-
super(message);
|
|
271
|
-
this.filePath = filePath;
|
|
272
|
-
this.loc = loc;
|
|
273
|
-
this.name = "ParseError";
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
// src/scoring.ts
|
|
278
|
-
var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
|
|
279
|
-
RecommendationPriority2["High"] = "high";
|
|
280
|
-
RecommendationPriority2["Medium"] = "medium";
|
|
281
|
-
RecommendationPriority2["Low"] = "low";
|
|
282
|
-
return RecommendationPriority2;
|
|
283
|
-
})(RecommendationPriority || {});
|
|
284
|
-
var ReadinessRating = /* @__PURE__ */ ((ReadinessRating2) => {
|
|
285
|
-
ReadinessRating2["Excellent"] = "Excellent";
|
|
286
|
-
ReadinessRating2["Good"] = "Good";
|
|
287
|
-
ReadinessRating2["Fair"] = "Fair";
|
|
288
|
-
ReadinessRating2["NeedsWork"] = "Needs Work";
|
|
289
|
-
ReadinessRating2["Critical"] = "Critical";
|
|
290
|
-
return ReadinessRating2;
|
|
291
|
-
})(ReadinessRating || {});
|
|
292
|
-
var DEFAULT_TOOL_WEIGHTS = {
|
|
293
|
-
["pattern-detect" /* PatternDetect */]: 22,
|
|
294
|
-
["context-analyzer" /* ContextAnalyzer */]: 19,
|
|
295
|
-
["naming-consistency" /* NamingConsistency */]: 14,
|
|
296
|
-
["ai-signal-clarity" /* AiSignalClarity */]: 11,
|
|
297
|
-
["agent-grounding" /* AgentGrounding */]: 10,
|
|
298
|
-
["testability-index" /* TestabilityIndex */]: 10,
|
|
299
|
-
["doc-drift" /* DocDrift */]: 8,
|
|
300
|
-
["dependency-health" /* DependencyHealth */]: 6,
|
|
301
|
-
["change-amplification" /* ChangeAmplification */]: 8
|
|
302
|
-
};
|
|
303
|
-
var TOOL_NAME_MAP = {
|
|
304
|
-
patterns: "pattern-detect" /* PatternDetect */,
|
|
305
|
-
"pattern-detect": "pattern-detect" /* PatternDetect */,
|
|
306
|
-
context: "context-analyzer" /* ContextAnalyzer */,
|
|
307
|
-
"context-analyzer": "context-analyzer" /* ContextAnalyzer */,
|
|
308
|
-
consistency: "naming-consistency" /* NamingConsistency */,
|
|
309
|
-
"naming-consistency": "naming-consistency" /* NamingConsistency */,
|
|
310
|
-
"ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
|
|
311
|
-
"ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
|
|
312
|
-
grounding: "agent-grounding" /* AgentGrounding */,
|
|
313
|
-
"agent-grounding": "agent-grounding" /* AgentGrounding */,
|
|
314
|
-
testability: "testability-index" /* TestabilityIndex */,
|
|
315
|
-
"testability-index": "testability-index" /* TestabilityIndex */,
|
|
316
|
-
"doc-drift": "doc-drift" /* DocDrift */,
|
|
317
|
-
"deps-health": "dependency-health" /* DependencyHealth */,
|
|
318
|
-
"dependency-health": "dependency-health" /* DependencyHealth */,
|
|
319
|
-
"change-amp": "change-amplification" /* ChangeAmplification */,
|
|
320
|
-
"change-amplification": "change-amplification" /* ChangeAmplification */
|
|
321
|
-
};
|
|
322
|
-
var ScoringProfile = /* @__PURE__ */ ((ScoringProfile2) => {
|
|
323
|
-
ScoringProfile2["Default"] = "default";
|
|
324
|
-
ScoringProfile2["Agentic"] = "agentic";
|
|
325
|
-
ScoringProfile2["Logic"] = "logic";
|
|
326
|
-
ScoringProfile2["UI"] = "ui";
|
|
327
|
-
ScoringProfile2["Cost"] = "cost";
|
|
328
|
-
ScoringProfile2["Security"] = "security";
|
|
329
|
-
return ScoringProfile2;
|
|
330
|
-
})(ScoringProfile || {});
|
|
331
|
-
var SCORING_PROFILES = {
|
|
332
|
-
["default" /* Default */]: DEFAULT_TOOL_WEIGHTS,
|
|
333
|
-
["agentic" /* Agentic */]: {
|
|
334
|
-
["ai-signal-clarity" /* AiSignalClarity */]: 30,
|
|
335
|
-
["agent-grounding" /* AgentGrounding */]: 30,
|
|
336
|
-
["testability-index" /* TestabilityIndex */]: 20,
|
|
337
|
-
["context-analyzer" /* ContextAnalyzer */]: 10,
|
|
338
|
-
["naming-consistency" /* NamingConsistency */]: 10
|
|
339
|
-
},
|
|
340
|
-
["logic" /* Logic */]: {
|
|
341
|
-
["testability-index" /* TestabilityIndex */]: 40,
|
|
342
|
-
["naming-consistency" /* NamingConsistency */]: 20,
|
|
343
|
-
["context-analyzer" /* ContextAnalyzer */]: 20,
|
|
344
|
-
["pattern-detect" /* PatternDetect */]: 10,
|
|
345
|
-
["change-amplification" /* ChangeAmplification */]: 10
|
|
346
|
-
},
|
|
347
|
-
["ui" /* UI */]: {
|
|
348
|
-
["naming-consistency" /* NamingConsistency */]: 30,
|
|
349
|
-
["context-analyzer" /* ContextAnalyzer */]: 30,
|
|
350
|
-
["pattern-detect" /* PatternDetect */]: 20,
|
|
351
|
-
["doc-drift" /* DocDrift */]: 10,
|
|
352
|
-
["ai-signal-clarity" /* AiSignalClarity */]: 10
|
|
353
|
-
},
|
|
354
|
-
["cost" /* Cost */]: {
|
|
355
|
-
["pattern-detect" /* PatternDetect */]: 50,
|
|
356
|
-
["context-analyzer" /* ContextAnalyzer */]: 30,
|
|
357
|
-
["change-amplification" /* ChangeAmplification */]: 10,
|
|
358
|
-
["dependency-health" /* DependencyHealth */]: 10
|
|
359
|
-
},
|
|
360
|
-
["security" /* Security */]: {
|
|
361
|
-
["naming-consistency" /* NamingConsistency */]: 40,
|
|
362
|
-
["testability-index" /* TestabilityIndex */]: 30,
|
|
363
|
-
["dependency-health" /* DependencyHealth */]: 20,
|
|
364
|
-
["context-analyzer" /* ContextAnalyzer */]: 10
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
var CONTEXT_TIER_THRESHOLDS = {
|
|
368
|
-
compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
|
|
369
|
-
standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
|
|
370
|
-
extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
|
|
371
|
-
frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
|
|
372
|
-
};
|
|
373
|
-
var SIZE_ADJUSTED_THRESHOLDS = {
|
|
374
|
-
xs: 80,
|
|
375
|
-
// < 50 files
|
|
376
|
-
small: 75,
|
|
377
|
-
// 50-200 files
|
|
378
|
-
medium: 70,
|
|
379
|
-
// 200-500 files
|
|
380
|
-
large: 65,
|
|
381
|
-
// 500-2000 files
|
|
382
|
-
enterprise: 58
|
|
383
|
-
// 2000+ files
|
|
384
|
-
};
|
|
385
|
-
function getProjectSizeTier(fileCount) {
|
|
386
|
-
if (fileCount < 50) return "xs";
|
|
387
|
-
if (fileCount < 200) return "small";
|
|
388
|
-
if (fileCount < 500) return "medium";
|
|
389
|
-
if (fileCount < 2e3) return "large";
|
|
390
|
-
return "enterprise";
|
|
391
|
-
}
|
|
392
|
-
function getRecommendedThreshold(fileCount, modelTier = "standard") {
|
|
393
|
-
const sizeTier = getProjectSizeTier(fileCount);
|
|
394
|
-
const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
|
|
395
|
-
const modelBonus = modelTier === "frontier" ? -3 : modelTier === "extended" ? -2 : 0;
|
|
396
|
-
return base + modelBonus;
|
|
397
|
-
}
|
|
398
|
-
function normalizeToolName(shortName) {
|
|
399
|
-
return TOOL_NAME_MAP[shortName.toLowerCase()] || shortName;
|
|
400
|
-
}
|
|
401
|
-
function getToolWeight(toolName, toolConfig, cliOverride, profile = "default" /* Default */) {
|
|
402
|
-
if (cliOverride !== void 0) return cliOverride;
|
|
403
|
-
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
404
|
-
const profileWeights = SCORING_PROFILES[profile] || DEFAULT_TOOL_WEIGHTS;
|
|
405
|
-
return profileWeights[toolName] ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
|
|
406
|
-
}
|
|
407
|
-
function parseWeightString(weightStr) {
|
|
408
|
-
const weights = /* @__PURE__ */ new Map();
|
|
409
|
-
if (!weightStr) return weights;
|
|
410
|
-
const pairs = weightStr.split(",");
|
|
411
|
-
for (const pair of pairs) {
|
|
412
|
-
const [toolShortName, weightValueStr] = pair.split(":");
|
|
413
|
-
if (toolShortName && weightValueStr) {
|
|
414
|
-
const toolName = normalizeToolName(toolShortName.trim());
|
|
415
|
-
const weight = parseInt(weightValueStr.trim(), 10);
|
|
416
|
-
if (!isNaN(weight) && weight > 0) {
|
|
417
|
-
weights.set(toolName, weight);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
return weights;
|
|
422
|
-
}
|
|
423
|
-
function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
424
|
-
if (toolOutputs.size === 0) {
|
|
425
|
-
throw new Error("No tool outputs provided for scoring");
|
|
426
|
-
}
|
|
427
|
-
const profile = config?.scoring?.profile || "default" /* Default */;
|
|
428
|
-
const weights = /* @__PURE__ */ new Map();
|
|
429
|
-
for (const [toolName] of toolOutputs.entries()) {
|
|
430
|
-
const cliWeight = cliWeights?.get(toolName);
|
|
431
|
-
const configWeight = config?.tools?.[toolName]?.scoreWeight;
|
|
432
|
-
const weight = cliWeight ?? configWeight ?? getToolWeight(toolName, void 0, void 0, profile);
|
|
433
|
-
weights.set(toolName, weight);
|
|
434
|
-
}
|
|
435
|
-
let weightedSum = 0;
|
|
436
|
-
let totalWeight = 0;
|
|
437
|
-
const breakdown = [];
|
|
438
|
-
const toolsUsed = [];
|
|
439
|
-
const calculationWeights = {};
|
|
440
|
-
for (const [toolName, output] of toolOutputs.entries()) {
|
|
441
|
-
const weight = weights.get(toolName) || 5;
|
|
442
|
-
weightedSum += output.score * weight;
|
|
443
|
-
totalWeight += weight;
|
|
444
|
-
toolsUsed.push(toolName);
|
|
445
|
-
calculationWeights[toolName] = weight;
|
|
446
|
-
breakdown.push(output);
|
|
447
|
-
}
|
|
448
|
-
const overall = Math.round(weightedSum / totalWeight);
|
|
449
|
-
const rating = getRating(overall);
|
|
450
|
-
const formulaParts = Array.from(toolOutputs.entries()).map(
|
|
451
|
-
([name, output]) => {
|
|
452
|
-
const w = weights.get(name) || 5;
|
|
453
|
-
return `(${output.score} \xD7 ${w})`;
|
|
454
|
-
}
|
|
455
|
-
);
|
|
456
|
-
const formulaStr = `[${formulaParts.join(" + ")}] / ${totalWeight} = ${overall}`;
|
|
457
|
-
return {
|
|
458
|
-
overall,
|
|
459
|
-
rating,
|
|
460
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
461
|
-
toolsUsed,
|
|
462
|
-
breakdown,
|
|
463
|
-
calculation: {
|
|
464
|
-
formula: formulaStr,
|
|
465
|
-
weights: calculationWeights,
|
|
466
|
-
normalized: formulaStr
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
function getRating(score) {
|
|
471
|
-
if (score >= 90) return "Excellent" /* Excellent */;
|
|
472
|
-
if (score >= 75) return "Good" /* Good */;
|
|
473
|
-
if (score >= 60) return "Fair" /* Fair */;
|
|
474
|
-
if (score >= 40) return "Needs Work" /* NeedsWork */;
|
|
475
|
-
return "Critical" /* Critical */;
|
|
476
|
-
}
|
|
477
|
-
function getRatingSlug(score) {
|
|
478
|
-
if (score >= 90) return "excellent";
|
|
479
|
-
if (score >= 75) return "good";
|
|
480
|
-
if (score >= 60) return "fair";
|
|
481
|
-
if (score >= 40) return "needs-work";
|
|
482
|
-
return "critical";
|
|
483
|
-
}
|
|
484
|
-
function getRatingWithContext(score, fileCount, modelTier = "standard") {
|
|
485
|
-
const threshold = getRecommendedThreshold(fileCount, modelTier);
|
|
486
|
-
const normalized = score - threshold + 70;
|
|
487
|
-
return getRating(normalized);
|
|
488
|
-
}
|
|
489
|
-
function getRatingDisplay(rating) {
|
|
490
|
-
switch (rating) {
|
|
491
|
-
case "Excellent" /* Excellent */:
|
|
492
|
-
return { emoji: "\u2705", color: "green" };
|
|
493
|
-
case "Good" /* Good */:
|
|
494
|
-
return { emoji: "\u{1F44D}", color: "blue" };
|
|
495
|
-
case "Fair" /* Fair */:
|
|
496
|
-
return { emoji: "\u26A0\uFE0F", color: "yellow" };
|
|
497
|
-
case "Needs Work" /* NeedsWork */:
|
|
498
|
-
return { emoji: "\u{1F528}", color: "orange" };
|
|
499
|
-
case "Critical" /* Critical */:
|
|
500
|
-
return { emoji: "\u274C", color: "red" };
|
|
501
|
-
default:
|
|
502
|
-
return { emoji: "\u2753", color: "gray" };
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
function formatScore(result) {
|
|
506
|
-
const { emoji } = getRatingDisplay(result.rating);
|
|
507
|
-
return `${result.overall}/100 (${result.rating}) ${emoji}`;
|
|
508
|
-
}
|
|
509
|
-
function formatToolScore(output) {
|
|
510
|
-
let result = ` Score: ${output.score}/100
|
|
511
|
-
|
|
512
|
-
`;
|
|
513
|
-
if (output.factors && output.factors.length > 0) {
|
|
514
|
-
result += ` Factors:
|
|
515
|
-
`;
|
|
516
|
-
output.factors.forEach((factor) => {
|
|
517
|
-
const impactSign = factor.impact > 0 ? "+" : "";
|
|
518
|
-
result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
|
|
519
|
-
`;
|
|
520
|
-
});
|
|
521
|
-
result += "\n";
|
|
522
|
-
}
|
|
523
|
-
if (output.recommendations && output.recommendations.length > 0) {
|
|
524
|
-
result += ` Recommendations:
|
|
525
|
-
`;
|
|
526
|
-
output.recommendations.forEach((rec, i) => {
|
|
527
|
-
let priorityIcon = "\u{1F535}";
|
|
528
|
-
const prio = rec.priority;
|
|
529
|
-
if (prio === "high" /* High */ || prio === "high")
|
|
530
|
-
priorityIcon = "\u{1F534}";
|
|
531
|
-
else if (prio === "medium" /* Medium */ || prio === "medium")
|
|
532
|
-
priorityIcon = "\u{1F7E1}";
|
|
533
|
-
result += ` ${i + 1}. ${priorityIcon} ${rec.action}
|
|
534
|
-
`;
|
|
535
|
-
result += ` Impact: +${rec.estimatedImpact} points
|
|
536
|
-
|
|
537
|
-
`;
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
return result;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
// src/utils/visualization.ts
|
|
544
|
-
function generateHTML(graph) {
|
|
545
|
-
const payload = JSON.stringify(graph, null, 2);
|
|
546
|
-
return `<!doctype html>
|
|
547
|
-
<html>
|
|
548
|
-
<head>
|
|
549
|
-
<meta charset="utf-8" />
|
|
550
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
551
|
-
<title>AIReady Visualization</title>
|
|
552
|
-
<style>
|
|
553
|
-
html,body { height: 100%; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f172a; color: #e2e8f0 }
|
|
554
|
-
#container { display:flex; height:100vh }
|
|
555
|
-
#panel { width: 320px; padding: 16px; background: #071130; box-shadow: -2px 0 8px rgba(0,0,0,0.3); overflow:auto }
|
|
556
|
-
#canvasWrap { flex:1; display:flex; align-items:center; justify-content:center }
|
|
557
|
-
canvas { background: #0b1220; border-radius:8px }
|
|
558
|
-
.stat { margin-bottom:12px }
|
|
559
|
-
</style>
|
|
560
|
-
</head>
|
|
561
|
-
<body>
|
|
562
|
-
<div id="container">
|
|
563
|
-
<div id="canvasWrap"><canvas id="canvas" width="1200" height="800"></canvas></div>
|
|
564
|
-
<div id="panel">
|
|
565
|
-
<h2>AIReady Visualization</h2>
|
|
566
|
-
<div class="stat"><strong>Files:</strong> <span id="stat-files"></span></div>
|
|
567
|
-
<div class="stat"><strong>Dependencies:</strong> <span id="stat-deps"></span></div>
|
|
568
|
-
<div class="stat"><strong>Legend</strong></div>
|
|
569
|
-
<div style="font-size:13px;line-height:1.3;color:#cbd5e1;margin-top:8px">
|
|
570
|
-
<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>
|
|
571
|
-
<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>
|
|
572
|
-
<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>
|
|
573
|
-
<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>
|
|
574
|
-
<div style="margin-top:10px;color:#94a3b8"><strong>Node size</strong>: larger = higher token cost, more issues or dependency weight.</div>
|
|
575
|
-
<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>
|
|
576
|
-
<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>
|
|
577
|
-
</div>
|
|
578
|
-
</div>
|
|
579
|
-
</div>
|
|
580
|
-
|
|
581
|
-
<script>
|
|
582
|
-
const graphData = ${payload};
|
|
583
|
-
document.getElementById('stat-files').textContent = graphData.metadata.totalFiles;
|
|
584
|
-
document.getElementById('stat-deps').textContent = graphData.metadata.totalDependencies;
|
|
585
|
-
|
|
586
|
-
const canvas = document.getElementById('canvas');
|
|
587
|
-
const ctx = canvas.getContext('2d');
|
|
588
|
-
|
|
589
|
-
const nodes = graphData.nodes.map((n, i) => ({
|
|
590
|
-
...n,
|
|
591
|
-
x: canvas.width / 2 + Math.cos(i / graphData.nodes.length * Math.PI * 2) * (Math.min(canvas.width, canvas.height) / 3),
|
|
592
|
-
y: canvas.height / 2 + Math.sin(i / graphData.nodes.length * Math.PI * 2) * (Math.min(canvas.width, canvas.height) / 3),
|
|
593
|
-
}));
|
|
594
|
-
|
|
595
|
-
function draw() {
|
|
596
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
597
|
-
|
|
598
|
-
graphData.edges.forEach(edge => {
|
|
599
|
-
const s = nodes.find(n => n.id === edge.source);
|
|
600
|
-
const t = nodes.find(n => n.id === edge.target);
|
|
601
|
-
if (!s || !t) return;
|
|
602
|
-
if (edge.type === 'related') return;
|
|
603
|
-
if (edge.type === 'similarity') {
|
|
604
|
-
ctx.strokeStyle = '#fb7e81';
|
|
605
|
-
ctx.lineWidth = 1.2;
|
|
606
|
-
} else if (edge.type === 'dependency') {
|
|
607
|
-
ctx.strokeStyle = '#84c1ff';
|
|
608
|
-
ctx.lineWidth = 1.0;
|
|
609
|
-
} else if (edge.type === 'reference') {
|
|
610
|
-
ctx.strokeStyle = '#ffa500';
|
|
611
|
-
ctx.lineWidth = 0.9;
|
|
612
|
-
} else {
|
|
613
|
-
ctx.strokeStyle = '#334155';
|
|
614
|
-
ctx.lineWidth = 0.8;
|
|
615
|
-
}
|
|
616
|
-
ctx.beginPath();
|
|
617
|
-
ctx.moveTo(s.x, s.y);
|
|
618
|
-
ctx.lineTo(t.x, t.y);
|
|
619
|
-
ctx.stroke();
|
|
620
|
-
});
|
|
621
|
-
|
|
622
|
-
const groups = {};
|
|
623
|
-
nodes.forEach(n => {
|
|
624
|
-
const g = n.group || '__default';
|
|
625
|
-
if (!groups[g]) groups[g] = { minX: n.x, minY: n.y, maxX: n.x, maxY: n.y };
|
|
626
|
-
groups[g].minX = Math.min(groups[g].minX, n.x);
|
|
627
|
-
groups[g].minY = Math.min(groups[g].minY, n.y);
|
|
628
|
-
groups[g].maxX = Math.max(groups[g].maxX, n.x);
|
|
629
|
-
groups[g].maxY = Math.max(groups[g].maxY, n.y);
|
|
630
|
-
});
|
|
631
|
-
|
|
632
|
-
const groupRelations = {};
|
|
633
|
-
graphData.edges.forEach(edge => {
|
|
634
|
-
const sNode = nodes.find(n => n.id === edge.source);
|
|
635
|
-
const tNode = nodes.find(n => n.id === edge.target);
|
|
636
|
-
if (!sNode || !tNode) return;
|
|
637
|
-
const g1 = sNode.group || '__default';
|
|
638
|
-
const g2 = tNode.group || '__default';
|
|
639
|
-
if (g1 === g2) return;
|
|
640
|
-
const key = g1 < g2 ? g1 + '::' + g2 : g2 + '::' + g1;
|
|
641
|
-
groupRelations[key] = (groupRelations[key] || 0) + 1;
|
|
642
|
-
});
|
|
643
|
-
|
|
644
|
-
Object.keys(groupRelations).forEach(k => {
|
|
645
|
-
const count = groupRelations[k];
|
|
646
|
-
const [ga, gb] = k.split('::');
|
|
647
|
-
if (!groups[ga] || !groups[gb]) return;
|
|
648
|
-
const ax = (groups[ga].minX + groups[ga].maxX) / 2;
|
|
649
|
-
const ay = (groups[ga].minY + groups[ga].maxY) / 2;
|
|
650
|
-
const bx = (groups[gb].minX + groups[gb].maxX) / 2;
|
|
651
|
-
const by = (groups[gb].minY + groups[gb].maxY) / 2;
|
|
652
|
-
ctx.beginPath();
|
|
653
|
-
ctx.strokeStyle = 'rgba(148,163,184,0.25)';
|
|
654
|
-
ctx.lineWidth = Math.min(6, 0.6 + Math.sqrt(count));
|
|
655
|
-
ctx.moveTo(ax, ay);
|
|
656
|
-
ctx.lineTo(bx, by);
|
|
657
|
-
ctx.stroke();
|
|
658
|
-
});
|
|
659
|
-
|
|
660
|
-
Object.keys(groups).forEach(g => {
|
|
661
|
-
if (g === '__default') return;
|
|
662
|
-
const box = groups[g];
|
|
663
|
-
const pad = 16;
|
|
664
|
-
const x = box.minX - pad;
|
|
665
|
-
const y = box.minY - pad;
|
|
666
|
-
const w = (box.maxX - box.minX) + pad * 2;
|
|
667
|
-
const h = (box.maxY - box.minY) + pad * 2;
|
|
668
|
-
ctx.save();
|
|
669
|
-
ctx.fillStyle = 'rgba(30,64,175,0.04)';
|
|
670
|
-
ctx.strokeStyle = 'rgba(30,64,175,0.12)';
|
|
671
|
-
ctx.lineWidth = 1.2;
|
|
672
|
-
const r = 8;
|
|
673
|
-
ctx.beginPath();
|
|
674
|
-
ctx.moveTo(x + r, y);
|
|
675
|
-
ctx.arcTo(x + w, y, x + w, y + h, r);
|
|
676
|
-
ctx.arcTo(x + w, y + h, x, y + h, r);
|
|
677
|
-
ctx.arcTo(x, y + h, x, y, r);
|
|
678
|
-
ctx.arcTo(x, y, x + w, y, r);
|
|
679
|
-
ctx.closePath();
|
|
680
|
-
ctx.fill();
|
|
681
|
-
ctx.stroke();
|
|
682
|
-
ctx.restore();
|
|
683
|
-
ctx.fillStyle = '#94a3b8';
|
|
684
|
-
ctx.font = '11px sans-serif';
|
|
685
|
-
ctx.fillText(g, x + 8, y + 14);
|
|
686
|
-
});
|
|
687
|
-
|
|
688
|
-
nodes.forEach(n => {
|
|
689
|
-
const sizeVal = (n.size || n.value || 1);
|
|
690
|
-
const r = 6 + (sizeVal / 2);
|
|
691
|
-
ctx.beginPath();
|
|
692
|
-
ctx.fillStyle = n.color || '#60a5fa';
|
|
693
|
-
ctx.arc(n.x, n.y, r, 0, Math.PI * 2);
|
|
694
|
-
ctx.fill();
|
|
695
|
-
|
|
696
|
-
ctx.fillStyle = '#e2e8f0';
|
|
697
|
-
ctx.font = '11px sans-serif';
|
|
698
|
-
ctx.textAlign = 'center';
|
|
699
|
-
ctx.fillText(n.label || n.id.split('/').slice(-1)[0], n.x, n.y + r + 12);
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
draw();
|
|
704
|
-
</script>
|
|
705
|
-
</body>
|
|
706
|
-
</html>`;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
export {
|
|
710
|
-
Severity,
|
|
711
|
-
SeveritySchema,
|
|
712
|
-
ToolName,
|
|
713
|
-
ToolNameSchema,
|
|
714
|
-
FRIENDLY_TOOL_NAMES,
|
|
715
|
-
IssueType,
|
|
716
|
-
IssueTypeSchema,
|
|
717
|
-
AnalysisStatus,
|
|
718
|
-
AnalysisStatusSchema,
|
|
719
|
-
ModelTier,
|
|
720
|
-
ModelTierSchema,
|
|
721
|
-
LocationSchema,
|
|
722
|
-
IssueSchema,
|
|
723
|
-
MetricsSchema,
|
|
724
|
-
AnalysisResultSchema,
|
|
725
|
-
SpokeSummarySchema,
|
|
726
|
-
SpokeOutputSchema,
|
|
727
|
-
UnifiedReportSchema,
|
|
728
|
-
LeadSource,
|
|
729
|
-
LeadSourceSchema,
|
|
730
|
-
LeadSchema,
|
|
731
|
-
LeadSubmissionSchema,
|
|
732
|
-
ManagedAccountSchema,
|
|
733
|
-
GLOBAL_INFRA_OPTIONS,
|
|
734
|
-
GLOBAL_SCAN_OPTIONS,
|
|
735
|
-
COMMON_FINE_TUNING_OPTIONS,
|
|
736
|
-
Language,
|
|
737
|
-
LANGUAGE_EXTENSIONS,
|
|
738
|
-
ParseError,
|
|
739
|
-
RecommendationPriority,
|
|
740
|
-
ReadinessRating,
|
|
741
|
-
DEFAULT_TOOL_WEIGHTS,
|
|
742
|
-
TOOL_NAME_MAP,
|
|
743
|
-
ScoringProfile,
|
|
744
|
-
SCORING_PROFILES,
|
|
745
|
-
CONTEXT_TIER_THRESHOLDS,
|
|
746
|
-
SIZE_ADJUSTED_THRESHOLDS,
|
|
747
|
-
getProjectSizeTier,
|
|
748
|
-
getRecommendedThreshold,
|
|
749
|
-
normalizeToolName,
|
|
750
|
-
getToolWeight,
|
|
751
|
-
parseWeightString,
|
|
752
|
-
calculateOverallScore,
|
|
753
|
-
getRating,
|
|
754
|
-
getRatingSlug,
|
|
755
|
-
getRatingWithContext,
|
|
756
|
-
getRatingDisplay,
|
|
757
|
-
formatScore,
|
|
758
|
-
formatToolScore,
|
|
759
|
-
generateHTML
|
|
760
|
-
};
|