@parcha/agentrun-computer 0.0.0-stage → 0.1.0-beta.32
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +2401 -2
- package/box/Dockerfile +69 -0
- package/box/agentrun-archil +168 -0
- package/box/build-daytona.py +26 -0
- package/box/build-e2b.mjs +32 -0
- package/box/build-modal.py +17 -0
- package/dist/actions.d.ts +18 -0
- package/dist/actions.js +139 -0
- package/dist/browser.d.ts +151 -0
- package/dist/browser.js +305 -0
- package/dist/browserbase.d.ts +139 -0
- package/dist/browserbase.js +408 -0
- package/dist/child.d.ts +40 -0
- package/dist/child.js +127 -0
- package/dist/client.d.ts +22 -0
- package/dist/client.js +136 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/archil.d.ts +68 -0
- package/dist/conformance/archil.js +152 -0
- package/dist/conformance/browserbase.d.ts +35 -0
- package/dist/conformance/browserbase.js +45 -0
- package/dist/conformance/cases/apps.d.ts +2 -0
- package/dist/conformance/cases/apps.js +155 -0
- package/dist/conformance/cases/browser.d.ts +4 -0
- package/dist/conformance/cases/browser.js +105 -0
- package/dist/conformance/cases/drift.d.ts +2 -0
- package/dist/conformance/cases/drift.js +64 -0
- package/dist/conformance/cases/exec.d.ts +2 -0
- package/dist/conformance/cases/exec.js +125 -0
- package/dist/conformance/cases/files.d.ts +2 -0
- package/dist/conformance/cases/files.js +294 -0
- package/dist/conformance/cases/health.d.ts +2 -0
- package/dist/conformance/cases/health.js +71 -0
- package/dist/conformance/cases/index.d.ts +9 -0
- package/dist/conformance/cases/index.js +37 -0
- package/dist/conformance/cases/input.d.ts +12 -0
- package/dist/conformance/cases/input.js +109 -0
- package/dist/conformance/cases/isolation.d.ts +21 -0
- package/dist/conformance/cases/isolation.js +92 -0
- package/dist/conformance/cases/lifetime.d.ts +2 -0
- package/dist/conformance/cases/lifetime.js +64 -0
- package/dist/conformance/cases/mount.d.ts +2 -0
- package/dist/conformance/cases/mount.js +252 -0
- package/dist/conformance/cases/process.d.ts +2 -0
- package/dist/conformance/cases/process.js +240 -0
- package/dist/conformance/cases/provider.d.ts +2 -0
- package/dist/conformance/cases/provider.js +302 -0
- package/dist/conformance/cases/screen.d.ts +9 -0
- package/dist/conformance/cases/screen.js +230 -0
- package/dist/conformance/cases/settings.d.ts +57 -0
- package/dist/conformance/cases/settings.js +142 -0
- package/dist/conformance/cases/touch.d.ts +2 -0
- package/dist/conformance/cases/touch.js +117 -0
- package/dist/conformance/cases/util.d.ts +7 -0
- package/dist/conformance/cases/util.js +8 -0
- package/dist/conformance/cdp.d.ts +13 -0
- package/dist/conformance/cdp.js +88 -0
- package/dist/conformance/cli.d.ts +29 -0
- package/dist/conformance/cli.js +231 -0
- package/dist/conformance/daytona-sweep.d.ts +18 -0
- package/dist/conformance/daytona-sweep.js +118 -0
- package/dist/conformance/daytona.d.ts +83 -0
- package/dist/conformance/daytona.js +107 -0
- package/dist/conformance/docker.d.ts +38 -0
- package/dist/conformance/docker.js +70 -0
- package/dist/conformance/drift-daemon.d.ts +8 -0
- package/dist/conformance/drift-daemon.js +41 -0
- package/dist/conformance/e2b-diagnose.d.ts +16 -0
- package/dist/conformance/e2b-diagnose.js +61 -0
- package/dist/conformance/e2b-sweep.d.ts +18 -0
- package/dist/conformance/e2b-sweep.js +125 -0
- package/dist/conformance/e2b.d.ts +74 -0
- package/dist/conformance/e2b.js +111 -0
- package/dist/conformance/fixture.d.ts +65 -0
- package/dist/conformance/fixture.js +98 -0
- package/dist/conformance/index.d.ts +8 -0
- package/dist/conformance/index.js +8 -0
- package/dist/conformance/kernel.d.ts +31 -0
- package/dist/conformance/kernel.js +40 -0
- package/dist/conformance/kind.d.ts +23 -0
- package/dist/conformance/kind.js +58 -0
- package/dist/conformance/modal-sweep.d.ts +22 -0
- package/dist/conformance/modal-sweep.js +190 -0
- package/dist/conformance/modal.d.ts +69 -0
- package/dist/conformance/modal.js +76 -0
- package/dist/conformance/orgo.d.ts +41 -0
- package/dist/conformance/orgo.js +69 -0
- package/dist/conformance/phone-harness.d.ts +61 -0
- package/dist/conformance/phone-harness.js +241 -0
- package/dist/conformance/png.d.ts +16 -0
- package/dist/conformance/png.js +132 -0
- package/dist/conformance/report.d.ts +2 -0
- package/dist/conformance/report.js +86 -0
- package/dist/conformance/runner.d.ts +11 -0
- package/dist/conformance/runner.js +585 -0
- package/dist/conformance/tar.d.ts +13 -0
- package/dist/conformance/tar.js +105 -0
- package/dist/conformance/types.d.ts +257 -0
- package/dist/conformance/types.js +24 -0
- package/dist/daemon-copy.d.ts +40 -0
- package/dist/daemon-copy.js +259 -0
- package/dist/daytona.d.ts +178 -0
- package/dist/daytona.js +1484 -0
- package/dist/desktop.d.ts +24 -0
- package/dist/desktop.js +68 -0
- package/dist/docker/egress-main.d.ts +1 -0
- package/dist/docker/egress-main.js +68 -0
- package/dist/docker/egress-proxy.d.ts +53 -0
- package/dist/docker/egress-proxy.js +450 -0
- package/dist/docker/egress-table.d.ts +39 -0
- package/dist/docker/egress-table.js +197 -0
- package/dist/docker/egress.d.ts +109 -0
- package/dist/docker/egress.js +318 -0
- package/dist/docker/image.d.ts +49 -0
- package/dist/docker/image.js +302 -0
- package/dist/docker/stage.d.ts +21 -0
- package/dist/docker/stage.js +290 -0
- package/dist/docker/volume.d.ts +24 -0
- package/dist/docker/volume.js +67 -0
- package/dist/docker.d.ts +150 -0
- package/dist/docker.js +1200 -0
- package/dist/drift.d.ts +200 -0
- package/dist/drift.js +416 -0
- package/dist/e2b.d.ts +335 -0
- package/dist/e2b.js +1515 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.js +24 -0
- package/dist/files.d.ts +50 -0
- package/dist/files.js +208 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +26 -0
- package/dist/isolation.d.ts +29 -0
- package/dist/isolation.js +71 -0
- package/dist/janitor.d.ts +50 -0
- package/dist/janitor.js +135 -0
- package/dist/kernel.d.ts +113 -0
- package/dist/kernel.js +358 -0
- package/dist/kinds.d.ts +79 -0
- package/dist/kinds.js +133 -0
- package/dist/labels.d.ts +23 -0
- package/dist/labels.js +50 -0
- package/dist/modal.d.ts +302 -0
- package/dist/modal.js +1374 -0
- package/dist/mount-archil.d.ts +164 -0
- package/dist/mount-archil.js +471 -0
- package/dist/mount.d.ts +57 -0
- package/dist/mount.js +104 -0
- package/dist/orgo-channel.d.ts +96 -0
- package/dist/orgo-channel.js +391 -0
- package/dist/orgo.d.ts +139 -0
- package/dist/orgo.js +1006 -0
- package/dist/phone-harness.d.ts +185 -0
- package/dist/phone-harness.js +1420 -0
- package/dist/processes.d.ts +24 -0
- package/dist/processes.js +40 -0
- package/dist/protocol.d.ts +729 -0
- package/dist/protocol.js +54 -0
- package/dist/provider.d.ts +245 -0
- package/dist/provider.js +37 -0
- package/dist/providers.d.ts +68 -0
- package/dist/providers.js +25 -0
- package/dist/result.d.ts +15 -0
- package/dist/result.js +2 -0
- package/dist/screen-watch.d.ts +150 -0
- package/dist/screen-watch.js +490 -0
- package/dist/test-connection.d.ts +17 -0
- package/dist/test-connection.js +26 -0
- package/dist/wait.d.ts +23 -0
- package/dist/wait.js +65 -0
- package/package.json +62 -4
package/dist/orgo.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { KindCapabilities } from "./kinds.js";
|
|
2
|
+
import { type MountKind } from "./mount.js";
|
|
3
|
+
import { type OrgoChannel, type OrgoStart, type OrgoWebSocketFactory } from "./orgo-channel.js";
|
|
4
|
+
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 } from "./provider.js";
|
|
5
|
+
import { type Result } from "./result.js";
|
|
6
|
+
import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
|
|
7
|
+
/** The mount kinds an Orgo computer takes: none yet (an Archil mount needs an Orgo template that bakes the helper). */
|
|
8
|
+
export declare const MOUNT: readonly MountKind[];
|
|
9
|
+
/** What a built provider declares, known without building one: one configuration, a Linux desktop (the registry's entry). */
|
|
10
|
+
export declare const CAPABILITIES: readonly KindCapabilities[];
|
|
11
|
+
/** The conformance CLI's module for Orgo: its live switch, the run's 1 h cap and the drifted twin. */
|
|
12
|
+
export declare const conformance: () => Promise<typeof import("./conformance/orgo.js")>;
|
|
13
|
+
/** The longest each kind of call may take, and the pause between two polls. */
|
|
14
|
+
export interface OrgoTimeouts {
|
|
15
|
+
/** One REST call: get, delete, extend, a workspace's computers. */
|
|
16
|
+
requestMs: number;
|
|
17
|
+
/** The create call, and the wait until Orgo reads the computer running. */
|
|
18
|
+
createMs: number;
|
|
19
|
+
/** The daemon's upload. */
|
|
20
|
+
uploadMs: number;
|
|
21
|
+
/** One command through the channel: install, the X check, the labels file, the start. */
|
|
22
|
+
execMs: number;
|
|
23
|
+
/** From a bridge's start to the daemon's hello, and each read-back call after it. */
|
|
24
|
+
helloMs: number;
|
|
25
|
+
/** The probe, through the daemon. */
|
|
26
|
+
probeMs: number;
|
|
27
|
+
/** One whole list. */
|
|
28
|
+
listMs: number;
|
|
29
|
+
/** From a delete to a computer Orgo no longer has. */
|
|
30
|
+
goneMs: number;
|
|
31
|
+
/** The pause between two reads while create or release waits. */
|
|
32
|
+
pollMs: number;
|
|
33
|
+
}
|
|
34
|
+
export interface OrgoProviderOptions {
|
|
35
|
+
/** The Orgo API key. Serve passes ORGO_API_KEY's value; the provider never reads the environment or logs it. */
|
|
36
|
+
apiKey: string;
|
|
37
|
+
/** The workspace this deployment's computers live in; the provider lists, attaches and releases only there. */
|
|
38
|
+
workspaceId: string;
|
|
39
|
+
/** Orgo's API, https; default https://www.orgo.ai/api. */
|
|
40
|
+
apiUrl?: string;
|
|
41
|
+
/** For tests: every REST call goes through it. Default the global fetch. */
|
|
42
|
+
fetch?: typeof fetch;
|
|
43
|
+
/** For tests: the terminal socket. Default Node's global WebSocket. */
|
|
44
|
+
webSocket?: OrgoWebSocketFactory;
|
|
45
|
+
/** The way into a computer; default Orgo's bash, upload and root terminal (orgoTerminalChannel). */
|
|
46
|
+
channel?: OrgoChannel;
|
|
47
|
+
/** The daemon binary for linux/amd64. Default this package's dist/computerd-linux-amd64. */
|
|
48
|
+
daemonPath?: string;
|
|
49
|
+
/** The longest lifetime check takes: at most Orgo's 720 h, the default. */
|
|
50
|
+
maxLifetimeMs?: number;
|
|
51
|
+
/** Who the tools run as, uid:gid in numbers, never root: default 2510:2510, the remote tool user. */
|
|
52
|
+
user?: string;
|
|
53
|
+
/** How init is started: from bash, detached (default), or in a named terminal session. */
|
|
54
|
+
start?: OrgoStart;
|
|
55
|
+
/** Orgo's X display, where the daemon's screen and input go. Default :99. */
|
|
56
|
+
display?: string;
|
|
57
|
+
timeouts?: Partial<OrgoTimeouts>;
|
|
58
|
+
/** The addresses the probe tries, host:port over TCP or host:port/udp, to show none of them answers. */
|
|
59
|
+
probeTargets?: string[];
|
|
60
|
+
}
|
|
61
|
+
/** Orgo's base desktop, no template: the image a spec names for a plain Linux desktop, and the default for kind desktop. */
|
|
62
|
+
export declare const ORGO_BASE_IMAGE = "linux";
|
|
63
|
+
/** The labels file: every label, the deadline and its most, the image and sizes, root's, readable by all. */
|
|
64
|
+
export declare const LABELS_FILE = "/opt/agentrun/labels.json";
|
|
65
|
+
/**
|
|
66
|
+
* Every path unix socket of Orgo's desktop made root's alone (owner root, mode 0600), but the display's own ($1) and
|
|
67
|
+
* computerd's, before any tool runs: the tools reach the X server through that one and nothing else (live run 4 found
|
|
68
|
+
* root's D-Bus buses connectable by the tool user). Prints `locked <path>` for each, and `failed <path>` for one it
|
|
69
|
+
* could not lock. Any failure fails the script: the scan, the sort, or one socket's chown or chmod (a later socket that
|
|
70
|
+
* locks hides none), and create then refuses the computer. Plain sh (no pipefail): the scan and the sort are each
|
|
71
|
+
* checked, and the loop reads a here-document, so its failed flag is the script's own. Orgo's desktop runs as root, so
|
|
72
|
+
* nothing of its own loses a socket.
|
|
73
|
+
*/
|
|
74
|
+
export declare const LOCKDOWN_SCRIPT: string;
|
|
75
|
+
/**
|
|
76
|
+
* The name of a computer with these labels: computer-<hex>, then -r<the run label's hash> and -e<the epoch label> when
|
|
77
|
+
* the labels carry a run and an epoch that is one, then -d<the deadline> when given: whole seconds since the epoch,
|
|
78
|
+
* rounded up (never before init's own), in base 36, the janitor's deadline. Only those: a name is no place for a label's
|
|
79
|
+
* value. Everything but the deadline is the name's stable part, which a rename on extend keeps.
|
|
80
|
+
*/
|
|
81
|
+
export declare function orgoName(labels: Record<string, string>, hex: string, deadline?: Date): string;
|
|
82
|
+
/**
|
|
83
|
+
* Orgo desktops: see the module's header. A spec's image is "linux" (Orgo's base desktop) or an Orgo template
|
|
84
|
+
* (namespace/name@version); cpus and memoryMb are Orgo's sizes; the network is none.
|
|
85
|
+
*/
|
|
86
|
+
export declare class OrgoProvider implements ComputerProvider {
|
|
87
|
+
#private;
|
|
88
|
+
readonly id = "orgo";
|
|
89
|
+
readonly version: string;
|
|
90
|
+
constructor({ apiKey, workspaceId, apiUrl, fetch, webSocket, channel, daemonPath, maxLifetimeMs, user, start, display, timeouts, probeTargets }: OrgoProviderOptions);
|
|
91
|
+
/**
|
|
92
|
+
* daemon child: Orgo's own agent is the VM's first process, and init is a command it ran. lifetime janitor: Orgo ends
|
|
93
|
+
* a computer only in whole hours (ends_in_hours, the backstop), so the janitor deletes it at its exact deadline, which
|
|
94
|
+
* its name carries (list() reads it with nothing run inside); init ends its programs at that deadline inside. network
|
|
95
|
+
* none alone, read back by the probe from inside (Orgo reads no policy back). release delete alone: Orgo's stop
|
|
96
|
+
* freezes a computer, which nothing here needs.
|
|
97
|
+
*/
|
|
98
|
+
capabilities(): ComputerCapabilities;
|
|
99
|
+
check(spec: ComputerSpec): Refusal[];
|
|
100
|
+
create(spec: ComputerSpec, { signal }?: CallContext): Promise<Result<CreatedComputer>>;
|
|
101
|
+
/** The live view: screen.watch on a connection of the watch's own (daemonWatch), never Orgo's VNC (proxy only). */
|
|
102
|
+
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
103
|
+
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
104
|
+
attach(ref: {
|
|
105
|
+
id: string;
|
|
106
|
+
} | {
|
|
107
|
+
labels: Record<string, string>;
|
|
108
|
+
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
109
|
+
/**
|
|
110
|
+
* Every computer of this provider in the workspace that carries all of these labels. The run and the epoch are read
|
|
111
|
+
* from the name, with nothing run in a computer, so a stopped one is listed too; any other label is read from the
|
|
112
|
+
* labels file of a running computer (a stopped one is not woken, so it proves no such label and is left out).
|
|
113
|
+
*/
|
|
114
|
+
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
115
|
+
/** none, read back by the probe from inside, as the tool user; a change is refused: none is the one network here. */
|
|
116
|
+
/** Settings' test: one read of the workspace's computers (list with no label to read from inside), which makes nothing. */
|
|
117
|
+
testConnection(context?: CallContext): Promise<Result<{
|
|
118
|
+
detail: string;
|
|
119
|
+
}>>;
|
|
120
|
+
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
121
|
+
/** delete: idempotent, a computer Orgo no longer has is done; it waits until Orgo no longer has it. No stop. */
|
|
122
|
+
release(ref: ComputerRef, how: "stop" | "delete", { signal }?: CallContext): Promise<Result<void>>;
|
|
123
|
+
/**
|
|
124
|
+
* Moves the deadline to now + ttlMs, never earlier and never past the most the labels file holds (create's time plus
|
|
125
|
+
* the cap): Orgo's end first, in whole hours with an Idempotency-Key, so it never ends the computer before init does;
|
|
126
|
+
* then init's deadline; then the name's, from the time init took; then the labels file. The result is the deadline
|
|
127
|
+
* init took. A computer's extends are taken in turn: each reads the deadline the one before it left, so a shorter one
|
|
128
|
+
* is refused as earlier, never renaming the computer back to an earlier deadline the janitor would trust.
|
|
129
|
+
*/
|
|
130
|
+
extend(ref: ComputerRef, ttlMs: number, context?: CallContext): Promise<Result<{
|
|
131
|
+
deadline: Date;
|
|
132
|
+
}>>;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* An OrgoProvider from its options alone, its key included: it reads no environment. Serve passes apiKey from its
|
|
136
|
+
* ORGO_API_KEY setting and its workspace; the conformance module reads COMPUTER_ORGO_* (settingsFromEnv).
|
|
137
|
+
*/
|
|
138
|
+
export declare function create(options: OrgoProviderOptions): OrgoProvider;
|
|
139
|
+
export type { OrgoChannel, OrgoStart, OrgoStream, OrgoWebSocketFactory } from "./orgo-channel.js";
|