nolo-cli 0.108.0-alpha.1 → 0.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{_executeModel-GTYLDSJW.js → _executeModel-RVAKYU4J.js} +128 -83
- package/action-RHUT4OHH.js +23 -0
- package/{addContentAction-MB2HHMDZ.js → addContentAction-BQ3LJLUW.js} +19 -13
- package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-B6X7BXR4.js} +24 -20
- package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-T5MDAOE7.js} +154 -67
- package/{agentEmailCommands-C6J2KUL2.js → agentEmailCommands-UWBQSKLI.js} +125 -104
- package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
- package/agentListCommands-2Q456VYS.js +800 -0
- package/{agentMachineCommands-UDEXV472.js → agentMachineCommands-FPJJ4DCF.js} +54 -57
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-7PCGR77I.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-7GCDM4BK.js} +7 -7
- package/agentRecordCommands-3JGDR4NN.js +149 -0
- package/agentRunCommand-3NQOP3SD.js +179 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-2CDZNHXV.js} +10 -2
- package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-SQUDRZWE.js} +42 -46
- package/{agentSlice-TNH7BSUC.js → agentSlice-R4W6MCEW.js} +22 -16
- package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-CLLYGEBC.js} +55 -55
- package/{appDeployCommands-UTB76XFM.js → appDeployCommands-HY2NBNDQ.js} +64 -59
- package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-SGO5GEXH.js} +53 -52
- package/{appGetCommands-PX2BFHOB.js → appGetCommands-ZPYK2N5D.js} +53 -52
- package/{appListCommands-BSMPTWKC.js → appListCommands-O2BHIMKS.js} +54 -55
- package/{authCommand-YW42YZA4.js → authCommand-GUIREPHK.js} +213 -72
- package/{authCommands-RGOGCPP6.js → authCommands-K3BDSTJ4.js} +10 -7
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MUOUTRNJ.js} +13 -10
- package/{chromeCommands-FZYAU75D.js → chromeCommands-Z2WRJB7O.js} +290 -38
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-YWYXZTIR.js} +157 -23
- package/{chunk-RRPWH4LX.js → chunk-26UZ2Y4Z.js} +26 -31
- package/{chunk-2F7RJC6L.js → chunk-2C47W7IJ.js} +1 -1
- package/{chunk-VLTIYV3X.js → chunk-2ECUZDEL.js} +37 -11
- package/{chunk-ALXHV7NK.js → chunk-2GGXHQIW.js} +43 -4
- package/{chunk-AHAHBQMU.js → chunk-2OMUAIKR.js} +2 -2
- package/{chunk-DHDMC6FO.js → chunk-3CZM6HGQ.js} +53 -23
- package/{chunk-BNGW5ASC.js → chunk-3LI5UCTU.js} +23 -3
- package/{chunk-FDTR4QJ6.js → chunk-3MZAGMYY.js} +48 -1
- package/chunk-3PVYUPXK.js +40 -0
- package/chunk-3SK3J3IF.js +929 -0
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-V7E4PXQD.js → chunk-4MSYSHZD.js} +15 -7
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-MP64VFGD.js → chunk-4XEYAFLY.js} +60 -18
- package/chunk-4YRTZIVN.js +871 -0
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-N7J63Q6C.js → chunk-56GBUMO5.js} +10 -1
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-XT35TTFG.js → chunk-5WLADF62.js} +90 -36
- package/chunk-5XN3OSCT.js +164 -0
- package/chunk-6CCAXGFK.js +1712 -0
- package/{chunk-42V6BK2E.js → chunk-6MXDOUMH.js} +18 -36
- package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
- package/{chunk-J4MOO56S.js → chunk-6VRWNU5J.js} +10 -2
- package/{chunk-GEPUP7OO.js → chunk-726TCFLQ.js} +5 -5
- package/chunk-7DPNBQSV.js +9 -0
- package/chunk-7YVPCIEN.js +1858 -0
- package/{chunk-AEOE4Z6Q.js → chunk-A337PRRR.js} +41 -17
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-ABQYVJBJ.js → chunk-AIZE5TDM.js} +3 -3
- package/{chunk-GPCZ7UXG.js → chunk-ALKCVCA5.js} +4 -4
- package/{chunk-5UTFL4QJ.js → chunk-APO5TOXO.js} +1 -1
- package/{chunk-E4MARS3Q.js → chunk-AU7AXHUL.js} +1 -1
- package/{chunk-PBA4UJBK.js → chunk-BFYDNHYW.js} +12 -12
- package/{chunk-QTGQ2LTL.js → chunk-BIAETTOB.js} +5 -9
- package/{chunk-OIVSQH2O.js → chunk-CGEK73JN.js} +311 -12
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/chunk-DGDGNYI5.js +593 -0
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-PVZT43MU.js → chunk-EXR4XCFE.js} +17 -15
- package/chunk-EYLGAEB4.js +784 -0
- package/{chunk-3BMYXEUW.js → chunk-F2UJW3EK.js} +1 -1
- package/{chunk-P5EVSOPA.js → chunk-FWY6BHIJ.js} +363 -248
- package/{chunk-4MK3I7Y4.js → chunk-G23MQWLJ.js} +7 -128
- package/chunk-G6OOUQWJ.js +417 -0
- package/{chunk-WV42OMV7.js → chunk-GHZ2H2HJ.js} +11 -15
- package/chunk-GMZLP5DV.js +82 -0
- package/chunk-I42VC5KR.js +15 -0
- package/{chunk-GO3Z72MT.js → chunk-IFALJPEX.js} +71 -99
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-UKWGR5SS.js → chunk-IJERIUXS.js} +242 -1146
- package/chunk-IRG4OKY6.js +843 -0
- package/{chunk-TYYSADX4.js → chunk-IUTHWIZQ.js} +269 -141
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/chunk-JJM3WS6W.js +132 -0
- package/{chunk-R7RHOSZU.js → chunk-KN6MKCS5.js} +1733 -465
- package/{chunk-SH43IESU.js → chunk-KQ7DAEZ7.js} +202 -32
- package/{chunk-6OZ36FXI.js → chunk-KY6GPQ7O.js} +36 -12
- package/{chunk-MRIHM22T.js → chunk-LAVSW2C2.js} +77 -144
- package/{chunk-NA35QHCF.js → chunk-LNEKN523.js} +10 -7
- package/chunk-LWLNLZC5.js +265 -0
- package/{chunk-I3TQJXQ7.js → chunk-MHD5JBSS.js} +131 -10
- package/{chunk-KQ4ONNQD.js → chunk-MW533QT3.js} +190 -8
- package/{chunk-62CATUYY.js → chunk-NLEJWKF5.js} +10532 -9444
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-NN4UUYGB.js} +18 -4
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/chunk-OKARGYFT.js +15 -0
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-53HEEOTT.js → chunk-OYBAT7RT.js} +113 -17
- package/chunk-P3SFAHIL.js +134 -0
- package/{chunk-7U6P3PHS.js → chunk-P6KLYCL3.js} +310 -95
- package/{chunk-XD2MJFUG.js → chunk-PBGO5AFD.js} +1 -1
- package/{chunk-EYAQT56M.js → chunk-PFEK4SA2.js} +13 -10
- package/{chunk-Z77CRGTW.js → chunk-PHHFVGOJ.js} +1 -1
- package/{chunk-3VNWWVKB.js → chunk-PJNFNEJE.js} +114 -28
- package/{chunk-RRM7AJ3M.js → chunk-PS6XSDHW.js} +35 -30
- package/{chunk-HVURBGF3.js → chunk-PWRS2SU2.js} +27 -9
- package/chunk-QFEW2ULV.js +42 -0
- package/chunk-QH2QSBGP.js +7546 -0
- package/{chunk-IIVGDG4I.js → chunk-QLQ573SU.js} +124 -77
- package/chunk-QQ56R7KS.js +88 -0
- package/chunk-QYPE3TS3.js +43 -0
- package/{chunk-VMFTFOWF.js → chunk-RLRYVSCD.js} +31 -14
- package/{chunk-VRTTFDBM.js → chunk-RNNWTMKT.js} +56 -63
- package/chunk-ROXFUKKL.js +13941 -0
- package/{chunk-DUK4OQNO.js → chunk-RRPT5CGT.js} +124 -703
- package/{chunk-JRQFUXY7.js → chunk-RRQQAG7W.js} +93 -24
- package/chunk-SJ3QFSQS.js +1147 -0
- package/chunk-SP4WCECG.js +95 -0
- package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-UZGQNTVW.js → chunk-TSBCYK5F.js} +10 -8
- package/chunk-TY3TIUJK.js +89 -0
- package/chunk-U4STABYN.js +81 -0
- package/chunk-UEILX4EV.js +15 -0
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/{chunk-EEGDMATE.js → chunk-UPFOOGHU.js} +90 -79
- package/{chunk-7S4YWN7P.js → chunk-V2UPLOXT.js} +4 -4
- package/{chunk-PQFHGD77.js → chunk-V5DCOM6G.js} +185 -16
- package/{chunk-LS2ZANRJ.js → chunk-V6WXGTUJ.js} +1 -1
- package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
- package/{chunk-DVINR3PL.js → chunk-VEA7H5FG.js} +3 -3
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
- package/{chunk-HKNXJGEC.js → chunk-VSPO4S33.js} +47 -192
- package/{chunk-ETI2NYVF.js → chunk-W2N3ZC4P.js} +7 -7
- package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
- package/{chunk-6Z7MY3V7.js → chunk-WCQNEMXG.js} +3 -3
- package/chunk-WJZOQR2J.js +151 -0
- package/{chunk-L7OXGGBN.js → chunk-WVES4PHL.js} +69 -57
- package/{chunk-BFDFRLLQ.js → chunk-WW2USJ3C.js} +3 -3
- package/{chunk-QWL5QZGU.js → chunk-X2VPXJZC.js} +20 -11
- package/chunk-X5BIY654.js +29 -0
- package/{chunk-Q554LLSI.js → chunk-XETG4RIX.js} +5 -5
- package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
- package/{chunk-JEDZAO7L.js → chunk-YBNHPX4S.js} +257 -37
- package/{chunk-JPGCXHNM.js → chunk-YLMMECCH.js} +1 -1
- package/{chunk-CSC3CU4K.js → chunk-YSZQSZR2.js} +61 -11
- package/{chunk-6D6VBVEW.js → chunk-YVTZMLXZ.js} +96 -25
- package/{chunk-AG2AZ6GX.js → chunk-YZZLKXCQ.js} +1449 -1094
- package/chunk-ZRAU6T47.js +56 -0
- package/{chunk-ONXOABJR.js → chunk-ZWQUWF6W.js} +36 -1
- package/{cliExecutor-HG3S345O.js → cliExecutor-AWYR3T33.js} +1 -1
- package/commandRegistry-C25O2ARU.js +839 -0
- package/contentThunks-UWODFKX6.js +83 -0
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-JFKTYS2D.js} +2 -2
- package/{createAgentAutomationAction-OBH7GPW5.js → createAgentAutomationAction-SA4IA4CR.js} +51 -43
- package/createDialogAction-EDK5IMRG.js +75 -0
- package/{createPageAction-JJ7UUTWC.js → createPageAction-VYVF5EIZ.js} +60 -51
- package/{chunk-BVGTK7MR.js → cursorProvider-YGGNMVWX.js} +2751 -10185
- package/{dbSlice-A6C6H32X.js → dbSlice-JQFBMJ55.js} +18 -12
- package/{deleteFile-YG6QMJLU.js → deleteFile-6JWDDRVP.js} +9 -5
- package/dialogCommands-K734RXEQ.js +108 -0
- package/{dialogSlice-6Z2BPC3T.js → dialogSlice-EEDP6PJ3.js} +66 -41
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-N3KPGP4A.js} +51 -53
- package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-4CR4TXZ7.js} +53 -54
- package/{docReadCommands-WJN3WT6O.js → docReadCommands-62XK57VS.js} +50 -52
- package/{docStore-7WUS6XXX.js → docStore-RB7YBD4Y.js} +24 -15
- package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-DRAAWIDC.js} +51 -53
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-LM6OMMQQ.js} +5 -4
- package/{getPricing-LUSEABA6.js → getPricing-XDF4OLTC.js} +6 -6
- package/handleSendMessageAction-TYDPIC6O.js +1849 -0
- package/index.js +91 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-BOETO2TD.js} +2 -2
- package/localRuntimeAdapter-VYB2QTU3.js +239 -0
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-YSE6NH7B.js} +12 -9
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-7FBKDEQY.js} +1 -1
- package/{machineCommands-KSN4COGR.js → machineCommands-IQRRLSYP.js} +493 -151
- package/machineWsRunDispatch-LIMM5CYE.js +164 -0
- package/{memberThunks-P2ECUJ56.js → memberThunks-Y3Q7GZTG.js} +24 -17
- package/{models-T3SG6MJ5.js → models-6V4ZCHEE.js} +2 -2
- package/node_modules/abstract-level/CHANGELOG.md +150 -0
- package/node_modules/abstract-level/LICENSE +21 -0
- package/node_modules/abstract-level/README.md +1957 -0
- package/node_modules/abstract-level/UPGRADING.md +669 -0
- package/node_modules/abstract-level/abstract-chained-batch.js +397 -0
- package/node_modules/abstract-level/abstract-iterator.js +404 -0
- package/node_modules/abstract-level/abstract-level.js +1127 -0
- package/node_modules/abstract-level/abstract-snapshot.js +84 -0
- package/node_modules/abstract-level/index.d.ts +52 -0
- package/node_modules/abstract-level/index.js +9 -0
- package/node_modules/abstract-level/lib/abstract-sublevel-iterator.js +141 -0
- package/node_modules/abstract-level/lib/abstract-sublevel.js +290 -0
- package/node_modules/abstract-level/lib/common.js +33 -0
- package/node_modules/abstract-level/lib/default-chained-batch.js +29 -0
- package/node_modules/abstract-level/lib/default-kv-iterator.js +74 -0
- package/node_modules/abstract-level/lib/deferred-iterator.js +110 -0
- package/node_modules/abstract-level/lib/deferred-queue.js +84 -0
- package/node_modules/abstract-level/lib/errors.js +21 -0
- package/node_modules/abstract-level/lib/event-monitor.js +30 -0
- package/node_modules/abstract-level/lib/hooks.js +78 -0
- package/node_modules/abstract-level/lib/prefixes.js +21 -0
- package/node_modules/abstract-level/lib/prewrite-batch.js +96 -0
- package/node_modules/abstract-level/lib/range-options.js +26 -0
- package/node_modules/abstract-level/package.json +66 -0
- package/node_modules/abstract-level/test/async-iterator-test.js +132 -0
- package/node_modules/abstract-level/test/batch-test.js +214 -0
- package/node_modules/abstract-level/test/chained-batch-test.js +315 -0
- package/node_modules/abstract-level/test/clear-range-test.js +262 -0
- package/node_modules/abstract-level/test/clear-test.js +110 -0
- package/node_modules/abstract-level/test/common.js +90 -0
- package/node_modules/abstract-level/test/deferred-open-test.js +209 -0
- package/node_modules/abstract-level/test/del-test.js +65 -0
- package/node_modules/abstract-level/test/encoding-buffer-test.js +336 -0
- package/node_modules/abstract-level/test/encoding-custom-test.js +92 -0
- package/node_modules/abstract-level/test/encoding-decode-error-test.js +85 -0
- package/node_modules/abstract-level/test/encoding-json-test.js +75 -0
- package/node_modules/abstract-level/test/encoding-test.js +130 -0
- package/node_modules/abstract-level/test/events/write.js +132 -0
- package/node_modules/abstract-level/test/factory-test.js +36 -0
- package/node_modules/abstract-level/test/get-many-test.js +157 -0
- package/node_modules/abstract-level/test/get-sync-test.js +61 -0
- package/node_modules/abstract-level/test/get-test.js +83 -0
- package/node_modules/abstract-level/test/has-many-test.js +144 -0
- package/node_modules/abstract-level/test/has-test.js +81 -0
- package/node_modules/abstract-level/test/hooks/newsub.js +57 -0
- package/node_modules/abstract-level/test/hooks/postopen.js +229 -0
- package/node_modules/abstract-level/test/hooks/prewrite.js +816 -0
- package/node_modules/abstract-level/test/hooks/shared.js +38 -0
- package/node_modules/abstract-level/test/index.js +86 -0
- package/node_modules/abstract-level/test/iterator-explicit-snapshot-test.js +393 -0
- package/node_modules/abstract-level/test/iterator-no-snapshot-test.js +49 -0
- package/node_modules/abstract-level/test/iterator-range-test.js +277 -0
- package/node_modules/abstract-level/test/iterator-seek-test.js +335 -0
- package/node_modules/abstract-level/test/iterator-snapshot-test.js +56 -0
- package/node_modules/abstract-level/test/iterator-test.js +621 -0
- package/node_modules/abstract-level/test/manifest-test.js +21 -0
- package/node_modules/abstract-level/test/open-create-if-missing-test.js +39 -0
- package/node_modules/abstract-level/test/open-error-if-exists-test.js +25 -0
- package/node_modules/abstract-level/test/open-test.js +263 -0
- package/node_modules/abstract-level/test/put-get-del-test.js +97 -0
- package/node_modules/abstract-level/test/put-test.js +70 -0
- package/node_modules/abstract-level/test/self/abstract-iterator-test.js +182 -0
- package/node_modules/abstract-level/test/self/async-iterator-test.js +242 -0
- package/node_modules/abstract-level/test/self/attach-resource-test.js +74 -0
- package/node_modules/abstract-level/test/self/defer-test.js +140 -0
- package/node_modules/abstract-level/test/self/deferred-iterator-test.js +314 -0
- package/node_modules/abstract-level/test/self/deferred-operations-test.js +86 -0
- package/node_modules/abstract-level/test/self/deferred-queue-test.js +93 -0
- package/node_modules/abstract-level/test/self/encoding-test.js +391 -0
- package/node_modules/abstract-level/test/self/errors-test.js +11 -0
- package/node_modules/abstract-level/test/self/iterator-test.js +1050 -0
- package/node_modules/abstract-level/test/self/sublevel-test.js +1039 -0
- package/node_modules/abstract-level/test/self.js +905 -0
- package/node_modules/abstract-level/test/sublevel-test.js +209 -0
- package/node_modules/abstract-level/test/traits/closed.js +42 -0
- package/node_modules/abstract-level/test/traits/index.js +4 -0
- package/node_modules/abstract-level/test/traits/open.js +62 -0
- package/node_modules/abstract-level/test/util.js +275 -0
- package/node_modules/abstract-level/types/abstract-chained-batch.d.ts +124 -0
- package/node_modules/abstract-level/types/abstract-iterator.d.ts +241 -0
- package/node_modules/abstract-level/types/abstract-level.d.ts +636 -0
- package/node_modules/abstract-level/types/abstract-snapshot.d.ts +30 -0
- package/node_modules/abstract-level/types/abstract-sublevel.d.ts +76 -0
- package/node_modules/abstract-level/types/interfaces.d.ts +43 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/browser-level/CHANGELOG.md +44 -0
- package/node_modules/browser-level/LICENSE +21 -0
- package/node_modules/browser-level/README.md +124 -0
- package/node_modules/browser-level/UPGRADING.md +143 -0
- package/node_modules/browser-level/index.d.ts +108 -0
- package/node_modules/browser-level/index.js +323 -0
- package/node_modules/browser-level/iterator.js +239 -0
- package/node_modules/browser-level/package.json +48 -0
- package/node_modules/browser-level/util/clear.js +38 -0
- package/node_modules/browser-level/util/deserialize.js +17 -0
- package/node_modules/browser-level/util/key-range.js +20 -0
- package/node_modules/buffer/AUTHORS.md +73 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +194 -0
- package/node_modules/buffer/index.js +2106 -0
- package/node_modules/buffer/package.json +93 -0
- package/node_modules/classic-level/CHANGELOG.md +115 -0
- package/node_modules/classic-level/LICENSE +21 -0
- package/node_modules/classic-level/README.md +274 -0
- package/node_modules/classic-level/UPGRADING.md +131 -0
- package/node_modules/classic-level/binding.cc +2652 -0
- package/node_modules/classic-level/binding.gyp +71 -0
- package/node_modules/classic-level/binding.js +1 -0
- package/node_modules/classic-level/chained-batch.js +35 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/LICENSE +27 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/Makefile +424 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/build_detect_platform +256 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/autocompact_test.cc +118 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/builder.cc +88 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/builder.h +34 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/c.cc +595 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/c_test.c +390 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/corruption_test.cc +374 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_bench.cc +1020 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_impl.cc +1568 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_impl.h +212 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_iter.cc +317 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_iter.h +28 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_test.cc +2158 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dbformat.cc +140 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dbformat.h +230 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dbformat_test.cc +112 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dumpfile.cc +225 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/fault_injection_test.cc +554 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/filename.cc +144 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/filename.h +85 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/filename_test.cc +123 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/leveldbutil.cc +64 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_format.h +35 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_reader.cc +284 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_reader.h +113 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_test.cc +591 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_writer.cc +112 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_writer.h +54 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/memtable.cc +145 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/memtable.h +89 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/recovery_test.cc +324 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/repair.cc +461 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/skiplist.h +384 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/skiplist_test.cc +378 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/snapshot.h +67 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/table_cache.cc +127 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/table_cache.h +61 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_edit.cc +266 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_edit.h +107 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_edit_test.cc +46 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_set.cc +1535 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_set.h +399 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_set_test.cc +179 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/write_batch.cc +147 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/write_batch_internal.h +50 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/write_batch_test.cc +120 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/helpers/memenv/memenv.cc +398 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/helpers/memenv/memenv.h +20 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/helpers/memenv/memenv_test.cc +241 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/c.h +290 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/cache.h +110 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/comparator.h +63 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/db.h +164 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/dumpfile.h +25 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/env.h +351 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/filter_policy.h +70 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/iterator.h +100 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/options.h +213 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/slice.h +109 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/status.h +112 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/table.h +85 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/table_builder.h +92 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/value_sink.h +26 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/write_batch.h +64 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/issues/issue178_test.cc +92 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/issues/issue200_test.cc +59 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/atomic_pointer.h +242 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port.h +21 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_example.h +141 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_posix.cc +53 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_posix.h +156 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_posix_sse.cc +129 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/thread_annotations.h +60 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/win/stdint.h +24 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block.cc +268 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block.h +44 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block_builder.cc +109 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block_builder.h +57 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/filter_block.cc +111 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/filter_block.h +68 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/filter_block_test.cc +128 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/format.cc +144 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/format.h +108 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/iterator.cc +67 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/iterator_wrapper.h +66 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/merger.cc +197 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/merger.h +26 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/table.cc +285 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/table_builder.cc +270 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/table_test.cc +876 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/two_level_iterator.cc +182 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/two_level_iterator.h +34 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/arena.cc +68 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/arena.h +68 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/arena_test.cc +68 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/bloom.cc +95 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/bloom_test.cc +162 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/cache.cc +405 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/cache_test.cc +226 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/coding.cc +194 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/coding.h +104 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/coding_test.cc +196 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/comparator.cc +81 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/crc32c.cc +350 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/crc32c.h +45 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/crc32c_test.cc +72 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env.cc +100 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_posix.cc +695 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_posix_test.cc +66 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_posix_test_helper.h +28 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_test.cc +106 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/filter_policy.cc +11 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/hash.cc +52 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/hash.h +19 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/hash_test.cc +54 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/histogram.cc +139 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/histogram.h +42 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/logging.cc +72 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/logging.h +43 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/mutexlock.h +41 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/options.cc +30 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/posix_logger.h +98 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/random.h +64 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/status.cc +75 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testharness.cc +77 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testharness.h +138 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testutil.cc +51 -0
- package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testutil.h +63 -0
- package/node_modules/classic-level/deps/leveldb/leveldb.gyp +282 -0
- package/node_modules/classic-level/deps/leveldb/patches/001-value-sink.patch +164 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/atomic_pointer_win.h +48 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/env_win.cc +692 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/port_uv.cc +36 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/port_uv.h +157 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/port_uv.h.bak +153 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/stdint-msvc2008.h +247 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/uv_condvar.h +45 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/uv_condvar_posix.cc +139 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/win_logger.cc +79 -0
- package/node_modules/classic-level/deps/leveldb/port-libuv/win_logger.h +28 -0
- package/node_modules/classic-level/deps/snappy/freebsd/config.h +135 -0
- package/node_modules/classic-level/deps/snappy/freebsd/snappy-stubs-public.h +100 -0
- package/node_modules/classic-level/deps/snappy/linux/config.h +135 -0
- package/node_modules/classic-level/deps/snappy/linux/snappy-stubs-public.h +100 -0
- package/node_modules/classic-level/deps/snappy/mac/config.h +137 -0
- package/node_modules/classic-level/deps/snappy/mac/snappy-stubs-public.h +100 -0
- package/node_modules/classic-level/deps/snappy/openbsd/config.h +135 -0
- package/node_modules/classic-level/deps/snappy/openbsd/snappy-stubs-public.h +100 -0
- package/node_modules/classic-level/deps/snappy/snappy/COPYING +54 -0
- package/node_modules/classic-level/deps/snappy/snappy/cmake/SnappyConfig.cmake +1 -0
- package/node_modules/classic-level/deps/snappy/snappy/cmake/config.h.in +62 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-c.cc +90 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-c.h +138 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-internal.h +224 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-sinksource.cc +104 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-sinksource.h +182 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-stubs-internal.cc +42 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-stubs-internal.h +561 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-stubs-public.h.in +94 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-test.cc +612 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy-test.h +573 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy.cc +1515 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy.h +203 -0
- package/node_modules/classic-level/deps/snappy/snappy/snappy_unittest.cc +1410 -0
- package/node_modules/classic-level/deps/snappy/snappy.gyp +119 -0
- package/node_modules/classic-level/deps/snappy/solaris/config.h +135 -0
- package/node_modules/classic-level/deps/snappy/solaris/snappy-stubs-public.h +100 -0
- package/node_modules/classic-level/deps/snappy/win32/config.h +29 -0
- package/node_modules/classic-level/deps/snappy/win32/snappy-stubs-public.h +100 -0
- package/node_modules/classic-level/index.d.ts +343 -0
- package/node_modules/classic-level/index.js +311 -0
- package/node_modules/classic-level/iterator.js +122 -0
- package/node_modules/classic-level/package.json +70 -0
- package/node_modules/classic-level/prebuilds/android-arm/classic-level.armv7.node +0 -0
- package/node_modules/classic-level/prebuilds/android-arm64/classic-level.armv8.node +0 -0
- package/node_modules/classic-level/prebuilds/darwin-x64+arm64/classic-level.node +0 -0
- package/node_modules/classic-level/prebuilds/linux-arm/classic-level.armv6.node +0 -0
- package/node_modules/classic-level/prebuilds/linux-arm/classic-level.armv7.node +0 -0
- package/node_modules/classic-level/prebuilds/linux-arm64/classic-level.armv8.node +0 -0
- package/node_modules/classic-level/prebuilds/linux-x64/classic-level.musl.node +0 -0
- package/node_modules/classic-level/prebuilds/linux-x64/classic-level.node +0 -0
- package/node_modules/classic-level/prebuilds/win32-ia32/classic-level.node +0 -0
- package/node_modules/classic-level/prebuilds/win32-x64/classic-level.node +0 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/is-buffer/LICENSE +21 -0
- package/node_modules/is-buffer/README.md +54 -0
- package/node_modules/is-buffer/index.d.ts +2 -0
- package/node_modules/is-buffer/index.js +11 -0
- package/node_modules/is-buffer/package.json +65 -0
- package/node_modules/level/CHANGELOG.md +532 -0
- package/node_modules/level/LICENSE +21 -0
- package/node_modules/level/README.md +107 -0
- package/node_modules/level/UPGRADING.md +413 -0
- package/node_modules/level/browser.js +1 -0
- package/node_modules/level/index.d.ts +75 -0
- package/node_modules/level/index.js +1 -0
- package/node_modules/level/package.json +62 -0
- package/node_modules/level-supports/CHANGELOG.md +140 -0
- package/node_modules/level-supports/LICENSE +21 -0
- package/node_modules/level-supports/README.md +276 -0
- package/node_modules/level-supports/index.d.ts +137 -0
- package/node_modules/level-supports/index.js +26 -0
- package/node_modules/level-supports/package.json +46 -0
- package/node_modules/level-supports/test/cloneable.js +26 -0
- package/node_modules/level-supports/test/index.js +24 -0
- package/node_modules/level-supports/test/self.js +86 -0
- package/node_modules/level-supports/test/shape.js +23 -0
- package/node_modules/level-transcoder/CHANGELOG.md +15 -0
- package/node_modules/level-transcoder/LICENSE +21 -0
- package/node_modules/level-transcoder/README.md +214 -0
- package/node_modules/level-transcoder/UPGRADING.md +13 -0
- package/node_modules/level-transcoder/index.d.ts +27 -0
- package/node_modules/level-transcoder/index.js +158 -0
- package/node_modules/level-transcoder/lib/encoding.d.ts +158 -0
- package/node_modules/level-transcoder/lib/encoding.js +105 -0
- package/node_modules/level-transcoder/lib/encodings.d.ts +9 -0
- package/node_modules/level-transcoder/lib/encodings.js +135 -0
- package/node_modules/level-transcoder/lib/formats.d.ts +13 -0
- package/node_modules/level-transcoder/lib/formats.js +111 -0
- package/node_modules/level-transcoder/lib/text-endec.d.ts +6 -0
- package/node_modules/level-transcoder/lib/text-endec.js +19 -0
- package/node_modules/level-transcoder/package.json +46 -0
- package/node_modules/maybe-combine-errors/LICENSE.md +21 -0
- package/node_modules/maybe-combine-errors/README.md +94 -0
- package/node_modules/maybe-combine-errors/index.js +60 -0
- package/node_modules/maybe-combine-errors/package.json +33 -0
- package/node_modules/module-error/CHANGELOG.md +23 -0
- package/node_modules/module-error/LICENSE +21 -0
- package/node_modules/module-error/README.md +89 -0
- package/node_modules/module-error/index.d.ts +18 -0
- package/node_modules/module-error/index.js +22 -0
- package/node_modules/module-error/package.json +36 -0
- package/node_modules/napi-macros/LICENSE +21 -0
- package/node_modules/napi-macros/README.md +277 -0
- package/node_modules/napi-macros/index.js +1 -0
- package/node_modules/napi-macros/napi-macros.h +255 -0
- package/node_modules/napi-macros/package.json +22 -0
- package/node_modules/node-gyp-build/LICENSE +21 -0
- package/node_modules/node-gyp-build/README.md +58 -0
- package/node_modules/node-gyp-build/SECURITY.md +5 -0
- package/node_modules/node-gyp-build/bin.js +84 -0
- package/node_modules/node-gyp-build/build-test.js +19 -0
- package/node_modules/node-gyp-build/index.js +6 -0
- package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
- package/node_modules/node-gyp-build/optional.js +7 -0
- package/node_modules/node-gyp-build/package.json +43 -0
- package/oauthTokenStore-PADKLNOC.js +23 -0
- package/package.json +6 -3
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HIPK67DU.js} +9 -9
- package/{providerRegistry-757OWH3O.js → providerRegistry-AI4U2FNM.js} +13 -9
- package/{read-COE3ZYR6.js → read-RNUQ7F34.js} +11 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-6WIZHE6O.js} +5 -3
- package/{readlineWorkspace-HO62DKCG.js → readlineWorkspace-P3I7ZJUP.js} +6948 -3879
- package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-EFQ4O2IQ.js} +27 -26
- package/{runAgentClientLoop-JLRJIF3F.js → runAgentClientLoop-AYNL3KMJ.js} +150 -90
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-5CIWJEZ3.js} +36 -8
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/setDialogExtraReferencesAction-MXAH2KPV.js +37 -0
- package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-7OPVNK4M.js} +28 -27
- package/{chunk-GP5LKBUZ.js → settingThunks-GHVLHABJ.js} +240 -945
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-QC35EQY4.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-5GLCWZPO.js → spaceCommands-WZCLRGBO.js} +56 -55
- package/{streamAgentChatTurn-DZ3PP7ZH.js → streamAgentChatTurn-O5T3B4B3.js} +325 -1557
- package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-4PANDG3L.js} +24 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-U3QDY4L6.js} +19 -17
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-54CXTU7C.js} +5 -4
- package/tools-UMU2DYQX.js +122 -0
- package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-ISODIW2O.js} +15 -29
- package/{updateCommands-2M74UL7P.js → updateCommands-NQXAGFM7.js} +3 -3
- package/{updateDialogTitleAction-VWZT4J6J.js → updateDialogTitleAction-TIS2SETN.js} +101 -57
- package/action-P4TNFGAD.js +0 -31
- package/agentListCommands-B2V4YAC4.js +0 -410
- package/agentRecordCommands-XBVDEYVC.js +0 -128
- package/agentRunCommand-V6RTNFRH.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-XMFWRG3P.js +0 -186
- package/chunk-ACTMNVHM.js +0 -93
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-N4G4PKQ6.js +0 -23
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-QQWJUHSL.js +0 -34
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-TWQWYIMJ.js +0 -21409
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/contentThunks-3Z6NAUW6.js +0 -73
- package/createDialogAction-7XW3RX2A.js +0 -65
- package/dialogCommands-H7FPUYUQ.js +0 -99
- package/handleSendMessageAction-GUBOMCGM.js +0 -633
- package/machineWsRunDispatch-AAG6PDBY.js +0 -144
- package/setDialogExtraReferencesAction-WX5VTY6O.js +0 -30
- package/settingSlice-P4ZW7K5X.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-XA4ZWLH4.js +0 -110
- package/{chunk-SV5IJK6K.js → chunk-NBTY7YJF.js} +3 -3
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
- package/{offlineMarxistsAgentCommand-HGXZV4XJ.js → offlineMarxistsAgentCommand-2QTHJCHV.js} +4 -4
|
@@ -0,0 +1,1127 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { supports } = require('level-supports')
|
|
4
|
+
const { Transcoder } = require('level-transcoder')
|
|
5
|
+
const { EventEmitter } = require('events')
|
|
6
|
+
const ModuleError = require('module-error')
|
|
7
|
+
const combineErrors = require('maybe-combine-errors')
|
|
8
|
+
const { AbstractIterator } = require('./abstract-iterator')
|
|
9
|
+
const { DefaultKeyIterator, DefaultValueIterator } = require('./lib/default-kv-iterator')
|
|
10
|
+
const { DeferredIterator, DeferredKeyIterator, DeferredValueIterator } = require('./lib/deferred-iterator')
|
|
11
|
+
const { DefaultChainedBatch } = require('./lib/default-chained-batch')
|
|
12
|
+
const { DatabaseHooks } = require('./lib/hooks')
|
|
13
|
+
const { PrewriteBatch } = require('./lib/prewrite-batch')
|
|
14
|
+
const { EventMonitor } = require('./lib/event-monitor')
|
|
15
|
+
const { getOptions, noop, emptyOptions, resolvedPromise } = require('./lib/common')
|
|
16
|
+
const { prefixDescendantKey, isDescendant } = require('./lib/prefixes')
|
|
17
|
+
const { DeferredQueue } = require('./lib/deferred-queue')
|
|
18
|
+
const rangeOptions = require('./lib/range-options')
|
|
19
|
+
|
|
20
|
+
class AbstractLevel extends EventEmitter {
|
|
21
|
+
#status = 'opening'
|
|
22
|
+
#deferOpen = true
|
|
23
|
+
#statusChange = null
|
|
24
|
+
#statusLocked = false
|
|
25
|
+
#resources
|
|
26
|
+
#queue
|
|
27
|
+
#options
|
|
28
|
+
#defaultOptions
|
|
29
|
+
#transcoder
|
|
30
|
+
#keyEncoding
|
|
31
|
+
#valueEncoding
|
|
32
|
+
#eventMonitor
|
|
33
|
+
|
|
34
|
+
constructor (manifest, options) {
|
|
35
|
+
super()
|
|
36
|
+
|
|
37
|
+
if (typeof manifest !== 'object' || manifest === null) {
|
|
38
|
+
throw new TypeError("The first argument 'manifest' must be an object")
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
options = getOptions(options)
|
|
42
|
+
const { keyEncoding, valueEncoding, passive, ...forward } = options
|
|
43
|
+
|
|
44
|
+
this.#resources = new Set()
|
|
45
|
+
this.#queue = new DeferredQueue()
|
|
46
|
+
this.#options = forward
|
|
47
|
+
|
|
48
|
+
// Aliased for backwards compatibility
|
|
49
|
+
const implicitSnapshots = manifest.snapshots !== false &&
|
|
50
|
+
manifest.implicitSnapshots !== false
|
|
51
|
+
|
|
52
|
+
this.hooks = new DatabaseHooks()
|
|
53
|
+
this.supports = supports(manifest, {
|
|
54
|
+
deferredOpen: true,
|
|
55
|
+
seek: true,
|
|
56
|
+
implicitSnapshots,
|
|
57
|
+
permanence: manifest.permanence !== false,
|
|
58
|
+
|
|
59
|
+
encodings: manifest.encodings || {},
|
|
60
|
+
events: {
|
|
61
|
+
...manifest.events,
|
|
62
|
+
opening: true,
|
|
63
|
+
open: true,
|
|
64
|
+
closing: true,
|
|
65
|
+
closed: true,
|
|
66
|
+
write: true,
|
|
67
|
+
clear: true
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
this.#eventMonitor = new EventMonitor(this)
|
|
72
|
+
this.#transcoder = new Transcoder(formats(this))
|
|
73
|
+
this.#keyEncoding = this.#transcoder.encoding(keyEncoding || 'utf8')
|
|
74
|
+
this.#valueEncoding = this.#transcoder.encoding(valueEncoding || 'utf8')
|
|
75
|
+
|
|
76
|
+
// Add custom and transcoder encodings to manifest
|
|
77
|
+
for (const encoding of this.#transcoder.encodings()) {
|
|
78
|
+
if (!this.supports.encodings[encoding.commonName]) {
|
|
79
|
+
this.supports.encodings[encoding.commonName] = true
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
this.#defaultOptions = {
|
|
84
|
+
empty: emptyOptions,
|
|
85
|
+
entry: Object.freeze({
|
|
86
|
+
keyEncoding: this.#keyEncoding.commonName,
|
|
87
|
+
valueEncoding: this.#valueEncoding.commonName
|
|
88
|
+
}),
|
|
89
|
+
entryFormat: Object.freeze({
|
|
90
|
+
keyEncoding: this.#keyEncoding.format,
|
|
91
|
+
valueEncoding: this.#valueEncoding.format
|
|
92
|
+
}),
|
|
93
|
+
key: Object.freeze({
|
|
94
|
+
keyEncoding: this.#keyEncoding.commonName
|
|
95
|
+
}),
|
|
96
|
+
keyFormat: Object.freeze({
|
|
97
|
+
keyEncoding: this.#keyEncoding.format
|
|
98
|
+
}),
|
|
99
|
+
owner: Object.freeze({
|
|
100
|
+
owner: this
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Before we start opening, let subclass finish its constructor
|
|
105
|
+
// and allow events and postopen hook functions to be added.
|
|
106
|
+
queueMicrotask(() => {
|
|
107
|
+
if (this.#deferOpen) {
|
|
108
|
+
this.open({ passive: false }).catch(noop)
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get status () {
|
|
114
|
+
return this.#status
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
get parent () {
|
|
118
|
+
return null
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
keyEncoding (encoding) {
|
|
122
|
+
return this.#transcoder.encoding(encoding ?? this.#keyEncoding)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
valueEncoding (encoding) {
|
|
126
|
+
return this.#transcoder.encoding(encoding ?? this.#valueEncoding)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async open (options) {
|
|
130
|
+
options = { ...this.#options, ...getOptions(options) }
|
|
131
|
+
|
|
132
|
+
options.createIfMissing = options.createIfMissing !== false
|
|
133
|
+
options.errorIfExists = !!options.errorIfExists
|
|
134
|
+
|
|
135
|
+
// TODO: document why we do this
|
|
136
|
+
const postopen = this.hooks.postopen.noop ? null : this.hooks.postopen.run
|
|
137
|
+
const passive = options.passive
|
|
138
|
+
|
|
139
|
+
if (passive && this.#deferOpen) {
|
|
140
|
+
// Wait a tick until constructor calls open() non-passively
|
|
141
|
+
await undefined
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Wait for pending changes and check that opening is allowed
|
|
145
|
+
this.#assertUnlocked()
|
|
146
|
+
while (this.#statusChange !== null) await this.#statusChange.catch(noop)
|
|
147
|
+
this.#assertUnlocked()
|
|
148
|
+
|
|
149
|
+
if (passive) {
|
|
150
|
+
if (this.#status !== 'open') throw new NotOpenError()
|
|
151
|
+
} else if (this.#status === 'closed' || this.#deferOpen) {
|
|
152
|
+
this.#deferOpen = false
|
|
153
|
+
this.#statusChange = resolvedPromise // TODO: refactor
|
|
154
|
+
this.#statusChange = (async () => {
|
|
155
|
+
this.#status = 'opening'
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
this.emit('opening')
|
|
159
|
+
await this._open(options)
|
|
160
|
+
} catch (err) {
|
|
161
|
+
this.#status = 'closed'
|
|
162
|
+
|
|
163
|
+
// Must happen before we close resources, in case their close() is waiting
|
|
164
|
+
// on a deferred operation which in turn is waiting on db.open().
|
|
165
|
+
this.#queue.drain()
|
|
166
|
+
|
|
167
|
+
try {
|
|
168
|
+
await this.#closeResources()
|
|
169
|
+
} catch (resourceErr) {
|
|
170
|
+
// eslint-disable-next-line no-ex-assign
|
|
171
|
+
err = combineErrors([err, resourceErr])
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
throw new NotOpenError(err)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
this.#status = 'open'
|
|
178
|
+
|
|
179
|
+
if (postopen !== null) {
|
|
180
|
+
let hookErr
|
|
181
|
+
|
|
182
|
+
try {
|
|
183
|
+
// Prevent deadlock
|
|
184
|
+
this.#statusLocked = true
|
|
185
|
+
await postopen(options)
|
|
186
|
+
} catch (err) {
|
|
187
|
+
hookErr = convertRejection(err)
|
|
188
|
+
} finally {
|
|
189
|
+
this.#statusLocked = false
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Revert
|
|
193
|
+
if (hookErr) {
|
|
194
|
+
this.#status = 'closing'
|
|
195
|
+
this.#queue.drain()
|
|
196
|
+
|
|
197
|
+
try {
|
|
198
|
+
await this.#closeResources()
|
|
199
|
+
await this._close()
|
|
200
|
+
} catch (closeErr) {
|
|
201
|
+
// There's no safe state to return to. Can't return to 'open' because
|
|
202
|
+
// postopen hook failed. Can't return to 'closed' (with the ability to
|
|
203
|
+
// reopen) because the underlying database is potentially still open.
|
|
204
|
+
this.#statusLocked = true
|
|
205
|
+
hookErr = combineErrors([hookErr, closeErr])
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
this.#status = 'closed'
|
|
209
|
+
|
|
210
|
+
throw new ModuleError('The postopen hook failed on open()', {
|
|
211
|
+
code: 'LEVEL_HOOK_ERROR',
|
|
212
|
+
cause: hookErr
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
this.#queue.drain()
|
|
218
|
+
this.emit('open')
|
|
219
|
+
})()
|
|
220
|
+
|
|
221
|
+
try {
|
|
222
|
+
await this.#statusChange
|
|
223
|
+
} finally {
|
|
224
|
+
this.#statusChange = null
|
|
225
|
+
}
|
|
226
|
+
} else if (this.#status !== 'open') {
|
|
227
|
+
/* istanbul ignore next: should not happen */
|
|
228
|
+
throw new NotOpenError()
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
async _open (options) {}
|
|
233
|
+
|
|
234
|
+
async close () {
|
|
235
|
+
// Wait for pending changes and check that closing is allowed
|
|
236
|
+
this.#assertUnlocked()
|
|
237
|
+
while (this.#statusChange !== null) await this.#statusChange.catch(noop)
|
|
238
|
+
this.#assertUnlocked()
|
|
239
|
+
|
|
240
|
+
if (this.#status === 'open' || this.#deferOpen) {
|
|
241
|
+
// If close() was called after constructor, we didn't open yet
|
|
242
|
+
const fromInitial = this.#deferOpen
|
|
243
|
+
|
|
244
|
+
this.#deferOpen = false
|
|
245
|
+
this.#statusChange = resolvedPromise
|
|
246
|
+
this.#statusChange = (async () => {
|
|
247
|
+
this.#status = 'closing'
|
|
248
|
+
this.#queue.drain()
|
|
249
|
+
|
|
250
|
+
try {
|
|
251
|
+
this.emit('closing')
|
|
252
|
+
await this.#closeResources()
|
|
253
|
+
if (!fromInitial) await this._close()
|
|
254
|
+
} catch (err) {
|
|
255
|
+
this.#status = 'open'
|
|
256
|
+
this.#queue.drain()
|
|
257
|
+
throw new NotClosedError(err)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
this.#status = 'closed'
|
|
261
|
+
this.#queue.drain()
|
|
262
|
+
this.emit('closed')
|
|
263
|
+
})()
|
|
264
|
+
|
|
265
|
+
try {
|
|
266
|
+
await this.#statusChange
|
|
267
|
+
} finally {
|
|
268
|
+
this.#statusChange = null
|
|
269
|
+
}
|
|
270
|
+
} else if (this.#status !== 'closed') {
|
|
271
|
+
/* istanbul ignore next: should not happen */
|
|
272
|
+
throw new NotClosedError()
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
async #closeResources () {
|
|
277
|
+
if (this.#resources.size === 0) {
|
|
278
|
+
return
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// In parallel so that all resources know they are closed
|
|
282
|
+
const resources = Array.from(this.#resources)
|
|
283
|
+
const promises = resources.map(closeResource)
|
|
284
|
+
const results = await Promise.allSettled(promises)
|
|
285
|
+
const errors = []
|
|
286
|
+
|
|
287
|
+
for (let i = 0; i < results.length; i++) {
|
|
288
|
+
if (results[i].status === 'fulfilled') {
|
|
289
|
+
this.#resources.delete(resources[i])
|
|
290
|
+
} else {
|
|
291
|
+
errors.push(convertRejection(results[i].reason))
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (errors.length > 0) {
|
|
296
|
+
throw combineErrors(errors)
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
async _close () {}
|
|
301
|
+
|
|
302
|
+
async get (key, options) {
|
|
303
|
+
options = getOptions(options, this.#defaultOptions.entry)
|
|
304
|
+
|
|
305
|
+
if (this.#status === 'opening') {
|
|
306
|
+
return this.deferAsync(() => this.get(key, options))
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
this.#assertOpen()
|
|
310
|
+
this._assertValidKey(key)
|
|
311
|
+
|
|
312
|
+
const snapshot = options.snapshot
|
|
313
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
314
|
+
const valueEncoding = this.valueEncoding(options.valueEncoding)
|
|
315
|
+
const keyFormat = keyEncoding.format
|
|
316
|
+
const valueFormat = valueEncoding.format
|
|
317
|
+
|
|
318
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
319
|
+
if (options === this.#defaultOptions.entry) {
|
|
320
|
+
options = this.#defaultOptions.entryFormat
|
|
321
|
+
} else if (options.keyEncoding !== keyFormat || options.valueEncoding !== valueFormat) {
|
|
322
|
+
options = { ...options, keyEncoding: keyFormat, valueEncoding: valueFormat }
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const encodedKey = keyEncoding.encode(key)
|
|
326
|
+
const mappedKey = this.prefixKey(encodedKey, keyFormat, true)
|
|
327
|
+
|
|
328
|
+
// Keep snapshot open during operation
|
|
329
|
+
snapshot?.ref()
|
|
330
|
+
|
|
331
|
+
let value
|
|
332
|
+
|
|
333
|
+
try {
|
|
334
|
+
value = await this._get(mappedKey, options)
|
|
335
|
+
} finally {
|
|
336
|
+
// Release snapshot
|
|
337
|
+
snapshot?.unref()
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
try {
|
|
341
|
+
return value === undefined ? value : valueEncoding.decode(value)
|
|
342
|
+
} catch (err) {
|
|
343
|
+
throw new ModuleError('Could not decode value', {
|
|
344
|
+
code: 'LEVEL_DECODE_ERROR',
|
|
345
|
+
cause: err
|
|
346
|
+
})
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
async _get (key, options) {
|
|
351
|
+
return undefined
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
getSync (key, options) {
|
|
355
|
+
if (this.status !== 'open') {
|
|
356
|
+
throw new ModuleError('Database is not open', {
|
|
357
|
+
code: 'LEVEL_DATABASE_NOT_OPEN'
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
this._assertValidKey(key)
|
|
362
|
+
|
|
363
|
+
// Fast-path for default options (known encoding, no cloning, no snapshot)
|
|
364
|
+
if (options == null) {
|
|
365
|
+
const encodedKey = this.#keyEncoding.encode(key)
|
|
366
|
+
const mappedKey = this.prefixKey(encodedKey, this.#keyEncoding.format, true)
|
|
367
|
+
const value = this._getSync(mappedKey, this.#defaultOptions.entryFormat)
|
|
368
|
+
|
|
369
|
+
try {
|
|
370
|
+
return value !== undefined ? this.#valueEncoding.decode(value) : undefined
|
|
371
|
+
} catch (err) {
|
|
372
|
+
throw new ModuleError('Could not decode value', {
|
|
373
|
+
code: 'LEVEL_DECODE_ERROR',
|
|
374
|
+
cause: err
|
|
375
|
+
})
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const snapshot = options.snapshot
|
|
380
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
381
|
+
const valueEncoding = this.valueEncoding(options.valueEncoding)
|
|
382
|
+
const keyFormat = keyEncoding.format
|
|
383
|
+
const valueFormat = valueEncoding.format
|
|
384
|
+
|
|
385
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
386
|
+
if (options.keyEncoding !== keyFormat || options.valueEncoding !== valueFormat) {
|
|
387
|
+
options = { ...options, keyEncoding: keyFormat, valueEncoding: valueFormat }
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const encodedKey = keyEncoding.encode(key)
|
|
391
|
+
const mappedKey = this.prefixKey(encodedKey, keyFormat, true)
|
|
392
|
+
|
|
393
|
+
let value
|
|
394
|
+
|
|
395
|
+
// Keep snapshot open during operation
|
|
396
|
+
snapshot?.ref()
|
|
397
|
+
|
|
398
|
+
try {
|
|
399
|
+
value = this._getSync(mappedKey, options)
|
|
400
|
+
} finally {
|
|
401
|
+
// Release snapshot
|
|
402
|
+
snapshot?.unref()
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
try {
|
|
406
|
+
return value !== undefined ? valueEncoding.decode(value) : undefined
|
|
407
|
+
} catch (err) {
|
|
408
|
+
throw new ModuleError('Could not decode value', {
|
|
409
|
+
code: 'LEVEL_DECODE_ERROR',
|
|
410
|
+
cause: err
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
_getSync (key, options) {
|
|
416
|
+
throw new ModuleError('Database does not support getSync()', {
|
|
417
|
+
code: 'LEVEL_NOT_SUPPORTED'
|
|
418
|
+
})
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
async getMany (keys, options) {
|
|
422
|
+
options = getOptions(options, this.#defaultOptions.entry)
|
|
423
|
+
|
|
424
|
+
if (this.#status === 'opening') {
|
|
425
|
+
return this.deferAsync(() => this.getMany(keys, options))
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
this.#assertOpen()
|
|
429
|
+
|
|
430
|
+
if (!Array.isArray(keys)) {
|
|
431
|
+
throw new TypeError("The first argument 'keys' must be an array")
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (keys.length === 0) {
|
|
435
|
+
return []
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const snapshot = options.snapshot
|
|
439
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
440
|
+
const valueEncoding = this.valueEncoding(options.valueEncoding)
|
|
441
|
+
const keyFormat = keyEncoding.format
|
|
442
|
+
const valueFormat = valueEncoding.format
|
|
443
|
+
|
|
444
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
445
|
+
if (options === this.#defaultOptions.entry) {
|
|
446
|
+
options = this.#defaultOptions.entryFormat
|
|
447
|
+
} else if (options.keyEncoding !== keyFormat || options.valueEncoding !== valueFormat) {
|
|
448
|
+
options = { ...options, keyEncoding: keyFormat, valueEncoding: valueFormat }
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const mappedKeys = new Array(keys.length)
|
|
452
|
+
|
|
453
|
+
for (let i = 0; i < keys.length; i++) {
|
|
454
|
+
const key = keys[i]
|
|
455
|
+
this._assertValidKey(key)
|
|
456
|
+
mappedKeys[i] = this.prefixKey(keyEncoding.encode(key), keyFormat, true)
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// Keep snapshot open during operation
|
|
460
|
+
snapshot?.ref()
|
|
461
|
+
|
|
462
|
+
let values
|
|
463
|
+
|
|
464
|
+
try {
|
|
465
|
+
values = await this._getMany(mappedKeys, options)
|
|
466
|
+
} finally {
|
|
467
|
+
// Release snapshot
|
|
468
|
+
snapshot?.unref()
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
try {
|
|
472
|
+
for (let i = 0; i < values.length; i++) {
|
|
473
|
+
if (values[i] !== undefined) {
|
|
474
|
+
values[i] = valueEncoding.decode(values[i])
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
} catch (err) {
|
|
478
|
+
throw new ModuleError(`Could not decode one or more of ${values.length} value(s)`, {
|
|
479
|
+
code: 'LEVEL_DECODE_ERROR',
|
|
480
|
+
cause: err
|
|
481
|
+
})
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return values
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
async _getMany (keys, options) {
|
|
488
|
+
return new Array(keys.length).fill(undefined)
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
async has (key, options) {
|
|
492
|
+
options = getOptions(options, this.#defaultOptions.key)
|
|
493
|
+
|
|
494
|
+
if (this.#status === 'opening') {
|
|
495
|
+
return this.deferAsync(() => this.has(key, options))
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
this.#assertOpen()
|
|
499
|
+
this._assertValidKey(key)
|
|
500
|
+
|
|
501
|
+
const snapshot = options.snapshot
|
|
502
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
503
|
+
const keyFormat = keyEncoding.format
|
|
504
|
+
|
|
505
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
506
|
+
if (options === this.#defaultOptions.key) {
|
|
507
|
+
options = this.#defaultOptions.keyFormat
|
|
508
|
+
} else if (options.keyEncoding !== keyFormat) {
|
|
509
|
+
options = { ...options, keyEncoding: keyFormat }
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const encodedKey = keyEncoding.encode(key)
|
|
513
|
+
const mappedKey = this.prefixKey(encodedKey, keyFormat, true)
|
|
514
|
+
|
|
515
|
+
// Keep snapshot open during operation
|
|
516
|
+
snapshot?.ref()
|
|
517
|
+
|
|
518
|
+
try {
|
|
519
|
+
return this._has(mappedKey, options)
|
|
520
|
+
} finally {
|
|
521
|
+
// Release snapshot
|
|
522
|
+
snapshot?.unref()
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
async _has (key, options) {
|
|
527
|
+
throw new ModuleError('Database does not support has()', {
|
|
528
|
+
code: 'LEVEL_NOT_SUPPORTED'
|
|
529
|
+
})
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
async hasMany (keys, options) {
|
|
533
|
+
options = getOptions(options, this.#defaultOptions.key)
|
|
534
|
+
|
|
535
|
+
if (this.#status === 'opening') {
|
|
536
|
+
return this.deferAsync(() => this.hasMany(keys, options))
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
this.#assertOpen()
|
|
540
|
+
|
|
541
|
+
if (!Array.isArray(keys)) {
|
|
542
|
+
throw new TypeError("The first argument 'keys' must be an array")
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (keys.length === 0) {
|
|
546
|
+
return []
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const snapshot = options.snapshot
|
|
550
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
551
|
+
const keyFormat = keyEncoding.format
|
|
552
|
+
|
|
553
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
554
|
+
if (options === this.#defaultOptions.key) {
|
|
555
|
+
options = this.#defaultOptions.keyFormat
|
|
556
|
+
} else if (options.keyEncoding !== keyFormat) {
|
|
557
|
+
options = { ...options, keyEncoding: keyFormat }
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
const mappedKeys = new Array(keys.length)
|
|
561
|
+
|
|
562
|
+
for (let i = 0; i < keys.length; i++) {
|
|
563
|
+
const key = keys[i]
|
|
564
|
+
this._assertValidKey(key)
|
|
565
|
+
mappedKeys[i] = this.prefixKey(keyEncoding.encode(key), keyFormat, true)
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// Keep snapshot open during operation
|
|
569
|
+
snapshot?.ref()
|
|
570
|
+
|
|
571
|
+
try {
|
|
572
|
+
return this._hasMany(mappedKeys, options)
|
|
573
|
+
} finally {
|
|
574
|
+
// Release snapshot
|
|
575
|
+
snapshot?.unref()
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
async _hasMany (keys, options) {
|
|
580
|
+
throw new ModuleError('Database does not support hasMany()', {
|
|
581
|
+
code: 'LEVEL_NOT_SUPPORTED'
|
|
582
|
+
})
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
async put (key, value, options) {
|
|
586
|
+
if (!this.hooks.prewrite.noop) {
|
|
587
|
+
// Forward to batch() which will run the hook
|
|
588
|
+
// Note: technically means that put() supports the sublevel option in this case,
|
|
589
|
+
// but it generally doesn't per documentation (which makes sense). Same for del().
|
|
590
|
+
return this.batch([{ type: 'put', key, value }], options)
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
options = getOptions(options, this.#defaultOptions.entry)
|
|
594
|
+
|
|
595
|
+
if (this.#status === 'opening') {
|
|
596
|
+
return this.deferAsync(() => this.put(key, value, options))
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
this.#assertOpen()
|
|
600
|
+
|
|
601
|
+
this._assertValidKey(key)
|
|
602
|
+
this._assertValidValue(value)
|
|
603
|
+
|
|
604
|
+
// Encode data for private API
|
|
605
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
606
|
+
const valueEncoding = this.valueEncoding(options.valueEncoding)
|
|
607
|
+
const keyFormat = keyEncoding.format
|
|
608
|
+
const valueFormat = valueEncoding.format
|
|
609
|
+
const enableWriteEvent = this.#eventMonitor.write
|
|
610
|
+
const original = options
|
|
611
|
+
|
|
612
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
613
|
+
if (options === this.#defaultOptions.entry) {
|
|
614
|
+
options = this.#defaultOptions.entryFormat
|
|
615
|
+
} else if (options.keyEncoding !== keyFormat || options.valueEncoding !== valueFormat) {
|
|
616
|
+
options = { ...options, keyEncoding: keyFormat, valueEncoding: valueFormat }
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
const encodedKey = keyEncoding.encode(key)
|
|
620
|
+
const prefixedKey = this.prefixKey(encodedKey, keyFormat, true)
|
|
621
|
+
const encodedValue = valueEncoding.encode(value)
|
|
622
|
+
|
|
623
|
+
await this._put(prefixedKey, encodedValue, options)
|
|
624
|
+
|
|
625
|
+
if (enableWriteEvent) {
|
|
626
|
+
const op = {
|
|
627
|
+
...original,
|
|
628
|
+
type: 'put',
|
|
629
|
+
key,
|
|
630
|
+
value,
|
|
631
|
+
keyEncoding,
|
|
632
|
+
valueEncoding,
|
|
633
|
+
encodedKey,
|
|
634
|
+
encodedValue
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
this.emit('write', [op])
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
async _put (key, value, options) {}
|
|
642
|
+
|
|
643
|
+
async del (key, options) {
|
|
644
|
+
if (!this.hooks.prewrite.noop) {
|
|
645
|
+
// Forward to batch() which will run the hook
|
|
646
|
+
return this.batch([{ type: 'del', key }], options)
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
options = getOptions(options, this.#defaultOptions.key)
|
|
650
|
+
|
|
651
|
+
if (this.#status === 'opening') {
|
|
652
|
+
return this.deferAsync(() => this.del(key, options))
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
this.#assertOpen()
|
|
656
|
+
this._assertValidKey(key)
|
|
657
|
+
|
|
658
|
+
// Encode data for private API
|
|
659
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
660
|
+
const keyFormat = keyEncoding.format
|
|
661
|
+
const enableWriteEvent = this.#eventMonitor.write
|
|
662
|
+
const original = options
|
|
663
|
+
|
|
664
|
+
// Forward encoding options. Avoid cloning if possible.
|
|
665
|
+
if (options === this.#defaultOptions.key) {
|
|
666
|
+
options = this.#defaultOptions.keyFormat
|
|
667
|
+
} else if (options.keyEncoding !== keyFormat) {
|
|
668
|
+
options = { ...options, keyEncoding: keyFormat }
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
const encodedKey = keyEncoding.encode(key)
|
|
672
|
+
const prefixedKey = this.prefixKey(encodedKey, keyFormat, true)
|
|
673
|
+
|
|
674
|
+
await this._del(prefixedKey, options)
|
|
675
|
+
|
|
676
|
+
if (enableWriteEvent) {
|
|
677
|
+
const op = {
|
|
678
|
+
...original,
|
|
679
|
+
type: 'del',
|
|
680
|
+
key,
|
|
681
|
+
keyEncoding,
|
|
682
|
+
encodedKey
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
this.emit('write', [op])
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
async _del (key, options) {}
|
|
690
|
+
|
|
691
|
+
// TODO (future): add way for implementations to declare which options are for the
|
|
692
|
+
// whole batch rather than defaults for individual operations. E.g. the sync option
|
|
693
|
+
// of classic-level, that should not be copied to individual operations.
|
|
694
|
+
batch (operations, options) {
|
|
695
|
+
if (!arguments.length) {
|
|
696
|
+
this.#assertOpen()
|
|
697
|
+
return this._chainedBatch()
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
options = getOptions(options, this.#defaultOptions.empty)
|
|
701
|
+
return this.#arrayBatch(operations, options)
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// Wrapped for async error handling
|
|
705
|
+
async #arrayBatch (operations, options) {
|
|
706
|
+
// TODO (not urgent): freeze prewrite hook and write event
|
|
707
|
+
if (this.#status === 'opening') {
|
|
708
|
+
return this.deferAsync(() => this.#arrayBatch(operations, options))
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
this.#assertOpen()
|
|
712
|
+
|
|
713
|
+
if (!Array.isArray(operations)) {
|
|
714
|
+
throw new TypeError("The first argument 'operations' must be an array")
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
if (operations.length === 0) {
|
|
718
|
+
return
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
const length = operations.length
|
|
722
|
+
const enablePrewriteHook = !this.hooks.prewrite.noop
|
|
723
|
+
const enableWriteEvent = this.#eventMonitor.write
|
|
724
|
+
const publicOperations = enableWriteEvent ? new Array(length) : null
|
|
725
|
+
const privateOperations = new Array(length)
|
|
726
|
+
const prewriteBatch = enablePrewriteHook
|
|
727
|
+
? new PrewriteBatch(this, privateOperations, publicOperations)
|
|
728
|
+
: null
|
|
729
|
+
|
|
730
|
+
for (let i = 0; i < length; i++) {
|
|
731
|
+
// Clone the op so that we can freely mutate it. We can't use a class because the
|
|
732
|
+
// op can have userland properties that we'd have to copy, negating the performance
|
|
733
|
+
// benefits of a class. So use a plain object.
|
|
734
|
+
const op = { ...options, ...operations[i] }
|
|
735
|
+
|
|
736
|
+
// Hook functions can modify op but not its type or sublevel, so cache those
|
|
737
|
+
const isPut = op.type === 'put'
|
|
738
|
+
const delegated = op.sublevel != null
|
|
739
|
+
const db = delegated ? op.sublevel : this
|
|
740
|
+
|
|
741
|
+
db._assertValidKey(op.key)
|
|
742
|
+
|
|
743
|
+
op.keyEncoding = db.keyEncoding(op.keyEncoding)
|
|
744
|
+
|
|
745
|
+
if (isPut) {
|
|
746
|
+
db._assertValidValue(op.value)
|
|
747
|
+
op.valueEncoding = db.valueEncoding(op.valueEncoding)
|
|
748
|
+
} else if (op.type !== 'del') {
|
|
749
|
+
throw new TypeError("A batch operation must have a type property that is 'put' or 'del'")
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if (enablePrewriteHook) {
|
|
753
|
+
try {
|
|
754
|
+
this.hooks.prewrite.run(op, prewriteBatch)
|
|
755
|
+
|
|
756
|
+
// Normalize encodings again in case they were modified
|
|
757
|
+
op.keyEncoding = db.keyEncoding(op.keyEncoding)
|
|
758
|
+
if (isPut) op.valueEncoding = db.valueEncoding(op.valueEncoding)
|
|
759
|
+
} catch (err) {
|
|
760
|
+
throw new ModuleError('The prewrite hook failed on batch()', {
|
|
761
|
+
code: 'LEVEL_HOOK_ERROR',
|
|
762
|
+
cause: err
|
|
763
|
+
})
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// Encode data for private API
|
|
768
|
+
const keyEncoding = op.keyEncoding
|
|
769
|
+
const preencodedKey = keyEncoding.encode(op.key)
|
|
770
|
+
const keyFormat = keyEncoding.format
|
|
771
|
+
|
|
772
|
+
// If the sublevel is not a descendant then forward that option to the parent db
|
|
773
|
+
// so that we don't erroneously add our own prefix to the key of the operation.
|
|
774
|
+
const siblings = delegated && !isDescendant(op.sublevel, this) && op.sublevel !== this
|
|
775
|
+
const encodedKey = delegated && !siblings
|
|
776
|
+
? prefixDescendantKey(preencodedKey, keyFormat, db, this)
|
|
777
|
+
: preencodedKey
|
|
778
|
+
|
|
779
|
+
// Only prefix once
|
|
780
|
+
if (delegated && !siblings) {
|
|
781
|
+
op.sublevel = null
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
let publicOperation = null
|
|
785
|
+
|
|
786
|
+
// If the sublevel is not a descendant then we shouldn't emit events
|
|
787
|
+
if (enableWriteEvent && !siblings) {
|
|
788
|
+
// Clone op before we mutate it for the private API
|
|
789
|
+
// TODO (future semver-major): consider sending this shape to private API too
|
|
790
|
+
publicOperation = { ...op }
|
|
791
|
+
publicOperation.encodedKey = encodedKey
|
|
792
|
+
|
|
793
|
+
if (delegated) {
|
|
794
|
+
// Ensure emitted data makes sense in the context of this db
|
|
795
|
+
publicOperation.key = encodedKey
|
|
796
|
+
publicOperation.keyEncoding = this.keyEncoding(keyFormat)
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
publicOperations[i] = publicOperation
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// If we're forwarding the sublevel option then don't prefix the key yet
|
|
803
|
+
op.key = siblings ? encodedKey : this.prefixKey(encodedKey, keyFormat, true)
|
|
804
|
+
op.keyEncoding = keyFormat
|
|
805
|
+
|
|
806
|
+
if (isPut) {
|
|
807
|
+
const valueEncoding = op.valueEncoding
|
|
808
|
+
const encodedValue = valueEncoding.encode(op.value)
|
|
809
|
+
const valueFormat = valueEncoding.format
|
|
810
|
+
|
|
811
|
+
op.value = encodedValue
|
|
812
|
+
op.valueEncoding = valueFormat
|
|
813
|
+
|
|
814
|
+
if (enableWriteEvent && !siblings) {
|
|
815
|
+
publicOperation.encodedValue = encodedValue
|
|
816
|
+
|
|
817
|
+
if (delegated) {
|
|
818
|
+
publicOperation.value = encodedValue
|
|
819
|
+
publicOperation.valueEncoding = this.valueEncoding(valueFormat)
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
privateOperations[i] = op
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// TODO (future): maybe add separate hook to run on private data. Currently can't work
|
|
828
|
+
// because prefixing happens too soon; we need to move that logic to the private
|
|
829
|
+
// API of AbstractSublevel (or reimplement with hooks). TBD how it'd work in chained
|
|
830
|
+
// batch. Hook would look something like hooks.midwrite.run(privateOperations, ...).
|
|
831
|
+
|
|
832
|
+
await this._batch(privateOperations, options)
|
|
833
|
+
|
|
834
|
+
if (enableWriteEvent) {
|
|
835
|
+
this.emit('write', publicOperations)
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
async _batch (operations, options) {}
|
|
840
|
+
|
|
841
|
+
sublevel (name, options) {
|
|
842
|
+
const xopts = AbstractSublevel.defaults(options)
|
|
843
|
+
const sublevel = this._sublevel(name, xopts)
|
|
844
|
+
|
|
845
|
+
if (!this.hooks.newsub.noop) {
|
|
846
|
+
try {
|
|
847
|
+
this.hooks.newsub.run(sublevel, xopts)
|
|
848
|
+
} catch (err) {
|
|
849
|
+
throw new ModuleError('The newsub hook failed on sublevel()', {
|
|
850
|
+
code: 'LEVEL_HOOK_ERROR',
|
|
851
|
+
cause: err
|
|
852
|
+
})
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
return sublevel
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
_sublevel (name, options) {
|
|
860
|
+
return new AbstractSublevel(this, name, options)
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
prefixKey (key, keyFormat, local) {
|
|
864
|
+
return key
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
async clear (options) {
|
|
868
|
+
options = getOptions(options, this.#defaultOptions.empty)
|
|
869
|
+
|
|
870
|
+
if (this.#status === 'opening') {
|
|
871
|
+
return this.deferAsync(() => this.clear(options))
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
this.#assertOpen()
|
|
875
|
+
|
|
876
|
+
const original = options
|
|
877
|
+
const keyEncoding = this.keyEncoding(options.keyEncoding)
|
|
878
|
+
const snapshot = options.snapshot
|
|
879
|
+
|
|
880
|
+
options = rangeOptions(options, keyEncoding)
|
|
881
|
+
options.keyEncoding = keyEncoding.format
|
|
882
|
+
|
|
883
|
+
if (options.limit !== 0) {
|
|
884
|
+
// Keep snapshot open during operation
|
|
885
|
+
snapshot?.ref()
|
|
886
|
+
|
|
887
|
+
try {
|
|
888
|
+
await this._clear(options)
|
|
889
|
+
} finally {
|
|
890
|
+
// Release snapshot
|
|
891
|
+
snapshot?.unref()
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
this.emit('clear', original)
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
async _clear (options) {}
|
|
899
|
+
|
|
900
|
+
iterator (options) {
|
|
901
|
+
const keyEncoding = this.keyEncoding(options?.keyEncoding)
|
|
902
|
+
const valueEncoding = this.valueEncoding(options?.valueEncoding)
|
|
903
|
+
|
|
904
|
+
options = rangeOptions(options, keyEncoding)
|
|
905
|
+
options.keys = options.keys !== false
|
|
906
|
+
options.values = options.values !== false
|
|
907
|
+
|
|
908
|
+
// We need the original encoding options in AbstractIterator in order to decode data
|
|
909
|
+
options[AbstractIterator.keyEncoding] = keyEncoding
|
|
910
|
+
options[AbstractIterator.valueEncoding] = valueEncoding
|
|
911
|
+
|
|
912
|
+
// Forward encoding options to private API
|
|
913
|
+
options.keyEncoding = keyEncoding.format
|
|
914
|
+
options.valueEncoding = valueEncoding.format
|
|
915
|
+
|
|
916
|
+
if (this.#status === 'opening') {
|
|
917
|
+
return new DeferredIterator(this, options)
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
this.#assertOpen()
|
|
921
|
+
return this._iterator(options)
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
_iterator (options) {
|
|
925
|
+
return new AbstractIterator(this, options)
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
keys (options) {
|
|
929
|
+
// Also include valueEncoding (though unused) because we may fallback to _iterator()
|
|
930
|
+
const keyEncoding = this.keyEncoding(options?.keyEncoding)
|
|
931
|
+
const valueEncoding = this.valueEncoding(options?.valueEncoding)
|
|
932
|
+
|
|
933
|
+
options = rangeOptions(options, keyEncoding)
|
|
934
|
+
|
|
935
|
+
// We need the original encoding options in AbstractKeyIterator in order to decode data
|
|
936
|
+
options[AbstractIterator.keyEncoding] = keyEncoding
|
|
937
|
+
options[AbstractIterator.valueEncoding] = valueEncoding
|
|
938
|
+
|
|
939
|
+
// Forward encoding options to private API
|
|
940
|
+
options.keyEncoding = keyEncoding.format
|
|
941
|
+
options.valueEncoding = valueEncoding.format
|
|
942
|
+
|
|
943
|
+
if (this.#status === 'opening') {
|
|
944
|
+
return new DeferredKeyIterator(this, options)
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
this.#assertOpen()
|
|
948
|
+
return this._keys(options)
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
_keys (options) {
|
|
952
|
+
return new DefaultKeyIterator(this, options)
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
values (options) {
|
|
956
|
+
const keyEncoding = this.keyEncoding(options?.keyEncoding)
|
|
957
|
+
const valueEncoding = this.valueEncoding(options?.valueEncoding)
|
|
958
|
+
|
|
959
|
+
options = rangeOptions(options, keyEncoding)
|
|
960
|
+
|
|
961
|
+
// We need the original encoding options in AbstractValueIterator in order to decode data
|
|
962
|
+
options[AbstractIterator.keyEncoding] = keyEncoding
|
|
963
|
+
options[AbstractIterator.valueEncoding] = valueEncoding
|
|
964
|
+
|
|
965
|
+
// Forward encoding options to private API
|
|
966
|
+
options.keyEncoding = keyEncoding.format
|
|
967
|
+
options.valueEncoding = valueEncoding.format
|
|
968
|
+
|
|
969
|
+
if (this.#status === 'opening') {
|
|
970
|
+
return new DeferredValueIterator(this, options)
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
this.#assertOpen()
|
|
974
|
+
return this._values(options)
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
_values (options) {
|
|
978
|
+
return new DefaultValueIterator(this, options)
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
snapshot (options) {
|
|
982
|
+
this.#assertOpen()
|
|
983
|
+
|
|
984
|
+
// Owner is an undocumented option explained in AbstractSnapshot
|
|
985
|
+
if (typeof options !== 'object' || options === null) {
|
|
986
|
+
options = this.#defaultOptions.owner
|
|
987
|
+
} else if (options.owner == null) {
|
|
988
|
+
options = { ...options, owner: this }
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
return this._snapshot(options)
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
_snapshot (options) {
|
|
995
|
+
throw new ModuleError('Database does not support explicit snapshots', {
|
|
996
|
+
code: 'LEVEL_NOT_SUPPORTED'
|
|
997
|
+
})
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
defer (fn, options) {
|
|
1001
|
+
if (typeof fn !== 'function') {
|
|
1002
|
+
throw new TypeError('The first argument must be a function')
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
this.#queue.add(function (abortError) {
|
|
1006
|
+
if (!abortError) fn()
|
|
1007
|
+
}, options)
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
deferAsync (fn, options) {
|
|
1011
|
+
if (typeof fn !== 'function') {
|
|
1012
|
+
throw new TypeError('The first argument must be a function')
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
return new Promise((resolve, reject) => {
|
|
1016
|
+
this.#queue.add(function (abortError) {
|
|
1017
|
+
if (abortError) reject(abortError)
|
|
1018
|
+
else fn().then(resolve, reject)
|
|
1019
|
+
}, options)
|
|
1020
|
+
})
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
attachResource (resource) {
|
|
1024
|
+
if (typeof resource !== 'object' || resource === null ||
|
|
1025
|
+
typeof resource.close !== 'function') {
|
|
1026
|
+
throw new TypeError('The first argument must be a resource object')
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
this.#resources.add(resource)
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
detachResource (resource) {
|
|
1033
|
+
this.#resources.delete(resource)
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
_chainedBatch () {
|
|
1037
|
+
return new DefaultChainedBatch(this)
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
_assertValidKey (key) {
|
|
1041
|
+
if (key === null || key === undefined) {
|
|
1042
|
+
throw new ModuleError('Key cannot be null or undefined', {
|
|
1043
|
+
code: 'LEVEL_INVALID_KEY'
|
|
1044
|
+
})
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
_assertValidValue (value) {
|
|
1049
|
+
if (value === null || value === undefined) {
|
|
1050
|
+
throw new ModuleError('Value cannot be null or undefined', {
|
|
1051
|
+
code: 'LEVEL_INVALID_VALUE'
|
|
1052
|
+
})
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
#assertOpen () {
|
|
1057
|
+
if (this.#status !== 'open') {
|
|
1058
|
+
throw new ModuleError('Database is not open', {
|
|
1059
|
+
code: 'LEVEL_DATABASE_NOT_OPEN'
|
|
1060
|
+
})
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
#assertUnlocked () {
|
|
1065
|
+
if (this.#statusLocked) {
|
|
1066
|
+
throw new ModuleError('Database status is locked', {
|
|
1067
|
+
code: 'LEVEL_STATUS_LOCKED'
|
|
1068
|
+
})
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
const { AbstractSublevel } = require('./lib/abstract-sublevel')({ AbstractLevel })
|
|
1074
|
+
|
|
1075
|
+
exports.AbstractLevel = AbstractLevel
|
|
1076
|
+
exports.AbstractSublevel = AbstractSublevel
|
|
1077
|
+
|
|
1078
|
+
if (typeof Symbol.asyncDispose === 'symbol') {
|
|
1079
|
+
AbstractLevel.prototype[Symbol.asyncDispose] = async function () {
|
|
1080
|
+
return this.close()
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
const formats = function (db) {
|
|
1085
|
+
return Object.keys(db.supports.encodings)
|
|
1086
|
+
.filter(k => !!db.supports.encodings[k])
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
const closeResource = function (resource) {
|
|
1090
|
+
return resource.close()
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// Ensure that we don't work with falsy err values, because JavaScript unfortunately
|
|
1094
|
+
// allows Promise.reject(null) and similar patterns. Which'd break `if (err)` logic.
|
|
1095
|
+
const convertRejection = function (reason) {
|
|
1096
|
+
if (reason instanceof Error) {
|
|
1097
|
+
return reason
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
if (Object.prototype.toString.call(reason) === '[object Error]') {
|
|
1101
|
+
return reason
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
const hint = reason === null ? 'null' : typeof reason
|
|
1105
|
+
const msg = `Promise rejection reason must be an Error, received ${hint}`
|
|
1106
|
+
|
|
1107
|
+
return new TypeError(msg)
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// Internal utilities, not typed or exported
|
|
1111
|
+
class NotOpenError extends ModuleError {
|
|
1112
|
+
constructor (cause) {
|
|
1113
|
+
super('Database failed to open', {
|
|
1114
|
+
code: 'LEVEL_DATABASE_NOT_OPEN',
|
|
1115
|
+
cause
|
|
1116
|
+
})
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
class NotClosedError extends ModuleError {
|
|
1121
|
+
constructor (cause) {
|
|
1122
|
+
super('Database failed to close', {
|
|
1123
|
+
code: 'LEVEL_DATABASE_NOT_CLOSED',
|
|
1124
|
+
cause
|
|
1125
|
+
})
|
|
1126
|
+
}
|
|
1127
|
+
}
|