@aiready/core 0.21.17 → 0.21.21
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-CKVKHN3G.mjs +643 -0
- package/dist/chunk-LTNXTXRI.mjs +642 -0
- package/dist/chunk-SWTDBVYJ.mjs +645 -0
- package/dist/client.d.mts +206 -92
- package/dist/client.d.ts +206 -92
- package/dist/client.js +45 -15
- package/dist/client.mjs +5 -1
- package/dist/index.d.mts +78 -14
- package/dist/index.d.ts +78 -14
- package/dist/index.js +260 -241
- package/dist/index.mjs +220 -230
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -235,6 +235,11 @@ declare const UnifiedReportSchema: z.ZodObject<{
|
|
|
235
235
|
totalIssues: z.ZodNumber;
|
|
236
236
|
criticalIssues: z.ZodNumber;
|
|
237
237
|
majorIssues: z.ZodNumber;
|
|
238
|
+
businessImpact: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
estimatedMonthlyWaste: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
potentialSavings: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
productivityHours: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
}, z.core.$strip>>;
|
|
238
243
|
}, z.core.$strip>;
|
|
239
244
|
results: z.ZodArray<z.ZodObject<{
|
|
240
245
|
fileName: z.ZodString;
|
|
@@ -443,103 +448,142 @@ declare const GLOBAL_INFRA_OPTIONS: string[];
|
|
|
443
448
|
*/
|
|
444
449
|
declare const COMMON_FINE_TUNING_OPTIONS: string[];
|
|
445
450
|
declare const GLOBAL_SCAN_OPTIONS: string[];
|
|
451
|
+
/**
|
|
452
|
+
* Base configuration for any AIReady tool
|
|
453
|
+
*/
|
|
454
|
+
interface BaseToolConfig {
|
|
455
|
+
/** Whether this tool is enabled for the scan */
|
|
456
|
+
enabled?: boolean;
|
|
457
|
+
/** Custom weight for overall score calculation (sum should be 100) */
|
|
458
|
+
scoreWeight?: number;
|
|
459
|
+
/** Catch-all for any other tool-specific options */
|
|
460
|
+
[key: string]: any;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Configuration for the pattern-detect tool (semantic duplicate detection)
|
|
464
|
+
*/
|
|
465
|
+
interface PatternDetectConfig extends BaseToolConfig {
|
|
466
|
+
/** Similarity threshold (0-1). Higher = more strict. */
|
|
467
|
+
minSimilarity?: number;
|
|
468
|
+
/** Minimum lines to consider a block */
|
|
469
|
+
minLines?: number;
|
|
470
|
+
/** Batch size for parallel processing */
|
|
471
|
+
batchSize?: number;
|
|
472
|
+
/** Use approximate matching engine for faster results on large repos */
|
|
473
|
+
approx?: boolean;
|
|
474
|
+
/** Minimum tokens shared between blocks for candidates */
|
|
475
|
+
minSharedTokens?: number;
|
|
476
|
+
/** Maximum number of candidates to compare per block */
|
|
477
|
+
maxCandidatesPerBlock?: number;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Configuration for the context-analyzer tool (fragmentation and budget)
|
|
481
|
+
*/
|
|
482
|
+
interface ContextAnalyzerConfig extends BaseToolConfig {
|
|
483
|
+
/** Maximum directory depth to traverse */
|
|
484
|
+
maxDepth?: number;
|
|
485
|
+
/** Maximum tokens allowed per context window */
|
|
486
|
+
maxContextBudget?: number;
|
|
487
|
+
/** Minimum cohesion score required (0-1) */
|
|
488
|
+
minCohesion?: number;
|
|
489
|
+
/** Maximum fragmentation ratio allowed (0-1) */
|
|
490
|
+
maxFragmentation?: number;
|
|
491
|
+
/** Primary focus area for the analyzer */
|
|
492
|
+
focus?: 'fragmentation' | 'cohesion' | 'depth' | 'all';
|
|
493
|
+
/** Whether to include dependencies from node_modules */
|
|
494
|
+
includeNodeModules?: boolean;
|
|
495
|
+
/** Project-specific domain keywords for better inference */
|
|
496
|
+
domainKeywords?: string[];
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Configuration for the naming-consistency tool
|
|
500
|
+
*/
|
|
501
|
+
interface NamingConsistencyConfig extends BaseToolConfig {
|
|
502
|
+
/** Project-approved abbreviations */
|
|
503
|
+
acceptedAbbreviations?: string[];
|
|
504
|
+
/** Words that are allowed to be short (like 'id', 'db') */
|
|
505
|
+
shortWords?: string[];
|
|
506
|
+
/** Specific checks to disable */
|
|
507
|
+
disableChecks?: ('single-letter' | 'abbreviation' | 'convention-mix' | 'unclear' | 'poor-naming')[];
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Configuration for the ai-signal-clarity tool
|
|
511
|
+
*/
|
|
512
|
+
interface AiSignalClarityConfig extends BaseToolConfig {
|
|
513
|
+
/** Detect unnamed constants */
|
|
514
|
+
checkMagicLiterals?: boolean;
|
|
515
|
+
/** Detect positional boolean arguments */
|
|
516
|
+
checkBooleanTraps?: boolean;
|
|
517
|
+
/** Detect generic names like 'temp', 'data' */
|
|
518
|
+
checkAmbiguousNames?: boolean;
|
|
519
|
+
/** Detect public exports missing JSDoc */
|
|
520
|
+
checkUndocumentedExports?: boolean;
|
|
521
|
+
/** Detect implicit state mutations */
|
|
522
|
+
checkImplicitSideEffects?: boolean;
|
|
523
|
+
/** Detect deeply nested callbacks */
|
|
524
|
+
checkDeepCallbacks?: boolean;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Consolidated AIReady configuration schema
|
|
528
|
+
*/
|
|
446
529
|
interface AIReadyConfig {
|
|
530
|
+
/** Global scan settings */
|
|
447
531
|
scan?: {
|
|
532
|
+
/** Glob patterns to include */
|
|
448
533
|
include?: string[];
|
|
534
|
+
/** Glob patterns to exclude */
|
|
449
535
|
exclude?: string[];
|
|
536
|
+
/** List of tools to execute */
|
|
450
537
|
tools?: string[];
|
|
451
538
|
};
|
|
539
|
+
/** Tool-specific configurations */
|
|
452
540
|
tools?: {
|
|
453
|
-
'pattern-detect'?:
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
batchSize?: number;
|
|
459
|
-
approx?: boolean;
|
|
460
|
-
minSharedTokens?: number;
|
|
461
|
-
maxCandidatesPerBlock?: number;
|
|
462
|
-
streamResults?: boolean;
|
|
463
|
-
maxResults?: number;
|
|
464
|
-
};
|
|
465
|
-
'context-analyzer'?: {
|
|
466
|
-
enabled?: boolean;
|
|
467
|
-
scoreWeight?: number;
|
|
468
|
-
maxDepth?: number;
|
|
469
|
-
maxContextBudget?: number;
|
|
470
|
-
minCohesion?: number;
|
|
471
|
-
maxFragmentation?: number;
|
|
472
|
-
focus?: 'fragmentation' | 'cohesion' | 'depth' | 'all';
|
|
473
|
-
includeNodeModules?: boolean;
|
|
474
|
-
maxResults?: number;
|
|
475
|
-
domainKeywords?: string[];
|
|
476
|
-
domainPatterns?: string[];
|
|
477
|
-
pathDomainMap?: Record<string, string>;
|
|
478
|
-
};
|
|
479
|
-
[ToolName.NamingConsistency]?: {
|
|
480
|
-
enabled?: boolean;
|
|
481
|
-
scoreWeight?: number;
|
|
482
|
-
acceptedAbbreviations?: string[];
|
|
483
|
-
shortWords?: string[];
|
|
484
|
-
disableChecks?: ('single-letter' | 'abbreviation' | 'convention-mix' | 'unclear' | 'poor-naming')[];
|
|
485
|
-
};
|
|
486
|
-
[ToolName.AiSignalClarity]?: {
|
|
487
|
-
enabled?: boolean;
|
|
488
|
-
scoreWeight?: number;
|
|
489
|
-
checkMagicLiterals?: boolean;
|
|
490
|
-
checkBooleanTraps?: boolean;
|
|
491
|
-
checkAmbiguousNames?: boolean;
|
|
492
|
-
checkUndocumentedExports?: boolean;
|
|
493
|
-
checkImplicitSideEffects?: boolean;
|
|
494
|
-
checkDeepCallbacks?: boolean;
|
|
495
|
-
minSeverity?: string;
|
|
496
|
-
};
|
|
497
|
-
[ToolName.AgentGrounding]?: {
|
|
498
|
-
enabled?: boolean;
|
|
499
|
-
scoreWeight?: number;
|
|
541
|
+
'pattern-detect'?: PatternDetectConfig;
|
|
542
|
+
'context-analyzer'?: ContextAnalyzerConfig;
|
|
543
|
+
[ToolName.NamingConsistency]?: NamingConsistencyConfig;
|
|
544
|
+
[ToolName.AiSignalClarity]?: AiSignalClarityConfig;
|
|
545
|
+
[ToolName.AgentGrounding]?: BaseToolConfig & {
|
|
500
546
|
maxRecommendedDepth?: number;
|
|
501
547
|
readmeStaleDays?: number;
|
|
502
|
-
additionalVagueNames?: string[];
|
|
503
548
|
};
|
|
504
|
-
[ToolName.TestabilityIndex]?: {
|
|
505
|
-
enabled?: boolean;
|
|
506
|
-
scoreWeight?: number;
|
|
549
|
+
[ToolName.TestabilityIndex]?: BaseToolConfig & {
|
|
507
550
|
minCoverageRatio?: number;
|
|
508
551
|
testPatterns?: string[];
|
|
509
552
|
};
|
|
510
|
-
[ToolName.DocDrift]?: {
|
|
511
|
-
enabled?: boolean;
|
|
512
|
-
scoreWeight?: number;
|
|
553
|
+
[ToolName.DocDrift]?: BaseToolConfig & {
|
|
513
554
|
maxCommits?: number;
|
|
514
555
|
staleMonths?: number;
|
|
515
556
|
};
|
|
516
|
-
[ToolName.DependencyHealth]?: {
|
|
517
|
-
enabled?: boolean;
|
|
518
|
-
scoreWeight?: number;
|
|
557
|
+
[ToolName.DependencyHealth]?: BaseToolConfig & {
|
|
519
558
|
trainingCutoffYear?: number;
|
|
520
559
|
};
|
|
521
|
-
[ToolName.ChangeAmplification]?:
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
};
|
|
525
|
-
[toolName: string]: {
|
|
526
|
-
enabled?: boolean;
|
|
527
|
-
scoreWeight?: number;
|
|
528
|
-
[key: string]: any;
|
|
529
|
-
} | undefined;
|
|
560
|
+
[ToolName.ChangeAmplification]?: BaseToolConfig;
|
|
561
|
+
/** Support for custom/third-party tools */
|
|
562
|
+
[toolName: string]: BaseToolConfig | undefined;
|
|
530
563
|
};
|
|
564
|
+
/** Global scoring and threshold settings */
|
|
531
565
|
scoring?: {
|
|
566
|
+
/** Minimum overall score required to pass CI/CD */
|
|
532
567
|
threshold?: number;
|
|
568
|
+
/** Detailed breakdown in terminal output */
|
|
533
569
|
showBreakdown?: boolean;
|
|
570
|
+
/** Comparison with a previous run */
|
|
534
571
|
compareBaseline?: string;
|
|
572
|
+
/** Auto-persist result to this path */
|
|
535
573
|
saveTo?: string;
|
|
536
574
|
};
|
|
575
|
+
/** Console and file output preferences */
|
|
537
576
|
output?: {
|
|
577
|
+
/** Output format (console, json, html) */
|
|
538
578
|
format?: 'console' | 'json' | 'html';
|
|
579
|
+
/** Target file for the full report */
|
|
539
580
|
file?: string;
|
|
540
581
|
};
|
|
582
|
+
/** Graph Visualizer preferences */
|
|
541
583
|
visualizer?: {
|
|
584
|
+
/** Custom directory grouping levels */
|
|
542
585
|
groupingDirs?: string[];
|
|
586
|
+
/** Performance constraints for large graphs */
|
|
543
587
|
graph?: {
|
|
544
588
|
maxNodes?: number;
|
|
545
589
|
maxEdges?: number;
|
|
@@ -817,10 +861,25 @@ interface ParseStatistics {
|
|
|
817
861
|
}
|
|
818
862
|
|
|
819
863
|
/**
|
|
820
|
-
*
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
864
|
+
* Priority levels for actionable recommendations
|
|
865
|
+
*/
|
|
866
|
+
declare enum RecommendationPriority {
|
|
867
|
+
High = "high",
|
|
868
|
+
Medium = "medium",
|
|
869
|
+
Low = "low"
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* AI Readiness Rating categories
|
|
873
|
+
*/
|
|
874
|
+
declare enum ReadinessRating {
|
|
875
|
+
Excellent = "Excellent",
|
|
876
|
+
Good = "Good",
|
|
877
|
+
Fair = "Fair",
|
|
878
|
+
NeedsWork = "Needs Work",
|
|
879
|
+
Critical = "Critical"
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Output structure for a single tool's scoring analysis
|
|
824
883
|
*/
|
|
825
884
|
interface ToolScoringOutput {
|
|
826
885
|
/** Unique tool identifier (e.g., "pattern-detect") */
|
|
@@ -833,43 +892,58 @@ interface ToolScoringOutput {
|
|
|
833
892
|
rawMetrics: Record<string, any>;
|
|
834
893
|
/** Factors that influenced the score */
|
|
835
894
|
factors: Array<{
|
|
895
|
+
/** Human-readable name of the factor */
|
|
836
896
|
name: string;
|
|
897
|
+
/** Points contribution (positive or negative) */
|
|
837
898
|
impact: number;
|
|
899
|
+
/** Explanation of the factor's impact */
|
|
838
900
|
description: string;
|
|
839
901
|
}>;
|
|
840
902
|
/** Actionable recommendations with estimated impact */
|
|
841
903
|
recommendations: Array<{
|
|
904
|
+
/** The recommended action to take */
|
|
842
905
|
action: string;
|
|
906
|
+
/** Potential points increase if implemented */
|
|
843
907
|
estimatedImpact: number;
|
|
844
|
-
|
|
908
|
+
/** Implementation priority */
|
|
909
|
+
priority: RecommendationPriority | 'high' | 'medium' | 'low';
|
|
845
910
|
}>;
|
|
846
911
|
}
|
|
912
|
+
/**
|
|
913
|
+
* Consolidated scoring result across all tools
|
|
914
|
+
*/
|
|
847
915
|
interface ScoringResult {
|
|
848
916
|
/** Overall AI Readiness Score (0-100) */
|
|
849
917
|
overall: number;
|
|
850
|
-
/** Rating category */
|
|
851
|
-
rating:
|
|
918
|
+
/** Rating category representing the overall readiness */
|
|
919
|
+
rating: ReadinessRating | string;
|
|
852
920
|
/** Timestamp of score calculation */
|
|
853
921
|
timestamp: string;
|
|
854
922
|
/** Tools that contributed to this score */
|
|
855
923
|
toolsUsed: string[];
|
|
856
|
-
/** Breakdown by tool */
|
|
924
|
+
/** Breakdown by individual tool */
|
|
857
925
|
breakdown: ToolScoringOutput[];
|
|
858
|
-
/**
|
|
926
|
+
/** Internal calculation details for transparency */
|
|
859
927
|
calculation: {
|
|
928
|
+
/** Textual representation of the calculation formula */
|
|
860
929
|
formula: string;
|
|
930
|
+
/** Weights applied to each tool */
|
|
861
931
|
weights: Record<string, number>;
|
|
932
|
+
/** Simplified normalized formula output */
|
|
862
933
|
normalized: string;
|
|
863
934
|
};
|
|
864
935
|
}
|
|
936
|
+
/**
|
|
937
|
+
* Configuration options for the scoring system
|
|
938
|
+
*/
|
|
865
939
|
interface ScoringConfig {
|
|
866
|
-
/** Minimum passing score (exit
|
|
940
|
+
/** Minimum passing score (CLI will exit with non-zero if below) */
|
|
867
941
|
threshold?: number;
|
|
868
|
-
/**
|
|
942
|
+
/** Whether to show the detailed tool-by-tool breakdown */
|
|
869
943
|
showBreakdown?: boolean;
|
|
870
|
-
/** Path to baseline JSON for comparison */
|
|
944
|
+
/** Path to a baseline report JSON for trend comparison */
|
|
871
945
|
compareBaseline?: string;
|
|
872
|
-
/**
|
|
946
|
+
/** Target file path to persist the calculated score */
|
|
873
947
|
saveTo?: string;
|
|
874
948
|
}
|
|
875
949
|
/**
|
|
@@ -899,52 +973,92 @@ declare const CONTEXT_TIER_THRESHOLDS: Record<ModelContextTier, {
|
|
|
899
973
|
*/
|
|
900
974
|
declare const SIZE_ADJUSTED_THRESHOLDS: Record<string, number>;
|
|
901
975
|
/**
|
|
902
|
-
* Determine project size tier
|
|
976
|
+
* Determine project size tier based on the total number of files
|
|
977
|
+
*
|
|
978
|
+
* @param fileCount Total number of files in the project
|
|
979
|
+
* @returns A string identifier for the project size tier (xs, small, medium, large, enterprise)
|
|
903
980
|
*/
|
|
904
981
|
declare function getProjectSizeTier(fileCount: number): keyof typeof SIZE_ADJUSTED_THRESHOLDS;
|
|
905
982
|
/**
|
|
906
|
-
*
|
|
983
|
+
* Calculate the recommended minimum AI readiness threshold for a project
|
|
984
|
+
*
|
|
985
|
+
* @param fileCount Total number of files in the project
|
|
986
|
+
* @param modelTier The model context tier targeted (compact, standard, extended, frontier)
|
|
987
|
+
* @returns The recommended score threshold (0-100)
|
|
907
988
|
*/
|
|
908
989
|
declare function getRecommendedThreshold(fileCount: number, modelTier?: ModelContextTier): number;
|
|
909
990
|
/**
|
|
910
|
-
* Normalize tool name from shorthand to canonical
|
|
991
|
+
* Normalize a tool name from a shorthand or alias to its canonical ID
|
|
992
|
+
*
|
|
993
|
+
* @param shortName The tool shorthand or alias name
|
|
994
|
+
* @returns The canonical tool ID
|
|
911
995
|
*/
|
|
912
996
|
declare function normalizeToolName(shortName: string): string;
|
|
913
997
|
/**
|
|
914
|
-
*
|
|
998
|
+
* Retrieve the weight for a specific tool, considering overrides
|
|
999
|
+
*
|
|
1000
|
+
* @param toolName The canonical tool ID
|
|
1001
|
+
* @param toolConfig Optional configuration for the tool containing a weight
|
|
1002
|
+
* @param cliOverride Optional weight override from the CLI
|
|
1003
|
+
* @returns The weight to be used for this tool in overall scoring
|
|
915
1004
|
*/
|
|
916
1005
|
declare function getToolWeight(toolName: string, toolConfig?: {
|
|
917
1006
|
scoreWeight?: number;
|
|
918
1007
|
}, cliOverride?: number): number;
|
|
919
1008
|
/**
|
|
920
|
-
* Parse weight string
|
|
1009
|
+
* Parse a comma-separated weight string (e.g. "patterns:30,context:10")
|
|
1010
|
+
*
|
|
1011
|
+
* @param weightStr The raw weight string from the CLI or config
|
|
1012
|
+
* @returns A Map of tool IDs to their parsed weights
|
|
921
1013
|
*/
|
|
922
1014
|
declare function parseWeightString(weightStr?: string): Map<string, number>;
|
|
923
1015
|
/**
|
|
924
|
-
* Calculate overall AI Readiness Score
|
|
1016
|
+
* Calculate the overall consolidated AI Readiness Score
|
|
1017
|
+
*
|
|
1018
|
+
* @param toolOutputs Map of tool IDs to their individual scoring outputs
|
|
1019
|
+
* @param config Optional global configuration
|
|
1020
|
+
* @param cliWeights Optional weight overrides from the CLI
|
|
1021
|
+
* @returns Consolidate ScoringResult including overall score and rating
|
|
925
1022
|
*/
|
|
926
1023
|
declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutput>, config?: any, cliWeights?: Map<string, number>): ScoringResult;
|
|
927
1024
|
/**
|
|
928
1025
|
* Convert numeric score to rating category
|
|
1026
|
+
*
|
|
1027
|
+
* @param score The numerical AI readiness score (0-100)
|
|
1028
|
+
* @returns The corresponding ReadinessRating category
|
|
929
1029
|
*/
|
|
930
|
-
declare function getRating(score: number):
|
|
1030
|
+
declare function getRating(score: number): ReadinessRating;
|
|
931
1031
|
/**
|
|
932
1032
|
* Convert score to rating with project-size awareness.
|
|
1033
|
+
*
|
|
1034
|
+
* @param score The numerical AI readiness score
|
|
1035
|
+
* @param fileCount Total number of files in the project
|
|
1036
|
+
* @param modelTier The model context tier being targeted
|
|
1037
|
+
* @returns The size-adjusted ReadinessRating
|
|
933
1038
|
*/
|
|
934
|
-
declare function getRatingWithContext(score: number, fileCount: number, modelTier?: ModelContextTier):
|
|
1039
|
+
declare function getRatingWithContext(score: number, fileCount: number, modelTier?: ModelContextTier): ReadinessRating;
|
|
935
1040
|
/**
|
|
936
|
-
* Get rating display properties
|
|
1041
|
+
* Get rating display properties (emoji and color)
|
|
1042
|
+
*
|
|
1043
|
+
* @param rating The readiness rating category
|
|
1044
|
+
* @returns Object containing display emoji and color string
|
|
937
1045
|
*/
|
|
938
|
-
declare function getRatingDisplay(rating:
|
|
1046
|
+
declare function getRatingDisplay(rating: ReadinessRating | string): {
|
|
939
1047
|
emoji: string;
|
|
940
1048
|
color: string;
|
|
941
1049
|
};
|
|
942
1050
|
/**
|
|
943
|
-
* Format score for display
|
|
1051
|
+
* Format score for human-readable console display
|
|
1052
|
+
*
|
|
1053
|
+
* @param result The consolidated scoring result
|
|
1054
|
+
* @returns Formatted string for display
|
|
944
1055
|
*/
|
|
945
1056
|
declare function formatScore(result: ScoringResult): string;
|
|
946
1057
|
/**
|
|
947
|
-
* Format individual tool score for display
|
|
1058
|
+
* Format individual tool score for detailed console display
|
|
1059
|
+
*
|
|
1060
|
+
* @param output The scoring output for a single tool
|
|
1061
|
+
* @returns Formatted string with factors and recommendations
|
|
948
1062
|
*/
|
|
949
1063
|
declare function formatToolScore(output: ToolScoringOutput): string;
|
|
950
1064
|
|
|
@@ -961,4 +1075,4 @@ declare function formatToolScore(output: ToolScoringOutput): string;
|
|
|
961
1075
|
*/
|
|
962
1076
|
declare function generateHTML(graph: GraphData): string;
|
|
963
1077
|
|
|
964
|
-
export { type AIReadyConfig, type AcceptancePrediction, type AnalysisResult, AnalysisResultSchema, AnalysisStatus, AnalysisStatusSchema, type BusinessReport, COMMON_FINE_TUNING_OPTIONS, CONTEXT_TIER_THRESHOLDS, type CommonASTNode, type ComprehensionDifficulty, type CostConfig, DEFAULT_TOOL_WEIGHTS, type ExportInfo, FRIENDLY_TOOL_NAMES, GLOBAL_INFRA_OPTIONS, GLOBAL_SCAN_OPTIONS, type GraphData, type GraphEdge, type GraphIssueSeverity, type GraphMetadata, type GraphNode, type ImportInfo, type Issue, IssueSchema, IssueType, IssueTypeSchema, LANGUAGE_EXTENSIONS, Language, type LanguageConfig, type LanguageParser, type Location, LocationSchema, type Metrics, MetricsSchema, type ModelContextTier, ModelTier, ModelTierSchema, type NamingConvention, ParseError, type ParseResult, type ParseStatistics, type ProductivityImpact, type Report, SIZE_ADJUSTED_THRESHOLDS, type ScanOptions, type ScoringConfig, type ScoringResult, Severity, SeveritySchema, type SourceLocation, type SourceRange, type SpokeOutput, SpokeOutputSchema, type SpokeSummary, SpokeSummarySchema, TOOL_NAME_MAP, type TechnicalValueChain, type TechnicalValueChainSummary, type TokenBudget, ToolName, ToolNameSchema, type ToolScoringOutput, type UnifiedReport, UnifiedReportSchema, calculateOverallScore, formatScore, formatToolScore, generateHTML, getProjectSizeTier, getRating, getRatingDisplay, getRatingWithContext, getRecommendedThreshold, getToolWeight, normalizeToolName, parseWeightString };
|
|
1078
|
+
export { type AIReadyConfig, type AcceptancePrediction, type AiSignalClarityConfig, type AnalysisResult, AnalysisResultSchema, AnalysisStatus, AnalysisStatusSchema, type BaseToolConfig, type BusinessReport, COMMON_FINE_TUNING_OPTIONS, CONTEXT_TIER_THRESHOLDS, type CommonASTNode, type ComprehensionDifficulty, type ContextAnalyzerConfig, type CostConfig, DEFAULT_TOOL_WEIGHTS, type ExportInfo, FRIENDLY_TOOL_NAMES, GLOBAL_INFRA_OPTIONS, GLOBAL_SCAN_OPTIONS, type GraphData, type GraphEdge, type GraphIssueSeverity, type GraphMetadata, type GraphNode, type ImportInfo, type Issue, IssueSchema, IssueType, IssueTypeSchema, LANGUAGE_EXTENSIONS, Language, type LanguageConfig, type LanguageParser, type Location, LocationSchema, type Metrics, MetricsSchema, type ModelContextTier, ModelTier, ModelTierSchema, type NamingConsistencyConfig, type NamingConvention, ParseError, type ParseResult, type ParseStatistics, type PatternDetectConfig, type ProductivityImpact, ReadinessRating, RecommendationPriority, type Report, SIZE_ADJUSTED_THRESHOLDS, type ScanOptions, type ScoringConfig, type ScoringResult, Severity, SeveritySchema, type SourceLocation, type SourceRange, type SpokeOutput, SpokeOutputSchema, type SpokeSummary, SpokeSummarySchema, TOOL_NAME_MAP, type TechnicalValueChain, type TechnicalValueChainSummary, type TokenBudget, ToolName, ToolNameSchema, type ToolScoringOutput, type UnifiedReport, UnifiedReportSchema, calculateOverallScore, formatScore, formatToolScore, generateHTML, getProjectSizeTier, getRating, getRatingDisplay, getRatingWithContext, getRecommendedThreshold, getToolWeight, normalizeToolName, parseWeightString };
|
package/dist/client.js
CHANGED
|
@@ -39,6 +39,8 @@ __export(client_exports, {
|
|
|
39
39
|
ModelTier: () => ModelTier,
|
|
40
40
|
ModelTierSchema: () => ModelTierSchema,
|
|
41
41
|
ParseError: () => ParseError,
|
|
42
|
+
ReadinessRating: () => ReadinessRating,
|
|
43
|
+
RecommendationPriority: () => RecommendationPriority,
|
|
42
44
|
SIZE_ADJUSTED_THRESHOLDS: () => SIZE_ADJUSTED_THRESHOLDS,
|
|
43
45
|
Severity: () => Severity,
|
|
44
46
|
SeveritySchema: () => SeveritySchema,
|
|
@@ -203,7 +205,12 @@ var UnifiedReportSchema = import_zod.z.object({
|
|
|
203
205
|
totalFiles: import_zod.z.number(),
|
|
204
206
|
totalIssues: import_zod.z.number(),
|
|
205
207
|
criticalIssues: import_zod.z.number(),
|
|
206
|
-
majorIssues: import_zod.z.number()
|
|
208
|
+
majorIssues: import_zod.z.number(),
|
|
209
|
+
businessImpact: import_zod.z.object({
|
|
210
|
+
estimatedMonthlyWaste: import_zod.z.number().optional(),
|
|
211
|
+
potentialSavings: import_zod.z.number().optional(),
|
|
212
|
+
productivityHours: import_zod.z.number().optional()
|
|
213
|
+
}).optional()
|
|
207
214
|
}),
|
|
208
215
|
results: import_zod.z.array(AnalysisResultSchema),
|
|
209
216
|
scoring: import_zod.z.object({
|
|
@@ -282,6 +289,20 @@ var ParseError = class extends Error {
|
|
|
282
289
|
};
|
|
283
290
|
|
|
284
291
|
// src/scoring.ts
|
|
292
|
+
var RecommendationPriority = /* @__PURE__ */ ((RecommendationPriority2) => {
|
|
293
|
+
RecommendationPriority2["High"] = "high";
|
|
294
|
+
RecommendationPriority2["Medium"] = "medium";
|
|
295
|
+
RecommendationPriority2["Low"] = "low";
|
|
296
|
+
return RecommendationPriority2;
|
|
297
|
+
})(RecommendationPriority || {});
|
|
298
|
+
var ReadinessRating = /* @__PURE__ */ ((ReadinessRating2) => {
|
|
299
|
+
ReadinessRating2["Excellent"] = "Excellent";
|
|
300
|
+
ReadinessRating2["Good"] = "Good";
|
|
301
|
+
ReadinessRating2["Fair"] = "Fair";
|
|
302
|
+
ReadinessRating2["NeedsWork"] = "Needs Work";
|
|
303
|
+
ReadinessRating2["Critical"] = "Critical";
|
|
304
|
+
return ReadinessRating2;
|
|
305
|
+
})(ReadinessRating || {});
|
|
285
306
|
var DEFAULT_TOOL_WEIGHTS = {
|
|
286
307
|
["pattern-detect" /* PatternDetect */]: 22,
|
|
287
308
|
["context-analyzer" /* ContextAnalyzer */]: 19,
|
|
@@ -356,10 +377,10 @@ function parseWeightString(weightStr) {
|
|
|
356
377
|
if (!weightStr) return weights;
|
|
357
378
|
const pairs = weightStr.split(",");
|
|
358
379
|
for (const pair of pairs) {
|
|
359
|
-
const [toolShortName,
|
|
360
|
-
if (toolShortName &&
|
|
380
|
+
const [toolShortName, weightValueStr] = pair.split(":");
|
|
381
|
+
if (toolShortName && weightValueStr) {
|
|
361
382
|
const toolName = normalizeToolName(toolShortName.trim());
|
|
362
|
-
const weight = parseInt(
|
|
383
|
+
const weight = parseInt(weightValueStr.trim(), 10);
|
|
363
384
|
if (!isNaN(weight) && weight > 0) {
|
|
364
385
|
weights.set(toolName, weight);
|
|
365
386
|
}
|
|
@@ -414,11 +435,11 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
414
435
|
};
|
|
415
436
|
}
|
|
416
437
|
function getRating(score) {
|
|
417
|
-
if (score >= 90) return "Excellent"
|
|
418
|
-
if (score >= 75) return "Good"
|
|
419
|
-
if (score >= 60) return "Fair"
|
|
420
|
-
if (score >= 40) return "Needs Work"
|
|
421
|
-
return "Critical"
|
|
438
|
+
if (score >= 90) return "Excellent" /* Excellent */;
|
|
439
|
+
if (score >= 75) return "Good" /* Good */;
|
|
440
|
+
if (score >= 60) return "Fair" /* Fair */;
|
|
441
|
+
if (score >= 40) return "Needs Work" /* NeedsWork */;
|
|
442
|
+
return "Critical" /* Critical */;
|
|
422
443
|
}
|
|
423
444
|
function getRatingWithContext(score, fileCount, modelTier = "standard") {
|
|
424
445
|
const threshold = getRecommendedThreshold(fileCount, modelTier);
|
|
@@ -427,16 +448,18 @@ function getRatingWithContext(score, fileCount, modelTier = "standard") {
|
|
|
427
448
|
}
|
|
428
449
|
function getRatingDisplay(rating) {
|
|
429
450
|
switch (rating) {
|
|
430
|
-
case "Excellent"
|
|
451
|
+
case "Excellent" /* Excellent */:
|
|
431
452
|
return { emoji: "\u2705", color: "green" };
|
|
432
|
-
case "Good"
|
|
453
|
+
case "Good" /* Good */:
|
|
433
454
|
return { emoji: "\u{1F44D}", color: "blue" };
|
|
434
|
-
case "Fair"
|
|
455
|
+
case "Fair" /* Fair */:
|
|
435
456
|
return { emoji: "\u26A0\uFE0F", color: "yellow" };
|
|
436
|
-
case "Needs Work"
|
|
457
|
+
case "Needs Work" /* NeedsWork */:
|
|
437
458
|
return { emoji: "\u{1F528}", color: "orange" };
|
|
438
|
-
case "Critical"
|
|
459
|
+
case "Critical" /* Critical */:
|
|
439
460
|
return { emoji: "\u274C", color: "red" };
|
|
461
|
+
default:
|
|
462
|
+
return { emoji: "\u2753", color: "gray" };
|
|
440
463
|
}
|
|
441
464
|
}
|
|
442
465
|
function formatScore(result) {
|
|
@@ -461,7 +484,12 @@ function formatToolScore(output) {
|
|
|
461
484
|
result += ` Recommendations:
|
|
462
485
|
`;
|
|
463
486
|
output.recommendations.forEach((rec, i) => {
|
|
464
|
-
|
|
487
|
+
let priorityIcon = "\u{1F535}";
|
|
488
|
+
const prio = rec.priority;
|
|
489
|
+
if (prio === "high" /* High */ || prio === "high")
|
|
490
|
+
priorityIcon = "\u{1F534}";
|
|
491
|
+
else if (prio === "medium" /* Medium */ || prio === "medium")
|
|
492
|
+
priorityIcon = "\u{1F7E1}";
|
|
465
493
|
result += ` ${i + 1}. ${priorityIcon} ${rec.action}
|
|
466
494
|
`;
|
|
467
495
|
result += ` Impact: +${rec.estimatedImpact} points
|
|
@@ -658,6 +686,8 @@ function generateHTML(graph) {
|
|
|
658
686
|
ModelTier,
|
|
659
687
|
ModelTierSchema,
|
|
660
688
|
ParseError,
|
|
689
|
+
ReadinessRating,
|
|
690
|
+
RecommendationPriority,
|
|
661
691
|
SIZE_ADJUSTED_THRESHOLDS,
|
|
662
692
|
Severity,
|
|
663
693
|
SeveritySchema,
|
package/dist/client.mjs
CHANGED
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
ModelTier,
|
|
19
19
|
ModelTierSchema,
|
|
20
20
|
ParseError,
|
|
21
|
+
ReadinessRating,
|
|
22
|
+
RecommendationPriority,
|
|
21
23
|
SIZE_ADJUSTED_THRESHOLDS,
|
|
22
24
|
Severity,
|
|
23
25
|
SeveritySchema,
|
|
@@ -39,7 +41,7 @@ import {
|
|
|
39
41
|
getToolWeight,
|
|
40
42
|
normalizeToolName,
|
|
41
43
|
parseWeightString
|
|
42
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-SWTDBVYJ.mjs";
|
|
43
45
|
export {
|
|
44
46
|
AnalysisResultSchema,
|
|
45
47
|
AnalysisStatus,
|
|
@@ -60,6 +62,8 @@ export {
|
|
|
60
62
|
ModelTier,
|
|
61
63
|
ModelTierSchema,
|
|
62
64
|
ParseError,
|
|
65
|
+
ReadinessRating,
|
|
66
|
+
RecommendationPriority,
|
|
63
67
|
SIZE_ADJUSTED_THRESHOLDS,
|
|
64
68
|
Severity,
|
|
65
69
|
SeveritySchema,
|