// Plugin gate: runs inside Magpie's Bun plugin host process and listens on 127.0.0.1: (default 3488). // // Two independent secrets: // - gate key (key): written to page/session.js; the plugin page uses it to open the gate. // - daemon token (token): unlocks the daemon's API / WebSocket; it only appears in the # fragment of the gate's 302 // and is never written to any static file. // // Why separate them: Magpie serves the page directory at /_magpie/plugin// without checking Origin, // Host, Sec-Fetch-* or cookies; the only protection is that the path can't be guessed. session.js is a script, and any page that knows the path // can include it with