DeepSeek Harness · module reference

@wanghailong0419/dsh-mcp-manager

A package plugins require but dsh never ships in its module table — the browser half cannot resolve it.

插件会 require、但 dsh 从未放进模块表的包——浏览器端无法解析它。

Module history模块历史

@wanghailong0419/dsh-mcp-manager
never shipped in any shell module table从未进入任何 shell 模块表

Ecosystem生态

1 plugin(s) ecosystem-wide hit the same module全生态 1 个插件踩了同一个模块

Why it breaks为什么崩

dsh resolves require() only against the module table baked into each shell build plus registered plugin factories — never against node_modules. Node builtins (stream / buffer / fs / util / events …) and most npm packages are therefore never resolvable from a plugin’s client bundle.

dsh 的 require() 只对照烘焙进每个 shell 构建的模块表加已注册的插件工厂解析——从不查 node_modules。所以 Node 内置模块(stream / buffer / fs / util / events …)和大多数 npm 包在插件的 client bundle 里永远解析不了。

How to fix it怎么修

Bundle the dependency into the plugin (keeping react and @deepseek-ai/cordis external to avoid duplicates), or wrap the require in try/catch and degrade gracefully. The loader resolves require() at call time, so a paired catch turns the crash into a fallback.

把该依赖打进插件自身 bundle(react 和 @deepseek-ai/cordis 保持 external 避免双份),或给 require 加 try/catch 兜底降级。加载器是调用时解析 require 的,配对的 catch 能把崩溃变成优雅降级。

FAQ常见问题

Why does require("@wanghailong0419/dsh-mcp-manager") crash in dsh but not in Node?

dsh’s client bundles run in the browser and resolve against the shell module table, not node_modules. Node-only packages can never load there unless the plugin bundles them.

为什么 require("@wanghailong0419/dsh-mcp-manager") 在 dsh 里崩、在 Node 里不崩?

dsh 的 client bundle 跑在浏览器里,对照 shell 模块表解析、不查 node_modules。纯 Node 包只有被打进插件自身才能在那里加载。