nolo-cli 0.104.0-alpha.1 → 0.104.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 (208) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-4W7C3ACS.js → _executeModel-JXG5TLPE.js} +75 -68
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-J3DLDV64.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-PHIXJCF2.js} +18 -19
  6. package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-2AWJGHXG.js} +117 -42
  7. package/{agentEmailCommands-O2KH4G7U.js → agentEmailCommands-VV5OSILE.js} +98 -88
  8. package/agentListCommands-OQMRBDWP.js +742 -0
  9. package/{agentMachineCommands-5I5CCUBM.js → agentMachineCommands-3VLLR6RL.js} +48 -43
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-XPJYZSCE.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-GPIARVOW.js +138 -0
  13. package/agentRunCommand-LRJTZ7IM.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-PV6AZOEU.js} +48 -39
  16. package/{agentSlice-6LBOYNKN.js → agentSlice-6R3JKS6I.js} +14 -13
  17. package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-WEX73P5R.js} +46 -41
  18. package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-7BAXWA4M.js} +46 -41
  19. package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-EJ6A2U4X.js} +46 -41
  20. package/{appGetCommands-SFAPP5PB.js → appGetCommands-SB355OEX.js} +46 -41
  21. package/{appListCommands-EKUBDRUO.js → appListCommands-TSZDPIKJ.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-5PB3YRVV.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-SBBWTANC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  30. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  31. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  32. package/{chunk-V4MJDUSR.js → chunk-3F424ASC.js} +2 -2
  33. package/{chunk-HJUYAD4A.js → chunk-3Q7NEHAR.js} +5 -5
  34. package/chunk-44CU7CKA.js +13545 -0
  35. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  36. package/chunk-4LCOCOR5.js +50 -0
  37. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  38. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  39. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  40. package/{chunk-H62HCIUP.js → chunk-4WMMIL66.js} +35 -22
  41. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  42. package/{chunk-ZCYXJSTU.js → chunk-54VPQTOA.js} +66 -94
  43. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  44. package/chunk-5MMAK75Q.js +15 -0
  45. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  46. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  47. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  48. package/chunk-A4SQRTZ6.js +15 -0
  49. package/{chunk-L5UXH3B2.js → chunk-AFH5QC6R.js} +58 -9
  50. package/{chunk-AEOE4Z6Q.js → chunk-AFSY3ZMB.js} +39 -15
  51. package/chunk-AGIM7IMJ.js +147 -0
  52. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  53. package/{chunk-NA35QHCF.js → chunk-AWVP7PPG.js} +1 -1
  54. package/{chunk-EEGDMATE.js → chunk-B7APRSPS.js} +86 -81
  55. package/{chunk-W324THOB.js → chunk-BB7LVBTS.js} +20 -11
  56. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  57. package/{chunk-5H7KJX7J.js → chunk-CFHWVEUJ.js} +5 -5
  58. package/chunk-CHOZJMJS.js +78 -0
  59. package/{chunk-ETI2NYVF.js → chunk-CNA27EMD.js} +4 -4
  60. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  61. package/{chunk-WV42OMV7.js → chunk-D2GQE6AF.js} +8 -8
  62. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  63. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  64. package/chunk-DZ7R5V3Y.js +164 -0
  65. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  66. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  67. package/{chunk-2J5Y72GY.js → chunk-EP7BWZ4B.js} +1 -1
  68. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  69. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  70. package/{chunk-3ZW5ZJMM.js → chunk-FGSJ3YMD.js} +23 -28
  71. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  72. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  73. package/chunk-GMZLP5DV.js +82 -0
  74. package/{chunk-DHDMC6FO.js → chunk-GSKPJIHY.js} +14 -9
  75. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  76. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  77. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  78. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  79. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  80. package/{chunk-NXUYQBDZ.js → chunk-HYXABXCZ.js} +29 -78
  81. package/{chunk-DNCEALKX.js → chunk-IEJ5YDA4.js} +22 -29
  82. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  83. package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
  84. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  85. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  86. package/{chunk-4OEFYTWL.js → chunk-L5WOICCV.js} +67 -48
  87. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  88. package/chunk-LWLNLZC5.js +265 -0
  89. package/{chunk-H66KLASO.js → chunk-LWXE6IFU.js} +567 -519
  90. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  91. package/chunk-NKWIS6G2.js +442 -0
  92. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  93. package/{chunk-DJWMIXDZ.js → chunk-NSAFG343.js} +10 -10
  94. package/{chunk-UKZDAFYT.js → chunk-NSBID7PR.js} +6 -10
  95. package/{chunk-4J4QNKTW.js → chunk-NTR4SD3P.js} +845 -240
  96. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  97. package/chunk-NWENLDMM.js +42 -0
  98. package/chunk-O7SVKKLY.js +875 -0
  99. package/chunk-OCZKATRC.js +129 -0
  100. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  101. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  102. package/{chunk-JRQFUXY7.js → chunk-P5GCTVGV.js} +99 -22
  103. package/{chunk-PQFHGD77.js → chunk-QKTESDWK.js} +161 -14
  104. package/{chunk-U3JZVWIB.js → chunk-QMXJ5KDJ.js} +68 -46
  105. package/{chunk-GEPUP7OO.js → chunk-QYUBY3OZ.js} +3 -3
  106. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  107. package/{chunk-J4MOO56S.js → chunk-RILRSUGC.js} +10 -2
  108. package/{chunk-OEVAY4J6.js → chunk-RWX7AY7J.js} +18 -20
  109. package/{chunk-YY7I6GQ3.js → chunk-S2NSK7AZ.js} +11 -9
  110. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  111. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  112. package/chunk-TY3TIUJK.js +89 -0
  113. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  114. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  115. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  116. package/chunk-UWXDA7L5.js +8005 -0
  117. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  118. package/chunk-VIWDGTDA.js +8 -0
  119. package/chunk-VJVNU77E.js +83 -0
  120. package/{chunk-A6FMKU7M.js → chunk-VVJ2ENLY.js} +47 -67
  121. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  122. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  123. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  124. package/chunk-YK5MHOWM.js +915 -0
  125. package/chunk-YV25TM3R.js +780 -0
  126. package/{chunk-TOP2VXOR.js → chunk-YVU4XVJD.js} +5 -5
  127. package/{chunk-7SOWRCQQ.js → chunk-Z5NGE5DH.js} +29 -9
  128. package/{chunk-6VFARHZW.js → chunk-ZBHR642M.js} +994 -1079
  129. package/chunk-ZRAU6T47.js +56 -0
  130. package/{chunk-B6P4QKEN.js → chunk-ZSUDOTPL.js} +19 -17
  131. package/commandRegistry-QU62WJQX.js +833 -0
  132. package/{contentThunks-LXOZUD2Y.js → contentThunks-VGV3JJVB.js} +37 -35
  133. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  134. package/{createAgentAutomationAction-M5NDEIC6.js → createAgentAutomationAction-ZNVLI4WV.js} +39 -37
  135. package/createDialogAction-TTUA46DT.js +69 -0
  136. package/{createPageAction-WY5ZKP2M.js → createPageAction-KUFSC5XW.js} +46 -43
  137. package/{chunk-ITBLTYQB.js → cursorProvider-YGGNMVWX.js} +2496 -9897
  138. package/{dbSlice-XVWBAGYN.js → dbSlice-MYEETO73.js} +11 -10
  139. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  140. package/{dialogCommands-5J56DFWN.js → dialogCommands-DRDPEOTL.js} +49 -45
  141. package/{dialogSlice-HSGREZGA.js → dialogSlice-V2SVSTIV.js} +41 -34
  142. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  143. package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-M26CFDDQ.js} +48 -43
  144. package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-LRZHCKVX.js} +49 -44
  145. package/{docReadCommands-HOSVSBDJ.js → docReadCommands-6QJSISHK.js} +47 -42
  146. package/{docStore-IIS36NGG.js → docStore-4RWAFNDM.js} +16 -12
  147. package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-W4KU4U5T.js} +48 -43
  148. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  149. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  150. package/{handleSendMessageAction-FEHCWMN2.js → handleSendMessageAction-VEWLGB5Z.js} +107 -41
  151. package/index.js +87 -884
  152. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  153. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  154. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  155. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  156. package/{machineCommands-G5J754EH.js → machineCommands-AEHHCJEW.js} +92 -82
  157. package/machineWsRunDispatch-MY2KHS36.js +154 -0
  158. package/{memberThunks-QGFLFVCI.js → memberThunks-EE6TI3TV.js} +20 -18
  159. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  160. package/oauthTokenStore-ITEB663N.js +23 -0
  161. package/package.json +1 -1
  162. package/pdf-U6KSUEZZ.js +26435 -0
  163. package/processSpawn-SOAV3FEV.js +11 -0
  164. package/profileConfig-ZGOFORWV.js +43 -0
  165. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  166. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  167. package/{read-COE3ZYR6.js → read-PJIT2YEJ.js} +7 -6
  168. package/{readDocTool-5USN4A6V.js → readDocTool-DRSXHGNL.js} +5 -3
  169. package/{readlineWorkspace-TGCYJFEB.js → readlineWorkspace-7Q6MITLV.js} +2685 -2050
  170. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-IN4WUKJJ.js} +21 -25
  171. package/{runAgentClientLoop-UY76PPZM.js → runAgentClientLoop-H2JALUVD.js} +76 -70
  172. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  173. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  174. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-VDRF7LPK.js} +15 -13
  175. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-RO6LIWJ4.js} +22 -26
  176. package/{chunk-AFUORTY4.js → settingThunks-3OPOLOIA.js} +226 -940
  177. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  178. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  179. package/{spaceCommands-NKJVJCQQ.js → spaceCommands-UBLL5EF2.js} +51 -46
  180. package/{streamAgentChatTurn-3YVIO4KE.js → streamAgentChatTurn-FFJWW3FD.js} +214 -108
  181. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-MVF2JNE7.js} +18 -19
  182. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  183. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  184. package/tools-AZRYLYNK.js +116 -0
  185. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-7S5HJ3MT.js} +25 -22
  186. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  187. package/{updateDialogTitleAction-GF5T3VMK.js → updateDialogTitleAction-5WXTRUJM.js} +82 -44
  188. package/action-YVYQEAAV.js +0 -31
  189. package/agentListCommands-GUDMBDHZ.js +0 -410
  190. package/agentRecordCommands-RSS44XHC.js +0 -128
  191. package/agentRunCommand-P7VHL4ZR.js +0 -156
  192. package/browser-image-compression-MFDTD7K6.js +0 -1763
  193. package/chatQueueReduxAdapter-WFROMKD3.js +0 -186
  194. package/chunk-CQ3WA2NE.js +0 -299
  195. package/chunk-FQUHIG5X.js +0 -20782
  196. package/chunk-M76ECQRD.js +0 -13658
  197. package/chunk-MEYIRKDN.js +0 -8967
  198. package/chunk-Q5FJJ6XI.js +0 -103
  199. package/chunk-S7Z2HMCN.js +0 -25
  200. package/chunk-Y5GCAMGP.js +0 -9
  201. package/chunk-YPREESF4.js +0 -225
  202. package/createDialogAction-TDFOINOY.js +0 -65
  203. package/machineWsRunDispatch-VXYBYYKM.js +0 -144
  204. package/settingSlice-ZQZVUPKK.js +0 -204
  205. package/syncMapping-N6RGXGBW.js +0 -437
  206. package/tools-Q6IBBG33.js +0 -110
  207. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  208. 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-3DII57IT.js";
7
+ } from "./chunk-VCAQFMVN.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-NXUYQBDZ.js";
18
+ } from "./chunk-HYXABXCZ.js";
20
19
  import "./chunk-JEXVIMYZ.js";
21
20
  import {
22
21
  prepareTools
23
- } from "./chunk-DJWMIXDZ.js";
22
+ } from "./chunk-NSAFG343.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-U3JZVWIB.js";
40
+ } from "./chunk-QMXJ5KDJ.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-H66KLASO.js";
50
- import "./chunk-5UTFL4QJ.js";
47
+ resolveAgentRequiredPackIds,
48
+ selectAiRecentContentLimit,
49
+ selectGlobalPrompt,
50
+ selectKnowledgeCaptureLevel,
51
+ selectMaxExecutionTime,
52
+ selectSpaceContextLevel,
53
+ selectUserTonePreset
54
+ } from "./chunk-LWXE6IFU.js";
51
55
  import "./chunk-NF64D32W.js";
56
+ import "./chunk-QKTESDWK.js";
57
+ import "./chunk-AOTBKDRK.js";
52
58
  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-HJUYAD4A.js";
59
+ import "./chunk-OXME3PEE.js";
60
+ import "./chunk-DZ7R5V3Y.js";
61
+ import "./chunk-RILRSUGC.js";
62
+ import "./chunk-3Q7NEHAR.js";
58
63
  import {
59
64
  getFinalPrice,
60
65
  getModelPricing,
61
66
  getPrices,
62
67
  hasExplicitAgentPricing
63
- } from "./chunk-EYAQT56M.js";
68
+ } from "./chunk-4DPP773Q.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-UKZDAFYT.js";
75
+ } from "./chunk-HP57OUJO.js";
76
+ import "./chunk-NSBID7PR.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-W324THOB.js";
84
- import "./chunk-3ZW5ZJMM.js";
92
+ } from "./chunk-BB7LVBTS.js";
93
+ import "./chunk-FGSJ3YMD.js";
94
+ import "./chunk-E3YWHWCR.js";
85
95
  import {
86
96
  getTableState
87
- } from "./chunk-A6FMKU7M.js";
97
+ } from "./chunk-VVJ2ENLY.js";
88
98
  import {
89
99
  getCurrentSpaceId,
90
100
  getCurrentSpaceIdRaw,
@@ -106,34 +116,38 @@ import {
106
116
  selectAllMsgs,
107
117
  selectCurrentDialogConfig,
108
118
  selectDialogConfigByKey,
109
- shouldBlockForGptPro,
110
119
  updateTokens,
111
120
  updateToolMessage
112
- } from "./chunk-FQUHIG5X.js";
113
- import "./chunk-MC4XLIJ7.js";
114
- import "./chunk-3BMYXEUW.js";
115
- import "./chunk-YYLHWIW6.js";
121
+ } from "./chunk-44CU7CKA.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-YY7I6GQ3.js";
126
+ import "./chunk-S2NSK7AZ.js";
118
127
  import {
119
128
  createCliChatTurnStream,
120
129
  getCliChatSession,
121
130
  startCliChatSession
122
- } from "./chunk-TOP2VXOR.js";
131
+ } from "./chunk-YVU4XVJD.js";
123
132
  import "./chunk-5RGU3J7P.js";
133
+ import "./chunk-ZRAU6T47.js";
124
134
  import {
125
135
  addActiveController,
136
+ claimDialogTurnPhase,
137
+ clearDialogTurnPhase,
126
138
  clearPendingUserInputQueue,
127
139
  dequeueUserInput,
128
140
  removeActiveController,
129
141
  selectActiveControllers,
130
142
  selectPendingFiles,
131
143
  selectPendingUserInputQueue,
144
+ setDialogTurnPhase,
132
145
  tokenUsageLiveUpdate
133
- } from "./chunk-6YTOJY35.js";
134
- import "./chunk-M76ECQRD.js";
146
+ } from "./chunk-BZ7NPA6G.js";
147
+ import "./chunk-4LCOCOR5.js";
135
148
  import "./chunk-YDH3FDFQ.js";
136
- import "./chunk-JRQFUXY7.js";
149
+ import "./chunk-5UUIGN6I.js";
150
+ import "./chunk-P5GCTVGV.js";
137
151
  import {
138
152
  TOOL_PACKS,
139
153
  addDefaultSystemCapabilityTools,
@@ -143,8 +157,10 @@ import {
143
157
  expandEnabledPackPromptPatches,
144
158
  expandEnabledPacks,
145
159
  resolveEffectiveEnabledPacks
146
- } from "./chunk-DHDMC6FO.js";
147
- import "./chunk-Q554LLSI.js";
160
+ } from "./chunk-GSKPJIHY.js";
161
+ import "./chunk-WJ3B6FX6.js";
162
+ import "./chunk-DMXLXZKL.js";
163
+ import "./chunk-A4SQRTZ6.js";
148
164
  import "./chunk-KHCLMKZZ.js";
149
165
  import {
150
166
  assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets,
@@ -153,108 +169,109 @@ import {
153
169
  projectToolMessageContent,
154
170
  resolveAgentContextWindow,
155
171
  stripImagePartsForTextOnlyAgent
156
- } from "./chunk-5H7KJX7J.js";
157
- import "./chunk-CQ3WA2NE.js";
172
+ } from "./chunk-CFHWVEUJ.js";
158
173
  import "./chunk-5ZUL4CUO.js";
174
+ import "./chunk-NKWIS6G2.js";
159
175
  import "./chunk-N7J63Q6C.js";
160
- import "./chunk-L5UXH3B2.js";
176
+ import "./chunk-AFH5QC6R.js";
161
177
  import {
162
178
  extractImagePartsFromResponseOutput,
163
179
  extractTextFromResponseOutput,
164
180
  toResponsesTools
165
- } from "./chunk-PUOC4YRO.js";
181
+ } from "./chunk-M7VLQGQP.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-4OEFYTWL.js";
189
+ } from "./chunk-L5WOICCV.js";
176
190
  import {
177
191
  planContextUsage
178
- } from "./chunk-DNCEALKX.js";
192
+ } from "./chunk-IEJ5YDA4.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-3F424ASC.js";
204
+ import "./chunk-UAD2WT54.js";
205
+ import {
206
+ patch,
207
+ read,
208
+ selectById,
209
+ write
210
+ } from "./chunk-4WMMIL66.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-EKPKW6RM.js";
224
+ import "./chunk-UA324D4O.js";
225
+ import "./chunk-27ONFIEY.js";
182
226
  import {
183
227
  isOpenAiResponsesModel
184
- } from "./chunk-GQBOR3G6.js";
185
- import "./chunk-BYXBJQAS.js";
228
+ } from "./chunk-7KVZ5LDQ.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-3BXNTXYI.js";
194
234
  import "./chunk-W7XHHYWM.js";
195
235
  import {
196
236
  toErrorMessage
197
237
  } from "./chunk-HNMXYYJR.js";
238
+ import "./chunk-CYSYR67N.js";
239
+ import "./chunk-Y3PMXGLH.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-D2GQE6AF.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-BP4XNZRM.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-AFUORTY4.js";
220
- import "./chunk-Y5GCAMGP.js";
221
- import "./chunk-QDSINZM3.js";
249
+ isSystemBuiltinTrustedAgentKey
250
+ } from "./chunk-BNGW5ASC.js";
222
251
  import {
223
- asRecordOrEmpty
224
- } from "./chunk-KX6YBIHG.js";
225
- import "./chunk-V4MJDUSR.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-H62HCIUP.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";
@@ -856,6 +869,7 @@ var sendOpenAIResponseRequest = async ({
856
869
  const toolMessage = {
857
870
  id: runningToolMessageId,
858
871
  dbKey: runningToolDbKey,
872
+ dialogId,
859
873
  role: "tool",
860
874
  content: selfHealContent,
861
875
  toolCallId: callId,
@@ -1788,6 +1802,8 @@ var buildRecentAppToolMemory = (messages, toolRuns) => {
1788
1802
  // packages/ai/agent/streamAgentChatTurnUtils.ts
1789
1803
  var BROWSER_UNAVAILABLE_CORE_TOOLS = {
1790
1804
  createAgentAutomation: true,
1805
+ updateAgentAutomation: true,
1806
+ deleteAgentAutomation: true,
1791
1807
  notifyUser: true
1792
1808
  };
1793
1809
  var getRuntimeCoreTools = () => {
@@ -2336,10 +2352,35 @@ var resolveImageGenerationStreamingState = (agentConfig, args) => {
2336
2352
  };
2337
2353
  };
2338
2354
 
2355
+ // packages/core/gptProTier.ts
2356
+ var GPT_PRO_REQUIRED_RECHARGE_AMOUNT = 199;
2357
+ function isGptProModel(provider, model) {
2358
+ const normalizedProvider = asTrimmedLowercaseString(provider);
2359
+ const normalizedModel = asTrimmedLowercaseString(model);
2360
+ if (normalizedProvider === "openai") {
2361
+ return /^gpt-[a-z0-9.-]+-pro(?:-|$)/.test(normalizedModel);
2362
+ }
2363
+ if (normalizedProvider === "deepinfra") {
2364
+ return normalizedModel.includes("claude") && (normalizedModel.includes("opus") || normalizedModel.includes("fable"));
2365
+ }
2366
+ if (normalizedProvider === "nolo") {
2367
+ return normalizedModel === "kimi-k3";
2368
+ }
2369
+ return false;
2370
+ }
2371
+ 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`;
2372
+ function shouldBlockForGptPro(agent, gptProStatus) {
2373
+ if (!agent) return { blocked: false };
2374
+ if (agent.apiSource === "cli") return { blocked: false };
2375
+ if (!isGptProModel(agent.provider, agent.model)) return { blocked: false };
2376
+ if (gptProStatus === "active") return { blocked: false };
2377
+ return { blocked: true, message: GPT_PRO_BLOCKED_MESSAGE };
2378
+ }
2379
+
2339
2380
  // packages/ai/agent/persistMessageWithFixedId.ts
2340
2381
  async function persistMessageWithFixedId(dispatch, message) {
2341
2382
  dispatch(addUserMessage(message));
2342
- const { controller, ...messageToWrite } = message;
2383
+ const { controller, dialogId: _dialogId, ...messageToWrite } = message;
2343
2384
  try {
2344
2385
  const writeRequest = dispatch(
2345
2386
  write({
@@ -2418,6 +2459,7 @@ function normalizeDesktopAgentRuntimeTurnError(data) {
2418
2459
  async function* runDesktopAgentRuntimeTurnStream({
2419
2460
  fetchImpl = fetch,
2420
2461
  signal,
2462
+ noEventWatchdogMs,
2421
2463
  ...args
2422
2464
  }) {
2423
2465
  try {
@@ -2474,7 +2516,13 @@ async function* runDesktopAgentRuntimeTurnStream({
2474
2516
  yield { type: "error", error: "The operation was aborted." };
2475
2517
  return;
2476
2518
  }
2477
- const { done, value } = await readStreamChunk(reader, { signal });
2519
+ const { done, value } = await readStreamChunk(reader, {
2520
+ signal,
2521
+ ...noEventWatchdogMs && noEventWatchdogMs > 0 ? {
2522
+ timeoutMs: noEventWatchdogMs,
2523
+ timeoutErrorMessage: `Desktop turn stream stalled: no event within ${noEventWatchdogMs}ms`
2524
+ } : {}
2525
+ });
2478
2526
  if (done) break;
2479
2527
  buffer += decoder.decode(value, { stream: true });
2480
2528
  const lines = buffer.split("\n");
@@ -2596,7 +2644,8 @@ var toolMessageWillPersist = (toolMsg) => {
2596
2644
  if (typeof content === "string") return content.trim().length > 0;
2597
2645
  return Array.isArray(content) && content.length > 0;
2598
2646
  };
2599
- var shouldUseDesktopLocalRuntime = (agentConfig) => {
2647
+ var shouldUseDesktopLocalRuntime = (agentConfig, explicitTarget) => {
2648
+ if (explicitTarget?.kind === "machine") return false;
2600
2649
  if (!getIsDesktopApp()) return false;
2601
2650
  return agentConfig?.apiSource !== "cli";
2602
2651
  };
@@ -3048,6 +3097,28 @@ function hasInlineExecutedToolCalls(result) {
3048
3097
  const output = result?.output;
3049
3098
  return Array.isArray(output) && output.some((b) => b?.type === "toolCall" && b?.result != null);
3050
3099
  }
3100
+ 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;
3101
+ var DESKTOP_SSE_NO_EVENT_WATCHDOG_MS = 20 * 60 * 1e3;
3102
+ function classifyLocalTurnStreamError(errorText) {
3103
+ const text = typeof errorText === "string" ? errorText : "";
3104
+ if (COMPACTION_TIMEOUT_PATTERN.test(text)) {
3105
+ return {
3106
+ kind: "compaction_timeout",
3107
+ retryable: true,
3108
+ summary: "\u5386\u53F2\u538B\u7F29\u8D85\u65F6",
3109
+ 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"
3110
+ };
3111
+ }
3112
+ if (isContextOverflowText(text)) {
3113
+ return {
3114
+ kind: "context_overflow",
3115
+ retryable: true,
3116
+ summary: "\u4E0A\u4E0B\u6587\u8FC7\u957F",
3117
+ 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"
3118
+ };
3119
+ }
3120
+ return { kind: "generic", retryable: true, summary: "", actionHint: "" };
3121
+ }
3051
3122
  function createRemoteToolEventHandlers(opts) {
3052
3123
  const { dialogId, dispatch, messageMetadata } = opts;
3053
3124
  const activeToolMessages = /* @__PURE__ */ new Map();
@@ -3182,6 +3253,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3182
3253
  thunkApi.signal.addEventListener("abort", onAbort);
3183
3254
  let loopKey = null;
3184
3255
  let runtimeDialogKey = explicitDialogKey ?? null;
3256
+ let turnPhaseTurnId = null;
3185
3257
  let remoteTransientMessageId = null;
3186
3258
  let remoteTransientMessageFinalized = false;
3187
3259
  let modelRequestStarted = false;
@@ -3290,8 +3362,14 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3290
3362
  const configuredBoundMachineId = asTrimmedString(
3291
3363
  agentConfig.runtimeBinding?.machineId
3292
3364
  );
3293
- const boundMachineId = resolveRemoteBoundMachineId(configuredBoundMachineId);
3294
- if (agentConfig.apiSource === "cli" || boundMachineId && !getIsDesktopApp()) {
3365
+ const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
3366
+ const explicitTarget = runtimeOptions?.runtimeTarget ?? (currentDialog?.runtimeBinding?.target?.kind === "server" || currentDialog?.runtimeBinding?.target?.kind === "machine" ? currentDialog.runtimeBinding.target : void 0);
3367
+ const boundMachineId = explicitTarget ? explicitTarget.kind === "machine" ? asTrimmedString(explicitTarget.machineId) : null : resolveRemoteBoundMachineId(configuredBoundMachineId);
3368
+ const hasExplicitMachineTarget = explicitTarget?.kind === "machine";
3369
+ if (hasExplicitMachineTarget && !boundMachineId) {
3370
+ 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");
3371
+ }
3372
+ if (hasExplicitMachineTarget || agentConfig.apiSource === "cli" && !explicitTarget || boundMachineId && !getIsDesktopApp()) {
3295
3373
  console.info("[streamAgentChatTurn] Triggered CLI/machine route. apiSource:", agentConfig.apiSource, "boundMachineId:", boundMachineId, "agentKey:", agentKey);
3296
3374
  const currentState = getState();
3297
3375
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
@@ -3326,6 +3404,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3326
3404
  let accumulated2 = "";
3327
3405
  let totalTurnUsage2 = void 0;
3328
3406
  const buildMachineAssistantMessage = () => ({
3407
+ dialogId: dialogId2,
3329
3408
  id: messageId,
3330
3409
  dbKey: msgKey,
3331
3410
  role: "assistant",
@@ -3375,6 +3454,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3375
3454
  stream: true,
3376
3455
  persistDialog: false,
3377
3456
  clientDialogId: dialogId2,
3457
+ ...explicitTarget ? { runtimeTarget: explicitTarget } : {},
3378
3458
  runtimeContext: {
3379
3459
  surface: "web",
3380
3460
  host: "browser",
@@ -3600,6 +3680,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3600
3680
  let cliTurnUsage = null;
3601
3681
  const decoder = new TextDecoder();
3602
3682
  const buildCliAssistantMessage = () => ({
3683
+ dialogId: dialogId2,
3603
3684
  id: messageId,
3604
3685
  dbKey: msgKey,
3605
3686
  role: "assistant",
@@ -3722,7 +3803,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3722
3803
  }
3723
3804
  return;
3724
3805
  }
3725
- const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
3726
3806
  const activeDialogKey = currentDialog?.dbKey;
3727
3807
  const dialogKey = explicitDialogKey || activeDialogKey;
3728
3808
  if (!dialogKey) {
@@ -3734,11 +3814,13 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3734
3814
  dialogKey,
3735
3815
  dialogId
3736
3816
  });
3737
- if (shouldUseDesktopLocalRuntime(agentConfig)) {
3817
+ if (shouldUseDesktopLocalRuntime(agentConfig, explicitTarget)) {
3738
3818
  const desktopMessageMetadata = buildMessageMetadata(agentConfig);
3739
3819
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
3740
3820
  loopKey = `loop:${dialogId}`;
3741
3821
  dispatch(addActiveController({ messageId: loopKey, controller: loopController, dialogKey }));
3822
+ turnPhaseTurnId = `turn-phase:${dialogId}:${Date.now().toString(36)}:${Math.random().toString(36).slice(2, 8)}`;
3823
+ claimDialogTurnPhase({ dialogKey, turnId: turnPhaseTurnId });
3742
3824
  let currentContent = "";
3743
3825
  const assistantSegments = [];
3744
3826
  let assistantMessageKeys = null;
@@ -3811,7 +3893,18 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3811
3893
  workspaceToolsHint: runtimeOptions?.workspaceToolsHint === true,
3812
3894
  agentConfigSnapshot: agentConfig,
3813
3895
  dialogMessages: selectAllMsgs(getState(), dialogId),
3814
- signal: loopController.signal
3896
+ signal: loopController.signal,
3897
+ // SSE 传输层兜底(review 修复 4):此前本调用方从不传
3898
+ // noEventWatchdogMs,watchdog 永远关闭——「已有安全网」只是
3899
+ // 错觉,挂起点若在 provider.complete 之外(resolveProvider /
3900
+ // adapter 内部,runtime 没有任何 deadline)就会无限静默。
3901
+ // 量级必须大于 runtime 自己的 idle 窗(默认 10 分钟无新输出
3902
+ // 才放弃,见 localLoop.DEFAULT_LLM_REQUEST_TIMEOUT_MS),
3903
+ // 否则一个健康的慢思考轮次会被客户端提前判死,用户拿到的是
3904
+ // 未分类的 "stream stalled" 而不是 runtime 的
3905
+ // LLM_REQUEST_TIMEOUT 可操作文案。取 2× = 20 分钟:
3906
+ // 只兜「runtime 完全没 deadline」的真悬挂。
3907
+ noEventWatchdogMs: DESKTOP_SSE_NO_EVENT_WATCHDOG_MS
3815
3908
  });
3816
3909
  for await (const event of eventStream) {
3817
3910
  if (loopController.signal.aborted || thunkApi.signal.aborted) {
@@ -3884,6 +3977,9 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3884
3977
  dispatch(messageStreaming(toolResultMsg));
3885
3978
  }
3886
3979
  }
3980
+ } else if (event.type === "status") {
3981
+ const phase = event.phase === "validating-context" ? "validating" : event.phase;
3982
+ setDialogTurnPhase({ phase, dialogKey, turnId: turnPhaseTurnId ?? void 0 });
3887
3983
  } else if (event.type === "done") {
3888
3984
  streamResult = event.result;
3889
3985
  } else if (event.type === "error") {
@@ -3924,6 +4020,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3924
4020
  stopToolNameById
3925
4021
  );
3926
4022
  await persistMessageWithFixedId(dispatch, {
4023
+ dialogId,
3927
4024
  id: segment2.messageId,
3928
4025
  dbKey: segment2.key,
3929
4026
  role: "assistant",
@@ -3974,6 +4071,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3974
4071
  errorToolNameById
3975
4072
  );
3976
4073
  await persistMessageWithFixedId(dispatch, {
4074
+ dialogId,
3977
4075
  id: segment2.messageId,
3978
4076
  dbKey: segment2.key,
3979
4077
  role: "assistant",
@@ -4015,8 +4113,12 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4015
4113
  setLoopStopReason("error");
4016
4114
  };
4017
4115
  if (streamError) {
4018
- await finalizeDesktopTurnOnError(streamError);
4019
- return rejectWithValue(streamError);
4116
+ const info = classifyLocalTurnStreamError(streamError);
4117
+ const finalError = info.actionHint ? `${streamError}
4118
+
4119
+ ${info.actionHint}` : streamError;
4120
+ await finalizeDesktopTurnOnError(finalError);
4121
+ return rejectWithValue(finalError);
4020
4122
  }
4021
4123
  if (!streamResult) {
4022
4124
  const message = "Local turn stream closed unexpectedly without result";
@@ -4146,6 +4248,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4146
4248
  let accumulated = "";
4147
4249
  let totalTurnUsage2 = void 0;
4148
4250
  const buildRemoteAssistantMessage = () => ({
4251
+ dialogId,
4149
4252
  id: messageId,
4150
4253
  dbKey: msgKey,
4151
4254
  role: "assistant",
@@ -4190,6 +4293,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4190
4293
  stream: true,
4191
4294
  persistDialog: false,
4192
4295
  clientDialogId: dialogId,
4296
+ ...explicitTarget ? { runtimeTarget: explicitTarget } : {},
4193
4297
  runtimeContext: {
4194
4298
  surface: "web",
4195
4299
  host: "browser",
@@ -4982,6 +5086,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4982
5086
  error?.message || "An unexpected error occurred in streamAgentChatTurn."
4983
5087
  );
4984
5088
  } finally {
5089
+ clearDialogTurnPhase({ dialogKey: runtimeDialogKey ?? void 0, turnId: turnPhaseTurnId ?? void 0 });
4985
5090
  if (loopKey && runtimeDialogKey) {
4986
5091
  dispatch(removeActiveController({ messageId: loopKey, dialogKey: runtimeDialogKey }));
4987
5092
  } else if (loopKey) {
@@ -5001,5 +5106,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
5001
5106
  }
5002
5107
  };
5003
5108
  export {
5109
+ classifyLocalTurnStreamError,
5004
5110
  streamAgentChatTurnHandler
5005
5111
  };