nolo-cli 0.148.0-alpha.1 → 0.151.0-alpha.2

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 (258) hide show
  1. package/{_executeModel-NFJAMAGJ.js → _executeModel-XHAFJ2MM.js} +134 -91
  2. package/accountResolver-7RYB4D2P.js +300 -0
  3. package/action-SXJD5N5R.js +23 -0
  4. package/{addContentAction-B2DRF7P6.js → addContentAction-ZV774PHH.js} +20 -14
  5. package/{addDialogAgentAction-2P2FLTLD.js → addDialogAgentAction-A6SMKAGH.js} +26 -22
  6. package/{agentDeleteCommand-7IDWF6E3.js → agentDeleteCommand-DPUUS56Z.js} +181 -93
  7. package/{agentEmailCommands-4KW33JII.js → agentEmailCommands-V4P5EFLP.js} +132 -112
  8. package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
  9. package/agentListCommands-TWFLUYIZ.js +802 -0
  10. package/{agentMachineCommands-CMQR4RQ4.js → agentMachineCommands-MELPAZZI.js} +58 -62
  11. package/{agentProviderCommands-YK2BIIXZ.js → agentProviderCommands-HL6MBLCL.js} +149 -2
  12. package/{agentPullCommand-HF4A42D4.js → agentPullCommand-FA43RBRU.js} +7 -7
  13. package/agentRecordCommands-FSWSSQIO.js +154 -0
  14. package/agentRunCommand-GDBJVOAT.js +183 -0
  15. package/{agentRunControl-2SKCR4SB.js → agentRunControl-IFM7IGMG.js} +10 -2
  16. package/{agentRuntimeLocal-AK2QVJHY.js → agentRuntimeLocal-KKSQJMTE.js} +47 -50
  17. package/{agentSlice-OZ33K224.js → agentSlice-YO2ZLJMD.js} +23 -16
  18. package/{appDeleteCommands-N3XEVVYC.js → appDeleteCommands-4PL4KYRN.js} +58 -59
  19. package/{appDeployCommands-AWFIXYVW.js → appDeployCommands-EEEXCEB6.js} +67 -63
  20. package/{appDeployStatusCommands-CZRON2FO.js → appDeployStatusCommands-35ZX7T66.js} +56 -56
  21. package/{appGetCommands-XQIUY4TD.js → appGetCommands-WFCHXJWF.js} +56 -56
  22. package/{appListCommands-NNG4H36Y.js → appListCommands-XY2U6DPF.js} +57 -59
  23. package/{authCommand-UBJ4EWYZ.js → authCommand-QYN47CQD.js} +371 -68
  24. package/{authCommands-H6WKKCRW.js → authCommands-77CHYBGF.js} +12 -9
  25. package/{builtinSkillRegistry-ZMF6YGNO.js → builtinSkillRegistry-TDQ6JB2E.js} +13 -11
  26. package/{chromeCommands-2N6MEWRU.js → chromeCommands-OBBNJCLS.js} +314 -13
  27. package/chromeOpsCommands-3Z34RKSE.js +472 -0
  28. package/{chunk-ALXHV7NK.js → chunk-2GGXHQIW.js} +43 -4
  29. package/{localRuntimeAuthority-5W6IJRAD.js → chunk-2IXDJNZI.js} +154 -75
  30. package/{chunk-IVZJWTDI.js → chunk-36OMEXXR.js} +89 -21
  31. package/{chunk-H6A6X4EK.js → chunk-3MZAGMYY.js} +16 -0
  32. package/chunk-3PVYUPXK.js +40 -0
  33. package/chunk-3SZA4U64.js +1192 -0
  34. package/{chunk-GNMAFAIS.js → chunk-44WXLHFI.js} +1 -1
  35. package/{chunk-AGGIDPCZ.js → chunk-4JH2UMJR.js} +6 -0
  36. package/chunk-4LCOCOR5.js +50 -0
  37. package/chunk-4YRTZIVN.js +871 -0
  38. package/chunk-556RW72X.js +14110 -0
  39. package/{chunk-N7J63Q6C.js → chunk-56GBUMO5.js} +10 -1
  40. package/{chunk-W7XHHYWM.js → chunk-5BHQICF2.js} +5 -1
  41. package/{chunk-XUWRURDF.js → chunk-5EBLANFT.js} +1 -1
  42. package/{chunk-3AH7LNUB.js → chunk-5EMSBTQ6.js} +33 -14
  43. package/{chunk-YRRASA5Q.js → chunk-5MM7NNO6.js} +113 -52
  44. package/chunk-5MMAK75Q.js +15 -0
  45. package/{chunk-M5PVFLD4.js → chunk-64K7WX26.js} +90 -21
  46. package/{chunk-AKG5W4LG.js → chunk-6CCFTVBP.js} +76 -221
  47. package/chunk-6MJNEXUU.js +614 -0
  48. package/{chunk-62IL3KQV.js → chunk-6MXDOUMH.js} +15 -3
  49. package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
  50. package/chunk-6QDYSCPW.js +223 -0
  51. package/{chunk-HYZIYH2H.js → chunk-74RAWNQN.js} +56 -63
  52. package/chunk-7DPNBQSV.js +9 -0
  53. package/chunk-7MOXKPHC.js +119 -0
  54. package/{chunk-523WHFSL.js → chunk-7XKL25PW.js} +1973 -754
  55. package/{chunk-IAESIMK7.js → chunk-A4MW3YZL.js} +10 -14
  56. package/chunk-AGIM7IMJ.js +147 -0
  57. package/{chunk-7CHC4W22.js → chunk-AIZE5TDM.js} +3 -3
  58. package/{chunk-P4BX6FFU.js → chunk-AOCM7HPT.js} +214 -51
  59. package/{chunk-5GVBDNTO.js → chunk-AU7AXHUL.js} +1 -1
  60. package/{chunk-4H22P2JV.js → chunk-AUIJZACN.js} +2073 -1275
  61. package/{chunk-CIF4X6ZM.js → chunk-AWVFQMOV.js} +25 -3
  62. package/{chunk-RYZINGPM.js → chunk-BPMPOFWP.js} +347 -235
  63. package/{chunk-YUNJN43V.js → chunk-BU2YQBV4.js} +215 -28
  64. package/{chunk-XPRWFQQK.js → chunk-CBHGZRCE.js} +38 -12
  65. package/{chunk-Y3PMXGLH.js → chunk-CHCS6XPJ.js} +365 -144
  66. package/chunk-CHOZJMJS.js +78 -0
  67. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  68. package/{chunk-3SV7RM24.js → chunk-D2QN6CTI.js} +117 -72
  69. package/{chunk-5TEEECZM.js → chunk-E2AKSW7L.js} +10 -7
  70. package/{chunk-RSEEDUMS.js → chunk-EDX5XSJM.js} +2 -2
  71. package/{chunk-BKWMNZ2X.js → chunk-ES633ZS5.js} +280 -98
  72. package/{chunk-QDSINZM3.js → chunk-EUGTFFO6.js} +2 -23
  73. package/{chunk-UNYJU5L6.js → chunk-EYLGAEB4.js} +5 -1
  74. package/{chunk-CU3QB4HW.js → chunk-EYWJT7A2.js} +12 -12
  75. package/{chunk-BNGW5ASC.js → chunk-EZVK3N5L.js} +66 -18
  76. package/{chunk-6FGTMQCL.js → chunk-F32Z66T4.js} +6 -10
  77. package/chunk-FJMRBOPO.js +11507 -0
  78. package/{chunk-ZOVKKMF6.js → chunk-FY4SDK2E.js} +1 -1
  79. package/chunk-G6OOUQWJ.js +417 -0
  80. package/{chunk-PQWU42UQ.js → chunk-GCKHQECX.js} +6 -6
  81. package/chunk-GKXCHNTE.js +15 -0
  82. package/{chunk-T7F46O36.js → chunk-GQN2WLAI.js} +20 -11
  83. package/{chunk-P6GMCCAT.js → chunk-GQV5KHJU.js} +78 -12
  84. package/{chunk-B2XUQXQX.js → chunk-HIQ4GF53.js} +191 -68
  85. package/{chunk-YUWMM4US.js → chunk-HKX3ULQB.js} +34 -22
  86. package/{chunk-GMZLP5DV.js → chunk-HNUWUO75.js} +30 -19
  87. package/{chunk-5UTFL4QJ.js → chunk-I2ZMGXXF.js} +10 -5
  88. package/chunk-I42VC5KR.js +15 -0
  89. package/{chunk-3BXNTXYI.js → chunk-I4SN4NUQ.js} +1199 -56
  90. package/chunk-IA7TRNNR.js +11 -0
  91. package/{chunk-WIWM4FE3.js → chunk-IJERIUXS.js} +55 -748
  92. package/{chunk-CPUFH46E.js → chunk-ILU2NPWY.js} +10 -10
  93. package/{chunk-SLLGJZDT.js → chunk-ISQL4V7C.js} +4 -4
  94. package/chunk-IT3ZZRJE.js +12 -0
  95. package/{chunk-LPVCRQMM.js → chunk-IZ7OJB6K.js} +20 -16
  96. package/{chunk-DY7ANLKG.js → chunk-JKMLSTZK.js} +43 -12
  97. package/{chunk-6TPOEJMQ.js → chunk-JZX2XLKC.js} +64 -23
  98. package/{chunk-27ONFIEY.js → chunk-K2AER7RX.js} +19 -12
  99. package/{chunk-O2OWEFII.js → chunk-KFHQQ3NO.js} +1 -1
  100. package/{chunk-QXGPFY6J.js → chunk-LGN377P3.js} +27 -17
  101. package/{chunk-L36OWPP3.js → chunk-LIQJTQRN.js} +118 -139
  102. package/{chunk-FWQEKRTD.js → chunk-LTRUTOHX.js} +36 -31
  103. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  104. package/{chunk-5J3PYNUP.js → chunk-NYYFIKHI.js} +17 -3
  105. package/{chunk-6O4IK4V2.js → chunk-OFFL4DCR.js} +1 -1
  106. package/{chunk-B6SAMB33.js → chunk-OWYYDMGJ.js} +209 -9
  107. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  108. package/{chunk-CTUQJVQM.js → chunk-P5QACQDK.js} +1 -1
  109. package/{chunk-DIXLJWCD.js → chunk-PCKVQXYV.js} +274 -93
  110. package/{chunk-4JMDLJAD.js → chunk-PJNFNEJE.js} +114 -37
  111. package/{chunk-Z4CSIXYP.js → chunk-PLSVXHSA.js} +3 -3
  112. package/{chunk-BIDGLJQ3.js → chunk-PLXDDGBK.js} +45 -8
  113. package/chunk-PWTNI4N7.js +47 -0
  114. package/chunk-QFEW2ULV.js +42 -0
  115. package/{chunk-RGNEEJ3Y.js → chunk-QLQ573SU.js} +35 -9
  116. package/chunk-QQ56R7KS.js +88 -0
  117. package/chunk-QYPE3TS3.js +43 -0
  118. package/{chunk-4DPP773Q.js → chunk-RSHPU4PD.js} +59 -11
  119. package/chunk-RVWMAFIT.js +134 -0
  120. package/{chunk-ESHYE7WU.js → chunk-S73EPYNC.js} +10 -7
  121. package/{chunk-UQNS32WZ.js → chunk-SCMHQUMK.js} +1 -1
  122. package/{chunk-T767MPHB.js → chunk-SMENBO3M.js} +354 -120
  123. package/{chunk-PCVVZ2MH.js → chunk-SSFDFOVT.js} +26 -31
  124. package/chunk-SW4S4XYB.js +1794 -0
  125. package/{chunk-HUFPWXFW.js → chunk-T6X3D7NB.js} +572 -430
  126. package/chunk-TY3TIUJK.js +89 -0
  127. package/{chunk-X2QRZXZH.js → chunk-TYJ5XFEA.js} +4 -4
  128. package/{chunk-ALFH24P3.js → chunk-TYYRSFBG.js} +197 -155
  129. package/{chunk-7KVZ5LDQ.js → chunk-UBUH2TCC.js} +18 -4
  130. package/chunk-UEILX4EV.js +15 -0
  131. package/chunk-UHTDNB5Y.js +140 -0
  132. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  133. package/{chunk-OHOVNO7I.js → chunk-UOKFKFPO.js} +6 -3
  134. package/{chunk-XISEYOGH.js → chunk-USHQX6VT.js} +5 -5
  135. package/chunk-UUPR3TD7.js +53 -0
  136. package/{chunk-HDLLCBRF.js → chunk-VEA7H5FG.js} +2 -2
  137. package/chunk-VHGD6FHV.js +116 -0
  138. package/chunk-VIWDGTDA.js +8 -0
  139. package/{chunk-GOH6RW6F.js → chunk-VJXHL6MH.js} +34 -11
  140. package/{chunk-4XEYAFLY.js → chunk-VL5KOY2C.js} +623 -94
  141. package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
  142. package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
  143. package/chunk-WD4XYDYC.js +567 -0
  144. package/chunk-WJZOQR2J.js +151 -0
  145. package/{chunk-AUDNYVRC.js → chunk-XETG4RIX.js} +5 -5
  146. package/{chunk-MX574M24.js → chunk-XI7DGLUK.js} +4 -4
  147. package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
  148. package/chunk-XRUSXPCQ.js +514 -0
  149. package/{chunk-I4OPU5TK.js → chunk-XS47QOFV.js} +273 -11
  150. package/{chunk-S5XGT6GB.js → chunk-XZNCX52W.js} +30 -9
  151. package/{chunk-2JMMBU6V.js → chunk-Y2DXOPSO.js} +1920 -644
  152. package/{chunk-5OA5HMTL.js → chunk-YLMMECCH.js} +1 -1
  153. package/{chunk-CFT5HBGW.js → chunk-YVLQXTUB.js} +448 -12
  154. package/chunk-YVPQATSC.js +709 -0
  155. package/{chunk-DCFPQW22.js → chunk-Z7OJUX6S.js} +122 -107
  156. package/chunk-ZEZC7IIM.js +126 -0
  157. package/{chunk-ALGORS6Y.js → chunk-ZF6526IQ.js} +43 -8
  158. package/chunk-ZIWPQEFU.js +165 -0
  159. package/chunk-ZKZ5X2HS.js +7012 -0
  160. package/chunk-ZRAU6T47.js +56 -0
  161. package/{cliExecutor-AWYR3T33.js → cliExecutor-BWBF2MTI.js} +4 -3
  162. package/{clipboardy-BX4NMYHE.js → clipboardy-GCO3GT3I.js} +3 -8
  163. package/{commandRegistry-YOEQUA7T.js → commandRegistry-XN7C5GHO.js} +183 -107
  164. package/contentThunks-5L7YQI3S.js +84 -0
  165. package/{cooldownCommands-ZLEPIB4A.js → cooldownCommands-JFKTYS2D.js} +2 -2
  166. package/{createAgentAutomationAction-5EJL6ROU.js → createAgentAutomationAction-QOPOLCRK.js} +53 -44
  167. package/createDialogAction-MZ66VY5Q.js +76 -0
  168. package/{createPageAction-75ELC64R.js → createPageAction-VQDJIXMY.js} +65 -54
  169. package/cursorProvider-YGGNMVWX.js +6123 -0
  170. package/{db-VQSAOWAO.js → db-2QOTXYGH.js} +11 -5
  171. package/{dbSlice-DQ32LYTJ.js → dbSlice-J37OGIXH.js} +19 -13
  172. package/{deleteFile-NX6QHCWZ.js → deleteFile-6JWDDRVP.js} +10 -6
  173. package/dialogCommands-YZLSJB6X.js +113 -0
  174. package/{dialogSlice-KSXPGJB2.js → dialogSlice-6RODVYCK.js} +53 -39
  175. package/{docCreateCommands-ZSLGVBZT.js → docCreateCommands-JB2RRMRJ.js} +54 -57
  176. package/{docDeleteCommands-5N4GVZBG.js → docDeleteCommands-AQENULNM.js} +56 -58
  177. package/{docReadCommands-YJSAA7AV.js → docReadCommands-DYD25YLQ.js} +53 -56
  178. package/{docStore-AROBVRCR.js → docStore-ZZA3OPM5.js} +25 -16
  179. package/{docUpdateCommands-WEMLSW6W.js → docUpdateCommands-3GVS23QL.js} +54 -57
  180. package/{fetchMessages-67MEFPZR.js → fetchMessages-IIJWQ3HR.js} +5 -4
  181. package/{getPricing-NMMFT3YI.js → getPricing-FKK3F5EJ.js} +11 -9
  182. package/{handleSendMessageAction-EGNWHAUB.js → handleSendMessageAction-DVG5U26T.js} +619 -165
  183. package/index.js +11 -7
  184. package/{lib-FRRS27KN.js → lib-4YTWAGY7.js} +581 -248
  185. package/{localDialogRead-EBRS242U.js → localDialogRead-FSOMOPDZ.js} +2 -2
  186. package/localRuntimeAdapter-HXRHFKRC.js +244 -0
  187. package/localRuntimeAuthority-JDAD7CB6.js +16 -0
  188. package/{localRuntimeDb-3LRMNLCM.js → localRuntimeDb-CVC62PM5.js} +1 -1
  189. package/{machineCommands-ARZYKGGE.js → machineCommands-5KBF4RCC.js} +503 -161
  190. package/{machineInfo-66ZFUMLE.js → machineInfo-UKPTZO5Y.js} +2 -2
  191. package/machineWsRunDispatch-4OQDEDOR.js +169 -0
  192. package/{memberThunks-5ZXPR63F.js → memberThunks-66DH6ABQ.js} +25 -18
  193. package/{models-ZPU5EDF4.js → models-LAS4B2B5.js} +2 -2
  194. package/package.json +1 -1
  195. package/{providerPresetApply-DD6NGWW6.js → providerPresetApply-MY66I6NT.js} +10 -10
  196. package/{providerRegistry-XDRLMYGJ.js → providerRegistry-QOE2FT57.js} +13 -9
  197. package/{read-EPTJRAEF.js → read-DC4NUGN6.js} +12 -8
  198. package/{readDocTool-W4NDXNEX.js → readDocTool-NCJ5NT25.js} +1 -1
  199. package/{readlineWorkspace-3XOFVARF.js → readlineWorkspace-RIE62QVZ.js} +5022 -921
  200. package/{removeDialogAgentAction-OSYNZRX7.js → removeDialogAgentAction-E2H3OZU6.js} +29 -28
  201. package/{runAgentClientLoop-UMF7VZYZ.js → runAgentClientLoop-KLUUXBZS.js} +154 -97
  202. package/{runtimeDoctorCommands-ID23PNNZ.js → runtimeDoctorCommands-GIOGC5SC.js} +17 -17
  203. package/secretCommands-ZXZRLR3R.js +700 -0
  204. package/setDialogExtraReferencesAction-SITRPMYU.js +37 -0
  205. package/{setPrimaryDialogAgentAction-WZ7KI3YA.js → setPrimaryDialogAgentAction-U7N45TGC.js} +30 -29
  206. package/{chunk-SONWNI3L.js → settingThunks-Y7SVJOMZ.js} +223 -928
  207. package/{skillDiscovery-ZBU76COE.js → skillDiscovery-QC35EQY4.js} +2 -2
  208. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  209. package/{spaceCommands-UJOVU4XI.js → spaceCommands-ZR5BR3GX.js} +59 -59
  210. package/{streamAgentChatTurn-GYGMYOSM.js → streamAgentChatTurn-MN2SSPGA.js} +309 -165
  211. package/{switchDialogAgentAction-GMR7WN3P.js → switchDialogAgentAction-OMGBD3N2.js} +26 -22
  212. package/{tableCommands-G7RV3RU3.js → tableCommands-U3QDY4L6.js} +19 -17
  213. package/{toolApiClient-CVGWM4PN.js → toolApiClient-7WSJJJBV.js} +6 -5
  214. package/tools-W2MOLERY.js +124 -0
  215. package/tuiSummaryLlmCaller-BM3VSTBU.js +130 -0
  216. package/{updateCommands-4EHDLF5J.js → updateCommands-NQXAGFM7.js} +3 -3
  217. package/{updateDialogTitleAction-4U5W4AMH.js → updateDialogTitleAction-Z4JX6REN.js} +102 -57
  218. package/workloadLifecycle-36DXRZKU.js +320 -0
  219. package/action-GI44T4DR.js +0 -31
  220. package/agentListCommands-IW3GQVUP.js +0 -427
  221. package/agentRecordCommands-4YBSYPIY.js +0 -134
  222. package/agentRunCommand-5MU5X5OT.js +0 -161
  223. package/browser-image-compression-MFDTD7K6.js +0 -1763
  224. package/chatQueueReduxAdapter-HVHA2HPM.js +0 -186
  225. package/chromeOpsCommands-IXRLN57H.js +0 -289
  226. package/chunk-42Z3EMC4.js +0 -25363
  227. package/chunk-CQ3WA2NE.js +0 -299
  228. package/chunk-CYSYR67N.js +0 -93
  229. package/chunk-IAG4FHOJ.js +0 -34
  230. package/chunk-JBTJAPUF.js +0 -35
  231. package/chunk-K2CSUCHJ.js +0 -620
  232. package/chunk-LTRXGFMS.js +0 -83
  233. package/chunk-M76ECQRD.js +0 -13658
  234. package/chunk-MEYIRKDN.js +0 -8967
  235. package/chunk-OCZKATRC.js +0 -129
  236. package/chunk-OTGFTBLI.js +0 -13
  237. package/chunk-PUOC4YRO.js +0 -394
  238. package/chunk-QU5A4LYX.js +0 -2415
  239. package/chunk-URMS4XY2.js +0 -10
  240. package/chunk-UV6VISQJ.js +0 -20
  241. package/chunk-VJVNU77E.js +0 -83
  242. package/chunk-WRMKCKZ3.js +0 -13807
  243. package/chunk-Y5GCAMGP.js +0 -9
  244. package/chunk-YPREESF4.js +0 -225
  245. package/contentThunks-AK2F3KNC.js +0 -73
  246. package/createDialogAction-F5WEWA47.js +0 -66
  247. package/dialogCommands-G7YBVAMC.js +0 -102
  248. package/levelLazyShim-GZBKODGI.js +0 -7
  249. package/machineWsRunDispatch-I7F4L532.js +0 -149
  250. package/serverStoreFactory-YMXDF4NI.js +0 -20
  251. package/setDialogExtraReferencesAction-M32UYNCG.js +0 -30
  252. package/settingSlice-Q6EKL7EQ.js +0 -204
  253. package/syncMapping-N6RGXGBW.js +0 -437
  254. package/tools-DU4JXVAV.js +0 -111
  255. package/tuiSummaryLlmCaller-3YFNHCTW.js +0 -128
  256. package/{chunk-SV5IJK6K.js → chunk-NBTY7YJF.js} +3 -3
  257. package/{chunk-2SYTUTLI.js → chunk-YBNHPX4S.js} +3 -3
  258. package/{offlineMarxistsAgentCommand-HGXZV4XJ.js → offlineMarxistsAgentCommand-2QTHJCHV.js} +4 -4
@@ -0,0 +1,472 @@
1
+ import {
2
+ createChromeConnectorClient,
3
+ createVerifiedChromeConnectorClient
4
+ } from "./chunk-BU2YQBV4.js";
5
+ import "./chunk-KUG52IAP.js";
6
+ import {
7
+ toErrorMessage
8
+ } from "./chunk-HNMXYYJR.js";
9
+ import {
10
+ readOption
11
+ } from "./chunk-A7GB5UGH.js";
12
+ import "./chunk-OLZBQWZU.js";
13
+ import "./chunk-LCBAMY2M.js";
14
+ import "./chunk-4SN6J65J.js";
15
+ import "./chunk-CF7PE763.js";
16
+ import "./chunk-G3SUCT4W.js";
17
+ import "./chunk-4VNS5WPM.js";
18
+
19
+ // packages/cli/chromeOpsCommands.ts
20
+ import { writeFile } from "node:fs/promises";
21
+ function wantsHelp(args) {
22
+ return args.includes("--help") || args.includes("-h");
23
+ }
24
+ function readTrimmedOption(args, flag) {
25
+ return (readOption(args, flag) ?? "").trim();
26
+ }
27
+ function readBrowserFlag(args) {
28
+ const equalsForm = args.find((arg) => arg.startsWith("--browser="));
29
+ const raw = equalsForm !== void 0 ? equalsForm.slice("--browser=".length) : readOption(args, "--browser");
30
+ if (raw === void 0) return void 0;
31
+ const value = raw.trim();
32
+ if (value === "chrome" || value === "firefox") return value;
33
+ return null;
34
+ }
35
+ function readAllOptions(args, flag) {
36
+ const values = [];
37
+ for (let i = 0; i < args.length; i++) {
38
+ if (args[i] === flag && i + 1 < args.length) {
39
+ const val = args[i + 1].trim();
40
+ if (val && !val.startsWith("--")) {
41
+ values.push(val);
42
+ }
43
+ }
44
+ }
45
+ return values;
46
+ }
47
+ function readIntOption(args, flag, usage) {
48
+ const raw = readOption(args, flag);
49
+ if (raw === void 0) return void 0;
50
+ const value = Number.parseInt(raw, 10);
51
+ if (!Number.isFinite(value)) {
52
+ throw new Error(`Invalid ${flag} <N>. Usage: ${usage}`);
53
+ }
54
+ return value;
55
+ }
56
+ function readNonNegativeIntOption(args, flag, usage) {
57
+ const equalsForm = args.find((arg) => arg.startsWith(`${flag}=`));
58
+ const raw = equalsForm !== void 0 ? equalsForm.slice(`${flag}=`.length) : readOption(args, flag);
59
+ if (raw === void 0) {
60
+ if (args.includes(flag)) {
61
+ throw new Error(`Invalid ${flag} <N>. Usage: ${usage}`);
62
+ }
63
+ return void 0;
64
+ }
65
+ const trimmed = raw.trim();
66
+ if (!/^\d+$/.test(trimmed)) {
67
+ throw new Error(`Invalid ${flag} <N>. Usage: ${usage}`);
68
+ }
69
+ const value = Number.parseInt(trimmed, 10);
70
+ if (!Number.isFinite(value) || value < 0) {
71
+ throw new Error(`Invalid ${flag} <N>. Usage: ${usage}`);
72
+ }
73
+ return value;
74
+ }
75
+ function requireTabId(args, usage) {
76
+ const tabId = readTrimmedOption(args, "--tab");
77
+ if (!tabId) {
78
+ throw new Error(`Missing required --tab <id>. Usage: ${usage}`);
79
+ }
80
+ return tabId;
81
+ }
82
+ function requireTarget(args, usage) {
83
+ const elementRef = readTrimmedOption(args, "--ref");
84
+ const selector = readTrimmedOption(args, "--selector");
85
+ if (!elementRef && !selector) {
86
+ throw new Error(
87
+ `Provide --ref <elementRef> (from read-page) or --selector <css>. Usage: ${usage}`
88
+ );
89
+ }
90
+ return {
91
+ ...elementRef ? { elementRef } : {},
92
+ ...selector ? { selector } : {}
93
+ };
94
+ }
95
+ var CHROME_OPS_SUBCOMMANDS = {
96
+ "list-tabs": {
97
+ action: "list_tabs",
98
+ usage: "nolo browser list-tabs",
99
+ payload: () => ({})
100
+ },
101
+ "open-tab": {
102
+ action: "open_tab",
103
+ usage: "nolo browser open-tab --url <url> [--active]",
104
+ payload: (args, usage) => {
105
+ const url = readTrimmedOption(args, "--url");
106
+ if (!url) {
107
+ throw new Error(`Missing required --url <url>. Usage: ${usage}`);
108
+ }
109
+ return { url, active: args.includes("--active") };
110
+ }
111
+ },
112
+ "close-tab": {
113
+ action: "close_tab",
114
+ usage: "nolo browser close-tab --tab <id>",
115
+ payload: (args, usage) => ({ tabId: requireTabId(args, usage) })
116
+ },
117
+ "read-page": {
118
+ action: "read_page",
119
+ usage: "nolo browser read-page --tab <id> [--selector <css>] [--detail compact|full] [--max-elements N] [--offset N] [--viewport]",
120
+ payload: (args, usage) => {
121
+ const payload = { tabId: requireTabId(args, usage) };
122
+ const selector = readTrimmedOption(args, "--selector");
123
+ if (selector) payload.selector = selector;
124
+ const detail = readTrimmedOption(args, "--detail");
125
+ if (detail) payload.detail = detail;
126
+ const maxElements = readIntOption(args, "--max-elements", usage);
127
+ if (maxElements !== void 0) payload.maxElements = maxElements;
128
+ const offset = readNonNegativeIntOption(args, "--offset", usage);
129
+ if (offset !== void 0) payload.offset = offset;
130
+ if (args.includes("--viewport")) payload.viewportOnly = true;
131
+ return payload;
132
+ }
133
+ },
134
+ click: {
135
+ action: "click",
136
+ usage: "nolo browser click --tab <id> (--ref <elementRef> | --selector <css>)",
137
+ payload: (args, usage) => ({
138
+ tabId: requireTabId(args, usage),
139
+ ...requireTarget(args, usage)
140
+ })
141
+ },
142
+ type: {
143
+ action: "type",
144
+ usage: "nolo browser type --tab <id> (--ref <elementRef> | --selector <css>) --text <text> [--append]",
145
+ payload: (args, usage) => {
146
+ const text = readOption(args, "--text");
147
+ if (text === void 0 || text.startsWith("--")) {
148
+ throw new Error(`Missing required --text <text>. Usage: ${usage}`);
149
+ }
150
+ return {
151
+ tabId: requireTabId(args, usage),
152
+ ...requireTarget(args, usage),
153
+ text,
154
+ ...args.includes("--append") ? { clearFirst: false } : {}
155
+ };
156
+ }
157
+ },
158
+ upload: {
159
+ action: "set_files",
160
+ usage: "nolo browser upload --tab <id> (--ref <elementRef> | --selector <css>) --file <path> [--file <path>...]",
161
+ payload: (args, usage) => {
162
+ const files = readAllOptions(args, "--file");
163
+ if (files.length === 0) {
164
+ throw new Error(`Missing required --file <path>. Usage: ${usage}`);
165
+ }
166
+ const target = requireTarget(args, usage);
167
+ const tabId = requireTabId(args, usage);
168
+ return {
169
+ tabId,
170
+ ...target,
171
+ ...target.elementRef ? { ref: target.elementRef } : {},
172
+ files
173
+ };
174
+ }
175
+ },
176
+ press: {
177
+ action: "press",
178
+ usage: "nolo browser press --tab <id> --key <key>",
179
+ payload: (args, usage) => {
180
+ const key = readTrimmedOption(args, "--key");
181
+ if (!key) {
182
+ throw new Error(`Missing required --key <key>. Usage: ${usage}`);
183
+ }
184
+ return { tabId: requireTabId(args, usage), key };
185
+ }
186
+ },
187
+ "prepare-action": {
188
+ action: "prepare_browser_action",
189
+ usage: "nolo browser prepare-action --tab <id> --action click|type|press (--selector <css> | --active) [--text <text>] [--key <key>] [--owner <id>] [--dialog <id>]",
190
+ payload: (args, usage) => {
191
+ const tabId = requireTabId(args, usage);
192
+ const action = readTrimmedOption(args, "--action").toLowerCase();
193
+ if (!action || !["click", "type", "press"].includes(action)) {
194
+ throw new Error(`Invalid or missing --action <click|type|press>. Usage: ${usage}`);
195
+ }
196
+ if (readOption(args, "--ref") !== void 0) {
197
+ throw new Error(`--ref is not supported for action preparation; use --selector or --active. Usage: ${usage}`);
198
+ }
199
+ const active = args.includes("--active");
200
+ const selector = readTrimmedOption(args, "--selector");
201
+ if (!active && !selector && action !== "press") {
202
+ throw new Error(`Provide --selector <css> or --active. Usage: ${usage}`);
203
+ }
204
+ const payload = {
205
+ tabId,
206
+ action,
207
+ ...active ? { active: true } : {},
208
+ ...selector ? { selector } : {}
209
+ };
210
+ if (action === "type") {
211
+ const text = readOption(args, "--text");
212
+ if (text === void 0 || text.startsWith("--")) {
213
+ throw new Error(`Missing required --text <text> for type action. Usage: ${usage}`);
214
+ }
215
+ payload.text = text;
216
+ if (args.includes("--append")) {
217
+ payload.clearFirst = false;
218
+ }
219
+ } else if (action === "press") {
220
+ const key = readTrimmedOption(args, "--key");
221
+ if (!key) {
222
+ throw new Error(`Missing required --key <key> for press action. Usage: ${usage}`);
223
+ }
224
+ payload.key = key;
225
+ }
226
+ const owner = readTrimmedOption(args, "--owner");
227
+ if (owner) payload.owner = owner;
228
+ const dialog = readTrimmedOption(args, "--dialog");
229
+ if (dialog) payload.dialogId = dialog;
230
+ return payload;
231
+ }
232
+ },
233
+ scroll: {
234
+ action: "scroll",
235
+ usage: "nolo browser scroll --tab <id> [--selector <css>] [--delta-x N] [--delta-y N]",
236
+ payload: (args, usage) => {
237
+ const payload = { tabId: requireTabId(args, usage) };
238
+ const selector = readTrimmedOption(args, "--selector");
239
+ const deltaX = readIntOption(args, "--delta-x", usage);
240
+ const deltaY = readIntOption(args, "--delta-y", usage);
241
+ if (selector) payload.selector = selector;
242
+ if (deltaX !== void 0) payload.deltaX = deltaX;
243
+ if (deltaY !== void 0) payload.deltaY = deltaY;
244
+ return payload;
245
+ }
246
+ },
247
+ screenshot: {
248
+ action: "screenshot",
249
+ usage: "nolo browser screenshot --tab <id> [--out <path>] [--full-page]",
250
+ payload: (args, usage) => ({
251
+ tabId: requireTabId(args, usage),
252
+ ...args.includes("--full-page") ? { fullPage: true } : {}
253
+ })
254
+ },
255
+ "read-console": {
256
+ action: "read_console",
257
+ usage: "nolo browser read-console --tab <id> [--limit N]",
258
+ payload: (args, usage) => {
259
+ const payload = { tabId: requireTabId(args, usage) };
260
+ const limit = readIntOption(args, "--limit", usage);
261
+ if (limit !== void 0) payload.limit = limit;
262
+ return payload;
263
+ }
264
+ },
265
+ "read-network": {
266
+ action: "read_network",
267
+ usage: "nolo browser read-network --tab <id> [--limit N] [--include-assets]",
268
+ payload: (args, usage) => {
269
+ const payload = { tabId: requireTabId(args, usage) };
270
+ const limit = readIntOption(args, "--limit", usage);
271
+ if (limit !== void 0) payload.limit = limit;
272
+ if (args.includes("--include-assets")) payload.includeAssets = true;
273
+ return payload;
274
+ }
275
+ }
276
+ };
277
+ function renderChromeOpsHelp() {
278
+ const lines = [
279
+ "Operate the user's browser (Chrome or Firefox) through the Nolo Browser Connector",
280
+ "(the desktop bridge; the same RPC the browser_* agent tools use \u2014 legacy `chrome_*` names still work).",
281
+ "",
282
+ "Usage:",
283
+ " nolo browser <subcommand> [flags]",
284
+ " nolo chrome <subcommand> [flags] # compatibility alias",
285
+ "",
286
+ "Subcommands:",
287
+ ...Object.values(CHROME_OPS_SUBCOMMANDS).map(
288
+ (spec) => ` ${spec.usage.replace(/^nolo browser /, "")}`
289
+ ),
290
+ "",
291
+ "Notes:",
292
+ " --ref takes an elementRef copied from `nolo browser read-page` (revision-scoped,",
293
+ " preferred over --selector); --selector takes a CSS selector.",
294
+ " Actions the connector classifies as irreversible (Submit / Delete / Pay ...)",
295
+ " are refused with CONFIRMATION_REQUIRED \u2014 ask the user to perform them.",
296
+ " prepare-action prepares an immutable action challenge binding for host consent verification;",
297
+ " it is strictly read-only, never executes mutations, and does not grant approval.",
298
+ " read-console / read-network / upload work on Chrome only (Firefox lacks chrome.debugger).",
299
+ " --browser chrome|firefox selects which connector endpoint serves the call (default",
300
+ " auto-detects single online browser: chrome = 127.0.0.1:38947, firefox = 127.0.0.1:38948);",
301
+ " the wrong browser is refused.",
302
+ " Every subcommand prints the connector's raw JSON result; failures exit 1.",
303
+ " Endpoint: NOLO_CHROME_CONNECTOR_RPC_URL or per-browser NOLO_CHROME_CONNECTOR_PORT /",
304
+ " NOLO_FIREFOX_CONNECTOR_PORT (default http://127.0.0.1:38947/rpc)."
305
+ ];
306
+ return lines.join("\n");
307
+ }
308
+ var CHROME_OPS_HELP_TEXT = renderChromeOpsHelp();
309
+ async function defaultProbeBrowser(browser) {
310
+ try {
311
+ const client = createChromeConnectorClient({
312
+ browser,
313
+ fetchImpl: (input, init) => {
314
+ return fetch(input, {
315
+ ...init,
316
+ signal: AbortSignal.timeout(400)
317
+ });
318
+ }
319
+ });
320
+ const info = await client.request("connector_info", {});
321
+ return typeof info?.extensionId === "string";
322
+ } catch (error) {
323
+ if (error?.code === "CHROME_CONNECTOR_UNAVAILABLE") {
324
+ return false;
325
+ }
326
+ const handshakeError = new Error(
327
+ `\u63A2\u6D4B\u5230\u7AEF\u70B9\u4F46\u63E1\u624B\u5931\u8D25\uFF1A${toErrorMessage(error)}`
328
+ );
329
+ handshakeError.code = error?.code || "CHROME_CONNECTOR_HANDSHAKE_FAILED";
330
+ handshakeError.details = error?.details;
331
+ throw handshakeError;
332
+ }
333
+ }
334
+ async function runChromeOpsCommand(subcommand, args, deps = {}) {
335
+ const io = {
336
+ stdout: (text) => console.log(text),
337
+ stderr: (text) => console.error(text),
338
+ ...deps.io
339
+ };
340
+ const spec = CHROME_OPS_SUBCOMMANDS[subcommand];
341
+ if (!spec) {
342
+ io.stderr(`Unknown browser subcommand "${subcommand}".
343
+
344
+ ${CHROME_OPS_HELP_TEXT}`);
345
+ return 1;
346
+ }
347
+ if (wantsHelp(args)) {
348
+ io.stdout(CHROME_OPS_HELP_TEXT);
349
+ return 0;
350
+ }
351
+ const browserFlag = readBrowserFlag(args);
352
+ if (browserFlag === null) {
353
+ io.stderr(
354
+ `Invalid --browser value: expected "chrome" or "firefox". Usage: ${spec.usage}`
355
+ );
356
+ return 1;
357
+ }
358
+ let payload;
359
+ try {
360
+ payload = spec.payload(args, spec.usage);
361
+ } catch (error) {
362
+ io.stderr(toErrorMessage(error));
363
+ return 1;
364
+ }
365
+ let result;
366
+ try {
367
+ const env = deps.env ?? process.env;
368
+ let client;
369
+ if (deps.client) {
370
+ client = deps.client;
371
+ } else {
372
+ let targetBrowser = browserFlag;
373
+ if (!targetBrowser && !env.NOLO_CHROME_CONNECTOR_RPC_URL) {
374
+ const probe = deps.probeBrowser ?? defaultProbeBrowser;
375
+ const [chromeResult, firefoxResult] = await Promise.allSettled([
376
+ probe("chrome"),
377
+ probe("firefox")
378
+ ]);
379
+ const chromeOnline = chromeResult.status === "fulfilled" && chromeResult.value === true;
380
+ const firefoxOnline = firefoxResult.status === "fulfilled" && firefoxResult.value === true;
381
+ if (chromeOnline && firefoxOnline) {
382
+ const error = new Error(
383
+ "Both Chrome and Firefox connectors are online. Specify --browser chrome or --browser firefox."
384
+ );
385
+ error.code = "MULTIPLE_BROWSERS_AVAILABLE";
386
+ throw error;
387
+ }
388
+ if (chromeOnline) {
389
+ targetBrowser = "chrome";
390
+ } else if (firefoxOnline) {
391
+ targetBrowser = "firefox";
392
+ } else {
393
+ if (chromeResult.status === "rejected") {
394
+ const reason = toErrorMessage(chromeResult.reason);
395
+ const err = new Error(
396
+ reason.startsWith("\u63A2\u6D4B\u5230\u7AEF\u70B9\u4F46\u63E1\u624B\u5931\u8D25\uFF1A") ? reason : `\u63A2\u6D4B\u5230\u7AEF\u70B9\u4F46\u63E1\u624B\u5931\u8D25\uFF1A${reason}`
397
+ );
398
+ err.code = chromeResult.reason?.code || "CHROME_CONNECTOR_HANDSHAKE_FAILED";
399
+ err.details = chromeResult.reason?.details;
400
+ throw err;
401
+ }
402
+ if (firefoxResult.status === "rejected") {
403
+ const reason = toErrorMessage(firefoxResult.reason);
404
+ const err = new Error(
405
+ reason.startsWith("\u63A2\u6D4B\u5230\u7AEF\u70B9\u4F46\u63E1\u624B\u5931\u8D25\uFF1A") ? reason : `\u63A2\u6D4B\u5230\u7AEF\u70B9\u4F46\u63E1\u624B\u5931\u8D25\uFF1A${reason}`
406
+ );
407
+ err.code = firefoxResult.reason?.code || "CHROME_CONNECTOR_HANDSHAKE_FAILED";
408
+ err.details = firefoxResult.reason?.details;
409
+ throw err;
410
+ }
411
+ const chromePort = env.NOLO_CHROME_CONNECTOR_PORT || 38947;
412
+ const firefoxPort = env.NOLO_FIREFOX_CONNECTOR_PORT || 38948;
413
+ const chromeEndpoint = `http://127.0.0.1:${chromePort}/rpc`;
414
+ const firefoxEndpoint = `http://127.0.0.1:${firefoxPort}/rpc`;
415
+ const error = new Error(
416
+ `Chrome connector RPC endpoint is unavailable at ${chromeEndpoint} or ${firefoxEndpoint}.`
417
+ );
418
+ error.code = "CHROME_CONNECTOR_UNAVAILABLE";
419
+ throw error;
420
+ }
421
+ }
422
+ if (deps.createClient) {
423
+ client = deps.createClient(targetBrowser);
424
+ } else if (targetBrowser) {
425
+ client = createVerifiedChromeConnectorClient({
426
+ client: createChromeConnectorClient({ browser: targetBrowser }),
427
+ expectedBrowser: targetBrowser
428
+ });
429
+ } else {
430
+ client = createChromeConnectorClient();
431
+ }
432
+ }
433
+ result = await client.request(spec.action, payload);
434
+ } catch (error) {
435
+ const code = typeof error?.code === "string" ? error.code : "CHROME_COMMAND_FAILED";
436
+ io.stderr(JSON.stringify({ ok: false, error: { code, message: toErrorMessage(error) } }, null, 2));
437
+ return 1;
438
+ }
439
+ if (subcommand === "screenshot") {
440
+ const out = readTrimmedOption(args, "--out");
441
+ const dataUrl = result?.dataUrl;
442
+ if (out && typeof dataUrl === "string") {
443
+ const base64 = dataUrl.includes(",") ? dataUrl.slice(dataUrl.indexOf(",") + 1) : dataUrl;
444
+ const bytes = Buffer.from(base64, "base64");
445
+ try {
446
+ await writeFile(out, bytes);
447
+ } catch (error) {
448
+ io.stderr(
449
+ JSON.stringify(
450
+ {
451
+ ok: false,
452
+ error: { code: "SCREENSHOT_WRITE_FAILED", message: toErrorMessage(error) }
453
+ },
454
+ null,
455
+ 2
456
+ )
457
+ );
458
+ return 1;
459
+ }
460
+ io.stdout(JSON.stringify({ ok: true, result: { savedTo: out, bytes: bytes.byteLength } }, null, 2));
461
+ return 0;
462
+ }
463
+ }
464
+ io.stdout(JSON.stringify({ ok: true, result }, null, 2));
465
+ return 0;
466
+ }
467
+ export {
468
+ CHROME_OPS_HELP_TEXT,
469
+ CHROME_OPS_SUBCOMMANDS,
470
+ renderChromeOpsHelp,
471
+ runChromeOpsCommand
472
+ };
@@ -3,13 +3,45 @@ import {
3
3
  } from "./chunk-NF64D32W.js";
4
4
  import {
5
5
  CORE_DRAIN_REASON,
6
+ parsePositiveFiniteNumberOrFallback,
6
7
  parseRetryAfterHeaderMs
7
- } from "./chunk-3L2WKC3W.js";
8
+ } from "./chunk-XPWGOTBQ.js";
8
9
  import {
9
10
  asTrimmedLowercaseString
10
11
  } from "./chunk-QSJ3HFEF.js";
11
12
 
12
13
  // packages/cli/connectorWebSocketTarget.ts
14
+ var MAX_CONNECTOR_TIMER_DELAY_MS = 2147483647;
15
+ function clampConnectorTimerDelayMs(value) {
16
+ return Math.min(Math.max(value, 1), MAX_CONNECTOR_TIMER_DELAY_MS);
17
+ }
18
+ var DEFAULT_CONNECTOR_PROBE_TIMEOUT_MS = 5e3;
19
+ function resolveConnectorProbeTimeoutMs(env) {
20
+ return clampConnectorTimerDelayMs(
21
+ parsePositiveFiniteNumberOrFallback(
22
+ env.NOLO_CONNECT_PROBE_TIMEOUT_MS,
23
+ DEFAULT_CONNECTOR_PROBE_TIMEOUT_MS
24
+ )
25
+ );
26
+ }
27
+ async function probeConnectorWebSocketTarget(args) {
28
+ const controller = new AbortController();
29
+ let timer = null;
30
+ const timeoutPromise = new Promise((resolve) => {
31
+ timer = setTimeout(() => {
32
+ controller.abort();
33
+ resolve(null);
34
+ }, args.timeoutMs);
35
+ });
36
+ try {
37
+ return await Promise.race([
38
+ args.fetchImpl(args.probeUrl, { headers: args.headers, signal: controller.signal }).catch(() => null),
39
+ timeoutPromise
40
+ ]);
41
+ } finally {
42
+ if (timer) clearTimeout(timer);
43
+ }
44
+ }
13
45
  var ConnectorWebSocketAuthError = class extends Error {
14
46
  code;
15
47
  constructor(message, code = "CONNECTOR_AUTH_FAILED") {
@@ -53,9 +85,13 @@ async function resolveConnectorWebSocketTarget(input) {
53
85
  const probeUrl = new URL(input.serverUrl);
54
86
  probeUrl.pathname = "/api/connector/ws";
55
87
  probeUrl.search = directWsUrl.search;
56
- const response = await (input.fetchImpl ?? fetch)(probeUrl, {
57
- headers: input.headers
58
- }).catch(() => null);
88
+ const probeTimeoutMs = input.probeTimeoutMs ?? resolveConnectorProbeTimeoutMs(input.env ?? process.env);
89
+ const response = await probeConnectorWebSocketTarget({
90
+ fetchImpl: input.fetchImpl ?? fetch,
91
+ probeUrl,
92
+ headers: input.headers,
93
+ timeoutMs: clampConnectorTimerDelayMs(probeTimeoutMs)
94
+ });
59
95
  if (response && (response.status === 401 || response.status === 403)) {
60
96
  const json2 = await response.json().catch(() => null);
61
97
  const code = typeof json2?.code === "string" ? json2.code : "CONNECTOR_AUTH_FAILED";
@@ -82,6 +118,9 @@ async function resolveConnectorWebSocketTarget(input) {
82
118
  }
83
119
 
84
120
  export {
121
+ MAX_CONNECTOR_TIMER_DELAY_MS,
122
+ clampConnectorTimerDelayMs,
123
+ resolveConnectorProbeTimeoutMs,
85
124
  isConnectorWebSocketAuthError,
86
125
  isConnectorWebSocketRetryableError,
87
126
  resolveConnectorWebSocketTarget