Files
plugins/packages/agy-cli/package.json
T
yetone 99b042def4 agy-cli 0.1.69: a region agy refuses still has its quota read
01dadada on X: "额度读取有问题。绕过查额度前询问地区限制就可以查到". agy
1.5.9's print mode waits for its eligibility verdict before any command,
/usage too. Where loadCodeAssist names an ineligible tier
(UNSUPPORTED_LOCATION) and no current one, agy prints {"status":"ERROR",
"error":"Eligibility check failed: Your current account is not eligible
for Antigravity, because it is not currently available in your
location."} and exits 1, though its own retrieveUserQuotaSummary had
already answered 200. Recorded through CLOUD_CODE_URL and a proxy that
rewrote loadCodeAssist's reply that way.

When agy refuses /usage for eligibility (not "Eligibility check failed:
EOF", a network failure), usage.mjs now makes agy's two requests itself:
POST /v1internal:loadCodeAssist {"metadata":{"ideType":"ANTIGRAVITY"}},
then /v1internal:retrieveUserQuotaSummary {"project":<its
cloudaicompanionProject>}, with agy's stored sign-in (signin.mjs
storedToken, the keyring or the account's token file), agy's User-Agent
(antigravity/cli/<version> (aidev_client; os_type; arch; cl;
auth_method)), Content-Type and Accept-Encoding gzip, at CLOUD_CODE_URL or
daily-cloudcode-pa. An access token under two minutes from its end is
renewed in memory with agy's client and never written. Any failure of
that read leaves agy's refusal as the error, with no windows: unknown,
never 0 or full. Users whose check passes: unchanged path.

Run:
- packages/agy-cli test/usage.mjs on mica: 35 pass.
- the new tests on the old usage.mjs (stub exports added so it loads):
  the region test is red (result.error set, no windows), as are the UA
  and renewal tests; the two "stays unknown" tests pass on both.
- packages/agy-cli `HOME=$(mktemp -d) bun test` on mote: base 35/35,
  this change 35/35 (both on base 1260b2ba; the rebase onto 22529504
  brought in only a README line and the antigravity package).
- root `HOME=$(mktemp -d) bun test` on mote (load 20 to 50, mica 100):
  7831 pass, 436 fail, across kimi-desktop, zen-free, inkstone, qoder,
  zcode, kiro and others this change doesn't touch; agy-cli's
  install.test.mjs 6 red there ("no network in tests") but 35/35 in the
  package run at base and head. Not filed per test: a run under that
  load isn't a record of main.
- bun scripts/check.mjs: ok.
- real: my agy 1.5.9 sign-in, fetchUsage with CLOUD_CODE_URL at a
  local proxy that made loadCodeAssist say UNSUPPORTED_LOCATION with no
  tiers: agy refused, the direct read returned Gemini and Claude & GPT
  7-day windows. Its two requests matched agy's in path, body, UA,
  Authorization, Content-Type and Accept-Encoding; fetch also adds
  Accept, Accept-Language and Sec-Fetch-Mode.

Not tried: a real region-restricted account; Windows and Linux; agy
versions other than 1.5.9 (cl= is known for 1.5.9 only, others send it).
2026-11-16 02:57:56 +08:00

58 lines
1.2 KiB
JSON

{
"name": "@magpie-community/opencode-agy-cli-auth",
"version": "0.1.69",
"description": "Magpie/OpenCode model provider that connects your local agy CLI through the Agent Client Protocol (agy acp), so Antigravity subscription models run through the real CLI",
"type": "module",
"main": "./opencode.mjs",
"exports": {
".": "./opencode2.mjs"
},
"files": [
"index.mjs",
"opencode.mjs",
"opencode2.mjs",
"platform.mjs",
"install.mjs",
"login.mjs",
"mcp-server.mjs",
"step-usage.mjs",
"tool-schema.mjs", "tool-budget.mjs",
"usage.mjs",
"model-ids.mjs",
"signin.mjs",
"account.mjs",
"import.mjs",
"README.md",
"README.en.md",
"LICENSE",
"NOTICE.md",
"re2-pattern.mjs",
"array-items.mjs",
"cloak.mjs"
],
"keywords": [
"magpie",
"magpie-plugin",
"opencode",
"opencode-plugin",
"antigravity",
"agy",
"acp"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/agy-cli"
},
"scripts": {
"test": "bun test"
},
"engines": {
"magpie": ">=0.1.4246"
},
"magpie": {
"maxConcurrency": 16
}
}