@parcha/agentrun-computer 0.1.0-beta.33 → 0.1.0-beta.35
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/README.md +308 -36
- package/dist/browser.d.ts +13 -14
- package/dist/browser.js +22 -17
- package/dist/browserbase.d.ts +3 -3
- package/dist/browserbase.js +16 -11
- package/dist/child.d.ts +2 -0
- package/dist/child.js +13 -2
- package/dist/chrome.d.ts +73 -0
- package/dist/chrome.js +224 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/browserbase.js +1 -1
- package/dist/conformance/cases/gpu.d.ts +2 -0
- package/dist/conformance/cases/gpu.js +108 -0
- package/dist/conformance/cases/health.js +83 -3
- package/dist/conformance/cases/index.js +2 -0
- package/dist/conformance/cases/mount.d.ts +8 -1
- package/dist/conformance/cases/mount.js +4 -3
- package/dist/conformance/cases/provider.js +92 -3
- package/dist/conformance/cli.js +46 -7
- package/dist/conformance/daytona.js +2 -1
- package/dist/conformance/e2b.js +2 -1
- package/dist/conformance/fixture.js +24 -2
- package/dist/conformance/kernel.js +1 -1
- package/dist/conformance/kind.js +2 -1
- package/dist/conformance/local-chrome.d.ts +30 -0
- package/dist/conformance/local-chrome.js +36 -0
- package/dist/conformance/orgo.d.ts +11 -5
- package/dist/conformance/orgo.js +37 -8
- package/dist/conformance/phone-harness.js +2 -1
- package/dist/conformance/report.js +13 -7
- package/dist/conformance/runner.js +68 -18
- package/dist/conformance/types.d.ts +78 -18
- package/dist/conformance/types.js +10 -0
- package/dist/conformance/windows-fixture.d.ts +1 -0
- package/dist/conformance/windows-fixture.js +37 -0
- package/dist/daytona.d.ts +4 -6
- package/dist/daytona.js +97 -52
- package/dist/descriptor.d.ts +94 -0
- package/dist/descriptor.js +81 -0
- package/dist/descriptors/browserbase.d.ts +24 -0
- package/dist/descriptors/browserbase.js +18 -0
- package/dist/descriptors/daytona.d.ts +62 -0
- package/dist/descriptors/daytona.js +49 -0
- package/dist/descriptors/docker.d.ts +12 -0
- package/dist/descriptors/docker.js +17 -0
- package/dist/descriptors/e2b.d.ts +22 -0
- package/dist/descriptors/e2b.js +19 -0
- package/dist/descriptors/index.d.ts +229 -0
- package/dist/descriptors/index.js +19 -0
- package/dist/descriptors/kernel.d.ts +20 -0
- package/dist/descriptors/kernel.js +15 -0
- package/dist/descriptors/local-chrome.d.ts +17 -0
- package/dist/descriptors/local-chrome.js +21 -0
- package/dist/descriptors/modal.d.ts +50 -0
- package/dist/descriptors/modal.js +38 -0
- package/dist/descriptors/orgo.d.ts +88 -0
- package/dist/descriptors/orgo.js +44 -0
- package/dist/descriptors/phone-harness.d.ts +28 -0
- package/dist/descriptors/phone-harness.js +20 -0
- package/dist/descriptors/shared.d.ts +7 -0
- package/dist/descriptors/shared.js +6 -0
- package/dist/desktop.d.ts +4 -4
- package/dist/desktop.js +4 -4
- package/dist/docker/egress.d.ts +1 -1
- package/dist/docker/image.js +17 -15
- package/dist/docker/inspect.d.ts +147 -0
- package/dist/docker/inspect.js +335 -0
- package/dist/docker.d.ts +6 -4
- package/dist/docker.js +53 -41
- package/dist/drift.d.ts +6 -146
- package/dist/drift.js +14 -334
- package/dist/e2b.d.ts +2 -6
- package/dist/e2b.js +19 -22
- package/dist/index.d.ts +9 -10
- package/dist/index.js +14 -10
- package/dist/isolation.d.ts +0 -2
- package/dist/isolation.js +2 -18
- package/dist/janitor.d.ts +18 -1
- package/dist/janitor.js +67 -19
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +19 -14
- package/dist/kinds.d.ts +56 -30
- package/dist/kinds.js +19 -97
- package/dist/labels.d.ts +18 -0
- package/dist/labels.js +65 -2
- package/dist/local-chrome.d.ts +86 -0
- package/dist/local-chrome.js +475 -0
- package/dist/local-supervisor.d.ts +51 -0
- package/dist/local-supervisor.js +221 -0
- package/dist/modal.d.ts +15 -7
- package/dist/modal.js +83 -39
- package/dist/mount-archil.js +4 -4
- package/dist/orgo-channel.js +16 -13
- package/dist/orgo-desktop.d.ts +153 -0
- package/dist/orgo-desktop.js +1614 -0
- package/dist/orgo-names.d.ts +52 -0
- package/dist/orgo-names.js +84 -0
- package/dist/orgo.d.ts +18 -13
- package/dist/orgo.js +54 -128
- package/dist/phone-harness.d.ts +4 -8
- package/dist/phone-harness.js +48 -46
- package/dist/protocol.d.ts +20 -0
- package/dist/protocol.js +9 -0
- package/dist/provider.d.ts +151 -10
- package/dist/provider.js +70 -0
- package/dist/providers.d.ts +22 -17
- package/dist/providers.js +14 -16
- package/dist/result.d.ts +11 -1
- package/dist/result.js +11 -0
- package/dist/test-connection.js +2 -2
- package/package.json +42 -2
package/dist/orgo-channel.js
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
// memory for the call. Neither is in a word this module returns.
|
|
15
15
|
import { randomBytes } from "node:crypto";
|
|
16
16
|
import { PassThrough, Writable } from "node:stream";
|
|
17
|
-
import {
|
|
17
|
+
import { errorOf, failFor, ok, vendorFail } from "./result.js";
|
|
18
|
+
/** This module's failures: one with code vendor names Orgo. */
|
|
19
|
+
const fail = failFor("orgo");
|
|
18
20
|
/** Orgo's API. */
|
|
19
21
|
export const ORGO_API_URL = "https://www.orgo.ai/api";
|
|
20
22
|
/** The most Orgo's one-step upload takes. */
|
|
@@ -31,7 +33,7 @@ const SESSION = "agentrun-init";
|
|
|
31
33
|
export const quote = (word) => `'${word.replaceAll("'", "'\\''")}'`;
|
|
32
34
|
/** An argv as one bash command line. */
|
|
33
35
|
export const commandLine = (argv) => argv.map(quote).join(" ");
|
|
34
|
-
const codeOfStatus = (status) => status === 401 || status === 403 ? "denied" : status === 404 ? "not_found" : status === 429 ? "limit" : status === 400 || status === 422 ? "invalid" : status === 409 ? "refused" : "
|
|
36
|
+
const codeOfStatus = (status) => status === 401 || status === 403 ? "denied" : status === 404 ? "not_found" : status === 429 ? "limit" : status === 400 || status === 422 ? "invalid" : status === 409 ? "refused" : "vendor";
|
|
35
37
|
/** Orgo's REST API with a key: every call bounded, every failure a code and words that never hold the key. */
|
|
36
38
|
export function orgoRest({ apiKey, apiUrl = ORGO_API_URL, fetch: fetcher = globalThis.fetch }) {
|
|
37
39
|
const base = apiUrl.replace(/\/+$/, "");
|
|
@@ -58,7 +60,7 @@ export function orgoRest({ apiKey, apiUrl = ORGO_API_URL, fetch: fetcher = globa
|
|
|
58
60
|
return fail("aborted", `${what} was aborted`);
|
|
59
61
|
if (bound.aborted)
|
|
60
62
|
return fail("timeout", `${what} did not answer within ${timeoutMs / 1000} s`);
|
|
61
|
-
return
|
|
63
|
+
return vendorFail("orgo", `${what} failed: ${scrub(error instanceof Error ? error.message : String(error))}`);
|
|
62
64
|
}
|
|
63
65
|
const text = await response.text().catch(() => "");
|
|
64
66
|
let parsed;
|
|
@@ -73,7 +75,8 @@ export function orgoRest({ apiKey, apiUrl = ORGO_API_URL, fetch: fetcher = globa
|
|
|
73
75
|
const { error, code } = (parsed ?? {});
|
|
74
76
|
const words = typeof error === "string" ? error : text || response.statusText;
|
|
75
77
|
const orgoCode = typeof code === "string" ? code : undefined;
|
|
76
|
-
|
|
78
|
+
const error_ = errorOf(codeOfStatus(response.status), `${what} answered ${response.status}: ${scrub(words)}${orgoCode ? ` (${orgoCode})` : ""}`, "orgo");
|
|
79
|
+
return { ok: false, error: error_, status: response.status, ...(orgoCode ? { orgoCode } : {}) };
|
|
77
80
|
},
|
|
78
81
|
};
|
|
79
82
|
}
|
|
@@ -93,16 +96,16 @@ async function typeLine(terminal, line, heard, { deadline, echoMs }) {
|
|
|
93
96
|
for (let tries = 1; tries <= TYPE_TRIES; tries++) {
|
|
94
97
|
const ended = terminal.ended();
|
|
95
98
|
if (ended !== undefined)
|
|
96
|
-
return
|
|
99
|
+
return vendorFail("orgo", ended);
|
|
97
100
|
terminal.send(line);
|
|
98
101
|
if (await terminal.waitFor(() => heard() || terminal.ended() !== undefined, Math.min(echoMs, left()))) {
|
|
99
102
|
const after = terminal.ended();
|
|
100
|
-
return after !== undefined && !heard() ?
|
|
103
|
+
return after !== undefined && !heard() ? vendorFail("orgo", after) : ok(undefined);
|
|
101
104
|
}
|
|
102
105
|
if (Date.now() >= deadline)
|
|
103
106
|
return fail("timeout", `the line was typed ${tries} ${tries === 1 ? "time" : "times"}, and the shell had not echoed it`);
|
|
104
107
|
}
|
|
105
|
-
return
|
|
108
|
+
return vendorFail("orgo", `the line was typed ${TYPE_TRIES} times, and the shell never echoed it`);
|
|
106
109
|
}
|
|
107
110
|
/** A frame's bytes as text, when they are: a string, an ArrayBuffer or a typed array; a Blob is read, in order. */
|
|
108
111
|
function frameText(data) {
|
|
@@ -131,7 +134,7 @@ export function orgoTerminalChannel({ rest, workspaceId, webSocket = defaultWebS
|
|
|
131
134
|
return ran;
|
|
132
135
|
const { exit_code: exitCode, output } = ran.value ?? {};
|
|
133
136
|
if (typeof exitCode !== "number")
|
|
134
|
-
return
|
|
137
|
+
return vendorFail("orgo", `Orgo's bash call answered no exit code (${JSON.stringify(ran.value)?.slice(0, 200)})`);
|
|
135
138
|
return ok({ exitCode, output: typeof output === "string" ? output : "" });
|
|
136
139
|
};
|
|
137
140
|
const open = async (computer, { session, timeoutMs, signal }) => {
|
|
@@ -140,7 +143,7 @@ export function orgoTerminalChannel({ rest, workspaceId, webSocket = defaultWebS
|
|
|
140
143
|
return read;
|
|
141
144
|
const password = read.value?.vnc_password;
|
|
142
145
|
if (typeof password !== "string" || password === "")
|
|
143
|
-
return
|
|
146
|
+
return vendorFail("orgo", `Orgo gave no terminal password for ${computer}: is it running?`);
|
|
144
147
|
const url = new URL(`/desktops/${encodeURIComponent(computer)}/ws/terminal`, rest.origin.replace(/^http/, "ws"));
|
|
145
148
|
url.searchParams.set("token", password);
|
|
146
149
|
if (session !== undefined)
|
|
@@ -150,7 +153,7 @@ export function orgoTerminalChannel({ rest, workspaceId, webSocket = defaultWebS
|
|
|
150
153
|
socket = webSocket(url.href);
|
|
151
154
|
}
|
|
152
155
|
catch (error) {
|
|
153
|
-
return
|
|
156
|
+
return vendorFail("orgo", `the terminal of ${computer} could not be opened: ${String(error?.message ?? error).replaceAll(password, "[password]").slice(0, 200)}`);
|
|
154
157
|
}
|
|
155
158
|
const outputs = [];
|
|
156
159
|
const ends = [];
|
|
@@ -278,7 +281,7 @@ export function orgoTerminalChannel({ rest, workspaceId, webSocket = defaultWebS
|
|
|
278
281
|
});
|
|
279
282
|
terminal.onEnd((words) => {
|
|
280
283
|
clearTimeout(timer);
|
|
281
|
-
settle(
|
|
284
|
+
settle(vendorFail("orgo", `the terminal of ${computer} did not open: ${words}`));
|
|
282
285
|
});
|
|
283
286
|
});
|
|
284
287
|
if (!opened.ok) {
|
|
@@ -309,7 +312,7 @@ export function orgoTerminalChannel({ rest, workspaceId, webSocket = defaultWebS
|
|
|
309
312
|
const ran = await bash(computer, `setsid -f ${detached}`, timeoutMs, signal);
|
|
310
313
|
if (!ran.ok)
|
|
311
314
|
return ran;
|
|
312
|
-
return ran.value.exitCode === 0 ? ok(undefined) :
|
|
315
|
+
return ran.value.exitCode === 0 ? ok(undefined) : vendorFail("orgo", `starting ${argv[0]} from bash exited ${ran.value.exitCode}: ${ran.value.output.trim().slice(0, 300)}`);
|
|
313
316
|
}
|
|
314
317
|
const deadline = Date.now() + timeoutMs;
|
|
315
318
|
const terminal = await open(computer, { session: SESSION, timeoutMs, ...(signal ? { signal } : {}) });
|
|
@@ -350,7 +353,7 @@ export function orgoTerminalChannel({ rest, workspaceId, webSocket = defaultWebS
|
|
|
350
353
|
const sent = () => `the terminal sent ${terminal.seen()} and no marker; its last bytes: ${JSON.stringify(before.slice(-300))}`;
|
|
351
354
|
terminal.onEnd((words) => {
|
|
352
355
|
said = words;
|
|
353
|
-
settle(
|
|
356
|
+
settle(vendorFail("orgo", `computerd's bridge in ${computer} ended before it started: ${words}; ${sent()}`));
|
|
354
357
|
readable.end();
|
|
355
358
|
});
|
|
356
359
|
const late = (why) => fail("timeout", `computerd's bridge in ${computer} did not start within ${timeoutMs / 1000} s: ${why}; ${sent()}`);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type OrgoRest } from "./orgo-channel.js";
|
|
2
|
+
import { type ComputerClient, type DaemonMethod, type DaemonMethods, type Group, type HelloResult } from "./protocol.js";
|
|
3
|
+
import { type AttachedComputer, type CallContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type CreatedComputer, type NetworkPolicy, type NetworkSpec, type Refusal, type ReleaseHow } from "./provider.js";
|
|
4
|
+
import { type Result } from "./result.js";
|
|
5
|
+
import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
|
|
6
|
+
export type OrgoDesktopOs = "windows" | "macos";
|
|
7
|
+
/** The longest each kind of call may take, and the pause between two polls. */
|
|
8
|
+
export interface OrgoDesktopTimeouts {
|
|
9
|
+
/** One REST call: get, delete, extend, a workspace's computers, one input call. */
|
|
10
|
+
requestMs: number;
|
|
11
|
+
/** The create call, and the wait until the computer runs and answers a command. */
|
|
12
|
+
createMs: number;
|
|
13
|
+
/** One command of the provider's own (the labels file, the user). */
|
|
14
|
+
execMs: number;
|
|
15
|
+
/** One whole list. */
|
|
16
|
+
listMs: number;
|
|
17
|
+
/** From a delete to a computer Orgo no longer has. */
|
|
18
|
+
goneMs: number;
|
|
19
|
+
/** The pause between two reads while create or release waits. */
|
|
20
|
+
pollMs: number;
|
|
21
|
+
}
|
|
22
|
+
export interface OrgoDesktopOptions {
|
|
23
|
+
/** Which desktop: Windows or macOS. */
|
|
24
|
+
os: OrgoDesktopOs;
|
|
25
|
+
/** The Orgo API key. Serve passes ORGO_API_KEY's value; the provider never reads the environment or logs it. */
|
|
26
|
+
apiKey: string;
|
|
27
|
+
/** The workspace this deployment's computers live in; the provider lists, attaches and releases only there. */
|
|
28
|
+
workspaceId: string;
|
|
29
|
+
/** Orgo's API, https; default https://www.orgo.ai/api. */
|
|
30
|
+
apiUrl?: string;
|
|
31
|
+
/** For tests: every REST call goes through it. Default the global fetch. */
|
|
32
|
+
fetch?: typeof fetch;
|
|
33
|
+
/** The longest lifetime check takes: at most 720 h, the default (Orgo's longest end on Windows). */
|
|
34
|
+
maxLifetimeMs?: number;
|
|
35
|
+
timeouts?: Partial<OrgoDesktopTimeouts>;
|
|
36
|
+
/** The version the computer's hello reports; default the provider's. Only the conformance drift case sets another. */
|
|
37
|
+
daemonVersion?: string;
|
|
38
|
+
}
|
|
39
|
+
/** What differs between the two desktops. */
|
|
40
|
+
interface Profile {
|
|
41
|
+
os: OrgoDesktopOs;
|
|
42
|
+
image: string;
|
|
43
|
+
groups: readonly Group[];
|
|
44
|
+
/** Go's name for the architecture the desktop reports in hello. */
|
|
45
|
+
arch: string;
|
|
46
|
+
/** Where the labels file is. */
|
|
47
|
+
labels: string;
|
|
48
|
+
/** Where a file too large for one command waits, uploaded, before it takes its path (Windows' files.write). */
|
|
49
|
+
staging?: string;
|
|
50
|
+
/** Orgo's RAM sizes, in GB. */
|
|
51
|
+
ram: readonly number[];
|
|
52
|
+
/** Whether Orgo takes ends_in_hours, the vendor's backstop, for this os. */
|
|
53
|
+
ends: boolean;
|
|
54
|
+
/** Whether the spec may give cpus. */
|
|
55
|
+
cpus: boolean;
|
|
56
|
+
/** The most bytes of text one type call takes. */
|
|
57
|
+
typeBytes: number;
|
|
58
|
+
/** Whether click and drag take a button other than left, and click a repeat and modifiers. */
|
|
59
|
+
windowsInput: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** One word for PowerShell: single-quoted, with every quote PowerShell reads as a single quote doubled. */
|
|
62
|
+
export declare const psQuote: (word: string) => string;
|
|
63
|
+
/** One word for a POSIX shell: single-quoted. */
|
|
64
|
+
export declare const shQuote: (word: string) => string;
|
|
65
|
+
/**
|
|
66
|
+
* The command that runs argv on this desktop, as Orgo's bash call takes it: on Windows a PowerShell call operator over
|
|
67
|
+
* quoted words, whose exit is the program's own ($LASTEXITCODE), or 0 and 1 for a cmdlet; on macOS the words quoted for
|
|
68
|
+
* the shell, through env for the variables. cwd and env are set first; argv is never a shell string. A cwd or variable
|
|
69
|
+
* that cannot be set runs nothing: the command exits 1 with the error on stderr, as the shell's `cd … &&` does on macOS.
|
|
70
|
+
*/
|
|
71
|
+
export declare function commandOf(os: OrgoDesktopOs, argv: readonly string[], { cwd, env }?: {
|
|
72
|
+
cwd?: string;
|
|
73
|
+
env?: Record<string, string>;
|
|
74
|
+
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* Orgo's Windows and macOS desktops: see the module's header. A spec's image is "windows" or "macos", the one this
|
|
77
|
+
* provider was built for; cpus and memoryMb are Orgo's sizes; the network is open.
|
|
78
|
+
*/
|
|
79
|
+
export declare class OrgoDesktopProvider implements ComputerProvider {
|
|
80
|
+
#private;
|
|
81
|
+
readonly id = "orgo";
|
|
82
|
+
readonly version: string;
|
|
83
|
+
constructor({ os, apiKey, workspaceId, apiUrl, fetch, maxLifetimeMs, timeouts, daemonVersion }: OrgoDesktopOptions);
|
|
84
|
+
/**
|
|
85
|
+
* daemon none: the provider answers every method over Orgo's API. lifetime janitor: the deadline is in the name, and
|
|
86
|
+
* on Windows Orgo's end (whole hours) is the backstop. network open alone, never read back from inside: Orgo has no
|
|
87
|
+
* egress control and no computerd runs here to probe from inside. release delete alone.
|
|
88
|
+
*/
|
|
89
|
+
capabilities(): ComputerCapabilities;
|
|
90
|
+
check(spec: ComputerSpec): Refusal[];
|
|
91
|
+
create(spec: ComputerSpec, { signal }?: CallContext): Promise<Result<CreatedComputer>>;
|
|
92
|
+
/** The live view: screen.watch on a connection of the watch's own (daemonWatch), the client's polled screenshots. */
|
|
93
|
+
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
94
|
+
/**
|
|
95
|
+
* A connection to a computer Orgo reads running; one that is not is refused, never woken by a first call. Once open,
|
|
96
|
+
* the connection is the claim's own, on a computer its run holds: a call it makes reaches Orgo even if Orgo has since
|
|
97
|
+
* suspended the computer, and waking it for the run's own input is what the run asked. The no-wake rule is for what
|
|
98
|
+
* reads computers no run holds (list, the janitor, attach), which never wake one.
|
|
99
|
+
*/
|
|
100
|
+
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
101
|
+
attach(ref: {
|
|
102
|
+
id: string;
|
|
103
|
+
} | {
|
|
104
|
+
labels: Record<string, string>;
|
|
105
|
+
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
106
|
+
/**
|
|
107
|
+
* Every computer of this provider in the workspace that carries all of these labels. The run and the epoch are read
|
|
108
|
+
* from the name, with nothing run in a computer, so a stopped one is listed too; any other label is read from the
|
|
109
|
+
* labels file of a running computer (a stopped one is not woken, so it proves no such label and is left out).
|
|
110
|
+
*/
|
|
111
|
+
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
112
|
+
/** Settings' test: one read of the workspace's computers (list with no label to read from inside), which makes nothing. */
|
|
113
|
+
testConnection(context?: CallContext): Promise<Result<{
|
|
114
|
+
detail: string;
|
|
115
|
+
}>>;
|
|
116
|
+
/** open: what Orgo gives, the one network here; never read from inside, and a change is refused. */
|
|
117
|
+
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
118
|
+
/** delete: idempotent, a computer Orgo no longer has is done; it waits until Orgo no longer has it. No stop. */
|
|
119
|
+
release(ref: ComputerRef, how: ReleaseHow, { signal }?: CallContext): Promise<Result<void>>;
|
|
120
|
+
/**
|
|
121
|
+
* Moves the deadline to now + ttlMs, never earlier and never past the most the labels file holds: Orgo's end first
|
|
122
|
+
* where there is one, in whole hours with an Idempotency-Key, then the name's, then the labels file. A computer's
|
|
123
|
+
* extends are taken in turn.
|
|
124
|
+
*/
|
|
125
|
+
extend(ref: ComputerRef, ttlMs: number, context?: CallContext): Promise<Result<{
|
|
126
|
+
deadline: Date;
|
|
127
|
+
}>>;
|
|
128
|
+
}
|
|
129
|
+
/** Where the pointer is on one computer, shared by its clients: undefined until a client has moved it. */
|
|
130
|
+
export interface Pointer {
|
|
131
|
+
at?: [number, number] | undefined;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The in-process client of one Orgo Windows or macOS desktop: each protocol method is one or more calls to Orgo's API.
|
|
135
|
+
* Input batches run one at a time; a cancel stops a batch at the action it is on.
|
|
136
|
+
*/
|
|
137
|
+
export declare class OrgoDesktopClient implements ComputerClient {
|
|
138
|
+
#private;
|
|
139
|
+
readonly rest: OrgoRest;
|
|
140
|
+
readonly computer: string;
|
|
141
|
+
readonly profile: Profile;
|
|
142
|
+
readonly workspaceId: string;
|
|
143
|
+
readonly requestMs: number;
|
|
144
|
+
readonly pointer: Pointer;
|
|
145
|
+
constructor(rest: OrgoRest, computer: string, profile: Profile, workspaceId: string, requestMs: number, pointer?: Pointer);
|
|
146
|
+
/** The screen's size from a first screenshot, then the hello this client answers. */
|
|
147
|
+
open(version: string, signal?: AbortSignal): Promise<Result<HelloResult>>;
|
|
148
|
+
close(): void;
|
|
149
|
+
call<M extends DaemonMethod>(method: M, params: DaemonMethods[M]["params"], options?: {
|
|
150
|
+
signal?: AbortSignal;
|
|
151
|
+
}): Promise<Result<DaemonMethods[M]["result"]>>;
|
|
152
|
+
}
|
|
153
|
+
export {};
|