/** * Provider-neutral context-fit estimation. * * Callers supply the inputs they know exactly as tokens and the inputs they * only know as bytes. Keeping those components separate makes the estimate * deterministic while preserving the uncertainty introduced by byte-to-token * conversion. */ export declare const DEFAULT_EXECUTION_FIT_POLICY: { readonly contextWindowTokens: 250000; readonly targetWorkingSetTokens: 100000; readonly cautionWorkingSetTokens: 140000; readonly hardWorkingSetTokens: 190000; readonly toleranceTokens: 10000; readonly bytesPerToken: 4; readonly byteEstimateUncertainty: 0.25; readonly missingNewFileTokens: 4000; }; export interface ExecutionFitPolicy { contextWindowTokens: number; targetWorkingSetTokens: number; cautionWorkingSetTokens: number; hardWorkingSetTokens: number; /** * Deliberate slack around the target and caution boundaries. Estimation is * not precise enough for a small overage to force a different execution * strategy. */ toleranceTokens: number; bytesPerToken: number; /** Fractional uncertainty applied only to tokens estimated from bytes. */ byteEstimateUncertainty: number; /** Working-set allowance for each declared (NEW) file not on disk yet. */ missingNewFileTokens: number; } export interface ExecutionFitApproval { approved: boolean; justification?: string; } export interface ExecutionFitInput { /** Components whose token counts are already known. */ tokenComponents?: Readonly>; /** Components that must be converted to tokens using `bytesPerToken`. */ byteComponents?: Readonly>; /** Optional human decision for an oversized, but still possible, run. */ approval?: ExecutionFitApproval; } export type ExecutionFitClassification = "normal" | "caution" | "oversized" | "physically-impossible"; export interface ExecutionFitEstimate { classification: ExecutionFitClassification; knownTokens: number; estimatedTokensFromBytes: number; workingSetTokens: number; uncertaintyTokens: number; lowerBoundTokens: number; upperBoundTokens: number; /** True only when even the tolerant lower bound exceeds physical capacity. */ hardFailure: boolean; /** Oversized runs are possible, but should be an explicit human decision. */ approvalRequired: boolean; approval?: { approved: boolean; justification?: string; satisfied: boolean; }; } /** Deterministically estimate whether a supplied working set fits one run. */ export declare function estimateExecutionFit(input: ExecutionFitInput, policy?: ExecutionFitPolicy): ExecutionFitEstimate; export interface DeclaredTouchedFile { path: string; isNew: boolean; } export type ExecutionFitTextReader = (absolutePath: string) => Promise; export interface RepositoryExecutionFitInput { root: string; /** Supply the spec directly, or omit it and provide `taskPath`. */ specMarkdown?: string; taskPath?: string; visionPath: string; contextDocs?: readonly string[]; agentsPath?: string; readText?: ExecutionFitTextReader; approval?: ExecutionFitApproval; } export interface RepositoryExecutionFitComponents { staticCharacters: number; specCharacters: number; touchedFileCharacters: number; missingNewFileTokens: number; } export interface RepositoryExecutionFitAssessment extends ExecutionFitEstimate { components: RepositoryExecutionFitComponents; touchedFiles: DeclaredTouchedFile[]; missingNewFiles: string[]; missingReferencedFiles: string[]; } /** Parse file entries only from the spec's `Files Touched` section. */ export declare function declaredTouchedFiles(specMarkdown: string): DeclaredTouchedFile[]; /** * Measure the material one workstream asks an agent to carry. Text is counted * by characters and converted with the configured chars-per-token ratio; a * missing (NEW) file receives an explicit allowance instead of counting zero. */ export declare function assessRepositoryExecutionFit(input: RepositoryExecutionFitInput, policy?: ExecutionFitPolicy): Promise; //# sourceMappingURL=execution-fit.d.ts.map