@parcha/agentrun-computer 0.0.0-stage → 0.1.0-beta.33

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 (173) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +2411 -2
  4. package/box/Dockerfile +69 -0
  5. package/box/agentrun-archil +168 -0
  6. package/box/build-daytona.py +26 -0
  7. package/box/build-e2b.mjs +32 -0
  8. package/box/build-modal.py +17 -0
  9. package/dist/actions.d.ts +18 -0
  10. package/dist/actions.js +139 -0
  11. package/dist/browser.d.ts +151 -0
  12. package/dist/browser.js +305 -0
  13. package/dist/browserbase.d.ts +139 -0
  14. package/dist/browserbase.js +408 -0
  15. package/dist/child.d.ts +40 -0
  16. package/dist/child.js +127 -0
  17. package/dist/client.d.ts +22 -0
  18. package/dist/client.js +136 -0
  19. package/dist/computerd-linux-amd64 +0 -0
  20. package/dist/computerd-linux-arm64 +0 -0
  21. package/dist/conformance/archil.d.ts +68 -0
  22. package/dist/conformance/archil.js +152 -0
  23. package/dist/conformance/browserbase.d.ts +35 -0
  24. package/dist/conformance/browserbase.js +45 -0
  25. package/dist/conformance/cases/apps.d.ts +2 -0
  26. package/dist/conformance/cases/apps.js +155 -0
  27. package/dist/conformance/cases/browser.d.ts +4 -0
  28. package/dist/conformance/cases/browser.js +105 -0
  29. package/dist/conformance/cases/drift.d.ts +2 -0
  30. package/dist/conformance/cases/drift.js +64 -0
  31. package/dist/conformance/cases/exec.d.ts +2 -0
  32. package/dist/conformance/cases/exec.js +125 -0
  33. package/dist/conformance/cases/files.d.ts +2 -0
  34. package/dist/conformance/cases/files.js +294 -0
  35. package/dist/conformance/cases/health.d.ts +2 -0
  36. package/dist/conformance/cases/health.js +71 -0
  37. package/dist/conformance/cases/index.d.ts +9 -0
  38. package/dist/conformance/cases/index.js +37 -0
  39. package/dist/conformance/cases/input.d.ts +12 -0
  40. package/dist/conformance/cases/input.js +109 -0
  41. package/dist/conformance/cases/isolation.d.ts +21 -0
  42. package/dist/conformance/cases/isolation.js +98 -0
  43. package/dist/conformance/cases/lifetime.d.ts +2 -0
  44. package/dist/conformance/cases/lifetime.js +64 -0
  45. package/dist/conformance/cases/mount.d.ts +2 -0
  46. package/dist/conformance/cases/mount.js +252 -0
  47. package/dist/conformance/cases/process.d.ts +2 -0
  48. package/dist/conformance/cases/process.js +240 -0
  49. package/dist/conformance/cases/provider.d.ts +2 -0
  50. package/dist/conformance/cases/provider.js +302 -0
  51. package/dist/conformance/cases/screen.d.ts +9 -0
  52. package/dist/conformance/cases/screen.js +230 -0
  53. package/dist/conformance/cases/settings.d.ts +57 -0
  54. package/dist/conformance/cases/settings.js +142 -0
  55. package/dist/conformance/cases/touch.d.ts +2 -0
  56. package/dist/conformance/cases/touch.js +117 -0
  57. package/dist/conformance/cases/util.d.ts +7 -0
  58. package/dist/conformance/cases/util.js +8 -0
  59. package/dist/conformance/cdp.d.ts +13 -0
  60. package/dist/conformance/cdp.js +88 -0
  61. package/dist/conformance/cli.d.ts +29 -0
  62. package/dist/conformance/cli.js +231 -0
  63. package/dist/conformance/daytona-sweep.d.ts +18 -0
  64. package/dist/conformance/daytona-sweep.js +126 -0
  65. package/dist/conformance/daytona.d.ts +83 -0
  66. package/dist/conformance/daytona.js +107 -0
  67. package/dist/conformance/docker.d.ts +38 -0
  68. package/dist/conformance/docker.js +70 -0
  69. package/dist/conformance/drift-daemon.d.ts +8 -0
  70. package/dist/conformance/drift-daemon.js +41 -0
  71. package/dist/conformance/e2b-diagnose.d.ts +16 -0
  72. package/dist/conformance/e2b-diagnose.js +61 -0
  73. package/dist/conformance/e2b-sweep.d.ts +18 -0
  74. package/dist/conformance/e2b-sweep.js +132 -0
  75. package/dist/conformance/e2b.d.ts +74 -0
  76. package/dist/conformance/e2b.js +111 -0
  77. package/dist/conformance/fixture.d.ts +65 -0
  78. package/dist/conformance/fixture.js +98 -0
  79. package/dist/conformance/index.d.ts +8 -0
  80. package/dist/conformance/index.js +8 -0
  81. package/dist/conformance/kernel.d.ts +31 -0
  82. package/dist/conformance/kernel.js +40 -0
  83. package/dist/conformance/kind.d.ts +23 -0
  84. package/dist/conformance/kind.js +58 -0
  85. package/dist/conformance/modal-sweep.d.ts +22 -0
  86. package/dist/conformance/modal-sweep.js +213 -0
  87. package/dist/conformance/modal.d.ts +69 -0
  88. package/dist/conformance/modal.js +76 -0
  89. package/dist/conformance/orgo.d.ts +41 -0
  90. package/dist/conformance/orgo.js +69 -0
  91. package/dist/conformance/phone-harness.d.ts +61 -0
  92. package/dist/conformance/phone-harness.js +241 -0
  93. package/dist/conformance/png.d.ts +16 -0
  94. package/dist/conformance/png.js +132 -0
  95. package/dist/conformance/report.d.ts +2 -0
  96. package/dist/conformance/report.js +86 -0
  97. package/dist/conformance/runner.d.ts +11 -0
  98. package/dist/conformance/runner.js +585 -0
  99. package/dist/conformance/tar.d.ts +13 -0
  100. package/dist/conformance/tar.js +105 -0
  101. package/dist/conformance/types.d.ts +257 -0
  102. package/dist/conformance/types.js +24 -0
  103. package/dist/daemon-copy.d.ts +40 -0
  104. package/dist/daemon-copy.js +259 -0
  105. package/dist/daytona.d.ts +180 -0
  106. package/dist/daytona.js +1498 -0
  107. package/dist/desktop.d.ts +24 -0
  108. package/dist/desktop.js +68 -0
  109. package/dist/docker/egress-main.d.ts +1 -0
  110. package/dist/docker/egress-main.js +68 -0
  111. package/dist/docker/egress-proxy.d.ts +53 -0
  112. package/dist/docker/egress-proxy.js +450 -0
  113. package/dist/docker/egress-table.d.ts +39 -0
  114. package/dist/docker/egress-table.js +197 -0
  115. package/dist/docker/egress.d.ts +109 -0
  116. package/dist/docker/egress.js +318 -0
  117. package/dist/docker/image.d.ts +49 -0
  118. package/dist/docker/image.js +302 -0
  119. package/dist/docker/stage.d.ts +21 -0
  120. package/dist/docker/stage.js +290 -0
  121. package/dist/docker/volume.d.ts +24 -0
  122. package/dist/docker/volume.js +67 -0
  123. package/dist/docker.d.ts +156 -0
  124. package/dist/docker.js +1277 -0
  125. package/dist/drift.d.ts +200 -0
  126. package/dist/drift.js +416 -0
  127. package/dist/e2b.d.ts +337 -0
  128. package/dist/e2b.js +1516 -0
  129. package/dist/entry.d.ts +2 -0
  130. package/dist/entry.js +24 -0
  131. package/dist/files.d.ts +50 -0
  132. package/dist/files.js +208 -0
  133. package/dist/index.d.ts +27 -0
  134. package/dist/index.js +26 -0
  135. package/dist/isolation.d.ts +29 -0
  136. package/dist/isolation.js +71 -0
  137. package/dist/janitor.d.ts +50 -0
  138. package/dist/janitor.js +135 -0
  139. package/dist/kernel.d.ts +113 -0
  140. package/dist/kernel.js +358 -0
  141. package/dist/kinds.d.ts +79 -0
  142. package/dist/kinds.js +133 -0
  143. package/dist/labels.d.ts +23 -0
  144. package/dist/labels.js +50 -0
  145. package/dist/modal.d.ts +302 -0
  146. package/dist/modal.js +1374 -0
  147. package/dist/mount-archil.d.ts +164 -0
  148. package/dist/mount-archil.js +471 -0
  149. package/dist/mount.d.ts +57 -0
  150. package/dist/mount.js +104 -0
  151. package/dist/orgo-channel.d.ts +96 -0
  152. package/dist/orgo-channel.js +391 -0
  153. package/dist/orgo.d.ts +139 -0
  154. package/dist/orgo.js +1006 -0
  155. package/dist/phone-harness.d.ts +185 -0
  156. package/dist/phone-harness.js +1420 -0
  157. package/dist/processes.d.ts +24 -0
  158. package/dist/processes.js +40 -0
  159. package/dist/protocol.d.ts +729 -0
  160. package/dist/protocol.js +54 -0
  161. package/dist/provider.d.ts +245 -0
  162. package/dist/provider.js +37 -0
  163. package/dist/providers.d.ts +68 -0
  164. package/dist/providers.js +25 -0
  165. package/dist/result.d.ts +15 -0
  166. package/dist/result.js +2 -0
  167. package/dist/screen-watch.d.ts +150 -0
  168. package/dist/screen-watch.js +490 -0
  169. package/dist/test-connection.d.ts +17 -0
  170. package/dist/test-connection.js +26 -0
  171. package/dist/wait.d.ts +23 -0
  172. package/dist/wait.js +65 -0
  173. package/package.json +62 -4
@@ -0,0 +1,24 @@
1
+ /** The named volume a provider's paths are on, and where this process has it mounted. */
2
+ export interface DockerVolume {
3
+ /** The named volume, as Docker names it (`docker volume ls`). */
4
+ name: string;
5
+ /** Where this process has the volume mounted: an absolute path. Every path the provider mounts must be below it. */
6
+ root: string;
7
+ }
8
+ /** The first Docker Engine that mounts a volume's subpath (API 1.45). */
9
+ export declare const VOLUME_SUBPATH_ENGINE = 26;
10
+ /** Why an older engine is refused. */
11
+ export declare const OLD_ENGINE = "Docker Engine <26 can't mount a named volume's subpath, which the provider's volume option needs: upgrade to Docker 26+";
12
+ /** The option checked, its root resolved; a throw in words for one the provider cannot use. */
13
+ export declare function volumeOf(given: unknown): DockerVolume;
14
+ /** `path` relative to the root, as a volume's subpath, when it is below it (or at it, with `orRoot`); else undefined.
15
+ * Read against the root as written and, when it exists, as its real path, since a path the provider made may be real. */
16
+ export declare function subpathOf(volume: DockerVolume, path: string, { orRoot }?: {
17
+ orRoot?: boolean;
18
+ }): string | undefined;
19
+ /** Why `path` cannot be mounted from the volume, in words, or undefined when it can. `what` names it. */
20
+ export declare function outsideWords(volume: DockerVolume, path: string, what: string): string;
21
+ /** The --mount value of `subpath` of the volume at `dst`. */
22
+ export declare function volumeMount(volume: DockerVolume, subpath: string, dst: string, readonly: boolean): string;
23
+ /** The engine's major version from docker info's ServerVersion ("26.1.4", "29.0.0-rc.1"), or undefined. */
24
+ export declare function engineOf(serverVersion: unknown): number | undefined;
@@ -0,0 +1,67 @@
1
+ // A Docker provider whose host paths are not the Docker daemon's: a server in a container of that Docker's own, given its
2
+ // socket (compose.yaml), has its files on a named volume the daemon mounted into it at `root`. A path there exists only in
3
+ // the server's container, so the daemon cannot bind it; the provider then mounts each path it hands a computer (the
4
+ // daemon's copy, the run's folder) as a subpath of that volume:
5
+ //
6
+ // --mount type=volume,src=<name>,dst=<in the computer>,volume-subpath=<path below root>,volume-nocopy[,readonly]
7
+ //
8
+ // never the volume's root, and never a path outside it, which is refused in words. `volume-subpath` takes Docker Engine
9
+ // 26 or later; an older engine is refused in words too. `volume-nocopy`: Docker never copies the image's files at the
10
+ // mount's destination into the volume. As serve's box stack did (packages/serve/src/box-paths.ts).
11
+ import { realpathSync } from "node:fs";
12
+ import { isAbsolute, relative, resolve, sep } from "node:path";
13
+ /** The first Docker Engine that mounts a volume's subpath (API 1.45). */
14
+ export const VOLUME_SUBPATH_ENGINE = 26;
15
+ /** Why an older engine is refused. */
16
+ export const OLD_ENGINE = `Docker Engine <${VOLUME_SUBPATH_ENGINE} can't mount a named volume's subpath, which the provider's volume option needs: upgrade to Docker ${VOLUME_SUBPATH_ENGINE}+`;
17
+ /** Docker's own rule for a volume's name. */
18
+ const VOLUME_NAME = /^[a-zA-Z0-9][a-zA-Z0-9_.-]+$/;
19
+ /** What a --mount value cannot hold. */
20
+ const UNSAFE = /[,"\r\n]/;
21
+ /** The option checked, its root resolved; a throw in words for one the provider cannot use. */
22
+ export function volumeOf(given) {
23
+ const option = given;
24
+ if (typeof option !== "object" || option === null)
25
+ throw new Error("the provider's volume is { name, root }: the named volume its paths are on, and where this process has it mounted");
26
+ const { name, root } = option;
27
+ if (typeof name !== "string" || !VOLUME_NAME.test(name))
28
+ throw new Error(`the provider's volume.name ${JSON.stringify(name)} is not a Docker volume's name`);
29
+ if (typeof root !== "string" || !isAbsolute(root))
30
+ throw new Error(`the provider's volume.root ${JSON.stringify(root)} must be an absolute path: where this process has the volume ${name} mounted`);
31
+ if (UNSAFE.test(root))
32
+ throw new Error(`the provider's volume.root ${JSON.stringify(root)} has a comma, a double quote or a line break, which a Docker mount cannot hold`);
33
+ return { name, root: resolve(root) };
34
+ }
35
+ /** `path` relative to the root, as a volume's subpath, when it is below it (or at it, with `orRoot`); else undefined.
36
+ * Read against the root as written and, when it exists, as its real path, since a path the provider made may be real. */
37
+ export function subpathOf(volume, path, { orRoot = false } = {}) {
38
+ const target = resolve(path);
39
+ const roots = [volume.root];
40
+ try {
41
+ roots.push(realpathSync(volume.root));
42
+ }
43
+ catch {
44
+ // A root that is not there (yet) is read as written.
45
+ }
46
+ for (const root of roots) {
47
+ const below = relative(root, target);
48
+ if (below === "")
49
+ return orRoot ? "" : undefined;
50
+ if (!below.startsWith(`..${sep}`) && below !== ".." && !isAbsolute(below))
51
+ return below;
52
+ }
53
+ return undefined;
54
+ }
55
+ /** Why `path` cannot be mounted from the volume, in words, or undefined when it can. `what` names it. */
56
+ export function outsideWords(volume, path, what) {
57
+ return `${what} ${path} is not below the provider's volume root ${volume.root} (the volume ${volume.name}): on this Docker host the provider reaches a path only as a subpath of that volume, never its root`;
58
+ }
59
+ /** The --mount value of `subpath` of the volume at `dst`. */
60
+ export function volumeMount(volume, subpath, dst, readonly) {
61
+ return `type=volume,src=${volume.name},dst=${dst},volume-subpath=${subpath},volume-nocopy${readonly ? ",readonly" : ""}`;
62
+ }
63
+ /** The engine's major version from docker info's ServerVersion ("26.1.4", "29.0.0-rc.1"), or undefined. */
64
+ export function engineOf(serverVersion) {
65
+ const major = typeof serverVersion === "string" ? /^(\d+)\./.exec(serverVersion.trim())?.[1] : undefined;
66
+ return major === undefined ? undefined : Number(major);
67
+ }
@@ -0,0 +1,156 @@
1
+ import { type DesktopOptions } from "./desktop.js";
2
+ import { type DockerHost } from "./drift.js";
3
+ import { type EnsureImageOptions, type ImageSource } from "./docker/image.js";
4
+ import type { KindCapabilities } from "./kinds.js";
5
+ import { type MountKind } from "./mount.js";
6
+ import { type AttachedComputer, type CallContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type NetworkPolicy, type NetworkSpec, type Refusal } from "./provider.js";
7
+ import { type Result } from "./result.js";
8
+ import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
9
+ /**
10
+ * A Docker desktop: an image with an X server (test/fixtures/desktop/Dockerfile is the smallest, Debian and Xvfb).
11
+ * computerd stays the first process and starts nothing of its own: create gives it DISPLAY, then starts the X server
12
+ * through it with process.start (startDisplay in ./desktop.ts).
13
+ */
14
+ export type DockerDesktopOptions = DesktopOptions;
15
+ /** A computer's egress proxy, for a spec whose network is an allowlist (src/docker/egress.ts). */
16
+ export interface DockerEgressOptions {
17
+ /** The proxy container's image: one with Node 22.19 or later as `node`. Default EGRESS_IMAGE, pinned by digest. */
18
+ image?: string;
19
+ /** What a refusal of a host off the list says to do, after its words: printable ASCII, since it goes into a status line. */
20
+ hint?: string;
21
+ /** How long create waits for the proxy to say it is ready before it gives up, in ms. Default 10 s. */
22
+ readyMs?: number;
23
+ /**
24
+ * The Docker host's own addresses, each an IP address, which the proxy refuses as the host's (this-host), beside this
25
+ * machine's public ones. Required for an allowlist when this provider's interfaces are not the Docker host's: it runs
26
+ * in a container (containerSigns), or its docker CLI talks to a daemon that is not a local unix socket.
27
+ */
28
+ hostAddresses?: string[];
29
+ /**
30
+ * The root of the filesystem containerSigns reads to tell whether this provider runs in a container (/.dockerenv,
31
+ * /run/.containerenv, /proc/self/cgroup under it): an absolute path, default "/". For tests and embedders that know
32
+ * better; it never makes the refusal weaker than what that root shows.
33
+ */
34
+ hostRoot?: string;
35
+ }
36
+ export interface DockerProviderOptions {
37
+ /** The daemon binary on this machine, for the computer's architecture (dist/computerd-linux-<arch>). Any mode this
38
+ * process can read: a computer binds the provider's own 0755 copy of it (daemonCache), never this file. */
39
+ daemonPath: string;
40
+ /** The directory the provider copies the daemon into, the copy each computer binds: computerd-<sha256 of its bytes>,
41
+ * mode 0755. Made 0700 when missing; refused in words when it is a link, another user's, open to other users, or
42
+ * under a directory another user may write. Default ~/.cache/agentrun-computer; the provider reads no
43
+ * environment, XDG_CACHE_HOME included. */
44
+ daemonCache?: string;
45
+ /** The egress proxy of a computer whose network is an allowlist. */
46
+ egress?: DockerEgressOptions;
47
+ /** Makes every computer a desktop (kind desktop): its image must have the X server. */
48
+ desktop?: DockerDesktopOptions;
49
+ /** The docker CLI. */
50
+ docker?: string;
51
+ /** Who a computer runs as when its spec does not say: uid or uid:gid, in numbers. Default: this process's uid:gid, or
52
+ * 1000:1000 when its uid or gid is 0. Root and root's group are refused here: a computer runs as either only when
53
+ * its spec asks. */
54
+ user?: string;
55
+ /** The image its computers start from, which image() makes ready: a recipe, built once, or an image by name, pulled
56
+ * when Docker has none. Default the provider's own recipe, DOCKER_RECIPE (src/docker/image.ts). */
57
+ image?: ImageSource;
58
+ /**
59
+ * For a provider whose paths are not the Docker daemon's: one in a container of that Docker's own, given its socket
60
+ * (compose), with its files on the named volume `name`, which this process has mounted at `root`. The daemon's copy
61
+ * (daemonCache) and a spec's run folder are then mounted as that volume's subpaths (`volume-subpath`, Docker Engine 26
62
+ * and later), never binds of this process's paths, which the daemon does not have, and never the volume's root.
63
+ * daemonCache must be at or below `root` (refused here when it is not), and a run folder below it (refused by check);
64
+ * an older engine is refused by check and create. Without it, every path is bound as it is (src/docker/volume.ts).
65
+ */
66
+ volume?: {
67
+ name: string;
68
+ root: string;
69
+ };
70
+ }
71
+ /** The mount kinds a Docker computer takes, as capabilities().mount declares them: a bind of a folder on this host. */
72
+ export declare const MOUNT: readonly MountKind[];
73
+ /** The machine kind and groups of each configuration: a linux computer, and one made with the desktop option. */
74
+ export declare const CAPABILITIES: readonly KindCapabilities[];
75
+ /** What create() takes: the provider's options, the daemon optional. */
76
+ export interface DockerCreateOptions extends Partial<DockerProviderOptions> {
77
+ /** The longest `docker version` may take, when create asks Docker its architecture; default 30 s. */
78
+ timeoutMs?: number;
79
+ }
80
+ /**
81
+ * Docker's architecture as `docker version` reports it (amd64, arm64), within timeoutMs, or an error in words. The docker
82
+ * CLI runs with this process's environment, as every call of the provider does, so it asks the Docker the provider uses.
83
+ */
84
+ export declare function dockerArch({ docker, timeoutMs }?: Pick<DockerCreateOptions, "docker" | "timeoutMs">): Promise<string>;
85
+ /**
86
+ * A DockerProvider from its options alone; it reads no environment. Without options.daemonPath it asks Docker its
87
+ * architecture and takes this package's daemon for it, and says when that daemon is not built. The image is an option
88
+ * too (default the provider's own recipe): no image name is read from the environment.
89
+ */
90
+ export declare function create(options?: DockerCreateOptions): Promise<DockerProvider>;
91
+ /** The conformance CLI's module for Docker: the drifted twin. */
92
+ export declare const conformance: () => Promise<typeof import("./conformance/docker.js")>;
93
+ /**
94
+ * Why #settle could not show its leftovers gone within SETTLE_MS, in words that always name them: `there`, what its
95
+ * last look still found; or, when the last look found none but the quiet window was not complete, every name it
96
+ * checked (`checked`), which could not be confirmed gone. Exported for its test.
97
+ */
98
+ export declare function settleWords(checked: readonly string[], there: readonly string[]): string;
99
+ export declare class DockerProvider implements ComputerProvider {
100
+ #private;
101
+ readonly id = "docker";
102
+ readonly version: string;
103
+ constructor({ daemonPath, daemonCache, docker, user, desktop, egress, image, volume }: DockerProviderOptions);
104
+ /** The uid:gid a computer runs as when its spec names no user: the user a bound run folder must be writable by. */
105
+ get user(): string;
106
+ capabilities(): ComputerCapabilities;
107
+ /**
108
+ * The provider's image ready in Docker, and its tag for create's spec.image: built from its recipe, or pulled, when
109
+ * Docker has none; one inspect when it has. Concurrent calls in one process share one build (ensureImage).
110
+ */
111
+ image(options?: CallContext & Pick<EnsureImageOptions, "timeoutMs" | "onWait">): Promise<Result<string>>;
112
+ /** The spec's refusals, and the host's once create, attach or host() has read it: its problems, a bind or an
113
+ * allowlist on a host that remaps user ids, and an allowlist on a Docker host this provider does not run on. */
114
+ check(spec: ComputerSpec): Refusal[];
115
+ create(spec: ComputerSpec, { signal }?: {
116
+ signal?: AbortSignal;
117
+ }): Promise<Result<ComputerRef>>;
118
+ /** The Docker host's architecture and enforcement (hostOf), read by docker info once per provider. */
119
+ host({ signal }?: CallContext): Promise<Result<DockerHost>>;
120
+ /** The live view: screen.watch on a connection of the watch's own (daemonWatch); a linux computer has no screen. */
121
+ watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
122
+ connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
123
+ attach(ref: {
124
+ id: string;
125
+ } | {
126
+ labels: Record<string, string>;
127
+ }, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
128
+ /**
129
+ * Settings' test: one docker ps by the provider's own label on this Docker host, which makes nothing. The count is the
130
+ * names of its making that ps lists, with no inspect of each.
131
+ */
132
+ testConnection({ signal }?: CallContext): Promise<Result<{
133
+ detail: string;
134
+ }>>;
135
+ list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
136
+ /**
137
+ * The janitor's second pass (sweep calls it after the computers): every egress proxy container and egress volume
138
+ * labelled EGRESS_LABEL, and with all of `labels`, whose deadline label has passed (or is missing or unreadable, fail
139
+ * closed), or whose computer is gone and that is older than a create could take (#leftoverGraceMs: one under way has
140
+ * made its proxy before its computer, and pulled both images before either, so no pull happens in between). Each is
141
+ * removed by what its label found, a proxy before its volume, never by a name alone. Returns the names removed, a
142
+ * volume's as "<name> (volume)".
143
+ */
144
+ sweepLeftovers({ labels, now, signal }?: {
145
+ labels?: Record<string, string>;
146
+ now?: Date;
147
+ signal?: AbortSignal;
148
+ }): Promise<Result<string[]>>;
149
+ network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
150
+ /**
151
+ * Stops or deletes the computer, then its egress proxy, found by its label (EGRESS_LABEL=<name>), and on delete its
152
+ * egress volume, found the same way: a container or volume of the proxy's name without that label is never touched.
153
+ * Each is ok when already gone.
154
+ */
155
+ release(ref: ComputerRef, how: "stop" | "delete"): Promise<Result<void>>;
156
+ }