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

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 (112) hide show
  1. package/README.md +308 -36
  2. package/dist/browser.d.ts +13 -14
  3. package/dist/browser.js +22 -17
  4. package/dist/browserbase.d.ts +3 -3
  5. package/dist/browserbase.js +16 -11
  6. package/dist/child.d.ts +2 -0
  7. package/dist/child.js +13 -2
  8. package/dist/chrome.d.ts +73 -0
  9. package/dist/chrome.js +224 -0
  10. package/dist/computerd-linux-amd64 +0 -0
  11. package/dist/computerd-linux-arm64 +0 -0
  12. package/dist/conformance/browserbase.js +1 -1
  13. package/dist/conformance/cases/gpu.d.ts +2 -0
  14. package/dist/conformance/cases/gpu.js +108 -0
  15. package/dist/conformance/cases/health.js +83 -3
  16. package/dist/conformance/cases/index.js +2 -0
  17. package/dist/conformance/cases/mount.d.ts +8 -1
  18. package/dist/conformance/cases/mount.js +4 -3
  19. package/dist/conformance/cases/provider.js +92 -3
  20. package/dist/conformance/cli.js +46 -7
  21. package/dist/conformance/daytona.js +2 -1
  22. package/dist/conformance/e2b.js +2 -1
  23. package/dist/conformance/fixture.js +24 -2
  24. package/dist/conformance/kernel.js +1 -1
  25. package/dist/conformance/kind.js +2 -1
  26. package/dist/conformance/local-chrome.d.ts +30 -0
  27. package/dist/conformance/local-chrome.js +36 -0
  28. package/dist/conformance/orgo.d.ts +11 -5
  29. package/dist/conformance/orgo.js +37 -8
  30. package/dist/conformance/phone-harness.js +2 -1
  31. package/dist/conformance/report.js +13 -7
  32. package/dist/conformance/runner.js +68 -18
  33. package/dist/conformance/types.d.ts +78 -18
  34. package/dist/conformance/types.js +10 -0
  35. package/dist/conformance/windows-fixture.d.ts +1 -0
  36. package/dist/conformance/windows-fixture.js +37 -0
  37. package/dist/daytona.d.ts +4 -6
  38. package/dist/daytona.js +97 -52
  39. package/dist/descriptor.d.ts +94 -0
  40. package/dist/descriptor.js +81 -0
  41. package/dist/descriptors/browserbase.d.ts +24 -0
  42. package/dist/descriptors/browserbase.js +18 -0
  43. package/dist/descriptors/daytona.d.ts +62 -0
  44. package/dist/descriptors/daytona.js +49 -0
  45. package/dist/descriptors/docker.d.ts +12 -0
  46. package/dist/descriptors/docker.js +17 -0
  47. package/dist/descriptors/e2b.d.ts +22 -0
  48. package/dist/descriptors/e2b.js +19 -0
  49. package/dist/descriptors/index.d.ts +229 -0
  50. package/dist/descriptors/index.js +19 -0
  51. package/dist/descriptors/kernel.d.ts +20 -0
  52. package/dist/descriptors/kernel.js +15 -0
  53. package/dist/descriptors/local-chrome.d.ts +17 -0
  54. package/dist/descriptors/local-chrome.js +21 -0
  55. package/dist/descriptors/modal.d.ts +50 -0
  56. package/dist/descriptors/modal.js +38 -0
  57. package/dist/descriptors/orgo.d.ts +88 -0
  58. package/dist/descriptors/orgo.js +44 -0
  59. package/dist/descriptors/phone-harness.d.ts +28 -0
  60. package/dist/descriptors/phone-harness.js +20 -0
  61. package/dist/descriptors/shared.d.ts +7 -0
  62. package/dist/descriptors/shared.js +6 -0
  63. package/dist/desktop.d.ts +4 -4
  64. package/dist/desktop.js +4 -4
  65. package/dist/docker/egress.d.ts +1 -1
  66. package/dist/docker/image.js +17 -15
  67. package/dist/docker/inspect.d.ts +147 -0
  68. package/dist/docker/inspect.js +335 -0
  69. package/dist/docker.d.ts +6 -4
  70. package/dist/docker.js +53 -41
  71. package/dist/drift.d.ts +6 -146
  72. package/dist/drift.js +14 -334
  73. package/dist/e2b.d.ts +2 -6
  74. package/dist/e2b.js +19 -22
  75. package/dist/index.d.ts +9 -10
  76. package/dist/index.js +14 -10
  77. package/dist/isolation.d.ts +0 -2
  78. package/dist/isolation.js +2 -18
  79. package/dist/janitor.d.ts +18 -1
  80. package/dist/janitor.js +67 -19
  81. package/dist/kernel.d.ts +3 -3
  82. package/dist/kernel.js +19 -14
  83. package/dist/kinds.d.ts +56 -30
  84. package/dist/kinds.js +19 -97
  85. package/dist/labels.d.ts +18 -0
  86. package/dist/labels.js +65 -2
  87. package/dist/local-chrome.d.ts +86 -0
  88. package/dist/local-chrome.js +475 -0
  89. package/dist/local-supervisor.d.ts +51 -0
  90. package/dist/local-supervisor.js +221 -0
  91. package/dist/modal.d.ts +15 -7
  92. package/dist/modal.js +83 -39
  93. package/dist/mount-archil.js +4 -4
  94. package/dist/orgo-channel.js +16 -13
  95. package/dist/orgo-desktop.d.ts +153 -0
  96. package/dist/orgo-desktop.js +1614 -0
  97. package/dist/orgo-names.d.ts +52 -0
  98. package/dist/orgo-names.js +84 -0
  99. package/dist/orgo.d.ts +18 -13
  100. package/dist/orgo.js +54 -128
  101. package/dist/phone-harness.d.ts +4 -8
  102. package/dist/phone-harness.js +48 -46
  103. package/dist/protocol.d.ts +20 -0
  104. package/dist/protocol.js +9 -0
  105. package/dist/provider.d.ts +151 -10
  106. package/dist/provider.js +70 -0
  107. package/dist/providers.d.ts +22 -17
  108. package/dist/providers.js +14 -16
  109. package/dist/result.d.ts +11 -1
  110. package/dist/result.js +11 -0
  111. package/dist/test-connection.js +2 -2
  112. package/package.json +42 -2
package/dist/kinds.js CHANGED
@@ -1,17 +1,4 @@
1
- // The kind registry: the computer an agent is given, its setting kind, and the providers Settings offers for it. Two
2
- // axes: the machine kind is the protocol's (capabilities().kind, KIND_SHAPES); the setting kind is what an agent is
3
- // given in Settings, `computer: { kind, provider? }`, as machine kinds and capability groups. Whether a provider serves
4
- // a setting kind is computed from its capabilities alone (serves), never kept beside them: a provider that drops a
5
- // group stops serving the kind. The model's tools are not here: they live in the kernel's tool registry, keyed by
6
- // these groups.
7
- // The default images are values: each from the provider module that owns it. Those modules import this one for types
8
- // alone, so this is no import cycle.
9
- import { BROWSER_IMAGE } from "./browser.js";
10
- import { DAYTONA_DEFAULT_SNAPSHOT } from "./daytona.js";
11
- import { E2B_BASE_TEMPLATE, E2B_DESKTOP_TEMPLATE } from "./e2b.js";
12
- import { MODAL_DEFAULT_IMAGE } from "./modal.js";
13
- import { ORGO_BASE_IMAGE } from "./orgo.js";
14
- import { PHONE_IMAGE } from "./phone-harness.js";
1
+ import { DESCRIPTORS } from "./descriptors/index.js";
15
2
  export const SETTING_KINDS = {
16
3
  none: { machineKinds: [], required: [], optional: [] },
17
4
  sandbox: { machineKinds: ["linux"], required: ["exec", "files", "processes"], optional: [] },
@@ -45,89 +32,24 @@ export function serves(capabilities, kind) {
45
32
  export function kindOf(capabilities) {
46
33
  return SETTING_KIND_NAMES.find((kind) => serves(capabilities, kind));
47
34
  }
48
- const SANDBOX = { kind: "linux", groups: ["exec", "files", "processes"] };
49
- const LINUX_DESKTOP = { kind: "desktop", groups: ["exec", "files", "processes", "screen", "input.pointer", "input.keys"] };
50
- /** An entry with its kinds derived from its capabilities. */
51
- function entry(fields) {
52
- return { ...fields, kinds: SETTING_KIND_NAMES.filter((kind) => fields.capabilities.some((one) => serves(one, kind))) };
35
+ /** The images a kind's configurations offer by name (`serving`: those that serve it), the kind's default first when it is one. */
36
+ export function imagesOf(serving, defaultImage) {
37
+ const names = [...new Set(serving.flatMap((one) => (one.image === undefined ? [] : [one.image])))];
38
+ return defaultImage !== undefined && names.includes(defaultImage) ? [defaultImage, ...names.filter((name) => name !== defaultImage)] : names;
53
39
  }
54
40
  /**
55
- * Every provider Settings offers, each with its provider file in the registry;
56
- * a unit test then holds each to its module (CAPABILITIES, MOUNT). daytona, modal and e2b take archil mounts.
41
+ * The configuration a setting selects among a kind's (`serving`): the one its image names; with none named, the one
42
+ * whose image is the kind's default, else one with no image, else the first. Undefined when the image names none.
57
43
  */
58
- export const PROVIDERS = [
59
- entry({ id: "docker", label: "Docker", keys: [], mounts: ["bind"], metered: false, capabilities: [SANDBOX, LINUX_DESKTOP] }),
60
- entry({
61
- id: "daytona",
62
- label: "Daytona",
63
- keys: [
64
- { name: "DAYTONA_API_KEY", required: true },
65
- { name: "DAYTONA_API_URL", required: false },
66
- { name: "DAYTONA_TARGET", required: false },
67
- ],
68
- mounts: ["archil"],
69
- metered: true,
70
- capabilities: [SANDBOX],
71
- defaultImage: { sandbox: DAYTONA_DEFAULT_SNAPSHOT },
72
- }),
73
- entry({
74
- id: "modal",
75
- label: "Modal",
76
- keys: [
77
- { name: "MODAL_TOKEN_ID", required: true },
78
- { name: "MODAL_TOKEN_SECRET", required: true },
79
- ],
80
- mounts: ["archil"],
81
- metered: true,
82
- capabilities: [SANDBOX],
83
- defaultImage: { sandbox: MODAL_DEFAULT_IMAGE },
84
- }),
85
- entry({
86
- id: "e2b",
87
- label: "E2B",
88
- keys: [{ name: "E2B_API_KEY", required: true }],
89
- mounts: ["archil"],
90
- metered: true,
91
- capabilities: [SANDBOX, LINUX_DESKTOP],
92
- defaultImage: { sandbox: E2B_BASE_TEMPLATE, desktop: E2B_DESKTOP_TEMPLATE },
93
- }),
94
- entry({
95
- id: "orgo",
96
- label: "Orgo",
97
- keys: [{ name: "ORGO_API_KEY", required: true }],
98
- mounts: [],
99
- metered: true,
100
- capabilities: [LINUX_DESKTOP],
101
- defaultImage: { desktop: ORGO_BASE_IMAGE },
102
- }),
103
- entry({
104
- id: "phone-harness",
105
- label: "Phone harness",
106
- keys: [{ name: "PHONE_HARNESS_API_KEY", required: true }],
107
- mounts: [],
108
- metered: true,
109
- capabilities: [{ kind: "android", groups: ["screen", "input.touch", "input.keys", "apps", "apps.ui_tree"] }],
110
- defaultImage: { phone: PHONE_IMAGE },
111
- }),
112
- entry({
113
- id: "browserbase",
114
- label: "Browserbase",
115
- keys: [
116
- { name: "BROWSERBASE_API_KEY", required: true },
117
- { name: "BROWSERBASE_PROJECT_ID", required: true },
118
- ],
119
- mounts: [],
120
- metered: true,
121
- capabilities: [{ kind: "browser", groups: ["cdp", "stream"] }],
122
- defaultImage: { browser: BROWSER_IMAGE },
123
- }),
124
- entry({
125
- id: "kernel",
126
- label: "Kernel",
127
- keys: [{ name: "KERNEL_API_KEY", required: true }],
128
- mounts: [],
129
- metered: true,
130
- capabilities: [{ kind: "browser", groups: ["cdp", "stream"] }],
131
- defaultImage: { browser: BROWSER_IMAGE },
132
- }),
133
- ];
44
+ export function configurationOf(serving, image, defaultImage) {
45
+ if (image !== undefined)
46
+ return serving.find((one) => one.image === image);
47
+ return serving.find((one) => defaultImage !== undefined && one.image === defaultImage) ?? serving.find((one) => one.image === undefined) ?? serving[0];
48
+ }
49
+ /** A descriptor as Settings shows it: its data, and the setting kinds its capabilities serve, derived by serves(). */
50
+ export function entryOf(descriptor) {
51
+ const { load: _load, ...data } = descriptor;
52
+ return { ...data, kinds: SETTING_KIND_NAMES.filter((kind) => descriptor.capabilities.some((one) => serves(one, kind))) };
53
+ }
54
+ /** Every provider Settings offers: each built-in descriptor (descriptors/index.ts), as entryOf gives it. */
55
+ export const PROVIDERS = DESCRIPTORS.map(entryOf);
package/dist/labels.d.ts CHANGED
@@ -1,10 +1,28 @@
1
1
  import { epochProblem } from "./mount.js";
2
+ import { type ComputerOwner } from "./provider.js";
2
3
  import { type Result } from "./result.js";
3
4
  export { epochProblem };
4
5
  /** The run a computer works for. */
5
6
  export declare const RUN_LABEL = "agentrun.run";
6
7
  /** The claim epoch of the run's runner that made the computer, in decimal. */
7
8
  export declare const EPOCH_LABEL = "agentrun.epoch";
9
+ /** The run label's hash (runHash), listed in place of RUN_LABEL by a provider that keeps only the hash and is listed
10
+ * with no run label to match. */
11
+ export declare const RUN_HASH_LABEL = "agentrun.run.hash";
12
+ /** The run label's hash, as a provider keeps it where the run itself doesn't fit (a computer's name): base32 of its
13
+ * sha256, lower case, 16 letters. */
14
+ export declare function runHash(run: string): string;
15
+ /** The agent a persistent computer belongs to, as agent:<id>. */
16
+ export declare const OWNER_LABEL = "agentrun.owner";
17
+ /** The owner's idle TTL of a persistent computer, in milliseconds, in decimal: how long it may stay detached. */
18
+ export declare const IDLE_TTL_LABEL = "agentrun.idle-ttl-ms";
19
+ /** The labels of an agent's computer: its owner, and its idle TTL when the owner set one. Throws, in words, on an owner that is not one. */
20
+ export declare function ownerLabels(owner: ComputerOwner): Record<string, string>;
21
+ /**
22
+ * 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 invalid, in words naming what it reads.
24
+ */
25
+ export declare function ownerOf(labels: Record<string, string> | undefined): Result<ComputerOwner | undefined>;
8
26
  /**
9
27
  * Why run is not a run id, in words, or undefined when it is one: a non-empty string with no NUL byte. That is the
10
28
  * strictest rule the providers share for a label's value (Docker, Daytona and Modal each refuse only a NUL), so every
package/dist/labels.js CHANGED
@@ -1,15 +1,78 @@
1
1
  // The run and its claim epoch, as two labels every computer of a run carries. The claim epoch is the one fence for runs
2
2
  // and computers: a new claim is epoch + 1, and it releases every computer of the run labelled with a lower epoch
3
- // (releaseOlder, in janitor.ts). Both names live here alone.
3
+ // (releaseOlder, in janitor.ts). Both names live here alone, with the run label's hash: a provider whose computers keep
4
+ // only that (Orgo's names) lists it under RUN_HASH_LABEL, so a caller can still tell whose run a computer is.
5
+ //
6
+ // An agent's persistent computer carries its owner as two more labels, set at create: agentrun.owner=agent:<id>, and
7
+ // the owner's idle TTL when it set one. The run and epoch labels then name the claim that holds it now.
8
+ import { createHash } from "node:crypto";
4
9
  import { epochProblem } from "./mount.js";
10
+ import { ownerProblem } from "./provider.js";
5
11
  import { fail, ok } from "./result.js";
6
12
  export { epochProblem };
7
13
  /** The run a computer works for. */
8
14
  export const RUN_LABEL = "agentrun.run";
9
15
  /** The claim epoch of the run's runner that made the computer, in decimal. */
10
16
  export const EPOCH_LABEL = "agentrun.epoch";
17
+ /** The run label's hash (runHash), listed in place of RUN_LABEL by a provider that keeps only the hash and is listed
18
+ * with no run label to match. */
19
+ export const RUN_HASH_LABEL = "agentrun.run.hash";
20
+ /** The run label's hash, as a provider keeps it where the run itself doesn't fit (a computer's name): base32 of its
21
+ * sha256, lower case, 16 letters. */
22
+ export function runHash(run) {
23
+ const alphabet = "abcdefghijklmnopqrstuvwxyz234567";
24
+ const bytes = createHash("sha256").update(run, "utf8").digest();
25
+ let bits = 0;
26
+ let value = 0;
27
+ let out = "";
28
+ for (const byte of bytes) {
29
+ value = (value << 8) | byte;
30
+ bits += 8;
31
+ while (bits >= 5 && out.length < 16) {
32
+ out += alphabet[(value >>> (bits - 5)) & 31];
33
+ bits -= 5;
34
+ }
35
+ if (out.length >= 16)
36
+ break;
37
+ }
38
+ return out;
39
+ }
40
+ /** The agent a persistent computer belongs to, as agent:<id>. */
41
+ export const OWNER_LABEL = "agentrun.owner";
42
+ /** The owner's idle TTL of a persistent computer, in milliseconds, in decimal: how long it may stay detached. */
43
+ export const IDLE_TTL_LABEL = "agentrun.idle-ttl-ms";
44
+ /** A whole number as a label holds it: decimal digits, no sign, no leading zero, no space. */
45
+ const DECIMAL = /^(?:0|[1-9][0-9]*)$/;
46
+ /** The labels of an agent's computer: its owner, and its idle TTL when the owner set one. Throws, in words, on an owner that is not one. */
47
+ export function ownerLabels(owner) {
48
+ const problem = ownerProblem(owner);
49
+ if (problem !== undefined)
50
+ throw new TypeError(problem);
51
+ return { [OWNER_LABEL]: `agent:${owner.agent}`, ...(owner.idleTtlMs === undefined ? {} : { [IDLE_TTL_LABEL]: String(owner.idleTtlMs) }) };
52
+ }
53
+ /**
54
+ * 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 invalid, in words naming what it reads.
56
+ */
57
+ export function ownerOf(labels) {
58
+ if (typeof labels !== "object" || labels === null || Array.isArray(labels))
59
+ return fail("invalid", "the computer's labels are not a map of names to strings");
60
+ if (!Object.hasOwn(labels, OWNER_LABEL))
61
+ return ok(undefined);
62
+ const text = labels[OWNER_LABEL];
63
+ const agent = typeof text === "string" && text.startsWith("agent:") ? text.slice("agent:".length) : undefined;
64
+ if (agent === undefined || ownerProblem({ agent }) !== undefined)
65
+ return fail("invalid", `the label ${OWNER_LABEL} reads ${JSON.stringify(text)}, not agent:<id>`);
66
+ if (!Object.hasOwn(labels, IDLE_TTL_LABEL))
67
+ return ok({ agent });
68
+ const ttl = labels[IDLE_TTL_LABEL];
69
+ const idleTtlMs = typeof ttl === "string" && DECIMAL.test(ttl) ? Number(ttl) : Number.NaN;
70
+ if (!(Number.isSafeInteger(idleTtlMs) && idleTtlMs > 0))
71
+ return fail("invalid", `the label ${IDLE_TTL_LABEL} reads ${JSON.stringify(ttl)}, not a whole number of milliseconds above 0`);
72
+ return ok({ agent, idleTtlMs });
73
+ }
11
74
  /** An epoch as a label holds it: decimal digits, no sign, no leading zero, no space. */
12
- const EPOCH_TEXT = /^(?:0|[1-9][0-9]*)$/;
75
+ const EPOCH_TEXT = DECIMAL;
13
76
  /**
14
77
  * Why run is not a run id, in words, or undefined when it is one: a non-empty string with no NUL byte. That is the
15
78
  * strictest rule the providers share for a label's value (Docker, Daytona and Modal each refuse only a NUL), so every
@@ -0,0 +1,86 @@
1
+ import type { KindCapabilities } from "./kinds.js";
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";
4
+ import { type Result } from "./result.js";
5
+ /** The longest a local browser lives: a day, as pi-browser's local Chrome. */
6
+ export declare const LOCAL_MAX_LIFETIME_MS: number;
7
+ /** A browser takes no mount: its descriptor's (descriptors/local-chrome.ts). */
8
+ export declare const MOUNT: readonly MountKind[];
9
+ /** A spec's network as this browser's proxy takes it: open (no list), a list (parseAllow's), or why it can't. */
10
+ export declare function browserNetworkOf(network: unknown): {
11
+ allow?: string[];
12
+ } | {
13
+ problem: string;
14
+ };
15
+ /** The one configuration it offers, its descriptor's: a browser with a CDP target. */
16
+ export declare const CAPABILITIES: readonly KindCapabilities[];
17
+ export interface LocalBrowserOptions {
18
+ /** The Chrome or Chromium to run; default the one findChrome finds in `env`, then in the usual places. */
19
+ executablePath?: string;
20
+ /**
21
+ * Where CHROME_PATH, PI_BROWSER_CHROME and PATH are read when no executablePath is given: the host's environment, which
22
+ * it passes (serve passes its own). The library reads none.
23
+ */
24
+ env?: Readonly<Record<string, string | undefined>>;
25
+ /** Shows the window, for a person watching on this machine; default headless. */
26
+ headed?: boolean;
27
+ /** Where the browsers' directories go; default <tmpdir>/agentrun-local-browser-<uid>. Made 0700, and refused when another user can write it. */
28
+ root?: string;
29
+ /** The user this process runs as: a test's seam. */
30
+ uid?: number;
31
+ }
32
+ /** Computers that are this machine's Chrome. */
33
+ export declare class LocalBrowserProvider implements ComputerProvider {
34
+ #private;
35
+ readonly id = "local-chrome";
36
+ readonly version: string;
37
+ readonly root: string;
38
+ constructor({ executablePath, env, headed, root, uid }?: LocalBrowserOptions);
39
+ /**
40
+ * A browser: our supervisor ends it at its deadline, and list reads that deadline, so the janitor sweeps one whose
41
+ * supervisor is gone (lifetime janitor); it reaches public addresses only, through its egress proxy (network open), or
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).
44
+ */
45
+ capabilities(): ComputerCapabilities;
46
+ /** The Chrome this provider runs: the option's, else one found; null when there is none. */
47
+ executable(): string | null;
48
+ check(spec: ComputerSpec): Refusal[];
49
+ /** Starts Chrome under a supervisor of its own, waits until its DevTools socket answers, and hands back its ref. */
50
+ create(spec: ComputerSpec, { signal }?: {
51
+ signal?: AbortSignal;
52
+ }): Promise<Result<CreatedComputer>>;
53
+ /**
54
+ * Settings' test: finds the Chrome and starts it once, headless, on a blank page, with its sandbox on (chrome.ts
55
+ * checkChrome), with a proxy that reaches nothing. No browser is kept and no key is read; no Chrome, root, or a Chrome
56
+ * that cannot start its sandbox is said in words.
57
+ */
58
+ testConnection(_context?: CallContext): Promise<Result<{
59
+ detail: string;
60
+ }>>;
61
+ /** Every browser with these labels: running while its Chrome runs, stopped once it does not (its files not yet removed). */
62
+ list(labels: Record<string, string>, _context?: CallContext): Promise<Result<ComputerInfo[]>>;
63
+ attach(ref: {
64
+ id: string;
65
+ } | {
66
+ labels: Record<string, string>;
67
+ }, _context?: CallContext): Promise<Result<AttachedComputer>>;
68
+ /** The network it was made with (open, or its list), read back; its proxy is started with it, so a change is refused in words. */
69
+ network(ref: ComputerRef, policy?: NetworkSpec, _context?: CallContext): Promise<Result<NetworkPolicy>>;
70
+ /**
71
+ * The browser's DevTools URL, ws://127.0.0.1:<port>/devtools/browser/<id>, once the socket on that port answers with
72
+ * the path this browser's Chrome wrote; and a client that answers hello and ping. The URL bears no secret, but the
73
+ * socket takes any local client: it is the browser.
74
+ */
75
+ connect(ref: ComputerRef): Promise<Result<ComputerConnection>>;
76
+ /**
77
+ * Ends the browser and removes its files: its supervisor is asked to end it (SIGTERM), and whatever is left once it
78
+ * has gone (a supervisor already gone, a Chrome it did not end) is ended and removed here. A browser already gone is
79
+ * released; done means its directory is gone.
80
+ */
81
+ release(ref: ComputerRef, how: "stop" | "delete", _context?: CallContext): Promise<Result<void>>;
82
+ }
83
+ /** The provider, built from its options alone: no key, and no environment read but the `env` it is given. */
84
+ export declare function create(options?: LocalBrowserOptions): LocalBrowserProvider;
85
+ /** The conformance CLI's module for the local browser: its live switch, its image and its notes. */
86
+ export declare const conformance: () => Promise<typeof import("./conformance/local-chrome.js")>;