dsh-switch
已验证 · 实测可装 dongsheng123132
功能简介
dsh-switch — DSH 插件(桥接)
可用 — 实测通过,早期项目
dsh-switch — DSH 插件(桥接) 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-switch
Evidence-first model control plane for DeepSeek Harness.
dsh-switch does two deliberately separate jobs:
- The DSH bundle exposes model-facing tools that inspect registered provider routes, validate an exact provider/model through the official
ctx.llmseam, and save the default for new sessions throughctx.agentDefaultModel. - The standalone CLI probes OpenAI-compatible
/modelsendpoints and reports reachability, HTTP status, latency, model count, and whether a credential environment variable is configured.
It does not intercept model requests, implement another OpenAI adapter, or silently reroute an active session. Projects such as dsh-polyglot and dsh-llm-fallbacks own adapter/fallback behavior; this project is the observable control plane around routes DSH already knows.
Install the DSH bundle
Pin a reviewed commit when installing from GitHub:
dsh plugin --profile web add github:dongsheng123132/dsh-switch#<commit>
dsh --profile web --dump-config
The bundle ships JavaScript and has no install/build lifecycle script.
Tools
dsh_switch_status({ includeModels? })
- shows the default selection used by newly created sessions;
- lists registered provider routes;
- optionally asks each adapter for its advertised models;
- performs no provider network health request itself.
dsh_switch_default({ provider, model, reasoningEffort?, expectedProvider?, expectedModel? })
- validates the exact route with
ctx.llm.resolveModelInfo(); - rejects an unsupported reasoning effort;
- supports an optimistic-concurrency expectation pair;
- saves through
ctx.agentDefaultModel.saveSelection(); - reads the value back and fails if the write is not observable;
- affects new sessions only. Existing sessions keep the route recorded in their logs.
Probe provider endpoints
Copy providers.example.json to a private local file such as providers.json. Reference secrets by environment-variable name—never place keys in JSON.
node bin/dsh-switch.mjs validate --config providers.json
node bin/dsh-switch.mjs check --config providers.json
node bin/dsh-switch.mjs best --config providers.json
JSON output:
node bin/dsh-switch.mjs check --config providers.json --json
Example output:
✓ deepseek-official 83.4 ms HTTP 200, 2 models credential:configured
✗ local-vllm 1.2 ms network-error credential:not-required
The probe sends GET <baseURL><modelsPath>. It does not send a chat completion and therefore does not consume inference tokens. A successful /models response proves endpoint reachability, not end-to-end generation correctness.
Security and evidence boundaries
apiKeyfields and credentials embedded in URLs are rejected.- Output contains only
configured,missing, ornot-required; secret values never enter results. - A 401/403 endpoint is reachable but not healthy.
- DSH tool switching validates registered adapter metadata, not live provider I/O.
- No automatic fallback or cost-based routing is enabled in v0.1.
Development
npm test
npm run check
The plugin smoke test requires the official DSH runtime packages to be resolvable:
npm run smoke:plugin
License
MIT © 2026 hfshfg
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-switch」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:dongsheng123132/dsh-switch Headless(CLI)profile:
dsh plugin --profile headless add github:dongsheng123132/dsh-switch 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。
使用场景
给 agent 网络能力——请求、API、代理或协议——让它能触达外部系统。
适合谁
任务涉及网络的人——调 API、抓资源或与远端服务通信。
二次开发建议
适配器和请求整形是缝——加协议、鉴权处理器、重试和端点抽象。