rulvar API reference / @rulvar/core / ToolContext
Interface: ToolContext
Defined in: packages/core/src/l0/spi/toolsource.ts:27
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/src/l0/spi/toolsource.ts:31 |
agent.agentType | string | - | packages/core/src/l0/spi/toolsource.ts:31 |
agent.label? | string | - | packages/core/src/l0/spi/toolsource.ts:31 |
cwd | string | Isolation working directory; host cwd under isolation 'none'. | packages/core/src/l0/spi/toolsource.ts:33 |
isolation | IsolationSpec | The spawn's declared isolation. | packages/core/src/l0/spi/toolsource.ts:35 |
runId | string | - | packages/core/src/l0/spi/toolsource.ts:28 |
signal | AbortSignal | Fires on cancellation, budget ceiling, UsageLimits expiry. | packages/core/src/l0/spi/toolsource.ts:37 |
spanId | string | Tool span in the run > phase > agent > tool hierarchy. | packages/core/src/l0/spi/toolsource.ts:30 |
Methods
log()
ts
log(
level,
msg,
data?): void;Defined in: packages/core/src/l0/spi/toolsource.ts:39
Emits telemetry log events; never writes journal entries.
Parameters
| Parameter | Type |
|---|---|
level | "error" | "debug" | "info" | "warn" |
msg | string |
data? | Json |
Returns
void