@delali/narsil 0.3.1-next.185 → 0.3.1-next.193

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 (170) hide show
  1. package/README.md +1 -0
  2. package/dist/adapters/filesystem.mjs +2 -2
  3. package/dist/adapters/gcs.mjs +2 -2
  4. package/dist/adapters/indexeddb.mjs +1 -1
  5. package/dist/adapters/s3.mjs +2 -2
  6. package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
  7. package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
  8. package/dist/browser/{chunk-CPSHS46N.mjs → chunk-UQG4HUGQ.mjs} +82 -50
  9. package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
  10. package/dist/browser/{module-XVLHJ7T7.mjs → module-ZZTNG5JZ.mjs} +26 -3
  11. package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
  12. package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-N3JMQ6CF.mjs} +14569 -13747
  13. package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
  14. package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
  15. package/dist/{chunk-CODGHJVW.mjs → chunk-2HVQYOOD.mjs} +40 -12
  16. package/dist/{chunk-M5I64AQW.mjs → chunk-3N5GUXBI.mjs} +33 -33
  17. package/dist/{chunk-DU23J5JG.mjs → chunk-5CIHQIA4.mjs} +6 -6
  18. package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-62X472AC.mjs} +1 -1
  19. package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
  20. package/dist/{chunk-G3XRHAJA.mjs → chunk-6MC6BCXK.mjs} +3 -3
  21. package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
  22. package/dist/{chunk-MHBG33R5.mjs → chunk-7X4IIREW.mjs} +76 -46
  23. package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
  24. package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
  25. package/dist/{chunk-LR6JJVML.mjs → chunk-D2EJUM4A.mjs} +764 -699
  26. package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
  27. package/dist/{chunk-2YWWHMVC.mjs → chunk-FGOGT273.mjs} +2 -2
  28. package/dist/{chunk-5BUEBIXR.mjs → chunk-GLXLSPLO.mjs} +18 -5
  29. package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
  30. package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
  31. package/dist/{chunk-BVZWWMOU.mjs → chunk-HHYQMGPW.mjs} +2 -2
  32. package/dist/{chunk-SL53DHVE.mjs → chunk-HSA3H3VW.mjs} +121 -68
  33. package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
  34. package/dist/{chunk-JDG6CCXM.mjs → chunk-JENWA4WX.mjs} +2 -2
  35. package/dist/{chunk-2GONI5HL.mjs → chunk-JXINPXRS.mjs} +5 -4
  36. package/dist/chunk-K5GNK5GE.mjs +602 -0
  37. package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
  38. package/dist/{chunk-EDEE7ETQ.mjs → chunk-KOA6T2IC.mjs} +3 -3
  39. package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
  40. package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
  41. package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
  42. package/dist/{chunk-VYSWVQCE.mjs → chunk-PAPQGC6I.mjs} +2 -2
  43. package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
  44. package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
  45. package/dist/{chunk-FBQYC5OX.mjs → chunk-SB5HCIIO.mjs} +16 -13
  46. package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
  47. package/dist/{chunk-O337MDRJ.mjs → chunk-SHES4VP5.mjs} +38 -13
  48. package/dist/{chunk-H4QYQ5DE.mjs → chunk-SIIDIGKI.mjs} +2 -2
  49. package/dist/{chunk-A3OAFUZI.mjs → chunk-SM2SYVIX.mjs} +2 -2
  50. package/dist/{chunk-II6XF6M4.mjs → chunk-SMLUZGSI.mjs} +9 -8
  51. package/dist/{chunk-2KCCQK4R.mjs → chunk-TSE2VWPX.mjs} +2 -2
  52. package/dist/{chunk-WSIU6YXQ.mjs → chunk-YPEJ6ODL.mjs} +1732 -743
  53. package/dist/{chunk-7WXGUTWK.mjs → chunk-Z6SIJH5O.mjs} +17 -6
  54. package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
  55. package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
  56. package/dist/{chunk-FCQMZDRI.mjs → chunk-ZVZYJIIP.mjs} +3 -3
  57. package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
  58. package/dist/client.d.ts +7 -7
  59. package/dist/client.mjs +3 -1265
  60. package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
  61. package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
  62. package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
  63. package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-WSZALYCV.mjs} +8 -8
  64. package/dist/distribution/coordinator/etcd.d.ts +1 -1
  65. package/dist/distribution/coordinator/etcd.mjs +35 -15
  66. package/dist/distribution/coordinator/in-memory.d.ts +1 -1
  67. package/dist/distribution/coordinator/in-memory.mjs +16 -6
  68. package/dist/distribution/transport/grpc.mjs +2 -2
  69. package/dist/distribution/transport/tcp.mjs +2 -2
  70. package/dist/distribution.d.ts +70 -9
  71. package/dist/distribution.mjs +1695 -680
  72. package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
  73. package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
  74. package/dist/embeddings/openai.mjs +2 -2
  75. package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
  76. package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
  77. package/dist/index.browser.mjs +3 -3
  78. package/dist/index.d.ts +4 -4
  79. package/dist/index.mjs +8 -8
  80. package/dist/index.react-native.mjs +9 -9
  81. package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-N2DNPEA3.mjs} +21 -21
  82. package/dist/{module-Z3CL4GJ4.mjs → module-UQFIJQMG.mjs} +33 -13
  83. package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
  84. package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
  85. package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-CGDBJBHQ.mjs} +31 -18
  86. package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-UK44CVXG.mjs} +20 -20
  87. package/dist/partial-words.browser.mjs +3 -3
  88. package/dist/partial-words.mjs +8 -8
  89. package/dist/pattern.browser.mjs +2 -2
  90. package/dist/pattern.mjs +3 -3
  91. package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
  92. package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
  93. package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
  94. package/dist/{query-actions-7EOKT3WD.mjs → query-actions-7BL3YZDW.mjs} +8 -8
  95. package/dist/query-suggestions/merge-worker.mjs +11 -11
  96. package/dist/query-suggestions.browser.mjs +3 -3
  97. package/dist/query-suggestions.d.ts +1 -1
  98. package/dist/query-suggestions.mjs +9 -9
  99. package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
  100. package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-63DZ26X5.mjs} +277 -75
  101. package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
  102. package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-BNFGA7TY.mjs} +3 -3
  103. package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
  104. package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
  105. package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
  106. package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-IP3QLETQ.mjs} +5 -5
  107. package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-LOKGE4OQ.mjs} +3 -3
  108. package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
  109. package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
  110. package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-UYAZLGEM.mjs} +1 -1
  111. package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
  112. package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-XHYOQ4K4.mjs} +2 -2
  113. package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
  114. package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
  115. package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
  116. package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
  117. package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
  118. package/dist/react-native/chunks/{module-COLNJNML.mjs → module-QRCYB7QV.mjs} +32 -9
  119. package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
  120. package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
  121. package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-GC6JWMAF.mjs} +31 -18
  122. package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
  123. package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
  124. package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-2ACONS4W.mjs} +12 -12
  125. package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-SSIWXVUG.mjs} +10 -10
  126. package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-I2WDFE6O.mjs} +11 -11
  127. package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-YXXMG4VR.mjs} +14727 -13915
  128. package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-FS7A4PZA.mjs} +11 -11
  129. package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-PSFCT5EX.mjs} +11 -11
  130. package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-QRMISMEL.mjs} +10 -10
  131. package/dist/react-native/partial-words.mjs +9 -9
  132. package/dist/react-native/pattern.mjs +5 -5
  133. package/dist/react-native/query-suggestions.mjs +9 -9
  134. package/dist/react-native/sync.mjs +433 -51
  135. package/dist/react-native/synonyms.mjs +9 -9
  136. package/dist/react.d.ts +8 -8
  137. package/dist/react.mjs +7 -0
  138. package/dist/{rerank-KTV5L7MZ.mjs → rerank-4GFC26FD.mjs} +8 -8
  139. package/dist/rerankers/http.mjs +2 -2
  140. package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
  141. package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-E4EIUYVV.mjs} +11 -11
  142. package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-MP6DILVE.mjs} +9 -9
  143. package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-ED2NMUC5.mjs} +9 -9
  144. package/dist/server.d.ts +13 -9
  145. package/dist/server.mjs +875 -348
  146. package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-HQFO37W7.mjs} +5234 -5835
  147. package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-PL2G7RM5.mjs} +10 -10
  148. package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-I3MEHACP.mjs} +12 -12
  149. package/dist/sync/filesystem.d.ts +2 -2
  150. package/dist/sync/filesystem.mjs +16 -16
  151. package/dist/sync/indexeddb.browser.mjs +1 -1
  152. package/dist/sync/indexeddb.d.ts +2 -2
  153. package/dist/sync/indexeddb.mjs +3 -3
  154. package/dist/sync.browser.mjs +35 -1108
  155. package/dist/sync.d.ts +3 -3
  156. package/dist/sync.mjs +430 -51
  157. package/dist/synonyms.browser.mjs +3 -3
  158. package/dist/synonyms.mjs +8 -8
  159. package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
  160. package/dist/thread-LTFI3RK5.mjs +31 -0
  161. package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
  162. package/dist/vector/search-worker.mjs +5 -5
  163. package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-P7YWXEP5.mjs} +11 -11
  164. package/dist/workers/entry.mjs +14 -14
  165. package/openapi.json +144 -0
  166. package/package.json +5 -7
  167. package/dist/chunk-URVH6BLO.mjs +0 -217
  168. package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
  169. package/dist/thread-NQRNW3IH.mjs +0 -31
  170. /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
@@ -1,10 +1,10 @@
1
- import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestFileRefs, graphPartKey, vectorFileKey } from './chunk-2KCCQK4R.mjs';
2
- import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-WLFOLAQI.mjs';
3
- import { openChecksummedEnvelope, HEADER_SIZE, QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-EDEE7ETQ.mjs';
1
+ import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestFileRefs, graphPartKey, vectorFileKey } from './chunk-TSE2VWPX.mjs';
2
+ import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-KBU3ZFJN.mjs';
3
+ import { openChecksummedEnvelope, HEADER_SIZE, QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-KOA6T2IC.mjs';
4
4
  import { decode } from './chunk-GXCDWLQI.mjs';
5
- import { requireValidFieldTypes } from './chunk-X5NHWOXT.mjs';
5
+ import { requireValidFieldTypes } from './chunk-7P5YWDRQ.mjs';
6
6
  import { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
7
- import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
7
+ import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
8
8
 
9
9
  // src/persistence/durability/segment/manifest-fields.ts
10
10
  function invalidManifest(message, details) {
@@ -554,6 +554,17 @@ async function readHistoryEntries(reader, handlers) {
554
554
  }
555
555
  }
556
556
 
557
+ // src/sync/feed/constants.ts
558
+ var DEFAULT_FEED_WINDOW_BYTES = 8388608;
559
+ var ENTRIES_MESSAGE_LIMIT_BYTES = 1048576;
560
+ var DEFAULT_MAX_FEED_CONNECTIONS = 1e4;
561
+ var DEFAULT_MAX_FEED_CATCH_UPS = 32;
562
+ var DEFAULT_MAX_FEED_BUFFERED_BYTES = 268435456;
563
+ var FEED_HEAD_RETRY_MS = 200;
564
+ var TIMER_DELAY_LIMIT_MS = 2147483647;
565
+ var FEED_SOCKET_MAX_PAYLOAD_BYTES = 131072;
566
+ var FEED_SOCKET_MAX_BACKPRESSURE_BYTES = 1073741824;
567
+
557
568
  // src/persistence/archive/range-layout.ts
558
569
  function archiveLayout(config, manifestBytes, files) {
559
570
  const parts = [];
@@ -624,4 +635,4 @@ async function* archiveRange(layout, start, endExclusive) {
624
635
  }
625
636
  }
626
637
 
627
- export { ARCHIVE_CONFIG_ENTRY, ARCHIVE_FILE_CHUNK_BYTES, ARCHIVE_MANIFEST_ENTRY, archiveLayout, archiveRange, decodeManifestPayload, decodeSegmentManifest, estimatedArchiveBytes, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, openManifestPayload, readSnapshotArchive, sourceIndexNameOf, tarEnd, tarEntryHeaders, tarPadding };
638
+ export { ARCHIVE_CONFIG_ENTRY, ARCHIVE_FILE_CHUNK_BYTES, ARCHIVE_MANIFEST_ENTRY, DEFAULT_FEED_WINDOW_BYTES, DEFAULT_MAX_FEED_BUFFERED_BYTES, DEFAULT_MAX_FEED_CATCH_UPS, DEFAULT_MAX_FEED_CONNECTIONS, ENTRIES_MESSAGE_LIMIT_BYTES, FEED_HEAD_RETRY_MS, FEED_SOCKET_MAX_BACKPRESSURE_BYTES, FEED_SOCKET_MAX_PAYLOAD_BYTES, TIMER_DELAY_LIMIT_MS, archiveLayout, archiveRange, decodeManifestPayload, decodeSegmentManifest, estimatedArchiveBytes, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, openManifestPayload, readSnapshotArchive, sourceIndexNameOf, tarEnd, tarEntryHeaders, tarPadding };
@@ -39,6 +39,13 @@ var ErrorCodes = {
39
39
  SYNC_NOT_READY: "SYNC_NOT_READY",
40
40
  SYNC_NOT_ENABLED: "SYNC_NOT_ENABLED",
41
41
  SYNC_SNAPSHOT_PREPARING: "SYNC_SNAPSHOT_PREPARING",
42
+ CHANGES_DURABILITY_REQUIRED: "CHANGES_DURABILITY_REQUIRED",
43
+ CHANGES_BACKUP_STORE_REQUIRED: "CHANGES_BACKUP_STORE_REQUIRED",
44
+ CHANGES_NOT_READY: "CHANGES_NOT_READY",
45
+ CHANGES_NOT_ENABLED: "CHANGES_NOT_ENABLED",
46
+ CHANGES_PREVIOUS_DOCUMENT_REQUIRED: "CHANGES_PREVIOUS_DOCUMENT_REQUIRED",
47
+ CHANGES_EXPORT_PREPARING: "CHANGES_EXPORT_PREPARING",
48
+ CHANGES_INVALID_POSITIONS: "CHANGES_INVALID_POSITIONS",
42
49
  QUERY_SUGGESTIONS_NOT_ENABLED: "QUERY_SUGGESTIONS_NOT_ENABLED",
43
50
  SEARCH_INVALID_FIELD: "SEARCH_INVALID_FIELD",
44
51
  VECTOR_DIMENSION_MISMATCH: "VECTOR_DIMENSION_MISMATCH",
@@ -1,6 +1,6 @@
1
- import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, withTransientAdmission, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_LIVE_COUNT, IN_MEMORY, STORE_RELEASED_VECTORS_TO_DISK, STORE_SLOTS, writeSequenceOf, openGraphState, fixedView, createSharedVectorStoreHandles, sequenceWritesOf, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, oldestHeldPin, coverOrdinal, nextSequence, publishSequence, createOrdinalFilter, addToOrdinalFilter, magnitude, stampBorn, mayFree, retiredAtOf, requireBytesWithinLimit, stampRetired, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, slotByteOffset, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createVectorFileReader, grownByteLength, growBufferTo, resetStoreHeader, STORE_CODE_COUNT, STORE_CALIBRATED, STORE_CALIBRATION_GENERATION, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createVectorBlock, ensureBlockSlots } from './chunk-WLFOLAQI.mjs';
2
- import { createDocIdMap } from './chunk-6SZQETSC.mjs';
3
- import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
1
+ import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, withTransientAdmission, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_LIVE_COUNT, IN_MEMORY, STORE_RELEASED_VECTORS_TO_DISK, STORE_SLOTS, writeSequenceOf, openGraphState, fixedView, createSharedVectorStoreHandles, sequenceWritesOf, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, oldestHeldPin, coverOrdinal, nextSequence, publishSequence, createOrdinalFilter, addToOrdinalFilter, magnitude, stampBorn, mayFree, retiredAtOf, requireBytesWithinLimit, stampRetired, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, slotByteOffset, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createVectorFileReader, grownByteLength, growBufferTo, resetStoreHeader, STORE_CODE_COUNT, STORE_CALIBRATED, STORE_CALIBRATION_GENERATION, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createVectorBlock, ensureBlockSlots } from './chunk-KBU3ZFJN.mjs';
2
+ import { createDocIdMap } from './chunk-RORNUNXW.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
5
5
  // src/vector/vector-store/hot-block-distance.ts
6
6
  function jsDistance(a, b, magA, magB, metric) {
@@ -1250,6 +1250,9 @@ function createVectorStore(options) {
1250
1250
  },
1251
1251
  growthBytesFor(vectors) {
1252
1252
  return state.open === null ? 0 : growthBytesFor(state.open, vectors);
1253
+ },
1254
+ visitDocumentTables(visit) {
1255
+ visit("documents", docToOrd.size, true);
1253
1256
  }
1254
1257
  };
1255
1258
  }
@@ -1,6 +1,6 @@
1
- import { getIndexMetadata } from './chunk-CODGHJVW.mjs';
2
- import { fnv1a } from './chunk-SL53DHVE.mjs';
3
- import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
1
+ import { getIndexMetadata } from './chunk-2HVQYOOD.mjs';
2
+ import { fnv1a } from './chunk-HSA3H3VW.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
5
5
  // src/distribution/cluster-node/routable-allocation.ts
6
6
  async function routableAllocation(coordinator, indexName) {
@@ -1,8 +1,8 @@
1
1
  import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-CzG9OUw5.js';
2
- import { e as SnapshotOptions, V as VectorMaintenanceResult, B as BatchResult, L as ListParams, l as ListResult, I as IndexInfo, p as IndexStats, P as PartitionStatsResult, Q as QueryParams, j as QueryResult, o as PreflightResult, m as SuggestParams, n as SuggestResult, g as SyncStatus, f as SyncSetting } from './engine-De6JzTW8.js';
2
+ import { o as SnapshotOptions, V as VectorMaintenanceResult, B as BatchResult, L as ListParams, y as ListResult, F as FollowChangesOptions, d as ChangesEvent, a as ChangePosition, h as ChangesStatus, g as ChangesSetting, I as IndexInfo, x as IndexStats, P as PartitionStatsResult, Q as QueryParams, t as QueryResult, z as PreflightResult, w as SuggestParams, A as SuggestResult, q as SyncStatus, p as SyncSetting } from './engine-qjAxJSKk.js';
3
3
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
4
- import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, m as CreateBackupBody, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-X2IJQc8J.js';
5
- import { B as BackupListing } from './config-D9WR3MhO.js';
4
+ import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, m as CreateBackupBody, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-C65V7lIr.js';
5
+ import { B as BackupListing } from './config-BvHQ-C7U.js';
6
6
  import { d as QuerySuggestionsSetting, e as QuerySuggestionsStatus, f as RecordQueryResult, c as QuerySuggestionsPreview, M as ManualQuerySuggestion } from './query-suggestions-CBYkrQ5T.js';
7
7
 
8
8
  /**
@@ -563,6 +563,89 @@ interface BulkOperations {
563
563
  startImport(indexName: string, source: ImportSource, options?: RequestOptions): Promise<TaskRecord>;
564
564
  }
565
565
 
566
+ /**
567
+ * Where a subscription to the change feed starts, which changes it receives, and how it proves the caller's access.
568
+ *
569
+ * @public
570
+ */
571
+ interface ChangeFeedOptions extends FollowChangesOptions {
572
+ /**
573
+ * The client offers this value as a second WebSocket subprotocol, after `narsil.changes.v1`, because a browser
574
+ * sends no header of the caller's choosing with a WebSocket upgrade. The server's `onRequest` hook reads it from
575
+ * the `sec-websocket-protocol` header. It must hold only the characters that an HTTP token allows.
576
+ */
577
+ credential?: string;
578
+ }
579
+ /**
580
+ * One connection to the change feed of an index, which returns its events one at a time.
581
+ *
582
+ * The server stops sending once the changes that the caller has not acknowledged pass the window in bytes, so call
583
+ * {@link ChangeSubscription.ack} with each position once the caller has saved it.
584
+ *
585
+ * @public
586
+ */
587
+ interface ChangeSubscription extends AsyncIterable<ChangesEvent> {
588
+ /**
589
+ * Tells the server that the caller has saved these positions, which frees the window for further changes. Pass
590
+ * only positions that the caller has saved, each at or below a `scannedSeqNo` that the feed returned. The
591
+ * subscription remembers the highest position of every partition and sends all of them, because the server
592
+ * expects each acknowledgement to cover every partition.
593
+ *
594
+ * @param positions - The saved positions of any partitions whose position moved.
595
+ * @throws NarsilError with `CHANGES_INVALID_POSITIONS` for a position that is not a whole number at or above
596
+ * zero, or for a partition that the index lacks.
597
+ */
598
+ ack(positions: ChangePosition[]): void;
599
+ /** Closes the connection and ends the iteration. */
600
+ close(): void;
601
+ }
602
+
603
+ /**
604
+ * These methods read and replace the change capture setting of an index and follow its changes over the server's
605
+ * change feed, as {@link ChangesOperations} does on the engine.
606
+ *
607
+ * @public
608
+ */
609
+ interface ChangesClientOperations {
610
+ /**
611
+ * Returns the change capture state of an index, as {@link ChangesOperations.getChanges} does on the engine.
612
+ *
613
+ * @param indexName - The server reports the state of this index.
614
+ * @param options - This sets the signal, the deadline, and the headers for this request.
615
+ * @returns The setting and the epoch.
616
+ * @throws A `NarsilError` with `INDEX_NOT_FOUND` when no index has that name.
617
+ */
618
+ getChanges(indexName: string, options?: RequestOptions): Promise<ChangesStatus>;
619
+ /**
620
+ * Replaces the change capture setting of an index, as {@link ChangesOperations.updateChanges} does on the engine.
621
+ *
622
+ * @param indexName - The server replaces the setting of this index.
623
+ * @param setting - This is the new setting.
624
+ * @param options - This sets the signal, the deadline, and the headers for this request.
625
+ * @throws A `NarsilError` with `CHANGES_DURABILITY_REQUIRED` when the server's engine has no write-ahead log
626
+ * durability, and with `CONFIG_INVALID` when a field has the wrong type or a history limit is not a positive whole
627
+ * number.
628
+ */
629
+ updateChanges(indexName: string, setting: ChangesSetting, options?: RequestOptions): Promise<void>;
630
+ /**
631
+ * Opens the change feed of an index and returns its events, as {@link ChangesOperations.followChanges} does on the
632
+ * engine. The server serves the feed only where its `changes` option is on.
633
+ *
634
+ * The first event gives the epoch and the positions. Each later event holds the changes of one partition in
635
+ * `seqNo` order, and the last event is a resync where the positions no longer lead to the index's changes. Save each
636
+ * `scannedSeqNo` once you apply its changes, then acknowledge it with {@link ChangeSubscription.ack}.
637
+ *
638
+ * @param indexName - The server sends the changes of this index.
639
+ * @param options - The epoch and positions to start from, a filter, a signal, and a credential.
640
+ * @returns The subscription, which opens its connection at once.
641
+ * @throws A `NarsilError` from the iteration with `CHANGES_NOT_ENABLED` when capture turns off, with the code in the
642
+ * close reason when the index's setting refuses the subscription, with `CONFIG_INVALID` when the server refuses the
643
+ * epoch, the positions, or the filter, and with `CLIENT_CONNECTION_FAILED` when the connection fails or the server
644
+ * refuses it, in which case subscribe again from the saved positions.
645
+ */
646
+ followChanges(indexName: string, options?: ChangeFeedOptions): ChangeSubscription;
647
+ }
648
+
566
649
  /**
567
650
  * This says what an upsert did, which is how {@link DocumentOperations.put}
568
651
  * reports whether the id already held a document.
@@ -1237,7 +1320,7 @@ interface TaskOperations {
1237
1320
  *
1238
1321
  * @public
1239
1322
  */
1240
- interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperations, SearchOperations, TaskOperations, AdminOperations, BackupOperations, ServerOperations, SyncSettingOperations, QuerySuggestionOperations {
1323
+ interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperations, SearchOperations, TaskOperations, AdminOperations, BackupOperations, ServerOperations, SyncSettingOperations, ChangesClientOperations, QuerySuggestionOperations {
1241
1324
  }
1242
1325
  /**
1243
1326
  * Builds a client for one Narsil server, or for a list of them that it moves
@@ -1258,4 +1341,4 @@ interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperatio
1258
1341
  */
1259
1342
  declare function createNarsilClient(options: NarsilClientOptions): NarsilClient;
1260
1343
 
1261
- export { type AdminOperations as A, type BackupOperations as B, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type QuerySuggestionOperations as Q, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type IndexOperations as b, type NarsilClientOptions as c, type ServerOperations as d, type ServerVersion as e, type SyncSettingOperations as f, type SyncSnapshotDownload as g, type SyncSnapshotResume as h, createNarsilClient as i };
1344
+ export { type AdminOperations as A, type BackupOperations as B, type ChangeFeedOptions as C, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type QuerySuggestionOperations as Q, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type ChangeSubscription as b, type ChangesClientOperations as c, type IndexOperations as d, type NarsilClientOptions as e, type ServerOperations as f, type ServerVersion as g, type SyncSettingOperations as h, type SyncSnapshotDownload as i, type SyncSnapshotResume as j, createNarsilClient as k };
package/dist/client.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-D9WR3MhO.js';
2
- export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, e as SnapshotOptions, f as SyncSetting, g as SyncStatus, i as isNarsilError } from './engine-De6JzTW8.js';
3
- export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-DAHXphRn.js';
4
- export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-X2IJQc8J.js';
1
+ export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-BvHQ-C7U.js';
2
+ export { C as Change, a as ChangePosition, b as ChangeType, c as ChangesBatch, d as ChangesEvent, e as ChangesOperations, f as ChangesResync, g as ChangesSetting, h as ChangesStatus, i as ChangesSubscribed, j as ClientErrorCode, k as ClientErrorCodes, E as ErrorCode, l as ErrorCodes, F as FollowChangesOptions, N as NarsilError, m as NarsilErrorCode, S as ServerErrorCode, n as ServerErrorCodes, o as SnapshotOptions, p as SyncSetting, q as SyncStatus, r as isNarsilError } from './engine-qjAxJSKk.js';
3
+ export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-CLnQHIqV.js';
4
+ export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-C65V7lIr.js';
5
5
  export { M as ManualQuerySuggestion, Q as QuerySuggestionPreviewEntry, a as QuerySuggestionsBuild, b as QuerySuggestionsBuildTrigger, c as QuerySuggestionsPreview, d as QuerySuggestionsSetting, e as QuerySuggestionsStatus, R as RecordQueryOutcome, f as RecordQueryResult } from './query-suggestions-CBYkrQ5T.js';
6
- export { A as AdminOperations, B as BackupOperations, a as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, b as IndexOperations, N as NarsilClient, c as NarsilClientOptions, P as PutResult, Q as QuerySuggestionOperations, R as RequestOptions, S as SearchOperations, d as ServerOperations, e as ServerVersion, f as SyncSettingOperations, g as SyncSnapshotDownload, h as SyncSnapshotResume, T as TaskOperations, W as WaitForTaskOptions, i as createNarsilClient } from './client-DpqtT2XG.js';
7
- import './config-C687-reW.js';
6
+ export { A as AdminOperations, B as BackupOperations, a as BulkOperations, C as ChangeFeedOptions, b as ChangeSubscription, c as ChangesClientOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, d as IndexOperations, N as NarsilClient, e as NarsilClientOptions, P as PutResult, Q as QuerySuggestionOperations, R as RequestOptions, S as SearchOperations, f as ServerOperations, g as ServerVersion, h as SyncSettingOperations, i as SyncSnapshotDownload, j as SyncSnapshotResume, T as TaskOperations, W as WaitForTaskOptions, k as createNarsilClient } from './client-uB0kp2yT.js';
7
+ import './config-PqgNY1H7.js';
8
8
  import './adapters-pljAqmrC.js';
9
9
  import './schema-CzG9OUw5.js';
10
10
  import './synonyms-CpOAHPa-.js';
11
- import './index-CBUl4z3E.js';
11
+ import './index-BaQIAnk0.js';
12
12
  import './types-DvncmvuQ.js';