@replit/river 0.25.2 → 0.26.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 (50) hide show
  1. package/dist/{chunk-PF74DCPQ.js → chunk-5FDAIAQ5.js} +3 -3
  2. package/dist/{chunk-ONIPHO7J.js → chunk-5S64PXTU.js} +4 -4
  3. package/dist/{chunk-QXMZJ7LF.js → chunk-7ETNUCOL.js} +41 -40
  4. package/dist/chunk-7ETNUCOL.js.map +1 -0
  5. package/dist/{chunk-GDHQCPWW.js → chunk-BNNELZM4.js} +2 -2
  6. package/dist/{chunk-GDHQCPWW.js.map → chunk-BNNELZM4.js.map} +1 -1
  7. package/dist/{chunk-EHD2JJBW.js → chunk-CCUYKR5C.js} +14 -4
  8. package/dist/chunk-CCUYKR5C.js.map +1 -0
  9. package/dist/{chunk-Q3PZBJXR.js → chunk-JSU2KACV.js} +2 -2
  10. package/dist/{chunk-ZWMWRM23.js → chunk-KP4UB5NW.js} +2 -2
  11. package/dist/{client-edc8e2de.d.ts → client-162c509c.d.ts} +2 -2
  12. package/dist/{connection-ef50ac3a.d.ts → connection-6a404bb8.d.ts} +1 -1
  13. package/dist/{handshake-12d57161.d.ts → handshake-3342bb94.d.ts} +2 -2
  14. package/dist/logging/index.d.cts +1 -1
  15. package/dist/logging/index.d.ts +1 -1
  16. package/dist/{message-e6c560fd.d.ts → message-1a434848.d.ts} +2 -1
  17. package/dist/router/index.cjs +12 -3
  18. package/dist/router/index.cjs.map +1 -1
  19. package/dist/router/index.d.cts +8 -8
  20. package/dist/router/index.d.ts +8 -8
  21. package/dist/router/index.js +2 -2
  22. package/dist/{server-f8228636.d.ts → server-1b695374.d.ts} +2 -2
  23. package/dist/{services-4b9e5232.d.ts → services-c17f7eff.d.ts} +3 -3
  24. package/dist/transport/impls/ws/client.cjs +12 -3
  25. package/dist/transport/impls/ws/client.cjs.map +1 -1
  26. package/dist/transport/impls/ws/client.d.cts +4 -4
  27. package/dist/transport/impls/ws/client.d.ts +4 -4
  28. package/dist/transport/impls/ws/client.js +5 -5
  29. package/dist/transport/impls/ws/server.cjs +48 -39
  30. package/dist/transport/impls/ws/server.cjs.map +1 -1
  31. package/dist/transport/impls/ws/server.d.cts +4 -4
  32. package/dist/transport/impls/ws/server.d.ts +4 -4
  33. package/dist/transport/impls/ws/server.js +5 -5
  34. package/dist/transport/index.cjs +48 -39
  35. package/dist/transport/index.cjs.map +1 -1
  36. package/dist/transport/index.d.cts +4 -4
  37. package/dist/transport/index.d.ts +4 -4
  38. package/dist/transport/index.js +5 -5
  39. package/dist/util/testHelpers.cjs +12 -3
  40. package/dist/util/testHelpers.cjs.map +1 -1
  41. package/dist/util/testHelpers.d.cts +4 -4
  42. package/dist/util/testHelpers.d.ts +4 -4
  43. package/dist/util/testHelpers.js +3 -3
  44. package/package.json +1 -1
  45. package/dist/chunk-EHD2JJBW.js.map +0 -1
  46. package/dist/chunk-QXMZJ7LF.js.map +0 -1
  47. /package/dist/{chunk-PF74DCPQ.js.map → chunk-5FDAIAQ5.js.map} +0 -0
  48. /package/dist/{chunk-ONIPHO7J.js.map → chunk-5S64PXTU.js.map} +0 -0
  49. /package/dist/{chunk-Q3PZBJXR.js.map → chunk-JSU2KACV.js.map} +0 -0
  50. /package/dist/{chunk-ZWMWRM23.js.map → chunk-KP4UB5NW.js.map} +0 -0
@@ -1,9 +1,9 @@
1
- import { c as TransportClientId } from '../../../message-e6c560fd.js';
1
+ import { c as TransportClientId } from '../../../message-1a434848.js';
2
2
  import { WebSocketServer } from 'ws';
3
- import { W as WebSocketConnection } from '../../../connection-ef50ac3a.js';
3
+ import { W as WebSocketConnection } from '../../../connection-6a404bb8.js';
4
4
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
5
- import { S as ServerTransport } from '../../../server-f8228636.js';
6
- import { c as ProvidedServerTransportOptions } from '../../../handshake-12d57161.js';
5
+ import { S as ServerTransport } from '../../../server-1b695374.js';
6
+ import { c as ProvidedServerTransportOptions } from '../../../handshake-3342bb94.js';
7
7
  import '@sinclair/typebox/value';
8
8
  import '@sinclair/typebox';
9
9
  import '@opentelemetry/api';
@@ -1,9 +1,9 @@
1
- import { c as TransportClientId } from '../../../message-e6c560fd.js';
1
+ import { c as TransportClientId } from '../../../message-1a434848.js';
2
2
  import { WebSocketServer } from 'ws';
3
- import { W as WebSocketConnection } from '../../../connection-ef50ac3a.js';
3
+ import { W as WebSocketConnection } from '../../../connection-6a404bb8.js';
4
4
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
5
- import { S as ServerTransport } from '../../../server-f8228636.js';
6
- import { c as ProvidedServerTransportOptions } from '../../../handshake-12d57161.js';
5
+ import { S as ServerTransport } from '../../../server-1b695374.js';
6
+ import { c as ProvidedServerTransportOptions } from '../../../handshake-3342bb94.js';
7
7
  import '@sinclair/typebox/value';
8
8
  import '@sinclair/typebox';
9
9
  import '@opentelemetry/api';
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ServerTransport
3
- } from "../../../chunk-QXMZJ7LF.js";
3
+ } from "../../../chunk-7ETNUCOL.js";
4
4
  import {
5
5
  WebSocketConnection
6
- } from "../../../chunk-ZWMWRM23.js";
7
- import "../../../chunk-PF74DCPQ.js";
6
+ } from "../../../chunk-KP4UB5NW.js";
7
+ import "../../../chunk-5FDAIAQ5.js";
8
8
  import "../../../chunk-TAH2GVTJ.js";
9
- import "../../../chunk-Q3PZBJXR.js";
10
- import "../../../chunk-EHD2JJBW.js";
9
+ import "../../../chunk-JSU2KACV.js";
10
+ import "../../../chunk-CCUYKR5C.js";
11
11
  import "../../../chunk-4PVU7J25.js";
12
12
 
13
13
  // transport/impls/ws/server.ts
@@ -255,11 +255,20 @@ var ControlMessageHandshakeRequestSchema = import_typebox.Type.Object({
255
255
  var HandshakeErrorRetriableResponseCodes = import_typebox.Type.Union([
256
256
  import_typebox.Type.Literal("SESSION_STATE_MISMATCH")
257
257
  ]);
258
+ var HandshakeErrorCustomHandlerFatalResponseCodes = import_typebox.Type.Union([
259
+ // The custom validation handler rejected the handler because the client is unsupported.
260
+ import_typebox.Type.Literal("REJECTED_UNSUPPORTED_CLIENT"),
261
+ // The custom validation handler rejected the handshake.
262
+ import_typebox.Type.Literal("REJECTED_BY_CUSTOM_HANDLER")
263
+ ]);
258
264
  var HandshakeErrorFatalResponseCodes = import_typebox.Type.Union([
265
+ HandshakeErrorCustomHandlerFatalResponseCodes,
266
+ // The ciient sent a handshake that doesn't comply with the extended handshake metadata.
259
267
  import_typebox.Type.Literal("MALFORMED_HANDSHAKE_META"),
268
+ // The ciient sent a handshake that doesn't comply with ControlMessageHandshakeRequestSchema.
260
269
  import_typebox.Type.Literal("MALFORMED_HANDSHAKE"),
261
- import_typebox.Type.Literal("PROTOCOL_VERSION_MISMATCH"),
262
- import_typebox.Type.Literal("REJECTED_BY_CUSTOM_HANDLER")
270
+ // The client's protocol version does not match the server's.
271
+ import_typebox.Type.Literal("PROTOCOL_VERSION_MISMATCH")
263
272
  ]);
264
273
  var HandshakeErrorResponseCodes = import_typebox.Type.Union([
265
274
  HandshakeErrorRetriableResponseCodes,
@@ -564,7 +573,7 @@ var SessionNoConnection = class extends IdentifiedSession {
564
573
  var import_api = require("@opentelemetry/api");
565
574
 
566
575
  // package.json
567
- var version = "0.25.2";
576
+ var version = "0.26.0";
568
577
 
569
578
  // tracing/index.ts
570
579
  function getPropagationContext(ctx) {
@@ -1947,43 +1956,43 @@ var ServerTransport = class extends Transport {
1947
1956
  connectedSession.startActiveHeartbeat();
1948
1957
  }
1949
1958
  async validateHandshakeMetadata(handshakingSession, existingSession, rawMetadata, from) {
1950
- let parsedMetadata = {};
1951
- if (this.handshakeExtensions) {
1952
- if (!import_value3.Value.Check(this.handshakeExtensions.schema, rawMetadata)) {
1953
- this.rejectHandshakeRequest(
1954
- handshakingSession,
1955
- from,
1956
- "received malformed handshake metadata",
1957
- "MALFORMED_HANDSHAKE_META",
1958
- {
1959
- ...handshakingSession.loggingMetadata,
1960
- connectedTo: from,
1961
- validationErrors: [
1962
- ...import_value3.Value.Errors(this.handshakeExtensions.schema, rawMetadata)
1963
- ]
1964
- }
1965
- );
1966
- return false;
1967
- }
1968
- const previousParsedMetadata = existingSession ? this.sessionHandshakeMetadata.get(existingSession.to) : void 0;
1969
- parsedMetadata = await this.handshakeExtensions.validate(
1970
- rawMetadata,
1971
- previousParsedMetadata
1959
+ if (!this.handshakeExtensions) {
1960
+ return {};
1961
+ }
1962
+ if (!import_value3.Value.Check(this.handshakeExtensions.schema, rawMetadata)) {
1963
+ this.rejectHandshakeRequest(
1964
+ handshakingSession,
1965
+ from,
1966
+ "received malformed handshake metadata",
1967
+ "MALFORMED_HANDSHAKE_META",
1968
+ {
1969
+ ...handshakingSession.loggingMetadata,
1970
+ connectedTo: from,
1971
+ validationErrors: [
1972
+ ...import_value3.Value.Errors(this.handshakeExtensions.schema, rawMetadata)
1973
+ ]
1974
+ }
1972
1975
  );
1973
- if (parsedMetadata === false) {
1974
- this.rejectHandshakeRequest(
1975
- handshakingSession,
1976
- from,
1977
- "rejected by handshake handler",
1978
- "REJECTED_BY_CUSTOM_HANDLER",
1979
- {
1980
- ...handshakingSession.loggingMetadata,
1981
- connectedTo: from,
1982
- clientId: this.clientId
1983
- }
1984
- );
1985
- return false;
1986
- }
1976
+ return false;
1977
+ }
1978
+ const previousParsedMetadata = existingSession ? this.sessionHandshakeMetadata.get(existingSession.to) : void 0;
1979
+ const parsedMetadata = await this.handshakeExtensions.validate(
1980
+ rawMetadata,
1981
+ previousParsedMetadata
1982
+ );
1983
+ if (import_value3.Value.Check(HandshakeErrorCustomHandlerFatalResponseCodes, parsedMetadata)) {
1984
+ this.rejectHandshakeRequest(
1985
+ handshakingSession,
1986
+ from,
1987
+ "rejected by handshake handler",
1988
+ parsedMetadata,
1989
+ {
1990
+ ...handshakingSession.loggingMetadata,
1991
+ connectedTo: from,
1992
+ clientId: this.clientId
1993
+ }
1994
+ );
1995
+ return false;
1987
1996
  }
1988
1997
  return parsedMetadata;
1989
1998
  }