@aiready/core 0.23.19 → 0.23.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-2N7ISIKE.mjs +158 -0
- package/dist/chunk-ARUIZO7M.mjs +297 -0
- package/dist/chunk-CYC5EGEI.mjs +297 -0
- package/dist/{chunk-ZB3EHHAG.mjs → chunk-DBOPSRBC.mjs} +88 -26
- package/dist/chunk-EZ7ECLAZ.mjs +299 -0
- package/dist/chunk-FNPULWG7.mjs +248 -0
- package/dist/chunk-FZTFKZUQ.mjs +250 -0
- package/dist/chunk-GTS642BQ.mjs +262 -0
- package/dist/chunk-IXPY5J4K.mjs +248 -0
- package/dist/chunk-JJQLYW6Z.mjs +111 -0
- package/dist/chunk-L6BKANJC.mjs +130 -0
- package/dist/chunk-LXEO5PG3.mjs +292 -0
- package/dist/chunk-LZHO636W.mjs +501 -0
- package/dist/chunk-MTK2IIDZ.mjs +262 -0
- package/dist/chunk-QDCQETSI.mjs +262 -0
- package/dist/chunk-QZNY7B2N.mjs +248 -0
- package/dist/chunk-RCZSMGCX.mjs +250 -0
- package/dist/chunk-SWZOT67M.mjs +250 -0
- package/dist/chunk-U3IY2CFC.mjs +36 -0
- package/dist/chunk-UBCM5Y6R.mjs +275 -0
- package/dist/chunk-UTCRW3N7.mjs +301 -0
- package/dist/{chunk-RMH2TPAT.mjs → chunk-UYLH35LA.mjs} +88 -26
- package/dist/{chunk-TJXR2CHZ.mjs → chunk-WVNVC2PP.mjs} +266 -213
- package/dist/chunk-WYOW6O3P.mjs +114 -0
- package/dist/{chunk-CGOS2J6T.mjs → chunk-YRSSR4KN.mjs} +260 -217
- package/dist/client-2xbeKnrg.d.mts +1291 -0
- package/dist/client-2xbeKnrg.d.ts +1291 -0
- package/dist/client-4HLAGzFg.d.mts +1291 -0
- package/dist/client-4HLAGzFg.d.ts +1291 -0
- package/dist/client-B4TQwNa7.d.mts +1290 -0
- package/dist/client-B4TQwNa7.d.ts +1290 -0
- package/dist/client-Bdi4ty0v.d.mts +1294 -0
- package/dist/client-Bdi4ty0v.d.ts +1294 -0
- package/dist/client-BsKpUH3H.d.mts +1339 -0
- package/dist/client-BsKpUH3H.d.ts +1339 -0
- package/dist/client-Bv1zOaWF.d.mts +1291 -0
- package/dist/client-Bv1zOaWF.d.ts +1291 -0
- package/dist/client-Bz9YJMIX.d.mts +1290 -0
- package/dist/client-Bz9YJMIX.d.ts +1290 -0
- package/dist/client-CBpzm34X.d.mts +1291 -0
- package/dist/client-CBpzm34X.d.ts +1291 -0
- package/dist/client-CNu_tCZZ.d.mts +1305 -0
- package/dist/client-CNu_tCZZ.d.ts +1305 -0
- package/dist/client-CmEvxxQu.d.mts +1339 -0
- package/dist/client-CmEvxxQu.d.ts +1339 -0
- package/dist/client-DGMAxkZc.d.mts +1339 -0
- package/dist/client-DGMAxkZc.d.ts +1339 -0
- package/dist/client-DZq-CqcD.d.mts +1292 -0
- package/dist/client-DZq-CqcD.d.ts +1292 -0
- package/dist/{client-WVCAIWdJ.d.mts → client-DcqGfDTt.d.mts} +318 -226
- package/dist/{client-WVCAIWdJ.d.ts → client-DcqGfDTt.d.ts} +318 -226
- package/dist/{client-DLvFR2qA.d.mts → client-O8RvSRm0.d.mts} +89 -25
- package/dist/{client-DLvFR2qA.d.ts → client-O8RvSRm0.d.ts} +89 -25
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +53 -27
- package/dist/client.mjs +6 -6
- package/dist/csharp-parser-4ZKCSX5B.mjs +9 -0
- package/dist/csharp-parser-5HKICCRR.mjs +9 -0
- package/dist/csharp-parser-JCKXIAJW.mjs +9 -0
- package/dist/go-parser-J4KIH4RG.mjs +9 -0
- package/dist/go-parser-TKXL3DVH.mjs +9 -0
- package/dist/go-parser-XOM232XZ.mjs +9 -0
- package/dist/index.d.mts +332 -54
- package/dist/index.d.ts +332 -54
- package/dist/index.js +3930 -3064
- package/dist/index.mjs +933 -2036
- package/dist/java-parser-3KHXOXRQ.mjs +9 -0
- package/dist/java-parser-MASGS4WB.mjs +9 -0
- package/dist/java-parser-T5LXD63J.mjs +9 -0
- package/dist/python-parser-FNFK2473.mjs +8 -0
- package/dist/typescript-parser-2GGNRNB5.mjs +7 -0
- package/dist/typescript-parser-3ENJ6C7H.mjs +7 -0
- package/dist/typescript-parser-4GI7DPSW.mjs +7 -0
- package/dist/typescript-parser-4H3HUBO4.mjs +7 -0
- package/dist/typescript-parser-K63IVZMF.mjs +7 -0
- package/dist/typescript-parser-ZJKROMQG.mjs +7 -0
- package/package.json +1 -1
- package/dist/chunk-5SHLHMH7.mjs +0 -760
- package/dist/chunk-Q55AMEFV.mjs +0 -760
- package/dist/client-BEoUYNLp.d.mts +0 -1191
- package/dist/client-BEoUYNLp.d.ts +0 -1191
- package/dist/client-BrIMPk89.d.mts +0 -1214
- package/dist/client-BrIMPk89.d.ts +0 -1214
- package/dist/client-C5BuGX4F.d.mts +0 -1205
- package/dist/client-C5BuGX4F.d.ts +0 -1205
- package/dist/client-CKcjnPXt.d.mts +0 -1214
- package/dist/client-CKcjnPXt.d.ts +0 -1214
- package/dist/client-CLulBnie.d.mts +0 -1182
- package/dist/client-CLulBnie.d.ts +0 -1182
- package/dist/client-CQwvp8ep.d.mts +0 -1182
- package/dist/client-CQwvp8ep.d.ts +0 -1182
- package/dist/client-PFPdeo-z.d.mts +0 -1186
- package/dist/client-PFPdeo-z.d.ts +0 -1186
- package/dist/client-wk2fgk1q.d.mts +0 -1184
- package/dist/client-wk2fgk1q.d.ts +0 -1184
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +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, 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
|
|
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
|
|
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 Language, l as LanguageParser, m as ParseResult, N as NamingConvention, n as ExportInfo } from './client-Bdi4ty0v.mjs';
|
|
2
|
+
export { o as AIReadyConfigSchema, p as ASTNode, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, w as Config, D as DEFAULT_TOOL_WEIGHTS, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, Y as LanguageConfig, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, a5 as ManagedAccount, a6 as ManagedAccountSchema, a7 as MetricsSchema, a8 as ModelTier, a9 as ModelTierSchema, aa as ParseError, ab as ParseStatistics, ac as ReadinessRating, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, ak as SeveritySchema, al as SourceLocation, am as SourceRange, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, ar as ToolNameSchema, as as ToolOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, az as getPriorityIcon, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aD as getRatingEmoji, aE as getRatingLabel, aF as getRatingMetadata, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aJ as getToolEmoji, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from './client-Bdi4ty0v.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import * as chalk from 'chalk';
|
|
4
5
|
import * as Parser from 'web-tree-sitter';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -237,7 +238,22 @@ declare function loadMergedConfig<T extends Record<string, any>>(directory: stri
|
|
|
237
238
|
*/
|
|
238
239
|
declare function handleJSONOutput(data: any, outputFile?: string, successMessage?: string): void;
|
|
239
240
|
/**
|
|
240
|
-
*
|
|
241
|
+
* Get a formatted terminal divider string based on current terminal width.
|
|
242
|
+
*
|
|
243
|
+
* @param color - Chalk color function to use for the divider.
|
|
244
|
+
* @param maxWidth - Maximum width for the divider (default: 60).
|
|
245
|
+
* @returns String representation of the divider.
|
|
246
|
+
*/
|
|
247
|
+
declare function getTerminalDivider(color?: any, maxWidth?: number): string;
|
|
248
|
+
/**
|
|
249
|
+
* Print a standard terminal header with dividers.
|
|
250
|
+
*
|
|
251
|
+
* @param title - Header title text.
|
|
252
|
+
* @param color - Chalk color function for the dividers.
|
|
253
|
+
*/
|
|
254
|
+
declare function printTerminalHeader(title: string, color?: any): void;
|
|
255
|
+
/**
|
|
256
|
+
* Common CLI error handler for CLI commands.
|
|
241
257
|
* Logs error and exits process with code 1.
|
|
242
258
|
*
|
|
243
259
|
* @param error - Error object or message.
|
|
@@ -333,6 +349,61 @@ declare function findLatestReport(dirPath: string): string | null;
|
|
|
333
349
|
*/
|
|
334
350
|
declare function findLatestScanReport(scanReportsDir: string, reportFilePrefix: string): string | null;
|
|
335
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Generate timestamp for report filenames (YYYYMMDD-HHMMSS)
|
|
354
|
+
* Provides better granularity than date-only filenames
|
|
355
|
+
*/
|
|
356
|
+
declare function getReportTimestamp(): string;
|
|
357
|
+
/**
|
|
358
|
+
* Interface for CLI action output parameters
|
|
359
|
+
*/
|
|
360
|
+
interface JSONOutputParams {
|
|
361
|
+
outputData: any;
|
|
362
|
+
outputFile?: string;
|
|
363
|
+
resolvedDir: string;
|
|
364
|
+
prefix?: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Standard JSON output handler for CLI actions.
|
|
368
|
+
* Consolidates path resolution and output handling.
|
|
369
|
+
*/
|
|
370
|
+
declare function handleStandardJSONOutput({ outputData, outputFile, resolvedDir, prefix, }: JSONOutputParams): void;
|
|
371
|
+
/**
|
|
372
|
+
* Resolves the output format and file path from CLI options and merged config.
|
|
373
|
+
*/
|
|
374
|
+
declare function resolveOutputFormat(options: {
|
|
375
|
+
output?: string;
|
|
376
|
+
outputFile?: string;
|
|
377
|
+
}, config: {
|
|
378
|
+
output?: {
|
|
379
|
+
format?: string;
|
|
380
|
+
file?: string;
|
|
381
|
+
};
|
|
382
|
+
}): {
|
|
383
|
+
format: string;
|
|
384
|
+
file: string | undefined;
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Common configuration preparation for CLI actions.
|
|
388
|
+
* Resolves directory and merges configuration.
|
|
389
|
+
*/
|
|
390
|
+
declare function prepareActionConfig<T extends Record<string, any>>(directory: string, defaults: T, cliOptions: Partial<T>): Promise<{
|
|
391
|
+
resolvedDir: string;
|
|
392
|
+
finalOptions: T & {
|
|
393
|
+
rootDir: string;
|
|
394
|
+
};
|
|
395
|
+
}>;
|
|
396
|
+
/**
|
|
397
|
+
* Formats report data for standard JSON output including timing and scoring.
|
|
398
|
+
*/
|
|
399
|
+
declare function formatStandardReport(params: {
|
|
400
|
+
results?: any;
|
|
401
|
+
report?: any;
|
|
402
|
+
summary: any;
|
|
403
|
+
elapsedTime: string;
|
|
404
|
+
score?: ToolScoringOutput;
|
|
405
|
+
}): any;
|
|
406
|
+
|
|
336
407
|
/**
|
|
337
408
|
* Groups a flat array of issues by their `location.file` path into the
|
|
338
409
|
* `AnalysisResult[]` shape expected by `SpokeOutputSchema`.
|
|
@@ -403,10 +474,10 @@ declare function calculateImportSimilarity(export1: ExportWithImports, export2:
|
|
|
403
474
|
* @param filePath - Path to the file (used for language detection and AST metadata)
|
|
404
475
|
* @returns Object containing all identified exports and imports
|
|
405
476
|
*/
|
|
406
|
-
declare function parseFileExports(code: string, filePath: string): {
|
|
477
|
+
declare function parseFileExports(code: string, filePath: string): Promise<{
|
|
407
478
|
exports: ExportWithImports[];
|
|
408
479
|
imports: FileImport[];
|
|
409
|
-
}
|
|
480
|
+
}>;
|
|
410
481
|
|
|
411
482
|
/**
|
|
412
483
|
* Estimate token count for text (rough approximation)
|
|
@@ -428,6 +499,66 @@ declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
|
|
|
428
499
|
*/
|
|
429
500
|
declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
|
|
430
501
|
|
|
502
|
+
/**
|
|
503
|
+
* Shared HTML report formatting utilities.
|
|
504
|
+
* Provides common template parts for generating self-contained HTML reports.
|
|
505
|
+
*
|
|
506
|
+
* @lastUpdated 2026-03-24
|
|
507
|
+
*/
|
|
508
|
+
interface ReportOptions {
|
|
509
|
+
title: string;
|
|
510
|
+
subtitle?: string;
|
|
511
|
+
packageName: string;
|
|
512
|
+
packageUrl?: string;
|
|
513
|
+
bugUrl?: string;
|
|
514
|
+
version?: string;
|
|
515
|
+
}
|
|
516
|
+
interface StatCard {
|
|
517
|
+
value: string | number;
|
|
518
|
+
label: string;
|
|
519
|
+
color?: string;
|
|
520
|
+
}
|
|
521
|
+
interface TableConfig {
|
|
522
|
+
headers: string[];
|
|
523
|
+
rows: string[][];
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Generate the HTML document head with common styles.
|
|
527
|
+
*/
|
|
528
|
+
declare function generateReportHead(title: string): string;
|
|
529
|
+
/**
|
|
530
|
+
* Generate a hero section for the report.
|
|
531
|
+
*/
|
|
532
|
+
declare function generateReportHero(title: string, subtitle?: string): string;
|
|
533
|
+
/**
|
|
534
|
+
* Generate stat cards section.
|
|
535
|
+
*/
|
|
536
|
+
declare function generateStatCards(cards: StatCard[]): string;
|
|
537
|
+
/**
|
|
538
|
+
* Generate a score card with a single large value.
|
|
539
|
+
*/
|
|
540
|
+
declare function generateScoreCard(value: string | number, label: string): string;
|
|
541
|
+
/**
|
|
542
|
+
* Generate an HTML table from configuration.
|
|
543
|
+
*/
|
|
544
|
+
declare function generateTable(config: TableConfig): string;
|
|
545
|
+
/**
|
|
546
|
+
* Generate an issue summary card.
|
|
547
|
+
*/
|
|
548
|
+
declare function generateIssueSummary(critical: number, major: number, minor: number, potentialSavings?: number): string;
|
|
549
|
+
/**
|
|
550
|
+
* Generate the report footer.
|
|
551
|
+
*/
|
|
552
|
+
declare function generateReportFooter(options: ReportOptions): string;
|
|
553
|
+
/**
|
|
554
|
+
* Wrap content in a card div.
|
|
555
|
+
*/
|
|
556
|
+
declare function wrapInCard(content: string, title?: string): string;
|
|
557
|
+
/**
|
|
558
|
+
* Generate a complete report by combining all parts.
|
|
559
|
+
*/
|
|
560
|
+
declare function generateCompleteReport(options: ReportOptions, bodyContent: string): string;
|
|
561
|
+
|
|
431
562
|
/**
|
|
432
563
|
* Normalizes raw issue data into a strict Issue object.
|
|
433
564
|
*/
|
|
@@ -445,6 +576,132 @@ declare function normalizeAnalysisResult(raw: any): AnalysisResult;
|
|
|
445
576
|
*/
|
|
446
577
|
declare function normalizeSpokeOutput(raw: any, toolName: string): SpokeOutput;
|
|
447
578
|
|
|
579
|
+
/**
|
|
580
|
+
* Standard parameters for building a ToolScoringOutput.
|
|
581
|
+
*/
|
|
582
|
+
interface StandardScoringParams {
|
|
583
|
+
toolName: ToolName | string;
|
|
584
|
+
score: number;
|
|
585
|
+
rawData: Record<string, any>;
|
|
586
|
+
dimensions: Record<string, number>;
|
|
587
|
+
dimensionNames: Record<string, string>;
|
|
588
|
+
recommendations: string[];
|
|
589
|
+
recommendationImpact?: number;
|
|
590
|
+
rating?: string;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Common factor builder logic.
|
|
594
|
+
* Map dimension scores to standard factor objects with -50 impact baseline.
|
|
595
|
+
*/
|
|
596
|
+
declare function buildFactorsFromDimensions(dimensions: Record<string, number>, dimensionNames: Record<string, string>, rawData: Record<string, any>): ToolScoringOutput['factors'];
|
|
597
|
+
/**
|
|
598
|
+
* Unified tool scoring output builder.
|
|
599
|
+
*/
|
|
600
|
+
declare function buildStandardToolScore(params: StandardScoringParams): ToolScoringOutput;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Calculate Jaccard similarity between two strings.
|
|
604
|
+
* Splitting by non-alphanumeric to be robust across different programming languages and formats.
|
|
605
|
+
*
|
|
606
|
+
* @param a - First string for comparison.
|
|
607
|
+
* @param b - Second string for comparison.
|
|
608
|
+
* @returns Similarity score between 0 and 1.
|
|
609
|
+
*/
|
|
610
|
+
declare function calculateStringSimilarity(a: string, b: string): number;
|
|
611
|
+
/**
|
|
612
|
+
* Calculate heuristic confidence score for a duplicate or pattern detection.
|
|
613
|
+
* Considers similarity, block size, and structural match.
|
|
614
|
+
*
|
|
615
|
+
* @param similarity - Similarity score (0-1).
|
|
616
|
+
* @param tokens - Token count of the code block.
|
|
617
|
+
* @param lines - Line count of the code block.
|
|
618
|
+
* @returns Confidence score between 0 and 1.
|
|
619
|
+
*/
|
|
620
|
+
declare function calculateHeuristicConfidence(similarity: number, tokens: number, lines: number): number;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Standard progress callback for AIReady spoke tools.
|
|
624
|
+
* Unified to remove structural duplication across spokes.
|
|
625
|
+
*
|
|
626
|
+
* @param toolName - The name of the tool reporting progress.
|
|
627
|
+
*/
|
|
628
|
+
declare function createStandardProgressCallback(toolName: string): (processed: number, total: number, message: string) => void;
|
|
629
|
+
/**
|
|
630
|
+
* Standard result formatter for CLI output.
|
|
631
|
+
*
|
|
632
|
+
* @param toolName - Canonical ToolName.
|
|
633
|
+
* @param score - Calculated readiness score (0-100).
|
|
634
|
+
* @param issuesCount - Number of identified issues.
|
|
635
|
+
*/
|
|
636
|
+
declare function formatStandardCliResult(toolName: string, score: number, issuesCount: number): void;
|
|
637
|
+
/**
|
|
638
|
+
* Common CLI action helper to unify try-catch and output handling.
|
|
639
|
+
*/
|
|
640
|
+
declare function runStandardCliAction(toolName: string, action: () => Promise<{
|
|
641
|
+
score: number;
|
|
642
|
+
issuesCount: number;
|
|
643
|
+
}>): Promise<void>;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Interface for standard CLI report data
|
|
647
|
+
*/
|
|
648
|
+
interface StandardReportData {
|
|
649
|
+
title: string;
|
|
650
|
+
subtitle?: string;
|
|
651
|
+
score: number;
|
|
652
|
+
rating: string;
|
|
653
|
+
dimensions: Array<{
|
|
654
|
+
name: string;
|
|
655
|
+
value: number;
|
|
656
|
+
label?: string;
|
|
657
|
+
}>;
|
|
658
|
+
stats?: Array<{
|
|
659
|
+
label: string;
|
|
660
|
+
value: string | number;
|
|
661
|
+
}>;
|
|
662
|
+
issues: Array<{
|
|
663
|
+
severity: Severity | string;
|
|
664
|
+
message: string;
|
|
665
|
+
suggestion?: string;
|
|
666
|
+
}>;
|
|
667
|
+
recommendations?: string[];
|
|
668
|
+
elapsedTime: string;
|
|
669
|
+
noIssuesMessage?: string;
|
|
670
|
+
safetyRating?: string;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Get color for score values
|
|
674
|
+
*/
|
|
675
|
+
declare function getScoreColor(score: number): chalk.ChalkInstance;
|
|
676
|
+
/**
|
|
677
|
+
* Display a standardized console report for any AIReady spoke CLI
|
|
678
|
+
*
|
|
679
|
+
* @param data - The report data to display
|
|
680
|
+
* @lastUpdated 2026-03-22
|
|
681
|
+
*/
|
|
682
|
+
declare function displayStandardConsoleReport(data: StandardReportData): void;
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Logical code block extracted from source
|
|
686
|
+
*/
|
|
687
|
+
interface CodeBlock {
|
|
688
|
+
file: string;
|
|
689
|
+
startLine: number;
|
|
690
|
+
endLine: number;
|
|
691
|
+
code: string;
|
|
692
|
+
tokens: number;
|
|
693
|
+
patternType: string;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Infer the type of code pattern based on keywords and naming conventions.
|
|
697
|
+
*/
|
|
698
|
+
declare function inferPatternType(keyword: string, name: string): string;
|
|
699
|
+
/**
|
|
700
|
+
* Split file content into logical blocks (functions, classes, methods)
|
|
701
|
+
* Handles TS/JS, Java, C#, Go, and Python (via indentation)
|
|
702
|
+
*/
|
|
703
|
+
declare function extractCodeBlocks(file: string, content: string): CodeBlock[];
|
|
704
|
+
|
|
448
705
|
/**
|
|
449
706
|
* AI model pricing presets for cost estimation.
|
|
450
707
|
* Prices are input token costs per 1K tokens (USD), as of Q1 2026.
|
|
@@ -470,11 +727,33 @@ declare const DEFAULT_COST_CONFIG: CostConfig;
|
|
|
470
727
|
/**
|
|
471
728
|
* Calculate estimated monthly cost of AI context waste
|
|
472
729
|
*/
|
|
473
|
-
declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig
|
|
730
|
+
declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig>, options?: {
|
|
731
|
+
avgContextBudget?: number;
|
|
732
|
+
fragmentationScore?: number;
|
|
733
|
+
potentialSavings?: number;
|
|
734
|
+
}): {
|
|
474
735
|
total: number;
|
|
475
736
|
range: [number, number];
|
|
476
737
|
confidence: number;
|
|
477
738
|
};
|
|
739
|
+
/**
|
|
740
|
+
* Calculate precise Token ROI from analyzer metrics.
|
|
741
|
+
*
|
|
742
|
+
* This is the "Value-Led" monetization engine that quantifies the
|
|
743
|
+
* "Context Tax" savings for a team.
|
|
744
|
+
*/
|
|
745
|
+
declare function calculateDetailedTokenROI(params: {
|
|
746
|
+
totalTokens: number;
|
|
747
|
+
avgContextBudget: number;
|
|
748
|
+
potentialSavings: number;
|
|
749
|
+
fragmentationScore: number;
|
|
750
|
+
developerCount: number;
|
|
751
|
+
queriesPerDevPerDay?: number;
|
|
752
|
+
}): {
|
|
753
|
+
monthlySavings: number;
|
|
754
|
+
contextTaxPerDev: number;
|
|
755
|
+
efficiencyGain: number;
|
|
756
|
+
};
|
|
478
757
|
/**
|
|
479
758
|
* Calculate token budget and unit economics
|
|
480
759
|
*/
|
|
@@ -631,6 +910,7 @@ declare function calculateBusinessROI(params: {
|
|
|
631
910
|
/** Projected total annual business value gained */
|
|
632
911
|
annualValue: number;
|
|
633
912
|
};
|
|
913
|
+
|
|
634
914
|
/**
|
|
635
915
|
* Format currency value for display in console or reports.
|
|
636
916
|
*
|
|
@@ -675,27 +955,25 @@ declare function generateValueChain(params: {
|
|
|
675
955
|
severity: 'critical' | 'major' | 'minor';
|
|
676
956
|
}): TechnicalValueChain;
|
|
677
957
|
|
|
678
|
-
/**
|
|
679
|
-
* Parser Factory - Manages language-specific parsers
|
|
680
|
-
*
|
|
681
|
-
* This factory provides a centralized way to access the appropriate parser
|
|
682
|
-
* for a given file based on its extension.
|
|
683
|
-
*/
|
|
684
|
-
|
|
685
958
|
/**
|
|
686
959
|
* Factory for creating and managing language parsers.
|
|
687
960
|
* Supports both singleton usage and multiple instances for test isolation.
|
|
688
961
|
*
|
|
689
|
-
* @lastUpdated 2026-03-
|
|
962
|
+
* @lastUpdated 2026-03-22
|
|
690
963
|
*/
|
|
691
964
|
declare class ParserFactory {
|
|
692
965
|
private static instance;
|
|
693
966
|
private parsers;
|
|
694
967
|
private extensionMap;
|
|
968
|
+
private registeredParsers;
|
|
695
969
|
/**
|
|
696
970
|
* Create a new ParserFactory instance
|
|
697
971
|
*/
|
|
698
972
|
constructor();
|
|
973
|
+
/**
|
|
974
|
+
* Register a lazy-loaded parser
|
|
975
|
+
*/
|
|
976
|
+
registerLazyParser(language: Language, loader: () => Promise<LanguageParser>): void;
|
|
699
977
|
/**
|
|
700
978
|
* Get the global singleton instance
|
|
701
979
|
*
|
|
@@ -709,13 +987,13 @@ declare class ParserFactory {
|
|
|
709
987
|
/**
|
|
710
988
|
* Get parser for a specific language
|
|
711
989
|
*/
|
|
712
|
-
getParserForLanguage(language: Language): LanguageParser | null
|
|
990
|
+
getParserForLanguage(language: Language): Promise<LanguageParser | null>;
|
|
713
991
|
/**
|
|
714
992
|
* Get parser for a file based on its extension
|
|
715
993
|
*/
|
|
716
|
-
getParserForFile(filePath: string): LanguageParser | null
|
|
994
|
+
getParserForFile(filePath: string): Promise<LanguageParser | null>;
|
|
717
995
|
/**
|
|
718
|
-
* Check if a file is supported
|
|
996
|
+
* Check if a file is supported (synchronous check based on extension)
|
|
719
997
|
*/
|
|
720
998
|
isSupported(filePath: string): boolean;
|
|
721
999
|
/**
|
|
@@ -748,9 +1026,9 @@ declare class ParserFactory {
|
|
|
748
1026
|
*
|
|
749
1027
|
* @param filePath - Path to the file to get a parser for.
|
|
750
1028
|
* @returns LanguageParser instance or null if unsupported.
|
|
751
|
-
* @lastUpdated 2026-03-
|
|
1029
|
+
* @lastUpdated 2026-03-22
|
|
752
1030
|
*/
|
|
753
|
-
declare function getParser(filePath: string): LanguageParser | null
|
|
1031
|
+
declare function getParser(filePath: string): Promise<LanguageParser | null>;
|
|
754
1032
|
/**
|
|
755
1033
|
* Initialize all parsers
|
|
756
1034
|
*/
|
|
@@ -1462,40 +1740,6 @@ interface FutureProofRecommendationParams {
|
|
|
1462
1740
|
dependencyHealth?: DependencyHealthScore;
|
|
1463
1741
|
}
|
|
1464
1742
|
|
|
1465
|
-
/**
|
|
1466
|
-
* Change Amplification Metrics.
|
|
1467
|
-
* Measures how a change in one file ripples through the system via dependency fan-out.
|
|
1468
|
-
*
|
|
1469
|
-
* @lastUpdated 2026-03-18
|
|
1470
|
-
*/
|
|
1471
|
-
interface ChangeAmplificationScore {
|
|
1472
|
-
score: number;
|
|
1473
|
-
rating: 'isolated' | 'contained' | 'amplified' | 'explosive';
|
|
1474
|
-
avgAmplification: number;
|
|
1475
|
-
maxAmplification: number;
|
|
1476
|
-
hotspots: Array<{
|
|
1477
|
-
file: string;
|
|
1478
|
-
fanOut: number;
|
|
1479
|
-
fanIn: number;
|
|
1480
|
-
amplificationFactor: number;
|
|
1481
|
-
}>;
|
|
1482
|
-
recommendations: string[];
|
|
1483
|
-
}
|
|
1484
|
-
/**
|
|
1485
|
-
* Calculate Change Amplification metrics for a set of files in a dependency graph.
|
|
1486
|
-
*
|
|
1487
|
-
* @param params - Structural metrics gathered from link analysis.
|
|
1488
|
-
* @param params.files - List of files with their fan-in/fan-out counts.
|
|
1489
|
-
* @returns Comprehensive ChangeAmplificationScore.
|
|
1490
|
-
*/
|
|
1491
|
-
declare function calculateChangeAmplification(params: {
|
|
1492
|
-
files: Array<{
|
|
1493
|
-
file: string;
|
|
1494
|
-
fanOut: number;
|
|
1495
|
-
fanIn: number;
|
|
1496
|
-
}>;
|
|
1497
|
-
}): ChangeAmplificationScore;
|
|
1498
|
-
|
|
1499
1743
|
/**
|
|
1500
1744
|
* Future-Proof AI Metrics Abstraction Layer.
|
|
1501
1745
|
*
|
|
@@ -1539,6 +1783,40 @@ declare function calculateExtendedFutureProofScore(params: FutureProofRecommenda
|
|
|
1539
1783
|
semanticDistances?: SemanticDistance[];
|
|
1540
1784
|
}): ToolScoringOutput;
|
|
1541
1785
|
|
|
1786
|
+
/**
|
|
1787
|
+
* Change Amplification Metrics.
|
|
1788
|
+
* Measures how a change in one file ripples through the system via dependency fan-out.
|
|
1789
|
+
*
|
|
1790
|
+
* @lastUpdated 2026-03-18
|
|
1791
|
+
*/
|
|
1792
|
+
interface ChangeAmplificationScore {
|
|
1793
|
+
score: number;
|
|
1794
|
+
rating: 'isolated' | 'contained' | 'amplified' | 'explosive';
|
|
1795
|
+
avgAmplification: number;
|
|
1796
|
+
maxAmplification: number;
|
|
1797
|
+
hotspots: Array<{
|
|
1798
|
+
file: string;
|
|
1799
|
+
fanOut: number;
|
|
1800
|
+
fanIn: number;
|
|
1801
|
+
amplificationFactor: number;
|
|
1802
|
+
}>;
|
|
1803
|
+
recommendations: string[];
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Calculate Change Amplification metrics for a set of files in a dependency graph.
|
|
1807
|
+
*
|
|
1808
|
+
* @param params - Structural metrics gathered from link analysis.
|
|
1809
|
+
* @param params.files - List of files with their fan-in/fan-out counts.
|
|
1810
|
+
* @returns Comprehensive ChangeAmplificationScore.
|
|
1811
|
+
*/
|
|
1812
|
+
declare function calculateChangeAmplification(params: {
|
|
1813
|
+
files: Array<{
|
|
1814
|
+
file: string;
|
|
1815
|
+
fanOut: number;
|
|
1816
|
+
fanIn: number;
|
|
1817
|
+
}>;
|
|
1818
|
+
}): ChangeAmplificationScore;
|
|
1819
|
+
|
|
1542
1820
|
/**
|
|
1543
1821
|
* Temporal Tracking Utilities
|
|
1544
1822
|
*
|
|
@@ -1654,4 +1932,4 @@ declare function severityToAnnotationLevel(severity: string): 'error' | 'warning
|
|
|
1654
1932
|
*/
|
|
1655
1933
|
declare function emitIssuesAsAnnotations(issues: any[]): void;
|
|
1656
1934
|
|
|
1657
|
-
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 FileTestability, 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 };
|
|
1935
|
+
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CodeBlock, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, Issue, type JSONOutputParams, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StandardReportData, type StandardScoringParams, type StatCard, type TableConfig, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildFactorsFromDimensions, buildSimpleProviderScore, buildSpokeOutput, buildStandardToolScore, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateHeuristicConfidence, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateStringSimilarity, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, createStandardProgressCallback, displayStandardConsoleReport, emitAnnotation, emitIssuesAsAnnotations, emitProgress, estimateCostFromBudget, estimateTokens, exportHistory, extractCodeBlocks, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, formatStandardCliResult, formatStandardReport, generateCompleteReport, generateIssueSummary, generateReportFooter, generateReportHead, generateReportHero, generateScoreCard, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getReportTimestamp, getSafetyIcon, getScoreBar, getScoreColor, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLevel, getSeverityValue, getSupportedLanguages, getTerminalDivider, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, handleStandardJSONOutput, inferPatternType, initTreeSitter, initializeParsers, isFileSupported, isSourceFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, prepareActionConfig, printTerminalHeader, readFileContent, resolveOutputFormat, resolveOutputPath, runStandardCliAction, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };
|