Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(desktop): 移除 dsh-im 面板接管与市场标签页注入 (#1167) (#1170)

Hairy82e90ce46d09
diff --git a/.gitmodules b/.gitmodules
index f230b527..8ca7b788 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -16,9 +16,6 @@
[submodule "source/dsh-plugin-capabilities"]
path = source/dsh-plugin-capabilities
url = https://github.com/qinyre/dsh-plugin-capabilities
-[submodule "source/dsh-market"]
- path = source/dsh-market
- url = https://github.com/dsh-market/dsh-market.git
[submodule "source/deepseek-harness"]
path = source/deepseek-harness
url = https://github.com/deepseek-ai/deepseek-harness
diff --git a/docs/specs/upstram.sync.md b/docs/specs/upstram.sync.md
index b4a3c291..701e0217 100644
--- a/docs/specs/upstram.sync.md
+++ b/docs/specs/upstram.sync.md
@@ -158,14 +158,13 @@ git diff --check
| `dsh-tauri-pet` | `QCYTSN/dsh-dafeiyu` | `source/dsh-dafeiyu` | `v0.1.14` (`9c0588c`) | `v0.1.14` (`9c0588c`) | `v0.1.10`–`v0.1.14` 已评估:零可移植(文案表几无变化;其 `includeSubagents` opt-in 与本仓硬排除子代理会话**有意相反**);无待评估项 | [日志](https://www.google.com/search?q=../packages/dsh-tauri-pet/docs/sync-log.md) |
| `dsh-tauri-pet` | `Skylarking/dsh-plugin-codex-pets` | `source/dsh-plugin-codex-pets` | `22e93f4` | - | 未评估 main 分支更新 | [日志](https://www.google.com/search?q=../packages/dsh-tauri-pet/docs/sync-log.md) |
| 桌宠窗口 | `ayangweb/BongoCat` | `source/BongoCat` | `44f44bc` | `v1.1.0` | HEAD 已超前 Tag 5 个 Commit | [日志](https://www.google.com/search?q=../packages/dsh-tauri-pet/docs/sync-log.md) |
-| `dsh-tauri-extension` | `qinyre/dsh-plugin-capabilities` | `source/dsh-plugin-capabilities` | `v0.3.11` (`52e3f66`) | `v0.3.11` | 暂无待评估项(该上游的 Market 模块确定不移植;扩展面板的市场页改为直接消费 `dshmarket` 的 `market` 服务) | [日志](../packages/dsh-tauri-extension/docs/sync-log.md) |
-| `dsh-tauri-extension`(市场标签页) | `dsh-market/dsh-market` | `source/dsh-market` | `v1.47.0-6` (`53f793e`) | `v1.47.0-6` (`53f793e`) | 非代码移植:消费其 `ctx.provide('market')` 服务。`render()` 尚未发版,故先以 `source` 子模块承载;待上游发版后改为常规 npm 依赖并移除子模块 | - |
+| `dsh-tauri-extension` | `qinyre/dsh-plugin-capabilities` | `source/dsh-plugin-capabilities` | `v0.3.11` (`52e3f66`) | `v0.3.11` | 暂无待评估项(该上游的 Market 模块确定不移植,扩展面板也不再消费 `dshmarket` 的 `market` 服务) | [日志](../packages/dsh-tauri-extension/docs/sync-log.md) |
| `dsh-tauri-scheduler` | `MichengAI/dsh-automation` | `source/dsh-automation` | `ecfe1e6` (+`c426c3d`) | `v0.1.51` (`ecfe1e6`) | `v0.1.33`–`v0.1.42` 全部不采纳(2026-09-16);`v0.1.43`–`v0.1.51` 已评估并采纳 3 项(`116c953`+`a0c4cc6` 增量摘要、`0bde1a4` 插件卸载记 `cancelled`),其余不采纳/归档(2026-09-28);无待评估项 | [日志](https://www.google.com/search?q=../packages/dsh-tauri-scheduler/docs/sync-log.md) |
| `dsh-tauri`(内核载体契约) | `deepseek-ai/deepseek-harness` | `source/deepseek-harness` | `dsh-v0.2.0-rc.2` (`639ed015397`) | `dsh-v0.2.0-rc.2` (`639ed015397`) | 区间 187 commits(140 非 merge,1022 文件):宿主契约(鉴权闸门 / index 注入行 / `dshDesktop` 标记 / `__DSH_BOOT__`)10 份源文件 blob SHA 逐字节相等,仅基线推进;`FALLBACK_DSH_TAG` 保留最后已打包的 rc.1 tag(打包仓库未产出 rc.2 前不杜撰 buildId);Windows 标题栏/全屏 DOM 契约、新可选包、Electron 专属适配、上游 pi-ai 0.87.1 升级归档不实施(本地不枚举 pi-ai compat 字段,无待办;rc.2 的模型选择器搜索能力已择优落到 `dsh-tauri-model` 候选选择器,登记见该包 `THIRD_PARTY_NOTICES.md`);无待评估项 | [日志](../packages/dsh-tauri/docs/sync-log.md) |
### 5.2 已知配置与异常记录
-* **子模块绑定**:`source/*` 下 8 个参考仓库均已引入 `.gitmodules`。其中 `source/dsh-market` 是 2026-09 新增的**临时**参考仓库:上游 `render()` API 只存在于 main 分支,尚未发版,故先以源码子模块承载供 GitHub 源安装测试;上游发版后应改为 npm 依赖并移除该子模块。当前 gitlink 配置已暂存,待提交。
+* **子模块绑定**:`source/*` 下参考仓库均已引入 `.gitmodules`。`source/dsh-market` 曾为扩展面板的市场标签页临时引入(上游 `render()` 只存在于 main 分支),该标签页已在 #1167 移除,对应的 gitlink 与 `.gitmodules` 条目一并删除。
* **内核参考仓库**:`source/deepseek-harness`(`deepseek-ai/deepseek-harness`,基线 `639ed015397` = `dsh-v0.2.0-rc.2`)是**只读对照基线**,为 Issue #496(非 Electron 壳可复用的无端口嵌入式宿主)提供契约比对依据。按 §1.2,DSH 内核**排除在本同步流程之外**:此子模块不参与择优采纳,只用于核对宿主契约与登记核心版本基线(登记见 §5.1 末行,明细见 `packages/dsh-tauri/docs/sync-log.md`)。桌面端载体鉴权适配的实现见 `packages/dsh-tauri/src/host/service/gate.ts`(`DSH_TAURI_EMBEDDED=1` 时覆写两道鉴权闸门)。
* **路径纠偏记录**:
* `source/dsh-automation` 已纠正 gitlink 配置,子模块 HEAD 指向 `f1bc91a`。
diff --git a/packages/dsh-tauri-extension/docs/sync-log.md b/packages/dsh-tauri-extension/docs/sync-log.md
index a8fe4bf8..aab9cae4 100644
--- a/packages/dsh-tauri-extension/docs/sync-log.md
+++ b/packages/dsh-tauri-extension/docs/sync-log.md
@@ -59,7 +59,7 @@
- 侧栏扩展的路由前缀随桌面统一为 `/api/desktop/dsh-tauri-extension/*`,不改为上游的 `/dsh-plugin-capabilities/*`。
- MCP 管理继续写入当前扩展约定的 profile / DSH home 路径。
- 不移植上游设置页的“技能与 MCP”一级标题。
-- 不移植上游 Market(技能市场 / MCP 市场)模块;扩展面板新增的「市场」标签页(`src/client/components/market-tab.tsx`)不来自该上游,而是直接消费 `dshmarket` 经 `ctx.provide('market')` 发布的 `render()` 面板,详见 `docs/specs/upstram.sync.md` §5。
+- 不移植上游 Market(技能市场 / MCP 市场)模块,扩展面板也不再提供「市场」标签页:原标签页直接消费 `dshmarket` 经 `ctx.provide('market')` 发布的 `render()` 面板,已随 #1167 移除(市场插件自行挂到左侧边栏,桌面端无需接管)。
- 技能仓库仍沿用侧栏扩展的精简“导入仓库”流程。
- 侧栏扩展既有的 JSON / 表单双模式 MCP 编辑器保留。
diff --git a/packages/dsh-tauri-extension/src/client/components/extension-panel.test.tsx b/packages/dsh-tauri-extension/src/client/components/extension-panel.test.tsx
index f07bf40d..36b6071b 100644
--- a/packages/dsh-tauri-extension/src/client/components/extension-panel.test.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/extension-panel.test.tsx
@@ -1,6 +1,5 @@
// @vitest-environment jsdom
import type { SegmentedControlProps } from '../../../../dsh-tauri-ui/src/client/components/segmented-control'
-import type { MarketFace } from '../service/market.types'
import { cleanup, fireEvent, render } from '@testing-library/react'
import { renderToStaticMarkup } from 'react-dom/server'
import { afterEach, describe, expect, it, vi } from 'vitest'
@@ -31,47 +30,24 @@ afterEach(() => {
describe('extension panel composition', () => {
it('renders the official plugins element as the first selected tab', () => {
- const render = vi.fn(() => <section>installed-market-content</section>)
- const market: MarketFace = { version: 1, render, setSettingsVisible: vi.fn(), settingsVisible: () => false }
- const markup = renderToStaticMarkup(<ExtensionPanel plugins={<section>official-plugins-content</section>} market={market} createSkill={async () => {}} />)
- expect(markup).toContain('data-active="plugins"')
- expect(markup).toContain('<button type="button">plugins</button><button type="button">market</button><button type="button">skills</button><button type="button">mcp</button>')
- expect(markup).toContain('official-plugins-content')
- expect(render).not.toHaveBeenCalled()
- expect(markup).not.toContain('skills-content')
- expect(markup).not.toContain('mcp-content')
- })
-
- it('renders plugins without the optional market service', () => {
- const markup = renderToStaticMarkup(<ExtensionPanel plugins={<section>official-plugins-content</section>} market={undefined} createSkill={async () => {}} />)
+ const markup = renderToStaticMarkup(<ExtensionPanel plugins={<section>official-plugins-content</section>} createSkill={async () => {}} />)
expect(markup).toContain('data-active="plugins"')
expect(markup).toContain('<button type="button">plugins</button><button type="button">skills</button><button type="button">mcp</button>')
expect(markup).toContain('official-plugins-content')
- })
-
- it('renders the market element with the installed subsection preference when plugins are unavailable', () => {
- const render = vi.fn(() => <section>installed-market-content</section>)
- const market: MarketFace = { version: 1, render, setSettingsVisible: vi.fn(), settingsVisible: () => false }
- const markup = renderToStaticMarkup(<ExtensionPanel market={market} createSkill={async () => {}} />)
- expect(markup).toContain('data-active="market"')
- expect(markup).toContain('<button type="button">market</button><button type="button">skills</button><button type="button">mcp</button>')
- expect(render).toHaveBeenCalledExactlyOnceWith({ preferredSubsectionId: 'installed' })
- expect(markup).toContain('installed-market-content')
expect(markup).not.toContain('skills-content')
expect(markup).not.toContain('mcp-content')
})
- it('renders skills when both optional pages are unavailable', () => {
- const markup = renderToStaticMarkup(<ExtensionPanel market={undefined} createSkill={async () => {}} />)
+ it('renders skills when the official plugins page is unavailable', () => {
+ const markup = renderToStaticMarkup(<ExtensionPanel createSkill={async () => {}} />)
expect(markup).toContain('data-active="skills"')
expect(markup).toContain('<button type="button">skills</button><button type="button">mcp</button>')
expect(markup).toContain('skills-content')
- expect(markup).not.toContain('installed-market-content')
expect(markup).not.toContain('mcp-content')
})
it('unmounts official plugins on tab switches while preserving the skill draft', () => {
- const view = render(<ExtensionPanel plugins={<section>official-plugins-content</section>} market={undefined} createSkill={async () => {}} />)
+ const view = render(<ExtensionPanel plugins={<section>official-plugins-content</section>} createSkill={async () => {}} />)
const plugins = view.getByText('official-plugins-content')
fireEvent.click(view.getByRole('button', { name: 'skills' }))
expect(plugins.isConnected).toBe(false)
@@ -89,30 +65,15 @@ describe('extension panel composition', () => {
it('keeps a fallback skill draft when official plugins disappear and return', () => {
const createSkill = async () => {}
const plugins = <section>official-plugins-content</section>
- const view = render(<ExtensionPanel plugins={plugins} market={undefined} createSkill={createSkill} />)
- view.rerender(<ExtensionPanel market={undefined} createSkill={createSkill} />)
+ const view = render(<ExtensionPanel plugins={plugins} createSkill={createSkill} />)
+ view.rerender(<ExtensionPanel createSkill={createSkill} />)
const draft = view.getByRole('textbox', { name: 'skill draft' })
fireEvent.change(draft, { target: { value: 'unsaved skill' } })
- view.rerender(<ExtensionPanel plugins={plugins} market={undefined} createSkill={createSkill} />)
+ view.rerender(<ExtensionPanel plugins={plugins} createSkill={createSkill} />)
expect(view.getByText('official-plugins-content').closest('[role="tabpanel"]')?.hasAttribute('hidden')).toBe(false)
expect(draft.isConnected).toBe(true)
expect(draft.closest('[role="tabpanel"]')?.hasAttribute('hidden')).toBe(true)
- view.rerender(<ExtensionPanel market={undefined} createSkill={createSkill} />)
- expect(view.getByRole('textbox', { name: 'skill draft' })).toBe(draft)
- expect((draft as HTMLInputElement).value).toBe('unsaved skill')
- })
-
- it('keeps a fallback tab mounted when the market disappears and returns', () => {
- const market: MarketFace = { version: 1, render: () => <section>market</section>, setSettingsVisible: vi.fn(), settingsVisible: () => false }
- const createSkill = async () => {}
- const view = render(<ExtensionPanel market={market} createSkill={createSkill} />)
- view.rerender(<ExtensionPanel market={undefined} createSkill={createSkill} />)
- const draft = view.getByRole('textbox', { name: 'skill draft' })
- fireEvent.change(draft, { target: { value: 'unsaved skill' } })
- view.rerender(<ExtensionPanel market={market} createSkill={createSkill} />)
- expect(draft.isConnected).toBe(true)
- expect(draft.closest('[role="tabpanel"]')?.hasAttribute('hidden')).toBe(true)
- view.rerender(<ExtensionPanel market={undefined} createSkill={createSkill} />)
+ view.rerender(<ExtensionPanel createSkill={createSkill} />)
expect(view.getByRole('textbox', { name: 'skill draft' })).toBe(draft)
expect((draft as HTMLInputElement).value).toBe('unsaved skill')
})
diff --git a/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx b/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx
index 29457217..9f1ea8a6 100644
--- a/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx
@@ -1,5 +1,4 @@
import type { ReactElement } from 'react'
-import type { MarketFace } from '../service/market.types'
import { SegmentedControl } from 'dsh-tauri-ui/client'
import { useId, useState } from 'react'
import { locale } from '../locales'
@@ -10,7 +9,6 @@ import { SkillsTab } from './skills-tab'
export interface ExtensionPanelProps {
createSkill: () => Promise<void>
plugins?: ReactElement
- market: MarketFace | undefined
}
interface ExtensionTab {
@@ -19,15 +17,11 @@ interface ExtensionTab {
render: () => ReactElement
}
-export function ExtensionPanel({ createSkill, market, plugins }: ExtensionPanelProps): ReactElement {
+export function ExtensionPanel({ createSkill, plugins }: ExtensionPanelProps): ReactElement {
const t = locale.text
const tabsId = useId()
- const marketFace = market
const rows: ExtensionTab[] = [
...(plugins === undefined ? [] : [{ id: 'plugins', label: t('pluginsTab'), render: () => plugins }]),
- ...(marketFace === undefined
- ? []
- : [{ id: 'market', label: t('marketTab'), render: () => <>{marketFace.render({ preferredSubsectionId: 'installed' })}</> }]),
{ id: 'skills', label: t('skillsTab'), render: () => <SkillsTab t={t} createSkill={createSkill} /> },
{ id: 'mcp', label: t('mcpTab'), render: () => <McpTab t={t} /> },
]
diff --git a/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.test.ts b/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.test.ts
index 0ac78059..3352ade2 100644
--- a/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.test.ts
+++ b/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.test.ts
@@ -1,31 +1,31 @@
/**
* client/components/extension-panel.utils.test.ts — 活动标签页必须落在现存标签页上。
*
- * 守一条事故约束(issue #655):插件市场点「更新」会重载市场插件的客户端 bundle,
- * 它发布的面板服务随之短暂消失、`rows` 里的 `market` 一并消失。活动页若仍是那个
- * 已不存在的 id,面板过滤后一行都不渲染 —— 插件市场变成空白页,且不会自愈。
+ * 守一条事故约束(issue #655):插件面板重载会让插件页短暂消失,`rows` 里的
+ * `plugins` 一并消失。活动页若仍是那个已不存在的 id,面板过滤后一行都不渲染 ——
+ * 面板变成空白页,且不会自愈。
*/
import { describe, expect, it } from 'vitest'
import { resolveActiveTab } from './extension-panel.utils'
-const WITH_MARKET = [{ id: 'market' }, { id: 'skills' }, { id: 'mcp' }]
-const WITHOUT_MARKET = [{ id: 'skills' }, { id: 'mcp' }]
+const WITH_PLUGINS = [{ id: 'plugins' }, { id: 'skills' }, { id: 'mcp' }]
+const WITHOUT_PLUGINS = [{ id: 'skills' }, { id: 'mcp' }]
describe('resolveActiveTab', () => {
it('请求的标签页仍在场:原样保持,不跳回第一页', () => {
- expect(resolveActiveTab(WITH_MARKET, 'mcp')).toBe('mcp')
+ expect(resolveActiveTab(WITH_PLUGINS, 'mcp')).toBe('mcp')
})
it('请求的标签页已消失:回落到首个现存标签页,而不是留一个不存在的活动页', () => {
- expect(resolveActiveTab(WITHOUT_MARKET, 'market')).toBe('skills')
+ expect(resolveActiveTab(WITHOUT_PLUGINS, 'plugins')).toBe('skills')
})
it('只剩一个标签页时回落到它', () => {
- expect(resolveActiveTab([{ id: 'skills' }], 'market')).toBe('skills')
+ expect(resolveActiveTab([{ id: 'skills' }], 'plugins')).toBe('skills')
})
it('没有任何标签页:返回请求值,不返回 undefined', () => {
- expect(resolveActiveTab([], 'market')).toBe('market')
+ expect(resolveActiveTab([], 'plugins')).toBe('plugins')
})
})
diff --git a/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.ts b/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.ts
index 4d157294..7bb82b89 100644
--- a/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.ts
+++ b/packages/dsh-tauri-extension/src/client/components/extension-panel.utils.ts
@@ -1,14 +1,13 @@
/**
* client/components/extension-panel.utils.ts — 扩展面板标签页的取舍判据。
*
- * 市场标签页是**可选**的:它由另一个客户端插件在渲染期探测发布(`service/market.ts`),
- * 插件更新/重载期间服务会短暂消失。`useState` 的初值只取一次,若活动页直接沿用请求值,
- * 市场消失后过滤结果为空——一行都不渲染,面板变成空白页(issue #655)。
+ * 插件标签页是**可选**的:它由另一个客户端插件在渲染期探测发布,插件更新/重载期间会短暂消失。
+ * `useState` 的初值只取一次,若活动页直接沿用请求值,插件页消失后过滤结果为空——面板变成空白页(issue #655)。
*/
/**
* 活动标签页:请求值仍在场就保持它,否则回落到首个现存标签页。
- * @param rows - 当前可用的标签页(市场页缺席时不在其中)。
+ * @param rows - 当前可用的标签页(插件页缺席时不在其中)。
* @param requested - 用户最后选中的标签页 id。
*/
export function resolveActiveTab(rows: readonly { id: string }[], requested: string): string {
diff --git a/packages/dsh-tauri-extension/src/client/constants/index.ts b/packages/dsh-tauri-extension/src/client/constants/index.ts
index 017d28b1..d7e63208 100644
--- a/packages/dsh-tauri-extension/src/client/constants/index.ts
+++ b/packages/dsh-tauri-extension/src/client/constants/index.ts
@@ -4,7 +4,6 @@ import { PLUGIN_ID } from '../../shared/constants'
export { PLUGIN_ID } from '../../shared/constants'
export const CONVERSATION_INPUT_LEFT_SLOT = 'conversation.input.left'
-export const MARKET_SERVICE_NAME = 'market'
export const PANEL_ID = PLUGIN_ID
export const PANEL_ACTION_ORDER = 20
export const PLUGINS_MORE_HEADER_SELECTOR = '[data-dsh-extension-plugins] [data-plugin-panel] > header:has(> button:first-child + h1)'
diff --git a/packages/dsh-tauri-extension/src/client/locales/index.ts b/packages/dsh-tauri-extension/src/client/locales/index.ts
index fa41bfc5..a9314dd6 100644
--- a/packages/dsh-tauri-extension/src/client/locales/index.ts
+++ b/packages/dsh-tauri-extension/src/client/locales/index.ts
@@ -7,7 +7,6 @@ const zh = {
pluginsBack: '回退',
skillsTab: '技能',
mcpTab: 'MCP',
- marketTab: '市场',
skillsTitle: '技能管理',
skillsIntro: '查看与编辑 dsh 发现的技能;用户级与仓库技能可就地管理。卡片开关控制技能是否加载。',
newSkill: '新建技能',
@@ -125,7 +124,6 @@ const en: Record<LocaleKey, string> = {
pluginsBack: 'Back',
skillsTab: 'Skills',
mcpTab: 'MCP',
- marketTab: 'Market',
skillsTitle: 'Skills',
skillsIntro: 'View and manage discovered skills, including user and repository skills. Each card switch controls loading.',
newSkill: 'New skill',
diff --git a/packages/dsh-tauri-extension/src/client/register/extension-panel-plugins.test.tsx b/packages/dsh-tauri-extension/src/client/register/extension-panel-plugins.test.tsx
index 3d380025..d44ce9a8 100644
--- a/packages/dsh-tauri-extension/src/client/register/extension-panel-plugins.test.tsx
+++ b/packages/dsh-tauri-extension/src/client/register/extension-panel-plugins.test.tsx
@@ -142,7 +142,7 @@ function Plugins({ floor = false, initial = 'list', backLabel = '返回插件',
}
function renderPanel(plugins = <Plugins />) {
- return render(<ExtensionPanel plugins={plugins} market={{ version: 1, render: () => <section>Market</section>, setSettingsVisible: () => {}, settingsVisible: () => false }} createSkill={async () => {}} />)
+ return render(<ExtensionPanel plugins={plugins} createSkill={async () => {}} />)
}
async function settle(): Promise<void> {
@@ -169,7 +169,7 @@ describe('embedded official plugin headers', () => {
install()
const view = renderPanel()
const tabs = view.getAllByRole('tab')
- expect(tabs.map(tab => tab.textContent)).toEqual(['插件', '市场', '技能', 'MCP'])
+ expect(tabs.map(tab => tab.textContent)).toEqual(['插件', '技能', 'MCP'])
expect(tabs[0]?.getAttribute('aria-selected')).toBe('true')
const mainTitle = view.getByRole('heading', { name: '官方插件', level: 1 })
expect(getComputedStyle(mainTitle).paddingLeft).toBe('32px')
diff --git a/packages/dsh-tauri-extension/src/client/register/extension-panel.tsx b/packages/dsh-tauri-extension/src/client/register/extension-panel.tsx
index cbe253c1..b6e5a8d4 100644
--- a/packages/dsh-tauri-extension/src/client/register/extension-panel.tsx
+++ b/packages/dsh-tauri-extension/src/client/register/extension-panel.tsx
@@ -4,16 +4,14 @@ import { Icon, IconSparkleRegular, mountStyle, Panel, Puzzle, SlotOutlet } from
import { definePanel, defineRegister, hidePanel } from 'dsh-tauri/client'
import { useSyncExternalStore } from 'react'
import { ExtensionPanel } from '../components/extension-panel'
-import { MARKET_SERVICE_NAME, PANEL_ACTION_ORDER, PANEL_ID, PLUGINS_MORE_HEADER_SELECTOR } from '../constants'
+import { PANEL_ACTION_ORDER, PANEL_ID, PLUGINS_MORE_HEADER_SELECTOR } from '../constants'
import { locale } from '../locales'
-import { currentScope, hostsMarketPanel, readMarket } from '../service/market'
import { store } from '../store'
import { pluginsStyle } from '../styles/plugins.cssr'
import { chooseWorkspace, sessionSnapshotOf, workspaceSnapshotOf } from './extension-panel.utils'
export const extensionPanelFeature = defineRegister<ClientContext>((controller, ctx, adapter) => {
let panel: PanelHandle | undefined
- const embedMarket = hostsMarketPanel(currentScope())
const slots = adapter.service<SlotRegistry>('slots')
let restorePlugins: (() => void) | undefined
@@ -91,17 +89,6 @@ export const extensionPanelFeature = defineRegister<ClientContext>((controller,
syncPlugins()
controller.add(() => restorePlugins?.())
- ctx.inject([MARKET_SERVICE_NAME], () => {
- if (!embedMarket)
- return
- const face = readMarket(ctx)
- if (face === undefined)
- return
- const restore = face.settingsVisible()
- face.setSettingsVisible(false)
- return () => face.setSettingsVisible(restore)
- })
-
async function createSkill(): Promise<void> {
const id = chooseWorkspace(
sessionSnapshotOf(adapter.sessions.list?.getSnapshot()),
@@ -136,7 +123,7 @@ export const extensionPanelFeature = defineRegister<ClientContext>((controller,
}
return (
<Panel>
- <ExtensionPanel plugins={plugins} createSkill={createSkill} market={embedMarket ? readMarket(ctx) : undefined} />
+ <ExtensionPanel plugins={plugins} createSkill={createSkill} />
</Panel>
)
},
diff --git a/packages/dsh-tauri-extension/src/client/service/market.test.ts b/packages/dsh-tauri-extension/src/client/service/market.test.ts
deleted file mode 100644
index 3a35055e..00000000
--- a/packages/dsh-tauri-extension/src/client/service/market.test.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * client/service/market.test.ts — 市场面板服务的能力判据。
- *
- * 守三条需求硬约束:**没装市场时不出现标签页**;**已发布的 1.47.0(有 `market`
- * 但没有 `render`)不能被当成可用**——收不进面板,就更不能顺手把它自带的设置页
- * 入口藏掉,否则市场会彻底没有入口;**注册表读取抛错时静默**。
- *
- * 另守面板归属:只有桌面 iframe 收编市场,普通浏览器标签页保留市场自带的设置页入口。
- *
- * 判据都是能力探测,不是版本号。
- */
-
-import type { ClientContext } from 'dsh-tauri/client'
-import { describe, expect, it } from 'vitest'
-import { hostsMarketPanel, readMarket } from './market'
-
-/** 最小上下文替身:只提供能力探测真正读到的 `reflect.get`。 */
-function contextWith(service: unknown, options: { throws?: boolean } = {}): ClientContext {
- return {
- reflect: {
- get: () => {
- if (options.throws === true)
- throw new Error('registry unavailable')
- return service
- },
- provide: () => () => {},
- },
- } as unknown as ClientContext
-}
-
-/** 已发布的 1.47.0 形状:有可见性开关,但没有 `render`。 */
-function released(): unknown {
- return { version: 1, setSettingsVisible: () => {}, settingsVisible: () => true }
-}
-
-describe('readMarket', () => {
- it('未安装市场:服务缺席 → 不可用(标签页不出现)', () => {
- expect(readMarket(contextWith(undefined))).toBeUndefined()
- })
-
- it('已发布的 1.47.0:有 market 服务但没有 render → 仍不可用', () => {
- expect(readMarket(contextWith(released()))).toBeUndefined()
- })
-
- it('新版:render 可调用 → 返回服务本体', () => {
- const service = { ...released() as object, render: () => null }
- expect(readMarket(contextWith(service))).toBe(service)
- })
-
- it('render 存在但不是函数 → 按不可用处理', () => {
- expect(readMarket(contextWith({ ...released() as object, render: 'yes' }))).toBeUndefined()
- })
-
- it('注册表读取抛错时按不可用处理,不冒泡', () => {
- expect(readMarket(contextWith(undefined, { throws: true }))).toBeUndefined()
- })
-
- it('缺少 reflect 的壳也不会崩', () => {
- expect(readMarket({} as unknown as ClientContext)).toBeUndefined()
- expect(readMarket({ reflect: {} } as unknown as ClientContext)).toBeUndefined()
- })
-
- it('每次都按当前注册表读数探测:服务消失后回到不可用(不缓存旧引用)', () => {
- const service: unknown = { ...released() as object, render: () => null }
- let current: unknown = service
- const ctx = {
- reflect: {
- get: () => current,
- provide: () => () => {},
- },
- } as unknown as ClientContext
- expect(readMarket(ctx)).toBe(service)
- current = undefined
- expect(readMarket(ctx)).toBeUndefined()
- })
-})
-
-describe('hostsMarketPanel', () => {
- it('桌面 iframe:parent 不是自身 → 收编市场面板', () => {
- expect(hostsMarketPanel({ parent: {} })).toBe(true)
- })
-
- it('独立浏览器标签页:parent 是自身 → 不收编,市场设置页入口保留', () => {
- const scope: { parent: unknown } = { parent: undefined }
- scope.parent = scope
- expect(hostsMarketPanel(scope)).toBe(false)
- })
-
- it('没有窗口(非浏览器环境)→ 不收编', () => {
- expect(hostsMarketPanel(undefined)).toBe(false)
- })
-})
diff --git a/packages/dsh-tauri-extension/src/client/service/market.ts b/packages/dsh-tauri-extension/src/client/service/market.ts
deleted file mode 100644
index fb2b07d3..00000000
--- a/packages/dsh-tauri-extension/src/client/service/market.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import type { ClientContext } from 'dsh-tauri/client'
-import type { MarketFace } from './market.types'
-import { MARKET_SERVICE_NAME } from '../constants'
-
-/**
- * client/service/market.ts — 读市场插件发布的面板服务(能力探测,不做版本嗅探)。
- *
- * 服务的三个状态必须分开对待,否则会把用户的入口弄丢:
- *
- * - 没有 `market`(未安装 / 未加载)→ 不能用;
- * - 有 `market` 但没有可调用的 `render`(1.47.0,即已发布版本)→ **也不能用**:
- * 收不进来,就更不能顺手把它自带的设置页入口藏掉;
- * - 有 `render` → 面板归宿主,设置页那条重复入口由 `register/extension-panel` 撤下。
- *
- * 在**渲染那一刻**探测,而不是 apply 时:服务由另一个客户端插件发布,apply 顺序不保证。
- */
-
-export function readMarket(ctx: ClientContext): MarketFace | undefined {
- const reflect = ctx?.reflect
- if (reflect === undefined || typeof reflect.get !== 'function')
- return undefined
- let service: unknown
- try {
- service = reflect.get(MARKET_SERVICE_NAME)
- }
- catch {
- // 服务注册表在极端时序下可能抛错:按「没有该能力」处理,绝不因此报错。
- return undefined
- }
- if (service === null || service === undefined)
- return undefined
- return typeof (service as MarketFace).render === 'function' ? service as MarketFace : undefined
-}
-
-/**
- * 本宿主是否收编市场面板。
- *
- * 同一份 profile 也服务普通浏览器标签:桌面壳层把 dsh 页面嵌在跨域 iframe 里,
- * 只有那种情形才由本面板接管;浏览器直接访问时面板不出「市场」标签页,市场自带
- * 的设置页入口照旧保留。判据与 `dsh-tauri-ui` 的 `im-panel` 相同。
- */
-export function hostsMarketPanel(scope: { parent: unknown } | undefined): boolean {
- return scope !== undefined && scope.parent !== scope
-}
-
-/** 当前页面的窗口;非浏览器环境为 undefined。 */
-export function currentScope(): { parent: unknown } | undefined {
- return typeof window === 'undefined' ? undefined : window
-}
diff --git a/packages/dsh-tauri-extension/src/client/service/market.types.ts b/packages/dsh-tauri-extension/src/client/service/market.types.ts
deleted file mode 100644
index 47d1d226..00000000
--- a/packages/dsh-tauri-extension/src/client/service/market.types.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { ReactElement } from 'react'
-
-/** `market.render()` 入参:宿主希望面板初始停靠的子区(可带 `:查询串`,未知值被忽略)。 */
-export interface MarketRenderProps {
- preferredSubsectionId?: string
-}
-
-/**
- * `dshmarket` 经 `ctx.provide('market', …)` 发布的宿主接入面。
- *
- * `version` / `setSettingsVisible` / `settingsVisible` 自 1.47.0 就有;
- * `render`(把市场自己的面板交给宿主渲染)随下一个版本发布,因此能力判据是它,不是 `version`。
- */
-export interface MarketFace {
- version: number
- render: (props?: MarketRenderProps) => ReactElement
- setSettingsVisible: (visible: boolean) => void
- settingsVisible: () => boolean
-}
diff --git a/packages/dsh-tauri-ui/src/client/constants/index.ts b/packages/dsh-tauri-ui/src/client/constants/index.ts
index c55d5877..35f21248 100644
--- a/packages/dsh-tauri-ui/src/client/constants/index.ts
+++ b/packages/dsh-tauri-ui/src/client/constants/index.ts
@@ -39,9 +39,6 @@ export const NEW_SESSION_LABELS = ['新建会话', 'New session'] as const
/** 官方未分组分组行的行键:`workspace:` + 官方 `UNGROUPED_KEY`(后者为空串)。 */
export const UNGROUPED_ROW_KEY = 'workspace:'
-/** dsh-im 客户端插件经 `ctx.provide` 发布的反射服务名(4.22.0 起)。 */
-export const DSH_IM_CLIENT_SERVICE = 'dshImClient'
-
export const STYLES_EFFECT = `${PLUGIN_ID}: styles`
export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`
export const SEAT_EFFECT = `${PLUGIN_ID}: shell.overlay seat`
@@ -49,7 +46,6 @@ export const SECTIONS_EFFECT = `${PLUGIN_ID}: settings sections projection`
export const SETTINGS_EFFECT = `${PLUGIN_ID}: settings panel`
export const OBSTRUCTIONS_EFFECT = `${PLUGIN_ID}: settings obstructions`
export const SETTINGS_OPEN_EFFECT = `${PLUGIN_ID}: settings deep-link`
-export const IM_PANEL_EFFECT = `${PLUGIN_ID}: im panel`
export const HERO_WORKSPACE_EFFECT = `${PLUGIN_ID}: hero workspace picker`
export const NEW_SESSION_EFFECT = `${PLUGIN_ID}: sidebar new session`
export const UNGROUPED_NEW_SESSION_EFFECT = `${PLUGIN_ID}: sidebar ungrouped new session`
diff --git a/packages/dsh-tauri-ui/src/client/index.test.ts b/packages/dsh-tauri-ui/src/client/index.test.ts
index fba2f946..ed25a4c8 100644
--- a/packages/dsh-tauri-ui/src/client/index.test.ts
+++ b/packages/dsh-tauri-ui/src/client/index.test.ts
@@ -12,7 +12,6 @@ vi.mock('./register/composer-resume', () => ({ composerResumeFeature: vi.fn() })
vi.mock('./register/continue-notice', () => ({ registerContinueNotice: vi.fn() }))
vi.mock('./register/desktop-settings', () => ({ registerDesktopSettings: vi.fn() }))
vi.mock('./register/hero-workspace', () => ({ heroWorkspaceFeature: vi.fn() }))
-vi.mock('./register/im-panel', () => ({ registerImPanel: vi.fn() }))
vi.mock('./register/new-session', () => ({ sidebarNewSessionFeature: vi.fn(), ungroupedNewSessionFeature: vi.fn() }))
vi.mock('./register/obstructions', () => ({ registerSettingsObstructions: vi.fn() }))
vi.mock('./register/sections', () => ({ registerSettingsSections: vi.fn() }))
@@ -35,7 +34,7 @@ describe('ui client settings effect registration', () => {
apply({ effect } as unknown as Parameters<typeof apply>[0])
expect(effect).toHaveBeenCalledWith(registerSettings, 'dsh-tauri-ui: settings panel')
- expect(effect).toHaveBeenCalledTimes(13)
+ expect(effect).toHaveBeenCalledTimes(12)
expect(effect).toHaveBeenCalledWith(registerContinueNotice, 'dsh-tauri-ui: continue notice')
expect(effect).toHaveBeenCalledWith(expect.any(Function), 'dsh-tauri-ui: styles')
expect(effect.mock.calls.some(([, name]) => name.includes('mobile'))).toBe(false)
diff --git a/packages/dsh-tauri-ui/src/client/index.ts b/packages/dsh-tauri-ui/src/client/index.ts
index 3b9ec6eb..224c9d66 100644
--- a/packages/dsh-tauri-ui/src/client/index.ts
+++ b/packages/dsh-tauri-ui/src/client/index.ts
@@ -1,13 +1,12 @@
import type {} from '@deepseek-ai/dsh-client-ui-layout/client'
import type { ClientContext } from 'dsh-tauri/client'
import { PLUGIN_ID } from '../shared/constants'
-import { HERO_WORKSPACE_EFFECT, IM_PANEL_EFFECT, LOCALE_EFFECT, NEW_SESSION_EFFECT, OBSTRUCTIONS_EFFECT, SECTIONS_EFFECT, SETTINGS_EFFECT, SETTINGS_OPEN_EFFECT, STYLES_EFFECT, UNGROUPED_NEW_SESSION_EFFECT } from './constants'
+import { HERO_WORKSPACE_EFFECT, LOCALE_EFFECT, NEW_SESSION_EFFECT, OBSTRUCTIONS_EFFECT, SECTIONS_EFFECT, SETTINGS_EFFECT, SETTINGS_OPEN_EFFECT, STYLES_EFFECT, UNGROUPED_NEW_SESSION_EFFECT } from './constants'
import { locale } from './locales'
import { composerResumeFeature } from './register/composer-resume'
import { registerContinueNotice } from './register/continue-notice'
import { registerDesktopSettings } from './register/desktop-settings'
import { heroWorkspaceFeature } from './register/hero-workspace'
-import { registerImPanel } from './register/im-panel'
import { sidebarNewSessionFeature, ungroupedNewSessionFeature } from './register/new-session'
import { registerSettingsObstructions } from './register/obstructions'
import { registerSettingsSections } from './register/sections'
@@ -48,6 +47,5 @@ export function apply(ctx: ClientContext): void {
ctx.effect(ungroupedNewSessionFeature, UNGROUPED_NEW_SESSION_EFFECT)
ctx.effect(composerResumeFeature, COMPOSER_RESUME_EFFECT)
ctx.effect(registerContinueNotice, CONTINUE_NOTICE_EFFECT)
- ctx.effect(registerImPanel, IM_PANEL_EFFECT)
ctx.effect(registerDesktopSettings, `${PLUGIN_ID}: desktop settings`)
}
diff --git a/packages/dsh-tauri-ui/src/client/locales/index.ts b/packages/dsh-tauri-ui/src/client/locales/index.ts
index 4576539d..b9f72e0b 100644
--- a/packages/dsh-tauri-ui/src/client/locales/index.ts
+++ b/packages/dsh-tauri-ui/src/client/locales/index.ts
@@ -13,7 +13,6 @@ export const locale = defineLocale(PLUGIN_ID, {
noResults: '没有匹配的设置项',
resumeTask: '继续任务',
recoverContentRisk: '安全恢复并继续',
- im: 'IM',
chooseWorkspace: '选择工作区',
ungrouped: '未分组',
addWorkspace: '添加工作区…',
@@ -35,7 +34,6 @@ export const locale = defineLocale(PLUGIN_ID, {
noResults: 'No matching settings',
resumeTask: 'Resume task',
recoverContentRisk: 'Recover safely and continue',
- im: 'IM',
chooseWorkspace: 'Choose workspace',
ungrouped: 'Ungrouped',
addWorkspace: 'Add workspace…',
diff --git a/packages/dsh-tauri-ui/src/client/register/im-panel.tsx b/packages/dsh-tauri-ui/src/client/register/im-panel.tsx
deleted file mode 100644
index 96f857ca..00000000
--- a/packages/dsh-tauri-ui/src/client/register/im-panel.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import type { ClientContext } from 'dsh-tauri/client'
-import { definePanel, defineRegister } from 'dsh-tauri/client'
-import { Icon } from '../components/icon'
-import { Comments } from '../components/icons'
-import { Panel } from '../components/panel'
-import { DSH_IM_CLIENT_SERVICE } from '../constants'
-import { locale } from '../locales'
-import { readDshImClient } from '../service/dsh-im'
-
-/** 带插件前缀:dsh-im 源码仓库另有一个手动安装的同名接入(id `dsh-im`),同 id 会撞槽位。 */
-const IM_PANEL_ID = 'dsh-tauri-ui-im'
-/** 排在定时任务(30)之后。 */
-const IM_PANEL_ORDER = 40
-
-export const registerImPanel = defineRegister<ClientContext>((_controller, ctx) => {
- // 同一 profile 也服务普通浏览器标签:只有桌面 iframe 接管,浏览器保留设置页入口。
- if (typeof window === 'undefined' || window.parent === window)
- return
-
- // 服务由 dsh-im 客户端插件发布,apply 顺序不保证,旧版 dsh-im 也没有它:
- // inject 只在服务到位时激活本接入,缺席时不注册面板、不动设置页。
- // 交由返回的 disposer(而非 effect)回收:服务被撤下时同样要恢复设置页入口。
- ctx.inject([DSH_IM_CLIENT_SERVICE], () => {
- const im = readDshImClient(ctx)
- if (im === undefined)
- return
-
- const panel = definePanel(ctx, {
- id: IM_PANEL_ID,
- order: IM_PANEL_ORDER,
- label: () => locale.text('im'),
- icon: props => <Icon as={Comments} size={props.size} />,
- render: () => <Panel>{im.render()}</Panel>,
- })
- // 撤下重复入口前记住原状态:退出时恢复到「我们发现它时」的样子。
- const restoreSettings = im.settingsVisible()
- im.setSettingsVisible(false)
-
- return () => {
- im.setSettingsVisible(restoreSettings)
- panel.dispose()
- }
- })
-})
diff --git a/packages/dsh-tauri-ui/src/client/service/dsh-im.test.ts b/packages/dsh-tauri-ui/src/client/service/dsh-im.test.ts
deleted file mode 100644
index 16cc0c56..00000000
--- a/packages/dsh-tauri-ui/src/client/service/dsh-im.test.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import type { ClientContext } from 'dsh-tauri/client'
-import type { DshImClient } from './dsh-im.types'
-import { describe, expect, it } from 'vitest'
-import { DSH_IM_CLIENT_SERVICE } from '../constants'
-import { readDshImClient } from './dsh-im'
-
-const VALID: DshImClient = {
- version: 1,
- render: () => null,
- setSettingsVisible: () => {},
- settingsVisible: () => true,
-}
-
-function contextReflecting(get: (name: string) => unknown): ClientContext {
- return { reflect: { get } } as unknown as ClientContext
-}
-
-describe('readDshImClient', () => {
- it('reads the published v1 face', () => {
- const ctx = contextReflecting(name => name === DSH_IM_CLIENT_SERVICE ? VALID : undefined)
- expect(readDshImClient(ctx)).toBe(VALID)
- })
-
- it('rejects an unknown interface version', () => {
- const ctx = contextReflecting(() => ({ ...VALID, version: 2 }))
- expect(readDshImClient(ctx)).toBeUndefined()
- })
-
- it('rejects a face without render', () => {
- const ctx = contextReflecting(() => ({ ...VALID, render: undefined }))
- expect(readDshImClient(ctx)).toBeUndefined()
- })
-
- it('rejects a partial face missing the visibility switch', () => {
- expect(readDshImClient(contextReflecting(() => ({ ...VALID, setSettingsVisible: undefined })))).toBeUndefined()
- expect(readDshImClient(contextReflecting(() => ({ ...VALID, settingsVisible: undefined })))).toBeUndefined()
- })
-
- it('treats an absent service and a throwing registry as unavailable', () => {
- expect(readDshImClient(contextReflecting(() => undefined))).toBeUndefined()
- expect(readDshImClient(contextReflecting(() => {
- throw new Error('registry disposed')
- }))).toBeUndefined()
- })
-})
diff --git a/packages/dsh-tauri-ui/src/client/service/dsh-im.ts b/packages/dsh-tauri-ui/src/client/service/dsh-im.ts
deleted file mode 100644
index aae3d6fd..00000000
--- a/packages/dsh-tauri-ui/src/client/service/dsh-im.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import type { ClientContext } from 'dsh-tauri/client'
-import type { DshImClient } from './dsh-im.types'
-import { DSH_IM_CLIENT_SERVICE } from '../constants'
-
-/**
- * client/service/dsh-im.ts — 读 dsh-im 客户端服务(能力探测,不做版本嗅探)。
- *
- * 服务由另一个客户端插件发布、apply 顺序不保证,且旧版 dsh-im 根本没有它:
- * 在注册回调内即时读取,`version !== 1`、缺少可调用的 `render` 或注册表异常
- * 一律按「没有该能力」处理——只失去这个控制面,不影响本插件自身。
- */
-export function readDshImClient(ctx: ClientContext): DshImClient | undefined {
- const reflect = ctx?.reflect
- if (reflect === undefined || typeof reflect.get !== 'function')
- return undefined
- let service: unknown
- try {
- service = reflect.get(DSH_IM_CLIENT_SERVICE)
- }
- catch {
- return undefined
- }
- if (service === null || service === undefined)
- return undefined
- const face = service as DshImClient
- const usable = face.version === 1
- && typeof face.render === 'function'
- && typeof face.setSettingsVisible === 'function'
- && typeof face.settingsVisible === 'function'
- return usable ? face : undefined
-}
diff --git a/packages/dsh-tauri-ui/src/client/service/dsh-im.types.ts b/packages/dsh-tauri-ui/src/client/service/dsh-im.types.ts
deleted file mode 100644
index 61f08723..00000000
--- a/packages/dsh-tauri-ui/src/client/service/dsh-im.types.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { ReactNode } from 'react'
-
-/**
- * dsh-im 客户端反射服务(4.22.0 起经 `ctx.provide('dshImClient', ...)` 发布)。
- *
- * `render()` 每次返回新 element(完整管理面板,含语言刷新与局部错误保护),
- * `setSettingsVisible()` 只影响当前客户端内存中的「设置 → IM机器人」入口。
- */
-export interface DshImClient {
- readonly version: number
- render: (props?: { preferredSectionId?: string }) => ReactNode
- setSettingsVisible: (visible: boolean) => void
- settingsVisible: () => boolean
-}
diff --git a/source/dsh-market b/source/dsh-market
deleted file mode 160000
index 53f793e7..00000000
--- a/source/dsh-market
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 53f793e775834c11a4f196940a0b9c9fcf238c1c