@justsilver/opencode-providers 0.3.2-beta.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,36 @@
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.3] - 2026-10-08
11
+
12
+ ### Changed
13
+
14
+ - 技能 CLI:`list` / `list --json` 的**顶层共享模型引用方按供应商去重**(同一家多个模型引用同一 canon 时,不再出现 `r4-coder, r4-coder`)。
15
+ - 技能 CLI:`search` 输出给**供应商 id/名称命中**加标记 `〔供应商 id/名称命中〕`,与「仅其名下模型命中」区分。
16
+ - 技能 CLI:`remove-shared-model` 的**拒绝文案**改为**推荐 `remove-model`**,并说明「纯 `base` 引用直接 `--unset base` 会留下无 limit 的非法模型」。
17
+ - 技能:澄清「**精确命中不用问**,直接 `--base`;**模糊命中(多个/相似)**才用 `"multiple"` 的 `question` 二次确认」;「改名」限定为 **id/key(标识)**(**显示名**走 `set-provider --name` / `set-model --model-name`);判定供应商是否存在**用 `show <id>`**(`search` 是宽松召回,同 token 会假阳性);`set-model` / `set-shared-model` **不能补 `variants`**。
18
+ - 技能 CLI:`search` 改为**宽松匹配(召回优先)**——归一化(大小写、`. _ / \` 与 `-` 等价、词序无关、忽略版本数字)+ token,**一次搜索可能召回多个候选**。
19
+ - 技能:命中**分档**——归一化后相等才 `--base`;**召回多个 / 相似但不同**(如 `glm-5` vs `glm-5-air`)→ 用 `"multiple": true` 的 `question` 把候选动态列出让用户**二次确认**(**模糊命中不标「推荐」**);无命中的「家族标签(lab)」题**动态列出已有 lab** 且**支持多选**;并明确**跨步骤不得沿用上一步的 lab**。
20
+ - 插件:模型**输入模态兜底 `["text"]` → `["text","image"]`**,与 opencode 内核 `Model.Info.default()`(`packages/schema/src/model.ts`)一致;注册表未写 `input` 的模型从此默认支持图片,**纯文本模型必须显式写 `input: ["text"]`**(技能 CLI 传 `--input text`),`output` 兜底仍为 `["text"]`。
21
+
22
+ ## [0.3.2] - 2026-10-08
23
+
24
+ 首个稳定版(并入 `0.3.2-beta.0` / `0.3.2-beta.1` 的全部内容)。
25
+
26
+ ### Fixed
27
+
28
+ - **强制刷新未携带 location → 模型列表不更新**:provider / model 注册**按 location 隔离**(同一个 `/api/model` 按请求目录返回不同结果)。`doRefresh` 调 RPC 时没传 location,于是只刷到服务端**默认目录**,用户所在目录的注册一直停在旧状态。改为 RPC 调用**带上当前 location**(`{ location: { directory } }`);客户端刷新后同时失效并重取 `integration` / `model` / `provider`(`reloadCatalog`)。
29
+
30
+ ### Changed
31
+
32
+ - **技能 CLI:`add-provider` / `add-model` 现在必须声明模型来源(破坏性)**——`--lab <lab>`(建家族 canon `registry/models/<lab>/<model>.json`,参数写进 canon、provider 层只写 `base`)/ `--base <lab>/<model>`(复用已有 canon)/ `--inline`(本家独有,必须自带 limit)。**取消「默认内联」**:不给来源直接报错。判据是「能不能说出造它的 lab」,**独家代理 ≠ 本家独有**。技能在 `search` 没命中任何 canon 时会先问「家族标签(lab)」。
33
+ - 注册表数据:`kimi-k3` 提升为共享模型 `kimi/kimi-k3`,`r4-coder` 改为 `base` 引用。
34
+
35
+ ### Added
36
+
37
+ - 技能 CLI:`--lab-key`(canon 文件名与 provider key 可不同);`check` 新增「参数完全相同的两个 canon(重复家族)」提醒;`remove-provider` / `remove-model` 后**自动清理无人引用的 canon**(并清空空 lab 目录)。
38
+ - (`0.3.2-beta.0`)注册表维护 CLI:复用共享模型(`list`/`search`/`show` 暴露顶层共享模型)、`set-*` 字段补丁 + `--unset`、`remove-*` 安全约束、`check [--strict]`、CLI 拆分 `scripts/lib/` 子模块;CI 增 `registry.mjs check --strict`。
39
+
10
40
  ## [0.3.2-beta.1] - 2026-10-08
11
41
 
12
42
  ### Fixed
@@ -189,7 +219,9 @@
189
219
  - 插件源码从 `.opencode/plugins/opencode-providers/` 移到 `plugin/opencode-providers/`:仓库自身不再是插件发现根,避免在仓库里跑 opencode 时与全局安装的同 id 副本相撞(`Duplicate plugin ID` → 面板里一条 `failed`)
190
220
  - 安装后**通常无需重启**(插件目录被文件监视热重载),不再要求 `opencode service restart`
191
221
 
192
- [Unreleased]: https://github.com/Just-Silver/opencode-providers/compare/v0.3.1...HEAD
222
+ [Unreleased]: https://github.com/Just-Silver/opencode-providers/compare/v0.3.3...HEAD
223
+ [0.3.3]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.3.3
224
+ [0.3.2]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.3.2
193
225
  [0.3.1]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.3.1
194
226
  [0.3.0]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.3.0
195
227
  [0.1.0]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0
package/README.md CHANGED
@@ -28,7 +28,7 @@ OpenCode 的供应商清单来自 models.dev 目录,**目录里没有的供应
28
28
 
29
29
  ```jsonc
30
30
  {
31
- "plugins": ["@justsilver/opencode-providers@0.3.1"]
31
+ "plugins": ["@justsilver/opencode-providers@0.3.2"]
32
32
  }
33
33
  ```
34
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justsilver/opencode-providers",
3
- "version": "0.3.2-beta.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "Register providers missing from the models.dev catalog in OpenCode V2 from a self-hosted registry — no opencode.json needed",
6
6
  "license": "MIT",
@@ -56,7 +56,8 @@ export function buildProviderModels(
56
56
  ...(Object.keys(compatibility).length === 0 ? {} : { compatibility }),
57
57
  capabilities: {
58
58
  tools: resolved.tools ?? true,
59
- input: resolved.input ?? ["text"],
59
+ // 与 opencode 内核 `Model.Info.default()` 一致(packages/schema/src/model.ts):缺省 input = text+image。
60
+ input: resolved.input ?? ["text", "image"],
60
61
  output: resolved.output ?? ["text"],
61
62
  },
62
63
  variants: (resolved.variants ?? []).map((variant) =>