From 6ab2909ac5f94f704153180ffa64501871570fec Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Tue, 27 Jan 2026 20:58:34 -0800 Subject: [PATCH] fix: update internal crate versions in workspace dependencies during release --- scripts/release/update_version.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/release/update_version.ts b/scripts/release/update_version.ts index cfd86bf..90f9427 100644 --- a/scripts/release/update_version.ts +++ b/scripts/release/update_version.ts @@ -34,6 +34,32 @@ export async function updateVersion(opts: ReleaseOpts) { }, ]; + // Update internal crate versions in workspace dependencies + // These need to match the new version so cargo publish can resolve them correctly + const internalCrates = [ + "sandbox-agent", + "sandbox-agent-error", + "sandbox-agent-agent-management", + "sandbox-agent-agent-credentials", + "sandbox-agent-universal-agent-schema", + "sandbox-agent-extracted-agent-schemas", + ]; + + const cargoTomlPath = `${opts.root}/Cargo.toml`; + let cargoContent = await fs.readFile(cargoTomlPath, "utf-8"); + + for (const crate of internalCrates) { + // Match: crate-name = { version = "x.y.z", path = "..." } + const pattern = new RegExp( + `(${crate.replace(/-/g, "-")} = \\{ version = ")[^"]+(",)`, + "g" + ); + cargoContent = cargoContent.replace(pattern, `$1${opts.version}$2`); + } + + await fs.writeFile(cargoTomlPath, cargoContent); + await $({ cwd: opts.root })`git add Cargo.toml`; + // Substitute all files for (const { path: globPath, find, replace } of findReplace) { const paths = await glob(globPath, { cwd: opts.root });