import type { AnyTrace } from '@voiceflow/dtos-interact'; import type { RuntimeAction } from '../runtime/index.js'; import type { TraceDeclaration } from '../trace/trace.interface.js'; /** Contact values keyed by property name, e.g. `{ name: 'Jane', email: 'jane@example.com' }` */ export type RuntimeContact = Record; export interface RuntimeClientOptions { traces?: TraceDeclaration[]; baseURL: string; onTrace?: (context: T, trace: AnyTrace) => Promise | void; transcript?: { os?: string; device?: string; browser?: string; }; authorization?: string; /** what the host already knows about the person; the runtime only accepts it with a valid `authorization` */ contact?: RuntimeContact; /** the user's BCP 47 locale, sent with every session start; the runtime seeds `{locale}` with it */ locale?: string; getPageURL?: () => string | undefined; onStateChange?: (context: T, state: Record) => void; inactivityTimeout?: number; onSessionKeyChange?: (sessionKey: string | null) => void; onTranscriptIDChange?: (transcriptID: string | null) => void; /** * if `true` the client opts-in to managing the conversation state * this is used for in-product chat experiences * may be ignored if the client does not support managing state */ stateful?: boolean; /** * if `true` the client will send initial state when starting a session * but will not maintain or sync state during the conversation * this is used for shareable links that need initial state without persistence */ sendInitialState?: boolean; } export interface RuntimeInteractStreamRequest { userID: string; action: RuntimeAction | null; timezone?: string; projectID: string; sessionKey: string | null; environment?: string; audioEvents?: boolean; webchatVersion: string; } export declare enum RuntimeLogStatus { INFO = "info", ERROR = "error", DEBUG = "debug", WARNING = "warning" } export interface RuntimeLog { error?: unknown; status: RuntimeLogStatus; source: string; message: string; version: string; projectID: string; additionalProperties?: Record; } export interface RuntimeRequestFileStorageRequest { userID: string; fileName: string; fileType: string; fileSize?: number; projectID: string; versionID?: string; } export interface RuntimeRequestFileStorageResponse { url: string; fields: Record; provider: string; } export interface RuntimeUploadFileRequest extends RuntimeRequestFileStorageResponse { file: File; } export interface RuntimeUserFileStorageRequest { sessionKey: string; userID: string; fileName: string; fileType: string; projectID: string; } export interface RuntimeUserFileStorageResponse { url: string; fields: Record; key: string; downloadUrl: string; } export interface RuntimeUploadUserFileRequest extends RuntimeUserFileStorageResponse { file: File; } //# sourceMappingURL=runtime.interface.d.ts.map