返回目录
模型与 MCP 插件

dsh-ext-master

maxid/dsh-ext-master

Deepseek Harness 文件预览扩展名管理

Stars
0
Forks
0
Issues
0
更新
21 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:maxid/dsh-ext-master

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-ext-master

DeepSeek Harness 的文档预览扩展名管理插件。当前支持 Markdown 后缀(默认把 .mdc 当作 Markdown),配置结构按预览类型分组,后续可继续加 html、code 等预览类型。

适配 DSH >=0.2.1-rc.3 <0.3.0-0(已在 0.2.1-rc.5 与当前桌面版 0.2.1-rc.3 上验证)。不修改 app.asar,通过 DSH profile 的 bundle + client plugin 机制加载。

版本对应(tag)

本仓库的 tag 与 DeepSeek Harness 官方版本一一对应,命名沿用官方的 dsh-v<版本>:

DSH 版本 对应插件 tag 验证情况
0.2.1-rc.5(当前最新) dsh-v0.2.1-rc.5 ✅ 2026-11-02 在独立 profile 中真实启动 Web 验证:Host 注入 + Client bundle 均正常
0.2.1-rc.3(当前桌面版) dsh-v0.2.1-rc.3 ✅ 桌面版日常使用验证

package.json 的 engines.dsh 声明 >=0.2.1-rc.3 <0.3.0-0(-0 让 0.3 的预发布版本也算在边界外):这个范围内的 DSH 版本不需要换 tag;DSH 进入 0.3(含 alpha/rc)时,本插件会先发布对应版本的 tag。

按 DSH 版本安装(把 profile 名换成你的实际环境):

dsh plugin --profile desktop add "github:maxid/dsh-ext-master#dsh-v0.2.1-rc.5"

详细变更见 CHANGELOG.md。

功能

  • 内置预览只注册了 md / markdown;本插件在运行时把配置的后缀追加到对应预览定义。
  • 默认 previews.markdown: [mdc];也支持 mdx 等任意安全后缀。
  • 后缀统一小写、去掉前导 .、去重,并校验为安全字符。
  • 监听预览注册变化;即使目标预览定义晚于本插件注册也能补上。
  • 配置通过 Host 注入页面的 __DSH_DOCUMENT_PREVIEW_EXTENSIONS__ 传递。

安装

推荐用 DSH 的插件命令安装对应版本(见上方「版本对应」);下面是手动方式。

  1. 把仓库放到 profile 的插件目录:
mkdir -p ~/.dsh/profiles/desktop/plugins
git clone https://github.com/maxid/dsh-ext-master.git \
  ~/.dsh/profiles/desktop/plugins/dsh-ext-master
  1. 在 ~/.dsh/profiles/desktop/package.json 声明依赖并选择 bundle:
{
  "dependencies": {
    "dsh-ext-master": "link:./plugins/dsh-ext-master"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "dsh-ext-master"
      ]
    }
  }
}

保留你原有的 bundles,只在末尾追加 dsh-ext-master。

  1. 建立 node_modules 链接(不经过 registry):
ln -sfn ~/.dsh/profiles/desktop/plugins/dsh-ext-master \
  ~/.dsh/profiles/desktop/node_modules/dsh-ext-master
  1. 刷新 DSH 页面。若 profile 的 HMR 未开启,重启 DSH。

配置

bundle 自带默认配置:

previews:
  markdown:
    - mdc

要扩展更多后缀,在 ~/.dsh/profiles/desktop/cordis.patch.yml 追加:

- id: dsh-ext-master
  name: dsh-ext-master
  config:
    previews:
      markdown:
        - mdc
        - mdx

previews 的 key 对应预览定义 id 的最后一段(如 markdown、html)。后续新增预览类型时沿用同一结构:

previews:
  markdown: [mdc, mdx]
  html: [xhtml]

改配置后刷新页面(扩展名在页面加载时注入);仅改本插件 lib/client.js 时代码本身可被 DSH HMR 热重载。

结构

lib/index.js        Host 插件:校验配置并通过 webserver/index-inject 注入页面
lib/client.js       Client 插件:按预览类型把后缀追加到对应预览定义
cordis.patch.yml    Bundle patch:插入 dsh-ext-master 行,默认 markdown: [mdc]

说明

DSH 的浏览器插件是预构建的 lib/client.js,使用 window.__ModuleLoader__.load({ id, factory }) 协议;本仓库直接提供该产物,无构建步骤。

已知限制

  • 文件树中的 .mdc 图标可能仍显示通用图标:前端 file-kind 映射在只读 bundle 内,插件无法覆盖;预览行为不受影响。
  • 这是 profile 级扩展,不进入 DSH 安装包;DSH 升级后 profile 与插件仍然有效。
  • 更彻底的做法是上游把 mdc 加入 @deepseek-ai/dsh-client-ui-sidebar-documentpreview 的 extensions,并同步前端 file-kind 映射。

License

MIT

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。