@magpie-community/tools-calc served its tools as tools-calc_eval and its
page under "tools-calc" because ShortName only dropped middleware- and
opencode-. It now drops tools-, page- and agent- too, so the calc example
serves calc_eval/calc_convert/calc_date as its README and the docs say.
`magpie plugin options` / SetOptions find a plugin by its short name or by
its bare package name (plugin.Called), so "agent-aider" keeps working
beside "aider".
Run at 1a16fc0b5:
- go test ./internal/plugin ./internal/cli ./internal/middleware, and
gateway -run 'Tool|MCP', gui -run Page: ok.
- Broken by hand: ShortName without the new prefixes -> the new
TestShortName cases red; Called without bareName -> the
SetOptions("agent-aider") case red. Both green after restoring.
- Sandbox HOME: magpie plugin add @magpie-community/tools-calc listed
tools calc_convert, calc_date, calc_eval.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: 0.
- go test -timeout 45m ./... : ok (load ~130).
ShortName cut a plugin's name at its last "/". A plugin added from a
folder is named by its path, and on Windows that path has only
backslashes, so its short name was the whole path: `magpie plugin off
zz-tags` said there was no plugin "zz-tags", and so did on, rm, options
and plugin.SetOptions. It now cuts at the last "/" or "\". npm names
have no backslash, so they are unchanged.
TestPluginOnOffRmShortName was one of the 26 Windows failures listed in
#1827 (CaramelizedCUDA). TestSetOptionsShortName now also checks a
Windows path, so the case fails on every OS without the fix.
Run:
- without the fix, macOS: TestSetOptionsShortName fails, ShortName
("C:\\Users\\me\\plugins\\middleware-zz-tags") = the whole path, want
"zz-tags"; with it, passes.
- Windows 11 box (windows/amd64 test binaries, sandbox USERPROFILE and
APPDATA): at 9dd5917a4 TestPluginOnOffRmShortName fails "off by short
name: err no plugin \"zz-tags\""; with the fix it and
TestSetOptionsShortName pass.
- macOS: go test -tags nogui ./internal/cli ./internal/plugin ok; gofmt
clean; go vet on both packages for darwin, linux (nogui), windows.