plugin: Antigravity's plugin keeps serving whoever has it, and is given to nobody new
The owner (11-15): "正在使用的继续正常,加个提示,新用户不让下载". Google suspends accounts it sees on Code Assist through Antigravity's own client, so9cd5f3652retired the plugin outright (0.2.0 answered every request with a 410). Now its users keep it working and are told the risk; nobody new gets it. - internal/plugin/withdrawn.go: a list of withdrawn packages (Antigravity's, pointing to agy-cli). plugin.Add, the one place the CLI, the GUI, Discover and import links install through, turns a withdrawn package away unless this magpie has it listed already (on or off), and says what to use instead. Upgrade and AddExact (backup, sync) are not gated: they act on a plugin the user has. - The mover installs it for the user's own accounts (move, keepMovedCurrent) under plugin.KeepWithdrawn; Adopt, which brings no accounts, is a new user and is turned away. Antigravity's min is 0.2.1, plugins c0c625ac: the 0.1.18 plugin restored, out of the registry. - /api/providers lists the withdrawn plugins kept in `withdrawn`, and the Providers page draws a line over the list: the risk, why, and "Use Antigravity (local agy CLI)", which opens Plugins on "agy". New strings in zh, zh-TW, ja and de. depLine() now draws all three kinds of Providers line (discovery off, unmoved, this one), which keeps app.js inside its budget without a raise. - AGENTS.md, provider-plugins.md and the site's subscriptions docs (en, zh, ja, search index) say the plugin keeps working for its users and is withdrawn for anyone new. Run on mote at this tree (base52e83f7b5). After the rebase onto500f39886(testenv, qianfan, LESSONS upstream), again at this head: go vet and go test -count=1 of internal/plugin, internal/provider, internal/gui, internal/testenv and the root package, all ok. Before it: - go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet of internal/plugin, internal/provider and internal/gui: ok. gofmt -l clean. - go test -count=1 ./internal/plugin ./internal/provider ./internal/gui (whole packages, TestCoreScriptBudget and the i18n guards in them): ok. - node --test providers-withdrawn (new; chromium and webkit, en zh zh-TW ja de, 1100 and 420), deprecation-notice, plugin-move, plugin-move-overflow, retired-move, deprecated-subscriptions, i18n-keys, providers-discovery-off, plugin-movable-review, providers-off-fold: ok. plugin-move-unserved's 'Try again takes the models unticked' is red 4 of 4, the same at origin/main500f39886alone: #4410. - Broken by hand: without RefuseWithdrawn in Add, TestWithdrawnGivenToNobodyNew goes red (Add goes on to install); without KeepWithdrawn in move, TestWithdrawnPluginKeptForItsUsers goes red (the user's own move is turned away). - Plugins: bun scripts/check.mjs all and bun test packages/antigravity packages/agy-cli scripts, 195 pass; dist index.json has 0.2.1. Not tried: a real Antigravity account through 0.2.1 (it is 0.1.18's code, which served until 11-15), and the CLI/TUI show no notice beyond Add's refusal.
This commit is contained in:
@@ -80,16 +80,20 @@ Two cases decide it:
|
||||
subscription in the table above is retired (10-17; Antigravity 11-15);
|
||||
gates ask `provider.PluginServes(id)` (moved or retired). Gemini CLI
|
||||
(`gemini`) and the agy agent stay built in.
|
||||
- **Antigravity is off entirely** (the owner, 11-15): Google bans
|
||||
accounts it sees on Code Assist through Antigravity's own client, the
|
||||
built-in's way and the plugin's alike. The built-in's code is still in
|
||||
the tree, but `googleLogins` lists nothing once the plugin serves it, so
|
||||
it asks Google for nothing; the mover reads `googleSavedLogins`. The
|
||||
plugin's 0.2.0 (the mover's min) sends nothing either: every request
|
||||
gets a 410 "retired" naming Antigravity (local agy CLI),
|
||||
`@magpie-community/opencode-agy-cli-auth`, which runs the user's own
|
||||
agy over ACP, and it left the registry. Don't bring either route back.
|
||||
The route's tests serve it again through
|
||||
- **Antigravity's plugin is withdrawn for anyone new** (the owner, 11-15:
|
||||
正在使用的继续正常,加个提示,新用户不让下载): Google bans accounts it
|
||||
sees on Code Assist through Antigravity's own client. The built-in's code
|
||||
is still in the tree, but `googleLogins` lists nothing once the plugin
|
||||
serves it, so it asks Google for nothing; the mover reads
|
||||
`googleSavedLogins`. The plugin (0.2.1, the mover's min) serves as
|
||||
before for whoever has it, and the Providers page tells them the risk
|
||||
and points to Antigravity (local agy CLI),
|
||||
`@magpie-community/opencode-agy-cli-auth`, which runs the user's own agy
|
||||
over ACP (`withdrawn` in `/api/providers`). `plugin.Add` turns it away
|
||||
for anyone who doesn't have it listed (`plugin.RefuseWithdrawn`); the
|
||||
mover installs it for the user's own accounts under
|
||||
`plugin.KeepWithdrawn`, and it left the registry. Don't offer it to
|
||||
anyone new. The built-in route's tests serve it again through
|
||||
`provider.AntigravityBuiltinForTest()` until its code is taken out
|
||||
(#6723).
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ The `movers` map assembled in `internal/provider/migrate*.go` is the authoritati
|
||||
|
||||
`provider.Moved(id)` identifies a subscription whose migration state in `migrations.json` is `plugin`. In `/api/providers`, its row exposes `move.state == "plugin"`; the GUI also receives its id in `onPlugins`.
|
||||
|
||||
A retired built-in (`retiredBuiltins` in [`migrate.go`](../../internal/provider/migrate.go), `provider.BuiltinRetired(id)`) has no built-in code left: the plugin serves it whether or not a move has run, and its row's `move.state` is `plugin`. Gates that once asked `Moved(id)` ask `provider.PluginServes(id)`, which is moved or retired. Built-in accounts of a retired subscription that haven't moved yet are served by nothing; `/api/providers` lists them in `unmoved` (each a `MoveCandidate`, with the failed move's `error` and `why`), and the GUI shows a line over the Providers list with a Move button (`unmovedLine` in `app.js`). Built-ins are retired one at a time, each in the commit that removes its code. Antigravity is the exception (11-15): retired before its code is removed, it is kept from Google by `googleLogins`, which lists no account of a subscription its plugin serves (the mover reads `googleSavedLogins`), and its plugin's 0.2.0 answers every request with a 410 that points to Antigravity (local agy CLI).
|
||||
A retired built-in (`retiredBuiltins` in [`migrate.go`](../../internal/provider/migrate.go), `provider.BuiltinRetired(id)`) has no built-in code left: the plugin serves it whether or not a move has run, and its row's `move.state` is `plugin`. Gates that once asked `Moved(id)` ask `provider.PluginServes(id)`, which is moved or retired. Built-in accounts of a retired subscription that haven't moved yet are served by nothing; `/api/providers` lists them in `unmoved` (each a `MoveCandidate`, with the failed move's `error` and `why`), and the GUI shows a line over the Providers list with a Move button (`unmovedLine` in `app.js`). Built-ins are retired one at a time, each in the commit that removes its code. Antigravity is the exception (11-15): retired before its code is removed, it is kept from Google by `googleLogins`, which lists no account of a subscription its plugin serves (the mover reads `googleSavedLogins`), and its plugin is withdrawn for anyone new: `plugin.Add` refuses a withdrawn package this magpie doesn't have listed (`withdrawn` in [`withdrawn.go`](../../internal/plugin/withdrawn.go), `RefuseWithdrawn`), the mover installs it for the user's own accounts under `plugin.KeepWithdrawn`, and `/api/providers` lists the ones kept in `withdrawn`, which the GUI shows as a line over the Providers list pointing to Antigravity (local agy CLI).
|
||||
|
||||
| Operation | Built-in owns the subscription | Plugin owns the subscription |
|
||||
| --- | --- | --- |
|
||||
|
||||
+23
-28
@@ -6508,22 +6508,23 @@ function renderMovable() {
|
||||
let hid = "";
|
||||
try { hid = localStorage.getItem("magpie.deprecatedHidden") || ""; } catch {}
|
||||
const ids = ps.map((p) => p.id).join(",");
|
||||
const unmoved = providers.unmoved || [];
|
||||
const unmoved = providers.unmoved || [], wd = providers.withdrawn || [];
|
||||
const noSubs = !!(state?.settings?.noAccountDiscovery || prefs?.noAccountsEnv);
|
||||
box.hidden = (!ps.length || hid === ids) && !unmoved.length && !noSubs;
|
||||
box.hidden = (!ps.length || hid === ids) && !unmoved.length && !wd.length && !noSubs;
|
||||
if (noSubs) box.append(discoveryOffLine());
|
||||
for (const p of unmoved) box.append(unmovedLine(p));
|
||||
// a plugin magpie gives nobody new (plugin.WithdrawnOf): it still
|
||||
// works, and its user is told the risk and what to use instead
|
||||
for (const w of wd) {
|
||||
const go = el("button", "text action", t("Use {name}", { name: w.instead }));
|
||||
go.onclick = () => openPlugins("agy");
|
||||
box.append(depLine("withdrawn", t("{name}'s plugin can get your account suspended", { name: w.name }), t("Google suspends accounts it sees used outside its own app. {name} runs your own agy instead.", { name: w.instead }), go));
|
||||
}
|
||||
if (!ps.length || hid === ids) return;
|
||||
const names = ps.map((p) => p.name).join(t(", "));
|
||||
// one quiet line over the list, as calm as its rows: an amber dot, what
|
||||
// happened and why, and the two answers on the right (the owner: 这个太丑了 —
|
||||
// it was a tinted box with a tile, a badge, three lines and a purple button)
|
||||
const card = el("div", "deprecation");
|
||||
card.setAttribute("role", "note");
|
||||
const body = el("div", "dep-body");
|
||||
body.append(el("div", "dep-head", ps.length > 1 ? t("These built-in subscriptions are deprecated: {names}", { names }) : t("{name}'s built-in subscription is deprecated", { name: names })),
|
||||
el("p", "dep-why", [t(DEPRECATED_WHY), t("Moving keeps your accounts, models and agents as they are.")].join(locale === "zh" || locale === "zh-TW" || locale === "ja" ? "" : " ")));
|
||||
const acts = el("div", "dep-acts");
|
||||
const hide = el("button", "text", t("Not now"));
|
||||
hide.title = t("Hide this until another deprecated subscription is signed in");
|
||||
hide.onclick = () => { try { localStorage.setItem("magpie.deprecatedHidden", ids); } catch {} renderMovable(); };
|
||||
@@ -6533,24 +6534,25 @@ function renderMovable() {
|
||||
if (ps.length > 1) { openPlugins(); return; }
|
||||
editing = ps[0].id; draft = null; renderProviders();
|
||||
};
|
||||
acts.append(hide, review);
|
||||
card.append(el("span", "dep-dot"), body, acts);
|
||||
box.append(card);
|
||||
box.append(depLine("", ps.length > 1 ? t("These built-in subscriptions are deprecated: {names}", { names }) : t("{name}'s built-in subscription is deprecated", { name: names }), [t(DEPRECATED_WHY), t("Moving keeps your accounts, models and agents as they are.")].join(locale === "zh" || locale === "zh-TW" || locale === "ja" ? "" : " "), hide, review));
|
||||
}
|
||||
|
||||
// discoveryOffLine: subscription accounts are off in Settings › Privacy,
|
||||
// so none of them works; said here, with the way to the switch
|
||||
function discoveryOffLine() {
|
||||
const card = el("div", "deprecation discovery-off");
|
||||
card.setAttribute("role", "note");
|
||||
const body = el("div", "dep-body");
|
||||
body.append(el("div", "dep-head", t("Subscription accounts are off")),
|
||||
el("p", "dep-why", prefs?.noAccountsEnv ? t("Off for this run: MAGPIE_NO_ACCOUNTS is set") : t("magpie reads none of your agents' sign-ins, so no subscription works. API-key providers work as before.")));
|
||||
const acts = el("div", "dep-acts");
|
||||
const go = el("button", "text action", t("Settings › Privacy"));
|
||||
go.onclick = (e) => openSettingsAt(e, "privacy", "#discoveryList .row");
|
||||
acts.append(go);
|
||||
card.append(el("span", "dep-dot"), body, acts);
|
||||
return depLine("discovery-off", t("Subscription accounts are off"), prefs?.noAccountsEnv ? t("Off for this run: MAGPIE_NO_ACCOUNTS is set") : t("magpie reads none of your agents' sign-ins, so no subscription works. API-key providers work as before."), go);
|
||||
}
|
||||
|
||||
// depLine: one quiet line over the Providers list: an amber dot, what
|
||||
// happened and why, and its buttons on the right
|
||||
function depLine(kind, head, why, ...acts) {
|
||||
const card = el("div", "deprecation " + kind), body = el("div", "dep-body"), a = el("div", "dep-acts");
|
||||
card.setAttribute("role", "note");
|
||||
body.append(el("div", "dep-head", head), el("p", "dep-why", why));
|
||||
a.append(...acts);
|
||||
card.append(el("span", "dep-dot"), body, a);
|
||||
return card;
|
||||
}
|
||||
|
||||
@@ -6559,15 +6561,8 @@ function discoveryOffLine() {
|
||||
// An amber dot, what happened and why, and the move, tried again here.
|
||||
const unmovedSaid = {}; // provider id → { busy } or { why }
|
||||
function unmovedLine(p) {
|
||||
const card = el("div", "deprecation unmoved");
|
||||
card.setAttribute("role", "note");
|
||||
card.dataset.id = p.id;
|
||||
const body = el("div", "dep-body");
|
||||
const said = unmovedSaid[p.id];
|
||||
const why = said?.why || moveWhy(p, p);
|
||||
body.append(el("div", "dep-head", t("{name}'s built-in subscription is retired, and its accounts haven't moved to its plugin yet", { name: p.name })),
|
||||
el("p", "dep-why", why ? t("Nothing serves them until they move: {error}", { error: why }) : t("Nothing serves them until they move. Moving keeps your accounts, models and agents as they are.")));
|
||||
const acts = el("div", "dep-acts");
|
||||
const b = el("button", "text action", said?.busy || (why ? t("Try again") : t("Move to the plugin")));
|
||||
b.title = p.package; // the npm package: for the curious, not the sentence
|
||||
b.disabled = b.classList.toggle("busy", !!said?.busy);
|
||||
@@ -6584,8 +6579,8 @@ function unmovedLine(p) {
|
||||
renderMovable();
|
||||
}
|
||||
};
|
||||
acts.append(b);
|
||||
card.append(el("span", "dep-dot"), body, acts);
|
||||
const card = depLine("unmoved", t("{name}'s built-in subscription is retired, and its accounts haven't moved to its plugin yet", { name: p.name }), why ? t("Nothing serves them until they move: {error}", { error: why }) : t("Nothing serves them until they move. Moving keeps your accounts, models and agents as they are."), b);
|
||||
card.dataset.id = p.id;
|
||||
return card;
|
||||
}
|
||||
|
||||
|
||||
@@ -1458,6 +1458,8 @@ const I18N = {
|
||||
"Every subscription stops working in magpie until this is on again: magpie reads none of the sign-ins they come from. API-key providers work as before.": "所有订阅都将在 magpie 里停止工作,直到重新开启:magpie 不再读取它们所来自的登录。API Key 服务商照常可用。",
|
||||
"Off for this run: MAGPIE_NO_ACCOUNTS is set": "本次运行已关闭:设置了 MAGPIE_NO_ACCOUNTS",
|
||||
"Subscription accounts are off": "订阅账号已关闭",
|
||||
"{name}'s plugin can get your account suspended": "{name} 插件可能导致账号被封",
|
||||
"Google suspends accounts it sees used outside its own app. {name} runs your own agy instead.": "Google 会封禁在其官方应用之外使用的账号。{name} 改用你自己的 agy 运行。",
|
||||
"magpie reads none of your agents' sign-ins, so no subscription works. API-key providers work as before.": "magpie 不读取你的智能体的任何登录,所以订阅都用不了。API Key 服务商不受影响。",
|
||||
"Read the accounts your agents are signed in to (Claude Code, Codex, Copilot, Cursor and others: their files and the Keychain) and serve them. Off, magpie reads none of them; API-key providers work as before": "读取你的智能体已登录的账号(Claude Code、Codex、Copilot、Cursor 等:它们的文件和钥匙串)并提供服务。关闭后 magpie 一个都不读;API Key 服务商照常可用",
|
||||
"subscription accounts are off in magpie (Settings → Privacy, or `magpie accounts discovery on`)": "magpie 里的订阅账号已关闭(设置 → 隐私,或 `magpie accounts discovery on`)",
|
||||
@@ -6795,6 +6797,8 @@ const I18N = {
|
||||
"Every subscription stops working in magpie until this is on again: magpie reads none of the sign-ins they come from. API-key providers work as before.": "所有訂閱都將在 magpie 中停止運作,直到重新開啟:magpie 不再讀取它們所來自的登入。API Key 服務商照常可用。",
|
||||
"Off for this run: MAGPIE_NO_ACCOUNTS is set": "本次執行已關閉:設定了 MAGPIE_NO_ACCOUNTS",
|
||||
"Subscription accounts are off": "訂閱帳號已關閉",
|
||||
"{name}'s plugin can get your account suspended": "{name} 外掛可能導致帳號被停權",
|
||||
"Google suspends accounts it sees used outside its own app. {name} runs your own agy instead.": "Google 會停權在其官方應用之外使用的帳號。{name} 改用你自己的 agy 執行。",
|
||||
"magpie reads none of your agents' sign-ins, so no subscription works. API-key providers work as before.": "magpie 不讀取你的智能體的任何登入,所以訂閱都用不了。API Key 服務商不受影響。",
|
||||
"Read the accounts your agents are signed in to (Claude Code, Codex, Copilot, Cursor and others: their files and the Keychain) and serve them. Off, magpie reads none of them; API-key providers work as before": "讀取你的智慧體已登入的帳號(Claude Code、Codex、Copilot、Cursor 等:它們的檔案和鑰匙圈)並提供服務。關閉後 magpie 一個都不讀;API Key 服務商照常可用",
|
||||
"subscription accounts are off in magpie (Settings → Privacy, or `magpie accounts discovery on`)": "magpie 中的訂閱帳號已關閉(設定 → 隱私,或 `magpie accounts discovery on`)",
|
||||
@@ -12092,6 +12096,8 @@ const I18N = {
|
||||
"Every subscription stops working in magpie until this is on again: magpie reads none of the sign-ins they come from. API-key providers work as before.": "再びオンにするまで、すべてのサブスクリプションが magpie で使えなくなります。magpie はそれらのサインインを一切読み取りません。API キーのプロバイダーはこれまでどおり使えます。",
|
||||
"Off for this run: MAGPIE_NO_ACCOUNTS is set": "この実行ではオフ:MAGPIE_NO_ACCOUNTS が設定されています",
|
||||
"Subscription accounts are off": "サブスクリプションアカウントはオフです",
|
||||
"{name}'s plugin can get your account suspended": "{name} のプラグインはアカウント停止の原因になることがあります",
|
||||
"Google suspends accounts it sees used outside its own app. {name} runs your own agy instead.": "Google は公式アプリ以外で使われたアカウントを停止します。{name} は代わりにあなた自身の agy で動きます。",
|
||||
"magpie reads none of your agents' sign-ins, so no subscription works. API-key providers work as before.": "magpie はエージェントのサインインを一切読まないため、サブスクリプションはどれも使えません。API キーのプロバイダーはこれまでどおり使えます。",
|
||||
"Read the accounts your agents are signed in to (Claude Code, Codex, Copilot, Cursor and others: their files and the Keychain) and serve them. Off, magpie reads none of them; API-key providers work as before": "エージェントがサインインしているアカウント(Claude Code、Codex、Copilot、Cursor など:そのファイルとキーチェーン)を読み取って提供します。オフにすると magpie はどれも読みません。API キーのプロバイダはこれまでどおり使えます",
|
||||
"subscription accounts are off in magpie (Settings → Privacy, or `magpie accounts discovery on`)": "magpie のサブスクリプションアカウントはオフです(設定 → プライバシー、または `magpie accounts discovery on`)",
|
||||
@@ -17424,6 +17430,8 @@ const I18N = {
|
||||
"Every subscription stops working in magpie until this is on again: magpie reads none of the sign-ins they come from. API-key providers work as before.": "Alle Abos funktionieren in magpie nicht mehr, bis dies wieder an ist: magpie liest keine der Anmeldungen, aus denen sie kommen. Anbieter mit API-Schlüssel funktionieren wie bisher.",
|
||||
"Off for this run: MAGPIE_NO_ACCOUNTS is set": "Für diesen Lauf aus: MAGPIE_NO_ACCOUNTS ist gesetzt",
|
||||
"Subscription accounts are off": "Abo-Konten sind aus",
|
||||
"{name}'s plugin can get your account suspended": "Das Plugin von {name} kann dein Konto sperren lassen",
|
||||
"Google suspends accounts it sees used outside its own app. {name} runs your own agy instead.": "Google sperrt Konten, die es außerhalb seiner eigenen App sieht. {name} nutzt stattdessen dein eigenes agy.",
|
||||
"magpie reads none of your agents' sign-ins, so no subscription works. API-key providers work as before.": "magpie liest keine Anmeldung Ihrer Agenten, daher funktioniert kein Abo. Anbieter mit API-Schlüssel funktionieren wie bisher.",
|
||||
"Read the accounts your agents are signed in to (Claude Code, Codex, Copilot, Cursor and others: their files and the Keychain) and serve them. Off, magpie reads none of them; API-key providers work as before": "Die Konten lesen, bei denen deine Agenten angemeldet sind (Claude Code, Codex, Copilot, Cursor und andere: ihre Dateien und der Schlüsselbund), und sie bereitstellen. Aus liest magpie keines davon; Anbieter mit API-Schlüssel funktionieren wie bisher",
|
||||
"subscription accounts are off in magpie (Settings → Privacy, or `magpie accounts discovery on`)": "Abo-Konten sind in magpie aus (Einstellungen → Datenschutz, oder `magpie accounts discovery on`)",
|
||||
|
||||
@@ -830,6 +830,9 @@ type providersJSON struct {
|
||||
// Unmoved are the retired built-ins whose accounts haven't moved onto
|
||||
// their plugins yet, served by nothing until they do, with why
|
||||
Unmoved []provider.MoveCandidate `json:"unmoved,omitempty"`
|
||||
// Withdrawn are the plugins this magpie still has that magpie gives
|
||||
// to nobody new, for the page to say the risk and what to use instead
|
||||
Withdrawn []plugin.Withdrawal `json:"withdrawn,omitempty"`
|
||||
// Moved is the agents the change moved off models it stopped serving
|
||||
// (agent.Reseat), for the page to say so.
|
||||
Moved []agent.Move `json:"moved,omitempty"`
|
||||
@@ -1480,6 +1483,7 @@ func providersState() providersJSON {
|
||||
s.Unmoved = append(s.Unmoved, c)
|
||||
}
|
||||
}
|
||||
s.Withdrawn = plugin.WithdrawnKept()
|
||||
if err := provider.FileError(); err != nil {
|
||||
s.FileError = err.Error()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
// Run with Node's test runner and Playwright on the module path; see README.md.
|
||||
// Antigravity's plugin is withdrawn (the owner, 11-15: 正在使用的继续正常,
|
||||
// 加个提示,新用户不让下载): it keeps working for whoever has it, and a
|
||||
// line over the Providers list tells them Google can suspend the account
|
||||
// and leads to Antigravity (local agy CLI) on the Plugins page. Without it
|
||||
// installed, no line. Every language, Chromium and WebKit, at 1100 and 420
|
||||
// wide, nothing past the window's edge.
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs/promises");
|
||||
const path = require("node:path");
|
||||
const { test } = require("node:test");
|
||||
const { chromium, webkit } = require("playwright");
|
||||
|
||||
const assets = path.resolve(__dirname, "../assets");
|
||||
|
||||
function serve(lang, kept) {
|
||||
const settings = { lang, theme: "light", lanURLs: [], fx: { rate: 7.2, at: new Date().toISOString() } };
|
||||
const full = settings;
|
||||
const withdrawn = kept ? [{ id: "antigravity", name: "Antigravity", instead: "Antigravity (local agy CLI)", package: "@magpie-community/opencode-agy-cli-auth" }] : undefined;
|
||||
return async (route) => {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:false,textSize:100};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings });
|
||||
if (url.pathname === "/api/settings") return json(full);
|
||||
if (url.pathname === "/api/plugins") return json({ plugins: [] });
|
||||
if (url.pathname === "/api/plugins/listings") return json({ listings: [{ name: "Antigravity (local agy CLI)", package: "@magpie-community/opencode-agy-cli-auth", providers: ["agy-cli"], community: true, summary: "Your own agy CLI" }] });
|
||||
if (url.pathname === "/api/plugins/search") return json({ hits: [] });
|
||||
if (url.pathname === "/api/groups") return json({ groups: [], models: [] });
|
||||
if (url.pathname === "/api/providers") return json({ providers: [{ id: "relay", name: "Relay", icon: "generic", host: "relay.example", chat: "https://relay.example/v1", models: [], agents: [], key: { set: true, masked: "sk-…1234" } }], presets: [], excluded: [], withdrawn });
|
||||
if (url.pathname === "/api/window/fit") return route.fulfill({ status: 204 });
|
||||
if (url.pathname.startsWith("/api/")) return json({});
|
||||
const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
|
||||
const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
|
||||
try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); }
|
||||
};
|
||||
}
|
||||
|
||||
const fits = (page) => page.evaluate(() => document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1);
|
||||
|
||||
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
|
||||
for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) {
|
||||
for (const width of [1100, 420]) {
|
||||
test(`${engine} ${lang} ${width}: a withdrawn plugin's user is told the risk and led to agy`, async (t) => {
|
||||
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
|
||||
t.after(() => browser.close());
|
||||
const open = async (kept) => {
|
||||
const page = await (await browser.newContext({ viewport: { width, height: 760 }, reducedMotion: "reduce" })).newPage();
|
||||
page.setDefaultTimeout(6000);
|
||||
page.setDefaultNavigationTimeout(60000);
|
||||
page.errors = [];
|
||||
page.on("pageerror", (e) => { if (engine === "webkit" && /due to access control checks/.test(e.message)) return; page.errors.push(e.message); });
|
||||
await page.route("**/*", serve(lang, kept));
|
||||
await page.goto("http://magpie.test/?view=providers");
|
||||
await page.locator("#view-providers .row", { hasText: "Relay" }).first().waitFor();
|
||||
return page;
|
||||
};
|
||||
const tr = (page, s, v) => page.evaluate(([s, v]) => t(s, v), [s, v]);
|
||||
|
||||
// without it: no line
|
||||
let page = await open(false);
|
||||
assert.equal(await page.locator("#movable .withdrawn").count(), 0, "no line");
|
||||
assert.deepEqual(page.errors, []);
|
||||
|
||||
// with it: the risk, translated, and the way to agy-cli
|
||||
page = await open(true);
|
||||
const line = page.locator("#movable .withdrawn");
|
||||
await line.waitFor();
|
||||
assert(await page.locator("#movable").isVisible(), "shown");
|
||||
const head = await tr(page, "{name}'s plugin can get your account suspended", { name: "Antigravity" });
|
||||
assert.equal((await line.locator(".dep-head").textContent()).trim(), head);
|
||||
if (lang !== "en") assert.notEqual(head, "Antigravity's plugin can get your account suspended", "translated");
|
||||
assert.equal((await line.locator(".dep-why").textContent()).trim(), await tr(page, "Google suspends accounts it sees used outside its own app. {name} runs your own agy instead.", { name: "Antigravity (local agy CLI)" }));
|
||||
assert(await fits(page), "fits");
|
||||
const go = line.locator("button.action");
|
||||
assert.equal((await go.textContent()).trim(), await tr(page, "Use {name}", { name: "Antigravity (local agy CLI)" }));
|
||||
const gb = await go.boundingBox(), lb = await line.boundingBox();
|
||||
assert(gb.x >= lb.x - 1 && gb.x + gb.width <= lb.x + lb.width + 1, "inside the line");
|
||||
await go.click();
|
||||
await page.waitForFunction(() => [...document.querySelectorAll("#view-plugins input[type=search]")].some((q) => q.value === "agy"));
|
||||
assert.deepEqual(page.errors, []);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,6 +420,9 @@ func Add(ctx context.Context, spec string) (Entry, error) {
|
||||
if err != nil {
|
||||
return Entry{}, err
|
||||
}
|
||||
if err := RefuseWithdrawn(ctx, spec); err != nil {
|
||||
return Entry{}, err
|
||||
}
|
||||
return add(ctx, spec, "")
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"slices"
|
||||
)
|
||||
|
||||
// Withdrawal is an official package magpie gives to nobody new: a user
|
||||
// who has it keeps it, updated as before, and is told the risk and what
|
||||
// to use instead; everyone else is turned away at Add.
|
||||
type Withdrawal struct {
|
||||
// ID and Name are the provider the package serves
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
// Instead is the provider to use in its place, and Package its plugin
|
||||
Instead string `json:"instead"`
|
||||
Package string `json:"package"`
|
||||
}
|
||||
|
||||
// withdrawn, by package name.
|
||||
var withdrawn = map[string]Withdrawal{
|
||||
// Google suspends accounts it sees calling Code Assist through
|
||||
// Antigravity's own client, as this plugin does (the owner, 11-15:
|
||||
// 正在使用的继续正常,加个提示,新用户不让下载)
|
||||
"@magpie-community/opencode-antigravity-auth": {ID: "antigravity", Name: "Antigravity", Instead: "Antigravity (local agy CLI)", Package: "@magpie-community/opencode-agy-cli-auth"},
|
||||
}
|
||||
|
||||
// WithdrawnOf is the withdrawal of the package name, if it is withdrawn.
|
||||
func WithdrawnOf(name string) (Withdrawal, bool) {
|
||||
w, ok := withdrawn[name]
|
||||
return w, ok
|
||||
}
|
||||
|
||||
// WithdrawnKept are the withdrawn packages this magpie still has listed,
|
||||
// on or off: their users, who are told the risk.
|
||||
func WithdrawnKept() []Withdrawal {
|
||||
var out []Withdrawal
|
||||
for _, e := range Load().Plugins {
|
||||
if w, ok := withdrawn[PackageName(e.Spec)]; ok && !slices.Contains(out, w) {
|
||||
out = append(out, w)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
type keepWithdrawnKey struct{}
|
||||
|
||||
// KeepWithdrawn lets an Add under ctx install a withdrawn package: the
|
||||
// move of the user's own accounts onto it, or keeping a moved user's
|
||||
// plugin current.
|
||||
func KeepWithdrawn(ctx context.Context) context.Context {
|
||||
return context.WithValue(ctx, keepWithdrawnKey{}, true)
|
||||
}
|
||||
|
||||
// RefuseWithdrawn turns away an add of a withdrawn package that this
|
||||
// magpie doesn't have listed already.
|
||||
func RefuseWithdrawn(ctx context.Context, spec string) error {
|
||||
if IsPath(spec) || ctx.Value(keepWithdrawnKey{}) != nil {
|
||||
return nil
|
||||
}
|
||||
name := PackageName(spec)
|
||||
w, ok := withdrawn[name]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if slices.ContainsFunc(Load().Plugins, func(e Entry) bool { return PackageName(e.Spec) == name }) {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("%s is no longer installed: its vendor suspends accounts it sees used this way. Use %s instead: magpie plugin add %s", name, w.Instead, w.Package)
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// A withdrawn package (Antigravity's, owner 11-15) is given to nobody new:
|
||||
// Add turns it away before anything is installed, however its package is
|
||||
// written, and says what to use instead. A user who has it listed
|
||||
// keeps it (an update, or an add over it), a move of the user's own
|
||||
// accounts may install it, and WithdrawnKept names it for the page's
|
||||
// notice only while it is listed.
|
||||
func TestWithdrawnGivenToNobodyNew(t *testing.T) {
|
||||
storeSandbox(t)
|
||||
const pkg = "@magpie-community/opencode-antigravity-auth"
|
||||
ctx := context.Background()
|
||||
for _, spec := range []string{pkg, pkg + "@0.1.18", "npm:" + pkg} {
|
||||
_, err := Add(ctx, spec)
|
||||
if err == nil || !strings.Contains(err.Error(), "@magpie-community/opencode-agy-cli-auth") {
|
||||
t.Fatalf("Add(%q) = %v, want it turned away pointing to agy-cli", spec, err)
|
||||
}
|
||||
}
|
||||
if len(Load().Plugins) != 0 {
|
||||
t.Fatalf("a turned-away add listed %v", Load().Plugins)
|
||||
}
|
||||
if got := WithdrawnKept(); len(got) != 0 {
|
||||
t.Fatalf("WithdrawnKept with nothing listed = %v", got)
|
||||
}
|
||||
if err := RefuseWithdrawn(KeepWithdrawn(ctx), pkg); err != nil {
|
||||
t.Fatalf("a move of the user's own accounts was turned away: %v", err)
|
||||
}
|
||||
if err := RefuseWithdrawn(ctx, "@magpie-community/opencode-agy-cli-auth"); err != nil {
|
||||
t.Fatalf("agy-cli was turned away: %v", err)
|
||||
}
|
||||
|
||||
writeList(t, `{"plugins":[{"spec":"`+pkg+`@latest","off":true}]}`)
|
||||
if err := RefuseWithdrawn(ctx, pkg); err != nil {
|
||||
t.Fatalf("a user who has it (turned off) was turned away: %v", err)
|
||||
}
|
||||
got := WithdrawnKept()
|
||||
if len(got) != 1 || got[0].ID != "antigravity" || got[0].Instead != "Antigravity (local agy CLI)" {
|
||||
t.Fatalf("WithdrawnKept = %+v", got)
|
||||
}
|
||||
}
|
||||
@@ -330,8 +330,9 @@ var retiredBuiltins = map[string]bool{
|
||||
"devin": true,
|
||||
CommandCodePlanID: true,
|
||||
// Google bans accounts it sees on Code Assist through Antigravity's
|
||||
// own client (the owner, 11-15): the plugin's 0.2.0 sends nothing and
|
||||
// points to Antigravity (local agy CLI), which drives the user's agy
|
||||
// own client (the owner, 11-15): the built-in asks Google nothing, and
|
||||
// its plugin serves the users who have it, withdrawn for anyone new
|
||||
// (plugin.WithdrawnOf), who are pointed to Antigravity (local agy CLI)
|
||||
"antigravity": true,
|
||||
}
|
||||
|
||||
@@ -697,7 +698,9 @@ func move(ctx context.Context, id string, mv *mover) (err error) {
|
||||
return fmt.Errorf("no %s account to move", id)
|
||||
}
|
||||
had := pluginListed(mv.pkg)
|
||||
if err := installPlugin(ctx, mv.pkg, mv.min); err != nil {
|
||||
// the user's own accounts: a package withdrawn for anyone new is
|
||||
// still theirs (plugin.KeepWithdrawn)
|
||||
if err := installPlugin(plugin.KeepWithdrawn(ctx), mv.pkg, mv.min); err != nil {
|
||||
return installFailed(mv.pkg, err)
|
||||
}
|
||||
installed := !had
|
||||
@@ -1135,7 +1138,7 @@ func keepMovedCurrent(ctx context.Context) {
|
||||
if mv.min == "" {
|
||||
continue
|
||||
}
|
||||
if err := installPlugin(ctx, mv.pkg, mv.min); err != nil {
|
||||
if err := installPlugin(plugin.KeepWithdrawn(ctx), mv.pkg, mv.min); err != nil {
|
||||
log.Printf("updating %s's plugin: %s", id, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
func init() {
|
||||
movers["antigravity"] = &mover{
|
||||
pkg: "@magpie-community/opencode-antigravity-auth",
|
||||
min: "0.2.0", // retired: sends nothing, points to Antigravity (local agy CLI) (owner, 11-15); 0.1.18 a variant at xhigh (Gemini 4 Hydrogen) is asked at xhigh (plugins#1169); 0.1.14: Gemini 4's late INVALID_ARGUMENT, a bare line in the stream, is asked again and says it isn't a region block (0.1.13 Codex's GPT-5 line reworded in a user's turn, 0.1.12 rewords instead of zero-width, 0.1.11 omp's "key words", 0.1.0 ported the built-in)
|
||||
min: "0.2.1", // 0.2.1 serves again as 0.1.18 did, for the users who have it, and is withdrawn for anyone new (plugin.WithdrawnOf; owner, 11-15: 正在使用的继续正常,加个提示,新用户不让下载); 0.2.0 retired it, sending nothing; 0.1.18 a variant at xhigh (Gemini 4 Hydrogen) is asked at xhigh (plugins#1169); 0.1.14: Gemini 4's late INVALID_ARGUMENT, a bare line in the stream, is asked again and says it isn't a region block (0.1.13 Codex's GPT-5 line reworded in a user's turn, 0.1.12 rewords instead of zero-width, 0.1.11 omp's "key words", 0.1.0 ported the built-in)
|
||||
agents: []string{"antigravity"},
|
||||
out: func() ([]Moving, error) {
|
||||
var out []Moving
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/yetone/magpie/internal/plugin"
|
||||
)
|
||||
|
||||
// A withdrawn plugin (Antigravity's, owner 11-15) is still installed for
|
||||
// the users who have it: a move of their own built-in accounts onto it, and
|
||||
// keepMovedCurrent bringing a moved user's up to its min. Adopt, which signs
|
||||
// in to it with no account to bring, is a new user's install, and turned
|
||||
// away.
|
||||
func TestWithdrawnPluginKeptForItsUsers(t *testing.T) {
|
||||
claudeHome(t)
|
||||
fakeMover(t)
|
||||
const pkg = "@magpie-community/opencode-antigravity-auth"
|
||||
movers["fakeco"].pkg, movers["fakeco"].min = pkg, "0.2.1"
|
||||
var said []error
|
||||
installPlugin = func(ctx context.Context, p, _ string) error {
|
||||
err := plugin.RefuseWithdrawn(ctx, p)
|
||||
said = append(said, err)
|
||||
return err
|
||||
}
|
||||
oldProviders, oldRemove := pluginProviders, removePlugin
|
||||
pluginProviders = func(context.Context) ([]plugin.Provider, error) { return nil, errors.New("stop here") }
|
||||
removePlugin = func(context.Context, string) error { return nil }
|
||||
t.Cleanup(func() { pluginProviders, removePlugin = oldProviders, oldRemove })
|
||||
ctx := context.Background()
|
||||
|
||||
if err := Adopt(ctx, "fakeco"); err == nil || len(said) != 1 || said[0] == nil {
|
||||
t.Fatalf("Adopt with no account = %v (install said %v), want it turned away", err, said)
|
||||
}
|
||||
|
||||
loginsMu.Lock()
|
||||
if err := writeLogins([]savedLogin{fakeLogin("a@fake", "r-a", true, true)}); err != nil {
|
||||
loginsMu.Unlock()
|
||||
t.Fatal(err)
|
||||
}
|
||||
loginsMu.Unlock()
|
||||
said = nil
|
||||
_ = Move(ctx, "fakeco")
|
||||
if len(said) != 1 || said[0] != nil {
|
||||
t.Fatalf("a move of the user's own account: install said %v, want it allowed", said)
|
||||
}
|
||||
|
||||
said = nil
|
||||
_ = setMigration("fakeco", func(m *Migration) { m.State = MovePlugin })
|
||||
keepMovedCurrent(ctx)
|
||||
if len(said) != 1 || said[0] != nil {
|
||||
t.Fatalf("keepMovedCurrent: install said %v, want it allowed", said)
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@
|
||||
<li><b>Claude。</b> Claude サブスクリプションでのリクエストは、コンピューターにインストールされた Claude Code を通じて送られるので、Claude Code はインストールしたままにしてください。</li>
|
||||
<li><b>Copilot。</b> Copilot はコードを表示するので、GitHub のページで入力します。独自ドメインの GitHub Enterprise の場合:<code>magpie accounts add copilot --host <name>.ghe.com</code>。</li>
|
||||
<li><b>Gemini。</b> これは Gemini CLI の Google サインインです。Google が応じるのは、専用の Google Cloud プロジェクトを持つ Code Assist Standard または Enterprise のアカウントだけです。プロジェクトは <code>magpie accounts project gemini <email> <project></code> で指定します。</li>
|
||||
<li><b>Antigravity。</b> <span class="ui">プラグイン</span>ページから <span class="ui">Antigravity (local agy CLI)</span> を入れてください(<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>)。インストールしてサインインした agy CLI を動かすので、Google には agy 自身のリクエストとして届きます。magpie で Antigravity に直接サインインする方法は終了しました。その使い方をした Google アカウントは停止されます。</li>
|
||||
<li><b>Antigravity。</b> <span class="ui">プラグイン</span>ページから <span class="ui">Antigravity (local agy CLI)</span> を入れてください(<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>)。インストールしてサインインした agy CLI を動かすので、Google には agy 自身のリクエストとして届きます。magpie で Antigravity に直接サインインする方法は終了しました。その使い方をした Google アカウントは停止されます。旧 Antigravity プラグインを入れている場合はそのまま使え、プロバイダページにリスクが表示されます。新しくインストールすることはできません。</li>
|
||||
</ul>
|
||||
<p>その他のサブスクリプションは、magpie の <span class="ui">Plugins</span> ページからプラグインとして追加します。<a href="/docs/ja/plugins">プラグイン</a>を参照してください。</p>
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
<li><b>Claude.</b> Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed.</li>
|
||||
<li><b>Copilot.</b> Copilot gives you a code to enter on GitHub’s page. For GitHub Enterprise on its own domain: <code>magpie accounts add copilot --host <name>.ghe.com</code>.</li>
|
||||
<li><b>Gemini.</b> This is Gemini CLI’s Google sign-in. Google answers it only for a Code Assist Standard or Enterprise account with a Google Cloud project of its own; <code>magpie accounts project gemini <email> <project></code> names the project.</li>
|
||||
<li><b>Antigravity.</b> Install <span class="ui">Antigravity (local agy CLI)</span> from <span class="ui">Plugins</span> (<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>). It runs the agy CLI you installed and signed in to, so Google sees agy’s own requests. Signing in to Antigravity in magpie directly is retired: Google bans accounts used that way.</li>
|
||||
<li><b>Antigravity.</b> Install <span class="ui">Antigravity (local agy CLI)</span> from <span class="ui">Plugins</span> (<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>). It runs the agy CLI you installed and signed in to, so Google sees agy’s own requests. Signing in to Antigravity in magpie directly is retired: Google bans accounts used that way. If you already have the old Antigravity plugin, it keeps working, and the Providers page tells you the risk; it is no longer installed for anyone new.</li>
|
||||
</ul>
|
||||
<p>Other subscriptions are added as plugins, from magpie’s <span class="ui">Plugins</span> page; see <a href="/docs/plugins">Plugins</a>.</p>
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
<li><b>Claude。</b>Claude 订阅的请求通过你电脑上安装的 Claude Code 发出,所以要保留 Claude Code。</li>
|
||||
<li><b>Copilot。</b>Copilot 会给你一个验证码,在 GitHub 页面上输入。使用自有域名的 GitHub Enterprise:<code>magpie accounts add copilot --host <name>.ghe.com</code>。</li>
|
||||
<li><b>Gemini。</b>这是 Gemini CLI 的 Google 登录。Google 只对有自己 Google Cloud 项目的 Code Assist Standard 或 Enterprise 账号提供服务;用 <code>magpie accounts project gemini <邮箱> <项目></code> 指定项目。</li>
|
||||
<li><b>Antigravity。</b>在<span class="ui">插件</span>页安装 <span class="ui">Antigravity (local agy CLI)</span>(<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>)。它运行你自己安装并登录的 agy CLI,Google 看到的是 agy 自己的请求。在 magpie 里直接登录 Antigravity 已下线:Google 会封这样用的账号。</li>
|
||||
<li><b>Antigravity。</b>在<span class="ui">插件</span>页安装 <span class="ui">Antigravity (local agy CLI)</span>(<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>)。它运行你自己安装并登录的 agy CLI,Google 看到的是 agy 自己的请求。在 magpie 里直接登录 Antigravity 已下线:Google 会封这样用的账号。已经装了旧 Antigravity 插件的照常能用,服务商页会提示风险;新用户不再能安装它。</li>
|
||||
</ul>
|
||||
<p>其他订阅以插件形式在 magpie 的 <span class="ui">插件</span> 页添加,见 <a href="/docs/zh/plugins">插件</a>。</p>
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user