import type { CompactionConfig } from '../config/runtime.js'; import type { TokenUsage } from '../types/common/index.js'; import type { Message } from '../types/message/index.js'; import type { LLMProvider } from '../types/provider/interface.js'; import type { WorkingStateManager } from './manager.js'; /** * Narrow sink for the tokens a side-channel model call spends. * * The verifier runs outside the iteration loop, so its usage never reached * `runMgr.accumulateUsage` and the guard could not see it — and it fires * exactly when the context is largest, making it the most expensive call * the turn does not count. A one-method sink keeps the compaction layer * from depending on `TurnRecorder`. */ export type UsageSink = (usage: TokenUsage) => void; /** Cancellation and stream-liveness policy for a compaction verifier call. */ export interface CompactionVerificationOptions { /** Stop before provider work starts, or close an in-flight verifier transport. */ readonly signal?: AbortSignal; /** * Milliseconds without a verifier chunk before the provider stream is * treated as stalled. Defaults to the SDK's finite shared bound. Set `0` * only for explicit unbounded compatibility. */ readonly streamIdleTimeoutMs?: number; } export declare function buildVerifiedSummary(manager: WorkingStateManager, olderMessages: Message[], provider: LLMProvider, config: CompactionConfig, onUsage?: UsageSink, /** * The turn's model. Required in practice: this used to send `model: ''`, * which some drivers quietly default and others reject outright — on * some backends the model id IS the endpoint. So compaction's verifier failed * exactly on the providers where a long turn most needs it, and the * failure surfaced as compaction killing the turn it exists to save. */ model?: string, options?: CompactionVerificationOptions): Promise; /** * Query-only seam for a provider whose idle/retry/fallback order was already * composed at turn admission. Wrapping that chain again would put an idle * timer around retry backoff and misclassify a healthy recovery pause as a * stalled stream. This symbol is intentionally absent from the package barrel. */ export declare function buildVerifiedSummaryWithBoundedProvider(manager: WorkingStateManager, olderMessages: Message[], provider: LLMProvider, config: CompactionConfig, onUsage?: UsageSink, model?: string, signal?: AbortSignal): Promise; //# sourceMappingURL=verifier.d.ts.map