@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,149 +109,160 @@ 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
- }),
143
- results: z.array(AnalysisResultSchema),
144
- scoring: z.object({
145
- overall: z.number(),
146
- rating: z.string(),
147
- timestamp: z.string(),
148
- breakdown: z.array(
149
- z.object({
150
- toolName: z.union([ToolNameSchema, z.string()]),
151
- score: z.number()
152
- }).catchall(z.any())
153
- )
154
- }).optional()
155
- }).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
+ }),
149
+ results: z.array(AnalysisResultSchema),
150
+ scoring: z
151
+ .object({
152
+ overall: z.number(),
153
+ rating: z.string(),
154
+ timestamp: z.string(),
155
+ breakdown: z.array(
156
+ z
157
+ .object({
158
+ toolName: z.union([ToolNameSchema, z.string()]),
159
+ score: z.number(),
160
+ })
161
+ .catchall(z.any())
162
+ ),
163
+ })
164
+ .optional(),
165
+ })
166
+ .catchall(z.any());
156
167
 
157
168
  // src/types.ts
158
169
  var GLOBAL_INFRA_OPTIONS = [
159
- "rootDir",
170
+ 'rootDir',
160
171
  // Essential for every tool
161
- "include",
162
- "exclude",
163
- "onProgress",
164
- "progressCallback",
165
- "includeTests",
166
- "useSmartDefaults",
167
- "streamResults",
168
- "batchSize",
169
- "costConfig",
170
- "tools",
171
- "toolConfigs"
172
+ 'include',
173
+ 'exclude',
174
+ 'onProgress',
175
+ 'progressCallback',
176
+ 'includeTests',
177
+ 'useSmartDefaults',
178
+ 'streamResults',
179
+ 'batchSize',
180
+ 'costConfig',
181
+ 'tools',
182
+ 'toolConfigs',
172
183
  ];
173
184
  var COMMON_FINE_TUNING_OPTIONS = [
174
- "maxDepth",
175
- "minSimilarity",
176
- "minLines",
177
- "minCohesion",
185
+ 'maxDepth',
186
+ 'minSimilarity',
187
+ 'minLines',
188
+ 'minCohesion',
178
189
  // AI Signal Clarity options
179
- "checkMagicLiterals",
180
- "checkBooleanTraps",
181
- "checkAmbiguousNames",
182
- "checkUndocumentedExports",
183
- "checkImplicitSideEffects",
184
- "checkDeepCallbacks"
190
+ 'checkMagicLiterals',
191
+ 'checkBooleanTraps',
192
+ 'checkAmbiguousNames',
193
+ 'checkUndocumentedExports',
194
+ 'checkImplicitSideEffects',
195
+ 'checkDeepCallbacks',
185
196
  ];
186
197
  var GLOBAL_SCAN_OPTIONS = [...GLOBAL_INFRA_OPTIONS];
187
198
 
188
199
  // src/types/language.ts
189
200
  var Language = /* @__PURE__ */ ((Language2) => {
190
- Language2["TypeScript"] = "typescript";
191
- Language2["JavaScript"] = "javascript";
192
- Language2["Python"] = "python";
193
- Language2["Java"] = "java";
194
- Language2["Go"] = "go";
195
- Language2["Rust"] = "rust";
196
- Language2["CSharp"] = "csharp";
201
+ Language2['TypeScript'] = 'typescript';
202
+ Language2['JavaScript'] = 'javascript';
203
+ Language2['Python'] = 'python';
204
+ Language2['Java'] = 'java';
205
+ Language2['Go'] = 'go';
206
+ Language2['Rust'] = 'rust';
207
+ Language2['CSharp'] = 'csharp';
197
208
  return Language2;
198
209
  })(Language || {});
199
210
  var LANGUAGE_EXTENSIONS = {
200
- ".ts": "typescript" /* TypeScript */,
201
- ".tsx": "typescript" /* TypeScript */,
202
- ".js": "javascript" /* JavaScript */,
203
- ".jsx": "javascript" /* JavaScript */,
204
- ".py": "python" /* Python */,
205
- ".java": "java" /* Java */,
206
- ".go": "go" /* Go */,
207
- ".rs": "rust" /* Rust */,
208
- ".cs": "csharp" /* CSharp */
211
+ '.ts': 'typescript' /* TypeScript */,
212
+ '.tsx': 'typescript' /* TypeScript */,
213
+ '.js': 'javascript' /* JavaScript */,
214
+ '.jsx': 'javascript' /* JavaScript */,
215
+ '.py': 'python' /* Python */,
216
+ '.java': 'java' /* Java */,
217
+ '.go': 'go' /* Go */,
218
+ '.rs': 'rust' /* Rust */,
219
+ '.cs': 'csharp' /* CSharp */,
209
220
  };
210
221
  var ParseError = class extends Error {
211
222
  constructor(message, filePath, loc) {
212
223
  super(message);
213
224
  this.filePath = filePath;
214
225
  this.loc = loc;
215
- this.name = "ParseError";
226
+ this.name = 'ParseError';
216
227
  }
217
228
  };
218
229
 
219
230
  // src/scoring.ts
220
231
  var DEFAULT_TOOL_WEIGHTS = {
221
- ["pattern-detect" /* PatternDetect */]: 22,
222
- ["context-analyzer" /* ContextAnalyzer */]: 19,
223
- ["naming-consistency" /* NamingConsistency */]: 14,
224
- ["ai-signal-clarity" /* AiSignalClarity */]: 11,
225
- ["agent-grounding" /* AgentGrounding */]: 10,
226
- ["testability-index" /* TestabilityIndex */]: 10,
227
- ["doc-drift" /* DocDrift */]: 8,
228
- ["dependency-health" /* DependencyHealth */]: 6,
229
- ["change-amplification" /* ChangeAmplification */]: 8
232
+ ['pattern-detect' /* PatternDetect */]: 22,
233
+ ['context-analyzer' /* ContextAnalyzer */]: 19,
234
+ ['naming-consistency' /* NamingConsistency */]: 14,
235
+ ['ai-signal-clarity' /* AiSignalClarity */]: 11,
236
+ ['agent-grounding' /* AgentGrounding */]: 10,
237
+ ['testability-index' /* TestabilityIndex */]: 10,
238
+ ['doc-drift' /* DocDrift */]: 8,
239
+ ['dependency-health' /* DependencyHealth */]: 6,
240
+ ['change-amplification' /* ChangeAmplification */]: 8,
230
241
  };
231
242
  var TOOL_NAME_MAP = {
232
- patterns: "pattern-detect" /* PatternDetect */,
233
- "pattern-detect": "pattern-detect" /* PatternDetect */,
234
- context: "context-analyzer" /* ContextAnalyzer */,
235
- "context-analyzer": "context-analyzer" /* ContextAnalyzer */,
236
- consistency: "naming-consistency" /* NamingConsistency */,
237
- "naming-consistency": "naming-consistency" /* NamingConsistency */,
238
- "ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
239
- "ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
240
- grounding: "agent-grounding" /* AgentGrounding */,
241
- "agent-grounding": "agent-grounding" /* AgentGrounding */,
242
- testability: "testability-index" /* TestabilityIndex */,
243
- "testability-index": "testability-index" /* TestabilityIndex */,
244
- "doc-drift": "doc-drift" /* DocDrift */,
245
- "deps-health": "dependency-health" /* DependencyHealth */,
246
- "dependency-health": "dependency-health" /* DependencyHealth */,
247
- "change-amp": "change-amplification" /* ChangeAmplification */,
248
- "change-amplification": "change-amplification" /* ChangeAmplification */
243
+ patterns: 'pattern-detect' /* PatternDetect */,
244
+ 'pattern-detect': 'pattern-detect' /* PatternDetect */,
245
+ context: 'context-analyzer' /* ContextAnalyzer */,
246
+ 'context-analyzer': 'context-analyzer' /* ContextAnalyzer */,
247
+ consistency: 'naming-consistency' /* NamingConsistency */,
248
+ 'naming-consistency': 'naming-consistency' /* NamingConsistency */,
249
+ 'ai-signal': 'ai-signal-clarity' /* AiSignalClarity */,
250
+ 'ai-signal-clarity': 'ai-signal-clarity' /* AiSignalClarity */,
251
+ grounding: 'agent-grounding' /* AgentGrounding */,
252
+ 'agent-grounding': 'agent-grounding' /* AgentGrounding */,
253
+ testability: 'testability-index' /* TestabilityIndex */,
254
+ 'testability-index': 'testability-index' /* TestabilityIndex */,
255
+ 'doc-drift': 'doc-drift' /* DocDrift */,
256
+ 'deps-health': 'dependency-health' /* DependencyHealth */,
257
+ 'dependency-health': 'dependency-health' /* DependencyHealth */,
258
+ 'change-amp': 'change-amplification' /* ChangeAmplification */,
259
+ 'change-amplification': 'change-amplification' /* ChangeAmplification */,
249
260
  };
250
261
  var CONTEXT_TIER_THRESHOLDS = {
251
262
  compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
252
263
  standard: { idealTokens: 5e3, criticalTokens: 15e3, idealDepth: 5 },
253
264
  extended: { idealTokens: 15e3, criticalTokens: 5e4, idealDepth: 7 },
254
- frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
265
+ frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 },
255
266
  };
256
267
  var SIZE_ADJUSTED_THRESHOLDS = {
257
268
  xs: 80,
@@ -262,20 +273,21 @@ var SIZE_ADJUSTED_THRESHOLDS = {
262
273
  // 200-500 files
263
274
  large: 65,
264
275
  // 500-2000 files
265
- enterprise: 58
276
+ enterprise: 58,
266
277
  // 2000+ files
267
278
  };
268
279
  function getProjectSizeTier(fileCount) {
269
- if (fileCount < 50) return "xs";
270
- if (fileCount < 200) return "small";
271
- if (fileCount < 500) return "medium";
272
- if (fileCount < 2e3) return "large";
273
- return "enterprise";
280
+ if (fileCount < 50) return 'xs';
281
+ if (fileCount < 200) return 'small';
282
+ if (fileCount < 500) return 'medium';
283
+ if (fileCount < 2e3) return 'large';
284
+ return 'enterprise';
274
285
  }
275
- function getRecommendedThreshold(fileCount, modelTier = "standard") {
286
+ function getRecommendedThreshold(fileCount, modelTier = 'standard') {
276
287
  const sizeTier = getProjectSizeTier(fileCount);
277
288
  const base = SIZE_ADJUSTED_THRESHOLDS[sizeTier];
278
- const modelBonus = modelTier === "frontier" ? -3 : modelTier === "extended" ? -2 : 0;
289
+ const modelBonus =
290
+ modelTier === 'frontier' ? -3 : modelTier === 'extended' ? -2 : 0;
279
291
  return base + modelBonus;
280
292
  }
281
293
  function normalizeToolName(shortName) {
@@ -289,9 +301,9 @@ function getToolWeight(toolName, toolConfig, cliOverride) {
289
301
  function parseWeightString(weightStr) {
290
302
  const weights = /* @__PURE__ */ new Map();
291
303
  if (!weightStr) return weights;
292
- const pairs = weightStr.split(",");
304
+ const pairs = weightStr.split(',');
293
305
  for (const pair of pairs) {
294
- const [toolShortName, weightStr2] = pair.split(":");
306
+ const [toolShortName, weightStr2] = pair.split(':');
295
307
  if (toolShortName && weightStr2) {
296
308
  const toolName = normalizeToolName(toolShortName.trim());
297
309
  const weight = parseInt(weightStr2.trim(), 10);
@@ -304,13 +316,14 @@ function parseWeightString(weightStr) {
304
316
  }
305
317
  function calculateOverallScore(toolOutputs, config, cliWeights) {
306
318
  if (toolOutputs.size === 0) {
307
- throw new Error("No tool outputs provided for scoring");
319
+ throw new Error('No tool outputs provided for scoring');
308
320
  }
309
321
  const weights = /* @__PURE__ */ new Map();
310
322
  for (const [toolName] of toolOutputs.entries()) {
311
323
  const cliWeight = cliWeights?.get(toolName);
312
324
  const configWeight = config?.tools?.[toolName]?.scoreWeight;
313
- const weight = cliWeight ?? configWeight ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
325
+ const weight =
326
+ cliWeight ?? configWeight ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
314
327
  weights.set(toolName, weight);
315
328
  }
316
329
  let weightedSum = 0;
@@ -334,44 +347,44 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
334
347
  return `(${output.score} \xD7 ${w})`;
335
348
  }
336
349
  );
337
- const formulaStr = `[${formulaParts.join(" + ")}] / ${totalWeight} = ${overall}`;
350
+ const formulaStr = `[${formulaParts.join(' + ')}] / ${totalWeight} = ${overall}`;
338
351
  return {
339
352
  overall,
340
353
  rating,
341
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
354
+ timestamp: /* @__PURE__ */ new Date().toISOString(),
342
355
  toolsUsed,
343
356
  breakdown,
344
357
  calculation: {
345
358
  formula: formulaStr,
346
359
  weights: calculationWeights,
347
- normalized: formulaStr
348
- }
360
+ normalized: formulaStr,
361
+ },
349
362
  };
350
363
  }
351
364
  function getRating(score) {
352
- if (score >= 90) return "Excellent";
353
- if (score >= 75) return "Good";
354
- if (score >= 60) return "Fair";
355
- if (score >= 40) return "Needs Work";
356
- return "Critical";
365
+ if (score >= 90) return 'Excellent';
366
+ if (score >= 75) return 'Good';
367
+ if (score >= 60) return 'Fair';
368
+ if (score >= 40) return 'Needs Work';
369
+ return 'Critical';
357
370
  }
358
- function getRatingWithContext(score, fileCount, modelTier = "standard") {
371
+ function getRatingWithContext(score, fileCount, modelTier = 'standard') {
359
372
  const threshold = getRecommendedThreshold(fileCount, modelTier);
360
373
  const normalized = score - threshold + 70;
361
374
  return getRating(normalized);
362
375
  }
363
376
  function getRatingDisplay(rating) {
364
377
  switch (rating) {
365
- case "Excellent":
366
- return { emoji: "\u2705", color: "green" };
367
- case "Good":
368
- return { emoji: "\u{1F44D}", color: "blue" };
369
- case "Fair":
370
- return { emoji: "\u26A0\uFE0F", color: "yellow" };
371
- case "Needs Work":
372
- return { emoji: "\u{1F528}", color: "orange" };
373
- case "Critical":
374
- return { emoji: "\u274C", color: "red" };
378
+ case 'Excellent':
379
+ return { emoji: '\u2705', color: 'green' };
380
+ case 'Good':
381
+ return { emoji: '\u{1F44D}', color: 'blue' };
382
+ case 'Fair':
383
+ return { emoji: '\u26A0\uFE0F', color: 'yellow' };
384
+ case 'Needs Work':
385
+ return { emoji: '\u{1F528}', color: 'orange' };
386
+ case 'Critical':
387
+ return { emoji: '\u274C', color: 'red' };
375
388
  }
376
389
  }
377
390
  function formatScore(result) {
@@ -386,17 +399,22 @@ function formatToolScore(output) {
386
399
  result += ` Factors:
387
400
  `;
388
401
  output.factors.forEach((factor) => {
389
- const impactSign = factor.impact > 0 ? "+" : "";
402
+ const impactSign = factor.impact > 0 ? '+' : '';
390
403
  result += ` \u2022 ${factor.name}: ${impactSign}${factor.impact} - ${factor.description}
391
404
  `;
392
405
  });
393
- result += "\n";
406
+ result += '\n';
394
407
  }
395
408
  if (output.recommendations && output.recommendations.length > 0) {
396
409
  result += ` Recommendations:
397
410
  `;
398
411
  output.recommendations.forEach((rec, i) => {
399
- const priorityIcon = rec.priority === "high" ? "\u{1F534}" : rec.priority === "medium" ? "\u{1F7E1}" : "\u{1F535}";
412
+ const priorityIcon =
413
+ rec.priority === 'high'
414
+ ? '\u{1F534}'
415
+ : rec.priority === 'medium'
416
+ ? '\u{1F7E1}'
417
+ : '\u{1F535}';
400
418
  result += ` ${i + 1}. ${priorityIcon} ${rec.action}
401
419
  `;
402
420
  result += ` Impact: +${rec.estimatedImpact} points
@@ -613,5 +631,5 @@ export {
613
631
  getRatingDisplay,
614
632
  formatScore,
615
633
  formatToolScore,
616
- generateHTML
634
+ generateHTML,
617
635
  };