/**
 * An agent's profile, as the Agents API returns it.
 *
 * The SDK fetches it once while {@link createAgentManager} runs and exposes it as
 * {@link AgentManager.agent}, so everything here is available before
 * {@link AgentManager.connect | connect()} — which is what makes it useful for rendering the agent
 * before the video exists. The fields are the agent's configuration, whether it was set in D-ID Studio
 * or through the Agents API; most of them are for the application to use, and each one below says
 * where the SDK itself reads it.
 *
 * @see [Get an agent](https://docs.d-id.com/reference/agent-get)
 * @category Agent Manager
 */
export declare interface Agent {
    /** Id of the agent: the same value passed to {@link createAgentManager}. */
    id: string;
    /** Id of the D-ID account that owns the agent. Set by the Agents API. */
    owner_id?: string;
    /** The agent's display name. */
    name?: string;
    /** `'public'` when the agent is configured for public access; omitted otherwise. */
    access?: 'public';
    /** URL of the agent's still image. Use it as the poster of your video element before
     * {@link AgentManager.connect | connect()} has a stream to show. */
    thumbnail?: string;
    /**
     * The greeting lines configured for the agent.
     *
     * The SDK never speaks them by itself: pass one to {@link AgentManager.speak | speak()} once
     * the agent is connected if you want the agent to open the conversation. Check what your own
     * agent does first — an Expressive (V4) session's server side may greet on its own, in which
     * case speaking a greeting as well says it twice.
     */
    greetings?: string[];
    /**
     * Suggested opening questions to offer the user.
     *
     * The SDK surfaces the same array as {@link AgentManager.starterMessages | starterMessages}.
     */
    starter_message?: string[];
    /**
     * URL of the agent's looping idle video.
     *
     * Show it while the agent is not speaking: put it on your video element's `src` when
     * {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange} reports `STOP`.
     */
    idle_video?: string;
    /**
     * The knowledge base attached to the agent, when it has one.
     *
     * Its presence is what tells you the agent can cite sources; the citations themselves arrive on
     * each answer as {@link Message.matches | matches}.
     */
    knowledge?: {
        /**
         * Id of the knowledge base.
         *
         * The SDK sends it with every rating made by {@link AgentManager.rate | rate()}, and it is
         * the {@link RetrievalMetadata.knowledge_id | knowledge_id} of the citations on an answer.
         */
        id: string;
        /** The embedding model the knowledge base was indexed with. The SDK does not act on it. */
        embedder?: {
            /** Whether that embedding model covers only a limited set of languages, so knowledge
             * written in another language may not be retrieved well. */
            is_limited_language?: boolean;
        };
    };
    /**
     * The avatar the agent is built on.
     *
     * Its `type` is the single most important field on an agent: it decides which transport the
     * session uses and therefore which SDK features work. See {@link AgentAvatar}.
     */
    avatar: AgentAvatar;
    /**
     * Whether vision is enabled for the agent.
     *
     * Exposed so an application can decide whether to offer the camera; the SDK does not read it,
     * and publishing a camera stream is an Expressive (V4) feature — see
     * {@link AgentManager.publishCameraStream | publishCameraStream()}.
     */
    vision?: {
        /** `true` when the agent is configured to use the user's camera. */
        enabled: boolean;
    };
    /**
     * The end-of-call feedback form configured for the agent.
     *
     * The SDK does not read it: render your own form from it and submit the result with
     * {@link AgentManager.submitFeedback | submitFeedback()}. See
     * {@link EndOfCallFeedbackConfig}.
     */
    end_of_call_feedback?: EndOfCallFeedbackConfig;
    /** Whether the agent has triggers configured. The SDK does not act on them. */
    triggers_available?: boolean;
    /** Settings that change how D-ID's own surfaces present the agent. */
    advanced_settings?: {
        /**
         * Whether the SDK logs its streaming lifecycle to the browser console.
         *
         * When it is enabled the SDK turns debug logging on for every visitor, whatever
         * {@link AgentManagerOptions.debug | debug} was passed to {@link createAgentManager}.
         */
        ui_debug_mode?: boolean;
        /**
         * Account the agent's rendering VM is billed to. D-ID internal; kept in the declarations
         * for D-ID's own applications, hidden from the reference.
         *
         * @hidden
         */
        vm_account_id?: string;
        /** Whether the embedding UI should show closed captions. The SDK does not act on it. */
        closed_captions_enabled?: boolean;
    };
    /**
     * Feature-flag targeting context for the account this agent belongs to.
     *
     * Used by D-ID's own applications; not part of the SDK contract and may change without notice.
     */
    ld_context?: {
        /** Key identifying the context. */
        key: string;
        /** Hashed form of the key. */
        hash_key: string;
        /** The plan group the account falls into. */
        plan_group: string;
    };
}

/**
 * What the agent is doing right now, for driving the application's UI.
 *
 * The argument of
 * {@link AgentManagerCallbacks.onAgentActivityStateChange | onAgentActivityStateChange}. Expressive
 * (V4) agents move through all four states; Talks (V2) and Clips (V3) agents only alternate between
 * {@link AgentActivityState.Talking | TALKING} and {@link AgentActivityState.Idle | IDLE}, and only
 * on fluent streams.
 *
 * @category Callbacks & Events
 */
export declare enum AgentActivityState {
    /** The agent is doing nothing and is waiting for the user — the conversational turn has ended. */
    Idle = "IDLE",
    /**
     * The agent is working on an answer that has not started streaming yet.
     *
     * Expressive (V4) only: set when a turn starts and when the user's speech has just been
     * transcribed. Use it for a typing or thinking indicator.
     */
    Loading = "LOADING",
    /** The agent's video has started; the agent is speaking. */
    Talking = "TALKING",
    /**
     * The agent is running one or more tool calls.
     *
     * Expressive (V4) only: set when a tool call starts, and returned to after the agent finishes
     * speaking while any call is still outstanding (for example a client tool waiting on the user).
     * The individual calls are reported by
     * {@link AgentManagerCallbacks.onRunningToolCallsChange | onRunningToolCallsChange}.
     */
    ToolActive = "TOOL_ACTIVE"
}

/**
 * The avatar an agent speaks through: its rendering tier and the language of its voice.
 *
 * The value of {@link Agent.avatar}. Its `type` is the single most important field on an agent: it
 * decides which transport the session uses and therefore which SDK features work.
 *
 * @category Agent Manager
 */
export declare interface AgentAvatar {
    /**
     * The kind of avatar: {@link AvatarType.Talk | talk} for Talks (V2), {@link AvatarType.Clip | clip}
     * for Clips (V3), {@link AvatarType.Expressive | expressive} for Expressive (V4).
     *
     * Talks (V2) and Clips (V3) agents stream over WebRTC and receive their events on the
     * notifications web socket; Expressive (V4) agents connect to a real-time session instead, which
     * is what makes the microphone, camera, client tool and data-channel methods of
     * {@link AgentManager} available.
     *
     * Either an {@link AvatarType} member or its string value — `AvatarType.Talk` and `'talk'` are
     * both accepted, so an {@link Agent} restored from your own storage does not have to import the
     * enum.
     */
    type: `${AvatarType}`;
    /** The voice the agent speaks with. */
    voice?: {
        /**
         * Language of the configured voice. The SDK reports it in analytics; it does not change how
         * the session behaves.
         */
        language?: string;
    };
    /**
     * The avatar's background. The Agents API sets it only when the agent has no background.
     *
     * @hidden
     */
    background?: {
        /**
         * The agent is set to have no background. The avatar is still rendered on a green screen, which
         * D-ID's agents widget removes in the browser to show it without a frame; the SDK does not read it.
         */
        transparent: boolean;
    };
}

/**
 * A live connection to one agent: its profile, its chat, and the video stream it answers on.
 *
 * Created by {@link createAgentManager}. Nothing happens on the wire until
 * {@link AgentManager.connect | connect()} resolves; after that
 * {@link AgentManager.chat | chat()} makes the agent answer with its own LLM and
 * {@link AgentManager.speak | speak()} makes it say exactly what you give it. Call
 * {@link AgentManager.disconnect | disconnect()} when the user leaves.
 *
 * Two properties, {@link AgentManager.agent | agent} and
 * {@link AgentManager.starterMessages | starterMessages}, are readable as soon as the manager
 * exists; everything else is a method. Some methods work only with some avatar types: each one
 * says so, and {@link AgentAvatar} is where the session's tier is read from.
 *
 * The manager's own state is readable at any time:
 * {@link AgentManager.getChatMode | getChatMode()},
 * {@link AgentManager.getConnectionState | getConnectionState()} and
 * {@link AgentManager.getSessionInfo | getSessionInfo()} answer with what the matching callback
 * last reported, so nothing has to be mirrored in application state.
 *
 * Every method that reaches the Agents API can reject with an {@link HttpError} when the request
 * comes back non-2xx, or a {@link NetworkError} when it never reaches the server; the individual
 * `@throws` entries below name the errors that are specific to each method.
 *
 * @category Agent Manager
 */
export declare interface AgentManager {
    /**
     * The agent this manager is connected to, as the Agents API returned it.
     *
     * Fetched once while the manager is created, so it is available before
     * {@link AgentManager.connect | connect()}. Useful for rendering the agent's name, thumbnail
     * and {@link Agent.idle_video | idle_video}. See {@link Agent}.
     *
     * Read-only: the property cannot be reassigned, and the SDK never replaces it — the manager
     * talks to the agent it was created for, for its whole life.
     * @example
     * ```ts
     * nameElement.textContent = agentManager.agent.name ?? 'Agent';
     * thumbnailElement.src = agentManager.agent.thumbnail ?? '';
     * ```
     */
    readonly agent: Agent;
    /**
     * Returns the kind of stream the current session negotiated.
     *
     * @returns {@link StreamType.Fluent} for a fluent stream (one video for the idle and talking
         * states), {@link StreamType.Legacy} for the two-element legacy mode, or `undefined` before
         * {@link AgentManager.connect | connect()} has established a session, except for an Expressive (V4)
         * agent, whose stream is always fluent.
         * @example
         * ```ts
         * import { StreamType } from '@d-id/client-sdk';
         *
         * // A legacy stream is the one the application swaps the idle video in and out of.
         * const swapsIdleVideo = agentManager.getStreamType() === StreamType.Legacy;
         * ```
         */
     getStreamType(): StreamType | undefined;
     /**
      * Returns whether the current stream supports interrupting the agent mid-answer.
      *
      * `true` once connected on a fluent stream (every Expressive (V4) session, or a fluent Clips
      * (V3) one) whose agent has not turned interrupting off in its advanced settings. It reads the
      * session {@link AgentManager.connect | connect()} attached, so ask it after `connect()`
      * resolves. This says the stream supports interrupting at all;
      * {@link AgentManagerCallbacks.onInterruptibleChange | onInterruptibleChange} says whether
      * interrupting is allowed right now.
      *
      * @returns `true` when {@link AgentManager.interrupt | interrupt()} can do anything.
      * @example
      * ```ts
      * await agentManager.connect();
      * setStopButtonVisible(agentManager.isInterruptAvailable());
      * ```
      */
     isInterruptAvailable(): boolean;
     /**
      * The agent's starter messages.
      *
      * Suggested openers to offer the user as buttons; empty when the agent defines none. Available
      * before {@link AgentManager.connect | connect()}.
      *
      * Read-only, and a copy of {@link Agent.starter_message} rather than the same array, so
      * sorting or filtering a local copy of it cannot change what
      * {@link AgentManager.agent | agent} reports.
      * @example
      * ```ts
      * for (const message of agentManager.starterMessages) {
      *     addSuggestionButton(message, () => void agentManager.chat(message));
      * }
      * ```
      */
     readonly starterMessages: readonly string[];
     /**
      * Fetches a short-lived Azure Speech token, for running your own speech recognition.
      *
      * Works with every {@link Auth} type, connected or not. The agent must be public or belong to
      * the account the credentials are for.
      *
      * @returns The {@link SttTokenResponse}: the token and its Azure region.
      * @throws {@link HttpError} `400` when the agent is neither public nor the caller's, `404` when
          * it does not exist, or any other non-2xx answer.
          * @throws {@link NetworkError} When the request never reaches the server.
              * @example
              * ```ts
              * const { token, region } = await agentManager.getSttToken();
              * startRecognition(token, region);
              * ```
              */
          getSttToken(): Promise<SttTokenResponse>;
          /**
           * Returns the chat mode in effect right now.
           *
           * The same value {@link AgentManagerCallbacks.onModeChange | onModeChange} last reported, and
           * the one every mode guard in the SDK reads. It is not always the mode that was asked for: the
           * server can answer {@link AgentManager.connect | connect()} with a different mode, which the
           * manager adopts, and a failed connection leaves the session in
           * {@link ChatMode.Maintenance | Maintenance}. Use it instead of mirroring `onModeChange` in
           * your own state.
           *
           * @returns The current {@link ChatMode}; before {@link AgentManager.connect | connect()}, the
           * mode the manager was created with ({@link ChatMode.Functional} by default).
           * @example
           * ```ts
           * import { ChatMode } from '@d-id/client-sdk';
           *
           * if (agentManager.getChatMode() === ChatMode.Maintenance) {
           *     showBanner('The agent is temporarily unavailable.');
           * }
           * ```
           */
          getChatMode(): ChatMode;
          /**
           * Returns the connection state the manager last reported.
           *
           * The same value
           * {@link AgentManagerCallbacks.onConnectionStateChange | onConnectionStateChange} was last
           * called with, so a component that mounts after the session is up can read the state instead of
           * waiting for the next change.
           *
           * @returns The current {@link ConnectionState}; {@link ConnectionState.New | 'new'} before the
           * first {@link AgentManager.connect | connect()}.
           * @example
           * ```ts
           * const canChat = agentManager.getConnectionState() === 'connected';
           * ```
           */
          getConnectionState(): ConnectionState;
          /**
           * Returns the ids of the session that is open, for support and for your own logs.
           *
           * The same {@link StreamCreatedInfo} that
           * {@link AgentManagerCallbacks.onStreamCreated | onStreamCreated} delivered for this session.
           *
           * @returns The open session's `streamId`, `sessionId` and `agentId`, or `undefined` before
           * {@link AgentManager.connect | connect()} and after
           * {@link AgentManager.disconnect | disconnect()}.
           * @example
           * ```ts
           * const session = agentManager.getSessionInfo();
           * console.log('session', session?.sessionId, 'stream', session?.streamId);
           * ```
           */
          getSessionInfo(): StreamCreatedInfo | undefined;
          /**
           * Opens a new session with the agent: a new WebRTC connection, a new web socket and a new chat.
           *
           * Resolves once the connection reaches {@link ConnectionState.Connected | 'connected'}, by
           * which point {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} has been called
           * with the media stream to render.
           *
           * One session at a time: while a call is still in flight a second call returns that same
           * promise rather than opening a second session, and cancels a
           * {@link AgentManager.disconnect | disconnect()} made in between, which is what makes it safe
           * in a React StrictMode effect. While a session is open it rejects instead: call
           * `disconnect()` first to start a fresh conversation, or
           * {@link AgentManager.reconnect | reconnect()} to keep the current one. After the server ended
           * the session (`'disconnected'` with a {@link StreamEndReason}), `connect()` opens a new one. A
           * call that joins an
           * operation a {@link AgentManager.disconnect | disconnect()} later cancels resolves without a
           * session open; read {@link AgentManager.getConnectionState | getConnectionState()} for what
           * happened.
           *
           * @returns Resolves when the agent is connected and ready.
           * @throws {@link ValidationError} When a session is already open, or when
               * {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} was not supplied and the
               * current {@link ChatMode} streams video — which a
               * {@link AgentManager.changeMode | changeMode()} out of a text-only mode can bring about.
               * @throws {@link HttpError} When creating the stream or the chat comes back non-2xx — a client
                   * key that is not authorized for the agent or the calling domain, an account out of credits, or
                   * an agent that is not built yet. The SDK tries the initialization up to three times first,
                   * except on `429`, on `409` and on an out-of-credits response.
                   * @throws {@link NetworkError} When those requests never reach the server.
                       * @example
                       * ```ts
                       * await agentManager.connect();
                       * ```
                       */
                   connect(): Promise<void>;
                   /**
                    * Reopens the stream when the session expires, and continues the conversation on the same chat.
                    *
                    * The chat id normally does not change, so the agent keeps its context. It starts a new stream
                    * — including after the server ended the previous one deliberately — rather than resuming the
                    * old one. On Expressive (V4) agents the transport is asked to reconnect first; if that fails
                    * the SDK falls back to a disconnect and a fresh connect, which starts a new chat id.
                    *
                    * One session-opening operation runs at a time, teardown included, so this and
                    * {@link AgentManager.connect | connect()} cannot interleave — call one or the other rather
                    * than racing them. A `connect()` that joins this one continues the existing chat, so
                    * {@link AgentManagerCallbacks.onNewChat | onNewChat} does not fire for it.
                    *
                    * @returns Resolves when the new stream is connected.
                    * @throws {@link ValidationError} When a {@link AgentManager.connect | connect()} is still in
                        * flight; wait for it to settle first.
                        * @throws {@link HttpError} When creating the new stream comes back non-2xx.
                            * @throws {@link NetworkError} When that request never reaches the server.
                                * @example
                                * ```ts
                                * try {
                                *     // The session expired. Start a new stream and keep the conversation.
                                *     await agentManager.reconnect();
                                * } catch {
                                *     // A connect() or another reconnect() is still in flight; let it settle first.
                                * }
                                * ```
                                */
                            reconnect(): Promise<void>;
                            /**
                             * Closes the existing connection and chat with the agent: the stream and the web socket.
                             *
                             * Call it when the user leaves the page or the conversation, so the session does not keep
                             * running. After it resolves, {@link AgentManager.connect | connect()} is needed before the
                             * agent can be used again.
                             *
                             * @returns Resolves once everything is closed.
                             * @example
                             * ```ts
                             * // The user left the conversation: close the session so it stops running.
                             * await agentManager.disconnect();
                             *
                             * // The manager stays usable — connect() opens a new session with a new chat.
                             * await agentManager.connect();
                             * ```
                             */
                            disconnect(): Promise<void>;
                            /**
                             * Publishes a microphone audio track to the session so the agent can hear the user.
                             *
                             * Call it after {@link AgentManager.connect | connect()} to enable voice input. Expressive (V4)
                             * agents only; on Talks (V2) and Clips (V3) agents, and before `connect()`, the returned
                             * promise rejects with a {@link ValidationError}.
                             *
                             * @param stream - A `MediaStream` whose audio track is published to the session.
                             * @returns Resolves once the track is published.
                             * @throws {@link ValidationError} When the session is not an Expressive (V4) one, or
                                 * {@link AgentManager.connect | connect()} has not run yet.
                                 * @example
                                 * ```ts
                                 * const micStream = await navigator.mediaDevices.getUserMedia({ audio: true });
                                 * await agentManager.publishMicrophoneStream(micStream);
                                 * ```
                                 */
                             publishMicrophoneStream(stream: MediaStream): Promise<void>;
                             /**
                              * Removes the published microphone track from the session.
                              *
                              * The counterpart of {@link AgentManager.publishMicrophoneStream | publishMicrophoneStream()}.
                              * The `MediaStreamTrack` is not stopped, because the stream is the caller's: stop it to release
                              * the microphone. Expressive (V4) agents only; on Talks (V2) and Clips (V3) agents, and when
                              * nothing is published, it resolves without doing anything.
                              *
                              * @returns Resolves once the track is removed.
                              * @example
                              * ```ts
                              * await agentManager.unpublishMicrophoneStream();
                              * ```
                              */
                             unpublishMicrophoneStream(): Promise<void>;
                             /**
                              * Swaps the live microphone track without unpublishing it.
                              *
                              * Use it when the user picks a different input device: the publication is preserved — its
                              * LiveKit publication id (SID) and SSRC stay the same, though the `MediaStreamTrack` id
                              * changes — so the server sees continuous audio across the swap rather than a stop and a
                              * restart. The previous track is not stopped; stop it once the swap resolves. Rejects with a
                              * plain `Error` from the transport when there is no active publication: fall back to
                              * {@link AgentManager.publishMicrophoneStream | publishMicrophoneStream()} in that case.
                              * Expressive (V4) agents only; on Talks (V2) and Clips (V3) agents, and before
                              * {@link AgentManager.connect | connect()}, the returned promise rejects with a
                              * {@link ValidationError}.
                              *
                              * @param track - The audio track to send from now on.
                              * @returns Resolves once the transport has switched to the new track.
                              * @throws {@link ValidationError} When the session is not an Expressive (V4) one, or
                                  * {@link AgentManager.connect | connect()} has not run yet.
                                  * @example
                                  * ```ts
                                  * const stream = await navigator.mediaDevices.getUserMedia({ audio: { deviceId } });
                                  * const [track] = stream.getAudioTracks();
                                  *
                                  * try {
                                  *     await agentManager.replaceMicrophoneTrack(track);
                                  * } catch {
                                  *     // Nothing published yet, so there is no track to swap: publish instead.
                                  *     await agentManager.publishMicrophoneStream(stream);
                                  * }
                                  * ```
                                  */
                              replaceMicrophoneTrack(track: MediaStreamTrack): Promise<void>;
                              /**
                               * Publishes a camera video track to the session so the agent can see the user.
                               *
                               * Call it after {@link AgentManager.connect | connect()} to enable vision. Expressive (V4)
                               * agents only; on Talks (V2) and Clips (V3) agents, and before `connect()`, the returned
                               * promise rejects with a {@link ValidationError}.
                               *
                               * @param stream - A `MediaStream` whose video track is published to the session.
                               * @returns Resolves once the track is published.
                               * @throws {@link ValidationError} When the session is not an Expressive (V4) one, or
                                   * {@link AgentManager.connect | connect()} has not run yet.
                                   * @example
                                   * ```ts
                                   * if (agentManager.agent.vision?.enabled) {
                                   *     const cameraStream = await navigator.mediaDevices.getUserMedia({ video: true });
                                   *     await agentManager.publishCameraStream(cameraStream);
                                   * }
                                   * ```
                                   */
                               publishCameraStream(stream: MediaStream): Promise<void>;
                               /**
                                * Removes the published camera track from the session.
                                *
                                * Call it to disable vision. The `MediaStreamTrack` is not stopped, because the stream is the
                                * caller's: stop it to release the camera. Expressive (V4) agents only; on Talks (V2) and Clips (V3) agents,
                                * and when nothing is published, it resolves without doing anything.
                                *
                                * @returns Resolves once the track is removed.
                                * @example
                                * ```ts
                                * // No guard needed: a no-op wherever there is nothing published.
                                * await agentManager.unpublishCameraStream();
                                * ```
                                */
                               unpublishCameraStream(): Promise<void>;
                               /**
                                * Sends a message to the agent and gets a streamed video based on its answer (LLM).
                                *
                                * The answer arrives through {@link AgentManagerCallbacks.onNewMessage | onNewMessage} — first
                                * as `partial` chunks, then as the full `answer` — while the video plays it. The chat is
                                * created on the first call if the session does not have one yet.
                                *
                                * @param userMessage - The user's message text to send to the agent.
                                * @returns The {@link ChatResponse} for this turn.
                                * @throws {@link ValidationError} When the message is empty or too long, when the chat mode has
                                    * chat disabled or is in maintenance, or when the manager is not connected yet.
                                    * @throws {@link ChatCreationFailed} On Talks (V2) and Clips (V3) agents, when the session has
                                        * no chat yet and the Agents API answers the creation request without one.
                                        * @throws {@link HttpError} On Talks (V2) and Clips (V3) agents, and in
                                            * {@link ChatMode.Playground}, when the message request comes back non-2xx. Expressive (V4)
                                            * agents send the message over the data channel instead, so no HTTP request is made.
                                            * @throws {@link NetworkError} On Talks (V2) and Clips (V3) agents, and in
                                                * {@link ChatMode.Playground}, when that request never reaches the server.
                                                * @example
                                                * ```ts
                                                * const chat = await agentManager.chat('What is the distance to the moon?');
                                                * ```
                                                */
                                            chat(userMessage: string): Promise<ChatResponse>;
                                            /**
                                             * Rates one of the agent's answers in the chat, for future analytics and insights.
                                             *
                                             * Pass `rateId` to change a rating the user already gave instead of adding another.
                                             *
                                             * Works on every avatar type. On an Expressive (V4) session an answer that arrived over the
                                             * data channel without a server id is given a locally generated one, which D-ID's records
                                             * cannot be matched against — rate the answers whose ids came from the server.
                                             *
                                             * @param messageId - Id of the message being rated.
                                             * @param score - 1 for a positive rating, -1 for a negative one.
                                             * @param rateId - Id of an existing rating to update; omit to create a new one.
                                             * @returns The created or updated {@link Rating}.
                                             * @throws {@link ValidationError} When no chat has started, or when no message with that id is
                                                 * in the transcript.
                                                 * @throws {@link HttpError} When the rating request comes back non-2xx.
                                                     * @throws {@link NetworkError} When the rating request never reaches the server.
                                                         * @example
                                                         * ```ts
                                                         * const rating = await agentManager.rate(messageId, 1);
                                                         *
                                                         * // The user changed their mind: pass the rating's id back rather than adding another.
                                                         * await agentManager.rate(messageId, -1, rating.id);
                                                         * ```
                                                         */
                                                     rate(messageId: string, score: 1 | -1, rateId?: string): Promise<Rating>;
                                                     /**
                                                      * Removes a rating the user gave to an answer in the chat.
                                                      *
                                                      * @param id - Id of the rating to remove, as returned by
                                                      * {@link AgentManager.rate | rate()}.
                                                      * @returns The {@link Rating} that was deleted.
                                                      * @throws {@link ValidationError} When no chat has started.
                                                          * @throws {@link HttpError} When the delete request comes back non-2xx.
                                                              * @throws {@link NetworkError} When the delete request never reaches the server.
                                                                  * @example
                                                                  * ```ts
                                                                  * const rating = await agentManager.rate(messageId, 1);
                                                                  * await agentManager.deleteRate(rating.id);
                                                                  * ```
                                                                  */
                                                              deleteRate(id: string): Promise<Rating>;
                                                              /**
                                                               * Submits end-of-call feedback for the whole conversation.
                                                               *
                                                               * Separate from {@link AgentManager.rate | rate()}, which scores a single answer. Collect it
                                                               * when the user ends the call, using the agent's end-of-call feedback configuration.
                                                               *
                                                               * Every avatar type. The agent must have end-of-call feedback switched on
                                                               * ({@link Agent.end_of_call_feedback}, {@link EndOfCallFeedbackConfig.enabled | enabled}) —
                                                               * the Agents API rejects the request otherwise, so read the configuration before offering the
                                                               * form. A second submission for the same conversation replaces the first.
                                                               *
                                                               * @param rating - The user's score for the conversation: 1, 2, 3, 4 or 5. The Agents API
                                                               * rejects anything else, whole numbers outside the range and fractions alike.
                                                               * @param answer - The user's free-text answer to the follow-up question, when one was asked.
                                                               * @returns The stored {@link SubmitFeedbackResponse}.
                                                               * @throws {@link ValidationError} When no chat has started.
                                                                   * @throws {@link HttpError} When the feedback request comes back non-2xx — including a `400`
                                                                       * when the agent does not have end-of-call feedback enabled.
                                                                       * @throws {@link NetworkError} When the feedback request never reaches the server.
                                                                           * @example
                                                                           * ```ts
                                                                           * // The Agents API rejects the request unless the agent has end-of-call feedback on.
                                                                           * if (agentManager.agent.end_of_call_feedback?.enabled) {
                                                                           *     await agentManager.submitFeedback(5, 'The answers were clear and quick.');
                                                                           * }
                                                                           * ```
                                                                           */
                                                                       submitFeedback(rating: 1 | 2 | 3 | 4 | 5, answer?: string): Promise<SubmitFeedbackResponse>;
                                                                       /**
                                                                        * Makes the agent stream back a video based on the text or audio file you provide.
                                                                        *
                                                                        * Unlike {@link AgentManager.chat | chat()} the agent's LLM is not involved, so this is how you
                                                                        * script greetings and canned lines. Pass a plain string as a shorthand for a text script. See
                                                                        * {@link SpeakScript}, {@link TextStreamScript} and {@link AudioStreamScript}. Text
                                                                        * scripts also accept an optional `sentiment`, for Expressive (V4) agents only; if the
                                                                        * requested sentiment is not supported by the agent, the default sentiment is used.
                                                                        *
                                                                        * @see [Create a video stream](https://docs.d-id.com/reference/createvideoagentstream) — the request
                                                                        * sent for Talks (V2) and Clips (V3) agents.
                                                                        * @see [Control the Agent](https://docs.d-id.com/docs/livekit-commands) — the `did.speak` command
                                                                        * sent over the data channel for Expressive (V4) agents.
                                                                        * @param payload - A text or audio script, or a string treated as the text to speak.
                                                                        * @returns The {@link SpeakResponse} for the video that was produced, or the same
                                                                        * response with `duration` `0` and an empty `videoId` when the call produced no discrete video
                                                                        * — on Expressive (V4) agents, and in a text-only chat mode.
                                                                        * @throws {@link ValidationError} When the manager is not connected to a stream yet.
                                                                            * @throws {@link HttpError} On Talks (V2) and Clips (V3) agents, when the Agents API answers
                                                                                * the request non-2xx. Expressive (V4) agents send the script over the data channel instead,
                                                                                * so no HTTP request is made.
                                                                                * @throws {@link NetworkError} On Talks (V2) and Clips (V3) agents, when that request never
                                                                                    * reaches the server.
                                                                                    * @example Text
                                                                                    * ```ts
                                                                                    * const speak = await agentManager.speak({
                                                                                    *     type: 'text',
                                                                                    *     input: "Hi! I'm Alice!",
                                                                                    * });
                                                                                    * ```
                                                                                    * @example Text with sentiment (Expressive (V4) agents)
                                                                                    * ```ts
                                                                                    * const speak = await agentManager.speak({
                                                                                    *     type: 'text',
                                                                                    *     input: "Hi! I'm Alice!",
                                                                                    *     sentiment: 'friendly',
                                                                                    * });
                                                                                    * ```
                                                                                    * @example Audio file
                                                                                    * ```ts
                                                                                    * const speak = await agentManager.speak({
                                                                                    *     type: 'audio',
                                                                                    *     audio_url: 'https://www.yourwebsite.com/audio.mp3',
                                                                                    * });
                                                                                    * ```
                                                                                    */
                                                                                speak(payload: SpeakScript | string): Promise<SpeakResponse>;
                                                                                /**
                                                                                 * Switches the chat to another mode.
                                                                                 *
                                                                                 * Any mode but {@link ChatMode.Functional} disconnects the stream, and a change into
                                                                                 * `Functional` disconnects a session that was not built for a conversation (one opened in
                                                                                 * {@link ChatMode.DirectPlayback}, for example); call {@link AgentManager.connect | connect()}
                                                                                 * again after such a change. {@link AgentManagerCallbacks.onModeChange | onModeChange} fires
                                                                                 * once the change is applied; passing the mode already in effect does nothing.
                                                                                 *
                                                                                 * @param mode - The {@link ChatMode} to switch to.
                                                                                 * @returns A promise resolved when the mode is in effect and any disconnect has completed.
                                                                                 * @throws {@link ValidationError} Rejects on Expressive (V4) agents for {@link ChatMode.Off} and
                                                                                     * {@link ChatMode.DirectPlayback}, which those agents do not support.
                                                                                     * @example
                                                                                     * ```ts
                                                                                     * import { ChatMode } from '@d-id/client-sdk';
                                                                                     *
                                                                                     * await agentManager.changeMode(ChatMode.Off); // Disconnects the stream.
                                                                                     *
                                                                                     * await agentManager.changeMode(ChatMode.Functional);
                                                                                     * await agentManager.connect();
                                                                                     * ```
                                                                                     */
                                                                                 changeMode(mode: ChatMode): Promise<void>;
                                                                                 /**
                                                                                  * Adds properties to every analytics event the SDK sends from now on.
                                                                                  *
                                                                                  * The same thing
                                                                                  * {@link AnalyticsOptions.additionalProperties | analytics.additionalProperties} does at
                                                                                  * creation time, for values you only learn later.
                                                                                  *
                                                                                  * Advanced. Calls merge, so a property sent twice takes the later value, and events already
                                                                                  * sent are not changed. It has no visible effect when analytics is switched off with
                                                                                  * {@link AnalyticsOptions.enabled | analytics.enabled} set to `false`, because nothing is sent
                                                                                  * at all.
                                                                                  *
                                                                                  * @param properties - A flat JSON object whose properties are added to every analytics event
                                                                                  * the SDK sends from now on.
                                                                                  * @example
                                                                                  * ```ts
                                                                                  * // The user signed in halfway through the session.
                                                                                  * agentManager.enrichAnalytics({ plan: 'pro', locale: navigator.language });
                                                                                  * ```
                                                                                  */
                                                                                 enrichAnalytics(properties: Record<string, unknown>): void;
                                                                                 /**
                                                                                  * Interrupts the current video stream mid-playback, so the user can talk over the agent.
                                                                                  *
                                                                                  * Supported on a fluent stream — a Clips (V3) agent built on a Pro avatar, or any Expressive
                                                                                  * (V4) agent. It never throws: on every agent type it returns without doing anything when
                                                                                  * interrupting is not available for the session, when it is not allowed right now, and — on
                                                                                  * Talks (V2) and Clips (V3) agents — when the stream is not a fluent stream or no video is
                                                                                  * playing. Check {@link AgentManager.isInterruptAvailable | isInterruptAvailable()}
                                                                                  * before offering the control at all; on Expressive (V4) agents
                                                                                  * {@link AgentManagerCallbacks.onInterruptibleChange | onInterruptibleChange} tracks whether it
                                                                                  * is allowed right now.
                                                                                  *
                                                                                  * The last message in the transcript is marked `interrupted` in the next
                                                                                  * {@link AgentManagerCallbacks.onNewMessage | onNewMessage}, but only when an interrupt was
                                                                                  * actually sent. A call that finds nothing to interrupt leaves the message untouched and fires
                                                                                  * no callback.
                                                                                  *
                                                                                  * @param options - What caused the interruption, as an {@link InterruptOptions}: `text`,
                                                                                  * `audio`, `click` or `manual`. Optional — a stop button is the common case, so leaving it out
                                                                                  * means `{ type: 'click' }`. Expressive (V4) agents drop `text` interrupts, because the
                                                                                  * orchestrator does not cancel the in-flight answer for them.
                                                                                  * @example
                                                                                  * ```ts
                                                                                  * stopButton.onclick = () => agentManager.interrupt();
                                                                                  *
                                                                                  * // The user typed over the answer instead of pressing the button.
                                                                                  * agentManager.interrupt({ type: 'text' });
                                                                                  * ```
                                                                                  */
                                                                                 interrupt(options?: InterruptOptions): void;
                                                                                 /**
                                                                                  * Switches the speech-to-text language in the middle of a session.
                                                                                  *
                                                                                  * Expressive (V4) agents only, after {@link AgentManager.connect | connect()}; otherwise the
                                                                                  * returned promise rejects with a {@link ValidationError}.
                                                                                  *
                                                                                  * @param language - The language to transcribe in, as a name or a BCP-47 code — `"English"` or
                                                                                  * `"en-US"`.
                                                                                  * @returns Resolves once the new language has been sent to the agent. A room that has dropped
                                                                                  * since {@link AgentManager.connect | connect()} reports a {@link StreamError} through
                                                                                  * {@link AgentManagerCallbacks.onError | onError} and the promise still resolves.
                                                                                  * @throws {@link ValidationError} When the session is not an Expressive (V4) one, or
                                                                                      * {@link AgentManager.connect | connect()} has not run yet.
                                                                                      * @example
                                                                                      * ```ts
                                                                                      * await agentManager.setSttLanguage('en-US');
                                                                                      * await agentManager.setSttLanguage('Spanish');
                                                                                      * ```
                                                                                      */
                                                                                  setSttLanguage(language: string): Promise<void>;
                                                                                  /**
                                                                                   * Sends a JSON payload to the agent over a data-channel topic.
                                                                                   *
                                                                                   * Use it for application-specific messages that are not speech, such as telling a presentation
                                                                                   * to change slide. Expressive (V4) agents only, after {@link AgentManager.connect | connect()};
                                                                                   * otherwise the returned promise rejects with a {@link ValidationError}.
                                                                                   *
                                                                                   * @param topic - Data-channel topic to send on. Either a {@link DataChannelTopic} member or
                                                                                   * its string value — `DataChannelTopic.Presentation` and `'did.presentation'` are both
                                                                                   * accepted. {@link DataChannelTopic} is exported from the package root and lists every topic
                                                                                   * this method accepts.
                                                                                   * @param payload - A plain object, sent as JSON.
                                                                                   * @returns Resolves once the payload has been sent. A room that has dropped since
                                                                                   * {@link AgentManager.connect | connect()} reports a {@link StreamError} through
                                                                                   * {@link AgentManagerCallbacks.onError | onError} and the promise still resolves.
                                                                                   * @throws {@link ValidationError} When the session is not an Expressive (V4) one, or
                                                                                       * {@link AgentManager.connect | connect()} has not run yet.
                                                                                       * @example
                                                                                       * ```ts
                                                                                       * import { DataChannelTopic } from '@d-id/client-sdk';
                                                                                       *
                                                                                       * await agentManager.sendDataChannelMessage(DataChannelTopic.Presentation, {
                                                                                       *     type: 'navigate',
                                                                                       *     slide: 3,
                                                                                       * });
                                                                                       * ```
                                                                                       */
                                                                                   sendDataChannelMessage(topic: `${DataChannelTopic}`, payload: Record<string, unknown>): Promise<void>;
                                                                                   /**
                                                                                    * Reports a piece of the viewer's current state to the agent, such as where they are in a video.
                                                                                    *
                                                                                    * The value is set as the participant attribute `did.viewer.<kind>`, and the agent reads the
                                                                                    * latest one at its next answer. Expressive (V4) agents only, after
                                                                                    * {@link AgentManager.connect | connect()}; otherwise the returned promise rejects with a
                                                                                    * {@link ValidationError}. The SDK remembers the last value of each kind and sets it again on
                                                                                    * {@link AgentManager.connect | connect()} and {@link AgentManager.reconnect | reconnect()}, but
                                                                                    * not after LiveKit's own automatic reconnection.
                                                                                    *
                                                                                    * Rules for every kind:
                                                                                    * - State, not events: the latest value wins. Anything that must happen exactly once belongs on
                                                                                    *   {@link AgentManager.sendDataChannelMessage | sendDataChannelMessage()}.
                                                                                    * - Low frequency: no more often than every few seconds. Never stream continuous values such
                                                                                    *   as playback time.
                                                                                    * - Small and structured: a JSON object of at most 1 KB.
                                                                                    * - Untrusted: the agent accepts only kinds on its allow-list, parses them, and never puts the
                                                                                    *   raw value in its prompt. Unknown kinds and malformed values are dropped.
                                                                                    * - No secrets or personal data: attributes are visible to everyone in the room and to the
                                                                                    *   LiveKit server.
                                                                                    * - A breaking change is a new kind (for example `..._v2`); never reshape an existing one.
                                                                                    *
                                                                                    * @param kind - The kind of state, matching `^[a-z0-9_]+$` — `'agentic_video_position'`.
                                                                                    * @param value - A plain object, sent as JSON, or `null` to clear the kind.
                                                                                    * @returns Resolves once the attribute has been sent. A failure to set it is not reported; the
                                                                                    * value is set again on the next {@link AgentManager.connect | connect()} or
                                                                                    * {@link AgentManager.reconnect | reconnect()}.
                                                                                    * @throws {@link ValidationError} When `kind` is invalid, the serialized value is over 1 KB, the
                                                                                        * session is not an Expressive (V4) one, or {@link AgentManager.connect | connect()} has not run
                                                                                        * yet.
                                                                                        * @example
                                                                                        * ```ts
                                                                                        * await agentManager.setViewerState('agentic_video_position', { seconds: 42, trigger: 'ask' });
                                                                                        * await agentManager.setViewerState('agentic_video_position', null);
                                                                                        * ```
                                                                                        */
                                                                                    setViewerState(kind: string, value: object | null): Promise<void>;
                                                                                    /**
                                                                                     * Registers a handler for a client tool, run in the browser when the agent's LLM calls it.
                                                                                     *
                                                                                     * Expressive (V4) agents only: client tools travel on the real-time session's RPC channel,
                                                                                     * which Talks (V2) and Clips (V3) agents do not have. It throws a {@link ValidationError} on
                                                                                     * those rather than registering a handler the agent could never call. The check is on the
                                                                                     * agent, not on the connection, so it applies before
                                                                                     * {@link AgentManager.connect | connect()} too.
                                                                                     *
                                                                                     * The handler executes on the client and its result is returned to the LLM. Register the
                                                                                     * handlers before {@link AgentManager.connect | connect()} so the agent can call
                                                                                     * them from the moment the session starts; registering the same name again replaces the
                                                                                     * handler. Progress is reported through
                                                                                     * {@link AgentManagerCallbacks.onToolEvent | onToolEvent}.
                                                                                     *
                                                                                     * @param name - Name of the tool, which must match the one defined in the agent's
                                                                                     * configuration.
                                                                                     * @param handler - The function that runs when the agent calls the tool. It receives the
                                                                                     * arguments the LLM produced and returns a JSON string of at most 15 KiB — the limit is the
                                                                                     * transport's, not the SDK's, and a larger result fails the call. See
                                                                                     * {@link ClientToolHandler}.
                                                                                     * @throws {@link ValidationError} When the agent is a Talks (V2) or Clips (V3) one.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * if (agentManager.agent.avatar.type === 'expressive') {
                                                                                         *     agentManager.registerClientTool('get_cart_total', async args => {
                                                                                         *         const total = await cart.total(args.currency as string);
                                                                                         *         return JSON.stringify({ total });
                                                                                         *     });
                                                                                         * }
                                                                                         * ```
                                                                                         */
                                                                                     registerClientTool(name: string, handler: ClientToolHandler): void;
                                                                                     /**
                                                                                      * Removes a previously registered client tool handler.
                                                                                      *
                                                                                      * After this the agent's calls to that tool fail rather than reaching your code. Unlike
                                                                                      * {@link AgentManager.registerClientTool | registerClientTool()} it never throws — a name that
                                                                                      * was never registered, and any agent type, is a no-op — so it is safe in a cleanup path.
                                                                                      *
                                                                                      * @param name - Name of the tool whose handler should be removed.
                                                                                      * @example
                                                                                      * ```ts
                                                                                      * // Safe in a cleanup path: it never throws, whatever the agent type.
                                                                                      * agentManager.unregisterClientTool('get_cart_total');
                                                                                      * ```
                                                                                      */
                                                                                     unregisterClientTool(name: string): void;
                                                                                    }

                                                                                    /**
                                                                                     * Handlers the SDK calls as the connection, the video stream and the chat change state.
                                                                                     *
                                                                                     * Pass the object as {@link AgentManagerOptions.callbacks}. Every handler is optional in the type,
                                                                                     * but {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} is required in practice
                                                                                     * for any chat mode that streams video — without it there is nothing to render the agent into, and
                                                                                     * {@link createAgentManager} rejects. Every handler is called from the SDK's own event handling,
                                                                                     * so keep the work inside short.
                                                                                     *
                                                                                     * The handlers fall into four groups: the connection
                                                                                     * ({@link AgentManagerCallbacks.onConnectionStateChange | onConnectionStateChange},
                                                                                     * {@link AgentManagerCallbacks.onConnectivityStateChange | onConnectivityStateChange},
                                                                                     * {@link AgentManagerCallbacks.onError | onError}), the video stream
                                                                                     * ({@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady},
                                                                                     * {@link AgentManagerCallbacks.onStreamCreated | onStreamCreated},
                                                                                     * {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange},
                                                                                     * {@link AgentManagerCallbacks.onAgentActivityStateChange | onAgentActivityStateChange},
                                                                                     * {@link AgentManagerCallbacks.onInterruptibleChange | onInterruptibleChange}), the chat
                                                                                     * ({@link AgentManagerCallbacks.onNewChat | onNewChat}, {@link AgentManagerCallbacks.onNewMessage | onNewMessage},
                                                                                     * {@link AgentManagerCallbacks.onModeChange | onModeChange}) and client tools
                                                                                     * ({@link AgentManagerCallbacks.onToolEvent | onToolEvent},
                                                                                     * {@link AgentManagerCallbacks.onRunningToolCallsChange | onRunningToolCallsChange}). A handler that
                                                                                     * lives outside the object can be typed with an indexed access such as
                                                                                     * `AgentManagerCallbacks['onNewMessage']`.
                                                                                     *
                                                                                     * The whole object is captured once, by {@link createAgentManager}, and the manager works from its
                                                                                     * own copy — assigning a handler to the object you passed afterwards has no effect, and neither
                                                                                     * does replacing {@link AgentManagerOptions.callbacks | options.callbacks}. Give each handler a
                                                                                     * stable identity that reads the current state rather than closing over it: in React, keep the
                                                                                     * state in a ref and read `ref.current` inside the handler.
                                                                                     *
                                                                                     * @category Callbacks & Events
                                                                                     */
                                                                                    export declare interface AgentManagerCallbacks {
                                                                                        /**
                                                                                         * Called every time the connection to the agent's stream changes state.
                                                                                         *
                                                                                         * Triggered by {@link AgentManager.connect | connect()},
                                                                                         * {@link AgentManager.reconnect | reconnect()} and
                                                                                         * {@link AgentManager.disconnect | disconnect()}.
                                                                                         * {@link ConnectionState.Connected | 'connected'} is the point at which
                                                                                         * {@link AgentManager.chat | chat()} and {@link AgentManager.speak | speak()} can be called.
                                                                                         *
                                                                                         * @param state - The state just reached: one of `new`, `connecting`, `connected`, `completed`,
                                                                                         * `disconnecting`, `disconnected`, `closed` or `fail`. See {@link ConnectionState}.
                                                                                         * @param reason - Why that state was reached. On `disconnected` it is a
                                                                                         * {@link StreamEndReason} value when the server ended the stream on purpose, which is how you
                                                                                         * tell a deliberate end from a dropped connection. Talks (V2) and Clips (V3) agents report
                                                                                         * only `ok`, `unknown_error`, `network_issue` and `inactivity`; `message_limit`, `time_limit`
                                                                                         * and `ended_by_agent` come from Expressive (V4) agents. A close reason the SDK does not
                                                                                         * recognize is forwarded as-is, so compare `reason` against the enum rather than parsing it;
                                                                                         * any other value is an opaque transport diagnostic.
                                                                                         * {@link AgentManager.reconnect | reconnect()} still works after a deliberate end; it starts a
                                                                                         * new stream rather than resuming the old one.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { ConnectionState, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onConnectionStateChange(state, reason) {
                                                                                         *         console.log('onConnectionStateChange(): ', state, reason);
                                                                                         *
                                                                                         *         if (state === ConnectionState.Connected) {
                                                                                         *             console.log("I'm ready to go!");
                                                                                         *         }
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onConnectionStateChange?: (state: ConnectionState, reason?: string) => void;
                                                                                        /**
                                                                                         * Called when the streamed video starts and stops, so the video element can switch source.
                                                                                         *
                                                                                         * Triggered by {@link AgentManager.chat | chat()} and {@link AgentManager.speak | speak()}. On
                                                                                         * `STOP` point the element at the agent's idle video ({@link Agent.idle_video}); on `START` put
                                                                                         * the stream handed to {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} back
                                                                                         * on it.
                                                                                         *
                                                                                         * On a **legacy** stream this is the only "is the agent speaking" signal — see
                                                                                         * {@link AgentManagerCallbacks.onAgentActivityStateChange | onAgentActivityStateChange} for
                                                                                         * which stream types report which.
                                                                                         *
                                                                                         * @param state - {@link StreamingState.Start | START} while the agent is speaking,
                                                                                         * {@link StreamingState.Stop | STOP} once it has finished.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { StreamingState, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * let srcObject: MediaStream | null = null;
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onSrcObjectReady(value) {
                                                                                         *         srcObject = value;
                                                                                         *         videoElement.srcObject = value;
                                                                                         *     },
                                                                                         *     onVideoStateChange(state) {
                                                                                         *         if (state === StreamingState.Stop) {
                                                                                         *             videoElement.srcObject = null;
                                                                                         *             videoElement.src = agentManager.agent.idle_video ?? '';
                                                                                         *         } else {
                                                                                         *             videoElement.src = '';
                                                                                         *             videoElement.srcObject = srcObject;
                                                                                         *         }
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onVideoStateChange?: (state: StreamingState) => void;
                                                                                        /**
                                                                                         * Called with the media stream carrying the agent's video and audio.
                                                                                         *
                                                                                         * This is the one callback a video session cannot work without: assign the value to the
                                                                                         * `srcObject` of your `<video>` element, and keep a reference to it, because
                                                                                         * {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange} has to put it back
                                                                                         * after the idle video has been shown. Triggered by
                                                                                         * {@link AgentManager.connect | connect()}, {@link AgentManager.reconnect | reconnect()} and
                                                                                         * {@link AgentManager.disconnect | disconnect()}.
                                                                                         *
                                                                                         * Optional only for the chat modes that never stream video — {@link ChatMode.TextOnly},
                                                                                         * {@link ChatMode.Playground} and {@link ChatMode.Maintenance} — so a text-only application
                                                                                         * does not have to supply a stub. {@link createAgentManager} rejects with a
                                                                                         * {@link ValidationError} when it is missing in any other mode — {@link ChatMode.Off} and
                                                                                         * {@link ChatMode.DirectPlayback} included, since those create no chat but still stream video.
                                                                                         * {@link AgentManager.connect | connect()} checks it again against the mode in
                                                                                         * effect then, so a manager created in a text-only mode and later moved into a video mode with
                                                                                         * {@link AgentManager.changeMode | changeMode()} rejects rather than opening a stream with
                                                                                         * nothing to render it into.
                                                                                         *
                                                                                         * @param srcObject - The live media stream to render.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import type { AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * // Kept so `onVideoStateChange` can put it back after the idle video.
                                                                                         * let srcObject: MediaStream | null = null;
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onSrcObjectReady(value) {
                                                                                         *         videoElement.srcObject = value;
                                                                                         *         srcObject = value;
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onSrcObjectReady?: (srcObject: MediaStream) => void;
                                                                                        /**
                                                                                         * Called with the whole chat transcript every time a message is added or updated.
                                                                                         *
                                                                                         * Triggered by {@link AgentManager.chat | chat()}, by {@link AgentManager.speak | speak()} for
                                                                                         * text scripts, and as the agent's answer streams in. It also fires once while the manager is
                                                                                         * created, with whatever {@link AgentManagerOptions.initialMessages | initialMessages} were
                                                                                         * given, and again on every {@link AgentManager.connect | connect()} after the first — both
                                                                                         * with type `answer`. The array is a fresh copy on each call, oldest message first; every
                                                                                         * {@link Message} carries an `id`, a `role` of `user` or `assistant` (the agent), its `content`
                                                                                         * and a `createdAt` timestamp.
                                                                                         *
                                                                                         * @param messages - The chat so far.
                                                                                         * @param type - `partial` while the agent's answer is still streaming in, `answer` for the full
                                                                                         * answer spoken in the streamed video, `user` when the message just added is the user's own
                                                                                         * (a message passed to {@link AgentManager.chat | chat()}, or a transcribed utterance).
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import type { AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onNewMessage(messages, type) {
                                                                                         *         // `partial` fires repeatedly as the answer streams in; `answer` is the final one.
                                                                                         *         if (type === 'answer') {
                                                                                         *             console.log(messages[messages.length - 1]?.content);
                                                                                         *         }
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onNewMessage?: (messages: Message[], type: 'answer' | 'partial' | 'user') => void;
                                                                                        /**
                                                                                         * Called when a chat is created for this session.
                                                                                         *
                                                                                         * A chat is created while {@link AgentManager.connect | connect()} runs, and lazily on the
                                                                                         * first {@link AgentManager.chat | chat()} when none exists yet. Store the id if you want to
                                                                                         * correlate the conversation with your own records.
                                                                                         *
                                                                                         * On Talks (V2) and Clips (V3) agents the id comes from the Agents API. On Expressive (V4)
                                                                                         * agents the SDK derives it from the session id as `cht_<sessionId>`, which is the same id the
                                                                                         * Agents API stores the conversation under — so it correlates with D-ID's own records either
                                                                                         * way.
                                                                                         *
                                                                                         * @param chatId - Id of the chat that was just created.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import type { AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onNewChat(chatId) {
                                                                                         *         // Keep it to correlate the conversation with your own records.
                                                                                         *         localStorage.setItem('did-chat-id', chatId);
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onNewChat?: (chatId: string) => void;
                                                                                        /**
                                                                                         * Called when the chat mode changes.
                                                                                         *
                                                                                         * Fires after {@link AgentManager.changeMode | changeMode()}, and when the server answers with
                                                                                         * a different mode than the one requested (for example {@link ChatMode.Maintenance}).
                                                                                         *
                                                                                         * @param mode - The {@link ChatMode} now in effect.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { ChatMode, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onModeChange(mode) {
                                                                                         *         // `chat()` rejects in Maintenance too, so the composer goes with the banner below.
                                                                                         *         setComposerEnabled(
                                                                                         *             mode !== ChatMode.Off && mode !== ChatMode.DirectPlayback && mode !== ChatMode.Maintenance
                                                                                         *         );
                                                                                         *
                                                                                         *         if (mode === ChatMode.Maintenance) {
                                                                                         *             showBanner('The agent is temporarily unavailable.');
                                                                                         *         }
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onModeChange?: (mode: ChatMode) => void;
                                                                                        /**
                                                                                         * Called when the quality of the user's internet connection changes.
                                                                                         *
                                                                                         * The state is derived from jitter-buffer delay and freeze count on the video stream for
                                                                                         * Talks (V2) and Clips (V3) agents, and from LiveKit's reported connection quality for
                                                                                         * Expressive (V4) agents, so it reflects what the session is actually getting rather than the
                                                                                         * browser's online flag.
                                                                                         *
                                                                                         * @param state - {@link ConnectivityState.Strong | STRONG},
                                                                                         * {@link ConnectivityState.Weak | WEAK} or {@link ConnectivityState.Unknown | UNKNOWN}.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { ConnectivityState, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onConnectivityStateChange(state) {
                                                                                         *         setQualityWarningVisible(state === ConnectivityState.Weak);
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onConnectivityStateChange?: (state: ConnectivityState) => void;
                                                                                        /**
                                                                                         * Called when the SDK fails, so the application can surface the problem.
                                                                                         *
                                                                                         * Receives failures from the Agents API requests, the stream and the web socket — an
                                                                                         * {@link HttpError} when a request comes back non-2xx, a {@link NetworkError} when it never
                                                                                         * reaches the server, a {@link WsError} when the web socket itself fails, and also
                                                                                         * {@link ChatModeDowngraded} and {@link StreamError}. Two errors do not arrive here:
                                                                                         * {@link ValidationError} and {@link ChatCreationFailed} are thrown to whoever called the
                                                                                         * method ({@link AgentManager.chat | chat()}, {@link AgentManager.speak | speak()} and the
                                                                                         * rating methods), so they surface as a rejected promise rather than through this callback.
                                                                                         *
                                                                                         * @param error - The error that occurred. Narrow it with {@link isDIDError} and branch on
                                                                                         * {@link BaseError.kind | kind}; {@link BaseError.toJson | toJson()} is what to log.
                                                                                         * @param errorData - Where the failure happened, as an {@link ErrorContext}: the endpoint and
                                                                                         * method for a failed request, the session or stream id for a failure on the stream. Every
                                                                                         * field is optional and nothing else is passed — in particular not the request body, which
                                                                                         * carries the end user's own message.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { isDIDError, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onError(error, errorData) {
                                                                                         *         reportToYourErrorService({
                                                                                         *             ...(isDIDError(error) ? error.toJson() : { kind: 'Error', message: error.message }),
                                                                                         *             ...errorData,
                                                                                         *         });
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onError?: (error: Error, errorData?: ErrorContext) => void;
                                                                                        /**
                                                                                         * Called when the agent moves between idle, loading, talking and running a tool.
                                                                                         *
                                                                                         * Use it to drive a typing indicator or to disable input while the agent is busy. The full set
                                                                                         * of states is reported for Expressive (V4) agents only. Talks (V2) and Clips (V3) agents
                                                                                         * report just {@link AgentActivityState.Talking | Talking} and
                                                                                         * {@link AgentActivityState.Idle | Idle}, and only on fluent streams, plus a final
                                                                                         * {@link AgentActivityState.Idle | Idle} when the connection closes.
                                                                                         *
                                                                                         * It is the authoritative "is the agent speaking" signal wherever it reports at all — an
                                                                                         * Expressive (V4) session or a fluent stream — because it comes from the agent rather than from
                                                                                         * the video track, so it also covers thinking and tool calls, which produce no video.
                                                                                         * On a **legacy** stream it reports nothing, so use
                                                                                         * {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange} there; that is the
                                                                                         * branch every consumer otherwise writes for itself, keyed on
                                                                                         * {@link AgentManager.getStreamType | getStreamType()}.
                                                                                         *
                                                                                         * @param state - The {@link AgentActivityState} the agent has moved to.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { AgentActivityState, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onAgentActivityStateChange(state) {
                                                                                         *         setTypingIndicatorVisible(state === AgentActivityState.Loading);
                                                                                         *         setComposerEnabled(state === AgentActivityState.Idle);
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onAgentActivityStateChange?: (state: AgentActivityState) => void;
                                                                                        /**
                                                                                         * Called once per session when the stream has been created on the server.
                                                                                         *
                                                                                         * Fires before the connection reaches {@link ConnectionState.Connected | 'connected'}. The ids
                                                                                         * are useful when correlating a session with D-ID support or with your own logs.
                                                                                         *
                                                                                         * @param stream - The new stream's `streamId`, `sessionId` and `agentId`.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import type { AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onStreamCreated({ streamId, sessionId }) {
                                                                                         *         // The two ids D-ID support asks for when a session misbehaves.
                                                                                         *         console.log('stream', streamId, 'session', sessionId);
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onStreamCreated?: (stream: StreamCreatedInfo) => void;
                                                                                        /**
                                                                                         * Called when the agent starts, finishes or fails a tool call.
                                                                                         *
                                                                                         * Expressive (V4) agents only. The handler takes two arguments and returns nothing: `event`,
                                                                                         * one of {@link ToolCallEvent.Started}, {@link ToolCallEvent.Done} or
                                                                                         * {@link ToolCallEvent.Error}; and `data`, the payload that event carries —
                                                                                         * {@link ToolCallStartedPayload}, {@link ToolCallDonePayload} or
                                                                                         * {@link ToolCallErrorPayload} respectively. The signature that does the narrowing is on
                                                                                         * {@link ToolEventCallback}, which also carries a handler that branches on all three events.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { ToolCallEvent, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onToolEvent(event, data) {
                                                                                         *         if (event === ToolCallEvent.Error) {
                                                                                         *             showBanner(`${data.name} failed: ${data.error ?? 'no reason given'}`);
                                                                                         *         }
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onToolEvent?: ToolEventCallback;
                                                                                        /**
                                                                                         * Called when the agent becomes interruptible, or stops being interruptible.
                                                                                         *
                                                                                         * Expressive (V4) agents only, and about whether interrupting is allowed *right now*: it goes
                                                                                         * `false` while any `blocking` tool call is outstanding (client or server), and back to `true`
                                                                                         * once none is: finished, failed, its turn ended, or the session disconnected. That is a
                                                                                         * different question from
                                                                                         * {@link AgentManager.isInterruptAvailable | isInterruptAvailable()}, which says whether
                                                                                         * the session supports interrupting at all. Use this one to enable or disable an interrupt
                                                                                         * button. Talks (V2) and Clips (V3) agents never report a change.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import type { AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onInterruptibleChange(interruptible) {
                                                                                         *         setStopButtonEnabled(interruptible);
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onInterruptibleChange?: (
                                                                                        /** `true` when interrupting is allowed, `false` while a blocking tool call is pending. */
                                                                                        interruptible: boolean) => void;
                                                                                        /**
                                                                                         * Called whenever the set of tool calls running in the session changes.
                                                                                         *
                                                                                         * Expressive (V4) agents only. On disconnect it fires with an empty array if any call was
                                                                                         * still running, so a spinner driven by this callback always clears; with nothing outstanding
                                                                                         * there is nothing to clear and nothing is emitted. Each entry is a {@link RunningToolCall}.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * import { isAwaitingTool, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                         *
                                                                                         * const callbacks: AgentManagerCallbacks = {
                                                                                         *     onRunningToolCallsChange(calls) {
                                                                                         *         setSpinnerVisible(isAwaitingTool(calls));
                                                                                         *         setStatusText(calls.map(call => call.name).join(', '));
                                                                                         *     },
                                                                                         * };
                                                                                         * ```
                                                                                         */
                                                                                        onRunningToolCallsChange?: (
                                                                                        /** Every tool call running right now, empty when none is. */
                                                                                        calls: readonly RunningToolCall[]) => void;
                                                                                    }

                                                                                    /**
                                                                                     * Everything {@link createAgentManager} needs to reach an agent and report back to the application.
                                                                                     *
                                                                                     * {@link AgentManagerOptions.auth | auth} and {@link AgentManagerOptions.callbacks | callbacks} are
                                                                                     * required; the rest have defaults that suit a browser application talking to D-ID production.
                                                                                     *
                                                                                     * {@link createAgentManager} reads the object once, at creation, and never writes to it: the
                                                                                     * manager works from its own copy, so one options object can create two managers, and a property
                                                                                     * you read back afterwards is still the one you set. The same means a handler assigned to
                                                                                     * {@link AgentManagerOptions.callbacks | callbacks} after the manager exists is not picked up —
                                                                                     * give the callback a stable identity and dispatch inside it instead.
                                                                                     *
                                                                                     * @category Agent Manager
                                                                                     */
                                                                                    export declare interface AgentManagerOptions {
                                                                                        /**
                                                                                         * Credentials used for every request the SDK makes on the application's behalf.
                                                                                         *
                                                                                         * Use `{ type: 'key', clientKey }` in a browser: a client key works for one agent and only from
                                                                                         * the domains you allowed, so it is the only credential that is safe to ship in a page. See
                                                                                         * {@link Auth}.
                                                                                         */
                                                                                        auth: Auth;
                                                                                        /**
                                                                                         * Handlers the SDK calls as the connection, the video stream and the chat change state.
                                                                                         *
                                                                                         * See {@link AgentManagerCallbacks}.
                                                                                         * {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} is what connects the
                                                                                         * streamed media to your video element, so every chat mode that streams video needs it. The
                                                                                         * handlers are captured at creation, so replacing one on this object later has no effect.
                                                                                         */
                                                                                        callbacks: AgentManagerCallbacks;
                                                                                        /**
                                                                                         * How the agent answers: with a streamed video, as text only, or not at all.
                                                                                         *
                                                                                         * See {@link ChatMode}. It can be changed later with
                                                                                         * {@link AgentManager.changeMode | changeMode()}. {@link ChatMode.Off} and
                                                                                         * {@link ChatMode.DirectPlayback} are supported on Talks (V2) and Clips (V3) agents only.
                                                                                         *
                                                                                         * @default ChatMode.Functional
                                                                                         * @throws {@link ValidationError} From {@link createAgentManager}, when the agent is Expressive
                                                                                             * (V4) and the mode is {@link ChatMode.Off} or {@link ChatMode.DirectPlayback}.
                                                                                             */
                                                                                         mode?: ChatMode;
                                                                                         /**
                                                                                          * Base URL of the D-ID Agents API.
                                                                                          *
                                                                                          * Advanced. Points the SDK at another D-ID environment. Production applications do not set
                                                                                          * this. Every REST call the manager makes — agent lookup, chat, ratings, stream creation — is
                                                                                          * addressed against it.
                                                                                          *
                                                                                          * @defaultValue D-ID's production Agents API.
                                                                                          */
                                                                                         baseURL?: string;
                                                                                         /**
                                                                                          * URL of the D-ID notifications web socket.
                                                                                          *
                                                                                          * Advanced. Points the SDK at another D-ID environment. Production applications do not set
                                                                                          * this. Only opened in the chat modes that stream the agent's answer, so it has no effect in
                                                                                          * {@link ChatMode.DirectPlayback | DirectPlayback} or {@link ChatMode.Off | Off}.
                                                                                          *
                                                                                          * @defaultValue D-ID's production notifications web socket.
                                                                                          */
                                                                                         wsURL?: string;
                                                                                         /**
                                                                                          * Whether the SDK logs its streaming lifecycle to the browser console.
                                                                                          *
                                                                                          * It is also switched on for everyone when the agent's `ui_debug_mode` advanced setting is
                                                                                          * enabled, regardless of the value passed here.
                                                                                          *
                                                                                          * @default false
                                                                                          */
                                                                                         debug?: boolean;
                                                                                         /**
                                                                                          * Whether tool-call events carry the call's input, output, duration and failure details.
                                                                                          *
                                                                                          * Without it, {@link AgentManagerCallbacks.onToolEvent | onToolEvent} payloads carry only the
                                                                                          * call's id, name and timestamp. The Agents API accepts it only from the agent's owner with
                                                                                          * {@link BasicAuth} or {@link BearerToken} auth, and rejects it with a `403` otherwise, so a
                                                                                          * browser application on a client key cannot use it. Independent of
                                                                                          * {@link AgentManagerOptions.debug | debug}. Expressive (V4) agents only.
                                                                                          *
                                                                                          * @default false
                                                                                          */
                                                                                         verbose?: boolean;
                                                                                         /**
                                                                                          * What the SDK reports about the session, and where it goes.
                                                                                          *
                                                                                          * See {@link AnalyticsOptions}. Reporting is on unless you turn it off with
                                                                                          * `analytics: { enabled: false }`.
                                                                                          */
                                                                                         analytics?: AnalyticsOptions;
                                                                                         /**
                                                                                          * Your own identifier for the end user.
                                                                                          *
                                                                                          * It is stored in `localStorage`, sent as part of the `type: 'key'` authorization header and
                                                                                          * attached to analytics, so the same visitor is recognized across page loads. When it is
                                                                                          * omitted the SDK generates an id and reuses it.
                                                                                          */
                                                                                         externalId?: string;
                                                                                         /**
                                                                                          * Transport settings applied when the stream is created.
                                                                                          *
                                                                                          * See {@link StreamOptions}. Talks (V2) and Clips (V3) agents only. Expressive (V4) agents
                                                                                          * manage transport settings automatically.
                                                                                          */
                                                                                         streamOptions?: StreamOptions;
                                                                                         /**
                                                                                          * Messages the chat starts with, for example a transcript restored from your own storage.
                                                                                          *
                                                                                          * They are delivered to {@link AgentManagerCallbacks.onNewMessage | onNewMessage} so the UI can
                                                                                          * render them. On Talks (V2) and Clips (V3) agents they are also sent as context with the next
                                                                                          * {@link AgentManager.chat | chat()} request. See {@link Message}.
                                                                                          *
                                                                                          * A row from your own storage is enough: {@link Message.parts | parts} and
                                                                                          * {@link Message.createdAt | createdAt} are optional, and the SDK builds the parts from
                                                                                          * `content` with {@link parseMessageParts} for every message that arrives without them, so a
                                                                                          * transcript restored from the text alone still renders. A non-empty `parts` array is kept as
                                                                                          * given.
                                                                                          *
                                                                                          * @example Restoring rows that carry only the message text
                                                                                          * ```ts
                                                                                          * const initialMessages = stored.map(({ id, role, content }) => ({ id, role, content }));
                                                                                          * ```
                                                                                          */
                                                                                         initialMessages?: Message[];
                                                                                         /**
                                                                                          * Whether the server keeps the chat so it can be resumed in a later session.
                                                                                          *
                                                                                          * Without persistence a chat lives only as long as the connection.
                                                                                          * {@link AgentManager.reconnect | reconnect()} normally continues the same chat either way —
                                                                                          * see the caveat there for Expressive (V4) agents.
                                                                                          *
                                                                                          * Off unless you set it, on every agent type.
                                                                                          *
                                                                                          * @default false
                                                                                          */
                                                                                         persistentChat?: boolean;
                                                                                        }

                                                                                        /**
                                                                                         * What the SDK reports about the session, and where it goes.
                                                                                         *
                                                                                         * Pass it as {@link AgentManagerOptions.analytics}; every field is optional, and leaving the whole
                                                                                         * object out reports to D-ID's own project.
                                                                                         *
                                                                                         * The SDK posts an event to Mixpanel for each step of a session — connect, reconnect and
                                                                                         * disconnect, every message sent and answered, every {@link AgentManager.speak | speak()}, mode
                                                                                         * change, rating, feedback, tool call, video start and stop, interrupt and error. Each event
                                                                                         * carries the agent id, the visitor id derived from
                                                                                         * {@link AgentManagerOptions.externalId | externalId}, the page URL, the screen size, the user
                                                                                         * agent, the SDK version and whatever
                                                                                         * {@link AnalyticsOptions.additionalProperties | additionalProperties} added. **Conversation text
                                                                                         * is included too:** the agent's answer on `agent-message-received`, and the script on
                                                                                         * `agent-speak`. Set {@link AnalyticsOptions.enabled | enabled: false} to send nothing at all.
                                                                                         *
                                                                                         * Events that fail to post are buffered in memory (at most 50) and retried when the tab comes back
                                                                                         * online or becomes visible.
                                                                                         *
                                                                                         * @example Send the SDK's events to your own project, tagged with your plan
                                                                                         * ```ts
                                                                                         * const agentManager = await sdk.createAgentManager('agt_fumf1234', {
                                                                                         *     auth: { type: 'key', clientKey: 'YOUR_CLIENT_KEY' },
                                                                                         *     callbacks,
                                                                                         *     analytics: { mixpanelKey: 'YOUR_MIXPANEL_TOKEN', additionalProperties: { plan: 'pro' } },
                                                                                         * });
                                                                                         * ```
                                                                                         * @category Agent Manager
                                                                                         */
                                                                                        export declare interface AnalyticsOptions {
                                                                                            /**
                                                                                             * Whether the SDK reports usage analytics at all. Set it to `false` to send nothing.
                                                                                             *
                                                                                             * @default true
                                                                                             */
                                                                                            enabled?: boolean;
                                                                                            /**
                                                                                             * Mixpanel project token the SDK's analytics events are sent to.
                                                                                             *
                                                                                             * Defaults to D-ID's own project. Set it to send the SDK's events to your Mixpanel project
                                                                                             * instead.
                                                                                             */
                                                                                            mixpanelKey?: string;
                                                                                            /**
                                                                                             * Extra properties merged into every analytics event the SDK sends.
                                                                                             *
                                                                                             * A flat object — use it to tag events with your own identifiers. More properties can be added
                                                                                             * later with {@link AgentManager.enrichAnalytics | enrichAnalytics()}. A `plan` property here
                                                                                             * is also forwarded to the Agents API as end-user data when a Talks (V2) or Clips (V3) stream
                                                                                             * is created.
                                                                                             */
                                                                                            additionalProperties?: Record<string, unknown>;
                                                                                        }

                                                                                        /**
                                                                                         * A script that makes the agent lip-sync an audio file you host, with no text-to-speech involved.
                                                                                         *
                                                                                         * The other payload {@link AgentManager.speak | speak()} accepts. Use it when the audio already
                                                                                         * exists (a recording, or speech you synthesized yourself) instead of having a provider generate
                                                                                         * it from text. Talks (V2) and Clips (V3) agents only: an Expressive (V4) agent drops an audio
                                                                                         * script without an error.
                                                                                         *
                                                                                         * @example Audio file
                                                                                         * ```ts
                                                                                         * const speak = await agentManager.speak({
                                                                                         *     type: 'audio',
                                                                                         *     audio_url: 'https://www.yourwebsite.com/audio.mp3',
                                                                                         * });
                                                                                         * ```
                                                                                         * @category Speak & Scripts
                                                                                         */
                                                                                        export declare interface AudioStreamScript {
                                                                                            /**
                                                                                             * Which kind of script this is. Always `audio` for this variant; a
                                                                                             * {@link TextStreamScript} carries `text` instead.
                                                                                             */
                                                                                            type: 'audio';
                                                                                            /**
                                                                                             * URL of the audio file the agent lip-syncs to.
                                                                                             *
                                                                                             * The URL has to be publicly reachable, since the file is fetched server-side rather than
                                                                                             * uploaded from the browser. The file may be at most 15 MB.
                                                                                             * @example "https://www.yourwebsite.com/audio.mp3"
                                                                                             */
                                                                                            audio_url: string;
                                                                                        }

                                                                                        /**
                                                                                         * The credentials {@link createAgentManager} accepts, as
                                                                                         * {@link AgentManagerOptions.auth | options.auth}.
                                                                                         *
                                                                                         * Pick {@link ClientKeyAuth} (`{ type: 'key', clientKey }`) for anything that runs in a browser: it
                                                                                         * is the only variant limited to one agent and to the domains you allowed. {@link BasicAuth} is an
                                                                                         * API key with access to the whole account, for a server. {@link BearerToken} is a D-ID user access
                                                                                         * token. Whichever you pass is used for every request the SDK makes: the REST calls, the video
                                                                                         * stream and the notifications web socket.
                                                                                         *
                                                                                         * @category Authentication
                                                                                         */
                                                                                        export declare type Auth = BearerToken | BasicAuth | ClientKeyAuth;

                                                                                        /**
                                                                                         * The kind of avatar an agent is built on, which is what decides how its video is produced.
                                                                                         *
                                                                                         * It is the `type` of the agent's avatar ({@link Agent.avatar}) and so determines which SDK
                                                                                         * features a session has: {@link AvatarType.Talk | talk} is Talks (V2),
                                                                                         * {@link AvatarType.Clip | clip} is Clips (V3), and {@link AvatarType.Expressive | expressive} is
                                                                                         * Expressive (V4).
                                                                                         *
                                                                                         * @category Agent Manager
                                                                                         */
                                                                                        export declare enum AvatarType {
                                                                                            /** A Clips (V3) agent: a pre-recorded presenter, driven by the D-ID Clips pipeline. */
                                                                                            Clip = "clip",
                                                                                            /** A Talks (V2) agent: a still photo animated to speak. */
                                                                                            Talk = "talk",
                                                                                            /**
                                                                                             * An Expressive (V4) avatar: a real-time avatar that also supports microphone and camera
                                                                                             * publishing, client tools and interruption.
                                                                                             */
                                                                                            Expressive = "expressive",
                                                                                            /**
                                                                                             * An image agent: a still photo animated in real time. Streams over the same real-time session
                                                                                             * as Expressive (V4).
                                                                                             *
                                                                                             * @hidden
                                                                                             */
                                                                                            Image = "image"
                                                                                        }

                                                                                        /**
                                                                                         * Selects an Azure OpenAI voice for {@link TextStreamScript.provider}.
                                                                                         *
                                                                                         * The same shape as {@link MicrosoftTtsProvider}, with the `type` naming Azure OpenAI. Azure
                                                                                         * ignores `voice_config.rate` for these voices.
                                                                                         *
                                                                                         * @category Voice
                                                                                         */
                                                                                        export declare interface AzureOpenAiTtsProvider extends Omit<MicrosoftTtsProvider, 'type'> {
                                                                                            /** `'azure-openai'`, or {@link Providers.AzureOpenAi}. */
                                                                                            type: `${Providers.AzureOpenAi}`;
                                                                                        }

                                                                                        /**
                                                                                         * Base class of every error the SDK itself raises.
                                                                                         *
                                                                                         * Catching `BaseError` catches everything the SDK classified; branch on
                                                                                         * {@link BaseError.kind | kind}, which is stable, rather than on the message, which is not.
                                                                                         * Errors reach the application two ways, and each subclass says which applies: some are thrown to
                                                                                         * the caller of the method, so they reject the promise it returned; others are handed to
                                                                                         * {@link AgentManagerCallbacks.onError | onError} because no call of yours was in flight when they
                                                                                         * happened. {@link HttpError} and {@link NetworkError} do both — the request that failed rejects,
                                                                                         * and the callback is notified as well.
                                                                                         *
                                                                                         * Not everything that reaches the application is one of these. The streaming transport is the main
                                                                                         * exception: a failure LiveKit raises inside a media call on an Expressive (V4) agent — no
                                                                                         * microphone publication to replace, a room that is not connected — rejects with a plain `Error`,
                                                                                         * and so do a few low-level guards inside {@link AgentManager.connect | connect()}, such as a
                                                                                         * `livekit-client` package that is not installed, a transport the SDK does not recognize, or a
                                                                                         * stream the server created without a session id. An unknown
                                                                                         * {@link AgentManagerOptions.auth | auth} type is a plain `Error` too. So keep the
                                                                                         * `else throw error` branch in a handler built on {@link isDIDError}.
                                                                                         *
                                                                                         * Subclasses: {@link HttpError}, {@link NetworkError}, {@link WsError}, {@link StreamError},
                                                                                         * {@link ValidationError}, {@link ChatCreationFailed} and {@link ChatModeDowngraded}. When the
                                                                                         * caught value is typed `unknown`, {@link isDIDError} narrows it to {@link DIDError}, the union of
                                                                                         * those seven, so a `switch` on {@link BaseError.kind | kind} then narrows it to one class.
                                                                                         *
                                                                                         * @category Errors
                                                                                         */
                                                                                        export declare class BaseError extends Error {
                                                                                            /**
                                                                                             * Stable machine-readable code for this failure, and the value to branch on.
                                                                                             *
                                                                                             * Every subclass redeclares it as the literal it always carries, so a `switch` on `kind`
                                                                                             * narrows a value {@link isDIDError} has recognized to that class: `'HttpError'` on
                                                                                             * {@link HttpError}, `'NetworkError'` on {@link NetworkError}, `'WSError'` on
                                                                                             * {@link WsError}, `'StreamError'` on {@link StreamError}, `'ValidationError'` on
                                                                                             * {@link ValidationError}, `'ChatCreationFailed'` on {@link ChatCreationFailed} and
                                                                                             * `'ChatModeDowngraded'` on {@link ChatModeDowngraded}. It stays a plain `string` here on
                                                                                             * the base class: on a `BaseError` built directly it is whatever the caller passed, and
                                                                                             * `'Error'` when nothing was. The Agents API's own classification of a failed request is
                                                                                             * {@link HttpError.code | HttpError.code}, not this.
                                                                                             */
                                                                                            readonly kind: string;
                                                                                            /**
                                                                                             * The error or value that caused this one, when the SDK was wrapping something else.
                                                                                             *
                                                                                             * For a {@link NetworkError} this is the browser's own `fetch` rejection. It is not
                                                                                             * serialized as-is: {@link BaseError.toJson | toJson()} takes only an `Error` cause's
                                                                                             * message.
                                                                                             */
                                                                                            readonly originalError?: unknown | undefined;
                                                                                            /**
                                                                                             * Creates an SDK error. The SDK builds these itself; applications normally only catch them.
                                                                                             *
                                                                                             * @param message - Human-readable description of the failure, used as the `Error` message.
                                                                                             * @param kind - Stable machine-readable code for the failure.
                                                                                             * @param originalError - The underlying error or value this one wraps, when there is one.
                                                                                             */
                                                                                            constructor(message: string, 
                                                                                            /**
                                                                                             * Stable machine-readable code for this failure, and the value to branch on.
                                                                                             *
                                                                                             * Every subclass redeclares it as the literal it always carries, so a `switch` on `kind`
                                                                                             * narrows a value {@link isDIDError} has recognized to that class: `'HttpError'` on
                                                                                             * {@link HttpError}, `'NetworkError'` on {@link NetworkError}, `'WSError'` on
                                                                                             * {@link WsError}, `'StreamError'` on {@link StreamError}, `'ValidationError'` on
                                                                                             * {@link ValidationError}, `'ChatCreationFailed'` on {@link ChatCreationFailed} and
                                                                                             * `'ChatModeDowngraded'` on {@link ChatModeDowngraded}. It stays a plain `string` here on
                                                                                             * the base class: on a `BaseError` built directly it is whatever the caller passed, and
                                                                                             * `'Error'` when nothing was. The Agents API's own classification of a failed request is
                                                                                             * {@link HttpError.code | HttpError.code}, not this.
                                                                                             */
                                                                                            kind?: string, 
                                                                                            /**
                                                                                             * The error or value that caused this one, when the SDK was wrapping something else.
                                                                                             *
                                                                                             * For a {@link NetworkError} this is the browser's own `fetch` rejection. It is not
                                                                                             * serialized as-is: {@link BaseError.toJson | toJson()} takes only an `Error` cause's
                                                                                             * message.
                                                                                             */
                                                                                            originalError?: unknown | undefined);
                                                                                            /**
                                                                                             * Serializes the error into the JSON-safe {@link ErrorJson} payload for logging or reporting.
                                                                                             *
                                                                                             * The payload always carries {@link BaseError.kind | kind} and the message. The cause's message
                                                                                             * is added only when {@link BaseError.originalError | originalError} is an `Error` and says
                                                                                             * something the message does not, truncated to 256 characters; any other cause is dropped.
                                                                                             * Subclasses extend the payload with the fields listed on their own pages.
                                                                                             *
                                                                                             * @returns The error as plain, JSON-serializable data.
                                                                                             * @example An HttpError from a request that was refused
                                                                                             * ```json
                                                                                             * {
                                                                                             *     "kind": "HttpError",
                                                                                             *     "code": "InsufficientCreditsError",
                                                                                             *     "message": "Account has insufficient credits",
                                                                                             *     "httpStatus": 402,
                                                                                             *     "endpoint": "/agt_x/chat/cht_y",
                                                                                             *     "method": "POST"
                                                                                             * }
                                                                                             * ```
                                                                                             * @example A NetworkError from a request that never left the browser
                                                                                             * ```json
                                                                                             * {
                                                                                             *     "kind": "NetworkError",
                                                                                             *     "message": "Network request failed",
                                                                                             *     "cause": "Failed to fetch",
                                                                                             *     "endpoint": "/agt_x/chat/cht_y",
                                                                                             *     "method": "POST",
                                                                                             *     "durationMs": 12,
                                                                                             *     "online": false,
                                                                                             *     "visibility": "visible"
                                                                                             * }
                                                                                             * ```
                                                                                             */
                                                                                            toJson(): ErrorJson;
                                                                                        }

                                                                                        /**
                                                                                         * A D-ID API key, sent with HTTP basic authentication.
                                                                                         *
                                                                                         * An API key from D-ID Studio has the form `API_USERNAME:API_PASSWORD`. Pass it whole as `token`,
                                                                                         * or split at the colon into `username` and `password`. It gives access to the whole account, so
                                                                                         * keep it on a server and never ship it in a page; use {@link ClientKeyAuth} in a browser. The SDK
                                                                                         * sends it as `Authorization: Basic <credentials>~<connectionId>`; the D-ID authorizer strips the
                                                                                         * per-connection id before it validates the key.
                                                                                         *
                                                                                         * @see [Basic authentication](https://docs.d-id.com/reference/basic-authentication)
                                                                                         *
                                                                                         * @category Authentication
                                                                                         */
                                                                                        export declare type BasicAuth = {
                                                                                            /**
                                                                                             * Discriminator selecting this variant of {@link Auth}.
                                                                                             */
                                                                                            type: 'basic';
                                                                                            /**
                                                                                             * The API key as D-ID Studio shows it (`API_USERNAME:API_PASSWORD`), or that string
                                                                                             * base64-encoded. Sent as given.
                                                                                             */
                                                                                            token: string;
                                                                                        } | {
                                                                                            /**
                                                                                             * Discriminator selecting this variant of {@link Auth}.
                                                                                             */
                                                                                            type: 'basic';
                                                                                            /**
                                                                                             * The part of the API key before the colon (`API_USERNAME`). It is not the account's
                                                                                             * email address.
                                                                                             */
                                                                                            username: string;
                                                                                            /**
                                                                                             * The part of the API key after the colon (`API_PASSWORD`).
                                                                                             */
                                                                                            password: string;
                                                                                        };

                                                                                        /**
                                                                                         * A D-ID user access token: the short-lived token a signed-in D-ID user holds.
                                                                                         *
                                                                                         * It is what D-ID's own applications use. An integration authenticates with an API key
                                                                                         * ({@link BasicAuth}) on a server, or with a client key ({@link ClientKeyAuth}) in a browser. The
                                                                                         * SDK sends it as `Authorization: Bearer <token>~<connectionId>`; the D-ID authorizer strips the
                                                                                         * per-connection id before it validates the token.
                                                                                         *
                                                                                         * @category Authentication
                                                                                         */
                                                                                        export declare interface BearerToken {
                                                                                            /**
                                                                                             * Discriminator selecting this variant of {@link Auth}.
                                                                                             */
                                                                                            type: 'bearer';
                                                                                            /**
                                                                                             * The bearer token itself, sent in the `Authorization` header.
                                                                                             */
                                                                                            token: string;
                                                                                        }

                                                                                        /**
                                                                                         * A chat could not be created for the session.
                                                                                         *
                                                                                         * {@link AgentManager.chat | chat()} creates a chat on the first message when the session does not
                                                                                         * have one yet; this error is thrown when that call comes back without one, so it rejects the
                                                                                         * promise `chat()` returned and the user's message is not sent. It is not delivered to
                                                                                         * {@link AgentManagerCallbacks.onError | onError} — catch it around `chat()`. A failing request
                                                                                         * surfaces as {@link HttpError} or {@link NetworkError} instead; this error is the case where the
                                                                                         * request succeeded but produced no chat.
                                                                                         *
                                                                                         * The message names the {@link ChatMode} in effect and whether a persistent chat was asked for, for
                                                                                         * example `Failed to create persistent chat, mode: Functional`.
                                                                                         * {@link BaseError.kind | kind} is `'ChatCreationFailed'`.
                                                                                         *
                                                                                         * @category Errors
                                                                                         */
                                                                                        export declare class ChatCreationFailed extends BaseError {
                                                                                            /**
                                                                                             * Always `'ChatCreationFailed'`. Branch on it to tell this failure from the other SDK errors.
                                                                                             */
                                                                                            readonly kind: 'ChatCreationFailed';
                                                                                        }

                                                                                        /**
                                                                                         * How the agent answers: with a streamed video, as text only, or not at all.
                                                                                         *
                                                                                         * Chosen with {@link AgentManagerOptions.mode | mode} and changed later with
                                                                                         * {@link AgentManager.changeMode | changeMode()}, which reports the new value through
                                                                                         * {@link AgentManagerCallbacks.onModeChange | onModeChange}. Switching to anything other than
                                                                                         * {@link ChatMode.Functional} disconnects the stream, and switching *into*
                                                                                         * {@link ChatMode.Functional} disconnects it too when the open session cannot carry a conversation
                                                                                         * — call {@link AgentManager.connect | connect()} again after either.
                                                                                         *
                                                                                         * What the mode decides is narrower than it looks: whether a chat is created for the session, and
                                                                                         * whether {@link AgentManager.connect | connect()} opens the notifications web socket — which is
                                                                                         * exactly why a session built for one mode may not serve another. The video stream is established
                                                                                         * in every mode, and every guard reads the mode the session is in at the time of the call, not the
                                                                                         * one {@link createAgentManager} was given.
                                                                                         *
                                                                                         * The server can also answer with a different mode than the one asked for when the chat is created;
                                                                                         * the SDK then adopts it and reports a {@link ChatModeDowngraded} error through
                                                                                         * {@link AgentManagerCallbacks.onError | onError}.
                                                                                         *
                                                                                         * @category Chat
                                                                                         */
                                                                                        export declare enum ChatMode {
                                                                                            /**
                                                                                             * Chat and video: the agent answers questions with its own LLM, in a streamed video.
                                                                                             *
                                                                                             * The default when {@link AgentManagerOptions.mode | mode} is omitted, and the only mode a
                                                                                             * session can be in while a stream is connected and chat is available at the same time:
                                                                                             * {@link AgentManager.changeMode | changeMode()} to any other value disconnects the stream.
                                                                                             */
                                                                                            Functional = "Functional",
                                                                                            /**
                                                                                             * Text answers only: the chat works over the Agents API, but no video is produced.
                                                                                             *
                                                                                             * A fallback the server sets, for example when the account is out of credits; the SDK adopts
                                                                                             * it and reports it through {@link AgentManagerCallbacks.onModeChange | onModeChange}. Talks
                                                                                             * (V2) and Clips (V3) agents only.
                                                                                             */
                                                                                            TextOnly = "TextOnly",
                                                                                            /**
                                                                                             * The agent is unavailable: {@link AgentManager.chat | chat()} throws a
                                                                                             * {@link ValidationError}.
                                                                                             *
                                                                                             * The SDK switches to it by itself when connecting fails after its retries, so a UI can show
                                                                                             * that the agent is temporarily out of service; the server can also return it when a chat is
                                                                                             * created. Like {@link ChatMode.TextOnly} it produces no video.
                                                                                             */
                                                                                            Maintenance = "Maintenance",
                                                                                            /**
                                                                                             * A text-only test conversation, used by the agent playground in D-ID Studio.
                                                                                             *
                                                                                             * Produces no video, and marks each chat request with a playground header so the Agents API
                                                                                             * can treat it as a test. Chats in this mode always go over the Agents API, even for
                                                                                             * Expressive (V4) agents, which otherwise chat over the data channel. Applications normally
                                                                                             * use {@link ChatMode.Functional} or {@link ChatMode.TextOnly} instead.
                                                                                             */
                                                                                            Playground = "Playground",
                                                                                            /**
                                                                                             * Speak-only: no chat is created and no notifications web socket is opened, while video still
                                                                                             * streams. Use it when the application drives the agent entirely through
                                                                                             * {@link AgentManager.speak | speak()}.
                                                                                             *
                                                                                             * Talks (V2) and Clips (V3) agents only; rejected with a {@link ValidationError} for Expressive
                                                                                             * (V4) agents. {@link AgentManager.chat | chat()} rejects with a {@link ValidationError} in
                                                                                             * this mode.
                                                                                             */
                                                                                            DirectPlayback = "DirectPlayback",
                                                                                            /**
                                                                                             * Chat is switched off: no chat is created for the session, while video still streams. Unlike
                                                                                             * {@link ChatMode.DirectPlayback} it keeps the notifications web socket.
                                                                                             *
                                                                                             * Talks (V2) and Clips (V3) agents only; rejected with a {@link ValidationError} for Expressive
                                                                                             * (V4) agents. {@link AgentManager.chat | chat()} rejects with a {@link ValidationError} in
                                                                                             * this mode.
                                                                                             */
                                                                                            Off = "Off"
                                                                                        }

                                                                                        /**
                                                                                         * The server created the chat in a mode that cannot stream video.
                                                                                         *
                                                                                         * Raised while {@link AgentManager.connect | connect()} runs on a Talks (V2) or Clips (V3) agent,
                                                                                         * when the chat the server created is in a mode other than the session's (`Functional` by default)
                                                                                         * and that mode is not {@link ChatMode.Functional | Functional}: {@link ChatMode.TextOnly | TextOnly}
                                                                                         * or {@link ChatMode.Maintenance | Maintenance}, for instance. The SDK
                                                                                         * disconnects the stream it had just opened and `connect()` resolves anyway, so no video will play
                                                                                         * and {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} will not fire again: the
                                                                                         * session continues as a text chat.
                                                                                         *
                                                                                         * It is delivered to {@link AgentManagerCallbacks.onError | onError} and never thrown, so
                                                                                         * `connect()` does not reject on it.
                                                                                         * {@link AgentManagerCallbacks.onModeChange | onModeChange} fires with the new mode just after it.
                                                                                         * Treat it as a signal to switch the interface to text, not as a connection failure.
                                                                                         * {@link BaseError.kind | kind} is `'ChatModeDowngraded'`.
                                                                                         *
                                                                                         * @category Errors
                                                                                         */
                                                                                        export declare class ChatModeDowngraded extends BaseError {
                                                                                            /**
                                                                                             * Always `'ChatModeDowngraded'`. Branch on it to tell this failure from the other SDK errors.
                                                                                             */
                                                                                            readonly kind: 'ChatModeDowngraded';
                                                                                        }

                                                                                        /**
                                                                                         * What the Agents API answers a chat request with.
                                                                                         *
                                                                                         * Returned by {@link AgentManager.chat | chat()}. The SDK has already added the answer to the
                                                                                         * transcript by the time you get it, so most applications render
                                                                                         * {@link AgentManagerCallbacks.onNewMessage | onNewMessage} instead and use this only for the
                                                                                         * fields that never reach a {@link Message}. Expressive (V4) agents chat over the data channel
                                                                                         * rather than over the Agents API — except in {@link ChatMode.Playground} — so for them the
                                                                                         * object is empty and the answer arrives through the callback.
                                                                                         *
                                                                                         * @category Chat
                                                                                         */
                                                                                        export declare interface ChatResponse {
                                                                                            /**
                                                                                             * The agent's answer.
                                                                                             *
                                                                                             * Empty or absent when the answer is delivered as it is generated instead, which is what
                                                                                             * streaming modes do; the SDK then adds no message for it and the text arrives through
                                                                                             * {@link AgentManagerCallbacks.onNewMessage | onNewMessage}.
                                                                                             */
                                                                                            result?: string;
                                                                                            /**
                                                                                             * The Agents API's own list of ids for the documents behind the answer. The SDK never reads it;
                                                                                             * {@link ChatResponse.matches | matches} is what it keeps on the message.
                                                                                             */
                                                                                            documentIds?: string[];
                                                                                            /**
                                                                                             * The knowledge citations behind the answer.
                                                                                             *
                                                                                             * Copied onto the answer as {@link Message.matches | matches}.
                                                                                             */
                                                                                            matches?: RetrievalMetadata[];
                                                                                            /**
                                                                                             * The {@link ChatMode} the server handled the request in.
                                                                                             *
                                                                                             * It can differ from the mode that was asked for — see {@link ChatMode}.
                                                                                             */
                                                                                            chatMode?: ChatMode;
                                                                                            /**
                                                                                             * The retrieved context the answer was generated from.
                                                                                             *
                                                                                             * Copied onto the answer as {@link Message.context | context}.
                                                                                             */
                                                                                            context?: string;
                                                                                            /** Id of the video generated for the answer, when the server reported one. */
                                                                                            videoId?: string;
                                                                                        }

                                                                                        /**
                                                                                         * A client key for the Agents API — the credential to use in a browser.
                                                                                         *
                                                                                         * This is the one credential that is safe to ship in a page: a client key works for one agent,
                                                                                         * and only from the domains allowed for it. Copy it from the agent's Embed snippet, where it
                                                                                         * appears as `data-client-key`, or create one with the Agents API (see the link below). The SDK
                                                                                         * sends it as `Authorization: Client-Key <clientKey>.<externalId>_<connectionId>`, where the external id is
                                                                                         * either {@link AgentManagerOptions.externalId | externalId} or a per-browser id the SDK keeps in
                                                                                         * `localStorage`.
                                                                                         *
                                                                                         * @see [Create an agent client key](https://docs.d-id.com/reference/createresourceclientkey)
                                                                                         * @category Authentication
                                                                                         */
                                                                                        export declare interface ClientKeyAuth {
                                                                                            /**
                                                                                             * Discriminator selecting this variant of {@link Auth}.
                                                                                             */
                                                                                            type: 'key';
                                                                                            /**
                                                                                             * The client key: the `data-client-key` value from the agent's Embed snippet, or a key created with
                                                                                             * the Agents API.
                                                                                             */
                                                                                            clientKey: string;
                                                                                        }

                                                                                        /**
                                                                                         * A client tool's implementation: the function that runs in the browser when the agent calls it.
                                                                                         *
                                                                                         * Register it with {@link AgentManager.registerClientTool | registerClientTool()}, under the tool
                                                                                         * name defined in the agent's configuration. The SDK parses the arguments the agent's LLM produced
                                                                                         * and passes them in; whatever the handler resolves with is sent back to the agent as the tool's
                                                                                         * result. Throwing rejects the call, and the error message (at most 256 bytes) is forwarded to the
                                                                                         * agent. The server gives a handler 10 seconds unless the tool's configuration sets a `timeout`.
                                                                                         * Expressive (V4) agents only: {@link AgentManager.registerClientTool | registerClientTool()}
                                                                                         * throws a {@link ValidationError} on a Talks (V2) or Clips (V3) agent.
                                                                                         *
                                                                                         * @param args - The arguments the LLM produced for this call, already parsed from JSON.
                                                                                         * @returns The tool's result as a string, at most 15 KiB (the LiveKit RPC response limit; a larger
                                                                                         * result fails the call). Return JSON: the server parses it, and passes other text on as it is. A synchronous handler may return the string
                                                                                         * directly; the SDK awaits the result either way.
                                                                                         * @example
                                                                                         * ```ts
                                                                                         * agentManager.registerClientTool('get_cart_total', async args => {
                                                                                         *     const total = await cart.total(args.currency as string);
                                                                                         *     return JSON.stringify({ total });
                                                                                         * });
                                                                                         *
                                                                                         * // Nothing to await: the string is enough.
                                                                                         * agentManager.registerClientTool('get_locale', () => JSON.stringify({ locale: navigator.language }));
                                                                                         * ```
                                                                                         * @category Callbacks & Events
                                                                                         */
                                                                                        export declare type ClientToolHandler = (args: Record<string, unknown>) => string | Promise<string>;

                                                                                        /**
                                                                                         * Which video codec the stream should negotiate.
                                                                                         *
                                                                                         * Passed as {@link StreamOptions.compatibilityMode}. `on` forces VP8 and `off` forces H264; with
                                                                                         * `auto` the SDK forwards the flag and the codec is selected according to the browser. Talks (V2)
                                                                                         * and Clips (V3) agents only — Expressive (V4) agents negotiate the codec themselves and ignore
                                                                                         * the setting.
                                                                                         *
                                                                                         * @category Streaming Options
                                                                                         */
                                                                                        export declare type CompatibilityMode = 'on' | 'off' | 'auto';

                                                                                        /**
                                                                                         * The state of the connection between the browser and the agent's stream.
                                                                                         *
                                                                                         * The first argument of
                                                                                         * {@link AgentManagerCallbacks.onConnectionStateChange | onConnectionStateChange}.
                                                                                         * {@link ConnectionState.Connected | 'connected'} is the point at which
                                                                                         * {@link AgentManager.chat | chat()} and {@link AgentManager.speak | speak()} can be called.
                                                                                         *
                                                                                         * Every agent type reports `'connecting'`, `'connected'`, `'fail'` and `'disconnected'`; `'new'`,
                                                                                         * `'completed'` and `'closed'` are WebRTC ICE states that only Talks (V2) and Clips (V3) agents
                                                                                         * reach, and `'disconnecting'` is Expressive (V4) only.
                                                                                         *
                                                                                         * @category Callbacks & Events
                                                                                         */
                                                                                        export declare enum ConnectionState {
                                                                                            /** The connection object exists but nothing has been negotiated yet. */
                                                                                            New = "new",
                                                                                            /** The connection could not be established, or dropped irrecoverably. */
                                                                                            Fail = "fail",
                                                                                            /** The stream is live: the agent can be spoken to and its video rendered. */
                                                                                            Connected = "connected",
                                                                                            /** The connection is being established, or re-established after a drop. */
                                                                                            Connecting = "connecting",
                                                                                            /** The connection has been shut down and cannot be used again. */
                                                                                            Closed = "closed",
                                                                                            /**
                                                                                             * Negotiation finished and the connection is fully established.
                                                                                             *
                                                                                             * It is reached after {@link ConnectionState.Connected | 'connected'}, so gate the application
                                                                                             * on that one instead: it is the state every agent type reports.
                                                                                             */
                                                                                            Completed = "completed",
                                                                                            /**
                                                                                             * {@link AgentManager.disconnect | disconnect()} is in progress.
                                                                                             *
                                                                                             * Expressive (V4) agents only; Talks (V2) and Clips (V3) go straight from
                                                                                             * {@link ConnectionState.Connected | 'connected'} to
                                                                                             * {@link ConnectionState.Disconnected | 'disconnected'}.
                                                                                             */
                                                                                            Disconnecting = "disconnecting",
                                                                                            /**
                                                                                             * The stream has ended.
                                                                                             *
                                                                                             * The `reason` argument of
                                                                                             * {@link AgentManagerCallbacks.onConnectionStateChange | onConnectionStateChange} says why —
                                                                                             * a {@link StreamEndReason} when the server ended the session deliberately. Reconnecting with
                                                                                             * {@link AgentManager.reconnect | reconnect()} starts a new stream.
                                                                                             */
                                                                                            Disconnected = "disconnected"
                                                                                        }

                                                                                        /**
                                                                                         * How well the streamed media is reaching the user.
                                                                                         *
                                                                                         * The argument of
                                                                                         * {@link AgentManagerCallbacks.onConnectivityStateChange | onConnectivityStateChange}. It is
                                                                                         * estimated from the session's own media statistics — jitter-buffer delay and freeze count for
                                                                                         * Talks (V2) and Clips (V3), the transport's reported connection quality for Expressive (V4) — so
                                                                                         * it reflects what this stream is actually getting rather than whether the browser is online.
                                                                                         *
                                                                                         * @category Callbacks & Events
                                                                                         */
                                                                                        export declare enum ConnectivityState {
                                                                                            /** The stream is arriving smoothly. */
                                                                                            Strong = "STRONG",
                                                                                            /** The stream is degraded: video is stalling or arriving late. */
                                                                                            Weak = "WEAK",
                                                                                            /** There is not enough data to judge the connection yet, or the stream stopped arriving. */
                                                                                            Unknown = "UNKNOWN"
                                                                                        }

                                                                                        /**
                                                                                         * Creates an {@link AgentManager} for one agent: its chat, its video stream and its connections.
                                                                                         *
                                                                                         * Fetches the agent from the Agents API before it resolves, so the returned manager already has
                                                                                         * {@link AgentManager.agent | agent} and {@link AgentManager.starterMessages | starterMessages}
                                                                                         * filled in. No stream is opened until {@link AgentManager.connect | connect()} is called.
                                                                                         * Two options are checked here, and both reject with a {@link ValidationError}: an Expressive (V4)
                                                                                         * agent asked for {@link ChatMode.Off} or {@link ChatMode.DirectPlayback}, which only Talks (V2)
                                                                                         * and Clips (V3) agents support; and
                                                                                         * {@link AgentManagerOptions.callbacks | callbacks} without
                                                                                         * {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} in a mode that streams video —
                                                                                         * that callback is what attaches the streamed media to a video element, and only
                                                                                         * {@link ChatMode.TextOnly}, {@link ChatMode.Playground} and {@link ChatMode.Maintenance} can do
                                                                                         * without it. Every other bad argument surfaces later, as a {@link ValidationError} rejected by the
                                                                                         * method that was called on the returned manager, such as
                                                                                         * {@link AgentManager.chat | chat()} or {@link AgentManager.speak | speak()}.
                                                                                         *
                                                                                         * @param agent - Id of the agent to talk to: the `data-agent-id` from its Embed snippet, or the `id`
                                                                                         * returned by the Agents API.
                                                                                         * @param options - Credentials, callbacks and everything else the manager needs. See
                                                                                         * {@link AgentManagerOptions}.
                                                                                         * @returns A manager for that agent, ready to {@link AgentManager.connect | connect()}.
                                                                                         * @throws {@link ValidationError} When an Expressive (V4) agent is created with
                                                                                             * {@link ChatMode.Off} or {@link ChatMode.DirectPlayback}, or when
                                                                                             * {@link AgentManagerCallbacks.onSrcObjectReady | onSrcObjectReady} is missing in a mode that
                                                                                             * streams video.
                                                                                             * @throws {@link HttpError} When the agent cannot be fetched — an unknown id, or a client key that
                                                                                                 * is not authorized for the agent or the calling domain.
                                                                                                 * @throws {@link NetworkError} When the request for the agent never reaches the server: the browser
                                                                                                     * is offline, DNS or TLS fails, or the request is blocked.
                                                                                                     *
                                                                                                     * @example
                                                                                                     * ```ts
                                                                                                     * import * as sdk from '@d-id/client-sdk';
                                                                                                     *
                                                                                                     * const agentManager = await sdk.createAgentManager('agt_fumf1234', {
                                                                                                     *     auth: { type: 'key', clientKey: 'YOUR_CLIENT_KEY' },
                                                                                                     *     callbacks: {
                                                                                                     *         // Hand the streamed media to your video element. Required in every mode that
                                                                                                     *         // streams video, which is every mode but TextOnly, Playground and Maintenance.
                                                                                                     *         onSrcObjectReady(value) {
                                                                                                     *             videoElement.srcObject = value;
                                                                                                     *         },
                                                                                                     *     },
                                                                                                     * });
                                                                                                     *
                                                                                                     * await agentManager.connect();
                                                                                                     * await agentManager.chat('What is the distance to the moon?');
                                                                                                     * ```
                                                                                                     *
                                                                                                     * @category Agent Manager
                                                                                                     */
                                                                                                 export declare function createAgentManager(agent: string, options: AgentManagerOptions): Promise<AgentManager>;

                                                                                                 /**
                                                                                                  * The data-channel topics an application may send on with
                                                                                                  * {@link AgentManager.sendDataChannelMessage | sendDataChannelMessage()}.
                                                                                                  *
                                                                                                  * The remaining data-channel topics are driven by their own methods
                                                                                                  * ({@link AgentManager.chat | chat()}, {@link AgentManager.speak | speak()},
                                                                                                  * {@link AgentManager.interrupt | interrupt()},
                                                                                                  * {@link AgentManager.setSttLanguage | setSttLanguage()}), which own the payload shape and
                                                                                                  * bookkeeping those topics expect, so they stay internal.
                                                                                                  *
                                                                                                  * The members' values are the wire strings. Take the value from the enum rather than writing the
                                                                                                  * string out, so the wire string stays in one place. Expressive (V4) agents only.
                                                                                                  *
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * import { DataChannelTopic } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * await agentManager.sendDataChannelMessage(DataChannelTopic.Presentation, {
                                                                                                  *     type: 'navigate',
                                                                                                  *     slide: 3,
                                                                                                  * });
                                                                                                  * ```
                                                                                                  * @category Agent Manager
                                                                                                  */
                                                                                                 export declare enum DataChannelTopic {
                                                                                                     /**
                                                                                                      * Tells the agent which slide the user moved to in the deck it is presenting. Sent on the wire
                                                                                                      * as `did.presentation`. The only payload the agent reads is
                                                                                                      * `{ type: 'navigate', slide: <integer> }`; anything else, or any message while the agent has
                                                                                                      * no deck, is ignored.
                                                                                                      */
                                                                                                     Presentation = "did.presentation"
                                                                                                 }

                                                                                                 /**
                                                                                                  * Every error the SDK raises, as a union — what {@link isDIDError} narrows a caught value to.
                                                                                                  *
                                                                                                  * Each member declares {@link BaseError.kind | kind} as a different literal, so a `switch` on
                                                                                                  * `kind` inside an `isDIDError` branch narrows the value to one class and gives typed access to
                                                                                                  * that class's own fields — {@link HttpError.status | status} and {@link HttpError.code | code} on
                                                                                                  * an {@link HttpError}, {@link ValidationError.key | key} on a {@link ValidationError}, and so on.
                                                                                                  * The `default` branch of an exhaustive `switch` is `never` to the type checker.
                                                                                                  *
                                                                                                  * Keep that branch total anyway. {@link isDIDError} recognizes any `Error` carrying a string
                                                                                                  * `kind`, which is what lets it see across a bundle boundary, so a value built by a different copy
                                                                                                  * of the SDK — a 2.x `HttpError`, whose `kind` was the server's classification — can reach the
                                                                                                  * `default` branch at runtime with a `kind` outside this union.
                                                                                                  *
                                                                                                  * {@link BaseError} itself is deliberately not a member: its `kind` is a plain `string`, which
                                                                                                  * matches every literal and would stop the narrowing from working.
                                                                                                  *
                                                                                                  * @example Branching on a caught error
                                                                                                  * ```ts
                                                                                                  * import { isDIDError, type DIDError } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * try {
                                                                                                  *     await agentManager.connect();
                                                                                                  * } catch (error) {
                                                                                                  *     if (!isDIDError(error)) {
                                                                                                  *         throw error;
                                                                                                  *     }
                                                                                                  *
                                                                                                  *     switch (error.kind) {
                                                                                                  *         case 'HttpError':
                                                                                                  *             console.error(error.status, error.code);
                                                                                                  *             break;
                                                                                                  *         case 'NetworkError':
                                                                                                  *             console.error('offline?', error.endpoint);
                                                                                                  *             break;
                                                                                                  *         default:
                                                                                                  *             // Total on purpose: `kind` is `never` here to the type checker, but a value from
                                                                                                  *             // another copy of the SDK can still land in this branch.
                                                                                                  *             console.error(error.kind, error.message);
                                                                                                  *     }
                                                                                                  * }
                                                                                                  * ```
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare type DIDError = HttpError | NetworkError | StreamError | WsError | ValidationError | ChatCreationFailed | ChatModeDowngraded;

                                                                                                 /**
                                                                                                  * Selects an ElevenLabs voice for {@link TextStreamScript.provider}. Available on paid plans.
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare interface ElevenlabsTtsProvider {
                                                                                                     /** `'elevenlabs'`, or {@link Providers.Elevenlabs}. */
                                                                                                     type: `${Providers.Elevenlabs}`;
                                                                                                     /**
                                                                                                      * Id of the voice to speak with, from D-ID's list of ElevenLabs voices.
                                                                                                      *
                                                                                                      * @example "21m00Tcm4TlvDq8ikWAM"
                                                                                                      * @see [ElevenLabs voices](https://docs.d-id.com/docs/tts-elevenlabs)
                                                                                                      */
                                                                                                     voice_id: string;
                                                                                                     /** Voice settings; see {@link VoiceConfigElevenlabs}. */
                                                                                                     voice_config?: VoiceConfigElevenlabs;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The end-of-call feedback form configured on an agent.
                                                                                                  *
                                                                                                  * It describes what to ask the user when the conversation ends; the SDK does not render anything
                                                                                                  * itself. Read it from {@link Agent.end_of_call_feedback}, show your own form when
                                                                                                  * {@link EndOfCallFeedbackConfig.enabled | enabled} is set, and send the result with
                                                                                                  * {@link AgentManager.submitFeedback | submitFeedback()}.
                                                                                                  *
                                                                                                  * @category Agent Manager
                                                                                                  */
                                                                                                 export declare interface EndOfCallFeedbackConfig {
                                                                                                     /** Whether the agent is configured to ask for feedback when a call ends. */
                                                                                                     enabled: boolean;
                                                                                                     /** The line to show the user as the call ends, before the rating is asked for. */
                                                                                                     closing_message?: string;
                                                                                                     /** Whether a free-text follow-up question should be asked after the rating. */
                                                                                                     follow_up_enabled?: boolean;
                                                                                                     /**
                                                                                                      * The follow-up question to ask, chosen by the score the user gave.
                                                                                                      *
                                                                                                      * Whichever one you show is what {@link AgentManager.submitFeedback | submitFeedback()} records
                                                                                                      * as {@link SubmitFeedbackResponse.question_shown | question_shown}.
                                                                                                      */
                                                                                                     follow_up_messages?: {
                                                                                                         /** Question for a score at the low end of the scale. */
                                                                                                         low?: string;
                                                                                                         /** Question for a score of 4. */
                                                                                                         four?: string;
                                                                                                         /** Question for a score of 5. */
                                                                                                         five?: string;
                                                                                                     };
                                                                                                 }

                                                                                                 /**
                                                                                                  * What the SDK knows about where a failure happened, beyond the error itself.
                                                                                                  *
                                                                                                  * The second argument of {@link AgentManagerCallbacks.onError | onError}. Which fields are set
                                                                                                  * follows from the call that failed, not from the class of the error:
                                                                                                  *
                                                                                                  * - a failed Agents API request — an {@link HttpError} or a {@link NetworkError} — sets
                                                                                                  *   {@link ErrorContext.endpoint | endpoint} and {@link ErrorContext.method | method};
                                                                                                  * - a failure on an Expressive (V4) session sets {@link ErrorContext.sessionId | sessionId};
                                                                                                  * - a failure on a Talks (V2) or Clips (V3) stream sets {@link ErrorContext.streamId | streamId}.
                                                                                                  *
                                                                                                  * Nothing else is passed. In particular the request body and headers are not: the body is the end
                                                                                                  * user's own message, and applications routinely forward this argument straight to an error
                                                                                                  * reporter. The error is the thing to log — {@link BaseError.toJson | toJson()} renders it with
                                                                                                  * the same request fields already redacted — and this is context to attach alongside it.
                                                                                                  *
                                                                                                  * Every field is optional, so read them with a guard — and the whole argument is optional too: a
                                                                                                  * failure the SDK has no context for is reported with an empty object, or with no second argument
                                                                                                  * at all.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare interface ErrorContext {
                                                                                                     /**
                                                                                                      * Path of the Agents API request that failed, relative to the API host.
                                                                                                      *
                                                                                                      * The same value as {@link HttpError.endpoint} and {@link NetworkError.endpoint} on the error
                                                                                                      * itself.
                                                                                                      */
                                                                                                     endpoint?: string;
                                                                                                     /** HTTP method of the request that failed, such as `GET` or `POST`. */
                                                                                                     method?: string;
                                                                                                     /**
                                                                                                      * Id of the Expressive (V4) session the failure happened on.
                                                                                                      *
                                                                                                      * The same value {@link AgentManagerCallbacks.onStreamCreated | onStreamCreated} reported as
                                                                                                      * {@link StreamCreatedInfo.sessionId}, and {@link AgentManager.getSessionInfo | getSessionInfo()}
                                                                                                      * returns.
                                                                                                      */
                                                                                                     sessionId?: string;
                                                                                                     /**
                                                                                                      * Id of the Talks (V2) or Clips (V3) stream the failure happened on.
                                                                                                      *
                                                                                                      * The same value {@link AgentManagerCallbacks.onStreamCreated | onStreamCreated} reported as
                                                                                                      * {@link StreamCreatedInfo.streamId}.
                                                                                                      */
                                                                                                     streamId?: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The JSON-safe payload {@link BaseError.toJson | toJson()} produces, for logs and error reports.
                                                                                                  *
                                                                                                  * Only the fields the SDK deliberately exposes are present, so the payload can be forwarded to a
                                                                                                  * logging service as it is. Subclasses add their own keys: {@link HttpError} adds `code` and
                                                                                                  * `httpStatus` and, when the failing call is known, `endpoint` and `method`; {@link NetworkError}
                                                                                                  * adds `endpoint`, `method`, `durationMs`, `online` and `visibility`.
                                                                                                  *
                                                                                                  * @example An HttpError from a request that was refused
                                                                                                  * ```json
                                                                                                  * {
                                                                                                  *     "kind": "HttpError",
                                                                                                  *     "code": "InsufficientCreditsError",
                                                                                                  *     "message": "Account has insufficient credits",
                                                                                                  *     "httpStatus": 402,
                                                                                                  *     "endpoint": "/agt_x/chat/cht_y",
                                                                                                  *     "method": "POST"
                                                                                                  * }
                                                                                                  * ```
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare interface ErrorJson {
                                                                                                     /**
                                                                                                      * Stable machine-readable code for the failure — the error's {@link BaseError.kind | kind}.
                                                                                                      */
                                                                                                     kind: string;
                                                                                                     /**
                                                                                                      * Human-readable description of the failure — the error's `message`.
                                                                                                      */
                                                                                                     message: string;
                                                                                                     /**
                                                                                                      * Message of the error that caused this one, truncated to 256 characters.
                                                                                                      *
                                                                                                      * Present only when {@link BaseError.originalError | originalError} is an `Error` and its
                                                                                                      * message differs from {@link ErrorJson.message | message}. A cause that is not an `Error` is
                                                                                                      * never serialized, so an arbitrary object carrying credentials cannot end up in the payload.
                                                                                                      */
                                                                                                     cause?: string;
                                                                                                     /**
                                                                                                      * The Agents API's own classification of the failure, from {@link HttpError.code | code}.
                                                                                                      *
                                                                                                      * Present on an {@link HttpError} only.
                                                                                                      */
                                                                                                     code?: string;
                                                                                                     /**
                                                                                                      * Additional fields contributed by a subclass, such as `httpStatus` on {@link HttpError}.
                                                                                                      *
                                                                                                      * Typed `unknown`, so a key that is not declared above has to be narrowed before it is used.
                                                                                                      */
                                                                                                     [key: string]: unknown;
                                                                                                 }

                                                                                                 /**
                                                                                                  * A request to the Agents API came back with a non-2xx status.
                                                                                                  *
                                                                                                  * Raised for every REST call the SDK makes on the application's behalf: fetching the agent in
                                                                                                  * {@link createAgentManager}, creating the stream and the chat during
                                                                                                  * {@link AgentManager.connect | connect()}, sending a message with
                                                                                                  * {@link AgentManager.chat | chat()}, and the rating and feedback calls. The same error is both
                                                                                                  * handed to {@link AgentManagerCallbacks.onError | onError} and thrown, so it also rejects the
                                                                                                  * promise of whichever method made the request — catch it around that call, or handle it centrally
                                                                                                  * in the callback. For the message-send request behind {@link AgentManager.chat | chat()} the
                                                                                                  * callback may not fire; the error is still thrown. Typical cases are `401` or `403` for a client
                                                                                                  * key that is not authorized for the agent or the calling domain, and `404` for an unknown agent
                                                                                                  * id; an account that is out of credits comes back with {@link HttpError.code | code}
                                                                                                  * `'InsufficientCreditsError'`. An agent that is still being built comes back with `409` and code
                                                                                                  * `'NotReadyError'`, and one whose build failed or was rejected with `409` and code
                                                                                                  * `'ConflictError'`. A `429` is retried twice, one second apart (three attempts in total), before it
                                                                                                  * surfaces.
                                                                                                  *
                                                                                                  * {@link BaseError.kind | kind} is always `'HttpError'`, so a `switch` on it narrows a caught value
                                                                                                  * to this class. The server's own classification lives on {@link HttpError.code | code} — the
                                                                                                  * `'InsufficientCreditsError'` above is one — so a message-independent branch on a specific API
                                                                                                  * failure is possible.
                                                                                                  *
                                                                                                  * The message is the envelope's `description` when the body is that JSON, and the raw body
                                                                                                  * otherwise — truncated to 256 characters either way, because a gateway can answer a 5xx with a
                                                                                                  * whole HTML page.
                                                                                                  *
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare class HttpError extends BaseError {
                                                                                                     /**
                                                                                                      * Always `'HttpError'`. Branch on it to tell this failure from the other SDK errors.
                                                                                                      */
                                                                                                     readonly kind: 'HttpError';
                                                                                                     /**
                                                                                                      * The Agents API's own classification of the failure — the `kind` from D-ID's
                                                                                                      * `{ kind, description }` error body — and `'HttpError'` when the response was not that
                                                                                                      * envelope.
                                                                                                      *
                                                                                                      * An account out of credits comes back as `'InsufficientCreditsError'`, for instance. It is a
                                                                                                      * plain `string` because the set is the API's, not the SDK's, and grows without an SDK release.
                                                                                                      * Use {@link HttpError.status | status} for the transport-level branch, this for the API-level
                                                                                                      * one, and {@link BaseError.kind | kind} to tell an `HttpError` from the SDK's other errors.
                                                                                                      */
                                                                                                     readonly code: string;
                                                                                                     /**
                                                                                                      * HTTP status code of the response, such as `401`, `404` or `500`.
                                                                                                      */
                                                                                                     readonly status: number;
                                                                                                     /**
                                                                                                      * Path of the request that failed, relative to the API client's base path — for example
                                                                                                      * `/agt_x/chat/cht_y` for a message sent to a chat.
                                                                                                      *
                                                                                                      * Absent when the error was constructed without call context. {@link NetworkError.endpoint}
                                                                                                      * is the same value on a transport failure.
                                                                                                      */
                                                                                                     readonly endpoint?: string;
                                                                                                     /**
                                                                                                      * HTTP method of the request that failed, such as `GET` or `POST`.
                                                                                                      *
                                                                                                      * Absent when the error was constructed without call context.
                                                                                                      */
                                                                                                     readonly method?: string;
                                                                                                     /**
                                                                                                      * Serializes the error, adding the failing call to what
                                                                                                      * {@link BaseError.toJson | BaseError.toJson()} already returns.
                                                                                                      *
                                                                                                      * Adds {@link HttpError.code | code}, `httpStatus` from {@link HttpError.status | status}, and
                                                                                                      * `endpoint` and `method` when the call context is known. The raw `status` property is
                                                                                                      * serialized as `httpStatus`.
                                                                                                      *
                                                                                                      * @returns The error as plain, JSON-serializable data.
                                                                                                      */
                                                                                                     toJson(): ErrorJson;
                                                                                                 }

                                                                                                 /**
                                                                                                  * What caused the user to interrupt the agent, passed to
                                                                                                  * {@link AgentManager.interrupt | interrupt()}.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare interface InterruptOptions {
                                                                                                     /**
                                                                                                      * The cause: `text` when the user typed over the answer, `audio` when they started speaking,
                                                                                                      * `click` when they pressed a stop control, and `manual` for an interruption the application
                                                                                                      * decided on itself.
                                                                                                      *
                                                                                                      * The SDK records it with the interruption for analytics. It changes behavior in one case
                                                                                                      * only: Expressive (V4) agents ignore a `text` interrupt, because their orchestrator does not
                                                                                                      * cancel the answer already in flight. Talks (V2) and Clips (V3) agents interrupt the current
                                                                                                      * video whatever the value.
                                                                                                      */
                                                                                                     type: 'text' | 'audio' | 'click' | 'manual';
                                                                                                 }

                                                                                                 /**
                                                                                                  * Whether the agent is waiting on a tool call before it can continue.
                                                                                                  *
                                                                                                  * True while any of the running calls is `blocking`; false when nothing is running, or when
                                                                                                  * everything running is `async` and the agent can keep talking. Pass it the array
                                                                                                  * {@link AgentManagerCallbacks.onRunningToolCallsChange | onRunningToolCallsChange} hands you, to
                                                                                                  * decide whether to show the user that the agent is busy.
                                                                                                  *
                                                                                                  * @param calls - The tool calls running right now, as reported by
                                                                                                  * {@link AgentManagerCallbacks.onRunningToolCallsChange | onRunningToolCallsChange}. See
                                                                                                  * {@link RunningToolCall}.
                                                                                                  * @returns `true` while the agent is suspended on a blocking tool call.
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * import { isAwaitingTool, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * const callbacks: AgentManagerCallbacks = {
                                                                                                  *     onRunningToolCallsChange(calls) {
                                                                                                  *         setSpinnerVisible(isAwaitingTool(calls));
                                                                                                  *     },
                                                                                                  * };
                                                                                                  * ```
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare function isAwaitingTool(calls: readonly RunningToolCall[]): boolean;

                                                                                                 /**
                                                                                                  * Type guard that reports whether a caught value is an error raised by the SDK.
                                                                                                  *
                                                                                                  * It accepts any `Error` carrying a string `kind`, which every {@link BaseError} has, so it also
                                                                                                  * recognizes SDK errors that crossed a bundle boundary, where `instanceof BaseError` can fail
                                                                                                  * because two copies of the class are loaded. It narrows to {@link DIDError}, the union of the
                                                                                                  * seven subclasses, so a `switch` on {@link BaseError.kind | kind} inside the branch narrows
                                                                                                  * further to one class and its own fields — `error.status` on an {@link HttpError},
                                                                                                  * `error.key` on a {@link ValidationError}.
                                                                                                  *
                                                                                                  * The duck-typing is wider than the union it promises, so keep the `default` branch of a `switch`
                                                                                                  * total — {@link DIDError} says why.
                                                                                                  *
                                                                                                  * @param error - The caught value to test.
                                                                                                  * @returns `true` when `error` is an error the SDK raised.
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * try {
                                                                                                  *     await agentManager.chat('What is the distance to the moon?');
                                                                                                  * } catch (error) {
                                                                                                  *     if (isDIDError(error)) {
                                                                                                  *         console.error(error.kind, error.toJson());
                                                                                                  *
                                                                                                  *         if (error.kind === 'HttpError' && error.status === 401) {
                                                                                                  *             refreshCredentials();
                                                                                                  *         }
                                                                                                  *     } else {
                                                                                                  *         throw error;
                                                                                                  *     }
                                                                                                  * }
                                                                                                  * ```
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare function isDIDError(error: unknown): error is DIDError;

                                                                                                 /**
                                                                                                  * One message of a chat: what the user asked, or what the agent answered.
                                                                                                  *
                                                                                                  * The SDK keeps the whole transcript and hands a fresh copy of it to
                                                                                                  * {@link AgentManagerCallbacks.onNewMessage | onNewMessage} every time a message is added or
                                                                                                  * changed, oldest first. While an answer streams in, the last message's
                                                                                                  * {@link Message.content | content} and {@link Message.parts | parts} are replaced with the latest
                                                                                                  * text on each `partial` callback — not appended to — and are final on `answer`. The same shape is
                                                                                                  * accepted by {@link AgentManagerOptions.initialMessages | initialMessages} to seed a transcript.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare interface Message {
                                                                                                     /**
                                                                                                      * Id of this message.
                                                                                                      *
                                                                                                      * Pass it to {@link AgentManager.rate | rate()} to rate the answer. The SDK generates a random
                                                                                                      * id for the messages it creates locally, and uses the id sent with the message for those that
                                                                                                      * arrive from the agent.
                                                                                                      */
                                                                                                     id: string;
                                                                                                     /**
                                                                                                      * Who the message is from.
                                                                                                      *
                                                                                                      * The SDK itself only creates `user` (the end user) and `assistant` (the agent) messages; the
                                                                                                      * value on a transcribed or streamed message is whatever the server payload carried. `system`,
                                                                                                      * `function` and `tool` exist because the underlying chat protocol allows them.
                                                                                                      */
                                                                                                     role?: 'system' | 'assistant' | 'user' | 'function' | 'tool';
                                                                                                     /**
                                                                                                      * The message text.
                                                                                                      *
                                                                                                      * Plain text, which for agent answers may contain markdown. It is replaced by the latest text
                                                                                                      * on every `partial` callback while the answer streams in — and the final `answer` may be
                                                                                                      * shorter than the partials before it, which is exactly how the SDK spots an interruption — so
                                                                                                      * render it as it is rather than appending to what you rendered before.
                                                                                                      */
                                                                                                     content: string;
                                                                                                     /**
                                                                                                      * {@link Message.content | content} split into renderable pieces by {@link parseMessageParts}.
                                                                                                      *
                                                                                                      * Kept in step with `content` on every message the SDK creates, including while an answer
                                                                                                      * streams in. Render these instead of the raw string when the agent may answer with images,
                                                                                                      * videos or links; a message with no markup is a single `text` part, and an empty message is
                                                                                                      * an empty array.
                                                                                                      *
                                                                                                      * Optional because {@link AgentManagerOptions.initialMessages | initialMessages} take the same
                                                                                                      * shape, and a transcript restored from your own storage carries only the text: leave `parts`
                                                                                                      * out and the SDK runs the parser over `content` before the message reaches the transcript. A
                                                                                                      * non-empty array you built yourself is kept exactly as given. Every message the SDK delivers
                                                                                                      * through {@link AgentManagerCallbacks.onNewMessage | onNewMessage} has it set, seeded
                                                                                                      * `initialMessages` included, so a handler can read it without a guard.
                                                                                                      */
                                                                                                     parts?: MessagePart[];
                                                                                                     /**
                                                                                                      * When the message was added, as an ISO 8601 timestamp.
                                                                                                      *
                                                                                                      * Optional for the same reason as {@link Message.parts | parts} — a restored transcript need
                                                                                                      * not carry one — but set on every message the SDK builds itself, which is every message that
                                                                                                      * reaches {@link AgentManagerCallbacks.onNewMessage | onNewMessage} other than a seeded
                                                                                                      * {@link AgentManagerOptions.initialMessages | initialMessage} that arrived without one.
                                                                                                      */
                                                                                                     createdAt?: string;
                                                                                                     /**
                                                                                                      * The knowledge citations the answer was drawn from, as {@link RetrievalMetadata} entries.
                                                                                                      *
                                                                                                      * Present on an agent answer when the chat response carried them, so a UI can show its sources;
                                                                                                      * {@link AgentManager.rate | rate()} also sends them with a rating. The SDK strips this field
                                                                                                      * from the transcript it sends back to the Agents API with the next
                                                                                                      * {@link AgentManager.chat | chat()}.
                                                                                                      */
                                                                                                     matches?: ChatResponse['matches'];
                                                                                                     /**
                                                                                                      * The retrieved context the answer was generated from, as
                                                                                                      * {@link ChatResponse.context | the chat response} supplied it.
                                                                                                      *
                                                                                                      * Only ever set on an agent answer, and only when the answer came back from the Agents API.
                                                                                                      * Expressive (V4) agents chat over the data channel instead, so their answers carry no context
                                                                                                      * — except in {@link ChatMode.Playground}, which always takes the Agents API path.
                                                                                                      */
                                                                                                     context?: string;
                                                                                                     /**
                                                                                                      * `true` when the answer was cut short instead of being spoken to the end.
                                                                                                      *
                                                                                                      * Set on the last message by {@link AgentManager.interrupt | interrupt()}, and by the SDK when
                                                                                                      * the final answer turns out to be shorter than the partial text already received — which is
                                                                                                      * how it detects that the agent was interrupted mid-utterance.
                                                                                                      */
                                                                                                     interrupted?: boolean;
                                                                                                     /**
                                                                                                      * `true` when this user message came from speech-to-text rather than from
                                                                                                      * {@link AgentManager.chat | chat()}.
                                                                                                      *
                                                                                                      * It is what distinguishes an utterance the user spoke from one they typed.
                                                                                                      */
                                                                                                     transcribed?: boolean;
                                                                                                     /**
                                                                                                      * The sentiment the agent delivered this answer with, when the stream reported one.
                                                                                                      *
                                                                                                      * Taken from the metadata the server sends with the video it created, and attached to the most
                                                                                                      * recent agent answer. The SDK only ever fills it in from an Expressive (V4) session, and only
                                                                                                      * while {@link AgentManagerOptions.debug | debug} is enabled.
                                                                                                      */
                                                                                                     sentiment?: MessageSentiment;
                                                                                                 }

                                                                                                 /**
                                                                                                  * One renderable piece of a message: a run of text, an image, a video or a link.
                                                                                                  *
                                                                                                  * {@link parseMessageParts} splits a message's {@link Message.content | content} into these, and
                                                                                                  * the SDK keeps the result on {@link Message.parts}. Switch on `type` when rendering. Anything the
                                                                                                  * parser did not recognize is preserved verbatim as a `text` part, in its original order, and
                                                                                                  * nothing is dropped or reordered; a recognized image, video or link replaces the markup it was
                                                                                                  * written as, so the parts are not a concatenation of the original string.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare type MessagePart = {
                                                                                                     /** Discriminant: plain text that the parser found no markup in. */
                                                                                                     type: 'text';
                                                                                                     /** The text itself, exactly as it appeared in {@link Message.content}. */
                                                                                                     text: string;
                                                                                                 } | {
                                                                                                     /** Discriminant: an image, from markdown image syntax such as `![alt](url)`. */
                                                                                                     type: 'image';
                                                                                                     /** URL of the image. */
                                                                                                     src: string;
                                                                                                     /** The alt text from the markdown, or an empty string when it had none. */
                                                                                                     alt: string;
                                                                                                     /**
                                                                                                      * `image/gif` when the URL itself ends in `.gif`, ignoring case; absent otherwise.
                                                                                                      *
                                                                                                      * The check looks at the whole URL, so a query string or fragment suppresses it —
                                                                                                      * `cat.gif?v=2` carries no `mimeType`. Video detection differs: it strips both before
                                                                                                      * looking at the extension.
                                                                                                      */
                                                                                                     mimeType?: string;
                                                                                                 } | {
                                                                                                     /**
                                                                                                      * Discriminant: a video, either from thumbnail syntax (`[![alt](thumb)](video)`) or from
                                                                                                      * an image whose URL ends in `.mp4`, `.webm`, `.mkv`, `.mov`, `.m4v` or `.ogv` once any
                                                                                                      * query string and fragment have been stripped.
                                                                                                      */
                                                                                                     type: 'video';
                                                                                                     /** URL of the video file. */
                                                                                                     src: string;
                                                                                                     /** The alt text from the markdown, or an empty string when it had none. */
                                                                                                     alt: string;
                                                                                                     /** URL of the poster image, when the thumbnail syntax supplied one. */
                                                                                                     thumbnail?: string;
                                                                                                 } | {
                                                                                                     /** Discriminant: a link, from markdown `[label](url)` or from an HTML `<a href>`. */
                                                                                                     type: 'link';
                                                                                                     /** Target of the link. */
                                                                                                     href: string;
                                                                                                     /** The text shown for the link. */
                                                                                                     label: string;
                                                                                                 };

                                                                                                 /**
                                                                                                  * The sentiment an agent answer was delivered with, as the server reported it.
                                                                                                  *
                                                                                                  * The shape of {@link Message.sentiment}. It is an object rather than a string because the server
                                                                                                  * reports both the id of the sentiment it used and its name, where
                                                                                                  * {@link TextStreamScript.sentiment} — the sentiment the application *asks* for — is just the
                                                                                                  * name.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare interface MessageSentiment {
                                                                                                     /** Id of the sentiment, as the server sent it. */
                                                                                                     id: string;
                                                                                                     /** Name of the sentiment, as the server sent it. */
                                                                                                     name: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * Selects a Microsoft Azure voice for {@link TextStreamScript.provider}.
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare interface MicrosoftTtsProvider {
                                                                                                     /** `'microsoft'`, or {@link Providers.Microsoft}. */
                                                                                                     type: `${Providers.Microsoft}`;
                                                                                                     /**
                                                                                                      * Id of the voice to speak with, from D-ID's list of Microsoft Azure voices.
                                                                                                      *
                                                                                                      * @example "en-US-JennyNeural"
                                                                                                      * @see [Microsoft Azure voices](https://docs.d-id.com/docs/tts-microsoft)
                                                                                                      */
                                                                                                     voice_id: string;
                                                                                                     /**
                                                                                                      * How the voice should deliver the text: style, rate and pitch. See
                                                                                                      * {@link VoiceConfigMicrosoft}.
                                                                                                      */
                                                                                                     voice_config?: VoiceConfigMicrosoft;
                                                                                                 }

                                                                                                 /**
                                                                                                  * A request to the Agents API never reached the server, so no response came back.
                                                                                                  *
                                                                                                  * This is the transport failure counterpart of {@link HttpError}, where the server did answer: the
                                                                                                  * browser's `fetch` rejected outright because the device is offline, DNS or TLS failed, the
                                                                                                  * connection was refused or the request was blocked, for instance by CORS or an extension. Like
                                                                                                  * {@link HttpError} it is both handed to {@link AgentManagerCallbacks.onError | onError} and
                                                                                                  * thrown, so it also rejects the promise of the method that made the request; for the message-send
                                                                                                  * request behind {@link AgentManager.chat | chat()} the callback may not fire, but the error is
                                                                                                  * still thrown. A request the SDK cancelled itself is not reported this way — the browser's own
                                                                                                  * `AbortError` is rethrown unchanged.
                                                                                                  *
                                                                                                  * The message is always `'Network request failed'`; the browser's own wording, such as
                                                                                                  * `'Failed to fetch'`, is kept in {@link BaseError.originalError | originalError} and appears as
                                                                                                  * `cause` in {@link NetworkError.toJson | toJson()}. The remaining properties record what was
                                                                                                  * happening at the time, which is usually what distinguishes a dropped connection from a tab that
                                                                                                  * was backgrounded.
                                                                                                  *
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare class NetworkError extends BaseError {
                                                                                                     /**
                                                                                                      * Always `'NetworkError'`. Branch on it to tell this failure from the other SDK errors.
                                                                                                      */
                                                                                                     readonly kind: 'NetworkError';
                                                                                                     /**
                                                                                                      * Path of the request that failed, relative to the API client's base path — for example
                                                                                                      * `/agt_x/chat/cht_y`.
                                                                                                      */
                                                                                                     readonly endpoint?: string;
                                                                                                     /**
                                                                                                      * HTTP method of the request that failed, such as `GET` or `POST`.
                                                                                                      */
                                                                                                     readonly method?: string;
                                                                                                     /**
                                                                                                      * How long the request ran before it failed, in milliseconds.
                                                                                                      *
                                                                                                      * A value close to zero usually means the request never left the browser; a large one points
                                                                                                      * at a connection that was established and then lost.
                                                                                                      */
                                                                                                     readonly durationMs?: number;
                                                                                                     /**
                                                                                                      * The browser's `navigator.onLine` at the moment of the failure — `false` when the device
                                                                                                      * reported itself offline.
                                                                                                      */
                                                                                                     readonly online?: boolean;
                                                                                                     /**
                                                                                                      * The page's `document.visibilityState` at the moment of the failure.
                                                                                                      *
                                                                                                      * `'hidden'` means the tab was in the background, where browsers throttle or suspend network
                                                                                                      * activity.
                                                                                                      */
                                                                                                     readonly visibility?: DocumentVisibilityState;
                                                                                                     /**
                                                                                                      * Serializes the error, adding the captured context to what
                                                                                                      * {@link BaseError.toJson | BaseError.toJson()} already returns.
                                                                                                      *
                                                                                                      * Each of `endpoint`, `method`, `durationMs`, `online` and `visibility` is included only when it
                                                                                                      * was captured.
                                                                                                      *
                                                                                                      * @returns The error as plain, JSON-serializable data.
                                                                                                      */
                                                                                                     toJson(): ErrorJson;
                                                                                                 }

                                                                                                 /**
                                                                                                  * Splits a message's text into the typed {@link MessagePart | parts} a UI can render.
                                                                                                  *
                                                                                                  * The SDK already runs it over every message it builds and keeps the result on
                                                                                                  * {@link Message.parts}, so this is for content that comes from somewhere else — a transcript you
                                                                                                  * render outside the SDK, or text you assembled before handing it to a renderer.
                                                                                                  * {@link AgentManagerOptions.initialMessages | initialMessages} no longer need it: pass `parts: []`
                                                                                                  * and the SDK runs this for you. It recognizes markdown
                                                                                                  * images (`![alt](url)`), the video thumbnail form (`[![alt](thumb)](video)`), markdown links
                                                                                                  * (`[label](url)`) and HTML anchors (`<a href="url">label</a>`); an image whose URL looks like a
                                                                                                  * video becomes a `video` part instead, and a GIF is tagged with a `mimeType`, both under the rules
                                                                                                  * {@link MessagePart} sets out. Everything the parser does not recognize is preserved verbatim as a
                                                                                                  * `text` part, in its original order, and nothing is dropped or reordered; each recognized part
                                                                                                  * replaces the markup it was written as, so the parts are not a concatenation of the input.
                                                                                                  *
                                                                                                  * @param content - The message text to split, as it appears in {@link Message.content}.
                                                                                                  * @returns The parts in the order they appear in `content`: a single `text` part when there is no
                                                                                                  * markup to find, and an empty array for an empty string.
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * import { parseMessageParts } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * parseMessageParts('Here it is: ![a cat](https://example.com/cat.png) — enjoy!');
                                                                                                  * // [
                                                                                                  * //     { type: 'text', text: 'Here it is: ' },
                                                                                                  * //     { type: 'image', src: 'https://example.com/cat.png', alt: 'a cat' },
                                                                                                  * //     { type: 'text', text: ' — enjoy!' },
                                                                                                  * // ]
                                                                                                  * ```
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare function parseMessageParts(content: string): MessagePart[];

                                                                                                 /**
                                                                                                  * The text-to-speech engines a voice in D-ID's catalog can be served by.
                                                                                                  *
                                                                                                  * The value of {@link Voice.provider}, and of the `type` field that discriminates the provider
                                                                                                  * objects a speak script accepts: {@link Providers.Microsoft} selects a {@link MicrosoftTtsProvider},
                                                                                                  * {@link Providers.Elevenlabs} an {@link ElevenlabsTtsProvider} and {@link Providers.AzureOpenAi}
                                                                                                  * an {@link AzureOpenAiTtsProvider}. The other values appear only in the catalog.
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare enum Providers {
                                                                                                     /** Amazon Polly. Catalog only: agents cannot speak with an Amazon voice. */
                                                                                                     Amazon = "amazon",
                                                                                                     /** Azure OpenAI text-to-speech; see {@link AzureOpenAiTtsProvider}. */
                                                                                                     AzureOpenAi = "azure-openai",
                                                                                                     /** Microsoft Azure text-to-speech; see {@link MicrosoftTtsProvider}. */
                                                                                                     Microsoft = "microsoft",
                                                                                                     /** ElevenLabs text-to-speech; see {@link ElevenlabsTtsProvider}. */
                                                                                                     Elevenlabs = "elevenlabs",
                                                                                                     /** Cartesia text-to-speech. Available as the configured voice of Expressive (V4) agents only. */
                                                                                                     Cartesia = "cartesia"
                                                                                                 }

                                                                                                 /**
                                                                                                  * A rating stored against one message of a chat, as the Agents API returns it.
                                                                                                  *
                                                                                                  * Produced by {@link AgentManager.rate | rate()} and returned again by
                                                                                                  * {@link AgentManager.deleteRate | deleteRate()}. Keep {@link Rating.id | id} if the user may
                                                                                                  * change their mind: pass it back to {@link AgentManager.rate | rate()} as `rateId` to update the
                                                                                                  * rating, or to {@link AgentManager.deleteRate | deleteRate()} to remove it.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare interface Rating {
                                                                                                     /**
                                                                                                      * Id of this rating.
                                                                                                      *
                                                                                                      * Pass it as the `rateId` argument of {@link AgentManager.rate | rate()} to update the rating,
                                                                                                      * or to {@link AgentManager.deleteRate | deleteRate()} to remove it.
                                                                                                      */
                                                                                                     id: string;
                                                                                                     /** Id of the D-ID account that owns the agent the rating was left on. Set by the Agents API. */
                                                                                                     owner_id: string;
                                                                                                     /** Id of the agent whose answer was rated. */
                                                                                                     agent_id: string;
                                                                                                     /**
                                                                                                      * The knowledge citations that were attached to the rated answer, as `[document_id, id]` pairs.
                                                                                                      *
                                                                                                      * The SDK builds them from the {@link Message.matches | matches} of the rated message, so a
                                                                                                      * negative rating can be traced back to the documents the answer was drawn from. Empty when the
                                                                                                      * answer cited nothing.
                                                                                                      */
                                                                                                     matches: [string, string][];
                                                                                                     /**
                                                                                                      * Id of the agent's knowledge base ({@link Agent.knowledge}) at the time of the rating.
                                                                                                      *
                                                                                                      * An empty string when the agent has no knowledge base.
                                                                                                      */
                                                                                                     knowledge_id: string;
                                                                                                     /**
                                                                                                      * The end-user identifier the Agents API recorded for the request.
                                                                                                      *
                                                                                                      * Derived from the credentials the SDK sends, which carry
                                                                                                      * {@link AgentManagerOptions.externalId | externalId} for `type: 'key'` authorization.
                                                                                                      */
                                                                                                     external_id: string;
                                                                                                     /** Identity the Agents API attributed the rating to. Set by the Agents API. */
                                                                                                     created_by: string;
                                                                                                     /** Id of the chat the rated message belongs to — the value
                                                                                                      * {@link AgentManagerCallbacks.onNewChat | onNewChat} reported. */
                                                                                                     chat_id: string;
                                                                                                     /** The score itself: `1` for a positive rating, `-1` for a negative one. */
                                                                                                     score: 1 | -1;
                                                                                                     /** When the rating was created, as an ISO 8601 timestamp. */
                                                                                                     created_at: string;
                                                                                                     /** When the rating was last changed, as an ISO 8601 timestamp. */
                                                                                                     modified_at: string;
                                                                                                     /** {@link Message.id | Id of the message} that was rated. */
                                                                                                     message_id: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * One knowledge citation: the passage of the agent's knowledge base an answer was drawn from.
                                                                                                  *
                                                                                                  * The Agents API returns these with an answer and the SDK keeps them on
                                                                                                  * {@link Message.matches | matches}, so a UI can show the sources behind a reply.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare interface RetrievalMetadata {
                                                                                                     /** Id of this match. Sent back with a rating as the second half of a
                                                                                                      * {@link Rating.matches} pair. */
                                                                                                     id: string;
                                                                                                     /** The matched passage itself, as stored in the knowledge base. */
                                                                                                     data: string;
                                                                                                     /** Title of the document the passage comes from. */
                                                                                                     title: string;
                                                                                                     /** Id of the source document. Sent back with a rating as the first half of a
                                                                                                      * {@link Rating.matches} pair. */
                                                                                                     document_id: string;
                                                                                                     /** Id of the knowledge base the document belongs to — the agent's {@link Agent.knowledge}. */
                                                                                                     knowledge_id: string;
                                                                                                     /** URL of the original source, for linking the citation out of the chat. */
                                                                                                     source_url: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * A tool call currently running in the session.
                                                                                                  *
                                                                                                  * The entries of the array given to
                                                                                                  * {@link AgentManagerCallbacks.onRunningToolCallsChange | onRunningToolCallsChange}. A call appears
                                                                                                  * when it starts and disappears when it finishes, fails, or — for a `blocking` call — when its turn
                                                                                                  * ends; an `async` call outlives its turn.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare interface RunningToolCall {
                                                                                                     /**
                                                                                                      * Id of this call, matching the {@link ToolCallStartedPayload.callId | callId} of the
                                                                                                      * {@link ToolCallStartedPayload} that announced it.
                                                                                                      */
                                                                                                     callId: string;
                                                                                                     /** Name of the tool being called, as configured on the agent. */
                                                                                                     name: string;
                                                                                                     /**
                                                                                                      * Whether the agent is suspended while this call runs.
                                                                                                      *
                                                                                                      * `blocking` means the agent waits for the result before it can continue; `async` means it
                                                                                                      * keeps talking while the call runs. See {@link ToolExecutionMode}.
                                                                                                      */
                                                                                                     executionMode: ToolExecutionMode;
                                                                                                     /**
                                                                                                      * `true` for a built-in call the agent doesn't show as running, such as moving to the next
                                                                                                      * slide. It still counts as running: a `blocking` one makes the agent busy like any other call.
                                                                                                      * Absent on every other call.
                                                                                                      */
                                                                                                     unlisted?: boolean;
                                                                                                 }

                                                                                                 /**
                                                                                                  * What {@link AgentManager.speak | speak()} resolves with: the video the agent is about to stream.
                                                                                                  *
                                                                                                  * The fields come from the Talks (V2) and Clips (V3) API, which generates a discrete video while
                                                                                                  * answering the request. Where no such video exists the call still resolves, with the same stub —
                                                                                                  * `status` `'success'`, `duration` `0` and an empty `videoId`: on Expressive (V4) agents, whose
                                                                                                  * speech is streamed over the data channel rather than rendered as a separate video, and in a
                                                                                                  * text-only chat mode ({@link ChatMode.TextOnly}, {@link ChatMode.Playground} or
                                                                                                  * {@link ChatMode.Maintenance}), which produces no video at all.
                                                                                                  *
                                                                                                  * @category Speak & Scripts
                                                                                                  */
                                                                                                 export declare interface SpeakResponse {
                                                                                                     /**
                                                                                                      * What the server said about the request. Not a fixed set — the Agents API declares it as an
                                                                                                      * open string — so treat an unrecognized value as accepted; a rejected request comes back as
                                                                                                      * an {@link HttpError}. `'success'` on the stub the SDK returns where no video is produced.
                                                                                                      */
                                                                                                     status: string;
                                                                                                     /**
                                                                                                      * Id of the session this call was made on; the SDK sends it back on later streaming requests.
                                                                                                      */
                                                                                                     sessionId?: string;
                                                                                                     /**
                                                                                                      * Duration of the generated video as reported by the Agents API for Talks (V2) and Clips (V3)
                                                                                                      * agents. `0` when the call produced no discrete video — on Expressive (V4) agents, and in a
                                                                                                      * text-only chat mode.
                                                                                                      */
                                                                                                     duration: number;
                                                                                                     /**
                                                                                                      * Id of the generated video.
                                                                                                      *
                                                                                                      * Use it to correlate this call with the video the agent then plays, which
                                                                                                      * {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange} reports the start and
                                                                                                      * end of, and which {@link AgentManager.interrupt | interrupt()} cancels. Empty when the call
                                                                                                      * produced no discrete video — on Expressive (V4) agents, and in a text-only chat mode.
                                                                                                      */
                                                                                                     videoId: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The script payload {@link AgentManager.speak | speak()} accepts: text or audio.
                                                                                                  *
                                                                                                  * Discriminated by its `type` field, so `'text'` narrows the object to {@link TextStreamScript}
                                                                                                  * and `'audio'` to {@link AudioStreamScript}.
                                                                                                  * {@link AgentManager.speak | speak()} additionally takes a plain string, as shorthand for a
                                                                                                  * {@link TextStreamScript} with that string as its `input`.
                                                                                                  *
                                                                                                  * @category Speak & Scripts
                                                                                                  */
                                                                                                 export declare type SpeakScript = TextStreamScript | AudioStreamScript;

                                                                                                 /**
                                                                                                  * Identifiers of the stream the SDK has just opened for the session.
                                                                                                  *
                                                                                                  * Handed to {@link AgentManagerCallbacks.onStreamCreated | onStreamCreated} once the server has
                                                                                                  * accepted the stream, before the first video frame arrives. Log the three ids together: they are
                                                                                                  * what identifies the session in D-ID's own records.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare interface StreamCreatedInfo {
                                                                                                     /**
                                                                                                      * Id of the agent the stream was opened for.
                                                                                                      */
                                                                                                     agentId: string;
                                                                                                     /**
                                                                                                      * Id of the session; the SDK sends it back on every subsequent request for this stream.
                                                                                                      * On Expressive (V4) agents it is the same value as
                                                                                                      * {@link StreamCreatedInfo.streamId | streamId}.
                                                                                                      */
                                                                                                     sessionId: string;
                                                                                                     /**
                                                                                                      * Id of the stream itself.
                                                                                                      */
                                                                                                     streamId: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * Why the server ended the session.
                                                                                                  *
                                                                                                  * Arrives as the `reason` argument of
                                                                                                  * {@link AgentManagerCallbacks.onConnectionStateChange | onConnectionStateChange} together with
                                                                                                  * {@link ConnectionState.Disconnected | 'disconnected'}, and is how you tell a session the server
                                                                                                  * closed on purpose from a connection that simply dropped — `reason` is an opaque transport
                                                                                                  * diagnostic in the latter case, so compare it against these values rather than parsing it. A
                                                                                                  * close reason the SDK does not recognize is forwarded as-is, which is the other reason to compare
                                                                                                  * against the enum. Which members can arrive depends on the agent type: Talks (V2) and Clips (V3)
                                                                                                  * agents report only {@link StreamEndReason.Ok | Ok},
                                                                                                  * {@link StreamEndReason.UnknownError | UnknownError},
                                                                                                  * {@link StreamEndReason.NetworkIssue | NetworkIssue} and
                                                                                                  * {@link StreamEndReason.Inactivity | Inactivity}.
                                                                                                  * {@link AgentManager.reconnect | reconnect()} still works afterwards; it starts a new stream
                                                                                                  * rather than resuming the ended one.
                                                                                                  *
                                                                                                  * @example Reacting to the limits an Expressive (V4) session reports
                                                                                                  * ```ts
                                                                                                  * import { ConnectionState, StreamEndReason, type AgentManagerCallbacks } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * const callbacks: AgentManagerCallbacks = {
                                                                                                  *     onConnectionStateChange(state, reason) {
                                                                                                  *         if (state !== ConnectionState.Disconnected) return;
                                                                                                  *
                                                                                                  *         if (reason === StreamEndReason.TimeLimit || reason === StreamEndReason.MessageLimit) {
                                                                                                  *             showMessage('This session has reached its limit.');
                                                                                                  *         } else if (reason === StreamEndReason.Inactivity) {
                                                                                                  *             showMessage('The session timed out.');
                                                                                                  *         }
                                                                                                  *     },
                                                                                                  * };
                                                                                                  * ```
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare enum StreamEndReason {
                                                                                                     /** The session ended normally, because it was closed deliberately. */
                                                                                                     Ok = "ok",
                                                                                                     /** The session ended because of a failure the server could not classify. */
                                                                                                     UnknownError = "unknown_error",
                                                                                                     /** The session ended because the connection to the browser broke down. */
                                                                                                     NetworkIssue = "network_issue",
                                                                                                     /**
                                                                                                      * The session ended because it reached the message limit configured for the agent.
                                                                                                      *
                                                                                                      * Expressive (V4) agents.
                                                                                                      */
                                                                                                     MessageLimit = "message_limit",
                                                                                                     /**
                                                                                                      * The session ended because it reached its maximum duration.
                                                                                                      *
                                                                                                      * Expressive (V4) agents.
                                                                                                      */
                                                                                                     TimeLimit = "time_limit",
                                                                                                     /**
                                                                                                      * The session ended because nothing happened for too long.
                                                                                                      *
                                                                                                      * The window is {@link StreamOptions.sessionTimeout | sessionTimeout} for Talks (V2) and
                                                                                                      * Clips (V3).
                                                                                                      */
                                                                                                     Inactivity = "inactivity",
                                                                                                     /**
                                                                                                      * The agent itself ended the call.
                                                                                                      *
                                                                                                      * Expressive (V4) agents.
                                                                                                      */
                                                                                                     EndedByAgent = "ended_by_agent"
                                                                                                 }

                                                                                                 /**
                                                                                                  * Something went wrong inside the live audio and video stream.
                                                                                                  *
                                                                                                  * Unlike {@link HttpError} and {@link NetworkError}, which come from REST calls, this one comes
                                                                                                  * from the transport carrying the agent's video, so it is only ever delivered to
                                                                                                  * {@link AgentManagerCallbacks.onError | onError} — no call of yours is necessarily in flight when
                                                                                                  * it happens, and nothing throws it. The SDK raises it when:
                                                                                                  *
                                                                                                  * - no media track is subscribed within the timeout after the LiveKit room used by Expressive (V4)
                                                                                                  *   agents connects, after which the SDK disconnects the stream;
                                                                                                  * - the LiveKit room reports a media-device or encryption failure;
                                                                                                  * - a message cannot be put on the data channel — the WebRTC channel used by Talks (V2) and Clips
                                                                                                  *   (V3) is not open, or the LiveKit room is not connected or rejects the send;
                                                                                                  * - the server reports that the stream itself failed, with the message
                                                                                                  *   `Stream failed with event <event>`.
                                                                                                  *
                                                                                                  * Most of these leave the session unusable, so the useful response is to tell the user and call
                                                                                                  * {@link AgentManager.reconnect | reconnect()}. {@link BaseError.kind | kind} is `'StreamError'`.
                                                                                                  * The message describes the failure, and is the plain `'Stream Error'` when the transport gave no
                                                                                                  * detail; the underlying error, where there was one, is kept as
                                                                                                  * {@link BaseError.originalError | originalError}.
                                                                                                  *
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare class StreamError extends BaseError {
                                                                                                     /**
                                                                                                      * Always `'StreamError'`. Branch on it to tell this failure from the other SDK errors.
                                                                                                      */
                                                                                                     readonly kind: 'StreamError';
                                                                                                 }

                                                                                                 /**
                                                                                                  * Whether the agent's video is currently playing.
                                                                                                  *
                                                                                                  * The argument of {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange}: it tells
                                                                                                  * the application when to show the streamed video and when to fall back to the agent's idle video.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare enum StreamingState {
                                                                                                     /** The agent has started speaking; render the streamed media. */
                                                                                                     Start = "START",
                                                                                                     /** The agent has finished speaking; the application can switch back to the idle video. */
                                                                                                     Stop = "STOP"
                                                                                                 }

                                                                                                 /**
                                                                                                  * Transport settings applied when the stream is created.
                                                                                                  *
                                                                                                  * Talks (V2) and Clips (V3) agents only. Expressive (V4) agents manage transport settings
                                                                                                  * automatically and ignore these options. Pass the object as
                                                                                                  * {@link AgentManagerOptions.streamOptions}; every field is optional.
                                                                                                  *
                                                                                                  * @category Streaming Options
                                                                                                  */
                                                                                                 export declare interface StreamOptions {
                                                                                                     /**
                                                                                                      * Which video codec the stream negotiates.
                                                                                                      *
                                                                                                      * See {@link CompatibilityMode}.
                                                                                                      *
                                                                                                      * @default auto
                                                                                                      */
                                                                                                     compatibilityMode?: CompatibilityMode;
                                                                                                     /**
                                                                                                      * Whether the stream plays a warmup video while the connection settles.
                                                                                                      *
                                                                                                      * With it on the server plays a short warmup video as soon as the connection is up, and the
                                                                                                      * SDK holds back {@link ConnectionState.Connected | 'connected'} — and so the resolution of
                                                                                                      * {@link AgentManager.connect | connect()} — until that video has played out. Without it,
                                                                                                      * `'connected'` is reported as soon as the data channel opens. The application sees nothing of
                                                                                                      * the warmup video itself beyond the delay; it is not distinguishable from any other. A fluent
                                                                                                      * stream ignores the option — the warmup only runs on legacy streams (see
                                                                                                      * {@link StreamOptions.fluent | fluent}).
                                                                                                      *
                                                                                                      * @default false
                                                                                                      */
                                                                                                     streamWarmup?: boolean;
                                                                                                     /**
                                                                                                      * How long the session may sit idle between messages before the server ends it, in seconds.
                                                                                                      *
                                                                                                      * Up to 300, and only for accounts whose plan allows it. When the session does time out,
                                                                                                      * {@link AgentManagerCallbacks.onConnectionStateChange | onConnectionStateChange} reports
                                                                                                      * {@link ConnectionState.Disconnected | 'disconnected'} with the reason
                                                                                                      * {@link StreamEndReason.Inactivity | 'inactivity'}. Leave it out and the server decides.
                                                                                                      */
                                                                                                     sessionTimeout?: number;
                                                                                                     /**
                                                                                                      * Whether to request a fluent stream.
                                                                                                      *
                                                                                                      * `true` streams one video for both the idle and talking states; `false` uses the legacy mode,
                                                                                                      * where the application swaps between two video elements. Clips (V3) agents built on a Pro
                                                                                                      * avatar; always on for Expressive (V4). A fluent stream is also what makes
                                                                                                      * {@link AgentManager.interrupt | interrupt()} available.
                                                                                                      *
                                                                                                      * @default false
                                                                                                      */
                                                                                                     fluent?: boolean;
                                                                                                 }

                                                                                                 /**
                                                                                                  * How the agent's idle and talking video are delivered.
                                                                                                  *
                                                                                                  * Returned by {@link AgentManager.getStreamType | getStreamType()}. Which one a session gets
                                                                                                  * follows from the agent and from {@link StreamOptions.fluent | fluent}.
                                                                                                  *
                                                                                                  * @category Streaming Options
                                                                                                  */
                                                                                                 export declare enum StreamType {
                                                                                                     /**
                                                                                                      * Two videos: the agent's idle video, which the application plays itself, and the streamed
                                                                                                      * talking video. Switch between them in
                                                                                                      * {@link AgentManagerCallbacks.onVideoStateChange | onVideoStateChange}.
                                                                                                      */
                                                                                                     Legacy = "legacy",
                                                                                                     /**
                                                                                                      * One continuous video for both the idle and the talking state, so there is nothing to swap.
                                                                                                      * Expressive (V4) agents always stream this way, and it is what makes
                                                                                                      * {@link AgentManager.interrupt | interrupt()} possible.
                                                                                                      */
                                                                                                     Fluent = "fluent"
                                                                                                 }

                                                                                                 /**
                                                                                                  * A short-lived Azure Speech authorization token, issued by the Agents API.
                                                                                                  *
                                                                                                  * What {@link AgentManager.getSttToken | getSttToken()} resolves with. It lets an application run
                                                                                                  * Azure speech recognition in the browser without holding a speech subscription key. Azure tokens
                                                                                                  * expire after about ten minutes, so request one per recognition session.
                                                                                                  *
                                                                                                  * @category Agent Manager
                                                                                                  */
                                                                                                 export declare interface SttTokenResponse {
                                                                                                     /** The authorization token to present to Azure Speech. */
                                                                                                     token: string;
                                                                                                     /** The Azure region the token is valid in. */
                                                                                                     region: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * What the Agents API stored when end-of-call feedback was submitted.
                                                                                                  *
                                                                                                  * Returned by {@link AgentManager.submitFeedback | submitFeedback()}, which rates the conversation
                                                                                                  * as a whole rather than a single answer.
                                                                                                  *
                                                                                                  * @category Chat
                                                                                                  */
                                                                                                 export declare interface SubmitFeedbackResponse {
                                                                                                     /** Id of the chat the feedback belongs to — the value
                                                                                                      * {@link AgentManagerCallbacks.onNewChat | onNewChat} reported. */
                                                                                                     chat_id: string;
                                                                                                     /** The score that was submitted, on the agent's end-of-call scale of 1 to 5. */
                                                                                                     rating: number;
                                                                                                     /**
                                                                                                      * The follow-up question the user was asked, when one was recorded.
                                                                                                      *
                                                                                                      * Applications pick it from {@link EndOfCallFeedbackConfig.follow_up_messages}.
                                                                                                      */
                                                                                                     question_shown?: string;
                                                                                                     /** When the feedback was stored, as an ISO 8601 timestamp. */
                                                                                                     submitted_at: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * A script that makes the agent say text you supply, synthesized by a text-to-speech provider.
                                                                                                  *
                                                                                                  * The usual payload for {@link AgentManager.speak | speak()}. The agent's LLM is not involved, so
                                                                                                  * the agent says exactly what {@link TextStreamScript.input | input} contains — which is what makes
                                                                                                  * it the right script for greetings and other canned lines. Passing a plain string to
                                                                                                  * {@link AgentManager.speak | speak()} is shorthand for this script with `ssml` set to `false`.
                                                                                                  *
                                                                                                  * @example Text
                                                                                                  * ```ts
                                                                                                  * const speak = await agentManager.speak({
                                                                                                  *     type: 'text',
                                                                                                  *     input: "Hi! I'm Alice!",
                                                                                                  * });
                                                                                                  * ```
                                                                                                  * @example Text with sentiment
                                                                                                  * `sentiment` is for Expressive (V4) agents only. If the requested sentiment is not supported by
                                                                                                  * the agent, the default sentiment is used.
                                                                                                  * ```ts
                                                                                                  * const speak = await agentManager.speak({
                                                                                                  *     type: 'text',
                                                                                                  *     input: "Hi! I'm Alice!",
                                                                                                  *     sentiment: 'friendly',
                                                                                                  * });
                                                                                                  * ```
                                                                                                  * @category Speak & Scripts
                                                                                                  */
                                                                                                 export declare interface TextStreamScript {
                                                                                                     /**
                                                                                                      * Which kind of script this is. Always `text` for this variant; an
                                                                                                      * {@link AudioStreamScript} carries `audio` instead.
                                                                                                      */
                                                                                                     type: 'text';
                                                                                                     /**
                                                                                                      * The text-to-speech provider and voice that synthesize
                                                                                                      * {@link TextStreamScript.input | input}, from the list of supported providers.
                                                                                                      *
                                                                                                      * One of the objects in {@link TtsProvider}: a `type` naming the provider, the
                                                                                                      * `voice_id` to speak with, and optional provider-specific `voice_config`. Leave it out and the
                                                                                                      * agent speaks with its own configured voice; that voice's `voice_config` is not applied.
                                                                                                      * Talks (V2) and Clips (V3) agents only: Expressive (V4) agents always speak with their
                                                                                                      * configured voice and ignore this field.
                                                                                                      */
                                                                                                     provider?: TtsProvider;
                                                                                                     /**
                                                                                                      * The text to be synthesized into speech.
                                                                                                      *
                                                                                                      * Each provider has its own limit on the text length.
                                                                                                      * @example "This is an example text"
                                                                                                      * @maxLength 40000
                                                                                                      * @minLength 3
                                                                                                      */
                                                                                                     input: string;
                                                                                                     /**
                                                                                                      * Is the text provided in ssml form.
                                                                                                      *
                                                                                                      * Set it to `true` when {@link TextStreamScript.input | input} is SSML markup rather than plain
                                                                                                      * text, so the provider reads the tags instead of speaking them.
                                                                                                      * @default false
                                                                                                      */
                                                                                                     ssml?: boolean;
                                                                                                     /**
                                                                                                      * Queue this speak behind the current speech instead of interrupting it. Expressive (V4)
                                                                                                      * agents only.
                                                                                                      * @default false
                                                                                                      */
                                                                                                     should_queue_speaks?: boolean;
                                                                                                     /**
                                                                                                      * Sentiment name to speak with. Expressive (V4) agents only; if the agent does not support the
                                                                                                      * requested sentiment, its default sentiment is used.
                                                                                                      * @example "friendly"
                                                                                                      */
                                                                                                     sentiment?: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The payload of a {@link ToolCallEvent.Done} event: a tool call finished successfully.
                                                                                                  *
                                                                                                  * Delivered to {@link AgentManagerCallbacks.onToolEvent | onToolEvent} — see
                                                                                                  * {@link ToolEventCallback}.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare interface ToolCallDonePayload {
                                                                                                     /** Id of the call that finished, matching the {@link ToolCallStartedPayload} that announced it. */
                                                                                                     callId: string;
                                                                                                     /** Name of the tool that was called. */
                                                                                                     name: string;
                                                                                                     /** The arguments the call was made with. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     input?: Record<string, unknown>;
                                                                                                     /** The result the tool returned. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     output?: Record<string, unknown>;
                                                                                                     /** How long the call took, in milliseconds. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     durationMs?: number;
                                                                                                     /** Any additional metadata the tool reported alongside its result. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     extra?: Record<string, unknown>;
                                                                                                     /** `true` for a call the agent doesn't show as running. See {@link RunningToolCall.unlisted}. */
                                                                                                     unlisted?: boolean;
                                                                                                     /** When the call finished, as reported by the server. */
                                                                                                     timestamp: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The payload of a {@link ToolCallEvent.Error} event: a tool call failed.
                                                                                                  *
                                                                                                  * Delivered to {@link AgentManagerCallbacks.onToolEvent | onToolEvent} — see
                                                                                                  * {@link ToolEventCallback}. Read {@link ToolCallErrorPayload.error | error} for what went wrong.
                                                                                                  * The agent carries on with the conversation; the SDK does not retry.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare interface ToolCallErrorPayload {
                                                                                                     /** Id of the call that failed, matching the {@link ToolCallStartedPayload} that announced it. */
                                                                                                     callId: string;
                                                                                                     /** Name of the tool that was called. */
                                                                                                     name: string;
                                                                                                     /** The arguments the call was made with. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     input?: Record<string, unknown>;
                                                                                                     /**
                                                                                                      * Whatever the failed call produced, if anything. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions.
                                                                                                      *
                                                                                                      * Any JSON value — the server's own type for a tool result is unconstrained, and on a failure
                                                                                                      * it is commonly the reason as a plain string rather than a structured result. Narrow it
                                                                                                      * before use. The string case is also given to you as
                                                                                                      * {@link ToolCallErrorPayload.error | error}, which is what to show.
                                                                                                      */
                                                                                                     output?: unknown;
                                                                                                     /** How long the call ran before failing, in milliseconds. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     durationMs?: number;
                                                                                                     /** Any additional metadata the server reported with the failure. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     extra?: Record<string, unknown>;
                                                                                                     /**
                                                                                                      * What went wrong, in one line, when the server said. Only verbose sessions carry it.
                                                                                                      *
                                                                                                      * Taken from the failure the server reports in {@link ToolCallErrorPayload.extra | extra}
                                                                                                      * (`extra.error.message`), and from {@link ToolCallErrorPayload.output | output} when that is
                                                                                                      * a plain string instead. Absent when the server sent neither, which is why an application
                                                                                                      * that shows the reason needs a fallback of its own; the full structured failure — its kind,
                                                                                                      * code and any data — is in `extra.error`.
                                                                                                      */
                                                                                                     error?: string;
                                                                                                     /** `true` for a call the agent doesn't show as running. See {@link RunningToolCall.unlisted}. */
                                                                                                     unlisted?: boolean;
                                                                                                     /** When the call failed, as reported by the server. */
                                                                                                     timestamp: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The tool-call events delivered to {@link AgentManagerCallbacks.onToolEvent | onToolEvent}.
                                                                                                  *
                                                                                                  * Switch on the first argument of the handler to tell them apart: it narrows the second argument to
                                                                                                  * the payload that event carries — see {@link ToolEventCallback}. The members' values are the wire
                                                                                                  * strings the server sends, so compare against the enum rather than writing the string out.
                                                                                                  * Expressive (V4) agents only.
                                                                                                  *
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * import { AgentManagerCallbacks, ToolCallEvent } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * const callbacks: AgentManagerCallbacks = {
                                                                                                  *     onToolEvent(event, data) {
                                                                                                  *         if (event === ToolCallEvent.Started) {
                                                                                                  *             console.log('started', data.name, data.input);
                                                                                                  *         }
                                                                                                  *     },
                                                                                                  * };
                                                                                                  * ```
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare enum ToolCallEvent {
                                                                                                     /**
                                                                                                      * The agent has begun a tool call; the payload is a {@link ToolCallStartedPayload}, carrying the
                                                                                                      * call's id, the tool's name and the arguments the agent's LLM produced.
                                                                                                      */
                                                                                                     Started = "tool-call/started",
                                                                                                     /**
                                                                                                      * A tool call finished successfully; the payload is a {@link ToolCallDonePayload}, carrying the
                                                                                                      * result the tool returned and how long the call took.
                                                                                                      */
                                                                                                     Done = "tool-call/done",
                                                                                                     /**
                                                                                                      * A tool call failed; the payload is a {@link ToolCallErrorPayload}, carrying the reason in
                                                                                                      * {@link ToolCallErrorPayload.error | error} when the server gave one. The agent carries on
                                                                                                      * with the conversation.
                                                                                                      */
                                                                                                     Error = "tool-call/error"
                                                                                                 }

                                                                                                 /**
                                                                                                  * The payload of a {@link ToolCallEvent.Started} event: the agent has begun a tool call.
                                                                                                  *
                                                                                                  * Delivered to {@link AgentManagerCallbacks.onToolEvent | onToolEvent} — see
                                                                                                  * {@link ToolEventCallback}.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare interface ToolCallStartedPayload {
                                                                                                     /** Id of this call. The matching done or error payload carries the same id. */
                                                                                                     callId: string;
                                                                                                     /** Name of the tool the agent is calling, as configured on the agent. */
                                                                                                     name: string;
                                                                                                     /** The arguments the agent's LLM produced for this call. Sent only in {@link AgentManagerOptions.verbose | verbose} sessions. */
                                                                                                     input?: Record<string, unknown>;
                                                                                                     /**
                                                                                                      * The tool's result, when the server sent one.
                                                                                                      *
                                                                                                      * The event is emitted before the tool has run, so it is normally absent; read the
                                                                                                      * {@link ToolCallDonePayload.output | output} of the matching done event instead.
                                                                                                      */
                                                                                                     output?: Record<string, unknown>;
                                                                                                     /**
                                                                                                      * Whether the server considers the agent interruptible while this call is outstanding.
                                                                                                      *
                                                                                                      * Informational: the SDK does not forward it.
                                                                                                      * {@link AgentManagerCallbacks.onInterruptibleChange | onInterruptibleChange} is derived from
                                                                                                      * the {@link ToolCallStartedPayload.executionMode | executionMode} of the calls still
                                                                                                      * running, not from this field.
                                                                                                      */
                                                                                                     interruptible: boolean;
                                                                                                     /**
                                                                                                      * Whether the agent waits for this call. See {@link ToolExecutionMode}.
                                                                                                      *
                                                                                                      * Always present: a server event that omits it, or carries anything other than `async`, is
                                                                                                      * reported as `'blocking'` — the same normalization
                                                                                                      * {@link RunningToolCall.executionMode | RunningToolCall.executionMode} applies, so the two
                                                                                                      * agree about the same call.
                                                                                                      */
                                                                                                     executionMode: ToolExecutionMode;
                                                                                                     /** The conversational turn this call belongs to, or `null` when it belongs to no turn. */
                                                                                                     turnId?: number | null;
                                                                                                     /** `true` for a call the agent doesn't show as running. See {@link RunningToolCall.unlisted}. */
                                                                                                     unlisted?: boolean;
                                                                                                     /** When the call started, as reported by the server. */
                                                                                                     timestamp: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The handler type for {@link AgentManagerCallbacks.onToolEvent | onToolEvent}: the event argument
                                                                                                  * narrows the payload argument.
                                                                                                  *
                                                                                                  * One signature over three argument pairs, one pair per tool-call event, so the first argument
                                                                                                  * narrows the second: a handler written against this type sees exactly one of
                                                                                                  * {@link ToolCallStartedPayload}, {@link ToolCallDonePayload} and {@link ToolCallErrorPayload},
                                                                                                  * never a union of the three — in an inline `onToolEvent(event, data) { … }` handler as much as in
                                                                                                  * a standalone function annotated with this type. A payload that does not belong to its event is
                                                                                                  * rejected. Expressive (V4) agents only.
                                                                                                  *
                                                                                                  * @param args - The event and the payload it carries, as one pair:
                                                                                                  * {@link ToolCallEvent.Started} with a {@link ToolCallStartedPayload} — the call the agent has just
                                                                                                  * begun, with the arguments its LLM produced; {@link ToolCallEvent.Done} with a
                                                                                                  * {@link ToolCallDonePayload} — the call that has just finished, with the result the tool returned;
                                                                                                  * or {@link ToolCallEvent.Error} with a {@link ToolCallErrorPayload} — the call that has just
                                                                                                  * failed, with the reason in {@link ToolCallErrorPayload.error | error} when the server gave one.
                                                                                                  *
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * import { AgentManagerCallbacks, ToolCallEvent } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * const callbacks: AgentManagerCallbacks = {
                                                                                                  *     onToolEvent(event, data) {
                                                                                                  *         if (event === ToolCallEvent.Started) {
                                                                                                  *             console.log('started', data.name, data.input);
                                                                                                  *         } else if (event === ToolCallEvent.Done) {
                                                                                                  *             console.log('done', data.name, data.output, data.durationMs);
                                                                                                  *         } else {
                                                                                                  *             console.log('failed', data.name, data.error ?? 'no reason given');
                                                                                                  *         }
                                                                                                  *     },
                                                                                                  * };
                                                                                                  * ```
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare type ToolEventCallback = (...args: [event: ToolCallEvent.Started, data: ToolCallStartedPayload] | [event: ToolCallEvent.Done, data: ToolCallDonePayload] | [event: ToolCallEvent.Error, data: ToolCallErrorPayload]) => void;

                                                                                                 /**
                                                                                                  * Whether the agent waits for a tool call to finish before it carries on.
                                                                                                  *
                                                                                                  * Set on the agent's tool configuration, and reported on {@link RunningToolCall.executionMode} and
                                                                                                  * {@link ToolCallStartedPayload.executionMode}. Only a `blocking` call suspends the agent, which
                                                                                                  * is why one being outstanding is what makes the agent uninterruptible — see
                                                                                                  * {@link AgentManagerCallbacks.onInterruptibleChange | onInterruptibleChange}.
                                                                                                  *
                                                                                                  * @category Callbacks & Events
                                                                                                  */
                                                                                                 export declare type ToolExecutionMode = 'blocking' | 'async';

                                                                                                 /**
                                                                                                  * The provider object a speak script accepts.
                                                                                                  *
                                                                                                  * This is the type of {@link TextStreamScript.provider}. Pick the variant for the provider you
                                                                                                  * want and give it the `voice_id` to speak with and an optional `voice_config`; `type`
                                                                                                  * discriminates the union.
                                                                                                  *
                                                                                                  * @example
                                                                                                  * ```ts
                                                                                                  * import { Providers } from '@d-id/client-sdk';
                                                                                                  *
                                                                                                  * const speak = await agentManager.speak({
                                                                                                  *     type: 'text',
                                                                                                  *     input: "Hi! I'm Alice!",
                                                                                                  *     provider: { type: Providers.Microsoft, voice_id: 'en-US-JennyNeural' },
                                                                                                  * });
                                                                                                  * ```
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare type TtsProvider = MicrosoftTtsProvider | AzureOpenAiTtsProvider | ElevenlabsTtsProvider;

                                                                                                 /**
                                                                                                  * A method was called with arguments, or in a state, that the SDK will not send to the Agents
                                                                                                  * API.
                                                                                                  *
                                                                                                  * This is one of the two SDK errors that only ever reach the caller and are never delivered to
                                                                                                  * {@link AgentManagerCallbacks.onError | onError} (the other is {@link ChatCreationFailed}): it is
                                                                                                  * the direct answer to the call you just made, and every method that raises it rejects the promise
                                                                                                  * it returned, so `await` the call inside a `try`/`catch` or attach a `.catch()`. The SDK raises it
                                                                                                  * from
                                                                                                  * {@link AgentManager.chat | chat()} when the message is empty or 2000 characters or longer, when
                                                                                                  * the session's {@link ChatMode} has chat disabled or is in maintenance, and when the chat or the
                                                                                                  * stream has not been initialized yet; from {@link AgentManager.speak | speak()} when it is called
                                                                                                  * before {@link AgentManager.connect | connect()}; and from
                                                                                                  * {@link AgentManager.rate | rate()}, {@link AgentManager.deleteRate | deleteRate()} and
                                                                                                  * {@link AgentManager.submitFeedback | submitFeedback()} when no chat has started, plus, for
                                                                                                  * `rate()` alone, when no message with the given id is in the transcript. It is also raised from
                                                                                                  * {@link createAgentManager} and {@link AgentManager.changeMode | changeMode()} when an Expressive
                                                                                                  * (V4) agent is asked for {@link ChatMode.Off} or {@link ChatMode.DirectPlayback}, which only Talks
                                                                                                  * (V2) and Clips (V3) agents support. The five Expressive-only media methods —
                                                                                                  * {@link AgentManager.publishMicrophoneStream | publishMicrophoneStream()},
                                                                                                  * {@link AgentManager.replaceMicrophoneTrack | replaceMicrophoneTrack()},
                                                                                                  * {@link AgentManager.publishCameraStream | publishCameraStream()},
                                                                                                  * {@link AgentManager.setSttLanguage | setSttLanguage()} and
                                                                                                  * {@link AgentManager.sendDataChannelMessage | sendDataChannelMessage()} — raise it the other way
                                                                                                  * round: when the session is a Talks (V2) or Clips (V3) one, or
                                                                                                  * {@link AgentManager.connect | connect()} has not run yet.
                                                                                                  *
                                                                                                  * Nothing was sent to the Agents API when this is raised, so the session stays usable: fix the
                                                                                                  * argument or wait for {@link ConnectionState.Connected | 'connected'} and call again.
                                                                                                  * {@link BaseError.kind | kind} is `'ValidationError'`.
                                                                                                  *
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare class ValidationError extends BaseError {
                                                                                                     /**
                                                                                                      * Name of the field the failure is about.
                                                                                                      *
                                                                                                      * The SDK does not populate it — every validation it raises passes the message alone — so it
                                                                                                      * is only set on a `ValidationError` an application constructed itself. It is also left out
                                                                                                      * of {@link BaseError.toJson | toJson()}, so a serialized validation error carries only its
                                                                                                      * kind and message.
                                                                                                      */
                                                                                                     readonly key?: string | undefined;
                                                                                                     /**
                                                                                                      * Always `'ValidationError'`. Branch on it to tell this failure from the other SDK errors.
                                                                                                      */
                                                                                                     readonly kind: 'ValidationError';
                                                                                                     /**
                                                                                                      * Builds a validation failure. The SDK does this itself before it performs a request.
                                                                                                      *
                                                                                                      * @param message - What was wrong with the call, such as `'Message cannot be empty'`.
                                                                                                      * @param key - Name of the field the failure is about. The SDK's own validations leave it
                                                                                                      * unset.
                                                                                                      */
                                                                                                     constructor(message: string, 
                                                                                                     /**
                                                                                                      * Name of the field the failure is about.
                                                                                                      *
                                                                                                      * The SDK does not populate it — every validation it raises passes the message alone — so it
                                                                                                      * is only set on a `ValidationError` an application constructed itself. It is also left out
                                                                                                      * of {@link BaseError.toJson | toJson()}, so a serialized validation error carries only its
                                                                                                      * kind and message.
                                                                                                      */
                                                                                                     key?: string | undefined);
                                                                                                 }

                                                                                                 /**
                                                                                                  * One voice in D-ID's catalog of text-to-speech voices.
                                                                                                  *
                                                                                                  * The SDK does not fetch voices itself; the type is exported so an application that lists them —
                                                                                                  * to build a voice picker, say — can type the result and then feed {@link Voice.id | id} and
                                                                                                  * {@link Voice.provider | provider} into the provider object it passes as
                                                                                                  * {@link TextStreamScript.provider}. {@link Voice.provider | provider} is the wide
                                                                                                  * {@link Providers} enum, while each provider variant requires its own literal `type`, so switch
                                                                                                  * on it to build the matching variant, for example {@link Providers.Elevenlabs} to an
                                                                                                  * {@link ElevenlabsTtsProvider}. The catalog also lists voices agents cannot speak with (Google
                                                                                                  * voices, for example), so keep only the providers {@link TtsProvider} has a variant for.
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare interface Voice {
                                                                                                     /** Identifier of the voice: the value to pass as a provider object's `voice_id`. */
                                                                                                     id: string;
                                                                                                     /** Display name of the voice. */
                                                                                                     name: string;
                                                                                                     /** The gender the voice is labelled with. */
                                                                                                     gender: string;
                                                                                                     /** Each language the voice speaks, with its locale code such as `en-US`. */
                                                                                                     languages: {
                                                                                                         /** The language, as a name such as `English`. */
                                                                                                         language: string;
                                                                                                         /** Its locale code, such as `en-US`. */
                                                                                                         locale: string;
                                                                                                         /** The accent, when the catalog names one. */
                                                                                                         accent?: string;
                                                                                                     }[];
                                                                                                     /** Which accounts may use the voice. See {@link VoiceAccess}. */
                                                                                                     access: VoiceAccess;
                                                                                                     /** The provider that serves the voice. See {@link Providers}. */
                                                                                                     provider: Providers;
                                                                                                     /** The speaking styles this particular voice offers, for example as a
                                                                                                      * {@link VoiceConfigMicrosoft.style | style}. Styles differ from voice to voice. */
                                                                                                     styles: string[];
                                                                                                     /** The language of the voice, as a name rather than a locale code, when the catalog sets one. */
                                                                                                     language?: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * Who may use a voice.
                                                                                                  *
                                                                                                  * The value of {@link Voice.access}, so an application listing voices can show or hide the ones the
                                                                                                  * account cannot select.
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare enum VoiceAccess {
                                                                                                     /** Available to every account. */
                                                                                                     Public = "public",
                                                                                                     /** Available to accounts whose plan includes premium voices. */
                                                                                                     Premium = "premium",
                                                                                                     /** Available only to the account the voice belongs to. */
                                                                                                     Private = "private",
                                                                                                     /** A voice from the account's own ElevenLabs account, used with its ElevenLabs API key. */
                                                                                                     ExternalPrivate = "external-private"
                                                                                                 }

                                                                                                 /**
                                                                                                  * ElevenLabs voice settings: how stable the voice is and how closely it adheres to the source voice.
                                                                                                  *
                                                                                                  * The `voice_config` of {@link ElevenlabsTtsProvider}. Every field is optional.
                                                                                                  *
                                                                                                  * @see [ElevenLabs on D-ID](https://docs.d-id.com/docs/tts-elevenlabs)
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare interface VoiceConfigElevenlabs {
                                                                                                     /**
                                                                                                      * How stable the voice is, and how much each generation varies.
                                                                                                      *
                                                                                                      * A number from 0 to 1: lower is more expressive and more variable between generations, higher
                                                                                                      * is flatter and more repeatable.
                                                                                                      * @example 0.5
                                                                                                      */
                                                                                                     stability?: number;
                                                                                                     /**
                                                                                                      * How closely the synthesized speech should adhere to the original voice it was cloned from.
                                                                                                      *
                                                                                                      * A number from 0 to 1: higher follows the original more strictly.
                                                                                                      * @example 0.5
                                                                                                      */
                                                                                                     similarity_boost?: number;
                                                                                                 }

                                                                                                 /**
                                                                                                  * How a Microsoft Azure or Azure OpenAI voice should deliver the text.
                                                                                                  *
                                                                                                  * The `voice_config` of {@link MicrosoftTtsProvider} and {@link AzureOpenAiTtsProvider}. Every
                                                                                                  * field is optional; when one is omitted the Agents API applies its own default.
                                                                                                  *
                                                                                                  * @category Voice
                                                                                                  */
                                                                                                 export declare interface VoiceConfigMicrosoft {
                                                                                                     /** Speaking style, such as `cheerful`; {@link Voice.styles} lists what a voice offers. */
                                                                                                     style?: string;
                                                                                                     /**
                                                                                                      * The speed of the voice.
                                                                                                      * The value is relative to 1, 0.5 being half speed, 2 being twice as fast, etc.
                                                                                                      * Another option is a constant value from x-slow/slow/medium/fast/x-fast.
                                                                                                      * @example "0.5"
                                                                                                      */
                                                                                                     rate?: string;
                                                                                                     /**
                                                                                                      * The pitch of the voice.
                                                                                                      * Value could be an absolute value in Hz (including units), a relative value in Hz or st(semitones)
                                                                                                      * or a constant value from x-low/low/medium/high/x-high.
                                                                                                      * @example "+2st"
                                                                                                      */
                                                                                                     pitch?: string;
                                                                                                 }

                                                                                                 /**
                                                                                                  * The web socket the SDK uses for chat notifications failed to connect.
                                                                                                  *
                                                                                                  * Talks (V2) and Clips (V3) sessions open a web socket alongside the video stream; the agent's
                                                                                                  * answer arrives over it as `partial` and `answer` events, which is what drives
                                                                                                  * {@link AgentManagerCallbacks.onNewMessage | onNewMessage}. This error is raised when that socket
                                                                                                  * emits an `error` event, once per failed attempt while
                                                                                                  * {@link AgentManager.connect | connect()} is retrying. It is only delivered to
                                                                                                  * {@link AgentManagerCallbacks.onError | onError} and never thrown, so there is nothing to catch
                                                                                                  * around `connect()` for it; if every attempt fails, `connect()` rejects with the browser's own
                                                                                                  * socket event instead.
                                                                                                  *
                                                                                                  * The socket is not opened at all for Expressive (V4) agents, which receive the same events over
                                                                                                  * the LiveKit data channel, nor in {@link ChatMode.DirectPlayback | DirectPlayback} mode, so the
                                                                                                  * error cannot occur in either case.
                                                                                                  *
                                                                                                  * {@link BaseError.kind | kind} is `'WSError'`, and the message is
                                                                                                  * `'Websocket failed to connect'`.
                                                                                                  *
                                                                                                  * @category Errors
                                                                                                  */
                                                                                                 export declare class WsError extends BaseError {
                                                                                                     /**
                                                                                                      * Always `'WSError'` — note the capitalization, which does not match the class name.
                                                                                                      */
                                                                                                     readonly kind: 'WSError';
                                                                                                 }

                                                                                                 export { }
