@pellux/goodvibes-transport-core 0.34.2 → 0.36.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/README.md CHANGED
@@ -6,9 +6,25 @@ Most applications should install `@pellux/goodvibes-sdk` and import `@pellux/goo
6
6
 
7
7
  Use this surface only when you are composing your own transport/client abstraction.
8
8
 
9
- Exports include:
10
- - event envelope helpers
11
- - runtime event feed primitives
12
- - generic client transport helpers
9
+ Key exports:
10
+ - Event envelopes: `createEventEnvelope` (with the `EventEnvelope` / `EventEnvelopeContext` types).
11
+ - Client transport: `createClientTransport`, `createDirectClientTransport`.
12
+ - Middleware: `composeMiddleware` (with the `TransportMiddleware` / `TransportContext` types).
13
+ - Transport error helpers: `transportErrorFromUnknown`, `isAbortError`, `describeUnknownTransportError`.
14
+ - Runtime event feeds: `createRuntimeEventFeed`, `createRuntimeEventFeeds`.
15
+ - Utilities: `createUuidV4`.
16
+
17
+ ```ts
18
+ import {
19
+ createEventEnvelope,
20
+ createUuidV4,
21
+ } from '@pellux/goodvibes-sdk/transport-core';
22
+
23
+ const envelope = createEventEnvelope(
24
+ 'TURN_SUBMITTED',
25
+ { turnId: createUuidV4(), prompt: 'Hello' },
26
+ { sessionId: 'sess_abc', source: 'orchestrator' },
27
+ );
28
+ ```
13
29
 
14
30
  Most consumers should use `@pellux/goodvibes-sdk`, `@pellux/goodvibes-sdk/operator`, or `@pellux/goodvibes-sdk/peer` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC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E,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAyE1C"}
@@ -57,8 +57,15 @@ export function composeMiddleware(middleware, innerFetch) {
57
57
  }
58
58
  catch (err) {
59
59
  // Mark that the error originated from this middleware (not the real fetch).
60
- ctx.middlewareError = true;
61
- ctx.activeMiddlewareName = mwName;
60
+ // innerFetch sets `ctx.error = err` before rethrowing, so a transport/fetch
61
+ // error that merely bubbled up through this middleware is reference-identical
62
+ // to `ctx.error`. Only flag errors thrown by the middleware body itself,
63
+ // otherwise genuine transport errors would be reclassified and lose their
64
+ // HttpStatusError identity (status/category/retryAfterMs), disabling retries.
65
+ if (err !== ctx.error) {
66
+ ctx.middlewareError = true;
67
+ ctx.activeMiddlewareName = mwName;
68
+ }
62
69
  throw err;
63
70
  }
64
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-transport-core",
3
- "version": "0.34.2",
3
+ "version": "0.36.0",
4
4
  "engines": {
5
5
  "bun": "1.3.10",
6
6
  "node": ">=22.0.0"
@@ -57,7 +57,7 @@
57
57
  ],
58
58
  "sideEffects": false,
59
59
  "dependencies": {
60
- "@pellux/goodvibes-errors": "0.34.2"
60
+ "@pellux/goodvibes-errors": "0.36.0"
61
61
  },
62
62
  "license": "MIT",
63
63
  "repository": {