From 4272c71651de03d4e74c01163af17a89d65e1541 Mon Sep 17 00:00:00 2001 From: Danyang Chen Date: Mon, 23 Nov 2026 08:59:29 +0800 Subject: [PATCH] [bugfix] plugin: accept later DSH 0.2 hosts in engines.dsh (#418) Declare a 0.2-line minimum instead of pinning the exact host version, so DSH 0.2.2-rc.5 and other later 0.2 releases can install the plugin. --- plugins/deepseek-harness/README.md | 4 +- plugins/deepseek-harness/README.zh-CN.md | 4 +- plugins/deepseek-harness/package-lock.json | 18 ++++++- plugins/deepseek-harness/package.json | 5 +- plugins/deepseek-harness/test/engines.test.js | 51 +++++++++++++++++++ 5 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 plugins/deepseek-harness/test/engines.test.js diff --git a/plugins/deepseek-harness/README.md b/plugins/deepseek-harness/README.md index 81476c372..bc2465bc8 100644 --- a/plugins/deepseek-harness/README.md +++ b/plugins/deepseek-harness/README.md @@ -6,7 +6,7 @@ Create media from a DSH conversation, follow generation progress, and open the s ## Install and connect -Use DSH **0.2.2-rc.1** with Node.js **24.9.0 or newer** and `pnpm` on `PATH`. Start OpenDirector using the [installation guide](../../docs/guides/installation.md). From this plugin directory, package it and create a Web profile before adding the bundle: +Use DSH **0.2.2-rc.1 or later in the 0.2 line** with Node.js **24.9.0 or newer** and `pnpm` on `PATH`. Start OpenDirector using the [installation guide](../../docs/guides/installation.md). From this plugin directory, package it and create a Web profile before adding the bundle: ```sh npm pack @@ -145,4 +145,4 @@ node test/creation.integration.mjs This checks project creation, a saved PNG candidate, result selection and replay, edit-session conflicts, and an accepted job completing while the plugin is disabled. It requires the fixture's health marker before writing. `OPENDIRECTOR_FIXTURE_URL` can select another fixture port; the test uses generated fixture images rather than a model service. -The package pins its DSH compatibility to `0.2.2-rc.1`; DSH is in developer preview, so check compatibility before upgrading the host. OpenDirector’s own installation requirements are maintained in its installation guide. +The package declares DSH compatibility as `>=0.2.2-rc.1 <0.3.0-0` (a 0.2-line minimum, not an exact host version). DSH is in developer preview, so check compatibility before upgrading the host. OpenDirector’s own installation requirements are maintained in its installation guide. diff --git a/plugins/deepseek-harness/README.zh-CN.md b/plugins/deepseek-harness/README.zh-CN.md index feda27142..0e62ac4e1 100644 --- a/plugins/deepseek-harness/README.zh-CN.md +++ b/plugins/deepseek-harness/README.zh-CN.md @@ -6,7 +6,7 @@ ## 安装并连接 -使用 **DSH 0.2.2-rc.1**、**Node.js 24.9.0 或更新版本**,并确保 `pnpm` 在 `PATH` 中。先按[安装指南](../../docs/guides/installation.zh-CN.md)启动 OpenDirector,再从本插件目录打包,并先创建带对话界面的 Web profile,再加入插件包: +使用 **DSH 0.2.2-rc.1 或同系列更新版本(0.2 且低于 0.3)**、**Node.js 24.9.0 或更新版本**,并确保 `pnpm` 在 `PATH` 中。先按[安装指南](../../docs/guides/installation.zh-CN.md)启动 OpenDirector,再从本插件目录打包,并先创建带对话界面的 Web profile,再加入插件包: ```sh npm pack @@ -147,4 +147,4 @@ node test/creation.integration.mjs 这会检查创建工程、PNG候选落盘、采用与重放、编辑会话冲突,以及停用插件期间已接受任务继续完成。脚本先检查隔离夹具标记再写入;用 `OPENDIRECTOR_FIXTURE_URL` 可选择其他夹具端口。图片来自测试夹具,不调用模型服务。 -本包将 DSH 兼容版本固定为 `0.2.2-rc.1`。DSH 仍在开发预览阶段,升级宿主前应重新确认兼容性。OpenDirector 自身的运行环境要求以安装指南为准。 +本包将 DSH 兼容范围声明为 `>=0.2.2-rc.1 <0.3.0-0`(0.2 系列的最低版本要求,而不是精确锁定宿主版本)。DSH 仍在开发预览阶段,升级宿主前应重新确认兼容性。OpenDirector 自身的运行环境要求以安装指南为准。 diff --git a/plugins/deepseek-harness/package-lock.json b/plugins/deepseek-harness/package-lock.json index 02e1eb8a2..b37ff895a 100644 --- a/plugins/deepseek-harness/package-lock.json +++ b/plugins/deepseek-harness/package-lock.json @@ -16,10 +16,11 @@ "@deepseek-ai/cordis-plugin-loader": "~1.1.0", "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1", "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.1", - "@deepseek-ai/dsh-tools": "0.2.2-rc.1" + "@deepseek-ai/dsh-tools": "0.2.2-rc.1", + "semver": "^7.8.5" }, "engines": { - "dsh": "0.2.2-rc.1", + "dsh": ">=0.2.2-rc.1 <0.3.0-0", "node": ">=24.9.0" }, "peerDependencies": { @@ -312,6 +313,19 @@ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "license": "MIT" }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/zod": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", diff --git a/plugins/deepseek-harness/package.json b/plugins/deepseek-harness/package.json index c87a02980..03c593255 100644 --- a/plugins/deepseek-harness/package.json +++ b/plugins/deepseek-harness/package.json @@ -21,7 +21,7 @@ "test": "node --test test/*.test.js" }, "engines": { - "dsh": "0.2.2-rc.1", + "dsh": ">=0.2.2-rc.1 <0.3.0-0", "node": ">=24.9.0" }, "dsh": { @@ -45,6 +45,7 @@ "@deepseek-ai/dsh-tools": "0.2.2-rc.1", "@deepseek-ai/cordis-plugin-loader": "~1.1.0", "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1", - "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.1" + "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.1", + "semver": "^7.8.5" } } diff --git a/plugins/deepseek-harness/test/engines.test.js b/plugins/deepseek-harness/test/engines.test.js new file mode 100644 index 000000000..0a8cb5a31 --- /dev/null +++ b/plugins/deepseek-harness/test/engines.test.js @@ -0,0 +1,51 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import semver from 'semver' + +/** Mirrors DSH app-boot `evaluatePluginCompatibility` for the engines.dsh path: + * `semver.satisfies(runtime, range, { includePrerelease: true })`. + * Official source: deepseek-ai/deepseek-harness packages/boot/app-boot/src/plugin-compatibility.ts + */ +function enginesCompatibility(manifest, runtimeVersion) { + const range = manifest.engines?.dsh + if (typeof range !== 'string') throw new Error('engines.dsh must be a string') + if (semver.valid(runtimeVersion) === null) { + throw new Error(`Invalid dsh runtime version: ${JSON.stringify(runtimeVersion)}`) + } + const ok = range.trim() !== '' && semver.satisfies(runtimeVersion, range, { includePrerelease: true }) + return ok ? undefined : { 'engines.dsh': range } +} + +const manifest = JSON.parse( + readFileSync(join(dirname(fileURLToPath(import.meta.url)), '../package.json'), 'utf8'), +) +const RANGE = '>=0.2.2-rc.1 <0.3.0-0' + +test('engines.dsh requires a 0.2 minimum rather than an exact DSH version', () => { + assert.equal(manifest.engines.dsh, RANGE) + assert.equal(manifest.engines.node, '>=24.9.0') +}) + +test('the published exact pin rejects the newer host from the bug report', () => { + const exact = { engines: { dsh: '0.2.2-rc.1' } } + assert.deepEqual(enginesCompatibility(exact, '0.2.2-rc.5'), { 'engines.dsh': '0.2.2-rc.1' }) + assert.equal(enginesCompatibility(exact, '0.2.2-rc.1'), undefined) +}) + +test('the declared range admits 0.2.2-rc.1 and later 0.2 hosts, including 0.2.2-rc.5', () => { + const admitted = ['0.2.2-rc.1', '0.2.2-rc.5', '0.2.2', '0.2.3', '0.2.3-rc.1', '0.2.9-alpha.0'] + const rejected = ['0.2.1', '0.2.1-rc.5', '0.2.2-rc.0', '0.3.0-rc.1', '0.3.0', '1.0.0'] + for (const version of admitted) { + assert.equal(enginesCompatibility(manifest, version), undefined, `should admit ${version}`) + } + for (const version of rejected) { + assert.deepEqual( + enginesCompatibility(manifest, version), + { 'engines.dsh': RANGE }, + `should reject ${version}`, + ) + } +})