/** * The signed-in user's TORUK access token, handed to the widget by the host page. * * A host whose visitors are already signed in to TORUK (directly, or through an * app that logs them in with TORUK) passes the user's access token here and the * widget sends it as `Authorization: Bearer` on every runtime request — config, * predictions, sessions, artifacts. CORE then identifies and authorizes that * user, and everything the conversation creates belongs to them. * * A function is called on every request, so a host that rotates tokens returns * the current one and nothing goes stale mid-conversation. Returning an empty * value sends the request without the header. */ export type WidgetAccessToken = string | (() => string | null | undefined | Promise); export type WidgetRequestHook = (request: RequestInit) => Promise; /** * Compose the host's `onRequest` hook with the bearer header. The header is set * first, so a host hook still sees and may override it; whatever `headers` shape * the request carried is normalized to a `Headers` instance the transports accept. */ export declare const withAccessToken: (accessToken: WidgetAccessToken | undefined, onRequest?: WidgetRequestHook) => WidgetRequestHook | undefined;