import type { Api, AssistantMessage, Message, Model } from "../types.js"; /** * Normalize tool call ID for cross-provider compatibility. * OpenAI Responses API generates IDs that are 450+ chars with special characters like `|`. * Anthropic APIs require IDs matching ^[a-zA-Z0-9_-]+$ (max 64 chars). * * For aborted/errored turns, this function: * - Preserves tool call structure (unlike converting to text summaries) * - Injects synthetic "aborted" tool results */ /** * Credential-shaped token patterns scrubbed from outbound provider traffic when * credential redaction is enabled. Exported so hosts can route the same shapes * through reversible obfuscation (keyed placeholders restored before local tool * execution) instead of the irreversible `[*_token_redacted]` rewrite below — * an irreversible placeholder echoed back in edit-tool `old_string` can never * match the real bytes on disk. */ export declare const SENSITIVE_TOKEN_RE: RegExp; /** * Toggle outbound credential-pattern redaction. When disabled (the default), * {@link redactSensitiveCredentials} and {@link redactSensitiveInObject} are * pass-throughs and outbound messages/system prompts leave the process * unmodified. */ export declare function configureCredentialRedaction(enabled: boolean): void; export declare function redactSensitiveCredentials(text: string): string; export declare function redactSensitiveInObject(val: unknown): { result: unknown; changed: boolean; }; export declare function transformMessages(messages: Message[], model: Model, normalizeToolCallId?: (id: string, model: Model, source: AssistantMessage) => string, maxNormalizedToolCallIdLength?: number, duplicateToolCallIdSuffixPrefix?: string, targetCompat?: Model["compat"]): Message[];