Skip to content

rulvar API reference


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

PropertyTypeDescriptionDefined in
agent{ agentType: string; label?: string; }-packages/core/src/l0/spi/toolsource.ts:31
agent.agentTypestring-packages/core/src/l0/spi/toolsource.ts:31
agent.label?string-packages/core/src/l0/spi/toolsource.ts:31
cwdstringIsolation working directory; host cwd under isolation 'none'.packages/core/src/l0/spi/toolsource.ts:33
isolationIsolationSpecThe spawn's declared isolation.packages/core/src/l0/spi/toolsource.ts:35
runIdstring-packages/core/src/l0/spi/toolsource.ts:28
signalAbortSignalFires on cancellation, budget ceiling, UsageLimits expiry.packages/core/src/l0/spi/toolsource.ts:37
spanIdstringTool 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

ParameterType
level"error" | "debug" | "info" | "warn"
msgstring
data?Json

Returns

void