nolo-cli 0.108.0-alpha.2 → 0.108.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (606) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-BY3P5LBB.js → _executeModel-T7PIVJIW.js} +128 -83
  3. package/action-RHUT4OHH.js +23 -0
  4. package/{addContentAction-MB2HHMDZ.js → addContentAction-BQ3LJLUW.js} +19 -13
  5. package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-B6X7BXR4.js} +24 -20
  6. package/{agentDeleteCommand-66KXCSRR.js → agentDeleteCommand-VIDCZAFG.js} +154 -68
  7. package/{agentEmailCommands-63UTONDK.js → agentEmailCommands-PCHDY4ZP.js} +125 -105
  8. package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
  9. package/agentListCommands-QNUAN3YH.js +800 -0
  10. package/{agentMachineCommands-Z6RGPZSG.js → agentMachineCommands-C2TMTQNU.js} +54 -58
  11. package/{agentProviderCommands-X3UNW77C.js → agentProviderCommands-7PCGR77I.js} +97 -2
  12. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-7GCDM4BK.js} +7 -7
  13. package/agentRecordCommands-T4XAUFF5.js +149 -0
  14. package/agentRunCommand-T3AW43I6.js +179 -0
  15. package/{agentRunControl-AVJR4JW4.js → agentRunControl-2CDZNHXV.js} +10 -2
  16. package/{agentRuntimeLocal-E67CTV45.js → agentRuntimeLocal-SQUDRZWE.js} +41 -46
  17. package/{agentSlice-DG5TIQHE.js → agentSlice-HBGFNXUG.js} +22 -16
  18. package/{appDeleteCommands-Z36CLGUK.js → appDeleteCommands-CLLYGEBC.js} +55 -56
  19. package/{appDeployCommands-ECMUWG6S.js → appDeployCommands-HY2NBNDQ.js} +64 -60
  20. package/{appDeployStatusCommands-CL24TDMA.js → appDeployStatusCommands-SGO5GEXH.js} +53 -53
  21. package/{appGetCommands-ITHGOYGJ.js → appGetCommands-ZPYK2N5D.js} +53 -53
  22. package/{appListCommands-EEOSI6RC.js → appListCommands-O2BHIMKS.js} +54 -56
  23. package/{authCommand-HGP2XTKC.js → authCommand-GUIREPHK.js} +132 -83
  24. package/{authCommands-RGOGCPP6.js → authCommands-K3BDSTJ4.js} +10 -7
  25. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MUOUTRNJ.js} +13 -10
  26. package/{chromeCommands-FZYAU75D.js → chromeCommands-Z2WRJB7O.js} +290 -38
  27. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-YWYXZTIR.js} +157 -23
  28. package/{chunk-2F7RJC6L.js → chunk-2C47W7IJ.js} +1 -1
  29. package/chunk-2DRYS3G3.js +13941 -0
  30. package/{chunk-VLTIYV3X.js → chunk-2ECUZDEL.js} +37 -11
  31. package/{chunk-LPIYPEME.js → chunk-2FY3GHBV.js} +1449 -1094
  32. package/{chunk-ALXHV7NK.js → chunk-2GGXHQIW.js} +43 -4
  33. package/{chunk-AHAHBQMU.js → chunk-2OMUAIKR.js} +2 -2
  34. package/{chunk-DHDMC6FO.js → chunk-3CZM6HGQ.js} +53 -23
  35. package/{chunk-BNGW5ASC.js → chunk-3LI5UCTU.js} +23 -3
  36. package/{chunk-FDTR4QJ6.js → chunk-3MZAGMYY.js} +48 -1
  37. package/chunk-3PVYUPXK.js +40 -0
  38. package/{chunk-FV3JEYR3.js → chunk-3SK3J3IF.js} +69 -10
  39. package/chunk-4LCOCOR5.js +50 -0
  40. package/{chunk-V7E4PXQD.js → chunk-4MSYSHZD.js} +15 -7
  41. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  42. package/{chunk-MP64VFGD.js → chunk-4XEYAFLY.js} +60 -18
  43. package/chunk-4YRTZIVN.js +871 -0
  44. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  45. package/{chunk-N7J63Q6C.js → chunk-56GBUMO5.js} +10 -1
  46. package/chunk-5MMAK75Q.js +15 -0
  47. package/{chunk-KZJP33ZK.js → chunk-5WLADF62.js} +90 -36
  48. package/chunk-5XN3OSCT.js +164 -0
  49. package/{chunk-T3GEOSRJ.js → chunk-5YJWHTKD.js} +69 -57
  50. package/chunk-6CCAXGFK.js +1712 -0
  51. package/{chunk-42V6BK2E.js → chunk-6MXDOUMH.js} +18 -36
  52. package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
  53. package/{chunk-J4MOO56S.js → chunk-6VRWNU5J.js} +10 -2
  54. package/{chunk-IQPFGYO3.js → chunk-726TCFLQ.js} +5 -5
  55. package/{chunk-CW67PN7L.js → chunk-7B3BVGU3.js} +61 -11
  56. package/chunk-7DPNBQSV.js +9 -0
  57. package/{chunk-LWKP7AWH.js → chunk-A337PRRR.js} +41 -17
  58. package/chunk-AGIM7IMJ.js +147 -0
  59. package/chunk-AI7XJMMQ.js +1858 -0
  60. package/{chunk-ABQYVJBJ.js → chunk-AIZE5TDM.js} +3 -3
  61. package/{chunk-LJ5VW2UJ.js → chunk-ALKCVCA5.js} +4 -4
  62. package/{chunk-5UTFL4QJ.js → chunk-APO5TOXO.js} +1 -1
  63. package/{chunk-E4MARS3Q.js → chunk-AU7AXHUL.js} +1 -1
  64. package/{chunk-DOTZ5GTO.js → chunk-AWYWIWTU.js} +310 -95
  65. package/chunk-B77W7P7J.js +95 -0
  66. package/{chunk-PBA4UJBK.js → chunk-BFYDNHYW.js} +12 -12
  67. package/{chunk-QTGQ2LTL.js → chunk-BIAETTOB.js} +5 -9
  68. package/{chunk-OIVSQH2O.js → chunk-CGEK73JN.js} +311 -12
  69. package/chunk-CHOZJMJS.js +78 -0
  70. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  71. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  72. package/chunk-EYLGAEB4.js +784 -0
  73. package/{chunk-3BMYXEUW.js → chunk-F2UJW3EK.js} +1 -1
  74. package/{chunk-RVE4DCV3.js → chunk-FBLRSLZH.js} +26 -31
  75. package/{chunk-P5EVSOPA.js → chunk-FWY6BHIJ.js} +363 -248
  76. package/{chunk-4MK3I7Y4.js → chunk-G23MQWLJ.js} +7 -128
  77. package/chunk-G6OOUQWJ.js +417 -0
  78. package/{chunk-WV42OMV7.js → chunk-GHZ2H2HJ.js} +11 -15
  79. package/chunk-I42VC5KR.js +15 -0
  80. package/{chunk-H4AHY5BU.js → chunk-IFALJPEX.js} +69 -20
  81. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  82. package/{chunk-UKWGR5SS.js → chunk-IJERIUXS.js} +242 -1146
  83. package/chunk-IN5UVHHP.js +843 -0
  84. package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
  85. package/{chunk-SYXOBWOC.js → chunk-JGLKZGGZ.js} +124 -703
  86. package/chunk-JJM3WS6W.js +132 -0
  87. package/{chunk-TR22GEUU.js → chunk-JKDL7BRF.js} +20 -11
  88. package/chunk-JONVI6DK.js +593 -0
  89. package/{chunk-SH43IESU.js → chunk-KQ7DAEZ7.js} +202 -32
  90. package/chunk-KWEDNOZZ.js +7546 -0
  91. package/{chunk-6OZ36FXI.js → chunk-KY6GPQ7O.js} +36 -12
  92. package/{chunk-RZGLXO2B.js → chunk-L5YKEQLD.js} +1715 -451
  93. package/{chunk-MRIHM22T.js → chunk-LAVSW2C2.js} +77 -144
  94. package/{chunk-HSSRGGXJ.js → chunk-LNEKN523.js} +10 -7
  95. package/chunk-LWLNLZC5.js +265 -0
  96. package/{chunk-YTLRHRH3.js → chunk-MDOZSLDE.js} +17 -15
  97. package/{chunk-I3TQJXQ7.js → chunk-MHD5JBSS.js} +131 -10
  98. package/{chunk-QU7KDSZX.js → chunk-MW533QT3.js} +190 -8
  99. package/{chunk-4NNTATRH.js → chunk-NLEJWKF5.js} +10394 -8549
  100. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  101. package/{chunk-GQBOR3G6.js → chunk-NN4UUYGB.js} +18 -4
  102. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  103. package/chunk-OKARGYFT.js +15 -0
  104. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  105. package/{chunk-Z5625XML.js → chunk-OYBAT7RT.js} +113 -17
  106. package/chunk-P3SFAHIL.js +134 -0
  107. package/{chunk-XD2MJFUG.js → chunk-PBGO5AFD.js} +1 -1
  108. package/{chunk-EYAQT56M.js → chunk-PFEK4SA2.js} +13 -10
  109. package/{chunk-Z77CRGTW.js → chunk-PHHFVGOJ.js} +1 -1
  110. package/{chunk-3VNWWVKB.js → chunk-PJNFNEJE.js} +114 -28
  111. package/{chunk-HVURBGF3.js → chunk-PWRS2SU2.js} +27 -9
  112. package/chunk-QFEW2ULV.js +42 -0
  113. package/{chunk-IIVGDG4I.js → chunk-QLQ573SU.js} +124 -77
  114. package/chunk-QQ56R7KS.js +88 -0
  115. package/{chunk-PWBDVI4R.js → chunk-QRFI5NHO.js} +269 -141
  116. package/chunk-QYPE3TS3.js +43 -0
  117. package/{chunk-VMFTFOWF.js → chunk-RLRYVSCD.js} +31 -14
  118. package/{chunk-VRTTFDBM.js → chunk-RNNWTMKT.js} +56 -63
  119. package/{chunk-JRQFUXY7.js → chunk-RRQQAG7W.js} +93 -24
  120. package/chunk-SJ3QFSQS.js +1147 -0
  121. package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
  122. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  123. package/{chunk-GNCCNNZD.js → chunk-TSBCYK5F.js} +7 -7
  124. package/chunk-TY3TIUJK.js +89 -0
  125. package/chunk-U4STABYN.js +81 -0
  126. package/chunk-UEILX4EV.js +15 -0
  127. package/{chunk-AODJ7WSF.js → chunk-UIYVU3S4.js} +90 -79
  128. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  129. package/{chunk-7S4YWN7P.js → chunk-V2UPLOXT.js} +4 -4
  130. package/{chunk-LS2ZANRJ.js → chunk-V6WXGTUJ.js} +1 -1
  131. package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
  132. package/{chunk-DVINR3PL.js → chunk-VEA7H5FG.js} +3 -3
  133. package/chunk-VIWDGTDA.js +8 -0
  134. package/chunk-VJVNU77E.js +83 -0
  135. package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
  136. package/{chunk-HKNXJGEC.js → chunk-VSPO4S33.js} +47 -192
  137. package/{chunk-PHXD6JTX.js → chunk-W2N3ZC4P.js} +7 -7
  138. package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
  139. package/{chunk-6Z7MY3V7.js → chunk-WCQNEMXG.js} +3 -3
  140. package/chunk-WJZOQR2J.js +151 -0
  141. package/{chunk-BFDFRLLQ.js → chunk-WW2USJ3C.js} +3 -3
  142. package/chunk-X5BIY654.js +29 -0
  143. package/{chunk-Q554LLSI.js → chunk-XETG4RIX.js} +5 -5
  144. package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
  145. package/{chunk-2OASQKU2.js → chunk-XRXYRHE5.js} +187 -16
  146. package/{chunk-JEDZAO7L.js → chunk-YBNHPX4S.js} +257 -37
  147. package/{chunk-JPGCXHNM.js → chunk-YLMMECCH.js} +1 -1
  148. package/{chunk-6D6VBVEW.js → chunk-YVTZMLXZ.js} +96 -25
  149. package/{chunk-G4VIHCGJ.js → chunk-ZR5RAAVI.js} +35 -30
  150. package/chunk-ZRAU6T47.js +56 -0
  151. package/{chunk-ONXOABJR.js → chunk-ZWQUWF6W.js} +36 -1
  152. package/{cliExecutor-HG3S345O.js → cliExecutor-AWYR3T33.js} +1 -1
  153. package/commandRegistry-3XWUYELA.js +839 -0
  154. package/contentThunks-ALRPUDRE.js +83 -0
  155. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-JFKTYS2D.js} +2 -2
  156. package/{createAgentAutomationAction-7HX7KBES.js → createAgentAutomationAction-XXRXCDFJ.js} +51 -43
  157. package/createDialogAction-FVSAW7WZ.js +75 -0
  158. package/{createPageAction-QWNMGO3O.js → createPageAction-RT6DPYP5.js} +60 -51
  159. package/{chunk-UDIIVXKA.js → cursorProvider-YGGNMVWX.js} +2822 -10269
  160. package/{dbSlice-A6C6H32X.js → dbSlice-JQFBMJ55.js} +18 -12
  161. package/{deleteFile-YG6QMJLU.js → deleteFile-6JWDDRVP.js} +9 -5
  162. package/dialogCommands-K734RXEQ.js +108 -0
  163. package/{dialogSlice-P2K47T3P.js → dialogSlice-GFCT74GI.js} +66 -41
  164. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  165. package/{docCreateCommands-43JKQEIH.js → docCreateCommands-N3KPGP4A.js} +51 -54
  166. package/{docDeleteCommands-RL6D46XE.js → docDeleteCommands-4CR4TXZ7.js} +53 -55
  167. package/{docReadCommands-TOEUEQDG.js → docReadCommands-62XK57VS.js} +50 -53
  168. package/{docStore-3AHKTJRI.js → docStore-Z7KBPFXX.js} +24 -15
  169. package/{docUpdateCommands-FWU5G2XB.js → docUpdateCommands-DRAAWIDC.js} +51 -54
  170. package/{fetchMessages-EIU7UFFK.js → fetchMessages-LM6OMMQQ.js} +5 -4
  171. package/{getPricing-LUSEABA6.js → getPricing-XDF4OLTC.js} +6 -6
  172. package/handleSendMessageAction-NRKUSHK2.js +1849 -0
  173. package/index.js +91 -884
  174. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  175. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-BOETO2TD.js} +2 -2
  176. package/localRuntimeAdapter-S6UEEOSA.js +239 -0
  177. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-YSE6NH7B.js} +12 -9
  178. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-7FBKDEQY.js} +1 -1
  179. package/{machineCommands-TTKK4F7C.js → machineCommands-IQYHOOVH.js} +493 -152
  180. package/machineWsRunDispatch-3ZUMZUGP.js +164 -0
  181. package/{memberThunks-P2ECUJ56.js → memberThunks-Y3Q7GZTG.js} +24 -17
  182. package/{models-T3SG6MJ5.js → models-6V4ZCHEE.js} +2 -2
  183. package/node_modules/abstract-level/CHANGELOG.md +150 -0
  184. package/node_modules/abstract-level/LICENSE +21 -0
  185. package/node_modules/abstract-level/README.md +1957 -0
  186. package/node_modules/abstract-level/UPGRADING.md +669 -0
  187. package/node_modules/abstract-level/abstract-chained-batch.js +397 -0
  188. package/node_modules/abstract-level/abstract-iterator.js +404 -0
  189. package/node_modules/abstract-level/abstract-level.js +1127 -0
  190. package/node_modules/abstract-level/abstract-snapshot.js +84 -0
  191. package/node_modules/abstract-level/index.d.ts +52 -0
  192. package/node_modules/abstract-level/index.js +9 -0
  193. package/node_modules/abstract-level/lib/abstract-sublevel-iterator.js +141 -0
  194. package/node_modules/abstract-level/lib/abstract-sublevel.js +290 -0
  195. package/node_modules/abstract-level/lib/common.js +33 -0
  196. package/node_modules/abstract-level/lib/default-chained-batch.js +29 -0
  197. package/node_modules/abstract-level/lib/default-kv-iterator.js +74 -0
  198. package/node_modules/abstract-level/lib/deferred-iterator.js +110 -0
  199. package/node_modules/abstract-level/lib/deferred-queue.js +84 -0
  200. package/node_modules/abstract-level/lib/errors.js +21 -0
  201. package/node_modules/abstract-level/lib/event-monitor.js +30 -0
  202. package/node_modules/abstract-level/lib/hooks.js +78 -0
  203. package/node_modules/abstract-level/lib/prefixes.js +21 -0
  204. package/node_modules/abstract-level/lib/prewrite-batch.js +96 -0
  205. package/node_modules/abstract-level/lib/range-options.js +26 -0
  206. package/node_modules/abstract-level/package.json +66 -0
  207. package/node_modules/abstract-level/test/async-iterator-test.js +132 -0
  208. package/node_modules/abstract-level/test/batch-test.js +214 -0
  209. package/node_modules/abstract-level/test/chained-batch-test.js +315 -0
  210. package/node_modules/abstract-level/test/clear-range-test.js +262 -0
  211. package/node_modules/abstract-level/test/clear-test.js +110 -0
  212. package/node_modules/abstract-level/test/common.js +90 -0
  213. package/node_modules/abstract-level/test/deferred-open-test.js +209 -0
  214. package/node_modules/abstract-level/test/del-test.js +65 -0
  215. package/node_modules/abstract-level/test/encoding-buffer-test.js +336 -0
  216. package/node_modules/abstract-level/test/encoding-custom-test.js +92 -0
  217. package/node_modules/abstract-level/test/encoding-decode-error-test.js +85 -0
  218. package/node_modules/abstract-level/test/encoding-json-test.js +75 -0
  219. package/node_modules/abstract-level/test/encoding-test.js +130 -0
  220. package/node_modules/abstract-level/test/events/write.js +132 -0
  221. package/node_modules/abstract-level/test/factory-test.js +36 -0
  222. package/node_modules/abstract-level/test/get-many-test.js +157 -0
  223. package/node_modules/abstract-level/test/get-sync-test.js +61 -0
  224. package/node_modules/abstract-level/test/get-test.js +83 -0
  225. package/node_modules/abstract-level/test/has-many-test.js +144 -0
  226. package/node_modules/abstract-level/test/has-test.js +81 -0
  227. package/node_modules/abstract-level/test/hooks/newsub.js +57 -0
  228. package/node_modules/abstract-level/test/hooks/postopen.js +229 -0
  229. package/node_modules/abstract-level/test/hooks/prewrite.js +816 -0
  230. package/node_modules/abstract-level/test/hooks/shared.js +38 -0
  231. package/node_modules/abstract-level/test/index.js +86 -0
  232. package/node_modules/abstract-level/test/iterator-explicit-snapshot-test.js +393 -0
  233. package/node_modules/abstract-level/test/iterator-no-snapshot-test.js +49 -0
  234. package/node_modules/abstract-level/test/iterator-range-test.js +277 -0
  235. package/node_modules/abstract-level/test/iterator-seek-test.js +335 -0
  236. package/node_modules/abstract-level/test/iterator-snapshot-test.js +56 -0
  237. package/node_modules/abstract-level/test/iterator-test.js +621 -0
  238. package/node_modules/abstract-level/test/manifest-test.js +21 -0
  239. package/node_modules/abstract-level/test/open-create-if-missing-test.js +39 -0
  240. package/node_modules/abstract-level/test/open-error-if-exists-test.js +25 -0
  241. package/node_modules/abstract-level/test/open-test.js +263 -0
  242. package/node_modules/abstract-level/test/put-get-del-test.js +97 -0
  243. package/node_modules/abstract-level/test/put-test.js +70 -0
  244. package/node_modules/abstract-level/test/self/abstract-iterator-test.js +182 -0
  245. package/node_modules/abstract-level/test/self/async-iterator-test.js +242 -0
  246. package/node_modules/abstract-level/test/self/attach-resource-test.js +74 -0
  247. package/node_modules/abstract-level/test/self/defer-test.js +140 -0
  248. package/node_modules/abstract-level/test/self/deferred-iterator-test.js +314 -0
  249. package/node_modules/abstract-level/test/self/deferred-operations-test.js +86 -0
  250. package/node_modules/abstract-level/test/self/deferred-queue-test.js +93 -0
  251. package/node_modules/abstract-level/test/self/encoding-test.js +391 -0
  252. package/node_modules/abstract-level/test/self/errors-test.js +11 -0
  253. package/node_modules/abstract-level/test/self/iterator-test.js +1050 -0
  254. package/node_modules/abstract-level/test/self/sublevel-test.js +1039 -0
  255. package/node_modules/abstract-level/test/self.js +905 -0
  256. package/node_modules/abstract-level/test/sublevel-test.js +209 -0
  257. package/node_modules/abstract-level/test/traits/closed.js +42 -0
  258. package/node_modules/abstract-level/test/traits/index.js +4 -0
  259. package/node_modules/abstract-level/test/traits/open.js +62 -0
  260. package/node_modules/abstract-level/test/util.js +275 -0
  261. package/node_modules/abstract-level/types/abstract-chained-batch.d.ts +124 -0
  262. package/node_modules/abstract-level/types/abstract-iterator.d.ts +241 -0
  263. package/node_modules/abstract-level/types/abstract-level.d.ts +636 -0
  264. package/node_modules/abstract-level/types/abstract-snapshot.d.ts +30 -0
  265. package/node_modules/abstract-level/types/abstract-sublevel.d.ts +76 -0
  266. package/node_modules/abstract-level/types/interfaces.d.ts +43 -0
  267. package/node_modules/base64-js/LICENSE +21 -0
  268. package/node_modules/base64-js/README.md +34 -0
  269. package/node_modules/base64-js/base64js.min.js +1 -0
  270. package/node_modules/base64-js/index.d.ts +3 -0
  271. package/node_modules/base64-js/index.js +150 -0
  272. package/node_modules/base64-js/package.json +47 -0
  273. package/node_modules/browser-level/CHANGELOG.md +44 -0
  274. package/node_modules/browser-level/LICENSE +21 -0
  275. package/node_modules/browser-level/README.md +124 -0
  276. package/node_modules/browser-level/UPGRADING.md +143 -0
  277. package/node_modules/browser-level/index.d.ts +108 -0
  278. package/node_modules/browser-level/index.js +323 -0
  279. package/node_modules/browser-level/iterator.js +239 -0
  280. package/node_modules/browser-level/package.json +48 -0
  281. package/node_modules/browser-level/util/clear.js +38 -0
  282. package/node_modules/browser-level/util/deserialize.js +17 -0
  283. package/node_modules/browser-level/util/key-range.js +20 -0
  284. package/node_modules/buffer/AUTHORS.md +73 -0
  285. package/node_modules/buffer/LICENSE +21 -0
  286. package/node_modules/buffer/README.md +410 -0
  287. package/node_modules/buffer/index.d.ts +194 -0
  288. package/node_modules/buffer/index.js +2106 -0
  289. package/node_modules/buffer/package.json +93 -0
  290. package/node_modules/classic-level/CHANGELOG.md +115 -0
  291. package/node_modules/classic-level/LICENSE +21 -0
  292. package/node_modules/classic-level/README.md +274 -0
  293. package/node_modules/classic-level/UPGRADING.md +131 -0
  294. package/node_modules/classic-level/binding.cc +2652 -0
  295. package/node_modules/classic-level/binding.gyp +71 -0
  296. package/node_modules/classic-level/binding.js +1 -0
  297. package/node_modules/classic-level/chained-batch.js +35 -0
  298. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/LICENSE +27 -0
  299. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/Makefile +424 -0
  300. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/build_detect_platform +256 -0
  301. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/autocompact_test.cc +118 -0
  302. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/builder.cc +88 -0
  303. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/builder.h +34 -0
  304. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/c.cc +595 -0
  305. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/c_test.c +390 -0
  306. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/corruption_test.cc +374 -0
  307. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_bench.cc +1020 -0
  308. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_impl.cc +1568 -0
  309. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_impl.h +212 -0
  310. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_iter.cc +317 -0
  311. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_iter.h +28 -0
  312. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/db_test.cc +2158 -0
  313. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dbformat.cc +140 -0
  314. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dbformat.h +230 -0
  315. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dbformat_test.cc +112 -0
  316. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/dumpfile.cc +225 -0
  317. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/fault_injection_test.cc +554 -0
  318. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/filename.cc +144 -0
  319. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/filename.h +85 -0
  320. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/filename_test.cc +123 -0
  321. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/leveldbutil.cc +64 -0
  322. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_format.h +35 -0
  323. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_reader.cc +284 -0
  324. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_reader.h +113 -0
  325. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_test.cc +591 -0
  326. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_writer.cc +112 -0
  327. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/log_writer.h +54 -0
  328. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/memtable.cc +145 -0
  329. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/memtable.h +89 -0
  330. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/recovery_test.cc +324 -0
  331. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/repair.cc +461 -0
  332. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/skiplist.h +384 -0
  333. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/skiplist_test.cc +378 -0
  334. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/snapshot.h +67 -0
  335. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/table_cache.cc +127 -0
  336. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/table_cache.h +61 -0
  337. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_edit.cc +266 -0
  338. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_edit.h +107 -0
  339. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_edit_test.cc +46 -0
  340. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_set.cc +1535 -0
  341. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_set.h +399 -0
  342. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/version_set_test.cc +179 -0
  343. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/write_batch.cc +147 -0
  344. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/write_batch_internal.h +50 -0
  345. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/db/write_batch_test.cc +120 -0
  346. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/helpers/memenv/memenv.cc +398 -0
  347. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/helpers/memenv/memenv.h +20 -0
  348. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/helpers/memenv/memenv_test.cc +241 -0
  349. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/c.h +290 -0
  350. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/cache.h +110 -0
  351. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/comparator.h +63 -0
  352. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/db.h +164 -0
  353. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/dumpfile.h +25 -0
  354. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/env.h +351 -0
  355. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/filter_policy.h +70 -0
  356. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/iterator.h +100 -0
  357. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/options.h +213 -0
  358. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/slice.h +109 -0
  359. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/status.h +112 -0
  360. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/table.h +85 -0
  361. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/table_builder.h +92 -0
  362. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/value_sink.h +26 -0
  363. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/include/leveldb/write_batch.h +64 -0
  364. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/issues/issue178_test.cc +92 -0
  365. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/issues/issue200_test.cc +59 -0
  366. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/atomic_pointer.h +242 -0
  367. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port.h +21 -0
  368. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_example.h +141 -0
  369. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_posix.cc +53 -0
  370. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_posix.h +156 -0
  371. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/port_posix_sse.cc +129 -0
  372. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/thread_annotations.h +60 -0
  373. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/port/win/stdint.h +24 -0
  374. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block.cc +268 -0
  375. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block.h +44 -0
  376. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block_builder.cc +109 -0
  377. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/block_builder.h +57 -0
  378. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/filter_block.cc +111 -0
  379. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/filter_block.h +68 -0
  380. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/filter_block_test.cc +128 -0
  381. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/format.cc +144 -0
  382. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/format.h +108 -0
  383. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/iterator.cc +67 -0
  384. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/iterator_wrapper.h +66 -0
  385. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/merger.cc +197 -0
  386. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/merger.h +26 -0
  387. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/table.cc +285 -0
  388. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/table_builder.cc +270 -0
  389. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/table_test.cc +876 -0
  390. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/two_level_iterator.cc +182 -0
  391. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/table/two_level_iterator.h +34 -0
  392. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/arena.cc +68 -0
  393. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/arena.h +68 -0
  394. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/arena_test.cc +68 -0
  395. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/bloom.cc +95 -0
  396. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/bloom_test.cc +162 -0
  397. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/cache.cc +405 -0
  398. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/cache_test.cc +226 -0
  399. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/coding.cc +194 -0
  400. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/coding.h +104 -0
  401. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/coding_test.cc +196 -0
  402. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/comparator.cc +81 -0
  403. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/crc32c.cc +350 -0
  404. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/crc32c.h +45 -0
  405. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/crc32c_test.cc +72 -0
  406. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env.cc +100 -0
  407. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_posix.cc +695 -0
  408. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_posix_test.cc +66 -0
  409. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_posix_test_helper.h +28 -0
  410. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/env_test.cc +106 -0
  411. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/filter_policy.cc +11 -0
  412. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/hash.cc +52 -0
  413. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/hash.h +19 -0
  414. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/hash_test.cc +54 -0
  415. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/histogram.cc +139 -0
  416. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/histogram.h +42 -0
  417. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/logging.cc +72 -0
  418. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/logging.h +43 -0
  419. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/mutexlock.h +41 -0
  420. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/options.cc +30 -0
  421. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/posix_logger.h +98 -0
  422. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/random.h +64 -0
  423. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/status.cc +75 -0
  424. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testharness.cc +77 -0
  425. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testharness.h +138 -0
  426. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testutil.cc +51 -0
  427. package/node_modules/classic-level/deps/leveldb/leveldb-1.20/util/testutil.h +63 -0
  428. package/node_modules/classic-level/deps/leveldb/leveldb.gyp +282 -0
  429. package/node_modules/classic-level/deps/leveldb/patches/001-value-sink.patch +164 -0
  430. package/node_modules/classic-level/deps/leveldb/port-libuv/atomic_pointer_win.h +48 -0
  431. package/node_modules/classic-level/deps/leveldb/port-libuv/env_win.cc +692 -0
  432. package/node_modules/classic-level/deps/leveldb/port-libuv/port_uv.cc +36 -0
  433. package/node_modules/classic-level/deps/leveldb/port-libuv/port_uv.h +157 -0
  434. package/node_modules/classic-level/deps/leveldb/port-libuv/port_uv.h.bak +153 -0
  435. package/node_modules/classic-level/deps/leveldb/port-libuv/stdint-msvc2008.h +247 -0
  436. package/node_modules/classic-level/deps/leveldb/port-libuv/uv_condvar.h +45 -0
  437. package/node_modules/classic-level/deps/leveldb/port-libuv/uv_condvar_posix.cc +139 -0
  438. package/node_modules/classic-level/deps/leveldb/port-libuv/win_logger.cc +79 -0
  439. package/node_modules/classic-level/deps/leveldb/port-libuv/win_logger.h +28 -0
  440. package/node_modules/classic-level/deps/snappy/freebsd/config.h +135 -0
  441. package/node_modules/classic-level/deps/snappy/freebsd/snappy-stubs-public.h +100 -0
  442. package/node_modules/classic-level/deps/snappy/linux/config.h +135 -0
  443. package/node_modules/classic-level/deps/snappy/linux/snappy-stubs-public.h +100 -0
  444. package/node_modules/classic-level/deps/snappy/mac/config.h +137 -0
  445. package/node_modules/classic-level/deps/snappy/mac/snappy-stubs-public.h +100 -0
  446. package/node_modules/classic-level/deps/snappy/openbsd/config.h +135 -0
  447. package/node_modules/classic-level/deps/snappy/openbsd/snappy-stubs-public.h +100 -0
  448. package/node_modules/classic-level/deps/snappy/snappy/COPYING +54 -0
  449. package/node_modules/classic-level/deps/snappy/snappy/cmake/SnappyConfig.cmake +1 -0
  450. package/node_modules/classic-level/deps/snappy/snappy/cmake/config.h.in +62 -0
  451. package/node_modules/classic-level/deps/snappy/snappy/snappy-c.cc +90 -0
  452. package/node_modules/classic-level/deps/snappy/snappy/snappy-c.h +138 -0
  453. package/node_modules/classic-level/deps/snappy/snappy/snappy-internal.h +224 -0
  454. package/node_modules/classic-level/deps/snappy/snappy/snappy-sinksource.cc +104 -0
  455. package/node_modules/classic-level/deps/snappy/snappy/snappy-sinksource.h +182 -0
  456. package/node_modules/classic-level/deps/snappy/snappy/snappy-stubs-internal.cc +42 -0
  457. package/node_modules/classic-level/deps/snappy/snappy/snappy-stubs-internal.h +561 -0
  458. package/node_modules/classic-level/deps/snappy/snappy/snappy-stubs-public.h.in +94 -0
  459. package/node_modules/classic-level/deps/snappy/snappy/snappy-test.cc +612 -0
  460. package/node_modules/classic-level/deps/snappy/snappy/snappy-test.h +573 -0
  461. package/node_modules/classic-level/deps/snappy/snappy/snappy.cc +1515 -0
  462. package/node_modules/classic-level/deps/snappy/snappy/snappy.h +203 -0
  463. package/node_modules/classic-level/deps/snappy/snappy/snappy_unittest.cc +1410 -0
  464. package/node_modules/classic-level/deps/snappy/snappy.gyp +119 -0
  465. package/node_modules/classic-level/deps/snappy/solaris/config.h +135 -0
  466. package/node_modules/classic-level/deps/snappy/solaris/snappy-stubs-public.h +100 -0
  467. package/node_modules/classic-level/deps/snappy/win32/config.h +29 -0
  468. package/node_modules/classic-level/deps/snappy/win32/snappy-stubs-public.h +100 -0
  469. package/node_modules/classic-level/index.d.ts +343 -0
  470. package/node_modules/classic-level/index.js +311 -0
  471. package/node_modules/classic-level/iterator.js +122 -0
  472. package/node_modules/classic-level/package.json +70 -0
  473. package/node_modules/classic-level/prebuilds/android-arm/classic-level.armv7.node +0 -0
  474. package/node_modules/classic-level/prebuilds/android-arm64/classic-level.armv8.node +0 -0
  475. package/node_modules/classic-level/prebuilds/darwin-x64+arm64/classic-level.node +0 -0
  476. package/node_modules/classic-level/prebuilds/linux-arm/classic-level.armv6.node +0 -0
  477. package/node_modules/classic-level/prebuilds/linux-arm/classic-level.armv7.node +0 -0
  478. package/node_modules/classic-level/prebuilds/linux-arm64/classic-level.armv8.node +0 -0
  479. package/node_modules/classic-level/prebuilds/linux-x64/classic-level.musl.node +0 -0
  480. package/node_modules/classic-level/prebuilds/linux-x64/classic-level.node +0 -0
  481. package/node_modules/classic-level/prebuilds/win32-ia32/classic-level.node +0 -0
  482. package/node_modules/classic-level/prebuilds/win32-x64/classic-level.node +0 -0
  483. package/node_modules/ieee754/LICENSE +11 -0
  484. package/node_modules/ieee754/README.md +51 -0
  485. package/node_modules/ieee754/index.d.ts +10 -0
  486. package/node_modules/ieee754/index.js +85 -0
  487. package/node_modules/ieee754/package.json +52 -0
  488. package/node_modules/is-buffer/LICENSE +21 -0
  489. package/node_modules/is-buffer/README.md +54 -0
  490. package/node_modules/is-buffer/index.d.ts +2 -0
  491. package/node_modules/is-buffer/index.js +11 -0
  492. package/node_modules/is-buffer/package.json +65 -0
  493. package/node_modules/level/CHANGELOG.md +532 -0
  494. package/node_modules/level/LICENSE +21 -0
  495. package/node_modules/level/README.md +107 -0
  496. package/node_modules/level/UPGRADING.md +413 -0
  497. package/node_modules/level/browser.js +1 -0
  498. package/node_modules/level/index.d.ts +75 -0
  499. package/node_modules/level/index.js +1 -0
  500. package/node_modules/level/package.json +62 -0
  501. package/node_modules/level-supports/CHANGELOG.md +140 -0
  502. package/node_modules/level-supports/LICENSE +21 -0
  503. package/node_modules/level-supports/README.md +276 -0
  504. package/node_modules/level-supports/index.d.ts +137 -0
  505. package/node_modules/level-supports/index.js +26 -0
  506. package/node_modules/level-supports/package.json +46 -0
  507. package/node_modules/level-supports/test/cloneable.js +26 -0
  508. package/node_modules/level-supports/test/index.js +24 -0
  509. package/node_modules/level-supports/test/self.js +86 -0
  510. package/node_modules/level-supports/test/shape.js +23 -0
  511. package/node_modules/level-transcoder/CHANGELOG.md +15 -0
  512. package/node_modules/level-transcoder/LICENSE +21 -0
  513. package/node_modules/level-transcoder/README.md +214 -0
  514. package/node_modules/level-transcoder/UPGRADING.md +13 -0
  515. package/node_modules/level-transcoder/index.d.ts +27 -0
  516. package/node_modules/level-transcoder/index.js +158 -0
  517. package/node_modules/level-transcoder/lib/encoding.d.ts +158 -0
  518. package/node_modules/level-transcoder/lib/encoding.js +105 -0
  519. package/node_modules/level-transcoder/lib/encodings.d.ts +9 -0
  520. package/node_modules/level-transcoder/lib/encodings.js +135 -0
  521. package/node_modules/level-transcoder/lib/formats.d.ts +13 -0
  522. package/node_modules/level-transcoder/lib/formats.js +111 -0
  523. package/node_modules/level-transcoder/lib/text-endec.d.ts +6 -0
  524. package/node_modules/level-transcoder/lib/text-endec.js +19 -0
  525. package/node_modules/level-transcoder/package.json +46 -0
  526. package/node_modules/maybe-combine-errors/LICENSE.md +21 -0
  527. package/node_modules/maybe-combine-errors/README.md +94 -0
  528. package/node_modules/maybe-combine-errors/index.js +60 -0
  529. package/node_modules/maybe-combine-errors/package.json +33 -0
  530. package/node_modules/module-error/CHANGELOG.md +23 -0
  531. package/node_modules/module-error/LICENSE +21 -0
  532. package/node_modules/module-error/README.md +89 -0
  533. package/node_modules/module-error/index.d.ts +18 -0
  534. package/node_modules/module-error/index.js +22 -0
  535. package/node_modules/module-error/package.json +36 -0
  536. package/node_modules/napi-macros/LICENSE +21 -0
  537. package/node_modules/napi-macros/README.md +277 -0
  538. package/node_modules/napi-macros/index.js +1 -0
  539. package/node_modules/napi-macros/napi-macros.h +255 -0
  540. package/node_modules/napi-macros/package.json +22 -0
  541. package/node_modules/node-gyp-build/LICENSE +21 -0
  542. package/node_modules/node-gyp-build/README.md +58 -0
  543. package/node_modules/node-gyp-build/SECURITY.md +5 -0
  544. package/node_modules/node-gyp-build/bin.js +84 -0
  545. package/node_modules/node-gyp-build/build-test.js +19 -0
  546. package/node_modules/node-gyp-build/index.js +6 -0
  547. package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  548. package/node_modules/node-gyp-build/optional.js +7 -0
  549. package/node_modules/node-gyp-build/package.json +43 -0
  550. package/oauthTokenStore-PADKLNOC.js +23 -0
  551. package/package.json +6 -3
  552. package/processSpawn-SOAV3FEV.js +11 -0
  553. package/profileConfig-ZGOFORWV.js +43 -0
  554. package/{providerPresetApply-XI3WUPTI.js → providerPresetApply-HIPK67DU.js} +9 -9
  555. package/{providerRegistry-KEPWWGXD.js → providerRegistry-AI4U2FNM.js} +13 -9
  556. package/{read-COE3ZYR6.js → read-RNUQ7F34.js} +11 -7
  557. package/{readDocTool-5USN4A6V.js → readDocTool-6WIZHE6O.js} +5 -3
  558. package/{readlineWorkspace-KIMUDPPV.js → readlineWorkspace-BCDVMOR5.js} +6947 -3879
  559. package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-EFQ4O2IQ.js} +27 -26
  560. package/{runAgentClientLoop-AN4WIRPQ.js → runAgentClientLoop-5RBD3DE6.js} +150 -90
  561. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-5CIWJEZ3.js} +36 -8
  562. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  563. package/setDialogExtraReferencesAction-MXAH2KPV.js +37 -0
  564. package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-7OPVNK4M.js} +28 -27
  565. package/{chunk-GP5LKBUZ.js → settingThunks-GHVLHABJ.js} +240 -945
  566. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-QC35EQY4.js} +3 -3
  567. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  568. package/{spaceCommands-NA4JMIGT.js → spaceCommands-WZCLRGBO.js} +56 -56
  569. package/{streamAgentChatTurn-3TYTHZPJ.js → streamAgentChatTurn-YJTEHUH7.js} +371 -1556
  570. package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-4PANDG3L.js} +24 -20
  571. package/{tableCommands-O6NWHFKV.js → tableCommands-U3QDY4L6.js} +19 -17
  572. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-54CXTU7C.js} +5 -4
  573. package/tools-ZT4GXXDQ.js +122 -0
  574. package/{tuiSummaryLlmCaller-UFGFOIIW.js → tuiSummaryLlmCaller-ISODIW2O.js} +14 -29
  575. package/{updateCommands-2M74UL7P.js → updateCommands-NQXAGFM7.js} +3 -3
  576. package/{updateDialogTitleAction-RDHNT265.js → updateDialogTitleAction-2PQTFUUV.js} +101 -57
  577. package/action-P4TNFGAD.js +0 -31
  578. package/agentListCommands-NXCOTTZL.js +0 -411
  579. package/agentRecordCommands-JP54ZWND.js +0 -129
  580. package/agentRunCommand-RMQWWSHF.js +0 -157
  581. package/browser-image-compression-MFDTD7K6.js +0 -1763
  582. package/chatQueueReduxAdapter-DKLWTT3G.js +0 -186
  583. package/chunk-ACTMNVHM.js +0 -93
  584. package/chunk-CQ3WA2NE.js +0 -299
  585. package/chunk-M76ECQRD.js +0 -13658
  586. package/chunk-MEYIRKDN.js +0 -8967
  587. package/chunk-N4G4PKQ6.js +0 -23
  588. package/chunk-P3GYTNDF.js +0 -34
  589. package/chunk-PUOC4YRO.js +0 -394
  590. package/chunk-S7Z2HMCN.js +0 -25
  591. package/chunk-Y5GCAMGP.js +0 -9
  592. package/chunk-YPREESF4.js +0 -225
  593. package/chunk-YWIEQS6H.js +0 -21409
  594. package/contentThunks-JHK6X2KU.js +0 -73
  595. package/createDialogAction-VUUUZL54.js +0 -65
  596. package/dialogCommands-EN7TYD3I.js +0 -100
  597. package/handleSendMessageAction-ID5IKXUE.js +0 -633
  598. package/machineWsRunDispatch-RX64L3ET.js +0 -145
  599. package/setDialogExtraReferencesAction-WX5VTY6O.js +0 -30
  600. package/settingSlice-P4ZW7K5X.js +0 -204
  601. package/syncMapping-N6RGXGBW.js +0 -437
  602. package/tools-34SEJSLQ.js +0 -110
  603. package/{chunk-SV5IJK6K.js → chunk-NBTY7YJF.js} +3 -3
  604. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  605. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
  606. 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
+ }