@delali/narsil 0.3.1-next.107 → 0.3.1-next.111

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 (95) hide show
  1. package/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/browser/{chunk-JJKVYLL3.mjs → chunk-2CBQ2PCC.mjs} +1 -1
  4. package/dist/browser/{chunk-PA56PRWX.mjs → chunk-5BQPBG3G.mjs} +41 -4
  5. package/dist/browser/{chunk-NNQPZPTB.mjs → chunk-6YUUEMQ4.mjs} +139 -28
  6. package/dist/browser/{chunk-WZUSMF7A.mjs → chunk-HQOYKRMB.mjs} +14 -13
  7. package/dist/browser/{chunk-J3QB4LBD.mjs → chunk-LJS6PREA.mjs} +2 -0
  8. package/dist/browser/{chunk-OKZGAJEF.mjs → chunk-OVY4RPDS.mjs} +3 -3
  9. package/dist/browser/{chunk-OL7S2KLL.mjs → chunk-P7C2S5JX.mjs} +2 -2
  10. package/dist/browser/{durability-wiring-HFQULBSA.mjs → durability-wiring-CYAJBYCO.mjs} +48 -20
  11. package/dist/browser/{module-VROKZ7IZ.mjs → module-DYKR4INA.mjs} +5 -5
  12. package/dist/browser/{restore-queue-EU77FRCV.mjs → restore-queue-RTZGJT4D.mjs} +1 -1
  13. package/dist/browser/{runtime-JQYPNOK6.mjs → runtime-FL5K4JOH.mjs} +1 -1
  14. package/dist/browser/{snapshot-G77LQBZX.mjs → snapshot-BU6I25CW.mjs} +27 -14
  15. package/dist/browser/{write-RUC64JIH.mjs → write-RUPYHPBZ.mjs} +5 -5
  16. package/dist/{capabilities-ByKPha_q.d.ts → capabilities-ByaX8Arf.d.ts} +2 -2
  17. package/dist/{chunk-WCNN2PLX.mjs → chunk-2RAQKITH.mjs} +1 -1
  18. package/dist/{chunk-JSSGO4B5.mjs → chunk-542TD4BL.mjs} +1 -1
  19. package/dist/{chunk-KOCHOOS5.mjs → chunk-63HFWQEA.mjs} +5 -3
  20. package/dist/{chunk-77SO7G55.mjs → chunk-6ODIY6ZB.mjs} +1 -1
  21. package/dist/{chunk-VVDQNCOG.mjs → chunk-6OXNHLNZ.mjs} +1 -0
  22. package/dist/{chunk-CYHQNM3T.mjs → chunk-6PN3U6XW.mjs} +1 -1
  23. package/dist/{chunk-WCJJCBR4.mjs → chunk-6S7YRUPQ.mjs} +123 -35
  24. package/dist/{chunk-FEOLYA2Y.mjs → chunk-7JOONQ24.mjs} +6 -6
  25. package/dist/{chunk-MZW4V4DS.mjs → chunk-7ZZQNOIY.mjs} +1 -1
  26. package/dist/{chunk-VWFFCDOL.mjs → chunk-CUVTRLA4.mjs} +26 -13
  27. package/dist/{chunk-VVFKFHWE.mjs → chunk-DG62H7OD.mjs} +2 -2
  28. package/dist/{chunk-QALAFGF5.mjs → chunk-FUUP45IS.mjs} +1 -1
  29. package/dist/{chunk-2MNJ2HX7.mjs → chunk-HNAP2KTG.mjs} +2 -2
  30. package/dist/{chunk-RI5VNFAI.mjs → chunk-IR4KQ4WB.mjs} +2 -2
  31. package/dist/{chunk-CKNOGER5.mjs → chunk-IW6UR3AF.mjs} +23 -22
  32. package/dist/{chunk-FABI2JA7.mjs → chunk-J6YVB2XM.mjs} +1 -1
  33. package/dist/{chunk-UM6Z7AIP.mjs → chunk-JBPYFYIU.mjs} +4 -3
  34. package/dist/{chunk-WXVTQ6NO.mjs → chunk-KCQG2PJT.mjs} +3 -3
  35. package/dist/{chunk-OKZPYJZX.mjs → chunk-LOBYK2FG.mjs} +3 -3
  36. package/dist/{chunk-3BRFOMGX.mjs → chunk-N57XXGPG.mjs} +2 -2
  37. package/dist/{chunk-6JUOMMHQ.mjs → chunk-OBWUWZRA.mjs} +2 -0
  38. package/dist/{chunk-VHPVBJOI.mjs → chunk-OCB7TMUQ.mjs} +1 -1
  39. package/dist/{chunk-AEF2O7B4.mjs → chunk-OFYKBKKV.mjs} +1 -1
  40. package/dist/{chunk-IZLM2OOO.mjs → chunk-PKE2PCTS.mjs} +43 -6
  41. package/dist/{chunk-HNAQNAFS.mjs → chunk-PT7VRWS7.mjs} +3 -3
  42. package/dist/{chunk-DUWYU4D5.mjs → chunk-PWIWSUCX.mjs} +2 -2
  43. package/dist/{chunk-IA6I5U36.mjs → chunk-QI6JW4PM.mjs} +1 -1
  44. package/dist/{chunk-MJIJG4YT.mjs → chunk-QIFOXLWF.mjs} +2 -2
  45. package/dist/{chunk-M5EZVXIM.mjs → chunk-R2MRGYU5.mjs} +2 -2
  46. package/dist/{chunk-7IBX2LRA.mjs → chunk-R2MRMH6M.mjs} +11 -11
  47. package/dist/{chunk-5FPMDU54.mjs → chunk-SOADQINJ.mjs} +8 -1
  48. package/dist/{chunk-QA6F5MML.mjs → chunk-SXVDBHYJ.mjs} +39 -8
  49. package/dist/{chunk-NRARRUKN.mjs → chunk-UGKO3RG2.mjs} +7 -7
  50. package/dist/{chunk-HAQUJYMN.mjs → chunk-V7G627TA.mjs} +14 -8
  51. package/dist/{chunk-BRIOLMIX.mjs → chunk-VK45J47R.mjs} +1 -1
  52. package/dist/{chunk-RPIE4QCL.mjs → chunk-YH5OIL7B.mjs} +2 -0
  53. package/dist/{chunk-G6YATIRT.mjs → chunk-YIDSHBQS.mjs} +2 -2
  54. package/dist/{chunk-IA3H54X4.mjs → chunk-YLE75NQ5.mjs} +2 -2
  55. package/dist/{chunk-DNKM67DF.mjs → chunk-YSR5L3XJ.mjs} +2 -2
  56. package/dist/{client-DI-xIXgR.d.ts → client-BdnzDFtO.d.ts} +2 -2
  57. package/dist/client.d.ts +6 -6
  58. package/dist/client.mjs +2 -0
  59. package/dist/{config-DL_bDDD8.d.ts → config-CSgvApt0.d.ts} +1 -1
  60. package/dist/{config-BZ_e3X8w.d.ts → config-ujZESkJz.d.ts} +1 -1
  61. package/dist/{direct-executor-BPBD2PBK.mjs → direct-executor-QFAUKTCQ.mjs} +12 -12
  62. package/dist/distribution/coordinator/etcd.mjs +94 -5
  63. package/dist/distribution/transport/grpc.mjs +24 -8
  64. package/dist/distribution/transport/in-memory.mjs +4 -4
  65. package/dist/distribution/transport/tcp.mjs +6 -6
  66. package/dist/distribution.d.ts +5 -5
  67. package/dist/distribution.mjs +1800 -468
  68. package/dist/{durability-wiring-AZL4EFLO.mjs → durability-wiring-NUHTYXHA.mjs} +66 -39
  69. package/dist/embeddings/openai.mjs +2 -2
  70. package/dist/{engine-D_SYDsId.d.ts → engine-C_HSy3iz.d.ts} +1 -1
  71. package/dist/{events-C7_dboUr.d.ts → events-CJsXF1F9.d.ts} +2 -0
  72. package/dist/index.browser.mjs +3 -3
  73. package/dist/index.d.ts +5 -5
  74. package/dist/index.mjs +17 -17
  75. package/dist/{module-6EY7GW2W.mjs → module-WP4VVGV2.mjs} +9 -9
  76. package/dist/partial-words.mjs +5 -5
  77. package/dist/pattern.mjs +3 -3
  78. package/dist/persistence/durability/checkpoint-worker.d.ts +12 -0
  79. package/dist/persistence/durability/checkpoint-worker.mjs +26 -24
  80. package/dist/react.d.ts +6 -6
  81. package/dist/react.mjs +2 -0
  82. package/dist/{rerank-WVFFZV76.mjs → rerank-3POMPQNX.mjs} +7 -7
  83. package/dist/rerankers/http.mjs +2 -2
  84. package/dist/{restore-queue-DDXFDP7U.mjs → restore-queue-QSLGXZJB.mjs} +1 -1
  85. package/dist/{runtime-AVUUCJWQ.mjs → runtime-C2435MPK.mjs} +5 -5
  86. package/dist/server.d.ts +8 -8
  87. package/dist/server.mjs +16 -15
  88. package/dist/{snapshot-IDAM65JO.mjs → snapshot-IV3S2TMI.mjs} +27 -27
  89. package/dist/synonyms.mjs +3 -3
  90. package/dist/{tasks-BhjQZ8Qf.d.ts → tasks-CI3Fvkxw.d.ts} +1 -1
  91. package/dist/{thread-LMSYLCPI.mjs → thread-THLCKMEB.mjs} +13 -13
  92. package/dist/vector/search-worker.mjs +4 -4
  93. package/dist/workers/entry.mjs +6 -6
  94. package/dist/{write-3LIFIGOL.mjs → write-VGRTOS7N.mjs} +19 -19
  95. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
1
  import { MAX_NODE_ID_LENGTH, CONTROLLER_LEASE_KEY, MAX_WATCHERS } from '../../chunk-44W3CBNG.mjs';
2
2
  import '../../chunk-R6A773WK.mjs';
3
3
  import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
4
- import { NarsilError, ErrorCodes, describeError } from '../../chunk-6JUOMMHQ.mjs';
4
+ import { NarsilError, ErrorCodes, describeError } from '../../chunk-OBWUWZRA.mjs';
5
5
  import { encode, decode } from '@msgpack/msgpack';
6
6
 
7
7
  // src/distribution/coordinator/etcd/constants.ts
@@ -13,6 +13,54 @@ var RECONNECT_FIRST_DELAY_MS = 100;
13
13
  var RECONNECT_LONGEST_DELAY_MS = 5e3;
14
14
  var ETCD_START_PROBE_TIMEOUT_MS = 1e4;
15
15
  var ETCD_CALL_TIMEOUT_MS = 5e3;
16
+ var ETCD_KEEPALIVE_TIME_MS = 1e4;
17
+ var ETCD_KEEPALIVE_TIMEOUT_MS = 5e3;
18
+ var ETCD_WATCH_ATTACH_TIMEOUT_MS = 1e4;
19
+ var ETCD_ENDPOINT_FAILURE_THRESHOLD = 3;
20
+ var ETCD_ENDPOINT_SKIP_MS = 5e3;
21
+
22
+ // src/distribution/coordinator/etcd/endpoint-breaker.ts
23
+ var NEVER_ABORTED = new AbortController().signal;
24
+ var noListeners = () => ({ dispose: () => {
25
+ } });
26
+ var EndpointSkippedError = class extends NarsilError {
27
+ isBrokenCircuitError = true;
28
+ };
29
+ var SkippingEndpointBreaker = class {
30
+ constructor(endpoint, counts) {
31
+ this.endpoint = endpoint;
32
+ this.counts = counts;
33
+ }
34
+ onSuccess = noListeners;
35
+ onFailure = noListeners;
36
+ consecutiveFailures = 0;
37
+ skippedUntil = 0;
38
+ async execute(fn, signal = NEVER_ABORTED) {
39
+ if (Date.now() < this.skippedUntil) {
40
+ throw new EndpointSkippedError(
41
+ ErrorCodes.COORDINATOR_UNAVAILABLE,
42
+ `etcd endpoint ${this.endpoint} failed ${ETCD_ENDPOINT_FAILURE_THRESHOLD} calls in a row, so this client skips it for ${ETCD_ENDPOINT_SKIP_MS} ms`,
43
+ { endpoint: this.endpoint }
44
+ );
45
+ }
46
+ try {
47
+ const result = await fn({ signal });
48
+ this.consecutiveFailures = 0;
49
+ return result;
50
+ } catch (error) {
51
+ if (error instanceof Error && this.counts(error)) {
52
+ this.consecutiveFailures += 1;
53
+ if (this.consecutiveFailures >= ETCD_ENDPOINT_FAILURE_THRESHOLD) {
54
+ this.skippedUntil = Date.now() + ETCD_ENDPOINT_SKIP_MS;
55
+ }
56
+ }
57
+ throw error;
58
+ }
59
+ }
60
+ };
61
+ function createEndpointBreaker(endpoint, counts) {
62
+ return new SkippingEndpointBreaker(endpoint, counts);
63
+ }
16
64
 
17
65
  // src/distribution/coordinator/etcd/types.ts
18
66
  var DEFAULT_ETCD_CONFIG = {
@@ -181,6 +229,16 @@ async function loadEtcd3Module() {
181
229
  // src/distribution/coordinator/etcd/prefix-watch.ts
182
230
  function connectedOrDropped(watcher) {
183
231
  return new Promise((resolve, reject) => {
232
+ const timer = setTimeout(() => {
233
+ detach();
234
+ reject(
235
+ new NarsilError(
236
+ ErrorCodes.COORDINATOR_UNAVAILABLE,
237
+ `etcd did not attach the watch within ${ETCD_WATCH_ATTACH_TIMEOUT_MS} ms`
238
+ )
239
+ );
240
+ }, ETCD_WATCH_ATTACH_TIMEOUT_MS);
241
+ timer.unref?.();
184
242
  const onConnected = () => {
185
243
  detach();
186
244
  resolve();
@@ -190,6 +248,7 @@ function connectedOrDropped(watcher) {
190
248
  reject(error);
191
249
  };
192
250
  function detach() {
251
+ clearTimeout(timer);
193
252
  watcher.off("connected", onConnected);
194
253
  watcher.off("disconnected", onDropped);
195
254
  watcher.off("error", onDropped);
@@ -233,12 +292,16 @@ async function watchPrefix(context, prefix, handlers) {
233
292
  return String(BigInt(listing.header.revision) + 1n);
234
293
  }
235
294
  async function watchFrom(startRevision2) {
236
- const watcher = context.client.watch().prefix(prefix).startRevision(startRevision2).watcher();
295
+ const client = context.watchClient.current();
296
+ const watcher = client.watch().prefix(prefix).startRevision(startRevision2).watcher();
237
297
  try {
238
298
  await connectedOrDropped(watcher);
239
299
  } catch (error) {
300
+ watcher.on("error", () => {
301
+ });
240
302
  watcher.cancel().catch(() => {
241
303
  });
304
+ context.watchClient.replace(client);
242
305
  throw error;
243
306
  }
244
307
  if (stopped || context.isShutdown()) {
@@ -733,6 +796,24 @@ function validatePartitionState(value) {
733
796
  return value;
734
797
  }
735
798
 
799
+ // src/distribution/coordinator/etcd/watch-client.ts
800
+ function createReplaceableWatchClient(open) {
801
+ let client = open();
802
+ let closed = false;
803
+ return {
804
+ current: () => client,
805
+ replace(stale) {
806
+ if (closed || stale !== client) return;
807
+ client = open();
808
+ stale.close();
809
+ },
810
+ close() {
811
+ closed = true;
812
+ client.close();
813
+ }
814
+ };
815
+ }
816
+
736
817
  // src/distribution/coordinator/etcd/index.ts
737
818
  async function createEtcdCoordinator(config) {
738
819
  const resolvedConfig = {
@@ -742,12 +823,18 @@ async function createEtcdCoordinator(config) {
742
823
  requireEtcdMaxRequestBytes(resolvedConfig.maxRequestBytes);
743
824
  const securityOptions = etcdSecurityOptions(resolvedConfig);
744
825
  const etcd3Module = await loadEtcd3Module();
745
- const client = new etcd3Module.Etcd3({
826
+ const openClient = () => new etcd3Module.Etcd3({
746
827
  hosts: resolvedConfig.endpoints,
747
- grpcOptions: { "grpc.max_receive_message_length": ETCD_MAX_RESPONSE_BYTES },
828
+ grpcOptions: {
829
+ "grpc.max_receive_message_length": ETCD_MAX_RESPONSE_BYTES,
830
+ "grpc.keepalive_time_ms": ETCD_KEEPALIVE_TIME_MS,
831
+ "grpc.keepalive_timeout_ms": ETCD_KEEPALIVE_TIMEOUT_MS
832
+ },
748
833
  defaultCallOptions: (context) => context.isStream ? {} : { deadline: Date.now() + ETCD_CALL_TIMEOUT_MS },
834
+ faultHandling: { host: (endpoint) => createEndpointBreaker(endpoint, etcd3Module.isRecoverableError) },
749
835
  ...securityOptions
750
836
  });
837
+ const client = openClient();
751
838
  const keys = coordinatorKeys(resolvedConfig);
752
839
  try {
753
840
  await probeEtcd(client, etcd3Module, keys.nodePrefix(), resolvedConfig.endpoints);
@@ -779,7 +866,8 @@ async function createEtcdCoordinator(config) {
779
866
  });
780
867
  watchers.delete(watcher);
781
868
  }
782
- const watchContext = { client, addWatcher, removeWatcher, isShutdown: () => isShutdown };
869
+ const watchClient = createReplaceableWatchClient(openClient);
870
+ const watchContext = { client, watchClient, addWatcher, removeWatcher, isShutdown: () => isShutdown };
783
871
  const coordinator = {
784
872
  async registerNode(registration) {
785
873
  assertNotShutdown();
@@ -1003,6 +1091,7 @@ async function createEtcdCoordinator(config) {
1003
1091
  await Promise.all(cancelPromises);
1004
1092
  watchers.clear();
1005
1093
  await leaseManager.revokeAll();
1094
+ watchClient.close();
1006
1095
  client.close();
1007
1096
  }
1008
1097
  };
@@ -1,8 +1,8 @@
1
- import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-FABI2JA7.mjs';
2
- import { timeoutsOf, replyDeadlineMs } from '../../chunk-DUWYU4D5.mjs';
1
+ import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-J6YVB2XM.mjs';
2
+ import { timeoutsOf, replyDeadlineMs } from '../../chunk-PWIWSUCX.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
4
- import { TransportError, TransportErrorCodes } from '../../chunk-RPIE4QCL.mjs';
5
- import { NarsilError, ErrorCodes } from '../../chunk-6JUOMMHQ.mjs';
4
+ import { TransportError, TransportErrorCodes } from '../../chunk-YH5OIL7B.mjs';
5
+ import { NarsilError, ErrorCodes } from '../../chunk-OBWUWZRA.mjs';
6
6
 
7
7
  // src/distribution/transport/grpc/codec.ts
8
8
  var FIELD_ONE_LENGTH_DELIMITED_KEY = 10;
@@ -152,7 +152,7 @@ var GrpcClientPool = class {
152
152
  }
153
153
  async send(target, message) {
154
154
  const messageBytes = this.encodeChecked(target, message);
155
- const client = await this.getClient(target);
155
+ const client = await this.readyClient(target);
156
156
  const responseBytes = await this.unaryCall(
157
157
  client,
158
158
  target,
@@ -265,7 +265,7 @@ var GrpcClientPool = class {
265
265
  }
266
266
  assertOpen() {
267
267
  if (this.closed) {
268
- throw new TransportError(TransportErrorCodes.PEER_UNAVAILABLE, "gRPC client pool has been shut down");
268
+ throw new TransportError(TransportErrorCodes.CONNECT_FAILED, "gRPC client pool has been shut down");
269
269
  }
270
270
  }
271
271
  getClient(target) {
@@ -283,8 +283,24 @@ var GrpcClientPool = class {
283
283
  });
284
284
  return clientPromise;
285
285
  }
286
+ async readyClient(target) {
287
+ const client = await this.getClient(target);
288
+ if (client.getChannel().getConnectivityState(false) === this.grpc.connectivityState.READY) {
289
+ return client;
290
+ }
291
+ const ready = this.awaitReady(client, target);
292
+ this.clients.set(target, ready);
293
+ ready.catch(() => {
294
+ if (this.clients.get(target) === ready) {
295
+ this.clients.delete(target);
296
+ }
297
+ });
298
+ return ready;
299
+ }
286
300
  connect(target) {
287
- const client = new this.grpc.Client(target, this.credentials(), channelOptions());
301
+ return this.awaitReady(new this.grpc.Client(target, this.credentials(), channelOptions()), target);
302
+ }
303
+ awaitReady(client, target) {
288
304
  const channel = client.getChannel();
289
305
  const { READY, SHUTDOWN, TRANSIENT_FAILURE } = this.grpc.connectivityState;
290
306
  const deadline = Date.now() + this.config.connectTimeout;
@@ -614,7 +630,7 @@ async function createGrpcTransport(nodeId, config) {
614
630
  function assertNotShutdown() {
615
631
  if (isShutdown) {
616
632
  throw new TransportError(
617
- TransportErrorCodes.PEER_UNAVAILABLE,
633
+ TransportErrorCodes.CONNECT_FAILED,
618
634
  `gRPC transport for node '${nodeId}' has been shut down`,
619
635
  { nodeId }
620
636
  );
@@ -1,6 +1,6 @@
1
- import { timeoutsOf, replyDeadlineMs } from '../../chunk-DUWYU4D5.mjs';
1
+ import { timeoutsOf, replyDeadlineMs } from '../../chunk-PWIWSUCX.mjs';
2
2
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
3
- import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-RPIE4QCL.mjs';
3
+ import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-YH5OIL7B.mjs';
4
4
 
5
5
  // src/distribution/transport/in-memory.ts
6
6
  function createInMemoryNetwork() {
@@ -27,7 +27,7 @@ function createInMemoryTransport(nodeId, network, config) {
27
27
  function assertNotShutdown() {
28
28
  if (isShutdown) {
29
29
  throw new TransportError(
30
- TransportErrorCodes.PEER_UNAVAILABLE,
30
+ TransportErrorCodes.CONNECT_FAILED,
31
31
  `Transport for node '${nodeId}' has been shut down`,
32
32
  { nodeId }
33
33
  );
@@ -36,7 +36,7 @@ function createInMemoryTransport(nodeId, network, config) {
36
36
  function lookupPeer(target) {
37
37
  const peer = network.getTransport(target);
38
38
  if (peer === void 0) {
39
- throw new TransportError(TransportErrorCodes.PEER_UNAVAILABLE, `Node '${target}' is not reachable`, { target });
39
+ throw new TransportError(TransportErrorCodes.CONNECT_FAILED, `Node '${target}' is not reachable`, { target });
40
40
  }
41
41
  return peer;
42
42
  }
@@ -1,7 +1,7 @@
1
- import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-FABI2JA7.mjs';
2
- import { timeoutsOf, replyDeadlineMs } from '../../chunk-DUWYU4D5.mjs';
1
+ import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-J6YVB2XM.mjs';
2
+ import { timeoutsOf, replyDeadlineMs } from '../../chunk-PWIWSUCX.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
4
- import { TransportError, TransportErrorCodes } from '../../chunk-RPIE4QCL.mjs';
4
+ import { TransportError, TransportErrorCodes } from '../../chunk-YH5OIL7B.mjs';
5
5
  import { connect as connect$1, createServer as createServer$1 } from 'net';
6
6
  import { connect, createServer } from 'tls';
7
7
 
@@ -71,7 +71,7 @@ var TcpConnectionPool = class {
71
71
  }
72
72
  async send(target, message) {
73
73
  if (this.closed) {
74
- throw new TransportError(TransportErrorCodes.PEER_UNAVAILABLE, "Connection pool has been shut down");
74
+ throw new TransportError(TransportErrorCodes.CONNECT_FAILED, "Connection pool has been shut down");
75
75
  }
76
76
  const messageBytes = encodeTransportMessage(message);
77
77
  if (messageBytes.byteLength > MAX_MESSAGE_SIZE_BYTES) {
@@ -113,7 +113,7 @@ var TcpConnectionPool = class {
113
113
  }
114
114
  async stream(target, message, handler) {
115
115
  if (this.closed) {
116
- throw new TransportError(TransportErrorCodes.PEER_UNAVAILABLE, "Connection pool has been shut down");
116
+ throw new TransportError(TransportErrorCodes.CONNECT_FAILED, "Connection pool has been shut down");
117
117
  }
118
118
  const messageBytes = encodeTransportMessage(message);
119
119
  const socket = await this.getOrCreateConnection(target);
@@ -571,7 +571,7 @@ function createTcpTransport(nodeId, config) {
571
571
  function assertNotShutdown() {
572
572
  if (isShutdown) {
573
573
  throw new TransportError(
574
- TransportErrorCodes.PEER_UNAVAILABLE,
574
+ TransportErrorCodes.CONNECT_FAILED,
575
575
  `TCP transport for node '${nodeId}' has been shut down`,
576
576
  { nodeId }
577
577
  );
@@ -1,14 +1,14 @@
1
- import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-BZ_e3X8w.js';
2
- export { c as ClusterControllerConfig, d as ClusterHealth, e as ClusterHealthStatus, f as ClusterMemoryConfig, g as ClusterMetrics, h as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig } from './config-BZ_e3X8w.js';
1
+ import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-ujZESkJz.js';
2
+ export { c as ClusterControllerConfig, d as ClusterHealth, e as ClusterHealthStatus, f as ClusterMemoryConfig, g as ClusterMetrics, h as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig } from './config-ujZESkJz.js';
3
3
  import { R as RerankAdapter } from './adapters-BQFQ4PRz.js';
4
- import { B as BatchResult, L as ListParams, g as ListResult, h as SuggestParams, j as SuggestResult, Q as QueryParams, P as PreflightResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './events-C7_dboUr.js';
4
+ import { B as BatchResult, L as ListParams, g as ListResult, h as SuggestParams, j as SuggestResult, Q as QueryParams, P as PreflightResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './events-CJsXF1F9.js';
5
5
  import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-4W_7tk1f.js';
6
6
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
7
7
  import { b as NodeCapacity, N as NodeRole } from './index-Cl5qQauj.js';
8
8
  export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexPartitionBytes, e as NodeEvent, f as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, g as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-Cl5qQauj.js';
9
- import { N as Narsil } from './engine-D_SYDsId.js';
9
+ import { N as Narsil } from './engine-C_HSy3iz.js';
10
10
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-DvncmvuQ.js';
11
- import './config-DL_bDDD8.js';
11
+ import './config-CSgvApt0.js';
12
12
 
13
13
  /**
14
14
  * The cluster splits an index into this many partitions when