@magpie-community/opencode-zcode-auth 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/index.mjs +7 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1048,9 +1048,14 @@ export async function ZCodeAuthPlugin({ client }) {
1048
1048
  const start = await onStart(s).catch(() => false)
1049
1049
  const base = start ? START_BASE : s.base
1050
1050
  let ms = modelsOf(await zcodeConfig().catch(() => null), planID(base))
1051
- if (!ms.length) ms = start ? START_MODELS : MODELS
1051
+ // ZCode's config can't be had: its table stands in, and magpie keeps
1052
+ // the list it was told last, as the built-in keeps the one it fetched last
1053
+ const fell = !ms.length
1054
+ if (fell) ms = start ? START_MODELS : MODELS
1052
1055
  const url = s.base + "/v1"
1053
- return Object.fromEntries(ms.map((m) => [m.id, model(m, url)]))
1056
+ const out = Object.fromEntries(ms.map((m) => [m.id, model(m, url)]))
1057
+ if (fell) out[Symbol.for("magpie.fellBack")] = true
1058
+ return out
1054
1059
  },
1055
1060
  },
1056
1061
  auth: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-zcode-auth",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "OpenCode provider plugin: signs in to Z.ai's or BigModel's (智谱) GLM Coding Plan as ZCode does, including team seats and ZCode's Start Plan",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",