nolo-cli 0.258.0-alpha.1 → 0.260.0-alpha.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 (316) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-E2LL7FPO.js → _executeModel-EO6JFCOF.js} +97 -83
  3. package/accountResolver-NGICIMEE.js +1 -1
  4. package/{action-C6IQAKN4.js → action-WIA56QT4.js} +12 -10
  5. package/{addContentAction-53364YDW.js → addContentAction-OCMWZLYG.js} +14 -13
  6. package/{addDialogAgentAction-U5DD5EN5.js → addDialogAgentAction-ER2NZ7BC.js} +20 -24
  7. package/{agentDeleteCommand-ORNRRKJO.js → agentDeleteCommand-KSXSNPAU.js} +184 -146
  8. package/{agentEmailCommands-2ALVFOD5.js → agentEmailCommands-NXRWS7NS.js} +142 -126
  9. package/{agentGrantCommands-L6O2HVJI.js → agentGrantCommands-D2S7LCTU.js} +8 -5
  10. package/{agentListCommands-6I4NQPR4.js → agentListCommands-PFXGZZ3Y.js} +87 -68
  11. package/{agentMachineCommands-PNHTIJ6A.js → agentMachineCommands-2Q55CSL4.js} +68 -59
  12. package/{agentProviderCommands-QLTABYR7.js → agentProviderCommands-EUNS7Y2Z.js} +10 -7
  13. package/{agentPullCommand-2EYJ5ENC.js → agentPullCommand-S2VMPSWL.js} +9 -6
  14. package/agentRecordCommands-FUFI526H.js +210 -0
  15. package/agentRun-ZNMUPDHF.js +250 -0
  16. package/agentRunCommand-ISVQ2UYC.js +248 -0
  17. package/{agentRunControl-3TIVJ3SR.js → agentRunControl-NEK44LDM.js} +19 -12
  18. package/{agentRuntimeLocal-3MAEFYSB.js → agentRuntimeLocal-SST4EPLT.js} +62 -49
  19. package/{agentSlice-KOQXUPKT.js → agentSlice-4ZJJJN4M.js} +15 -18
  20. package/appConfigCommands-MPHS6FHD.js +417 -0
  21. package/{appDeleteCommands-FEPN62UR.js → appDeleteCommands-W26WGENW.js} +68 -58
  22. package/{appDeployCommands-DPFEWFYZ.js → appDeployCommands-ER7IOF5E.js} +74 -59
  23. package/{appDeployStatusCommands-LQ5X5KVX.js → appDeployStatusCommands-VKLL3A77.js} +68 -58
  24. package/{appGetCommands-W3JBBIF7.js → appGetCommands-P6GXJNUD.js} +74 -58
  25. package/{appListCommands-LUHZS7JU.js → appListCommands-ACA2IZZM.js} +74 -58
  26. package/appMigrateCommands-OGF4E2W6.js +230 -0
  27. package/appSourceCommands-GAHVBRUM.js +279 -0
  28. package/{authCommand-HKSXJT3J.js → authCommand-PXE7NZTQ.js} +26 -40
  29. package/{authCommands-T5FODCEG.js → authCommands-AZPYXTUB.js} +20 -17
  30. package/{builtinSkillRegistry-FVEEO4U2.js → builtinSkillRegistry-6XUWMAV5.js} +8 -6
  31. package/{chromeOpsCommands-4UIKH26F.js → chromeOpsCommands-7UKKUOBU.js} +68 -18
  32. package/{chunk-KO5PFS74.js → chunk-2CKFROQS.js} +2454 -1115
  33. package/{chunk-6N4IKMTH.js → chunk-2I4R6ZRV.js} +40 -26
  34. package/{chunk-FXEPZKNJ.js → chunk-2MIZHEND.js} +506 -64
  35. package/{chunk-TLE77UJ5.js → chunk-2OROOEOQ.js} +0 -1
  36. package/{chunk-6RSNVJGO.js → chunk-2ZBPWX7N.js} +4 -4
  37. package/chunk-35JIFLIG.js +30 -0
  38. package/{chunk-ZYPXOQS2.js → chunk-3EPED3UO.js} +1 -1
  39. package/{chunk-DNNPARJK.js → chunk-3QMN3T6L.js} +50 -37
  40. package/{chunk-DMPZMYH4.js → chunk-3R4AYHJR.js} +13 -1
  41. package/{chunk-HPDLPEUG.js → chunk-42JZNSAY.js} +267 -234
  42. package/{chunk-223KZUJ6.js → chunk-4HZCBA4Q.js} +18 -15
  43. package/{chunk-C5A54QS7.js → chunk-4INJGWE3.js} +18 -5
  44. package/chunk-4IVMDQBA.js +261 -0
  45. package/chunk-4Y6CZ2N4.js +82 -0
  46. package/{chunk-OKAXQFON.js → chunk-52BNL6GP.js} +4 -4
  47. package/{chunk-KZ4A7EIV.js → chunk-56OAS5RZ.js} +1 -1
  48. package/{chunk-QGFLVQ6E.js → chunk-6KUTNAPU.js} +4 -14
  49. package/{chunk-MNFUKRRU.js → chunk-6XAAKRJB.js} +7 -7
  50. package/{chunk-P27E22MA.js → chunk-6Z6DGDPI.js} +1 -1
  51. package/chunk-72VWN4VK.js +51 -0
  52. package/{chunk-2RZBFJEG.js → chunk-75FZ2Z7C.js} +16027 -17392
  53. package/{chunk-ADYWV732.js → chunk-76B6YUQS.js} +264 -177
  54. package/{chunk-AKBNCTPY.js → chunk-76K4GTY5.js} +1 -1
  55. package/{chunk-ZMJMHXYX.js → chunk-7HUCUD2I.js} +3 -3
  56. package/chunk-7LR2IFUH.js +100 -0
  57. package/{chunk-S73EPYNC.js → chunk-7LS5ATRP.js} +20 -6
  58. package/{chunk-Y2TCTNUD.js → chunk-7QO6YSA4.js} +4 -4
  59. package/{chunk-TF427WGH.js → chunk-7RYH7YIY.js} +19 -27
  60. package/{chunk-KHYSFS3W.js → chunk-A454UXB6.js} +148 -73
  61. package/chunk-AMNZPQCY.js +635 -0
  62. package/chunk-AMTF6FJD.js +356 -0
  63. package/{chunk-MUDMYJCM.js → chunk-AQNWWJLH.js} +2 -56
  64. package/{chunk-WSLL7VV4.js → chunk-B4NA5UJR.js} +9 -9
  65. package/{chunk-LHCGKAFO.js → chunk-BKP325XS.js} +184 -112
  66. package/{chunk-PENRYZ4D.js → chunk-BPB3T5EU.js} +4 -7
  67. package/{chunk-46FETNLF.js → chunk-BTIFQBYW.js} +7 -6
  68. package/{chunk-2JHGUL5K.js → chunk-BVYHE6QD.js} +2 -2
  69. package/{chunk-KXOPLLFP.js → chunk-CA7LGAHV.js} +69 -9
  70. package/{chunk-2FZVXOFX.js → chunk-CEIWXKHP.js} +112 -200
  71. package/{chunk-AIFQKNPP.js → chunk-CL33RFD7.js} +1 -1
  72. package/{chunk-JAGD4PSH.js → chunk-CRGPRAJ4.js} +46 -42
  73. package/{chunk-P4R5KXU7.js → chunk-CW6LRDSF.js} +5 -5
  74. package/{chunk-BD22OFDQ.js → chunk-CZHIOBBK.js} +8 -3
  75. package/chunk-D3ONA3FP.js +762 -0
  76. package/chunk-D3SAQ6T7.js +1697 -0
  77. package/{chunk-PIVTQRX6.js → chunk-DDKA6V6X.js} +111 -12
  78. package/{chunk-KQHEGELM.js → chunk-DEAII55O.js} +16 -6
  79. package/{chunk-J55F3IEZ.js → chunk-DKJQEFNG.js} +1 -1
  80. package/chunk-DLXL4NSL.js +1179 -0
  81. package/{chunk-EJQE5HB7.js → chunk-DSBRIUX5.js} +4 -2
  82. package/{chunk-XRGBJHZX.js → chunk-E36V7MPY.js} +9 -5
  83. package/{chunk-4YPH5KRA.js → chunk-EDKMRDET.js} +1 -1
  84. package/chunk-EJHLDJWZ.js +58 -0
  85. package/{chunk-E4HBZDV6.js → chunk-EMFZXJTN.js} +15 -47
  86. package/chunk-ER6NTALN.js +34 -0
  87. package/chunk-EUHMI5KG.js +101 -0
  88. package/{chunk-YQLAFJRQ.js → chunk-FBNVJ2TO.js} +1 -1
  89. package/{chunk-EXD7S7QW.js → chunk-FF5ZRKW7.js} +12 -7
  90. package/{chunk-7PTWFSZZ.js → chunk-FGD4NMTP.js} +4 -4
  91. package/{chunk-6XIE5ZGI.js → chunk-FGFJUFPS.js} +5 -6
  92. package/chunk-FI4DPLR7.js +902 -0
  93. package/chunk-FKVLQNGJ.js +25 -0
  94. package/{chunk-JCQ3WCQ3.js → chunk-FOC4TORM.js} +69 -3
  95. package/{chunk-JPXACKSW.js → chunk-G22P2J7O.js} +30 -81
  96. package/{chunk-7WHCIA5V.js → chunk-G5IAIGGD.js} +3 -8
  97. package/{chunk-IZHENZQ5.js → chunk-G5JGA5YM.js} +180 -31
  98. package/{chunk-7EUJ65PF.js → chunk-GMBWWBSJ.js} +782 -449
  99. package/{chunk-WS36XPJD.js → chunk-GYFKKTDI.js} +82 -6
  100. package/{chunk-APXC3SQO.js → chunk-GZ4I5EMM.js} +9 -9
  101. package/{chunk-324FWHUA.js → chunk-HHXF57CL.js} +12 -3
  102. package/chunk-HJTI7RZV.js +94 -0
  103. package/{chunk-JGVWHUYK.js → chunk-HPIY372N.js} +7 -7
  104. package/{chunk-Q2MPKE4B.js → chunk-HVRG27HI.js} +76 -26
  105. package/{chunk-HDKMVYNJ.js → chunk-I3NWAILT.js} +6 -4
  106. package/{chunk-MD7O2NN2.js → chunk-IM7HCFB4.js} +313 -275
  107. package/{chunk-DWES4SXY.js → chunk-INN2PBW7.js} +1 -1
  108. package/chunk-IV6VUVLJ.js +88 -0
  109. package/chunk-J42X32PV.js +472 -0
  110. package/{chunk-V6S5OZSP.js → chunk-JHQNWV2C.js} +4441 -2569
  111. package/{chunk-R7XWZDOH.js → chunk-JUMQJSQF.js} +1423 -282
  112. package/{chunk-BIDSIRTS.js → chunk-JUNYPVL6.js} +10 -16
  113. package/chunk-JVEKCQAP.js +222 -0
  114. package/{chunk-JW6OURKM.js → chunk-KAHYBAEN.js} +215 -473
  115. package/chunk-KDDXC2IH.js +148 -0
  116. package/chunk-KGKTN2NX.js +25 -0
  117. package/chunk-KGWE224L.js +246 -0
  118. package/chunk-L3UFGEDU.js +17157 -0
  119. package/{chunk-CBIGMWMI.js → chunk-LHJB4BXJ.js} +1 -1
  120. package/{chunk-DCTQJDDQ.js → chunk-LIH7WSX5.js} +23 -379
  121. package/chunk-LJOPY4TL.js +443 -0
  122. package/{chunk-TRRXYFTR.js → chunk-LOFRSJX2.js} +1 -0
  123. package/{chunk-SQL7YNED.js → chunk-LPXBBC32.js} +71 -5
  124. package/chunk-LXP53WGF.js +168 -0
  125. package/chunk-MDAYRIP7.js +1889 -0
  126. package/chunk-MRACVEPZ.js +7 -0
  127. package/chunk-NHLLXINQ.js +8 -0
  128. package/{chunk-VQR2ACSC.js → chunk-NTBTVKKB.js} +17 -25
  129. package/{chunk-LVZVSLKO.js → chunk-O7ZY6SUK.js} +5 -22
  130. package/{chunk-APQBEIOQ.js → chunk-P4XAHM4B.js} +1 -1
  131. package/chunk-PL5RKESU.js +40 -0
  132. package/{chunk-U2H426FE.js → chunk-PQ3QZMJK.js} +20 -4
  133. package/chunk-Q5FJJ6XI.js +103 -0
  134. package/{createAgentAutomationAction-HEZ3G5L4.js → chunk-QKM55LP2.js} +3 -160
  135. package/{chunk-SIHOY5YI.js → chunk-QZCLCAYC.js} +170 -164
  136. package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
  137. package/{chunk-JLZJL3WC.js → chunk-RDZ5OIAT.js} +370 -39
  138. package/{chunk-5RGU3J7P.js → chunk-REAE2SZK.js} +0 -1
  139. package/chunk-RF576RYE.js +117 -0
  140. package/chunk-RI7SXDJW.js +1317 -0
  141. package/{chunk-JOJH3KWV.js → chunk-RIOAPUGV.js} +242 -25
  142. package/{chunk-7B55IVLF.js → chunk-RL6H2A2Z.js} +2561 -4059
  143. package/{chunk-BZLGPM5B.js → chunk-RNLKWUVY.js} +7 -12
  144. package/{chunk-BB76X6O4.js → chunk-RWXHGPWJ.js} +1 -1
  145. package/chunk-S7BF2OGX.js +432 -0
  146. package/{chunk-6VEO7Z3Y.js → chunk-SD4MBKZ7.js} +6 -6
  147. package/{chunk-PNBQ5JTA.js → chunk-SGEBRBF3.js} +7 -4
  148. package/{chunk-6SOWMEAY.js → chunk-SR57FDTX.js} +2 -258
  149. package/{chunk-CEKRIR22.js → chunk-SU4NCTW4.js} +1 -1
  150. package/{chunk-LJ6WIQZO.js → chunk-SX6PDLBZ.js} +279 -149
  151. package/{chunk-6VNBJ7GI.js → chunk-T4WU747C.js} +5 -5
  152. package/{chunk-53W5BXLN.js → chunk-TCOHWKDM.js} +54 -55
  153. package/{chunk-KO5GO2BC.js → chunk-TXMFSGRY.js} +1 -1
  154. package/{chunk-UUCYUN6Y.js → chunk-UB7NV7NN.js} +1 -1
  155. package/{chunk-CVDJUPBN.js → chunk-UOLGGEEC.js} +774 -119
  156. package/{chunk-ADUCBH4M.js → chunk-USFG4EWQ.js} +51 -42
  157. package/{chunk-LLUBUHNT.js → chunk-UYZOBSSO.js} +5 -9
  158. package/{chunk-ONTHDYFU.js → chunk-VDC3BW24.js} +24 -10
  159. package/chunk-VH356OQ3.js +425 -0
  160. package/{chunk-U6QNVOR5.js → chunk-VKM7DOYB.js} +130 -6
  161. package/{chunk-3GGVFHWI.js → chunk-VPAO5WQX.js} +17 -14
  162. package/{chunk-OYUMJMC5.js → chunk-W2RQYNPI.js} +5 -0
  163. package/{chunk-C63KMRJE.js → chunk-W2Z5E2R7.js} +126 -698
  164. package/{chunk-4ZCTKB27.js → chunk-W5GKF5ZW.js} +1 -0
  165. package/{chunk-NUHQO3RB.js → chunk-WIVVNJUS.js} +1 -1
  166. package/chunk-WLJNHFEB.js +1710 -0
  167. package/chunk-WMBJDXMY.js +408 -0
  168. package/chunk-WSQLCWLQ.js +201 -0
  169. package/{chunk-YN23INFZ.js → chunk-WXD6Y7DW.js} +23 -2
  170. package/{chunk-RQKTCHQM.js → chunk-WY6DMHMG.js} +1 -1
  171. package/{chunk-MLK3FEXG.js → chunk-XJW6SLBZ.js} +3 -3
  172. package/{chunk-7BIJFGKS.js → chunk-XQFDCRG3.js} +105 -51
  173. package/chunk-XT6C2QZW.js +46 -0
  174. package/{chunk-NRUYSNSZ.js → chunk-Y7THFNVJ.js} +9 -9
  175. package/{chunk-ZEZC7IIM.js → chunk-YFSM2366.js} +35 -35
  176. package/{chunk-RD3QLZQV.js → chunk-YM5XULB2.js} +324 -2
  177. package/{chunk-BD5YJJLJ.js → chunk-YNP3ITPU.js} +19 -12
  178. package/{chunk-U35UUM5K.js → chunk-YOUSQIIK.js} +1 -1
  179. package/{chunk-RIWKZT7E.js → chunk-YRPIUIEQ.js} +11 -9
  180. package/{chunk-Z3JZ2R5F.js → chunk-YU235GGN.js} +25 -8
  181. package/chunk-YWEZSBLL.js +790 -0
  182. package/chunk-Z3KTXWWB.js +76 -0
  183. package/{chunk-YLAHYLDQ.js → chunk-ZC3CMUKU.js} +2 -89
  184. package/chunk-ZD7OULYZ.js +368 -0
  185. package/{chunk-5P3PPQVP.js → chunk-ZQAADXSF.js} +1 -1
  186. package/{chunk-HQUGB2HM.js → chunk-ZTCMXPIS.js} +62 -50
  187. package/{cliAgentConfigHelpers-BXHQ3PXP.js → cliAgentConfigHelpers-KMXS7JP5.js} +20 -14
  188. package/{cliAuthorityBrokerClient-TFNXJLXL.js → cliAuthorityBrokerClient-3SKOA7OZ.js} +3 -1
  189. package/cliAuthorityBrokerProcess-DCCUT4YQ.js +34 -0
  190. package/{cliEnvHelpers-CNMP3RDX.js → cliEnvHelpers-YDGDHIEE.js} +5 -2
  191. package/{cliExecutor-K6FDZTQ2.js → cliExecutor-Z62UBJ5S.js} +12 -6
  192. package/cliLocalAgentRecordReader-X2YHEBWI.js +113 -0
  193. package/cloudAutomationCommands-C6Q3BFRB.js +310 -0
  194. package/{commandRegistry-QKOJ5FIC.js → commandRegistry-TYYYTW5E.js} +263 -120
  195. package/{contentThunks-ZDBDDZP3.js → contentThunks-E6BJ5YSX.js} +45 -43
  196. package/{cooldownCommands-Y4ZQQ35D.js → cooldownCommands-FPAFS7XG.js} +1 -1
  197. package/createAgentAutomationAction-L3NLCIIW.js +172 -0
  198. package/{createDialogAction-DK62W5VA.js → createDialogAction-QSWKRPWQ.js} +46 -42
  199. package/{createPageAction-W6NXHVKO.js → createPageAction-ZVVUT4CZ.js} +49 -45
  200. package/{db-VR74ADGC.js → db-KTQ3LL2Q.js} +3 -3
  201. package/{dbSlice-RWPSVHBC.js → dbSlice-SEVKNA7A.js} +21 -16
  202. package/deleteDbKey-43MTK2DI.js +86 -0
  203. package/{dialogCommands-Z24IDINY.js → dialogCommands-UVMTIFSA.js} +80 -66
  204. package/{dialogMessageRecord-OAV77LT7.js → dialogMessageRecord-2HJTEXQX.js} +1 -1
  205. package/{dialogNotifyCommand-IASQGEMW.js → dialogNotifyCommand-LMWF7EQI.js} +22 -14
  206. package/dialogPortabilityCommands-PAMLEBST.js +3036 -0
  207. package/{dialogSlice-62GISS77.js → dialogSlice-VHPXENDZ.js} +43 -42
  208. package/{dialogTraceCommand-FDINAIZ6.js → dialogTraceCommand-SO2WKAXW.js} +83 -69
  209. package/{dialogUsageCommand-WJ3U6KZU.js → dialogUsageCommand-EUO6JXTD.js} +6 -3
  210. package/{docCreateCommands-SXA4TMGJ.js → docCreateCommands-H4RLIUNX.js} +68 -59
  211. package/{docDeleteCommands-ELXSZK3F.js → docDeleteCommands-OVAKCBMT.js} +68 -59
  212. package/{docReadCommands-DFLAQPI4.js → docReadCommands-KFISIUVA.js} +67 -58
  213. package/{docStore-UWF2PMCB.js → docStore-X7BEA735.js} +16 -17
  214. package/{docUpdateCommands-KB6M5HUH.js → docUpdateCommands-VOEER36L.js} +68 -59
  215. package/ebookDownloaderAgentCommand-2DHPGEOQ.js +674 -0
  216. package/{fetchMessages-TQEUZD7H.js → fetchMessages-RGPIYEPZ.js} +2 -2
  217. package/{getPricing-5BLZRPTM.js → getPricing-BK6CUBAE.js} +8 -4
  218. package/{handleSendMessageAction-ZV6OQPQG.js → handleSendMessageAction-GQ2KKOET.js} +265 -119
  219. package/{hostCredentialCreate-3IA5IJFG.js → hostCredentialCreate-PJAIKZQP.js} +138 -122
  220. package/index.js +35 -21
  221. package/{keys-RWF7UCB4.js → keys-FXEGMKSG.js} +2 -2
  222. package/localAutomationCommands-UU66LOWB.js +198 -0
  223. package/localAutomationRuntime-SW4R42SZ.js +60 -0
  224. package/{localDialogRead-BJJT3TF5.js → localDialogRead-W2EVXISA.js} +2 -2
  225. package/{localRuntimeAdapter-SSG5ORLZ.js → localRuntimeAdapter-WRBLXFUZ.js} +136 -119
  226. package/localRuntimeAuthority-3YDFZD3L.js +44 -0
  227. package/{localRuntimeDb-ZJFGNHML.js → localRuntimeDb-CJWJK47G.js} +1 -1
  228. package/{machineCommands-4WKJ3TLO.js → machineCommands-JFYED66N.js} +251 -357
  229. package/{machineInfo-LWHTEBHJ.js → machineInfo-BJIU3WQ5.js} +4 -2
  230. package/machineWsRunDispatch-CZUV2FXE.js +227 -0
  231. package/{mcpLocalAuthorizeCommand-RBXJDE6J.js → mcpLocalAuthorizeCommand-HLU72QME.js} +40 -22
  232. package/mcpLocalManageCommands-OHHU6F5C.js +212 -0
  233. package/{memberThunks-43B7UYC5.js → memberThunks-FJW4GPM5.js} +102 -22
  234. package/{memoryCommands-BC6REPQB.js → memoryCommands-2RLHDMU2.js} +25 -34
  235. package/{models-ZX2BYIMB.js → models-TOXYINNM.js} +3 -2
  236. package/{offlineMarxistsAgentCommand-XVXUE6G5.js → offlineMarxistsAgentCommand-WZBJBCPZ.js} +16 -22
  237. package/package.json +3 -3
  238. package/parityCommands-7EWR34P3.js +613 -0
  239. package/{projectArchive-JN43WW4E.js → projectArchive-JIVRMXVV.js} +49 -45
  240. package/{providerPresetApply-NTJUINI6.js → providerPresetApply-IRJ56XIZ.js} +12 -16
  241. package/{providerRegistry-W45SLUV6.js → providerRegistry-26PAUYH2.js} +3 -13
  242. package/{read-KG6INYUT.js → read-6YR57D6V.js} +11 -10
  243. package/{readDocTool-N3GA52JR.js → readDocTool-NKOGL2MW.js} +5 -1
  244. package/{readlineWorkspace-D6EUSB2Q.js → readlineWorkspace-V26AN2FL.js} +926 -572
  245. package/{rememberExplicit-CPAPONSI.js → rememberExplicit-7KX4HXQC.js} +4 -4
  246. package/remove-BF33RCTH.js +32 -0
  247. package/{removeDialogAgentAction-EEVSOQOJ.js → removeDialogAgentAction-GWHBWF4W.js} +22 -26
  248. package/{runAgentClientLoop-FEZTSUSJ.js → runAgentClientLoop-EKD2EEEA.js} +117 -82
  249. package/{runtimeDoctorCommands-V3M3JTUV.js → runtimeDoctorCommands-IALUR5BZ.js} +23 -16
  250. package/{secretCommands-53NZFD4T.js → secretCommands-CSTQYB6T.js} +2 -2
  251. package/{setDialogExtraReferencesAction-DNO5POHA.js → setDialogExtraReferencesAction-RL6FGO7T.js} +16 -17
  252. package/{setPrimaryDialogAgentAction-QABBEO4C.js → setPrimaryDialogAgentAction-XJASBB3K.js} +23 -27
  253. package/{settingThunks-DVKG4X4S.js → settingThunks-ZT7ZYXXL.js} +170 -497
  254. package/{skillDiscovery-5GEGWJ6N.js → skillDiscovery-IUEZZG2B.js} +3 -3
  255. package/{spaceCommands-4ACQQNZL.js → spaceCommands-65WQHVOI.js} +194 -90
  256. package/spacePruneCommand-PTMRUWYJ.js +233 -0
  257. package/{store-Z53ICFL3.js → store-WSAVTR32.js} +3 -1
  258. package/{streamAgentChatTurn-I425SVYJ.js → streamAgentChatTurn-B5NICHZW.js} +225 -137
  259. package/{switchDialogAgentAction-KYWJSGOO.js → switchDialogAgentAction-X6DFOIAX.js} +19 -23
  260. package/{tableCommands-EFA754RE.js → tableCommands-6E77VD73.js} +28 -49
  261. package/{toolApiClient-N5PYW2R3.js → toolApiClient-GTTWEV6P.js} +15 -4
  262. package/{tools-WBPFTSMK.js → tools-UMCPIQX6.js} +73 -63
  263. package/{tuiRestart-VN5F4GYU.js → tuiRestart-O7UDLNQU.js} +20 -13
  264. package/tuiSummaryLlmCaller-7APIUIIV.js +52 -0
  265. package/{updateCommands-VQEBBIGO.js → updateCommands-DXDIAQFS.js} +12 -7
  266. package/{updateDialogTitleAction-VB5DTVXV.js → updateDialogTitleAction-HZLKWVKM.js} +57 -58
  267. package/{usageCommand-WI6SQOPB.js → usageCommand-WYLNBDHB.js} +6 -8
  268. package/{usageRebuildCommand-WQRLLZAT.js → usageRebuildCommand-AEUPY2PE.js} +11 -15
  269. package/{windowsSelfUpdate-ZEZKGX4M.js → windowsSelfUpdate-SXSVXK4X.js} +2 -2
  270. package/workContext-ZAW6VXT7.js +18 -0
  271. package/workContextQueryProjection-CACY5VFE.js +23 -0
  272. package/{workloadLifecycle-DYX5ZMAT.js → workloadLifecycle-P2SJVV3S.js} +1 -1
  273. package/agentFavoriteCommands-7LOP3HUD.js +0 -186
  274. package/agentRecordCommands-BEZPBYBM.js +0 -194
  275. package/agentRunCommand-2T72V5KY.js +0 -232
  276. package/chunk-2MBTWINN.js +0 -89
  277. package/chunk-523DITKR.js +0 -32
  278. package/chunk-BUDVRYES.js +0 -2213
  279. package/chunk-BXGU6274.js +0 -862
  280. package/chunk-BZMDWGQQ.js +0 -47
  281. package/chunk-GAHJLSDO.js +0 -107
  282. package/chunk-GYX6XTAI.js +0 -84
  283. package/chunk-HNUWUO75.js +0 -93
  284. package/chunk-HSBHS6KT.js +0 -33401
  285. package/chunk-KG27JIG4.js +0 -136
  286. package/chunk-OB4FBZXJ.js +0 -364
  287. package/chunk-OKH74FML.js +0 -3746
  288. package/chunk-OLZBQWZU.js +0 -6
  289. package/chunk-OOV5JN25.js +0 -1317
  290. package/chunk-OQFOE4SJ.js +0 -405
  291. package/chunk-PXYBUFDB.js +0 -53
  292. package/chunk-R3FZHW4Q.js +0 -103
  293. package/chunk-R3MV2GII.js +0 -106
  294. package/chunk-SCAC3NM5.js +0 -11751
  295. package/chunk-SR4FE5VD.js +0 -9
  296. package/chunk-SYTHYBMI.js +0 -3558
  297. package/chunk-UKZX3NHN.js +0 -48
  298. package/chunk-UVLYNWIE.js +0 -74
  299. package/chunk-WFEWP352.js +0 -861
  300. package/chunk-X4O7FJF5.js +0 -160
  301. package/chunk-YJPK35HB.js +0 -175
  302. package/chunk-YNIYE47Z.js +0 -105
  303. package/chunk-Z4PCXPUE.js +0 -127
  304. package/chunk-ZTHAJU3O.js +0 -2537
  305. package/cliAuthorityBrokerProcess-5ZFBTHLB.js +0 -22
  306. package/cliLocalAgentRecordReader-Q6677YID.js +0 -104
  307. package/deleteFile-ECU6FU5C.js +0 -55
  308. package/localRuntimeAuthority-UF2DAQ3F.js +0 -28
  309. package/machineWsRunDispatch-7PROH7E7.js +0 -209
  310. package/markdownToSlate-PXYAIBVL.js +0 -8
  311. package/tuiSummaryLlmCaller-HROLGN4F.js +0 -45
  312. package/webapi-QVV65DQF.js +0 -2487
  313. package/workContext-Y3ADAPZU.js +0 -14
  314. package/{chunk-USGHJSGO.js → chunk-GX2MFKF3.js} +3 -3
  315. package/{chunk-PHREU2KZ.js → chunk-WX266G2C.js} +0 -0
  316. package/{chunk-DXWGFL2Z.js → chunk-YY7IGJMN.js} +3 -3
@@ -1,14 +1,39 @@
1
1
  import {
2
2
  loadCliAuthorityBrokerTls
3
3
  } from "./chunk-3A5NNQCN.js";
4
+ import {
5
+ DIALOG_TURN_DEFAULT_TTL_MS,
6
+ DIALOG_TURN_MAX_PAYLOAD_BYTES,
7
+ isDialogTurnMessageId,
8
+ isDialogTurnRecord,
9
+ validateDialogTurnRequest
10
+ } from "./chunk-EUHMI5KG.js";
4
11
  import {
5
12
  Level,
6
- createLevelAuthorityStore
7
- } from "./chunk-R3MV2GII.js";
13
+ MAX_AUTHORITY_BATCH_GET_KEYS,
14
+ compareUtf8Keys,
15
+ createBatchedStoreIterator,
16
+ createLevelAuthorityStore,
17
+ readIteratorWindow
18
+ } from "./chunk-KGWE224L.js";
8
19
  import {
20
+ CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
21
+ MAX_BROKER_ITERATE_PAGE_LIMIT,
9
22
  createCliAuthorityBrokerClient,
10
23
  createCliAuthorityBrokerSocketInvoker
11
- } from "./chunk-SQL7YNED.js";
24
+ } from "./chunk-LPXBBC32.js";
25
+ import {
26
+ toErrorMessage
27
+ } from "./chunk-HNMXYYJR.js";
28
+ import {
29
+ isLevelNotFoundError
30
+ } from "./chunk-OW765XBU.js";
31
+ import {
32
+ createKey
33
+ } from "./chunk-DLXL4NSL.js";
34
+ import {
35
+ dialogMessageKey
36
+ } from "./chunk-OJKUU3LP.js";
12
37
  import {
13
38
  getLogger
14
39
  } from "./chunk-EYLGAEB4.js";
@@ -16,16 +41,267 @@ import {
16
41
  getHostRuntimeExecutable,
17
42
  isCompiledBinary,
18
43
  resolveCliEntrypointPath
19
- } from "./chunk-BIDSIRTS.js";
20
- import {
21
- toErrorMessage
22
- } from "./chunk-HNMXYYJR.js";
44
+ } from "./chunk-JUNYPVL6.js";
23
45
 
24
46
  // packages/cli/cliAuthorityBrokerProcess.ts
25
47
  import { spawn } from "node:child_process";
26
48
  import { dirname, isAbsolute, resolve } from "node:path";
27
49
  import { setTimeout as delay } from "node:timers/promises";
28
50
 
51
+ // packages/database-engine/dialogTurnAuthority.ts
52
+ import { createHash, randomUUID } from "node:crypto";
53
+ var DIALOG_TURN_STATE_PREFIX = "dialog-turn-state:";
54
+ var DIALOG_TURN_IDEM_PREFIX = "dialog-turn-idem:";
55
+ var isDialogTurnAuthorityReservedKey = (key) => typeof key === "string" && (key.startsWith(DIALOG_TURN_STATE_PREFIX) || key.startsWith(DIALOG_TURN_IDEM_PREFIX));
56
+ var dialogTurnNamespaceKey = (dialogId) => `${DIALOG_TURN_STATE_PREFIX}:owner:${dialogId}`;
57
+ var dialogTurnStateKey = ({ userId, dialogId }) => `${DIALOG_TURN_STATE_PREFIX}${userId}:${dialogId}`;
58
+ var keysFor = ({ userId, dialogId }) => ({
59
+ dialogKey: createKey("dialog" /* DIALOG */, userId, dialogId),
60
+ stateKey: dialogTurnStateKey({ userId, dialogId }),
61
+ namespaceKey: dialogTurnNamespaceKey(dialogId),
62
+ idemKey: (commandId) => `${DIALOG_TURN_IDEM_PREFIX}${userId}:${dialogId}:${commandId}`
63
+ });
64
+ var queues = /* @__PURE__ */ new WeakMap();
65
+ function serialize(store, key, task) {
66
+ let tails = queues.get(store);
67
+ if (!tails) queues.set(store, tails = /* @__PURE__ */ new Map());
68
+ const current = (tails.get(key) ?? Promise.resolve()).then(task);
69
+ const settled = current.then(() => void 0, () => void 0);
70
+ tails.set(key, settled);
71
+ void settled.then(() => {
72
+ if (tails.get(key) === settled) tails.delete(key);
73
+ });
74
+ return current;
75
+ }
76
+ async function getOptional(store, key) {
77
+ try {
78
+ return await store.get(key);
79
+ } catch (error) {
80
+ if (isLevelNotFoundError(error)) return void 0;
81
+ throw error;
82
+ }
83
+ }
84
+ function summarize(turn) {
85
+ if (!turn) return null;
86
+ const { runId, holder, holderKind, startedAt, heartbeatAt, expiresAt } = turn;
87
+ return { runId, holder, holderKind, startedAt, heartbeatAt, expiresAt };
88
+ }
89
+ function revisionOf(row) {
90
+ return isDialogTurnRecord(row) && typeof row.dialogRevision === "number" ? row.dialogRevision : 0;
91
+ }
92
+ function fingerprint(value) {
93
+ const hash = createHash("sha256");
94
+ let bytes = 0;
95
+ const tooLarge = Symbol();
96
+ const invalid = Symbol();
97
+ const add = (part) => {
98
+ bytes += Buffer.byteLength(part);
99
+ if (bytes > DIALOG_TURN_MAX_PAYLOAD_BYTES) throw tooLarge;
100
+ hash.update(part);
101
+ };
102
+ const visit = (item, depth) => {
103
+ if (depth > 64) throw invalid;
104
+ if (item === null || typeof item === "boolean" || typeof item === "string" || typeof item === "number" && Number.isFinite(item)) {
105
+ if (typeof item === "string" && item.length > DIALOG_TURN_MAX_PAYLOAD_BYTES) throw tooLarge;
106
+ add(JSON.stringify(item));
107
+ } else if (Array.isArray(item)) {
108
+ add("[");
109
+ for (let i = 0; i < item.length; i++) {
110
+ if (i) add(",");
111
+ visit(item[i], depth + 1);
112
+ }
113
+ add("]");
114
+ } else if (isDialogTurnRecord(item)) {
115
+ add("{");
116
+ for (const [index, key] of Object.keys(item).sort().entries()) {
117
+ if (index) add(",");
118
+ add(JSON.stringify(key));
119
+ add(":");
120
+ visit(item[key], depth + 1);
121
+ }
122
+ add("}");
123
+ } else throw invalid;
124
+ };
125
+ try {
126
+ visit(value, 0);
127
+ return { hash: hash.digest("hex") };
128
+ } catch (error) {
129
+ if (error !== tooLarge && error !== invalid) throw error;
130
+ return { status: error === tooLarge ? "payload_too_large" : "invalid_request", field: "payload" };
131
+ }
132
+ }
133
+ var titleFields = ["title", "titleSource", "titleUpdatedAt"];
134
+ function createDialogTurnAuthority(store, options = {}) {
135
+ const now = options.now ?? Date.now;
136
+ const guarded = (task) => store.runPublicationBatch && typeof store.batchWrite === "function" ? store.runPublicationBatch((access) => task({
137
+ ...access,
138
+ put: (key, value) => access.batchWrite([{ type: "put", key, value }]),
139
+ del: (key) => access.batchWrite([{ type: "del", key }])
140
+ })) : task(store);
141
+ const run = (method, raw, task) => {
142
+ const parsed = validateDialogTurnRequest(method, raw);
143
+ if (!parsed.ok) return Promise.resolve(parsed.error);
144
+ const keys = keysFor(parsed.input.dialogRef);
145
+ return serialize(store, keys.namespaceKey, () => guarded((access) => task(parsed.input, keys, access)));
146
+ };
147
+ const active = async (access, key) => await getOptional(access, key) ?? null;
148
+ const checkNamespace = async (access, { namespaceKey, dialogKey }, ref, row) => {
149
+ const owner = await getOptional(access, namespaceKey);
150
+ if (owner !== void 0 && owner !== dialogKey) return "forbidden";
151
+ if (options.verifyNamespace && (owner === void 0 || row !== void 0) && !await options.verifyNamespace(ref, row)) return "forbidden";
152
+ return owner === void 0 ? "unclaimed" : "claimed";
153
+ };
154
+ return {
155
+ getDialogTurnState: (raw) => run("getDialogTurnState", raw, async (_, { dialogKey, stateKey }, access) => ({
156
+ ok: true,
157
+ dialogKey,
158
+ dialogRevision: revisionOf(await getOptional(access, dialogKey)),
159
+ activeTurn: summarize(await active(access, stateKey))
160
+ })),
161
+ beginDialogTurn: (raw) => run("beginDialogTurn", raw, async (input, { dialogKey, stateKey, namespaceKey }, access) => {
162
+ const current = await active(access, stateKey);
163
+ const row = await getOptional(access, dialogKey);
164
+ const dialogRevision = revisionOf(row);
165
+ const namespace = options.verifyNamespace ? await checkNamespace(access, { namespaceKey, dialogKey }, input.dialogRef, row) : void 0;
166
+ if (namespace === "forbidden") return { status: "forbidden" };
167
+ const replayed = current !== null;
168
+ if (current && (current.runId !== input.runId || current.holder !== input.holder || current.holderKind !== input.holderKind)) {
169
+ return { status: "busy", dialogRevision, activeTurn: summarize(current) };
170
+ }
171
+ const timestamp = now();
172
+ const turn = current ?? {
173
+ runId: input.runId,
174
+ runToken: randomUUID(),
175
+ holder: input.holder,
176
+ holderKind: input.holderKind,
177
+ startedAt: timestamp,
178
+ heartbeatAt: timestamp,
179
+ expiresAt: timestamp + (input.ttlMs ?? DIALOG_TURN_DEFAULT_TTL_MS)
180
+ };
181
+ if (namespace === "unclaimed") {
182
+ if (typeof access.batchWrite !== "function") return { status: "atomic_batch_unsupported" };
183
+ await access.batchWrite([{ type: "put", key: namespaceKey, value: dialogKey }, { type: "put", key: stateKey, value: turn }]);
184
+ } else if (!replayed) await access.put(stateKey, turn);
185
+ return { status: "acquired", replayed, dialogRevision, activeTurn: turn };
186
+ }),
187
+ heartbeatDialogTurn: (raw) => run("heartbeatDialogTurn", raw, async (input, { stateKey }, access) => {
188
+ const current = await active(access, stateKey);
189
+ if (!current || current.runToken !== input.runToken) return { status: "token_mismatch", activeTurn: summarize(current) };
190
+ const heartbeatAt = Math.max(now(), current.heartbeatAt);
191
+ const turn = { ...current, heartbeatAt, expiresAt: heartbeatAt + (input.ttlMs ?? DIALOG_TURN_DEFAULT_TTL_MS) };
192
+ await access.put(stateKey, turn);
193
+ return { status: "renewed", activeTurn: turn };
194
+ }),
195
+ endDialogTurn: (raw) => run("endDialogTurn", raw, async (input, { stateKey }, access) => {
196
+ const current = await active(access, stateKey);
197
+ if (!current) return { status: "already_idle" };
198
+ if (input.runToken !== void 0 ? current.runToken !== input.runToken : current.runId !== input.expectedRunId) {
199
+ return { status: "token_mismatch", activeTurn: summarize(current) };
200
+ }
201
+ await access.del(stateKey);
202
+ return { status: "ended" };
203
+ }),
204
+ commitDialogTurn: (raw) => run("commitDialogTurn", raw, async (input, keys, access) => {
205
+ const { dialogKey, stateKey, namespaceKey, idemKey } = keys;
206
+ if (typeof access.batchWrite !== "function") return { status: "atomic_batch_unsupported" };
207
+ const { mode, dialogRef, runToken, commandId, baseRevision, dialogRecord, messageRecords, keepTurnActive } = input;
208
+ const idleSync = mode === "idle_sync";
209
+ const idleStored = idleSync ? await getOptional(access, dialogKey) : void 0;
210
+ const namespace = idleSync ? await checkNamespace(access, keys, dialogRef, idleStored) : void 0;
211
+ if (namespace === "forbidden") return { status: "forbidden" };
212
+ const { userId, dialogId } = dialogRef;
213
+ if (dialogRecord.id !== void 0 && dialogRecord.id !== dialogId || dialogRecord.userId !== void 0 && dialogRecord.userId !== userId || dialogRecord.type !== void 0 && dialogRecord.type !== "dialog" /* DIALOG */) {
214
+ return { status: "invalid_request", field: "dialogRecord" };
215
+ }
216
+ const prefix = dialogMessageKey(dialogId, "");
217
+ const seen = /* @__PURE__ */ new Set();
218
+ for (const { key, value } of messageRecords) {
219
+ const messageId = key.slice(prefix.length);
220
+ if (!key.startsWith(prefix) || !isDialogTurnMessageId(messageId) || seen.has(key) || value.id !== void 0 && value.id !== messageId) return { status: "invalid_message_key", field: "messageRecords" };
221
+ seen.add(key);
222
+ }
223
+ const digest = fingerprint({
224
+ method: "commit",
225
+ baseRevision,
226
+ dialogRecord,
227
+ messageRecords,
228
+ ...idleSync ? { mode } : { runToken, keepTurnActive: keepTurnActive === true }
229
+ });
230
+ if (!("hash" in digest)) return digest;
231
+ const receiptKey = idemKey(commandId);
232
+ const prior = await getOptional(access, receiptKey);
233
+ if (prior !== void 0) return prior.hash === digest.hash ? { status: "committed", replayed: true, dialogRevision: prior.dialogRevision, commandId, committedAt: prior.committedAt } : { status: "idempotency_conflict", commandId };
234
+ const current = await active(access, stateKey);
235
+ const stored = idleSync ? idleStored : await getOptional(access, dialogKey);
236
+ const storedRevision = revisionOf(stored);
237
+ if (idleSync) {
238
+ if (current) return { ok: true, status: "busy", dialogKey, dialogRevision: storedRevision, activeTurn: summarize(current) };
239
+ } else if (!current || current.runToken !== runToken) {
240
+ return { status: "fenced", activeTurn: summarize(current), dialogRevision: storedRevision };
241
+ }
242
+ if (storedRevision !== baseRevision) return { status: "revision_conflict", expectedRevision: baseRevision, actualRevision: storedRevision };
243
+ if (!idleSync && options.verifyNamespace && (await getOptional(access, namespaceKey) !== dialogKey || stored !== void 0 && !await options.verifyNamespace(dialogRef, stored))) return { status: "forbidden" };
244
+ const dialogRevision = baseRevision + 1;
245
+ const committedAt = now();
246
+ await access.batchWrite([
247
+ ...messageRecords.map(({ key, value }) => ({ type: "put", key, value })),
248
+ { type: "put", key: dialogKey, value: {
249
+ ...dialogRecord,
250
+ // A history writer may have read the header before a narrow memory patch.
251
+ ...isDialogTurnRecord(stored) && Object.hasOwn(stored, "memoryCaptureResult") ? { memoryCaptureResult: stored.memoryCaptureResult } : {},
252
+ ...isDialogTurnRecord(stored) && Object.hasOwn(stored, "memoryEvents") ? { memoryEvents: stored.memoryEvents } : {},
253
+ id: dialogId,
254
+ userId,
255
+ type: "dialog" /* DIALOG */,
256
+ dbKey: dialogKey,
257
+ dialogRevision
258
+ } },
259
+ { type: "put", key: receiptKey, value: { ...digest, dialogRevision, committedAt } },
260
+ ...namespace === "unclaimed" ? [{ type: "put", key: namespaceKey, value: dialogKey }] : [],
261
+ ...!idleSync && keepTurnActive !== true ? [{ type: "del", key: stateKey }] : []
262
+ ]);
263
+ return { status: "committed", replayed: false, dialogRevision, commandId, committedAt };
264
+ }),
265
+ patchDialogMetadata: (raw) => run("patchDialogMetadata", raw, async (input, { dialogKey, idemKey }, access) => {
266
+ const { patch, commandId, expectedTitleUpdatedAt } = input;
267
+ const key = commandId === void 0 ? void 0 : idemKey(commandId);
268
+ if (key && typeof access.batchWrite !== "function") return { status: "atomic_batch_unsupported" };
269
+ const digest = fingerprint({ method: "metadata", patch, ...expectedTitleUpdatedAt !== void 0 ? { expectedTitleUpdatedAt } : {} });
270
+ if (!("hash" in digest)) return digest;
271
+ const prior = key ? await getOptional(access, key) : void 0;
272
+ if (prior !== void 0) return prior.hash === digest.hash ? { status: "patched", replayed: true, dialogRevision: prior.dialogRevision } : { status: "idempotency_conflict", commandId };
273
+ const row = await getOptional(access, dialogKey);
274
+ if (!isDialogTurnRecord(row) || row.deletedAt) return { status: "not_found" };
275
+ if (expectedTitleUpdatedAt !== void 0 && (row.titleUpdatedAt ?? null) !== expectedTitleUpdatedAt) return { status: "title_conflict" };
276
+ if (row.titleSource === "manual" && titleFields.some((field) => Object.hasOwn(patch, field)) && patch.titleSource !== "manual") {
277
+ return { status: "manual_title_protected" };
278
+ }
279
+ const dialogRevision = revisionOf(row);
280
+ const { memoryEvents, ...fields } = patch;
281
+ const value = { ...row, ...fields };
282
+ if (memoryEvents) {
283
+ const events = Array.isArray(row.memoryEvents) ? [...row.memoryEvents] : [];
284
+ const eventKey = (event) => isDialogTurnRecord(event) ? JSON.stringify([event.type, event.sourceKind, event.content]) : void 0;
285
+ const seen = new Set(events.map(eventKey));
286
+ for (const event of memoryEvents) {
287
+ const key2 = eventKey(event);
288
+ if (!seen.has(key2)) {
289
+ events.push(event);
290
+ seen.add(key2);
291
+ }
292
+ }
293
+ value.memoryEvents = events;
294
+ }
295
+ if (key) await access.batchWrite([
296
+ { type: "put", key: dialogKey, value },
297
+ { type: "put", key, value: { ...digest, dialogRevision, committedAt: now() } }
298
+ ]);
299
+ else await access.put(dialogKey, value);
300
+ return { status: "patched", dialogRevision, replayed: false };
301
+ })
302
+ };
303
+ }
304
+
29
305
  // packages/database-engine/cliAuthorityBrokerServer.ts
30
306
  import fs3 from "node:fs";
31
307
  import path3 from "node:path";
@@ -251,43 +527,55 @@ function removeFileIfPresent(filePath) {
251
527
  } catch {
252
528
  }
253
529
  }
254
- async function buildIteratorPage(store, request) {
530
+ async function buildIteratorPage(store, request, limit) {
531
+ if (limit === 0) return { entries: [], nextCursor: null, done: true };
255
532
  const base = request.options ?? {};
256
533
  const reverse = base.reverse === true;
257
534
  const cursor = typeof request.cursor === "string" && request.cursor.length > 0 ? request.cursor : void 0;
258
535
  const iterOptions = { ...base };
259
- if (cursor) {
536
+ delete iterOptions.limit;
537
+ const cursorBytes = cursor === void 0 ? void 0 : Buffer.from(cursor);
538
+ if (cursor !== void 0 && cursorBytes !== void 0) {
260
539
  if (reverse) {
261
- if (iterOptions.lte !== void 0 && iterOptions.lte < cursor) {
540
+ if (iterOptions.lte !== void 0 && compareUtf8Keys(iterOptions.lte, cursorBytes) < 0) {
262
541
  } else {
263
542
  delete iterOptions.lte;
264
- iterOptions.lt = iterOptions.lt !== void 0 && iterOptions.lt < cursor ? iterOptions.lt : cursor;
543
+ iterOptions.lt = iterOptions.lt !== void 0 && compareUtf8Keys(iterOptions.lt, cursorBytes) < 0 ? iterOptions.lt : cursor;
265
544
  }
266
545
  } else {
267
- if (iterOptions.gte !== void 0 && iterOptions.gte > cursor) {
546
+ if (iterOptions.gte !== void 0 && compareUtf8Keys(iterOptions.gte, cursorBytes) > 0) {
268
547
  } else {
269
548
  delete iterOptions.gte;
270
- iterOptions.gt = iterOptions.gt !== void 0 && iterOptions.gt > cursor ? iterOptions.gt : cursor;
549
+ iterOptions.gt = iterOptions.gt !== void 0 && compareUtf8Keys(iterOptions.gt, cursorBytes) > 0 ? iterOptions.gt : cursor;
271
550
  }
272
551
  }
273
552
  }
274
- const limit = Math.max(0, Math.floor(request.limit ?? DEFAULT_ITERATOR_LIMIT));
553
+ const baseGt = base.gt === void 0 ? void 0 : Buffer.from(base.gt);
275
554
  const entries = [];
276
555
  let hasMore = false;
277
- for await (const entry of store.iterator(iterOptions)) {
278
- const [key] = entry;
279
- if (cursor && (reverse ? key >= cursor : key <= cursor)) {
280
- continue;
281
- }
282
- if (base.gt !== void 0 && key <= base.gt) {
283
- continue;
284
- }
285
- if (entries.length >= limit) {
286
- hasMore = true;
287
- break;
556
+ await readIteratorWindow(createBatchedStoreIterator(store, iterOptions), {
557
+ batchSize: () => Math.min(Math.max(1, limit + 1 - entries.length), 256),
558
+ onBatch: (chunk) => {
559
+ for (const entry of chunk) {
560
+ const [key] = entry;
561
+ if (isDialogTurnAuthorityReservedKey(key)) continue;
562
+ if (cursorBytes || baseGt) {
563
+ const keyBytes = Buffer.from(key);
564
+ if (cursorBytes) {
565
+ const order = compareUtf8Keys(keyBytes, cursorBytes);
566
+ if (reverse ? order >= 0 : order <= 0) continue;
567
+ }
568
+ if (baseGt && compareUtf8Keys(keyBytes, baseGt) <= 0) continue;
569
+ }
570
+ if (entries.length >= limit) {
571
+ hasMore = true;
572
+ return false;
573
+ }
574
+ entries.push(entry);
575
+ }
576
+ return true;
288
577
  }
289
- entries.push(entry);
290
- }
578
+ });
291
579
  const lastEntry = entries.at(-1) ?? null;
292
580
  return {
293
581
  entries,
@@ -331,7 +619,7 @@ function validConditionalPut(request) {
331
619
  function dispatchCliAuthorityBrokerRequest(store, request) {
332
620
  const state = ownerQueue(store);
333
621
  if (state.closed) return Promise.resolve({ ok: false, error: { code: "BROKER_CLOSING", message: "Authority broker is closing" } });
334
- const isRead = request?.type === "get" || request?.type === "batchGet" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
622
+ const isRead = request?.type === "dialogTurnGetState" || request?.type === "get" || request?.type === "batchGet" || request?.type === "status" || request?.type === "iterator" || request?.type === "close";
335
623
  const execute = () => executeCliAuthorityBrokerRequest(store, request);
336
624
  const result = isRead ? Promise.resolve().then(execute) : state.tail.then(execute);
337
625
  if (!isRead) state.tail = result.catch(() => void 0);
@@ -345,24 +633,46 @@ async function executeCliAuthorityBrokerRequest(store, request) {
345
633
  if (!request || typeof request !== "object") {
346
634
  return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid broker request" } };
347
635
  }
636
+ const forbidden = { ok: false, error: { code: "BROKER_FORBIDDEN", message: "Reserved dialog turn key" } };
637
+ if ("key" in request && isDialogTurnAuthorityReservedKey(request.key) || request.type === "batchGet" && Array.isArray(request.keys) && request.keys.some(isDialogTurnAuthorityReservedKey) || request.type === "batchWrite" && Array.isArray(request.ops) && request.ops.some((op) => isDialogTurnAuthorityReservedKey(op?.key))) return forbidden;
348
638
  switch (request.type) {
349
- case "conditionalPut": {
350
- if (!validConditionalPut(request)) {
351
- return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid conditionalPut request" } };
639
+ case "dialogTurnGetState":
640
+ return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).getDialogTurnState(request.input) } };
641
+ case "dialogTurnBegin":
642
+ return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).beginDialogTurn(request.input) } };
643
+ case "dialogTurnHeartbeat":
644
+ return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).heartbeatDialogTurn(request.input) } };
645
+ case "dialogTurnEnd":
646
+ return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).endDialogTurn(request.input) } };
647
+ case "dialogTurnCommit":
648
+ return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).commitDialogTurn(request.input) } };
649
+ case "dialogTurnPatchMetadata":
650
+ return { ok: true, result: { type: request.type, response: await createDialogTurnAuthority(store).patchDialogMetadata(request.input) } };
651
+ case "conditionalPut":
652
+ case "conditionalDelete": {
653
+ const deleting = request.type === "conditionalDelete";
654
+ const valid = deleting ? Object.keys(request).length === 3 && typeof request.key === "string" && request.key.length > 0 && Number.isSafeInteger(request.expectedRevision) && request.expectedRevision >= 0 : validConditionalPut(request);
655
+ if (!valid) {
656
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: `Invalid ${request.type} request` } };
352
657
  }
353
658
  let current;
354
659
  try {
355
660
  current = await store.get(request.key);
356
661
  } catch (error) {
357
- if (error?.code !== "LEVEL_NOT_FOUND") throw error;
662
+ if (!isLevelNotFoundError(error)) throw error;
358
663
  }
359
664
  const matches = request.expectedRevision === null ? current === void 0 : typeof current === "object" && current !== null && !Array.isArray(current) && Object.hasOwn(current, "revision") && current.revision === request.expectedRevision;
360
- if (!matches) return { ok: true, result: { type: "conditionalPut", status: "conflict" } };
361
- await store.put(request.key, request.value);
362
- return { ok: true, result: { type: "conditionalPut", status: "updated" } };
665
+ if (!matches) return { ok: true, result: { type: request.type, status: "conflict" } };
666
+ if (deleting) await store.del(request.key);
667
+ else await store.put(request.key, request.value);
668
+ return { ok: true, result: { type: request.type, status: "updated" } };
363
669
  }
364
670
  case "status":
365
- return { ok: true, result: { type: "status", ...request.includeLocation && store.location ? { location: store.location } : {} } };
671
+ return { ok: true, result: {
672
+ type: "status",
673
+ protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
674
+ ...request.includeLocation && store.location ? { location: store.location } : {}
675
+ } };
366
676
  case "open":
367
677
  await store.open();
368
678
  return { ok: true, result: { type: "open" } };
@@ -374,6 +684,19 @@ async function executeCliAuthorityBrokerRequest(store, request) {
374
684
  if (!Array.isArray(request.keys) || !request.keys.every((key) => typeof key === "string")) {
375
685
  return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid batchGet request" } };
376
686
  }
687
+ if (request.keys.length > MAX_AUTHORITY_BATCH_GET_KEYS) {
688
+ return {
689
+ ok: false,
690
+ error: {
691
+ code: "BROKER_INVALID_REQUEST",
692
+ message: `batchGet exceeds maximum batch size (${MAX_AUTHORITY_BATCH_GET_KEYS})`
693
+ }
694
+ };
695
+ }
696
+ if (typeof store.batchGet === "function") {
697
+ const items2 = await store.batchGet(request.keys);
698
+ return { ok: true, result: { type: "batchGet", items: items2 } };
699
+ }
377
700
  const items = await Promise.all(
378
701
  request.keys.map(async (key) => {
379
702
  try {
@@ -398,19 +721,24 @@ async function executeCliAuthorityBrokerRequest(store, request) {
398
721
  case "batchWrite":
399
722
  await store.batchWrite(request.ops);
400
723
  return { ok: true, result: { type: "batchWrite" } };
401
- case "iterator":
724
+ case "iterator": {
725
+ const limit = request.limit === void 0 ? DEFAULT_ITERATOR_LIMIT : request.limit;
726
+ if (!Number.isSafeInteger(limit) || limit < 0 || limit > MAX_BROKER_ITERATE_PAGE_LIMIT) {
727
+ return { ok: false, error: { code: "BROKER_INVALID_REQUEST", message: "Invalid iterator page limit" } };
728
+ }
402
729
  return {
403
730
  ok: true,
404
731
  result: {
405
732
  type: "iterator",
406
- page: await buildIteratorPage(store, request)
733
+ page: await buildIteratorPage(store, request, limit)
407
734
  }
408
735
  };
736
+ }
409
737
  default:
410
738
  return { ok: false, error: { code: "BROKER_UNSUPPORTED_REQUEST", message: "Unsupported broker request" } };
411
739
  }
412
740
  } catch (error) {
413
- if (request?.type === "conditionalPut") {
741
+ if (request?.type === "conditionalPut" || request?.type === "conditionalDelete") {
414
742
  return { ok: false, error: { code: "BROKER_CONDITIONAL_WRITE_FAILED", message: "Conditional write failed" } };
415
743
  }
416
744
  return createErrorResponse(error);
@@ -508,6 +836,7 @@ async function createBrokerHandle(options) {
508
836
  const listeningEndpoint = (options.transportMode ?? "socket") === "socket" ? buildListeningEndpoint(server, target) : options.endpoint;
509
837
  writeJsonFile(options.metadataPath, {
510
838
  pid: process.pid,
839
+ protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
511
840
  ...options.tls ? { transportSecurity: "mutual-tls" } : {},
512
841
  ...options.supervisorPid === void 0 ? {} : { supervisorPid: options.supervisorPid },
513
842
  endpoint: listeningEndpoint,
@@ -517,6 +846,7 @@ async function createBrokerHandle(options) {
517
846
  writeJsonFile(options.healthPath, {
518
847
  ok: true,
519
848
  pid: process.pid,
849
+ protocolVersion: CLI_AUTHORITY_BROKER_PROTOCOL_VERSION,
520
850
  endpoint: listeningEndpoint,
521
851
  checkedAt: new Date(now()).toISOString()
522
852
  });
@@ -982,6 +1312,7 @@ async function runCliAuthorityBrokerProcess(args) {
982
1312
  }
983
1313
 
984
1314
  export {
1315
+ createDialogTurnAuthority,
985
1316
  startCliAuthorityBrokerProcess,
986
1317
  superviseCliAuthorityBrokerProcess,
987
1318
  runCliAuthorityBrokerProcess
@@ -54,7 +54,6 @@ var replacePrimaryDialogAgentId = (existingAgentIds, nextPrimaryAgentId) => [
54
54
  var removeDialogAgentId = (existingAgentIds, agentIdToRemove) => existingAgentIds.filter((id) => id !== agentIdToRemove);
55
55
 
56
56
  export {
57
- getDialogAgentIds,
58
57
  getPrimaryDialogAgentId,
59
58
  getActiveDialogAgentId,
60
59
  addDialogAgentIds,
@@ -0,0 +1,117 @@
1
+ import {
2
+ safeParse
3
+ } from "./chunk-FI4DPLR7.js";
4
+
5
+ // packages/cli/defaultServer.ts
6
+ var DEFAULT_NOLO_SERVER_URL = "https://nolo.chat";
7
+
8
+ // packages/cli/cliParseArgs.ts
9
+ import { parseArgs } from "node:util";
10
+ function isShortFlag(flag) {
11
+ return flag.startsWith("-") && !flag.startsWith("--") && flag.length === 2;
12
+ }
13
+ function normalizeLongName(flag) {
14
+ return flag.replace(/^--/, "");
15
+ }
16
+ function hasCliFlag(args, flag) {
17
+ const short = isShortFlag(flag);
18
+ const { tokens } = parseArgs({
19
+ args: [...args],
20
+ strict: false,
21
+ allowPositionals: true,
22
+ tokens: true,
23
+ options: short ? { __target: { type: "boolean", short: flag.slice(1) } } : { [normalizeLongName(flag)]: { type: "boolean" } }
24
+ });
25
+ return tokens.some(
26
+ (t) => t.kind === "option" && t.rawName === flag && (!short || args[t.index] === flag)
27
+ );
28
+ }
29
+ function readCliOptionOptional(args, flag, options) {
30
+ const short = isShortFlag(flag);
31
+ const { tokens } = parseArgs({
32
+ args: [...args],
33
+ strict: false,
34
+ allowPositionals: true,
35
+ tokens: true,
36
+ options: short ? { __target: { type: "string", short: flag.slice(1) } } : { [normalizeLongName(flag)]: { type: "string" } }
37
+ });
38
+ for (const t of tokens) {
39
+ if (t.kind !== "option" || t.rawName !== flag) continue;
40
+ if (typeof t.value !== "string") continue;
41
+ if (!options?.allowLeadingDash && !t.inlineValue && t.value.startsWith("-")) {
42
+ continue;
43
+ }
44
+ return t.value;
45
+ }
46
+ return void 0;
47
+ }
48
+ function readCliOption(args, flag) {
49
+ return readCliOptionOptional(args, flag) ?? "";
50
+ }
51
+ function readRepeatedCliOption(args, flag) {
52
+ const short = isShortFlag(flag);
53
+ const { tokens } = parseArgs({
54
+ args: [...args],
55
+ strict: false,
56
+ allowPositionals: true,
57
+ tokens: true,
58
+ options: short ? { __target: { type: "string", short: flag.slice(1), multiple: true } } : { [normalizeLongName(flag)]: { type: "string", multiple: true } }
59
+ });
60
+ const out = [];
61
+ for (const t of tokens) {
62
+ if (t.kind !== "option" || t.rawName !== flag) continue;
63
+ if (typeof t.value !== "string") continue;
64
+ if (!t.inlineValue && t.value.startsWith("-")) continue;
65
+ const trimmed = t.value.trim();
66
+ if (trimmed) out.push(trimmed);
67
+ }
68
+ return out;
69
+ }
70
+ function parseCliInput(args, schema, flags) {
71
+ const raw = {};
72
+ for (const [key, spec] of Object.entries(flags)) {
73
+ if (spec.type === "boolean") {
74
+ if (hasCliFlag(args, spec.flag)) raw[key] = true;
75
+ continue;
76
+ }
77
+ let val = readCliOptionOptional(args, spec.flag);
78
+ if (val === void 0 && spec.positionalFallback) {
79
+ val = args.find((a) => !a.startsWith("-"));
80
+ }
81
+ if (val === void 0) continue;
82
+ if (spec.type === "string") {
83
+ raw[key] = val;
84
+ } else if (spec.type === "nullableString") {
85
+ raw[key] = val === "null" ? null : val;
86
+ } else if (spec.type === "number") {
87
+ const n = Number(val);
88
+ if (!Number.isFinite(n)) throw new Error(`Invalid number for ${spec.flag}: ${val}`);
89
+ raw[key] = n;
90
+ } else if (spec.type === "csv") {
91
+ raw[key] = val.split(",").map((item) => item.trim()).filter(Boolean);
92
+ } else if (spec.type === "json") {
93
+ try {
94
+ raw[key] = JSON.parse(val);
95
+ } catch {
96
+ throw new Error(`Invalid JSON for ${spec.flag}`);
97
+ }
98
+ }
99
+ }
100
+ const parsed = safeParse(schema, raw);
101
+ if (!parsed.success) {
102
+ const issue = parsed.issues[0];
103
+ const path = issue?.path?.map((seg) => String(seg.key)).join(".");
104
+ const flagHint = path && flags[path] ? ` (${flags[path].flag})` : "";
105
+ throw new Error(`Invalid argument${flagHint}: ${issue?.message ?? "validation failed"}`);
106
+ }
107
+ return parsed.output;
108
+ }
109
+
110
+ export {
111
+ DEFAULT_NOLO_SERVER_URL,
112
+ hasCliFlag,
113
+ readCliOptionOptional,
114
+ readCliOption,
115
+ readRepeatedCliOption,
116
+ parseCliInput
117
+ };