DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

PaoMoXML /

PaoMoXML/dsh-paste-names

Verified

dsh将非图片文件或文件夹以原生 @path 引用粘贴进聊天输入框,替代仅支持图片的报错。

★ 1 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@03d5ee19

dsh-paste-names

Paste a non-image file or folder into the DSH chat composer → get a native @path reference instead of the "PNG/JPG/WebP/GIF only" error.

在 DSH(DeepSeek Harness)Web 聊天输入框里粘贴非图片文件或文件夹时,本插件会把它解析成 DSH 原生 @ 文件引用,替代默认的「仅支持 PNG、JPG、WebP、GIF 格式的图片」报错。

行为

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

多条目粘贴时以空格分隔逐个插入。同名候选取路径最短者(与 @ 菜单首选一致)。

工作原理

插件分两半:

  • 浏览器半(lib/client.js):在 document 捕获阶段拦截输入框的 paste 事件(先于 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 条目),弥补索引截断。

安装

方式一:dsh plugin add(推荐)

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

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

方式二:手动

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

    git clone https://github.com/PaoMoXML/dsh-paste-names.git ~/.dsh/profiles/web/plugins/dsh-paste-names
    
  2. 在 ~/.dsh/profiles/web/package.json 的 dependencies 里加一行,然后在该目录执行 pnpm install:

    "dsh-paste-names": "link:plugins/dsh-paste-names"
    
  3. 在 ~/.dsh/profiles/web/cordis.patch.yml 末尾追加:

    - insert:
        - id: paste-names
          name: dsh-paste-names
    
  4. 重启 dsh web 并硬刷新页面(Ctrl+Shift+R)。

已知取舍

  • 同名文件/目录取路径最短者,不弹选择菜单;
  • 扫描包含构建产物(如 target/、dist/),如需排除可自行在 lib/index.js 的 EXCLUDED 集合中添加;
  • 深度解析首扫约 1 秒(按仓库规模浮动),索引内条目毫秒级。

License

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit 03d5ee190212

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout