esyion / __PKG_NAME__
Scaffold DeepSeek Harness (DSH) web plugins with Vite + React/TSX - emits the DSH ModuleLoader client bundle format
About this plugin
Written by the registry from verified metadata, not from the README.
__PKG_NAME__ is a DSH plugin published from the template package in the esyion/dsh-plugin-react repository.
Capabilities and topics
TITLE
DSH web plugin (Vite + React/TSX), generated by dsh-plugin-react.
Layout
index.js Host half (Node): add services/tools/routes here
src/client/main.tsx Browser half: React component + slot registration
src/shared/ Constants shared by the build and both halves
lib/client.js Built browser bundle (ModuleLoader contract) — keep it committed
cordis.patch.yml Inserts the plugin row into the profile
locale/ Display metadata (meta.title / meta.description / meta.detail)
docs/DETAIL.md Plugin Manager detail page
icon.svg Plugin icon
scripts/check-bundle.mjs Bundle contract self-check
Commands
| Command | What it does |
|---|---|
npm run dev | Rebuild lib/client.js on change (open DSH pages hot-swap the bundle) |
npm run build | One-shot build to lib/client.js |
npm run check | TypeScript type check |
npm run verify | check + build + bundle contract self-check |
The ModuleLoader contract (what the build produces)
lib/client.js must look like:
window.__ModuleLoader__.load({
id: "__PKG_NAME__",
factory(require) {
// compiled module body; require("react") resolves from the host's shared table
return { inject: ['slots'], apply(ctx) { /* slot registration */ } };
},
});
Keep these rules when you extend the template:
- Never bundle React. react / react-dom / react/jsx-runtime are marked
externalinvite.config.ts; the host provides them. A second React instance breaks hooks. - No dynamic import(). DSH serves lazy chunks with its own
require.async("./client.<name>.js")convention; plain ESM chunks will not load. Keep everything in one CJS file. - Static assets need the host's
require.asset(...)form and an"./assets/*"export; prefer inlining small icons as JSX/SVG components. - Styles render as component-local React elements (see
App), so they are removed on unmount and inherit the host theme viacurrentColor. - Register into a slot that already allocates space; find slots and their
props with the agent tools (
Slots.listSubTree) when you change__SLOT__.
Install into DSH
- Desktop app: Settings → Plugins → Add plugin → select this directory.
- Web/CLI profile:
dsh plugin --profile web add link:<this directory> - From a DSH session: ask the agent to
install_bundlethis directory.
After editing, rebuild (npm run dev or npm run build) — the Host watches
lib/client.js and open pages reload the plugin automatically; refresh the
page if a swap ever gets stuck.
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/esyion/dsh-plugin-react/template)