dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness 插件:为自定义供应方(llm-pi-ai 手动添加的 provider)补上 DSH 官方渠道才有的能力,开箱即用、零逐模型配置。
A DeepSeek Harness plugin that gives custom providers (hand-added via the
llm-pi-ai provider) four capabilities official channels already have —
out of the box, with no per-model configuration.
双版本兼容(0.6.1):同一代码库同时支撑 DSH Desktop 2.0.15(dsh-
0.1.7-rc.2)* 与最新0.2.0-rc.2。核验方式:对两版lib/index.js做 SHA-256 比对——dsh-settings、dsh-api-settings-controller、dsh-llm、dsh-credentials、dsh-attachment、dsh-typert-protocol逐字节相同,cordis 同为4.0.4; 仅dsh-llm-pi-ai(内置供应商表 + anthropic 响应模型记录)与dsh-config-editor(仅list()的inherited优化,写路径edit()逐字相同)有差异,且都不涉及本插件 使用的接口。因此采用差异收敛而非版本分支:src/compat.ts是唯一差异缝—— describe 形状归一(宿主裸数组 / RPCnamespaces包装 / 客户端{ok,value}信封)、 CAS 重试共用、同时订阅新旧两个 settings 事件名(settings/document-updated与旧settings/updated,未发射的事件名天然静默)。未来任一版本演进只改这一个文件。 Dual-version (0.6.1): one codebase serves DSH Desktop 2.0.15 (dsh-* 0.1.7-rc.2) and the latest 0.2.0-rc.2. Verified by SHA-256 over bothlib/index.jstrees: dsh-settings / dsh-api-settings-controller / dsh-llm / dsh-credentials / dsh-attachment / dsh-typert-protocol are byte-identical and cordis is 4.0.4 in both; only dsh-llm-pi-ai (builtin provider tables, anthropic response-model bookkeeping) and dsh-config-editor (alist()-onlyinheritedoptimization; theedit()write path is byte-identical) differ, and neither touches a surface this plugin uses. The strategy is therefore convergence, not version branching:src/compat.tsis the single seam — describe-shape normalization (bare array /namespaceswrapper /{ok,value}envelope), a shared CAS retry, and subscriptions under both settings event names. A future version change touches that one file. 兼容性:需要 DSH Desktop 2.0.15+(0.1.7-rc.2 设置模型:settings.yaml 退役、 per-profile Cordis patch、仅.volatile()字段可写)。0.6.0 起逐面核验于 DSH Desktop 2.0.15(cordis4.0.4、dsh-settings/dsh-llm-pi-ai0.1.7-rc.2):describe/mutate 0.1.7 契约(get/section/settings/updated已移除)、settings.document-updated事件、settings.section槽、 ModuleLoader bundle 协议、pi-ai 推理词典语义(reasoningEfforts/compat/input/contextWindow均为 schema 声明字段,volatile 子树写入合法)、llm.stream/discoverModels的signal透传。 插件运行时可变数据(探测 IPC、总开关、UA 覆盖)全部迁入本插件自有设置项dsh-provider-pro(volatile Schemastery Config)。 Requires DSH Desktop 2.0.15+ (the 0.1.7-rc.2 settings model: settings.yaml retired, per-profile Cordis patches, only.volatile()fields writable). 0.6.0 is verified surface-by-surface against DSH Desktop 2.0.15 (cordis 4.0.4, dsh-settings/dsh-llm-pi-ai 0.1.7-rc.2): the describe/mutate 0.1.7 contract (get/section/settings/updatedremoved upstream), thesettings/document-updatedevent, thesettings.sectionslot, the ModuleLoader bundle protocol, pi-ai reasoning semantics (reasoningEfforts / compat / input / contextWindow remain schema-declared — writes under the volatileprovidersdict stay legal), andsignalpassthrough forllm.stream/discoverModels. All runtime-mutable plugin data (probe IPC, master switch, UA overrides) moved into the plugin's owndsh-provider-prosettings entry (volatile Schemastery Config).
reasoningEfforts 的自定义模型写入五档词典
(off → null,low/medium/high/max → 同名值),
对话模型选择器随即出现推理等级行;
defaultEffort 不写 → 初始档位为 Default(请求不带思考参数,由供应方
自行决定)。切换发生在聊天里,无需设置。input: [text, image],DSH 随即允许向该模型附加图片。/v1/models 拉取 contextWindow/maxTokens,
缺失字段自动回填(手工值不覆盖);developer 角色(部分上游如 GLM 中转直接拒绝,报 1214「角色信息不正确」)。
探测发极小请求实测;被拒且 system 可用时自动写入
compat.supportsDeveloperRole: false(回退 system),即刻修复;reasoningEfforts 的模型由自动补档器
恢复默认五档 off/low/medium/high/max,探测从不覆写该字典;input 声明(只增删 image,其他 modality 保留)。
写回(容量回填 + compat + 图片声明)各自在 mutate 前重新读取最新配置,
只写真正变化的字段,互不覆盖;流式探测 30s 预算内无首 token 判为失败,
不会误报存活。wire 检查仅对 openai-completions 路由生效。
供应商卡片头显示 可达/不可达/冷却/未测 徽章,模型行显示对应状态点;
「一键探测」对全部模型走同一全量探测(冷却中的模型跳过,保留上次结果)。# 方式一:git 安装(需要一次构建许可,见下)
dsh plugin --profile desktop add github:Mortal520/dsh-provider-pro
# 方式二:本地仓库 / tarball(免构建许可)
dsh plugin --profile desktop add ./dsh-provider-pro
dsh plugin --profile desktop add ./dsh-provider-pro-0.5.1.tgz # 先 pnpm pack
git 安装注意:pnpm ≥10 默认拒绝运行 git 依赖的构建脚本。首次
add报错时, 把 pnpm 提示的那个包 key 写进 profile 的pnpm-workspace.yaml:allowBuilds: dsh-provider-pro: true然后重跑
add。这是对包内代码在你机器上执行的一次性授权——只允许可信来源, 并建议锁定提交(github:Mortal520/dsh-provider-pro#<sha>)。为避免该步骤,本仓库已提交构建产物
lib/,也可直接用 tarball/本地路径安装。
安装后**重启 dsh web(DSH Desktop 需重启应用)**生效。
在「模型」下方新增的原生设置页(与官方页同款令牌样式):
对话模型选择器内部的档位名是 dsh-llm-pi-ai 硬编码英文
(Off / Minimal / … / Max,reasoningInfo() 在 dsh-llm-pi-ai/lib/index.js 写死),
第三方插件无法为其改语言,defaultEffort 也不接受中文名值。中文能力只覆盖本插件的
设置页。若需要选择器内中文化,只能改 dsh-llm-pi-ai 本体。
reasoningEfforts 词典 → pi-ai resolveModelReasoning
→ 模型 reasoning = { thinkingLevelMap 全 5 档 } → ModelSelect 的 Effort 行天然出现;
defaultEffort 留空 → 选择器自动前置「Default」并默认选中。dsh-provider-pro 的 autoReasoning
(volatile Config 字段,缺省 = 开)。DSH 2.0.15 起设置只认
.volatile() 声明字段,pi-ai 段已是 zod-strict——旧版塞在
llm-pi-ai 用户层里的插件标志一律被剥除。Host 补档器每次扫描前
检查该开关;客户端点开关一次性写开关(自有 entry)+ 移除字节级
相同的自动补档词典(pi-ai entry)。headers 里任意大小写的 user-agent、再追加 attribution 头
(requestHeaders()),改 settings.headers 是死路。Host 半在宿主进程对
globalThis.fetch 做一次 URL 前缀匹配的最小补丁:仅当请求 URL 命中某供应方 baseURL、
且该供应方在本插件自有设置项 userAgents.<route> 配了覆盖值
(DSH 2.0.15 起 pi-ai schema 不再保留 providers.<route>.userAgent 未知字段,
UA 存储随 0.6.0 迁入插件自有 entry)时替换(而非追加)User-Agent。settings.section 槽,id: provider-pro、order: 15(官方「模型」=10)。pnpm install
pnpm run check # 类型检查 + 构建 + 离线产物校验
pnpm run smoke # Host 行为冒烟(fetch 补丁 / 补档器 / 总开关 / UA 边界 / 探测消费者)
pnpm run verify # 上面全部 + 打包(prepack)
lib/ 是发布产物,已提交进仓库(git 安装免重建即可用)。
注:
check/smoke验证的是构建产物与 Host 半逻辑;不覆盖真实 profile 安装、 客户端 UI 渲染或真实网关探测。修改涉及探测或写入路径后,建议对实际网关再跑一次 全量探测,并重启桌面端验证设置页行为。
dsh-llm-pi-ai 硬编码英文,无法中文化(见「平台红线」)。llm-pi-ai namespace 内、手声明 models[] 的条目生效;
不触碰 modelOverrides 与官方渠道(catalog)。reasoningEfforts dictionary for every
hand-declared custom model that lacks one and keeps defaultEffort unset,
so the picker preselects Default (no thinking parameter is sent; the
provider decides). Switch levels any time in chat.input: [text, image] so DSH allows image
attachments for that model./v1/models for contextWindow/maxTokens
and backfills missing fields (hand-set values are never overwritten).developer role for reasoning-capable models — which
some upstreams (GLM behind a relay, error 1214) refuse. A minimal wire
request verifies it; when developer is refused while system passes,
compat.supportsDeveloperRole: false is written automatically.reasoningEfforts
dictionary get the default five-level dict (off / low / medium / high /
max) from the auto-fill pass; the probe never overwrites it.input declaration (adds/removes only image; other declared
modalities are preserved). A stream that yields no first token within
the 30s budget is an explicit failure, never a false "alive".
Each write-back (backfill + compat + image declaration) re-reads the
freshest settings right before its mutate and writes only fields that
actually changed. Wire checks apply only to openai-completions routes.
Provider card headers show an up/down/cooldown/untested badge and each
model row a matching status dot, aggregated from the latest results
("Probe all" skips models with an active cooldown and keeps their
previous result).# git install (needs one build allow, see note)
dsh plugin --profile desktop add github:Mortal520/dsh-provider-pro
# or a local checkout / tarball (no build permission needed)
dsh plugin --profile desktop add ./dsh-provider-pro
dsh plugin --profile desktop add ./dsh-provider-pro-0.5.1.tgz # after pnpm pack
git installs run the package's
preparescript. pnpm ≥10 blocks that until you allow it: copy the package key pnpm prints into the profile'spnpm-workspace.yaml(allowBuilds: dsh-provider-pro: true) and re-runadd. Only allow packages you trust — and preferably pin a commit (github:Mortal520/dsh-provider-pro#<sha>).To avoid that step entirely, this repo commits its built
lib/, and tarball/local installs need no build permission at all.
Restart dsh web after installing.
A native settings section right below the official 模型 page:
Effort-level names inside the model picker are hardcoded English in
dsh-llm-pi-ai and cannot be localized by a third-party plugin; our Chinese
labels cover this plugin's own settings section only. In-picker Chinese
requires patching dsh-llm-pi-ai itself.
pnpm install
pnpm run check # typecheck + build + offline artifact validation
pnpm run smoke # host smoke tests (fetch patch / filler / master switch / UA boundary / probe consumer)
pnpm run verify # the above plus a tarball pack (prepack)
lib/ is the build artifact and is committed, so a git install works without
building.
Note:
check/smokevalidate the build output and the host-half logic; they do not cover a real profile install, client-UI rendering, or a live gateway probe. After changing the probe or write paths, re-run a full probe against your actual gateway and restart the desktop app to verify the settings page behavior.
models[] under the llm-pi-ai
namespace; it never touches modelOverrides or catalog models.