Skip to content

feat: install pinned @deepseek-ai/dsh from npm in /dsh:setup - #5

Open
cpj-dev wants to merge 4 commits into
mainfrom
cursor/npm-first-setup-2311
Open

feat: install pinned @deepseek-ai/dsh from npm in /dsh:setup#5
cpj-dev wants to merge 4 commits into
mainfrom
cursor/npm-first-setup-2311

Conversation

@cpj-dev

@cpj-dev cpj-dev commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary / 变更摘要

/dsh:setup no longer git clones DeepSeek Harness and runs pnpm run build:lib. Default setup installs the pinned npm CLI into the plugin data directory and adds the SDK JSON-RPC server (plus that package's published peerDependencies) to the cc profile.

This is required because:

  • @deepseek-ai/dsh is on npm (0.1.0-rc.6); there is no 0.1.0-rc.5 tarball, so the old git SHA pin cannot be expressed as an npm version.
  • @deepseek-ai/dsh-sdk-jsonrpc-server is published separately and is outside the CLI dependency closure. Dist-tags are unsafe: on 2026-08-14 CLI latest/next were 0.1.0-rc.6 while SDK-server latest was still 0.0.1-rc.5. Both packages are pinned to 0.1.0-rc.6.
  • A server-only dsh plugin add fails at boot (Cannot find package '@deepseek-ai/dsh-sdk-protocol'). The launcher's $DSH_HOME/profiles/node_modules self-heal does not provide those peers. Setup therefore adds the server and HARNESS_SDK_JSONRPC_PEER_SPECS. Nested peer warnings remain; they did not block initialize.

--harness still links a user-built checkout (no plugin-side compile). DSH_BINARY / PATH skip the CLI install and still repair the profile from registry specs.

Breaking / 破坏性变更

  • --skip-build is removed.
  • --harness no longer runs pnpm install / build:lib; the checkout must already be built.
  • Uninstall path is the plugin data npm prefix ($CLAUDE_PLUGIN_DATA/npm), not a cloned deepseek-harness directory.
  • Runtime pin moves from source 0.1.0-rc.5 (47f9438) to npm 0.1.0-rc.6.
  • No-args /dsh:setup migrates a persisted source install to the npm pin. Pass --harness again to keep a checkout.

Review follow-up

  • Codex P2: pin refresh re-adds SDK server + peers (c93e836).
  • Ampcode round 1 (all three accepted in 8ae85fa):
    1. Pre-npm harnessCheckout configs migrate to npm on no-args setup.
    2. sdkProfileVersion is written only after a successful plugin add, so a failed refresh is retried; DSH_BINARY + an already-ready profile also refreshes.
    3. --harness errors when packages/sdk/server is missing (no silent npm SDK mix).
  • Ampcode round 2 (both accepted in 3bbbad3):
    1. sdkProfileVersion is now a full identity (npm:0.1.0-rc.6 or harness: + checkout realpath). npm to --harness and checkout A to B re-add the SDK server; identity is written only after a successful plugin add.
    2. /dsh:check treats a stale npm CLI pin or profile identity as not ready (npm.ok / profile.ready / multiTurnReady) and adds nextSteps to rerun setup.

Verification / 验证

  • npm test — 71/71 pass on Node v22.22.2 (setup e2e uses a fake npm; CI has no network)
  • Relevant manual checks completed / 已完成相关手工检查 — live npm install + cc initialize. Full broker-turn checklist not run (no DEEPSEEK_API_KEY).
  • User-facing English and Simplified Chinese docs are synchronized / 用户可见的中英文文档已同步

Safety and compatibility / 安全与兼容性

  • No credentials, private paths, generated output, or local notes are included / 不包含凭据、私有路径、生成文件或本地笔记
  • DSH assumptions are documented in docs/dsh-compat.md, when applicable / 如涉及 DSH 假设,已更新兼容性契约
  • Breaking changes and migration steps are described / 已说明破坏性变更和迁移步骤

Existing --harness / DSH_BINARY users: rerun /dsh:setup (pass --harness with your checkout path if you still want the source tree). Auto-cloned trees under the plugin data dir are no longer maintained; /dsh:setup with no args installs the npm pin.

Related issue / 关联 Issue

npm-first setup after @deepseek-ai/dsh published publicly.

Replace git clone + pnpm build with an npm-prefix install of
@deepseek-ai/dsh@0.1.0-rc.6. The cc profile adds the SDK JSON-RPC
server plus its published peerDependencies, because profile self-heal
cannot resolve @deepseek-ai/dsh-sdk-protocol. --harness still links a
user-built checkout and no longer compiles it. --skip-build is removed.

Co-authored-by: Gao Peiwen <gpw0426@hotmail.com>
@cpj-dev
cpj-dev marked this pull request as ready for review August 14, 2026 10:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3530303f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/dsh/scripts/dsh-bridge.mjs Outdated
Comment on lines 452 to 453
const probeBefore = probeProfile("cc", { mustContain: JSONRPC_PLUGIN, cwd });
if (!probeBefore.ready) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh the SDK packages when upgrading the CLI pin

When npmPinStale causes a future /dsh:setup run to reinstall a newer CLI, an existing cc profile still makes this probe ready because probeProfile only checks that the JSON-RPC package name appears in --dump-config. The guarded plugin add is therefore skipped, leaving the SDK server and peers at their previous versions even though the CLI and compatibility pin were upgraded; reinstall the pinned profile specs whenever the npm pin is refreshed, not only when the package row is absent.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — --dump-config only proves the package name is present, so a pin bump skipped plugin add and left the SDK server/peers on the old versions.

Fixed in c93e836: whenever setup refreshes the npm CLI pin it re-adds the pinned SDK-server + peer specs, even if the profile already looks ready. Matching-pin reruns stay a no-op.

cursoragent and others added 3 commits August 14, 2026 11:01
probeProfile only checks that the JSON-RPC package name appears in
--dump-config, so a pin bump skipped plugin add and left the cc
profile on the previous SDK-server/peer versions.

Co-authored-by: Gao Peiwen <gpw0426@hotmail.com>
No-args setup now moves pre-npm harnessCheckout configs (and
dshInstall: harness) onto the npm pin; only an explicit --harness
keeps a checkout. sdkProfileVersion is written only after a successful
plugin add so a failed refresh is retried. --harness errors when
packages/sdk/server is missing instead of mixing in the npm SDK pin.

Co-authored-by: Gao Peiwen <gpw0426@hotmail.com>
sdkProfileVersion is now npm:<pin> or harness:<realpath> and is
compared on every setup so npm→harness and checkout A→B re-add the
SDK server. /dsh:check treats a stale CLI pin or profile identity as
not ready and adds nextSteps.

Co-authored-by: Gao Peiwen <gpw0426@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants