dsh-open-native: Open delivery card with system default program

Introduction

In DeepSeek Harness (DSH), files delivered by agents via present appear as cards within the conversation. The default behavior is: clicking the main body of the card triggers an embedded preview in the right-side Sidebar, while “Open with System Default Program” is a separate button on the card. For developers who frequently handle deliverables like .xlsx or .pdf directly using WPS, local editors, or professional software, the extra step of previewing before finding the “Open (Default)” button is inconvenient.

Below is an introduction to the community plugin dsh-open-native (maintainer Lessthinker66). It changes the “click on the card body” action to open the file via the system’s default program, while retaining a fallback to the built-in preview when a modifier key is held down. This plugin is categorized as a Client plugin; the modifications exist only on the browser side and do not alter the DSH core.

What is this

The positioning of dsh-open-native is: when a delivered file card is opened, it uses the native channel provided by the host session.openWorkspacePath({ path }) to invoke the default application associated with that file extension by the system, rather than using the hardcoded sidebar embedded preview in DSH.

The specific program that ultimately opens the file depends on the operating system’s default associations for the file extension (e.g., whether .xlsx is associated with WPS or Microsoft Office on Windows). This is unrelated to the plugin; if the association is abnormal, it is a system-side issue, not an issue with the opening channel selection of this plugin.

Differences between DSH Default Behavior and this Plugin

DSH delivery cards deliberately distinguish between two paths:

  • Click on the card body → Embedded preview in the right Sidebar (no setting available to change this).
  • The “Open (Default)” button on the card → System default program.

This plugin changes the first path to the same native opening method as the second. The implementation listens for click events on document during the capture phase: if the click hits a card with [data-presented-file] and is not on the action button in the bottom right corner, it calls preventDefault() to cancel the original preview logic and instead calls session.openWorkspacePath. The title attribute of the card’s preview button holds the resolved absolute path (resolveWorkspacePath(cwd, file.path)); the plugin reads the path from the specific button clicked to avoid misidentification when a single card contains multiple files.

Retaining Built-in Preview

Holding down Shift, Ctrl, Alt, or Cmd (depending on the platform) while clicking the card still triggers the DSH built-in sidebar preview, facilitating scenarios where you occasionally need a quick look within the built-in interface.

Installation and Activation

This is a standard DSH plugin package (dsh.bundle.patch + dsh.client). The package.json declares the applicable DSH version as >=0.2.0-rc.2 for plugin marketplace compatibility checks; the current package version is 1.1.1 with an MIT license.

Install under the desktop profile:

dsh plugin --profile desktop add dsh-open-native

If using a local packaged file:

dsh plugin --profile desktop add file:/absolute/path/to/dsh-open-native-1.1.0.tgz

After installation, the entry (titled “Native Open”, with an icon) will be visible in the “Plugins” panel on the DSH visual page, and can be enabled or disabled at any time.

Before installing, it is recommended to review the source code and license of the GitHub repository; plugins run under the permissions of the current DSH process, so like any client plugin, you should verify the source is trustworthy.

Typical Usage

  1. After installing and enabling the plugin, have the agent present a file card in the conversation.
  2. Directly click the card body (not the action button in the bottom right) → The file should be opened by the system default program.
  3. If sidebar preview is needed, hold Shift (or Ctrl / Alt / Cmd) and click the card.

No additional configuration items are required; the behavior is determined by the click target and modifier keys.

Implementation Highlights and Package Structure

The modifications do not touch app.asar, so plugin logic will not be lost during DSH upgrades. The main files are as follows:

File Function
lib/index.js Host half: Does not register services, only ensures the bundle can be loaded
lib/client.js Client half: Capture phase click interception
cordis.patch.yml Mounts the plugin into the profile
locale/*.json Plugin panel names and descriptions

Troubleshooting and Version Risks

Press F12 to open Developer Tools and check the Console for warnings starting with [dsh-open-native]:

  • Host did not accept native open: The host refused the call (path is not within the session workspace, or the host does not provide native opening capabilities).
  • No output: The click may not have been recognized as a card; a common reason is that a major DSH version update changed the card DOM.

The plugin identifies cards by relying on the [data-presented-file] container and the cardPreview class within the preview button’s class; constants are defined at the top of lib/client.js. If the class names do not match, it falls back to “the first button within the card with an absolute path as the title”; if the container mark data-presented-file is removed, the plugin may fail entirely. The path must look like an absolute path (starting with C:\, \\, /) to trigger the host call, avoiding mistaking normal text for a path.

Version changes recorded in the README: 1.1.0 enhanced preview button identification and multi-file path retrieval; 1.0.0 was the initial release.

Applicable Scenarios and Notes

Suitable for developers who frequently handle delivered files in the DSH desktop client and want to “click the card to open locally.” Not suitable for scenarios where relying on the default sidebar preview is the only reading path and using modifier keys is undesirable.

The community plugin directory can be found at the SkillHub entry; this site is a community ecosystem directory and has no official affiliation with DeepSeek / High-Flyer. Source code and issue feedback: https://github.com/Lessthinker66/dsh-open-native.

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

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

Xiaoye