Skip to content

StageContext

Defined in: packages/engine/src/lib/planner/stage.ts:71

Request-scoped services the Engine gives every stage of a Planner.

readonly optional enumSnapshot?: ActionParameterEnumSnapshot

Defined in: packages/engine/src/lib/planner/stage.ts:100

The Action parameter enum values StageContext.validate checks actions against, captured once from the Vessel catalog in StageContext.origin. A stage that renders enum values for that same catalog (for example into a prompt) should read them from here, so it shows exactly the literals validation accepts even for values whose serialization is not stable across calls. The Engine always sets it; combinators that derive a context must forward it unchanged.


readonly instrument: Instrument

Defined in: packages/engine/src/lib/planner/stage.ts:86

The Engine’s telemetry seam. pipeline wraps every stage with it; a stage reports what happens inside it (for example a model call) with instrument.event. The Engine always sets it, to a no-op when none is configured; combinators that derive a context must forward it unchanged.


readonly logger: Logger

Defined in: packages/engine/src/lib/planner/stage.ts:79

The Engine’s logger. Log through it so stage logs share the Engine’s sink and redaction.


readonly origin: PlanningInput

Defined in: packages/engine/src/lib/planner/stage.ts:88

The untouched input the Engine passed to the first stage.


readonly optional signal?: AbortSignal

Defined in: packages/engine/src/lib/planner/stage.ts:77

Cancels in-flight work for the request. Every stage must honour it so that cancelled requests, and later concurrent combinators, stop spending on work nobody will use.


readonly validate: ValidateCandidate

Defined in: packages/engine/src/lib/planner/stage.ts:90

Heals and validates a candidate against the request in StageContext.origin.