Member Junction
    Preparing search index...

    Interface PrepareClientSessionInput

    Input for RealtimeClientSessionService.PrepareClientSession.

    The co-agent may be supplied either as a fully-loaded entity (CoAgent) or by id (CoAgentID), which is resolved from AIEngine's cached agents. The target agent is always supplied by id — it is a runtime choice made when the voice session starts.

    interface PrepareClientSessionInput {
        AgentSessionID: string;
        AppContext?: AppContextSnapshot;
        ApplicationID?: string;
        CoAgent?: MJAIAgentEntityExtended;
        CoAgentID?: string;
        CompanyID?: string;
        Config?: JSONObject;
        ConfigOverridesJson?: string;
        ConversationID?: string;
        ConversationMessages?: ChatMessage[];
        DisableAutoResponse?: boolean;
        ExtraTools?: RealtimeToolDefinition[];
        MaxSessionSeconds?: number;
        PreferredModelID?: string;
        PriorTranscript?: string;
        SelfNames?: string[];
        TargetAgentID: string;
        UserID?: string;
    }
    Index

    Properties

    AgentSessionID: string

    The shared session id grouping this voice session's runs.

    AppContext?: AppContextSnapshot

    Optional app-context snapshot — where the user is, what they see, and the live capability manifest — injected into the companion system prompt at mint (the session-start half of the client-context delivery; the import('@memberjunction/ai-core-plus').AppContextSnapshot shape). The streaming half rides the ClientContextChannel. Absent ⇒ no app-context section.

    ApplicationID?: string

    Optional application id the realtime session runs in. Sources the app cascade layer of the effective config: Application.AgentSettings.Realtime (persona/disclosure/model overrides) + RelevantAgents (union-accumulated into the co-agent's allowed delegation set). Absent ⇒ no app layer (the cascade rests on type/co-agent/target/override only).

    The Realtime Co-Agent entity. Provide this OR PrepareClientSessionInput.CoAgentID.

    CoAgentID?: string

    The Realtime Co-Agent id (resolved from cached metadata). Provide this OR PrepareClientSessionInput.CoAgent.

    CompanyID?: string

    Optional company-scope id for memory/context retrieval.

    Config?: JSONObject

    Optional provider-specific session config bag (voice, language, turn detection, etc.).

    ConfigOverridesJson?: string

    Optional RUNTIME configuration-override layer (the most-specific layer of the effective configuration merge: type DefaultConfiguration ← agent TypeConfiguration ← this). Pre-authorized by the transport layer — the MJServer resolver gates it behind the Realtime: Advanced Session Controls authorization BEFORE threading it here; the service trusts the input. Malformed JSON is tolerated (it simply contributes nothing to the merge).

    ConversationID?: string

    Optional conversation id the session is attached to — stamped on the co-agent observability run.

    ConversationMessages?: ChatMessage[]

    Prior conversation history to seed the model's context. Optional.

    DisableAutoResponse?: boolean

    Multi-agent meeting mode. When true, the agent joins as one of several voices in a shared room: its model's blind auto-response is disabled (the session Config carries disableAutoResponse, which providers translate to e.g. OpenAI turn_detection.create_response=false) and a meeting-aware clause is added to the prompt so it hears everything but speaks only when addressed. The bridge becomes the sole speech trigger (gated by its turn policy). Absent/false = a 1:1 call with the model's normal auto-response. See plans/realtime/multi-agent-meeting-turn-taking.md.

    ExtraTools?: RealtimeToolDefinition[]

    Optional extra, target-independent tools to expose in addition to invoke-target-agent.

    MaxSessionSeconds?: number

    Optional server-authoritative hard ceiling on the session's wall-clock duration, in seconds. Threaded into RealtimeSessionParams.MaxSessionSeconds so a driver can bound the provider session/token, and surfaced so the transport layer (the MJServer resolver) can stamp the absolute deadline on the session for the janitor to enforce. Set for abuse-sensitive deployments (a public web-widget guest's VoiceMaxSessionMinutes); omitted otherwise.

    PreferredModelID?: string

    Optional EXPLICIT realtime model choice (MJ: AI Models.ID). When set, that exact model is used — it must be Active, of AIModelType Realtime, and have an active vendor whose DriverClass resolves an API key. If the preferred model cannot be satisfied the prepare FAILS with a clear reason (no silent fallback — the user explicitly chose). When omitted, the default highest-PowerRank resolution applies.

    PriorTranscript?: string

    Pre-formatted, role-tagged transcript lines (User: … / Assistant: …, newline-separated) from the caller's PRIOR session leg(s) when this session RESUMES one (lastSessionId). The transport layer (the MJServer resolver) loads, ownership-checks, and caps this (~30 turns / ~8k chars, oldest dropped) before threading it here; the service only FRAMES it into the system prompt as a clearly-labeled prior-conversation section so the model remembers the previous leg. Optional — absent for fresh sessions, and any upstream load failure simply omits it (hydration never blocks a start).

    SelfNames?: string[]

    The names the meeting-aware prompt tells the agent it answers to (its own display name + aliases). Used ONLY to phrase the "you are addressed when someone says one of these" guidance; the actual addressing GATE is the bridge's RegexAddressedMatcher. Ignored unless DisableAutoResponse.

    TargetAgentID: string

    The top-level target agent the co-agent voices on behalf of (a runtime parameter).

    UserID?: string

    Optional user-scope id for memory/context retrieval (falls back to the context user).