pi-coding-agent: 0.80.10 -> 0.81.0

Changelog: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/CHANGELOG.md

0.81.0 moved the provider catalog into gitignored data/*.json generated by a
network fetch; supply it from the matching pi-ai npm package. Replace the
updateScript with one that also refreshes the modelData hash on version bumps.

Assisted-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adam C. Stephens
2026-07-21 12:31:29 -04:00
parent e0b9825606
commit 67f79754f0

View File

@@ -2,6 +2,7 @@
lib,
buildNpmPackage,
fetchFromGitHub,
fetchurl,
nix-update-script,
versionCheckHook,
writableTmpDirAsHomeHook,
@@ -12,16 +13,34 @@
}:
buildNpmPackage (finalAttrs: {
pname = "pi-coding-agent";
version = "0.80.10";
version = "0.81.0";
src = fetchFromGitHub {
owner = "earendil-works";
repo = "pi";
tag = "v${finalAttrs.version}";
hash = "sha256-Vs/ndHYzFyfN4CjPV2zMYblLXe9IuM13UrPJI1VsZEQ=";
hash = "sha256-/TIYea6baa0vlz2G5wUv1aOknjEdo8zoo7eZI0Afjmk=";
};
npmDepsHash = "sha256-XGvDNH+eilsgc0Z7ITqbitB/9RVc+WuDfCcr1pibNqk=";
npmDepsHash = "sha256-i0RwHPWBD06nh7FCM5F3R4kTOkH+7ulLFwIIDdH0vH0=";
# The provider model catalog (packages/ai/src/providers/data/) is generated by
# a network fetch (models.dev plus provider APIs) and is gitignored upstream,
# so it is absent from the source tarball. Restore it from the matching
# published @earendil-works/pi-ai npm package, which ships the hydrated catalog
# under dist/providers/data/. Bump this hash alongside version.
modelData = fetchurl {
url = "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-${finalAttrs.version}.tgz";
hash = "sha256-YuCrwc/6xDHQkcvI6I7u/LTEKLx40nAuxSvPXe/h/1o=";
};
preConfigure = ''
mkdir -p packages/ai/src/providers/data
tar --extract --gzip --file=${finalAttrs.modelData} \
--directory=packages/ai/src/providers/data \
--strip-components=4 \
package/dist/providers/data
'';
npmWorkspace = "packages/coding-agent";
@@ -34,8 +53,8 @@ buildNpmPackage (finalAttrs: {
# Build workspace dependencies in order, then the coding-agent.
# We invoke tsgo directly for workspace deps to skip pi-ai's
# generate-models script which requires network access
# (models.generated.ts is committed to the repo).
# generate-models script, which requires network access; the model
# catalog it would produce is supplied via modelData above.
buildPhase = ''
runHook preBuild
@@ -96,7 +115,12 @@ buildNpmPackage (finalAttrs: {
versionCheckProgram = "${placeholder "out"}/bin/pi";
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
passthru.updateScript = nix-update-script {
extraArgs = [
"--custom-dep"
"modelData"
];
};
meta = {
description = "Coding agent CLI with read, bash, edit, write tools and session management";