@parcha/agentrun-computer 0.1.0-beta.41 → 0.1.0-beta.42
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 +254 -14
- package/box/README.md +2 -2
- package/box/build-e2b.mjs +1 -1
- package/dist/box-image.d.ts +1 -3
- package/dist/box-image.js +1 -11
- package/dist/boxd.d.ts +126 -0
- package/dist/boxd.js +418 -0
- package/dist/cloudflare.d.ts +32 -0
- package/dist/cloudflare.js +179 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/computerd.json +2 -2
- package/dist/conformance/boxd.d.ts +77 -0
- package/dist/conformance/boxd.js +113 -0
- package/dist/conformance/cases/isolation.js +1 -17
- package/dist/conformance/cloudflare.d.ts +42 -0
- package/dist/conformance/cloudflare.js +54 -0
- package/dist/conformance/dial-only.d.ts +6 -0
- package/dist/conformance/dial-only.js +9 -0
- package/dist/conformance/e2b.d.ts +12 -3
- package/dist/conformance/e2b.js +21 -4
- package/dist/conformance/fly.d.ts +52 -0
- package/dist/conformance/fly.js +52 -0
- package/dist/conformance/modal.d.ts +15 -2
- package/dist/conformance/modal.js +36 -3
- package/dist/conformance/morph.d.ts +59 -0
- package/dist/conformance/morph.js +95 -0
- package/dist/conformance/phone-harness.js +2 -2
- package/dist/conformance/runner.js +3 -3
- package/dist/conformance/sweep.d.ts +1 -6
- package/dist/conformance/sweep.js +8 -18
- package/dist/descriptors/boxd.d.ts +52 -0
- package/dist/descriptors/boxd.js +29 -0
- package/dist/descriptors/cloudflare.d.ts +21 -0
- package/dist/descriptors/cloudflare.js +29 -0
- package/dist/descriptors/e2b.d.ts +4 -0
- package/dist/descriptors/e2b.js +3 -0
- package/dist/descriptors/fly.d.ts +19 -0
- package/dist/descriptors/fly.js +28 -0
- package/dist/descriptors/index.d.ts +113 -1
- package/dist/descriptors/index.js +7 -2
- package/dist/descriptors/modal.d.ts +3 -0
- package/dist/descriptors/modal.js +7 -2
- package/dist/descriptors/morph.d.ts +15 -0
- package/dist/descriptors/morph.js +21 -0
- package/dist/descriptors/phone-harness.d.ts +1 -0
- package/dist/descriptors/phone-harness.js +2 -0
- package/dist/e2b.d.ts +7 -1
- package/dist/e2b.js +87 -44
- package/dist/fly.d.ts +43 -0
- package/dist/fly.js +245 -0
- package/dist/host.d.ts +8 -28
- package/dist/hosted/process.d.ts +19 -0
- package/dist/hosted/process.js +28 -0
- package/dist/hosted/provider.d.ts +11 -22
- package/dist/hosted/provider.js +30 -201
- package/dist/hosted/scripts.d.ts +2 -8
- package/dist/hosted/scripts.js +2 -22
- package/dist/hosted/ssh-exec.d.ts +2 -1
- package/dist/hosted/ssh-exec.js +58 -2
- package/dist/hosted/values.d.ts +5 -0
- package/dist/hosted/values.js +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/modal.d.ts +6 -0
- package/dist/modal.js +20 -10
- package/dist/morph.d.ts +65 -0
- package/dist/morph.js +495 -0
- package/dist/phone-harness.d.ts +15 -5
- package/dist/phone-harness.js +50 -15
- package/dist/screen-watch.js +2 -2
- package/package.json +20 -2
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
// Modal for the conformance CLI: `npm run conformance -w @parcha/agentrun-computer -- --provider modal`. It builds a real
|
|
2
|
+
// Modal client, so it runs only with AGENTRUN_COMPUTER_LIVE_MODAL=1 and a key for an account you can bill, under
|
|
3
|
+
// COMPUTER_MODAL_TOKEN_ID and COMPUTER_MODAL_TOKEN_SECRET. The provider reads no environment: this module reads its own
|
|
4
|
+
// COMPUTER_MODAL_* names (never MODAL_TOKEN_ID or MODAL_TOKEN_SECRET, which may hold a production token) and passes each
|
|
5
|
+
// to create() as its option; the provider gives the token to the client explicitly, pins the server it goes to and
|
|
6
|
+
// refuses an ambient MODAL_SERVER_URL (see modalClient in ../modal.ts). The live switch is checked first, before any
|
|
7
|
+
// other setting is read. The live sweep (sweep.ts, --provider modal) reads the same names through createHost, which
|
|
8
|
+
// needs no live switch: it makes nothing; sweepScope names the app and server a before file must have been listed from.
|
|
9
|
+
//
|
|
10
|
+
// The daemon is uploaded into each sandbox (dist/computerd-linux-amd64, `npm run build:daemon`), so a run publishes
|
|
11
|
+
// nothing. The drifted provider uploads a daemon built with Go as version <version>-drift. Every computer of a run
|
|
12
|
+
// lives at most 30 minutes: Modal's timeout is its lifetime, and a longer one is refused in words.
|
|
13
|
+
//
|
|
14
|
+
// For the mount cases, mountFor("archil") makes a fresh run folder on the Archil disk COMPUTER_ARCHIL_DISK names (in
|
|
15
|
+
// COMPUTER_ARCHIL_REGION, mounted with the disk token COMPUTER_ARCHIL_TOKEN), and reaches it from outside through the
|
|
16
|
+
// disk's object API (the shared archilRunFolder, ./archil.ts: the host's disk SDK with COMPUTER_ARCHIL_API_KEY and
|
|
17
|
+
// COMPUTER_ARCHIL_S3_URL, or an object API given as archil.objects); with no disk named it makes none, and the cases
|
|
18
|
+
// are skipped.
|
|
19
|
+
import { boxImageRef } from "../box-image.js";
|
|
1
20
|
import { create, MODAL_DEFAULT_SERVER_URL } from "../modal.js";
|
|
2
21
|
import { archilRunFolder, archilSettings } from "./archil.js";
|
|
22
|
+
import { dialOnlyFromServer } from "./dial-only.js";
|
|
3
23
|
import { buildDriftDaemon, DRIFT_VERSION } from "./drift-daemon.js";
|
|
4
24
|
/** The Archil disk's settings for the mount cases, by name (COMPUTER_ARCHIL_*: all five, or none). */
|
|
5
25
|
export { ARCHIL_ENV } from "./archil.js";
|
|
@@ -13,6 +33,8 @@ export const MODAL_ENV = {
|
|
|
13
33
|
app: "COMPUTER_MODAL_APP",
|
|
14
34
|
/** serverUrl: the server the token goes to; the SDK's default when unset. */
|
|
15
35
|
serverUrl: "COMPUTER_MODAL_SERVER_URL",
|
|
36
|
+
/** connect: exec (default) or dial, which needs the public server's process (dialKit). */
|
|
37
|
+
connect: "COMPUTER_MODAL_CONNECT",
|
|
16
38
|
};
|
|
17
39
|
/** The names this module reads, under the conformance modules' common name (ConformanceModule.ENV). */
|
|
18
40
|
export const ENV = MODAL_ENV;
|
|
@@ -33,7 +55,9 @@ export function settingsFromEnv(env = process.env) {
|
|
|
33
55
|
if (!app)
|
|
34
56
|
throw new Error(`the Modal conformance module needs ${MODAL_ENV.app}: the app the run's sandboxes live in`);
|
|
35
57
|
const serverUrl = env[MODAL_ENV.serverUrl];
|
|
36
|
-
|
|
58
|
+
// create() refuses any other value in words.
|
|
59
|
+
const connect = env[MODAL_ENV.connect];
|
|
60
|
+
return { tokenId, tokenSecret, app, ...(serverUrl ? { serverUrl } : {}), ...(connect ? { connect } : {}) };
|
|
37
61
|
}
|
|
38
62
|
/** The longest lifetime a computer of a run may ask for: Modal ends each sandbox at its timeout, the lifetime. */
|
|
39
63
|
export const CONFORMANCE_MAX_LIFETIME_MS = 30 * 60_000;
|
|
@@ -43,10 +67,19 @@ function live(env) {
|
|
|
43
67
|
}
|
|
44
68
|
}
|
|
45
69
|
/** The provider the CLI runs; throws in words without the live switch, or when a setting is missing or wrong. */
|
|
46
|
-
export async function createProvider({ env = process.env, ModalClient, daemonPath, onNote } = {}) {
|
|
70
|
+
export async function createProvider({ env = process.env, ModalClient, daemonPath, onNote, dial } = {}) {
|
|
47
71
|
live(env);
|
|
48
|
-
return create({ ...settingsFromEnv(env), ...(daemonPath === undefined ? {} : { daemonPath }), ...(ModalClient ? { ModalClient } : {}), ...(onNote ? { onNote } : {}), maxLifetimeMs: CONFORMANCE_MAX_LIFETIME_MS });
|
|
72
|
+
return create({ ...settingsFromEnv(env), ...(daemonPath === undefined ? {} : { daemonPath }), ...(ModalClient ? { ModalClient } : {}), ...(onNote ? { onNote } : {}), ...(dial ? { dial } : {}), maxLifetimeMs: CONFORMANCE_MAX_LIFETIME_MS });
|
|
49
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* The image every computer of the run starts from: on dial the box image, since only it holds agentrun-dial; on exec
|
|
76
|
+
* debian:bookworm-slim, the CLI's own default.
|
|
77
|
+
*/
|
|
78
|
+
export function conformanceImage({ env = process.env } = {}) {
|
|
79
|
+
return env[MODAL_ENV.connect] === "dial" ? boxImageRef() : "debian:bookworm-slim";
|
|
80
|
+
}
|
|
81
|
+
/** A dial machine (COMPUTER_MODAL_CONNECT=dial) runs its Core inside the public server's process: refused here (dial-only.ts). */
|
|
82
|
+
export const dialKit = dialOnlyFromServer("modal", "Modal", `${MODAL_ENV.connect}=dial`);
|
|
50
83
|
/**
|
|
51
84
|
* A run folder for an Archil mount, and none for any other kind (a Modal computer takes no bind): a fresh folder on the
|
|
52
85
|
* disk the COMPUTER_ARCHIL_* names name (archilSettings), none when they name none (archilRunFolder, ./archil.ts).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { MachineHost } from "../host.js";
|
|
2
|
+
import { type MorphOptions, type MorphProvider } from "../morph.js";
|
|
3
|
+
/** The environment this module reads, by name, each for the option its comment names, the live switch and the run's snapshot. */
|
|
4
|
+
export declare const MORPH_ENV: {
|
|
5
|
+
readonly live: "AGENTRUN_COMPUTER_LIVE_MORPH";
|
|
6
|
+
/** apiKey, required: the account's API key. */
|
|
7
|
+
readonly key: "COMPUTER_MORPH_API_KEY";
|
|
8
|
+
/** The snapshot every computer of the run starts from; default the box snapshot (prepareImage). */
|
|
9
|
+
readonly snapshot: "COMPUTER_MORPH_SNAPSHOT";
|
|
10
|
+
/** apiUrl: Morph's REST API; default https://cloud.morph.so/api. */
|
|
11
|
+
readonly apiUrl: "COMPUTER_MORPH_API_URL";
|
|
12
|
+
/** daemonPath: the daemon binary; default this package's dist/computerd-linux-amd64. */
|
|
13
|
+
readonly daemon: "COMPUTER_MORPH_DAEMON";
|
|
14
|
+
/** maxLifetimeMs: the cap, in ms, at most 86400000; a run takes it when it is under 30 minutes, else 30 minutes. */
|
|
15
|
+
readonly maxLifetimeMs: "COMPUTER_MORPH_MAX_LIFETIME_MS";
|
|
16
|
+
};
|
|
17
|
+
/** The names this module reads, under the conformance modules' common name (ConformanceModule.ENV). */
|
|
18
|
+
export declare const ENV: {
|
|
19
|
+
readonly live: "AGENTRUN_COMPUTER_LIVE_MORPH";
|
|
20
|
+
/** apiKey, required: the account's API key. */
|
|
21
|
+
readonly key: "COMPUTER_MORPH_API_KEY";
|
|
22
|
+
/** The snapshot every computer of the run starts from; default the box snapshot (prepareImage). */
|
|
23
|
+
readonly snapshot: "COMPUTER_MORPH_SNAPSHOT";
|
|
24
|
+
/** apiUrl: Morph's REST API; default https://cloud.morph.so/api. */
|
|
25
|
+
readonly apiUrl: "COMPUTER_MORPH_API_URL";
|
|
26
|
+
/** daemonPath: the daemon binary; default this package's dist/computerd-linux-amd64. */
|
|
27
|
+
readonly daemon: "COMPUTER_MORPH_DAEMON";
|
|
28
|
+
/** maxLifetimeMs: the cap, in ms, at most 86400000; a run takes it when it is under 30 minutes, else 30 minutes. */
|
|
29
|
+
readonly maxLifetimeMs: "COMPUTER_MORPH_MAX_LIFETIME_MS";
|
|
30
|
+
};
|
|
31
|
+
/** What this module reads from the environment: the key, and each other option whose name is set. */
|
|
32
|
+
export type MorphSettings = Pick<MorphOptions, "apiKey" | "apiUrl" | "daemonPath" | "maxLifetimeMs">;
|
|
33
|
+
/** The provider's options this module reads from env, each only when its name is set; throws in words without a key, never echoing it. */
|
|
34
|
+
export declare function settingsFromEnv(env?: Record<string, string | undefined>): MorphSettings;
|
|
35
|
+
/** The longest lifetime a computer of a run may ask for: Morph's TTL and init end it at its deadline, the sweep deletes it. */
|
|
36
|
+
export declare const CONFORMANCE_MAX_LIFETIME_MS: number;
|
|
37
|
+
/** For the run's report: what this configuration means for the suite. */
|
|
38
|
+
export declare const conformanceNotes: string[];
|
|
39
|
+
export interface MorphModuleOptions extends Pick<MorphOptions, "ssh2" | "fetch" | "daemonPath" | "timeouts" | "onNote" | "sshHost" | "sshPort"> {
|
|
40
|
+
/** Where the settings are read; default process.env. */
|
|
41
|
+
env?: Record<string, string | undefined>;
|
|
42
|
+
/** Builds this package's daemon for linux/amd64 stamped with version, and gives its path; default go build. */
|
|
43
|
+
buildDaemon?: (version: string) => Promise<string>;
|
|
44
|
+
}
|
|
45
|
+
/** The provider the CLI runs; throws in words without the live switch, or when a setting is missing or wrong. */
|
|
46
|
+
export declare function createProvider(options?: MorphModuleOptions): Promise<MorphProvider>;
|
|
47
|
+
/** The same provider uploading a daemon that reports version <version>-drift, for the drift.version case. */
|
|
48
|
+
export declare function createDriftedProvider(options?: MorphModuleOptions): Promise<MorphProvider>;
|
|
49
|
+
/** The run's snapshot: COMPUTER_MORPH_SNAPSHOT, else the box snapshot, found or built in the key's account first (live). */
|
|
50
|
+
export declare function conformanceImage(options?: MorphModuleOptions, { signal }?: {
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
}): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* The Morph host the live sweep (sweep.ts) lists and deletes through, from the same settings; it needs no live switch,
|
|
55
|
+
* since the sweep makes nothing, and it calls nothing until the sweep does.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createHost(options?: Pick<MorphModuleOptions, "env" | "ssh2" | "fetch">): Promise<MachineHost>;
|
|
58
|
+
/** Where the host lists, in words: one key is one account, and one listing covers all of it. The key is named by its sha256 prefix alone. */
|
|
59
|
+
export declare function sweepScope({ env }?: Pick<MorphModuleOptions, "env">): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { accountOf, create } from "../morph.js";
|
|
2
|
+
import { buildDriftDaemon, DRIFT_VERSION } from "./drift-daemon.js";
|
|
3
|
+
/** The environment this module reads, by name, each for the option its comment names, the live switch and the run's snapshot. */
|
|
4
|
+
export const MORPH_ENV = {
|
|
5
|
+
live: "AGENTRUN_COMPUTER_LIVE_MORPH",
|
|
6
|
+
/** apiKey, required: the account's API key. */
|
|
7
|
+
key: "COMPUTER_MORPH_API_KEY",
|
|
8
|
+
/** The snapshot every computer of the run starts from; default the box snapshot (prepareImage). */
|
|
9
|
+
snapshot: "COMPUTER_MORPH_SNAPSHOT",
|
|
10
|
+
/** apiUrl: Morph's REST API; default https://cloud.morph.so/api. */
|
|
11
|
+
apiUrl: "COMPUTER_MORPH_API_URL",
|
|
12
|
+
/** daemonPath: the daemon binary; default this package's dist/computerd-linux-amd64. */
|
|
13
|
+
daemon: "COMPUTER_MORPH_DAEMON",
|
|
14
|
+
/** maxLifetimeMs: the cap, in ms, at most 86400000; a run takes it when it is under 30 minutes, else 30 minutes. */
|
|
15
|
+
maxLifetimeMs: "COMPUTER_MORPH_MAX_LIFETIME_MS",
|
|
16
|
+
};
|
|
17
|
+
/** The names this module reads, under the conformance modules' common name (ConformanceModule.ENV). */
|
|
18
|
+
export const ENV = MORPH_ENV;
|
|
19
|
+
/** The provider's options this module reads from env, each only when its name is set; throws in words without a key, never echoing it. */
|
|
20
|
+
export function settingsFromEnv(env = process.env) {
|
|
21
|
+
const apiKey = env[MORPH_ENV.key];
|
|
22
|
+
if (apiKey === undefined || apiKey === "")
|
|
23
|
+
throw new Error(`set ${MORPH_ENV.key} to a Morph API key: the conformance module reads it there and nowhere else, never from MORPH_API_KEY`);
|
|
24
|
+
const lifetime = env[MORPH_ENV.maxLifetimeMs] || undefined;
|
|
25
|
+
if (lifetime !== undefined && !/^\d+$/.test(lifetime))
|
|
26
|
+
throw new Error(`${MORPH_ENV.maxLifetimeMs} is a whole number of milliseconds, such as 86400000`);
|
|
27
|
+
const apiUrl = env[MORPH_ENV.apiUrl] || undefined;
|
|
28
|
+
const daemonPath = env[MORPH_ENV.daemon] || undefined;
|
|
29
|
+
return {
|
|
30
|
+
apiKey,
|
|
31
|
+
...(apiUrl === undefined ? {} : { apiUrl }),
|
|
32
|
+
...(daemonPath === undefined ? {} : { daemonPath }),
|
|
33
|
+
...(lifetime === undefined ? {} : { maxLifetimeMs: Number(lifetime) }),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** The longest lifetime a computer of a run may ask for: Morph's TTL and init end it at its deadline, the sweep deletes it. */
|
|
37
|
+
export const CONFORMANCE_MAX_LIFETIME_MS = 30 * 60_000;
|
|
38
|
+
/** For the run's report: what this configuration means for the suite. */
|
|
39
|
+
export const conformanceNotes = [
|
|
40
|
+
"morph: every computer is a Morph instance started from a snapshot (the box snapshot, built in the key's account, unless COMPUTER_MORPH_SNAPSHOT names one), with a TTL whose action is stop, read back from Morph and probed from inside; the daemon is a child, started over SSH through Morph's gateway (ssh.cloud.morph.so, as the instance id with the instance's own key), and every command goes over that SSH. Morph has no egress control: network none, open and a list are all init's. No Archil mount yet and no desktop; no stream(), so screen.stream is skipped.",
|
|
41
|
+
];
|
|
42
|
+
function live(env) {
|
|
43
|
+
if (env[MORPH_ENV.live] !== "1") {
|
|
44
|
+
throw new Error(`the Morph conformance module makes real instances, which bill until deleted: set ${MORPH_ENV.live}=1, with a key for an account you can bill, to run it`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** The test doubles a caller hands in, each only when given. */
|
|
48
|
+
const doubles = ({ ssh2, fetch, timeouts, onNote, sshHost, sshPort }) => ({
|
|
49
|
+
...(ssh2 ? { ssh2 } : {}),
|
|
50
|
+
...(fetch ? { fetch } : {}),
|
|
51
|
+
...(timeouts ? { timeouts } : {}),
|
|
52
|
+
...(onNote ? { onNote } : {}),
|
|
53
|
+
...(sshHost ? { sshHost } : {}),
|
|
54
|
+
...(sshPort ? { sshPort } : {}),
|
|
55
|
+
});
|
|
56
|
+
/** A run's cap: COMPUTER_MORPH_MAX_LIFETIME_MS when it is shorter, else CONFORMANCE_MAX_LIFETIME_MS. */
|
|
57
|
+
const runCap = (settings) => Math.min(settings.maxLifetimeMs ?? CONFORMANCE_MAX_LIFETIME_MS, CONFORMANCE_MAX_LIFETIME_MS);
|
|
58
|
+
/** The provider the CLI runs; throws in words without the live switch, or when a setting is missing or wrong. */
|
|
59
|
+
export async function createProvider(options = {}) {
|
|
60
|
+
const { env = process.env, daemonPath } = options;
|
|
61
|
+
live(env);
|
|
62
|
+
const settings = settingsFromEnv(env);
|
|
63
|
+
return create({ ...settings, ...doubles(options), ...(daemonPath === undefined ? {} : { daemonPath }), maxLifetimeMs: runCap(settings) });
|
|
64
|
+
}
|
|
65
|
+
/** The same provider uploading a daemon that reports version <version>-drift, for the drift.version case. */
|
|
66
|
+
export async function createDriftedProvider(options = {}) {
|
|
67
|
+
const { env = process.env, buildDaemon = (version) => buildDriftDaemon("amd64", version) } = options;
|
|
68
|
+
live(env);
|
|
69
|
+
const settings = settingsFromEnv(env);
|
|
70
|
+
const daemonPath = await buildDaemon(DRIFT_VERSION);
|
|
71
|
+
return create({ ...settings, ...doubles(options), daemonPath, maxLifetimeMs: runCap(settings) });
|
|
72
|
+
}
|
|
73
|
+
/** The run's snapshot: COMPUTER_MORPH_SNAPSHOT, else the box snapshot, found or built in the key's account first (live). */
|
|
74
|
+
export async function conformanceImage(options = {}, { signal } = {}) {
|
|
75
|
+
const { env = process.env } = options;
|
|
76
|
+
const named = env[MORPH_ENV.snapshot];
|
|
77
|
+
if (named)
|
|
78
|
+
return named;
|
|
79
|
+
const ready = await (await createProvider(options)).prepareImage(signal ? { signal } : {});
|
|
80
|
+
if (!ready.ok)
|
|
81
|
+
throw new Error(`the Morph box snapshot: ${ready.error.message}`);
|
|
82
|
+
return ready.value;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The Morph host the live sweep (sweep.ts) lists and deletes through, from the same settings; it needs no live switch,
|
|
86
|
+
* since the sweep makes nothing, and it calls nothing until the sweep does.
|
|
87
|
+
*/
|
|
88
|
+
export async function createHost(options = {}) {
|
|
89
|
+
return (await create({ ...settingsFromEnv(options.env ?? process.env), ...doubles(options) })).host;
|
|
90
|
+
}
|
|
91
|
+
/** Where the host lists, in words: one key is one account, and one listing covers all of it. The key is named by its sha256 prefix alone. */
|
|
92
|
+
export function sweepScope({ env = process.env } = {}) {
|
|
93
|
+
const { apiKey, apiUrl } = settingsFromEnv(env);
|
|
94
|
+
return accountOf(apiKey, apiUrl);
|
|
95
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// rented by the minute, so nothing is built without AGENTRUN_COMPUTER_LIVE_PHONE_HARNESS=1, and a run's phones live at
|
|
5
5
|
// most 10 min.
|
|
6
6
|
// The provider reads no environment: this module reads these names and passes them in as options.
|
|
7
|
-
import { randomBytes } from "node:crypto";
|
|
7
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
8
8
|
import { existsSync, linkSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { tmpdir } from "node:os";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
@@ -235,7 +235,7 @@ function optionsOf({ env = process.env, adb, uiFixture = UI_FIXTURE_APK, ...rest
|
|
|
235
235
|
maxLifetimeMs: RUN_MAX_LIFETIME_MS,
|
|
236
236
|
// The Full ui cases act on the fixture. Without its APK they skip, each saying it is not installed, and the
|
|
237
237
|
// report's notes say why (conformanceNotes).
|
|
238
|
-
apks: existsSync(uiFixture) ? [uiFixture] : [],
|
|
238
|
+
apks: existsSync(uiFixture) ? [{ path: uiFixture, sha256: createHash("sha256").update(readFileSync(uiFixture)).digest("hex") }] : [],
|
|
239
239
|
...rest,
|
|
240
240
|
};
|
|
241
241
|
}
|
|
@@ -717,7 +717,7 @@ export async function runConformance(provider, options) {
|
|
|
717
717
|
for (const what of pending.values()) {
|
|
718
718
|
report.cleanup.errors.push(`${what} did not settle within ${cleanupTimeoutMs / 1000} s of the run's end: what it makes may be left`);
|
|
719
719
|
}
|
|
720
|
-
await cleanup(provider, capabilities.lifetime, runLabels, report, deleted, cleanupTimeoutMs
|
|
720
|
+
await cleanup(provider, capabilities.lifetime, runLabels, report, deleted, cleanupTimeoutMs);
|
|
721
721
|
}
|
|
722
722
|
// A Core case skipped for an optional group the computer does not declare, or written for another system, is not part
|
|
723
723
|
// of Core's verdict.
|
|
@@ -733,7 +733,7 @@ export async function runConformance(provider, options) {
|
|
|
733
733
|
return report;
|
|
734
734
|
}
|
|
735
735
|
/** Sweeps a janitor provider by the run's label, past every deadline, and lists the label to show nothing is left. */
|
|
736
|
-
async function cleanup(provider, lifetime, labels, report, deleted, ms
|
|
736
|
+
async function cleanup(provider, lifetime, labels, report, deleted, ms) {
|
|
737
737
|
try {
|
|
738
738
|
if (lifetime === "janitor") {
|
|
739
739
|
const stop = new AbortController();
|
|
@@ -758,7 +758,7 @@ async function cleanup(provider, lifetime, labels, report, deleted, ms, image) {
|
|
|
758
758
|
if (host !== undefined && typeof host.list === "function") {
|
|
759
759
|
const { sweepMachines } = await import("./sweep.js");
|
|
760
760
|
const said = [];
|
|
761
|
-
const swept = await within(sweepMachines(host, { labels, waitMs: ms,
|
|
761
|
+
const swept = await within(sweepMachines(host, { labels, waitMs: ms, onWords: (words) => said.push(words) }), ms * 2, "the sweep of the run's machines");
|
|
762
762
|
report.cleanup.errors.push(...said.map((words) => `sweep: ${words}`));
|
|
763
763
|
if (!swept.ok)
|
|
764
764
|
report.cleanup.errors.push(`sweep: ${swept.error.code}: ${swept.error.message}`);
|
|
@@ -22,18 +22,13 @@ export interface SweepMachinesOptions {
|
|
|
22
22
|
listMs?: number;
|
|
23
23
|
/** Told, in words, of a machine not read, not deleted or still there. */
|
|
24
24
|
onWords?: (words: string) => void;
|
|
25
|
-
/**
|
|
26
|
-
* The image the run's computers started from. With facts.labels "machine", labels are read only in a machine of this
|
|
27
|
-
* image or a box image (HostedOptions.image): one of another image is never read, so never swept.
|
|
28
|
-
*/
|
|
29
|
-
image?: string;
|
|
30
25
|
}
|
|
31
26
|
/**
|
|
32
27
|
* The sweep over host: every machine listed with agentrun.computer=1 and `labels`, not in `before`, that carries a
|
|
33
28
|
* conformance run's label is deleted and read back gone; one without it is left alone and counted. A listing the
|
|
34
29
|
* vendor refused is the error, with nothing deleted.
|
|
35
30
|
*/
|
|
36
|
-
export declare function sweepMachines(host: MachineHost, { labels, before, waitMs, pollMs, requestMs, listMs, onWords
|
|
31
|
+
export declare function sweepMachines(host: MachineHost, { labels, before, waitMs, pollMs, requestMs, listMs, onWords }?: SweepMachinesOptions): Promise<Result<SweepCounts>>;
|
|
37
32
|
/** A stream as main writes to it: done is called once the text is handed on. */
|
|
38
33
|
export interface Writer {
|
|
39
34
|
write(text: string, done?: (error?: Error | null) => void): unknown;
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
// labelled machines with no conformance label, which another user of the account made during the run: never touched. A
|
|
13
13
|
// machine in <file> is never touched either: no call names it, and a before file of another provider is refused, as is
|
|
14
14
|
// one listed elsewhere for a provider whose module names where it lists (sweepScope: an app and a server), since
|
|
15
|
-
// every machine there would read as new.
|
|
16
|
-
// of a box image or of --after's --image <image>, the image the run started from.
|
|
15
|
+
// every machine there would read as new.
|
|
17
16
|
// Exit 0 when every swept machine is gone, 1 when one is still there, 2 on a usage error, a before file it cannot read,
|
|
18
17
|
// missing settings, or a listing the vendor refused (nothing is deleted then). It makes nothing, so it needs no live switch.
|
|
19
18
|
//
|
|
@@ -32,8 +31,8 @@ import { RUN_LABEL } from "./runner.js";
|
|
|
32
31
|
* conformance run's label is deleted and read back gone; one without it is left alone and counted. A listing the
|
|
33
32
|
* vendor refused is the error, with nothing deleted.
|
|
34
33
|
*/
|
|
35
|
-
export async function sweepMachines(host, { labels = {}, before = new Set(), waitMs = 60_000, pollMs = 2_000, requestMs = 30_000, listMs = 60_000, onWords = () => { }
|
|
36
|
-
const listed = await foundBy(host, "the listing", { ...labels, [COMPUTER_LABEL]: "1" }, { listMs, requestMs
|
|
34
|
+
export async function sweepMachines(host, { labels = {}, before = new Set(), waitMs = 60_000, pollMs = 2_000, requestMs = 30_000, listMs = 60_000, onWords = () => { } } = {}) {
|
|
35
|
+
const listed = await foundBy(host, "the listing", { ...labels, [COMPUTER_LABEL]: "1" }, { listMs, requestMs });
|
|
37
36
|
if (!listed.ok)
|
|
38
37
|
return listed;
|
|
39
38
|
const added = listed.value.filter((machine) => !before.has(machine.id));
|
|
@@ -57,13 +56,11 @@ export async function sweepMachines(host, { labels = {}, before = new Set(), wai
|
|
|
57
56
|
return ok({ swept: fresh.length, gone: fresh.length - stillThere.length, stillThere, leftAlone });
|
|
58
57
|
}
|
|
59
58
|
const USAGE = `usage: node packages/computer/dist/conformance/sweep.js --provider <id> --before <file> | --after <file>
|
|
60
|
-
--provider <id> a provider on the shared machine-host adapter (e2b, agent37, daytona)
|
|
59
|
+
--provider <id> a provider on the shared machine-host adapter (e2b, agent37, morph, daytona, boxd)
|
|
61
60
|
--before <file> record the id of every machine the vendor lists with ${COMPUTER_LABEL}=1 into <file>
|
|
62
61
|
--after <file> delete every machine listed with ${COMPUTER_LABEL}=1 and ${RUN_LABEL} whose id is not in <file>, read
|
|
63
62
|
each back until the vendor no longer has it (up to 60 s each), and print
|
|
64
63
|
{"swept":n,"gone":m,"stillThere":[ids],"leftAlone":k}; a new one with no ${RUN_LABEL} is left alone
|
|
65
|
-
--image <image> with --after, for a host that keeps its labels in the machine: the image the run's computers started
|
|
66
|
-
from, read beside the box images (a machine of any other image is never read, so never swept)
|
|
67
64
|
settings: the provider's conformance module's (COMPUTER_<VENDOR>_*), never the vendor's own names
|
|
68
65
|
exit: 0 every swept machine is gone, 1 one is still there, 2 usage error, unreadable before file, no settings, or a refused listing`;
|
|
69
66
|
class Usage extends Error {
|
|
@@ -71,27 +68,20 @@ class Usage extends Error {
|
|
|
71
68
|
const write = (stream, text) => new Promise((resolve) => void stream.write(text, () => resolve()));
|
|
72
69
|
function parse(argv) {
|
|
73
70
|
let provider;
|
|
74
|
-
let image;
|
|
75
71
|
let found;
|
|
76
72
|
for (let i = 0; i < argv.length; i++) {
|
|
77
73
|
const [flag = "", inline] = (argv[i] ?? "").split(/=(.*)/s, 2);
|
|
78
|
-
if (flag !== "--before" && flag !== "--after" && flag !== "--provider"
|
|
74
|
+
if (flag !== "--before" && flag !== "--after" && flag !== "--provider")
|
|
79
75
|
throw new Usage(`unknown option ${flag}`);
|
|
80
76
|
const value = inline ?? argv[++i];
|
|
81
77
|
if (value === undefined || value === "" || value.startsWith("--"))
|
|
82
|
-
throw new Usage(`${flag} needs a ${flag === "--provider" ? "provider id" :
|
|
78
|
+
throw new Usage(`${flag} needs a ${flag === "--provider" ? "provider id" : "file"}`);
|
|
83
79
|
if (flag === "--provider") {
|
|
84
80
|
if (provider !== undefined)
|
|
85
81
|
throw new Usage("give --provider once");
|
|
86
82
|
provider = value;
|
|
87
83
|
continue;
|
|
88
84
|
}
|
|
89
|
-
if (flag === "--image") {
|
|
90
|
-
if (image !== undefined)
|
|
91
|
-
throw new Usage("give --image once");
|
|
92
|
-
image = value;
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
85
|
if (found !== undefined)
|
|
96
86
|
throw new Usage("give --before <file> or --after <file>, one of them");
|
|
97
87
|
found = { mode: flag === "--before" ? "before" : "after", file: value };
|
|
@@ -100,7 +90,7 @@ function parse(argv) {
|
|
|
100
90
|
throw new Usage("give --provider <id>");
|
|
101
91
|
if (found === undefined)
|
|
102
92
|
throw new Usage("give --before <file> or --after <file>, one of them");
|
|
103
|
-
return { provider, ...found
|
|
93
|
+
return { provider, ...found };
|
|
104
94
|
}
|
|
105
95
|
/** The ids a before file of this provider (and of this scope, when the provider names one) holds, or why it is not one. */
|
|
106
96
|
function beforeIds(file, provider, scope) {
|
|
@@ -182,7 +172,7 @@ export async function main(argv, io = {}) {
|
|
|
182
172
|
return 0;
|
|
183
173
|
}
|
|
184
174
|
const said = [];
|
|
185
|
-
const swept = await sweepMachines(host, { before, waitMs, pollMs,
|
|
175
|
+
const swept = await sweepMachines(host, { before, waitMs, pollMs, onWords: (words) => said.push(words) });
|
|
186
176
|
for (const words of said)
|
|
187
177
|
await write(stderr, `${words}\n`);
|
|
188
178
|
if (!swept.ok) {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** boxd's own Ubuntu 24.04 image: a computer whose spec names it starts from no snapshot. */
|
|
2
|
+
export declare const BOXD_DEFAULT_IMAGE = "default";
|
|
3
|
+
export declare const BOXD: {
|
|
4
|
+
readonly id: "boxd";
|
|
5
|
+
readonly label: "boxd";
|
|
6
|
+
readonly keys: readonly [{
|
|
7
|
+
readonly name: "BOXD_API_KEY";
|
|
8
|
+
readonly option: "apiKey";
|
|
9
|
+
readonly required: true;
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "BOXD_ORG";
|
|
12
|
+
readonly option: "org";
|
|
13
|
+
readonly required: false;
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "BOXD_REGION";
|
|
16
|
+
readonly option: "region";
|
|
17
|
+
readonly required: false;
|
|
18
|
+
}];
|
|
19
|
+
readonly metered: true;
|
|
20
|
+
readonly mounts: readonly [];
|
|
21
|
+
readonly network: readonly ["none"];
|
|
22
|
+
readonly capabilities: readonly [{
|
|
23
|
+
readonly options: {
|
|
24
|
+
readonly kind: "linux";
|
|
25
|
+
};
|
|
26
|
+
readonly kind: import("../protocol.js").ComputerKind;
|
|
27
|
+
readonly groups: import("../protocol.js").Group[];
|
|
28
|
+
readonly gpu?: import("../provider.js").GpuCapability;
|
|
29
|
+
readonly persistence?: {
|
|
30
|
+
keepsState: true;
|
|
31
|
+
resume: boolean;
|
|
32
|
+
};
|
|
33
|
+
readonly image?: string;
|
|
34
|
+
}, {
|
|
35
|
+
readonly options: {
|
|
36
|
+
readonly kind: "desktop";
|
|
37
|
+
};
|
|
38
|
+
readonly kind: import("../protocol.js").ComputerKind;
|
|
39
|
+
readonly groups: import("../protocol.js").Group[];
|
|
40
|
+
readonly gpu?: import("../provider.js").GpuCapability;
|
|
41
|
+
readonly persistence?: {
|
|
42
|
+
keepsState: true;
|
|
43
|
+
resume: boolean;
|
|
44
|
+
};
|
|
45
|
+
readonly image?: string;
|
|
46
|
+
}];
|
|
47
|
+
readonly defaultImage: {
|
|
48
|
+
readonly sandbox: "default";
|
|
49
|
+
};
|
|
50
|
+
readonly prepareImage: true;
|
|
51
|
+
readonly load: () => Promise<typeof import("../boxd.js")>;
|
|
52
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// boxd's descriptor: a boxd machine (a microVM) as a sandbox or a desktop, the desktop restored from a snapshot its
|
|
2
|
+
// prepareImage() builds. No mount yet.
|
|
3
|
+
import { defineProvider } from "../descriptor.js";
|
|
4
|
+
import { LINUX_DESKTOP, SANDBOX } from "./shared.js";
|
|
5
|
+
/** boxd's own Ubuntu 24.04 image: a computer whose spec names it starts from no snapshot. */
|
|
6
|
+
export const BOXD_DEFAULT_IMAGE = "default";
|
|
7
|
+
export const BOXD = defineProvider({
|
|
8
|
+
id: "boxd",
|
|
9
|
+
label: "boxd",
|
|
10
|
+
keys: [
|
|
11
|
+
{ name: "BOXD_API_KEY", option: "apiKey", required: true },
|
|
12
|
+
{ name: "BOXD_ORG", option: "org", required: false },
|
|
13
|
+
{ name: "BOXD_REGION", option: "region", required: false },
|
|
14
|
+
],
|
|
15
|
+
metered: true,
|
|
16
|
+
mounts: [],
|
|
17
|
+
// None: its programs run in a network of their own (isolation.ts OWN_NETWORK_ONLY).
|
|
18
|
+
network: ["none"],
|
|
19
|
+
// Each configuration names the kind its create() options build: the provider's default is linux.
|
|
20
|
+
capabilities: [
|
|
21
|
+
{ ...SANDBOX, options: { kind: "linux" } },
|
|
22
|
+
{ ...LINUX_DESKTOP, options: { kind: "desktop" } },
|
|
23
|
+
],
|
|
24
|
+
// A sandbox starts from boxd's own image. A desktop has no default: it starts from the snapshot its prepareImage()
|
|
25
|
+
// builds once in the key's org (agentrun-desktop-<hash>), boxd's own image with a stock app added.
|
|
26
|
+
defaultImage: { sandbox: BOXD_DEFAULT_IMAGE },
|
|
27
|
+
prepareImage: true,
|
|
28
|
+
load: () => import("../boxd.js"),
|
|
29
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** The relay's routes and rows this package speaks: the relay template's RELAY_VERSION; testConnection refuses another. */
|
|
2
|
+
export declare const CLOUDFLARE_RELAY_VERSION = 1;
|
|
3
|
+
export declare const CLOUDFLARE: {
|
|
4
|
+
readonly id: "cloudflare";
|
|
5
|
+
readonly label: "Cloudflare";
|
|
6
|
+
readonly keys: readonly [{
|
|
7
|
+
readonly name: "CLOUDFLARE_RELAY_URL";
|
|
8
|
+
readonly option: "relayUrl";
|
|
9
|
+
readonly required: true;
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "CLOUDFLARE_RELAY_TOKEN";
|
|
12
|
+
readonly option: "relayToken";
|
|
13
|
+
readonly required: true;
|
|
14
|
+
}];
|
|
15
|
+
readonly metered: true;
|
|
16
|
+
readonly mounts: readonly [];
|
|
17
|
+
readonly network: readonly ["none", "open", "allow"];
|
|
18
|
+
readonly capabilities: readonly [import("../kinds.js").KindCapabilities];
|
|
19
|
+
readonly prepareImage: true;
|
|
20
|
+
readonly load: () => Promise<typeof import("../cloudflare.js")>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Cloudflare's descriptor: a Linux sandbox in a Cloudflare Container (a Firecracker microVM) in the operator's own
|
|
2
|
+
// account, started by the relay Worker the operator deploys from packages/computer/relays/cloudflare, from the box image
|
|
3
|
+
// that relay was built FROM. Its containers dial the server (MachineHost facts.connect "dial"): Cloudflare has no REST
|
|
4
|
+
// call that starts or reaches into a container, so the relay creates, lists and deletes them, and computerd dials the
|
|
5
|
+
// server's attach route.
|
|
6
|
+
import { defineProvider } from "../descriptor.js";
|
|
7
|
+
import { SANDBOX } from "./shared.js";
|
|
8
|
+
/** The relay's routes and rows this package speaks: the relay template's RELAY_VERSION; testConnection refuses another. */
|
|
9
|
+
export const CLOUDFLARE_RELAY_VERSION = 1;
|
|
10
|
+
export const CLOUDFLARE = defineProvider({
|
|
11
|
+
id: "cloudflare",
|
|
12
|
+
label: "Cloudflare",
|
|
13
|
+
keys: [
|
|
14
|
+
{ name: "CLOUDFLARE_RELAY_URL", option: "relayUrl", required: true },
|
|
15
|
+
{ name: "CLOUDFLARE_RELAY_TOKEN", option: "relayToken", required: true },
|
|
16
|
+
],
|
|
17
|
+
metered: true,
|
|
18
|
+
// None: a machine that dials takes no Archil mount yet (its helper's root steps run through exec, which it has none of).
|
|
19
|
+
mounts: [],
|
|
20
|
+
// None: its programs run in init's network of their own, their loopback alone (isolation.ts). Open and a list: their
|
|
21
|
+
// one way out is init's egress proxy (hosted/network.ts). The container itself always reaches out (enableInternet): it
|
|
22
|
+
// fetches its daemon from the server and dials it.
|
|
23
|
+
network: ["none", "open", "allow"],
|
|
24
|
+
// A linux computer alone: agentrun-dial starts init with no display.
|
|
25
|
+
capabilities: [SANDBOX],
|
|
26
|
+
// No default image: every computer starts from the box image the relay was deployed with, which prepareImage() reads.
|
|
27
|
+
prepareImage: true,
|
|
28
|
+
load: () => import("../cloudflare.js"),
|
|
29
|
+
});
|
|
@@ -6,6 +6,10 @@ export declare const E2B: {
|
|
|
6
6
|
readonly option: "apiKey";
|
|
7
7
|
readonly required: true;
|
|
8
8
|
}];
|
|
9
|
+
readonly settings: readonly [{
|
|
10
|
+
readonly name: "e2bConnect";
|
|
11
|
+
readonly option: "connect";
|
|
12
|
+
}];
|
|
9
13
|
readonly metered: true;
|
|
10
14
|
readonly mounts: readonly ["archil"];
|
|
11
15
|
readonly network: readonly ["none", "open", "allow"];
|
package/dist/descriptors/e2b.js
CHANGED
|
@@ -6,6 +6,9 @@ export const E2B = defineProvider({
|
|
|
6
6
|
id: "e2b",
|
|
7
7
|
label: "E2B",
|
|
8
8
|
keys: [{ name: "E2B_API_KEY", option: "apiKey", required: true }],
|
|
9
|
+
// How the server reaches its machines: exec (the provider's default, when the server's settings name none), a bridge
|
|
10
|
+
// through envd per connection, or dial, the machine dials the server (a sandbox only).
|
|
11
|
+
settings: [{ name: "e2bConnect", option: "connect" }],
|
|
9
12
|
metered: true,
|
|
10
13
|
mounts: ["archil"],
|
|
11
14
|
// None: its programs run in a network of their own, their loopback alone (isolation.ts), and the sandbox is made with
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const FLY: {
|
|
2
|
+
readonly id: "fly";
|
|
3
|
+
readonly label: "Fly Machines";
|
|
4
|
+
readonly keys: readonly [{
|
|
5
|
+
readonly name: "FLY_API_TOKEN";
|
|
6
|
+
readonly option: "apiToken";
|
|
7
|
+
readonly required: true;
|
|
8
|
+
}, {
|
|
9
|
+
readonly name: "FLY_APP";
|
|
10
|
+
readonly option: "app";
|
|
11
|
+
readonly required: true;
|
|
12
|
+
}];
|
|
13
|
+
readonly metered: true;
|
|
14
|
+
readonly mounts: readonly [];
|
|
15
|
+
readonly network: readonly ["none", "open", "allow"];
|
|
16
|
+
readonly capabilities: readonly [import("../kinds.js").KindCapabilities];
|
|
17
|
+
readonly prepareImage: true;
|
|
18
|
+
readonly load: () => Promise<typeof import("../fly.js")>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Fly Machines' descriptor: a Linux sandbox on a Fly Machine (a Firecracker microVM) in the operator's Fly app, started
|
|
2
|
+
// from our box image, the public registry tag its prepareImage() answers (box-image.ts), which Fly pulls at each create.
|
|
3
|
+
// Its machines dial the server (MachineHost facts.connect "dial"): Fly's exec answers only once the command ends, so
|
|
4
|
+
// nothing reaches into a machine from outside, and its computerd dials the server's attach route instead.
|
|
5
|
+
import { defineProvider } from "../descriptor.js";
|
|
6
|
+
import { SANDBOX } from "./shared.js";
|
|
7
|
+
export const FLY = defineProvider({
|
|
8
|
+
id: "fly",
|
|
9
|
+
label: "Fly Machines",
|
|
10
|
+
keys: [
|
|
11
|
+
{ name: "FLY_API_TOKEN", option: "apiToken", required: true },
|
|
12
|
+
// The Fly app its machines live in: one the operator made (fly apps create), as Fly's app names are global, so there
|
|
13
|
+
// is no default. Saved beside the token in Settings → Computers, as Orgo's workspace and Daytona's URL are.
|
|
14
|
+
{ name: "FLY_APP", option: "app", required: true },
|
|
15
|
+
],
|
|
16
|
+
metered: true,
|
|
17
|
+
// None: a machine that dials takes no Archil mount yet (its helper's root steps run through exec, which it has none of).
|
|
18
|
+
mounts: [],
|
|
19
|
+
// None: its programs run in init's network of their own, their loopback alone (isolation.ts). Open and a list: their
|
|
20
|
+
// one way out is init's egress proxy, which reaches the public internet alone, and with a list its hosts alone
|
|
21
|
+
// (hosted/network.ts). The machine itself always reaches out: it fetches its daemon from the server and dials it.
|
|
22
|
+
network: ["none", "open", "allow"],
|
|
23
|
+
// A linux computer alone: agentrun-dial starts init with no display.
|
|
24
|
+
capabilities: [SANDBOX],
|
|
25
|
+
// No default image: every computer starts from the box image its prepareImage() answers.
|
|
26
|
+
prepareImage: true,
|
|
27
|
+
load: () => import("../fly.js"),
|
|
28
|
+
});
|