dsh-at-file
FSMargoo/dsh-at-fileCodex 风格的 `@file` 文件引用,输入框里直接搜索并引用工作区文件。
工作区文件树插件:多标签预览(文本/DOCX/PDF/Markdown/CSV/图片)、Markdown 内联编辑、Git 变更面板与右键文件操作(重命名/删除/复制/移动/新建)。
DSH Web GUI 的工作区文件树插件(dsh-ftree):文件浏览、多格式预览、内联编辑、Git 变更面板与完整文件操作,零核心修改、热插拔(profile bundle)。
.git / node_modules / .DS_Store 经 host raw 路由渲染), ; Tab)+ 表格渲染no-cache 字节流).dshbak.1~3webStartup 动态派生(127.0.0.1 / localhost / [::1] / 配置的 host / trustedHosts),跨站请求一律 403;监听 0.0.0.0(LAN)时退化为仅靠 CSRF token/dsh-ftree-token 颁发的 token.dshbak.1~3' → '')lib/pathguard.js):所有路径经 realpath 规范化(跟随符号链接与 NTFS junction)后再做工作区前缀校验,.. 穿越、junction 与 symlink 逃逸均无法绕过白名单;不存在的写入目标自动回溯最近存在祖先(realpathLenient)# 同步修改到 node_modules 实体拷贝(改完 lib/ 后执行)
powershell -ExecutionPolicy Bypass -File sync.ps1
# 若 package.json 有改动(名称/版本/dsh.client)
cd ..\.. && pnpm add "file:./packages/dsh-ftree"
# 重启 dsh web 生效
版本号以 package.json 为准(host 启动时读取,/dsh-ftree-meta 暴露给客户端做 stale-cache 检测)。
| 路由 | 方法 | 说明 |
|---|---|---|
/dsh-ftree-meta | GET | 版本信息 |
/dsh-ftree-token | GET | CSRF token |
/dsh-ftree-list | GET | 列目录(withMtime=1 时附修改时间) |
/dsh-ftree-read | GET | 分块读文件(text/image/pdf/docx) |
/dsh-ftree-op | POST | rename / delete / paste / open / mkdir / newfile |
/dsh-ftree-write | POST | 保存文本(带 .dshbak 备份) |
/dsh-ftree-pdf | GET | PDF 字节流 |
/dsh-ftree-raw | GET | 工作区原始字节(markdown 图片) |
/dsh-ftree-git | GET | git status(branch + 变更) |
/dsh-ftree-git-op | POST | stage / unstage / discard / diff |
MIT