Commit Graph
95 Commits
Author SHA1 Message Date
yetone 4df5256db8 plugins: a plugin's page shows its README in the UI's language (ahwulv on X)
A plugin that ships README.zh-CN.md still showed README.md on its details
page with magpie in Chinese. GET /api/plugins/page now takes ?lang= (the
page's document language) and plugin.ReadmeIn picks the README named for it:
README.zh-CN.md, README_zh.md, README-zh.md, README.zh-Hans.md, README.CN.md
and the like, any case (readmeTag/pickReadme). Order: the language's own tag,
then its base (zh-TW takes a simplified README over English), then the plain
README.md as before.

Where it reads from: an installed plugin's folder; an npm package not
installed from its files through jsDelivr's file list (the registry entry
holds README.md only), public registry only, never a user's private one;
a GitHub repository not installed from its contents list. Any failure keeps
the old README.md path. The page cache in plugins.js is keyed by package and
language. A package only on the community dist branch still shows the
README its index carries (English).

Before/after: zh UI + a package with README.zh-CN.md showed README.md; now
shows the Chinese one. en UI, no such file, or jsDelivr down: unchanged.

Run: TestPickReadmeByLanguage, TestReadmeInUILanguage (fake npm, jsDelivr,
GitHub, installed folder) on mote at the commit before the final rebase and
on a WSL box; broken by hand (lang forced to "" in ReadmeIn) the test goes
red. GUI plugin-readme-lang (new, chromium + webkit, en and zh) green, red
when &lang= is dropped from the request; plugin-detail-escape green. go vet
darwin green. Not tried: a real npm package with a localized README against
the live jsDelivr; the other plugin GUI files and linux/windows vet were
still queued on mote when this was pushed.
2026-11-11 11:50:13 +08:00
yetone 13a9f1263a plugins: Discover counts who uses and likes each plugin
Discover showed npm's weekly downloads, which CI, mirrors and magpie's
own keepMovedCurrent updates inflate. Now each card and the hero say
how many people use a plugin, counted by magpie itself, and a plugin's
page has a like.

- The daily stats send (stats.Send) also POSTs usemagpie.ai
  /api/plugins/report with the install id and the installed, switched-on
  plugins Discover lists, by their Discover key: the npm name, or
  github:owner/repo for a repository tagged magpie-plugin
  (plugin.Public). A folder, a private repository or an unlisted
  package is never named. It goes only while "Share the agents,
  providers, models and plugins I use" is on (noUsageStats), and only
  where the day's event goes at all (Count me as a user, DO_NOT_TRACK,
  MAGPIE_NO_STATS, release builds).
- site/pluginstats.js on D1 magpie-plugins: users are the ids that
  reported a plugin in the last 7 days, reports drop after 30 days, a
  caller's address is kept only as a hash for an hour (60 asks an
  hour). /api/plugins/stats carries no id and is cached for an hour.
- A like (POST /api/plugins/like through the GUI's /api/plugins/like)
  is taken only for a plugin installed and on here, can be taken back,
  and is kept in plugin-likes.json.
- "Most liked" sorts by likes once a plugin has 20, below that by
  GitHub's stars.
- plugincounts.js is loaded with the Plugins page, not the core, and
  redraws the cards only when the counts changed.
- The privacy text follows: README.md, README.zh-CN.md, docs/reference.md,
  the site's privacy and start pages in en, zh and ja, llms-full.txt,
  and the Privacy switch's label and description in every language.

Run at this tree (on origin/main 51da6f1f5):
- Windows box (win-run): gofmt -l clean; go vet of internal/stats,
  internal/plugin, internal/gui ok for windows and linux (-tags nogui);
  node --test site/pluginstats.test.mjs site/worker.test.mjs 44 of 44;
  TestCoreScriptBudget, TestPluginCountsAndLikes ok; GUI old-webkit,
  i18n-keys, privacy-usage-stats, plugin-git, plugin-local,
  plugin-github in both engines: 45 of 46, the one red is #5919
  (.side-foot:has, d374168d0).
- mote, one commit before the rebase onto 51da6f1f5 (Go unchanged
  since): go vet darwin ok; TestSendPlugins, TestPublicPlugins,
  TestPluginCountsAndLikes, TestCoreScriptBudget ok.
- Windows, at 7bc7af1d0 (one rebase earlier): go test internal/stats
  ok; internal/plugin and internal/gui red only in TestPiPackage and
  eight gui tests that fail the same at origin/main 72f2deebe on that
  box (#4115, #5928; TestCherryStudioImportRow added to #4115 with its
  cause). Every plugin*, market*, privacy*, i18n*, old-webkit* and
  discover* GUI file (83 files, both engines, concurrency 4): the reds
  left after the fix below match origin/main 6d7862769 on the same box,
  or are flakes red there too under concurrency: plugin-update-button
  (#4500), plugin-proxy-page (#6017, new), privacy-agent-telemetry
  (#6018, new).
- Broken by hand, caught: the first run had `const like = !local && …`,
  so a local plugin's page called false?.sync() every 600ms; 136
  "like?.sync is not a function" errors across plugin-git, plugin-local,
  plugin-github and the sign-in files. Fixed before this commit.
- Live: D1 magpie-plugins created and the worker deployed;
  /api/plugins/stats answers {"plugins":{}}, a bad report or like 400,
  /api/latest and / 200. No test data was written to production.

Not tried: the full Go suite and the full GUI suite. mote had 28 suites
waiting for its lock, and WSL on the Windows box failed with
E_UNEXPECTED while another session uninstalled a distro. Not tried
either: a real like or report from a release build (source builds
never send), so the first real counts come with this release.
2026-11-11 04:28:18 +08:00
yetone 5048a48d5c gui: a plugin's README renderer moves out of the core, to pluginmd.js
Discover and the new Install button took TestCoreScriptBudget 2,766
bytes over. The README's Markdown renderer moves to pluginmd.js,
imported once plugins.js has run; the core is 1,531,323 of 1,533,802,
no raise. markdown and mdLoad stay function declarations: as consts,
window.mdRender = markdown at the top of plugins.js threw "Cannot
access 'markdown' before initialization" and every page failed (the
first WSL run). The Library's skill files read through window.mdRender
too, so the import isn't left for the Plugins page to open.
old-webkit lists pluginmd.js with the other lazily loaded files.

Run record: the Discover commit's (same push).
2026-11-11 01:51:15 +08:00
yetone e369bf77b4 plugins: Install is a thin ring round body-coloured text, with its arrow
The owner picked option C of four: "一个个大安装像一个个补丁". Install,
Move and a list's Sign in are a 1px ring (--ring-act, the text colour
at 15%) round body-coloured text, with a download arrow before
Install; hover fills it grey; Update is the same ring in green; the
detail page's main action keeps its accent fill. Browsers without
color-mix() (Safari before 16.2) get --line for the ring, which
old-webkit's check asked for.

plugin-update-button and plugin-market assert the ring and the fill
of the new look. Run record: the Discover commit's (same push).
2026-11-11 01:51:15 +08:00
yetone fd568caf7d plugins: Discover is one market, with this week's picks on top
The owner asked for one market instead of three (magpie's community,
other npm authors and repositories tagged magpie-plugin on GitHub) and
approved the mockup: every plugin is the same card, its source said
under its name, a strip picks the kind and a menu the source. The top
is the week's picks: one a day from the community's most downloaded
not installed yet, the most downloaded and the most starred. A search
looks through every source at once, most used first. GitHub's slower
answer shows a word that it is being asked, and a failed ask a quiet
line with another go.

The GUI tests that named the three sections now find the cards by
source. plugin-manual-float picks Subscriptions so all 40 cards draw
(Discover's shelves cap at 6). plugin-github waits for WebKit's wheel
scroll to come to rest after reaching a card: it went on after the
last wheel, and the scroll that was measured as the click's was its
own (logged before, settled, open and closed: it moved before the
click, never after).

Run at 563b3dd92, the pushed head's tree (only messages changed since),
on origin/main 40fbec705:
- mote: gofmt -l internal/gui empty; go vet ./internal/gui,
  GOOS=linux go vet -tags nogui, GOOS=windows go vet; go build,
  GOOS=linux go build -tags nogui, GOOS=windows go build: ok.
  go test ./internal/gui ./internal/plugin ok (TestCoreScriptBudget
  in it).
- mote GUI, plugin*, old-webkit, market*, builtins, skill-edit, i18n*,
  gui-*, about*, agent-plugin* files: 1,283 ok, 50 not ok, in
  plugin-move-unserved (#4410), market-have (#5997), old-webkit's
  app.css :has() (#5919), gui-ja's {model} (#5943),
  plugin-signin-no-url (#5938), plugin-signed-out-account (#5998) and
  plugin-card-update once; each red the same alone at origin/main
  90f9f01a2, where plugin-card-update was red too.
- Rebased onto 459405960 (c4da9a97d's title-bar drag in app.js and
  app.css among it): gofmt, go vet ./internal/gui and the Budget and
  Script tests of internal/gui again: ok.
- Before the rebase (on 783cd0f84): the whole GUI suite on
  magpie-desktop (WSL), its 132 red files again beside main: 95 red the
  same on main (#4600, commented), key-replace red 3 of 3 alone on main
  too; old-webkit's color-mix and plugin-github were this change's and
  are fixed; library-hooks, -items, -loading and -subagents red the
  same alone on main (#5997).
Not tried: the real app; screenshots come from the GUI test pages.
2026-11-11 01:51:15 +08:00
yetone 623e797fde plugin pages: read a day's usage and share a picture they drew
A plugin's page can now read one day's usage and share an image it
drew. This is for the day card (JungleyYeh on X asked for a "daily AI
statement"); the card itself is an optional community plugin,
@magpie-community/page-day-card.

- A page that asks for the "usage:day" read gets that day as
  magpie.read("usage:day", {date, tz}): totals, each agent and its
  models, the streak and the average active day (usageapi/day.go,
  gui/pageday.go). The Plugins page names the read before it is granted.
- magpie.image.copy(png) and magpie.image.save(png, name) share a PNG
  of at most 16 MB. In the window they go through
  POST /api/plugin-pages/image (pageimage.go): copy puts the picture on
  the clipboard (clipimage.go: osascript PNGf on macOS, PowerShell
  PNG + Bitmap on Windows, wl-copy or xclip on Linux), and save writes
  it to Downloads under a name made safe. In magpie web, the browser
  saves or copies the picture itself.
- The window's side, pageshare.js, is imported the first time a page
  shares a picture. The core grows by its one call only, paid for by
  comments cut, so the budget is not raised.

Tests:
- New: TestDayOf, TestPluginPageReadsADay, TestPluginPageSharesAPicture,
  TestPageImageName and TestClipImageCommand. plugin-page.test.cjs
  covers the bridge, both engines and a refused SVG.

What was run (mote):
- gofmt, plus go vet on darwin, linux and windows: clean.
- Full go test ./... at the pre-rebase base: 369 packages ok, 3 FAILs.
  - TestEveryRouteHasACommandOrIsNamed and TestCoreScriptBudget were
    this change's own reds. The new route now has a parity entry, and
    the share code moved into lazy pageshare.js with no raise.
  - TestGatewayModeStatsNameTheGatewaySessions is #5690, the red in the
    first hour of the day (it ran at 00:32).
- GUI suite (affected and plugin files, both engines): 1160 of 1179
  passed. Every red is filed and none touches this change:
  - i18n-keys "a plugin's words are its own": #5332, #5426, #5482.
  - page-width-steady: #5013.
  - plugin-card-update in WebKit: #3079.
  - plugin-move-unserved "Try again": #4410.
- At this head, after the rebase on bc8b01d60:
  - gofmt clean; go vet ./internal/... on darwin, linux (nogui) and
    windows ok.
  - internal/usageapi, internal/plugin and internal/cli ok.
  - internal/gui: TestCoreScriptBudget, the TestPluginPage* tests and
    the TestPageImage/TestClipImage tests pass.
  - plugin-page and old-webkit (both engines): 12 of 12.

Real use:
- A sandbox HOME with a copy of real usage, through the real GUI
  server, in Chromium and WebKit, light and dark, en/zh/zh-TW/ja/de, at
  420 and 1100 px. The card showed 87.9M tokens, $9.85 and 4076 calls
  with a 22-day streak.
- Picking an earlier day and WebKit's Copy ("Copied") worked, with no
  page errors.
- Not tried at push: Chromium's Copy (its headless clipboard was
  denied) and magpie web's Save as a captured download. A second real
  run that grants both was still queued on mote's suite lock.
- Clipboard: checked live on macOS (osascript) and Windows
  (PowerShell). Not tried live on Linux: WSLg had no display.
2026-11-09 23:19:14 +08:00
yetoneandsevtdy 136178803b gui: Escape closes a plugin's details dialog on Discover (#3779)
On Plugins › Discover, Escape left a plugin's details dialog open and
only showed Install's focus ring. detail() opened #modal without
setting confirmAsk, unlike every other dialog that borrows #modal
outside Providers, so Escape reached only the Providers page's
handler, which closes nothing there.

detail() now sets confirmAsk and its Close goes through
closeConfirmAsk. show() clears confirmAsk when leaving a page closes
the modal: the dialog's Sign in goes to Providers through show(), and
a leftover confirmAsk would take the next Escape there. This is
sevtdy's patch from the issue.

Side effect: cfgblocked.js steps back to the dialog under a Repair
only when confirmAsk is unset, so a Repair opened over the plugin
details no longer goes back to them, the same as over the other
confirmAsk dialogs.

New test: plugin-detail-escape.test.cjs (en, zh): Escape closes the
details twice, Close still closes them, and after Install, then Sign
in, then Providers, Escape closes the add sheet.

Run (mote, via suite.lock):
- plugin-detail-escape.test.cjs: chromium 3/3, webkit 3/3
Broken by hand:
- plugins.js and app.js at the base: red in both engines (the first
  Escape leaves the dialog open)
- only show()'s clear taken out: red in both engines (after Sign in,
  Escape on Providers leaves the add sheet open)
Wider GUI run (every plugin*, modal-*, i18n-keys, update-wait and the
files testing Escape on #modal: 114 files, both engines): running at
push time; any red gets its own issue.
Not tried: the real app (Wails webview) by hand.

Reported-by: sevtdy <16433683+sevtdy@users.noreply.github.com>
Co-authored-by: sevtdy <16433683+sevtdy@users.noreply.github.com>
2026-11-09 17:21:30 +08:00
yetone a5c97cd83a plugins: a tool plugin's Hide from agents sits with Switch off and Remove
The button was on the tools line, pushed right with margin-left: auto, so
in a two-line row (x: "Tools for agents: x_search, x_read") it sat a line
below Switch off and Remove, which the row centres. It is now one of the
row's buttons (toolsFlip), before Options, Switch off and Remove, as a
text button like them.

Run (mote): plugin-tools 22/22, both engines, en/zh/zh-TW/ja/de, 980 and
420; its new check that every row button shares one centre line fails on
the old plugins.js/css (red in every language). plugin*.test.cjs,
i18n-keys, old-webkit, library-mcp-tool*: 1134 pass, 6 red:
plugin-move-unserved's "Try again" x4 is red on unchanged 8fa3c60f8 too
(#4410); i18n-keys "a plugin's words are its own" is red on 8fa3c60f8
(#5332, #5482); plugin-panels chromium timed out once under load and
passed when run again.
Not tried: the real app with the x plugin installed.
2026-11-08 18:45:50 +08:00
yetone 784113472d gui: motion answers sooner: strong ease-out, folds and popovers under 300ms, no scale(0)
The owner asked for every animation to follow Emil Kowalski's "make your
app feel faster" rules (x.com/emilkowalski/status/2118687605776597482):
ease-out for anything the user starts, a strong curve over the stock one,
and UI motion under ~300ms. Spinners, attention flashes, decorative loops
and the chart intros are left as they were.

- New token --ease-out: cubic-bezier(.23, 1, .32, 1); --morph-ease is now
  the strong ease-in-out (.77, 0, .175, 1).
- Agents' fold, and the panel's edge that moves with it (UNROLL/ROLLUP):
  .62s/.42s -> .34s/.26s on --ease-out; its rows .56s with a 48ms stagger
  -> .32s with 24ms.
- An agent row's details (ROW_OPEN/ROW_CLOSE, .ag-open, .ag-body):
  .48s/.40s -> .32s/.26s. The curve stays the gentle-start spring the
  comment chose so the panel's edge keeps up; only the time is shorter.
- Hover reveal of a row's menu: up to .52s -> .28s. Chevrons .3-.5s ->
  .22-.32s.
- Popovers: pop-in .42s -> .24s; pop-out was .22s on an ease-in curve,
  now .15s ease-out.
- The new-dot started from scale(0); it starts at scale(.5), opacity 0.
- Sheets, sidebar sub-lists, modals (.57s -> .44s open, .38s -> .30s
  close), Context tiles and fades, plugin cards: 460-620ms -> 240-400ms.
- Theme crossfade .35s -> .25s; copied/new-account pops .36-.5s -> .26-.3s.

Run on the Linux VM (magpie-desktop, WSL), both engines, every language:
- Whole GUI suite at this change: 21559 pass, 431 fail of 21990. The run
  overlapped another session's suite (15-minute load 39). #5559 has 478
  of 21666 red on this VM at main.
- 17 files that touch the changed motion (model-chip-steady,
  page-width-steady, zero-priced-free, segs-press-redraw, rest-try-now,
  provider-fetch-again, codex-predictions, side-toggle, tray-cell-click,
  menu-input-scroll, agent-details-ready, agent-expand-steady,
  held-animations, group-morph, header-centre, inner-scroll-contain,
  recovered-file), concurrency 2, at the parent e6cdeac9c and at this
  change: 230 pass / 154 fail on both, and the 128 failing test names are
  identical (diff empty). They are filed: #4388, #4600, #4689, #2624,
  #3479, #5559.
- i18n-keys' "a plugin's words are its own" is red at the parent too
  (plugin i18n strings also said in Go files); not touched here.

At the pushed head (rebased on 999ba6a00): go test -run Budget|Asset|Embed
./internal/gui ok on mote.

Not run: a clean whole-suite baseline at the parent on an idle machine
(mote was running two other sessions' suites), and nothing on macOS
WebKit or the real tray panel; the feel was not watched in the real app.
2026-11-07 22:04:06 +08:00
yetone 922cc0ccf8 library: a plugin's tools hidden from every agent from its Plugins row
chengming0v0 (Discord) keeps a plugin for its providers but doesn't want
the MCP server it brings (minimax_query_video_generation and the rest)
shown to agents, and doesn't want to remove the plugin.

Before: a plugin that gives tools is a Library server of its own
(plugin_tools.go), switched per agent with the row's chips in Library ›
MCP, which held through updates and off/on. Nothing on the Plugins page
said so: its line read "Tools for every agent" whatever the Library had,
and an app at the router's address (/mcp/magpie/hub, agent "") was given
every server, ticked for any agent or none, so taking every chip off
still left the tools there.

Now:
- The plugin's tools line says "Tools for agents" or "Tools, hidden from
  agents", with Hide from agents / Give to agents beside the copy button
  (plugins.js, toolsServer in /api/plugins from library.PluginServers).
- PluginServerOn (servers/plugin-on {name, on}) sets Server.Hidden and
  keeps the agents it had in Paused. Hidden, no agent is given it and
  hubServers leaves it out for the router's address too. Give to agents
  gives the kept agents back; with none kept, the router's agents
  (hubAgents), or else every shown agent that can take it.
- It holds through a plugin update, the plugin off and on, an edit in the
  Library editor (SaveServer keeps it) and an agent's "every server"
  (serversAgents with no names skips a hidden one). Ticking an agent for
  it in Library › MCP shows it again (save clears Hidden).
- Library › MCP tags the server "Plugin", its tooltip pointing at Plugins.
- /mcp/magpie/tools (every plugin's tools, wired by hand) is unchanged.
- Docs: plugin-tools.md, mcp-router.md, site docs plugins (en, zh, ja).
- The core script budget is not raised: two plugins.js comments cut, the
  button's tooltips and status lines left out.

Run on mote at this tree (before the site docs, html only):
- go build ./..., go vet ./internal/library ./internal/gui, GOOS=windows
  go vet of both, GOOS=linux go vet ./internal/library: ok.
- go test -count=1 ./internal/library/: ok (187s).
- go test -count=1 ./internal/gui/ -run 'Plugin|Library|Budget|Script':
  ok (TestCoreScriptBudget 1,533,514 of 1,533,802).
- node --test plugin-tools.test.cjs (new: the line's words, Hide and Give
  posting {name, on}, the button inside its row at 980 and 420, all five
  languages, Chromium and WebKit): ok; builtins, every library-mcp-* and
  mcp-* file: ok.
- i18n-keys "a plugin's words are its own": red, the same three words on
  origin/main 61394481c (#5327/#5332, #5426, #5482); nothing of mine.
- library-mcp-first-click: one 1500ms wait red per run (chromium en 1100
  once, webkit zh-TW 1100 once) with several files at once; green alone on
  origin/main 61394481c. Not filed yet; the whole GUI suite comes next.
- site/worker.test.mjs: ok.

Broken by hand: without `!s.Hidden` in hubServers, TestPluginToolsHidden
is red ("hidden: still listed"); without the every-server skip, red at
"every server given to claude".

Not tried: a real MiniMax plugin or the real app; the whole GUI suite and
go test ./... (queued under the suite lock on mote after the push); a Go
test of toolsServer in pluginsState (the GUI test fakes /api/plugins);
Windows and Linux runs.

Reported-by: chengming0v0 (Discord)
2026-11-07 20:14:49 +08:00
yetone 116f23c784 plugins: an agent plugin whose agent isn't on this computer says so, not "Adds Kimi to Agents" (zzZ)
zzZ (innerscw) on Discord: Kimi no longer shows in Agents, even with the
plugin installed. Nothing in magpie regressed. Kimi Code CLI (built-in
`kimi`, ~/.kimi-code) is found on main: installed with Kimi's own
install.sh in a sandbox HOME on mote, it is listed. The plugin is
@magpie-community/agent-kimi-desktop. Its agent's folder,
~/.config/magpie-kimi, is made by its adapter only once Kimi desktop's
Work runtime has written its config.json (bootstrap() in adapter.mjs).
Until then Detected() is false, so Agents lists no row for it. All the
while, the Plugins page said "Adds Kimi to Agents".

/api/plugins's agent now has missing, looks (where magpie looks, ~ for
home) and notice (the plugin's own notice) when the agent isn't found.
The row's line says "Kimi isn't in Agents: magpie doesn't find it in
~/.config/magpie-kimi", followed by the plugin's notice ("请先打开 Kimi…").
It wraps, in muted colour, since it is not a failure. In zh, zh-TW, ja
and de as well. A found agent's row is unchanged, as are fixtures with
no `missing`.

Run on mote (mote-run):
- go test ./internal/gui -run 'TestPluginAgent|TestCoreScriptBudget|I18n|Words': ok.
- node --test plugin-agent, i18n-keys, i18n-en-no-cjk: 30 pass, Chromium
  and WebKit, en/zh/zh-TW/ja/de, at 980 and 420.
- go test ./internal/gui ./internal/agent -count=1 -timeout 45m:
  internal/agent ok; internal/gui red only in TestMainWindowCorners
  (macOS 27, #3949).
- node --test every *plugin*.test.cjs: 1126 of 1130 pass. The 4 reds are
  plugin-move-unserved's "Try again takes the models unticked", red the
  same on origin/main 47d583939 run alone on mote (#4410).
- The core script budget: 1,530,183 + this change, under 1,533,802, with
  no raise.

Broken by hand:
- With pluginAgentOf back to the old code, TestPluginAgentMissingSaysSo is
  red ("Missing:false Looks: Notice:").
- With plugins.js back to the old code, plugin-agent is red with "Adds Kimi
  to Agents" / "把 Kimi 加到 Agent 页".

Not tried: a real Kimi desktop install. It is on neither this Mac nor mote.
2026-11-05 11:45:44 +08:00
yetone ed7aeb052f plugins: a package that declares magpie.agent is an agent, with a main or without (plugins#737)
miaocell's magpie-agent-deva ships a Bun module as its main beside its
moejs agent file (deva.agent.js), because the agent needs a runtime. The
market's GitHub list decided the kind by whether a main was there, so it
listed the package under Providers, and the Installed row wore a Provider
chip and a provider logo though the module serves no provider.

Now readTagged gives Kind "agent" to any package that declares
magpie.agent; middleware, page and hooks still need no main to be that
kind. The file looked for in the repository is still the module Bun
loads (its main), or the agent file when there is no main. The Installed
row of an agent plugin wears Provider only when its module serves a
provider, and its logo is the agent glyph unless it does. The moejs
descriptor contract is unchanged. The community registry.json already
gives kimi-desktop and reasonix-desktop (both with a main) kind agent;
the plugins repo's check now fails an agent package listed as any other
kind.

Docs: docs/reference.md, docs/subsystems/provider-plugins.md, and
site/public/docs plugins.html in en, zh and ja say an agent that needs a
runtime keeps its agent file and adds a Bun main, and is listed as an
agent either way.

Run (on mote, at this head rebased on b047cfe73):
- TestTaggedAgentWithMain (new; the reporter's real package.json,
  index.mjs and deva.agent.js in testdata): go test -run
  'Tagged|PkgEntry|Readme|GitHub' ./internal/plugin ok. Red with
  github.go at its parent: kind "".
- plugin-agent.test.cjs (new rows: an agent with a main and no
  provider, one switched off, one that serves a provider), chromium and
  webkit, en, zh, zh-TW, ja, de: ok. Red at origin/main b047cfe73: the
  deva row's chips were [Agent, Provider].
- Every plugin*.test.cjs plus i18n-keys, both engines: 1090 of 1094 ok.
  The 4 reds are plugin-move-unserved "Try again takes the models
  unticked" (Model 1 folded behind "Show the other 29"), red the same
  at origin/main b047cfe73; filed as #4410.
- gofmt -l, go vet ./internal/plugin ./internal/gui, GOOS=linux and
  GOOS=windows go vet ./internal/plugin, go test -run 'Budget|I18n'
  ./internal/gui (TestCoreScriptBudget, budget not raised): ok.

Not tried: installing magpie-agent-deva from the real GitHub list in a
running app (the list is read from the test server); Windows and Linux
runs of the GUI tests.
2026-11-05 03:54:41 +08:00
yetoneandMYCF711 cbb09383fb plugin: a GitHub-tagged package's card says its own name and summary (#3608, plugins#394)
MYCF711's #3608 (and plugins#394): a repository tagged magpie-plugin
outside the community's list showed its repository's name and GitHub's
description on its card under Discover → Unofficial, on GitHub, whatever
its package.json said of itself. Ported from MYCF711's 1cc337001.

Now readTagged keeps package.json's magpie.name (ownName, as main's row
already does since d8cf4f74f) and magpie.summary (ownSummary, by
language), and npm's copy's when the card installs from npm and it says
them. The card shows them in place of the repository's, with an "Its
own words" chip whose tip says nobody reviewed them; no community badge,
and they never resolve a name. GitHub's description stays the English
line for a package whose summary has none.

Changed from 1cc337001, reviewed line by line:
- ownSummary also refuses control and format characters (a bidi
  override, a zero width space) and bad UTF-8, as main's ownName does.
- magpie.summary is read as raw JSON: in 1cc337001 a summary that isn't
  an object of strings ("summary": "text") failed the whole package.json
  parse, and readTagged then left the repository out of the list.
- npm's copy's words win over the repository's when npm's is the one
  installed; 1cc337001 read them from npm only for the NPM type, which
  no card shows.
- Left out: the row chip and InstalledName/ownName on /api/plugins (main
  has them from d8cf4f74f), NPM.Name/Summary (no page reads them), and
  the core budget raise: the card's code is paid for by cutting three
  comments in plugins.js, 1,533,388 of 1,533,802.

Run (mote, at this tree on 538026e62):
- go test -count=1 ./internal/plugin ./internal/gui: internal/plugin ok
  (145s); internal/gui red only in TestMainWindowCorners/macOS_26_SDK,
  filed as #3949 (macOS 27)
- go vet ./internal/plugin ./internal/gui, GOOS=linux -tags nogui and
  GOOS=windows: clean; gofmt -l: nothing.
- node --test internal/gui/tests/plugin*.test.cjs,
  plugins-more-discover and i18n-keys, Chromium and WebKit: 1028 of
  1032; the 4 reds are plugin-move-unserved's "Try again takes the
  models unticked" (en, zh, both engines), filed as #4410 and #4392
- plugin-own-words.test.cjs: en, zh, zh-TW, ja, de at 980 and 420, both
  engines, 22 of 22; with main's plugins.js 0 of 22 ('magpie-officeace'
  for 'OfficeAce').
After the rebase on 823e7c250 (mote): TestCoreScriptBudget ok, go test
  -run 'OwnWords|Tagged' ./internal/plugin ok, plugin-own-words,
  i18n-keys and plugins-more-discover 32 of 32.
Broken by hand:
- npm's words not taken: TestReadTaggedOwnWords red (name "OfficeAce
  dev").
- summary read as map[string]string: TestReadTaggedOwnWords red (the
  package with "summary": "text" not kept).
- ownSummary without the character check: TestOwnWordsBounds red (two
  lines, tab, bidi override, zero width).
Not tried: a real repository with magpie.summary (none tagged has one);
the desktop window itself.

Co-authored-by: MYCF711 <323101370+MYCF711@users.noreply.github.com>
2026-11-04 22:47:11 +08:00
yetone 2a19043afc library: a skill's files are read as Markdown and edited in the page (refeccd)
refeccd on Discord kept skills in ~/.agents/skills, handed them over to
magpie ("let magpie manage"), and then had nowhere to edit them: the
Library's skill view showed SKILL.md as raw text with no way to change
it. There never was an edit path; this adds one.

- GET /api/library/skill takes `file` and answers library.ReadSkillFile:
  the file (SKILL.md by default), its text, the skill's folder and its
  text files (UTF-8, no NUL, up to 1 MB each, 200 listed, SKILL.md first;
  links, hidden folders and what installing writes left out).
- POST /api/library/skills/save {name, file, text, was} is
  library.SaveSkillFile, through change(): it writes only a regular
  file already in the skill's library folder (no .., no absolute path,
  no link, no folder that is a link out of the skill, nothing under
  node_modules/.venv/…), refuses when the file no longer holds `was`
  (the text the page opened), keeps CRLF line ends, and writes with
  edit.WriteAtomic. The sync after it reaches every agent: a linked
  one reads the library's folder, a copy is made again. A copy edited in
  an agent before the save is older, so takeEdits sets it aside in the
  backups. A GitHub skill saved here reads as Changed here, so an update
  asks first.
- The page (viewSkill in plugins/library/client.js) draws a Markdown
  file with the Plugins page's own renderer (plugins.js exports it as
  window.mdRender, 27 bytes of core script) and its front matter as
  rows; other files as text. Edit swaps in a text box; Save or ⌘S/Ctrl+S
  sends it; Cancel asks when there are changes. Other files are the
  app's menu under the name (no native select). New code is in the
  library plugin, so the core script budget is not raised.
- SkillText is gone (its only caller was the route). One new string, in
  all five languages. docs/subsystems/library.md says all this.

Run on mote at the change rebased on 9335e23d3:
- go test -count=1 -timeout 45m ./internal/library ./internal/gui
  ./internal/cli: library ok. gui: TestCoreScriptBudget passes; the only
  red is TestMainWindowCorners/macOS_26_SDK (#3949, mote's macOS 27).
  cli: the only red is TestEveryRouteHasACommandOrIsNamed on GET
  /api/context/reply (#5026, from 0872bc2a0). Both are red on main and
  filed.
- GOOS=linux and GOOS=windows go vet -tags nogui on the three packages;
  gofmt -l clean.
- skill-edit.test.cjs: 22/22 (chromium and webkit; en, zh, zh-TW, ja,
  de; 860px and 400px). It checks the drawn Markdown and front matter,
  no sideways scroll, ⌘S posting the exact body with `was`, the status,
  the file menu, Cancel sending nothing, Save on a second file, no click
  scrolling the page, no left-border stripe or gradient. i18n-keys ok.
- Whole GUI suite (a new API call), on the Linux box (wsl-run; mote had
  two other full suites): ~4460 of its results in at the push, not
  finished. Its reds are all WebKit and none is in a file this touches.
  The ones near it, run alone at this change and at origin/main
  bc10a6198: click-scroll, found-skill-pick-remove and account-eye fail
  the same on both (#4385, #4097/#5013, #4244).

Again at the pushed head (rebased on b967b1620; its commits change
app.js and the core budget), on the Linux box: TestCoreScriptBudget ok,
go test ./internal/library ok, gofmt -l clean, skill-edit.test.cjs and
i18n-keys 26/26.

Broken by hand: without the `was` check, without the linked-folder check
and without the CRLF handling, TestSkillFileSaveRefusesAChangedFile,
TestSkillFileStaysInTheSkill and TestSkillFileKeepsLineEnds each went red.
skill-edit.test.cjs on the old assets: 0/11 in chromium (.lib-mdview
never appears).

Not tried: refeccd's own skills (the fixture is a made-up handover from
~/.agents/skills, with a copy agent and a link agent); the real app
window (the GUI tests fake the API); the TUI and CLI, which have no
editor; making, renaming or removing a file from the page; Windows.
2026-11-03 16:33:03 +08:00
yetone 277c911658 plugins: a plugin's Sign in asks which subscription, and Qoder CN is Qoder 中国版 in Chinese
小武 on Discord: "Qoder 只支持国际版 请添加 Qoder中国版", then "有Qoder CN
没有添加账号的入口". The Qoder plugin serves four subscriptions (qoder,
qoder-cn, qwenwork, qwenwork-enterprise), but the Plugins page's Sign in
on its card and on its Installed row always took the first one not signed
in, qoder.com. Qoder CN was never offered there. In the Add sheet it was
called "Qoder CN" in every language, so a search for 中国版 found nothing.

- plugins.js: with more than one subscription not signed in, Sign in opens
  the app's menu (openProtoMenu), headed "Sign in to which subscription"
  and listing each one by its Add-sheet name (subName). With one, it signs
  in to it directly, as before. The Installed row says "Sign in to
  another…" when more than one is left. The pm-sub lines and tips use the
  same names.
- app.js: the qoder-cn SUBS entry's name goes through t(). openProtoMenu
  passes the click event to a single-choice choose, so the sign-in it
  starts has a fresh trusted event.
- i18n.js: Qoder 中国版 (qoder.cn) / Qoder 中國版 (qoder.cn) / Qoder 中国版 /
  Qoder CN, plus the menu's heading and "Sign in to another…", in zh,
  zh-TW, ja and de.
- The core scripts' budget is unchanged. The ~800 bytes added are paid for
  by cutting two of plugins.js's GitHub-section comments
  (1,533,657 <= 1,533,802).

The registry's Qoder summary was updated to name Qoder 中国版 in
magpie-community/plugins 2595d48. No plugin code changed, so there is no
new npm version and no mover min raise.

Run at 3b3d32724 (this commit plus the next commit's market.json), rebased
on origin/main ce2e81da1, on mote:
- GUI: plugin-pick-sub (new), plugin-two-subs, plugin-replaced,
  qoder-cn-tile, signin-closes-sheet, i18n-keys, plugin-github,
  plugin-github-filter, plugin-github-hooks, plugin-github-wait and
  plugins-more-discover, chromium + webkit: 146/146 ok.
- go test ./internal/plugin ok; go test -run 'Budget|I18n|Lang|Words'
  ./internal/gui ok (TestCoreScriptBudget).
- Before the rebase, 82 reachable GUI files (anything naming plugins,
  Qoder, Sign in to, pm-row or pm-card, plus i18n and gui-*), on mote at
  load ~270: 1122/1145 ok. The reds that failed again when run alone fail
  the same way on origin/main a4916aec1 and ce2e81da1:
  - segs-press-redraw searchAllRow (#4566);
  - usage-fold "most on one screen" (#4790);
  - plugin-move-unserved "Try again" (#4410, #4392);
  - plugin-card-update webkit (#3079);
  - TestMainWindowCorners (#3949).
  account-mask, sessions-toolbar and signin-closes-sheet passed when run
  alone.

Again after rebasing on origin/main 834c6c7df (which changed
internal/plugin and gui/providers.go), at this tree: plugin-pick-sub,
plugin-two-subs, plugin-replaced, qoder-cn-tile, signin-closes-sheet,
i18n-keys and account-rows-fit, chromium + webkit, 69/69 ok;
go test ./internal/plugin ok; ./internal/gui Budget/I18n ok.

Broken by hand: with signInTo always signing in to the first subscription,
plugin-pick-sub goes red (en and zh, 980 and 420, chromium).

Not tried:
- a real Qoder CN sign-in, or the real app window (the GUI tests fake the
  API);
- the Linux WebKitGTK app;
- the whole GUI suite after the rebase.
2026-11-02 14:49:36 +08:00
yetone e65bc84731 plugins: a git plugin updated past the commit the look found waits no more (#4802)
matrix0487 (Discord, #4802): github:faithleysath/magpie-oh-my-aihub, unpinned.
The look at 14:38:55 wrote {version: fdaa691, latest: 3b411a5}; the repository
moved on to ba898e7 twenty seconds later, and Update installed ba898e7. The
dot, "Update all (1)" and the row's New commits stayed until the next hourly
look, and every Update after said only "is up to date".

Cause (checked against the source, as the reporter traced it):
- PendingUpdates kept a git entry until the commit installed was the
  recorded latest (GitBehind is installed != head, not "behind"), so a commit
  newer than latest kept it forever. The npm branch compares versions in
  order and was right.
- Upgrade, Update and add never touched plugin-updates.json; only the next
  CheckUpdates/CheckNow rewrote it.
- The page kept /api/plugins/git's old head (3b411a5) in its heads map, and
  merge() put it over the plugins' own fresher head after the update, so the
  row's New commits and Update all stayed even with the file right.

Changes:
- waitsNoMore (shared by PendingUpdates and the new settleWaiting): a git
  entry also waits no more once the commit installed is not the one the look
  saw installed (Version).
- settleWaiting rewrites plugin-updates.json without what waits no more,
  after add (every install, npm Upgrade, Update's pinned path), a git
  Upgrade, Update (Update all) and InstallMissing. Checked time is kept.
- reinstall's #2954 "left it at X" error now needs the commit to have stayed:
  a moved install that can't ask the repository again (rate limit, offline)
  isn't reported as stuck on the look's older head.
- plugins.js: an action on a plugin (Update all: on every one) drops the
  page's cached head for it, so the plugins' own head is drawn; a git Update whose
  commit moved says "{name} updated to {commit}" (zh, zh-TW, ja, de), and
  the Up to date chip's tooltip prefers the row's head over the check's.

Siblings: npm (version order already right; now also rewritten on file),
a commit pin (dropped once at the pin: test case), Update all (same flow as
Upgrade: test case), the toast (above). CheckNow/CheckUpdates rewrite the
file as before.

Tests (reporter's literal fdaa691 / 3b411a5 / ba898e7):
- TestGitWaitingGoneOnceUpdatedPastTheLook: installed ba898e7, 3b411a5, another
  commit, still fdaa691 (waits), and a pinned spec.
- TestSettleWaitingRewritesTheRecord: git + npm entries gone from the file.
- TestGitUpdatePastTheLookWaitsNoMore: fake bun + fake GitHub; look, push,
  then Upgrade / Update / Upgrade with GitHub down after; nothing waits on
  file or in PendingUpdates, and the update isn't an error.
- plugin-git.test.cjs: the repository moves on after Check for updates;
  Update installs ba898e7, no New commits, no Update all, toast names it.

Run at the pushed head (rebased on 99d9016fd), on mote:
- After the last rebase onto 16ce5ed23 (quotaall.js, i18n.js): internal/gui
  TestCoreScriptBudget ok, i18n-keys and plugin-git in both engines 10 of 10.
- gofmt -l internal/plugin internal/gui: empty. go vet darwin, linux
  (nogui) and windows on internal/plugin, gui, provider: ok (at d2a83de61;
  only plugins.js changed after).
- go test internal/plugin, internal/provider: ok. internal/gui
  TestCoreScriptBudget: ok, 1,533,780 of 1,533,802 with no room added (the
  JS's comments cut to one).
- go test internal/gui and internal/cli at d2a83de61: ok except
  TestMainWindowCorners (#3949), TestSettingsCLISetsWhatTheWindowSaves
  (#4793) and TestEveryRouteHasACommandOrIsNamed (#4794), main's own.
- node --test plugin-git, plugin-update-button, plugin-updates,
  plugin-check-updates, plugin-card-update, i18n-keys (chromium + webkit,
  every language they cover): 54 of 56; the 2 are plugin-card-update webkit
  waiting 5s for the card's Update button before any click, red 2 of 3
  alone at this head and 2 of 3 alone at origin/main 99d9016fd (#3079).
- Before the rebase, every plugin-*.test.cjs + i18n-keys +
  account-plugin-user: 956 of 960, the 4 being plugin-move-unserved's "Try
  again takes the models unticked", equally red at de7953e3b (#4410).

Broken by hand (on mote, then restored):
- all three Go parts removed: all three new Go tests red (the reporter's
  ba898e7 case keeps Waiting; the file keeps both entries; Upgrade/Update
  keep it waiting, and the GitHub-down Upgrade errors "left it at ...").
- plugins.js without the heads line: plugin-git red in both engines (New
  commits still shown, 6 of 6 red).
- only settleWaiting a no-op: TestSettleWaitingRewritesTheRecord and the
  on-file check of all three TestGitUpdatePastTheLookWaitsNoMore cases red.

Not tried: the reporter's real repository or a real bun against GitHub (the
fake bun and fake GitHub API stand in); the Windows and Linux apps.
2026-11-02 03:54:00 +08:00
yetone 276c806db2 plugins: a plugin's own requests are counted; a provider plugin's options get the editor (plugins#592)
zelong77 asked for two things once Devin 0.1.30's cache keep-alive
worked: its pings were invisible in magpie, and the interval and ping
count could only be edited in plugins.json. The owner decided pings are
shown as counted usage and the two numbers are edited in the GUI.

- host.js gives plugins input.magpie.usage(provider, call) and
  input.magpie.account(provider). usage validates the call (kind
  [a-z0-9_-]{1,40}, a model id, whole-number tokens from 0, status at
  most 999, error clipped to 500) and sends an unasked "usage" event;
  host.go hands it to plugin.OnUsage in the background.
- internal/usage/plugin_calls.go writes each one as a row of agent
  magpie on the plugin's provider (provider.PluginID) and account
  (provider.PluginAccountUser), with its kind. It is counted, priced
  and in every total, not a probe. Kind cache_keepalive is in the
  purpose catalog as "Cache keep-alive" (five languages), so the
  request log names and filters it. The ping itself still goes straight
  to Devin, never through the gateway, which would break the cache.
- /api/plugins reads every plugin's package options example, not only a
  middleware's or request hook's, and the Installed row offers the same
  Options JSON editor for a provider or agent plugin that suggests or
  has options (not while it is off). Clear's confirm no longer calls
  them a middleware's options.
- The Devin mover's min is 0.1.31, which reports each ping and gives
  its two settings' defaults (285 s, 6) to the editor. npm has 0.1.31
  (published 10:03Z); the plugins publish run is red only for
  think-tags' known E404 (plugins#180).
- docs: provider-plugins.md (the API, the options editor),
  gateway-sessions.md (the counted row beside probes).

Run at this tree (rebased on origin/main 85e37162e):
- mote (mote-run): go test -count=1 -timeout 45m ./internal/plugin
  ./internal/usage ./internal/gui ./internal/provider: plugin, usage,
  provider ok; gui red only in TestMainWindowCorners/macOS_26_SDK, the
  macOS 27 red already filed as #3949 (not this change's code).
- mote: GOOS=linux and GOOS=windows go vet of plugin, usage, provider ok;
  gofmt -l clean.
- mote: plugin-provider-options.test.cjs (new, 5 languages, 980/420px,
  Chromium + WebKit), plugin-gateway.test.cjs and i18n-keys.test.cjs:
  28 of 28 pass.
- The whole GUI suite (make test-ui) on WSL magpie-desktop (mote was at
  load ~100 with other sessions' suites, #4125), at the 8f804396f base:
  cut off after 498 test entries, when the session's background jobs
  were killed; 495 ok, 3 red, none on a page this change touches. Run
  again alone at origin/main 85e37162e, the same files are red there
  too: account-eye webkit (#4244), agent-expand-steady webkit 980px
  (#2935), add-button zh's 3000ms waitForFunction (filed #4792). The
  rest of the suite was not run.
Broken by hand (each red, then put back):
- host.go dropping the "usage" event: TestPluginReportsOwnUsage fails.
- plugins.go reading optionsExample for middleware/hooks only:
  TestProviderPluginOptionsExample fails.
- purpose.go without the Cache keep-alive kind:
  TestPluginKeepaliveIsCounted fails (purpose {}).
- plugins.js without ownOpts: plugin-provider-options.test.cjs times
  out waiting for the Options button in every language.
Not tried: a real Devin account's keep-alive ping reported into a real
magpie (needs a live Devin conversation idle for 285 s); a plugin can
report a row for any provider id, as magpie.load can.
2026-11-01 22:14:19 +08:00
yetone a6217e83d3 plugins: a plugin npm said nothing of offers Install, not Coming soon (zhudabao8433 on Discord)
zhudabao8433 on Discord (#general, 11-01): PowerContext
(@magpie-community/gateway-powercontext) could be installed yesterday and
today reads 即将上线 again.

Cause: PowerContext was never pulled. It is in registry.json since
plugins 1e4c8a2 (10-29) and on the dist branch (0.2.0, every dist commit
since), and not on npm (E404), so magpie learns its version from the
dist branch's ~1.7MB index.json. Coming soon is drawn whenever a listing
has an npm answer with no version, and three paths gave one without
anything confirming the package is missing:
- builds before v0.1.2413 kept a dist read cut off at npmEach (6s) as
  "not on npm" in plugin-npm.json (ferock, e0eb74987). After an update,
  InfoCached (the listings) and Info ("what it said last") still served
  that empty answer while a new ask couldn't read the branch;
- the page turned every listing /api/plugins/npm said nothing of
  (unknown: npm or the branch not read in time) into { weekly: 0 }, i.e.
  Coming soon, and never asked again;
- /api/plugins/market gave every listing &NPM{} even when Info had no
  answer for it.

Fix:
- market.go: a cached "not on npm" over an hour old is unknown
  (npmEntry.missingStale): left out of InfoCached and of Info's seed.
  One said within the hour stands, as before.
- plugins.js: a listing npm said nothing of is marked unknown ({ u: 1 }), which
  offers Install (installDist waits for the branch with its own read);
  the page asks again up to 4 times, 15s apart, and the answer replaces
  it. A listing npm answered with no version still reads Coming soon.
- plugins.go: pluginMarketState leaves NPM nil when Info has no answer.

Old data: an old "not on npm" is unknown once an hour old, for every
user, with nothing to do on their side.

Tests:
- TestStaleMissingIsUnknownWhileDistUnread (internal/plugin): an
  hours-old "not on npm" with the dist branch 503 is in neither
  InfoCached nor Info; a minute-old one stands; once the branch answers,
  Info has 0.2.0.
- plugin-npm-unknown.test.cjs: PowerContext with no npm answer shows
  Install (enabled), Qoder answered without a version shows Coming soon,
  and after the 15s re-ask (page.clock) PowerContext shows v0.2.0. en,
  zh, zh-TW, ja, de; 980 and 420px; Chromium and WebKit.

Run (mote, at this commit rebased on origin/main 36af588e2):
- gofmt -l clean; go vet darwin, GOOS=windows, GOOS=linux -tags nogui on
  ./internal/plugin/... ./internal/gui/...: ok.
- go test -count=1 -timeout 45m ./internal/plugin/...: ok.
  ./internal/gui/...: TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
  TestMainWindowCorners/macOS_26_SDK (#3949) red, the same on an
  origin/main 36af588e2 copy; TestCoreScriptBudget green (plugins.js is
  1 byte under main's, a comment cut, no raise).
- node --test plugin-npm-unknown (22/22), plugin-market, i18n-keys: ok.
  plugin-market webkit "the Plugins tab" was red once in the run after
  the Go suite, its output lost; 3 of 3 green after, alone.
- Broken by hand: the Go test is red on origin/main's market.go (an
  hours-old "not on npm" served; want it unknown); plugin-npm-unknown is
  red (waits for Install) on origin/main's plugins.js.
- Earlier GUI batch (70 files: plugin*, market*, i18n*,
  deprecation-notice, list-sort), before the rebase: 968/974; the reds
  are plugin-move-unserved (#4410, #4392, red the same on main) and
  plugin-github-filter chromium en 420px, batch only (#4679).

Not tried: a real slow network from China; zhudabao8433's version is not
known.
2026-11-01 12:12:05 +08:00
yetone f85a221c96 plugins: a plugin installed twice says "another copy" once, not its own name per provider (plugins#565)
ferock (plugins#565) installed the CodeArts / OfficeAce plugin from two
specs. Each copy serves codearts and officeace, so each card got one
clash line per provider, built from the other copy's shownName, which
is the card's own name. In zh it read "CodeArts / OfficeAce 也登录 CodeArts;
由这个插件提供" and then again for OfficeAce.

clashLine is now given groups (clashGroups): a row's clashes grouped by
side (served here or by the other plugin) and by which specs they clash
with, with the provider names joined. When every other spec's name is
this row's own name, the line says another copy of this plugin ({spec})
does it. Otherwise several names use new plural keys, and one name uses
the old key. All four new keys are in zh, zh-TW, ja and de. The
existing zh and zh-TW singular line now reads "{other} 也能登录 {name},
现由这个插件提供" in place of the clipped "也登录 …;由这个插件提供".

Run on mote, at this tree rebased on origin/main 3d063e34f:
- plugin-clash.test.cjs: the new test, "one plugin installed twice
  says so once, not by its own name", covers both specs, every
  language, widths 1100 and 560, Chromium and WebKit. It passes, and
  with the old plugins.js and i18n.js (stashed) it is red, as are the
  zh and zh-TW `serves` lines.
- i18n-keys, gui-de/ja/zh-tw, dates-gui-lang and every plugin*.test.cjs
  in Chromium and WebKit. Before the rebase: 891/899 and 461/468 pass.
  origin/main 3d063e34f alone: 869/877 and 450/457. Every red is the
  same on main, and each is filed: gui-ja's {agent} (#4580, filed here),
  i18n-keys "Unmarked" (#4524), plugin-move-unserved Try again (#4392),
  plugin-card-update (#3079). plugin-namesake ja 440 and the
  "Install asks first" case were red once in the full run. Rerun at
  this head with plugin-card-update, plugin-replaced, i18n-keys,
  gui-zh-tw and gui-de in both engines, they pass (80/81, the one
  red is #4524).
- go test -tags nogui ./internal/gui: the only reds are
  TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestColdTurnsTaken
  (#4510), both red at 3d063e34f alone. The budgets pass.

Not tried: the real app with the plugin installed twice. The full GUI
suite beyond the plugin and i18n files was not run either, since the change adds no
API call and no shared class or layout.

Rebased on 3ecc02b78 (nav-lamp only), then 73a12e8bf (wsl, no GUI files): after the rebase, plugin-clash and nav-lamp
pass in both engines (32/32 each) and the budget tests pass.
2026-10-31 21:31:09 +08:00
yetone d8cf4f74f9 plugins: a plugin's package.json names its row with magpie.name (#4558, MYCF711)
A plugin installed from git whose package.json says
"magpie": { "name": "华为云 HUAWEI" } read as its dependency key
(magpie-officeace) on Settings → Plugins. Bun takes no non-ASCII key, so
a package outside the community's list had no way to show a readable
name. magpie.name was never read at all: #3608's route (MYCF711's branch
1cc33700) didn't reach main, so no release has it, git or npm.

plugin.InstalledName reads magpie.name from the installed package's own
package.json, beside magpie.icon (installedOwn, one parse for both): one
line of at most 80 bytes, no control or format characters (a bidi
override would show it as another name), else nothing. /api/plugins gives
each row it as ownName, and plugins.js's shownName takes it after the
community list's name and before the git package or the spec, so a
listed package is still named by the list. The row's page, the "is up to
date" status and every message that names the row (options, prefer, Update
all) go through shownName; a page plugin's sidebar tab takes it when the
page names no title (windowParts). It is never used to resolve a name and
never shown with the community badge. Not changed: the CLI's plugin list
(the dependency key, as the reporter expects), Discover's cards for
uninstalled GitHub/npm packages, and magpie.summary. Documented in
docs/reference.md and site/public/docs (en, zh, ja).

Run:
- mote: go test -timeout 45m ./internal/plugin/ ./internal/gui/ — plugin
  ok; gui red only in TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
  the AppKit window tests killed at their deadline (TestPanelCloseHidesIt,
  TestPluginPageLoadsItsFilesInTheWindow, TestMainWindowCorners, …;
  #4125, #2645). The first three run the same red on origin/main 7aa67e9e5.
- mote: go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet on
  internal/plugin and internal/gui: clean. gofmt -l internal/: nothing.
- wsl-run (magpie-desktop): plugin-own-name.test.cjs, Chromium and
  WebKit, en/zh/zh-TW/ja/de at 980 and 420: 22/22. Every plugin*,
  plugins-*, agent-plugin*, account-plugin*, signin-paste-plugin,
  sidebar* and i18n-keys file (67): all green but i18n-keys "a plugin's words are its own" (#4524), plugin-card-update webkit en/zh (#3079) and plugin-github-filter webkit ja 420px (#4564, filed now), each red the same at origin/main 7aa67e9e5
- Rebased on origin/main 7b883cc61, mote: -run "Budget|OwnName|TestPluginsState|
  TestWindowParts" on internal/gui and internal/plugin: ok (core scripts
  under the budget, no raise).

Broken by hand:
- InstalledName returning "": TestPluginsStateGivesAGitPackagesOwnName red
  (ownName "", and the sidebar title magpie-officeace).
- shownName without e.ownName: plugin-own-name.test.cjs red, the row
  reads 'magpie-officeace'.

Not tried: the desktop window itself, and a real git repository with
magpie.name (the fixture is shaped from the reporter's installed
package.json: name magpie-officeace, version 0.2.4).
2026-10-31 18:30:39 +08:00
yetone e647a1fd54 plugins: an npm registry of the user's own is used for installs and lookups (timwangdev on X)
timwangdev asked on X for plugins to take a custom npm registry. Zero-config
first: Registry() (internal/plugin/registry.go) takes, in order, the one set
in magpie (settings npmRegistry: `magpie plugin registry <url>|default`, or
Plugins › Discover's new npm registry row), BUN_CONFIG_REGISTRY /
NPM_CONFIG_REGISTRY / npm_config_registry in magpie's environment, then the
login shell's (cached probe only, proc.LoginEnvKnown, never waits on a
shell), install.registry in the plugins folder's or the user's .bunfig.toml,
registry= in the plugins folder's or ~/.npmrc, then the 国内镜像 switch's
npmmirror, then npm's own. The switch no longer puts npmmirror over a
registry the user named: before, bun was handed BUN_CONFIG_REGISTRY=npmmirror
whenever it was on, over the user's .npmrc. bun is told the registry only
where it wouldn't find it itself (magpie's setting, the shell's, the
switch's). magpie's own npm questions (latest version for the market,
Update and the hourly check, README, search) go to the same registry, a
package's @scope:registry= to that scope's, with the .npmrc's
//host/path/:_authToken (${VAR} expanded, longest prefix) sent to that host
alone, dropped on a redirect to another host, never logged or shown.
Download counts stay npm's. Only http(s) with a host, no userinfo, query
or fragment is taken; anything else is refused and not saved, and a bad
value hand-written into settings.json is passed over. /api/plugins says
which registry is in use and where it came from.

The GUI row is in registry.js, imported when Discover draws it, so the
core script budget isn't raised (plugins.js is 292 bytes smaller than
before, one long comment there condensed).

Left out: bunfig [install.scopes] for magpie's own lookups (bun reads them
for installs), .npmrc _auth and username/password, NPM_CONFIG_USERCONFIG
and npm's global npmrc, and internal/agent/cliupdate.go's agent CLI update
lookups, which still ask npm's own.

Run (mote and wsl-run). First at this change on 2ac423f4f:
- go test ./internal/plugin/ ./internal/source/ ./internal/gui/
  ./internal/proc/ ./internal/cli/ ./internal/settings/ -timeout 45m:
  plugin, source, cli, settings ok. gui: only the real-window AppKit tests
  killed at their deadline on mote (dock, panel, titlebar, tray; #2645,
  #4125), TestCoreScriptBudget and TestSettingsSaveKeepsWhatItDoesNotSend
  green after the fixes in this commit. proc: TestNoCommandBypassesProc red
  on origin/main itself (internal/claudetui/tui.go:183), filed as #4491.
- gofmt -l internal: clean. GOOS=linux go vet -tags nogui ./... and
  GOOS=windows go vet ./...: ok.
- GUI (wsl-run, magpie-desktop): plugin-registry.test.cjs in Chromium and
  WebKit, 5 languages each, 980px and 380px; i18n-keys, old-webkit and
  plugin-market (WebKit): 19/19 pass. On mote the browser runs timed out
  launching (#4125).
Again at this tree rebased on fa5e86cf2 (upstream changed app.js and
i18n.js): go build ./...; go test ./internal/gui/ ./internal/cli/
./internal/plugin/ ./internal/settings/: cli, plugin, settings ok, gui only
the same ten AppKit window tests killed on mote (#2645, #4125), the core
budget green; gofmt clean; plugin-registry (Chromium, WebKit), i18n-keys
and old-webkit on WSL: 22/22 pass.
Rebased once more on 45de2ddb9 (app.js and i18n.js again): gofmt clean,
go vet of gui and plugin ok, TestCoreScriptBudget and
TestSettingsSaveKeepsWhatItDoesNotSend ok, i18n-keys 4/4.

Broken by hand, each red, then restored:
- A: old registryEnv (npmmirror whenever the switch is on):
  TestBunTakesTheUsersRegistry red.
- B: lookups always to npm's own: TestLookupsAskTheUsersRegistry red.
- C: no URL check: TestSetRegistryRefusesWhatIsntOne red.
- D: the switch before the user's registry: Precedence, BunTakes and
  Lookups red.
- E: no token sent: Lookups red.
- F: scopes ignored: Lookups red.

Not tried: a real private registry (Verdaccio, GitHub Packages, Nexus) with
a real token; a real bun install through one; Windows (the login shell
probe is a no-op there, so only env, bunfig and .npmrc apply).
2026-10-31 04:24:59 +08:00
yetone 40af660275 gui: failed calls told through statusErr, statusTErr and settingsErr (#3685)
origin/main 101775657 is over both of its own budgets (core 1,536,777
of 1,536,586, app.js 1,315,507 of 1,315,316), and Coffemon's batch on
it came to core 1,536,973. Calls that spelled out the same error line
now share a helper, with no change in what they do:
- statusErr (already there): the tray panel's Manage opening the
  window (46fb0c1b9), signAsk's failed load of signsheets.js (no
  caller reads its return value) and the sync row's Show.
- statusTErr(e), status(t(e.message), "err"): 14 calls in app.js and
  the Plugins page's mirror switch in plugins.js, plus 3
  .catch((e) => status(t(e.message), "err")).
- settingsErr(e), statusTErr then renderSettings: the 8
  .catch((e) => { status(t(e.message), "err"); renderSettings(); }).
Main's own red was fixed in e94bf7a08 (restBack) while this was
run; on that main the batch is core 1,536,265 of 1,536,586 with
this commit, still over it without. No local t or renderSettings shadows the globals at any of them. Core
1,536,454 of 1,536,586, app.js 1,313,140 of 1,315,316; no budget
raised. TestCoreScriptBudget is red without this commit (1,536,973).

What was run, go1.26.8: TestCoreScriptBudget, TestMainURL and
TestMainView on mote (ok). In Linux (wsl-run), both engines:
copilot-ghe, claude-setup-token, panel-switch-accounts,
claude-switch-only, status-long, webdav-settings-refresh,
sync-not-backup, sync-other-kind, claude-auth-status,
revoked-signin-account, plugin-signed-out-account and i18n-keys
before the statusTErr part (229 pass, 1 fail: copilot-ghe zh in
WebKit, the route-after-close flake red on main 244d80e23 too,
#1949); then agent-prefs,
cli-update(-admin), disabled-models, gateway-mode, github-token(-refused),
mask-actions, masking-records, name-suffix-saved, privacy-model,
redact-rule-edit, settings-general, settings-proxy-auth,
tray-usage-redraw, uninstall-settings, update-mirror, warm-at-own,
i18n-keys, plugin-installed-unnamed and plugin-signin-scrolls: 499
pass, 5 fail, redact-rule-edit at 420px in WebKit, red the same on
origin/main 101775657 (#3407, #4120).
Broken by hand: a first cut whose statusTErr called itself sent
github-token, redact-rule-edit and update-mirror red (30 fail), so
these files reach the error paths.
Not tried: the whole GUI suite (#4125); the real app's window.
2026-10-30 15:59:56 +08:00
JoeyWu-tech dc0ec94d89 plugins: a repository's package.json name no longer hides npm's package (#3685)
A search left out npm's card of any package a tagged repository's
package.json names, as if npm's package were that repository's. It is
only when npm has the package from that repository, and then the
repository's card is installed by npm's name (ghListing's spec).
Otherwise npm's package of that name, if npm has one, is another plugin,
which a search never showed.

Now a search leaves out npm's card only of a listing's package, or of a
tagged repository's that npm has from that repository, whose card
installs by npm's name. npm's package of a name another repository's
package.json gives stays, and its Install asks before it takes an
installed repository's place (the first commit).

Not changed: the GitHub section drops a tagged repository whose
package.json names a listing's package (`listed`), the same rule the
other way. Showing those would put repositories named like community
plugins beside them, and that's the owner's call (#3929). Both sets are
built from every listing and tagged repository, not from what the query
left, as before. An npm card installs by the bare name, which resolve
takes for a community plugin's where one is called by it (#3928).

plugins.js grows 153 bytes, the core's scripts to 1,530,343 of
1,530,449: 2,028 bytes for the three commits, in the 2,134 the room
makes.

What was run (tree a5364df0, on origin/main 174250b2, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, the Go tests at umask 077:
- plugin-namesake, with Node 22.22.1 and Playwright 1.62.1, in Chromium
  and WebKit: green, the ten new cases and the commits before's thirty,
  in each engine. The new test, in en, zh, zh-TW, ja and de at 980 and
  440px, has mu-zi-lee's repository installed, fakes npm with a package
  of the name both repositories' package.json give, and searches
  "free-model": npm's section shows that package, whose card reads
  Install, and not npm's card of a package npm has from a repository on
  the page.
- the commit before's plugins.js under it, in Chromium, which is main's
  `known`, the one line of code this commit changes: red in all ten,
  npm's section offering no card to install.
- npm's and git's answers held 150, 300 and 450ms (the page draws each
  card again as they come), each delay written into a copy of the test,
  in Chromium and WebKit: green at each delay, all forty cases in each
  engine.
- i18n-keys, which reads the strings with no browser: 4 of 4 pass.
- TestCoreScriptBudget: pass.
- old-webkit, which parses every script for syntax and built-ins newer
  than Safari 15.0 and draws each page in WebKit without those
  built-ins: 6 of 6 pass.
- gofmt -l clean. go vet -tags nogui for linux, windows and darwin, go
  vet for windows, go build -tags nogui for linux and darwin and go
  build for windows: exit 0 each. go vet and go build without the tag on
  linux: exit 1 (no libsoup-3.0 or gio-unix-2.0 here).
- 70 GUI files, each alone in Chromium and in WebKit (DISPLAY unset):
  the 53 plugin*.test.cjs, the 12 whose code names app.js, plugins.js or
  context.js (4 of them plugin ones), 8 more that open the Plugins page
  (builtins, deprecated-subscriptions, list-sort, modal-centred-late,
  settings-lines-wrap, settings-tabs-stick, skeleton-bird and
  title-bar-tools), and i18n-keys. 64 green in both. Red here and, run
  alone again, at 174250b2: plugin-card-update in WebKit, en and zh
  (#3079); plugin-github in WebKit, de at 440 (#3218);
  plugin-github-wait in Chromium, de at 440 (#4099); settings-lines-wrap
  in both, de at 440px (#4026); title-bar-tools in both, de in Chromium,
  and in WebKit ja, de and en here and zh, zh-TW, ja and de there
  (#2740); modal-centred-late in WebKit at 560px (#4116).
- go test -tags nogui -count=1 -timeout 45m ./... (Bun 1.4.2; 9m02s,
  load 24 at its start): 71 packages ok, and 15 tests red in 6 packages,
  each filed: agent TestInstalledVersion, TestHowInstalled,
  TestCursorFolderFromTheEditorIsNotTheCLI,
  TestCopilotFolderFromAnIDEPluginIsNotTheCLI,
  TestQoderSettingsFromAnIDEPluginIsNotTheCLI and
  TestOmpDetectedWithPiDir (#3141), TestCodexDriftReached (#3398),
  TestReasonixCLIRequiresSupportedNativeVersion and
  TestReasonixCLIRecoversAfterProbeTimeout (#3641); davsync
  TestSyncTeraCloudStillSeesOtherWrites (#3420); edit
  TestWriteAtomicReadOnlyHardLink and testenv TestProgram (#3640, at
  umask 077); gateway TestPluginToldWhereTheAgentWorks (#3675, an empty
  .git above TMPDIR); gui TestGatewayHeldByAContainer and
  TestGatewayFixQuitsOnlyAMagpie (#3649).

Not tried: the real app, and a search of the real npm and GitHub; the
API is faked.

Landed by yetone in a batch of Coffemon's patches from the issues.
What was run, go1.26.8, on origin/main cc81ad4ea, then again at
70a0c387c (gofmt, the three vets, the changed tests, umask 077):
- mote (macOS 27): gofmt -l clean; go vet, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet ./...: ok. edit and testenv at umask
  077; agent, provider, library and gateway with an empty .git above
  TMPDIR; davsync, imagemcp, plugin, library, edit, testenv whole; the
  changed tests in agent, provider, gateway and gui; the timing tests
  -count=10 (gateway, davsync, imagemcp) and -count=5 (agent): all ok.
  TestCoreScriptBudget ok: core 1,536,751 of 1,537,034, app.js
  1,312,975 of 1,315,316, no budget raised.
- Red on the old code: on origin/main, TestWriteAtomicReadOnlyHardLink
  at umask 077 and two Reasonix tests under an empty .git; on Linux
  (wsl-run) TestProgram at umask 077 with the old program.go. With
  each fix's code taken back to main's, the Gemini imageConfig tests,
  TestPluginToldWhereTheAgentWorks, TestSkillRepoTraced,
  TestTaggedHooksAlone, TestMainURL/TestMainView and update-auto,
  plugin-github-hooks, plugins-more-discover, plugin-namesake were
  red. Broken by hand: claudeKeyed always true (both
  OwnEndpointNeverAsked tests red), claudeAsk a no-op
  (TestClaudeFirstWriteAsksTheProxy red), GitAt taking any .git folder
  (the three TestGitOnDisk tests red).
- GUI: 123 files (plugins*, update-*, panel/tray/start/context, i18n,
  gui-zh-tw/ja/de and every file that evals app.js parts) in WebKit on
  Linux (wsl-run). 11 files had reds (click-scroll, panel-fold,
  plugin-card-update, plugin-github, plugin-move*, segs-glide,
  tray-totals, update-*), and run again side by side they fail the
  same on origin/main d80d75f30 (79 pass, 26 fail here; 78 and 27
  there). They are click-scroll guards ("the click must not scroll
  the page"), varying by language from run to run (#4385).
  copilot-ghe's route-after-close red is #1949, seen on main 244d80e23
  too. In Chromium on mote, Chromium segfaulted partway through files
  (#4125): context-map, context-scroll-end and context-tune fail the
  same on origin/main 0911a65e7, so the batch's own files
  (plugin-namesake, update-auto, plugins-more-discover,
  plugin-github-hooks) ran in Chromium on Linux: 62 of 62.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., mote)
  at 472a0608f (on 70a0c387c): every package ok but internal/gateway,
  whose five reds were #4362's (Antigravity turned-away and
  TestCodexSpentGrokFailingIsTold), fixed on main in d80d75f30. After
  the rebase on 244d80e23 the five pass, and gofmt, the three vets
  and the targeted runs above were run again: ok. In Linux the
  sign-in, copilot, plugin-github*, plugins-more-discover,
  plugin-namesake, plugin-gateway, update-auto, quota-refresh-order
  and i18n files ran in both engines: 475 pass, 4 fail (copilot-ghe
  #1949, plugin-github's click scroll, both red on main too).
- Rebased again on c7171a256, over its budget fix e94bf7a08: gofmt, vet of
  gui, gateway, provider and plugin, TestCoreScriptBudget (core
  1,536,265 of 1,536,586 with the batch's last commit, statusTErr and settingsErr), the Gemini,
  GitOnDisk and plugin tests, and in Linux both engines i18n-keys,
  update-mirror, plugin-namesake, plugins-more-discover,
  plugin-github-hooks and update-auto (138 of 138): ok.
Not tried: the whole GUI suite (mote's WebKit wouldn't launch and its
Chromium segfaulted, #4125); macOS WebKit; the real app's window.
2026-10-30 15:53:22 +08:00
JoeyWu-tech 7ea9056ae3 plugins: a GitHub card reads Installed only for the repository installed (#3685)
entryOf took a tagged repository's card for an installed git plugin of
the package the repository's package.json names, so a second repository
naming that package read Installed too. EchoChan314 (#3685) had
github:mu-zi-lee/magpie-our-free-model installed, and Gyarados4157's
repository of the same package showed a second Installed card, though
nothing of it was on disk.

Now a repository's card reads Installed only when the plugin installed
is that repository, by whichever spec names it: GitHub's shorthand, its
page, a git URL over https, ssh with a user, scp's colon or a port,
ssh.github.com and git://, owner/repo, in any case and with a ref.
ghRepo read only the shorthand, its page and owner/repo before. The
other repository's card reads Install, and its Install asks first (the
commit before), naming the spec installed.

One case turns from Installed to Install: a repository renamed or moved
on GitHub, installed by its old name. The page can't tell that from
another repository of the same package without asking GitHub, and the
latter is #3685, so it asks before a reinstall. And a card found by
another spec than its own (its page, a git URL) shows no Sign in, as the
page's URL didn't before: actionFor reads the sign-ins by the card's
spec (#3930).

plugins.js grows 41 bytes, the core's scripts to 1,530,190 of 1,530,449.

What was run (tree c3898368, on origin/main 174250b2, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, the Go tests at umask 077:
- plugin-namesake, with Node 22.22.1 and Playwright 1.62.1, in Chromium
  and WebKit: green, the twenty new cases and the first commit's ten, in
  each engine. The new test installs mu-zi-lee's repository by each of
  ten specs, in en and zh: its card reads Installed, Gyarados4157's
  reads Install, one card is installed, and Gyarados4157's Install asks
  to replace that spec, and Cancel installs nothing.
- the commit before's plugins.js under it, in Chromium: red for all ten
  specs in en and zh, Gyarados4157's card offering no Install.
- Broken by hand, in Chromium, each red, then put back:
  - ghRepo as on main, reading GitHub's shorthand, its page and
    owner/repo only: red for the six git URLs, in en and zh, mu-zi-lee's
    card not reading Installed
  - ghRepo without the port and ssh.github.com: red for the two specs
    with a port, in en and zh, the same way
  - entryOf as on main, taking a git install of the package a tagged
    repository's package.json names for that repository: red for all ten
    specs, in en and zh, as with the commit before's
- i18n-keys, which reads the strings with no browser: 4 of 4 pass.
- TestCoreScriptBudget: pass.
- The Plugins page's other GUI files, old-webkit, vet and the full suite
  ran at the last commit's tree, which holds this one.

Not tried: the real app, and a real install from GitHub; the API is
faked.

Landed by yetone in a batch of Coffemon's patches from the issues.
What was run, go1.26.8, on origin/main cc81ad4ea, then again at
70a0c387c (gofmt, the three vets, the changed tests, umask 077):
- mote (macOS 27): gofmt -l clean; go vet, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet ./...: ok. edit and testenv at umask
  077; agent, provider, library and gateway with an empty .git above
  TMPDIR; davsync, imagemcp, plugin, library, edit, testenv whole; the
  changed tests in agent, provider, gateway and gui; the timing tests
  -count=10 (gateway, davsync, imagemcp) and -count=5 (agent): all ok.
  TestCoreScriptBudget ok: core 1,536,751 of 1,537,034, app.js
  1,312,975 of 1,315,316, no budget raised.
- Red on the old code: on origin/main, TestWriteAtomicReadOnlyHardLink
  at umask 077 and two Reasonix tests under an empty .git; on Linux
  (wsl-run) TestProgram at umask 077 with the old program.go. With
  each fix's code taken back to main's, the Gemini imageConfig tests,
  TestPluginToldWhereTheAgentWorks, TestSkillRepoTraced,
  TestTaggedHooksAlone, TestMainURL/TestMainView and update-auto,
  plugin-github-hooks, plugins-more-discover, plugin-namesake were
  red. Broken by hand: claudeKeyed always true (both
  OwnEndpointNeverAsked tests red), claudeAsk a no-op
  (TestClaudeFirstWriteAsksTheProxy red), GitAt taking any .git folder
  (the three TestGitOnDisk tests red).
- GUI: 123 files (plugins*, update-*, panel/tray/start/context, i18n,
  gui-zh-tw/ja/de and every file that evals app.js parts) in WebKit on
  Linux (wsl-run). 11 files had reds (click-scroll, panel-fold,
  plugin-card-update, plugin-github, plugin-move*, segs-glide,
  tray-totals, update-*), and run again side by side they fail the
  same on origin/main d80d75f30 (79 pass, 26 fail here; 78 and 27
  there). They are click-scroll guards ("the click must not scroll
  the page"), varying by language from run to run (#4385).
  copilot-ghe's route-after-close red is #1949, seen on main 244d80e23
  too. In Chromium on mote, Chromium segfaulted partway through files
  (#4125): context-map, context-scroll-end and context-tune fail the
  same on origin/main 0911a65e7, so the batch's own files
  (plugin-namesake, update-auto, plugins-more-discover,
  plugin-github-hooks) ran in Chromium on Linux: 62 of 62.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., mote)
  at 472a0608f (on 70a0c387c): every package ok but internal/gateway,
  whose five reds were #4362's (Antigravity turned-away and
  TestCodexSpentGrokFailingIsTold), fixed on main in d80d75f30. After
  the rebase on 244d80e23 the five pass, and gofmt, the three vets
  and the targeted runs above were run again: ok. In Linux the
  sign-in, copilot, plugin-github*, plugins-more-discover,
  plugin-namesake, plugin-gateway, update-auto, quota-refresh-order
  and i18n files ran in both engines: 475 pass, 4 fail (copilot-ghe
  #1949, plugin-github's click scroll, both red on main too).
- Rebased again on c7171a256, over its budget fix e94bf7a08: gofmt, vet of
  gui, gateway, provider and plugin, TestCoreScriptBudget (core
  1,536,265 of 1,536,586 with the batch's last commit, statusTErr and settingsErr), the Gemini,
  GitOnDisk and plugin tests, and in Linux both engines i18n-keys,
  update-mirror, plugin-namesake, plugins-more-discover,
  plugin-github-hooks and update-auto (138 of 138): ok.
Not tried: the whole GUI suite (mote's WebKit wouldn't launch and its
Chromium segfaulted, #4125); macOS WebKit; the real app's window.
2026-10-30 15:53:22 +08:00
JoeyWu-tech 5e8ddf5003 plugins: Install asks before it replaces a plugin of the same package (#3685)
plugins/ holds one package of a name, so plugin.Add installs another
source of an installed plugin's package in its place: the old one is
removed, its options and Off carry over, and the sign-ins saved for the
providers it served stay with those providers (plugin-auth.json keeps
them by provider id) for whichever code serves them next. The Plugins
page did that with no word: a listing's card over a git install of its
package, a tagged repository's card over npm's package of the name its
package.json gives, and the field's Install ("Have one in mind?") over
either. EchoChan314 (#3685) had github:mu-zi-lee/magpie-our-free-model
installed, and worried that a click on the card of Gyarados4157's
repository, of the same package, would switch the source quietly. Once
that card reads Install, as it should, its Install would do just that,
sign-ins included.

Now Install asks first when it would take another source's place, and
names both by their source, a git spec or npm:<name> (resolve's word for
npm's own package). For #3685's two repositories it asks "Replace
github:mu-zi-lee/magpie-our-free-model with
github:Gyarados4157/magpie-our-free-model?" (in the field; the card asks
the same once the next commit has it read Install), and says only one of
them can be installed, that the old one is removed and its options and
sign-ins pass to the new one, and, when the old one is off, that the new
one is installed off too. Cancel installs nothing. The same repository
by another spec, npm's package at another version, and a package nothing
installed has, install at once as before.

The field asks the same for a repository the page has read, npm:<name>
and a scoped name. A bare name, which resolve may take for a community
plugin's, and a repository the page hasn't read are known only once
installed, so they install at once as before; #3927 has them, with
`magpie plugin add` and a backup's or a sync's plugins, which replace
the same way.

Not covered: npm's cards still send the bare name, so where it is also a
name a community plugin goes by, the dialog names npm:<name> while the
community package is what gets installed (#3928).

The strings are in zh, zh-TW, ja and de. plugins.js grows 1,834 bytes,
the core's scripts to 1,530,149 of 1,530,449, in the room the commit
before makes.

What was run (tree 7ca08da4, on origin/main 174250b2, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, the Go tests at umask 077:
- plugin-namesake, new, with Node 22.22.1 and Playwright 1.62.1, in
  Chromium and WebKit, en, zh, zh-TW, ja and de, at 980 and 440px:
  green, all ten cases in each engine. In each: with npm's package
  installed, the repository's card asks, Cancel installs nothing,
  Replace installs it, and the card of a package nothing has installs at
  once; with a repository installed and off, npm's card asks and says
  the new one is installed off, and after Replace its card offers Switch
  on; the field asks for the other repository, installs the installed
  one by its page's URL at once, and asks for npm:<name>. The dialog
  fits at 440px, a click scrolls nothing, and no page error.
- the commit before's plugins.js under it (174250b2's but for the room's
  statusErr and NO_SCROLL), in Chromium: red in all ten, at the first
  case: Install on Gyarados4157's card, with npm's package installed,
  opens no dialog.
- Broken by hand, in Chromium, each red, then put back:
  - npm's installs left out of namesakeOf's search: red in all ten, as
    with the commit before's
  - what a tagged repository's package.json names left unread: red in
    all ten, the same way
  - the field's Install not asking: red in all ten, at the field, no
    dialog for the other repository typed in
  - npm's package named by its bare name, not npm:<name>: red in all
    ten, the dialog's title reading "Replace magpie-our-free-model with
    github:Gyarados4157/magpie-our-free-model?" in en
  - namesakeOf not reading the old one's Off: red in all ten, at the
    second case, the dialog not saying the new one is installed off
  - the same repository by another spec taken for another plugin: red in
    all ten, "the same repository installs at once"
- i18n-keys, which reads the strings with no browser: 4 of 4 pass.
- TestCoreScriptBudget: pass.
- The Plugins page's other GUI files, old-webkit, vet and the full suite
  ran at the last commit's tree, which holds this one.

Not tried: the real app (WebKitGTK, Wails), and a real install from
GitHub; the API is faked.

Landed by yetone in a batch of Coffemon's patches from the issues.
What was run, go1.26.8, on origin/main cc81ad4ea, then again at
70a0c387c (gofmt, the three vets, the changed tests, umask 077):
- mote (macOS 27): gofmt -l clean; go vet, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet ./...: ok. edit and testenv at umask
  077; agent, provider, library and gateway with an empty .git above
  TMPDIR; davsync, imagemcp, plugin, library, edit, testenv whole; the
  changed tests in agent, provider, gateway and gui; the timing tests
  -count=10 (gateway, davsync, imagemcp) and -count=5 (agent): all ok.
  TestCoreScriptBudget ok: core 1,536,751 of 1,537,034, app.js
  1,312,975 of 1,315,316, no budget raised.
- Red on the old code: on origin/main, TestWriteAtomicReadOnlyHardLink
  at umask 077 and two Reasonix tests under an empty .git; on Linux
  (wsl-run) TestProgram at umask 077 with the old program.go. With
  each fix's code taken back to main's, the Gemini imageConfig tests,
  TestPluginToldWhereTheAgentWorks, TestSkillRepoTraced,
  TestTaggedHooksAlone, TestMainURL/TestMainView and update-auto,
  plugin-github-hooks, plugins-more-discover, plugin-namesake were
  red. Broken by hand: claudeKeyed always true (both
  OwnEndpointNeverAsked tests red), claudeAsk a no-op
  (TestClaudeFirstWriteAsksTheProxy red), GitAt taking any .git folder
  (the three TestGitOnDisk tests red).
- GUI: 123 files (plugins*, update-*, panel/tray/start/context, i18n,
  gui-zh-tw/ja/de and every file that evals app.js parts) in WebKit on
  Linux (wsl-run). 11 files had reds (click-scroll, panel-fold,
  plugin-card-update, plugin-github, plugin-move*, segs-glide,
  tray-totals, update-*), and run again side by side they fail the
  same on origin/main d80d75f30 (79 pass, 26 fail here; 78 and 27
  there). They are click-scroll guards ("the click must not scroll
  the page"), varying by language from run to run (#4385).
  copilot-ghe's route-after-close red is #1949, seen on main 244d80e23
  too. In Chromium on mote, Chromium segfaulted partway through files
  (#4125): context-map, context-scroll-end and context-tune fail the
  same on origin/main 0911a65e7, so the batch's own files
  (plugin-namesake, update-auto, plugins-more-discover,
  plugin-github-hooks) ran in Chromium on Linux: 62 of 62.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., mote)
  at 472a0608f (on 70a0c387c): every package ok but internal/gateway,
  whose five reds were #4362's (Antigravity turned-away and
  TestCodexSpentGrokFailingIsTold), fixed on main in d80d75f30. After
  the rebase on 244d80e23 the five pass, and gofmt, the three vets
  and the targeted runs above were run again: ok. In Linux the
  sign-in, copilot, plugin-github*, plugins-more-discover,
  plugin-namesake, plugin-gateway, update-auto, quota-refresh-order
  and i18n files ran in both engines: 475 pass, 4 fail (copilot-ghe
  #1949, plugin-github's click scroll, both red on main too).
- Rebased again on c7171a256, over its budget fix e94bf7a08: gofmt, vet of
  gui, gateway, provider and plugin, TestCoreScriptBudget (core
  1,536,265 of 1,536,586 with the batch's last commit, statusTErr and settingsErr), the Gemini,
  GitOnDisk and plugin tests, and in Linux both engines i18n-keys,
  update-mirror, plugin-namesake, plugins-more-discover,
  plugin-github-hooks and update-auto (138 of 138): ok.
Not tried: the whole GUI suite (mote's WebKit wouldn't launch and its
Chromium segfaulted, #4125); macOS WebKit; the real app's window.
2026-10-30 15:53:22 +08:00
yetone dfc08e8824 gui: one NO_SCROLL for 90 focus calls, one statusErr for 68 failed calls (#3685)
Room for #3685, which did not fit the core script budget. The budget
is not raised; two repeated forms move into one name each.

- NO_SCROLL: `{ preventScroll: true }` was written out at 90 focus
  calls (89 in app.js, 1 in plugins.js). It is one const at the top of
  app.js now.
- statusErr(e): `status(e.message, "err")` was written out for 68
  failed calls (app.js 61, plugins.js 3, context.js 4), 15 of them as
  a `e => status(e.message, "err")` callback that now passes statusErr.
  renderSync is left alone: `status` is a local string there (#4066).

Saves 2,016 bytes: core 1,536,751 of 1,537,034 and app.js 1,312,975 of
1,315,316 with #3685 on top. quota-refresh-order.test.cjs evals parts
of app.js in a vm and gets both names as stubs.

The idea is Coffemon's (JoeyWu-tech) e7af88774, which no longer
applied to main; it was redone on the current tree.

Landed by yetone in a batch of Coffemon's patches from the issues.
What was run, go1.26.8, on origin/main cc81ad4ea, then again at
70a0c387c (gofmt, the three vets, the changed tests, umask 077):
- mote (macOS 27): gofmt -l clean; go vet, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet ./...: ok. edit and testenv at umask
  077; agent, provider, library and gateway with an empty .git above
  TMPDIR; davsync, imagemcp, plugin, library, edit, testenv whole; the
  changed tests in agent, provider, gateway and gui; the timing tests
  -count=10 (gateway, davsync, imagemcp) and -count=5 (agent): all ok.
  TestCoreScriptBudget ok: core 1,536,751 of 1,537,034, app.js
  1,312,975 of 1,315,316, no budget raised.
- Red on the old code: on origin/main, TestWriteAtomicReadOnlyHardLink
  at umask 077 and two Reasonix tests under an empty .git; on Linux
  (wsl-run) TestProgram at umask 077 with the old program.go. With
  each fix's code taken back to main's, the Gemini imageConfig tests,
  TestPluginToldWhereTheAgentWorks, TestSkillRepoTraced,
  TestTaggedHooksAlone, TestMainURL/TestMainView and update-auto,
  plugin-github-hooks, plugins-more-discover, plugin-namesake were
  red. Broken by hand: claudeKeyed always true (both
  OwnEndpointNeverAsked tests red), claudeAsk a no-op
  (TestClaudeFirstWriteAsksTheProxy red), GitAt taking any .git folder
  (the three TestGitOnDisk tests red).
- GUI: 123 files (plugins*, update-*, panel/tray/start/context, i18n,
  gui-zh-tw/ja/de and every file that evals app.js parts) in WebKit on
  Linux (wsl-run). 11 files had reds (click-scroll, panel-fold,
  plugin-card-update, plugin-github, plugin-move*, segs-glide,
  tray-totals, update-*), and run again side by side they fail the
  same on origin/main d80d75f30 (79 pass, 26 fail here; 78 and 27
  there). They are click-scroll guards ("the click must not scroll
  the page"), varying by language from run to run (#4385).
  copilot-ghe's route-after-close red is #1949, seen on main 244d80e23
  too. In Chromium on mote, Chromium segfaulted partway through files
  (#4125): context-map, context-scroll-end and context-tune fail the
  same on origin/main 0911a65e7, so the batch's own files
  (plugin-namesake, update-auto, plugins-more-discover,
  plugin-github-hooks) ran in Chromium on Linux: 62 of 62.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., mote)
  at 472a0608f (on 70a0c387c): every package ok but internal/gateway,
  whose five reds were #4362's (Antigravity turned-away and
  TestCodexSpentGrokFailingIsTold), fixed on main in d80d75f30. After
  the rebase on 244d80e23 the five pass, and gofmt, the three vets
  and the targeted runs above were run again: ok. In Linux the
  sign-in, copilot, plugin-github*, plugins-more-discover,
  plugin-namesake, plugin-gateway, update-auto, quota-refresh-order
  and i18n files ran in both engines: 475 pass, 4 fail (copilot-ghe
  #1949, plugin-github's click scroll, both red on main too).
- Rebased again on c7171a256, over its budget fix e94bf7a08: gofmt, vet of
  gui, gateway, provider and plugin, TestCoreScriptBudget (core
  1,536,265 of 1,536,586 with the batch's last commit, statusTErr and settingsErr), the Gemini,
  GitOnDisk and plugin tests, and in Linux both engines i18n-keys,
  update-mirror, plugin-namesake, plugins-more-discover,
  plugin-github-hooks and update-auto (138 of 138): ok.
Not tried: the whole GUI suite (mote's WebKit wouldn't launch and its
Chromium segfaulted, #4125); macOS WebKit; the real app's window.
2026-10-30 15:53:22 +08:00
JoeyWu-tech ef7f55fe98 plugin: Discover lists a repository of gateway hooks alone, as a request hook (#3821)
MengXiangxi (#3821): a GitHub repository tagged magpie-plugin whose
package.json has magpie.hooks and no main, exports or index.js, a gateway
request hook alone that installs and runs, never showed in the Plugins
page's "Unofficial, on GitHub". readTagged read the magpie block's
middleware, agent and page but not hooks, so such a package was taken for
a provider: the file #1327's check looks for in the repository was its
entry as Bun resolves it, index.js, which it hasn't, and the 404 left it
out without a word. An inert index.js, as the reporter tried, lists it,
as a provider.

readTagged reads magpie.hooks. A package with hooks, no main or exports,
and none of middleware, agent or page is of kind "hooks", and the
file #1327's check looks for is its hooks file, so one whose hooks file
isn't committed (a dist built only to publish) is still left out, as a
middleware's is. The Plugins page picks "hooks" out with middleware, as
both run in the gateway (kindOf), and its chip says Request hook, as an
installed one's row does, through the word kindChip takes since the
previous commit. docs/subsystems/gateway-request-hooks.md says so. Not
changed: a raw 404 that GitHub's cache answers just after a push is
still kept for that push in this process (the reporter's second
point, #4067).

plugins.js grows 51 bytes for it. With the previous commit the core's
scripts are 24 bytes under main's, 1,527,948 of 1,528,076.

What was run (tree 79884772, on origin/main 56602426, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, the Go tests at umask 077:
- TestTaggedHooksAlone, new. IvanXxxxyyuffff/magpie-system-prompt-file's
  package.json as it is (a repository the report names) is kept, of kind
  hooks, with its spec, package and version 0.3.0, and its hooks file is
  the file asked for, never an index.js. someone/hooks-gone, whose hooks
  file is only in a dist it doesn't commit, is left out. With
  TestTaggedRepos*, -count=50: 350 of 350 pass; -race -count=20: 140 of
  140, no race.
- plugin-github-hooks.test.cjs, new. Seven repositories of
  /api/plugins/github's real answer of 2026-10-27 (two providers, three
  middleware, two of hooks alone): each of hooks alone has the gateway's
  chip saying Request hook and is picked out under Middleware, in
  English, Chinese, Traditional Chinese, Japanese and German at 980px and
  420px. Chromium and WebKit, 3 runs: 22 of 22 each run.
- Broken by hand, each red:
  - no kind made of magpie.hooks, as on main: TestTaggedHooksAlone,
    hooks alone not kept.
  - the kind made but the file looked for still the entry, index.js:
    the same.
  - the hooks file not looked for: TestTaggedHooksAlone, the hooks file
    not among the files asked for.
  - kindOf without hooks, so a Provider: plugin-github-hooks 0 of 22.
  - the card's chip not given its word: 0 of 22.
- TestCoreScriptBudget: ok.
- gofmt -l clean. go vet -tags nogui for linux, windows and darwin, go
  vet for windows, go build -tags nogui for linux and darwin and go
  build for windows: exit 0 each. go vet and go build without the tag
  on linux: exit 1 (no libsoup-3.0 or gio-unix-2.0 here).
- The Plugins page's GUI files near the change, 24 with the new one and
  i18n-keys, each run by itself in Chromium and in WebKit: 42 of 48 runs
  green. The other 6 are red the same at 56602426, each file run the
  same way, and none is in what this changes:
  - i18n-keys, both engines: "a plugin's words are its own", for
    plugins/routing/i18n.js "masking…", which internal/masking/masking.go
    says too (#4053).
  - builtins, WebKit: Plugins › Built-in, the Observability switch's
    click times out, the stuck Plugins header (.lib-head.pm-head.stuck)
    over it taking the pointer.
  - plugin-github, WebKit: de 440, a click scrolls #view-plugins, 74 to
    139 (65 to 119 at 56602426; #3218 has the same check red in
    Chromium).
  - plugin-github-wait, Chromium: de 440, Try again moves #view-plugins
    by 2.
  - plugin-release, WebKit: en and zh read "Serves Zed\n" for "Serves
    Zed".
- go test -tags nogui -count=1 -timeout 45m ./... (Bun 1.4.2, log
  kept; 8m48s, load 32 at its start): 71 packages ok, internal/plugin
  among them, and 16 tests red in 6 packages, none of them this
  commit's tests or what they cover (internal/gui's are its gateway
  tests): agent TestCodexDriftReached (#3398); TestInstalledVersion,
  TestHowInstalled, TestCursorFolderFromTheEditorIsNotTheCLI,
  TestCopilotFolderFromAnIDEPluginIsNotTheCLI,
  TestQoderSettingsFromAnIDEPluginIsNotTheCLI, TestOmpDetectedWithPiDir
  and TestZedAppPath (#3141); TestReasonixCLIRequiresSupportedNativeVersion
  and TestReasonixCLIRecoversAfterProbeTimeout (#3641); davsync
  TestSyncTeraCloudStillSeesOtherWrites (#3420); edit
  TestWriteAtomicReadOnlyHardLink and testenv TestProgram (umask
  077, #3640); gateway TestPluginToldWhereTheAgentWorks (the
  /tmp/.git of #3675); gui TestGatewayHeldByAContainer and
  TestGatewayFixQuitsOnlyAMagpie (#3649).

The rest is what was run for 31a99237, at tree 2dd21699 on origin/main
508911e4, the same Go change (github.go has since taken e4ccf67b's
search timeout, in askTagged, not readTagged; 31a99237's plugins.js
named the card's chip by hand, not through kindChip, and had three
lines of comment this leaves out; not this tree):
- Real use: magpie web built at 508911e4 and at that change's code
  (529f07e5, the same but for the new GUI file), each in a sandbox HOME,
  asked real GitHub for /api/plugins/github. 508911e4 listed 163 and left
  IvanXxxxyyuffff/magpie-system-prompt-file out. That change listed 164,
  it and MengXiangxi/magpie-openviking (which now has the inert index.js)
  of kind hooks. cyberElar/magpie-x-search (#1327's, a command only) was
  left out by both.

Not tried: macOS and Windows; the real app's window (no display here, the
page in Playwright's browsers only).

Landed by yetone in a batch of Coffemon's patches from the issues.
What was run, go1.26.8, on origin/main cc81ad4ea, then again at
70a0c387c (gofmt, the three vets, the changed tests, umask 077):
- mote (macOS 27): gofmt -l clean; go vet, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet ./...: ok. edit and testenv at umask
  077; agent, provider, library and gateway with an empty .git above
  TMPDIR; davsync, imagemcp, plugin, library, edit, testenv whole; the
  changed tests in agent, provider, gateway and gui; the timing tests
  -count=10 (gateway, davsync, imagemcp) and -count=5 (agent): all ok.
  TestCoreScriptBudget ok: core 1,536,751 of 1,537,034, app.js
  1,312,975 of 1,315,316, no budget raised.
- Red on the old code: on origin/main, TestWriteAtomicReadOnlyHardLink
  at umask 077 and two Reasonix tests under an empty .git; on Linux
  (wsl-run) TestProgram at umask 077 with the old program.go. With
  each fix's code taken back to main's, the Gemini imageConfig tests,
  TestPluginToldWhereTheAgentWorks, TestSkillRepoTraced,
  TestTaggedHooksAlone, TestMainURL/TestMainView and update-auto,
  plugin-github-hooks, plugins-more-discover, plugin-namesake were
  red. Broken by hand: claudeKeyed always true (both
  OwnEndpointNeverAsked tests red), claudeAsk a no-op
  (TestClaudeFirstWriteAsksTheProxy red), GitAt taking any .git folder
  (the three TestGitOnDisk tests red).
- GUI: 123 files (plugins*, update-*, panel/tray/start/context, i18n,
  gui-zh-tw/ja/de and every file that evals app.js parts) in WebKit on
  Linux (wsl-run). 11 files had reds (click-scroll, panel-fold,
  plugin-card-update, plugin-github, plugin-move*, segs-glide,
  tray-totals, update-*), and run again side by side they fail the
  same on origin/main d80d75f30 (79 pass, 26 fail here; 78 and 27
  there). They are click-scroll guards ("the click must not scroll
  the page"), varying by language from run to run (#4385).
  copilot-ghe's route-after-close red is #1949, seen on main 244d80e23
  too. In Chromium on mote, Chromium segfaulted partway through files
  (#4125): context-map, context-scroll-end and context-tune fail the
  same on origin/main 0911a65e7, so the batch's own files
  (plugin-namesake, update-auto, plugins-more-discover,
  plugin-github-hooks) ran in Chromium on Linux: 62 of 62.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., mote)
  at 472a0608f (on 70a0c387c): every package ok but internal/gateway,
  whose five reds were #4362's (Antigravity turned-away and
  TestCodexSpentGrokFailingIsTold), fixed on main in d80d75f30. After
  the rebase on 244d80e23 the five pass, and gofmt, the three vets
  and the targeted runs above were run again: ok. In Linux the
  sign-in, copilot, plugin-github*, plugins-more-discover,
  plugin-namesake, plugin-gateway, update-auto, quota-refresh-order
  and i18n files ran in both engines: 475 pass, 4 fail (copilot-ghe
  #1949, plugin-github's click scroll, both red on main too).
- Rebased again on c7171a256, over its budget fix e94bf7a08: gofmt, vet of
  gui, gateway, provider and plugin, TestCoreScriptBudget (core
  1,536,265 of 1,536,586 with the batch's last commit, statusTErr and settingsErr), the Gemini,
  GitOnDisk and plugin tests, and in Linux both engines i18n-keys,
  update-mirror, plugin-namesake, plugins-more-discover,
  plugin-github-hooks and update-auto (138 of 138): ok.
Not tried: the whole GUI suite (mote's WebKit wouldn't launch and its
Chromium segfaulted, #4125); macOS WebKit; the real app's window.
2026-10-30 15:53:22 +08:00
JoeyWu-tech 7a1bfaf2f0 plugins: kindChip says the word it is given, so a request hook's chip is one call (#3821)
The Installed tab's row of a gateway request hook made its chip as
middleware's and then wrote "Request hook" over the chip's word, in
five lines. kindChip now takes a word to say in place of its kind's,
and the row asks for its chip in one line. Behaviour is unchanged: the
same chip, class, glyph and tooltip, its word translated as before.
This makes room under TestCoreScriptBudget for the next commit without
raising the budget: the core's scripts go from 1,527,972 to 1,527,897
of 1,528,076.

plugin-gateway.test.cjs, which opens such a row, now checks its chip
says Request hook in each of its five languages; nothing checked it.

What was run (tree 0b0ba0c9, on origin/main 56602426, go1.26.8,
linux/amd64, Linux 5.15), outside graftcp, the Go tests at umask 077:
- plugin-gateway.test.cjs, Chromium and WebKit: 12 of 12 pass. With
  56602426's plugins.js under it: 12 of 12, so the chip said the same
  before this change.
- kindChip ignoring the word given (t(word) for t(name || word)): 0 of
  12, the chip saying Middleware, translated, in every language.
- TestCoreScriptBudget: ok.
- The GUI files near the change, vet and the full suite ran at the next
  commit's tree, which holds this one.

Not tried: the real app's window (no display here, the page in
Playwright's browsers only).

Landed by yetone in a batch of Coffemon's patches from the issues.
What was run, go1.26.8, on origin/main cc81ad4ea, then again at
70a0c387c (gofmt, the three vets, the changed tests, umask 077):
- mote (macOS 27): gofmt -l clean; go vet, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet ./...: ok. edit and testenv at umask
  077; agent, provider, library and gateway with an empty .git above
  TMPDIR; davsync, imagemcp, plugin, library, edit, testenv whole; the
  changed tests in agent, provider, gateway and gui; the timing tests
  -count=10 (gateway, davsync, imagemcp) and -count=5 (agent): all ok.
  TestCoreScriptBudget ok: core 1,536,751 of 1,537,034, app.js
  1,312,975 of 1,315,316, no budget raised.
- Red on the old code: on origin/main, TestWriteAtomicReadOnlyHardLink
  at umask 077 and two Reasonix tests under an empty .git; on Linux
  (wsl-run) TestProgram at umask 077 with the old program.go. With
  each fix's code taken back to main's, the Gemini imageConfig tests,
  TestPluginToldWhereTheAgentWorks, TestSkillRepoTraced,
  TestTaggedHooksAlone, TestMainURL/TestMainView and update-auto,
  plugin-github-hooks, plugins-more-discover, plugin-namesake were
  red. Broken by hand: claudeKeyed always true (both
  OwnEndpointNeverAsked tests red), claudeAsk a no-op
  (TestClaudeFirstWriteAsksTheProxy red), GitAt taking any .git folder
  (the three TestGitOnDisk tests red).
- GUI: 123 files (plugins*, update-*, panel/tray/start/context, i18n,
  gui-zh-tw/ja/de and every file that evals app.js parts) in WebKit on
  Linux (wsl-run). 11 files had reds (click-scroll, panel-fold,
  plugin-card-update, plugin-github, plugin-move*, segs-glide,
  tray-totals, update-*), and run again side by side they fail the
  same on origin/main d80d75f30 (79 pass, 26 fail here; 78 and 27
  there). They are click-scroll guards ("the click must not scroll
  the page"), varying by language from run to run (#4385).
  copilot-ghe's route-after-close red is #1949, seen on main 244d80e23
  too. In Chromium on mote, Chromium segfaulted partway through files
  (#4125): context-map, context-scroll-end and context-tune fail the
  same on origin/main 0911a65e7, so the batch's own files
  (plugin-namesake, update-auto, plugins-more-discover,
  plugin-github-hooks) ran in Chromium on Linux: 62 of 62.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., mote)
  at 472a0608f (on 70a0c387c): every package ok but internal/gateway,
  whose five reds were #4362's (Antigravity turned-away and
  TestCodexSpentGrokFailingIsTold), fixed on main in d80d75f30. After
  the rebase on 244d80e23 the five pass, and gofmt, the three vets
  and the targeted runs above were run again: ok. In Linux the
  sign-in, copilot, plugin-github*, plugins-more-discover,
  plugin-namesake, plugin-gateway, update-auto, quota-refresh-order
  and i18n files ran in both engines: 475 pass, 4 fail (copilot-ghe
  #1949, plugin-github's click scroll, both red on main too).
- Rebased again on c7171a256, over its budget fix e94bf7a08: gofmt, vet of
  gui, gateway, provider and plugin, TestCoreScriptBudget (core
  1,536,265 of 1,536,586 with the batch's last commit, statusTErr and settingsErr), the Gemini,
  GitOnDisk and plugin tests, and in Linux both engines i18n-keys,
  update-mirror, plugin-namesake, plugins-more-discover,
  plugin-github-hooks and update-auto (138 of 138): ok.
Not tried: the whole GUI suite (mote's WebKit wouldn't launch and its
Chromium segfaulted, #4125); macOS WebKit; the real app's window.
2026-10-30 15:53:22 +08:00
yetone 1027db4081 plugins: a README read once shows at once when its page opens again
The owner (10-30): closing a plugin's page and opening it again played
the loading bird over a README already read, and memory for them must
stay bounded, and a README changed since must not stay old.

detail() keeps each page read in a Map, the last 20 opened only: a new
read goes to the end and the oldest is dropped past 20. Opening a page
that is there draws its README and date at once, with no loader and no
bird, and reads the page again behind it; a README that changed takes
the old one's place, and a failed read keeps the one shown. A page never
read still loads under the bird, waiting for its three landings.

The core's scripts grow 677 bytes; coreScriptBudget is raised to the
exact size, 1,537,034, with no room added.

Run (mote, at 55299ee30 + this change):
- node --check plugins.js.
- node --test plugin-readme-bird, skeleton-bird, plugin-page,
  plugin-market, plugin-progressive, plugin-github-wait, plugin-local,
  plugin-release, tray-bird: 82 pass, 0 fail, chromium and webkit,
  the new test "a README read once shows at once when its page opens
  again, and a newer one takes its place" among them.
- go test -run Budget ./internal/gui/: ok. gofmt -l: clean.

Broken by hand:
- main's plugins.js under the new test: red in both engines (the
  reopened page shows the bird and no README).
- without the line that puts a changed README in: red, waiting for
  the newer README's "Paragraph 4.".

Not run: the full GUI suite and go test ./... (this touches plugins.js'
detail() and one test file only); the 20-page cap has no test of its
own, it is read from the code.
2026-10-30 04:17:35 +08:00
yetone 56bc3d515a plugins: a plugin's README waits for its bird to land on three lines
The owner (10-30): opening a plugin's page, the README came so fast that
the bird dropped in and flew straight off, the same flash the skeleton
bird had (9b4d0bda8 fixed that one only; this loader is plugins.js's
bounceLoader, a bird of its own that comes at once, with no 450ms wait).

The loader now has a ready promise: it is kept once the bird has landed
on its third line (drop 300ms, three landings, two hops: ~1.7s), at once
with reduced motion or the Loading bird off, when the box is gone, and
after 3s at most for a window that draws no frames. detail()'s fill waits
for it before the README goes in, then the bird flies off over it as
before. A dialog closed while it waits is left alone.

The core scripts' budget is raised to 1,532,602, the exact size, with no
room added, after the loader's comment was cut down.

Run on mote (macOS 27), at this tree on origin/main 9b833205f:
- plugin-readme-bird, skeleton-bird, tray-bird, plugin-page,
  plugin-market, plugin-progressive, plugin-github-wait, plugin-local,
  plugin-release, both engines: 80 pass, 0 fail. New: "a README back at
  once waits for the bird to land on three lines" (three lines lit when
  the README went in, after more than 1.3s and less than 3.5s).
- Broken by hand on main's plugins.js: the new test fails in both engines
  (README in after 18ms and 10ms, no line landed on).
- go test -run Budget ./internal/gui/: ok. gofmt -l: clean.

Not run: the full GUI suite (another session's full suite holds mote),
Linux and Windows.
2026-10-30 03:36:14 +08:00
yetone f463a8aaf7 gui: Settings has Loading bird, which keeps magpie's bird off skeletons and stops looking for them
Yayoi_no_yume on X, agreed by GymlinZhu: they run magpie on a 1-core,
1GB server and asked for a way to turn the loading bird off. The owner
wanted the bird, so it stays on by default. Settings -> General now has
"Loading bird" (Off / On), below Reduce motion.

- settings.json keeps noBird (omitted when the bird is on), and boot.js
  passes it. A POST that leaves it out keeps it, as with the other prefs.
  theme.js sets data-bird="off" on <html> before the first paint, and
  applyPrefs changes it.
- skelBird (app.js): with the bird off, nothing looks for skeletons at
  all. No 250ms interval and no observer run. Turning it off mid-hop ends
  the hops, and the bird flies off.
- With the bird on, the look is driven by events. Before, the 250ms
  setInterval ran forever, scanning the DOM for .skeleton whether or not
  one existed. Now a MutationObserver watches for an added node that is or
  holds a skeleton, the 250ms look runs only while one is in the page,
  and the look stops itself once none are left.
- The README's bird (plugins.js bounceLoader): with the bird off, the four
  lines stand straight with no bird, and the box goes when the README
  comes.
- Strings are in en, zh, zh-TW, ja and de. App.js is 1,294,016 bytes, under
  its budget, which is not raised.

Tests:
- skeleton-bird.test.cjs adds three tests:
  - with no skeleton left, the look stops, and a skeleton added later
    starts it again;
  - with the setting saved off, no bird, no dip and no look ever starts
    (setInterval is wrapped to count the look);
  - the Settings row shows On by default; Off posts noBird:true, stops a
    running look, and a skeleton added after that starts none; On posts
    false and the look starts again.
- plugin-readme-bird.test.cjs: with the setting off, the lines stay
  straight, no .sk-bird is drawn, and the box goes at once.
- settings-general: #birdSegs is in the list of bare rows.
- TestSettingsNoBird: off by default, kept by a POST that leaves it out,
  cleared by false, in settings.json and boot.js.

Run at this head (rebased on e15b2277c):
- mote: go test -run "Budget|TestSettings|TestBoot|TestI18n"
  ./internal/gui ./internal/settings: ok. GOOS=linux, windows and darwin
  go vet -tags nogui of both: clean (on the pre-rebase base aad6546cd,
  with no Go change between the two). gofmt -l: clean.
- wsl-run (Linux), both engines: skeleton-bird, plugin-readme-bird,
  settings-general, reduce-motion and i18n-keys: 43 of 44 pass. The one
  red is skeleton-bird's original hopping test in WebKit. It is red 2 of
  2 on origin/main e15b2277c in the same place, filed as #4176 (also one
  line of #4120).
- Before the rebase, on mote in Chromium, the same five files all passed.
- wsl-run Chromium: settings-groups, settings-lines-wrap, settings-search,
  settings-sections, settings-shortcut, settings-tabs-stick, text-size,
  menu-scroll and i18n-keys: 76 of 76 pass.

Broken by hand:
- With birdOff() always false, the three new off tests go red (README,
  skeletons, Settings row).
- With the look never stopping itself, "with no skeleton left" goes red.

Not tried:
- WebKit on mote. Playwright's WebKit never launched there (180s launch
  timeouts at load 65-300), so macOS WebKit wasn't run; WebKit ran only on
  Linux.
- The whole GUI suite (970 files), because mote was under heavy load.
- The real app on any OS, and a real 1c1g server. The CPU saved wasn't
  measured.
2026-10-29 13:12:36 +08:00
yetone e8e9245ecf agents: Install another agent says Plugins has more agents, and opens them
The owner, on the Agents page: 因为我们支持Agent插件了,这里是不是也应该
显示插件中有更多? Install another agent listed only the agents magpie has
an install command for; the agents a plugin adds were nowhere on that page.

- GET /api/plugins/agents names the suggested agent plugins (the market's
  kind "agent") not installed here. One installed but turned off, or
  pinned to a version, counts as installed: Plugins turns it on.
- Install another agent counts them in its header and ends with one row,
  "More in Plugins" with their names, as the Providers add sheet does for
  subscriptions. The row opens Plugins › Discover scrolled to its Agents,
  only while the click is fresh (scrollOnPurpose), on the section drawn
  last, since npm's answers draw it again.
- The list is fetched beside the install commands, not before them, so a
  slow market never holds the commands back. With no install command left,
  the section shows the plugins' row alone and no install note.
- Budgets: app.js 1,311,681 and the core 1,530,449 (+1,430 / +2,408 over main),
  the Agents page and Plugins page are the core's own, no room added.

Run at this tree, rebased on e2efbd357 (on mote):
- go test -tags nogui ./internal/gui -count=1: ok (budgets included);
  GOOS=linux and GOOS=windows go vet ./internal/gui: ok; gofmt -l: none.
- TestPluginAgentsNotInstalled: a fake registry with every kind, installed,
  turned-off and pinned agents; all installed gives [], never null.
- agent-plugin-agents.test.cjs: chromium and webkit, en zh zh-TW ja de,
  1100 and 420px: count, row order, words, tooltip, one line, name not cut,
  no sideways scroll, the click landing Agents at the top and staying.
- 69 GUI files that reach this (install section, Plugins Discover, strict
  fixtures, i18n), 1044 tests: 1033 pass. The reds were i18n-keys' #4053
  (fixed in the next commit) and mobile-web, whose copy had no .git for
  origin/main; run again with one fetched (d4f1d64): 30/30.

Broken by hand: main's assets under the new GUI test, 11/11 red; the
scroll line taken out, 11/11 red (webkit); the Go installed filter taken
out, TestPluginAgentsNotInstalled red.

Not run: the whole GUI suite (mote was busy with other sessions' suites),
and the real app with the live market.
2026-10-28 22:34:52 +08:00
yetone 766356cd3f plugins: a row's "Serves" chip names the providers the plugin registers (#3902)
The chip named only built-ins moved onto a plugin (provider.MovedOnto),
so a plugin magpie never shipped as a built-in, like
magpie-magicrew-auth signing in to letsmagic.cn and magicrew.ai, said
nothing about what it carries. /api/plugins now sends `serves`: the
names of the providers the plugin registers (plugin.Cached, which the
row's provider names already come from), once each, leaving out the
moved ones (a moved built-in's id is the plugin's provider id; the page
names it as the built-in). It is sent when the plugin has a moved
built-in or registers two or more providers: a lone provider is the
row's title already. No package.json field. The "in place of the
built-in" tooltip stays on a chip that names a moved built-in only.
plugins.js is 27 bytes smaller; no budget touched.

Analysis and the proposal by MYCF711 (mycf_711 on Discord) in #3902.

Run:
- go test ./internal/gui -count=1: ok (107s)
- TestPluginServesItsProviders red with servesBeside returning nil
  (three cases), green restored
- plugin-release.test.cjs (chromium + webkit, en + zh): 6/6; with
  origin/main's plugins.js 0/6
- plugin-*.test.cjs plugins-*.test.cjs i18n-keys.test.cjs: 661/664.
  The 3 reds are on main too: i18n-keys "a plugin's words are its own"
  (#3897) and plugin-card-update webkit en under load (#3079; 2 of 5
  red on origin/main's plugins.js too, load ~65)
- gofmt -l, go vet, GOOS=windows go vet, GOOS=linux go vet -tags nogui
  on internal/gui: clean
Not tried: a real install of magpie-magicrew-auth in the window.
2026-10-27 23:37:46 +08:00
yetone ed5cc959a7 gui: every slow page's skeletons get magpie's bird hopping bar to bar
The owner, after the Plugins page's README bird (722483c08): every
skeleton loader should have it, the slow pages most of all (Sessions,
Usage, Masking, Library).

app.js keeps one bird for the window (skelBird). Every 250ms it looks
for .skeleton and the Plugins page's ghost cards' .sk bars. When some
have stayed 450ms or more and at least one can be seen (in the
viewport, elementFromPoint at the bar landing on it or a box it sits
in, since ghost bars let clicks through), the bird drops onto one. The
bar dips under it, and it hops to the next bar it can see, in page
order. When the bars are gone it flaps off up and to the right and is
removed. It is position: fixed with pointer-events none, so nothing
under it moves or stops taking clicks. A quick load (under 450ms)
never shows it. A hidden window and reduced motion skip it.

The README's bird (plugins.js bounceLoader) now draws from the same
markup (BIRD) and styles (.sk-bird, sk-flap in app.css). plugins.css
loses its .pm-bird copy.

Budgets: app.js 1,321,319 -> 1,325,845, core 1,537,645 -> 1,541,967,
the exact bytes, no room added.

Run at origin/main 9809a8ac9 (load 100-150):
- skeleton-bird.test.cjs (new), both engines: a held market read
  shows the bird within 3s, over 30 places and dips, and gone 2s after
  the reply. A 150ms reply shows none. Reduced motion: no bird, no dip.
- plugin-readme-bird, i18n-keys, gateway-key-limit, the Budget tests:
  ok (the README bird's one webkit red is main's too, fixed in the
  next commit but one).
- Probe with every /api read but state held, per page: the bird shows
  on Sessions (4 bars), Library (31), Providers (20), Gateway (39),
  Usage (15), Masking (2) and Plugins (48). Screenshots looked at for
  Library, Usage and Sessions.
- The whole GUI suite at a6c808b68 (concurrency 6, load ~170): 128
  reds on this branch, 130 on main, over the same 36 files. Run alone
  twice per tree, the only test red on this branch and not on main was
  gateway-key-limit's chromium narrow check, a ResizeObserver race,
  fixed in the next commit.
Broken by hand: with the bird never spawned, the slow test is red.
Not tried: the Routing window page, which draws its stage at once and
has no skeleton (the tray panel's routing tab does); the tray panel
itself; the real app (only Playwright's engines).
2026-10-26 23:10:08 +08:00
yetone 689cf41423 plugins: a row's picture is asked for as it nears the screen (#909, #1956, #2459)
Each SVG an <img> draws is a document of its own in the webview (its
own Page, style engine and DOM, ~0.6 MB), kept while the window is
open. Opening Plugins drew 122 pictures at once, 57 of them SVGs, so
the renderer took 58 documents more, most for rows far below the fold.

icon() takes a lazy flag that sets loading="lazy" on the <img> it makes
for a stored picture or a -color/PNG icon; Plugins' rows and cards pass
it, the plugin's own page header (big) does not. Menus and other pages
keep loading at once, so nothing that opens on screen waits a frame.

Measured in Chromium against a dev backend with a copy of the real
library and its stored icons, every page visited then on Settings
(memory-infra dump of the renderer, then ps RSS):
- documents: 81 -> 37
- malloc 90.3 -> 81.7 MB, blink_gc 41.7 -> 39.7, partition_alloc
  25.4 -> 20.5, image cache 5.3 -> 1.3
- renderer RSS 256-289 -> 243 MiB
Scrolled to the bottom of Discover, all 122 pictures load in Chromium
and WebKit (screenshot checked); before scrolling, 52 and 18.

Run at this head:
- go test ./internal/gui -count=1 -timeout 45m: ok 125s
- GUI: tests/plugin*.test.cjs, models-add-and-icons, mono-icon-redraw,
  routing-log-icons, tray-logos, i18n-keys: 691 of 693 pass; the one
  red is webkit en of plugin-card-update, waiting 5s for the Update
  button under load 10 (#3079, filed on main 75e769a9f), and 3 of 3
  alone pass.
- plugin-own-icon now checks a row's picture is lazy and loads on
  screen, and the page header's is not: 22 of 22.
Broken by hand: logo() without the flag turns plugin-own-icon red.
Not tried: WebView2 and WebKitGTK themselves (both support
loading=lazy; an engine without it loads at once as before).
2026-10-26 17:36:38 +08:00
yetone 385ce789e4 gui: a page plugin's sidebar tab comes and goes as it is installed or switched
The owner: after installing a page plugin, its tab took a long while to show
in the sidebar. The Plugins page's actions (Install, Switch on/off, Remove,
the market card's Switch on, Move) re-read the plugin list and providers in
refresh(), but only the Plugins page's own load told the sidebar to read
/api/plugin-pages again, so the tab came when that page was next opened or
the language changed. The backend was never slow: POST /api/plugins/{op} and
GET /api/plugin-pages both answer synchronously.

refresh() now calls loadPluginPages first, without waiting on the providers'
answer, which can be slow.

Core script budget raised by 174 bytes to 1,542,418, measured at origin/main
3b717d5e0, with no room added.

Run at this head (rebased on origin/main 3b717d5e0):
- plugin-page.test.cjs, both engines: 6 of 6 pass. The new test switches a
  page plugin on with /api/providers held 4s and sees its tab in 2s, then
  switches it off and sees the tab go. Broken by hand: with plugins.js
  reverted, it fails at the tab wait.
- Every tests/plugin*.test.cjs plus menu-scroll, i18n-keys and retired-move,
  both engines: green, except plugin-updates (#3633, #3103) and
  plugin-signed-out-account (filed #3642). Both are red at the base without
  this change too (2 of 2 runs), on a different subtest each run.
- builtins.test is red at the base too (#3498, the masking tab).
- TestCoreScriptBudget and TestAppScriptBudget pass. gofmt -l is clean.

Not run: the full Go suite, the whole GUI suite, and the real app.
2026-10-26 02:39:06 +08:00
yetone 722483c089 plugins: a plugin's README loads under magpie's bird bouncing down its lines
The owner found the plugin page's pulsing skeleton bars boring and picked
concept F (Trampoline) from the design round. While the README loads,
the skeleton's four lines are strings. magpie's bird drops onto the first,
bounces down them, and each string bends under its feet and wobbles after
it as a damped spring. A string it has landed on turns faintly to the
accent colour. From the last string it is thrown off the top and drops in
again. When the README comes, the strings fade and the bird flies off
up-right while the dialog grows to the README on its spring, as before.
With reduced motion the strings are drawn straight and the bird sits on
the first one.

How it fits the dialog:
- The leaving box goes into #modal, beside the dialog, not inside it.
  Anywhere in the dialog (a scroller), an absolutely positioned box made
  WebKit lay the fields out 8px short until it was removed, so the
  dialog's last frame jumped 8px and modal-centred-late's "centred in
  every frame" went red at 820px in WebKit. Tried in the README and in
  the dialog first; both were red.
- Its marks are data-* attributes, not classes, so holdModal's
  MutationObserver (class/hidden/open) doesn't run on every hop. It is
  removed 200ms after the 570ms height spring would end.
- The README fades in alone (n, not the readme box), so the bird isn't
  faded with it.
- Only the README skeleton changes; the small .skeleton bars elsewhere
  are as they were.

Core budget: 1,537,016 -> 1,542,244, the bytes plugins.js grew, with no
room added.

Run at 42ec2700b plus this change; rebased onto 5214d5114, whose two
commits touch the Claude gateway and provider code, not internal/gui:
- New tests/plugin-readme-bird.test.cjs, chromium and webkit: four
  strings and the bird; over 2s a string bends >4px, the bird takes >20
  places and >=2 strings light; when the README comes the box is marked
  gone, is out of the README, leaves from where it was, the README takes
  the top, and the box is gone within 2s. Reduced motion: nothing moves
  in 400ms, strings straight, box gone at once.
- modal-centred-late both engines (16/16 with the new test, twice).
- GUI: plugin*, market-*, modal-*, i18n*: 728 of 730. The red is
  plugin-card-update webkit en (#3079): it passes 2 of 3 alone at this
  head and fails 2 of 3 alone on origin/main 42ec2700b under load 40-77.
- go test ./internal/gui -run Budget; gofmt -l clean.
- Screenshots in light and dark at 980x820, through the loop and the
  flight off.

Broken by hand: the leaving box kept inside the README, and inside the
dialog: modal-centred-late webkit 820px red both ways (the last frame's
8px jump), green with it in #modal.

Not tried: the real Wails app (WebKitGTK on Linux, WebView2 on Windows);
only Playwright's chromium and webkit.
2026-10-26 02:18:40 +08:00
yetone 54b198c5c1 gui: a plugin's page grows to its README on a spring, not in one jump
A plugin's page (Plugins › Discover) opens with a skeleton for its
README, and when the README came in the dialog took its new height in
one frame. Now detail()'s fill() measures the dialog, puts the README
in, re-centres it (holdModal), and animates height and top together
from the old box to the new on SPRING, the curve the dialog opened on
(570ms, 1.5% over), clipped while it grows; the README fades in over
it. Height and top move on one curve, so the dialog keeps the middle
in every frame. The same for the error note when npm or GitHub
doesn't answer. Reduced motion: no animation, as before.

Budget: the core 1,530,050 -> 1,530,631, the 581 bytes of fill(), the
Plugins page's own, no room added.

Run at this head (rebased on 9277c2567):
- modal-centred-late.test.cjs, a new test sampling every frame from
  the README's arrival: heights in between the two and centred within
  2px in each frame, at 820px and 560px (README taller than the
  window), Chromium and WebKit: 12/12. With the plugin GUI files
  (plugin-market, -github, -local, -git, -folder-path, -own-icon,
  -card-update): 80/80 at 9dc7d6eb8, before the rebase onto two
  commits that touch Codex's card and the masking page only.
- go test -run Budget ./internal/gui ok; gofmt -l clean.
- Frames seeked to 0/80/160/280/570ms and looked at.

Broken by hand: fill() returning before the animation turns the new
test red in both sizes ("grew over frames: [674,674,674,674]").

Not run: the whole GUI suite and go test ./... (only plugins.js and a
test changed); not tried in the real app on WebKitGTK or Windows.
2026-10-25 17:08:20 +08:00
yetone 894ec96036 plugins: "More in Plugins" opens Discover, not the tab visited last (outloudvi on Discord)
On Providers, 「插件里还有更多」 / "More in Plugins" opened whichever
Plugins tab was visited last (Built-in, Installed). pluginQuery("")
returned early when the query was already empty, before it set the
tab to Discover. The early return is gone, so an empty query also
switches to Discover; a non-empty one already did.

plugins-more-discover.test.cjs visits Built-in, then Installed, in en
and zh, goes back to Providers and clicks the add sheet's More in
Plugins tile, expecting Discover with its cards and no Built-in list;
then the "look for a plugin" link with a search, expecting Discover
with that search.

Run:
- plugins-more-discover.test.cjs, chromium and webkit: 3 of 3 green.
- 61 GUI files the change can reach (plugin-*, plugins-*, builtins,
  deprecat*, add-sheet*, provider-search*, i18n-keys, nav-sub-unroll,
  mobile-web, market-have, sidebar-tab-top), both engines: 412 pass,
  1 fail each: builtins.test.cjs's sidebar list lacks the masking
  tab, red the same with the old plugins.js (#3498).
- go test ./internal/gui/ -count=1 (budgets included): ok but
  TestMainWindowCorners/macOS_15_SDK killed at load ~200 (#1936,
  #2645); alone it passes.
- At the rebased head (b28e5ffd8): the new test and i18n-keys green in
  both engines, go test -run Budget ok.
- No bytes added: core and app script budgets untouched.

Broken by hand: with the early return put back, the new test is red
in both engines (expected Discover, got Built-in; expected 发现, got
内置).

Not tried: the tray panel's link, which opens the main window through
window/main?view=plugins and still shows the last tab (#3579, a
sibling); the full Go suite (no suite-lock.sh on this machine).
2026-10-25 16:00:21 +08:00
yetone 63c0c354af gui: Discover is quieter: one unofficial mark, one button style, a reason in your language
Kiko03O1 on X asked for a better-looking Plugins › Discover page
("ui 设计能不能好看点"). Five things on it said one thing twice or said
it raw:

- A GitHub card had an "Unofficial" chip. A GitHub card is only ever
  drawn in the 非官方插件 · GitHub section, so the chip repeated the
  section's head on every card. It is gone from the card; the plugin's
  page keeps its full warning.
- Sign in on a card and on an Installed row is tinted like Install,
  not filled. It stays filled only in the plugin's sheet, so each level
  of action has one look.
- The GitHub line said Go's English in the middle of a zh page ("no
  answer in 8s"). internal/plugin's GitHub read now wraps its timeout in
  ErrNoAnswer; /api/plugins/github passes `why`: "slow" for that or any
  timeout, "limited" for GitHub's rate limit (ghtoken.Limited), and the page says "GitHub 响应超时" (zh, zh-TW, ja, de); the raw
  error is the line's hover. The line is smaller and muted, and Retry
  takes the accent colour.
- The second filter row's All had a count. It always equalled
  Installed + Not installed and the first row's picked count, so
  "全部 · N" showed twice side by side. It has no count now.
- Found on the way, same page: the filter box's placeholder was cut off
  in en at 1280/1100/980 and in de at every width but 420. It fits at
  every width now; the filter bar wraps where it did.

Looked at and left alone: the 8px inset on the borderless Signed in,
and the monospace version numbers.

plugins.js nets -25 bytes (the Unofficial chip's code went), so the
core script budget is unchanged: TestCoreScriptBudget passes at the
pushed head with no raise.

What was run, at this change on origin/main 4b9694c34, and again after
the last rebase onto 0df6a3aba: TestCoreScriptBudget, TestTaggedWhyKind,
gofmt, and the four changed GUI files with i18n-keys in both engines
(80 of 80):
- Red without the change: with the old assets, the four changed GUI
  files (plugin-github, plugin-github-wait, plugin-github-filter,
  plugin-market) went 37 red in Chromium; plugin-market expected the
  tinted colour and got the filled one. TestTaggedWhyKind doesn't
  compile without the change.
- Changed and nearby GUI files (those four, i18n-keys,
  plugin-check-github-limit, plugin-kinds-discover, plugin-page), both
  engines: 124 of 124 pass.
- gofmt clean. go vet clean on darwin, linux (-tags nogui) and windows;
  all three build. go test internal/gui and internal/plugin: plugin ok;
  gui ok on its own, one red in the package run,
  TestMainWindowCorners/macOS_15_SDK killed at its 40s deadline at load
  ~85 (#2645), which passes alone.
- The whole GUI suite (858 files, both engines, concurrency 3) was
  started at 628e18987 and ended early when the disk filled (ENOSPC):
  ~350 files ran, 3108 passed. Its five reds from before the disk
  filled are off the Plugins page, pass alone, and are filed:
  agent-models (#3468), cli-update (#3473), context-picks (#3483),
  deprecated-subscriptions (#3484). The rest failed launching a browser
  with ENOSPC.
- Rerun after space was freed, at d7ad3f2a3 plus this change: every
  library-* file, every plugin-* file, login-import, menu-input-scroll,
  mobile-web, name-suffix-saved and i18n-keys (94 files, both engines):
  1414 of 1426 pass. The 12 reds are all red on an origin/main
  118486258 worktree too, and filed: library-mcp-health-wsl ja (#3350),
  menu-input-scroll (#3402, 0 of 4 on main), plugin-card-update webkit
  (#3079, 0-1 of 3 on main over three runs, same Update-button wait),
  plugin-github chromium de 440 scrolled 1px (#3218, 18 of 18 alone).
- The two files after name-suffix-saved outside plugin-* that open the
  Plugins page, settings-tabs-stick and title-bar-tools, both engines:
  42 of 42 pass.
- Not run: the other ~440 GUI files after name-suffix-saved, and
  go test ./... .

Screenshots, before and after, zh dark and en light, were checked by
eye at 1280.
2026-10-24 22:31:59 +08:00
yetone fb101b0d57 plugins: a GitHub list that couldn't be read says why with Try again, instead of the section vanishing (till on Discord)
till (Windows, v0.1.1293, Belarus network) saw no "Unofficial plugins ·
GitHub" section in Plugins › Discover; a magpie in Japan shows it. On
v0.1.1293 the section shows its loading skeleton and then disappears
whenever GitHub can't be read: plugin.TaggedRepos returned the last list
(or nothing) with no error when the topic search failed, and an empty
list with no error when the search answered but every package.json read
from raw.githubusercontent.com failed or timed out. /api/plugins/github
answered 200 {repos:[]}, and the page showed ghFailed only on an HTTP
error, never in a search, and never once a list had been had.

Now:
- TaggedRepos returns the error with what it has. A failed search keeps
  the last list and says why (held a minute, like before); repositories
  the search found but that couldn't be read come back as a
  *TaggedMissing with their count and the last read error.
- /api/plugins/github sends error and missing beside repos; ?again asks
  GitHub again at once when the last answer had an error.
- The page shows the reason and Try again: in place of the section when
  nothing could be read (in Discover and in a search), and as a line over
  the cards when some were read or an older list is kept. Try again keeps
  the cards while it asks. zh, zh-TW, ja and de strings added.

No Windows-only cause was found in the code: the fetch goes through the
same netproxy on every OS (a PAC-only system proxy isn't read anywhere).
The likely cause is the network reaching api.github.com or
raw.githubusercontent.com, or the unauthenticated search limit; the page
now names which.

Run (worktree on ef655acb4, sandbox HOME):
- gofmt -l clean; go vet darwin, linux -tags nogui, windows ok; builds ok.
- go test ./internal/plugin ./internal/gui: ok. Broken by hand (failure
  path returning nil error; missing ignored): TestTaggedRepos ("down:
  <nil>") and TestTaggedReposUnreadable go red; restored, green.
- plugin-github-wait.test.cjs: 18/18 in chromium and webkit, every
  language and width; against the old assets it times out waiting for
  the reason (red). After the rebase: once 16/18 and once 17/18 with
  page.goto's 5s load timing out at load average ~280, then 18/18.
- Whole GUI suite, both engines: all pass except codex-predictions at
  420 (7 cases: Settings' stuck search head takes the click), already
  #2624, untouched by this change.
- set -o pipefail; go test -timeout 45m ./...: every package ok except
  internal/agent, which hit the 45m timeout at load average ~200 with
  other sessions' suites (2769s). Rerun after the rebase with
  internal/plugin and internal/gui: plugin ok (973s), gui ok (550s),
  agent timed out again (2704s, load ~400). Recorded on #2723; this
  change touches nothing in internal/agent.

Not tried on Windows or from the reporter's network.
2026-10-20 02:35:14 +08:00
yetone 33dbdcc529 plugins: Sign in on Installed takes the reader down to the plugin's sign-in
Sign in on Plugins › Installed (or a plugin card) opens the Providers add
sheet with the plugin's sign-in drawn at the sheet's foot, under every
tile. With many plugins the sheet is taller than the window and the reader
was left at its top, the sign-in out of sight: the click seemed to do
nothing (the owner, on magpie-intelligence-check).

The click now passes its event, so pluginSignIn scrolls the sign-in into
the middle of the view on purpose. In WebKit that alone didn't hold: the
list show() loads redraws the sheet after the scroll, WebKit pulls the view
to 0 while it is drawn, and inside the purpose window that 0 was taken as
the reader's, then backToReader returned there. arrived(v) ends the
purpose window once the scroll is done and keeps where it left the view as
where the reader is, so the redraw is put back to the sign-in.

Run:
- plugin-signin-scrolls.test.cjs (new; 24 signed-in plugins and one
  signed out, 900x560, Chromium and WebKit, en and zh): 6/6 pass. On
  origin/main 0/6 ("the page went down to the sign-in"); with the scroll
  but without arrived(), Chromium passes and WebKit fails 2/2.
- GUI: plugin*, *scroll*, *signin*, builtins: 1033 pass, 0 fail.
- go test -tags nogui ./internal/gui: ok (script budget, guard tests).
No Go changes.
2026-10-19 16:05:09 +08:00
yetone d783df46cb plugin: a plugin's page adds items to a provider's and an agent's row menu (P6)
package.json's magpie.actions: [{id, menu, title, titles}] puts items in
the row menus magpie draws, after its own: a provider row's (right-click)
and an agent row's (its handle, or right-click). Picking one opens the
plugin's page and posts it {event: "action", data: {id, provider|agent:
{id, name}}}, nothing else of the row; the bridge's magpie.onAction(fn)
gets it, and an action picked before fn was given waits for it.

- plugin.Window reads them (page.go): menu one of ActionMenus (provider,
  agent; a session's menu is left out, its title is user content), id
  ^[a-z0-9][a-z0-9-]{0,39}$, an id given twice is the first's, 8 at most,
  none for a plugin with no page.
- /api/plugin-pages carries them on the page; a missing title is the
  page's, in each language (pluginpage.go).
- pluginpages.js: magpie.actions(menu, context) gives the row menu's
  items; openRowMenu draws a plugin's name as written (literal), not
  through t().
- The Plugins page says which menus a plugin adds to (actionsLine),
  translated in zh, zh-TW, ja and de.
- Docs: plugin-runtime.md's P6 section and verification; the site's
  plugin docs (en, zh, ja) gain "Items in magpie's menus".
- The core's budget (TestCoreScriptBudget) is not raised (#2710): with
  P6 the core came to 1,447,648 bytes, 648 over. pluginpages.js's header
  now says P5's and P6's part in one paragraph and points to
  plugin-runtime.md, which says it in full, and plugins.js's panels and
  actions lines share whereLine: 1,446,845, 155 under.

Run:
- Full: this series (P5, the Plugins dot, the probe test, P6, and a
  built-ins-on commit since dropped for main's own 5a2414acd) was run
  together, at load 200-660.
  At the pushed tree, 88dfab2d3 on origin/main 5380114da (rebased
  from 210bc2b77, no conflicts; its GUI assets and tests are the same
  bytes as the tree the GUI runs below used, diff -rq): gofmt clean,
  vet darwin/linux nogui/windows ok, TestCoreScriptBudget ok
  (1,446,845 of 1,447,000). go test -timeout 45m ./... at load
  193-278: 62 packages ok, red in TestMainWindowCorners (#1936) and
  TestPluginStreamLargeReplies JSON_fast (client timeout; alone 1 of
  3 red here, 0 of 3 on 5380114da side by side at load ~280; the
  series doesn't touch the stream path; #2551 reopened with the
  output, taken). Two earlier runs at this tree are discarded: one
  stopped when the disk filled, one when another session's go clean
  -cache emptied the build cache mid-run. The whole GUI suite at
  this tree was not finished (the disk filled); the files the series
  reaches ran (1318 tests, 124 red), and the 39 red files ran again
  at concurrency 1 on both trees: here 148 ok 120 red, origin/main
  135 ok 127 red. Both sides' reds are page.goto/launch timeouts
  under load (66 here, 71 there) and the same assertions:
  title-bar-tools' and settings-proxy-auth's "access control checks"
  on a cut-off /api/providers read (#2740, taken next), sidebar's
  "the list unrolls" and WebKit "#prefs pressed darkens" (#2684;
  alone, 1 red here, 3 on main), side-toggle (#2732); plugin-move
  red on main only. Six files again one by one on both trees:
  plugin-actions red 1 of 6 here, a 5s goto of ?view=plugins at load
  260; plugin-clash red on both; plugin-own-icon, plugin-gateway,
  plugin-checkin ok on both; settings-proxy-auth ok here, 3 red on
  main.
  At 976c9893a (on origin/main 6f950653f): go test -timeout 45m ./...
  red only in TestMainWindowCorners (#1936, the window's process
  killed at its deadline) and TestSetAnswersWhileDevinAndProvidersHang
  (#1375, 3 of 3 alone). The whole GUI suite, both engines: 10834
  tests, 237 red in 73 files, 184 of them a 180s browser launch. Those
  73 files run again at concurrency 2: 52 green, among them every
  plugin-* and agent-* file and plugin-actions; the 21 still red were
  run at origin/main f191d6423 and are red there too: codex-predictions
  (#2624), lightweight (#2638), segs-glide (#2683), usage-agents-hide
  (#2276), provider-advanced-fold (#2552), routing-bodies (#2559),
  routing-model-rest and rest-try-now (#2115, #2564), routing-keys-fold
  (#1612), routing-wb-restricted (#1905), routing-request-metrics
  (#2571), quota-count-wrap and quota-name-translated (#2228), s3-sync
  (#2448), usage-checkin (#2549), usage-ledger-abort (#2700),
  tencent-access-key (#2733), usage-range (#2734); side-toggle's WebKit
  motion red 1 of 3 on main, 0 of 3 here (#2732); usage-fold green alone.
  Rebased onto origin/main 717b69f78 (60725faa1, no conflicts): gofmt
  clean, vet darwin/linux nogui/windows ok; go test -timeout 45m ./...
  red in TestSetAnswersWhileDevinAndProvidersHang (#1375) and agent and
  gateway at the 45m alarm with tests still moving at load 400+, both ok
  alone (1173s, 1167s); 105 GUI files the series reaches (plugin*,
  sidebar*, side-*, settings*, title*, header*, agent-*): 1322 tests,
  23 red, run alone 214 of 218 ok, the 4 left in sidebar and
  sidebar-overlay-scrollbar (WebKit), red on 717b69f78 too (#2684,
  #1863). The whole GUI suite was not run again after the rebase.
- gofmt -l clean; go vet darwin, linux (-tags nogui) and windows ok;
  TestCoreScriptBudget ok.
- go test -run 'TestWindowActions|TestPluginPageActions' ok: duplicate,
  malformed and session-menu ids dropped, 12 actions kept to 8, none
  without a page, an off plugin's not served.
- plugin-actions.test.cjs: chromium and webkit, en zh zh-TW ja de, at
  1100 and 420: no page adds nothing; the agent menu ends with Hide then
  the plugin's item; the provider menu's item is in the window's
  language; a pick opens the page, which gets exactly {id, provider|
  agent: {id, name}} once, in one frame, though it calls onAction 400ms
  late. The Plugins row says which menus.
- Broken by hand, each red then restored: the bridge not holding an
  action picked before onAction (the late-registering fixture), the
  provider's whole row posted in place of {id, name} (the exact-data
  check), any id and any menu accepted (TestWindowActions).
- Neighbours in both engines: plugin-page, agent-cli-missing,
  agent-disconnect, group-bulk-remove, model-test-why and provider-find
  ok; plugin-panels red before P5's fixture fix (padding, in that
  commit), ok after.
- Real use: a dev build (-tags dev) in a sandbox HOME with a
  local plugin of two actions; WebKit on its dev UI picked "Inspect
  agent" on Claude Code and "Inspect provider" on a local provider, and
  the page logged {"id":"about-agent","agent":{"id":"claude","name":
  "Claude Code"}} then {"id":"about-provider","provider":{"id":
  "local-try","name":"Local Try"}}, one frame. Not clicked in the
  WKWebView window itself; the frame's loading there is
  TestPluginPageLoadsItsFilesInTheWindow's.
2026-10-18 07:13:12 +08:00
yetone 8e44c2f351 gui: the dot on Plugins says what it is, and leads to the plugins with an update
The owner, on the sidebar's dot beside Plugins: no one can tell what it
means, and once they click it, they should see which plugins need
updating. It meant "a plugin update is waiting", said only in a hover
title, and Plugins opened on whatever tab was last open.

- Sidebar: under Plugins, Installed reads "1 update" / "N updates" in the
  dot's colour in place of its count, with a title saying where to update.
- Opening Plugins while an update waits lands on Installed.
- Installed names the plugins with a newer version in a bar above the
  list, with Update all beside them (moved there from the footer).
  Each row still shows its own "vX out" and Update.
- Strings in zh, zh-TW, ja and de; the docs (en, zh, ja) say the same.

Run:
- plugin-updates.test.cjs: chromium and webkit, en zh zh-TW ja de, at
  1024 (sidebar) and 600 (tab bar), 22 ok. Also ok in both engines:
  plugin-git, plugin-update-button, plugin-check-updates,
  plugin-card-update, plugin-prerelease, nav-sub-unroll, sidebar,
  builtins, i18n-keys. go test ./internal/gui/ -run
  'TestCoreScriptBudget' ok.
- Broken by hand, each red: no sidebar label (the 1024 cases), no jump
  to Installed, no bar (every case).
- Looked at in WebKit screenshots, zh at 1024 and de at 600.

Full run, with the rest of its series:
  this series (P5, the Plugins dot, the probe test, P6, and a
  built-ins-on commit since dropped for main's own 5a2414acd) was run
  together, at load 200-660.
  At the pushed tree, 88dfab2d3 on origin/main 5380114da (rebased
  from 210bc2b77, no conflicts; its GUI assets and tests are the same
  bytes as the tree the GUI runs below used, diff -rq): gofmt clean,
  vet darwin/linux nogui/windows ok, TestCoreScriptBudget ok
  (1,446,845 of 1,447,000). go test -timeout 45m ./... at load
  193-278: 62 packages ok, red in TestMainWindowCorners (#1936) and
  TestPluginStreamLargeReplies JSON_fast (client timeout; alone 1 of
  3 red here, 0 of 3 on 5380114da side by side at load ~280; the
  series doesn't touch the stream path; #2551 reopened with the
  output, taken). Two earlier runs at this tree are discarded: one
  stopped when the disk filled, one when another session's go clean
  -cache emptied the build cache mid-run. The whole GUI suite at
  this tree was not finished (the disk filled); the files the series
  reaches ran (1318 tests, 124 red), and the 39 red files ran again
  at concurrency 1 on both trees: here 148 ok 120 red, origin/main
  135 ok 127 red. Both sides' reds are page.goto/launch timeouts
  under load (66 here, 71 there) and the same assertions:
  title-bar-tools' and settings-proxy-auth's "access control checks"
  on a cut-off /api/providers read (#2740, taken next), sidebar's
  "the list unrolls" and WebKit "#prefs pressed darkens" (#2684;
  alone, 1 red here, 3 on main), side-toggle (#2732); plugin-move
  red on main only. Six files again one by one on both trees:
  plugin-actions red 1 of 6 here, a 5s goto of ?view=plugins at load
  260; plugin-clash red on both; plugin-own-icon, plugin-gateway,
  plugin-checkin ok on both; settings-proxy-auth ok here, 3 red on
  main.
  At 976c9893a (on origin/main 6f950653f): go test -timeout 45m ./...
  red only in TestMainWindowCorners (#1936, the window's process
  killed at its deadline) and TestSetAnswersWhileDevinAndProvidersHang
  (#1375, 3 of 3 alone). The whole GUI suite, both engines: 10834
  tests, 237 red in 73 files, 184 of them a 180s browser launch. Those
  73 files run again at concurrency 2: 52 green, among them every
  plugin-* and agent-* file and plugin-actions; the 21 still red were
  run at origin/main f191d6423 and are red there too: codex-predictions
  (#2624), lightweight (#2638), segs-glide (#2683), usage-agents-hide
  (#2276), provider-advanced-fold (#2552), routing-bodies (#2559),
  routing-model-rest and rest-try-now (#2115, #2564), routing-keys-fold
  (#1612), routing-wb-restricted (#1905), routing-request-metrics
  (#2571), quota-count-wrap and quota-name-translated (#2228), s3-sync
  (#2448), usage-checkin (#2549), usage-ledger-abort (#2700),
  tencent-access-key (#2733), usage-range (#2734); side-toggle's WebKit
  motion red 1 of 3 on main, 0 of 3 here (#2732); usage-fold green alone.
  Rebased onto origin/main 717b69f78 (60725faa1, no conflicts): gofmt
  clean, vet darwin/linux nogui/windows ok; go test -timeout 45m ./...
  red in TestSetAnswersWhileDevinAndProvidersHang (#1375) and agent and
  gateway at the 45m alarm with tests still moving at load 400+, both ok
  alone (1173s, 1167s); 105 GUI files the series reaches (plugin*,
  sidebar*, side-*, settings*, title*, header*, agent-*): 1322 tests,
  23 red, run alone 214 of 218 ok, the 4 left in sidebar and
  sidebar-overlay-scrollbar (WebKit), red on 717b69f78 too (#2684,
  #1863). The whole GUI suite was not run again after the rebase.
2026-10-18 07:13:10 +08:00
yetone b9f790d37b plugins: panels in magpie's pages, a page that replaces a built-in one, titles in the window's language, and a look that matches
P5 of the plugin runtime (docs/subsystems/plugin-runtime.md):

- Panels (magpie.panels): a plugin draws a frame into a slot of a
  built-in page (a provider's editor, Settings, Usage); magpie.context
  says where it is, and the frame is as tall as what it draws.
- A page can replace a built-in one (magpie.page.replaces); show() opens
  it in that page's place, and the sidebar row goes to it.
- page.titles and a panel's titles name it in the window's language
  ({"zh": …}); a malformed map is dropped, the title kept
  (TestWindowTitles).
- main's #2501 already names wails:// in the policy of a page in the
  desktop window (through ownWindow), which is why the usage page drew as
  bare HTML from v0.1.1259. TestPluginPageLoadsItsFilesInTheWindow loads
  a page through ownWindow in a real WKWebView, which Playwright on http
  can't; the subsystem page says how.
- The bridge adds magpie's look for what a page leaves unstyled, every
  rule in :where() so any rule of the page's wins, and the theme's
  colours as --magpie-* variables.

One commit: the panels, the replacing pages and the titles share hunks
in page.go, pluginpage.go, pluginpages.js and the docs, and couldn't be
split cleanly.

Run:
- Full: this series (P5, the Plugins dot, the probe test, P6, and a
  built-ins-on commit since dropped for main's own 5a2414acd) was run
  together, at load 200-660.
  At the pushed tree, 88dfab2d3 on origin/main 5380114da (rebased
  from 210bc2b77, no conflicts; its GUI assets and tests are the same
  bytes as the tree the GUI runs below used, diff -rq): gofmt clean,
  vet darwin/linux nogui/windows ok, TestCoreScriptBudget ok
  (1,446,845 of 1,447,000). go test -timeout 45m ./... at load
  193-278: 62 packages ok, red in TestMainWindowCorners (#1936) and
  TestPluginStreamLargeReplies JSON_fast (client timeout; alone 1 of
  3 red here, 0 of 3 on 5380114da side by side at load ~280; the
  series doesn't touch the stream path; #2551 reopened with the
  output, taken). Two earlier runs at this tree are discarded: one
  stopped when the disk filled, one when another session's go clean
  -cache emptied the build cache mid-run. The whole GUI suite at
  this tree was not finished (the disk filled); the files the series
  reaches ran (1318 tests, 124 red), and the 39 red files ran again
  at concurrency 1 on both trees: here 148 ok 120 red, origin/main
  135 ok 127 red. Both sides' reds are page.goto/launch timeouts
  under load (66 here, 71 there) and the same assertions:
  title-bar-tools' and settings-proxy-auth's "access control checks"
  on a cut-off /api/providers read (#2740, taken next), sidebar's
  "the list unrolls" and WebKit "#prefs pressed darkens" (#2684;
  alone, 1 red here, 3 on main), side-toggle (#2732); plugin-move
  red on main only. Six files again one by one on both trees:
  plugin-actions red 1 of 6 here, a 5s goto of ?view=plugins at load
  260; plugin-clash red on both; plugin-own-icon, plugin-gateway,
  plugin-checkin ok on both; settings-proxy-auth ok here, 3 red on
  main.
  At 976c9893a (on origin/main 6f950653f): go test -timeout 45m ./...
  red only in TestMainWindowCorners (#1936, the window's process
  killed at its deadline) and TestSetAnswersWhileDevinAndProvidersHang
  (#1375, 3 of 3 alone). The whole GUI suite, both engines: 10834
  tests, 237 red in 73 files, 184 of them a 180s browser launch. Those
  73 files run again at concurrency 2: 52 green, among them every
  plugin-* and agent-* file and plugin-actions; the 21 still red were
  run at origin/main f191d6423 and are red there too: codex-predictions
  (#2624), lightweight (#2638), segs-glide (#2683), usage-agents-hide
  (#2276), provider-advanced-fold (#2552), routing-bodies (#2559),
  routing-model-rest and rest-try-now (#2115, #2564), routing-keys-fold
  (#1612), routing-wb-restricted (#1905), routing-request-metrics
  (#2571), quota-count-wrap and quota-name-translated (#2228), s3-sync
  (#2448), usage-checkin (#2549), usage-ledger-abort (#2700),
  tencent-access-key (#2733), usage-range (#2734); side-toggle's WebKit
  motion red 1 of 3 on main, 0 of 3 here (#2732); usage-fold green alone.
  Rebased onto origin/main 717b69f78 (60725faa1, no conflicts): gofmt
  clean, vet darwin/linux nogui/windows ok; go test -timeout 45m ./...
  red in TestSetAnswersWhileDevinAndProvidersHang (#1375) and agent and
  gateway at the 45m alarm with tests still moving at load 400+, both ok
  alone (1173s, 1167s); 105 GUI files the series reaches (plugin*,
  sidebar*, side-*, settings*, title*, header*, agent-*): 1322 tests,
  23 red, run alone 214 of 218 ok, the 4 left in sidebar and
  sidebar-overlay-scrollbar (WebKit), red on 717b69f78 too (#2684,
  #1863). The whole GUI suite was not run again after the rebase.
- plugin-panels' tall panel (body{margin:0}) measured 220, not 180,
  after the look above gave an unstyled body 20px of padding; the
  fixture now sets padding:0 too, as a page that wants none would.
  plugin-panels ok in chromium and webkit after.
- gofmt -l clean; go vet darwin, linux (-tags nogui) and windows ok.
- GUI: plugin-page and plugin-panels in chromium and webkit, en zh zh-TW
  ja de, wide and narrow, ok.
- Broken by hand, each red then green: titled() in pluginpages.js
  (the "draws in its frame" test), the wails:// scheme in pagePolicy
  (the WKWebView test, before the rebase onto #2501), titles' parsing
  (TestWindowTitles).
- Real use: the published @magpie-community/page-usage 0.1.1 in a
  sandbox magpie window, its tiles styled.
2026-10-18 07:13:09 +08:00
yetone 17557132cb gui: in a narrow window the title bar's tools show their icons, then the title gives way; nothing lies over it (#2625, linusxiong)
Beside the sidebar, Library's, Plugins' and Settings' heads sit in the
title bar after the breadcrumb, between --tools-l (the crumb's right +
16) and the window's buttons, laid out flex-end. When the tools needed
more than that room they ran on to the left, over the crumb: at about
650pt with the sidebar, Library -> MCP servers had 「发现」 over
「MCP 服务器」's last character. The crumb never gave way to them.

app.js tools() now shares the room out, laying out and reading each
step in its one frame, the next only if the tools still run over:
1. the crumb whole (its natural width from its parts, the last one's
   scrollWidth) and the tools with their words;
2. body.tools-tight: Library's Discover / Library folder / Backups and
   Plugins' "Mirrors in China" show their icon (or switch) alone. Each
   keeps its name as aria-label (a hidden span leaves the accessible
   name) and its tooltip as before (the folder's path, the backups'
   note and path, Discover's and the mirrors' sentences);
3. --crumb-max: the crumb drops its leading parts ("Work /"), a part
   and its slash at a time, and last cuts the page's name at its end.
In the side-nav head the Library buttons and the mirror switch are
flex: none and Plugins' search keeps 120px, so what doesn't fit shows
as running over rather than shrinking out of sight. The views'
MutationObserver also asks tools() again, as a tab's own tools change
(Discover only on MCP servers and Skills) without the crumb resizing.

title-bar-tools.test.cjs (new): every Library tab, Plugins' three and
Settings, sidebar picked, window mode, at 560 (the window's least),
650, 760, 900, 1024 and 1280px, in zh, zh-TW, ja, de and en, Chromium
and WebKit. No tool lies over the shown title or another tool or out
of the bar, no label is cut, an icon-only tool has aria-label and
title, only leading crumb parts go and the page's name shows, whole
from 650px. Against the old assets (MAGPIE_GUI_ASSETS) it fails in all
five languages at 560px Library Instructions ("a tool lies over the
title"); with the change Chromium 5/5 and WebKit 5/5. Looked at
screenshots of zh Library MCP servers and Plugins Discover at 560, 650
and 760px.

docs/subsystems/gui-shell.md says how the title bar gives way.

Run with both #2623's and #2625's changes, on b7d9616d0 (macOS, Go
1.26.8, load average 80-270 from other sessions):
- gofmt -l: nothing. go vet -tags nogui ./... with GOOS darwin, linux and
  windows: clean.
- set -o pipefail; go test -timeout 45m ./...: every package ok except
  internal/agent (2702s) and internal/gateway (2721s), which ran past
  45m under the load (#2544, #2108; no test hung, each was seconds into
  its run). Rerun with -timeout 90m: internal/agent ok (2816s);
  internal/gateway's only red is TestDesktopSubagentUnsetDoesNotDecode,
  "allocated 1 times" (10/10 green alone, filed as #2699). The textcalls
  tests passed in that run.
- The whole GUI suite, both engines (NODE_PATH at playwright@1.62.0). It
  ran in two parts, because another session deleted the first part's log
  mid-run; the files from provider-* on were run again. title-bar-tools
  passed 10/10 inside the suite. The reds are red the same way on
  b7d9616d0's assets, rerun beside them (MAGPIE_GUI_ASSETS) at
  concurrency 1-2:
  - segs-glide 20/20: filed #2683.
  - sidebar under load: filed #2684; 4/6 red on the old assets.
  - lightweight: filed #2638.
  - Already filed:
    - usage-agents-hide (#2276), routing-bodies (#2559, #2658),
      routing-keys-fold (#1612), routing-model-rest (#2115),
      routing-wb-restricted (#1905), rest-try-now (#2564), s3-sync (#2448).
    - quota-count-wrap, quota-name-translated and usage-fold (#2399),
      usage-checkin (#2549), usage-refresh (#2184), usage-ledger (#1876).
    - codex-predictions (#2624), github-sync (#2631), login-import (#1307).
  - The rest were Playwright launch timeouts under load (#2371).
- After rebasing on origin/main 85eef5d87: title-bar-tools Chromium 5/5,
  WebKit 5/5. Before that, WebKit zh and ja failed on a page error, "Fetch
  API cannot load /api/providers due to access control checks". That is
  WebKit's report of a sidebar read cancelled by the test going to the
  next page (#1350, #1307). The test now leaves that one WebKit message
  out. Against b7d9616d0's assets, WebKit ja is still red: "a tool lies
  over the title at 560px library instructions".

Not tried in the real app on Linux (WebKitGTK) or Windows (WebView2);
no motion or new browser API is involved, only layout.
2026-10-17 18:41:43 +08:00
yetone 7d7dba31ae provider: removing or turning off a moved subscription's plugin moves nothing back
The built-ins are being retired (the owner, 10-16: 陆续把内置Provider下线掉),
so the last way back to one is gone. MoveBack, moveBack and releasePlugin
are removed, with the Left flag they set.

- SetPluginOff only turns the plugin off. A moved subscription stays
  moved, off with it.
- RemovePlugin records the moved ids as the new state "removed". The
  record keeps its accounts, which plugin.Remove leaves in the plugin's
  auth store. Nothing moves or installs it by itself: MoveRetiring
  skips it and keepMovedCurrent reads only "plugin".
- HandOver turns a removed record whose plugin is installed and current
  back into "plugin", record and all. So does Adopt (the editor's Move).
- MoveRetiring moves an old "back" record again, whatever Left said.
- Plugins page, rm/off confirms: "{names} stops working until the plugin
  is installed again. Its accounts are kept." / "... while the plugin
  is off." The status after removing no longer says it is back on the
  built-in.
- Strings: five old strings dropped ("Moving back…" among them), three
  new ones in zh, zh-TW, ja and de.
- `magpie plugins rm`/`off` say the same in their output.
- Docs: provider-plugins.md (the states table, the Move-back paragraph)
  and AGENTS.md.

Tests:
- TestNoWayBack is new. It covers a "back" record moved again, the
  plugin turned off (still moved, accounts kept), removed (removed, not
  reinstalled by keepMovedCurrent or MoveRetiring), installed again
  (HandOver), and removed again then Adopt.
- TestReleasePlugin and TestMoveBackKeepsLapse asserted the way back
  and are deleted.
- TestMove, TestHandOver, TestMoveTidiesItsPlugin and
  TestAdoptBeforeSigningIn no longer call MoveBack. TestKeepMovedCurrent
  uses the removed state.
- plugin-release.test.cjs checks the new asks and that the status names
  no built-in.

Run:
- Broken by hand:
  - With HEAD's migrate.go, TestNoWayBack is red at "turning the plugin
    off moved it back".
  - With HandOver's removed branch disabled, it is red at "installed
    again: map[], moved false".
- go test -tags nogui ./internal/provider -run
  'TestMove|TestNoWayBack|TestHandOver|TestKeepMovedCurrent|TestAdopt|TestInstallPlugin|TestWorkBuddyCheckin|Plugin|Migrat':
  ok.
- GUI (NODE_PATH playwright, --test-concurrency=1): plugin-release,
  plugin-move and i18n-keys, chromium and webkit: 17/17.
- gofmt -l clean; GOOS=linux and windows go vet of provider, gui and cli.
- Full suite: go test -tags nogui ./... -count=1 -timeout 90m at this commit rebased on 9b04c4e20 (with the TestFailOpen fix after it): 66 packages ok, none red. Before that fix, at bff7cbd24, 65 ok and internal/middleware TestFailOpen red under load (fixed at its cause in the next commit).
2026-10-16 22:58:41 +08:00
yetone 1d6f461a99 plugins: the Unofficial, on GitHub section shows while GitHub hasn't answered, looking, with cards still to come
On a slow line the section wasn't drawn until /api/plugins/github
answered, so Discover read as having no unofficial plugins (yetone:
当还没加载完的时候,压根就不显示,会让那些网慢的用户以为没有非官方插件).

While it waits, the section stands in its place before the field: its
head and hint, a quiet "Looking on GitHub" with three breathing dots
(role=status, aria-busy on the section), and three card-shaped ghosts
(logo, name, author, button, two lines, two chips) a soft light passes
over, each card a beat after the last. When GitHub answers, its cards
come in where the ghosts were with a short staggered fade-up. A search
while it waits shows the same. When the ask fails (and nothing was
loaded before) the section says "Couldn't ask GitHub: <error>" with Try
again, instead of disappearing. prefers-reduced-motion stops all of it.
Strings in zh, zh-TW, ja and de.

Run:
- new internal/gui/tests/plugin-github-wait.test.cjs: 18/18 on this tree
  (Chromium and WebKit; en, zh, ja, de; 980 and 440 wide; held, search
  while held, let go, 502 then Try again, no scroll on the click).
  With MAGPIE_WAIT_ASSETS at origin/main's assets: 9/9 red (Chromium).
  Screenshots of each state looked at.
- GUI files around it (plugin-*, i18n-*, builtins, nav-sub*,
  click-scroll, old-webkit, mobile-web): 602/620 under load. The reds,
  rerun one file at a time here and on origin/main a751f5282: the same
  31 pass / 6 fail on both; the fails are plugin-other-ways, filed as
  #2590. i18n-keys' plugins/routing duplicates and the nav-sub-unroll /
  plugin-market timeouts passed on the one-at-a-time rerun.
- go test ./internal/gui: TestMainWindowCorners killed at 40s at load
  ~140-200 (#1936, sighting added); alone it passes here and on main.
- node --check on plugins.js and i18n.js.
Not tried: the real app on Linux WebKitGTK (CSS animation of
background-position and opacity only, no view transition).
2026-10-16 22:50:26 +08:00
yetoneandTsukikage7 9b04c4e20f plugin: async gateway request hooks, run in Bun before routing and after the reply (#2118)
A package's magpie.hooks entry (or a *.hooks.{js,mjs,ts,mts} file) exports
`async onRequest(body, ctx)` and an optional `onResponse(reply, ctx)`. They
run in the Bun plugin host, so a hook can await I/O, for example a context
service like PowerContext, which the sync moejs middleware can't. The
gateway still makes one model request per client request. A hook adds
context to the body; it doesn't register tools or run a loop, so magpie
doesn't become an agent runtime.

Ported from Tsukikage7/magpie#1. Changes from the fork:
- The entry name is magpie.hooks / *.hooks.*. The fork's magpie.gateway /
  *.gateway.mjs is already the middleware's alias, so a hook importing
  node:fs was also loaded as moejs middleware and failed there.
  TestGatewayHookNamesApartFromMiddleware fails if the two sets overlap.
- onRequest is rolled back, and counts as failed with no onResponse, when
  it throws, times out, returns non-JSON, or changes tools, tool_choice,
  function_call, functions, toolConfig, model or stream.
- onResponse gets the client-facing reply, merged through the gateway's own
  stream decoder, collector and renderer (no second merger).
- Codex's native passthrough (/backend-api/codex) runs the hooks too,
  without the sync middleware.
- The run ends with the request handler, not the client connection. Codex
  hangs up on response.completed, and the reply it got is still captured
  as a success. TestGatewayHookSeesReplyAfterClientHangsUp is red on the
  old `r.Context().Err()` check and green with -count=3.
- ctx.origin is host-derived (local / gateway-key / remote). Headers, keys
  and peer addresses never reach the hook.
- Plugins page: a hook package shows a "Request hook" chip, a diagnostics
  line (outcome code, calls, avg ms, bytes, failures; no content), and
  Options. Strings are in en, zh, zh-TW, ja and de.

Docs: docs/subsystems/gateway-request-hooks.md (new), provider-plugins.md,
gateway-middleware.md, and site docs plugins.html in en, zh and ja.

Real use, sandbox HOME on 127.0.0.1:3486 with the owner's real Codex Pro
sign-in. The probe hook adds a codename note and logs both callbacks:
- /v1/responses, /v1/messages, Gemini generateContent: stream and
  non-stream. onRequest's note reached the model (the answer had the
  codename), and onResponse got success=true and the whole reply.
- /v1/chat/completions: with the probe also changing `model`, the change
  was rolled back (the reply came from the asked model) and no onResponse
  ran. Without that change, earlier: stream and non-stream success.
- The real Codex CLI 0.162.1 `codex exec` through openai_base_url ->
  /backend-api/codex: the hook saw origin=local, agent=codex and the
  query; the answer had the codename; onResponse success=true (before the
  hang-up fix it never ran: the context was already cancelled).
- `magpie plugin list` shows only "async gateway hook onRequest" for the
  hook package, no failed middleware.

Tests (base origin/main 63be47717, macbook at load avg 220-340 from other
sessions' suites):
- gofmt -l: clean. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: clean. go build and GOOS=linux -tags nogui
  build: ok.
- go test ./... -timeout 45m: every package ok except:
  - agent, gateway and library timed out at 45m under the load;
  - gui's TestSetAnswersWhileDevinAndProvidersHang (#1375, also red on a
    clean 63be47717 run alone; commented there);
  - library's TestSkillRelinkKeepsUnreadableCopy, which passes -count=2 alone.
  Rerun at -timeout 150m: agent ok (4524s), library ok (2581s). gateway was
  ok except TestVisionWaitIsntTheDescribersTime's 300ms limit (#2444,
  commented), which passes -count=5 alone on this tree and on 63be47717.
- internal/plugin and internal/gateway hook tests: ok.
- GUI (chromium+webkit; en, zh, zh-TW, ja, de): plugin-gateway 12/12 twice.
  It failed earlier at load ~340, chromium only, on page.goto's 5s (#2542).
  All 43 plugin-*.test.cjs files and mobile-web are green except:
  - plugin-move: red on a clean 63be47717 too (#2399, commented);
  - plugin-moved-signin: one 5s waitFor under load, then 6/6 twice.

Rebased onto ea3dee96a (21 commits; main touched host.go, host.js, i18n.js and
the plugin docs; clean rebase), then rerun at the rebased head:
- gofmt, vet (darwin, linux nogui, windows) and build: clean.
- go test: plugin ok, cli ok, gateway -run 'Hook|Middleware|Codex|Plugin' ok.
  gui ok except TestMainWindowCorners, which was killed under load (#1936)
  and passes alone.
- GUI: plugin-gateway 12/12, plugin-middleware 24/24, plugin-tools 22/22,
  plugin-agent 22/22.
- Real account with the rebased binary: every protocol and the real Codex
  CLI gave the same results as above (codename answered, success=true,
  chat's model change rolled back).

Co-authored-by: Tsukikage7 <65526564+Tsukikage7@users.noreply.github.com>
2026-10-16 20:48:51 +08:00
yetone b6533893a7 plugins: Discover lists tools and page plugins, and the intro links to the plugin docs
Every kind of plugin magpie runs now has its place on the Plugins page, so
someone looking to extend magpie finds what exists and how to write one:

- Discover has "Tools for agents" (market kind "tools") and "Pages" (kind
  "page") sections beside Subscriptions, Gateway middleware and Agents,
  each card with its own chip (a new Tools chip, the Page chip). Before,
  both kinds fell under Subscriptions as Providers.
- A GitHub repository tagged magpie-plugin whose package.json has
  magpie.page.file is a Page, and that file must be committed, as a
  provider's entry must (TaggedRepos).
- An installed plugin that only gives tools wears the Tools chip.
- The intro says what a plugin can be (provider, gateway middleware,
  routing strategy, tools, an agent, a page) and its "Write a plugin" link
  opens usemagpie.ai/docs/plugins in the window's language (zh and zh-TW
  to zh/, ja to ja/), outside the window.
- The docs' Publishing section lists the "tools", "page" and "agent"
  registry kinds and the community package names for each, in en, zh, ja.

Run at the reviewed head (on origin/main cf21b71ff):
- go test ./internal/plugin: ok. Broken by hand: without the page case,
  and with the page's entry not checked, TestTaggedRepos goes red.
- plugin-kinds-discover.test.cjs (new): 5 languages x 980/420 x chromium
  and webkit, green. Broken by hand, each red: the old plugins.js (11/11
  fail), no "tools" kind (11/11), no ja/zh-TW docs link (3), no Tools chip
  on an installed row (11/11).
- plugin-middleware.test.cjs's intro test now checks the new copy and link;
  it still checks the click scrolls nothing.
- Every plugin*.test.cjs and i18n*.test.cjs, both engines: 505 pass, 0 fail.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: 0.
- go test -timeout 45m ./...: all 66 packages ok (full=0).
2026-10-16 01:48:45 +08:00