d3fc6f2bfada18e6ae7887b79ed1e4c650ca37e1
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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
|
||
|
|
2f65a33aaf |
library: a tools plugin is a Library server of its own, in the MCP hub (Search1API)
chenxiang0010 (Discord #general) asked for a tools plugin's tools, Search1API's (@magpie-community/tools-search1api), to be in magpie's aggregated MCP server. Until now plugin tools were served only at /mcp/magpie/tools, wired by hand; the hub listed Library servers only. Now each plugin that is on and gives tools becomes a Library server once the plugin host has noted its tools (plugin-tools.json, new plugin.ToolsNoted): - named by the plugin's short name (search1api, search1api-plugin beside a user's server of that name), `plugin` set, `local`, its URL the new /mcp/magpie/tools/<short> (gateway ToolsMCPOne), which serves that plugin's tools alone by their own names; - added with the hub on, it is on for the agents given the hub's entry, so their hub lists search1api__search etc. at once; with the hub off it is on for none until switched on. Per agent and per tool it is switched like any server; - the hub lists and runs its tools in process (gateway.PluginToolsOf, RunPluginToolOf, under the Plugin tools gate); with the hub off an agent is given the per-plugin URL at the address it reaches the gateway (through), with a key from another machine; - offered once (pluginsOffered): removed by the user, it comes back only when the plugin is removed and added again. The plugin removed takes the server out; turned off it stays and lists nothing; an unreadable plugins.json changes nothing (plugin.ReadList). Edited in the Library's editor, which doesn't send `plugin`, it stays the plugin's. Docs: docs/subsystems/plugin-tools.md, mcp-hub.md, site docs plugins (en, zh, ja). Run (mote; full suite at this change on origin/main |