cto-ai-cli 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOCS.md +352 -0
- package/README.md +192 -15
- package/dist/action/index.js +629 -83
- package/dist/api/dashboard.js +107 -23
- package/dist/api/dashboard.js.map +1 -1
- package/dist/api/server.js +108 -24
- package/dist/api/server.js.map +1 -1
- package/dist/cli/gateway.js +2925 -0
- package/dist/cli/score.js +3015 -237
- package/dist/cli/v2/index.js +133 -49
- package/dist/cli/v2/index.js.map +1 -1
- package/dist/engine/index.d.ts +85 -1
- package/dist/engine/index.js +665 -42
- package/dist/engine/index.js.map +1 -1
- package/dist/gateway/index.d.ts +281 -0
- package/dist/gateway/index.js +2803 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/govern/index.d.ts +67 -3
- package/dist/govern/index.js +462 -23
- package/dist/govern/index.js.map +1 -1
- package/dist/interact/index.js +108 -24
- package/dist/interact/index.js.map +1 -1
- package/dist/mcp/v2.js +130 -46
- package/dist/mcp/v2.js.map +1 -1
- package/package.json +3 -2
package/dist/engine/index.d.ts
CHANGED
|
@@ -813,4 +813,88 @@ declare function estimateTokens(content: string, sizeInBytes: number, method?: '
|
|
|
813
813
|
declare function estimateFileTokens(filePath: string, method?: 'chars4' | 'tiktoken'): Promise<number>;
|
|
814
814
|
declare function freeEncoder(): void;
|
|
815
815
|
|
|
816
|
-
|
|
816
|
+
type MonorepoTool = 'npm-workspaces' | 'yarn-workspaces' | 'pnpm-workspaces' | 'turborepo' | 'nx' | 'lerna' | 'none';
|
|
817
|
+
interface PackageInfo {
|
|
818
|
+
name: string;
|
|
819
|
+
path: string;
|
|
820
|
+
relativePath: string;
|
|
821
|
+
files: number;
|
|
822
|
+
tokens: number;
|
|
823
|
+
dependencies: string[];
|
|
824
|
+
dependents: string[];
|
|
825
|
+
isShared: boolean;
|
|
826
|
+
entryPoints: string[];
|
|
827
|
+
}
|
|
828
|
+
interface CrossPackageEdge {
|
|
829
|
+
from: string;
|
|
830
|
+
to: string;
|
|
831
|
+
files: number;
|
|
832
|
+
type: 'dependency' | 'devDependency' | 'peer';
|
|
833
|
+
}
|
|
834
|
+
interface MonorepoAnalysis {
|
|
835
|
+
detected: boolean;
|
|
836
|
+
tool: MonorepoTool;
|
|
837
|
+
rootPath: string;
|
|
838
|
+
packages: PackageInfo[];
|
|
839
|
+
sharedPackages: PackageInfo[];
|
|
840
|
+
crossPackageEdges: CrossPackageEdge[];
|
|
841
|
+
isolationScore: number;
|
|
842
|
+
totalTokens: number;
|
|
843
|
+
packageTokenMap: Record<string, number>;
|
|
844
|
+
}
|
|
845
|
+
interface PackageContextResult {
|
|
846
|
+
targetPackage: string;
|
|
847
|
+
includedPackages: string[];
|
|
848
|
+
excludedPackages: string[];
|
|
849
|
+
originalTokens: number;
|
|
850
|
+
optimizedTokens: number;
|
|
851
|
+
savedTokens: number;
|
|
852
|
+
savedPercent: number;
|
|
853
|
+
}
|
|
854
|
+
declare function detectMonorepoTool(rootPath: string): Promise<MonorepoTool>;
|
|
855
|
+
declare function analyzeMonorepo(rootPath: string, analysis?: ProjectAnalysis): Promise<MonorepoAnalysis>;
|
|
856
|
+
declare function selectPackageContext(monorepo: MonorepoAnalysis, targetPackage: string): PackageContextResult;
|
|
857
|
+
declare function renderMonorepoAnalysis(mono: MonorepoAnalysis): string;
|
|
858
|
+
declare function renderPackageContext(result: PackageContextResult): string;
|
|
859
|
+
|
|
860
|
+
interface QualityGateConfig {
|
|
861
|
+
threshold: number;
|
|
862
|
+
failOnSecrets: boolean;
|
|
863
|
+
failOnRegression: boolean;
|
|
864
|
+
regressionLimit: number;
|
|
865
|
+
baselinePath: string;
|
|
866
|
+
secretSeverities: string[];
|
|
867
|
+
}
|
|
868
|
+
interface QualityGateCheck {
|
|
869
|
+
name: string;
|
|
870
|
+
passed: boolean;
|
|
871
|
+
detail: string;
|
|
872
|
+
severity: 'error' | 'warning' | 'info';
|
|
873
|
+
}
|
|
874
|
+
interface Baseline {
|
|
875
|
+
score: number;
|
|
876
|
+
grade: string;
|
|
877
|
+
timestamp: string;
|
|
878
|
+
commit?: string;
|
|
879
|
+
branch?: string;
|
|
880
|
+
dimensions: Record<string, number>;
|
|
881
|
+
}
|
|
882
|
+
interface QualityGateResult {
|
|
883
|
+
passed: boolean;
|
|
884
|
+
score: number;
|
|
885
|
+
grade: string;
|
|
886
|
+
previousScore: number | null;
|
|
887
|
+
delta: number | null;
|
|
888
|
+
checks: QualityGateCheck[];
|
|
889
|
+
baseline: Baseline | null;
|
|
890
|
+
prComment: string;
|
|
891
|
+
summary: string;
|
|
892
|
+
}
|
|
893
|
+
declare const DEFAULT_GATE_CONFIG: QualityGateConfig;
|
|
894
|
+
declare function loadBaseline(projectPath: string, baselinePath?: string): Promise<Baseline | null>;
|
|
895
|
+
declare function saveBaseline(projectPath: string, score: ContextScore, commit?: string, branch?: string, baselinePath?: string): Promise<void>;
|
|
896
|
+
declare function runQualityGate(score: ContextScore, analysis: ProjectAnalysis, secretFindings: {
|
|
897
|
+
severity: string;
|
|
898
|
+
}[], config?: Partial<QualityGateConfig>): Promise<QualityGateResult>;
|
|
899
|
+
|
|
900
|
+
export { type Baseline, type BenchmarkResult, type ChangeType, type ChangedFile, type CompilabilityMetrics, type CompilabilityResult, type CompileProofResult, type CompileProofStrategy, type ContextScore, type CrossPackageEdge, type CrossRepoModel, type CrossRepoPrediction, DEFAULT_GATE_CONFIG, type DimensionScore, type FeedbackEntry, type FeedbackInsight, type FeedbackModel, type FeedbackOutcome, type FileChangeEvent, type Grade, MODEL_REGISTRY, type ModelOptimization, type ModelProfile, type MonorepoAnalysis, type MonorepoTool, type MultiModelResult, type PRContextOptions, type PRContextResult, type PackageContextResult, type PackageInfo, type PredictionResult, type PredictorModel, type ProjectFingerprint, ProjectWatcher, type QualityBenchmarkResult, type QualityGateCheck, type QualityGateConfig, type QualityGateResult, type QualityMetrics, type ScoreInsight, type SelectionInput, type SemanticAnalysis, type SemanticDomain, type SemanticFingerprint, type StrategyResult, type WatcherOptions, analyzeMonorepo, analyzeProject, analyzeSemantics, bfsBidirectional, buildAdjacencyList, buildProjectGraph, calculateCoverage, classifyFileKind, computeContextScore, computeFingerprint, configureCache, countTokensChars4, countTokensTiktoken, createProject, detectMonorepoTool, detectStack, estimateFileTokens, estimateTokens, freeEncoder, generatePRContext, getActiveWatchers, getCTODir, getCacheStats, getCachedAnalysis, getConfigPath, getCrossRepoStats, getFeedbackBoosts, getModelStats, getPolicyPath, getPredictorBoosts, getPruneLevelForRisk, initProjectConfig, invalidateCache, loadBaseline, loadConfig, loadFeedbackModel, loadGlobalModel, loadModel, loadPolicyFromYAML, matchGlob, optimizeBudget, optimizeForModels, predictFromCrossRepo, predictRelevantFiles, pruneFile, pruneFiles, recordCrossRepoSelection, recordFeedback, recordSelection, renderBenchmark, renderCompilabilityBenchmark, renderCompileProof, renderContextScore, renderFeedbackReport, renderMonorepoAnalysis, renderMultiModelResult, renderPackageContext, renderQualityBenchmark, renderSemanticAnalysis, runBenchmark, runCompilabilityBenchmark, runCompileProof, runQualityBenchmark, runQualityGate, saveBaseline, saveConfig, scoreAllFiles, scoreFile, selectContext, selectPackageContext, semanticBoosts, unwatchAll, unwatchProject, walkProject, watchProject };
|