kee0012/dsh-sidebar-panel1

dsh-sidebar-panel

DSH (DeepSeek Harness) right-side panel plugin: overview (context/cost/usage), files (workspace tree + right-click reference/copy/reveal), changes (files written this session), tools (tool-call details).

包名
dsh-sidebar-panel
版本
0.2.0
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:kee0012/dsh-sidebar-panel

方式二:npm 安装(暂未发布到 npm registry,不建议使用)

dsh plugin --profile web add dsh-sidebar-panel


安装后重启 DSH,并刷新浏览器(Ctrl+Shift+R)。验证配置层生效:

## 服务端 API(同源,供客户端面板使用)

| 路由 | 说明 |
|---|---|
| `GET /dsh-sidebar-panel/api/config` | 引用模板 / 内容上限 / 计价开关 |
| `GET /dsh-sidebar-panel/api/overview?sessionId=` | 请求数、费用、运行时间、按模型用量 |
| `GET /dsh-sidebar-panel/api/files?root=&path=` | 列目录(文件+文件夹),锁定在工作区内 |
| `POST /dsh-sidebar-panel/api/file-content` | 读取文件内容(截断上限可配置) |
| `GET /dsh-sidebar-panel/api/file-raw?root=&path=` | 原始字节预览(PDF/图片,content-type 白名单) |
| `GET /dsh-sidebar-panel/api/balance` | DeepSeek 官方余额(`user/balance`,key 来自 DSH 凭据,永不下发浏览器) |
| `POST /dsh-sidebar-panel/api/reveal` | 在文件管理器中显示(win32/darwin/linux 分发) |
| `GET /dsh-sidebar-panel/api/changes?sessionId=` | 本次会话写文件类工具改动列表 |

## 配置(cordis.yml / 插件配置)

在 DSH 组合配置中给该插件加 `config` 即可(未提供时全部使用默认值):

```yaml
- id: dsh-sidebar-panel
  name: dsh-sidebar-panel
  config:
    fileBrowser:
      maxEntries: 500
      maxContentChars: 40000
      includeHidden: false
    reference:
      file: '@
'
      folder: '@
/'
    changes:
      writeTools: ['write', 'edit', 'str-replace-editor', 'patch', 'run_code']
    pricing:
      enabled: true
      currency: CNY
      offPeakStartHour: 0.5      # 北京时间 00:30 起为低谷
      offPeakEndHour: 8.5        # 08:30 止
      offPeakMultiplier: 0.5
      models:
        deepseek-chat: { inputPerM: 2, cacheHitPerM: 0.5, cacheWritePerM: 2, outputPerM: 8 }
        deepseek-reasoner: { inputPerM: 4, cacheHitPerM: 1, cacheWritePerM: 4, outputPerM: 16 }

费用为估算:按每次请求的 usage × 每百万 tokens 单价(缓存命中按低价),并按请求时刻的北京时间峰/谷时段加权。你的模型若不在表中则用 pricing.defaultModel(默认与 deepseek-chat 相同)。如需精确匹配实际账单,请按你的模型实际价格调整 pricing.models

开发与测试


## 服务端 API(同源,供客户端面板使用)

| 路由 | 说明 |
|---|---|
| `GET /dsh-sidebar-panel/api/config` | 引用模板 / 内容上限 / 计价开关 |
| `GET /dsh-sidebar-panel/api/overview?sessionId=` | 请求数、费用、运行时间、按模型用量 |
| `GET /dsh-sidebar-panel/api/files?root=&path=` | 列目录(文件+文件夹),锁定在工作区内 |
| `POST /dsh-sidebar-panel/api/file-content` | 读取文件内容(截断上限可配置) |
| `GET /dsh-sidebar-panel/api/file-raw?root=&path=` | 原始字节预览(PDF/图片,content-type 白名单) |
| `GET /dsh-sidebar-panel/api/balance` | DeepSeek 官方余额(`user/balance`,key 来自 DSH 凭据,永不下发浏览器) |
| `POST /dsh-sidebar-panel/api/reveal` | 在文件管理器中显示(win32/darwin/linux 分发) |
| `GET /dsh-sidebar-panel/api/changes?sessionId=` | 本次会话写文件类工具改动列表 |

## 配置(cordis.yml / 插件配置)

在 DSH 组合配置中给该插件加 `config` 即可(未提供时全部使用默认值):

```yaml
- id: dsh-sidebar-panel
  name: dsh-sidebar-panel
  config:
    fileBrowser:
      maxEntries: 500
      maxContentChars: 40000
      includeHidden: false
    reference:
      file: '@
'
      folder: '@
/'
    changes:
      writeTools: ['write', 'edit', 'str-replace-editor', 'patch', 'run_code']
    pricing:
      enabled: true
      currency: CNY
      offPeakStartHour: 0.5      # 北京时间 00:30 起为低谷
      offPeakEndHour: 8.5        # 08:30 止
      offPeakMultiplier: 0.5
      models:
        deepseek-chat: { inputPerM: 2, cacheHitPerM: 0.5, cacheWritePerM: 2, outputPerM: 8 }
        deepseek-reasoner: { inputPerM: 4, cacheHitPerM: 1, cacheWritePerM: 4, outputPerM: 16 }

费用为估算:按每次请求的 usage × 每百万 tokens 单价(缓存命中按低价),并按请求时刻的北京时间峰/谷时段加权。你的模型若不在表中则用 pricing.defaultModel(默认与 deepseek-chat 相同)。如需精确匹配实际账单,请按你的模型实际价格调整 pricing.models