@magpie-community/opencode-grok-auth 0.1.4 → 0.1.5

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 +4 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -249,6 +249,10 @@ async function listModels(key) {
249
249
  await sign(headers, key)
250
250
  const res = await fetch(`${BASE}/models`, { headers })
251
251
  const text = await res.text()
252
+ // a token Grok turned away before its time (signed out elsewhere) is a
253
+ // sign-in gone, said as one past its time is: a move takes it along
254
+ // untried rather than stopping on it
255
+ if (res.status === 401) throw new Error("Grok's sign-in has expired; run `grok login`")
252
256
  if (!res.ok) throw new Error(`Grok models: ${res.status} ${text.slice(0, 200)}`)
253
257
  const out = []
254
258
  for (const d of JSON.parse(text)?.data ?? []) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-grok-auth",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "OpenCode provider plugin: Grok (SuperGrok / X Premium+) through the Grok Build CLI's sign-in",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",