dsh-workspace: Append Additional Source Directories to DSH Workspace

Preface

In DeepSeek Harness (DSH), each workspace corresponds to a unique directory path in the registry, and the session’s current working directory (cwd) also falls under this directory. In many real-world projects, code, scripts, or dependencies are scattered outside the workspace directory—for example, in adjacent repositories, shared configuration directories, or subtrees outside a monorepo. Without a unified entry point, one can only repeatedly switch workspaces or manually create paths outside permission boundaries, and the agent side may not necessarily handle these paths as “part of the workspace.”

dsh-workspace (repository fenghuanfun/dsh-workspace) is a community-maintained client-side plugin: while retaining the original workspace directory, it registers additional source directories for the same workspace, grants writable root paths in already running sessions following the same strategy as the workspace directory, and declares these directories as belonging to the current workspace in the runtime context. Below is an explanation of the implementation covering installation, usage, and boundaries.

What is it

  • Name: dsh-workspace (npm package name consistent, current version 1.0.0)
  • Maintainer: fenghuanfun
  • Category: Client (Host + Browser halves, see dsh.bundle and dsh.client in package.json)
  • License: MIT
  • One-liner: Adds additional source directories to a workspace; manage the list via the workspace row’s “…” or right-click menu in the sidebar; takes effect immediately for sessions enabled under the corresponding workspace after saving.

The DSH ecosystem emphasizes “everything is a plugin”; the plugin directory site skillhub.cn has no official affiliation with DeepSeek/Fanqian; please read the repository source code and license yourself before installing.

Core Features

The capabilities clearly defined in the documentation are as follows.

  1. Workspace menu entry: Provides Source directories (Chinese interface: “源目录”) in the workspace row’s ... / right-click menu, listed alongside operations like Rename and Delete.
  2. Add, Delete, and Persistence: Add paths via the system directory picker, remove entries, and save; each workspace maintains a list independently. Saving an empty list will delete the record for that workspace.
  3. Immediate Effect on Running Sessions: After saving, for each source directory, register a session-level writable root (sandboxPolicy.registerWritableRoot()) in the current session of that workspace, and add a line of explanation in the systemPrompt runtime context.
  4. Host-side Validation: Only accepts absolute paths; directory must exist; normalized via realpath; deduplicated and nested parent-child paths collapsed; maximum of 32 directories per workspace.
  5. Persistent Storage: State is written to $DSH_HOME/storages/dsh-workspace.json (also written as ~/.dsh/storages/dsh-workspace.json in the Chinese README); writes to a temporary file first then renames; does not publish a half-completed state if writing to disk fails.

The Host exposes two JSON routes protected by connection trust boundaries: GET /dsh-workspace/list and POST /dsh-workspace/set. The browser half registers UI elements like contextMenus and dialogs via client.js.

Installation and Activation

The plugin runs with the current DSH process permissions. Before installing, check the GitHub repository source code and the MIT license. The runtime environment requires Node.js >= 20 (see engines in package.json).

Choose one of the following:

  1. Open Plugins → Add plugin in DSH Desktop, select the directory containing this plugin (you need to obtain the repository files locally first; the method depends on your environment).
  2. Install the bundle in the shell (where target is the absolute path to this repository):
plugin_manager install_bundle target=/absolute/path/to/dsh-workspace

Documentation notes: No need to restart the process after installation; refresh the page to load the browser half. After completion, you can verify that dsh-workspace is enabled in the plugin manager.

Typical Usage

Follow the reproducible steps in the README:

  1. Hover your mouse over a workspace row in the sidebar, click ..., or right-click the row.
  2. Select Source directories.
  3. Use Add to add directories, Remove to remove unwanted entries, and finally Save.

After saving, the already running sessions under that workspace will include the newly registered directories within the same permissions and policy scope as the workspace directory; the model cannot add or remove source directories on its own; this operation is exclusive to the user.

Behavioral Boundaries and Use Cases

Suitable for: Scenarios where shared library directories, documentation trees, or toolchain paths exist alongside a monorepo, and you want to reference multiple root directories within a single session under controlled read/write ranges without creating a separate workspace for each physical path.

Remaining Limitations to Note (all from upstream README):

Item Description
Session cwd Still based on the registered workspace directory; relative paths, bash default current directory, and the right-side file tree anchor remain unchanged.
Permission Mode In read-only mode, additional source directories are also read-only.
Authorization Lifecycle Writable roots are runtime and session-level; restoring or forking a session re-registers them; authorization disappears after disabling the plugin.
Operation Subject Only the user modifies the list via the UI.

Development and Verification

The test entry point for the Host half within the repository is:

npm test

test/host.mjs covers validation, deduplication and nested path collapsing, workspace isolation, atomic writes, concurrent save serialization, write failure rollback, and session authorization and prompt copywriting in a simulated Cordis context. .github/workflows/test.yml runs the same set of tests on pushes and pull requests.

Conclusion

dsh-workspace solves the configuration and runtime alignment problem of “one workspace, multiple source roots”: maintaining the list in the UI, Host validates and persists it, and the session side immediately obtains consistent policies and context. To browse the plugin summary or jump to the repository, you can use the directory page skillhub.cn/plugins/fenghuanfun/dsh-workspace and the GitHub github.com/fenghuanfun/dsh-workspace.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye