Adds MiniMax Design (packages/minimax-design, @magpie-community/agent-minimax-design 0.1.0) as a magpie agent. Its one switch writes a single custom-model entry, `config.customModels.user-custom-magpie`, into Design's `%APPDATA%\@hilo\desktop\hub-config.json`. The entry points at magpie's local /v1 with the gateway key and magpie's model list. Reasoning levels are filtered to the ones Design knows (low to max). Disconnecting removes the whole entry and leaves the user's other custom models alone. The agent is Windows only: its paths lean on $APPDATA and $LOCALAPPDATA, so it is never detected on macOS or Linux, and the agent's notice says so. Also in this change: - a README Agents row; - a registry entry; - COMPATIBILITY.md. Verified by the author with real use: Windows 11, MiniMax Design 3.0.17, magpie 0.1.3238. Connect writes the entry, Design's model menu shows Magpie, and requests reach the gateway, attributed to minimax-design. Disconnect removes only the entry, and its preview lists it (magpie 0d70f335e, v0.1.3200). Run at the reviewed head 8e09f13c on a separate macOS machine, with a throwaway HOME (Bun 1.4.2): - bun test packages/minimax-design: 7 pass, 0 fail. - bun scripts/check.mjs minimax-design: ok. - Repo-wide bun test: 6791 pass, 20 skip, 1 fail. The one failure is gcp-ai's ADC consent test (plugin.test.mjs:422), red only under a concurrent full suite. It is green 6 of 6 alone, and the package isn't touched here. Not tried: a real Design install on the reviewer's side, and macOS/Linux (unsupported).
69 lines
2.5 KiB
JavaScript
69 lines
2.5 KiB
JavaScript
import { expect, test } from "bun:test"
|
|
import { agent, connect } from "./minimax-design.agent.js"
|
|
|
|
const gateway = { url: "http://127.0.0.1:3425", v1: "http://127.0.0.1:3425/v1", key: "magpie-minimax-design" }
|
|
|
|
test("says where Design keeps its custom models, and that it is Windows only", () => {
|
|
expect(agent).toMatchObject({
|
|
id: "minimax-design",
|
|
config: "$APPDATA/@hilo/desktop/hub-config.json",
|
|
format: "json",
|
|
})
|
|
expect(agent.model).toBeUndefined()
|
|
expect(agent.notice).toContain("Windows only")
|
|
})
|
|
|
|
test("shows Design's own icon, as the package gives it", async () => {
|
|
const pkg = await Bun.file(new URL("./package.json", import.meta.url)).json()
|
|
expect(agent.icon).toBe("https://design.minimax.io/favicon.ico")
|
|
expect(pkg.magpie.icon).toBe(agent.icon)
|
|
})
|
|
|
|
test("writes the entry as one key holding the whole object", () => {
|
|
const out = connect({ gateway, models: [] })
|
|
expect(Object.keys(out)).toEqual(["config.customModels.user-custom-magpie"])
|
|
expect(out["config.customModels.user-custom-magpie"]).toEqual({
|
|
protocol: "openai-compatible",
|
|
providerName: "Magpie",
|
|
baseUrl: "http://127.0.0.1:3425/v1",
|
|
apiKey: "magpie-minimax-design",
|
|
models: [],
|
|
})
|
|
})
|
|
|
|
test("maps magpie's model fields onto Design's", () => {
|
|
const out = connect({
|
|
gateway,
|
|
models: [{ id: "workbuddy/deepseek-v4.1-flash", context: 1000000, output: 128000, efforts: ["low", "high", "max"] }],
|
|
})
|
|
expect(out["config.customModels.user-custom-magpie"].models).toEqual([
|
|
{ id: "workbuddy/deepseek-v4.1-flash", contextWindow: 1000000, maxOutputTokens: 128000, reasoningLevels: ["low", "high", "max"] },
|
|
])
|
|
})
|
|
|
|
test("drops reasoning levels Design doesn't know, and omits the field when nothing is left", () => {
|
|
const out = connect({
|
|
gateway,
|
|
models: [
|
|
{ id: "a", efforts: ["none", "minimal", "xhigh"] },
|
|
{ id: "b", efforts: ["none"] },
|
|
],
|
|
})
|
|
const models = out["config.customModels.user-custom-magpie"].models
|
|
expect(models[0]).toEqual({ id: "a", reasoningLevels: ["xhigh"] })
|
|
expect(models[1]).toEqual({ id: "b" })
|
|
})
|
|
|
|
test("drops models without an id, and null or missing model entries", () => {
|
|
const out = connect({
|
|
gateway,
|
|
models: [null, {}, { id: "" }, { id: "kept" }, undefined],
|
|
})
|
|
expect(out["config.customModels.user-custom-magpie"].models).toEqual([{ id: "kept" }])
|
|
})
|
|
|
|
test("models: undefined gives an entry with an empty list", () => {
|
|
const out = connect({ gateway, models: undefined })
|
|
expect(out["config.customModels.user-custom-magpie"].models).toEqual([])
|
|
})
|