dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH 插件:自动同步 opencode-go 模型清单到 pi-ai catalog,按官方文档精确标记协议(anthropic-messages / openai-completions / openai-responses)与多模态支持
⛔ 已废弃(DEPRECATED):本插件自 pi-ai 1.x 起不再需要,已停止维护。 pi-ai ≥ 1.0 自带的
scripts/generate-models.ts --strict会在发布时生成完整、准确的dist/providers/data/opencode-go.json(协议 / 价格 / 多模态齐全)。本插件的 catalog 格式 假设与 pi-ai 1.x 的chat:<id>格式不兼容,继续使用会写坏文件,且其硬编码的协议 / 价格表 已过时。请勿安装或继续使用,改用升级 pi-ai 获取最新模型清单。 迁移说明见 RELEASE.md。
DSH 插件 – 同步 OpenCode Go 套餐的模型清单,并基于精确的家族配置标记多模态(图像/视频)支持。
🌏 语言 / Language:中文 · English
⚠️ 范围声明:本插件仅覆盖 OpenCode Go 订阅套餐 (端点
https://opencode.ai/zen/go/v1)。OpenCode Zen 另有主套餐 (端点https://opencode.ai/zen/v1),其模型清单、每 1M tokens 按量价格、 计费模式(按量付费 vs Go 的订阅制)和弃用节奏均与 Go 不同——本插件 不处理 Zen 主套餐,请勿将本插件的模型/价格数据套用到/zen/v1。
https://opencode.ai/zen/go/v1/models 获取最新模型列表data/opencode-go.json)对比,计算新增/下线模型api 字段,按 opencode.ai 文档端点分配
anthropic-messages / openai-completions / openai-responses,绝不强制统一协议input: ['text', 'image'] 仅授予官方确认的视觉模型@deepseek-ai/dsh-atomic-write:withFileLock 跨进程写锁 +
writeFileAtomic(排除性临时文件 + rename 原子提交),任何失败旧文件保持完好dsh-opencode-go-models)npx @deepseek-ai/dsh plugin --profile web add dsh-opencode-go-models
装完重启 dsh 生效(bundle 层变更);发布包内含 cordis.patch.yml,
dsh.bundle 声明随包生效,无需手工 patch
升级/指版本:npx @deepseek-ai/dsh plugin --profile web add dsh-opencode-go-models@<版本>
国内网络若等不到镜像同步,用官方源(同样经由 CLI,无需手工进目录):
npx @deepseek-ai/dsh plugin --profile web add dsh-opencode-go-models --registry=https://registry.npmjs.org
git clone <your-repo-url>
cd dsh-opencode-go-models
pnpm install # 或 npm install
pnpm run build
npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-opencode-go-models
本地安装后,编辑 ~/.dsh/profiles/web/cordis.patch.yml 追加:
- insert:
- id: dsh-opencode-go-models
name: 'dsh-opencode-go-models'
patch 层经 HMR 热生效,无需重启;但模型列表的同步结果仍需重启 dsh(catalog 启动时加载)。
在 DSH 对话中:
请帮我同步 opencode-go 的模型列表请预览 opencode-go 模型同步的变更kimi-k3 支持图片输入吗?恢复 opencode-go 模型清单(撤销插件对 catalog 的全部修改)插件默认在加载时自动同步,但受冷却窗口节制(默认 12 小时,可配置): 冷却期内启动零网络、零写盘;超窗才拉取线上清单比对,仅在确有差异时 写入 catalog 并提示"重启后生效"。凭据缺失/网络失败只记日志跳过,不影响插件加载。
手动同步(sync_opencode_models)始终可用,与自动同步共享同一套原子写路径;
冷却期在自动检查与手动同步后都会刷新。
调整自动同步的 patch 配置示例:
- insert:
- id: dsh-opencode-go-models
name: 'dsh-opencode-go-models'
config:
autoSync: true # 默认 true;false 关闭自动同步
autoSyncIntervalHours: 12 # 冷却窗口(小时)
官方文档(develop/basic)规定:通过 ctx 注册的监听/工具/定时器在插件卸载时会被
自动清理;需要手动管理的资源用 ctx.effect() 注册清理函数。本插件修改的是持久
文件(catalog),采用备份 + 卸载恢复方案:
opencode-go.json.dsh-backup.json
(内容含 original 原文件与 ours 插件写入版本)cordis.patch.yml / package.json)引用本插件——patch 层被移除或依赖被删除
(真卸载)→ 把备份整体写回;HMR 重载 / 普通关停 / 换 profile(仍被引用)→
不恢复,避免每次重启丢失已同步模型恢复 opencode-go 模型清单 → reset_opencode_models 工具data/*.json(含本插件写入的模型),升级后重新同步即可openai-completions 兜底(/v1 端点原生 OpenAI 兼容)⛔ DEPRECATED: As of pi-ai 1.x this plugin is no longer needed and is unmaintained. pi-ai >= 1.0 ships a complete, accurate
dist/providers/data/opencode-go.json(generated byscripts/generate-models.ts --strict) covering all current Go models with correct protocols, pricing, and modalities. This plugin's catalog-format assumption is incompatible with pi-ai 1.x (chat:<id>keys) and its hardcoded metadata is stale. Do not install or use it — upgrade pi-ai instead. See RELEASE.md for migration details.
DSH plugin – syncs the model catalog of the OpenCode Go plan and flags multimodal (image/video) support based on accurate family configuration.
⚠️ Scope: This plugin covers only the OpenCode Go subscription plan (endpoint
https://opencode.ai/zen/go/v1). OpenCode Zen also has a main plan (endpointhttps://opencode.ai/zen/v1); its model list, per-1M-token usage prices, billing model (pay-as-you-go vs Go's subscription) and deprecation cadence all differ from Go's — this plugin does not handle the Zen main plan; do not apply this plugin's model/price data to/zen/v1.
https://opencode.ai/zen/go/v1/models for the latest model listdata/opencode-go.json) and reports added/removed modelsapi field, assigned per the opencode.ai documented endpoints as
anthropic-messages / openai-completions / openai-responses — never forced onto one uniform protocolinput: ['text', 'image'] is granted only to officially confirmed vision models@deepseek-ai/dsh-atomic-write: withFileLock cross-process write lock +
writeFileAtomic (exclusive temp file + atomic rename commit); on any failure the old file stays intactdsh-opencode-go-models is published)npx @deepseek-ai/dsh plugin --profile web add dsh-opencode-go-models
Restart dsh after installing to take effect (bundle-layer change); the published package ships cordis.patch.yml,
and the dsh.bundle declaration takes effect with the package — no manual patching needed
Upgrade / pin a version: npx @deepseek-ai/dsh plugin --profile web add dsh-opencode-go-models@<version>
If the mirror does not sync in time on a domestic network, use the official registry (still via the CLI, no need to go into the directory manually):
npx @deepseek-ai/dsh plugin --profile web add dsh-opencode-go-models --registry=https://registry.npmjs.org
git clone <your-repo-url>
cd dsh-opencode-go-models
pnpm install # or npm install
pnpm run build
npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-opencode-go-models
After a local install, append to ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
- id: dsh-opencode-go-models
name: 'dsh-opencode-go-models'
The patch layer hot-applies via HMR — no restart needed; but the synced model list still requires a dsh restart (the catalog loads at startup).
In a DSH conversation:
请帮我同步 opencode-go 的模型列表请预览 opencode-go 模型同步的变更kimi-k3 支持图片输入吗?恢复 opencode-go 模型清单 (undoes all plugin modifications to the catalog)The plugin auto-syncs by default on load, gated by a cooldown window (default 12 h, configurable): within the cooldown, startup does zero network I/O and zero disk writes; only after the window does it fetch the online list and diff — it writes to the catalog only when there is an actual difference and then hints "restart to take effect". Missing credentials / network failures are merely logged and skipped, without affecting plugin load.
Manual sync (sync_opencode_models) is always available and shares the same atomic-write path with
auto-sync; the cooldown refreshes after both the automatic check and a manual sync.
Example patch config to tune auto-sync:
- insert:
- id: dsh-opencode-go-models
name: 'dsh-opencode-go-models'
config:
autoSync: true # default true; false disables auto-sync
autoSyncIntervalHours: 12 # cooldown window (hours)
Per the official docs (develop/basic): listeners/tools/timers registered through ctx are cleaned up
automatically when the plugin unloads; resources managed manually should be registered with ctx.effect().
This plugin modifies a persistent file (the catalog) and uses a backup + restore-on-uninstall scheme:
opencode-go.json.dsh-backup.json
(containing original — the untouched file — and ours — the version the plugin wrote)cordis.patch.yml / package.json) still references this plugin — when the patch layer is removed or the
dependency is deleted (a true uninstall) → the backup is written back whole; on HMR reload / normal shutdown /
profile switch (still referenced) → no restore, so synced models are not lost on every restart恢复 opencode-go 模型清单 → reset_opencode_models tooldata/*.json (including the models this plugin wrote) — just resync after upgradingopenai-completions (the /v1 endpoint is natively OpenAI-compatible)