interact
Play scripted page steps frame by frame to verify state changes, console output, motion, and sound; attach expected checks and save passing runs as rerunnable tests.
Instructions
Plays steps on the open page frame by frame and returns what changed in the state (the whole state when nothing did), the console lines and errors the steps raised, a Motion line when the subject turned or stopped under a held key or would stutter on a 100 Hz screen, and a Sound line on a page that makes sound. Each mouse and touch step names the object under it and its distance. expect adds one ✓ or ✗ line per path; save keeps the play as a check test reruns, only when every entry holds. A malformed step fails the call before anything plays; a failing expect entry is reported, not raised. Use feel to measure how an event reacts on screen, observe to read the state without playing, and eval to set it with code. Options in full: the skill's references/tools.md.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "interact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game | No | The name the game was opened under with the `open` tool, to act on ("main" by default; a subagent uses its own). | |
| look | No | Also return `look`'s picture after the steps. | |
| save | No | Save the steps and `expect` as a check of this name (letters, digits, - or _) in game-tests.json when every Expect entry holds; the call plays from a fresh reload, its leading state steps as setup. | |
| hover | No | After the steps, the mouse moves to each named object's centre; one diff per name after `frames`. | |
| steps | No | Steps, in order: { key, frames? } (held, then released); { key, down: true|false } (held across steps); { mouse: click|dblclick|down|up|move, x, y, button?: "left"|"right"|"middle" } (left by default); { mouse: move, relative: [dx, dy] } (pointer lock); { wheel: deltaY, x?, y? }; { resize: [w, h] }; { scroll: px | { progress: 0..1 } | { to: "#id" } }; { touch: start|move|end|tap, x, y }; { wait: frames, draw? }; { action, ...args } (window.__game.act); { state: {...} } (window.__game.setState, then one frame); { until: {...}, max? } (until the state holds, values as `expect`'s; `max` 600 frames by default); { clock: { timescale?, paused? } } (paused: false plays in real time; the clock reads 60 s at frame 0 on purpose). Each step advances `frames` (default 1) and draws only its last (draw: true draws each); `frames: 0` sends it on the same frame as the next. | |
| trace | No | Up to 6 dotted paths into observe(), read each frame (the first 600): first and last value, peak or low, and first change, with frames. | |
| expect | No | Checked against the state after the steps, keyed by dotted paths into observe() ("coins.0.x"): a number, string or boolean (equal), [min, max] (a range; two numbers always are), a list of other values (one of them; [null] is null), [] (an empty list) or null (exists, whatever its value). | |
| frames | No | Frames to wait at each hovered object (default 1). | |
| record | No | true: plays the steps in real time (1/60 s a frame, 15 s at most) into a GIF in the run folder; the reply has four moments and the real frame intervals. |