@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
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { osqCodeBytes, osqStagedQueryBytes, osqRecordBytes, unpackLevels, readTrailer, stageQueryLevels, writeRecord } from './chunk-
|
|
2
|
-
import { markSimdUnavailable, adoptSharedTurns, OSQ_STEPS,
|
|
1
|
+
import { osqCodeBytes, osqStagedQueryBytes, osqRecordBytes, unpackLevels, readTrailer, stageQueryLevels, writeRecord } from './chunk-5TCXK5SB.mjs';
|
|
2
|
+
import { markSimdUnavailable, adoptSharedTurns, OSQ_STEPS, OSQ_GRID, OSQ_QUERY_BITS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_PLACEMENT_QUERY_BITS, OSQ_LAMBDA, threadSlotGone } from './chunk-4WCVMOU3.mjs';
|
|
3
3
|
import { NATIVE_THREAD_SEARCH_SLOTS, VECTOR_SCRATCH_SLOTS, MAX_DOC_ID_TABLE_BYTES, MAX_VECTOR_ORDINALS, MAX_WASM_PAGES, WASM_PAGE_BYTES, UNPLACED_FLAG_CHUNK_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, VECTOR_BLOCK_INITIAL_SLOTS, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, GRAPH_LOCK_WAIT_SLICE_MS, GRAPH_LOCK_WAIT_DEADLINE_MS } from './chunk-TY7L6OXO.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { DEFAULT_EF_SEARCH, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, PLACEMENT_ROOM_REQUESTS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, compareCodePoints, INITIAL_UPPER_SLOTS, CONNECT_RESTARTS_BEFORE_ONE_PASS, FARTHEST_REJECTED_LINKS_KEPT, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, NEAREST_LINK_FALLBACK_HOSTS } from './chunk-LFIWRCEA.mjs';
|
|
5
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
5
6
|
|
|
6
7
|
// src/vector/shared-buffers/memory-limits.ts
|
|
7
8
|
var VECTOR_MEMORY_LIMITS = {
|
|
@@ -1917,6 +1918,7 @@ function writeKeepingLastLinks(state, ord, sorted, kept, held) {
|
|
|
1917
1918
|
|
|
1918
1919
|
// src/vector/hnsw/nearest-links.ts
|
|
1919
1920
|
var NOT_YET_FOUND = -2;
|
|
1921
|
+
var NOT_ANCHORED = -1;
|
|
1920
1922
|
function nearer(a, b) {
|
|
1921
1923
|
return nearerPair(a.distance, a.ord, b.distance, b.ord);
|
|
1922
1924
|
}
|
|
@@ -1965,7 +1967,8 @@ function replaceableSlot(pass, host, list) {
|
|
|
1965
1967
|
for (let i = 0; i < list.length; i++) {
|
|
1966
1968
|
const neighbour = list[i];
|
|
1967
1969
|
if (incomingCount(pass.state.adjacency, neighbour) < 2) continue;
|
|
1968
|
-
if (isLive(pass.state, neighbour) && nearestInList(pass, neighbour) === host)
|
|
1970
|
+
if (isLive(pass.state, neighbour) && (nearestInList(pass, neighbour) === host || pass.anchoredBy[neighbour] === host))
|
|
1971
|
+
continue;
|
|
1969
1972
|
const distance = pass.distance(host, neighbour);
|
|
1970
1973
|
if (farthest === -1 || nearerPair(farthestDistance, farthestOrd, distance, neighbour)) {
|
|
1971
1974
|
farthest = i;
|
|
@@ -1980,12 +1983,16 @@ function linkFrom(pass, host, ord) {
|
|
|
1980
1983
|
const base = layerBase(adjacency, host, 0);
|
|
1981
1984
|
if (base === ABSENT) return false;
|
|
1982
1985
|
const list = adjacency.level0.subarray(base + 1, base + 1 + adjacency.level0[base]);
|
|
1983
|
-
if (list.includes(ord))
|
|
1986
|
+
if (list.includes(ord)) {
|
|
1987
|
+
pass.anchoredBy[ord] = host;
|
|
1988
|
+
return true;
|
|
1989
|
+
}
|
|
1984
1990
|
if (list.length < pass.state.Mmax0) {
|
|
1985
1991
|
adjacency.level0[base + list.length + 1] = ord;
|
|
1986
1992
|
adjacency.level0[base] = list.length + 1;
|
|
1987
1993
|
noteLinked(adjacency, ord);
|
|
1988
1994
|
pass.nearest[host] = NOT_YET_FOUND;
|
|
1995
|
+
pass.anchoredBy[ord] = host;
|
|
1989
1996
|
return true;
|
|
1990
1997
|
}
|
|
1991
1998
|
const slot = replaceableSlot(pass, host, list);
|
|
@@ -1995,6 +2002,7 @@ function linkFrom(pass, host, ord) {
|
|
|
1995
2002
|
noteUnlinked(adjacency, replaced);
|
|
1996
2003
|
noteLinked(adjacency, ord);
|
|
1997
2004
|
pass.nearest[host] = NOT_YET_FOUND;
|
|
2005
|
+
pass.anchoredBy[ord] = host;
|
|
1998
2006
|
return true;
|
|
1999
2007
|
}
|
|
2000
2008
|
function linkFromNearest(state) {
|
|
@@ -2007,7 +2015,8 @@ function* linkFromNearestSteps(state, pace) {
|
|
|
2007
2015
|
const pass = {
|
|
2008
2016
|
state,
|
|
2009
2017
|
distance: nodeDistanceFunction(state, state.buildMetric),
|
|
2010
|
-
nearest: new Int32Array(slots).fill(NOT_YET_FOUND)
|
|
2018
|
+
nearest: new Int32Array(slots).fill(NOT_YET_FOUND),
|
|
2019
|
+
anchoredBy: new Int32Array(slots).fill(NOT_ANCHORED)
|
|
2011
2020
|
};
|
|
2012
2021
|
for (let ord = 0; ord < slots; ord++) {
|
|
2013
2022
|
if (stepTaken(pace)) yield;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { restoredConfigFields, restoredEmbedding } from './chunk-EXQZGUQH.mjs';
|
|
2
|
+
import { chunksOf } from './chunk-DSXIBE6N.mjs';
|
|
3
|
+
import { untagDocumentLine } from './chunk-ABCXENU5.mjs';
|
|
4
|
+
import { flattenSchema, requireConfigurationShape } from './chunk-JIJXMI42.mjs';
|
|
5
|
+
import { turnsAreBudgeted, turnIsSpent, yieldTurn } from './chunk-4WCVMOU3.mjs';
|
|
5
6
|
import { MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, MAX_IMPORT_REFUSALS_REPORTED } from './chunk-4RD3AFSB.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
7
8
|
|
|
8
9
|
// src/engine/export/lines.ts
|
|
9
10
|
var NEWLINE = 10;
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { MAX_MIN_PEOPLE, MIN_MIN_PEOPLE, DEFAULT_MIN_PEOPLE, MAX_MIN_RESULTS, MIN_MIN_RESULTS, DEFAULT_MIN_RESULTS, MAX_RETENTION_DAYS, MIN_RETENTION_DAYS, DEFAULT_RETENTION_DAYS, MAX_MAX_PHRASES_PER_DAY, DEFAULT_MAX_PHRASES_PER_DAY, MAX_MAX_PHRASES_PER_PERSON, DEFAULT_MAX_PHRASES_PER_PERSON, MAX_MAX_PEOPLE_PER_DAY, DEFAULT_MAX_PEOPLE_PER_DAY, MAX_MAX_GROUPS, DEFAULT_MAX_GROUPS, MAX_MAX_LENGTH, DEFAULT_MAX_LENGTH, DEFAULT_MIN_LETTERS, MAX_MAX_WORDS, DEFAULT_MAX_WORDS, DEFAULT_MAX_DIGITS, MAX_MAX_MERGE_PHRASES, DEFAULT_MAX_MERGE_PHRASES, MAX_MERGE_MEMORY_BYTES, MIN_MERGE_MEMORY_BYTES, DEFAULT_MERGE_MEMORY_BYTES, MAX_SAVE_INTERVAL_MS, MIN_SAVE_INTERVAL_MS, DEFAULT_SAVE_INTERVAL_MS, MAX_RESULT_CHECKS_PER_SECOND, DEFAULT_RESULT_CHECKS_PER_SECOND, MAX_GROUP_LENGTH, MAX_PERSON_UTF16_UNITS, MAX_SCHEDULE_LENGTH, SCHEDULE_LOOKAHEAD_DAYS, DEFAULT_TIME_ZONE, DEFAULT_SCHEDULE, MAX_FIELDS, SCHEDULE_OFF, MAX_SETTING_BYTES, MAX_SOURCE_INDEX_NAME_LENGTH, RAW_PHRASE_UTF16_UNITS_PER_CODE_POINT, MAX_PERSON_PAIRS_PER_DAY, MAX_FILE_PEOPLE_PER_DAY, MAX_MERGE_PEOPLE, DAY_MS } from './chunk-7IGKGWSQ.mjs';
|
|
2
|
+
import { flattenSchema } from './chunk-JIJXMI42.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
4
|
+
import { encode } from '@msgpack/msgpack';
|
|
5
|
+
|
|
6
|
+
// src/query-suggestions/phrase.ts
|
|
7
|
+
var APOSTROPHE_VARIANTS = /[\u2018\u2019\u02bc]/g;
|
|
8
|
+
var HYPHEN_VARIANTS = /[\u2010\u2011]/g;
|
|
9
|
+
var WHITE_SPACE_RUNS = /\p{White_Space}+/gu;
|
|
10
|
+
var ALLOWED_PHRASE = /^[\p{L}\p{M}\p{Nd} '-]+$/u;
|
|
11
|
+
var LETTER = /\p{L}/gu;
|
|
12
|
+
var DIGIT = /\p{Nd}/gu;
|
|
13
|
+
var GROUP_PATTERN = new RegExp(`^[A-Za-z0-9][A-Za-z0-9_-]{0,${MAX_GROUP_LENGTH - 1}}$`);
|
|
14
|
+
var GROUP_FORMAT = `1 to ${MAX_GROUP_LENGTH} letters, digits, "_", and "-"`;
|
|
15
|
+
function countMatches(text, pattern) {
|
|
16
|
+
pattern.lastIndex = 0;
|
|
17
|
+
let count = 0;
|
|
18
|
+
while (pattern.exec(text) !== null) count++;
|
|
19
|
+
return count;
|
|
20
|
+
}
|
|
21
|
+
function codePointCount(text, stopAfter) {
|
|
22
|
+
let count = 0;
|
|
23
|
+
for (const _ of text) {
|
|
24
|
+
count++;
|
|
25
|
+
if (count > stopAfter) break;
|
|
26
|
+
}
|
|
27
|
+
return count;
|
|
28
|
+
}
|
|
29
|
+
function normalisePhrase(raw, maxLength) {
|
|
30
|
+
if (raw.length === 0 || raw.length > maxLength * RAW_PHRASE_UTF16_UNITS_PER_CODE_POINT) return null;
|
|
31
|
+
return raw.normalize("NFKC").toLowerCase().replace(APOSTROPHE_VARIANTS, "'").replace(HYPHEN_VARIANTS, "-").replace(WHITE_SPACE_RUNS, " ").trim();
|
|
32
|
+
}
|
|
33
|
+
function phraseFits(phrase, limits) {
|
|
34
|
+
if (phrase.length === 0 || phrase.length > limits.maxLength * 2) return false;
|
|
35
|
+
if (phrase !== phrase.trim() || phrase.includes(" ")) return false;
|
|
36
|
+
if (!ALLOWED_PHRASE.test(phrase)) return false;
|
|
37
|
+
if (codePointCount(phrase, limits.maxLength) > limits.maxLength) return false;
|
|
38
|
+
if (phrase.split(" ").length > limits.maxWords) return false;
|
|
39
|
+
if (countMatches(phrase, DIGIT) > limits.maxDigits) return false;
|
|
40
|
+
return countMatches(phrase, LETTER) >= limits.minLetters;
|
|
41
|
+
}
|
|
42
|
+
function isNormalPhrase(phrase, limits) {
|
|
43
|
+
return phraseFits(phrase, limits) && normalisePhrase(phrase, limits.maxLength) === phrase;
|
|
44
|
+
}
|
|
45
|
+
function acceptedPhrase(raw, limits) {
|
|
46
|
+
const phrase = normalisePhrase(raw, limits.maxLength);
|
|
47
|
+
if (phrase === null || !phraseFits(phrase, limits)) return null;
|
|
48
|
+
return phrase;
|
|
49
|
+
}
|
|
50
|
+
function isGroup(value) {
|
|
51
|
+
return typeof value === "string" && GROUP_PATTERN.test(value);
|
|
52
|
+
}
|
|
53
|
+
function isPerson(value) {
|
|
54
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_PERSON_UTF16_UNITS;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/query-suggestions/schedule.ts
|
|
58
|
+
var FIELD_RANGES = [
|
|
59
|
+
{ min: 0, max: 59 },
|
|
60
|
+
{ min: 0, max: 23 },
|
|
61
|
+
{ min: 1, max: 31 },
|
|
62
|
+
{ min: 1, max: 12 },
|
|
63
|
+
{ min: 0, max: 6 }
|
|
64
|
+
];
|
|
65
|
+
var NUMBER = /^\d{1,2}$/;
|
|
66
|
+
function parseNumber(text, range) {
|
|
67
|
+
if (!NUMBER.test(text)) return null;
|
|
68
|
+
const value = Number(text);
|
|
69
|
+
return value >= range.min && value <= range.max ? value : null;
|
|
70
|
+
}
|
|
71
|
+
function parseField(text, range) {
|
|
72
|
+
const allowed = new Array(range.max + 1).fill(false);
|
|
73
|
+
for (const part of text.split(",")) {
|
|
74
|
+
const [base, stepText, ...extra] = part.split("/");
|
|
75
|
+
if (base === void 0 || extra.length > 0) return null;
|
|
76
|
+
let step = 1;
|
|
77
|
+
if (stepText !== void 0) {
|
|
78
|
+
if (!NUMBER.test(stepText) || Number(stepText) < 1) return null;
|
|
79
|
+
step = Number(stepText);
|
|
80
|
+
}
|
|
81
|
+
let start;
|
|
82
|
+
let end;
|
|
83
|
+
if (base === "*") {
|
|
84
|
+
start = range.min;
|
|
85
|
+
end = range.max;
|
|
86
|
+
} else {
|
|
87
|
+
const bounds = base.split("-");
|
|
88
|
+
if (bounds.length > 2) return null;
|
|
89
|
+
const first = parseNumber(bounds[0] ?? "", range);
|
|
90
|
+
if (first === null) return null;
|
|
91
|
+
start = first;
|
|
92
|
+
if (bounds.length === 2) {
|
|
93
|
+
const last = parseNumber(bounds[1] ?? "", range);
|
|
94
|
+
if (last === null || last < first) return null;
|
|
95
|
+
end = last;
|
|
96
|
+
} else end = stepText === void 0 ? first : range.max;
|
|
97
|
+
}
|
|
98
|
+
for (let value = start; value <= end; value += step) allowed[value] = true;
|
|
99
|
+
}
|
|
100
|
+
return allowed;
|
|
101
|
+
}
|
|
102
|
+
function parseSchedule(expression) {
|
|
103
|
+
if (expression.length > MAX_SCHEDULE_LENGTH) return null;
|
|
104
|
+
const fields = expression.trim().split(/\s+/);
|
|
105
|
+
if (fields.length !== FIELD_RANGES.length) return null;
|
|
106
|
+
const parsed = [];
|
|
107
|
+
for (let i = 0; i < fields.length; i++) {
|
|
108
|
+
const field = parseField(fields[i] ?? "", FIELD_RANGES[i]);
|
|
109
|
+
if (field === null) return null;
|
|
110
|
+
parsed.push(field);
|
|
111
|
+
}
|
|
112
|
+
const [minutes, hours, daysOfMonth, months, daysOfWeek] = parsed;
|
|
113
|
+
return {
|
|
114
|
+
minutes,
|
|
115
|
+
hours,
|
|
116
|
+
daysOfMonth,
|
|
117
|
+
months,
|
|
118
|
+
daysOfWeek,
|
|
119
|
+
dayOfMonthAny: fields[2] === "*",
|
|
120
|
+
dayOfWeekAny: fields[4] === "*"
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var formatters = /* @__PURE__ */ new Map();
|
|
124
|
+
function formatterOf(timeZone) {
|
|
125
|
+
let formatter = formatters.get(timeZone);
|
|
126
|
+
if (formatter === void 0) {
|
|
127
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
128
|
+
timeZone,
|
|
129
|
+
hourCycle: "h23",
|
|
130
|
+
year: "numeric",
|
|
131
|
+
month: "numeric",
|
|
132
|
+
day: "numeric",
|
|
133
|
+
hour: "numeric",
|
|
134
|
+
minute: "numeric"
|
|
135
|
+
});
|
|
136
|
+
formatters.set(timeZone, formatter);
|
|
137
|
+
}
|
|
138
|
+
return formatter;
|
|
139
|
+
}
|
|
140
|
+
function wallTimeAt(instant, timeZone) {
|
|
141
|
+
const parts = {};
|
|
142
|
+
for (const part of formatterOf(timeZone).formatToParts(instant)) {
|
|
143
|
+
if (part.type !== "literal") parts[part.type] = Number(part.value);
|
|
144
|
+
}
|
|
145
|
+
return { year: parts.year, month: parts.month, day: parts.day, hour: parts.hour, minute: parts.minute };
|
|
146
|
+
}
|
|
147
|
+
function wallAsUtc(wall) {
|
|
148
|
+
return Date.UTC(wall.year, wall.month - 1, wall.day, wall.hour, wall.minute);
|
|
149
|
+
}
|
|
150
|
+
function instantOf(wall, timeZone) {
|
|
151
|
+
const target = wallAsUtc(wall);
|
|
152
|
+
let guess = target;
|
|
153
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
154
|
+
const offset = wallAsUtc(wallTimeAt(guess, timeZone)) - guess;
|
|
155
|
+
guess = target - offset;
|
|
156
|
+
}
|
|
157
|
+
const landed = wallTimeAt(guess, timeZone);
|
|
158
|
+
return wallAsUtc(landed) === target ? guess : null;
|
|
159
|
+
}
|
|
160
|
+
function dayMatches(schedule, dayStartUtc) {
|
|
161
|
+
const date = new Date(dayStartUtc);
|
|
162
|
+
if (!schedule.months[date.getUTCMonth() + 1]) return false;
|
|
163
|
+
const monthDay = schedule.daysOfMonth[date.getUTCDate()] === true;
|
|
164
|
+
const weekDay = schedule.daysOfWeek[date.getUTCDay()] === true;
|
|
165
|
+
if (!schedule.dayOfMonthAny && !schedule.dayOfWeekAny) return monthDay || weekDay;
|
|
166
|
+
return monthDay && weekDay;
|
|
167
|
+
}
|
|
168
|
+
function matchesOfDay(schedule, dayStartUtc, timeZone) {
|
|
169
|
+
const date = new Date(dayStartUtc);
|
|
170
|
+
const instants = [];
|
|
171
|
+
for (let hour = 0; hour < 24; hour++) {
|
|
172
|
+
if (!schedule.hours[hour]) continue;
|
|
173
|
+
for (let minute = 0; minute < 60; minute++) {
|
|
174
|
+
if (!schedule.minutes[minute]) continue;
|
|
175
|
+
const wall = { year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate(), hour, minute };
|
|
176
|
+
const instant = instantOf(wall, timeZone);
|
|
177
|
+
if (instant !== null) instants.push(instant);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return instants;
|
|
181
|
+
}
|
|
182
|
+
function localDayStart(instant, timeZone) {
|
|
183
|
+
const wall = wallTimeAt(instant, timeZone);
|
|
184
|
+
return Date.UTC(wall.year, wall.month - 1, wall.day);
|
|
185
|
+
}
|
|
186
|
+
function nextMatchAfter(schedule, timeZone, after) {
|
|
187
|
+
const firstDay = localDayStart(after, timeZone);
|
|
188
|
+
for (let day = 0; day <= SCHEDULE_LOOKAHEAD_DAYS; day++) {
|
|
189
|
+
const dayStart = firstDay + day * DAY_MS;
|
|
190
|
+
if (!dayMatches(schedule, dayStart)) continue;
|
|
191
|
+
for (const instant of matchesOfDay(schedule, dayStart, timeZone)) {
|
|
192
|
+
if (instant > after) return instant;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
function latestMatchAtOrBefore(schedule, timeZone, at) {
|
|
198
|
+
const firstDay = localDayStart(at, timeZone);
|
|
199
|
+
for (let day = 0; day <= SCHEDULE_LOOKAHEAD_DAYS; day++) {
|
|
200
|
+
const dayStart = firstDay - day * DAY_MS;
|
|
201
|
+
if (!dayMatches(schedule, dayStart)) continue;
|
|
202
|
+
const instants = matchesOfDay(schedule, dayStart, timeZone);
|
|
203
|
+
for (let i = instants.length - 1; i >= 0; i--) {
|
|
204
|
+
if (instants[i] <= at) return instants[i];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// src/query-suggestions/setting.ts
|
|
211
|
+
var RANGES = [
|
|
212
|
+
{
|
|
213
|
+
key: "minPeople",
|
|
214
|
+
wire: "min_people",
|
|
215
|
+
fallback: DEFAULT_MIN_PEOPLE,
|
|
216
|
+
min: MIN_MIN_PEOPLE,
|
|
217
|
+
max: MAX_MIN_PEOPLE
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
key: "minResults",
|
|
221
|
+
wire: "min_results",
|
|
222
|
+
fallback: DEFAULT_MIN_RESULTS,
|
|
223
|
+
min: MIN_MIN_RESULTS,
|
|
224
|
+
max: MAX_MIN_RESULTS
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
key: "retentionDays",
|
|
228
|
+
wire: "retention_days",
|
|
229
|
+
fallback: DEFAULT_RETENTION_DAYS,
|
|
230
|
+
min: MIN_RETENTION_DAYS,
|
|
231
|
+
max: MAX_RETENTION_DAYS
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: "maxPhrasesPerDay",
|
|
235
|
+
wire: "max_phrases_per_day",
|
|
236
|
+
fallback: DEFAULT_MAX_PHRASES_PER_DAY,
|
|
237
|
+
min: 1,
|
|
238
|
+
max: MAX_MAX_PHRASES_PER_DAY
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
key: "maxPhrasesPerPerson",
|
|
242
|
+
wire: "max_phrases_per_person",
|
|
243
|
+
fallback: DEFAULT_MAX_PHRASES_PER_PERSON,
|
|
244
|
+
min: 1,
|
|
245
|
+
max: MAX_MAX_PHRASES_PER_PERSON
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: "maxPeoplePerDay",
|
|
249
|
+
wire: "max_people_per_day",
|
|
250
|
+
fallback: DEFAULT_MAX_PEOPLE_PER_DAY,
|
|
251
|
+
min: 1,
|
|
252
|
+
max: MAX_MAX_PEOPLE_PER_DAY
|
|
253
|
+
},
|
|
254
|
+
{ key: "maxGroups", wire: "max_groups", fallback: DEFAULT_MAX_GROUPS, min: 1, max: MAX_MAX_GROUPS },
|
|
255
|
+
{ key: "maxLength", wire: "max_length", fallback: DEFAULT_MAX_LENGTH, min: 1, max: MAX_MAX_LENGTH },
|
|
256
|
+
{ key: "minLetters", wire: "min_letters", fallback: DEFAULT_MIN_LETTERS, min: 1, max: "maxLength" },
|
|
257
|
+
{ key: "maxWords", wire: "max_words", fallback: DEFAULT_MAX_WORDS, min: 1, max: MAX_MAX_WORDS },
|
|
258
|
+
{ key: "maxDigits", wire: "max_digits", fallback: DEFAULT_MAX_DIGITS, min: 0, max: "maxLength" },
|
|
259
|
+
{
|
|
260
|
+
key: "maxMergePhrases",
|
|
261
|
+
wire: "max_merge_phrases",
|
|
262
|
+
fallback: DEFAULT_MAX_MERGE_PHRASES,
|
|
263
|
+
min: 1,
|
|
264
|
+
max: MAX_MAX_MERGE_PHRASES
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
key: "mergeMemoryBytes",
|
|
268
|
+
wire: "merge_memory_bytes",
|
|
269
|
+
fallback: DEFAULT_MERGE_MEMORY_BYTES,
|
|
270
|
+
min: MIN_MERGE_MEMORY_BYTES,
|
|
271
|
+
max: MAX_MERGE_MEMORY_BYTES
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
key: "saveIntervalMs",
|
|
275
|
+
wire: "save_interval_ms",
|
|
276
|
+
fallback: DEFAULT_SAVE_INTERVAL_MS,
|
|
277
|
+
min: MIN_SAVE_INTERVAL_MS,
|
|
278
|
+
max: MAX_SAVE_INTERVAL_MS
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
key: "resultChecksPerSecond",
|
|
282
|
+
wire: "result_checks_per_second",
|
|
283
|
+
fallback: DEFAULT_RESULT_CHECKS_PER_SECOND,
|
|
284
|
+
min: 1,
|
|
285
|
+
max: MAX_RESULT_CHECKS_PER_SECOND
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
var SETTING_KEYS = /* @__PURE__ */ new Set(["enabled", "fields", "schedule", "timeZone", ...RANGES.map((range) => range.key)]);
|
|
289
|
+
function invalidSetting(message, details = {}) {
|
|
290
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, message, details);
|
|
291
|
+
}
|
|
292
|
+
function isWholeNumber(value) {
|
|
293
|
+
return typeof value === "number" && Number.isSafeInteger(value);
|
|
294
|
+
}
|
|
295
|
+
function knowsTimeZone(timeZone) {
|
|
296
|
+
try {
|
|
297
|
+
new Intl.DateTimeFormat("en-US", { timeZone });
|
|
298
|
+
return true;
|
|
299
|
+
} catch {
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function resolveSetting(setting) {
|
|
304
|
+
const resolved = {
|
|
305
|
+
enabled: setting.enabled,
|
|
306
|
+
fields: [...setting.fields],
|
|
307
|
+
schedule: setting.schedule ?? DEFAULT_SCHEDULE,
|
|
308
|
+
timeZone: setting.timeZone ?? DEFAULT_TIME_ZONE
|
|
309
|
+
};
|
|
310
|
+
for (const range of RANGES) resolved[range.key] = setting[range.key] ?? range.fallback;
|
|
311
|
+
return resolved;
|
|
312
|
+
}
|
|
313
|
+
function requireProducts(resolved) {
|
|
314
|
+
if (resolved.maxPeoplePerDay * resolved.maxPhrasesPerPerson > MAX_PERSON_PAIRS_PER_DAY) {
|
|
315
|
+
invalidSetting(`maxPeoplePerDay times maxPhrasesPerPerson must stay at or below ${MAX_PERSON_PAIRS_PER_DAY}`);
|
|
316
|
+
}
|
|
317
|
+
if (resolved.maxPhrasesPerDay * resolved.minPeople > MAX_FILE_PEOPLE_PER_DAY) {
|
|
318
|
+
invalidSetting(`maxPhrasesPerDay times minPeople must stay at or below ${MAX_FILE_PEOPLE_PER_DAY}`);
|
|
319
|
+
}
|
|
320
|
+
if (resolved.maxMergePhrases * resolved.minPeople > MAX_MERGE_PEOPLE) {
|
|
321
|
+
invalidSetting(`maxMergePhrases times minPeople must stay at or below ${MAX_MERGE_PEOPLE}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function validateSetting(raw) {
|
|
325
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
326
|
+
invalidSetting("The query suggestions setting must be an object");
|
|
327
|
+
}
|
|
328
|
+
const input = raw;
|
|
329
|
+
for (const key of Object.keys(input)) {
|
|
330
|
+
if (!SETTING_KEYS.has(key)) invalidSetting(`The query suggestions setting holds an unknown key "${key}"`, { key });
|
|
331
|
+
}
|
|
332
|
+
if (typeof input.enabled !== "boolean") invalidSetting('The query suggestions setting needs a boolean "enabled"');
|
|
333
|
+
const fields = input.fields;
|
|
334
|
+
if (!Array.isArray(fields) || fields.length === 0 || fields.length > MAX_FIELDS) {
|
|
335
|
+
invalidSetting(`The query suggestions setting needs from 1 to ${MAX_FIELDS} fields`);
|
|
336
|
+
}
|
|
337
|
+
const seen = /* @__PURE__ */ new Set();
|
|
338
|
+
for (const field of fields) {
|
|
339
|
+
if (typeof field !== "string" || field.length === 0 || seen.has(field)) {
|
|
340
|
+
invalidSetting("Each field of the query suggestions setting must be a distinct, non-empty path");
|
|
341
|
+
}
|
|
342
|
+
seen.add(field);
|
|
343
|
+
}
|
|
344
|
+
const setting = { enabled: input.enabled, fields: [...seen] };
|
|
345
|
+
for (const range of RANGES) {
|
|
346
|
+
const value = input[range.key];
|
|
347
|
+
if (value === void 0) continue;
|
|
348
|
+
if (!isWholeNumber(value)) invalidSetting(`${range.key} must be a whole number`, { key: range.key });
|
|
349
|
+
setting[range.key] = value;
|
|
350
|
+
}
|
|
351
|
+
const resolved = resolveSetting(setting);
|
|
352
|
+
for (const range of RANGES) {
|
|
353
|
+
const value = resolved[range.key];
|
|
354
|
+
const max = typeof range.max === "number" ? range.max : resolved[range.max];
|
|
355
|
+
if (value < range.min || value > max) {
|
|
356
|
+
invalidSetting(`${range.key} must be from ${range.min} to ${max}`, { key: range.key, value });
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
requireProducts(resolved);
|
|
360
|
+
if (input.schedule !== void 0) {
|
|
361
|
+
if (typeof input.schedule !== "string") invalidSetting("schedule must be a string");
|
|
362
|
+
if (input.schedule !== SCHEDULE_OFF && parseSchedule(input.schedule) === null) {
|
|
363
|
+
invalidSetting('schedule must be "off" or a cron expression of five fields', { schedule: input.schedule });
|
|
364
|
+
}
|
|
365
|
+
setting.schedule = input.schedule;
|
|
366
|
+
}
|
|
367
|
+
if (input.timeZone !== void 0) {
|
|
368
|
+
if (typeof input.timeZone !== "string" || !knowsTimeZone(input.timeZone)) {
|
|
369
|
+
invalidSetting("timeZone must name an IANA time zone", { timeZone: String(input.timeZone) });
|
|
370
|
+
}
|
|
371
|
+
setting.timeZone = input.timeZone;
|
|
372
|
+
}
|
|
373
|
+
if (encode(settingToWire(setting)).byteLength > MAX_SETTING_BYTES) {
|
|
374
|
+
invalidSetting(`The query suggestions setting must encode to at most ${MAX_SETTING_BYTES} bytes`);
|
|
375
|
+
}
|
|
376
|
+
return setting;
|
|
377
|
+
}
|
|
378
|
+
function requireFieldsInSchema(setting, schema) {
|
|
379
|
+
const flat = flattenSchema(schema);
|
|
380
|
+
for (const field of setting.fields) {
|
|
381
|
+
const type = flat[field];
|
|
382
|
+
if (type !== "string" && type !== "string[]") {
|
|
383
|
+
invalidSetting(`Field "${field}" must be a string or string[] field of the schema`, { field });
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function settingToWire(setting) {
|
|
388
|
+
const wire = { enabled: setting.enabled, fields: [...setting.fields] };
|
|
389
|
+
for (const range of RANGES) {
|
|
390
|
+
const value = setting[range.key];
|
|
391
|
+
if (value !== void 0) wire[range.wire] = value;
|
|
392
|
+
}
|
|
393
|
+
if (setting.schedule !== void 0) wire.schedule = setting.schedule;
|
|
394
|
+
if (setting.timeZone !== void 0) wire.time_zone = setting.timeZone;
|
|
395
|
+
return wire;
|
|
396
|
+
}
|
|
397
|
+
function settingFromWire(raw) {
|
|
398
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
399
|
+
invalidSetting("The stored query suggestions setting is not a map");
|
|
400
|
+
}
|
|
401
|
+
const wire = raw;
|
|
402
|
+
const camel = {};
|
|
403
|
+
const byWire = new Map([
|
|
404
|
+
["enabled", "enabled"],
|
|
405
|
+
["fields", "fields"],
|
|
406
|
+
["schedule", "schedule"],
|
|
407
|
+
["time_zone", "timeZone"],
|
|
408
|
+
...RANGES.map((range) => [range.wire, range.key])
|
|
409
|
+
]);
|
|
410
|
+
for (const [key, value] of Object.entries(wire)) {
|
|
411
|
+
const camelKey = byWire.get(key);
|
|
412
|
+
if (camelKey === void 0) invalidSetting(`The stored query suggestions setting holds an unknown key "${key}"`);
|
|
413
|
+
camel[camelKey] = value;
|
|
414
|
+
}
|
|
415
|
+
return validateSetting(camel);
|
|
416
|
+
}
|
|
417
|
+
function validateSource(raw) {
|
|
418
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
419
|
+
invalidSetting("The suggestions index marker must be a map");
|
|
420
|
+
}
|
|
421
|
+
const { index, group, ...rest } = raw;
|
|
422
|
+
if (Object.keys(rest).length > 0) invalidSetting("The suggestions index marker holds an unknown key");
|
|
423
|
+
if (typeof index !== "string" || index.length === 0 || index.length > MAX_SOURCE_INDEX_NAME_LENGTH) {
|
|
424
|
+
invalidSetting("The suggestions index marker needs the name of its source index");
|
|
425
|
+
}
|
|
426
|
+
if (!isGroup(group)) {
|
|
427
|
+
invalidSetting("The suggestions index marker needs a valid group");
|
|
428
|
+
}
|
|
429
|
+
return { index, group };
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export { GROUP_FORMAT, acceptedPhrase, invalidSetting, isGroup, isNormalPhrase, isPerson, latestMatchAtOrBefore, nextMatchAfter, parseSchedule, requireFieldsInSchema, resolveSetting, settingFromWire, settingToWire, validateSetting, validateSource };
|
|
@@ -1,82 +1,3 @@
|
|
|
1
|
-
import { NarsilError, ErrorCodes } from './chunk-PIS7ZAP7.mjs';
|
|
2
|
-
|
|
3
|
-
// src/serialization/constants.ts
|
|
4
|
-
var CHECKSUM_YIELD_CHUNK_BYTES = 4 * 1024 * 1024;
|
|
5
|
-
var NATIVE_CRC32_MIN_BYTES = 16;
|
|
6
|
-
var MAX_FILE_BYTES = 2147483647;
|
|
7
|
-
var MAX_DOCUMENT_ENCODING_DEPTH = 100;
|
|
8
|
-
var DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES = 1048576;
|
|
9
|
-
var VALID_HNSW_METRICS = /* @__PURE__ */ new Set(["cosine", "dotProduct", "euclidean"]);
|
|
10
|
-
|
|
11
|
-
// src/runtime/turn-budget.browser.ts
|
|
12
|
-
var turnsAreBudgeted = true;
|
|
13
|
-
var turnIsSpent = () => false;
|
|
14
|
-
var yieldTurn = () => Promise.resolve();
|
|
15
|
-
var countWrite = (write) => write();
|
|
16
|
-
var changeIndexOutsideExternalWaits = (change) => change();
|
|
17
|
-
function indexChangeOutsideExternalWaits(change) {
|
|
18
|
-
return () => changeIndexOutsideExternalWaits(change);
|
|
19
|
-
}
|
|
20
|
-
var waitOutsideCountedWrite = (wait) => wait();
|
|
21
|
-
function adoptSharedTurns(scheduler) {
|
|
22
|
-
turnIsSpent = scheduler.turnIsSpent;
|
|
23
|
-
yieldTurn = scheduler.yieldTurn;
|
|
24
|
-
countWrite = scheduler.countWrite;
|
|
25
|
-
changeIndexOutsideExternalWaits = scheduler.changeIndexOutsideExternalWaits;
|
|
26
|
-
waitOutsideCountedWrite = scheduler.waitOutsideCountedWrite;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// src/runtime/simd-support.ts
|
|
30
|
-
var SIMD_PROBE_MODULE = new Uint8Array([
|
|
31
|
-
0,
|
|
32
|
-
97,
|
|
33
|
-
115,
|
|
34
|
-
109,
|
|
35
|
-
1,
|
|
36
|
-
0,
|
|
37
|
-
0,
|
|
38
|
-
0,
|
|
39
|
-
1,
|
|
40
|
-
5,
|
|
41
|
-
1,
|
|
42
|
-
96,
|
|
43
|
-
0,
|
|
44
|
-
1,
|
|
45
|
-
123,
|
|
46
|
-
3,
|
|
47
|
-
2,
|
|
48
|
-
1,
|
|
49
|
-
0,
|
|
50
|
-
10,
|
|
51
|
-
10,
|
|
52
|
-
1,
|
|
53
|
-
8,
|
|
54
|
-
0,
|
|
55
|
-
65,
|
|
56
|
-
0,
|
|
57
|
-
253,
|
|
58
|
-
15,
|
|
59
|
-
253,
|
|
60
|
-
98,
|
|
61
|
-
11
|
|
62
|
-
]);
|
|
63
|
-
function runtimeStartsSimdModule() {
|
|
64
|
-
try {
|
|
65
|
-
if (typeof WebAssembly === "undefined") return false;
|
|
66
|
-
new WebAssembly.Instance(new WebAssembly.Module(SIMD_PROBE_MODULE));
|
|
67
|
-
return true;
|
|
68
|
-
} catch {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
var simdAvailable = runtimeStartsSimdModule();
|
|
73
|
-
function isSimdAvailable() {
|
|
74
|
-
return simdAvailable;
|
|
75
|
-
}
|
|
76
|
-
function markSimdUnavailable() {
|
|
77
|
-
simdAvailable = false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
1
|
// src/core/ordering/code-points.ts
|
|
81
2
|
function exceedsCodePoints(value, maximum) {
|
|
82
3
|
if (value.length <= maximum) return false;
|
|
@@ -371,83 +292,4 @@ var NEAREST_LINK_FALLBACK_HOSTS = 4;
|
|
|
371
292
|
var CONNECT_STEPS_BETWEEN_CLOCK_CHECKS = 256;
|
|
372
293
|
var CONNECT_RESTARTS_BEFORE_ONE_PASS = 8;
|
|
373
294
|
|
|
374
|
-
|
|
375
|
-
var OSQ_GRID = { 1: 0.798, 2: 1.493, 4: 2.514, 8: 3.922 };
|
|
376
|
-
var OSQ_STEPS = { 1: 1, 2: 3, 4: 15, 8: 255 };
|
|
377
|
-
var OSQ_QUERY_BITS = { 1: 4, 2: 4, 4: 4, 8: 8 };
|
|
378
|
-
var OSQ_PLACEMENT_QUERY_BITS = { 1: 4, 2: 4, 4: 8, 8: 8 };
|
|
379
|
-
var OSQ_LAMBDA = 0.1;
|
|
380
|
-
var OSQ_REFINE_ROUNDS = 5;
|
|
381
|
-
var OSQ_REFINE_TOLERANCE = 1e-8;
|
|
382
|
-
var MIN_OVERSAMPLE = 1;
|
|
383
|
-
|
|
384
|
-
// src/workers/thread-slot.ts
|
|
385
|
-
var goneThreadSlots = /* @__PURE__ */ new Set();
|
|
386
|
-
function threadSlotOfWorker(workerId) {
|
|
387
|
-
return workerId + 1;
|
|
388
|
-
}
|
|
389
|
-
function noteThreadSlotLive(threadSlot) {
|
|
390
|
-
goneThreadSlots.delete(threadSlot);
|
|
391
|
-
}
|
|
392
|
-
function noteThreadSlotGone(threadSlot) {
|
|
393
|
-
goneThreadSlots.add(threadSlot);
|
|
394
|
-
}
|
|
395
|
-
function threadSlotGone(threadSlot) {
|
|
396
|
-
return goneThreadSlots.has(threadSlot);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// src/core/doc-id-tables/plain.ts
|
|
400
|
-
function createDocIdMap() {
|
|
401
|
-
return /* @__PURE__ */ new Map();
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// src/runtime/detect.ts
|
|
405
|
-
function detectRuntimeName() {
|
|
406
|
-
if ("Bun" in globalThis) {
|
|
407
|
-
return "bun";
|
|
408
|
-
}
|
|
409
|
-
if ("Deno" in globalThis) {
|
|
410
|
-
return "deno";
|
|
411
|
-
}
|
|
412
|
-
const proc = globalThis.process;
|
|
413
|
-
if (typeof proc === "object" && proc !== null && typeof proc.versions === "object" && typeof proc.versions?.node === "string") {
|
|
414
|
-
return "node";
|
|
415
|
-
}
|
|
416
|
-
return "browser";
|
|
417
|
-
}
|
|
418
|
-
function getCpuCount() {
|
|
419
|
-
const nav = globalThis.navigator;
|
|
420
|
-
if (nav && typeof nav.hardwareConcurrency === "number" && nav.hardwareConcurrency >= 1) {
|
|
421
|
-
return nav.hardwareConcurrency;
|
|
422
|
-
}
|
|
423
|
-
return 1;
|
|
424
|
-
}
|
|
425
|
-
function detectRuntime() {
|
|
426
|
-
const runtime = detectRuntimeName();
|
|
427
|
-
return {
|
|
428
|
-
runtime,
|
|
429
|
-
cpuCount: getCpuCount(),
|
|
430
|
-
supportsWorkerThreads: runtime === "node" || runtime === "bun",
|
|
431
|
-
supportsWebWorkers: runtime === "browser" || runtime === "deno" || runtime === "bun",
|
|
432
|
-
supportsFileSystem: runtime === "node" || runtime === "bun" || runtime === "deno",
|
|
433
|
-
supportsIndexedDB: runtime === "browser" || "indexedDB" in globalThis,
|
|
434
|
-
supportsBroadcastChannel: "BroadcastChannel" in globalThis
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// src/workers/entry-point.ts
|
|
439
|
-
var DIST_SEGMENT = "/dist/";
|
|
440
|
-
function resolveWorkerEntry(moduleUrl, sourceDirectory, distEntry) {
|
|
441
|
-
const distIndex = moduleUrl.lastIndexOf(DIST_SEGMENT);
|
|
442
|
-
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;
|
|
443
|
-
return entry === moduleUrl ? null : entry;
|
|
444
|
-
}
|
|
445
|
-
function missingWorkerEntry(moduleUrl) {
|
|
446
|
-
return new NarsilError(
|
|
447
|
-
ErrorCodes.CONFIG_INVALID,
|
|
448
|
-
`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`,
|
|
449
|
-
{ moduleUrl }
|
|
450
|
-
);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
export { CHECKSUM_YIELD_CHUNK_BYTES, COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_EF_SEARCH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, EARLIER_RELEASE_MIN_M, FARTHEST_REJECTED_LINKS_KEPT, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_DOCUMENT_ENCODING_DEPTH, MAX_FILE_BYTES, MAX_LAYER_CAP, MAX_M, MIN_M, MIN_OVERSAMPLE, NATIVE_CRC32_MIN_BYTES, NEAREST_LINK_FALLBACK_HOSTS, OSQ_GRID, OSQ_LAMBDA, OSQ_PLACEMENT_QUERY_BITS, OSQ_QUERY_BITS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, OSQ_STEPS, PLACEMENT_ROOM_REQUESTS, SORT_MODES, SORT_VALUE_MAX_CODE_POINTS, VALID_HNSW_METRICS, adoptSharedTurns, appendFoldedCodePoint, changeIndexOutsideExternalWaits, codePointCount, compareCodePoints, compareComparableKeys, compareComparableValues, compareSortValues, countWrite, createDocIdMap, defaultSortMode, detectRuntime, exceedsCodePoints, holdsUnpairedSurrogate, indexChangeOutsideExternalWaits, isSimdAvailable, isSortMode, markSimdUnavailable, missingWorkerEntry, noteThreadSlotGone, noteThreadSlotLive, readSortField, resolveWorkerEntry, singleFoldTable, sortModeOf, threadSlotGone, threadSlotOfWorker, toComparableSortValue, toReducedSortValue, truncateSortString, turnIsSpent, turnsAreBudgeted, waitOutsideCountedWrite, yieldTurn };
|
|
295
|
+
export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_EF_SEARCH, EARLIER_RELEASE_MIN_M, FARTHEST_REJECTED_LINKS_KEPT, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, MIN_M, NEAREST_LINK_FALLBACK_HOSTS, PLACEMENT_ROOM_REQUESTS, SORT_MODES, SORT_VALUE_MAX_CODE_POINTS, appendFoldedCodePoint, codePointCount, compareCodePoints, compareComparableKeys, compareComparableValues, compareSortValues, defaultSortMode, exceedsCodePoints, holdsUnpairedSurrogate, isSortMode, readSortField, singleFoldTable, sortModeOf, toComparableSortValue, toReducedSortValue, truncateSortString };
|