Files
plugins/scripts
yetoneandMagiczerowxy 526c7853c3 page-chat 0.1.0: Magic_zero's chat page, with tests, a registry entry and check.mjs for a page's host part
Lists Magic_zero's (Magiczerowxy) magpie-chat as @magpie-community/page-chat:
a chat page in magpie's window over magpie's own gateway, models, MCP
servers, instructions and skills. Not a provider or a relay: it signs in
to nothing and every request goes through magpie's gateway.

- chat.test.mjs starts the service on a free port against a fake
  gateway in a temp config folder: no token (Origin null and none), a
  wrong token, another Origin and a rebound Host are refused and nothing
  reaches the gateway; with the token a chat streams with the caller key;
  the icon redirect has a Location; boot.js makes no request; app.js
  sends the token.
- scripts/check.mjs takes the OpenCode v1 default export {id, server}
  as magpie's host does, and doesn't start a page's server (it would bind
  a port and write config); layerfs's tools are still checked.
- package.json declares the port option (3477) both parts read; boot.js's
  comment says so instead of a fallback to 3478 that never existed.
- README in the repo's style with credit, what the service reads and
  sends, who can use it, and the changes from the original.
- registry.json entry and a row in the Pages table.

Run on mote (bun 1.4.2) at this tree:
- cd packages/chat && HOME=$(mktemp -d) bun test: 11 pass.
- HOME=$(mktemp -d) bun test (whole repo): 3119 pass, 0 fail, 3127
  tests across 261 files; bun scripts/check.mjs: exit 0, chat and
  layerfs ok.
Broken by hand: with the token check off, "a page without the token
can't chat" went red; with the Host check off, "a DNS-rebound Host is
refused" went red.
Not tried: the page in a real magpie window (sandboxed frame navigation
and the host calling server()).

Co-authored-by: Magiczerowxy <magiczerowxy@users.noreply.github.com>
2026-10-29 09:07:44 +08:00
..