Commit graph

4 commits

Author SHA1 Message Date
Frederic Jung
dd6e4f4f8a
Fix CodeQL code-scanning alerts
- Values pasted into eval'd or inline-script code go through lit() (scripts/lib/js-literal.js), which escapes <, >, /, U+2028 and U+2029 after JSON.stringify
- build test and i18n-check read script tags with a DOM parser or a plain search, not HTML regexes
- mcp.js parses the Authorization header without a backtracking regex
2026-11-05 21:24:26 +01:00
Frederic Jung
151b7786ed
Tests wait for state instead of sleeping, on free ports
The relay, parity and benchmark server tests slept fixed times before
asserting, which a busy CI runner overran. They now wait for what they
need (the relay reports what it holds), take a port from the OS, and
use fresh HTTP connections. npm test -- --stress N hunts flakes.
2026-11-05 11:38:26 +01:00
Frederic Jung
c1d726c105
Relay test waits for the late page instead of a fixed 2.5 s
On a busy CI runner the page took longer than that to load and answer,
and the test failed although the server did proceed.
2026-11-05 11:04:47 +01:00
Wolfgang Nagele
7438fd1065 Agent mode: an AI agent plays in the player's own tab, with the agent's clock or a running one
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.
2026-11-03 16:18:43 -05:00