Skip to content

Function: executeCommand() ​

ts
function executeCommand<TIn, TOut, THandle>(
   node, 
   input, 
   ctx
): Promise<TOut>;

Defined in: runtime/step/execute-command.ts:19

Executes a passive CommandNode (P.command(id)) by validating input, invoking node.fn(validatedInput, ctx), and validating the returned output (SPEC.md §2.3 & §3.7).

Enforces Declarative Compilation Invariant 6 (node is a passive AST record with zero .execute method; execution occurs exclusively here).

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownValidated command input payload type.
TOutunknownValidated command output payload type.
THandleunknownRuntime handle type of the active isolation scope.

Parameters ​

ParameterTypeDescription
nodeCommandNode<TIn, TOut, THandle>Passive CommandNode AST definition.
inputTInRaw or pre-mapped command input payload.
ctxStepExecutionContext<THandle>Active step execution context.

Returns ​

Promise<TOut>

Schema-validated command output payload.

Released under the MIT License.