spawn/sh/local/t3code.sh
Ahmed Abushagur 4b62e8735f
chore: rename moved repos (OpenRouterTeam→OpenRouterLabs, sst→anomalyco) (#3445)
* chore: rename moved repos OpenRouterTeam→OpenRouterLabs and sst/opencode→anomalyco

Pure mechanical find/replace across the tree — both repos were renamed on
GitHub and only resolved via 301 redirects (fragile; hijack risk if the old
names are re-registered).

- OpenRouterTeam/spawn → OpenRouterLabs/spawn (141 refs): hardcoded REPO
  consts (manifest.ts, agent-tarball.ts), release-download URLs in every
  sh/{cloud}/{agent}.sh, gh/raw/asset URLs, docs, tests, fixtures.
- sst/opencode → anomalyco/opencode (5 refs): manifest, README, agent-setup.ts
  download cmd, opencode.Dockerfile.

No behavior change. biome clean (205 files). CLI version 1.1.0 → 1.1.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(spawn): deflake cmdRun + hetzner tests (disable telemetry in tests, route hetzner mock by endpoint)

* test(spawn): deflake cmdRun + hetzner tests (disable telemetry in tests, route hetzner mock by endpoint)

* test(spawn): deflake cmdRun + hetzner tests (disable telemetry in tests, route hetzner mock by endpoint)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: spa-the-spawn-maintainer[bot] <286559366+spa-the-spawn-maintainer[bot]@users.noreply.github.com>
2026-06-03 07:29:14 +00:00

27 lines
1.1 KiB
Bash

#!/bin/bash
set -eo pipefail
# Thin shim: ensures bun is available, runs bundled local.js (local or from GitHub release)
_ensure_bun() {
if command -v bun &>/dev/null; then return 0; fi
printf '\033[0;36mInstalling bun...\033[0m\n' >&2
curl -fsSL --proto '=https' --show-error https://bun.sh/install?version=1.3.9 | bash >/dev/null || { printf '\033[0;31mFailed to install bun\033[0m\n' >&2; exit 1; }
export PATH="$HOME/.bun/bin:$PATH"
command -v bun &>/dev/null || { printf '\033[0;31mbun not found after install\033[0m\n' >&2; exit 1; }
}
_ensure_bun
# SPAWN_CLI_DIR override — force local source (used by e2e tests)
if [[ -n "${SPAWN_CLI_DIR:-}" && -f "$SPAWN_CLI_DIR/packages/cli/src/local/main.ts" ]]; then
exec bun run "$SPAWN_CLI_DIR/packages/cli/src/local/main.ts" t3code "$@"
fi
# Remote — download bundled local.js from GitHub release
LOCAL_JS=$(mktemp)
trap 'rm -f "$LOCAL_JS"' EXIT
curl -fsSL --proto '=https' "https://github.com/OpenRouterLabs/spawn/releases/download/local-latest/local.js" -o "$LOCAL_JS" \
|| { printf '\033[0;31mFailed to download local.js\033[0m\n' >&2; exit 1; }
exec bun run "$LOCAL_JS" t3code "$@"