dsh-file-explorer
其他 活跃维护

dsh-file-explorer

wendi-lok/dsh-file-explorer

提供左侧栏文件目录卡片能力,支持树形结构展开浏览、盘符切换、交互式面包屑导航与全屏模式,侧边栏状态自动同步,操作流畅贴合开发使用习惯。

2
Stars 标星
0
Forks 分支
2
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
24 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:wendi-lok/dsh-file-explorer
git clone https://github.com/wendi-lok/dsh-file-explorer.git
git clone git@github.com:wendi-lok/dsh-file-explorer.git
README.md main

dsh-file-explorer

A DeepSeek Harness Web GUI plugin that shows a file directory tree in the left workspace area.

What it adds

  • A 文件目录 / File Explorer toggle button at the bottom of the left sidebar (sidebar.footer.action).
  • A bottom-anchored card that slides up the left sidebar (non-linear easing):
    • half-height by default (just past the middle); a top bar with a full-expand button covers the whole sidebar, plus restore and close;
    • tree browsing: click a row's arrow to expand/collapse subdirectories inline, double-click a folder name to enter it, single-click a file to open it with the host OS;
    • a drive-selection page ("此电脑") — "up" from any drive root lands there, so you can switch disks;
    • a full interactive breadcrumb path chain (wheel-scrollable when it overflows), plus home / up / path editing / refresh / show-hidden / follow-session;
    • clicking the blank sidebar area above the half card collapses it;
    • the card's right edge tracks the sidebar column (ResizeObserver + direct DOM write), so dragging the sidebar handle resizes the card with it.

It is fully additive: nothing shipped is shadowed; closing the panel restores the normal session browser.

Architecture

Half File Role
Host lib/index.js Cordis plugin registering the exact route POST /plugins/file-explorer/fs: one directory level with files and directories (name-sorted, hidden-flagged) plus the {op:"drives"} drive-selection listing. The shipped host.listDirectory wire only returns directories, so this route exists.
Browser lib/client.js Hand-authored window.__ModuleLoader__.load bundle (no build step): registers the footer toggle + overlay card, renders the tree / drives page / breadcrumbs, fetches listings from the host route.

Install into a profile

  1. Make the package resolvable from the profile (Node walks $DSH_HOME/profiles/<name>/node_modules → $DSH_HOME/profiles/node_modules → …). A junction into this repo works:

    New-Item -ItemType Junction -Path "$env:DSH_HOME\profiles\node_modules\dsh-file-explorer" -Target D:\Codes\dsh-file-explorer
  2. Add a row in the profile's cordis.patch.yml:

    - insert:
       - id: file-explorer
         name: dsh-file-explorer
  3. Restart the profile (dsh web) and refresh the page. The browser bundle is picked up by the client-modules scan; subsequent edits to lib/client.js hot-reload through the HMR poll without a server restart.

Development notes

  • Client slot targets: sidebar.footer.action (list, additive) and shell.overlay (list, additive); both are root-scoped, declared by the shipped ui-sidebar / ui-layout entries.
  • The host route only accepts POST with content-type: application/json (cross-origin pages are forced into a CORS preflight the server never answers — the same fence the /api gateway relies on).