dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
A DeepSeek Harness tool plugin — demo scaffold generated by create-dsh-plugin
A DeepSeek Harness tool plugin generated by
create-dsh-plugin. 由 create-dsh-plugin 生成的 DeepSeek Harness 工具插件。
Registers the xiaoziwenjie_code_demo_tool tool via defineTool().
pnpm install
pnpm run build # tsc → dist/index.js (pure ESM)
# From the PARENT directory, install into a profile and boot:
dsh plugin --profile my-profile add ./dsh-plugin-demo-tool
dsh --profile my-profile # watch for: [xiaoziwenjie-code-demo-tool] registered "xiaoziwenjie_code_demo_tool" — listed=true
注意:
dsh plugin add <dir>的相对路径锚定「调用目录」,请在插件父目录执行。
dsh --profile my-profile --dump-config | grep xiaoziwenjie-code-demo-tool # 配置层含本行
dsh plugin --profile headless add ./dsh-plugin-demo-tool
dsh --profile headless "run a probe" # session/event 触发;模型调用会 MISSING_CREDENTIAL
@deepseek-ai/dsh-tools: 0.2.1-rc.2 (exact — the next-tag line; npm latest is stale).@deepseek-ai/cordis: ^4.0.5 (peerDependency — host provides it; types-only in code).This plugin has no host-rendered UI of its own (tool results render through the official
chat surface), so it is compatible by construction. If you later add a panel, follow the
DSH Web styling contract: colors via --dsw-alias-* tokens only, and emit
data-dsh-plugin / data-dsh-part / data-dsh-surface semantic attributes
(dsh-web skin-center contracts).
本插件没有自有宿主 UI(工具结果走官方聊天面渲染),天然兼容。若以后加面板:
颜色只用 --dsw-alias-* 令牌,并输出 data-dsh-* 语义属性(见上方契约链接)。
Node version: DSH requires Node ^22.19.0 || >=24.0.0. Older Node (e.g. v22.17) only warns EBADENGINE but may hit runtime issues — upgrade if you can.
npm dist-tag trap (the big one): @deepseek-ai/dsh-tools latest is a STALE 0.0.1-rc.1; the real line is under the next tag (0.1.0-rc.x). This scaffold pins the next-tag version for you — never npm i @deepseek-ai/dsh-tools over it.
@deepseek-ai/dsh-tools 的 latest 是过期的 0.0.1-rc.1,正确版本在 next tag。本脚手架已锁 next 版本,勿再手动 npm i 覆盖。Version-line alignment: keep every @deepseek-ai/dsh-* package on the same 0.1.0-rc.x line so pnpm does not install two module copies.
@deepseek-ai/cordis is a peerDependency: import only type { Context } (erased at compile). At runtime the host hands you ctx — never import cordis values at runtime.
Pure ESM: package.json must set "type": "module"; build with module: esnext + moduleResolution: bundler to keep bare specifiers.
dsh plugin add <dir> anchors relative paths to the INVOKING directory — run it from the parent directory, not from inside the plugin.
In the bundle cordis.patch.yml, name is a package name (resolved via node_modules / $DSH_HOME/profiles/node_modules), not a relative path.
Registrations are effects: ctx.tools.register() / ctx.on() auto-dispose on unload. Wrap your OWN resources (timers/connections) in ctx.effect(() => { acquire; return cleanup }).
Load order = service dependencies, never file order: export const inject = ['tools'] makes the plugin wait until ctx.tools is ready.
Full end-to-end (model actually calls your tool) needs DEEPSEEK_API_KEY; without it --verify proves load/list/event, and the model call fails with MISSING_CREDENTIAL.