UI Enhancements
dsh-web-ui
zunyan/dsh-web-ui · ★ 0
DSH Web UI plugin — one focused surface: a Codex-style right-docked file panel for the harness web profile. File tree on the left, read-only preview on the right, opened from a…
Manifest details
安装
dsh plugin --profile web add github:zunyan/dsh-web-uiGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
Table of contents
DSH Web UI plugin — one focused surface: a Codex-style right-docked file panel for the harness web profile. File tree on the left, read-only preview on the right, opened from a sidebar footer icon.
Surface
- Toggle — sidebar footer icon button (visible when the sidebar is open). Active state mirrors the panel's open/close.
- Panel — right-docked drawer, 420px wide. Slides in from the right edge.
- Header: file name + close button.
- Left: lazy file tree (workspace root → directories → files; directories collapse by default, click to expand).
- Right: read-only preview pane with file size + path footer.
- Hotkey —
Ctrl/Cmd + Shift + Rtoggles the panel.
Default state is closed; the user opens it via the toggle.
Install
dsh plugin --profile web add dsh-web-ui
The plugin resolves through the profile's node_modules; the
cordis.patch.yml inserts the plugin row into the profile's loader stack.
Wire contract
All host endpoints live under /api/dsh-web-ui/ and respond with the
envelope:
{ "ok": true, "value": ... }
{ "ok": false, "error": { "code": 403, "message": "..." } }
| Path | Method | Purpose |
|---|---|---|
/api/dsh-web-ui/fs/tree?path=<abs> |
GET | one-level listing (files + dirs, dirs first) |
/api/dsh-web-ui/fs/file?path=<abs> |
GET | file content (utf8 or binary flag), max 1 MB |
Both routes realpath-validate path against the active workspace root and
reject anything outside as 403. The plugin does not read arbitrary paths.
Build
pnpm install
pnpm build # tsc -p tsconfig.build.json && tsdown
pnpm typecheck
Why one client bundle
DSH plugins with a scoped npm name (@scope/pkg) ship two CJS bundles: one
registering as the package name (@scope/pkg, the official channel) and
one as the manifest id (scope/pkg/registry, the registry channel). For a
non-scoped plugin like this one, the two channels collapse to one id —
dsh-web-ui — so lib/client-registry.js is the single artifact and
dsh.plugin.json's client.main points at it.
License
MIT