Skip to content

rulvar API reference


rulvar API reference / @rulvar/core / ToolRuntime

Interface: ToolRuntime

Defined in: packages/core/src/runtime/agent-loop.ts:198

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/src/runtime/agent-loop.ts:200
defsToolDef<SchemaSpec>[]-packages/core/src/runtime/agent-loop.ts:199
permission?(call) => Promise<PermissionGate>Permission chain evaluation (M3-T03); absent = every call allowed.packages/core/src/runtime/agent-loop.ts:204

Methods

contextFor()

ts
contextFor(toolName): ToolContext;

Defined in: packages/core/src/runtime/agent-loop.ts:202

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

Parameters

ParameterType
toolNamestring

Returns

ToolContext