StageContext
Defined in: packages/engine/src/lib/planner/stage.ts:77
Request-scoped services the Engine gives every stage of a Planner.
Properties
Section titled “Properties”enumSnapshot?
Section titled “enumSnapshot?”
readonlyoptionalenumSnapshot?:ActionParameterEnumSnapshot
Defined in: packages/engine/src/lib/planner/stage.ts:106
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.
instrument
Section titled “instrument”
readonlyinstrument:Instrument
Defined in: packages/engine/src/lib/planner/stage.ts:92
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.
logger
Section titled “logger”
readonlylogger:Logger
Defined in: packages/engine/src/lib/planner/stage.ts:85
The Engine’s logger. Log through it so stage logs share the Engine’s sink and redaction.
origin
Section titled “origin”
readonlyorigin:PlanningInput
Defined in: packages/engine/src/lib/planner/stage.ts:94
The untouched input the Engine passed to the first stage.
signal?
Section titled “signal?”
readonlyoptionalsignal?:AbortSignal
Defined in: packages/engine/src/lib/planner/stage.ts:83
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.
validate
Section titled “validate”
readonlyvalidate: {(candidate):Result<ValidatedCandidate,EngineError>; (candidate):Result<ValidatedReplylessCandidate,EngineError>; }
Defined in: packages/engine/src/lib/planner/stage.ts:96
Heals and validates a candidate against the request in StageContext.origin.
Call Signature
Section titled “Call Signature”(
candidate):Result<ValidatedCandidate,EngineError>
Parameters
Section titled “Parameters”candidate
Section titled “candidate”Returns
Section titled “Returns”Result<ValidatedCandidate, EngineError>
Call Signature
Section titled “Call Signature”(
candidate):Result<ValidatedReplylessCandidate,EngineError>
Parameters
Section titled “Parameters”candidate
Section titled “candidate”Returns
Section titled “Returns”Result<ValidatedReplylessCandidate, EngineError>