Skip to main content

How to use dsh-super-injector

Module Injector for DSH ecosystem: Load any local plugin into a running web without restart, featuring hot reload, self-reload, one-click uninstall, route self-healing, and plugin management UI for side panels and settings pages.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

dsh-super-injector

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add --allow-build=@dsh-external/dsh-super-injector github:yjh051108/dsh-super-injector

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

    • id: dsh-super-injector
  • 不硬编码 DSH 版本:peerDependencies 全部为范围声明
  • 已适配服务改名:webServer(原 httpServer)、compaction(原 compact)。
  • 🔥 热重载 + 自重载:dev_reload_package 整包重载(清缓存 → 重新 import → 重建 fiber,失败回滚保留旧代);注入器自身也支持自重载(自杀 → 全局定时器重建)
  • 🤖 自动 watch:注入即自动监听插件目录,改代码 build 后约 1.5 秒自动重载(无需手动触发)

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

What to do if dev_ tools are not visible after installation?*

First confirm that the injector has taken effect through the official installation path (dsh plugin --profile web add or cordis.patch.yml), and that the corresponding web profile has been restarted. Then ask the agent dev_plugin_status - if dsh-super-injector is not in the list, it's likely installed to a non-running profile (INSTALL.md:170-178).

How to troubleshoot injecting a UI-form plugin showing "client ✗"?

If the plugin didn't declare dsh.client.platform, it will show "Skip", which is expected. If it shows "Registration Failed", it means lib/client.js is missing or the client bundle is not a tsdown product; you need to run npm run build:client to build the client bundle separately, and the injector will automatically block before injection (src/index.ts:2406-2422 / INSTALL.md:176).

dev_reload_package reports "reload target hits injector itself" and gets rejected?

The injector refuses self-destruction under normal paths - you must use dev_reload_package with a name containing dsh-super-injector (which goes through the self-reload branch), and the interval between two self-reloads must be ≥10 seconds, otherwise it will be blocked by throttling (src/index.ts:656 / src/index.ts:1135-1142).

How to fix web startup crash reporting "duplicate loader entry id"?

Run node scripts/fix-patch.mjs in the extraction directory (or use dev_fix_patch in a running environment), deduplicate by ID and automatically backup original files; dsh loader strictly requires only one entry per ID (INSTALL.md:107-132 / src/index.ts:2539-2598).

Build fails with "cannot find bash" on Windows or WSL error?

The injector proactively rejects WSL's System32\bash.exe (it fails to start when System32 takes priority in PATH). You need to install Git for Windows / PortableGit and add Git\bin to PATH; Windows links use NTFS junctions instead of symbolic links (src/index.ts:83-85 / src/index.ts:2749-2767).

Do injected plugins persist after restart?

Yes. The injection list persists to ~/.dsh/super-injector/registry.json, and during next installation autoRestore is enabled by default, automatically re-injecting each item from the list; side-loaded tools are also persisted in staging.json (src/index.ts:502-522 / src/index.ts:1429-1489).

How to completely uninstall the injector?

Run dsh plugin --profile web remove @yjh051108/dsh-super-injector, then clean up related entries in cordis.patch.yml (keeping a single top-level array), delete profile node_modules links, and optionally delete ~/.dsh/super-injector/ directory; after restart, dev_* tools disappearing means uninstallation is complete (INSTALL.md:182-199).

Can the scaffold-generated skeleton be injected directly?

Yes, but you need to first run dev_build_plugin to build lib/ in the DSH_CHECKOUT environment; the skeleton already enforces ctx.effect registration specifications and peerDependencies scope declarations, and client-formatted plugins also validate slot.register for legitimate slot names (src/index.ts:2838-2851 / docs/SPEC.md:142-151).

— source: plugin_wiki.faq_json

Compatibility

  • DSH: 0.1.0-rc.6+(peerDependencies 范围声明 @deepseek-ai/dsh-tools >=0.0.1-rc <2,DSH 升级不需改插件)
  • Node: 未声明
  • Platforms: macOS, Windows, Linux

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule

How to use dsh-super-injector