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,791 @@
1
+ import {
2
+ assertCredentialRef
3
+ } from "./chunk-E6A5NHDH.js";
4
+ import {
5
+ asTrimmedString
6
+ } from "./chunk-3EUW3WEO.js";
7
+
8
+ // packages/agent-runtime/linuxSecretServiceCredentialBroker.ts
9
+ import { spawn } from "node:child_process";
10
+ var LINUX_SECRET_SERVICE_ATTRIBUTE = "nolo-credential";
11
+ var SECRET_TOOL_NO_MATCH_EXIT = 1;
12
+ var isGenuineNoMatch = (result) => result.exitCode === SECRET_TOOL_NO_MATCH_EXIT && result.stderr.trim() === "";
13
+ var DEFAULT_SECRET_TOOL_BIN = "secret-tool";
14
+ function safeCredentialRef(ref) {
15
+ try {
16
+ return assertCredentialRef(ref);
17
+ } catch {
18
+ throw new Error("invalid_ref");
19
+ }
20
+ }
21
+ function brokerFailure(op) {
22
+ throw new Error(`credential_broker_${op}_failed`);
23
+ }
24
+ function createDefaultSecretToolRunner(secretToolBin = DEFAULT_SECRET_TOOL_BIN, timeoutMs = 15e3) {
25
+ return (input) => new Promise((resolve) => {
26
+ let stdout = "";
27
+ let stderr = "";
28
+ let settled = false;
29
+ let timer;
30
+ const finish = (result) => {
31
+ if (settled) return;
32
+ settled = true;
33
+ clearTimeout(timer);
34
+ resolve(result);
35
+ };
36
+ let child;
37
+ try {
38
+ child = spawn(secretToolBin, input.args, {
39
+ stdio: ["pipe", "pipe", "pipe"],
40
+ detached: process.platform !== "win32"
41
+ });
42
+ } catch {
43
+ finish({ exitCode: -1, stdout: "", stderr: "" });
44
+ return;
45
+ }
46
+ timer = setTimeout(() => {
47
+ try {
48
+ if (process.platform !== "win32" && child.pid !== void 0) {
49
+ try {
50
+ process.kill(-child.pid, "SIGKILL");
51
+ return;
52
+ } catch {
53
+ }
54
+ }
55
+ child.kill("SIGKILL");
56
+ } catch {
57
+ } finally {
58
+ finish({ exitCode: -1, stdout: "", stderr: "" });
59
+ }
60
+ }, timeoutMs);
61
+ child.stdout?.on("data", (chunk) => {
62
+ stdout += chunk;
63
+ });
64
+ child.stderr?.on("data", (chunk) => {
65
+ stderr += chunk;
66
+ });
67
+ child.on("error", () => {
68
+ finish({ exitCode: -1, stdout: "", stderr: "" });
69
+ });
70
+ child.on("close", (code) => {
71
+ finish({
72
+ exitCode: typeof code === "number" ? code : -1,
73
+ stdout,
74
+ stderr
75
+ });
76
+ });
77
+ child.stdin?.on("error", () => {
78
+ });
79
+ child.stdin?.end(input.stdin);
80
+ });
81
+ }
82
+ function createLinuxSecretServiceCredentialBroker(options = {}) {
83
+ const runner = options.runner ?? createDefaultSecretToolRunner(options.secretToolBin);
84
+ const attribute = options.attribute ?? LINUX_SECRET_SERVICE_ATTRIBUTE;
85
+ const attrArgs = (ref) => [attribute, ref];
86
+ const lookup = async (ref) => {
87
+ try {
88
+ return await runner({ args: ["lookup", ...attrArgs(ref)] });
89
+ } catch {
90
+ brokerFailure("get");
91
+ }
92
+ };
93
+ return {
94
+ async get(ref) {
95
+ const safeRef = safeCredentialRef(ref);
96
+ const result = await lookup(safeRef);
97
+ if (isGenuineNoMatch(result)) return null;
98
+ if (result.exitCode !== 0) brokerFailure("get");
99
+ const secret = result.stdout.replace(/\n$/, "");
100
+ return secret.length > 0 ? secret : null;
101
+ },
102
+ async put(ref, secret) {
103
+ const safeRef = safeCredentialRef(ref);
104
+ const value = asTrimmedString(secret);
105
+ if (!value) {
106
+ throw new Error("Cannot store an empty credential secret.");
107
+ }
108
+ const args = [
109
+ "store",
110
+ `--label=nolo-credential:${safeRef}`,
111
+ ...attrArgs(safeRef)
112
+ ];
113
+ if (value.includes("\n") || args.some((arg) => arg.includes(value))) {
114
+ brokerFailure("put");
115
+ }
116
+ let result;
117
+ try {
118
+ result = await runner({ args, stdin: value });
119
+ } catch {
120
+ brokerFailure("put");
121
+ }
122
+ if (result.exitCode !== 0) brokerFailure("put");
123
+ },
124
+ async delete(ref) {
125
+ const safeRef = safeCredentialRef(ref);
126
+ let result;
127
+ try {
128
+ result = await runner({ args: ["clear", ...attrArgs(safeRef)] });
129
+ } catch {
130
+ brokerFailure("delete");
131
+ }
132
+ if (result.exitCode === 0 || isGenuineNoMatch(result)) {
133
+ return;
134
+ }
135
+ brokerFailure("delete");
136
+ },
137
+ async has(ref) {
138
+ const safeRef = safeCredentialRef(ref);
139
+ const result = await lookup(safeRef);
140
+ if (isGenuineNoMatch(result)) return false;
141
+ if (result.exitCode !== 0) brokerFailure("has");
142
+ return true;
143
+ }
144
+ };
145
+ }
146
+
147
+ // packages/agent-runtime/macOsKeychainCredentialBroker.ts
148
+ import { spawn as spawn2 } from "node:child_process";
149
+ var MACOS_KEYCHAIN_SERVICE_PREFIX = "nolo.credentials.keys";
150
+ var MACOS_KEYCHAIN_ACCOUNT = "api-key";
151
+ var MACOS_KEYCHAIN_B64_PREFIX = "nolo-b64v1:";
152
+ var SECURITY_ITEM_NOT_FOUND_EXIT = 44;
153
+ var DEFAULT_SECURITY_BIN = "/usr/bin/security";
154
+ function safeCredentialRef2(ref) {
155
+ try {
156
+ return assertCredentialRef(ref);
157
+ } catch {
158
+ throw new Error("invalid_ref");
159
+ }
160
+ }
161
+ function credentialRefToMacOsKeychainService(ref, servicePrefix = MACOS_KEYCHAIN_SERVICE_PREFIX) {
162
+ const safe = safeCredentialRef2(ref);
163
+ const hex = Buffer.from(safe, "utf8").toString("hex");
164
+ if (!hex) {
165
+ throw new Error("invalid_ref");
166
+ }
167
+ return `${servicePrefix}.${hex}`;
168
+ }
169
+ function rethrowBrokerError(op, _error) {
170
+ throw new Error(`credential_broker_${op}_failed`);
171
+ }
172
+ function createDefaultSecurityRunner(securityBin = DEFAULT_SECURITY_BIN, timeoutMs = 15e3) {
173
+ return function defaultSecurityRunner(input) {
174
+ return new Promise((resolve) => {
175
+ let settled = false;
176
+ let timer;
177
+ const finish = (result) => {
178
+ if (settled) return;
179
+ settled = true;
180
+ clearTimeout(timer);
181
+ resolve(result);
182
+ };
183
+ let child;
184
+ try {
185
+ child = spawn2(securityBin, input.args, {
186
+ stdio: ["pipe", "pipe", "pipe"],
187
+ detached: process.platform !== "win32"
188
+ });
189
+ } catch {
190
+ finish({ exitCode: -1, stdout: "", stderr: "" });
191
+ return;
192
+ }
193
+ timer = setTimeout(() => {
194
+ try {
195
+ if (process.platform !== "win32" && child.pid !== void 0) {
196
+ try {
197
+ process.kill(-child.pid, "SIGKILL");
198
+ return;
199
+ } catch {
200
+ }
201
+ }
202
+ try {
203
+ child.kill("SIGKILL");
204
+ } catch {
205
+ }
206
+ } finally {
207
+ finish({ exitCode: -1, stdout: "", stderr: "" });
208
+ }
209
+ }, timeoutMs);
210
+ let stdout = "";
211
+ let stderr = "";
212
+ child.stdout?.setEncoding("utf8");
213
+ child.stderr?.setEncoding("utf8");
214
+ child.stdout?.on("data", (chunk) => {
215
+ stdout += chunk;
216
+ });
217
+ child.stderr?.on("data", (chunk) => {
218
+ stderr += chunk;
219
+ });
220
+ child.on("error", () => {
221
+ finish({ exitCode: -1, stdout: "", stderr: "" });
222
+ });
223
+ let stdinFailed = false;
224
+ child.stdin?.on("error", () => {
225
+ stdinFailed = true;
226
+ });
227
+ child.on("close", (code) => {
228
+ finish({
229
+ exitCode: !stdinFailed && typeof code === "number" ? code : -1,
230
+ stdout,
231
+ stderr
232
+ });
233
+ });
234
+ child.stdin?.end(input.stdin);
235
+ });
236
+ };
237
+ }
238
+ function createMacOsKeychainCredentialBroker(options = {}) {
239
+ const runner = options.runner ?? createDefaultSecurityRunner(options.securityBin);
240
+ const servicePrefix = options.servicePrefix ?? MACOS_KEYCHAIN_SERVICE_PREFIX;
241
+ const account = options.account ?? MACOS_KEYCHAIN_ACCOUNT;
242
+ const serviceFor = (ref) => credentialRefToMacOsKeychainService(ref, servicePrefix);
243
+ return {
244
+ async get(ref) {
245
+ const safeRef = safeCredentialRef2(ref);
246
+ const service = serviceFor(safeRef);
247
+ let result;
248
+ try {
249
+ result = await runner({
250
+ args: [
251
+ "find-generic-password",
252
+ "-a",
253
+ account,
254
+ "-s",
255
+ service,
256
+ "-w"
257
+ ]
258
+ });
259
+ } catch (error) {
260
+ rethrowBrokerError("get", error);
261
+ }
262
+ if (result.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
263
+ return null;
264
+ }
265
+ if (result.exitCode !== 0) {
266
+ rethrowBrokerError("get");
267
+ }
268
+ const secret = result.stdout.replace(/\r?\n$/, "");
269
+ if (!secret.startsWith(MACOS_KEYCHAIN_B64_PREFIX)) {
270
+ return secret.length > 0 ? secret : null;
271
+ }
272
+ const encoded = secret.slice(MACOS_KEYCHAIN_B64_PREFIX.length);
273
+ const bytes = Buffer.from(encoded, "base64");
274
+ const decoded = bytes.toString("utf8");
275
+ if (bytes.toString("base64") !== encoded || !Buffer.from(decoded, "utf8").equals(bytes)) {
276
+ rethrowBrokerError("get");
277
+ }
278
+ return decoded;
279
+ },
280
+ async put(ref, secret) {
281
+ const safeRef = safeCredentialRef2(ref);
282
+ const value = asTrimmedString(secret);
283
+ if (!value) {
284
+ throw new Error("Cannot store an empty credential secret.");
285
+ }
286
+ const service = serviceFor(safeRef);
287
+ const unsafeToken = /[^A-Za-z0-9._:@/-]/;
288
+ if (!account || account.startsWith("-") || service.startsWith("-") || unsafeToken.test(account) || unsafeToken.test(service)) {
289
+ rethrowBrokerError("put");
290
+ }
291
+ const encoded = `${MACOS_KEYCHAIN_B64_PREFIX}${Buffer.from(value, "utf8").toString("base64")}`;
292
+ const stdin = `add-generic-password -U -a ${account} -s ${service} -w ${encoded}
293
+ `;
294
+ let result;
295
+ try {
296
+ result = await runner({ args: ["-i"], stdin });
297
+ } catch (error) {
298
+ rethrowBrokerError("put", error);
299
+ }
300
+ if (result.exitCode !== 0 || /(?:^|\r?\n)security:/i.test(result.stderr)) {
301
+ rethrowBrokerError("put");
302
+ }
303
+ },
304
+ async delete(ref) {
305
+ const safeRef = safeCredentialRef2(ref);
306
+ const service = serviceFor(safeRef);
307
+ let result;
308
+ try {
309
+ result = await runner({
310
+ args: [
311
+ "delete-generic-password",
312
+ "-a",
313
+ account,
314
+ "-s",
315
+ service
316
+ ]
317
+ });
318
+ } catch (error) {
319
+ rethrowBrokerError("delete", error);
320
+ }
321
+ if (result.exitCode === 0 || result.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
322
+ return;
323
+ }
324
+ rethrowBrokerError("delete");
325
+ },
326
+ async has(ref) {
327
+ const safeRef = safeCredentialRef2(ref);
328
+ const service = serviceFor(safeRef);
329
+ let result;
330
+ try {
331
+ result = await runner({
332
+ args: [
333
+ "find-generic-password",
334
+ "-a",
335
+ account,
336
+ "-s",
337
+ service
338
+ ]
339
+ });
340
+ } catch (error) {
341
+ rethrowBrokerError("has", error);
342
+ }
343
+ if (result.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
344
+ return false;
345
+ }
346
+ if (result.exitCode !== 0) {
347
+ rethrowBrokerError("has");
348
+ }
349
+ return true;
350
+ }
351
+ };
352
+ }
353
+
354
+ // packages/agent-runtime/windowsCredentialManagerBroker.ts
355
+ import { spawn as spawn3 } from "node:child_process";
356
+ var WINDOWS_CREDENTIAL_TARGET_PREFIX = "nolo.credentials.keys";
357
+ var WIN_ERROR_NOT_FOUND = 1168;
358
+ var WINDOWS_CREDENTIAL_MANAGER_SCRIPT = `
359
+ $ErrorActionPreference = 'Stop'
360
+ try {
361
+ $raw = [Console]::In.ReadToEnd()
362
+ if ([string]::IsNullOrWhiteSpace($raw)) { exit 1 }
363
+ $req = $raw | ConvertFrom-Json
364
+ $op = [string]$req.op
365
+ $target = [string]$req.target
366
+ if ([string]::IsNullOrWhiteSpace($op) -or [string]::IsNullOrWhiteSpace($target)) { exit 1 }
367
+
368
+ Add-Type @"
369
+ using System;
370
+ using System.Runtime.InteropServices;
371
+ using System.Text;
372
+
373
+ public class NoloCredNative {
374
+ public const int CRED_TYPE_GENERIC = 1;
375
+ public const int CRED_PERSIST_LOCAL_MACHINE = 2;
376
+ public const int ERROR_NOT_FOUND = 1168;
377
+
378
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
379
+ public struct CREDENTIAL {
380
+ public int Flags;
381
+ public int Type;
382
+ public string TargetName;
383
+ public string Comment;
384
+ public long LastWritten;
385
+ public int CredentialBlobSize;
386
+ public IntPtr CredentialBlob;
387
+ public int Persist;
388
+ public int AttributeCount;
389
+ public IntPtr Attributes;
390
+ public string TargetAlias;
391
+ public string UserName;
392
+ }
393
+
394
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
395
+ public static extern bool CredWriteW(ref CREDENTIAL userCredential, uint flags);
396
+
397
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
398
+ public static extern bool CredReadW(string target, int type, int reservedFlag, out IntPtr credentialPtr);
399
+
400
+ [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
401
+ public static extern bool CredDeleteW(string target, int type, int flags);
402
+
403
+ [DllImport("advapi32.dll", SetLastError = true)]
404
+ public static extern void CredFree(IntPtr buffer);
405
+ }
406
+ "@
407
+
408
+ if ($op -eq 'get') {
409
+ $ptr = [IntPtr]::Zero
410
+ $ok = [NoloCredNative]::CredReadW($target, [NoloCredNative]::CRED_TYPE_GENERIC, 0, [ref]$ptr)
411
+ if (-not $ok) {
412
+ exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
413
+ }
414
+ try {
415
+ $cred = [Runtime.InteropServices.Marshal]::PtrToStructure($ptr, [type][NoloCredNative+CREDENTIAL])
416
+ if ($cred.CredentialBlobSize -le 0 -or $cred.CredentialBlob -eq [IntPtr]::Zero) {
417
+ $payload = @{ secret = '' } | ConvertTo-Json -Compress
418
+ [Console]::Out.Write($payload)
419
+ exit 0
420
+ }
421
+ $bytes = New-Object byte[] $cred.CredentialBlobSize
422
+ [Runtime.InteropServices.Marshal]::Copy($cred.CredentialBlob, $bytes, 0, $cred.CredentialBlobSize)
423
+ $secret = [Text.Encoding]::UTF8.GetString($bytes)
424
+ $payload = @{ secret = $secret } | ConvertTo-Json -Compress
425
+ [Console]::Out.Write($payload)
426
+ exit 0
427
+ } finally {
428
+ [NoloCredNative]::CredFree($ptr)
429
+ }
430
+ }
431
+
432
+ if ($op -eq 'has') {
433
+ $ptr = [IntPtr]::Zero
434
+ $ok = [NoloCredNative]::CredReadW($target, [NoloCredNative]::CRED_TYPE_GENERIC, 0, [ref]$ptr)
435
+ if (-not $ok) {
436
+ exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
437
+ }
438
+ [NoloCredNative]::CredFree($ptr)
439
+ exit 0
440
+ }
441
+
442
+ if ($op -eq 'put') {
443
+ $secret = [string]$req.secret
444
+ if ([string]::IsNullOrEmpty($secret)) { exit 1 }
445
+ $blob = [Text.Encoding]::UTF8.GetBytes($secret)
446
+ $cred = New-Object NoloCredNative+CREDENTIAL
447
+ $cred.Type = [NoloCredNative]::CRED_TYPE_GENERIC
448
+ $cred.TargetName = $target
449
+ $cred.UserName = 'api-key'
450
+ $cred.Persist = [NoloCredNative]::CRED_PERSIST_LOCAL_MACHINE
451
+ $cred.CredentialBlobSize = $blob.Length
452
+ $cred.CredentialBlob = [Runtime.InteropServices.Marshal]::AllocHGlobal($blob.Length)
453
+ try {
454
+ if ($blob.Length -gt 0) {
455
+ [Runtime.InteropServices.Marshal]::Copy($blob, 0, $cred.CredentialBlob, $blob.Length)
456
+ }
457
+ $ok = [NoloCredNative]::CredWriteW([ref]$cred, 0)
458
+ if (-not $ok) {
459
+ exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
460
+ }
461
+ exit 0
462
+ } finally {
463
+ [Runtime.InteropServices.Marshal]::FreeHGlobal($cred.CredentialBlob)
464
+ }
465
+ }
466
+
467
+ if ($op -eq 'delete') {
468
+ $ok = [NoloCredNative]::CredDeleteW($target, [NoloCredNative]::CRED_TYPE_GENERIC, 0)
469
+ if (-not $ok) {
470
+ exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
471
+ }
472
+ exit 0
473
+ }
474
+
475
+ exit 1
476
+ } catch {
477
+ exit 1
478
+ }
479
+ `.trim();
480
+ function safeCredentialRef3(ref) {
481
+ try {
482
+ return assertCredentialRef(ref);
483
+ } catch {
484
+ throw new Error("invalid_ref");
485
+ }
486
+ }
487
+ function credentialRefToWindowsCredentialTarget(ref, targetPrefix = WINDOWS_CREDENTIAL_TARGET_PREFIX) {
488
+ const safe = safeCredentialRef3(ref);
489
+ const hex = Buffer.from(safe, "utf8").toString("hex");
490
+ if (!hex) {
491
+ throw new Error("invalid_ref");
492
+ }
493
+ return `${targetPrefix}.${hex}`;
494
+ }
495
+ function rethrowBrokerError2(op, _error) {
496
+ throw new Error(`credential_broker_${op}_failed`);
497
+ }
498
+ function buildWindowsCredentialPowerShellArgs(script = WINDOWS_CREDENTIAL_MANAGER_SCRIPT) {
499
+ const encoded = Buffer.from(script, "utf16le").toString("base64");
500
+ return [
501
+ "-NoProfile",
502
+ "-NonInteractive",
503
+ "-ExecutionPolicy",
504
+ "Bypass",
505
+ "-EncodedCommand",
506
+ encoded
507
+ ];
508
+ }
509
+ function requestStdin(payload) {
510
+ return JSON.stringify(payload);
511
+ }
512
+ function parseGetSecretFromStdout(stdout) {
513
+ const trimmed = asTrimmedString(stdout);
514
+ if (!trimmed) {
515
+ rethrowBrokerError2("get");
516
+ }
517
+ let parsed;
518
+ try {
519
+ parsed = JSON.parse(trimmed);
520
+ } catch {
521
+ rethrowBrokerError2("get");
522
+ }
523
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed) || typeof parsed.secret !== "string") {
524
+ rethrowBrokerError2("get");
525
+ }
526
+ return parsed.secret;
527
+ }
528
+ var SHELL_TIMEOUT = Symbol("shell timeout");
529
+ function spawnShell(bin, args, stdin, timeoutMs) {
530
+ return new Promise((resolve) => {
531
+ let settled = false;
532
+ let timer;
533
+ const finish = (result) => {
534
+ if (settled) return;
535
+ settled = true;
536
+ clearTimeout(timer);
537
+ resolve(result);
538
+ };
539
+ let child;
540
+ try {
541
+ child = spawn3(bin, args, {
542
+ stdio: ["pipe", "pipe", "pipe"],
543
+ windowsHide: true
544
+ });
545
+ } catch {
546
+ finish({ exitCode: -1, stdout: "", stderr: "" });
547
+ return;
548
+ }
549
+ timer = setTimeout(() => {
550
+ try {
551
+ child.kill("SIGKILL");
552
+ } catch {
553
+ } finally {
554
+ finish(SHELL_TIMEOUT);
555
+ }
556
+ }, timeoutMs);
557
+ let stdout = "";
558
+ let stderr = "";
559
+ child.stdout?.setEncoding("utf8");
560
+ child.stderr?.setEncoding("utf8");
561
+ child.stdout?.on("data", (chunk) => {
562
+ stdout += chunk;
563
+ });
564
+ child.stderr?.on("data", (chunk) => {
565
+ stderr += chunk;
566
+ });
567
+ child.on("error", () => {
568
+ finish({ exitCode: -1, stdout: "", stderr: "" });
569
+ });
570
+ child.on("close", (code) => {
571
+ finish({
572
+ exitCode: typeof code === "number" ? code : -1,
573
+ stdout,
574
+ stderr
575
+ });
576
+ });
577
+ child.stdin?.on("error", () => {
578
+ });
579
+ child.stdin?.end(stdin);
580
+ });
581
+ }
582
+ function createDefaultWindowsCredentialRunner(shellBin, timeoutMs = 15e3) {
583
+ let resolvedBin = shellBin ?? null;
584
+ return async function defaultWindowsCredentialRunner(input) {
585
+ const bins = resolvedBin ? [resolvedBin] : ["powershell.exe", "pwsh"];
586
+ let result = { exitCode: -1, stdout: "", stderr: "" };
587
+ for (const bin of bins) {
588
+ const attempt = await spawnShell(bin, input.args, input.stdin, timeoutMs);
589
+ if (attempt === SHELL_TIMEOUT) {
590
+ return { exitCode: -1, stdout: "", stderr: "" };
591
+ }
592
+ result = attempt;
593
+ if (result.exitCode !== -1) {
594
+ resolvedBin = bin;
595
+ break;
596
+ }
597
+ }
598
+ return result;
599
+ };
600
+ }
601
+ function createWindowsCredentialManagerBroker(options = {}) {
602
+ const runner = options.runner ?? createDefaultWindowsCredentialRunner(options.shellBin);
603
+ const targetPrefix = options.targetPrefix ?? WINDOWS_CREDENTIAL_TARGET_PREFIX;
604
+ const targetFor = (ref) => credentialRefToWindowsCredentialTarget(ref, targetPrefix);
605
+ const staticArgs = buildWindowsCredentialPowerShellArgs();
606
+ return {
607
+ async get(ref) {
608
+ const safeRef = safeCredentialRef3(ref);
609
+ const target = targetFor(safeRef);
610
+ let result;
611
+ try {
612
+ result = await runner({
613
+ args: staticArgs,
614
+ stdin: requestStdin({ op: "get", target })
615
+ });
616
+ } catch (error) {
617
+ rethrowBrokerError2("get", error);
618
+ }
619
+ if (result.exitCode === WIN_ERROR_NOT_FOUND) {
620
+ return null;
621
+ }
622
+ if (result.exitCode !== 0) {
623
+ rethrowBrokerError2("get");
624
+ }
625
+ const secret = parseGetSecretFromStdout(result.stdout);
626
+ return secret.length > 0 ? secret : null;
627
+ },
628
+ async put(ref, secret) {
629
+ const safeRef = safeCredentialRef3(ref);
630
+ const value = asTrimmedString(secret);
631
+ if (!value) {
632
+ throw new Error("Cannot store an empty credential secret.");
633
+ }
634
+ const target = targetFor(safeRef);
635
+ let result;
636
+ try {
637
+ result = await runner({
638
+ args: staticArgs,
639
+ stdin: requestStdin({ op: "put", target, secret: value })
640
+ });
641
+ } catch (error) {
642
+ rethrowBrokerError2("put", error);
643
+ }
644
+ if (result.exitCode !== 0) {
645
+ rethrowBrokerError2("put");
646
+ }
647
+ },
648
+ async delete(ref) {
649
+ const safeRef = safeCredentialRef3(ref);
650
+ const target = targetFor(safeRef);
651
+ let result;
652
+ try {
653
+ result = await runner({
654
+ args: staticArgs,
655
+ stdin: requestStdin({ op: "delete", target })
656
+ });
657
+ } catch (error) {
658
+ rethrowBrokerError2("delete", error);
659
+ }
660
+ if (result.exitCode === 0 || result.exitCode === WIN_ERROR_NOT_FOUND) {
661
+ return;
662
+ }
663
+ rethrowBrokerError2("delete");
664
+ },
665
+ async has(ref) {
666
+ const safeRef = safeCredentialRef3(ref);
667
+ const target = targetFor(safeRef);
668
+ let result;
669
+ try {
670
+ result = await runner({
671
+ args: staticArgs,
672
+ stdin: requestStdin({ op: "has", target })
673
+ });
674
+ } catch (error) {
675
+ rethrowBrokerError2("has", error);
676
+ }
677
+ if (result.exitCode === WIN_ERROR_NOT_FOUND) {
678
+ return false;
679
+ }
680
+ if (result.exitCode !== 0) {
681
+ rethrowBrokerError2("has");
682
+ }
683
+ return true;
684
+ }
685
+ };
686
+ }
687
+
688
+ // packages/agent-runtime/desktopHostCredentialBroker.ts
689
+ function createClosedCredentialBroker(code = "credential_store_unavailable") {
690
+ const fail = () => {
691
+ throw new Error(code);
692
+ };
693
+ return {
694
+ get: fail,
695
+ put: fail,
696
+ delete: fail,
697
+ has: () => false
698
+ };
699
+ }
700
+ function createHostCredentialBrokerChain(args) {
701
+ const { strict, session, legacy, notifySessionFallback, notifyLegacyHit } = args;
702
+ const legacyNoticed = /* @__PURE__ */ new Set();
703
+ let sessionNotified = false;
704
+ const noticeSession = () => {
705
+ if (sessionNotified || !notifySessionFallback) return;
706
+ sessionNotified = true;
707
+ try {
708
+ notifySessionFallback();
709
+ } catch {
710
+ }
711
+ };
712
+ return {
713
+ async get(ref) {
714
+ try {
715
+ const strictValue = await strict.get(ref);
716
+ if (strictValue !== null && strictValue !== void 0) return strictValue;
717
+ } catch {
718
+ }
719
+ const sessionValue = await session.get(ref);
720
+ if (sessionValue !== null && sessionValue !== void 0) return sessionValue;
721
+ if (!legacy) return null;
722
+ const legacyValue = await legacy.get(ref);
723
+ if (legacyValue !== null && legacyValue !== void 0) {
724
+ if (notifyLegacyHit && !legacyNoticed.has(ref)) {
725
+ legacyNoticed.add(ref);
726
+ try {
727
+ notifyLegacyHit(ref);
728
+ } catch {
729
+ }
730
+ }
731
+ return legacyValue;
732
+ }
733
+ return null;
734
+ },
735
+ async put(ref, secret) {
736
+ try {
737
+ await strict.put(ref, secret);
738
+ if (await strict.has(ref)) return;
739
+ } catch {
740
+ }
741
+ await session.put(ref, secret);
742
+ noticeSession();
743
+ },
744
+ async delete(ref) {
745
+ try {
746
+ await strict.delete(ref);
747
+ } catch {
748
+ }
749
+ try {
750
+ await session.delete(ref);
751
+ } catch {
752
+ }
753
+ if (legacy) await legacy.delete(ref);
754
+ },
755
+ async has(ref) {
756
+ try {
757
+ if (await strict.has(ref)) return true;
758
+ } catch {
759
+ }
760
+ if (await session.has(ref)) return true;
761
+ return legacy ? await legacy.has(ref) : false;
762
+ }
763
+ };
764
+ }
765
+ function createStrictHostCredentialBroker(options = {}) {
766
+ const platform = options.platform ?? process.platform;
767
+ const env = options.env ?? process.env;
768
+ const override = String(env.NOLO_DESKTOP_CREDENTIAL_STORE ?? "").trim().toLowerCase();
769
+ if (override === "file") {
770
+ return createClosedCredentialBroker("credential_store_file_not_allowed");
771
+ }
772
+ if (platform === "darwin" || override === "keychain") return createSystemStoreBroker("keychain", options);
773
+ if (platform === "win32" || override === "credman") return createSystemStoreBroker("credman", options);
774
+ if (platform === "linux" || override === "secret-service") return createSystemStoreBroker("secret-service", options);
775
+ return createClosedCredentialBroker("credential_store_unsupported");
776
+ }
777
+ function createSystemStoreBroker(mode, options) {
778
+ switch (mode) {
779
+ case "keychain":
780
+ return options.keychainBroker ?? options.createKeychainBroker?.() ?? createMacOsKeychainCredentialBroker();
781
+ case "credman":
782
+ return options.windowsCredentialBroker ?? options.createWindowsCredentialBroker?.() ?? createWindowsCredentialManagerBroker();
783
+ case "secret-service":
784
+ return options.linuxSecretServiceBroker ?? options.createLinuxSecretServiceBroker?.() ?? createLinuxSecretServiceCredentialBroker();
785
+ }
786
+ }
787
+
788
+ export {
789
+ createHostCredentialBrokerChain,
790
+ createStrictHostCredentialBroker
791
+ };