From c81d7e7d2485efbc2bbee453533467c91ef6d34a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 11 Oct 2026 06:00:04 +0000 Subject: [PATCH 1/2] fix: make the Cloud Agent install idempotent Install Rust stable with rustfmt and clippy on that toolchain, then install workspace dependencies, stage the host native addon, and compile TypeScript. Co-authored-by: Tony Cerqui --- .cursor/environment.json | 2 +- scripts/cloud-agent-install.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 scripts/cloud-agent-install.sh diff --git a/.cursor/environment.json b/.cursor/environment.json index 416fd8de..74f82634 100644 --- a/.cursor/environment.json +++ b/.cursor/environment.json @@ -1,4 +1,4 @@ { "name": "reqlan", - "install": "rustup toolchain install stable --profile minimal && rustup component add rustfmt clippy && rustup default stable && pnpm install --frozen-lockfile && node scripts/ensure-host-native.mjs && pnpm run build:tsc" + "install": "bash scripts/cloud-agent-install.sh" } diff --git a/scripts/cloud-agent-install.sh b/scripts/cloud-agent-install.sh new file mode 100755 index 00000000..24ee57bc --- /dev/null +++ b/scripts/cloud-agent-install.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Idempotent Cloud Agent install for the reqlan workspace. +# Runs after checkout. Exits when finished. +set -euo pipefail + +cd "$(dirname "$0")/.." + +if [ -s "${NVM_DIR:-$HOME/.nvm}/nvm.sh" ]; then + # shellcheck disable=SC1091 + . "${NVM_DIR:-$HOME/.nvm}/nvm.sh" +fi + +export RUSTUP_HOME=/usr/local/rustup +export CARGO_HOME=/usr/local/cargo +export PATH="${CARGO_HOME}/bin:${PATH}" +hash -r + +rustup toolchain install stable --profile minimal --component rustfmt,clippy +rustup default stable + +if ! command -v pnpm >/dev/null 2>&1; then + corepack enable + corepack prepare pnpm@12.10.1 --activate +fi + +echo "node $(node -v) ($(command -v node))" +echo "pnpm $(pnpm -v) ($(command -v pnpm))" +echo "rustc $(rustc --version)" + +pnpm install --frozen-lockfile +node scripts/ensure-host-native.mjs +pnpm run build:tsc From 1ec6ca28731be592f7aed84b82f1063af3745cdb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 11 Oct 2026 06:05:02 +0000 Subject: [PATCH 2/2] fix: use the Node install that owns pnpm The agent runtime can appear earlier on PATH than the workspace Node. The install script selects the Node directory that provides pnpm. --- scripts/cloud-agent-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/cloud-agent-install.sh b/scripts/cloud-agent-install.sh index 24ee57bc..8c701c09 100755 --- a/scripts/cloud-agent-install.sh +++ b/scripts/cloud-agent-install.sh @@ -23,6 +23,10 @@ if ! command -v pnpm >/dev/null 2>&1; then corepack prepare pnpm@12.10.1 --activate fi +# Prefer the Node that owns pnpm. The agent runtime can shadow `node` on PATH. +export PATH="$(dirname "$(command -v pnpm)"):${PATH}" +hash -r + echo "node $(node -v) ($(command -v node))" echo "pnpm $(pnpm -v) ($(command -v pnpm))" echo "rustc $(rustc --version)"