1ccacad63281094de8a3372d5a507d38f9969e5c
36
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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 |
||
|
|
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). |
||
|
|
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 |
||
|
|
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 |
||
|
|
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 |
||
|
|
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
|
||
|
|
93b31f5b79 |
plugins: Discover's install box floats at the foot of the list (0x3108 on X)
With many plugins, Discover's "Have one in mind?" box (install by name) was found only after scrolling to the very end. It now sticks to the bottom of the view while the cards scroll under it, on a strip of the page's own background (no shadow, no gradient), with the same dashed box. At the end of the list it sits in its place, above the npm registry line, and every card is above it. Its place in the DOM is unchanged. The strip blocks clicks so they can't reach a card hidden under it. Because a sticky box paints its ::before over its own border, the dashed border is now drawn by ::after. A scroll-padding-bottom keeps a card reached with Tab from stopping under the box. CSS only (plugins.css), so no script budget moves. Main's existing core budget red is #4526. Siblings: Discover is the only page that renders this box (manual() in plugins.js). Library's skills install card is already at the top of its page. Run: - New test, internal/gui/tests/plugin-manual-float.test.cjs: 40 cards, en/zh/zh-TW/ja/de, 390x780, 560x800, 980x820 and 1280x800. The box is in the view at the foot at the top and mid-way (wheel scrolling), with no card showing above or below it. At the end, the last card is above the box and the registry line is below it. Tab from the cards never stops under the box. The search field takes keys and Escape brings the box back. Chromium on mote: 6/6 pass, 3 runs. WebKit through wsl-run (Linux): 6/6 pass. With plugins.css at origin/main, both engines are red: "390x780 at the top: the box is in the view" (the box sits at ~6100 in a 780 view). - The 63 GUI files the change can reach (plugin*, plugins-more-discover, signin-paste-plugin, account-plugin-user, agent-plugin-agents, i18n-keys, click-scroll), run at --test-concurrency=4: - WebKit (wsl-run): 9 reds in 5 files. Rerun serially, they are the same 9 at base |
||
|
|
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
|
||
|
|
ed5cc959a7 |
gui: every slow page's skeletons get magpie's bird hopping bar to bar
The owner, after the Plugins page's README bird ( |
||
|
|
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 |
||
|
|
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
|
||
|
|
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
|
||
|
|
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 |
||
|
|
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
|
||
|
|
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> |
||
|
|
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.
|
||
|
|
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.
|
||
|
|
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.
|
||
|
|
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.
|
||
|
|
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
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. | ||
|
|
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). | ||
|
|
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). | ||
|
|
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. | ||
|
|
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. | ||
|
|
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. |
||
|
|
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. | ||
|
|
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. | ||
|
|
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.
|
||
|
|
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) | ||
|
|
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. | ||
|
|
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 ([](…)), as  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. | ||
|
|
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. |