@parcha/agentrun-computer 0.1.0-beta.34 → 0.1.0-beta.36

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 (107) hide show
  1. package/README.md +251 -46
  2. package/box/Dockerfile +3 -1
  3. package/box/agentrun-archil +59 -7
  4. package/box/build-daytona.py +20 -4
  5. package/dist/browser.d.ts +73 -23
  6. package/dist/browser.js +141 -17
  7. package/dist/browserbase.d.ts +48 -25
  8. package/dist/browserbase.js +176 -29
  9. package/dist/chrome.d.ts +3 -4
  10. package/dist/chrome.js +6 -11
  11. package/dist/computerd-linux-amd64 +0 -0
  12. package/dist/computerd-linux-arm64 +0 -0
  13. package/dist/conformance/browserbase.js +1 -1
  14. package/dist/conformance/cases/provider.js +78 -3
  15. package/dist/conformance/daytona.d.ts +4 -0
  16. package/dist/conformance/daytona.js +7 -1
  17. package/dist/conformance/e2b.js +2 -1
  18. package/dist/conformance/fixture.js +24 -2
  19. package/dist/conformance/kernel.js +1 -1
  20. package/dist/conformance/kind.js +2 -1
  21. package/dist/conformance/{local.d.ts → local-chrome.d.ts} +7 -7
  22. package/dist/conformance/{local.js → local-chrome.js} +11 -11
  23. package/dist/conformance/orgo.d.ts +11 -5
  24. package/dist/conformance/orgo.js +37 -8
  25. package/dist/conformance/phone-harness.js +2 -1
  26. package/dist/conformance/report.js +3 -2
  27. package/dist/conformance/runner.js +25 -7
  28. package/dist/conformance/types.d.ts +21 -8
  29. package/dist/conformance/types.js +10 -0
  30. package/dist/conformance/windows-fixture.d.ts +1 -0
  31. package/dist/conformance/windows-fixture.js +37 -0
  32. package/dist/daytona.d.ts +16 -35
  33. package/dist/daytona.js +87 -95
  34. package/dist/descriptor.d.ts +116 -0
  35. package/dist/descriptor.js +92 -0
  36. package/dist/descriptors/browserbase.d.ts +25 -0
  37. package/dist/descriptors/browserbase.js +20 -0
  38. package/dist/descriptors/daytona.d.ts +83 -0
  39. package/dist/descriptors/daytona.js +81 -0
  40. package/dist/descriptors/docker.d.ts +12 -0
  41. package/dist/descriptors/docker.js +17 -0
  42. package/dist/descriptors/e2b.d.ts +22 -0
  43. package/dist/descriptors/e2b.js +19 -0
  44. package/dist/descriptors/index.d.ts +256 -0
  45. package/dist/descriptors/index.js +19 -0
  46. package/dist/descriptors/kernel.d.ts +21 -0
  47. package/dist/descriptors/kernel.js +17 -0
  48. package/dist/descriptors/local-chrome.d.ts +17 -0
  49. package/dist/descriptors/local-chrome.js +21 -0
  50. package/dist/descriptors/modal.d.ts +54 -0
  51. package/dist/descriptors/modal.js +48 -0
  52. package/dist/descriptors/orgo.d.ts +99 -0
  53. package/dist/descriptors/orgo.js +49 -0
  54. package/dist/descriptors/phone-harness.d.ts +33 -0
  55. package/dist/descriptors/phone-harness.js +23 -0
  56. package/dist/descriptors/shared.d.ts +7 -0
  57. package/dist/descriptors/shared.js +6 -0
  58. package/dist/desktop.d.ts +4 -4
  59. package/dist/desktop.js +4 -4
  60. package/dist/docker/egress.d.ts +5 -4
  61. package/dist/docker/egress.js +7 -6
  62. package/dist/docker/image.js +17 -15
  63. package/dist/docker/inspect.d.ts +147 -0
  64. package/dist/docker/inspect.js +335 -0
  65. package/dist/docker.d.ts +6 -6
  66. package/dist/docker.js +53 -47
  67. package/dist/drift.d.ts +3 -145
  68. package/dist/drift.js +5 -334
  69. package/dist/e2b.d.ts +2 -8
  70. package/dist/e2b.js +17 -23
  71. package/dist/index.d.ts +9 -12
  72. package/dist/index.js +14 -12
  73. package/dist/isolation.js +2 -2
  74. package/dist/janitor.d.ts +20 -2
  75. package/dist/janitor.js +67 -19
  76. package/dist/kernel.d.ts +19 -29
  77. package/dist/kernel.js +110 -32
  78. package/dist/kinds.d.ts +59 -34
  79. package/dist/kinds.js +19 -117
  80. package/dist/labels.d.ts +20 -0
  81. package/dist/labels.js +62 -1
  82. package/dist/{local.d.ts → local-chrome.d.ts} +8 -9
  83. package/dist/{local.js → local-chrome.js} +26 -19
  84. package/dist/local-supervisor.d.ts +3 -3
  85. package/dist/local-supervisor.js +3 -3
  86. package/dist/modal.d.ts +6 -25
  87. package/dist/modal.js +86 -88
  88. package/dist/mount-archil.d.ts +25 -3
  89. package/dist/mount-archil.js +43 -12
  90. package/dist/orgo-channel.js +16 -13
  91. package/dist/orgo-desktop.d.ts +162 -0
  92. package/dist/orgo-desktop.js +1856 -0
  93. package/dist/orgo-names.d.ts +178 -0
  94. package/dist/orgo-names.js +287 -0
  95. package/dist/orgo.d.ts +34 -20
  96. package/dist/orgo.js +424 -173
  97. package/dist/phone-harness.d.ts +7 -12
  98. package/dist/phone-harness.js +70 -54
  99. package/dist/protocol.d.ts +5 -0
  100. package/dist/provider.d.ts +153 -10
  101. package/dist/provider.js +48 -1
  102. package/dist/providers.d.ts +23 -24
  103. package/dist/providers.js +14 -17
  104. package/dist/result.d.ts +11 -1
  105. package/dist/result.js +11 -0
  106. package/dist/test-connection.js +2 -2
  107. package/package.json +42 -2
@@ -0,0 +1,7 @@
1
+ import type { KindCapabilities } from "../kinds.js";
2
+ /** A Linux shell: exec, files and processes. */
3
+ export declare const SANDBOX: KindCapabilities;
4
+ /** A Linux desktop: a shell, and the screen, pointer and keys of an X display. */
5
+ export declare const LINUX_DESKTOP: KindCapabilities;
6
+ /** The image every browser computer runs: its vendor's own Chromium. */
7
+ export declare const BROWSER_IMAGE = "chromium";
@@ -0,0 +1,6 @@
1
+ /** A Linux shell: exec, files and processes. */
2
+ export const SANDBOX = { kind: "linux", groups: ["exec", "files", "processes"] };
3
+ /** A Linux desktop: a shell, and the screen, pointer and keys of an X display. */
4
+ export const LINUX_DESKTOP = { kind: "desktop", groups: ["exec", "files", "processes", "screen", "input.pointer", "input.keys"] };
5
+ /** The image every browser computer runs: its vendor's own Chromium. */
6
+ export const BROWSER_IMAGE = "chromium";
package/dist/desktop.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ComputerClient } from "./protocol.js";
2
- import { type ComputerErrorCode, type Result } from "./result.js";
2
+ import { type Result } from "./result.js";
3
3
  export interface DesktopOptions {
4
4
  /** The display the daemon and the X server use, given to the daemon as DISPLAY. Default ":0". */
5
5
  display?: string;
@@ -14,11 +14,11 @@ export declare const DESKTOP_GROUPS: readonly ["screen", "input.pointer", "input
14
14
  export declare function desktopOf({ display, server, timeoutMs }: DesktopOptions): Required<DesktopOptions>;
15
15
  /**
16
16
  * Starts the desktop's X server through the daemon (process.start) and waits until hello declares the display: the
17
- * server ending first, or the bound passing, is a failure in words, with the server's own last words, under the
18
- * vendor's code. version is the client's, sent with each hello.
17
+ * server ending first, or the bound passing, is a failure in words, with the server's own last words, as the vendor's
18
+ * (code vendor, vendor the provider's id). version is the client's, sent with each hello.
19
19
  */
20
20
  export declare function startDisplay(client: ComputerClient, desktop: Required<DesktopOptions>, { version, vendor, signal }: {
21
21
  version: string;
22
- vendor: ComputerErrorCode;
22
+ vendor: string;
23
23
  signal?: AbortSignal | undefined;
24
24
  }): Promise<Result<void>>;
package/dist/desktop.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // The daemon reaches the display once it answers, and hello declares screen, input.pointer and input.keys from then on
4
4
  // (hello re-checks the display on each call). Docker's desktops and E2B's start the display this way.
5
5
  import { setTimeout as sleep } from "node:timers/promises";
6
- import { fail, ok } from "./result.js";
6
+ import { fail, ok, vendorFail } from "./result.js";
7
7
  /** The groups a desktop declares besides exec, files and processes. */
8
8
  export const DESKTOP_GROUPS = ["screen", "input.pointer", "input.keys"];
9
9
  const DISPLAY = /^:\d{1,5}(\.\d{1,5})?$/;
@@ -28,8 +28,8 @@ export function desktopOf({ display = ":0", server, timeoutMs = 30_000 }) {
28
28
  }
29
29
  /**
30
30
  * Starts the desktop's X server through the daemon (process.start) and waits until hello declares the display: the
31
- * server ending first, or the bound passing, is a failure in words, with the server's own last words, under the
32
- * vendor's code. version is the client's, sent with each hello.
31
+ * server ending first, or the bound passing, is a failure in words, with the server's own last words, as the vendor's
32
+ * (code vendor, vendor the provider's id). version is the client's, sent with each hello.
33
33
  */
34
34
  export async function startDisplay(client, desktop, { version, vendor, signal }) {
35
35
  const server = desktop.server.join(" ");
@@ -55,7 +55,7 @@ export async function startDisplay(client, desktop, { version, vendor, signal })
55
55
  const read = await client.call("process.read", { id, stream: "stderr", offset: 0 }, { signal: either });
56
56
  const words = read.ok ? Buffer.from(read.value.data, "base64").toString("utf8").trim().split("\n").slice(-5).join("; ") : "";
57
57
  const how = waited.value.signal ? `signal ${waited.value.signal}` : `exit code ${waited.value.exitCode}`;
58
- return fail(vendor, `the X server (${server}) ended with ${how} before the display ${desktop.display} was up${words ? `: ${words}` : ""}`);
58
+ return vendorFail(vendor, `the X server (${server}) ended with ${how} before the display ${desktop.display} was up${words ? `: ${words}` : ""}`);
59
59
  }
60
60
  if (timedOut())
61
61
  return late();
@@ -1,8 +1,9 @@
1
- import { type DockerInspect } from "../drift.js";
1
+ import type { DockerInspect } from "./inspect.js";
2
2
  import type { NetworkPolicy } from "../provider.js";
3
- /** The proxy container's image: node:22.23.4-bookworm-slim, pinned to its multi-arch index digest (as serve pins its
4
- * own), so every host runs the same Node. The provider's `egress.image` replaces it. */
5
- export declare const EGRESS_IMAGE = "node:22.23.4-bookworm-slim@sha256:de170b39439eb0e5a3444ad7d60b015614a381e10fecae2e30ec9e735122f38d";
3
+ /** The proxy container's image: node:22.23.5-trixie-slim (Node 22's November 2026 security release), pinned to its
4
+ * multi-arch index digest (amd64 and arm64 both listed), so every host runs the same Node. serve's macOS proxy pins the
5
+ * same image. The provider's `egress.image` replaces it. */
6
+ export declare const EGRESS_IMAGE = "node:22.23.5-trixie-slim@sha256:68c76cfad89921b927eae28ba21407475e29d0ce450afcdbe70c1532db042b64";
6
7
  /** The label the proxy container and the volume carry: the computer's name. In the provider's own namespace, which a
7
8
  * spec's labels cannot use. */
8
9
  export declare const EGRESS_LABEL = "agentrun.computer.egress";
@@ -1,8 +1,8 @@
1
1
  // A Docker computer's way out to the network when its spec asks for an allowlist ({ allow: [names or CIDRs] }): the
2
2
  // computer stays `--network none`, and its own egress proxy runs in a second container the provider makes, reads back
3
- // and removes with it. Moved from serve's box-egress.ts and rewritten onto the provider: the proxy no longer lives in the
4
- // process that made the computer, so the computer keeps its network when that process ends, and attach and list read it
5
- // back from Docker anywhere.
3
+ // and removes with it. The proxy does not live in the process that
4
+ // made the computer, so the computer keeps its network when that process ends, and attach and list read it back from
5
+ // Docker anywhere.
6
6
  //
7
7
  // - The volume `<computer>-egress`: a tmpfs of 1 MiB, mode 0700, owned by the computer's uid:gid. The proxy's Unix
8
8
  // socket is made in it; the computer mounts it read-only at EGRESS_MOUNT.
@@ -20,9 +20,10 @@ import { fileURLToPath } from "node:url";
20
20
  import { DEADLINE_LABEL } from "../drift.js";
21
21
  import { LISTED_PORTS, parseAllow } from "./egress-proxy.js";
22
22
  import { checkAddress } from "./egress-table.js";
23
- /** The proxy container's image: node:22.23.4-bookworm-slim, pinned to its multi-arch index digest (as serve pins its
24
- * own), so every host runs the same Node. The provider's `egress.image` replaces it. */
25
- export const EGRESS_IMAGE = "node:22.23.4-bookworm-slim@sha256:de170b39439eb0e5a3444ad7d60b015614a381e10fecae2e30ec9e735122f38d";
23
+ /** The proxy container's image: node:22.23.5-trixie-slim (Node 22's November 2026 security release), pinned to its
24
+ * multi-arch index digest (amd64 and arm64 both listed), so every host runs the same Node. serve's macOS proxy pins the
25
+ * same image. The provider's `egress.image` replaces it. */
26
+ export const EGRESS_IMAGE = "node:22.23.5-trixie-slim@sha256:68c76cfad89921b927eae28ba21407475e29d0ce450afcdbe70c1532db042b64";
26
27
  /** The label the proxy container and the volume carry: the computer's name. In the provider's own namespace, which a
27
28
  * spec's labels cannot use. */
28
29
  export const EGRESS_LABEL = "agentrun.computer.egress";
@@ -18,7 +18,9 @@
18
18
  // recipe's own failing step, or the line Docker could not parse, which the caller wrote.
19
19
  import { execFile } from "node:child_process";
20
20
  import { createHash } from "node:crypto";
21
- import { fail, ok } from "../result.js";
21
+ import { failFor, ok, vendorFail } from "../result.js";
22
+ /** This module's failures: one with code vendor names Docker. */
23
+ const fail = failFor("docker");
22
24
  /** The repository every recipe's image is tagged in. */
23
25
  export const IMAGE_REPOSITORY = "agentrun-computer";
24
26
  /** The label a recipe's image carries: the recipe's whole sha256. A computer made from the image carries it too. */
@@ -243,7 +245,7 @@ function labelsOf(stdout) {
243
245
  /** The failures every docker call shares: no CLI, the bound (in the words given), the last caller gone. */
244
246
  function common(docker, answer, timedOut) {
245
247
  if (answer.code === "ENOENT")
246
- return fail("docker", `the docker CLI (${docker}) was not found`);
248
+ return vendorFail("docker", `the docker CLI (${docker}) was not found`);
247
249
  if (answer.code === "timeout")
248
250
  return fail("timeout", timedOut);
249
251
  if (answer.code === "aborted")
@@ -255,8 +257,8 @@ function inspectFailure(docker, tag, answer, timeoutMs) {
255
257
  if (shared)
256
258
  return shared;
257
259
  if (NOT_RUNNING.test(answer.stderr))
258
- return fail("docker", `Docker did not answer docker image inspect ${tag}: is it running, and may this user reach it?`);
259
- return fail("docker", `docker image inspect ${tag} failed (${exitOf(answer)}): run it on this machine as this process's user to see why`);
260
+ return vendorFail("docker", `Docker did not answer docker image inspect ${tag}: is it running, and may this user reach it?`);
261
+ return vendorFail("docker", `docker image inspect ${tag} failed (${exitOf(answer)}): run it on this machine as this process's user to see why`);
260
262
  }
261
263
  function buildFailure(docker, source, answer, timeoutMs) {
262
264
  const { tag, base } = source;
@@ -265,26 +267,26 @@ function buildFailure(docker, source, answer, timeoutMs) {
265
267
  return shared;
266
268
  const said = answer.stderr;
267
269
  if (/no space left on device/i.test(said))
268
- return fail("docker", `the build of ${tag} ran out of disk space: free some, then call again`);
270
+ return vendorFail("docker", `the build of ${tag} ran out of disk space: free some, then call again`);
269
271
  // A base that could not be fetched for want of a network says so in both ways: the network is the cause.
270
272
  if (UNREACHABLE.test(said))
271
- return fail("docker", `the build of ${tag} could not reach the network (it pulls ${base}): call again once this machine can reach it`);
273
+ return vendorFail("docker", `the build of ${tag} could not reach the network (it pulls ${base}): call again once this machine can reach it`);
272
274
  if (NO_BASE.test(said))
273
- return fail("docker", `the build of ${tag} could not pull its base, ${base}: name a base the registry has, or pull it on this machine first`);
275
+ return vendorFail("docker", `the build of ${tag} could not pull its base, ${base}: name a base the registry has, or pull it on this machine first`);
274
276
  if (NO_PACKAGE.test(said))
275
- return fail("docker", `the recipe of ${tag} names a package its base's package manager could not install: check the names, then call again`);
277
+ return vendorFail("docker", `the recipe of ${tag} names a package its base's package manager could not install: check the names, then call again`);
276
278
  const line = PARSE.exec(said)?.[1];
277
279
  if (line !== undefined)
278
- return fail("docker", `Docker could not parse the recipe of ${tag} at line ${line}: fix that line`);
280
+ return vendorFail("docker", `Docker could not parse the recipe of ${tag} at line ${line}: fix that line`);
279
281
  for (const pattern of STEP) {
280
282
  const step = pattern.exec(said);
281
283
  if (step === null)
282
284
  continue;
283
285
  // The step is the recipe's own words, which the caller wrote: the shell's prefix off, BuildKit's quoting undone.
284
286
  const command = (step[1] ?? "").replace(/\\(.)/g, "$1").replace(/^\/bin\/sh -c /, "").slice(0, 200);
285
- return fail("docker", `the recipe of ${tag} failed at the step \`RUN ${command}\` with exit code ${step[2]}: fix that step`);
287
+ return vendorFail("docker", `the recipe of ${tag} failed at the step \`RUN ${command}\` with exit code ${step[2]}: fix that step`);
286
288
  }
287
- return fail("docker", `docker build of ${tag} failed (${exitOf(answer)}): run docker build with the recipe on this machine to see why`);
289
+ return vendorFail("docker", `docker build of ${tag} failed (${exitOf(answer)}): run docker build with the recipe on this machine to see why`);
288
290
  }
289
291
  function pullFailure(docker, image, answer, timeoutMs) {
290
292
  const see = `run docker pull ${image} on this machine to see why`;
@@ -293,10 +295,10 @@ function pullFailure(docker, image, answer, timeoutMs) {
293
295
  return shared;
294
296
  const said = answer.stderr;
295
297
  if (DENIED.test(said))
296
- return fail("docker", `the registry refused the pull of ${image} (no such repository, or it needs a docker login): ${see}`);
298
+ return vendorFail("docker", `the registry refused the pull of ${image} (no such repository, or it needs a docker login): ${see}`);
297
299
  if (NO_MANIFEST.test(said))
298
- return fail("docker", `the registry has no ${image}: name an image it has`);
300
+ return vendorFail("docker", `the registry has no ${image}: name an image it has`);
299
301
  if (UNREACHABLE.test(said))
300
- return fail("docker", `the registry could not be reached to pull ${image}: ${see}`);
301
- return fail("docker", `docker pull ${image} failed (${exitOf(answer)}): ${see}`);
302
+ return vendorFail("docker", `the registry could not be reached to pull ${image}: ${see}`);
303
+ return vendorFail("docker", `docker pull ${image} failed (${exitOf(answer)}): ${see}`);
302
304
  }
@@ -0,0 +1,147 @@
1
+ import { type HelloExpected } from "../drift.js";
2
+ import { type MountReadBack } from "../mount.js";
3
+ import type { HelloResult } from "../protocol.js";
4
+ import type { ComputerSpec, NetworkPolicy, NetworkSpec } from "../provider.js";
5
+ import { type EgressCode } from "./egress.js";
6
+ import { type DockerVolume } from "./volume.js";
7
+ /** With the Docker provider's volume option, where the daemon's staged directory is mounted read-only: its computerd is
8
+ * DAEMON_IN_COMPUTER (stage.ts). */
9
+ export declare const DAEMON_DIR_IN_COMPUTER = "/opt/agentrun";
10
+ /** CPUs are a CFS quota of each 100 ms, as serve gives them: Docker refuses a --cpus above its own CPU count. */
11
+ export declare const CPU_PERIOD_US = 100000;
12
+ /**
13
+ * The --tmpfs options of each tmpfs a computer gets, owned by its uid:gid. A tmpfs's pages count against the
14
+ * computer's memory, so /work holds half of it: a full /work is ENOSPC before the memory limit could OOM-kill a
15
+ * process. /run/agentrun holds only init's socket.
16
+ */
17
+ export declare function tmpfsOf(user: string, memoryMb: number): Record<string, string>;
18
+ /** The parts of `docker inspect` a computer is checked by; HostConfig and Config are checked whole. */
19
+ export interface DockerInspect {
20
+ Id?: string;
21
+ Name?: string;
22
+ State?: {
23
+ Running?: boolean;
24
+ Status?: string;
25
+ ExitCode?: number;
26
+ Error?: string;
27
+ };
28
+ AppArmorProfile?: string;
29
+ ProcessLabel?: string;
30
+ Config?: {
31
+ User?: string;
32
+ Image?: string;
33
+ WorkingDir?: string;
34
+ Env?: string[] | null;
35
+ Entrypoint?: string[] | null;
36
+ Cmd?: string[] | null;
37
+ Labels?: Record<string, string> | null;
38
+ [field: string]: unknown;
39
+ };
40
+ HostConfig?: {
41
+ NetworkMode?: string;
42
+ CapDrop?: string[] | null;
43
+ CapAdd?: string[] | null;
44
+ Privileged?: boolean;
45
+ SecurityOpt?: string[] | null;
46
+ PidsLimit?: number | null;
47
+ Memory?: number;
48
+ MemorySwap?: number;
49
+ CpuPeriod?: number;
50
+ CpuQuota?: number;
51
+ Tmpfs?: Record<string, string> | null;
52
+ Mounts?: Array<Record<string, unknown>> | null;
53
+ MaskedPaths?: string[] | null;
54
+ ReadonlyPaths?: string[] | null;
55
+ [field: string]: unknown;
56
+ };
57
+ Mounts?: Array<{
58
+ Type?: string;
59
+ Name?: string;
60
+ Source?: string;
61
+ Destination?: string;
62
+ RW?: boolean;
63
+ Propagation?: string;
64
+ }> | null;
65
+ NetworkSettings?: {
66
+ Networks?: Record<string, unknown> | null;
67
+ };
68
+ }
69
+ /** What `docker info` reports of the host's enforcement, as the provider reads it. */
70
+ export interface DockerInfo {
71
+ Architecture?: string;
72
+ SecurityOptions?: string[] | null;
73
+ MemoryLimit?: boolean;
74
+ SwapLimit?: boolean;
75
+ PidsLimit?: boolean;
76
+ CPUCfsQuota?: boolean;
77
+ CPUCfsPeriod?: boolean;
78
+ ServerVersion?: string;
79
+ }
80
+ /** A Docker host as the provider reads it: its architecture in Go's names, its security modules, and what it lacks. */
81
+ export interface DockerHost {
82
+ arch: string;
83
+ /** The Docker Engine's major version (docker info's ServerVersion), when it reads as one. */
84
+ engine?: number;
85
+ apparmor: boolean;
86
+ selinux: boolean;
87
+ /** Each enforcement the host lacks, in words; a computer is refused on a host with any. */
88
+ problems: string[];
89
+ /**
90
+ * Present when the host remaps user ids (docker info's name=userns: userns-remap; name=rootless: rootless Docker): a
91
+ * computer's uid is then another uid on the host. No problem for a computer, but a bind of the run folder is refused.
92
+ */
93
+ remap?: "userns" | "rootless";
94
+ }
95
+ /**
96
+ * The host's enforcement, from docker info. A computer's sizes are cgroup limits, so a host that does not enforce one
97
+ * makes it configuration only; seccomp is required, since a computer's only syscall filter is Docker's default
98
+ * profile. AppArmor and SELinux are read, not required: a host has the one its distribution ships or neither, and a
99
+ * computer must then carry the profile or label Docker gives every container (the drift check).
100
+ */
101
+ export declare function hostOf(info: DockerInfo | null | undefined): DockerHost;
102
+ export interface DriftExpected extends HelloExpected {
103
+ /** The daemon file on the host the computer binds, as it was mounted: for DockerProvider, its copy of the daemon. */
104
+ daemonPath: string;
105
+ /** The deadline label's value, as it was set. */
106
+ deadline: string;
107
+ /** The uid:gid the computer was asked to run as. */
108
+ user: string;
109
+ /** Whether the host's Docker gives every container an AppArmor profile, or an SELinux label (hostOf). */
110
+ apparmor: boolean;
111
+ selinux: boolean;
112
+ /** For a computer with an allowlist: its proxy container's inspect (none when it is gone), and where the proxy's code
113
+ * is on the host, as it was bound. */
114
+ proxy?: DockerInspect | null;
115
+ egressCode?: EgressCode;
116
+ /** For a computer with an allowlist: the Docker host's own addresses its proxy must refuse (its --local holds each). */
117
+ hostAddresses?: readonly string[];
118
+ /** The provider's volume option: the daemon and the run's folder are then that volume's subpaths, not binds. */
119
+ volume?: DockerVolume;
120
+ }
121
+ /**
122
+ * How create mounts a path of this host at `target`: a bind of it, or, with the provider's volume option, the volume's
123
+ * subpath, as HostConfig.Mounts records it (Docker keeps `volume-nocopy` and the subpath under VolumeOptions). Undefined
124
+ * for a path outside the volume, which create never mounts.
125
+ */
126
+ export declare function mountAsked(path: string, target: string, readonly: boolean, volume: DockerVolume | undefined): Record<string, unknown> | undefined;
127
+ /** Whether a computer's inspect shows any part of an allowlist: the egress volume at its path, or init's relay. */
128
+ export declare function egressShaped(inspected: DockerInspect | null | undefined): boolean;
129
+ /**
130
+ * The network a computer is on, read back from inspect: `none` is network mode none on no network but Docker's own
131
+ * `none`, `open` is the default bridge alone. An allowlist is network mode none with the computer's egress volume
132
+ * mounted read-only at EGRESS_MOUNT and init relaying to its socket, and the list read back from `proxy`, the
133
+ * computer's proxy container's inspect (egressOf: none when it is gone), which must refuse each of `local`, the Docker
134
+ * host's own addresses. Anything else is reported in words, never as a policy it might widen to.
135
+ */
136
+ export declare function networkOf(inspected: DockerInspect | null | undefined, proxy?: DockerInspect | null, code?: EgressCode, local?: readonly string[]): NetworkPolicy;
137
+ /** Whether a policy read back is the one declared: the same string, or an allowlist with the same entries, normalized. */
138
+ export declare function samePolicy(declared: NetworkSpec, read: NetworkPolicy): boolean;
139
+ /**
140
+ * What is mounted at /workspace, read back from inspect: a read-write bind is the run's folder; nothing is undefined;
141
+ * anything else (read-only, a volume, two mounts) is reported in words, never as a bind it might be.
142
+ */
143
+ export declare function mountOf(inspected: DockerInspect | null | undefined, volume?: DockerVolume): MountReadBack | undefined;
144
+ /** Every way a created computer differs from its spec, from inspect and hello. */
145
+ export declare function drift(spec: ComputerSpec, inspected: DockerInspect | null | undefined, hello: HelloResult | null | undefined, expected: DriftExpected): string[];
146
+ /** Every way a computer's docker inspect differs from its spec: the fields create asks for, and the closed check. */
147
+ export declare function inspectDrift(spec: ComputerSpec, inspected: DockerInspect | null | undefined, expected: DriftExpected): string[];