/** * Role for {@link ScriptLogger.transcript} lines that land in the CMS call transcript. * * Wire values stay `'user'` / `'agent'` for dialog-consumer mapping * (`human_phrase` / `agent_phrase`). */ export declare enum TranscriptionRole { User = "user", Agent = "agent" } /** * Structured logger available to scripts. * * In Voctiv platform compatibility mode, log entries are also batch-written * to the `dialog_stats` DB table (equivalent of old LE `nn.log`). * In all modes they go to the API process logger. Debug streaming, when enabled, * forwards only logs from the current script session to the configured debug endpoint. */ export interface ScriptLogger { /** Info-level log entry. */ log(message: string, data?: Record): void; /** Warning-level log entry. */ warn(message: string, data?: Record): void; /** Error-level log entry. */ error(message: string, data?: Record): void; /** Debug-level log entry; intended for process/debug stream output rather than legacy DB stats. */ debug(message: string, data?: Record): void; /** * Write a phrase into the CMS call transcript. * * In Voctiv legacy mode: * - {@link TranscriptionRole.User} → `nv.listen` / `stop` in `dialog_stats` (Mongo `human_phrase`) * - {@link TranscriptionRole.Agent} → `nv.synthesize` (Mongo `agent_phrase`) * * Also logs as `USER: …` / `AGENT: …`. Empty / whitespace-only text is ignored. * * Does **not** mutate the script's `call_transcript` output entity — scripts * that keep their own transcript buffer should still update it explicitly. * * @example * ```ts * import { TranscriptionRole } from '@lib/scripting-sdk'; * logger.transcript(TranscriptionRole.User, userText); * logger.transcript(TranscriptionRole.Agent, '¿Hola?'); * ``` */ transcript(role: TranscriptionRole, message: string): void; /** * Enable real-time log streaming to a remote debug endpoint. * Opens a Socket.IO connection from this API pod to the debug server. * Only logs from THIS script instance will be sent. * * @param endpoint - Debug URL from script-manager, e.g. "http://script-manager:3007#TOKEN" */ enableDebug(endpoint: string): void; /** Stop streaming logs and disconnect from the debug endpoint. */ disableDebug(): void; /** * Virtual breakpoint — pauses script execution and sends a snapshot * of the provided variables to the debug UI. Execution resumes when * the developer clicks "Continue" in the UI. * * If no debug session is active, resolves immediately (no-op). * * @param label - Human-readable label, e.g. "after ASR result" * @param snapshot - Object with variables to inspect, e.g. { text, intent, score } */ breakpoint(label: string, snapshot?: Record): Promise; } //# sourceMappingURL=logger.d.ts.map