import type { ShellRunInvocation } from "./shell-runs.js"; export type OutputChannel = "stdout" | "stderr"; export interface ToolOutputCoverage { schema: "omnius.tool-output-coverage.v1"; sourceRef: string; generation: string; state: "capturing" | "complete" | "partial"; reason?: "quota" | "write_failed" | "interrupted"; streams: Record; } export interface ToolOutputPage { sourceRef: string; channel: OutputChannel; fromByte: number; toByte: number; text: string; encoding: "utf8" | "base64"; nextCursor: string | null; coverage: ToolOutputCoverage; } export declare const TOOL_OUTPUT_LIMITS: Readonly<{ perProcessBytes: number; workspaceBytes: number; pageBytes: 65536; entries: 4096; }>; /** A display cap cannot split a UTF16 surrogate pair from a valid decoded stream. */ export declare function boundedOutputPrefix(text: string, maxChars: number): string; export declare function sameOutputOwner(producer: ShellRunInvocation | undefined, reader: ShellRunInvocation | undefined): boolean; /** Native byte custody, independent of decoded previews and process/effect truth. * A restored spool grants observation access only, never stop/restart authority. */ export declare class ToolOutputSpool { readonly sourceRef: string; private manifest; private directory; private handles; private hashes; private closed; private capacity; constructor(workspace: string, owner?: ShellRunInvocation, options?: { perProcessBytes?: number; workspaceBytes?: number; }); static storageRoot(workspace: string): string; private fail; private persist; append(channel: OutputChannel, bytes: Buffer): void; snapshot(): ToolOutputCoverage; finish(complete?: boolean): ToolOutputCoverage; /** Byte cursor pages cannot invent full producer coverage or process truth. * Invalid/non-UTF8 bytes remain exactly recoverable as base64. */ static read(workspace: string, sourceRef: string, reader: ShellRunInvocation | undefined, options?: { channel?: OutputChannel; cursor?: string; maxBytes?: number; }): ToolOutputPage; }