nolo-cli 0.107.0-alpha.4 → 0.107.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 (211) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UDCSOTD2.js → _executeModel-M573MKVE.js} +78 -70
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-MB2HHMDZ.js → addContentAction-M2WOWZCL.js} +13 -12
  5. package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-QMAQ5Z6N.js} +19 -20
  6. package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-ZFHYRHBS.js} +118 -43
  7. package/{agentEmailCommands-AU5I4M4W.js → agentEmailCommands-X6AVPIVQ.js} +100 -90
  8. package/agentListCommands-PAD2CI2I.js +741 -0
  9. package/{agentMachineCommands-YMNME2L6.js → agentMachineCommands-UPH6RJCC.js} +50 -46
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-CMVTBY5X.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-UMACPRAF.js +138 -0
  13. package/agentRunCommand-H6KKHHMU.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-N4YGKL7M.js} +44 -40
  16. package/{agentSlice-R7PR6KYM.js → agentSlice-2LPP43XH.js} +15 -14
  17. package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-7DAF33AM.js} +46 -42
  18. package/{appDeployCommands-UTB76XFM.js → appDeployCommands-ZPZSMFGZ.js} +46 -42
  19. package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-FWBDSSS5.js} +46 -42
  20. package/{appGetCommands-PX2BFHOB.js → appGetCommands-SZZOHGEP.js} +46 -42
  21. package/{appListCommands-BSMPTWKC.js → appListCommands-FPMUBDPM.js} +46 -42
  22. package/{authCommand-YW42YZA4.js → authCommand-VL3G26NQ.js} +119 -25
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZK4K67Y5.js} +11 -9
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  28. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  29. package/{chunk-QTGQ2LTL.js → chunk-3DQY5IFB.js} +6 -10
  30. package/{chunk-XT35TTFG.js → chunk-3IXAHOJS.js} +19 -21
  31. package/{chunk-UVA7OYO3.js → chunk-3W67RV75.js} +29 -9
  32. package/chunk-4LCOCOR5.js +50 -0
  33. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  34. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  35. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  36. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  37. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  38. package/{chunk-C3M4465B.js → chunk-5HYJ3DSZ.js} +404 -659
  39. package/chunk-5MMAK75Q.js +15 -0
  40. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  41. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  42. package/{chunk-4MK3I7Y4.js → chunk-6MAW4XOF.js} +5 -5
  43. package/{chunk-3UZPUAES.js → chunk-74PPKIY2.js} +1 -1
  44. package/chunk-76HO2DP6.js +15 -0
  45. package/{chunk-ASIFZ2WY.js → chunk-7BBP7ZX3.js} +66 -54
  46. package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
  47. package/{chunk-IBOZNTG2.js → chunk-7X5XZ34C.js} +23 -28
  48. package/chunk-AGIM7IMJ.js +147 -0
  49. package/{chunk-5UTFL4QJ.js → chunk-APO5TOXO.js} +1 -1
  50. package/{chunk-EEGDMATE.js → chunk-AZOVPTL6.js} +91 -81
  51. package/{chunk-6OZ36FXI.js → chunk-BIPGGSJS.js} +22 -4
  52. package/{chunk-EYAQT56M.js → chunk-BNQMNUKZ.js} +9 -6
  53. package/{chunk-62CATUYY.js → chunk-CBUMFIFE.js} +834 -962
  54. package/{chunk-OIVSQH2O.js → chunk-CDEEFJXN.js} +308 -11
  55. package/chunk-CHOZJMJS.js +78 -0
  56. package/{chunk-ETI2NYVF.js → chunk-CIP3AAMT.js} +4 -4
  57. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  58. package/{chunk-W7HLWAQ7.js → chunk-DE45KZNH.js} +118 -90
  59. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  60. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  61. package/{chunk-HKNXJGEC.js → chunk-ECFHBYUW.js} +85 -50
  62. package/{chunk-ACTMNVHM.js → chunk-EHSYSKXV.js} +1 -1
  63. package/{chunk-WV42OMV7.js → chunk-ELUDRSRD.js} +8 -8
  64. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  65. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  66. package/{chunk-BFDFRLLQ.js → chunk-EZ4VZHAG.js} +5 -5
  67. package/{chunk-GO3Z72MT.js → chunk-FHLMQIU7.js} +65 -95
  68. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  69. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  70. package/chunk-GMZLP5DV.js +82 -0
  71. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  72. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  73. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  74. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  75. package/{chunk-BNGW5ASC.js → chunk-I2RGRVQ7.js} +22 -2
  76. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  77. package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
  78. package/{chunk-GQBOR3G6.js → chunk-JBKHQOYK.js} +8 -4
  79. package/{chunk-XD2MJFUG.js → chunk-JEFXP73H.js} +1 -1
  80. package/{chunk-PBA4UJBK.js → chunk-JIXGJTBU.js} +4 -4
  81. package/{chunk-AEOE4Z6Q.js → chunk-K6L5PNXK.js} +39 -15
  82. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  83. package/{chunk-GPCZ7UXG.js → chunk-KD6D6BLA.js} +1 -1
  84. package/{chunk-4CR5I7BD.js → chunk-KFWDYYSS.js} +47 -67
  85. package/{chunk-UZGQNTVW.js → chunk-KHKTDMYG.js} +8 -6
  86. package/{chunk-JDPFV2JV.js → chunk-KWUKOQM2.js} +20 -11
  87. package/{chunk-MRIHM22T.js → chunk-LBFL6RZG.js} +58 -9
  88. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  89. package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
  90. package/{chunk-NA35QHCF.js → chunk-LVBFKW65.js} +1 -1
  91. package/chunk-LWLNLZC5.js +265 -0
  92. package/chunk-N4NGJDT6.js +929 -0
  93. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  94. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  95. package/chunk-NWENLDMM.js +42 -0
  96. package/chunk-O7SVKKLY.js +875 -0
  97. package/chunk-OCZKATRC.js +129 -0
  98. package/{chunk-6Z7MY3V7.js → chunk-OEJLGVBL.js} +5 -5
  99. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  100. package/{chunk-GEPUP7OO.js → chunk-OR2UWD6X.js} +3 -3
  101. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  102. package/{chunk-J4MOO56S.js → chunk-PNXHPLRU.js} +10 -2
  103. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  104. package/{chunk-P5EVSOPA.js → chunk-R6EBQEQE.js} +22 -29
  105. package/chunk-RQ6CTX2E.js +164 -0
  106. package/{chunk-MS7TSPZR.js → chunk-RU36ZYSG.js} +19 -17
  107. package/{chunk-ALXHV7NK.js → chunk-RWXLPUKI.js} +40 -4
  108. package/{chunk-KQ4ONNQD.js → chunk-RXA3HAVW.js} +190 -8
  109. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  110. package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
  111. package/{chunk-JRQFUXY7.js → chunk-TBAXFWOS.js} +99 -22
  112. package/{chunk-PQFHGD77.js → chunk-TBM2RS3U.js} +161 -14
  113. package/{chunk-NOF3HDSN.js → chunk-TFOIJFCM.js} +11 -9
  114. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  115. package/chunk-TY3TIUJK.js +89 -0
  116. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  117. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  118. package/chunk-UM7TA3K4.js +1008 -0
  119. package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
  120. package/{chunk-GL3EHUR4.js → chunk-VHGYUYQ3.js} +69 -47
  121. package/chunk-VIWDGTDA.js +8 -0
  122. package/chunk-VJVNU77E.js +83 -0
  123. package/chunk-VM6IE2GN.js +8004 -0
  124. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  125. package/chunk-VZLO4XJD.js +17 -0
  126. package/chunk-W32HPLTL.js +13692 -0
  127. package/{chunk-AHAHBQMU.js → chunk-WDLSZMTA.js} +2 -2
  128. package/{chunk-53HEEOTT.js → chunk-WF5X57VW.js} +83 -16
  129. package/{chunk-VRTTFDBM.js → chunk-WPHY3VPF.js} +35 -22
  130. package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
  131. package/chunk-YV25TM3R.js +780 -0
  132. package/chunk-ZRAU6T47.js +56 -0
  133. package/{chunk-IBOOZVVD.js → chunk-ZTKZZY2A.js} +851 -279
  134. package/commandRegistry-ASW6IVZ3.js +833 -0
  135. package/{contentThunks-IV2T3EJC.js → contentThunks-4XNVOIR7.js} +39 -36
  136. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  137. package/{createAgentAutomationAction-JCOIEYY4.js → createAgentAutomationAction-NHHTCJMC.js} +40 -37
  138. package/createDialogAction-XEBTHDB3.js +70 -0
  139. package/{createPageAction-D2VOOLP3.js → createPageAction-VR3WW2AQ.js} +47 -43
  140. package/{chunk-FG3HKPQP.js → cursorProvider-YGGNMVWX.js} +2751 -10185
  141. package/{dbSlice-A6C6H32X.js → dbSlice-TG4MZ5EB.js} +12 -11
  142. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  143. package/{dialogCommands-H7FPUYUQ.js → dialogCommands-FJWQG3MX.js} +50 -47
  144. package/{dialogSlice-6JZOOTDS.js → dialogSlice-GVRDGCRG.js} +57 -37
  145. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  146. package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-AZSK4NAG.js} +48 -44
  147. package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-DDJMSMFZ.js} +49 -45
  148. package/{docReadCommands-WJN3WT6O.js → docReadCommands-5F5Q6EBZ.js} +47 -43
  149. package/{docStore-HUPQ2FSS.js → docStore-SUZUUWDI.js} +17 -13
  150. package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-XPNPVZOC.js} +48 -44
  151. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  152. package/{getPricing-LUSEABA6.js → getPricing-DOBBZLOK.js} +4 -4
  153. package/{handleSendMessageAction-DFPMQ7YM.js → handleSendMessageAction-VC6VTFKS.js} +109 -42
  154. package/index.js +87 -884
  155. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  156. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  157. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  158. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  159. package/{machineCommands-M2T2I5NF.js → machineCommands-M634V2L3.js} +98 -89
  160. package/machineWsRunDispatch-Z3HUSTFI.js +154 -0
  161. package/{memberThunks-P2ECUJ56.js → memberThunks-5S5D3N4U.js} +20 -18
  162. package/{models-T3SG6MJ5.js → models-PQU25T6Q.js} +2 -2
  163. package/oauthTokenStore-ITEB663N.js +23 -0
  164. package/package.json +1 -1
  165. package/processSpawn-SOAV3FEV.js +11 -0
  166. package/profileConfig-ZGOFORWV.js +43 -0
  167. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HAQWVAQX.js} +7 -7
  168. package/{providerRegistry-757OWH3O.js → providerRegistry-5FGWB3X5.js} +11 -7
  169. package/{read-COE3ZYR6.js → read-LSYFLSIM.js} +8 -7
  170. package/{readDocTool-5USN4A6V.js → readDocTool-XWRXV3DR.js} +5 -3
  171. package/{readlineWorkspace-XQRDGWRZ.js → readlineWorkspace-J3YD3DNW.js} +2596 -2032
  172. package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-4TEFC3VL.js} +22 -26
  173. package/{runAgentClientLoop-5ZA62FBA.js → runAgentClientLoop-APSMCLAF.js} +79 -72
  174. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  175. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  176. package/{setDialogExtraReferencesAction-WX5VTY6O.js → setDialogExtraReferencesAction-LSEN44OY.js} +16 -14
  177. package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-SR366X5A.js} +23 -27
  178. package/{chunk-GP5LKBUZ.js → settingThunks-CTVPPGIN.js} +226 -940
  179. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  180. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  181. package/{spaceCommands-5GLCWZPO.js → spaceCommands-3UK63WPE.js} +51 -47
  182. package/{streamAgentChatTurn-6UZJMYRB.js → streamAgentChatTurn-DNY2PSRW.js} +215 -115
  183. package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-M6NAFOOU.js} +19 -20
  184. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  185. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
  186. package/tools-X5UWATZK.js +117 -0
  187. package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-DEH7ZEM6.js} +25 -23
  188. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  189. package/{updateDialogTitleAction-QTKNIURB.js → updateDialogTitleAction-YSY5BF5A.js} +84 -45
  190. package/action-P4TNFGAD.js +0 -31
  191. package/agentListCommands-B2V4YAC4.js +0 -410
  192. package/agentRecordCommands-G4KK4R7H.js +0 -128
  193. package/agentRunCommand-UTZJA23G.js +0 -156
  194. package/browser-image-compression-MFDTD7K6.js +0 -1763
  195. package/chatQueueReduxAdapter-2P6NFX64.js +0 -186
  196. package/chunk-CQ3WA2NE.js +0 -299
  197. package/chunk-M76ECQRD.js +0 -13658
  198. package/chunk-MEYIRKDN.js +0 -8967
  199. package/chunk-PUOC4YRO.js +0 -394
  200. package/chunk-Q5FJJ6XI.js +0 -103
  201. package/chunk-S7Z2HMCN.js +0 -25
  202. package/chunk-T75QD6AB.js +0 -20923
  203. package/chunk-Y5GCAMGP.js +0 -9
  204. package/chunk-YPREESF4.js +0 -225
  205. package/createDialogAction-NGG7YVNU.js +0 -65
  206. package/machineWsRunDispatch-ISBKOOD7.js +0 -144
  207. package/settingSlice-P4ZW7K5X.js +0 -204
  208. package/syncMapping-N6RGXGBW.js +0 -437
  209. package/tools-KMGFWO43.js +0 -110
  210. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  211. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -4,23 +4,22 @@ import {
4
4
  import {
5
5
  buildStaticUserPolicyContext,
6
6
  resolveSpaceContextPreloadPlan
7
- } from "./chunk-XD2MJFUG.js";
7
+ } from "./chunk-JEFXP73H.js";
8
8
  import {
9
9
  buildCliPrompt
10
10
  } from "./chunk-ATNTHIZI.js";
11
11
  import {
12
12
  filterAndCleanMessages,
13
13
  handleToolCalls,
14
- parseApiError,
15
14
  persistToolMessages,
16
15
  readStreamChunk,
17
16
  sendOpenAICompletionsRequest,
18
17
  updateTotalUsage
19
- } from "./chunk-W7HLWAQ7.js";
18
+ } from "./chunk-DE45KZNH.js";
20
19
  import "./chunk-JEXVIMYZ.js";
21
20
  import {
22
21
  prepareTools
23
- } from "./chunk-ASIFZ2WY.js";
22
+ } from "./chunk-7BBP7ZX3.js";
24
23
  import {
25
24
  INVALID_TOOL_ARGS_REPLACEMENT,
26
25
  buildInvalidToolCallSelfHealResult,
@@ -38,53 +37,64 @@ import {
38
37
  sanitizeOutboundResponsesInput,
39
38
  selectResponsesConversationState,
40
39
  updateResponsesConversationState
41
- } from "./chunk-GL3EHUR4.js";
40
+ } from "./chunk-VHGYUYQ3.js";
42
41
  import "./chunk-EOARMOVD.js";
43
42
  import "./chunk-HS7MLR74.js";
44
43
  import {
45
44
  createSSEParser,
46
45
  getAllToolRuns,
47
46
  resolveAgentRecommendedSkillNames,
48
- resolveAgentRequiredPackIds
49
- } from "./chunk-C3M4465B.js";
50
- import "./chunk-5UTFL4QJ.js";
47
+ resolveAgentRequiredPackIds,
48
+ selectAiRecentContentLimit,
49
+ selectGlobalPrompt,
50
+ selectKnowledgeCaptureLevel,
51
+ selectMaxExecutionTime,
52
+ selectSpaceContextLevel,
53
+ selectUserTonePreset
54
+ } from "./chunk-5HYJ3DSZ.js";
51
55
  import "./chunk-NF64D32W.js";
52
- import "./chunk-3L2WKC3W.js";
53
- import "./chunk-3VNWWVKB.js";
54
- import "./chunk-PQFHGD77.js";
55
- import "./chunk-KQHGZWSV.js";
56
- import "./chunk-J4MOO56S.js";
57
- import "./chunk-6Z7MY3V7.js";
56
+ import "./chunk-TBM2RS3U.js";
57
+ import "./chunk-APO5TOXO.js";
58
+ import "./chunk-XPWGOTBQ.js";
59
+ import "./chunk-OXME3PEE.js";
60
+ import "./chunk-RQ6CTX2E.js";
61
+ import "./chunk-PNXHPLRU.js";
62
+ import "./chunk-OEJLGVBL.js";
58
63
  import {
59
64
  getFinalPrice,
60
65
  getModelPricing,
61
66
  getPrices,
62
67
  hasExplicitAgentPricing
63
- } from "./chunk-EYAQT56M.js";
68
+ } from "./chunk-BNQMNUKZ.js";
64
69
  import {
65
70
  getPublicImageAgentDefaultProfile,
66
71
  getPublicImageAgentMode
67
72
  } from "./chunk-VIDPVFP3.js";
68
73
  import {
69
74
  resolveToolBaseUrl
70
- } from "./chunk-VLTIYV3X.js";
71
- import "./chunk-QTGQ2LTL.js";
75
+ } from "./chunk-7I25CBT5.js";
76
+ import "./chunk-3DQY5IFB.js";
77
+ import {
78
+ isContextOverflowText,
79
+ parseApiError
80
+ } from "./chunk-OCZKATRC.js";
72
81
  import {
73
82
  waitForAbortableDelay
74
83
  } from "./chunk-N4G4PKQ6.js";
75
- import "./chunk-FZGV4FGK.js";
84
+ import "./chunk-NUHHBEJC.js";
76
85
  import {
77
86
  extractCategorizedMentions
78
- } from "./chunk-MEYIRKDN.js";
87
+ } from "./chunk-AGIM7IMJ.js";
79
88
  import "./chunk-63W5N6P3.js";
80
89
  import "./chunk-VF4K2QE6.js";
81
90
  import {
82
91
  getDocState
83
- } from "./chunk-JDPFV2JV.js";
84
- import "./chunk-IBOZNTG2.js";
92
+ } from "./chunk-KWUKOQM2.js";
93
+ import "./chunk-7X5XZ34C.js";
94
+ import "./chunk-E3YWHWCR.js";
85
95
  import {
86
96
  getTableState
87
- } from "./chunk-4CR5I7BD.js";
97
+ } from "./chunk-KFWDYYSS.js";
88
98
  import {
89
99
  getCurrentSpaceId,
90
100
  getCurrentSpaceIdRaw,
@@ -106,34 +116,39 @@ import {
106
116
  selectAllMsgs,
107
117
  selectCurrentDialogConfig,
108
118
  selectDialogConfigByKey,
109
- shouldBlockForGptPro,
110
119
  updateTokens,
111
120
  updateToolMessage
112
- } from "./chunk-T75QD6AB.js";
113
- import "./chunk-MC4XLIJ7.js";
114
- import "./chunk-3BMYXEUW.js";
115
- import "./chunk-YYLHWIW6.js";
121
+ } from "./chunk-W32HPLTL.js";
122
+ import "./chunk-UKZX3NHN.js";
123
+ import "./chunk-R5AJODNI.js";
124
+ import "./chunk-523DITKR.js";
116
125
  import "./chunk-AGGIDPCZ.js";
117
- import "./chunk-NOF3HDSN.js";
126
+ import "./chunk-VZLO4XJD.js";
127
+ import "./chunk-TFOIJFCM.js";
118
128
  import {
119
129
  createCliChatTurnStream,
120
130
  getCliChatSession,
121
131
  startCliChatSession
122
- } from "./chunk-BFDFRLLQ.js";
132
+ } from "./chunk-EZ4VZHAG.js";
123
133
  import "./chunk-5RGU3J7P.js";
134
+ import "./chunk-ZRAU6T47.js";
124
135
  import {
125
136
  addActiveController,
137
+ claimDialogTurnPhase,
138
+ clearDialogTurnPhase,
126
139
  clearPendingUserInputQueue,
127
140
  dequeueUserInput,
128
141
  removeActiveController,
129
142
  selectActiveControllers,
130
143
  selectPendingFiles,
131
144
  selectPendingUserInputQueue,
145
+ setDialogTurnPhase,
132
146
  tokenUsageLiveUpdate
133
- } from "./chunk-6YTOJY35.js";
134
- import "./chunk-M76ECQRD.js";
147
+ } from "./chunk-VBG7GWWR.js";
148
+ import "./chunk-4LCOCOR5.js";
135
149
  import "./chunk-YDH3FDFQ.js";
136
- import "./chunk-JRQFUXY7.js";
150
+ import "./chunk-5UUIGN6I.js";
151
+ import "./chunk-TBAXFWOS.js";
137
152
  import {
138
153
  TOOL_PACKS,
139
154
  addDefaultSystemCapabilityTools,
@@ -143,8 +158,10 @@ import {
143
158
  expandEnabledPackPromptPatches,
144
159
  expandEnabledPacks,
145
160
  resolveEffectiveEnabledPacks
146
- } from "./chunk-DHDMC6FO.js";
147
- import "./chunk-Q554LLSI.js";
161
+ } from "./chunk-LUBFABMJ.js";
162
+ import "./chunk-IXH3HKY2.js";
163
+ import "./chunk-DMXLXZKL.js";
164
+ import "./chunk-76HO2DP6.js";
148
165
  import "./chunk-KHCLMKZZ.js";
149
166
  import {
150
167
  assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets,
@@ -153,108 +170,108 @@ import {
153
170
  projectToolMessageContent,
154
171
  resolveAgentContextWindow,
155
172
  stripImagePartsForTextOnlyAgent
156
- } from "./chunk-4MK3I7Y4.js";
157
- import "./chunk-CQ3WA2NE.js";
173
+ } from "./chunk-6MAW4XOF.js";
158
174
  import "./chunk-5ZUL4CUO.js";
159
175
  import "./chunk-N7J63Q6C.js";
160
- import "./chunk-MRIHM22T.js";
176
+ import "./chunk-LBFL6RZG.js";
161
177
  import {
162
178
  extractImagePartsFromResponseOutput,
163
179
  extractTextFromResponseOutput,
164
180
  toResponsesTools
165
- } from "./chunk-PUOC4YRO.js";
181
+ } from "./chunk-UM7TA3K4.js";
166
182
  import {
167
183
  resolveRuntimeToolSurfaceForAgent
168
- } from "./chunk-IIVGDG4I.js";
169
- import "./chunk-FDTR4QJ6.js";
170
- import "./chunk-UZGQNTVW.js";
171
- import "./chunk-6OZ36FXI.js";
184
+ } from "./chunk-SJKULPGX.js";
185
+ import "./chunk-H6A6X4EK.js";
172
186
  import {
173
187
  getModelContextWindow,
174
188
  getModelInfo
175
- } from "./chunk-HKNXJGEC.js";
189
+ } from "./chunk-ECFHBYUW.js";
176
190
  import {
177
191
  planContextUsage
178
- } from "./chunk-P5EVSOPA.js";
192
+ } from "./chunk-R6EBQEQE.js";
193
+ import "./chunk-5MMAK75Q.js";
194
+ import "./chunk-BYXBJQAS.js";
195
+ import "./chunk-DWLEOOGR.js";
196
+ import "./chunk-2U3NHADM.js";
197
+ import {
198
+ asRecordOrEmpty
199
+ } from "./chunk-KX6YBIHG.js";
179
200
  import {
180
201
  estimateTokenCount
181
202
  } from "./chunk-PSCNXBYA.js";
203
+ import "./chunk-WDLSZMTA.js";
204
+ import "./chunk-UAD2WT54.js";
205
+ import {
206
+ patch,
207
+ read,
208
+ selectById,
209
+ write
210
+ } from "./chunk-WPHY3VPF.js";
211
+ import "./chunk-EV235ILT.js";
212
+ import "./chunk-HNGRBWYF.js";
213
+ import {
214
+ buildLinkedSpacesSection,
215
+ buildSpaceContextLayer
216
+ } from "./chunk-HDLLCBRF.js";
217
+ import "./chunk-4VJAC32I.js";
218
+ import {
219
+ canonicalizeToolNames,
220
+ prioritizeToolNames
221
+ } from "./chunk-IHPDK6UD.js";
222
+ import "./chunk-LWLNLZC5.js";
223
+ import "./chunk-RXA3HAVW.js";
224
+ import "./chunk-KHKTDMYG.js";
225
+ import "./chunk-BIPGGSJS.js";
182
226
  import {
183
227
  isOpenAiResponsesModel
184
- } from "./chunk-GQBOR3G6.js";
185
- import "./chunk-BYXBJQAS.js";
228
+ } from "./chunk-JBKHQOYK.js";
186
229
  import {
187
230
  getApiEndpoint,
188
231
  getModelConfig,
189
232
  getProviderByModelName
190
- } from "./chunk-OIVSQH2O.js";
191
- import "./chunk-DWLEOOGR.js";
192
- import "./chunk-HVURBGF3.js";
193
- import "./chunk-ONXOABJR.js";
233
+ } from "./chunk-CDEEFJXN.js";
194
234
  import "./chunk-W7XHHYWM.js";
195
235
  import {
196
236
  toErrorMessage
197
237
  } from "./chunk-HNMXYYJR.js";
238
+ import "./chunk-EHSYSKXV.js";
239
+ import "./chunk-SZC4REES.js";
198
240
  import {
199
- buildLinkedSpacesSection,
200
- buildSpaceContextLayer
201
- } from "./chunk-DVINR3PL.js";
202
- import "./chunk-2GRGFCF6.js";
241
+ asTrimmedLowercaseString
242
+ } from "./chunk-QSJ3HFEF.js";
243
+ import "./chunk-ELUDRSRD.js";
203
244
  import {
204
- canonicalizeToolNames,
205
- prioritizeToolNames
206
- } from "./chunk-O6OSWFZQ.js";
207
- import "./chunk-7S4YWN7P.js";
208
- import "./chunk-ACTMNVHM.js";
209
- import "./chunk-Q67DOFOO.js";
210
- import "./chunk-PBA4UJBK.js";
245
+ selectRuntimeCurrentServer
246
+ } from "./chunk-O7SVKKLY.js";
247
+ import "./chunk-D2MDMY2M.js";
211
248
  import {
212
- selectAiRecentContentLimit,
213
- selectCurrentServer,
214
- selectGlobalPrompt,
215
- selectKnowledgeCaptureLevel,
216
- selectMaxExecutionTime,
217
- selectSpaceContextLevel,
218
- selectUserTonePreset
219
- } from "./chunk-GP5LKBUZ.js";
220
- import "./chunk-Y5GCAMGP.js";
221
- import "./chunk-QDSINZM3.js";
249
+ isSystemBuiltinTrustedAgentKey
250
+ } from "./chunk-I2RGRVQ7.js";
222
251
  import {
223
- asRecordOrEmpty
224
- } from "./chunk-KX6YBIHG.js";
225
- import "./chunk-AHAHBQMU.js";
226
- import "./chunk-UAD2WT54.js";
252
+ extractCustomId
253
+ } from "./chunk-M2EJHDJP.js";
227
254
  import {
228
- patch,
229
- read,
230
- selectById,
231
- write
232
- } from "./chunk-VRTTFDBM.js";
255
+ isRecord
256
+ } from "./chunk-KUG52IAP.js";
257
+ import "./chunk-JIXGJTBU.js";
258
+ import {
259
+ selectCurrentServer
260
+ } from "./chunk-NWENLDMM.js";
233
261
  import {
234
262
  asNonEmptyStringArray,
235
263
  createDialogMessageKeyAndId,
236
264
  dialogMessageKey,
237
265
  metaKey
238
- } from "./chunk-VMFTFOWF.js";
266
+ } from "./chunk-OKGVNZTL.js";
239
267
  import {
240
268
  asOptionalFiniteNumber
241
269
  } from "./chunk-WWC7I6TA.js";
242
- import "./chunk-ABQYVJBJ.js";
243
- import "./chunk-QSJ3HFEF.js";
244
- import "./chunk-WV42OMV7.js";
245
- import {
246
- isSystemBuiltinTrustedAgentKey
247
- } from "./chunk-BNGW5ASC.js";
248
- import {
249
- extractCustomId
250
- } from "./chunk-M2EJHDJP.js";
251
- import {
252
- selectRuntimeCurrentServer
253
- } from "./chunk-UKWGR5SS.js";
270
+ import "./chunk-VY6VFGKR.js";
254
271
  import {
255
272
  getIsDesktopApp,
256
273
  isAbortError
257
- } from "./chunk-QOKAKDPE.js";
274
+ } from "./chunk-HIM3FCLF.js";
258
275
  import "./chunk-OW765XBU.js";
259
276
  import {
260
277
  getSessionSnapshotForState,
@@ -263,14 +280,10 @@ import {
263
280
  selectIdentityUserBalance,
264
281
  selectIdentityUserId
265
282
  } from "./chunk-SEJ5OS6F.js";
266
- import "./chunk-GBRG75BQ.js";
267
- import {
268
- isRecord
269
- } from "./chunk-KUG52IAP.js";
283
+ import "./chunk-U6VC4MU4.js";
270
284
  import {
271
285
  asTrimmedString
272
286
  } from "./chunk-3EUW3WEO.js";
273
- import "./chunk-U6VC4MU4.js";
274
287
  import "./chunk-LCBAMY2M.js";
275
288
  import "./chunk-4SN6J65J.js";
276
289
  import "./chunk-CF7PE763.js";
@@ -353,12 +366,6 @@ function projectDesktopToolUiContent(args) {
353
366
  const toolName = asOptionalTrimmedString(args.toolName) || "tool";
354
367
  const metadata = isRecord(args.metadata) ? args.metadata : {};
355
368
  const rawContent = typeof args.content === "string" ? args.content : typeof args.summary === "string" ? args.summary : typeof args.message === "string" ? args.message : "";
356
- if (toolName === "setTodoList") {
357
- const existing = tryParseJsonRecord(rawContent);
358
- if (existing && Array.isArray(existing.todos)) {
359
- return clipUiText(JSON.stringify({ todos: existing.todos }));
360
- }
361
- }
362
369
  if (toolName === "execShell") {
363
370
  const existing = tryParseJsonRecord(rawContent);
364
371
  if (existing && (typeof existing.stdout === "string" || typeof existing.command === "string" || typeof existing.stderr === "string")) {
@@ -856,6 +863,7 @@ var sendOpenAIResponseRequest = async ({
856
863
  const toolMessage = {
857
864
  id: runningToolMessageId,
858
865
  dbKey: runningToolDbKey,
866
+ dialogId,
859
867
  role: "tool",
860
868
  content: selfHealContent,
861
869
  toolCallId: callId,
@@ -1788,6 +1796,8 @@ var buildRecentAppToolMemory = (messages, toolRuns) => {
1788
1796
  // packages/ai/agent/streamAgentChatTurnUtils.ts
1789
1797
  var BROWSER_UNAVAILABLE_CORE_TOOLS = {
1790
1798
  createAgentAutomation: true,
1799
+ updateAgentAutomation: true,
1800
+ deleteAgentAutomation: true,
1791
1801
  notifyUser: true
1792
1802
  };
1793
1803
  var getRuntimeCoreTools = () => {
@@ -2336,10 +2346,35 @@ var resolveImageGenerationStreamingState = (agentConfig, args) => {
2336
2346
  };
2337
2347
  };
2338
2348
 
2349
+ // packages/core/gptProTier.ts
2350
+ var GPT_PRO_REQUIRED_RECHARGE_AMOUNT = 199;
2351
+ function isGptProModel(provider, model) {
2352
+ const normalizedProvider = asTrimmedLowercaseString(provider);
2353
+ const normalizedModel = asTrimmedLowercaseString(model);
2354
+ if (normalizedProvider === "openai") {
2355
+ return /^gpt-[a-z0-9.-]+-pro(?:-|$)/.test(normalizedModel);
2356
+ }
2357
+ if (normalizedProvider === "deepinfra") {
2358
+ return normalizedModel.includes("claude") && (normalizedModel.includes("opus") || normalizedModel.includes("fable"));
2359
+ }
2360
+ if (normalizedProvider === "nolo") {
2361
+ return normalizedModel === "kimi-k3";
2362
+ }
2363
+ return false;
2364
+ }
2365
+ var GPT_PRO_BLOCKED_MESSAGE = `GPT Pro / Kimi K3 \u7B49\u9AD8\u7EA7\u6A21\u578B\u9700\u8981\u5148\u5F00\u901A ${GPT_PRO_REQUIRED_RECHARGE_AMOUNT} \u79EF\u5206\u6863\u4F4D\u3002`;
2366
+ function shouldBlockForGptPro(agent, gptProStatus) {
2367
+ if (!agent) return { blocked: false };
2368
+ if (agent.apiSource === "cli") return { blocked: false };
2369
+ if (!isGptProModel(agent.provider, agent.model)) return { blocked: false };
2370
+ if (gptProStatus === "active") return { blocked: false };
2371
+ return { blocked: true, message: GPT_PRO_BLOCKED_MESSAGE };
2372
+ }
2373
+
2339
2374
  // packages/ai/agent/persistMessageWithFixedId.ts
2340
2375
  async function persistMessageWithFixedId(dispatch, message) {
2341
2376
  dispatch(addUserMessage(message));
2342
- const { controller, ...messageToWrite } = message;
2377
+ const { controller, dialogId: _dialogId, ...messageToWrite } = message;
2343
2378
  try {
2344
2379
  const writeRequest = dispatch(
2345
2380
  write({
@@ -2418,6 +2453,7 @@ function normalizeDesktopAgentRuntimeTurnError(data) {
2418
2453
  async function* runDesktopAgentRuntimeTurnStream({
2419
2454
  fetchImpl = fetch,
2420
2455
  signal,
2456
+ noEventWatchdogMs,
2421
2457
  ...args
2422
2458
  }) {
2423
2459
  try {
@@ -2474,7 +2510,13 @@ async function* runDesktopAgentRuntimeTurnStream({
2474
2510
  yield { type: "error", error: "The operation was aborted." };
2475
2511
  return;
2476
2512
  }
2477
- const { done, value } = await readStreamChunk(reader, { signal });
2513
+ const { done, value } = await readStreamChunk(reader, {
2514
+ signal,
2515
+ ...noEventWatchdogMs && noEventWatchdogMs > 0 ? {
2516
+ timeoutMs: noEventWatchdogMs,
2517
+ timeoutErrorMessage: `Desktop turn stream stalled: no event within ${noEventWatchdogMs}ms`
2518
+ } : {}
2519
+ });
2478
2520
  if (done) break;
2479
2521
  buffer += decoder.decode(value, { stream: true });
2480
2522
  const lines = buffer.split("\n");
@@ -2596,7 +2638,8 @@ var toolMessageWillPersist = (toolMsg) => {
2596
2638
  if (typeof content === "string") return content.trim().length > 0;
2597
2639
  return Array.isArray(content) && content.length > 0;
2598
2640
  };
2599
- var shouldUseDesktopLocalRuntime = (agentConfig) => {
2641
+ var shouldUseDesktopLocalRuntime = (agentConfig, explicitTarget) => {
2642
+ if (explicitTarget?.kind === "machine") return false;
2600
2643
  if (!getIsDesktopApp()) return false;
2601
2644
  return agentConfig?.apiSource !== "cli";
2602
2645
  };
@@ -3048,6 +3091,28 @@ function hasInlineExecutedToolCalls(result) {
3048
3091
  const output = result?.output;
3049
3092
  return Array.isArray(output) && output.some((b) => b?.type === "toolCall" && b?.result != null);
3050
3093
  }
3094
+ var COMPACTION_TIMEOUT_PATTERN = /compaction[^\n]{0,40}(timed\s*out|timeout|deadline)|(timed\s*out|timeout|deadline)[^\n]{0,40}compaction|summary[^\n]{0,30}(timed\s*out|timeout)/i;
3095
+ var DESKTOP_SSE_NO_EVENT_WATCHDOG_MS = 20 * 60 * 1e3;
3096
+ function classifyLocalTurnStreamError(errorText) {
3097
+ const text = typeof errorText === "string" ? errorText : "";
3098
+ if (COMPACTION_TIMEOUT_PATTERN.test(text)) {
3099
+ return {
3100
+ kind: "compaction_timeout",
3101
+ retryable: true,
3102
+ summary: "\u5386\u53F2\u538B\u7F29\u8D85\u65F6",
3103
+ actionHint: "\u5386\u53F2\u538B\u7F29\u672A\u80FD\u5728\u65F6\u9650\u5185\u5B8C\u6210\uFF0C\u672C\u56DE\u5408\u5DF2\u505C\u6B62\u3002\u4F60\u7684\u6D88\u606F\u4E0E\u9644\u4EF6\u5747\u5DF2\u4FDD\u7559\uFF1B\u53EF\u91CD\u8BD5\u3001\u5F00\u542F\u65B0\u5BF9\u8BDD\uFF0C\u6216\u5207\u6362\u5230\u66F4\u5927\u7A97\u53E3\u7684\u6A21\u578B\u3002\uFF08\u8D85\u65F6\u540E\u4E0D\u4F1A\u81EA\u52A8\u91CD\u8BD5\u540C\u4E00\u4ED8\u8D39\u8BF7\u6C42\u3002\uFF09"
3104
+ };
3105
+ }
3106
+ if (isContextOverflowText(text)) {
3107
+ return {
3108
+ kind: "context_overflow",
3109
+ retryable: true,
3110
+ summary: "\u4E0A\u4E0B\u6587\u8FC7\u957F",
3111
+ actionHint: "\u5F53\u524D\u4E0A\u4E0B\u6587\u8D85\u51FA\u6A21\u578B\u7A97\u53E3\u3002\u53EF\u81EA\u52A8\u538B\u7F29\u5E76\u91CD\u8BD5\u3001\u5F00\u542F\u65B0\u5BF9\u8BDD\uFF0C\u6216\u5207\u6362\u5230\u66F4\u5927\u7A97\u53E3\u7684\u6A21\u578B\u3002"
3112
+ };
3113
+ }
3114
+ return { kind: "generic", retryable: true, summary: "", actionHint: "" };
3115
+ }
3051
3116
  function createRemoteToolEventHandlers(opts) {
3052
3117
  const { dialogId, dispatch, messageMetadata } = opts;
3053
3118
  const activeToolMessages = /* @__PURE__ */ new Map();
@@ -3182,6 +3247,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3182
3247
  thunkApi.signal.addEventListener("abort", onAbort);
3183
3248
  let loopKey = null;
3184
3249
  let runtimeDialogKey = explicitDialogKey ?? null;
3250
+ let turnPhaseTurnId = null;
3185
3251
  let remoteTransientMessageId = null;
3186
3252
  let remoteTransientMessageFinalized = false;
3187
3253
  let modelRequestStarted = false;
@@ -3290,8 +3356,14 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3290
3356
  const configuredBoundMachineId = asTrimmedString(
3291
3357
  agentConfig.runtimeBinding?.machineId
3292
3358
  );
3293
- const boundMachineId = resolveRemoteBoundMachineId(configuredBoundMachineId);
3294
- if (agentConfig.apiSource === "cli" || boundMachineId && !getIsDesktopApp()) {
3359
+ const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
3360
+ const explicitTarget = runtimeOptions?.runtimeTarget ?? (currentDialog?.runtimeBinding?.target?.kind === "server" || currentDialog?.runtimeBinding?.target?.kind === "machine" ? currentDialog.runtimeBinding.target : void 0);
3361
+ const boundMachineId = explicitTarget ? explicitTarget.kind === "machine" ? asTrimmedString(explicitTarget.machineId) : null : resolveRemoteBoundMachineId(configuredBoundMachineId);
3362
+ const hasExplicitMachineTarget = explicitTarget?.kind === "machine";
3363
+ if (hasExplicitMachineTarget && !boundMachineId) {
3364
+ return rejectWithValue("\u663E\u5F0F\u9009\u62E9\u7684\u7535\u8111\u76EE\u6807\u7F3A\u5C11 machineId\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6267\u884C\u7535\u8111\u3002");
3365
+ }
3366
+ if (hasExplicitMachineTarget || agentConfig.apiSource === "cli" && !explicitTarget || boundMachineId && !getIsDesktopApp()) {
3295
3367
  console.info("[streamAgentChatTurn] Triggered CLI/machine route. apiSource:", agentConfig.apiSource, "boundMachineId:", boundMachineId, "agentKey:", agentKey);
3296
3368
  const currentState = getState();
3297
3369
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
@@ -3326,6 +3398,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3326
3398
  let accumulated2 = "";
3327
3399
  let totalTurnUsage2 = void 0;
3328
3400
  const buildMachineAssistantMessage = () => ({
3401
+ dialogId: dialogId2,
3329
3402
  id: messageId,
3330
3403
  dbKey: msgKey,
3331
3404
  role: "assistant",
@@ -3375,6 +3448,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3375
3448
  stream: true,
3376
3449
  persistDialog: false,
3377
3450
  clientDialogId: dialogId2,
3451
+ ...explicitTarget ? { runtimeTarget: explicitTarget } : {},
3378
3452
  runtimeContext: {
3379
3453
  surface: "web",
3380
3454
  host: "browser",
@@ -3600,6 +3674,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3600
3674
  let cliTurnUsage = null;
3601
3675
  const decoder = new TextDecoder();
3602
3676
  const buildCliAssistantMessage = () => ({
3677
+ dialogId: dialogId2,
3603
3678
  id: messageId,
3604
3679
  dbKey: msgKey,
3605
3680
  role: "assistant",
@@ -3722,7 +3797,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3722
3797
  }
3723
3798
  return;
3724
3799
  }
3725
- const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
3726
3800
  const activeDialogKey = currentDialog?.dbKey;
3727
3801
  const dialogKey = explicitDialogKey || activeDialogKey;
3728
3802
  if (!dialogKey) {
@@ -3734,11 +3808,13 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3734
3808
  dialogKey,
3735
3809
  dialogId
3736
3810
  });
3737
- if (shouldUseDesktopLocalRuntime(agentConfig)) {
3811
+ if (shouldUseDesktopLocalRuntime(agentConfig, explicitTarget)) {
3738
3812
  const desktopMessageMetadata = buildMessageMetadata(agentConfig);
3739
3813
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
3740
3814
  loopKey = `loop:${dialogId}`;
3741
3815
  dispatch(addActiveController({ messageId: loopKey, controller: loopController, dialogKey }));
3816
+ turnPhaseTurnId = `turn-phase:${dialogId}:${Date.now().toString(36)}:${Math.random().toString(36).slice(2, 8)}`;
3817
+ claimDialogTurnPhase({ dialogKey, turnId: turnPhaseTurnId });
3742
3818
  let currentContent = "";
3743
3819
  const assistantSegments = [];
3744
3820
  let assistantMessageKeys = null;
@@ -3811,7 +3887,18 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3811
3887
  workspaceToolsHint: runtimeOptions?.workspaceToolsHint === true,
3812
3888
  agentConfigSnapshot: agentConfig,
3813
3889
  dialogMessages: selectAllMsgs(getState(), dialogId),
3814
- signal: loopController.signal
3890
+ signal: loopController.signal,
3891
+ // SSE 传输层兜底(review 修复 4):此前本调用方从不传
3892
+ // noEventWatchdogMs,watchdog 永远关闭——「已有安全网」只是
3893
+ // 错觉,挂起点若在 provider.complete 之外(resolveProvider /
3894
+ // adapter 内部,runtime 没有任何 deadline)就会无限静默。
3895
+ // 量级必须大于 runtime 自己的 idle 窗(默认 10 分钟无新输出
3896
+ // 才放弃,见 localLoop.DEFAULT_LLM_REQUEST_TIMEOUT_MS),
3897
+ // 否则一个健康的慢思考轮次会被客户端提前判死,用户拿到的是
3898
+ // 未分类的 "stream stalled" 而不是 runtime 的
3899
+ // LLM_REQUEST_TIMEOUT 可操作文案。取 2× = 20 分钟:
3900
+ // 只兜「runtime 完全没 deadline」的真悬挂。
3901
+ noEventWatchdogMs: DESKTOP_SSE_NO_EVENT_WATCHDOG_MS
3815
3902
  });
3816
3903
  for await (const event of eventStream) {
3817
3904
  if (loopController.signal.aborted || thunkApi.signal.aborted) {
@@ -3884,6 +3971,9 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3884
3971
  dispatch(messageStreaming(toolResultMsg));
3885
3972
  }
3886
3973
  }
3974
+ } else if (event.type === "status") {
3975
+ const phase = event.phase === "validating-context" ? "validating" : event.phase;
3976
+ setDialogTurnPhase({ phase, dialogKey, turnId: turnPhaseTurnId ?? void 0 });
3887
3977
  } else if (event.type === "done") {
3888
3978
  streamResult = event.result;
3889
3979
  } else if (event.type === "error") {
@@ -3924,6 +4014,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3924
4014
  stopToolNameById
3925
4015
  );
3926
4016
  await persistMessageWithFixedId(dispatch, {
4017
+ dialogId,
3927
4018
  id: segment2.messageId,
3928
4019
  dbKey: segment2.key,
3929
4020
  role: "assistant",
@@ -3974,6 +4065,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3974
4065
  errorToolNameById
3975
4066
  );
3976
4067
  await persistMessageWithFixedId(dispatch, {
4068
+ dialogId,
3977
4069
  id: segment2.messageId,
3978
4070
  dbKey: segment2.key,
3979
4071
  role: "assistant",
@@ -4015,8 +4107,12 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4015
4107
  setLoopStopReason("error");
4016
4108
  };
4017
4109
  if (streamError) {
4018
- await finalizeDesktopTurnOnError(streamError);
4019
- return rejectWithValue(streamError);
4110
+ const info = classifyLocalTurnStreamError(streamError);
4111
+ const finalError = info.actionHint ? `${streamError}
4112
+
4113
+ ${info.actionHint}` : streamError;
4114
+ await finalizeDesktopTurnOnError(finalError);
4115
+ return rejectWithValue(finalError);
4020
4116
  }
4021
4117
  if (!streamResult) {
4022
4118
  const message = "Local turn stream closed unexpectedly without result";
@@ -4146,6 +4242,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4146
4242
  let accumulated = "";
4147
4243
  let totalTurnUsage2 = void 0;
4148
4244
  const buildRemoteAssistantMessage = () => ({
4245
+ dialogId,
4149
4246
  id: messageId,
4150
4247
  dbKey: msgKey,
4151
4248
  role: "assistant",
@@ -4190,6 +4287,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4190
4287
  stream: true,
4191
4288
  persistDialog: false,
4192
4289
  clientDialogId: dialogId,
4290
+ ...explicitTarget ? { runtimeTarget: explicitTarget } : {},
4193
4291
  runtimeContext: {
4194
4292
  surface: "web",
4195
4293
  host: "browser",
@@ -4982,6 +5080,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4982
5080
  error?.message || "An unexpected error occurred in streamAgentChatTurn."
4983
5081
  );
4984
5082
  } finally {
5083
+ clearDialogTurnPhase({ dialogKey: runtimeDialogKey ?? void 0, turnId: turnPhaseTurnId ?? void 0 });
4985
5084
  if (loopKey && runtimeDialogKey) {
4986
5085
  dispatch(removeActiveController({ messageId: loopKey, dialogKey: runtimeDialogKey }));
4987
5086
  } else if (loopKey) {
@@ -5001,5 +5100,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
5001
5100
  }
5002
5101
  };
5003
5102
  export {
5103
+ classifyLocalTurnStreamError,
5004
5104
  streamAgentChatTurnHandler
5005
5105
  };