diff --git a/build.sh b/build.sh index 6367ccd..fc8ae15 100755 --- a/build.sh +++ b/build.sh @@ -583,6 +583,15 @@ write_build_manifest() { fi fi fi + # Pi version provenance. Pi is fetched as @latest (see packages/npm-globals.txt), + # so the concrete version floats — derive it from the bundled tarball name + # (earendil-works-pi-coding-agent-.tgz) and record it. This runs after + # fetch-npm-globals.sh + install_live_npm_globals, so the tarball is present. + _pi_version="unknown" + _pi_tgz=$(ls "${NPM_GLOBALS_DIR}"/earendil-works-pi-coding-agent-*.tgz 2>/dev/null | head -1) + if [ -n "${_pi_tgz}" ]; then + _pi_version=$(basename "${_pi_tgz}" .tgz | sed 's/^earendil-works-pi-coding-agent-//') + fi mkdir -p "$(dirname "$_manifest_path")" cat > "$_manifest_path" <@` downloads the pinned published tarball without - # installing it. Output is `-.tgz` (scoped names get - # their slash flattened to a dash). - npm pack "$pkg" >/dev/null + # `npm pack @` downloads the published tarball without + # installing it. Output is `-.tgz` (scoped names get + # their slash flattened to a dash). npm prints that filename on stdout — echo + # it so the build log shows exactly which version a dist-tag (e.g. @latest) + # resolved to. + _packed=$(npm pack "$pkg" 2>/dev/null | tail -1) + [ -n "${_packed}" ] && echo " → ${_packed}" done < "$NPM_GLOBALS_LIST" echo ""