Preface¶
DSH (DeepSeek Harness) adopts an “everything is a plugin” architecture. Agent developers frequently need to inspect workspaces, browse repository file trees, index Markdown documents, and manage sessions at runtime. Panel-type components are typically limited to display purposes; to handle both editing and archiving, developers often have to split views or call multiple APIs. dsh-workbench-panel provides a sidebar panel that unifies three views—workspace, documents, and code—while supporting single-file editing and session archiving governed by a toggle switch. The panel itself does not display sessions; session archiving is performed through explicit API calls.
Plugin Overview¶
Plugin name: dsh-workbench-panel. Maintainer: person-clouds. Category: Client. Current version: 0.2.0. License: MIT.
The plugin is a DSH Web sidebar panel with three tabs: Workspace, Documents, and Code. The Workspace tab reads workspace information from ctx.workspaceRegistry; the Documents tab supports Markdown document indexing with content browsing/editing; the Code tab displays the repository file tree and blob content, supporting both git and worktree modes. Editing is controlled by the writeEnabled toggle and allows saving a single text file by default; archiving is performed via the POST /api/archive endpoint. The plugin reuses DSH’s frontend shiki and theme tokens, introducing zero new dependencies.
Installation & Activation¶
Installation command (from the README):
dsh plugin --profile web add dsh-workbench-panel
After restarting dsh web, a “DSH Workbench” entry appears in the sidebar (icon id dsh-workbench-panel). Clicking it reveals three tabs: Workspace, Documents, and Code.
Core Features¶
Workspace Tab¶
Read-only access to workspace information from ctx.workspaceRegistry, including title, path, creation time, and git markers. The panel does not display sessions, nor does it provide unarchived/archived filtering or an ungrouped bucket. The workspace list is served via read-only endpoints.
Documents Tab¶
First select a repository from docRepos, then load that repository’s Markdown index on demand. The directory tree is collapsed by default and expanded level by level. Clicking a document reads its content via the blob view. A “Edit Source” button at the top switches to an overlay editor for modifying the Markdown body. Saving uses a two-step confirmation flow with mtimeMs-based optimistic locking; the “Preview” button switches back to the rendered view.
Code Tab¶
Uses the plugin’s repos configuration combined with repositories auto-detected via workspaceRegistry. The file tree is loaded level by level, displaying all items at each level (no pagination); blobs are read-only. Supports both git and worktree modes.
Explicit Archiving¶
Invokes workspaceRegistry.archiveSession() via POST /api/archive; the endpoint is idempotent. After archiving, the panel no longer displays the session card, but the archive endpoint remains available for scripts and external calls. Session logs and directories are not deleted.
Read-Only Endpoints¶
GET /dsh-workbench-panel/api?view=... provides the following views: workspaces, docRepos, docs, repos, tree, blob (sessions/repoSessions have been deprecated). Workspace and repository lists use offset/limit (max 50) and return total/hasMore; tree is not paginated and returns all child items at that level in a single response.
Write Endpoints¶
POST /dsh-workbench-panel/api/archive: Session archiving.
POST /api/write: Overwrite a single workspace text file; parameters are { repo, path, text, expectMtimeMs }. A stale mtimeMs returns 409.
POST /api/revert: Revert a single file; parameters are { repo, path }, using git checkout --.
Authentication and origin verification follow the DSH Connection model (unauthenticated requests return 401; untrusted origins return 403). When writeEnabled=false, both the write and revert endpoints return 403.
Caching¶
In-process snapshot cache with cacheSeconds defaulting to 10 seconds; no disk persistence. Session titles are backfilled for missing entries on the current page and written to <dshHome>/state/workbench/session-titles.json.
Configuration¶
Modify via DSH Settings → Plugins → DSH Workbench, or write to the profile’s cordis.patch.yml:
- id: dsh-workbench-panel
name: dsh-workbench-panel
config:
dshHome: /home/zh/.dsh # default $DSH_HOME or ~/.dsh
cacheSeconds: 10 # in-process snapshot cache duration in seconds
repos: [] # when empty, only auto-detected repos from workspaceRegistry are used
# repos:
# - id: doc
# name: docs-repo
# path: /home/zh/www/doc
# mode: git # git | worktree
# ref: origin/main # ref to read in git mode
# description: workspace docs
# remote: https://github.com/person-clouds/doc.git
# exclude: [archive] # relative path prefixes; matched dirs/files are hidden
Each entry in repos must have id and path; all other fields are optional. The repository list also automatically includes workspace paths from workspaceRegistry; the same real path appears only once.
Boundaries & Limitations¶
- Only
/dsh-workbench-panel/apiis registered; write operations are limited to three types: session archiving, single-file overwrite, and single-file git revert. - Only writes to repositories in
worktreemode, and only to existing text files or files whose parent directory already exists. Repositories withmode=git, files exceeding 2 MB, binary files, and../absolute paths are all rejected. - Code browsing and search mask
.env*,.git, credential directories,*.pem/*.key/*.sqlite/*.db, etc. - Not supported in this version: autocomplete/LSP/symbol navigation, creating (top-level)/renaming/deleting files, terminal, simultaneous multi-repo tabs, column selection/multi-cursor.
- No credential reading; all content is rendered as React elements, with no use of
innerHTML. - No SA database access, no SA ticket/control views, no background fetch or cleanup loops.
- The panel depends on DSH Web services such as
webServer,workspaceRegistry, andsessionQuery; API changes after DSH upgrades require synchronous adaptation.
Use Cases & Notes¶
Suitable for DSH Web users who need to view workspaces, browse repository file trees, index Markdown documents, and perform controlled editing and session archiving within a single panel. Review the source code and license before installation.
The plugin runs with the current dsh process permissions. Ensure that configured paths and permissions are within the expected scope.
Summary¶
dsh-workbench-panel unifies workspace browsing, document indexing, and code viewing into a single sidebar panel, providing toggle-controlled single-file editing and a session archiving API. It introduces no heavy dependencies and reuses DSH’s frontend capabilities. Ideal for agent developers who need centralized management of project views and text files at runtime.
- Plugin directory page: https://www.skillhub.cn/plugins/person-clouds/dsh-workbench-panel
- GitHub: https://github.com/person-clouds/dsh-workbench-panel