DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
feat(panel-extension): embed the plugin market panel and retune the chrome
hairyf2454ab2afa7a
diff --git a/.gitmodules b/.gitmodulesindex 6702c5be..75f36ad9 100644--- a/.gitmodules+++ b/.gitmodules@@ -16,3 +16,6 @@[submodule "source/dsh-plugin-capabilities"]path = source/dsh-plugin-capabilitiesurl = https://github.com/qinyre/dsh-plugin-capabilities+[submodule "source/dsh-market"]+ path = source/dsh-market+ url = https://github.com/dsh-market/dsh-market.gitdiff --git a/README.en.md b/README.en.mdindex 5efdfe30..69567112 100644--- a/README.en.md+++ b/README.en.md@@ -67,7 +67,7 @@ First-party plugins bundled with the installer:- [DSH Tauri](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri) — provides a communication channel with the Tauri 2 shell- [DSH Tauri UI](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-ui) — provides a custom settings sidebar for the Tauri 2 shell- [DSH Tauri Worktree](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-worktree) — creates an isolated Git worktree per session, with checkout to a local branch or archive-and-abandon flows-- [DSH Tauri Panel Extension](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension) — Skills and MCP management with skill repository import+- [DSH Tauri Panel Extension](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension) — Skills and MCP management with skill repository import, plus an embedded plugin market panel- [DSH Tauri Panel Scheduler](https://github.com/dsh-tauri-desk/deepseek-harness-desktop/tree/main/packages/dsh-tauri-panel-scheduler) — creates daily, interval, weekday, and weekly scheduled tasks; runs them in independent Agent sessions and retains run history- [DSH Tauri Turn Rewind](https://github.com/dsh-tauri-desk/deepseek-harness-desktop/tree/main/packages/dsh-tauri-turnrewind) — records private Git snapshots per Agent turn, shows file-change cards, and safely undoes a turn with conflict protection- [DSH Tauri Session](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-session) — replaces workspace deletion with archiving and adds an Archived Chats settings page with search, sorting, grouping, project filtering, and unarchive supportdiff --git a/README.es.md b/README.es.mdindex a8732af3..c37b896f 100644--- a/README.es.md+++ b/README.es.md@@ -67,7 +67,7 @@ Plugins propios incluidos con el instalador:- [DSH Tauri](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri) — provee el canal de comunicación con el shell Tauri 2- [DSH Tauri UI](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-ui) — provee una barra lateral de ajustes personalizada para el shell Tauri 2- [DSH Tauri Worktree](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-worktree) — crea un Git worktree aislado por sesión, con checkout a rama local o flujos de archivar-y-abandonar-- [DSH Tauri Panel Extension](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension) — gestión de Skills y MCP con importación de repositorios de skills+- [DSH Tauri Panel Extension](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension) — gestión de Skills y MCP con importación de repositorios de skills, más un panel del mercado de plugins integrado- [DSH Tauri Panel Scheduler](https://github.com/dsh-tauri-desk/deepseek-harness-desktop/tree/main/packages/dsh-tauri-panel-scheduler) — crea tareas programadas diarias, por intervalo, días hábiles y semanales; las ejecuta en sesiones Agent independientes y conserva el historial- [DSH Tauri Turn Rewind](https://github.com/dsh-tauri-desk/deepseek-harness-desktop/tree/main/packages/dsh-tauri-turnrewind) — registra snapshots Git privados por turno del Agent, muestra tarjetas de cambios y revierte un turno de forma segura con protección de conflictos- [DSH Tauri Session](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-session) — reemplaza el borrado de workspaces por archivado y agrega una página de chats archivados con búsqueda, orden, agrupado, filtro por proyecto y restauracióndiff --git a/README.md b/README.mdindex 87ca0de7..8c221c54 100644--- a/README.md+++ b/README.md@@ -62,7 +62,7 @@- [DSH Tauri](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri) — 提供与 Tauri 2 外壳的通信通道- [DSH Tauri UI](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-ui) — 为 Tauri 2 外壳提供自定义设置侧边栏- [DSH Tauri Worktree](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-worktree) — 为每个会话创建隔离的 Git Worktree,并支持检出到本地分支或归档放弃-- [DSH Tauri Panel Extension](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension) — Skills/MCP 管理与导入技能仓库+- [DSH Tauri Panel Extension](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension) — Skills/MCP 管理与导入技能仓库,内嵌插件市场面板- [DSH Tauri Panel Scheduler](https://github.com/dsh-tauri-desk/deepseek-harness-desktop/tree/main/packages/dsh-tauri-panel-scheduler) — 创建每天、间隔、工作日或每周的定时任务;在独立 Agent 会话中执行,并保留执行记录- [DSH Tauri Turn Rewind](https://github.com/dsh-tauri-desk/deepseek-harness-desktop/tree/main/packages/dsh-tauri-turnrewind) — 按 Agent 回合记录私有 Git 快照、显示文件变更卡片,并在冲突保护下撤销该回合改动- [DSH Tauri Session](https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-session) — 将删除工作区改为归档,并提供支持搜索、排序、分组、项目筛选和取消归档的「已归档聊天」设置页diff --git a/docs/UPSTREAM_SYNC.spec.md b/docs/UPSTREAM_SYNC.spec.mdindex e15a9bd5..2fd45e72 100644--- a/docs/UPSTREAM_SYNC.spec.md+++ b/docs/UPSTREAM_SYNC.spec.md@@ -156,12 +156,13 @@ git diff --check| `dsh-tauri-pet` | `QCYTSN/dsh-dafeiyu` | `source/dsh-dafeiyu` | `v0.1.9` (`f4f4482`) | `v0.1.14` (`9c0588c`) | `v0.1.10`–`v0.1.14` 待评估 | [日志](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-panel-extension` | `qinyre/dsh-plugin-capabilities` | `source/dsh-plugin-capabilities` | `v0.3.10` (`e5e3596`) | `v0.3.10` | 暂无待评估项(Market 模块确定不移植) | [日志](https://www.google.com/search?q=../packages/dsh-tauri-panel-extension/docs/upstream-sync-log.md) |+| `dsh-tauri-panel-extension` | `qinyre/dsh-plugin-capabilities` | `source/dsh-plugin-capabilities` | `v0.3.10` (`e5e3596`) | `v0.3.10` | 暂无待评估项(该上游的 Market 模块确定不移植;扩展面板的市场页改为直接消费 `dshmarket` 的 `market` 服务) | [日志](https://www.google.com/search?q=../packages/dsh-tauri-panel-extension/docs/upstream-sync-log.md) |+| `dsh-tauri-panel-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-panel-scheduler` | `MichengAI/dsh-automation` | `source/dsh-automation` | `f1bc91a` (+`c426c3d`) | `v0.1.42` (`e75499e`) | `v0.1.33`–`v0.1.42` 已评估:全部不采纳(2026-09-16);无待评估项 | [日志](https://www.google.com/search?q=../packages/dsh-tauri-panel-scheduler/docs/sync-log.md) |### 5.2 已知配置与异常记录-* **子模块绑定**:`source/*` 下 6 个参考仓库均已引入 `.gitmodules`。当前 gitlink 配置已暂存,待提交。+* **子模块绑定**:`source/*` 下 7 个参考仓库均已引入 `.gitmodules`。其中 `source/dsh-market` 是 2026-09 新增的**临时**参考仓库:上游 `render()` API 只存在于 main 分支,尚未发版,故先以源码子模块承载供 GitHub 源安装测试;上游发版后应改为 npm 依赖并移除该子模块。当前 gitlink 配置已暂存,待提交。* **路径纠偏记录**:* `source/dsh-automation` 已纠正 gitlink 配置,子模块 HEAD 指向 `f1bc91a`。* `source/dsh-automation` gitlink 为 `f1bc91a`,但工作区 checkout 停在 `e75499e`(`git submodule status` 前缀 `+`,diff --git a/packages/dsh-tauri-panel-extension/docs/upstream-sync-log.md b/packages/dsh-tauri-panel-extension/docs/upstream-sync-log.mdindex 65bf3833..b1eaed5b 100644--- a/packages/dsh-tauri-panel-extension/docs/upstream-sync-log.md+++ b/packages/dsh-tauri-panel-extension/docs/upstream-sync-log.md@@ -58,7 +58,7 @@- 侧栏扩展的路由前缀随桌面统一为 `/api/desktop/dsh-tauri-panel-extension/*`,不改为上游的 `/dsh-plugin-capabilities/*`。- MCP 管理继续写入当前扩展约定的 profile / DSH home 路径。- 不移植上游设置页的“技能与 MCP”一级标题。-- 不移植上游 Market(技能市场 / MCP 市场)模块。+- 不移植上游 Market(技能市场 / MCP 市场)模块;扩展面板新增的「市场」标签页(`src/client/components/market-tab.tsx`)不来自该上游,而是直接消费 `dshmarket` 经 `ctx.provide('market')` 发布的 `render()` 面板,详见 `docs/UPSTREAM_SYNC.spec.md` §5。- 技能仓库仍沿用侧栏扩展的精简“导入仓库”流程。- 侧栏扩展既有的 JSON / 表单双模式 MCP 编辑器保留。diff --git a/packages/dsh-tauri-panel-extension/package.json b/packages/dsh-tauri-panel-extension/package.jsonindex 4019bb6c..40a2c297 100644--- a/packages/dsh-tauri-panel-extension/package.json+++ b/packages/dsh-tauri-panel-extension/package.json@@ -2,7 +2,7 @@"name": "dsh-tauri-panel-extension","type": "module","version": "1.0.0",- "description": "Skills and MCP management in the DSH Tauri extension panel.",+ "description": "Skills, MCP, and the plugin market in the DSH Tauri extension panel.","author": "Hairyf <[email protected]>","license": "MIT","homepage": "https://github.com/dsh-tauri-desk/dsh-tauri-plugins#readme",diff --git a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsxindex 3853a477..9c623e91 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/extension-panel.tsx@@ -1,22 +1,38 @@import type { ReactElement } from 'react'+import type { MarketFace } from '../service/market.types'import { useMountStyle } from 'dsh-tauri-ui/client'import { useEffect, useId, useRef, useState } from 'react'import { EXTENSION_PANEL_STYLE_ID } from '../constants'import { locale } from '../locales'import extensionPanelStyle from './extension-panel.cssr'+import { MarketTab } from './market-tab'import { McpTab } from './mcp-tab'import { SkillsTab } from './skills-tab'export interface ExtensionPanelProps {createSkill: () => Promise<void>+ /** 市场未安装 / 未发布 `render` 时为 undefined:此时不出现市场标签页。 */+ market: MarketFace | undefined}-export function ExtensionPanel({ createSkill }: ExtensionPanelProps): ReactElement {+interface ExtensionTab {+ id: string+ label: string+ render: () => ReactElement+}++export function ExtensionPanel({ createSkill, market }: ExtensionPanelProps): ReactElement {const t = locale.textuseMountStyle(extensionPanelStyle, EXTENSION_PANEL_STYLE_ID)const tabsId = useId()const tabRefs = useRef<Array<HTMLButtonElement | null>>([])- const rows = [{ id: 'skills', label: t('skillsTab') }, { id: 'mcp', label: t('mcpTab') }]+ const marketFace = market+ const rows: ExtensionTab[] = [+ { id: 'skills', label: t('skillsTab'), render: () => <SkillsTab t={t} createSkill={createSkill} /> },+ { id: 'mcp', label: t('mcpTab'), render: () => <McpTab t={t} /> },+ ]+ if (marketFace !== undefined)+ rows.push({ id: 'market', label: t('marketTab'), render: () => <MarketTab market={marketFace} /> })const [activeId, setActiveId] = useState('skills')const [visited, setVisited] = useState<ReadonlySet<string>>(() => new Set(['skills']))useEffect(() => setVisited(previous => previous.has(activeId) ? previous : new Set([...previous, activeId])), [activeId])@@ -63,7 +79,7 @@ export function ExtensionPanel({ createSkill }: ExtensionPanelProps): ReactEleme</div>{rows.filter(row => row.id === activeId || visited.has(row.id)).map((row) => {const selected = row.id === activeId- return <div key={row.id} id={`${tabsId}-panel-${row.id}`} className="dshp-extension__tab-panel" role="tabpanel" aria-labelledby={`${tabsId}-tab-${row.id}`} hidden={!selected}>{row.id === 'skills' ? <SkillsTab t={t} createSkill={createSkill} /> : <McpTab t={t} />}</div>+ return <div key={row.id} id={`${tabsId}-panel-${row.id}`} className="dshp-extension__tab-panel" role="tabpanel" aria-labelledby={`${tabsId}-tab-${row.id}`} hidden={!selected}>{row.render()}</div>})}</div></div>diff --git a/packages/dsh-tauri-panel-extension/src/client/components/market-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/market-tab.tsxnew file mode 100644index 00000000..f347605b--- /dev/null+++ b/packages/dsh-tauri-panel-extension/src/client/components/market-tab.tsx@@ -0,0 +1,17 @@+import type { ReactElement } from 'react'+import type { MarketFace } from '../service/market.types'++export interface MarketTabProps {+ market: MarketFace+}++/**+ * 市场面板:直接渲染 `market.render()` 交出的 element。+ *+ * 市场的客户端 bundle 与宿主共用同一个 React 实例(经宿主的模块表解析 react),+ * 因此这个 element 挂在面板树的任何位置都能正常工作;它自带错误边界,弹层+ * portal 到 `document.body`,跨容器没有问题。+ */+export function MarketTab({ market }: MarketTabProps): ReactElement {+ return <>{market.render({ preferredSubsectionId: 'installed' })}</>+}diff --git a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsxindex 622b6835..bacd16f4 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/mcp-tab.tsx@@ -307,7 +307,7 @@ export function McpTab({ t }: McpTabProps): ReactElement {return (<div className="dshp-extension__section"><div className="dshp-extension__head">- <Icon as={PlugConnection} />+ <span className="dshp-extension__head-icon"><Icon as={PlugConnection} size={16} /></span><h3>{t('mcpTitle')}</h3><span className="dshp-extension__spacer" /><Button variant="ghost" size="sm" disabled={restarting} onClick={() => setRestartConfirm(true)}>{t('restart')}</Button>diff --git a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.tsindex 28ffd265..5aabd418 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts+++ b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.cssr.ts@@ -4,15 +4,6 @@ const { c, bem: { b, e } } = cssrconst { primary, secondary, tertiary, borderL2: border, business, layer1, layer3, hover } = sharedStylesexport default b('extension', [- e('head', {- display: 'flex',- alignItems: 'center',- gap: '8px',- flexWrap: 'wrap',- }, [- c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),- c('& > svg', { flex: 'none', color: tertiary }),- ]),e('list-head', {display: 'flex',alignItems: 'center',diff --git a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsxindex 334c65d8..d39dcc3f 100644--- a/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/components/skills-tab.tsx@@ -189,7 +189,7 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {return (<div className="dshp-extension__section"><div className="dshp-extension__head">- <Icon as={GraduationCap} />+ <span className="dshp-extension__head-icon"><Icon as={GraduationCap} size={16} /></span><h3>{t('skillsTitle')}</h3><span className="dshp-extension__spacer" /><Button variant="ghost" size="sm" onClick={() => void doOpen({ target: 'user-skills' })}>{t('openUserSkills')}</Button>diff --git a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts b/packages/dsh-tauri-panel-extension/src/client/constants/index.tsindex 49989b04..ce602f44 100644--- a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts+++ b/packages/dsh-tauri-panel-extension/src/client/constants/index.ts@@ -4,8 +4,9 @@ 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 = 40+export const PANEL_ACTION_ORDER = 20export const INPUT_PREFILL_ID = `${PLUGIN_ID}.skill-prefill`export const INPUT_PREFILL_ORDER = 40export const INPUT_PREFILL_PRIORITY = 0diff --git a/packages/dsh-tauri-panel-extension/src/client/locales/index.ts b/packages/dsh-tauri-panel-extension/src/client/locales/index.tsindex e41d66ce..d0dbc278 100644--- a/packages/dsh-tauri-panel-extension/src/client/locales/index.ts+++ b/packages/dsh-tauri-panel-extension/src/client/locales/index.ts@@ -2,9 +2,10 @@ import { defineLocale } from 'dsh-tauri/client'import { PLUGIN_ID } from '../constants'const zh = {- extension: '扩展技能',+ extension: '扩展管理',skillsTab: '技能',mcpTab: 'MCP',+ marketTab: '市场',skillsTitle: '技能管理',skillsIntro: '查看与编辑 dsh 发现的技能;用户级与仓库技能可就地管理。卡片开关控制技能是否加载。',newSkill: '新建技能',@@ -117,9 +118,10 @@ const zh = {type LocaleKey = keyof typeof zhconst en: Record<LocaleKey, string> = {- extension: 'Extension Skills',+ extension: 'Extension Management',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-panel-extension/src/client/register/extension-panel.tsx b/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsxindex 49338ebe..7ed81dd0 100644--- a/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsx+++ b/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsx@@ -1,14 +1,25 @@import type { ClientContext, PanelHandle } from 'dsh-tauri/client'+import type { MarketFace } from '../service/market.types'import { Icon, PanelPage, Puzzle } from 'dsh-tauri-ui/client'import { definePanel, defineRegister } from 'dsh-tauri/client'import { ExtensionPanel } from '../components/extension-panel'-import { PANEL_ACTION_ORDER, PANEL_ID } from '../constants'+import { MARKET_SERVICE_NAME, PANEL_ACTION_ORDER, PANEL_ID } from '../constants'import { locale } from '../locales'+import { readMarket } from '../service/market'import { store } from '../store'import { chooseWorkspace, sessionSnapshotOf, workspaceSnapshotOf } from './extension-panel.utils'export const extensionPanelFeature = defineRegister<ClientContext>((controller, ctx, adapter) => {let panel: PanelHandle | undefined+ let market: MarketFace | undefined++ // 面板收进本插槽后,市场自带的设置页入口就是重复入口,撤下它;+ // 服务由另一个客户端插件发布,apply 顺序不保证,所以用 inject 等它到位。+ ctx.inject([MARKET_SERVICE_NAME], () => {+ market = readMarket(ctx)+ market?.setSettingsVisible(false)+ })+ controller.add(() => market?.setSettingsVisible(true))const createSkill = async (): Promise<void> => {const id = chooseWorkspace(@@ -33,7 +44,7 @@ export const extensionPanelFeature = defineRegister<ClientContext>((controller,icon: props => <Icon as={Puzzle} size={props.size} />,render: () => (<PanelPage>- <ExtensionPanel createSkill={createSkill} />+ <ExtensionPanel createSkill={createSkill} market={readMarket(ctx)} /></PanelPage>),})diff --git a/packages/dsh-tauri-panel-extension/src/client/service/market.test.ts b/packages/dsh-tauri-panel-extension/src/client/service/market.test.tsnew file mode 100644index 00000000..5bba9006--- /dev/null+++ b/packages/dsh-tauri-panel-extension/src/client/service/market.test.ts@@ -0,0 +1,73 @@+/**+ * client/service/market.test.ts — 市场面板服务的能力判据。+ *+ * 守三条需求硬约束:**没装市场时不出现标签页**;**已发布的 1.47.0(有 `market`+ * 但没有 `render`)不能被当成可用**——收不进面板,就更不能顺手把它自带的设置页+ * 入口藏掉,否则市场会彻底没有入口;**注册表读取抛错时静默**。+ *+ * 判据都是能力探测,不是版本号。+ */++import type { ClientContext } from 'dsh-tauri/client'+import { describe, expect, it } from 'vitest'+import { 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('每次都按当前注册表读数探测:服务消失后回到不可用(不缓存旧引用)', () => {+ let service: unknown = { ...released() as object, render: () => null }+ const ctx = {+ reflect: {+ get: () => service,+ provide: () => () => {},+ },+ } as unknown as ClientContext+ expect(readMarket(ctx)).toBeDefined()+ service = undefined+ expect(readMarket(ctx)).toBeUndefined()+ })+})diff --git a/packages/dsh-tauri-panel-extension/src/client/service/market.ts b/packages/dsh-tauri-panel-extension/src/client/service/market.tsnew file mode 100644index 00000000..87da1cb9--- /dev/null+++ b/packages/dsh-tauri-panel-extension/src/client/service/market.ts@@ -0,0 +1,33 @@+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+}diff --git a/packages/dsh-tauri-panel-extension/src/client/service/market.types.ts b/packages/dsh-tauri-panel-extension/src/client/service/market.types.tsnew file mode 100644index 00000000..47d1d226--- /dev/null+++ b/packages/dsh-tauri-panel-extension/src/client/service/market.types.ts@@ -0,0 +1,19 @@+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-panel-extension/src/client/styles/index.cssr.ts b/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.tsindex d0a18bdf..965b733b 100644--- a/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts+++ b/packages/dsh-tauri-panel-extension/src/client/styles/index.cssr.ts@@ -4,9 +4,25 @@ const { c, bem: { b, e, m } } = cssrconst { primary, secondary, tertiary, borderL2: border, business, layer1, layer3, hover } = sharedStylesexport default b('extension', [- e('intro', { margin: '0', fontSize: '13px', lineHeight: '20px', color: tertiary }),+ e('intro', { margin: '0', fontSize: '12px', lineHeight: '18px', color: tertiary }),e('empty', { margin: '0', fontSize: '13px', lineHeight: '20px', color: tertiary }),e('spacer', { flex: '1' }),+ e('head', {+ display: 'flex',+ alignItems: 'center',+ gap: '10px',+ flexWrap: 'wrap',+ }, [+ c('& h3', { margin: '0', fontSize: '16px', lineHeight: '24px', fontWeight: '500' }),+ ]),+ e('head-icon', {+ display: 'inline-flex',+ alignItems: 'center',+ justifyContent: 'center',+ flex: 'none',+ width: '22px',+ height: '22px',+ }),e('search', {width: '200px',boxSizing: 'border-box',diff --git a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsx b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsxindex 4c492295..a49cb802 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsx+++ b/packages/dsh-tauri-panel-scheduler/src/client/components/scheduler-nav-icon.tsx@@ -1,5 +1,5 @@import type { ReactElement } from 'react'-import { Calendar, Icon } from 'dsh-tauri-ui/client'+import { Clock, Icon } from 'dsh-tauri-ui/client'import { useStore } from 'dsh-tauri/client'import { store } from '../store'import { countUnreadRuns } from './schedule.utils'@@ -8,7 +8,7 @@ export function SchedulerNavIcon({ size }: { size: number }): ReactElement {const state = useStore(store.scheduler)return (<>- <Icon as={Calendar} size={size} />+ <Icon as={Clock} size={size} />{countUnreadRuns(state.runs, state.readAt, state.readIds) > 0? (<span className="dshp-scheduler__nav-badge">diff --git a/source/dsh-market b/source/dsh-marketnew file mode 160000index 00000000..53f793e7--- /dev/null+++ b/source/dsh-market@@ -0,0 +1 @@+Subproject commit 53f793e775834c11a4f196940a0b9c9fcf238c1cdiff --git a/src-tauri/resources/internal-plugins.json b/src-tauri/resources/internal-plugins.jsonindex 06418947..910c676d 100644--- a/src-tauri/resources/internal-plugins.json+++ b/src-tauri/resources/internal-plugins.json@@ -38,7 +38,7 @@"id": "dsh-tauri-panel-extension","spec": "dsh-tauri-panel-extension","name": "DSH Tauri Panel Extension",- "description": "Skills and MCP management in the DeepSeek Harness desktop extension panel.",+ "description": "Skills, MCP, and the plugin market in the DeepSeek Harness desktop extension panel.","repoUrl": "https://github.com/dsh-tauri-desk/dsh-tauri-plugins/tree/main/packages/dsh-tauri-panel-extension"},{