@delali/narsil 0.3.1-next.113 → 0.3.1-next.116

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 (51) hide show
  1. package/dist/browser/{chunk-DC2SZO4D.mjs → chunk-2TMWIATH.mjs} +107 -67
  2. package/dist/browser/{chunk-YZPOBLAS.mjs → chunk-73U5DWOZ.mjs} +4 -3
  3. package/dist/browser/{chunk-4FVSBSXY.mjs → chunk-FODCC3MK.mjs} +1 -1
  4. package/dist/browser/{chunk-3YPLBK4C.mjs → chunk-I45FAGOF.mjs} +2 -2
  5. package/dist/browser/{durability-wiring-2RG22WQJ.mjs → durability-wiring-CSMTKEYX.mjs} +3 -3
  6. package/dist/browser/{module-5EWHBKHZ.mjs → module-G2PPZV3B.mjs} +27 -24
  7. package/dist/browser/{restore-queue-WCFUB4NS.mjs → restore-queue-N7N42PBS.mjs} +1 -1
  8. package/dist/browser/{runtime-FL5K4JOH.mjs → runtime-BX6XRFYR.mjs} +2 -2
  9. package/dist/browser/{snapshot-BE3F2PNC.mjs → snapshot-EBH6RXQO.mjs} +4 -4
  10. package/dist/browser/{write-MV7K7OCU.mjs → write-5ZKFINX3.mjs} +2 -2
  11. package/dist/{chunk-H2GNWBLB.mjs → chunk-4ZKBKPBV.mjs} +1 -1
  12. package/dist/{chunk-GLZI636G.mjs → chunk-5VVSHCXT.mjs} +27 -12
  13. package/dist/{chunk-LVNBY2TS.mjs → chunk-7EWQZQDT.mjs} +1 -1
  14. package/dist/{chunk-4PFOOQFQ.mjs → chunk-BCNUJVTT.mjs} +1 -1
  15. package/dist/{chunk-PABYSTKO.mjs → chunk-BCSWODXP.mjs} +71 -54
  16. package/dist/{thread-S4SUCV4Y.mjs → chunk-DEXID4ZT.mjs} +300 -202
  17. package/dist/{chunk-4XWIW3F3.mjs → chunk-HC5NURS6.mjs} +4 -3
  18. package/dist/{chunk-AOLD3LPV.mjs → chunk-IE43SRL3.mjs} +4 -1
  19. package/dist/{chunk-27ZEY73B.mjs → chunk-KGVC6KJ3.mjs} +4 -4
  20. package/dist/{chunk-QGVMEMCG.mjs → chunk-KVLX65KD.mjs} +4 -4
  21. package/dist/{chunk-5WEBVYOA.mjs → chunk-N53HN5VA.mjs} +16 -9
  22. package/dist/chunk-N6J6EJW3.mjs +198 -0
  23. package/dist/{chunk-CU4OB64V.mjs → chunk-NX7KU77V.mjs} +1 -1
  24. package/dist/{chunk-QIFOXLWF.mjs → chunk-OGFSUXYY.mjs} +2 -2
  25. package/dist/{chunk-5QIRLJH4.mjs → chunk-Q62NDKEC.mjs} +4 -3
  26. package/dist/{chunk-DZXGNLK5.mjs → chunk-UDZYIWDP.mjs} +3 -3
  27. package/dist/{chunk-HNAP2KTG.mjs → chunk-VFAXPDBH.mjs} +1 -0
  28. package/dist/{chunk-OM5G2J6X.mjs → chunk-VOKEYJHU.mjs} +1 -1
  29. package/dist/{chunk-OABTAUCW.mjs → chunk-YCFQ5754.mjs} +1 -1
  30. package/dist/{chunk-JUAFWJON.mjs → chunk-YCSRB3IN.mjs} +3 -3
  31. package/dist/{chunk-CQUMNIIG.mjs → chunk-Z4DZ4KK2.mjs} +1 -0
  32. package/dist/{chunk-2RAQKITH.mjs → chunk-ZR63OGT2.mjs} +1 -1
  33. package/dist/{direct-executor-R4HOSVPE.mjs → direct-executor-OUY4RPTU.mjs} +4 -4
  34. package/dist/distribution.mjs +17 -17
  35. package/dist/{durability-wiring-XZI6355I.mjs → durability-wiring-5V6DVHFK.mjs} +13 -13
  36. package/dist/index.browser.mjs +1 -1
  37. package/dist/index.mjs +7 -7
  38. package/dist/long-query-thread-HMQM2FWL.mjs +118 -0
  39. package/dist/{module-WVKSJL74.mjs → module-3IMTXNPW.mjs} +30 -27
  40. package/dist/pattern.mjs +1 -1
  41. package/dist/persistence/durability/checkpoint-worker.mjs +10 -10
  42. package/dist/{rerank-3POMPQNX.mjs → rerank-NYX5S7OG.mjs} +3 -3
  43. package/dist/{restore-queue-JAZAB5IQ.mjs → restore-queue-J6PCG4ON.mjs} +1 -1
  44. package/dist/{runtime-C2435MPK.mjs → runtime-XNYW6AWX.mjs} +2 -2
  45. package/dist/server.mjs +93 -199
  46. package/dist/{snapshot-PDUGHQ25.mjs → snapshot-57WF53MK.mjs} +14 -14
  47. package/dist/thread-FDEHU5G3.mjs +31 -0
  48. package/dist/vector/search-worker.mjs +2 -2
  49. package/dist/workers/entry.mjs +17 -5
  50. package/dist/{write-KVJ7YJJ6.mjs → write-YEI7A5OR.mjs} +8 -8
  51. package/package.json +7 -7
@@ -1,8 +1,8 @@
1
- import { vectorsPerFile } from './chunk-CU4OB64V.mjs';
2
- import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-JUAFWJON.mjs';
1
+ import { vectorsPerFile } from './chunk-NX7KU77V.mjs';
2
+ import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-YCSRB3IN.mjs';
3
3
  import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-OCB7TMUQ.mjs';
4
- import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-27ZEY73B.mjs';
5
- import { HEADER_SIZE } from './chunk-PABYSTKO.mjs';
4
+ import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-KGVC6KJ3.mjs';
5
+ import { HEADER_SIZE } from './chunk-BCSWODXP.mjs';
6
6
  import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
7
7
  import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
8
8
 
@@ -1,4 +1,4 @@
1
- import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, bitsetHas, createBitSet, bitsetSet, bitsetIsEmpty, bitsetOrInto, bitsetAndNotInto, bitsetAndInto, bitsetFromSet, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-HNAP2KTG.mjs';
1
+ import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, bitsetHas, createBitSet, bitsetSet, bitsetIsEmpty, bitsetOrInto, bitsetAndNotInto, bitsetAndInto, bitsetFromSet, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-VFAXPDBH.mjs';
2
2
  import { GEO_UNIT_METRES, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, FILTER_OPERAND_COPY_DEPTH } from './chunk-WQBCBKY3.mjs';
3
3
  import { expandTermPrefix, suggestDisplayTerms, getNestedValue, textFieldsChanged, getFlatSchema, tokenizeOptions, partialWordSearchModule, getOrCreateFieldNameIndex, partitionDocumentFrequency } from './chunk-KCQG2PJT.mjs';
4
4
  import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, partialFieldsOf, schemaFieldsOf, flattenSchema, validateDocument, validateDocumentStrict, ANTIMERIDIAN_SPAN_DEGREES, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, VINCENTY_CONVERGENCE_THRESHOLD, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, DEG_TO_RAD, VINCENTY_MAX_ITERATIONS } from './chunk-DG62H7OD.mjs';
@@ -7664,7 +7664,7 @@ function capExceeded(cap) {
7664
7664
  { cap }
7665
7665
  );
7666
7666
  }
7667
- function localMeter(cap, spent, matcherStateBytes, flushUnits) {
7667
+ function localMeter(cap, spent, matcherStateBytes, flushUnits, clock) {
7668
7668
  let total = spent;
7669
7669
  let sharedCount = null;
7670
7670
  const spentSoFar = () => sharedCount === null ? total : Number(Atomics.load(sharedCount, 0));
@@ -7672,11 +7672,13 @@ function localMeter(cap, spent, matcherStateBytes, flushUnits) {
7672
7672
  cap,
7673
7673
  matcherStateBytes,
7674
7674
  flushUnits,
7675
+ clock,
7675
7676
  add(units) {
7676
7677
  if (units <= 0) return;
7677
7678
  if (sharedCount === null) total += units;
7678
7679
  else total = Number(Atomics.add(sharedCount, 0, BigInt(units))) + units;
7679
7680
  if (total > cap) throw capExceeded(cap);
7681
+ if (clock !== void 0) clock.tick(units);
7680
7682
  },
7681
7683
  remaining() {
7682
7684
  return cap - spentSoFar();
@@ -7715,8 +7717,8 @@ function localMeter(cap, spent, matcherStateBytes, flushUnits) {
7715
7717
  };
7716
7718
  return meter;
7717
7719
  }
7718
- function createPatternWorkMeter(cap = DEFAULT_PATTERN_WORK_CAP) {
7719
- return localMeter(cap, 0, MATCHER_STATE_BUDGET_BYTES, PATTERN_WORK_FLUSH_UNITS);
7720
+ function createPatternWorkMeter(cap = DEFAULT_PATTERN_WORK_CAP, clock) {
7721
+ return localMeter(cap, 0, MATCHER_STATE_BUDGET_BYTES, PATTERN_WORK_FLUSH_UNITS, clock);
7720
7722
  }
7721
7723
  function sharedMeter(work, counter) {
7722
7724
  const view = new BigInt64Array(counter);
@@ -7730,11 +7732,12 @@ function sharedMeter(work, counter) {
7730
7732
  },
7731
7733
  remaining() {
7732
7734
  return work.cap - Number(Atomics.load(view, 0));
7733
- }
7735
+ },
7736
+ clock: void 0
7734
7737
  };
7735
7738
  }
7736
7739
  function joinPatternWorkMeter(work) {
7737
- const meter = work.counter === null ? localMeter(work.cap, work.spent, work.matcherStateBytes, work.flushUnits) : sharedMeter(work, work.counter);
7740
+ const meter = work.counter === null ? localMeter(work.cap, work.spent, work.matcherStateBytes, work.flushUnits, void 0) : sharedMeter(work, work.counter);
7738
7741
  let spent = 0;
7739
7742
  return {
7740
7743
  matcherStateBytes: meter.matcherStateBytes,
@@ -7745,6 +7748,7 @@ function joinPatternWorkMeter(work) {
7745
7748
  meter.add(units);
7746
7749
  },
7747
7750
  remaining: () => meter.remaining(),
7751
+ clock: meter.clock,
7748
7752
  spent: () => spent
7749
7753
  };
7750
7754
  }
@@ -8282,7 +8286,7 @@ function ordersAfterAnchor(result, anchor, sort) {
8282
8286
  function applyPagination(results, limit, offset, binding, cursor, sort, pinnedIds) {
8283
8287
  const decoded = cursor ? decodePageCursor(cursor) : null;
8284
8288
  if (decoded !== null && cursor !== void 0) {
8285
- requireMatchingCursor(decoded, cursor, sort?.signature ?? null, true, binding);
8289
+ requireMatchingCursor(decoded, cursor, sort?.signature ?? null, true, binding());
8286
8290
  }
8287
8291
  if (limit <= 0) {
8288
8292
  return { paginated: [] };
@@ -8310,14 +8314,14 @@ function applyPagination(results, limit, offset, binding, cursor, sort, pinnedId
8310
8314
  sortKey: sort.sortKeyOf(lastResult.id).map(toComparableSortValue),
8311
8315
  sortSignature: sort.signature,
8312
8316
  depth,
8313
- binding
8317
+ binding: binding()
8314
8318
  }) : encodePageCursor({
8315
8319
  anchor: lastResult.id,
8316
8320
  score: lastResult.score ?? null,
8317
8321
  sortKey: null,
8318
8322
  sortSignature: null,
8319
8323
  depth,
8320
- binding
8324
+ binding: binding()
8321
8325
  });
8322
8326
  }
8323
8327
  return { paginated: sliced, nextCursor };
@@ -8547,6 +8551,7 @@ async function fanOutQuery(manager, params, language, schema, config, searchOpti
8547
8551
  const partitionFacets = [];
8548
8552
  const everyValue = params.facets ? everyValueFacetConfig(params.facets) : void 0;
8549
8553
  for (const partition of partitions) {
8554
+ options.patternWork?.clock?.check();
8550
8555
  const result = dispatchSinglePartition(partition, params, language, schema, options);
8551
8556
  if (everyValue) {
8552
8557
  partitionFacets.push(partition.computeFacets(facetMatchSetOf(result), everyValue, schema));
@@ -8557,6 +8562,7 @@ async function fanOutQuery(manager, params, language, schema, config, searchOpti
8557
8562
  facets = mergeFacets(partitionFacets, params.facets);
8558
8563
  }
8559
8564
  }
8565
+ options.patternWork?.clock?.check();
8560
8566
  const allScoredArrays = outcomes.map((o) => o.result.scored);
8561
8567
  const merged = kWayMerge(allScoredArrays);
8562
8568
  let totalMatched = 0;
@@ -8613,6 +8619,7 @@ function fanOutMatchCount(manager, params, language, schema, options) {
8613
8619
  patternWork: options?.searchOptions?.patternWork ?? createPatternWorkMeter()
8614
8620
  };
8615
8621
  for (const partition of partitionsIn(manager, options?.partitionIds)) {
8622
+ searchOptions.patternWork.clock?.check();
8616
8623
  const matches = fulltextMatches(partition, params, language, schema, searchOptions);
8617
8624
  if (matches !== null) count += matches.count;
8618
8625
  }
@@ -0,0 +1,198 @@
1
+ import { sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-IE43SRL3.mjs';
2
+ import { ServerErrorCodes } from './chunk-OBWUWZRA.mjs';
3
+ import { rm } from 'fs/promises';
4
+ import path from 'path';
5
+
6
+ // src/server/request-threads/captured-response.ts
7
+ var DEFAULT_STATUS = 200;
8
+ var NO_RESPONSE_STATUS = 500;
9
+ function statusOf(line) {
10
+ const parsed = Number.parseInt(line, 10);
11
+ return Number.isFinite(parsed) ? parsed : DEFAULT_STATUS;
12
+ }
13
+ function bodyBytes(body) {
14
+ if (body === void 0) return new Uint8Array(0);
15
+ if (typeof body === "string") return Buffer.from(body, "utf8");
16
+ return body;
17
+ }
18
+ function createRelayAbort() {
19
+ const listeners = [];
20
+ let aborted = false;
21
+ return {
22
+ get aborted() {
23
+ return aborted;
24
+ },
25
+ onAbort(fn) {
26
+ if (aborted) fn();
27
+ else listeners.push(fn);
28
+ },
29
+ trigger() {
30
+ if (aborted) return;
31
+ aborted = true;
32
+ for (const fn of listeners) fn();
33
+ }
34
+ };
35
+ }
36
+ function createCapturingResponse(remoteAddress, requestId, sendPart) {
37
+ let status = DEFAULT_STATUS;
38
+ const headers = [];
39
+ let finished = false;
40
+ let streaming = false;
41
+ let inFlight = 0;
42
+ let writable = null;
43
+ const abort = createRelayAbort();
44
+ let resolveDone = () => void 0;
45
+ const done = new Promise((resolve) => {
46
+ resolveDone = resolve;
47
+ });
48
+ function finish(body) {
49
+ if (finished) return;
50
+ finished = true;
51
+ if (streaming) {
52
+ sendPart({ type: "stream-end", requestId, failed: false }, []);
53
+ resolveDone(null);
54
+ return;
55
+ }
56
+ resolveDone({ status, headers, body });
57
+ }
58
+ function startStreaming() {
59
+ if (streaming) return;
60
+ streaming = true;
61
+ sendPart({ type: "stream-start", requestId, status, headers }, []);
62
+ }
63
+ const sink = {
64
+ cork(callback) {
65
+ callback();
66
+ return sink;
67
+ },
68
+ writeStatus(line) {
69
+ if (!finished && !streaming) status = statusOf(line);
70
+ return sink;
71
+ },
72
+ writeHeader(key, value) {
73
+ if (!finished && !streaming) headers.push([key, value]);
74
+ return sink;
75
+ },
76
+ end(body) {
77
+ finish(bodyBytes(body));
78
+ return sink;
79
+ },
80
+ write(chunk) {
81
+ if (finished || abort.aborted) return true;
82
+ startStreaming();
83
+ const copy = new Uint8Array(chunk.byteLength);
84
+ copy.set(chunk);
85
+ inFlight += 1;
86
+ sendPart({ type: "stream-chunk", requestId, chunk: copy }, [copy.buffer]);
87
+ return inFlight < RELAY_STREAM_CHUNKS_IN_FLIGHT;
88
+ },
89
+ pause: () => void 0,
90
+ resume: () => void 0,
91
+ close() {
92
+ if (finished) return sink;
93
+ finished = true;
94
+ if (streaming) {
95
+ sendPart({ type: "stream-end", requestId, failed: true }, []);
96
+ resolveDone(null);
97
+ } else {
98
+ status = NO_RESPONSE_STATUS;
99
+ resolveDone({ status, headers, body: new Uint8Array(0) });
100
+ }
101
+ return sink;
102
+ },
103
+ endWithoutBody() {
104
+ finish(new Uint8Array(0));
105
+ return sink;
106
+ },
107
+ tryEnd(body) {
108
+ finish(body);
109
+ return [true, true];
110
+ },
111
+ getWriteOffset: () => 0,
112
+ onWritable(handler) {
113
+ writable = handler;
114
+ return sink;
115
+ },
116
+ onAborted: () => sink,
117
+ onData: () => sink,
118
+ getRemoteAddressAsText: () => new TextEncoder().encode(remoteAddress).buffer
119
+ };
120
+ return {
121
+ sink,
122
+ abort,
123
+ done,
124
+ credit() {
125
+ inFlight = Math.max(0, inFlight - 1);
126
+ if (inFlight >= RELAY_STREAM_CHUNKS_IN_FLIGHT || writable === null) return;
127
+ const handler = writable;
128
+ writable = null;
129
+ handler(0);
130
+ },
131
+ cancel() {
132
+ abort.trigger();
133
+ if (writable !== null) {
134
+ const handler = writable;
135
+ writable = null;
136
+ handler(0);
137
+ }
138
+ if (!finished) {
139
+ finished = true;
140
+ resolveDone(null);
141
+ }
142
+ },
143
+ finishUnanswered() {
144
+ if (finished) return;
145
+ if (streaming) {
146
+ finished = true;
147
+ sendPart({ type: "stream-end", requestId, failed: true }, []);
148
+ resolveDone(null);
149
+ return;
150
+ }
151
+ status = NO_RESPONSE_STATUS;
152
+ finish(new Uint8Array(0));
153
+ }
154
+ };
155
+ }
156
+ function toRelayedResponse(requestId, captured) {
157
+ return { type: "response", requestId, status: captured.status, headers: captured.headers, body: captured.body };
158
+ }
159
+
160
+ // src/server/request-threads/answer-request.ts
161
+ function spooledBodyOf(relayed) {
162
+ if (relayed === null) return null;
163
+ return {
164
+ path: relayed.path,
165
+ bytes: relayed.bytes,
166
+ remove: () => rm(path.dirname(relayed.path), { recursive: true, force: true })
167
+ };
168
+ }
169
+ async function answerRequest(handler, request, port, streams) {
170
+ const captured = createCapturingResponse(
171
+ request.hookContext?.remoteAddress ?? "",
172
+ request.requestId,
173
+ (part, moved) => port.postMessage(part, moved)
174
+ );
175
+ streams.set(request.requestId, captured);
176
+ const ctx = {
177
+ res: captured.sink,
178
+ params: request.params,
179
+ query: new URLSearchParams(request.query),
180
+ contentType: request.contentType,
181
+ rawBody: request.rawBody === null ? null : Buffer.from(request.rawBody.buffer, request.rawBody.byteOffset, request.rawBody.byteLength),
182
+ bodyRefusal: request.bodyRefusal,
183
+ spooledBody: spooledBodyOf(request.spooledBody),
184
+ abort: captured.abort,
185
+ hookContext: request.hookContext
186
+ };
187
+ try {
188
+ await handler(ctx);
189
+ } catch {
190
+ sendError(ctx.res, 500, ServerErrorCodes.INTERNAL_ERROR, "An unexpected error occurred");
191
+ }
192
+ captured.finishUnanswered();
193
+ const answered = await captured.done;
194
+ streams.delete(request.requestId);
195
+ return answered === null ? null : toRelayedResponse(request.requestId, answered);
196
+ }
197
+
198
+ export { answerRequest };
@@ -1,5 +1,5 @@
1
1
  import { VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes } from './chunk-OCB7TMUQ.mjs';
2
- import { createOrdinalFilter, addToOrdinalFilter, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-4XWIW3F3.mjs';
2
+ import { createOrdinalFilter, addToOrdinalFilter, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-HC5NURS6.mjs';
3
3
  import { osqRecordBytes, writeRecord } from './chunk-37CD3OKS.mjs';
4
4
  import { MAX_DOC_ID_LENGTH } from './chunk-LXWDQLTW.mjs';
5
5
  import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
@@ -1,5 +1,5 @@
1
1
  import { rerankQueryTextOf } from './chunk-KZ3NX2P7.mjs';
2
- import { fixedHybridDepthOf, pageByPosition, requireWithinHybridDepth } from './chunk-2RAQKITH.mjs';
2
+ import { fixedHybridDepthOf, pageByPosition, requireWithinHybridDepth } from './chunk-ZR63OGT2.mjs';
3
3
  import { DEFAULT_RERANK_WINDOW, MIN_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
4
4
  import { DEFAULT_LIMIT, DEFAULT_OFFSET } from './chunk-LXWDQLTW.mjs';
5
5
  import { RESULT_WINDOW } from './chunk-E74YLAIG.mjs';
@@ -90,7 +90,7 @@ function rerankTextOf(values) {
90
90
  // src/rerank/pipeline.ts
91
91
  function rerankCursorDepth(cursor, binding, host) {
92
92
  const decoded = host.decodePageCursor(cursor);
93
- host.requireMatchingCursor(decoded, cursor, null, true, binding);
93
+ host.requireMatchingCursor(decoded, cursor, null, true, binding());
94
94
  return decoded.depth ?? 0;
95
95
  }
96
96
  function requireWithinReach(cursorDepth, offset, limit) {
@@ -1,7 +1,7 @@
1
- import { requirePatternSearchFor, requirePartialWordSearchFor, createPartitionIndex, buildPartialWordTableFrom, recordValueSize, patternIndexOf, encodeFieldIndexes, encodePartialSpellingsOf, countPartialSpelling, copyVectorsInto, isCompositePartition, fnv1a, partialSpellingsOfDocuments, createFrozenPartialWords, requirePatternSearch, documentValueBytes, cloneProjected, projectIncludedPaths, valueWithOwnBuffers, createSurfaceRegistry, MAX_TERM_FREQUENCY, joinPatternWorkMeter, fanOutQuery, sanitizeGlobalStats, countsWithoutScores, fanOutMatchCount, createCompositePartition, createGeoIndex, documentWithOwnBuffers, readProjectedPath, createNumericIndex, createBooleanIndex, createEnumIndex, ValueAffixes } from './chunk-5WEBVYOA.mjs';
1
+ import { requirePatternSearchFor, requirePartialWordSearchFor, createPartitionIndex, buildPartialWordTableFrom, recordValueSize, patternIndexOf, encodeFieldIndexes, encodePartialSpellingsOf, countPartialSpelling, copyVectorsInto, isCompositePartition, fnv1a, partialSpellingsOfDocuments, createFrozenPartialWords, requirePatternSearch, documentValueBytes, cloneProjected, projectIncludedPaths, valueWithOwnBuffers, createSurfaceRegistry, MAX_TERM_FREQUENCY, joinPatternWorkMeter, fanOutQuery, sanitizeGlobalStats, countsWithoutScores, fanOutMatchCount, createCompositePartition, createGeoIndex, documentWithOwnBuffers, readProjectedPath, createNumericIndex, createBooleanIndex, createEnumIndex, ValueAffixes } from './chunk-N53HN5VA.mjs';
2
2
  import { generateId, getLanguage } from './chunk-FUUP45IS.mjs';
3
3
  import { readHeapStatistics, readResidentMemory } from './chunk-ZATRDAYU.mjs';
4
- import { GrowableUint32, bitsetHas, bitsetSet, createBitSet } from './chunk-HNAP2KTG.mjs';
4
+ import { GrowableUint32, bitsetHas, bitsetSet, createBitSet } from './chunk-VFAXPDBH.mjs';
5
5
  import { tokenizeOptions, getNestedValue, sameFields, visitDocumentSurfaceSpellings, visitDocumentSpellings } from './chunk-KCQG2PJT.mjs';
6
6
  import { schemaFieldsOf, partialFieldsOf, encodeDocument, validateDocument, validateDocumentStrict, extractVectorFieldsFromSchema } from './chunk-DG62H7OD.mjs';
7
7
  import { fuzzyPrefixOf, boundedLevenshtein } from './chunk-GES7U2PM.mjs';
@@ -9,7 +9,7 @@ import { isWordIndexedBase } from './chunk-6ODIY6ZB.mjs';
9
9
  import { resolveIndexAnalysis, synonymSearchModule } from './chunk-IR4KQ4WB.mjs';
10
10
  import { visitTokens, codePointOrder, encodeStringBlob, encodeLookupKey, SEGMENT_TOKEN_TABLE_START, SEGMENT_POSTING_LOG_START, SEGMENT_POSITION_POOL_START, SEGMENT_FIELD_SCRATCH_START, FROZEN_REMOVAL_INDEX_MAX_PROCESS_FRACTION } from './chunk-OFYKBKKV.mjs';
11
11
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
12
- import { loadedVectorCode, loadVectorCode, loadVectorCodeFor, requireLoadedVectorCode } from './chunk-4PFOOQFQ.mjs';
12
+ import { loadedVectorCode, loadVectorCode, loadVectorCodeFor, requireLoadedVectorCode } from './chunk-BCNUJVTT.mjs';
13
13
  import { PROTOTYPE_POLLUTION_KEYS } from './chunk-L5ORED7V.mjs';
14
14
  import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
15
15
  import { Decoder, decode } from '@msgpack/msgpack';
@@ -3353,6 +3353,7 @@ function createDirectExecutor(options) {
3353
3353
  );
3354
3354
  }
3355
3355
  case "serveRequests":
3356
+ case "serveLongQueries":
3356
3357
  case "stopServing": {
3357
3358
  throw new NarsilError(
3358
3359
  ErrorCodes.CONFIG_INVALID,
@@ -1,6 +1,6 @@
1
- import { readMetadataEnvelope } from './chunk-JUAFWJON.mjs';
2
- import { readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-27ZEY73B.mjs';
3
- import { applyDeleteEntry, applyIndexEntry } from './chunk-LVNBY2TS.mjs';
1
+ import { readMetadataEnvelope } from './chunk-YCSRB3IN.mjs';
2
+ import { readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-KGVC6KJ3.mjs';
3
+ import { applyDeleteEntry, applyIndexEntry } from './chunk-7EWQZQDT.mjs';
4
4
 
5
5
  // src/persistence/durability/recovery.ts
6
6
  async function listPersistedIndexes(directory) {
@@ -1865,6 +1865,7 @@ function answeredByTypoTest(request, tally) {
1865
1865
  }
1866
1866
  function matchPattern(request) {
1867
1867
  const { operator, caseFold, index, matches, host } = request;
1868
+ request.meter.clock?.check();
1868
1869
  const tally = new WorkTally(request.meter);
1869
1870
  if (answeredByTypoTest(request, tally)) {
1870
1871
  tally.flush();
@@ -1,4 +1,4 @@
1
- import { sanitizeSurfaceForms, patternIndexesFromWire, dropStoredVectorValues } from './chunk-JUAFWJON.mjs';
1
+ import { sanitizeSurfaceForms, patternIndexesFromWire, dropStoredVectorValues } from './chunk-YCSRB3IN.mjs';
2
2
  import { requireValidFieldTypes } from './chunk-DG62H7OD.mjs';
3
3
  import { VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
4
4
  import { decode } from '@msgpack/msgpack';
@@ -1,6 +1,6 @@
1
1
  import { nodeThreadId } from './chunk-W55X2BYN.mjs';
2
2
  import { getFs, getPath } from './chunk-HLPRHOSO.mjs';
3
- import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-27ZEY73B.mjs';
3
+ import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-KGVC6KJ3.mjs';
4
4
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
5
5
  import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
6
6
  import { openSync, close, readFileSync } from 'fs';
@@ -1,7 +1,7 @@
1
1
  import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-OCB7TMUQ.mjs';
2
- import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, readSegmentFile, manifestKey, segmentsPrefix, readListedFile, requireListedChecksum, vectorFileKey, graphPartKey } from './chunk-27ZEY73B.mjs';
3
- import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope } from './chunk-PABYSTKO.mjs';
4
- import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-5QIRLJH4.mjs';
2
+ import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, readSegmentFile, manifestKey, segmentsPrefix, readListedFile, requireListedChecksum, vectorFileKey, graphPartKey } from './chunk-KGVC6KJ3.mjs';
3
+ import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope } from './chunk-BCSWODXP.mjs';
4
+ import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-Q62NDKEC.mjs';
5
5
  import { flattenSchema, requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-DG62H7OD.mjs';
6
6
  import { MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
7
7
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
@@ -15,6 +15,7 @@ var KNOWN_ACTION_TYPES = [
15
15
  "dropVectorCopy",
16
16
  "insertVectorOrdinals",
17
17
  "serveRequests",
18
+ "serveLongQueries",
18
19
  "stopServing",
19
20
  "dropIndex",
20
21
  "getStats",
@@ -49,7 +49,7 @@ function pageByPosition(placed, organic, { start, limit, pinnedIds, binding, enc
49
49
  sortKey: null,
50
50
  sortSignature: null,
51
51
  depth,
52
- binding
52
+ binding: binding()
53
53
  });
54
54
  return { page, cursor };
55
55
  }
@@ -1,11 +1,11 @@
1
- export { createDirectExecutor } from './chunk-5QIRLJH4.mjs';
2
- import './chunk-5WEBVYOA.mjs';
1
+ export { createDirectExecutor } from './chunk-Q62NDKEC.mjs';
2
+ import './chunk-N53HN5VA.mjs';
3
3
  import './chunk-FUUP45IS.mjs';
4
4
  import './chunk-ZATRDAYU.mjs';
5
5
  import './chunk-EBIHRL7B.mjs';
6
6
  import './chunk-TGP5M5R7.mjs';
7
7
  import './chunk-U2BKYEC7.mjs';
8
- import './chunk-HNAP2KTG.mjs';
8
+ import './chunk-VFAXPDBH.mjs';
9
9
  import './chunk-WQBCBKY3.mjs';
10
10
  import './chunk-KCQG2PJT.mjs';
11
11
  import './chunk-DG62H7OD.mjs';
@@ -20,7 +20,7 @@ import './chunk-7X5JST5L.mjs';
20
20
  import './chunk-OFYKBKKV.mjs';
21
21
  import './chunk-R6A773WK.mjs';
22
22
  import './chunk-YTJCGKM4.mjs';
23
- import './chunk-4PFOOQFQ.mjs';
23
+ import './chunk-BCNUJVTT.mjs';
24
24
  import './chunk-22YPZVMG.mjs';
25
25
  import './chunk-L5ORED7V.mjs';
26
26
  import './chunk-OBWUWZRA.mjs';
@@ -3,29 +3,29 @@ import { MAX_WAIT_FOR_ACTIVE_REPLICAS, MIN_CONTROLLER_LEASE_TTL_MS, MAX_NODE_LEF
3
3
  export { DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR } from './chunk-HFJXEFFV.mjs';
4
4
  import { addBackgroundAdmission, workWaitingForMemory } from './chunk-PELHVTO7.mjs';
5
5
  import { onRefusalAfterCollection, reservedHeapBytes, reserveHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal } from './chunk-IWVEG5CX.mjs';
6
- import { fixedHybridDepthOf, requireWithinHybridDepth, pageByPosition } from './chunk-2RAQKITH.mjs';
7
- import { closePartitionWriter, replaySyncedWal } from './chunk-DZXGNLK5.mjs';
8
- import { buildArchiveFromMemory, archiveStream, memoryCheckpointStore, readSnapshotArchive } from './chunk-QGVMEMCG.mjs';
9
- import './chunk-CU4OB64V.mjs';
10
- import { indexMetadataOf, loadPartitionSegments, readSegmentManifest, readVectorFile } from './chunk-JUAFWJON.mjs';
6
+ import { fixedHybridDepthOf, requireWithinHybridDepth, pageByPosition } from './chunk-ZR63OGT2.mjs';
7
+ import { closePartitionWriter, replaySyncedWal } from './chunk-UDZYIWDP.mjs';
8
+ import { buildArchiveFromMemory, archiveStream, memoryCheckpointStore, readSnapshotArchive } from './chunk-KVLX65KD.mjs';
9
+ import './chunk-NX7KU77V.mjs';
10
+ import { indexMetadataOf, loadPartitionSegments, readSegmentManifest, readVectorFile } from './chunk-YCSRB3IN.mjs';
11
11
  import { decodeVectorFilePayload, bytesToVectors, isDead } from './chunk-OCB7TMUQ.mjs';
12
12
  import { CONTROLLER_LEASE_KEY } from './chunk-44W3CBNG.mjs';
13
13
  import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
14
- import './chunk-4XWIW3F3.mjs';
14
+ import './chunk-HC5NURS6.mjs';
15
15
  import './chunk-DJHHF2L5.mjs';
16
16
  import './chunk-37CD3OKS.mjs';
17
17
  import { getPath, getFs } from './chunk-HLPRHOSO.mjs';
18
- import { createForwardBatchResultMessage, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, readListedFile, optionalIndexUuid, computeEntryChecksum, createPrimaryResignMessage, validateInsyncConfirmPayload, buildEntry, createInsyncRemoveMessage, createEntryBatchMessage, createInsyncConfirmMessage, createEntryMessage, validateAckPayload, createInsyncAddMessage, directoryCheckpointStore, checkpointLastSeqNo, checkpointPrimaryTerm, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage } from './chunk-27ZEY73B.mjs';
19
- import { applyIndexEntry, applyDeleteEntry, validateReplicationEntry } from './chunk-LVNBY2TS.mjs';
18
+ import { createForwardBatchResultMessage, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, readListedFile, optionalIndexUuid, computeEntryChecksum, createPrimaryResignMessage, validateInsyncConfirmPayload, buildEntry, createInsyncRemoveMessage, createEntryBatchMessage, createInsyncConfirmMessage, createEntryMessage, validateAckPayload, createInsyncAddMessage, directoryCheckpointStore, checkpointLastSeqNo, checkpointPrimaryTerm, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage } from './chunk-KGVC6KJ3.mjs';
19
+ import { applyIndexEntry, applyDeleteEntry, validateReplicationEntry } from './chunk-7EWQZQDT.mjs';
20
20
  import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, WIRE_BATCH_BUDGET } from './chunk-P36MUFEJ.mjs';
21
21
  import { TransportErrorCodes, ReplicationMessageTypes, ClusterMessageTypes, QueryMessageTypes, TransportError, DEFAULT_TRANSPORT_CONFIG } from './chunk-YH5OIL7B.mjs';
22
- import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, createEngineIndex, encodeIndexConfiguration, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, createByteReader, openChecksummedEnvelope, emptySerializablePartition, crc32Init, crc32Final, crc32Update, yieldToEventLoop } from './chunk-PABYSTKO.mjs';
23
- import { runtimeHost, requireSurfaceFormsForPartialFields, now, listBindingOf, clampLimit, hitsKeptPerGroup, queryBindingOf, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-GLZI636G.mjs';
22
+ import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, createEngineIndex, encodeIndexConfiguration, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, createByteReader, openChecksummedEnvelope, emptySerializablePartition, crc32Init, crc32Final, crc32Update, yieldToEventLoop } from './chunk-BCSWODXP.mjs';
23
+ import { runtimeHost, requireSurfaceFormsForPartialFields, now, listBindingOf, clampLimit, hitsKeptPerGroup, queryBindingOf, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-5VVSHCXT.mjs';
24
24
  import { bindRerankWindowSource, rerankWindowCapOf, providedDocId, engineCoreOf } from './chunk-N57XXGPG.mjs';
25
25
  import './chunk-6PN3U6XW.mjs';
26
26
  import './chunk-AV4IJKD2.mjs';
27
- import { synonymModule } from './chunk-5QIRLJH4.mjs';
28
- import { oversampledShardSize, normalizeSort, sortModesOf, readSortValues, resolveProjection, fnv1a, applyProjection, FILTER_EXPRESSION_KEYS, filterTestCount, setNestedValue, FIELD_FILTER_OPERATORS, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, encodePageCursor, requireWithinResultWindow, sortSignatureEntry, fnv1aUint32s, mergePartitionStats } from './chunk-5WEBVYOA.mjs';
27
+ import { synonymModule } from './chunk-Q62NDKEC.mjs';
28
+ import { oversampledShardSize, normalizeSort, sortModesOf, readSortValues, resolveProjection, fnv1a, applyProjection, FILTER_EXPRESSION_KEYS, filterTestCount, setNestedValue, FIELD_FILTER_OPERATORS, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, encodePageCursor, requireWithinResultWindow, sortSignatureEntry, fnv1aUint32s, mergePartitionStats } from './chunk-N53HN5VA.mjs';
29
29
  import { generateId, getLanguage } from './chunk-FUUP45IS.mjs';
30
30
  import './chunk-ZATRDAYU.mjs';
31
31
  import './chunk-EBIHRL7B.mjs';
@@ -36,7 +36,7 @@ import './chunk-U2BKYEC7.mjs';
36
36
  import './chunk-KOKM4PQN.mjs';
37
37
  import { MIN_OVERSAMPLE } from './chunk-QSK35UC2.mjs';
38
38
  import './chunk-VK45J47R.mjs';
39
- import { isPatternTolerance } from './chunk-HNAP2KTG.mjs';
39
+ import { isPatternTolerance } from './chunk-VFAXPDBH.mjs';
40
40
  import { MAX_FILTER_DEPTH, MAX_FILTER_TESTS, MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
41
41
  import { getNestedValue } from './chunk-KCQG2PJT.mjs';
42
42
  import { encodeDocument, validateSchema, requireCreatableSchema, encodeDocumentReply, schemaFieldsOf, MIN_POLYGON_POINTS, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES } from './chunk-DG62H7OD.mjs';
@@ -52,8 +52,8 @@ import './chunk-OFYKBKKV.mjs';
52
52
  import { isSortMode, SORT_MODES, toComparableSortValue, compareComparableKeys, compareSortValues } from './chunk-R6A773WK.mjs';
53
53
  import { compareCodePoints, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
54
54
  import { collectAndReturnPages } from './chunk-RIIUZJQ3.mjs';
55
- import './chunk-CQUMNIIG.mjs';
56
- import './chunk-4PFOOQFQ.mjs';
55
+ import './chunk-Z4DZ4KK2.mjs';
56
+ import './chunk-BCNUJVTT.mjs';
57
57
  import { HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-22YPZVMG.mjs';
58
58
  import './chunk-RFBLQLLZ.mjs';
59
59
  import { MAX_STORED_VECTOR_DIMENSION, MAX_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
@@ -16187,7 +16187,7 @@ function pageFixedDepth(placed, fused, pins, allMatchesPresent, start, page, dep
16187
16187
  start,
16188
16188
  limit: page.limit,
16189
16189
  pinnedIds: placedIds,
16190
- binding: page.binding,
16190
+ binding: () => page.binding,
16191
16191
  encodeCursor: encodePageCursor
16192
16192
  });
16193
16193
  return { page: paged.page.map((hit) => hit.entry), cursor: paged.cursor ?? null };
@@ -17144,7 +17144,7 @@ async function queryCluster(deps, indexName, params) {
17144
17144
  (reader) => searchCluster(deps, indexName, params, allocation, reader, false)
17145
17145
  );
17146
17146
  }
17147
- const { rerankClusterQuery } = await import('./rerank-3POMPQNX.mjs');
17147
+ const { rerankClusterQuery } = await import('./rerank-NYX5S7OG.mjs');
17148
17148
  return withRankedReader(
17149
17149
  deps,
17150
17150
  indexName,
@@ -1,22 +1,22 @@
1
- import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-OM5G2J6X.mjs';
2
- import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-DZXGNLK5.mjs';
3
- import { decodeSegmentManifest, SINGLE_NODE_PRIMARY_TERM, readMetadataEnvelope, writeMetadataEnvelope, metadataFromConfig, createSeqOwner, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, isRecord, invalidManifest, unpackEnvelopeBytes, isId, isUint32, isSequenceNumber, writeLiveVectors, growPartitionsTo, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf, readCurrentManifest } from './chunk-JUAFWJON.mjs';
1
+ import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-VOKEYJHU.mjs';
2
+ import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-UDZYIWDP.mjs';
3
+ import { decodeSegmentManifest, SINGLE_NODE_PRIMARY_TERM, readMetadataEnvelope, writeMetadataEnvelope, metadataFromConfig, createSeqOwner, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, isRecord, invalidManifest, unpackEnvelopeBytes, isId, isUint32, isSequenceNumber, writeLiveVectors, growPartitionsTo, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf, readCurrentManifest } from './chunk-YCSRB3IN.mjs';
4
4
  import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-OCB7TMUQ.mjs';
5
5
  import './chunk-37CD3OKS.mjs';
6
- import { createDurableDirectory } from './chunk-OABTAUCW.mjs';
6
+ import { createDurableDirectory } from './chunk-YCFQ5754.mjs';
7
7
  import { spawnNodeWorker } from './chunk-W55X2BYN.mjs';
8
8
  import { getFs } from './chunk-HLPRHOSO.mjs';
9
- import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, directoryCheckpointStore, manifestKey, readListedFile, adapterCheckpointStore, snapshotBundleKey, manifestReferencedKeys, manifestFileRefs, readSegmentFile, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, commitCheckpointManifest, removeCheckpointGarbage, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, SEGMENT_HEADER_SIZE, buildEntry, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, checkpointLastSeqNo, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-27ZEY73B.mjs';
10
- import './chunk-LVNBY2TS.mjs';
9
+ import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, directoryCheckpointStore, manifestKey, readListedFile, adapterCheckpointStore, snapshotBundleKey, manifestReferencedKeys, manifestFileRefs, readSegmentFile, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, commitCheckpointManifest, removeCheckpointGarbage, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, SEGMENT_HEADER_SIZE, buildEntry, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, checkpointLastSeqNo, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-KGVC6KJ3.mjs';
10
+ import './chunk-7EWQZQDT.mjs';
11
11
  import './chunk-P36MUFEJ.mjs';
12
12
  import './chunk-YH5OIL7B.mjs';
13
- import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-PABYSTKO.mjs';
14
- import './chunk-GLZI636G.mjs';
13
+ import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-BCSWODXP.mjs';
14
+ import './chunk-5VVSHCXT.mjs';
15
15
  import './chunk-N57XXGPG.mjs';
16
16
  import { resolveWorkerEntry } from './chunk-6PN3U6XW.mjs';
17
17
  import { detectRuntime } from './chunk-AV4IJKD2.mjs';
18
- import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-5QIRLJH4.mjs';
19
- import { fnv1a } from './chunk-5WEBVYOA.mjs';
18
+ import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-Q62NDKEC.mjs';
19
+ import { fnv1a } from './chunk-N53HN5VA.mjs';
20
20
  import './chunk-FUUP45IS.mjs';
21
21
  import './chunk-ZATRDAYU.mjs';
22
22
  import './chunk-EBIHRL7B.mjs';
@@ -27,7 +27,7 @@ import './chunk-U2BKYEC7.mjs';
27
27
  import './chunk-KOKM4PQN.mjs';
28
28
  import './chunk-QSK35UC2.mjs';
29
29
  import './chunk-VK45J47R.mjs';
30
- import './chunk-HNAP2KTG.mjs';
30
+ import './chunk-VFAXPDBH.mjs';
31
31
  import './chunk-WQBCBKY3.mjs';
32
32
  import './chunk-KCQG2PJT.mjs';
33
33
  import { encodeDocument, requireValidFieldTypes } from './chunk-DG62H7OD.mjs';
@@ -42,8 +42,8 @@ import './chunk-7X5JST5L.mjs';
42
42
  import './chunk-OFYKBKKV.mjs';
43
43
  import './chunk-R6A773WK.mjs';
44
44
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
45
- import './chunk-CQUMNIIG.mjs';
46
- import './chunk-4PFOOQFQ.mjs';
45
+ import './chunk-Z4DZ4KK2.mjs';
46
+ import './chunk-BCNUJVTT.mjs';
47
47
  import './chunk-22YPZVMG.mjs';
48
48
  import './chunk-RFBLQLLZ.mjs';
49
49
  import './chunk-L5ORED7V.mjs';
@@ -1,4 +1,4 @@
1
- export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-DC2SZO4D.mjs';
1
+ export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-2TMWIATH.mjs';
2
2
  export { isSimdAvailable } from './browser/chunk-2CBQ2PCC.mjs';
3
3
  import './browser/chunk-JPTQZWJQ.mjs';
4
4
  export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-LJS6PREA.mjs';