@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.
- package/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
- package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
- package/dist/browser/{chunk-CPSHS46N.mjs → chunk-UQG4HUGQ.mjs} +82 -50
- package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
- package/dist/browser/{module-XVLHJ7T7.mjs → module-ZZTNG5JZ.mjs} +26 -3
- package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
- package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-N3JMQ6CF.mjs} +14569 -13747
- package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
- package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
- package/dist/{chunk-CODGHJVW.mjs → chunk-2HVQYOOD.mjs} +40 -12
- package/dist/{chunk-M5I64AQW.mjs → chunk-3N5GUXBI.mjs} +33 -33
- package/dist/{chunk-DU23J5JG.mjs → chunk-5CIHQIA4.mjs} +6 -6
- package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-62X472AC.mjs} +1 -1
- package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
- package/dist/{chunk-G3XRHAJA.mjs → chunk-6MC6BCXK.mjs} +3 -3
- package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
- package/dist/{chunk-MHBG33R5.mjs → chunk-7X4IIREW.mjs} +76 -46
- package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
- package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
- package/dist/{chunk-LR6JJVML.mjs → chunk-D2EJUM4A.mjs} +764 -699
- package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
- package/dist/{chunk-2YWWHMVC.mjs → chunk-FGOGT273.mjs} +2 -2
- package/dist/{chunk-5BUEBIXR.mjs → chunk-GLXLSPLO.mjs} +18 -5
- package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
- package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
- package/dist/{chunk-BVZWWMOU.mjs → chunk-HHYQMGPW.mjs} +2 -2
- package/dist/{chunk-SL53DHVE.mjs → chunk-HSA3H3VW.mjs} +121 -68
- package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
- package/dist/{chunk-JDG6CCXM.mjs → chunk-JENWA4WX.mjs} +2 -2
- package/dist/{chunk-2GONI5HL.mjs → chunk-JXINPXRS.mjs} +5 -4
- package/dist/chunk-K5GNK5GE.mjs +602 -0
- package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
- package/dist/{chunk-EDEE7ETQ.mjs → chunk-KOA6T2IC.mjs} +3 -3
- package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
- package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
- package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
- package/dist/{chunk-VYSWVQCE.mjs → chunk-PAPQGC6I.mjs} +2 -2
- package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
- package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
- package/dist/{chunk-FBQYC5OX.mjs → chunk-SB5HCIIO.mjs} +16 -13
- package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
- package/dist/{chunk-O337MDRJ.mjs → chunk-SHES4VP5.mjs} +38 -13
- package/dist/{chunk-H4QYQ5DE.mjs → chunk-SIIDIGKI.mjs} +2 -2
- package/dist/{chunk-A3OAFUZI.mjs → chunk-SM2SYVIX.mjs} +2 -2
- package/dist/{chunk-II6XF6M4.mjs → chunk-SMLUZGSI.mjs} +9 -8
- package/dist/{chunk-2KCCQK4R.mjs → chunk-TSE2VWPX.mjs} +2 -2
- package/dist/{chunk-WSIU6YXQ.mjs → chunk-YPEJ6ODL.mjs} +1732 -743
- package/dist/{chunk-7WXGUTWK.mjs → chunk-Z6SIJH5O.mjs} +17 -6
- package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
- package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
- package/dist/{chunk-FCQMZDRI.mjs → chunk-ZVZYJIIP.mjs} +3 -3
- package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -1265
- package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
- package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
- package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
- package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-WSZALYCV.mjs} +8 -8
- package/dist/distribution/coordinator/etcd.d.ts +1 -1
- package/dist/distribution/coordinator/etcd.mjs +35 -15
- package/dist/distribution/coordinator/in-memory.d.ts +1 -1
- package/dist/distribution/coordinator/in-memory.mjs +16 -6
- package/dist/distribution/transport/grpc.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +70 -9
- package/dist/distribution.mjs +1695 -680
- package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
- package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
- package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +8 -8
- package/dist/index.react-native.mjs +9 -9
- package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-N2DNPEA3.mjs} +21 -21
- package/dist/{module-Z3CL4GJ4.mjs → module-UQFIJQMG.mjs} +33 -13
- package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
- package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
- package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-CGDBJBHQ.mjs} +31 -18
- package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-UK44CVXG.mjs} +20 -20
- package/dist/partial-words.browser.mjs +3 -3
- package/dist/partial-words.mjs +8 -8
- package/dist/pattern.browser.mjs +2 -2
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
- package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
- package/dist/{query-actions-7EOKT3WD.mjs → query-actions-7BL3YZDW.mjs} +8 -8
- package/dist/query-suggestions/merge-worker.mjs +11 -11
- package/dist/query-suggestions.browser.mjs +3 -3
- package/dist/query-suggestions.d.ts +1 -1
- package/dist/query-suggestions.mjs +9 -9
- package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
- package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-63DZ26X5.mjs} +277 -75
- package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-BNFGA7TY.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
- package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-IP3QLETQ.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-LOKGE4OQ.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
- package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-UYAZLGEM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-XHYOQ4K4.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
- package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
- package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
- package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
- package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
- package/dist/react-native/chunks/{module-COLNJNML.mjs → module-QRCYB7QV.mjs} +32 -9
- package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
- package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
- package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-GC6JWMAF.mjs} +31 -18
- package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
- package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
- package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-2ACONS4W.mjs} +12 -12
- package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-SSIWXVUG.mjs} +10 -10
- package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-I2WDFE6O.mjs} +11 -11
- package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-YXXMG4VR.mjs} +14727 -13915
- package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-FS7A4PZA.mjs} +11 -11
- package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-PSFCT5EX.mjs} +11 -11
- package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-QRMISMEL.mjs} +10 -10
- package/dist/react-native/partial-words.mjs +9 -9
- package/dist/react-native/pattern.mjs +5 -5
- package/dist/react-native/query-suggestions.mjs +9 -9
- package/dist/react-native/sync.mjs +433 -51
- package/dist/react-native/synonyms.mjs +9 -9
- package/dist/react.d.ts +8 -8
- package/dist/react.mjs +7 -0
- package/dist/{rerank-KTV5L7MZ.mjs → rerank-4GFC26FD.mjs} +8 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
- package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-E4EIUYVV.mjs} +11 -11
- package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-MP6DILVE.mjs} +9 -9
- package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-ED2NMUC5.mjs} +9 -9
- package/dist/server.d.ts +13 -9
- package/dist/server.mjs +875 -348
- package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-HQFO37W7.mjs} +5234 -5835
- package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-PL2G7RM5.mjs} +10 -10
- package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-I3MEHACP.mjs} +12 -12
- package/dist/sync/filesystem.d.ts +2 -2
- package/dist/sync/filesystem.mjs +16 -16
- package/dist/sync/indexeddb.browser.mjs +1 -1
- package/dist/sync/indexeddb.d.ts +2 -2
- package/dist/sync/indexeddb.mjs +3 -3
- package/dist/sync.browser.mjs +35 -1108
- package/dist/sync.d.ts +3 -3
- package/dist/sync.mjs +430 -51
- package/dist/synonyms.browser.mjs +3 -3
- package/dist/synonyms.mjs +8 -8
- package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
- package/dist/thread-LTFI3RK5.mjs +31 -0
- package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-P7YWXEP5.mjs} +11 -11
- package/dist/workers/entry.mjs +14 -14
- package/openapi.json +144 -0
- package/package.json +5 -7
- package/dist/chunk-URVH6BLO.mjs +0 -217
- package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
- package/dist/thread-NQRNW3IH.mjs +0 -31
- /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { withOpenIndex, oneAtATime, resolveIndexAnalysis, loadStorageCode, emitSyncChange, encodeStringBlob, tokenize, typedRegion, regionsOverlap, encodeLookupKey } from './browser/chunk-
|
|
2
|
-
import { storedText } from './browser/chunk-
|
|
1
|
+
import { withOpenIndex, oneAtATime, resolveIndexAnalysis, loadStorageCode, emitSyncChange, encodeStringBlob, tokenize, typedRegion, regionsOverlap, encodeLookupKey } from './browser/chunk-UQG4HUGQ.mjs';
|
|
2
|
+
import { storedText } from './browser/chunk-QAOVAYAG.mjs';
|
|
3
3
|
import './browser/chunk-YJHGOJAC.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes, requireLoadedMessagePack, compareCodePoints } from './browser/chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes, requireLoadedMessagePack, compareCodePoints } from './browser/chunk-YINZFPLT.mjs';
|
|
5
5
|
|
|
6
6
|
// src/core/synonyms/combined-postings.ts
|
|
7
7
|
var NO_DELETED = { size: 0, has: () => false };
|
package/dist/synonyms.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { synonymSearchModule } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { synonymSearchModule } from './chunk-HSA3H3VW.mjs';
|
|
2
|
+
import './chunk-2CKDCC65.mjs';
|
|
3
|
+
import './chunk-AOYQTX6W.mjs';
|
|
4
4
|
import './chunk-GXCDWLQI.mjs';
|
|
5
5
|
import './chunk-BUMREPLU.mjs';
|
|
6
6
|
import './chunk-7T4LAYT4.mjs';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import './chunk-IL5DRCNU.mjs';
|
|
8
|
+
import './chunk-7P5YWDRQ.mjs';
|
|
9
9
|
import './chunk-U2BKYEC7.mjs';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-RORNUNXW.mjs';
|
|
11
11
|
import './chunk-UPDNNOTG.mjs';
|
|
12
12
|
import './chunk-3ECIRFS5.mjs';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-ASZLNVWW.mjs';
|
|
14
14
|
import './chunk-ZXX5GZEX.mjs';
|
|
15
15
|
import './chunk-4PY4JYMY.mjs';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-ZKOQR7EA.mjs';
|
|
17
17
|
import './chunk-TGPKS2UM.mjs';
|
|
18
18
|
|
|
19
19
|
// src/synonyms/index.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BackupListing, b as ClusterNodeInfo, N as NodeReadiness } from './config-
|
|
2
|
-
import { A as AllocationConstraints, N as NodeRole, d as NodeMemoryReport } from './index-
|
|
1
|
+
import { B as BackupListing, b as ClusterNodeInfo, N as NodeReadiness } from './config-BvHQ-C7U.js';
|
|
2
|
+
import { A as AllocationConstraints, N as NodeRole, d as NodeMemoryReport } from './index-BaQIAnk0.js';
|
|
3
3
|
import { a as QuerySuggestionsBuild } from './query-suggestions-CBYkrQ5T.js';
|
|
4
|
-
import { I as IndexInfo, P as PartitionStatsResult, V as VectorMaintenanceResult, M as MemoryStats } from './engine-
|
|
4
|
+
import { I as IndexInfo, P as PartitionStatsResult, V as VectorMaintenanceResult, M as MemoryStats } from './engine-qjAxJSKk.js';
|
|
5
5
|
import { A as AnyDocument, a as InsertOptions, B as BM25Params, W as WriteOptions } from './schema-CzG9OUw5.js';
|
|
6
6
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { closeRequestThread, searchHandler, serveRequests } from './chunk-SB5HCIIO.mjs';
|
|
2
|
+
import './chunk-7X4IIREW.mjs';
|
|
3
|
+
import './chunk-F6F4G322.mjs';
|
|
4
|
+
import './chunk-JXINPXRS.mjs';
|
|
5
|
+
import './chunk-Z6SIJH5O.mjs';
|
|
6
|
+
import './chunk-TSE2VWPX.mjs';
|
|
7
|
+
import './chunk-S5QMWECL.mjs';
|
|
8
|
+
import './chunk-LNGE7SLY.mjs';
|
|
9
|
+
import './chunk-R2PJKSNL.mjs';
|
|
10
|
+
import './chunk-62X472AC.mjs';
|
|
11
|
+
import './chunk-SIIDIGKI.mjs';
|
|
12
|
+
import './chunk-KBU3ZFJN.mjs';
|
|
13
|
+
import './chunk-V6EUBAIT.mjs';
|
|
14
|
+
import './chunk-KOA6T2IC.mjs';
|
|
15
|
+
import './chunk-HSA3H3VW.mjs';
|
|
16
|
+
import './chunk-2CKDCC65.mjs';
|
|
17
|
+
import './chunk-AOYQTX6W.mjs';
|
|
18
|
+
import './chunk-GXCDWLQI.mjs';
|
|
19
|
+
import './chunk-BUMREPLU.mjs';
|
|
20
|
+
import './chunk-7T4LAYT4.mjs';
|
|
21
|
+
import './chunk-IL5DRCNU.mjs';
|
|
22
|
+
import './chunk-7P5YWDRQ.mjs';
|
|
23
|
+
import './chunk-U2BKYEC7.mjs';
|
|
24
|
+
import './chunk-RORNUNXW.mjs';
|
|
25
|
+
import './chunk-UPDNNOTG.mjs';
|
|
26
|
+
import './chunk-3ECIRFS5.mjs';
|
|
27
|
+
import './chunk-ASZLNVWW.mjs';
|
|
28
|
+
import './chunk-ZXX5GZEX.mjs';
|
|
29
|
+
import './chunk-4PY4JYMY.mjs';
|
|
30
|
+
import './chunk-ZKOQR7EA.mjs';
|
|
31
|
+
import './chunk-TGPKS2UM.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { openSharedVectorField, createVectorStore } from '../chunk-
|
|
1
|
+
import { openSharedVectorField, createVectorStore } from '../chunk-ZS2YUB2L.mjs';
|
|
2
2
|
import '../chunk-T4HMSZCX.mjs';
|
|
3
|
-
import { osqBitsOf, createHNSWIndex, createOsqQuantizer, osqRecordBytes } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import { osqBitsOf, createHNSWIndex, createOsqQuantizer, osqRecordBytes } from '../chunk-KBU3ZFJN.mjs';
|
|
4
|
+
import '../chunk-RORNUNXW.mjs';
|
|
5
5
|
import { MAX_WORKER_COPIES } from '../chunk-UPDNNOTG.mjs';
|
|
6
6
|
import '../chunk-3ECIRFS5.mjs';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-ASZLNVWW.mjs';
|
|
8
8
|
import '../chunk-ZXX5GZEX.mjs';
|
|
9
9
|
import '../chunk-4PY4JYMY.mjs';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-ZKOQR7EA.mjs';
|
|
11
11
|
import '../chunk-TGPKS2UM.mjs';
|
|
12
12
|
|
|
13
13
|
// src/vector/worker-copy.ts
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { holdCopyPublication, copyGenerationOf, transferIndexToPool, executeRetained, loadIndexOntoWorkers } from './chunk-
|
|
2
|
-
export { emptySerializablePartition, loadIndexOntoWorkers, transferIndexToPool } from './chunk-
|
|
3
|
-
import { growPartitionsTo, isCompositePartition, createSharedFrozenSegment, loadStorageCode, resolvePartitionInsertOptions, buildSegmentPayloads, freezeSegmentShared, DEFAULT_COPY_THRESHOLD, workersEnabledByDefault, POOL_RESTART_DELAY_MS, createRequestId, mergeSegmentContents, freezeEncodedSegmentShared, SegmentRefusal, NO_REMOVED_SPELLINGS, DEFAULT_COPY_IDLE_TIMEOUT_MS, LONG_QUERY_THREADS, toError, isDeterministicFailure, workerIneligibility, reportIneligible, fnv1a, selectionKeeps, prepareDocumentVectors, MAX_PENDING_REPLICATION_DOCUMENTS, MAIN_COPY_LONE_QUERY_DOCUMENTS, returnsEveryMatch, oversampledFacetConfig, afterCurrentTurn, LOAD_BUFFER_YIELD_INTERVAL, yieldToEventLoop, IDLE_MERGE_DELAY_MS, alreadyPresentOnWorker, REPLICATION_WINDOW, RETIRED_THREADS_EXIT_WAIT_MS, eligibleIndexNames, createWorkerFactory, availablePatternSearch, patternHost, kWayMerge, mergeFacets, generateId, POOL_RESTART_DELAY_MAX_MS, COMPACTION_SEGMENT_TRIGGER, LIVE_TAIL_FREEZE_FLOOR, requireLoadedVectorCode, LIVE_TAIL_FLUSH_DOCUMENTS, SEGMENTS_PER_MERGE } from './chunk-
|
|
4
|
-
export { bindWorkerCopiesHost, createWorkerExecutor } from './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
import { holdCopyPublication, copyGenerationOf, transferIndexToPool, executeRetained, loadIndexOntoWorkers } from './chunk-SM2SYVIX.mjs';
|
|
2
|
+
export { emptySerializablePartition, loadIndexOntoWorkers, transferIndexToPool } from './chunk-SM2SYVIX.mjs';
|
|
3
|
+
import { growPartitionsTo, isCompositePartition, createSharedFrozenSegment, loadStorageCode, resolvePartitionInsertOptions, buildSegmentPayloads, freezeSegmentShared, DEFAULT_COPY_THRESHOLD, workersEnabledByDefault, POOL_RESTART_DELAY_MS, createRequestId, mergeSegmentContents, freezeEncodedSegmentShared, SegmentRefusal, NO_REMOVED_SPELLINGS, DEFAULT_COPY_IDLE_TIMEOUT_MS, LONG_QUERY_THREADS, toError, isDeterministicFailure, workerIneligibility, reportIneligible, fnv1a, selectionKeeps, prepareDocumentVectors, MAX_PENDING_REPLICATION_DOCUMENTS, MAIN_COPY_LONE_QUERY_DOCUMENTS, returnsEveryMatch, oversampledFacetConfig, afterCurrentTurn, LOAD_BUFFER_YIELD_INTERVAL, yieldToEventLoop, IDLE_MERGE_DELAY_MS, alreadyPresentOnWorker, REPLICATION_WINDOW, RETIRED_THREADS_EXIT_WAIT_MS, eligibleIndexNames, createWorkerFactory, availablePatternSearch, patternHost, kWayMerge, mergeFacets, generateId, POOL_RESTART_DELAY_MAX_MS, COMPACTION_SEGMENT_TRIGGER, LIVE_TAIL_FREEZE_FLOOR, requireLoadedVectorCode, LIVE_TAIL_FLUSH_DOCUMENTS, SEGMENTS_PER_MERGE } from './chunk-HSA3H3VW.mjs';
|
|
4
|
+
export { bindWorkerCopiesHost, createWorkerExecutor } from './chunk-HSA3H3VW.mjs';
|
|
5
|
+
import './chunk-2CKDCC65.mjs';
|
|
6
|
+
import './chunk-AOYQTX6W.mjs';
|
|
7
7
|
import './chunk-GXCDWLQI.mjs';
|
|
8
8
|
import './chunk-BUMREPLU.mjs';
|
|
9
9
|
import './chunk-7T4LAYT4.mjs';
|
|
10
|
-
import { MATCHER_STATE_BUDGET_BYTES } from './chunk-
|
|
11
|
-
import { schemaFieldsOf } from './chunk-
|
|
10
|
+
import { MATCHER_STATE_BUDGET_BYTES } from './chunk-IL5DRCNU.mjs';
|
|
11
|
+
import { schemaFieldsOf } from './chunk-7P5YWDRQ.mjs';
|
|
12
12
|
import './chunk-U2BKYEC7.mjs';
|
|
13
|
-
import { resolveWorkerCount, splitWorkerBudget, SHUTDOWN_TIMEOUT_MS, resolveRequestThreadCount } from './chunk-
|
|
13
|
+
import { resolveWorkerCount, splitWorkerBudget, SHUTDOWN_TIMEOUT_MS, resolveRequestThreadCount } from './chunk-RORNUNXW.mjs';
|
|
14
14
|
import { noteThreadSlotGone, threadSlotOfWorker } from './chunk-UPDNNOTG.mjs';
|
|
15
15
|
import { MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS } from './chunk-3ECIRFS5.mjs';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-ASZLNVWW.mjs';
|
|
17
17
|
import './chunk-ZXX5GZEX.mjs';
|
|
18
18
|
import './chunk-4PY4JYMY.mjs';
|
|
19
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
19
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
20
20
|
import './chunk-TGPKS2UM.mjs';
|
|
21
21
|
|
|
22
22
|
// src/workers/pool-memory.ts
|
package/dist/workers/entry.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { requireSearchBackendSettings, loadVectorCode, loadGeoCode, importOptionalReads, initializeCopyPublication, publishCopyAction, isValidWorkerAction } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { requireSearchBackendSettings, loadVectorCode, loadGeoCode, importOptionalReads, initializeCopyPublication, publishCopyAction, isValidWorkerAction } from '../chunk-HSA3H3VW.mjs';
|
|
2
|
+
import '../chunk-2CKDCC65.mjs';
|
|
3
|
+
import '../chunk-AOYQTX6W.mjs';
|
|
4
4
|
import '../chunk-GXCDWLQI.mjs';
|
|
5
5
|
import '../chunk-BUMREPLU.mjs';
|
|
6
6
|
import '../chunk-7T4LAYT4.mjs';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import { loadMessagePack } from '../chunk-
|
|
7
|
+
import '../chunk-IL5DRCNU.mjs';
|
|
8
|
+
import { loadMessagePack } from '../chunk-7P5YWDRQ.mjs';
|
|
9
9
|
import '../chunk-U2BKYEC7.mjs';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-RORNUNXW.mjs';
|
|
11
11
|
import { threadSlotOfWorker, startIdleHeapCleanup } from '../chunk-UPDNNOTG.mjs';
|
|
12
12
|
import '../chunk-3ECIRFS5.mjs';
|
|
13
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-ASZLNVWW.mjs';
|
|
14
14
|
import '../chunk-ZXX5GZEX.mjs';
|
|
15
15
|
import '../chunk-4PY4JYMY.mjs';
|
|
16
|
-
import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-
|
|
16
|
+
import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-ZKOQR7EA.mjs';
|
|
17
17
|
import '../chunk-TGPKS2UM.mjs';
|
|
18
18
|
|
|
19
19
|
// src/workers/action-handler.ts
|
|
@@ -32,9 +32,9 @@ async function importBootstrapModule(moduleUrl) {
|
|
|
32
32
|
await import(moduleUrl);
|
|
33
33
|
}
|
|
34
34
|
async function stopServingRequests() {
|
|
35
|
-
const { closeRequestThread } = await import('../thread-
|
|
35
|
+
const { closeRequestThread } = await import('../thread-LTFI3RK5.mjs');
|
|
36
36
|
closeRequestThread();
|
|
37
|
-
const { closeLongQueryThread } = await import('../long-query-thread-
|
|
37
|
+
const { closeLongQueryThread } = await import('../long-query-thread-N2DNPEA3.mjs');
|
|
38
38
|
closeLongQueryThread();
|
|
39
39
|
}
|
|
40
40
|
function holdsCopies(executor) {
|
|
@@ -87,7 +87,7 @@ function createActionHandler(executor) {
|
|
|
87
87
|
if (!holdsCopies(executor)) {
|
|
88
88
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "This executor holds no copies to answer requests from");
|
|
89
89
|
}
|
|
90
|
-
const starting = import('../thread-
|
|
90
|
+
const starting = import('../thread-LTFI3RK5.mjs').then(
|
|
91
91
|
({ serveRequests }) => serveRequests(executor, action.settings)
|
|
92
92
|
);
|
|
93
93
|
serving.start = starting.then(
|
|
@@ -104,7 +104,7 @@ function createActionHandler(executor) {
|
|
|
104
104
|
if (!holdsCopies(executor)) {
|
|
105
105
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "This executor holds no copies to answer long queries from");
|
|
106
106
|
}
|
|
107
|
-
const { serveLongQueries } = await import('../long-query-thread-
|
|
107
|
+
const { serveLongQueries } = await import('../long-query-thread-N2DNPEA3.mjs');
|
|
108
108
|
serveLongQueries(executor, action.settings);
|
|
109
109
|
servingRequests = true;
|
|
110
110
|
post(buildSuccessResponse(action.requestId, void 0));
|
|
@@ -152,8 +152,8 @@ async function setup() {
|
|
|
152
152
|
}
|
|
153
153
|
requireSearchBackendSettings();
|
|
154
154
|
const [{ createDirectExecutor }, { runQueryAction }] = await Promise.all([
|
|
155
|
-
import('../direct-executor-
|
|
156
|
-
import('../query-actions-
|
|
155
|
+
import('../direct-executor-WSZALYCV.mjs'),
|
|
156
|
+
import('../query-actions-7BL3YZDW.mjs'),
|
|
157
157
|
loadVectorCode(),
|
|
158
158
|
loadGeoCode(),
|
|
159
159
|
importOptionalReads(),
|
package/openapi.json
CHANGED
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
{
|
|
35
35
|
"name": "Sync"
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Changes"
|
|
39
|
+
},
|
|
37
40
|
{
|
|
38
41
|
"name": "QuerySuggestions"
|
|
39
42
|
}
|
|
@@ -2392,6 +2395,84 @@
|
|
|
2392
2395
|
}
|
|
2393
2396
|
}
|
|
2394
2397
|
},
|
|
2398
|
+
"/indexes/{name}/changes": {
|
|
2399
|
+
"get": {
|
|
2400
|
+
"operationId": "getChanges",
|
|
2401
|
+
"summary": "Report the change capture setting of an index and its epoch",
|
|
2402
|
+
"tags": [
|
|
2403
|
+
"Changes"
|
|
2404
|
+
],
|
|
2405
|
+
"parameters": [
|
|
2406
|
+
{
|
|
2407
|
+
"name": "name",
|
|
2408
|
+
"in": "path",
|
|
2409
|
+
"required": true,
|
|
2410
|
+
"description": "The name of the index.",
|
|
2411
|
+
"schema": {
|
|
2412
|
+
"type": "string"
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
],
|
|
2416
|
+
"responses": {
|
|
2417
|
+
"200": {
|
|
2418
|
+
"description": "The server answered the request.",
|
|
2419
|
+
"content": {
|
|
2420
|
+
"application/json": {
|
|
2421
|
+
"schema": {
|
|
2422
|
+
"$ref": "#/components/schemas/ChangesStatus"
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2427
|
+
"default": {
|
|
2428
|
+
"$ref": "#/components/responses/Error"
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
},
|
|
2432
|
+
"put": {
|
|
2433
|
+
"operationId": "updateChanges",
|
|
2434
|
+
"summary": "Replace the change capture setting of an index",
|
|
2435
|
+
"tags": [
|
|
2436
|
+
"Changes"
|
|
2437
|
+
],
|
|
2438
|
+
"parameters": [
|
|
2439
|
+
{
|
|
2440
|
+
"name": "name",
|
|
2441
|
+
"in": "path",
|
|
2442
|
+
"required": true,
|
|
2443
|
+
"description": "The name of the index.",
|
|
2444
|
+
"schema": {
|
|
2445
|
+
"type": "string"
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
],
|
|
2449
|
+
"requestBody": {
|
|
2450
|
+
"required": true,
|
|
2451
|
+
"content": {
|
|
2452
|
+
"application/json": {
|
|
2453
|
+
"schema": {
|
|
2454
|
+
"$ref": "#/components/schemas/ChangesSetting"
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
},
|
|
2459
|
+
"responses": {
|
|
2460
|
+
"200": {
|
|
2461
|
+
"description": "The server answered the request.",
|
|
2462
|
+
"content": {
|
|
2463
|
+
"application/json": {
|
|
2464
|
+
"schema": {
|
|
2465
|
+
"$ref": "#/components/schemas/OkResponse"
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
},
|
|
2470
|
+
"default": {
|
|
2471
|
+
"$ref": "#/components/responses/Error"
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
},
|
|
2395
2476
|
"/indexes/{name}/query-suggestions": {
|
|
2396
2477
|
"put": {
|
|
2397
2478
|
"operationId": "updateQuerySuggestions",
|
|
@@ -3110,6 +3191,69 @@
|
|
|
3110
3191
|
},
|
|
3111
3192
|
"description": "The body of `POST /indexes/{name}/_change-analysis`, where a key that you leave out keeps its current value."
|
|
3112
3193
|
},
|
|
3194
|
+
"ChangesSetting": {
|
|
3195
|
+
"type": "object",
|
|
3196
|
+
"properties": {
|
|
3197
|
+
"enabled": {
|
|
3198
|
+
"type": "boolean",
|
|
3199
|
+
"description": "This turns change capture on or off. Turning it on gives the index a new epoch unless device sync is on."
|
|
3200
|
+
},
|
|
3201
|
+
"previousDocument": {
|
|
3202
|
+
"type": "boolean",
|
|
3203
|
+
"description": "Set this to write into each log entry the document that the entry replaces or removes. A change then holds the document before the write, and a subscription can hold a filter. It defaults to false, because the engine then reads the stored document and writes it to the log again on every update and removal."
|
|
3204
|
+
},
|
|
3205
|
+
"historyMaxAgeMs": {
|
|
3206
|
+
"type": "number",
|
|
3207
|
+
"description": "This is the age in milliseconds after which the engine deletes a log segment from history. It defaults to 30 days."
|
|
3208
|
+
},
|
|
3209
|
+
"historyMaxBytes": {
|
|
3210
|
+
"type": "number",
|
|
3211
|
+
"description": "This is the byte count above which the engine deletes the oldest log segment from history. It defaults to the larger of the checkpoint's length and 1 GiB."
|
|
3212
|
+
}
|
|
3213
|
+
},
|
|
3214
|
+
"required": [
|
|
3215
|
+
"enabled"
|
|
3216
|
+
],
|
|
3217
|
+
"description": "The change capture setting of one index, which ChangesOperations.updateChanges takes. A subscriber receives the documents of the whole index, so decide which callers may follow an index before you turn capture on. A filter only chooses which changes a subscriber receives, and it grants no access."
|
|
3218
|
+
},
|
|
3219
|
+
"ChangesStatus": {
|
|
3220
|
+
"type": "object",
|
|
3221
|
+
"properties": {
|
|
3222
|
+
"previousDocument": {
|
|
3223
|
+
"type": "boolean",
|
|
3224
|
+
"description": "This is true when the engine writes the document before the write into each log entry."
|
|
3225
|
+
},
|
|
3226
|
+
"epoch": {
|
|
3227
|
+
"anyOf": [
|
|
3228
|
+
{
|
|
3229
|
+
"type": "null"
|
|
3230
|
+
},
|
|
3231
|
+
{
|
|
3232
|
+
"type": "string"
|
|
3233
|
+
}
|
|
3234
|
+
],
|
|
3235
|
+
"description": "This is the index epoch, 32 lowercase hexadecimal digits, or `null` while capture is off."
|
|
3236
|
+
},
|
|
3237
|
+
"enabled": {
|
|
3238
|
+
"type": "boolean",
|
|
3239
|
+
"description": "This turns change capture on or off. Turning it on gives the index a new epoch unless device sync is on."
|
|
3240
|
+
},
|
|
3241
|
+
"historyMaxAgeMs": {
|
|
3242
|
+
"type": "number",
|
|
3243
|
+
"description": "This is the age in milliseconds after which the engine deletes a log segment from history. It defaults to 30 days."
|
|
3244
|
+
},
|
|
3245
|
+
"historyMaxBytes": {
|
|
3246
|
+
"type": "number",
|
|
3247
|
+
"description": "This is the byte count above which the engine deletes the oldest log segment from history. It defaults to the larger of the checkpoint's length and 1 GiB."
|
|
3248
|
+
}
|
|
3249
|
+
},
|
|
3250
|
+
"required": [
|
|
3251
|
+
"previousDocument",
|
|
3252
|
+
"epoch",
|
|
3253
|
+
"enabled"
|
|
3254
|
+
],
|
|
3255
|
+
"description": "The change capture state of one index, which ChangesOperations.getChanges returns."
|
|
3256
|
+
},
|
|
3113
3257
|
"ClusterAllocationResponse": {
|
|
3114
3258
|
"type": "object",
|
|
3115
3259
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delali/narsil",
|
|
3
|
-
"version": "0.3.1-next.
|
|
3
|
+
"version": "0.3.1-next.193",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Distributed search engine with full-text, vector, hybrid, and geosearch. One engine, embedded or on a server, with a cross-language .nrsl format.",
|
|
6
6
|
"author": "Delali (https://sondelali.com)",
|
|
@@ -653,11 +653,9 @@
|
|
|
653
653
|
}
|
|
654
654
|
},
|
|
655
655
|
"optionalDependencies": {
|
|
656
|
-
"@delali/narsil-native-
|
|
657
|
-
"@delali/narsil-native-
|
|
658
|
-
"@delali/narsil-native-
|
|
659
|
-
"@delali/narsil-native-
|
|
660
|
-
"@delali/narsil-native-win32-arm64": "0.3.1-next.185",
|
|
661
|
-
"@delali/narsil-native-win32-x64": "0.3.1-next.185"
|
|
656
|
+
"@delali/narsil-native-linux-arm64": "0.3.1-next.193",
|
|
657
|
+
"@delali/narsil-native-linux-x64": "0.3.1-next.193",
|
|
658
|
+
"@delali/narsil-native-win32-arm64": "0.3.1-next.193",
|
|
659
|
+
"@delali/narsil-native-win32-x64": "0.3.1-next.193"
|
|
662
660
|
}
|
|
663
661
|
}
|
package/dist/chunk-URVH6BLO.mjs
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { encode } from './chunk-CV3Q2EKO.mjs';
|
|
2
|
-
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
3
|
-
import { openChecksummedEnvelope, packChecksummedEnvelope } from './chunk-EDEE7ETQ.mjs';
|
|
4
|
-
import { rulesOfStoredSynonyms, configurationPayloadOf, withOpenIndex, emitSyncChange } from './chunk-SL53DHVE.mjs';
|
|
5
|
-
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
6
|
-
import { newSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
|
|
8
|
-
|
|
9
|
-
// src/engine/snapshot/index-configuration-decode.ts
|
|
10
|
-
var INDEX_CONFIGURATION_ENVELOPE_VERSION = 5;
|
|
11
|
-
function requireConfigurationShape(raw, what) {
|
|
12
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
13
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} does not hold an index configuration`);
|
|
14
|
-
}
|
|
15
|
-
const configuration = raw;
|
|
16
|
-
if (configuration.schema === null || typeof configuration.schema !== "object") {
|
|
17
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} holds no schema`);
|
|
18
|
-
}
|
|
19
|
-
if (typeof configuration.language !== "string" || configuration.language.length === 0) {
|
|
20
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} holds no language`);
|
|
21
|
-
}
|
|
22
|
-
return configuration;
|
|
23
|
-
}
|
|
24
|
-
async function decodeIndexConfiguration(bytes) {
|
|
25
|
-
const { payload } = await openChecksummedEnvelope(bytes, {
|
|
26
|
-
envelopeFormatVersion: INDEX_CONFIGURATION_ENVELOPE_VERSION,
|
|
27
|
-
what: "index configuration",
|
|
28
|
-
allowsCompression: true
|
|
29
|
-
});
|
|
30
|
-
let raw;
|
|
31
|
-
try {
|
|
32
|
-
raw = decode(payload);
|
|
33
|
-
} catch {
|
|
34
|
-
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, "The index configuration is not MessagePack");
|
|
35
|
-
}
|
|
36
|
-
return requireConfigurationShape(raw, "index configuration");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/engine/snapshot/index-configuration-encode.ts
|
|
40
|
-
function refuseCode(entry) {
|
|
41
|
-
if (entry.config.tokenizer !== void 0 && typeof entry.config.tokenizer !== "string") {
|
|
42
|
-
throw new NarsilError(
|
|
43
|
-
ErrorCodes.CONFIG_INVALID,
|
|
44
|
-
"A snapshot persists no code, so the index tokenizer must be a name registered with registerTokenizer"
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
if (typeof entry.config.stopWords === "function") {
|
|
48
|
-
throw new NarsilError(
|
|
49
|
-
ErrorCodes.CONFIG_INVALID,
|
|
50
|
-
"A snapshot persists no code, so the index stop words must be a name registered with registerStopWords"
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function indexConfigurationOf(entry) {
|
|
55
|
-
refuseCode(entry);
|
|
56
|
-
const synonyms = entry.synonyms === null ? void 0 : rulesOfStoredSynonyms(entry.synonyms);
|
|
57
|
-
const payload = configurationPayloadOf(
|
|
58
|
-
entry.config,
|
|
59
|
-
entry.language,
|
|
60
|
-
entry.embeddingAdapterName,
|
|
61
|
-
entry.analysisRevision,
|
|
62
|
-
entry.arrayPositionGap,
|
|
63
|
-
synonyms,
|
|
64
|
-
entry.analysisGeneration
|
|
65
|
-
);
|
|
66
|
-
const withSuggestions = { ...payload, ...entry.querySuggestions };
|
|
67
|
-
return entry.sync === null ? withSuggestions : { ...withSuggestions, syncEpoch: entry.sync.epoch };
|
|
68
|
-
}
|
|
69
|
-
async function encodeIndexConfiguration(entry) {
|
|
70
|
-
const packed = await packChecksummedEnvelope(
|
|
71
|
-
[encode(indexConfigurationOf(entry))],
|
|
72
|
-
INDEX_CONFIGURATION_ENVELOPE_VERSION,
|
|
73
|
-
"index configuration"
|
|
74
|
-
);
|
|
75
|
-
const bytes = new Uint8Array(packed.byteLength);
|
|
76
|
-
let offset = 0;
|
|
77
|
-
for (const chunk of packed.chunks) {
|
|
78
|
-
bytes.set(chunk, offset);
|
|
79
|
-
offset += chunk.byteLength;
|
|
80
|
-
}
|
|
81
|
-
return bytes;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// src/engine/sync/operations.ts
|
|
85
|
-
function invalidLimit(name, value) {
|
|
86
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The sync setting ${name} must be a positive whole number`, {
|
|
87
|
-
[name]: String(value)
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function requireSyncSetting(setting) {
|
|
91
|
-
if (setting === null || typeof setting !== "object") {
|
|
92
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The sync setting must be an object");
|
|
93
|
-
}
|
|
94
|
-
const { enabled, historyMaxAgeMs, historyMaxBytes } = setting;
|
|
95
|
-
if (typeof enabled !== "boolean") {
|
|
96
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The sync setting needs enabled set to true or false");
|
|
97
|
-
}
|
|
98
|
-
const isLimit = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
|
|
99
|
-
if (historyMaxAgeMs !== void 0 && !isLimit(historyMaxAgeMs)) invalidLimit("historyMaxAgeMs", historyMaxAgeMs);
|
|
100
|
-
if (historyMaxBytes !== void 0 && !isLimit(historyMaxBytes)) invalidLimit("historyMaxBytes", historyMaxBytes);
|
|
101
|
-
return {
|
|
102
|
-
enabled,
|
|
103
|
-
...historyMaxAgeMs !== void 0 ? { historyMaxAgeMs } : {},
|
|
104
|
-
...historyMaxBytes !== void 0 ? { historyMaxBytes } : {}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function requireNoQuerySuggestions(state, indexName) {
|
|
108
|
-
if (state?.querySuggestions?.enabled !== true) return;
|
|
109
|
-
throw new NarsilError(
|
|
110
|
-
ErrorCodes.CONFIG_INVALID,
|
|
111
|
-
`Index "${indexName}" has popular query suggestions on, so it cannot sync to devices: a device receives the whole index of one user, while a suggestion comes from the searches of several people`,
|
|
112
|
-
{ indexName }
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
function syncStorageOf(core, indexName) {
|
|
116
|
-
const storage = core.durability?.manager.syncStorage?.();
|
|
117
|
-
if (storage === void 0) {
|
|
118
|
-
throw new NarsilError(
|
|
119
|
-
ErrorCodes.SYNC_DURABILITY_REQUIRED,
|
|
120
|
-
`Index "${indexName}" needs write-ahead log durability for device sync, because the feed reads the log`,
|
|
121
|
-
{ indexName }
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
return storage;
|
|
125
|
-
}
|
|
126
|
-
async function persistSyncState(core, indexName, next) {
|
|
127
|
-
const entry = core.requireIndex(indexName);
|
|
128
|
-
const previous = entry.sync;
|
|
129
|
-
entry.sync = next;
|
|
130
|
-
try {
|
|
131
|
-
await core.durability?.manager.persistMetadata(indexName);
|
|
132
|
-
} catch (error) {
|
|
133
|
-
entry.sync = previous;
|
|
134
|
-
throw error;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function updateIndexSync(core, indexName, value) {
|
|
138
|
-
const setting = requireSyncSetting(value);
|
|
139
|
-
core.requireIndex(indexName);
|
|
140
|
-
const storage = syncStorageOf(core, indexName);
|
|
141
|
-
return withOpenIndex(
|
|
142
|
-
core,
|
|
143
|
-
indexName,
|
|
144
|
-
() => oneSyncChangeAtATime(core.indexRegistry, indexName, async () => {
|
|
145
|
-
if (setting.enabled) requireNoQuerySuggestions(core.requireIndex(indexName).querySuggestions, indexName);
|
|
146
|
-
const previous = core.requireIndex(indexName).sync;
|
|
147
|
-
if (!setting.enabled) {
|
|
148
|
-
if (previous === null) return;
|
|
149
|
-
await persistSyncState(core, indexName, null);
|
|
150
|
-
await storage.release(indexName);
|
|
151
|
-
emitSyncChange(core.indexRegistry, { kind: "off", indexName });
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const limits = {
|
|
155
|
-
...setting.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: setting.historyMaxAgeMs } : {},
|
|
156
|
-
...setting.historyMaxBytes !== void 0 ? { historyMaxBytes: setting.historyMaxBytes } : {}
|
|
157
|
-
};
|
|
158
|
-
if (previous !== null) {
|
|
159
|
-
await persistSyncState(core, indexName, { ...limits, active: previous.active, epoch: previous.epoch });
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
await storage.release(indexName);
|
|
163
|
-
await persistSyncState(core, indexName, { ...limits, active: false, epoch: newSyncEpoch() });
|
|
164
|
-
})
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
async function renewWhileHeld(core, indexName) {
|
|
168
|
-
const sync = core.indexRegistry.get(indexName)?.sync ?? null;
|
|
169
|
-
if (sync === null) return;
|
|
170
|
-
await persistSyncState(core, indexName, { ...sync, active: false, epoch: newSyncEpoch() });
|
|
171
|
-
await core.durability?.manager.syncStorage?.().release(indexName);
|
|
172
|
-
emitSyncChange(core.indexRegistry, { kind: "epoch", indexName });
|
|
173
|
-
}
|
|
174
|
-
function holdRenewedSyncEpoch(core, indexName) {
|
|
175
|
-
if (core.mutationCtx.capacityScope === "partition") return Promise.resolve(() => void 0);
|
|
176
|
-
return new Promise((resolveHold, rejectHold) => {
|
|
177
|
-
void oneSyncChangeAtATime(core.indexRegistry, indexName, async () => {
|
|
178
|
-
try {
|
|
179
|
-
await renewWhileHeld(core, indexName);
|
|
180
|
-
} catch (error) {
|
|
181
|
-
rejectHold(error);
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
await new Promise((release) => resolveHold(() => release()));
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// src/engine/snapshot/constants.ts
|
|
190
|
-
var RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE = 0.2;
|
|
191
|
-
var RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 7.86;
|
|
192
|
-
var RESTORE_WORST_HEAP_BYTES_PER_VECTOR = 264;
|
|
193
|
-
var RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION = 0.24;
|
|
194
|
-
var RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 738;
|
|
195
|
-
var RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 0.2;
|
|
196
|
-
var RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE = 4.06;
|
|
197
|
-
var RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 14.5;
|
|
198
|
-
var RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR = 1482;
|
|
199
|
-
var RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION = 9.29;
|
|
200
|
-
var RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 2141;
|
|
201
|
-
var RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 24.15;
|
|
202
|
-
var RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE = 0.16;
|
|
203
|
-
var RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 6.16;
|
|
204
|
-
var RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR = 204;
|
|
205
|
-
var RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION = 0.17;
|
|
206
|
-
var RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 695;
|
|
207
|
-
var RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 0.04;
|
|
208
|
-
var RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE = 2.14;
|
|
209
|
-
var RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 5.05;
|
|
210
|
-
var RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR = 1080;
|
|
211
|
-
var RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION = 0.72;
|
|
212
|
-
var RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 1744;
|
|
213
|
-
var RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 20.05;
|
|
214
|
-
var RESTORE_ESTIMATE_MARGIN = 1.25;
|
|
215
|
-
var MAX_SNAPSHOT_ANALYSIS_ATTEMPTS = 3;
|
|
216
|
-
|
|
217
|
-
export { INDEX_CONFIGURATION_ENVELOPE_VERSION, MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, RESTORE_ESTIMATE_MARGIN, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE, RESTORE_WORST_HEAP_BYTES_PER_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION, decodeIndexConfiguration, encodeIndexConfiguration, holdRenewedSyncEpoch, indexConfigurationOf, requireConfigurationShape, requireNoQuerySuggestions, requireSyncSetting, syncStorageOf, updateIndexSync };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { restoreVectorFields, setNestedValue } from './chunk-OZ3XEM6D.mjs';
|
|
2
|
-
export { Decoder, MAP_TAGS, bindMsgpackHost, decode, decodeMulti, encodeDocument, headerAt } from './chunk-YOTP2FPE.mjs';
|
|
3
|
-
import './chunk-ZDDJVR7X.mjs';
|
|
4
|
-
import './chunk-HRDMIQ63.mjs';
|
|
5
|
-
import './chunk-VUJCSQG5.mjs';
|
|
6
|
-
import './chunk-TQ26BKBH.mjs';
|
|
7
|
-
export { encode } from '@msgpack/msgpack';
|