@parcha/agentrun-computer 0.1.0-beta.35 → 0.1.0-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/NOTICE +2 -0
  2. package/README.md +423 -323
  3. package/box/Dockerfile +3 -1
  4. package/box/agentrun-archil +59 -7
  5. package/box/build-agent37.mjs +177 -0
  6. package/box/build-daytona.py +20 -4
  7. package/dist/agent37.d.ts +165 -0
  8. package/dist/agent37.js +759 -0
  9. package/dist/attach.d.ts +146 -0
  10. package/dist/attach.js +469 -0
  11. package/dist/browser.d.ts +61 -10
  12. package/dist/browser.js +125 -3
  13. package/dist/browserbase.d.ts +46 -23
  14. package/dist/browserbase.js +162 -17
  15. package/dist/chrome.d.ts +3 -4
  16. package/dist/chrome.js +6 -11
  17. package/dist/client.d.ts +33 -1
  18. package/dist/client.js +53 -0
  19. package/dist/computerd-linux-amd64 +0 -0
  20. package/dist/computerd-linux-arm64 +0 -0
  21. package/dist/conformance/agent37.d.ts +96 -0
  22. package/dist/conformance/agent37.js +154 -0
  23. package/dist/conformance/cases/apps.d.ts +5 -0
  24. package/dist/conformance/cases/apps.js +160 -73
  25. package/dist/conformance/cases/health.js +14 -0
  26. package/dist/conformance/cases/index.js +2 -0
  27. package/dist/conformance/cases/provider.js +27 -1
  28. package/dist/conformance/cases/screen.d.ts +3 -0
  29. package/dist/conformance/cases/screen.js +18 -0
  30. package/dist/conformance/cases/settings.d.ts +29 -23
  31. package/dist/conformance/cases/settings.js +76 -58
  32. package/dist/conformance/cases/touch.js +19 -17
  33. package/dist/conformance/cases/ui.d.ts +2 -0
  34. package/dist/conformance/cases/ui.js +475 -0
  35. package/dist/conformance/cli.d.ts +9 -0
  36. package/dist/conformance/cli.js +28 -3
  37. package/dist/conformance/daytona.d.ts +4 -0
  38. package/dist/conformance/daytona.js +5 -0
  39. package/dist/conformance/e2b.d.ts +6 -0
  40. package/dist/conformance/e2b.js +9 -2
  41. package/dist/conformance/fixture.d.ts +1 -1
  42. package/dist/conformance/fixture.js +25 -1
  43. package/dist/conformance/modal.d.ts +17 -13
  44. package/dist/conformance/modal.js +18 -9
  45. package/dist/conformance/orgo.d.ts +3 -3
  46. package/dist/conformance/orgo.js +6 -8
  47. package/dist/conformance/phone-harness.d.ts +6 -2
  48. package/dist/conformance/phone-harness.js +21 -4
  49. package/dist/conformance/report.js +1 -1
  50. package/dist/conformance/runner.js +23 -4
  51. package/dist/conformance/sweep.d.ts +50 -0
  52. package/dist/conformance/sweep.js +187 -0
  53. package/dist/conformance/types.d.ts +11 -3
  54. package/dist/conformance/ui-fixture.d.ts +56 -0
  55. package/dist/conformance/ui-fixture.js +43 -0
  56. package/dist/create-requests.d.ts +51 -0
  57. package/dist/create-requests.js +121 -0
  58. package/dist/daytona.d.ts +15 -5
  59. package/dist/daytona.js +58 -38
  60. package/dist/descriptor.d.ts +29 -2
  61. package/dist/descriptor.js +13 -0
  62. package/dist/descriptors/agent37.d.ts +41 -0
  63. package/dist/descriptors/agent37.js +28 -0
  64. package/dist/descriptors/browserbase.d.ts +1 -0
  65. package/dist/descriptors/browserbase.js +2 -0
  66. package/dist/descriptors/daytona.d.ts +23 -2
  67. package/dist/descriptors/daytona.js +34 -2
  68. package/dist/descriptors/index.d.ts +66 -3
  69. package/dist/descriptors/index.js +5 -3
  70. package/dist/descriptors/kernel.d.ts +1 -0
  71. package/dist/descriptors/kernel.js +2 -0
  72. package/dist/descriptors/modal.d.ts +4 -0
  73. package/dist/descriptors/modal.js +11 -1
  74. package/dist/descriptors/orgo.d.ts +13 -1
  75. package/dist/descriptors/orgo.js +9 -3
  76. package/dist/descriptors/phone-harness.d.ts +6 -1
  77. package/dist/descriptors/phone-harness.js +5 -2
  78. package/dist/docker/egress.d.ts +4 -3
  79. package/dist/docker/egress.js +7 -6
  80. package/dist/docker.d.ts +7 -4
  81. package/dist/docker.js +278 -34
  82. package/dist/e2b.d.ts +9 -165
  83. package/dist/e2b.js +282 -1342
  84. package/dist/fake-ui-driver.d.ts +97 -0
  85. package/dist/fake-ui-driver.js +717 -0
  86. package/dist/host.d.ts +182 -0
  87. package/dist/host.js +1 -0
  88. package/dist/hosted/process.d.ts +67 -0
  89. package/dist/hosted/process.js +228 -0
  90. package/dist/hosted/provider.d.ts +146 -0
  91. package/dist/hosted/provider.js +1364 -0
  92. package/dist/hosted/scripts.d.ts +76 -0
  93. package/dist/{child.js → hosted/scripts.js} +93 -12
  94. package/dist/index.d.ts +11 -7
  95. package/dist/index.js +10 -7
  96. package/dist/janitor.d.ts +5 -4
  97. package/dist/janitor.js +1 -1
  98. package/dist/kernel.d.ts +17 -27
  99. package/dist/kernel.js +94 -18
  100. package/dist/kinds.d.ts +17 -5
  101. package/dist/kinds.js +20 -4
  102. package/dist/labels.d.ts +10 -2
  103. package/dist/labels.js +30 -7
  104. package/dist/local-chrome.d.ts +5 -5
  105. package/dist/local-chrome.js +10 -5
  106. package/dist/modal.d.ts +23 -181
  107. package/dist/modal.js +273 -1232
  108. package/dist/mount-archil.d.ts +25 -3
  109. package/dist/mount-archil.js +39 -8
  110. package/dist/orgo-channel.d.ts +3 -2
  111. package/dist/orgo-channel.js +5 -2
  112. package/dist/orgo-desktop.d.ts +23 -9
  113. package/dist/orgo-desktop.js +328 -66
  114. package/dist/orgo-names.d.ts +129 -3
  115. package/dist/orgo-names.js +211 -8
  116. package/dist/orgo-workspaces.d.ts +47 -0
  117. package/dist/orgo-workspaces.js +94 -0
  118. package/dist/orgo.d.ts +27 -10
  119. package/dist/orgo.js +411 -81
  120. package/dist/phone-harness.d.ts +31 -21
  121. package/dist/phone-harness.js +510 -681
  122. package/dist/png.d.ts +4 -0
  123. package/dist/png.js +27 -0
  124. package/dist/protocol.d.ts +338 -30
  125. package/dist/protocol.js +96 -3
  126. package/dist/provider.d.ts +97 -7
  127. package/dist/provider.js +24 -3
  128. package/dist/result.d.ts +1 -1
  129. package/dist/surface/api.d.ts +248 -0
  130. package/dist/surface/api.js +1 -0
  131. package/dist/surface/core.d.ts +42 -0
  132. package/dist/surface/core.js +393 -0
  133. package/dist/surface/index.d.ts +5 -0
  134. package/dist/surface/index.js +3 -0
  135. package/dist/surface/outline.d.ts +8 -0
  136. package/dist/surface/outline.js +50 -0
  137. package/dist/surface/script.d.ts +10 -0
  138. package/dist/surface/script.js +92 -0
  139. package/dist/ui-engine.d.ts +114 -0
  140. package/dist/ui-engine.js +798 -0
  141. package/package.json +17 -1
  142. package/dist/child.d.ts +0 -42
  143. package/dist/conformance/e2b-diagnose.d.ts +0 -16
  144. package/dist/conformance/e2b-diagnose.js +0 -61
  145. package/dist/conformance/e2b-sweep.d.ts +0 -18
  146. package/dist/conformance/e2b-sweep.js +0 -132
  147. package/dist/conformance/modal-sweep.d.ts +0 -22
  148. package/dist/conformance/modal-sweep.js +0 -213
@@ -9,6 +9,11 @@ export interface DescriptorKey {
9
9
  /** The create() option it fills (apiKey). */
10
10
  readonly option: string;
11
11
  readonly required: boolean;
12
+ /**
13
+ * A person picks its value from the vendor's own list rather than typing it (Orgo's workspace, by name): Settings
14
+ * offers what the built provider's keyChoices(option) reads with the other keys. Absent: typed.
15
+ */
16
+ readonly picked?: boolean;
12
17
  }
13
18
  /** A setting that is no key but fills a create() option, with the value used when the server names none. */
14
19
  export interface DescriptorSetting {
@@ -27,6 +32,17 @@ export type ParkedConfiguration = KindCapabilities & {
27
32
  readonly image: string;
28
33
  readonly why: string;
29
34
  };
35
+ /** A program a provider runs on the server's own machine: the command it looks for on PATH, and what installs it. */
36
+ export interface HostCommand {
37
+ readonly command: string;
38
+ /** What gives the command, in words a person installs it by: "Android platform-tools". */
39
+ readonly from: string;
40
+ /**
41
+ * The machines it is built for, as Node names them (`${process.platform}-${process.arch}`: "linux-x64"). A server on
42
+ * any other cannot install it, and says so. Absent: every machine.
43
+ */
44
+ readonly builds?: readonly string[];
45
+ }
30
46
  /**
31
47
  * A provider, declared once. Every field is data but load(), which imports the provider module only when called:
32
48
  * reading a descriptor loads no provider and no vendor SDK.
@@ -63,6 +79,12 @@ export interface ProviderDescriptor<Module extends ProviderModule = ProviderModu
63
79
  readonly defaultImage?: Partial<Record<ComputerSettingKind, string>>;
64
80
  /** Its built providers have prepareImage(): the image a computer starts from is made or pulled before the first create. */
65
81
  readonly prepareImage?: boolean;
82
+ /**
83
+ * The server's environment variable that, when its operator sets it, names the image every computer of this provider
84
+ * starts from in place of defaultImage (Daytona's snapshot of box/Dockerfile, which an Archil mount needs). The
85
+ * provider's own check() still judges the image. Absent: its images are its defaultImage alone.
86
+ */
87
+ readonly imageEnv?: string;
66
88
  /** Its computers run on this machine's container engine: a server passes it its local host options (volume, host addresses). */
67
89
  readonly local?: boolean;
68
90
  /** create() takes a ledger the server keeps for it, as `options[ledger.option]` (the phone harness's sessions). */
@@ -71,10 +93,15 @@ export interface ProviderDescriptor<Module extends ProviderModule = ProviderModu
71
93
  };
72
94
  /**
73
95
  * The server's own environment variables its provider reads on this machine, by name (Local Chrome's, where it finds
74
- * Chrome): a server passes their values, and no other variable of its own, as `options.env`. The provider itself reads
75
- * no environment.
96
+ * Chrome; a cloud browser's, the gateway a server reaches its API through): a server passes their values, and no other
97
+ * variable of its own, as `options.env`. The provider itself reads no environment.
76
98
  */
77
99
  readonly hostEnv?: readonly string[];
100
+ /**
101
+ * A program its computers need on the server's own machine, found on PATH (the phone's adb): a server looks for it at
102
+ * its start and, when it is missing, says from this alone that the provider can't run there and why.
103
+ */
104
+ readonly hostCommand?: HostCommand;
78
105
  /**
79
106
  * Configurations its module builds but does not offer yet (Orgo's Windows and macOS desktops), each by the image a
80
107
  * setting would name and why: a setting naming one is refused in its words, saying it is parked, never as an unknown
@@ -67,10 +67,23 @@ export function descriptorProblems(value) {
67
67
  named(d.settings, "settings");
68
68
  if (Array.isArray(d.keys) && d.keys.some((key) => typeof key?.required !== "boolean"))
69
69
  problems.push("each key says whether it is required");
70
+ if (Array.isArray(d.keys) && d.keys.some((key) => key?.picked !== undefined && typeof key.picked !== "boolean"))
71
+ problems.push("a key's picked is true or false");
70
72
  if (d.ledger !== undefined && (typeof d.ledger?.option !== "string" || d.ledger.option === ""))
71
73
  problems.push("ledger names the option it fills");
74
+ if (d.imageEnv !== undefined && (typeof d.imageEnv !== "string" || !/^[A-Z][A-Z0-9_]*$/.test(d.imageEnv)))
75
+ problems.push("imageEnv is an environment variable name (capital letters, digits and underscores)");
72
76
  if (d.hostEnv !== undefined && (!Array.isArray(d.hostEnv) || d.hostEnv.some((name) => typeof name !== "string" || name === "")))
73
77
  problems.push("hostEnv is a list of environment variable names");
78
+ if (d.hostCommand !== undefined) {
79
+ const { command, from, builds } = (d.hostCommand ?? {});
80
+ if (typeof command !== "string" || !/^[A-Za-z0-9._-]+$/.test(command))
81
+ problems.push("hostCommand's command is a program's name, with no path");
82
+ if (typeof from !== "string" || from.trim() === "")
83
+ problems.push("hostCommand says in words what installs it (from)");
84
+ if (builds !== undefined && (!Array.isArray(builds) || builds.length === 0 || builds.some((one) => typeof one !== "string" || !/^[a-z0-9]+-[a-z0-9]+$/.test(one))))
85
+ problems.push("hostCommand's builds are machines as Node names them (linux-x64)");
86
+ }
74
87
  if (d.parked !== undefined) {
75
88
  if (!Array.isArray(d.parked) || d.parked.some((one) => typeof one?.image !== "string" || one.image === "" || typeof one.why !== "string" || one.why === "" || typeof one.kind !== "string" || !Array.isArray(one.groups)))
76
89
  problems.push("parked is a list of configurations, each with its image and why it is parked");
@@ -0,0 +1,41 @@
1
+ /** Agent37's plain Linux template: a sandbox when its setting names no image. */
2
+ export declare const AGENT37_BASE_TEMPLATE = "agent37-base";
3
+ /**
4
+ * Our box image (box/Dockerfile and Xvfb) as a template of the key's own workspace, which box/build-agent37.mjs builds
5
+ * and publishes under this one name: a desktop when its setting names no image.
6
+ */
7
+ export declare const AGENT37_BOX_TEMPLATE = "agentrun-box";
8
+ export declare const AGENT37: {
9
+ readonly id: "agent37";
10
+ readonly label: "Agent37";
11
+ readonly keys: readonly [{
12
+ readonly name: "AGENT37_API_KEY";
13
+ readonly option: "apiKey";
14
+ readonly required: true;
15
+ }, {
16
+ readonly name: "AGENT37_SSH_KEY";
17
+ readonly option: "sshKey";
18
+ readonly required: true;
19
+ }];
20
+ readonly metered: true;
21
+ readonly mounts: readonly ["archil"];
22
+ readonly network: readonly ["none"];
23
+ readonly capabilities: readonly [import("../kinds.js").KindCapabilities, {
24
+ readonly options: {
25
+ readonly kind: "desktop";
26
+ };
27
+ readonly kind: import("../protocol.js").ComputerKind;
28
+ readonly groups: import("../protocol.js").Group[];
29
+ readonly gpu?: import("../provider.js").GpuCapability;
30
+ readonly persistence?: {
31
+ keepsState: true;
32
+ resume: boolean;
33
+ };
34
+ readonly image?: string;
35
+ }];
36
+ readonly defaultImage: {
37
+ readonly sandbox: "agent37-base";
38
+ readonly desktop: "agentrun-box";
39
+ };
40
+ readonly load: () => Promise<typeof import("../agent37.js")>;
41
+ };
@@ -0,0 +1,28 @@
1
+ // Agent37's descriptor: a Linux sandbox or a Linux desktop on an Agent37 instance (a VM by default), the run's folder on
2
+ // an Archil disk. The desktop starts from our box image built as a workspace template (box/build-agent37.mjs).
3
+ import { defineProvider } from "../descriptor.js";
4
+ import { LINUX_DESKTOP, SANDBOX } from "./shared.js";
5
+ /** Agent37's plain Linux template: a sandbox when its setting names no image. */
6
+ export const AGENT37_BASE_TEMPLATE = "agent37-base";
7
+ /**
8
+ * Our box image (box/Dockerfile and Xvfb) as a template of the key's own workspace, which box/build-agent37.mjs builds
9
+ * and publishes under this one name: a desktop when its setting names no image.
10
+ */
11
+ export const AGENT37_BOX_TEMPLATE = "agentrun-box";
12
+ export const AGENT37 = defineProvider({
13
+ id: "agent37",
14
+ label: "Agent37",
15
+ keys: [
16
+ { name: "AGENT37_API_KEY", option: "apiKey", required: true },
17
+ // The private half of the SSH key registered on the workspace: every command reaches the machine over SSH.
18
+ { name: "AGENT37_SSH_KEY", option: "sshKey", required: true },
19
+ ],
20
+ metered: true,
21
+ mounts: ["archil"],
22
+ // None: its programs run in a network of their own (isolation.ts OWN_NETWORK_ONLY).
23
+ network: ["none"],
24
+ // Each configuration built by its own create() options: kind linux is the provider's default.
25
+ capabilities: [SANDBOX, { ...LINUX_DESKTOP, options: { kind: "desktop" } }],
26
+ defaultImage: { sandbox: AGENT37_BASE_TEMPLATE, desktop: AGENT37_BOX_TEMPLATE },
27
+ load: () => import("../agent37.js"),
28
+ });
@@ -13,6 +13,7 @@ export declare const BROWSERBASE: {
13
13
  readonly metered: true;
14
14
  readonly mounts: readonly [];
15
15
  readonly network: readonly ["open"];
16
+ readonly hostEnv: readonly ["BROWSERBASE_BASE_URL", "BROWSERBASE_CONNECT_BASE_URL"];
16
17
  readonly capabilities: readonly [{
17
18
  readonly kind: "browser";
18
19
  readonly groups: ["cdp", "stream"];
@@ -12,6 +12,8 @@ export const BROWSERBASE = defineProvider({
12
12
  mounts: [],
13
13
  // Browserbase's own network, open: it cannot be closed or narrowed.
14
14
  network: ["open"],
15
+ // A server behind a gateway that fronts Browserbase's API or its sessions' sockets names it here.
16
+ hostEnv: ["BROWSERBASE_BASE_URL", "BROWSERBASE_CONNECT_BASE_URL"],
15
17
  capabilities: [{ kind: "browser", groups: ["cdp", "stream"] }],
16
18
  defaultImage: { browser: BROWSER_IMAGE },
17
19
  load: () => import("../browserbase.js"),
@@ -25,10 +25,22 @@ export declare const DAYTONA_GPU_SNAPSHOT_GPU: Readonly<DaytonaSnapshotGpu>;
25
25
  * daytona-gpu, alone (another type needs a snapshot of its own), with its limits on a GPU sandbox: its stop deletes it
26
26
  * (no pause, no snapshot: nothing is kept), it runs in region earth, it has the snapshot's 16 vCPUs, 100 GiB of memory
27
27
  * and 400 GiB of disk, it may be preempted (daytona.io/pricing lists its GPUs as "Preemptible GPU prices", 11-10), and
28
- * it takes no mount: daytona-gpu's user is daytona, not root, and it has no Archil client, so an Archil mount is refused
29
- * in words.
28
+ * it takes no mount: Daytona's GPU host gives no /dev/fuse, even to root (live 11-11), and the archil client mounts
29
+ * through FUSE, so an Archil mount is refused in words.
30
30
  */
31
31
  export declare const DAYTONA_GPU: Readonly<GpuCapability>;
32
+ /** The snapshot a provider makes its GPU computers from, and its GPU. */
33
+ export interface DaytonaGpuSnapshot extends DaytonaSnapshotGpu {
34
+ snapshot: string;
35
+ }
36
+ /**
37
+ * The GPU snapshot a provider with the gpuSnapshot option (or none) makes its GPU computers from: daytona-gpu when none
38
+ * is given; else ours, with the GPU its name says. Throws in words for a name that is not one of ours
39
+ * (box/build-daytona.py --gpu prints it).
40
+ */
41
+ export declare function daytonaGpuSnapshot(gpuSnapshot?: string): DaytonaGpuSnapshot;
42
+ /** The GPUs a provider declares for its GPU snapshot (DAYTONA_GPU's limits and no mount, the snapshot's GPU): a copy. */
43
+ export declare function daytonaGpu(gpuSnapshot?: string): GpuCapability;
32
44
  export declare const DAYTONA: {
33
45
  readonly id: "daytona";
34
46
  readonly label: "Daytona";
@@ -44,6 +56,10 @@ export declare const DAYTONA: {
44
56
  readonly name: "DAYTONA_TARGET";
45
57
  readonly option: "target";
46
58
  readonly required: false;
59
+ }, {
60
+ readonly name: "DAYTONA_ARCHIL_EGRESS";
61
+ readonly option: "archilEgress";
62
+ readonly required: false;
47
63
  }];
48
64
  readonly metered: true;
49
65
  readonly mounts: readonly ["archil"];
@@ -52,11 +68,16 @@ export declare const DAYTONA: {
52
68
  readonly gpu: Readonly<GpuCapability>;
53
69
  readonly kind: import("../protocol.js").ComputerKind;
54
70
  readonly groups: import("../protocol.js").Group[];
71
+ readonly persistence?: {
72
+ keepsState: true;
73
+ resume: boolean;
74
+ };
55
75
  readonly image?: string;
56
76
  readonly options?: Readonly<Record<string, unknown>>;
57
77
  }];
58
78
  readonly defaultImage: {
59
79
  readonly sandbox: "default";
60
80
  };
81
+ readonly imageEnv: "AGENTRUN_DAYTONA_SNAPSHOT";
61
82
  readonly load: () => Promise<typeof import("../daytona.js")>;
62
83
  };
@@ -18,8 +18,8 @@ export const DAYTONA_GPU_SNAPSHOT_GPU = Object.freeze({ type: "H100", count: 1 }
18
18
  * daytona-gpu, alone (another type needs a snapshot of its own), with its limits on a GPU sandbox: its stop deletes it
19
19
  * (no pause, no snapshot: nothing is kept), it runs in region earth, it has the snapshot's 16 vCPUs, 100 GiB of memory
20
20
  * and 400 GiB of disk, it may be preempted (daytona.io/pricing lists its GPUs as "Preemptible GPU prices", 11-10), and
21
- * it takes no mount: daytona-gpu's user is daytona, not root, and it has no Archil client, so an Archil mount is refused
22
- * in words.
21
+ * it takes no mount: Daytona's GPU host gives no /dev/fuse, even to root (live 11-11), and the archil client mounts
22
+ * through FUSE, so an Archil mount is refused in words.
23
23
  */
24
24
  export const DAYTONA_GPU = Object.freeze({
25
25
  types: [DAYTONA_GPU_SNAPSHOT_GPU.type],
@@ -29,7 +29,35 @@ export const DAYTONA_GPU = Object.freeze({
29
29
  region: DAYTONA_GPU_REGION,
30
30
  perGpu: { cpus: 16, memoryMb: 100 * 1024, diskMb: 400 * 1024 },
31
31
  mounts: [],
32
+ unmounted: Object.freeze({ why: "Daytona's GPU runtime gives it no /dev/fuse", yet: false }),
32
33
  });
34
+ /**
35
+ * Our GPU snapshots: box/Dockerfile built with a GPU (box/build-daytona.py --gpu <type>), named
36
+ * agentrun-archil-gpu-<type>-<the recipe's hash>. Their user is root and they carry the Archil client and our helper,
37
+ * but their GPU computers take no mount either: Daytona's GPU host gives no /dev/fuse. The name says the GPU: one of
38
+ * the type it names (the build's resources).
39
+ */
40
+ const ARCHIL_GPU_SNAPSHOT = /^agentrun-archil-gpu-(h100)-[0-9a-f]{12}$/;
41
+ const ARCHIL_GPU_TYPES = { h100: "H100" };
42
+ /**
43
+ * The GPU snapshot a provider with the gpuSnapshot option (or none) makes its GPU computers from: daytona-gpu when none
44
+ * is given; else ours, with the GPU its name says. Throws in words for a name that is not one of ours
45
+ * (box/build-daytona.py --gpu prints it).
46
+ */
47
+ export function daytonaGpuSnapshot(gpuSnapshot) {
48
+ if (gpuSnapshot === undefined)
49
+ return { snapshot: DAYTONA_GPU_SNAPSHOT, ...DAYTONA_GPU_SNAPSHOT_GPU };
50
+ const named = ARCHIL_GPU_SNAPSHOT.exec(gpuSnapshot);
51
+ const type = named === null ? undefined : ARCHIL_GPU_TYPES[named[1]];
52
+ if (type === undefined)
53
+ throw new Error(`gpuSnapshot ${JSON.stringify(gpuSnapshot)} is not a GPU snapshot of box/Dockerfile: box/build-daytona.py --gpu H100 prints its name, agentrun-archil-gpu-h100-<12 hex digits>`);
54
+ return { snapshot: gpuSnapshot, type, count: 1 };
55
+ }
56
+ /** The GPUs a provider declares for its GPU snapshot (DAYTONA_GPU's limits and no mount, the snapshot's GPU): a copy. */
57
+ export function daytonaGpu(gpuSnapshot) {
58
+ const { type, count } = daytonaGpuSnapshot(gpuSnapshot);
59
+ return { ...DAYTONA_GPU, types: [type], max: count, perGpu: { ...DAYTONA_GPU.perGpu }, mounts: [] };
60
+ }
33
61
  export const DAYTONA = defineProvider({
34
62
  id: "daytona",
35
63
  label: "Daytona",
@@ -37,6 +65,7 @@ export const DAYTONA = defineProvider({
37
65
  { name: "DAYTONA_API_KEY", option: "apiKey", required: true },
38
66
  { name: "DAYTONA_API_URL", option: "apiUrl", required: false },
39
67
  { name: "DAYTONA_TARGET", option: "target", required: false },
68
+ { name: "DAYTONA_ARCHIL_EGRESS", option: "archilEgress", required: false },
40
69
  ],
41
70
  metered: true,
42
71
  mounts: ["archil"],
@@ -45,5 +74,8 @@ export const DAYTONA = defineProvider({
45
74
  // A linux computer, with GPUs when asked.
46
75
  capabilities: [{ ...SANDBOX, gpu: DAYTONA_GPU }],
47
76
  defaultImage: { sandbox: DAYTONA_DEFAULT_SNAPSHOT },
77
+ // A Daytona computer that mounts the run's folder from Archil needs a snapshot of box/Dockerfile (build-daytona.py
78
+ // builds one and prints its name): the operator names it here, and the default snapshot stands while unset.
79
+ imageEnv: "AGENTRUN_DAYTONA_SNAPSHOT",
48
80
  load: () => import("../daytona.js"),
49
81
  });
@@ -1,3 +1,4 @@
1
+ import { AGENT37 } from "./agent37.js";
1
2
  import { BROWSERBASE } from "./browserbase.js";
2
3
  import { DAYTONA } from "./daytona.js";
3
4
  import { DOCKER } from "./docker.js";
@@ -33,6 +34,10 @@ export declare const DESCRIPTORS: readonly [{
33
34
  readonly name: "DAYTONA_TARGET";
34
35
  readonly option: "target";
35
36
  readonly required: false;
37
+ }, {
38
+ readonly name: "DAYTONA_ARCHIL_EGRESS";
39
+ readonly option: "archilEgress";
40
+ readonly required: false;
36
41
  }];
37
42
  readonly metered: true;
38
43
  readonly mounts: readonly ["archil"];
@@ -41,12 +46,17 @@ export declare const DESCRIPTORS: readonly [{
41
46
  readonly gpu: Readonly<import("../provider.js").GpuCapability>;
42
47
  readonly kind: import("../protocol.js").ComputerKind;
43
48
  readonly groups: import("../protocol.js").Group[];
49
+ readonly persistence?: {
50
+ keepsState: true;
51
+ resume: boolean;
52
+ };
44
53
  readonly image?: string;
45
54
  readonly options?: Readonly<Record<string, unknown>>;
46
55
  }];
47
56
  readonly defaultImage: {
48
57
  readonly sandbox: "default";
49
58
  };
59
+ readonly imageEnv: "AGENTRUN_DAYTONA_SNAPSHOT";
50
60
  readonly load: () => Promise<typeof import("../daytona.js")>;
51
61
  }, {
52
62
  readonly id: "modal";
@@ -72,6 +82,10 @@ export declare const DESCRIPTORS: readonly [{
72
82
  readonly gpu: Readonly<import("../provider.js").GpuCapability>;
73
83
  readonly kind: import("../protocol.js").ComputerKind;
74
84
  readonly groups: import("../protocol.js").Group[];
85
+ readonly persistence?: {
86
+ keepsState: true;
87
+ resume: boolean;
88
+ };
75
89
  readonly image?: string;
76
90
  readonly options?: Readonly<Record<string, unknown>>;
77
91
  }];
@@ -96,6 +110,39 @@ export declare const DESCRIPTORS: readonly [{
96
110
  readonly desktop: "desktop";
97
111
  };
98
112
  readonly load: () => Promise<typeof import("../e2b.js")>;
113
+ }, {
114
+ readonly id: "agent37";
115
+ readonly label: "Agent37";
116
+ readonly keys: readonly [{
117
+ readonly name: "AGENT37_API_KEY";
118
+ readonly option: "apiKey";
119
+ readonly required: true;
120
+ }, {
121
+ readonly name: "AGENT37_SSH_KEY";
122
+ readonly option: "sshKey";
123
+ readonly required: true;
124
+ }];
125
+ readonly metered: true;
126
+ readonly mounts: readonly ["archil"];
127
+ readonly network: readonly ["none"];
128
+ readonly capabilities: readonly [import("../kinds.js").KindCapabilities, {
129
+ readonly options: {
130
+ readonly kind: "desktop";
131
+ };
132
+ readonly kind: import("../protocol.js").ComputerKind;
133
+ readonly groups: import("../protocol.js").Group[];
134
+ readonly gpu?: import("../provider.js").GpuCapability;
135
+ readonly persistence?: {
136
+ keepsState: true;
137
+ resume: boolean;
138
+ };
139
+ readonly image?: string;
140
+ }];
141
+ readonly defaultImage: {
142
+ readonly sandbox: "agent37-base";
143
+ readonly desktop: "agentrun-box";
144
+ };
145
+ readonly load: () => Promise<typeof import("../agent37.js")>;
99
146
  }, {
100
147
  readonly id: "orgo";
101
148
  readonly label: "Orgo";
@@ -106,7 +153,8 @@ export declare const DESCRIPTORS: readonly [{
106
153
  }, {
107
154
  readonly name: "ORGO_WORKSPACE_ID";
108
155
  readonly option: "workspaceId";
109
- readonly required: true;
156
+ readonly required: false;
157
+ readonly picked: true;
110
158
  }];
111
159
  readonly metered: true;
112
160
  readonly mounts: readonly [];
@@ -114,6 +162,10 @@ export declare const DESCRIPTORS: readonly [{
114
162
  readonly capabilities: readonly [{
115
163
  readonly image: "linux";
116
164
  readonly options: {};
165
+ readonly persistence: {
166
+ readonly keepsState: true;
167
+ readonly resume: true;
168
+ };
117
169
  readonly kind: import("../protocol.js").ComputerKind;
118
170
  readonly groups: import("../protocol.js").Group[];
119
171
  readonly gpu?: import("../provider.js").GpuCapability;
@@ -135,6 +187,9 @@ export declare const DESCRIPTORS: readonly [{
135
187
  };
136
188
  readonly why: "Orgo's macOS desktops are parked for now: Orgo offers Linux desktops";
137
189
  }];
190
+ readonly ledger: {
191
+ readonly option: "ledger";
192
+ };
138
193
  readonly defaultImage: {
139
194
  readonly desktop: "linux";
140
195
  };
@@ -160,6 +215,11 @@ export declare const DESCRIPTORS: readonly [{
160
215
  readonly ledger: {
161
216
  readonly option: "ledger";
162
217
  };
218
+ readonly hostCommand: {
219
+ readonly command: "adb";
220
+ readonly from: "Android platform-tools";
221
+ readonly builds: readonly ["linux-x64", "darwin-x64", "darwin-arm64", "win32-x64"];
222
+ };
163
223
  readonly load: () => Promise<typeof import("../phone-harness.js")>;
164
224
  }, {
165
225
  readonly id: "browserbase";
@@ -176,6 +236,7 @@ export declare const DESCRIPTORS: readonly [{
176
236
  readonly metered: true;
177
237
  readonly mounts: readonly [];
178
238
  readonly network: readonly ["open"];
239
+ readonly hostEnv: readonly ["BROWSERBASE_BASE_URL", "BROWSERBASE_CONNECT_BASE_URL"];
179
240
  readonly capabilities: readonly [{
180
241
  readonly kind: "browser";
181
242
  readonly groups: ["cdp", "stream"];
@@ -195,6 +256,7 @@ export declare const DESCRIPTORS: readonly [{
195
256
  readonly metered: true;
196
257
  readonly mounts: readonly [];
197
258
  readonly network: readonly ["open"];
259
+ readonly hostEnv: readonly ["KERNEL_BASE_URL"];
198
260
  readonly capabilities: readonly [{
199
261
  readonly kind: "browser";
200
262
  readonly groups: ["cdp", "stream"];
@@ -220,8 +282,9 @@ export declare const DESCRIPTORS: readonly [{
220
282
  readonly hostEnv: readonly ["PI_BROWSER_CHROME", "CHROME_PATH", "PATH"];
221
283
  readonly load: () => Promise<typeof import("../local-chrome.js")>;
222
284
  }];
223
- export { BROWSERBASE, DAYTONA, DOCKER, E2B, KERNEL, LOCAL, MODAL, ORGO, PHONE_HARNESS };
224
- export { DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT } from "./daytona.js";
285
+ export { AGENT37, BROWSERBASE, DAYTONA, DOCKER, E2B, KERNEL, LOCAL, MODAL, ORGO, PHONE_HARNESS };
286
+ export { AGENT37_BASE_TEMPLATE, AGENT37_BOX_TEMPLATE } from "./agent37.js";
287
+ export { DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT, type DaytonaGpuSnapshot, daytonaGpu, daytonaGpuSnapshot } from "./daytona.js";
225
288
  export { E2B_BASE_TEMPLATE, E2B_DESKTOP_TEMPLATE } from "./e2b.js";
226
289
  export { MODAL_DEFAULT_IMAGE } from "./modal.js";
227
290
  export { ORGO_BASE_IMAGE } from "./orgo.js";
@@ -1,5 +1,6 @@
1
1
  // Every built-in provider's descriptor, in the order Settings shows them. Importing this loads descriptors (data) alone:
2
2
  // each provider module loads only when its descriptor's load() is called.
3
+ import { AGENT37 } from "./agent37.js";
3
4
  import { BROWSERBASE } from "./browserbase.js";
4
5
  import { DAYTONA } from "./daytona.js";
5
6
  import { DOCKER } from "./docker.js";
@@ -9,9 +10,10 @@ import { LOCAL } from "./local-chrome.js";
9
10
  import { MODAL } from "./modal.js";
10
11
  import { ORGO } from "./orgo.js";
11
12
  import { PHONE_HARNESS } from "./phone-harness.js";
12
- export const DESCRIPTORS = [DOCKER, DAYTONA, MODAL, E2B, ORGO, PHONE_HARNESS, BROWSERBASE, KERNEL, LOCAL];
13
- export { BROWSERBASE, DAYTONA, DOCKER, E2B, KERNEL, LOCAL, MODAL, ORGO, PHONE_HARNESS };
14
- export { DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT } from "./daytona.js";
13
+ export const DESCRIPTORS = [DOCKER, DAYTONA, MODAL, E2B, AGENT37, ORGO, PHONE_HARNESS, BROWSERBASE, KERNEL, LOCAL];
14
+ export { AGENT37, BROWSERBASE, DAYTONA, DOCKER, E2B, KERNEL, LOCAL, MODAL, ORGO, PHONE_HARNESS };
15
+ export { AGENT37_BASE_TEMPLATE, AGENT37_BOX_TEMPLATE } from "./agent37.js";
16
+ export { DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT, daytonaGpu, daytonaGpuSnapshot } from "./daytona.js";
15
17
  export { E2B_BASE_TEMPLATE, E2B_DESKTOP_TEMPLATE } from "./e2b.js";
16
18
  export { MODAL_DEFAULT_IMAGE } from "./modal.js";
17
19
  export { ORGO_BASE_IMAGE } from "./orgo.js";
@@ -9,6 +9,7 @@ export declare const KERNEL: {
9
9
  readonly metered: true;
10
10
  readonly mounts: readonly [];
11
11
  readonly network: readonly ["open"];
12
+ readonly hostEnv: readonly ["KERNEL_BASE_URL"];
12
13
  readonly capabilities: readonly [{
13
14
  readonly kind: "browser";
14
15
  readonly groups: ["cdp", "stream"];
@@ -9,6 +9,8 @@ export const KERNEL = defineProvider({
9
9
  mounts: [],
10
10
  // Kernel's own network, open: it cannot be closed or narrowed.
11
11
  network: ["open"],
12
+ // A server behind a gateway that fronts Kernel's API names it here.
13
+ hostEnv: ["KERNEL_BASE_URL"],
12
14
  capabilities: [{ kind: "browser", groups: ["cdp", "stream"] }],
13
15
  defaultImage: { browser: BROWSER_IMAGE },
14
16
  load: () => import("../kernel.js"),
@@ -40,6 +40,10 @@ export declare const MODAL: {
40
40
  readonly gpu: Readonly<GpuCapability>;
41
41
  readonly kind: import("../protocol.js").ComputerKind;
42
42
  readonly groups: import("../protocol.js").Group[];
43
+ readonly persistence?: {
44
+ keepsState: true;
45
+ resume: boolean;
46
+ };
43
47
  readonly image?: string;
44
48
  readonly options?: Readonly<Record<string, unknown>>;
45
49
  }];
@@ -17,7 +17,17 @@ export const MODAL_GPU_MAX = 8;
17
17
  * being proven on gVisor; and the loopback fence made inside a user namespace, as gVisor's root may not make a network
18
18
  * namespace itself (a live probe, 11-11: unshare -n refused, unshare -Urn allowed).
19
19
  */
20
- export const MODAL_GPU = Object.freeze({ types: [...MODAL_GPU_TYPES], max: MODAL_GPU_MAX, isolation: "gvisor", preemptible: true, mounts: [], fence: "userns-netns" });
20
+ export const MODAL_GPU = Object.freeze({
21
+ types: [...MODAL_GPU_TYPES],
22
+ max: MODAL_GPU_MAX,
23
+ isolation: "gvisor",
24
+ preemptible: true,
25
+ mounts: [],
26
+ // Its gVisor runtime gives /dev/fuse (modal-6, 11-11: a character device 10:229 that opens), but Archil's FUSE mount
27
+ // under gVisor is not proven safe for the Archil client.
28
+ unmounted: Object.freeze({ why: "Archil's FUSE mount isn't proven on Modal's gVisor runtime (#2279)", yet: true }),
29
+ fence: "userns-netns",
30
+ });
21
31
  export const MODAL = defineProvider({
22
32
  id: "modal",
23
33
  label: "Modal",
@@ -19,6 +19,10 @@ export declare const MACOS_GROUPS: readonly Group[];
19
19
  export declare const ORGO_CONFIGURATIONS: readonly [{
20
20
  readonly image: "linux";
21
21
  readonly options: {};
22
+ readonly persistence: {
23
+ readonly keepsState: true;
24
+ readonly resume: true;
25
+ };
22
26
  readonly kind: import("../protocol.js").ComputerKind;
23
27
  readonly groups: Group[];
24
28
  readonly gpu?: import("../provider.js").GpuCapability;
@@ -52,7 +56,8 @@ export declare const ORGO: {
52
56
  }, {
53
57
  readonly name: "ORGO_WORKSPACE_ID";
54
58
  readonly option: "workspaceId";
55
- readonly required: true;
59
+ readonly required: false;
60
+ readonly picked: true;
56
61
  }];
57
62
  readonly metered: true;
58
63
  readonly mounts: readonly [];
@@ -60,6 +65,10 @@ export declare const ORGO: {
60
65
  readonly capabilities: readonly [{
61
66
  readonly image: "linux";
62
67
  readonly options: {};
68
+ readonly persistence: {
69
+ readonly keepsState: true;
70
+ readonly resume: true;
71
+ };
63
72
  readonly kind: import("../protocol.js").ComputerKind;
64
73
  readonly groups: Group[];
65
74
  readonly gpu?: import("../provider.js").GpuCapability;
@@ -81,6 +90,9 @@ export declare const ORGO: {
81
90
  };
82
91
  readonly why: "Orgo's macOS desktops are parked for now: Orgo offers Linux desktops";
83
92
  }];
93
+ readonly ledger: {
94
+ readonly option: "ledger";
95
+ };
84
96
  readonly defaultImage: {
85
97
  readonly desktop: "linux";
86
98
  };
@@ -17,7 +17,10 @@ export const MACOS_GROUPS = ["exec", "screen", "input.pointer", "input.keys"];
17
17
  * Windows and macOS are parked (ORGO_PARKED): create({ os }) still builds them, for the conformance suite and their
18
18
  * tests, but no agent's setting selects one, and a setting that names one is refused in words saying so.
19
19
  */
20
- export const ORGO_CONFIGURATIONS = [{ ...LINUX_DESKTOP, image: ORGO_BASE_IMAGE, options: {} }];
20
+ export const ORGO_CONFIGURATIONS = [
21
+ // Orgo's suspend keeps a Linux desktop's memory and disk: an agent's own computer resumes where it was.
22
+ { ...LINUX_DESKTOP, image: ORGO_BASE_IMAGE, options: {}, persistence: { keepsState: true, resume: true } },
23
+ ];
21
24
  /** Orgo's desktops not offered yet, each as its module builds it (create()'s os), and why, in the words a setting naming
22
25
  * one is refused in. */
23
26
  export const ORGO_PARKED = [
@@ -27,10 +30,11 @@ export const ORGO_PARKED = [
27
30
  export const ORGO = defineProvider({
28
31
  id: "orgo",
29
32
  label: "Orgo",
30
- // The workspace this server's computers live in: every Orgo provider is built in one, and lists only it.
33
+ // The workspace this server's computers live in: every Orgo provider lists only it. Unsaved, it is the key's account's
34
+ // one workspace; with several, a person picks one by name in Settings (orgo-workspaces.ts).
31
35
  keys: [
32
36
  { name: "ORGO_API_KEY", option: "apiKey", required: true },
33
- { name: "ORGO_WORKSPACE_ID", option: "workspaceId", required: true },
37
+ { name: "ORGO_WORKSPACE_ID", option: "workspaceId", required: false, picked: true },
34
38
  ],
35
39
  metered: true,
36
40
  // None yet: an Archil mount needs an Orgo template that bakes the helper.
@@ -39,6 +43,8 @@ export const ORGO = defineProvider({
39
43
  network: ["none"],
40
44
  capabilities: ORGO_CONFIGURATIONS,
41
45
  parked: ORGO_PARKED,
46
+ // An agent's own computers' labels: Orgo holds none, and a detached computer is never woken to read its labels file.
47
+ ledger: { option: "ledger" },
42
48
  defaultImage: { desktop: ORGO_BASE_IMAGE },
43
49
  load: () => import("../orgo.js"),
44
50
  });
@@ -1,5 +1,5 @@
1
1
  import type { Group } from "../protocol.js";
2
- /** The groups a phone harness phone offers. */
2
+ /** The groups a phone harness phone offers: phoned's, the driver it runs (daemon-android/), in its hello's order. */
3
3
  export declare const PHONE_GROUPS: readonly Group[];
4
4
  /** The phone harness's Android: a phone computer when its setting names no image. */
5
5
  export declare const PHONE_IMAGE = "android";
@@ -24,5 +24,10 @@ export declare const PHONE_HARNESS: {
24
24
  readonly ledger: {
25
25
  readonly option: "ledger";
26
26
  };
27
+ readonly hostCommand: {
28
+ readonly command: "adb";
29
+ readonly from: "Android platform-tools";
30
+ readonly builds: readonly ["linux-x64", "darwin-x64", "darwin-arm64", "win32-x64"];
31
+ };
27
32
  readonly load: () => Promise<typeof import("../phone-harness.js")>;
28
33
  };
@@ -1,7 +1,7 @@
1
1
  // The phone harness's descriptor: a cloud Android over adb, its sessions in a ledger the server keeps.
2
2
  import { defineProvider } from "../descriptor.js";
3
- /** The groups a phone harness phone offers. */
4
- export const PHONE_GROUPS = ["screen", "input.touch", "input.keys", "apps", "apps.ui_tree"];
3
+ /** The groups a phone harness phone offers: phoned's, the driver it runs (daemon-android/), in its hello's order. */
4
+ export const PHONE_GROUPS = ["exec", "screen", "input.keys", "input.touch", "apps", "ui"];
5
5
  /** The phone harness's Android: a phone computer when its setting names no image. */
6
6
  export const PHONE_IMAGE = "android";
7
7
  export const PHONE_HARNESS = defineProvider({
@@ -16,5 +16,8 @@ export const PHONE_HARNESS = defineProvider({
16
16
  defaultImage: { phone: PHONE_IMAGE },
17
17
  // The phones it rents, by session: the server's store backs this ledger, so a phone is never lost across restarts.
18
18
  ledger: { option: "ledger" },
19
+ // The phone is driven by adb from the server's machine (the module's adb option, adb on PATH by default). Google
20
+ // builds platform-tools for x86-64 Linux, macOS and x86-64 Windows alone.
21
+ hostCommand: { command: "adb", from: "Android platform-tools", builds: ["linux-x64", "darwin-x64", "darwin-arm64", "win32-x64"] },
19
22
  load: () => import("../phone-harness.js"),
20
23
  });