Start a task
do() resolves as soon as the task exists — not when it finishes. It also waits internally for init and the claim to complete, so you can call it right after init with no readiness check.
One goal at a time
Each session runs at most one task. Whatdo() does while a task is running depends on the goal:
Read the outcome
status is one of running, completed, failed, or cancelled; summary is a string or null.
check() is the authoritative source for how a task ended. Activity events (below) are ephemeral and per-tab; when you need to decide what actually happened, use check().
End a task early
Handle errors
check() and cancel() reject on any non-2xx response. The rejection is a plain Error — there’s no .status or .code property to branch on — but its message carries the HTTP status, so inspect the message:
