Skip to content
1 min read · 245 words

Interface: RawTurnGate

Defined in: lib/classes/turn_gate.ts:24

Plain input object supplied to TurnGate at construction time.

Remarks

turnId and abortSignal are injected by the runner — callers constructing a gate via ctx.waitFor() never supply them directly.

abortSignal is AbortSignal (not AbortController) because the gate reacts to turn-level cancellation but cannot trigger it. The gate owns its own internal AbortController for gate.abort().

Properties

PropertyTypeDescriptionDefined in
abortSignal?AbortSignalThe turn's abort signal. When fired the gate self-rejects with @nhtio/adk!E_TURN_GATE_ABORTED.lib/classes/turn_gate.ts:38
createdAtstring | number | Date | DateTime<boolean>When this gate was created.lib/classes/turn_gate.ts:40
idstringStable unique identifier for this gate.lib/classes/turn_gate.ts:26
payloadunknownArbitrary data supplied to the gate opener; passed through to turnGateOpen listeners.lib/classes/turn_gate.ts:32
reasonstringHuman-readable label describing why this gate was opened (e.g. 'tool_approval').lib/classes/turn_gate.ts:30
schema?SchemaOptional validator schema for the resolution value. When present, resolve() validates before settling.lib/classes/turn_gate.ts:34
timeout?numberOptional timeout in milliseconds. When elapsed the gate self-rejects with @nhtio/adk!E_TURN_GATE_TIMEOUT.lib/classes/turn_gate.ts:36
turnIdstringThe ID of the turn that opened this gate.lib/classes/turn_gate.ts:28