Files
plugins/packages/agy-cli/test
yetone 9907c187b2 agy-cli 0.1.68: bring in the retired Antigravity plugin's accounts
A user asked on X (@tongzhenbao) to move the accounts signed in on the
retired Antigravity plugin (provider "antigravity") into agy-cli in one
click. That plugin signed in with Antigravity's own Google OAuth client
(1071006060591-tmhssin2h21lcre235vtolojh4g403ep), and agy's own
`agy acp --login` link uses the same client id, so agy can take those
refresh tokens as its own: nothing is sent anywhere agy doesn't already
send its sign-in, and no other client is spoken for.

auth.import (magpie's "Import accounts from a file…") now takes:
- the old plugin's saved oauth entry, one, a list or plugin-auth.json's
  map of them (refresh "<token>|<project>", accountId = email);
- agy's own token file / keyring value (go-keyring-base64: prefix too).
A bare refresh token or another tool's export is refused, since it may be
another client's. Each account gets its own agy home with the token file
agy writes (0600), and is added only once `agy models` runs there; one agy
refuses leaves no home. An account already signed in (same email) gives
its existing key back.

Run:
- mote: packages/agy-cli `HOME=$(mktemp -d) bun test`: smoke, signin,
  cloak, install all pass; test/usage.mjs red (3 of 30, different each
  run) and red the same way on pristine origin/main e5cb9598 (8 and 9
  of 30, two runs on mote), green on ubuntu CI; filed separately.
- the new smoke checks are red on the old index.mjs ("plugin.auth.import
  is not a function").
- bun scripts/check.mjs: ok.
- real account, sandbox HOME: the owner's live old-plugin entry copied
  into a sandbox .gemini/antigravity-cli/antigravity-oauth-token;
  `SSH_CONNECTION=… agy models` listed the models and agy refreshed the
  file in the same shape (refresh token not rotated).

Not tried: the import through a running magpie with a real account
(magpie's Providers-page Move comes in a magpie release).
2026-11-16 01:29:08 +08:00
..