@replit/river 0.208.4 → 0.209.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 (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-N62U4PDY.js → chunk-2AV3IIW5.js} +174 -168
  5. package/dist/chunk-2AV3IIW5.js.map +1 -0
  6. package/dist/{chunk-NJNR3MK5.js → chunk-2DRHPFKM.js} +2 -2
  7. package/dist/{chunk-7TKRCDKJ.js → chunk-UC4MQ5FP.js} +2 -2
  8. package/dist/{chunk-7TKRCDKJ.js.map → chunk-UC4MQ5FP.js.map} +1 -1
  9. package/dist/client-CRY4aeRv.d.cts +54 -0
  10. package/dist/client-Cvl0bF5y.d.ts +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/common-MmS1PQN7.d.cts +577 -0
  15. package/dist/common-yodP-WNy.d.ts +577 -0
  16. package/dist/{connection-BF4zg6Qv.d.cts → connection-BVE0wfE7.d.cts} +3 -3
  17. package/dist/{connection-Donr3JRB.d.ts → connection-BphUYGjL.d.ts} +3 -3
  18. package/dist/{index-D8IOd3LG.d.ts → index-CSM8soK7.d.ts} +1 -1
  19. package/dist/{index-C9tpZjBN.d.cts → index-D9R6UTMl.d.cts} +1 -1
  20. package/dist/logging/index.d.cts +2 -2
  21. package/dist/logging/index.d.ts +2 -2
  22. package/dist/{message-Di94OL80.d.cts → message-Dlsh5WDF.d.cts} +1 -1
  23. package/dist/{message-Di94OL80.d.ts → message-Dlsh5WDF.d.ts} +1 -1
  24. package/dist/router/index.cjs +174 -168
  25. package/dist/router/index.cjs.map +1 -1
  26. package/dist/router/index.d.cts +21 -18
  27. package/dist/router/index.d.ts +21 -18
  28. package/dist/router/index.js +3 -3
  29. package/dist/server-BKZTIlAc.d.cts +72 -0
  30. package/dist/server-hDGOXIRA.d.ts +72 -0
  31. package/dist/services-9I3wdkpy.d.cts +1010 -0
  32. package/dist/services-BFGny14R.d.ts +1010 -0
  33. package/dist/testUtil/index.cjs +1 -1
  34. package/dist/testUtil/index.cjs.map +1 -1
  35. package/dist/testUtil/index.d.cts +9 -7
  36. package/dist/testUtil/index.d.ts +9 -7
  37. package/dist/testUtil/index.js +2 -2
  38. package/dist/testUtil/index.js.map +1 -1
  39. package/dist/transport/impls/ws/client.cjs +1 -1
  40. package/dist/transport/impls/ws/client.cjs.map +1 -1
  41. package/dist/transport/impls/ws/client.d.cts +6 -5
  42. package/dist/transport/impls/ws/client.d.ts +6 -5
  43. package/dist/transport/impls/ws/client.js +3 -3
  44. package/dist/transport/impls/ws/server.cjs +1 -1
  45. package/dist/transport/impls/ws/server.cjs.map +1 -1
  46. package/dist/transport/impls/ws/server.d.cts +8 -8
  47. package/dist/transport/impls/ws/server.d.ts +8 -8
  48. package/dist/transport/impls/ws/server.js +3 -3
  49. package/dist/transport/impls/ws/server.js.map +1 -1
  50. package/dist/transport/index.cjs +1 -1
  51. package/dist/transport/index.cjs.map +1 -1
  52. package/dist/transport/index.d.cts +7 -74
  53. package/dist/transport/index.d.ts +7 -74
  54. package/dist/transport/index.js +2 -2
  55. package/package.json +1 -1
  56. package/dist/chunk-N62U4PDY.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-NJNR3MK5.js.map → chunk-2DRHPFKM.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 './common-MmS1PQN7.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 };
@@ -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 './common-yodP-WNy.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 };
@@ -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-7TKRCDKJ.js";
5
+ } from "../chunk-UC4MQ5FP.js";
6
6
  import "../chunk-CC7RN7GI.js";
7
- import "../chunk-N62U4PDY.js";
7
+ import "../chunk-2AV3IIW5.js";
8
8
  export {
9
9
  BinaryCodec,
10
10
  CodecMessageAdapter,