@replit/river 0.202.0 → 0.203.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.
Files changed (44) hide show
  1. package/dist/{chunk-2T22KY5X.js → chunk-D5EIDBUT.js} +3 -3
  2. package/dist/{chunk-NSH4D6OB.js → chunk-DGT3MPD4.js} +13 -3
  3. package/dist/chunk-DGT3MPD4.js.map +1 -0
  4. package/dist/{chunk-W4AGHFXK.js → chunk-FG22HHCY.js} +11 -4
  5. package/dist/chunk-FG22HHCY.js.map +1 -0
  6. package/dist/{chunk-QMXUCLGE.js → chunk-SZHNMLKC.js} +2 -2
  7. package/dist/{chunk-QMXUCLGE.js.map → chunk-SZHNMLKC.js.map} +1 -1
  8. package/dist/{chunk-BDUOHZMF.js → chunk-XBPEUVWN.js} +2 -2
  9. package/dist/{client-a32692b0.d.ts → client-5d2e41a3.d.ts} +7 -1
  10. package/dist/{connection-48d021ca.d.ts → connection-11a4af0f.d.ts} +1 -1
  11. package/dist/{context-8d263a7f.d.ts → context-d6dd8a1a.d.ts} +14 -0
  12. package/dist/router/index.cjs +8 -7
  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 +8 -7
  17. package/dist/router/index.js.map +1 -1
  18. package/dist/{server-48d90a77.d.ts → server-e46399f9.d.ts} +1 -1
  19. package/dist/{services-a05f5174.d.ts → services-56cbea0d.d.ts} +2 -2
  20. package/dist/testUtil/index.cjs +20 -3
  21. package/dist/testUtil/index.cjs.map +1 -1
  22. package/dist/testUtil/index.d.cts +5 -5
  23. package/dist/testUtil/index.d.ts +5 -5
  24. package/dist/testUtil/index.js +4 -4
  25. package/dist/transport/impls/ws/client.cjs +20 -3
  26. package/dist/transport/impls/ws/client.cjs.map +1 -1
  27. package/dist/transport/impls/ws/client.d.cts +3 -3
  28. package/dist/transport/impls/ws/client.d.ts +3 -3
  29. package/dist/transport/impls/ws/client.js +4 -4
  30. package/dist/transport/impls/ws/server.cjs +10 -3
  31. package/dist/transport/impls/ws/server.cjs.map +1 -1
  32. package/dist/transport/impls/ws/server.d.cts +3 -3
  33. package/dist/transport/impls/ws/server.d.ts +3 -3
  34. package/dist/transport/impls/ws/server.js +4 -4
  35. package/dist/transport/index.cjs +20 -3
  36. package/dist/transport/index.cjs.map +1 -1
  37. package/dist/transport/index.d.cts +4 -4
  38. package/dist/transport/index.d.ts +4 -4
  39. package/dist/transport/index.js +4 -4
  40. package/package.json +1 -1
  41. package/dist/chunk-NSH4D6OB.js.map +0 -1
  42. package/dist/chunk-W4AGHFXK.js.map +0 -1
  43. /package/dist/{chunk-2T22KY5X.js.map → chunk-D5EIDBUT.js.map} +0 -0
  44. /package/dist/{chunk-BDUOHZMF.js.map → chunk-XBPEUVWN.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { c as TransportClientId } from '../../../message-3def9ded.js';
2
2
  import { WebSocketServer } from 'ws';
3
- import { W as WebSocketConnection } from '../../../connection-48d021ca.js';
3
+ import { W as WebSocketConnection } from '../../../connection-11a4af0f.js';
4
4
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
5
- import { S as ServerTransport } from '../../../server-48d90a77.js';
6
- import { c as ProvidedServerTransportOptions } from '../../../context-8d263a7f.js';
5
+ import { S as ServerTransport } from '../../../server-e46399f9.js';
6
+ import { c as ProvidedServerTransportOptions } from '../../../context-d6dd8a1a.js';
7
7
  import { IncomingMessage } from 'http';
8
8
  import '@sinclair/typebox/value';
9
9
  import '@sinclair/typebox';
@@ -1,9 +1,9 @@
1
1
  import { c as TransportClientId } from '../../../message-3def9ded.js';
2
2
  import { WebSocketServer } from 'ws';
3
- import { W as WebSocketConnection } from '../../../connection-48d021ca.js';
3
+ import { W as WebSocketConnection } from '../../../connection-11a4af0f.js';
4
4
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
5
- import { S as ServerTransport } from '../../../server-48d90a77.js';
6
- import { c as ProvidedServerTransportOptions } from '../../../context-8d263a7f.js';
5
+ import { S as ServerTransport } from '../../../server-e46399f9.js';
6
+ import { c as ProvidedServerTransportOptions } from '../../../context-d6dd8a1a.js';
7
7
  import { IncomingMessage } from 'http';
8
8
  import '@sinclair/typebox/value';
9
9
  import '@sinclair/typebox';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ServerTransport
3
- } from "../../../chunk-2T22KY5X.js";
3
+ } from "../../../chunk-D5EIDBUT.js";
4
4
  import {
5
5
  WebSocketConnection
6
- } from "../../../chunk-BDUOHZMF.js";
7
- import "../../../chunk-W4AGHFXK.js";
8
- import "../../../chunk-QMXUCLGE.js";
6
+ } from "../../../chunk-XBPEUVWN.js";
7
+ import "../../../chunk-FG22HHCY.js";
8
+ import "../../../chunk-SZHNMLKC.js";
9
9
  import "../../../chunk-LHH5LQ7C.js";
10
10
  import "../../../chunk-AJGIY2UB.js";
11
11
 
@@ -367,6 +367,14 @@ var StateMachineState = class {
367
367
  * and we've moved on to another state
368
368
  */
369
369
  _isConsumed;
370
+ /**
371
+ * Cleanup this state machine state and mark it as consumed.
372
+ * After calling close, it is an error to access any properties on the state.
373
+ * You should never need to call this as a consumer.
374
+ *
375
+ * If you're looking to close the session from the client,
376
+ * use `.hardDisconnect` on the client transport.
377
+ */
370
378
  close() {
371
379
  this._handleClose();
372
380
  }
@@ -421,9 +429,8 @@ var CommonSession = class extends StateMachineState {
421
429
  parseMsg(msg) {
422
430
  const parsedMsg = this.options.codec.fromBuffer(msg);
423
431
  if (parsedMsg === null) {
424
- const decodedBuffer = new TextDecoder().decode(Buffer.from(msg));
425
432
  this.log?.error(
426
- `received malformed msg: ${decodedBuffer}`,
433
+ `received malformed msg: ${Buffer.from(msg).toString("base64")}`,
427
434
  this.loggingMetadata
428
435
  );
429
436
  return null;
@@ -603,7 +610,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
603
610
  var import_api = require("@opentelemetry/api");
604
611
 
605
612
  // package.json
606
- var version = "0.202.0";
613
+ var version = "0.203.0";
607
614
 
608
615
  // tracing/index.ts
609
616
  function getPropagationContext(ctx) {
@@ -1744,6 +1751,16 @@ var ClientTransport = class extends Transport {
1744
1751
  );
1745
1752
  this.updateSession(backingOffSession);
1746
1753
  }
1754
+ /**
1755
+ * Manually kills all sessions to the server (including all pending state).
1756
+ * This is useful for when you want to close all connections to a server
1757
+ * and don't want to wait for the grace period to elapse.
1758
+ */
1759
+ hardDisconnect() {
1760
+ for (const session of this.sessions.values()) {
1761
+ this.deleteSession(session);
1762
+ }
1763
+ }
1747
1764
  onBackoffFinished(session) {
1748
1765
  const connPromise = tracing_default.startActiveSpan("connect", async (span) => {
1749
1766
  try {