@aiready/core 0.24.5 → 0.24.6

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 (106) hide show
  1. package/dist/{chunk-RCZSMGCX.mjs → chunk-2IUCKF4Z.mjs} +1 -1
  2. package/dist/{chunk-WYOW6O3P.mjs → chunk-3D3I5K5W.mjs} +33 -7
  3. package/dist/{chunk-GTS642BQ.mjs → chunk-3FAI4YNO.mjs} +1 -1
  4. package/dist/{chunk-EZ7ECLAZ.mjs → chunk-5IVDH26E.mjs} +21 -16
  5. package/dist/{chunk-SWZOT67M.mjs → chunk-6T5O7OAY.mjs} +1 -1
  6. package/dist/{chunk-L6BKANJC.mjs → chunk-DHFOYNMW.mjs} +12 -8
  7. package/dist/{chunk-QZNY7B2N.mjs → chunk-EHUK4VMH.mjs} +16 -8
  8. package/dist/{chunk-MTK2IIDZ.mjs → chunk-EJ74KPCV.mjs} +1 -1
  9. package/dist/{chunk-2ILVUVRK.mjs → chunk-FAESSLG7.mjs} +44 -17
  10. package/dist/{chunk-UTCRW3N7.mjs → chunk-Q4LOPVH6.mjs} +18 -14
  11. package/dist/{chunk-WH4ZGRVF.mjs → chunk-QY5YG2AZ.mjs} +12 -9
  12. package/dist/{chunk-IXPY5J4K.mjs → chunk-X63YJX5G.mjs} +16 -8
  13. package/dist/client/index.d.mts +1 -1
  14. package/dist/client/index.d.ts +1 -1
  15. package/dist/client/index.js +44 -17
  16. package/dist/client/index.mjs +1 -1
  17. package/dist/{csharp-parser-4ZKCSX5B.mjs → csharp-parser-C52DNAKT.mjs} +2 -2
  18. package/dist/{csharp-parser-5HKICCRR.mjs → csharp-parser-XW7WHE77.mjs} +2 -2
  19. package/dist/{go-parser-TKXL3DVH.mjs → go-parser-GO4BIRDD.mjs} +2 -2
  20. package/dist/{go-parser-XOM232XZ.mjs → go-parser-KTG4CGF5.mjs} +2 -2
  21. package/dist/{index-CkM98qn1.d.mts → index-ChiWzeQs.d.mts} +188 -180
  22. package/dist/{index-CkM98qn1.d.ts → index-ChiWzeQs.d.ts} +188 -180
  23. package/dist/{index-EQ2jRSlB.d.mts → index-PI6qMP2H.d.mts} +182 -178
  24. package/dist/{index-EQ2jRSlB.d.ts → index-PI6qMP2H.d.ts} +182 -178
  25. package/dist/index.d.mts +50 -15
  26. package/dist/index.d.ts +50 -15
  27. package/dist/index.js +255 -109
  28. package/dist/index.mjs +161 -66
  29. package/dist/{java-parser-MASGS4WB.mjs → java-parser-EOKMGQ6B.mjs} +2 -2
  30. package/dist/{java-parser-T5LXD63J.mjs → java-parser-G47O53QP.mjs} +2 -2
  31. package/dist/{python-parser-FNFK2473.mjs → python-parser-BCI7JVLF.mjs} +1 -1
  32. package/dist/{typescript-parser-2GGNRNB5.mjs → typescript-parser-4BA4VYAF.mjs} +1 -1
  33. package/dist/{typescript-parser-3ENJ6C7H.mjs → typescript-parser-WFGH52WB.mjs} +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-ARUIZO7M.mjs +0 -297
  36. package/dist/chunk-AZRUQG5T.mjs +0 -537
  37. package/dist/chunk-CYC5EGEI.mjs +0 -297
  38. package/dist/chunk-DBOPSRBC.mjs +0 -884
  39. package/dist/chunk-E55RNGGK.mjs +0 -852
  40. package/dist/chunk-FNPULWG7.mjs +0 -248
  41. package/dist/chunk-FZTFKZUQ.mjs +0 -250
  42. package/dist/chunk-G4Z45SMK.mjs +0 -852
  43. package/dist/chunk-JJQLYW6Z.mjs +0 -111
  44. package/dist/chunk-LEITCMH3.mjs +0 -535
  45. package/dist/chunk-LTAZ7Z62.mjs +0 -855
  46. package/dist/chunk-LXEO5PG3.mjs +0 -292
  47. package/dist/chunk-LZHO636W.mjs +0 -501
  48. package/dist/chunk-MPWWAAHQ.mjs +0 -548
  49. package/dist/chunk-QDCQETSI.mjs +0 -262
  50. package/dist/chunk-SM6INS52.mjs +0 -501
  51. package/dist/chunk-UBCM5Y6R.mjs +0 -275
  52. package/dist/chunk-UYLH35LA.mjs +0 -884
  53. package/dist/chunk-WVNVC2PP.mjs +0 -852
  54. package/dist/chunk-XQSEJ7WN.mjs +0 -547
  55. package/dist/chunk-YRSSR4KN.mjs +0 -850
  56. package/dist/client-2xbeKnrg.d.mts +0 -1291
  57. package/dist/client-2xbeKnrg.d.ts +0 -1291
  58. package/dist/client-4HLAGzFg.d.mts +0 -1291
  59. package/dist/client-4HLAGzFg.d.ts +0 -1291
  60. package/dist/client-B4TQwNa7.d.mts +0 -1290
  61. package/dist/client-B4TQwNa7.d.ts +0 -1290
  62. package/dist/client-Bdi4ty0v.d.mts +0 -1294
  63. package/dist/client-Bdi4ty0v.d.ts +0 -1294
  64. package/dist/client-BsKpUH3H.d.mts +0 -1339
  65. package/dist/client-BsKpUH3H.d.ts +0 -1339
  66. package/dist/client-Bv1zOaWF.d.mts +0 -1291
  67. package/dist/client-Bv1zOaWF.d.ts +0 -1291
  68. package/dist/client-Bz9YJMIX.d.mts +0 -1290
  69. package/dist/client-Bz9YJMIX.d.ts +0 -1290
  70. package/dist/client-CBpzm34X.d.mts +0 -1291
  71. package/dist/client-CBpzm34X.d.ts +0 -1291
  72. package/dist/client-CNu_tCZZ.d.mts +0 -1305
  73. package/dist/client-CNu_tCZZ.d.ts +0 -1305
  74. package/dist/client-CmEvxxQu.d.mts +0 -1339
  75. package/dist/client-CmEvxxQu.d.ts +0 -1339
  76. package/dist/client-Ctl_0z6F.d.mts +0 -1294
  77. package/dist/client-Ctl_0z6F.d.ts +0 -1294
  78. package/dist/client-DGMAxkZc.d.mts +0 -1339
  79. package/dist/client-DGMAxkZc.d.ts +0 -1339
  80. package/dist/client-DZq-CqcD.d.mts +0 -1292
  81. package/dist/client-DZq-CqcD.d.ts +0 -1292
  82. package/dist/client-DcqGfDTt.d.mts +0 -1284
  83. package/dist/client-DcqGfDTt.d.ts +0 -1284
  84. package/dist/client-O8RvSRm0.d.mts +0 -1261
  85. package/dist/client-O8RvSRm0.d.ts +0 -1261
  86. package/dist/client.d.mts +0 -2
  87. package/dist/client.d.ts +0 -2
  88. package/dist/client.js +0 -922
  89. package/dist/client.mjs +0 -104
  90. package/dist/csharp-parser-JCKXIAJW.mjs +0 -9
  91. package/dist/go-parser-J4KIH4RG.mjs +0 -9
  92. package/dist/index-Ctl_0z6F.d.mts +0 -1294
  93. package/dist/index-Ctl_0z6F.d.ts +0 -1294
  94. package/dist/index-DLHCsiAk.d.mts +0 -1294
  95. package/dist/index-DLHCsiAk.d.ts +0 -1294
  96. package/dist/java-parser-3KHXOXRQ.mjs +0 -9
  97. package/dist/python-parser-7QISP7LK.mjs +0 -8
  98. package/dist/python-parser-PDCO35VN.mjs +0 -8
  99. package/dist/python-parser-QAAL56MC.mjs +0 -8
  100. package/dist/python-parser-R7HLPNZK.mjs +0 -8
  101. package/dist/python-parser-SJ3LFZFJ.mjs +0 -8
  102. package/dist/python-parser-UFLCDT6L.mjs +0 -8
  103. package/dist/typescript-parser-4GI7DPSW.mjs +0 -7
  104. package/dist/typescript-parser-4H3HUBO4.mjs +0 -7
  105. package/dist/typescript-parser-K63IVZMF.mjs +0 -7
  106. package/dist/typescript-parser-ZJKROMQG.mjs +0 -7
@@ -1,2 +1,2 @@
1
- export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, 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, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-EQ2jRSlB.mjs';
1
+ export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, 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, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-ChiWzeQs.mjs';
2
2
  import 'zod';
@@ -1,2 +1,2 @@
1
- export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, 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, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-EQ2jRSlB.js';
1
+ export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, 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, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-ChiWzeQs.js';
2
2
  import 'zod';
@@ -469,6 +469,31 @@ var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
469
469
  })(RecommendationPriority || {});
470
470
 
471
471
  // src/scoring.ts
472
+ var SCORING_CONSTANTS = {
473
+ WEIGHTS: {
474
+ DEFAULT: 5,
475
+ MAX: 100
476
+ },
477
+ THRESHOLDS: {
478
+ XS: 80,
479
+ SMALL: 75,
480
+ MEDIUM: 70,
481
+ LARGE: 65,
482
+ ENTERPRISE: 58,
483
+ NORMALIZATION_OFFSET: 70
484
+ },
485
+ FILE_COUNTS: {
486
+ XS: 50,
487
+ SMALL: 200,
488
+ MEDIUM: 500,
489
+ LARGE: 2e3
490
+ },
491
+ DELIMITERS: {
492
+ LIST: ",",
493
+ PAIR: ":",
494
+ FORMULA_JOIN: " + "
495
+ }
496
+ };
472
497
  var DEFAULT_TOOL_WEIGHTS = {
473
498
  ["pattern-detect" /* PatternDetect */]: 22,
474
499
  ["context-analyzer" /* ContextAnalyzer */]: 19,
@@ -556,22 +581,22 @@ var CONTEXT_TIER_THRESHOLDS = {
556
581
  frontier: { idealTokens: 5e4, criticalTokens: 15e4, idealDepth: 10 }
557
582
  };
558
583
  var SIZE_ADJUSTED_THRESHOLDS = {
559
- xs: 80,
584
+ xs: SCORING_CONSTANTS.THRESHOLDS.XS,
560
585
  // < 50 files
561
- small: 75,
586
+ small: SCORING_CONSTANTS.THRESHOLDS.SMALL,
562
587
  // 50-200 files
563
- medium: 70,
588
+ medium: SCORING_CONSTANTS.THRESHOLDS.MEDIUM,
564
589
  // 200-500 files
565
- large: 65,
590
+ large: SCORING_CONSTANTS.THRESHOLDS.LARGE,
566
591
  // 500-2000 files
567
- enterprise: 58
592
+ enterprise: SCORING_CONSTANTS.THRESHOLDS.ENTERPRISE
568
593
  // 2000+ files
569
594
  };
570
595
  function getProjectSizeTier(fileCount) {
571
- if (fileCount < 50) return "xs";
572
- if (fileCount < 200) return "small";
573
- if (fileCount < 500) return "medium";
574
- if (fileCount < 2e3) return "large";
596
+ if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.XS) return "xs";
597
+ if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.SMALL) return "small";
598
+ if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.MEDIUM) return "medium";
599
+ if (fileCount < SCORING_CONSTANTS.FILE_COUNTS.LARGE) return "large";
575
600
  return "enterprise";
576
601
  }
577
602
  function getRecommendedThreshold(fileCount, modelTier = "standard") {
@@ -587,14 +612,16 @@ function getToolWeight(toolName, toolConfig, cliOverride, profile = "default" /*
587
612
  if (cliOverride !== void 0) return cliOverride;
588
613
  if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
589
614
  const profileWeights = SCORING_PROFILES[profile] ?? DEFAULT_TOOL_WEIGHTS;
590
- return profileWeights[toolName] ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
615
+ return profileWeights[toolName] ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? SCORING_CONSTANTS.WEIGHTS.DEFAULT;
591
616
  }
592
617
  function parseWeightString(weightStr) {
593
618
  const weights = /* @__PURE__ */ new Map();
594
619
  if (!weightStr) return weights;
595
- const pairs = weightStr.split(",");
620
+ const pairs = weightStr.split(SCORING_CONSTANTS.DELIMITERS.LIST);
596
621
  for (const pair of pairs) {
597
- const [toolShortName, weightValueStr] = pair.split(":");
622
+ const [toolShortName, weightValueStr] = pair.split(
623
+ SCORING_CONSTANTS.DELIMITERS.PAIR
624
+ );
598
625
  if (toolShortName && weightValueStr) {
599
626
  const toolName = normalizeToolName(toolShortName.trim());
600
627
  const weight = parseInt(weightValueStr.trim(), 10);
@@ -609,7 +636,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
609
636
  if (toolOutputs.size === 0) {
610
637
  throw new Error("No tool outputs provided for scoring");
611
638
  }
612
- const profile = config?.scoring?.profile || "default" /* Default */;
639
+ const profile = config?.profile || "default" /* Default */;
613
640
  const weights = /* @__PURE__ */ new Map();
614
641
  for (const [toolName] of toolOutputs.entries()) {
615
642
  const cliWeight = cliWeights?.get(toolName);
@@ -623,7 +650,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
623
650
  const toolsUsed = [];
624
651
  const calculationWeights = {};
625
652
  for (const [toolName, output] of toolOutputs.entries()) {
626
- const weight = weights.get(toolName) ?? 5;
653
+ const weight = weights.get(toolName) ?? SCORING_CONSTANTS.WEIGHTS.DEFAULT;
627
654
  weightedSum += output.score * weight;
628
655
  totalWeight += weight;
629
656
  toolsUsed.push(toolName);
@@ -634,11 +661,11 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
634
661
  const rating = getRating(overall);
635
662
  const formulaParts = Array.from(toolOutputs.entries()).map(
636
663
  ([name, output]) => {
637
- const weight = weights.get(name) ?? 5;
664
+ const weight = weights.get(name) ?? SCORING_CONSTANTS.WEIGHTS.DEFAULT;
638
665
  return `(${output.score} \xD7 ${weight})`;
639
666
  }
640
667
  );
641
- const formulaStr = `[${formulaParts.join(" + ")}] / ${totalWeight} = ${overall}`;
668
+ const formulaStr = `[${formulaParts.join(SCORING_CONSTANTS.DELIMITERS.FORMULA_JOIN)}] / ${totalWeight} = ${overall}`;
642
669
  return {
643
670
  overall,
644
671
  rating,
@@ -654,7 +681,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
654
681
  }
655
682
  function getRatingWithContext(score, fileCount, modelTier = "standard") {
656
683
  const threshold = getRecommendedThreshold(fileCount, modelTier);
657
- const normalized = score - threshold + 70;
684
+ const normalized = score - threshold + SCORING_CONSTANTS.THRESHOLDS.NORMALIZATION_OFFSET;
658
685
  return getRating(normalized);
659
686
  }
660
687
  function getRatingDisplay(rating) {
@@ -45,7 +45,7 @@ import {
45
45
  getToolWeight,
46
46
  normalizeToolName,
47
47
  parseWeightString
48
- } from "../chunk-2ILVUVRK.mjs";
48
+ } from "../chunk-FAESSLG7.mjs";
49
49
  import {
50
50
  LANGUAGE_EXTENSIONS,
51
51
  Language,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CSharpParser
3
- } from "./chunk-FNPULWG7.mjs";
4
- import "./chunk-JJQLYW6Z.mjs";
3
+ } from "./chunk-X63YJX5G.mjs";
4
+ import "./chunk-DHFOYNMW.mjs";
5
5
  import "./chunk-2N7ISIKE.mjs";
6
6
  import "./chunk-U3IY2CFC.mjs";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CSharpParser
3
- } from "./chunk-QZNY7B2N.mjs";
4
- import "./chunk-L6BKANJC.mjs";
3
+ } from "./chunk-EHUK4VMH.mjs";
4
+ import "./chunk-3D3I5K5W.mjs";
5
5
  import "./chunk-2N7ISIKE.mjs";
6
6
  import "./chunk-U3IY2CFC.mjs";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GoParser
3
- } from "./chunk-QDCQETSI.mjs";
4
- import "./chunk-JJQLYW6Z.mjs";
3
+ } from "./chunk-3FAI4YNO.mjs";
4
+ import "./chunk-DHFOYNMW.mjs";
5
5
  import "./chunk-2N7ISIKE.mjs";
6
6
  import "./chunk-U3IY2CFC.mjs";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GoParser
3
- } from "./chunk-GTS642BQ.mjs";
4
- import "./chunk-L6BKANJC.mjs";
3
+ } from "./chunk-EJ74KPCV.mjs";
4
+ import "./chunk-3D3I5K5W.mjs";
5
5
  import "./chunk-2N7ISIKE.mjs";
6
6
  import "./chunk-U3IY2CFC.mjs";
7
7
  export {
@@ -1,8 +1,182 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- * AST Parsing and Export Extraction Types
4
+ * Language-agnostic AST and parser interfaces for multi-language support
5
+ *
6
+ * This module provides abstractions for parsing different programming languages
7
+ * while maintaining a consistent interface for analysis tools.
8
+ */
9
+
10
+ /**
11
+ * Supported programming languages
12
+ */
13
+ declare enum Language {
14
+ TypeScript = "typescript",
15
+ JavaScript = "javascript",
16
+ Python = "python",
17
+ Java = "java",
18
+ Go = "go",
19
+ Rust = "rust",
20
+ CSharp = "csharp"
21
+ }
22
+ /**
23
+ * File extensions mapped to languages
24
+ */
25
+ declare const LANGUAGE_EXTENSIONS: Record<string, Language>;
26
+ /**
27
+ * Common AST node type (language-agnostic)
28
+ */
29
+ interface CommonASTNode {
30
+ type: string;
31
+ loc?: SourceRange;
32
+ raw?: any;
33
+ }
34
+ /**
35
+ * Export information (function, class, variable, etc.)
36
+ */
37
+ interface ExportInfo {
38
+ name: string;
39
+ type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default' | 'variable' | 'all';
40
+ loc?: SourceRange;
41
+ /** Imports used within this export */
42
+ imports?: string[];
43
+ /** Dependencies on other exports in same file */
44
+ dependencies?: string[];
45
+ /** TypeScript types referenced */
46
+ typeReferences?: string[];
47
+ /** For methods: parent class name */
48
+ parentClass?: string;
49
+ /** For functions/methods: parameters */
50
+ parameters?: string[];
51
+ /** For classes/interfaces: number of methods and properties */
52
+ methodCount?: number;
53
+ propertyCount?: number;
54
+ /** Visibility (public, private, protected) */
55
+ visibility?: 'public' | 'private' | 'protected';
56
+ /** Whether the value is a primitive (string, number, boolean) */
57
+ isPrimitive?: boolean;
58
+ /** Behavioral metadata for advanced metrics */
59
+ isPure?: boolean;
60
+ hasSideEffects?: boolean;
61
+ /** Whether the export has explicit type annotations (TS only) */
62
+ isTyped?: boolean;
63
+ /** Inferred domain/area this export belongs to (e.g., "auth", "database") */
64
+ inferredDomain?: string;
65
+ /** Associated documentation */
66
+ documentation?: {
67
+ content: string;
68
+ type: 'jsdoc' | 'docstring' | 'comment' | 'xml-doc';
69
+ loc?: SourceRange;
70
+ isStale?: boolean;
71
+ };
72
+ }
73
+ /**
74
+ * Parse result containing exports and imports
5
75
  */
76
+ interface ParseResult {
77
+ exports: ExportInfo[];
78
+ imports: FileImport[];
79
+ /** Language of the parsed file */
80
+ language: Language;
81
+ /** Any parse warnings (non-fatal) */
82
+ warnings?: string[];
83
+ }
84
+ /**
85
+ * Naming convention rules per language
86
+ */
87
+ interface NamingConvention {
88
+ /** Allowed variable naming patterns */
89
+ variablePattern: RegExp;
90
+ /** Allowed function naming patterns */
91
+ functionPattern: RegExp;
92
+ /** Allowed class naming patterns */
93
+ classPattern: RegExp;
94
+ /** Allowed constant naming patterns */
95
+ constantPattern: RegExp;
96
+ /** Allowed type naming patterns */
97
+ typePattern?: RegExp;
98
+ /** Allowed interface naming patterns */
99
+ interfacePattern?: RegExp;
100
+ /** Language-specific exceptions (e.g., __init__ in Python) */
101
+ exceptions?: string[];
102
+ }
103
+ /**
104
+ * Language-specific configuration
105
+ */
106
+ interface LanguageConfig {
107
+ language: Language;
108
+ /** File extensions for this language */
109
+ extensions: string[];
110
+ /** Naming conventions */
111
+ namingConventions: NamingConvention;
112
+ /** Common abbreviations allowed */
113
+ allowedAbbreviations?: string[];
114
+ /** Language-specific keywords to ignore */
115
+ keywords?: string[];
116
+ }
117
+ /**
118
+ * Abstract interface for language parsers
119
+ * Each language implementation should implement this interface
120
+ */
121
+ interface LanguageParser {
122
+ /** Language this parser handles */
123
+ readonly language: Language;
124
+ /** File extensions this parser supports */
125
+ readonly extensions: string[];
126
+ /**
127
+ * Parse source code and extract structure
128
+ * @param code - Source code to parse
129
+ * @param filePath - Path to the file (for context)
130
+ * @returns Parse result with exports and imports
131
+ * @throws ParseError if code has syntax errors
132
+ */
133
+ parse(code: string, filePath: string): ParseResult;
134
+ /**
135
+ * Get naming conventions for this language
136
+ */
137
+ getNamingConventions(): NamingConvention;
138
+ /**
139
+ * Initialize the parser (e.g. load WASM)
140
+ */
141
+ initialize(): Promise<void>;
142
+ /**
143
+ * Check if this parser can handle a file
144
+ * @param filePath - File path to check
145
+ */
146
+ canHandle(filePath: string): boolean;
147
+ /**
148
+ * Get the raw AST for advanced querying
149
+ * @param code - Source code to parse
150
+ * @param filePath - Path to the file
151
+ */
152
+ getAST(code: string, filePath: string): Promise<any>;
153
+ /**
154
+ * Analyze structural metadata for a node (e.g. purity)
155
+ * @param node - The AST node to analyze (language specific)
156
+ * @param code - The original source code
157
+ */
158
+ analyzeMetadata(node: any, code: string): Partial<ExportInfo>;
159
+ }
160
+ /**
161
+ * Parser error with location information
162
+ */
163
+ declare class ParseError extends Error {
164
+ readonly filePath: string;
165
+ readonly loc?: SourceLocation | undefined;
166
+ constructor(message: string, filePath: string, loc?: SourceLocation | undefined);
167
+ }
168
+ /**
169
+ * Statistics about parsed code
170
+ */
171
+ interface ParseStatistics {
172
+ language: Language;
173
+ filesAnalyzed: number;
174
+ totalExports: number;
175
+ totalImports: number;
176
+ parseErrors: number;
177
+ warnings: number;
178
+ }
179
+
6
180
  /**
7
181
  * Location information in source code
8
182
  */
@@ -17,9 +191,10 @@ interface SourceRange {
17
191
  start: SourceLocation;
18
192
  end: SourceLocation;
19
193
  }
194
+
20
195
  interface ExportWithImports {
21
196
  name: string;
22
- type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default' | 'all';
197
+ type: ExportInfo['type'];
23
198
  source?: string;
24
199
  imports: string[];
25
200
  dependencies: string[];
@@ -89,7 +264,8 @@ declare enum ToolName {
89
264
  CognitiveLoad = "cognitive-load",
90
265
  PatternEntropy = "pattern-entropy",
91
266
  ConceptCohesion = "concept-cohesion",
92
- SemanticDistance = "semantic-distance"
267
+ SemanticDistance = "semantic-distance",
268
+ ContractEnforcement = "contract-enforcement"
93
269
  }
94
270
  /** Zod schema for ToolName enum */
95
271
  declare const ToolNameSchema: z.ZodEnum<typeof ToolName>;
@@ -118,7 +294,8 @@ declare enum IssueType {
118
294
  LowTestability = "low-testability",
119
295
  AgentNavigationFailure = "agent-navigation-failure",
120
296
  AmbiguousApi = "ambiguous-api",
121
- ChangeAmplification = "change-amplification"
297
+ ChangeAmplification = "change-amplification",
298
+ ContractGap = "contract-gap"
122
299
  }
123
300
  /** Zod schema for IssueType enum */
124
301
  declare const IssueTypeSchema: z.ZodEnum<typeof IssueType>;
@@ -820,181 +997,6 @@ interface GraphMetadata {
820
997
  executionTime?: number;
821
998
  }
822
999
 
823
- /**
824
- * Language-agnostic AST and parser interfaces for multi-language support
825
- *
826
- * This module provides abstractions for parsing different programming languages
827
- * while maintaining a consistent interface for analysis tools.
828
- */
829
-
830
- /**
831
- * Supported programming languages
832
- */
833
- declare enum Language {
834
- TypeScript = "typescript",
835
- JavaScript = "javascript",
836
- Python = "python",
837
- Java = "java",
838
- Go = "go",
839
- Rust = "rust",
840
- CSharp = "csharp"
841
- }
842
- /**
843
- * File extensions mapped to languages
844
- */
845
- declare const LANGUAGE_EXTENSIONS: Record<string, Language>;
846
- /**
847
- * Common AST node type (language-agnostic)
848
- */
849
- interface CommonASTNode {
850
- type: string;
851
- loc?: SourceRange;
852
- raw?: any;
853
- }
854
- /**
855
- * Export information (function, class, variable, etc.)
856
- */
857
- interface ExportInfo {
858
- name: string;
859
- type: 'function' | 'class' | 'const' | 'type' | 'interface' | 'default' | 'variable';
860
- loc?: SourceRange;
861
- /** Imports used within this export */
862
- imports?: string[];
863
- /** Dependencies on other exports in same file */
864
- dependencies?: string[];
865
- /** TypeScript types referenced */
866
- typeReferences?: string[];
867
- /** For methods: parent class name */
868
- parentClass?: string;
869
- /** For functions/methods: parameters */
870
- parameters?: string[];
871
- /** For classes/interfaces: number of methods and properties */
872
- methodCount?: number;
873
- propertyCount?: number;
874
- /** Visibility (public, private, protected) */
875
- visibility?: 'public' | 'private' | 'protected';
876
- /** Whether the value is a primitive (string, number, boolean) */
877
- isPrimitive?: boolean;
878
- /** Behavioral metadata for advanced metrics */
879
- isPure?: boolean;
880
- hasSideEffects?: boolean;
881
- /** Whether the export has explicit type annotations (TS only) */
882
- isTyped?: boolean;
883
- /** Associated documentation */
884
- documentation?: {
885
- content: string;
886
- type: 'jsdoc' | 'docstring' | 'comment' | 'xml-doc';
887
- loc?: SourceRange;
888
- isStale?: boolean;
889
- };
890
- }
891
- /**
892
- * Parse result containing exports and imports
893
- */
894
- interface ParseResult {
895
- exports: ExportInfo[];
896
- imports: FileImport[];
897
- /** Language of the parsed file */
898
- language: Language;
899
- /** Any parse warnings (non-fatal) */
900
- warnings?: string[];
901
- }
902
- /**
903
- * Naming convention rules per language
904
- */
905
- interface NamingConvention {
906
- /** Allowed variable naming patterns */
907
- variablePattern: RegExp;
908
- /** Allowed function naming patterns */
909
- functionPattern: RegExp;
910
- /** Allowed class naming patterns */
911
- classPattern: RegExp;
912
- /** Allowed constant naming patterns */
913
- constantPattern: RegExp;
914
- /** Allowed type naming patterns */
915
- typePattern?: RegExp;
916
- /** Allowed interface naming patterns */
917
- interfacePattern?: RegExp;
918
- /** Language-specific exceptions (e.g., __init__ in Python) */
919
- exceptions?: string[];
920
- }
921
- /**
922
- * Language-specific configuration
923
- */
924
- interface LanguageConfig {
925
- language: Language;
926
- /** File extensions for this language */
927
- extensions: string[];
928
- /** Naming conventions */
929
- namingConventions: NamingConvention;
930
- /** Common abbreviations allowed */
931
- allowedAbbreviations?: string[];
932
- /** Language-specific keywords to ignore */
933
- keywords?: string[];
934
- }
935
- /**
936
- * Abstract interface for language parsers
937
- * Each language implementation should implement this interface
938
- */
939
- interface LanguageParser {
940
- /** Language this parser handles */
941
- readonly language: Language;
942
- /** File extensions this parser supports */
943
- readonly extensions: string[];
944
- /**
945
- * Parse source code and extract structure
946
- * @param code - Source code to parse
947
- * @param filePath - Path to the file (for context)
948
- * @returns Parse result with exports and imports
949
- * @throws ParseError if code has syntax errors
950
- */
951
- parse(code: string, filePath: string): ParseResult;
952
- /**
953
- * Get naming conventions for this language
954
- */
955
- getNamingConventions(): NamingConvention;
956
- /**
957
- * Initialize the parser (e.g. load WASM)
958
- */
959
- initialize(): Promise<void>;
960
- /**
961
- * Check if this parser can handle a file
962
- * @param filePath - File path to check
963
- */
964
- canHandle(filePath: string): boolean;
965
- /**
966
- * Get the raw AST for advanced querying
967
- * @param code - Source code to parse
968
- * @param filePath - Path to the file
969
- */
970
- getAST(code: string, filePath: string): Promise<any>;
971
- /**
972
- * Analyze structural metadata for a node (e.g. purity)
973
- * @param node - The AST node to analyze (language specific)
974
- * @param code - The original source code
975
- */
976
- analyzeMetadata(node: any, code: string): Partial<ExportInfo>;
977
- }
978
- /**
979
- * Parser error with location information
980
- */
981
- declare class ParseError extends Error {
982
- readonly filePath: string;
983
- readonly loc?: SourceLocation | undefined;
984
- constructor(message: string, filePath: string, loc?: SourceLocation | undefined);
985
- }
986
- /**
987
- * Statistics about parsed code
988
- */
989
- interface ParseStatistics {
990
- language: Language;
991
- filesAnalyzed: number;
992
- totalExports: number;
993
- totalImports: number;
994
- parseErrors: number;
995
- warnings: number;
996
- }
997
-
998
1000
  /**
999
1001
  * Shared rating helper functions for scoring and display.
1000
1002
  * Extracted to eliminate duplication between scoring.ts and CLI output modules.
@@ -1140,6 +1142,12 @@ interface ScoringConfig {
1140
1142
  compareBaseline?: string;
1141
1143
  /** Target file path to persist the calculated score */
1142
1144
  saveTo?: string;
1145
+ /** Scoring profile to use for weighting */
1146
+ profile?: string;
1147
+ /** Tool-specific configurations (e.g., weights) */
1148
+ tools?: Record<string, {
1149
+ scoreWeight?: number;
1150
+ }>;
1143
1151
  }
1144
1152
 
1145
1153
  /**
@@ -1244,7 +1252,7 @@ declare function parseWeightString(weightStr?: string): Map<string, number>;
1244
1252
  * @param cliWeights Optional weight overrides from the CLI
1245
1253
  * @returns Consolidate ScoringResult including overall score and rating
1246
1254
  */
1247
- declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutput>, config?: any, cliWeights?: Map<string, number>): ScoringResult;
1255
+ declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutput>, config?: ScoringConfig, cliWeights?: Map<string, number>): ScoringResult;
1248
1256
  /**
1249
1257
  * Convert score to rating with project-size and model awareness.
1250
1258
  *