dsh-index-tap-bridge: Enable the tapIndex plugin in the official DSH desktop version

Preface

Many third-party plugins in DeepSeek Harness (DSH) inject <script>, <style>, and similar tags into the page via webServer.tapIndex(html => html). On the dsh web path or when the Host renders index.html itself, this mechanism works correctly; the official desktop edition, however, loads the built-in SPA (dsh-app://app/) and only consumes the structured injection rows (webserver/index-inject) reported by the Host via IPC—it never executes the tapIndex transformation inside renderIndex(). The result: plugins show as enabled in the list and load without errors, yet the injected resources never appear in the page. The following introduces how the community plugin dsh-index-tap-bridge bridges tapIndex into the injection channel the desktop shell recognizes, without modifying the source code of the target plugins.

What Is This

dsh-index-tap-bridge (GitHub: VCPr0j3k7/dsh-index-tap-bridge) is published by maintainer VCPr0j3k7, classified as a client-side plugin, currently at version 0.1.0 under the MIT license. It is installed into a DSH profile as a standalone bundle. When the webserver/index-inject event fires, it reads the registered indexTaps, translates the newly added HTML tags produced by the transformation into structured injection rows, and pushes them into the injection table—so third-party plugins that rely on tapIndex work equally well in the official Harness desktop edition.

Problem Background and Two Injection Channels

@deepseek-ai/dsh-host-webserver offers two channels to index.html:

Channel Primary Users Official Desktop Edition
Structured injection rows (webserver/index-inject event) Official plugins (e.g. dsh-client-modules) Works
Index transformation (tapIndex(html => html)) Many third-party plugins Does not work

The desktop edition does not render the Host’s index.html: the window loads the shell’s built-in SPA; after the Host starts it reports the result of collectIndexInjections() only once. tapIndex is executed only inside renderIndex(), a path the desktop edition never takes. Official source code describes applyIndexTaps() as “the escape hatch for markup no IndexInjection row expresses”—the bridge plugin exactly transcribes the output of that escape hatch into a form IndexInjection rows can express.

Core Features

  1. Transparent compatibility: The target plugin still calls tapIndex(), and the transformation remains in indexTaps; behavior via renderIndex() in browsers and dsh web is unchanged.
  2. Translation of injections: In the desktop shell scenario, for each tap the plugin applies it to a minimal skeleton HTML, extracts the newly added tags, maps them to kind values such as script-src, script, style, html according to rules, and deduplicates by kind and payload.
  3. Conditional activation: By default, the bridge is enabled based on whether process.argv contains dsh-desktop-host, avoiding duplicate injection on self-contained shells (which still go through renderIndex()).
  4. Bundle integration: It is attached to the profile via dsh.bundle.patch (cordis.patch.yml); after dsh plugin installation, reconcilePlugins() automatically maintains dsh.profile.bundles.

Summary of translation rules (see the repository README for the complete table):

Original Tag Translation Result
<script src="U"> { kind: 'script-src', src: 'U' }
<script>inline</script> { kind: 'script', text, placement }
<style>…</style> { kind: 'style', text }
<link>, div, etc. { kind: 'html', placement, html }

The desktop frontend uses insertAdjacentHTML() for html rows; <script> tags inserted this way do not execute, so <script> must be mapped separately and cannot be carried by an html row.

Environment Requirements

Item Requirement
Node.js ^22.19.0 \|\| >=24
DeepSeek Harness Verified on official desktop edition 0.1.7-rc.2

Installation and Activation

Plugins are installed per DSH profile. The Web side commonly uses the web profile (auto-created on first DSH run); the official Harness desktop edition uses the desktop profile.

Install into the web profile:

dsh plugin --profile web add github:VCPr0j3k7/dsh-index-tap-bridge

Desktop edition:

dsh plugin --profile desktop add github:VCPr0j3k7/dsh-index-tap-bridge

No manual edits to dsh.profile.bundles are needed. Confirm it is registered:

dsh --profile web --dump-config

The output should contain index-tap-bridge. After installation, the target harness must be restarted; the desktop edition loads plugins at startup, and running instances are not hot-reloaded.

For troubleshooting, the activation logic can be overridden:

Environment Variable Value Effect
DSH_INDEX_TAP_BRIDGE on Force enable
DSH_INDEX_TAP_BRIDGE off Force disable

Uninstallation

dsh plugin --profile desktop rm dsh-index-tap-bridge

reconcilePlugins() will clean up bundle entries accordingly; if any remain, delete the corresponding items manually. After uninstallation, the harness must also be restarted.

Typical Verification Methods

The repository provides logic self-checks that do not depend on the DSH runtime:

npm test

test/check.mjs covers translation branches, empty-payload discarding, ordering preservation, reporting of untranslatable tags, and desktop shell detection; the README records 23/23 currently passing.

End-to-end: after installing and restarting the desktop edition, tapIndex-dependent plugins that previously did not display their widgets should start working; if the plugin has logs, you can see its injected resources being requested.

Applicable Scenarios and Caveats

Who it is for: Developers who have enabled third-party plugins relying on tapIndex in DSH and primarily use the official desktop shell.

Permissions and security: The plugin runs with the same permissions as the current DSH process. Before installing, read the source code and MIT license of the GitHub repository and evaluate for yourself whether to include it in your profile.

Known limitations (excerpted from the README):

  • Only newly added tags are translated; if a tap modifies an existing DOM fragment, it cannot be translated and will be listed via console.warn.
  • If the official project renames the indexTaps field, the bridge may silently fail (there is an Array.isArray guard).
  • Tags that require “replace node” semantics, such as <canvas>, are not force-translated into html rows.
  • The desktop edition’s plugin library toggle may rewrite dsh.profile.bundles (sanitizeProfile); if the bridge suddenly stops working, first check whether the entry still exists in the bundle.

The DSH ecosystem emphasizes “everything is a plugin”; the community directory SkillHub plugin page is an independent site and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-index-tap-bridge addresses the disconnect between the official desktop edition and the tapIndex injection path: while the Host still registers taps, at the index-inject moment it translates newly added tags into injection rows the shell can apply. If your plugin list looks normal but page scripts never load, first install this bridge for the desktop profile and restart, then cross-check against the limitations in the README for untranslated tags.

  • Directory page: https://www.skillhub.cn/plugins/VCPr0j3k7/dsh-index-tap-bridge
  • GitHub: https://github.com/VCPr0j3k7/dsh-index-tap-bridge
羽毛球分组比赛记分
小程序二维码

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

Xiaoye