Skip to content

Interface: HumanAdapter ​

Defined in: ports/human-adapter.ts:9

Runtime port for outbound human notifications and bidirectional human-in-the-loop adjudications.

Dispatched via RuntimeExecutorRegistry.humanChannels[node.type] to page human operators, await schema-validated decisions, and cancel superseded decision requests.

Methods ​

cancelDecision()? ​

ts
cancelDecision?(runId, requestId): Promise<void>;

Defined in: ports/human-adapter.ts:47

Cancels an in-flight human decision request when a sibling branch or interrupt supersedes it.

Dismisses or updates the pending prompt in the external channel for (runId, requestId).

Parameters ​

ParameterTypeDescription
runIdstringIdentifier of the harness run owning the request.
requestIdstringIdentifier of the decision request to cancel.

Returns ​

Promise<void>

Resolves once the cancellation has been processed.


notify() ​

ts
notify(message): Promise<void>;

Defined in: ports/human-adapter.ts:19

Sends a one-way notification message to the configured human channel.

Delivers formatted alert or status text without blocking on a human response.

Parameters ​

ParameterTypeDescription
messagestringFormatted notification text to deliver.

Returns ​

Promise<void>

Resolves once the notification has been dispatched.


requestDecision() ​

ts
requestDecision<TRequest, TResponse>(req): Promise<TResponse>;

Defined in: ports/human-adapter.ts:33

Requests a structured decision from a human operator and awaits a validated response.

Validates the human's reply against req.responseSchema before resolving.

Type Parameters ​

Type ParameterDescription
TRequestRequest brief payload type.
TResponseValidated response payload type.

Parameters ​

ParameterTypeDescription
reqHumanDecisionRequest<TRequest, TResponse>Decision request descriptor and response schema.

Returns ​

Promise<TResponse>

Schema-validated human decision response.

Released under the MIT License.