@pingroom/sdk 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +144 -12
  2. package/dist/client.d.ts +67 -18
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +275 -111
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +8 -3
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +9 -3
  9. package/dist/errors.js.map +1 -1
  10. package/dist/http.d.ts +12 -1
  11. package/dist/http.d.ts.map +1 -1
  12. package/dist/http.js +40 -17
  13. package/dist/http.js.map +1 -1
  14. package/dist/internal/async.d.ts +2 -0
  15. package/dist/internal/async.d.ts.map +1 -1
  16. package/dist/internal/async.js +6 -0
  17. package/dist/internal/async.js.map +1 -1
  18. package/dist/internal/guards.d.ts +9 -0
  19. package/dist/internal/guards.d.ts.map +1 -1
  20. package/dist/internal/guards.js +41 -1
  21. package/dist/internal/guards.js.map +1 -1
  22. package/dist/internal/retry.d.ts +58 -0
  23. package/dist/internal/retry.d.ts.map +1 -0
  24. package/dist/internal/retry.js +108 -0
  25. package/dist/internal/retry.js.map +1 -0
  26. package/dist/internal/url.d.ts +9 -0
  27. package/dist/internal/url.d.ts.map +1 -1
  28. package/dist/internal/url.js +25 -0
  29. package/dist/internal/url.js.map +1 -1
  30. package/dist/linkPing.d.ts.map +1 -1
  31. package/dist/linkPing.js +6 -2
  32. package/dist/linkPing.js.map +1 -1
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +10 -2
  35. package/dist/mcp.js.map +1 -1
  36. package/dist/types.d.ts +182 -18
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/version.d.ts +1 -1
  39. package/dist/version.js +1 -1
  40. package/dist/webhooks.d.ts +20 -3
  41. package/dist/webhooks.d.ts.map +1 -1
  42. package/dist/webhooks.js +14 -9
  43. package/dist/webhooks.js.map +1 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -37,8 +37,26 @@ await pr.broadcast('ab12cd', {
37
37
  is_urgent: true,
38
38
  });
39
39
 
40
- // Listen for what comes back
41
- const { notifications, cursor } = await pr.notifications.wait({ timeout: 20 });
40
+ // Listen for what comes back. listen() reads the current head first, then
41
+ // long-polls forward; stop it with an AbortSignal.
42
+ const ac = new AbortController();
43
+ for await (const ping of pr.notifications.listen({ signal: ac.signal })) {
44
+ console.log(ping.message);
45
+ ac.abort();
46
+ }
47
+ ```
48
+
49
+ A send that times out may still have been delivered. Pass an `idempotencyKey`
50
+ to `broadcast()`, `actions.trigger()`, `approvals.request()` or
51
+ `questions.ask()` and reuse the same key when you retry: the server replays
52
+ the first result instead of pinging the human twice. The SDK sends it as the
53
+ `Idempotency-Key` header, never in the body. A key is 1–255 printable ASCII
54
+ characters, spaces included, and surrounding whitespace is trimmed as the
55
+ server does. Anything else, such as an emoji or Cyrillic, is refused before
56
+ sending with `invalid_request`, because it cannot travel as a header.
57
+
58
+ ```ts
59
+ await pr.broadcast('ab12cd', { message: 'Deploy shipped ✅', idempotencyKey: 'deploy-1.4.0-shipped' });
42
60
  ```
43
61
 
44
62
  Ping titles are limited to 40 characters. Visible bodies are limited to 120
@@ -197,6 +215,18 @@ pr.setToken(fresh.credential);
197
215
  await pr.auth.revoke();
198
216
  ```
199
217
 
218
+ Check what a credential is connected to before sending, and disconnect it when
219
+ you are done:
220
+
221
+ ```ts
222
+ const info = await pr.auth.connection();
223
+ console.log(info.owner.id, info.owner.name, info.handle, info.home_room?.invite_code);
224
+
225
+ // Revokes this credential and its refresh credentials.
226
+ await pr.auth.disconnect();
227
+ pr.setToken(null);
228
+ ```
229
+
200
230
  Generic MCP clients (Cursor, Claude Desktop, Claude Code) should use the standard OAuth 2.1 lane at `/.well-known/oauth-authorization-server` instead — see [pingroom.io/connect-mcp.md](https://pingroom.io/connect-mcp.md).
201
231
 
202
232
  ## Rooms & quick actions
@@ -353,10 +383,26 @@ const ac = new AbortController();
353
383
 
354
384
  for await (const ping of pr.notifications.listen({ signal: ac.signal })) {
355
385
  console.log(ping.sender?.name, ping.message, ping.data);
356
- if (ping.message === 'stop') ac.abort();
386
+ if (ping.message === 'stop') ac.abort(); // sent by another member of the room
357
387
  }
358
388
  ```
359
389
 
390
+ `listen()` delivers what the other members of your rooms send. It leaves out
391
+ everything sent as the connected account: your own sends, your human's own
392
+ pings and replies, other agents on the same account, and incoming-webhook and
393
+ Scheduled Pings in rooms the account owns (those are sent as the owner). So the
394
+ `stop` above has to come from someone else. To let your human stop the loop,
395
+ ask them, and abort when they approve:
396
+
397
+ ```ts
398
+ const stop = await pr.questions.ask('ab12cd', { prompt: 'Stop listening?', ttl: 86400 });
399
+
400
+ pr.questions
401
+ .waitForAnswer(stop.id, { signal: ac.signal })
402
+ .then((q) => { if (q.state === 'answered' && q.answer?.value === 'approve') ac.abort(); })
403
+ .catch(() => {}); // rejects with the abort reason once the loop has stopped
404
+ ```
405
+
360
406
  A listened ping carries two fields worth branching on. `ping.is_handoff` is true
361
407
  when the ping is a handoff rather than an ordinary ping, and `ping.question` is
362
408
  the embedded `Question` (the same wire shape `pr.questions` returns) when the
@@ -372,7 +418,14 @@ for await (const ping of pr.notifications.listen({ signal: ac.signal })) {
372
418
  }
373
419
  ```
374
420
 
375
- Or a single long-poll:
421
+ `listen()` retries transient failures (network errors, request timeouts, 429
422
+ and 5xx) with a backoff that starts at `backoffMs` (default 1 s), doubles up to
423
+ 30 s, and waits out a server `retryAfter`. Pass `onError` to observe those
424
+ retries. Any other failure, such as a 401 after the credential is revoked or a
425
+ 403, ends the iterator by throwing, with or without `onError`.
426
+
427
+ Or a single long-poll. Without `after`, `wait()` answers at once with no pings
428
+ and the current head cursor, so pass the cursor from a previous call:
376
429
 
377
430
  ```ts
378
431
  const { notifications, cursor } = await pr.notifications.wait({ after: lastCursor, timeout: 20 });
@@ -413,6 +466,7 @@ const approval = await pr.approvals.request('ab12cd', {
413
466
  question: 'Ship release 1.4.0 to production?',
414
467
  options: ['Ship it', 'Hold'],
415
468
  correlation_id: 'deploy-1.4.0',
469
+ idempotencyKey: 'deploy-1.4.0-approval', // reuse when retrying this request
416
470
  });
417
471
 
418
472
  const decided = await pr.approvals.waitForDecision(approval.id);
@@ -421,13 +475,43 @@ if (decided.status === 'decided' && decided.decision === 'Ship it') {
421
475
  }
422
476
  ```
423
477
 
478
+ `status` is `pending`, `decided`, `expired` or `cancelled`. Gate on the exact
479
+ approving `decision`, never on `decision !== 'Hold'`.
480
+
481
+ `waitForDecision()`, `questions.waitForAnswer()` and `handoffs.waitForResult()`
482
+ return only a response for the id you asked about, in a known state. Anything
483
+ else, such as an HTML page from a proxy, `{}`, or another approval, rejects with
484
+ `invalid_response` instead of being returned as an outcome. The wait routes
485
+ share a 30-requests-per-minute limit per human, so these loops retry a 429
486
+ after its `retryAfter`, and retry network errors and 5xx with a backoff capped
487
+ at 30 s. Approval and question polls start at least 1 s apart, and handoff
488
+ polls 2.1 s apart, even if something in between answers `pending` at once.
489
+
490
+ The retries are bounded without a signal. Once only failures have come back
491
+ since the last valid response, a wait gives up 5 minutes after the last
492
+ `expires_at` it read, or after 15 minutes of unbroken failures if it has not
493
+ read one yet. It then rejects with code `unavailable`, and the last failure as
494
+ `error.cause`. The CLI uses the same bound. Pass `onRetry(error, attempt)` to
495
+ see each retry (`attempt` counts consecutive failures from 1), and an
496
+ `AbortSignal` to stop sooner. Throwing from `onRetry` ends the wait with that
497
+ error.
498
+
499
+ ```ts
500
+ const decided = await pr.approvals.waitForDecision(approval.id, {
501
+ signal: AbortSignal.timeout(30 * 60_000),
502
+ onRetry: (err, attempt) => {
503
+ if (attempt === 3) console.warn(`PingRoom unreachable (${err.status || err.code}); still waiting`);
504
+ },
505
+ });
506
+ ```
507
+
424
508
  For a runnable example that binds approval to a file's SHA-256, handles timeouts,
425
509
  and refuses a changed artifact, see [release approval](examples/release-approval/README.md).
426
510
  The demo runs locally with simulated decisions and needs no account or credentials.
427
511
 
428
512
  ## Human-in-the-loop questions
429
513
 
430
- A **question** is the general form of an approval: 2–4 options (or a short typed answer), delivered as a push with tappable buttons, resolving to exactly one answer — first tap wins. Reach for `pr.questions` when you need more than yes/no, a typed reply, or want *anyone in the room* to answer.
514
+ A **question** is the general form of an approval: 2–4 options (or a short typed answer), delivered as a push with tappable buttons, resolving to exactly one answer — first tap wins. Reach for `pr.questions` when you need more than yes/no, a typed reply, want *anyone in the room* to answer, or want *everyone in the room* to vote ([polls](#polls)).
431
515
 
432
516
  ```ts
433
517
  // Ask — omit `options` for a binary Approve/Deny; ttl defaults to 1h (30s–24h).
@@ -467,6 +551,36 @@ await pr.questions.cancel(q.id); // withdraw a pending one
467
551
 
468
552
  > `pr.approvals` is the ergonomic two-option shortcut and stays fully supported — it routes through the same machinery server-side. Use it for plain yes/no gates; use `pr.questions` for everything richer.
469
553
 
554
+ ### Polls
555
+
556
+ Polls need SDK 0.8.0 or newer: 0.7.1's `QuestionInput` has no `resolution_policy` and its `Question` type has no `results`.
557
+
558
+ Set `resolution_policy: 'all'` to poll the room instead of taking the first answer. Everyone who is in the room when you ask — except your own bound human — gets one final vote. The poll closes `answered` once nobody who can still vote owes a vote, or at its deadline if anyone voted; with no votes it expires. Someone who left the room, was removed, deleted their account, or is now barred by a block (with your bound human, the room owner or an admin) stops holding it open; the server checks on every vote and once a minute, so such a poll closes within about a minute. A poll nobody voted in still waits for its deadline.
559
+
560
+ ```ts
561
+ const poll = await pr.questions.ask('ab12cd', {
562
+ prompt: 'Which release name?',
563
+ options: ['otter', 'heron'],
564
+ resolution_policy: 'all', // implies responder_scope: 'room'
565
+ ttl: 3600,
566
+ });
567
+
568
+ const closed = await pr.questions.waitForAnswer(poll.id);
569
+ if (closed.state === 'answered') {
570
+ console.log(closed.answer?.value ?? 'tie'); // the leading option, or null on a tie
571
+ for (const o of closed.results?.options ?? []) console.log(o.value, o.count);
572
+ console.log(`${closed.results?.response_count} of ${closed.results?.audience_count} voted`);
573
+ }
574
+ ```
575
+
576
+ - `results` is on every read of a poll, so `questions.get()` shows the running tally while it is `pending`. It is `null` on a first-answer Question.
577
+ - A poll's `answer` has `responder: null` (the room chose it); who voted what is in `results.responses` (up to the 100 most recent votes, oldest first; the counts stay exact).
578
+ - A closed poll's `answer` is the leader stored when it closed and never changes. `results` stays live, so its counts can drop if a voter later deletes their account.
579
+ - `results.viewer` is always `null` for the SDK: it reads the agent API, where no individual viewer is set.
580
+ - A poll is options-only: `ask()` throws `invalid_request` before sending if you combine `resolution_policy: 'all'` with `responder_scope: 'direct'`, `target_user_id`, or `text_input`.
581
+ - If your bound human is the room's only member, the server asks them a plain `direct` question instead, and the returned Question reads `resolution_policy: 'first'`. A retry with the same `idempotencyKey` and `resolution_policy: 'first'` replays it; any other policy change under a reused key is `409 idempotency_conflict`.
582
+ - A poll nobody in the room could vote in (every member besides your bound human is barred by a block) is refused: `ask()` rejects with a `PingRoomError` whose `status` is 422 (a validation error on `resolution_policy`, with no machine `code`).
583
+
470
584
  ## Handoffs (Agent → one human)
471
585
 
472
586
  A **handoff** is the direct, private version of the human-in-the-loop: it always targets **exactly one human** and is never readable by anyone else in the room. Reach for `pr.handoffs` when an agent needs to hand a task to *its* human (or one specific person) and block on the outcome — no room to pick, no room-scope answering. It's backed by the ack and question primitives, so a handoff is one of two `kind`s:
@@ -553,7 +667,7 @@ if (answered.state === 'answered') {
553
667
  }
554
668
  ```
555
669
 
556
- `waitForResult` loops the bounded long-poll until a terminal state lands, so `expired`/`cancelled` and a negative answer all come back as normal results — nothing is thrown for the outcome. Full options: `prompt`, `target` (`'me'` — the default — or a user UUID), `expiresIn` (120–86400s, default 900), `urgency` (`'active'` | `'passive'`), `correlationId`, `replyTo`, `data`, `idempotencyKey`.
670
+ `waitForResult` loops the bounded long-poll until a terminal state lands, so `expired`/`cancelled` and a negative answer all come back as normal results — nothing is thrown for the outcome. Full options: `prompt`, `target` (`'me'`, the default; an agent can hand off only to the human who connected it, and any other id is `403 target_not_permitted`), `expiresIn` (120–86400s, default 900), `urgency` (`'active'` | `'passive'`), `correlationId`, `replyTo`, `data`, `idempotencyKey`.
557
671
 
558
672
  ```ts
559
673
  await pr.handoffs.get(id); // current state (polling / audit)
@@ -561,6 +675,9 @@ await pr.handoffs.list({ state: 'open' }); // your open handoffs
561
675
  await pr.handoffs.list({ state: 'all' }); // recent history (up to 200 per kind)
562
676
  ```
563
677
 
678
+ `waitForResult` starts polls at least 2.1 seconds apart, so a short `timeout`
679
+ cannot use up the wait route's 30-per-minute limit.
680
+
564
681
  Create/read map coded failures onto `PingRoomError` — branch on `error.code` (see [`HandoffErrorCode`](#errors)). The exported union covers target policy (`target_not_permitted`), room designation (`no_room_configured`, `handoff_room_unsupported`), scope/quota, idempotency, feature, and capability failures; `capability_check_unavailable` is retryable. Authentication and schema-validation failures may have no code, so also inspect `error.status`. `room_not_granted` is **not** in this union: `POST /handoffs` names no room, so it is not behind the room-grant gate — see `RoomScopedErrorCode`.
565
682
 
566
683
  ## Incoming webhooks (no token needed)
@@ -664,8 +781,9 @@ await pr.live.push('AB12CD', liveStatus.done('deploy-42', 'Shipped v1.4.0'));
664
781
  // ...or liveStatus.failed('deploy-42', 'Rollback triggered')
665
782
 
666
783
  // Reconcile after a restart instead of opening a duplicate.
667
- // Returns null for a 404 ONLY — no such stream in the last 24 hours. Every
668
- // other failure throws, including a 403 `room_not_granted`, so a permission
784
+ // Returns null ONLY for a 404 `stream_not_found`: no such stream in the last
785
+ // 24 hours. Every other failure throws, including a 404 for an unknown or
786
+ // deleted room and a 403 `room_not_granted`, so a wrong room or a permission
669
787
  // problem is never mistaken for an absent stream.
670
788
  const snap = await pr.live.get('AB12CD', 'deploy-42');
671
789
  if (snap) console.log(snap.template, snap.current_step, snap.updated_at);
@@ -690,6 +808,8 @@ When PingRoom POSTs an event to *your* server, verify it before trusting it. New
690
808
 
691
809
  `timestamp` is the Unix-seconds value in `X-PingRoom-Timestamp`, and `deliveryId` is the exact `X-PingRoom-Delivery` value. **Verify over the exact raw request body; re-serializing parsed JSON can change the bytes and invalidate the signature.** If v2 is present, receivers MUST verify it and reject the request on failure. The helper accepts legacy v1 only when v2 is absent. It rejects timestamps outside a five-minute replay window by default; set `maxAgeSeconds` to customize that window.
692
810
 
811
+ Pass `requireV2: true`. Every delivery PingRoom sends carries v2, and v1 does not sign `X-PingRoom-Delivery`: a captured body replayed without its v2 header and under a new delivery id still passes v1. With `requireV2: true` such a request fails, so a receiver can dedupe on `X-PingRoom-Delivery`. Without it, the helper still falls back to v1 for receivers that predate v2; never dedupe on the delivery id in that mode.
812
+
693
813
  ```ts
694
814
  import {
695
815
  verifyWebhookSignature,
@@ -699,6 +819,9 @@ import {
699
819
  WEBHOOK_DELIVERY_HEADER,
700
820
  } from '@pingroom/sdk';
701
821
 
822
+ const signingSecret = process.env.PINGROOM_SIGNING_SECRET;
823
+ if (!signingSecret) throw new Error('Set PINGROOM_SIGNING_SECRET to the webhook signing_secret.');
824
+
702
825
  // Express example — capture the raw body (e.g. express.raw())
703
826
  app.post('/pingroom', async (req, res) => {
704
827
  const ok = await verifyWebhookSignature({
@@ -707,7 +830,8 @@ app.post('/pingroom', async (req, res) => {
707
830
  signatureV2: req.get(WEBHOOK_SIGNATURE_V2_HEADER),
708
831
  timestamp: req.get(WEBHOOK_TIMESTAMP_HEADER),
709
832
  deliveryId: req.get(WEBHOOK_DELIVERY_HEADER),
710
- secret: process.env.PINGROOM_SIGNING_SECRET,
833
+ secret: signingSecret,
834
+ requireV2: true, // refuse the legacy v1-only form
711
835
  });
712
836
  if (!ok) return res.status(401).end();
713
837
  // ... handle the verified event
@@ -761,20 +885,28 @@ const profile = await pr.directory.get('agt_deploybell');
761
885
 
762
886
  ## Errors
763
887
 
764
- Every failure rejects with a `PingRoomError` carrying the HTTP `status` and the API's machine `code` (e.g. `cooldown`, `rate_limited`, `room_not_granted`), plus `retryAfter` when present:
888
+ Every failure rejects with a `PingRoomError` carrying the HTTP `status` and the API's machine `code` (e.g. `room_not_granted`, `cooldown_active`, `rate_limited`), plus `retryAfter` when present.
889
+
890
+ Retry on the status, not on one code. Every 429 should be retried after `retryAfter`: route throttles answer `rate_limited`, but a public room's per-minute limit answers `public_room_rate_limited` and a quick action's cooldown answers `cooldown_active`. Reuse the same `idempotencyKey` on the retry:
765
891
 
766
892
  ```ts
767
893
  import { PingRoomError } from '@pingroom/sdk';
768
894
 
895
+ const send = () => pr.broadcast('ab12cd', { message: 'hi', idempotencyKey: 'hello-1' });
769
896
  try {
770
- await pr.broadcast('ab12cd', { message: 'hi' });
897
+ await send();
771
898
  } catch (err) {
772
- if (err instanceof PingRoomError && err.code === 'rate_limited') {
899
+ if (err instanceof PingRoomError && err.status === 429) {
773
900
  await new Promise((r) => setTimeout(r, (err.retryAfter ?? 1) * 1000));
901
+ await send();
902
+ } else {
903
+ throw err;
774
904
  }
775
905
  }
776
906
  ```
777
907
 
908
+ The SDK also raises a few client-side codes: `network_error` and `timeout` (status 0), `redirect_refused` when the API answers with a redirect (the SDK never follows one, so a token, upload or webhook body cannot be forwarded to another origin), `invalid_response` when a wait loop receives something that is not the requested approval, Question or handoff, `unavailable` when a wait loop stops retrying an unreachable API (see [approvals](#human-in-the-loop-approvals); the last failure is `error.cause`), and `invalid_request` for input refused before sending, including an `idempotencyKey` that is not 1–255 printable ASCII characters.
909
+
778
910
  The coded vocabulary is exported both as types and as runtime arrays, one per
779
911
  surface, so you can branch exhaustively:
780
912
 
package/dist/client.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { HttpClient } from './http.js';
2
2
  import type { LiveStatusPing, LiveStatusResult, LiveStatusSnapshot } from './liveStatus.js';
3
3
  import { McpClient } from './mcp.js';
4
- import type { AcknowledgementWaitResult, Attachment, ZipManifest, AgentInboxEnsureResult, AgentInboxActivateInput, AgentInboxActivationResult, AgentInboxEnsureInput, AgentNotification, Approval, ApprovalInput, CreatePublicRoomInput, CreateRoomInput, CreateWebhookInput, Credential, ClaimCompleteParams, ClaimStartParams, AskInput, DirectoryEntry, DirectoryListInput, DirectoryProfile, DirectPingResult, Handoff, ListHandoffsInput, JoinRoomInput, ListNotificationsInput, ListenInput, ListQuestionsInput, NotificationDetail, NotificationHistoryEntry, Paginated, PingInput, PingResult, PingRoomOptions, Question, QuestionInput, QuickAction, RegisterParams, RedeemCodeResult, PairingStart, PairingStatus, PairedCredential, Room, RoomIconCatalog, RequestAckInput, RotateHandleResult, StartPairingParams, TriggerInput, QuickActionInput, UpdateQuickActionInput, UpdateQuickActionLayoutInput, UpdateWebhookInput, UploadAttachmentInput, WaitApprovalInput, WaitHandoffInput, WaitForAcknowledgementInput, WaitInput, WaitQuestionInput, WaitResult, WaitForPairingOptions, Webhook } from './types.js';
4
+ import type { AcknowledgementWaitResult, Attachment, ZipManifest, AgentInboxEnsureResult, AgentInboxActivateInput, AgentInboxActivationResult, AgentInboxEnsureInput, AgentConnectionInfo, AgentDisconnectResult, AgentNotification, Approval, ApprovalInput, CreatePublicRoomInput, CreateRoomInput, CreateWebhookInput, Credential, ClaimCompleteParams, ClaimStartParams, AskInput, DirectoryEntry, DirectoryListInput, DirectoryProfile, DirectPingResult, Handoff, ListHandoffsInput, JoinRoomInput, ListNotificationsInput, ListenInput, ListQuestionsInput, NotificationDetail, NotificationHistoryEntry, Paginated, PingInput, PingResult, PingRoomOptions, Question, QuestionInput, QuickAction, RegisterParams, RedeemCodeResult, PairingStart, PairingStatus, PairedCredential, Room, RoomIconCatalog, RequestAckInput, RotateHandleResult, StartPairingParams, TriggerInput, QuickActionInput, UpdateQuickActionInput, UpdateQuickActionLayoutInput, UpdateWebhookInput, UploadAttachmentInput, WaitApprovalInput, WaitHandoffInput, WaitForAcknowledgementInput, WaitForOutcomeOptions, WaitInput, WaitQuestionInput, WaitResult, WaitForPairingOptions, Webhook } from './types.js';
5
+ /** Node's util.inspect hook, named through the global registry so no import is needed. */
6
+ declare const INSPECT: unique symbol;
5
7
  /** Agent credential lifecycle (auth.md flow). */
6
8
  declare class AuthApi {
7
9
  private readonly http;
@@ -31,11 +33,23 @@ declare class AuthApi {
31
33
  * the active credential returned by the server.
32
34
  */
33
35
  waitForPairing(pairing: PairingStart, options?: WaitForPairingOptions): Promise<PairedCredential>;
34
- private throwIfPairingAborted;
35
36
  /** Rotate to a fresh credential (same scopes/handle). */
36
37
  refresh(): Promise<Credential>;
37
38
  /** Revoke the current credential. */
38
39
  revoke(): Promise<void>;
40
+ /**
41
+ * What this credential is connected to: the robot, the owner's public id and
42
+ * name, the home room and room memberships, and the room grant. Check
43
+ * `owner.id` and `handle` against the account and robot you approved before
44
+ * sending anything.
45
+ */
46
+ connection(): Promise<AgentConnectionInfo>;
47
+ /**
48
+ * Disconnect this agent: revokes the calling credential and its refresh
49
+ * credentials. The client keeps the now-revoked token; clear it with
50
+ * `setToken(null)` or pair again.
51
+ */
52
+ disconnect(): Promise<AgentDisconnectResult>;
39
53
  }
40
54
  declare class RoomsApi {
41
55
  private readonly http;
@@ -142,10 +156,17 @@ declare class ApprovalsApi {
142
156
  get(approvalId: string): Promise<Approval>;
143
157
  /** One long-poll for the decision; returns the (possibly still-pending) approval. */
144
158
  wait(approvalId: string, input?: WaitApprovalInput): Promise<Approval>;
145
- /** Block until the human decides (or the request expires), looping wait() under the hood. */
146
- waitForDecision(approvalId: string, input?: {
147
- signal?: AbortSignal;
148
- }): Promise<Approval>;
159
+ /**
160
+ * Block until the human decides (or the request expires or is cancelled),
161
+ * looping wait() under the hood, with polls started at least 1 s apart. A
162
+ * response that is not this approval in a known status rejects with
163
+ * `invalid_response`. Network failures, 429 and 5xx are retried with backoff
164
+ * (honouring `retryAfter`), and reported to `onRetry`, until `signal` aborts
165
+ * or the outage outlasts the approval's `expires_at` by 5 minutes (15 minutes
166
+ * of failures while no `expires_at` has been read); that rejects with
167
+ * `unavailable`. See {@link WaitForOutcomeOptions}.
168
+ */
169
+ waitForDecision(approvalId: string, input?: WaitForOutcomeOptions): Promise<Approval>;
149
170
  }
150
171
  /**
151
172
  * The general human-in-the-loop primitive: ask a human a question with 2–4
@@ -156,7 +177,11 @@ declare class ApprovalsApi {
156
177
  declare class QuestionsApi {
157
178
  private readonly http;
158
179
  constructor(http: HttpClient);
159
- /** Ask a Question in a room; returns the pending Question (id + computed expiry). */
180
+ /**
181
+ * Ask a Question in a room; returns the pending Question (id + computed
182
+ * expiry). Pass `resolution_policy: 'all'` to poll the room: everyone asked
183
+ * votes once, and `results` carries the tally on every read.
184
+ */
160
185
  ask(inviteCode: string, input: QuestionInput): Promise<Question>;
161
186
  /** Fetch a Question's current state. */
162
187
  get(questionId: string): Promise<Question>;
@@ -165,11 +190,17 @@ declare class QuestionsApi {
165
190
  /**
166
191
  * Block until the human answers (or the question expires/cancels), looping
167
192
  * wait() under the hood. Returns the resolved Question — inspect `state` and
168
- * `answer.value` to branch.
193
+ * `answer.value` to branch. A poll returns once it closes; its `answer` is the
194
+ * leading option, or `null` on a tie, and `results` holds the tally.
195
+ *
196
+ * Polls start at least 1 s apart. A response that is not this Question in a
197
+ * known state rejects with `invalid_response`. Network failures, 429 and 5xx
198
+ * are retried with backoff (honouring `retryAfter`), and reported to
199
+ * `onRetry`, until `signal` aborts or the outage outlasts the Question's
200
+ * `expires_at` by 5 minutes (15 minutes of failures while no `expires_at` has
201
+ * been read); that rejects with `unavailable`. See {@link WaitForOutcomeOptions}.
169
202
  */
170
- waitForAnswer(questionId: string, input?: {
171
- signal?: AbortSignal;
172
- }): Promise<Question>;
203
+ waitForAnswer(questionId: string, input?: WaitForOutcomeOptions): Promise<Question>;
173
204
  /** List the asker's Questions, optionally filtered by state. */
174
205
  list(input?: ListQuestionsInput): Promise<Question[]>;
175
206
  /** Withdraw a still-pending Question (409 if it already resolved). */
@@ -203,8 +234,16 @@ declare class HandoffsApi {
203
234
  * Block until the handoff resolves (or expires/cancels), looping the bounded
204
235
  * long-poll under the hood. `expired`/`cancelled` and a negative answer (e.g.
205
236
  * `hold`) all surface as normal terminal results — nothing is thrown for them.
237
+ *
238
+ * Polls start at least 2.1 s apart, so a short `timeout` stays under the
239
+ * route's 30-per-minute limit. A response that is not this handoff in a
240
+ * known state rejects with `invalid_response`. Network failures, 429 and 5xx
241
+ * are retried with backoff (honouring `retryAfter`), and reported to
242
+ * `onRetry`, until `signal` aborts or the outage outlasts the handoff's
243
+ * `expires_at` by 5 minutes (15 minutes of failures while no `expires_at` has
244
+ * been read); that rejects with `unavailable`. See {@link WaitForOutcomeOptions}.
206
245
  */
207
- waitForResult(id: string, input?: WaitHandoffInput): Promise<Handoff>;
246
+ waitForResult(id: string, input?: WaitHandoffInput & WaitForOutcomeOptions): Promise<Handoff>;
208
247
  /** List the agent's open handoffs or bounded recent history. */
209
248
  list(input?: ListHandoffsInput): Promise<Handoff[]>;
210
249
  /** One bounded long-poll; returns the (possibly still-open) handoff. */
@@ -261,11 +300,11 @@ declare class LiveApi {
261
300
  * Read back a stream this credential started, so a restarted producer can
262
301
  * reconcile instead of opening a duplicate.
263
302
  *
264
- * Resolves null for a 404 ONLY — no stream with that correlation id in the
265
- * last 24 hours. Every other failure throws: in particular a 403
266
- * `room_not_granted` ({@link RoomScopedErrorCode}), raised when the room is
267
- * outside the grant the human gave this agent, propagates rather than being
268
- * reported as "no stream".
303
+ * Resolves null ONLY for a 404 `stream_not_found` — no stream with that
304
+ * correlation id in the last 24 hours. Every other failure throws: a 404 for
305
+ * an unknown or deleted room code, and a 403 `room_not_granted`
306
+ * ({@link RoomScopedErrorCode}) when the room is outside the grant the human
307
+ * gave this agent, both propagate rather than being reported as "no stream".
269
308
  */
270
309
  get(inviteCode: string, correlationId: string): Promise<LiveStatusSnapshot | null>;
271
310
  }
@@ -332,8 +371,18 @@ export declare class PingRoom {
332
371
  getToken(): string | null;
333
372
  /** Redeem a gift or promotional code for this agent's authorizing human. */
334
373
  redeemCode(code: string): Promise<RedeemCodeResult>;
335
- /** Broadcast a ping to every member of a room you own. */
374
+ /**
375
+ * Broadcast a ping to every member of a room you own. Pass `idempotencyKey`
376
+ * and reuse it when retrying after a timeout or network error, so a send
377
+ * the server already committed is replayed rather than delivered twice.
378
+ */
336
379
  broadcast(inviteCode: string, ping: PingInput): Promise<PingResult>;
380
+ /** What a logger or JSON.stringify() sees: the API origin, never the credential. */
381
+ toJSON(): {
382
+ baseUrl: string;
383
+ token: '[redacted]' | null;
384
+ };
385
+ [INSPECT](): string;
337
386
  }
338
387
  export {};
339
388
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAavC,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EACV,yBAAyB,EACzB,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,uBAAuB,EAEvB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EAGP,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,UAAU,EACV,eAAe,EACf,QAAQ,EACR,aAAa,EACb,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,SA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