Directory Plugin: Let DSH "New Workspace" Start from Your Specified Folder

Preface

When creating a new workspace in DeepSeek Harness (DSH) Desktop, the native system folder selection dialog pops up. The starting point for this dialog is usually a system default location (e.g., “Downloads”), and the caller cannot specify the starting directory via parameters. If you are accustomed to keeping projects centralized in a fixed directory under a specific drive, having to navigate from the Downloads folder every time wastes a significant amount of time.

The following introduces the community plugin dsh-directory-plugin. It intercepts the directory selection process for “New Workspace” on Windows, changing the default starting point of the native selection box to a path configured in your settings; you still select the specific subdirectory yourself. It can be installed in non-Windows environments, but it will not take effect, and the behavior remains consistent with not having the plugin installed.

What is this

  • Repository / Package Name: dsh-directory-plugin
  • Maintainer: milu7
  • Category: Client (Includes both host routing and browser-side slot takeover)
  • License: MIT (package.json version 1.0.0)
  • Platform: Fully effective only on Windows 10/11; the starting directory relies on the Win32 COM IFileDialog::SetFolder

The plugin does not modify any files in the DSH installation directory; configuration and logs are written to the .dsh directory under the user’s home directory.

Core Features

  1. Directory Selection Takeover: Replaces the folder dialog popping up for “New Workspace,” starting from a configurable directory.
  2. Settings Page: Adds a “New Workspace Directory” section to DSH settings, supporting path input, “Browse…”, saving, and “Restore System Default”.
  3. Safe Fallback: If the plugin is unavailable, the directory is deleted, or the dialog errors, it automatically falls back to the DSH built-in selection box, without blocking the creation of a new workspace.
  4. Diagnostic Logging: Records whether the starting directory was effective for each dialog instance, facilitating troubleshooting.

Only one selection box can exist at a time: if “Browse…” on the settings page and “New Workspace” conflict, the latter initiated action will prompt “A folder selection box is already open”. The selection box is a modal dialog on the DSH window; the DSH main window is inoperable while it is open.

Installation and Activation

Prerequisites: Windows 10/11 + DSH Desktop (Next kernel). The plugin runs with the permissions of the current DSH process; please review the repository source code and MIT license before installation.

The registration method provided in the official README is to add the plugin directory to the desktop configuration profile using the link: format (without copying files). You need to obtain the repository locally first, then register it via DSH’s built-in plugin-cli.js:

# Modify these two variables according to your actual situation
$DSH_EXE = 'C:\Program Files\DSH\DSH NEXT.exe'   # Your DSH Desktop installation location
$PLUGIN  = 'D:\Plugins\dsh-directory-plugin'     # Local directory where this repository is located

$CLI = Join-Path (Split-Path $DSH_EXE) 'resources\app.asar\lib\plugin-cli.js'

$env:ELECTRON_RUN_AS_NODE = '1'
$env:DSH_HOME = "$env:USERPROFILE\.dsh"
& $DSH_EXE --expose-internals $CLI desktop add "link:$PLUGIN"

After the steps above:

  1. Restart DSH Desktop (Plugin combinations are read at startup).
  2. Open Settings → “New Workspace Directory”, select a directory and save it.
  3. Try “New Workspace” once to confirm the selection box opens from the configured path.

To uninstall, execute desktop remove dsh-directory-plugin in the same environment and restart; configuration files and logs remain in %USERPROFILE%\.dsh, which can be deleted manually.

$env:ELECTRON_RUN_AS_NODE = '1'
$env:DSH_HOME = "$env:USERPROFILE\.dsh"
& $DSH_EXE --expose-internals $CLI desktop remove dsh-directory-plugin

Typical Usage

  1. Go to Settings → “New Workspace Directory”.
  2. Click “Browse…” to select a directory, or manually enter the path, then click “Save”. “Browse…” opens from the current path in the input box (it works even if not saved yet), but it only takes effect for “New Workspace” after saving.
  3. From then on, every time you “Create New Workspace”, the selection box will start from this directory.
  4. “Restore System Default” clears the configuration and returns to the original DSH behavior.

The configuration file path is %USERPROFILE%\.dsh\workspace-directory.json, for example:

{ "directory": "D:\\Projects" }

When manually editing the JSON, backslashes in Windows paths must be written as \\. Old filenames workspace-anchor.json / default-workspace-directory.json will be automatically migrated upon first read; after migration, the old files are renamed to *.migrated and retained.

How it Works (Brief)

The plugin registers HTTP routes /dsh-directory-plugin/config and /dsh-directory-plugin/pick on the host side; on the browser side, it takes over the conversation.hero.workspace.directoryFlow and sidebar.workspaces.directoryFlow slots and registers the settings page. When the dialog pops up, the client calls POST /pick, and lib/dialog-worker.cjs uses koffi to call the Win32 FileOpenDialog, using IFileDialog::SetFolder to set the starting point. If it fails, it falls back to the desktop’s built-in __DSH_DIRECTORY_PICKER__.

The repository bundles koffi 3.1.1 (vendor/), requiring no internet connection for installation. x64 uses the built-in binary; ARM64 will attempt to use the koffi 3.x bundled in the DSH installation directory, though this path has not been tested on ARM64.

Troubleshooting and Compatibility

Diagnostic log: %USERPROFILE%\.dsh\workspace-directory.log (Rotates and retains one copy when exceeding 1MB).

To determine if it is taking effect, compare with the README:

  1. After restart, host-routes-registered appears in the log → Host side is loaded.
  2. When creating a new workspace, a new pick ... initial={"applied":true} line appears → Uses this plugin’s dialog.
  3. If there is no pick line and the old dialog remains → Browser-side takeover did not take effect, the function degrades to native DSH behavior.

Compatibility notes: Windows 10/11 x64 is the primary support environment; on other systems, the settings page only displays an explanation, and “New Workspace” still uses the DSH built-in selection box. It relies on DSH Desktop slots and client plugin mechanisms; if future versions change slots, the plugin will silently fallback.

Conclusion

The directory plugin solves a small but specific interaction problem: fixing the default starting point of the “New Workspace” folder selection box to your commonly used project root directory, while maintaining a silent fallback in case of failure. The DSH ecosystem emphasizes “Everything is a plugin”; the community directory site is not officially affiliated with DeepSeek / High-Flyer. The information in this article is based on the repository README.

  • Community Directory Page: https://www.skillhub.cn/plugins/milu7/dsh-directory-plugin
  • GitHub: https://github.com/milu7/dsh-directory-plugin
羽毛球分组比赛记分
小程序二维码

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

Xiaoye