/** * @file Deep redaction for payloads that carry live credentials beside state * worth keeping (audit inventories, captured API responses, transcripts). * `redactContext` strips credential-bearing fields as the payload is read, * so no caller ever holds a secret it could log. Value-shape detection * derives from the shared secret catalog (`secrets/patterns`) instead of a * second copy, so a vendor shape added there is caught here for free. * Pure by design: no network, no filesystem — unit-testable on its own. */ /** * Written in place of a credential-bearing value. */ export declare const REDACTED = "[redacted]"; /** * Written in place of a bulky or unwalkable field (an over-deep subtree, a * cycle, or a key in the omit list). */ export declare const OMITTED = "[omitted]"; /** * A copy of `value` with every credential-bearing field replaced. Walks * objects and arrays; leaves other primitives alone. * * Two passes, because a secret can hide behind either its key or its shape: a * field NAMED like a credential is redacted whatever it holds, and a string * that MATCHES a known token shape is redacted whatever it is called. The * second pass is what catches a token a vendor moves to a field the key list * has never seen. * * @example * ;```ts * redactContext({ token: 'abc', count: 2 }) * // { token: '[redacted]', count: 2 } * ``` * * @param value - The payload to copy and redact. * * @returns A redacted copy of `value`. */ export declare function redactContext(value: unknown): unknown; export declare function redactValue(value: unknown, depth: number, ancestors: WeakSet): unknown;