@aiready/core 0.19.3 → 0.21.0
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-QAFB3HXQ.mjs +574 -0
- package/dist/chunk-YCA4FTEK.mjs +582 -0
- package/dist/client.d.mts +53 -49
- package/dist/client.d.ts +53 -49
- package/dist/client.js +87 -39
- package/dist/client.mjs +9 -1
- package/dist/index.d.mts +54 -3
- package/dist/index.d.ts +54 -3
- package/dist/index.js +185 -48
- package/dist/index.mjs +106 -10
- package/package.json +1 -1
package/dist/client.d.mts
CHANGED
|
@@ -10,6 +10,30 @@ declare enum Severity {
|
|
|
10
10
|
Info = "info"
|
|
11
11
|
}
|
|
12
12
|
declare const SeveritySchema: z.ZodEnum<typeof Severity>;
|
|
13
|
+
/**
|
|
14
|
+
* Canonical Tool Names (IDs)
|
|
15
|
+
* Used everywhere as the single source of truth for tool identification.
|
|
16
|
+
*/
|
|
17
|
+
declare enum ToolName {
|
|
18
|
+
PatternDetect = "pattern-detect",
|
|
19
|
+
ContextAnalyzer = "context-analyzer",
|
|
20
|
+
NamingConsistency = "naming-consistency",
|
|
21
|
+
AiSignalClarity = "ai-signal-clarity",
|
|
22
|
+
AgentGrounding = "agent-grounding",
|
|
23
|
+
TestabilityIndex = "testability-index",
|
|
24
|
+
DocDrift = "doc-drift",
|
|
25
|
+
DependencyHealth = "dependency-health",
|
|
26
|
+
ChangeAmplification = "change-amplification",
|
|
27
|
+
CognitiveLoad = "cognitive-load",
|
|
28
|
+
PatternEntropy = "pattern-entropy",
|
|
29
|
+
ConceptCohesion = "concept-cohesion",
|
|
30
|
+
SemanticDistance = "semantic-distance"
|
|
31
|
+
}
|
|
32
|
+
declare const ToolNameSchema: z.ZodEnum<typeof ToolName>;
|
|
33
|
+
/**
|
|
34
|
+
* Friendly labels for UI display
|
|
35
|
+
*/
|
|
36
|
+
declare const FRIENDLY_TOOL_NAMES: Record<ToolName, string>;
|
|
13
37
|
/**
|
|
14
38
|
* Standardized issue types across all AIReady tools.
|
|
15
39
|
*/
|
|
@@ -139,6 +163,17 @@ declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
139
163
|
}, z.core.$strip>;
|
|
140
164
|
}, z.core.$strip>;
|
|
141
165
|
type AnalysisResult = z.infer<typeof AnalysisResultSchema>;
|
|
166
|
+
/**
|
|
167
|
+
* Standard spoke tool summary schema.
|
|
168
|
+
*/
|
|
169
|
+
declare const SpokeSummarySchema: z.ZodObject<{
|
|
170
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
totalIssues: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
criticalIssues: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
majorIssues: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
176
|
+
type SpokeSummary = z.infer<typeof SpokeSummarySchema>;
|
|
142
177
|
/**
|
|
143
178
|
* Standard spoke tool output contract.
|
|
144
179
|
*/
|
|
@@ -176,11 +211,17 @@ declare const SpokeOutputSchema: z.ZodObject<{
|
|
|
176
211
|
totalExports: z.ZodOptional<z.ZodNumber>;
|
|
177
212
|
}, z.core.$strip>;
|
|
178
213
|
}, z.core.$strip>>;
|
|
179
|
-
summary: z.
|
|
214
|
+
summary: z.ZodObject<{
|
|
215
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
totalIssues: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
criticalIssues: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
majorIssues: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
180
221
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
181
222
|
toolName: z.ZodString;
|
|
182
|
-
version: z.ZodString
|
|
183
|
-
timestamp: z.ZodString
|
|
223
|
+
version: z.ZodOptional<z.ZodString>;
|
|
224
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
184
225
|
}, z.core.$catchall<z.ZodAny>>>;
|
|
185
226
|
}, z.core.$strip>;
|
|
186
227
|
type SpokeOutput = z.infer<typeof SpokeOutputSchema>;
|
|
@@ -232,7 +273,7 @@ declare const UnifiedReportSchema: z.ZodObject<{
|
|
|
232
273
|
rating: z.ZodString;
|
|
233
274
|
timestamp: z.ZodString;
|
|
234
275
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
235
|
-
toolName: z.ZodString
|
|
276
|
+
toolName: z.ZodUnion<readonly [z.ZodEnum<typeof ToolName>, z.ZodString]>;
|
|
236
277
|
score: z.ZodNumber;
|
|
237
278
|
}, z.core.$catchall<z.ZodAny>>>;
|
|
238
279
|
}, z.core.$strip>>;
|
|
@@ -753,53 +794,26 @@ interface ScoringConfig {
|
|
|
753
794
|
* Default weights for known tools. Weights sum to 100 and read directly as
|
|
754
795
|
* percentage contribution to the overall score.
|
|
755
796
|
* New tools get weight of 5 if not specified.
|
|
756
|
-
*
|
|
757
|
-
* Weight philosophy:
|
|
758
|
-
* - pattern-detect (22%): Semantic duplication directly wastes token budget and
|
|
759
|
-
* confuses AI with contradictory in-context examples.
|
|
760
|
-
* - context-analyzer (19%): Context limits are the primary hard constraint on
|
|
761
|
-
* AI effectiveness regardless of model size.
|
|
762
|
-
* - consistency (14%): Naming/pattern inconsistency degrades AI intent understanding
|
|
763
|
-
* proportionally to codebase size.
|
|
764
|
-
* - ai-signal-clarity (11%): Code patterns empirically causing AI to generate
|
|
765
|
-
* confidently wrong outputs — critical for agentic use cases.
|
|
766
|
-
* - agent-grounding (10%): How well an autonomous agent can navigate unaided —
|
|
767
|
-
* increasingly important as agentic workflows grow.
|
|
768
|
-
* - testability (10%): AI changes without verifiability create hidden risk.
|
|
769
|
-
* - doc-drift (8%): Stale docs actively mislead AI; planned spoke.
|
|
770
|
-
* - deps (6%): Dependency health affects AI suggestion accuracy; planned spoke.
|
|
771
797
|
*/
|
|
772
798
|
declare const DEFAULT_TOOL_WEIGHTS: Record<string, number>;
|
|
773
799
|
/**
|
|
774
|
-
* Tool name normalization map (shorthand ->
|
|
800
|
+
* Tool name normalization map (shorthand -> canonical name)
|
|
775
801
|
*/
|
|
776
802
|
declare const TOOL_NAME_MAP: Record<string, string>;
|
|
777
803
|
/**
|
|
778
804
|
* Model context tiers for context-aware threshold calibration.
|
|
779
|
-
*
|
|
780
|
-
* As AI models evolve from 32k → 128k → 1M+ context windows, absolute token
|
|
781
|
-
* thresholds become meaningless. Use these tiers to adjust context-analyzer
|
|
782
|
-
* thresholds relative to the model your team uses.
|
|
783
805
|
*/
|
|
784
806
|
type ModelContextTier = 'compact' | 'standard' | 'extended' | 'frontier';
|
|
785
807
|
/**
|
|
786
808
|
* Context budget thresholds per tier.
|
|
787
|
-
* Scores are interpolated between these boundaries.
|
|
788
809
|
*/
|
|
789
810
|
declare const CONTEXT_TIER_THRESHOLDS: Record<ModelContextTier, {
|
|
790
|
-
/** Below this → full score for context budget */
|
|
791
811
|
idealTokens: number;
|
|
792
|
-
/** Above this → critical penalty for context budget */
|
|
793
812
|
criticalTokens: number;
|
|
794
|
-
/** Suggested max import depth before penalty */
|
|
795
813
|
idealDepth: number;
|
|
796
814
|
}>;
|
|
797
815
|
/**
|
|
798
816
|
* Project-size-adjusted minimum thresholds.
|
|
799
|
-
*
|
|
800
|
-
* Large codebases structurally accrue more issues. A score of 65 in an
|
|
801
|
-
* enterprise codebase is roughly equivalent to 75 in a small project.
|
|
802
|
-
* These are recommended minimum passing thresholds by project size.
|
|
803
817
|
*/
|
|
804
818
|
declare const SIZE_ADJUSTED_THRESHOLDS: Record<string, number>;
|
|
805
819
|
/**
|
|
@@ -811,30 +825,21 @@ declare function getProjectSizeTier(fileCount: number): keyof typeof SIZE_ADJUST
|
|
|
811
825
|
*/
|
|
812
826
|
declare function getRecommendedThreshold(fileCount: number, modelTier?: ModelContextTier): number;
|
|
813
827
|
/**
|
|
814
|
-
* Normalize tool name from shorthand to
|
|
828
|
+
* Normalize tool name from shorthand to canonical name
|
|
815
829
|
*/
|
|
816
830
|
declare function normalizeToolName(shortName: string): string;
|
|
817
831
|
/**
|
|
818
|
-
* Get tool weight
|
|
819
|
-
* 1. CLI override
|
|
820
|
-
* 2. Tool config scoreWeight
|
|
821
|
-
* 3. Default weight
|
|
822
|
-
* 4. 10 (for unknown tools)
|
|
832
|
+
* Get tool weight
|
|
823
833
|
*/
|
|
824
834
|
declare function getToolWeight(toolName: string, toolConfig?: {
|
|
825
835
|
scoreWeight?: number;
|
|
826
836
|
}, cliOverride?: number): number;
|
|
827
837
|
/**
|
|
828
|
-
* Parse weight string from CLI
|
|
838
|
+
* Parse weight string from CLI
|
|
829
839
|
*/
|
|
830
840
|
declare function parseWeightString(weightStr?: string): Map<string, number>;
|
|
831
841
|
/**
|
|
832
|
-
* Calculate overall AI Readiness Score
|
|
833
|
-
*
|
|
834
|
-
* Formula: Σ(tool_score × tool_weight) / Σ(active_tool_weights)
|
|
835
|
-
*
|
|
836
|
-
* This allows dynamic composition - score adjusts automatically
|
|
837
|
-
* based on which tools actually ran.
|
|
842
|
+
* Calculate overall AI Readiness Score
|
|
838
843
|
*/
|
|
839
844
|
declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutput>, config?: any, cliWeights?: Map<string, number>): ScoringResult;
|
|
840
845
|
/**
|
|
@@ -843,18 +848,17 @@ declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutpu
|
|
|
843
848
|
declare function getRating(score: number): ScoringResult['rating'];
|
|
844
849
|
/**
|
|
845
850
|
* Convert score to rating with project-size awareness.
|
|
846
|
-
* Use this for display to give fairer assessment to large codebases.
|
|
847
851
|
*/
|
|
848
852
|
declare function getRatingWithContext(score: number, fileCount: number, modelTier?: ModelContextTier): ScoringResult['rating'];
|
|
849
853
|
/**
|
|
850
|
-
* Get rating
|
|
854
|
+
* Get rating display properties
|
|
851
855
|
*/
|
|
852
856
|
declare function getRatingDisplay(rating: ScoringResult['rating']): {
|
|
853
857
|
emoji: string;
|
|
854
858
|
color: string;
|
|
855
859
|
};
|
|
856
860
|
/**
|
|
857
|
-
* Format score for display
|
|
861
|
+
* Format score for display
|
|
858
862
|
*/
|
|
859
863
|
declare function formatScore(result: ScoringResult): string;
|
|
860
864
|
/**
|
|
@@ -875,4 +879,4 @@ declare function formatToolScore(output: ToolScoringOutput): string;
|
|
|
875
879
|
*/
|
|
876
880
|
declare function generateHTML(graph: GraphData): string;
|
|
877
881
|
|
|
878
|
-
export { type AIReadyConfig, type AcceptancePrediction, type AnalysisResult, AnalysisResultSchema, AnalysisStatus, AnalysisStatusSchema, type BusinessReport, CONTEXT_TIER_THRESHOLDS, type CommonASTNode, type ComprehensionDifficulty, type CostConfig, DEFAULT_TOOL_WEIGHTS, type ExportInfo, 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, TOOL_NAME_MAP, type TechnicalValueChain, type TechnicalValueChainSummary, type TokenBudget, type ToolScoringOutput, type UnifiedReport, UnifiedReportSchema, calculateOverallScore, formatScore, formatToolScore, generateHTML, getProjectSizeTier, getRating, getRatingDisplay, getRatingWithContext, getRecommendedThreshold, getToolWeight, normalizeToolName, parseWeightString };
|
|
882
|
+
export { type AIReadyConfig, type AcceptancePrediction, type AnalysisResult, AnalysisResultSchema, AnalysisStatus, AnalysisStatusSchema, type BusinessReport, CONTEXT_TIER_THRESHOLDS, type CommonASTNode, type ComprehensionDifficulty, type CostConfig, DEFAULT_TOOL_WEIGHTS, type ExportInfo, FRIENDLY_TOOL_NAMES, 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 };
|
package/dist/client.d.ts
CHANGED
|
@@ -10,6 +10,30 @@ declare enum Severity {
|
|
|
10
10
|
Info = "info"
|
|
11
11
|
}
|
|
12
12
|
declare const SeveritySchema: z.ZodEnum<typeof Severity>;
|
|
13
|
+
/**
|
|
14
|
+
* Canonical Tool Names (IDs)
|
|
15
|
+
* Used everywhere as the single source of truth for tool identification.
|
|
16
|
+
*/
|
|
17
|
+
declare enum ToolName {
|
|
18
|
+
PatternDetect = "pattern-detect",
|
|
19
|
+
ContextAnalyzer = "context-analyzer",
|
|
20
|
+
NamingConsistency = "naming-consistency",
|
|
21
|
+
AiSignalClarity = "ai-signal-clarity",
|
|
22
|
+
AgentGrounding = "agent-grounding",
|
|
23
|
+
TestabilityIndex = "testability-index",
|
|
24
|
+
DocDrift = "doc-drift",
|
|
25
|
+
DependencyHealth = "dependency-health",
|
|
26
|
+
ChangeAmplification = "change-amplification",
|
|
27
|
+
CognitiveLoad = "cognitive-load",
|
|
28
|
+
PatternEntropy = "pattern-entropy",
|
|
29
|
+
ConceptCohesion = "concept-cohesion",
|
|
30
|
+
SemanticDistance = "semantic-distance"
|
|
31
|
+
}
|
|
32
|
+
declare const ToolNameSchema: z.ZodEnum<typeof ToolName>;
|
|
33
|
+
/**
|
|
34
|
+
* Friendly labels for UI display
|
|
35
|
+
*/
|
|
36
|
+
declare const FRIENDLY_TOOL_NAMES: Record<ToolName, string>;
|
|
13
37
|
/**
|
|
14
38
|
* Standardized issue types across all AIReady tools.
|
|
15
39
|
*/
|
|
@@ -139,6 +163,17 @@ declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
139
163
|
}, z.core.$strip>;
|
|
140
164
|
}, z.core.$strip>;
|
|
141
165
|
type AnalysisResult = z.infer<typeof AnalysisResultSchema>;
|
|
166
|
+
/**
|
|
167
|
+
* Standard spoke tool summary schema.
|
|
168
|
+
*/
|
|
169
|
+
declare const SpokeSummarySchema: z.ZodObject<{
|
|
170
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
totalIssues: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
criticalIssues: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
majorIssues: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
176
|
+
type SpokeSummary = z.infer<typeof SpokeSummarySchema>;
|
|
142
177
|
/**
|
|
143
178
|
* Standard spoke tool output contract.
|
|
144
179
|
*/
|
|
@@ -176,11 +211,17 @@ declare const SpokeOutputSchema: z.ZodObject<{
|
|
|
176
211
|
totalExports: z.ZodOptional<z.ZodNumber>;
|
|
177
212
|
}, z.core.$strip>;
|
|
178
213
|
}, z.core.$strip>>;
|
|
179
|
-
summary: z.
|
|
214
|
+
summary: z.ZodObject<{
|
|
215
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
totalIssues: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
criticalIssues: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
majorIssues: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
180
221
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
181
222
|
toolName: z.ZodString;
|
|
182
|
-
version: z.ZodString
|
|
183
|
-
timestamp: z.ZodString
|
|
223
|
+
version: z.ZodOptional<z.ZodString>;
|
|
224
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
184
225
|
}, z.core.$catchall<z.ZodAny>>>;
|
|
185
226
|
}, z.core.$strip>;
|
|
186
227
|
type SpokeOutput = z.infer<typeof SpokeOutputSchema>;
|
|
@@ -232,7 +273,7 @@ declare const UnifiedReportSchema: z.ZodObject<{
|
|
|
232
273
|
rating: z.ZodString;
|
|
233
274
|
timestamp: z.ZodString;
|
|
234
275
|
breakdown: z.ZodArray<z.ZodObject<{
|
|
235
|
-
toolName: z.ZodString
|
|
276
|
+
toolName: z.ZodUnion<readonly [z.ZodEnum<typeof ToolName>, z.ZodString]>;
|
|
236
277
|
score: z.ZodNumber;
|
|
237
278
|
}, z.core.$catchall<z.ZodAny>>>;
|
|
238
279
|
}, z.core.$strip>>;
|
|
@@ -753,53 +794,26 @@ interface ScoringConfig {
|
|
|
753
794
|
* Default weights for known tools. Weights sum to 100 and read directly as
|
|
754
795
|
* percentage contribution to the overall score.
|
|
755
796
|
* New tools get weight of 5 if not specified.
|
|
756
|
-
*
|
|
757
|
-
* Weight philosophy:
|
|
758
|
-
* - pattern-detect (22%): Semantic duplication directly wastes token budget and
|
|
759
|
-
* confuses AI with contradictory in-context examples.
|
|
760
|
-
* - context-analyzer (19%): Context limits are the primary hard constraint on
|
|
761
|
-
* AI effectiveness regardless of model size.
|
|
762
|
-
* - consistency (14%): Naming/pattern inconsistency degrades AI intent understanding
|
|
763
|
-
* proportionally to codebase size.
|
|
764
|
-
* - ai-signal-clarity (11%): Code patterns empirically causing AI to generate
|
|
765
|
-
* confidently wrong outputs — critical for agentic use cases.
|
|
766
|
-
* - agent-grounding (10%): How well an autonomous agent can navigate unaided —
|
|
767
|
-
* increasingly important as agentic workflows grow.
|
|
768
|
-
* - testability (10%): AI changes without verifiability create hidden risk.
|
|
769
|
-
* - doc-drift (8%): Stale docs actively mislead AI; planned spoke.
|
|
770
|
-
* - deps (6%): Dependency health affects AI suggestion accuracy; planned spoke.
|
|
771
797
|
*/
|
|
772
798
|
declare const DEFAULT_TOOL_WEIGHTS: Record<string, number>;
|
|
773
799
|
/**
|
|
774
|
-
* Tool name normalization map (shorthand ->
|
|
800
|
+
* Tool name normalization map (shorthand -> canonical name)
|
|
775
801
|
*/
|
|
776
802
|
declare const TOOL_NAME_MAP: Record<string, string>;
|
|
777
803
|
/**
|
|
778
804
|
* Model context tiers for context-aware threshold calibration.
|
|
779
|
-
*
|
|
780
|
-
* As AI models evolve from 32k → 128k → 1M+ context windows, absolute token
|
|
781
|
-
* thresholds become meaningless. Use these tiers to adjust context-analyzer
|
|
782
|
-
* thresholds relative to the model your team uses.
|
|
783
805
|
*/
|
|
784
806
|
type ModelContextTier = 'compact' | 'standard' | 'extended' | 'frontier';
|
|
785
807
|
/**
|
|
786
808
|
* Context budget thresholds per tier.
|
|
787
|
-
* Scores are interpolated between these boundaries.
|
|
788
809
|
*/
|
|
789
810
|
declare const CONTEXT_TIER_THRESHOLDS: Record<ModelContextTier, {
|
|
790
|
-
/** Below this → full score for context budget */
|
|
791
811
|
idealTokens: number;
|
|
792
|
-
/** Above this → critical penalty for context budget */
|
|
793
812
|
criticalTokens: number;
|
|
794
|
-
/** Suggested max import depth before penalty */
|
|
795
813
|
idealDepth: number;
|
|
796
814
|
}>;
|
|
797
815
|
/**
|
|
798
816
|
* Project-size-adjusted minimum thresholds.
|
|
799
|
-
*
|
|
800
|
-
* Large codebases structurally accrue more issues. A score of 65 in an
|
|
801
|
-
* enterprise codebase is roughly equivalent to 75 in a small project.
|
|
802
|
-
* These are recommended minimum passing thresholds by project size.
|
|
803
817
|
*/
|
|
804
818
|
declare const SIZE_ADJUSTED_THRESHOLDS: Record<string, number>;
|
|
805
819
|
/**
|
|
@@ -811,30 +825,21 @@ declare function getProjectSizeTier(fileCount: number): keyof typeof SIZE_ADJUST
|
|
|
811
825
|
*/
|
|
812
826
|
declare function getRecommendedThreshold(fileCount: number, modelTier?: ModelContextTier): number;
|
|
813
827
|
/**
|
|
814
|
-
* Normalize tool name from shorthand to
|
|
828
|
+
* Normalize tool name from shorthand to canonical name
|
|
815
829
|
*/
|
|
816
830
|
declare function normalizeToolName(shortName: string): string;
|
|
817
831
|
/**
|
|
818
|
-
* Get tool weight
|
|
819
|
-
* 1. CLI override
|
|
820
|
-
* 2. Tool config scoreWeight
|
|
821
|
-
* 3. Default weight
|
|
822
|
-
* 4. 10 (for unknown tools)
|
|
832
|
+
* Get tool weight
|
|
823
833
|
*/
|
|
824
834
|
declare function getToolWeight(toolName: string, toolConfig?: {
|
|
825
835
|
scoreWeight?: number;
|
|
826
836
|
}, cliOverride?: number): number;
|
|
827
837
|
/**
|
|
828
|
-
* Parse weight string from CLI
|
|
838
|
+
* Parse weight string from CLI
|
|
829
839
|
*/
|
|
830
840
|
declare function parseWeightString(weightStr?: string): Map<string, number>;
|
|
831
841
|
/**
|
|
832
|
-
* Calculate overall AI Readiness Score
|
|
833
|
-
*
|
|
834
|
-
* Formula: Σ(tool_score × tool_weight) / Σ(active_tool_weights)
|
|
835
|
-
*
|
|
836
|
-
* This allows dynamic composition - score adjusts automatically
|
|
837
|
-
* based on which tools actually ran.
|
|
842
|
+
* Calculate overall AI Readiness Score
|
|
838
843
|
*/
|
|
839
844
|
declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutput>, config?: any, cliWeights?: Map<string, number>): ScoringResult;
|
|
840
845
|
/**
|
|
@@ -843,18 +848,17 @@ declare function calculateOverallScore(toolOutputs: Map<string, ToolScoringOutpu
|
|
|
843
848
|
declare function getRating(score: number): ScoringResult['rating'];
|
|
844
849
|
/**
|
|
845
850
|
* Convert score to rating with project-size awareness.
|
|
846
|
-
* Use this for display to give fairer assessment to large codebases.
|
|
847
851
|
*/
|
|
848
852
|
declare function getRatingWithContext(score: number, fileCount: number, modelTier?: ModelContextTier): ScoringResult['rating'];
|
|
849
853
|
/**
|
|
850
|
-
* Get rating
|
|
854
|
+
* Get rating display properties
|
|
851
855
|
*/
|
|
852
856
|
declare function getRatingDisplay(rating: ScoringResult['rating']): {
|
|
853
857
|
emoji: string;
|
|
854
858
|
color: string;
|
|
855
859
|
};
|
|
856
860
|
/**
|
|
857
|
-
* Format score for display
|
|
861
|
+
* Format score for display
|
|
858
862
|
*/
|
|
859
863
|
declare function formatScore(result: ScoringResult): string;
|
|
860
864
|
/**
|
|
@@ -875,4 +879,4 @@ declare function formatToolScore(output: ToolScoringOutput): string;
|
|
|
875
879
|
*/
|
|
876
880
|
declare function generateHTML(graph: GraphData): string;
|
|
877
881
|
|
|
878
|
-
export { type AIReadyConfig, type AcceptancePrediction, type AnalysisResult, AnalysisResultSchema, AnalysisStatus, AnalysisStatusSchema, type BusinessReport, CONTEXT_TIER_THRESHOLDS, type CommonASTNode, type ComprehensionDifficulty, type CostConfig, DEFAULT_TOOL_WEIGHTS, type ExportInfo, 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, TOOL_NAME_MAP, type TechnicalValueChain, type TechnicalValueChainSummary, type TokenBudget, type ToolScoringOutput, type UnifiedReport, UnifiedReportSchema, calculateOverallScore, formatScore, formatToolScore, generateHTML, getProjectSizeTier, getRating, getRatingDisplay, getRatingWithContext, getRecommendedThreshold, getToolWeight, normalizeToolName, parseWeightString };
|
|
882
|
+
export { type AIReadyConfig, type AcceptancePrediction, type AnalysisResult, AnalysisResultSchema, AnalysisStatus, AnalysisStatusSchema, type BusinessReport, CONTEXT_TIER_THRESHOLDS, type CommonASTNode, type ComprehensionDifficulty, type CostConfig, DEFAULT_TOOL_WEIGHTS, type ExportInfo, FRIENDLY_TOOL_NAMES, 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 };
|
package/dist/client.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(client_exports, {
|
|
|
25
25
|
AnalysisStatusSchema: () => AnalysisStatusSchema,
|
|
26
26
|
CONTEXT_TIER_THRESHOLDS: () => CONTEXT_TIER_THRESHOLDS,
|
|
27
27
|
DEFAULT_TOOL_WEIGHTS: () => DEFAULT_TOOL_WEIGHTS,
|
|
28
|
+
FRIENDLY_TOOL_NAMES: () => FRIENDLY_TOOL_NAMES,
|
|
28
29
|
IssueSchema: () => IssueSchema,
|
|
29
30
|
IssueType: () => IssueType,
|
|
30
31
|
IssueTypeSchema: () => IssueTypeSchema,
|
|
@@ -39,7 +40,10 @@ __export(client_exports, {
|
|
|
39
40
|
Severity: () => Severity,
|
|
40
41
|
SeveritySchema: () => SeveritySchema,
|
|
41
42
|
SpokeOutputSchema: () => SpokeOutputSchema,
|
|
43
|
+
SpokeSummarySchema: () => SpokeSummarySchema,
|
|
42
44
|
TOOL_NAME_MAP: () => TOOL_NAME_MAP,
|
|
45
|
+
ToolName: () => ToolName,
|
|
46
|
+
ToolNameSchema: () => ToolNameSchema,
|
|
43
47
|
UnifiedReportSchema: () => UnifiedReportSchema,
|
|
44
48
|
calculateOverallScore: () => calculateOverallScore,
|
|
45
49
|
formatScore: () => formatScore,
|
|
@@ -66,6 +70,38 @@ var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
|
66
70
|
return Severity2;
|
|
67
71
|
})(Severity || {});
|
|
68
72
|
var SeveritySchema = import_zod.z.nativeEnum(Severity);
|
|
73
|
+
var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
74
|
+
ToolName2["PatternDetect"] = "pattern-detect";
|
|
75
|
+
ToolName2["ContextAnalyzer"] = "context-analyzer";
|
|
76
|
+
ToolName2["NamingConsistency"] = "naming-consistency";
|
|
77
|
+
ToolName2["AiSignalClarity"] = "ai-signal-clarity";
|
|
78
|
+
ToolName2["AgentGrounding"] = "agent-grounding";
|
|
79
|
+
ToolName2["TestabilityIndex"] = "testability-index";
|
|
80
|
+
ToolName2["DocDrift"] = "doc-drift";
|
|
81
|
+
ToolName2["DependencyHealth"] = "dependency-health";
|
|
82
|
+
ToolName2["ChangeAmplification"] = "change-amplification";
|
|
83
|
+
ToolName2["CognitiveLoad"] = "cognitive-load";
|
|
84
|
+
ToolName2["PatternEntropy"] = "pattern-entropy";
|
|
85
|
+
ToolName2["ConceptCohesion"] = "concept-cohesion";
|
|
86
|
+
ToolName2["SemanticDistance"] = "semantic-distance";
|
|
87
|
+
return ToolName2;
|
|
88
|
+
})(ToolName || {});
|
|
89
|
+
var ToolNameSchema = import_zod.z.nativeEnum(ToolName);
|
|
90
|
+
var FRIENDLY_TOOL_NAMES = {
|
|
91
|
+
["pattern-detect" /* PatternDetect */]: "Semantic Duplicates",
|
|
92
|
+
["context-analyzer" /* ContextAnalyzer */]: "Context Fragmentation",
|
|
93
|
+
["naming-consistency" /* NamingConsistency */]: "Naming Consistency",
|
|
94
|
+
["ai-signal-clarity" /* AiSignalClarity */]: "AI Signal Clarity",
|
|
95
|
+
["agent-grounding" /* AgentGrounding */]: "Agent Grounding",
|
|
96
|
+
["testability-index" /* TestabilityIndex */]: "Testability Index",
|
|
97
|
+
["doc-drift" /* DocDrift */]: "Documentation Health",
|
|
98
|
+
["dependency-health" /* DependencyHealth */]: "Dependency Health",
|
|
99
|
+
["change-amplification" /* ChangeAmplification */]: "Change Amplification",
|
|
100
|
+
["cognitive-load" /* CognitiveLoad */]: "Cognitive Load",
|
|
101
|
+
["pattern-entropy" /* PatternEntropy */]: "Pattern Entropy",
|
|
102
|
+
["concept-cohesion" /* ConceptCohesion */]: "Concept Cohesion",
|
|
103
|
+
["semantic-distance" /* SemanticDistance */]: "Semantic Distance"
|
|
104
|
+
};
|
|
69
105
|
var IssueType = /* @__PURE__ */ ((IssueType2) => {
|
|
70
106
|
IssueType2["DuplicatePattern"] = "duplicate-pattern";
|
|
71
107
|
IssueType2["PatternInconsistency"] = "pattern-inconsistency";
|
|
@@ -142,13 +178,20 @@ var AnalysisResultSchema = import_zod.z.object({
|
|
|
142
178
|
issues: import_zod.z.array(IssueSchema),
|
|
143
179
|
metrics: MetricsSchema
|
|
144
180
|
});
|
|
181
|
+
var SpokeSummarySchema = import_zod.z.object({
|
|
182
|
+
totalFiles: import_zod.z.number().optional(),
|
|
183
|
+
totalIssues: import_zod.z.number().optional(),
|
|
184
|
+
criticalIssues: import_zod.z.number().optional(),
|
|
185
|
+
majorIssues: import_zod.z.number().optional(),
|
|
186
|
+
score: import_zod.z.number().optional()
|
|
187
|
+
}).catchall(import_zod.z.any());
|
|
145
188
|
var SpokeOutputSchema = import_zod.z.object({
|
|
146
189
|
results: import_zod.z.array(AnalysisResultSchema),
|
|
147
|
-
summary:
|
|
190
|
+
summary: SpokeSummarySchema,
|
|
148
191
|
metadata: import_zod.z.object({
|
|
149
192
|
toolName: import_zod.z.string(),
|
|
150
|
-
version: import_zod.z.string(),
|
|
151
|
-
timestamp: import_zod.z.string()
|
|
193
|
+
version: import_zod.z.string().optional(),
|
|
194
|
+
timestamp: import_zod.z.string().optional()
|
|
152
195
|
}).catchall(import_zod.z.any()).optional()
|
|
153
196
|
});
|
|
154
197
|
var UnifiedReportSchema = import_zod.z.object({
|
|
@@ -163,10 +206,12 @@ var UnifiedReportSchema = import_zod.z.object({
|
|
|
163
206
|
overall: import_zod.z.number(),
|
|
164
207
|
rating: import_zod.z.string(),
|
|
165
208
|
timestamp: import_zod.z.string(),
|
|
166
|
-
breakdown: import_zod.z.array(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
209
|
+
breakdown: import_zod.z.array(
|
|
210
|
+
import_zod.z.object({
|
|
211
|
+
toolName: import_zod.z.union([ToolNameSchema, import_zod.z.string()]),
|
|
212
|
+
score: import_zod.z.number()
|
|
213
|
+
}).catchall(import_zod.z.any())
|
|
214
|
+
)
|
|
170
215
|
}).optional()
|
|
171
216
|
}).catchall(import_zod.z.any());
|
|
172
217
|
|
|
@@ -203,28 +248,34 @@ var ParseError = class extends Error {
|
|
|
203
248
|
|
|
204
249
|
// src/scoring.ts
|
|
205
250
|
var DEFAULT_TOOL_WEIGHTS = {
|
|
206
|
-
"pattern-detect": 22,
|
|
207
|
-
"context-analyzer": 19,
|
|
208
|
-
consistency: 14,
|
|
209
|
-
"ai-signal-clarity": 11,
|
|
210
|
-
"agent-grounding": 10,
|
|
211
|
-
testability: 10,
|
|
212
|
-
"doc-drift": 8,
|
|
213
|
-
|
|
251
|
+
["pattern-detect" /* PatternDetect */]: 22,
|
|
252
|
+
["context-analyzer" /* ContextAnalyzer */]: 19,
|
|
253
|
+
["naming-consistency" /* NamingConsistency */]: 14,
|
|
254
|
+
["ai-signal-clarity" /* AiSignalClarity */]: 11,
|
|
255
|
+
["agent-grounding" /* AgentGrounding */]: 10,
|
|
256
|
+
["testability-index" /* TestabilityIndex */]: 10,
|
|
257
|
+
["doc-drift" /* DocDrift */]: 8,
|
|
258
|
+
["dependency-health" /* DependencyHealth */]: 6,
|
|
259
|
+
["change-amplification" /* ChangeAmplification */]: 8
|
|
214
260
|
};
|
|
215
261
|
var TOOL_NAME_MAP = {
|
|
216
|
-
patterns: "pattern-detect"
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
"
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"
|
|
226
|
-
|
|
227
|
-
|
|
262
|
+
patterns: "pattern-detect" /* PatternDetect */,
|
|
263
|
+
"pattern-detect": "pattern-detect" /* PatternDetect */,
|
|
264
|
+
context: "context-analyzer" /* ContextAnalyzer */,
|
|
265
|
+
"context-analyzer": "context-analyzer" /* ContextAnalyzer */,
|
|
266
|
+
consistency: "naming-consistency" /* NamingConsistency */,
|
|
267
|
+
"naming-consistency": "naming-consistency" /* NamingConsistency */,
|
|
268
|
+
"ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
|
|
269
|
+
"ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
|
|
270
|
+
grounding: "agent-grounding" /* AgentGrounding */,
|
|
271
|
+
"agent-grounding": "agent-grounding" /* AgentGrounding */,
|
|
272
|
+
testability: "testability-index" /* TestabilityIndex */,
|
|
273
|
+
"testability-index": "testability-index" /* TestabilityIndex */,
|
|
274
|
+
"doc-drift": "doc-drift" /* DocDrift */,
|
|
275
|
+
"deps-health": "dependency-health" /* DependencyHealth */,
|
|
276
|
+
"dependency-health": "dependency-health" /* DependencyHealth */,
|
|
277
|
+
"change-amp": "change-amplification" /* ChangeAmplification */,
|
|
278
|
+
"change-amplification": "change-amplification" /* ChangeAmplification */
|
|
228
279
|
};
|
|
229
280
|
var CONTEXT_TIER_THRESHOLDS = {
|
|
230
281
|
compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
|
|
@@ -258,22 +309,16 @@ function getRecommendedThreshold(fileCount, modelTier = "standard") {
|
|
|
258
309
|
return base + modelBonus;
|
|
259
310
|
}
|
|
260
311
|
function normalizeToolName(shortName) {
|
|
261
|
-
return TOOL_NAME_MAP[shortName] || shortName;
|
|
312
|
+
return TOOL_NAME_MAP[shortName.toLowerCase()] || shortName;
|
|
262
313
|
}
|
|
263
314
|
function getToolWeight(toolName, toolConfig, cliOverride) {
|
|
264
|
-
if (cliOverride !== void 0)
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
if (toolConfig?.scoreWeight !== void 0) {
|
|
268
|
-
return toolConfig.scoreWeight;
|
|
269
|
-
}
|
|
315
|
+
if (cliOverride !== void 0) return cliOverride;
|
|
316
|
+
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
270
317
|
return DEFAULT_TOOL_WEIGHTS[toolName] || 5;
|
|
271
318
|
}
|
|
272
319
|
function parseWeightString(weightStr) {
|
|
273
320
|
const weights = /* @__PURE__ */ new Map();
|
|
274
|
-
if (!weightStr)
|
|
275
|
-
return weights;
|
|
276
|
-
}
|
|
321
|
+
if (!weightStr) return weights;
|
|
277
322
|
const pairs = weightStr.split(",");
|
|
278
323
|
for (const pair of pairs) {
|
|
279
324
|
const [toolShortName, weightStr2] = pair.split(":");
|
|
@@ -305,8 +350,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
305
350
|
const calculationWeights = {};
|
|
306
351
|
for (const [toolName, output] of toolOutputs.entries()) {
|
|
307
352
|
const weight = weights.get(toolName) || 5;
|
|
308
|
-
|
|
309
|
-
weightedSum += weightedScore;
|
|
353
|
+
weightedSum += output.score * weight;
|
|
310
354
|
totalWeight += weight;
|
|
311
355
|
toolsUsed.push(toolName);
|
|
312
356
|
calculationWeights[toolName] = weight;
|
|
@@ -565,6 +609,7 @@ function generateHTML(graph) {
|
|
|
565
609
|
AnalysisStatusSchema,
|
|
566
610
|
CONTEXT_TIER_THRESHOLDS,
|
|
567
611
|
DEFAULT_TOOL_WEIGHTS,
|
|
612
|
+
FRIENDLY_TOOL_NAMES,
|
|
568
613
|
IssueSchema,
|
|
569
614
|
IssueType,
|
|
570
615
|
IssueTypeSchema,
|
|
@@ -579,7 +624,10 @@ function generateHTML(graph) {
|
|
|
579
624
|
Severity,
|
|
580
625
|
SeveritySchema,
|
|
581
626
|
SpokeOutputSchema,
|
|
627
|
+
SpokeSummarySchema,
|
|
582
628
|
TOOL_NAME_MAP,
|
|
629
|
+
ToolName,
|
|
630
|
+
ToolNameSchema,
|
|
583
631
|
UnifiedReportSchema,
|
|
584
632
|
calculateOverallScore,
|
|
585
633
|
formatScore,
|
package/dist/client.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
AnalysisStatusSchema,
|
|
5
5
|
CONTEXT_TIER_THRESHOLDS,
|
|
6
6
|
DEFAULT_TOOL_WEIGHTS,
|
|
7
|
+
FRIENDLY_TOOL_NAMES,
|
|
7
8
|
IssueSchema,
|
|
8
9
|
IssueType,
|
|
9
10
|
IssueTypeSchema,
|
|
@@ -18,7 +19,10 @@ import {
|
|
|
18
19
|
Severity,
|
|
19
20
|
SeveritySchema,
|
|
20
21
|
SpokeOutputSchema,
|
|
22
|
+
SpokeSummarySchema,
|
|
21
23
|
TOOL_NAME_MAP,
|
|
24
|
+
ToolName,
|
|
25
|
+
ToolNameSchema,
|
|
22
26
|
UnifiedReportSchema,
|
|
23
27
|
calculateOverallScore,
|
|
24
28
|
formatScore,
|
|
@@ -32,13 +36,14 @@ import {
|
|
|
32
36
|
getToolWeight,
|
|
33
37
|
normalizeToolName,
|
|
34
38
|
parseWeightString
|
|
35
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-YCA4FTEK.mjs";
|
|
36
40
|
export {
|
|
37
41
|
AnalysisResultSchema,
|
|
38
42
|
AnalysisStatus,
|
|
39
43
|
AnalysisStatusSchema,
|
|
40
44
|
CONTEXT_TIER_THRESHOLDS,
|
|
41
45
|
DEFAULT_TOOL_WEIGHTS,
|
|
46
|
+
FRIENDLY_TOOL_NAMES,
|
|
42
47
|
IssueSchema,
|
|
43
48
|
IssueType,
|
|
44
49
|
IssueTypeSchema,
|
|
@@ -53,7 +58,10 @@ export {
|
|
|
53
58
|
Severity,
|
|
54
59
|
SeveritySchema,
|
|
55
60
|
SpokeOutputSchema,
|
|
61
|
+
SpokeSummarySchema,
|
|
56
62
|
TOOL_NAME_MAP,
|
|
63
|
+
ToolName,
|
|
64
|
+
ToolNameSchema,
|
|
57
65
|
UnifiedReportSchema,
|
|
58
66
|
calculateOverallScore,
|
|
59
67
|
formatScore,
|