Start a task
Poll until done
since on the first call is the same as omitting it.
Answer an approval
When the loop prints an approval with"isLinkOnly": false:
"isLinkOnly": true, open the approvalUrl in a browser. Then run the poll loop again with the same SESSION and CURSOR.
The poll response also carries the blocking approval as a top-level approval field, so jq .approval works when the event has already scrolled past.
Attach a file
Stop a task
Stream instead
Leavewait out and read the SSE frames as they arrive:

