From a573abbc1b0dd9dd46fb5b4827226aa8a5392990 Mon Sep 17 00:00:00 2001 From: taekchef Date: Thu, 8 Oct 2026 16:34:43 +0800 Subject: [PATCH] fix: adapt to DSH 0.2.1-alpha.1 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 4 ++-- CHANGELOG.md | 6 ++++++ README.md | 6 +++--- README.zh-CN.md | 6 +++--- package.json | 11 ----------- pnpm-lock.yaml | 27 ++++++++++++++++++++++++--- pnpm-workspace.yaml | 1 - scripts/check-host-api.mjs | 6 ++++-- src/plugin/invariant.ts | 30 ------------------------------ tests/fence-feedback.spec.ts | 4 ++-- tests/peer-range.spec.ts | 6 ++++-- tsdown.config.ts | 10 +++------- 13 files changed, 55 insertions(+), 70 deletions(-) delete mode 100644 src/plugin/invariant.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 607e2f11..de184572 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,13 @@ jobs: host-ref: "dsh-v0.1.2-rc.1" role: minimum - node: 22 - host-ref: "dsh-v0.1.7-rc.2" + host-ref: "dsh-v0.2.0-rc.2" role: current - node: 24 - host-ref: "dsh-v0.1.7-rc.2" + host-ref: "dsh-v0.2.0-rc.2" role: current - node: 24 - host-ref: "dsh-v0.2.0-rc.2" + host-ref: "dsh-v0.2.1-alpha.1" role: next runs-on: ubuntu-latest timeout-minutes: 40 @@ -63,7 +63,7 @@ jobs: if: matrix.role == 'minimum' run: pnpm run build - - name: Check published host API (typecheck + build) + - name: Check published host API (typecheck + plugin lifecycle + build) if: matrix.role != 'minimum' run: pnpm run check:host-api "${{ matrix.host-ref }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a4cf0b9..85662b25 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,8 @@ jobs: env: RELEASE_TAG: ${{ github.event.release.tag_name }} PRERELEASE: ${{ github.event.release.prerelease }} - HOST_REF: dsh-v0.1.7-rc.2 - NEXT_HOST_REF: dsh-v0.2.0-rc.2 + HOST_REF: dsh-v0.2.0-rc.2 + NEXT_HOST_REF: dsh-v0.2.1-alpha.1 steps: # actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e1167b4e..a81a7ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +### 兼容性 + +- 将 DSH 当前宿主与下一测试版的接口、打包安装和发布验证目标更新为 `0.2.0-rc.2` 与 `0.2.1-alpha.1`。 +- 移除 DSH 已废弃的运行时诊断配套入口 `./invariant`、对应构建产物与 `@deepseek-ai/dsh-invariants` 直接依赖。 +- 对应宿主版本的公开依赖检查加入技能注册、插件重载和持久化纠错恢复测试;会话样本补齐新版要求的消息记录字段。 + ## [0.11.4] - 2026-10-08 ### 修复 diff --git a/README.md b/README.md index baec8bfa..1569c6b5 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ The repository ships both renderer channels, the host plugin, and the built brow Prerequisites — all required: -1. **dsh `^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0`** (DSH `0.2.0-rc.1` is currently a prerelease; verified host roles: minimum `dsh-v0.1.2-rc.1`, current `dsh-v0.1.7-rc.2`, next `dsh-v0.2.0-rc.2`; users on DSH `<=0.1.1-rc.x` should use dsh-genui `0.9.8`) +1. **dsh `^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0`** (DSH `0.2.1-alpha.1` is currently a prerelease; verified host roles: minimum `dsh-v0.1.2-rc.1`, current `dsh-v0.2.0-rc.2`, next `dsh-v0.2.1-alpha.1`; users on DSH `<=0.1.1-rc.x` should use dsh-genui `0.9.8`) 2. **`pnpm` on your PATH**: the `dsh plugin` command depends on it. If missing: `corepack enable` (or `npm i -g pnpm`), then **open a new terminal** and confirm `pnpm -v` prints a version Install and activate in DSH (one command, all dependencies included): @@ -246,9 +246,9 @@ pnpm run check # type check + full tests + build With the locked dependencies installed, the check script (`pnpm run check` or `npm run check`) uses the pinned DSH `0.1.2-rc.1` release packages. -The verified host roles are minimum `dsh-v0.1.2-rc.1`, current `dsh-v0.1.7-rc.2`, and next `dsh-v0.2.0-rc.1`. DSH `0.2.0-rc.1` is currently a prerelease. CI keeps four primary lanes: Node 22 + current, and Node 24 + minimum/current/next. Replace these pinned tags as DSH publishes newer versions. +The verified host roles are minimum `dsh-v0.1.2-rc.1`, current `dsh-v0.2.0-rc.2`, and next `dsh-v0.2.1-alpha.1`. DSH `0.2.1-alpha.1` is currently a prerelease. CI keeps four primary lanes: Node 22 + current, and Node 24 + minimum/current/next. Replace these pinned tags as DSH publishes newer versions. -`pnpm run check:host-api dsh-v0.1.7-rc.2` and `pnpm run check:host-api dsh-v0.2.0-rc.1` install the corresponding published DSH packages and run TypeScript typecheck plus tsdown build. Each CI host lane then installs the generated tarball in its pinned DSH host and runs the packed smoke. +`pnpm run check:host-api dsh-v0.2.0-rc.2` and `pnpm run check:host-api dsh-v0.2.1-alpha.1` install the corresponding published DSH packages and run TypeScript typecheck, plugin lifecycle tests (including skill registration and persisted feedback recovery), and tsdown build. Each CI host lane then installs the generated tarball in its pinned DSH host and runs the packed smoke. Run `node scripts/verify-pack.mjs --keep` to retain the verified tarball for inspection or e2e use. The default `node scripts/verify-pack.mjs` removes its temporary directory after verification. diff --git a/README.zh-CN.md b/README.zh-CN.md index 35503e9a..e99da1db 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -96,7 +96,7 @@ CI 的 packed host smoke 会把实际生成的 npm tarball 安装到真实 DSH 前置条件,缺一不可: -1. **dsh `^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0`**(DSH `0.2.0-rc.1` 当前属于预发布版本;已验证宿主角色:minimum `dsh-v0.1.2-rc.1`、current `dsh-v0.1.7-rc.2`、next `dsh-v0.2.0-rc.2`;使用 DSH `<=0.1.1-rc.x` 的用户请使用 dsh-genui `0.9.8`) +1. **dsh `^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0`**(DSH `0.2.1-alpha.1` 当前属于预发布版本;已验证宿主角色:minimum `dsh-v0.1.2-rc.1`、current `dsh-v0.2.0-rc.2`、next `dsh-v0.2.1-alpha.1`;使用 DSH `<=0.1.1-rc.x` 的用户请使用 dsh-genui `0.9.8`) 2. **`pnpm` 在 PATH 上**:`dsh plugin` 命令依赖它。没有就 `corepack enable`(或 `npm i -g pnpm`),然后**新开一个终端**,确认 `pnpm -v` 有输出 安装并在 DSH 中激活(一行命令,自动带上全部依赖): @@ -260,9 +260,9 @@ pnpm run check # 类型检查 + 全量测试 + 构建 安装锁定依赖后,检查脚本(`pnpm run check` 或 `npm run check`)使用固定的 DSH `0.1.2-rc.1` 发布包。 -已验证宿主角色为 minimum `dsh-v0.1.2-rc.1`、current `dsh-v0.1.7-rc.2`、next `dsh-v0.2.0-rc.1`。DSH `0.2.0-rc.1` 当前属于预发布版本。CI 保持四条主要 lane:Node 22 + current,以及 Node 24 + minimum/current/next。DSH 发布新版本后,替换对应固定标签。 +已验证宿主角色为 minimum `dsh-v0.1.2-rc.1`、current `dsh-v0.2.0-rc.2`、next `dsh-v0.2.1-alpha.1`。DSH `0.2.1-alpha.1` 当前属于预发布版本。CI 保持四条主要 lane:Node 22 + current,以及 Node 24 + minimum/current/next。DSH 发布新版本后,替换对应固定标签。 -`pnpm run check:host-api dsh-v0.1.7-rc.2` 与 `pnpm run check:host-api dsh-v0.2.0-rc.1` 会安装对应 DSH 发布包,运行 TypeScript 类型检查与 tsdown 构建。每条 CI 宿主 lane 随后会把生成的 tarball 安装到固定版本的 DSH 宿主并运行 packed smoke。 +`pnpm run check:host-api dsh-v0.2.0-rc.2` 与 `pnpm run check:host-api dsh-v0.2.1-alpha.1` 会安装对应 DSH 发布包,运行 TypeScript 类型检查、插件生命周期测试(包括技能注册与持久化纠错恢复)和 tsdown 构建。每条 CI 宿主 lane 随后会把生成的 tarball 安装到固定版本的 DSH 宿主并运行 packed smoke。 运行 `node scripts/verify-pack.mjs --keep` 可保留已验收的 tarball,便于检查或运行 e2e;默认的 `node scripts/verify-pack.mjs` 会在验收后清理临时目录。 diff --git a/package.json b/package.json index 32b39282..19e507c2 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,6 @@ "types": "./lib/types/plugin/index.d.ts", "default": "./lib/index.js" }, - "./invariant": { - "types": "./lib/types/plugin/invariant.d.ts", - "default": "./lib/invariant.js" - }, "./client": { "types": "./lib/types/client/index.d.ts", "default": "./lib/client.js" @@ -29,12 +25,10 @@ }, "files": [ "lib/index.js", - "lib/invariant.js", "lib/client.js", "lib/assets/mermaid.js", "lib/assets/three.js", "lib/types/plugin/index.d.ts", - "lib/types/plugin/invariant.d.ts", "lib/types/client/index.d.ts", "SKILL.md", "README.md", @@ -86,7 +80,6 @@ "@deepseek-ai/dsh-client-ui-session": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", "@deepseek-ai/dsh-client-ui-tool": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", - "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", "@deepseek-ai/dsh-llm": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", "@deepseek-ai/dsh-session": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", "@deepseek-ai/dsh-skill": "^0.1.2-rc.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.1.7-alpha.1 || >=0.2.0-rc.1 <0.3.0-0", @@ -122,7 +115,6 @@ "@deepseek-ai/dsh-deque": "0.1.2-rc.1", "@deepseek-ai/dsh-file-reference": "0.1.2-rc.1", "@deepseek-ai/dsh-home-paths": "0.1.2-rc.1", - "@deepseek-ai/dsh-invariants": "0.1.2-rc.1", "@deepseek-ai/dsh-jobs": "0.1.2-rc.1", "@deepseek-ai/dsh-llm": "0.1.2-rc.1", "@deepseek-ai/dsh-native-command": "0.1.2-rc.1", @@ -226,9 +218,6 @@ "@deepseek-ai/dsh-client-ui-tool": { "optional": true }, - "@deepseek-ai/dsh-invariants": { - "optional": true - }, "@deepseek-ai/dsh-llm": { "optional": true }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 022b54ea..e2304c8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,9 +96,6 @@ importers: '@deepseek-ai/dsh-home-paths': specifier: 0.1.2-rc.1 version: 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) - '@deepseek-ai/dsh-invariants': - specifier: 0.1.2-rc.1 - version: 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2) '@deepseek-ai/dsh-jobs': specifier: 0.1.2-rc.1 version: 0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-agent@0.1.2-rc.1(6f833cf90b9dd3f0d529840b1aebfb48))(@deepseek-ai/dsh-brand@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2))(@deepseek-ai/dsh-session@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-scope@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)(@deepseek-ai/dsh-invariants@0.1.2-rc.1(@deepseek-ai/cordis@4.0.2)))) @@ -1685,133 +1682,157 @@ packages: resolution: {integrity: sha512-+oEBxK35kdbskhxozjZhI8N6qrMOfphpIkXnqBj6N2DC08rdkg10MUMRNKZLBNU6uNyoYiLcLyCE6aFV2sfMKw==} cpu: [arm64] os: [android] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-darwin-arm64@0.8.5': resolution: {integrity: sha512-+U2LBCJbQH24dFLAM0kmij/fOVHHWqWTMuaCavRKDE9rBz/a46tNsuYN87p+nFt5V4MECM7t5RSLCNkYzBmE+Q==} cpu: [arm64] os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-darwin-x64@0.8.5': resolution: {integrity: sha512-STctF8lSW+XhRvPupHktesqV0pk61SEZOwZTuDTZD/nPZsBsOPnD+X1hODioeoXMHn7bTkQKefOn4y6NyBOnoQ==} cpu: [x64] os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-freebsd-x64@0.8.5': resolution: {integrity: sha512-cQRu/g1LjMnso08GhiFQHrzLdczNiJ1IikpStJRC1RnKHGdZRGAWrfuJx1/j0Nwow0z9PrBf/rb3x85MRGSAQQ==} cpu: [x64] os: [freebsd] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm-gnu@0.8.5': resolution: {integrity: sha512-069wu3iLZzw0vMC3p4SECvA0MVyglOw5jTeKL99yfC1k89qA6PvKJDn3Ty6Z/2D9Ci0lAIjRDdicNqVpNCFyfg==} cpu: [arm] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm-musl@0.8.5': resolution: {integrity: sha512-g7GhzWR1EmK4BLZfVXJGzhpzNqgF8WhblU/oFZBvR+d747TmBslShqzdJAmaS1gJ1ydmQfyO94Zyias8pLUe5Q==} cpu: [arm] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm64-gnu@0.8.5': resolution: {integrity: sha512-moIvcAsAmgehTqvj3aBo97mAzx+4VGZudXsWvZTRfFs4qgg+iSdzrV8wMWURHslQkFDXKvt1DzMxGNZZxjz5yQ==} cpu: [arm64] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-arm64-musl@0.8.5': resolution: {integrity: sha512-w6sQZ5nlSYFPsz9FQ2a9oWxY/1cLi7C73qydLCqxYnB0EuDsrwZrKHw2FF/DXJr6qH7x2x+SmSFoVtaadLkhhg==} cpu: [arm64] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-x64-gnu@0.8.5': resolution: {integrity: sha512-R3bbB3RYuNu/aQcgCrwNRhKo/5zTLNyx+rklCzTrpESAbnZAwAU8cZqAe0CSXFDGQAPooWZDnmIGsq/L5aDUBQ==} cpu: [x64] os: [linux] libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-linux-x64-musl@0.8.5': resolution: {integrity: sha512-E3tDaVRj9azS0GTzF2VpwkLLH1iqoadp2U1C2KDbUAtt1F4q5BBYzUv9/yI/4lmYzkrUSBG4e343tUwevm8u1w==} cpu: [x64] os: [linux] libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-win32-arm64@0.8.5': resolution: {integrity: sha512-zqy0Gu6StX8vN+J7i7J6HUjy6p+B+w7a3lLETlbmJLgphQTq3lKEt5zPAsNs/I5TU54xa3GaLobMM7EUqJvxZA==} cpu: [arm64] os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-codegen/binding-win32-x64@0.8.5': resolution: {integrity: sha512-2ASUq/tP4sFD6xlB7Nuz/v3ofhPlt122r6RNFjPAnQdxZUqerOCX4rTJkyYqYcnyiSVazyuSVWKOiJItyJGX1w==} cpu: [x64] os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 '@yuku-parser/binding-android-arm64@0.8.5': resolution: {integrity: sha512-BJtJvyf/Ma3v57uebPbe7VMUjNwTa3KW0fJn4awBBXyen8aS/i0gUbCDEsjGPY4GvAT41AggcYSep37V5VPENg==} cpu: [arm64] os: [android] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-darwin-arm64@0.8.5': resolution: {integrity: sha512-CEzkjuxNjufVmSRlSm1qYGaoRpbp0g03saC8Tz6BesbmBUuP8MSqJa2BSskMbvYkRhKUN4OFCoPJ0XJf7ARTZQ==} cpu: [arm64] os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-darwin-x64@0.8.5': resolution: {integrity: sha512-HS7wYfYUi3fTYNrzLNnZUia5DVo/Kf5NRmbh2rNVDKzMUEUfXI7xWdh0OOqIqYI3SsA5AcZOCI357uYb0+2B9Q==} cpu: [x64] os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-freebsd-x64@0.8.5': resolution: {integrity: sha512-Iq/XcdT3qjV+mxzb6hE4oSlst/+wrJxSsgKu3FkVkV1bxb0UfITfedws/wI356KVr+BM9CeamNkdbchHV4pJlw==} cpu: [x64] os: [freebsd] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm-gnu@0.8.5': resolution: {integrity: sha512-vbI/zeUdJEZ8BKUEfOD8ngtPR5/9XdONpRRosw73kOtA1GyipTF1rj75ozLHIVCEybdCB/GSlQ6OjjhuEAKrGA==} cpu: [arm] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm-musl@0.8.5': resolution: {integrity: sha512-3K4kOkOxWbUKoRja+vn7Srn8Nyc66Fr66oFWO+pFA/0KpVtlIGpKY+/KL8QIQdM7swTh+82OVkuFKeFEweVFLg==} cpu: [arm] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm64-gnu@0.8.5': resolution: {integrity: sha512-aj2pI9eT3ZAj8mWrC+utYUJwyxSd6ozthHjJfGtcY3MnZuQ4qbO7wm15BMqDgCSrg7az3tnONy1ftVQTWV9inA==} cpu: [arm64] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-arm64-musl@0.8.5': resolution: {integrity: sha512-+T2buVRNtY0QwhUeo8t47HmEpgh7tXMx8htMEdT7O0HHv3eFitwvyuVSdYNOpxo52Sc/0wJ6F4UbZni75aD4Pg==} cpu: [arm64] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-x64-gnu@0.8.5': resolution: {integrity: sha512-uIoy1uplNUqjq3GW6z+Ea8UCQkLKRPlM4FvqAhYMDwBazkVpE1mNvMqaQqf57ZP8mGTeOf4OF6CuUlenR2ttqg==} cpu: [x64] os: [linux] libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-linux-x64-musl@0.8.5': resolution: {integrity: sha512-27doVJjvYevPWcakDCpfgZfDAlyhfyY3BwHf5TKtponCrSYBMzrBpD8ChYB1M7B6YOm0M5U9kEA0k1sB6CD4Ow==} cpu: [x64] os: [linux] libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-win32-arm64@0.8.5': resolution: {integrity: sha512-UIlSKhOLWZUQyDVQzYWAkHQGWnwNw5IxR/YYT2UCy64HLMQGGIxhb3qa/7Rf6yki50FrLx1O9PWgBKXCq7Zxxg==} cpu: [arm64] os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-parser/binding-win32-x64@0.8.5': resolution: {integrity: sha512-helhS0Pt0TwsW9Z5L3V5o27qrnTrmaUTgSpymVUJYlZJgW6Nagk7nS5P3Ez4b1OZXMwc5y5CR6m1niuzL/yYfQ==} cpu: [x64] os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 '@yuku-toolchain/types@0.8.5': resolution: {integrity: sha512-ELNzrhwfi9+VCTaj6QcLCb5MlUK6pmVqPqH8bBmer1FTHvgEITnpwB73L/Wx5KKPPVWAokfeeU9V2rJy/9kMlg==} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c50d763d..82721cff 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -29,7 +29,6 @@ minimumReleaseAgeExclude: - '@deepseek-ai/dsh-deque@0.1.2-rc.1' - '@deepseek-ai/dsh-file-reference@0.1.2-rc.1' - '@deepseek-ai/dsh-home-paths@0.1.2-rc.1' - - '@deepseek-ai/dsh-invariants@0.1.2-rc.1' - '@deepseek-ai/dsh-jobs@0.1.2-rc.1' - '@deepseek-ai/dsh-llm@0.1.2-rc.1' - '@deepseek-ai/dsh-native-command@0.1.2-rc.1' diff --git a/scripts/check-host-api.mjs b/scripts/check-host-api.mjs index f60ae278..5e602fd0 100644 --- a/scripts/check-host-api.mjs +++ b/scripts/check-host-api.mjs @@ -14,10 +14,11 @@ const dshPackages = Object.keys(pkg.peerDependencies).filter(name => name.starts const checkRoot = await mkdtemp(join(tmpdir(), 'dsh-genui-host-api-')) try { - for (const name of ['package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.npmrc', 'tsconfig.json', 'tsdown.config.ts']) { + for (const name of ['package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.npmrc', 'tsconfig.json', 'tsdown.config.ts', 'vitest.config.ts', 'SKILL.md']) { await cp(join(repoRoot, name), join(checkRoot, name)) } await cp(join(repoRoot, 'src'), join(checkRoot, 'src'), { recursive: true }) + await cp(join(repoRoot, 'tests'), join(checkRoot, 'tests'), { recursive: true }) // pnpm 在隔离目录安装发布包,源码中的 import 由该目录的 node_modules 解析。 execFileSync('pnpm', ['add', '--save-dev', '--save-exact', ...dshPackages.map(name => `${name}@${version}`)], { cwd: checkRoot, stdio: 'inherit' }) @@ -26,8 +27,9 @@ try { assert.equal(installed.version, version, `${name} 必须使用 ${version} 的公开类型`) } execFileSync('pnpm', ['exec', 'tsc', '-p', 'tsconfig.json'], { cwd: checkRoot, stdio: 'inherit' }) + execFileSync('pnpm', ['exec', 'vitest', 'run', 'tests/fence-feedback.spec.ts', 'tests/plugin-genui.spec.ts'], { cwd: checkRoot, stdio: 'inherit' }) execFileSync('pnpm', ['exec', 'tsdown'], { cwd: checkRoot, stdio: 'inherit' }) - console.log(`${hostRef} API typecheck 与 tsdown build 通过`) + console.log(`${hostRef} API typecheck、插件生命周期测试与 tsdown build 通过`) } finally { await rm(checkRoot, { recursive: true, force: true }) } diff --git a/src/plugin/invariant.ts b/src/plugin/invariant.ts deleted file mode 100644 index a7e4037f..00000000 --- a/src/plugin/invariant.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Package-owned invariant companion for `@changfenhuang/dsh-genui`. - * @module @changfenhuang/dsh-genui/invariant - */ - -/* jscpd:ignore-start */ -import type { Context } from '@deepseek-ai/cordis' -import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants' - -const PACKAGE_NAME = '@changfenhuang/dsh-genui' - -/** Cordis companion plugin name. */ -export const name = 'genui-invariant' -/** Service required before the companion can reserve package ownership. */ -export const inject = ['invariants'] - -/** - * No runtime invariant: this host plugin only registers a static prompt - * section; the section text is pinned by its own tests. - */ -const install: InvariantInstaller = () => {} - -/** - * Register this package's invariant companion. - * @param ctx - Cordis context carrying the invariant service. - * @returns the installed registration's disposer after setup succeeds. - */ -export const apply = (ctx: Context): Promise<() => void> => - Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install)) -/* jscpd:ignore-end */ diff --git a/tests/fence-feedback.spec.ts b/tests/fence-feedback.spec.ts index f735d72a..d08b57a4 100644 --- a/tests/fence-feedback.spec.ts +++ b/tests/fence-feedback.spec.ts @@ -158,7 +158,7 @@ async function persistedFeedbackHarness() { }, assistant: (body: string) => { session.append('assistant/message', { - turn, step: 1, + turn, step: 1, stream: [], message: createAssistantMessage({ content: [{ type: 'text', text: reply(body) }], source: { provider: 'test', model: 'test' }, }), @@ -1065,7 +1065,7 @@ describe('persisted fence feedback lifecycle', () => { const restored = h.ctx.sessions.create('restored-feedback', { seed: h.session.snapshotEvents() }) const steer = vi.fn() restored.append('assistant/message', { - turn: 7, step: 1, + turn: 7, step: 1, stream: [], message: createAssistantMessage({ content: [{ type: 'text', text: reply('{"items":[{"type":"stat","label":"third"}]}') }], source: { provider: 'test', model: 'test' }, diff --git a/tests/peer-range.spec.ts b/tests/peer-range.spec.ts index 0ce912dd..686df9b8 100644 --- a/tests/peer-range.spec.ts +++ b/tests/peer-range.spec.ts @@ -11,7 +11,9 @@ const versionCases = [ ['0.1.7-alpha.1', true], ['0.1.7-rc.2', true], ['0.2.0-rc.1', true], + ['0.2.0-rc.2', true], ['0.2.0', true], + ['0.2.1-alpha.1', true], ['0.2.1', true], ['0.3.0-rc.1', false], ['0.3.0', false], @@ -19,8 +21,8 @@ const versionCases = [ ] as const describe('DSH peer version ranges', () => { - it('covers all 18 DSH packages', () => { - expect(dshPeers).toHaveLength(18) + it('covers all 17 DSH packages', () => { + expect(dshPeers).toHaveLength(17) }) it.each(versionCases)('%s support matches every DSH peer range', (version, expected) => { diff --git a/tsdown.config.ts b/tsdown.config.ts index 95e72546..33f47667 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -245,19 +245,15 @@ function assetConfig(name: 'mermaid' | 'three' | 'echarts', entry: string): User const libConfig: UserConfig = { name: ID, - // Named entries keep the published layout stable (lib/index.js + - // lib/invariant.js) while src/index.ts becomes the canonical bundle - // source entry that plugin_check's tool-bundle contract expects. - entry: { index: 'src/index.ts', invariant: 'src/plugin/invariant.ts' }, + // Keep the root plugin bundle at lib/index.js, built from src/index.ts. + entry: { index: 'src/index.ts' }, outDir: 'lib', format: ['esm'], platform: 'node', target: 'es2024', fixedExtension: false, dts: false, - // Flatten entry outputs to lib/.js so package exports keep the - // stable paths lib/index.js + lib/invariant.js (a directory-mirroring - // default would emit lib/plugin/invariant.js). + // Keep the output name aligned with the package's root export. outputOptions: { entryFileNames: '[name].js' }, // Cleanup happens in the build script (`rm -rf lib` before tsc): tsdown // must never wipe lib/types (tsc's declaration output) mid-pipeline.