dsh-sidebar-Explorer-Plus
Manifest valid★ 3A consumer plugin for dsh-better-sidebar: adds a new "Files" tab to the sidebar, featuring a file tree fixed within the workspace (cwd), providing true file management capabilities—upload, move, delete, rename, and create new folders. It fills in the missing "write" operations that better-sidebar's built-in Explorer lacks (Explorer is read-only).
dsh-sidebar-explorer-plus
A TypeScript / React file manager for the DeepSeek Harness sidebar.
English
Adds a Files tab to dsh-better-sidebar through its public ctx.betterSidebar.registerTab service. The plugin combines a React file tree with host-side file operations, without modifying the sidebar foundation.
Features
- Drag and drop files or folders to upload, preserving folder structure.
- Move, rename, delete, and create directories from the file tree.
- Open files in the sidebar editor.
- Reject existing destinations when moving or renaming. Uploads can replace existing files; deletion is permanent and asks for confirmation in the UI.
- Host/origin request checks, upload-size limits, and working-directory path checks in the host API.
Install
Requires a running DSH web profile, dsh-better-sidebar (peer dependency >=0.4.0), and Node.js 20 or newer.
dsh plugin --profile web add github:Wulabalabo/dsh-sidebar-Explorer-Plus
Restart dsh web, then hard-refresh the browser. Open the sidebar + menu and select Files / 文件. The repository includes built files in lib/, so Git-based installation does not require a local build.
Code and API map
| Part | Responsibility |
|---|---|
src/index.ts | Host routes, request checks, upload limits, file operations, and structured errors. |
src/client/index.tsx | React file tree, drag and drop, context menus, and tab registration. |
build.mjs | Host/client bundling; the build script also generates TypeScript declarations. |
cordis.patch.yml | Plugin mounting configuration. |
All operations use POST /sidebar-explorer/<operation>:
| Operation | Payload |
|---|---|
upload | Query: sessionId, name, optional dir and cwd; raw bytes in the body. |
delete / mkdir | JSON: sessionId, absolute path, optional cwd. |
move | JSON: sessionId, absolute from and to, optional cwd. |
rename | JSON: sessionId, absolute path, new name, optional cwd. |
Successful operations return { ok: true, value }. Operation errors return { ok: false, error: { code, message } }; rejected trust checks and unsupported HTTP methods return plain HTTP 403/405 responses.
Development
npm ci
npm run typecheck
npm run build
The default upload limit is 50 MiB per file. Set uploadLimit in the profile config to change the byte limit; see the configuration example below.
Troubleshooting and operating scope
- Tab missing: confirm the sidebar dependency is installed, restart the host, and hard-refresh the browser.
- HTTP 403: check the configured trusted host and the browser origin.
- HTTP 409 on move/rename: choose a destination that does not already exist.
- Upload too large: reduce the file size or adjust
uploadLimit.
The current path checks compare path strings; they do not resolve symlinks or fully canonicalize traversal segments in every operation. Working-directory selection also has client/process fallbacks. Run this in a trusted workspace; these checks do not establish isolation for untrusted filesystem content or callers.
中文
一个 dsh-better-sidebar 的消费插件:在侧边栏新增一个「文件」tab,内置一棵固定在工作区(cwd)内的文件树,提供真正的文件管理能力——上传、移动、删除、重命名、新建文件夹。它补充了 better-sidebar 自带 Explorer 缺失的「写」操作(Explorer 只读)。
它通过 dsh-better-sidebar 公开的 ctx.betterSidebar.registerTab 服务注册,是一个独立插件,不改动 better-sidebar 源码。
功能
- 🗂️ 拖拽任意文件(文本 / 图片 / PDF / 二进制…)上传,上传到指定目录
- 📁 拖拽整个文件夹上传,按原目录结构落盘
- 📂 文件树展示文件与文件夹;点文件在侧边栏编辑器打开
- ↕️ 拖拽移动:把文件/文件夹拖到另一个文件夹上移动(冲突报错跳过,不覆盖)
- ✏️ 重命名:右键 → 重命名
- 🗑️ 删除:右键 → 删除(永久删除 + 二次确认;文件夹递归删除)
- ➕ 新建文件夹:在选中目录下建子目录
- 🔒 Host/Origin 请求检查、上传大小限制及工作目录路径检查;当前实现使用路径字符串比较,不保证符号链接或所有路径穿越场景的隔离,请用于可信工作区。
安装
前置:已安装
dsh-better-sidebar(本插件通过其betterSidebar服务注册 tab)。
dsh plugin --profile web add github:Wulabalabo/dsh-sidebar-Explorer-Plus
装完重启 dsh web(本插件含 host 半),再浏览器硬刷新(Cmd/Ctrl+Shift+R),侧边栏 + 菜单里就会出现「文件」tab。
工作原理
| 半边 | 作用 |
|---|---|
host(src/index.ts → lib/index.js) | 注册 /sidebar-explorer/* 路由:upload(原始字节)/ delete / move / rename / mkdir(JSON),全部限定在会话 cwd 内 |
client(src/client/index.tsx → lib/client.js) | ctx.betterSidebar.registerTab 注册 sidebar-explorer tab,渲染文件树 + 拖拽区 + 右键菜单 |
路由契约:POST /sidebar-explorer/<op>;upload 用 query(sessionId/dir/name)+ 原始 body,其余用 JSON body(sessionId/path/from/to/name),均可携带可选 cwd。成功响应为 { ok: true, value },操作错误为 { ok: false, error: { code, message } };请求信任检查失败或 HTTP 方法不支持时直接返回 403/405。
开发 / 构建
npm install # 安装 devDependencies
npm run typecheck # tsc --noEmit
npm run build # esbuild 打包 + 生成 lib/types/*.d.ts
lib/是构建产物,已提交进仓库,因此从 git 安装无需任何构建步骤。- 客户端 bundle 走
window.__ModuleLoader__.load({ id: 'dsh-sidebar-explorer-plus', factory })注册,react作为 external 由模块表运行时解析。
配置(可选)
在 profile 的挂载行加 config 可调上传大小上限(默认 50 MB):
- insert:
- id: sidebar-explorer
name: 'dsh-sidebar-explorer-plus'
config:
uploadLimit: 104857600 # 100 MB
License
MIT
Comments
Loading…
Similar plugins
by luis1232023
增强dsh左侧工作区区侧栏——每个工作区文件夹下提供 任务/文件/Git 子 Tab,含文件树与右侧预览、Git 的 Changes/Graph 双视图、搜索、视图切换与添加工作区,界面样式对齐默认插件。
★ 3
MIT
JavaScript
Aug 26, 2026
dsh plugin --profile web add dsh-workspace-enhanceby wannanbigpig
一个为 DeepSeek Harness 最新源码补齐工程能力的外置插件(Bundle),无需修改宿主源码。插件直接融合进宿主原生 Right Sidebar、文件资源标签和底部 Dock:复用宿主已有的文件树、标签页、拆分/悬浮布局,只补充可编辑高亮、Git Review/提交、Worktree 和交互式 PTY。所有项目操作以当前 Session 的 cwd 为边界
★ 0
MIT
JavaScript
Sep 12, 2026
dsh plugin --profile web add @wannanbigpig/dsh-sidebarby taxueseek
DeepSeek Harness 插件:原生上传管线上的文件夹按钮 + read_document 文档解析(PDF/DOCX/XLSX)。The folder button on the native upload pipeline, plus the read_document parser.
★ 38
MIT
TypeScript
Sep 5, 2026
dsh plugin --profile web add dsh-filesA file-view enhancement plugin that extends the official DSH sidebar, providing source view, in-place editing, line number display, search, and font zoom.
★ 0
dsh plugin --profile web add dsh-sidebar-plusby Fallen0543
DeepSeek Harness 侧边栏文件树插件:会话/文件标签栏 + 懒加载文件树,按扩展名彩色图标、复制路径、发送给 Agent。A sidebar file tree plugin for DeepSeek Harness: Sessions/Files tabs, lazy tree, per-extension icons, copy-path and send-to-agent.
★ 3
↓ 106/wk
TypeScript
Aug 15, 2026
dsh plugin --profile web add dsh-sidebar-filesby drscrewdriver
DSH 侧边栏插件:把 Qoder Canvas `*.canvas.tsx` 静态解析为结构化报告页,在 dsh-better-sidebar 右侧栏渲染(文件查看器接管 + 页签)。纯静态管线,不执行源码。附 writing-qoder-canvas skill。| Render Qoder Canvas `.canvas.tsx` reports in the DSH right sidebar. Static parse only — no code execution.
★ 0
TypeScript
Sep 17, 2026
dsh plugin --profile web add dsh-canvas-tsx-sidebar