@pidgeon-ai/sdk 1.65.0 → 1.67.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,27 @@ the two would publish a release for every unrelated product deploy.
7
7
  Semver applies to **this package's own surface** — the exported names, the
8
8
  call shapes, the result shape — not to the API behind it.
9
9
 
10
+ ## 1.67.0 — one set of capabilities, two languages
11
+
12
+ - `streamEvents` reconnects from its cursor when a connection is cut
13
+ mid-response; it threw `TypeError: terminated` before, despite its promise
14
+ that only `signal` ends the loop.
15
+ - The Python package (`pidgeon`, same version) gains `pidgeon.identity`,
16
+ `pidgeon.sign_in` and `pidgeon.stream`, the twins of `@pidgeon-ai/id`,
17
+ `@pidgeon-ai/sign-in` and `streamEvents`. A test now fails the build when
18
+ either language has a capability the other lacks.
19
+
20
+ ## 1.66.1 — a retried approval is the same approval
21
+
22
+ - `signInsApprove` takes an `Idempotency-Key`: a retry with the same key
23
+ answers with the first callback instead of a second code.
24
+
25
+ ## 1.66.0 — approving a sign-in
26
+
27
+ - `signInsApprove`: an agent approves an app's Sign in with Pidgeon with its
28
+ own key, and gets back the app's callback to open. The key must be able to
29
+ send as the address.
30
+
10
31
  ## 1.65.0 — reply_to
11
32
 
12
33
  - `messagesSend` and `messagesCheck` take `reply_to`: where replies go when
package/dist/index.cjs CHANGED
@@ -151,6 +151,7 @@ __export(index_exports, {
151
151
  routingDelete: () => routingDelete,
152
152
  routingList: () => routingList,
153
153
  routingUpdate: () => routingUpdate,
154
+ signInsApprove: () => signInsApprove,
154
155
  streamEvents: () => streamEvents,
155
156
  testInbound: () => testInbound,
156
157
  threadsGet: () => threadsGet,
@@ -1375,6 +1376,15 @@ var messagesCheck = (options) => (options.client ?? client).post({
1375
1376
  ...options.headers
1376
1377
  }
1377
1378
  });
1379
+ var signInsApprove = (options) => (options.client ?? client).post({
1380
+ security: [{ scheme: "bearer", type: "http" }],
1381
+ url: "/sign-ins",
1382
+ ...options,
1383
+ headers: {
1384
+ "Content-Type": "application/json",
1385
+ ...options.headers
1386
+ }
1387
+ });
1378
1388
  var messagesSearch = (options) => (options?.client ?? client).get({
1379
1389
  security: [{ scheme: "bearer", type: "http" }],
1380
1390
  url: "/messages/search",
@@ -2003,17 +2013,23 @@ async function* streamEvents(options) {
2003
2013
  continue;
2004
2014
  }
2005
2015
  backoffMs = 1e3;
2006
- for await (const frame of frames(response.body, options.signal)) {
2007
- if (frame.id) lastEventId = frame.id;
2008
- if (!frame.data) continue;
2009
- if (frame.event === "error") continue;
2010
- let parsed;
2011
- try {
2012
- parsed = JSON.parse(frame.data);
2013
- } catch {
2014
- continue;
2016
+ try {
2017
+ for await (const frame of frames(response.body, options.signal)) {
2018
+ if (frame.id) lastEventId = frame.id;
2019
+ if (!frame.data) continue;
2020
+ if (frame.event === "error") continue;
2021
+ let parsed;
2022
+ try {
2023
+ parsed = JSON.parse(frame.data);
2024
+ } catch {
2025
+ continue;
2026
+ }
2027
+ yield parsed;
2015
2028
  }
2016
- yield parsed;
2029
+ } catch {
2030
+ if (options.signal?.aborted) return;
2031
+ await sleep(backoffMs, options.signal);
2032
+ backoffMs = Math.min(backoffMs * 2, 3e4);
2017
2033
  }
2018
2034
  }
2019
2035
  }
@@ -2197,6 +2213,7 @@ function sleep(ms, signal) {
2197
2213
  routingDelete,
2198
2214
  routingList,
2199
2215
  routingUpdate,
2216
+ signInsApprove,
2200
2217
  streamEvents,
2201
2218
  testInbound,
2202
2219
  threadsGet,