@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.
- package/NOTICE +2 -0
- package/README.md +423 -323
- package/box/Dockerfile +3 -1
- package/box/agentrun-archil +59 -7
- package/box/build-agent37.mjs +177 -0
- package/box/build-daytona.py +20 -4
- package/dist/agent37.d.ts +165 -0
- package/dist/agent37.js +759 -0
- package/dist/attach.d.ts +146 -0
- package/dist/attach.js +469 -0
- package/dist/browser.d.ts +61 -10
- package/dist/browser.js +125 -3
- package/dist/browserbase.d.ts +46 -23
- package/dist/browserbase.js +162 -17
- package/dist/chrome.d.ts +3 -4
- package/dist/chrome.js +6 -11
- package/dist/client.d.ts +33 -1
- package/dist/client.js +53 -0
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/conformance/agent37.d.ts +96 -0
- package/dist/conformance/agent37.js +154 -0
- package/dist/conformance/cases/apps.d.ts +5 -0
- package/dist/conformance/cases/apps.js +160 -73
- package/dist/conformance/cases/health.js +14 -0
- package/dist/conformance/cases/index.js +2 -0
- package/dist/conformance/cases/provider.js +27 -1
- package/dist/conformance/cases/screen.d.ts +3 -0
- package/dist/conformance/cases/screen.js +18 -0
- package/dist/conformance/cases/settings.d.ts +29 -23
- package/dist/conformance/cases/settings.js +76 -58
- package/dist/conformance/cases/touch.js +19 -17
- package/dist/conformance/cases/ui.d.ts +2 -0
- package/dist/conformance/cases/ui.js +475 -0
- package/dist/conformance/cli.d.ts +9 -0
- package/dist/conformance/cli.js +28 -3
- package/dist/conformance/daytona.d.ts +4 -0
- package/dist/conformance/daytona.js +5 -0
- package/dist/conformance/e2b.d.ts +6 -0
- package/dist/conformance/e2b.js +9 -2
- package/dist/conformance/fixture.d.ts +1 -1
- package/dist/conformance/fixture.js +25 -1
- package/dist/conformance/modal.d.ts +17 -13
- package/dist/conformance/modal.js +18 -9
- package/dist/conformance/orgo.d.ts +3 -3
- package/dist/conformance/orgo.js +6 -8
- package/dist/conformance/phone-harness.d.ts +6 -2
- package/dist/conformance/phone-harness.js +21 -4
- package/dist/conformance/report.js +1 -1
- package/dist/conformance/runner.js +23 -4
- package/dist/conformance/sweep.d.ts +50 -0
- package/dist/conformance/sweep.js +187 -0
- package/dist/conformance/types.d.ts +11 -3
- package/dist/conformance/ui-fixture.d.ts +56 -0
- package/dist/conformance/ui-fixture.js +43 -0
- package/dist/create-requests.d.ts +51 -0
- package/dist/create-requests.js +121 -0
- package/dist/daytona.d.ts +15 -5
- package/dist/daytona.js +58 -38
- package/dist/descriptor.d.ts +29 -2
- package/dist/descriptor.js +13 -0
- package/dist/descriptors/agent37.d.ts +41 -0
- package/dist/descriptors/agent37.js +28 -0
- package/dist/descriptors/browserbase.d.ts +1 -0
- package/dist/descriptors/browserbase.js +2 -0
- package/dist/descriptors/daytona.d.ts +23 -2
- package/dist/descriptors/daytona.js +34 -2
- package/dist/descriptors/index.d.ts +66 -3
- package/dist/descriptors/index.js +5 -3
- package/dist/descriptors/kernel.d.ts +1 -0
- package/dist/descriptors/kernel.js +2 -0
- package/dist/descriptors/modal.d.ts +4 -0
- package/dist/descriptors/modal.js +11 -1
- package/dist/descriptors/orgo.d.ts +13 -1
- package/dist/descriptors/orgo.js +9 -3
- package/dist/descriptors/phone-harness.d.ts +6 -1
- package/dist/descriptors/phone-harness.js +5 -2
- package/dist/docker/egress.d.ts +4 -3
- package/dist/docker/egress.js +7 -6
- package/dist/docker.d.ts +7 -4
- package/dist/docker.js +278 -34
- package/dist/e2b.d.ts +9 -165
- package/dist/e2b.js +282 -1342
- package/dist/fake-ui-driver.d.ts +97 -0
- package/dist/fake-ui-driver.js +717 -0
- package/dist/host.d.ts +182 -0
- package/dist/host.js +1 -0
- package/dist/hosted/process.d.ts +67 -0
- package/dist/hosted/process.js +228 -0
- package/dist/hosted/provider.d.ts +146 -0
- package/dist/hosted/provider.js +1364 -0
- package/dist/hosted/scripts.d.ts +76 -0
- package/dist/{child.js → hosted/scripts.js} +93 -12
- package/dist/index.d.ts +11 -7
- package/dist/index.js +10 -7
- package/dist/janitor.d.ts +5 -4
- package/dist/janitor.js +1 -1
- package/dist/kernel.d.ts +17 -27
- package/dist/kernel.js +94 -18
- package/dist/kinds.d.ts +17 -5
- package/dist/kinds.js +20 -4
- package/dist/labels.d.ts +10 -2
- package/dist/labels.js +30 -7
- package/dist/local-chrome.d.ts +5 -5
- package/dist/local-chrome.js +10 -5
- package/dist/modal.d.ts +23 -181
- package/dist/modal.js +273 -1232
- package/dist/mount-archil.d.ts +25 -3
- package/dist/mount-archil.js +39 -8
- package/dist/orgo-channel.d.ts +3 -2
- package/dist/orgo-channel.js +5 -2
- package/dist/orgo-desktop.d.ts +23 -9
- package/dist/orgo-desktop.js +328 -66
- package/dist/orgo-names.d.ts +129 -3
- package/dist/orgo-names.js +211 -8
- package/dist/orgo-workspaces.d.ts +47 -0
- package/dist/orgo-workspaces.js +94 -0
- package/dist/orgo.d.ts +27 -10
- package/dist/orgo.js +411 -81
- package/dist/phone-harness.d.ts +31 -21
- package/dist/phone-harness.js +510 -681
- package/dist/png.d.ts +4 -0
- package/dist/png.js +27 -0
- package/dist/protocol.d.ts +338 -30
- package/dist/protocol.js +96 -3
- package/dist/provider.d.ts +97 -7
- package/dist/provider.js +24 -3
- package/dist/result.d.ts +1 -1
- package/dist/surface/api.d.ts +248 -0
- package/dist/surface/api.js +1 -0
- package/dist/surface/core.d.ts +42 -0
- package/dist/surface/core.js +393 -0
- package/dist/surface/index.d.ts +5 -0
- package/dist/surface/index.js +3 -0
- package/dist/surface/outline.d.ts +8 -0
- package/dist/surface/outline.js +50 -0
- package/dist/surface/script.d.ts +10 -0
- package/dist/surface/script.js +92 -0
- package/dist/ui-engine.d.ts +114 -0
- package/dist/ui-engine.js +798 -0
- package/package.json +17 -1
- package/dist/child.d.ts +0 -42
- package/dist/conformance/e2b-diagnose.d.ts +0 -16
- package/dist/conformance/e2b-diagnose.js +0 -61
- package/dist/conformance/e2b-sweep.d.ts +0 -18
- package/dist/conformance/e2b-sweep.js +0 -132
- package/dist/conformance/modal-sweep.d.ts +0 -22
- package/dist/conformance/modal-sweep.js +0 -213
package/dist/kinds.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DescriptorKey, DescriptorSetting, ParkedConfiguration, ProviderDescriptor } from "./descriptor.js";
|
|
1
|
+
import type { DescriptorKey, DescriptorSetting, HostCommand, ParkedConfiguration, ProviderDescriptor } from "./descriptor.js";
|
|
2
2
|
import type { MountKind } from "./mount.js";
|
|
3
|
-
import type { ComputerKind, Group } from "./protocol.js";
|
|
3
|
+
import type { ComputerKind, Group, HelloResult } from "./protocol.js";
|
|
4
4
|
import type { ComputerCapabilities, NetworkForm } from "./provider.js";
|
|
5
5
|
import type { Result } from "./result.js";
|
|
6
6
|
/**
|
|
@@ -23,17 +23,25 @@ export declare const SETTING_KINDS: Readonly<Record<ComputerSettingKind, Setting
|
|
|
23
23
|
export declare const SETTING_KIND_NAMES: ComputerSettingKind[];
|
|
24
24
|
/**
|
|
25
25
|
* The capabilities serves() and kindOf() read: one configuration a provider offers, with the GPUs it offers (Settings'
|
|
26
|
-
* GPU choice)
|
|
27
|
-
*
|
|
26
|
+
* GPU choice), and whether it keeps a computer for an agent (`persistence`, as its built provider declares it: Settings'
|
|
27
|
+
* persistent choice). In a descriptor, `image` is the name an agent's setting selects it by (Orgo's `windows`), the image
|
|
28
|
+
* its computer starts from, and `options` are what create() takes to build it ({ os: "windows" }), beside the keys. A
|
|
28
29
|
* configuration with no image is the one a setting that names none gets, as is the one whose image is the kind's
|
|
29
30
|
* defaultImage.
|
|
30
31
|
*/
|
|
31
|
-
export type KindCapabilities = Pick<ComputerCapabilities, "kind" | "groups" | "gpu"> & {
|
|
32
|
+
export type KindCapabilities = Pick<ComputerCapabilities, "kind" | "groups" | "gpu" | "persistence"> & {
|
|
32
33
|
readonly image?: string;
|
|
33
34
|
readonly options?: Readonly<Record<string, unknown>>;
|
|
34
35
|
};
|
|
35
36
|
/** Why capabilities do not serve a setting kind, in words; none when they do. */
|
|
36
37
|
export declare function servingRefusals(capabilities: KindCapabilities, kind: ComputerSettingKind): string[];
|
|
38
|
+
/**
|
|
39
|
+
* The groups a computer's hello must add to serve the setting kind its machine kind belongs to: the required groups
|
|
40
|
+
* hello.groups lacks, for the SETTING_KINDS entry whose machineKinds holds hello.kind. Empty when it serves that kind.
|
|
41
|
+
* A desktop that declares no input.pointer can't be given to an agent, so serve refuses it at connect and pairing, and
|
|
42
|
+
* health.kind-served fails a driver whose hello says so.
|
|
43
|
+
*/
|
|
44
|
+
export declare function kindServed(hello: Pick<HelloResult, "kind" | "groups">): Group[];
|
|
37
45
|
/** Whether a provider with these capabilities serves the kind: its machine kind is one of the kind's, and it declares every required group. */
|
|
38
46
|
export declare function serves(capabilities: KindCapabilities, kind: ComputerSettingKind): boolean;
|
|
39
47
|
/** The setting kind these capabilities serve, or undefined when they serve none. Machine kinds are apart, so at most one. */
|
|
@@ -74,6 +82,8 @@ export interface ProviderEntry {
|
|
|
74
82
|
readonly defaultImage?: Partial<Record<ComputerSettingKind, string>>;
|
|
75
83
|
/** Its built providers make or pull their image before the first create (prepareImage()). */
|
|
76
84
|
readonly prepareImage?: boolean;
|
|
85
|
+
/** The server's environment variable whose value, when set, is the image of every computer of it (descriptor.ts). */
|
|
86
|
+
readonly imageEnv?: string;
|
|
77
87
|
/** Its computers run on this machine's container engine. */
|
|
78
88
|
readonly local?: boolean;
|
|
79
89
|
/** create() takes a ledger the server keeps for it, as this option. */
|
|
@@ -82,6 +92,8 @@ export interface ProviderEntry {
|
|
|
82
92
|
};
|
|
83
93
|
/** The server's environment variables its provider reads on this machine, passed as options.env (descriptor.ts). */
|
|
84
94
|
readonly hostEnv?: readonly string[];
|
|
95
|
+
/** A program its computers need on this machine's PATH, and the machines it is built for (descriptor.ts). */
|
|
96
|
+
readonly hostCommand?: HostCommand;
|
|
85
97
|
/** Configurations it builds but does not offer yet, each with why: a setting naming one's image is refused as parked. */
|
|
86
98
|
readonly parked?: readonly ParkedConfiguration[];
|
|
87
99
|
}
|
package/dist/kinds.js
CHANGED
|
@@ -2,8 +2,8 @@ import { DESCRIPTORS } from "./descriptors/index.js";
|
|
|
2
2
|
export const SETTING_KINDS = {
|
|
3
3
|
none: { machineKinds: [], required: [], optional: [] },
|
|
4
4
|
sandbox: { machineKinds: ["linux"], required: ["exec", "files", "processes"], optional: [] },
|
|
5
|
-
desktop: { machineKinds: ["desktop"], required: ["screen", "input.pointer", "input.keys"], optional: ["exec", "files", "processes", "apps", "stream"] },
|
|
6
|
-
phone: { machineKinds: ["android", "ios"], required: ["screen", "input.touch", "apps"], optional: ["input.keys", "apps.install", "
|
|
5
|
+
desktop: { machineKinds: ["desktop"], required: ["screen", "input.pointer", "input.keys"], optional: ["exec", "files", "processes", "apps", "ui", "stream"] },
|
|
6
|
+
phone: { machineKinds: ["android", "ios"], required: ["screen", "input.touch", "apps"], optional: ["input.keys", "apps.install", "ui", "stream"] },
|
|
7
7
|
browser: { machineKinds: ["browser"], required: ["cdp"], optional: ["stream", "downloads"] },
|
|
8
8
|
};
|
|
9
9
|
/** Every setting kind, in the table's order. */
|
|
@@ -18,12 +18,28 @@ export function servingRefusals(capabilities, kind) {
|
|
|
18
18
|
const refusals = [];
|
|
19
19
|
if (!spec.machineKinds.includes(capabilities.kind))
|
|
20
20
|
refusals.push(`kind ${kind} is a ${spec.machineKinds.join(" or ")} machine, not a ${capabilities.kind} one`);
|
|
21
|
-
const
|
|
22
|
-
const missing = spec.required.filter((group) => !groups.includes(group));
|
|
21
|
+
const missing = missingGroups(spec, capabilities.groups);
|
|
23
22
|
if (missing.length > 0)
|
|
24
23
|
refusals.push(`kind ${kind} needs groups ${missing.join(", ")}, which the provider does not declare`);
|
|
25
24
|
return refusals;
|
|
26
25
|
}
|
|
26
|
+
/** The groups a setting kind requires that `groups` lacks; a groups that is no list lacks them all. */
|
|
27
|
+
function missingGroups(spec, groups) {
|
|
28
|
+
const declared = Array.isArray(groups) ? groups : [];
|
|
29
|
+
return spec.required.filter((group) => !declared.includes(group));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The groups a computer's hello must add to serve the setting kind its machine kind belongs to: the required groups
|
|
33
|
+
* hello.groups lacks, for the SETTING_KINDS entry whose machineKinds holds hello.kind. Empty when it serves that kind.
|
|
34
|
+
* A desktop that declares no input.pointer can't be given to an agent, so serve refuses it at connect and pairing, and
|
|
35
|
+
* health.kind-served fails a driver whose hello says so.
|
|
36
|
+
*/
|
|
37
|
+
export function kindServed(hello) {
|
|
38
|
+
const kind = SETTING_KIND_NAMES.find((name) => SETTING_KINDS[name].machineKinds.includes(hello.kind));
|
|
39
|
+
if (kind === undefined)
|
|
40
|
+
return [];
|
|
41
|
+
return missingGroups(SETTING_KINDS[kind], hello.groups);
|
|
42
|
+
}
|
|
27
43
|
/** Whether a provider with these capabilities serves the kind: its machine kind is one of the kind's, and it declares every required group. */
|
|
28
44
|
export function serves(capabilities, kind) {
|
|
29
45
|
return servingRefusals(capabilities, kind).length === 0;
|
package/dist/labels.d.ts
CHANGED
|
@@ -14,13 +14,21 @@ export declare const RUN_HASH_LABEL = "agentrun.run.hash";
|
|
|
14
14
|
export declare function runHash(run: string): string;
|
|
15
15
|
/** The agent a persistent computer belongs to, as agent:<id>. */
|
|
16
16
|
export declare const OWNER_LABEL = "agentrun.owner";
|
|
17
|
+
/** The server that agent is on, when the owner names one (owner.server). */
|
|
18
|
+
export declare const OWNER_SERVER_LABEL = "agentrun.owner-server";
|
|
17
19
|
/** The owner's idle TTL of a persistent computer, in milliseconds, in decimal: how long it may stay detached. */
|
|
18
20
|
export declare const IDLE_TTL_LABEL = "agentrun.idle-ttl-ms";
|
|
19
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The labels of an agent's computer: its owner, its server when the owner names one, and its idle TTL when the owner
|
|
23
|
+
* set one. Throws, in words, on an owner that is not one.
|
|
24
|
+
*/
|
|
20
25
|
export declare function ownerLabels(owner: ComputerOwner): Record<string, string>;
|
|
26
|
+
/** The labels an owner's listing filters by: its agent's, and its server's when it names one (no idle TTL). */
|
|
27
|
+
export declare function ownerFilter(owner: Pick<ComputerOwner, "agent" | "server">): Record<string, string>;
|
|
21
28
|
/**
|
|
22
29
|
* A computer's owner, read from its labels: undefined for a run's computer (no owner label). An owner label that is not
|
|
23
|
-
* agent:<id>, or an idle TTL that is not a decimal whole number above 0, is
|
|
30
|
+
* agent:<id>, a server label that is not a server id, or an idle TTL that is not a decimal whole number above 0, is
|
|
31
|
+
* invalid, in words naming what it reads.
|
|
24
32
|
*/
|
|
25
33
|
export declare function ownerOf(labels: Record<string, string> | undefined): Result<ComputerOwner | undefined>;
|
|
26
34
|
/**
|
package/dist/labels.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// (releaseOlder, in janitor.ts). Both names live here alone, with the run label's hash: a provider whose computers keep
|
|
4
4
|
// only that (Orgo's names) lists it under RUN_HASH_LABEL, so a caller can still tell whose run a computer is.
|
|
5
5
|
//
|
|
6
|
-
// An agent's persistent computer carries its owner as
|
|
7
|
-
// the owner's idle TTL when it set one. The run and epoch labels then name
|
|
6
|
+
// An agent's persistent computer carries its owner as more labels, set at create: agentrun.owner=agent:<id>, the
|
|
7
|
+
// agent's server when the owner names one, and the owner's idle TTL when it set one. The run and epoch labels then name
|
|
8
|
+
// the claim that holds it now.
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
9
10
|
import { epochProblem } from "./mount.js";
|
|
10
11
|
import { ownerProblem } from "./provider.js";
|
|
@@ -39,20 +40,35 @@ export function runHash(run) {
|
|
|
39
40
|
}
|
|
40
41
|
/** The agent a persistent computer belongs to, as agent:<id>. */
|
|
41
42
|
export const OWNER_LABEL = "agentrun.owner";
|
|
43
|
+
/** The server that agent is on, when the owner names one (owner.server). */
|
|
44
|
+
export const OWNER_SERVER_LABEL = "agentrun.owner-server";
|
|
42
45
|
/** The owner's idle TTL of a persistent computer, in milliseconds, in decimal: how long it may stay detached. */
|
|
43
46
|
export const IDLE_TTL_LABEL = "agentrun.idle-ttl-ms";
|
|
44
47
|
/** A whole number as a label holds it: decimal digits, no sign, no leading zero, no space. */
|
|
45
48
|
const DECIMAL = /^(?:0|[1-9][0-9]*)$/;
|
|
46
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The labels of an agent's computer: its owner, its server when the owner names one, and its idle TTL when the owner
|
|
51
|
+
* set one. Throws, in words, on an owner that is not one.
|
|
52
|
+
*/
|
|
47
53
|
export function ownerLabels(owner) {
|
|
48
54
|
const problem = ownerProblem(owner);
|
|
49
55
|
if (problem !== undefined)
|
|
50
56
|
throw new TypeError(problem);
|
|
51
|
-
return {
|
|
57
|
+
return {
|
|
58
|
+
[OWNER_LABEL]: `agent:${owner.agent}`,
|
|
59
|
+
...(owner.server === undefined ? {} : { [OWNER_SERVER_LABEL]: owner.server }),
|
|
60
|
+
...(owner.idleTtlMs === undefined ? {} : { [IDLE_TTL_LABEL]: String(owner.idleTtlMs) }),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The labels an owner's listing filters by: its agent's, and its server's when it names one (no idle TTL). */
|
|
64
|
+
export function ownerFilter(owner) {
|
|
65
|
+
const { [IDLE_TTL_LABEL]: _, ...labels } = ownerLabels({ agent: owner.agent, ...(owner.server === undefined ? {} : { server: owner.server }) });
|
|
66
|
+
return labels;
|
|
52
67
|
}
|
|
53
68
|
/**
|
|
54
69
|
* A computer's owner, read from its labels: undefined for a run's computer (no owner label). An owner label that is not
|
|
55
|
-
* agent:<id>, or an idle TTL that is not a decimal whole number above 0, is
|
|
70
|
+
* agent:<id>, a server label that is not a server id, or an idle TTL that is not a decimal whole number above 0, is
|
|
71
|
+
* invalid, in words naming what it reads.
|
|
56
72
|
*/
|
|
57
73
|
export function ownerOf(labels) {
|
|
58
74
|
if (typeof labels !== "object" || labels === null || Array.isArray(labels))
|
|
@@ -63,13 +79,20 @@ export function ownerOf(labels) {
|
|
|
63
79
|
const agent = typeof text === "string" && text.startsWith("agent:") ? text.slice("agent:".length) : undefined;
|
|
64
80
|
if (agent === undefined || ownerProblem({ agent }) !== undefined)
|
|
65
81
|
return fail("invalid", `the label ${OWNER_LABEL} reads ${JSON.stringify(text)}, not agent:<id>`);
|
|
82
|
+
let owner = { agent };
|
|
83
|
+
if (Object.hasOwn(labels, OWNER_SERVER_LABEL)) {
|
|
84
|
+
const server = labels[OWNER_SERVER_LABEL];
|
|
85
|
+
if (typeof server !== "string" || ownerProblem({ agent, server }) !== undefined)
|
|
86
|
+
return fail("invalid", `the label ${OWNER_SERVER_LABEL} reads ${JSON.stringify(server)}, not a server's id`);
|
|
87
|
+
owner = { agent, server };
|
|
88
|
+
}
|
|
66
89
|
if (!Object.hasOwn(labels, IDLE_TTL_LABEL))
|
|
67
|
-
return ok(
|
|
90
|
+
return ok(owner);
|
|
68
91
|
const ttl = labels[IDLE_TTL_LABEL];
|
|
69
92
|
const idleTtlMs = typeof ttl === "string" && DECIMAL.test(ttl) ? Number(ttl) : Number.NaN;
|
|
70
93
|
if (!(Number.isSafeInteger(idleTtlMs) && idleTtlMs > 0))
|
|
71
94
|
return fail("invalid", `the label ${IDLE_TTL_LABEL} reads ${JSON.stringify(ttl)}, not a whole number of milliseconds above 0`);
|
|
72
|
-
return ok({
|
|
95
|
+
return ok({ ...owner, idleTtlMs });
|
|
73
96
|
}
|
|
74
97
|
/** An epoch as a label holds it: decimal digits, no sign, no leading zero, no space. */
|
|
75
98
|
const EPOCH_TEXT = DECIMAL;
|
package/dist/local-chrome.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { KindCapabilities } from "./kinds.js";
|
|
2
2
|
import type { MountKind } from "./mount.js";
|
|
3
|
-
import type { AttachedComputer, CallContext, ComputerCapabilities, ComputerConnection, ComputerInfo, ComputerProvider, ComputerRef, ComputerSpec, CreatedComputer, NetworkPolicy, NetworkSpec, Refusal } from "./provider.js";
|
|
3
|
+
import type { AttachedComputer, CallContext, ComputerCapabilities, ComputerConnection, ComputerInfo, ComputerProvider, ComputerRef, ComputerSpec, CreateContext, CreatedComputer, NetworkPolicy, NetworkSpec, Refusal } from "./provider.js";
|
|
4
4
|
import { type Result } from "./result.js";
|
|
5
5
|
/** The longest a local browser lives: a day, as pi-browser's local Chrome. */
|
|
6
6
|
export declare const LOCAL_MAX_LIFETIME_MS: number;
|
|
@@ -40,16 +40,16 @@ export declare class LocalBrowserProvider implements ComputerProvider {
|
|
|
40
40
|
* A browser: our supervisor ends it at its deadline, and list reads that deadline, so the janitor sweeps one whose
|
|
41
41
|
* supervisor is gone (lifetime janitor); it reaches public addresses only, through its egress proxy (network open), or
|
|
42
42
|
* only a list's hosts among them (network allow);
|
|
43
|
-
* it runs on this host, as this user, isolated by Chrome's sandbox alone (isolation host).
|
|
43
|
+
* it runs on this host, as this user, isolated by Chrome's sandbox alone (isolation host). Its sessions (browser) end
|
|
44
|
+
* at their deadline, a wall clock, and take a viewport (spec.browser.viewport, its window); no profile, no stealth,
|
|
45
|
+
* and headless is the provider's option, not a session's.
|
|
44
46
|
*/
|
|
45
47
|
capabilities(): ComputerCapabilities;
|
|
46
48
|
/** The Chrome this provider runs: the option's, else one found; null when there is none. */
|
|
47
49
|
executable(): string | null;
|
|
48
50
|
check(spec: ComputerSpec): Refusal[];
|
|
49
51
|
/** Starts Chrome under a supervisor of its own, waits until its DevTools socket answers, and hands back its ref. */
|
|
50
|
-
create(spec: ComputerSpec,
|
|
51
|
-
signal?: AbortSignal;
|
|
52
|
-
}): Promise<Result<CreatedComputer>>;
|
|
52
|
+
create(spec: ComputerSpec, context: CreateContext): Promise<Result<CreatedComputer>>;
|
|
53
53
|
/**
|
|
54
54
|
* Settings' test: finds the Chrome and starts it once, headless, on a blank page, with its sandbox on (chrome.ts
|
|
55
55
|
* checkChrome), with a proxy that reaches nothing. No browser is kept and no key is read; no Chrome, root, or a Chrome
|
package/dist/local-chrome.js
CHANGED
|
@@ -27,7 +27,7 @@ import { lstat, mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises
|
|
|
27
27
|
import { tmpdir } from "node:os";
|
|
28
28
|
import { join, resolve } from "node:path";
|
|
29
29
|
import { fileURLToPath } from "node:url";
|
|
30
|
-
import { browserClient, browserHello, carries, labelsProblem } from "./browser.js";
|
|
30
|
+
import { browserClient, browserHello, browserSpecRefusals, carries, labelsProblem } from "./browser.js";
|
|
31
31
|
import { alive, answeringPath, CHROME_FLAGS, checkChrome, findChrome, killTree, NO_CHROME, AS_ROOT, runsWith, singletonDir } from "./chrome.js";
|
|
32
32
|
import { LOCAL } from "./descriptors/local-chrome.js";
|
|
33
33
|
import { BROWSER_IMAGE } from "./descriptors/shared.js";
|
|
@@ -80,7 +80,7 @@ export const CAPABILITIES = LOCAL.capabilities;
|
|
|
80
80
|
const ID = /^lb-[0-9a-f]{16}$/;
|
|
81
81
|
const idProblem = (id) => (typeof id === "string" && ID.test(id) ? undefined : `${typeof id === "string" ? JSON.stringify(id) : String(id)} is not a local browser's id`);
|
|
82
82
|
const refOf = (id) => ({ id, name: id });
|
|
83
|
-
const SPEC_FIELDS = new Set(["image", "lifetimeMs", "network", "labels"]);
|
|
83
|
+
const SPEC_FIELDS = new Set(["image", "lifetimeMs", "network", "labels", "browser"]);
|
|
84
84
|
const sleep = (ms) => new Promise((done) => setTimeout(done, ms));
|
|
85
85
|
const readJson = async (file) => {
|
|
86
86
|
try {
|
|
@@ -112,7 +112,9 @@ export class LocalBrowserProvider {
|
|
|
112
112
|
* A browser: our supervisor ends it at its deadline, and list reads that deadline, so the janitor sweeps one whose
|
|
113
113
|
* supervisor is gone (lifetime janitor); it reaches public addresses only, through its egress proxy (network open), or
|
|
114
114
|
* only a list's hosts among them (network allow);
|
|
115
|
-
* it runs on this host, as this user, isolated by Chrome's sandbox alone (isolation host).
|
|
115
|
+
* it runs on this host, as this user, isolated by Chrome's sandbox alone (isolation host). Its sessions (browser) end
|
|
116
|
+
* at their deadline, a wall clock, and take a viewport (spec.browser.viewport, its window); no profile, no stealth,
|
|
117
|
+
* and headless is the provider's option, not a session's.
|
|
116
118
|
*/
|
|
117
119
|
capabilities() {
|
|
118
120
|
return {
|
|
@@ -125,6 +127,7 @@ export class LocalBrowserProvider {
|
|
|
125
127
|
groups: [...CAPABILITIES[0].groups],
|
|
126
128
|
maxLifetimeMs: LOCAL_MAX_LIFETIME_MS,
|
|
127
129
|
release: ["delete"],
|
|
130
|
+
browser: { timeout: "wall-clock" },
|
|
128
131
|
};
|
|
129
132
|
}
|
|
130
133
|
/** The Chrome this provider runs: the option's, else one found; null when there is none. */
|
|
@@ -153,6 +156,7 @@ export class LocalBrowserProvider {
|
|
|
153
156
|
const net = browserNetworkOf(network);
|
|
154
157
|
if ("problem" in net)
|
|
155
158
|
refusals.push({ field: "network", message: net.problem });
|
|
159
|
+
refusals.push(...browserSpecRefusals(given.browser, { timeout: "wall-clock" }, LOCAL.label));
|
|
156
160
|
if (labels !== undefined) {
|
|
157
161
|
const problem = labelsProblem(labels);
|
|
158
162
|
if (problem)
|
|
@@ -184,7 +188,8 @@ export class LocalBrowserProvider {
|
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
190
|
/** Starts Chrome under a supervisor of its own, waits until its DevTools socket answers, and hands back its ref. */
|
|
187
|
-
async create(spec,
|
|
191
|
+
async create(spec, context) {
|
|
192
|
+
const signal = context?.signal;
|
|
188
193
|
const refusals = this.check(spec);
|
|
189
194
|
if (refusals.length > 0)
|
|
190
195
|
return fail(refusals.some((r) => r.field === "image" && r.message.endsWith(NO_CHROME)) ? "not_found" : "refused", refusals.map(({ field, message }) => `${field}: ${message}`).join("; "));
|
|
@@ -205,7 +210,7 @@ export class LocalBrowserProvider {
|
|
|
205
210
|
created: new Date(now).toISOString(),
|
|
206
211
|
deadline: new Date(now + runLifetimeMs(spec)).toISOString(),
|
|
207
212
|
executablePath: this.executable(),
|
|
208
|
-
args: [...CHROME_FLAGS, ...(this.#headed ? [] : ["--headless=new"]), WINDOW],
|
|
213
|
+
args: [...CHROME_FLAGS, ...(this.#headed ? [] : ["--headless=new"]), spec.browser?.viewport ? `--window-size=${spec.browser.viewport.width},${spec.browser.viewport.height}` : WINDOW],
|
|
209
214
|
...networkRecord(spec.network),
|
|
210
215
|
};
|
|
211
216
|
try {
|
package/dist/modal.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { HostedProvider, type HostedOptions, type HostedTimeouts } from "./hosted/provider.js";
|
|
1
2
|
import type { KindCapabilities } from "./kinds.js";
|
|
2
|
-
import {
|
|
3
|
-
import { type ProviderNote } from "./mount-archil.js";
|
|
4
|
-
import { type AttachedComputer, type CallContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type CreatedComputer, type NetworkPolicy, type NetworkSpec, type Refusal, type ReleaseHow } from "./provider.js";
|
|
5
|
-
import { type Result } from "./result.js";
|
|
6
|
-
import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
|
|
3
|
+
import type { MountKind } from "./mount.js";
|
|
7
4
|
/** The App sandboxes are made in (modal-client@64880502:js/src/app.ts:32-61). */
|
|
8
5
|
export interface ModalApp {
|
|
9
6
|
readonly appId: string;
|
|
@@ -50,13 +47,6 @@ export interface ModalSandbox {
|
|
|
50
47
|
poll(): Promise<number | null>;
|
|
51
48
|
getTags(): Promise<Record<string, string>>;
|
|
52
49
|
terminate(): Promise<void>;
|
|
53
|
-
/** The sandbox's own command's output (the SDK's ModalReadStream): read only to say why a create's sandbox ended. */
|
|
54
|
-
readonly stdout?: {
|
|
55
|
-
readText(): Promise<string>;
|
|
56
|
-
};
|
|
57
|
-
readonly stderr?: {
|
|
58
|
-
readText(): Promise<string>;
|
|
59
|
-
};
|
|
60
50
|
}
|
|
61
51
|
/** The part of the SDK's ModalClient this provider calls. The host passes its own client. */
|
|
62
52
|
export interface ModalSdk {
|
|
@@ -79,66 +69,15 @@ export interface ModalSdk {
|
|
|
79
69
|
}): AsyncIterable<ModalSandbox>;
|
|
80
70
|
};
|
|
81
71
|
}
|
|
82
|
-
/** The
|
|
83
|
-
export interface
|
|
84
|
-
/** sandboxes.create, which builds the image layer and waits for the sandbox to be scheduled. */
|
|
85
|
-
createMs: number;
|
|
86
|
-
/** Every other SDK call: apps.fromName, fromId, getTags, poll, terminate, exec's start. */
|
|
87
|
-
callMs: number;
|
|
88
|
-
/** A new connection, from the start of the bridge's exec (at most callMs of it) to the daemon's hello. */
|
|
89
|
-
helloMs: number;
|
|
90
|
-
/** The probe, run through the daemon. */
|
|
91
|
-
probeMs: number;
|
|
92
|
-
/** One whole list, every page and every sandbox's tags. */
|
|
93
|
-
listMs: number;
|
|
94
|
-
/** The daemon's upload, from the exec's start to its exit. The entrypoint waits this long and one call more. */
|
|
95
|
-
uploadMs: number;
|
|
96
|
-
/**
|
|
97
|
-
* How long release delete, and a create that refuses its sandbox (drift, an abort, a failed upload), wait after the
|
|
98
|
-
* terminate for poll to read the sandbox finished: Modal ends a sandbox asynchronously, and lists it until then. Each
|
|
99
|
-
* wait also ends on the caller's abort.
|
|
100
|
-
*/
|
|
101
|
-
releaseMs: number;
|
|
102
|
-
/** The first pause between two of those polls; the pauses double up to 5 s. */
|
|
103
|
-
releasePollMs: number;
|
|
104
|
-
/**
|
|
105
|
-
* How long a create whose sandbox Modal says is shutting down on its own (its command, init, exited) waits for poll to
|
|
106
|
-
* read it finished, to give the command's exit code and words in its failure.
|
|
107
|
-
*/
|
|
108
|
-
endedMs: number;
|
|
109
|
-
/** Each root step of an Archil mount through exec (the preflight, mount or revoke, serve), and its checkin at release. */
|
|
110
|
-
mountMs: number;
|
|
111
|
-
}
|
|
112
|
-
export interface ModalProviderOptions {
|
|
72
|
+
/** The Modal provider's options: the client and the app, then the shared adapter's (HostedOptions). */
|
|
73
|
+
export interface ModalProviderOptions extends Omit<HostedOptions, "label" | "kind" | "desktop" | "maxLifetimeMs"> {
|
|
113
74
|
/** The host's Modal client, or anything with the same slice. */
|
|
114
75
|
sdk: ModalSdk;
|
|
115
|
-
/** Told what is no failure of the call it came from: a release that did not let an Archil folder go cleanly. */
|
|
116
|
-
onNote?: ProviderNote;
|
|
117
76
|
/** The Modal App the sandboxes live in; made when missing. */
|
|
118
77
|
app: string;
|
|
119
|
-
/**
|
|
120
|
-
* A registry image holding the daemon for linux/amd64 at /computerd, pinned by digest (name@sha256:<64 hex>), copied
|
|
121
|
-
* into each computer's image with COPY --from. Without it the daemon is uploaded (daemonPath).
|
|
122
|
-
*/
|
|
123
|
-
daemonImage?: string;
|
|
124
|
-
/**
|
|
125
|
-
* The daemon binary for linux/amd64 on this machine, streamed into each computer right after create when no
|
|
126
|
-
* daemonImage is given. Default this package's dist/computerd-linux-amd64 (npm run build:daemon).
|
|
127
|
-
*/
|
|
128
|
-
daemonPath?: string;
|
|
129
|
-
/** The longest lifetime check takes, in ms, declared as capabilities().maxLifetimeMs: at most 24 hours, Modal's longest timeout, which is the default. */
|
|
78
|
+
/** The longest lifetime check takes, in ms: at most 24 hours, Modal's longest timeout, which is the default. */
|
|
130
79
|
maxLifetimeMs?: number;
|
|
131
|
-
|
|
132
|
-
* Who a computer runs as when its spec does not say: uid:gid in numbers, never root or root's group. Default 2510:2510
|
|
133
|
-
* (TOOL_USER). Init refuses to start while another process in the sandbox holds the uid.
|
|
134
|
-
*/
|
|
135
|
-
user?: string;
|
|
136
|
-
timeouts?: Partial<ModalTimeouts>;
|
|
137
|
-
/**
|
|
138
|
-
* The addresses the probe tries, to show none of them answers a computer with network none: host:port over TCP, or
|
|
139
|
-
* host:port/udp, a DNS query over UDP.
|
|
140
|
-
*/
|
|
141
|
-
probeTargets?: string[];
|
|
80
|
+
timeouts?: Partial<HostedTimeouts>;
|
|
142
81
|
}
|
|
143
82
|
/** The mount kinds a Modal computer takes, as capabilities().mount declares them: the run's folder on an Archil disk. */
|
|
144
83
|
export declare const MOUNT: readonly MountKind[];
|
|
@@ -185,126 +124,29 @@ export interface ModalCreateOptions extends Omit<ModalProviderOptions, "sdk">, M
|
|
|
185
124
|
*/
|
|
186
125
|
export declare function modalClient({ tokenId, tokenSecret, serverUrl, ModalClient }: ModalClientOptions): Promise<ModalSdk>;
|
|
187
126
|
/**
|
|
188
|
-
* A ModalProvider from its options alone: the client as modalClient makes it from the token and server passed in,
|
|
189
|
-
* app (required)
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* AGENTRUN_BOX_APP, the conformance module the settings it reads. The app and the token are checked before any client
|
|
193
|
-
* is made, and neither is ever echoed.
|
|
127
|
+
* A ModalProvider from its options alone: the client as modalClient makes it from the token and server passed in, and
|
|
128
|
+
* the app (required). It reads no environment but the guard modalClient keeps: serve passes its MODAL_TOKEN_ID,
|
|
129
|
+
* MODAL_TOKEN_SECRET and AGENTRUN_BOX_APP, the conformance module the settings it reads. The app and the token are
|
|
130
|
+
* checked before any client is made, and neither is ever echoed.
|
|
194
131
|
*/
|
|
195
132
|
export declare function create(options: ModalCreateOptions): Promise<ModalProvider>;
|
|
196
133
|
/** The conformance CLI's module for Modal: its live switch, the run's 30-minute cap and the drifted twin. */
|
|
197
134
|
export declare const conformance: () => Promise<typeof import("./conformance/modal.js")>;
|
|
198
135
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
|
|
202
|
-
export declare const ARCHIL_GATE = "/opt/agentrun/archil-mounted";
|
|
203
|
-
/**
|
|
204
|
-
* The commands the provider sends into a sandbox when it uploads the daemon, exactly: the sandbox's command
|
|
205
|
-
* (entrypoint, which also waits for `gate` when given: an Archil computer's), the upload, and a connection's bridge
|
|
206
|
-
* (stdio). Exported so a test can run them where Modal would.
|
|
207
|
-
*/
|
|
208
|
-
export declare function modalCommands({ deadline, user, waitSeconds, sha256, daemon, home, gate, }?: {
|
|
209
|
-
deadline?: string;
|
|
210
|
-
user?: string;
|
|
211
|
-
waitSeconds?: number;
|
|
212
|
-
sha256?: string;
|
|
213
|
-
daemon?: string;
|
|
214
|
-
home?: string;
|
|
215
|
-
gate?: string;
|
|
216
|
-
}): {
|
|
217
|
-
entrypoint: string[];
|
|
218
|
-
upload: string[];
|
|
219
|
-
hold: string[];
|
|
220
|
-
stdio: string[];
|
|
221
|
-
};
|
|
222
|
-
export interface UntilFinishedOptions {
|
|
223
|
-
/** The sandbox in words, for the errors, such as its name or id. */
|
|
224
|
-
name: string;
|
|
225
|
-
/** The longest the whole wait takes, in ms. */
|
|
226
|
-
boundMs: number;
|
|
227
|
-
/** The longest one poll may take, in ms. */
|
|
228
|
-
callMs: number;
|
|
229
|
-
/** The first pause between two polls, in ms; each pause doubles up to maxMs. */
|
|
230
|
-
minMs: number;
|
|
231
|
-
/** The longest pause between two polls, in ms. */
|
|
232
|
-
maxMs: number;
|
|
233
|
-
/** Ends the wait early, as aborted; a wait that must finish whatever its caller does is given none. */
|
|
234
|
-
signal?: AbortSignal;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* The one wait after a terminate, which returns before Modal has ended the sandbox (sandbox.ts:1292-1296, 2238-2251):
|
|
238
|
-
* polls through waitUntil until poll reads an exit code (null while it runs, sandbox.ts:2761-2771) or Modal no longer
|
|
239
|
-
* knows the sandbox. Past boundMs it is a timeout, and on the signal's abort an abort, each saying what poll last read;
|
|
240
|
-
* it never reports a sandbox finished that it did not read finished. release delete, a create that refuses its
|
|
241
|
-
* sandbox, and modal-sweep --after all wait through it.
|
|
136
|
+
* The tags a sandbox carries for a machine's labels. Every label is its own tag, with one exception that keeps an
|
|
137
|
+
* Archil computer within Modal's 512 bytes: the mount label's folder, agents/<agent>/runs/<run>/work, names the run its
|
|
138
|
+
* agentrun.run label holds, so the tag records the agent alone, and labelsOf puts the folder back.
|
|
242
139
|
*/
|
|
243
|
-
export declare function
|
|
140
|
+
export declare function tagsOf(labels: Record<string, string>): Record<string, string>;
|
|
141
|
+
/** A sandbox's labels from its tags: tagsOf undone. */
|
|
142
|
+
export declare function labelsOf(tags: Record<string, string>): Record<string, string>;
|
|
244
143
|
/**
|
|
245
|
-
* Computers that are Modal sandboxes on the VM runtime, or on gVisor with a GPU. The daemon is
|
|
246
|
-
* exec's stdin, while the sandbox's command,
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
* network policy back, so the daemon's probe stands for one: network none is honoured only when none of its addresses
|
|
251
|
-
* answers (an address that accepts and sends nothing back is named in the read-back's notes), and an allowlist is
|
|
252
|
-
* refused until the live bypass cases pass.
|
|
144
|
+
* Computers that are Modal sandboxes on the VM runtime, or on gVisor with a GPU, on the shared adapter. The daemon is
|
|
145
|
+
* streamed in through an exec's stdin right after create, while the sandbox's command, the entrypoint, waits for it and
|
|
146
|
+
* then becomes `computerd init`. A connection is `computerd stdio` through exec, so a computer with network none is still
|
|
147
|
+
* reached. Modal ends each sandbox at its timeout, so the lifetime is the vendor's. A spec may size a computer (cpus,
|
|
148
|
+
* memoryMb) and name the uid its programs run as, never root.
|
|
253
149
|
*/
|
|
254
|
-
export declare class ModalProvider
|
|
255
|
-
|
|
256
|
-
readonly id = "modal";
|
|
257
|
-
readonly version: string;
|
|
258
|
-
constructor({ sdk, app, daemonImage, daemonPath, maxLifetimeMs, user, timeouts, probeTargets, onNote }: ModalProviderOptions);
|
|
259
|
-
/**
|
|
260
|
-
* daemon pid1: the sandbox's command is init itself (with daemonImage) or the entrypoint that execs into it, and Modal
|
|
261
|
-
* finishes the sandbox when that main process exits (sandbox.ts:384-388), so init's exit ends the computer. Whether
|
|
262
|
-
* Modal gives that process the number 1 is not documented; init reaps as a subreaper either way. maxLifetimeMs is this
|
|
263
|
-
* instance's cap: Modal's 24 hours unless the provider was made with less. Init starts with --own-network whatever
|
|
264
|
-
* Modal runs in the sandbox (no listener of its own there is documented, so no port is declared), and network none is
|
|
265
|
-
* all a computer takes until a proxy carries open out of the daemon's own network.
|
|
266
|
-
*/
|
|
267
|
-
capabilities(): ComputerCapabilities;
|
|
268
|
-
check(spec: ComputerSpec): Refusal[];
|
|
269
|
-
create(spec: ComputerSpec, { signal }?: CallContext): Promise<Result<CreatedComputer>>;
|
|
270
|
-
/**
|
|
271
|
-
* Settings' test: the provider's app read without making it (createIfMissing false), which makes nothing. An app not
|
|
272
|
-
* made yet is a connection all the same: the token was taken, and the first computer makes the app.
|
|
273
|
-
*/
|
|
274
|
-
testConnection({ signal }?: CallContext): Promise<Result<{
|
|
275
|
-
detail: string;
|
|
276
|
-
}>>;
|
|
277
|
-
/** The live view: screen.watch on a connection of the watch's own (daemonWatch); a sandbox has no screen. */
|
|
278
|
-
watch(ref: ComputerRef, handlers: ScreenWatchHandlers, options?: WatchOptions): Promise<Result<ScreenWatch>>;
|
|
279
|
-
connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
|
|
280
|
-
attach(ref: {
|
|
281
|
-
id: string;
|
|
282
|
-
} | {
|
|
283
|
-
labels: Record<string, string>;
|
|
284
|
-
}, { signal }?: CallContext): Promise<Result<AttachedComputer>>;
|
|
285
|
-
/**
|
|
286
|
-
* Every running computer this provider made that carries all of these labels. Modal's list asks for running sandboxes
|
|
287
|
-
* only (includeFinished: false, sandbox.ts:1135-1140), yet a sandbox terminated a moment ago is still listed: each one
|
|
288
|
-
* listed is polled, and one that poll reads finished (an exit code, not null, sandbox.ts:2761-2771) or no longer
|
|
289
|
-
* finds is left out.
|
|
290
|
-
*/
|
|
291
|
-
list(labels: Record<string, string>, { signal }?: CallContext): Promise<Result<ComputerInfo[]>>;
|
|
292
|
-
/**
|
|
293
|
-
* Modal reads no policy back. Open is open, nothing being wider; none is read back by the probe from inside, and is
|
|
294
|
-
* another network in words when any of its addresses answered (an address that only accepted, and sent nothing back,
|
|
295
|
-
* leaves it none). A change is refused: it is fixed at create.
|
|
296
|
-
*/
|
|
297
|
-
network(ref: ComputerRef, policy?: NetworkSpec, { signal }?: CallContext): Promise<Result<NetworkPolicy>>;
|
|
298
|
-
/**
|
|
299
|
-
* delete terminates, and is idempotent: a sandbox already finished, or one Modal no longer knows, is ok. Modal ends a
|
|
300
|
-
* sandbox asynchronously (terminate returns before it has finished unless asked to wait, sandbox.ts:1292-1296 and
|
|
301
|
-
* 2238-2251), so delete then polls through untilFinished, as a refusing create does, with pauses that double from
|
|
302
|
-
* releasePollMs to 5 s, until poll reads an exit code (null while it runs, sandbox.ts:2761-2771) or Modal no longer
|
|
303
|
-
* knows it, within releaseMs and the caller's signal. Past releaseMs it is a timeout that says what poll last read,
|
|
304
|
-
* never done. An Archil computer that still runs lets go of the run's folder first (archilRelease: the final sync
|
|
305
|
-
* through computerd, then checkin as root); the terminate runs whatever that answers. A folder not let go cleanly
|
|
306
|
-
* loses nothing (every call that changed it synced, and the next claim revokes the hold), so it is said through
|
|
307
|
-
* onNote, and the release succeeds once the sandbox is gone.
|
|
308
|
-
*/
|
|
309
|
-
release(ref: ComputerRef, how: ReleaseHow, { signal }?: CallContext): Promise<Result<void>>;
|
|
150
|
+
export declare class ModalProvider extends HostedProvider {
|
|
151
|
+
constructor(options: ModalProviderOptions);
|
|
310
152
|
}
|