@replit/river 0.209.2 → 0.209.4

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/{chunk-L3KNTJU3.js → chunk-MIO5URHT.js} +25 -21
  2. package/dist/chunk-MIO5URHT.js.map +1 -0
  3. package/dist/{chunk-OTL2R22H.js → chunk-SWRTP3YW.js} +12 -5
  4. package/dist/chunk-SWRTP3YW.js.map +1 -0
  5. package/dist/{chunk-DVAIJ57I.js → chunk-VQAPXMIR.js} +24 -15
  6. package/dist/chunk-VQAPXMIR.js.map +1 -0
  7. package/dist/{client-BX3IXUA2.d.cts → client-DXJRow2s.d.cts} +1 -1
  8. package/dist/{client-CBak1h8Q.d.ts → client-Dw0JBBs3.d.ts} +1 -1
  9. package/dist/codec/index.js +2 -2
  10. package/dist/{connection-_eetKnva.d.cts → connection-BWkuQM31.d.cts} +1 -1
  11. package/dist/{connection-zMlysQKs.d.ts → connection-T0wHyOsa.d.ts} +1 -1
  12. package/dist/router/index.cjs +6 -2
  13. package/dist/router/index.cjs.map +1 -1
  14. package/dist/router/index.d.cts +7 -7
  15. package/dist/router/index.d.ts +7 -7
  16. package/dist/router/index.js +1 -1
  17. package/dist/{server-BV7GXuhz.d.cts → server-BDSYa-CO.d.cts} +1 -1
  18. package/dist/{server-B_H1zn-R.d.ts → server-DFOzjvLh.d.ts} +1 -1
  19. package/dist/{services-DtsSIaec.d.ts → services-DEubFUIR.d.ts} +12 -20
  20. package/dist/{services-BIMmk-v4.d.cts → services-GJyw0jKV.d.cts} +12 -20
  21. package/dist/testUtil/index.cjs +15 -6
  22. package/dist/testUtil/index.cjs.map +1 -1
  23. package/dist/testUtil/index.d.cts +4 -4
  24. package/dist/testUtil/index.d.ts +4 -4
  25. package/dist/testUtil/index.js +3 -3
  26. package/dist/transport/impls/ws/client.cjs +25 -9
  27. package/dist/transport/impls/ws/client.cjs.map +1 -1
  28. package/dist/transport/impls/ws/client.d.cts +3 -3
  29. package/dist/transport/impls/ws/client.d.ts +3 -3
  30. package/dist/transport/impls/ws/client.js +3 -3
  31. package/dist/transport/impls/ws/server.cjs +13 -5
  32. package/dist/transport/impls/ws/server.cjs.map +1 -1
  33. package/dist/transport/impls/ws/server.d.cts +3 -3
  34. package/dist/transport/impls/ws/server.d.ts +3 -3
  35. package/dist/transport/impls/ws/server.js +3 -3
  36. package/dist/transport/index.cjs +15 -6
  37. package/dist/transport/index.cjs.map +1 -1
  38. package/dist/transport/index.d.cts +4 -4
  39. package/dist/transport/index.d.ts +4 -4
  40. package/dist/transport/index.js +3 -3
  41. package/dist/{handshake-B3iu79B0.d.cts → transport-CxT7y8Qk.d.cts} +107 -102
  42. package/dist/{handshake-DNinPBA3.d.ts → transport-pdbkDzmJ.d.ts} +107 -102
  43. package/package.json +1 -1
  44. package/dist/chunk-DVAIJ57I.js.map +0 -1
  45. package/dist/chunk-L3KNTJU3.js.map +0 -1
  46. package/dist/chunk-OTL2R22H.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { b as ProvidedClientTransportOptions, c as ProvidedServerTransportOptions, n as ClientHandshakeOptions, C as Connection, q as ServerHandshakeOptions, T as Transport, x as SessionOptions, m as ClientTransportOptions, e as SessionNoConnection, y as SessionBoundSendFn } from '../handshake-B3iu79B0.cjs';
2
- import { C as ClientTransport } from '../client-BX3IXUA2.cjs';
3
- import { S as ServerTransport } from '../server-BV7GXuhz.cjs';
1
+ import { b as ProvidedClientTransportOptions, c as ProvidedServerTransportOptions, n as ClientHandshakeOptions, C as Connection, q as ServerHandshakeOptions, T as Transport, x as SessionOptions, m as ClientTransportOptions, e as SessionNoConnection, y as SessionBoundSendFn } from '../transport-CxT7y8Qk.cjs';
2
+ import { C as ClientTransport } from '../client-DXJRow2s.cjs';
3
+ import { S as ServerTransport } from '../server-BDSYa-CO.cjs';
4
4
  import { c as TransportClientId, e as PartialTransportMessage, b as OpaqueTransportMessage } from '../message-Dlsh5WDF.cjs';
5
5
  import { TSchema, Static } from '@sinclair/typebox';
6
- import { J as BaseErrorSchemaType, v as Readable, _ as ReadableIterator, w as ReadableResult } from '../services-BIMmk-v4.cjs';
6
+ import { J as BaseErrorSchemaType, v as Readable, _ as ReadableIterator, w as ReadableResult } from '../services-GJyw0jKV.cjs';
7
7
  import NodeWs from 'ws';
8
8
  import http from 'node:http';
9
9
  import { W as WsLike } from '../wslike-Dng9H1C7.cjs';
@@ -1,9 +1,9 @@
1
- import { b as ProvidedClientTransportOptions, c as ProvidedServerTransportOptions, n as ClientHandshakeOptions, C as Connection, q as ServerHandshakeOptions, T as Transport, x as SessionOptions, m as ClientTransportOptions, e as SessionNoConnection, y as SessionBoundSendFn } from '../handshake-DNinPBA3.js';
2
- import { C as ClientTransport } from '../client-CBak1h8Q.js';
3
- import { S as ServerTransport } from '../server-B_H1zn-R.js';
1
+ import { b as ProvidedClientTransportOptions, c as ProvidedServerTransportOptions, n as ClientHandshakeOptions, C as Connection, q as ServerHandshakeOptions, T as Transport, x as SessionOptions, m as ClientTransportOptions, e as SessionNoConnection, y as SessionBoundSendFn } from '../transport-pdbkDzmJ.js';
2
+ import { C as ClientTransport } from '../client-Dw0JBBs3.js';
3
+ import { S as ServerTransport } from '../server-DFOzjvLh.js';
4
4
  import { c as TransportClientId, e as PartialTransportMessage, b as OpaqueTransportMessage } from '../message-Dlsh5WDF.js';
5
5
  import { TSchema, Static } from '@sinclair/typebox';
6
- import { J as BaseErrorSchemaType, v as Readable, _ as ReadableIterator, w as ReadableResult } from '../services-DtsSIaec.js';
6
+ import { J as BaseErrorSchemaType, v as Readable, _ as ReadableIterator, w as ReadableResult } from '../services-DEubFUIR.js';
7
7
  import NodeWs from 'ws';
8
8
  import http from 'node:http';
9
9
  import { W as WsLike } from '../wslike-Dng9H1C7.js';
@@ -5,12 +5,12 @@ import {
5
5
  SessionStateGraph,
6
6
  defaultClientTransportOptions,
7
7
  defaultTransportOptions
8
- } from "../chunk-DVAIJ57I.js";
8
+ } from "../chunk-VQAPXMIR.js";
9
+ import "../chunk-CC7RN7GI.js";
9
10
  import {
10
11
  currentProtocolVersion,
11
12
  getTracer
12
- } from "../chunk-L3KNTJU3.js";
13
- import "../chunk-CC7RN7GI.js";
13
+ } from "../chunk-MIO5URHT.js";
14
14
 
15
15
  // testUtil/index.ts
16
16
  import NodeWs, { WebSocketServer } from "ws";
@@ -218,7 +218,8 @@ var defaultConnectionRetryOptions = {
218
218
  maxJitterMs: 200,
219
219
  maxBackoffMs: 32e3,
220
220
  attemptBudgetCapacity: 5,
221
- budgetRestoreIntervalMs: 200
221
+ budgetRestoreIntervalMs: 200,
222
+ isFatalConnectionError: () => false
222
223
  };
223
224
  var defaultClientTransportOptions = {
224
225
  ...defaultTransportOptions,
@@ -673,7 +674,7 @@ function coerceErrorString(err) {
673
674
  }
674
675
 
675
676
  // package.json
676
- var version = "0.209.2";
677
+ var version = "0.209.4";
677
678
 
678
679
  // tracing/index.ts
679
680
  function getPropagationContext(ctx) {
@@ -1853,10 +1854,18 @@ var ClientTransport = class extends Transport {
1853
1854
  const connectedSession = ClientSessionStateGraph.transition.HandshakingToConnected(session, {
1854
1855
  onConnectionErrored: (err) => {
1855
1856
  const errStr = coerceErrorString(err);
1856
- this.log?.warn(
1857
- `connection to ${connectedSession.to} errored: ${errStr}`,
1858
- connectedSession.loggingMetadata
1859
- );
1857
+ if (err instanceof Error && this.options.isFatalConnectionError(err)) {
1858
+ this.log?.warn(
1859
+ `connection to ${connectedSession.to} fatally errored: ${errStr}`,
1860
+ connectedSession.loggingMetadata
1861
+ );
1862
+ this.reconnectOnConnectionDrop = false;
1863
+ } else {
1864
+ this.log?.warn(
1865
+ `connection to ${connectedSession.to} errored: ${errStr}`,
1866
+ connectedSession.loggingMetadata
1867
+ );
1868
+ }
1860
1869
  },
1861
1870
  onConnectionClosed: () => {
1862
1871
  this.log?.info(
@@ -2054,6 +2063,15 @@ var ClientTransport = class extends Transport {
2054
2063
 
2055
2064
  // transport/impls/ws/connection.ts
2056
2065
  var WS_HEALTHY_CLOSE_CODE = 1e3;
2066
+ var WebSocketCloseError = class extends Error {
2067
+ code;
2068
+ reason;
2069
+ constructor(code, reason) {
2070
+ super(`websocket closed with code and reason: ${code} - ${reason}`);
2071
+ this.code = code;
2072
+ this.reason = reason;
2073
+ }
2074
+ };
2057
2075
  var WebSocketConnection = class extends Connection {
2058
2076
  ws;
2059
2077
  extras;
@@ -2075,9 +2093,7 @@ var WebSocketConnection = class extends Connection {
2075
2093
  };
2076
2094
  this.ws.onclose = ({ code, reason }) => {
2077
2095
  if (didError) {
2078
- const err = new Error(
2079
- `websocket closed with code and reason: ${code} - ${reason}`
2080
- );
2096
+ const err = new WebSocketCloseError(code, reason);
2081
2097
  this.onError(err);
2082
2098
  }
2083
2099
  this.onClose();