@aiready/core 0.23.15 → 0.23.20
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-2Y6WZCES.mjs +859 -0
- package/dist/chunk-FMNCV4CC.mjs +859 -0
- package/dist/chunk-REU6OUBT.mjs +859 -0
- package/dist/chunk-RMH2TPAT.mjs +822 -0
- package/dist/chunk-SQHS6PFL.mjs +859 -0
- package/dist/chunk-ST75O5C5.mjs +859 -0
- package/dist/chunk-ZB3EHHAG.mjs +822 -0
- package/dist/client-CYz0qxGB.d.mts +1217 -0
- package/dist/client-CYz0qxGB.d.ts +1217 -0
- package/dist/client-DLvFR2qA.d.mts +1197 -0
- package/dist/client-DLvFR2qA.d.ts +1197 -0
- package/dist/client-jGuH6TAG.d.mts +1244 -0
- package/dist/client-jGuH6TAG.d.ts +1244 -0
- package/dist/client-pYldIAg2.d.mts +1209 -0
- package/dist/client-pYldIAg2.d.ts +1209 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +210 -177
- package/dist/client.mjs +27 -3
- package/dist/index.d.mts +73 -4
- package/dist/index.d.ts +73 -4
- package/dist/index.js +362 -183
- package/dist/index.mjs +133 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, I as Issue, M as Metrics, f as ModelContextTier, C as CostConfig, 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-
|
|
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
|
|
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-jGuH6TAG.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 getPriorityIcon, az as getProjectSizeTier, aA as getRating, aB as getRatingDisplay, aC as getRatingEmoji, aD as getRatingLabel, aE as getRatingSlug, aF as getRatingWithContext, aG as getRecommendedThreshold, aH as getToolEmoji, aI as getToolWeight, aJ as normalizeToolName, aK as parseWeightString } from './client-jGuH6TAG.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as Parser from 'web-tree-sitter';
|
|
5
5
|
|
|
@@ -428,6 +428,52 @@ declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
|
|
|
428
428
|
*/
|
|
429
429
|
declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
|
|
430
430
|
|
|
431
|
+
/**
|
|
432
|
+
* Shared HTML report builder utility
|
|
433
|
+
* Provides common template parts for generating self-contained HTML reports.
|
|
434
|
+
*/
|
|
435
|
+
interface ReportOptions {
|
|
436
|
+
title: string;
|
|
437
|
+
subtitle?: string;
|
|
438
|
+
packageName: string;
|
|
439
|
+
packageUrl?: string;
|
|
440
|
+
bugUrl?: string;
|
|
441
|
+
version?: string;
|
|
442
|
+
}
|
|
443
|
+
interface StatCard {
|
|
444
|
+
value: string | number;
|
|
445
|
+
label: string;
|
|
446
|
+
color?: string;
|
|
447
|
+
}
|
|
448
|
+
interface TableConfig {
|
|
449
|
+
headers: string[];
|
|
450
|
+
rows: string[][];
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Generate the HTML document head with common styles
|
|
454
|
+
*/
|
|
455
|
+
declare function generateReportHead(title: string): string;
|
|
456
|
+
/**
|
|
457
|
+
* Generate stat cards section
|
|
458
|
+
*/
|
|
459
|
+
declare function generateStatCards(cards: StatCard[]): string;
|
|
460
|
+
/**
|
|
461
|
+
* Generate an HTML table from config
|
|
462
|
+
*/
|
|
463
|
+
declare function generateTable(config: TableConfig): string;
|
|
464
|
+
/**
|
|
465
|
+
* Generate the report footer
|
|
466
|
+
*/
|
|
467
|
+
declare function generateReportFooter(options: ReportOptions): string;
|
|
468
|
+
/**
|
|
469
|
+
* Wrap content in a card div
|
|
470
|
+
*/
|
|
471
|
+
declare function wrapInCard(content: string, title?: string): string;
|
|
472
|
+
/**
|
|
473
|
+
* Generate a complete report by combining all parts
|
|
474
|
+
*/
|
|
475
|
+
declare function generateCompleteReport(options: ReportOptions, bodyContent: string): string;
|
|
476
|
+
|
|
431
477
|
/**
|
|
432
478
|
* Normalizes raw issue data into a strict Issue object.
|
|
433
479
|
*/
|
|
@@ -470,11 +516,33 @@ declare const DEFAULT_COST_CONFIG: CostConfig;
|
|
|
470
516
|
/**
|
|
471
517
|
* Calculate estimated monthly cost of AI context waste
|
|
472
518
|
*/
|
|
473
|
-
declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig
|
|
519
|
+
declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig>, options?: {
|
|
520
|
+
avgContextBudget?: number;
|
|
521
|
+
fragmentationScore?: number;
|
|
522
|
+
potentialSavings?: number;
|
|
523
|
+
}): {
|
|
474
524
|
total: number;
|
|
475
525
|
range: [number, number];
|
|
476
526
|
confidence: number;
|
|
477
527
|
};
|
|
528
|
+
/**
|
|
529
|
+
* Calculate precise Token ROI from analyzer metrics.
|
|
530
|
+
*
|
|
531
|
+
* This is the "Value-Led" monetization engine that quantifies the
|
|
532
|
+
* "Context Tax" savings for a team.
|
|
533
|
+
*/
|
|
534
|
+
declare function calculateDetailedTokenROI(params: {
|
|
535
|
+
totalTokens: number;
|
|
536
|
+
avgContextBudget: number;
|
|
537
|
+
potentialSavings: number;
|
|
538
|
+
fragmentationScore: number;
|
|
539
|
+
developerCount: number;
|
|
540
|
+
queriesPerDevPerDay?: number;
|
|
541
|
+
}): {
|
|
542
|
+
monthlySavings: number;
|
|
543
|
+
contextTaxPerDev: number;
|
|
544
|
+
efficiencyGain: number;
|
|
545
|
+
};
|
|
478
546
|
/**
|
|
479
547
|
* Calculate token budget and unit economics
|
|
480
548
|
*/
|
|
@@ -631,6 +699,7 @@ declare function calculateBusinessROI(params: {
|
|
|
631
699
|
/** Projected total annual business value gained */
|
|
632
700
|
annualValue: number;
|
|
633
701
|
};
|
|
702
|
+
|
|
634
703
|
/**
|
|
635
704
|
* Format currency value for display in console or reports.
|
|
636
705
|
*
|
|
@@ -1654,4 +1723,4 @@ declare function severityToAnnotationLevel(severity: string): 'error' | 'warning
|
|
|
1654
1723
|
*/
|
|
1655
1724
|
declare function emitIssuesAsAnnotations(issues: any[]): void;
|
|
1656
1725
|
|
|
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 };
|
|
1726
|
+
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, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StatCard, type TableConfig, 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, calculateDetailedTokenROI, 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, generateCompleteReport, generateReportFooter, generateReportHead, generateStatCards, generateTable, 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, wrapInCard };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as ToolName, S as ScanOptions, a as SpokeOutput, b as ToolScoringOutput, c as ToolOptions, d as Severity, A as AnalysisResult, E as ExportWithImports, F as FileImport, e as AIReadyConfig, I as Issue, M as Metrics, f as ModelContextTier, C as CostConfig, 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-
|
|
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
|
|
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-jGuH6TAG.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 getPriorityIcon, az as getProjectSizeTier, aA as getRating, aB as getRatingDisplay, aC as getRatingEmoji, aD as getRatingLabel, aE as getRatingSlug, aF as getRatingWithContext, aG as getRecommendedThreshold, aH as getToolEmoji, aI as getToolWeight, aJ as normalizeToolName, aK as parseWeightString } from './client-jGuH6TAG.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as Parser from 'web-tree-sitter';
|
|
5
5
|
|
|
@@ -428,6 +428,52 @@ declare function loadConfig(rootDir: string): Promise<AIReadyConfig | null>;
|
|
|
428
428
|
*/
|
|
429
429
|
declare function mergeConfigWithDefaults(userConfig: AIReadyConfig | null, defaults: any): any;
|
|
430
430
|
|
|
431
|
+
/**
|
|
432
|
+
* Shared HTML report builder utility
|
|
433
|
+
* Provides common template parts for generating self-contained HTML reports.
|
|
434
|
+
*/
|
|
435
|
+
interface ReportOptions {
|
|
436
|
+
title: string;
|
|
437
|
+
subtitle?: string;
|
|
438
|
+
packageName: string;
|
|
439
|
+
packageUrl?: string;
|
|
440
|
+
bugUrl?: string;
|
|
441
|
+
version?: string;
|
|
442
|
+
}
|
|
443
|
+
interface StatCard {
|
|
444
|
+
value: string | number;
|
|
445
|
+
label: string;
|
|
446
|
+
color?: string;
|
|
447
|
+
}
|
|
448
|
+
interface TableConfig {
|
|
449
|
+
headers: string[];
|
|
450
|
+
rows: string[][];
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Generate the HTML document head with common styles
|
|
454
|
+
*/
|
|
455
|
+
declare function generateReportHead(title: string): string;
|
|
456
|
+
/**
|
|
457
|
+
* Generate stat cards section
|
|
458
|
+
*/
|
|
459
|
+
declare function generateStatCards(cards: StatCard[]): string;
|
|
460
|
+
/**
|
|
461
|
+
* Generate an HTML table from config
|
|
462
|
+
*/
|
|
463
|
+
declare function generateTable(config: TableConfig): string;
|
|
464
|
+
/**
|
|
465
|
+
* Generate the report footer
|
|
466
|
+
*/
|
|
467
|
+
declare function generateReportFooter(options: ReportOptions): string;
|
|
468
|
+
/**
|
|
469
|
+
* Wrap content in a card div
|
|
470
|
+
*/
|
|
471
|
+
declare function wrapInCard(content: string, title?: string): string;
|
|
472
|
+
/**
|
|
473
|
+
* Generate a complete report by combining all parts
|
|
474
|
+
*/
|
|
475
|
+
declare function generateCompleteReport(options: ReportOptions, bodyContent: string): string;
|
|
476
|
+
|
|
431
477
|
/**
|
|
432
478
|
* Normalizes raw issue data into a strict Issue object.
|
|
433
479
|
*/
|
|
@@ -470,11 +516,33 @@ declare const DEFAULT_COST_CONFIG: CostConfig;
|
|
|
470
516
|
/**
|
|
471
517
|
* Calculate estimated monthly cost of AI context waste
|
|
472
518
|
*/
|
|
473
|
-
declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig
|
|
519
|
+
declare function calculateMonthlyCost(tokenWaste: number, config?: Partial<CostConfig>, options?: {
|
|
520
|
+
avgContextBudget?: number;
|
|
521
|
+
fragmentationScore?: number;
|
|
522
|
+
potentialSavings?: number;
|
|
523
|
+
}): {
|
|
474
524
|
total: number;
|
|
475
525
|
range: [number, number];
|
|
476
526
|
confidence: number;
|
|
477
527
|
};
|
|
528
|
+
/**
|
|
529
|
+
* Calculate precise Token ROI from analyzer metrics.
|
|
530
|
+
*
|
|
531
|
+
* This is the "Value-Led" monetization engine that quantifies the
|
|
532
|
+
* "Context Tax" savings for a team.
|
|
533
|
+
*/
|
|
534
|
+
declare function calculateDetailedTokenROI(params: {
|
|
535
|
+
totalTokens: number;
|
|
536
|
+
avgContextBudget: number;
|
|
537
|
+
potentialSavings: number;
|
|
538
|
+
fragmentationScore: number;
|
|
539
|
+
developerCount: number;
|
|
540
|
+
queriesPerDevPerDay?: number;
|
|
541
|
+
}): {
|
|
542
|
+
monthlySavings: number;
|
|
543
|
+
contextTaxPerDev: number;
|
|
544
|
+
efficiencyGain: number;
|
|
545
|
+
};
|
|
478
546
|
/**
|
|
479
547
|
* Calculate token budget and unit economics
|
|
480
548
|
*/
|
|
@@ -631,6 +699,7 @@ declare function calculateBusinessROI(params: {
|
|
|
631
699
|
/** Projected total annual business value gained */
|
|
632
700
|
annualValue: number;
|
|
633
701
|
};
|
|
702
|
+
|
|
634
703
|
/**
|
|
635
704
|
* Format currency value for display in console or reports.
|
|
636
705
|
*
|
|
@@ -1654,4 +1723,4 @@ declare function severityToAnnotationLevel(severity: string): 'error' | 'warning
|
|
|
1654
1723
|
*/
|
|
1655
1724
|
declare function emitIssuesAsAnnotations(issues: any[]): void;
|
|
1656
1725
|
|
|
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 };
|
|
1726
|
+
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, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StatCard, type TableConfig, 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, calculateDetailedTokenROI, 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, generateCompleteReport, generateReportFooter, generateReportHead, generateStatCards, generateTable, 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, wrapInCard };
|