Skip to content

Interface: EscalateCapabilityBuilder<TPayload, TResponse> ​

Defined in: builders/escalate-capability-builder.ts:17

Fluent sub-builder for voluntary exogenous human escalation ($cap.escalate(interrupt, $esc => ...)).

Binds a bidirectional HumanNode authority, a Zod decision response schema, and an optional capability lease elevation rule.

Extends ​

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownEscalation brief payload type validated by interrupt.schema.
TResponseunknownHuman decision response type validated by responseSchema.

Methods ​

elevateLeaseWhen() ​

ts
elevateLeaseWhen(predicate, leaseMapper): EscalateCapabilityBuilder<TPayload, TResponse>;

Defined in: builders/escalate-capability-builder.ts:59

Registers a conditional capability lease elevation rule evaluated when the human responds.

Grants the LeaseDelta returned by leaseMapper(decision) whenever predicate(decision) holds.

Parameters ​

ParameterTypeDescription
predicate(decision) => booleanPredicate testing whether a lease should be granted.
leaseMapper(decision) => LeaseDeltaMapper producing the LeaseDelta to grant.

Returns ​

EscalateCapabilityBuilder<TPayload, TResponse>

New immutable escalation builder.


response() ​

ts
response<TNewResp>(schema): EscalateCapabilityBuilder<TPayload, TNewResp>;

Defined in: builders/escalate-capability-builder.ts:45

Binds the Zod validation schema for the human authority's decision response.

Resets any previously bound elevateLeaseWhen rule when the response type changes.

Type Parameters ​

Type ParameterDescription
TNewRespValidated human decision response type.

Parameters ​

ParameterTypeDescription
schemaZodType<TNewResp>Zod schema validating the human response.

Returns ​

EscalateCapabilityBuilder<TPayload, TNewResp>

New immutable escalation builder.


to() ​

ts
to<TMode>(human): EscalateCapabilityBuilder<TPayload, TResponse>;

Defined in: builders/escalate-capability-builder.ts:30

Binds the bidirectional HumanNode authority paged when the escalation tool is invoked.

Throws at builder call time if human's channel is 'notify-only'.

Type Parameters ​

Type ParameterDefault typeDescription
TMode extends "bidirectional" | "notify-only""bidirectional" | "notify-only"Interaction mode of human ('bidirectional' | 'notify-only').

Parameters ​

ParameterTypeDescription
humanMaybeBuilder<HumanNode<TMode>>Target human authority node or builder.

Returns ​

EscalateCapabilityBuilder<TPayload, TResponse>

New immutable escalation builder.


toAST() ​

ts
toAST(): EscalateCapabilityNode;

Defined in: ast/ast-builder.ts:20

Compiles the current builder configuration into a deeply frozen passive AST node.

Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.

Returns ​

EscalateCapabilityNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Released under the MIT License.