dshplugin.devDeepSeek Harness Plugins
suanlayu-dsh-plugins plugin logo
DeepSeek Harness Plugin

suanlayu-dsh-plugins

0
Published by suanlayu666

Self-made DeepSeek Harness plugins (MIT)

Developer Toolsdeepseek-harnessdeepseek-harness-plugindeepseek-harness-pluginsdsh

Get this plugin

Review the source, then continue to the publisher.

Get this plugin
Share on X ↗

About this plugin

Source snapshot 8/17/2026

suanlayu-dsh-plugins

我的 DeepSeek Harness(dsh) 自研插件合集。

这些插件最初是我自己用的(边学边写的作品)。如果它们对你有用,欢迎拿去使用; 觉得不错可以点个 Star,遇到问题提 Issue,有改进想法欢迎发 PR。 插件以 MIT 许可证开源,自担风险、无任何担保。


📦 插件列表

插件一句话说明状态
dsh-file-upload给网页聊天框加上传文件能力:📎 按钮 + 拖拽 + 附件卡片,文本/PDF/DOCX/XLSX 自动解析✅ 可用

🚀 使用教程

前置条件

  • Node.js 20+(推荐 22 LTS)
  • pnpm(DSH 的插件管理依赖它):npm install -g pnpm
  • DSH 本体:npm install -g @deepseek-ai/dsh

安装插件

# 1) 下载本仓库
git clone https://github.com/suanlayu666/suanlayu-dsh-plugins.git
#    或:GitHub 页面 Code → Download ZIP 后解压

# 2) 安装进 web profile
dsh plugin --profile web add file:D:\你的目录\suanlayu-dsh-plugins\plugins\dsh-file-upload

# 3) 重启 dsh web(若已有实例在运行,先关掉再启动)
dsh web

⚠️ Windows 注意:安装路径不能含空格(如 D:\My Plugins\... 会失败)。 路径含空格时,先把 plugins\dsh-file-upload 复制到一个无空格目录再安装。

使用(以 dsh-file-upload 为例)

  1. 网页输入框工具栏里(权限切换控件右侧)会出现一个 📎 按钮
  2. 点它选择文件(可多选),或直接把文件拖进页面
  3. 文件变成输入框上方的附件卡片(可点 × 单独移除)
  4. 正常输入你的问题,点发送——文件路径会自动随消息交给 agent,agent 自行读取分析

也可以通过 HTTP 接口直传(脚本/自动化场景):

curl -X POST --data-binary "@report.pdf" "http://127.0.0.1:3080/file-upload?name=report.pdf"
# 返回: {"ok":true,"name":"report.pdf","path":"...","size":...,"text":"提取的文本...","truncated":false}

配置(可选)

在 profile 的补丁层(~/.dsh/profiles/web/cordis.patch.yml)覆盖默认值 (注意:补丁的 config 是整体替换,三个键都要写全):

- id: file-upload
  config:
    route: /file-upload        # HTTP 路由
    root: D:/my-uploads        # 文件落盘目录(默认: 启动目录/uploads)
    maxBytes: 10485760         # 单文件大小上限(默认 10 MiB)

📖 dsh-file-upload 详情

能力说明
支持的解析文本类约 40 种扩展名(txt/md/json/yaml/csv/各类代码)自动提取全文;PDF/DOCX/XLSX 经可选依赖解析
长文本处理提取内容超过 4000 字时,写入 <原文件>.extracted.txt 侧车文件,消息中只给路径
图片仅落盘保存(当前模型无图像输入),不 OCR
安全大小上限、文件名清洗(防路径穿越)、仅本地 127.0.0.1

⚠️ 说明与限制

  • 个人自用项目:仅在作者本机(Windows + dsh 0.1.0-rc.6 的 web profile)测试过,欢迎报告其他环境的兼容性问题
  • DSH 处于 RC 阶段:上游接口可能变化导致插件失效,我会随缘维护,也欢迎 PR
  • 附件以"路径 + 解析文本"的形式通过消息交给 agent,并非 dsh 原生附件协议
  • 无任何质量保证(MIT, "AS IS")

🛠 开发者文档

想自己写 dsh 插件、或为本仓库贡献代码?完整开发规范见 docs/DEVELOPMENT.md

suanlayu-dsh-plugins/
├─ pnpm-workspace.yaml          # 声明 plugins/* 都是包
├─ docs/DEVELOPMENT.md          # 开发规范全文(六条规范/模板/踩坑史)
├─ rebuild-file-upload.cmd      # 一键:构建 → 暂存 → 重装
└─ plugins/...                  # 插件

改代码后:Windows 下运行 rebuild-file-upload.cmd 一键重建+重装; 宿主代码需重启 dsh web,客户端代码刷新页面即可。

🙏 致谢

  • deepseek-ai/deepseek-harness:DSH 本体与插件体系(MIT)

📄 License

MIT © 2026 suanlayu666 and contributors