Files
plugins/packages/antigravity/index.mjs
T
yetone 003a38ff44 antigravity 0.2.0: retired, sends nothing and points to Antigravity (local agy CLI)
Google bans accounts it sees calling Code Assist the way this plugin did
(Antigravity's own OAuth client, straight to cloudcode-pa), and as the
plugin magpie offered for Antigravity it was the one everyone installed
(the owner, 11-15: 全部下线,改推 agy-cli). Antigravity is served by
@magpie-community/opencode-agy-cli-auth now, which drives the user's own
agy over ACP.

From 0.2.0 the package makes no request at all. Every request gets a 410
{"error":{"status":"ModelDeprecated","message":"Antigravity: this model
has been retired. …"}} naming Antigravity (local agy CLI) and its magpie
plugin add command; magpie's modelRetired reads that as a retired model,
so a routing group asks its next member. Signing in throws the same
words; there are no models, usage, options or web search. The provider id
stays, so magpie's mover (raised to 0.2.0 there) lands moved users here
and their account rows show the message.

registry.json drops the antigravity entry, so Discover no longer offers
it. agy-cli's cloak.mjs was a copy kept equal to antigravity's by
cloak.test.mjs; it is the only copy now, and the parity tests become
tests of cloak.mjs alone (the invisible-character and REWORDED cases are
kept). agy-cli's version is unchanged (comments and tests only).

What users lose: multi-account rotation, the in-plugin Google sign-in and
account import, AI-credit spending, Antigravity web search, and a
provider that works without agy installed.

Run (mote, temp HOME): bun scripts/check.mjs all ✓; bun test
packages/antigravity packages/agy-cli scripts: 79 pass, 0 fail.
retired.test.mjs replaces fetch with one that throws and checks nothing
was asked on any path. Not tried: a magpie with a moved account on 0.2.0
(done on the magpie side's commit).
2026-11-15 11:10:03 +08:00

77 lines
2.6 KiB
JavaScript

// Antigravity through a Google account, retired (0.2.0).
//
// Up to 0.1.18 this plugin signed in with Antigravity's own Google client
// and sent each request to Code Assist (cloudcode-pa) the way the
// Antigravity app does. Google bans accounts it sees used that way, and
// since this was the plugin magpie offered first, anyone who reached for
// Antigravity in magpie put their account at that risk.
//
// Antigravity is now served by "Antigravity (local agy CLI)",
// @magpie-community/opencode-agy-cli-auth, which runs the agy CLI the user
// installed and signed in to over the Agent Client Protocol (agy acp): the
// requests Google sees are agy's own.
//
// This version sends nothing anywhere. It keeps the provider id so an
// account moved onto it stays listed, and answers every request with a
// 410 that says where Antigravity went: magpie reads it as a retired model,
// so a routing group asks its next member. Signing in is turned away with
// the same words, and there are no models, usage or web search.
const PROVIDER = "antigravity"
const AGY_CLI = "@magpie-community/opencode-agy-cli-auth"
export const RETIRED =
"Antigravity with a Google account has been retired in magpie: Google bans accounts it sees used this way. " +
`Install "Antigravity (local agy CLI)" from Plugins (magpie plugin add ${AGY_CLI}), which runs your own agy CLI over ACP, then remove this plugin.`
// the reply to every request: Gemini's error shape, which magpie and the
// AI SDK read, saying the model has been retired
function retiredResponse() {
const body = {
error: {
code: 410,
status: "ModelDeprecated",
message: `Antigravity: this model has been retired. ${RETIRED}`,
},
}
return new Response(JSON.stringify(body), { status: 410, headers: { "content-type": "application/json" } })
}
export async function AntigravityAuthPlugin() {
return {
config: async (cfg) => {
cfg.provider ??= {}
const was = cfg.provider[PROVIDER] ?? {}
cfg.provider[PROVIDER] = { ...was, name: "Antigravity (retired)", npm: "@ai-sdk/google", models: {} }
},
provider: {
id: PROVIDER,
async models() {
return {}
},
},
auth: {
provider: PROVIDER,
methods: [
{
type: "oauth",
label: "Use Antigravity (local agy CLI) instead",
async authorize() {
throw new Error(RETIRED)
},
},
],
async loader() {
return {
apiKey: "antigravity",
async fetch() {
return retiredResponse()
},
}
},
},
}
}
export const _internal = { RETIRED, retiredResponse }