DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-folder-attach

s

dsh-folder-attach

Manifest valid

Add folder references to the DeepSeek Harness web composer: host folder dialog, /folder command, and folder drag/paste resolved into @path mentions.

UI (client)hasBundlePatch

dsh-folder-attach

test license: MIT

在 DeepSeek Harness 的 Web 浏览器界面里,为对话输入框添加文件夹引用。

English · 需要 dsh >= 0.2.0-rc.2

背景

DSH 的输入框对"拖入/粘贴文件夹"有一条硬性限制:

const bridge = globalThis.__DSH_HOST_PATHS__;
if (bridge === void 0 && directory) return t("attachment.directoryDesktopOnly");
// → "只有桌面端支持添加文件夹,浏览器里请添加单个文件"

浏览器出于安全不会给出拖入文件夹的绝对路径,只有桌面端(Electron shell 注入 __DSH_HOST_PATHS__)能把 File 映射回真实路径。而 @deepseek-ai/dsh 目前没有发布桌面端:dsh web 只有 --host/--port/--no-open/--trusted-host,全量搜索也没有任何包写入该全局。

本插件不去绕过这个限制,而是换一个问题来源:不问浏览器要路径,问宿主机要。

原理

Web 界面分两半:浏览器里的 client,和你机器上的 Node host。浏览器是沙箱化的,host 不是。

DSH 已经自带一个宿主目录选择能力(dsh-host-directory-picker-auto)。在 macOS + 回环绑定时它解析成 native 后端,在宿主机上执行:

osascript -e 'choose folder' -e 'POSIX path of selectedFolder'

返回一个真实的绝对路径。插件把它接到输入框上——桌面端那条判定根本不会被触发。

拖入的文件夹则用 fileReferences/list(@ 补全菜单背后的同一个索引)按名称解析:一次调用,宿主自己的模糊索引,已排除 node_modules 等。

功能

入口行为
输入框左侧「添加文件夹」在宿主机弹出系统文件夹对话框,选中后插入 @目录/
/folder 命令同上
拖入 / 粘贴文件夹按名称在工作区内解析,插入 @目录/;同批普通文件走原有上传通道

插入的是标准 @路径 mention,与桌面端拖文件夹产生的等价:工作区内用相对形式,工作区外保留绝对形式,含空格自动加引号。

安装

从 GitHub 安装(当前可用)

dsh plugin --profile web add github:sixzjd/dsh-folder-attach

从 npm 安装(发布后)

dsh plugin --profile web add dsh-folder-attach

也可以在侧边栏 插件 → 添加插件 里填上面的地址。装完刷新浏览器页面。

从源码安装
git clone https://github.com/sixzjd/dsh-folder-attach.git
cd ~/.dsh/profiles/web        # 或你的 profile 目录
dsh plugin --profile web add ./dsh-folder-attach

卸载

dsh plugin --profile web remove dsh-folder-attach

或在插件页关闭开关。插件只在浏览器内注册一个 composer 槽位、一个斜杠命令和两个事件监听器,不写任何全局对象,卸载即无痕。

开发

npm test          # 两个回归测试
npm run check     # 语法检查 + 测试

无需构建:dsh-client-modules 把 lib/client.js 逐字节原样作为浏览器 bundle 服务,所以它按 window.__ModuleLoader__.load 格式手写。

文件作用
lib/index.js空的宿主侧 apply,让包成为 Loader 条目、从而被扫描到
lib/client.js全部行为
cordis.patch.yml该 bundle 启用时贡献的组合层
locale/{en,zh}.json插件页显示名(en.json 必须存在,否则 zh.json 不会被读取)

依赖的公开接缝

只用官方声明过的扩展点,不改写官方代码、不打 monkeypatch:

  • ctx.slots.inject("conversation.input.left", …) — 官方文档点名的 composer 扩展位
  • 该座位的标准 props:sessionId、inputActions、t
  • ctx.commandUi.register({ name: "folder", ui: { kind: "action" } })
  • ctx.remote.directoryPicker.pick() — 宿主系统对话框,返回绝对路径
  • ctx.remote.fileReferences.list(sessionId, query) — @ 菜单背后的索引查询

已知限制

  • 拖入/粘贴的文件夹只能按名称在工作区内解析。浏览器不给路径,这无法回避;解析不到时明确报错并提示改用对话框,不会猜一个路径。
  • 拖入产生的是 @目录/ 纯文本 mention,不是桌面端那种带图标的文件夹 chip——chip 需要真实路径。功能等价,外观不同。
  • 索引查询有返回上限,极端情况下同名文件夹可能不在候选里,此时按未解析处理。
  • 若 profile 把目录选择解析成 browse 后端(远程 / SSH 访问),系统对话框不可用,pick 会拒绝并提示;此时仍可用拖拽解析。
  • 插件页显示名依赖 locale/en.json 存在。

为什么它能活过 dsh 升级

兼容性闸门只校验 peerDependencies 里 @deepseek-ai/dsh* 前缀的版本,本插件不声明它,因此升级不会让 bundle 被跳过。真正的风险是上面那些接缝改名——那时表现是静默不显示,不会拖垮 DSH。

许可

MIT

Comments

Loading…

Similar plugins

dsh-path-browser

by dkjsiogu

DeepSeek Harness plugin: browse host files/folders in the Web composer and insert absolute paths

Manifest valid

★ 0

MIT

TypeScript

Aug 15, 2026

dsh plugin --profile web add dsh-path-browser

by pomelotea-yuzu

DSH chat composer file/folder picker: add files or folders to a message as readable references Browse the filesystem and attach files/folders to DSH chat messages as <file>path</file> references the m

Manifest valid

★ 0

MIT

JavaScript

Aug 15, 2026

dsh plugin --profile web add @deepseek-ai/dsh-add-files

by whyzsm

Attach files/folders in the DSH composer: clipboard paste, native picker, @-mention path search, paged Markdown conversion

Manifest valid

★ 0

MIT

JavaScript

Sep 28, 2026

dsh plugin --profile web add dsh-clipfile

by OnTheWay111

deepseek harness path completion(deepseek harness @文件名自动补齐和发现)

Tools & CapabilitiesUI & ExperienceManifest valid

★ 0

NOASSERTION

TypeScript

Sep 22, 2026

dsh plugin --profile web add @onthewayli/dsh-plugin-path-completion

by WJZ-P

Adds file and folder drag-and-drop attachments to the Web UI, with composer cards, persistent history, and workspace-backed paths.

UI & ExperienceTools & CapabilitiesManifest valid

★ 6

↓ 312/wk

MIT

JavaScript

Aug 19, 2026

dsh plugin --profile web add dsh-attachment

by Zenjibad

dsh bundle: attach any file type in the DeepSeek Harness Web UI — text-likes inline, binaries as workspace path references, rasters via the built-in pipeline

UI & ExperienceManifest valid

★ 3

MIT

JavaScript

Aug 14, 2026

dsh plugin --profile web add dsh-any-attachment