/** * Bounded streaming redaction over raw child output. * * Two lanes run before any byte receives a cursor, so raw sensitive data never * reaches memory retention, artifacts, telemetry, or presentation: * * 1. A byte matcher removes the exact UTF-8 encodings of registered sensitive * values across arbitrary chunk splits, including next to invalid UTF-8. * 2. A decoder applies the existing textual secret patterns to the valid UTF-8 * runs of the emitted region. * * Retention is bounded: the only bytes held back are an incomplete trailing * UTF-8 code point and a tail that is still a viable prefix of a registered * secret. Prompts without a trailing newline therefore emit immediately. */ import { type SessionOperation } from "./types.js"; export declare const REDACTION_MARKER = "[redacted]"; export declare function trailingIncompleteUtf8Bytes(bytes: Uint8Array): number; export interface Utf8Run { readonly valid: boolean; readonly bytes: Uint8Array; } export declare function splitUtf8Runs(bytes: Uint8Array): Utf8Run[]; export declare class StreamingSecretRedactor { private readonly overlapBytes; private pending; private readonly secrets; private redactedAny; private closed; constructor(overlapBytes: number); get redacted(): boolean; registerExactSecret(value: string, operation?: SessionOperation): void; private viablePrefixTail; private viablePatternTail; push(raw: Uint8Array): Uint8Array; close(): Uint8Array; private transform; private applyByteLane; }