@replit/river 0.26.3 → 0.26.5

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 (43) hide show
  1. package/dist/{chunk-MZELCWJK.js → chunk-7KB7DHFZ.js} +4 -9
  2. package/dist/chunk-7KB7DHFZ.js.map +1 -0
  3. package/dist/{chunk-X35QRIA5.js → chunk-AZ3ILPXP.js} +5 -5
  4. package/dist/chunk-AZ3ILPXP.js.map +1 -0
  5. package/dist/{chunk-3JCZNGF7.js → chunk-FA2IRWCM.js} +2 -2
  6. package/dist/{chunk-JI6FFDY5.js → chunk-IPOUVVKT.js} +3 -3
  7. package/dist/{chunk-BB2E5L4U.js → chunk-PZEYFHAB.js} +24 -24
  8. package/dist/chunk-PZEYFHAB.js.map +1 -0
  9. package/dist/{chunk-ZY2HYJ5Y.js → chunk-QEWSUVWV.js} +2 -2
  10. package/dist/{chunk-ZY2HYJ5Y.js.map → chunk-QEWSUVWV.js.map} +1 -1
  11. package/dist/{chunk-OCL2FUTQ.js → chunk-XRZ52TYH.js} +15 -13
  12. package/dist/{chunk-OCL2FUTQ.js.map → chunk-XRZ52TYH.js.map} +1 -1
  13. package/dist/{client-1894a9c9.d.ts → client-6c67339a.d.ts} +1 -1
  14. package/dist/router/index.cjs +3 -8
  15. package/dist/router/index.cjs.map +1 -1
  16. package/dist/router/index.d.cts +4 -4
  17. package/dist/router/index.d.ts +4 -4
  18. package/dist/router/index.js +2 -2
  19. package/dist/{services-491d8c32.d.ts → services-6140f578.d.ts} +1 -1
  20. package/dist/transport/impls/ws/client.cjs +36 -39
  21. package/dist/transport/impls/ws/client.cjs.map +1 -1
  22. package/dist/transport/impls/ws/client.d.cts +1 -1
  23. package/dist/transport/impls/ws/client.d.ts +1 -1
  24. package/dist/transport/impls/ws/client.js +5 -5
  25. package/dist/transport/impls/ws/server.cjs +17 -20
  26. package/dist/transport/impls/ws/server.cjs.map +1 -1
  27. package/dist/transport/impls/ws/server.js +5 -5
  28. package/dist/transport/index.cjs +37 -40
  29. package/dist/transport/index.cjs.map +1 -1
  30. package/dist/transport/index.d.cts +1 -1
  31. package/dist/transport/index.d.ts +1 -1
  32. package/dist/transport/index.js +5 -5
  33. package/dist/util/testHelpers.cjs +16 -19
  34. package/dist/util/testHelpers.cjs.map +1 -1
  35. package/dist/util/testHelpers.d.cts +2 -2
  36. package/dist/util/testHelpers.d.ts +2 -2
  37. package/dist/util/testHelpers.js +3 -3
  38. package/package.json +1 -1
  39. package/dist/chunk-BB2E5L4U.js.map +0 -1
  40. package/dist/chunk-MZELCWJK.js.map +0 -1
  41. package/dist/chunk-X35QRIA5.js.map +0 -1
  42. /package/dist/{chunk-3JCZNGF7.js.map → chunk-FA2IRWCM.js.map} +0 -0
  43. /package/dist/{chunk-JI6FFDY5.js.map → chunk-IPOUVVKT.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  export { b as ClientTransportOptions, C as Connection, j as EventHandler, E as EventMap, i as EventTypes, k as ProtocolError, l as ProtocolErrorType, c as ServerTransportOptions, S as Session, h as SessionConnected, f as SessionConnecting, g as SessionHandshaking, e as SessionNoConnection, d as SessionState, T as Transport, P as TransportOptions, a as TransportStatus } from '../handshake-154a0bb2.js';
2
- export { C as ClientTransport } from '../client-1894a9c9.js';
2
+ export { C as ClientTransport } from '../client-6c67339a.js';
3
3
  export { S as ServerTransport, a as SessionWaitingForHandshake } from '../server-1f5eb427.js';
4
4
  export { b as OpaqueTransportMessage, O as OpaqueTransportMessageSchema, c as TransportClientId, a as TransportMessage, T as TransportMessageSchema, d as isStreamClose, i as isStreamOpen } from '../message-ff78a233.js';
5
5
  import '@sinclair/typebox';
@@ -1,5 +1,5 @@
1
1
  export { b as ClientTransportOptions, C as Connection, j as EventHandler, E as EventMap, i as EventTypes, k as ProtocolError, l as ProtocolErrorType, c as ServerTransportOptions, S as Session, h as SessionConnected, f as SessionConnecting, g as SessionHandshaking, e as SessionNoConnection, d as SessionState, T as Transport, P as TransportOptions, a as TransportStatus } from '../handshake-154a0bb2.js';
2
- export { C as ClientTransport } from '../client-1894a9c9.js';
2
+ export { C as ClientTransport } from '../client-6c67339a.js';
3
3
  export { S as ServerTransport, a as SessionWaitingForHandshake } from '../server-1f5eb427.js';
4
4
  export { b as OpaqueTransportMessage, O as OpaqueTransportMessageSchema, c as TransportClientId, a as TransportMessage, T as TransportMessageSchema, d as isStreamClose, i as isStreamOpen } from '../message-ff78a233.js';
5
5
  import '@sinclair/typebox';
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  ClientTransport
3
- } from "../chunk-BB2E5L4U.js";
3
+ } from "../chunk-PZEYFHAB.js";
4
4
  import {
5
5
  ServerTransport
6
- } from "../chunk-X35QRIA5.js";
6
+ } from "../chunk-AZ3ILPXP.js";
7
7
  import {
8
8
  Connection,
9
9
  ProtocolError,
10
10
  Transport
11
- } from "../chunk-JI6FFDY5.js";
11
+ } from "../chunk-IPOUVVKT.js";
12
12
  import "../chunk-TAH2GVTJ.js";
13
13
  import {
14
14
  SessionState
15
- } from "../chunk-OCL2FUTQ.js";
15
+ } from "../chunk-XRZ52TYH.js";
16
16
  import {
17
17
  OpaqueTransportMessageSchema,
18
18
  TransportMessageSchema
19
- } from "../chunk-MZELCWJK.js";
19
+ } from "../chunk-7KB7DHFZ.js";
20
20
  import "../chunk-4PVU7J25.js";
21
21
  export {
22
22
  ClientTransport,
@@ -380,10 +380,7 @@ var ControlMessageHandshakeRequestSchema = import_typebox.Type.Object({
380
380
  expectedSessionState: import_typebox.Type.Object({
381
381
  // what the client expects the server to send next
382
382
  nextExpectedSeq: import_typebox.Type.Integer(),
383
- // TODO: remove optional once we know all servers
384
- // are nextSentSeq here
385
- // what the server expects the client to send next
386
- nextSentSeq: import_typebox.Type.Optional(import_typebox.Type.Integer())
383
+ nextSentSeq: import_typebox.Type.Integer()
387
384
  }),
388
385
  metadata: import_typebox.Type.Optional(import_typebox.Type.Unknown())
389
386
  });
@@ -419,9 +416,7 @@ var ControlMessageHandshakeResponseSchema = import_typebox.Type.Object({
419
416
  import_typebox.Type.Object({
420
417
  ok: import_typebox.Type.Literal(false),
421
418
  reason: import_typebox.Type.String(),
422
- // TODO: remove optional once we know all servers
423
- // are sending code here
424
- code: import_typebox.Type.Optional(HandshakeErrorResponseCodes)
419
+ code: HandshakeErrorResponseCodes
425
420
  })
426
421
  ])
427
422
  });
@@ -460,7 +455,7 @@ function Err(error) {
460
455
  var import_api = require("@opentelemetry/api");
461
456
 
462
457
  // package.json
463
- var version = "0.26.3";
458
+ var version = "0.26.5";
464
459
 
465
460
  // tracing/index.ts
466
461
  function createSessionTelemetryInfo(sessionId, to, from, propagationCtx) {
@@ -749,9 +744,6 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
749
744
  super(props);
750
745
  this.connPromise = props.connPromise;
751
746
  this.listeners = props.listeners;
752
- this.connectionTimeout = setTimeout(() => {
753
- this.listeners.onConnectionTimeout();
754
- }, this.options.connectionTimeoutMs);
755
747
  this.connPromise.then(
756
748
  (conn) => {
757
749
  if (this._isConsumed)
@@ -764,16 +756,21 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
764
756
  this.listeners.onConnectionFailed(err);
765
757
  }
766
758
  );
759
+ this.connectionTimeout = setTimeout(() => {
760
+ this.listeners.onConnectionTimeout();
761
+ }, this.options.connectionTimeoutMs);
767
762
  }
768
763
  // close a pending connection if it resolves, ignore errors if the promise
769
764
  // ends up rejected anyways
770
765
  bestEffortClose() {
771
- void this.connPromise.then((conn) => {
766
+ const logger = this.log;
767
+ const metadata = this.loggingMetadata;
768
+ this.connPromise.then((conn) => {
772
769
  conn.close();
773
- this.log?.info(
770
+ logger?.info(
774
771
  "connection eventually resolved but session has transitioned, closed connection",
775
772
  {
776
- ...this.loggingMetadata,
773
+ ...metadata,
777
774
  ...conn.loggingMetadata
778
775
  }
779
776
  );
@@ -935,13 +932,13 @@ var SessionConnected = class extends IdentifiedSession {
935
932
  this.conn.addCloseListener(this.listeners.onConnectionClosed);
936
933
  this.conn.addErrorListener(this.listeners.onConnectionErrored);
937
934
  if (this.sendBuffer.length > 0) {
938
- this.log?.debug(
939
- `sending ${this.sendBuffer.length} buffered messages`,
935
+ this.log?.info(
936
+ `sending ${this.sendBuffer.length} buffered messages, starting at seq ${this.nextSeq()}`,
940
937
  this.loggingMetadata
941
938
  );
942
- }
943
- for (const msg of this.sendBuffer) {
944
- this.conn.send(this.options.codec.toBuffer(msg));
939
+ for (const msg of this.sendBuffer) {
940
+ this.conn.send(this.options.codec.toBuffer(msg));
941
+ }
945
942
  }
946
943
  this.isActivelyHeartbeating = false;
947
944
  this.heartbeatHandle = setInterval(() => {