cli: magpie plugin list says a built-in runs the plugin's provider rather than "not signed in" (要保证插件订阅 provider 跟内置的订阅 provider所有逻辑都要一模一样) — after a move back the plugin stays when the user had installed it, and its rows read "not signed in · magpie plugin login kiro", as if broken; they now say "runs on magpie's built-in (2 accounts) · magpie plugin move kiro". go build -tags nogui passes.

This commit is contained in:
yetone committed 2026-10-01 11:15:25 +08:00
1 parent 93c3cde024
commit cc6fc56b3b
1 file changed
+9
+9
View File
@@ -163,6 +163,12 @@ func listPlugins(ctx context.Context, asJSON bool) error {
fmt.Println(string(b))
return nil
}
// a built-in with accounts the plugin could run: not signed in to the
// plugin is its normal state, not something to fix
onBuiltin := map[string]provider.MoveCandidate{}
for _, c := range provider.MoveCandidates() {
onBuiltin[c.ID] = c
}
for _, e := range l.Plugins {
state := green.Render("on")
switch {
@@ -177,6 +183,9 @@ func listPlugins(ctx context.Context, asJSON bool) error {
continue
}
who := muted.Render("not signed in · magpie plugin login " + p.ID)
if c, ok := onBuiltin[p.ID]; ok && !p.SignedIn {
who = muted.Render(fmt.Sprintf("runs on magpie's built-in (%d accounts) · magpie plugin move %s", c.Accounts, p.ID))
}
if p.SignedIn {
who = green.Render("signed in")
if p.AccountID != "" {