@parcha/agentrun-computer 0.1.0-beta.39 → 0.1.0-beta.40
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 +25 -7
- package/box/Dockerfile +5 -54
- package/box/README.md +7 -2
- package/box/build-daytona.py +2 -2
- package/box/build-e2b.mjs +1 -1
- package/box/install.sh +87 -0
- package/box/recipe.mjs +12 -10
- package/dist/agent37.js +2 -1
- package/dist/computerd-linux-amd64 +0 -0
- package/dist/computerd-linux-arm64 +0 -0
- package/dist/computerd.json +2 -2
- package/dist/conformance/cases/isolation.js +17 -1
- package/dist/conformance/cases/lifetime.js +30 -0
- package/dist/conformance/cases/provider.js +47 -1
- package/dist/conformance/cli.js +23 -4
- package/dist/conformance/exec-stream.d.ts +37 -7
- package/dist/conformance/exec-stream.js +339 -87
- package/dist/conformance/report.js +3 -0
- package/dist/conformance/runner.js +127 -9
- package/dist/conformance/types.d.ts +21 -0
- package/dist/daytona.js +4 -2
- package/dist/host.d.ts +60 -19
- package/dist/host.js +5 -0
- package/dist/hosted/framed-exec.d.ts +49 -0
- package/dist/hosted/framed-exec.js +185 -0
- package/dist/hosted/process.d.ts +11 -5
- package/dist/hosted/process.js +30 -12
- package/dist/hosted/provider.d.ts +10 -5
- package/dist/hosted/provider.js +233 -36
- package/dist/hosted/rest.d.ts +10 -0
- package/dist/hosted/rest.js +15 -6
- package/dist/hosted/scripts.d.ts +8 -0
- package/dist/hosted/scripts.js +22 -0
- package/dist/hosted/values.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { MachineHost } from "../host.js";
|
|
2
2
|
/** The checks, in the order they run. */
|
|
3
|
-
export declare const EXEC_STREAM_CHECKS: readonly ["stdout-
|
|
3
|
+
export declare const EXEC_STREAM_CHECKS: readonly ["stdout-text", "stdin-text", "large", "stdout-live", "stdin-live", "stdout-unread", "stderr", "exit-code", "kill", "no-timeout"];
|
|
4
4
|
export type ExecStreamCheckId = (typeof EXEC_STREAM_CHECKS)[number];
|
|
5
|
+
/** What the capability probe reads, in the order the report gives it. */
|
|
6
|
+
export declare const EXEC_STREAM_FACTS: readonly ["root", "netns", "fuse", "arch", "kernel", "listeners"];
|
|
7
|
+
export type ExecStreamFactId = (typeof EXEC_STREAM_FACTS)[number];
|
|
8
|
+
/** One thing the machine offers: what was read, and what it means for the provider. */
|
|
9
|
+
export interface ExecStreamFact {
|
|
10
|
+
id: ExecStreamFactId;
|
|
11
|
+
value: string;
|
|
12
|
+
means: string;
|
|
13
|
+
}
|
|
5
14
|
export interface ExecStreamCheck {
|
|
6
15
|
id: ExecStreamCheckId;
|
|
7
16
|
status: "pass" | "fail";
|
|
@@ -14,16 +23,21 @@ export interface ExecStreamReport {
|
|
|
14
23
|
machine: string;
|
|
15
24
|
checks: ExecStreamCheck[];
|
|
16
25
|
pass: boolean;
|
|
26
|
+
/** What the capability probe read; empty when it could not run, with why in factsProblem. */
|
|
27
|
+
facts: ExecStreamFact[];
|
|
28
|
+
factsProblem?: string;
|
|
17
29
|
}
|
|
18
30
|
export interface ExecStreamOptions {
|
|
19
31
|
/** How long the no-timeout check's process runs, silent, before it prints and exits; default 75 s. */
|
|
20
32
|
longMs?: number;
|
|
21
33
|
/** How long one step waits: exec's answer, bytes coming back, wait() after the end; default 30 s. */
|
|
22
34
|
stepMs?: number;
|
|
23
|
-
/** The large check's payload, in bytes; default 8 MiB. */
|
|
35
|
+
/** The large check's payload, in bytes of random UTF-8 text; default 8 MiB. */
|
|
24
36
|
largeBytes?: number;
|
|
25
37
|
/** How long the large check may take in all; default 180 s. */
|
|
26
38
|
largeMs?: number;
|
|
39
|
+
/** How long stdout-unread writes to stdin with stdout left unread, before it reads; default 10 s. */
|
|
40
|
+
unreadMs?: number;
|
|
27
41
|
signal?: AbortSignal;
|
|
28
42
|
/** Told of each check as it ends. */
|
|
29
43
|
onCheck?: (check: ExecStreamCheck) => void;
|
|
@@ -39,14 +53,30 @@ export declare const QUICK_LONG_MS = 5000;
|
|
|
39
53
|
*/
|
|
40
54
|
export declare const PID_STATE_SCRIPT = "st=$(sed -n \"s/^State:[[:space:]]*\\([A-Z]\\).*/\\1/p\" \"/proc/$1/status\" 2>/dev/null); case \"$st\" in Z|X) echo gone ;; ?) echo running ;; *) if kill -0 \"$1\" 2>/dev/null; then echo running; else echo gone; fi ;; esac";
|
|
41
55
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
56
|
+
* length bytes of random UTF-8 text: characters of 1, 2, 3 and 4 bytes at random, any code point of each width but NUL
|
|
57
|
+
* and the surrogates (which are no text).
|
|
58
|
+
*/
|
|
59
|
+
export declare function randomText(length: number): Buffer;
|
|
60
|
+
/**
|
|
61
|
+
* Why `got` is not `sent`, in words, or undefined when they are the same text. Both are UTF-8; `way` is where it went
|
|
62
|
+
* ("on stdout"). The first character that differs is named, and the usual ways an exec changes text are named for what
|
|
63
|
+
* they are.
|
|
64
|
+
*/
|
|
65
|
+
export declare function textProblem(sent: Uint8Array, got: Uint8Array, way: string): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The capability probe, one sh script run through exec (as root, as exec runs): a tab-separated line for each thing it
|
|
68
|
+
* reads, each value on one line, and every line of the kernel's TCP tables as a "tcp" line. readFacts reads it. It needs
|
|
69
|
+
* no ss, ip or util-linux beyond unshare, and says "none" where the machine lacks unshare.
|
|
44
70
|
*/
|
|
45
|
-
export declare
|
|
71
|
+
export declare const CAPABILITY_SCRIPT: string;
|
|
72
|
+
/** The TCP listeners in the probe's "tcp" lines: address:port, each once, in the order the kernel lists them. */
|
|
73
|
+
export declare function tcpListeners(lines: readonly string[]): string[];
|
|
74
|
+
/** The probe's output as facts, each with what it means for the provider. */
|
|
75
|
+
export declare function readFacts(output: string): ExecStreamFact[];
|
|
46
76
|
/**
|
|
47
77
|
* The exec pre-check on one machine: each check in EXEC_STREAM_CHECKS runs in turn, and the report passes when every one
|
|
48
|
-
* does. host.exec is the only member called.
|
|
78
|
+
* does; then the capability probe, which passes or fails nothing. host.exec is the only member called.
|
|
49
79
|
*/
|
|
50
80
|
export declare function checkExecStream(host: MachineHost, machine: string, options?: ExecStreamOptions): Promise<ExecStreamReport>;
|
|
51
|
-
/** The report as a person reads it: one line per check, what failed in words, the verdict last. */
|
|
81
|
+
/** The report as a person reads it: one line per check, what failed in words, the machine's facts, the verdict last. */
|
|
52
82
|
export declare function formatExecStream(report: ExecStreamReport): string;
|