DeepSeek Harness plugin

dsh-paste-names

Paste non-image files or folders into the DSH chat composer as native @path references (with plain-name fallback) instead of the images-only error.

Jump to install

Source facts

Repository
PaoMoXML/dsh-paste-names
Latest update
Aug 21, 2026
Category
Models & Providers
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-21

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/PaoMoXML/dsh-paste-names
Plugin: dsh-paste-names
Author: PaoMoXML

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-paste-names

Paste or drop a non-image file/folder into the DSH chat → paste gives a native @path reference, drop inserts the absolute path as plain text.

在 DSH(DeepSeek Harness)Web 聊天输入框里粘贴/拖入非图片文件或文件夹时:

  • 粘贴 → 解析成 DSH 原生 @ 文件引用,替代默认的「仅支持 PNG、JPG、WebP、GIF 格式的图片」报错;
  • 拖放(拖到界面任意位置)→ 直接把绝对路径文本插入输入框。

行为

粘贴

粘贴内容结果
工作区内的文件@相对/路径/文件名(与手动 @ 选择完全等价)
工作区内的目录@目录/(目录引用,带尾斜杠)
含空格的路径@"my docs/readme.md" 引号语法
解析失败(工作区外 / 无匹配 / 超时)回退插入纯文件名
截图 / png / jpg / webp / gif不干预,走 DSH 原生图片附件流程
纯文本不干预

拖放(v1.3.0 新增)

拖入内容结果
工作区内的文件插入绝对路径文本,如 C:\repo\src\index.js
工作区内的文件夹插入绝对路径 + 尾分隔符,如 C:\repo\docs\
含空格的路径整体加引号:"C:\my docs\a.txt"
解析失败(工作区外 / 无会话)回退插入纯文件名
纯图片拖放不干预,走 DSH 原生图片附件流程

说明:浏览器拖放事件不暴露源文件的绝对路径(安全限制),插件按 basename 反查会话工作区后用「会话根 + 相对路径」拼出绝对路径,因此只对会话工作区内的条目有效。多条目以空格分隔;拖到输入框上插在光标处,拖到界面其他位置追加到末尾。

多条目粘贴时以空格分隔插入。末位是 @ 引用时不补尾随空格:保持 token 未闭合,让 DSH 原生 @ 菜单自动弹出且首选即精确匹配,一次回车即可升级为原生 chip(v1.3.0 行为)。

工作原理

插件分两半:

  • 浏览器半(lib/client.js:在 document 捕获阶段拦截输入框的 paste 事件与全局 dragenter/dragover/drop 事件(先于 DSH 自带处理),识别条目后解析:粘贴以 @ 语法插入草稿,拖放以绝对路径文本插入。会话 id 通过目标元素沿 React fiber 上溯取得。
  • 宿主半(lib/index.js:注册 GET /plugins/dsh-paste-names/resolve 深度解析路由。

路径解析分两级,多条目共享:

1. 快查:DSH 自带 remote.fileReferences @ 搜索索引(毫秒级;但索引有 10,000 条 BFS 截断,大仓库深层文件覆盖不到)。多条目并发查询; 2. 深度兜底:宿主半用 node:fs 按 basename 全量扫描会话 cwd(排除 .git / node_modules;400,000 条 / 4 秒双上限;实测约 1s / 78k 条目),弥补索引截断。批量接口(v1.3.0):全部未命中条目打包成一次请求(客户端按每批 40 条分块防 URL 超长),宿主半只扫一次。

深度扫描缓存(v1.3.0)

扫描结果以「basename → 路径」倒排索引形式按工作区根缓存:

  • 30s TTL + stale-while-revalidate:过期后请求立即返回旧索引(毫秒级),后台异步重建;只有每个根的首次请求才等待完整扫描;
  • 并发去重:同一根的并发构建只跑一次 BFS;
  • LRU 上限:最多缓存 8 个工作区根,防止多会话场景内存无界增长;
  • bucket 在构建时预排序(路径短者优先),查询为纯内存操作。

resolve 路由

GET /plugins/dsh-paste-names/resolve?session=<id>&n=<name>&d=<0|1>&n=<name>&d=<0|1>...
  → { ok: true, root: "<abs cwd>", results: [{ name, dir, matches: [{ path, kind }, ...] }, ...] }

兼容旧单条形式:name=<basename>&dir=<0|1> → { ok: true, root, matches: [...] }
免扫描取根:root=1 且不带 n= → { ok: true, root }(供拖放拼接绝对路径)
失败 → { ok: false, error: "..." }(4xx/5xx)

安装

方式一:dsh plugin add(推荐)

dsh plugin --profile web add git+https://github.com/PaoMoXML/dsh-paste-names.git

(本包的 package.json 声明了 dsh.bundle.patchdsh plugin add 会自动接线。)

方式二:手动

1. 克隆仓库到 profile 的插件目录:

``bash git clone https://github.com/PaoMoXML/dsh-paste-names.git ~/.dsh/profiles/web/plugins/dsh-paste-names ``

2. 在 ~/.dsh/profiles/web/package.jsondependencies 里加一行,然后在该目录执行 pnpm install

``json "dsh-paste-names": "link:plugins/dsh-paste-names" ``

3. 在 ~/.dsh/profiles/web/cordis.patch.yml 末尾追加:

``yaml - insert: - id: paste-names name: dsh-paste-names ``

4. 重启 dsh web 并硬刷新页面(Ctrl+Shift+R)。

已知取舍

  • 同名文件/目录取路径最短者;粘贴时末位 @ 引用会弹出原生菜单,可手动改选;
  • 扫描包含构建产物(如 target/dist/),如需排除可自行在 lib/index.jsEXCLUDED 集合中添加;
  • 深度解析每个工作区根首次扫描约 1 秒(按仓库规模浮动),此后 30s 内为毫秒级缓存命中,过期后台重建不阻塞;
  • 拖放插入的是绝对路径文本(非 @ 引用):浏览器拖放不暴露源绝对路径(安全限制),只能按 basename 反查会话工作区后拼接。

License

MIT