sha256:5cdceabb726c727c44ec5b6c70cf03cb4b30701dcc81e9115387078e33d19483
Last pushed
about 19 hours by dockerpublicbot
Type
Sandbox Kit
Manifest digest
sha256:5cdceabb726c727c44ec5b6c70cf03cb4b30701dcc81e9115387078e33d19483
schemaVersion: "2"
kind: mixin
name: t3code
displayName: T3 Code
description: Installs the t3 npm package that T3 Code's SSH integration runs inside a sandbox, so the first connection starts a pre-installed server.
args:
telemetry:
default: "false"
description: 'Whether the t3 server inside the sandbox sends anonymous usage telemetry. Off by default: the sandbox proxy blocks the telemetry host unless it is allowed, and a server that cannot reach it keeps retrying. Set to true to opt in, and allow us.i.posthog.com:443 in the sandbox''s network policy.'
enum:
- "true"
- "false"
agentInstructions:
content: |
## T3 Code
This sandbox has the `t3` npm package pre-installed and on PATH.
- T3 Code's remote bootstrap finds `t3` directly instead of falling back
to `npx --package t3@latest`, so the first connection does not reach
the npm registry.
- `t3` installs a platform package that carries prebuilt native modules,
`node-pty` among them, so nothing compiles here. Those binaries need
`libatomic1`, which this kit installs when the base image lacks it.
- The t3 server's anonymous usage telemetry is off in this sandbox unless
the kit was installed with `telemetry=true`.
permissions:
network:
allow:
- registry.npmjs.org:443
- archive.ubuntu.com:80
- security.ubuntu.com:80
- ports.ubuntu.com:80
- download.docker.com:443
environment:
variables:
T3CODE_TELEMETRY_ENABLED: ${{ kit.args.telemetry }}
setup:
install:
- command: |
set -euo pipefail
command -v npm >/dev/null || { echo "npm not found: this mixin needs a base image with Node.js >= 18 (all standard agent templates ship it)" >&2; exit 1; }
if [ -n "${HTTP_PROXY:-}" ]; then
npm config set proxy "$HTTP_PROXY"
fi
if [ -n "${HTTPS_PROXY:-${HTTP_PROXY:-}}" ]; then
npm config set https-proxy "${HTTPS_PROXY:-$HTTP_PROXY}"
fi
# t3's prebuilt binaries link against libatomic1. Install it when the
# base image has not already, rather than inheriting it by accident
# from some other package's dependencies.
if ! ldconfig -p 2>/dev/null | grep -q 'libatomic\.so\.1'; then
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends libatomic1
rm -rf /var/lib/apt/lists/*
fi
npm install -g t3@latest
ln -sf "$(command -v t3)" /usr/local/bin/t3
t3 --version || { echo "t3 installed but will not start, see the error above. On a base image without apt-get, install libatomic1 with its own package manager first." >&2; exit 1; }
user: "0"
description: Install the t3 npm package globally