Folds the channels sections of the cascade's layers (lowest precedence first) into one
normalized RealtimeChannelsConfig.
This is per-channel, not per-key: each layer's include / exclude are decisions about
individual channels, so the most specific layer to mention a channel wins — and within one layer
exclude beats include. A plain deep merge would be wrong here, because it replaces arrays
wholesale: an app layer's exclude: ['Media'] would silently erase the agent layer's
exclude: ['RemoteBrowser']. (Allowed-agent accumulation exists for the same reason.)
config and displayPolicy merge per channel key, later layers winning. requireZeroDataRetentionFor
is a union (a requirement is only ever added to).
Parameters
layers: readonlyunknown[]
Raw channels sections, lowest precedence first. Absent/invalid ones are skipped.
Folds the
channelssections of the cascade's layers (lowest precedence first) into one normalized RealtimeChannelsConfig.This is per-channel, not per-key: each layer's
include/excludeare decisions about individual channels, so the most specific layer to mention a channel wins — and within one layerexcludebeatsinclude. A plain deep merge would be wrong here, because it replaces arrays wholesale: an app layer'sexclude: ['Media']would silently erase the agent layer'sexclude: ['RemoteBrowser']. (Allowed-agent accumulation exists for the same reason.)configanddisplayPolicymerge per channel key, later layers winning.requireZeroDataRetentionForis a union (a requirement is only ever added to).