Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/rulvar / ToolRuntime

Interface: ToolRuntime

Defined in: packages/core/dist/index.d.ts

The spawn's frozen toolset plus the per-call context factory, prepared by the ctx layer (M3-T01). The contracts are the canonical identity projection already hashed into the spawn's content key; the loop sends exactly them to the model.

Properties

PropertyTypeDescriptionDefined in
contractsToolContract[]-packages/core/dist/index.d.ts
defsToolDef<SchemaSpec<unknown>>[]-packages/core/dist/index.d.ts
executeExternal?(def, args, ordinal) => Promise<unknown>Runs a non-inprocess tool out of process through the engine's registered ToolExecutorProvider (RV-216). Present whenever the frozen toolset holds any non-inprocess tool; the ctx layer mints the tool span and idempotency key and wires the provider. A throw becomes the call's error tool result exactly like an inprocess execute throw. ordinal is the call's 1-based position in this agent invocation's tool loop (checkpoint-stable across suspension and crash resume); the ctx layer folds it with the agent entry's seq into the idempotency key, so two separate calls with identical arguments do not collide while an at-least-once retry of one call keeps its key (P0.4).packages/core/dist/index.d.ts
permission?(call) => Promise<PermissionGate>Permission chain evaluation (M3-T03); absent = every call allowed.packages/core/dist/index.d.ts

Methods

contextFor()

ts
contextFor(toolName): ToolContext;

Defined in: packages/core/dist/index.d.ts

Mints a per-call ToolContext (fresh tool span under the agent span).

Parameters

ParameterType
toolNamestring

Returns

ToolContext