Build the per-frame visibility check. Merges consumer rules on top
of the kit defaults, then closes over ctx so each chrome-id
lookup runs its rule against the current state.
VisibilityRules entries may be either fluent Condition values
(callable) or raw Rule trees — we normalize at lookup time.
Predicates are O(1) and run once per chrome id per frame; no
memoization in v1 — profile before adding any.
ChromeCtx is the legacy shape; surfaces still on it get mode='normal'
and DEFAULT_ALLOWED_CAPABILITIES filled in here, so a caller that never
opted into modality behaves exactly like one sitting in normal mode.
Build the per-frame visibility check. Merges consumer rules on top of the kit defaults, then closes over
ctxso each chrome-id lookup runs its rule against the current state.VisibilityRulesentries may be either fluentConditionvalues (callable) or rawRuletrees — we normalize at lookup time.Predicates are O(1) and run once per chrome id per frame; no memoization in v1 — profile before adding any.
ChromeCtxis the legacy shape; surfaces still on it getmode='normal'andDEFAULT_ALLOWED_CAPABILITIESfilled in here, so a caller that never opted into modality behaves exactly like one sitting in normal mode.