#!/usr/bin/env bash
set -eu
# Run in either checkout; pass an empty output directory as $1.
# Start each side with its own fresh database. Do not copy application data.
proof_dir=$(realpath "$1")
printf 'min-release-age=3\n' > "$proof_dir/npmrc"
export npm_config_userconfig="$proof_dir/npmrc"
vp i
vp i -g @opencode/cli
vp env current --json
npm view @opencode/cli version
# Verify the release eligible under this policy with Vite+'s managed npm:
managed_npm=$(vp env current --json | python3 -c 'import json,sys,pathlib; print(pathlib.Path(json.load(sys.stdin)["node"]["bin_path"]).parent/"npm")')
"$managed_npm" pack --dry-run --json=false --global @opencode/cli@latest
T3CODE_DEV_SEED=0 vp run dev
# Pair using the startup URL, then follow browser-driver.md.
