@aiready/core 0.23.21 → 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.
- package/dist/chunk-E55RNGGK.mjs +852 -0
- package/dist/client/index.d.mts +2 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +922 -0
- package/dist/client/index.mjs +104 -0
- package/dist/client-Ctl_0z6F.d.mts +1294 -0
- package/dist/client-Ctl_0z6F.d.ts +1294 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index-Ctl_0z6F.d.mts +1294 -0
- package/dist/index-Ctl_0z6F.d.ts +1294 -0
- package/dist/index.d.mts +113 -115
- package/dist/index.d.ts +113 -115
- package/dist/index.js +223 -223
- package/dist/index.mjs +224 -224
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
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 './
|
|
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
4
|
import * as chalk from 'chalk';
|
|
5
5
|
import * as Parser from 'web-tree-sitter';
|
|
@@ -702,6 +702,117 @@ declare function inferPatternType(keyword: string, name: string): string;
|
|
|
702
702
|
*/
|
|
703
703
|
declare function extractCodeBlocks(file: string, content: string): CodeBlock[];
|
|
704
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Business Value Metrics Module.
|
|
707
|
+
*
|
|
708
|
+
* Provides business-aligned metrics that quantify ROI and survive technology changes.
|
|
709
|
+
*
|
|
710
|
+
* @lastUpdated 2026-03-18
|
|
711
|
+
*/
|
|
712
|
+
/**
|
|
713
|
+
* Historical score entry for trend tracking.
|
|
714
|
+
* Used to store and compare results across different points in time.
|
|
715
|
+
*/
|
|
716
|
+
interface ScoreHistoryEntry {
|
|
717
|
+
/** ISO timestamp of the scan */
|
|
718
|
+
timestamp: string;
|
|
719
|
+
/** Overall score (0-100) */
|
|
720
|
+
overallScore: number;
|
|
721
|
+
/** Breakdown of scores by tool */
|
|
722
|
+
breakdown: Record<string, number>;
|
|
723
|
+
/** Total number of issues detected */
|
|
724
|
+
totalIssues: number;
|
|
725
|
+
/** Total tokens analyzed */
|
|
726
|
+
totalTokens: number;
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Trend analysis comparing current vs historical scores.
|
|
730
|
+
* Helps teams understand if their AI-readiness is improving or degrading.
|
|
731
|
+
*/
|
|
732
|
+
interface ScoreTrend {
|
|
733
|
+
/** Overall trend direction */
|
|
734
|
+
direction: 'improving' | 'stable' | 'degrading';
|
|
735
|
+
/** Percentage change in score over last 30 days */
|
|
736
|
+
change30Days: number;
|
|
737
|
+
/** Percentage change in score over last 90 days */
|
|
738
|
+
change90Days: number;
|
|
739
|
+
/** Rate of change (points per week) */
|
|
740
|
+
velocity: number;
|
|
741
|
+
/** Projected score in 30 days based on current velocity */
|
|
742
|
+
projectedScore: number;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Calculate Aggregate Business ROI from code analysis results.
|
|
746
|
+
*
|
|
747
|
+
* This high-level function combines token waste and productivity impact
|
|
748
|
+
* to produce a monthly and annual dollar value of the issues found.
|
|
749
|
+
*
|
|
750
|
+
* @param params - Parameters for ROI calculation
|
|
751
|
+
* @param params.tokenWaste - Estimated total tokens wasted on context inefficiencies
|
|
752
|
+
* @param params.issues - Array of issues with severity levels for productivity impact
|
|
753
|
+
* @param params.developerCount - Number of developers in the team (default: 5)
|
|
754
|
+
* @param params.modelId - AI model ID for pricing model selection (default: 'claude-4.6')
|
|
755
|
+
* @returns Business ROI metrics including savings and recommendations
|
|
756
|
+
*/
|
|
757
|
+
declare function calculateBusinessROI(params: {
|
|
758
|
+
tokenWaste: number;
|
|
759
|
+
issues: {
|
|
760
|
+
severity: string;
|
|
761
|
+
}[];
|
|
762
|
+
developerCount?: number;
|
|
763
|
+
modelId?: string;
|
|
764
|
+
}): {
|
|
765
|
+
/** Estimated monthly savings if issues are resolved */
|
|
766
|
+
monthlySavings: number;
|
|
767
|
+
/** Total developer hours gained per month */
|
|
768
|
+
productivityGainHours: number;
|
|
769
|
+
/** Projected total annual business value gained */
|
|
770
|
+
annualValue: number;
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* Format currency value for display in console or reports.
|
|
774
|
+
*
|
|
775
|
+
* Handles small values with decimals and large values with 'k' suffix.
|
|
776
|
+
*
|
|
777
|
+
* @param cost Cost in USD
|
|
778
|
+
* @returns Formatted currency string (e.g. "$0.50", "$500", "$1.2k")
|
|
779
|
+
*/
|
|
780
|
+
declare function formatCost(cost: number): string;
|
|
781
|
+
/**
|
|
782
|
+
* Format time duration in hours for display in console or reports.
|
|
783
|
+
*
|
|
784
|
+
* Automatically switches between minutes, hours, and weeks based on magnitude.
|
|
785
|
+
*
|
|
786
|
+
* @param hours Number of hours
|
|
787
|
+
* @returns Formatted duration string (e.g. "30min", "4.5h", "2.1 weeks")
|
|
788
|
+
*/
|
|
789
|
+
declare function formatHours(hours: number): string;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Format AI acceptance rate as a human-readable percentage string.
|
|
793
|
+
*
|
|
794
|
+
* @param rate - Rate value between 0 and 1 (e.g. 0.85).
|
|
795
|
+
* @returns Formatted percentage string (e.g. "85%").
|
|
796
|
+
*/
|
|
797
|
+
declare function formatAcceptanceRate(rate: number): string;
|
|
798
|
+
/**
|
|
799
|
+
* Generate a technical value chain map for a specific issue category.
|
|
800
|
+
*
|
|
801
|
+
* maps technical metrics (like duplication count) to business outcomes
|
|
802
|
+
* by explaining the impact on AI models and developer workflow.
|
|
803
|
+
*
|
|
804
|
+
* @param params Issue information
|
|
805
|
+
* @param params.issueType Unique identifier for the issue type
|
|
806
|
+
* @param params.count Total occurrences of this issue
|
|
807
|
+
* @param params.severity Severity level of the issues
|
|
808
|
+
* @returns A structured technical value chain object
|
|
809
|
+
*/
|
|
810
|
+
declare function generateValueChain(params: {
|
|
811
|
+
issueType: string;
|
|
812
|
+
count: number;
|
|
813
|
+
severity: 'critical' | 'major' | 'minor';
|
|
814
|
+
}): TechnicalValueChain;
|
|
815
|
+
|
|
705
816
|
/**
|
|
706
817
|
* AI model pricing presets for cost estimation.
|
|
707
818
|
* Prices are input token costs per 1K tokens (USD), as of Q1 2026.
|
|
@@ -842,119 +953,6 @@ declare function calculateTechnicalValueChain(params: {
|
|
|
842
953
|
*/
|
|
843
954
|
declare function calculateComprehensionDifficulty(contextBudget: number, importDepth: number, fragmentation: number, modelTier?: ModelContextTier | string): ComprehensionDifficulty;
|
|
844
955
|
|
|
845
|
-
/**
|
|
846
|
-
* Business Value Metrics Module.
|
|
847
|
-
*
|
|
848
|
-
* Provides business-aligned metrics that quantify ROI and survive technology changes.
|
|
849
|
-
*
|
|
850
|
-
* @lastUpdated 2026-03-18
|
|
851
|
-
*/
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Historical score entry for trend tracking.
|
|
855
|
-
* Used to store and compare results across different points in time.
|
|
856
|
-
*/
|
|
857
|
-
interface ScoreHistoryEntry {
|
|
858
|
-
/** ISO timestamp of the scan */
|
|
859
|
-
timestamp: string;
|
|
860
|
-
/** Overall score (0-100) */
|
|
861
|
-
overallScore: number;
|
|
862
|
-
/** Breakdown of scores by tool */
|
|
863
|
-
breakdown: Record<string, number>;
|
|
864
|
-
/** Total number of issues detected */
|
|
865
|
-
totalIssues: number;
|
|
866
|
-
/** Total tokens analyzed */
|
|
867
|
-
totalTokens: number;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Trend analysis comparing current vs historical scores.
|
|
871
|
-
* Helps teams understand if their AI-readiness is improving or degrading.
|
|
872
|
-
*/
|
|
873
|
-
interface ScoreTrend {
|
|
874
|
-
/** Overall trend direction */
|
|
875
|
-
direction: 'improving' | 'stable' | 'degrading';
|
|
876
|
-
/** Percentage change in score over last 30 days */
|
|
877
|
-
change30Days: number;
|
|
878
|
-
/** Percentage change in score over last 90 days */
|
|
879
|
-
change90Days: number;
|
|
880
|
-
/** Rate of change (points per week) */
|
|
881
|
-
velocity: number;
|
|
882
|
-
/** Projected score in 30 days based on current velocity */
|
|
883
|
-
projectedScore: number;
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* Calculate Aggregate Business ROI from code analysis results.
|
|
887
|
-
*
|
|
888
|
-
* This high-level function combines token waste and productivity impact
|
|
889
|
-
* to produce a monthly and annual dollar value of the issues found.
|
|
890
|
-
*
|
|
891
|
-
* @param params - Parameters for ROI calculation
|
|
892
|
-
* @param params.tokenWaste - Estimated total tokens wasted on context inefficiencies
|
|
893
|
-
* @param params.issues - Array of issues with severity levels for productivity impact
|
|
894
|
-
* @param params.developerCount - Number of developers in the team (default: 5)
|
|
895
|
-
* @param params.modelId - AI model ID for pricing model selection (default: 'claude-4.6')
|
|
896
|
-
* @returns Business ROI metrics including savings and recommendations
|
|
897
|
-
*/
|
|
898
|
-
declare function calculateBusinessROI(params: {
|
|
899
|
-
tokenWaste: number;
|
|
900
|
-
issues: {
|
|
901
|
-
severity: string;
|
|
902
|
-
}[];
|
|
903
|
-
developerCount?: number;
|
|
904
|
-
modelId?: string;
|
|
905
|
-
}): {
|
|
906
|
-
/** Estimated monthly savings if issues are resolved */
|
|
907
|
-
monthlySavings: number;
|
|
908
|
-
/** Total developer hours gained per month */
|
|
909
|
-
productivityGainHours: number;
|
|
910
|
-
/** Projected total annual business value gained */
|
|
911
|
-
annualValue: number;
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
* Format currency value for display in console or reports.
|
|
916
|
-
*
|
|
917
|
-
* Handles small values with decimals and large values with 'k' suffix.
|
|
918
|
-
*
|
|
919
|
-
* @param cost Cost in USD
|
|
920
|
-
* @returns Formatted currency string (e.g. "$0.50", "$500", "$1.2k")
|
|
921
|
-
*/
|
|
922
|
-
declare function formatCost(cost: number): string;
|
|
923
|
-
/**
|
|
924
|
-
* Format time duration in hours for display in console or reports.
|
|
925
|
-
*
|
|
926
|
-
* Automatically switches between minutes, hours, and weeks based on magnitude.
|
|
927
|
-
*
|
|
928
|
-
* @param hours Number of hours
|
|
929
|
-
* @returns Formatted duration string (e.g. "30min", "4.5h", "2.1 weeks")
|
|
930
|
-
*/
|
|
931
|
-
declare function formatHours(hours: number): string;
|
|
932
|
-
|
|
933
|
-
/**
|
|
934
|
-
* Format AI acceptance rate as a human-readable percentage string.
|
|
935
|
-
*
|
|
936
|
-
* @param rate - Rate value between 0 and 1 (e.g. 0.85).
|
|
937
|
-
* @returns Formatted percentage string (e.g. "85%").
|
|
938
|
-
*/
|
|
939
|
-
declare function formatAcceptanceRate(rate: number): string;
|
|
940
|
-
/**
|
|
941
|
-
* Generate a technical value chain map for a specific issue category.
|
|
942
|
-
*
|
|
943
|
-
* maps technical metrics (like duplication count) to business outcomes
|
|
944
|
-
* by explaining the impact on AI models and developer workflow.
|
|
945
|
-
*
|
|
946
|
-
* @param params Issue information
|
|
947
|
-
* @param params.issueType Unique identifier for the issue type
|
|
948
|
-
* @param params.count Total occurrences of this issue
|
|
949
|
-
* @param params.severity Severity level of the issues
|
|
950
|
-
* @returns A structured technical value chain object
|
|
951
|
-
*/
|
|
952
|
-
declare function generateValueChain(params: {
|
|
953
|
-
issueType: string;
|
|
954
|
-
count: number;
|
|
955
|
-
severity: 'critical' | 'major' | 'minor';
|
|
956
|
-
}): TechnicalValueChain;
|
|
957
|
-
|
|
958
956
|
/**
|
|
959
957
|
* Factory for creating and managing language parsers.
|
|
960
958
|
* Supports both singleton usage and multiple instances for test isolation.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
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 './
|
|
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.js';
|
|
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.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as chalk from 'chalk';
|
|
5
5
|
import * as Parser from 'web-tree-sitter';
|
|
@@ -702,6 +702,117 @@ declare function inferPatternType(keyword: string, name: string): string;
|
|
|
702
702
|
*/
|
|
703
703
|
declare function extractCodeBlocks(file: string, content: string): CodeBlock[];
|
|
704
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Business Value Metrics Module.
|
|
707
|
+
*
|
|
708
|
+
* Provides business-aligned metrics that quantify ROI and survive technology changes.
|
|
709
|
+
*
|
|
710
|
+
* @lastUpdated 2026-03-18
|
|
711
|
+
*/
|
|
712
|
+
/**
|
|
713
|
+
* Historical score entry for trend tracking.
|
|
714
|
+
* Used to store and compare results across different points in time.
|
|
715
|
+
*/
|
|
716
|
+
interface ScoreHistoryEntry {
|
|
717
|
+
/** ISO timestamp of the scan */
|
|
718
|
+
timestamp: string;
|
|
719
|
+
/** Overall score (0-100) */
|
|
720
|
+
overallScore: number;
|
|
721
|
+
/** Breakdown of scores by tool */
|
|
722
|
+
breakdown: Record<string, number>;
|
|
723
|
+
/** Total number of issues detected */
|
|
724
|
+
totalIssues: number;
|
|
725
|
+
/** Total tokens analyzed */
|
|
726
|
+
totalTokens: number;
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Trend analysis comparing current vs historical scores.
|
|
730
|
+
* Helps teams understand if their AI-readiness is improving or degrading.
|
|
731
|
+
*/
|
|
732
|
+
interface ScoreTrend {
|
|
733
|
+
/** Overall trend direction */
|
|
734
|
+
direction: 'improving' | 'stable' | 'degrading';
|
|
735
|
+
/** Percentage change in score over last 30 days */
|
|
736
|
+
change30Days: number;
|
|
737
|
+
/** Percentage change in score over last 90 days */
|
|
738
|
+
change90Days: number;
|
|
739
|
+
/** Rate of change (points per week) */
|
|
740
|
+
velocity: number;
|
|
741
|
+
/** Projected score in 30 days based on current velocity */
|
|
742
|
+
projectedScore: number;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Calculate Aggregate Business ROI from code analysis results.
|
|
746
|
+
*
|
|
747
|
+
* This high-level function combines token waste and productivity impact
|
|
748
|
+
* to produce a monthly and annual dollar value of the issues found.
|
|
749
|
+
*
|
|
750
|
+
* @param params - Parameters for ROI calculation
|
|
751
|
+
* @param params.tokenWaste - Estimated total tokens wasted on context inefficiencies
|
|
752
|
+
* @param params.issues - Array of issues with severity levels for productivity impact
|
|
753
|
+
* @param params.developerCount - Number of developers in the team (default: 5)
|
|
754
|
+
* @param params.modelId - AI model ID for pricing model selection (default: 'claude-4.6')
|
|
755
|
+
* @returns Business ROI metrics including savings and recommendations
|
|
756
|
+
*/
|
|
757
|
+
declare function calculateBusinessROI(params: {
|
|
758
|
+
tokenWaste: number;
|
|
759
|
+
issues: {
|
|
760
|
+
severity: string;
|
|
761
|
+
}[];
|
|
762
|
+
developerCount?: number;
|
|
763
|
+
modelId?: string;
|
|
764
|
+
}): {
|
|
765
|
+
/** Estimated monthly savings if issues are resolved */
|
|
766
|
+
monthlySavings: number;
|
|
767
|
+
/** Total developer hours gained per month */
|
|
768
|
+
productivityGainHours: number;
|
|
769
|
+
/** Projected total annual business value gained */
|
|
770
|
+
annualValue: number;
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* Format currency value for display in console or reports.
|
|
774
|
+
*
|
|
775
|
+
* Handles small values with decimals and large values with 'k' suffix.
|
|
776
|
+
*
|
|
777
|
+
* @param cost Cost in USD
|
|
778
|
+
* @returns Formatted currency string (e.g. "$0.50", "$500", "$1.2k")
|
|
779
|
+
*/
|
|
780
|
+
declare function formatCost(cost: number): string;
|
|
781
|
+
/**
|
|
782
|
+
* Format time duration in hours for display in console or reports.
|
|
783
|
+
*
|
|
784
|
+
* Automatically switches between minutes, hours, and weeks based on magnitude.
|
|
785
|
+
*
|
|
786
|
+
* @param hours Number of hours
|
|
787
|
+
* @returns Formatted duration string (e.g. "30min", "4.5h", "2.1 weeks")
|
|
788
|
+
*/
|
|
789
|
+
declare function formatHours(hours: number): string;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Format AI acceptance rate as a human-readable percentage string.
|
|
793
|
+
*
|
|
794
|
+
* @param rate - Rate value between 0 and 1 (e.g. 0.85).
|
|
795
|
+
* @returns Formatted percentage string (e.g. "85%").
|
|
796
|
+
*/
|
|
797
|
+
declare function formatAcceptanceRate(rate: number): string;
|
|
798
|
+
/**
|
|
799
|
+
* Generate a technical value chain map for a specific issue category.
|
|
800
|
+
*
|
|
801
|
+
* maps technical metrics (like duplication count) to business outcomes
|
|
802
|
+
* by explaining the impact on AI models and developer workflow.
|
|
803
|
+
*
|
|
804
|
+
* @param params Issue information
|
|
805
|
+
* @param params.issueType Unique identifier for the issue type
|
|
806
|
+
* @param params.count Total occurrences of this issue
|
|
807
|
+
* @param params.severity Severity level of the issues
|
|
808
|
+
* @returns A structured technical value chain object
|
|
809
|
+
*/
|
|
810
|
+
declare function generateValueChain(params: {
|
|
811
|
+
issueType: string;
|
|
812
|
+
count: number;
|
|
813
|
+
severity: 'critical' | 'major' | 'minor';
|
|
814
|
+
}): TechnicalValueChain;
|
|
815
|
+
|
|
705
816
|
/**
|
|
706
817
|
* AI model pricing presets for cost estimation.
|
|
707
818
|
* Prices are input token costs per 1K tokens (USD), as of Q1 2026.
|
|
@@ -842,119 +953,6 @@ declare function calculateTechnicalValueChain(params: {
|
|
|
842
953
|
*/
|
|
843
954
|
declare function calculateComprehensionDifficulty(contextBudget: number, importDepth: number, fragmentation: number, modelTier?: ModelContextTier | string): ComprehensionDifficulty;
|
|
844
955
|
|
|
845
|
-
/**
|
|
846
|
-
* Business Value Metrics Module.
|
|
847
|
-
*
|
|
848
|
-
* Provides business-aligned metrics that quantify ROI and survive technology changes.
|
|
849
|
-
*
|
|
850
|
-
* @lastUpdated 2026-03-18
|
|
851
|
-
*/
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Historical score entry for trend tracking.
|
|
855
|
-
* Used to store and compare results across different points in time.
|
|
856
|
-
*/
|
|
857
|
-
interface ScoreHistoryEntry {
|
|
858
|
-
/** ISO timestamp of the scan */
|
|
859
|
-
timestamp: string;
|
|
860
|
-
/** Overall score (0-100) */
|
|
861
|
-
overallScore: number;
|
|
862
|
-
/** Breakdown of scores by tool */
|
|
863
|
-
breakdown: Record<string, number>;
|
|
864
|
-
/** Total number of issues detected */
|
|
865
|
-
totalIssues: number;
|
|
866
|
-
/** Total tokens analyzed */
|
|
867
|
-
totalTokens: number;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Trend analysis comparing current vs historical scores.
|
|
871
|
-
* Helps teams understand if their AI-readiness is improving or degrading.
|
|
872
|
-
*/
|
|
873
|
-
interface ScoreTrend {
|
|
874
|
-
/** Overall trend direction */
|
|
875
|
-
direction: 'improving' | 'stable' | 'degrading';
|
|
876
|
-
/** Percentage change in score over last 30 days */
|
|
877
|
-
change30Days: number;
|
|
878
|
-
/** Percentage change in score over last 90 days */
|
|
879
|
-
change90Days: number;
|
|
880
|
-
/** Rate of change (points per week) */
|
|
881
|
-
velocity: number;
|
|
882
|
-
/** Projected score in 30 days based on current velocity */
|
|
883
|
-
projectedScore: number;
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* Calculate Aggregate Business ROI from code analysis results.
|
|
887
|
-
*
|
|
888
|
-
* This high-level function combines token waste and productivity impact
|
|
889
|
-
* to produce a monthly and annual dollar value of the issues found.
|
|
890
|
-
*
|
|
891
|
-
* @param params - Parameters for ROI calculation
|
|
892
|
-
* @param params.tokenWaste - Estimated total tokens wasted on context inefficiencies
|
|
893
|
-
* @param params.issues - Array of issues with severity levels for productivity impact
|
|
894
|
-
* @param params.developerCount - Number of developers in the team (default: 5)
|
|
895
|
-
* @param params.modelId - AI model ID for pricing model selection (default: 'claude-4.6')
|
|
896
|
-
* @returns Business ROI metrics including savings and recommendations
|
|
897
|
-
*/
|
|
898
|
-
declare function calculateBusinessROI(params: {
|
|
899
|
-
tokenWaste: number;
|
|
900
|
-
issues: {
|
|
901
|
-
severity: string;
|
|
902
|
-
}[];
|
|
903
|
-
developerCount?: number;
|
|
904
|
-
modelId?: string;
|
|
905
|
-
}): {
|
|
906
|
-
/** Estimated monthly savings if issues are resolved */
|
|
907
|
-
monthlySavings: number;
|
|
908
|
-
/** Total developer hours gained per month */
|
|
909
|
-
productivityGainHours: number;
|
|
910
|
-
/** Projected total annual business value gained */
|
|
911
|
-
annualValue: number;
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
* Format currency value for display in console or reports.
|
|
916
|
-
*
|
|
917
|
-
* Handles small values with decimals and large values with 'k' suffix.
|
|
918
|
-
*
|
|
919
|
-
* @param cost Cost in USD
|
|
920
|
-
* @returns Formatted currency string (e.g. "$0.50", "$500", "$1.2k")
|
|
921
|
-
*/
|
|
922
|
-
declare function formatCost(cost: number): string;
|
|
923
|
-
/**
|
|
924
|
-
* Format time duration in hours for display in console or reports.
|
|
925
|
-
*
|
|
926
|
-
* Automatically switches between minutes, hours, and weeks based on magnitude.
|
|
927
|
-
*
|
|
928
|
-
* @param hours Number of hours
|
|
929
|
-
* @returns Formatted duration string (e.g. "30min", "4.5h", "2.1 weeks")
|
|
930
|
-
*/
|
|
931
|
-
declare function formatHours(hours: number): string;
|
|
932
|
-
|
|
933
|
-
/**
|
|
934
|
-
* Format AI acceptance rate as a human-readable percentage string.
|
|
935
|
-
*
|
|
936
|
-
* @param rate - Rate value between 0 and 1 (e.g. 0.85).
|
|
937
|
-
* @returns Formatted percentage string (e.g. "85%").
|
|
938
|
-
*/
|
|
939
|
-
declare function formatAcceptanceRate(rate: number): string;
|
|
940
|
-
/**
|
|
941
|
-
* Generate a technical value chain map for a specific issue category.
|
|
942
|
-
*
|
|
943
|
-
* maps technical metrics (like duplication count) to business outcomes
|
|
944
|
-
* by explaining the impact on AI models and developer workflow.
|
|
945
|
-
*
|
|
946
|
-
* @param params Issue information
|
|
947
|
-
* @param params.issueType Unique identifier for the issue type
|
|
948
|
-
* @param params.count Total occurrences of this issue
|
|
949
|
-
* @param params.severity Severity level of the issues
|
|
950
|
-
* @returns A structured technical value chain object
|
|
951
|
-
*/
|
|
952
|
-
declare function generateValueChain(params: {
|
|
953
|
-
issueType: string;
|
|
954
|
-
count: number;
|
|
955
|
-
severity: 'critical' | 'major' | 'minor';
|
|
956
|
-
}): TechnicalValueChain;
|
|
957
|
-
|
|
958
956
|
/**
|
|
959
957
|
* Factory for creating and managing language parsers.
|
|
960
958
|
* Supports both singleton usage and multiple instances for test isolation.
|