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
+3 -3
View File
@@ -26,9 +26,9 @@ test('non-JSON errors report HTTP status without exposing response content', asy
});
test('patch rejects unsupported or changed clients and double patching', () => {
const source = Array(3).fill("await fetch('/plugins/dsh-session-delete/delete'); await response.json()").join(';');
const patched = patchClient(source, '1.5.12');
const patched = patchClient(source, '1.5.16');
assert.equal(patched.split('await dshChatFetch(').length, 4);
assert.throws(() => patchClient(source, '1.5.13'), /unsupported/);
assert.throws(() => patchClient('', '1.5.12'), /unexpected/);
assert.throws(() => patchClient(patched, '1.5.12'), /unexpected/);
assert.throws(() => patchClient('', '1.5.16'), /unexpected/);
assert.throws(() => patchClient(patched, '1.5.16'), /unexpected/);
});