nolo-cli 0.101.0-alpha.1 → 0.101.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 (206) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-LUNEV235.js → _executeModel-WLFACVFR.js} +74 -67
  3. package/action-PNPQLJHG.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-RBOUD7SJ.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-IODCR6TB.js} +18 -19
  6. package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-EFWZSSZA.js} +47 -42
  7. package/{agentEmailCommands-G6A7IRPQ.js → agentEmailCommands-FJ2DAY5M.js} +97 -87
  8. package/agentListCommands-EDV4RJ4D.js +742 -0
  9. package/{agentMachineCommands-W2SMNSQ3.js → agentMachineCommands-UOEI4TPN.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-MLDVCTFN.js +138 -0
  13. package/agentRunCommand-SY7N2BDL.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-SXYAKX3A.js} +48 -39
  16. package/{agentSlice-5YJHUO47.js → agentSlice-WBSSBKBB.js} +14 -13
  17. package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-GTTBG53T.js} +46 -41
  18. package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-ZZCHUJAT.js} +46 -41
  19. package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-GZLLGY7Z.js} +46 -41
  20. package/{appGetCommands-SFAPP5PB.js → appGetCommands-ZRLWHJ3C.js} +46 -41
  21. package/{appListCommands-EKUBDRUO.js → appListCommands-OHARWLIL.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-NHDLY3IB.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-UDBJVSZU.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MAR5LPAC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  30. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  31. package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
  32. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  33. package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
  34. package/chunk-4LCOCOR5.js +50 -0
  35. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  36. package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
  37. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  38. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  39. package/chunk-5J3PYNUP.js +255 -0
  40. package/{chunk-DRGSDQBL.js → chunk-5LTAPGPV.js} +10 -10
  41. package/chunk-5MMAK75Q.js +15 -0
  42. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  43. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  44. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  45. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  46. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  47. package/{chunk-L5UXH3B2.js → chunk-7TKWCTSY.js} +22 -6
  48. package/chunk-A4SQRTZ6.js +15 -0
  49. package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
  50. package/chunk-AGIM7IMJ.js +147 -0
  51. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  52. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  53. package/chunk-BMQ2MJUK.js +153 -0
  54. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  55. package/{chunk-4S5QUMJP.js → chunk-CHNCM7EF.js} +11 -9
  56. package/chunk-CHOZJMJS.js +78 -0
  57. package/chunk-CJN5OERD.js +13545 -0
  58. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  59. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  60. package/{chunk-RFCKMYDK.js → chunk-DNHENQ3T.js} +23 -28
  61. package/chunk-DZ7R5V3Y.js +164 -0
  62. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  63. package/{chunk-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
  64. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  65. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  66. package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
  67. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  68. package/{chunk-6IG4XSS6.js → chunk-FY7DCYW7.js} +88 -17
  69. package/{chunk-6VFARHZW.js → chunk-G53AA7RW.js} +934 -1091
  70. package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
  71. package/chunk-GMZLP5DV.js +82 -0
  72. package/{chunk-5FBTLSFG.js → chunk-GUYEMTRK.js} +551 -516
  73. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  74. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  75. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  76. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  77. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  78. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  79. package/{chunk-6Q33GUCC.js → chunk-KLUBZL6X.js} +1 -1
  80. package/{chunk-4OEFYTWL.js → chunk-LKERWYPX.js} +67 -48
  81. package/{chunk-OEVAY4J6.js → chunk-LNVJHIGA.js} +18 -20
  82. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  83. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  84. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  85. package/{chunk-X6DN5HBD.js → chunk-NRUSXKH7.js} +24 -5
  86. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  87. package/chunk-NWENLDMM.js +42 -0
  88. package/{chunk-AEOE4Z6Q.js → chunk-NZWAO6LH.js} +13 -15
  89. package/chunk-OCZKATRC.js +129 -0
  90. package/{chunk-G2O6V3HJ.js → chunk-ODTDLPBV.js} +20 -11
  91. package/chunk-OW4APERY.js +870 -0
  92. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  93. package/{chunk-Q2XN3EOZ.js → chunk-OYPMWCIQ.js} +67 -45
  94. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  95. package/chunk-PH275YDS.js +7881 -0
  96. package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
  97. package/{chunk-5H7KJX7J.js → chunk-SEB5HAUU.js} +5 -5
  98. package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
  99. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  100. package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
  101. package/chunk-TY3TIUJK.js +89 -0
  102. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  103. package/{chunk-ORYWEJO4.js → chunk-U6IGAJT4.js} +47 -67
  104. package/{chunk-RG6JBBX5.js → chunk-U7XXEI5R.js} +166 -13
  105. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  106. package/chunk-UJXNKP5V.js +760 -0
  107. package/{chunk-UKZDAFYT.js → chunk-UM4PH574.js} +6 -10
  108. package/{chunk-GEPUP7OO.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  110. package/{chunk-NA35QHCF.js → chunk-V7Y6KRAH.js} +1 -1
  111. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  112. package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
  113. package/chunk-VIWDGTDA.js +8 -0
  114. package/chunk-VJVNU77E.js +83 -0
  115. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  116. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  117. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  118. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  119. package/{chunk-SSDAAEC2.js → chunk-X34KOYU2.js} +873 -227
  120. package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
  121. package/{chunk-45C5ER5U.js → chunk-XIRXOUBV.js} +19 -17
  122. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  123. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  124. package/{chunk-ETI2NYVF.js → chunk-YPOPJAKN.js} +4 -4
  125. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  126. package/chunk-YV25TM3R.js +780 -0
  127. package/{chunk-BTI7PJDX.js → chunk-Z56IK6UT.js} +29 -78
  128. package/chunk-ZRAU6T47.js +56 -0
  129. package/commandRegistry-2HPRUR3I.js +833 -0
  130. package/{contentThunks-GJV22WVZ.js → contentThunks-F2BNWOZV.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-6V25TZEO.js → createAgentAutomationAction-5N2NRNR7.js} +38 -36
  133. package/createDialogAction-DSEG4L5Y.js +69 -0
  134. package/{createPageAction-IR4BGJSI.js → createPageAction-K32FYQPE.js} +45 -42
  135. package/{chunk-YFE4A4O7.js → cursorProvider-YGGNMVWX.js} +2496 -9897
  136. package/{dbSlice-XVWBAGYN.js → dbSlice-Q25STFGJ.js} +11 -10
  137. package/{deleteFile-YG6QMJLU.js → deleteFile-AJ2EZMHT.js} +7 -6
  138. package/{dialogCommands-5J56DFWN.js → dialogCommands-LF7PLYAD.js} +49 -45
  139. package/{dialogSlice-UNX2FAPZ.js → dialogSlice-4GBOUTGL.js} +40 -33
  140. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  141. package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-NQR3S7A4.js} +48 -43
  142. package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-V3IAQ2HT.js} +49 -44
  143. package/{docReadCommands-HOSVSBDJ.js → docReadCommands-GDX4CLSU.js} +47 -42
  144. package/{docStore-JWVG5NDO.js → docStore-ZTYSP3YE.js} +16 -12
  145. package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-QMYXWQOU.js} +48 -43
  146. package/{fetchMessages-EIU7UFFK.js → fetchMessages-I5ICDDHM.js} +5 -5
  147. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  148. package/{handleSendMessageAction-B75UOJKF.js → handleSendMessageAction-XFZH2TQS.js} +110 -86
  149. package/index.js +87 -884
  150. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  151. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
  152. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  153. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  154. package/{machineCommands-GFPTOY6L.js → machineCommands-KMU3D5I5.js} +91 -81
  155. package/machineWsRunDispatch-6GJ5YOSW.js +154 -0
  156. package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.js} +20 -18
  157. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  158. package/oauthTokenStore-ITEB663N.js +23 -0
  159. package/package.json +1 -1
  160. package/pdf-U6KSUEZZ.js +26435 -0
  161. package/processSpawn-SOAV3FEV.js +11 -0
  162. package/profileConfig-ZGOFORWV.js +43 -0
  163. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  164. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  165. package/{read-COE3ZYR6.js → read-SRQMNO26.js} +7 -6
  166. package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
  167. package/{readlineWorkspace-UFSWHFKD.js → readlineWorkspace-ZMNRQXMC.js} +2704 -2060
  168. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  169. package/{runAgentClientLoop-25LJ4XGV.js → runAgentClientLoop-URRDZ5WG.js} +75 -69
  170. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  171. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  172. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
  173. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
  174. package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.js} +226 -940
  175. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  176. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  177. package/{spaceCommands-NKJVJCQQ.js → spaceCommands-2P2X37MC.js} +51 -46
  178. package/{streamAgentChatTurn-A46QFV4O.js → streamAgentChatTurn-YPUYKXDX.js} +206 -105
  179. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
  180. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  181. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  182. package/tools-M5ENXZRJ.js +116 -0
  183. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
  184. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  185. package/{updateDialogTitleAction-QJPZGF52.js → updateDialogTitleAction-7PNUE23W.js} +82 -44
  186. package/action-YVYQEAAV.js +0 -31
  187. package/agentListCommands-KMS675GZ.js +0 -406
  188. package/agentRecordCommands-D7BRMFNI.js +0 -128
  189. package/agentRunCommand-VL6MMEUB.js +0 -155
  190. package/browser-image-compression-MFDTD7K6.js +0 -1763
  191. package/chatQueueReduxAdapter-PQMRR2PK.js +0 -186
  192. package/chunk-M76ECQRD.js +0 -13658
  193. package/chunk-MEYIRKDN.js +0 -8967
  194. package/chunk-Q5FJJ6XI.js +0 -103
  195. package/chunk-QVKRR2SS.js +0 -20782
  196. package/chunk-S7Z2HMCN.js +0 -25
  197. package/chunk-Y5GCAMGP.js +0 -9
  198. package/chunk-YPREESF4.js +0 -225
  199. package/createDialogAction-SX36BGSX.js +0 -65
  200. package/machineWsRunDispatch-46PSZ3DJ.js +0 -144
  201. package/settingSlice-ZQZVUPKK.js +0 -204
  202. package/syncMapping-N6RGXGBW.js +0 -437
  203. package/tools-TTDGRNY6.js +0 -110
  204. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  205. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  206. 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-BTI7PJDX.js";
18
+ } from "./chunk-Z56IK6UT.js";
20
19
  import "./chunk-JEXVIMYZ.js";
21
20
  import {
22
21
  prepareTools
23
- } from "./chunk-DRGSDQBL.js";
22
+ } from "./chunk-5LTAPGPV.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-Q2XN3EOZ.js";
40
+ } from "./chunk-OYPMWCIQ.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-5FBTLSFG.js";
50
- import "./chunk-5UTFL4QJ.js";
47
+ resolveAgentRequiredPackIds,
48
+ selectAiRecentContentLimit,
49
+ selectGlobalPrompt,
50
+ selectKnowledgeCaptureLevel,
51
+ selectMaxExecutionTime,
52
+ selectSpaceContextLevel,
53
+ selectUserTonePreset
54
+ } from "./chunk-GUYEMTRK.js";
51
55
  import "./chunk-NF64D32W.js";
56
+ import "./chunk-U7XXEI5R.js";
57
+ import "./chunk-AOTBKDRK.js";
52
58
  import "./chunk-3L2WKC3W.js";
53
- import "./chunk-3VNWWVKB.js";
54
- import "./chunk-RG6JBBX5.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-GARACBQB.js";
62
+ import "./chunk-FJ5BGMNM.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-UM4PH574.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-G2O6V3HJ.js";
84
- import "./chunk-RFCKMYDK.js";
92
+ } from "./chunk-ODTDLPBV.js";
93
+ import "./chunk-DNHENQ3T.js";
94
+ import "./chunk-E3YWHWCR.js";
85
95
  import {
86
96
  getTableState
87
- } from "./chunk-ORYWEJO4.js";
97
+ } from "./chunk-U6IGAJT4.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-QVKRR2SS.js";
113
- import "./chunk-MC4XLIJ7.js";
114
- import "./chunk-3BMYXEUW.js";
121
+ } from "./chunk-CJN5OERD.js";
115
122
  import "./chunk-YYLHWIW6.js";
123
+ import "./chunk-6O4IK4V2.js";
124
+ import "./chunk-523DITKR.js";
116
125
  import "./chunk-AGGIDPCZ.js";
117
- import "./chunk-4S5QUMJP.js";
126
+ import "./chunk-CHNCM7EF.js";
118
127
  import {
119
128
  createCliChatTurnStream,
120
129
  getCliChatSession,
121
130
  startCliChatSession
122
- } from "./chunk-TOP2VXOR.js";
131
+ } from "./chunk-PCF3QU5Q.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-ADBZWMFB.js";
150
+ import "./chunk-VEYL5MO5.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-WCGC6S77.js";
161
+ import "./chunk-WJ3B6FX6.js";
162
+ import "./chunk-AUDNYVRC.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-SEB5HAUU.js";
158
173
  import "./chunk-5ZUL4CUO.js";
174
+ import "./chunk-CQ3WA2NE.js";
159
175
  import "./chunk-N7J63Q6C.js";
160
- import "./chunk-L5UXH3B2.js";
176
+ import "./chunk-7TKWCTSY.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-4YSOUKUR.js";
185
+ import "./chunk-H6A6X4EK.js";
172
186
  import {
173
187
  getModelContextWindow,
174
188
  getModelInfo
175
- } from "./chunk-4OEFYTWL.js";
189
+ } from "./chunk-LKERWYPX.js";
176
190
  import {
177
191
  planContextUsage
178
- } from "./chunk-DNCEALKX.js";
192
+ } from "./chunk-7MMSLEPA.js";
193
+ import "./chunk-5MMAK75Q.js";
194
+ import "./chunk-BYXBJQAS.js";
195
+ import "./chunk-DWLEOOGR.js";
196
+ import "./chunk-XFUBXRVI.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-E73ON47R.js";
204
+ import "./chunk-UAD2WT54.js";
205
+ import {
206
+ patch,
207
+ read,
208
+ selectById,
209
+ write
210
+ } from "./chunk-4FFUDT6D.js";
211
+ import "./chunk-46Y5D2BZ.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-XUWRURDF.js";
222
+ import "./chunk-5J3PYNUP.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-PTDYOADJ.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-UJXNKP5V.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-W72ISAKC.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-3AH7LNUB.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");
@@ -3048,6 +3096,28 @@ function hasInlineExecutedToolCalls(result) {
3048
3096
  const output = result?.output;
3049
3097
  return Array.isArray(output) && output.some((b) => b?.type === "toolCall" && b?.result != null);
3050
3098
  }
3099
+ 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;
3100
+ var DESKTOP_SSE_NO_EVENT_WATCHDOG_MS = 20 * 60 * 1e3;
3101
+ function classifyLocalTurnStreamError(errorText) {
3102
+ const text = typeof errorText === "string" ? errorText : "";
3103
+ if (COMPACTION_TIMEOUT_PATTERN.test(text)) {
3104
+ return {
3105
+ kind: "compaction_timeout",
3106
+ retryable: true,
3107
+ summary: "\u5386\u53F2\u538B\u7F29\u8D85\u65F6",
3108
+ 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"
3109
+ };
3110
+ }
3111
+ if (isContextOverflowText(text)) {
3112
+ return {
3113
+ kind: "context_overflow",
3114
+ retryable: true,
3115
+ summary: "\u4E0A\u4E0B\u6587\u8FC7\u957F",
3116
+ 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"
3117
+ };
3118
+ }
3119
+ return { kind: "generic", retryable: true, summary: "", actionHint: "" };
3120
+ }
3051
3121
  function createRemoteToolEventHandlers(opts) {
3052
3122
  const { dialogId, dispatch, messageMetadata } = opts;
3053
3123
  const activeToolMessages = /* @__PURE__ */ new Map();
@@ -3182,6 +3252,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3182
3252
  thunkApi.signal.addEventListener("abort", onAbort);
3183
3253
  let loopKey = null;
3184
3254
  let runtimeDialogKey = explicitDialogKey ?? null;
3255
+ let turnPhaseTurnId = null;
3185
3256
  let remoteTransientMessageId = null;
3186
3257
  let remoteTransientMessageFinalized = false;
3187
3258
  let modelRequestStarted = false;
@@ -3290,8 +3361,10 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3290
3361
  const configuredBoundMachineId = asTrimmedString(
3291
3362
  agentConfig.runtimeBinding?.machineId
3292
3363
  );
3293
- const boundMachineId = resolveRemoteBoundMachineId(configuredBoundMachineId);
3294
- if (agentConfig.apiSource === "cli" || boundMachineId && !getIsDesktopApp()) {
3364
+ const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
3365
+ const explicitTarget = runtimeOptions?.runtimeTarget ?? (currentDialog?.runtimeBinding?.target?.kind === "server" || currentDialog?.runtimeBinding?.target?.kind === "machine" ? currentDialog.runtimeBinding.target : void 0);
3366
+ const boundMachineId = explicitTarget ? explicitTarget.kind === "machine" ? asTrimmedString(explicitTarget.machineId) : null : resolveRemoteBoundMachineId(configuredBoundMachineId);
3367
+ if (agentConfig.apiSource === "cli" && !explicitTarget || boundMachineId && !getIsDesktopApp()) {
3295
3368
  console.info("[streamAgentChatTurn] Triggered CLI/machine route. apiSource:", agentConfig.apiSource, "boundMachineId:", boundMachineId, "agentKey:", agentKey);
3296
3369
  const currentState = getState();
3297
3370
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
@@ -3326,6 +3399,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3326
3399
  let accumulated2 = "";
3327
3400
  let totalTurnUsage2 = void 0;
3328
3401
  const buildMachineAssistantMessage = () => ({
3402
+ dialogId: dialogId2,
3329
3403
  id: messageId,
3330
3404
  dbKey: msgKey,
3331
3405
  role: "assistant",
@@ -3375,6 +3449,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3375
3449
  stream: true,
3376
3450
  persistDialog: false,
3377
3451
  clientDialogId: dialogId2,
3452
+ ...explicitTarget ? { runtimeTarget: explicitTarget } : {},
3378
3453
  runtimeContext: {
3379
3454
  surface: "web",
3380
3455
  host: "browser",
@@ -3600,6 +3675,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3600
3675
  let cliTurnUsage = null;
3601
3676
  const decoder = new TextDecoder();
3602
3677
  const buildCliAssistantMessage = () => ({
3678
+ dialogId: dialogId2,
3603
3679
  id: messageId,
3604
3680
  dbKey: msgKey,
3605
3681
  role: "assistant",
@@ -3722,7 +3798,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3722
3798
  }
3723
3799
  return;
3724
3800
  }
3725
- const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
3726
3801
  const activeDialogKey = currentDialog?.dbKey;
3727
3802
  const dialogKey = explicitDialogKey || activeDialogKey;
3728
3803
  if (!dialogKey) {
@@ -3739,6 +3814,8 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3739
3814
  const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
3740
3815
  loopKey = `loop:${dialogId}`;
3741
3816
  dispatch(addActiveController({ messageId: loopKey, controller: loopController, dialogKey }));
3817
+ turnPhaseTurnId = `turn-phase:${dialogId}:${Date.now().toString(36)}:${Math.random().toString(36).slice(2, 8)}`;
3818
+ claimDialogTurnPhase({ dialogKey, turnId: turnPhaseTurnId });
3742
3819
  let currentContent = "";
3743
3820
  const assistantSegments = [];
3744
3821
  let assistantMessageKeys = null;
@@ -3811,7 +3888,18 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3811
3888
  workspaceToolsHint: runtimeOptions?.workspaceToolsHint === true,
3812
3889
  agentConfigSnapshot: agentConfig,
3813
3890
  dialogMessages: selectAllMsgs(getState(), dialogId),
3814
- signal: loopController.signal
3891
+ signal: loopController.signal,
3892
+ // SSE 传输层兜底(review 修复 4):此前本调用方从不传
3893
+ // noEventWatchdogMs,watchdog 永远关闭——「已有安全网」只是
3894
+ // 错觉,挂起点若在 provider.complete 之外(resolveProvider /
3895
+ // adapter 内部,runtime 没有任何 deadline)就会无限静默。
3896
+ // 量级必须大于 runtime 自己的 idle 窗(默认 10 分钟无新输出
3897
+ // 才放弃,见 localLoop.DEFAULT_LLM_REQUEST_TIMEOUT_MS),
3898
+ // 否则一个健康的慢思考轮次会被客户端提前判死,用户拿到的是
3899
+ // 未分类的 "stream stalled" 而不是 runtime 的
3900
+ // LLM_REQUEST_TIMEOUT 可操作文案。取 2× = 20 分钟:
3901
+ // 只兜「runtime 完全没 deadline」的真悬挂。
3902
+ noEventWatchdogMs: DESKTOP_SSE_NO_EVENT_WATCHDOG_MS
3815
3903
  });
3816
3904
  for await (const event of eventStream) {
3817
3905
  if (loopController.signal.aborted || thunkApi.signal.aborted) {
@@ -3884,6 +3972,9 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3884
3972
  dispatch(messageStreaming(toolResultMsg));
3885
3973
  }
3886
3974
  }
3975
+ } else if (event.type === "status") {
3976
+ const phase = event.phase === "validating-context" ? "validating" : event.phase;
3977
+ setDialogTurnPhase({ phase, dialogKey, turnId: turnPhaseTurnId ?? void 0 });
3887
3978
  } else if (event.type === "done") {
3888
3979
  streamResult = event.result;
3889
3980
  } else if (event.type === "error") {
@@ -3924,6 +4015,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3924
4015
  stopToolNameById
3925
4016
  );
3926
4017
  await persistMessageWithFixedId(dispatch, {
4018
+ dialogId,
3927
4019
  id: segment2.messageId,
3928
4020
  dbKey: segment2.key,
3929
4021
  role: "assistant",
@@ -3974,6 +4066,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
3974
4066
  errorToolNameById
3975
4067
  );
3976
4068
  await persistMessageWithFixedId(dispatch, {
4069
+ dialogId,
3977
4070
  id: segment2.messageId,
3978
4071
  dbKey: segment2.key,
3979
4072
  role: "assistant",
@@ -4015,8 +4108,12 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4015
4108
  setLoopStopReason("error");
4016
4109
  };
4017
4110
  if (streamError) {
4018
- await finalizeDesktopTurnOnError(streamError);
4019
- return rejectWithValue(streamError);
4111
+ const info = classifyLocalTurnStreamError(streamError);
4112
+ const finalError = info.actionHint ? `${streamError}
4113
+
4114
+ ${info.actionHint}` : streamError;
4115
+ await finalizeDesktopTurnOnError(finalError);
4116
+ return rejectWithValue(finalError);
4020
4117
  }
4021
4118
  if (!streamResult) {
4022
4119
  const message = "Local turn stream closed unexpectedly without result";
@@ -4146,6 +4243,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4146
4243
  let accumulated = "";
4147
4244
  let totalTurnUsage2 = void 0;
4148
4245
  const buildRemoteAssistantMessage = () => ({
4246
+ dialogId,
4149
4247
  id: messageId,
4150
4248
  dbKey: msgKey,
4151
4249
  role: "assistant",
@@ -4190,6 +4288,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4190
4288
  stream: true,
4191
4289
  persistDialog: false,
4192
4290
  clientDialogId: dialogId,
4291
+ ...explicitTarget ? { runtimeTarget: explicitTarget } : {},
4193
4292
  runtimeContext: {
4194
4293
  surface: "web",
4195
4294
  host: "browser",
@@ -4982,6 +5081,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
4982
5081
  error?.message || "An unexpected error occurred in streamAgentChatTurn."
4983
5082
  );
4984
5083
  } finally {
5084
+ clearDialogTurnPhase({ dialogKey: runtimeDialogKey ?? void 0, turnId: turnPhaseTurnId ?? void 0 });
4985
5085
  if (loopKey && runtimeDialogKey) {
4986
5086
  dispatch(removeActiveController({ messageId: loopKey, dialogKey: runtimeDialogKey }));
4987
5087
  } else if (loopKey) {
@@ -5001,5 +5101,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
5001
5101
  }
5002
5102
  };
5003
5103
  export {
5104
+ classifyLocalTurnStreamError,
5004
5105
  streamAgentChatTurnHandler
5005
5106
  };
@@ -1,39 +1,38 @@
1
1
  import {
2
- getActiveDialogKey
3
- } from "./chunk-6YTOJY35.js";
2
+ formatISO
3
+ } from "./chunk-ZRAU6T47.js";
4
4
  import {
5
- require_date_fns
6
- } from "./chunk-M76ECQRD.js";
5
+ getActiveDialogKey
6
+ } from "./chunk-BZ7NPA6G.js";
7
+ import "./chunk-4LCOCOR5.js";
7
8
  import "./chunk-YDH3FDFQ.js";
8
9
  import {
9
10
  patch,
10
11
  selectById
11
- } from "./chunk-H62HCIUP.js";
12
- import "./chunk-VMFTFOWF.js";
13
- import "./chunk-WWC7I6TA.js";
14
- import "./chunk-ABQYVJBJ.js";
12
+ } from "./chunk-4FFUDT6D.js";
13
+ import "./chunk-46Y5D2BZ.js";
15
14
  import "./chunk-QSJ3HFEF.js";
16
- import "./chunk-WV42OMV7.js";
15
+ import "./chunk-PTDYOADJ.js";
16
+ import "./chunk-UJXNKP5V.js";
17
+ import "./chunk-D2MDMY2M.js";
17
18
  import "./chunk-BNGW5ASC.js";
18
19
  import "./chunk-M2EJHDJP.js";
19
- import "./chunk-UKWGR5SS.js";
20
- import "./chunk-QOKAKDPE.js";
20
+ import "./chunk-KUG52IAP.js";
21
+ import "./chunk-3AH7LNUB.js";
22
+ import "./chunk-WWC7I6TA.js";
23
+ import "./chunk-VY6VFGKR.js";
24
+ import "./chunk-HIM3FCLF.js";
21
25
  import "./chunk-OW765XBU.js";
22
26
  import "./chunk-SEJ5OS6F.js";
23
- import "./chunk-GBRG75BQ.js";
24
- import "./chunk-KUG52IAP.js";
25
- import "./chunk-3EUW3WEO.js";
26
27
  import "./chunk-U6VC4MU4.js";
28
+ import "./chunk-3EUW3WEO.js";
27
29
  import "./chunk-LCBAMY2M.js";
28
30
  import "./chunk-4SN6J65J.js";
29
31
  import "./chunk-CF7PE763.js";
30
32
  import "./chunk-G3SUCT4W.js";
31
- import {
32
- __toESM
33
- } from "./chunk-4VNS5WPM.js";
33
+ import "./chunk-4VNS5WPM.js";
34
34
 
35
35
  // packages/chat/dialog/actions/switchDialogAgentAction.ts
36
- var import_date_fns = __toESM(require_date_fns());
37
36
  var switchDialogAgentAction = async (payload, thunkApi) => {
38
37
  const { dispatch, getState } = thunkApi;
39
38
  const state = getState();
@@ -50,7 +49,7 @@ var switchDialogAgentAction = async (payload, thunkApi) => {
50
49
  }
51
50
  const changes = {
52
51
  activeAgentKey: payload.agentKey.trim(),
53
- updatedAt: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date())
52
+ updatedAt: formatISO(/* @__PURE__ */ new Date())
54
53
  };
55
54
  return await dispatch(
56
55
  patch({