Chat (page-chat 0.1.8 -> 0.1.9) can send an EPUB's text with a message. The book is read in the page (chat/epub-reader.js: its own ZIP reader with size, CRC and encryption checks, DecompressionStream inflate, chapters parsed inert in spine order, no external resource loaded, no script run), never uploaded. Each request to the gateway inlines the text once in the user message that carried it, between 【电子书:name】 and 【电子书结束】; the same book again is a note, a failed read is a note and a toast. Send waits while a book is read, and switching chats drops a book still being read. Image-only user messages now stay in history. Run at 1cb1ecb400fe31bbc1f58463af09af757374d27e: - CI (pr.yml, ubuntu): HOME=$(mktemp -d) bun test and bun scripts/check.mjs green; the spawned-Chrome reader test ran and passed there (10.5s). - mote: packages/chat bun test 34 pass; the reader test's own Chrome spawn gets no page load over ssh on macOS (and in WSL), so its fixtures were run again through Playwright 1.62 Chromium and WebKit: 2 pass, 21 expects, each engine. - End to end on mote, Chromium and WebKit, 420px: startServer with a sandbox config and HOME, a fake gateway, the real page; attached Project Gutenberg's Alice (132,120 chars) and 紅樓夢 (876,576 chars) EPUBs, sent, then followed up. Each gateway request carried the book once, before the question, with no base64 or EPUB data; the follow-up carried user,assistant,user with the book once. The page made no request outside its own service. Not changed: the MCP tool pick still scores the last message, which on a book's first message is the whole book (filed as #623).
69 lines
2.1 KiB
JSON
69 lines
2.1 KiB
JSON
{
|
|
"name": "@magpie-community/page-chat",
|
|
"version": "0.1.9",
|
|
"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"
|
|
}
|