rulvar API reference / @rulvar/rulvar / ToolContext
Interface: ToolContext
Defined in: packages/core/dist/index.d.ts
The context handed to execute (and to permission hooks and canUseTool). Deliberately exposes NO spawn primitives: tools are leaves of the call-and-return tree (invariant I3); all spawning flows through Ctx primitives.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
agent | { agentType: string; label?: string; } | - | packages/core/dist/index.d.ts |
agent.agentType | string | - | packages/core/dist/index.d.ts |
agent.label? | string | - | packages/core/dist/index.d.ts |
cwd | string | Isolation working directory; host cwd under isolation 'none'. | packages/core/dist/index.d.ts |
isolation | IsolationSpec | The spawn's declared isolation. | packages/core/dist/index.d.ts |
runId | string | - | packages/core/dist/index.d.ts |
signal | AbortSignal | Fires on cancellation, budget ceiling, UsageLimits expiry. | packages/core/dist/index.d.ts |
spanId | string | Tool span in the run > phase > agent > tool hierarchy. | packages/core/dist/index.d.ts |
Methods
log()
ts
log(
level,
msg,
data?): void;Defined in: packages/core/dist/index.d.ts
Emits telemetry log events; never writes journal entries.
Parameters
| Parameter | Type |
|---|---|
level | "debug" | "info" | "warn" | "error" |
msg | string |
data? | Json |
Returns
void