import type { HarnessDescriptor } from "../knowledge/descriptor.js"; import type { SpawnArgvOptions } from "./argv.js"; /** Preserve the real turn's launch settings, replacing only its prompt * transport. The pending task is staged later over the control channel. */ export declare function buildContextInspectionArgv(harness: HarnessDescriptor, options: SpawnArgvOptions): string[]; export declare function assertContextInspectionOptions(harness: HarnessDescriptor, options: SpawnArgvOptions): void; /** A native estimate of the complete staged request, including recalled * history. No inferred token ratio or model table is used here. The caller * owns its additional reserve and dispatch policy. */ export type ContextInspection = { readonly contextWindowTokens: number; readonly inputLimitTokens: number; readonly method: "native-context-estimate"; readonly model: string; readonly status: "available"; readonly totalTokens: number; } | { readonly reason: "cancelled" | "transport-limit" | "transport" | "protocol" | "timeout" | "cleanup"; readonly status: "unavailable"; } | { readonly reason: "unverified-adapter" | "unsupported-adapter" | "auth" | "limit" | "native-exit"; readonly status: "unavailable"; }; /** Cleanup and caller interruption take precedence. Otherwise a recognized * native failure explains a failed exchange more precisely than its framing. */ export declare function settledContextInspection(facts: { readonly accounting: ContextInspection; readonly clean: boolean; readonly exitCode: number | null; readonly nativeFailure: "auth" | "limit" | null; }): ContextInspection; /** Normalize only a complete native response. A window alone says nothing * about remaining capacity, and invalid compaction data must not increase it. */ export declare function contextInspectionOf(input: unknown): ContextInspection; export interface ContextProbe { readonly initial: string; readonly staged: string; accept(line: string): { readonly kind: "send"; readonly line: string; } | { readonly kind: "complete"; readonly accounting: ContextInspection; } | null; } /** Pure protocol state: only an acknowledgement of this staged UUID allows * the usage query. The execution owner handles transport and cancellation. */ export declare function createContextProbe(inputId: string, prompt: string): ContextProbe; //# sourceMappingURL=context-inspection.d.ts.map