lak321/dsh-filetree
DSH(DeepSeek Harness)集成:终端 + VSCode 工作流(运行/调试/测试)
项目介绍Project Overview
DSH File Tree 是面向 DeepSeek Harness Web 界面的工程文件浏览器插件。它在会话视图新增"文件"页签,提供工程目录树浏览、文件查看以及 VSCode 风格的代码编辑与保存功能(含 C/C++ 语法高亮、行号、Tab 缩进和状态栏),目录根随当前工作区自动切换。安装时执行 dsh plugin --profile web add 一条命令即可,重启 DSH 后可用。注意:编辑器基于 textarea 叠加实现,暂不支持多光标、撤销栈与高级补全,大文件编辑性能有限。
DSH File Tree is a plugin that adds a project file browser to the DeepSeek Harness Web interface. It introduces a "Files" tab in the conversation view, providing a full directory tree, file viewing, and a VSCode-style editor with C/C++ syntax highlighting, line numbers, tab indentation, and a status bar; the root directory follows the current workspace. Install with a single dsh plugin --profile web add command, then restart DSH. Note: the editor is built on a textarea overlay, so it lacks multi-cursor, undo history, and advanced completion, and may struggle with large files.
请帮我了解并安装插件:【dsh-filetree】【https://github.com/lak321/dsh-filetree】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add github:lak321/dsh-filetree
把 lak321/dsh-filetree 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
DSH File Tree — DeepSeek Harness 工程文件浏览器
给 DeepSeek Harness Web 界面增加工程查看 / 打开 / 编辑能力的插件组合。
DSH 官方界面没有文件浏览器,本插件补齐:在会话视图新增 "文件" 页签,显示当前工作区(工程)的完整目录树,点击文件即可查看,并支持 VSCode 风格的代码编辑与保存。
功能
- 📁 工程查看:完整目录树,展开/折叠所有子文件夹,跟随当前工作区(切换工程自动切换)
- 📖 打开文件:点击任意文件查看内容
- ✏️ 编辑保存:直接修改并保存到磁盘
- 🎨 VSCode 风格编辑器:
- C/C++ 语法高亮(关键词/字符串/注释/数字/预处理器,Dark+ 配色)
- 行号栏(随滚动联动)
- Tab 键缩进(4 空格)+ 回车自动缩进
- 状态栏(文件类型 / UTF-8 / 光标行列)
- 深色主题,透明滚动条
组成
Bundle 形态(标准 DSH 插件包,包根 = 仓库根):
| 端 | 位置 | 作用 |
|---|---|---|
| Host(Node half) | host/lib/index.js(main / exports["."]) |
注册 POST /api/filetree HTTP 路由(list/read/write,基于 fs 服务) |
| Client(UI half) | client/lib/client.js(exports["./client"] + dsh.client.platform) |
会话视图"文件"页签:目录树 + VSCode 风格编辑器 |
组合层:根 cordis.patch.yml(dsh.bundle.patch 指向),挂载 host half;client half 由 exports["./client"] 自动进 __DSH_BOOT__。
安装
一条命令(git 源,产物已入库,无需构建):
dsh plugin --profile web add "github:lak321/dsh-filetree#<commit>&path:/"
<commit>换成最新提交号(见仓库主页)。path:/指向仓库根(本 bundle 包根 = 仓库根)。
或本地目录(包目录内执行):
cd dsh-filetree && dsh plugin --profile web add .
装完重启 DSH(npx -y @deepseek-ai/dsh web),浏览器打开后会话视图顶部出现 "文件" 页签。
旧的手动复制
host/+client/并注入cordis.patch.yml的方式已废弃,由 bundle 层栈安装替代(见install/cordis.patch.example.yml仅为历史参考)。
使用
- 打开 DSH Web 界面,进入任意会话
- 点顶部 "文件" 页签(在 对话 / 轨迹 之后)
- 左侧为当前工程目录树(顶部显示工程名,来自当前工作区 cwd)
- 点 ▸ 展开文件夹,点文件在右侧打开
- 编辑 → 保存(顶栏按钮,未保存显示 ●);关闭 收起编辑器
工作原理
- Host:
dsh-filetree在 apply 时通过ctx.get('webServer').register()注册/api/filetree路由,处理器用ctx.get('fs')执行目录列举 / 读文件 / 写文件。fs.resolve()支持相对路径(工作区根)和绝对路径(如会话 cwd)。 - Client:
dsh-client-ui-filetree通过ctx.slots.inject("conversation.view")注册files页签(id: "files", order: 20, label: "文件")。组件从props.useSession读取会话cwd作为文件树根目录,用浏览器fetch调/api/filetree。编辑器为纯 JS 实现(textarea 叠加语法高亮层 + 行号),无第三方依赖。
开发要点(踩坑记录)
- single slot shadow 需更低 priority:若替换
sidebar.workspaces这类 single slot,必须用priority: -1,否则 loader 报 "already has a registration at priority 0"。 - client 插件必须导出
exports.inject(依赖列表,如["slots"]),否则ctx.slots不可用。 - client.js 是
window.__ModuleLoader__.load({ id, factory })格式,factory 内用require("react"),导出exports.apply/exports.inject。
License
MIT
插件发布
WhaleHub 插件市场提交规范(标准 bundle 整改 + Issue 表单/PR 流程)见
docs/whalehub-submission.md。
nexu-io/open-design
ruvnet/ruflo
amruthpillai/reactive-resume
esengine/DeepSeek-Reasonix
volcengine/OpenViking
Molunerfinn/PicGo
titanwings/colleague-skill
nocobase/nocobase