AgentToolContext
Namespace: E2E
public sealed class AgentToolContextWhat a project tool reaches of the step it runs in (upstream’s ToolContext): a look at the screen, and a screenshot kept
as evidence of the step. A tool that changes the app may not look: it observes in a separate call.
Inheritance: object
Constructors
Section titled “Constructors”AgentToolContext(StepExecutorContext, bool)
Section titled “AgentToolContext(StepExecutorContext, bool)”public AgentToolContext(StepExecutorContext context, bool mutates)Parameters
| Name | Type | Description |
|---|---|---|
context |
StepExecutorContext | The context of the step the tool runs in. |
mutates |
bool | Whether the tool changes the app. Such a tool cannot look at the screen. |
Methods
Section titled “Methods”AttachScreenshotAsync(ExecutorPixels, string, CancellationToken)
Section titled “AttachScreenshotAsync(ExecutorPixels, string, CancellationToken)”public Task<string> AttachScreenshotAsync(ExecutorPixels pixels, string label, CancellationToken cancellationToken = default)Upstream’s attachScreenshot: keeps pixels the tool saw as a screenshot of the step, and returns where it landed.
Parameters
| Name | Type | Description |
|---|---|---|
pixels |
ExecutorPixels | |
label |
string | |
cancellationToken |
CancellationToken |
Returns: Task<string>
ObserveAsync(ExecutorObserveOptions?, CancellationToken)
Section titled “ObserveAsync(ExecutorObserveOptions?, CancellationToken)”public Task<ExecutorObservation> ObserveAsync(ExecutorObserveOptions? options = null, CancellationToken cancellationToken = default)Upstream’s observe. A mutating tool is refused with POLICY_DENIED.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ExecutorObserveOptions | |
cancellationToken |
CancellationToken |
Returns: Task<ExecutorObservation>