feat(runtime): upgrade DSH and bundled plugins with startup migration

This commit is contained in:
2026-10-18 02:14:27 +08:00
parent eb7e809999
commit 2e31e74972
18 changed files with 501 additions and 80 deletions
+5
View File
@@ -8,6 +8,11 @@ const replacement = 'const persistence = "host"; /* dsh-mgr: authenticated remot
// Deliberately scoped to the settings UI, not connection.isLoopback or auth.
// Fail closed on upstream changes instead of silently shipping a broken UI.
export function patchSettings(source, version) {
// Native host settings supersede the old persistence patch.
if (version === "0.2.1-rc.2") {
if (source.includes(target) || !source.includes("this.ctx.remote.settings.describe()") || !source.includes("this.ctx.remote.settings.mutate(")) throw new Error("expected native host settings API");
return source;
}
if (version !== '0.2.0-rc.2') throw new Error('unsupported DSH version for host settings patch');
if (source.split(target).length !== 2 || source.includes(replacement)) {
throw new Error('expected exactly one unpatched settings persistence selector');