@delali/narsil 0.3.1-next.143 → 0.3.1-next.145

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 (165) hide show
  1. package/dist/adapters/filesystem.d.ts +1 -1
  2. package/dist/adapters/filesystem.mjs +101 -13
  3. package/dist/adapters/gcs.d.ts +49 -0
  4. package/dist/adapters/gcs.mjs +213 -0
  5. package/dist/adapters/indexeddb.d.ts +1 -1
  6. package/dist/adapters/indexeddb.mjs +2 -7
  7. package/dist/adapters/memory.d.ts +1 -1
  8. package/dist/adapters/memory.mjs +5 -0
  9. package/dist/adapters/s3.d.ts +53 -0
  10. package/dist/adapters/s3.mjs +263 -0
  11. package/dist/{adapters-BQFQ4PRz.d.ts → adapters-pljAqmrC.d.ts} +33 -0
  12. package/dist/{analysis-change-HQUT2Z3I.mjs → analysis-change-D5APH4Z3.mjs} +24 -33
  13. package/dist/{browser/analysis-change-entry-7HR4LWL3.mjs → analysis-change-entry-V4SQQSXQ.mjs} +1 -1
  14. package/dist/browser/{analysis-change-JPV775LR.mjs → analysis-change-QTCQ5ETU.mjs} +5 -5
  15. package/dist/{analysis-change-entry-TZTG4AZB.mjs → browser/analysis-change-entry-KYEQSP3I.mjs} +1 -1
  16. package/dist/{chunk-46NZOPHS.mjs → browser/chunk-5WYWLTM5.mjs} +2 -2
  17. package/dist/browser/{chunk-ZEV26AQ6.mjs → chunk-6OFS7RUN.mjs} +1 -1
  18. package/dist/browser/{chunk-MZI3TEOW.mjs → chunk-75PMIFQA.mjs} +1 -1
  19. package/dist/browser/{chunk-R4WUDZQV.mjs → chunk-AOKLYVTT.mjs} +2 -2
  20. package/dist/browser/{chunk-LVY2LI35.mjs → chunk-BTMRV5MY.mjs} +2 -2
  21. package/dist/browser/{chunk-3ZBJYAS4.mjs → chunk-FHO5N7FD.mjs} +1 -1
  22. package/dist/browser/{chunk-KTOK275N.mjs → chunk-FXPMF65P.mjs} +12 -12
  23. package/dist/browser/{chunk-VFYMPCOV.mjs → chunk-GP4QLUQM.mjs} +5 -5
  24. package/dist/browser/{chunk-35B42UFM.mjs → chunk-IFGTRRPU.mjs} +9 -0
  25. package/dist/browser/{chunk-6RHTAVZX.mjs → chunk-K7UFXEJS.mjs} +31 -14
  26. package/dist/browser/{chunk-MVM33ZUL.mjs → chunk-LGJ6XMH5.mjs} +5 -5
  27. package/dist/{chunk-NN33CZRE.mjs → browser/chunk-PMBSBSCN.mjs} +2 -2
  28. package/dist/browser/{chunk-D33A5VMU.mjs → chunk-QNDWMPV2.mjs} +1 -1
  29. package/dist/browser/{chunk-HKX2G6WH.mjs → chunk-U77XQJOY.mjs} +3 -3
  30. package/dist/browser/{chunk-TCLEOZ4P.mjs → chunk-XIHLIMFX.mjs} +2 -2
  31. package/dist/browser/{chunk-WCFCHIBB.mjs → chunk-XWMEGKDC.mjs} +2 -2
  32. package/dist/browser/{chunk-5DB2VDGI.mjs → chunk-ZALEKEUH.mjs} +27 -27
  33. package/dist/browser/{chunk-MWUK3DA5.mjs → chunk-ZKVDQ5ZH.mjs} +8 -8
  34. package/dist/browser/{cold-module-MJMKNUYJ.mjs → cold-module-Y2IJAP7S.mjs} +14 -14
  35. package/dist/browser/{durability-wiring-SNOWIT6Z.mjs → durability-wiring-MLXZ5QQF.mjs} +78 -61
  36. package/dist/browser/import-FTMLTPGQ.mjs +9 -0
  37. package/dist/browser/{module-BUFNZMEU.mjs → module-5LMDGXQH.mjs} +10 -10
  38. package/dist/browser/{module-BVP4TKZU.mjs → module-Q6VFGLMG.mjs} +71 -11
  39. package/dist/browser/{phrase-module-HGVBO24W.mjs → phrase-module-KXNRTWCS.mjs} +1 -1
  40. package/dist/{restore-queue-FEYAC4SB.mjs → browser/restore-queue-SOAHKZSQ.mjs} +2 -2
  41. package/dist/browser/{runtime-VEUH674B.mjs → runtime-ZNEGK33G.mjs} +2 -2
  42. package/dist/browser/{snapshot-QXBKHJAG.mjs → snapshot-2EGS2FYU.mjs} +16 -15
  43. package/dist/browser/{write-WHFBDWQS.mjs → write-WMZA6NSF.mjs} +11 -11
  44. package/dist/{capabilities-BCdUwK_L.d.ts → capabilities-CNnzGtqP.d.ts} +3 -3
  45. package/dist/{chunk-ZMBFWQXN.mjs → chunk-2E2ZFOPT.mjs} +2 -2
  46. package/dist/{chunk-BOJZGUS6.mjs → chunk-5K2JHKM3.mjs} +1 -1
  47. package/dist/{chunk-YH5OIL7B.mjs → chunk-5QMHMELB.mjs} +6 -1
  48. package/dist/{browser/chunk-CCOAOO73.mjs → chunk-6FOJKNUR.mjs} +2 -2
  49. package/dist/{chunk-GLZHNSGB.mjs → chunk-6Z22L5RN.mjs} +1 -1
  50. package/dist/{chunk-AST3SHFA.mjs → chunk-7523VCM4.mjs} +2 -2
  51. package/dist/{chunk-KZL72VTC.mjs → chunk-7AJAW6NN.mjs} +11 -10
  52. package/dist/{chunk-DQNKVOJ2.mjs → chunk-BTARFTEN.mjs} +695 -8
  53. package/dist/{chunk-YLNSJQLX.mjs → chunk-DHEJAGVW.mjs} +5 -5
  54. package/dist/{chunk-Z4HFMYNX.mjs → chunk-DKMZ7JFW.mjs} +29 -12
  55. package/dist/{chunk-NRUXBYPH.mjs → chunk-F442VZUL.mjs} +5 -5
  56. package/dist/{chunk-O4LJQI4G.mjs → chunk-FRJ5RGX7.mjs} +126 -4
  57. package/dist/{chunk-L76W3IZJ.mjs → chunk-FTQLF5JI.mjs} +1 -1
  58. package/dist/{chunk-UIKN2OTQ.mjs → chunk-G6Q5DEF5.mjs} +37 -3
  59. package/dist/{chunk-DD2673TX.mjs → chunk-GRFXSEFF.mjs} +2 -2
  60. package/dist/{chunk-ZSWHPKGM.mjs → chunk-GVPYMSLO.mjs} +69 -2
  61. package/dist/{chunk-VEFN6X6Q.mjs → chunk-HOC5JP2H.mjs} +9 -10
  62. package/dist/{chunk-SRJBFG2T.mjs → chunk-HTMUGEFU.mjs} +6 -7
  63. package/dist/{chunk-J6YVB2XM.mjs → chunk-IJPK5PGM.mjs} +1 -1
  64. package/dist/{chunk-HNHCNTVG.mjs → chunk-IQHZMCLX.mjs} +9 -0
  65. package/dist/{chunk-C3YDYX6C.mjs → chunk-ISUOSACK.mjs} +1 -1
  66. package/dist/{chunk-YHUTF6EA.mjs → chunk-IV2XTSS2.mjs} +14 -14
  67. package/dist/chunk-K5HSUPYS.mjs +11 -0
  68. package/dist/{chunk-LA4WNDHL.mjs → chunk-KG5N7LE6.mjs} +12 -14
  69. package/dist/{chunk-NPNK57CA.mjs → chunk-LWFK3TC2.mjs} +1 -1
  70. package/dist/{chunk-RKAVHNRW.mjs → chunk-LYKUJNAV.mjs} +10 -5
  71. package/dist/{chunk-TNBIK2LQ.mjs → chunk-MJTEU2XK.mjs} +3 -4
  72. package/dist/chunk-NWTEJ2T7.mjs +100 -0
  73. package/dist/{chunk-WJGO5PGV.mjs → chunk-OH7SX5MY.mjs} +28 -16
  74. package/dist/{chunk-W2COJ5AH.mjs → chunk-ONDEEBTA.mjs} +2 -2
  75. package/dist/{chunk-PWIWSUCX.mjs → chunk-POUYICOU.mjs} +1 -1
  76. package/dist/chunk-PRID7CA6.mjs +104 -0
  77. package/dist/{chunk-ICW45TTU.mjs → chunk-QLDLQW36.mjs} +1 -1
  78. package/dist/{chunk-KEIYVZUX.mjs → chunk-QU2XF7VI.mjs} +3 -4
  79. package/dist/{chunk-74XB2SXI.mjs → chunk-QXH2CS4V.mjs} +35 -2
  80. package/dist/{chunk-ZPWS2SKJ.mjs → chunk-QYMAYU7M.mjs} +165 -11
  81. package/dist/{chunk-NJJCPFXN.mjs → chunk-RNUP6WZ6.mjs} +2 -2
  82. package/dist/{chunk-SBMAWTRG.mjs → chunk-RTVAWNUL.mjs} +80 -14
  83. package/dist/{chunk-7AUASRE7.mjs → chunk-RVBUQITB.mjs} +7 -7
  84. package/dist/{chunk-VJEGOELZ.mjs → chunk-SA52N7G3.mjs} +3 -3
  85. package/dist/{chunk-NOT5QOHU.mjs → chunk-SE7MKJVK.mjs} +1 -1
  86. package/dist/{chunk-BRUUBXCB.mjs → chunk-SNB4DYL3.mjs} +10 -38
  87. package/dist/chunk-SVO6NV4D.mjs +248 -0
  88. package/dist/{chunk-GWOS5DYC.mjs → chunk-UGQULMSU.mjs} +11 -13
  89. package/dist/{chunk-6SNBQESJ.mjs → chunk-UHVTEVF5.mjs} +5 -5
  90. package/dist/{chunk-HJJWY6PT.mjs → chunk-UQS5PAS5.mjs} +1 -1
  91. package/dist/{chunk-UUZCQQG2.mjs → chunk-W6M4RRAT.mjs} +3 -3
  92. package/dist/{browser/chunk-XNWPP5NS.mjs → chunk-WDEWU46C.mjs} +2 -2
  93. package/dist/{chunk-XZ3SRNDJ.mjs → chunk-WMIV7PJ7.mjs} +65 -5
  94. package/dist/{chunk-RHKRTYGO.mjs → chunk-X5SBWARI.mjs} +3 -3
  95. package/dist/{chunk-XS2VM7UE.mjs → chunk-XLAI4OIO.mjs} +2 -2
  96. package/dist/{chunk-IO5F7ZBE.mjs → chunk-YUCGFPMS.mjs} +454 -37
  97. package/dist/{client-B12YFALP.d.ts → client-DoYPHcUn.d.ts} +62 -5
  98. package/dist/client.d.ts +8 -8
  99. package/dist/client.mjs +44 -0
  100. package/dist/{cold-module-4X7WJCFM.mjs → cold-module-NUD332YD.mjs} +32 -41
  101. package/dist/{config-CIG5yDyg.d.ts → config-CuUfls_H.d.ts} +150 -3
  102. package/dist/{config-BhZxIeb1.d.ts → config-Dzs46im6.d.ts} +11 -2
  103. package/dist/direct-executor-FDQYQEJQ.mjs +22 -0
  104. package/dist/distribution/coordinator/etcd.d.ts +3 -3
  105. package/dist/distribution/coordinator/etcd.mjs +1 -1
  106. package/dist/distribution/coordinator/in-memory.d.ts +3 -3
  107. package/dist/distribution/transport/grpc.mjs +4 -4
  108. package/dist/distribution/transport/in-memory.mjs +2 -2
  109. package/dist/distribution/transport/tcp.mjs +3 -3
  110. package/dist/distribution.d.ts +8 -8
  111. package/dist/distribution.mjs +16219 -14535
  112. package/dist/{durability-wiring-324D2DDD.mjs → durability-wiring-K7RDXWL6.mjs} +103 -95
  113. package/dist/embeddings/openai.d.ts +1 -1
  114. package/dist/embeddings/openai.mjs +2 -2
  115. package/dist/{engine-CtzbHOmG.d.ts → engine-C0ifUEcm.d.ts} +3 -3
  116. package/dist/import-6KXFY6XI.mjs +35 -0
  117. package/dist/{index-DsEurhSl.d.ts → index-MsF7e5hL.d.ts} +2 -2
  118. package/dist/index.browser.mjs +4 -4
  119. package/dist/index.d.ts +7 -7
  120. package/dist/index.mjs +21 -30
  121. package/dist/invalidation/broadcast-channel.d.ts +1 -1
  122. package/dist/invalidation/filesystem.d.ts +1 -1
  123. package/dist/invalidation/filesystem.mjs +1 -1
  124. package/dist/invalidation/noop.d.ts +1 -1
  125. package/dist/{long-query-thread-4SW7RWDE.mjs → long-query-thread-FKVHRCHF.mjs} +18 -23
  126. package/dist/{module-DXSJ5LT2.mjs → module-GJUKW5VU.mjs} +14 -16
  127. package/dist/{module-IYPLWHGC.mjs → module-TMFIWOD2.mjs} +28 -37
  128. package/dist/{paged-partition-archive-HFP45PLU.mjs → paged-partition-archive-WNUEMYWM.mjs} +34 -39
  129. package/dist/partial-words.mjs +7 -9
  130. package/dist/pattern.mjs +4 -6
  131. package/dist/persistence/durability/checkpoint-worker.d.ts +2 -2
  132. package/dist/persistence/durability/checkpoint-worker.mjs +27 -36
  133. package/dist/{phrase-module-5QHBD2VJ.mjs → phrase-module-OMY3QQV7.mjs} +1 -1
  134. package/dist/react.d.ts +11 -11
  135. package/dist/react.mjs +9 -0
  136. package/dist/{rerank-KTLC3E6N.mjs → rerank-ZZ5CHKLW.mjs} +4 -4
  137. package/dist/rerankers/http.d.ts +1 -1
  138. package/dist/rerankers/http.mjs +2 -2
  139. package/dist/{browser/restore-queue-ONYNYUDE.mjs → restore-queue-UAVGBSJG.mjs} +2 -2
  140. package/dist/{runtime-DYV75DCB.mjs → runtime-RAOCKSYA.mjs} +5 -5
  141. package/dist/{schema-B-Runv0n.d.ts → schema-D33CyXCy.d.ts} +1 -1
  142. package/dist/server.d.ts +24 -12
  143. package/dist/server.mjs +153 -36
  144. package/dist/{snapshot-CGM65VCD.mjs → snapshot-DB5ZVCDN.mjs} +39 -48
  145. package/dist/synonyms.mjs +3 -4
  146. package/dist/{tasks-CjRJRGTb.d.ts → tasks-ChWp0wrF.d.ts} +59 -7
  147. package/dist/{thread-KGNAIKPD.mjs → thread-OV6T555H.mjs} +17 -22
  148. package/dist/vector/search-worker.d.ts +2 -2
  149. package/dist/vector/search-worker.mjs +5 -6
  150. package/dist/workers/entry.mjs +7 -7
  151. package/dist/{write-2DZPEQL2.mjs → write-KZVTLGCI.mjs} +28 -37
  152. package/openapi.json +349 -2
  153. package/package.json +27 -8
  154. package/dist/browser/import-TLB2A5LJ.mjs +0 -9
  155. package/dist/chunk-5WYVUPGD.mjs +0 -427
  156. package/dist/chunk-AV4IJKD2.mjs +0 -35
  157. package/dist/chunk-GES7U2PM.mjs +0 -68
  158. package/dist/chunk-KGOXHLLZ.mjs +0 -693
  159. package/dist/chunk-N37VMC62.mjs +0 -18
  160. package/dist/chunk-QSK35UC2.mjs +0 -35
  161. package/dist/chunk-WNBRW4Q2.mjs +0 -128
  162. package/dist/chunk-WQBCBKY3.mjs +0 -8
  163. package/dist/chunk-ZATRDAYU.mjs +0 -160
  164. package/dist/direct-executor-7XOQ7VQP.mjs +0 -28
  165. package/dist/import-OOBUW3RR.mjs +0 -44
@@ -1,17 +1,15 @@
1
1
  import { WIRE_BATCH_BUDGET } from './chunk-JDDXV6UF.mjs';
2
- import { DEFAULT_COMPACTION_THRESHOLD, writeSegmentsOf, readSegmentFile, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-7AUASRE7.mjs';
3
- import { encodeSegmentManifest, SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION } from './chunk-UUZCQQG2.mjs';
4
- import { restoreVectorFields } from './chunk-KEIYVZUX.mjs';
5
- import { ReplicationMessageTypes } from './chunk-YH5OIL7B.mjs';
6
- import { crc32, reconstructSchemaFromMetadata, prepareDocumentVectors } from './chunk-IO5F7ZBE.mjs';
7
- import { freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, shareSegmentArrays } from './chunk-WJGO5PGV.mjs';
8
- import { isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-ZPWS2SKJ.mjs';
9
- import { generateId } from './chunk-N37VMC62.mjs';
10
- import { extractVectorFieldsFromSchema, partialFieldsOf } from './chunk-KGOXHLLZ.mjs';
2
+ import { DEFAULT_COMPACTION_THRESHOLD, writeSegmentsOf, readSegmentFile, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-RVBUQITB.mjs';
3
+ import { restoreVectorFields } from './chunk-QU2XF7VI.mjs';
4
+ import { encodeSegmentManifest, SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION } from './chunk-W6M4RRAT.mjs';
5
+ import { ReplicationMessageTypes } from './chunk-5QMHMELB.mjs';
6
+ import { crc32, reconstructSchemaFromMetadata, prepareDocumentVectors } from './chunk-YUCGFPMS.mjs';
7
+ import { generateId, freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, shareSegmentArrays } from './chunk-OH7SX5MY.mjs';
8
+ import { isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-QYMAYU7M.mjs';
9
+ import { getLanguage, resolveIndexAnalysis } from './chunk-FRJ5RGX7.mjs';
10
+ import { extractVectorFieldsFromSchema, partialFieldsOf } from './chunk-BTARFTEN.mjs';
11
11
  import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
12
- import { resolveIndexAnalysis } from './chunk-O4LJQI4G.mjs';
13
- import { getLanguage } from './chunk-WNBRW4Q2.mjs';
14
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
12
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
15
13
  import { encode, decode } from '@msgpack/msgpack';
16
14
 
17
15
  // src/persistence/durability/segment/captured-partition.ts
@@ -879,7 +877,7 @@ async function compactPartitionSegments(input) {
879
877
  if (paged) {
880
878
  const { directory } = input.store;
881
879
  if (directory === void 0) return { segments, nextSegmentId: input.nextSegmentId };
882
- const { mergePagedWindow } = await import('./module-IYPLWHGC.mjs');
880
+ const { mergePagedWindow } = await import('./module-TMFIWOD2.mjs');
883
881
  return replacing(
884
882
  await mergePagedWindow({
885
883
  store: input.store,
@@ -967,7 +965,7 @@ function pagedSettingsOf(context) {
967
965
  async function tombstonesOfDelta(context, older, selections, deleted) {
968
966
  const { directory } = context.input.store;
969
967
  if (context.input.metadata.textStorage !== "disk" || directory === void 0) return deleted;
970
- const { pagedTombstonesFor } = await import('./module-IYPLWHGC.mjs');
968
+ const { pagedTombstonesFor } = await import('./module-TMFIWOD2.mjs');
971
969
  return pagedTombstonesFor(
972
970
  directory,
973
971
  older,
@@ -1,6 +1,6 @@
1
1
  import { LOOKUP_KEY_SCRATCH_BYTES } from './chunk-4UMZ7KQL.mjs';
2
+ import { createNarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
2
3
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
3
- import { createNarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
4
4
 
5
5
  // src/core/tokenizer/constants.ts
6
6
  var TOKEN_CACHE_SIZE_FLOOR = 5e4;
@@ -1,9 +1,7 @@
1
- import { MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
2
1
  import { bitsetHas, bitsetSet, GrowableUint32, createBitSet, bitsetAnd, bitsetNot } from './chunk-JUKYYXSP.mjs';
3
- import { tabulatedLevenshtein } from './chunk-GES7U2PM.mjs';
4
- import { parsedTypeOf } from './chunk-ZSWHPKGM.mjs';
2
+ import { parsedTypeOf, tabulatedLevenshtein } from './chunk-GVPYMSLO.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
5
4
  import { codePointCount, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
6
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
7
5
 
8
6
  // src/core/pattern-index/constants.ts
9
7
  var DEFAULT_PATTERN_WORK_CAP = 25e6;
@@ -2281,6 +2279,13 @@ function mergePatternArrays(fieldPath, inputs) {
2281
2279
  return trimmedArrays(fieldPath, docIds, runs, offsets, postings);
2282
2280
  }
2283
2281
 
2282
+ // src/filters/constants.ts
2283
+ var MAX_FILTER_DEPTH = 30;
2284
+ var MAX_FILTER_TESTS = 1024;
2285
+ var FILTER_OPERAND_COPY_DEPTH = 3;
2286
+ var MAX_FILTER_ARRAY_SIZE = 65536;
2287
+ var GEO_UNIT_METRES = { km: 1e3, mi: 1609.344, m: 1 };
2288
+
2284
2289
  // src/filters/operands/checks.ts
2285
2290
  function operandKindOf(type) {
2286
2291
  if (type === void 0) return void 0;
@@ -2505,4 +2510,4 @@ var patternSearchModule = {
2505
2510
  decodeIndex: decodePatternIndex
2506
2511
  };
2507
2512
 
2508
- export { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES, PATTERN_ELEMENT_OPERATORS, PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_WORK_FLUSH_UNITS, TYPO_CLAIM_SLOTS_PER_WORD, invalid, isFiniteNumber, isObjectRecord, isPatternTolerance, kindOfValue, patternSearchModule, requireFieldKind, requireListLength, requireTextRangeField };
2513
+ export { DEFAULT_PATTERN_WORK_CAP, FILTER_OPERAND_COPY_DEPTH, GEO_UNIT_METRES, MATCHER_STATE_BUDGET_BYTES, MAX_FILTER_ARRAY_SIZE, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, PATTERN_ELEMENT_OPERATORS, PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_WORK_FLUSH_UNITS, TYPO_CLAIM_SLOTS_PER_WORD, invalid, isFiniteNumber, isObjectRecord, isPatternTolerance, kindOfValue, patternSearchModule, requireFieldKind, requireListLength, requireTextRangeField };
@@ -1,12 +1,11 @@
1
1
  import { osqCodeBytes, osqStagedQueryBytes, osqRecordBytes, unpackLevels, readTrailer, stageQueryLevels, writeRecord } from './chunk-37CD3OKS.mjs';
2
2
  import { stopUsingTheNativeSearchCore, noteFallback, nativeSearchCoreIsEnabled } from './chunk-DJHHF2L5.mjs';
3
3
  import { markSimdUnavailable } from './chunk-KOKM4PQN.mjs';
4
- import { MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, OSQ_STEPS, UNPLACED_FLAG_CHUNK_ORDINALS, OSQ_GRID, VECTOR_BLOCK_INITIAL_SLOTS, OSQ_QUERY_BITS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_PLACEMENT_QUERY_BITS, GRAPH_LOCK_WAIT_SLICE_MS, NATIVE_ATTACH_RETRY_MS, GRAPH_LOCK_WAIT_DEADLINE_MS, OSQ_LAMBDA, MAX_DOC_ID_TABLE_BYTES } from './chunk-QSK35UC2.mjs';
5
- import { loadNativeCore } from './chunk-74XB2SXI.mjs';
4
+ import { MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, OSQ_STEPS, UNPLACED_FLAG_CHUNK_ORDINALS, OSQ_GRID, VECTOR_BLOCK_INITIAL_SLOTS, OSQ_QUERY_BITS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, loadNativeCore, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_PLACEMENT_QUERY_BITS, GRAPH_LOCK_WAIT_SLICE_MS, NATIVE_ATTACH_RETRY_MS, GRAPH_LOCK_WAIT_DEADLINE_MS, OSQ_LAMBDA, MAX_DOC_ID_TABLE_BYTES } from './chunk-QXH2CS4V.mjs';
5
+ import { threadSlotGone } from './chunk-RFBLQLLZ.mjs';
6
6
  import { DEFAULT_EF_SEARCH, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, PLACEMENT_ROOM_REQUESTS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, NEAREST_LINK_FALLBACK_HOSTS, FARTHEST_REJECTED_LINKS_KEPT } from './chunk-VJS4JFBQ.mjs';
7
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
7
8
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
8
- import { threadSlotGone } from './chunk-RFBLQLLZ.mjs';
9
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
10
9
 
11
10
  // src/vector/shared-buffers/growable.ts
12
11
  function sharedMemoryAvailable() {
@@ -0,0 +1,100 @@
1
+ import { getIndexMetadata } from './chunk-SNB4DYL3.mjs';
2
+ import { fnv1a } from './chunk-QYMAYU7M.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
4
+
5
+ // src/distribution/cluster-node/routable-allocation.ts
6
+ async function routableAllocation(coordinator, indexName) {
7
+ const table = await coordinator.getAllocation(indexName);
8
+ if (table !== null && table.assignments.size > 0) {
9
+ return table;
10
+ }
11
+ if (await getIndexMetadata(coordinator, indexName) === null) {
12
+ return null;
13
+ }
14
+ throw new NarsilError(
15
+ ErrorCodes.QUERY_ROUTING_FAILED,
16
+ `The cluster owns index '${indexName}' and holds no allocation table for it yet, so this node cannot place a read or a write`,
17
+ { indexName }
18
+ );
19
+ }
20
+
21
+ // src/distribution/cluster-node/write-routing/assignment.ts
22
+ function resolvePartitionId(docId, partitionCount) {
23
+ return fnv1a(docId) % partitionCount;
24
+ }
25
+ async function resolveNodeTargets(nodeId, deps) {
26
+ if (deps.resolveNodeTargets === void 0) {
27
+ return [nodeId];
28
+ }
29
+ const targets = await deps.resolveNodeTargets(nodeId);
30
+ return targets.length > 0 ? targets : [nodeId];
31
+ }
32
+ function requireAssignedPrimary(assignment, indexName, partitionId) {
33
+ if (assignment === void 0 || assignment.primary === null) {
34
+ throw new NarsilError(
35
+ ErrorCodes.PARTITION_UNASSIGNED,
36
+ `No primary assigned for partition ${partitionId} of index '${indexName}'`,
37
+ { indexName, partitionId }
38
+ );
39
+ }
40
+ return assignment;
41
+ }
42
+ function leadsPartitionOf(table, docId, nodeId) {
43
+ if (table === null) return false;
44
+ const assignment = table.assignments.get(resolvePartitionId(docId, table.assignments.size));
45
+ return assignment?.primary === nodeId;
46
+ }
47
+ async function resolvePrimaryAssignment(indexName, docId, deps, requireLocalPrimary) {
48
+ let table = await routableAllocation(deps.coordinator, indexName);
49
+ if (requireLocalPrimary && deps.refreshAllocation !== void 0 && !leadsPartitionOf(table, docId, deps.nodeId)) {
50
+ const live = await deps.refreshAllocation(indexName);
51
+ if (live !== null && live.assignments.size > 0) table = live;
52
+ }
53
+ if (table === null) {
54
+ if (requireLocalPrimary) {
55
+ throw new NarsilError(
56
+ ErrorCodes.QUERY_ROUTING_FAILED,
57
+ `No allocation table is available for forwarded write to index '${indexName}'`,
58
+ { indexName }
59
+ );
60
+ }
61
+ return null;
62
+ }
63
+ const partitionCount = table.assignments.size;
64
+ const partitionId = resolvePartitionId(docId, partitionCount);
65
+ const assignment = requireAssignedPrimary(table.assignments.get(partitionId), indexName, partitionId);
66
+ if (requireLocalPrimary && assignment.primary !== deps.nodeId) {
67
+ throw new NarsilError(
68
+ ErrorCodes.PARTITION_NOT_PRIMARY,
69
+ `Node '${deps.nodeId}' is not primary for partition ${partitionId} of index '${indexName}'`,
70
+ { indexName, partitionId, primaryNodeId: assignment.primary, localNodeId: deps.nodeId }
71
+ );
72
+ }
73
+ return { table, partitionId, assignment };
74
+ }
75
+ function assertSufficientActiveReplicas(indexName, partitionId, assignment, deps) {
76
+ const requiredActiveCopies = deps.waitForActiveReplicas ?? 1;
77
+ if (requiredActiveCopies <= 1) {
78
+ return;
79
+ }
80
+ const activeCopies = 1 + getInSyncReplicaTargets(assignment, deps.nodeId).length;
81
+ if (activeCopies < requiredActiveCopies) {
82
+ throw new NarsilError(
83
+ ErrorCodes.INSUFFICIENT_REPLICAS,
84
+ `Write to partition ${partitionId} of index '${indexName}' requires ${requiredActiveCopies} active copies but only ${activeCopies} are available`,
85
+ { indexName, partitionId, requiredActiveCopies, activeCopies }
86
+ );
87
+ }
88
+ }
89
+ function getInSyncReplicaTargets(assignment, localNodeId, pendingAdmissions = []) {
90
+ const configuredReplicas = new Set(assignment.replicas);
91
+ const targets = [];
92
+ for (const nodeId of [...assignment.inSyncSet, ...pendingAdmissions]) {
93
+ if (nodeId !== localNodeId && configuredReplicas.has(nodeId) && !targets.includes(nodeId)) {
94
+ targets.push(nodeId);
95
+ }
96
+ }
97
+ return targets;
98
+ }
99
+
100
+ export { assertSufficientActiveReplicas, getInSyncReplicaTargets, requireAssignedPrimary, resolveNodeTargets, resolvePartitionId, resolvePrimaryAssignment, routableAllocation };
@@ -1,19 +1,14 @@
1
- import { requirePatternSearchFor, requirePartialWordSearchFor, createPartitionIndex, cloneProjected, projectIncludedPaths, valueWithOwnBuffers, buildPartialWordTableFrom, createSurfaceRegistry, encodePartialSpellingsOf, recordValueSize, patternIndexOf, encodeFieldIndexes, countPartialSpelling, ARRAY_POSITION_GAP, documentWithOwnBuffers, readProjectedPath, copyVectorsInto, isCompositePartition, fnv1a, partialSpellingsOfDocuments, createFrozenPartialWords, requirePatternSearch, documentValueBytes, MAX_TERM_FREQUENCY, loadPhraseCodeFor, joinPatternWorkMeter, fanOutQuery, sanitizeGlobalStats, countsWithoutScores, fanOutMatchCount, createGeoIndex, createNumericIndex, createBooleanIndex, createEnumIndex, ValueAffixes, createCompositePartition } from './chunk-ZPWS2SKJ.mjs';
2
- import { generateId } from './chunk-N37VMC62.mjs';
3
- import { readHeapStatistics, readResidentMemory } from './chunk-ZATRDAYU.mjs';
1
+ import { requirePatternSearchFor, requirePartialWordSearchFor, createPartitionIndex, cloneProjected, projectIncludedPaths, valueWithOwnBuffers, buildPartialWordTableFrom, createSurfaceRegistry, encodePartialSpellingsOf, recordValueSize, patternIndexOf, encodeFieldIndexes, countPartialSpelling, ARRAY_POSITION_GAP, readHeapStatistics, documentWithOwnBuffers, readProjectedPath, copyVectorsInto, isCompositePartition, fnv1a, partialSpellingsOfDocuments, createFrozenPartialWords, requirePatternSearch, documentValueBytes, MAX_TERM_FREQUENCY, loadPhraseCodeFor, joinPatternWorkMeter, fanOutQuery, sanitizeGlobalStats, countsWithoutScores, fanOutMatchCount, createGeoIndex, createNumericIndex, createBooleanIndex, createEnumIndex, ValueAffixes, readResidentMemory, createCompositePartition } from './chunk-QYMAYU7M.mjs';
2
+ import { resolveIndexAnalysis, getLanguage, synonymSearchModule } from './chunk-FRJ5RGX7.mjs';
3
+ import { loadedVectorCode, loadVectorCode, loadVectorCodeFor, requireLoadedVectorCode } from './chunk-6Z22L5RN.mjs';
4
4
  import { GrowableUint32, bitsetHas, bitsetSet, createBitSet } from './chunk-JUKYYXSP.mjs';
5
- import { getNestedValue, tokenizeOptions, sameFields, visitDocumentSurfaceSpellings, visitDocumentSpellings } from './chunk-DQNKVOJ2.mjs';
6
- import { partialFieldsOf, schemaFieldsOf, encodeDocument, validateDocument, validateDocumentStrict, extractVectorFieldsFromSchema } from './chunk-KGOXHLLZ.mjs';
7
- import { fuzzyPrefixOf, boundedLevenshtein } from './chunk-GES7U2PM.mjs';
8
- import { isWordIndexedBase } from './chunk-ZSWHPKGM.mjs';
9
- import { resolveIndexAnalysis, synonymSearchModule } from './chunk-O4LJQI4G.mjs';
10
- import { getLanguage } from './chunk-WNBRW4Q2.mjs';
11
- import { encodeStringBlob, encodeLookupKey, visitTokens, codePointOrder } from './chunk-NPNK57CA.mjs';
5
+ import { partialFieldsOf, getNestedValue, schemaFieldsOf, tokenizeOptions, sameFields, encodeDocument, validateDocument, validateDocumentStrict, extractVectorFieldsFromSchema, visitDocumentSurfaceSpellings, visitDocumentSpellings } from './chunk-BTARFTEN.mjs';
6
+ import { encodeStringBlob, encodeLookupKey, visitTokens, codePointOrder } from './chunk-LWFK3TC2.mjs';
12
7
  import { SEGMENT_TOKEN_TABLE_START, SEGMENT_POSTING_LOG_START, SEGMENT_POSITION_POOL_START, SEGMENT_FIELD_SCRATCH_START, FROZEN_REMOVAL_INDEX_MAX_PROCESS_FRACTION } from './chunk-4UMZ7KQL.mjs';
13
- import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
14
- import { loadedVectorCode, loadVectorCode, loadVectorCodeFor, requireLoadedVectorCode } from './chunk-GLZHNSGB.mjs';
8
+ import { isWordIndexedBase, fuzzyPrefixOf, boundedLevenshtein } from './chunk-GVPYMSLO.mjs';
15
9
  import { PROTOTYPE_POLLUTION_KEYS } from './chunk-L5ORED7V.mjs';
16
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
10
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
11
+ import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
17
12
  import { Decoder, decode } from '@msgpack/msgpack';
18
13
 
19
14
  // src/core/synonyms/platform.ts
@@ -647,6 +642,23 @@ async function runQueryAction(entry, action) {
647
642
  return { count: result.totalMatched };
648
643
  }
649
644
 
645
+ // src/core/id-generator.ts
646
+ function generateId() {
647
+ const bytes = new Uint8Array(16);
648
+ crypto.getRandomValues(bytes);
649
+ const now = Date.now();
650
+ bytes[0] = Math.floor(now / 2 ** 40);
651
+ bytes[1] = Math.floor(now / 2 ** 32) % 256;
652
+ bytes[2] = Math.floor(now / 2 ** 24) % 256;
653
+ bytes[3] = Math.floor(now / 2 ** 16) % 256;
654
+ bytes[4] = Math.floor(now / 2 ** 8) % 256;
655
+ bytes[5] = now % 256;
656
+ bytes[6] = bytes[6] & 15 | 112;
657
+ bytes[8] = bytes[8] & 63 | 128;
658
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
659
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
660
+ }
661
+
650
662
  // src/core/partition/frozen/doc-table.ts
651
663
  function createFrozenDocTable(idTable, lengthColumns, documents, tombstones) {
652
664
  const capacity = idTable.count;
@@ -3220,7 +3232,7 @@ async function attachSegments(entry, action) {
3220
3232
  growPartitionsTo(entry.manager, segment.partitionId);
3221
3233
  const surfaceForms = segment.survivingSurfaceForms;
3222
3234
  const spellings = surfaceForms === void 0 ? void 0 : NO_REMOVED_SPELLINGS;
3223
- const frozen = isPagedSnapshot(segment.snapshot) ? (await import('./module-IYPLWHGC.mjs')).createPagedFrozenSegment(segment.snapshot) : createSharedFrozenSegment(segment.snapshot, surfaceForms);
3235
+ const frozen = isPagedSnapshot(segment.snapshot) ? (await import('./module-TMFIWOD2.mjs')).createPagedFrozenSegment(segment.snapshot) : createSharedFrozenSegment(segment.snapshot, surfaceForms);
3224
3236
  for (const docId of segment.tombstonedDocIds ?? []) frozen.tombstoneDocument(docId, spellings);
3225
3237
  entry.manager.attachFrozenSegment(segment.partitionId, frozen);
3226
3238
  }
@@ -3275,7 +3287,7 @@ function runSegmentAction(entry, action) {
3275
3287
  case "attachSegments":
3276
3288
  return attachSegments(entry, action);
3277
3289
  case "adoptDiskSegments":
3278
- return import('./module-IYPLWHGC.mjs').then((code) => code.adoptSegmentsOnWorker(entry.manager, action));
3290
+ return import('./module-TMFIWOD2.mjs').then((code) => code.adoptSegmentsOnWorker(entry.manager, action));
3279
3291
  case "compactSegments": {
3280
3292
  const partition = requireComposite(entry, action.indexName, action.partitionId, "compact");
3281
3293
  return mergeFrozenSegments(
@@ -3677,4 +3689,4 @@ function createDirectExecutor(options) {
3677
3689
  };
3678
3690
  }
3679
3691
 
3680
- export { assemblePagedFrozenSegment, availableSynonymModule, buildSegmentPayload, createDirectExecutor, createEncodedDocumentSource, createFrozenSegment, createPartitionManager, createPartitionRouter, createSharedFrozenSegment, decodeEveryStoredDocument, decodeMapWithoutFields, decodeStoredDocument, decodeSurfaceTable, encodeSurfaceTable, endOfValue, fieldIndexRemapOf, freezeSegmentShared, holdsADiscardedField, isEmptySynonymSet, mergeFieldIndexes, mergeFieldLengths, mergeFrozenSegments, mergePartialWords, mergeSegmentContents, mergeSurfaceForms, registerSynonyms, resolvePartialWordAnalysis, resolvePartitionInsertOptions, segmentArraysOf, selectionKeeps, shareSegmentArrays, synonymModule, wrapFrozenTokenTable };
3692
+ export { assemblePagedFrozenSegment, availableSynonymModule, buildSegmentPayload, createDirectExecutor, createEncodedDocumentSource, createFrozenSegment, createPartitionManager, createPartitionRouter, createSharedFrozenSegment, decodeEveryStoredDocument, decodeMapWithoutFields, decodeStoredDocument, decodeSurfaceTable, encodeSurfaceTable, endOfValue, fieldIndexRemapOf, freezeSegmentShared, generateId, holdsADiscardedField, isEmptySynonymSet, mergeFieldIndexes, mergeFieldLengths, mergeFrozenSegments, mergePartialWords, mergeSegmentContents, mergeSurfaceForms, registerSynonyms, resolvePartialWordAnalysis, resolvePartitionInsertOptions, segmentArraysOf, selectionKeeps, shareSegmentArrays, synonymModule, wrapFrozenTokenTable };
@@ -1,5 +1,5 @@
1
- import { crc32 } from './chunk-IO5F7ZBE.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
1
+ import { crc32 } from './chunk-YUCGFPMS.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
3
3
  import { decode, encode } from '@msgpack/msgpack';
4
4
 
5
5
  var PAGED_SEGMENT_ENVELOPE_VERSION = 6;
@@ -1,4 +1,4 @@
1
- import { ReplicationMessageTypes } from './chunk-YH5OIL7B.mjs';
1
+ import { ReplicationMessageTypes } from './chunk-5QMHMELB.mjs';
2
2
 
3
3
  // src/distribution/transport/reply-deadline.ts
4
4
  function replyDeadlineMs(messageType, config) {
@@ -0,0 +1,104 @@
1
+ import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
3
+
4
+ // src/persistence/object-store.ts
5
+ function objectKeyPrefix(prefix, adapter) {
6
+ if (prefix === void 0 || prefix.length === 0) return "";
7
+ if (prefix.startsWith("/") || prefix.includes("\0")) {
8
+ throw new NarsilError(
9
+ ErrorCodes.CONFIG_INVALID,
10
+ `The ${adapter} key prefix must not start with '/' or hold a null byte`,
11
+ { prefix }
12
+ );
13
+ }
14
+ return prefix.endsWith("/") ? prefix : `${prefix}/`;
15
+ }
16
+ function requireBucket(bucket, adapter) {
17
+ if (typeof bucket !== "string" || bucket.trim().length === 0) {
18
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${adapter} adapter needs a bucket name`, {});
19
+ }
20
+ return bucket;
21
+ }
22
+ function requireObjectKey(key) {
23
+ if (key.length === 0 || key.includes("\0")) {
24
+ throw new NarsilError(
25
+ ErrorCodes.PERSISTENCE_SAVE_FAILED,
26
+ "Invalid key: a key must be non-empty and hold no null byte",
27
+ {
28
+ key
29
+ }
30
+ );
31
+ }
32
+ }
33
+ function refuseOversizedObject(key, bytes) {
34
+ if (bytes > MAX_FILE_BYTES) {
35
+ throw new NarsilError(
36
+ ErrorCodes.PERSISTENCE_LOAD_FAILED,
37
+ `The object "${key}" holds ${bytes} bytes, which passes the ${MAX_FILE_BYTES}-byte limit of one stored file`,
38
+ { key, bytes, limit: MAX_FILE_BYTES }
39
+ );
40
+ }
41
+ }
42
+ function objectStoreFailure(code, action, key, error) {
43
+ if (error instanceof NarsilError) return error;
44
+ const cause = error instanceof Error ? error.message : String(error);
45
+ return new NarsilError(code, `The object store could not ${action} "${key}": ${cause}`, { key, cause });
46
+ }
47
+ function lengthMismatch(key, length, yielded) {
48
+ return new NarsilError(
49
+ ErrorCodes.PERSISTENCE_SAVE_FAILED,
50
+ `The stream for "${key}" yielded ${yielded} bytes where the caller declared ${length}`,
51
+ { key, length, yielded }
52
+ );
53
+ }
54
+ function requireStreamLength(key, length) {
55
+ if (!Number.isSafeInteger(length) || length < 0 || length > MAX_FILE_BYTES) {
56
+ throw new NarsilError(
57
+ ErrorCodes.PERSISTENCE_SAVE_FAILED,
58
+ `A stream for "${key}" declares ${length} bytes, which is not a byte count from 0 to ${MAX_FILE_BYTES}`,
59
+ { key, length }
60
+ );
61
+ }
62
+ }
63
+ async function* countedChunks(key, data, length) {
64
+ let yielded = 0;
65
+ for await (const chunk of data) {
66
+ yielded += chunk.byteLength;
67
+ if (yielded > length) throw lengthMismatch(key, length, yielded);
68
+ if (chunk.byteLength > 0) yield chunk;
69
+ }
70
+ if (yielded !== length) throw lengthMismatch(key, length, yielded);
71
+ }
72
+ async function* partsOf(chunks, partBytes) {
73
+ let pending = [];
74
+ let pendingBytes = 0;
75
+ for await (const chunk of chunks) {
76
+ pending.push(chunk);
77
+ pendingBytes += chunk.byteLength;
78
+ if (pendingBytes < partBytes) continue;
79
+ yield joinChunks(pending, pendingBytes);
80
+ pending = [];
81
+ pendingBytes = 0;
82
+ }
83
+ if (pendingBytes > 0 || pending.length > 0) yield joinChunks(pending, pendingBytes);
84
+ }
85
+ async function readWhole(chunks, length) {
86
+ const joined = new Uint8Array(length);
87
+ let offset = 0;
88
+ for await (const chunk of chunks) {
89
+ joined.set(chunk, offset);
90
+ offset += chunk.byteLength;
91
+ }
92
+ return joined;
93
+ }
94
+ function joinChunks(chunks, total) {
95
+ const joined = new Uint8Array(total);
96
+ let offset = 0;
97
+ for (const chunk of chunks) {
98
+ joined.set(chunk, offset);
99
+ offset += chunk.byteLength;
100
+ }
101
+ return joined;
102
+ }
103
+
104
+ export { countedChunks, joinChunks, objectKeyPrefix, objectStoreFailure, partsOf, readWhole, refuseOversizedObject, requireBucket, requireObjectKey, requireStreamLength };
@@ -1,6 +1,6 @@
1
1
  import { osqRecordBytes } from './chunk-37CD3OKS.mjs';
2
2
  import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-VJS4JFBQ.mjs';
3
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
4
4
 
5
5
  // src/vector/vector-index/dead-bits.ts
6
6
  var NO_LIVE_VECTOR_AT_POSITION = -1;
@@ -1,8 +1,7 @@
1
- import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-IO5F7ZBE.mjs';
2
- import { getNestedValue } from './chunk-DQNKVOJ2.mjs';
3
- import { requireValidFieldTypes } from './chunk-KGOXHLLZ.mjs';
1
+ import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-YUCGFPMS.mjs';
2
+ import { getNestedValue, requireValidFieldTypes } from './chunk-BTARFTEN.mjs';
4
3
  import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
5
- import { ErrorCodes, NarsilError } from './chunk-HNHCNTVG.mjs';
4
+ import { ErrorCodes, NarsilError } from './chunk-IQHZMCLX.mjs';
6
5
  import { decode } from '@msgpack/msgpack';
7
6
 
8
7
  function validateReplicationEntry(entry, localPrimaryTerm, log) {
@@ -1,8 +1,41 @@
1
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
1
+ import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
2
2
  import { existsSync } from 'fs';
3
3
  import { createRequire } from 'module';
4
4
  import { join, dirname } from 'path';
5
5
 
6
+ // src/vector/constants.ts
7
+ var WASM_PAGE_BYTES = 65536;
8
+ var MAX_WASM_PAGES = 65536;
9
+ var VECTOR_STORE_INITIAL_CAPACITY = 16;
10
+ var VECTOR_BLOCK_INITIAL_SLOTS = 256;
11
+ var DISK_STORAGE_BLOCK_BYTES = 67108864;
12
+ var MAX_VECTOR_ORDINALS = 16777216;
13
+ var UNPLACED_FLAG_CHUNK_ORDINALS = 1024;
14
+ var VECTOR_SCRATCH_SLOTS = 64;
15
+ var SCRATCH_SLOTS_PER_THREAD_POOL = 31;
16
+ var MAX_DOC_ID_TABLE_BYTES = 1073741824;
17
+ var MAX_WORKER_COPIES = 64;
18
+ var VECTOR_SEARCH_TIMEOUT_MS = 3e4;
19
+ var VECTOR_SEARCH_LOAD_TIMEOUT_MS = 3e5;
20
+ var VECTOR_INSERT_TIMEOUT_MS = 6e5;
21
+ var NATIVE_ATTACH_RETRY_MS = 1e3;
22
+ var MAX_RENUMBERED_SEARCH_ATTEMPTS = 3;
23
+ var LOCK_SPIN_ITERATIONS = 128;
24
+ var LOCK_WAIT_SLICE_MS = 20;
25
+ var GRAPH_LOCK_WAIT_SLICE_MS = 1;
26
+ var GRAPH_LOCK_WAIT_DEADLINE_MS = 1e4;
27
+ var GRAPH_BUILD_DISPATCH_CHUNK = 64;
28
+ var GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER = 2;
29
+
30
+ // src/vector/osq/constants.ts
31
+ var OSQ_GRID = { 1: 0.798, 2: 1.493, 4: 2.514, 8: 3.922 };
32
+ var OSQ_STEPS = { 1: 1, 2: 3, 4: 15, 8: 255 };
33
+ var OSQ_QUERY_BITS = { 1: 4, 2: 4, 4: 4, 8: 8 };
34
+ var OSQ_PLACEMENT_QUERY_BITS = { 1: 4, 2: 4, 4: 8, 8: 8 };
35
+ var OSQ_LAMBDA = 0.1;
36
+ var OSQ_REFINE_ROUNDS = 5;
37
+ var OSQ_REFINE_TOLERANCE = 1e-8;
38
+ var MIN_OVERSAMPLE = 1;
6
39
  var NATIVE_CORE_ABI_VERSION = 6;
7
40
  var BINARY_FILE_NAME = "narsil-core.node";
8
41
  var MUSL_DIRECTORY = "musl";
@@ -111,4 +144,4 @@ function loadNativeCore() {
111
144
  return loaded;
112
145
  }
113
146
 
114
- export { loadNativeCore, requireSearchBackendSettings };
147
+ export { DISK_STORAGE_BLOCK_BYTES, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, GRAPH_BUILD_DISPATCH_CHUNK, GRAPH_LOCK_WAIT_DEADLINE_MS, GRAPH_LOCK_WAIT_SLICE_MS, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, MAX_DOC_ID_TABLE_BYTES, MAX_RENUMBERED_SEARCH_ATTEMPTS, MAX_VECTOR_ORDINALS, MAX_WASM_PAGES, MAX_WORKER_COPIES, MIN_OVERSAMPLE, NATIVE_ATTACH_RETRY_MS, OSQ_GRID, OSQ_LAMBDA, OSQ_PLACEMENT_QUERY_BITS, OSQ_QUERY_BITS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_STEPS, SCRATCH_SLOTS_PER_THREAD_POOL, UNPLACED_FLAG_CHUNK_ORDINALS, VECTOR_BLOCK_INITIAL_SLOTS, VECTOR_INSERT_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_STORE_INITIAL_CAPACITY, WASM_PAGE_BYTES, loadNativeCore, requireSearchBackendSettings };