ferocknew asked for a way to give new chats every MCP server without ticking each one. The MCP list in the settings sidebar now starts with a switch, "使用 magpie 的全部 MCP 服务器". On, a chat uses every server in library.json, read again on each chat, so a server added to magpie later is in too; the rows show checked and disabled. Off (the default, and what a 0.1.5 settings.json reads as), ticking works as before, and the ticks set before turning it on come back. The whole path: the setting is mcpAll in the service's settings (cleanSettings keeps it, default false). runChat wants tools when mcpAll is on even with nothing ticked, and pickServers() picks every Library server; "检查连接" (/api/mcp/tools) checks the same set. The page sends useTools when mcpAll is on. The service picks servers from the saved settings, while the page saves them 320ms after a change, so send() now saves pending settings before /api/chat; a switch flipped just before sending (or a server just ticked) counts. Run (mote, bun 1.4.2, HOME a temp dir): bun test chat.test.mjs, 28 pass; bun scripts/check.mjs chat ok. Three new tests: a chat against two fake Streamable-HTTP MCP servers gets only the ticked one with the switch off, both with it on and nothing ticked, a third added to library.json after turning it on, and /api/mcp/tools lists all three; a 0.1.5 settings.json reads as off; the page's wantsTools and the save-before-send. Broken by hand: pickServers ignoring mcpAll fails the first two tests; cleanSettings dropping mcpAll fails the same two; useTools back to "mcp ticked" fails the third. Real page, Playwright 1.62.0, 1200 and 760 wide: switch off by default with the old tick, on makes every row checked and disabled, flipping it and pressing Enter saves settings before /api/chat with useTools true, still on after reload, off brings back the old tick, rows clickable. Chromium on mote, 18 of 18; WebKit on Linux (WSL magpie-desktop), 18 of 18, since WebKit on mote didn't launch within 180s (other sessions' WebKit processes were running there). Not tried: a real magpie window with real MCP servers and a real model call (the gateway in the browser run was absent; tool lists came from fakes); stdio servers under the switch (same pick, only http was run); macOS WebKit; languages other than Chinese (the page has no i18n).
69 lines
2.1 KiB
JSON
69 lines
2.1 KiB
JSON
{
|
|
"name": "@magpie-community/page-chat",
|
|
"version": "0.1.6",
|
|
"description": "在 magpie 窗口里加一个「对话」页面:用 magpie 自己的模型、MCP 服务器、指令和技能聊天,支持图片与 LaTeX。A chat page inside magpie's window: talk with magpie's own models, MCP servers, instructions and skills, with images and LaTeX.",
|
|
"author": "Magic_zero (https://github.com/Magiczerowxy)",
|
|
"files": [
|
|
"index.mjs",
|
|
"lib",
|
|
"chat",
|
|
"page",
|
|
"assets",
|
|
"serve.mjs",
|
|
"start-server.cmd",
|
|
"start-server.vbs",
|
|
"install-autostart.cmd",
|
|
"install-autostart.ps1",
|
|
"README.md",
|
|
"SERVE.md",
|
|
"LICENSE"
|
|
],
|
|
"keywords": [
|
|
"magpie",
|
|
"magpie-page",
|
|
"magpie-plugin",
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"chat",
|
|
"llm"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/chat"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/magpie-community/plugins/issues"
|
|
},
|
|
"homepage": "https://github.com/Magiczerowxy/magpie-chat#readme",
|
|
"engines": {
|
|
"magpie": ">=0.1.1340"
|
|
},
|
|
"magpie": {
|
|
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4IiB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+CiAgPHJlY3Qgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHJ4PSIyOCIgZmlsbD0iIzRmNDZlNSIvPgogIDxwYXRoIGQ9Ik0zMCAzOGg2OGE4IDggMCAwIDEgOCA4djM0YTggOCAwIDAgMS04IDhINjBsLTE2IDE0di0xNGgtMTRhOCA4IDAgMCAxLTgtOFY0NmE4IDggMCAwIDEgOC04eiIgZmlsbD0iI2ZmZiIvPgogIDxnIGZpbGw9IiM0ZjQ2ZTUiPgogICAgPGNpcmNsZSBjeD0iNDYiIGN5PSI1OCIgcj0iNSIvPgogICAgPGNpcmNsZSBjeD0iNjQiIGN5PSI1OCIgcj0iNSIvPgogICAgPGNpcmNsZSBjeD0iODIiIGN5PSI1OCIgcj0iNSIvPgogIDwvZz4KPC9zdmc+Cg==",
|
|
"page": {
|
|
"title": "Chat",
|
|
"titles": {
|
|
"zh": "对话",
|
|
"zh-TW": "對話",
|
|
"ja": "チャット"
|
|
},
|
|
"file": "page/index.html",
|
|
"icon": "assets/icon.svg",
|
|
"service": {
|
|
"port": 3477,
|
|
"option": "port"
|
|
}
|
|
},
|
|
"options": {
|
|
"port": 3477
|
|
}
|
|
},
|
|
"scripts": {
|
|
"start": "node serve.mjs"
|
|
},
|
|
"main": "./index.mjs",
|
|
"type": "module"
|
|
}
|