@parcha/agentrun-computer 0.1.0-beta.67 → 0.1.0-beta.69
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/README.md +243 -9
- package/box/README.md +8 -0
- package/box/install.sh +60 -6
- package/dist/boxd.js +43 -8
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/computerd.json +1 -1
- package/dist/conformance/cli.d.ts +6 -0
- package/dist/conformance/cli.js +14 -3
- package/dist/conformance/instabox.d.ts +36 -0
- package/dist/conformance/instabox.js +43 -0
- package/dist/conformance/northflank.d.ts +44 -0
- package/dist/conformance/northflank.js +50 -0
- package/dist/conformance/sprites.d.ts +32 -0
- package/dist/conformance/sprites.js +40 -0
- package/dist/conformance/vercel.d.ts +35 -0
- package/dist/conformance/vercel.js +43 -0
- package/dist/descriptor.d.ts +6 -0
- package/dist/descriptor.js +2 -0
- package/dist/descriptors/agent37.d.ts +1 -0
- package/dist/descriptors/agent37.js +2 -0
- package/dist/descriptors/daytona.d.ts +1 -0
- package/dist/descriptors/daytona.js +2 -0
- package/dist/descriptors/e2b.d.ts +14 -0
- package/dist/descriptors/e2b.js +20 -3
- package/dist/descriptors/fly.d.ts +1 -0
- package/dist/descriptors/fly.js +2 -0
- package/dist/descriptors/groundbox.d.ts +1 -0
- package/dist/descriptors/groundbox.js +2 -0
- package/dist/descriptors/index.d.ts +106 -1
- package/dist/descriptors/index.js +8 -2
- package/dist/descriptors/instabox.d.ts +20 -0
- package/dist/descriptors/instabox.js +22 -0
- package/dist/descriptors/modal.d.ts +1 -0
- package/dist/descriptors/modal.js +2 -0
- package/dist/descriptors/northflank.d.ts +24 -0
- package/dist/descriptors/northflank.js +30 -0
- package/dist/descriptors/orgo.d.ts +1 -0
- package/dist/descriptors/orgo.js +2 -0
- package/dist/descriptors/render.d.ts +1 -0
- package/dist/descriptors/render.js +2 -0
- package/dist/descriptors/sprites.d.ts +19 -0
- package/dist/descriptors/sprites.js +19 -0
- package/dist/descriptors/vercel.d.ts +23 -0
- package/dist/descriptors/vercel.js +24 -0
- package/dist/docker/egress-main.js +17 -10
- package/dist/docker/egress-proxy.d.ts +7 -0
- package/dist/docker/egress-proxy.js +12 -0
- package/dist/docker/egress.d.ts +3 -1
- package/dist/docker/egress.js +11 -4
- package/dist/docker/image.d.ts +8 -2
- package/dist/docker/image.js +24 -3
- package/dist/docker.d.ts +6 -0
- package/dist/docker.js +15 -5
- package/dist/e2b.d.ts +25 -10
- package/dist/e2b.js +36 -16
- package/dist/groundbox.js +15 -2
- package/dist/hosted/download.d.ts +16 -0
- package/dist/hosted/download.js +108 -2
- package/dist/hosted/provider.js +25 -12
- package/dist/hosted/rest.js +23 -1
- package/dist/hosted/scripts.d.ts +2 -0
- package/dist/hosted/scripts.js +29 -0
- package/dist/hosted/ssh-exec.d.ts +17 -2
- package/dist/hosted/ssh-exec.js +17 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/instabox.d.ts +30 -0
- package/dist/instabox.js +424 -0
- package/dist/northflank.d.ts +44 -0
- package/dist/northflank.js +448 -0
- package/dist/orgo-desktop.js +2 -2
- package/dist/orgo-names.d.ts +15 -1
- package/dist/orgo-names.js +13 -0
- package/dist/orgo.d.ts +10 -0
- package/dist/orgo.js +64 -4
- package/dist/providers.d.ts +10 -4
- package/dist/render.js +4 -3
- package/dist/sprites.d.ts +37 -0
- package/dist/sprites.js +309 -0
- package/dist/vercel.d.ts +26 -0
- package/dist/vercel.js +262 -0
- package/package.json +22 -2
package/dist/hosted/rest.js
CHANGED
|
@@ -35,6 +35,19 @@ export function jsonOf(bytes) {
|
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* A Retry-After's wait in ms (RFC 9110 10.2.3): delay-seconds, or an HTTP date (0 once it has passed); undefined for no
|
|
40
|
+
* header or words that are neither.
|
|
41
|
+
*/
|
|
42
|
+
function retryAfterMs(value) {
|
|
43
|
+
if (value === null)
|
|
44
|
+
return undefined;
|
|
45
|
+
const text = value.trim();
|
|
46
|
+
if (/^[0-9]+$/.test(text))
|
|
47
|
+
return Number(text) * 1000;
|
|
48
|
+
const at = Date.parse(text);
|
|
49
|
+
return Number.isNaN(at) ? undefined : Math.max(0, at - Date.now());
|
|
50
|
+
}
|
|
38
51
|
/** Whether fetch failed on a redirect it was told not to follow. */
|
|
39
52
|
function redirected(cause) {
|
|
40
53
|
const inner = cause?.cause;
|
|
@@ -115,6 +128,8 @@ export function rest(options) {
|
|
|
115
128
|
bound?.addEventListener("abort", cut, { once: true });
|
|
116
129
|
let failure;
|
|
117
130
|
let retryable;
|
|
131
|
+
// The wait a refused answer's Retry-After asks of a retry.
|
|
132
|
+
let asked;
|
|
118
133
|
try {
|
|
119
134
|
const headers = init.json === undefined ? options.headers() : { ...options.headers(), "Content-Type": "application/json" };
|
|
120
135
|
const either = signal ? AbortSignal.any([signal, timeout.signal]) : timeout.signal;
|
|
@@ -131,6 +146,7 @@ export function rest(options) {
|
|
|
131
146
|
const bytes = await bytesOf(response, either);
|
|
132
147
|
const own = typeof init.retry === "function";
|
|
133
148
|
retryable = own ? init.retry(response.status, bytes) : init.retry === true && (response.status === 429 || response.status >= 500);
|
|
149
|
+
asked = retryable ? retryAfterMs(response.headers.get("retry-after")) : undefined;
|
|
134
150
|
const text = decoder.decode(bytes).replace(/\s+/g, " ").slice(0, 300);
|
|
135
151
|
const said = options.explain?.({ status: response.status, bytes, text, what }) ?? {};
|
|
136
152
|
failure = errorOf(said.code ?? httpCode(response.status, init.named), said.message ?? `${what}: ${response.status} ${text}`, options.vendor);
|
|
@@ -155,7 +171,13 @@ export function rest(options) {
|
|
|
155
171
|
}
|
|
156
172
|
if (!retryable || attempt >= attempts)
|
|
157
173
|
return { ok: false, error: failure };
|
|
158
|
-
|
|
174
|
+
// A send before the vendor's Retry-After is refused again, so the pause is the longer of it and the backoff. A
|
|
175
|
+
// Retry-After past the call's bound is not waited out: the call fails now, its words giving the wait.
|
|
176
|
+
if (asked !== undefined && asked > timeoutMs) {
|
|
177
|
+
const message = `${failure.message}; the vendor asks a retry to wait (Retry-After ${Math.round(asked / 100) / 10} s), past the call's bound of ${Math.round(timeoutMs / 100) / 10} s`;
|
|
178
|
+
return { ok: false, error: { ...failure, message } };
|
|
179
|
+
}
|
|
180
|
+
await wait(Math.max((options.retry?.baseMs ?? 0) * 2 ** (attempt - 1), asked ?? 0), signal);
|
|
159
181
|
}
|
|
160
182
|
}
|
|
161
183
|
const call = (method, url, init = {}, signal) => exchange(method, url, init, signal, async (response, cut) => ({ status: response.status, bytes: await bytesOf(response, cut) }));
|
package/dist/hosted/scripts.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export declare const READ_COPIES = "/run/agentrun-read";
|
|
|
21
21
|
export declare const readStage: (uid: string, gid: string, path: string, copy: string) => string[];
|
|
22
22
|
/** The read-unstage argv: copy removed. */
|
|
23
23
|
export declare const readUnstage: (copy: string) => string[];
|
|
24
|
+
/** The tree-stage argv: the tar of path written to copy, made as uid:gid, at most `blocks` 512-byte blocks long. */
|
|
25
|
+
export declare const treeStage: (uid: string, gid: string, path: string, copy: string, blocks: number) => string[];
|
|
24
26
|
/**
|
|
25
27
|
* The session buses a vendor's own processes leave in /tmp (Daytona's D-Bus, /tmp/dbus-Y8OW6E3FDx), which no network
|
|
26
28
|
* namespace cuts: every child host's create closes them to the computer's user before init starts. The window
|
package/dist/hosted/scripts.js
CHANGED
|
@@ -120,6 +120,35 @@ const READ_UNSTAGE_SCRIPT = ["# agentrun-computer: read-unstage", ROOT, 'exec $p
|
|
|
120
120
|
export const readStage = (uid, gid, path, copy) => argvOf(READ_STAGE_SCRIPT, [uid, gid, path, copy]);
|
|
121
121
|
/** The read-unstage argv: copy removed. */
|
|
122
122
|
export const readUnstage = (copy) => argvOf(READ_UNSTAGE_SCRIPT, [copy]);
|
|
123
|
+
/**
|
|
124
|
+
* tree-stage: [uid, gid, path, copy, blocks]. Writes to copy the tar computerd's tar.pull gives of path, made as uid:gid
|
|
125
|
+
* with no supplementary groups (setpriv), so it holds only what the daemon's user can read: a directory's entries named
|
|
126
|
+
* relative to it (a directory's name ending in "/"), a file one entry named for it; a hard link as a file of its own, a
|
|
127
|
+
* symlink as a link, and sockets, devices and pipes left out (find's types f, d and l). A name past ustar's 100 bytes
|
|
128
|
+
* goes in a pax header. find's names go to tar through a pipe, and root writes the copy alone, under umask 077 in
|
|
129
|
+
* READ_COPIES: the copy is the one file the script writes, so removing it (read-unstage) leaves nothing of a stage that
|
|
130
|
+
* was killed part way. The tar's file-size limit is `blocks` 512-byte blocks (ulimit -f in a POSIX sh: dash, busybox,
|
|
131
|
+
* and bash run as sh), so a tree past it fails rather than filling the machine's /run. find's own status comes back
|
|
132
|
+
* on fd 4, since a POSIX sh's pipeline answers only tar's. Any failure (a directory the user can't read, a file changed
|
|
133
|
+
* while it was read, a path whose resolved name is not its own, find or tar missing) removes the copy and fails the
|
|
134
|
+
* script, and the daemon's pull is read instead.
|
|
135
|
+
*/
|
|
136
|
+
const TREE_STAGE_SCRIPT = [
|
|
137
|
+
"# agentrun-computer: tree-stage",
|
|
138
|
+
ROOT,
|
|
139
|
+
`exec $p sh -c 'umask 077; cd / && mkdir -p "\${3%/*}" && chmod 0700 "\${3%/*}" && r=$(realpath -e -- "$2") || exit 1
|
|
140
|
+
if [ -d "$r" ]; then
|
|
141
|
+
f=$( { { setpriv --reuid="$0" --regid="$1" --clear-groups -- find "$r" -mindepth 1 \\( -type f -o -type d -o -type l \\) -printf "%P\\0"; echo $? >&4; } |
|
|
142
|
+
( ulimit -f "$4" && exec setpriv --reuid="$0" --regid="$1" --clear-groups -- tar -C "$r" --null --no-recursion -T - --hard-dereference --format=pax -cf - ) >"$3"; } 4>&1 ) &&
|
|
143
|
+
[ "$f" = 0 ]
|
|
144
|
+
else
|
|
145
|
+
[ -f "$r" ] && [ "\${r##*/}" = "\${2##*/}" ] && printf "%s\\0" "\${r##*/}" |
|
|
146
|
+
( ulimit -f "$4" && exec setpriv --reuid="$0" --regid="$1" --clear-groups -- tar -C "\${r%/*}" --null --no-recursion -T - --format=pax -cf - ) >"$3"
|
|
147
|
+
fi
|
|
148
|
+
[ "$?" = 0 ] || { rm -f -- "$3"; exit 1; }' "$@"`,
|
|
149
|
+
].join("\n");
|
|
150
|
+
/** The tree-stage argv: the tar of path written to copy, made as uid:gid, at most `blocks` 512-byte blocks long. */
|
|
151
|
+
export const treeStage = (uid, gid, path, copy, blocks) => argvOf(TREE_STAGE_SCRIPT, [uid, gid, path, copy, String(blocks)]);
|
|
123
152
|
/**
|
|
124
153
|
* The session buses a vendor's own processes leave in /tmp (Daytona's D-Bus, /tmp/dbus-Y8OW6E3FDx), which no network
|
|
125
154
|
* namespace cuts: every child host's create closes them to the computer's user before init starts. The window
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Duplex } from "node:stream";
|
|
2
|
-
import type
|
|
2
|
+
import { type HostCall, type MachineProcess } from "../host.js";
|
|
3
3
|
/** A readable side of an ssh2 channel, as this provider uses it: piped, or drained. */
|
|
4
4
|
export interface Ssh2Readable {
|
|
5
5
|
pipe(destination: NodeJS.WritableStream): unknown;
|
|
@@ -29,6 +29,8 @@ export interface Ssh2ConnectConfig {
|
|
|
29
29
|
readyTimeout: number;
|
|
30
30
|
keepaliveInterval: number;
|
|
31
31
|
keepaliveCountMax: number;
|
|
32
|
+
/** Given the server's host key (its SSH wire blob), whether to go on: false ends the handshake before any login. */
|
|
33
|
+
hostVerifier?: (key: Buffer) => boolean;
|
|
32
34
|
}
|
|
33
35
|
/** The slice of an ssh2 Client this provider uses. */
|
|
34
36
|
export interface Ssh2Client {
|
|
@@ -68,7 +70,15 @@ export interface SshLogin {
|
|
|
68
70
|
password?: string;
|
|
69
71
|
/** What no error may carry, beside the key and the password, which never do: a key inside the username (Morph's). */
|
|
70
72
|
secrets?: readonly string[];
|
|
73
|
+
/**
|
|
74
|
+
* The sshd's host key, as OpenSSH's sha256 fingerprint (SHA256: and unpadded base64): a server with another key ends
|
|
75
|
+
* the handshake before the login is sent, and is not tried again. For a login that carries a credential (InstaBox's
|
|
76
|
+
* token as the username), which a host posing as the gateway would otherwise read.
|
|
77
|
+
*/
|
|
78
|
+
hostKey?: string;
|
|
71
79
|
}
|
|
80
|
+
/** A host key pin's form, OpenSSH's sha256 fingerprint: SHA256: and 43 characters of unpadded base64. */
|
|
81
|
+
export declare const HOST_KEY_PIN: RegExp;
|
|
72
82
|
export interface SshExecOptions {
|
|
73
83
|
/** The host's own ssh2 package, or anything with the same slice. */
|
|
74
84
|
ssh2: Ssh2Module;
|
|
@@ -81,11 +91,16 @@ export interface SshExecOptions {
|
|
|
81
91
|
* or past: a refused login fails at once.
|
|
82
92
|
*/
|
|
83
93
|
deniedUntil?: (id: string) => number;
|
|
94
|
+
/**
|
|
95
|
+
* Every login must carry hostKey of HOST_KEY_PIN's form: one without is refused (vendor) before its tunnel opens, so
|
|
96
|
+
* its credential never leaves. For a host whose login is itself a credential (InstaBox's token as the username).
|
|
97
|
+
*/
|
|
98
|
+
pinned?: boolean;
|
|
84
99
|
}
|
|
85
100
|
/** MachineHost.exec over SSH: argv as the host's login, as channels on one connection per machine, shared by its execs. */
|
|
86
101
|
export declare class SshExec {
|
|
87
102
|
#private;
|
|
88
|
-
constructor({ ssh2, loginOf, tunnelOf, deniedUntil }: SshExecOptions);
|
|
103
|
+
constructor({ ssh2, loginOf, tunnelOf, deniedUntil, pinned }: SshExecOptions);
|
|
89
104
|
/** Ends every connection to machine id, channels and all: the vendor calls it once the machine is deleted. */
|
|
90
105
|
closeAll(id: string): void;
|
|
91
106
|
/**
|
package/dist/hosted/ssh-exec.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// the machine's sshd (Agent37's WebSocket tunnel) and as the login the host gives (Agent37's root and key). Every error it throws or
|
|
4
4
|
// rejects with is redacted of the login's secrets. The host's own ssh2 package does the protocol; this package names
|
|
5
5
|
// only the slice it uses (Ssh2Module) and imports nothing at load.
|
|
6
|
-
import { createPrivateKey, randomBytes } from "node:crypto";
|
|
6
|
+
import { createHash, createPrivateKey, randomBytes } from "node:crypto";
|
|
7
7
|
import { PassThrough } from "node:stream";
|
|
8
|
+
import { HostError } from "../host.js";
|
|
8
9
|
import { boundOf, redact } from "./process.js";
|
|
9
10
|
import { PID_WRAPPER, pidKill, pidStderr, shellLine } from "./scripts.js";
|
|
10
11
|
import { sshString } from "./ssh-key.js";
|
|
@@ -48,6 +49,10 @@ const isBound = (error) => {
|
|
|
48
49
|
const name = error?.name;
|
|
49
50
|
return name === "TimeoutError" || name === "AbortError";
|
|
50
51
|
};
|
|
52
|
+
/** OpenSSH's sha256 fingerprint of a host key's wire blob. */
|
|
53
|
+
const fingerprintOf = (key) => `SHA256:${createHash("sha256").update(key).digest("base64").replace(/=+$/, "")}`;
|
|
54
|
+
/** A host key pin's form, OpenSSH's sha256 fingerprint: SHA256: and 43 characters of unpadded base64. */
|
|
55
|
+
export const HOST_KEY_PIN = /^SHA256:[A-Za-z0-9+/]{43}$/;
|
|
51
56
|
/** The pause between two logins an sshd refused, while deniedUntil says the key may still reach it. */
|
|
52
57
|
const DENIED_RETRY_MS = 2_000;
|
|
53
58
|
/** MachineHost.exec over SSH: argv as the host's login, as channels on one connection per machine, shared by its execs. */
|
|
@@ -56,16 +61,18 @@ export class SshExec {
|
|
|
56
61
|
#loginOf;
|
|
57
62
|
#tunnelOf;
|
|
58
63
|
#deniedUntil;
|
|
64
|
+
#pinned;
|
|
59
65
|
/**
|
|
60
66
|
* The SSH connections to each machine, opening, open, or done and still held, until each ends: one, and a second
|
|
61
67
|
* past CHANNELS_PER_CONNECTION channels. A done one takes no new channel; closeAll ends them all.
|
|
62
68
|
*/
|
|
63
69
|
#links = new Map();
|
|
64
|
-
constructor({ ssh2, loginOf, tunnelOf, deniedUntil }) {
|
|
70
|
+
constructor({ ssh2, loginOf, tunnelOf, deniedUntil, pinned = false }) {
|
|
65
71
|
this.#ssh2 = ssh2;
|
|
66
72
|
this.#loginOf = loginOf;
|
|
67
73
|
this.#tunnelOf = tunnelOf;
|
|
68
74
|
this.#deniedUntil = deniedUntil;
|
|
75
|
+
this.#pinned = pinned;
|
|
69
76
|
}
|
|
70
77
|
/** Ends every connection to machine id, channels and all: the vendor calls it once the machine is deleted. */
|
|
71
78
|
closeAll(id) {
|
|
@@ -112,10 +119,15 @@ export class SshExec {
|
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
121
|
/**
|
|
115
|
-
* One tunnel and one SSH handshake over it
|
|
116
|
-
* WebSocket (opening or open), the stream and the
|
|
122
|
+
* One tunnel and one SSH handshake over it, the login had first: a pinned exec's login with no pin opens no tunnel.
|
|
123
|
+
* On a failure, or once stop aborts before the handshake is done, the WebSocket (opening or open), the stream and the
|
|
124
|
+
* client are dropped.
|
|
117
125
|
*/
|
|
118
126
|
async #handshake(id, timeoutMs, stop) {
|
|
127
|
+
const { username, privateKey, password, hostKey } = this.#loginOf(id);
|
|
128
|
+
if (this.#pinned && !(typeof hostKey === "string" && HOST_KEY_PIN.test(hostKey))) {
|
|
129
|
+
throw new HostError("vendor", `the SSH login to ${id} names no host key (SHA256:...) to pin its sshd by, and this host pins every login: no connection was made`);
|
|
130
|
+
}
|
|
119
131
|
const { duplex, opened, host } = this.#tunnelOf(id);
|
|
120
132
|
const client = new this.#ssh2.Client();
|
|
121
133
|
const givenUp = () => new SshTunnelError(`the SSH tunnel to ${host} was given up on`);
|
|
@@ -130,14 +142,13 @@ export class SshExec {
|
|
|
130
142
|
quit(givenUp());
|
|
131
143
|
};
|
|
132
144
|
stop.addEventListener("abort", drop, { once: true });
|
|
133
|
-
const { username, privateKey, password } = this.#loginOf(id);
|
|
134
145
|
try {
|
|
135
146
|
await Promise.race([opened, quitted]);
|
|
136
147
|
await Promise.race([
|
|
137
148
|
new Promise((resolve, reject) => {
|
|
138
149
|
client.once("ready", resolve);
|
|
139
150
|
client.once("error", reject);
|
|
140
|
-
client.connect({ sock: duplex, username, privateKey, password, readyTimeout: timeoutMs, keepaliveInterval: KEEPALIVE_MS, keepaliveCountMax: KEEPALIVE_COUNT_MAX });
|
|
151
|
+
client.connect({ sock: duplex, username, privateKey, password, readyTimeout: timeoutMs, keepaliveInterval: KEEPALIVE_MS, keepaliveCountMax: KEEPALIVE_COUNT_MAX, ...(hostKey === undefined ? {} : { hostVerifier: (key) => fingerprintOf(key) === hostKey }) });
|
|
141
152
|
}),
|
|
142
153
|
quitted,
|
|
143
154
|
]);
|
package/dist/index.d.ts
CHANGED
|
@@ -16,9 +16,10 @@ export type { HostCall, HostFacts, Machine, MachineHost, MachineProcess, Machine
|
|
|
16
16
|
export { HostedProvider, type HostedDial, type HostedOptions, type HostedTimeouts, hostedDaemonPath } from "./hosted/provider.js";
|
|
17
17
|
export { httpsBase, keyBase } from "./hosted/rest.js";
|
|
18
18
|
export { type DockerVolume, VOLUME_SUBPATH_ENGINE } from "./docker/volume.js";
|
|
19
|
-
export { DEFAULT_DOCKER_IMAGE, DOCKER_BASE, DOCKER_RECIPE, DOCKER_RECIPE_HAS, ensureImage, type EnsureImageOptions, IMAGE_REPOSITORY, IMAGE_TIMEOUT_MS, type ImageSource, imageSourceProblem, type Making, RECIPE_LABEL, recipeHash, recipeTag, } from "./docker/image.js";
|
|
19
|
+
export { DEFAULT_DOCKER_IMAGE, DOCKER_BASE, DOCKER_NODE_SHA256, DOCKER_NODE_VERSION, DOCKER_RECIPE, DOCKER_RECIPE_HAS, ensureImage, type EnsureImageOptions, IMAGE_REPOSITORY, IMAGE_TIMEOUT_MS, type ImageSource, imageSourceProblem, type Making, RECIPE_LABEL, recipeHash, recipeTag, } from "./docker/image.js";
|
|
20
20
|
export { ADB_ENV_NAMES, adbEnv, BASE_ENV_NAMES, CHROME_ENV_NAMES, childEnv, chromeEnv, DOCKER_ENV_NAMES, dockerEnv, type HostEnv } from "./child-env.js";
|
|
21
21
|
export { containerSigns, EGRESS_IMAGE, EGRESS_LABEL, EGRESS_MOUNT, EGRESS_SOCKET } from "./docker/egress.js";
|
|
22
|
+
export { DEFAULT_MAX_TUNNELS, MAX_TUNNELS_CEILING, maxTunnelsOf } from "./docker/egress-proxy.js";
|
|
22
23
|
export { ARCHIL_HELPER, ARCHIL_SYNC_SOCKET, ARCHIL_TOOL_UID, ARCHIL_TOOL_USER, ARCHIL_VERSION, type ArchilMount, type ArchilEgress, type ArchilMountOptions, type ArchilRoot, type ProviderNote, archilEgressOf, archilLabels, archilMount, archilReadBack, archilRefusals, archilRelease, archilSync, claimEpoch, helperSha256, MOUNT_LABEL, mountDrift, mountWords, type RecordedFolder, type RecordedSource, readMount, recordedFolder, recordedMount, SYNC_LABELS, syncingClient, } from "./mount-archil.js";
|
|
23
24
|
export { type BrowserComputerProvider, type BrowserDownloads, type BrowserFile, type BrowserProfiles, type BrowserSessionUsage, browserSpecRefusals, type BrowserStream, isBrowserProvider, BrowserVendorError, CREATE_LABEL, ATTEMPT_LABEL, causeOf, memoryUrls, RECOVER_MS, recoverCreate, recoveriesInFlight, type RecoveryInFlight, type ReleaseConfirm, type RestReply, type UrlStore, } from "./browser.js";
|
|
24
25
|
export { CHROME_ENV, CHROME_FLAGS, checkChrome, chromeFence, findChrome, killTree, NO_CHROME } from "./chrome.js";
|
package/dist/index.js
CHANGED
|
@@ -20,9 +20,10 @@ export { httpsBase, keyBase } from "./hosted/rest.js";
|
|
|
20
20
|
// (providerFor), or from its own subpath (@parcha/agentrun-computer/docker, /daytona, /modal, /e2b, /agent37, /morph, /orgo,
|
|
21
21
|
// /phone-harness, /browserbase, /kernel, /local, /smolcloud, /groundbox: each the provider file's name).
|
|
22
22
|
export { VOLUME_SUBPATH_ENGINE } from "./docker/volume.js";
|
|
23
|
-
export { DEFAULT_DOCKER_IMAGE, DOCKER_BASE, DOCKER_RECIPE, DOCKER_RECIPE_HAS, ensureImage, IMAGE_REPOSITORY, IMAGE_TIMEOUT_MS, imageSourceProblem, RECIPE_LABEL, recipeHash, recipeTag, } from "./docker/image.js";
|
|
23
|
+
export { DEFAULT_DOCKER_IMAGE, DOCKER_BASE, DOCKER_NODE_SHA256, DOCKER_NODE_VERSION, DOCKER_RECIPE, DOCKER_RECIPE_HAS, ensureImage, IMAGE_REPOSITORY, IMAGE_TIMEOUT_MS, imageSourceProblem, RECIPE_LABEL, recipeHash, recipeTag, } from "./docker/image.js";
|
|
24
24
|
export { ADB_ENV_NAMES, adbEnv, BASE_ENV_NAMES, CHROME_ENV_NAMES, childEnv, chromeEnv, DOCKER_ENV_NAMES, dockerEnv } from "./child-env.js";
|
|
25
25
|
export { containerSigns, EGRESS_IMAGE, EGRESS_LABEL, EGRESS_MOUNT, EGRESS_SOCKET } from "./docker/egress.js";
|
|
26
|
+
export { DEFAULT_MAX_TUNNELS, MAX_TUNNELS_CEILING, maxTunnelsOf } from "./docker/egress-proxy.js";
|
|
26
27
|
export { ARCHIL_HELPER, ARCHIL_SYNC_SOCKET, ARCHIL_TOOL_UID, ARCHIL_TOOL_USER, ARCHIL_VERSION, archilEgressOf, archilLabels, archilMount, archilReadBack, archilRefusals, archilRelease, archilSync, claimEpoch, helperSha256, MOUNT_LABEL, mountDrift, mountWords, readMount, recordedFolder, recordedMount, SYNC_LABELS, syncingClient, } from "./mount-archil.js";
|
|
27
28
|
export { browserSpecRefusals, isBrowserProvider, BrowserVendorError, CREATE_LABEL, ATTEMPT_LABEL, causeOf, memoryUrls, RECOVER_MS, recoverCreate, recoveriesInFlight, } from "./browser.js";
|
|
28
29
|
// Local Chrome's provider class is on its provider id's subpath (@parcha/agentrun-computer/local-chrome), as every
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HostedProvider, type HostedOptions } from "./hosted/provider.js";
|
|
2
|
+
import { type Ssh2Module } from "./hosted/ssh-exec.js";
|
|
3
|
+
/** The InstaBox provider's options: the key and ssh2, then the shared adapter's (HostedOptions). */
|
|
4
|
+
export interface InstaboxProviderOptions extends Omit<HostedOptions, "kind" | "desktop"> {
|
|
5
|
+
/** The workspace's API key. The caller passes it; this provider never reads it from the environment. */
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** The ssh2 package: the host's own, or anything with the same slice. */
|
|
8
|
+
ssh2: Ssh2Module;
|
|
9
|
+
/** The fetch every REST call goes through; default the global one. */
|
|
10
|
+
fetch?: typeof fetch;
|
|
11
|
+
/** The API's root; default https://api.instabox.sh. */
|
|
12
|
+
apiUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
/** What create() takes: the provider's options, ssh2 optional (default the host's ssh2 package). */
|
|
15
|
+
export interface InstaboxOptions extends Omit<InstaboxProviderOptions, "ssh2"> {
|
|
16
|
+
ssh2?: Ssh2Module;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEFAULT_API_URL = "https://api.instabox.sh";
|
|
19
|
+
/** The workspace a key reaches, in words: the key named by its sha256 prefix alone. */
|
|
20
|
+
export declare function accountOf(apiKey: string, apiUrl?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* An InstaboxProvider from its options alone; it reads no environment. The key is options.apiKey, nowhere else (serve
|
|
23
|
+
* passes its INSTABOX_API_KEY, the conformance module what it reads), and ssh2 is the host's package unless given.
|
|
24
|
+
*/
|
|
25
|
+
export declare function create(options: InstaboxOptions): Promise<InstaboxProvider>;
|
|
26
|
+
export declare const conformance: () => Promise<typeof import("./conformance/instabox.js")>;
|
|
27
|
+
/** Computers that are InstaBox machines, on the shared adapter: a sandbox from an InstaBox template, no desktop. */
|
|
28
|
+
export declare class InstaboxProvider extends HostedProvider {
|
|
29
|
+
constructor(options: InstaboxProviderOptions);
|
|
30
|
+
}
|