The MCP server gains a second session, --browser: the game in the player's tab, reached through the agent relay npm run dev hosts at /agent (loopback unless --host; Host and Origin checked, no token). The player turns it on in Settings → Agent API, a section only the development page has, and picks the clock: a pace of 30 s to 5 min a day that nobody can pause, or the agent's own. Headless gets the running clock too (--clock realtime --pace MS) and both get a wait tool. All of it lives in src/agent/ (development page only). The game offers HOOKS, UI.clockLocked, setSpeed() and runClock(dt), the frame's day block moved out unchanged, and nothing more: the page players get grows by under 1 KB gzipped and runs exactly as before.
4 lines
229 B
JavaScript
4 lines
229 B
JavaScript
/* ================= AGENT API: start =================
|
|
Last, once every file of the facade has loaded: agent mode wires itself in (75-mode.js). Everything before this only
|
|
defines tables and functions. */
|
|
apiAgentStart();
|