Skip to main content

Module context_setup

Module context_setup 

Source
Expand description

Context-window setup helpers shared by the ECS pipeline’s spawner and stage-entry.

These are pure operations over a ContextWindow driven by a blueprint/layout.

Functions§

apply_layout
Swap a ContextWindow to a stage-specific layout in place, preserving each carried-over region’s existing content by name. Pure over the window (no engine/entity), so both the imperative engine and the ECS pipeline’s stage-entry can share it.
init_window
Initialize a ContextWindow seeding only the task text - the thin back-compat wrapper over init_window_seeded used by callers that carry a single task string (the imperative engine and existing tests).
init_window_seeded
Initialize a ContextWindow from a blueprint and seed its regions from a name→content map. Adds each layout region plus the infra tool_results/conversation regions, then fills each seed whose key matches a declared region. The task key gets the legacy fallback: if there is no region literally named task, it seeds the first pinned region instead. Pure over the window (no engine/entity), so both the imperative engine and the ECS pipeline’s spawner can share it.