nolo-cli 0.149.0-alpha.1 → 0.151.0-alpha.3

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-OW3H7ICR.js → _executeModel-T7ANHTUW.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-4L5KCKFY.js} +181 -93
  7. package/{agentEmailCommands-A6XBQZBN.js → agentEmailCommands-2IMMIRO2.js} +132 -112
  8. package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
  9. package/agentListCommands-TWFLUYIZ.js +802 -0
  10. package/{agentMachineCommands-DQPUIMAC.js → agentMachineCommands-KIWXWT6L.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-727NPCRW.js +154 -0
  14. package/agentRunCommand-JASIG3FZ.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-O4RUQUMT.js → agentSlice-SLV57QGU.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-ID7LNBWR.js → chunk-3T4ZG6AC.js} +1920 -644
  35. package/{chunk-GNMAFAIS.js → chunk-44WXLHFI.js} +1 -1
  36. package/{chunk-AGGIDPCZ.js → chunk-4JH2UMJR.js} +6 -0
  37. package/chunk-4LCOCOR5.js +50 -0
  38. package/chunk-4YRTZIVN.js +871 -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-TXH4IWJL.js → chunk-626KHJNX.js} +20 -11
  46. package/{chunk-M5PVFLD4.js → chunk-64K7WX26.js} +90 -21
  47. package/{chunk-AKG5W4LG.js → chunk-6CCFTVBP.js} +76 -221
  48. package/chunk-6MJNEXUU.js +614 -0
  49. package/{chunk-62IL3KQV.js → chunk-6MXDOUMH.js} +15 -3
  50. package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
  51. package/chunk-6QDYSCPW.js +223 -0
  52. package/{chunk-HYZIYH2H.js → chunk-74RAWNQN.js} +56 -63
  53. package/chunk-7DPNBQSV.js +9 -0
  54. package/{chunk-IAESIMK7.js → chunk-A4MW3YZL.js} +10 -14
  55. package/{chunk-OMRJYNCI.js → chunk-AG7MCDLR.js} +26 -31
  56. package/chunk-AGIM7IMJ.js +147 -0
  57. package/{chunk-7CHC4W22.js → chunk-AIZE5TDM.js} +3 -3
  58. package/chunk-AJ3G7X2K.js +7012 -0
  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-YAQJJDC2.js → chunk-BJEZC5RA.js} +214 -51
  63. package/{chunk-RYZINGPM.js → chunk-BPMPOFWP.js} +347 -235
  64. package/{chunk-YUNJN43V.js → chunk-BU2YQBV4.js} +215 -28
  65. package/{chunk-XPRWFQQK.js → chunk-CBHGZRCE.js} +38 -12
  66. package/{chunk-Y3PMXGLH.js → chunk-CHCS6XPJ.js} +365 -144
  67. package/chunk-CHOZJMJS.js +78 -0
  68. package/chunk-CYJWI3NH.js +119 -0
  69. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  70. package/{chunk-3SV7RM24.js → chunk-D2QN6CTI.js} +117 -72
  71. package/{chunk-TZZ2WRBL.js → chunk-DFDXM2Y4.js} +20 -16
  72. package/{chunk-5TEEECZM.js → chunk-E2AKSW7L.js} +10 -7
  73. package/{chunk-RSEEDUMS.js → chunk-EDX5XSJM.js} +2 -2
  74. package/{chunk-QDSINZM3.js → chunk-EUGTFFO6.js} +2 -23
  75. package/{chunk-UNYJU5L6.js → chunk-EYLGAEB4.js} +5 -1
  76. package/{chunk-CU3QB4HW.js → chunk-EYWJT7A2.js} +12 -12
  77. package/{chunk-BNGW5ASC.js → chunk-EZVK3N5L.js} +66 -18
  78. package/{chunk-6FGTMQCL.js → chunk-F32Z66T4.js} +6 -10
  79. package/{chunk-ZOVKKMF6.js → chunk-FY4SDK2E.js} +1 -1
  80. package/chunk-G6OOUQWJ.js +417 -0
  81. package/{chunk-PQWU42UQ.js → chunk-GCKHQECX.js} +6 -6
  82. package/chunk-GKXCHNTE.js +15 -0
  83. package/{chunk-P6GMCCAT.js → chunk-GQV5KHJU.js} +78 -12
  84. package/{chunk-B2XUQXQX.js → chunk-HIQ4GF53.js} +191 -68
  85. package/{chunk-GMZLP5DV.js → chunk-HNUWUO75.js} +30 -19
  86. package/{chunk-UASIEDKM.js → chunk-I2XLRXVX.js} +36 -31
  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-BIDGLJQ3.js → chunk-IK2TSJQA.js} +45 -8
  93. package/{chunk-CPUFH46E.js → chunk-ILU2NPWY.js} +10 -10
  94. package/{chunk-SLLGJZDT.js → chunk-ISQL4V7C.js} +4 -4
  95. package/chunk-IT3ZZRJE.js +12 -0
  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-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  103. package/{chunk-5J3PYNUP.js → chunk-NYYFIKHI.js} +17 -3
  104. package/{chunk-6O4IK4V2.js → chunk-OFFL4DCR.js} +1 -1
  105. package/{chunk-B6SAMB33.js → chunk-OWYYDMGJ.js} +209 -9
  106. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  107. package/{chunk-CTUQJVQM.js → chunk-P5QACQDK.js} +1 -1
  108. package/{chunk-TB3MIBRC.js → chunk-PIDUNDFS.js} +572 -430
  109. package/{chunk-4JMDLJAD.js → chunk-PJNFNEJE.js} +114 -37
  110. package/chunk-PKZKOVA5.js +11507 -0
  111. package/{chunk-Z4CSIXYP.js → chunk-PLSVXHSA.js} +3 -3
  112. package/chunk-PWTNI4N7.js +47 -0
  113. package/chunk-QFEW2ULV.js +42 -0
  114. package/{chunk-RGNEEJ3Y.js → chunk-QLQ573SU.js} +35 -9
  115. package/chunk-QQ56R7KS.js +88 -0
  116. package/chunk-QYPE3TS3.js +43 -0
  117. package/{chunk-HTVYCXBP.js → chunk-RN2GPWN6.js} +354 -120
  118. package/{chunk-ATLTFRYJ.js → chunk-ROCUB2H2.js} +280 -98
  119. package/{chunk-4DPP773Q.js → chunk-RSHPU4PD.js} +59 -11
  120. package/chunk-RVWMAFIT.js +134 -0
  121. package/{chunk-ESHYE7WU.js → chunk-S73EPYNC.js} +10 -7
  122. package/{chunk-UQNS32WZ.js → chunk-SCMHQUMK.js} +1 -1
  123. package/chunk-SW4S4XYB.js +1794 -0
  124. package/{chunk-ZUEK6A6C.js → chunk-TTH4HOJD.js} +1973 -754
  125. package/chunk-TY3TIUJK.js +89 -0
  126. package/{chunk-X2QRZXZH.js → chunk-TYJ5XFEA.js} +4 -4
  127. package/{chunk-ALFH24P3.js → chunk-TYYRSFBG.js} +197 -155
  128. package/{chunk-MST6R3E4.js → chunk-U5GPBQDG.js} +34 -22
  129. package/chunk-U5ICMAFV.js +14110 -0
  130. package/{chunk-7KVZ5LDQ.js → chunk-UBUH2TCC.js} +18 -4
  131. package/chunk-UEILX4EV.js +15 -0
  132. package/chunk-UHTDNB5Y.js +140 -0
  133. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  134. package/{chunk-OHOVNO7I.js → chunk-UOKFKFPO.js} +6 -3
  135. package/{chunk-XISEYOGH.js → chunk-USHQX6VT.js} +5 -5
  136. package/chunk-UUPR3TD7.js +53 -0
  137. package/{chunk-3DAVPNFT.js → chunk-V4EE3D54.js} +122 -107
  138. package/{chunk-HDLLCBRF.js → chunk-VEA7H5FG.js} +2 -2
  139. package/chunk-VHGD6FHV.js +116 -0
  140. package/chunk-VIWDGTDA.js +8 -0
  141. package/{chunk-GOH6RW6F.js → chunk-VJXHL6MH.js} +34 -11
  142. package/{chunk-4XEYAFLY.js → chunk-VL5KOY2C.js} +623 -94
  143. package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
  144. package/{chunk-DXHL7G2L.js → chunk-VWW6O2TL.js} +274 -93
  145. package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
  146. package/chunk-WD4XYDYC.js +567 -0
  147. package/chunk-WJZOQR2J.js +151 -0
  148. package/{chunk-AUDNYVRC.js → chunk-XETG4RIX.js} +5 -5
  149. package/{chunk-MX574M24.js → chunk-XI7DGLUK.js} +4 -4
  150. package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
  151. package/chunk-XRUSXPCQ.js +514 -0
  152. package/{chunk-I4OPU5TK.js → chunk-XS47QOFV.js} +273 -11
  153. package/{chunk-S5XGT6GB.js → chunk-XZNCX52W.js} +30 -9
  154. package/{chunk-5OA5HMTL.js → chunk-YLMMECCH.js} +1 -1
  155. package/{chunk-CFT5HBGW.js → chunk-YVLQXTUB.js} +448 -12
  156. package/chunk-YVPQATSC.js +709 -0
  157. package/chunk-ZEZC7IIM.js +126 -0
  158. package/{chunk-ALGORS6Y.js → chunk-ZF6526IQ.js} +43 -8
  159. package/chunk-ZIWPQEFU.js +165 -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-2KBOXZQC.js → commandRegistry-NBLZEMCW.js} +183 -107
  164. package/contentThunks-6AIWNSGO.js +84 -0
  165. package/{cooldownCommands-ZLEPIB4A.js → cooldownCommands-JFKTYS2D.js} +2 -2
  166. package/{createAgentAutomationAction-5UGTB26P.js → createAgentAutomationAction-4BUS65DZ.js} +53 -44
  167. package/createDialogAction-QAIKSCG4.js +76 -0
  168. package/{createPageAction-CDLDKPRM.js → createPageAction-DXCZ334C.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-N3YB65G5.js → dialogSlice-PVUSMKFW.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-E3CEOV5Q.js → docStore-CSEBEMKP.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-DQAD5ERJ.js → handleSendMessageAction-G2TLYGC4.js} +422 -118
  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-B4TAYYA7.js +244 -0
  187. package/localRuntimeAuthority-JDAD7CB6.js +16 -0
  188. package/{localRuntimeDb-3LRMNLCM.js → localRuntimeDb-CVC62PM5.js} +1 -1
  189. package/{machineCommands-HAP75VSG.js → machineCommands-6OBFD3XF.js} +503 -161
  190. package/{machineInfo-66ZFUMLE.js → machineInfo-UKPTZO5Y.js} +2 -2
  191. package/machineWsRunDispatch-OO7N3O3Y.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-7BC66QSX.js → readlineWorkspace-UIQN7JUR.js} +5017 -915
  200. package/{removeDialogAgentAction-OSYNZRX7.js → removeDialogAgentAction-E2H3OZU6.js} +29 -28
  201. package/{runAgentClientLoop-6E6UC3CE.js → runAgentClientLoop-GS3SGG37.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-3UXPYFNX.js → streamAgentChatTurn-4XYC33KE.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-P77EE7Q4.js +124 -0
  215. package/tuiSummaryLlmCaller-BM3VSTBU.js +130 -0
  216. package/{updateCommands-4EHDLF5J.js → updateCommands-NQXAGFM7.js} +3 -3
  217. package/{updateDialogTitleAction-UPFV7TDT.js → updateDialogTitleAction-CIANVPZC.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-VCA76W6B.js +0 -134
  222. package/agentRunCommand-YNLDKVR7.js +0 -161
  223. package/browser-image-compression-MFDTD7K6.js +0 -1763
  224. package/chatQueueReduxAdapter-TJRMXMYA.js +0 -186
  225. package/chromeOpsCommands-IXRLN57H.js +0 -289
  226. package/chunk-36KZDDO5.js +0 -2415
  227. package/chunk-ACQD6YI2.js +0 -25363
  228. package/chunk-CQ3WA2NE.js +0 -299
  229. package/chunk-CYSYR67N.js +0 -93
  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-PZZTFEKK.js +0 -34
  239. package/chunk-URMS4XY2.js +0 -10
  240. package/chunk-UV6VISQJ.js +0 -20
  241. package/chunk-VJVNU77E.js +0 -83
  242. package/chunk-XYJSY4KG.js +0 -13807
  243. package/chunk-Y5GCAMGP.js +0 -9
  244. package/chunk-YPREESF4.js +0 -225
  245. package/contentThunks-BDIQRZR6.js +0 -73
  246. package/createDialogAction-B7VGVEVU.js +0 -66
  247. package/dialogCommands-G7YBVAMC.js +0 -102
  248. package/levelLazyShim-GZBKODGI.js +0 -7
  249. package/machineWsRunDispatch-L32G7C4P.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-MKYDMWA4.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
@@ -7,130 +7,180 @@ import {
7
7
  mergeAgentToolsWithRuntime,
8
8
  projectDesktopToolUiContent,
9
9
  resolveTurnToolContext
10
- } from "./chunk-TB3MIBRC.js";
11
- import "./chunk-O2OWEFII.js";
10
+ } from "./chunk-PIDUNDFS.js";
11
+ import "./chunk-KFHQQ3NO.js";
12
12
  import {
13
13
  CONTEXT_OVERFLOW_ACTIONS,
14
14
  CONTEXT_TOO_LARGE_ACTIONS,
15
- isContextOverflowText
16
- } from "./chunk-OCZKATRC.js";
17
- import {
15
+ extractErrorDiagnostics,
16
+ isContextOverflowText,
18
17
  performServerProxyFetchWithRetry
19
- } from "./chunk-HTVYCXBP.js";
18
+ } from "./chunk-RN2GPWN6.js";
20
19
  import {
21
20
  createSSEParser,
22
21
  resolveAgentRequiredPackIds,
23
22
  waitForAbortableDelay
24
- } from "./chunk-ATLTFRYJ.js";
23
+ } from "./chunk-ROCUB2H2.js";
25
24
  import "./chunk-NF64D32W.js";
26
- import "./chunk-3L2WKC3W.js";
27
- import "./chunk-TXH4IWJL.js";
28
- import "./chunk-XPRWFQQK.js";
29
- import "./chunk-UQNS32WZ.js";
30
- import "./chunk-MEYIRKDN.js";
31
- import "./chunk-36KZDDO5.js";
32
- import "./chunk-ZJ7UHBJS.js";
25
+ import "./chunk-XPWGOTBQ.js";
26
+ import "./chunk-ZIWPQEFU.js";
27
+ import "./chunk-CBHGZRCE.js";
28
+ import "./chunk-SCMHQUMK.js";
29
+ import "./chunk-RSHPU4PD.js";
30
+ import "./chunk-VIDPVFP3.js";
31
+ import "./chunk-AGIM7IMJ.js";
32
+ import "./chunk-626KHJNX.js";
33
+ import "./chunk-AJ3G7X2K.js";
33
34
  import {
35
+ clearForegroundTurnSettledVisible,
34
36
  initMsgs,
37
+ markForegroundTurnSettledVisible,
35
38
  messageStreamEnd,
36
39
  messageStreaming,
37
40
  prepareAndPersistUserMessage,
41
+ protectTransientForCanonicalHandoff,
42
+ releaseTransientCanonicalHandoff,
38
43
  removeTransientMessage,
39
44
  resolveHandleSendMessageContext,
40
45
  selectAllMsgs,
41
46
  setMessages,
42
47
  setStreamingMessageId,
48
+ toolResultNeedsUserConfirmation,
43
49
  updateToolMessage
44
- } from "./chunk-ACQD6YI2.js";
50
+ } from "./chunk-U5ICMAFV.js";
45
51
  import "./chunk-523DITKR.js";
46
- import "./chunk-YYLHWIW6.js";
47
- import "./chunk-6O4IK4V2.js";
52
+ import "./chunk-UKZX3NHN.js";
53
+ import "./chunk-OFFL4DCR.js";
54
+ import "./chunk-QYPE3TS3.js";
48
55
  import {
49
56
  streamAgentChatTurn
50
- } from "./chunk-TZZ2WRBL.js";
51
- import "./chunk-Z4CSIXYP.js";
57
+ } from "./chunk-DFDXM2Y4.js";
58
+ import "./chunk-4JH2UMJR.js";
59
+ import "./chunk-ZJ7UHBJS.js";
60
+ import "./chunk-BYXBJQAS.js";
61
+ import "./chunk-PLSVXHSA.js";
52
62
  import "./chunk-5RGU3J7P.js";
53
- import "./chunk-M76ECQRD.js";
54
63
  import {
55
64
  addActiveController,
56
65
  getActiveDialogKey,
57
66
  removeActiveController
58
- } from "./chunk-B6SAMB33.js";
67
+ } from "./chunk-OWYYDMGJ.js";
68
+ import "./chunk-ZRAU6T47.js";
69
+ import "./chunk-4LCOCOR5.js";
59
70
  import "./chunk-YDH3FDFQ.js";
60
- import "./chunk-MX574M24.js";
61
- import "./chunk-4DPP773Q.js";
62
- import "./chunk-VIDPVFP3.js";
63
- import "./chunk-AGGIDPCZ.js";
64
- import "./chunk-B2XUQXQX.js";
65
- import {
66
- expandEnabledPacks
67
- } from "./chunk-6TPOEJMQ.js";
68
- import "./chunk-AUDNYVRC.js";
69
- import "./chunk-KHCLMKZZ.js";
70
- import "./chunk-PQWU42UQ.js";
71
- import "./chunk-AKG5W4LG.js";
72
- import "./chunk-RYZINGPM.js";
73
- import "./chunk-PSCNXBYA.js";
74
- import "./chunk-L36OWPP3.js";
75
- import "./chunk-BYXBJQAS.js";
76
- import "./chunk-DWLEOOGR.js";
77
- import "./chunk-7KVZ5LDQ.js";
78
- import "./chunk-HNMXYYJR.js";
79
- import "./chunk-3BXNTXYI.js";
80
- import "./chunk-W7XHHYWM.js";
81
- import "./chunk-RSEEDUMS.js";
82
- import "./chunk-UAD2WT54.js";
83
- import "./chunk-ZWQUWF6W.js";
84
- import "./chunk-HDLLCBRF.js";
85
- import "./chunk-4VJAC32I.js";
86
- import {
87
- canonicalizeToolName
88
- } from "./chunk-XUWRURDF.js";
89
- import "./chunk-5J3PYNUP.js";
90
- import "./chunk-CYSYR67N.js";
91
- import {
92
- PLATFORM_LLM_BUSY_USER_MESSAGE
93
- } from "./chunk-Y3PMXGLH.js";
94
71
  import {
95
72
  selectCurrentServer
96
- } from "./chunk-SONWNI3L.js";
97
- import "./chunk-Y5GCAMGP.js";
98
- import "./chunk-QDSINZM3.js";
99
- import "./chunk-KX6YBIHG.js";
73
+ } from "./chunk-QFEW2ULV.js";
74
+ import "./chunk-XI7DGLUK.js";
75
+ import "./chunk-EDX5XSJM.js";
76
+ import "./chunk-UAD2WT54.js";
100
77
  import {
101
78
  readAndWait,
102
79
  selectById
103
- } from "./chunk-HYZIYH2H.js";
104
- import "./chunk-7CHC4W22.js";
105
- import {
106
- createDialogMessageKeyAndId
107
- } from "./chunk-3AH7LNUB.js";
108
- import "./chunk-WWC7I6TA.js";
109
- import "./chunk-QSJ3HFEF.js";
110
- import "./chunk-IAESIMK7.js";
111
- import "./chunk-WIWM4FE3.js";
80
+ } from "./chunk-74RAWNQN.js";
81
+ import "./chunk-3PVYUPXK.js";
82
+ import "./chunk-A4MW3YZL.js";
83
+ import "./chunk-AIZE5TDM.js";
84
+ import "./chunk-4YRTZIVN.js";
85
+ import "./chunk-UEILX4EV.js";
86
+ import "./chunk-IJERIUXS.js";
112
87
  import {
113
88
  getIsDesktopApp
114
- } from "./chunk-QOKAKDPE.js";
89
+ } from "./chunk-6Q7UTJKR.js";
90
+ import "./chunk-QQ56R7KS.js";
91
+ import "./chunk-OW765XBU.js";
115
92
  import {
116
93
  selectIdentityToken,
117
94
  selectIdentityUserId
118
95
  } from "./chunk-SEJ5OS6F.js";
119
- import "./chunk-OW765XBU.js";
120
- import "./chunk-GBRG75BQ.js";
121
- import "./chunk-KUG52IAP.js";
122
- import "./chunk-BNGW5ASC.js";
96
+ import "./chunk-D2MDMY2M.js";
97
+ import "./chunk-HIQ4GF53.js";
98
+ import {
99
+ expandEnabledPacks
100
+ } from "./chunk-JZX2XLKC.js";
101
+ import "./chunk-EUGTFFO6.js";
102
+ import "./chunk-XETG4RIX.js";
103
+ import "./chunk-GKXCHNTE.js";
104
+ import "./chunk-GCKHQECX.js";
105
+ import "./chunk-WJZOQR2J.js";
106
+ import "./chunk-6CCFTVBP.js";
107
+ import "./chunk-BPMPOFWP.js";
108
+ import "./chunk-5MMAK75Q.js";
109
+ import "./chunk-DWLEOOGR.js";
110
+ import "./chunk-LIQJTQRN.js";
111
+ import "./chunk-UHTDNB5Y.js";
112
+ import "./chunk-KX6YBIHG.js";
113
+ import "./chunk-7DPNBQSV.js";
114
+ import {
115
+ canonicalizeToolName
116
+ } from "./chunk-5EBLANFT.js";
117
+ import "./chunk-NYYFIKHI.js";
118
+ import "./chunk-EZVK3N5L.js";
123
119
  import {
124
120
  extractCustomId
125
121
  } from "./chunk-M2EJHDJP.js";
126
- import "./chunk-3EUW3WEO.js";
122
+ import {
123
+ createDialogMessageKeyAndId
124
+ } from "./chunk-5EMSBTQ6.js";
125
+ import "./chunk-I42VC5KR.js";
127
126
  import "./chunk-U6VC4MU4.js";
127
+ import "./chunk-WWC7I6TA.js";
128
+ import "./chunk-PSCNXBYA.js";
129
+ import "./chunk-UBUH2TCC.js";
130
+ import "./chunk-I4SN4NUQ.js";
131
+ import "./chunk-5BHQICF2.js";
132
+ import "./chunk-KUG52IAP.js";
133
+ import "./chunk-3EUW3WEO.js";
134
+ import "./chunk-HNMXYYJR.js";
128
135
  import "./chunk-LCBAMY2M.js";
129
136
  import "./chunk-4SN6J65J.js";
130
137
  import "./chunk-CF7PE763.js";
131
138
  import "./chunk-G3SUCT4W.js";
139
+ import "./chunk-RVWMAFIT.js";
140
+ import {
141
+ PLATFORM_LLM_BUSY_USER_MESSAGE
142
+ } from "./chunk-CHCS6XPJ.js";
143
+ import "./chunk-QSJ3HFEF.js";
144
+ import "./chunk-ZWQUWF6W.js";
145
+ import "./chunk-KHCLMKZZ.js";
146
+ import "./chunk-VEA7H5FG.js";
147
+ import "./chunk-4VJAC32I.js";
132
148
  import "./chunk-4VNS5WPM.js";
133
149
 
150
+ // packages/ai/agent/foregroundTurnStageLog.ts
151
+ var FOREGROUND_TURN_STAGE_LOG_PREFIX = "[foregroundTurn][latency]";
152
+ var isStageLogEnabled = () => {
153
+ try {
154
+ if (globalThis.__NOLO_FOREGROUND_TURN_STAGE_LOG__ === true) {
155
+ return true;
156
+ }
157
+ const storage = globalThis.localStorage;
158
+ return typeof storage?.getItem === "function" ? storage.getItem("nolo.foregroundTurn.stageLog") === "1" : false;
159
+ } catch {
160
+ return false;
161
+ }
162
+ };
163
+ function createForegroundTurnStageLog(args) {
164
+ const t0 = Date.now();
165
+ const identity = `turn=${args.turnKey} runId=${args.runId} dialogId=${args.dialogId} dialogKey=${args.dialogKey} base=${args.base}`;
166
+ const marks = [];
167
+ return {
168
+ stage: (stage, detail) => {
169
+ const at = Date.now() - t0;
170
+ marks.push(`${stage}=+${at}ms`);
171
+ if (!isStageLogEnabled()) return;
172
+ console.info(
173
+ `${FOREGROUND_TURN_STAGE_LOG_PREFIX} stage=${stage} t=+${at}ms ${identity}${detail ? ` ${detail}` : ""}`
174
+ );
175
+ },
176
+ summary: (outcome, detail) => {
177
+ console.info(
178
+ `${FOREGROUND_TURN_STAGE_LOG_PREFIX} SUMMARY outcome=${outcome} total=+${Date.now() - t0}ms ${identity} marks=[${marks.join(" ")}]${detail ? ` ${detail}` : ""}`
179
+ );
180
+ }
181
+ };
182
+ }
183
+
134
184
  // packages/ai/tools/effectiveToolSurface.ts
135
185
  function readEffectiveToolName(value) {
136
186
  if (typeof value === "string") {
@@ -184,6 +234,10 @@ function resolveEffectiveToolSurface(input) {
184
234
  (Array.isArray(agent.disabledTools) ? agent.disabledTools : []).map(readEffectiveToolName).filter((name) => !!name)
185
235
  );
186
236
  for (const name of disabled) byName.delete(name);
237
+ const selectableCount = typeof input.selectableRuntimeCount === "number" ? input.selectableRuntimeCount : typeof input.runtimeCatalog?.selectableCount === "number" ? input.runtimeCatalog.selectableCount : void 0;
238
+ if (selectableCount !== void 0 && selectableCount <= 1) {
239
+ byName.delete("listRuntimes");
240
+ }
187
241
  const entries = [...byName.entries()].map(
188
242
  ([name, sources]) => ({ name, sources: [...sources] })
189
243
  );
@@ -218,33 +272,186 @@ function resolveEffectiveToolSurface(input) {
218
272
  };
219
273
  }
220
274
 
221
- // packages/ai/agent/serverOwnedWebForegroundEligibility.ts
222
- var DURABLE_WEB_FOREGROUND_INTERACTIVE_TOOL_NAMES = /* @__PURE__ */ new Set([
223
- "ask_user"
224
- ]);
225
- var DURABLE_WEB_FOREGROUND_READ_ONLY_TOOL_NAMES = /* @__PURE__ */ new Set([
226
- // Network read-only tools.
227
- "exa_search",
228
- "fetchWebpage",
229
- // Dialog search backed by the server workspace executor.
230
- "searchDialogMessages",
231
- // Nolo workspace read/query tools.
232
- "listDialogs",
233
- "readDialog",
234
- "queryDialogsBySubjectRef",
235
- "listAgents",
236
- "readAgent",
237
- "listSpaces",
238
- "readSpace",
239
- "readDoc",
240
- "readSkillDoc",
241
- "listTables",
242
- "queryTableRows"
243
- ]);
275
+ // packages/ai/tools/toolExecutionSemantics.ts
276
+ var UNKNOWN_TOOL_EXECUTION_CONTRACT = {
277
+ replay: "unknown",
278
+ sideEffects: "unknown",
279
+ locality: "unknown",
280
+ interaction: "unknown",
281
+ concurrency: "exclusive",
282
+ durableWebForeground: false
283
+ };
284
+ var serverPureRead = (durableWebForeground) => ({
285
+ replay: "pure",
286
+ sideEffects: "none",
287
+ locality: "server",
288
+ interaction: "none",
289
+ concurrency: "safe",
290
+ durableWebForeground
291
+ });
292
+ var serverExternalRead = (durableWebForeground) => ({
293
+ // Repeating the request should not mutate the target resource, but may spend
294
+ // provider quota/money and may observe newer remote state; it is not pure.
295
+ replay: "idempotent",
296
+ sideEffects: "observable",
297
+ locality: "server",
298
+ interaction: "none",
299
+ concurrency: "safe",
300
+ durableWebForeground
301
+ });
302
+ var serverConfirmedHandoffStep = () => ({
303
+ replay: "unsafe",
304
+ sideEffects: "observable",
305
+ locality: "server",
306
+ interaction: "handoff",
307
+ concurrency: "exclusive",
308
+ durableWebForeground: false
309
+ });
310
+ var TOOL_EXECUTION_CONTRACT = Object.freeze({
311
+ // Proven durable network reads. They execute on the server but touch external
312
+ // systems, so replay/cost semantics are intentionally not called "pure".
313
+ exa_search: serverExternalRead("read-only"),
314
+ fetchWebpage: serverExternalRead("read-only"),
315
+ // Proven durable server-hosted workspace reads/queries.
316
+ searchDialogMessages: serverPureRead("read-only"),
317
+ listDialogs: serverPureRead("read-only"),
318
+ readDialog: serverPureRead("read-only"),
319
+ queryDialogsBySubjectRef: serverPureRead("read-only"),
320
+ listAgents: serverPureRead("read-only"),
321
+ readAgent: serverPureRead("read-only"),
322
+ listSpaces: serverPureRead("read-only"),
323
+ readSpace: serverPureRead("read-only"),
324
+ readDoc: serverPureRead("read-only"),
325
+ readSkillDoc: serverPureRead("read-only"),
326
+ listTables: serverPureRead("read-only"),
327
+ queryTableRows: serverPureRead("read-only"),
328
+ // Read-only presentation payload. Actions remain inert; this adds no submit or
329
+ // open-app authority to server-owned projection.
330
+ show_interaction: {
331
+ replay: "pure",
332
+ sideEffects: "none",
333
+ locality: "server",
334
+ interaction: "none",
335
+ concurrency: "safe",
336
+ durableWebForeground: "read-only"
337
+ },
338
+ // Durable interactive boundary: the current execution ends and a later user
339
+ // choice starts a new execution. It is intentionally not modeled as a read.
340
+ ask_user: {
341
+ replay: "unsafe",
342
+ sideEffects: "observable",
343
+ locality: "server",
344
+ interaction: "blocking",
345
+ concurrency: "exclusive",
346
+ durableWebForeground: "interactive"
347
+ },
348
+ // Confirmed human hand-off boundary for the media step family. These tools
349
+ // do not start work needing authorization: they return
350
+ // `{ status: "requires_confirmation", ... }` and the run must stop and wait
351
+ // for the user. Registered explicitly (rather than inferred from any status)
352
+ // so a random tool echoing the same status never pauses the run, and kept out
353
+ // of the durable Web foreground plane on purpose (media ServerTool admission
354
+ // is owned elsewhere).
355
+ transcribe: serverConfirmedHandoffStep(),
356
+ translate: serverConfirmedHandoffStep(),
357
+ exportDocument: serverConfirmedHandoffStep(),
358
+ readArtifact: serverConfirmedHandoffStep(),
359
+ // Representative explicitly non-durable execution classes. These entries
360
+ // make the reason machine-readable; unlisted tools remain UNKNOWN.
361
+ execShell: {
362
+ replay: "unsafe",
363
+ sideEffects: "mutation",
364
+ locality: "workspace",
365
+ interaction: "none",
366
+ concurrency: "exclusive",
367
+ durableWebForeground: false
368
+ },
369
+ readFile: {
370
+ replay: "idempotent",
371
+ sideEffects: "none",
372
+ locality: "device",
373
+ interaction: "none",
374
+ concurrency: "safe",
375
+ durableWebForeground: false
376
+ },
377
+ globFiles: {
378
+ replay: "idempotent",
379
+ sideEffects: "none",
380
+ locality: "device",
381
+ interaction: "none",
382
+ concurrency: "safe",
383
+ durableWebForeground: false
384
+ },
385
+ createDoc: {
386
+ replay: "unsafe",
387
+ sideEffects: "mutation",
388
+ locality: "server",
389
+ interaction: "none",
390
+ concurrency: "exclusive",
391
+ durableWebForeground: false
392
+ },
393
+ updateDoc: {
394
+ replay: "unsafe",
395
+ sideEffects: "mutation",
396
+ locality: "server",
397
+ interaction: "none",
398
+ concurrency: "exclusive",
399
+ durableWebForeground: false
400
+ },
401
+ deleteDialogs: {
402
+ replay: "unsafe",
403
+ sideEffects: "mutation",
404
+ locality: "server",
405
+ interaction: "confirm",
406
+ concurrency: "exclusive",
407
+ durableWebForeground: false
408
+ },
409
+ loadSkill: {
410
+ replay: "unsafe",
411
+ sideEffects: "observable",
412
+ locality: "server",
413
+ interaction: "none",
414
+ concurrency: "exclusive",
415
+ durableWebForeground: false
416
+ }
417
+ });
418
+ function resolveToolExecutionContract(toolName) {
419
+ if (typeof toolName !== "string" || !toolName.trim()) {
420
+ return UNKNOWN_TOOL_EXECUTION_CONTRACT;
421
+ }
422
+ const canonicalName = canonicalizeToolName(toolName);
423
+ return TOOL_EXECUTION_CONTRACT[canonicalName] ?? UNKNOWN_TOOL_EXECUTION_CONTRACT;
424
+ }
425
+ function collectDurableWebToolNames(durableClass) {
426
+ return new Set(
427
+ Object.entries(TOOL_EXECUTION_CONTRACT).filter(([, contract]) => contract.durableWebForeground === durableClass).map(([name]) => name)
428
+ );
429
+ }
430
+ var DURABLE_WEB_FOREGROUND_READ_ONLY_TOOL_NAMES = collectDurableWebToolNames("read-only");
431
+ var DURABLE_WEB_FOREGROUND_INTERACTIVE_TOOL_NAMES = collectDurableWebToolNames("interactive");
244
432
  var DURABLE_WEB_FOREGROUND_TOOL_NAMES = /* @__PURE__ */ new Set([
245
- ...DURABLE_WEB_FOREGROUND_INTERACTIVE_TOOL_NAMES,
246
- ...DURABLE_WEB_FOREGROUND_READ_ONLY_TOOL_NAMES
433
+ ...DURABLE_WEB_FOREGROUND_READ_ONLY_TOOL_NAMES,
434
+ ...DURABLE_WEB_FOREGROUND_INTERACTIVE_TOOL_NAMES
247
435
  ]);
436
+ var CONFIRMED_HANDOFF_TOOL_NAMES = new Set(
437
+ Object.entries(TOOL_EXECUTION_CONTRACT).filter(([, contract]) => contract.interaction === "handoff").map(([name]) => name)
438
+ );
439
+ function hasProvenServerReadOnlySemantics(toolName) {
440
+ const contract = resolveToolExecutionContract(toolName);
441
+ return contract.durableWebForeground === "read-only" && (contract.replay === "pure" || contract.replay === "idempotent") && (contract.sideEffects === "none" || contract.sideEffects === "observable") && contract.locality === "server" && contract.interaction === "none";
442
+ }
443
+ function hasProvenDurableWebForegroundSemantics(toolName) {
444
+ const contract = resolveToolExecutionContract(toolName);
445
+ if (contract.durableWebForeground === "read-only") {
446
+ return hasProvenServerReadOnlySemantics(toolName);
447
+ }
448
+ if (contract.durableWebForeground === "interactive") {
449
+ return contract.locality === "server" && contract.interaction === "blocking" && contract.sideEffects === "observable";
450
+ }
451
+ return false;
452
+ }
453
+
454
+ // packages/ai/agent/serverOwnedWebForegroundEligibility.ts
248
455
  var AUDITED_WEB_FOREGROUND_HOST_BASELINE_TOOL_NAMES = /* @__PURE__ */ new Set([
249
456
  // TOOL_PACKS.CORE
250
457
  "read",
@@ -254,6 +461,8 @@ var AUDITED_WEB_FOREGROUND_HOST_BASELINE_TOOL_NAMES = /* @__PURE__ */ new Set([
254
461
  "search_workspace",
255
462
  "updateSelf",
256
463
  "ask_user",
464
+ // show_interaction: CORE 宿主注入;服务端纯函数展示(parse + fallback,无 I/O、无客户端通道),只读展示语义,不执行卡片动作
465
+ "show_interaction",
257
466
  "createAgentAutomation",
258
467
  "updateAgentAutomation",
259
468
  "deleteAgentAutomation",
@@ -267,13 +476,13 @@ var AUDITED_WEB_FOREGROUND_HOST_BASELINE_TOOL_NAMES = /* @__PURE__ */ new Set([
267
476
  // Default system capabilities
268
477
  "exa_search",
269
478
  "fetchWebpage",
270
- "setTodoList",
271
479
  "startAgentRun",
272
480
  "controlAgentRun",
273
481
  "listAgents"
274
482
  ]);
275
483
  function isDurableRequestedToolName(name) {
276
- return typeof name === "string" && DURABLE_WEB_FOREGROUND_TOOL_NAMES.has(canonicalizeToolName(name));
484
+ if (typeof name !== "string") return false;
485
+ return hasProvenDurableWebForegroundSemantics(canonicalizeToolName(name));
277
486
  }
278
487
  function hasSupportedDurableToolSurface(agent, suppliedSurface) {
279
488
  const surface = suppliedSurface ?? resolveEffectiveToolSurface({
@@ -320,7 +529,6 @@ function shouldUseServerOwnedWebForegroundTurn(input) {
320
529
  }
321
530
  if (runtimeOptions?.editingTarget) return false;
322
531
  if (runtimeOptions?.imageConfigOverride) return false;
323
- if (runtimeOptions?.quickChatModelOverride) return false;
324
532
  if (runtimeOptions?.workspaceToolsHint) return false;
325
533
  if (runtimeOptions?.cwd) return false;
326
534
  if (runtimeOptions?.restrictShellToWorkspace) return false;
@@ -401,11 +609,7 @@ function createServerOwnedToolProjection(args) {
401
609
  if (!toolName || !supported.has(toolName)) return;
402
610
  const metadata = payload.metadata && typeof payload.metadata === "object" && !Array.isArray(payload.metadata) ? payload.metadata : void 0;
403
611
  const failed = isToolResultFailure(payload.content, metadata);
404
- const content = toolName === "ask_user" ? typeof payload.content === "string" ? payload.content : "" : projectDesktopToolUiContent({
405
- toolName,
406
- content: payload.content,
407
- metadata
408
- });
612
+ const content = toolName === "ask_user" ? typeof payload.content === "string" ? payload.content : "" : projectDesktopToolUiContent({ toolName, content: payload.content, metadata });
409
613
  const base = existing ?? (() => {
410
614
  const { key, messageId } = createDialogMessageKeyAndId(args.dialogId);
411
615
  return {
@@ -426,17 +630,21 @@ function createServerOwnedToolProjection(args) {
426
630
  ...args.messageMetadata
427
631
  };
428
632
  })();
429
- const staysReadOnly = keepReadOnly.has(toolName);
633
+ const staysReadOnly = !failed && keepReadOnly.has(toolName);
634
+ const awaitingUserConfirmation = toolResultNeedsUserConfirmation(toolName, payload.content);
430
635
  const toolPayload = {
431
636
  ...base.toolPayload ?? {},
432
637
  toolName,
433
- status: staysReadOnly ? "running" : failed ? "failed" : "succeeded"
638
+ status: staysReadOnly ? "running" : awaitingUserConfirmation ? "pending" : failed ? "failed" : "succeeded"
434
639
  };
435
640
  const message = {
436
641
  ...base,
437
642
  content,
438
643
  isStreaming: staysReadOnly,
439
644
  toolName,
645
+ // F1: surface server-projected metadata (incl. executionLocation) on the
646
+ // message so tool rows can render the actual execution host.
647
+ ...metadata ? { metadata } : {},
440
648
  toolPayload
441
649
  };
442
650
  transientByCallId.set(callId, message);
@@ -455,7 +663,8 @@ function createServerOwnedToolProjection(args) {
455
663
  content,
456
664
  isStreaming: false,
457
665
  toolName,
458
- toolPayload
666
+ toolPayload,
667
+ ...metadata ? { metadata } : {}
459
668
  }
460
669
  })
461
670
  );
@@ -621,6 +830,7 @@ function applyServerOwnedAssistantStreamPayload(state, payload) {
621
830
  }
622
831
 
623
832
  // packages/ai/agent/serverOwnedWebForegroundTurn.ts
833
+ var SERVER_OWNED_CANONICAL_HANDOFF_PROTECT_MS = 65e3;
624
834
  function resolveServerOwnedWebAllowedToolNames(toolNames) {
625
835
  return Array.from(
626
836
  new Set(
@@ -648,7 +858,7 @@ async function canRunServerOwnedWebForegroundTurn(args, thunk) {
648
858
  let agentConfig = args.agentConfig ?? void 0;
649
859
  if (!agentConfig) {
650
860
  try {
651
- const { readAndWait: readAndWait2 } = await import("./dbSlice-DQ32LYTJ.js");
861
+ const { readAndWait: readAndWait2 } = await import("./dbSlice-J37OGIXH.js");
652
862
  agentConfig = await thunk.dispatch(readAndWait2(args.agentKey)).unwrap();
653
863
  } catch {
654
864
  return { eligible: false };
@@ -720,6 +930,19 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
720
930
  let assistantStream = EMPTY_SERVER_OWNED_ASSISTANT_STREAM;
721
931
  let sawDone = false;
722
932
  let clientControllerReleased = false;
933
+ let visibleFinalized = false;
934
+ let sawFirstDelta = false;
935
+ let observedExecutionId = "";
936
+ let canonicalVisible = false;
937
+ const stageLog = createForegroundTurnStageLog({
938
+ turnKey: loopKey,
939
+ // This path's server run identity IS the dialogId; executionId stays in the
940
+ // SUMMARY detail to tell multiple runs of the same dialog apart.
941
+ runId: dialogId,
942
+ dialogKey,
943
+ dialogId,
944
+ base: currentServer
945
+ });
723
946
  const toolProjection = createServerOwnedToolProjection({
724
947
  dialogId,
725
948
  dispatch: thunk.dispatch,
@@ -729,7 +952,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
729
952
  userId
730
953
  },
731
954
  supportedToolNames: DURABLE_WEB_FOREGROUND_TOOL_NAMES,
732
- keepReadOnlyUntilCanonical: ["ask_user"]
955
+ keepReadOnlyUntilCanonical: ["ask_user", "show_interaction"]
733
956
  });
734
957
  const projectAssistant = () => {
735
958
  thunk.dispatch(
@@ -750,6 +973,19 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
750
973
  if (clientControllerReleased) return;
751
974
  clientControllerReleased = true;
752
975
  thunk.dispatch(removeActiveController({ messageId: loopKey, dialogKey }));
976
+ clearForegroundTurnSettledVisible(dialogId);
977
+ stageLog.stage("controller-release");
978
+ };
979
+ const finalizeVisibleProjectionOnDone = () => {
980
+ if (visibleFinalized) return;
981
+ visibleFinalized = true;
982
+ protectTransientForCanonicalHandoff(
983
+ dialogId,
984
+ transientId,
985
+ SERVER_OWNED_CANONICAL_HANDOFF_PROTECT_MS
986
+ );
987
+ finishTransientImmediately();
988
+ markForegroundTurnSettledVisible(dialogId);
753
989
  };
754
990
  const finishTransientImmediately = () => {
755
991
  const transient = selectAllMsgs(thunk.getState(), dialogId).find((message) => message?.id === transientId);
@@ -787,6 +1023,8 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
787
1023
  toolProjection.cleanup();
788
1024
  thunk.dispatch(removeTransientMessage({ id: transientId, dialogId }));
789
1025
  }).catch(() => {
1026
+ }).finally(() => {
1027
+ releaseTransientCanonicalHandoff(dialogId, transientId);
790
1028
  });
791
1029
  };
792
1030
  thunk.dispatch(addActiveController({ messageId: loopKey, controller, dialogKey }));
@@ -832,6 +1070,10 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
832
1070
  },
833
1071
  signal: controller.signal
834
1072
  });
1073
+ stageLog.stage(
1074
+ "run-fetch-start",
1075
+ `endpoint=${currentServer}/api/agent/run agentKey=${args.agentKey}`
1076
+ );
835
1077
  try {
836
1078
  let response;
837
1079
  try {
@@ -849,12 +1091,16 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
849
1091
  });
850
1092
  return { serverOwned: true, detached: true };
851
1093
  }
1094
+ stageLog.stage("headers", `status=${response.status} ok=${response.ok}`);
852
1095
  if (!response.ok) {
853
1096
  const text = await response.text().catch(() => "");
854
1097
  throw new Error(text || `Agent run failed (${response.status})`);
855
1098
  }
856
1099
  const reader = response.body?.getReader();
857
- if (!reader) return { serverOwned: true, detached: true };
1100
+ if (!reader) {
1101
+ stageLog.stage("no-stream-body");
1102
+ return { serverOwned: true, detached: true };
1103
+ }
858
1104
  const parseSSE = createSSEParser();
859
1105
  const decoder = new TextDecoder();
860
1106
  const outcome = await consumeAgentRunStream({
@@ -867,6 +1113,9 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
867
1113
  onAbort: async () => {
868
1114
  },
869
1115
  onPayload: (payload) => {
1116
+ if (payload?.type === "dialog") {
1117
+ observedExecutionId = typeof payload.executionId === "string" ? payload.executionId.trim() : "";
1118
+ }
870
1119
  if (payload?.type === "error") {
871
1120
  return { reject: payload.message || "Agent execution failed" };
872
1121
  }
@@ -878,17 +1127,40 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
878
1127
  if (nextAssistantStream !== assistantStream) {
879
1128
  assistantStream = nextAssistantStream;
880
1129
  projectAssistant();
1130
+ if (!sawFirstDelta && payload?.type !== "done") {
1131
+ sawFirstDelta = true;
1132
+ stageLog.stage(
1133
+ "first-delta",
1134
+ `payloadType=${payload?.type} executionId=${observedExecutionId}`
1135
+ );
1136
+ }
1137
+ }
1138
+ if (payload?.type === "done" && !visibleFinalized) {
1139
+ stageLog.stage("done-frame", `executionId=${observedExecutionId}`);
1140
+ finalizeVisibleProjectionOnDone();
881
1141
  }
882
1142
  }
883
1143
  });
1144
+ stageLog.stage(
1145
+ "eof",
1146
+ outcome.outcome === "streamEnded" ? `outcome=streamEnded sawDone=${outcome.sawDone} executionId=${observedExecutionId}` : `outcome=${outcome.outcome}`
1147
+ );
884
1148
  if (outcome.outcome === "aborted") return { serverOwned: true, aborted: true };
885
1149
  if (outcome.outcome === "rejected") throw new Error(outcome.message);
886
1150
  if (!outcome.sawDone) return { serverOwned: true, detached: true };
887
1151
  sawDone = true;
888
- finishTransientImmediately();
889
- let canonicalVisible = false;
1152
+ finalizeVisibleProjectionOnDone();
890
1153
  try {
891
- await thunk.dispatch(initMsgs({ dialogId })).unwrap();
1154
+ stageLog.stage("init-msgs-start", `dialogKey=${dialogKey}`);
1155
+ const initMsgsStartedAt = Date.now();
1156
+ await thunk.dispatch(
1157
+ initMsgs({
1158
+ dialogId,
1159
+ dialogKey,
1160
+ preferredServerOrigin: currentServer
1161
+ })
1162
+ ).unwrap();
1163
+ stageLog.stage("init-msgs-end", `ms=${Date.now() - initMsgsStartedAt}`);
892
1164
  canonicalVisible = !!await waitForNewCanonicalAssistant({
893
1165
  readMessages: () => selectAllMsgs(thunk.getState(), dialogId),
894
1166
  initialMessageIds,
@@ -906,6 +1178,7 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
906
1178
  });
907
1179
  }
908
1180
  if (canonicalVisible) {
1181
+ releaseTransientCanonicalHandoff(dialogId, transientId);
909
1182
  toolProjection.cleanup();
910
1183
  thunk.dispatch(removeTransientMessage({ id: transientId, dialogId }));
911
1184
  } else {
@@ -919,10 +1192,19 @@ async function runServerOwnedWebForegroundTurn(args, thunk) {
919
1192
  return { serverOwned: true };
920
1193
  } finally {
921
1194
  releaseClientController();
922
- if (!sawDone) {
1195
+ if (!sawDone && !visibleFinalized) {
1196
+ releaseTransientCanonicalHandoff(dialogId, transientId);
923
1197
  toolProjection.cleanup();
924
1198
  thunk.dispatch(removeTransientMessage({ id: transientId, dialogId }));
925
1199
  }
1200
+ if (visibleFinalized && !sawDone) {
1201
+ toolProjection.cleanup();
1202
+ removeTransientWhenCanonicalArrives();
1203
+ }
1204
+ stageLog.summary(
1205
+ controller.signal.aborted ? "aborted" : sawDone ? "done" : visibleFinalized ? "done-visible-only" : "no-done",
1206
+ `runId=${dialogId} executionId=${observedExecutionId} canonicalVisible=${canonicalVisible} settledVisible=${visibleFinalized}`
1207
+ );
926
1208
  }
927
1209
  }
928
1210
 
@@ -1027,6 +1309,22 @@ function parseSendError(errorInput) {
1027
1309
  domain = first ? asString(first.domain) : void 0;
1028
1310
  }
1029
1311
  const stage = resolveErrorStage(fullErrorText);
1312
+ const inputRecord = asRecord(errorInput);
1313
+ const authCode = asString(inputRecord?.authCode) ?? asString(inputRecord?.code);
1314
+ const hasPlatformAuthCode = /^AUTH_[A-Z0-9_]+$/.test(authCode ?? "") || /\bAUTH_[A-Z0-9_]+\b/.test(fullErrorText);
1315
+ const isPlatformProviderFailure = /\bplatform provider failed\b/i.test(fullErrorText);
1316
+ const isLoginStatus = statusCode === void 0 || statusCode === 401;
1317
+ const requiresLogin = isLoginStatus && !url && !/validation_required|api[_ -]?key/i.test(fullErrorText) && (hasPlatformAuthCode || isPlatformProviderFailure && statusCode === 401);
1318
+ if (requiresLogin) {
1319
+ return {
1320
+ kind: "auth",
1321
+ retryable: false,
1322
+ stage,
1323
+ summary: "\u9700\u8981\u767B\u5F55",
1324
+ actionHint: "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55",
1325
+ extraLinks: [{ text: "\u53BB\u767B\u5F55", url: "/login" }]
1326
+ };
1327
+ }
1030
1328
  const isPlatformBusy = fullErrorText.includes(PLATFORM_LLM_BUSY_USER_MESSAGE) || /PLATFORM_LLM_BUSY/i.test(fullErrorText);
1031
1329
  const busyUpstreamDetail = fullErrorText.match(
1032
1330
  /nolo\s+(?:HTTP\s*\d{3}|[A-Za-z]+Error)/
@@ -1311,7 +1609,9 @@ var finalizeSendFailureInDialog = async (dispatch, dialogConfig, agentKey, error
1311
1609
  const dialogId = dialogConfig.id ?? (dialogKey ? extractCustomId(dialogKey) : "");
1312
1610
  const { key: msgKey, messageId } = createDialogMessageKeyAndId(dialogId);
1313
1611
  const parsed = parseSendError(errorInput);
1612
+ const diagnostics = extractErrorDiagnostics(errorInput);
1314
1613
  const errorMeta = {
1614
+ ...diagnostics ? { diagnostics } : {},
1315
1615
  kind: parsed.kind,
1316
1616
  retryable: parsed.retryable,
1317
1617
  stage: parsed.stage,
@@ -1409,10 +1709,14 @@ var handleSendMessageAction = async (args, { dispatch, getState, rejectWithValue
1409
1709
  dialogKey: dialogConfig.dbKey
1410
1710
  });
1411
1711
  }
1712
+ const selectedRuntimeTarget = dialogConfig.runtimeBinding?.target;
1412
1713
  const resolvedContext = resolveHandleSendMessageContext({
1413
1714
  dialogConfig,
1414
1715
  targetAgentKey: args.targetAgentKey,
1415
- runtimeOptions: args.runtimeOptions
1716
+ runtimeOptions: {
1717
+ ...args.runtimeOptions,
1718
+ ...selectedRuntimeTarget && (selectedRuntimeTarget.kind === "server" || selectedRuntimeTarget.kind === "machine") ? { runtimeTarget: selectedRuntimeTarget } : {}
1719
+ }
1416
1720
  });
1417
1721
  agentKeyToUse = resolvedContext.agentKeyToUse;
1418
1722
  const agentConfigToUse = resolvedContext.agentConfigToUse;