@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.
@@ -0,0 +1,111 @@
1
+ # The media box image: the Docker box's default image (DOCKER_RECIPE in src/docker/image.ts, on the same base digest)
2
+ # plus what renders video in a box with no network: Node 24 from its official tarball (pinned by sha256; Debian's nodejs
3
+ # is older than HyperFrames' Node 22 floor), Chromium, FFmpeg and FFprobe, fonts for titles (Noto with CJK and colour
4
+ # emoji, Liberation, DejaVu), the HyperFrames CLI at an exact version, and on amd64 the chrome-headless-shell build that
5
+ # CLI pins (pinned here by sha256), which renders with its fast capture path and the pixels it was tuned on. `chrome` on
6
+ # PATH is Chromium, so a box's needs name plain programs: chrome, ffmpeg, ffprobe, hyperframes.
7
+ #
8
+ # It is built with no context and named to serve in AGENTRUN_DOCKER_IMAGE, the one setting that picks a Docker box's
9
+ # image. From the repository's root:
10
+ #
11
+ # tag=agentrun-media:$(sha256sum packages/computer/media/Dockerfile | cut -c1-12)
12
+ # docker build -t "$tag" - < packages/computer/media/Dockerfile
13
+ # AGENTRUN_DOCKER_IMAGE=$tag AGENTRUN_BOXES=docker node packages/serve/dist/cli.js
14
+ #
15
+ # The tag is the first 12 hex digits of this file's sha256, as a recipe's tag is: an edit here is a new tag. The base is
16
+ # pinned by digest, Node and the headless shell by sha256, and the Debian packages by a snapshot.debian.org instant, so
17
+ # two builds of one tag install the same packages. The HyperFrames CLI's dependencies are pinned by npm's --before, the
18
+ # same instant: by date, not by content. Nothing in it holds a key, and nothing in it is fetched when a box runs.
19
+ #
20
+ # A box's commands get PATH and HOME but not the image's environment, so `hyperframes` on PATH is a small script that
21
+ # names the browser to render with (the headless shell where the image has it, else Chromium) unless the caller names
22
+ # one in HYPERFRAMES_BROWSER_PATH: HyperFrames would otherwise try to download its pinned shell, which a box with no
23
+ # network cannot. The script also turns off HyperFrames' usage
24
+ # reports and its update check unless the caller turns them on: a box with a network sends nothing of its work home.
25
+ # And it gives HyperFrames a font cache in HOME holding a link to each folder of fonts compressed at build (below).
26
+ FROM python:3.12-slim@sha256:b18b261e1b4974b4f321451ad5251ded85abb22c2b8b262da527dda1d031ab30
27
+
28
+ # The default image's tools (but its nodejs and npm, which Node's tarball brings), then Chromium, FFmpeg and the fonts,
29
+ # from Debian's archive and its security archive as snapshot.debian.org held them at one instant (the step fails if a
30
+ # source still names the live mirror), over https: the base already has apt's https method and the CA certificates. apt
31
+ # checks each package against that snapshot's signed index; a snapshot's index is past its Valid-Until date, so apt is
32
+ # told not to refuse it for that.
33
+ 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 \
34
+ && ! grep -q 'deb\.debian\.org' /etc/apt/sources.list.d/debian.sources \
35
+ && apt-get -o Acquire::Check-Valid-Until=false update \
36
+ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git curl ca-certificates ripgrep socat unzip xz-utils \
37
+ chromium ffmpeg fontconfig fonts-dejavu-core fonts-liberation fonts-noto-core fonts-noto-cjk fonts-noto-color-emoji \
38
+ && rm -rf /var/lib/apt/lists/*
39
+
40
+ # Node 24.22.3 from nodejs.org, checked against its sha256 for this machine's architecture before it is unpacked.
41
+ RUN set -eu; \
42
+ case "$(dpkg --print-architecture)" in \
43
+ amd64) arch=x64; sum=4f2b175a6d53a5c617a80dba2676238a0688cef28c6da4eba35c7d844e66fcfb ;; \
44
+ arm64) arch=arm64; sum=6e51a2ada00f0011cc266f65d98922b403d7ad88f809ca2aa615a5fe1ce6e86c ;; \
45
+ *) echo "no Node build for $(dpkg --print-architecture)" >&2; exit 1 ;; \
46
+ esac; \
47
+ file="node-v24.22.3-linux-$arch.tar.xz"; \
48
+ curl -fsSLo "/tmp/$file" "https://nodejs.org/dist/v24.22.3/$file"; \
49
+ echo "$sum /tmp/$file" | sha256sum -c -; \
50
+ tar -xJf "/tmp/$file" -C /usr/local --strip-components=1 --no-same-owner --exclude='*/CHANGELOG.md' --exclude='*/README.md'; \
51
+ rm "/tmp/$file"; \
52
+ node --version; npm --version
53
+
54
+ # chrome-headless-shell 158.0.8127.36, the build HyperFrames 0.9.78 pins, from Chrome for Testing, checked against its
55
+ # sha256 (amd64 only: on arm64 HyperFrames renders with Chromium).
56
+ RUN set -eu; \
57
+ if [ "$(dpkg --print-architecture)" = amd64 ]; then \
58
+ curl -fsSLo /tmp/shell.zip https://storage.googleapis.com/chrome-for-testing-public/158.0.8127.36/linux64/chrome-headless-shell-linux64.zip; \
59
+ echo "2d3a23017323c54fd457a678e4351f895c4076d8050e39d5aa6247f93448b73a /tmp/shell.zip" | sha256sum -c -; \
60
+ unzip -q /tmp/shell.zip -d /opt; \
61
+ rm /tmp/shell.zip; \
62
+ ln -s /opt/chrome-headless-shell-linux64/chrome-headless-shell /usr/local/bin/chrome-headless-shell; \
63
+ chrome-headless-shell --version; \
64
+ fi
65
+
66
+ # The HyperFrames CLI at an exact version, its dependencies as the registry had them when it was published (--before), no
67
+ # install script run, behind the script that names its browser and turns off its reports. Then `chrome`, the name a
68
+ # box's needs use, for Chromium.
69
+ RUN npm install --global --ignore-scripts --before=2026-11-21T20:42:00Z hyperframes@0.9.78 \
70
+ && npm cache clean --force \
71
+ && rm /usr/local/bin/hyperframes \
72
+ && printf '%s\n' \
73
+ '#!/bin/sh' \
74
+ 'if [ -z "${HYPERFRAMES_BROWSER_PATH:-}" ]; then' \
75
+ ' HYPERFRAMES_BROWSER_PATH=/usr/bin/chromium' \
76
+ ' [ -x /usr/local/bin/chrome-headless-shell ] && HYPERFRAMES_BROWSER_PATH=/usr/local/bin/chrome-headless-shell' \
77
+ ' export HYPERFRAMES_BROWSER_PATH' \
78
+ 'fi' \
79
+ 'export HYPERFRAMES_NO_TELEMETRY="${HYPERFRAMES_NO_TELEMETRY:-1}"' \
80
+ 'export HYPERFRAMES_NO_UPDATE_CHECK="${HYPERFRAMES_NO_UPDATE_CHECK:-1}"' \
81
+ 'if [ -z "${HYPERFRAMES_FONT_CACHE_DIR:-}" ]; then' \
82
+ ' HYPERFRAMES_FONT_CACHE_DIR="${HOME:-/tmp}/.cache/hyperframes/fonts"' \
83
+ ' if mkdir -p "$HYPERFRAMES_FONT_CACHE_DIR" 2>/dev/null; then' \
84
+ ' for baked in /usr/local/share/hyperframes/fonts/*/; do' \
85
+ ' baked="${baked%/}"; name="${baked##*/}"' \
86
+ ' [ -d "$baked" ] && [ ! -e "$HYPERFRAMES_FONT_CACHE_DIR/$name" ] && ln -s "$baked" "$HYPERFRAMES_FONT_CACHE_DIR/$name" 2>/dev/null' \
87
+ ' done' \
88
+ ' fi' \
89
+ ' export HYPERFRAMES_FONT_CACHE_DIR' \
90
+ 'fi' \
91
+ 'exec node /usr/local/lib/node_modules/hyperframes/bin/hyperframes.mjs "$@"' \
92
+ > /usr/local/bin/hyperframes \
93
+ && chmod 755 /usr/local/bin/hyperframes \
94
+ && ln -s /usr/bin/chromium /usr/local/bin/chrome \
95
+ && hyperframes --version
96
+
97
+ # Each of the image's fonts compressed once, here, as HyperFrames compresses a system font it embeds when it can't fetch
98
+ # the family from Google Fonts: with no network that is every render, and Noto Color Emoji alone takes about a minute of
99
+ # CPU, since a box's own cache starts empty. HyperFrames' own fontToDataUri writes each under this cache root, in the
100
+ # folder and under the key HyperFrames picks, and the script links each folder here into the font cache it names in HOME,
101
+ # so a render finds them while its Google Fonts cache stays writable; a font it can't compress is said and left, as a
102
+ # render would embed it raw. The CJK collections are not compressed: a render naming Noto Sans CJK SC, JP or KR embeds
103
+ # none of them (HyperFrames maps no CJK family), and Chrome draws those titles from these system fonts directly.
104
+ RUN set -eu; \
105
+ chunk="$(grep -l 'async function fontToDataUri' /usr/local/lib/node_modules/hyperframes/dist/*.js)"; \
106
+ test "$(printf '%s\n' "$chunk" | wc -l)" -eq 1; \
107
+ find /usr/share/fonts -type f \( -name '*.ttf' -o -name '*.otf' \) -print0 | sort -z \
108
+ | HF_CHUNK="$chunk" HYPERFRAMES_FONT_CACHE_DIR=/usr/local/share/hyperframes/fonts xargs -0 -P "$(nproc)" -n 4 node --input-type=module -e 'const { fontToDataUri } = await import(process.env.HF_CHUNK); const { readFileSync } = await import("node:fs"); for (const path of process.argv.slice(1)) { const uri = await fontToDataUri(readFileSync(path), path.endsWith(".otf") ? "otf" : "ttf"); if (!uri.startsWith("data:font/woff2;")) console.log(`left raw: ${path}`); }'; \
109
+ test "$(find /usr/local/share/hyperframes/fonts -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1; \
110
+ echo "$(find /usr/local/share/hyperframes/fonts -name '*.woff2' | wc -l) fonts compressed into $(ls /usr/local/share/hyperframes/fonts)"; \
111
+ chmod -R a+rX /usr/local/share/hyperframes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-computer",
3
- "version": "0.1.0-beta.52",
3
+ "version": "0.1.0-beta.54",
4
4
  "description": "The open platform's computer protocol: a daemon in every computer, and one provisioner per vendor, starting with Docker.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -9,7 +9,8 @@
9
9
  "docker",
10
10
  "daytona",
11
11
  "boxd",
12
- "smolcloud"
12
+ "smolcloud",
13
+ "groundbox"
13
14
  ],
14
15
  "type": "module",
15
16
  "license": "Apache-2.0",
@@ -72,6 +73,10 @@
72
73
  "types": "./dist/boxd.d.ts",
73
74
  "default": "./dist/boxd.js"
74
75
  },
76
+ "./groundbox": {
77
+ "types": "./dist/groundbox.d.ts",
78
+ "default": "./dist/groundbox.js"
79
+ },
75
80
  "./orgo": {
76
81
  "types": "./dist/orgo.d.ts",
77
82
  "default": "./dist/orgo.js"
@@ -105,6 +110,8 @@
105
110
  "files": [
106
111
  "dist",
107
112
  "box",
113
+ "media",
114
+ "documents",
108
115
  "README.md",
109
116
  "LICENSE",
110
117
  "NOTICE"
@@ -124,6 +131,7 @@
124
131
  "test:modal": "node --test --test-timeout=1800000 test/modal/*.test.mjs",
125
132
  "test:e2b": "node --test --test-timeout=1800000 test/e2b/*.test.mjs",
126
133
  "test:boxd": "node --test --test-timeout=1800000 test/boxd/*.test.mjs",
134
+ "test:groundbox": "node --test --test-timeout=1800000 test/groundbox/*.test.mjs",
127
135
  "conformance": "node dist/conformance/cli.js"
128
136
  },
129
137
  "repository": {