import type { WebFetchReceipt } from "./tools/web-fetch.js"; export interface StreamedUtf8Segment { index: number; byteStart: number; byteEndExclusive: number; charStart: number; charEndExclusive: number; lineStart: number; lineEnd: number; sha256: string; } export interface StreamedUtf8File { readonly path: string; readonly indexPath: string; readonly sha256: string; readonly bytes: number; readonly utf16Chars: number; readonly lineCount: number; readonly segmentCount: number; readonly indexSha256: string; } /** Full durable source bytes; no eager body, DOM, lazy getter or prefix text. */ export interface NativeStreamedWebSource { readonly schema: "omnius.native-streamed-web-source.v1"; readonly receipt: Readonly; readonly native: StreamedUtf8File; readonly semantic: StreamedUtf8File; readonly semanticScope: "all_static_body_text" | "complete_text"; readonly captureId: string; readonly html?: Readonly<{ rendered: false; semanticMode: "static_body_text" | "raw_html"; fallbackReason?: "tokenizer_requires_raw_view"; excludedElements: readonly string[]; includedAttributes: readonly string[]; }>; } export declare class StreamedWebBinaryRefusalError extends Error { readonly binaryKind: string; readonly observedBytes: number; constructor(binaryKind: string, observedBytes: number); } /** Internal producer operation; all input reaches private disk before routing. */ export declare function captureStreamedWebResponse(response: Response, receiptBase: Omit, options?: { signal?: AbortSignal; spoolRoot?: string; inspectPrefix?: (bytes: Uint8Array) => string | null; }): Promise; export declare function verifiedNativeStreamedWebSource(value: unknown): NativeStreamedWebSource | null; /** A bounded window. Exact segments and the whole immutable index are checked * without loading the full source or trusting caller-supplied filesystem data. */ export declare function readNativeStreamedWebSourceRange(source: NativeStreamedWebSource, range: { view: "native" | "semantic"; charStart: number; charEndExclusive: number; }, signal?: AbortSignal): Promise<{ content: string; charStart: number; charEndExclusive: number; sha256: string; }>; export declare function verifyNativeStreamedWebSource(source: NativeStreamedWebSource, signal?: AbortSignal): Promise; /** Internal disposal for failed/small captures; published large sources remain durable. */ export declare function disposeNativeStreamedWebSource(source: NativeStreamedWebSource): Promise;