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
AstBuilder<EscalateCapabilityNode<TPayload,TResponse>>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Escalation brief payload type validated by interrupt.schema. |
TResponse | unknown | Human decision response type validated by responseSchema. |
Methods
elevateLeaseWhen()
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
| Parameter | Type | Description |
|---|---|---|
predicate | (decision) => boolean | Predicate testing whether a lease should be granted. |
leaseMapper | (decision) => LeaseDelta | Mapper producing the LeaseDelta to grant. |
Returns
EscalateCapabilityBuilder<TPayload, TResponse>
New immutable escalation builder.
response()
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 Parameter | Description |
|---|---|
TNewResp | Validated human decision response type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNewResp> | Zod schema validating the human response. |
Returns
EscalateCapabilityBuilder<TPayload, TNewResp>
New immutable escalation builder.
to()
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 Parameter | Default type | Description |
|---|---|---|
TMode extends "bidirectional" | "notify-only" | "bidirectional" | "notify-only" | Interaction mode of human ('bidirectional' | 'notify-only'). |
Parameters
| Parameter | Type | Description |
|---|---|---|
human | MaybeBuilder<HumanNode<TMode>> | Target human authority node or builder. |
Returns
EscalateCapabilityBuilder<TPayload, TResponse>
New immutable escalation builder.
toAST()
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
Deeply frozen passive AST node.