@parcha/agentrun-computer 0.1.0-beta.36 → 0.1.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +2 -0
- package/README.md +321 -308
- package/box/build-agent37.mjs +177 -0
- package/dist/agent37.d.ts +165 -0
- package/dist/agent37.js +759 -0
- package/dist/attach.d.ts +146 -0
- package/dist/attach.js +469 -0
- package/dist/browserbase.d.ts +2 -4
- package/dist/browserbase.js +2 -1
- package/dist/client.d.ts +33 -1
- package/dist/client.js +53 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/agent37.d.ts +96 -0
- package/dist/conformance/agent37.js +154 -0
- package/dist/conformance/cases/apps.d.ts +5 -0
- package/dist/conformance/cases/apps.js +160 -73
- package/dist/conformance/cases/health.js +14 -0
- package/dist/conformance/cases/index.js +2 -0
- package/dist/conformance/cases/provider.js +27 -1
- package/dist/conformance/cases/screen.d.ts +3 -0
- package/dist/conformance/cases/screen.js +18 -0
- package/dist/conformance/cases/settings.d.ts +29 -23
- package/dist/conformance/cases/settings.js +76 -58
- package/dist/conformance/cases/touch.js +19 -17
- package/dist/conformance/cases/ui.d.ts +2 -0
- package/dist/conformance/cases/ui.js +475 -0
- package/dist/conformance/cli.d.ts +9 -0
- package/dist/conformance/cli.js +28 -3
- package/dist/conformance/e2b.d.ts +6 -0
- package/dist/conformance/e2b.js +9 -2
- package/dist/conformance/fixture.d.ts +1 -1
- package/dist/conformance/fixture.js +25 -1
- package/dist/conformance/modal.d.ts +17 -13
- package/dist/conformance/modal.js +18 -9
- package/dist/conformance/orgo.d.ts +3 -3
- package/dist/conformance/orgo.js +6 -8
- package/dist/conformance/phone-harness.d.ts +6 -2
- package/dist/conformance/phone-harness.js +21 -4
- package/dist/conformance/report.js +1 -1
- package/dist/conformance/runner.js +23 -4
- package/dist/conformance/sweep.d.ts +50 -0
- package/dist/conformance/sweep.js +187 -0
- package/dist/conformance/types.d.ts +11 -3
- package/dist/conformance/ui-fixture.d.ts +56 -0
- package/dist/conformance/ui-fixture.js +43 -0
- package/dist/create-requests.d.ts +51 -0
- package/dist/create-requests.js +121 -0
- package/dist/daytona.d.ts +2 -4
- package/dist/daytona.js +3 -2
- package/dist/descriptor.d.ts +5 -0
- package/dist/descriptor.js +2 -0
- package/dist/descriptors/agent37.d.ts +41 -0
- package/dist/descriptors/agent37.js +28 -0
- package/dist/descriptors/index.d.ts +38 -2
- package/dist/descriptors/index.js +4 -2
- package/dist/descriptors/orgo.d.ts +2 -1
- package/dist/descriptors/orgo.js +3 -2
- package/dist/descriptors/phone-harness.d.ts +1 -1
- package/dist/descriptors/phone-harness.js +2 -2
- package/dist/docker.d.ts +7 -4
- package/dist/docker.js +271 -29
- package/dist/e2b.d.ts +9 -165
- package/dist/e2b.js +282 -1342
- package/dist/fake-ui-driver.d.ts +97 -0
- package/dist/fake-ui-driver.js +717 -0
- package/dist/host.d.ts +182 -0
- package/dist/host.js +1 -0
- package/dist/hosted/process.d.ts +67 -0
- package/dist/hosted/process.js +228 -0
- package/dist/hosted/provider.d.ts +146 -0
- package/dist/hosted/provider.js +1364 -0
- package/dist/hosted/scripts.d.ts +76 -0
- package/dist/{child.js → hosted/scripts.js} +93 -12
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -4
- package/dist/kernel.d.ts +2 -4
- package/dist/kernel.js +2 -1
- package/dist/kinds.d.ts +8 -1
- package/dist/kinds.js +20 -4
- package/dist/local-chrome.d.ts +2 -4
- package/dist/local-chrome.js +2 -1
- package/dist/modal.d.ts +23 -181
- package/dist/modal.js +271 -1244
- package/dist/orgo-channel.d.ts +3 -2
- package/dist/orgo-channel.js +5 -2
- package/dist/orgo-desktop.d.ts +9 -4
- package/dist/orgo-desktop.js +33 -13
- package/dist/orgo-workspaces.d.ts +47 -0
- package/dist/orgo-workspaces.js +94 -0
- package/dist/orgo.d.ts +10 -4
- package/dist/orgo.js +30 -12
- package/dist/phone-harness.d.ts +31 -22
- package/dist/phone-harness.js +510 -698
- package/dist/png.d.ts +4 -0
- package/dist/png.js +27 -0
- package/dist/protocol.d.ts +335 -32
- package/dist/protocol.js +96 -3
- package/dist/provider.d.ts +34 -6
- package/dist/provider.js +16 -0
- package/dist/result.d.ts +1 -1
- package/dist/surface/api.d.ts +248 -0
- package/dist/surface/api.js +1 -0
- package/dist/surface/core.d.ts +42 -0
- package/dist/surface/core.js +393 -0
- package/dist/surface/index.d.ts +5 -0
- package/dist/surface/index.js +3 -0
- package/dist/surface/outline.d.ts +8 -0
- package/dist/surface/outline.js +50 -0
- package/dist/surface/script.d.ts +10 -0
- package/dist/surface/script.js +92 -0
- package/dist/ui-engine.d.ts +114 -0
- package/dist/ui-engine.js +798 -0
- package/package.json +17 -1
- package/dist/child.d.ts +0 -42
- package/dist/conformance/e2b-diagnose.d.ts +0 -16
- package/dist/conformance/e2b-diagnose.js +0 -61
- package/dist/conformance/e2b-sweep.d.ts +0 -18
- package/dist/conformance/e2b-sweep.js +0 -132
- package/dist/conformance/modal-sweep.d.ts +0 -22
- package/dist/conformance/modal-sweep.js +0 -213
package/dist/provider.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// The provisioner: one per vendor. It makes, finds and ends computers; the daemon inside does the work.
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
1
3
|
/** The os and daemon modes each kind may have; no other pair is valid. */
|
|
2
4
|
export const KIND_SHAPES = {
|
|
3
5
|
linux: { os: ["linux"], daemon: ["pid1", "child"] },
|
|
@@ -110,3 +112,17 @@ export function checkGpu(gpu, { gpu: offered }, mount) {
|
|
|
110
112
|
}
|
|
111
113
|
return [];
|
|
112
114
|
}
|
|
115
|
+
/** A request id's most characters: it is hashed into the name, never sent. */
|
|
116
|
+
const REQUEST_ID_MAX = 1024;
|
|
117
|
+
/** The name of the computer one create's request makes: computer- and the first 12 hex digits of its sha256. */
|
|
118
|
+
export function computerNameFor(requestId) {
|
|
119
|
+
return `computer-${createHash("sha256").update(requestId, "utf8").digest("hex").slice(0, 12)}`;
|
|
120
|
+
}
|
|
121
|
+
/** Why a create's request id is not one, or undefined: every provider's create refuses it as invalid. */
|
|
122
|
+
export function requestIdProblem(requestId) {
|
|
123
|
+
if (typeof requestId !== "string" || requestId === "")
|
|
124
|
+
return "create needs context.requestId, the caller's id of this request (serve passes the run's claim): a retry with the same id finds the computer the first one made";
|
|
125
|
+
if (requestId.length > REQUEST_ID_MAX || requestId.includes("\0"))
|
|
126
|
+
return `context.requestId is at most ${REQUEST_ID_MAX} characters, with no NUL byte`;
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
package/dist/result.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type Result<T, E = ComputerError> = {
|
|
|
6
6
|
ok: false;
|
|
7
7
|
error: E;
|
|
8
8
|
};
|
|
9
|
-
export type ComputerErrorCode = "gone" | "refused" | "timeout" | "aborted" | "not_found" | "invalid" | "unsupported" | "denied" | "limit" | "exists" | "not_dir" | "is_dir" | "unauthorized" | "unreachable" | "vendor";
|
|
9
|
+
export type ComputerErrorCode = "gone" | "refused" | "timeout" | "aborted" | "not_found" | "invalid" | "unsupported" | "denied" | "limit" | "exists" | "not_dir" | "is_dir" | "stale" | "unauthorized" | "unreachable" | "vendor";
|
|
10
10
|
export interface ComputerError {
|
|
11
11
|
code: ComputerErrorCode;
|
|
12
12
|
message: string;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import type { ComputerKind, ComputerOs, FileType, InputAction, Point, Rect, ScreenSize, UiExpect, UiNode, UiRef, UiRoute, UiStep } from "../protocol.js";
|
|
2
|
+
/** An image a script can show the model with `image(...)`: base64 PNG or JPEG, with its size in pixels. */
|
|
3
|
+
export interface Image {
|
|
4
|
+
type: "image";
|
|
5
|
+
mimeType: "image/png" | "image/jpeg";
|
|
6
|
+
/** base64. */
|
|
7
|
+
data: string;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
/** What the computer is, from its hello. */
|
|
12
|
+
export interface Card {
|
|
13
|
+
kind: ComputerKind;
|
|
14
|
+
os: ComputerOs;
|
|
15
|
+
/** The OS's own version, as "15" or "26.1", where the computer says it. */
|
|
16
|
+
osVersion?: string;
|
|
17
|
+
arch: string;
|
|
18
|
+
/** The main screen, in points, where the computer has one. */
|
|
19
|
+
screen?: ScreenSize;
|
|
20
|
+
/** What the computer offers (hello.groups): each namespace below is here only with its group. */
|
|
21
|
+
groups: string[];
|
|
22
|
+
/** What its groups can and cannot do here: a feature that is off says why. */
|
|
23
|
+
features: Record<string, true | {
|
|
24
|
+
off: string;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
/** One observation of an app's window: its state id, its elements, and its image when asked. */
|
|
28
|
+
export interface State {
|
|
29
|
+
/** The state's id, as "s7". A step at a point names it (an act's `state`), and is refused as stale once the window
|
|
30
|
+
* moved or redrew under the point. */
|
|
31
|
+
id: string;
|
|
32
|
+
app: {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
36
|
+
/** bounds in screen points: where the window sits. Elements' bounds and steps' points are in the window's points. */
|
|
37
|
+
window: {
|
|
38
|
+
id: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
bounds: Rect;
|
|
41
|
+
};
|
|
42
|
+
/** The elements, in reading order, each after its parent. */
|
|
43
|
+
elements: UiNode[];
|
|
44
|
+
/** Elements were left out (too many, or past the reply's size). */
|
|
45
|
+
truncated: boolean;
|
|
46
|
+
/** The elements as compact lines, as computer_observe shows them: `@e12 button "Save"`. */
|
|
47
|
+
outline: string;
|
|
48
|
+
/** The window's image, when asked. Its pixels are not points: a point is pixel × window.bounds[2] / image.width. */
|
|
49
|
+
image?: Image;
|
|
50
|
+
}
|
|
51
|
+
/** How a step reached the app: the protocol's routes, or `input` for raw screen input on a computer with no ui group. */
|
|
52
|
+
export type Route = UiRoute | "input";
|
|
53
|
+
/** What one step did: the route it ran by, and whether a readback confirmed it; or why it was refused. */
|
|
54
|
+
export type StepResult = {
|
|
55
|
+
route: Route;
|
|
56
|
+
verified: boolean;
|
|
57
|
+
} | {
|
|
58
|
+
error: {
|
|
59
|
+
kind: string;
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/** What an act did: each step's result, the expect's outcome, whether the window changed, and the new state. */
|
|
64
|
+
export interface ActResult {
|
|
65
|
+
/** One per step tried, in order. A refused step is the last: the steps after it did not run. */
|
|
66
|
+
steps: StepResult[];
|
|
67
|
+
/** With an expect: met, or unmet when it did not hold before its timeout. */
|
|
68
|
+
expect?: "met" | "unmet";
|
|
69
|
+
/** The window changed after the steps. Absent with raw input, which can't tell. */
|
|
70
|
+
changed?: boolean;
|
|
71
|
+
/** The state after the steps. Absent with raw input, which has no states. */
|
|
72
|
+
state?: string;
|
|
73
|
+
/** The new observation, when asked with `observe`. */
|
|
74
|
+
after?: State;
|
|
75
|
+
}
|
|
76
|
+
/** What raw input did: one result per action tried, in order; a refused one is the last. */
|
|
77
|
+
export interface InputResult {
|
|
78
|
+
steps: StepResult[];
|
|
79
|
+
}
|
|
80
|
+
/** What `observe` takes. */
|
|
81
|
+
export interface ObserveOptions {
|
|
82
|
+
/** Add the window's image. Default false: the elements are usually enough. */
|
|
83
|
+
image?: boolean;
|
|
84
|
+
/** Every element, not only those that can be acted on or have a name. */
|
|
85
|
+
full?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** What `act` takes, beside its steps. */
|
|
88
|
+
export interface ActOptions {
|
|
89
|
+
/** The state the steps' points were read from. A step at a point needs it; the app's last observe is the default. */
|
|
90
|
+
state?: string;
|
|
91
|
+
/** A condition to wait for after the steps. */
|
|
92
|
+
expect?: UiExpect;
|
|
93
|
+
/** Let steps take the foreground route, which moves the user's pointer and focus. Default false. */
|
|
94
|
+
foreground?: boolean;
|
|
95
|
+
/** Observe again after the steps and return it as `after` (one call instead of two). */
|
|
96
|
+
observe?: boolean | ObserveOptions;
|
|
97
|
+
}
|
|
98
|
+
/** An app, bound by its id: observe it and act on it. Every act waits until the window settles. */
|
|
99
|
+
export interface App {
|
|
100
|
+
readonly id: string;
|
|
101
|
+
/** Observe the app's window: its elements, and its image when asked. */
|
|
102
|
+
observe(options?: ObserveOptions): Promise<State>;
|
|
103
|
+
/** The elements of the app's last observation that match, with no call to the computer: by role (ARIA's, the same on
|
|
104
|
+
* every OS), by the app's own id for it, and by a text its name, value or desc holds (or a RegExp they match). */
|
|
105
|
+
find(query: {
|
|
106
|
+
role?: string;
|
|
107
|
+
id?: string;
|
|
108
|
+
text?: string | RegExp;
|
|
109
|
+
}): UiNode[];
|
|
110
|
+
/** Run steps on the app, in order; the first refused one stops the rest. */
|
|
111
|
+
act(steps: UiStep[], options?: ActOptions): Promise<ActResult>;
|
|
112
|
+
/** The element's default action: the surest, fastest step. */
|
|
113
|
+
press(ref: UiRef, options?: ActOptions): Promise<ActResult>;
|
|
114
|
+
/** Set an element's value: a field's text, a slider's value, a switch's "on" or "off". */
|
|
115
|
+
set(ref: UiRef, value: string, options?: ActOptions): Promise<ActResult>;
|
|
116
|
+
click(at: UiRef | Point, options?: ActOptions & {
|
|
117
|
+
button?: "left" | "right";
|
|
118
|
+
count?: 1 | 2 | 3;
|
|
119
|
+
}): Promise<ActResult>;
|
|
120
|
+
type(text: string, options?: ActOptions & {
|
|
121
|
+
into?: UiRef;
|
|
122
|
+
}): Promise<ActResult>;
|
|
123
|
+
/** A key or a chord: key("enter"), key("super+s"). */
|
|
124
|
+
key(chord: string, options?: ActOptions): Promise<ActResult>;
|
|
125
|
+
/** Scroll by points: dy > 0 shows what is below. */
|
|
126
|
+
scroll(at: UiRef | Point, delta: {
|
|
127
|
+
dx?: number;
|
|
128
|
+
dy?: number;
|
|
129
|
+
}, options?: ActOptions): Promise<ActResult>;
|
|
130
|
+
/** Wait until the condition holds (or, with gone, no longer holds), at most its timeoutMs. */
|
|
131
|
+
waitFor(expect: UiExpect): Promise<ActResult>;
|
|
132
|
+
}
|
|
133
|
+
/** An app the computer has. */
|
|
134
|
+
export interface AppInfo {
|
|
135
|
+
id: string;
|
|
136
|
+
name?: string;
|
|
137
|
+
}
|
|
138
|
+
/** What a shell command did. */
|
|
139
|
+
export interface RunResult {
|
|
140
|
+
stdout: string;
|
|
141
|
+
stderr: string;
|
|
142
|
+
/** null when a signal ended it. */
|
|
143
|
+
exitCode: number | null;
|
|
144
|
+
timedOut: boolean;
|
|
145
|
+
/** Output past what is kept was cut. */
|
|
146
|
+
truncated: boolean;
|
|
147
|
+
}
|
|
148
|
+
/** A file or a directory. */
|
|
149
|
+
export interface FileInfo {
|
|
150
|
+
path: string;
|
|
151
|
+
type: FileType;
|
|
152
|
+
size: number;
|
|
153
|
+
mtimeMs: number;
|
|
154
|
+
}
|
|
155
|
+
/** The computer an agent's code drives. */
|
|
156
|
+
export interface Computer {
|
|
157
|
+
/** What this computer is. */
|
|
158
|
+
readonly card: Card;
|
|
159
|
+
/** @group apps */
|
|
160
|
+
readonly apps: {
|
|
161
|
+
/** The installed apps, and which is in front. */
|
|
162
|
+
list(): Promise<{
|
|
163
|
+
apps: AppInfo[];
|
|
164
|
+
foreground: string | null;
|
|
165
|
+
}>;
|
|
166
|
+
/** Open an app (with background, without taking the front, where the computer can). With the ui group, bind it
|
|
167
|
+
* with app(id). */
|
|
168
|
+
open(id: string, options?: {
|
|
169
|
+
url?: string;
|
|
170
|
+
background?: boolean;
|
|
171
|
+
}): Promise<void>;
|
|
172
|
+
};
|
|
173
|
+
/** Bind an app by its id, open or not, to observe it and act on it. No id: the app in front.
|
|
174
|
+
* @group ui */
|
|
175
|
+
app(id?: string): App;
|
|
176
|
+
/** @group screen */
|
|
177
|
+
readonly screen: {
|
|
178
|
+
/** A screenshot, as an image; with region, only that part, in the whole screen's pixels. */
|
|
179
|
+
shot(options?: {
|
|
180
|
+
region?: Rect;
|
|
181
|
+
}): Promise<Image>;
|
|
182
|
+
};
|
|
183
|
+
/** Raw input at screenshot pixels: the screen, not an app. With the ui group, prefer an app's steps; this reaches
|
|
184
|
+
* what they can't (a drag from one app to another, a swipe from the screen's edge, a pinch, outside every window).
|
|
185
|
+
* @group input.pointer input.touch input.keys */
|
|
186
|
+
readonly input: {
|
|
187
|
+
act(actions: InputAction[]): Promise<InputResult>;
|
|
188
|
+
};
|
|
189
|
+
/** @group exec */
|
|
190
|
+
readonly shell: {
|
|
191
|
+
/** Run a command: a string runs in sh -c, a list is the program and its arguments. */
|
|
192
|
+
run(command: string | string[], options?: {
|
|
193
|
+
cwd?: string;
|
|
194
|
+
timeoutMs?: number;
|
|
195
|
+
env?: Record<string, string>;
|
|
196
|
+
}): Promise<RunResult>;
|
|
197
|
+
};
|
|
198
|
+
/** @group files */
|
|
199
|
+
readonly files: {
|
|
200
|
+
/** A file's text (UTF-8), or with base64 its bytes. */
|
|
201
|
+
read(path: string, options?: {
|
|
202
|
+
encoding?: "utf8" | "base64";
|
|
203
|
+
}): Promise<string>;
|
|
204
|
+
write(path: string, data: string, options?: {
|
|
205
|
+
encoding?: "utf8" | "base64";
|
|
206
|
+
}): Promise<void>;
|
|
207
|
+
list(path: string): Promise<FileInfo[]>;
|
|
208
|
+
stat(path: string): Promise<FileInfo>;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/** computer_observe: observe an app's window (or, with no ui group, the screen). */
|
|
212
|
+
export interface ObserveArgs {
|
|
213
|
+
/** Default: the app in front. */
|
|
214
|
+
app?: string;
|
|
215
|
+
/** Add the window's picture (always, with no ui group). */
|
|
216
|
+
image?: boolean;
|
|
217
|
+
/** Every element, not only named or actionable ones. */
|
|
218
|
+
full?: boolean;
|
|
219
|
+
}
|
|
220
|
+
/** computer_act: run steps on an app, and check a condition after them. */
|
|
221
|
+
export interface ActArgs {
|
|
222
|
+
/** Default: the state's app, else the app in front. */
|
|
223
|
+
app?: string;
|
|
224
|
+
/** The state a step's point was read from. Default: the last observed. */
|
|
225
|
+
state?: string;
|
|
226
|
+
/** Run in order. Empty with an expect: only wait.
|
|
227
|
+
* @maxItems 100 */
|
|
228
|
+
steps: UiStep[];
|
|
229
|
+
expect?: UiExpect;
|
|
230
|
+
/** Allow moving the person's pointer and focus. */
|
|
231
|
+
foreground?: boolean;
|
|
232
|
+
/** Return the new outline. */
|
|
233
|
+
observe?: boolean;
|
|
234
|
+
}
|
|
235
|
+
/** computer_screenshot: a screenshot of the screen, or of a region of it. */
|
|
236
|
+
export interface ScreenshotArgs {
|
|
237
|
+
/** [x, y, w, h] in screen pixels. */
|
|
238
|
+
region?: Rect;
|
|
239
|
+
}
|
|
240
|
+
/** computer_script: run JavaScript against the `computer` object. */
|
|
241
|
+
export interface ScriptArgs {
|
|
242
|
+
/** An async function's body; `return` what you need. */
|
|
243
|
+
code: string;
|
|
244
|
+
/** For the run's timeline. */
|
|
245
|
+
title?: string;
|
|
246
|
+
/** Default 120000, at most 600000. */
|
|
247
|
+
timeoutMs?: number;
|
|
248
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComputerClient, HelloResult, UiStep } from "../protocol.js";
|
|
2
|
+
import type { ActResult, Card, Image } from "./api.js";
|
|
3
|
+
/** What a surface can be asked, by name: the members of Computer and the tools' calls. */
|
|
4
|
+
export type SurfaceOp = "observe" | "act" | "screenshot" | "input.act" | "apps.list" | "apps.open" | "shell.run" | "files.read" | "files.write" | "files.list" | "files.stat";
|
|
5
|
+
export declare const SURFACE_OPS: readonly SurfaceOp[];
|
|
6
|
+
/** One call's answer: the value a script gets, the text a model reads, and the images that go with it. */
|
|
7
|
+
export interface SurfaceAnswer {
|
|
8
|
+
value: unknown;
|
|
9
|
+
text: string;
|
|
10
|
+
images: Image[];
|
|
11
|
+
}
|
|
12
|
+
/** A call the computer refused or failed: `kind` is the protocol's error kind (stale, unsupported, ...) or the
|
|
13
|
+
* connection's (gone, timeout). */
|
|
14
|
+
export declare class SurfaceError extends Error {
|
|
15
|
+
readonly kind: string;
|
|
16
|
+
constructor(kind: string, message: string);
|
|
17
|
+
}
|
|
18
|
+
export interface Surface {
|
|
19
|
+
readonly card: Card;
|
|
20
|
+
/** The ops this computer answers, from its groups. */
|
|
21
|
+
readonly ops: readonly SurfaceOp[];
|
|
22
|
+
call(op: string, args: unknown, options?: {
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}): Promise<SurfaceAnswer>;
|
|
25
|
+
}
|
|
26
|
+
/** The most bytes files.read gathers into one answer. */
|
|
27
|
+
export declare const MAX_READ_BYTES: number;
|
|
28
|
+
/** The card of a hello. */
|
|
29
|
+
export declare function cardOf(hello: HelloResult): Card;
|
|
30
|
+
/** The ops a computer with these groups answers. */
|
|
31
|
+
export declare function opsOf(groups: readonly string[]): SurfaceOp[];
|
|
32
|
+
/** The name of a step: its first key ("press", "click", ...). */
|
|
33
|
+
export declare const stepName: (step: UiStep) => string;
|
|
34
|
+
/** An act's answer as lines: one per step (named by `names`), then the expect, then whether it changed and the new
|
|
35
|
+
* state, then the new observation's outline when there is one. */
|
|
36
|
+
export declare function actText(names: readonly string[], result: ActResult): string;
|
|
37
|
+
/** A chord's keys: "ctrl+shift+t" is ctrl, shift, t; a trailing "+" is the plus key ("ctrl++"). */
|
|
38
|
+
export declare const chordKeys: (chord: string) => string[];
|
|
39
|
+
/** The surface of one computer, over its connection. */
|
|
40
|
+
export declare function createSurface(client: ComputerClient, hello: HelloResult): Surface;
|
|
41
|
+
/** A value with its images' data left out: the structured half of an answer whose images travel beside it. */
|
|
42
|
+
export declare function withoutImageData(value: unknown): unknown;
|