@aiready/core 0.23.15 → 0.23.20
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-2Y6WZCES.mjs +859 -0
- package/dist/chunk-FMNCV4CC.mjs +859 -0
- package/dist/chunk-REU6OUBT.mjs +859 -0
- package/dist/chunk-RMH2TPAT.mjs +822 -0
- package/dist/chunk-SQHS6PFL.mjs +859 -0
- package/dist/chunk-ST75O5C5.mjs +859 -0
- package/dist/chunk-ZB3EHHAG.mjs +822 -0
- package/dist/client-CYz0qxGB.d.mts +1217 -0
- package/dist/client-CYz0qxGB.d.ts +1217 -0
- package/dist/client-DLvFR2qA.d.mts +1197 -0
- package/dist/client-DLvFR2qA.d.ts +1197 -0
- package/dist/client-jGuH6TAG.d.mts +1244 -0
- package/dist/client-jGuH6TAG.d.ts +1244 -0
- package/dist/client-pYldIAg2.d.mts +1209 -0
- package/dist/client-pYldIAg2.d.ts +1209 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +210 -177
- package/dist/client.mjs +27 -3
- package/dist/index.d.mts +73 -4
- package/dist/index.d.ts +73 -4
- package/dist/index.js +362 -183
- package/dist/index.mjs +133 -9
- package/package.json +1 -1
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
// src/types/business.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
|
|
4
|
+
LeadSource2["ClawMoreHero"] = "clawmore-hero";
|
|
5
|
+
LeadSource2["ClawMoreWaitlist"] = "clawmore-waitlist";
|
|
6
|
+
LeadSource2["ClawMoreBeta"] = "clawmore-beta";
|
|
7
|
+
LeadSource2["AiReadyPlatform"] = "aiready-platform";
|
|
8
|
+
return LeadSource2;
|
|
9
|
+
})(LeadSource || {});
|
|
10
|
+
var LeadSourceSchema = z.nativeEnum(LeadSource);
|
|
11
|
+
var LeadSchema = z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
email: z.string().email(),
|
|
14
|
+
name: z.string().min(1),
|
|
15
|
+
interest: z.string().default("General"),
|
|
16
|
+
notes: z.string().optional(),
|
|
17
|
+
timestamp: z.string().datetime(),
|
|
18
|
+
source: LeadSourceSchema,
|
|
19
|
+
status: z.enum(["new", "contacted", "qualified", "converted", "archived"]).default("new")
|
|
20
|
+
});
|
|
21
|
+
var LeadSubmissionSchema = LeadSchema.omit({
|
|
22
|
+
id: true,
|
|
23
|
+
timestamp: true,
|
|
24
|
+
status: true
|
|
25
|
+
});
|
|
26
|
+
var ManagedAccountSchema = z.object({
|
|
27
|
+
id: z.string(),
|
|
28
|
+
// Internal UUID
|
|
29
|
+
accountId: z.string(),
|
|
30
|
+
// AWS Account ID
|
|
31
|
+
userId: z.string(),
|
|
32
|
+
// Owner (caopengau@gmail.com)
|
|
33
|
+
stripeSubscriptionId: z.string(),
|
|
34
|
+
// AI Token Management
|
|
35
|
+
tokenStrategy: z.enum(["managed", "byok"]).default("managed"),
|
|
36
|
+
byokConfig: z.object({
|
|
37
|
+
openaiKey: z.string().optional(),
|
|
38
|
+
anthropicKey: z.string().optional(),
|
|
39
|
+
openrouterKey: z.string().optional()
|
|
40
|
+
}).optional(),
|
|
41
|
+
// Financials (in cents)
|
|
42
|
+
baseFeeCents: z.number().default(2900),
|
|
43
|
+
includedComputeCents: z.number().default(1500),
|
|
44
|
+
// $15.00 AWS included
|
|
45
|
+
includedTokenCents: z.number().default(500),
|
|
46
|
+
// $5.00 Managed Tokens included
|
|
47
|
+
// Pre-paid Balance (credits)
|
|
48
|
+
prepaidTokenBalanceCents: z.number().default(0),
|
|
49
|
+
// Users buy these in $10 packs
|
|
50
|
+
currentMonthlyTokenSpendCents: z.number().default(0),
|
|
51
|
+
// Governance
|
|
52
|
+
status: z.enum(["provisioning", "active", "warning", "quarantined", "suspended"]).default("provisioning"),
|
|
53
|
+
lastCostSyncAt: z.string().datetime().optional(),
|
|
54
|
+
region: z.string().default("ap-southeast-2"),
|
|
55
|
+
// Alerting thresholds (percentage of includedComputeCents)
|
|
56
|
+
alertThresholds: z.array(z.number()).default([50, 80, 100, 150])
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// src/types/enums.ts
|
|
60
|
+
import { z as z2 } from "zod";
|
|
61
|
+
var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
62
|
+
Severity2["Critical"] = "critical";
|
|
63
|
+
Severity2["Major"] = "major";
|
|
64
|
+
Severity2["Minor"] = "minor";
|
|
65
|
+
Severity2["Info"] = "info";
|
|
66
|
+
return Severity2;
|
|
67
|
+
})(Severity || {});
|
|
68
|
+
var SeveritySchema = z2.nativeEnum(Severity);
|
|
69
|
+
var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
70
|
+
ToolName2["PatternDetect"] = "pattern-detect";
|
|
71
|
+
ToolName2["ContextAnalyzer"] = "context-analyzer";
|
|
72
|
+
ToolName2["NamingConsistency"] = "naming-consistency";
|
|
73
|
+
ToolName2["AiSignalClarity"] = "ai-signal-clarity";
|
|
74
|
+
ToolName2["AgentGrounding"] = "agent-grounding";
|
|
75
|
+
ToolName2["TestabilityIndex"] = "testability-index";
|
|
76
|
+
ToolName2["DocDrift"] = "doc-drift";
|
|
77
|
+
ToolName2["DependencyHealth"] = "dependency-health";
|
|
78
|
+
ToolName2["ChangeAmplification"] = "change-amplification";
|
|
79
|
+
ToolName2["CognitiveLoad"] = "cognitive-load";
|
|
80
|
+
ToolName2["PatternEntropy"] = "pattern-entropy";
|
|
81
|
+
ToolName2["ConceptCohesion"] = "concept-cohesion";
|
|
82
|
+
ToolName2["SemanticDistance"] = "semantic-distance";
|
|
83
|
+
return ToolName2;
|
|
84
|
+
})(ToolName || {});
|
|
85
|
+
var ToolNameSchema = z2.nativeEnum(ToolName);
|
|
86
|
+
var FRIENDLY_TOOL_NAMES = {
|
|
87
|
+
["pattern-detect" /* PatternDetect */]: "Semantic Duplicates",
|
|
88
|
+
["context-analyzer" /* ContextAnalyzer */]: "Context Fragmentation",
|
|
89
|
+
["naming-consistency" /* NamingConsistency */]: "Naming Consistency",
|
|
90
|
+
["ai-signal-clarity" /* AiSignalClarity */]: "AI Signal Clarity",
|
|
91
|
+
["agent-grounding" /* AgentGrounding */]: "Agent Grounding",
|
|
92
|
+
["testability-index" /* TestabilityIndex */]: "Testability Index",
|
|
93
|
+
["doc-drift" /* DocDrift */]: "Documentation Health",
|
|
94
|
+
["dependency-health" /* DependencyHealth */]: "Dependency Health",
|
|
95
|
+
["change-amplification" /* ChangeAmplification */]: "Change Amplification",
|
|
96
|
+
["cognitive-load" /* CognitiveLoad */]: "Cognitive Load",
|
|
97
|
+
["pattern-entropy" /* PatternEntropy */]: "Pattern Entropy",
|
|
98
|
+
["concept-cohesion" /* ConceptCohesion */]: "Concept Cohesion",
|
|
99
|
+
["semantic-distance" /* SemanticDistance */]: "Semantic Distance"
|
|
100
|
+
};
|
|
101
|
+
var IssueType = /* @__PURE__ */ ((IssueType2) => {
|
|
102
|
+
IssueType2["DuplicatePattern"] = "duplicate-pattern";
|
|
103
|
+
IssueType2["PatternInconsistency"] = "pattern-inconsistency";
|
|
104
|
+
IssueType2["ContextFragmentation"] = "context-fragmentation";
|
|
105
|
+
IssueType2["DependencyHealth"] = "dependency-health";
|
|
106
|
+
IssueType2["CircularDependency"] = "circular-dependency";
|
|
107
|
+
IssueType2["DocDrift"] = "doc-drift";
|
|
108
|
+
IssueType2["NamingInconsistency"] = "naming-inconsistency";
|
|
109
|
+
IssueType2["NamingQuality"] = "naming-quality";
|
|
110
|
+
IssueType2["ArchitectureInconsistency"] = "architecture-inconsistency";
|
|
111
|
+
IssueType2["DeadCode"] = "dead-code";
|
|
112
|
+
IssueType2["MissingTypes"] = "missing-types";
|
|
113
|
+
IssueType2["MagicLiteral"] = "magic-literal";
|
|
114
|
+
IssueType2["BooleanTrap"] = "boolean-trap";
|
|
115
|
+
IssueType2["AiSignalClarity"] = "ai-signal-clarity";
|
|
116
|
+
IssueType2["LowTestability"] = "low-testability";
|
|
117
|
+
IssueType2["AgentNavigationFailure"] = "agent-navigation-failure";
|
|
118
|
+
IssueType2["AmbiguousApi"] = "ambiguous-api";
|
|
119
|
+
IssueType2["ChangeAmplification"] = "change-amplification";
|
|
120
|
+
return IssueType2;
|
|
121
|
+
})(IssueType || {});
|
|
122
|
+
var IssueTypeSchema = z2.nativeEnum(IssueType);
|
|
123
|
+
var AnalysisStatus = /* @__PURE__ */ ((AnalysisStatus2) => {
|
|
124
|
+
AnalysisStatus2["Processing"] = "processing";
|
|
125
|
+
AnalysisStatus2["Completed"] = "completed";
|
|
126
|
+
AnalysisStatus2["Failed"] = "failed";
|
|
127
|
+
return AnalysisStatus2;
|
|
128
|
+
})(AnalysisStatus || {});
|
|
129
|
+
var AnalysisStatusSchema = z2.nativeEnum(AnalysisStatus);
|
|
130
|
+
var ModelTier = /* @__PURE__ */ ((ModelTier2) => {
|
|
131
|
+
ModelTier2["Compact"] = "compact";
|
|
132
|
+
ModelTier2["Standard"] = "standard";
|
|
133
|
+
ModelTier2["Extended"] = "extended";
|
|
134
|
+
ModelTier2["Frontier"] = "frontier";
|
|
135
|
+
return ModelTier2;
|
|
136
|
+
})(ModelTier || {});
|
|
137
|
+
var ModelTierSchema = z2.nativeEnum(ModelTier);
|
|
138
|
+
|
|
139
|
+
// src/types/common.ts
|
|
140
|
+
import { z as z3 } from "zod";
|
|
141
|
+
var LocationSchema = z3.object({
|
|
142
|
+
file: z3.string(),
|
|
143
|
+
line: z3.number(),
|
|
144
|
+
column: z3.number().optional(),
|
|
145
|
+
endLine: z3.number().optional(),
|
|
146
|
+
endColumn: z3.number().optional()
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// src/types/schemas/issue.ts
|
|
150
|
+
import { z as z4 } from "zod";
|
|
151
|
+
var IssueSchema = z4.object({
|
|
152
|
+
type: IssueTypeSchema,
|
|
153
|
+
severity: SeveritySchema,
|
|
154
|
+
message: z4.string(),
|
|
155
|
+
location: LocationSchema,
|
|
156
|
+
suggestion: z4.string().optional()
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// src/types/schemas/metrics.ts
|
|
160
|
+
import { z as z5 } from "zod";
|
|
161
|
+
var MetricsSchema = z5.object({
|
|
162
|
+
tokenCost: z5.number().optional(),
|
|
163
|
+
complexityScore: z5.number().optional(),
|
|
164
|
+
consistencyScore: z5.number().optional(),
|
|
165
|
+
docFreshnessScore: z5.number().optional(),
|
|
166
|
+
// AI agent readiness metrics (v0.12+)
|
|
167
|
+
aiSignalClarityScore: z5.number().optional(),
|
|
168
|
+
agentGroundingScore: z5.number().optional(),
|
|
169
|
+
testabilityScore: z5.number().optional(),
|
|
170
|
+
docDriftScore: z5.number().optional(),
|
|
171
|
+
dependencyHealthScore: z5.number().optional(),
|
|
172
|
+
modelContextTier: ModelTierSchema.optional(),
|
|
173
|
+
// Business value metrics
|
|
174
|
+
estimatedMonthlyCost: z5.number().optional(),
|
|
175
|
+
estimatedDeveloperHours: z5.number().optional(),
|
|
176
|
+
comprehensionDifficultyIndex: z5.number().optional(),
|
|
177
|
+
// Extended metrics for specific spokes
|
|
178
|
+
totalSymbols: z5.number().optional(),
|
|
179
|
+
totalExports: z5.number().optional()
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// src/types/schemas/report.ts
|
|
183
|
+
import { z as z6 } from "zod";
|
|
184
|
+
var AnalysisResultSchema = z6.object({
|
|
185
|
+
fileName: z6.string(),
|
|
186
|
+
issues: z6.array(IssueSchema),
|
|
187
|
+
metrics: MetricsSchema
|
|
188
|
+
});
|
|
189
|
+
var SpokeSummarySchema = z6.object({
|
|
190
|
+
totalFiles: z6.number().optional(),
|
|
191
|
+
totalIssues: z6.number().optional(),
|
|
192
|
+
criticalIssues: z6.number().optional(),
|
|
193
|
+
majorIssues: z6.number().optional(),
|
|
194
|
+
score: z6.number().optional()
|
|
195
|
+
}).catchall(z6.any());
|
|
196
|
+
var SpokeOutputSchema = z6.object({
|
|
197
|
+
results: z6.array(AnalysisResultSchema),
|
|
198
|
+
summary: SpokeSummarySchema,
|
|
199
|
+
metadata: z6.object({
|
|
200
|
+
toolName: z6.string(),
|
|
201
|
+
version: z6.string().optional(),
|
|
202
|
+
timestamp: z6.string().optional(),
|
|
203
|
+
config: z6.any().optional()
|
|
204
|
+
}).catchall(z6.any()).optional()
|
|
205
|
+
});
|
|
206
|
+
var UnifiedReportSchema = z6.object({
|
|
207
|
+
summary: z6.object({
|
|
208
|
+
totalFiles: z6.number(),
|
|
209
|
+
totalIssues: z6.number(),
|
|
210
|
+
criticalIssues: z6.number(),
|
|
211
|
+
majorIssues: z6.number(),
|
|
212
|
+
businessImpact: z6.object({
|
|
213
|
+
estimatedMonthlyWaste: z6.number().optional(),
|
|
214
|
+
potentialSavings: z6.number().optional(),
|
|
215
|
+
productivityHours: z6.number().optional()
|
|
216
|
+
}).optional()
|
|
217
|
+
}),
|
|
218
|
+
results: z6.array(AnalysisResultSchema),
|
|
219
|
+
scoring: z6.object({
|
|
220
|
+
overall: z6.number(),
|
|
221
|
+
rating: z6.string(),
|
|
222
|
+
timestamp: z6.string(),
|
|
223
|
+
breakdown: z6.array(
|
|
224
|
+
z6.object({
|
|
225
|
+
toolName: z6.union([ToolNameSchema, z6.string()]),
|
|
226
|
+
score: z6.number()
|
|
227
|
+
}).catchall(z6.any())
|
|
228
|
+
)
|
|
229
|
+
}).optional()
|
|
230
|
+
}).catchall(z6.any());
|
|
231
|
+
|
|
232
|
+
// src/types/schemas/config.ts
|
|
233
|
+
import { z as z7 } from "zod";
|
|
234
|
+
var AIReadyConfigSchema = z7.object({
|
|
235
|
+
/** Target score threshold (0-100) */
|
|
236
|
+
threshold: z7.number().optional(),
|
|
237
|
+
/** Files or directories to include in scan */
|
|
238
|
+
include: z7.array(z7.string()).optional(),
|
|
239
|
+
/** Files or directories to exclude from scan */
|
|
240
|
+
exclude: z7.array(z7.string()).optional(),
|
|
241
|
+
/** Scan-specific configuration */
|
|
242
|
+
scan: z7.object({
|
|
243
|
+
include: z7.array(z7.string()).optional(),
|
|
244
|
+
exclude: z7.array(z7.string()).optional(),
|
|
245
|
+
parallel: z7.boolean().optional(),
|
|
246
|
+
deep: z7.boolean().optional(),
|
|
247
|
+
tools: z7.array(z7.string()).optional()
|
|
248
|
+
}).optional(),
|
|
249
|
+
/** Output-specific configuration */
|
|
250
|
+
output: z7.object({
|
|
251
|
+
/** Output format (json, console, html) */
|
|
252
|
+
format: z7.enum(["json", "console", "html"]).optional(),
|
|
253
|
+
/** Output file path */
|
|
254
|
+
path: z7.string().optional(),
|
|
255
|
+
/** Output directory */
|
|
256
|
+
saveTo: z7.string().optional(),
|
|
257
|
+
/** Whether to show score breakdown in console */
|
|
258
|
+
showBreakdown: z7.boolean().optional(),
|
|
259
|
+
/** Baseline report to compare against */
|
|
260
|
+
compareBaseline: z7.string().optional()
|
|
261
|
+
}).optional(),
|
|
262
|
+
/** Tool-specific configuration overrides (Strictly ToolName -> Config) */
|
|
263
|
+
tools: z7.record(z7.string(), z7.any()).optional(),
|
|
264
|
+
/** Scoring profile and weights */
|
|
265
|
+
scoring: z7.object({
|
|
266
|
+
/** Name of the scoring profile (e.g. "strict", "balanced") */
|
|
267
|
+
profile: z7.string().optional(),
|
|
268
|
+
/** Custom weights for tools and metrics */
|
|
269
|
+
weights: z7.record(z7.string(), z7.number()).optional()
|
|
270
|
+
}).optional(),
|
|
271
|
+
/** Visualizer settings (interactive graph) */
|
|
272
|
+
visualizer: z7.object({
|
|
273
|
+
groupingDirs: z7.array(z7.string()).optional(),
|
|
274
|
+
graph: z7.object({
|
|
275
|
+
maxNodes: z7.number().optional(),
|
|
276
|
+
maxEdges: z7.number().optional()
|
|
277
|
+
}).optional()
|
|
278
|
+
}).optional()
|
|
279
|
+
}).catchall(z7.any());
|
|
280
|
+
|
|
281
|
+
// src/types.ts
|
|
282
|
+
var GLOBAL_INFRA_OPTIONS = [
|
|
283
|
+
"rootDir",
|
|
284
|
+
"include",
|
|
285
|
+
"exclude",
|
|
286
|
+
"tools",
|
|
287
|
+
"scoring"
|
|
288
|
+
];
|
|
289
|
+
var GLOBAL_SCAN_OPTIONS = [
|
|
290
|
+
"rootDir",
|
|
291
|
+
"include",
|
|
292
|
+
"exclude",
|
|
293
|
+
"config",
|
|
294
|
+
"threshold",
|
|
295
|
+
"output",
|
|
296
|
+
"format",
|
|
297
|
+
"parallel",
|
|
298
|
+
"showBreakdown"
|
|
299
|
+
];
|
|
300
|
+
var COMMON_FINE_TUNING_OPTIONS = [
|
|
301
|
+
"maxDepth",
|
|
302
|
+
"minSimilarity",
|
|
303
|
+
"threshold",
|
|
304
|
+
"showBreakdown"
|
|
305
|
+
];
|
|
306
|
+
|
|
307
|
+
// src/types/language.ts
|
|
308
|
+
var Language = /* @__PURE__ */ ((Language2) => {
|
|
309
|
+
Language2["TypeScript"] = "typescript";
|
|
310
|
+
Language2["JavaScript"] = "javascript";
|
|
311
|
+
Language2["Python"] = "python";
|
|
312
|
+
Language2["Java"] = "java";
|
|
313
|
+
Language2["Go"] = "go";
|
|
314
|
+
Language2["Rust"] = "rust";
|
|
315
|
+
Language2["CSharp"] = "csharp";
|
|
316
|
+
return Language2;
|
|
317
|
+
})(Language || {});
|
|
318
|
+
var LANGUAGE_EXTENSIONS = {
|
|
319
|
+
".ts": "typescript" /* TypeScript */,
|
|
320
|
+
".tsx": "typescript" /* TypeScript */,
|
|
321
|
+
".js": "javascript" /* JavaScript */,
|
|
322
|
+
".jsx": "javascript" /* JavaScript */,
|
|
323
|
+
".py": "python" /* Python */,
|
|
324
|
+
".java": "java" /* Java */,
|
|
325
|
+
".go": "go" /* Go */,
|
|
326
|
+
".rs": "rust" /* Rust */,
|
|
327
|
+
".cs": "csharp" /* CSharp */
|
|
328
|
+
};
|
|
329
|
+
var ParseError = class extends Error {
|
|
330
|
+
constructor(message, filePath, loc) {
|
|
331
|
+
super(message);
|
|
332
|
+
this.filePath = filePath;
|
|
333
|
+
this.loc = loc;
|
|
334
|
+
this.name = "ParseError";
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// src/scoring.ts
|
|
339
|
+
var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
|
|
340
|
+
RecommendationPriority2["High"] = "high";
|
|
341
|
+
RecommendationPriority2["Medium"] = "medium";
|
|
342
|
+
RecommendationPriority2["Low"] = "low";
|
|
343
|
+
return RecommendationPriority2;
|
|
344
|
+
})(RecommendationPriority || {});
|
|
345
|
+
var ReadinessRating = /* @__PURE__ */ ((ReadinessRating2) => {
|
|
346
|
+
ReadinessRating2["Excellent"] = "Excellent";
|
|
347
|
+
ReadinessRating2["Good"] = "Good";
|
|
348
|
+
ReadinessRating2["Fair"] = "Fair";
|
|
349
|
+
ReadinessRating2["NeedsWork"] = "Needs Work";
|
|
350
|
+
ReadinessRating2["Critical"] = "Critical";
|
|
351
|
+
return ReadinessRating2;
|
|
352
|
+
})(ReadinessRating || {});
|
|
353
|
+
var DEFAULT_TOOL_WEIGHTS = {
|
|
354
|
+
["pattern-detect" /* PatternDetect */]: 22,
|
|
355
|
+
["context-analyzer" /* ContextAnalyzer */]: 19,
|
|
356
|
+
["naming-consistency" /* NamingConsistency */]: 14,
|
|
357
|
+
["ai-signal-clarity" /* AiSignalClarity */]: 11,
|
|
358
|
+
["agent-grounding" /* AgentGrounding */]: 10,
|
|
359
|
+
["testability-index" /* TestabilityIndex */]: 10,
|
|
360
|
+
["doc-drift" /* DocDrift */]: 8,
|
|
361
|
+
["dependency-health" /* DependencyHealth */]: 6,
|
|
362
|
+
["change-amplification" /* ChangeAmplification */]: 8
|
|
363
|
+
};
|
|
364
|
+
var TOOL_NAME_MAP = {
|
|
365
|
+
patterns: "pattern-detect" /* PatternDetect */,
|
|
366
|
+
"pattern-detect": "pattern-detect" /* PatternDetect */,
|
|
367
|
+
context: "context-analyzer" /* ContextAnalyzer */,
|
|
368
|
+
"context-analyzer": "context-analyzer" /* ContextAnalyzer */,
|
|
369
|
+
consistency: "naming-consistency" /* NamingConsistency */,
|
|
370
|
+
"naming-consistency": "naming-consistency" /* NamingConsistency */,
|
|
371
|
+
"ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
|
|
372
|
+
"ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
|
|
373
|
+
grounding: "agent-grounding" /* AgentGrounding */,
|
|
374
|
+
"agent-grounding": "agent-grounding" /* AgentGrounding */,
|
|
375
|
+
testability: "testability-index" /* TestabilityIndex */,
|
|
376
|
+
"testability-index": "testability-index" /* TestabilityIndex */,
|
|
377
|
+
"doc-drift": "doc-drift" /* DocDrift */,
|
|
378
|
+
"deps-health": "dependency-health" /* DependencyHealth */,
|
|
379
|
+
"dependency-health": "dependency-health" /* DependencyHealth */,
|
|
380
|
+
"change-amp": "change-amplification" /* ChangeAmplification */,
|
|
381
|
+
"change-amplification": "change-amplification" /* ChangeAmplification */
|
|
382
|
+
};
|
|
383
|
+
var ScoringProfile = /* @__PURE__ */ ((ScoringProfile2) => {
|
|
384
|
+
ScoringProfile2["Default"] = "default";
|
|
385
|
+
ScoringProfile2["Agentic"] = "agentic";
|
|
386
|
+
ScoringProfile2["Logic"] = "logic";
|
|
387
|
+
ScoringProfile2["UI"] = "ui";
|
|
388
|
+
ScoringProfile2["Cost"] = "cost";
|
|
389
|
+
ScoringProfile2["Security"] = "security";
|
|
390
|
+
return ScoringProfile2;
|
|
391
|
+
})(ScoringProfile || {});
|
|
392
|
+
var SCORING_PROFILES = {
|
|
393
|
+
["default" /* Default */]: DEFAULT_TOOL_WEIGHTS,
|
|
394
|
+
["agentic" /* Agentic */]: {
|
|
395
|
+
["ai-signal-clarity" /* AiSignalClarity */]: 30,
|
|
396
|
+
["agent-grounding" /* AgentGrounding */]: 30,
|
|
397
|
+
["testability-index" /* TestabilityIndex */]: 20,
|
|
398
|
+
["context-analyzer" /* ContextAnalyzer */]: 10,
|
|
399
|
+
["naming-consistency" /* NamingConsistency */]: 10
|
|
400
|
+
},
|
|
401
|
+
["logic" /* Logic */]: {
|
|
402
|
+
["testability-index" /* TestabilityIndex */]: 40,
|
|
403
|
+
["naming-consistency" /* NamingConsistency */]: 20,
|
|
404
|
+
["context-analyzer" /* ContextAnalyzer */]: 20,
|
|
405
|
+
["pattern-detect" /* PatternDetect */]: 10,
|
|
406
|
+
["change-amplification" /* ChangeAmplification */]: 10
|
|
407
|
+
},
|
|
408
|
+
["ui" /* UI */]: {
|
|
409
|
+
["naming-consistency" /* NamingConsistency */]: 30,
|
|
410
|
+
["context-analyzer" /* ContextAnalyzer */]: 30,
|
|
411
|
+
["pattern-detect" /* PatternDetect */]: 20,
|
|
412
|
+
["doc-drift" /* DocDrift */]: 10,
|
|
413
|
+
["ai-signal-clarity" /* AiSignalClarity */]: 10
|
|
414
|
+
},
|
|
415
|
+
["cost" /* Cost */]: {
|
|
416
|
+
["pattern-detect" /* PatternDetect */]: 50,
|
|
417
|
+
["context-analyzer" /* ContextAnalyzer */]: 30,
|
|
418
|
+
["change-amplification" /* ChangeAmplification */]: 10,
|
|
419
|
+
["dependency-health" /* DependencyHealth */]: 10
|
|
420
|
+
},
|
|
421
|
+
["security" /* Security */]: {
|
|
422
|
+
["naming-consistency" /* NamingConsistency */]: 40,
|
|
423
|
+
["testability-index" /* TestabilityIndex */]: 30,
|
|
424
|
+
["dependency-health" /* DependencyHealth */]: 20,
|
|
425
|
+
["context-analyzer" /* ContextAnalyzer */]: 10
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
var CONTEXT_TIER_THRESHOLDS = {
|
|
429
|
+
compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
|
|
430
|
+
standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
|
|
431
|
+
extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
|
|
432
|
+
frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
|
|
433
|
+
};
|
|
434
|
+
var SIZE_ADJUSTED_THRESHOLDS = {
|
|
435
|
+
xs: 80,
|
|
436
|
+
// < 50 files
|
|
437
|
+
small: 75,
|
|
438
|
+
// 50-200 files
|
|
439
|
+
medium: 70,
|
|
440
|
+
// 200-500 files
|
|
441
|
+
large: 65,
|
|
442
|
+
// 500-2000 files
|
|
443
|
+
enterprise: 58
|
|
444
|
+
// 2000+ files
|
|
445
|
+
};
|
|
446
|
+
function getProjectSizeTier(fileCount) {
|
|
447
|
+
if (fileCount < 50) return "xs";
|
|
448
|
+
if (fileCount < 200) return "small";
|
|
449
|
+
if (fileCount < 500) return "medium";
|
|
450
|
+
if (fileCount < 2e3) return "large";
|
|
451
|
+
return "enterprise";
|
|
452
|
+
}
|
|
453
|
+
function getRecommendedThreshold(fileCount, modelTier = "standard") {
|
|
454
|
+
const sizeTier = getProjectSizeTier(fileCount);
|
|
455
|
+
const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
|
|
456
|
+
const modelBonus = modelTier === "frontier" ? -3 : modelTier === "extended" ? -2 : 0;
|
|
457
|
+
return base + modelBonus;
|
|
458
|
+
}
|
|
459
|
+
function normalizeToolName(shortName) {
|
|
460
|
+
return TOOL_NAME_MAP[shortName.toLowerCase()] ?? shortName;
|
|
461
|
+
}
|
|
462
|
+
function getToolWeight(toolName, toolConfig, cliOverride, profile = "default" /* Default */) {
|
|
463
|
+
if (cliOverride !== void 0) return cliOverride;
|
|
464
|
+
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
465
|
+
const profileWeights = SCORING_PROFILES[profile] ?? DEFAULT_TOOL_WEIGHTS;
|
|
466
|
+
return profileWeights[toolName] ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
|
|
467
|
+
}
|
|
468
|
+
function parseWeightString(weightStr) {
|
|
469
|
+
const weights = /* @__PURE__ */ new Map();
|
|
470
|
+
if (!weightStr) return weights;
|
|
471
|
+
const pairs = weightStr.split(",");
|
|
472
|
+
for (const pair of pairs) {
|
|
473
|
+
const [toolShortName, weightValueStr] = pair.split(":");
|
|
474
|
+
if (toolShortName && weightValueStr) {
|
|
475
|
+
const toolName = normalizeToolName(toolShortName.trim());
|
|
476
|
+
const weight = parseInt(weightValueStr.trim(), 10);
|
|
477
|
+
if (!isNaN(weight) && weight > 0) {
|
|
478
|
+
weights.set(toolName, weight);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return weights;
|
|
483
|
+
}
|
|
484
|
+
function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
485
|
+
if (toolOutputs.size === 0) {
|
|
486
|
+
throw new Error("No tool outputs provided for scoring");
|
|
487
|
+
}
|
|
488
|
+
const profile = config?.scoring?.profile || "default" /* Default */;
|
|
489
|
+
const weights = /* @__PURE__ */ new Map();
|
|
490
|
+
for (const [toolName] of toolOutputs.entries()) {
|
|
491
|
+
const cliWeight = cliWeights?.get(toolName);
|
|
492
|
+
const configWeight = config?.tools?.[toolName]?.scoreWeight;
|
|
493
|
+
const weight = cliWeight ?? configWeight ?? getToolWeight(toolName, void 0, void 0, profile);
|
|
494
|
+
weights.set(toolName, weight);
|
|
495
|
+
}
|
|
496
|
+
let weightedSum = 0;
|
|
497
|
+
let totalWeight = 0;
|
|
498
|
+
const breakdown = [];
|
|
499
|
+
const toolsUsed = [];
|
|
500
|
+
const calculationWeights = {};
|
|
501
|
+
for (const [toolName, output] of toolOutputs.entries()) {
|
|
502
|
+
const weight = weights.get(toolName) ?? 5;
|
|
503
|
+
weightedSum += output.score * weight;
|
|
504
|
+
totalWeight += weight;
|
|
505
|
+
toolsUsed.push(toolName);
|
|
506
|
+
calculationWeights[toolName] = weight;
|
|
507
|
+
breakdown.push(output);
|
|
508
|
+
}
|
|
509
|
+
const overall = Math.round(weightedSum / totalWeight);
|
|
510
|
+
const rating = getRating(overall);
|
|
511
|
+
const formulaParts = Array.from(toolOutputs.entries()).map(
|
|
512
|
+
([name, output]) => {
|
|
513
|
+
const w = weights.get(name) ?? 5;
|
|
514
|
+
return `(${output.score} \xD7 ${w})`;
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
const formulaStr = `[${formulaParts.join(" + ")}] / ${totalWeight} = ${overall}`;
|
|
518
|
+
return {
|
|
519
|
+
overall,
|
|
520
|
+
rating,
|
|
521
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
522
|
+
toolsUsed,
|
|
523
|
+
breakdown,
|
|
524
|
+
calculation: {
|
|
525
|
+
formula: formulaStr,
|
|
526
|
+
weights: calculationWeights,
|
|
527
|
+
normalized: formulaStr
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
function getRatingWithContext(score, fileCount, modelTier = "standard") {
|
|
532
|
+
const threshold = getRecommendedThreshold(fileCount, modelTier);
|
|
533
|
+
const normalized = score - threshold + 70;
|
|
534
|
+
return getRating(normalized);
|
|
535
|
+
}
|
|
536
|
+
function getRatingDisplay(rating) {
|
|
537
|
+
switch (rating) {
|
|
538
|
+
case "Excellent" /* Excellent */:
|
|
539
|
+
return { emoji: "\u2705", color: "green" };
|
|
540
|
+
case "Good" /* Good */:
|
|
541
|
+
return { emoji: "\u{1F44D}", color: "blue" };
|
|
542
|
+
case "Fair" /* Fair */:
|
|
543
|
+
return { emoji: "\u26A0\uFE0F", color: "yellow" };
|
|
544
|
+
case "Needs Work" /* NeedsWork */:
|
|
545
|
+
return { emoji: "\u{1F528}", color: "orange" };
|
|
546
|
+
case "Critical" /* Critical */:
|
|
547
|
+
return { emoji: "\u274C", color: "red" };
|
|
548
|
+
default:
|
|
549
|
+
return { emoji: "\u2753", color: "gray" };
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
function formatScore(result) {
|
|
553
|
+
const { emoji } = getRatingDisplay(result.rating);
|
|
554
|
+
return `${result.overall}/100 (${result.rating}) ${emoji}`;
|
|
555
|
+
}
|
|
556
|
+
function formatToolScore(output) {
|
|
557
|
+
let result = ` Score: ${output.score}/100
|
|
558
|
+
|
|
559
|
+
`;
|
|
560
|
+
if (output.factors && output.factors.length > 0) {
|
|
561
|
+
result += ` Factors:
|
|
562
|
+
`;
|
|
563
|
+
output.factors.forEach((factor) => {
|
|
564
|
+
const impactSign = factor.impact > 0 ? "+" : "";
|
|
565
|
+
result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
|
|
566
|
+
`;
|
|
567
|
+
});
|
|
568
|
+
result += "\n";
|
|
569
|
+
}
|
|
570
|
+
if (output.recommendations && output.recommendations.length > 0) {
|
|
571
|
+
result += ` Recommendations:
|
|
572
|
+
`;
|
|
573
|
+
output.recommendations.forEach((rec, i) => {
|
|
574
|
+
let priorityIcon = "\u{1F535}";
|
|
575
|
+
const prio = rec.priority;
|
|
576
|
+
if (prio === "high" /* High */ || prio === "high")
|
|
577
|
+
priorityIcon = "\u{1F534}";
|
|
578
|
+
else if (prio === "medium" /* Medium */ || prio === "medium")
|
|
579
|
+
priorityIcon = "\u{1F7E1}";
|
|
580
|
+
result += ` ${i + 1}. ${priorityIcon} ${rec.action}
|
|
581
|
+
`;
|
|
582
|
+
result += ` Impact: +${rec.estimatedImpact} points
|
|
583
|
+
|
|
584
|
+
`;
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
return result;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// src/utils/rating-helpers.ts
|
|
591
|
+
function getRatingLabel(score) {
|
|
592
|
+
if (score >= 90) return "Excellent";
|
|
593
|
+
if (score >= 75) return "Good";
|
|
594
|
+
if (score >= 60) return "Fair";
|
|
595
|
+
if (score >= 40) return "Needs Work";
|
|
596
|
+
return "Critical";
|
|
597
|
+
}
|
|
598
|
+
function getRatingSlug(score) {
|
|
599
|
+
if (score >= 90) return "excellent";
|
|
600
|
+
if (score >= 75) return "good";
|
|
601
|
+
if (score >= 60) return "fair";
|
|
602
|
+
if (score >= 40) return "needs-work";
|
|
603
|
+
return "critical";
|
|
604
|
+
}
|
|
605
|
+
function getRatingEmoji(score) {
|
|
606
|
+
if (score >= 90) return "\u2705";
|
|
607
|
+
if (score >= 75) return "\u{1F44D}";
|
|
608
|
+
if (score >= 60) return "\u{1F44C}";
|
|
609
|
+
if (score >= 40) return "\u{1F528}";
|
|
610
|
+
return "\u{1F6A8}";
|
|
611
|
+
}
|
|
612
|
+
function getToolEmoji(score) {
|
|
613
|
+
return getRatingEmoji(score);
|
|
614
|
+
}
|
|
615
|
+
function getPriorityIcon(priority) {
|
|
616
|
+
switch (priority) {
|
|
617
|
+
case "critical":
|
|
618
|
+
return "\u{1F534}";
|
|
619
|
+
case "high":
|
|
620
|
+
return "\u{1F7E0}";
|
|
621
|
+
case "medium":
|
|
622
|
+
return "\u{1F7E1}";
|
|
623
|
+
case "low":
|
|
624
|
+
return "\u{1F535}";
|
|
625
|
+
default:
|
|
626
|
+
return "\u26AA";
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function getRating2(score) {
|
|
630
|
+
if (score >= 90) return "Excellent" /* Excellent */;
|
|
631
|
+
if (score >= 75) return "Good" /* Good */;
|
|
632
|
+
if (score >= 60) return "Fair" /* Fair */;
|
|
633
|
+
if (score >= 40) return "Needs Work" /* NeedsWork */;
|
|
634
|
+
return "Critical" /* Critical */;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// src/utils/visualization.ts
|
|
638
|
+
function generateHTML(graph) {
|
|
639
|
+
const payload = JSON.stringify(graph, null, 2);
|
|
640
|
+
return `<!doctype html>
|
|
641
|
+
<html>
|
|
642
|
+
<head>
|
|
643
|
+
<meta charset="utf-8" />
|
|
644
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
645
|
+
<title>AIReady Visualization</title>
|
|
646
|
+
<style>
|
|
647
|
+
html,body { height: 100%; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f172a; color: #e2e8f0 }
|
|
648
|
+
#container { display:flex; height:100vh }
|
|
649
|
+
#panel { width: 320px; padding: 16px; background: #071130; box-shadow: -2px 0 8px rgba(0,0,0,0.3); overflow:auto }
|
|
650
|
+
#canvasWrap { flex:1; display:flex; align-items:center; justify-content:center }
|
|
651
|
+
canvas { background: #0b1220; border-radius:8px }
|
|
652
|
+
.stat { margin-bottom:12px }
|
|
653
|
+
</style>
|
|
654
|
+
</head>
|
|
655
|
+
<body>
|
|
656
|
+
<div id="container">
|
|
657
|
+
<div id="canvasWrap"><canvas id="canvas" width="1200" height="800"></canvas></div>
|
|
658
|
+
<div id="panel">
|
|
659
|
+
<h2>AIReady Visualization</h2>
|
|
660
|
+
<div class="stat"><strong>Files:</strong> <span id="stat-files"></span></div>
|
|
661
|
+
<div class="stat"><strong>Dependencies:</strong> <span id="stat-deps"></span></div>
|
|
662
|
+
<div class="stat"><strong>Legend</strong></div>
|
|
663
|
+
<div style="font-size:13px;line-height:1.3;color:#cbd5e1;margin-top:8px">
|
|
664
|
+
<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>
|
|
665
|
+
<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>
|
|
666
|
+
<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>
|
|
667
|
+
<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>
|
|
668
|
+
<div style="margin-top:10px;color:#94a3b8"><strong>Node size</strong>: larger = higher token cost, more issues or dependency weight.</div>
|
|
669
|
+
<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>
|
|
670
|
+
<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>
|
|
671
|
+
</div>
|
|
672
|
+
</div>
|
|
673
|
+
</div>
|
|
674
|
+
|
|
675
|
+
<script>
|
|
676
|
+
const graphData = ${payload};
|
|
677
|
+
document.getElementById('stat-files').textContent = graphData.metadata.totalFiles;
|
|
678
|
+
document.getElementById('stat-deps').textContent = graphData.metadata.totalDependencies;
|
|
679
|
+
|
|
680
|
+
const canvas = document.getElementById('canvas');
|
|
681
|
+
const ctx = canvas.getContext('2d');
|
|
682
|
+
|
|
683
|
+
const nodes = graphData.nodes.map((n, i) => ({
|
|
684
|
+
...n,
|
|
685
|
+
x: canvas.width / 2 + Math.cos(i / graphData.nodes.length * Math.PI * 2) * (Math.min(canvas.width, canvas.height) / 3),
|
|
686
|
+
y: canvas.height / 2 + Math.sin(i / graphData.nodes.length * Math.PI * 2) * (Math.min(canvas.width, canvas.height) / 3),
|
|
687
|
+
}));
|
|
688
|
+
|
|
689
|
+
function draw() {
|
|
690
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
691
|
+
|
|
692
|
+
graphData.edges.forEach(edge => {
|
|
693
|
+
const s = nodes.find(n => n.id === edge.source);
|
|
694
|
+
const t = nodes.find(n => n.id === edge.target);
|
|
695
|
+
if (!s || !t) return;
|
|
696
|
+
if (edge.type === 'related') return;
|
|
697
|
+
if (edge.type === 'similarity') {
|
|
698
|
+
ctx.strokeStyle = '#fb7e81';
|
|
699
|
+
ctx.lineWidth = 1.2;
|
|
700
|
+
} else if (edge.type === 'dependency') {
|
|
701
|
+
ctx.strokeStyle = '#84c1ff';
|
|
702
|
+
ctx.lineWidth = 1.0;
|
|
703
|
+
} else if (edge.type === 'reference') {
|
|
704
|
+
ctx.strokeStyle = '#ffa500';
|
|
705
|
+
ctx.lineWidth = 0.9;
|
|
706
|
+
} else {
|
|
707
|
+
ctx.strokeStyle = '#334155';
|
|
708
|
+
ctx.lineWidth = 0.8;
|
|
709
|
+
}
|
|
710
|
+
ctx.beginPath();
|
|
711
|
+
ctx.moveTo(s.x, s.y);
|
|
712
|
+
ctx.lineTo(t.x, t.y);
|
|
713
|
+
ctx.stroke();
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
const groups = {};
|
|
717
|
+
nodes.forEach(n => {
|
|
718
|
+
const g = n.group || '__default';
|
|
719
|
+
if (!groups[g]) groups[g] = { minX: n.x, minY: n.y, maxX: n.x, maxY: n.y };
|
|
720
|
+
groups[g].minX = Math.min(groups[g].minX, n.x);
|
|
721
|
+
groups[g].minY = Math.min(groups[g].minY, n.y);
|
|
722
|
+
groups[g].maxX = Math.max(groups[g].maxX, n.x);
|
|
723
|
+
groups[g].maxY = Math.max(groups[g].maxY, n.y);
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
const groupRelations = {};
|
|
727
|
+
graphData.edges.forEach(edge => {
|
|
728
|
+
const sNode = nodes.find(n => n.id === edge.source);
|
|
729
|
+
const tNode = nodes.find(n => n.id === edge.target);
|
|
730
|
+
if (!sNode || !tNode) return;
|
|
731
|
+
const g1 = sNode.group || '__default';
|
|
732
|
+
const g2 = tNode.group || '__default';
|
|
733
|
+
if (g1 === g2) return;
|
|
734
|
+
const key = g1 < g2 ? g1 + '::' + g2 : g2 + '::' + g1;
|
|
735
|
+
groupRelations[key] = (groupRelations[key] || 0) + 1;
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
Object.keys(groupRelations).forEach(k => {
|
|
739
|
+
const count = groupRelations[k];
|
|
740
|
+
const [ga, gb] = k.split('::');
|
|
741
|
+
if (!groups[ga] || !groups[gb]) return;
|
|
742
|
+
const ax = (groups[ga].minX + groups[ga].maxX) / 2;
|
|
743
|
+
const ay = (groups[ga].minY + groups[ga].maxY) / 2;
|
|
744
|
+
const bx = (groups[gb].minX + groups[gb].maxX) / 2;
|
|
745
|
+
const by = (groups[gb].minY + groups[gb].maxY) / 2;
|
|
746
|
+
ctx.beginPath();
|
|
747
|
+
ctx.strokeStyle = 'rgba(148,163,184,0.25)';
|
|
748
|
+
ctx.lineWidth = Math.min(6, 0.6 + Math.sqrt(count));
|
|
749
|
+
ctx.moveTo(ax, ay);
|
|
750
|
+
ctx.lineTo(bx, by);
|
|
751
|
+
ctx.stroke();
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
Object.keys(groups).forEach(g => {
|
|
755
|
+
if (g === '__default') return;
|
|
756
|
+
const box = groups[g];
|
|
757
|
+
const pad = 16;
|
|
758
|
+
const x = box.minX - pad;
|
|
759
|
+
const y = box.minY - pad;
|
|
760
|
+
const w = (box.maxX - box.minX) + pad * 2;
|
|
761
|
+
const h = (box.maxY - box.minY) + pad * 2;
|
|
762
|
+
ctx.save();
|
|
763
|
+
ctx.fillStyle = 'rgba(30,64,175,0.04)';
|
|
764
|
+
ctx.strokeStyle = 'rgba(30,64,175,0.12)';
|
|
765
|
+
ctx.lineWidth = 1.2;
|
|
766
|
+
const r = 8;
|
|
767
|
+
ctx.beginPath();
|
|
768
|
+
ctx.moveTo(x + r, y);
|
|
769
|
+
ctx.arcTo(x + w, y, x + w, y + h, r);
|
|
770
|
+
ctx.arcTo(x + w, y + h, x, y + h, r);
|
|
771
|
+
ctx.arcTo(x, y + h, x, y, r);
|
|
772
|
+
ctx.arcTo(x, y, x + w, y, r);
|
|
773
|
+
ctx.closePath();
|
|
774
|
+
ctx.fill();
|
|
775
|
+
ctx.stroke();
|
|
776
|
+
ctx.restore();
|
|
777
|
+
ctx.fillStyle = '#94a3b8';
|
|
778
|
+
ctx.font = '11px sans-serif';
|
|
779
|
+
ctx.fillText(g, x + 8, y + 14);
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
nodes.forEach(n => {
|
|
783
|
+
const sizeVal = (n.size || n.value || 1);
|
|
784
|
+
const r = 6 + (sizeVal / 2);
|
|
785
|
+
ctx.beginPath();
|
|
786
|
+
ctx.fillStyle = n.color || '#60a5fa';
|
|
787
|
+
ctx.arc(n.x, n.y, r, 0, Math.PI * 2);
|
|
788
|
+
ctx.fill();
|
|
789
|
+
|
|
790
|
+
ctx.fillStyle = '#e2e8f0';
|
|
791
|
+
ctx.font = '11px sans-serif';
|
|
792
|
+
ctx.textAlign = 'center';
|
|
793
|
+
ctx.fillText(n.label || n.id.split('/').slice(-1)[0], n.x, n.y + r + 12);
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
draw();
|
|
798
|
+
</script>
|
|
799
|
+
</body>
|
|
800
|
+
</html>`;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export {
|
|
804
|
+
LeadSource,
|
|
805
|
+
LeadSourceSchema,
|
|
806
|
+
LeadSchema,
|
|
807
|
+
LeadSubmissionSchema,
|
|
808
|
+
ManagedAccountSchema,
|
|
809
|
+
Severity,
|
|
810
|
+
SeveritySchema,
|
|
811
|
+
ToolName,
|
|
812
|
+
ToolNameSchema,
|
|
813
|
+
FRIENDLY_TOOL_NAMES,
|
|
814
|
+
IssueType,
|
|
815
|
+
IssueTypeSchema,
|
|
816
|
+
AnalysisStatus,
|
|
817
|
+
AnalysisStatusSchema,
|
|
818
|
+
ModelTier,
|
|
819
|
+
ModelTierSchema,
|
|
820
|
+
LocationSchema,
|
|
821
|
+
IssueSchema,
|
|
822
|
+
MetricsSchema,
|
|
823
|
+
AnalysisResultSchema,
|
|
824
|
+
SpokeSummarySchema,
|
|
825
|
+
SpokeOutputSchema,
|
|
826
|
+
UnifiedReportSchema,
|
|
827
|
+
AIReadyConfigSchema,
|
|
828
|
+
GLOBAL_INFRA_OPTIONS,
|
|
829
|
+
GLOBAL_SCAN_OPTIONS,
|
|
830
|
+
COMMON_FINE_TUNING_OPTIONS,
|
|
831
|
+
Language,
|
|
832
|
+
LANGUAGE_EXTENSIONS,
|
|
833
|
+
ParseError,
|
|
834
|
+
getRatingLabel,
|
|
835
|
+
getRatingSlug,
|
|
836
|
+
getRatingEmoji,
|
|
837
|
+
getToolEmoji,
|
|
838
|
+
getPriorityIcon,
|
|
839
|
+
getRating2 as getRating,
|
|
840
|
+
RecommendationPriority,
|
|
841
|
+
ReadinessRating,
|
|
842
|
+
DEFAULT_TOOL_WEIGHTS,
|
|
843
|
+
TOOL_NAME_MAP,
|
|
844
|
+
ScoringProfile,
|
|
845
|
+
SCORING_PROFILES,
|
|
846
|
+
CONTEXT_TIER_THRESHOLDS,
|
|
847
|
+
SIZE_ADJUSTED_THRESHOLDS,
|
|
848
|
+
getProjectSizeTier,
|
|
849
|
+
getRecommendedThreshold,
|
|
850
|
+
normalizeToolName,
|
|
851
|
+
getToolWeight,
|
|
852
|
+
parseWeightString,
|
|
853
|
+
calculateOverallScore,
|
|
854
|
+
getRatingWithContext,
|
|
855
|
+
getRatingDisplay,
|
|
856
|
+
formatScore,
|
|
857
|
+
formatToolScore,
|
|
858
|
+
generateHTML
|
|
859
|
+
};
|