import type { AccountModelDescriptor } from './account-model-catalog.ts'; /** Managed-route admission and compaction defaults; these never replace catalog capacities. */ export interface RequestBudgetPolicy { /** Estimated framing/tokenization headroom deducted from admissible input, once. */ readonly safetyTokens: number; /** Fraction of hard input headroom used only by callers eligible for proactive compaction. */ readonly pressureRatio: number; /** Used only for compaction with no caller or adapter-resolved effort. */ readonly compactionReasoning: 'prefer-low' | 'preserve'; } /** The safety allowance matches the pinned native SDK; pressure is a separate opt-in check. */ export declare const DEFAULT_REQUEST_BUDGET_POLICY: Readonly; /** Validate deployment policy before applying defaults; unknown keys fail rather than silently drift. */ export declare function resolveRequestBudgetPolicy(config?: Partial): Readonly; export type RequestBudgetLimits = Pick; /** A detached operational budget alongside, not in place of, the supplier capacities. */ export interface RequestBudget { readonly contextWindow: number; readonly maxInputTokens?: number; readonly maxOutputTokens: number; /** Explicit request cap, or the model's output capability when the request omits one. */ readonly outputReservation: number; readonly hardInputLimit: number; readonly pressureInputLimit: number; readonly limitingFactor: 'prompt' | 'context'; } export type RequestBudgetFailureCode = 'COPILOT_REQUEST_INVALID_LIMITS' | 'COPILOT_REQUEST_INVALID_OUTPUT_LIMIT' | 'COPILOT_REQUEST_OUTPUT_LIMIT_EXCEEDED' | 'COPILOT_REQUEST_NO_INPUT_HEADROOM' | 'COPILOT_REQUEST_INVALID_ESTIMATE' | 'COPILOT_REQUEST_INPUT_LIMIT_EXCEEDED' | 'COPILOT_REQUEST_CONTEXT_LIMIT_EXCEEDED' | 'COPILOT_REQUEST_PRESSURE_EXCEEDED'; /** Owned diagnostics only; no credentials, request content, or provider error bodies. */ export interface RequestBudgetFailure { readonly ok: false; readonly code: RequestBudgetFailureCode; readonly message: string; } export type RequestBudgetResult = Readonly<{ ok: true; budget: Readonly; }> | RequestBudgetFailure; export type RequestBudgetAdmission = Readonly<{ ok: true; }> | RequestBudgetFailure; /** * Reserve output under the combined context and independently enforce the prompt ceiling. * `policy` must come from resolveRequestBudgetPolicy; no caller cap or catalog object is changed. */ export declare function calculateRequestBudget(limits: RequestBudgetLimits, requestedMaxTokens?: number, policy?: Readonly): RequestBudgetResult; /** * Check an estimated full prompt; estimates are not provider-exact token counts. * Enable pressure only for an owned ordinary loop call with a compaction recovery path. * Auxiliary and agentless calls use hard admission, including compaction itself. */ export declare function assessRequestBudget(estimatedInput: number, budget: Readonly, pressure?: boolean): RequestBudgetAdmission; /** * Select a low-cost supported effort only for a caller-confirmed compaction request. * A supplied effort, including a materialized provider default, wins unchanged; native validation * remains authoritative. Unsupported low-cost controls preserve the provider default, never off/none. */ export declare function selectCompactionReasoning(supportedEfforts: readonly Effort[], requestedEffort?: Effort, mode?: RequestBudgetPolicy['compactionReasoning']): Effort | undefined; //# sourceMappingURL=request-budget.d.ts.map