diff --git a/pkgbuilds/t3code-bin/PKGBUILD b/pkgbuilds/t3code-bin/PKGBUILD index b6be68d..92e4d84 100644 --- a/pkgbuilds/t3code-bin/PKGBUILD +++ b/pkgbuilds/t3code-bin/PKGBUILD @@ -8,7 +8,7 @@ pkgname=t3code-bin pkgver=0.0.35 -pkgrel=1 +pkgrel=2 pkgdesc="Open-source control plane for coding agents" arch=('x86_64') url="https://t3.codes" @@ -55,10 +55,11 @@ conflicts=('t3code') options=('!debug' '!strip') _appimage="T3-Code-${pkgver}-x86_64.AppImage" -source=('t3code-launcher.sh' 'LICENSE') +source=('t3code-launcher.sh' 't3-launcher.sh' 'LICENSE') source_x86_64=("${_appimage}::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/${_appimage}") noextract=("${_appimage}") sha256sums=('cb905ff341372ef2ef6e402cf485959f8bd1df8f0efebee4cda1afdd5e6abc0a' + 'c5b3f2a9f0b14b12cfd973b79319f0f018b7ae49a1d43d8ca346100c3f7de28f' '935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43') sha256sums_x86_64=('97564d89bdb2d1b45f2fb1916183f39d4a384349dec788d5fb6fb2c643ae0794') @@ -111,5 +112,9 @@ package() { chmod 4755 "${pkgdir}/usr/lib/t3code/chrome-sandbox" install -Dm755 "${srcdir}/t3code-launcher.sh" "${pkgdir}/usr/bin/t3code" + # The server CLI, run through the bundled Electron as Node. Same entrypoint + # npm's `t3` package runs, so `t3 serve`, `t3 pair`, and the rest work + # without a separate install. + install -Dm755 "${srcdir}/t3-launcher.sh" "${pkgdir}/usr/bin/t3" install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } diff --git a/pkgbuilds/t3code-bin/t3-launcher.sh b/pkgbuilds/t3code-bin/t3-launcher.sh new file mode 100755 index 0000000..af1988f --- /dev/null +++ b/pkgbuilds/t3code-bin/t3-launcher.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# The T3 Code server CLI (`t3`) ships inside the app bundle; upstream only +# distributes it separately through npm. The bundled Electron doubles as the +# Node runtime for it, so the desktop package can put the CLI on PATH without +# shipping a second runtime. Electron's fs layer reads app.asar transparently +# in this mode. +set -euo pipefail + +export ELECTRON_RUN_AS_NODE=1 +exec /usr/lib/t3code/t3code /usr/lib/t3code/resources/app.asar/apps/server/dist/bin.mjs "$@"