Member Junction
    Preparing search index...

    Result shape returned by the StartRealtimeClientSession server mutation. The browser uses these values to open a client-direct realtime session.

    Exported because a host may mint the session ITSELF (its own mutation, carrying server-side context the stock mutation cannot express) and then hand the result to RealtimeSessionRuntime.StartRealtimeSessionFromResult to run it — this is the contract that path is written against.

    interface StartRealtimeClientSessionResult {
        AgentSessionId: string;
        AvatarStatusJson?: string | null;
        ClientPolicyJson?: string | null;
        ConversationId: string | null;
        EphemeralToken: string;
        ExpiresAt: string;
        Model: string;
        ModelName: string | null;
        NarrationInstructionsTemplate: string | null;
        PriorChannelStatesJson: string | null;
        Provider: string;
        RelayUrl?: string | null;
        SessionConfigJson: string;
        Transport?: string | null;
    }
    Index

    Properties

    AgentSessionId: string
    AvatarStatusJson?: string | null

    OPTIONAL — the session's live-avatar status (RealtimeAvatarStatus from @memberjunction/ai) as JSON: whether the voiced agent asked for an avatar, whether the model renders it, and why not. The runtime reads it after connecting to publish RealtimeSessionRuntime.AvatarNotice$. Absent from a server that predates it, when the agent asked for no avatar, and from a host that mints for itself and does not pass it on; the call then shows no notice.

    ClientPolicyJson?: string | null

    OPTIONAL — the server's resolved RealtimeSessionClientPolicy (from @memberjunction/ai-core-plus) as JSON: which of the channel candidates the client reported at mint are in this session (agent/app scoping and the registry's kill switch already applied), their resolved display and config, and the app/static client-tool tiers. Absent from a server that predates channel scoping and from a host that mints through its own proxy; the runtime then resolves the scope locally from code defaults and host declarations.

    ConversationId: string | null
    EphemeralToken: string

    The provider credential the client driver presents. Empty on a relay session, which has RelayUrl instead.

    ExpiresAt: string
    Model: string
    ModelName: string | null

    Display name of the realtime model the session uses (e.g. "GPT Realtime 2"). Null when unknown.

    NarrationInstructionsTemplate: string | null

    DB-driven progress-narration instruction template (contains a {{ progressMessage }} placeholder). Null when the deployment hasn't synced the narration prompt — the client falls back to its built-in wording.

    PriorChannelStatesJson: string | null

    JSON map of the PRIOR session's saved channel states keyed by channel name (present only when the start carried lastSessionId and the prior session — owned by the same user — had saved states). Applied to the matching channel plugins via BaseRealtimeChannelClient.RestoreState so e.g. the whiteboard resumes where the last session left off.

    Provider: string
    RelayUrl?: string | null

    OPTIONAL — where a relay session's client driver connects (MJAPI's realtime relay). It carries the session's ticket, so it is a credential: never log it. A host that mints for itself must pass it on for a relay session.

    SessionConfigJson: string

    JSON.stringify of the provider session config (instructions + tools) to apply at connect.

    Transport?: string | null

    OPTIONAL — how the browser reaches the provider: 'direct' or 'relay' (RealtimeClientTransport from @memberjunction/ai). Absent, null or unknown means direct: a direct session, or a server that predates it.