import type { CloseDiagnosticEvent } from '../types/close-diagnostics.js'; /** Minimal internal diagnostics sink used by query runtimes. */ export interface DiagnosticsSink { record(message: string, error?: unknown): void; recordClose?(event: Omit): void; } export type SdkDiagnosticsOptions = { onCloseDiagnostic?: (event: CloseDiagnosticEvent) => void; debug?: boolean; debugFile?: string; stderr?: (data: string) => void; }; export declare function isSdkDiagnosticsEnabled(options: SdkDiagnosticsOptions): boolean; export declare function resolveSdkDiagnosticsFilePath(options: SdkDiagnosticsOptions): string | undefined; export declare class SdkDiagnostics implements DiagnosticsSink { private readonly correlationId; private readonly onCloseDiagnostic?; private readonly enabled; private readonly debugFile?; private readonly stderr?; constructor(options?: SdkDiagnosticsOptions); record(message: string, error?: unknown): void; /** 独立于 debug/stderr 的安全通道,适用于禁用原始诊断的 BYOK 宿主。 */ recordClose(event: Omit): void; get filePath(): string | undefined; private writeToFile; private writeToStderr; private formatLine; private formatError; }