lak321/dsh-filetree

Plugin插件 Native原生 ⭐ 2 MIT Dev Workflow开发与代码工作流

DSH(DeepSeek Harness)集成:终端 + VSCode 工作流(运行/调试/测试)

Project Overview项目介绍

dsh-filetree is a native plugin built exclusively for DeepSeek Harness, designed to add missing file tree browsing and in-browser editing capabilities to DSH’s default web interface. It adds a dedicated “Files” tab to DSH’s conversation view that displays the full directory tree of the currently active workspace, and automatically updates the tree when you switch workspaces. The plugin supports opening and viewing any file from the tree directly in DSH, and ships with a VSCode-style code editor that lets users edit and save changes directly to disk. The editor includes C/C++ syntax highlighting, line numbers, automatic indentation, a status bar, and a dark theme matching VSCode’s Dark+ scheme.

To install the plugin, you can run a single DSH CLI command pointing to the GitHub repository, since the built plugin assets are already committed to the repo so no extra build step is required. If you cloned the repo locally, you can also install it directly from the local directory by running the DSH CLI install command from within the repo root. After installation completes, you have to restart your DSH web instance, then open DSH in your browser to see the new “Files” tab at the top of the conversation view. The typical workflow starts with navigating to the Files tab, expanding folders to locate your target file, clicking it to open in-editor before saving changes.

The plugin is split into two parts: the host backend running on Node.js, and the client UI running in the browser. The backend uses DSH’s native context to register an HTTP endpoint for handling file system operations like listing directories, reading, and writing files. The client UI is implemented in pure JavaScript with no third-party dependencies, and injects the new Files tab into DSH’s existing conversation view slot. The plugin is released under the permissive open-source MIT license, and is currently only compatible with DSH’s web profile, with no official support for other DSH run modes at this time.

这是一款专为 DeepSeek Harness 开发的原生插件,用于给 DSH Web 界面补齐原生缺失的工程文件浏览与编辑能力。本插件会在会话视图新增「文件」页签,显示当前工作区(工程)的完整目录树,支持点击查看任意文件,并提供 VSCode 风格的代码编辑保存功能。核心功能包括可展开折叠的完整目录树、C/C++ 语法高亮、行号栏、缩进支持、状态栏和深色主题。

本插件采用标准 DSH 插件包结构,分为后端服务和前端 UI 两部分,支持两种安装方式:可以通过一条 DSH 命令从 GitHub 仓库安装,无需额外构建,也可以从本地目录直接安装。安装完成后只需要重启 DSH,就能在浏览器打开的会话视图顶部看到新增的「文件」页签。它面向需要直接在 DSH Web 界面快速浏览编辑工程文件,不想频繁切换外部编辑器的用户。

后端依托 DSH 原生 API 注册路由,处理目录枚举、文件读写等文件系统操作,前端编辑器由纯 JavaScript 实现,无额外第三方依赖。本插件以 MIT 许可证开源,允许自由使用、修改和分发,目前仅针对 DSH Web 版提供支持,不支持 DSH 的其他运行模式。仓库中还记录了开发时遇到的常见坑点,供参考学习二次开发的相关注意事项。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

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 仅为历史参考)。

使用

  1. 打开 DSH Web 界面,进入任意会话
  2. 点顶部 "文件" 页签(在 对话 / 轨迹 之后)
  3. 左侧为当前工程目录树(顶部显示工程名,来自当前工作区 cwd)
  4. 点 ▸ 展开文件夹,点文件在右侧打开
  5. 编辑 → 保存(顶栏按钮,未保存显示 ●);关闭 收起编辑器

工作原理

  • 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。

← 上一个 Prev dsh-im-bridge 下一个 Next dsh-dungeon-party →