fix: retain previous patch upgrade compatibility

This commit is contained in:
Agent Workbench Dev
2026-11-06 08:03:02 +08:00
parent 0c4895b7c8
commit e86f576ff2
8 changed files with 135 additions and 6 deletions
+6 -1
View File
@@ -7,6 +7,11 @@ import packageManifest from '../package.json' with { type: 'json' };
// The current release is also a valid source for a retained-process update or
// rollback. JSON is bundled for compiled hosts and remains available beside
// this standalone script in the portable release, without requiring src/.
// Earlier patches of the same release line stay valid when the package version
// advances. Including only the current patch silently dropped 1.25.4 in 1.25.5.
const currentRelease = /^(\d+)\.(\d+)\.(\d+)$/.exec(packageManifest.version);
const releasePatches = currentRelease ? Array.from({ length: Number(currentRelease[3]) + 1 },
(_, patch) => currentRelease[1] + '.' + currentRelease[2] + '.' + patch) : [];
export const SUPPORTED_UPGRADE_VERSIONS = Object.freeze([...new Set([
'0.1.0', '1.0.0', '1.1.0', '1.2.0', '1.3.0', '1.4.0', '1.5.0', '1.5.1',
'1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1',
@@ -14,7 +19,7 @@ export const SUPPORTED_UPGRADE_VERSIONS = Object.freeze([...new Set([
'1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.20.2', '1.20.3', '1.21.0', '1.22.0',
'1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3', '1.24.4', '1.24.5',
'1.24.6', '1.24.7', '1.24.8', '1.24.9', '1.25.0', '1.25.1', '1.25.2', '1.25.3',
packageManifest.version,
...releasePatches, packageManifest.version,
])]);
function localUrl(value) {