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
ContextWindowto 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
ContextWindowseeding only the task text - the thin back-compat wrapper overinit_window_seededused by callers that carry a single task string (the imperative engine and existing tests). - init_
window_ seeded - Initialize a
ContextWindowfrom a blueprint and seed its regions from a name→content map. Adds each layout region plus the infratool_results/conversationregions, then fills each seed whose key matches a declared region. Thetaskkey gets the legacy fallback: if there is no region literally namedtask, 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.