omdsh-dev/dsh-plugin-dev

dsh-plugin-dev

DSH 插件开发踩坑与做法档案(skill + 文档):cordis 双副本、tsconfig 三件套、Windows junction、多帧 zstd 等实测记录

Uncategorizedbest-practicesdocumentationdsh

dsh-plugin-dev

[中文](README.md)

Pitfalls encountered and practices verified during DeepSeek Harness plugin development.
Plugin development practices recorded during the DSH public beta (dsh-external organization): vendor cordis dual copies, the tsconfig trio, Windows junction, multi-frame zstd API... Every pitfall includes the symptom observed when it occurred, the confirmed root cause, and the final fix. After the public beta ended, the related repositories were migrated to the [omdsh-dev](https://github.com/omdsh-dev) organization and made public.


What This Is

An experience archive (skill + documentation): records the plugin development workflow, the pitfalls hit, and the practices verified to work.

How to Use

  1. Put skills/dsh-plugin-dev into your skills directory (or reference it in an agent session);
  2. Start with the workflow and pitfall quick-reference table in SKILL.md;
  3. Before building, read references/build-pitfalls.md — the first entry is the cordis dual-copy issue.

Archive Map

DocWhat it records
SKILL.mdDevelopment workflow + pitfall quick-reference table + pre-delivery verification loop
overview.mdShape selection (bundle) + surveyed ecosystem map
tool-plugin.mddefineTool contract, parameter schema, output modes, and the rc.2 settings namespace/keyed-slot contract
build-pitfalls.mdComplete pitfall collection (cordis dual copy / tsconfig / junction / multi-frame API)
bundle-patch.mdprofile/bundle mechanism, dsh plugin add, dsh run verification
testing.mdContract test / logic test / differential test patterns
publish.mddescription, topic, hub listing, collection packaging

Environment Baseline

When troubleshooting/reproducing an issue or evaluating whether a pitfall still applies, first cross-check this table to confirm the environment matches; when reporting an issue, attach the output of dsh --version and readlink ~/.dsh/source/current.

Runtime and Tool Versions

ItemVersion/ValueNotes
OSWindows 11 Pro (build 26200), git-bash (MSYS2 3.5.7)All Windows-specific cases in this document were verified in this environment
Nodev24.18.1 (~/node24 portable)Used preferentially by the dsh wrapper; system node 22.15 is unusable
dsh (npm)npm @deepseek-ai/dsh@next (npm line resolves to 0.1.5-rc.1; verified against local harness 0.1.5-rc.1, lib production mode)Started via npx -p @deepseek-ai/dsh@next dsh web --no-open (lib production mode; do not install -g globally)
TypeScript / VitestEach repo's devDependencies are self-contained (typescript/vitest/@types/node + lockfile)An independent checkout can run npm install → npm run typecheck → npm test → npm run build → npm pack
pnpm11.18.0Forwarded internally by dsh plugin (within the profile directory)
gh CLI2.97.0 (2026-07-31), account whiteicey, scopes gist, read:org, repoAPI operations and repository creation/visibility management
@types/node22.20.0 / 25.9.3 / 26.1.2 coexist under .pnpm, 22.20.0 used for buildsJunction reaches directly into .pnpm/@types+node@22.20.0/node_modules/@types/node

Key Paths

PathContents
~/.dsh($DSH_HOME)profiles / sessions / source / settings.yaml / web.log
~/.dsh/source/current→ DSH 0.1.2-alpha.2 — a leftover of the snapshot-junction era (does not exist under npm mode)
<monorepo>/vendor/cordisThe only legitimate cordis resolution source at build time (pitfall 1)
<monorepo>/packages/core/tools@deepseek-ai/dsh-tools (defineTool/tool pipeline)
<monorepo>/node_modules/.pnpm/@types+node@22.20.0/...Real path of @types/node (pitfall 3)
~/.dsh/profiles/{web,headless}profile directories (dsh.profile.bundles + cordis.yml + patch layer)
~/.dsh/sessions/<cwd 编码>/<session-id>/session.jsonl.zstdMulti-frame zstd session files (pitfall 6)
~/node24、~/.local/bin/dshPortable Node, dsh launcher wrapper

Environment Variables and Startup Method

VariableValueNotes
DSH_PERMISSION_MODEdanger-full-access⚠️ High-risk mode (review PD-04): Windows has no sandbox backend (bwrap/Landlock/Seatbelt); only this mode can start, and it disables approval prompts — use it only temporarily on a trusted local dev machine; do not put it into project templates, CI, or shared machines, nor copy it as a general recommendation
DSH_TELEMETRY_DISABLED1User chose to disable telemetry
DSH_HOMEC:\Users\admin\.dshDefaults to ~/.dsh when not explicitly set
DSH_* special variablesAlways passed in by the launch environment (wrapper/export)Putting them in ~/.dsh/.env causes a startup error (pitfall 7)

Startup: npx -p @deepseek-ai/dsh@next dsh web --no-open (DSH 0.1.5-rc.1, lib production mode; do not install -g globally). The old snapshot-era wrapper is deprecated: ~/.local/bin/dsh (do not run bin/dsh directly — on Windows, MSYS path conversion triggers ERR_UNSUPPORTED_ESM_URL_SCHEME, issue #388; the wrapper launches tsx with a file:// URL to work around it).

Platform Behavior Differences (versus the "standard practice" docs)

BehaviorVerified locally
Junction creationBoth ln -s and cmd mklink /J fail; PowerShell New-Item -ItemType Junction works (pitfall 1b)
Repository visibilitydsh-external defaults everything to private during the public beta; after the beta ended on 2026-08-13, the 15 repositories covered by this archive were migrated to the omdsh-dev organization and made public
headless one-shot tasks#376 on 0807 (no output/exit code 1); use dsh run "task" from 0808 on, fixed
Web GUIdsh web listens on 127.0.0.1:3080; the GUI must be restarted after installing a plugin for new tools to load

Self-check Command Quick Reference

dsh --version && readlink ~/.dsh/source/current     # 快照
node -v                                              # Node
gh --version && gh auth status                       # gh 与认证
node <mono>/node_modules/typescript/bin/tsc --version  # TS(<mono> 换成 current 真实路径)
node <mono>/node_modules/vitest/vitest.mjs --version   # Vitest

Maintenance

  • The pitfall list is continuously extended as dsh snapshots evolve (e.g. 0808's dsh run, credential migration, 200ms batch persistence);
  • New pitfalls are appended once recorded (including non-Windows platform experience, if any).

Build Dependency Layering (review PD-05)

LayerMethodWhen applicable
Preferred (current)Each repo's devDependencies are self-contained (typescript/vitest/@types/node + lockfile); an independent checkout can run npm install → npm run typecheck → npm test → npm run build → npm packReproducible builds/CI
Legacy (out-of-tree)DSH_MONOREPO points at the current snapshot, using the monorepo's tsc/vitestSnapshot-era local plugin development (historical record)
Environment fallbackInternal paths under .pnpm/@types+node@* (versions change; auto-discover with ls .pnpm/@types+node@* | sort -V | tail -1)This machine only