@aiready/core 0.23.2 → 0.23.4

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 -1098
  50. package/dist/client.d.ts +2 -1098
  51. package/dist/client.js +23 -43
  52. package/dist/client.mjs +3 -25
  53. package/dist/index.d.mts +329 -107
  54. package/dist/index.d.ts +329 -107
  55. package/dist/index.js +329 -340
  56. package/dist/index.mjs +305 -322
  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 +1 -1
@@ -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,110 +109,119 @@ 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
119
  var SpokeOutputSchema = z.object({
120
120
  results: z.array(AnalysisResultSchema),
121
121
  summary: z.any(),
122
- metadata: z.object({
123
- toolName: z.string(),
124
- version: z.string(),
125
- timestamp: z.string()
126
- }).catchall(z.any()).optional()
122
+ metadata: z
123
+ .object({
124
+ toolName: z.string(),
125
+ version: z.string(),
126
+ timestamp: z.string(),
127
+ })
128
+ .catchall(z.any())
129
+ .optional(),
127
130
  });
128
- var UnifiedReportSchema = z.object({
129
- summary: z.object({
130
- totalFiles: z.number(),
131
- totalIssues: z.number(),
132
- criticalIssues: z.number(),
133
- majorIssues: z.number()
134
- }),
135
- results: z.array(AnalysisResultSchema),
136
- scoring: z.object({
137
- overall: z.number(),
138
- rating: z.string(),
139
- timestamp: z.string(),
140
- breakdown: z.array(
141
- z.object({
142
- toolName: z.union([ToolNameSchema, z.string()]),
143
- score: z.number()
144
- }).catchall(z.any())
145
- )
146
- }).optional()
147
- }).catchall(z.any());
131
+ var UnifiedReportSchema = z
132
+ .object({
133
+ summary: z.object({
134
+ totalFiles: z.number(),
135
+ totalIssues: z.number(),
136
+ criticalIssues: z.number(),
137
+ majorIssues: z.number(),
138
+ }),
139
+ results: z.array(AnalysisResultSchema),
140
+ scoring: z
141
+ .object({
142
+ overall: z.number(),
143
+ rating: z.string(),
144
+ timestamp: z.string(),
145
+ breakdown: z.array(
146
+ z
147
+ .object({
148
+ toolName: z.union([ToolNameSchema, z.string()]),
149
+ score: z.number(),
150
+ })
151
+ .catchall(z.any())
152
+ ),
153
+ })
154
+ .optional(),
155
+ })
156
+ .catchall(z.any());
148
157
 
149
158
  // src/types/language.ts
150
159
  var Language = /* @__PURE__ */ ((Language2) => {
151
- Language2["TypeScript"] = "typescript";
152
- Language2["JavaScript"] = "javascript";
153
- Language2["Python"] = "python";
154
- Language2["Java"] = "java";
155
- Language2["Go"] = "go";
156
- Language2["Rust"] = "rust";
157
- Language2["CSharp"] = "csharp";
160
+ Language2['TypeScript'] = 'typescript';
161
+ Language2['JavaScript'] = 'javascript';
162
+ Language2['Python'] = 'python';
163
+ Language2['Java'] = 'java';
164
+ Language2['Go'] = 'go';
165
+ Language2['Rust'] = 'rust';
166
+ Language2['CSharp'] = 'csharp';
158
167
  return Language2;
159
168
  })(Language || {});
160
169
  var LANGUAGE_EXTENSIONS = {
161
- ".ts": "typescript" /* TypeScript */,
162
- ".tsx": "typescript" /* TypeScript */,
163
- ".js": "javascript" /* JavaScript */,
164
- ".jsx": "javascript" /* JavaScript */,
165
- ".py": "python" /* Python */,
166
- ".java": "java" /* Java */,
167
- ".go": "go" /* Go */,
168
- ".rs": "rust" /* Rust */,
169
- ".cs": "csharp" /* CSharp */
170
+ '.ts': 'typescript' /* TypeScript */,
171
+ '.tsx': 'typescript' /* TypeScript */,
172
+ '.js': 'javascript' /* JavaScript */,
173
+ '.jsx': 'javascript' /* JavaScript */,
174
+ '.py': 'python' /* Python */,
175
+ '.java': 'java' /* Java */,
176
+ '.go': 'go' /* Go */,
177
+ '.rs': 'rust' /* Rust */,
178
+ '.cs': 'csharp' /* CSharp */,
170
179
  };
171
180
  var ParseError = class extends Error {
172
181
  constructor(message, filePath, loc) {
173
182
  super(message);
174
183
  this.filePath = filePath;
175
184
  this.loc = loc;
176
- this.name = "ParseError";
185
+ this.name = 'ParseError';
177
186
  }
178
187
  };
179
188
 
180
189
  // src/scoring.ts
181
190
  var DEFAULT_TOOL_WEIGHTS = {
182
- ["pattern-detect" /* PatternDetect */]: 22,
183
- ["context-analyzer" /* ContextAnalyzer */]: 19,
184
- ["naming-consistency" /* NamingConsistency */]: 14,
185
- ["ai-signal-clarity" /* AiSignalClarity */]: 11,
186
- ["agent-grounding" /* AgentGrounding */]: 10,
187
- ["testability-index" /* TestabilityIndex */]: 10,
188
- ["doc-drift" /* DocDrift */]: 8,
189
- ["dependency-health" /* DependencyHealth */]: 6,
190
- ["change-amplification" /* ChangeAmplification */]: 8
191
+ ['pattern-detect' /* PatternDetect */]: 22,
192
+ ['context-analyzer' /* ContextAnalyzer */]: 19,
193
+ ['naming-consistency' /* NamingConsistency */]: 14,
194
+ ['ai-signal-clarity' /* AiSignalClarity */]: 11,
195
+ ['agent-grounding' /* AgentGrounding */]: 10,
196
+ ['testability-index' /* TestabilityIndex */]: 10,
197
+ ['doc-drift' /* DocDrift */]: 8,
198
+ ['dependency-health' /* DependencyHealth */]: 6,
199
+ ['change-amplification' /* ChangeAmplification */]: 8,
191
200
  };
192
201
  var TOOL_NAME_MAP = {
193
- patterns: "pattern-detect" /* PatternDetect */,
194
- "pattern-detect": "pattern-detect" /* PatternDetect */,
195
- context: "context-analyzer" /* ContextAnalyzer */,
196
- "context-analyzer": "context-analyzer" /* ContextAnalyzer */,
197
- consistency: "naming-consistency" /* NamingConsistency */,
198
- "naming-consistency": "naming-consistency" /* NamingConsistency */,
199
- "ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
200
- "ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
201
- grounding: "agent-grounding" /* AgentGrounding */,
202
- "agent-grounding": "agent-grounding" /* AgentGrounding */,
203
- testability: "testability-index" /* TestabilityIndex */,
204
- "testability-index": "testability-index" /* TestabilityIndex */,
205
- "doc-drift": "doc-drift" /* DocDrift */,
206
- "deps-health": "dependency-health" /* DependencyHealth */,
207
- "dependency-health": "dependency-health" /* DependencyHealth */,
208
- "change-amp": "change-amplification" /* ChangeAmplification */,
209
- "change-amplification": "change-amplification" /* ChangeAmplification */
202
+ patterns: 'pattern-detect' /* PatternDetect */,
203
+ 'pattern-detect': 'pattern-detect' /* PatternDetect */,
204
+ context: 'context-analyzer' /* ContextAnalyzer */,
205
+ 'context-analyzer': 'context-analyzer' /* ContextAnalyzer */,
206
+ consistency: 'naming-consistency' /* NamingConsistency */,
207
+ 'naming-consistency': 'naming-consistency' /* NamingConsistency */,
208
+ 'ai-signal': 'ai-signal-clarity' /* AiSignalClarity */,
209
+ 'ai-signal-clarity': 'ai-signal-clarity' /* AiSignalClarity */,
210
+ grounding: 'agent-grounding' /* AgentGrounding */,
211
+ 'agent-grounding': 'agent-grounding' /* AgentGrounding */,
212
+ testability: 'testability-index' /* TestabilityIndex */,
213
+ 'testability-index': 'testability-index' /* TestabilityIndex */,
214
+ 'doc-drift': 'doc-drift' /* DocDrift */,
215
+ 'deps-health': 'dependency-health' /* DependencyHealth */,
216
+ 'dependency-health': 'dependency-health' /* DependencyHealth */,
217
+ 'change-amp': 'change-amplification' /* ChangeAmplification */,
218
+ 'change-amplification': 'change-amplification' /* ChangeAmplification */,
210
219
  };
211
220
  var CONTEXT_TIER_THRESHOLDS = {
212
221
  compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
213
222
  standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
214
223
  extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
215
- frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
224
+ frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 },
216
225
  };
217
226
  var SIZE_ADJUSTED_THRESHOLDS = {
218
227
  xs: 80,
@@ -223,20 +232,21 @@ var SIZE_ADJUSTED_THRESHOLDS = {
223
232
  // 200-500 files
224
233
  large: 65,
225
234
  // 500-2000 files
226
- enterprise: 58
235
+ enterprise: 58,
227
236
  // 2000+ files
228
237
  };
229
238
  function getProjectSizeTier(fileCount) {
230
- if (fileCount < 50) return "xs";
231
- if (fileCount < 200) return "small";
232
- if (fileCount < 500) return "medium";
233
- if (fileCount < 2e3) return "large";
234
- return "enterprise";
239
+ if (fileCount < 50) return 'xs';
240
+ if (fileCount < 200) return 'small';
241
+ if (fileCount < 500) return 'medium';
242
+ if (fileCount < 2e3) return 'large';
243
+ return 'enterprise';
235
244
  }
236
- function getRecommendedThreshold(fileCount, modelTier = "standard") {
245
+ function getRecommendedThreshold(fileCount, modelTier = 'standard') {
237
246
  const sizeTier = getProjectSizeTier(fileCount);
238
247
  const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
239
- const modelBonus = modelTier === "frontier" ? -3 : modelTier === "extended" ? -2 : 0;
248
+ const modelBonus =
249
+ modelTier === 'frontier' ? -3 : modelTier === 'extended' ? -2 : 0;
240
250
  return base + modelBonus;
241
251
  }
242
252
  function normalizeToolName(shortName) {
@@ -250,9 +260,9 @@ function getToolWeight(toolName, toolConfig, cliOverride) {
250
260
  function parseWeightString(weightStr) {
251
261
  const weights = /* @__PURE__ */ new Map();
252
262
  if (!weightStr) return weights;
253
- const pairs = weightStr.split(",");
263
+ const pairs = weightStr.split(',');
254
264
  for (const pair of pairs) {
255
- const [toolShortName, weightStr2] = pair.split(":");
265
+ const [toolShortName, weightStr2] = pair.split(':');
256
266
  if (toolShortName && weightStr2) {
257
267
  const toolName = normalizeToolName(toolShortName.trim());
258
268
  const weight = parseInt(weightStr2.trim(), 10);
@@ -265,13 +275,14 @@ function parseWeightString(weightStr) {
265
275
  }
266
276
  function calculateOverallScore(toolOutputs, config, cliWeights) {
267
277
  if (toolOutputs.size === 0) {
268
- throw new Error("No tool outputs provided for scoring");
278
+ throw new Error('No tool outputs provided for scoring');
269
279
  }
270
280
  const weights = /* @__PURE__ */ new Map();
271
281
  for (const [toolName] of toolOutputs.entries()) {
272
282
  const cliWeight = cliWeights?.get(toolName);
273
283
  const configWeight = config?.tools?.[toolName]?.scoreWeight;
274
- const weight = cliWeight ?? configWeight ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
284
+ const weight =
285
+ cliWeight ?? configWeight ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
275
286
  weights.set(toolName, weight);
276
287
  }
277
288
  let weightedSum = 0;
@@ -295,44 +306,44 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
295
306
  return `(${output.score} \xD7 ${w})`;
296
307
  }
297
308
  );
298
- const formulaStr = `[${formulaParts.join(" + ")}] / ${totalWeight} = ${overall}`;
309
+ const formulaStr = `[${formulaParts.join(' + ')}] / ${totalWeight} = ${overall}`;
299
310
  return {
300
311
  overall,
301
312
  rating,
302
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
313
+ timestamp: /* @__PURE__ */ new Date().toISOString(),
303
314
  toolsUsed,
304
315
  breakdown,
305
316
  calculation: {
306
317
  formula: formulaStr,
307
318
  weights: calculationWeights,
308
- normalized: formulaStr
309
- }
319
+ normalized: formulaStr,
320
+ },
310
321
  };
311
322
  }
312
323
  function getRating(score) {
313
- if (score >= 90) return "Excellent";
314
- if (score >= 75) return "Good";
315
- if (score >= 60) return "Fair";
316
- if (score >= 40) return "Needs Work";
317
- return "Critical";
324
+ if (score >= 90) return 'Excellent';
325
+ if (score >= 75) return 'Good';
326
+ if (score >= 60) return 'Fair';
327
+ if (score >= 40) return 'Needs Work';
328
+ return 'Critical';
318
329
  }
319
- function getRatingWithContext(score, fileCount, modelTier = "standard") {
330
+ function getRatingWithContext(score, fileCount, modelTier = 'standard') {
320
331
  const threshold = getRecommendedThreshold(fileCount, modelTier);
321
332
  const normalized = score - threshold + 70;
322
333
  return getRating(normalized);
323
334
  }
324
335
  function getRatingDisplay(rating) {
325
336
  switch (rating) {
326
- case "Excellent":
327
- return { emoji: "\u2705", color: "green" };
328
- case "Good":
329
- return { emoji: "\u{1F44D}", color: "blue" };
330
- case "Fair":
331
- return { emoji: "\u26A0\uFE0F", color: "yellow" };
332
- case "Needs Work":
333
- return { emoji: "\u{1F528}", color: "orange" };
334
- case "Critical":
335
- return { emoji: "\u274C", color: "red" };
337
+ case 'Excellent':
338
+ return { emoji: '\u2705', color: 'green' };
339
+ case 'Good':
340
+ return { emoji: '\u{1F44D}', color: 'blue' };
341
+ case 'Fair':
342
+ return { emoji: '\u26A0\uFE0F', color: 'yellow' };
343
+ case 'Needs Work':
344
+ return { emoji: '\u{1F528}', color: 'orange' };
345
+ case 'Critical':
346
+ return { emoji: '\u274C', color: 'red' };
336
347
  }
337
348
  }
338
349
  function formatScore(result) {
@@ -347,17 +358,22 @@ function formatToolScore(output) {
347
358
  result += ` Factors:
348
359
  `;
349
360
  output.factors.forEach((factor) => {
350
- const impactSign = factor.impact > 0 ? "+" : "";
361
+ const impactSign = factor.impact > 0 ? '+' : '';
351
362
  result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
352
363
  `;
353
364
  });
354
- result += "\n";
365
+ result += '\n';
355
366
  }
356
367
  if (output.recommendations && output.recommendations.length > 0) {
357
368
  result += ` Recommendations:
358
369
  `;
359
370
  output.recommendations.forEach((rec, i) => {
360
- const priorityIcon = rec.priority === "high" ? "\u{1F534}" : rec.priority === "medium" ? "\u{1F7E1}" : "\u{1F535}";
371
+ const priorityIcon =
372
+ rec.priority === 'high'
373
+ ? '\u{1F534}'
374
+ : rec.priority === 'medium'
375
+ ? '\u{1F7E1}'
376
+ : '\u{1F535}';
361
377
  result += ` ${i + 1}. ${priorityIcon} ${rec.action}
362
378
  `;
363
379
  result += ` Impact: +${rec.estimatedImpact} points
@@ -570,5 +586,5 @@ export {
570
586
  getRatingDisplay,
571
587
  formatScore,
572
588
  formatToolScore,
573
- generateHTML
589
+ generateHTML,
574
590
  };