Wait for the user to finish signing in
wait_for_sign_inWait until the user finishes a sign-in link, so you know the moment they are done without asking them. Pass ref: meta.handoff.ref from a paused run, or ref from add_connection.
Call it right after you give the user the link, in the same turn. Write the link in your reply first, so they can see it while this waits. It holds for up to waitMs (default 45000, at most 50000) and answers the moment the sign-in finishes.
It returns state:
• done: every site on the link is signed in. Send the SAME script again now (or carry on with the task after add_connection). Do not ask the user whether they are done.
• pending: not yet; remaining names the sites still missing. Call it again with the same ref. Keep going while the link is live (expiresAt, 15 minutes); a person often takes a few minutes.
• cancelled: the user pressed Cancel. Tell them, and do not re-send the script unless they ask.
• expired: the link ran out first. Send the SAME script again; it pauses with a fresh link.
• unknown: no link with that ref on this account. A ref starting site: cannot be watched: wait for the user instead.
If the user replies while you are waiting, answer them; the link is still live and you can wait again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | `meta.handoff.ref` from a paused run, or `ref` from `add_connection`. | |
| waitMs | No | How long to wait for the sign-in to finish, in ms. Default 45000, at most 50000. |