DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix(plugins): 移除 dsh-tauri-archive 中已失效的 patch 目标 (#763) (#768)
Mao Mr68e8284b1877
diff --git a/packages/dsh-tauri-archive/THIRD_PARTY_NOTICES.md b/packages/dsh-tauri-archive/THIRD_PARTY_NOTICES.mdindex 177e5f95..a517586e 100644--- a/packages/dsh-tauri-archive/THIRD_PARTY_NOTICES.md+++ b/packages/dsh-tauri-archive/THIRD_PARTY_NOTICES.md@@ -16,7 +16,6 @@ Integration points:- Official row/menu recognition: only official `itemWrap`-structured primitives entries are recognised, and workspace rows are matched by the official row title (`workspace-patch.utils.ts:13,32,52`).- Official service surface: `src/client/types/runtime.ts:24-29` declares the official sessions (list subscription, refresh, open, bind, fork) and workspaces surfaces; `open` moved in kernel 0.1.7 and is restored by this repo's adapter instead of being re-implemented.- Official archive action mirroring: a session archived through the official menu appears in this package's page immediately (`src/client/hooks/use-archive-view.ts:15`).-- Official row disabled: `cordis.patch.yml` disables the official row id `ui-settings-unarchive-sessions`, whose page duplicates this package's archive section and only supports unarchive, never delete.Deliberate difference:diff --git a/packages/dsh-tauri-archive/cordis.patch.yml b/packages/dsh-tauri-archive/cordis.patch.ymlindex 8420678a..185e8062 100644--- a/packages/dsh-tauri-archive/cordis.patch.yml+++ b/packages/dsh-tauri-archive/cordis.patch.yml@@ -1,8 +1,3 @@-# 官方「已归档会话」设置页:与本插件的归档分区重复,且只支持取消归档、不能删除。-# 默认在加载层关闭该入口(0.1.6 起存在该行;旧内核无此 id 时仅告警跳过,不影响启动)。-- id: ui-settings-unarchive-sessions- disabled: true-- insert:- id: dsh-tauri-archivename: dsh-tauri-archivediff --git a/test/plugin-patch-targets.test.ts b/test/plugin-patch-targets.test.tsnew file mode 100644index 00000000..6383024a--- /dev/null+++ b/test/plugin-patch-targets.test.ts@@ -0,0 +1,58 @@+import { existsSync, readdirSync, readFileSync } from 'node:fs'+import { describe, expect, it } from 'vitest'++/**+ * issue #763:插件包内的 `cordis.patch.yml` 用顶层 `- id: <官方 id>` 关掉官方入口,+ * 但该 id 一旦随核心移除就成了死目标——loader 只在启动日志里告警跳过,静默留痕。+ *+ * 下面这份字面量是「当前确实仍需禁用的官方入口」的独立来源:`ui-settings-models`+ * 由核心 `@deepseek-ai/dsh-client-ui-settings-models` 提供(0.2.0-rc.1 仍在),+ * `dsh-tauri-model` 是它的完整 fork、注册同一个 `settings.section/models`,故必须禁用。+ * 已被核心移除的 `ui-settings-unarchive-sessions` 不得再回到任何 patch 层。+ */+const OFFICIAL_ROW_DISABLES = ['dsh-tauri-model → ui-settings-models']++const PACKAGES_ROOT = new URL('../packages/', import.meta.url)++function readPatchLayer(pkg: string): string {+ return readFileSync(new URL(`${pkg}/cordis.patch.yml`, PACKAGES_ROOT), 'utf8')+}++function packageNames(): string[] {+ return readdirSync(PACKAGES_ROOT, { withFileTypes: true })+ .filter(entry => entry.isDirectory() && existsSync(new URL(`${entry.name}/cordis.patch.yml`, PACKAGES_ROOT)))+ .map(entry => entry.name)+ .sort()+}++/** 顶层 `- id:` 才是 patch 目标;`insert:` 内缩进的 `id` 是插入的插件自身条目。 */+function disabledRowIds(source: string): string[] {+ return source.split('\n').flatMap((line) => {+ const match = /^- id: (\S+)\s*$/.exec(line)+ return match === null ? [] : [match[1]]+ })+}++describe('插件 patch 层的官方目标', () => {+ it('只把核心仍在提供的官方入口列为 patch 目标', () => {+ const actual = packageNames().flatMap(pkg => disabledRowIds(readPatchLayer(pkg)).map(id => `${pkg} → ${id}`))++ expect(actual).toEqual(OFFICIAL_ROW_DISABLES)+ })++ it('dsh-tauri-archive 的 patch 层只插入插件自身', () => {+ const source = readPatchLayer('dsh-tauri-archive')++ expect(disabledRowIds(source)).toEqual([])+ expect(source).toContain('- insert:')+ expect(source).toContain('- id: dsh-tauri-archive')+ expect(source).toContain('name: dsh-tauri-archive')+ })++ it('dsh-tauri-archive 的第三方声明不再声称禁用了官方入口', () => {+ const notices = readFileSync(new URL('../packages/dsh-tauri-archive/THIRD_PARTY_NOTICES.md', import.meta.url), 'utf8')++ expect(notices).not.toContain('ui-settings-unarchive-sessions')+ expect(notices).not.toContain('Official row disabled')+ })+})