Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
418 changes: 416 additions & 2 deletions docs-site/src/content/docs/api/E2E.Engine/IEngineSession.md

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions docs-site/src/content/docs/api/E2E/AgentTools.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "AgentTools"
description: "The built-in agent's tool vocabulary (upstream's agent/primitives.ts). CreateGrammarTools and CreateVerdictTool() are public, for a tool loop or an executor..."
description: "The built-in agent's tool vocabulary (upstream's agent/primitives.ts). CreateGrammarTools and CreateVerdictTool are public, for a tool loop or an executor th..."
editUrl: false
prev: false
next: false
Expand All @@ -20,7 +20,7 @@ public static class AgentTools


The built-in agent's tool vocabulary (upstream's `agent/primitives.ts`). `CreateGrammarTools` and
[CreateVerdictTool()](#E2E_AgentTools_CreateVerdictTool) are public, for a tool loop or an executor that keeps the built-in actions and verdicts.
`CreateVerdictTool` are public, for a tool loop or an executor that keeps the built-in actions and verdicts.

**Inheritance:** [object](https://learn.microsoft.com/dotnet/api/system.object)

Expand Down Expand Up @@ -73,17 +73,23 @@ agent's is. The screen presenter and the failure causes stay internal, as upstre
**Returns:** [IReadOnlyList<ToolLoopTool>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)

<a id="E2E_AgentTools_CreateVerdictTool_"></a>
<a id="E2E_AgentTools_CreateVerdictTool"></a>
<a id="E2E_AgentTools_CreateVerdictTool_System_Nullable_E2E_ExecutorStepKind__"></a>

### CreateVerdictTool()
### CreateVerdictTool(ExecutorStepKind?)


```csharp
public static VerdictTool CreateVerdictTool()
public static VerdictTool CreateVerdictTool(ExecutorStepKind? kind = null)
```


Upstream's `createVerdictTool`: the `done` tool with the closed blocked-code policy, and the verdict it collected. Make a
fresh one for each step: the first accepted verdict is final.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `kind` | `ExecutorStepKind?` | The step's kind. On [Act](/api/E2E/ExecutorStepKind/#E2E_ExecutorStepKind_Act), `ASSERTION_INCONCLUSIVE` is dropped from a failed verdict the same way, since only an assertion can be inconclusive. Omit it to keep every code a failed verdict sends. |

**Returns:** [VerdictTool](/api/E2E/VerdictTool/)
52 changes: 50 additions & 2 deletions docs-site/src/content/docs/api/E2E/AssertOptions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "AssertOptions"
description: "agent.assert: one judgment and one repair round, within Timeout."
description: "agent.assert: one judgment and one repair round within Timeout, or opt-in bounded viewport exploration (Explore)."
editUrl: false
prev: false
next: false
Expand All @@ -19,7 +19,7 @@ public sealed class AssertOptions
```


`agent.assert`: one judgment and one repair round, within [Timeout](#E2E_AssertOptions_Timeout).
`agent.assert`: one judgment and one repair round within [Timeout](#E2E_AssertOptions_Timeout), or opt-in bounded viewport exploration ([Explore](#E2E_AssertOptions_Explore)).

**Inheritance:** [object](https://learn.microsoft.com/dotnet/api/system.object)

Expand All @@ -42,6 +42,54 @@ The named agent whose judge decides. Defaults to `default`.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string)

<a id="E2E_AssertOptions_Explore_"></a>
<a id="E2E_AssertOptions_Explore"></a>

### Explore


```csharp
public bool Explore { get; init; }
```


Look around by scrolling before judging; defaults to false. An exploring assertion offers `observe`, `scroll`,
`scroll_to`, and project tools declared read-only, and `screenshot` when [Vision](#E2E_AssertOptions_Vision) is not [Off](/api/E2E/VisionMode/#E2E_VisionMode_Off).
It uses the agent's `Model`, even when a `Judge` is configured. Insufficient evidence within the time or action and model
budget fails `ASSERTION_INCONCLUSIVE`.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

<a id="E2E_AssertOptions_MaxModelCalls_"></a>
<a id="E2E_AssertOptions_MaxModelCalls"></a>

### MaxModelCalls


```csharp
public int? MaxModelCalls { get; init; }
```


Model-call budget; requires [Explore](#E2E_AssertOptions_Explore) (`INVALID_ARGUMENT` otherwise). Defaults to min(6, the configured `MaxModelCalls`), and can only lower the configured limit.

**Value:** [int?](https://learn.microsoft.com/dotnet/api/system.int32)

<a id="E2E_AssertOptions_MaxSteps_"></a>
<a id="E2E_AssertOptions_MaxSteps"></a>

### MaxSteps


```csharp
public int? MaxSteps { get; init; }
```


Scroll budget; requires [Explore](#E2E_AssertOptions_Explore) (`INVALID_ARGUMENT` otherwise). Defaults to min(10, the configured `MaxSteps`), and can only lower the configured limit.

**Value:** [int?](https://learn.microsoft.com/dotnet/api/system.int32)

<a id="E2E_AssertOptions_Params_"></a>
<a id="E2E_AssertOptions_Params"></a>

Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/api/E2E/BuiltInAgentOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string? System { get; init; }
```


Appended to the built-in execution rules. Only the act loop reads it.
Appended to the built-in execution rules. Read by the act loop and by an exploring assertion's loop.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string)

Expand Down
17 changes: 16 additions & 1 deletion docs-site/src/content/docs/api/E2E/DefaultAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ Upstream's `createBuiltInAgent` (`agent/default-agent.ts`): the tool loop with t

## Fields

<a id="E2E_DefaultAgent_AssertRules"></a>

### AssertRules


```csharp
public const string AssertRules = "You are judging exactly one assertion against the current application screen.\n- Use only the observation, scrolling, and read-only project tools offered to you. Do not tap, type, navigate, or change application state.\n- Combine evidence from every observation in this step. Items need not fit in one viewport. Scroll only to inspect the assertion's subject, and stop when you have enough evidence.\n- Node ids belong to the observed tree. Never invent ids; use scroll_to for a listed node or scroll to inspect more of the current screen.\n- Each scroll result contains a fresh observation. When screenshots are shown, each result includes fresh pixels too.\n- Conclude passed when the collected evidence establishes the assertion, failed with code ASSERTION_FAILED when it contradicts the assertion, and failed with code ASSERTION_INCONCLUSIVE when the available evidence or remaining budget cannot establish an answer."
```


Assertion-specific rules (upstream's `ASSERT_RULES`): they allow evidence gathered across several viewports. The port's verdict tool is `done`,
which takes `code`.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string)

<a id="E2E_DefaultAgent_BaseRules"></a>

### BaseRules
Expand Down Expand Up @@ -58,7 +73,7 @@ public static IStepExecutor CreateBuiltInAgent(BuiltInAgentOptions? options = nu

Builds the built-in step executor: the model loop with the grammar tools of the target's engine and the project
tools. It drives the step's own context, so it runs only where the runtime builds one, as a step's executor or inside a
custom executor that hands its context on.
custom executor that hands its context on. The act loop runs an act, and the assertion loop an exploring `agent.assert`.

**Parameters**

Expand Down
16 changes: 16 additions & 0 deletions docs-site/src/content/docs/api/E2E/ExecutorStep.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,19 @@ public IReadOnlyList<ExecutorSecret> Secrets { get; init; }
The secrets declared in the params, which `TypeSecretAsync` may fill.

**Value:** [IReadOnlyList&lt;ExecutorSecret&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)

<a id="E2E_ExecutorStep_Vision_"></a>
<a id="E2E_ExecutorStep_Vision"></a>

### Vision


```csharp
public VisionMode? Vision { get; init; }
```


Assert only: the [Vision](/api/E2E/AssertOptions/#E2E_AssertOptions_Vision) the call asked for, set only for an executor whose [Vision](/api/E2E/IStepExecutor/#E2E_IStepExecutor_Vision) is true.
[On](/api/E2E/VisionMode/#E2E_VisionMode_On) shows pixels beside the tree, [Only](/api/E2E/VisionMode/#E2E_VisionMode_Only) pixels alone; null when the call passed none.

**Value:** `VisionMode?`
16 changes: 16 additions & 0 deletions docs-site/src/content/docs/api/E2E/IStepExecutor.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ The version this executor reports. Upstream's `version`.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string)

<a id="E2E_IStepExecutor_Vision_"></a>
<a id="E2E_IStepExecutor_Vision"></a>

### Vision


```csharp
bool Vision { get; }
```


Whether the executor honors [Vision](/api/E2E/AssertOptions/#E2E_AssertOptions_Vision): the mode reaches it as [Vision](/api/E2E/ExecutorStep/#E2E_ExecutorStep_Vision). Without
this, the option fails the call with `UNSUPPORTED_CAPABILITY`, since only the executor decides what its model sees. Upstream's `vision`.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

<a id="E2E_IStepExecutor_RunStepAsync_"></a>
Expand Down
16 changes: 16 additions & 0 deletions docs-site/src/content/docs/api/E2E/ToolLoopExecutorOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ Builds the step's opening prompt: the first user message. Set this or [BuildMess

**Value:** [Func&lt;StepExecutorContext, Task&lt;string&gt;&gt;](https://learn.microsoft.com/dotnet/api/system.func-2)

<a id="E2E_ToolLoopExecutorOptions_InconclusiveOnOverflow_"></a>
<a id="E2E_ToolLoopExecutorOptions_InconclusiveOnOverflow"></a>

### InconclusiveOnOverflow


```csharp
public bool InconclusiveOnOverflow { get; init; }
```


Fails a context overflow as `ASSERTION_INCONCLUSIVE` instead of shrinking the history and retrying: for an assertion loop
whose earlier screens are evidence it must not drop.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

<a id="E2E_ToolLoopExecutorOptions_Model_"></a>
<a id="E2E_ToolLoopExecutorOptions_Model"></a>

Expand Down
20 changes: 17 additions & 3 deletions docs-site/src/content/docs/api/E2E/ToolLoopResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ in a user turn right after the turn's tool results, since a tool message carries
## Constructors

<a id="E2E_ToolLoopResult__ctor_"></a>
<a id="E2E_ToolLoopResult__ctor_System_String_System_Boolean_E2E_ExecutorPixels_"></a>
<a id="E2E_ToolLoopResult__ctor_System_String_System_Boolean_E2E_ExecutorPixels_System_Boolean_"></a>

### ToolLoopResult(string, bool, ExecutorPixels?)
### ToolLoopResult(string, bool, ExecutorPixels?, bool)


```csharp
public ToolLoopResult(string Content, bool Failed = false, ExecutorPixels? Pixels = null)
public ToolLoopResult(string Content, bool Failed = false, ExecutorPixels? Pixels = null, bool ErrorText = false)
```


Expand All @@ -51,6 +51,7 @@ in a user turn right after the turn's tool results, since a tool message carries
| `Content` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
| `Failed` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | |
| `Pixels` | [ExecutorPixels](/api/E2E/ExecutorPixels/) | |
| `ErrorText` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | |

## Properties

Expand All @@ -67,6 +68,19 @@ public string Content { get; init; }

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string)

<a id="E2E_ToolLoopResult_ErrorText_"></a>
<a id="E2E_ToolLoopResult_ErrorText"></a>

### ErrorText


```csharp
public bool ErrorText { get; init; }
```


**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

<a id="E2E_ToolLoopResult_Failed_"></a>
<a id="E2E_ToolLoopResult_Failed"></a>

Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/api/E2E/VerdictTool.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed class VerdictTool


Upstream's `VerdictTool`: the conclusion tool, the policy that accepts or refuses the verdict a call carries, and the verdict it
collected. Made by [CreateVerdictTool()](/api/E2E/AgentTools/#E2E_AgentTools_CreateVerdictTool); the tool loop adds one to every vocabulary, so an executor of its own that
collected. Made by `CreateVerdictTool`; the tool loop adds one to every vocabulary, so an executor of its own that
drives a model outside the loop is the only caller of [Execute(ModelToolCall)](#E2E_VerdictTool_Execute_E2E_ModelToolCall_).

**Inheritance:** [object](https://learn.microsoft.com/dotnet/api/system.object)
Expand Down
6 changes: 3 additions & 3 deletions docs-site/src/content/docs/api/E2E/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ The core. Agent, Screen, Expect, the engines, model clients, config, and the rep
| [AgentOptions](/api/E2E/AgentOptions/) | One named agent, as upstream agents.<name>. Each entry starts from the built-in defaults; no agent inherits another's values. A call picks one with its Agent option. |
| [AgentTool](/api/E2E/AgentTool/) | A project tool the agent offers to the model beside its own: upstream's defineTool. It declares whether it changes the application and which platforms it is offered on; the agent owns dispatch and accounting. The tool's name is its key in Tools. |
| [AgentToolContext](/api/E2E/AgentToolContext/) | What 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. |
| [AgentTools](/api/E2E/AgentTools/) | The built-in agent's tool vocabulary (upstream's agent/primitives.ts). CreateGrammarTools and CreateVerdictTool() are public, for a tool loop or an executor that keeps the built-in actions and verdicts. |
| [AgentTools](/api/E2E/AgentTools/) | The built-in agent's tool vocabulary (upstream's agent/primitives.ts). CreateGrammarTools and CreateVerdictTool are public, for a tool loop or an executor that keeps the built-in actions and verdicts. |
| [AnthropicModel](/api/E2E/AnthropicModel/) | Anthropic Messages API client. The system prompt and the newest message carry cache breakpoints, as upstream marks them, so each turn of a tool loop reads the previous turn's prefix from the cache. |
| [AnthropicModelOptions](/api/E2E/AnthropicModelOptions/) | |
| [App](/api/E2E/App/) | Opens and resets the app under test. A relative URL is resolved against BaseUrl; no URL opens the base URL. |
| [AppConfig](/api/E2E/AppConfig/) | |
| [AssertOptions](/api/E2E/AssertOptions/) | agent.assert: one judgment and one repair round, within Timeout. |
| [AssertOptions](/api/E2E/AssertOptions/) | agent.assert: one judgment and one repair round within Timeout, or opt-in bounded viewport exploration (Explore). |
| [AsymmetricMatcher](/api/E2E/AsymmetricMatcher/) | A stand-in for a value inside ToEqual, ToMatchObject, ToContain, and ToHaveProperty: Any(Type) in place of a number, ObjectContaining(object) in place of a record. The structural matchers ask it whether a value matches instead of comparing. |
| [AwsCredentials](/api/E2E/AwsCredentials/) | AWS access key credentials for Signature Version 4. |
| [BedrockModel](/api/E2E/BedrockModel/) | Amazon Bedrock Converse API client. It signs with AWS Signature Version 4 from the standard AWS environment variables or, with none set, from the AWS credential chain (shared profile, SSO, container and instance roles), as the AI SDK's amazon-bedrock provider does, or sends a Bedrock API key (AWS_BEARER_TOKEN_BEDROCK) as a bearer token when one is set. |
Expand Down Expand Up @@ -186,7 +186,7 @@ The core. Agent, Screen, Expect, the engines, model clients, config, and the rep
| [UserCredential](/api/E2E/UserCredential/) | Username plus a Secret password loaded from the environment. |
| [ValueExpectation&lt;T&gt;](/api/E2E/ValueExpectation-1/) | Synchronous matchers over a plain value, from That&lt;T&gt;. A failure is an ASSERTION_FAILED TestException. The optional message of the call opens every failure, and survives Not. |
| [Values](/api/E2E/Values/) | Wraps a fresh value so the replay cache can still match the step. |
| [VerdictTool](/api/E2E/VerdictTool/) | Upstream's VerdictTool: the conclusion tool, the policy that accepts or refuses the verdict a call carries, and the verdict it collected. Made by CreateVerdictTool(); the tool loop adds one to every vocabulary, so an executor of its own that drives a model outside the loop is the only caller of Execute(ModelToolCall). |
| [VerdictTool](/api/E2E/VerdictTool/) | Upstream's VerdictTool: the conclusion tool, the policy that accepts or refuses the verdict a call carries, and the verdict it collected. Made by CreateVerdictTool; the tool loop adds one to every vocabulary, so an executor of its own that drives a model outside the loop is the only caller of Execute(ModelToolCall). |
| [WaitForOptions](/api/E2E/WaitForOptions/) | agent.waitFor: a judgment at most once per Interval, and only on a changed screen, until Timeout. |
| [WebResponse](/api/E2E/WebResponse/) | A response WaitForResponseAsync matched. |
| [WebRoute](/api/E2E/WebRoute/) | One request a RouteAsync handler intercepted. Take exactly one decision. Each validates its options before it decides, so a rejected option leaves the request undecided, and the request is aborted. |
Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/features/acp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ One agent session serves one test attempt. The first agent step that the cache c

Each message carries the step, its non-secret params, the steps done so far, and the current screen. Action results say what changed on screen, and a `screenshot` reaches the agent as an image.

An assertion cannot change the screen. `observe`, `screenshot`, scrolling, and hovering still work. The agent ends every step with `done`: `passed`, `failed`, or `blocked` with an error code, as the built-in agent does.
An assertion cannot change the screen. `observe`, `screenshot`, and scrolling still work; hovering is refused. The agent ends every step with `done`: `passed`, `failed`, or `blocked` with an error code, as the built-in agent does.

## Limits

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ await Agent.AssertAsync("the chart trends upward", new AssertOptions { Vision =
The agent's observation shows a frame from another site, such as a hosted card field, as an `iframe` node with no content. To judge that content, use `Vision = VisionMode.On` (or `Only`), and reach it with script steps through `Browser.FrameLocator`. See [Working with the browser](/features/browser/#reach-into-an-iframe).

`Agent.AssertAsync` checks the current screen and fails if the statement is
false or the evidence is insufficient. Use `Agent.WaitForAsync` when the UI
false or the evidence is insufficient. When the evidence may be below the fold,
pass `Explore = true` and the assertion can scroll the screen, with read-only
tools and bounded budgets, before it judges. Use `Agent.WaitForAsync` when the UI
still needs time to reach the expected state. See
[Core concepts](/get-started/core-concepts/) for how a judgment reads the screen.

Expand Down
Loading
Loading