@replit/river 0.208.3 → 0.209.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 (59) hide show
  1. package/README.md +36 -1
  2. package/dist/{adapter-ChksXKVN.d.ts → adapter-Cp7_gIVA.d.ts} +1 -1
  3. package/dist/{adapter-Cuc4JtfV.d.cts → adapter-DjiEwOYi.d.cts} +1 -1
  4. package/dist/{chunk-M2B4PVR5.js → chunk-LPWARXI3.js} +2 -2
  5. package/dist/{chunk-JC4XN6NC.js → chunk-RATCBAZE.js} +199 -170
  6. package/dist/chunk-RATCBAZE.js.map +1 -0
  7. package/dist/{chunk-3WYK5ZRT.js → chunk-TVN2TB6X.js} +2 -2
  8. package/dist/{chunk-3WYK5ZRT.js.map → chunk-TVN2TB6X.js.map} +1 -1
  9. package/dist/client-BzJwq-hg.d.ts +54 -0
  10. package/dist/client-aETS93z1.d.cts +54 -0
  11. package/dist/codec/index.d.cts +3 -3
  12. package/dist/codec/index.d.ts +3 -3
  13. package/dist/codec/index.js +2 -2
  14. package/dist/{connection-Donr3JRB.d.ts → connection-b1wd5XrC.d.ts} +3 -3
  15. package/dist/{connection-BF4zg6Qv.d.cts → connection-hUWlS-hg.d.cts} +3 -3
  16. package/dist/{index-D8IOd3LG.d.ts → index-CSM8soK7.d.ts} +1 -1
  17. package/dist/{index-C9tpZjBN.d.cts → index-D9R6UTMl.d.cts} +1 -1
  18. package/dist/logging/index.d.cts +2 -2
  19. package/dist/logging/index.d.ts +2 -2
  20. package/dist/{message-Di94OL80.d.cts → message-Dlsh5WDF.d.cts} +1 -1
  21. package/dist/{message-Di94OL80.d.ts → message-Dlsh5WDF.d.ts} +1 -1
  22. package/dist/router/index.cjs +199 -170
  23. package/dist/router/index.cjs.map +1 -1
  24. package/dist/router/index.d.cts +21 -18
  25. package/dist/router/index.d.ts +21 -18
  26. package/dist/router/index.js +3 -3
  27. package/dist/server-BBgDVOzk.d.cts +72 -0
  28. package/dist/server-DZ0Yzmpf.d.ts +72 -0
  29. package/dist/services-DBvjc-Mq.d.ts +1010 -0
  30. package/dist/services-DC_uol9A.d.cts +1010 -0
  31. package/dist/testUtil/index.cjs +1 -1
  32. package/dist/testUtil/index.cjs.map +1 -1
  33. package/dist/testUtil/index.d.cts +9 -7
  34. package/dist/testUtil/index.d.ts +9 -7
  35. package/dist/testUtil/index.js +2 -2
  36. package/dist/testUtil/index.js.map +1 -1
  37. package/dist/transport/impls/ws/client.cjs +1 -1
  38. package/dist/transport/impls/ws/client.cjs.map +1 -1
  39. package/dist/transport/impls/ws/client.d.cts +6 -5
  40. package/dist/transport/impls/ws/client.d.ts +6 -5
  41. package/dist/transport/impls/ws/client.js +3 -3
  42. package/dist/transport/impls/ws/server.cjs +1 -1
  43. package/dist/transport/impls/ws/server.cjs.map +1 -1
  44. package/dist/transport/impls/ws/server.d.cts +8 -8
  45. package/dist/transport/impls/ws/server.d.ts +8 -8
  46. package/dist/transport/impls/ws/server.js +3 -3
  47. package/dist/transport/impls/ws/server.js.map +1 -1
  48. package/dist/transport/index.cjs +1 -1
  49. package/dist/transport/index.cjs.map +1 -1
  50. package/dist/transport/index.d.cts +7 -74
  51. package/dist/transport/index.d.ts +7 -74
  52. package/dist/transport/index.js +2 -2
  53. package/dist/transport-CxjUaGhi.d.cts +577 -0
  54. package/dist/transport-DwEB67zY.d.ts +577 -0
  55. package/package.json +1 -1
  56. package/dist/chunk-JC4XN6NC.js.map +0 -1
  57. package/dist/transport-CCaWx1Rb.d.cts +0 -1566
  58. package/dist/transport-CZb3vdB4.d.ts +0 -1566
  59. /package/dist/{chunk-M2B4PVR5.js.map → chunk-LPWARXI3.js.map} +0 -0
@@ -0,0 +1,54 @@
1
+ import { C as Connection, T as Transport, m as ClientTransportOptions, L as LeakyBucketRateLimit, n as ClientHandshakeOptions, o as ClientSession, b as ProvidedClientTransportOptions, e as SessionNoConnection, f as SessionConnecting, g as SessionHandshaking, h as SessionConnected, p as SessionBackingOff } from './transport-DwEB67zY.js';
2
+ import { c as TransportClientId, b as OpaqueTransportMessage } from './message-Dlsh5WDF.js';
3
+
4
+ declare abstract class ClientTransport<ConnType extends Connection> extends Transport<ConnType> {
5
+ /**
6
+ * The options for this transport.
7
+ */
8
+ protected options: ClientTransportOptions;
9
+ retryBudget: LeakyBucketRateLimit;
10
+ /**
11
+ * A flag indicating whether the transport should automatically reconnect
12
+ * when a connection is dropped.
13
+ * Realistically, this should always be true for clients unless you are writing
14
+ * tests or a special case where you don't want to reconnect.
15
+ */
16
+ reconnectOnConnectionDrop: boolean;
17
+ /**
18
+ * Optional handshake options for this client.
19
+ */
20
+ handshakeExtensions?: ClientHandshakeOptions;
21
+ sessions: Map<TransportClientId, ClientSession<ConnType>>;
22
+ constructor(clientId: TransportClientId, providedOptions?: ProvidedClientTransportOptions);
23
+ extendHandshake(options: ClientHandshakeOptions): void;
24
+ /**
25
+ * Abstract method that creates a new {@link Connection} object.
26
+ *
27
+ * @param to The client ID of the node to connect to.
28
+ * @returns The new connection object.
29
+ */
30
+ protected abstract createNewOutgoingConnection(to: TransportClientId): Promise<ConnType>;
31
+ private tryReconnecting;
32
+ createUnconnectedSession(to: string): SessionNoConnection;
33
+ protected onConnectingFailed(session: SessionConnecting<ConnType>): SessionNoConnection;
34
+ protected onConnClosed(session: SessionHandshaking<ConnType> | SessionConnected<ConnType>): SessionNoConnection;
35
+ protected onConnectionEstablished(session: SessionConnecting<ConnType>, conn: ConnType): SessionHandshaking<ConnType>;
36
+ private rejectHandshakeResponse;
37
+ protected onHandshakeResponse(session: SessionHandshaking<ConnType>, msg: OpaqueTransportMessage): void;
38
+ /**
39
+ * Manually attempts to connect to a client.
40
+ * @param to The client ID of the node to connect to.
41
+ */
42
+ connect(to: TransportClientId): void;
43
+ /**
44
+ * Manually kills all sessions to the server (including all pending state).
45
+ * This is useful for when you want to close all connections to a server
46
+ * and don't want to wait for the grace period to elapse.
47
+ */
48
+ hardDisconnect(): void;
49
+ protected onBackoffFinished(session: SessionBackingOff): void;
50
+ private sendHandshake;
51
+ close(): void;
52
+ }
53
+
54
+ export { ClientTransport as C };
@@ -0,0 +1,54 @@
1
+ import { C as Connection, T as Transport, m as ClientTransportOptions, L as LeakyBucketRateLimit, n as ClientHandshakeOptions, o as ClientSession, b as ProvidedClientTransportOptions, e as SessionNoConnection, f as SessionConnecting, g as SessionHandshaking, h as SessionConnected, p as SessionBackingOff } from './transport-CxjUaGhi.cjs';
2
+ import { c as TransportClientId, b as OpaqueTransportMessage } from './message-Dlsh5WDF.cjs';
3
+
4
+ declare abstract class ClientTransport<ConnType extends Connection> extends Transport<ConnType> {
5
+ /**
6
+ * The options for this transport.
7
+ */
8
+ protected options: ClientTransportOptions;
9
+ retryBudget: LeakyBucketRateLimit;
10
+ /**
11
+ * A flag indicating whether the transport should automatically reconnect
12
+ * when a connection is dropped.
13
+ * Realistically, this should always be true for clients unless you are writing
14
+ * tests or a special case where you don't want to reconnect.
15
+ */
16
+ reconnectOnConnectionDrop: boolean;
17
+ /**
18
+ * Optional handshake options for this client.
19
+ */
20
+ handshakeExtensions?: ClientHandshakeOptions;
21
+ sessions: Map<TransportClientId, ClientSession<ConnType>>;
22
+ constructor(clientId: TransportClientId, providedOptions?: ProvidedClientTransportOptions);
23
+ extendHandshake(options: ClientHandshakeOptions): void;
24
+ /**
25
+ * Abstract method that creates a new {@link Connection} object.
26
+ *
27
+ * @param to The client ID of the node to connect to.
28
+ * @returns The new connection object.
29
+ */
30
+ protected abstract createNewOutgoingConnection(to: TransportClientId): Promise<ConnType>;
31
+ private tryReconnecting;
32
+ createUnconnectedSession(to: string): SessionNoConnection;
33
+ protected onConnectingFailed(session: SessionConnecting<ConnType>): SessionNoConnection;
34
+ protected onConnClosed(session: SessionHandshaking<ConnType> | SessionConnected<ConnType>): SessionNoConnection;
35
+ protected onConnectionEstablished(session: SessionConnecting<ConnType>, conn: ConnType): SessionHandshaking<ConnType>;
36
+ private rejectHandshakeResponse;
37
+ protected onHandshakeResponse(session: SessionHandshaking<ConnType>, msg: OpaqueTransportMessage): void;
38
+ /**
39
+ * Manually attempts to connect to a client.
40
+ * @param to The client ID of the node to connect to.
41
+ */
42
+ connect(to: TransportClientId): void;
43
+ /**
44
+ * Manually kills all sessions to the server (including all pending state).
45
+ * This is useful for when you want to close all connections to a server
46
+ * and don't want to wait for the grace period to elapse.
47
+ */
48
+ hardDisconnect(): void;
49
+ protected onBackoffFinished(session: SessionBackingOff): void;
50
+ private sendHandshake;
51
+ close(): void;
52
+ }
53
+
54
+ export { ClientTransport as C };
@@ -1,6 +1,6 @@
1
- import { C as Codec } from '../adapter-Cuc4JtfV.cjs';
2
- export { a as CodecMessageAdapter } from '../adapter-Cuc4JtfV.cjs';
3
- import '../message-Di94OL80.cjs';
1
+ import { C as Codec } from '../adapter-DjiEwOYi.cjs';
2
+ export { a as CodecMessageAdapter } from '../adapter-DjiEwOYi.cjs';
3
+ import '../message-Dlsh5WDF.cjs';
4
4
  import '@sinclair/typebox';
5
5
  import '@opentelemetry/api';
6
6
 
@@ -1,6 +1,6 @@
1
- import { C as Codec } from '../adapter-ChksXKVN.js';
2
- export { a as CodecMessageAdapter } from '../adapter-ChksXKVN.js';
3
- import '../message-Di94OL80.js';
1
+ import { C as Codec } from '../adapter-Cp7_gIVA.js';
2
+ export { a as CodecMessageAdapter } from '../adapter-Cp7_gIVA.js';
3
+ import '../message-Dlsh5WDF.js';
4
4
  import '@sinclair/typebox';
5
5
  import '@opentelemetry/api';
6
6
 
@@ -2,9 +2,9 @@ import {
2
2
  BinaryCodec,
3
3
  CodecMessageAdapter,
4
4
  NaiveJsonCodec
5
- } from "../chunk-3WYK5ZRT.js";
5
+ } from "../chunk-TVN2TB6X.js";
6
6
  import "../chunk-CC7RN7GI.js";
7
- import "../chunk-JC4XN6NC.js";
7
+ import "../chunk-RATCBAZE.js";
8
8
  export {
9
9
  BinaryCodec,
10
10
  CodecMessageAdapter,
@@ -1,6 +1,6 @@
1
- import { T as Tags } from './index-D8IOd3LG.js';
2
- import { P as ProtocolVersion, O as OpaqueTransportMessage } from './message-Di94OL80.js';
3
- import { b as Connection } from './transport-CZb3vdB4.js';
1
+ import { T as Tags } from './index-CSM8soK7.js';
2
+ import { P as ProtocolVersion, b as OpaqueTransportMessage } from './message-Dlsh5WDF.js';
3
+ import { C as Connection } from './transport-DwEB67zY.js';
4
4
  import { W as WsLike } from './wslike-Dng9H1C7.js';
5
5
 
6
6
  interface ConnectionInfoExtras extends Record<string, unknown> {
@@ -1,6 +1,6 @@
1
- import { T as Tags } from './index-C9tpZjBN.cjs';
2
- import { P as ProtocolVersion, O as OpaqueTransportMessage } from './message-Di94OL80.cjs';
3
- import { b as Connection } from './transport-CCaWx1Rb.cjs';
1
+ import { T as Tags } from './index-D9R6UTMl.cjs';
2
+ import { P as ProtocolVersion, b as OpaqueTransportMessage } from './message-Dlsh5WDF.cjs';
3
+ import { C as Connection } from './transport-CxjUaGhi.cjs';
4
4
  import { W as WsLike } from './wslike-Dng9H1C7.cjs';
5
5
 
6
6
  interface ConnectionInfoExtras extends Record<string, unknown> {
@@ -1,4 +1,4 @@
1
- import { P as ProtocolVersion, O as OpaqueTransportMessage } from './message-Di94OL80.js';
1
+ import { P as ProtocolVersion, b as OpaqueTransportMessage } from './message-Dlsh5WDF.js';
2
2
 
3
3
  declare const LoggingLevels: {
4
4
  readonly debug: -1;
@@ -1,4 +1,4 @@
1
- import { P as ProtocolVersion, O as OpaqueTransportMessage } from './message-Di94OL80.cjs';
1
+ import { P as ProtocolVersion, b as OpaqueTransportMessage } from './message-Dlsh5WDF.cjs';
2
2
 
3
3
  declare const LoggingLevels: {
4
4
  readonly debug: -1;
@@ -1,4 +1,4 @@
1
- export { a as LogFn, L as Logger, M as MessageMetadata, c as coloredStringLogger, j as jsonLogger, s as stringLogger } from '../index-C9tpZjBN.cjs';
2
- import '../message-Di94OL80.cjs';
1
+ export { a as LogFn, L as Logger, M as MessageMetadata, c as coloredStringLogger, j as jsonLogger, s as stringLogger } from '../index-D9R6UTMl.cjs';
2
+ import '../message-Dlsh5WDF.cjs';
3
3
  import '@sinclair/typebox';
4
4
  import '@opentelemetry/api';
@@ -1,4 +1,4 @@
1
- export { a as LogFn, L as Logger, M as MessageMetadata, c as coloredStringLogger, j as jsonLogger, s as stringLogger } from '../index-D8IOd3LG.js';
2
- import '../message-Di94OL80.js';
1
+ export { a as LogFn, L as Logger, M as MessageMetadata, c as coloredStringLogger, j as jsonLogger, s as stringLogger } from '../index-CSM8soK7.js';
2
+ import '../message-Dlsh5WDF.js';
3
3
  import '@sinclair/typebox';
4
4
  import '@opentelemetry/api';
@@ -105,4 +105,4 @@ declare function isStreamOpen(controlFlag: number): boolean;
105
105
  */
106
106
  declare function isStreamClose(controlFlag: number): boolean;
107
107
 
108
- export { HandshakeErrorCustomHandlerFatalResponseCodes as H, type OpaqueTransportMessage as O, type ProtocolVersion as P, type TransportClientId as T, type PartialTransportMessage as a, type TelemetryInfo as b, type TransportMessage as c, HandshakeErrorResponseCodes as d, TransportMessageSchema as e, OpaqueTransportMessageSchema as f, isStreamClose as g, isStreamOpen as i };
108
+ export { HandshakeErrorResponseCodes as H, OpaqueTransportMessageSchema as O, type ProtocolVersion as P, TransportMessageSchema as T, type TransportMessage as a, type OpaqueTransportMessage as b, type TransportClientId as c, isStreamClose as d, type PartialTransportMessage as e, type TelemetryInfo as f, HandshakeErrorCustomHandlerFatalResponseCodes as g, isStreamOpen as i };
@@ -105,4 +105,4 @@ declare function isStreamOpen(controlFlag: number): boolean;
105
105
  */
106
106
  declare function isStreamClose(controlFlag: number): boolean;
107
107
 
108
- export { HandshakeErrorCustomHandlerFatalResponseCodes as H, type OpaqueTransportMessage as O, type ProtocolVersion as P, type TransportClientId as T, type PartialTransportMessage as a, type TelemetryInfo as b, type TransportMessage as c, HandshakeErrorResponseCodes as d, TransportMessageSchema as e, OpaqueTransportMessageSchema as f, isStreamClose as g, isStreamOpen as i };
108
+ export { HandshakeErrorResponseCodes as H, OpaqueTransportMessageSchema as O, type ProtocolVersion as P, TransportMessageSchema as T, type TransportMessage as a, type OpaqueTransportMessage as b, type TransportClientId as c, isStreamClose as d, type PartialTransportMessage as e, type TelemetryInfo as f, HandshakeErrorCustomHandlerFatalResponseCodes as g, isStreamOpen as i };