@delali/narsil 0.3.1-next.153 → 0.3.1-next.155
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 +3 -1
- 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/{analysis-change-2OYM7ARW.mjs → analysis-change-3TFIHT5E.mjs} +32 -23
- package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
- package/dist/archive-history-E4R73RWD.mjs +29 -0
- package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-TC36BU47.mjs} +39 -10
- package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
- package/dist/browser/chunk-23XRXIBW.mjs +85 -0
- package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
- package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-4EWUGZYZ.mjs} +4 -4
- package/dist/browser/chunk-4WCVMOU3.mjs +151 -0
- package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-56W3HQVJ.mjs} +9 -150
- package/dist/{react-native/chunks/chunk-VGUWIZFQ.mjs → browser/chunk-5TCXK5SB.mjs} +2 -2
- package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
- package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
- package/dist/browser/chunk-A5KUEGDY.mjs +241 -0
- package/dist/browser/{chunk-HT7J73QL.mjs → chunk-ABCXENU5.mjs} +2 -2
- package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
- package/dist/browser/chunk-BXM5XOCA.mjs +315 -0
- package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
- package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
- package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
- package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-EXQZGUQH.mjs} +2 -79
- package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-FNIFPFB7.mjs} +5 -31
- package/dist/browser/chunk-G64Q6OJF.mjs +96 -0
- package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
- package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
- package/dist/browser/chunk-JIJXMI42.mjs +1829 -0
- package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
- package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-K4GCSZLI.mjs} +15 -6
- package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-K5AXJBLL.mjs} +6 -5
- package/dist/browser/chunk-KKAMCABR.mjs +432 -0
- package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-LFIWRCEA.mjs} +1 -159
- package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
- package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
- package/dist/browser/chunk-NLWTBAGB.mjs +111 -0
- package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
- package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
- package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-RND5CLX3.mjs} +147 -253
- package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-RQBUNZQW.mjs} +2 -2
- package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-RRO3EV4C.mjs} +9 -8
- package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-SMEQ36NT.mjs} +162 -2019
- package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-SRMZXJSL.mjs} +8 -1
- package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SUDNZKPL.mjs} +2 -2
- package/dist/browser/{chunk-LURXVCHG.mjs → chunk-U3JOQGWX.mjs} +1 -1
- package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
- package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-XY4VVBBO.mjs} +3 -2
- package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
- package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
- package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-NEUGHUPA.mjs} +21 -14
- package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
- package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-CVGPRO6D.mjs} +1299 -881
- package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
- package/dist/browser/import-OM6QAW45.mjs +18 -0
- package/dist/browser/methods-KTQCSIN4.mjs +30 -0
- package/dist/browser/{module-XQLEOYNM.mjs → module-3HNFCBJ5.mjs} +10 -8
- package/dist/browser/{module-KAMRAJLE.mjs → module-E33X4AOK.mjs} +17 -10
- package/dist/browser/operations-OJ3BXS55.mjs +5 -0
- package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
- package/dist/browser/{pool-DTYSPBMQ.mjs → pool-3JLET5RO.mjs} +3 -2
- package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
- package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
- package/dist/browser/retention-ASWUHAYI.mjs +209 -0
- package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-OTAGEFQW.mjs} +1 -1
- package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-PN7ZW6Q4.mjs} +80 -315
- package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
- package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
- package/dist/browser/{write-I5P5MW4O.mjs → write-HMDYCTV2.mjs} +17 -11
- package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-Da4ywVVl.d.ts} +94 -7
- package/dist/{chunk-LDGGR7YT.mjs → chunk-2MANFZJ3.mjs} +2 -2
- package/dist/{chunk-IZT3G24Q.mjs → chunk-2NE7VCYE.mjs} +2 -2
- package/dist/{chunk-3TVDTACC.mjs → chunk-3C7MTCCI.mjs} +1 -1
- package/dist/chunk-3HB3PEC6.mjs +240 -0
- package/dist/chunk-3HHQLEEQ.mjs +1092 -0
- package/dist/chunk-3OH67G7R.mjs +214 -0
- package/dist/{chunk-ZS6CMXAE.mjs → chunk-3R4UZWQG.mjs} +98 -250
- package/dist/{chunk-65WCV5JO.mjs → chunk-4BYWRYPM.mjs} +1 -1
- package/dist/{chunk-SOUZMPME.mjs → chunk-4KRC2APY.mjs} +7 -194
- package/dist/{chunk-5QMHMELB.mjs → chunk-5FLRXF73.mjs} +8 -1
- package/dist/chunk-5FVU47TB.mjs +20 -0
- package/dist/chunk-5YNRKI2C.mjs +81 -0
- package/dist/chunk-6L3XJXGU.mjs +470 -0
- package/dist/chunk-6MSZ543Y.mjs +32 -0
- package/dist/{chunk-T4CJDBBE.mjs → chunk-6OEGXLBX.mjs} +1 -1
- package/dist/{chunk-3SBJVQLL.mjs → chunk-6RC4K46J.mjs} +2 -2
- package/dist/chunk-7GXJUJ24.mjs +49 -0
- package/dist/{chunk-FNBNZCGP.mjs → chunk-AILVAOLX.mjs} +2 -2
- package/dist/chunk-BDRIVYOK.mjs +72 -0
- package/dist/chunk-BUMREPLU.mjs +15 -0
- package/dist/chunk-BY6ZDGYS.mjs +50 -0
- package/dist/{chunk-5WB2A3XU.mjs → chunk-DCNKVEDB.mjs} +511 -27
- package/dist/{chunk-NITCPDFL.mjs → chunk-DIBHI6W5.mjs} +2 -2
- package/dist/{chunk-4QCSHLNM.mjs → chunk-DUOLGBTE.mjs} +3 -3
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/chunk-GH4WQ22V.mjs +34 -0
- package/dist/chunk-GQPTDQCL.mjs +54 -0
- package/dist/chunk-H4KHPLHJ.mjs +382 -0
- package/dist/{chunk-7TE2AJIH.mjs → chunk-H6VIGE62.mjs} +13 -10
- package/dist/{chunk-J7M73VY7.mjs → chunk-HJJI72X7.mjs} +1 -1
- package/dist/{chunk-DGRM4EZZ.mjs → chunk-HNVVEQP7.mjs} +1 -1
- package/dist/{chunk-RBEHLIKX.mjs → chunk-HW5TNXBO.mjs} +35 -11
- package/dist/{chunk-KYVRZAYP.mjs → chunk-I54T6CQP.mjs} +2 -69
- package/dist/{chunk-IRWP524D.mjs → chunk-INJYO3BU.mjs} +1 -1
- package/dist/chunk-IPN7S4KX.mjs +130 -0
- package/dist/{chunk-CSHHU7PA.mjs → chunk-J4IWBIVY.mjs} +11 -30
- package/dist/{chunk-G5KHSM6E.mjs → chunk-K4ZIGL2O.mjs} +1 -1
- package/dist/{chunk-6RKSY3BX.mjs → chunk-KBDBPVLN.mjs} +5 -5
- package/dist/{chunk-J4BDAH2W.mjs → chunk-KBKEXQZA.mjs} +2 -2
- package/dist/{chunk-IJSFWGVW.mjs → chunk-KFLK5NA2.mjs} +3 -3
- package/dist/{chunk-YGQOPB2Z.mjs → chunk-KHKIRS5D.mjs} +1 -1
- package/dist/chunk-KJ3RTZDJ.mjs +101 -0
- package/dist/{chunk-2PNYKG2D.mjs → chunk-KMUNHGBQ.mjs} +139 -432
- package/dist/chunk-KP7TYHWT.mjs +92 -0
- package/dist/{chunk-VP6XRMWR.mjs → chunk-KPIV4RUC.mjs} +6 -32
- package/dist/{chunk-NPXVQS33.mjs → chunk-KXCVQWOR.mjs} +4 -3
- package/dist/chunk-KYYABCSW.mjs +72 -0
- package/dist/{chunk-6F6USYII.mjs → chunk-L7ZD4L3K.mjs} +267 -265
- package/dist/{chunk-U46IZNCW.mjs → chunk-LC3FDWTX.mjs} +3 -2
- package/dist/{chunk-6BWLDLS3.mjs → chunk-LHKOSI2J.mjs} +1 -1
- package/dist/chunk-LNGE7SLY.mjs +151 -0
- package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-MP7ABPTD.mjs} +12 -2
- package/dist/chunk-MT2NRTA6.mjs +216 -0
- package/dist/chunk-NF4DT3IH.mjs +85 -0
- package/dist/{chunk-POUYICOU.mjs → chunk-OIJ64LGT.mjs} +1 -1
- package/dist/{chunk-SEAJS664.mjs → chunk-PCRA7HTI.mjs} +5 -5
- package/dist/chunk-PHQNACDT.mjs +63 -0
- package/dist/chunk-Q622CTMC.mjs +74 -0
- package/dist/{chunk-NVTFQFUL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
- package/dist/chunk-QDZJM7NI.mjs +23 -0
- package/dist/{chunk-52QQWEBS.mjs → chunk-QH3YIQP4.mjs} +36 -7
- package/dist/chunk-QJVOLKU6.mjs +111 -0
- package/dist/chunk-QUJHMPTP.mjs +30 -0
- package/dist/{chunk-3E4RRF5J.mjs → chunk-RSVULW4Q.mjs} +100 -8
- package/dist/{chunk-IJPK5PGM.mjs → chunk-RVGRFOGN.mjs} +1 -1
- package/dist/chunk-RZWWB2XR.mjs +96 -0
- package/dist/{chunk-KQJVNPRM.mjs → chunk-S2EQU2GE.mjs} +19 -16
- package/dist/chunk-S5LN746F.mjs +10 -0
- package/dist/{chunk-LJ4ENXOD.mjs → chunk-SG3JBNHY.mjs} +2 -2
- package/dist/{chunk-B2FTZNNF.mjs → chunk-SMVH6JBE.mjs} +34 -14
- package/dist/chunk-SY3EWKQY.mjs +242 -0
- package/dist/{chunk-NYSONUB7.mjs → chunk-TQXHPFWT.mjs} +1 -1
- package/dist/{chunk-ZHAXP7SD.mjs → chunk-U4BS74YN.mjs} +26 -238
- package/dist/chunk-UHICS3JI.mjs +83 -0
- package/dist/chunk-UZRZKNNZ.mjs +101 -0
- package/dist/chunk-V6EUBAIT.mjs +19 -0
- package/dist/{chunk-TTCKT2RT.mjs → chunk-VGF7CFRP.mjs} +134 -11
- package/dist/chunk-VHBNF4MA.mjs +543 -0
- package/dist/{chunk-AWNHDBKV.mjs → chunk-VQEUR6T6.mjs} +16 -8
- package/dist/chunk-WQRN64Q6.mjs +196 -0
- package/dist/{chunk-DMNPYF54.mjs → chunk-WZ7YV54N.mjs} +2 -2
- package/dist/chunk-Y4WPNHMC.mjs +50 -0
- package/dist/{chunk-2HJWQPR6.mjs → chunk-YEDIDCR7.mjs} +6 -122
- package/dist/chunk-YEKL4JBK.mjs +96 -0
- package/dist/{chunk-UGVUW27S.mjs → chunk-Z2BE2MAM.mjs} +14 -10
- package/dist/{chunk-3HV7M5OJ.mjs → chunk-ZAUJFLEN.mjs} +11 -135
- package/dist/{chunk-FDG4KXX5.mjs → chunk-ZHCUZZE5.mjs} +6 -4
- package/dist/chunk-ZTW5WTGG.mjs +167 -0
- package/dist/chunk-ZYAY26KG.mjs +29 -0
- package/dist/{client-Cn3gNxUU.d.ts → client-DRv7UVeY.d.ts} +193 -11
- package/dist/client.d.ts +9 -7
- package/dist/client.mjs +120 -7
- package/dist/{cold-module-PYSSBIL7.mjs → cold-module-7XXCEGTZ.mjs} +43 -33
- package/dist/config-CoSig5Ox.d.ts +482 -0
- package/dist/{config-CfhH1IWQ.d.ts → config-DMwffLKn.d.ts} +20 -5
- package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-G5TK7NLA.mjs} +18 -13
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +4 -4
- package/dist/distribution/transport/in-memory.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +3 -3
- package/dist/distribution.d.ts +41 -9
- package/dist/distribution.mjs +9304 -7271
- package/dist/durability-config-GE4U7MCZ.mjs +89 -0
- package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-NCKUC5EO.mjs} +1293 -872
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{config-aIsy7mcL.d.ts → engine-CFxPYqEk.d.ts} +716 -407
- package/dist/engine-hooks-DHCMOADY.mjs +47 -0
- package/dist/{import-GJOMB2HC.mjs → import-NBFXFCSG.mjs} +32 -24
- package/dist/{index-MsF7e5hL.d.ts → index-C4AmUnl1.d.ts} +1 -1
- package/dist/index.browser.mjs +9 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +29 -21
- package/dist/index.react-native.mjs +19 -12
- package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-J4DVRM4A.mjs} +33 -19
- package/dist/methods-7IOINERF.mjs +30 -0
- package/dist/{module-6RLIKSZQ.mjs → module-DWKPBSMN.mjs} +38 -28
- package/dist/{module-AVQEIB7O.mjs → module-UN76TF7I.mjs} +14 -14
- package/dist/operations-G5EP6JPX.mjs +5 -0
- package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-DPNWVSK2.mjs} +46 -31
- package/dist/partial-words.mjs +7 -5
- package/dist/pattern.mjs +4 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +16 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +40 -29
- package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
- package/dist/{pool-UPV5PVPY.mjs → pool-Y4A46T36.mjs} +2 -2
- package/dist/query-suggestions/merge-worker.d.ts +55 -0
- package/dist/query-suggestions/merge-worker.mjs +81 -0
- package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
- package/dist/query-suggestions.browser.mjs +246 -0
- package/dist/query-suggestions.d.ts +20 -0
- package/dist/query-suggestions.mjs +62 -0
- package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-6BPDPH6K.mjs} +50 -19
- package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-JLL42PH6.mjs} +1 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
- package/dist/react-native/chunks/chunk-3JIBF3XT.mjs +191 -0
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
- package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-4DII3ZSM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-4J74WHQM.mjs} +2 -2
- package/dist/react-native/chunks/chunk-4LCEN2IU.mjs +315 -0
- package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-4Y53T4YE.mjs} +6 -190
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
- package/dist/react-native/chunks/chunk-6WA3C3DV.mjs +85 -0
- package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
- package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7PXRWYUU.mjs} +1 -1
- package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-ALOIBXWN.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-C3PTWYKT.mjs} +10 -153
- package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-C5G6TJ7A.mjs} +2 -69
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
- package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-CKNRFDTZ.mjs} +1 -1
- package/dist/react-native/chunks/chunk-CUH5F57W.mjs +242 -0
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
- package/dist/{browser/chunk-55WYRLDZ.mjs → react-native/chunks/chunk-DVDX4SDR.mjs} +2 -2
- package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +12 -2
- package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-EIOYM5TO.mjs} +17 -9
- package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
- package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
- package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-GJFXPHXI.mjs} +5 -4
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-HUOYZJ3Q.mjs} +140 -430
- package/dist/react-native/chunks/chunk-IYNT75CE.mjs +111 -0
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
- package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-JLIIWJUV.mjs} +2 -2
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
- package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
- package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-KTTAU63H.mjs} +5 -5
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
- package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +2 -79
- package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-MJDQU5MW.mjs} +4 -30
- package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-MVXELMJX.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-N2WUOWLL.mjs} +12 -10
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
- package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-OL3WDV53.mjs} +7 -33
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
- package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-PEHS2UO3.mjs} +7 -6
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
- package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
- package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
- package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-RDWG33MM.mjs} +2 -2
- package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +96 -0
- package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
- package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-U4KSKA4Z.mjs} +1 -1
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
- package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-VXGE4ZXL.mjs} +151 -257
- package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-WBYQRHDY.mjs} +2 -2
- package/dist/react-native/chunks/chunk-YH7QY657.mjs +288 -0
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
- package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-5PHF6DZR.mjs} +31 -22
- package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
- package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-KO565FZC.mjs} +1309 -889
- package/dist/react-native/chunks/engine-hooks-MVRRHH6B.mjs +28 -0
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
- package/dist/react-native/chunks/import-YVZA4V4V.mjs +30 -0
- package/dist/react-native/chunks/methods-6W5U4C3H.mjs +30 -0
- package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-H5MVPSP2.mjs} +13 -11
- package/dist/react-native/chunks/module-ZL5ZG6YB.mjs +34 -0
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
- package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-JR3NJCAF.mjs} +3 -2
- package/dist/react-native/chunks/restore-hooks-SILFPU6B.mjs +125 -0
- package/dist/react-native/chunks/restore-queue-HSYP2AEC.mjs +55 -0
- package/dist/react-native/chunks/retention-7I7UAWYK.mjs +221 -0
- package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-R5E3TB3J.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-EZYB6SLF.mjs} +90 -323
- package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
- package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-JUESXHDL.mjs} +27 -19
- package/dist/react-native/partial-words.mjs +8 -5
- package/dist/react-native/pattern.mjs +4 -3
- package/dist/react-native/query-suggestions.mjs +258 -0
- package/dist/react-native/sync.mjs +2299 -0
- package/dist/react-native/synonyms.mjs +7 -4
- package/dist/react.d.ts +11 -10
- package/dist/react.mjs +8 -1
- package/dist/{rerank-3W54N6P2.mjs → rerank-MQ37IYRV.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/restore-hooks-HZ3ILAMO.mjs +146 -0
- package/dist/restore-queue-JVGENGGE.mjs +55 -0
- package/dist/retention-HROPV2QU.mjs +59 -0
- package/dist/{runtime-L2DZYY6N.mjs → runtime-COIUORCN.mjs} +5 -5
- package/dist/{schema-D33CyXCy.d.ts → schema-Jwt928nJ.d.ts} +1 -1
- package/dist/server.d.ts +119 -20
- package/dist/server.mjs +1123 -58
- package/dist/{snapshot-WMX6JCLP.mjs → snapshot-4HS2G2UM.mjs} +106 -49
- package/dist/start-UTWHGH42.mjs +59 -0
- package/dist/sync/filesystem.d.ts +30 -0
- package/dist/sync/filesystem.mjs +271 -0
- package/dist/sync/indexeddb.d.ts +30 -0
- package/dist/sync/indexeddb.mjs +237 -0
- package/dist/sync-state-ZWHLAFLE.mjs +15 -0
- package/dist/sync.browser.mjs +2294 -0
- package/dist/sync.d.ts +23 -0
- package/dist/sync.mjs +2268 -0
- package/dist/synonyms.mjs +6 -4
- package/dist/{tasks-C4ElXr4P.d.ts → tasks-qrJojgST.d.ts} +13 -5
- package/dist/thread-6MOXY2KD.mjs +45 -0
- package/dist/types-BZCGjfLn.d.ts +227 -0
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +7 -7
- package/dist/workers/entry.mjs +8 -8
- package/dist/{write-SKJ6HW7O.mjs → write-GTTWWRRG.mjs} +36 -28
- package/openapi.json +912 -5
- package/package.json +45 -8
- package/dist/browser/import-QOY6ZH6X.mjs +0 -12
- package/dist/browser/restore-queue-UQ6AAUVX.mjs +0 -41
- package/dist/chunk-7LDMWKP6.mjs +0 -209
- package/dist/engine-CJRUHXgf.d.ts +0 -664
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
- package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
- package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
- package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
- package/dist/react-native/chunks/restore-queue-H5VCN453.mjs +0 -41
- package/dist/restore-queue-AOF5OTQV.mjs +0 -41
- package/dist/thread-I7DVHHW7.mjs +0 -31
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ Every hit holds the document, its id, and its BM25 score. Beside the hits, `resu
|
|
|
106
106
|
|
|
107
107
|
**Geosearch.** [Geo filters](https://github.com/assetcorp/narsil/blob/main/docs/geosearch.md) match documents by radius, using Haversine or Vincenty distance, or by polygon containment. You can combine a geo filter with every other query feature.
|
|
108
108
|
|
|
109
|
-
**Storage.** [Persistence adapters](https://github.com/assetcorp/narsil/blob/main/docs/persistence-and-durability.md) store indexes on the filesystem, in IndexedDB, in memory, or in a backend of your own. With durability on, the engine keeps a write-ahead log with periodic checkpoints and recovers on its own after a crash. You can stream a whole index into a portable snapshot archive, or export its documents as JSON Lines to move the index across releases.
|
|
109
|
+
**Storage.** [Persistence adapters](https://github.com/assetcorp/narsil/blob/main/docs/persistence-and-durability.md) store indexes on the filesystem, in IndexedDB, in memory, or in a backend of your own. With durability on, the engine keeps a write-ahead log with periodic checkpoints and recovers on its own after a crash. You can stream a whole index into a portable snapshot archive, or export its documents as JSON Lines to move the index across releases. With [device sync](https://github.com/assetcorp/narsil/blob/main/docs/device-sync.md), a phone, a laptop, or a browser tab keeps a copy of one index from a server, which it searches and writes while it is offline.
|
|
110
110
|
|
|
111
111
|
**Scale.** The engine routes each document to a [partition](https://github.com/assetcorp/narsil/blob/main/docs/partitions-and-workers.md) by a deterministic hash. When you call `rebalance()`, the engine reshapes the partitions online and buffers incoming writes in a write-ahead queue. Once an index holds 1,000 documents, the engine serves keyword queries from worker copies on half its worker threads, while the HTTP server receives requests on the threads that hold those copies.
|
|
112
112
|
|
|
@@ -131,6 +131,8 @@ Every hit holds the document, its id, and its BM25 score. Beside the hits, `resu
|
|
|
131
131
|
| [HTTP server](https://github.com/assetcorp/narsil/blob/main/docs/http-server.md) | Wrapping an engine in a REST API, every route it serves, and long-running tasks |
|
|
132
132
|
| [Cluster mode](https://github.com/assetcorp/narsil/blob/main/docs/cluster.md) | Multi-node indexes: nodes and roles, replication, routed writes, distributed searches and reads, and the calls that fail in a cluster |
|
|
133
133
|
| [Client](https://github.com/assetcorp/narsil/blob/main/docs/client.md) | Reaching a server from a browser or Node, following a task, and the codes it raises |
|
|
134
|
+
| [Device sync](https://github.com/assetcorp/narsil/blob/main/docs/device-sync.md) | A copy of one index on a device that searches and writes offline, the sync routes, conflicts, and the snapshot |
|
|
135
|
+
| [Popular query suggestions](https://github.com/assetcorp/narsil/blob/main/docs/query-suggestions.md) | Whole searches that people ran and clicked, counted per person, built into a suggestions index, and the privacy trade-offs |
|
|
134
136
|
| [React](https://github.com/assetcorp/narsil/blob/main/docs/react.md) | The hooks over a client or an engine in the page, one shared request per key, and loading a corpus from a component |
|
|
135
137
|
| [Observability](https://github.com/assetcorp/narsil/blob/main/docs/observability.md) | Plugin hooks, engine events, and memory reporting |
|
|
136
138
|
| [Errors](https://github.com/assetcorp/narsil/blob/main/docs/errors.md) | The codes you handle most often, and the three sets that `NarsilError.code` covers |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { requireStreamLength, countedChunks } from '../chunk-
|
|
1
|
+
import { requireStreamLength, countedChunks } from '../chunk-3C7MTCCI.mjs';
|
|
2
2
|
import '../chunk-U476IXKQ.mjs';
|
|
3
3
|
import { OBJECT_STORE_PART_BYTES } from '../chunk-K5HSUPYS.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from '../chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes } from '../chunk-MP7ABPTD.mjs';
|
|
5
5
|
|
|
6
6
|
// src/persistence/filesystem.ts
|
|
7
7
|
function unfinishedSaveName(basename) {
|
package/dist/adapters/gcs.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { requireBucket, objectKeyPrefix, objectStoreFailure, requireObjectKey, requireStreamLength, countedChunks, readWhole, refuseOversizedObject, joinChunks } from '../chunk-
|
|
1
|
+
import { requireBucket, objectKeyPrefix, objectStoreFailure, requireObjectKey, requireStreamLength, countedChunks, readWhole, refuseOversizedObject, joinChunks } from '../chunk-3C7MTCCI.mjs';
|
|
2
2
|
import { MAX_FILE_BYTES } from '../chunk-U476IXKQ.mjs';
|
|
3
3
|
import { OBJECT_STORE_LIST_PAGE_KEYS, OBJECT_STORE_PART_BYTES } from '../chunk-K5HSUPYS.mjs';
|
|
4
|
-
import { ErrorCodes, NarsilError } from '../chunk-
|
|
4
|
+
import { ErrorCodes, NarsilError } from '../chunk-MP7ABPTD.mjs';
|
|
5
5
|
import { Readable } from 'stream';
|
|
6
6
|
import { pipeline } from 'stream/promises';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_INDEXEDDB_NAME, DEFAULT_INDEXEDDB_STORE_NAME, INDEXEDDB_BLOCKED_TIMEOUT_MS, MAX_PERSISTENCE_KEY_LENGTH } from '../chunk-K5HSUPYS.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from '../chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from '../chunk-MP7ABPTD.mjs';
|
|
3
3
|
|
|
4
4
|
// src/persistence/indexeddb.ts
|
|
5
5
|
function validateKey(key) {
|
package/dist/adapters/s3.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { requireBucket, objectKeyPrefix, objectStoreFailure, requireObjectKey, refuseOversizedObject, requireStreamLength, countedChunks, readWhole, partsOf } from '../chunk-
|
|
1
|
+
import { requireBucket, objectKeyPrefix, objectStoreFailure, requireObjectKey, refuseOversizedObject, requireStreamLength, countedChunks, readWhole, partsOf } from '../chunk-3C7MTCCI.mjs';
|
|
2
2
|
import '../chunk-U476IXKQ.mjs';
|
|
3
3
|
import { OBJECT_STORE_LIST_PAGE_KEYS, OBJECT_STORE_CONFLICT_ATTEMPTS, OBJECT_STORE_CONFLICT_RETRY_MS, OBJECT_STORE_PART_BYTES } from '../chunk-K5HSUPYS.mjs';
|
|
4
|
-
import { ErrorCodes, NarsilError } from '../chunk-
|
|
4
|
+
import { ErrorCodes, NarsilError } from '../chunk-MP7ABPTD.mjs';
|
|
5
5
|
|
|
6
6
|
// src/persistence/s3.ts
|
|
7
7
|
var S3_NOT_FOUND_STATUS = 404;
|
|
@@ -1,39 +1,48 @@
|
|
|
1
|
-
export { abandonAnalysisChange, adoptSavedAnalysis, buildHeldAnalysisChange, changeIndexAnalysis, dropHeldAnalysisChange, executeRebalance, heldAnalysisIsBuilt, holdsNamedSettings, releaseHeldAnalysisChange, resumeAnalysisChange, stampAnalysisGeneration } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-3HV7M5OJ.mjs';
|
|
7
|
-
import './chunk-KAKQ74LS.mjs';
|
|
1
|
+
export { abandonAnalysisChange, adoptSavedAnalysis, buildHeldAnalysisChange, changeIndexAnalysis, dropHeldAnalysisChange, executeRebalance, heldAnalysisIsBuilt, holdsNamedSettings, releaseHeldAnalysisChange, resumeAnalysisChange, stampAnalysisGeneration } from './chunk-HW5TNXBO.mjs';
|
|
2
|
+
import './chunk-KPIV4RUC.mjs';
|
|
3
|
+
import './chunk-ZYAY26KG.mjs';
|
|
4
|
+
import './chunk-KMUNHGBQ.mjs';
|
|
5
|
+
import './chunk-L7ZD4L3K.mjs';
|
|
8
6
|
import './chunk-HJSN7UYG.mjs';
|
|
9
|
-
import './chunk-
|
|
7
|
+
import './chunk-LHKOSI2J.mjs';
|
|
10
8
|
import './chunk-XIHUI4KB.mjs';
|
|
11
|
-
import './chunk-Q2UL2TPC.mjs';
|
|
12
9
|
import './chunk-3MXV3VHR.mjs';
|
|
13
10
|
import './chunk-EEBCDP36.mjs';
|
|
14
|
-
import './chunk-
|
|
11
|
+
import './chunk-Z2BE2MAM.mjs';
|
|
12
|
+
import './chunk-ZAUJFLEN.mjs';
|
|
13
|
+
import './chunk-GH4WQ22V.mjs';
|
|
14
|
+
import './chunk-3OH67G7R.mjs';
|
|
15
|
+
import './chunk-IPN7S4KX.mjs';
|
|
16
|
+
import './chunk-KAKQ74LS.mjs';
|
|
17
|
+
import './chunk-7GXJUJ24.mjs';
|
|
18
|
+
import './chunk-Q2UL2TPC.mjs';
|
|
19
|
+
import './chunk-LC3FDWTX.mjs';
|
|
20
|
+
import './chunk-JUKYYXSP.mjs';
|
|
21
|
+
import './chunk-4KRC2APY.mjs';
|
|
22
|
+
import './chunk-FQBFZAWG.mjs';
|
|
23
|
+
import './chunk-WQRN64Q6.mjs';
|
|
24
|
+
import './chunk-GES7U2PM.mjs';
|
|
25
|
+
import './chunk-I54T6CQP.mjs';
|
|
26
|
+
import './chunk-YEDIDCR7.mjs';
|
|
15
27
|
import './chunk-X5CV2E2B.mjs';
|
|
28
|
+
import './chunk-Y4WPNHMC.mjs';
|
|
29
|
+
import './chunk-RZWWB2XR.mjs';
|
|
16
30
|
import './chunk-TGP5M5R7.mjs';
|
|
31
|
+
import './chunk-4BYWRYPM.mjs';
|
|
32
|
+
import './chunk-4UMZ7KQL.mjs';
|
|
17
33
|
import './chunk-U2BKYEC7.mjs';
|
|
18
|
-
import './chunk-DGRM4EZZ.mjs';
|
|
19
34
|
import './chunk-QHPYS427.mjs';
|
|
20
35
|
import './chunk-QYRNLLLI.mjs';
|
|
36
|
+
import './chunk-HNVVEQP7.mjs';
|
|
21
37
|
import './chunk-ZXNQEW43.mjs';
|
|
38
|
+
import './chunk-L5ORED7V.mjs';
|
|
22
39
|
import './chunk-KOKM4PQN.mjs';
|
|
23
|
-
import './chunk-
|
|
24
|
-
import './chunk-LQG5G2LY.mjs';
|
|
40
|
+
import './chunk-Q7G3BV3Y.mjs';
|
|
25
41
|
import './chunk-BTPGQC6Z.mjs';
|
|
26
|
-
import './chunk-
|
|
27
|
-
import './chunk-U46IZNCW.mjs';
|
|
28
|
-
import './chunk-JUKYYXSP.mjs';
|
|
29
|
-
import './chunk-SOUZMPME.mjs';
|
|
30
|
-
import './chunk-FQBFZAWG.mjs';
|
|
31
|
-
import './chunk-65WCV5JO.mjs';
|
|
32
|
-
import './chunk-4UMZ7KQL.mjs';
|
|
42
|
+
import './chunk-LQG5G2LY.mjs';
|
|
33
43
|
import './chunk-ZXX5GZEX.mjs';
|
|
34
|
-
import './chunk-
|
|
35
|
-
import './chunk-L5ORED7V.mjs';
|
|
44
|
+
import './chunk-RFBLQLLZ.mjs';
|
|
36
45
|
import './chunk-U476IXKQ.mjs';
|
|
37
|
-
import './chunk-
|
|
46
|
+
import './chunk-MP7ABPTD.mjs';
|
|
38
47
|
import './chunk-R6A773WK.mjs';
|
|
39
48
|
import './chunk-YTJCGKM4.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { abandonChangeOf, resumeChangeOf, resumeEveryChange } from './chunk-
|
|
1
|
+
export { abandonChangeOf, resumeChangeOf, resumeEveryChange } from './chunk-DIBHI6W5.mjs';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { attachedRuntimeOf } from './chunk-S5LN746F.mjs';
|
|
2
|
+
import { historyFilesOf, listHistoryFolder, historyFileOf } from './chunk-KP7TYHWT.mjs';
|
|
3
|
+
import { QUERY_HISTORY_ARCHIVE_PREFIX } from './chunk-5YNRKI2C.mjs';
|
|
4
|
+
|
|
5
|
+
// src/query-suggestions/archive-history.ts
|
|
6
|
+
function inDayOrder(left, right) {
|
|
7
|
+
if (left.day !== right.day) return left.day < right.day ? -1 : 1;
|
|
8
|
+
return left.key < right.key ? -1 : left.key > right.key ? 1 : 0;
|
|
9
|
+
}
|
|
10
|
+
async function* historyArchiveEntries(core, indexName) {
|
|
11
|
+
const runtime = attachedRuntimeOf(core);
|
|
12
|
+
const files = runtime?.host.files ?? historyFilesOf(core.durability?.manager.historyStorage?.() ?? null);
|
|
13
|
+
await runtime?.saveDay(indexName);
|
|
14
|
+
const names = [];
|
|
15
|
+
for (const key of await listHistoryFolder(files, indexName)) {
|
|
16
|
+
const name = historyFileOf(indexName, key);
|
|
17
|
+
if (name !== null) names.push(name);
|
|
18
|
+
}
|
|
19
|
+
names.sort(inDayOrder);
|
|
20
|
+
let position = 0;
|
|
21
|
+
for (const name of names) {
|
|
22
|
+
const bytes = await files.read(name.key);
|
|
23
|
+
if (bytes === null || bytes === "too-long") continue;
|
|
24
|
+
yield { name: `${QUERY_HISTORY_ARCHIVE_PREFIX}${position}`, bytes };
|
|
25
|
+
position += 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { historyArchiveEntries };
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { requireAnalysisRebuildMemory } from './chunk-
|
|
2
|
-
import
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { requireAnalysisRebuildMemory } from './chunk-FNIFPFB7.mjs';
|
|
2
|
+
import './chunk-ELV4OZOI.mjs';
|
|
3
|
+
import { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, rewriteSpillOf, emitEngineEvent, reconstructSchemaFromMetadata, prepareStoredSynonyms, rulesOfStoredSynonyms, resolvePartialWordAnalysis, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, createPartitionIndex, REBALANCE_CHUNK_SIZE, yieldToEventLoop, prepareDocumentVectors, removeDocumentVectors, insertDocumentVectors, vectorsEqual, rebuildTextIndexes, holdSyncEpochChange, textRebuildTargetOf, extractVectorFromDoc, deleteNestedValue, ARRAY_POSITION_GAP } from './chunk-SMEQ36NT.mjs';
|
|
4
|
+
import './chunk-ML7THVLJ.mjs';
|
|
5
|
+
import './chunk-VI7BQR4U.mjs';
|
|
4
6
|
import './chunk-JPTQZWJQ.mjs';
|
|
7
|
+
import { getLanguage, resolveIndexAnalysis } from './chunk-JIJXMI42.mjs';
|
|
8
|
+
import './chunk-RA6LSBCM.mjs';
|
|
5
9
|
import './chunk-26A5JFT2.mjs';
|
|
6
10
|
import './chunk-OIZS5KIX.mjs';
|
|
7
|
-
import
|
|
11
|
+
import './chunk-4WCVMOU3.mjs';
|
|
8
12
|
import './chunk-TY7L6OXO.mjs';
|
|
9
13
|
import { ANALYSIS_CHANGE_MEMBERS, ANALYSIS_HOLD_APPLY_INTERVAL_MS } from './chunk-4RD3AFSB.mjs';
|
|
14
|
+
import { compareCodePoints } from './chunk-LFIWRCEA.mjs';
|
|
15
|
+
import './chunk-GPPOG6PT.mjs';
|
|
10
16
|
import './chunk-WXLBZJMT.mjs';
|
|
11
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
17
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
12
18
|
|
|
13
19
|
// src/engine/analysis-change/pending-target.ts
|
|
14
20
|
function configUnderAnalysis(base, language, tokenizer, stopWords) {
|
|
@@ -671,7 +677,8 @@ async function buildAndSwitch(scope) {
|
|
|
671
677
|
};
|
|
672
678
|
let partitionsRebuilt = 0;
|
|
673
679
|
let adopt = () => void 0;
|
|
674
|
-
const
|
|
680
|
+
const refusal = { byRestore: null };
|
|
681
|
+
const isCurrent = () => run.stopReason === null && refusal.byRestore === null && !core.shutdownState.isShutdown && core.indexRegistry.get(indexName) === entry && core.executor.getManager(indexName) === manager;
|
|
675
682
|
emit("started", 0);
|
|
676
683
|
const wasPromoted = core.orchestrator.desyncIndex(indexName);
|
|
677
684
|
try {
|
|
@@ -690,18 +697,27 @@ async function buildAndSwitch(scope) {
|
|
|
690
697
|
},
|
|
691
698
|
onSwitch: () => adopt(),
|
|
692
699
|
...hold === null ? {} : { holdBeforeSwitch: (keepCurrent) => waitForRelease(run, hold, keepCurrent) },
|
|
693
|
-
runSwitch(swap) {
|
|
700
|
+
async runSwitch(swap) {
|
|
694
701
|
const swapWithSynonyms = () => {
|
|
695
702
|
if (!isCurrent()) return false;
|
|
703
|
+
if (core.restoresInFlight.has(indexName)) {
|
|
704
|
+
refusal.byRestore = restoreInFlightError(indexName);
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
696
707
|
adopt = switchIndex(scope);
|
|
697
708
|
return swap();
|
|
698
709
|
};
|
|
699
|
-
|
|
710
|
+
const releaseSyncEpoch = await holdSyncEpochChange(core, indexName);
|
|
711
|
+
try {
|
|
712
|
+
return await (durable?.checkpointAfterSwitch?.(indexName, swapWithSynonyms) ?? swapWithSynonyms());
|
|
713
|
+
} finally {
|
|
714
|
+
releaseSyncEpoch();
|
|
715
|
+
}
|
|
700
716
|
}
|
|
701
717
|
},
|
|
702
718
|
textRebuildTargetOf(run.target.config, run.target.language, run.target.analysis)
|
|
703
719
|
);
|
|
704
|
-
if (!rebuilt) throw run.stopReason ?? stoppedError(core, indexName);
|
|
720
|
+
if (!rebuilt) throw run.stopReason ?? refusal.byRestore ?? stoppedError(core, indexName);
|
|
705
721
|
await spill?.removeUnread(manager);
|
|
706
722
|
if (entry.durableAnalysis !== null) {
|
|
707
723
|
throw new NarsilError(
|
|
@@ -732,6 +748,16 @@ async function clearPending(core, indexName, entry) {
|
|
|
732
748
|
entry.pendingAnalysis = null;
|
|
733
749
|
await core.durability?.manager.persistMetadata(indexName);
|
|
734
750
|
}
|
|
751
|
+
function restoreInFlightError(indexName) {
|
|
752
|
+
return new NarsilError(
|
|
753
|
+
ErrorCodes.ANALYSIS_CHANGE_REPLACED,
|
|
754
|
+
`A restore of index "${indexName}" is in flight and replaces this analysis change, so try the change again once the restore ends`,
|
|
755
|
+
{ indexName }
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
function requireNoRestoreInFlight(core, indexName) {
|
|
759
|
+
if (core.restoresInFlight.has(indexName)) throw restoreInFlightError(indexName);
|
|
760
|
+
}
|
|
735
761
|
function requireNotRebalancing(core, indexName) {
|
|
736
762
|
if (!core.rebalancingIndexes.has(indexName)) return;
|
|
737
763
|
throw new NarsilError(
|
|
@@ -749,6 +775,7 @@ async function driveRun(core, indexName, entry, run, previous, resumedGeneration
|
|
|
749
775
|
if (run.stopReason !== null) return;
|
|
750
776
|
if (core.indexRegistry.get(indexName) !== entry) throw stoppedError(core, indexName);
|
|
751
777
|
requireNotRebalancing(core, indexName);
|
|
778
|
+
requireNoRestoreInFlight(core, indexName);
|
|
752
779
|
if (resumedGeneration === null && holdsSettings(entry.config, run.target)) {
|
|
753
780
|
if (entry.pendingAnalysis !== null) await clearPending(core, indexName, entry);
|
|
754
781
|
run.finish();
|
|
@@ -769,7 +796,8 @@ async function driveRun(core, indexName, entry, run, previous, resumedGeneration
|
|
|
769
796
|
run.finish();
|
|
770
797
|
} catch (error) {
|
|
771
798
|
run.fail(error);
|
|
772
|
-
const
|
|
799
|
+
const refusedByRestore = run.stopReason === null && error instanceof NarsilError && error.code === ErrorCodes.ANALYSIS_CHANGE_REPLACED;
|
|
800
|
+
const keepsPending = !refusedByRestore && (resumedGeneration !== null || core.shutdownState.isShutdown);
|
|
773
801
|
const stillOwnsPending = runs.get(indexName) === run && run.stopReason === null;
|
|
774
802
|
if (!keepsPending && stillOwnsPending && core.indexRegistry.get(indexName) === entry) {
|
|
775
803
|
if (entry.pendingAnalysis !== null) await clearPending(core, indexName, entry).catch(() => void 0);
|
|
@@ -782,6 +810,7 @@ async function driveRun(core, indexName, entry, run, previous, resumedGeneration
|
|
|
782
810
|
async function changeIndexAnalysis(core, indexName, change) {
|
|
783
811
|
const entry = core.requireIndex(indexName);
|
|
784
812
|
requireNotRebalancing(core, indexName);
|
|
813
|
+
requireNoRestoreInFlight(core, indexName);
|
|
785
814
|
const target = resolveAnalysisTarget(indexName, entry.config, change);
|
|
786
815
|
const runs = runsOf(core);
|
|
787
816
|
const previous = runs.get(indexName);
|
package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-4MH3CZXH.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { abandonChangeOf, resumeChangeOf, resumeEveryChange } from './chunk-
|
|
1
|
+
export { abandonChangeOf, resumeChangeOf, resumeEveryChange } from './chunk-RQBUNZQW.mjs';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { historyFilesOf, listHistoryFolder, historyFileOf } from './chunk-OEDCEZXJ.mjs';
|
|
2
|
+
import { attachedRuntimeOf } from './chunk-ATEBYXP6.mjs';
|
|
3
|
+
import { QUERY_HISTORY_ARCHIVE_PREFIX } from './chunk-7IGKGWSQ.mjs';
|
|
4
|
+
|
|
5
|
+
// src/query-suggestions/archive-history.ts
|
|
6
|
+
function inDayOrder(left, right) {
|
|
7
|
+
if (left.day !== right.day) return left.day < right.day ? -1 : 1;
|
|
8
|
+
return left.key < right.key ? -1 : left.key > right.key ? 1 : 0;
|
|
9
|
+
}
|
|
10
|
+
async function* historyArchiveEntries(core, indexName) {
|
|
11
|
+
const runtime = attachedRuntimeOf(core);
|
|
12
|
+
const files = runtime?.host.files ?? historyFilesOf(core.durability?.manager.historyStorage?.() ?? null);
|
|
13
|
+
await runtime?.saveDay(indexName);
|
|
14
|
+
const names = [];
|
|
15
|
+
for (const key of await listHistoryFolder(files, indexName)) {
|
|
16
|
+
const name = historyFileOf(indexName, key);
|
|
17
|
+
if (name !== null) names.push(name);
|
|
18
|
+
}
|
|
19
|
+
names.sort(inDayOrder);
|
|
20
|
+
let position = 0;
|
|
21
|
+
for (const name of names) {
|
|
22
|
+
const bytes = await files.read(name.key);
|
|
23
|
+
if (bytes === null || bytes === "too-long") continue;
|
|
24
|
+
yield { name: `${QUERY_HISTORY_ARCHIVE_PREFIX}${position}`, bytes };
|
|
25
|
+
position += 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { historyArchiveEntries };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { fnv1a } from './chunk-RA6LSBCM.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
3
|
+
|
|
4
|
+
// src/persistence/durability/segment/layout.ts
|
|
5
|
+
var SEGMENT_ID_WIDTH = 16;
|
|
6
|
+
function manifestKey(indexName) {
|
|
7
|
+
return `${indexName}/manifest`;
|
|
8
|
+
}
|
|
9
|
+
function snapshotBundleKey(indexName) {
|
|
10
|
+
return `${indexName}/snapshot`;
|
|
11
|
+
}
|
|
12
|
+
function segmentPrefix(indexName, partitionId) {
|
|
13
|
+
return `${indexName}/segments/${partitionId}/`;
|
|
14
|
+
}
|
|
15
|
+
function segmentKey(indexName, partitionId, segmentId) {
|
|
16
|
+
return `${segmentPrefix(indexName, partitionId)}s${formatSegmentId(segmentId)}`;
|
|
17
|
+
}
|
|
18
|
+
function segmentsPrefix(indexName) {
|
|
19
|
+
return `${indexName}/segments/`;
|
|
20
|
+
}
|
|
21
|
+
function vectorFileKey(indexName, fieldPath, fileId) {
|
|
22
|
+
return `${segmentsPrefix(indexName)}vec-${encodeFieldPath(fieldPath)}-f${formatSegmentId(fileId)}`;
|
|
23
|
+
}
|
|
24
|
+
function requireGeneration(generation) {
|
|
25
|
+
if (Number.isSafeInteger(generation) && generation > 0) return;
|
|
26
|
+
throw new NarsilError(
|
|
27
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
28
|
+
`Vector graph generation ${generation} must be a positive integer`,
|
|
29
|
+
{ generation }
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function graphPartKey(indexName, fieldPath, generation, part) {
|
|
33
|
+
requireGeneration(generation);
|
|
34
|
+
return `${segmentsPrefix(indexName)}vec-${encodeFieldPath(fieldPath)}-graph-g${generation}-p${formatSegmentId(part)}`;
|
|
35
|
+
}
|
|
36
|
+
function formatSegmentId(segmentId) {
|
|
37
|
+
if (!Number.isInteger(segmentId) || segmentId < 0) {
|
|
38
|
+
throw new NarsilError(
|
|
39
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
40
|
+
`Segment id ${segmentId} must be a non-negative integer`,
|
|
41
|
+
{ segmentId }
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return segmentId.toString().padStart(SEGMENT_ID_WIDTH, "0");
|
|
45
|
+
}
|
|
46
|
+
var FIELD_PATH_PATTERN = /^[A-Za-z0-9_.]+$/;
|
|
47
|
+
function encodeFieldPath(fieldPath) {
|
|
48
|
+
if (!FIELD_PATH_PATTERN.test(fieldPath)) {
|
|
49
|
+
throw new NarsilError(
|
|
50
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
51
|
+
`Vector field path "${fieldPath}" contains characters that cannot be encoded in a segment key`,
|
|
52
|
+
{ fieldPath }
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
const fingerprint = fnv1a(fieldPath).toString(36);
|
|
56
|
+
return `${fieldPath.replace(/\./g, "_")}-${fingerprint}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/persistence/durability/segment/manifest.ts
|
|
60
|
+
var SEGMENT_MANIFEST_VERSION = 7;
|
|
61
|
+
var EARLIER_SEGMENT_MANIFEST_VERSION = 6;
|
|
62
|
+
var MANIFEST_ENVELOPE_VERSION = 2;
|
|
63
|
+
var MAX_SEGMENTS_PER_PARTITION = 65536;
|
|
64
|
+
var MAX_SEGMENT_ID = 281474976710655;
|
|
65
|
+
function manifestReferencedKeys(manifest) {
|
|
66
|
+
const keys = /* @__PURE__ */ new Set();
|
|
67
|
+
for (const partition of manifest.partitions) {
|
|
68
|
+
for (const segment of partition.segments) {
|
|
69
|
+
keys.add(segment.key);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (const vector of manifest.vectors) {
|
|
73
|
+
for (const file of vector.files) keys.add(file.key);
|
|
74
|
+
for (const part of vector.graphParts) keys.add(part.key);
|
|
75
|
+
}
|
|
76
|
+
return keys;
|
|
77
|
+
}
|
|
78
|
+
function manifestFileRefs(manifest) {
|
|
79
|
+
const refs = [];
|
|
80
|
+
for (const partition of manifest.partitions) refs.push(...partition.segments);
|
|
81
|
+
for (const vector of manifest.vectors) refs.push(...vector.files, ...vector.graphParts);
|
|
82
|
+
return refs;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { EARLIER_SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION, MAX_SEGMENTS_PER_PARTITION, MAX_SEGMENT_ID, SEGMENT_MANIFEST_VERSION, graphPartKey, manifestFileRefs, manifestKey, manifestReferencedKeys, segmentKey, segmentsPrefix, snapshotBundleKey, vectorFileKey };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { attachedRuntimeOf } from './chunk-ATEBYXP6.mjs';
|
|
2
|
+
import { emitWriteEventAfter, dropEngineIndex } from './chunk-SMEQ36NT.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
4
|
+
|
|
5
|
+
// src/query-suggestions/engine-hooks.ts
|
|
6
|
+
function suggestionIndexesOf(core, sourceName) {
|
|
7
|
+
const names = [];
|
|
8
|
+
for (const [name, entry] of core.indexRegistry) {
|
|
9
|
+
if (name !== sourceName && entry.querySuggestions?.querySuggestionsSource?.index === sourceName) names.push(name);
|
|
10
|
+
}
|
|
11
|
+
return names;
|
|
12
|
+
}
|
|
13
|
+
async function dropSuggestionIndexesOf(core, sourceName) {
|
|
14
|
+
if (core.mutationCtx.capacityScope === "partition") return;
|
|
15
|
+
for (const name of suggestionIndexesOf(core, sourceName)) {
|
|
16
|
+
if (!core.indexRegistry.has(name)) continue;
|
|
17
|
+
await emitWriteEventAfter(core, name, dropEngineIndex(core, name));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function clearLeftoversOfName(core, name) {
|
|
21
|
+
if (core.mutationCtx.capacityScope === "partition") return;
|
|
22
|
+
await dropSuggestionIndexesOf(core, name);
|
|
23
|
+
await core.durability?.manager.removeQueryHistory?.(name);
|
|
24
|
+
}
|
|
25
|
+
function hooksOf(core) {
|
|
26
|
+
return {
|
|
27
|
+
async beforeCreate(indexName) {
|
|
28
|
+
await clearLeftoversOfName(core, indexName);
|
|
29
|
+
if (core.indexRegistry.has(indexName)) {
|
|
30
|
+
throw new NarsilError(ErrorCodes.INDEX_ALREADY_EXISTS, `Index "${indexName}" already exists`, { indexName });
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
beforeDrop: (indexName) => dropSuggestionIndexesOf(core, indexName),
|
|
34
|
+
async afterDrop(indexName) {
|
|
35
|
+
await attachedRuntimeOf(core)?.onDrop(indexName);
|
|
36
|
+
},
|
|
37
|
+
async shutdown() {
|
|
38
|
+
await attachedRuntimeOf(core)?.stop().catch(() => void 0);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function installSuggestionHooks(core) {
|
|
43
|
+
core.querySuggestionHooks ??= hooksOf(core);
|
|
44
|
+
}
|
|
45
|
+
function holdsEnabledSetting(core) {
|
|
46
|
+
for (const entry of core.indexRegistry.values()) {
|
|
47
|
+
if (entry.querySuggestions?.querySuggestions?.enabled === true) return true;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
async function startQuerySuggestions(core, engine, config) {
|
|
52
|
+
installSuggestionHooks(core);
|
|
53
|
+
if (config?.querySuggestions === void 0 && !holdsEnabledSetting(core)) return;
|
|
54
|
+
try {
|
|
55
|
+
const { localRuntimeOf } = await import('./start-ZIRB7MQ2.mjs');
|
|
56
|
+
await localRuntimeOf(core, engine, config);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
await engine.shutdown().catch(() => void 0);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { clearLeftoversOfName, dropSuggestionIndexesOf, installSuggestionHooks, startQuerySuggestions };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { REBUILD_REMOVED_RATIO, BUILD_TURN_HANDOVER_AFTER_MS, DRIFT_CHECK_GROWTH_FACTOR, VECTOR_FILE_REPLACED_ABOVE_DEAD_SHARE, VECTOR_FILE_FIXED_OVERHEAD_BYTES, VECTOR_FILE_CENTROID_BYTES_PER_COMPONENT, VECTOR_FILE_STRING_HEADER_BYTES } from './chunk-3I27KXQD.mjs';
|
|
2
|
-
import { createOrdinalFilter, addToOrdinalFilter, turnsAreBudgeted, backgroundTurnIsSpent, yieldBackgroundTurn, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-
|
|
3
|
-
import { osqRecordBytes, VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes, writeRecord } from './chunk-
|
|
4
|
-
import { MAX_FILE_BYTES } from './chunk-IAXZAVYL.mjs';
|
|
2
|
+
import { createOrdinalFilter, addToOrdinalFilter, turnsAreBudgeted, backgroundTurnIsSpent, yieldBackgroundTurn, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-K4GCSZLI.mjs';
|
|
3
|
+
import { osqRecordBytes, VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes, writeRecord } from './chunk-5TCXK5SB.mjs';
|
|
5
4
|
import { MAX_DOC_ID_LENGTH } from './chunk-4RD3AFSB.mjs';
|
|
6
|
-
import {
|
|
5
|
+
import { MAX_FILE_BYTES } from './chunk-GPPOG6PT.mjs';
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
7
7
|
|
|
8
8
|
// src/vector/filter-ordinals.ts
|
|
9
9
|
var UNRESOLVED_ORDINAL = -1;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
2
|
+
|
|
3
|
+
// src/runtime/turn-budget.browser.ts
|
|
4
|
+
var turnsAreBudgeted = true;
|
|
5
|
+
var turnIsSpent = () => false;
|
|
6
|
+
var yieldTurn = () => Promise.resolve();
|
|
7
|
+
var countWrite = (write) => write();
|
|
8
|
+
var changeIndexOutsideExternalWaits = (change) => change();
|
|
9
|
+
function indexChangeOutsideExternalWaits(change) {
|
|
10
|
+
return () => changeIndexOutsideExternalWaits(change);
|
|
11
|
+
}
|
|
12
|
+
var waitOutsideCountedWrite = (wait) => wait();
|
|
13
|
+
function adoptSharedTurns(scheduler) {
|
|
14
|
+
turnIsSpent = scheduler.turnIsSpent;
|
|
15
|
+
yieldTurn = scheduler.yieldTurn;
|
|
16
|
+
countWrite = scheduler.countWrite;
|
|
17
|
+
changeIndexOutsideExternalWaits = scheduler.changeIndexOutsideExternalWaits;
|
|
18
|
+
waitOutsideCountedWrite = scheduler.waitOutsideCountedWrite;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/runtime/simd-support.ts
|
|
22
|
+
var SIMD_PROBE_MODULE = new Uint8Array([
|
|
23
|
+
0,
|
|
24
|
+
97,
|
|
25
|
+
115,
|
|
26
|
+
109,
|
|
27
|
+
1,
|
|
28
|
+
0,
|
|
29
|
+
0,
|
|
30
|
+
0,
|
|
31
|
+
1,
|
|
32
|
+
5,
|
|
33
|
+
1,
|
|
34
|
+
96,
|
|
35
|
+
0,
|
|
36
|
+
1,
|
|
37
|
+
123,
|
|
38
|
+
3,
|
|
39
|
+
2,
|
|
40
|
+
1,
|
|
41
|
+
0,
|
|
42
|
+
10,
|
|
43
|
+
10,
|
|
44
|
+
1,
|
|
45
|
+
8,
|
|
46
|
+
0,
|
|
47
|
+
65,
|
|
48
|
+
0,
|
|
49
|
+
253,
|
|
50
|
+
15,
|
|
51
|
+
253,
|
|
52
|
+
98,
|
|
53
|
+
11
|
|
54
|
+
]);
|
|
55
|
+
function runtimeStartsSimdModule() {
|
|
56
|
+
try {
|
|
57
|
+
if (typeof WebAssembly === "undefined") return false;
|
|
58
|
+
new WebAssembly.Instance(new WebAssembly.Module(SIMD_PROBE_MODULE));
|
|
59
|
+
return true;
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var simdAvailable = runtimeStartsSimdModule();
|
|
65
|
+
function isSimdAvailable() {
|
|
66
|
+
return simdAvailable;
|
|
67
|
+
}
|
|
68
|
+
function markSimdUnavailable() {
|
|
69
|
+
simdAvailable = false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/vector/osq/constants.ts
|
|
73
|
+
var OSQ_GRID = { 1: 0.798, 2: 1.493, 4: 2.514, 8: 3.922 };
|
|
74
|
+
var OSQ_STEPS = { 1: 1, 2: 3, 4: 15, 8: 255 };
|
|
75
|
+
var OSQ_QUERY_BITS = { 1: 4, 2: 4, 4: 4, 8: 8 };
|
|
76
|
+
var OSQ_PLACEMENT_QUERY_BITS = { 1: 4, 2: 4, 4: 8, 8: 8 };
|
|
77
|
+
var OSQ_LAMBDA = 0.1;
|
|
78
|
+
var OSQ_REFINE_ROUNDS = 5;
|
|
79
|
+
var OSQ_REFINE_TOLERANCE = 1e-8;
|
|
80
|
+
var MIN_OVERSAMPLE = 1;
|
|
81
|
+
|
|
82
|
+
// src/workers/thread-slot.ts
|
|
83
|
+
var goneThreadSlots = /* @__PURE__ */ new Set();
|
|
84
|
+
function threadSlotOfWorker(workerId) {
|
|
85
|
+
return workerId + 1;
|
|
86
|
+
}
|
|
87
|
+
function noteThreadSlotLive(threadSlot) {
|
|
88
|
+
goneThreadSlots.delete(threadSlot);
|
|
89
|
+
}
|
|
90
|
+
function noteThreadSlotGone(threadSlot) {
|
|
91
|
+
goneThreadSlots.add(threadSlot);
|
|
92
|
+
}
|
|
93
|
+
function threadSlotGone(threadSlot) {
|
|
94
|
+
return goneThreadSlots.has(threadSlot);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// src/core/doc-id-tables/plain.ts
|
|
98
|
+
function createDocIdMap() {
|
|
99
|
+
return /* @__PURE__ */ new Map();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/runtime/detect.ts
|
|
103
|
+
function detectRuntimeName() {
|
|
104
|
+
if ("Bun" in globalThis) {
|
|
105
|
+
return "bun";
|
|
106
|
+
}
|
|
107
|
+
if ("Deno" in globalThis) {
|
|
108
|
+
return "deno";
|
|
109
|
+
}
|
|
110
|
+
const proc = globalThis.process;
|
|
111
|
+
if (typeof proc === "object" && proc !== null && typeof proc.versions === "object" && typeof proc.versions?.node === "string") {
|
|
112
|
+
return "node";
|
|
113
|
+
}
|
|
114
|
+
return "browser";
|
|
115
|
+
}
|
|
116
|
+
function getCpuCount() {
|
|
117
|
+
const nav = globalThis.navigator;
|
|
118
|
+
if (nav && typeof nav.hardwareConcurrency === "number" && nav.hardwareConcurrency >= 1) {
|
|
119
|
+
return nav.hardwareConcurrency;
|
|
120
|
+
}
|
|
121
|
+
return 1;
|
|
122
|
+
}
|
|
123
|
+
function detectRuntime() {
|
|
124
|
+
const runtime = detectRuntimeName();
|
|
125
|
+
return {
|
|
126
|
+
runtime,
|
|
127
|
+
cpuCount: getCpuCount(),
|
|
128
|
+
supportsWorkerThreads: runtime === "node" || runtime === "bun",
|
|
129
|
+
supportsWebWorkers: runtime === "browser" || runtime === "deno" || runtime === "bun",
|
|
130
|
+
supportsFileSystem: runtime === "node" || runtime === "bun" || runtime === "deno",
|
|
131
|
+
supportsIndexedDB: runtime === "browser" || "indexedDB" in globalThis,
|
|
132
|
+
supportsBroadcastChannel: "BroadcastChannel" in globalThis
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/workers/entry-point.ts
|
|
137
|
+
var DIST_SEGMENT = "/dist/";
|
|
138
|
+
function resolveWorkerEntry(moduleUrl, sourceDirectory, distEntry) {
|
|
139
|
+
const distIndex = moduleUrl.lastIndexOf(DIST_SEGMENT);
|
|
140
|
+
const entry = distIndex !== -1 ? new URL(distEntry, moduleUrl.slice(0, distIndex + DIST_SEGMENT.length)).href : sourceDirectory.test(moduleUrl) ? moduleUrl.replace(sourceDirectory, `${DIST_SEGMENT}${distEntry}`) : null;
|
|
141
|
+
return entry === moduleUrl ? null : entry;
|
|
142
|
+
}
|
|
143
|
+
function missingWorkerEntry(moduleUrl) {
|
|
144
|
+
return new NarsilError(
|
|
145
|
+
ErrorCodes.CONFIG_INVALID,
|
|
146
|
+
`The engine finds no worker entry beside its own module at "${moduleUrl}", which happens where a bundler folds @delali/narsil into an application bundle. Keep @delali/narsil outside the bundle, or set workers.enabled to false`,
|
|
147
|
+
{ moduleUrl }
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { MIN_OVERSAMPLE, OSQ_GRID, OSQ_LAMBDA, OSQ_PLACEMENT_QUERY_BITS, OSQ_QUERY_BITS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_STEPS, adoptSharedTurns, changeIndexOutsideExternalWaits, countWrite, createDocIdMap, detectRuntime, indexChangeOutsideExternalWaits, isSimdAvailable, markSimdUnavailable, missingWorkerEntry, noteThreadSlotGone, noteThreadSlotLive, resolveWorkerEntry, threadSlotGone, threadSlotOfWorker, turnIsSpent, turnsAreBudgeted, waitOutsideCountedWrite, yieldTurn };
|