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
8 changes: 5 additions & 3 deletions COMPATIBILITY.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions docs-site/public/api/E2E.AgentCacheOptions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="canonical" href="https://www.hardkoded.com/e2e-dotnet/api/E2E/AgentCacheOptions/">
<meta http-equiv="refresh" content="0; url=/e2e-dotnet/api/E2E/AgentCacheOptions/">
<title>Redirecting…</title>
<script>location.replace("/e2e-dotnet/api/E2E/AgentCacheOptions/" + (location.hash || ""));</script>
</head>
<body>
<p><a href="/e2e-dotnet/api/E2E/AgentCacheOptions/">Continue</a></p>
</body>
</html>
13 changes: 13 additions & 0 deletions docs-site/public/api/E2E.CachingActOptions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="canonical" href="https://www.hardkoded.com/e2e-dotnet/api/E2E/CachingActOptions/">
<meta http-equiv="refresh" content="0; url=/e2e-dotnet/api/E2E/CachingActOptions/">
<title>Redirecting…</title>
<script>location.replace("/e2e-dotnet/api/E2E/CachingActOptions/" + (location.hash || ""));</script>
</head>
<body>
<p><a href="/e2e-dotnet/api/E2E/CachingActOptions/">Continue</a></p>
</body>
</html>
13 changes: 13 additions & 0 deletions docs-site/public/api/E2E.CoreAgent.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="canonical" href="https://www.hardkoded.com/e2e-dotnet/api/E2E/CoreAgent/">
<meta http-equiv="refresh" content="0; url=/e2e-dotnet/api/E2E/CoreAgent/">
<title>Redirecting…</title>
<script>location.replace("/e2e-dotnet/api/E2E/CoreAgent/" + (location.hash || ""));</script>
</head>
<body>
<p><a href="/e2e-dotnet/api/E2E/CoreAgent/">Continue</a></p>
</body>
</html>
13 changes: 13 additions & 0 deletions docs-site/public/api/E2E.CoreAgents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="canonical" href="https://www.hardkoded.com/e2e-dotnet/api/E2E/CoreAgents/">
<meta http-equiv="refresh" content="0; url=/e2e-dotnet/api/E2E/CoreAgents/">
<title>Redirecting…</title>
<script>location.replace("/e2e-dotnet/api/E2E/CoreAgents/" + (location.hash || ""));</script>
</head>
<body>
<p><a href="/e2e-dotnet/api/E2E/CoreAgents/">Continue</a></p>
</body>
</html>
13 changes: 13 additions & 0 deletions docs-site/public/api/E2E.CreateAgentOptions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="canonical" href="https://www.hardkoded.com/e2e-dotnet/api/E2E/CreateAgentOptions/">
<meta http-equiv="refresh" content="0; url=/e2e-dotnet/api/E2E/CreateAgentOptions/">
<title>Redirecting…</title>
<script>location.replace("/e2e-dotnet/api/E2E/CreateAgentOptions/" + (location.hash || ""));</script>
</head>
<body>
<p><a href="/e2e-dotnet/api/E2E/CreateAgentOptions/">Continue</a></p>
</body>
</html>
4 changes: 3 additions & 1 deletion docs-site/src/content/docs/api/E2E/ActOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ Namespace: [E2E](/api/E2E/)


```csharp
public sealed class ActOptions
public class ActOptions
```


Values passed into one `ActAsync` goal. Put fresh data in [Unique(string)](/api/E2E/Values/#E2E_Values_Unique_System_String_).

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

**Derived:** [CachingActOptions](/api/E2E/CachingActOptions/)

[View source](https://github.com/hardkoded/e2e-dotnet/blob/main/src/E2E/Agent/Agent.cs)

## Properties
Expand Down
88 changes: 88 additions & 0 deletions docs-site/src/content/docs/api/E2E/AgentCacheOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "AgentCacheOptions"
description: "Where ActAsync keeps the flows it recorded, and whether it may write new ones. Upstream's AgentCacheOptions (core/agent.ts)."
editUrl: false
prev: false
next: false
sidebar:
label: "AgentCacheOptions"
hidden: true
---

<a id="E2E_AgentCacheOptions"></a>

Namespace: [E2E](/api/E2E/)


```csharp
public sealed class AgentCacheOptions
```


Where `ActAsync` keeps the flows it recorded, and whether it may write new ones. Upstream's `AgentCacheOptions` (`core/agent.ts`).

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

[View source](https://github.com/hardkoded/e2e-dotnet/blob/main/src/E2E/Core/CoreAgent.cs)

## Properties

<a id="E2E_AgentCacheOptions_Dir_"></a>
<a id="E2E_AgentCacheOptions_Dir"></a>

### Dir


```csharp
public string? Dir { get; init; }
```


The file store's directory, from the [Cwd](/api/E2E/LaunchOptions/#E2E_LaunchOptions_Cwd) the host was launched with; default `.e2e/cache`. Ignored with [Store](#E2E_AgentCacheOptions_Store).

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

<a id="E2E_AgentCacheOptions_Mode_"></a>
<a id="E2E_AgentCacheOptions_Mode"></a>

### Mode


```csharp
public CacheMode Mode { get; init; }
```


[ReadWrite](/api/E2E/CacheMode/#E2E_CacheMode_ReadWrite) (the default) replays and records; [ReadOnly](/api/E2E/CacheMode/#E2E_CacheMode_ReadOnly) replays and never writes. [Off](/api/E2E/CacheMode/#E2E_CacheMode_Off) is `INVALID_ARGUMENT`: leave [Cache](/api/E2E/CreateAgentOptions/#E2E_CreateAgentOptions_Cache) unset.

**Value:** [CacheMode](/api/E2E/CacheMode/)

<a id="E2E_AgentCacheOptions_Store_"></a>
<a id="E2E_AgentCacheOptions_Store"></a>

### Store


```csharp
public IStepCache? Store { get; init; }
```


A custom store in place of the file store, the seam a shared cache plugs into.

**Value:** [IStepCache](/api/E2E/IStepCache/)

<a id="E2E_AgentCacheOptions_Strict_"></a>
<a id="E2E_AgentCacheOptions_Strict"></a>

### Strict


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


Replays only: a recording that no longer replays fails its step with `REPLAY_STALE` instead of calling the model, and nothing is written.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
4 changes: 3 additions & 1 deletion docs-site/src/content/docs/api/E2E/AgentOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Namespace: [E2E](/api/E2E/)


```csharp
public sealed class AgentOptions
public class AgentOptions
```


Expand All @@ -24,6 +24,8 @@ defaults; no agent inherits another's values. A call picks one with its `Agent`

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

**Derived:** [CreateAgentOptions](/api/E2E/CreateAgentOptions/)

[View source](https://github.com/hardkoded/e2e-dotnet/blob/main/src/E2E/Agent/AgentOptions.cs)

## Properties
Expand Down
61 changes: 61 additions & 0 deletions docs-site/src/content/docs/api/E2E/CachingActOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "CachingActOptions"
description: "ActOptions for ActAsync: each call names the recording it replays and records, or runs live. Upstream's CachingActOptions (core/agent.ts), which TypeScript t..."
editUrl: false
prev: false
next: false
sidebar:
label: "CachingActOptions"
hidden: true
---

<a id="E2E_CachingActOptions"></a>

Namespace: [E2E](/api/E2E/)


```csharp
public sealed class CachingActOptions : ActOptions
```


[ActOptions](/api/E2E/ActOptions/) for `ActAsync`: each call names the recording it replays and records, or runs live. Upstream's
`CachingActOptions` (`core/agent.ts`), which TypeScript types as a union; C# holds both members, and the agent refuses the one that
does not fit it at runtime. [Agent](/api/E2E/ActOptions/#E2E_ActOptions_Agent) is `INVALID_ARGUMENT`: create another agent for another configuration.

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

[View source](https://github.com/hardkoded/e2e-dotnet/blob/main/src/E2E/Core/CoreAgent.cs)

## Properties

<a id="E2E_CachingActOptions_Cache_"></a>
<a id="E2E_CachingActOptions_Cache"></a>

### Cache


```csharp
public bool? Cache { get; init; }
```


`false` runs this call live, neither replaying nor recording. Any other value is `INVALID_ARGUMENT`.

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

<a id="E2E_CachingActOptions_CacheKey_"></a>
<a id="E2E_CachingActOptions_CacheKey"></a>

### CacheKey


```csharp
public string? CacheKey { get; init; }
```


The recording this call replays and records, unique within what the program does: `checkout`, `cart-best-coupon`. The key is
this name, the instruction, its params, and how many times the session made the same call, so a reworded instruction records afresh.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string)
131 changes: 131 additions & 0 deletions docs-site/src/content/docs/api/E2E/CoreAgent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
title: "CoreAgent"
description: "An agent over one session, configured in code: ActAsync, AssertAsync, WaitForAsync, and ExtractAsync behave as they do in a test. With a cache, ActAsync repl..."
editUrl: false
prev: false
next: false
sidebar:
label: "CoreAgent"
hidden: true
---

<a id="E2E_CoreAgent"></a>

Namespace: [E2E](/api/E2E/)


```csharp
public sealed class CoreAgent
```


An agent over one session, configured in code: `ActAsync`, `AssertAsync`, `WaitForAsync`, and `ExtractAsync` behave as they
do in a test. With a cache, `ActAsync` replays recorded flows, each keyed by the [CacheKey](/api/E2E/CachingActOptions/#E2E_CachingActOptions_CacheKey) the call names.
Upstream's `CachingAgent`, `CoreAgent`, and `UncheckedAgent` (`core/agent.ts`), which TypeScript tells apart by the options
`createAgent` was called with: C# has one type, and refuses at runtime the `ActAsync` call that does not fit the agent.

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

[View source](https://github.com/hardkoded/e2e-dotnet/blob/main/src/E2E/Core/CoreAgent.cs)

## Methods

<a id="E2E_CoreAgent_ActAsync_"></a>
<a id="E2E_CoreAgent_ActAsync_System_String_E2E_CachingActOptions_System_Threading_CancellationToken_"></a>

### ActAsync(string, CachingActOptions?, CancellationToken)


```csharp
public Task<ActResult> ActAsync(string instruction, CachingActOptions? options = null, CancellationToken cancellationToken = default)
```


Runs one goal. On an agent with a cache the call names its recording with [CacheKey](/api/E2E/CachingActOptions/#E2E_CachingActOptions_CacheKey), or runs live with
[Cache](/api/E2E/CachingActOptions/#E2E_CachingActOptions_Cache) set to `false`; without one it fails with `INVALID_ARGUMENT`. On an agent without a cache,
naming either fails with `INVALID_ARGUMENT`.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `instruction` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
| `options` | [CachingActOptions](/api/E2E/CachingActOptions/) | |
| `cancellationToken` | [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | |

**Returns:** [Task&lt;ActResult&gt;](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

<a id="E2E_CoreAgent_AssertAsync_"></a>
<a id="E2E_CoreAgent_AssertAsync_System_String_E2E_AssertOptions_System_Threading_CancellationToken_"></a>

### AssertAsync(string, AssertOptions?, CancellationToken)


```csharp
public Task AssertAsync(string statement, AssertOptions? options = null, CancellationToken cancellationToken = default)
```


Checks that the statement holds on the current screen. See `AssertAsync`.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `statement` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
| `options` | [AssertOptions](/api/E2E/AssertOptions/) | |
| `cancellationToken` | [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | |

**Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

<a id="E2E_CoreAgent_ExtractAsync_"></a>
<a id="E2E_CoreAgent_ExtractAsync__1_System_String_E2E_ExtractOptions_System_Threading_CancellationToken_"></a>

### `ExtractAsync<T>(string, ExtractOptions?, CancellationToken)`


```csharp
public Task<T> ExtractAsync<T>(string instruction, ExtractOptions? options = null, CancellationToken cancellationToken = default)
```


Reads data off the current screen. See `ExtractAsync&lt;T&gt;`.

**Type parameters**

| Name | Description |
| --- | --- |
| `T` | |

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `instruction` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
| `options` | [ExtractOptions](/api/E2E/ExtractOptions/) | |
| `cancellationToken` | [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | |

**Returns:** [Task&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)

<a id="E2E_CoreAgent_WaitForAsync_"></a>
<a id="E2E_CoreAgent_WaitForAsync_System_String_E2E_WaitForOptions_System_Threading_CancellationToken_"></a>

### WaitForAsync(string, WaitForOptions?, CancellationToken)


```csharp
public Task WaitForAsync(string statement, WaitForOptions? options = null, CancellationToken cancellationToken = default)
```


Waits until the statement holds on screen. See `WaitForAsync`.

**Parameters**

| Name | Type | Description |
| --- | --- | --- |
| `statement` | [string](https://learn.microsoft.com/dotnet/api/system.string) | |
| `options` | [WaitForOptions](/api/E2E/WaitForOptions/) | |
| `cancellationToken` | [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | |

**Returns:** [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)
Loading
Loading