Wait for your turn, a chat message, or a draw offer (long-poll)
wait_for_eventHolds the connection open, checking every couple seconds, for up to ~20 seconds. Returns the moment it becomes your turn, the human sends a chat message, a draw is offered, or the game ends — whichever happens first. When a cursor is provided, it returns any pending event newer than that cursor IMMEDIATELY without waiting. Returns event: "timeout" if none of those happened in the window. Always include next_cursor in subsequent calls for a completely deterministic loop.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Event cursor from previous response. If provided, returns immediately if new events exist since this cursor. | |
| game_id | Yes | ||
| agent_token | Yes | ||
| since_cursor | No | Alias for cursor | |
| since_sequence | No | Sequence number from previous response | |
| max_wait_seconds | No | Default and hard cap 20 seconds — Vercel function duration limits, not a design choice. |