Skip to content
1 min read · 236 words

Class: DispatchRunner

Constructors

Constructor

ts
new DispatchRunner(
   token: typeof CONSTRUCT_TOKEN,
   sourceCtx: TurnContext | undefined,
   turnInputPipeline: DispatchPipelineMiddlewareFn[],
   turnOutputPipeline: DispatchPipelineMiddlewareFn[],
   hooks:
  | DispatchRunnerFunctionalHookRegistrations
  | undefined,
   observers:
  | DispatchRunnerObservabilityHookRegistrations
  | undefined): DispatchRunner;

Parameters

ParameterType
tokentypeof CONSTRUCT_TOKEN
sourceCtxTurnContext | undefined
turnInputPipelineDispatchPipelineMiddlewareFn[]
turnOutputPipelineDispatchPipelineMiddlewareFn[]
hooks| DispatchRunnerFunctionalHookRegistrations | undefined
observers| DispatchRunnerObservabilityHookRegistrations | undefined

Returns

DispatchRunner

Methods

dispatch()

ts
static dispatch(input: RawDispatchRunnerInput): Promise<void>;

Dispatches a single LLM execution.

Parameters

ParameterTypeDescription
inputRawDispatchRunnerInputThe dispatch input. Provide either source (derived path) or raw (standalone).

Returns

Promise<void>

Remarks

Constructs an @nhtio/adk!DispatchContext (derived from source or from raw), runs the iteration loop, and resolves when middleware/executor signals completion via ctx.ack() or the abort signal fires. Rejects with the nack error when middleware/executor calls ctx.nack(err). Pipeline and executor errors are wrapped, surfaced on the observability error hook, and re-thrown.

Throws

@nhtio/adk!E_INVALID_LLM_DISPATCH_INPUT when the input does not satisfy validation, or when neither source nor raw is provided, or when both are provided.


isDispatchRunner()

ts
static isDispatchRunner(value: unknown): value is DispatchRunner;

Returns true if value is a DispatchRunner instance.

Parameters

ParameterTypeDescription
valueunknownThe value to test.

Returns

value is DispatchRunner

true when value is a DispatchRunner instance.

Remarks

Uses @nhtio/adk!isInstanceOf for cross-realm safety.