nolo-cli 0.228.0-alpha.2 → 0.228.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 (260) hide show
  1. package/README.md +3 -5
  2. package/{_executeModel-VYCHHZVT.js → _executeModel-AKCTHGMP.js} +89 -83
  3. package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
  4. package/{action-GDZDXPMB.js → action-C6IQAKN4.js} +8 -5
  5. package/{addContentAction-7RO4AMRI.js → addContentAction-53364YDW.js} +13 -12
  6. package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-U5DD5EN5.js} +16 -15
  7. package/{agentDeleteCommand-QWQKT54A.js → agentDeleteCommand-2E5FAGUO.js} +128 -115
  8. package/{agentEmailCommands-EISMBIRE.js → agentEmailCommands-UGZZAH7E.js} +128 -111
  9. package/{agentListCommands-4WLG32IW.js → agentListCommands-JCTW3J2K.js} +398 -179
  10. package/{agentMachineCommands-DC6NKWTU.js → agentMachineCommands-QPG5ZXF4.js} +58 -47
  11. package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-QLTABYR7.js} +2 -2
  12. package/{agentPullCommand-KHV4EELF.js → agentPullCommand-2EYJ5ENC.js} +1 -1
  13. package/agentRecordCommands-4NTVR6MZ.js +194 -0
  14. package/agentRunCommand-VHF34PYC.js +232 -0
  15. package/{agentRunControl-MBG4U6SL.js → agentRunControl-QYTXUQGY.js} +14 -9
  16. package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-U54AKHXH.js} +58 -43
  17. package/{agentSlice-UG76KEBH.js → agentSlice-4JGDEXWK.js} +14 -13
  18. package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-XBE5QJ6P.js} +58 -47
  19. package/{appDeployCommands-AU4IUN33.js → appDeployCommands-QIYLXXGA.js} +58 -47
  20. package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-JXS6ZQZZ.js} +58 -47
  21. package/{appGetCommands-BGTLIQ4K.js → appGetCommands-SZS7SJPK.js} +58 -47
  22. package/{appListCommands-CUCPRUXW.js → appListCommands-B3GBJSNV.js} +58 -47
  23. package/{authCommand-OZ2KTP4Z.js → authCommand-V6EOMZX6.js} +25 -19
  24. package/{authCommands-55OGQGCR.js → authCommands-T5FODCEG.js} +12 -6
  25. package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-ZQC3IIO2.js} +8 -7
  26. package/{chromeCommands-G5UDKVSV.js → chromeCommands-O4IIKTBD.js} +384 -7
  27. package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-OFX7ZGKP.js} +3 -3
  28. package/{chunk-DBUR22G5.js → chunk-223KZUJ6.js} +19 -15
  29. package/{chunk-3U44JB3O.js → chunk-2C5VN7NH.js} +1 -1
  30. package/{chunk-PWTNI4N7.js → chunk-2E4BYAUE.js} +22 -0
  31. package/{chunk-L32W3PRP.js → chunk-2FZVXOFX.js} +234 -18
  32. package/{chunk-HBRDSQ3M.js → chunk-2JHGUL5K.js} +3 -2
  33. package/chunk-2SXN7LAY.js +15 -0
  34. package/chunk-3A5NNQCN.js +64 -0
  35. package/chunk-3F2FRLIO.js +372 -0
  36. package/{chunk-DEA37IUY.js → chunk-46FETNLF.js} +2 -2
  37. package/{chunk-ZEVQHCLM.js → chunk-4GYVS4PM.js} +8 -6
  38. package/{chunk-CBUZ6DKA.js → chunk-4YPH5KRA.js} +1 -1
  39. package/chunk-4ZCTKB27.js +31 -0
  40. package/chunk-53W5BXLN.js +340 -0
  41. package/{chunk-7FEP5USX.js → chunk-5AYP5QBB.js} +5 -5
  42. package/{chunk-XAG3FWBE.js → chunk-5ISNPTQH.js} +5 -5
  43. package/{chunk-EVGU5P4U.js → chunk-5P3PPQVP.js} +1 -1
  44. package/{chunk-XSW4EXQV.js → chunk-6BMTKYAO.js} +55 -18
  45. package/chunk-6PAHSSD2.js +33401 -0
  46. package/{chunk-ZOHO6MOF.js → chunk-6RSNVJGO.js} +2 -99
  47. package/{chunk-7JGMNKKG.js → chunk-6SOWMEAY.js} +30 -9
  48. package/{chunk-RG2DGNL6.js → chunk-6VEO7Z3Y.js} +3 -3
  49. package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
  50. package/{chunk-DGYCDA6W.js → chunk-7BIJFGKS.js} +36 -17
  51. package/{chunk-WFDNADFX.js → chunk-7OVOZRZF.js} +8 -8
  52. package/{chunk-WCFFRBL5.js → chunk-7PON4LBY.js} +45 -27
  53. package/{chunk-QRGDJA4B.js → chunk-7WHCIA5V.js} +33 -7
  54. package/{chunk-CMMI3DAT.js → chunk-ADYWV732.js} +59 -30
  55. package/{chunk-QYB23WUH.js → chunk-AIFQKNPP.js} +1 -1
  56. package/{chunk-HGDKT2D6.js → chunk-BPB3T5EU.js} +174 -1
  57. package/{chunk-DUUDXSLX.js → chunk-BZLGPM5B.js} +28 -4
  58. package/{chunk-ATEKLSLR.js → chunk-BZMDWGQQ.js} +14 -9
  59. package/chunk-C5A54QS7.js +108 -0
  60. package/{chunk-S6K5F3KP.js → chunk-CEKRIR22.js} +1 -1
  61. package/{chunk-42OKN2LI.js → chunk-D634SL2Y.js} +9 -107
  62. package/{chunk-DLXMMTGM.js → chunk-DHRPLRIR.js} +1283 -786
  63. package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
  64. package/{chunk-OBIC6EG7.js → chunk-DNNPARJK.js} +9 -5
  65. package/{chunk-X3E6EHJW.js → chunk-E3LSO6EI.js} +292 -207
  66. package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
  67. package/chunk-EHFBP6IK.js +791 -0
  68. package/chunk-EJQE5HB7.js +21 -0
  69. package/{chunk-VQ5N5GSV.js → chunk-EL5NRJHI.js} +4 -4
  70. package/chunk-EUGTFFO6.js +42 -0
  71. package/{chunk-7BCG67EI.js → chunk-EVHTYVD2.js} +1199 -442
  72. package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
  73. package/{chunk-262R3XNN.js → chunk-FEIVARWR.js} +377 -112
  74. package/{chunk-3VZLEKV2.js → chunk-FLBJ7IJI.js} +14 -14
  75. package/{chunk-EEOOBRA7.js → chunk-FXEPZKNJ.js} +13 -6
  76. package/{chunk-XTJKU3Z4.js → chunk-FYAMUU55.js} +677 -140
  77. package/{chunk-M3OZRQNH.js → chunk-FZANZZ63.js} +1 -1
  78. package/chunk-GAHJLSDO.js +107 -0
  79. package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
  80. package/{chunk-4N6G2CKP.js → chunk-HDKMVYNJ.js} +47 -1
  81. package/chunk-HEVRQGGH.js +106 -0
  82. package/{chunk-BIWI5M4E.js → chunk-HFHJPHFK.js} +1 -1
  83. package/{chunk-R6Z5S5GA.js → chunk-HPDLPEUG.js} +60 -17
  84. package/{chunk-YKY4OVOX.js → chunk-HQUGB2HM.js} +17 -170
  85. package/chunk-IIRJ4P4I.js +24 -0
  86. package/chunk-IVK2KT3H.js +209 -0
  87. package/{chunk-ALAES342.js → chunk-IYLUK67R.js} +9 -5
  88. package/{chunk-N5Z2V73W.js → chunk-J55F3IEZ.js} +1 -1
  89. package/{chunk-S6FDXXZV.js → chunk-J7JRCOIW.js} +2 -2
  90. package/{chunk-OWKNSIXL.js → chunk-JAKRY74O.js} +470 -83
  91. package/{chunk-VS276URX.js → chunk-JCQ3WCQ3.js} +4 -2
  92. package/chunk-JLZJL3WC.js +988 -0
  93. package/{chunk-OBSEKCVK.js → chunk-JPXACKSW.js} +219 -52
  94. package/{chunk-OTKSESZR.js → chunk-KDBDOXOM.js} +138 -54
  95. package/{chunk-VP3BINY7.js → chunk-KDDHQMSH.js} +31 -1
  96. package/{chunk-RBPUNSG5.js → chunk-KG27JIG4.js} +18 -108
  97. package/{chunk-4WVJLODK.js → chunk-KHYSFS3W.js} +88 -7
  98. package/{chunk-TCZ2VJZQ.js → chunk-KKIQAVDR.js} +9 -9
  99. package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
  100. package/chunk-KXOPLLFP.js +190 -0
  101. package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
  102. package/{chunk-HYLRQDEE.js → chunk-LLUBUHNT.js} +6 -6
  103. package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
  104. package/{chunk-RTHFJZ6M.js → chunk-LVZVSLKO.js} +29 -9
  105. package/{chunk-TI2EPRHE.js → chunk-MNFUKRRU.js} +3 -3
  106. package/chunk-MVOZ22RZ.js +26 -0
  107. package/{chunk-CNMY2XM6.js → chunk-O3A2CHAL.js} +6 -6
  108. package/{chunk-TSPMLCWI.js → chunk-OB4FBZXJ.js} +5 -5
  109. package/{chunk-LYD6C7OU.js → chunk-OJSJJKHF.js} +6 -6
  110. package/{chunk-M4SFKP5L.js → chunk-OKAXQFON.js} +3 -3
  111. package/{chunk-CD3RU7XL.js → chunk-OKH74FML.js} +121 -14
  112. package/{chunk-U2HBB7RS.js → chunk-OOV5JN25.js} +130 -30
  113. package/{chunk-ZH3KXFHS.js → chunk-OOVOAG4Q.js} +1 -1
  114. package/chunk-OQFOE4SJ.js +405 -0
  115. package/{chunk-M3JEW6N6.js → chunk-OYUMJMC5.js} +15 -0
  116. package/chunk-P27E22MA.js +203 -0
  117. package/{chunk-SRCCSTIM.js → chunk-P4R5KXU7.js} +4 -4
  118. package/{chunk-FJ23FZXF.js → chunk-PHREU2KZ.js} +5 -3
  119. package/{chunk-HSSBDZLD.js → chunk-PIVTQRX6.js} +43 -13
  120. package/{chunk-XFXFPUO7.js → chunk-PJL7OJRC.js} +13 -39
  121. package/{chunk-RRDRQOEC.js → chunk-PNLDLUMO.js} +276 -303
  122. package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
  123. package/{chunk-HHFGE2WF.js → chunk-QGFLVQ6E.js} +5 -5
  124. package/{chunk-EGHP7KOY.js → chunk-QONAOHVW.js} +38 -29
  125. package/chunk-R3FZHW4Q.js +103 -0
  126. package/{chunk-ZYKJBRZ3.js → chunk-R3MV2GII.js} +1 -47
  127. package/chunk-R72QWIFO.js +50 -0
  128. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  129. package/{chunk-ILHQ2AXT.js → chunk-RIWKZT7E.js} +36 -8
  130. package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
  131. package/{chunk-45CAVC35.js → chunk-S7H4KTMB.js} +2568 -337
  132. package/{chunk-OJ45MEEI.js → chunk-SA356NGW.js} +1 -1
  133. package/{chunk-F6Z6ZCUV.js → chunk-SCAC3NM5.js} +3 -3
  134. package/{chunk-YVFH2MFB.js → chunk-SLUN7W6S.js} +7 -7
  135. package/chunk-SQL7YNED.js +650 -0
  136. package/chunk-SR4FE5VD.js +9 -0
  137. package/{chunk-HF7BLF3F.js → chunk-SSOR2EDT.js} +107 -104
  138. package/chunk-TRRXYFTR.js +46 -0
  139. package/{chunk-3QIYD3VM.js → chunk-TUOHSUK5.js} +20068 -18402
  140. package/chunk-TYJCIA2O.js +835 -0
  141. package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
  142. package/{chunk-GAYNXB6T.js → chunk-U3BUWDUP.js} +1031 -2155
  143. package/{chunk-BP5ZJ6B4.js → chunk-U6QNVOR5.js} +1 -1
  144. package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
  145. package/chunk-UAF5VQCE.js +77 -0
  146. package/{chunk-TQEKUOTI.js → chunk-UFGUJ2IH.js} +12 -12
  147. package/{chunk-VMJVAJ6W.js → chunk-UP7KBWLE.js} +109 -33
  148. package/{chunk-2X7WFDT6.js → chunk-UUCYUN6Y.js} +1 -1
  149. package/{chunk-5YMA6DDZ.js → chunk-UZKBVQUX.js} +1 -1
  150. package/chunk-V5TI7HJH.js +133 -0
  151. package/{chunk-WFGNWWJI.js → chunk-VH7UO6E5.js} +252 -114
  152. package/{chunk-MNEZUL5S.js → chunk-VJFDG3ZG.js} +63 -94
  153. package/{chunk-G7IUT2V3.js → chunk-WC3J5SL2.js} +635 -350
  154. package/{chunk-HXB4VDGK.js → chunk-WD5547ZF.js} +33 -30
  155. package/chunk-WDWZPASX.js +29 -0
  156. package/{chunk-4ZGPHFLE.js → chunk-WS36XPJD.js} +2 -2
  157. package/{chunk-6QHKRARD.js → chunk-WSLL7VV4.js} +29 -5
  158. package/chunk-XRGBJHZX.js +136 -0
  159. package/{chunk-MZG5CETE.js → chunk-Y2KWJTOZ.js} +4 -4
  160. package/{dialogUsageCommand-W2WCSGKF.js → chunk-Y2TCTNUD.js} +27 -20
  161. package/chunk-YJPK35HB.js +175 -0
  162. package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
  163. package/{chunk-547ENH5T.js → chunk-YN23INFZ.js} +4 -4
  164. package/{chunk-4QYJPWHH.js → chunk-YXK3GJF5.js} +232 -10
  165. package/{chunk-MJI3UAXN.js → chunk-Z2OWAYMI.js} +77 -51
  166. package/{chunk-7Z6EW7AH.js → chunk-ZTHAJU3O.js} +106 -14
  167. package/{chunk-YFLVRVYK.js → chunk-ZYPXOQS2.js} +1 -1
  168. package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-BXHQ3PXP.js} +9 -9
  169. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
  170. package/cliAuthorityBrokerProcess-5ZFBTHLB.js +22 -0
  171. package/cliLocalAgentRecordReader-47PXMHPH.js +104 -0
  172. package/{commandRegistry-FVYPE2IN.js → commandRegistry-CTMPAQH2.js} +111 -162
  173. package/{contentThunks-GNFPG32S.js → contentThunks-CAHIIZO5.js} +38 -36
  174. package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-WDOI5VD7.js} +3 -3
  175. package/{createAgentAutomationAction-PB4QIFQ4.js → createAgentAutomationAction-M25XZSPD.js} +38 -36
  176. package/{createDialogAction-EVTOPY7A.js → createDialogAction-4SN7FKI7.js} +39 -37
  177. package/{createPageAction-2UYF2IDZ.js → createPageAction-N7QPDN3M.js} +43 -41
  178. package/{db-M7FU2GNK.js → db-VR74ADGC.js} +7 -2
  179. package/{dbSlice-XRUZOGSU.js → dbSlice-RWPSVHBC.js} +12 -11
  180. package/{deleteFile-6URDHYRB.js → deleteFile-ECU6FU5C.js} +15 -7
  181. package/{dialogCommands-6SZD4TYP.js → dialogCommands-BBHWCKDP.js} +69 -53
  182. package/dialogMessageRecord-OAV77LT7.js +7 -0
  183. package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-IASQGEMW.js} +11 -11
  184. package/{dialogSlice-5EQ2A6LY.js → dialogSlice-JI3J22RV.js} +39 -37
  185. package/dialogTraceCommand-EW2KK6A4.js +961 -0
  186. package/dialogUsageCommand-WJ3U6KZU.js +27 -0
  187. package/{docCreateCommands-25E6PGN3.js → docCreateCommands-QSX3X5U4.js} +57 -46
  188. package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-63JBG2HQ.js} +59 -48
  189. package/{docReadCommands-JY2E5XEN.js → docReadCommands-CQFKRQUI.js} +57 -46
  190. package/{docStore-OKKIKLT3.js → docStore-XLBKGGNM.js} +14 -13
  191. package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-534LUK25.js} +57 -46
  192. package/ebookDownloaderAgentCommand-DYSKF5ZY.js +677 -0
  193. package/fetchMessages-TQEUZD7H.js +1 -1
  194. package/{getPricing-LF5C4XSI.js → getPricing-5BLZRPTM.js} +4 -4
  195. package/{handleSendMessageAction-LNT7SZND.js → handleSendMessageAction-Q2VMEVOR.js} +127 -81
  196. package/{hostCredentialCreate-XUU2CSHI.js → hostCredentialCreate-C57T7YPE.js} +127 -109
  197. package/index.js +23 -11
  198. package/{localDialogRead-CCOCVGAP.js → localDialogRead-BJJT3TF5.js} +1 -1
  199. package/{localRuntimeAdapter-IBSTMSX7.js → localRuntimeAdapter-OALZPFZU.js} +134 -115
  200. package/localRuntimeAuthority-UF2DAQ3F.js +28 -0
  201. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-ZJFGNHML.js} +1 -1
  202. package/{machineCommands-HSQHDHOT.js → machineCommands-N6IVWRZT.js} +262 -325
  203. package/machineWsRunDispatch-PDWYB33B.js +209 -0
  204. package/markdownToSlate-PXYAIBVL.js +8 -0
  205. package/mcpLocalAuthorizeCommand-KYI4EGF5.js +110 -0
  206. package/{memberThunks-7Y3OYSJQ.js → memberThunks-43B7UYC5.js} +21 -16
  207. package/{models-H5NNZRLH.js → models-ZX2BYIMB.js} +2 -2
  208. package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
  209. package/package.json +2 -1
  210. package/{projectArchive-FQO654Z3.js → projectArchive-TJNW5DLM.js} +46 -44
  211. package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-NTJUINI6.js} +36 -17
  212. package/{providerRegistry-ZI2KORJ7.js → providerRegistry-W45SLUV6.js} +6 -6
  213. package/{read-TYMBGEXO.js → read-KG6INYUT.js} +13 -7
  214. package/{readDocTool-SKQVHBLO.js → readDocTool-N3GA52JR.js} +1 -1
  215. package/{readlineWorkspace-7U272DSA.js → readlineWorkspace-PJZJVGA5.js} +7486 -4492
  216. package/rememberExplicit-CPAPONSI.js +15 -0
  217. package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-EEVSOQOJ.js} +18 -17
  218. package/{runAgentClientLoop-AF4JQIJ7.js → runAgentClientLoop-3VC5TCDW.js} +107 -76
  219. package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-V3M3JTUV.js} +14 -11
  220. package/{secretCommands-KZWBZIYS.js → secretCommands-KVVZS7A6.js} +3 -3
  221. package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-DNO5POHA.js} +15 -14
  222. package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-QABBEO4C.js} +18 -17
  223. package/{settingThunks-ZRGWVGZD.js → settingThunks-DVKG4X4S.js} +181 -66
  224. package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-ZMJH36AK.js} +4 -3
  225. package/{spaceCommands-5VNWMDBE.js → spaceCommands-AGGZXPY3.js} +235 -87
  226. package/{streamAgentChatTurn-YSPEFY4K.js → streamAgentChatTurn-4GTLL2OF.js} +242 -169
  227. package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-KYWJSGOO.js} +16 -15
  228. package/{tableCommands-FTAOCBTX.js → tableCommands-EFA754RE.js} +7 -4
  229. package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
  230. package/{tools-M35PTIFB.js → tools-5AGPOPLW.js} +69 -65
  231. package/{tuiRestart-2IL37YIB.js → tuiRestart-77E7PL4R.js} +11 -10
  232. package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-HROLGN4F.js} +16 -15
  233. package/{updateCommands-CPATDG6J.js → updateCommands-GJGRS6JK.js} +3 -3
  234. package/{updateDialogTitleAction-IMIRJRQQ.js → updateDialogTitleAction-5OSEDGRK.js} +40 -38
  235. package/{usageCommand-2BF74MKF.js → usageCommand-WI6SQOPB.js} +2 -2
  236. package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-WQRLLZAT.js} +3 -3
  237. package/webapi-QVV65DQF.js +2487 -0
  238. package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-C7LGVWYX.js} +2 -2
  239. package/workContext-Y3ADAPZU.js +14 -0
  240. package/workContextAccess-VU5I4LKZ.js +11 -0
  241. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  242. package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-P2SJVV3S.js} +2 -2
  243. package/agentRecordCommands-IZYUVHME.js +0 -177
  244. package/agentRunCommand-QM7ETUTX.js +0 -209
  245. package/chunk-2YGBI2XB.js +0 -30
  246. package/chunk-5ZMIIR23.js +0 -265
  247. package/chunk-5ZUOVCKT.js +0 -32
  248. package/chunk-62HXNQVV.js +0 -134
  249. package/chunk-FJSNBZXR.js +0 -142
  250. package/chunk-FPBJM2BW.js +0 -689
  251. package/chunk-JQZRSXS5.js +0 -90
  252. package/chunk-P2ZLUIW2.js +0 -795
  253. package/chunk-PPJYZRSQ.js +0 -160
  254. package/chunk-TUSTONB3.js +0 -81
  255. package/chunk-ZXF6D3I6.js +0 -359
  256. package/cliLocalAgentRecordReader-H3HYQRRR.js +0 -91
  257. package/lib-OT5OTXRU.js +0 -21046
  258. package/localRuntimeAuthority-IBJAT62G.js +0 -16
  259. package/machineWsRunDispatch-L6H7J66T.js +0 -192
  260. package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
@@ -0,0 +1,650 @@
1
+ // packages/database-engine/cliAuthorityBrokerClient.ts
2
+ import { createConnection } from "node:net";
3
+ import { connect as connectTls } from "node:tls";
4
+ var DEFAULT_ITERATOR_PAGE_SIZE = 200;
5
+ var CliAuthorityBrokerUnavailableError = class extends Error {
6
+ reason = "cli_authority_broker_unavailable";
7
+ status = 503;
8
+ endpoint;
9
+ constructor(endpoint, cause) {
10
+ super(`CLI authority broker unavailable at ${endpoint}. Start the local authority broker and retry.`);
11
+ this.name = "CliAuthorityBrokerUnavailableError";
12
+ this.endpoint = endpoint;
13
+ if (cause !== void 0) {
14
+ this.cause = cause;
15
+ }
16
+ }
17
+ };
18
+ var CliAuthorityBrokerTimeoutError = class extends Error {
19
+ reason = "cli_authority_broker_timeout";
20
+ endpoint;
21
+ timeoutMs;
22
+ constructor(endpoint, timeoutMs, cause) {
23
+ super(`CLI authority broker request at ${endpoint} timed out after ${timeoutMs}ms`);
24
+ this.name = "CliAuthorityBrokerTimeoutError";
25
+ this.endpoint = endpoint;
26
+ this.timeoutMs = timeoutMs;
27
+ if (cause !== void 0) {
28
+ this.cause = cause;
29
+ }
30
+ }
31
+ };
32
+ var CliAuthorityBrokerProtocolError = class extends Error {
33
+ code;
34
+ retryable;
35
+ constructor(error) {
36
+ super(error.message);
37
+ this.name = "CliAuthorityBrokerProtocolError";
38
+ this.code = error.code;
39
+ this.retryable = error.retryable === true;
40
+ }
41
+ };
42
+ function isCliAuthorityBrokerUnavailableError(error) {
43
+ return error instanceof CliAuthorityBrokerUnavailableError || typeof error === "object" && error !== null && error.reason === "cli_authority_broker_unavailable" && error.status === 503;
44
+ }
45
+ function isCliAuthorityBrokerTimeoutError(error) {
46
+ return error instanceof CliAuthorityBrokerTimeoutError || typeof error === "object" && error !== null && error.reason === "cli_authority_broker_timeout";
47
+ }
48
+ function isCliAuthorityBrokerProtocolError(error) {
49
+ return error instanceof CliAuthorityBrokerProtocolError || typeof error === "object" && error !== null && error.name === "CliAuthorityBrokerProtocolError";
50
+ }
51
+ function isBrokerUnavailableCause(error) {
52
+ if (!error) return false;
53
+ if (isCliAuthorityBrokerTimeoutError(error) || isCliAuthorityBrokerProtocolError(error)) {
54
+ return false;
55
+ }
56
+ if (isCliAuthorityBrokerUnavailableError(error)) {
57
+ return true;
58
+ }
59
+ if (typeof error === "object") {
60
+ const code = error.code;
61
+ if (typeof code === "string" && /^(ECONNREFUSED|ENOENT|ECONNRESET|EPIPE|EADDRNOTAVAIL|ENETUNREACH|EHOSTUNREACH)$/i.test(code)) {
62
+ return true;
63
+ }
64
+ }
65
+ const message = error instanceof Error ? error.message : String(error);
66
+ if (/timed out/i.test(message)) return false;
67
+ if (/malformed response|protocol mismatch/i.test(message)) return false;
68
+ return /ECONNREFUSED|ENOENT|ECONNRESET|EPIPE|closed connection without response|returned no response/i.test(message);
69
+ }
70
+ function resolveBrokerSocketTarget(endpoint) {
71
+ if (endpoint.startsWith("unix://")) {
72
+ return { kind: "unix", path: endpoint.slice("unix://".length) };
73
+ }
74
+ if (endpoint.startsWith("tcp://")) {
75
+ const url = new URL(endpoint);
76
+ return {
77
+ kind: "tcp",
78
+ host: url.hostname,
79
+ port: Number(url.port)
80
+ };
81
+ }
82
+ throw new Error(`Unsupported CLI authority broker endpoint: ${endpoint}`);
83
+ }
84
+ function isRetryableReadRequest(request) {
85
+ return request.type === "get" || request.type === "batchGet" || request.type === "status" || request.type === "iterator" || request.type === "close";
86
+ }
87
+ function isUnsupportedBrokerRequestPayload(parsed) {
88
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return false;
89
+ if (parsed.ok !== false) return false;
90
+ const error = parsed.error;
91
+ if (!error || typeof error !== "object") return false;
92
+ const code = typeof error.code === "string" ? error.code : "";
93
+ const message = typeof error.message === "string" ? error.message : "";
94
+ return code === "UNSUPPORTED_REQUEST" || code === "BROKER_UNSUPPORTED_REQUEST" || /unsupported broker request/i.test(message);
95
+ }
96
+ function isUnsupportedBrokerRequestError(error) {
97
+ if (!isCliAuthorityBrokerProtocolError(error)) return false;
98
+ return error.code === "UNSUPPORTED_REQUEST" || error.code === "BROKER_UNSUPPORTED_REQUEST" || /unsupported broker request/i.test(error.message);
99
+ }
100
+ function isNotFoundBrokerError(error) {
101
+ if (isCliAuthorityBrokerProtocolError(error)) {
102
+ if (error.code === "LEVEL_NOT_FOUND" || error.code === "NOT_FOUND") {
103
+ return true;
104
+ }
105
+ return /^(?:not\s*found|key not found)/i.test(error.message.trim());
106
+ }
107
+ if (typeof error === "object" && error !== null) {
108
+ const code = error.code;
109
+ if (code === "LEVEL_NOT_FOUND" || code === "NOT_FOUND") return true;
110
+ if (error.notFound === true) return true;
111
+ }
112
+ return false;
113
+ }
114
+ function createCliAuthorityBrokerSocketInvoker(options) {
115
+ const target = resolveBrokerSocketTarget(options.endpoint);
116
+ const connectedEvent = options.tls ? "secureConnect" : "connect";
117
+ const connect = () => target.kind === "unix" ? createConnection(target.path) : options.tls ? connectTls({ host: target.host, port: target.port, servername: "localhost", ...options.tls, rejectUnauthorized: true }) : createConnection({ host: target.host, port: target.port });
118
+ const timeoutMs = options.timeoutMs ?? 5e3;
119
+ const idleTimeoutMs = options.idleTimeoutMs ?? 5e3;
120
+ let nextRequestId = 1;
121
+ let activeConn = null;
122
+ let legacyBareMode = false;
123
+ let explicitlyClosed = false;
124
+ const legacyInFlight = /* @__PURE__ */ new Set();
125
+ const clearIdleTimer = (conn) => {
126
+ if (conn.idleTimer) {
127
+ clearTimeout(conn.idleTimer);
128
+ conn.idleTimer = null;
129
+ }
130
+ };
131
+ const destroyConnection = (conn) => {
132
+ if (activeConn === conn) activeConn = null;
133
+ conn.closed = true;
134
+ clearIdleTimer(conn);
135
+ if (!conn.socket.destroyed) {
136
+ conn.socket.destroy();
137
+ }
138
+ };
139
+ const maybeScheduleIdle = (conn) => {
140
+ if (conn.closed || conn.pending.size > 0) return;
141
+ conn.socket.unref?.();
142
+ clearIdleTimer(conn);
143
+ if (idleTimeoutMs > 0) {
144
+ conn.idleTimer = setTimeout(() => {
145
+ if (conn.pending.size === 0 && !conn.closed) {
146
+ destroyConnection(conn);
147
+ }
148
+ }, idleTimeoutMs);
149
+ conn.idleTimer.unref?.();
150
+ }
151
+ };
152
+ const settlePending = (conn, req, outcome) => {
153
+ if (req.settled) return;
154
+ req.settled = true;
155
+ clearTimeout(req.timer);
156
+ conn.pending.delete(req.id);
157
+ const qIndex = conn.writeQueue.indexOf(req);
158
+ if (qIndex !== -1) conn.writeQueue.splice(qIndex, 1);
159
+ outcome();
160
+ };
161
+ const createClosedError = () => new CliAuthorityBrokerUnavailableError(
162
+ options.endpoint,
163
+ new Error(`CLI authority broker invoker at ${options.endpoint} closed`)
164
+ );
165
+ const sendLegacyBare = (request) => {
166
+ if (explicitlyClosed) {
167
+ return Promise.reject(createClosedError());
168
+ }
169
+ return new Promise((resolve, reject) => {
170
+ const socket = connect();
171
+ let settled = false;
172
+ let buffer = "";
173
+ let timer;
174
+ const cleanup = () => {
175
+ clearTimeout(timer);
176
+ legacyInFlight.delete(closeHandle);
177
+ };
178
+ const finishResolve = (response) => {
179
+ if (settled) return;
180
+ settled = true;
181
+ cleanup();
182
+ if (!socket.destroyed) socket.destroy();
183
+ resolve(response);
184
+ };
185
+ const finishReject = (error) => {
186
+ if (settled) return;
187
+ settled = true;
188
+ cleanup();
189
+ if (!socket.destroyed) socket.destroy();
190
+ reject(error);
191
+ };
192
+ const closeHandle = {
193
+ close: () => {
194
+ finishReject(createClosedError());
195
+ }
196
+ };
197
+ legacyInFlight.add(closeHandle);
198
+ timer = setTimeout(() => {
199
+ finishReject(new CliAuthorityBrokerTimeoutError(options.endpoint, timeoutMs));
200
+ }, timeoutMs);
201
+ socket.setEncoding("utf8");
202
+ socket.on(connectedEvent, () => {
203
+ if (settled || explicitlyClosed) return;
204
+ socket.write(`${JSON.stringify(request)}
205
+ `);
206
+ });
207
+ const handleLine = (line) => {
208
+ try {
209
+ finishResolve(JSON.parse(line));
210
+ } catch (parseError) {
211
+ finishReject(
212
+ new CliAuthorityBrokerProtocolError({
213
+ code: "MALFORMED_RESPONSE",
214
+ message: `CLI authority broker at ${options.endpoint} returned malformed response: ${parseError instanceof Error ? parseError.message : String(parseError)}`
215
+ })
216
+ );
217
+ }
218
+ };
219
+ socket.on("data", (chunk) => {
220
+ if (settled) return;
221
+ buffer += chunk;
222
+ const newlineIndex = buffer.indexOf("\n");
223
+ if (newlineIndex === -1) return;
224
+ const line = buffer.slice(0, newlineIndex).trim();
225
+ buffer = buffer.slice(newlineIndex + 1);
226
+ if (!line) return;
227
+ handleLine(line);
228
+ });
229
+ socket.on("end", () => {
230
+ if (settled) return;
231
+ const trailing = buffer.trim();
232
+ if (trailing) {
233
+ handleLine(trailing);
234
+ return;
235
+ }
236
+ finishReject(
237
+ new CliAuthorityBrokerUnavailableError(
238
+ options.endpoint,
239
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
240
+ )
241
+ );
242
+ });
243
+ socket.on("error", (error) => {
244
+ finishReject(
245
+ isBrokerUnavailableCause(error) ? new CliAuthorityBrokerUnavailableError(options.endpoint, error) : error
246
+ );
247
+ });
248
+ socket.on("close", () => {
249
+ finishReject(
250
+ new CliAuthorityBrokerUnavailableError(
251
+ options.endpoint,
252
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
253
+ )
254
+ );
255
+ });
256
+ });
257
+ };
258
+ const processResponseLine = (conn, line) => {
259
+ let parsed;
260
+ try {
261
+ parsed = JSON.parse(line);
262
+ } catch (parseError) {
263
+ const protocolError2 = new CliAuthorityBrokerProtocolError({
264
+ code: "MALFORMED_RESPONSE",
265
+ message: `CLI authority broker at ${options.endpoint} returned malformed response: ${parseError instanceof Error ? parseError.message : String(parseError)}`
266
+ });
267
+ const pendingRequests2 = [...conn.pending.values()];
268
+ destroyConnection(conn);
269
+ for (const req of pendingRequests2) {
270
+ settlePending(conn, req, () => req.reject(protocolError2));
271
+ }
272
+ return false;
273
+ }
274
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed) && "response" in parsed && (typeof parsed.id === "number" || typeof parsed.id === "string")) {
275
+ const id = Number(parsed.id);
276
+ const req = conn.pending.get(id);
277
+ if (!req) return true;
278
+ conn.reused = true;
279
+ settlePending(conn, req, () => {
280
+ req.resolve(parsed.response);
281
+ });
282
+ return true;
283
+ }
284
+ const pendingRequests = [...conn.pending.values()];
285
+ if (isUnsupportedBrokerRequestPayload(parsed)) {
286
+ legacyBareMode = true;
287
+ for (const req of pendingRequests) {
288
+ settlePending(conn, req, () => {
289
+ if (explicitlyClosed) {
290
+ req.reject(createClosedError());
291
+ return;
292
+ }
293
+ void sendLegacyBare(req.request).then(req.resolve, req.reject);
294
+ });
295
+ }
296
+ destroyConnection(conn);
297
+ return false;
298
+ }
299
+ if (pendingRequests.length === 1) {
300
+ const [onlyReq] = pendingRequests;
301
+ destroyConnection(conn);
302
+ settlePending(conn, onlyReq, () => {
303
+ onlyReq.resolve(parsed);
304
+ });
305
+ return false;
306
+ }
307
+ if (pendingRequests.length > 1 && parsed && typeof parsed === "object" && parsed.ok === false) {
308
+ destroyConnection(conn);
309
+ for (const req of pendingRequests) {
310
+ settlePending(conn, req, () => {
311
+ req.resolve(parsed);
312
+ });
313
+ }
314
+ return false;
315
+ }
316
+ const protocolError = new CliAuthorityBrokerProtocolError({
317
+ code: "MALFORMED_RESPONSE",
318
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
319
+ });
320
+ destroyConnection(conn);
321
+ for (const req of pendingRequests) {
322
+ settlePending(conn, req, () => req.reject(protocolError));
323
+ }
324
+ return false;
325
+ };
326
+ const failRemainingPending = (conn, errorFactory) => {
327
+ const remaining = [...conn.pending.values()];
328
+ if (remaining.length === 0) return;
329
+ const canRetryOnDrop = !explicitlyClosed && conn.reused;
330
+ for (const req of remaining) {
331
+ settlePending(conn, req, () => {
332
+ if (!explicitlyClosed && !req.retried && (!req.written || canRetryOnDrop && isRetryableReadRequest(req.request))) {
333
+ void sendWithRetry(req.request, true).then(req.resolve, req.reject);
334
+ return;
335
+ }
336
+ req.reject(errorFactory());
337
+ });
338
+ }
339
+ };
340
+ const getOrOpenConnection = () => {
341
+ if (activeConn && !activeConn.closed && !activeConn.socket.destroyed && activeConn.socket.writable) {
342
+ clearIdleTimer(activeConn);
343
+ activeConn.socket.ref?.();
344
+ return activeConn;
345
+ }
346
+ const socket = connect();
347
+ const conn = {
348
+ socket,
349
+ connected: false,
350
+ closed: false,
351
+ reused: false,
352
+ buffer: "",
353
+ pending: /* @__PURE__ */ new Map(),
354
+ writeQueue: [],
355
+ idleTimer: null
356
+ };
357
+ activeConn = conn;
358
+ socket.setEncoding("utf8");
359
+ socket.setNoDelay?.(true);
360
+ socket.on(connectedEvent, () => {
361
+ if (conn.closed) return;
362
+ conn.connected = true;
363
+ const queued = conn.writeQueue.splice(0, conn.writeQueue.length);
364
+ for (const req of queued) {
365
+ if (req.settled) continue;
366
+ req.written = true;
367
+ socket.write(`${JSON.stringify({ id: req.id, request: req.request })}
368
+ `);
369
+ }
370
+ });
371
+ socket.on("data", (chunk) => {
372
+ if (conn.closed) return;
373
+ conn.buffer += chunk;
374
+ let newlineIndex;
375
+ while ((newlineIndex = conn.buffer.indexOf("\n")) !== -1) {
376
+ const line = conn.buffer.slice(0, newlineIndex).trim();
377
+ conn.buffer = conn.buffer.slice(newlineIndex + 1);
378
+ if (!line) continue;
379
+ if (!processResponseLine(conn, line)) return;
380
+ }
381
+ maybeScheduleIdle(conn);
382
+ });
383
+ socket.on("end", () => {
384
+ const trailing = conn.buffer.trim();
385
+ conn.buffer = "";
386
+ if (trailing && conn.pending.size > 0 && !conn.closed) {
387
+ processResponseLine(conn, trailing);
388
+ }
389
+ if (activeConn === conn) activeConn = null;
390
+ conn.closed = true;
391
+ clearIdleTimer(conn);
392
+ failRemainingPending(
393
+ conn,
394
+ () => new CliAuthorityBrokerUnavailableError(
395
+ options.endpoint,
396
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
397
+ )
398
+ );
399
+ });
400
+ socket.on("error", (error) => {
401
+ if (activeConn === conn) activeConn = null;
402
+ conn.closed = true;
403
+ clearIdleTimer(conn);
404
+ failRemainingPending(
405
+ conn,
406
+ () => isBrokerUnavailableCause(error) ? new CliAuthorityBrokerUnavailableError(options.endpoint, error) : error
407
+ );
408
+ });
409
+ socket.on("close", () => {
410
+ if (activeConn === conn) activeConn = null;
411
+ conn.closed = true;
412
+ clearIdleTimer(conn);
413
+ failRemainingPending(
414
+ conn,
415
+ () => new CliAuthorityBrokerUnavailableError(
416
+ options.endpoint,
417
+ new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
418
+ )
419
+ );
420
+ });
421
+ return conn;
422
+ };
423
+ const sendWithRetry = (request, retried) => {
424
+ if (explicitlyClosed) {
425
+ return Promise.reject(createClosedError());
426
+ }
427
+ if (legacyBareMode) {
428
+ return sendLegacyBare(request);
429
+ }
430
+ return new Promise((resolve, reject) => {
431
+ const conn = getOrOpenConnection();
432
+ const id = nextRequestId++;
433
+ const req = {
434
+ id,
435
+ request,
436
+ resolve,
437
+ reject,
438
+ timer: void 0,
439
+ settled: false,
440
+ written: false,
441
+ retried
442
+ };
443
+ req.timer = setTimeout(() => {
444
+ if (req.settled) return;
445
+ settlePending(conn, req, () => {
446
+ if (conn.pending.size === 0) {
447
+ destroyConnection(conn);
448
+ }
449
+ req.reject(new CliAuthorityBrokerTimeoutError(options.endpoint, timeoutMs));
450
+ });
451
+ }, timeoutMs);
452
+ conn.pending.set(id, req);
453
+ if (conn.connected) {
454
+ req.written = true;
455
+ conn.socket.write(`${JSON.stringify({ id: req.id, request: req.request })}
456
+ `);
457
+ } else {
458
+ conn.writeQueue.push(req);
459
+ }
460
+ });
461
+ };
462
+ const invoker = (request) => {
463
+ if (explicitlyClosed) {
464
+ return Promise.reject(createClosedError());
465
+ }
466
+ return legacyBareMode ? sendLegacyBare(request) : sendWithRetry(request, false);
467
+ };
468
+ invoker.close = () => {
469
+ explicitlyClosed = true;
470
+ const conn = activeConn;
471
+ if (conn) {
472
+ destroyConnection(conn);
473
+ failRemainingPending(conn, createClosedError);
474
+ }
475
+ for (const handle of [...legacyInFlight]) {
476
+ handle.close();
477
+ }
478
+ };
479
+ return invoker;
480
+ }
481
+ async function invokeBrokerRequest(options, request) {
482
+ try {
483
+ const response = await options.invoke(request);
484
+ if (!response || typeof response !== "object" || typeof response.ok !== "boolean") {
485
+ throw new CliAuthorityBrokerProtocolError({
486
+ code: "MALFORMED_RESPONSE",
487
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
488
+ });
489
+ }
490
+ if (response.ok) {
491
+ if (!response.result || typeof response.result !== "object") {
492
+ throw new CliAuthorityBrokerProtocolError({
493
+ code: "MALFORMED_RESPONSE",
494
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
495
+ });
496
+ }
497
+ return response.result;
498
+ }
499
+ if (!response.error || typeof response.error !== "object" || typeof response.error.code !== "string" || typeof response.error.message !== "string") {
500
+ throw new CliAuthorityBrokerProtocolError({
501
+ code: "MALFORMED_RESPONSE",
502
+ message: `CLI authority broker protocol mismatch at ${options.endpoint}`
503
+ });
504
+ }
505
+ if (response.error.code === "BROKER_UNAVAILABLE") {
506
+ throw new CliAuthorityBrokerUnavailableError(options.endpoint, response.error);
507
+ }
508
+ throw new CliAuthorityBrokerProtocolError(response.error);
509
+ } catch (error) {
510
+ if (isCliAuthorityBrokerTimeoutError(error)) throw error;
511
+ if (isCliAuthorityBrokerUnavailableError(error)) throw error;
512
+ if (isCliAuthorityBrokerProtocolError(error)) throw error;
513
+ if (isBrokerUnavailableCause(error)) {
514
+ throw new CliAuthorityBrokerUnavailableError(options.endpoint, error);
515
+ }
516
+ throw error;
517
+ }
518
+ }
519
+ function createCliAuthorityBrokerClient(options) {
520
+ const pageSize = options.iteratorPageSize ?? DEFAULT_ITERATOR_PAGE_SIZE;
521
+ let batchGetUnsupported = false;
522
+ const fallbackBatchGet = (keys) => Promise.all(
523
+ keys.map(async (key) => {
524
+ try {
525
+ const result = await invokeBrokerRequest(options, { type: "get", key });
526
+ if (result.type !== "get") {
527
+ throw new Error(`CLI authority broker protocol mismatch for get at ${options.endpoint}`);
528
+ }
529
+ return { ok: true, value: result.value };
530
+ } catch (error) {
531
+ if (isNotFoundBrokerError(error)) {
532
+ return {
533
+ ok: false,
534
+ error: {
535
+ code: isCliAuthorityBrokerProtocolError(error) ? error.code : typeof error?.code === "string" ? error.code : "NOT_FOUND",
536
+ message: error instanceof Error ? error.message : String(error),
537
+ ...isCliAuthorityBrokerProtocolError(error) && error.retryable ? { retryable: true } : {}
538
+ }
539
+ };
540
+ }
541
+ throw error;
542
+ }
543
+ })
544
+ );
545
+ return {
546
+ get location() {
547
+ return options.location ?? options.endpoint;
548
+ },
549
+ get status() {
550
+ return options.status ?? "broker";
551
+ },
552
+ async open() {
553
+ await invokeBrokerRequest(options, { type: "status" });
554
+ },
555
+ async close() {
556
+ },
557
+ async get(key) {
558
+ const result = await invokeBrokerRequest(options, { type: "get", key });
559
+ if (result.type !== "get") {
560
+ throw new Error(`CLI authority broker protocol mismatch for get at ${options.endpoint}`);
561
+ }
562
+ return result.value;
563
+ },
564
+ async batchGet(keys) {
565
+ if (batchGetUnsupported) {
566
+ return fallbackBatchGet(keys);
567
+ }
568
+ try {
569
+ const result = await invokeBrokerRequest(options, { type: "batchGet", keys });
570
+ if (result.type !== "batchGet" || !Array.isArray(result.items) || result.items.length !== keys.length) {
571
+ throw new CliAuthorityBrokerProtocolError({
572
+ code: "BROKER_PROTOCOL_MISMATCH",
573
+ message: `CLI authority broker protocol mismatch for batchGet at ${options.endpoint}`
574
+ });
575
+ }
576
+ return result.items;
577
+ } catch (error) {
578
+ if (isUnsupportedBrokerRequestError(error)) {
579
+ batchGetUnsupported = true;
580
+ return fallbackBatchGet(keys);
581
+ }
582
+ throw error;
583
+ }
584
+ },
585
+ async conditionalPut(key, expectedRevision, value) {
586
+ const result = await invokeBrokerRequest(options, { type: "conditionalPut", key, expectedRevision, value });
587
+ if (!result || result.type !== "conditionalPut" || result.status !== "updated" && result.status !== "conflict" || Object.keys(result).some((key2) => key2 !== "type" && key2 !== "status")) {
588
+ throw new CliAuthorityBrokerProtocolError({ code: "BROKER_PROTOCOL_MISMATCH", message: "Invalid conditionalPut response" });
589
+ }
590
+ return { status: result.status };
591
+ },
592
+ async put(key, value) {
593
+ await invokeBrokerRequest(options, { type: "put", key, value });
594
+ },
595
+ async del(key) {
596
+ await invokeBrokerRequest(options, { type: "del", key });
597
+ },
598
+ async batchWrite(ops) {
599
+ await invokeBrokerRequest(options, { type: "batchWrite", ops });
600
+ },
601
+ createBatch() {
602
+ const ops = [];
603
+ return {
604
+ put(key, value) {
605
+ ops.push({ type: "put", key, value });
606
+ },
607
+ del(key) {
608
+ ops.push({ type: "del", key });
609
+ },
610
+ async write() {
611
+ await invokeBrokerRequest(options, { type: "batchWrite", ops });
612
+ }
613
+ };
614
+ },
615
+ iterator(iteratorOptions = {}) {
616
+ return async function* iterate() {
617
+ let cursor = void 0;
618
+ while (true) {
619
+ const result = await invokeBrokerRequest(options, {
620
+ type: "iterator",
621
+ options: iteratorOptions,
622
+ cursor,
623
+ limit: pageSize
624
+ });
625
+ if (result.type !== "iterator") {
626
+ throw new Error(
627
+ `CLI authority broker protocol mismatch for iterator at ${options.endpoint}`
628
+ );
629
+ }
630
+ for (const entry of result.page.entries) {
631
+ yield entry;
632
+ }
633
+ if (result.page.done || !result.page.nextCursor) return;
634
+ cursor = result.page.nextCursor;
635
+ }
636
+ }();
637
+ }
638
+ };
639
+ }
640
+
641
+ export {
642
+ CliAuthorityBrokerUnavailableError,
643
+ CliAuthorityBrokerTimeoutError,
644
+ CliAuthorityBrokerProtocolError,
645
+ isCliAuthorityBrokerUnavailableError,
646
+ isCliAuthorityBrokerTimeoutError,
647
+ isCliAuthorityBrokerProtocolError,
648
+ createCliAuthorityBrokerSocketInvoker,
649
+ createCliAuthorityBrokerClient
650
+ };
@@ -0,0 +1,9 @@
1
+ // packages/core/sha256.ts
2
+ import SHA256 from "crypto-js/sha256.js";
3
+ function sha256Hex(text) {
4
+ return SHA256(text).toString();
5
+ }
6
+
7
+ export {
8
+ sha256Hex
9
+ };