/** * Widget utilities. * * Deliberately absent: any reading of ambient page state as a credential. * The widget once pulled `localStorage.API_KEY`, `localStorage.ORG_ID` and * `localStorage.accessToken` into every request, and stamped * `x-request-from: internal`. That let the embedding page choose its own * organization context and pass an external request off as an internal one. * Credentials now come only from explicit SDK configuration, through the * `onRequest` hook — see src/widget/services/toruk-client.ts. */ /** * Read a recorded Blob as a `data:audio/...;base64,...` URI. * * That is the shape Core's transcribe route validates (`@Matches(/^data:audio\//)`), * and FileReader is the only way to get it without hand-rolling base64 over an * ArrayBuffer — which for a multi-megabyte clip risks blowing the argument limit * on `String.fromCharCode.apply`. */ /** * Force a data URI to declare an audio type. * * Core's transcribe DTO validates `/^data:audio\//`, and `FileReader` derives the * prefix from `blob.type` — so a Blob with no type produces * `data:application/octet-stream` and a 400 that says nothing about the real * problem. The recorder now always tags its output, but this is the last line of * defence: the bytes are known to be a recording, so relabelling is safe and a * silent rejection is not. */ export declare const asAudioDataUri: (dataUri: string, fallbackMime?: string) => string; export declare const blobToDataUri: (blob: Blob) => Promise; /** * One readable line describing what a human-input form answered. * * This becomes the user's visible message when a form resumes a run — the * structured `formData` travels separately to the engine. Mirrors Core's * `summarizeFormData`, including masking a secret: only this string is shown and * persisted, so a credential must not appear in it. */ export declare const summarizeHumanInput: (formData: { value?: string | string[]; } | undefined, interactionType?: string) => string; export declare const isNotDefined: (value: T | null | undefined) => value is null | undefined; /** * URL for a file the deployment stored during the conversation. * * Rendered directly into `` / `