/**
 * Section runtime engine state (M7 — Variant C, layered core).
 *
 * The state object is the single source of truth for stage, cohort,
 * readiness signals, and the resolved coordinator/controller handles
 * across one engine instance. The transition function in
 * `engine-transition.ts` is the only legal mutator; the adapter (M7
 * PR 2) reads the state via `SectionEngineCore.getState()` and emits
 * the bundled `SectionEngineOutput[]` to its bridges.
 *
 * Phases (the FSM). Adjustment A2 of the M7 implementation plan locks
 * this list to four phases that map 1:1 onto the M6 canonical stages:
 *
 *   `idle`             → no cohort yet (before `initialize`).
 *   `booting-section`  → cohort known, controller resolution pending. Maps to stage `composed`.
 *   `engine-ready`     → controller resolved. Maps to stage `engine-ready`.
 *   `interactive`      → readiness gate satisfied. Maps to stage `interactive`.
 *   `disposed`         → engine torn down. Maps to stage `disposed`.
 *
 * `loading-complete` is intentionally **not** an FSM phase — it is a
 * `SectionEngineOutput` emitted from the `interactive` phase when the
 * readiness signals satisfy `allLoadingComplete`. See
 * `engine-output.ts` for the output shape and the implementation
 * plan's Adjustment A2 fence.
 */
/**
 * Initial state. Kept as a function so callers cannot mutate a shared
 * default by reference.
 */
export function createInitialEngineState() {
    return {
        phase: "idle",
        cohort: null,
        controllerResolved: false,
        readinessSignals: {
            sectionReady: false,
            interactionReady: false,
            allLoadingComplete: false,
            runtimeError: false,
        },
        effectiveRuntime: null,
        effectiveToolsConfig: null,
        loadingCompleteEmitted: false,
        lastFrameworkError: null,
        itemCount: 0,
        loadedCount: 0,
    };
}
//# sourceMappingURL=engine-state.js.map