opencode-magpie-plugin 0.4.1 → 0.4.2

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/README.md CHANGED
@@ -223,6 +223,10 @@ MAGPIE_ADDR=127.0.0.1:3426 opencode --standalone
223
223
 
224
224
  models.dev 缓存写入 `$XDG_CACHE_HOME/opencode-magpie-plugin/models.json`(默认 `~/.cache/opencode-magpie-plugin/models.json`)。首次可只读复用 Magpie、OpenCode 的 `models.json`;下载只写插件自己的目录。每次模型刷新检查缓存,超过 24 小时后台更新,缺价时可提前到 6 小时;同进程下载去重且失败后至少间隔 6 小时重试。首次下载和更新不阻塞模型发现,成功后下一次 30 秒刷新采用新目录;离线保留旧缓存。下载源为 `https://models.dev/api.json`,仍然零运行时依赖,基础价和 context 阶梯价一并传给 OpenCode。
225
225
 
226
+ ### 0.4.2
227
+
228
+ - 修正远端网关下路由组(`auto` / `group`)的 provider 显示名:不再显示为 "routing group",改为 "Magpie"。
229
+
226
230
  ### 0.4.1
227
231
 
228
232
  - 生图 skill 增加回退规则:某模型不可用(额度、积分、不支持的尺寸等)时不重试原模型,改用 `image_list` 中其他模型(优先换 provider),最多尝试三个模型。
package/dist/index.mjs CHANGED
@@ -321,14 +321,20 @@ const nestedProvider = (row) => {
321
321
  const slash = remainder.indexOf("/");
322
322
  if (slash <= 0 || slash === remainder.length - 1) return;
323
323
  const source = remainder.slice(0, slash);
324
+ const routing = source === "auto" || source === "group";
325
+ const parts = row.magpie_label?.split(" · ") ?? [];
326
+ if (routing) return {
327
+ id: `${row.owned_by}/${source}`,
328
+ name: parts.length === 3 ? `Magpie · ${parts[2]}` : `Magpie · ${providerName(row)}`
329
+ };
324
330
  const label = providerName(row);
325
- const sourceName = source === "auto" || source === "group" ? "routing group" : providerName({
331
+ const sourceName = providerName({
326
332
  id: source,
327
333
  owned_by: source
328
334
  });
329
335
  return {
330
336
  id: `${row.owned_by}/${source}`,
331
- name: row.magpie_label?.split(" · ").length === 3 ? label : `${sourceName} · ${label}`
337
+ name: parts.length === 3 ? label : `${sourceName} · ${label}`
332
338
  };
333
339
  };
334
340
  /** Magpie writes context windows as `Claude Opus 5.5 @ 1m`. The picker shows `@1m`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-magpie-plugin",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Discover Magpie providers and models in OpenCode V2 with built-in pricing and automatic local gateway startup",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",