#!/bin/sh # AgentXPro installer for macOS and Linux. # # curl -fsSL https://agentxpro-site.vercel.app/install.sh | sh # curl -fsSL https://agentxpro-site.vercel.app/install.sh | sh -s -- --base-url https://your-endpoint/v1 # # Installs, all under ~/.agentxpro (nothing system-wide, no sudo): # runtime/node a private Node.js 22.19.0 (checksum-verified) # runtime the agent runtime (@deepseek-ai/dsh@0.1.1-rc.2) from npm # profiles/… the AgentXPro client (checksum-verified) # and a launcher at ~/.local/bin/agentxpro. set -eu VERSION="0.1.2" BUNDLE_SHA256="60d2abc4abebdde00c76f25861ae87fdeb81453d28abd97a6d847f0e65a358db" NODE_VERSION="22.19.0" DSH_VERSION="0.1.1-rc.2" BASE="${AGENTXPRO_DOWNLOAD_BASE:-https://agentxpro-site.vercel.app/downloads}" AXP_HOME="$HOME/.agentxpro" RUNTIME="$AXP_HOME/runtime" say() { printf '==> %s\n' "$*"; } die() { printf '!! %s\n' "$*" >&2; exit 1; } need() { command -v "$1" >/dev/null 2>&1 || die "missing required tool: $1"; } need curl; need tar; need uname sha256() { if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1" | cut -d' ' -f1 else shasum -a 256 "$1" | cut -d' ' -f1; fi } case "$(uname -s)" in Darwin) os=darwin ;; Linux) os=linux ;; *) die "unsupported OS $(uname -s) — on Windows use install.ps1" ;; esac case "$(uname -m)" in arm64|aarch64) arch=arm64 ;; x86_64|amd64) arch=x64 ;; *) die "unsupported CPU $(uname -m)" ;; esac tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT INT TERM # 1. private Node.js ---------------------------------------------------------- NODE_DIR="$RUNTIME/node" if [ -x "$NODE_DIR/bin/node" ] && [ "$("$NODE_DIR/bin/node" -v)" = "v$NODE_VERSION" ]; then say "Node.js v$NODE_VERSION already present" else dist="node-v$NODE_VERSION-$os-$arch" say "downloading Node.js v$NODE_VERSION ($os-$arch)" curl -fsSL "https://nodejs.org/dist/v$NODE_VERSION/$dist.tar.gz" -o "$tmp/node.tgz" curl -fsSL "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt" -o "$tmp/SHASUMS256.txt" want="$(grep " $dist.tar.gz\$" "$tmp/SHASUMS256.txt" | cut -d' ' -f1)" [ -n "$want" ] && [ "$(sha256 "$tmp/node.tgz")" = "$want" ] || die "Node.js checksum mismatch" rm -rf "$NODE_DIR"; mkdir -p "$NODE_DIR" tar xzf "$tmp/node.tgz" -C "$NODE_DIR" --strip-components=1 fi NODE="$NODE_DIR/bin/node" NPM="$NODE_DIR/bin/npm" # 2. AgentXPro bundle --------------------------------------------------------- say "downloading AgentXPro $VERSION" curl -fsSL "$BASE/agentxpro-$VERSION.tgz" -o "$tmp/axp.tgz" [ "$(sha256 "$tmp/axp.tgz")" = "$BUNDLE_SHA256" ] || die "AgentXPro bundle checksum mismatch" mkdir -p "$tmp/axp" tar xzf "$tmp/axp.tgz" -C "$tmp/axp" # 3. agent runtime — exact tested tree from the bundle's lockfile ------------- say "installing agent runtime $DSH_VERSION" mkdir -p "$RUNTIME" cp "$tmp/axp/runtime/package.json" "$tmp/axp/runtime/package-lock.json" "$RUNTIME/" ( cd "$RUNTIME" && PATH="$NODE_DIR/bin:$PATH" "$NPM" ci --omit=dev --no-audit --no-fund \ --loglevel=error --update-notifier=false >/dev/null ) || die "agent runtime install failed" # 4. install + launcher ------------------------------------------------------- "$NODE" "$tmp/axp/install.mjs" --runtime "$RUNTIME" --node "$NODE" "$@"