Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/core / / ToolExecutionContext
Interface: ToolExecutionContext<TDeps>
Defined in: packages/core/src/contracts/tool.ts:217
Per-call execution context handed to Tool.execute(...). Carries the stable toolCallId, the parent RunContext, an AbortSignal tied to the surrounding agent run, structured tracer / logger handles, the streaming progress / content emitters, and a per-call secrets accessor scoped to the tool's secretsAllowed ACL.
Stable
Type Parameters
| Type Parameter | Default type |
|---|---|
TDeps | unknown |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
logger | readonly | Logger | - | packages/core/src/contracts/tool.ts:222 |
runContext | readonly | RunContext<TDeps> | - | packages/core/src/contracts/tool.ts:219 |
secrets | readonly | ToolSecretsAccessor | Per-call secrets accessor. The accessor enforces the tool's secretsAllowed ACL — calling require(...) for a key that is not on the allowlist throws SecretAccessDeniedError. | packages/core/src/contracts/tool.ts:228 |
signal | readonly | AbortSignal | - | packages/core/src/contracts/tool.ts:220 |
toolCallId | readonly | string | - | packages/core/src/contracts/tool.ts:218 |
tracer | readonly | Tracer | - | packages/core/src/contracts/tool.ts:221 |
Methods
reportProgress()
reportProgress(
current,
total?,
message?): void;Defined in: packages/core/src/contracts/tool.ts:235
Emit a progress event to subscribers of agent.stream(...). No-op on tools without streamingHint: true AND on aborted streams. The counter pair (current, total?) is consumer-rendered as a percentage when both fields are present.
Parameters
| Parameter | Type |
|---|---|
current | number |
total? | number |
message? | string |
Returns
void
streamContent()
streamContent(chunk): void;Defined in: packages/core/src/contracts/tool.ts:241
Emit one chunk of content. Concatenated into the tool's assembled output per the buffer-becomes-output discipline. No-op on tools without streamingHint: true AND on aborted streams.
Parameters
| Parameter | Type |
|---|---|
chunk | ContentChunk |
Returns
void