@parcha/agentrun-computer 0.1.0-beta.34 → 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 +144 -26
- package/dist/browser.d.ts +12 -13
- package/dist/browser.js +16 -14
- package/dist/browserbase.d.ts +3 -5
- package/dist/browserbase.js +16 -13
- package/dist/chrome.js +1 -1
- 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/provider.js +78 -3
- 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.d.ts → local-chrome.d.ts} +7 -7
- package/dist/conformance/{local.js → local-chrome.js} +11 -11
- 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 +3 -2
- package/dist/conformance/runner.js +25 -7
- package/dist/conformance/types.d.ts +21 -8
- 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 +3 -34
- package/dist/daytona.js +34 -61
- 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 -6
- package/dist/docker.js +46 -42
- package/dist/drift.d.ts +3 -145
- package/dist/drift.js +5 -334
- package/dist/e2b.d.ts +2 -8
- package/dist/e2b.js +16 -22
- package/dist/index.d.ts +8 -11
- package/dist/index.js +13 -11
- package/dist/isolation.js +2 -2
- package/dist/janitor.d.ts +18 -1
- package/dist/janitor.js +67 -19
- package/dist/kernel.d.ts +3 -5
- package/dist/kernel.js +19 -16
- package/dist/kinds.d.ts +54 -34
- package/dist/kinds.js +19 -117
- package/dist/labels.d.ts +12 -0
- package/dist/labels.js +39 -1
- package/dist/{local.d.ts → local-chrome.d.ts} +5 -8
- package/dist/{local.js → local-chrome.js} +19 -16
- package/dist/local-supervisor.d.ts +3 -3
- package/dist/local-supervisor.js +3 -3
- package/dist/modal.d.ts +3 -22
- package/dist/modal.js +15 -31
- 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 -15
- package/dist/orgo.js +46 -107
- package/dist/phone-harness.d.ts +4 -10
- package/dist/phone-harness.js +45 -46
- package/dist/provider.d.ts +91 -10
- package/dist/provider.js +42 -0
- package/dist/providers.d.ts +23 -24
- package/dist/providers.js +14 -17
- 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
|
@@ -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 {};
|