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