@delali/narsil 0.3.1-next.156 → 0.3.1-next.157

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 (168) hide show
  1. package/dist/{analysis-change-5BQOQ4BF.mjs → analysis-change-CKEMM2MC.mjs} +9 -9
  2. package/dist/{react-native/chunks/analysis-change-entry-SCVWK6OU.mjs → analysis-change-entry-SEDMJ6MW.mjs} +1 -1
  3. package/dist/browser/{analysis-change-435CUEPZ.mjs → analysis-change-ZKGJFENM.mjs} +38 -29
  4. package/dist/{analysis-change-entry-TXX6JSMX.mjs → browser/analysis-change-entry-5BFUVMHJ.mjs} +1 -1
  5. package/dist/browser/{chunk-BHFQATSC.mjs → chunk-25MTVDYD.mjs} +1 -1
  6. package/dist/browser/{chunk-IZXVW2ZJ.mjs → chunk-3NLMB5CC.mjs} +2 -2
  7. package/dist/browser/{chunk-23XRXIBW.mjs → chunk-5YWB3E2W.mjs} +8 -1
  8. package/dist/browser/chunk-AI5UI46D.mjs +12 -0
  9. package/dist/browser/{chunk-2CFI5VVV.mjs → chunk-BLT4RHCJ.mjs} +2 -2
  10. package/dist/browser/{chunk-4NGKC4H4.mjs → chunk-C26SPCGQ.mjs} +7 -6
  11. package/dist/browser/{chunk-6LWDPLTB.mjs → chunk-C4FJ3WDY.mjs} +1 -1
  12. package/dist/browser/{chunk-MGI4BCXC.mjs → chunk-CXNTHHA7.mjs} +2 -2
  13. package/dist/browser/{chunk-STOWQFT3.mjs → chunk-DUH6QUVU.mjs} +547 -2
  14. package/dist/browser/chunk-EKMGCRSR.mjs +61 -0
  15. package/dist/browser/{chunk-SSTPBZZX.mjs → chunk-GFAZPSWK.mjs} +5 -5
  16. package/dist/browser/{chunk-3SSRJMFN.mjs → chunk-HUCSHDTB.mjs} +1 -1
  17. package/dist/browser/{chunk-K4Q6KX3R.mjs → chunk-K3IPRX6D.mjs} +48 -17
  18. package/dist/browser/{chunk-MOG4OVDK.mjs → chunk-MY2XKH22.mjs} +1 -12
  19. package/dist/browser/{chunk-3V7DNNZL.mjs → chunk-N23GL72Q.mjs} +178 -801
  20. package/dist/browser/{chunk-NQAME3RK.mjs → chunk-UATIJ4KU.mjs} +2 -2
  21. package/dist/browser/{chunk-2TI4SSUP.mjs → chunk-UKOWD2K5.mjs} +3 -3
  22. package/dist/browser/{chunk-7U3WVJUP.mjs → chunk-UTMHUHUV.mjs} +2 -2
  23. package/dist/browser/{chunk-EA63E3D2.mjs → chunk-V43N6TZO.mjs} +5 -5
  24. package/dist/browser/{chunk-CRE3G7F3.mjs → chunk-VY5KW3HN.mjs} +3 -3
  25. package/dist/browser/{chunk-WI4MR75E.mjs → chunk-X7TXYUKO.mjs} +1 -1
  26. package/dist/browser/{chunk-KZWSX6BH.mjs → chunk-Y6IBAUNO.mjs} +2 -86
  27. package/dist/browser/{cold-module-2EHCIV4K.mjs → cold-module-YNUUDNOM.mjs} +12 -10
  28. package/dist/browser/{durability-wiring-A7BVG2DW.mjs → durability-wiring-GVZEE46O.mjs} +64 -21
  29. package/dist/browser/{engine-hooks-E4UD67JD.mjs → engine-hooks-HBVS6YM4.mjs} +5 -4
  30. package/dist/browser/{geo-index-HHWGMNIS.mjs → geo-index-OTV7VPIR.mjs} +2 -1
  31. package/dist/browser/{import-DXYB6756.mjs → import-5ESVMFDJ.mjs} +6 -5
  32. package/dist/browser/{module-NIYMEA5R.mjs → module-NDSQLPMQ.mjs} +11 -9
  33. package/dist/{release-BH3DKW3T.mjs → browser/release-HYXPVJVS.mjs} +0 -1
  34. package/dist/browser/{restore-hooks-YPN4ZFCY.mjs → restore-hooks-IE3GGYHG.mjs} +8 -7
  35. package/dist/browser/{restore-queue-G3RQGL3Y.mjs → restore-queue-LQBBTODR.mjs} +3 -3
  36. package/dist/browser/{retention-ZWVMNC3Q.mjs → retention-TY3L3BFN.mjs} +7 -6
  37. package/dist/browser/{snapshot-VEQNIE6C.mjs → snapshot-5FHPPCNZ.mjs} +16 -14
  38. package/dist/browser/{start-BM442C6R.mjs → start-2UZTOBG5.mjs} +8 -7
  39. package/dist/browser/{write-2EVMZWDE.mjs → write-ULXAN5B4.mjs} +10 -8
  40. package/dist/{capabilities-Da4ywVVl.d.ts → capabilities-D3AoBJoF.d.ts} +2 -2
  41. package/dist/{chunk-K5QFDYST.mjs → chunk-24FNVRKB.mjs} +1 -1
  42. package/dist/{chunk-DP5C7YFQ.mjs → chunk-2ROUFMQX.mjs} +2 -2
  43. package/dist/{chunk-PWC4VB3Q.mjs → chunk-4B7JIGQD.mjs} +2 -2
  44. package/dist/{chunk-FAKFUDZZ.mjs → chunk-4LMSZAK6.mjs} +14 -3
  45. package/dist/{chunk-6I6AYAXS.mjs → chunk-4ZTHGTVX.mjs} +2 -2
  46. package/dist/{chunk-QOW2JPUI.mjs → chunk-BNL5OPRV.mjs} +6 -6
  47. package/dist/{chunk-3HYC4JRF.mjs → chunk-C7XQYG6U.mjs} +2 -2
  48. package/dist/{chunk-WX4LAO6M.mjs → chunk-CQZXZ75V.mjs} +3 -97
  49. package/dist/{chunk-4KKXNJM6.mjs → chunk-CWS55TEX.mjs} +2 -2
  50. package/dist/{chunk-2UV4QBHW.mjs → chunk-EYD7K3H6.mjs} +5 -5
  51. package/dist/{chunk-EFBDHH5P.mjs → chunk-FEZVDOWX.mjs} +160 -245
  52. package/dist/{chunk-XAXKV65G.mjs → chunk-FUD5XSZ5.mjs} +1 -1
  53. package/dist/{chunk-JDJBQLRO.mjs → chunk-GPWMUPCA.mjs} +10 -10
  54. package/dist/{chunk-25KDNIZZ.mjs → chunk-IIRIG7H5.mjs} +1 -1
  55. package/dist/{chunk-TZTRKM33.mjs → chunk-JSV6OQ4C.mjs} +1 -1
  56. package/dist/{chunk-NF4DT3IH.mjs → chunk-JTYPJF3T.mjs} +8 -1
  57. package/dist/chunk-KCQYFO4K.mjs +62 -0
  58. package/dist/{chunk-CSLGFPFQ.mjs → chunk-LDNCLRZU.mjs} +1 -1
  59. package/dist/{chunk-MQOJIO5B.mjs → chunk-MW6BR4QP.mjs} +2 -2
  60. package/dist/{react-native/chunks/chunk-MUWD2H2S.mjs → chunk-MWD5VPN7.mjs} +2 -2
  61. package/dist/{chunk-XXHN7J46.mjs → chunk-ODYKO5TO.mjs} +1 -1
  62. package/dist/{chunk-RDXO6JST.mjs → chunk-OG7UGJ6F.mjs} +2 -2
  63. package/dist/{chunk-FYOVBEMM.mjs → chunk-OQLD2BSW.mjs} +2 -2
  64. package/dist/{chunk-I53G4JAU.mjs → chunk-OYABFKTW.mjs} +2 -2
  65. package/dist/{chunk-TZ3355VS.mjs → chunk-P5LANSH6.mjs} +1 -1
  66. package/dist/{chunk-P5ZI2P2W.mjs → chunk-PIH5SJ4N.mjs} +3 -3
  67. package/dist/{chunk-HFPMMRQT.mjs → chunk-PSZI4O24.mjs} +51 -4
  68. package/dist/{chunk-L6V6BST3.mjs → chunk-PV2CG7EJ.mjs} +3 -552
  69. package/dist/{chunk-SA5LOGO3.mjs → chunk-PWGYQXML.mjs} +1 -1
  70. package/dist/{chunk-BWZ3P4MU.mjs → chunk-QLDABJZM.mjs} +3 -3
  71. package/dist/{chunk-JWRUUCWD.mjs → chunk-RCX4WNLC.mjs} +2 -2
  72. package/dist/{chunk-DWEPMFJE.mjs → chunk-RIHIVFIQ.mjs} +5 -5
  73. package/dist/{chunk-FNGAM5B7.mjs → chunk-RWURUDSP.mjs} +8 -8
  74. package/dist/{chunk-I2KPOLOZ.mjs → chunk-SMOOSIAW.mjs} +3 -3
  75. package/dist/{chunk-TGS5UXBE.mjs → chunk-SOI6LTHM.mjs} +3 -3
  76. package/dist/{chunk-YTWZVGCB.mjs → chunk-UD5HIS4U.mjs} +1 -1
  77. package/dist/{chunk-46KY2PJD.mjs → chunk-UJDJB3NE.mjs} +37 -29
  78. package/dist/{chunk-Z2KAFCRT.mjs → chunk-VSLSGASN.mjs} +2 -2
  79. package/dist/{chunk-VTTRFF2C.mjs → chunk-VZ2ONHEE.mjs} +9 -5
  80. package/dist/chunk-W5EB5XKI.mjs +741 -0
  81. package/dist/{chunk-7LXHHCXZ.mjs → chunk-W7OSSKH5.mjs} +46 -16
  82. package/dist/{chunk-ZKP7G7TV.mjs → chunk-XXJZMTZT.mjs} +1 -1
  83. package/dist/{chunk-FRBFVQFN.mjs → chunk-ZPZ3YGXV.mjs} +4 -4
  84. package/dist/{client-DRv7UVeY.d.ts → client-kqSMevVi.d.ts} +15 -3
  85. package/dist/client.d.ts +6 -6
  86. package/dist/client.mjs +4 -0
  87. package/dist/{cold-module-6MO2XJF2.mjs → cold-module-VOJXMNZB.mjs} +13 -12
  88. package/dist/{config-DMwffLKn.d.ts → config-B4v_Htpu.d.ts} +1 -1
  89. package/dist/{config-CoSig5Ox.d.ts → config-CTP01fns.d.ts} +1 -1
  90. package/dist/{direct-executor-FTMYY3TI.mjs → direct-executor-V5DRIECI.mjs} +5 -5
  91. package/dist/distribution.d.ts +4 -4
  92. package/dist/distribution.mjs +72 -64
  93. package/dist/{durability-wiring-VIF5MOSY.mjs → durability-wiring-3TD62MBI.mjs} +38 -30
  94. package/dist/{engine-CFxPYqEk.d.ts → engine-CkPn2PWE.d.ts} +1 -1
  95. package/dist/{engine-hooks-EGUGNZYE.mjs → engine-hooks-HA3SBOBR.mjs} +8 -8
  96. package/dist/{import-XKDPJQDP.mjs → import-GPKLTSKA.mjs} +8 -8
  97. package/dist/index.browser.mjs +4 -3
  98. package/dist/index.d.ts +4 -4
  99. package/dist/index.mjs +7 -7
  100. package/dist/index.react-native.mjs +3 -3
  101. package/dist/{long-query-thread-YA4IAYSY.mjs → long-query-thread-QDFQSJD6.mjs} +13 -13
  102. package/dist/{module-FQ4JWNQJ.mjs → module-JYHFTVPS.mjs} +12 -11
  103. package/dist/{paged-partition-archive-PXW5XAYU.mjs → paged-partition-archive-RLRGOXDX.mjs} +14 -14
  104. package/dist/partial-words.mjs +3 -3
  105. package/dist/persistence/durability/checkpoint-worker.mjs +13 -12
  106. package/dist/query-suggestions/merge-worker.mjs +9 -9
  107. package/dist/query-suggestions.browser.mjs +9 -8
  108. package/dist/query-suggestions.d.ts +1 -1
  109. package/dist/query-suggestions.mjs +17 -17
  110. package/dist/react-native/chunks/{analysis-change-LT5QBQ3H.mjs → analysis-change-QUVDNABS.mjs} +37 -29
  111. package/dist/{browser/analysis-change-entry-HZXKPPGV.mjs → react-native/chunks/analysis-change-entry-OC4XASBF.mjs} +1 -1
  112. package/dist/react-native/chunks/{chunk-KV46CT4D.mjs → chunk-4AV5PPH6.mjs} +2 -2
  113. package/dist/react-native/chunks/{chunk-GXX3DQXP.mjs → chunk-4COWCEY7.mjs} +188 -163
  114. package/dist/react-native/chunks/{chunk-G43IPIDG.mjs → chunk-4NWR3NGS.mjs} +2 -2
  115. package/dist/react-native/chunks/{chunk-3JWDECAZ.mjs → chunk-5MSX5FRT.mjs} +5 -5
  116. package/dist/react-native/chunks/{chunk-6WA3C3DV.mjs → chunk-6OFDUYVX.mjs} +8 -1
  117. package/dist/react-native/chunks/{chunk-NB3LP33V.mjs → chunk-6ZELFCK5.mjs} +2 -2
  118. package/dist/react-native/chunks/{chunk-4JYO3JD2.mjs → chunk-BITYFZSZ.mjs} +2 -2
  119. package/dist/react-native/chunks/{chunk-ZXZFN7FI.mjs → chunk-DMIFXZ3Q.mjs} +1 -1
  120. package/dist/{chunk-KF4EXSM4.mjs → react-native/chunks/chunk-IAENKE2D.mjs} +2 -2
  121. package/dist/react-native/chunks/{chunk-ZLWVW734.mjs → chunk-KSBYEMCB.mjs} +1 -1
  122. package/dist/react-native/chunks/chunk-KU646XXT.mjs +164 -0
  123. package/dist/react-native/chunks/{chunk-MIP4SOR6.mjs → chunk-OCSLSH27.mjs} +164 -244
  124. package/dist/react-native/chunks/chunk-OXM66LO6.mjs +62 -0
  125. package/dist/react-native/chunks/{chunk-VWUDIOT6.mjs → chunk-TORU2OHQ.mjs} +1 -1
  126. package/dist/react-native/chunks/{chunk-PDRWWPKV.mjs → chunk-WVWJNUMN.mjs} +48 -18
  127. package/dist/react-native/chunks/{chunk-UQ4OAXKU.mjs → chunk-WW2X2AEI.mjs} +4 -4
  128. package/dist/react-native/chunks/{chunk-QUKQNI3H.mjs → chunk-ZNZ6CPAZ.mjs} +2 -87
  129. package/dist/react-native/chunks/{chunk-TP6KCKER.mjs → chunk-ZVQMBF2H.mjs} +2 -2
  130. package/dist/react-native/chunks/{chunk-POPDAGH6.mjs → chunk-ZWAIN4GG.mjs} +6 -6
  131. package/dist/react-native/chunks/{cold-module-KVZYUGRY.mjs → cold-module-N6KFNNZA.mjs} +9 -8
  132. package/dist/react-native/chunks/{durability-wiring-34OYO32E.mjs → durability-wiring-RN64S2TL.mjs} +63 -21
  133. package/dist/react-native/chunks/{engine-hooks-M7JV46NH.mjs → engine-hooks-CWA5CKCA.mjs} +4 -4
  134. package/dist/react-native/chunks/{import-H6AQREWI.mjs → import-5UAWBRJP.mjs} +4 -4
  135. package/dist/react-native/chunks/{module-LBZPGOWH.mjs → module-6RP4ZCBW.mjs} +8 -7
  136. package/dist/react-native/chunks/{release-D7ZTIANM.mjs → release-2SIHZWDO.mjs} +0 -1
  137. package/dist/react-native/chunks/{restore-hooks-IBGIY3DR.mjs → restore-hooks-ENFMDTWC.mjs} +7 -7
  138. package/dist/react-native/chunks/{restore-queue-ZZX54AH7.mjs → restore-queue-4R6AASE5.mjs} +3 -3
  139. package/dist/react-native/chunks/{retention-EW4TTDFB.mjs → retention-5GTFT3GR.mjs} +6 -6
  140. package/dist/react-native/chunks/{snapshot-REYVIN3X.mjs → snapshot-5LGPQXFS.mjs} +15 -14
  141. package/dist/react-native/chunks/{start-BQK6KN3R.mjs → start-ZQJVZ5DN.mjs} +7 -7
  142. package/dist/react-native/chunks/{write-FQAYCZF5.mjs → write-6BRYIIZ7.mjs} +7 -6
  143. package/dist/react-native/partial-words.mjs +2 -2
  144. package/dist/react-native/query-suggestions.mjs +8 -8
  145. package/dist/react-native/sync.mjs +44 -10
  146. package/dist/react.d.ts +7 -7
  147. package/dist/{browser/release-76MXRPGV.mjs → release-SMR4WJD4.mjs} +0 -1
  148. package/dist/{restore-hooks-CDERDEF4.mjs → restore-hooks-HXLIEB4A.mjs} +12 -12
  149. package/dist/{restore-queue-7NNSTROA.mjs → restore-queue-LZH7LMLR.mjs} +3 -3
  150. package/dist/{retention-QSVBBNRM.mjs → retention-3K7ARGAG.mjs} +12 -12
  151. package/dist/server.d.ts +10 -8
  152. package/dist/server.mjs +37 -29
  153. package/dist/{snapshot-RH4NSKIZ.mjs → snapshot-O7ICP7NJ.mjs} +24 -23
  154. package/dist/{start-MCKCOGIW.mjs → start-S4PFP6RS.mjs} +14 -14
  155. package/dist/sync/filesystem.d.ts +2 -2
  156. package/dist/sync/indexeddb.d.ts +2 -2
  157. package/dist/sync.browser.mjs +44 -10
  158. package/dist/sync.d.ts +3 -3
  159. package/dist/sync.mjs +44 -10
  160. package/dist/{tasks-qrJojgST.d.ts → tasks-CoNjxbop.d.ts} +2 -2
  161. package/dist/{thread-O4SBJJJS.mjs → thread-YLJ3ZPQ3.mjs} +12 -12
  162. package/dist/{types-BZCGjfLn.d.ts → types-DPMjfOr_.d.ts} +1 -1
  163. package/dist/workers/entry.mjs +5 -5
  164. package/dist/{write-3FK7NG3Y.mjs → write-2OBJGLFS.mjs} +11 -10
  165. package/openapi.json +71 -0
  166. package/package.json +7 -7
  167. package/dist/chunk-BU4SAIC4.mjs +0 -196
  168. package/dist/react-native/chunks/chunk-DNXOMPAQ.mjs +0 -191
@@ -1,558 +1,9 @@
1
- import { MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES } from './chunk-SQJWAIF4.mjs';
2
1
  import { PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, DEFAULT_FUZZY_PREFIX_LENGTH } from './chunk-FQBFZAWG.mjs';
3
- import { flattenSchema, encodeDocument } from './chunk-BU4SAIC4.mjs';
2
+ import { tokenizeOptions, getNestedValue } from './chunk-W5EB5XKI.mjs';
4
3
  import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
5
- import { isWordIndexedBase, parseFieldType } from './chunk-I54T6CQP.mjs';
6
4
  import { encodeStringBlob } from './chunk-G6HRSGOU.mjs';
7
- import { DEFAULT_PATTERN_VALUE_LIMIT, isPlainObject, MAX_DOCUMENT_BYTES, MAX_DOCUMENT_NESTING_DEPTH, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
8
5
  import { tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-A4L7YTKX.mjs';
9
- import { EARLIER_RELEASE_MIN_M, MIN_M, MAX_M } from './chunk-ZXX5GZEX.mjs';
10
- import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
11
- import { compareCodePoints, codePointCount, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-TBC3XUL2.mjs';
12
-
13
- // src/geo/coordinates.ts
14
- function isLatitude(value) {
15
- return value >= -MAX_LATITUDE_DEGREES && value <= MAX_LATITUDE_DEGREES;
16
- }
17
- function isLongitude(value) {
18
- return value >= -MAX_LONGITUDE_DEGREES && value <= MAX_LONGITUDE_DEGREES;
19
- }
20
-
21
- // src/schema/validator/field-values.ts
22
- function validateGeopoint(path, value) {
23
- if (!isPlainObject(value)) {
24
- throw new NarsilError(
25
- ErrorCodes.SCHEMA_INVALID_GEOPOINT,
26
- `Field "${path}" expected a geopoint object with lat and lon`,
27
- {
28
- field: path,
29
- received: Array.isArray(value) ? "array" : typeof value
30
- }
31
- );
32
- }
33
- if (typeof value.lat !== "number" || typeof value.lon !== "number" || Number.isNaN(value.lat) || Number.isNaN(value.lon)) {
34
- throw new NarsilError(ErrorCodes.SCHEMA_INVALID_GEOPOINT, `Field "${path}" geopoint requires numeric lat and lon`, {
35
- field: path,
36
- lat: Number.isNaN(value.lat) ? "NaN" : typeof value.lat,
37
- lon: Number.isNaN(value.lon) ? "NaN" : typeof value.lon
38
- });
39
- }
40
- if (!isLatitude(value.lat)) {
41
- throw new NarsilError(
42
- ErrorCodes.SCHEMA_INVALID_GEOPOINT,
43
- `Field "${path}" geopoint lat must be between -90 and 90`,
44
- {
45
- field: path,
46
- lat: value.lat
47
- }
48
- );
49
- }
50
- if (!isLongitude(value.lon)) {
51
- throw new NarsilError(
52
- ErrorCodes.SCHEMA_INVALID_GEOPOINT,
53
- `Field "${path}" geopoint lon must be between -180 and 180`,
54
- {
55
- field: path,
56
- lon: value.lon
57
- }
58
- );
59
- }
60
- }
61
- function validateVector(path, value, expectedDimension) {
62
- const isArray = Array.isArray(value);
63
- const isFloat32 = value instanceof Float32Array;
64
- if (!isArray && !isFloat32) {
65
- throw new NarsilError(
66
- ErrorCodes.DOC_VALIDATION_FAILED,
67
- `Field "${path}" expected a vector (Array or Float32Array)`,
68
- { field: path, received: typeof value }
69
- );
70
- }
71
- const arr = value;
72
- if (arr.length !== expectedDimension) {
73
- throw new NarsilError(
74
- ErrorCodes.DOC_VALIDATION_FAILED,
75
- `Field "${path}" expected vector of dimension ${expectedDimension}, got ${arr.length}`,
76
- { field: path, expected: expectedDimension, received: arr.length }
77
- );
78
- }
79
- for (let i = 0; i < arr.length; i++) {
80
- if (typeof arr[i] !== "number" || !Number.isFinite(arr[i])) {
81
- throw new NarsilError(
82
- ErrorCodes.DOC_VALIDATION_FAILED,
83
- `Field "${path}" vector element at index ${i} is not a valid number`,
84
- { field: path, index: i, value: arr[i] }
85
- );
86
- }
87
- }
88
- }
89
- function validateTypedArray(path, value, elementType) {
90
- if (!Array.isArray(value)) {
91
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected an array`, {
92
- field: path,
93
- received: typeof value
94
- });
95
- }
96
- for (let i = 0; i < value.length; i++) {
97
- const el = value[i];
98
- if (typeof el !== elementType) {
99
- throw new NarsilError(
100
- ErrorCodes.DOC_VALIDATION_FAILED,
101
- `Field "${path}" array element at index ${i} expected ${elementType}, got ${typeof el}`,
102
- { field: path, index: i, expected: elementType, received: typeof el }
103
- );
104
- }
105
- if (elementType === "number" && !Number.isFinite(el)) {
106
- throw new NarsilError(
107
- ErrorCodes.DOC_VALIDATION_FAILED,
108
- `Field "${path}" array element at index ${i} is ${String(el)}, while a number field holds finite numbers alone`,
109
- { field: path, index: i }
110
- );
111
- }
112
- }
113
- }
114
- function validatePatternValue(path, value, patternValueLimit, index) {
115
- if (!exceedsCodePoints(value, patternValueLimit)) return;
116
- const subject = index === void 0 ? `The value of field "${path}"` : `Element ${index} of field "${path}"`;
117
- throw new NarsilError(
118
- ErrorCodes.DOC_VALIDATION_FAILED,
119
- `${subject} is longer than ${patternValueLimit} code points, which is the pattern value limit of this index`,
120
- { field: path, limit: patternValueLimit, ...index === void 0 ? {} : { index } }
121
- );
122
- }
123
- function validateFieldValue(path, value, type, patternValueLimit) {
124
- switch (type.base) {
125
- case "string":
126
- case "verbatim":
127
- if (typeof value !== "string") {
128
- throw new NarsilError(
129
- ErrorCodes.DOC_VALIDATION_FAILED,
130
- `Field "${path}" expected string, got ${typeof value}`,
131
- {
132
- field: path,
133
- expected: "string",
134
- received: typeof value
135
- }
136
- );
137
- }
138
- if (type.pattern) validatePatternValue(path, value, patternValueLimit);
139
- return;
140
- case "number":
141
- if (typeof value !== "number" || !Number.isFinite(value)) {
142
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected a finite number`, {
143
- field: path,
144
- expected: "number",
145
- received: typeof value === "number" ? String(value) : typeof value
146
- });
147
- }
148
- return;
149
- case "boolean":
150
- if (typeof value !== "boolean") {
151
- throw new NarsilError(
152
- ErrorCodes.DOC_VALIDATION_FAILED,
153
- `Field "${path}" expected boolean, got ${typeof value}`,
154
- {
155
- field: path,
156
- expected: "boolean",
157
- received: typeof value
158
- }
159
- );
160
- }
161
- return;
162
- case "enum":
163
- if (typeof value !== "string") {
164
- throw new NarsilError(
165
- ErrorCodes.DOC_VALIDATION_FAILED,
166
- `Field "${path}" expected enum (string), got ${typeof value}`,
167
- {
168
- field: path,
169
- expected: "enum",
170
- received: typeof value
171
- }
172
- );
173
- }
174
- return;
175
- case "geopoint":
176
- validateGeopoint(path, value);
177
- return;
178
- case "string[]":
179
- case "verbatim[]":
180
- validateTypedArray(path, value, "string");
181
- if (type.pattern) {
182
- const elements = value;
183
- for (let i = 0; i < elements.length; i++) validatePatternValue(path, elements[i], patternValueLimit, i);
184
- }
185
- return;
186
- case "number[]":
187
- validateTypedArray(path, value, "number");
188
- return;
189
- case "boolean[]":
190
- validateTypedArray(path, value, "boolean");
191
- return;
192
- case "enum[]":
193
- validateTypedArray(path, value, "string");
194
- return;
195
- case "vector":
196
- validateVector(path, value, type.dimension);
197
- return;
198
- }
199
- }
200
-
201
- // src/schema/validator/storable.ts
202
- var RESERVED_OBJECT_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
203
- var UNPAIRED_SURROGATE_REASON = "holds an unpaired surrogate, the half of a character such as an emoji whose other half is missing, so the engine cannot store it as UTF-8";
204
- function reject(path, reason) {
205
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path === "" ? "(document)" : path}" ${reason}`, {
206
- field: path
207
- });
208
- }
209
- function isPlainObject2(value) {
210
- const proto = Object.getPrototypeOf(value);
211
- return proto === Object.prototype || proto === null;
212
- }
213
- function walkStorable(value, path, depth, ancestors, skip) {
214
- if (value === null || value === void 0) return;
215
- const kind = typeof value;
216
- if (kind === "string") {
217
- if (holdsUnpairedSurrogate(value)) reject(path, UNPAIRED_SURROGATE_REASON);
218
- return;
219
- }
220
- if (kind === "boolean" || kind === "number") return;
221
- if (kind === "bigint" || kind === "symbol" || kind === "function") {
222
- reject(path, `holds a ${kind}, which cannot be stored or recovered`);
223
- }
224
- const container = value;
225
- if (container instanceof Date) {
226
- if (Number.isNaN(container.getTime())) reject(path, "holds an invalid date, which the engine cannot store");
227
- return;
228
- }
229
- if (container instanceof Uint8Array) return;
230
- const isArray = Array.isArray(container);
231
- if (!isArray && !isPlainObject2(container)) {
232
- reject(
233
- path,
234
- "holds a value that does not survive storage; use plain objects, arrays, strings, numbers, booleans, dates, or Uint8Array bytes"
235
- );
236
- }
237
- if (depth >= MAX_DOCUMENT_NESTING_DEPTH) {
238
- reject(path, `nests deeper than ${MAX_DOCUMENT_NESTING_DEPTH} levels`);
239
- }
240
- if (ancestors.has(container)) {
241
- reject(path, "refers back to one of its own ancestors");
242
- }
243
- ancestors.add(container);
244
- if (isArray) {
245
- const items = container;
246
- for (let i = 0; i < items.length; i++) {
247
- walkStorable(items[i], `${path}[${i}]`, depth + 1, ancestors, skip);
248
- }
249
- } else {
250
- const record = container;
251
- for (const key of Object.keys(record)) {
252
- const keyPath = path === "" ? key : `${path}.${key}`;
253
- if (RESERVED_OBJECT_KEYS.has(key)) {
254
- reject(keyPath, "uses a reserved object key");
255
- }
256
- if (holdsUnpairedSurrogate(key)) reject(keyPath, `has a name that ${UNPAIRED_SURROGATE_REASON}`);
257
- if (skip.has(keyPath)) continue;
258
- walkStorable(record[key], keyPath, depth + 1, ancestors, skip);
259
- }
260
- }
261
- ancestors.delete(container);
262
- }
263
- function assertStorableDocument(document, skipFieldPaths) {
264
- walkStorable(document, "", 0, /* @__PURE__ */ new Set(), skipFieldPaths ?? /* @__PURE__ */ new Set());
265
- }
266
-
267
- // src/schema/validator/document.ts
268
- var vectorPathCache = /* @__PURE__ */ new WeakMap();
269
- function vectorFieldPaths(schema) {
270
- let paths = vectorPathCache.get(schema);
271
- if (paths !== void 0) return paths;
272
- paths = /* @__PURE__ */ new Set();
273
- const collect = (level, prefix) => {
274
- for (const [field, type] of Object.entries(level)) {
275
- const path = prefix === "" ? field : `${prefix}.${field}`;
276
- if (typeof type === "string" && VECTOR_PATTERN.test(type)) {
277
- paths?.add(path);
278
- } else if (isPlainObject(type)) {
279
- collect(type, path);
280
- }
281
- }
282
- };
283
- collect(schema, "");
284
- vectorPathCache.set(schema, paths);
285
- return paths;
286
- }
287
- var parsedLevelCache = /* @__PURE__ */ new WeakMap();
288
- function parsedLevel(schema, prefix) {
289
- let entries = parsedLevelCache.get(schema);
290
- if (entries !== void 0) return entries;
291
- entries = Object.entries(schema).map(([field, type]) => {
292
- if (isPlainObject(type)) return { field, nested: type, type: null };
293
- const path = prefix ? `${prefix}.${field}` : field;
294
- return { field, nested: null, type: parseFieldType(type, path) };
295
- });
296
- parsedLevelCache.set(schema, entries);
297
- return entries;
298
- }
299
- function validateDocumentFields(doc, schema, prefix, patternValueLimit) {
300
- for (const { field, nested, type } of parsedLevel(schema, prefix)) {
301
- const value = doc[field];
302
- if (value === void 0 || value === null) continue;
303
- const path = prefix ? `${prefix}.${field}` : field;
304
- if (nested !== null) {
305
- if (!isPlainObject(value)) {
306
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected an object`, {
307
- field: path,
308
- received: Array.isArray(value) ? "array" : typeof value
309
- });
310
- }
311
- validateDocumentFields(value, nested, path, patternValueLimit);
312
- continue;
313
- }
314
- if (type !== null) validateFieldValue(path, value, type, patternValueLimit);
315
- }
316
- }
317
- function validateDocument(document, schema, patternValueLimit = DEFAULT_PATTERN_VALUE_LIMIT) {
318
- if (!isPlainObject(document)) {
319
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document must be a plain object", {
320
- received: typeof document
321
- });
322
- }
323
- requireIdFieldKey(document);
324
- assertStorableDocument(document, vectorFieldPaths(schema));
325
- validateDocumentFields(document, schema, "", patternValueLimit);
326
- }
327
- function requireIdFieldKey(document) {
328
- if (!Object.hasOwn(document, "id")) return;
329
- const id = document.id;
330
- if (typeof id === "string" && id.length > 0) return;
331
- throw new NarsilError(
332
- ErrorCodes.DOC_VALIDATION_FAILED,
333
- `Field "id" holds ${typeof id === "string" ? "an empty string" : id === null ? "null" : `a ${typeof id}`}, while the engine stores a document under its id field, so that field must hold a non-empty string`,
334
- { field: "id", received: id === null ? "null" : typeof id }
335
- );
336
- }
337
- function collectExtraFields(doc, schema, prefix, extras) {
338
- for (const key of Object.keys(doc)) {
339
- if (key === "id") continue;
340
- const path = prefix ? `${prefix}.${key}` : key;
341
- if (!Object.hasOwn(schema, key)) {
342
- extras.push(path);
343
- continue;
344
- }
345
- const schemaType = schema[key];
346
- if (isPlainObject(schemaType) && isPlainObject(doc[key])) {
347
- collectExtraFields(doc[key], schemaType, path, extras);
348
- }
349
- }
350
- }
351
- function validateDocumentStrict(document, schema) {
352
- const extras = [];
353
- collectExtraFields(document, schema, "", extras);
354
- if (extras.length > 0) {
355
- throw new NarsilError(
356
- ErrorCodes.DOC_VALIDATION_FAILED,
357
- `Document contains fields not defined in schema: ${extras.join(", ")}`,
358
- { extraFields: extras }
359
- );
360
- }
361
- }
362
- function resolveNestedValue(document, path) {
363
- if (!path.includes(".")) return document[path];
364
- const segments = path.split(".");
365
- let current = document;
366
- for (const segment of segments) {
367
- if (current === null || current === void 0 || typeof current !== "object") return void 0;
368
- current = current[segment];
369
- }
370
- return current;
371
- }
372
- function validateRequiredFields(document, required) {
373
- if (required.length === 0) return;
374
- for (const field of required) {
375
- const value = resolveNestedValue(document, field);
376
- if (value === void 0 || value === null) {
377
- throw new NarsilError(ErrorCodes.DOC_MISSING_REQUIRED_FIELD, `Document is missing required field "${field}"`, {
378
- field
379
- });
380
- }
381
- }
382
- }
383
-
384
- // src/schema/validator/document-size.ts
385
- var LARGEST_HEADER_BYTES = 5;
386
- var LARGEST_NUMBER_BYTES = 9;
387
- var LARGEST_TIMESTAMP_BYTES = 15;
388
- var LARGEST_UTF8_BYTES_PER_UNIT = 3;
389
- function upperBoundBytes(value, budget, depth) {
390
- if (value === null || value === void 0 || typeof value === "boolean") return 1;
391
- if (typeof value === "number") return LARGEST_NUMBER_BYTES;
392
- if (typeof value === "string") return LARGEST_HEADER_BYTES + value.length * LARGEST_UTF8_BYTES_PER_UNIT;
393
- if (value instanceof Date) return LARGEST_TIMESTAMP_BYTES;
394
- if (ArrayBuffer.isView(value)) return LARGEST_HEADER_BYTES + value.byteLength;
395
- if (typeof value !== "object" || depth > MAX_DOCUMENT_NESTING_DEPTH) return LARGEST_NUMBER_BYTES;
396
- let total = LARGEST_HEADER_BYTES;
397
- if (Array.isArray(value)) {
398
- for (const item of value) {
399
- total += upperBoundBytes(item, budget - total, depth + 1);
400
- if (total > budget) return total;
401
- }
402
- return total;
403
- }
404
- const record = value;
405
- for (const key of Object.keys(record)) {
406
- total += LARGEST_HEADER_BYTES + key.length * LARGEST_UTF8_BYTES_PER_UNIT;
407
- total += upperBoundBytes(record[key], budget - total, depth + 1);
408
- if (total > budget) return total;
409
- }
410
- return total;
411
- }
412
- function messagePackUpperBoundBytes(value) {
413
- return upperBoundBytes(value, Number.POSITIVE_INFINITY, 0);
414
- }
415
- function encodedBytesOf(document) {
416
- try {
417
- return encodeDocument(document).byteLength;
418
- } catch {
419
- return null;
420
- }
421
- }
422
- function requireDocumentWithinSizeLimit(document) {
423
- if (upperBoundBytes(document, MAX_DOCUMENT_BYTES, 0) <= MAX_DOCUMENT_BYTES) return;
424
- const encodedBytes = encodedBytesOf(document);
425
- if (encodedBytes === null || encodedBytes <= MAX_DOCUMENT_BYTES) return;
426
- throw new NarsilError(
427
- ErrorCodes.DOC_VALIDATION_FAILED,
428
- `The document takes ${encodedBytes} bytes as MessagePack, vector values included, but a document may take at most ${MAX_DOCUMENT_BYTES}`,
429
- { bytes: encodedBytes, maximum: MAX_DOCUMENT_BYTES }
430
- );
431
- }
432
-
433
- // src/schema/validator/vector-promotion.ts
434
- var QUANTIZATION_MODES = /* @__PURE__ */ new Set(["osq8", "osq4", "osq2", "osq1", "none"]);
435
- var STORAGE_MODES = /* @__PURE__ */ new Set(["memory", "disk"]);
436
- function fail(message, details) {
437
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, message, details);
438
- }
439
- function isPositiveInteger(value) {
440
- return Number.isInteger(value) && value >= 1;
441
- }
442
- function isQuantizationMode(value) {
443
- return typeof value === "string" && QUANTIZATION_MODES.has(value);
444
- }
445
- function isStorageMode(value) {
446
- return typeof value === "string" && STORAGE_MODES.has(value);
447
- }
448
- function validateVectorStorage(config, filesystemDurability) {
449
- if (config?.storage === "disk" && !filesystemDurability) {
450
- fail("vectorPromotion.storage 'disk' needs filesystem durability, because a checkpoint file holds the vectors", {
451
- storage: config.storage
452
- });
453
- }
454
- }
455
- function validateTextStorage(textStorage, filesystemDurability) {
456
- if (textStorage === void 0 || textStorage === "memory" || textStorage === "disk" && filesystemDurability) return;
457
- fail("textStorage must be 'memory', or 'disk' with filesystem durability", { textStorage });
458
- }
459
- function raiseEarlierReleaseGraphSetting(config) {
460
- if (typeof config !== "object" || config === null) return config;
461
- const hnsw = config.hnswConfig;
462
- if (typeof hnsw !== "object" || hnsw === null) return config;
463
- if (hnsw.m !== EARLIER_RELEASE_MIN_M) return config;
464
- return { ...config, hnswConfig: { ...hnsw, m: MIN_M } };
465
- }
466
- function validateVectorPromotion(config) {
467
- if (config === void 0) return;
468
- if (config.threshold !== void 0 && !isPositiveInteger(config.threshold)) {
469
- fail("vectorPromotion.threshold must be a positive integer", { threshold: config.threshold });
470
- }
471
- const quantization = config.quantization;
472
- if (quantization !== void 0 && !isQuantizationMode(quantization)) {
473
- fail("vectorPromotion.quantization must be 'osq8', 'osq4', 'osq2', 'osq1', or 'none'", { quantization });
474
- }
475
- const storage = config.storage;
476
- if (storage !== void 0 && !isStorageMode(storage)) {
477
- fail("vectorPromotion.storage must be 'memory' or 'disk'", { storage });
478
- }
479
- const hnsw = config.hnswConfig;
480
- if (hnsw === void 0) return;
481
- if (hnsw.m !== void 0 && (!Number.isInteger(hnsw.m) || hnsw.m < MIN_M || hnsw.m > MAX_M)) {
482
- fail(`vectorPromotion.hnswConfig.m must be a whole number from ${MIN_M} to ${MAX_M}`, { m: hnsw.m });
483
- }
484
- if (hnsw.efConstruction !== void 0 && !isPositiveInteger(hnsw.efConstruction)) {
485
- fail("vectorPromotion.hnswConfig.efConstruction must be a positive integer", {
486
- efConstruction: hnsw.efConstruction
487
- });
488
- }
489
- const metric = hnsw.metric;
490
- if (metric !== void 0 && metric !== "cosine" && metric !== "dotProduct" && metric !== "euclidean") {
491
- fail("vectorPromotion.hnswConfig.metric must be 'cosine', 'dotProduct', or 'euclidean'", { metric });
492
- }
493
- }
494
-
495
- // src/core/partition/utils.ts
496
- function getOrCreateFieldNameIndex(table, fieldName) {
497
- const existing = table.indexMap.get(fieldName);
498
- if (existing !== void 0) return existing;
499
- const idx = table.names.length;
500
- table.names.push(fieldName);
501
- table.indexMap.set(fieldName, idx);
502
- return idx;
503
- }
504
- var VECTOR_PATTERN2 = /^vector\[(\d+)]$/;
505
- function getNestedValue(obj, path) {
506
- const parts = path.split(".");
507
- let current = obj;
508
- for (let i = 0; i < parts.length; i++) {
509
- if (current === null || current === void 0 || typeof current !== "object") return void 0;
510
- if (!Object.hasOwn(current, parts[i])) return void 0;
511
- current = current[parts[i]];
512
- }
513
- return current;
514
- }
515
- function stringArraysEqual(a, b) {
516
- if (a === b) return true;
517
- if (!a || !b) return false;
518
- if (a.length !== b.length) return false;
519
- for (let i = 0; i < a.length; i++) {
520
- if (a[i] !== b[i]) return false;
521
- }
522
- return true;
523
- }
524
- function textFieldsChanged(oldDoc, newDoc, fields) {
525
- for (const { path, base } of fields) {
526
- if (!isWordIndexedBase(base)) continue;
527
- const oldVal = getNestedValue(oldDoc, path);
528
- const newVal = getNestedValue(newDoc, path);
529
- if (base === "string") {
530
- if (oldVal !== newVal) return true;
531
- } else {
532
- if (!stringArraysEqual(oldVal, newVal)) return true;
533
- }
534
- }
535
- return false;
536
- }
537
- function parseVectorDimension(fieldType) {
538
- const match = VECTOR_PATTERN2.exec(fieldType);
539
- return match ? Number.parseInt(match[1], 10) : null;
540
- }
541
- function tokenizeOptions(options) {
542
- return {
543
- stem: true,
544
- removeStopWords: true,
545
- collectSurfaces: options?.collectSurfaces === true,
546
- stopWordOverride: options?.stopWordOverride,
547
- customTokenizer: options?.customTokenizer
548
- };
549
- }
550
- function getFlatSchema(state, schema) {
551
- if (state.lastSchemaRef === schema && state.flatSchemaCache) return state.flatSchemaCache;
552
- state.flatSchemaCache = flattenSchema(schema);
553
- state.lastSchemaRef = schema;
554
- return state.flatSchemaCache;
555
- }
6
+ import { compareCodePoints, codePointCount } from './chunk-TBC3XUL2.mjs';
556
7
 
557
8
  // src/core/partition/suggestions.ts
558
9
  function verbatimOccurrences(state, token) {
@@ -1432,4 +883,4 @@ var partialWordSearchModule = {
1432
883
  highlightWords: partialWordsToHighlight
1433
884
  };
1434
885
 
1435
- export { expandTermPrefix, getFlatSchema, getNestedValue, getOrCreateFieldNameIndex, isLatitude, isLongitude, isQuantizationMode, isStorageMode, messagePackUpperBoundBytes, parseVectorDimension, partialWordSearchModule, partitionDocumentFrequency, raiseEarlierReleaseGraphSetting, requireDocumentWithinSizeLimit, sameFields, suggestDisplayTerms, textFieldsChanged, tokenizeOptions, validateDocument, validateDocumentStrict, validateRequiredFields, validateTextStorage, validateVectorPromotion, validateVectorStorage, visitDocumentSpellings, visitDocumentSurfaceSpellings };
886
+ export { expandTermPrefix, partialWordSearchModule, partitionDocumentFrequency, sameFields, suggestDisplayTerms, visitDocumentSpellings, visitDocumentSurfaceSpellings };
@@ -1,6 +1,6 @@
1
1
  import { isGroup, isNormalPhrase } from './chunk-GQPTDQCL.mjs';
2
2
  import { MAX_HISTORY_FILE_BYTES, KEY_FINGERPRINT_BYTES, SCRAMBLED_ID_BYTES, MAX_INDEX_UUID_LENGTH, MAX_MAX_LENGTH, MAX_MAX_WORDS, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-5YNRKI2C.mjs';
3
- import { packEnvelopeWithChecksum } from './chunk-EFBDHH5P.mjs';
3
+ import { packEnvelopeWithChecksum } from './chunk-FEZVDOWX.mjs';
4
4
  import { HEADER_SIZE, openChecksummedEnvelope } from './chunk-3OH67G7R.mjs';
5
5
  import { crc32 } from './chunk-7GXJUJ24.mjs';
6
6
 
@@ -1,6 +1,6 @@
1
- import { localRuntimeOf } from './chunk-Z2KAFCRT.mjs';
2
- import { boundQuerySuggestionsOf, querySuggestionsOf } from './chunk-TGS5UXBE.mjs';
3
- import { engineCoreOf } from './chunk-EFBDHH5P.mjs';
1
+ import { localRuntimeOf } from './chunk-VSLSGASN.mjs';
2
+ import { boundQuerySuggestionsOf, querySuggestionsOf } from './chunk-SOI6LTHM.mjs';
3
+ import { engineCoreOf } from './chunk-FEZVDOWX.mjs';
4
4
  import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
5
5
 
6
6
  // src/query-suggestions/index.ts
@@ -1,7 +1,7 @@
1
1
  import { RESTORE_ESTIMATE_MARGIN, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE } from './chunk-ZYAY26KG.mjs';
2
- import { readResidentMemory } from './chunk-P5ZI2P2W.mjs';
2
+ import { readResidentMemory } from './chunk-PIH5SJ4N.mjs';
3
3
  import { readHeapStatistics } from './chunk-IPN7S4KX.mjs';
4
- import { extractVectorFieldsFromSchema } from './chunk-BU4SAIC4.mjs';
4
+ import { extractVectorFieldsFromSchema } from './chunk-W5EB5XKI.mjs';
5
5
  import { collectAndReturnPages } from './chunk-QYRNLLLI.mjs';
6
6
  import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
7
7
 
@@ -1,10 +1,10 @@
1
- import { writeLiveVectors, SINGLE_NODE_PRIMARY_TERM } from './chunk-7LXHHCXZ.mjs';
1
+ import { writeLiveVectors, SINGLE_NODE_PRIMARY_TERM } from './chunk-W7OSSKH5.mjs';
2
2
  import { vectorsPerFile } from './chunk-FCJ553HS.mjs';
3
- import { ARCHIVE_CONFIG_ENTRY, ARCHIVE_MANIFEST_ENTRY, tarEnd, tarEntryHeaders, tarPadding, ARCHIVE_FILE_CHUNK_BYTES } from './chunk-MQOJIO5B.mjs';
4
- import { decodeSegmentManifest } from './chunk-4KKXNJM6.mjs';
3
+ import { ARCHIVE_CONFIG_ENTRY, ARCHIVE_MANIFEST_ENTRY, tarEnd, tarEntryHeaders, tarPadding, ARCHIVE_FILE_CHUNK_BYTES } from './chunk-MW6BR4QP.mjs';
4
+ import { decodeSegmentManifest } from './chunk-CWS55TEX.mjs';
5
5
  import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-K4ZIGL2O.mjs';
6
- import { writeCheckpointSegments, commitCheckpointManifest, partitionContentsOf } from './chunk-JDJBQLRO.mjs';
7
- import { manifestKey, manifestFileRefs } from './chunk-NF4DT3IH.mjs';
6
+ import { writeCheckpointSegments, commitCheckpointManifest, partitionContentsOf } from './chunk-GPWMUPCA.mjs';
7
+ import { manifestKey, manifestFileRefs } from './chunk-JTYPJF3T.mjs';
8
8
  import { DEFAULT_COMPACTION_THRESHOLD } from './chunk-QDZJM7NI.mjs';
9
9
  import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
10
10
 
@@ -1,15 +1,15 @@
1
1
  import { encodeDocumentJson } from './chunk-6RC4K46J.mjs';
2
2
  import { loadFailed, sectionNamed, PAGED_SEGMENT_ENVELOPE_VERSION, encodePagedSegmentHead, SECTION_ALIGNMENT_BYTES, SEGMENT_PAGE_BYTES, PAYLOAD_PREFIX_BYTES, decodePagedSegmentHead, BLOCK_SUMMARY_BYTES, SMALLEST_BLOCK_POSTINGS, DOCUMENT_BLOCK_BYTES, decodeSections, DOCUMENT_BLOCK_MIN_RAW_BYTES, ID_SAMPLE_INTERVAL, POSITION_WIDTH_BYTES, POSTING_WIDTH_BYTES, RECORD_PAGE_BYTES, MAX_DOCUMENT_BLOCK_RAW_BYTES } from './chunk-WZ7YV54N.mjs';
3
3
  import { createVectorFileReader } from './chunk-FOCV4CBZ.mjs';
4
- import { writeSegmentsOf, MessagePackChunks, writeSurfaceForms, writeFieldLengths, writeValueColumns, writeBooleanColumns, writeEnumColumns, writeGeopointColumns, writePatternColumns, writePartialWords, FILE_ASSEMBLY_CHUNK_BYTES, REWRITE_SPILL_BYTES, LIST_VIEWS_HELD_PER_SEGMENT, TOMBSTONES_BETWEEN_YIELDS, readSegmentFile, READS_AHEAD_AT_ONCE, WRITER_YIELD_INTERVAL_TOKENS, LARGEST_CACHED_ENTRY_SHARE, MAX_THREAD_FILE_NUMBER, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, SECTION_WRITE_BUFFER_BYTES, READ_AHEAD_CHUNK_BYTES, LARGEST_REMOVAL_BUCKET_COUNT, REMOVAL_BUCKET_TARGET_BYTES, THREAD_READ_CACHE_BYTES, MERGE_READ_CACHE_BYTES } from './chunk-QOW2JPUI.mjs';
5
- import { requireOffsets, requireUtf8Entries, requireEntriesAscend, decodeFieldLengths, decodePartialWords, decodePatternColumns, decodeGeopointColumns, decodeEnumColumns, decodeBooleanColumns, decodeValueColumns, setNestedValue, littleEndianBytes, uint32sFrom, uint64Bytes, decodeSurfaceForms } from './chunk-WX4LAO6M.mjs';
6
- import { engineVersionParts } from './chunk-EFBDHH5P.mjs';
7
- import { generateId, wrapFrozenTokenTable, createEncodedDocumentSource, assemblePagedFrozenSegment, decodeStoredDocument, mergeFieldLengths, mergeSurfaceForms, encodeSurfaceTable, mergePartialWords, mergeFieldIndexes, resolvePartitionInsertOptions, decodeSurfaceTable, createSharedFrozenSegment, shareSegmentArrays, selectionKeeps, fieldIndexRemapOf, freezeSegmentShared, createFrozenSegment, holdsADiscardedField, endOfValue } from './chunk-VTTRFF2C.mjs';
8
- import { isCompositePartition, buildPartialWordTableFrom, createPartitionIndex, createCompositePartition, mergeDocFrequencies } from './chunk-P5ZI2P2W.mjs';
4
+ import { writeSegmentsOf, MessagePackChunks, writeSurfaceForms, writeFieldLengths, writeValueColumns, writeBooleanColumns, writeEnumColumns, writeGeopointColumns, writePatternColumns, writePartialWords, FILE_ASSEMBLY_CHUNK_BYTES, REWRITE_SPILL_BYTES, LIST_VIEWS_HELD_PER_SEGMENT, TOMBSTONES_BETWEEN_YIELDS, readSegmentFile, READS_AHEAD_AT_ONCE, WRITER_YIELD_INTERVAL_TOKENS, LARGEST_CACHED_ENTRY_SHARE, MAX_THREAD_FILE_NUMBER, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, SECTION_WRITE_BUFFER_BYTES, READ_AHEAD_CHUNK_BYTES, LARGEST_REMOVAL_BUCKET_COUNT, REMOVAL_BUCKET_TARGET_BYTES, THREAD_READ_CACHE_BYTES, MERGE_READ_CACHE_BYTES } from './chunk-BNL5OPRV.mjs';
5
+ import { requireOffsets, requireUtf8Entries, requireEntriesAscend, decodeFieldLengths, decodePartialWords, decodePatternColumns, decodeGeopointColumns, decodeEnumColumns, decodeBooleanColumns, decodeValueColumns, littleEndianBytes, uint32sFrom, uint64Bytes, decodeSurfaceForms } from './chunk-CQZXZ75V.mjs';
6
+ import { setNestedValue } from './chunk-KCQYFO4K.mjs';
7
+ import { engineVersionParts } from './chunk-FEZVDOWX.mjs';
8
+ import { generateId, wrapFrozenTokenTable, createEncodedDocumentSource, assemblePagedFrozenSegment, decodeStoredDocument, mergeFieldLengths, mergeSurfaceForms, encodeSurfaceTable, mergePartialWords, mergeFieldIndexes, resolvePartitionInsertOptions, decodeSurfaceTable, createSharedFrozenSegment, shareSegmentArrays, selectionKeeps, fieldIndexRemapOf, freezeSegmentShared, createFrozenSegment, holdsADiscardedField, endOfValue } from './chunk-VZ2ONHEE.mjs';
9
+ import { isCompositePartition, buildPartialWordTableFrom, createPartitionIndex, createCompositePartition, mergeDocFrequencies } from './chunk-PIH5SJ4N.mjs';
9
10
  import { HEADER_SIZE, requireWithinFileLimit, writeHeader, readHeader } from './chunk-3OH67G7R.mjs';
10
11
  import { crc32Init, crc32Update, crc32Final, crc32 } from './chunk-7GXJUJ24.mjs';
11
- import { parseVectorDimension } from './chunk-L6V6BST3.mjs';
12
- import { flattenSchema, encodeDocument } from './chunk-BU4SAIC4.mjs';
12
+ import { flattenSchema, parseVectorDimension, encodeDocument } from './chunk-W5EB5XKI.mjs';
13
13
  import { scanPostingBlocks } from './chunk-FB6463IN.mjs';
14
14
  import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
15
15
  import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
@@ -1311,7 +1311,7 @@ async function coldFieldOf(checkpoint, field) {
1311
1311
  const dimension = fieldType === void 0 ? null : parseVectorDimension(fieldType);
1312
1312
  if (dimension === null) return null;
1313
1313
  const withPath = async (ref) => ({ ref, path: await directory.pathOf(ref.key) });
1314
- const { openColdVectorField } = await import('./cold-module-6MO2XJF2.mjs');
1314
+ const { openColdVectorField } = await import('./cold-module-VOJXMNZB.mjs');
1315
1315
  return openColdVectorField({
1316
1316
  fieldPath: field.fieldPath,
1317
1317
  dimension,
@@ -1,11 +1,11 @@
1
1
  import { unrefInterval, DEFAULT_HISTORY_MAX_AGE_MS } from './chunk-YEKL4JBK.mjs';
2
- import { archiveLayout } from './chunk-TZTRKM33.mjs';
2
+ import { archiveLayout } from './chunk-JSV6OQ4C.mjs';
3
3
  import { MAX_SNAPSHOT_ANALYSIS_ATTEMPTS } from './chunk-ZYAY26KG.mjs';
4
4
  import { syncStorageOf } from './chunk-QJVOLKU6.mjs';
5
5
  import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
6
- import { manifestFileRefs } from './chunk-NF4DT3IH.mjs';
6
+ import { manifestFileRefs } from './chunk-JTYPJF3T.mjs';
7
7
  import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
8
- import { emitEngineEvent, encodeIndexConfiguration } from './chunk-EFBDHH5P.mjs';
8
+ import { emitEngineEvent, encodeIndexConfiguration } from './chunk-FEZVDOWX.mjs';
9
9
  import { INDEX_CONFIGURATION_ENVELOPE_VERSION } from './chunk-GH4WQ22V.mjs';
10
10
  import { openChecksummedEnvelope } from './chunk-3OH67G7R.mjs';
11
11
  import { withOpenIndex } from './chunk-Y4WPNHMC.mjs';