/** * @license * Copyright 2026 Qwen * SPDX-License-Identifier: Apache-2.0 */ import type { LiveConfig } from '../config.js'; export declare function runtimeFailureSecrets(config?: LiveConfig, extras?: readonly string[]): string[]; /** Observability only: these records never authorize retries or change state. */ export interface RuntimeFailure { source: 'realtime' | 'host' | 'tool' | 'backend' | 'proactive' | 'memory' | 'daemon'; code: string; stage: string; impact: 'operation' | 'response' | 'task' | 'feature' | 'call' | 'daemon'; message: string; epoch?: number; callId?: string; providerSessionId?: string; responseId?: string; toolCallId?: string; toolName?: string; taskId?: string; backend?: string; errorName?: string; kind?: 'configuration' | 'quota' | 'transient' | 'protocol'; providerType?: string; param?: string; status?: number; closeCode?: number; fatal?: boolean; /** A timeout or lost acknowledgement does not prove execution stopped. */ executionUncertain?: boolean; } export type RuntimeFailureSink = (failure: RuntimeFailure) => void; export declare function sanitizeFailureMessage(value: unknown, secrets?: readonly string[]): string; /** Deliberately whitelist fields: no raw arguments, headers, media or stacks. */ export declare function runtimeFailureRecord(failure: RuntimeFailure, secrets?: readonly string[]): Record; /** A diagnostic observer must never interfere with the operation being observed. */ export declare function emitRuntimeFailure(sink: RuntimeFailureSink | undefined, failure: RuntimeFailure): void; /** Synchronous, bounded error-only log: available before calls and during exit. */ export declare class RuntimeFailureLog { private readonly secrets; private readonly maxBytes; readonly filePath: string; private sequence; private readonly directory; constructor(dataDir: string, secrets?: () => readonly string[], maxBytes?: number); write(failure: RuntimeFailure): boolean; }