@aiready/core 0.23.20 → 0.23.22

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 (116) hide show
  1. package/dist/chunk-2N7ISIKE.mjs +158 -0
  2. package/dist/chunk-ARUIZO7M.mjs +297 -0
  3. package/dist/chunk-CYC5EGEI.mjs +297 -0
  4. package/dist/{chunk-REU6OUBT.mjs → chunk-DBOPSRBC.mjs} +47 -22
  5. package/dist/chunk-E55RNGGK.mjs +852 -0
  6. package/dist/chunk-EZ7ECLAZ.mjs +299 -0
  7. package/dist/chunk-FNPULWG7.mjs +248 -0
  8. package/dist/chunk-FZTFKZUQ.mjs +250 -0
  9. package/dist/chunk-GTS642BQ.mjs +262 -0
  10. package/dist/chunk-IXPY5J4K.mjs +248 -0
  11. package/dist/chunk-JJQLYW6Z.mjs +111 -0
  12. package/dist/chunk-L6BKANJC.mjs +130 -0
  13. package/dist/chunk-LXEO5PG3.mjs +292 -0
  14. package/dist/chunk-LZHO636W.mjs +501 -0
  15. package/dist/chunk-MTK2IIDZ.mjs +262 -0
  16. package/dist/chunk-QDCQETSI.mjs +262 -0
  17. package/dist/chunk-QZNY7B2N.mjs +248 -0
  18. package/dist/chunk-RCZSMGCX.mjs +250 -0
  19. package/dist/chunk-SWZOT67M.mjs +250 -0
  20. package/dist/chunk-U3IY2CFC.mjs +36 -0
  21. package/dist/chunk-UBCM5Y6R.mjs +275 -0
  22. package/dist/chunk-UTCRW3N7.mjs +301 -0
  23. package/dist/{chunk-SQHS6PFL.mjs → chunk-UYLH35LA.mjs} +47 -22
  24. package/dist/{chunk-ZB3EHHAG.mjs → chunk-WVNVC2PP.mjs} +90 -60
  25. package/dist/chunk-WYOW6O3P.mjs +114 -0
  26. package/dist/{chunk-RMH2TPAT.mjs → chunk-YRSSR4KN.mjs} +87 -59
  27. package/dist/client/index.d.mts +2 -0
  28. package/dist/client/index.d.ts +2 -0
  29. package/dist/client/index.js +922 -0
  30. package/dist/client/index.mjs +104 -0
  31. package/dist/client-2xbeKnrg.d.mts +1291 -0
  32. package/dist/client-2xbeKnrg.d.ts +1291 -0
  33. package/dist/client-4HLAGzFg.d.mts +1291 -0
  34. package/dist/client-4HLAGzFg.d.ts +1291 -0
  35. package/dist/client-B4TQwNa7.d.mts +1290 -0
  36. package/dist/client-B4TQwNa7.d.ts +1290 -0
  37. package/dist/client-Bdi4ty0v.d.mts +1294 -0
  38. package/dist/client-Bdi4ty0v.d.ts +1294 -0
  39. package/dist/client-BsKpUH3H.d.mts +1339 -0
  40. package/dist/client-BsKpUH3H.d.ts +1339 -0
  41. package/dist/client-Bv1zOaWF.d.mts +1291 -0
  42. package/dist/client-Bv1zOaWF.d.ts +1291 -0
  43. package/dist/client-Bz9YJMIX.d.mts +1290 -0
  44. package/dist/client-Bz9YJMIX.d.ts +1290 -0
  45. package/dist/client-CBpzm34X.d.mts +1291 -0
  46. package/dist/client-CBpzm34X.d.ts +1291 -0
  47. package/dist/client-CNu_tCZZ.d.mts +1305 -0
  48. package/dist/client-CNu_tCZZ.d.ts +1305 -0
  49. package/dist/client-CmEvxxQu.d.mts +1339 -0
  50. package/dist/client-CmEvxxQu.d.ts +1339 -0
  51. package/dist/client-Ctl_0z6F.d.mts +1294 -0
  52. package/dist/client-Ctl_0z6F.d.ts +1294 -0
  53. package/dist/client-DGMAxkZc.d.mts +1339 -0
  54. package/dist/client-DGMAxkZc.d.ts +1339 -0
  55. package/dist/client-DZq-CqcD.d.mts +1292 -0
  56. package/dist/client-DZq-CqcD.d.ts +1292 -0
  57. package/dist/{client-CYz0qxGB.d.mts → client-DcqGfDTt.d.mts} +90 -23
  58. package/dist/{client-CYz0qxGB.d.ts → client-DcqGfDTt.d.ts} +90 -23
  59. package/dist/{client-jGuH6TAG.d.mts → client-O8RvSRm0.d.mts} +18 -1
  60. package/dist/{client-jGuH6TAG.d.ts → client-O8RvSRm0.d.ts} +18 -1
  61. package/dist/client.d.mts +1 -1
  62. package/dist/client.d.ts +1 -1
  63. package/dist/client.js +47 -13
  64. package/dist/client.mjs +6 -4
  65. package/dist/csharp-parser-4ZKCSX5B.mjs +9 -0
  66. package/dist/csharp-parser-5HKICCRR.mjs +9 -0
  67. package/dist/csharp-parser-JCKXIAJW.mjs +9 -0
  68. package/dist/go-parser-J4KIH4RG.mjs +9 -0
  69. package/dist/go-parser-TKXL3DVH.mjs +9 -0
  70. package/dist/go-parser-XOM232XZ.mjs +9 -0
  71. package/dist/index-Ctl_0z6F.d.mts +1294 -0
  72. package/dist/index-Ctl_0z6F.d.ts +1294 -0
  73. package/dist/index.d.mts +372 -165
  74. package/dist/index.d.ts +372 -165
  75. package/dist/index.js +3825 -3123
  76. package/dist/index.mjs +901 -2128
  77. package/dist/java-parser-3KHXOXRQ.mjs +9 -0
  78. package/dist/java-parser-MASGS4WB.mjs +9 -0
  79. package/dist/java-parser-T5LXD63J.mjs +9 -0
  80. package/dist/python-parser-FNFK2473.mjs +8 -0
  81. package/dist/typescript-parser-2GGNRNB5.mjs +7 -0
  82. package/dist/typescript-parser-3ENJ6C7H.mjs +7 -0
  83. package/dist/typescript-parser-4GI7DPSW.mjs +7 -0
  84. package/dist/typescript-parser-4H3HUBO4.mjs +7 -0
  85. package/dist/typescript-parser-K63IVZMF.mjs +7 -0
  86. package/dist/typescript-parser-ZJKROMQG.mjs +7 -0
  87. package/package.json +6 -6
  88. package/dist/chunk-2Y6WZCES.mjs +0 -859
  89. package/dist/chunk-5SHLHMH7.mjs +0 -760
  90. package/dist/chunk-CGOS2J6T.mjs +0 -807
  91. package/dist/chunk-FMNCV4CC.mjs +0 -859
  92. package/dist/chunk-Q55AMEFV.mjs +0 -760
  93. package/dist/chunk-ST75O5C5.mjs +0 -859
  94. package/dist/chunk-TJXR2CHZ.mjs +0 -799
  95. package/dist/client-BEoUYNLp.d.mts +0 -1191
  96. package/dist/client-BEoUYNLp.d.ts +0 -1191
  97. package/dist/client-BrIMPk89.d.mts +0 -1214
  98. package/dist/client-BrIMPk89.d.ts +0 -1214
  99. package/dist/client-C5BuGX4F.d.mts +0 -1205
  100. package/dist/client-C5BuGX4F.d.ts +0 -1205
  101. package/dist/client-CKcjnPXt.d.mts +0 -1214
  102. package/dist/client-CKcjnPXt.d.ts +0 -1214
  103. package/dist/client-CLulBnie.d.mts +0 -1182
  104. package/dist/client-CLulBnie.d.ts +0 -1182
  105. package/dist/client-CQwvp8ep.d.mts +0 -1182
  106. package/dist/client-CQwvp8ep.d.ts +0 -1182
  107. package/dist/client-DLvFR2qA.d.mts +0 -1197
  108. package/dist/client-DLvFR2qA.d.ts +0 -1197
  109. package/dist/client-PFPdeo-z.d.mts +0 -1186
  110. package/dist/client-PFPdeo-z.d.ts +0 -1186
  111. package/dist/client-WVCAIWdJ.d.mts +0 -1192
  112. package/dist/client-WVCAIWdJ.d.ts +0 -1192
  113. package/dist/client-pYldIAg2.d.mts +0 -1209
  114. package/dist/client-pYldIAg2.d.ts +0 -1209
  115. package/dist/client-wk2fgk1q.d.mts +0 -1184
  116. package/dist/client-wk2fgk1q.d.ts +0 -1184
@@ -0,0 +1,1339 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * AST Parsing and Export Extraction Types
5
+ */
6
+ /**
7
+ * Location information in source code
8
+ */
9
+ interface SourceLocation {
10
+ line: number;
11
+ column: number;
12
+ }
13
+ /**
14
+ * Range information in source code
15
+ */
16
+ interface SourceRange {
17
+ start: SourceLocation;
18
+ end: SourceLocation;
19
+ }
20
+ interface ExportWithImports {
21
+ name: string;
22
+ type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default' | 'all';
23
+ source?: string;
24
+ imports: string[];
25
+ dependencies: string[];
26
+ typeReferences: string[];
27
+ loc?: SourceRange;
28
+ }
29
+ /**
30
+ * Information about a single import declaration
31
+ */
32
+ interface FileImport {
33
+ /** Module being imported from */
34
+ source: string;
35
+ /** What's being imported */
36
+ specifiers: string[];
37
+ /** Is this a type-only import (TypeScript) */
38
+ isTypeOnly?: boolean;
39
+ /** Location in source */
40
+ loc?: SourceRange;
41
+ }
42
+ interface ASTNode {
43
+ type: string;
44
+ loc?: SourceRange;
45
+ }
46
+ /**
47
+ * AI token budget unit economics (v0.13+)
48
+ */
49
+ interface TokenBudget {
50
+ totalContextTokens: number;
51
+ estimatedResponseTokens?: number;
52
+ wastedTokens: {
53
+ total: number;
54
+ bySource: {
55
+ duplication: number;
56
+ fragmentation: number;
57
+ chattiness: number;
58
+ };
59
+ };
60
+ efficiencyRatio: number;
61
+ potentialRetrievableTokens: number;
62
+ }
63
+
64
+ /**
65
+ * Severity levels for all AIReady issues.
66
+ */
67
+ declare enum Severity {
68
+ Critical = "critical",
69
+ Major = "major",
70
+ Minor = "minor",
71
+ Info = "info"
72
+ }
73
+ /** Zod schema for Severity enum */
74
+ declare const SeveritySchema: z.ZodEnum<typeof Severity>;
75
+ /**
76
+ * Canonical Tool Names (IDs)
77
+ * Used everywhere as the single source of truth for tool identification.
78
+ */
79
+ declare enum ToolName {
80
+ PatternDetect = "pattern-detect",
81
+ ContextAnalyzer = "context-analyzer",
82
+ NamingConsistency = "naming-consistency",
83
+ AiSignalClarity = "ai-signal-clarity",
84
+ AgentGrounding = "agent-grounding",
85
+ TestabilityIndex = "testability-index",
86
+ DocDrift = "doc-drift",
87
+ DependencyHealth = "dependency-health",
88
+ ChangeAmplification = "change-amplification",
89
+ CognitiveLoad = "cognitive-load",
90
+ PatternEntropy = "pattern-entropy",
91
+ ConceptCohesion = "concept-cohesion",
92
+ SemanticDistance = "semantic-distance"
93
+ }
94
+ /** Zod schema for ToolName enum */
95
+ declare const ToolNameSchema: z.ZodEnum<typeof ToolName>;
96
+ /**
97
+ * Friendly labels for UI display
98
+ */
99
+ declare const FRIENDLY_TOOL_NAMES: Record<ToolName, string>;
100
+ /**
101
+ * Standardized issue types across all AIReady tools.
102
+ */
103
+ declare enum IssueType {
104
+ DuplicatePattern = "duplicate-pattern",
105
+ PatternInconsistency = "pattern-inconsistency",
106
+ ContextFragmentation = "context-fragmentation",
107
+ DependencyHealth = "dependency-health",
108
+ CircularDependency = "circular-dependency",
109
+ DocDrift = "doc-drift",
110
+ NamingInconsistency = "naming-inconsistency",
111
+ NamingQuality = "naming-quality",
112
+ ArchitectureInconsistency = "architecture-inconsistency",
113
+ DeadCode = "dead-code",
114
+ MissingTypes = "missing-types",
115
+ MagicLiteral = "magic-literal",
116
+ BooleanTrap = "boolean-trap",
117
+ AiSignalClarity = "ai-signal-clarity",
118
+ LowTestability = "low-testability",
119
+ AgentNavigationFailure = "agent-navigation-failure",
120
+ AmbiguousApi = "ambiguous-api",
121
+ ChangeAmplification = "change-amplification"
122
+ }
123
+ /** Zod schema for IssueType enum */
124
+ declare const IssueTypeSchema: z.ZodEnum<typeof IssueType>;
125
+ /**
126
+ * Analysis processing status.
127
+ */
128
+ declare enum AnalysisStatus {
129
+ Processing = "processing",
130
+ Completed = "completed",
131
+ Failed = "failed"
132
+ }
133
+ /** Zod schema for AnalysisStatus enum */
134
+ declare const AnalysisStatusSchema: z.ZodEnum<typeof AnalysisStatus>;
135
+ /**
136
+ * AI Model Context Tiers.
137
+ */
138
+ declare enum ModelTier {
139
+ Compact = "compact",
140
+ Standard = "standard",
141
+ Extended = "extended",
142
+ Frontier = "frontier"
143
+ }
144
+ /** Zod schema for ModelTier enum */
145
+ declare const ModelTierSchema: z.ZodEnum<typeof ModelTier>;
146
+
147
+ /**
148
+ * Common tool options
149
+ */
150
+ interface ToolOptions {
151
+ /** Root directory of the project */
152
+ rootDir: string;
153
+ /** Files to include in this tool's analysis */
154
+ include?: string[];
155
+ /** Files to exclude from this tool's analysis */
156
+ exclude?: string[];
157
+ /** Tool-specific configuration values */
158
+ config?: any;
159
+ /** Any other dynamic options */
160
+ [key: string]: any;
161
+ }
162
+ /**
163
+ * Source code location schema.
164
+ */
165
+ /** Zod schema for Location object */
166
+ declare const LocationSchema: z.ZodObject<{
167
+ file: z.ZodString;
168
+ line: z.ZodNumber;
169
+ column: z.ZodOptional<z.ZodNumber>;
170
+ endLine: z.ZodOptional<z.ZodNumber>;
171
+ endColumn: z.ZodOptional<z.ZodNumber>;
172
+ }, z.core.$strip>;
173
+ type Location = z.infer<typeof LocationSchema>;
174
+
175
+ /**
176
+ * Standard Issue schema used across all tools.
177
+ */
178
+ /** Zod schema for Issue object */
179
+ declare const IssueSchema: z.ZodObject<{
180
+ type: z.ZodEnum<typeof IssueType>;
181
+ severity: z.ZodEnum<typeof Severity>;
182
+ message: z.ZodString;
183
+ location: z.ZodObject<{
184
+ file: z.ZodString;
185
+ line: z.ZodNumber;
186
+ column: z.ZodOptional<z.ZodNumber>;
187
+ endLine: z.ZodOptional<z.ZodNumber>;
188
+ endColumn: z.ZodOptional<z.ZodNumber>;
189
+ }, z.core.$strip>;
190
+ suggestion: z.ZodOptional<z.ZodString>;
191
+ }, z.core.$strip>;
192
+ type Issue = z.infer<typeof IssueSchema>;
193
+
194
+ /**
195
+ * Standard Metrics schema.
196
+ */
197
+ /** Zod schema for Metrics object */
198
+ declare const MetricsSchema: z.ZodObject<{
199
+ tokenCost: z.ZodOptional<z.ZodNumber>;
200
+ complexityScore: z.ZodOptional<z.ZodNumber>;
201
+ consistencyScore: z.ZodOptional<z.ZodNumber>;
202
+ docFreshnessScore: z.ZodOptional<z.ZodNumber>;
203
+ aiSignalClarityScore: z.ZodOptional<z.ZodNumber>;
204
+ agentGroundingScore: z.ZodOptional<z.ZodNumber>;
205
+ testabilityScore: z.ZodOptional<z.ZodNumber>;
206
+ docDriftScore: z.ZodOptional<z.ZodNumber>;
207
+ dependencyHealthScore: z.ZodOptional<z.ZodNumber>;
208
+ modelContextTier: z.ZodOptional<z.ZodEnum<typeof ModelTier>>;
209
+ estimatedMonthlyCost: z.ZodOptional<z.ZodNumber>;
210
+ estimatedDeveloperHours: z.ZodOptional<z.ZodNumber>;
211
+ comprehensionDifficultyIndex: z.ZodOptional<z.ZodNumber>;
212
+ totalSymbols: z.ZodOptional<z.ZodNumber>;
213
+ totalExports: z.ZodOptional<z.ZodNumber>;
214
+ }, z.core.$strip>;
215
+ type Metrics = z.infer<typeof MetricsSchema>;
216
+
217
+ /**
218
+ * Individual file/module analysis result.
219
+ */
220
+ declare const AnalysisResultSchema: z.ZodObject<{
221
+ fileName: z.ZodString;
222
+ issues: z.ZodArray<z.ZodObject<{
223
+ type: z.ZodEnum<typeof IssueType>;
224
+ severity: z.ZodEnum<typeof Severity>;
225
+ message: z.ZodString;
226
+ location: z.ZodObject<{
227
+ file: z.ZodString;
228
+ line: z.ZodNumber;
229
+ column: z.ZodOptional<z.ZodNumber>;
230
+ endLine: z.ZodOptional<z.ZodNumber>;
231
+ endColumn: z.ZodOptional<z.ZodNumber>;
232
+ }, z.core.$strip>;
233
+ suggestion: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strip>>;
235
+ metrics: z.ZodObject<{
236
+ tokenCost: z.ZodOptional<z.ZodNumber>;
237
+ complexityScore: z.ZodOptional<z.ZodNumber>;
238
+ consistencyScore: z.ZodOptional<z.ZodNumber>;
239
+ docFreshnessScore: z.ZodOptional<z.ZodNumber>;
240
+ aiSignalClarityScore: z.ZodOptional<z.ZodNumber>;
241
+ agentGroundingScore: z.ZodOptional<z.ZodNumber>;
242
+ testabilityScore: z.ZodOptional<z.ZodNumber>;
243
+ docDriftScore: z.ZodOptional<z.ZodNumber>;
244
+ dependencyHealthScore: z.ZodOptional<z.ZodNumber>;
245
+ modelContextTier: z.ZodOptional<z.ZodEnum<typeof ModelTier>>;
246
+ estimatedMonthlyCost: z.ZodOptional<z.ZodNumber>;
247
+ estimatedDeveloperHours: z.ZodOptional<z.ZodNumber>;
248
+ comprehensionDifficultyIndex: z.ZodOptional<z.ZodNumber>;
249
+ totalSymbols: z.ZodOptional<z.ZodNumber>;
250
+ totalExports: z.ZodOptional<z.ZodNumber>;
251
+ }, z.core.$strip>;
252
+ }, z.core.$strip>;
253
+ type AnalysisResult = z.infer<typeof AnalysisResultSchema>;
254
+ /**
255
+ * Standard spoke tool summary schema.
256
+ */
257
+ declare const SpokeSummarySchema: z.ZodObject<{
258
+ totalFiles: z.ZodOptional<z.ZodNumber>;
259
+ totalIssues: z.ZodOptional<z.ZodNumber>;
260
+ criticalIssues: z.ZodOptional<z.ZodNumber>;
261
+ majorIssues: z.ZodOptional<z.ZodNumber>;
262
+ score: z.ZodOptional<z.ZodNumber>;
263
+ }, z.core.$catchall<z.ZodAny>>;
264
+ type SpokeSummary = z.infer<typeof SpokeSummarySchema>;
265
+ /**
266
+ * Standard spoke tool output contract.
267
+ */
268
+ declare const SpokeOutputSchema: z.ZodObject<{
269
+ results: z.ZodArray<z.ZodObject<{
270
+ fileName: z.ZodString;
271
+ issues: z.ZodArray<z.ZodObject<{
272
+ type: z.ZodEnum<typeof IssueType>;
273
+ severity: z.ZodEnum<typeof Severity>;
274
+ message: z.ZodString;
275
+ location: z.ZodObject<{
276
+ file: z.ZodString;
277
+ line: z.ZodNumber;
278
+ column: z.ZodOptional<z.ZodNumber>;
279
+ endLine: z.ZodOptional<z.ZodNumber>;
280
+ endColumn: z.ZodOptional<z.ZodNumber>;
281
+ }, z.core.$strip>;
282
+ suggestion: z.ZodOptional<z.ZodString>;
283
+ }, z.core.$strip>>;
284
+ metrics: z.ZodObject<{
285
+ tokenCost: z.ZodOptional<z.ZodNumber>;
286
+ complexityScore: z.ZodOptional<z.ZodNumber>;
287
+ consistencyScore: z.ZodOptional<z.ZodNumber>;
288
+ docFreshnessScore: z.ZodOptional<z.ZodNumber>;
289
+ aiSignalClarityScore: z.ZodOptional<z.ZodNumber>;
290
+ agentGroundingScore: z.ZodOptional<z.ZodNumber>;
291
+ testabilityScore: z.ZodOptional<z.ZodNumber>;
292
+ docDriftScore: z.ZodOptional<z.ZodNumber>;
293
+ dependencyHealthScore: z.ZodOptional<z.ZodNumber>;
294
+ modelContextTier: z.ZodOptional<z.ZodEnum<typeof ModelTier>>;
295
+ estimatedMonthlyCost: z.ZodOptional<z.ZodNumber>;
296
+ estimatedDeveloperHours: z.ZodOptional<z.ZodNumber>;
297
+ comprehensionDifficultyIndex: z.ZodOptional<z.ZodNumber>;
298
+ totalSymbols: z.ZodOptional<z.ZodNumber>;
299
+ totalExports: z.ZodOptional<z.ZodNumber>;
300
+ }, z.core.$strip>;
301
+ }, z.core.$strip>>;
302
+ summary: z.ZodObject<{
303
+ totalFiles: z.ZodOptional<z.ZodNumber>;
304
+ totalIssues: z.ZodOptional<z.ZodNumber>;
305
+ criticalIssues: z.ZodOptional<z.ZodNumber>;
306
+ majorIssues: z.ZodOptional<z.ZodNumber>;
307
+ score: z.ZodOptional<z.ZodNumber>;
308
+ }, z.core.$catchall<z.ZodAny>>;
309
+ metadata: z.ZodOptional<z.ZodObject<{
310
+ toolName: z.ZodString;
311
+ version: z.ZodOptional<z.ZodString>;
312
+ timestamp: z.ZodOptional<z.ZodString>;
313
+ config: z.ZodOptional<z.ZodAny>;
314
+ }, z.core.$catchall<z.ZodAny>>>;
315
+ }, z.core.$strip>;
316
+ type SpokeOutput = z.infer<typeof SpokeOutputSchema>;
317
+ /**
318
+ * Master Unified Report contract (CLI -> Platform).
319
+ */
320
+ declare const UnifiedReportSchema: z.ZodObject<{
321
+ summary: z.ZodObject<{
322
+ totalFiles: z.ZodNumber;
323
+ totalIssues: z.ZodNumber;
324
+ criticalIssues: z.ZodNumber;
325
+ majorIssues: z.ZodNumber;
326
+ businessImpact: z.ZodOptional<z.ZodObject<{
327
+ estimatedMonthlyWaste: z.ZodOptional<z.ZodNumber>;
328
+ potentialSavings: z.ZodOptional<z.ZodNumber>;
329
+ productivityHours: z.ZodOptional<z.ZodNumber>;
330
+ }, z.core.$strip>>;
331
+ }, z.core.$strip>;
332
+ results: z.ZodArray<z.ZodObject<{
333
+ fileName: z.ZodString;
334
+ issues: z.ZodArray<z.ZodObject<{
335
+ type: z.ZodEnum<typeof IssueType>;
336
+ severity: z.ZodEnum<typeof Severity>;
337
+ message: z.ZodString;
338
+ location: z.ZodObject<{
339
+ file: z.ZodString;
340
+ line: z.ZodNumber;
341
+ column: z.ZodOptional<z.ZodNumber>;
342
+ endLine: z.ZodOptional<z.ZodNumber>;
343
+ endColumn: z.ZodOptional<z.ZodNumber>;
344
+ }, z.core.$strip>;
345
+ suggestion: z.ZodOptional<z.ZodString>;
346
+ }, z.core.$strip>>;
347
+ metrics: z.ZodObject<{
348
+ tokenCost: z.ZodOptional<z.ZodNumber>;
349
+ complexityScore: z.ZodOptional<z.ZodNumber>;
350
+ consistencyScore: z.ZodOptional<z.ZodNumber>;
351
+ docFreshnessScore: z.ZodOptional<z.ZodNumber>;
352
+ aiSignalClarityScore: z.ZodOptional<z.ZodNumber>;
353
+ agentGroundingScore: z.ZodOptional<z.ZodNumber>;
354
+ testabilityScore: z.ZodOptional<z.ZodNumber>;
355
+ docDriftScore: z.ZodOptional<z.ZodNumber>;
356
+ dependencyHealthScore: z.ZodOptional<z.ZodNumber>;
357
+ modelContextTier: z.ZodOptional<z.ZodEnum<typeof ModelTier>>;
358
+ estimatedMonthlyCost: z.ZodOptional<z.ZodNumber>;
359
+ estimatedDeveloperHours: z.ZodOptional<z.ZodNumber>;
360
+ comprehensionDifficultyIndex: z.ZodOptional<z.ZodNumber>;
361
+ totalSymbols: z.ZodOptional<z.ZodNumber>;
362
+ totalExports: z.ZodOptional<z.ZodNumber>;
363
+ }, z.core.$strip>;
364
+ }, z.core.$strip>>;
365
+ scoring: z.ZodOptional<z.ZodObject<{
366
+ overall: z.ZodNumber;
367
+ rating: z.ZodString;
368
+ timestamp: z.ZodString;
369
+ breakdown: z.ZodArray<z.ZodObject<{
370
+ toolName: z.ZodUnion<readonly [z.ZodEnum<typeof ToolName>, z.ZodString]>;
371
+ score: z.ZodNumber;
372
+ }, z.core.$catchall<z.ZodAny>>>;
373
+ }, z.core.$strip>>;
374
+ }, z.core.$catchall<z.ZodAny>>;
375
+ type UnifiedReport = z.infer<typeof UnifiedReportSchema>;
376
+
377
+ /**
378
+ * Global AIReady Configuration Schema.
379
+ * Strict definition for aiready.json and related config files.
380
+ */
381
+ declare const AIReadyConfigSchema: z.ZodObject<{
382
+ threshold: z.ZodOptional<z.ZodNumber>;
383
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
384
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
385
+ scan: z.ZodOptional<z.ZodObject<{
386
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
387
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
388
+ parallel: z.ZodOptional<z.ZodBoolean>;
389
+ deep: z.ZodOptional<z.ZodBoolean>;
390
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
391
+ }, z.core.$strip>>;
392
+ output: z.ZodOptional<z.ZodObject<{
393
+ format: z.ZodOptional<z.ZodEnum<{
394
+ json: "json";
395
+ console: "console";
396
+ html: "html";
397
+ }>>;
398
+ path: z.ZodOptional<z.ZodString>;
399
+ saveTo: z.ZodOptional<z.ZodString>;
400
+ showBreakdown: z.ZodOptional<z.ZodBoolean>;
401
+ compareBaseline: z.ZodOptional<z.ZodString>;
402
+ }, z.core.$strip>>;
403
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
404
+ scoring: z.ZodOptional<z.ZodObject<{
405
+ profile: z.ZodOptional<z.ZodString>;
406
+ weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
407
+ }, z.core.$strip>>;
408
+ visualizer: z.ZodOptional<z.ZodObject<{
409
+ groupingDirs: z.ZodOptional<z.ZodArray<z.ZodString>>;
410
+ graph: z.ZodOptional<z.ZodObject<{
411
+ maxNodes: z.ZodOptional<z.ZodNumber>;
412
+ maxEdges: z.ZodOptional<z.ZodNumber>;
413
+ }, z.core.$strip>>;
414
+ }, z.core.$strip>>;
415
+ }, z.core.$catchall<z.ZodAny>>;
416
+
417
+ /**
418
+ * Shared rating helper functions for scoring and display.
419
+ * Extracted to eliminate duplication between scoring.ts and CLI output modules.
420
+ */
421
+ /**
422
+ * AI Readiness Rating categories.
423
+ * Provides a high-level qualitative assessment based on the numeric score.
424
+ */
425
+ declare enum ReadinessRating {
426
+ Excellent = "Excellent",
427
+ Good = "Good",
428
+ Fair = "Fair",
429
+ NeedsWork = "Needs Work",
430
+ Critical = "Critical"
431
+ }
432
+ /**
433
+ * Metadata for a given score range.
434
+ */
435
+ interface RatingMetadata {
436
+ label: string;
437
+ slug: string;
438
+ emoji: string;
439
+ rating: ReadinessRating;
440
+ }
441
+ /**
442
+ * Get all metadata for a specific score.
443
+ * Unified to remove structural duplication.
444
+ *
445
+ * @param score The numerical AI readiness score (0-100)
446
+ * @returns Metadata object including label, slug, emoji, and rating category
447
+ */
448
+ declare function getRatingMetadata(score: number): RatingMetadata;
449
+ /**
450
+ * Get rating label from score
451
+ * @param score The numerical AI readiness score (0-100)
452
+ * @returns Human-readable rating label
453
+ */
454
+ declare function getRatingLabel(score: number): string;
455
+ /**
456
+ * Get rating slug from score (URL-friendly)
457
+ * @param score The numerical score
458
+ * @returns A kebab-case string (e.g., 'excellent', 'needs-work')
459
+ */
460
+ declare function getRatingSlug(score: number): string;
461
+ /**
462
+ * Get rating emoji from score
463
+ * @param score The numerical score
464
+ * @returns Emoji string for display
465
+ */
466
+ declare function getRatingEmoji(score: number): string;
467
+ /**
468
+ * Get tool emoji from score (alias for getRatingEmoji)
469
+ * @param score The numerical score
470
+ * @returns Emoji string for display
471
+ */
472
+ declare function getToolEmoji(score: number): string;
473
+ /**
474
+ * Get priority icon from priority level
475
+ * @param priority Priority level string
476
+ * @returns Emoji string for display
477
+ */
478
+ declare function getPriorityIcon(priority: string): string;
479
+ /**
480
+ * Convert numeric score to ReadinessRating enum
481
+ * @param score The numerical AI readiness score (0-100)
482
+ * @returns The corresponding ReadinessRating category
483
+ */
484
+ declare function getRating(score: number): ReadinessRating;
485
+
486
+ /**
487
+ * Priority levels for actionable recommendations.
488
+ * Used to sort and display fixes for the user.
489
+ */
490
+ declare enum RecommendationPriority {
491
+ High = "high",
492
+ Medium = "medium",
493
+ Low = "low"
494
+ }
495
+ /**
496
+ * Output structure for a single tool's scoring analysis.
497
+ */
498
+ interface ToolScoringOutput {
499
+ /** Unique tool identifier (e.g., "pattern-detect") */
500
+ toolName: string;
501
+ /** Normalized 0-100 score for this tool */
502
+ score: number;
503
+ /** AI token budget unit economics (v0.13+) */
504
+ tokenBudget?: TokenBudget;
505
+ /** Raw metrics used to calculate the score */
506
+ rawMetrics: Record<string, any>;
507
+ /** Factors that influenced the score */
508
+ factors: Array<{
509
+ /** Human-readable name of the factor */
510
+ name: string;
511
+ /** Points contribution (positive or negative) */
512
+ impact: number;
513
+ /** Explanation of the factor's impact */
514
+ description: string;
515
+ }>;
516
+ /** Actionable recommendations with estimated impact */
517
+ recommendations: Array<{
518
+ /** The recommended action to take */
519
+ action: string;
520
+ /** Potential points increase if implemented */
521
+ estimatedImpact: number;
522
+ /** Implementation priority */
523
+ priority: RecommendationPriority | 'high' | 'medium' | 'low';
524
+ }>;
525
+ }
526
+ /**
527
+ * Consolidated scoring result across all tools.
528
+ */
529
+ interface ScoringResult {
530
+ /** Overall AI Readiness Score (0-100) */
531
+ overall: number;
532
+ /** Rating category representing the overall readiness */
533
+ rating: ReadinessRating | string;
534
+ /** Timestamp of score calculation */
535
+ timestamp: string;
536
+ /** Tools that contributed to this score */
537
+ toolsUsed: string[];
538
+ /** Breakdown by individual tool */
539
+ breakdown: ToolScoringOutput[];
540
+ /** Internal calculation details for transparency */
541
+ calculation: {
542
+ /** Textual representation of the calculation formula */
543
+ formula: string;
544
+ /** Weights applied to each tool */
545
+ weights: Record<string, number>;
546
+ /** Simplified normalized formula output */
547
+ normalized: string;
548
+ };
549
+ }
550
+ /**
551
+ * Configuration options for the scoring system.
552
+ */
553
+ interface ScoringConfig {
554
+ /** Minimum passing score (CLI will exit with non-zero if below) */
555
+ threshold?: number;
556
+ /** Whether to show the detailed tool-by-tool breakdown */
557
+ showBreakdown?: boolean;
558
+ /** Path to a baseline report JSON for trend comparison */
559
+ compareBaseline?: string;
560
+ /** Target file path to persist the calculated score */
561
+ saveTo?: string;
562
+ }
563
+ /**
564
+ * Default weights for known tools.
565
+ */
566
+ declare const DEFAULT_TOOL_WEIGHTS: Record<string, number>;
567
+ /**
568
+ * Tool name normalization map.
569
+ * Maps common shorthands and aliases to canonical tool IDs.
570
+ */
571
+ declare const TOOL_NAME_MAP: Record<string, string>;
572
+ /**
573
+ * Model context tiers for context-aware threshold calibration.
574
+ */
575
+ type ModelContextTier = 'compact' | 'standard' | 'extended' | 'frontier';
576
+ /**
577
+ * Scoring profiles for project-aware weighting adjustments.
578
+ *
579
+ * Different profiles prioritize different aspects of AI readiness based
580
+ * on the project's primary focus.
581
+ */
582
+ declare enum ScoringProfile {
583
+ Default = "default",
584
+ Agentic = "agentic",// Focus on AI agent navigation and signal
585
+ Logic = "logic",// Focus on testability and complexity
586
+ UI = "ui",// Focus on consistency and context
587
+ Cost = "cost",// Focus on token waste reduction
588
+ Security = "security"
589
+ }
590
+ /**
591
+ * Project-type-aware tool weight presets for different profiles.
592
+ */
593
+ declare const SCORING_PROFILES: Record<ScoringProfile, Record<string, number>>;
594
+ /**
595
+ * Context budget thresholds per tier.
596
+ *
597
+ * "Ideal" represents target state. "Critical" represents failure state.
598
+ */
599
+ declare const CONTEXT_TIER_THRESHOLDS: Record<ModelContextTier, {
600
+ idealTokens: number;
601
+ criticalTokens: number;
602
+ idealDepth: number;
603
+ }>;
604
+ /**
605
+ * Project-size-adjusted minimum thresholds.
606
+ *
607
+ * Larger projects have slightly lower thresholds due to inherent complexity.
608
+ */
609
+ declare const SIZE_ADJUSTED_THRESHOLDS: Record<string, number>;
610
+ /**
611
+ * Determine project size tier based on the total number of files.
612
+ *
613
+ * @param fileCount Total number of files in the project
614
+ * @returns A string identifier for the project size tier (xs, small, medium, large, enterprise)
615
+ */
616
+ declare function getProjectSizeTier(fileCount: number): keyof typeof SIZE_ADJUSTED_THRESHOLDS;
617
+ /**
618
+ * Calculate the recommended minimum AI readiness threshold for a project.
619
+ *
620
+ * Threshold is adjusted based on project size and the model context tier targeted.
621
+ *
622
+ * @param fileCount Total number of files in the project
623
+ * @param modelTier The model context tier targeted (compact, standard, extended, frontier)
624
+ * @returns The recommended score threshold (0-100)
625
+ */
626
+ declare function getRecommendedThreshold(fileCount: number, modelTier?: ModelContextTier): number;
627
+ /**
628
+ * Normalize a tool name from a shorthand or alias to its canonical ID.
629
+ *
630
+ * @param shortName The tool shorthand or alias name
631
+ * @returns The canonical tool ID
632
+ */
633
+ declare function normalizeToolName(shortName: string): string;
634
+ /**
635
+ * Retrieve the weight for a specific tool, considering overrides and profiles.
636
+ *
637
+ * @param toolName The canonical tool ID
638
+ * @param toolConfig Optional configuration for the tool containing a weight
639
+ * @param cliOverride Optional weight override from the CLI
640
+ * @param profile Optional scoring profile to use
641
+ * @returns The weight to be used for this tool in overall scoring
642
+ */
643
+ declare function getToolWeight(toolName: string, toolConfig?: {
644
+ scoreWeight?: number;
645
+ }, cliOverride?: number, profile?: ScoringProfile): number;
646
+ /**
647
+ * Parse a comma-separated weight string from the CLI.
648
+ *
649
+ * Format: "tool1:weight1,tool2:weight2"
650
+ *
651
+ * @param weightStr The raw weight string from the CLI or config
652
+ * @returns A Map of tool IDs to their parsed weights
653
+ */
654
+ declare function parseWeightString(weightStr?: string): Map<string, number>;
655
+ /**
656
+ * Calculate the overall consolidated AI Readiness Score.
657
+ *
658
+ * Orchestrates the weighted aggregation of all tool individual scores.
659
+ *
660
+ * @param toolOutputs Map of tool IDs to their individual scoring outputs
661
+ * @param config Optional global configuration
662
+ * @param cliWeights Optional weight overrides from the CLI
663
+ * @returns Consolidate ScoringResult including overall score and rating
664
+ */
665
+ declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutput>, config?: any, cliWeights?: Map<string, number>): ScoringResult;
666
+ /**
667
+ * Convert score to rating with project-size and model awareness.
668
+ *
669
+ * Provides a more accurate rating by considering the target model's limits.
670
+ *
671
+ * @param score The numerical AI readiness score
672
+ * @param fileCount Total number of files in the project
673
+ * @param modelTier The model context tier being targeted
674
+ * @returns The size-aware ReadinessRating
675
+ */
676
+ declare function getRatingWithContext(score: number, fileCount: number, modelTier?: ModelContextTier): ReadinessRating;
677
+ /**
678
+ * Get display properties (emoji and color) for a given rating.
679
+ *
680
+ * @param rating The readiness rating category
681
+ * @returns Object containing display emoji and color string
682
+ */
683
+ declare function getRatingDisplay(rating: ReadinessRating | string): {
684
+ emoji: string;
685
+ color: string;
686
+ };
687
+ /**
688
+ * Format overall score for compact console display.
689
+ *
690
+ * @param result The consolidated scoring result
691
+ * @returns Formatted string (e.g., "85/100 (Good) 👍")
692
+ */
693
+ declare function formatScore(result: ScoringResult): string;
694
+ /**
695
+ * Format detailed tool score for expanded console display.
696
+ *
697
+ * Includes breakdown of influencing factors and actionable recommendations.
698
+ *
699
+ * @param output The scoring output for a single tool
700
+ * @returns Multi-line formatted string for console output
701
+ */
702
+ declare function formatToolScore(output: ToolScoringOutput): string;
703
+
704
+ /**
705
+ * Spoke-to-Hub Contract Definitions
706
+ * This file defines the expected JSON structure for tool outputs to ensure
707
+ * changes in spokes don't break the CLI, Platform, or Visualizer.
708
+ */
709
+
710
+ /**
711
+ * Issue overlay on the graph
712
+ */
713
+ interface IssueOverlay {
714
+ id: string;
715
+ type: string;
716
+ severity: string;
717
+ nodeIds: string[];
718
+ edgeIds?: string[];
719
+ message: string;
720
+ details?: string;
721
+ }
722
+ /**
723
+ * Tool Provider Interface
724
+ * Every AIReady spoke must implement this interface to be integrated into the CLI registry.
725
+ */
726
+ interface ToolProvider {
727
+ /** Canonical tool ID */
728
+ id: ToolName;
729
+ /** CLI aliases/shorthand for this tool */
730
+ alias: string[];
731
+ /** Primary analysis logic */
732
+ analyze: (options: ScanOptions) => Promise<SpokeOutput>;
733
+ /** Scoring logic for this tool's output */
734
+ score: (output: SpokeOutput, options: ScanOptions) => ToolScoringOutput;
735
+ /** Optional weight override for this tool */
736
+ defaultWeight?: number;
737
+ }
738
+ /**
739
+ * Validation utility to ensure a spoke's output matches the expected contract.
740
+ * Used in spoke tests to catch breakages early.
741
+ *
742
+ * @param toolName - Name of the tool being validated.
743
+ * @param output - The raw output data to check.
744
+ * @returns Validation result with boolean flag and any errors found.
745
+ */
746
+ declare function validateSpokeOutput(toolName: string, output: any): {
747
+ valid: boolean;
748
+ errors: string[];
749
+ };
750
+ /**
751
+ * Zod-based validation (Round 1 improvement).
752
+ *
753
+ * @param schema - Zod schema to validate against.
754
+ * @param data - Raw data to parse.
755
+ * @returns Result object with valid flag and typed data or errors.
756
+ * @lastUpdated 2026-03-18
757
+ */
758
+ declare function validateWithSchema<T>(schema: z.ZodSchema<T>, data: any): {
759
+ valid: boolean;
760
+ data?: T;
761
+ errors?: string[];
762
+ };
763
+
764
+ /**
765
+ * Shared types for graph-based visualizations
766
+ */
767
+
768
+ /**
769
+ * Base graph node compatible with d3-force simulation
770
+ */
771
+ interface BaseGraphNode {
772
+ id: string;
773
+ x?: number;
774
+ y?: number;
775
+ vx?: number;
776
+ vy?: number;
777
+ fx?: number | null;
778
+ fy?: number | null;
779
+ }
780
+ /**
781
+ * Base graph link compatible with d3-force simulation
782
+ */
783
+ interface BaseGraphLink {
784
+ source: string | BaseGraphNode;
785
+ target: string | BaseGraphNode;
786
+ index?: number;
787
+ }
788
+ /**
789
+ * Full graph node with all metadata
790
+ */
791
+ interface GraphNode extends BaseGraphNode {
792
+ label: string;
793
+ path?: string;
794
+ size?: number;
795
+ value?: number;
796
+ color?: string;
797
+ group?: string;
798
+ title?: string;
799
+ duplicates?: number;
800
+ tokenCost?: number;
801
+ severity?: string;
802
+ }
803
+ interface GraphEdge {
804
+ source: string;
805
+ target: string;
806
+ type?: string;
807
+ weight?: number;
808
+ }
809
+ interface GraphData {
810
+ nodes: GraphNode[];
811
+ edges: GraphEdge[];
812
+ clusters?: {
813
+ id: string;
814
+ name: string;
815
+ nodeIds: string[];
816
+ }[];
817
+ issues?: IssueOverlay[];
818
+ metadata?: GraphMetadata$1;
819
+ /** Whether the graph was truncated due to size limits */
820
+ truncated?: {
821
+ nodes: boolean;
822
+ edges: boolean;
823
+ nodeCount?: number;
824
+ edgeCount?: number;
825
+ nodeLimit?: number;
826
+ edgeLimit?: number;
827
+ };
828
+ }
829
+ /**
830
+ * Metadata about the graph
831
+ */
832
+ interface GraphMetadata$1 {
833
+ projectName?: string;
834
+ timestamp: string;
835
+ totalFiles: number;
836
+ totalDependencies: number;
837
+ analysisTypes: string[];
838
+ totalLinesOfCode?: number;
839
+ totalTokenCost?: number;
840
+ averageComplexity?: number;
841
+ criticalIssues: number;
842
+ majorIssues: number;
843
+ minorIssues: number;
844
+ infoIssues: number;
845
+ estimatedMonthlyCost?: number;
846
+ estimatedDeveloperHours?: number;
847
+ aiAcceptanceRate?: number;
848
+ aiReadinessScore?: number;
849
+ /** AI token budget unit economics (v0.13+) */
850
+ tokenBudget?: any;
851
+ }
852
+
853
+ /**
854
+ * Lead Source identifiers.
855
+ */
856
+ declare enum LeadSource {
857
+ ClawMoreHero = "clawmore-hero",
858
+ ClawMoreWaitlist = "clawmore-waitlist",
859
+ ClawMoreBeta = "clawmore-beta",
860
+ AiReadyPlatform = "aiready-platform"
861
+ }
862
+ /** Zod schema for LeadSource enum */
863
+ declare const LeadSourceSchema: z.ZodEnum<typeof LeadSource>;
864
+ /**
865
+ * Business Lead schema for waitlists and beta signups.
866
+ */
867
+ declare const LeadSchema: z.ZodObject<{
868
+ id: z.ZodString;
869
+ email: z.ZodString;
870
+ name: z.ZodString;
871
+ interest: z.ZodDefault<z.ZodString>;
872
+ notes: z.ZodOptional<z.ZodString>;
873
+ timestamp: z.ZodString;
874
+ source: z.ZodEnum<typeof LeadSource>;
875
+ status: z.ZodDefault<z.ZodEnum<{
876
+ new: "new";
877
+ contacted: "contacted";
878
+ qualified: "qualified";
879
+ converted: "converted";
880
+ archived: "archived";
881
+ }>>;
882
+ }, z.core.$strip>;
883
+ type Lead = z.infer<typeof LeadSchema>;
884
+ /**
885
+ * Lead Submission (input from form)
886
+ */
887
+ declare const LeadSubmissionSchema: z.ZodObject<{
888
+ name: z.ZodString;
889
+ source: z.ZodEnum<typeof LeadSource>;
890
+ email: z.ZodString;
891
+ interest: z.ZodDefault<z.ZodString>;
892
+ notes: z.ZodOptional<z.ZodString>;
893
+ }, z.core.$strip>;
894
+ type LeadSubmission = z.infer<typeof LeadSubmissionSchema>;
895
+ /**
896
+ * Managed AWS Account metadata for the Account Vending Machine.
897
+ */
898
+ declare const ManagedAccountSchema: z.ZodObject<{
899
+ id: z.ZodString;
900
+ accountId: z.ZodString;
901
+ userId: z.ZodString;
902
+ stripeSubscriptionId: z.ZodString;
903
+ tokenStrategy: z.ZodDefault<z.ZodEnum<{
904
+ managed: "managed";
905
+ byok: "byok";
906
+ }>>;
907
+ byokConfig: z.ZodOptional<z.ZodObject<{
908
+ openaiKey: z.ZodOptional<z.ZodString>;
909
+ anthropicKey: z.ZodOptional<z.ZodString>;
910
+ openrouterKey: z.ZodOptional<z.ZodString>;
911
+ }, z.core.$strip>>;
912
+ baseFeeCents: z.ZodDefault<z.ZodNumber>;
913
+ includedComputeCents: z.ZodDefault<z.ZodNumber>;
914
+ includedTokenCents: z.ZodDefault<z.ZodNumber>;
915
+ prepaidTokenBalanceCents: z.ZodDefault<z.ZodNumber>;
916
+ currentMonthlyTokenSpendCents: z.ZodDefault<z.ZodNumber>;
917
+ status: z.ZodDefault<z.ZodEnum<{
918
+ provisioning: "provisioning";
919
+ active: "active";
920
+ warning: "warning";
921
+ quarantined: "quarantined";
922
+ suspended: "suspended";
923
+ }>>;
924
+ lastCostSyncAt: z.ZodOptional<z.ZodString>;
925
+ region: z.ZodDefault<z.ZodString>;
926
+ alertThresholds: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
927
+ }, z.core.$strip>;
928
+ type ManagedAccount = z.infer<typeof ManagedAccountSchema>;
929
+
930
+ /**
931
+ * AI readiness configuration
932
+ */
933
+ type AIReadyConfig = z.infer<typeof AIReadyConfigSchema>;
934
+ /**
935
+ * Legacy alias for Config
936
+ */
937
+ type Config = AIReadyConfig;
938
+ /**
939
+ * Scan options for tool providers
940
+ */
941
+ interface ScanOptions extends ToolOptions {
942
+ /** Target output format */
943
+ output?: string | {
944
+ format: string;
945
+ file?: string;
946
+ };
947
+ /** Visual format (json/console/html) */
948
+ format?: 'json' | 'console' | 'html';
949
+ /** Whether to run in parallel */
950
+ parallel?: boolean;
951
+ }
952
+ /**
953
+ * Result of a single tool execution
954
+ */
955
+ interface ToolOutput {
956
+ /** Unique name/ID of the tool */
957
+ toolName: ToolName | string;
958
+ /** Whether the tool ran successfully */
959
+ success: boolean;
960
+ /** List of issues found by the tool */
961
+ issues: IssueType[] | any[];
962
+ /** Numeric metrics produced by the tool */
963
+ metrics: Metrics;
964
+ /** Execution duration in milliseconds */
965
+ duration?: number;
966
+ }
967
+ /**
968
+ * Overall scan result
969
+ */
970
+ interface ScanResult {
971
+ /** ISO timestamp of the scan */
972
+ timestamp: string;
973
+ /** Root directory analyzed */
974
+ rootDir: string;
975
+ /** Number of files processed */
976
+ filesAnalyzed: number;
977
+ /** Total issues found across all tools */
978
+ totalIssues: number;
979
+ /** Breakdown of issue counts by type */
980
+ issuesByType: Record<string, number>;
981
+ /** Breakdown of issue counts by severity */
982
+ issuesBySeverity: Record<Severity | string, number>;
983
+ /** Final calculated AIReady score (0-100) */
984
+ score: number;
985
+ /** Individual tool outputs */
986
+ tools: ToolOutput[];
987
+ }
988
+ /**
989
+ * Cost configuration for business impact analysis
990
+ */
991
+ interface CostConfig {
992
+ /** Price in USD per 1,000 tokens */
993
+ pricePer1KTokens: number;
994
+ /** Average number of AI queries per developer per day */
995
+ queriesPerDevPerDay: number;
996
+ /** Total number of developers in the team */
997
+ developerCount: number;
998
+ /** Working days per month */
999
+ daysPerMonth: number;
1000
+ }
1001
+ /**
1002
+ * Productivity impact metrics
1003
+ */
1004
+ interface ProductivityImpact {
1005
+ /** Estimated developer hours wasted on quality issues */
1006
+ totalHours: number;
1007
+ /** Developer hourly rate used for calculation */
1008
+ hourlyRate: number;
1009
+ /** Estimated total monthly cost of productivity loss */
1010
+ totalCost: number;
1011
+ /** Impact breakdown by severity */
1012
+ bySeverity: Record<Severity | string, {
1013
+ /** Hours lost for this severity level */
1014
+ hours: number;
1015
+ /** Cost associated with these hours */
1016
+ cost: number;
1017
+ }>;
1018
+ }
1019
+ /**
1020
+ * AI suggestion acceptance prediction
1021
+ */
1022
+ interface AcceptancePrediction {
1023
+ /** Predicted acceptance rate (0-1) */
1024
+ rate: number;
1025
+ /** Confidence level of the prediction (0-1) */
1026
+ confidence: number;
1027
+ /** Qualitative factors influencing the prediction */
1028
+ factors: Array<{
1029
+ /** Factor name */
1030
+ name: string;
1031
+ /** Impact weight (-100 to 100) */
1032
+ impact: number;
1033
+ }>;
1034
+ }
1035
+ /**
1036
+ * Technical Value Chain summary
1037
+ */
1038
+ interface TechnicalValueChain {
1039
+ /** Overall business value score for the component */
1040
+ score?: number;
1041
+ /** Business logic density (e.g. core vs boilerplate) */
1042
+ density?: number;
1043
+ /** Data access layer complexity */
1044
+ complexity?: number;
1045
+ /** API surface area and exposure */
1046
+ surface?: number;
1047
+ /** Issue type associated with this chain */
1048
+ issueType?: string;
1049
+ /** Name of the leading technical metric */
1050
+ technicalMetric?: string;
1051
+ /** Raw value of the technical metric */
1052
+ technicalValue?: number;
1053
+ /** Impact on AI agents */
1054
+ aiImpact?: {
1055
+ description: string;
1056
+ scoreImpact: number;
1057
+ };
1058
+ /** Impact on developer experience */
1059
+ developerImpact?: {
1060
+ description: string;
1061
+ productivityLoss: number;
1062
+ };
1063
+ /** Predicted business outcome */
1064
+ businessOutcome?: {
1065
+ directCost: number;
1066
+ opportunityCost: number;
1067
+ riskLevel: 'low' | 'moderate' | 'high' | 'critical';
1068
+ };
1069
+ }
1070
+ /**
1071
+ * Compatibility alias
1072
+ */
1073
+ type TechnicalValueChainSummary = TechnicalValueChain;
1074
+ /**
1075
+ * Code comprehension difficulty metrics
1076
+ */
1077
+ interface ComprehensionDifficulty {
1078
+ /** Overall difficulty score (0-100) */
1079
+ score: number;
1080
+ /** Descriptive rating of difficulty */
1081
+ rating: 'trivial' | 'easy' | 'moderate' | 'difficult' | 'expert';
1082
+ /** Ratios and factors contributing to difficulty */
1083
+ factors: {
1084
+ /** Ratio of file tokens to model context limit */
1085
+ budgetRatio: number;
1086
+ /** Relative depth of dependency tree */
1087
+ depthRatio: number;
1088
+ /** Level of logical fragmentation */
1089
+ fragmentation: number;
1090
+ };
1091
+ }
1092
+ /**
1093
+ * Business impact metrics (v0.10+)
1094
+ */
1095
+ interface BusinessMetrics {
1096
+ /** Predicted monthly cost of technical waste */
1097
+ estimatedMonthlyCost?: number;
1098
+ /** Estimated developer hours lost per month */
1099
+ estimatedDeveloperHours?: number;
1100
+ /** Predicted rate of AI suggestion acceptance */
1101
+ aiAcceptanceRate?: number;
1102
+ /** Overall AI readiness score */
1103
+ aiReadinessScore?: number;
1104
+ }
1105
+ /**
1106
+ * Canonical file content structure
1107
+ */
1108
+ interface FileContent {
1109
+ /** Absolute or relative file path */
1110
+ file: string;
1111
+ /** UTF-8 file content */
1112
+ content: string;
1113
+ }
1114
+ /**
1115
+ * Constants for tests and configuration stability
1116
+ */
1117
+ declare const GLOBAL_INFRA_OPTIONS: string[];
1118
+ declare const GLOBAL_SCAN_OPTIONS: string[];
1119
+ declare const COMMON_FINE_TUNING_OPTIONS: string[];
1120
+
1121
+ /**
1122
+ * Analysis issue mapping to graph
1123
+ */
1124
+ type GraphIssueSeverity = Severity;
1125
+ /**
1126
+ * Graph metadata
1127
+ */
1128
+ interface GraphMetadata {
1129
+ /** Project name if available */
1130
+ projectName?: string;
1131
+ /** ISO timestamp of analysis */
1132
+ timestamp: string;
1133
+ /** Total number of files in the graph */
1134
+ totalFiles: number;
1135
+ /** Total dependency edges in the graph */
1136
+ totalDependencies: number;
1137
+ /** Types of analysis performed */
1138
+ analysisTypes: string[];
1139
+ /** Count of critical issues in graph nodes */
1140
+ criticalIssues: number;
1141
+ /** Count of major issues in graph nodes */
1142
+ majorIssues: number;
1143
+ /** Count of minor issues in graph nodes */
1144
+ minorIssues: number;
1145
+ /** Count of informational issues in graph nodes */
1146
+ infoIssues: number;
1147
+ /** AI token budget unit economics (v0.13+) */
1148
+ tokenBudget?: TokenBudget;
1149
+ /** Execution time in milliseconds */
1150
+ executionTime?: number;
1151
+ }
1152
+
1153
+ /**
1154
+ * Language-agnostic AST and parser interfaces for multi-language support
1155
+ *
1156
+ * This module provides abstractions for parsing different programming languages
1157
+ * while maintaining a consistent interface for analysis tools.
1158
+ */
1159
+
1160
+ /**
1161
+ * Supported programming languages
1162
+ */
1163
+ declare enum Language {
1164
+ TypeScript = "typescript",
1165
+ JavaScript = "javascript",
1166
+ Python = "python",
1167
+ Java = "java",
1168
+ Go = "go",
1169
+ Rust = "rust",
1170
+ CSharp = "csharp"
1171
+ }
1172
+ /**
1173
+ * File extensions mapped to languages
1174
+ */
1175
+ declare const LANGUAGE_EXTENSIONS: Record<string, Language>;
1176
+ /**
1177
+ * Common AST node type (language-agnostic)
1178
+ */
1179
+ interface CommonASTNode {
1180
+ type: string;
1181
+ loc?: SourceRange;
1182
+ raw?: any;
1183
+ }
1184
+ /**
1185
+ * Export information (function, class, variable, etc.)
1186
+ */
1187
+ interface ExportInfo {
1188
+ name: string;
1189
+ type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default' | 'variable';
1190
+ loc?: SourceRange;
1191
+ /** Imports used within this export */
1192
+ imports?: string[];
1193
+ /** Dependencies on other exports in same file */
1194
+ dependencies?: string[];
1195
+ /** TypeScript types referenced */
1196
+ typeReferences?: string[];
1197
+ /** For methods: parent class name */
1198
+ parentClass?: string;
1199
+ /** For functions/methods: parameters */
1200
+ parameters?: string[];
1201
+ /** For classes/interfaces: number of methods and properties */
1202
+ methodCount?: number;
1203
+ propertyCount?: number;
1204
+ /** Visibility (public, private, protected) */
1205
+ visibility?: 'public' | 'private' | 'protected';
1206
+ /** Whether the value is a primitive (string, number, boolean) */
1207
+ isPrimitive?: boolean;
1208
+ /** Behavioral metadata for advanced metrics */
1209
+ isPure?: boolean;
1210
+ hasSideEffects?: boolean;
1211
+ /** Associated documentation */
1212
+ documentation?: {
1213
+ content: string;
1214
+ type: 'jsdoc' | 'docstring' | 'comment' | 'xml-doc';
1215
+ loc?: SourceRange;
1216
+ isStale?: boolean;
1217
+ };
1218
+ }
1219
+ /**
1220
+ * Parse result containing exports and imports
1221
+ */
1222
+ interface ParseResult {
1223
+ exports: ExportInfo[];
1224
+ imports: FileImport[];
1225
+ /** Language of the parsed file */
1226
+ language: Language;
1227
+ /** Any parse warnings (non-fatal) */
1228
+ warnings?: string[];
1229
+ }
1230
+ /**
1231
+ * Naming convention rules per language
1232
+ */
1233
+ interface NamingConvention {
1234
+ /** Allowed variable naming patterns */
1235
+ variablePattern: RegExp;
1236
+ /** Allowed function naming patterns */
1237
+ functionPattern: RegExp;
1238
+ /** Allowed class naming patterns */
1239
+ classPattern: RegExp;
1240
+ /** Allowed constant naming patterns */
1241
+ constantPattern: RegExp;
1242
+ /** Allowed type naming patterns */
1243
+ typePattern?: RegExp;
1244
+ /** Allowed interface naming patterns */
1245
+ interfacePattern?: RegExp;
1246
+ /** Language-specific exceptions (e.g., __init__ in Python) */
1247
+ exceptions?: string[];
1248
+ }
1249
+ /**
1250
+ * Language-specific configuration
1251
+ */
1252
+ interface LanguageConfig {
1253
+ language: Language;
1254
+ /** File extensions for this language */
1255
+ extensions: string[];
1256
+ /** Naming conventions */
1257
+ namingConventions: NamingConvention;
1258
+ /** Common abbreviations allowed */
1259
+ allowedAbbreviations?: string[];
1260
+ /** Language-specific keywords to ignore */
1261
+ keywords?: string[];
1262
+ }
1263
+ /**
1264
+ * Abstract interface for language parsers
1265
+ * Each language implementation should implement this interface
1266
+ */
1267
+ interface LanguageParser {
1268
+ /** Language this parser handles */
1269
+ readonly language: Language;
1270
+ /** File extensions this parser supports */
1271
+ readonly extensions: string[];
1272
+ /**
1273
+ * Parse source code and extract structure
1274
+ * @param code - Source code to parse
1275
+ * @param filePath - Path to the file (for context)
1276
+ * @returns Parse result with exports and imports
1277
+ * @throws ParseError if code has syntax errors
1278
+ */
1279
+ parse(code: string, filePath: string): ParseResult;
1280
+ /**
1281
+ * Get naming conventions for this language
1282
+ */
1283
+ getNamingConventions(): NamingConvention;
1284
+ /**
1285
+ * Initialize the parser (e.g. load WASM)
1286
+ */
1287
+ initialize(): Promise<void>;
1288
+ /**
1289
+ * Check if this parser can handle a file
1290
+ * @param filePath - File path to check
1291
+ */
1292
+ canHandle(filePath: string): boolean;
1293
+ /**
1294
+ * Get the raw AST for advanced querying
1295
+ * @param code - Source code to parse
1296
+ * @param filePath - Path to the file
1297
+ */
1298
+ getAST(code: string, filePath: string): Promise<any>;
1299
+ /**
1300
+ * Analyze structural metadata for a node (e.g. purity)
1301
+ * @param node - The AST node to analyze (language specific)
1302
+ * @param code - The original source code
1303
+ */
1304
+ analyzeMetadata(node: any, code: string): Partial<ExportInfo>;
1305
+ }
1306
+ /**
1307
+ * Parser error with location information
1308
+ */
1309
+ declare class ParseError extends Error {
1310
+ readonly filePath: string;
1311
+ readonly loc?: SourceLocation | undefined;
1312
+ constructor(message: string, filePath: string, loc?: SourceLocation | undefined);
1313
+ }
1314
+ /**
1315
+ * Statistics about parsed code
1316
+ */
1317
+ interface ParseStatistics {
1318
+ language: Language;
1319
+ filesAnalyzed: number;
1320
+ totalExports: number;
1321
+ totalImports: number;
1322
+ parseErrors: number;
1323
+ warnings: number;
1324
+ }
1325
+
1326
+ /**
1327
+ * Visualization utilities for generating HTML from graph data
1328
+ */
1329
+
1330
+ /**
1331
+ * Generate HTML visualization from graph data
1332
+ * Creates an interactive HTML page with a canvas-based graph visualization
1333
+ *
1334
+ * @param graph - The graph data to visualize
1335
+ * @returns HTML string representing the interactive visualization
1336
+ */
1337
+ declare function generateHTML(graph: GraphData): string;
1338
+
1339
+ export { LeadSchema as $, type AnalysisResult as A, type BusinessMetrics as B, type CostConfig as C, DEFAULT_TOOL_WEIGHTS as D, type ExportWithImports as E, type FileImport as F, GLOBAL_INFRA_OPTIONS as G, GLOBAL_SCAN_OPTIONS as H, type Issue as I, type GraphData as J, type GraphEdge as K, type LanguageParser as L, type Metrics as M, type NamingConvention as N, type GraphIssueSeverity as O, type ProductivityImpact as P, type GraphMetadata as Q, type GraphNode as R, type ScanOptions as S, type ToolProvider as T, type IssueOverlay as U, IssueSchema as V, IssueType as W, IssueTypeSchema as X, LANGUAGE_EXTENSIONS as Y, type LanguageConfig as Z, type Lead as _, ToolName as a, LeadSource as a0, LeadSourceSchema as a1, type LeadSubmission as a2, LeadSubmissionSchema as a3, type Location as a4, LocationSchema as a5, type ManagedAccount as a6, ManagedAccountSchema as a7, MetricsSchema as a8, ModelTier as a9, getPriorityIcon as aA, getProjectSizeTier as aB, getRating as aC, getRatingDisplay as aD, getRatingEmoji as aE, getRatingLabel as aF, getRatingMetadata as aG, getRatingSlug as aH, getRatingWithContext as aI, getRecommendedThreshold as aJ, getToolEmoji as aK, getToolWeight as aL, normalizeToolName as aM, parseWeightString as aN, validateSpokeOutput as aO, validateWithSchema as aP, type BaseGraphLink as aQ, type BaseGraphNode as aR, ModelTierSchema as aa, ParseError as ab, type ParseStatistics as ac, ReadinessRating as ad, RecommendationPriority as ae, SCORING_PROFILES as af, SIZE_ADJUSTED_THRESHOLDS as ag, type ScanResult as ah, type ScoringConfig as ai, ScoringProfile as aj, type ScoringResult as ak, SeveritySchema as al, type SourceLocation as am, type SourceRange as an, SpokeOutputSchema as ao, type SpokeSummary as ap, SpokeSummarySchema as aq, TOOL_NAME_MAP as ar, ToolNameSchema as as, type ToolOutput as at, type UnifiedReport as au, UnifiedReportSchema as av, calculateOverallScore as aw, formatScore as ax, formatToolScore as ay, generateHTML as az, type ToolOptions as b, Severity as c, type ToolScoringOutput as d, type SpokeOutput as e, type AIReadyConfig as f, type ModelContextTier as g, type TokenBudget as h, type AcceptancePrediction as i, type ComprehensionDifficulty as j, type TechnicalValueChainSummary as k, type TechnicalValueChain as l, Language as m, type ParseResult as n, type ExportInfo as o, AIReadyConfigSchema as p, type ASTNode as q, AnalysisResultSchema as r, AnalysisStatus as s, AnalysisStatusSchema as t, COMMON_FINE_TUNING_OPTIONS as u, CONTEXT_TIER_THRESHOLDS as v, type CommonASTNode as w, type Config as x, FRIENDLY_TOOL_NAMES as y, type FileContent as z };