@aiready/core 0.23.1 → 0.23.3

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.
Files changed (79) hide show
  1. package/dist/__tests__/parser-factory.test.d.ts +1 -1
  2. package/dist/__tests__/parser-factory.test.js +62 -50
  3. package/dist/__tests__/python-parser.test.d.ts +1 -1
  4. package/dist/__tests__/python-parser.test.js +111 -109
  5. package/dist/__tests__/scoring.test.d.ts +1 -1
  6. package/dist/__tests__/scoring.test.js +193 -176
  7. package/dist/chunk-3YI4IS3D.mjs +191 -173
  8. package/dist/chunk-5HIXDC3X.mjs +273 -251
  9. package/dist/chunk-5V3L53AE.mjs +805 -0
  10. package/dist/chunk-CKVKHN3G.mjs +228 -211
  11. package/dist/chunk-COHIBX3Q.mjs +213 -195
  12. package/dist/chunk-CWRCDSKZ.mjs +91 -82
  13. package/dist/chunk-D3D3NCRR.mjs +147 -129
  14. package/dist/chunk-HCFYP7UD.mjs +805 -0
  15. package/dist/chunk-HFLFBA6F.mjs +79 -72
  16. package/dist/chunk-HKSARRCD.mjs +66 -58
  17. package/dist/chunk-JJ5JL5FX.mjs +91 -82
  18. package/dist/chunk-KDSTXVLQ.mjs +724 -0
  19. package/dist/chunk-KI7XORTN.mjs +91 -82
  20. package/dist/chunk-LTMHFNFK.mjs +690 -0
  21. package/dist/chunk-LTNXTXRI.mjs +228 -211
  22. package/dist/chunk-M22BXHBR.mjs +805 -0
  23. package/dist/chunk-MH3A3LX6.mjs +200 -182
  24. package/dist/chunk-NGHT7JOG.mjs +697 -0
  25. package/dist/chunk-OQ6IGDXG.mjs +147 -129
  26. package/dist/chunk-QAFB3HXQ.mjs +181 -165
  27. package/dist/chunk-QQBKXHLU.mjs +678 -0
  28. package/dist/chunk-RDHYGES7.mjs +678 -0
  29. package/dist/chunk-SWTDBVYJ.mjs +228 -213
  30. package/dist/chunk-UIWL5JQB.mjs +79 -72
  31. package/dist/chunk-UQGI67WR.mjs +79 -72
  32. package/dist/chunk-UTZOO4XO.mjs +147 -131
  33. package/dist/chunk-X4F46I5L.mjs +213 -195
  34. package/dist/chunk-XKK7YHPX.mjs +204 -186
  35. package/dist/chunk-YCA4FTEK.mjs +190 -172
  36. package/dist/chunk-ZSZRRTJM.mjs +719 -0
  37. package/dist/client-BgmiMoil.d.mts +1344 -0
  38. package/dist/client-BgmiMoil.d.ts +1344 -0
  39. package/dist/client-BxGrPuuN.d.mts +1191 -0
  40. package/dist/client-BxGrPuuN.d.ts +1191 -0
  41. package/dist/client-D-cn9ydj.d.mts +1136 -0
  42. package/dist/client-D-cn9ydj.d.ts +1136 -0
  43. package/dist/client-D9seCH4K.d.mts +1334 -0
  44. package/dist/client-D9seCH4K.d.ts +1334 -0
  45. package/dist/client-DIXIh7rw.d.mts +1193 -0
  46. package/dist/client-DIXIh7rw.d.ts +1193 -0
  47. package/dist/client-DVHXWOHw.d.mts +1245 -0
  48. package/dist/client-DVHXWOHw.d.ts +1245 -0
  49. package/dist/client.d.mts +2 -1094
  50. package/dist/client.d.ts +2 -1094
  51. package/dist/client.js +23 -43
  52. package/dist/client.mjs +3 -25
  53. package/dist/index.d.mts +380 -108
  54. package/dist/index.d.ts +380 -108
  55. package/dist/index.js +609 -445
  56. package/dist/index.mjs +587 -429
  57. package/dist/parsers/parser-factory.d.ts +45 -45
  58. package/dist/parsers/parser-factory.js +86 -84
  59. package/dist/parsers/python-parser.d.ts +33 -28
  60. package/dist/parsers/python-parser.js +224 -222
  61. package/dist/parsers/typescript-parser.d.ts +15 -10
  62. package/dist/parsers/typescript-parser.js +223 -197
  63. package/dist/scoring.d.ts +59 -49
  64. package/dist/scoring.js +129 -127
  65. package/dist/types/language.d.ts +104 -93
  66. package/dist/types/language.js +23 -23
  67. package/dist/types.d.ts +105 -87
  68. package/dist/types.js +1 -1
  69. package/dist/utils/ast-parser.d.ts +42 -33
  70. package/dist/utils/ast-parser.js +159 -162
  71. package/dist/utils/cli-helpers.d.ts +27 -10
  72. package/dist/utils/cli-helpers.js +45 -43
  73. package/dist/utils/config.d.ts +8 -3
  74. package/dist/utils/config.js +67 -69
  75. package/dist/utils/file-scanner.d.ts +1 -1
  76. package/dist/utils/file-scanner.js +80 -76
  77. package/dist/utils/metrics.d.ts +1 -1
  78. package/dist/utils/metrics.js +2 -2
  79. package/package.json +2 -2
@@ -1,79 +1,79 @@
1
1
  // src/types/schema.ts
2
- import { z } from "zod";
2
+ import { z } from 'zod';
3
3
  var Severity = /* @__PURE__ */ ((Severity2) => {
4
- Severity2["Critical"] = "critical";
5
- Severity2["Major"] = "major";
6
- Severity2["Minor"] = "minor";
7
- Severity2["Info"] = "info";
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["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";
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
25
  return ToolName2;
26
26
  })(ToolName || {});
27
27
  var ToolNameSchema = z.nativeEnum(ToolName);
28
28
  var FRIENDLY_TOOL_NAMES = {
29
- ["pattern-detect" /* PatternDetect */]: "Semantic Duplicates",
30
- ["context-analyzer" /* ContextAnalyzer */]: "Context Fragmentation",
31
- ["naming-consistency" /* NamingConsistency */]: "Naming Consistency",
32
- ["ai-signal-clarity" /* AiSignalClarity */]: "AI Signal Clarity",
33
- ["agent-grounding" /* AgentGrounding */]: "Agent Grounding",
34
- ["testability-index" /* TestabilityIndex */]: "Testability Index",
35
- ["doc-drift" /* DocDrift */]: "Documentation Health",
36
- ["dependency-health" /* DependencyHealth */]: "Dependency Health",
37
- ["change-amplification" /* ChangeAmplification */]: "Change Amplification",
38
- ["cognitive-load" /* CognitiveLoad */]: "Cognitive Load",
39
- ["pattern-entropy" /* PatternEntropy */]: "Pattern Entropy",
40
- ["concept-cohesion" /* ConceptCohesion */]: "Concept Cohesion",
41
- ["semantic-distance" /* SemanticDistance */]: "Semantic Distance"
29
+ ['pattern-detect' /* PatternDetect */]: 'Semantic Duplicates',
30
+ ['context-analyzer' /* ContextAnalyzer */]: 'Context Fragmentation',
31
+ ['naming-consistency' /* NamingConsistency */]: 'Naming Consistency',
32
+ ['ai-signal-clarity' /* AiSignalClarity */]: 'AI Signal Clarity',
33
+ ['agent-grounding' /* AgentGrounding */]: 'Agent Grounding',
34
+ ['testability-index' /* TestabilityIndex */]: 'Testability Index',
35
+ ['doc-drift' /* DocDrift */]: 'Documentation Health',
36
+ ['dependency-health' /* DependencyHealth */]: 'Dependency Health',
37
+ ['change-amplification' /* ChangeAmplification */]: 'Change Amplification',
38
+ ['cognitive-load' /* CognitiveLoad */]: 'Cognitive Load',
39
+ ['pattern-entropy' /* PatternEntropy */]: 'Pattern Entropy',
40
+ ['concept-cohesion' /* ConceptCohesion */]: 'Concept Cohesion',
41
+ ['semantic-distance' /* SemanticDistance */]: 'Semantic Distance',
42
42
  };
43
43
  var IssueType = /* @__PURE__ */ ((IssueType2) => {
44
- IssueType2["DuplicatePattern"] = "duplicate-pattern";
45
- IssueType2["PatternInconsistency"] = "pattern-inconsistency";
46
- IssueType2["ContextFragmentation"] = "context-fragmentation";
47
- IssueType2["DependencyHealth"] = "dependency-health";
48
- IssueType2["CircularDependency"] = "circular-dependency";
49
- IssueType2["DocDrift"] = "doc-drift";
50
- IssueType2["NamingInconsistency"] = "naming-inconsistency";
51
- IssueType2["NamingQuality"] = "naming-quality";
52
- IssueType2["ArchitectureInconsistency"] = "architecture-inconsistency";
53
- IssueType2["DeadCode"] = "dead-code";
54
- IssueType2["MissingTypes"] = "missing-types";
55
- IssueType2["MagicLiteral"] = "magic-literal";
56
- IssueType2["BooleanTrap"] = "boolean-trap";
57
- IssueType2["AiSignalClarity"] = "ai-signal-clarity";
58
- IssueType2["LowTestability"] = "low-testability";
59
- IssueType2["AgentNavigationFailure"] = "agent-navigation-failure";
60
- IssueType2["AmbiguousApi"] = "ambiguous-api";
61
- IssueType2["ChangeAmplification"] = "change-amplification";
44
+ IssueType2['DuplicatePattern'] = 'duplicate-pattern';
45
+ IssueType2['PatternInconsistency'] = 'pattern-inconsistency';
46
+ IssueType2['ContextFragmentation'] = 'context-fragmentation';
47
+ IssueType2['DependencyHealth'] = 'dependency-health';
48
+ IssueType2['CircularDependency'] = 'circular-dependency';
49
+ IssueType2['DocDrift'] = 'doc-drift';
50
+ IssueType2['NamingInconsistency'] = 'naming-inconsistency';
51
+ IssueType2['NamingQuality'] = 'naming-quality';
52
+ IssueType2['ArchitectureInconsistency'] = 'architecture-inconsistency';
53
+ IssueType2['DeadCode'] = 'dead-code';
54
+ IssueType2['MissingTypes'] = 'missing-types';
55
+ IssueType2['MagicLiteral'] = 'magic-literal';
56
+ IssueType2['BooleanTrap'] = 'boolean-trap';
57
+ IssueType2['AiSignalClarity'] = 'ai-signal-clarity';
58
+ IssueType2['LowTestability'] = 'low-testability';
59
+ IssueType2['AgentNavigationFailure'] = 'agent-navigation-failure';
60
+ IssueType2['AmbiguousApi'] = 'ambiguous-api';
61
+ IssueType2['ChangeAmplification'] = 'change-amplification';
62
62
  return IssueType2;
63
63
  })(IssueType || {});
64
64
  var IssueTypeSchema = z.nativeEnum(IssueType);
65
65
  var AnalysisStatus = /* @__PURE__ */ ((AnalysisStatus2) => {
66
- AnalysisStatus2["Processing"] = "processing";
67
- AnalysisStatus2["Completed"] = "completed";
68
- AnalysisStatus2["Failed"] = "failed";
66
+ AnalysisStatus2['Processing'] = 'processing';
67
+ AnalysisStatus2['Completed'] = 'completed';
68
+ AnalysisStatus2['Failed'] = 'failed';
69
69
  return AnalysisStatus2;
70
70
  })(AnalysisStatus || {});
71
71
  var AnalysisStatusSchema = z.nativeEnum(AnalysisStatus);
72
72
  var ModelTier = /* @__PURE__ */ ((ModelTier2) => {
73
- ModelTier2["Compact"] = "compact";
74
- ModelTier2["Standard"] = "standard";
75
- ModelTier2["Extended"] = "extended";
76
- ModelTier2["Frontier"] = "frontier";
73
+ ModelTier2['Compact'] = 'compact';
74
+ ModelTier2['Standard'] = 'standard';
75
+ ModelTier2['Extended'] = 'extended';
76
+ ModelTier2['Frontier'] = 'frontier';
77
77
  return ModelTier2;
78
78
  })(ModelTier || {});
79
79
  var ModelTierSchema = z.nativeEnum(ModelTier);
@@ -82,14 +82,14 @@ var LocationSchema = z.object({
82
82
  line: z.number(),
83
83
  column: z.number().optional(),
84
84
  endLine: z.number().optional(),
85
- endColumn: z.number().optional()
85
+ endColumn: z.number().optional(),
86
86
  });
87
87
  var IssueSchema = z.object({
88
88
  type: IssueTypeSchema,
89
89
  severity: SeveritySchema,
90
90
  message: z.string(),
91
91
  location: LocationSchema,
92
- suggestion: z.string().optional()
92
+ suggestion: z.string().optional(),
93
93
  });
94
94
  var MetricsSchema = z.object({
95
95
  tokenCost: z.number().optional(),
@@ -109,213 +109,226 @@ var MetricsSchema = z.object({
109
109
  comprehensionDifficultyIndex: z.number().optional(),
110
110
  // Extended metrics for specific spokes
111
111
  totalSymbols: z.number().optional(),
112
- totalExports: z.number().optional()
112
+ totalExports: z.number().optional(),
113
113
  });
114
114
  var AnalysisResultSchema = z.object({
115
115
  fileName: z.string(),
116
116
  issues: z.array(IssueSchema),
117
- metrics: MetricsSchema
117
+ metrics: MetricsSchema,
118
118
  });
119
- var SpokeSummarySchema = z.object({
120
- totalFiles: z.number().optional(),
121
- totalIssues: z.number().optional(),
122
- criticalIssues: z.number().optional(),
123
- majorIssues: z.number().optional(),
124
- score: z.number().optional()
125
- }).catchall(z.any());
119
+ var SpokeSummarySchema = z
120
+ .object({
121
+ totalFiles: z.number().optional(),
122
+ totalIssues: z.number().optional(),
123
+ criticalIssues: z.number().optional(),
124
+ majorIssues: z.number().optional(),
125
+ score: z.number().optional(),
126
+ })
127
+ .catchall(z.any());
126
128
  var SpokeOutputSchema = z.object({
127
129
  results: z.array(AnalysisResultSchema),
128
130
  summary: SpokeSummarySchema,
129
- metadata: z.object({
130
- toolName: z.string(),
131
- version: z.string().optional(),
132
- timestamp: z.string().optional(),
133
- config: z.any().optional()
134
- }).catchall(z.any()).optional()
131
+ metadata: z
132
+ .object({
133
+ toolName: z.string(),
134
+ version: z.string().optional(),
135
+ timestamp: z.string().optional(),
136
+ config: z.any().optional(),
137
+ })
138
+ .catchall(z.any())
139
+ .optional(),
135
140
  });
136
- var UnifiedReportSchema = z.object({
137
- summary: z.object({
138
- totalFiles: z.number(),
139
- totalIssues: z.number(),
140
- criticalIssues: z.number(),
141
- majorIssues: z.number(),
142
- businessImpact: z.object({
143
- estimatedMonthlyWaste: z.number().optional(),
144
- potentialSavings: z.number().optional(),
145
- productivityHours: z.number().optional()
146
- }).optional()
147
- }),
148
- results: z.array(AnalysisResultSchema),
149
- scoring: z.object({
150
- overall: z.number(),
151
- rating: z.string(),
152
- timestamp: z.string(),
153
- breakdown: z.array(
154
- z.object({
155
- toolName: z.union([ToolNameSchema, z.string()]),
156
- score: z.number()
157
- }).catchall(z.any())
158
- )
159
- }).optional()
160
- }).catchall(z.any());
141
+ var UnifiedReportSchema = z
142
+ .object({
143
+ summary: z.object({
144
+ totalFiles: z.number(),
145
+ totalIssues: z.number(),
146
+ criticalIssues: z.number(),
147
+ majorIssues: z.number(),
148
+ businessImpact: z
149
+ .object({
150
+ estimatedMonthlyWaste: z.number().optional(),
151
+ potentialSavings: z.number().optional(),
152
+ productivityHours: z.number().optional(),
153
+ })
154
+ .optional(),
155
+ }),
156
+ results: z.array(AnalysisResultSchema),
157
+ scoring: z
158
+ .object({
159
+ overall: z.number(),
160
+ rating: z.string(),
161
+ timestamp: z.string(),
162
+ breakdown: z.array(
163
+ z
164
+ .object({
165
+ toolName: z.union([ToolNameSchema, z.string()]),
166
+ score: z.number(),
167
+ })
168
+ .catchall(z.any())
169
+ ),
170
+ })
171
+ .optional(),
172
+ })
173
+ .catchall(z.any());
161
174
 
162
175
  // src/types.ts
163
176
  var GLOBAL_INFRA_OPTIONS = [
164
- "rootDir",
177
+ 'rootDir',
165
178
  // Essential for every tool
166
- "include",
167
- "exclude",
168
- "onProgress",
169
- "progressCallback",
170
- "includeTests",
171
- "useSmartDefaults",
172
- "streamResults",
173
- "batchSize",
174
- "costConfig",
175
- "tools",
176
- "toolConfigs"
179
+ 'include',
180
+ 'exclude',
181
+ 'onProgress',
182
+ 'progressCallback',
183
+ 'includeTests',
184
+ 'useSmartDefaults',
185
+ 'streamResults',
186
+ 'batchSize',
187
+ 'costConfig',
188
+ 'tools',
189
+ 'toolConfigs',
177
190
  ];
178
191
  var COMMON_FINE_TUNING_OPTIONS = [
179
- "maxDepth",
180
- "minSimilarity",
181
- "minLines",
182
- "minCohesion",
192
+ 'maxDepth',
193
+ 'minSimilarity',
194
+ 'minLines',
195
+ 'minCohesion',
183
196
  // AI Signal Clarity options
184
- "checkMagicLiterals",
185
- "checkBooleanTraps",
186
- "checkAmbiguousNames",
187
- "checkUndocumentedExports",
188
- "checkImplicitSideEffects",
189
- "checkDeepCallbacks"
197
+ 'checkMagicLiterals',
198
+ 'checkBooleanTraps',
199
+ 'checkAmbiguousNames',
200
+ 'checkUndocumentedExports',
201
+ 'checkImplicitSideEffects',
202
+ 'checkDeepCallbacks',
190
203
  ];
191
204
  var GLOBAL_SCAN_OPTIONS = [...GLOBAL_INFRA_OPTIONS];
192
205
 
193
206
  // src/types/language.ts
194
207
  var Language = /* @__PURE__ */ ((Language2) => {
195
- Language2["TypeScript"] = "typescript";
196
- Language2["JavaScript"] = "javascript";
197
- Language2["Python"] = "python";
198
- Language2["Java"] = "java";
199
- Language2["Go"] = "go";
200
- Language2["Rust"] = "rust";
201
- Language2["CSharp"] = "csharp";
208
+ Language2['TypeScript'] = 'typescript';
209
+ Language2['JavaScript'] = 'javascript';
210
+ Language2['Python'] = 'python';
211
+ Language2['Java'] = 'java';
212
+ Language2['Go'] = 'go';
213
+ Language2['Rust'] = 'rust';
214
+ Language2['CSharp'] = 'csharp';
202
215
  return Language2;
203
216
  })(Language || {});
204
217
  var LANGUAGE_EXTENSIONS = {
205
- ".ts": "typescript" /* TypeScript */,
206
- ".tsx": "typescript" /* TypeScript */,
207
- ".js": "javascript" /* JavaScript */,
208
- ".jsx": "javascript" /* JavaScript */,
209
- ".py": "python" /* Python */,
210
- ".java": "java" /* Java */,
211
- ".go": "go" /* Go */,
212
- ".rs": "rust" /* Rust */,
213
- ".cs": "csharp" /* CSharp */
218
+ '.ts': 'typescript' /* TypeScript */,
219
+ '.tsx': 'typescript' /* TypeScript */,
220
+ '.js': 'javascript' /* JavaScript */,
221
+ '.jsx': 'javascript' /* JavaScript */,
222
+ '.py': 'python' /* Python */,
223
+ '.java': 'java' /* Java */,
224
+ '.go': 'go' /* Go */,
225
+ '.rs': 'rust' /* Rust */,
226
+ '.cs': 'csharp' /* CSharp */,
214
227
  };
215
228
  var ParseError = class extends Error {
216
229
  constructor(message, filePath, loc) {
217
230
  super(message);
218
231
  this.filePath = filePath;
219
232
  this.loc = loc;
220
- this.name = "ParseError";
233
+ this.name = 'ParseError';
221
234
  }
222
235
  };
223
236
 
224
237
  // src/scoring.ts
225
238
  var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
226
- RecommendationPriority2["High"] = "high";
227
- RecommendationPriority2["Medium"] = "medium";
228
- RecommendationPriority2["Low"] = "low";
239
+ RecommendationPriority2['High'] = 'high';
240
+ RecommendationPriority2['Medium'] = 'medium';
241
+ RecommendationPriority2['Low'] = 'low';
229
242
  return RecommendationPriority2;
230
243
  })(RecommendationPriority || {});
231
244
  var ReadinessRating = /* @__PURE__ */ ((ReadinessRating2) => {
232
- ReadinessRating2["Excellent"] = "Excellent";
233
- ReadinessRating2["Good"] = "Good";
234
- ReadinessRating2["Fair"] = "Fair";
235
- ReadinessRating2["NeedsWork"] = "Needs Work";
236
- ReadinessRating2["Critical"] = "Critical";
245
+ ReadinessRating2['Excellent'] = 'Excellent';
246
+ ReadinessRating2['Good'] = 'Good';
247
+ ReadinessRating2['Fair'] = 'Fair';
248
+ ReadinessRating2['NeedsWork'] = 'Needs Work';
249
+ ReadinessRating2['Critical'] = 'Critical';
237
250
  return ReadinessRating2;
238
251
  })(ReadinessRating || {});
239
252
  var DEFAULT_TOOL_WEIGHTS = {
240
- ["pattern-detect" /* PatternDetect */]: 22,
241
- ["context-analyzer" /* ContextAnalyzer */]: 19,
242
- ["naming-consistency" /* NamingConsistency */]: 14,
243
- ["ai-signal-clarity" /* AiSignalClarity */]: 11,
244
- ["agent-grounding" /* AgentGrounding */]: 10,
245
- ["testability-index" /* TestabilityIndex */]: 10,
246
- ["doc-drift" /* DocDrift */]: 8,
247
- ["dependency-health" /* DependencyHealth */]: 6,
248
- ["change-amplification" /* ChangeAmplification */]: 8
253
+ ['pattern-detect' /* PatternDetect */]: 22,
254
+ ['context-analyzer' /* ContextAnalyzer */]: 19,
255
+ ['naming-consistency' /* NamingConsistency */]: 14,
256
+ ['ai-signal-clarity' /* AiSignalClarity */]: 11,
257
+ ['agent-grounding' /* AgentGrounding */]: 10,
258
+ ['testability-index' /* TestabilityIndex */]: 10,
259
+ ['doc-drift' /* DocDrift */]: 8,
260
+ ['dependency-health' /* DependencyHealth */]: 6,
261
+ ['change-amplification' /* ChangeAmplification */]: 8,
249
262
  };
250
263
  var TOOL_NAME_MAP = {
251
- patterns: "pattern-detect" /* PatternDetect */,
252
- "pattern-detect": "pattern-detect" /* PatternDetect */,
253
- context: "context-analyzer" /* ContextAnalyzer */,
254
- "context-analyzer": "context-analyzer" /* ContextAnalyzer */,
255
- consistency: "naming-consistency" /* NamingConsistency */,
256
- "naming-consistency": "naming-consistency" /* NamingConsistency */,
257
- "ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
258
- "ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
259
- grounding: "agent-grounding" /* AgentGrounding */,
260
- "agent-grounding": "agent-grounding" /* AgentGrounding */,
261
- testability: "testability-index" /* TestabilityIndex */,
262
- "testability-index": "testability-index" /* TestabilityIndex */,
263
- "doc-drift": "doc-drift" /* DocDrift */,
264
- "deps-health": "dependency-health" /* DependencyHealth */,
265
- "dependency-health": "dependency-health" /* DependencyHealth */,
266
- "change-amp": "change-amplification" /* ChangeAmplification */,
267
- "change-amplification": "change-amplification" /* ChangeAmplification */
264
+ patterns: 'pattern-detect' /* PatternDetect */,
265
+ 'pattern-detect': 'pattern-detect' /* PatternDetect */,
266
+ context: 'context-analyzer' /* ContextAnalyzer */,
267
+ 'context-analyzer': 'context-analyzer' /* ContextAnalyzer */,
268
+ consistency: 'naming-consistency' /* NamingConsistency */,
269
+ 'naming-consistency': 'naming-consistency' /* NamingConsistency */,
270
+ 'ai-signal': 'ai-signal-clarity' /* AiSignalClarity */,
271
+ 'ai-signal-clarity': 'ai-signal-clarity' /* AiSignalClarity */,
272
+ grounding: 'agent-grounding' /* AgentGrounding */,
273
+ 'agent-grounding': 'agent-grounding' /* AgentGrounding */,
274
+ testability: 'testability-index' /* TestabilityIndex */,
275
+ 'testability-index': 'testability-index' /* TestabilityIndex */,
276
+ 'doc-drift': 'doc-drift' /* DocDrift */,
277
+ 'deps-health': 'dependency-health' /* DependencyHealth */,
278
+ 'dependency-health': 'dependency-health' /* DependencyHealth */,
279
+ 'change-amp': 'change-amplification' /* ChangeAmplification */,
280
+ 'change-amplification': 'change-amplification' /* ChangeAmplification */,
268
281
  };
269
282
  var ScoringProfile = /* @__PURE__ */ ((ScoringProfile2) => {
270
- ScoringProfile2["Default"] = "default";
271
- ScoringProfile2["Agentic"] = "agentic";
272
- ScoringProfile2["Logic"] = "logic";
273
- ScoringProfile2["UI"] = "ui";
274
- ScoringProfile2["Cost"] = "cost";
275
- ScoringProfile2["Security"] = "security";
283
+ ScoringProfile2['Default'] = 'default';
284
+ ScoringProfile2['Agentic'] = 'agentic';
285
+ ScoringProfile2['Logic'] = 'logic';
286
+ ScoringProfile2['UI'] = 'ui';
287
+ ScoringProfile2['Cost'] = 'cost';
288
+ ScoringProfile2['Security'] = 'security';
276
289
  return ScoringProfile2;
277
290
  })(ScoringProfile || {});
278
291
  var SCORING_PROFILES = {
279
- ["default" /* Default */]: DEFAULT_TOOL_WEIGHTS,
280
- ["agentic" /* Agentic */]: {
281
- ["ai-signal-clarity" /* AiSignalClarity */]: 30,
282
- ["agent-grounding" /* AgentGrounding */]: 30,
283
- ["testability-index" /* TestabilityIndex */]: 20,
284
- ["context-analyzer" /* ContextAnalyzer */]: 10,
285
- ["naming-consistency" /* NamingConsistency */]: 10
292
+ ['default' /* Default */]: DEFAULT_TOOL_WEIGHTS,
293
+ ['agentic' /* Agentic */]: {
294
+ ['ai-signal-clarity' /* AiSignalClarity */]: 30,
295
+ ['agent-grounding' /* AgentGrounding */]: 30,
296
+ ['testability-index' /* TestabilityIndex */]: 20,
297
+ ['context-analyzer' /* ContextAnalyzer */]: 10,
298
+ ['naming-consistency' /* NamingConsistency */]: 10,
286
299
  },
287
- ["logic" /* Logic */]: {
288
- ["testability-index" /* TestabilityIndex */]: 40,
289
- ["naming-consistency" /* NamingConsistency */]: 20,
290
- ["context-analyzer" /* ContextAnalyzer */]: 20,
291
- ["pattern-detect" /* PatternDetect */]: 10,
292
- ["change-amplification" /* ChangeAmplification */]: 10
300
+ ['logic' /* Logic */]: {
301
+ ['testability-index' /* TestabilityIndex */]: 40,
302
+ ['naming-consistency' /* NamingConsistency */]: 20,
303
+ ['context-analyzer' /* ContextAnalyzer */]: 20,
304
+ ['pattern-detect' /* PatternDetect */]: 10,
305
+ ['change-amplification' /* ChangeAmplification */]: 10,
293
306
  },
294
- ["ui" /* UI */]: {
295
- ["naming-consistency" /* NamingConsistency */]: 30,
296
- ["context-analyzer" /* ContextAnalyzer */]: 30,
297
- ["pattern-detect" /* PatternDetect */]: 20,
298
- ["doc-drift" /* DocDrift */]: 10,
299
- ["ai-signal-clarity" /* AiSignalClarity */]: 10
307
+ ['ui' /* UI */]: {
308
+ ['naming-consistency' /* NamingConsistency */]: 30,
309
+ ['context-analyzer' /* ContextAnalyzer */]: 30,
310
+ ['pattern-detect' /* PatternDetect */]: 20,
311
+ ['doc-drift' /* DocDrift */]: 10,
312
+ ['ai-signal-clarity' /* AiSignalClarity */]: 10,
300
313
  },
301
- ["cost" /* Cost */]: {
302
- ["pattern-detect" /* PatternDetect */]: 50,
303
- ["context-analyzer" /* ContextAnalyzer */]: 30,
304
- ["change-amplification" /* ChangeAmplification */]: 10,
305
- ["dependency-health" /* DependencyHealth */]: 10
314
+ ['cost' /* Cost */]: {
315
+ ['pattern-detect' /* PatternDetect */]: 50,
316
+ ['context-analyzer' /* ContextAnalyzer */]: 30,
317
+ ['change-amplification' /* ChangeAmplification */]: 10,
318
+ ['dependency-health' /* DependencyHealth */]: 10,
319
+ },
320
+ ['security' /* Security */]: {
321
+ ['naming-consistency' /* NamingConsistency */]: 40,
322
+ ['testability-index' /* TestabilityIndex */]: 30,
323
+ ['dependency-health' /* DependencyHealth */]: 20,
324
+ ['context-analyzer' /* ContextAnalyzer */]: 10,
306
325
  },
307
- ["security" /* Security */]: {
308
- ["naming-consistency" /* NamingConsistency */]: 40,
309
- ["testability-index" /* TestabilityIndex */]: 30,
310
- ["dependency-health" /* DependencyHealth */]: 20,
311
- ["context-analyzer" /* ContextAnalyzer */]: 10
312
- }
313
326
  };
314
327
  var CONTEXT_TIER_THRESHOLDS = {
315
328
  compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
316
329
  standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
317
330
  extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
318
- frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
331
+ frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 },
319
332
  };
320
333
  var SIZE_ADJUSTED_THRESHOLDS = {
321
334
  xs: 80,
@@ -326,26 +339,32 @@ var SIZE_ADJUSTED_THRESHOLDS = {
326
339
  // 200-500 files
327
340
  large: 65,
328
341
  // 500-2000 files
329
- enterprise: 58
342
+ enterprise: 58,
330
343
  // 2000+ files
331
344
  };
332
345
  function getProjectSizeTier(fileCount) {
333
- if (fileCount < 50) return "xs";
334
- if (fileCount < 200) return "small";
335
- if (fileCount < 500) return "medium";
336
- if (fileCount < 2e3) return "large";
337
- return "enterprise";
346
+ if (fileCount < 50) return 'xs';
347
+ if (fileCount < 200) return 'small';
348
+ if (fileCount < 500) return 'medium';
349
+ if (fileCount < 2e3) return 'large';
350
+ return 'enterprise';
338
351
  }
339
- function getRecommendedThreshold(fileCount, modelTier = "standard") {
352
+ function getRecommendedThreshold(fileCount, modelTier = 'standard') {
340
353
  const sizeTier = getProjectSizeTier(fileCount);
341
354
  const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
342
- const modelBonus = modelTier === "frontier" ? -3 : modelTier === "extended" ? -2 : 0;
355
+ const modelBonus =
356
+ modelTier === 'frontier' ? -3 : modelTier === 'extended' ? -2 : 0;
343
357
  return base + modelBonus;
344
358
  }
345
359
  function normalizeToolName(shortName) {
346
360
  return TOOL_NAME_MAP[shortName.toLowerCase()] || shortName;
347
361
  }
348
- function getToolWeight(toolName, toolConfig, cliOverride, profile = "default" /* Default */) {
362
+ function getToolWeight(
363
+ toolName,
364
+ toolConfig,
365
+ cliOverride,
366
+ profile = 'default' /* Default */
367
+ ) {
349
368
  if (cliOverride !== void 0) return cliOverride;
350
369
  if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
351
370
  const profileWeights = SCORING_PROFILES[profile] || DEFAULT_TOOL_WEIGHTS;
@@ -354,9 +373,9 @@ function getToolWeight(toolName, toolConfig, cliOverride, profile = "default" /*
354
373
  function parseWeightString(weightStr) {
355
374
  const weights = /* @__PURE__ */ new Map();
356
375
  if (!weightStr) return weights;
357
- const pairs = weightStr.split(",");
376
+ const pairs = weightStr.split(',');
358
377
  for (const pair of pairs) {
359
- const [toolShortName, weightValueStr] = pair.split(":");
378
+ const [toolShortName, weightValueStr] = pair.split(':');
360
379
  if (toolShortName && weightValueStr) {
361
380
  const toolName = normalizeToolName(toolShortName.trim());
362
381
  const weight = parseInt(weightValueStr.trim(), 10);
@@ -369,14 +388,17 @@ function parseWeightString(weightStr) {
369
388
  }
370
389
  function calculateOverallScore(toolOutputs, config, cliWeights) {
371
390
  if (toolOutputs.size === 0) {
372
- throw new Error("No tool outputs provided for scoring");
391
+ throw new Error('No tool outputs provided for scoring');
373
392
  }
374
- const profile = config?.scoring?.profile || "default" /* Default */;
393
+ const profile = config?.scoring?.profile || 'default'; /* Default */
375
394
  const weights = /* @__PURE__ */ new Map();
376
395
  for (const [toolName] of toolOutputs.entries()) {
377
396
  const cliWeight = cliWeights?.get(toolName);
378
397
  const configWeight = config?.tools?.[toolName]?.scoreWeight;
379
- const weight = cliWeight ?? configWeight ?? getToolWeight(toolName, void 0, void 0, profile);
398
+ const weight =
399
+ cliWeight ??
400
+ configWeight ??
401
+ getToolWeight(toolName, void 0, void 0, profile);
380
402
  weights.set(toolName, weight);
381
403
  }
382
404
  let weightedSum = 0;
@@ -400,46 +422,46 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
400
422
  return `(${output.score} \xD7 ${w})`;
401
423
  }
402
424
  );
403
- const formulaStr = `[${formulaParts.join(" + ")}] / ${totalWeight} = ${overall}`;
425
+ const formulaStr = `[${formulaParts.join(' + ')}] / ${totalWeight} = ${overall}`;
404
426
  return {
405
427
  overall,
406
428
  rating,
407
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
429
+ timestamp: /* @__PURE__ */ new Date().toISOString(),
408
430
  toolsUsed,
409
431
  breakdown,
410
432
  calculation: {
411
433
  formula: formulaStr,
412
434
  weights: calculationWeights,
413
- normalized: formulaStr
414
- }
435
+ normalized: formulaStr,
436
+ },
415
437
  };
416
438
  }
417
439
  function getRating(score) {
418
- if (score >= 90) return "Excellent" /* Excellent */;
419
- if (score >= 75) return "Good" /* Good */;
420
- if (score >= 60) return "Fair" /* Fair */;
421
- if (score >= 40) return "Needs Work" /* NeedsWork */;
422
- return "Critical" /* Critical */;
440
+ if (score >= 90) return 'Excellent' /* Excellent */;
441
+ if (score >= 75) return 'Good' /* Good */;
442
+ if (score >= 60) return 'Fair' /* Fair */;
443
+ if (score >= 40) return 'Needs Work' /* NeedsWork */;
444
+ return 'Critical' /* Critical */;
423
445
  }
424
- function getRatingWithContext(score, fileCount, modelTier = "standard") {
446
+ function getRatingWithContext(score, fileCount, modelTier = 'standard') {
425
447
  const threshold = getRecommendedThreshold(fileCount, modelTier);
426
448
  const normalized = score - threshold + 70;
427
449
  return getRating(normalized);
428
450
  }
429
451
  function getRatingDisplay(rating) {
430
452
  switch (rating) {
431
- case "Excellent" /* Excellent */:
432
- return { emoji: "\u2705", color: "green" };
433
- case "Good" /* Good */:
434
- return { emoji: "\u{1F44D}", color: "blue" };
435
- case "Fair" /* Fair */:
436
- return { emoji: "\u26A0\uFE0F", color: "yellow" };
437
- case "Needs Work" /* NeedsWork */:
438
- return { emoji: "\u{1F528}", color: "orange" };
439
- case "Critical" /* Critical */:
440
- return { emoji: "\u274C", color: "red" };
453
+ case 'Excellent' /* Excellent */:
454
+ return { emoji: '\u2705', color: 'green' };
455
+ case 'Good' /* Good */:
456
+ return { emoji: '\u{1F44D}', color: 'blue' };
457
+ case 'Fair' /* Fair */:
458
+ return { emoji: '\u26A0\uFE0F', color: 'yellow' };
459
+ case 'Needs Work' /* NeedsWork */:
460
+ return { emoji: '\u{1F528}', color: 'orange' };
461
+ case 'Critical' /* Critical */:
462
+ return { emoji: '\u274C', color: 'red' };
441
463
  default:
442
- return { emoji: "\u2753", color: "gray" };
464
+ return { emoji: '\u2753', color: 'gray' };
443
465
  }
444
466
  }
445
467
  function formatScore(result) {
@@ -454,22 +476,22 @@ function formatToolScore(output) {
454
476
  result += ` Factors:
455
477
  `;
456
478
  output.factors.forEach((factor) => {
457
- const impactSign = factor.impact > 0 ? "+" : "";
479
+ const impactSign = factor.impact > 0 ? '+' : '';
458
480
  result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
459
481
  `;
460
482
  });
461
- result += "\n";
483
+ result += '\n';
462
484
  }
463
485
  if (output.recommendations && output.recommendations.length > 0) {
464
486
  result += ` Recommendations:
465
487
  `;
466
488
  output.recommendations.forEach((rec, i) => {
467
- let priorityIcon = "\u{1F535}";
489
+ let priorityIcon = '\u{1F535}';
468
490
  const prio = rec.priority;
469
- if (prio === "high" /* High */ || prio === "high")
470
- priorityIcon = "\u{1F534}";
471
- else if (prio === "medium" /* Medium */ || prio === "medium")
472
- priorityIcon = "\u{1F7E1}";
491
+ if (prio === 'high' /* High */ || prio === 'high')
492
+ priorityIcon = '\u{1F534}';
493
+ else if (prio === 'medium' /* Medium */ || prio === 'medium')
494
+ priorityIcon = '\u{1F7E1}';
473
495
  result += ` ${i + 1}. ${priorityIcon} ${rec.action}
474
496
  `;
475
497
  result += ` Impact: +${rec.estimatedImpact} points
@@ -690,5 +712,5 @@ export {
690
712
  getRatingDisplay,
691
713
  formatScore,
692
714
  formatToolScore,
693
- generateHTML
715
+ generateHTML,
694
716
  };