nolo-cli 0.226.0-alpha.1 → 0.226.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.
Files changed (259) hide show
  1. package/README.md +3 -5
  2. package/{_executeModel-UE2NJPZD.js → _executeModel-IZ2MCXHO.js} +89 -83
  3. package/{action-CK64LS6S.js → action-VDEW6WLI.js} +9 -6
  4. package/{addContentAction-EQXMFNPR.js → addContentAction-7YVXHIPQ.js} +15 -14
  5. package/{addDialogAgentAction-RSDZDASD.js → addDialogAgentAction-BX7B47HF.js} +18 -17
  6. package/{agentDeleteCommand-SOI25WK7.js → agentDeleteCommand-N7ELXPLD.js} +145 -138
  7. package/{agentEmailCommands-UGWQQNKM.js → agentEmailCommands-OFS477PV.js} +144 -133
  8. package/{agentFavoriteCommands-2LKGKSUD.js → agentFavoriteCommands-7LOP3HUD.js} +5 -5
  9. package/{agentGrantCommands-QQV4N4JW.js → agentGrantCommands-L6O2HVJI.js} +5 -5
  10. package/agentListCommands-IQQHJSXP.js +644 -0
  11. package/{agentMachineCommands-M6IKO7XE.js → agentMachineCommands-NS65BEW7.js} +75 -66
  12. package/{agentProviderCommands-7BSJH7TO.js → agentProviderCommands-SS6M6VGY.js} +6 -6
  13. package/{agentPullCommand-XN6ZPBUW.js → agentPullCommand-QQQZSC6S.js} +6 -6
  14. package/agentRecordCommands-4VE7CNLC.js +188 -0
  15. package/agentRunCommand-2MUXHKNW.js +223 -0
  16. package/{agentRunControl-DFEEOFC7.js → agentRunControl-55GL6Q3M.js} +23 -15
  17. package/{agentRuntimeLocal-GSTYFEX4.js → agentRuntimeLocal-5DB2P4MU.js} +63 -49
  18. package/{agentSlice-7PTNWEED.js → agentSlice-5VTAFG43.js} +19 -18
  19. package/{appDeleteCommands-L7HL4AWF.js → appDeleteCommands-EDKUPHJM.js} +67 -58
  20. package/{appDeployCommands-SGSUNFZR.js → appDeployCommands-JO74GW4L.js} +67 -58
  21. package/{appDeployStatusCommands-AAA3XD54.js → appDeployStatusCommands-U77ZUHX7.js} +67 -58
  22. package/{appGetCommands-LN72GAOA.js → appGetCommands-QCMHBYPX.js} +67 -58
  23. package/{appListCommands-IJQQ3VND.js → appListCommands-ZQJYEXI6.js} +67 -58
  24. package/{authCommand-7JXW54U4.js → authCommand-W4KXRZLI.js} +33 -28
  25. package/{authCommands-YDNAIDEY.js → authCommands-6AUYO65N.js} +15 -10
  26. package/{builtinSkillRegistry-PXH7EGQB.js → builtinSkillRegistry-GHE3RD3V.js} +8 -8
  27. package/{chromeCommands-G5UDKVSV.js → chromeCommands-S7AW3AOD.js} +383 -6
  28. package/{chromeOpsCommands-YKX2QX3A.js → chromeOpsCommands-TBPM6MR4.js} +6 -6
  29. package/{chunk-7Z6EW7AH.js → chunk-247AAJRK.js} +13 -6
  30. package/{chunk-P2ZLUIW2.js → chunk-2BSLGODA.js} +350 -25
  31. package/{chunk-4HFTBHBF.js → chunk-2N4UBHUU.js} +8 -8
  32. package/chunk-2SXN7LAY.js +15 -0
  33. package/{chunk-GSAS72AN.js → chunk-2T5BHLID.js} +2871 -1565
  34. package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
  35. package/{chunk-VFBVA3U2.js → chunk-3OQFXODL.js} +131 -40
  36. package/{chunk-BGGHA5DV.js → chunk-3ORFJP2Z.js} +1 -1
  37. package/{chunk-OWH2BLNU.js → chunk-3UNAGTBW.js} +32 -95
  38. package/{chunk-LM2PS3YS.js → chunk-4F7SWSWO.js} +26 -13
  39. package/{chunk-SBVTHMEG.js → chunk-4FE3IWRE.js} +1 -1
  40. package/{chunk-GOAPXKQU.js → chunk-4UK6UBXF.js} +4 -4
  41. package/{chunk-4JVNURX4.js → chunk-4YFC3DWW.js} +68 -16
  42. package/chunk-4ZCTKB27.js +31 -0
  43. package/chunk-53W5BXLN.js +340 -0
  44. package/{chunk-TD6QCQ5G.js → chunk-5GRWWUB4.js} +4 -4
  45. package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
  46. package/{chunk-ZH6MUQEO.js → chunk-6326DRQY.js} +1 -1
  47. package/{chunk-AVHRSJUH.js → chunk-6MQWGA5F.js} +31 -24
  48. package/{chunk-67BE44IS.js → chunk-6MX6S6TE.js} +3 -3
  49. package/chunk-6RSNVJGO.js +279 -0
  50. package/{chunk-BRW24CTE.js → chunk-6S6CZUXK.js} +42 -33
  51. package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
  52. package/{chunk-CVS5IMJ5.js → chunk-6XLWUNZB.js} +25 -25
  53. package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
  54. package/{chunk-62HXNQVV.js → chunk-776CXKMX.js} +1 -1
  55. package/{chunk-6J4TTPS2.js → chunk-7AWKDRXG.js} +5 -5
  56. package/{chunk-3KNEE64G.js → chunk-7GTXPS3D.js} +16 -16
  57. package/{chunk-FS3RA7D2.js → chunk-7HUHOCIY.js} +147 -162
  58. package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
  59. package/chunk-BEM6LPD2.js +734 -0
  60. package/{chunk-AGP3YSEC.js → chunk-BH7CEVOH.js} +46 -1
  61. package/chunk-BIDSIRTS.js +307 -0
  62. package/{chunk-VTW7VKZX.js → chunk-C4KX626C.js} +15 -15
  63. package/chunk-C5A54QS7.js +108 -0
  64. package/{chunk-4PMZVBDU.js → chunk-CHYYSFFM.js} +6 -6
  65. package/{chunk-VREDDN25.js → chunk-CJTB3OYB.js} +14 -9
  66. package/{chunk-YFLVRVYK.js → chunk-DLT2DN4M.js} +1 -1
  67. package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
  68. package/{chunk-EOWLBDY6.js → chunk-DOK7GDRU.js} +1 -1
  69. package/{chunk-5NC6A2RZ.js → chunk-DPAIQLAL.js} +105 -102
  70. package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
  71. package/{chunk-XN23AUVU.js → chunk-EKXPHL7M.js} +8 -5
  72. package/{chunk-DISQCYPE.js → chunk-ENYTIRIO.js} +6 -6
  73. package/{chunk-2TIQO6TC.js → chunk-ER3P6MBT.js} +206 -308
  74. package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
  75. package/{chunk-JM5C4EUA.js → chunk-F4MCAOWN.js} +6 -6
  76. package/chunk-FDZ2GBWO.js +166 -0
  77. package/{chunk-PMDVQBGA.js → chunk-GAHJLSDO.js} +14 -7
  78. package/{chunk-N5PQJKCY.js → chunk-GES5GIAU.js} +14 -13
  79. package/{chunk-HYHIAM6T.js → chunk-HQVNO7FH.js} +66 -35
  80. package/chunk-HSWEFHFS.js +103 -0
  81. package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
  82. package/{chunk-F7DU25CE.js → chunk-IIG3TT73.js} +460 -123
  83. package/{chunk-AK5O76CC.js → chunk-IZJFTY4R.js} +3 -3
  84. package/{chunk-2VA6TU4I.js → chunk-J25ESVUW.js} +22 -19
  85. package/{chunk-TUIWP2LF.js → chunk-J2XZZXIH.js} +4 -4
  86. package/{chunk-JVRQ6YVK.js → chunk-JBWXPACD.js} +1 -1
  87. package/{chunk-D726I5AZ.js → chunk-JVJ53XCH.js} +2 -2
  88. package/{chunk-TXGQ4O5S.js → chunk-KC2QVCI7.js} +20 -174
  89. package/{chunk-UKS7D2NL.js → chunk-KF2DWSAH.js} +113 -28
  90. package/chunk-KK3FCYZM.js +647 -0
  91. package/{chunk-ZZ4M2I3R.js → chunk-KLD7K5FD.js} +349 -16
  92. package/{chunk-JIADJPUV.js → chunk-KMW5CRRM.js} +1564 -2955
  93. package/{chunk-N5Z2V73W.js → chunk-LELADM5Q.js} +1 -1
  94. package/{chunk-4NA3YTBC.js → chunk-LMFMV5UC.js} +8 -8
  95. package/{chunk-KZU52OJ5.js → chunk-LZOOUQAZ.js} +6 -6
  96. package/{chunk-VV7TXWOC.js → chunk-M5EA44QU.js} +6 -6
  97. package/{chunk-UYOICCYG.js → chunk-MEDPR36J.js} +64 -89
  98. package/chunk-MFXJY44K.js +133 -0
  99. package/chunk-MVOZ22RZ.js +26 -0
  100. package/{chunk-3QFLXA24.js → chunk-N6EN3HK3.js} +3 -3
  101. package/{chunk-SOF4OWDM.js → chunk-NEG5LYK5.js} +1 -3
  102. package/{chunk-HJAO2NAL.js → chunk-ODGSLWLO.js} +593 -370
  103. package/{chunk-OB6DVWPF.js → chunk-OGZE6BZG.js} +331 -99
  104. package/{chunk-KYH7XW3K.js → chunk-OJRTTERA.js} +77 -2
  105. package/{chunk-2VUZSVAS.js → chunk-OKPC4QNX.js} +57 -20
  106. package/{chunk-SOG7OEXX.js → chunk-ONFFUQYM.js} +1 -1
  107. package/{chunk-KNIIRXHF.js → chunk-P244EH4W.js} +46 -8
  108. package/chunk-P27E22MA.js +203 -0
  109. package/{chunk-YDBMZ7FV.js → chunk-PK7VT4ZU.js} +3 -3
  110. package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
  111. package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
  112. package/{chunk-5RKUPJYL.js → chunk-QLUYDJST.js} +11 -3
  113. package/{chunk-EVPIBQ5I.js → chunk-QUJKDFZW.js} +17 -17
  114. package/{chunk-C4VAR65S.js → chunk-QXUVCIPB.js} +204 -124
  115. package/{chunk-X4OVEYPX.js → chunk-QYNABNNQ.js} +13 -13
  116. package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
  117. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  118. package/{chunk-KC4SCKXO.js → chunk-RGUWOMXU.js} +1234 -1451
  119. package/{chunk-IZIN2UNJ.js → chunk-RH44TIHX.js} +206 -27
  120. package/{chunk-GNHMRBYZ.js → chunk-RIMFTQMC.js} +282 -58
  121. package/{chunk-VQUWV3YR.js → chunk-S25VJYXV.js} +9 -3
  122. package/{chunk-X7YC2OHB.js → chunk-SBRJOYND.js} +723 -355
  123. package/{chunk-UEKXWO7A.js → chunk-SBRSXY67.js} +18 -7
  124. package/chunk-SR4FE5VD.js +9 -0
  125. package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
  126. package/chunk-T3WSFTBS.js +62 -0
  127. package/{chunk-KEN3N2TN.js → chunk-TB5KTLNB.js} +15 -12
  128. package/{chunk-VP3BINY7.js → chunk-TOK555CQ.js} +31 -1
  129. package/{chunk-OBSEKCVK.js → chunk-U4VSBDO5.js} +88 -0
  130. package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
  131. package/{chunk-GGKNJ42M.js → chunk-UDT4SI37.js} +18 -108
  132. package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
  133. package/{chunk-GVGOEMNV.js → chunk-UQXOORR3.js} +5 -5
  134. package/{chunk-GS4OTYCH.js → chunk-UR7555FE.js} +9 -9
  135. package/{chunk-QLFCTYRH.js → chunk-UWOCASVL.js} +20 -13
  136. package/{chunk-C4WTX5TU.js → chunk-V2V5Q6DU.js} +2 -2
  137. package/{chunk-2ZKFCIJJ.js → chunk-VCU5GV42.js} +1 -1
  138. package/{chunk-FTQWYWUI.js → chunk-VMWY7TUA.js} +1 -1
  139. package/chunk-VNALJT32.js +33394 -0
  140. package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
  141. package/chunk-WBSJAIZP.js +170 -0
  142. package/chunk-WDWZPASX.js +29 -0
  143. package/chunk-WFGNWWJI.js +326 -0
  144. package/{chunk-UJKTI5PG.js → chunk-WRKMXMU7.js} +2 -1
  145. package/chunk-WVOZ35E4.js +1438 -0
  146. package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
  147. package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
  148. package/{chunk-GIABSSWQ.js → chunk-XDNXKFWF.js} +6 -6
  149. package/{chunk-GBZ4YKEO.js → chunk-XLN2GD6Z.js} +7 -7
  150. package/{chunk-45LZIYXB.js → chunk-XNEDFWT4.js} +2 -2
  151. package/{chunk-EWPDMS4N.js → chunk-Y22P6ASC.js} +32 -17
  152. package/{chunk-LJSNEV7M.js → chunk-Y3DOUQQQ.js} +8 -8
  153. package/{chunk-KOXKKHFE.js → chunk-Y5EBOURK.js} +10 -5
  154. package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
  155. package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
  156. package/{chunk-PVZY6P3S.js → chunk-YTEY27GN.js} +2 -2
  157. package/chunk-YUZ2DAIH.js +34 -0
  158. package/chunk-Z6YTCDU4.js +24 -0
  159. package/{chunk-MOMR7NMG.js → chunk-ZCVBIIUE.js} +4 -4
  160. package/{chunk-AZQZ5XPM.js → chunk-ZCZLTJEW.js} +98 -57
  161. package/{chunk-KN3HEZIQ.js → chunk-ZVOL2MAJ.js} +1 -1
  162. package/{cliAgentConfigHelpers-KICKKNYQ.js → cliAgentConfigHelpers-6OFDHJFT.js} +13 -13
  163. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
  164. package/{cliEnvHelpers-VPSJ4XWC.js → cliEnvHelpers-CNMP3RDX.js} +1 -1
  165. package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
  166. package/cliLocalAgentRecordReader-FHIMCBUK.js +102 -0
  167. package/{commandRegistry-XSMTI5PG.js → commandRegistry-OKIWAJIS.js} +113 -101
  168. package/{contentThunks-S4NNC7R2.js → contentThunks-VF2DCU46.js} +41 -38
  169. package/{cooldownCommands-X7P5M2V5.js → cooldownCommands-QL6DWGVU.js} +4 -4
  170. package/{createAgentAutomationAction-TH7ZEACJ.js → createAgentAutomationAction-BGET7Q6K.js} +41 -38
  171. package/{createDialogAction-SYZAYIIQ.js → createDialogAction-XYDQZETK.js} +42 -40
  172. package/{createPageAction-7Y4U6TXO.js → createPageAction-74S5RO7U.js} +46 -43
  173. package/{db-CS4ZJQKV.js → db-6NRZLEW2.js} +10 -7
  174. package/{dbSlice-ZJPDIFER.js → dbSlice-FI7VNDR5.js} +14 -13
  175. package/{deleteFile-Q3YDB4ML.js → deleteFile-GD62MPZW.js} +10 -7
  176. package/{dialogCommands-V5IYEOQP.js → dialogCommands-Y6DHZUAM.js} +71 -64
  177. package/dialogMessageRecord-OAV77LT7.js +7 -0
  178. package/{dialogNotifyCommand-77B57PL6.js → dialogNotifyCommand-MKXL4NGL.js} +15 -15
  179. package/{dialogSlice-O3RHDAWK.js → dialogSlice-XAUKSWZ4.js} +41 -38
  180. package/{dialogUsageCommand-HTVPR2CX.js → dialogUsageCommand-BZPKR3DW.js} +6 -6
  181. package/{docCreateCommands-36WS33BK.js → docCreateCommands-PHDFOQBM.js} +66 -57
  182. package/{docDeleteCommands-C4CS4XLF.js → docDeleteCommands-OSHJM67Y.js} +69 -60
  183. package/{docReadCommands-QZMSFMPN.js → docReadCommands-E6QYCFMS.js} +66 -57
  184. package/{docStore-PYNEODAH.js → docStore-ZZT2BEBU.js} +16 -15
  185. package/{docUpdateCommands-BYI64HVV.js → docUpdateCommands-DHIOPK2C.js} +66 -57
  186. package/fetchMessages-TQEUZD7H.js +2 -2
  187. package/{getPricing-VNGFM4PN.js → getPricing-RNRITFOP.js} +6 -6
  188. package/{handleSendMessageAction-Z43FP2E2.js → handleSendMessageAction-ARUU6CNF.js} +83 -78
  189. package/{hostCredentialCreate-Y7YIGKP4.js → hostCredentialCreate-SNQT73H4.js} +131 -119
  190. package/index.js +56 -18
  191. package/keys-RWF7UCB4.js +1 -1
  192. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  193. package/{localDialogRead-SVTPA5GY.js → localDialogRead-3T2KMCRC.js} +1 -1
  194. package/{localRuntimeAdapter-ZLJONQZS.js → localRuntimeAdapter-MHI6Y2IZ.js} +143 -130
  195. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-7DKIT7UH.js} +4 -2
  196. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
  197. package/{machineCommands-4ZLMRIA3.js → machineCommands-3O6Y27R4.js} +283 -348
  198. package/machineWsRunDispatch-5PFLR5XC.js +203 -0
  199. package/markdownToSlate-KIYM7B3P.js +8 -0
  200. package/mcpLocalAuthorizeCommand-BQCQ2KRJ.js +106 -0
  201. package/{memberThunks-JRYNONYV.js → memberThunks-TU6A6OBV.js} +24 -19
  202. package/{memoryCommands-5WC3T66U.js → memoryCommands-BC6REPQB.js} +4 -4
  203. package/{models-H5NNZRLH.js → models-CINY5UZR.js} +2 -2
  204. package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
  205. package/package.json +1 -1
  206. package/{projectArchive-JBX6HNK6.js → projectArchive-X2EVXU3N.js} +47 -44
  207. package/{providerPresetApply-J3WMRPD2.js → providerPresetApply-HUWNV2NI.js} +7 -7
  208. package/{providerRegistry-KJGB5XWS.js → providerRegistry-7FWKDKZJ.js} +7 -7
  209. package/{read-Q7GOHGNP.js → read-QAHEQID5.js} +9 -8
  210. package/{readDocTool-Z5OQ6422.js → readDocTool-KG5DP6EM.js} +1 -1
  211. package/{readlineWorkspace-WFPIAAAT.js → readlineWorkspace-SO3APHVP.js} +8125 -6196
  212. package/rememberExplicit-CPAPONSI.js +15 -0
  213. package/{removeDialogAgentAction-U3F2MNAY.js → removeDialogAgentAction-QZCCVK2G.js} +20 -19
  214. package/{runAgentClientLoop-STI5TKDJ.js → runAgentClientLoop-FLHHCOVH.js} +106 -81
  215. package/{runtimeDoctorCommands-UXKXYBW6.js → runtimeDoctorCommands-DN3I52C6.js} +17 -17
  216. package/{secretCommands-LJXOOYA7.js → secretCommands-36BCE3UE.js} +4 -4
  217. package/{setDialogExtraReferencesAction-G3WSJ7EM.js → setDialogExtraReferencesAction-PDPTYSEW.js} +17 -16
  218. package/{setPrimaryDialogAgentAction-6FHAHZBB.js → setPrimaryDialogAgentAction-DOUIPR66.js} +20 -19
  219. package/{settingThunks-AXTBX3Q5.js → settingThunks-MHGGP6UE.js} +186 -67
  220. package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
  221. package/{spaceCommands-GUKMDRWN.js → spaceCommands-JH7UYE3K.js} +70 -61
  222. package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
  223. package/{streamAgentChatTurn-A2WL5OOF.js → streamAgentChatTurn-VDDA2TX6.js} +200 -195
  224. package/{switchDialogAgentAction-UOFIAGPL.js → switchDialogAgentAction-7USK3DAP.js} +18 -17
  225. package/{tableCommands-HITDSLHS.js → tableCommands-UONBFC7L.js} +15 -12
  226. package/{toolApiClient-OGQEBQVX.js → toolApiClient-53YMJ2G6.js} +8 -6
  227. package/{tools-6NU5E6BN.js → tools-MIOCXKMG.js} +72 -68
  228. package/tuiRestart-ET3QISZ5.js +41 -0
  229. package/{tuiSummaryLlmCaller-7WLUKNP2.js → tuiSummaryLlmCaller-MSINBP3M.js} +21 -20
  230. package/{updateCommands-RJVCRSBP.js → updateCommands-5OYND6EF.js} +8 -6
  231. package/{updateDialogTitleAction-VMKU2Y67.js → updateDialogTitleAction-2L4CC4YO.js} +43 -40
  232. package/{usageCommand-YPJ2ZI2F.js → usageCommand-JTKDAG6I.js} +3 -3
  233. package/{usageRebuildCommand-FERQO74C.js → usageRebuildCommand-4TFZCKXM.js} +4 -4
  234. package/webapi-24RZDIIQ.js +2488 -0
  235. package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-HIYNL3VR.js} +2 -2
  236. package/workContext-Y3ADAPZU.js +14 -0
  237. package/workContextAccess-UZHDLBUR.js +11 -0
  238. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  239. package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-ZCSQCHG3.js} +9 -9
  240. package/agentListCommands-YBNOQ5T3.js +0 -991
  241. package/agentRecordCommands-3HL7Z4X6.js +0 -177
  242. package/agentRunCommand-C64A6MPL.js +0 -208
  243. package/chunk-2THCNKE4.js +0 -147
  244. package/chunk-2WZXXAQD.js +0 -57
  245. package/chunk-5ZMIIR23.js +0 -265
  246. package/chunk-652XYZGP.js +0 -352
  247. package/chunk-BJF2MHJ3.js +0 -118
  248. package/chunk-KEPOVMF4.js +0 -91
  249. package/chunk-QVBXJNZ2.js +0 -81
  250. package/chunk-QZI44GWV.js +0 -776
  251. package/cliLocalAgentRecordReader-6FXGFBI3.js +0 -90
  252. package/machineWsRunDispatch-L7Z3ULDF.js +0 -192
  253. package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +3 -3
  254. package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
  255. package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
  256. package/{chunk-SNBZZPYH.js → chunk-OQHIVPG4.js} +3 -3
  257. package/{chunk-47ITIXO7.js → chunk-USGHJSGO.js} +3 -3
  258. package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
  259. package/{offlineMarxistsAgentCommand-4IC3Y4C6.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +3 -3
@@ -0,0 +1,647 @@
1
+ // packages/database-engine/cliAuthorityBrokerClient.ts
2
+ import { createConnection } from "node:net";
3
+ var DEFAULT_ITERATOR_PAGE_SIZE = 200;
4
+ var CliAuthorityBrokerUnavailableError = class extends Error {
5
+ reason = "cli_authority_broker_unavailable";
6
+ status = 503;
7
+ endpoint;
8
+ constructor(endpoint, cause) {
9
+ super(`CLI authority broker unavailable at ${endpoint}. Start the local authority broker and retry.`);
10
+ this.name = "CliAuthorityBrokerUnavailableError";
11
+ this.endpoint = endpoint;
12
+ if (cause !== void 0) {
13
+ this.cause = cause;
14
+ }
15
+ }
16
+ };
17
+ var CliAuthorityBrokerTimeoutError = class extends Error {
18
+ reason = "cli_authority_broker_timeout";
19
+ endpoint;
20
+ timeoutMs;
21
+ constructor(endpoint, timeoutMs, cause) {
22
+ super(`CLI authority broker request at ${endpoint} timed out after ${timeoutMs}ms`);
23
+ this.name = "CliAuthorityBrokerTimeoutError";
24
+ this.endpoint = endpoint;
25
+ this.timeoutMs = timeoutMs;
26
+ if (cause !== void 0) {
27
+ this.cause = cause;
28
+ }
29
+ }
30
+ };
31
+ var CliAuthorityBrokerProtocolError = class extends Error {
32
+ code;
33
+ retryable;
34
+ constructor(error) {
35
+ super(error.message);
36
+ this.name = "CliAuthorityBrokerProtocolError";
37
+ this.code = error.code;
38
+ this.retryable = error.retryable === true;
39
+ }
40
+ };
41
+ function isCliAuthorityBrokerUnavailableError(error) {
42
+ return error instanceof CliAuthorityBrokerUnavailableError || typeof error === "object" && error !== null && error.reason === "cli_authority_broker_unavailable" && error.status === 503;
43
+ }
44
+ function isCliAuthorityBrokerTimeoutError(error) {
45
+ return error instanceof CliAuthorityBrokerTimeoutError || typeof error === "object" && error !== null && error.reason === "cli_authority_broker_timeout";
46
+ }
47
+ function isCliAuthorityBrokerProtocolError(error) {
48
+ return error instanceof CliAuthorityBrokerProtocolError || typeof error === "object" && error !== null && error.name === "CliAuthorityBrokerProtocolError";
49
+ }
50
+ function isBrokerUnavailableCause(error) {
51
+ if (!error) return false;
52
+ if (isCliAuthorityBrokerTimeoutError(error) || isCliAuthorityBrokerProtocolError(error)) {
53
+ return false;
54
+ }
55
+ if (isCliAuthorityBrokerUnavailableError(error)) {
56
+ return true;
57
+ }
58
+ if (typeof error === "object") {
59
+ const code = error.code;
60
+ if (typeof code === "string" && /^(ECONNREFUSED|ENOENT|ECONNRESET|EPIPE|EADDRNOTAVAIL|ENETUNREACH|EHOSTUNREACH)$/i.test(code)) {
61
+ return true;
62
+ }
63
+ }
64
+ const message = error instanceof Error ? error.message : String(error);
65
+ if (/timed out/i.test(message)) return false;
66
+ if (/malformed response|protocol mismatch/i.test(message)) return false;
67
+ return /ECONNREFUSED|ENOENT|ECONNRESET|EPIPE|closed connection without response|returned no response/i.test(message);
68
+ }
69
+ function resolveBrokerSocketTarget(endpoint) {
70
+ if (endpoint.startsWith("unix://")) {
71
+ return { kind: "unix", path: endpoint.slice("unix://".length) };
72
+ }
73
+ if (endpoint.startsWith("tcp://")) {
74
+ const url = new URL(endpoint);
75
+ return {
76
+ kind: "tcp",
77
+ host: url.hostname,
78
+ port: Number(url.port)
79
+ };
80
+ }
81
+ throw new Error(`Unsupported CLI authority broker endpoint: ${endpoint}`);
82
+ }
83
+ function isRetryableReadRequest(request) {
84
+ return request.type === "get" || request.type === "batchGet" || request.type === "status" || request.type === "iterator" || request.type === "close";
85
+ }
86
+ function isUnsupportedBrokerRequestPayload(parsed) {
87
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return false;
88
+ if (parsed.ok !== false) return false;
89
+ const error = parsed.error;
90
+ if (!error || typeof error !== "object") return false;
91
+ const code = typeof error.code === "string" ? error.code : "";
92
+ const message = typeof error.message === "string" ? error.message : "";
93
+ return code === "UNSUPPORTED_REQUEST" || code === "BROKER_UNSUPPORTED_REQUEST" || /unsupported broker request/i.test(message);
94
+ }
95
+ function isUnsupportedBrokerRequestError(error) {
96
+ if (!isCliAuthorityBrokerProtocolError(error)) return false;
97
+ return error.code === "UNSUPPORTED_REQUEST" || error.code === "BROKER_UNSUPPORTED_REQUEST" || /unsupported broker request/i.test(error.message);
98
+ }
99
+ function isNotFoundBrokerError(error) {
100
+ if (isCliAuthorityBrokerProtocolError(error)) {
101
+ if (error.code === "LEVEL_NOT_FOUND" || error.code === "NOT_FOUND") {
102
+ return true;
103
+ }
104
+ return /^(?:not\s*found|key not found)/i.test(error.message.trim());
105
+ }
106
+ if (typeof error === "object" && error !== null) {
107
+ const code = error.code;
108
+ if (code === "LEVEL_NOT_FOUND" || code === "NOT_FOUND") return true;
109
+ if (error.notFound === true) return true;
110
+ }
111
+ return false;
112
+ }
113
+ function createCliAuthorityBrokerSocketInvoker(options) {
114
+ const target = resolveBrokerSocketTarget(options.endpoint);
115
+ const timeoutMs = options.timeoutMs ?? 5e3;
116
+ const idleTimeoutMs = options.idleTimeoutMs ?? 5e3;
117
+ let nextRequestId = 1;
118
+ let activeConn = null;
119
+ let legacyBareMode = false;
120
+ let explicitlyClosed = false;
121
+ const legacyInFlight = /* @__PURE__ */ new Set();
122
+ const clearIdleTimer = (conn) => {
123
+ if (conn.idleTimer) {
124
+ clearTimeout(conn.idleTimer);
125
+ conn.idleTimer = null;
126
+ }
127
+ };
128
+ const destroyConnection = (conn) => {
129
+ if (activeConn === conn) activeConn = null;
130
+ conn.closed = true;
131
+ clearIdleTimer(conn);
132
+ if (!conn.socket.destroyed) {
133
+ conn.socket.destroy();
134
+ }
135
+ };
136
+ const maybeScheduleIdle = (conn) => {
137
+ if (conn.closed || conn.pending.size > 0) return;
138
+ conn.socket.unref?.();
139
+ clearIdleTimer(conn);
140
+ if (idleTimeoutMs > 0) {
141
+ conn.idleTimer = setTimeout(() => {
142
+ if (conn.pending.size === 0 && !conn.closed) {
143
+ destroyConnection(conn);
144
+ }
145
+ }, idleTimeoutMs);
146
+ conn.idleTimer.unref?.();
147
+ }
148
+ };
149
+ const settlePending = (conn, req, outcome) => {
150
+ if (req.settled) return;
151
+ req.settled = true;
152
+ clearTimeout(req.timer);
153
+ conn.pending.delete(req.id);
154
+ const qIndex = conn.writeQueue.indexOf(req);
155
+ if (qIndex !== -1) conn.writeQueue.splice(qIndex, 1);
156
+ outcome();
157
+ };
158
+ const createClosedError = () => new CliAuthorityBrokerUnavailableError(
159
+ options.endpoint,
160
+ new Error(`CLI authority broker invoker at ${options.endpoint} closed`)
161
+ );
162
+ const sendLegacyBare = (request) => {
163
+ if (explicitlyClosed) {
164
+ return Promise.reject(createClosedError());
165
+ }
166
+ return new Promise((resolve, reject) => {
167
+ const socket = target.kind === "unix" ? createConnection(target.path) : createConnection({ host: target.host, port: target.port });
168
+ let settled = false;
169
+ let buffer = "";
170
+ let timer;
171
+ const cleanup = () => {
172
+ clearTimeout(timer);
173
+ legacyInFlight.delete(closeHandle);
174
+ };
175
+ const finishResolve = (response) => {
176
+ if (settled) return;
177
+ settled = true;
178
+ cleanup();
179
+ if (!socket.destroyed) socket.destroy();
180
+ resolve(response);
181
+ };
182
+ const finishReject = (error) => {
183
+ if (settled) return;
184
+ settled = true;
185
+ cleanup();
186
+ if (!socket.destroyed) socket.destroy();
187
+ reject(error);
188
+ };
189
+ const closeHandle = {
190
+ close: () => {
191
+ finishReject(createClosedError());
192
+ }
193
+ };
194
+ legacyInFlight.add(closeHandle);
195
+ timer = setTimeout(() => {
196
+ finishReject(new CliAuthorityBrokerTimeoutError(options.endpoint, timeoutMs));
197
+ }, timeoutMs);
198
+ socket.setEncoding("utf8");
199
+ socket.on("connect", () => {
200
+ if (settled || explicitlyClosed) return;
201
+ socket.write(`${JSON.stringify(request)}
202
+ `);
203
+ });
204
+ const handleLine = (line) => {
205
+ try {
206
+ finishResolve(JSON.parse(line));
207
+ } catch (parseError) {
208
+ finishReject(
209
+ new CliAuthorityBrokerProtocolError({
210
+ code: "MALFORMED_RESPONSE",
211
+ message: `CLI authority broker at ${options.endpoint} returned malformed response: ${parseError instanceof Error ? parseError.message : String(parseError)}`
212
+ })
213
+ );
214
+ }
215
+ };
216
+ socket.on("data", (chunk) => {
217
+ if (settled) return;
218
+ buffer += chunk;
219
+ const newlineIndex = buffer.indexOf("\n");
220
+ if (newlineIndex === -1) return;
221
+ const line = buffer.slice(0, newlineIndex).trim();
222
+ buffer = buffer.slice(newlineIndex + 1);
223
+ if (!line) return;
224
+ handleLine(line);
225
+ });
226
+ socket.on("end", () => {
227
+ if (settled) return;
228
+ const trailing = buffer.trim();
229
+ if (trailing) {
230
+ handleLine(trailing);
231
+ return;
232
+ }
233
+ finishReject(
234
+ new CliAuthorityBrokerUnavailableError(
235
+ options.endpoint,
236
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
237
+ )
238
+ );
239
+ });
240
+ socket.on("error", (error) => {
241
+ finishReject(
242
+ isBrokerUnavailableCause(error) ? new CliAuthorityBrokerUnavailableError(options.endpoint, error) : error
243
+ );
244
+ });
245
+ socket.on("close", () => {
246
+ finishReject(
247
+ new CliAuthorityBrokerUnavailableError(
248
+ options.endpoint,
249
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
250
+ )
251
+ );
252
+ });
253
+ });
254
+ };
255
+ const processResponseLine = (conn, line) => {
256
+ let parsed;
257
+ try {
258
+ parsed = JSON.parse(line);
259
+ } catch (parseError) {
260
+ const protocolError2 = new CliAuthorityBrokerProtocolError({
261
+ code: "MALFORMED_RESPONSE",
262
+ message: `CLI authority broker at ${options.endpoint} returned malformed response: ${parseError instanceof Error ? parseError.message : String(parseError)}`
263
+ });
264
+ const pendingRequests2 = [...conn.pending.values()];
265
+ destroyConnection(conn);
266
+ for (const req of pendingRequests2) {
267
+ settlePending(conn, req, () => req.reject(protocolError2));
268
+ }
269
+ return false;
270
+ }
271
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed) && "response" in parsed && (typeof parsed.id === "number" || typeof parsed.id === "string")) {
272
+ const id = Number(parsed.id);
273
+ const req = conn.pending.get(id);
274
+ if (!req) return true;
275
+ conn.reused = true;
276
+ settlePending(conn, req, () => {
277
+ req.resolve(parsed.response);
278
+ });
279
+ return true;
280
+ }
281
+ const pendingRequests = [...conn.pending.values()];
282
+ if (isUnsupportedBrokerRequestPayload(parsed)) {
283
+ legacyBareMode = true;
284
+ for (const req of pendingRequests) {
285
+ settlePending(conn, req, () => {
286
+ if (explicitlyClosed) {
287
+ req.reject(createClosedError());
288
+ return;
289
+ }
290
+ void sendLegacyBare(req.request).then(req.resolve, req.reject);
291
+ });
292
+ }
293
+ destroyConnection(conn);
294
+ return false;
295
+ }
296
+ if (pendingRequests.length === 1) {
297
+ const [onlyReq] = pendingRequests;
298
+ destroyConnection(conn);
299
+ settlePending(conn, onlyReq, () => {
300
+ onlyReq.resolve(parsed);
301
+ });
302
+ return false;
303
+ }
304
+ if (pendingRequests.length > 1 && parsed && typeof parsed === "object" && parsed.ok === false) {
305
+ destroyConnection(conn);
306
+ for (const req of pendingRequests) {
307
+ settlePending(conn, req, () => {
308
+ req.resolve(parsed);
309
+ });
310
+ }
311
+ return false;
312
+ }
313
+ const protocolError = new CliAuthorityBrokerProtocolError({
314
+ code: "MALFORMED_RESPONSE",
315
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
316
+ });
317
+ destroyConnection(conn);
318
+ for (const req of pendingRequests) {
319
+ settlePending(conn, req, () => req.reject(protocolError));
320
+ }
321
+ return false;
322
+ };
323
+ const failRemainingPending = (conn, errorFactory) => {
324
+ const remaining = [...conn.pending.values()];
325
+ if (remaining.length === 0) return;
326
+ const canRetryOnDrop = !explicitlyClosed && conn.reused;
327
+ for (const req of remaining) {
328
+ settlePending(conn, req, () => {
329
+ if (!explicitlyClosed && !req.retried && (!req.written || canRetryOnDrop && isRetryableReadRequest(req.request))) {
330
+ void sendWithRetry(req.request, true).then(req.resolve, req.reject);
331
+ return;
332
+ }
333
+ req.reject(errorFactory());
334
+ });
335
+ }
336
+ };
337
+ const getOrOpenConnection = () => {
338
+ if (activeConn && !activeConn.closed && !activeConn.socket.destroyed && activeConn.socket.writable) {
339
+ clearIdleTimer(activeConn);
340
+ activeConn.socket.ref?.();
341
+ return activeConn;
342
+ }
343
+ const socket = target.kind === "unix" ? createConnection(target.path) : createConnection({ host: target.host, port: target.port });
344
+ const conn = {
345
+ socket,
346
+ connected: false,
347
+ closed: false,
348
+ reused: false,
349
+ buffer: "",
350
+ pending: /* @__PURE__ */ new Map(),
351
+ writeQueue: [],
352
+ idleTimer: null
353
+ };
354
+ activeConn = conn;
355
+ socket.setEncoding("utf8");
356
+ socket.setNoDelay?.(true);
357
+ socket.on("connect", () => {
358
+ if (conn.closed) return;
359
+ conn.connected = true;
360
+ const queued = conn.writeQueue.splice(0, conn.writeQueue.length);
361
+ for (const req of queued) {
362
+ if (req.settled) continue;
363
+ req.written = true;
364
+ socket.write(`${JSON.stringify({ id: req.id, request: req.request })}
365
+ `);
366
+ }
367
+ });
368
+ socket.on("data", (chunk) => {
369
+ if (conn.closed) return;
370
+ conn.buffer += chunk;
371
+ let newlineIndex;
372
+ while ((newlineIndex = conn.buffer.indexOf("\n")) !== -1) {
373
+ const line = conn.buffer.slice(0, newlineIndex).trim();
374
+ conn.buffer = conn.buffer.slice(newlineIndex + 1);
375
+ if (!line) continue;
376
+ if (!processResponseLine(conn, line)) return;
377
+ }
378
+ maybeScheduleIdle(conn);
379
+ });
380
+ socket.on("end", () => {
381
+ const trailing = conn.buffer.trim();
382
+ conn.buffer = "";
383
+ if (trailing && conn.pending.size > 0 && !conn.closed) {
384
+ processResponseLine(conn, trailing);
385
+ }
386
+ if (activeConn === conn) activeConn = null;
387
+ conn.closed = true;
388
+ clearIdleTimer(conn);
389
+ failRemainingPending(
390
+ conn,
391
+ () => new CliAuthorityBrokerUnavailableError(
392
+ options.endpoint,
393
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
394
+ )
395
+ );
396
+ });
397
+ socket.on("error", (error) => {
398
+ if (activeConn === conn) activeConn = null;
399
+ conn.closed = true;
400
+ clearIdleTimer(conn);
401
+ failRemainingPending(
402
+ conn,
403
+ () => isBrokerUnavailableCause(error) ? new CliAuthorityBrokerUnavailableError(options.endpoint, error) : error
404
+ );
405
+ });
406
+ socket.on("close", () => {
407
+ if (activeConn === conn) activeConn = null;
408
+ conn.closed = true;
409
+ clearIdleTimer(conn);
410
+ failRemainingPending(
411
+ conn,
412
+ () => new CliAuthorityBrokerUnavailableError(
413
+ options.endpoint,
414
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
415
+ )
416
+ );
417
+ });
418
+ return conn;
419
+ };
420
+ const sendWithRetry = (request, retried) => {
421
+ if (explicitlyClosed) {
422
+ return Promise.reject(createClosedError());
423
+ }
424
+ if (legacyBareMode) {
425
+ return sendLegacyBare(request);
426
+ }
427
+ return new Promise((resolve, reject) => {
428
+ const conn = getOrOpenConnection();
429
+ const id = nextRequestId++;
430
+ const req = {
431
+ id,
432
+ request,
433
+ resolve,
434
+ reject,
435
+ timer: void 0,
436
+ settled: false,
437
+ written: false,
438
+ retried
439
+ };
440
+ req.timer = setTimeout(() => {
441
+ if (req.settled) return;
442
+ settlePending(conn, req, () => {
443
+ if (conn.pending.size === 0) {
444
+ destroyConnection(conn);
445
+ }
446
+ req.reject(new CliAuthorityBrokerTimeoutError(options.endpoint, timeoutMs));
447
+ });
448
+ }, timeoutMs);
449
+ conn.pending.set(id, req);
450
+ if (conn.connected) {
451
+ req.written = true;
452
+ conn.socket.write(`${JSON.stringify({ id: req.id, request: req.request })}
453
+ `);
454
+ } else {
455
+ conn.writeQueue.push(req);
456
+ }
457
+ });
458
+ };
459
+ const invoker = (request) => {
460
+ if (explicitlyClosed) {
461
+ return Promise.reject(createClosedError());
462
+ }
463
+ return legacyBareMode ? sendLegacyBare(request) : sendWithRetry(request, false);
464
+ };
465
+ invoker.close = () => {
466
+ explicitlyClosed = true;
467
+ const conn = activeConn;
468
+ if (conn) {
469
+ destroyConnection(conn);
470
+ failRemainingPending(conn, createClosedError);
471
+ }
472
+ for (const handle of [...legacyInFlight]) {
473
+ handle.close();
474
+ }
475
+ };
476
+ return invoker;
477
+ }
478
+ async function invokeBrokerRequest(options, request) {
479
+ try {
480
+ const response = await options.invoke(request);
481
+ if (!response || typeof response !== "object" || typeof response.ok !== "boolean") {
482
+ throw new CliAuthorityBrokerProtocolError({
483
+ code: "MALFORMED_RESPONSE",
484
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
485
+ });
486
+ }
487
+ if (response.ok) {
488
+ if (!response.result || typeof response.result !== "object") {
489
+ throw new CliAuthorityBrokerProtocolError({
490
+ code: "MALFORMED_RESPONSE",
491
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
492
+ });
493
+ }
494
+ return response.result;
495
+ }
496
+ if (!response.error || typeof response.error !== "object" || typeof response.error.code !== "string" || typeof response.error.message !== "string") {
497
+ throw new CliAuthorityBrokerProtocolError({
498
+ code: "MALFORMED_RESPONSE",
499
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
500
+ });
501
+ }
502
+ if (response.error.code === "BROKER_UNAVAILABLE") {
503
+ throw new CliAuthorityBrokerUnavailableError(options.endpoint, response.error);
504
+ }
505
+ throw new CliAuthorityBrokerProtocolError(response.error);
506
+ } catch (error) {
507
+ if (isCliAuthorityBrokerTimeoutError(error)) throw error;
508
+ if (isCliAuthorityBrokerUnavailableError(error)) throw error;
509
+ if (isCliAuthorityBrokerProtocolError(error)) throw error;
510
+ if (isBrokerUnavailableCause(error)) {
511
+ throw new CliAuthorityBrokerUnavailableError(options.endpoint, error);
512
+ }
513
+ throw error;
514
+ }
515
+ }
516
+ function createCliAuthorityBrokerClient(options) {
517
+ const pageSize = options.iteratorPageSize ?? DEFAULT_ITERATOR_PAGE_SIZE;
518
+ let batchGetUnsupported = false;
519
+ const fallbackBatchGet = (keys) => Promise.all(
520
+ keys.map(async (key) => {
521
+ try {
522
+ const result = await invokeBrokerRequest(options, { type: "get", key });
523
+ if (result.type !== "get") {
524
+ throw new Error(`CLI authority broker protocol mismatch for get at ${options.endpoint}`);
525
+ }
526
+ return { ok: true, value: result.value };
527
+ } catch (error) {
528
+ if (isNotFoundBrokerError(error)) {
529
+ return {
530
+ ok: false,
531
+ error: {
532
+ code: isCliAuthorityBrokerProtocolError(error) ? error.code : typeof error?.code === "string" ? error.code : "NOT_FOUND",
533
+ message: error instanceof Error ? error.message : String(error),
534
+ ...isCliAuthorityBrokerProtocolError(error) && error.retryable ? { retryable: true } : {}
535
+ }
536
+ };
537
+ }
538
+ throw error;
539
+ }
540
+ })
541
+ );
542
+ return {
543
+ get location() {
544
+ return options.location ?? options.endpoint;
545
+ },
546
+ get status() {
547
+ return options.status ?? "broker";
548
+ },
549
+ async open() {
550
+ await invokeBrokerRequest(options, { type: "status" });
551
+ },
552
+ async close() {
553
+ },
554
+ async get(key) {
555
+ const result = await invokeBrokerRequest(options, { type: "get", key });
556
+ if (result.type !== "get") {
557
+ throw new Error(`CLI authority broker protocol mismatch for get at ${options.endpoint}`);
558
+ }
559
+ return result.value;
560
+ },
561
+ async batchGet(keys) {
562
+ if (batchGetUnsupported) {
563
+ return fallbackBatchGet(keys);
564
+ }
565
+ try {
566
+ const result = await invokeBrokerRequest(options, { type: "batchGet", keys });
567
+ if (result.type !== "batchGet" || !Array.isArray(result.items) || result.items.length !== keys.length) {
568
+ throw new CliAuthorityBrokerProtocolError({
569
+ code: "BROKER_PROTOCOL_MISMATCH",
570
+ message: `CLI authority broker protocol mismatch for batchGet at ${options.endpoint}`
571
+ });
572
+ }
573
+ return result.items;
574
+ } catch (error) {
575
+ if (isUnsupportedBrokerRequestError(error)) {
576
+ batchGetUnsupported = true;
577
+ return fallbackBatchGet(keys);
578
+ }
579
+ throw error;
580
+ }
581
+ },
582
+ async conditionalPut(key, expectedRevision, value) {
583
+ const result = await invokeBrokerRequest(options, { type: "conditionalPut", key, expectedRevision, value });
584
+ if (!result || result.type !== "conditionalPut" || result.status !== "updated" && result.status !== "conflict" || Object.keys(result).some((key2) => key2 !== "type" && key2 !== "status")) {
585
+ throw new CliAuthorityBrokerProtocolError({ code: "BROKER_PROTOCOL_MISMATCH", message: "Invalid conditionalPut response" });
586
+ }
587
+ return { status: result.status };
588
+ },
589
+ async put(key, value) {
590
+ await invokeBrokerRequest(options, { type: "put", key, value });
591
+ },
592
+ async del(key) {
593
+ await invokeBrokerRequest(options, { type: "del", key });
594
+ },
595
+ async batchWrite(ops) {
596
+ await invokeBrokerRequest(options, { type: "batchWrite", ops });
597
+ },
598
+ createBatch() {
599
+ const ops = [];
600
+ return {
601
+ put(key, value) {
602
+ ops.push({ type: "put", key, value });
603
+ },
604
+ del(key) {
605
+ ops.push({ type: "del", key });
606
+ },
607
+ async write() {
608
+ await invokeBrokerRequest(options, { type: "batchWrite", ops });
609
+ }
610
+ };
611
+ },
612
+ iterator(iteratorOptions = {}) {
613
+ return async function* iterate() {
614
+ let cursor = void 0;
615
+ while (true) {
616
+ const result = await invokeBrokerRequest(options, {
617
+ type: "iterator",
618
+ options: iteratorOptions,
619
+ cursor,
620
+ limit: pageSize
621
+ });
622
+ if (result.type !== "iterator") {
623
+ throw new Error(
624
+ `CLI authority broker protocol mismatch for iterator at ${options.endpoint}`
625
+ );
626
+ }
627
+ for (const entry of result.page.entries) {
628
+ yield entry;
629
+ }
630
+ if (result.page.done || !result.page.nextCursor) return;
631
+ cursor = result.page.nextCursor;
632
+ }
633
+ }();
634
+ }
635
+ };
636
+ }
637
+
638
+ export {
639
+ CliAuthorityBrokerUnavailableError,
640
+ CliAuthorityBrokerTimeoutError,
641
+ CliAuthorityBrokerProtocolError,
642
+ isCliAuthorityBrokerUnavailableError,
643
+ isCliAuthorityBrokerTimeoutError,
644
+ isCliAuthorityBrokerProtocolError,
645
+ createCliAuthorityBrokerSocketInvoker,
646
+ createCliAuthorityBrokerClient
647
+ };