@replit/river 0.26.0 → 0.26.1

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 (52) hide show
  1. package/dist/{chunk-BNNELZM4.js → chunk-4W5LENT2.js} +2 -2
  2. package/dist/{chunk-5FDAIAQ5.js → chunk-6UVTCZ6K.js} +5 -5
  3. package/dist/chunk-6UVTCZ6K.js.map +1 -0
  4. package/dist/{chunk-KP4UB5NW.js → chunk-AYIMQWS7.js} +2 -2
  5. package/dist/{chunk-7ETNUCOL.js → chunk-IVNX5H6C.js} +19 -8
  6. package/dist/chunk-IVNX5H6C.js.map +1 -0
  7. package/dist/{chunk-JSU2KACV.js → chunk-M43R4RPL.js} +10 -4
  8. package/dist/chunk-M43R4RPL.js.map +1 -0
  9. package/dist/{chunk-CCUYKR5C.js → chunk-UQOD22AN.js} +2 -2
  10. package/dist/{chunk-CCUYKR5C.js.map → chunk-UQOD22AN.js.map} +1 -1
  11. package/dist/{chunk-5S64PXTU.js → chunk-XRI2BXMM.js} +23 -9
  12. package/dist/chunk-XRI2BXMM.js.map +1 -0
  13. package/dist/{client-162c509c.d.ts → client-0f636b3a.d.ts} +2 -2
  14. package/dist/{connection-6a404bb8.d.ts → connection-07e97a79.d.ts} +1 -1
  15. package/dist/{handshake-3342bb94.d.ts → handshake-8752f79e.d.ts} +9 -5
  16. package/dist/logging/index.d.cts +1 -1
  17. package/dist/logging/index.d.ts +1 -1
  18. package/dist/{message-1a434848.d.ts → message-57296605.d.ts} +2 -1
  19. package/dist/router/index.cjs +1 -1
  20. package/dist/router/index.cjs.map +1 -1
  21. package/dist/router/index.d.cts +8 -8
  22. package/dist/router/index.d.ts +8 -8
  23. package/dist/router/index.js +2 -2
  24. package/dist/{server-1b695374.d.ts → server-e304daec.d.ts} +2 -2
  25. package/dist/{services-c17f7eff.d.ts → services-fc99aae1.d.ts} +3 -3
  26. package/dist/transport/impls/ws/client.cjs +30 -10
  27. package/dist/transport/impls/ws/client.cjs.map +1 -1
  28. package/dist/transport/impls/ws/client.d.cts +4 -4
  29. package/dist/transport/impls/ws/client.d.ts +4 -4
  30. package/dist/transport/impls/ws/client.js +5 -5
  31. package/dist/transport/impls/ws/server.cjs +26 -9
  32. package/dist/transport/impls/ws/server.cjs.map +1 -1
  33. package/dist/transport/impls/ws/server.d.cts +4 -4
  34. package/dist/transport/impls/ws/server.d.ts +4 -4
  35. package/dist/transport/impls/ws/server.js +5 -5
  36. package/dist/transport/index.cjs +45 -14
  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 +5 -5
  41. package/dist/util/testHelpers.cjs +9 -3
  42. package/dist/util/testHelpers.cjs.map +1 -1
  43. package/dist/util/testHelpers.d.cts +4 -4
  44. package/dist/util/testHelpers.d.ts +4 -4
  45. package/dist/util/testHelpers.js +3 -3
  46. package/package.json +1 -1
  47. package/dist/chunk-5FDAIAQ5.js.map +0 -1
  48. package/dist/chunk-5S64PXTU.js.map +0 -1
  49. package/dist/chunk-7ETNUCOL.js.map +0 -1
  50. package/dist/chunk-JSU2KACV.js.map +0 -1
  51. /package/dist/{chunk-BNNELZM4.js.map → chunk-4W5LENT2.js.map} +0 -0
  52. /package/dist/{chunk-KP4UB5NW.js.map → chunk-AYIMQWS7.js.map} +0 -0
@@ -1,7 +1,7 @@
1
- import { C as ClientTransport } from '../../../client-162c509c.js';
2
- import { c as TransportClientId } from '../../../message-1a434848.js';
3
- import { b as ProvidedClientTransportOptions } from '../../../handshake-3342bb94.js';
4
- import { W as WebSocketConnection } from '../../../connection-6a404bb8.js';
1
+ import { C as ClientTransport } from '../../../client-0f636b3a.js';
2
+ import { c as TransportClientId } from '../../../message-57296605.js';
3
+ import { b as ProvidedClientTransportOptions } from '../../../handshake-8752f79e.js';
4
+ import { W as WebSocketConnection } from '../../../connection-07e97a79.js';
5
5
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
6
6
  import '@sinclair/typebox/value';
7
7
  import '@sinclair/typebox';
@@ -1,7 +1,7 @@
1
- import { C as ClientTransport } from '../../../client-162c509c.js';
2
- import { c as TransportClientId } from '../../../message-1a434848.js';
3
- import { b as ProvidedClientTransportOptions } from '../../../handshake-3342bb94.js';
4
- import { W as WebSocketConnection } from '../../../connection-6a404bb8.js';
1
+ import { C as ClientTransport } from '../../../client-0f636b3a.js';
2
+ import { c as TransportClientId } from '../../../message-57296605.js';
3
+ import { b as ProvidedClientTransportOptions } from '../../../handshake-8752f79e.js';
4
+ import { W as WebSocketConnection } from '../../../connection-07e97a79.js';
5
5
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
6
6
  import '@sinclair/typebox/value';
7
7
  import '@sinclair/typebox';
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ClientTransport
3
- } from "../../../chunk-5S64PXTU.js";
3
+ } from "../../../chunk-XRI2BXMM.js";
4
4
  import {
5
5
  WebSocketConnection
6
- } from "../../../chunk-KP4UB5NW.js";
7
- import "../../../chunk-5FDAIAQ5.js";
6
+ } from "../../../chunk-AYIMQWS7.js";
7
+ import "../../../chunk-6UVTCZ6K.js";
8
8
  import "../../../chunk-TAH2GVTJ.js";
9
- import "../../../chunk-JSU2KACV.js";
10
- import "../../../chunk-CCUYKR5C.js";
9
+ import "../../../chunk-M43R4RPL.js";
10
+ import "../../../chunk-UQOD22AN.js";
11
11
  import "../../../chunk-4PVU7J25.js";
12
12
 
13
13
  // transport/impls/ws/client.ts
@@ -645,7 +645,7 @@ var SessionNoConnection = class extends IdentifiedSession {
645
645
  var import_api = require("@opentelemetry/api");
646
646
 
647
647
  // package.json
648
- var version = "0.26.0";
648
+ var version = "0.26.1";
649
649
 
650
650
  // tracing/index.ts
651
651
  function createSessionTelemetryInfo(sessionId, to, from, propagationCtx) {
@@ -687,7 +687,10 @@ var SessionWaitingForHandshake = class extends CommonSession {
687
687
  onHandshakeData = (msg) => {
688
688
  const parsedMsg = this.parseMsg(msg);
689
689
  if (parsedMsg === null) {
690
- this.listeners.onInvalidHandshake("could not parse message");
690
+ this.listeners.onInvalidHandshake(
691
+ "could not parse message",
692
+ "MALFORMED_HANDSHAKE"
693
+ );
691
694
  return;
692
695
  }
693
696
  this.listeners.onHandshake(parsedMsg);
@@ -733,7 +736,10 @@ var SessionHandshaking = class extends IdentifiedSession {
733
736
  onHandshakeData = (msg) => {
734
737
  const parsedMsg = this.parseMsg(msg);
735
738
  if (parsedMsg === null) {
736
- this.listeners.onInvalidHandshake("could not parse message");
739
+ this.listeners.onInvalidHandshake(
740
+ "could not parse message",
741
+ "MALFORMED_HANDSHAKE"
742
+ );
737
743
  return;
738
744
  }
739
745
  this.listeners.onHandshake(parsedMsg);
@@ -1223,8 +1229,8 @@ var Transport = class {
1223
1229
  removeEventListener(type, handler) {
1224
1230
  this.eventDispatcher.removeEventListener(type, handler);
1225
1231
  }
1226
- protocolError(type, message) {
1227
- this.eventDispatcher.dispatchEvent("protocolError", { type, message });
1232
+ protocolError(message) {
1233
+ this.eventDispatcher.dispatchEvent("protocolError", message);
1228
1234
  }
1229
1235
  /**
1230
1236
  * Default close implementation for transports. You should override this in the downstream
@@ -1429,13 +1435,17 @@ var ServerTransport = class extends Transport {
1429
1435
  receivedHandshake = true;
1430
1436
  void this.onHandshakeRequest(pendingSession, msg);
1431
1437
  },
1432
- onInvalidHandshake: (reason) => {
1438
+ onInvalidHandshake: (reason, code) => {
1433
1439
  this.log?.error(
1434
1440
  `invalid handshake: ${reason}`,
1435
1441
  pendingSession.loggingMetadata
1436
1442
  );
1437
1443
  this.deletePendingSession(pendingSession);
1438
- this.protocolError(ProtocolError.HandshakeFailed, reason);
1444
+ this.protocolError({
1445
+ type: ProtocolError.HandshakeFailed,
1446
+ code,
1447
+ message: reason
1448
+ });
1439
1449
  }
1440
1450
  },
1441
1451
  this.options,
@@ -1460,7 +1470,11 @@ var ServerTransport = class extends Transport {
1460
1470
  }
1461
1471
  })
1462
1472
  );
1463
- this.protocolError(ProtocolError.HandshakeFailed, reason);
1473
+ this.protocolError({
1474
+ type: ProtocolError.HandshakeFailed,
1475
+ code,
1476
+ message: reason
1477
+ });
1464
1478
  this.deletePendingSession(session);
1465
1479
  }
1466
1480
  async onHandshakeRequest(session, msg) {
@@ -1622,7 +1636,10 @@ var ServerTransport = class extends Transport {
1622
1636
  },
1623
1637
  onMessage: (msg2) => this.handleMsg(msg2),
1624
1638
  onInvalidMessage: (reason) => {
1625
- this.protocolError(ProtocolError.MessageOrderingViolated, reason);
1639
+ this.protocolError({
1640
+ type: ProtocolError.MessageOrderingViolated,
1641
+ message: reason
1642
+ });
1626
1643
  this.deleteSession(connectedSession);
1627
1644
  }
1628
1645
  }