Member Junction
    Preparing search index...

    Function ResolveEffectiveRealtimeConfig

    • Resolves the EFFECTIVE realtime configuration from the layers of the contract by tolerantly parsing each (see ParseRealtimeTypeConfiguration), deep-merging them (later wins per key, see DeepMergeConfigs), and normalizing into the typed RealtimeCoAgentConfig shape (wrong-typed fields dropped, never thrown on).

      Precedence (lowest → highest): AIAgentType.DefaultConfiguration < co-agent AIAgent.TypeConfiguration < target agent AIAgent.TypeConfiguration < runtime override. This is the single, surface-agnostic precedence cascade for model + voice + persona across EVERY realtime host (native chat, LiveKit, future Zoom/Teams) — see plans/realtime/realtime-core-host-convergence.md. The target layer is what lets a voiced agent (Sage, Marketing Agent, …) carry its own persisted voice/model that the shared co-agent then speaks with; it wins over the co-agent's defaults but yields to an explicit per-session runtime override.

      Parameters

      • typeDefaultJson: string

        The agent TYPE's DefaultConfiguration JSON (base layer).

      • agentJson: string

        The CO-AGENT's TypeConfiguration JSON (shared per-co-agent layer).

      • overridesJson: string

        Runtime overrides JSON (per-session layer; already authorization-gated by the caller).

      • OptionaltargetAgentJson: string

        Optional TARGET agent's TypeConfiguration JSON (per-voiced-agent layer). Merged ABOVE the co-agent and BELOW the app/runtime-override layers regardless of argument position. Omit when there is no distinct target (e.g. the co-agent voicing itself).

      • OptionalappSettingsJson: string

        Optional APP layer — Application.AgentSettings.Realtime translated into the canonical {"realtime":{…}} shape (use BuildAppRealtimeOverridesJson). Merged ABOVE the target and BELOW the runtime override. Omit when no app context is known.

      • OptionaldynamicAllowedAgents: RealtimeAllowedAgent[]

        Optional channel-registered delegation targets added at runtime (Move 3b), union-accumulated on top of the layer-sourced allowedAgents.

      Returns RealtimeCoAgentConfig

      The normalized effective configuration. realtime is absent when no layer supplied a usable section.