@aiready/core 0.24.19 → 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 +385 -340
- 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 +146 -91
- 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.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 +998 -695
- package/dist/index-slasaNzr.d.ts +998 -695
- package/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +35 -2
- package/dist/index.mjs +41 -9
- 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 -7
- 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 +11 -10
package/dist/chunk-3NEZ5M7Y.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 (team@getaiready.dev)
|
|
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,110 +603,110 @@ 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
|
-
[
|
|
600
|
-
[
|
|
601
|
-
[
|
|
602
|
-
[
|
|
603
|
-
[
|
|
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,
|
|
631
|
+
['cognitive-load' /* CognitiveLoad */]: 8,
|
|
632
|
+
['pattern-entropy' /* PatternEntropy */]: 8,
|
|
633
|
+
['concept-cohesion' /* ConceptCohesion */]: 10,
|
|
634
|
+
['semantic-distance' /* SemanticDistance */]: 10,
|
|
604
635
|
};
|
|
605
636
|
var TOOL_NAME_MAP = {
|
|
606
|
-
patterns:
|
|
607
|
-
|
|
608
|
-
context:
|
|
609
|
-
|
|
610
|
-
consistency:
|
|
611
|
-
namingconsistency:
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
grounding:
|
|
616
|
-
|
|
617
|
-
testability:
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
contract:
|
|
625
|
-
|
|
637
|
+
patterns: 'pattern-detect' /* PatternDetect */,
|
|
638
|
+
'pattern-detect': 'pattern-detect' /* PatternDetect */,
|
|
639
|
+
context: 'context-analyzer' /* ContextAnalyzer */,
|
|
640
|
+
'context-analyzer': 'context-analyzer' /* ContextAnalyzer */,
|
|
641
|
+
consistency: 'naming-consistency' /* NamingConsistency */,
|
|
642
|
+
namingconsistency: 'naming-consistency' /* NamingConsistency */,
|
|
643
|
+
'naming-consistency': 'naming-consistency' /* NamingConsistency */,
|
|
644
|
+
'ai-signal': 'ai-signal-clarity' /* AiSignalClarity */,
|
|
645
|
+
'ai-signal-clarity': 'ai-signal-clarity' /* AiSignalClarity */,
|
|
646
|
+
grounding: 'agent-grounding' /* AgentGrounding */,
|
|
647
|
+
'agent-grounding': 'agent-grounding' /* AgentGrounding */,
|
|
648
|
+
testability: 'testability-index' /* TestabilityIndex */,
|
|
649
|
+
'testability-index': 'testability-index' /* TestabilityIndex */,
|
|
650
|
+
'doc-drift': 'doc-drift' /* DocDrift */,
|
|
651
|
+
'deps-health': 'dependency-health' /* DependencyHealth */,
|
|
652
|
+
'dependency-health': 'dependency-health' /* DependencyHealth */,
|
|
653
|
+
'change-amp': 'change-amplification' /* ChangeAmplification */,
|
|
654
|
+
'change-amplification': 'change-amplification' /* ChangeAmplification */,
|
|
655
|
+
contract: 'contract-enforcement' /* ContractEnforcement */,
|
|
656
|
+
'contract-enforcement': 'contract-enforcement' /* ContractEnforcement */,
|
|
626
657
|
};
|
|
627
658
|
var ScoringProfile = /* @__PURE__ */ ((ScoringProfile2) => {
|
|
628
|
-
ScoringProfile2[
|
|
629
|
-
ScoringProfile2[
|
|
630
|
-
ScoringProfile2[
|
|
631
|
-
ScoringProfile2[
|
|
632
|
-
ScoringProfile2[
|
|
633
|
-
ScoringProfile2[
|
|
659
|
+
ScoringProfile2['Default'] = 'default';
|
|
660
|
+
ScoringProfile2['Agentic'] = 'agentic';
|
|
661
|
+
ScoringProfile2['Logic'] = 'logic';
|
|
662
|
+
ScoringProfile2['UI'] = 'ui';
|
|
663
|
+
ScoringProfile2['Cost'] = 'cost';
|
|
664
|
+
ScoringProfile2['Security'] = 'security';
|
|
634
665
|
return ScoringProfile2;
|
|
635
666
|
})(ScoringProfile || {});
|
|
636
667
|
var SCORING_PROFILES = {
|
|
637
|
-
[
|
|
638
|
-
[
|
|
639
|
-
[
|
|
640
|
-
[
|
|
641
|
-
[
|
|
642
|
-
[
|
|
643
|
-
[
|
|
644
|
-
[
|
|
668
|
+
['default' /* Default */]: DEFAULT_TOOL_WEIGHTS,
|
|
669
|
+
['agentic' /* Agentic */]: {
|
|
670
|
+
['ai-signal-clarity' /* AiSignalClarity */]: 25,
|
|
671
|
+
['agent-grounding' /* AgentGrounding */]: 25,
|
|
672
|
+
['testability-index' /* TestabilityIndex */]: 15,
|
|
673
|
+
['contract-enforcement' /* ContractEnforcement */]: 15,
|
|
674
|
+
['context-analyzer' /* ContextAnalyzer */]: 10,
|
|
675
|
+
['naming-consistency' /* NamingConsistency */]: 10,
|
|
645
676
|
},
|
|
646
|
-
[
|
|
647
|
-
[
|
|
648
|
-
[
|
|
649
|
-
[
|
|
650
|
-
[
|
|
651
|
-
[
|
|
677
|
+
['logic' /* Logic */]: {
|
|
678
|
+
['testability-index' /* TestabilityIndex */]: 40,
|
|
679
|
+
['naming-consistency' /* NamingConsistency */]: 20,
|
|
680
|
+
['context-analyzer' /* ContextAnalyzer */]: 20,
|
|
681
|
+
['pattern-detect' /* PatternDetect */]: 10,
|
|
682
|
+
['change-amplification' /* ChangeAmplification */]: 10,
|
|
652
683
|
},
|
|
653
|
-
[
|
|
654
|
-
[
|
|
655
|
-
[
|
|
656
|
-
[
|
|
657
|
-
[
|
|
658
|
-
[
|
|
684
|
+
['ui' /* UI */]: {
|
|
685
|
+
['naming-consistency' /* NamingConsistency */]: 30,
|
|
686
|
+
['context-analyzer' /* ContextAnalyzer */]: 30,
|
|
687
|
+
['pattern-detect' /* PatternDetect */]: 20,
|
|
688
|
+
['doc-drift' /* DocDrift */]: 10,
|
|
689
|
+
['ai-signal-clarity' /* AiSignalClarity */]: 10,
|
|
659
690
|
},
|
|
660
|
-
[
|
|
661
|
-
[
|
|
662
|
-
[
|
|
663
|
-
[
|
|
664
|
-
[
|
|
691
|
+
['cost' /* Cost */]: {
|
|
692
|
+
['pattern-detect' /* PatternDetect */]: 50,
|
|
693
|
+
['context-analyzer' /* ContextAnalyzer */]: 30,
|
|
694
|
+
['change-amplification' /* ChangeAmplification */]: 10,
|
|
695
|
+
['dependency-health' /* DependencyHealth */]: 10,
|
|
696
|
+
},
|
|
697
|
+
['security' /* Security */]: {
|
|
698
|
+
['naming-consistency' /* NamingConsistency */]: 30,
|
|
699
|
+
['testability-index' /* TestabilityIndex */]: 25,
|
|
700
|
+
['contract-enforcement' /* ContractEnforcement */]: 15,
|
|
701
|
+
['dependency-health' /* DependencyHealth */]: 20,
|
|
702
|
+
['context-analyzer' /* ContextAnalyzer */]: 10,
|
|
665
703
|
},
|
|
666
|
-
["security" /* Security */]: {
|
|
667
|
-
["naming-consistency" /* NamingConsistency */]: 30,
|
|
668
|
-
["testability-index" /* TestabilityIndex */]: 25,
|
|
669
|
-
["contract-enforcement" /* ContractEnforcement */]: 15,
|
|
670
|
-
["dependency-health" /* DependencyHealth */]: 20,
|
|
671
|
-
["context-analyzer" /* ContextAnalyzer */]: 10
|
|
672
|
-
}
|
|
673
704
|
};
|
|
674
705
|
var CONTEXT_TIER_THRESHOLDS = {
|
|
675
706
|
compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
|
|
676
707
|
standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
|
|
677
708
|
extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
|
|
678
|
-
frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
|
|
709
|
+
frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 },
|
|
679
710
|
};
|
|
680
711
|
var SIZE_ADJUSTED_THRESHOLDS = {
|
|
681
712
|
xs: SCORING_CONSTANTS.THRESHOLDS.XS,
|
|
@@ -686,30 +717,40 @@ var SIZE_ADJUSTED_THRESHOLDS = {
|
|
|
686
717
|
// 200-500 files
|
|
687
718
|
large: SCORING_CONSTANTS.THRESHOLDS.LARGE,
|
|
688
719
|
// 500-2000 files
|
|
689
|
-
enterprise: SCORING_CONSTANTS.THRESHOLDS.ENTERPRISE
|
|
720
|
+
enterprise: SCORING_CONSTANTS.THRESHOLDS.ENTERPRISE,
|
|
690
721
|
// 2000+ files
|
|
691
722
|
};
|
|
692
723
|
function getProjectSizeTier(fileCount) {
|
|
693
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.XS) return
|
|
694
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.SMALL) return
|
|
695
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.MEDIUM) return
|
|
696
|
-
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.LARGE) return
|
|
697
|
-
return
|
|
724
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.XS) return 'xs';
|
|
725
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.SMALL) return 'small';
|
|
726
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.MEDIUM) return 'medium';
|
|
727
|
+
if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.LARGE) return 'large';
|
|
728
|
+
return 'enterprise';
|
|
698
729
|
}
|
|
699
|
-
function getRecommendedThreshold(fileCount, modelTier =
|
|
730
|
+
function getRecommendedThreshold(fileCount, modelTier = 'standard') {
|
|
700
731
|
const sizeTier = getProjectSizeTier(fileCount);
|
|
701
732
|
const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
|
|
702
|
-
const modelBonus =
|
|
733
|
+
const modelBonus =
|
|
734
|
+
modelTier === 'frontier' ? -3 : modelTier === 'extended' ? -2 : 0;
|
|
703
735
|
return base + modelBonus;
|
|
704
736
|
}
|
|
705
737
|
function normalizeToolName(shortName) {
|
|
706
738
|
return TOOL_NAME_MAP[shortName.toLowerCase()] ?? shortName;
|
|
707
739
|
}
|
|
708
|
-
function getToolWeight(
|
|
740
|
+
function getToolWeight(
|
|
741
|
+
toolName,
|
|
742
|
+
toolConfig,
|
|
743
|
+
cliOverride,
|
|
744
|
+
profile = 'default' /* Default */
|
|
745
|
+
) {
|
|
709
746
|
if (cliOverride !== void 0) return cliOverride;
|
|
710
747
|
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
711
748
|
const profileWeights = SCORING_PROFILES[profile] ?? DEFAULT_TOOL_WEIGHTS;
|
|
712
|
-
return
|
|
749
|
+
return (
|
|
750
|
+
profileWeights[toolName] ??
|
|
751
|
+
DEFAULT_TOOL_WEIGHTS[toolName] ??
|
|
752
|
+
SCORING_CONSTANTS.WEIGHTS.DEFAULT
|
|
753
|
+
);
|
|
713
754
|
}
|
|
714
755
|
function parseWeightString(weightStr) {
|
|
715
756
|
const weights = /* @__PURE__ */ new Map();
|
|
@@ -731,14 +772,17 @@ function parseWeightString(weightStr) {
|
|
|
731
772
|
}
|
|
732
773
|
function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
733
774
|
if (toolOutputs.size === 0) {
|
|
734
|
-
throw new Error(
|
|
775
|
+
throw new Error('No tool outputs provided for scoring');
|
|
735
776
|
}
|
|
736
|
-
const profile = config?.profile ||
|
|
777
|
+
const profile = config?.profile || 'default'; /* Default */
|
|
737
778
|
const weights = /* @__PURE__ */ new Map();
|
|
738
779
|
for (const [toolName] of toolOutputs.entries()) {
|
|
739
780
|
const cliWeight = cliWeights?.get(toolName);
|
|
740
781
|
const configWeight = config?.tools?.[toolName]?.scoreWeight;
|
|
741
|
-
const weight =
|
|
782
|
+
const weight =
|
|
783
|
+
cliWeight ??
|
|
784
|
+
configWeight ??
|
|
785
|
+
getToolWeight(toolName, void 0, void 0, profile);
|
|
742
786
|
weights.set(toolName, weight);
|
|
743
787
|
}
|
|
744
788
|
let weightedSum = 0;
|
|
@@ -766,35 +810,36 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
766
810
|
return {
|
|
767
811
|
overall,
|
|
768
812
|
rating,
|
|
769
|
-
timestamp:
|
|
813
|
+
timestamp: /* @__PURE__ */ new Date().toISOString(),
|
|
770
814
|
toolsUsed,
|
|
771
815
|
breakdown,
|
|
772
816
|
calculation: {
|
|
773
817
|
formula: formulaStr,
|
|
774
818
|
weights: calculationWeights,
|
|
775
|
-
normalized: formulaStr
|
|
776
|
-
}
|
|
819
|
+
normalized: formulaStr,
|
|
820
|
+
},
|
|
777
821
|
};
|
|
778
822
|
}
|
|
779
|
-
function getRatingWithContext(score, fileCount, modelTier =
|
|
823
|
+
function getRatingWithContext(score, fileCount, modelTier = 'standard') {
|
|
780
824
|
const threshold = getRecommendedThreshold(fileCount, modelTier);
|
|
781
|
-
const normalized =
|
|
825
|
+
const normalized =
|
|
826
|
+
score - threshold + SCORING_CONSTANTS.THRESHOLDS.NORMALIZATION_OFFSET;
|
|
782
827
|
return getRating(normalized);
|
|
783
828
|
}
|
|
784
829
|
function getRatingDisplay(rating) {
|
|
785
830
|
switch (rating) {
|
|
786
|
-
case
|
|
787
|
-
return { emoji:
|
|
788
|
-
case
|
|
789
|
-
return { emoji:
|
|
790
|
-
case
|
|
791
|
-
return { emoji:
|
|
792
|
-
case
|
|
793
|
-
return { emoji:
|
|
794
|
-
case
|
|
795
|
-
return { emoji:
|
|
831
|
+
case 'Excellent' /* Excellent */:
|
|
832
|
+
return { emoji: '\u2705', color: 'green' };
|
|
833
|
+
case 'Good' /* Good */:
|
|
834
|
+
return { emoji: '\u{1F44D}', color: 'blue' };
|
|
835
|
+
case 'Fair' /* Fair */:
|
|
836
|
+
return { emoji: '\u26A0\uFE0F', color: 'yellow' };
|
|
837
|
+
case 'Needs Work' /* NeedsWork */:
|
|
838
|
+
return { emoji: '\u{1F528}', color: 'orange' };
|
|
839
|
+
case 'Critical' /* Critical */:
|
|
840
|
+
return { emoji: '\u274C', color: 'red' };
|
|
796
841
|
default:
|
|
797
|
-
return { emoji:
|
|
842
|
+
return { emoji: '\u2753', color: 'gray' };
|
|
798
843
|
}
|
|
799
844
|
}
|
|
800
845
|
function formatScore(result) {
|
|
@@ -809,22 +854,22 @@ function formatToolScore(output) {
|
|
|
809
854
|
result += ` Factors:
|
|
810
855
|
`;
|
|
811
856
|
output.factors.forEach((factor) => {
|
|
812
|
-
const impactSign = factor.impact > 0 ?
|
|
857
|
+
const impactSign = factor.impact > 0 ? '+' : '';
|
|
813
858
|
result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
|
|
814
859
|
`;
|
|
815
860
|
});
|
|
816
|
-
result +=
|
|
861
|
+
result += '\n';
|
|
817
862
|
}
|
|
818
863
|
if (output.recommendations && output.recommendations.length > 0) {
|
|
819
864
|
result += ` Recommendations:
|
|
820
865
|
`;
|
|
821
866
|
output.recommendations.forEach((rec, i) => {
|
|
822
|
-
let priorityIcon =
|
|
867
|
+
let priorityIcon = '\u{1F535}';
|
|
823
868
|
const prio = rec.priority;
|
|
824
|
-
if (prio ===
|
|
825
|
-
priorityIcon =
|
|
826
|
-
else if (prio ===
|
|
827
|
-
priorityIcon =
|
|
869
|
+
if (prio === 'high' /* High */ || prio === 'high')
|
|
870
|
+
priorityIcon = '\u{1F534}';
|
|
871
|
+
else if (prio === 'medium' /* Medium */ || prio === 'medium')
|
|
872
|
+
priorityIcon = '\u{1F7E1}';
|
|
828
873
|
result += ` ${i + 1}. ${priorityIcon} ${rec.action}
|
|
829
874
|
`;
|
|
830
875
|
result += ` Impact: +${rec.estimatedImpact} points
|
|
@@ -888,5 +933,5 @@ export {
|
|
|
888
933
|
getRatingWithContext,
|
|
889
934
|
getRatingDisplay,
|
|
890
935
|
formatScore,
|
|
891
|
-
formatToolScore
|
|
936
|
+
formatToolScore,
|
|
892
937
|
};
|