Skip to content

Repository files navigation

DSH 插件存储仓库

DeepSeek Harness 本地插件集合。本仓库用于统一管理和分发 DSH 的自定义插件,后续新增插件均追加至此仓库。

快速安装

安装单个插件

# 只装 OSS 文件浏览器
curl -fsSL https://raw.githubusercontent.com/chensl139-ok/dsh-plugins/main/install.sh | bash -s -- dsh-tool-oss

# 只装归档面板
curl -fsSL https://raw.githubusercontent.com/chensl139-ok/dsh-plugins/main/install.sh | bash -s -- dsh-ui-archived-local

安装多个插件

curl -fsSL https://raw.githubusercontent.com/chensl139-ok/dsh-plugins/main/install.sh | bash -s -- dsh-tool-oss dsh-ui-archived-local

交互式选择

curl -fsSL https://raw.githubusercontent.com/chensl139-ok/dsh-plugins/main/install.sh | bash

会列出所有可用插件,输入数字选择(支持多选,0 全选)。

指定 profile

curl -fsSL https://raw.githubusercontent.com/chensl139-ok/dsh-plugins/main/install.sh | bash -s -- --profile my-profile dsh-tool-oss

安装后配置

如果安装了 dsh-tool-oss,在 ~/.zshrc 中设置环境变量:

export SILICON_OSS_AK='你的AccessKey'
export SILICON_OSS_SK='你的SecretKey'
export SILICON_OSS_ENDPOINT='https://s3.6scloud.com'
export SILICON_OSS_REGION='cn-east-1'
export SILICON_OSS_BUCKET='你的bucket名'

然后:

source ~/.zshrc
pnpm dsh web

刷新浏览器即可使用。dsh-ui-archived-local 无需额外配置。

安装脚本自动完成:克隆仓库 → 复制选中插件 → 添加依赖 → pnpm install → 配置 cordis.patch.yml。未选中的插件不会被安装。

包含的插件

插件 版本 说明
dsh-tool-oss v0.2.0 OSS 对象存储文件浏览器,支持多 Bucket、文件/文件夹上传、递归删除,对接硅基流动 / 腾讯云 COS / 阿里云 OSS 等任意 S3 兼容存储
dsh-ui-archived-local v0.1.0 归档面板插件,侧边栏「已归档」面板,支持查看/打开/取消归档/永久删除,自定义居中确认弹窗替代 window.confirm

dsh-tool-oss

OSS 对象存储文件浏览器。

零外部依赖 — 仅用 Node.js 内置 crypto(AWS SigV4 签名)和全局 fetch,不安装任何 SDK。

功能一览

功能 说明
📁 文件浏览 居中面板,支持目录层级导航(面包屑 + 子目录点击进入)
📤 文件上传 单文件 / 多文件,任意格式(文本、图片、二进制)
📁 文件夹上传 递归上传整个文件夹,保留完整目录结构(含文件夹名)
📝 文本上传 直接输入 key + 文本内容上传
👁 文件查看 点击文件名内联查看内容
🗑 文件删除 单个文件删除,居中确认弹窗
🗑 文件夹删除 递归删除整个文件夹及其下所有对象
🔔 居中弹窗 所有确认 / 错误提示均为自定义居中 ModalDialog(非原生 window.confirm
🪣 多 Bucket 同时配置多个 Bucket,UI 顶部一键切换
🔐 环境变量 凭证全部从 ~/.zshrc 环境变量读取,composition 文件零密钥

包结构

local-plugins/
├── dsh-tool-oss/              # OSS 主插件(Host + Client 双面粉)
│   ├── index.js               # Host: oss 模型工具 + /oss RPC 通道
│   ├── client.js              # Client: 文件浏览面板 + 上传对话框
│   └── package.json           # dsh.client 声明
└── dsh-ui-archived-local/     # 归档面板覆盖插件
    ├── index.js               # Host: 空 apply 占位
    ├── client.js              # Client: 自定义居中确认弹窗替代 window.confirm
    └── package.json

安装

1. 放置插件文件

local-plugins/ 目录放到 DSH profile 下:

~/.dsh/profiles/web/local-plugins/

2. 添加依赖

编辑 ~/.dsh/profiles/web/package.json,在 dependencies 中加入:

"dsh-tool-oss": "link:./local-plugins/dsh-tool-oss",
"dsh-ui-archived-local": "link:./local-plugins/dsh-ui-archived-local"

然后安装:

cd ~/.dsh/profiles/web && pnpm install

3. 配置环境变量

~/.zshrc 中添加(以硅基流动两个 Bucket 为例):

# 共用配置(同账号)
export SILICON_OSS_AK='你的AccessKey'
export SILICON_OSS_SK='你的SecretKey'
export SILICON_OSS_ENDPOINT='https://s3.6scloud.com'
export SILICON_OSS_REGION='cn-east-1'

# Bucket 1
export SILICON_OSS_BUCKET='silicon'
# Bucket 2
export SILICON_OSS_BUCKET_2='model'
source ~/.zshrc

4. 配置 composition

编辑 ~/.dsh/profiles/web/cordis.patch.yml

- insert:
    - id: tool-oss
      name: dsh-tool-oss
      config:
        timeoutMs: 60000
        providers:
          silicon:
            endpointEnv: SILICON_OSS_ENDPOINT
            regionEnv: SILICON_OSS_REGION
            bucketEnv: SILICON_OSS_BUCKET
            accessKeyIdEnv: SILICON_OSS_AK
            secretAccessKeyEnv: SILICON_OSS_SK
          model:
            endpointEnv: SILICON_OSS_ENDPOINT
            regionEnv: SILICON_OSS_REGION
            bucketEnv: SILICON_OSS_BUCKET_2
            accessKeyIdEnv: SILICON_OSS_AK
            secretAccessKeyEnv: SILICON_OSS_SK
          # 腾讯云 COS
          # tencent:
          #   endpointEnv: TENCENT_COS_ENDPOINT
          #   regionEnv: TENCENT_COS_REGION
          #   bucketEnv: TENCENT_COS_BUCKET
          #   accessKeyIdEnv: TENCENT_COS_AK
          #   secretAccessKeyEnv: TENCENT_COS_SK

# 归档面板覆盖(可选)
- id: ui-archived
  disabled: true
- insert:
    - id: ui-archived-local
      name: dsh-ui-archived-local

5. 重启 DSH

pnpm dsh web

刷新浏览器后,左下角出现 ☁ OSS 按钮。

使用

  1. 点击左下角 ☁ OSS → 居中弹出文件浏览面板
  2. 顶部 Bucket: 按钮切换不同桶
  3. 面包屑导航目录层级,📁 文件夹可点击进入
  4. 点击 📤 上传 → 居中弹出上传对话框
    • 文件 / 文件夹 Tab:选择文件或文件夹上传
    • 文本 Tab:输入 key + 内容上传
  5. 文件右侧 🗑 删除单个对象,文件夹右侧 🗑 递归删除整个文件夹

对接其他云厂商

所有 S3 兼容存储都可对接,只需设置对应的环境变量:

云厂商 Endpoint 示例
硅基流动 https://s3.6scloud.com
腾讯云 COS https://cos.ap-guangzhou.myqcloud.com
阿里云 OSS https://oss-cn-hangzhou.aliyuncs.com
AWS S3 https://s3.us-east-1.amazonaws.com
MinIO http://localhost:9000

技术细节

  • 签名:AWS Signature V4,纯 node:crypto 实现
  • 传输:Host 端 fetch + S3 REST API;Client 端 connection.rpc.call → Host
  • 二进制安全:文件以 base64 编码传输,Host 端 Buffer.from(content, 'base64') 解码后 PUT
  • 文件夹删除:S3 服务强制 delimiter=/,采用递归方式逐层删除(先删文件,再递归子目录)
  • 生命周期:所有 RPC 通道和 Tool 注册均 fiber-scoped,插件卸载时自动清理

dsh-ui-archived-local

侧边栏「已归档」面板插件。在 DSH 侧边栏提供归档会话列表,支持查看、打开、取消归档和永久删除。将原 shipped ui-archivedwindow.confirm / window.alert 替换为自定义居中 ModalDialog

功能

  • 显示已归档会话的标题、工作区和相对时间
  • 点击会话即可重新打开
  • Host 支持 unarchiveSession 时可以取消归档
  • Host 支持 deleteSession 时可以永久删除(删除前居中确认弹窗)
  • Host 尚未安装补丁时自动隐藏对应操作按钮,查看和打开功能不受影响
  • 所有确认/错误弹窗均为自定义居中 ModalDialog(非原生 window.confirm

Host 补丁(可选)

patches/ 目录包含为 DSH 源码添加 unarchiveSessiondeleteSession 的可选补丁:

patches/
├── unarchiveSession.diff          # 为 workspaces 服务添加 unarchiveSession 方法
├── unarchiveSession.tests.diff    # 对应测试
├── deleteSession.diff             # 为 workspaces 服务添加 deleteSession 方法
├── deleteSession.tests.diff       # 对应测试
└── README.md                      # 补丁说明和应用步骤

不安装补丁时面板自动降级为查看 + 打开模式。

安装

cordis.patch.yml 中禁用 shipped ui-archived 并挂载本地版:

- id: ui-archived
  disabled: true

- insert:
    - id: ui-archived-local
      name: dsh-ui-archived-local

License

MIT

About

DSH 插件存储仓库 — DeepSeek Harness 本地插件集合。当前包含:dsh-tool-oss(OSS 对象存储文件浏览器)+ dsh-ui-archived-local(归档面板居中弹窗)。后续新插件均追加至此仓库。一键安装:curl -fsSL https://raw.githubusercontent.com/chensl139-ok/dsh-plugins/main/install.sh | bash

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages