/** * Non-mutating diagnostic projection for validated tool-call arguments. The * handler must receive the exact raw values, so redaction cannot happen where * arguments are produced; instead every boundary where arguments leave the * ephemeral execution path (planner queue/context/events, streaming and * observer payloads, action summaries, result/failure metadata, persisted * trajectories) projects them through this module before serialization. * * The projection composes runtime-known-secret redaction with the shared * tool-shape patterns from redact.ts (CLI --token forms, URI userinfo, token * prefixes), fully masks values under credential-named keys, preserves * non-string primitives so numeric/boolean diagnostics stay exact, and bounds * depth/cycles so a pathological argument graph cannot hang a diagnostic * writer. Unchanged subtrees are returned by reference (structural sharing); * callers must treat projected values as immutable. */ /** Replacement emitted for masked keys, cycles, and over-deep subtrees. */ export declare const TOOL_DIAGNOSTIC_MASK = "[REDACTED]"; /** Scrubs one string for diagnostic output. */ export type ToolDiagnosticTextRedactor = (text: string) => string; /** * Composes runtime-known-secret redaction with shared tool-shape redaction — * the established order from the action-output work: literal character * secrets first, then pattern detection over whatever remains. Lightweight * and test runtimes may stub `redactSecrets` as identity, so the pattern pass * always runs. */ export declare function composeToolDiagnosticRedactor(runtime?: { redactSecrets?(text: string): string; }): ToolDiagnosticTextRedactor; /** * Projects one value for diagnostic egress. The input is never mutated; the * result is safe to embed in diagnostic events, stream payloads, summaries, * and persisted trajectories. Strings are scrubbed with * `redactText`, values under credential-named keys are fully masked, * non-string primitives are preserved exactly, and cycles or nesting beyond * the depth bound collapse to {@link TOOL_DIAGNOSTIC_MASK}. */ export declare function projectToolDiagnosticValue(value: unknown, redactText: ToolDiagnosticTextRedactor): unknown; /** * Redacts one complete model-bound value without diagnostic depth masking. * Credential-shaped values are intentionally masked; every other reachable * field is preserved, and cyclic data is rejected with a typed error. */ export declare function projectCompleteToolValueForModel(value: unknown, redactText: ToolDiagnosticTextRedactor): unknown; /** Complete model-bound counterpart of {@link projectToolDiagnosticArgs}. */ export declare function projectCompleteToolArgsForModel(args: Record | undefined, redactText: ToolDiagnosticTextRedactor): Record | undefined; /** * Projects a complete model-call record without corrupting its executable JSON * Schemas. Model messages, responses, provider payloads, and tool-call values * use the normal credential-key pass. Schema property/definition names remain * exact identifiers, while descriptions, defaults, examples, and other schema * values are still scrubbed. Both neutral and OpenAI-style tool definitions * are supported. */ export declare function projectModelCallDiagnosticValue(value: Record, redactText: ToolDiagnosticTextRedactor): Record; /** * Projects a protected trajectory call without treating runtime-only * diagnostics as model input. The request/response fields are complete and * cycle-rejecting; unrelated metadata keeps the bounded diagnostic policy so * an AbortSignal, callback, or adapter cycle cannot erase a valid model call. */ export declare function projectProtectedModelCallValue(value: Record, redactText: ToolDiagnosticTextRedactor): Record; /** * Projects a tool-call argument record for diagnostic egress. Returns the * same reference when nothing needed redaction so unchanged calls stay * identity-comparable across surfaces. */ export declare function projectToolDiagnosticArgs(args: Record | undefined, redactText: ToolDiagnosticTextRedactor): Record | undefined;