rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Mortal520/dsh-provider-pro
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
给 DeepSeek Harness 里手动添加的自定义供应方(`llm-pi-ai⟫T⟫)补上官方渠道默认就有的三件事:请求级 User-Agent、供应方自己声明的模型能力、以及一次可复现的实测结论。
0.9.16 只有一条规则:上游优先,沉默则保留本地。 供应方在 `/models⟫T⟫ 里声明了上下文窗口、输出上限、推理梯、输入模态中的任何一个,就按它写;没声明、没这个模型、没这个字段,就一个字节都不动。
官方渠道的模型目录自带容量、推理档位与图片能力;手加的自定义供应方只有你得自己填的空行。原生能读一次模型列表(「获取可用模型」),但只覆盖你手动挑选的新条目,也不会替你判断一个中转网关到底认不认 `developer⟫T⟫ 角色、接不接受图片。这个插件补的就是这两块:声明同步(把供应方说的写下来)与 实测(把供应方没说的测出来)。
请求级 User-Agent — 每个供应方一张卡,填了就发,留空保存即清除。发往该供应方 baseURL 前缀的请求会替换(不是追加)User-Agent⟫T⟫,内置 attribution 头随之让位。用于按 UA 限流、或只放行官方终端的网关。值存在插件自有设置项userAgents.
能力声明同步(上游优先) — 供应方被添加或修改时,向该 baseURL 读一次 `GET {base}/models⟫T⟫,把供应方自己声明的值写到模型上:
context_length⟫T⟫、max_completion_tokens⟫T⟫(也认 context_window⟫T⟫、max_input_tokens⟫T⟫、max_output_tokens⟫T⟫、limit.*⟫T⟫ 等写法);reasoning.supported_efforts⟫T⟫,与 DSH 七档取交集、映射别名、补off⟫T⟫。只给 `supports_reasoning: true⟫T⟫ 而没有档位列表时,仅在本地完全没有档位的情况下补 DSH 全档;architecture.input_modalities⟫T⟫ 或顶层input_modalities⟫T⟫(supports_images: true⟫T⟫ 等同)。声明含 image 写['text', 'image']⟫T⟫,只给 text 就写 `['text']⟫T⟫。探测(实测,不猜) — 「一键探测」跑全部,单模型行内的「探测」强制重测这一个。一次探测做三件事:
developer⟫T⟫ 角色,部分中转直接拒(例如 1214)。发一条极小请求实测,被拒而system⟫T⟫ 可用时写 `compat.supportsDeveloperRole: false⟫T⟫,即刻修复;宿主托管的批量探测 — 「一键探测」只提交一个任务,宿主侧并发执行:
probeConcurrency⟫T⟫(1–8,默认 4,可在dsh-provider-pro⟫T⟫ 设置项调);probeCache⟫T⟫ 并镜像进provider_pro⟫T⟫ 存储域(耐久真相),刷新、重启、中断都不丢,新进程启动时回填;同步提示(toast) — 声明同步真的改动了模型时,窗口右下角弹一次「模型能力声明已同步 · 更新 N · 新增 M」(含上游声明的推理梯),卡片没打开也看得见。删除模型不弹——那不是本插件写的。
官方「模型」页下方的原生设置区,样式全部用宿主令牌(`--dsw-alias-*⟫T⟫),跟随主题与深色模式:
# 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.9.16.tgz # 先 pnpm pack
装完重启 DSH Desktop(或 `dsh web⟫T⟫)生效。
git 安装会被 pnpm ≥10 的构建脚本策略拦一次:把 pnpm 提示的包 key 写进 profile 的
pnpm-workspace.yaml⟫T⟫(allowBuilds: { dsh-provider-pro: true }⟫T⟫),再重跑add⟫T⟫。只对可信来源开放,并建议锁定提交(github:Mortal520/dsh-provider-pro#⟫T⟫)。仓库已提交构建产物 `lib/⟫T⟫,tarball 与本地路径安装都不需要这一步。
settings/document-updated⟫T⟫、settings 非 volatile 写入拒绝、storageDomain.defineDomain⟫T⟫、settings.section⟫T⟫ 的register({ id })⟫T⟫、mutate(ns, ops, expectedRevision)⟫T⟫、pi-aireasoningEfforts⟫T⟫。namespaces⟫T⟫ 包装 /{ok, value}⟫T⟫ 信封)、CAS 重试、新旧两个 settings 事件名,全部收在 src/compat.ts⟫T⟫ 一个文件里。历史逐缝审计数据见CHANGELOG.md⟫T⟫。settings.headers⟫T⟫ 是死路。Host 半在宿主进程对globalThis.fetch⟫T⟫ 做一次 baseURL 前缀匹配的最小补丁,命中且该 route 配了覆盖值时替换 UA 头。settings.section⟫T⟫,id: provider-pro⟫T⟫、order: 15⟫T⟫(官方「模型」为 10);toast 走shell.overlay⟫T⟫。dsh-provider-pro⟫T⟫(volatile Config +provider_pro⟫T⟫ 存储域),不污染 pi-ai 的 provider 行;那里只写它自己的 schema 字段。pnpm install
pnpm run check # tsc + 构建 + 离线产物校验
pnpm run smoke # Host 半行为冒烟(18 组)
pnpm run verify # 以上 + pnpm pack
lib/⟫T⟫ 是发布产物,已提交进仓库。check⟫T⟫/`smoke⟫T⟫ 覆盖构建产物与 Host 半逻辑,不覆盖真实 profile 安装、客户端渲染与真实网关;改了探测或写入路径,请对实际网关再跑一次全量探测。
llm-pi-ai⟫T⟫ namespace 下**手声明**的models[]⟫T⟫,不碰 `modelOverrides⟫T⟫ 与官方目录。discoverModels⟫T⟫),差异只在「批量回填已存在的模型」:原生adoptPicked⟫T⟫ 对已存在的 id 保留旧条目、不合并新容量(`client.js:700⟫T⟫)。对话模型选择器内部的档位名写死在 dsh-llm-pi-ai⟫T⟫ 的reasoningInfo()⟫T⟫ 里(Off / Minimal / … / Max),第三方插件无法为其改语言,defaultEffort⟫T⟫ 也不接受中文值。中文只覆盖本插件自己的设置页;要在选择器里中文化,只能改dsh-llm-pi-ai⟫T⟫ 本体。
A DeepSeek Harness plugin for custom providers hand-added through `llm-pi-ai⟫T⟫. It fills the three things official channels get for free: a request-level User-Agent, the model capabilities the vendor itself declares, and a reproducible measurement of what the vendor does not say.
0.9.16 has exactly one rule: the upstream wins, silence keeps the local value. If the vendor declares a context window, an output cap, a reasoning ladder or an input modality for a model, that value is written; if it declares nothing — no model, no field, empty list — nothing on the row is touched.
The official model catalog ships with capacity, reasoning levels and image support baked in; a hand-added provider is an empty row you fill in yourself. Native DSH can fetch a model list once ("Fetch available models"), but it only covers the rows you pick and never tells you whether a relay accepts the `developer⟫T⟫ message role or an image. This plugin covers both halves: declaration sync (write down what the vendor says) and probes (measure what it does not).
Request-level User-Agent — one card per provider; save to apply, empty + save clears it. Requests whose URL starts with that provider baseURL get a replaced (not appended) User-Agent⟫T⟫, so the built-in attribution header steps aside. For gateways that rate-limit by UA or only allow official terminals. Stored in the plugin entry (userAgents.
Capability declaration sync (upstream first) — when a provider is added or changed the plugin reads `GET {base}/models⟫T⟫ once and writes what the vendor declares:
context_length⟫T⟫,max_completion_tokens⟫T⟫ (also context_window⟫T⟫,max_input_tokens⟫T⟫, max_output_tokens⟫T⟫,limit.*⟫T⟫);reasoning.supported_efforts⟫T⟫, intersected with the seven DSH levels, aliases mapped,off⟫T⟫ always included. A bare `supports_reasoning: true⟫T⟫ without a level list only fills a row that has no ladder at all;architecture.input_modalities⟫T⟫ or a top-levelinput_modalities⟫T⟫ (supports_images: true⟫T⟫ counts). Image listed →['text', 'image']⟫T⟫; text only → `['text']⟫T⟫.Probes (measure, do not guess) — "Probe all" runs the batch, the per-model "Probe" button force-measures one. One probe does three things:
developer⟫T⟫ role by default, which some relays refuse (error 1214). A minimal request measures it; on refusal withsystem⟫T⟫ working, `compat.supportsDeveloperRole: false⟫T⟫ is written immediately;Host-owned batch probing — "Probe all" submits one job; the host runs it with a worker pool:
probeConcurrency⟫T⟫ (1-8, default 4, on thedsh-provider-pro⟫T⟫ entry);probeCache⟫T⟫ and is mirrored into theprovider_pro⟫T⟫ storage domain (the durable truth), so reload, restart and interruption lose nothing; a fresh process repopulates from the domain;Sync toast — when a sync actually changed declarations, a frame-wide toast says "Model capability declarations synced · N updated · M new" (reasoning ladders included), visible even when the card is closed. Deleting a model stays silent: that is not this plugin's write.
A native settings section right below the official 模型 page; every control uses host tokens (`--dsw-alias-*⟫T⟫) and follows the theme:
# git install (needs one build allow, see note)
dsh plugin --profile desktop add github:Mortal520/dsh-provider-pro
# local checkout / tarball (no build permission needed)
dsh plugin --profile desktop add ./dsh-provider-pro
dsh plugin --profile desktop add ./dsh-provider-pro-0.9.16.tgz # after pnpm pack
Restart DSH Desktop (or `dsh web⟫T⟫) afterwards.
pnpm ≥10 blocks the build script of a git dependency once: copy the package key pnpm prints into the profile
pnpm-workspace.yaml⟫T⟫ (allowBuilds: { dsh-provider-pro: true }⟫T⟫) and re-runadd⟫T⟫. Only allow sources you trust, and preferably pin a commit (github:Mortal520/dsh-provider-pro#⟫T⟫). The repo commits its built `lib/⟫T⟫, so tarball and local-path installs skip that step entirely.
settings/document-updated⟫T⟫, the non-volatile write refusal,storageDomain.defineDomain⟫T⟫, settings.section⟫T⟫ registration viaregister({ id })⟫T⟫, mutate(ns, ops, expectedRevision)⟫T⟫ and pi-aireasoningEfforts⟫T⟫.namespaces⟫T⟫ wrapper /{ok, value}⟫T⟫ envelope), the shared CAS retry and the old/new settings event names all live in src/compat.ts⟫T⟫. The historical audit data sits inCHANGELOG.md⟫T⟫.settings.headers⟫T⟫ is a dead end. The host half patchesglobalThis.fetch⟫T⟫ once, matching a baseURL prefix and replacing the UA header only when that route has an override.settings.section⟫T⟫ withid: provider-pro⟫T⟫, order: 15⟫T⟫ (official 模型 is 10); the toast ridesshell.overlay⟫T⟫.pnpm install
pnpm run check # tsc + build + offline artifact validation
pnpm run smoke # host-half behaviour smoke (18 groups)
pnpm run verify # the above plus pnpm pack
lib/⟫T⟫ is the published artifact and is committed.check⟫T⟫/`smoke⟫T⟫ cover the build output and the host half, not a real profile install, client rendering or a live gateway; after changing probe or write paths, run a full probe against your actual gateway.
models[]⟫T⟫ under thellm-pi-ai⟫T⟫ namespace; `modelOverrides⟫T⟫ and the official catalog are untouched.discoverModels⟫T⟫); the plugin only adds bulk backfill for existing models, where nativeadoptPicked⟫T⟫ keeps the old entry and never merges newly discovered capacity (`client.js:700⟫T⟫).Effort-level names inside the model picker are hardcoded in reasoningInfo()⟫T⟫ (dsh-llm-pi-ai⟫T⟫) as English Off / Minimal / … / Max; defaultEffort⟫T⟫ rejects Chinese values too. A third-party plugin cannot localize them — our Chinese covers this plugin settings section only. In-picker Chinese would require patchingdsh-llm-pi-ai⟫T⟫ itself.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。