@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
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, I as Issue, M as Metrics, f as ModelContextTier, C as CostConfig, g as TokenBudget, P as ProductivityImpact, h as AcceptancePrediction, i as ComprehensionDifficulty, j as TechnicalValueChainSummary, k as TechnicalValueChain, L as LanguageParser, l as Language, m as ParseResult, N as NamingConvention, n as ExportInfo } from './client-jGuH6TAG.mjs';
2
- export { o as AIReadyConfigSchema, p as ASTNode, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, w as Config, D as DEFAULT_TOOL_WEIGHTS, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, R as IssueSchema, U as IssueType, V as IssueTypeSchema, W as LANGUAGE_EXTENSIONS, X as LanguageConfig, Y as Lead, Z as LeadSchema, _ as LeadSource, $ as LeadSourceSchema, a0 as LeadSubmission, a1 as LeadSubmissionSchema, a2 as Location, a3 as LocationSchema, a4 as ManagedAccount, a5 as ManagedAccountSchema, a6 as MetricsSchema, a7 as ModelTier, a8 as ModelTierSchema, a9 as ParseError, aa as ParseStatistics, ab as ReadinessRating, ac as RecommendationPriority, ad as SCORING_PROFILES, ae as SIZE_ADJUSTED_THRESHOLDS, af as ScanResult, ag as ScoringConfig, ah as ScoringProfile, ai as ScoringResult, aj as SeveritySchema, ak as SourceLocation, al as SourceRange, am as SpokeOutputSchema, an as SpokeSummary, ao as SpokeSummarySchema, ap as TOOL_NAME_MAP, aq as ToolNameSchema, ar as ToolOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getPriorityIcon, az as getProjectSizeTier, aA as getRating, aB as getRatingDisplay, aC as getRatingEmoji, aD as getRatingLabel, aE as getRatingSlug, aF as getRatingWithContext, aG as getRecommendedThreshold, aH as getToolEmoji, aI as getToolWeight, aJ as normalizeToolName, aK as parseWeightString } from './client-jGuH6TAG.mjs';
1
+ import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, I as Issue, M as Metrics, f as TechnicalValueChain, g as ModelContextTier, C as CostConfig, h as TokenBudget, P as ProductivityImpact, i as AcceptancePrediction, j as ComprehensionDifficulty, k as TechnicalValueChainSummary, L as Language, l as LanguageParser, m as ParseResult, N as NamingConvention, n as ExportInfo } from './index-Ctl_0z6F.mjs';
2
+ export { o as AIReadyConfigSchema, p as ASTNode, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, w as Config, D as DEFAULT_TOOL_WEIGHTS, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, Y as LanguageConfig, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, a5 as ManagedAccount, a6 as ManagedAccountSchema, a7 as MetricsSchema, a8 as ModelTier, a9 as ModelTierSchema, aa as ParseError, ab as ParseStatistics, ac as ReadinessRating, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, ak as SeveritySchema, al as SourceLocation, am as SourceRange, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, ar as ToolNameSchema, as as ToolOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, az as getPriorityIcon, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aD as getRatingEmoji, aE as getRatingLabel, aF as getRatingMetadata, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aJ as getToolEmoji, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from './index-Ctl_0z6F.mjs';
3
3
  import { z } from 'zod';
4
+ import * as chalk from 'chalk';
4
5
  import * as Parser from 'web-tree-sitter';
5
6
 
6
7
  /**
@@ -237,7 +238,22 @@ declare function loadMergedConfig<T extends Record<string, any>>(directory: stri
237
238
  */
238
239
  declare function handleJSONOutput(data: any, outputFile?: string, successMessage?: string): void;
239
240
  /**
240
- * Common error handler for CLI commands.
241
+ * Get a formatted terminal divider string based on current terminal width.
242
+ *
243
+ * @param color - Chalk color function to use for the divider.
244
+ * @param maxWidth - Maximum width for the divider (default: 60).
245
+ * @returns String representation of the divider.
246
+ */
247
+ declare function getTerminalDivider(color?: any, maxWidth?: number): string;
248
+ /**
249
+ * Print a standard terminal header with dividers.
250
+ *
251
+ * @param title - Header title text.
252
+ * @param color - Chalk color function for the dividers.
253
+ */
254
+ declare function printTerminalHeader(title: string, color?: any): void;
255
+ /**
256
+ * Common CLI error handler for CLI commands.
241
257
  * Logs error and exits process with code 1.
242
258
  *
243
259
  * @param error - Error object or message.
@@ -333,6 +349,61 @@ declare function findLatestReport(dirPath: string): string | null;
333
349
  */
334
350
  declare function findLatestScanReport(scanReportsDir: string, reportFilePrefix: string): string | null;
335
351
 
352
+ /**
353
+ * Generate timestamp for report filenames (YYYYMMDD-HHMMSS)
354
+ * Provides better granularity than date-only filenames
355
+ */
356
+ declare function getReportTimestamp(): string;
357
+ /**
358
+ * Interface for CLI action output parameters
359
+ */
360
+ interface JSONOutputParams {
361
+ outputData: any;
362
+ outputFile?: string;
363
+ resolvedDir: string;
364
+ prefix?: string;
365
+ }
366
+ /**
367
+ * Standard JSON output handler for CLI actions.
368
+ * Consolidates path resolution and output handling.
369
+ */
370
+ declare function handleStandardJSONOutput({ outputData, outputFile, resolvedDir, prefix, }: JSONOutputParams): void;
371
+ /**
372
+ * Resolves the output format and file path from CLI options and merged config.
373
+ */
374
+ declare function resolveOutputFormat(options: {
375
+ output?: string;
376
+ outputFile?: string;
377
+ }, config: {
378
+ output?: {
379
+ format?: string;
380
+ file?: string;
381
+ };
382
+ }): {
383
+ format: string;
384
+ file: string | undefined;
385
+ };
386
+ /**
387
+ * Common configuration preparation for CLI actions.
388
+ * Resolves directory and merges configuration.
389
+ */
390
+ declare function prepareActionConfig<T extends Record<string, any>>(directory: string, defaults: T, cliOptions: Partial<T>): Promise<{
391
+ resolvedDir: string;
392
+ finalOptions: T & {
393
+ rootDir: string;
394
+ };
395
+ }>;
396
+ /**
397
+ * Formats report data for standard JSON output including timing and scoring.
398
+ */
399
+ declare function formatStandardReport(params: {
400
+ results?: any;
401
+ report?: any;
402
+ summary: any;
403
+ elapsedTime: string;
404
+ score?: ToolScoringOutput;
405
+ }): any;
406
+
336
407
  /**
337
408
  * Groups a flat array of issues by their `location.file` path into the
338
409
  * `AnalysisResult[]` shape expected by `SpokeOutputSchema`.
@@ -403,10 +474,10 @@ declare function calculateImportSimilarity(export1: ExportWithImports, export2:
403
474
  * @param filePath - Path to the file (used for language detection and AST metadata)
404
475
  * @returns Object containing all identified exports and imports
405
476
  */
406
- declare function parseFileExports(code: string, filePath: string): {
477
+ declare function parseFileExports(code: string, filePath: string): Promise<{
407
478
  exports: ExportWithImports[];
408
479
  imports: FileImport[];
409
- };
480
+ }>;
410
481
 
411
482
  /**
412
483
  * Estimate token count for text (rough approximation)
@@ -429,8 +500,10 @@ declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
429
500
  declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
430
501
 
431
502
  /**
432
- * Shared HTML report builder utility
503
+ * Shared HTML report formatting utilities.
433
504
  * Provides common template parts for generating self-contained HTML reports.
505
+ *
506
+ * @lastUpdated 2026-03-24
434
507
  */
435
508
  interface ReportOptions {
436
509
  title: string;
@@ -450,27 +523,39 @@ interface TableConfig {
450
523
  rows: string[][];
451
524
  }
452
525
  /**
453
- * Generate the HTML document head with common styles
526
+ * Generate the HTML document head with common styles.
454
527
  */
455
528
  declare function generateReportHead(title: string): string;
456
529
  /**
457
- * Generate stat cards section
530
+ * Generate a hero section for the report.
531
+ */
532
+ declare function generateReportHero(title: string, subtitle?: string): string;
533
+ /**
534
+ * Generate stat cards section.
458
535
  */
459
536
  declare function generateStatCards(cards: StatCard[]): string;
460
537
  /**
461
- * Generate an HTML table from config
538
+ * Generate a score card with a single large value.
539
+ */
540
+ declare function generateScoreCard(value: string | number, label: string): string;
541
+ /**
542
+ * Generate an HTML table from configuration.
462
543
  */
463
544
  declare function generateTable(config: TableConfig): string;
464
545
  /**
465
- * Generate the report footer
546
+ * Generate an issue summary card.
547
+ */
548
+ declare function generateIssueSummary(critical: number, major: number, minor: number, potentialSavings?: number): string;
549
+ /**
550
+ * Generate the report footer.
466
551
  */
467
552
  declare function generateReportFooter(options: ReportOptions): string;
468
553
  /**
469
- * Wrap content in a card div
554
+ * Wrap content in a card div.
470
555
  */
471
556
  declare function wrapInCard(content: string, title?: string): string;
472
557
  /**
473
- * Generate a complete report by combining all parts
558
+ * Generate a complete report by combining all parts.
474
559
  */
475
560
  declare function generateCompleteReport(options: ReportOptions, bodyContent: string): string;
476
561
 
@@ -492,144 +577,130 @@ declare function normalizeAnalysisResult(raw: any): AnalysisResult;
492
577
  declare function normalizeSpokeOutput(raw: any, toolName: string): SpokeOutput;
493
578
 
494
579
  /**
495
- * AI model pricing presets for cost estimation.
496
- * Prices are input token costs per 1K tokens (USD), as of Q1 2026.
580
+ * Standard parameters for building a ToolScoringOutput.
497
581
  */
498
- interface ModelPricingPreset {
499
- name: string;
500
- pricePer1KInputTokens: number;
501
- pricePer1KOutputTokens: number;
502
- contextTier: ModelContextTier;
503
- /** Approximate daily queries per active dev for this model class */
504
- typicalQueriesPerDevPerDay: number;
582
+ interface StandardScoringParams {
583
+ toolName: ToolName | string;
584
+ score: number;
585
+ rawData: Record<string, any>;
586
+ dimensions: Record<string, number>;
587
+ dimensionNames: Record<string, string>;
588
+ recommendations: string[];
589
+ recommendationImpact?: number;
590
+ rating?: string;
505
591
  }
506
- declare const MODEL_PRICING_PRESETS: Record<string, ModelPricingPreset>;
507
592
  /**
508
- * Get a model pricing preset by ID, with fallback to claude-4.6 (2026 default)
593
+ * Common factor builder logic.
594
+ * Map dimension scores to standard factor objects with -50 impact baseline.
509
595
  */
510
- declare function getModelPreset(modelId: string): ModelPricingPreset;
596
+ declare function buildFactorsFromDimensions(dimensions: Record<string, number>, dimensionNames: Record<string, string>, rawData: Record<string, any>): ToolScoringOutput['factors'];
597
+ /**
598
+ * Unified tool scoring output builder.
599
+ */
600
+ declare function buildStandardToolScore(params: StandardScoringParams): ToolScoringOutput;
511
601
 
512
602
  /**
513
- * Default cost configuration
603
+ * Calculate Jaccard similarity between two strings.
604
+ * Splitting by non-alphanumeric to be robust across different programming languages and formats.
605
+ *
606
+ * @param a - First string for comparison.
607
+ * @param b - Second string for comparison.
608
+ * @returns Similarity score between 0 and 1.
514
609
  */
515
- declare const DEFAULT_COST_CONFIG: CostConfig;
610
+ declare function calculateStringSimilarity(a: string, b: string): number;
516
611
  /**
517
- * Calculate estimated monthly cost of AI context waste
612
+ * Calculate heuristic confidence score for a duplicate or pattern detection.
613
+ * Considers similarity, block size, and structural match.
614
+ *
615
+ * @param similarity - Similarity score (0-1).
616
+ * @param tokens - Token count of the code block.
617
+ * @param lines - Line count of the code block.
618
+ * @returns Confidence score between 0 and 1.
518
619
  */
519
- declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig>, options?: {
520
- avgContextBudget?: number;
521
- fragmentationScore?: number;
522
- potentialSavings?: number;
523
- }): {
524
- total: number;
525
- range: [number, number];
526
- confidence: number;
527
- };
620
+ declare function calculateHeuristicConfidence(similarity: number, tokens: number, lines: number): number;
621
+
528
622
  /**
529
- * Calculate precise Token ROI from analyzer metrics.
623
+ * Standard progress callback for AIReady spoke tools.
624
+ * Unified to remove structural duplication across spokes.
530
625
  *
531
- * This is the "Value-Led" monetization engine that quantifies the
532
- * "Context Tax" savings for a team.
626
+ * @param toolName - The name of the tool reporting progress.
533
627
  */
534
- declare function calculateDetailedTokenROI(params: {
535
- totalTokens: number;
536
- avgContextBudget: number;
537
- potentialSavings: number;
538
- fragmentationScore: number;
539
- developerCount: number;
540
- queriesPerDevPerDay?: number;
541
- }): {
542
- monthlySavings: number;
543
- contextTaxPerDev: number;
544
- efficiencyGain: number;
545
- };
628
+ declare function createStandardProgressCallback(toolName: string): (processed: number, total: number, message: string) => void;
546
629
  /**
547
- * Calculate token budget and unit economics
630
+ * Standard result formatter for CLI output.
631
+ *
632
+ * @param toolName - Canonical ToolName.
633
+ * @param score - Calculated readiness score (0-100).
634
+ * @param issuesCount - Number of identified issues.
548
635
  */
549
- declare function calculateTokenBudget(params: {
550
- totalContextTokens: number;
551
- estimatedResponseTokens?: number;
552
- wastedTokens: {
553
- duplication: number;
554
- fragmentation: number;
555
- chattiness: number;
556
- };
557
- }): TokenBudget;
636
+ declare function formatStandardCliResult(toolName: string, score: number, issuesCount: number): void;
558
637
  /**
559
- * Estimate dollar cost from a token budget
638
+ * Common CLI action helper to unify try-catch and output handling.
560
639
  */
561
- declare function estimateCostFromBudget(budget: TokenBudget, model: ModelPricingPreset, config?: Partial<CostConfig>): {
562
- total: number;
563
- range: [number, number];
564
- confidence: number;
565
- };
640
+ declare function runStandardCliAction(toolName: string, action: () => Promise<{
641
+ score: number;
642
+ issuesCount: number;
643
+ }>): Promise<void>;
566
644
 
567
645
  /**
568
- * Severity time estimates (hours to fix)
646
+ * Interface for standard CLI report data
569
647
  */
570
- declare const SEVERITY_TIME_ESTIMATES: {
571
- critical: number;
572
- major: number;
573
- minor: number;
574
- info: number;
575
- };
648
+ interface StandardReportData {
649
+ title: string;
650
+ subtitle?: string;
651
+ score: number;
652
+ rating: string;
653
+ dimensions: Array<{
654
+ name: string;
655
+ value: number;
656
+ label?: string;
657
+ }>;
658
+ stats?: Array<{
659
+ label: string;
660
+ value: string | number;
661
+ }>;
662
+ issues: Array<{
663
+ severity: Severity | string;
664
+ message: string;
665
+ suggestion?: string;
666
+ }>;
667
+ recommendations?: string[];
668
+ elapsedTime: string;
669
+ noIssuesMessage?: string;
670
+ safetyRating?: string;
671
+ }
576
672
  /**
577
- * Calculate productivity impact from issues
673
+ * Get color for score values
578
674
  */
579
- declare function calculateProductivityImpact(issues: {
580
- severity: string;
581
- }[], hourlyRate?: number): ProductivityImpact;
675
+ declare function getScoreColor(score: number): chalk.ChalkInstance;
582
676
  /**
583
- * Predict AI suggestion acceptance rate
677
+ * Display a standardized console report for any AIReady spoke CLI
678
+ *
679
+ * @param data - The report data to display
680
+ * @lastUpdated 2026-03-22
584
681
  */
585
- declare function predictAcceptanceRate(toolOutputs: Map<string, ToolScoringOutput>): AcceptancePrediction;
682
+ declare function displayStandardConsoleReport(data: StandardReportData): void;
586
683
 
587
684
  /**
588
- * Knowledge and Technical Debt Risk Metrics
685
+ * Logical code block extracted from source
589
686
  */
590
- interface KnowledgeConcentrationRisk {
591
- score: number;
592
- rating: 'low' | 'moderate' | 'high' | 'critical';
593
- analysis: {
594
- uniqueConceptFiles: number;
595
- totalFiles: number;
596
- concentrationRatio: number;
597
- singleAuthorFiles: number;
598
- orphanFiles: number;
599
- };
600
- recommendations: string[];
601
- }
602
- declare function calculateKnowledgeConcentration(params: {
603
- uniqueConceptFiles: number;
604
- totalFiles: number;
605
- singleAuthorFiles: number;
606
- orphanFiles: number;
607
- }): KnowledgeConcentrationRisk;
608
- interface TechnicalDebtInterest {
609
- monthlyRate: number;
610
- annualRate: number;
611
- principal: number;
612
- projections: {
613
- months6: number;
614
- months12: number;
615
- months24: number;
616
- };
617
- monthlyCost: number;
687
+ interface CodeBlock {
688
+ file: string;
689
+ startLine: number;
690
+ endLine: number;
691
+ code: string;
692
+ tokens: number;
693
+ patternType: string;
618
694
  }
619
- declare function calculateDebtInterest(principal: number, monthlyGrowthRate: number): TechnicalDebtInterest;
620
-
621
695
  /**
622
- * Calculate Technical Value Chain
696
+ * Infer the type of code pattern based on keywords and naming conventions.
623
697
  */
624
- declare function calculateTechnicalValueChain(params: {
625
- businessLogicDensity: number;
626
- dataAccessComplexity: number;
627
- apiSurfaceArea: number;
628
- }): TechnicalValueChainSummary;
698
+ declare function inferPatternType(keyword: string, name: string): string;
629
699
  /**
630
- * Calculate Comprehension Difficulty Index (CDI)
700
+ * Split file content into logical blocks (functions, classes, methods)
701
+ * Handles TS/JS, Java, C#, Go, and Python (via indentation)
631
702
  */
632
- declare function calculateComprehensionDifficulty(contextBudget: number, importDepth: number, fragmentation: number, modelTier?: ModelContextTier | string): ComprehensionDifficulty;
703
+ declare function extractCodeBlocks(file: string, content: string): CodeBlock[];
633
704
 
634
705
  /**
635
706
  * Business Value Metrics Module.
@@ -638,7 +709,6 @@ declare function calculateComprehensionDifficulty(contextBudget: number, importD
638
709
  *
639
710
  * @lastUpdated 2026-03-18
640
711
  */
641
-
642
712
  /**
643
713
  * Historical score entry for trend tracking.
644
714
  * Used to store and compare results across different points in time.
@@ -699,7 +769,6 @@ declare function calculateBusinessROI(params: {
699
769
  /** Projected total annual business value gained */
700
770
  annualValue: number;
701
771
  };
702
-
703
772
  /**
704
773
  * Format currency value for display in console or reports.
705
774
  *
@@ -745,26 +814,164 @@ declare function generateValueChain(params: {
745
814
  }): TechnicalValueChain;
746
815
 
747
816
  /**
748
- * Parser Factory - Manages language-specific parsers
817
+ * AI model pricing presets for cost estimation.
818
+ * Prices are input token costs per 1K tokens (USD), as of Q1 2026.
819
+ */
820
+ interface ModelPricingPreset {
821
+ name: string;
822
+ pricePer1KInputTokens: number;
823
+ pricePer1KOutputTokens: number;
824
+ contextTier: ModelContextTier;
825
+ /** Approximate daily queries per active dev for this model class */
826
+ typicalQueriesPerDevPerDay: number;
827
+ }
828
+ declare const MODEL_PRICING_PRESETS: Record<string, ModelPricingPreset>;
829
+ /**
830
+ * Get a model pricing preset by ID, with fallback to claude-4.6 (2026 default)
831
+ */
832
+ declare function getModelPreset(modelId: string): ModelPricingPreset;
833
+
834
+ /**
835
+ * Default cost configuration
836
+ */
837
+ declare const DEFAULT_COST_CONFIG: CostConfig;
838
+ /**
839
+ * Calculate estimated monthly cost of AI context waste
840
+ */
841
+ declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig>, options?: {
842
+ avgContextBudget?: number;
843
+ fragmentationScore?: number;
844
+ potentialSavings?: number;
845
+ }): {
846
+ total: number;
847
+ range: [number, number];
848
+ confidence: number;
849
+ };
850
+ /**
851
+ * Calculate precise Token ROI from analyzer metrics.
749
852
  *
750
- * This factory provides a centralized way to access the appropriate parser
751
- * for a given file based on its extension.
853
+ * This is the "Value-Led" monetization engine that quantifies the
854
+ * "Context Tax" savings for a team.
752
855
  */
856
+ declare function calculateDetailedTokenROI(params: {
857
+ totalTokens: number;
858
+ avgContextBudget: number;
859
+ potentialSavings: number;
860
+ fragmentationScore: number;
861
+ developerCount: number;
862
+ queriesPerDevPerDay?: number;
863
+ }): {
864
+ monthlySavings: number;
865
+ contextTaxPerDev: number;
866
+ efficiencyGain: number;
867
+ };
868
+ /**
869
+ * Calculate token budget and unit economics
870
+ */
871
+ declare function calculateTokenBudget(params: {
872
+ totalContextTokens: number;
873
+ estimatedResponseTokens?: number;
874
+ wastedTokens: {
875
+ duplication: number;
876
+ fragmentation: number;
877
+ chattiness: number;
878
+ };
879
+ }): TokenBudget;
880
+ /**
881
+ * Estimate dollar cost from a token budget
882
+ */
883
+ declare function estimateCostFromBudget(budget: TokenBudget, model: ModelPricingPreset, config?: Partial<CostConfig>): {
884
+ total: number;
885
+ range: [number, number];
886
+ confidence: number;
887
+ };
888
+
889
+ /**
890
+ * Severity time estimates (hours to fix)
891
+ */
892
+ declare const SEVERITY_TIME_ESTIMATES: {
893
+ critical: number;
894
+ major: number;
895
+ minor: number;
896
+ info: number;
897
+ };
898
+ /**
899
+ * Calculate productivity impact from issues
900
+ */
901
+ declare function calculateProductivityImpact(issues: {
902
+ severity: string;
903
+ }[], hourlyRate?: number): ProductivityImpact;
904
+ /**
905
+ * Predict AI suggestion acceptance rate
906
+ */
907
+ declare function predictAcceptanceRate(toolOutputs: Map<string, ToolScoringOutput>): AcceptancePrediction;
908
+
909
+ /**
910
+ * Knowledge and Technical Debt Risk Metrics
911
+ */
912
+ interface KnowledgeConcentrationRisk {
913
+ score: number;
914
+ rating: 'low' | 'moderate' | 'high' | 'critical';
915
+ analysis: {
916
+ uniqueConceptFiles: number;
917
+ totalFiles: number;
918
+ concentrationRatio: number;
919
+ singleAuthorFiles: number;
920
+ orphanFiles: number;
921
+ };
922
+ recommendations: string[];
923
+ }
924
+ declare function calculateKnowledgeConcentration(params: {
925
+ uniqueConceptFiles: number;
926
+ totalFiles: number;
927
+ singleAuthorFiles: number;
928
+ orphanFiles: number;
929
+ }): KnowledgeConcentrationRisk;
930
+ interface TechnicalDebtInterest {
931
+ monthlyRate: number;
932
+ annualRate: number;
933
+ principal: number;
934
+ projections: {
935
+ months6: number;
936
+ months12: number;
937
+ months24: number;
938
+ };
939
+ monthlyCost: number;
940
+ }
941
+ declare function calculateDebtInterest(principal: number, monthlyGrowthRate: number): TechnicalDebtInterest;
942
+
943
+ /**
944
+ * Calculate Technical Value Chain
945
+ */
946
+ declare function calculateTechnicalValueChain(params: {
947
+ businessLogicDensity: number;
948
+ dataAccessComplexity: number;
949
+ apiSurfaceArea: number;
950
+ }): TechnicalValueChainSummary;
951
+ /**
952
+ * Calculate Comprehension Difficulty Index (CDI)
953
+ */
954
+ declare function calculateComprehensionDifficulty(contextBudget: number, importDepth: number, fragmentation: number, modelTier?: ModelContextTier | string): ComprehensionDifficulty;
753
955
 
754
956
  /**
755
957
  * Factory for creating and managing language parsers.
756
958
  * Supports both singleton usage and multiple instances for test isolation.
757
959
  *
758
- * @lastUpdated 2026-03-18
960
+ * @lastUpdated 2026-03-22
759
961
  */
760
962
  declare class ParserFactory {
761
963
  private static instance;
762
964
  private parsers;
763
965
  private extensionMap;
966
+ private registeredParsers;
764
967
  /**
765
968
  * Create a new ParserFactory instance
766
969
  */
767
970
  constructor();
971
+ /**
972
+ * Register a lazy-loaded parser
973
+ */
974
+ registerLazyParser(language: Language, loader: () => Promise<LanguageParser>): void;
768
975
  /**
769
976
  * Get the global singleton instance
770
977
  *
@@ -778,13 +985,13 @@ declare class ParserFactory {
778
985
  /**
779
986
  * Get parser for a specific language
780
987
  */
781
- getParserForLanguage(language: Language): LanguageParser | null;
988
+ getParserForLanguage(language: Language): Promise<LanguageParser | null>;
782
989
  /**
783
990
  * Get parser for a file based on its extension
784
991
  */
785
- getParserForFile(filePath: string): LanguageParser | null;
992
+ getParserForFile(filePath: string): Promise<LanguageParser | null>;
786
993
  /**
787
- * Check if a file is supported
994
+ * Check if a file is supported (synchronous check based on extension)
788
995
  */
789
996
  isSupported(filePath: string): boolean;
790
997
  /**
@@ -817,9 +1024,9 @@ declare class ParserFactory {
817
1024
  *
818
1025
  * @param filePath - Path to the file to get a parser for.
819
1026
  * @returns LanguageParser instance or null if unsupported.
820
- * @lastUpdated 2026-03-18
1027
+ * @lastUpdated 2026-03-22
821
1028
  */
822
- declare function getParser(filePath: string): LanguageParser | null;
1029
+ declare function getParser(filePath: string): Promise<LanguageParser | null>;
823
1030
  /**
824
1031
  * Initialize all parsers
825
1032
  */
@@ -1531,40 +1738,6 @@ interface FutureProofRecommendationParams {
1531
1738
  dependencyHealth?: DependencyHealthScore;
1532
1739
  }
1533
1740
 
1534
- /**
1535
- * Change Amplification Metrics.
1536
- * Measures how a change in one file ripples through the system via dependency fan-out.
1537
- *
1538
- * @lastUpdated 2026-03-18
1539
- */
1540
- interface ChangeAmplificationScore {
1541
- score: number;
1542
- rating: 'isolated' | 'contained' | 'amplified' | 'explosive';
1543
- avgAmplification: number;
1544
- maxAmplification: number;
1545
- hotspots: Array<{
1546
- file: string;
1547
- fanOut: number;
1548
- fanIn: number;
1549
- amplificationFactor: number;
1550
- }>;
1551
- recommendations: string[];
1552
- }
1553
- /**
1554
- * Calculate Change Amplification metrics for a set of files in a dependency graph.
1555
- *
1556
- * @param params - Structural metrics gathered from link analysis.
1557
- * @param params.files - List of files with their fan-in/fan-out counts.
1558
- * @returns Comprehensive ChangeAmplificationScore.
1559
- */
1560
- declare function calculateChangeAmplification(params: {
1561
- files: Array<{
1562
- file: string;
1563
- fanOut: number;
1564
- fanIn: number;
1565
- }>;
1566
- }): ChangeAmplificationScore;
1567
-
1568
1741
  /**
1569
1742
  * Future-Proof AI Metrics Abstraction Layer.
1570
1743
  *
@@ -1608,6 +1781,40 @@ declare function calculateExtendedFutureProofScore(params: FutureProofRecommenda
1608
1781
  semanticDistances?: SemanticDistance[];
1609
1782
  }): ToolScoringOutput;
1610
1783
 
1784
+ /**
1785
+ * Change Amplification Metrics.
1786
+ * Measures how a change in one file ripples through the system via dependency fan-out.
1787
+ *
1788
+ * @lastUpdated 2026-03-18
1789
+ */
1790
+ interface ChangeAmplificationScore {
1791
+ score: number;
1792
+ rating: 'isolated' | 'contained' | 'amplified' | 'explosive';
1793
+ avgAmplification: number;
1794
+ maxAmplification: number;
1795
+ hotspots: Array<{
1796
+ file: string;
1797
+ fanOut: number;
1798
+ fanIn: number;
1799
+ amplificationFactor: number;
1800
+ }>;
1801
+ recommendations: string[];
1802
+ }
1803
+ /**
1804
+ * Calculate Change Amplification metrics for a set of files in a dependency graph.
1805
+ *
1806
+ * @param params - Structural metrics gathered from link analysis.
1807
+ * @param params.files - List of files with their fan-in/fan-out counts.
1808
+ * @returns Comprehensive ChangeAmplificationScore.
1809
+ */
1810
+ declare function calculateChangeAmplification(params: {
1811
+ files: Array<{
1812
+ file: string;
1813
+ fanOut: number;
1814
+ fanIn: number;
1815
+ }>;
1816
+ }): ChangeAmplificationScore;
1817
+
1611
1818
  /**
1612
1819
  * Temporal Tracking Utilities
1613
1820
  *
@@ -1723,4 +1930,4 @@ declare function severityToAnnotationLevel(severity: string): 'error' | 'warning
1723
1930
  */
1724
1931
  declare function emitIssuesAsAnnotations(issues: any[]): void;
1725
1932
 
1726
- export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, Issue, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StatCard, type TableConfig, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildSimpleProviderScore, buildSpokeOutput, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, emitAnnotation, emitIssuesAsAnnotations, emitProgress, estimateCostFromBudget, estimateTokens, exportHistory, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, generateCompleteReport, generateReportFooter, generateReportHead, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getSafetyIcon, getScoreBar, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLevel, getSeverityValue, getSupportedLanguages, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, initTreeSitter, initializeParsers, isFileSupported, isSourceFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, readFileContent, resolveOutputPath, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };
1933
+ export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CodeBlock, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, Issue, type JSONOutputParams, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StandardReportData, type StandardScoringParams, type StatCard, type TableConfig, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildFactorsFromDimensions, buildSimpleProviderScore, buildSpokeOutput, buildStandardToolScore, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateHeuristicConfidence, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateStringSimilarity, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, createStandardProgressCallback, displayStandardConsoleReport, emitAnnotation, emitIssuesAsAnnotations, emitProgress, estimateCostFromBudget, estimateTokens, exportHistory, extractCodeBlocks, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, formatStandardCliResult, formatStandardReport, generateCompleteReport, generateIssueSummary, generateReportFooter, generateReportHead, generateReportHero, generateScoreCard, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getReportTimestamp, getSafetyIcon, getScoreBar, getScoreColor, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLevel, getSeverityValue, getSupportedLanguages, getTerminalDivider, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, handleStandardJSONOutput, inferPatternType, initTreeSitter, initializeParsers, isFileSupported, isSourceFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, prepareActionConfig, printTerminalHeader, readFileContent, resolveOutputFormat, resolveOutputPath, runStandardCliAction, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };