/** * Graph Execution Engine v2 — per-turn `` system-prompt block. * * Renders the live in-memory graph registry into a compact orientation block * injected into the system prompt each turn: "where am I in the workflow, * what runs next", sourced from {@link EngineState} (the engine-v2 runtime). * * The renderer is pure. It takes a snapshot list (see * `GraphToolSet.liveEngineStates()`), renders the fields the `EngineState` * contract guarantees, and returns `""` when there is nothing to show. The * injection site treats an empty string as a clean no-op, so no stray tags * ever reach the prompt when no graph is live. * * Comment on the `?? fallback` / truthiness guards removed here (B2): every * one of them tested a field the types declare non-optional * (`state.nodes`, `state.loopGroups`, `state.phase`, `state.graphId`, * `state.graphDeclaration`, `g.traversalCount`, `g.maxTraversals`), so it was * unreachable for any state that can exist. Its only real effect was to render * a corrupt state as a plausible-looking block instead of a visible failure. * Genuinely optional fields (a node's `errorReason`) keep their guards. * * Design reference: `.rolebox/design/engine-state-machine.md`. */ import type { EngineState } from "../../types.engine-v2.ts"; /** * Render the `` block for the given live engine snapshots. * * @param states Engine-state snapshots, typically * `GraphToolSet.liveEngineStates()`. Each becomes one `` element in * registry order. * @returns the block, or `""` when `states` is empty (no live graph) — the * caller treats the empty string as a clean no-op. */ export declare function buildEngineGraphStateBlock(states: readonly EngineState[]): string; //# sourceMappingURL=graph-state-block.d.ts.map