Introduction

A common approach when developing DSH Desktop plugins is to first verify the installation chain and then refer to a minimal implementation. dsh-plugin-restart-desktop is a DSH Desktop plugin with a single behavior: it adds a “Restart Desktop” button in the bottom-left corner of the sidebar. After clicking, it calls the desktop main process for an orderly restart via a secondary confirmation. Below, I introduce its functionality, installation steps, and usage notes.

What is this

dsh-plugin-restart-desktop is a DSH Desktop plugin with the repository at https://github.com/ExploringBB/dsh-plugin-restart-desktop and an MIT license. It is responsible for only one thing: injecting a “Restart Desktop” button into the bottom settings row of the sidebar and completing an orderly restart using the desktop main process after confirmation.

It can also serve as a minimal example for DSH Desktop plugins, referencing the standard package structure, the insert patch in cordis.patch.yml, and the host/client side and Typert Remote implementation styles.

Core Features

  • The button is injected into the bottom settings row of the sidebar, located to the right of the gear icon.
  • Clicking the button triggers a secondary confirmation dialog; after confirmation, desktopActions.requestRestart() (Electron relaunch) is called for an orderly restart.
  • A “Restarting…” loading layer is displayed during the restart process.
  • The button text is integrated with the DSH language system; switching between Chinese / English in DSH Settings → General Settings → Language causes the text to change immediately.
  • It only takes effect on the desktop profile; calls under a headless web profile will return { ok: false } and show a friendly error message.

Installation and Activation

This plugin is only applicable to the desktop profile. During installation, you need to modify the desktop profile’s package.json to add the plugin to dependencies and dsh.profile.bundles.

First, edit the desktop profile’s package.json, for example at the path:

~/.dsh/profiles/desktop/package.json

Add plugin dependencies and bundle configuration:

"dependencies": {
  "dsh-plugin-restart-desktop": "file:<local-plugin-directory>"
},
"dsh": {
  "profile": {
    "bundles": [
      "@deepseek-ai/dsh-base",
      "@deepseek-ai/dsh-web-app",
      "dsh-plugin-restart-desktop"
    ]
  }
}

The path after file: needs to be replaced with the actual directory of the plugin on the local machine.

Then, run installation in that profile directory:

pnpm install

Finally, restart DSH Desktop. After the above steps, you should be able to see the “Restart Desktop” button in the bottom settings row of the sidebar.

Typical Usage

  1. After restarting DSH Desktop, you will see the “Restart Desktop” button in the bottom settings row of the sidebar, to the right of the gear icon.
  2. Click the button, confirm in the secondary confirmation dialog, and the plugin triggers an orderly restart while displaying a “Restarting…” loading layer.
  3. Switch between Chinese / English in DSH Settings → General Settings → Language, and the button text changes immediately.
  4. If the currently running profile is headless web, the call will return { ok: false } and a friendly error message.

Package Declaration Highlights

The package.json declares the following dependencies:

{
  "dependencies": {
    "zod": "^4.4.3"
  },
  "peerDependencies": {
    "@deepseek-ai/cordis": "^4.0.1",
    "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
    "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.6",
    "react": "^18.2.0"
  }
}

It also declares client injection items:

{
  "dsh": {
    "client": {
      "inject": [
        "@deepseek-ai/dsh-client-runtime",
        "@deepseek-ai/dsh-api-remotes"
      ],
      "platform": "web"
    }
  }
}

Applicable Scenarios and Notes

Suitable for:
- Verifying the DSH Desktop plugin installation process: profile registration, pnpm install, and restart to take effect.
- Serving as a minimal reference implementation for custom DSH Desktop plugins.
- Reviewing the insert patch in cordis.patch.yml, and the host/client side and Typert Remote implementation styles.

Notes:
- This plugin is only applicable to the desktop profile; it is unavailable under a headless web profile and returns { ok: false }.
- The plugin will be loaded by DSH Desktop as part of the desktop profile and runs with the permissions of the current dsh process; you should check the source code, MIT license, and dependency versions before installing.
- The file: path in the installation steps needs to be replaced with the local plugin directory; do not copy the placeholder path directly.

Summary

dsh-plugin-restart-desktop covers several installation and runtime chains of DSH Desktop plugins: profile registration, dependency installation, UI injection, language system, and restart process. It is suitable for installation verification or as a minimal plugin example.

Repository address: https://github.com/ExploringBB/dsh-plugin-restart-desktop