Skip to main content

MandaitorExecutionsClient

@mandaitor/sdk


@mandaitor/sdk / MandaitorExecutionsClient

Class: MandaitorExecutionsClient

Defined in: @mandaitor/sdk/dist/executions.d.ts:171

The execution API for one agent. It opens the agent's session itself, bound to a key it makes for itself (DPoP), and opens a new one when it expires or ends.

Constructors​

Constructor​

new MandaitorExecutionsClient(config): MandaitorExecutionsClient

Defined in: @mandaitor/sdk/dist/executions.d.ts:179

Parameters​

config​

MandaitorExecutionsClientConfig

Returns​

MandaitorExecutionsClient

Methods​

getExecution()​

getExecution(executionId): Promise<Execution>

Defined in: @mandaitor/sdk/dist/executions.d.ts:193

Reads one of this agent's executions.

Parameters​

executionId​

string

Returns​

Promise<Execution>


requestExecution()​

requestExecution(request): Promise<{ execution: Execution; replayed: boolean; }>

Defined in: @mandaitor/sdk/dist/executions.d.ts:188

Asks for an execution. replayed is true when the idempotency key had already named this request, and the answer is that execution as it is now.

Safe to retry: the API's own retry signals (IDEMPOTENCY_IN_PROGRESS, RATE_LIMITED, AUDIT_UNAVAILABLE, TARGET_UNAVAILABLE) and a request that got no answer are retried with the same key, which never writes twice.

Parameters​

request​

ToolRequest

Returns​

Promise<{ execution: Execution; replayed: boolean; }>


waitForExecution()​

waitForExecution(executionId, options?): Promise<Execution>

Defined in: @mandaitor/sdk/dist/executions.d.ts:202

Reads the execution until until holds: by default, until it is final, waits for an approval, or is UNKNOWN. An UNKNOWN execution is not final: Mandaitor reads it back again for about 41 hours, and a person of the tenant resolves what that does not settle, so waiting longer here rarely helps. Throws a MandaitorTimeoutError when until does not hold within timeoutMs.

Parameters​

executionId​

string

options?​
intervalMs?​

number

timeoutMs?​

number

until?​

(execution) => boolean

Returns​

Promise<Execution>