auth.refresh with refreshLead 5 minutes (the in-fetch margin): the CLI renews the sign-in in the account's home (grok models), once per home however many ask, and the token is read back. A token the CLI renewed already is given without running it; no credential left (grok logout) is signIn "expired"; a token the CLI couldn't renew throws and is retried. The check before each request stays for OpenCode, which doesn't call the hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change; HOME=$(mktemp -d) bun test passes (396 across the repo).
17 lines
536 B
JSON
17 lines
536 B
JSON
{
|
|
"name": "@magpie-community/opencode-grok-auth",
|
|
"version": "0.1.6",
|
|
"description": "OpenCode provider plugin: Grok (SuperGrok / X Premium+) through the Grok Build CLI's sign-in",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"exports": "./index.mjs",
|
|
"files": ["index.mjs", "README.md"],
|
|
"keywords": ["opencode", "opencode-plugin", "grok", "xai", "supergrok"],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/grok"
|
|
}
|
|
}
|