@aiready/core 0.24.18 → 0.24.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-3NEZ5M7Y.mjs +937 -0
- package/dist/chunk-5IVDH26E.mjs +142 -88
- package/dist/chunk-BE52N7T2.mjs +892 -0
- package/dist/chunk-GQMKSUA4.mjs +381 -336
- package/dist/chunk-LRM26BOB.mjs +381 -336
- package/dist/chunk-MOM3IXCA.mjs +362 -0
- package/dist/chunk-OT6FOHL4.mjs +144 -88
- package/dist/chunk-OVWWYI75.mjs +307 -0
- package/dist/chunk-U3IY2CFC.mjs +18 -22
- package/dist/chunk-WPFXQH5F.mjs +307 -0
- package/dist/chunk-WUDUSXUE.mjs +366 -0
- package/dist/chunk-YQATXOKD.mjs +36 -0
- package/dist/chunk-YVPVNRFQ.mjs +937 -0
- package/dist/client/index.js +5 -1
- package/dist/client/index.mjs +2 -2
- package/dist/csharp-parser-JE5MWHQS.mjs +9 -0
- package/dist/csharp-parser-XW7WHE77.mjs +5 -9
- package/dist/go-parser-KTG4CGF5.mjs +5 -9
- package/dist/go-parser-T7PR6WJI.mjs +9 -0
- package/dist/index-CcP12wb-.d.mts +996 -693
- package/dist/index-CcP12wb-.d.ts +996 -693
- package/dist/index-DGbarGnr.d.mts +996 -693
- package/dist/index-DGbarGnr.d.ts +996 -693
- package/dist/index-slasaNzr.d.mts +1612 -0
- package/dist/index-slasaNzr.d.ts +1612 -0
- package/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +61 -7
- package/dist/index.mjs +58 -12
- package/dist/java-parser-EOKMGQ6B.mjs +5 -9
- package/dist/java-parser-WGOXKULP.mjs +9 -0
- package/dist/python-parser-7NCR7VCQ.mjs +8 -0
- package/dist/python-parser-BCI7JVLF.mjs +4 -8
- package/dist/typescript-parser-3KYGSSY5.mjs +3 -0
- package/dist/typescript-parser-4BA4VYAF.mjs +3 -7
- package/dist/typescript-parser-FOUPHVFI.mjs +3 -0
- package/dist/typescript-parser-G3TSNR7O.mjs +7 -0
- package/dist/typescript-parser-RMNCTHRD.mjs +3 -7
- package/dist/typescript-parser-WALISXF4.mjs +7 -0
- package/package.json +14 -11
package/dist/chunk-LRM26BOB.mjs
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
1
|
// src/types/enums.ts
|
|
2
|
-
import { z } from
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
4
|
-
Severity2[
|
|
5
|
-
Severity2[
|
|
6
|
-
Severity2[
|
|
7
|
-
Severity2[
|
|
4
|
+
Severity2['Critical'] = 'critical';
|
|
5
|
+
Severity2['Major'] = 'major';
|
|
6
|
+
Severity2['Minor'] = 'minor';
|
|
7
|
+
Severity2['Info'] = 'info';
|
|
8
8
|
return Severity2;
|
|
9
9
|
})(Severity || {});
|
|
10
10
|
var SeveritySchema = z.nativeEnum(Severity);
|
|
11
11
|
var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
12
|
-
ToolName2[
|
|
13
|
-
ToolName2[
|
|
14
|
-
ToolName2[
|
|
15
|
-
ToolName2[
|
|
16
|
-
ToolName2[
|
|
17
|
-
ToolName2[
|
|
18
|
-
ToolName2[
|
|
19
|
-
ToolName2[
|
|
20
|
-
ToolName2[
|
|
21
|
-
ToolName2[
|
|
22
|
-
ToolName2[
|
|
23
|
-
ToolName2[
|
|
24
|
-
ToolName2[
|
|
25
|
-
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
|
+
ToolName2['ContractEnforcement'] = 'contract-enforcement';
|
|
26
26
|
return ToolName2;
|
|
27
27
|
})(ToolName || {});
|
|
28
28
|
var ToolNameSchema = z.nativeEnum(ToolName);
|
|
29
29
|
var FRIENDLY_TOOL_NAMES = {
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
30
|
+
['pattern-detect' /* PatternDetect */]: 'Semantic Duplicates',
|
|
31
|
+
['context-analyzer' /* ContextAnalyzer */]: 'Context Fragmentation',
|
|
32
|
+
['naming-consistency' /* NamingConsistency */]: 'Naming Consistency',
|
|
33
|
+
['ai-signal-clarity' /* AiSignalClarity */]: 'AI Signal Clarity',
|
|
34
|
+
['agent-grounding' /* AgentGrounding */]: 'Agent Grounding',
|
|
35
|
+
['testability-index' /* TestabilityIndex */]: 'Testability Index',
|
|
36
|
+
['doc-drift' /* DocDrift */]: 'Documentation Health',
|
|
37
|
+
['dependency-health' /* DependencyHealth */]: 'Dependency Health',
|
|
38
|
+
['change-amplification' /* ChangeAmplification */]: 'Change Amplification',
|
|
39
|
+
['cognitive-load' /* CognitiveLoad */]: 'Cognitive Load',
|
|
40
|
+
['pattern-entropy' /* PatternEntropy */]: 'Pattern Entropy',
|
|
41
|
+
['concept-cohesion' /* ConceptCohesion */]: 'Concept Cohesion',
|
|
42
|
+
['semantic-distance' /* SemanticDistance */]: 'Semantic Distance',
|
|
43
|
+
['contract-enforcement' /* ContractEnforcement */]: 'Contract Enforcement',
|
|
44
44
|
};
|
|
45
45
|
var IssueType = /* @__PURE__ */ ((IssueType2) => {
|
|
46
|
-
IssueType2[
|
|
47
|
-
IssueType2[
|
|
48
|
-
IssueType2[
|
|
49
|
-
IssueType2[
|
|
50
|
-
IssueType2[
|
|
51
|
-
IssueType2[
|
|
52
|
-
IssueType2[
|
|
53
|
-
IssueType2[
|
|
54
|
-
IssueType2[
|
|
55
|
-
IssueType2[
|
|
56
|
-
IssueType2[
|
|
57
|
-
IssueType2[
|
|
58
|
-
IssueType2[
|
|
59
|
-
IssueType2[
|
|
60
|
-
IssueType2[
|
|
61
|
-
IssueType2[
|
|
62
|
-
IssueType2[
|
|
63
|
-
IssueType2[
|
|
64
|
-
IssueType2[
|
|
46
|
+
IssueType2['DuplicatePattern'] = 'duplicate-pattern';
|
|
47
|
+
IssueType2['PatternInconsistency'] = 'pattern-inconsistency';
|
|
48
|
+
IssueType2['ContextFragmentation'] = 'context-fragmentation';
|
|
49
|
+
IssueType2['DependencyHealth'] = 'dependency-health';
|
|
50
|
+
IssueType2['CircularDependency'] = 'circular-dependency';
|
|
51
|
+
IssueType2['DocDrift'] = 'doc-drift';
|
|
52
|
+
IssueType2['NamingInconsistency'] = 'naming-inconsistency';
|
|
53
|
+
IssueType2['NamingQuality'] = 'naming-quality';
|
|
54
|
+
IssueType2['ArchitectureInconsistency'] = 'architecture-inconsistency';
|
|
55
|
+
IssueType2['DeadCode'] = 'dead-code';
|
|
56
|
+
IssueType2['MissingTypes'] = 'missing-types';
|
|
57
|
+
IssueType2['MagicLiteral'] = 'magic-literal';
|
|
58
|
+
IssueType2['BooleanTrap'] = 'boolean-trap';
|
|
59
|
+
IssueType2['AiSignalClarity'] = 'ai-signal-clarity';
|
|
60
|
+
IssueType2['LowTestability'] = 'low-testability';
|
|
61
|
+
IssueType2['AgentNavigationFailure'] = 'agent-navigation-failure';
|
|
62
|
+
IssueType2['AmbiguousApi'] = 'ambiguous-api';
|
|
63
|
+
IssueType2['ChangeAmplification'] = 'change-amplification';
|
|
64
|
+
IssueType2['ContractGap'] = 'contract-gap';
|
|
65
65
|
return IssueType2;
|
|
66
66
|
})(IssueType || {});
|
|
67
67
|
var IssueTypeSchema = z.nativeEnum(IssueType);
|
|
68
68
|
var AnalysisStatus = /* @__PURE__ */ ((AnalysisStatus2) => {
|
|
69
|
-
AnalysisStatus2[
|
|
70
|
-
AnalysisStatus2[
|
|
71
|
-
AnalysisStatus2[
|
|
69
|
+
AnalysisStatus2['Processing'] = 'processing';
|
|
70
|
+
AnalysisStatus2['Completed'] = 'completed';
|
|
71
|
+
AnalysisStatus2['Failed'] = 'failed';
|
|
72
72
|
return AnalysisStatus2;
|
|
73
73
|
})(AnalysisStatus || {});
|
|
74
74
|
var AnalysisStatusSchema = z.nativeEnum(AnalysisStatus);
|
|
75
75
|
var ModelTier = /* @__PURE__ */ ((ModelTier2) => {
|
|
76
|
-
ModelTier2[
|
|
77
|
-
ModelTier2[
|
|
78
|
-
ModelTier2[
|
|
79
|
-
ModelTier2[
|
|
76
|
+
ModelTier2['Compact'] = 'compact';
|
|
77
|
+
ModelTier2['Standard'] = 'standard';
|
|
78
|
+
ModelTier2['Extended'] = 'extended';
|
|
79
|
+
ModelTier2['Frontier'] = 'frontier';
|
|
80
80
|
return ModelTier2;
|
|
81
81
|
})(ModelTier || {});
|
|
82
82
|
var ModelTierSchema = z.nativeEnum(ModelTier);
|
|
83
83
|
|
|
84
84
|
// src/types/common.ts
|
|
85
|
-
import { z as z2 } from
|
|
85
|
+
import { z as z2 } from 'zod';
|
|
86
86
|
var LocationSchema = z2.object({
|
|
87
87
|
file: z2.string(),
|
|
88
88
|
line: z2.number(),
|
|
89
89
|
column: z2.number().optional(),
|
|
90
90
|
endLine: z2.number().optional(),
|
|
91
|
-
endColumn: z2.number().optional()
|
|
91
|
+
endColumn: z2.number().optional(),
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
// src/types/schemas/issue.ts
|
|
95
|
-
import { z as z3 } from
|
|
95
|
+
import { z as z3 } from 'zod';
|
|
96
96
|
var IssueSchema = z3.object({
|
|
97
97
|
type: IssueTypeSchema,
|
|
98
98
|
severity: SeveritySchema,
|
|
99
99
|
message: z3.string(),
|
|
100
100
|
location: LocationSchema,
|
|
101
|
-
suggestion: z3.string().optional()
|
|
101
|
+
suggestion: z3.string().optional(),
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
// src/types/schemas/metrics.ts
|
|
105
|
-
import { z as z4 } from
|
|
105
|
+
import { z as z4 } from 'zod';
|
|
106
106
|
var MetricsSchema = z4.object({
|
|
107
107
|
tokenCost: z4.number().optional(),
|
|
108
108
|
complexityScore: z4.number().optional(),
|
|
@@ -121,115 +121,140 @@ var MetricsSchema = z4.object({
|
|
|
121
121
|
comprehensionDifficultyIndex: z4.number().optional(),
|
|
122
122
|
// Extended metrics for specific spokes
|
|
123
123
|
totalSymbols: z4.number().optional(),
|
|
124
|
-
totalExports: z4.number().optional()
|
|
124
|
+
totalExports: z4.number().optional(),
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
// src/types/schemas/report.ts
|
|
128
|
-
import { z as z5 } from
|
|
128
|
+
import { z as z5 } from 'zod';
|
|
129
129
|
var AnalysisResultSchema = z5.object({
|
|
130
130
|
fileName: z5.string(),
|
|
131
131
|
issues: z5.array(IssueSchema),
|
|
132
|
-
metrics: MetricsSchema
|
|
132
|
+
metrics: MetricsSchema,
|
|
133
133
|
});
|
|
134
|
-
var SpokeSummarySchema = z5
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
var SpokeSummarySchema = z5
|
|
135
|
+
.object({
|
|
136
|
+
totalFiles: z5.number().optional(),
|
|
137
|
+
totalIssues: z5.number().optional(),
|
|
138
|
+
criticalIssues: z5.number().optional(),
|
|
139
|
+
majorIssues: z5.number().optional(),
|
|
140
|
+
score: z5.number().optional(),
|
|
141
|
+
})
|
|
142
|
+
.catchall(z5.any());
|
|
141
143
|
var SpokeOutputSchema = z5.object({
|
|
142
144
|
results: z5.array(AnalysisResultSchema),
|
|
143
145
|
summary: SpokeSummarySchema,
|
|
144
|
-
metadata: z5
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
metadata: z5
|
|
147
|
+
.object({
|
|
148
|
+
toolName: z5.string(),
|
|
149
|
+
version: z5.string().optional(),
|
|
150
|
+
timestamp: z5.string().optional(),
|
|
151
|
+
config: z5.any().optional(),
|
|
152
|
+
})
|
|
153
|
+
.catchall(z5.any())
|
|
154
|
+
.optional(),
|
|
150
155
|
});
|
|
151
|
-
var UnifiedReportSchema = z5
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
156
|
+
var UnifiedReportSchema = z5
|
|
157
|
+
.object({
|
|
158
|
+
summary: z5.object({
|
|
159
|
+
totalFiles: z5.number(),
|
|
160
|
+
totalIssues: z5.number(),
|
|
161
|
+
criticalIssues: z5.number(),
|
|
162
|
+
majorIssues: z5.number(),
|
|
163
|
+
businessImpact: z5
|
|
164
|
+
.object({
|
|
165
|
+
estimatedMonthlyWaste: z5.number().optional(),
|
|
166
|
+
potentialSavings: z5.number().optional(),
|
|
167
|
+
productivityHours: z5.number().optional(),
|
|
168
|
+
})
|
|
169
|
+
.optional(),
|
|
170
|
+
}),
|
|
171
|
+
results: z5.array(AnalysisResultSchema),
|
|
172
|
+
scoring: z5
|
|
173
|
+
.object({
|
|
174
|
+
overall: z5.number(),
|
|
175
|
+
rating: z5.string(),
|
|
176
|
+
timestamp: z5.string(),
|
|
177
|
+
breakdown: z5.array(
|
|
178
|
+
z5
|
|
179
|
+
.object({
|
|
180
|
+
toolName: z5.union([ToolNameSchema, z5.string()]),
|
|
181
|
+
score: z5.number(),
|
|
182
|
+
})
|
|
183
|
+
.catchall(z5.any())
|
|
184
|
+
),
|
|
185
|
+
})
|
|
186
|
+
.optional(),
|
|
187
|
+
})
|
|
188
|
+
.catchall(z5.any());
|
|
176
189
|
|
|
177
190
|
// src/types/schemas/config.ts
|
|
178
|
-
import { z as z6 } from
|
|
179
|
-
var AIReadyConfigSchema = z6
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
/** Fail CI/CD if score below threshold (0-100) */
|
|
183
|
-
threshold: z6.number().optional(),
|
|
184
|
-
/** Fail on issues: critical, major, any */
|
|
185
|
-
failOn: z6.enum(["critical", "major", "any", "none"]).optional(),
|
|
186
|
-
/** Scan-specific configuration */
|
|
187
|
-
scan: z6.object({
|
|
188
|
-
include: z6.array(z6.string()).optional(),
|
|
191
|
+
import { z as z6 } from 'zod';
|
|
192
|
+
var AIReadyConfigSchema = z6
|
|
193
|
+
.object({
|
|
194
|
+
/** Files or directories to exclude from scan */
|
|
189
195
|
exclude: z6.array(z6.string()).optional(),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
196
|
+
/** Fail CI/CD if score below threshold (0-100) */
|
|
197
|
+
threshold: z6.number().optional(),
|
|
198
|
+
/** Fail on issues: critical, major, any */
|
|
199
|
+
failOn: z6.enum(['critical', 'major', 'any', 'none']).optional(),
|
|
200
|
+
/** Scan-specific configuration */
|
|
201
|
+
scan: z6
|
|
202
|
+
.object({
|
|
203
|
+
include: z6.array(z6.string()).optional(),
|
|
204
|
+
exclude: z6.array(z6.string()).optional(),
|
|
205
|
+
parallel: z6.boolean().optional(),
|
|
206
|
+
deep: z6.boolean().optional(),
|
|
207
|
+
tools: z6.array(z6.string()).optional(),
|
|
208
|
+
})
|
|
209
|
+
.optional(),
|
|
210
|
+
/** Output-specific configuration */
|
|
211
|
+
output: z6
|
|
212
|
+
.object({
|
|
213
|
+
/** Output format (json, console, html) */
|
|
214
|
+
format: z6.enum(['json', 'console', 'html']).optional(),
|
|
215
|
+
/** Output file path */
|
|
216
|
+
path: z6.string().optional(),
|
|
217
|
+
/** Output directory */
|
|
218
|
+
saveTo: z6.string().optional(),
|
|
219
|
+
/** Whether to show score breakdown in console */
|
|
220
|
+
showBreakdown: z6.boolean().optional(),
|
|
221
|
+
/** Baseline report to compare against */
|
|
222
|
+
compareBaseline: z6.string().optional(),
|
|
223
|
+
})
|
|
224
|
+
.optional(),
|
|
225
|
+
/** Tool-specific configuration overrides (Strictly ToolName -> Config) */
|
|
226
|
+
tools: z6.record(z6.string(), z6.any()).optional(),
|
|
227
|
+
/** Scoring profile and weights */
|
|
228
|
+
scoring: z6
|
|
229
|
+
.object({
|
|
230
|
+
/** Name of the scoring profile (e.g. "strict", "balanced") */
|
|
231
|
+
profile: z6.string().optional(),
|
|
232
|
+
/** Custom weights for tools and metrics */
|
|
233
|
+
weights: z6.record(z6.string(), z6.number()).optional(),
|
|
234
|
+
})
|
|
235
|
+
.optional(),
|
|
236
|
+
/** Visualizer settings (interactive graph) */
|
|
237
|
+
visualizer: z6
|
|
238
|
+
.object({
|
|
239
|
+
groupingDirs: z6.array(z6.string()).optional(),
|
|
240
|
+
graph: z6
|
|
241
|
+
.object({
|
|
242
|
+
maxNodes: z6.number().optional(),
|
|
243
|
+
maxEdges: z6.number().optional(),
|
|
244
|
+
})
|
|
245
|
+
.optional(),
|
|
246
|
+
})
|
|
247
|
+
.optional(),
|
|
248
|
+
})
|
|
249
|
+
.catchall(z6.any());
|
|
225
250
|
|
|
226
251
|
// src/types/business.ts
|
|
227
|
-
import { z as z7 } from
|
|
252
|
+
import { z as z7 } from 'zod';
|
|
228
253
|
var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
|
|
229
|
-
LeadSource2[
|
|
230
|
-
LeadSource2[
|
|
231
|
-
LeadSource2[
|
|
232
|
-
LeadSource2[
|
|
254
|
+
LeadSource2['ClawMoreHero'] = 'clawmore-hero';
|
|
255
|
+
LeadSource2['ClawMoreWaitlist'] = 'clawmore-waitlist';
|
|
256
|
+
LeadSource2['ClawMoreBeta'] = 'clawmore-beta';
|
|
257
|
+
LeadSource2['AiReadyPlatform'] = 'aiready-platform';
|
|
233
258
|
return LeadSource2;
|
|
234
259
|
})(LeadSource || {});
|
|
235
260
|
var LeadSourceSchema = z7.nativeEnum(LeadSource);
|
|
@@ -237,16 +262,18 @@ var LeadSchema = z7.object({
|
|
|
237
262
|
id: z7.string(),
|
|
238
263
|
email: z7.string().email(),
|
|
239
264
|
name: z7.string().min(1),
|
|
240
|
-
interest: z7.string().default(
|
|
265
|
+
interest: z7.string().default('General'),
|
|
241
266
|
notes: z7.string().optional(),
|
|
242
267
|
timestamp: z7.string().datetime(),
|
|
243
268
|
source: LeadSourceSchema,
|
|
244
|
-
status: z7
|
|
269
|
+
status: z7
|
|
270
|
+
.enum(['new', 'contacted', 'qualified', 'converted', 'archived'])
|
|
271
|
+
.default('new'),
|
|
245
272
|
});
|
|
246
273
|
var LeadSubmissionSchema = LeadSchema.omit({
|
|
247
274
|
id: true,
|
|
248
275
|
timestamp: true,
|
|
249
|
-
status: true
|
|
276
|
+
status: true,
|
|
250
277
|
});
|
|
251
278
|
var ManagedAccountSchema = z7.object({
|
|
252
279
|
id: z7.string(),
|
|
@@ -257,12 +284,14 @@ var ManagedAccountSchema = z7.object({
|
|
|
257
284
|
// Owner (caopengau@gmail.com)
|
|
258
285
|
stripeSubscriptionId: z7.string(),
|
|
259
286
|
// AI Token Management
|
|
260
|
-
tokenStrategy: z7.enum([
|
|
261
|
-
byokConfig: z7
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
287
|
+
tokenStrategy: z7.enum(['managed', 'byok']).default('managed'),
|
|
288
|
+
byokConfig: z7
|
|
289
|
+
.object({
|
|
290
|
+
openaiKey: z7.string().optional(),
|
|
291
|
+
anthropicKey: z7.string().optional(),
|
|
292
|
+
openrouterKey: z7.string().optional(),
|
|
293
|
+
})
|
|
294
|
+
.optional(),
|
|
266
295
|
// Financials (in cents)
|
|
267
296
|
baseFeeCents: z7.number().default(2900),
|
|
268
297
|
includedComputeCents: z7.number().default(1500),
|
|
@@ -274,37 +303,39 @@ var ManagedAccountSchema = z7.object({
|
|
|
274
303
|
// Users buy these in $10 packs
|
|
275
304
|
currentMonthlyTokenSpendCents: z7.number().default(0),
|
|
276
305
|
// Governance
|
|
277
|
-
status: z7
|
|
306
|
+
status: z7
|
|
307
|
+
.enum(['provisioning', 'active', 'warning', 'quarantined', 'suspended'])
|
|
308
|
+
.default('provisioning'),
|
|
278
309
|
lastCostSyncAt: z7.string().datetime().optional(),
|
|
279
|
-
region: z7.string().default(
|
|
310
|
+
region: z7.string().default('ap-southeast-2'),
|
|
280
311
|
// Alerting thresholds (percentage of includedComputeCents)
|
|
281
|
-
alertThresholds: z7.array(z7.number()).default([50, 80, 100, 150])
|
|
312
|
+
alertThresholds: z7.array(z7.number()).default([50, 80, 100, 150]),
|
|
282
313
|
});
|
|
283
314
|
|
|
284
315
|
// src/types.ts
|
|
285
316
|
var GLOBAL_INFRA_OPTIONS = [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
317
|
+
'rootDir',
|
|
318
|
+
'include',
|
|
319
|
+
'exclude',
|
|
320
|
+
'tools',
|
|
321
|
+
'scoring',
|
|
291
322
|
];
|
|
292
323
|
var GLOBAL_SCAN_OPTIONS = [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
324
|
+
'rootDir',
|
|
325
|
+
'include',
|
|
326
|
+
'exclude',
|
|
327
|
+
'config',
|
|
328
|
+
'threshold',
|
|
329
|
+
'output',
|
|
330
|
+
'format',
|
|
331
|
+
'parallel',
|
|
332
|
+
'showBreakdown',
|
|
302
333
|
];
|
|
303
334
|
var COMMON_FINE_TUNING_OPTIONS = [
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
335
|
+
'maxDepth',
|
|
336
|
+
'minSimilarity',
|
|
337
|
+
'threshold',
|
|
338
|
+
'showBreakdown',
|
|
308
339
|
];
|
|
309
340
|
|
|
310
341
|
// src/utils/visualization.ts
|
|
@@ -475,51 +506,51 @@ function generateHTML(graph) {
|
|
|
475
506
|
|
|
476
507
|
// src/utils/rating-helpers.ts
|
|
477
508
|
var ReadinessRating = /* @__PURE__ */ ((ReadinessRating2) => {
|
|
478
|
-
ReadinessRating2[
|
|
479
|
-
ReadinessRating2[
|
|
480
|
-
ReadinessRating2[
|
|
481
|
-
ReadinessRating2[
|
|
482
|
-
ReadinessRating2[
|
|
509
|
+
ReadinessRating2['Excellent'] = 'Excellent';
|
|
510
|
+
ReadinessRating2['Good'] = 'Good';
|
|
511
|
+
ReadinessRating2['Fair'] = 'Fair';
|
|
512
|
+
ReadinessRating2['NeedsWork'] = 'Needs Work';
|
|
513
|
+
ReadinessRating2['Critical'] = 'Critical';
|
|
483
514
|
return ReadinessRating2;
|
|
484
515
|
})(ReadinessRating || {});
|
|
485
516
|
function getRatingMetadata(score) {
|
|
486
517
|
if (score >= 90) {
|
|
487
518
|
return {
|
|
488
|
-
label:
|
|
489
|
-
slug:
|
|
490
|
-
emoji:
|
|
491
|
-
rating:
|
|
519
|
+
label: 'Excellent',
|
|
520
|
+
slug: 'excellent',
|
|
521
|
+
emoji: '\u2705',
|
|
522
|
+
rating: 'Excellent' /* Excellent */,
|
|
492
523
|
};
|
|
493
524
|
}
|
|
494
525
|
if (score >= 75) {
|
|
495
526
|
return {
|
|
496
|
-
label:
|
|
497
|
-
slug:
|
|
498
|
-
emoji:
|
|
499
|
-
rating:
|
|
527
|
+
label: 'Good',
|
|
528
|
+
slug: 'good',
|
|
529
|
+
emoji: '\u{1F44D}',
|
|
530
|
+
rating: 'Good' /* Good */,
|
|
500
531
|
};
|
|
501
532
|
}
|
|
502
533
|
if (score >= 60) {
|
|
503
534
|
return {
|
|
504
|
-
label:
|
|
505
|
-
slug:
|
|
506
|
-
emoji:
|
|
507
|
-
rating:
|
|
535
|
+
label: 'Fair',
|
|
536
|
+
slug: 'fair',
|
|
537
|
+
emoji: '\u{1F44C}',
|
|
538
|
+
rating: 'Fair' /* Fair */,
|
|
508
539
|
};
|
|
509
540
|
}
|
|
510
541
|
if (score >= 40) {
|
|
511
542
|
return {
|
|
512
|
-
label:
|
|
513
|
-
slug:
|
|
514
|
-
emoji:
|
|
515
|
-
rating:
|
|
543
|
+
label: 'Needs Work',
|
|
544
|
+
slug: 'needs-work',
|
|
545
|
+
emoji: '\u{1F528}',
|
|
546
|
+
rating: 'Needs Work' /* NeedsWork */,
|
|
516
547
|
};
|
|
517
548
|
}
|
|
518
549
|
return {
|
|
519
|
-
label:
|
|
520
|
-
slug:
|
|
521
|
-
emoji:
|
|
522
|
-
rating:
|
|
550
|
+
label: 'Critical',
|
|
551
|
+
slug: 'critical',
|
|
552
|
+
emoji: '\u{1F6A8}',
|
|
553
|
+
rating: 'Critical' /* Critical */,
|
|
523
554
|
};
|
|
524
555
|
}
|
|
525
556
|
function getRatingLabel(score) {
|
|
@@ -536,16 +567,16 @@ function getToolEmoji(score) {
|
|
|
536
567
|
}
|
|
537
568
|
function getPriorityIcon(priority) {
|
|
538
569
|
switch (priority) {
|
|
539
|
-
case
|
|
540
|
-
return
|
|
541
|
-
case
|
|
542
|
-
return
|
|
543
|
-
case
|
|
544
|
-
return
|
|
545
|
-
case
|
|
546
|
-
return
|
|
570
|
+
case 'critical':
|
|
571
|
+
return '\u{1F534}';
|
|
572
|
+
case 'high':
|
|
573
|
+
return '\u{1F7E0}';
|
|
574
|
+
case 'medium':
|
|
575
|
+
return '\u{1F7E1}';
|
|
576
|
+
case 'low':
|
|
577
|
+
return '\u{1F535}';
|
|
547
578
|
default:
|
|
548
|
-
return
|
|
579
|
+
return '\u26AA';
|
|
549
580
|
}
|
|
550
581
|
}
|
|
551
582
|
function getRating(score) {
|
|
@@ -554,9 +585,9 @@ function getRating(score) {
|
|
|
554
585
|
|
|
555
586
|
// src/scoring-types.ts
|
|
556
587
|
var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
|
|
557
|
-
RecommendationPriority2[
|
|
558
|
-
RecommendationPriority2[
|
|
559
|
-
RecommendationPriority2[
|
|
588
|
+
RecommendationPriority2['High'] = 'high';
|
|
589
|
+
RecommendationPriority2['Medium'] = 'medium';
|
|
590
|
+
RecommendationPriority2['Low'] = 'low';
|
|
560
591
|
return RecommendationPriority2;
|
|
561
592
|
})(RecommendationPriority || {});
|
|
562
593
|
|
|
@@ -564,7 +595,7 @@ var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
|
|
|
564
595
|
var SCORING_CONSTANTS = {
|
|
565
596
|
WEIGHTS: {
|
|
566
597
|
DEFAULT: 5,
|
|
567
|
-
MAX: 100
|
|
598
|
+
MAX: 100,
|
|
568
599
|
},
|
|
569
600
|
THRESHOLDS: {
|
|
570
601
|
XS: 80,
|
|
@@ -572,106 +603,106 @@ var SCORING_CONSTANTS = {
|
|
|
572
603
|
MEDIUM: 70,
|
|
573
604
|
LARGE: 65,
|
|
574
605
|
ENTERPRISE: 58,
|
|
575
|
-
NORMALIZATION_OFFSET: 70
|
|
606
|
+
NORMALIZATION_OFFSET: 70,
|
|
576
607
|
},
|
|
577
608
|
FILE_COUNTS: {
|
|
578
609
|
XS: 50,
|
|
579
610
|
SMALL: 200,
|
|
580
611
|
MEDIUM: 500,
|
|
581
|
-
LARGE: 2e3
|
|
612
|
+
LARGE: 2e3,
|
|
582
613
|
},
|
|
583
614
|
DELIMITERS: {
|
|
584
|
-
LIST:
|
|
585
|
-
PAIR:
|
|
586
|
-
FORMULA_JOIN:
|
|
587
|
-
}
|
|
615
|
+
LIST: ',',
|
|
616
|
+
PAIR: ':',
|
|
617
|
+
FORMULA_JOIN: ' + ',
|
|
618
|
+
},
|
|
588
619
|
};
|
|
589
620
|
var DEFAULT_TOOL_WEIGHTS = {
|
|
590
|
-
[
|
|
591
|
-
[
|
|
592
|
-
[
|
|
593
|
-
[
|
|
594
|
-
[
|
|
595
|
-
[
|
|
596
|
-
[
|
|
597
|
-
[
|
|
598
|
-
[
|
|
599
|
-
[
|
|
621
|
+
['pattern-detect' /* PatternDetect */]: 22,
|
|
622
|
+
['context-analyzer' /* ContextAnalyzer */]: 19,
|
|
623
|
+
['naming-consistency' /* NamingConsistency */]: 14,
|
|
624
|
+
['ai-signal-clarity' /* AiSignalClarity */]: 11,
|
|
625
|
+
['agent-grounding' /* AgentGrounding */]: 10,
|
|
626
|
+
['testability-index' /* TestabilityIndex */]: 10,
|
|
627
|
+
['doc-drift' /* DocDrift */]: 8,
|
|
628
|
+
['dependency-health' /* DependencyHealth */]: 6,
|
|
629
|
+
['change-amplification' /* ChangeAmplification */]: 8,
|
|
630
|
+
['contract-enforcement' /* ContractEnforcement */]: 10,
|
|
600
631
|
};
|
|
601
632
|
var TOOL_NAME_MAP = {
|
|
602
|
-
patterns:
|
|
603
|
-
|
|
604
|
-
context:
|
|
605
|
-
|
|
606
|
-
consistency:
|
|
607
|
-
namingconsistency:
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
grounding:
|
|
612
|
-
|
|
613
|
-
testability:
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
contract:
|
|
621
|
-
|
|
633
|
+
patterns: 'pattern-detect' /* PatternDetect */,
|
|
634
|
+
'pattern-detect': 'pattern-detect' /* PatternDetect */,
|
|
635
|
+
context: 'context-analyzer' /* ContextAnalyzer */,
|
|
636
|
+
'context-analyzer': 'context-analyzer' /* ContextAnalyzer */,
|
|
637
|
+
consistency: 'naming-consistency' /* NamingConsistency */,
|
|
638
|
+
namingconsistency: 'naming-consistency' /* NamingConsistency */,
|
|
639
|
+
'naming-consistency': 'naming-consistency' /* NamingConsistency */,
|
|
640
|
+
'ai-signal': 'ai-signal-clarity' /* AiSignalClarity */,
|
|
641
|
+
'ai-signal-clarity': 'ai-signal-clarity' /* AiSignalClarity */,
|
|
642
|
+
grounding: 'agent-grounding' /* AgentGrounding */,
|
|
643
|
+
'agent-grounding': 'agent-grounding' /* AgentGrounding */,
|
|
644
|
+
testability: 'testability-index' /* TestabilityIndex */,
|
|
645
|
+
'testability-index': 'testability-index' /* TestabilityIndex */,
|
|
646
|
+
'doc-drift': 'doc-drift' /* DocDrift */,
|
|
647
|
+
'deps-health': 'dependency-health' /* DependencyHealth */,
|
|
648
|
+
'dependency-health': 'dependency-health' /* DependencyHealth */,
|
|
649
|
+
'change-amp': 'change-amplification' /* ChangeAmplification */,
|
|
650
|
+
'change-amplification': 'change-amplification' /* ChangeAmplification */,
|
|
651
|
+
contract: 'contract-enforcement' /* ContractEnforcement */,
|
|
652
|
+
'contract-enforcement': 'contract-enforcement' /* ContractEnforcement */,
|
|
622
653
|
};
|
|
623
654
|
var ScoringProfile = /* @__PURE__ */ ((ScoringProfile2) => {
|
|
624
|
-
ScoringProfile2[
|
|
625
|
-
ScoringProfile2[
|
|
626
|
-
ScoringProfile2[
|
|
627
|
-
ScoringProfile2[
|
|
628
|
-
ScoringProfile2[
|
|
629
|
-
ScoringProfile2[
|
|
655
|
+
ScoringProfile2['Default'] = 'default';
|
|
656
|
+
ScoringProfile2['Agentic'] = 'agentic';
|
|
657
|
+
ScoringProfile2['Logic'] = 'logic';
|
|
658
|
+
ScoringProfile2['UI'] = 'ui';
|
|
659
|
+
ScoringProfile2['Cost'] = 'cost';
|
|
660
|
+
ScoringProfile2['Security'] = 'security';
|
|
630
661
|
return ScoringProfile2;
|
|
631
662
|
})(ScoringProfile || {});
|
|
632
663
|
var SCORING_PROFILES = {
|
|
633
|
-
[
|
|
634
|
-
[
|
|
635
|
-
[
|
|
636
|
-
[
|
|
637
|
-
[
|
|
638
|
-
[
|
|
639
|
-
[
|
|
640
|
-
[
|
|
664
|
+
['default' /* Default */]: DEFAULT_TOOL_WEIGHTS,
|
|
665
|
+
['agentic' /* Agentic */]: {
|
|
666
|
+
['ai-signal-clarity' /* AiSignalClarity */]: 25,
|
|
667
|
+
['agent-grounding' /* AgentGrounding */]: 25,
|
|
668
|
+
['testability-index' /* TestabilityIndex */]: 15,
|
|
669
|
+
['contract-enforcement' /* ContractEnforcement */]: 15,
|
|
670
|
+
['context-analyzer' /* ContextAnalyzer */]: 10,
|
|
671
|
+
['naming-consistency' /* NamingConsistency */]: 10,
|
|
641
672
|
},
|
|
642
|
-
[
|
|
643
|
-
[
|
|
644
|
-
[
|
|
645
|
-
[
|
|
646
|
-
[
|
|
647
|
-
[
|
|
673
|
+
['logic' /* Logic */]: {
|
|
674
|
+
['testability-index' /* TestabilityIndex */]: 40,
|
|
675
|
+
['naming-consistency' /* NamingConsistency */]: 20,
|
|
676
|
+
['context-analyzer' /* ContextAnalyzer */]: 20,
|
|
677
|
+
['pattern-detect' /* PatternDetect */]: 10,
|
|
678
|
+
['change-amplification' /* ChangeAmplification */]: 10,
|
|
648
679
|
},
|
|
649
|
-
[
|
|
650
|
-
[
|
|
651
|
-
[
|
|
652
|
-
[
|
|
653
|
-
[
|
|
654
|
-
[
|
|
680
|
+
['ui' /* UI */]: {
|
|
681
|
+
['naming-consistency' /* NamingConsistency */]: 30,
|
|
682
|
+
['context-analyzer' /* ContextAnalyzer */]: 30,
|
|
683
|
+
['pattern-detect' /* PatternDetect */]: 20,
|
|
684
|
+
['doc-drift' /* DocDrift */]: 10,
|
|
685
|
+
['ai-signal-clarity' /* AiSignalClarity */]: 10,
|
|
655
686
|
},
|
|
656
|
-
[
|
|
657
|
-
[
|
|
658
|
-
[
|
|
659
|
-
[
|
|
660
|
-
[
|
|
687
|
+
['cost' /* Cost */]: {
|
|
688
|
+
['pattern-detect' /* PatternDetect */]: 50,
|
|
689
|
+
['context-analyzer' /* ContextAnalyzer */]: 30,
|
|
690
|
+
['change-amplification' /* ChangeAmplification */]: 10,
|
|
691
|
+
['dependency-health' /* DependencyHealth */]: 10,
|
|
692
|
+
},
|
|
693
|
+
['security' /* Security */]: {
|
|
694
|
+
['naming-consistency' /* NamingConsistency */]: 30,
|
|
695
|
+
['testability-index' /* TestabilityIndex */]: 25,
|
|
696
|
+
['contract-enforcement' /* ContractEnforcement */]: 15,
|
|
697
|
+
['dependency-health' /* DependencyHealth */]: 20,
|
|
698
|
+
['context-analyzer' /* ContextAnalyzer */]: 10,
|
|
661
699
|
},
|
|
662
|
-
["security" /* Security */]: {
|
|
663
|
-
["naming-consistency" /* NamingConsistency */]: 30,
|
|
664
|
-
["testability-index" /* TestabilityIndex */]: 25,
|
|
665
|
-
["contract-enforcement" /* ContractEnforcement */]: 15,
|
|
666
|
-
["dependency-health" /* DependencyHealth */]: 20,
|
|
667
|
-
["context-analyzer" /* ContextAnalyzer */]: 10
|
|
668
|
-
}
|
|
669
700
|
};
|
|
670
701
|
var CONTEXT_TIER_THRESHOLDS = {
|
|
671
702
|
compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
|
|
672
703
|
standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
|
|
673
704
|
extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
|
|
674
|
-
frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
|
|
705
|
+
frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 },
|
|
675
706
|
};
|
|
676
707
|
var SIZE_ADJUSTED_THRESHOLDS = {
|
|
677
708
|
xs: SCORING_CONSTANTS.THRESHOLDS.XS,
|
|
@@ -682,30 +713,40 @@ var SIZE_ADJUSTED_THRESHOLDS = {
|
|
|
682
713
|
// 200-500 files
|
|
683
714
|
large: SCORING_CONSTANTS.THRESHOLDS.LARGE,
|
|
684
715
|
// 500-2000 files
|
|
685
|
-
enterprise: SCORING_CONSTANTS.THRESHOLDS.ENTERPRISE
|
|
716
|
+
enterprise: SCORING_CONSTANTS.THRESHOLDS.ENTERPRISE,
|
|
686
717
|
// 2000+ files
|
|
687
718
|
};
|
|
688
719
|
function getProjectSizeTier(fileCount) {
|
|
689
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.XS) return
|
|
690
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.SMALL) return
|
|
691
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.MEDIUM) return
|
|
692
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.LARGE) return
|
|
693
|
-
return
|
|
720
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.XS) return 'xs';
|
|
721
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.SMALL) return 'small';
|
|
722
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.MEDIUM) return 'medium';
|
|
723
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.LARGE) return 'large';
|
|
724
|
+
return 'enterprise';
|
|
694
725
|
}
|
|
695
|
-
function getRecommendedThreshold(fileCount, modelTier =
|
|
726
|
+
function getRecommendedThreshold(fileCount, modelTier = 'standard') {
|
|
696
727
|
const sizeTier = getProjectSizeTier(fileCount);
|
|
697
728
|
const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
|
|
698
|
-
const modelBonus =
|
|
729
|
+
const modelBonus =
|
|
730
|
+
modelTier === 'frontier' ? -3 : modelTier === 'extended' ? -2 : 0;
|
|
699
731
|
return base + modelBonus;
|
|
700
732
|
}
|
|
701
733
|
function normalizeToolName(shortName) {
|
|
702
734
|
return TOOL_NAME_MAP[shortName.toLowerCase()] ?? shortName;
|
|
703
735
|
}
|
|
704
|
-
function getToolWeight(
|
|
736
|
+
function getToolWeight(
|
|
737
|
+
toolName,
|
|
738
|
+
toolConfig,
|
|
739
|
+
cliOverride,
|
|
740
|
+
profile = 'default' /* Default */
|
|
741
|
+
) {
|
|
705
742
|
if (cliOverride !== void 0) return cliOverride;
|
|
706
743
|
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
707
744
|
const profileWeights = SCORING_PROFILES[profile] ?? DEFAULT_TOOL_WEIGHTS;
|
|
708
|
-
return
|
|
745
|
+
return (
|
|
746
|
+
profileWeights[toolName] ??
|
|
747
|
+
DEFAULT_TOOL_WEIGHTS[toolName] ??
|
|
748
|
+
SCORING_CONSTANTS.WEIGHTS.DEFAULT
|
|
749
|
+
);
|
|
709
750
|
}
|
|
710
751
|
function parseWeightString(weightStr) {
|
|
711
752
|
const weights = /* @__PURE__ */ new Map();
|
|
@@ -727,14 +768,17 @@ function parseWeightString(weightStr) {
|
|
|
727
768
|
}
|
|
728
769
|
function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
729
770
|
if (toolOutputs.size === 0) {
|
|
730
|
-
throw new Error(
|
|
771
|
+
throw new Error('No tool outputs provided for scoring');
|
|
731
772
|
}
|
|
732
|
-
const profile = config?.profile ||
|
|
773
|
+
const profile = config?.profile || 'default'; /* Default */
|
|
733
774
|
const weights = /* @__PURE__ */ new Map();
|
|
734
775
|
for (const [toolName] of toolOutputs.entries()) {
|
|
735
776
|
const cliWeight = cliWeights?.get(toolName);
|
|
736
777
|
const configWeight = config?.tools?.[toolName]?.scoreWeight;
|
|
737
|
-
const weight =
|
|
778
|
+
const weight =
|
|
779
|
+
cliWeight ??
|
|
780
|
+
configWeight ??
|
|
781
|
+
getToolWeight(toolName, void 0, void 0, profile);
|
|
738
782
|
weights.set(toolName, weight);
|
|
739
783
|
}
|
|
740
784
|
let weightedSum = 0;
|
|
@@ -762,35 +806,36 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
762
806
|
return {
|
|
763
807
|
overall,
|
|
764
808
|
rating,
|
|
765
|
-
timestamp:
|
|
809
|
+
timestamp: /* @__PURE__ */ new Date().toISOString(),
|
|
766
810
|
toolsUsed,
|
|
767
811
|
breakdown,
|
|
768
812
|
calculation: {
|
|
769
813
|
formula: formulaStr,
|
|
770
814
|
weights: calculationWeights,
|
|
771
|
-
normalized: formulaStr
|
|
772
|
-
}
|
|
815
|
+
normalized: formulaStr,
|
|
816
|
+
},
|
|
773
817
|
};
|
|
774
818
|
}
|
|
775
|
-
function getRatingWithContext(score, fileCount, modelTier =
|
|
819
|
+
function getRatingWithContext(score, fileCount, modelTier = 'standard') {
|
|
776
820
|
const threshold = getRecommendedThreshold(fileCount, modelTier);
|
|
777
|
-
const normalized =
|
|
821
|
+
const normalized =
|
|
822
|
+
score - threshold + SCORING_CONSTANTS.THRESHOLDS.NORMALIZATION_OFFSET;
|
|
778
823
|
return getRating(normalized);
|
|
779
824
|
}
|
|
780
825
|
function getRatingDisplay(rating) {
|
|
781
826
|
switch (rating) {
|
|
782
|
-
case
|
|
783
|
-
return { emoji:
|
|
784
|
-
case
|
|
785
|
-
return { emoji:
|
|
786
|
-
case
|
|
787
|
-
return { emoji:
|
|
788
|
-
case
|
|
789
|
-
return { emoji:
|
|
790
|
-
case
|
|
791
|
-
return { emoji:
|
|
827
|
+
case 'Excellent' /* Excellent */:
|
|
828
|
+
return { emoji: '\u2705', color: 'green' };
|
|
829
|
+
case 'Good' /* Good */:
|
|
830
|
+
return { emoji: '\u{1F44D}', color: 'blue' };
|
|
831
|
+
case 'Fair' /* Fair */:
|
|
832
|
+
return { emoji: '\u26A0\uFE0F', color: 'yellow' };
|
|
833
|
+
case 'Needs Work' /* NeedsWork */:
|
|
834
|
+
return { emoji: '\u{1F528}', color: 'orange' };
|
|
835
|
+
case 'Critical' /* Critical */:
|
|
836
|
+
return { emoji: '\u274C', color: 'red' };
|
|
792
837
|
default:
|
|
793
|
-
return { emoji:
|
|
838
|
+
return { emoji: '\u2753', color: 'gray' };
|
|
794
839
|
}
|
|
795
840
|
}
|
|
796
841
|
function formatScore(result) {
|
|
@@ -805,22 +850,22 @@ function formatToolScore(output) {
|
|
|
805
850
|
result += ` Factors:
|
|
806
851
|
`;
|
|
807
852
|
output.factors.forEach((factor) => {
|
|
808
|
-
const impactSign = factor.impact > 0 ?
|
|
853
|
+
const impactSign = factor.impact > 0 ? '+' : '';
|
|
809
854
|
result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
|
|
810
855
|
`;
|
|
811
856
|
});
|
|
812
|
-
result +=
|
|
857
|
+
result += '\n';
|
|
813
858
|
}
|
|
814
859
|
if (output.recommendations && output.recommendations.length > 0) {
|
|
815
860
|
result += ` Recommendations:
|
|
816
861
|
`;
|
|
817
862
|
output.recommendations.forEach((rec, i) => {
|
|
818
|
-
let priorityIcon =
|
|
863
|
+
let priorityIcon = '\u{1F535}';
|
|
819
864
|
const prio = rec.priority;
|
|
820
|
-
if (prio ===
|
|
821
|
-
priorityIcon =
|
|
822
|
-
else if (prio ===
|
|
823
|
-
priorityIcon =
|
|
865
|
+
if (prio === 'high' /* High */ || prio === 'high')
|
|
866
|
+
priorityIcon = '\u{1F534}';
|
|
867
|
+
else if (prio === 'medium' /* Medium */ || prio === 'medium')
|
|
868
|
+
priorityIcon = '\u{1F7E1}';
|
|
824
869
|
result += ` ${i + 1}. ${priorityIcon} ${rec.action}
|
|
825
870
|
`;
|
|
826
871
|
result += ` Impact: +${rec.estimatedImpact} points
|
|
@@ -884,5 +929,5 @@ export {
|
|
|
884
929
|
getRatingWithContext,
|
|
885
930
|
getRatingDisplay,
|
|
886
931
|
formatScore,
|
|
887
|
-
formatToolScore
|
|
932
|
+
formatToolScore,
|
|
888
933
|
};
|