@aiready/core 0.23.7 → 0.23.8
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-5SHLHMH7.mjs +760 -0
- package/dist/chunk-TJXR2CHZ.mjs +799 -0
- package/dist/client-CLulBnie.d.mts +1182 -0
- package/dist/client-CLulBnie.d.ts +1182 -0
- package/dist/client-CQwvp8ep.d.mts +1182 -0
- package/dist/client-CQwvp8ep.d.ts +1182 -0
- package/dist/client-PFPdeo-z.d.mts +1186 -0
- package/dist/client-PFPdeo-z.d.ts +1186 -0
- package/dist/client-wk2fgk1q.d.mts +1184 -0
- package/dist/client-wk2fgk1q.d.ts +1184 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +42 -4
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +44 -20
- package/dist/index.d.ts +44 -20
- package/dist/index.js +374 -355
- package/dist/index.mjs +314 -337
- package/package.json +1 -1
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { e as AIReadyConfig,
|
|
1
|
+
export { e as AIReadyConfig, h as AcceptancePrediction, A as AnalysisResult, r as AnalysisStatus, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, i as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, I as Issue, U as IssueType, W as LANGUAGE_EXTENSIONS, l as Language, X as LanguageConfig, L as LanguageParser, Y as Lead, Z as LeadSchema, _ as LeadSource, $ as LeadSourceSchema, a0 as LeadSubmission, a1 as LeadSubmissionSchema, a2 as Location, M as Metrics, f as ModelContextTier, N as NamingConvention, a9 as ParseError, m as ParseResult, aa as ParseStatistics, P as ProductivityImpact, ab as ReadinessRating, ac as RecommendationPriority, ad as SCORING_PROFILES, ae as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, af as ScanResult, ag as ScoringConfig, ah as ScoringProfile, ai as ScoringResult, d as Severity, d as SeverityType, ak as SourceLocation, al as SourceRange, a as SpokeOutput, ap as TOOL_NAME_MAP, k as TechnicalValueChain, j as TechnicalValueChainSummary, g as TokenBudget, T as ToolName, c as ToolOptions, ar as ToolOutput, b as ToolScoringOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-wk2fgk1q.mjs';
|
|
2
2
|
import 'zod';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { e as AIReadyConfig,
|
|
1
|
+
export { e as AIReadyConfig, h as AcceptancePrediction, A as AnalysisResult, r as AnalysisStatus, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, i as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, I as Issue, U as IssueType, W as LANGUAGE_EXTENSIONS, l as Language, X as LanguageConfig, L as LanguageParser, Y as Lead, Z as LeadSchema, _ as LeadSource, $ as LeadSourceSchema, a0 as LeadSubmission, a1 as LeadSubmissionSchema, a2 as Location, M as Metrics, f as ModelContextTier, N as NamingConvention, a9 as ParseError, m as ParseResult, aa as ParseStatistics, P as ProductivityImpact, ab as ReadinessRating, ac as RecommendationPriority, ad as SCORING_PROFILES, ae as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, af as ScanResult, ag as ScoringConfig, ah as ScoringProfile, ai as ScoringResult, d as Severity, d as SeverityType, ak as SourceLocation, al as SourceRange, a as SpokeOutput, ap as TOOL_NAME_MAP, k as TechnicalValueChain, j as TechnicalValueChainSummary, g as TokenBudget, T as ToolName, c as ToolOptions, ar as ToolOutput, b as ToolScoringOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-wk2fgk1q.js';
|
|
2
2
|
import 'zod';
|
package/dist/client.js
CHANGED
|
@@ -220,6 +220,44 @@ var UnifiedReportSchema = import_zod.z.object({
|
|
|
220
220
|
)
|
|
221
221
|
}).optional()
|
|
222
222
|
}).catchall(import_zod.z.any());
|
|
223
|
+
var AIReadyConfigSchema = import_zod.z.object({
|
|
224
|
+
/** Target score threshold (0-100) */
|
|
225
|
+
threshold: import_zod.z.number().optional(),
|
|
226
|
+
/** Files or directories to include in scan */
|
|
227
|
+
include: import_zod.z.array(import_zod.z.string()).optional(),
|
|
228
|
+
/** Files or directories to exclude from scan */
|
|
229
|
+
exclude: import_zod.z.array(import_zod.z.string()).optional(),
|
|
230
|
+
/** Scan-specific configuration */
|
|
231
|
+
scan: import_zod.z.object({
|
|
232
|
+
include: import_zod.z.array(import_zod.z.string()).optional(),
|
|
233
|
+
exclude: import_zod.z.array(import_zod.z.string()).optional(),
|
|
234
|
+
parallel: import_zod.z.boolean().optional(),
|
|
235
|
+
deep: import_zod.z.boolean().optional(),
|
|
236
|
+
tools: import_zod.z.array(import_zod.z.string()).optional()
|
|
237
|
+
}).optional(),
|
|
238
|
+
/** Output-specific configuration */
|
|
239
|
+
output: import_zod.z.object({
|
|
240
|
+
/** Output format (json, console, html) */
|
|
241
|
+
format: import_zod.z.enum(["json", "console", "html"]).optional(),
|
|
242
|
+
/** Output file path */
|
|
243
|
+
path: import_zod.z.string().optional(),
|
|
244
|
+
/** Output directory */
|
|
245
|
+
saveTo: import_zod.z.string().optional(),
|
|
246
|
+
/** Whether to show score breakdown in console */
|
|
247
|
+
showBreakdown: import_zod.z.boolean().optional(),
|
|
248
|
+
/** Baseline report to compare against */
|
|
249
|
+
compareBaseline: import_zod.z.string().optional()
|
|
250
|
+
}).optional(),
|
|
251
|
+
/** Tool-specific configuration overrides (Strictly ToolName -> Config) */
|
|
252
|
+
tools: import_zod.z.record(import_zod.z.string(), import_zod.z.any()).optional(),
|
|
253
|
+
/** Scoring profile and weights */
|
|
254
|
+
scoring: import_zod.z.object({
|
|
255
|
+
/** Name of the scoring profile (e.g. "strict", "balanced") */
|
|
256
|
+
profile: import_zod.z.string().optional(),
|
|
257
|
+
/** Custom weights for tools and metrics */
|
|
258
|
+
weights: import_zod.z.record(import_zod.z.string(), import_zod.z.number()).optional()
|
|
259
|
+
}).optional()
|
|
260
|
+
});
|
|
223
261
|
|
|
224
262
|
// src/types/business.ts
|
|
225
263
|
var import_zod2 = require("zod");
|
|
@@ -458,12 +496,12 @@ function getRecommendedThreshold(fileCount, modelTier = "standard") {
|
|
|
458
496
|
return base + modelBonus;
|
|
459
497
|
}
|
|
460
498
|
function normalizeToolName(shortName) {
|
|
461
|
-
return TOOL_NAME_MAP[shortName.toLowerCase()]
|
|
499
|
+
return TOOL_NAME_MAP[shortName.toLowerCase()] ?? shortName;
|
|
462
500
|
}
|
|
463
501
|
function getToolWeight(toolName, toolConfig, cliOverride, profile = "default" /* Default */) {
|
|
464
502
|
if (cliOverride !== void 0) return cliOverride;
|
|
465
503
|
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
466
|
-
const profileWeights = SCORING_PROFILES[profile]
|
|
504
|
+
const profileWeights = SCORING_PROFILES[profile] ?? DEFAULT_TOOL_WEIGHTS;
|
|
467
505
|
return profileWeights[toolName] ?? DEFAULT_TOOL_WEIGHTS[toolName] ?? 5;
|
|
468
506
|
}
|
|
469
507
|
function parseWeightString(weightStr) {
|
|
@@ -500,7 +538,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
500
538
|
const toolsUsed = [];
|
|
501
539
|
const calculationWeights = {};
|
|
502
540
|
for (const [toolName, output] of toolOutputs.entries()) {
|
|
503
|
-
const weight = weights.get(toolName)
|
|
541
|
+
const weight = weights.get(toolName) ?? 5;
|
|
504
542
|
weightedSum += output.score * weight;
|
|
505
543
|
totalWeight += weight;
|
|
506
544
|
toolsUsed.push(toolName);
|
|
@@ -511,7 +549,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
511
549
|
const rating = getRating(overall);
|
|
512
550
|
const formulaParts = Array.from(toolOutputs.entries()).map(
|
|
513
551
|
([name, output]) => {
|
|
514
|
-
const w = weights.get(name)
|
|
552
|
+
const w = weights.get(name) ?? 5;
|
|
515
553
|
return `(${output.score} \xD7 ${w})`;
|
|
516
554
|
}
|
|
517
555
|
);
|
package/dist/client.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, M as ModelContextTier, C as CostConfig,
|
|
2
|
-
export {
|
|
1
|
+
import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, I as Issue, M as Metrics, f as ModelContextTier, C as CostConfig, g as TokenBudget, P as ProductivityImpact, h as AcceptancePrediction, i as ComprehensionDifficulty, j as TechnicalValueChainSummary, k as TechnicalValueChain, L as LanguageParser, l as Language, m as ParseResult, N as NamingConvention, n as ExportInfo } from './client-wk2fgk1q.mjs';
|
|
2
|
+
export { o as AIReadyConfigSchema, p as ASTNode, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, w as Config, D as DEFAULT_TOOL_WEIGHTS, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, R as IssueSchema, U as IssueType, V as IssueTypeSchema, W as LANGUAGE_EXTENSIONS, X as LanguageConfig, Y as Lead, Z as LeadSchema, _ as LeadSource, $ as LeadSourceSchema, a0 as LeadSubmission, a1 as LeadSubmissionSchema, a2 as Location, a3 as LocationSchema, a4 as ManagedAccount, a5 as ManagedAccountSchema, a6 as MetricsSchema, a7 as ModelTier, a8 as ModelTierSchema, a9 as ParseError, aa as ParseStatistics, ab as ReadinessRating, ac as RecommendationPriority, ad as SCORING_PROFILES, ae as SIZE_ADJUSTED_THRESHOLDS, af as ScanResult, ag as ScoringConfig, ah as ScoringProfile, ai as ScoringResult, aj as SeveritySchema, ak as SourceLocation, al as SourceRange, am as SpokeOutputSchema, an as SpokeSummary, ao as SpokeSummarySchema, ap as TOOL_NAME_MAP, aq as ToolNameSchema, ar as ToolOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-wk2fgk1q.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as Parser from 'web-tree-sitter';
|
|
5
|
-
import { TSESTree } from '@typescript-eslint/typescript-estree';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Spoke-to-Hub Contract Definitions
|
|
@@ -429,6 +428,23 @@ declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
|
|
|
429
428
|
*/
|
|
430
429
|
declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
|
|
431
430
|
|
|
431
|
+
/**
|
|
432
|
+
* Normalizes raw issue data into a strict Issue object.
|
|
433
|
+
*/
|
|
434
|
+
declare function normalizeIssue(raw: any): Issue;
|
|
435
|
+
/**
|
|
436
|
+
* Normalizes raw metrics into a strict Metrics object.
|
|
437
|
+
*/
|
|
438
|
+
declare function normalizeMetrics(raw: any): Metrics;
|
|
439
|
+
/**
|
|
440
|
+
* Normalizes raw analysis result from any spoke into a strict AnalysisResult object.
|
|
441
|
+
*/
|
|
442
|
+
declare function normalizeAnalysisResult(raw: any): AnalysisResult;
|
|
443
|
+
/**
|
|
444
|
+
* Normalizes a full SpokeOutput.
|
|
445
|
+
*/
|
|
446
|
+
declare function normalizeSpokeOutput(raw: any, toolName: string): SpokeOutput;
|
|
447
|
+
|
|
432
448
|
/**
|
|
433
449
|
* AI model pricing presets for cost estimation.
|
|
434
450
|
* Prices are input token costs per 1K tokens (USD), as of Q1 2026.
|
|
@@ -753,15 +769,21 @@ declare function isFileSupported(filePath: string): boolean;
|
|
|
753
769
|
declare function getSupportedLanguages(): Language[];
|
|
754
770
|
|
|
755
771
|
/**
|
|
756
|
-
* Initialize tree-sitter once
|
|
772
|
+
* Initialize tree-sitter once.
|
|
773
|
+
*
|
|
774
|
+
* @lastUpdated 2026-03-18
|
|
757
775
|
*/
|
|
758
776
|
declare function initTreeSitter(): Promise<void>;
|
|
759
777
|
/**
|
|
760
|
-
* Find a WASM file for a specific language
|
|
778
|
+
* Find a WASM file for a specific language.
|
|
779
|
+
*
|
|
780
|
+
* @lastUpdated 2026-03-18
|
|
761
781
|
*/
|
|
762
782
|
declare function getWasmPath(language: string): string | null;
|
|
763
783
|
/**
|
|
764
|
-
* Load a language and return a configured parser
|
|
784
|
+
* Load a language and return a configured parser.
|
|
785
|
+
*
|
|
786
|
+
* @lastUpdated 2026-03-18
|
|
765
787
|
*/
|
|
766
788
|
declare function setupParser(language: string): Promise<Parser.Parser | null>;
|
|
767
789
|
|
|
@@ -775,14 +797,16 @@ declare class TypeScriptParser implements LanguageParser {
|
|
|
775
797
|
readonly language = Language.TypeScript;
|
|
776
798
|
readonly extensions: string[];
|
|
777
799
|
initialize(): Promise<void>;
|
|
778
|
-
|
|
779
|
-
|
|
800
|
+
canHandle(filePath: string): boolean;
|
|
801
|
+
getAST(code: string, filePath: string): Promise<any>;
|
|
780
802
|
parse(code: string, filePath: string): ParseResult;
|
|
781
803
|
getNamingConventions(): NamingConvention;
|
|
782
|
-
|
|
804
|
+
analyzeMetadata(node: any, code: string): Partial<ExportInfo>;
|
|
783
805
|
private extractImports;
|
|
784
806
|
private extractExports;
|
|
785
|
-
private
|
|
807
|
+
private createExport;
|
|
808
|
+
private extractDocumentation;
|
|
809
|
+
private isLikelyPure;
|
|
786
810
|
}
|
|
787
811
|
|
|
788
812
|
/**
|
|
@@ -804,7 +828,7 @@ declare abstract class BaseLanguageParser implements LanguageParser {
|
|
|
804
828
|
getAST(code: string, _filePath?: string): Promise<Parser.Tree | null>;
|
|
805
829
|
abstract analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
|
|
806
830
|
parse(code: string, filePath: string): ParseResult;
|
|
807
|
-
protected abstract extractImportsAST(rootNode: Parser.Node):
|
|
831
|
+
protected abstract extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
808
832
|
protected abstract extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
|
|
809
833
|
protected abstract parseRegex(code: string, filePath: string): ParseResult;
|
|
810
834
|
abstract getNamingConventions(): NamingConvention;
|
|
@@ -833,9 +857,9 @@ declare class PythonParser extends BaseLanguageParser {
|
|
|
833
857
|
* Extract import information using AST walk.
|
|
834
858
|
*
|
|
835
859
|
* @param rootNode - Root node of the Python AST.
|
|
836
|
-
* @returns Array of discovered
|
|
860
|
+
* @returns Array of discovered FileImport objects.
|
|
837
861
|
*/
|
|
838
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
862
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
839
863
|
/**
|
|
840
864
|
* Extract export information using AST walk.
|
|
841
865
|
*
|
|
@@ -888,9 +912,9 @@ declare class JavaParser extends BaseLanguageParser {
|
|
|
888
912
|
* Extract import information using AST walk.
|
|
889
913
|
*
|
|
890
914
|
* @param rootNode - Root node of the Java AST.
|
|
891
|
-
* @returns Array of discovered
|
|
915
|
+
* @returns Array of discovered FileImport objects.
|
|
892
916
|
*/
|
|
893
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
917
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
894
918
|
/**
|
|
895
919
|
* Extract export information (classes, interfaces, methods) using AST walk.
|
|
896
920
|
*
|
|
@@ -949,9 +973,9 @@ declare class CSharpParser extends BaseLanguageParser {
|
|
|
949
973
|
* Extract import information (usings) using AST walk.
|
|
950
974
|
*
|
|
951
975
|
* @param rootNode - Root node of the C# AST.
|
|
952
|
-
* @returns Array of discovered
|
|
976
|
+
* @returns Array of discovered FileImport objects.
|
|
953
977
|
*/
|
|
954
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
978
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
955
979
|
/**
|
|
956
980
|
* Extract export information (classes, methods, properties) using AST walk.
|
|
957
981
|
* Handles nested namespaces and classes.
|
|
@@ -996,9 +1020,9 @@ declare class GoParser extends BaseLanguageParser {
|
|
|
996
1020
|
* Extract import information using AST walk.
|
|
997
1021
|
*
|
|
998
1022
|
* @param rootNode - Root node of the Go AST.
|
|
999
|
-
* @returns Array of discovered
|
|
1023
|
+
* @returns Array of discovered FileImport objects.
|
|
1000
1024
|
*/
|
|
1001
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
1025
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
1002
1026
|
/**
|
|
1003
1027
|
* Extract export information (functions, types, vars) using AST walk.
|
|
1004
1028
|
*
|
|
@@ -1614,4 +1638,4 @@ declare function severityToAnnotationLevel(severity: string): 'error' | 'warning
|
|
|
1614
1638
|
*/
|
|
1615
1639
|
declare function emitIssuesAsAnnotations(issues: any[]): void;
|
|
1616
1640
|
|
|
1617
|
-
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileWithDomain, GoParser,
|
|
1641
|
+
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileWithDomain, GoParser, Issue, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildSimpleProviderScore, buildSpokeOutput, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, emitAnnotation, emitIssuesAsAnnotations, emitProgress, estimateCostFromBudget, estimateTokens, exportHistory, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getSafetyIcon, getScoreBar, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLevel, getSeverityValue, getSupportedLanguages, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, initTreeSitter, initializeParsers, isFileSupported, isSourceFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, readFileContent, resolveOutputPath, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, M as ModelContextTier, C as CostConfig,
|
|
2
|
-
export {
|
|
1
|
+
import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, I as Issue, M as Metrics, f as ModelContextTier, C as CostConfig, g as TokenBudget, P as ProductivityImpact, h as AcceptancePrediction, i as ComprehensionDifficulty, j as TechnicalValueChainSummary, k as TechnicalValueChain, L as LanguageParser, l as Language, m as ParseResult, N as NamingConvention, n as ExportInfo } from './client-wk2fgk1q.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 IssueSchema, U as IssueType, V as IssueTypeSchema, W as LANGUAGE_EXTENSIONS, X as LanguageConfig, Y as Lead, Z as LeadSchema, _ as LeadSource, $ as LeadSourceSchema, a0 as LeadSubmission, a1 as LeadSubmissionSchema, a2 as Location, a3 as LocationSchema, a4 as ManagedAccount, a5 as ManagedAccountSchema, a6 as MetricsSchema, a7 as ModelTier, a8 as ModelTierSchema, a9 as ParseError, aa as ParseStatistics, ab as ReadinessRating, ac as RecommendationPriority, ad as SCORING_PROFILES, ae as SIZE_ADJUSTED_THRESHOLDS, af as ScanResult, ag as ScoringConfig, ah as ScoringProfile, ai as ScoringResult, aj as SeveritySchema, ak as SourceLocation, al as SourceRange, am as SpokeOutputSchema, an as SpokeSummary, ao as SpokeSummarySchema, ap as TOOL_NAME_MAP, aq as ToolNameSchema, ar as ToolOutput, as as UnifiedReport, at as UnifiedReportSchema, au as calculateOverallScore, av as formatScore, aw as formatToolScore, ax as generateHTML, ay as getProjectSizeTier, az as getRating, aA as getRatingDisplay, aB as getRatingSlug, aC as getRatingWithContext, aD as getRecommendedThreshold, aE as getToolWeight, aF as normalizeToolName, aG as parseWeightString } from './client-wk2fgk1q.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as Parser from 'web-tree-sitter';
|
|
5
|
-
import { TSESTree } from '@typescript-eslint/typescript-estree';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Spoke-to-Hub Contract Definitions
|
|
@@ -429,6 +428,23 @@ declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
|
|
|
429
428
|
*/
|
|
430
429
|
declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
|
|
431
430
|
|
|
431
|
+
/**
|
|
432
|
+
* Normalizes raw issue data into a strict Issue object.
|
|
433
|
+
*/
|
|
434
|
+
declare function normalizeIssue(raw: any): Issue;
|
|
435
|
+
/**
|
|
436
|
+
* Normalizes raw metrics into a strict Metrics object.
|
|
437
|
+
*/
|
|
438
|
+
declare function normalizeMetrics(raw: any): Metrics;
|
|
439
|
+
/**
|
|
440
|
+
* Normalizes raw analysis result from any spoke into a strict AnalysisResult object.
|
|
441
|
+
*/
|
|
442
|
+
declare function normalizeAnalysisResult(raw: any): AnalysisResult;
|
|
443
|
+
/**
|
|
444
|
+
* Normalizes a full SpokeOutput.
|
|
445
|
+
*/
|
|
446
|
+
declare function normalizeSpokeOutput(raw: any, toolName: string): SpokeOutput;
|
|
447
|
+
|
|
432
448
|
/**
|
|
433
449
|
* AI model pricing presets for cost estimation.
|
|
434
450
|
* Prices are input token costs per 1K tokens (USD), as of Q1 2026.
|
|
@@ -753,15 +769,21 @@ declare function isFileSupported(filePath: string): boolean;
|
|
|
753
769
|
declare function getSupportedLanguages(): Language[];
|
|
754
770
|
|
|
755
771
|
/**
|
|
756
|
-
* Initialize tree-sitter once
|
|
772
|
+
* Initialize tree-sitter once.
|
|
773
|
+
*
|
|
774
|
+
* @lastUpdated 2026-03-18
|
|
757
775
|
*/
|
|
758
776
|
declare function initTreeSitter(): Promise<void>;
|
|
759
777
|
/**
|
|
760
|
-
* Find a WASM file for a specific language
|
|
778
|
+
* Find a WASM file for a specific language.
|
|
779
|
+
*
|
|
780
|
+
* @lastUpdated 2026-03-18
|
|
761
781
|
*/
|
|
762
782
|
declare function getWasmPath(language: string): string | null;
|
|
763
783
|
/**
|
|
764
|
-
* Load a language and return a configured parser
|
|
784
|
+
* Load a language and return a configured parser.
|
|
785
|
+
*
|
|
786
|
+
* @lastUpdated 2026-03-18
|
|
765
787
|
*/
|
|
766
788
|
declare function setupParser(language: string): Promise<Parser.Parser | null>;
|
|
767
789
|
|
|
@@ -775,14 +797,16 @@ declare class TypeScriptParser implements LanguageParser {
|
|
|
775
797
|
readonly language = Language.TypeScript;
|
|
776
798
|
readonly extensions: string[];
|
|
777
799
|
initialize(): Promise<void>;
|
|
778
|
-
|
|
779
|
-
|
|
800
|
+
canHandle(filePath: string): boolean;
|
|
801
|
+
getAST(code: string, filePath: string): Promise<any>;
|
|
780
802
|
parse(code: string, filePath: string): ParseResult;
|
|
781
803
|
getNamingConventions(): NamingConvention;
|
|
782
|
-
|
|
804
|
+
analyzeMetadata(node: any, code: string): Partial<ExportInfo>;
|
|
783
805
|
private extractImports;
|
|
784
806
|
private extractExports;
|
|
785
|
-
private
|
|
807
|
+
private createExport;
|
|
808
|
+
private extractDocumentation;
|
|
809
|
+
private isLikelyPure;
|
|
786
810
|
}
|
|
787
811
|
|
|
788
812
|
/**
|
|
@@ -804,7 +828,7 @@ declare abstract class BaseLanguageParser implements LanguageParser {
|
|
|
804
828
|
getAST(code: string, _filePath?: string): Promise<Parser.Tree | null>;
|
|
805
829
|
abstract analyzeMetadata(node: Parser.Node, code: string): Partial<ExportInfo>;
|
|
806
830
|
parse(code: string, filePath: string): ParseResult;
|
|
807
|
-
protected abstract extractImportsAST(rootNode: Parser.Node):
|
|
831
|
+
protected abstract extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
808
832
|
protected abstract extractExportsAST(rootNode: Parser.Node, code: string): ExportInfo[];
|
|
809
833
|
protected abstract parseRegex(code: string, filePath: string): ParseResult;
|
|
810
834
|
abstract getNamingConventions(): NamingConvention;
|
|
@@ -833,9 +857,9 @@ declare class PythonParser extends BaseLanguageParser {
|
|
|
833
857
|
* Extract import information using AST walk.
|
|
834
858
|
*
|
|
835
859
|
* @param rootNode - Root node of the Python AST.
|
|
836
|
-
* @returns Array of discovered
|
|
860
|
+
* @returns Array of discovered FileImport objects.
|
|
837
861
|
*/
|
|
838
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
862
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
839
863
|
/**
|
|
840
864
|
* Extract export information using AST walk.
|
|
841
865
|
*
|
|
@@ -888,9 +912,9 @@ declare class JavaParser extends BaseLanguageParser {
|
|
|
888
912
|
* Extract import information using AST walk.
|
|
889
913
|
*
|
|
890
914
|
* @param rootNode - Root node of the Java AST.
|
|
891
|
-
* @returns Array of discovered
|
|
915
|
+
* @returns Array of discovered FileImport objects.
|
|
892
916
|
*/
|
|
893
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
917
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
894
918
|
/**
|
|
895
919
|
* Extract export information (classes, interfaces, methods) using AST walk.
|
|
896
920
|
*
|
|
@@ -949,9 +973,9 @@ declare class CSharpParser extends BaseLanguageParser {
|
|
|
949
973
|
* Extract import information (usings) using AST walk.
|
|
950
974
|
*
|
|
951
975
|
* @param rootNode - Root node of the C# AST.
|
|
952
|
-
* @returns Array of discovered
|
|
976
|
+
* @returns Array of discovered FileImport objects.
|
|
953
977
|
*/
|
|
954
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
978
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
955
979
|
/**
|
|
956
980
|
* Extract export information (classes, methods, properties) using AST walk.
|
|
957
981
|
* Handles nested namespaces and classes.
|
|
@@ -996,9 +1020,9 @@ declare class GoParser extends BaseLanguageParser {
|
|
|
996
1020
|
* Extract import information using AST walk.
|
|
997
1021
|
*
|
|
998
1022
|
* @param rootNode - Root node of the Go AST.
|
|
999
|
-
* @returns Array of discovered
|
|
1023
|
+
* @returns Array of discovered FileImport objects.
|
|
1000
1024
|
*/
|
|
1001
|
-
protected extractImportsAST(rootNode: Parser.Node):
|
|
1025
|
+
protected extractImportsAST(rootNode: Parser.Node): FileImport[];
|
|
1002
1026
|
/**
|
|
1003
1027
|
* Extract export information (functions, types, vars) using AST walk.
|
|
1004
1028
|
*
|
|
@@ -1614,4 +1638,4 @@ declare function severityToAnnotationLevel(severity: string): 'error' | 'warning
|
|
|
1614
1638
|
*/
|
|
1615
1639
|
declare function emitIssuesAsAnnotations(issues: any[]): void;
|
|
1616
1640
|
|
|
1617
|
-
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileWithDomain, GoParser,
|
|
1641
|
+
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileWithDomain, GoParser, Issue, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildSimpleProviderScore, buildSpokeOutput, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, emitAnnotation, emitIssuesAsAnnotations, emitProgress, estimateCostFromBudget, estimateTokens, exportHistory, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getSafetyIcon, getScoreBar, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLevel, getSeverityValue, getSupportedLanguages, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, initTreeSitter, initializeParsers, isFileSupported, isSourceFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, readFileContent, resolveOutputPath, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema };
|