Files
Klarkxy 95f37f46fa minimax 0.2.0: MiniMax web search and Matrix media tools (#671)
Adds MiniMax Code's account tools to the minimax plugin, as a Magpie-only `exports["./server"]` entry (magpie.mjs):
- `web_search`, MiniMax's own search, at /mavis/api/v1/mcp/web_search;
- the Matrix connector tools: image, video, speech, music, media understanding, image search and enhancement, and asset URLs, plus `list_tools`, `tool_schema` and `call_tool` limited to connector__matrix__*. The schemas are bundled in matrix-tools.json, and each call is routed through the account's live catalog.
- Tool requests reuse the chat sign-in's refresh logic per stored account key, and go through siteFetch: a cross-host redirect (Akamai's 307 to the other site) is an OtherSite hint and spends no refresh (#666).
- With no `account` named, a tool uses the site's first stored account. An explicitly named account never falls back to another one.
- No `web_fetch`: magpie's search MCP already serves one that refuses private addresses.
- Tool descriptions don't name magpie (tested).
- Version 0.2.0. The OpenCode entries still export only the two chat plugins.

Run at the reviewed head e776afc, on mote (macOS, sandbox HOME):
- `bun test` in packages/minimax: 123 pass, 0 fail, 12 files.
- `bun scripts/check.mjs`: ok (minimax ✓).
- Broken by hand: with `send` back on plain fetch, "tool redirects to another host stop before a 401 or token rotation" goes red (1 fail), and green again when restored.
- The first review's probe (307 to another host, 401 there) spent 3 refreshes over 3 calls at 2467992. The new test covers the same case: 0 refreshes and 0 requests reaching the other host.
- Checked against magpie's plugin host (internal/plugin/host.js): ./server is tried first, `directory` is magpie's config dir, and auth.set with a `minimax-code#…` id writes that key.

Not tried: a real MiniMax account (search, generation, billing), and a real mainland-China network against the Global site.
2026-11-03 19:43:11 +08:00

4 lines
246 B
JavaScript

// Magpie selects exports["./server"]. Its MCP tools use Magpie's account
// store; the OpenCode entry points expose the two chat providers.
export { MiniMaxCodeAuthPlugin, MiniMaxCodeGlobalAuthPlugin, MiniMaxCodeToolsPlugin } from "./index.mjs"