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.
47 lines
1.7 KiB
Go
47 lines
1.7 KiB
Go
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)
|
|
}
|
|
}
|