@pidgeon-ai/sdk 1.66.1 → 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,16 @@ 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
+
10
20
  ## 1.66.1 — a retried approval is the same approval
11
21
 
12
22
  - `signInsApprove` takes an `Idempotency-Key`: a retry with the same key
package/dist/index.cjs CHANGED
@@ -2013,17 +2013,23 @@ async function* streamEvents(options) {
2013
2013
  continue;
2014
2014
  }
2015
2015
  backoffMs = 1e3;
2016
- for await (const frame of frames(response.body, options.signal)) {
2017
- if (frame.id) lastEventId = frame.id;
2018
- if (!frame.data) continue;
2019
- if (frame.event === "error") continue;
2020
- let parsed;
2021
- try {
2022
- parsed = JSON.parse(frame.data);
2023
- } catch {
2024
- 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;
2025
2028
  }
2026
- yield parsed;
2029
+ } catch {
2030
+ if (options.signal?.aborted) return;
2031
+ await sleep(backoffMs, options.signal);
2032
+ backoffMs = Math.min(backoffMs * 2, 3e4);
2027
2033
  }
2028
2034
  }
2029
2035
  }