chore(dsh): target DSH 0.2.2-alpha.2

Add the current DSH release to the peer ranges and to the package
compatibility matrix (cordis 4.0.6-alpha.1, loader 1.0.7-alpha.1,
schemastery 3.18.6-alpha.1), which needs Node 24.9 or newer.

The packaged-plugin check now launches the npm CLI through node using
the npm_execpath npm exports, so it also runs on Windows where npm is
npm.cmd and execFile cannot start it.
This commit is contained in:
LiangshouX 2026-10-28 16:20:21 +08:00
parent 2c5f6033c2
commit 11d2e90be7
3 changed files with 54 additions and 11 deletions

View file

@ -51,12 +51,12 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"peerDependencies": {
"@deepseek-ai/cordis": "~4.0.4 || ^4.0.5-alpha.1",
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2",
"@deepseek-ai/dsh-llm": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2",
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2",
"@deepseek-ai/dsh-typert-protocol": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2",
"@deepseek-ai/schemastery": "~3.18.4 || ^3.18.5-alpha.1"
"@deepseek-ai/cordis": "~4.0.4 || ^4.0.5-alpha.1 || ~4.0.6-alpha.1",
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2 || ^0.2.2-alpha.2",
"@deepseek-ai/dsh-llm": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2 || ^0.2.2-alpha.2",
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2 || ^0.2.2-alpha.2",
"@deepseek-ai/dsh-typert-protocol": "^0.1.7-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.2 || ^0.2.2-alpha.2",
"@deepseek-ai/schemastery": "~3.18.4 || ^3.18.5-alpha.1 || ~3.18.6-alpha.1"
},
"peerDependenciesMeta": {
"@deepseek-ai/cordis": {

View file

@ -38,8 +38,21 @@ const releases = [
schema: "3.18.5-alpha.2",
},
{ dsh: "0.2.1-rc.2", cordis: "4.0.5", loader: "1.0.6", schema: "3.18.5" },
{
dsh: "0.2.2-alpha.2",
cordis: "4.0.6-alpha.1",
loader: "1.0.7-alpha.1",
schema: "3.18.6-alpha.1",
},
];
// `npm` is `npm.cmd` on Windows, which execFile cannot launch directly; the
// script runs the npm CLI through node instead, using the path npm exported to
// this process.
const npmCommand = process.env.npm_execpath
? [process.execPath, [process.env.npm_execpath]]
: ["npm", []];
async function run(command, args, cwd) {
try {
return await execFileAsync(command, args, {
@ -53,9 +66,13 @@ async function run(command, args, cwd) {
}
}
/** Run the npm CLI on the platform this check runs on. */
function runNpm(args, cwd) {
return run(npmCommand[0], [...npmCommand[1], ...args], cwd);
}
try {
const { stdout } = await run(
"npm",
const { stdout } = await runNpm(
[
"pack",
"--json",
@ -112,8 +129,7 @@ try {
JSON.stringify({ private: true, type: "module", dependencies }),
);
// Install as a consumer with normal peer resolution, then check the shipped artifact.
await run(
"npm",
await runNpm(
[
"install",
"--ignore-scripts",
@ -157,7 +173,7 @@ try {
["--test", ...testFiles],
installed,
);
await run("npm", ["run", "build"], installed);
await runNpm(["run", "build"], installed);
const count = /# tests (\d+)/.exec(tested.stdout)?.[1];
process.stdout.write(
`DSH ${release.dsh}: packed import, source build, and ${count} tests passed\n`,

View file

@ -31,6 +31,7 @@ test("declares one installable DeepSeek Harness plugin", async () => {
"0.2.1-alpha.2",
"0.2.1-alpha.4",
"0.2.1-rc.2",
"0.2.2-alpha.2",
]) {
assert.ok(
semver.satisfies(version, manifest.peerDependencies[dependency]),
@ -51,6 +52,32 @@ test("declares one installable DeepSeek Harness plugin", async () => {
assert.equal(manifest.peerDependenciesMeta[dependency]?.optional, true);
}
assert.equal(manifest.peerDependencies.openclaw, undefined);
// The framework ranges track the same releases as the DSH packages, so a
// supported DSH install cannot pull a framework the plugin rejects.
for (const [dependency, supported, rejected] of [
[
"@deepseek-ai/cordis",
["4.0.4", "4.0.5-alpha.1", "4.0.5", "4.0.6-alpha.1", "4.1.0"],
["4.0.3", "5.0.0"],
],
[
"@deepseek-ai/schemastery",
["3.18.4", "3.18.5-alpha.1", "3.18.5", "3.18.6-alpha.1"],
["3.18.3", "4.0.0"],
],
]) {
for (const version of supported)
assert.ok(
semver.satisfies(version, manifest.peerDependencies[dependency]),
`${dependency} ${version} should be supported`,
);
for (const version of rejected)
assert.equal(
semver.satisfies(version, manifest.peerDependencies[dependency]),
false,
`${dependency} ${version} should be rejected`,
);
}
assert.match(patch, /remeMemory: true/);
assert.match(patch, /id: reme-memory-scope[\s\S]*id: reme-memory\r?\n/);
assert.doesNotMatch(patch, /id: reme-memory-runtime/);