@parcha/agentrun-computer 0.1.0-beta.52 → 0.1.0-beta.54
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 +165 -18
- package/box/README.md +4 -1
- package/box/build-daytona.py +30 -7
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/computerd.json +1 -1
- package/dist/conformance/cases/mount.js +3 -8
- package/dist/conformance/groundbox.d.ts +61 -0
- package/dist/conformance/groundbox.js +87 -0
- package/dist/conformance/sweep.js +1 -1
- package/dist/daytona.d.ts +10 -2
- package/dist/daytona.js +95 -17
- package/dist/descriptors/daytona.d.ts +4 -0
- package/dist/descriptors/daytona.js +2 -0
- package/dist/descriptors/groundbox.d.ts +34 -0
- package/dist/descriptors/groundbox.js +30 -0
- package/dist/descriptors/index.d.ts +33 -1
- package/dist/descriptors/index.js +4 -2
- package/dist/e2b.js +3 -10
- package/dist/groundbox.d.ts +61 -0
- package/dist/groundbox.js +663 -0
- package/dist/host.d.ts +7 -0
- package/dist/hosted/provider.d.ts +5 -1
- package/dist/hosted/provider.js +90 -6
- package/dist/hosted/scripts.d.ts +15 -0
- package/dist/hosted/scripts.js +22 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/sync-folder.d.ts +14 -10
- package/dist/sync-folder.js +25 -7
- package/dist/tar.d.ts +0 -2
- package/dist/tar.js +1 -1
- package/documents/Dockerfile +32 -0
- package/documents/documents.sh +48 -0
- package/media/Dockerfile +111 -0
- package/package.json +10 -2
package/dist/host.d.ts
CHANGED
|
@@ -83,6 +83,13 @@ export interface MachineHost {
|
|
|
83
83
|
* streams the file through exec's stdin as base64 text, which root decodes (`base64 -d`, in coreutils and busybox).
|
|
84
84
|
*/
|
|
85
85
|
upload?(id: string, path: string, bytes: Uint8Array, ctx: HostCall): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* What agentrun-dial wrote in a dial machine, for a create whose machine never dialed: the adapter adds its last lines
|
|
88
|
+
* to the timeout's words. undefined when agentrun-dial never started there. A host that started agentrun-dial itself
|
|
89
|
+
* and can read its output has it (Daytona's: its session command's log). A read that fails throws, and the timeout's
|
|
90
|
+
* words stay as they were.
|
|
91
|
+
*/
|
|
92
|
+
dialLog?(id: string, ctx: HostCall): Promise<string | undefined>;
|
|
86
93
|
/**
|
|
87
94
|
* The code of an error the vendor's client threw: one of ComputerErrorCode. Optional: the adapter reads a HostError's
|
|
88
95
|
* own code, an AbortError as "aborted" and a TimeoutError as "timeout" itself, and anything else a host does not map
|
|
@@ -28,7 +28,11 @@ export interface HostedTimeouts {
|
|
|
28
28
|
* listings while create waits for the new computer to show: those start at 150 ms and double up to it.
|
|
29
29
|
*/
|
|
30
30
|
pollMs: number;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* How long create waits for the listing to show the new computer. A computer still not listed then is read by its id:
|
|
33
|
+
* one that reads running with its labels is kept, with a note, since a vendor's listing may trail its create (Daytona's
|
|
34
|
+
* is eventually consistent); any other is a timeout.
|
|
35
|
+
*/
|
|
32
36
|
listedMs: number;
|
|
33
37
|
/**
|
|
34
38
|
* The listing's stability window: create's wait ends once the listing has shown the new computer on two consecutive
|
package/dist/hosted/provider.js
CHANGED
|
@@ -11,7 +11,7 @@ import { readFileSync } from "node:fs";
|
|
|
11
11
|
import { resolve } from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { isDeepStrictEqual } from "node:util";
|
|
14
|
-
import { ATTACH_EGRESS_ENV, ATTACH_PATH, attachEgressOf, DAEMON_PATH } from "../attach.js";
|
|
14
|
+
import { ATTACH_EGRESS_ENV, ATTACH_PATH, attachEgressOf, DAEMON_PATH, MACHINE_TOKEN_SOURCE } from "../attach.js";
|
|
15
15
|
import { CreateRequests, endedWords, otherSpecWords, readBackDiffer } from "../create-requests.js";
|
|
16
16
|
import { mountsOf, syncs } from "../descriptor.js";
|
|
17
17
|
import { desktopOf, startDisplay } from "../desktop.js";
|
|
@@ -68,6 +68,14 @@ const LISTED_POLL_MS = 150;
|
|
|
68
68
|
const LISTED_ROUNDS = 2;
|
|
69
69
|
const LISTEN_RETRY_MS = 250;
|
|
70
70
|
const START_POLL_MS = 500;
|
|
71
|
+
/** How much of agentrun-dial's output a dial timeout carries (MachineHost.dialLog): its last lines, cut to these characters. */
|
|
72
|
+
const DIAL_LOG_LINES = 10;
|
|
73
|
+
const DIAL_LOG_CHARS = 800;
|
|
74
|
+
/**
|
|
75
|
+
* A machine token anywhere in what agentrun-dial wrote, not the tail of a longer word (`restart_…`): a dial timeout's
|
|
76
|
+
* words carry `<token>` in its place.
|
|
77
|
+
*/
|
|
78
|
+
const MACHINE_TOKEN = new RegExp(`(?<![A-Za-z0-9_-])${MACHINE_TOKEN_SOURCE}`, "g");
|
|
71
79
|
/**
|
|
72
80
|
* The computerd build a hosted machine of arch runs: HostedProvider's default daemonPath, and the file serve's daemon
|
|
73
81
|
* route serves, so the sha256 a dial machine checks (AGENTRUN_DAEMON_SHA256) is this file's.
|
|
@@ -181,6 +189,13 @@ export class HostedProvider {
|
|
|
181
189
|
/** What the vendor said a machine this create made was given (Machine.resources), by machine id, from its read once it
|
|
182
190
|
* ran (#prepare) until the create answers with it (#createOnce). */
|
|
183
191
|
#given = new Map();
|
|
192
|
+
/**
|
|
193
|
+
* Each computer create kept while the vendor's listing still left it out (#unlisted), by name to machine id: a retry
|
|
194
|
+
* of its request finds it here, read by its id, where the name's listing would not show it yet. An entry goes once
|
|
195
|
+
* the listing shows the name, a read finds the machine gone or not this one, or release deletes it. This instance's
|
|
196
|
+
* alone: another instance's retry still waits on the listing.
|
|
197
|
+
*/
|
|
198
|
+
#keptUnlisted = new Map();
|
|
184
199
|
/** A dial host's server: what its machines reach, and what holds their tokens and sockets. */
|
|
185
200
|
#dial;
|
|
186
201
|
/** The host's descriptor's mounts as its machines reach this server (mountsOf): a dial host's take no Archil mount. */
|
|
@@ -532,6 +547,15 @@ export class HostedProvider {
|
|
|
532
547
|
if (!listed.ok)
|
|
533
548
|
return listed;
|
|
534
549
|
const found = listed.value.filter((machine) => ours(machine.labels, name));
|
|
550
|
+
if (found.length === 0) {
|
|
551
|
+
const kept = await this.#keptOf(name, signal);
|
|
552
|
+
if (!kept.ok)
|
|
553
|
+
return kept;
|
|
554
|
+
if (kept.value !== undefined)
|
|
555
|
+
return this.#again(spec, name, kept.value, signal);
|
|
556
|
+
}
|
|
557
|
+
else
|
|
558
|
+
this.#keptUnlisted.delete(name);
|
|
535
559
|
if (found.length > 1)
|
|
536
560
|
return this.#fail("exists", `${found.length} machines carry the name ${name} (${found.map((m) => m.id).join(", ")}): create with a new request id`);
|
|
537
561
|
if (found.length === 1)
|
|
@@ -570,6 +594,23 @@ export class HostedProvider {
|
|
|
570
594
|
return this.#again(spec, name, last.value, signal);
|
|
571
595
|
return ok({ ...ref, ...(prepared.value.length > 0 ? { notes: prepared.value } : {}), ...(given === undefined ? {} : { resources: given }) });
|
|
572
596
|
}
|
|
597
|
+
/**
|
|
598
|
+
* The computer create kept for this name while the listing left it out (#keptUnlisted), read by its id now: undefined
|
|
599
|
+
* when there is none, or the read finds it gone or not this name's (the entry then goes). A read that fails fails the
|
|
600
|
+
* create, the entry kept: a retry never asks the vendor for a second computer while the first may still be up.
|
|
601
|
+
*/
|
|
602
|
+
async #keptOf(name, signal) {
|
|
603
|
+
const id = this.#keptUnlisted.get(name);
|
|
604
|
+
if (id === undefined)
|
|
605
|
+
return ok(undefined);
|
|
606
|
+
const read = await this.#get(id, signal);
|
|
607
|
+
if (!read.ok)
|
|
608
|
+
return this.#fail(read.error.code, `${name} (machine ${id}), which create kept while the listing left it out, could not be read, so no second computer is made: ${read.error.message}`);
|
|
609
|
+
if (read.value !== undefined && ours(read.value.labels, name) && alive(read.value.state))
|
|
610
|
+
return ok(read.value);
|
|
611
|
+
this.#keptUnlisted.delete(name);
|
|
612
|
+
return ok(undefined);
|
|
613
|
+
}
|
|
573
614
|
/**
|
|
574
615
|
* The one machine a request keeps. Two creates of one request on two provider instances can both find no machine by
|
|
575
616
|
* the name and both make one: #requests holds within one instance alone, and a vendor's name or label need not be
|
|
@@ -990,7 +1031,7 @@ export class HostedProvider {
|
|
|
990
1031
|
await opened.value.close();
|
|
991
1032
|
}
|
|
992
1033
|
const listed = await this.#waitListed(ref, signal);
|
|
993
|
-
return listed.ok ? ok([...closed, ...notes]) : listed;
|
|
1034
|
+
return listed.ok ? ok([...closed, ...notes, ...listed.value]) : listed;
|
|
994
1035
|
}
|
|
995
1036
|
/** What init wrote to its log (child) or the vendor's words of the machine (pid1): the end of it, or nothing. */
|
|
996
1037
|
async #initWords(ref) {
|
|
@@ -1121,7 +1162,7 @@ export class HostedProvider {
|
|
|
1121
1162
|
const dialed = this.#dialed();
|
|
1122
1163
|
const to = "problem" in dialed ? "this server" : dialed.attach;
|
|
1123
1164
|
const through = this.#attachEgress === undefined ? "" : ` through ${this.#attachEgress}`;
|
|
1124
|
-
return this.#fail("timeout", `${ref.name} did not dial ${to}${through} within ${seconds(createMs)}: the machine must reach that address, and run agentrun-dial (the box image's entrypoint while AGENTRUN_ATTACH_URL is set)`);
|
|
1165
|
+
return this.#fail("timeout", `${ref.name} did not dial ${to}${through} within ${seconds(createMs)}: the machine must reach that address, and run agentrun-dial (the box image's entrypoint while AGENTRUN_ATTACH_URL is set, or the provider's own start of it)${await this.#dialWords(ref, signal)}`);
|
|
1125
1166
|
}
|
|
1126
1167
|
const polled = pause(Math.min(this.#startPollMs(), left), signal).then(() => false);
|
|
1127
1168
|
reading ??= this.#dialRefused(ref.name, Math.min(requestMs, left), signal);
|
|
@@ -1136,6 +1177,24 @@ export class HostedProvider {
|
|
|
1136
1177
|
return this.#fail("aborted", `create was aborted while it waited for ${ref.name} to dial`);
|
|
1137
1178
|
}
|
|
1138
1179
|
}
|
|
1180
|
+
/**
|
|
1181
|
+
* A dial timeout's last words: what the host's dialLog read of agentrun-dial, every machine token replaced by
|
|
1182
|
+
* `<token>`, its last DIAL_LOG_LINES lines within DIAL_LOG_CHARS characters, or that it never started. Nothing for a
|
|
1183
|
+
* host without dialLog, or a read that fails, outlasts requestMs or is cut by the create's signal, so a cancel never
|
|
1184
|
+
* waits on it.
|
|
1185
|
+
*/
|
|
1186
|
+
async #dialWords(ref, signal) {
|
|
1187
|
+
const { dialLog } = this.host;
|
|
1188
|
+
if (dialLog === undefined)
|
|
1189
|
+
return "";
|
|
1190
|
+
const read = await this.#call(`the dial log of ${ref.name}`, (ctx) => dialLog.call(this.host, ref.id, ctx), this.#timeouts.requestMs, signal);
|
|
1191
|
+
if (!read.ok)
|
|
1192
|
+
return "";
|
|
1193
|
+
if (read.value === undefined)
|
|
1194
|
+
return "; agentrun-dial never started";
|
|
1195
|
+
const lines = read.value.replaceAll(MACHINE_TOKEN, "<token>").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "");
|
|
1196
|
+
return lines.length === 0 ? "; agentrun-dial wrote nothing" : `; agentrun-dial said: ${lines.slice(-DIAL_LOG_LINES).join(" | ").slice(-DIAL_LOG_CHARS)}`;
|
|
1197
|
+
}
|
|
1139
1198
|
/**
|
|
1140
1199
|
* Its tools' network as they meet it, against the one create made: the probe, as the computer's own user. Under none,
|
|
1141
1200
|
* no target answers. Under open or a list, still none answers directly (their own loopback alone), init's relay
|
|
@@ -1194,30 +1253,53 @@ export class HostedProvider {
|
|
|
1194
1253
|
* Create waits until the listing shows the new computer on two consecutive polls at least listedStableMs apart (and on
|
|
1195
1254
|
* every poll between), so list() shows it once create returns: a listing that showed it once and then not starts over.
|
|
1196
1255
|
* The polls are 150 ms apart at first, the pause doubling up to pollMs, so a vendor slow to list costs a few calls.
|
|
1256
|
+
* A listing that has not settled by listedMs is no failure alone (#unlisted): the computer is read by its id.
|
|
1197
1257
|
*/
|
|
1198
1258
|
async #waitListed(ref, signal) {
|
|
1199
1259
|
const { listedMs, listMs, pollMs, listedStableMs } = this.#timeouts;
|
|
1200
|
-
const
|
|
1260
|
+
const began = Date.now();
|
|
1261
|
+
const until = began + listedMs;
|
|
1201
1262
|
let since;
|
|
1263
|
+
const seen = { polls: 0, shown: 0 };
|
|
1202
1264
|
for (let hits = 0, delay = Math.min(LISTED_POLL_MS, pollMs);; delay = Math.min(delay * 2, pollMs)) {
|
|
1203
1265
|
const listed = await listedBy(this.host, "the listing by name", byName(ref.name), listMs, signal);
|
|
1204
1266
|
if (!listed.ok)
|
|
1205
1267
|
return listed;
|
|
1268
|
+
seen.polls += 1;
|
|
1206
1269
|
if (listed.value.some((machine) => machine.id === ref.id)) {
|
|
1207
1270
|
hits += 1;
|
|
1271
|
+
seen.shown += 1;
|
|
1208
1272
|
since ??= Date.now();
|
|
1209
1273
|
}
|
|
1210
1274
|
else
|
|
1211
1275
|
[hits, since] = [0, undefined];
|
|
1212
1276
|
if (hits >= LISTED_ROUNDS && since !== undefined && Date.now() - since >= listedStableMs)
|
|
1213
|
-
return ok(
|
|
1277
|
+
return ok([]);
|
|
1214
1278
|
if (Date.now() >= until)
|
|
1215
|
-
return this.#
|
|
1279
|
+
return this.#unlisted(ref, { ...seen, ms: Date.now() - began }, signal);
|
|
1216
1280
|
await pause(Math.min(delay, until - Date.now()), signal);
|
|
1217
1281
|
if (signal?.aborted)
|
|
1218
1282
|
return this.#fail("aborted", "create was aborted while it waited for the listing");
|
|
1219
1283
|
}
|
|
1220
1284
|
}
|
|
1285
|
+
/**
|
|
1286
|
+
* A new computer the listing did not show twice in a row within listedMs, read by its id: one that reads running and
|
|
1287
|
+
* carries its labels is kept, the note saying so (create already reached its daemon and checked it from inside, so only
|
|
1288
|
+
* the vendor's listing lags; list() leaves it out until that listing shows it). Any other answer, or a read that fails,
|
|
1289
|
+
* is a timeout naming the labels asked for, the machine, the polls and the time waited.
|
|
1290
|
+
*/
|
|
1291
|
+
async #unlisted(ref, seen, signal) {
|
|
1292
|
+
const asked = Object.entries(byName(ref.name)).map(([key, value]) => `${key}=${value}`).join(", ");
|
|
1293
|
+
const what = `the listing by the labels ${asked} did not show ${ref.name} (machine ${ref.id}) on ${LISTED_ROUNDS} polls in a row within ${seconds(this.#timeouts.listedMs)} (${seen.polls} polls in ${seconds(seen.ms)}, ${seen.shown} of them showed it)`;
|
|
1294
|
+
const read = await this.#own(ref, signal);
|
|
1295
|
+
if (signal?.aborted)
|
|
1296
|
+
return this.#fail("aborted", "create was aborted while it waited for the listing");
|
|
1297
|
+
if (read.ok && read.value.state === "running") {
|
|
1298
|
+
this.#keptUnlisted.set(ref.name, ref.id);
|
|
1299
|
+
return ok([`${what}; a read by its id finds it running with its labels, so it is kept: the vendor's listing trails its create, and list() leaves the computer out until it shows it`]);
|
|
1300
|
+
}
|
|
1301
|
+
return this.#fail("timeout", `${what}; ${read.ok ? `a read by its id finds it ${read.value.state}` : `a read by its id: ${read.error.message}`}`);
|
|
1302
|
+
}
|
|
1221
1303
|
/** This provider's machine for ref, as the vendor reads it, or why not. */
|
|
1222
1304
|
async #own(ref, signal) {
|
|
1223
1305
|
const found = await this.#get(ref.id, signal);
|
|
@@ -1539,6 +1621,8 @@ export class HostedProvider {
|
|
|
1539
1621
|
return this.#fail("unsupported", `${a(this.#label)} computer is deleted, never stopped and kept: release it with delete`);
|
|
1540
1622
|
if (how !== "delete")
|
|
1541
1623
|
return this.#fail("invalid", `release is "delete", not ${String(how)}`);
|
|
1624
|
+
if (this.#keptUnlisted.get(ref.name) === ref.id)
|
|
1625
|
+
this.#keptUnlisted.delete(ref.name);
|
|
1542
1626
|
const found = await this.#get(ref.id);
|
|
1543
1627
|
if (!found.ok)
|
|
1544
1628
|
return found;
|
package/dist/hosted/scripts.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { ComputerCapabilities, ComputerConnection } from "../provider.js";
|
|
|
3
3
|
import { type Result } from "../result.js";
|
|
4
4
|
/** Who ran install, from its output's `installer <uid> <name>[ sudo]` line, in words; undefined when it has none. */
|
|
5
5
|
export declare function installerOf(output: string): string | undefined;
|
|
6
|
+
/** One word for a shell, single-quoted. */
|
|
7
|
+
export declare const quote: (word: string) => string;
|
|
6
8
|
/** One string for a shell: `sh -c '<script>' sh '<arg>' ...`, every word quoted. */
|
|
7
9
|
export declare const shellCommand: (script: string, args: readonly string[]) => string;
|
|
8
10
|
/** One argv as one shell line, every word but a plain one ("sh", "-c") single-quoted: for a vendor whose exec takes a line. */
|
|
@@ -57,6 +59,19 @@ export declare function hostedCommands({ staging, deadline, user, display, maxDe
|
|
|
57
59
|
rootOnly?: readonly string[];
|
|
58
60
|
workspace?: boolean;
|
|
59
61
|
}): HostedCommands;
|
|
62
|
+
/**
|
|
63
|
+
* The shell line a provider that starts agentrun-dial itself runs, as root, under umask 077 whatever the vendor's, as on
|
|
64
|
+
* the exec path (START_SCRIPT): init's start log is root's alone, and init and every program the computer runs inherit
|
|
65
|
+
* 077 (init gives /work to the computer's user, 0700). On
|
|
66
|
+
* dial the adapter runs nothing in the machine, so the line runs the steps the exec path runs before init first:
|
|
67
|
+
* rootOnly made root's alone when it names paths (HostFacts.rootOnly), then the session buses in /tmp closed
|
|
68
|
+
* (SESSION_BUSES). Joined by &&, so a step that fails starts nothing, and the machine never dials. attach, when given, is
|
|
69
|
+
* AGENTRUN_ATTACH_URL's quoted assignment on the line.
|
|
70
|
+
*/
|
|
71
|
+
export declare function dialLaunch({ rootOnly, attach }?: {
|
|
72
|
+
rootOnly?: readonly string[] | undefined;
|
|
73
|
+
attach?: string;
|
|
74
|
+
}): string;
|
|
60
75
|
export interface ChildCommandOptions {
|
|
61
76
|
/** Where the vendor's upload left the daemon. */
|
|
62
77
|
staging?: string;
|
package/dist/hosted/scripts.js
CHANGED
|
@@ -84,7 +84,8 @@ const INIT_SCRIPT = [
|
|
|
84
84
|
* Like init, it runs the daemon only when its path is root's alone (`held`), so a computer attached from an older
|
|
85
85
|
* install is checked too. */
|
|
86
86
|
const STDIO_SCRIPT = ["# agentrun-computer: stdio", "d=$1; r=$2", HELD, 'held "$d" >&2 || exit 6', ROOT, `exec $p env -i PATH=${PATH} AGENTRUN_COMPUTERD_SOCKET="$r/computerd.sock" "$d" stdio`].join("\n");
|
|
87
|
-
|
|
87
|
+
/** One word for a shell, single-quoted. */
|
|
88
|
+
export const quote = (word) => `'${word.replaceAll("'", "'\\''")}'`;
|
|
88
89
|
/** One string for a shell: `sh -c '<script>' sh '<arg>' ...`, every word quoted. */
|
|
89
90
|
export const shellCommand = (script, args) => ["sh", "-c", quote(script), "sh", ...args.map(quote)].join(" ");
|
|
90
91
|
/** One argv as one shell line, every word but a plain one ("sh", "-c") single-quoted: for a vendor whose exec takes a line. */
|
|
@@ -96,9 +97,10 @@ export const AGENTRUN_DIAL = "/usr/local/bin/agentrun-dial";
|
|
|
96
97
|
export const INIT_LOG = `${SOCKET_DIR}-init.log`;
|
|
97
98
|
/**
|
|
98
99
|
* Starts init detached from the call that starts it: in a session of its own (setsid), its output to the log, its stdin
|
|
99
|
-
* none, so the vendor's call ends at once and nothing of it holds init. As root, or through passwordless sudo
|
|
100
|
+
* none, so the vendor's call ends at once and nothing of it holds init. As root, or through passwordless sudo, under
|
|
101
|
+
* umask 077, so the log is root's alone whatever the vendor's umask.
|
|
100
102
|
*/
|
|
101
|
-
const START_SCRIPT = ["# agentrun-computer: start", "l=$1; shift", ROOT, `exec $p sh -c 'exec >"$0" 2>&1 </dev/null; setsid "$@" &' "$l" "$@"`].join("\n");
|
|
103
|
+
const START_SCRIPT = ["# agentrun-computer: start", "l=$1; shift", ROOT, `exec $p sh -c 'umask 077; exec >"$0" 2>&1 </dev/null; setsid "$@" &' "$l" "$@"`].join("\n");
|
|
102
104
|
/**
|
|
103
105
|
* The session buses a vendor's own processes leave in /tmp (Daytona's D-Bus, /tmp/dbus-Y8OW6E3FDx), which no network
|
|
104
106
|
* namespace cuts: every child host's create closes them to the computer's user before init starts. The window
|
|
@@ -209,6 +211,23 @@ export function hostedCommands({ staging = "", deadline = "", user = TOOL_USER,
|
|
|
209
211
|
entrypoint: argvOf(ENTRYPOINT_SCRIPT, [DAEMON_IN_COMPUTER, String(waitS), WORK, display, nonce, ...(gate === undefined ? [] : ["--gate", gate]), ...initArgs]),
|
|
210
212
|
};
|
|
211
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* The shell line a provider that starts agentrun-dial itself runs, as root, under umask 077 whatever the vendor's, as on
|
|
216
|
+
* the exec path (START_SCRIPT): init's start log is root's alone, and init and every program the computer runs inherit
|
|
217
|
+
* 077 (init gives /work to the computer's user, 0700). On
|
|
218
|
+
* dial the adapter runs nothing in the machine, so the line runs the steps the exec path runs before init first:
|
|
219
|
+
* rootOnly made root's alone when it names paths (HostFacts.rootOnly), then the session buses in /tmp closed
|
|
220
|
+
* (SESSION_BUSES). Joined by &&, so a step that fails starts nothing, and the machine never dials. attach, when given, is
|
|
221
|
+
* AGENTRUN_ATTACH_URL's quoted assignment on the line.
|
|
222
|
+
*/
|
|
223
|
+
export function dialLaunch({ rootOnly = [], attach } = {}) {
|
|
224
|
+
return [
|
|
225
|
+
"umask 077",
|
|
226
|
+
...(rootOnly.length > 0 ? [shellLine(hostedCommands({ rootOnly }).rootOnly)] : []),
|
|
227
|
+
shellLine(hostedCommands().sockets),
|
|
228
|
+
`${attach === undefined ? "" : `AGENTRUN_ATTACH_URL=${quote(attach)} `}exec ${AGENTRUN_DIAL}`,
|
|
229
|
+
].join(" && ");
|
|
230
|
+
}
|
|
212
231
|
/**
|
|
213
232
|
* init's flags, as start and a pid1 entrypoint give them: the deadline, the user, --own-network, and the most
|
|
214
233
|
* deadline.extend may move it to, the network form and --window-manager where given. A dial machine's
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export * from "./mount.js";
|
|
|
7
7
|
export { type CallOptions, DaemonClient, type DaemonStream, findNodes, refusedStep, type UiActOptions, type UiQuery, UiSession } from "./client.js";
|
|
8
8
|
export { type ActionFailure, type CheckActionsOptions, checkActions, isKey } from "./actions.js";
|
|
9
9
|
export { pullTar, pullTarStream, pushTar, readFile, writeFile, type PulledTar } from "./files.js";
|
|
10
|
-
export { type FolderMeta, FolderSync, folderPathProblem,
|
|
11
|
-
export {
|
|
10
|
+
export { type FolderMeta, FolderSync, folderPathProblem, SYNC_MAX_BYTES, SYNC_MAX_ENTRIES, type SyncCounts, type SyncSink } from "./sync-folder.js";
|
|
11
|
+
export { type TarEntry, TarReader, tarEntry, tarOf, tarStream, untar, untarStream } from "./tar.js";
|
|
12
12
|
export { listProcesses, readAll, type ReadAllResult } from "./processes.js";
|
|
13
13
|
export { type ActionMapper, createActionMapper, daemonWatch, redactWords, type ScreenFrame, type ScreenFrames, type ScreenWatch, ScreenWatchError, type ScreenWatchHandlers, toAction, type ViewerEvent, type WatchEndCode, watchEndCode, type WatchOptions, watchScreen, } from "./screen-watch.js";
|
|
14
14
|
export type { HostCall, HostFacts, Machine, MachineHost, MachineProcess, MachineRequest } from "./host.js";
|
|
@@ -26,7 +26,7 @@ export { EPOCH_LABEL, epochOf, epochProblem, IDLE_TTL_LABEL, OWNER_LABEL, OWNER_
|
|
|
26
26
|
export { waitUntil, type WaitOptions } from "./wait.js";
|
|
27
27
|
export { type BuiltinProviderId, type ConformanceModule, descriptorOf, isProviderId, type ProviderEnv, providerFor, type ProviderId, providerIds, type ProviderModule, providerModule, type ProviderOptions, providers, } from "./providers.js";
|
|
28
28
|
export { connectOf, type DescriptorKey, type DescriptorSetting, defineProvider, descriptorProblems, type HostCommand, mountsOf, type ParkedConfiguration, type ProviderDescriptor } from "./descriptor.js";
|
|
29
|
-
export { AGENT37, AGENT37_BASE_TEMPLATE, BOXD, BOXD_DEFAULT_IMAGE, BROWSER_IMAGE, BROWSERBASE, DAYTONA, DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT, type DaytonaGpuSnapshot, DESCRIPTORS, daytonaGpu, daytonaGpuSnapshot, DOCKER, E2B, KERNEL, LOCAL, MODAL, MORPH, ORGO, ORGO_BASE_IMAGE, PHONE_GROUPS, PHONE_HARNESS, PHONE_IMAGE, SMOLCLOUD, } from "./descriptors/index.js";
|
|
29
|
+
export { AGENT37, AGENT37_BASE_TEMPLATE, BOXD, BOXD_DEFAULT_IMAGE, BROWSER_IMAGE, BROWSERBASE, DAYTONA, DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT, type DaytonaGpuSnapshot, DESCRIPTORS, daytonaGpu, daytonaGpuSnapshot, DOCKER, E2B, GROUNDBOX, GROUNDBOX_OWN_IMAGE, KERNEL, LOCAL, MODAL, MORPH, ORGO, ORGO_BASE_IMAGE, PHONE_GROUPS, PHONE_HARNESS, PHONE_IMAGE, SMOLCLOUD, } from "./descriptors/index.js";
|
|
30
30
|
export type { PhoneLedger, PhoneLedgerEntry } from "./phone-harness.js";
|
|
31
31
|
export { configurationOf, entryOf, imagesOf, type KindCapabilities, kindOf, kindServed, type ProviderEntry, PROVIDERS, serves, servingRefusals, type TestConnection, type TestConnectionOptions, } from "./kinds.js";
|
|
32
32
|
export { type ComputerSettingKind, SETTING_KIND_NAMES, SETTING_KINDS, type SettingKindSpec } from "./setting-kinds.js";
|
package/dist/index.js
CHANGED
|
@@ -7,14 +7,14 @@ export * from "./mount.js";
|
|
|
7
7
|
export { DaemonClient, findNodes, refusedStep, UiSession } from "./client.js";
|
|
8
8
|
export { checkActions, isKey } from "./actions.js";
|
|
9
9
|
export { pullTar, pullTarStream, pushTar, readFile, writeFile } from "./files.js";
|
|
10
|
-
export { FolderSync, folderPathProblem,
|
|
11
|
-
export {
|
|
10
|
+
export { FolderSync, folderPathProblem, SYNC_MAX_BYTES, SYNC_MAX_ENTRIES } from "./sync-folder.js";
|
|
11
|
+
export { TarReader, tarEntry, tarOf, tarStream, untar, untarStream } from "./tar.js";
|
|
12
12
|
export { listProcesses, readAll } from "./processes.js";
|
|
13
13
|
export { createActionMapper, daemonWatch, redactWords, ScreenWatchError, toAction, watchEndCode, watchScreen, } from "./screen-watch.js";
|
|
14
14
|
export { HostedProvider, hostedDaemonPath } from "./hosted/provider.js";
|
|
15
15
|
// The provider classes and their option types are not here: each provider loads by its id through the registry
|
|
16
16
|
// (providerFor), or from its own subpath (@parcha/agentrun-computer/docker, /daytona, /modal, /e2b, /agent37, /morph, /orgo,
|
|
17
|
-
// /phone-harness, /browserbase, /kernel, /local, /smolcloud: each the provider file's name).
|
|
17
|
+
// /phone-harness, /browserbase, /kernel, /local, /smolcloud, /groundbox: each the provider file's name).
|
|
18
18
|
export { VOLUME_SUBPATH_ENGINE } from "./docker/volume.js";
|
|
19
19
|
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";
|
|
20
20
|
export { EGRESS_IMAGE, EGRESS_LABEL, EGRESS_MOUNT, EGRESS_SOCKET } from "./docker/egress.js";
|
|
@@ -30,7 +30,7 @@ export { EPOCH_LABEL, epochOf, epochProblem, IDLE_TTL_LABEL, OWNER_LABEL, OWNER_
|
|
|
30
30
|
export { waitUntil } from "./wait.js";
|
|
31
31
|
export { descriptorOf, isProviderId, providerFor, providerIds, providerModule, providers, } from "./providers.js";
|
|
32
32
|
export { connectOf, defineProvider, descriptorProblems, mountsOf } from "./descriptor.js";
|
|
33
|
-
export { AGENT37, AGENT37_BASE_TEMPLATE, BOXD, BOXD_DEFAULT_IMAGE, BROWSER_IMAGE, BROWSERBASE, DAYTONA, DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT, DESCRIPTORS, daytonaGpu, daytonaGpuSnapshot, DOCKER, E2B, KERNEL, LOCAL, MODAL, MORPH, ORGO, ORGO_BASE_IMAGE, PHONE_GROUPS, PHONE_HARNESS, PHONE_IMAGE, SMOLCLOUD, } from "./descriptors/index.js";
|
|
33
|
+
export { AGENT37, AGENT37_BASE_TEMPLATE, BOXD, BOXD_DEFAULT_IMAGE, BROWSER_IMAGE, BROWSERBASE, DAYTONA, DAYTONA_DEFAULT_SNAPSHOT, DAYTONA_GPU_SNAPSHOT, DESCRIPTORS, daytonaGpu, daytonaGpuSnapshot, DOCKER, E2B, GROUNDBOX, GROUNDBOX_OWN_IMAGE, KERNEL, LOCAL, MODAL, MORPH, ORGO, ORGO_BASE_IMAGE, PHONE_GROUPS, PHONE_HARNESS, PHONE_IMAGE, SMOLCLOUD, } from "./descriptors/index.js";
|
|
34
34
|
export { configurationOf, entryOf, imagesOf, kindOf, kindServed, PROVIDERS, serves, servingRefusals, } from "./kinds.js";
|
|
35
35
|
export { SETTING_KIND_NAMES, SETTING_KINDS } from "./setting-kinds.js";
|
|
36
36
|
export * from "./conformance/index.js";
|
package/dist/sync-folder.d.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { type ComputerClient } from "./protocol.js";
|
|
2
2
|
import { type Result } from "./result.js";
|
|
3
|
+
import { type TarEntry } from "./tar.js";
|
|
3
4
|
/** The most entries (files, directories and links) a synced folder holds: over it, a sync fails, kind limit. */
|
|
4
5
|
export declare const SYNC_MAX_ENTRIES = 20000;
|
|
5
6
|
/** The most bytes a synced folder's files hold together: over it, a sync fails, kind limit. */
|
|
6
7
|
export declare const SYNC_MAX_BYTES: number;
|
|
7
|
-
/**
|
|
8
|
-
* The mtime (whole seconds) a push into a synced folder gives each file, in its tar header, which computerd's extraction
|
|
9
|
-
* keeps: 2000-01-01T00:00:00Z. Older than any reading of the computer's clock, so a write after the push, even in its
|
|
10
|
-
* own clock tick, never leaves a file at it, and the newest mtime in a listing that holds such a write is still one of
|
|
11
|
-
* the computer's clock, as the racy rule needs. Not 1970: a zip of the folder can't hold a time before 1980.
|
|
12
|
-
*/
|
|
13
|
-
export declare const PUSHED_MTIME = 946684800;
|
|
14
8
|
/**
|
|
15
9
|
* The folder's modes and links: what an object store keeps no record of. A mode is listed where it is not the default
|
|
16
10
|
* (0644 for a file, 0755 for a directory); a link by its target, as written, never followed.
|
|
@@ -55,9 +49,19 @@ export declare class FolderSync {
|
|
|
55
49
|
now?: () => number;
|
|
56
50
|
});
|
|
57
51
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* it
|
|
52
|
+
* `entries` (the sink's copy of the folder) pushed into the computer's folder as one streaming tar, each file at
|
|
53
|
+
* PUSHED_MTIME, then the baseline taken: the rule a push into a synced folder keeps, in one place. `entries` is read
|
|
54
|
+
* only as pushTar reads it, so an abort or a failing source ends it as it ends any push (a source that throws is a
|
|
55
|
+
* failed push, and the source is let go). A failure says which step it was: "could not be pushed into the computer:
|
|
56
|
+
* ..." or "pushed into the computer could not be listed: ...", its code kept.
|
|
57
|
+
*/
|
|
58
|
+
push(entries: AsyncIterable<TarEntry> | Iterable<TarEntry>, options?: {
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
}): Promise<Result<void>>;
|
|
61
|
+
/**
|
|
62
|
+
* The manifest of a folder just pushed from the sink, each file at PUSHED_MTIME (push() does both), read, never
|
|
63
|
+
* guessed: what it lists is what the sink holds, so nothing is pulled, and a later write moves a file's mtime off the
|
|
64
|
+
* one it lists. Over a cap, it fails, kind limit.
|
|
61
65
|
*/
|
|
62
66
|
baseline(options?: {
|
|
63
67
|
signal?: AbortSignal;
|
package/dist/sync-folder.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
// re-read, a touch) are not put again. While a directory the computer's user can't read hides what the sink holds under
|
|
12
12
|
// it (files.list lists one without what it holds), a sync writes nothing and fails in words.
|
|
13
13
|
import { createHash } from "node:crypto";
|
|
14
|
-
import { pullTarStream } from "./files.js";
|
|
14
|
+
import { pullTarStream, pushTar } from "./files.js";
|
|
15
15
|
import { WORKSPACE } from "./mount.js";
|
|
16
16
|
import { MAX_CHUNK_BYTES, MAX_LIST_DEPTH, MAX_LIST_ENTRIES } from "./protocol.js";
|
|
17
|
-
import { fail, ok } from "./result.js";
|
|
18
|
-
import { untarStream } from "./tar.js";
|
|
17
|
+
import { fail, failAs, ok } from "./result.js";
|
|
18
|
+
import { tarStream, untarStream } from "./tar.js";
|
|
19
19
|
/** The most entries (files, directories and links) a synced folder holds: over it, a sync fails, kind limit. */
|
|
20
20
|
export const SYNC_MAX_ENTRIES = 20_000;
|
|
21
21
|
/** The most bytes a synced folder's files hold together: over it, a sync fails, kind limit. */
|
|
@@ -30,7 +30,7 @@ const RACY_MS = 1000;
|
|
|
30
30
|
* own clock tick, never leaves a file at it, and the newest mtime in a listing that holds such a write is still one of
|
|
31
31
|
* the computer's clock, as the racy rule needs. Not 1970: a zip of the folder can't hold a time before 1980.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
const PUSHED_MTIME = 946_684_800;
|
|
34
34
|
const TOO_MANY = `the run's folder holds more than ${SYNC_MAX_ENTRIES} entries, the most a synced folder holds`;
|
|
35
35
|
const FILE_MODE = 0o644;
|
|
36
36
|
const DIR_MODE = 0o755;
|
|
@@ -132,9 +132,27 @@ export class FolderSync {
|
|
|
132
132
|
this.#now = now;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* it
|
|
135
|
+
* `entries` (the sink's copy of the folder) pushed into the computer's folder as one streaming tar, each file at
|
|
136
|
+
* PUSHED_MTIME, then the baseline taken: the rule a push into a synced folder keeps, in one place. `entries` is read
|
|
137
|
+
* only as pushTar reads it, so an abort or a failing source ends it as it ends any push (a source that throws is a
|
|
138
|
+
* failed push, and the source is let go). A failure says which step it was: "could not be pushed into the computer:
|
|
139
|
+
* ..." or "pushed into the computer could not be listed: ...", its code kept.
|
|
140
|
+
*/
|
|
141
|
+
async push(entries, options = {}) {
|
|
142
|
+
const stamped = (async function* () {
|
|
143
|
+
for await (const entry of entries)
|
|
144
|
+
yield entry.type === "file" ? { ...entry, mtime: PUSHED_MTIME } : entry;
|
|
145
|
+
})();
|
|
146
|
+
const pushed = await pushTar(this.#client, this.#root, tarStream(stamped), options);
|
|
147
|
+
if (!pushed.ok)
|
|
148
|
+
return failAs(pushed.error, `could not be pushed into the computer: ${pushed.error.message}`);
|
|
149
|
+
const listed = await this.baseline(options);
|
|
150
|
+
return listed.ok ? listed : failAs(listed.error, `pushed into the computer could not be listed: ${listed.error.message}`);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The manifest of a folder just pushed from the sink, each file at PUSHED_MTIME (push() does both), read, never
|
|
154
|
+
* guessed: what it lists is what the sink holds, so nothing is pulled, and a later write moves a file's mtime off the
|
|
155
|
+
* one it lists. Over a cap, it fails, kind limit.
|
|
138
156
|
*/
|
|
139
157
|
async baseline(options = {}) {
|
|
140
158
|
const listed = await this.#list(options.signal);
|
package/dist/tar.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ export interface TarEntry {
|
|
|
10
10
|
*/
|
|
11
11
|
mtime?: number;
|
|
12
12
|
}
|
|
13
|
-
/** The latest mtime a ustar header holds: 11 octal digits of seconds. */
|
|
14
|
-
export declare const MAX_TAR_MTIME: number;
|
|
15
13
|
/** One entry's blocks: a pax header first where its name or link does not fit ustar's 100 bytes, then its own, its body and the padding. */
|
|
16
14
|
export declare function tarEntry(entry: TarEntry): Buffer[];
|
|
17
15
|
/** A whole archive of these entries. */
|
package/dist/tar.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// ways: ustar out, with a pax header for a name or a link target past ustar's 100 bytes; ustar, pax and GNU long names
|
|
3
3
|
// in, one entry at a time, each with its whole body, so what is held is one entry, never the archive.
|
|
4
4
|
/** The latest mtime a ustar header holds: 11 octal digits of seconds. */
|
|
5
|
-
|
|
5
|
+
const MAX_TAR_MTIME = 8 ** 11 - 1;
|
|
6
6
|
const BLOCK = 512;
|
|
7
7
|
const END = Buffer.alloc(2 * BLOCK);
|
|
8
8
|
const TYPE_FLAG = { file: "0", dir: "5", symlink: "2", other: "0" };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# The documents box image: the Docker box's default image (DOCKER_RECIPE in src/docker/image.ts, on the same base digest
|
|
2
|
+
# and with the same programs) plus the libraries that write decks, documents and sheets, which a box with no network
|
|
3
|
+
# can't install: python-pptx, python-docx and openpyxl for python3, pptxgenjs, docx and exceljs for node. The libraries
|
|
4
|
+
# are documents.sh's, beside this file, the one layer Daytona's documents snapshot runs on the box image too
|
|
5
|
+
# (box/build-daytona.py --documents); its comment says how each is pinned and where it goes.
|
|
6
|
+
#
|
|
7
|
+
# It is built from this folder and named to serve in AGENTRUN_DOCKER_IMAGE, the one setting that picks a Docker box's
|
|
8
|
+
# image. From the repository's root:
|
|
9
|
+
#
|
|
10
|
+
# tag=agentrun-documents:$(cat packages/computer/documents/Dockerfile packages/computer/documents/documents.sh | sha256sum | cut -c1-12)
|
|
11
|
+
# docker build -t "$tag" packages/computer/documents
|
|
12
|
+
# AGENTRUN_DOCKER_IMAGE=$tag AGENTRUN_BOXES=docker node packages/serve/dist/cli.js
|
|
13
|
+
#
|
|
14
|
+
# The tag is the first 12 hex digits of the sha256 of this file and documents.sh, as a recipe's tag is: an edit to
|
|
15
|
+
# either is a new tag. The base is pinned by digest, the Debian packages by a snapshot.debian.org instant (over https),
|
|
16
|
+
# the Python libraries by version and sha256, and the Node libraries by version and npm's --before at that same instant
|
|
17
|
+
# (by date, not by content). Nothing in it holds a key, and nothing in it is fetched when a box runs. An agent that
|
|
18
|
+
# needs them says so in computer.needs (["python-pptx", "pptxgenjs"], say), which each run checks in its box before its
|
|
19
|
+
# first model request.
|
|
20
|
+
FROM python:3.12-slim@sha256:b18b261e1b4974b4f321451ad5251ded85abb22c2b8b262da527dda1d031ab30
|
|
21
|
+
|
|
22
|
+
# The default image's programs, from the snapshot the header names, over https (the base has apt's https method and the
|
|
23
|
+
# CA certificates); a snapshot's index is past its Valid-Until date, so apt is told not to refuse it for that.
|
|
24
|
+
RUN sed -i -E 's#^URIs: http://deb\.debian\.org/(debian|debian-security)$#URIs: https://snapshot.debian.org/archive/\1/20261121T204200Z#' /etc/apt/sources.list.d/debian.sources \
|
|
25
|
+
&& ! grep -q 'deb\.debian\.org' /etc/apt/sources.list.d/debian.sources \
|
|
26
|
+
&& apt-get -o Acquire::Check-Valid-Until=false update \
|
|
27
|
+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git curl ca-certificates nodejs npm ripgrep socat \
|
|
28
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
29
|
+
|
|
30
|
+
# The libraries.
|
|
31
|
+
COPY documents.sh /tmp/agentrun-documents/documents.sh
|
|
32
|
+
RUN sh /tmp/agentrun-documents/documents.sh && rm -rf /tmp/agentrun-documents
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# The documents layer, as POSIX shell run as root: the libraries that write decks, documents and sheets, on a Debian
|
|
3
|
+
# with python3 (and its pip) and Debian's node and npm. The Docker box's documents image runs it on the default recipe's
|
|
4
|
+
# base (this folder's Dockerfile), and Daytona's documents snapshot runs it on the box image (box/build-daytona.py
|
|
5
|
+
# --documents), so both hold the same libraries at the same versions.
|
|
6
|
+
#
|
|
7
|
+
# Python: python-pptx, python-docx and openpyxl, and every package they need, each at an exact version and checked
|
|
8
|
+
# against its sha256 (a wheel for amd64 and one for arm64 where the package is built per machine), wheels
|
|
9
|
+
# only, nothing pip picks itself. Into the system's site-packages, so any user's python3 imports them.
|
|
10
|
+
# Node: pptxgenjs, docx and exceljs at exact versions, their dependencies as the registry had them at the instant
|
|
11
|
+
# npm's --before names (the instant the documents image's Debian snapshot names), no install script run.
|
|
12
|
+
# Into a folder of their own, linked as /node_modules: Node looks for a package in node_modules of every
|
|
13
|
+
# folder above a script, up to /, so a script anywhere requires or imports them, with no NODE_PATH (a box's
|
|
14
|
+
# commands get PATH and HOME, not the image's environment).
|
|
15
|
+
#
|
|
16
|
+
# It reads the network only through pip (PyPI) and npm (the registry), and ends by loading each library as an agent
|
|
17
|
+
# would, so a build that is missing one fails here.
|
|
18
|
+
set -eu
|
|
19
|
+
|
|
20
|
+
requirements=$(mktemp)
|
|
21
|
+
cat > "$requirements" <<'REQUIREMENTS'
|
|
22
|
+
python-pptx==1.0.2 --hash=sha256:160838e0b8565a8b1f67947675886e9fea18aa5e795db7ae531606d68e785cba
|
|
23
|
+
python-docx==1.2.0 --hash=sha256:3fd478f3250fbbbfd3b94fe1e985955737c145627498896a8a6bf81f4baf66c7
|
|
24
|
+
openpyxl==3.1.5 --hash=sha256:5282c12b107bffeef825f4617dc029afaf41d0ea60823bbb665ef3079dc79de2
|
|
25
|
+
et-xmlfile==2.0.0 --hash=sha256:7a91720bc756843502c3b7504c77b8fe44217c85c537d85037f0f536151b2caa
|
|
26
|
+
lxml==6.1.3 \
|
|
27
|
+
--hash=sha256:379f8a75cf6eb7eef0af074b55f49ab73b868388a98de14646abcdfa4564bb11 \
|
|
28
|
+
--hash=sha256:909f4e927bb051f7740d6367285fc60cdcfdaf0258c2dba4ff5ba7eadadc250c \
|
|
29
|
+
--hash=sha256:f683dc6300317700025e41d89a43e0276692ded16113a3c43eab704d605c58e5 \
|
|
30
|
+
--hash=sha256:b37772102d44bb6628186accca3a121b1fa3a6b3d97518a8c29a5229ca4c0d0a
|
|
31
|
+
pillow==13.0.0 \
|
|
32
|
+
--hash=sha256:42d63be3af4f9b951b199b0a9d23365d37ab14687e6d77b74940432c8515c4ca \
|
|
33
|
+
--hash=sha256:8bf295fe459343bc6093c8e5e0df60bfa189e0fcb775a22e2c2488fdeccc6c0d
|
|
34
|
+
xlsxwriter==3.3.3 --hash=sha256:2b83c5e184d872275e87718ebc88688acc258a50fc84dcad965b3d10be6e345f
|
|
35
|
+
typing-extensions==4.16.0 --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8
|
|
36
|
+
REQUIREMENTS
|
|
37
|
+
python3 -m pip install --require-hashes --no-deps --only-binary=:all: --no-cache-dir --disable-pip-version-check --root-user-action=ignore -r "$requirements"
|
|
38
|
+
rm "$requirements"
|
|
39
|
+
|
|
40
|
+
mkdir -p /usr/local/lib/agentrun-documents
|
|
41
|
+
npm install --prefix /usr/local/lib/agentrun-documents --no-audit --no-fund --ignore-scripts --before=2026-11-21T20:42:00Z pptxgenjs@4.0.1 docx@9.16.0 exceljs@4.4.0
|
|
42
|
+
npm cache clean --force
|
|
43
|
+
chmod -R a+rX /usr/local/lib/agentrun-documents
|
|
44
|
+
[ -e /node_modules ] || ln -s /usr/local/lib/agentrun-documents/node_modules /node_modules
|
|
45
|
+
|
|
46
|
+
# Each library as an agent loads it: Python's by import, Node's required from a folder that is not theirs.
|
|
47
|
+
python3 -c "import pptx, docx, openpyxl"
|
|
48
|
+
cd /tmp && node -e 'for (const name of ["pptxgenjs", "docx", "exceljs"]) require(name)'
|