react-websocket 4.22.2 → 4.22.3

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 (46) hide show
  1. package/dist/ag-ui.cjs +1 -2
  2. package/dist/ag-ui.d.cts +0 -6
  3. package/dist/ag-ui.d.ts +0 -2
  4. package/dist/ag-ui.js +1 -2
  5. package/dist/chaos.cjs +1 -2
  6. package/dist/chaos.d.cts +0 -2
  7. package/dist/chaos.d.ts +0 -2
  8. package/dist/chaos.js +1 -2
  9. package/dist/core.cjs +11 -22
  10. package/dist/core.cjs.map +1 -1
  11. package/dist/core.d.cts +0 -22
  12. package/dist/core.d.ts +0 -22
  13. package/dist/core.js +11 -22
  14. package/dist/core.js.map +1 -1
  15. package/dist/devtools.cjs +1 -2
  16. package/dist/devtools.d.cts +0 -2
  17. package/dist/devtools.d.ts +0 -2
  18. package/dist/devtools.js +1 -2
  19. package/dist/index.cjs +1 -2
  20. package/dist/index.d.cts +0 -28
  21. package/dist/index.d.ts +0 -22
  22. package/dist/index.development.cjs +1 -2
  23. package/dist/index.development.js +1 -2
  24. package/dist/index.js +1 -2
  25. package/dist/outbox.cjs +1 -2
  26. package/dist/outbox.d.cts +1 -3
  27. package/dist/outbox.d.ts +0 -2
  28. package/dist/outbox.js +1 -2
  29. package/dist/replay.cjs +1 -2
  30. package/dist/replay.d.cts +0 -2
  31. package/dist/replay.d.ts +0 -2
  32. package/dist/replay.js +1 -2
  33. package/dist/tabs.cjs +1 -2
  34. package/dist/tabs.d.cts +0 -2
  35. package/dist/tabs.d.ts +0 -2
  36. package/dist/tabs.js +1 -2
  37. package/dist/timeline.cjs +1 -2
  38. package/dist/timeline.d.cts +1 -5
  39. package/dist/timeline.d.ts +0 -2
  40. package/dist/timeline.js +1 -2
  41. package/dist/{types-Bb3sBG8L.d.cts → types-DyZm2F7B.d.cts} +1 -3
  42. package/dist/webtransport.cjs +1 -2
  43. package/dist/webtransport.d.cts +0 -2
  44. package/dist/webtransport.d.ts +0 -2
  45. package/dist/webtransport.js +1 -2
  46. package/package.json +4 -4
package/dist/ag-ui.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let __core_cjs = require("./core.cjs");
3
- //#region src/ag-ui.ts
3
+ // src/ag-ui.ts
4
4
  function unescape(token) {
5
5
  return token.replace(/~1/g, "/").replace(/~0/g, "~");
6
6
  }
@@ -420,7 +420,6 @@ function createAgUiAgent(client, options = {}) {
420
420
  }
421
421
  };
422
422
  }
423
- //#endregion
424
423
  exports.applyAgUiEvent = applyAgUiEvent;
425
424
  exports.applyPatch = applyPatch;
426
425
  exports.createAgUiAgent = createAgUiAgent;
package/dist/ag-ui.d.cts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/types.d.ts
2
1
  /**
3
2
  * Where to connect: a URL, or a function that returns one (sync or async).
4
3
  *
@@ -269,8 +268,6 @@ interface WebSocketClient<In = unknown, Out = unknown> {
269
268
  */
270
269
  acquire(): () => void;
271
270
  }
272
- //#endregion
273
- //#region src/runs.d.ts
274
271
  /**
275
272
  * What happens to a run when its connection drops: `keep` resumes it on the next connection,
276
273
  * for agents that keep working in the background; `cancel` aborts it and tells the server, for
@@ -333,8 +330,6 @@ interface WebSocketRuns<Req, T> {
333
330
  /** Stop following runs, and release the connection. Remembered runs stay remembered. */
334
331
  dispose(): void;
335
332
  }
336
- //#endregion
337
- //#region src/ag-ui.d.ts
338
333
  /** A JSON Patch (RFC 6902) operation, as in AG-UI's `STATE_DELTA` and `ACTIVITY_DELTA`. */
339
334
  export interface JsonPatchOperation {
340
335
  readonly op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
@@ -509,6 +504,5 @@ export interface AgUiAgent<S> {
509
504
  * ```
510
505
  */
511
506
  export declare function createAgUiAgent<S = unknown, In = any, Out = any>(client: WebSocketClient<In, Out>, options?: AgUiAgentOptions<S, NoInfer<In>, NoInfer<Out>>): AgUiAgent<S>;
512
- //#endregion
513
507
  export {};
514
508
  //# sourceMappingURL=ag-ui.d.cts.map
package/dist/ag-ui.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { RunPolicy, RunStorage, WebSocketClient, WebSocketRuns } from "./core.js";
2
- //#region src/ag-ui.d.ts
3
2
  /** A JSON Patch (RFC 6902) operation, as in AG-UI's `STATE_DELTA` and `ACTIVITY_DELTA`. */
4
3
  export interface JsonPatchOperation {
5
4
  readonly op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
@@ -174,5 +173,4 @@ export interface AgUiAgent<S> {
174
173
  * ```
175
174
  */
176
175
  export declare function createAgUiAgent<S = unknown, In = any, Out = any>(client: WebSocketClient<In, Out>, options?: AgUiAgentOptions<S, NoInfer<In>, NoInfer<Out>>): AgUiAgent<S>;
177
- //#endregion
178
176
  //# sourceMappingURL=ag-ui.d.ts.map
package/dist/ag-ui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createWebSocketRuns } from "./core.js";
2
- //#region src/ag-ui.ts
2
+ // src/ag-ui.ts
3
3
  function unescape(token) {
4
4
  return token.replace(/~1/g, "/").replace(/~0/g, "~");
5
5
  }
@@ -419,7 +419,6 @@ function createAgUiAgent(client, options = {}) {
419
419
  }
420
420
  };
421
421
  }
422
- //#endregion
423
422
  export { applyAgUiEvent, applyPatch, createAgUiAgent };
424
423
 
425
424
  //# sourceMappingURL=ag-ui.js.map
package/dist/chaos.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/chaos.ts
2
+ // src/chaos.ts
3
3
  const CONNECTING = 0;
4
4
  const OPEN = 1;
5
5
  const CLOSING = 2;
@@ -326,7 +326,6 @@ function createChaosWebSocket(options = {}) {
326
326
  }
327
327
  return ChaosSocket;
328
328
  }
329
- //#endregion
330
329
  exports.createChaosWebSocket = createChaosWebSocket;
331
330
 
332
331
  //# sourceMappingURL=chaos.cjs.map
package/dist/chaos.d.cts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/chaos.d.ts
2
1
  /** A duration in ms, or `[min, max]` for a uniformly random one each time it's used. */
3
2
  export type ChaosRange = number | readonly [min: number, max: number];
4
3
  /** Faults to inject. All are off by default. Change them on a running class with `configure()`. */
@@ -128,5 +127,4 @@ export type ChaosWebSocket = typeof WebSocket & ChaosControls;
128
127
  * ```
129
128
  */
130
129
  export declare function createChaosWebSocket(options?: ChaosOptions): ChaosWebSocket;
131
- //#endregion
132
130
  //# sourceMappingURL=chaos.d.cts.map
package/dist/chaos.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/chaos.d.ts
2
1
  /** A duration in ms, or `[min, max]` for a uniformly random one each time it's used. */
3
2
  export type ChaosRange = number | readonly [min: number, max: number];
4
3
  /** Faults to inject. All are off by default. Change them on a running class with `configure()`. */
@@ -128,5 +127,4 @@ export type ChaosWebSocket = typeof WebSocket & ChaosControls;
128
127
  * ```
129
128
  */
130
129
  export declare function createChaosWebSocket(options?: ChaosOptions): ChaosWebSocket;
131
- //#endregion
132
130
  //# sourceMappingURL=chaos.d.ts.map
package/dist/chaos.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/chaos.ts
1
+ // src/chaos.ts
2
2
  const CONNECTING = 0;
3
3
  const OPEN = 1;
4
4
  const CLOSING = 2;
@@ -325,7 +325,6 @@ function createChaosWebSocket(options = {}) {
325
325
  }
326
326
  return ChaosSocket;
327
327
  }
328
- //#endregion
329
328
  export { createChaosWebSocket };
330
329
 
331
330
  //# sourceMappingURL=chaos.js.map
package/dist/core.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/types.ts
2
+ // src/types.ts
3
3
  /**
4
4
  * Reported via the `error` event (and `onError`) when an incoming message can't be
5
5
  * decoded by `parse`/`json` or fails `schema` validation. The message is not delivered.
@@ -23,8 +23,7 @@ var MessageError = class extends Error {
23
23
  this.issues = options?.issues;
24
24
  }
25
25
  };
26
- //#endregion
27
- //#region src/client.ts
26
+ // src/client.ts
28
27
  const OPEN = 1;
29
28
  const RECONNECT_DEFAULTS = {
30
29
  maxAttempts: Infinity,
@@ -697,8 +696,7 @@ function createClient(url, options = {}) {
697
696
  function createWebSocket(url, options) {
698
697
  return createClient(url, options);
699
698
  }
700
- //#endregion
701
- //#region src/topics.ts
699
+ // src/topics.ts
702
700
  /** @internal Option key for a callback run when nothing holds a topic anymore. Used by feeds. */
703
701
  const ON_RELEASE = Symbol("react-websocket.onRelease");
704
702
  /**
@@ -783,8 +781,7 @@ function createWebSocketTopics(client, options) {
783
781
  }
784
782
  };
785
783
  }
786
- //#endregion
787
- //#region src/feeds.ts
784
+ // src/feeds.ts
788
785
  /**
789
786
  * Subscribe to topics whose messages carry a sequence number, and get each message once, in
790
787
  * order, across reconnects:
@@ -873,8 +870,7 @@ function createWebSocketFeeds(client, options) {
873
870
  }
874
871
  };
875
872
  }
876
- //#endregion
877
- //#region src/latency.ts
873
+ // src/latency.ts
878
874
  const EMPTY = Object.freeze({
879
875
  rtt: void 0,
880
876
  offset: void 0
@@ -983,8 +979,7 @@ function createWebSocketLatency(client, options) {
983
979
  }
984
980
  };
985
981
  }
986
- //#endregion
987
- //#region src/presence.ts
982
+ // src/presence.ts
988
983
  const VOLATILE$1 = { volatile: true };
989
984
  /**
990
985
  * Share per-peer state that expires, for presence, live cursors and selections.
@@ -1105,8 +1100,7 @@ function createWebSocketPresence(client, options) {
1105
1100
  }
1106
1101
  };
1107
1102
  }
1108
- //#endregion
1109
- //#region src/requests.ts
1103
+ // src/requests.ts
1110
1104
  const lastIds = /* @__PURE__ */ new WeakMap();
1111
1105
  /** @internal Method key on the client for what the devtools show, such as its queue length. */
1112
1106
  const INSPECT = Symbol.for("react-websocket.inspect");
@@ -1282,8 +1276,7 @@ function createWebSocketRequests(client, options) {
1282
1276
  }
1283
1277
  };
1284
1278
  }
1285
- //#endregion
1286
- //#region src/responder.ts
1279
+ // src/responder.ts
1287
1280
  const abortError = (message) => new DOMException(message, "AbortError");
1288
1281
  const MAX_TIMEOUT = 2 ** 31 - 1;
1289
1282
  /**
@@ -1435,8 +1428,7 @@ function createWebSocketResponder(client, options) {
1435
1428
  }
1436
1429
  };
1437
1430
  }
1438
- //#endregion
1439
- //#region src/runs.ts
1431
+ // src/runs.ts
1440
1432
  function randomId() {
1441
1433
  return globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
1442
1434
  }
@@ -1673,8 +1665,7 @@ function createWebSocketRuns(client, options) {
1673
1665
  }
1674
1666
  };
1675
1667
  }
1676
- //#endregion
1677
- //#region src/sendrate.ts
1668
+ // src/sendrate.ts
1678
1669
  const VOLATILE = { volatile: true };
1679
1670
  /**
1680
1671
  * Send high-rate state, such as aim, cursor or position, at a rate that adapts to the
@@ -1790,8 +1781,7 @@ function createWebSocketSendRate(client, options = {}) {
1790
1781
  }
1791
1782
  };
1792
1783
  }
1793
- //#endregion
1794
- //#region src/state.ts
1784
+ // src/state.ts
1795
1785
  /**
1796
1786
  * Keep state derived from a client's messages, like a reducer that runs on every message.
1797
1787
  * It starts listening immediately and keeps the state across reconnects; it doesn't open
@@ -1855,7 +1845,6 @@ function createWebSocketState(source, options) {
1855
1845
  dispose: source.on("message", (message) => update((current) => reduce(current, message), batch === "frame"))
1856
1846
  };
1857
1847
  }
1858
- //#endregion
1859
1848
  exports.MessageError = MessageError;
1860
1849
  exports.createWebSocket = createWebSocket;
1861
1850
  exports.createWebSocketFeeds = createWebSocketFeeds;