fix(console): restore @deepseek-ai/dsh-tools peer + add dsh-client-ui-primitives to client inject - #7
Open
HuanLinOTO wants to merge 1 commit into
Open
Conversation
…-primitives to client inject Two bugs that crash the plugin at runtime: 1. lib/index.mjs imports @deepseek-ai/dsh-tools but commit 5ce6bb0 removed it from peerDependencies (reason: '官方包未发布公共 npm'). The package is now on public npm (0.1.0-rc.6). Without the peer declaration, installation via link: or git source causes ERR_MODULE_NOT_FOUND when Node resolves the plugin's real path outside the profile module closure. 2. lib/index.js (client bundle) calls require('@deepseek-ai/dsh-client-ui-primitives') (Panel.tsx imports Button/Input/Pill from it), but dsh.client.inject only listed dsh-client-runtime and dsh-client-ui-slots. The DSSH module loader has no primitives module to inject → browser-side require fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
plugin-console crashes at runtime with two distinct bugs:
1.
dsh webstartup crash:ERR_MODULE_NOT_FOUND: @deepseek-ai/dsh-toolslib/index.mjsimportsdefineTool/ToolDefinitionfrom@deepseek-ai/dsh-tools(src/discovery/tools.ts:20), but commit 5ce6bb0 removed it frompeerDependencies.The commit's reasoning no longer applies. The commit message said:
Two things have changed since then:
@deepseek-ai/dsh-toolsis now on public npm (0.0.1-rc.1→0.1.0-rc.6), so peer resolution no longer 404s.preparescript (commit 987065d removed it;lib/is pre-built and committed), so pnpm never runsnpm installduring git-source install — the peer-404-during-prepare scenario can't trigger.Without the peer declaration, installation via
link:(and on Windows, any path that creates a symlink outside the profilenode_modules) causes Node to resolve the plugin's real path outside the profile module closure →ERR_MODULE_NOT_FOUND. The profile provides@deepseek-ai/dsh-toolsviahealProfilesModuleFallback(symlinks in~/.dsh/profiles/node_modules/), but Node's parent-directory walk from a symlink target outside the profile never reaches that directory.See also: #5 (existing issue reporting the same crash).
2. Browser panel crash:
dsh.client.injectmissingdsh-client-ui-primitiveslib/index.js(the client bundle) callsrequire("@deepseek-ai/dsh-client-ui-primitives")—Panel.tsximportsButton,Input,Pillfrom it. Butdsh.client.injectonly listeddsh-client-runtimeanddsh-client-ui-slots:The DSSH module loader uses this list to decide which packages to inject as
require()-able modules in the browser bundle. Withoutdsh-client-ui-primitivesin the list, therequire()call fails at runtime when the settings panel tries to render.Fix
"client": { "inject": [ "@deepseek-ai/dsh-client-runtime", + "@deepseek-ai/dsh-client-ui-primitives", "@deepseek-ai/dsh-client-ui-slots" ], "platform": "web" } ... "peerDependencies": { "cordis": "^4.0.0-rc.7", - "react": "^18.2.0" + "react": "^18.2.0", + "@deepseek-ai/dsh-tools": "^0.1.0-rc.5" }Verification
Applied these two fixes locally and verified:
node -e "import('@dsh-external/plugin-console')"succeeds (exportsapply, inject, name— cordis plugin contract)dsh webstarts without theERR_MODULE_NOT_FOUNDcrash@deepseek-ai/dsh-toolsresolves correctly via the profile module closureNotes
peerDependenciesshould includecordis+ all used@deepseek-ai/*packages. This PR only restores@deepseek-ai/dsh-tools(the one causing the crash). The client-side@deepseek-ai/*packages (dsh-client-runtime,dsh-client-ui-primitives,dsh-client-ui-slots) could also be declared as peers for full F2 compliance, but they're provided by the host's DSSH module loader at runtime (not via Node module resolution), so they don't cause crashes when omitted. Leaving that as a follow-up decision for the maintainer.^0.1.0-rc.5matches both the current dsh source (0.1.0-rc.5) and the latest npm release (0.1.0-rc.6).