fix(skill): pin packaged commands to the shipping package version (#1346)
Fixes #1338. Use canonical product identity for bundled command versions and keep build-cache fixtures aligned. Verified 10 focused tests, actual CLI installation/repair/uninstall scenarios and all 19 final-head CI checks. Co-authored-by: Yi-111-a <97448247+Yi-111-a@users.noreply.github.com>
This commit is contained in:
@@ -20,8 +20,8 @@ const cacheBust = String(Date.now());
|
||||
const { CATALOG_IDENTITY } = await import(
|
||||
`${pathToFileURL(join(root, "dist/catalogIdentity.js")).href}?${cacheBust}`
|
||||
);
|
||||
const { PACKAGE_METADATA } = await import(
|
||||
`${pathToFileURL(join(root, "dist/generatedPackageMetadata.js")).href}?${cacheBust}`
|
||||
const { PRODUCT_IDENTITY } = await import(
|
||||
`${pathToFileURL(join(root, "dist/identity.js")).href}?${cacheBust}`
|
||||
);
|
||||
if (/^\s{2}(?:tool_count|catalog_digest):/mu.test(current))
|
||||
throw new Error(
|
||||
@@ -31,8 +31,8 @@ const versionLine = /^ {2}version: "[^"\r\n]+"$/mu;
|
||||
if (!versionLine.test(current))
|
||||
throw new Error("Missing authored skill version");
|
||||
// A shipped skill must run the version it ships with, not whatever `@latest` resolves to.
|
||||
const latestSpecifier = `${PACKAGE_METADATA.name}@latest`;
|
||||
const pinnedSpecifier = `${PACKAGE_METADATA.name}@${PACKAGE_METADATA.version}`;
|
||||
const latestSpecifier = PRODUCT_IDENTITY.packageSpecifier;
|
||||
const pinnedSpecifier = PRODUCT_IDENTITY.registrationPackageSpecifier;
|
||||
const source = current
|
||||
.replace(
|
||||
versionLine,
|
||||
|
||||
Reference in New Issue
Block a user