Skip to content

rulvar API reference


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

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

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

Returns

void