Commit Graph
28 Commits
Author SHA1 Message Date
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 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 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 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 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
yetoneandMiFaZhan acb0d4ba0a gui: Plugins' "Unofficial, on GitHub" picks out what's installed beside its kinds, and the two narrow it together (#2381)
The owner: 插件发现这里加一个未安装. MiFaZhan's patch (#2381, fork
commit 295eb0e9): beside the kinds, a second segmented control, All ·
Installed · Not installed, each with how many there are. Each strip
counts what the other, the section's field and the page's search leave,
so picking Middleware turns the installed strip's counts into the
middleware's alone; Show all clears it with the kind and the field.
Which repositories are installed is asked once each (entryOf, the same
call the cards' "have" comes from). "Installed or not" and "Not
installed" in zh, zh-TW, ja and de; Installed reuses its key.

Changed from the patch, on review:
- The strip shows only while the list has both installed and not
  installed repositories, as one kind alone gets no kinds strip: with
  nothing from GitHub installed, Not installed was All again and
  Installed always 0.
- A pick the strip can no longer show is dropped, rather than narrowing
  the grid out of sight: Installed picked, then the page's search left
  only repositories not installed, hid the strip and kept an empty grid.
- The test checks the page's own .pm-card.have against the two the
  fixture installs (it had compared a package-name rule of its own),
  and adds: nothing installed has no strip, and the strip going takes
  its pick with it. Its 420px run is the commit before.

Run (at this commit):
- plugin-github-filter.test.cjs, en/zh/zh-TW/ja/de at 1100/980/420 plus
  "nothing installed": chromium 17/17, webkit 17/17.
- Broken by hand, each red in both engines: the pick kept when the strip
  goes (16 red), the strip always shown (17), Show all leaving the pick
  (16), the kinds' counts ignoring the installed pick (16), the
  installed strip's counts ignoring the kind (16).
- plugin-github.test.cjs 9/9, i18n-keys.test.cjs 3/3,
  go test -tags nogui -run 'TestCoreScriptBudget|TestBuiltinsTranslated'
  ./internal/gui ok. No Go file changed; git diff --check clean.

Not tried: the real app window; the patch's threshold (no bar at six
tagged repositories or fewer) is kept as it was.

Full suite: SUITE_LINE

Co-authored-by: MiFaZhan <MiFaZhan10@gmail.com>
2026-10-15 23:08:04 +08:00
yetone 6ac7032b4b plugins: a community plugin's tools reach every agent through magpie's MCP server /mcp/magpie/tools (P4 tool point)
A plugin's OpenCode `tool` hook ({tool: {name: tool({description, args,
execute})}}) used to reach no agent. Now the plugin host collects each
loaded plugin's tools, turns their zod args (v3/v4 shape or object; a
raw JSON Schema is kept) into JSON Schema, and runs one on a `tool`
call: arguments checked against the tool's own zod first (defaults
filled, a wrong one named), execute raced against ToolTimeout (55s,
ctx.abort fires), the answer as text.

The gateway serves them as an MCP server at /mcp/magpie/tools
(tools_mcp.go, guarded by serveMCP as the search one, 4 MiB body):
tools/list names each <plugin short name>_<tool>, at most 64 chars,
a shared name numbered _2; tools/call holds the call to the calling
key's limit through reserveFor and runs it with the calling agent.
The built-in plugin `tools` ("Plugin tools", Essential) serves
gwtool.PluginTools; off, nothing is listed, a call says the plugin is
off and the host isn't asked. InUse counts plugins that are on and
gave tools, from plugin-tools.json, which the host writes after each
load (whole, only on change), so it never starts Bun; the gateway's
KeepFresh watches that note too. Tool answers go to the calling
agent only, so masking doesn't apply (said in the docs).

The Plugins page lists an on plugin's tools by their MCP names, with
descriptions on hover and a button copying the server's address; a
plugin of tools alone has no Provider chip and isn't said to sign in
to nothing. Not done: a Library featured opt-in entry; wiring is the
copied address.

Docs: docs/subsystems/plugin-tools.md (new), plugin-runtime.md's new
"P4: community plugins at every point" section with the tool row, the
README index, usemagpie.ai/docs/plugins#tools in en, zh, ja with an
example. Strings in zh, zh-TW, ja, de. Example plugin:
internal/plugin/testdata/tools.

Run at this commit's tree (base 4df1ba0c6), each package alone, -p 2:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows
  over internal/plugin, gwtool, gateway, plugins/..., gui, pluginrt: ok
- go test ./internal/plugin -run Tool; ./plugins/...; ./internal/pluginrt;
  ./internal/gui -run 'Builtin|Plugins'; ./internal/gateway -timeout 45m
  -run 'ToolsMCP|ServingGates|OwnMCPRejects|SearchOnAndOff|KeyLimitsOnAndOff':
  all ok
- GUI, Chromium and WebKit: every plugin-*.test.cjs, i18n-keys,
  builtins: 461/461 pass; plugin-tools.test.cjs (new) covers en, zh,
  zh-TW, ja, de at 980 and 420 px

Broken by hand, each red, then restored:
- tools/list ignoring the gwtool gate -> TestToolsMCPOff
- tools/call ignoring the gate -> TestToolsMCPOff
- reserveFor removed -> TestToolsMCPHeldToKeyLimit (tool ran)
- collision suffix dropped -> TestToolsMCPServesPluginTools
- ToolsOn ignoring Off -> TestPluginTools
- host arg check removed -> TestPluginTools
- host timeout race not listening -> TestPluginTools (answered at
  5.3s by Go's backstop; the test now bounds it at 4s, and the first
  try at this break was a syntax error that proved nothing)
- GUI listing an off plugin's tools -> plugin-tools.test.cjs

Real use: a built magpie in a sandbox HOME (MAGPIE_ADDR 127.0.0.1:3491,
real Bun), the example plugin added with `magpie plugin add`. curl over
MCP: initialize, tools/list (4 tools, schemas), shout "HI HI (for
curl)", a missing argument as isError naming it, add {"sum":6.5}, fail
"it broke", a foreign Origin 403; plugin-tools.json written. Claude
Code (sandbox CLAUDE_CONFIG_DIR) `claude mcp add --transport http` +
`mcp list`: Connected. Not tried: a model calling a tool through a
real agent turn (no model in the sandbox). Binary and HOME removed.
2026-10-15 22:36:59 +08:00
yetone 1eea68e0cd gui: Plugins' "Unofficial, on GitHub" has its kinds to pick and a field of its own to narrow it
The owner: 这里应该有分类以及搜索框方便用户筛选. The section lists every
repository tagged magpie-plugin, 31 on the dev instance today, as one
long grid, and the page's only search ("Search plugins and npm…") sits
at the top and also asks npm.

Once more than six repositories are tagged, the section's head has:
- its kinds as a segmented control (All · 31, Provider · 27,
  Middleware · 3, Agent · 1): only kinds that have repositories, each
  counting what the field leaves, and none when one kind is all there is;
- a field that narrows by name, author or description as it is typed,
  with Escape to clear it;
- "No plugin on GitHub matches" with Show all when nothing is left.
Both narrow what the page's search has already found. Only the section
is drawn again as they change. The section, its field and the page's
body are made once and kept in the page, as the page's own field is
(#1055), so an answer that redraws the page while someone types (npm's)
keeps the field's focus and every key. Strings in zh, zh-TW, ja and de.

Run:
- plugin-github-filter.test.cjs (new), built on the dev instance's real
  /api/plugins/github answer: chromium and webkit, en/zh/zh-TW/ja/de,
  980px and 440px, 22/22. Putting back drawBody's replaceChildren turns
  the field-keeps-its-focus check red.
- Every other plugin-* GUI test, plus i18n-keys and nav-sub-unroll, in
  both engines: all green. plugin-github went 0/18 at first, because two
  fields matched its `.pm-find input`; with the six-repository threshold
  its four repositories show the plain grid, and it is 18/18.
- Looked at in dark WebKit at 1200px and light Chromium at 440px.
2026-10-13 04:52:38 +08:00
yetone e9b16ca184 gui: a plugin's Update is a button the size of Install, in green, on its card, its row and Update all (#1587, timonwong)
timonwong saw a plugin update announced on Plugins but the button that
brings it hard to find: on a card it was a small chip among the meta
chips ("Update to v0.0.9"), on the Installed row a text link, and Update
all a text link in the footer.

- One updateButton() makes every plugin Update: .pm-act (Install's height,
  min width, padding, font and corners) with .pm-up, green-soft with
  green text, filled green on hover (the app's own tokens; no stripes).
  Its title says the version (or the repo's newer commit for a git one),
  and for a community package that magpie updates by itself within the
  hour.
- A card's one button is Update in place of Signed in / Installed, as an
  app store's Update takes Open's place, and the card's version reads
  "v0.0.7 → v0.0.9" then. Sign in, not done yet, and Move keep their
  place; the Installed row offers Update then. The plugin's page uses the
  same button (actionFor).
- The Installed row's Update and the footer's Update all are the same
  green button.
- The class is pm-up, not update: the title bar's app-update pill owns
  .update (margin, height 22px), which the first try picked up.

Tests:
- new plugin-update-button.test.cjs: at 520px, Chromium and WebKit, en,
  zh, zh-TW, ja, de: the card's Update, the row's Update and Update all
  have Install's height, min width, padding, font, corners and margins,
  are at least Install's width, have a colour that isn't Install's, fit in
  the card, no sideways scroll. On the old plugins.js/css 7/7 fail; with
  the class named update the margins check fails.
- plugin-card-update.test.cjs follows the chip to the card's button.
- every plugin*.test.cjs, both engines: 274/274. The
  first run caught Update taking Sign in's place on the plugin's page
  (plugin-market), fixed by the order above.
JS/CSS only; no Go changed.
2026-10-11 20:10:05 +08:00
yetone cb406c8425 plugins: a plugin can add an agent magpie has no setup of its own for
Plugins could be subscription providers or gateway middleware. Now a third
kind: an agent plugin, so a user whose agent magpie doesn't ship can still
put it on magpie.

- internal/agentplug: a plugin's magpie.agent module (or a *.agent.js file)
  exports agent = {id, name, config, format?, model, prefix?, bin?, dir?,
  ua?, icon?, notice?} and an optional connect({gateway, model, models,
  agent}) returning the other keys to write. Compiled in moejs, reloaded
  when plugins.json or the file changes; why one didn't load is kept.
- internal/jsmod: module compiling (imports kept inside the plugin), moved
  out of middleware so both share it.
- internal/agent/plugged.go: each becomes an Agent (Plugin set) after
  magpie's own. JSON, YAML and env files are edited key by key, comments
  kept; what each key held is stashed typed under plugin:<id>:<path>, and
  its own model or Disconnect puts every key back. A built-in id is
  refused; a connect that throws writes nothing. Key magpie-<id>; usage
  names it by key or ua (usage.PluginAgents).
- GUI Plugins page: an Agent kind chip and glyph, a Discover "Agents"
  section (market kind "agent"), and an installed row line "Adds X to
  Agents" or why it didn't load. zh, zh-TW, ja, de strings.
- Docs: site Plugins page (en, zh, ja) "Agent plugins", reference.md,
  agent-wiring.md, gateway-middleware.md.

Run:
- go test ./... (all ok); gofmt -l clean; GOOS=linux go vet -tags nogui
  ./... and GOOS=windows go vet ./... clean.
- TestPluggedYAML, TestPluggedJSONUnwire, TestPluggedRefused.
- GUI: plugin-agent.test.cjs 22/22 (en, zh, zh-TW, ja, de; 980 and 420;
  chromium and webkit); all plugin-*.test.cjs, i18n-keys,
  deprecated-subscriptions, filter-ime: 315 pass, 0 fail.
- Real use, in a sandbox HOME: an Aider plugin (~/.aider.conf.yml, prefix
  openai/, connect writes openai-api-base/key) installed in a dev build;
  picking DeepSeek V4.1 Flash on the Agents page wired the file keeping the
  user's comment and keys; real aider 0.86.2 `--message` answered through
  magpie from the real DeepSeek account; usage.jsonl recorded agent aider,
  provider deepseek, 200; Disconnect restored the file byte for byte.
2026-10-10 18:39:47 +08:00
yetone 7d0e415e62 plugins: two plugins that sign in to one provider are both listed, each row says which serves it, and Use for picks the other (neiko on Discord)
neiko on Discord installed a third-party plugin beside a plugin of their
own, added by its folder. Only the third-party one could be seen. Both
plugins' auth hooks name the same provider id. The host's auths() keeps
the last plugin in plugins.json for an id, as OpenCode does, so the
user's own plugin silently lost it:
- its row read "Signs in to nothing magpie can use";
- its provider was gone from the Add sheet;
- keepUnloaded could list the id a second time, from the
  plugin-providers.json kept before.
A package-name clash and a display-name clash were tried as well. Both
plugins stay visible in those cases, because a folder plugin's name is
its path.

What changed:
- host.js:
  - init gives each loaded plugin the ids it signs in to (provides) and,
    for each id another plugin serves, that plugin's spec (servedBy).
  - auths() honours plugins.json's new prefer map (id -> spec).
  - Only the serving plugin's provider.models hook runs for the id.
- plugin:
  - Clashes() turns provides and servedBy into {id, by, with} per spec.
  - Prefer() records a pick and restarts the host.
  - Remove drops the removed plugin's picks.
  - Re-adding a plugin under a new spec carries its picks over.
  - remove, off, options and prefer find a plugin by its exact spec
    before its package name (indexOf), so acting on one plugin never
    reaches another of the same package.
  - keepUnloaded no longer re-adds a provider from before when another
    plugin serves its id now.
- GUI:
  - /api/plugins rows carry clashes, with the provider's listed name.
  - POST /api/plugins/prefer {spec, provider}.
  - The serving row says "{other} signs in to {name} too; this one
    serves it".
  - The other row says, in amber, "{name} is served by {other}, which
    signs in to it too", with a "Use for {name}" button.
  - New strings in zh, zh-TW, ja and de.
- CLI: `magpie plugin` prints the same lines, with the command that
  fixes it, and `magpie plugin use <name> <provider>` makes the pick.
- Docs: docs/subsystems/provider-plugins.md, docs/reference.md and
  site/public/docs/{,zh/,ja/}plugins.html.

What was run:
- Reproduced under a sandbox HOME with magpie web on 3562: a fake npm
  plugin and a folder plugin, both on id "acme".
  - Old binary: the local row had providers [] and /api/providers
    listed acme twice.
  - New binary: both rows carry the clash; prefer moves acme to the
    folder plugin; remove clears the pick and leaves the other plugin
    serving acme.
- New Go tests:
  - TestTwoPluginsOneProvider, a real Bun host: Prefer, restart,
    off/on and Remove.
  - TestClashes, TestPluginNamedExactlyFirst and
    TestKeepUnloadedLeavesAServedID.
  - TestPluginsClashRows (gui) and TestPluginListSaysClash (CLI).
  - Each fails when its piece is broken by hand: prefer ignored in
    host.js, the keepUnloaded id check removed, name before exact spec,
    Remove keeping picks, no provides, no clashes in the rows, no
    prefer route.
- plugin-clash.test.cjs, in Chromium and WebKit, in en, zh, zh-TW, ja
  and de, at 1100 and 560px: 22/22 pass. It times out on the old
  plugins.js.
- gui-de, gui-ja, gui-zh-tw, i18n-keys and every plugin-*.test.cjs:
  248 tests.
  - 245 passed in the 4-wide run.
  - plugin-moved-signin (webkit) failed once in that run, then passed
    3/3 alone and 26/26 in a smaller 4-wide rerun.
- gofmt -l; go vet ./...; GOOS=linux and GOOS=windows go vet -tags
  nogui ./...; go build ./...
- The full go test -tags nogui ./... under a temp HOME with the caches
  pinned: 44 packages ok, none failed.
- After rebasing onto 05917100 (plugins.css conflict with a3a8e257's
  chip rules, both kept): plugin, gui and the root plugin tests, vet on
  darwin, linux and windows, and the 248 GUI tests above, all green
  (248/248 this time).

Not tried: a real third-party plugin, neiko's own plugins, and Windows
beyond vet.
2026-10-10 00:55:38 +08:00
yetone 849faea3a3 plugins: a card's kind and Unofficial chips without fills, provider and middleware each their own hue (yetone)
Unofficial is a hairline with a small amber dot; what a plugin is reads as
its glyph and word, periwinkle for a provider and teal for middleware,
apart from the community badge's green.

Ran: plugin-github, plugin-middleware and plugin-check-updates GUI tests in
Chromium and WebKit (en/zh/ja/de, 980 and 440), light and dark looked at.
2026-10-10 00:42:37 +08:00
yetone f6f960e42c plugins: a GitHub repository tagged magpie-plugin shows on the Plugins page under Discover, as an unofficial plugin nobody at magpie has reviewed
GitHub's search for topic:magpie-plugin (not archived, not a fork, not
magpie-community's own, which the market lists) is asked at most every six
hours and kept on disk, so a restart or GitHub being down shows what it said
last. Each repository is read from its package.json on the default branch.
When npm has that package published from the same repository, it is
installed from npm, because a repository often builds its dist only to
publish and Bun runs no build for a git install. Otherwise it is installed as
github:owner/repo, and only if the file it loads (exports, main or
magpie.middleware) is in the repository. Its page warns that it is
unofficial, says whether npm or the repository is what gets installed, and
shows the repository's README until it is installed. MAGPIE_PLUGIN_MARKET=off
asks GitHub nothing.

Checked against real GitHub with the topic set to opencode-plugin in a
sandbox: 43 repositories came back, and 32 were kept (30 from npm, 2 from
git). github:ndom91/open-plan-annotator, one of the git ones, really
installed and loaded. alfaoz/opencode-see-image, whose dist isn't in its
repository, failed to load before the entry check and is now left out. The
test fixtures are GitHub's and npm's real answers.

Ran: go test -race -count=3 ./internal/plugin, go test ./internal/gui, go
vet, and plugin-github.test.cjs (Chromium and WebKit, 980/440, en/zh/ja/de,
18/18). The full GUI suite passed 3343 of 3348. The 5 failures were WebKit
number-units, purpose-filter and routing-failed-open, which pass 3/3 on
their own and don't touch the Plugins page.
2026-10-07 10:13:20 +08:00
tsuixl bd33e575f1 gui: let users choose installed interface and code fonts (#1007)
* gui: choose installed interface and code fonts and styles

Discover installed styles through DirectWrite, CoreText and Fontconfig. Keep choices per computer, apply them before paint and notify both desktop webviews after saving; defaults retain platform and Omarchy fallbacks.

Verified seven focused Go tests, including real Windows discovery (90 families, 276 styles), 14 font browser cases in Chromium/WebKit, 68 settings/zoom/Omarchy/web cases, go vet, Windows amd64/arm64 and Linux nogui builds. Against the original assets, the new UI test fails with Settings must offer an interface font picker (0 != 1). Full Windows suites have separately reproduced upstream failures; macOS/Linux native discovery is covered by the added CI step.

* gui: retain bundled Mac fonts and variable style precision

Only filter an undownloaded CoreText face when it is explicitly downloadable; bundled fonts are installed without being downloaded. Use resolved font names when descriptors omit them. Preserve fractional weights and nonnegative CSS widths for named variable styles.

* gui: restore the authored font cascade when returning to defaults

Apply family-only trait overrides only while a custom face is active. The browser regression catches code under a bold parent becoming 700 instead of its original 400. Keep the compatibility shim first, and apply boot fonts before visible content.

* gui: keep font picker review separate from CI integration

Leave the native test sources and manual verification command with the feature. Move the added workflow step to a follow-up so the font picker can take the normal review path requested on PR #1007.
2026-10-06 19:32:56 +08:00
yetone 2f135ed4d5 plugin, gui, docs: Plugins says which plugins are providers and which are middleware, lists the community's ready-made middleware, and edits a middleware's options in its row (the owner) — the Plugins page still read as if every plugin were a subscription, and nothing showed what a middleware does or let you set its options without editing plugins.json. Every Discover card and Installed row now carries a Provider or Middleware chip (both for a plugin that is both), also for one that is off (isMiddleware/middlewareOnly from the server, read from its files); Discover splits into Subscriptions and Gateway middleware ("runs in magpie's gateway on what every agent sends and gets back, whichever provider serves it"), the latter from market entries with "kind": "middleware" and no providers or icon (the built-in market.json lists the five new @magpie-community/middleware-* packages: param-override, model-map, system-prompt, word-guard, think-tags, mostly New API's channel settings with the same JSON). A middleware row has Options: a JSON editor in the row, starting from the package's magpie.options example when none are set, which validates it is an object, saves (POST /api/plugins/options) for the next request, clears, and cancels with Esc. magpie plugin options takes a short name (model-map for @magpie-community/middleware-model-map; plugin.ShortName, also in SetOptions). en/zh/ja/de. Docs: usemagpie.ai/docs/plugins (en/zh/ja) gains Ready-made middleware and Options and the registry's kind; reference.md, both READMEs and docs/subsystems/gateway-middleware.md likewise. Tested with a real DeepSeek account and real Claude Code through magpie web --gateway in a sandbox HOME, with all five installed and options set by short name: a mapped model named back, max_tokens capped, a prompt appended for claude only, word-guard's 400 and param-override's 403 in the agent's shape, <think> stripped from Chat and Responses streams and a whole Anthropic reply, reasoning_content moved into the text; /api/plugins showed the kinds and the example. TestSetOptionsShortName is new; TestBuiltinMarket checks a middleware entry has no providers or icon and no other kind. plugin-middleware.test.cjs (Chromium and WebKit, en and zh: the chips, Discover's two sections, the options editor with its errors, no select, no scroll, no left border) fails without the change; the other plugin tests and click-scroll pass in WebKit (plugin-market's section name updated; plugin-move fails only under parallel load and passes alone). go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass. 2026-10-05 20:50:09 +08:00
yetone eebd0b4222 plugin, gateway, gui: a plugin can be gateway middleware — onRequest, onEvent and onResponse run in magpie's gateway on what agents send and get back (moejs) — a plugin could only be a subscription provider, run in the Bun host, a process away from the gateway. A plugin may now declare middleware (package.json magpie.middleware, or a *.middleware.js / .mjs file), run in-process by moejs (pure-Go JS engine): compiled once, one runtime per request from a pool, so every hook of a request shares ctx.state. onRequest(body, ctx) sees the agent's body in its own API before routing; what it returns is the body the next middleware and the gateway get, undefined leaves the bytes as they were, ctx.reject(status, msg) answers with an error in the agent's API's shape. onEvent(ev, ctx) sees each SSE event's JSON (export const events = [...] filters by name; an object changes it, null drops it, undefined passes the bytes through untouched; data: [DONE] is no JSON and passes by). onResponse(body, ctx) sees a whole JSON reply, with ctx.status. ctx has protocol, model, stream, path, agent, the plugin's options and state. A hook that throws, returns a non-object or runs past its limit (250ms request/response, 50ms an event, 1s load; interrupted) leaves the request or reply as it was and is counted and logged (60 lines a minute); a compressed reply passes as-is. Files are reloaded within a second of a change. Only agents' requests run through it (serveAgent at the gateway's agent entry points and the Codex backend), never magpie's own titles, classifier or stand-ins; it sees bodies before redaction. A middleware-only package is skipped by the Bun host. The Plugins page marks a middleware with a chip, its hooks, calls and µs per call (JSON in and out counted), failures in red with the last error, and a load error. en/zh/ja/de; docs/reference.md and usemagpie.ai/docs/plugins#middleware (en/zh/ja) with an alias example. Tested with a real DeepSeek account through magpie web --gateway in a sandbox HOME: an alias middleware served "fast" and named it in message_start, a reject came back as 403 permission_error, a Chat stream uppercased; real Claude Code (sandbox CLAUDE_CONFIG_DIR) did Read, Bash and Glob tool turns through three middlewares with 0 failures: ≈1–1.6µs an event, 0.2–0.7ms an onRequest that parses and rewrites Claude Code's ≈80KB body. Real use found two bugs fixed here: [DONE] parsed as JSON (SyntaxError on every Chat stream) and stats leaving out the JSON time. internal/middleware tests (chain, undefined keeps bytes, reject, fail-open on throw/spin/string with the runtime reused, async hook, load errors, off and Bun skip, reload, split/CRLF/filtered/dropped stream events, [DONE] untouched, whole reply and gzip, 64 in parallel; BenchmarkEvent ≈0.9µs, 11 allocs) and TestMiddlewareThroughGateway (alias routed, events by protocol, redaction still upstream, reject in Anthropic's shape; fails without the change) are new; plugin-middleware.test.cjs (Chromium and WebKit, en and zh: chip, hooks and stats, failures with last error, broken and off, no left border) fails without it. The other plugin GUI tests and click-scroll pass in WebKit. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (internal/provider failed once under load and passes alone). 2026-10-05 19:14:31 +08:00
yetone a345af91e5 gui: a plugin card's Update chip updates the plugin (莫 on Discord: 显示更新但是好像没有更新按钮) — on Plugins › Discover a card whose plugin has a newer version showed an "Update" chip that looked like a button and did nothing (a click opened the plugin's page); the Update button was only on the Installed tab. The chip is now that button: it names the version ("Update to v0.0.9" / "更新到 v0.0.9"), updates the plugin without opening its page, shows Updating… meanwhile and goes once it is current, and is disabled while another plugin action runs or the plugin is off. plugin-card-update.test.cjs (en, zh) fails on the old code (no button) and passes; plugin-updates, plugin-market and plugin-check-updates still pass (WebKit). 2026-10-03 18:04:41 +08:00
yetone 860ed6618d plugins: a 「国内镜像」 switch on the Plugins page downloads the list, plugins and Bun from mirrors in China first (Discord, akic404: GitHub/npm are slow from the mainland; asked for ghproxy) — Plugins › Mirrors in China, off by default, kept in settings (chinaMirror). On, source asks a copy of the very file before its official address: npm's registry (packages, versions, search) at registry.npmmirror.com, Bun's release zips at registry.npmmirror.com/-/binary/bun, and the community registry.json at cdn.jsdelivr.net/gh/magpie-community/plugins@<branch>; bun add gets BUN_CONFIG_REGISTRY=npmmirror unless the environment names a registry. No proxy: gh-proxy (MAGPIE_MIRRORS' GitHub fallback) handles nothing the switch sends, since a proxy could hand back other code. A mirror asked first that can't answer (404/403/5xx, e.g. a version it hasn't synced) falls through to the official address; npm's weekly downloads stay api.npmjs.org's (npmmirror counts its own). Checked by hand: npmmirror's bun-v1.4.2 darwin-aarch64 zip has the SHA-256 pinned in bun.go, jsDelivr's registry.json is byte-identical to raw.githubusercontent's, and bun 1.4.2 add through npmmirror locks the same sha512 integrity npmjs gives. TestChinaFirst, TestChinaComesFirst, TestChinaMirrorAnswers, TestChinaMirrorsMissIsAskedOfficially, TestDoFaithful, TestBunInstallsFromChinaMirror and TestPluginsMirrorSwitch cover it. A live run with the switch on fetched the list from jsDelivr, npm info from npmmirror and Bun from npmmirror (checksum passed); a sandbox magpie web showed the switch in the Plugins head, saved it, kept it after a reload, and a click didn't move the page. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried from inside mainland China. 2026-10-03 15:14:45 +08:00
yetone 94bb3e2ca6 plugins: Check for updates asks npm now for each installed plugin's newest version, and each row says what it found (the owner: 插件的检查更新按钮还是得做) — the community's plugins update by themselves a little after magpie starts and every 6 hours, and the page knew of anyone else's new version only from what npm said within the hour (Info's cache), so a reader who heard a plugin had a new version had no way to have magpie look. The foot of Installed (beside Update all) now has Check for updates, shown when a plugin is npm's (a folder's or a git one's has no versions there; a git one keeps its own Update, which fetches it again): it says Checking… with a spinner while POST /api/plugins/check asks npm, a few at a time, past the hour's cache (plugin.CheckNow, through npmAsk, which is npmInfo telling why npm said nothing), and nothing is installed. Each row then says it: "v0.0.9 out" titled "v0.0.7 installed, v0.0.9 on npm" with its Update (the existing upgrade path, Upgrade → Add), "Up to date", or an amber "Couldn't check" chip with a dot, titled why — npm not reached (check your connection or proxy), npm turning requests away (429, try again in a few minutes), npm answering with an error, or npm not having the package (fetchJSON's answers other than 200/404 are now a statusError, so a 429 is told apart). The status line says how many have updates, or that every plugin is up to date, and how many couldn't be checked and why; npm not reached at all is "Couldn't check for updates: npm couldn't be reached — check your connection or proxy". A community plugin's Update is titled that magpie would update it by itself within a few hours and Update does it now. What npm said is kept as Info keeps it, so the rows and the market read it, and an update found for the reader (someone else's, or pinned) waits as the background look's do, putting the dot on Plugins; one npm didn't answer for keeps what waited before. Every new string has its Chinese; the click never scrolls the page. TestCheckNow (an httptest npm registry: the community's and someone else's updates found past an hour-old cache saying otherwise, up to date, 404 missing, 429 limited, 500 registry, git and folder not asked, nothing installed, the cache and the waiting list updated) and TestCheckNowOffline (npm not reached: offline, what waited still waits) are new, as is TestPluginsCheckRoute; plugin-check-updates.test.cjs (WebKit and Chromium, en and zh: Checking… while npm is asked, the rows' out / up to date / couldn't check chips and titles, the status line, Update after the check, offline said plainly, the view's scroll unmoved) fails without the change and passes with it. plugin-updates, plugin-market, plugin-progressive, plugin-git, plugin-local and click-scroll pass in WebKit and Chromium. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-02 21:58:22 +08:00
yetone ec10d3bd98 gui: the header tabs lose their grey track, a Plugins card's move is one word beside the name, and an agent row's grip shows only under the pointer (the user: 这个 tab 栏的背景灰色条有点丑 · 这里的紫色按钮也有点丑,而且还有的变成了两行 · 排序 icon 只在 hover 到这个条目的时候显示,logo hover 的排序 icon 可以删掉)
The header's .seg drew a grey track behind its tabs; now only the open tab's white thumb marks it (the account-mode .am-seg keeps its own). A Plugins card offering a built-in's accounts had a solid purple bar of its own at the card's foot, "Move my 2 Command Code Plan accounts", which broke onto two lines; it is now the tinted pill beside the name that Install is, reading "Move" / "迁移", its title saying whose accounts and how many and what moving does. In the Agents list the grip in a row's left margin (#479) was drawn on every row all the time, and hovering the logo turned it into a second grip; the margin grip now shows only for the row under the pointer, the one being dragged, or a handle with its menu open or the keyboard on it (kept in a rule of its own, for Safari 15), and the logo stays the logo. Dragging or clicking the grip still does what the logo does.

agent-grip now checks no grip is drawn with the pointer away, the hovered row's alone is, and the logo has no grip of its own; plugin-move-overflow checks the move button sits in the card's top row on one line. agent-grip, account-arrange, agent-layout, the agent-models tests, brand, header-centre, header-zoom-fit, phone-web, strip-scrollbar, old-webkit and the plugin tests pass in Chromium and WebKit, except plugin-move's known Chromium flake and click-scroll, which fail the same way on unchanged main on this loaded machine. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build and go test -tags nogui ./internal/gui/... pass.
2026-10-02 10:31:43 +08:00
yetone 03ab46dda3 library, plugins: the installed lists are sorted as the reader picks, and remember it (#481: the installed MCP servers, skills and plugins had no order the user could choose; the plugins came in the order they were installed) — the Library's MCP servers and the installed plugins now have A→Z and Z→A beside their list, A→Z until one is picked, so the plugins are no longer in the order they were installed in; the Library's skills have By source (the groups by repository and their parts, as before, and still the default), A→Z and Z→A, the last two one flat list of every skill by name, the filter still finding a skill by its repository. Each list keeps its own pick in the browser's storage (magpie.sort.<list>, read and written in try/catch), and a pick redraws only its list, the control left where it was on the screen. The skills' heading, the fullest, goes on to a second line in a narrow window rather than past the page's side. Sorting by use or by when a thing was installed waits for the library to keep those. list-sort (Chromium, WebKit; en, zh) fails without the change; library-items, library-all, own-skill, every-skill, the plugin tests, click-scroll and old-webkit pass; go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-10-02 06:33:46 +08:00
yetone 289de06b1f providers: the way to more subscriptions in Plugins is in the add sheet alone (the user: 这个不应该在这个页面,应该在第二个页面的这里) — the providers list's "More subscriptions in Plugins" button beside Add provider is gone; the add sheet's Subscriptions ends with its "More in Plugins" row, as before. plugin-market passes (Chromium, WebKit, en/zh); click-scroll, old-webkit, providers-off-fold pass. 2026-10-01 19:07:28 +08:00
volcanic fc248e381f plugins: the folder a plugin lives in is picked, not typed, and its page reads that folder's README (#411)
Settings → Plugins adds a plugin by npm package name or by a path, and the
path had to be typed in full: the market's field was the only way in, with
nothing to pick the folder from. And a plugin added from a folder had no page
of its own — its README comes from plugin.Readme, which answers only for an
npm package name ("%q isn't an npm package name"), so opening one said "npm
didn't answer" and offered an npm link for a folder that npm has never heard
of.

The field now has the system's folder picker beside it, and a folder plugin's
page shows the README that folder carries.

- POST /api/plugins/choose asks Windows.ChooseFolder, which the app answers
  with the system's panel — the Library's "Choose a project" already used it,
  and a page served by another magpie forwards it to the magpie it is served
  by. pluginsState carries "picker" beside "bun", false for `magpie web`: a
  browser has no such panel (webHost.ChooseFolder refuses it), and the page is
  then left with the field to type into, as before.
- plugin.Readme takes a path: folderReadme reads README.md whatever its case,
  else a markdown or a text one named beside it, and says so when the folder
  has none rather than answering with npm's silence. Updated is that file's
  mtime, and the text is capped at 200 KB as npm's answer is.
- A folder plugin's page drops what only npm can say: no npm link, no version,
  downloads or license, and a failure names the folder rather than npm. Its
  row and its title name the folder it was added from (opencode-mine, not
  /Users/me/plugins/opencode-mine).

TestReadmeFromFolder (internal/plugin) fails without the change: with a
README.txt and an unsuffixed README beside it, the README.md is still the one
read; ReadMe.MD is too, and through file:// and a trailing .; a folder with
none is an error, as is one that isn't there.
TestPluginsPickerWhereItCan (internal/gui) fails without the change: the
picker is offered for the app, not for `magpie web` nor for no host at all.
plugin-local.test.cjs (new; Chromium and WebKit, en and zh) fails without the
change: the picker is beside the field and titled as such, a click asks for it
and what it answers is what the field holds and takes the focus, what the
field holds is what Install posts, the Installed row names the folder rather
than its path, its page renders that folder's README with no npm link, and a
market that offers no picker draws no button (english and Chinese).

Not only the faked page: a sandbox `magpie web` in a HOME of its own, with a
plugin added by path, read that folder's README.md — its mtime as Updated —
and listed it by the folder's name.

go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows
go build, go test -tags nogui ./internal/gui/ pass; plugin-market,
plugin-signin and plugin-local pass in Chromium and WebKit, en and zh.
TestPluginProxy (internal/plugin) and the hermes tests (internal/agent,
internal/profile) fail on main on this machine too — its own proxy and a
hermes install it finds — and are unrelated.

Not done: the panel itself hasn't been clicked in the app. It is the system's
own, and the call under it is the one the Library's folder chooser already
uses, but the screenshots here are the page with a faked backend underneath
(the app's own picker is offered, `magpie web` has none), plus the real
`magpie web` for the README.
2026-10-01 18:46:56 +08:00
GinWU db0a3344f4 gui: a Plugins card's move button has a row of its own and says how many accounts it moves — on the Plugins tab, a card that offers a built-in's accounts put "Move my {name} accounts ({n})" in its top row beside the plugin's name; the button doesn't shrink (.pm-act is flex: none, nowrap), so in a two- or three-column window "Move my Grok (SuperGrok) accounts (1)" ran past the card's right edge, and Kiro's shorter one squeezed its name to "K…" and cut "magpie community". The move button (and its "Moving…") now has a row of its own at the card's foot, full width, wrapping if it must; Install, Sign in and the rest stay in the top row. Its words say what the number is: "Move my 1 Grok (SuperGrok) account", "Move my 2 Zed accounts", 「迁移我的 1 个 Grok (SuperGrok) 账号」. plugin-move-overflow.test.cjs (Chromium, WebKit, en/zh, 920/600/480px with the column count checked) fails without the change at 920 and 600px; plugin-move, plugin-market, market-have, old-webkit, plugin-moved-signin, plugin-release, plugin-signin pass (plugin-market's "typing keeps the field" fails now and then on main here too). Go not run: only CSS, JS and strings changed. (#398) 2026-10-01 14:56:25 +08:00
yetone 2ca1373db5 plugins: removing or switching off the plugin a built-in is moved onto moves the built-in back first (插件版…保持一模一样) — the provider went with the plugin, its accounts out of sight in plugin-auth.json; now its accounts go back to the built-in, then the plugin is removed or switched off, in the app and with magpie plugin rm|off. Installed marks such a plugin ("Serves Zed", a dot, no stripe) and asks in its row, not a dialog, naming what goes back; only a yes sends it. TestReleasePlugin and plugin-release.test.cjs (Chromium, WebKit, en/zh) fail without the change; plugin-market, click-scroll, old-webkit pass. 2026-10-01 04:04:23 +08:00
yetone 8a4283256d gui: a plugin's README reads as it does on GitHub (这里的Markdown你没有渲染) — a link inside bold (**Curated by [Numman Ali](…)**) was shown as its source, and a badge, a picture in a link ([![npm version](…)](…)), as ![npm version](…) text; bold and italics now hold links and code, a badge goes whole, a link written as HTML (<a href>) is a link, and a link to one of the README's headings ([Install](#-quick-start), GitHub's anchors) goes to it in the page instead of nowhere. The publisher line under the name ends in an ellipsis rather than cut, and a box drawn in │ and ─ joins up. plugin-market.test.cjs (Chromium, WebKit, en/zh) fails without the change; old-webkit, click-scroll pass. go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test ./internal/gui ./internal/plugin pass. 2026-09-30 19:07:34 +08:00
yetone 9ec237d4e6 gui: a Plugins tab, a market to find and install provider plugins in (在产品里要有插件市场功能,整个插件市场要美观易用), and a way to it from the providers list (供应商列表里有个精致优雅的按钮) — Discover lists the magpie community's plugins, then OpenCode's community's by weekly downloads, each card with its logo, publisher, summary, downloads, version and one button that takes it all the way: Install (Bun fetched first if need be), Sign in, Signed in; a package not on npm yet says Coming soon. Typing searches the list and, after a pause, npm, with the field keeping its focus. A card opens the plugin's page: version, downloads, licence, updated, what it signs in to, npm/source/homepage links, and its README (no images, HTML or scripts; only http(s) links, opened outside). Installed lists each plugin with its providers' sign-ins, a newer version to update to, Update all, switch off and remove; Settings' Plugins section moves here. The list comes from registry.json in magpie-community/plugins, kept for 6 hours, falling back to the copy fetched last and then the one built in (MAGPIE_PLUGIN_MARKET overrides, "off" never asks). Under Add provider a "More subscriptions in Plugins" pill opens it; the add sheet ends in a Plugins tile, and a search that finds nothing offers to look for a plugin. The header, seven tabs now, draws them in at the narrowest window. plugin-market.test.cjs (Chromium, WebKit, en/zh) and market_test.go fail without the change; add-button, plugin-signin, usage-ledger, text-size, old-webkit, click-scroll pass. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-09-30 17:57:46 +08:00