nolo-cli 0.228.0-alpha.2 → 0.228.0

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 (235) hide show
  1. package/README.md +3 -5
  2. package/{_executeModel-VYCHHZVT.js → _executeModel-GIFVXKDT.js} +88 -83
  3. package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
  4. package/{action-GDZDXPMB.js → action-WZTKEF5H.js} +9 -6
  5. package/{addContentAction-7RO4AMRI.js → addContentAction-MLI6GOBV.js} +14 -13
  6. package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-ARGQM22H.js} +17 -16
  7. package/{agentDeleteCommand-QWQKT54A.js → agentDeleteCommand-UF7XVELS.js} +118 -111
  8. package/{agentEmailCommands-EISMBIRE.js → agentEmailCommands-SFHRPQYC.js} +118 -107
  9. package/{agentListCommands-4WLG32IW.js → agentListCommands-IXKBP3W5.js} +208 -177
  10. package/{agentMachineCommands-DC6NKWTU.js → agentMachineCommands-7NX6PWQ6.js} +55 -48
  11. package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-C5T7C5KZ.js} +2 -2
  12. package/{agentPullCommand-KHV4EELF.js → agentPullCommand-4EQZYHU4.js} +1 -1
  13. package/agentRecordCommands-IUNX6XD6.js +188 -0
  14. package/{agentRunCommand-QM7ETUTX.js → agentRunCommand-LCR4XADM.js} +125 -111
  15. package/{agentRunControl-MBG4U6SL.js → agentRunControl-RN2P6AOD.js} +11 -9
  16. package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-LVXPQ7QA.js} +56 -43
  17. package/{agentSlice-UG76KEBH.js → agentSlice-ZGMOH6TE.js} +15 -14
  18. package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-BESCJOQM.js} +55 -48
  19. package/{appDeployCommands-AU4IUN33.js → appDeployCommands-LPTR6IOX.js} +55 -48
  20. package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-BZ7KZ5RD.js} +55 -48
  21. package/{appGetCommands-BGTLIQ4K.js → appGetCommands-EDWGJV4S.js} +55 -48
  22. package/{appListCommands-CUCPRUXW.js → appListCommands-OPRWYPM6.js} +55 -48
  23. package/{authCommand-OZ2KTP4Z.js → authCommand-3C3RN4OU.js} +25 -19
  24. package/{authCommands-55OGQGCR.js → authCommands-ZMVEDCQD.js} +12 -6
  25. package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-VRCMQ77Q.js} +7 -7
  26. package/{chromeCommands-G5UDKVSV.js → chromeCommands-O4IIKTBD.js} +384 -7
  27. package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-NZITLHWO.js} +3 -3
  28. package/{chunk-VQ5N5GSV.js → chunk-2BKNICGK.js} +4 -4
  29. package/{chunk-QYB23WUH.js → chunk-2FK2KZSL.js} +1 -1
  30. package/chunk-2SXN7LAY.js +15 -0
  31. package/{chunk-3VZLEKV2.js → chunk-3DJJ4CFG.js} +11 -11
  32. package/{chunk-TSPMLCWI.js → chunk-4IQN6FWY.js} +5 -5
  33. package/{chunk-XAG3FWBE.js → chunk-4OXPN3WC.js} +6 -6
  34. package/chunk-4ZCTKB27.js +31 -0
  35. package/chunk-53W5BXLN.js +340 -0
  36. package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
  37. package/chunk-6ASGEP5D.js +21 -0
  38. package/{chunk-MJI3UAXN.js → chunk-6CXQ3YNJ.js} +40 -36
  39. package/{chunk-G7IUT2V3.js → chunk-6MTVACLN.js} +365 -64
  40. package/{chunk-ZOHO6MOF.js → chunk-6RSNVJGO.js} +2 -99
  41. package/{chunk-XSW4EXQV.js → chunk-6TVYUQRM.js} +55 -18
  42. package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
  43. package/{chunk-7Z6EW7AH.js → chunk-6XVPMGXK.js} +97 -11
  44. package/{chunk-ALAES342.js → chunk-73PZD7JZ.js} +9 -5
  45. package/{chunk-TCZ2VJZQ.js → chunk-7UVVLYKC.js} +9 -9
  46. package/{chunk-S6FDXXZV.js → chunk-ADOOL3PG.js} +2 -2
  47. package/{chunk-OWKNSIXL.js → chunk-AEZBAFC6.js} +334 -77
  48. package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
  49. package/{chunk-RG2DGNL6.js → chunk-ARFCL53U.js} +5 -5
  50. package/{chunk-SRCCSTIM.js → chunk-AS6L5KSD.js} +4 -4
  51. package/{chunk-WFDNADFX.js → chunk-BAH3BAUZ.js} +8 -8
  52. package/{chunk-N5Z2V73W.js → chunk-BFKJ2RS3.js} +1 -1
  53. package/{chunk-F6Z6ZCUV.js → chunk-BVEDT6DM.js} +3 -3
  54. package/chunk-C5A54QS7.js +108 -0
  55. package/{chunk-CD3RU7XL.js → chunk-CD2DK5JA.js} +120 -14
  56. package/{chunk-BP5ZJ6B4.js → chunk-CD64YXRB.js} +1 -1
  57. package/{chunk-VP3BINY7.js → chunk-CIGCTSBF.js} +31 -1
  58. package/{chunk-TQEKUOTI.js → chunk-CIUZXD5D.js} +12 -12
  59. package/{chunk-EVGU5P4U.js → chunk-CO6E7YK6.js} +1 -1
  60. package/{chunk-VMJVAJ6W.js → chunk-CTIEJRTP.js} +28 -4
  61. package/{chunk-7JGMNKKG.js → chunk-CTWCZKNS.js} +29 -8
  62. package/{chunk-YFLVRVYK.js → chunk-D25ONVOH.js} +1 -1
  63. package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
  64. package/{chunk-262R3XNN.js → chunk-E5RYFR7E.js} +334 -103
  65. package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
  66. package/{chunk-HSSBDZLD.js → chunk-EDT65EUE.js} +6 -6
  67. package/{chunk-YVFH2MFB.js → chunk-EQZQUQ33.js} +7 -7
  68. package/{chunk-HBRDSQ3M.js → chunk-ESN4WNWU.js} +3 -2
  69. package/{chunk-2YGBI2XB.js → chunk-FE7G6DSP.js} +11 -1
  70. package/{chunk-547ENH5T.js → chunk-FFFKAOJN.js} +4 -4
  71. package/{chunk-5ZUOVCKT.js → chunk-FGHEF6WI.js} +3 -1
  72. package/{chunk-GAYNXB6T.js → chunk-FTWAOKFU.js} +756 -333
  73. package/chunk-GAHJLSDO.js +107 -0
  74. package/{chunk-2X7WFDT6.js → chunk-GX6DITLQ.js} +1 -1
  75. package/{chunk-HXB4VDGK.js → chunk-HCCQEMTK.js} +28 -28
  76. package/{chunk-CMMI3DAT.js → chunk-HZDK56EK.js} +33 -26
  77. package/{chunk-OTKSESZR.js → chunk-IIOSZAJX.js} +4 -4
  78. package/chunk-IIRJ4P4I.js +24 -0
  79. package/{chunk-OJ45MEEI.js → chunk-IJZC2KIJ.js} +1 -1
  80. package/{chunk-MNEZUL5S.js → chunk-ITBX27W6.js} +92 -31
  81. package/{chunk-LYD6C7OU.js → chunk-J2VIGDJN.js} +6 -6
  82. package/{chunk-M3OZRQNH.js → chunk-JEWMQR6J.js} +1 -1
  83. package/{chunk-6QHKRARD.js → chunk-JFRJEPFI.js} +29 -5
  84. package/{chunk-S6K5F3KP.js → chunk-JP2BH4NC.js} +1 -1
  85. package/{chunk-EGHP7KOY.js → chunk-JU7VN4LF.js} +38 -29
  86. package/{chunk-RTHFJZ6M.js → chunk-K26XPZRB.js} +2 -2
  87. package/{chunk-ZYKJBRZ3.js → chunk-K7VIXYTZ.js} +1 -3
  88. package/chunk-KK3FCYZM.js +647 -0
  89. package/chunk-KLAMJNKQ.js +33394 -0
  90. package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
  91. package/chunk-KXOPLLFP.js +190 -0
  92. package/{chunk-MZG5CETE.js → chunk-KZ5OD2MO.js} +4 -4
  93. package/{chunk-ILHQ2AXT.js → chunk-KZAT2M2V.js} +14 -8
  94. package/chunk-LHCGKAFO.js +739 -0
  95. package/{chunk-HF7BLF3F.js → chunk-LMGFVH65.js} +107 -104
  96. package/{chunk-QRGDJA4B.js → chunk-LTVEOOZL.js} +19 -6
  97. package/{chunk-L32W3PRP.js → chunk-MAA42MMV.js} +233 -17
  98. package/{chunk-ATEKLSLR.js → chunk-MTM4LRVG.js} +14 -9
  99. package/chunk-MVOZ22RZ.js +26 -0
  100. package/{chunk-U2HBB7RS.js → chunk-MYYNZG2M.js} +132 -32
  101. package/{chunk-DBUR22G5.js → chunk-MZVCFV3T.js} +19 -15
  102. package/{chunk-WCFFRBL5.js → chunk-N74XL3NI.js} +9 -9
  103. package/{chunk-VS276URX.js → chunk-NEG5LYK5.js} +1 -1
  104. package/{chunk-RBPUNSG5.js → chunk-OAZP4TSA.js} +18 -108
  105. package/{chunk-4QYJPWHH.js → chunk-ODBYGVO2.js} +232 -10
  106. package/{chunk-M4SFKP5L.js → chunk-OHUYN3YU.js} +3 -3
  107. package/{chunk-HYLRQDEE.js → chunk-OLGFIQN2.js} +6 -6
  108. package/{chunk-M3JEW6N6.js → chunk-OYUMJMC5.js} +15 -0
  109. package/chunk-P27E22MA.js +203 -0
  110. package/{chunk-BIWI5M4E.js → chunk-PBPXXMWZ.js} +1 -1
  111. package/{chunk-OBSEKCVK.js → chunk-PQ63BDV3.js} +210 -51
  112. package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
  113. package/{chunk-XFXFPUO7.js → chunk-QMNVV3YM.js} +10 -37
  114. package/{chunk-CNMY2XM6.js → chunk-R5NRFXGD.js} +5 -5
  115. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  116. package/{chunk-4WVJLODK.js → chunk-RHBD22LV.js} +9 -4
  117. package/{chunk-45CAVC35.js → chunk-RMWDKLBE.js} +1489 -286
  118. package/{chunk-ZEVQHCLM.js → chunk-RR3MB26M.js} +2 -2
  119. package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
  120. package/{chunk-DLXMMTGM.js → chunk-SCMYAGQE.js} +1067 -705
  121. package/{chunk-YKY4OVOX.js → chunk-SPU3L3OR.js} +17 -170
  122. package/chunk-SR4FE5VD.js +9 -0
  123. package/{chunk-DUUDXSLX.js → chunk-SX6AWTNK.js} +28 -4
  124. package/{chunk-ZH3KXFHS.js → chunk-TMRJGSK2.js} +1 -1
  125. package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
  126. package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
  127. package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
  128. package/{chunk-3U44JB3O.js → chunk-UF6J7NXV.js} +1 -1
  129. package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
  130. package/chunk-UOUMPHS5.js +103 -0
  131. package/{chunk-HHFGE2WF.js → chunk-UPOW5HTG.js} +5 -5
  132. package/{chunk-DEA37IUY.js → chunk-V4IYI3SB.js} +2 -2
  133. package/{chunk-XTJKU3Z4.js → chunk-VKCPKCSS.js} +66 -92
  134. package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
  135. package/{chunk-OBIC6EG7.js → chunk-VUHKG4KS.js} +3 -3
  136. package/{chunk-EEOOBRA7.js → chunk-W3HSD32M.js} +13 -6
  137. package/{chunk-P2ZLUIW2.js → chunk-W6T4FNZP.js} +351 -26
  138. package/chunk-WDWZPASX.js +29 -0
  139. package/{chunk-R6Z5S5GA.js → chunk-WQDTSK5U.js} +51 -14
  140. package/{chunk-X3E6EHJW.js → chunk-X22AUZKL.js} +149 -165
  141. package/{chunk-4ZGPHFLE.js → chunk-X3OZ655T.js} +2 -2
  142. package/{chunk-RRDRQOEC.js → chunk-XCA4WHX5.js} +95 -77
  143. package/{chunk-TI2EPRHE.js → chunk-XJSEST7D.js} +3 -3
  144. package/{chunk-3QIYD3VM.js → chunk-XNTZD4AE.js} +870 -1068
  145. package/chunk-XSRSAU3O.js +133 -0
  146. package/{chunk-7FEP5USX.js → chunk-Y4NPF2UN.js} +3 -3
  147. package/{chunk-FJSNBZXR.js → chunk-YDRRGVT5.js} +1 -1
  148. package/{chunk-7BCG67EI.js → chunk-YFW4H6DL.js} +405 -338
  149. package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
  150. package/{chunk-4N6G2CKP.js → chunk-YHNUDTU4.js} +49 -3
  151. package/chunk-YJPK35HB.js +175 -0
  152. package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
  153. package/{chunk-FPBJM2BW.js → chunk-Z7KE4K3H.js} +195 -126
  154. package/{chunk-DGYCDA6W.js → chunk-ZM5AZTQG.js} +20 -13
  155. package/{chunk-CBUZ6DKA.js → chunk-ZQ6K57FJ.js} +1 -1
  156. package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-37ZNEY5Y.js} +9 -9
  157. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
  158. package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-MCQVRWBR.js} +58 -47
  159. package/{commandRegistry-FVYPE2IN.js → commandRegistry-NTH5IAN5.js} +104 -92
  160. package/{contentThunks-GNFPG32S.js → contentThunks-SPXTX5U2.js} +38 -36
  161. package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-TIFCHCUN.js} +1 -1
  162. package/{createAgentAutomationAction-PB4QIFQ4.js → createAgentAutomationAction-KUQKCOXB.js} +38 -36
  163. package/{createDialogAction-EVTOPY7A.js → createDialogAction-HJN5U3XS.js} +39 -37
  164. package/{createPageAction-2UYF2IDZ.js → createPageAction-ZAHRDOAU.js} +43 -41
  165. package/{db-M7FU2GNK.js → db-CMUTP3W5.js} +2 -2
  166. package/{dbSlice-XRUZOGSU.js → dbSlice-656PMWR2.js} +13 -12
  167. package/{deleteFile-6URDHYRB.js → deleteFile-ZCQESEEQ.js} +10 -7
  168. package/{dialogCommands-6SZD4TYP.js → dialogCommands-KZTZLWPZ.js} +60 -54
  169. package/dialogMessageRecord-OAV77LT7.js +7 -0
  170. package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-PST75COP.js} +11 -11
  171. package/{dialogSlice-5EQ2A6LY.js → dialogSlice-BXIERQHO.js} +39 -37
  172. package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-6RW2FY6K.js} +5 -5
  173. package/{docCreateCommands-25E6PGN3.js → docCreateCommands-26HJ5NAY.js} +54 -47
  174. package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-UAOHH5XK.js} +56 -49
  175. package/{docReadCommands-JY2E5XEN.js → docReadCommands-4ADG7YE6.js} +54 -47
  176. package/{docStore-OKKIKLT3.js → docStore-FZ75HWP2.js} +15 -14
  177. package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-OGFJZENF.js} +54 -47
  178. package/fetchMessages-TQEUZD7H.js +1 -1
  179. package/{getPricing-LF5C4XSI.js → getPricing-FCHYVRJU.js} +4 -4
  180. package/{handleSendMessageAction-LNT7SZND.js → handleSendMessageAction-KP6GGBFY.js} +82 -78
  181. package/{hostCredentialCreate-XUU2CSHI.js → hostCredentialCreate-23TX56G7.js} +117 -105
  182. package/index.js +8 -8
  183. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  184. package/{localDialogRead-CCOCVGAP.js → localDialogRead-CIOTQM5T.js} +1 -1
  185. package/{localRuntimeAdapter-IBSTMSX7.js → localRuntimeAdapter-MTUWOYPN.js} +124 -111
  186. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-TYHQCTZN.js} +5 -3
  187. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-BO7IVWAZ.js} +1 -1
  188. package/{machineCommands-HSQHDHOT.js → machineCommands-4WJUJQHW.js} +241 -321
  189. package/{machineWsRunDispatch-L6H7J66T.js → machineWsRunDispatch-V3U4JM67.js} +113 -102
  190. package/markdownToSlate-KIYM7B3P.js +8 -0
  191. package/mcpLocalAuthorizeCommand-TI656UWC.js +106 -0
  192. package/{memberThunks-7Y3OYSJQ.js → memberThunks-JFYC4Z5L.js} +20 -15
  193. package/{models-H5NNZRLH.js → models-EP7VG6N2.js} +2 -2
  194. package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
  195. package/package.json +1 -1
  196. package/{projectArchive-FQO654Z3.js → projectArchive-NU2Z5HOR.js} +45 -43
  197. package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-4H7YP5D7.js} +6 -6
  198. package/{providerRegistry-ZI2KORJ7.js → providerRegistry-F3UPOTIY.js} +6 -6
  199. package/{read-TYMBGEXO.js → read-BRZHXUJ6.js} +9 -8
  200. package/{readDocTool-SKQVHBLO.js → readDocTool-N7RVFQEE.js} +1 -1
  201. package/{readlineWorkspace-7U272DSA.js → readlineWorkspace-T56MRMS5.js} +6423 -3669
  202. package/rememberExplicit-CPAPONSI.js +15 -0
  203. package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-J7XU7OUX.js} +19 -18
  204. package/{runAgentClientLoop-AF4JQIJ7.js → runAgentClientLoop-O2GRCGRZ.js} +96 -76
  205. package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-RDRJXMXC.js} +8 -8
  206. package/{secretCommands-KZWBZIYS.js → secretCommands-2FEMRUFM.js} +3 -3
  207. package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-Q4V2ZZW2.js} +16 -15
  208. package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-742H5S6T.js} +19 -18
  209. package/{settingThunks-ZRGWVGZD.js → settingThunks-T4FXSV6M.js} +185 -66
  210. package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
  211. package/{spaceCommands-5VNWMDBE.js → spaceCommands-W5TAVFDT.js} +58 -51
  212. package/{streamAgentChatTurn-YSPEFY4K.js → streamAgentChatTurn-OWDJMU5E.js} +234 -177
  213. package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-HLDLHRRA.js} +17 -16
  214. package/{tableCommands-FTAOCBTX.js → tableCommands-44GC4N6J.js} +8 -5
  215. package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
  216. package/{tools-M35PTIFB.js → tools-O7SGGVA3.js} +65 -62
  217. package/{tuiRestart-2IL37YIB.js → tuiRestart-EOGC2BYY.js} +10 -10
  218. package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-TM5BU73J.js} +16 -15
  219. package/{updateCommands-CPATDG6J.js → updateCommands-FBYA5WVG.js} +3 -3
  220. package/{updateDialogTitleAction-IMIRJRQQ.js → updateDialogTitleAction-EXSZGTLL.js} +40 -38
  221. package/{usageCommand-2BF74MKF.js → usageCommand-L4OFWXEU.js} +2 -2
  222. package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-7JR33UHS.js} +3 -3
  223. package/webapi-QVV65DQF.js +2487 -0
  224. package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-M4V77OUB.js} +2 -2
  225. package/workContext-Y3ADAPZU.js +14 -0
  226. package/workContextAccess-VU5I4LKZ.js +11 -0
  227. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  228. package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-ZCSQCHG3.js} +2 -2
  229. package/agentRecordCommands-IZYUVHME.js +0 -177
  230. package/chunk-5ZMIIR23.js +0 -265
  231. package/chunk-62HXNQVV.js +0 -134
  232. package/chunk-TUSTONB3.js +0 -81
  233. package/chunk-ZXF6D3I6.js +0 -359
  234. package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
  235. /package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
@@ -1,26 +1,6 @@
1
1
  import {
2
2
  buildCliPrompt
3
3
  } from "./chunk-ATNTHIZI.js";
4
- import {
5
- applyImageConfigRuntimeOverride,
6
- buildDynamicContexts,
7
- buildForegroundTurnAdmissionFetchInit,
8
- buildStaticContexts,
9
- compressOldToolResults,
10
- consumeAgentRunStream,
11
- mergeAgentToolsWithRuntime,
12
- mergeContexts,
13
- projectDesktopToolUiContent,
14
- pushGate,
15
- resolveImageGenerationStreamingState,
16
- resolveTurnToolContext,
17
- targetForRunKind,
18
- validateAccessAndBalance,
19
- withRequestContextBlocks
20
- } from "./chunk-X3E6EHJW.js";
21
- import {
22
- resolveUserSkillRuntime
23
- } from "./chunk-ZXF6D3I6.js";
24
4
  import {
25
5
  buildEmptyCompletionRepairBody,
26
6
  buildFinalCompletionsRequestBody,
@@ -32,13 +12,13 @@ import {
32
12
  sendOpenAICompletionsRequest,
33
13
  serializeAgentRunMessages,
34
14
  updateTotalUsage
35
- } from "./chunk-MJI3UAXN.js";
15
+ } from "./chunk-6CXQ3YNJ.js";
36
16
  import "./chunk-JEXVIMYZ.js";
37
17
  import {
38
18
  inlineImageUrlsForCustomProvider,
39
19
  prepareTools,
40
20
  shouldInlineImageUrlsForAgent
41
- } from "./chunk-OTKSESZR.js";
21
+ } from "./chunk-IIOSZAJX.js";
42
22
  import {
43
23
  DirectApiKeyResolutionError,
44
24
  INVALID_TOOL_ARGS_REPLACEMENT,
@@ -50,39 +30,58 @@ import {
50
30
  sanitizeOutboundResponsesInput,
51
31
  selectResponsesConversationState,
52
32
  updateResponsesConversationState
53
- } from "./chunk-XTJKU3Z4.js";
33
+ } from "./chunk-VKCPKCSS.js";
54
34
  import "./chunk-HS7MLR74.js";
55
- import "./chunk-GAYNXB6T.js";
35
+ import {
36
+ selectMaxExecutionTime
37
+ } from "./chunk-FTWAOKFU.js";
56
38
  import {
57
39
  isGptProModel,
58
40
  isPlatformPaidAgentCall,
59
41
  shouldBlockForGptPro
60
- } from "./chunk-RRDRQOEC.js";
42
+ } from "./chunk-XCA4WHX5.js";
61
43
  import "./chunk-AMWMV56B.js";
62
- import "./chunk-6QHKRARD.js";
44
+ import "./chunk-MVOZ22RZ.js";
45
+ import "./chunk-WDWZPASX.js";
46
+ import "./chunk-OAZP4TSA.js";
47
+ import "./chunk-JFRJEPFI.js";
48
+ import {
49
+ applyImageConfigRuntimeOverride,
50
+ buildDynamicContexts,
51
+ buildForegroundTurnAdmissionFetchInit,
52
+ buildStaticContexts,
53
+ clearGateTurn,
54
+ compressOldToolResults,
55
+ consumeAgentRunStream,
56
+ mergeAgentToolsWithRuntime,
57
+ mergeContexts,
58
+ projectDesktopToolUiContent,
59
+ pushGate,
60
+ resolveImageGenerationStreamingState,
61
+ resolveTurnToolContext,
62
+ targetForRunKind,
63
+ validateAccessAndBalance,
64
+ withRequestContextBlocks
65
+ } from "./chunk-X22AUZKL.js";
66
+ import {
67
+ resolveUserSkillRuntime
68
+ } from "./chunk-XSRSAU3O.js";
63
69
  import {
64
70
  performServerProxyFetchWithRetry
65
- } from "./chunk-EGHP7KOY.js";
71
+ } from "./chunk-JU7VN4LF.js";
66
72
  import {
67
73
  createSSEParser,
68
- selectMaxExecutionTime,
69
74
  waitForAbortableDelay
70
- } from "./chunk-HF7BLF3F.js";
75
+ } from "./chunk-LMGFVH65.js";
71
76
  import "./chunk-NF64D32W.js";
72
- import "./chunk-RBPUNSG5.js";
73
- import "./chunk-4JVNURX4.js";
74
- import "./chunk-HYLRQDEE.js";
75
- import "./chunk-BP5ZJ6B4.js";
76
- import "./chunk-FJ23FZXF.js";
77
- import "./chunk-AGIM7IMJ.js";
78
- import "./chunk-63W5N6P3.js";
77
+ import "./chunk-UOUMPHS5.js";
78
+ import "./chunk-J2VIGDJN.js";
79
79
  import "./chunk-VF4K2QE6.js";
80
- import "./chunk-LYD6C7OU.js";
81
- import "./chunk-4QYJPWHH.js";
82
- import "./chunk-HXB4VDGK.js";
83
- import {
84
- getCurrentSpaceId
85
- } from "./chunk-547ENH5T.js";
80
+ import "./chunk-OLGFIQN2.js";
81
+ import "./chunk-CD64YXRB.js";
82
+ import "./chunk-AGIM7IMJ.js";
83
+ import "./chunk-ODBYGVO2.js";
84
+ import "./chunk-HCCQEMTK.js";
86
85
  import {
87
86
  addToolMessage,
88
87
  addUserMessage,
@@ -104,19 +103,40 @@ import {
104
103
  updateDialogSummaryAction,
105
104
  updateTokens,
106
105
  updateToolMessage
107
- } from "./chunk-7BCG67EI.js";
106
+ } from "./chunk-YFW4H6DL.js";
108
107
  import "./chunk-TZXPT53C.js";
109
108
  import "./chunk-BUDVRYES.js";
110
109
  import "./chunk-523DITKR.js";
111
- import "./chunk-WCFFRBL5.js";
110
+ import "./chunk-N74XL3NI.js";
111
+ import {
112
+ getCurrentSpaceId
113
+ } from "./chunk-FFFKAOJN.js";
112
114
  import "./chunk-BYXBJQAS.js";
113
- import "./chunk-QYPE3TS3.js";
114
115
  import {
115
116
  createCliChatTurnStream,
116
117
  getCliChatSession,
117
118
  startCliChatSession
118
- } from "./chunk-RG2DGNL6.js";
119
+ } from "./chunk-ARFCL53U.js";
119
120
  import "./chunk-5RGU3J7P.js";
121
+ import "./chunk-UVLYNWIE.js";
122
+ import "./chunk-YNIYE47Z.js";
123
+ import "./chunk-V4IYI3SB.js";
124
+ import "./chunk-UAD2WT54.js";
125
+ import {
126
+ patch,
127
+ read,
128
+ selectById,
129
+ write
130
+ } from "./chunk-HZDK56EK.js";
131
+ import "./chunk-3PVYUPXK.js";
132
+ import "./chunk-X3OZ655T.js";
133
+ import "./chunk-HXER7YJF.js";
134
+ import "./chunk-FGHEF6WI.js";
135
+ import "./chunk-DXWGFL2Z.js";
136
+ import "./chunk-3L2WKC3W.js";
137
+ import "./chunk-S25VJYXV.js";
138
+ import "./chunk-KQHEGELM.js";
139
+ import "./chunk-QYPE3TS3.js";
120
140
  import {
121
141
  addActiveController,
122
142
  claimDialogTurnPhase,
@@ -130,59 +150,36 @@ import {
130
150
  setDialogTurnPhase,
131
151
  subscribe,
132
152
  tokenUsageLiveUpdate
133
- } from "./chunk-S2NTVGA2.js";
134
- import "./chunk-UVLYNWIE.js";
135
- import "./chunk-YNIYE47Z.js";
136
- import "./chunk-5FUN7EG4.js";
137
- import "./chunk-5ZUOVCKT.js";
138
- import "./chunk-DXWGFL2Z.js";
139
- import "./chunk-3L2WKC3W.js";
140
- import "./chunk-TI2EPRHE.js";
141
- import {
142
- selectCurrentServer
143
- } from "./chunk-ATEKLSLR.js";
144
- import "./chunk-DEA37IUY.js";
145
- import "./chunk-UAD2WT54.js";
146
- import {
147
- patch,
148
- read,
149
- selectById,
150
- write
151
- } from "./chunk-CMMI3DAT.js";
152
- import "./chunk-3PVYUPXK.js";
153
- import "./chunk-DGYCDA6W.js";
154
- import "./chunk-4ZGPHFLE.js";
153
+ } from "./chunk-U35UUM5K.js";
154
+ import "./chunk-RD3QLZQV.js";
155
+ import "./chunk-ZM5AZTQG.js";
155
156
  import {
156
157
  selectRuntimeCurrentServer
157
- } from "./chunk-R6Z5S5GA.js";
158
+ } from "./chunk-WQDTSK5U.js";
158
159
  import "./chunk-UEILX4EV.js";
159
- import "./chunk-7Z6EW7AH.js";
160
+ import "./chunk-XJSEST7D.js";
161
+ import {
162
+ selectCurrentServer
163
+ } from "./chunk-MTM4LRVG.js";
164
+ import "./chunk-6XVPMGXK.js";
160
165
  import {
161
166
  getIsDesktopApp
162
- } from "./chunk-4N6G2CKP.js";
167
+ } from "./chunk-YHNUDTU4.js";
168
+ import "./chunk-YJPK35HB.js";
169
+ import "./chunk-QQ56R7KS.js";
163
170
  import {
164
171
  selectIdentityToken,
165
172
  selectIdentityUser,
166
173
  selectIdentityUserId
167
174
  } from "./chunk-PXYBUFDB.js";
168
- import "./chunk-QQ56R7KS.js";
169
175
  import "./chunk-GBWGPTA7.js";
170
- import "./chunk-OOJNQK6V.js";
171
- import "./chunk-HXER7YJF.js";
172
- import "./chunk-BV3FLP2L.js";
173
176
  import {
174
177
  applyPublicAgentCatalogOverride
175
- } from "./chunk-DBUR22G5.js";
178
+ } from "./chunk-MZVCFV3T.js";
176
179
  import {
177
180
  applyBuiltinAgentRuntimeOverride,
178
181
  resolveBuiltinPlatformAgentRecord
179
- } from "./chunk-S6K5F3KP.js";
180
- import "./chunk-SRCCSTIM.js";
181
- import {
182
- getPublicImageAgentDefaultProfile,
183
- getPublicImageAgentMode
184
- } from "./chunk-VIDPVFP3.js";
185
- import "./chunk-4JH2UMJR.js";
182
+ } from "./chunk-JP2BH4NC.js";
186
183
  import {
187
184
  assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets,
188
185
  buildDesktopAgentRuntimeAgentConfigSnapshot,
@@ -190,109 +187,118 @@ import {
190
187
  evaluateRequestBudget,
191
188
  extractImageUrlsFromMessages,
192
189
  stripImagePartsForTextOnlyAgent
193
- } from "./chunk-XAG3FWBE.js";
194
- import "./chunk-BYXBJQAS.js";
195
- import "./chunk-DUUDXSLX.js";
190
+ } from "./chunk-4OXPN3WC.js";
196
191
  import {
197
192
  projectUserPartForModel
198
- } from "./chunk-QYB23WUH.js";
193
+ } from "./chunk-2FK2KZSL.js";
199
194
  import "./chunk-56GBUMO5.js";
200
- import "./chunk-FPBJM2BW.js";
195
+ import "./chunk-Z7KE4K3H.js";
196
+ import "./chunk-ITBX27W6.js";
197
+ import "./chunk-KXOPLLFP.js";
198
+ import "./chunk-QJTZ76CP.js";
201
199
  import {
202
200
  extractImagePartsFromResponseOutput,
203
201
  extractTextFromResponseOutput,
204
202
  toResponsesTools
205
- } from "./chunk-EEOOBRA7.js";
203
+ } from "./chunk-W3HSD32M.js";
206
204
  import "./chunk-X4O7FJF5.js";
207
- import "./chunk-MNEZUL5S.js";
208
- import "./chunk-QJTZ76CP.js";
209
- import {
210
- resolveRuntimeToolSurfaceForAgent
211
- } from "./chunk-VS276URX.js";
205
+ import "./chunk-BYXBJQAS.js";
206
+ import "./chunk-SX6AWTNK.js";
212
207
  import {
213
208
  isContextOverflowText,
214
209
  parseApiError
215
210
  } from "./chunk-TLE77UJ5.js";
211
+ import "./chunk-WFGNWWJI.js";
216
212
  import {
217
213
  resolveAgentCallPlan,
218
214
  resolveClientWire
219
- } from "./chunk-OBIC6EG7.js";
220
- import "./chunk-WFGNWWJI.js";
221
- import "./chunk-FJSNBZXR.js";
215
+ } from "./chunk-VUHKG4KS.js";
216
+ import "./chunk-YDRRGVT5.js";
222
217
  import {
223
218
  resolveAgentContextWindow
224
- } from "./chunk-QRGDJA4B.js";
219
+ } from "./chunk-LTVEOOZL.js";
225
220
  import "./chunk-5ZUL4CUO.js";
226
221
  import {
227
222
  getModelInfo
228
- } from "./chunk-L32W3PRP.js";
223
+ } from "./chunk-MAA42MMV.js";
229
224
  import "./chunk-H57T64RA.js";
230
225
  import "./chunk-UKZX3NHN.js";
226
+ import "./chunk-SR4FE5VD.js";
231
227
  import "./chunk-5MMAK75Q.js";
232
228
  import "./chunk-USGHJSGO.js";
229
+ import "./chunk-E6A5NHDH.js";
233
230
  import {
234
231
  asRecordOrEmpty
235
232
  } from "./chunk-KX6YBIHG.js";
236
- import "./chunk-OQHIVPG4.js";
237
- import "./chunk-DWLEOOGR.js";
238
- import {
239
- isAbortError
240
- } from "./chunk-7DPNBQSV.js";
241
- import "./chunk-OW765XBU.js";
242
233
  import "./chunk-EWQ3HGNZ.js";
243
234
  import {
244
235
  estimateTokenCount
245
236
  } from "./chunk-PSCNXBYA.js";
237
+ import "./chunk-DWLEOOGR.js";
238
+ import "./chunk-OW765XBU.js";
239
+ import {
240
+ isAbortError
241
+ } from "./chunk-7DPNBQSV.js";
242
+ import "./chunk-YGDYYFRX.js";
243
+ import "./chunk-2SXN7LAY.js";
246
244
  import "./chunk-G7Y4GXTY.js";
247
245
  import "./chunk-6UBGXX2W.js";
248
- import "./chunk-G7IUT2V3.js";
249
- import "./chunk-6OVNSQHN.js";
250
- import "./chunk-W6RFEDN4.js";
251
- import "./chunk-EVGU5P4U.js";
252
- import {
253
- isSystemBuiltinTrustedAgentKey
254
- } from "./chunk-ILHQ2AXT.js";
255
- import {
256
- extractCustomId
257
- } from "./chunk-M2EJHDJP.js";
246
+ import "./chunk-BV3FLP2L.js";
247
+ import "./chunk-6MTVACLN.js";
248
+ import "./chunk-AETZ7AD6.js";
249
+ import "./chunk-CO6E7YK6.js";
250
+ import "./chunk-KHCLMKZZ.js";
258
251
  import "./chunk-SYTHYBMI.js";
259
252
  import {
260
253
  createDialogMessageKeyAndId,
261
254
  dialogMessageKey
262
255
  } from "./chunk-OJKUU3LP.js";
263
256
  import "./chunk-YZMNK53S.js";
257
+ import {
258
+ resolveRuntimeToolSurfaceForAgent
259
+ } from "./chunk-NEG5LYK5.js";
260
+ import "./chunk-YLAHYLDQ.js";
261
+ import {
262
+ isSystemBuiltinTrustedAgentKey
263
+ } from "./chunk-KZAT2M2V.js";
264
+ import {
265
+ extractCustomId
266
+ } from "./chunk-M2EJHDJP.js";
264
267
  import "./chunk-I42VC5KR.js";
268
+ import "./chunk-AS6L5KSD.js";
269
+ import {
270
+ getPublicImageAgentDefaultProfile,
271
+ getPublicImageAgentMode
272
+ } from "./chunk-VIDPVFP3.js";
273
+ import "./chunk-4JH2UMJR.js";
265
274
  import "./chunk-U6VC4MU4.js";
266
- import "./chunk-42OKN2LI.js";
267
- import "./chunk-JQZRSXS5.js";
268
- import "./chunk-KHCLMKZZ.js";
269
275
  import "./chunk-LCBAMY2M.js";
270
- import "./chunk-62HXNQVV.js";
271
- import "./chunk-7JGMNKKG.js";
272
- import "./chunk-RTHFJZ6M.js";
273
- import {
274
- isOpenAiResponsesModel
275
- } from "./chunk-HBRDSQ3M.js";
276
+ import "./chunk-6ASGEP5D.js";
277
+ import "./chunk-CTWCZKNS.js";
276
278
  import {
277
279
  toErrorMessage
278
280
  } from "./chunk-HNMXYYJR.js";
281
+ import "./chunk-K26XPZRB.js";
282
+ import {
283
+ isOpenAiResponsesModel
284
+ } from "./chunk-ESN4WNWU.js";
279
285
  import {
280
286
  asTrimmedString
281
287
  } from "./chunk-3EUW3WEO.js";
288
+ import "./chunk-WWC7I6TA.js";
282
289
  import {
283
290
  getApiEndpoint
284
- } from "./chunk-CD3RU7XL.js";
291
+ } from "./chunk-CD2DK5JA.js";
285
292
  import "./chunk-JRTNUU5Z.js";
286
293
  import {
287
294
  isRecord
288
295
  } from "./chunk-KUG52IAP.js";
289
- import "./chunk-WWC7I6TA.js";
290
296
  import {
291
297
  asOptionalTrimmedString
292
298
  } from "./chunk-G3SUCT4W.js";
293
299
  import "./chunk-4SN6J65J.js";
294
300
  import "./chunk-CF7PE763.js";
295
- import "./chunk-OBSEKCVK.js";
301
+ import "./chunk-PQ63BDV3.js";
296
302
  import "./chunk-QSJ3HFEF.js";
297
303
  import "./chunk-U67V476Y.js";
298
304
 
@@ -533,7 +539,8 @@ var sendOpenAIResponseRequest = async ({
533
539
  parentMessageId,
534
540
  messageMetadata,
535
541
  quickChatPerfStartedAt,
536
- fallbackBodyData
542
+ fallbackBodyData,
543
+ userMessageId
537
544
  }) => {
538
545
  const { dispatch, getState, signal: thunkSignal } = thunkApi;
539
546
  const dialogId = extractCustomId(dialogKey);
@@ -766,7 +773,8 @@ var sendOpenAIResponseRequest = async ({
766
773
  agentConfig,
767
774
  messageId,
768
775
  dialogId,
769
- dialogKey
776
+ dialogKey,
777
+ userMessageId
770
778
  })
771
779
  ).unwrap();
772
780
  state.content = Array.isArray(result.finalContentBuffer) ? result.finalContentBuffer.filter((part) => part?.type === "text").map((part) => part.text ?? "").join("") : state.content;
@@ -1323,6 +1331,7 @@ async function* runDesktopAgentRuntimeTurnStream({
1323
1331
  fetchImpl = fetch,
1324
1332
  signal,
1325
1333
  noEventWatchdogMs,
1334
+ authToken,
1326
1335
  ...args
1327
1336
  }) {
1328
1337
  try {
@@ -1330,9 +1339,13 @@ async function* runDesktopAgentRuntimeTurnStream({
1330
1339
  yield { type: "error", error: "The operation was aborted." };
1331
1340
  return;
1332
1341
  }
1342
+ const trimmedAuthToken = asTrimmedString(authToken) ?? "";
1333
1343
  const response = await fetchImpl("/api/desktop/agent-runtime/turn", {
1334
1344
  method: "POST",
1335
- headers: { "Content-Type": "application/json" },
1345
+ headers: {
1346
+ "Content-Type": "application/json",
1347
+ ...trimmedAuthToken ? { Authorization: `Bearer ${trimmedAuthToken}` } : {}
1348
+ },
1336
1349
  body: JSON.stringify(buildDesktopAgentRuntimeTurnBody(args)),
1337
1350
  signal
1338
1351
  });
@@ -2048,7 +2061,45 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2048
2061
  let loopKey = null;
2049
2062
  let runtimeDialogKey = explicitDialogKey ?? null;
2050
2063
  let turnPhaseTurnId = null;
2064
+ const secretGateTurnId = createDialogMessageKeyAndId("secret-gate").messageId;
2065
+ const secretGateAnchors = /* @__PURE__ */ new Set();
2066
+ const receiveActionGate = (gate, target, dialogId) => {
2067
+ const secret = gate.kind === "input" && gate.payload?.action === "secret_request";
2068
+ if (!secret || target?.kind === "local") {
2069
+ pushGate(gate, target);
2070
+ return;
2071
+ }
2072
+ const { messageId, key } = createDialogMessageKeyAndId(dialogId);
2073
+ secretGateAnchors.add(messageId);
2074
+ pushGate(gate, target, { dialogId, turnId: secretGateTurnId, messageId });
2075
+ dispatch(messageStreaming({
2076
+ id: messageId,
2077
+ dbKey: key,
2078
+ dialogId,
2079
+ role: "tool",
2080
+ toolName: "secret-request",
2081
+ content: "",
2082
+ isStreaming: true
2083
+ }));
2084
+ };
2051
2085
  const batchExecution = createUserBatchExecution(loopController.signal, () => !thunkApi.signal.aborted && (!turnPhaseTurnId || !runtimeDialogKey || getDialogRuntimeState(runtimeDialogKey).turnPhaseTurnId === turnPhaseTurnId));
2086
+ const workMemoryUserMessageId = (dialogId, activeId) => {
2087
+ if (!activeId) return void 0;
2088
+ const users = selectAllMsgs(getState(), dialogId).filter((message) => message.role === "user");
2089
+ const bound = users.find((message) => message.id === activeId);
2090
+ if (!bound || bound.metadata?.queueState === "pending") return void 0;
2091
+ const receipt = bound.metadata?.userBatchReceipt;
2092
+ if (receipt) {
2093
+ const ids = receipt.messageIds;
2094
+ return Array.isArray(ids) && ids.length === 1 && ids[0] === activeId ? activeId : void 0;
2095
+ }
2096
+ const batchId = bound.metadata?.acceptedUserBatchId;
2097
+ if (batchId) {
2098
+ const batch = users.filter((message) => message.metadata?.acceptedUserBatchId === batchId);
2099
+ return batch.length === 1 && batch[0]?.id === activeId ? activeId : void 0;
2100
+ }
2101
+ return activeId;
2102
+ };
2052
2103
  let remoteTransientMessageId = null;
2053
2104
  let remoteTransientMessageFinalized = false;
2054
2105
  let modelRequestStarted = false;
@@ -2254,7 +2305,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2254
2305
  runtime: "react",
2255
2306
  entrypoint: "chat-dialog",
2256
2307
  capabilities: ["streaming", "dialog-ui", "machine-bound-cli", "durable-user-batch", "client-user-prepersisted"],
2257
- userMessageId: selectAdmittedMessages(selectAllMsgs(getState(), dialogId2)).filter((message) => message.role === "user").at(-1)?.id
2308
+ ...args.userMessageId ? { userMessageId: args.userMessageId } : {}
2258
2309
  },
2259
2310
  ...dialogConfig?.spaceId ? { spaceId: dialogConfig.spaceId } : {}
2260
2311
  }),
@@ -2302,12 +2353,13 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2302
2353
  return { reject: payload.message || "\u7535\u8111\u7AEF Agent \u6267\u884C\u5931\u8D25" };
2303
2354
  }
2304
2355
  if (payload.type === "action_gate" && payload.gate) {
2305
- pushGate(
2356
+ receiveActionGate(
2306
2357
  payload.gate,
2307
2358
  targetForRunKind("server-run", {
2308
2359
  server: currentServer2,
2309
2360
  token
2310
- })
2361
+ }),
2362
+ dialogId2
2311
2363
  );
2312
2364
  }
2313
2365
  remoteToolHandlers.handleToolPayload(payload);
@@ -2717,6 +2769,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2717
2769
  };
2718
2770
  try {
2719
2771
  const desktopAgentRef = agentConfig.dbKey || agentKey;
2772
+ const desktopTurnAuthToken = selectIdentityToken(getState());
2720
2773
  const eventStream = await dispatch(runPendingUserBatchRequest({
2721
2774
  dialogKey,
2722
2775
  signal: loopController.signal,
@@ -2754,7 +2807,8 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2754
2807
  // 未分类的 "stream stalled" 而不是 runtime 的
2755
2808
  // LLM_REQUEST_TIMEOUT 可操作文案。取 2× = 20 分钟:
2756
2809
  // 只兜「runtime 完全没 deadline」的真悬挂。
2757
- noEventWatchdogMs: DESKTOP_SSE_NO_EVENT_WATCHDOG_MS
2810
+ noEventWatchdogMs: DESKTOP_SSE_NO_EVENT_WATCHDOG_MS,
2811
+ ...desktopTurnAuthToken ? { authToken: desktopTurnAuthToken } : {}
2758
2812
  });
2759
2813
  const first = iterator.next();
2760
2814
  return async function* () {
@@ -2859,9 +2913,10 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
2859
2913
  } else if (event.type === "execution_location") {
2860
2914
  desktopToolExecutionLocation = event.location;
2861
2915
  } else if (event.type === "action_gate") {
2862
- pushGate(
2916
+ receiveActionGate(
2863
2917
  event.gate,
2864
- targetForRunKind("desktop-local")
2918
+ targetForRunKind("desktop-local"),
2919
+ dialogId
2865
2920
  );
2866
2921
  } else if (event.type === "done") {
2867
2922
  streamResult = event.result;
@@ -3259,12 +3314,13 @@ ${info.actionHint}` : streamError;
3259
3314
  return { reject: payload.message || "\u8FDC\u7AEF Agent \u6267\u884C\u5931\u8D25" };
3260
3315
  }
3261
3316
  if (payload.type === "action_gate" && payload.gate) {
3262
- pushGate(
3317
+ receiveActionGate(
3263
3318
  payload.gate,
3264
3319
  targetForRunKind("server-run", {
3265
3320
  server: explicitServerBase,
3266
3321
  token
3267
- })
3322
+ }),
3323
+ dialogId
3268
3324
  );
3269
3325
  }
3270
3326
  if (payload.type === "agent_handoff") {
@@ -3370,7 +3426,8 @@ ${info.actionHint}` : streamError;
3370
3426
  referencedTools: referenceTools,
3371
3427
  recommendedSkillTools: turnToolContext.recommendedSkillTools,
3372
3428
  recommendedSkillHints: turnToolContext.recommendedSkillHints,
3373
- skillPromptPatches: turnToolContext.skillPromptPatches
3429
+ skillPromptPatches: turnToolContext.skillPromptPatches,
3430
+ skillPromptContributions: turnToolContext.skillPromptContributions
3374
3431
  };
3375
3432
  const initialRawMsgs = selectAdmittedMessages(selectAllMsgs(state, dialogId));
3376
3433
  const initialHistoryIds = new Set(initialRawMsgs.map((m) => m.id));
@@ -3420,7 +3477,7 @@ ${info.actionHint}` : streamError;
3420
3477
  responseApi: true
3421
3478
  });
3422
3479
  let appendTempUserInput2 = true;
3423
- let activeTurnUserMessageId2;
3480
+ let activeTurnUserMessageId2 = args.userMessageId;
3424
3481
  let currentParentMessageId2 = parentMessageId ?? void 0;
3425
3482
  const storedResponsesState = currentDialog?.responsesState;
3426
3483
  let responsesState = selectResponsesConversationState(
@@ -3554,12 +3611,6 @@ ${info.actionHint}` : streamError;
3554
3611
  isStreaming: false
3555
3612
  }
3556
3613
  ];
3557
- activeTurnUserMessageId2 = tempId;
3558
- } else {
3559
- const lastMsg = visibleMessages[visibleMessages.length - 1];
3560
- if (lastMsg && typeof lastMsg.id === "string") {
3561
- activeTurnUserMessageId2 = lastMsg.id;
3562
- }
3563
3614
  }
3564
3615
  }
3565
3616
  const requestUserInput = snapshotUserBatchInput(selectAllMsgs(loopState, dialogId));
@@ -3620,24 +3671,28 @@ ${info.actionHint}` : streamError;
3620
3671
  dynamicMessageCount: dynamicMessages.length,
3621
3672
  stableMessageCount: stableMessages.length
3622
3673
  });
3623
- modelRequestStarted = true;
3624
3674
  const meta = await dispatch(runPendingUserBatchRequest({
3625
3675
  dialogKey,
3626
3676
  signal: loopController.signal,
3627
3677
  execution: batchExecution,
3628
3678
  requestUserInput,
3629
- start: () => sendOpenAIResponseRequest({
3630
- bodyData,
3631
- agentConfig: agentConfigForCall,
3632
- thunkApi,
3633
- dialogKey,
3634
- parentMessageId: currentParentMessageId2,
3635
- messageMetadata: streamingMessageMetadata,
3636
- quickChatPerfStartedAt,
3637
- fallbackBodyData
3638
- })
3679
+ start: () => {
3680
+ modelRequestStarted = true;
3681
+ return sendOpenAIResponseRequest({
3682
+ bodyData,
3683
+ agentConfig: agentConfigForCall,
3684
+ thunkApi,
3685
+ dialogKey,
3686
+ parentMessageId: currentParentMessageId2,
3687
+ messageMetadata: streamingMessageMetadata,
3688
+ quickChatPerfStartedAt,
3689
+ fallbackBodyData,
3690
+ userMessageId: workMemoryUserMessageId(dialogId, activeTurnUserMessageId2)
3691
+ });
3692
+ }
3639
3693
  })).unwrap();
3640
- if (!meta || loopController.signal.aborted || thunkApi.signal.aborted) break;
3694
+ if (isTurnAborted()) return { aborted: true };
3695
+ if (!meta) throw new Error("Model request returned no result; reply did not complete");
3641
3696
  logQuickChatPerfStage2(quickChatPerfStartedAt, "stream-agent-model-request-finished", {
3642
3697
  responseApi: true,
3643
3698
  hasToolCalls: meta.hasToolCalls,
@@ -3744,7 +3799,7 @@ ${info.actionHint}` : streamError;
3744
3799
  responseApi: false
3745
3800
  });
3746
3801
  let appendTempUserInput = true;
3747
- let activeTurnUserMessageId;
3802
+ let activeTurnUserMessageId = args.userMessageId;
3748
3803
  let currentParentMessageId = parentMessageId ?? void 0;
3749
3804
  const w = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
3750
3805
  if (w) w.__LOOP_STOP_REASON__ = null;
@@ -3867,12 +3922,6 @@ ${info.actionHint}` : streamError;
3867
3922
  isStreaming: false
3868
3923
  }
3869
3924
  ];
3870
- activeTurnUserMessageId = tempId;
3871
- } else {
3872
- const lastMsg = visibleMessages[visibleMessages.length - 1];
3873
- if (lastMsg && typeof lastMsg.id === "string") {
3874
- activeTurnUserMessageId = lastMsg.id;
3875
- }
3876
3925
  }
3877
3926
  }
3878
3927
  const requestUserInput = snapshotUserBatchInput(selectAllMsgs(loopState, dialogId));
@@ -3932,7 +3981,6 @@ ${info.actionHint}` : streamError;
3932
3981
  dynamicMessageCount: dynamicMessages.length,
3933
3982
  stableMessageCount: stableMessages.length
3934
3983
  });
3935
- modelRequestStarted = true;
3936
3984
  const disableToolsForThisRequest = shouldDisableQuickChatToolsForDirectAnswer(
3937
3985
  quickChatPerfStartedAt,
3938
3986
  userInput,
@@ -3954,18 +4002,23 @@ ${info.actionHint}` : streamError;
3954
4002
  signal: loopController.signal,
3955
4003
  execution: batchExecution,
3956
4004
  requestUserInput,
3957
- start: () => sendOpenAICompletionsRequest({
3958
- bodyData,
3959
- agentConfig: agentConfigForCall,
3960
- thunkApi,
3961
- dialogKey,
3962
- parentMessageId: currentParentMessageId,
3963
- messageMetadata: streamingMessageMetadata,
3964
- disableToolsForThisRequest,
3965
- quickChatPerfStartedAt
3966
- })
4005
+ start: () => {
4006
+ modelRequestStarted = true;
4007
+ return sendOpenAICompletionsRequest({
4008
+ bodyData,
4009
+ agentConfig: agentConfigForCall,
4010
+ thunkApi,
4011
+ dialogKey,
4012
+ parentMessageId: currentParentMessageId,
4013
+ messageMetadata: streamingMessageMetadata,
4014
+ disableToolsForThisRequest,
4015
+ quickChatPerfStartedAt,
4016
+ userMessageId: workMemoryUserMessageId(dialogId, activeTurnUserMessageId)
4017
+ });
4018
+ }
3967
4019
  })).unwrap();
3968
- if (!meta || loopController.signal.aborted || thunkApi.signal.aborted) break;
4020
+ if (isTurnAborted()) return { aborted: true };
4021
+ if (!meta) throw new Error("Model request returned no result; reply did not complete");
3969
4022
  logQuickChatPerfStage2(quickChatPerfStartedAt, "stream-agent-model-request-finished", {
3970
4023
  responseApi: false,
3971
4024
  hasToolCalls: meta.hasToolCalls,
@@ -4021,6 +4074,8 @@ ${info.actionHint}` : streamError;
4021
4074
  break;
4022
4075
  }
4023
4076
  }
4077
+ if (isTurnAborted()) return { aborted: true };
4078
+ if (!modelRequestStarted) throw new Error("Model request did not start; reply did not complete");
4024
4079
  return {
4025
4080
  usage: totalTurnUsage ?? void 0
4026
4081
  };
@@ -4069,6 +4124,8 @@ ${info.actionHint}` : streamError;
4069
4124
  );
4070
4125
  } finally {
4071
4126
  batchExecution.dispose();
4127
+ clearGateTurn(secretGateTurnId);
4128
+ for (const id of secretGateAnchors) dispatch(removeTransientMessage(id));
4072
4129
  clearDialogTurnPhase({ dialogKey: runtimeDialogKey ?? void 0, turnId: turnPhaseTurnId ?? void 0 });
4073
4130
  if (loopKey && runtimeDialogKey) {
4074
4131
  dispatch(removeActiveController({ messageId: loopKey, dialogKey: runtimeDialogKey }));