nolo-cli 0.16.0 → 0.17.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 (132) hide show
  1. package/{_executeModel-AVCA2NAV.js → _executeModel-WPNX5DH4.js} +49 -43
  2. package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
  3. package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
  4. package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
  5. package/{agentDeleteCommand-QW5PUMDQ.js → agentDeleteCommand-L3357EFL.js} +31 -28
  6. package/{agentEmailCommands-4ORVLGVQ.js → agentEmailCommands-N65AVLEI.js} +61 -55
  7. package/{agentListCommands-YWBYRTYC.js → agentListCommands-CH27FTI2.js} +30 -27
  8. package/{agentMachineCommands-JSQW4FOA.js → agentMachineCommands-PPK5HJZB.js} +29 -26
  9. package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
  10. package/{agentRecordCommands-AASIWOBT.js → agentRecordCommands-HTVXD4TT.js} +56 -50
  11. package/{agentRunCommand-TB5BHXUH.js → agentRunCommand-MGLVJUA5.js} +62 -53
  12. package/{agentRunControl-6ADXVYMR.js → agentRunControl-P75VPTGS.js} +24 -1
  13. package/{agentRuntimeLocal-QNPNJRVH.js → agentRuntimeLocal-QUTBSY3I.js} +24 -21
  14. package/{agentSlice-RUNXC62Y.js → agentSlice-DOGRCMWK.js} +9 -8
  15. package/appDeleteCommands-FEEVXUBG.js +127 -0
  16. package/appDeployCommands-C4HCGC4B.js +166 -0
  17. package/appDeployStatusCommands-IR5ZUZBQ.js +147 -0
  18. package/appGetCommands-6RJGZ66Z.js +122 -0
  19. package/appListCommands-VMTF5YZF.js +125 -0
  20. package/{authCommand-YFTR3347.js → authCommand-WJZPOLSS.js} +16 -9
  21. package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
  22. package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
  23. package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
  24. package/{chunk-M43KDE25.js → chunk-45BY7RLP.js} +2 -8
  25. package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
  26. package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
  27. package/chunk-7BUYEZ6U.js +671 -0
  28. package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
  29. package/{chunk-AVVZUXXC.js → chunk-AAODAAUQ.js} +34 -13
  30. package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
  31. package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
  32. package/{chunk-AUURUT6L.js → chunk-BT6K76S7.js} +238 -424
  33. package/chunk-CEFXYF66.js +107 -0
  34. package/{chunk-RLCXU7A5.js → chunk-D3HVJJIA.js} +1 -1
  35. package/{chunk-JTMNCCWF.js → chunk-DKZFOK24.js} +16 -87
  36. package/chunk-DL6EPNIK.js +50 -0
  37. package/{chunk-4L2OJPCU.js → chunk-EGPCU42M.js} +58 -8
  38. package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
  39. package/chunk-FKXFCYVO.js +221 -0
  40. package/{chunk-4FX6NVDW.js → chunk-FPKLD4KB.js} +3 -136
  41. package/{chunk-PCTUYVUM.js → chunk-FVIPEIVX.js} +10 -3
  42. package/chunk-GFUIQ4RY.js +136 -0
  43. package/{chunk-66X4VSRC.js → chunk-HQPG2PIV.js} +41 -1
  44. package/{chunk-IGXREZW2.js → chunk-HV2A3B4W.js} +1 -1
  45. package/{chunk-LPEUV5RE.js → chunk-IOOMJJ4Z.js} +2 -2
  46. package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
  47. package/{chunk-3OIRVWXA.js → chunk-JP7REMYP.js} +10 -1
  48. package/chunk-KFEVY3ST.js +255 -0
  49. package/{chunk-P3RIAYGG.js → chunk-L2MLZQXU.js} +3 -3
  50. package/{chunk-55NSNCFM.js → chunk-L6NVTGI7.js} +1 -1
  51. package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
  52. package/{chunk-S2LXHNHG.js → chunk-MD3V54DA.js} +6 -6
  53. package/{chunk-6EVITP2G.js → chunk-MUCU6ATG.js} +2 -251
  54. package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
  55. package/{chunk-ZQBL7LIC.js → chunk-NEKFSXOP.js} +310 -211
  56. package/{chunk-NSCHQQPU.js → chunk-NVB267BZ.js} +397 -324
  57. package/{chunk-Z5JQNBNY.js → chunk-NYUXSXLY.js} +33 -14
  58. package/{chunk-FRV6A633.js → chunk-PZCBZO4J.js} +2 -2
  59. package/{chunk-GSINCD4P.js → chunk-QCJITMYO.js} +21 -11
  60. package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
  61. package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
  62. package/{chunk-BEBNFWDU.js → chunk-RRGVDPH3.js} +3 -3
  63. package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
  64. package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
  65. package/{chunk-3663CXZN.js → chunk-SNZV4QCE.js} +65 -22
  66. package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
  67. package/{chunk-MYMMNKYL.js → chunk-TSIYZBTH.js} +156 -6
  68. package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
  69. package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
  70. package/{chunk-DPAB4FQ7.js → chunk-UZY4BEBR.js} +1579 -212
  71. package/chunk-V5R4NZP2.js +78 -0
  72. package/{chunk-MR6ISAGB.js → chunk-VDNQF5VI.js} +6 -6
  73. package/{chunk-33BJUVK4.js → chunk-VGMJ6PDJ.js} +5 -5
  74. package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
  75. package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
  76. package/chunk-X4Q4UZEY.js +26 -0
  77. package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
  78. package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
  79. package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
  80. package/{chunk-7UKFVQ5W.js → chunk-YLRTBX4Y.js} +105 -36
  81. package/{chunk-DGEYDWEZ.js → chunk-YXTRNO5W.js} +3 -3
  82. package/{chunk-FY233ZFU.js → chunk-ZJZCMKOR.js} +107 -177
  83. package/{chunk-NVEWUJVX.js → chunk-ZVOZH2HW.js} +1 -1
  84. package/chunk-ZZ2MH7LE.js +84 -0
  85. package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
  86. package/codingSkills-36KN5NQT.js +48 -0
  87. package/{createAgentAutomationAction-FNHPSKKO.js → createAgentAutomationAction-PMOLEPGJ.js} +19 -18
  88. package/{createDialogAction-TZCVQ3NU.js → createDialogAction-DPRTYNAK.js} +21 -20
  89. package/{createPageAction-EIGZ3BKT.js → createPageAction-JGZK3WAM.js} +25 -24
  90. package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
  91. package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
  92. package/{dialogCommands-FO77J5DQ.js → dialogCommands-XED6DKLV.js} +29 -26
  93. package/{dialogSlice-MM5U4KE2.js → dialogSlice-KO4NRNKC.js} +19 -18
  94. package/{docCreateCommands-I3BS3AZI.js → docCreateCommands-P6DYWHH3.js} +32 -27
  95. package/{docDeleteCommands-Q2OPV52P.js → docDeleteCommands-KUWXAMSN.js} +31 -26
  96. package/{docReadCommands-YOOFACYZ.js → docReadCommands-ECW55TKB.js} +30 -25
  97. package/{docStore-NGYQ2JTR.js → docStore-6KMERNUY.js} +20 -19
  98. package/{docUpdateCommands-2B32ITHN.js → docUpdateCommands-5J4BTJQN.js} +31 -26
  99. package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
  100. package/{getPricing-P4XRJRZB.js → getPricing-RYY6OBA4.js} +2 -2
  101. package/{handleSendMessageAction-JRZWWBKP.js → handleSendMessageAction-R3ZHTVU4.js} +20 -19
  102. package/index.js +95 -64
  103. package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
  104. package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
  105. package/{machineCommands-WRWF2ICZ.js → machineCommands-JF2YL34J.js} +62 -56
  106. package/{machineWsRunDispatch-ZX7Q3TWZ.js → machineWsRunDispatch-ON4AEOJL.js} +54 -48
  107. package/{models-WQ5N4OJM.js → models-5K5G2CZI.js} +1 -1
  108. package/package.json +1 -1
  109. package/queryRunOverlay-O4LOMMPO.js +161 -0
  110. package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
  111. package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
  112. package/{readlineWorkspace-ZTGRGW46.js → readlineWorkspace-SUCINTL7.js} +354 -185
  113. package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
  114. package/{runAgentClientLoop-JZCOP7LG.js → runAgentClientLoop-OBD2AVEL.js} +43 -37
  115. package/runOverlayPresentation-ZO4VCWEU.js +11 -0
  116. package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
  117. package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
  118. package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
  119. package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
  120. package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
  121. package/{spaceCommands-VV4GTPQK.js → spaceCommands-32NTNLHS.js} +30 -27
  122. package/{spaceSlice-DRWWZJP7.js → spaceSlice-P7VOXLY6.js} +19 -18
  123. package/{streamAgentChatTurn-Y6WGATQR.js → streamAgentChatTurn-UHEMNI3X.js} +97 -56
  124. package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
  125. package/{tools-PUNBY3AH.js → tools-BMXIXHMB.js} +32 -27
  126. package/{tuiSummaryLlmCaller-F64WLSAF.js → tuiSummaryLlmCaller-VUNVBRX3.js} +5 -4
  127. package/types-ZSTJ7MPR.js +7 -0
  128. package/{updateDialogTitleAction-YSR4TCMB.js → updateDialogTitleAction-LJBDYZLH.js} +22 -21
  129. package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
  130. package/{chunk-XBS2WYJ2.js → chunk-RK5NYQEL.js} +0 -0
  131. package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
  132. package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
@@ -8,27 +8,24 @@ import {
8
8
  writeUsage
9
9
  } from "./chunk-DZ3XJVET.js";
10
10
  import {
11
- resolveMachineId
12
- } from "./chunk-6HYVJV7B.js";
11
+ getReadableCliDb
12
+ } from "./chunk-WFHXMLHZ.js";
13
+ import {
14
+ normalizeAgentHandle,
15
+ readDbRecord,
16
+ resolveAgentRecordFromHybridStore
17
+ } from "./chunk-FVIPEIVX.js";
13
18
  import {
14
19
  agentRunCardLabels,
15
20
  createCliCallAgentToolExecutor,
16
21
  createCliLocalRuntimeAdapter,
17
22
  getCliLocale,
18
23
  isBuiltinNoloAgentRef,
24
+ isQuotaExhaustedError,
25
+ parseAgentRunEvent,
19
26
  t,
20
27
  toolLabel
21
- } from "./chunk-DPAB4FQ7.js";
22
- import {
23
- getReadableCliDb
24
- } from "./chunk-W4NVOSFF.js";
25
- import {
26
- readDbRecord,
27
- resolveAgentRecordFromHybridStore
28
- } from "./chunk-PCTUYVUM.js";
29
- import {
30
- normalizeAgentHandle
31
- } from "./chunk-M43KDE25.js";
28
+ } from "./chunk-UZY4BEBR.js";
32
29
  import {
33
30
  NOLO_PROJECT_MANAGER_AGENT_KEY,
34
31
  isLocalCliAgentKey
@@ -38,41 +35,39 @@ import {
38
35
  buildModelLayerOverride
39
36
  } from "./chunk-LTRXGFMS.js";
40
37
  import {
41
- formatAgentListCard,
42
- formatListRunsCard,
43
- formatNotFoundRunCard,
44
- formatStartRunCard,
45
- formatStatusRunCard,
46
- formatStopRunCard,
47
- isAgentNameFallback,
48
- isAgentRunTerminalStatus,
49
- resolveRunLabel
50
- } from "./chunk-ZQBL7LIC.js";
38
+ resolveMachineId
39
+ } from "./chunk-6HYVJV7B.js";
40
+ import {
41
+ formatAgentListCard
42
+ } from "./chunk-NEKFSXOP.js";
51
43
  import {
52
44
  isGatewayHttpStatus
53
45
  } from "./chunk-RQSOAMPJ.js";
46
+ import {
47
+ getDefaultCliLocalRuntimeDb
48
+ } from "./chunk-WJRJDX2W.js";
54
49
  import {
55
50
  buildMemorySubjectsForAgent,
56
51
  chooseMemoryOwners,
57
52
  loadMemoryCandidatesFromDb,
58
53
  resolveAgentMemoryPolicy
59
- } from "./chunk-Z5JQNBNY.js";
60
- import {
61
- parseExternalSkillMarkdown,
62
- parseSkillDocProtocol
63
- } from "./chunk-VC6OZXO5.js";
54
+ } from "./chunk-NYUXSXLY.js";
64
55
  import {
65
56
  API_REPORTED_COST_MULTIPLIER,
66
57
  normalizeUsage,
67
58
  parseUiAskChoiceContent
68
- } from "./chunk-NSCHQQPU.js";
59
+ } from "./chunk-NVB267BZ.js";
69
60
  import {
70
61
  buildSkillDiscoveryContextBlock
71
- } from "./chunk-AS3ZQ3O2.js";
62
+ } from "./chunk-7OBMZCRD.js";
63
+ import {
64
+ parseExternalSkillMarkdown,
65
+ parseSkillDocProtocol
66
+ } from "./chunk-VC6OZXO5.js";
72
67
  import {
73
68
  buildPlatformChatCompletionRequest,
74
69
  parsePlatformChatCompletionData
75
- } from "./chunk-AVVZUXXC.js";
70
+ } from "./chunk-AAODAAUQ.js";
76
71
  import {
77
72
  resolveAgentRuntimeConfigFromRecord
78
73
  } from "./chunk-OIQPORYI.js";
@@ -81,25 +76,33 @@ import {
81
76
  LOCAL_TURN_ABORTED_CODE,
82
77
  readActionGate,
83
78
  readCommandActionGatePayload
84
- } from "./chunk-GSINCD4P.js";
79
+ } from "./chunk-QCJITMYO.js";
80
+ import {
81
+ createThinkParserState,
82
+ flushThinkParser,
83
+ processThinkChunk
84
+ } from "./chunk-LSFAWXKC.js";
85
85
  import {
86
86
  resolvePlatformAuthToken,
87
87
  resolvePlatformChatCompletionsEndpoint
88
- } from "./chunk-6EVITP2G.js";
88
+ } from "./chunk-MUCU6ATG.js";
89
89
  import {
90
90
  DEFAULT_CONTEXT_WINDOW,
91
91
  getModelContextWindow
92
- } from "./chunk-4L2OJPCU.js";
92
+ } from "./chunk-EGPCU42M.js";
93
93
  import {
94
94
  clipCompactText
95
95
  } from "./chunk-5MMAK75Q.js";
96
96
  import {
97
97
  findModelConfig
98
- } from "./chunk-66X4VSRC.js";
98
+ } from "./chunk-HQPG2PIV.js";
99
+ import {
100
+ toErrorMessage
101
+ } from "./chunk-HNMXYYJR.js";
99
102
  import {
100
103
  buildMemoryOverlayLayer,
101
104
  buildMemoryUseGuidanceLayer
102
- } from "./chunk-QLUFR47U.js";
105
+ } from "./chunk-AL2V7U3E.js";
103
106
  import {
104
107
  compactWhitespace
105
108
  } from "./chunk-DWLEOOGR.js";
@@ -107,16 +110,20 @@ import {
107
110
  createRunActivityTracker,
108
111
  finalizeRunRecord,
109
112
  spawnLocalBackgroundRun
110
- } from "./chunk-MYMMNKYL.js";
111
- import {
112
- CliProviderQuotaError
113
- } from "./chunk-CMKUBIGW.js";
113
+ } from "./chunk-TSIYZBTH.js";
114
114
  import {
115
- toErrorMessage
116
- } from "./chunk-HNMXYYJR.js";
115
+ formatFinishedRunCard,
116
+ formatListRunsCard,
117
+ formatNotFoundRunCard,
118
+ formatStartRunCard,
119
+ formatStatusRunCard,
120
+ formatStopRunCard,
121
+ isAgentRunTerminalStatus,
122
+ runShowsLogTail
123
+ } from "./chunk-FKXFCYVO.js";
117
124
  import {
118
- getDefaultCliLocalRuntimeDb
119
- } from "./chunk-H33743XH.js";
125
+ CliProviderQuotaError
126
+ } from "./chunk-X7W4TNB4.js";
120
127
  import {
121
128
  readPipeText,
122
129
  spawnProcess
@@ -129,7 +136,7 @@ import {
129
136
  } from "./chunk-Y5GCAMGP.js";
130
137
  import {
131
138
  createMemoryKey
132
- } from "./chunk-O4BU24WZ.js";
139
+ } from "./chunk-6Y7A3OQQ.js";
133
140
  import {
134
141
  asTrimmedLowercaseString
135
142
  } from "./chunk-QSJ3HFEF.js";
@@ -137,7 +144,7 @@ import {
137
144
  BUILTIN_NOLO_AGENT_KEY,
138
145
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
139
146
  PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
140
- } from "./chunk-XPC5C7BK.js";
147
+ } from "./chunk-3ND52WIL.js";
141
148
  import {
142
149
  asTrimmedString
143
150
  } from "./chunk-3EUW3WEO.js";
@@ -191,23 +198,18 @@ function buildQuickChatIntentSystemPrompt(tierAgents) {
191
198
  \u53EF\u9009 agent \u5217\u8868\uFF08agentKey \u4E0E\u63CF\u8FF0\uFF09\uFF1A
192
199
  ${agentList}
193
200
 
194
- \u5224\u65AD\u539F\u5219\uFF08\u9ED8\u8BA4\u504F\u5411\u901A\u7528\u6863\u4F4D\uFF1B\u4E13\u804C agent \u5728\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF1B**\u7F16\u7801/\u672C\u5730\u4ED3\u5E93\u4EFB\u52A1\u8D70\u901A\u7528\u6863 + needsWorkspace=true**\uFF09\uFF1A
201
+ \u5224\u65AD\u539F\u5219\uFF08\u9ED8\u8BA4\u504F\u5411\u901A\u7528\u6863\u4F4D\uFF1B\u4E13\u804C agent \u5728\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF1B**\u7F16\u7801/\u672C\u5730\u4ED3\u5E93\u4EFB\u52A1\u8D70\u901A\u7528\u6863 balanced/quality**\uFF09\uFF1A
195
202
  - \u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C**\u9664\u975E\u7528\u6237\u660E\u786E\u8868\u8FBE\u8981\u5EFA\u5E94\u7528/\u5EFA Agent/\u63D0\u4EA4\u53CD\u9988/\u591A Agent \u7F16\u6392**\uFF0C\u5426\u5219\u9009\u901A\u7528\u6863\u4F4D\uFF08flash/balanced/quality\uFF09\uFF1A
196
203
  - \u7B80\u5355\u95EE\u5019\u3001\u95F2\u804A\u3001\u5FEB\u901F\u95EE\u7B54\u3001\u7FFB\u8BD1\u3001\u77ED\u6587 \u2192 \u9009 flash \u6863
197
204
  - \u9700\u8981\u63A8\u7406\u3001\u5206\u6790\u3001\u4E2D\u7B49\u957F\u5EA6\u5199\u4F5C\u3001\u666E\u901A\u4EE3\u7801\u89E3\u91CA/\u67B6\u6784\u95EE\u7B54 \u2192 \u9009 balanced \u6863
198
205
  - \u590D\u6742\u63A8\u7406\u3001\u957F\u6587\u3001\u67B6\u6784\u8BBE\u8BA1\u3001\u6DF1\u5EA6\u5206\u6790 \u2192 \u9009 quality \u6863
199
- - **\u660E\u786E\u7F16\u7801\u4EFB\u52A1\uFF08\u5B9E\u73B0\u529F\u80FD\u3001\u4FEE bug\u3001refactor\u3001\u5199/\u8865\u6D4B\u8BD5\u3001\u8DD1 build/tests/ci\uFF09\u6216\u67E5\u770B\u672C\u673A\u4ED3\u5E93/\u4EE3\u7801\u72B6\u6001\uFF08git/\u5206\u652F/commit/\u672C\u5730\u4E0E\u8FDC\u7A0B\u5DEE\u8DDD/\u672A\u63D0\u4EA4\u6539\u52A8\u7B49\uFF09** \u2192 \u9009 balanced \u6216 quality \u6863\uFF08\u6309\u590D\u6742\u5EA6\uFF1B**\u4E0D\u8981\u9009 flash**\uFF09\uFF0C\u4E14 needsWorkspace=true
206
+ - **\u660E\u786E\u7F16\u7801\u4EFB\u52A1\uFF08\u5B9E\u73B0\u529F\u80FD\u3001\u4FEE bug\u3001refactor\u3001\u5199/\u8865\u6D4B\u8BD5\u3001\u8DD1 build/tests/ci\uFF09\u6216\u67E5\u770B\u672C\u673A\u4ED3\u5E93/\u4EE3\u7801\u72B6\u6001\uFF08git/\u5206\u652F/commit/\u672C\u5730\u4E0E\u8FDC\u7A0B\u5DEE\u8DDD/\u672A\u63D0\u4EA4\u6539\u52A8\u7B49\uFF09** \u2192 \u9009 balanced \u6216 quality \u6863\uFF08\u6309\u590D\u6742\u5EA6\uFF1B**\u4E0D\u8981\u9009 flash**\uFF09
200
207
  - \u4E13\u804C agent \u8DEF\u7531\u89C4\u5219\uFF08\u6709\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF09\uFF1A
201
208
  - \u8981\u63D0\u4EA4/\u8BB0\u5F55 bug\u3001\u4F53\u9A8C\u95EE\u9898\u3001\u6570\u636E\u5F02\u5E38\u3001\u4EA7\u54C1\u5EFA\u8BAE\uFF0C\u6216\u53E3\u8BED\u5982\u300C\u60F3\u53CD\u9988\u4E00\u4E9B\u95EE\u9898\u300D\u300C\u53CD\u9988\u4E00\u4E0B\u300D\u2192 \u9009\u610F\u89C1\u53CD\u9988\u4E13\u804C agent
202
209
  - \u8981\u65B0\u5EFA\u6216\u5B9A\u5236 AI/Agent/\u667A\u80FD\u4F53\u52A9\u624B\uFF08\u542B\u914D\u7F6E\u5DE5\u5177\u3001\u77E5\u8BC6\u3001\u786E\u8BA4\u521B\u5EFA\uFF09\u2192 \u9009\u521B\u5EFA Agent \u4E13\u804C agent
203
210
  - \u8981\u505A/\u6539/\u53D1\u5E03\u7F51\u7AD9\u3001\u7F51\u9875\u3001\u5C0F\u5E94\u7528\u3001\u9884\u7EA6\u9875\u3001\u535A\u5BA2\u3001\u770B\u677F \u2192 \u9009\u5E94\u7528\u6784\u5EFA\u4E13\u804C agent
204
211
  - \u8981\u6D3E\u591A\u4E2A agent\u3001\u591A agent \u5E76\u884C\u3001\u62C6\u6210\u4EFB\u52A1\u540E\u53F0\u6267\u884C\u3001\u591A\u4E2A agent review\u3001\u8BA9\u4E0D\u540C agent \u8BA8\u8BBA/\u4F1A\u5546 \u2192 \u9009\u591A Agent \u7F16\u6392\u4E13\u804C agent\uFF08\u663E\u5F0F multi-agent \u4F18\u5148\uFF09
205
- - **\u62FF\u4E0D\u51C6\u65F6**\uFF1A\u7EAF\u95F2\u804A\u9009 flash\uFF1B**\u82E5\u6CBE\u8FB9\u672C\u5730\u4ED3\u5E93/\u5F53\u524D\u4EE3\u7801\u72B6\u6001\uFF0C\u9009 balanced/quality + needsWorkspace=true**\u3002
206
-
207
- \u540C\u65F6\u5224\u65AD\u672C\u8F6E\u662F\u5426\u9700\u8981\u6CE8\u5165\u300C\u5DE5\u4F5C\u533A\u53EA\u8BFB\u5DE5\u5177\u300D\uFF08listFiles/globFiles/searchFiles/readFile/execShell \u7B49\uFF09\uFF1A
208
- - needsWorkspace=true \u7684\u573A\u666F\uFF1A\u7528\u6237\u8981\u8BFB/\u6539/\u5206\u6790\u6587\u4EF6\u6216\u4EE3\u7801\u3001\u63D0\u5230\u4E86\u6587\u4EF6\u8DEF\u5F84/\u6269\u5C55\u540D\uFF08.md/.csv/.ts \u7B49\uFF09\u3001\u63D0\u5230\u5DE5\u4F5C\u533A/\u4EE3\u7801\u5E93/\u4ED3\u5E93/\u76EE\u5F55/git/\u5206\u652F\u3001\u8981\u770B\u5F53\u524D\u4EE3\u7801\u6216\u4ED3\u5E93\u72B6\u6001\u3001\u672C\u5730\u641C\u7D22/\u67E5\u770B\u4EE3\u7801\u3002
209
- - needsWorkspace=false \u7684\u573A\u666F\uFF1A\u901A\u7528\u77E5\u8BC6\u95EE\u7B54\uFF08\u5982\u300C\u5E7F\u4E1C\u7ECF\u6D4E\u6570\u636E\u300D\u300C\u5199\u4E00\u9996\u8BD7\u300D\uFF09\u3001\u7EAF\u95F2\u804A\u95EE\u5019\u3001\u7FFB\u8BD1\u3001\u4E0D\u6D89\u53CA\u672C\u5730\u6587\u4EF6/\u4ED3\u5E93\u3002
210
- - \u6F0F\u5224\uFF08\u7528\u6237\u8981\u6587\u4EF6\u800C\u6CA1\u5E26\u5DE5\u5177\uFF09\u6BD4\u8BEF\u5224\uFF08\u767D\u641C\u51E0\u8F6E\uFF09\u4EE3\u4EF7\u66F4\u9AD8\uFF0C\u5B81\u53EF\u504F\u5BBD\u5224 true\u3002
212
+ - **\u62FF\u4E0D\u51C6\u65F6**\uFF1A\u7EAF\u95F2\u804A\u9009 flash\uFF1B**\u82E5\u6CBE\u8FB9\u672C\u5730\u4ED3\u5E93/\u5F53\u524D\u4EE3\u7801\u72B6\u6001\uFF0C\u9009 balanced/quality**\u3002
211
213
 
212
214
  \u5728\u7ED9\u51FA agentKey \u4E4B\u524D\uFF0C\u5148\u5728\u5FC3\u91CC\u533A\u5206\u5019\u9009\u6863\u4F4D\u7684\u8FB9\u754C\u518D\u7ED9\u7F6E\u4FE1\u5EA6\uFF1Abalanced \u4E0E quality \u7684\u8FB9\u754C\u5728\u4E8E\u590D\u6742\u5EA6/\u7BC7\u5E45/\u662F\u5426\u9700\u8981\u6DF1\u5EA6\u5206\u6790\uFF0C\u62FF\u4E0D\u51C6\u5C31\u7ED9\u4F4E confidence\u3002
213
215
 
@@ -219,7 +221,7 @@ ${agentList}
219
221
  - \u666E\u901A\u95EE\u7B54/\u7EAF\u95F2\u804A/\u5EFA\u5E94\u7528 \u2192 skills \u4E3A []
220
222
 
221
223
  \u53EA\u8F93\u51FA JSON\uFF0C\u4E0D\u8981\u8F93\u51FA\u5176\u4ED6\u5185\u5BB9\uFF1A
222
- {"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "needsWorkspace": <true \u6216 false>, "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F ${[...VALID_QUICK_CHAT_SKILLS].map((s) => `"${s}"`).join(" | ")}\uFF0C\u672A\u547D\u4E2D\u7ED9 []>}`;
224
+ {"confidence": <0\u52301\u4E4B\u95F4\u7684\u5C0F\u6570\uFF0C\u8868\u793A\u4F60\u5BF9\u8FD9\u4E2A\u5206\u7C7B\u5224\u65AD\u7684\u628A\u63E1\u7A0B\u5EA6>, "agentKey": "<\u4ECE\u5217\u8868\u4E2D\u9009\u62E9\u7684 agentKey>", "skills": <\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5143\u7D20\u53EA\u80FD\u662F ${[...VALID_QUICK_CHAT_SKILLS].map((s) => `"${s}"`).join(" | ")}\uFF0C\u672A\u547D\u4E2D\u7ED9 []>}`;
223
225
  }
224
226
  function parseQuickChatIntentResult(content, tierAgents) {
225
227
  try {
@@ -228,8 +230,6 @@ function parseQuickChatIntentResult(content, tierAgents) {
228
230
  const key = parsed.agentKey;
229
231
  if (typeof key !== "string") return null;
230
232
  if (!tierAgents.some((t2) => t2.agentKey === key)) return null;
231
- const rawNeedsWorkspace = parsed.needsWorkspace;
232
- const needsWorkspace = rawNeedsWorkspace === true;
233
233
  const rawConfidence = parsed.confidence;
234
234
  const confidence = typeof rawConfidence === "number" && Number.isFinite(rawConfidence) && rawConfidence >= 0 && rawConfidence <= 1 ? rawConfidence : void 0;
235
235
  const rawSkills = parsed.skills;
@@ -240,7 +240,7 @@ function parseQuickChatIntentResult(content, tierAgents) {
240
240
  );
241
241
  if (filtered.length > 0) skills = filtered;
242
242
  }
243
- return { agentKey: key, needsWorkspace, confidence, skills };
243
+ return { agentKey: key, confidence, skills };
244
244
  } catch {
245
245
  return null;
246
246
  }
@@ -352,7 +352,6 @@ async function classifyCliAutoRoute(text, options) {
352
352
  tier,
353
353
  classified: true,
354
354
  confidence: parsed.confidence,
355
- needsWorkspace: parsed.needsWorkspace,
356
355
  skills: parsed.skills
357
356
  };
358
357
  } catch {
@@ -955,6 +954,17 @@ function supportsTruecolor(env = process.env) {
955
954
  const program = (env.TERM_PROGRAM ?? "").toLowerCase();
956
955
  return TRUECOLOR_TERM_PROGRAMS.has(program);
957
956
  }
957
+ function detectSystemBrightnessFromEnv(env = process.env) {
958
+ const appleStyle = (env.AppleInterfaceStyle ?? "").trim().toLowerCase();
959
+ if (appleStyle === "dark") return "dark";
960
+ const colorScheme = (env.COLOR_SCHEME ?? env.COLORSCHEME ?? env.SYSTEM_COLOR_SCHEME ?? "").trim().toLowerCase();
961
+ if (/(?:^|[\s\-_:])dark(?:$|[\s\-_:])/i.test(colorScheme)) return "dark";
962
+ if (/(?:^|[\s\-_:])light(?:$|[\s\-_:])/i.test(colorScheme)) return "light";
963
+ const gtkTheme = (env.GTK_THEME ?? env.QT_STYLE_OVERRIDE ?? "").trim().toLowerCase();
964
+ if (/(?:^|[\s\-_:])dark(?:$|[\s\-_:])/i.test(gtkTheme)) return "dark";
965
+ if (/(?:^|[\s\-_:])light(?:$|[\s\-_:])/i.test(gtkTheme)) return "light";
966
+ return null;
967
+ }
958
968
  function resolveTuiBrightness(env = process.env) {
959
969
  const explicit = (env.NOLO_TUI_THEME ?? "").trim().toLowerCase();
960
970
  if (explicit === "light") return "light";
@@ -967,6 +977,8 @@ function resolveTuiBrightness(env = process.env) {
967
977
  if (!Number.isNaN(bg) && bg >= 0 && bg <= 6) return "dark";
968
978
  if (!Number.isNaN(bg) && bg >= 7 && bg <= 15) return "light";
969
979
  }
980
+ const sys = detectSystemBrightnessFromEnv(env);
981
+ if (sys) return sys;
970
982
  return "dark";
971
983
  }
972
984
  function hexToSgr(hex) {
@@ -997,7 +1009,8 @@ function setActiveTerminalBaseHex(hex) {
997
1009
  }
998
1010
  function applyDetectedBackground(detected) {
999
1011
  const normalizedHex = detected.hex.replace(/^#/, "").toUpperCase();
1000
- const changed = detected.brightness !== activeBrightness || normalizedHex !== activeTerminalBaseHex;
1012
+ const hexChanged = normalizedHex !== "" && normalizedHex !== activeTerminalBaseHex;
1013
+ const changed = detected.brightness !== activeBrightness || hexChanged;
1001
1014
  setActiveBrightness(detected.brightness);
1002
1015
  setActiveTerminalBaseHex(detected.hex);
1003
1016
  return changed;
@@ -1606,161 +1619,8 @@ function createRenderAwareStreamWriter(args) {
1606
1619
  }
1607
1620
  };
1608
1621
  }
1609
-
1610
- // packages/cli/client/thinkingOutput.ts
1611
- var THINK_OPEN = /<think>/i;
1612
- var THINK_CLOSE = /<\/think>/i;
1613
- var COLLAPSED_MARKER = /^\s*▸ 思考已折叠\s*$/;
1614
- function normalizeThinkingDisplayMode(raw, fallback = "hide") {
1615
- const normalized = asTrimmedLowercaseString(raw);
1616
- if (normalized === "hide" || normalized === "off" || normalized === "false" || normalized === "0") {
1617
- return "hide";
1618
- }
1619
- if (normalized === "marker" || normalized === "collapsed" || normalized === "fold") {
1620
- return "marker";
1621
- }
1622
- if (normalized === "show" || normalized === "on" || normalized === "true" || normalized === "1") {
1623
- return "show";
1624
- }
1625
- return fallback;
1626
- }
1627
- function resolveThinkingDisplayMode(env = process.env) {
1628
- return normalizeThinkingDisplayMode(env.NOLO_CLI_THINKING ?? env.NOLO_THINKING, "hide");
1629
- }
1630
- function collapseThinkingBlocks(text, mode = "hide") {
1631
- if (mode === "show") return text;
1632
- const replacement = mode === "marker" ? "\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n" : "";
1633
- return text.replace(/<think>[\s\S]*?<\/think>\s*/gi, replacement).replace(/\n{3,}/g, "\n\n").trim();
1634
- }
1635
- function stripCollapsedThinkingMarkers(text) {
1636
- return text.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n").replace(/\n{2,}/g, "\n").trim();
1637
- }
1638
- function formatAssistantTextForCli(text, mode = "hide") {
1639
- const collapsed = collapseThinkingBlocks(text, mode);
1640
- return mode === "hide" ? stripCollapsedThinkingMarkers(collapsed) : collapsed;
1641
- }
1642
- function createThinkingEventSink(arg1, arg2) {
1643
- let mode = "hide";
1644
- let write = () => {
1645
- };
1646
- if (typeof arg1 === "function") {
1647
- write = arg1;
1648
- if (typeof arg2 === "string") {
1649
- mode = arg2;
1650
- }
1651
- } else {
1652
- mode = arg1;
1653
- if (typeof arg2 === "function") {
1654
- write = arg2;
1655
- }
1656
- }
1657
- if (mode === "hide") {
1658
- return {
1659
- push(_chunk) {
1660
- }
1661
- };
1662
- }
1663
- if (mode === "show") {
1664
- return {
1665
- push(chunk) {
1666
- if (chunk) write(chunk);
1667
- }
1668
- };
1669
- }
1670
- let markerEmitted = false;
1671
- return {
1672
- push(chunk) {
1673
- if (!chunk || markerEmitted) return;
1674
- write("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
1675
- markerEmitted = true;
1676
- }
1677
- };
1678
- }
1679
- function createThinkingAwareStreamFilter(write, mode = "hide") {
1680
- if (mode === "show") {
1681
- return {
1682
- push(chunk) {
1683
- write(chunk);
1684
- },
1685
- flush() {
1686
- }
1687
- };
1688
- }
1689
- let pending = "";
1690
- let insideThink = false;
1691
- let markerEmitted = false;
1692
- const emit = (chunk) => {
1693
- if (chunk) write(chunk);
1694
- };
1695
- const emitMarker = () => {
1696
- if (mode !== "marker" || markerEmitted) return;
1697
- emit("\n\u25B8 \u601D\u8003\u5DF2\u6298\u53E0\n");
1698
- markerEmitted = true;
1699
- };
1700
- const consume = (input) => {
1701
- pending += input;
1702
- while (pending.length > 0) {
1703
- if (insideThink) {
1704
- const closeMatch = pending.match(THINK_CLOSE);
1705
- if (!closeMatch || closeMatch.index == null) {
1706
- emitMarker();
1707
- pending = "";
1708
- return;
1709
- }
1710
- emitMarker();
1711
- pending = pending.slice(closeMatch.index + closeMatch[0].length);
1712
- insideThink = false;
1713
- markerEmitted = false;
1714
- continue;
1715
- }
1716
- const openMatch = pending.match(THINK_OPEN);
1717
- if (!openMatch || openMatch.index == null) {
1718
- const nextMarker = pending.indexOf("<");
1719
- if (nextMarker === -1) {
1720
- const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
1721
- emit(cleaned);
1722
- pending = "";
1723
- return;
1724
- }
1725
- if (nextMarker > 0) {
1726
- const head = pending.slice(0, nextMarker);
1727
- const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
1728
- emit(cleaned);
1729
- pending = pending.slice(nextMarker);
1730
- continue;
1731
- }
1732
- if (pending.length < 7) return;
1733
- emit(pending[0]);
1734
- pending = pending.slice(1);
1735
- continue;
1736
- }
1737
- if (openMatch.index > 0) {
1738
- const head = pending.slice(0, openMatch.index);
1739
- const cleaned = mode === "hide" ? head.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : head;
1740
- emit(cleaned);
1741
- pending = pending.slice(openMatch.index);
1742
- continue;
1743
- }
1744
- pending = pending.slice(openMatch[0].length);
1745
- insideThink = true;
1746
- markerEmitted = false;
1747
- }
1748
- };
1749
- return {
1750
- push(chunk) {
1751
- consume(chunk);
1752
- },
1753
- flush() {
1754
- if (insideThink) emitMarker();
1755
- if (pending) {
1756
- const cleaned = mode === "hide" ? pending.split("\n").filter((line) => !COLLAPSED_MARKER.test(line)).join("\n") : pending;
1757
- emit(cleaned);
1758
- }
1759
- pending = "";
1760
- insideThink = false;
1761
- markerEmitted = false;
1762
- }
1763
- };
1622
+ function formatAssistantTextForCli(text) {
1623
+ return text.replace(/\u003cthink\u003e[\s\S]*?\u003c\/think\u003e\s*/gi, "").replace(/\n{3,}/g, "\n\n").trim();
1764
1624
  }
1765
1625
 
1766
1626
  // packages/cli/client/formatReadPathTree.ts
@@ -2278,18 +2138,8 @@ function isFailedToolResult(event) {
2278
2138
  function isNeedsActionToolResult(event) {
2279
2139
  return Boolean(event.metadata?.actionGate);
2280
2140
  }
2281
- function readRunLogLines(parsed) {
2282
- if (Array.isArray(parsed.logLines)) return parsed.logLines;
2283
- if (typeof parsed.logTail === "string" && parsed.logTail.trim()) {
2284
- return parsed.logTail.split("\n");
2285
- }
2286
- return void 0;
2287
- }
2288
- function readRunErrorMessage(parsed) {
2289
- return typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
2290
- }
2291
2141
  function parseUiAskChoiceForCli(event) {
2292
- if (event.toolName !== "ui_ask_choice" && !event.metadata?.uiAskChoice) {
2142
+ if (event.toolName !== "ask_user" && !event.metadata?.uiAskChoice) {
2293
2143
  return null;
2294
2144
  }
2295
2145
  const parsed = parseUiAskChoiceContent(event.content);
@@ -2390,70 +2240,84 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
2390
2240
  return `${dimCliText(text, true)}
2391
2241
  `;
2392
2242
  }
2393
- function recoverOrchestrationDisplayFromContent(toolName, content) {
2243
+ function renderRunCard(snapshot, opts) {
2244
+ const labels = agentRunCardLabels();
2245
+ const timing = { startedAt: snapshot.startedAt, finishedAt: snapshot.finishedAt };
2246
+ const name = snapshot.agentName ?? "agent";
2247
+ if (isAgentRunTerminalStatus(snapshot.status)) {
2248
+ return formatFinishedRunCard(name, snapshot.status, {
2249
+ runId: snapshot.runId,
2250
+ toolCallCount: snapshot.toolCallCount,
2251
+ lastToolNames: snapshot.lastToolNames,
2252
+ lastAssistantText: snapshot.lastAssistantText,
2253
+ errorMessage: snapshot.errorMessage,
2254
+ logLines: snapshot.logLines,
2255
+ timing,
2256
+ ...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
2257
+ labels
2258
+ });
2259
+ }
2260
+ return formatStatusRunCard(name, snapshot.status, {
2261
+ runId: snapshot.runId,
2262
+ toolCallCount: snapshot.toolCallCount,
2263
+ lastToolNames: snapshot.lastToolNames,
2264
+ lastAssistantText: snapshot.lastAssistantText,
2265
+ errorMessage: snapshot.errorMessage,
2266
+ logLines: snapshot.logLines,
2267
+ timing,
2268
+ ...opts?.includeLogTail !== void 0 ? { includeLogTail: opts.includeLogTail } : {},
2269
+ labels
2270
+ });
2271
+ }
2272
+ function recoverOrchestrationCard(event, toolName) {
2273
+ const content = typeof event.content === "string" ? event.content : "";
2394
2274
  const trimmed = content.trim();
2395
- if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return content;
2275
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
2396
2276
  const labels = agentRunCardLabels();
2397
- try {
2398
- const parsed = JSON.parse(trimmed);
2399
- if (toolName === "listAgents") {
2277
+ if (toolName === "listAgents") {
2278
+ try {
2279
+ const parsed = JSON.parse(trimmed);
2400
2280
  const agents = Array.isArray(parsed.agents) ? parsed.agents : [];
2401
2281
  return formatAgentListCard(agents);
2282
+ } catch {
2283
+ return null;
2402
2284
  }
2403
- if (toolName === "startAgentRun") {
2404
- const name = resolveRunLabel(parsed);
2405
- const status = typeof parsed.status === "string" ? parsed.status : "running";
2406
- return formatStartRunCard(name, status, labels);
2407
- }
2408
- if (toolName === "controlAgentRun") {
2285
+ }
2286
+ if (toolName === "controlAgentRun") {
2287
+ try {
2288
+ const parsed = JSON.parse(trimmed);
2409
2289
  if (Array.isArray(parsed.runs)) {
2410
- const runs = parsed.runs;
2411
- return formatListRunsCard(runs, labels);
2412
- }
2413
- const status = typeof parsed.status === "string" ? parsed.status : void 0;
2414
- if (parsed.found === false || status === "not_found") {
2415
- return formatNotFoundRunCard(labels);
2416
- }
2417
- if (status === "killed" || status === "cancelled" || status === "cancelling") {
2418
- return formatStopRunCard(status, labels);
2290
+ return formatListRunsCard(
2291
+ parsed.runs,
2292
+ labels
2293
+ );
2419
2294
  }
2420
- return formatStatusRunCard(resolveRunLabel(parsed), status ?? "\u2014", {
2421
- errorMessage: readRunErrorMessage(parsed),
2422
- logLines: readRunLogLines(parsed),
2423
- labels
2424
- });
2295
+ } catch {
2296
+ return null;
2425
2297
  }
2426
- } catch {
2427
2298
  }
2428
- return content;
2299
+ const parsedEvent = parseAgentRunEvent(event);
2300
+ if (!parsedEvent) return null;
2301
+ const { kind, snapshot } = parsedEvent;
2302
+ if (kind === "start") {
2303
+ return formatStartRunCard(snapshot.agentName ?? "agent", snapshot.status, {
2304
+ task: snapshot.taskPreview,
2305
+ runId: snapshot.runId,
2306
+ labels
2307
+ });
2308
+ }
2309
+ if (kind === "gone") return formatNotFoundRunCard(labels);
2310
+ if (kind === "stop") return formatStopRunCard(snapshot.status, labels);
2311
+ return renderRunCard(snapshot);
2429
2312
  }
2430
2313
  function parseControlAgentRunStatusEvent(event) {
2431
- const raw = typeof event.content === "string" && event.content.trim() ? event.content.trim() : "";
2432
- if (!raw.startsWith("{")) return null;
2433
- try {
2434
- const parsed = JSON.parse(raw);
2435
- if (Array.isArray(parsed.runs)) return null;
2436
- const status = typeof parsed.status === "string" ? parsed.status : void 0;
2437
- if (parsed.found === false || status === "not_found") return null;
2438
- if (status === "killed" || status === "cancelled" || status === "cancelling") return null;
2439
- if (!status) return null;
2440
- const runId = typeof parsed.runId === "string" && parsed.runId.trim() ? parsed.runId.trim() : typeof event.metadata?.runId === "string" ? event.metadata.runId : "";
2441
- if (!runId) return null;
2442
- const agentName = resolveRunLabel(parsed);
2443
- const errorMessage = readRunErrorMessage(parsed);
2444
- const logLines = readRunLogLines(parsed);
2445
- const logKey = logLines && logLines.length > 0 ? logLines.join("\n") : "";
2446
- return { runId, status, agentName, errorMessage, logLines, logKey };
2447
- } catch {
2448
- return null;
2449
- }
2314
+ const parsed = parseAgentRunEvent(event);
2315
+ return parsed?.kind === "status" ? parsed.snapshot : null;
2450
2316
  }
2451
2317
  function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
2452
2318
  const rawLabel = toolLabel(toolName);
2453
- let rawDataStr = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : typeof event.content === "string" ? event.content : "";
2454
- if (typeof event.metadata?.displayData !== "string" && typeof event.content === "string" && event.content.trim()) {
2455
- rawDataStr = recoverOrchestrationDisplayFromContent(toolName, event.content);
2456
- }
2319
+ const bakedCard = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : "";
2320
+ const rawDataStr = recoverOrchestrationCard(event, toolName) || bakedCard || (typeof event.content === "string" ? event.content : "");
2457
2321
  const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
2458
2322
  if (failed) {
2459
2323
  const firstLine = rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
@@ -2489,16 +2353,22 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
2489
2353
  }
2490
2354
  return out;
2491
2355
  }
2356
+ function mergeRunSnapshot(previous, next) {
2357
+ return {
2358
+ ...previous,
2359
+ ...next,
2360
+ errorMessage: next.errorMessage ?? previous.errorMessage,
2361
+ logLines: next.logLines ?? previous.logLines,
2362
+ logKey: next.logKey || previous.logKey,
2363
+ toolCallCount: next.toolCallCount ?? previous.toolCallCount,
2364
+ lastToolNames: next.lastToolNames ?? previous.lastToolNames,
2365
+ lastAssistantText: next.lastAssistantText ?? previous.lastAssistantText,
2366
+ startedAt: next.startedAt ?? previous.startedAt,
2367
+ finishedAt: next.finishedAt ?? previous.finishedAt
2368
+ };
2369
+ }
2492
2370
  function formatFoldedControlStatusCard(snapshot, colorEnabled) {
2493
- const labels = agentRunCardLabels();
2494
- const body = formatStatusRunCard(snapshot.agentName, snapshot.status, {
2495
- errorMessage: snapshot.errorMessage,
2496
- logLines: snapshot.logLines,
2497
- pollCount: snapshot.pollCount,
2498
- elapsedMs: snapshot.elapsedMs,
2499
- includeLogTail: snapshot.includeLogTail,
2500
- labels
2501
- });
2371
+ const body = renderRunCard(snapshot, { includeLogTail: snapshot.includeLogTail });
2502
2372
  return formatOrchestrationCardBlock(
2503
2373
  {
2504
2374
  type: "tool-result",
@@ -2506,8 +2376,7 @@ function formatFoldedControlStatusCard(snapshot, colorEnabled) {
2506
2376
  toolCallId: `fold-${snapshot.runId}`,
2507
2377
  toolName: "controlAgentRun",
2508
2378
  content: "",
2509
- metadata: { displayData: body },
2510
- elapsedMs: snapshot.elapsedMs
2379
+ metadata: { displayData: body }
2511
2380
  },
2512
2381
  "controlAgentRun",
2513
2382
  colorEnabled
@@ -2528,7 +2397,7 @@ function formatVerboseToolEvent(event, colorEnabled) {
2528
2397
  );
2529
2398
  }
2530
2399
  const elapsed = typeof event.elapsedMs === "number" ? ` ${event.elapsedMs}ms` : "";
2531
- if (event.type === "tool-result" && (event.toolName === "ui_ask_choice" || event.metadata?.uiAskChoice)) {
2400
+ if (event.type === "tool-result" && (event.toolName === "ask_user" || event.metadata?.uiAskChoice)) {
2532
2401
  const block = formatUiAskChoiceBlock(event, colorEnabled);
2533
2402
  if (block) return `${formatToolTraceLine(`[nolo:tool] #${round} <- ${event.toolName}${elapsed}`, colorEnabled)}${block}`;
2534
2403
  }
@@ -2741,7 +2610,7 @@ function formatCompactToolLine(event, pending, colorEnabled) {
2741
2610
  if (event.type === "tool-result" && (toolName === "listAgents" || toolName === "startAgentRun" || toolName === "controlAgentRun")) {
2742
2611
  return formatOrchestrationCardBlock(event, toolName, colorEnabled);
2743
2612
  }
2744
- if (event.type === "tool-result" && (event.toolName === "ui_ask_choice" || event.metadata?.uiAskChoice)) {
2613
+ if (event.type === "tool-result" && (event.toolName === "ask_user" || event.metadata?.uiAskChoice)) {
2745
2614
  const block = formatUiAskChoiceBlock(event, colorEnabled);
2746
2615
  if (block) return block;
2747
2616
  }
@@ -2788,26 +2657,14 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2788
2657
  const fold = statusFold;
2789
2658
  statusFold = null;
2790
2659
  const prevLog = lastEmittedLogByRunId.get(fold.runId);
2791
- const includeLogTail = Boolean(fold.logKey) && fold.logKey !== prevLog;
2792
- if (fold.logKey) {
2660
+ const changed = Boolean(fold.logKey) && fold.logKey !== prevLog;
2661
+ if (changed && runShowsLogTail(fold.status)) {
2793
2662
  lastEmittedLogByRunId.set(fold.runId, fold.logKey);
2794
2663
  }
2795
- return formatFoldedControlStatusCard(
2796
- {
2797
- runId: fold.runId,
2798
- status: fold.status,
2799
- agentName: fold.agentName,
2800
- errorMessage: fold.errorMessage,
2801
- logLines: fold.logLines,
2802
- pollCount: fold.pollCount,
2803
- elapsedMs: fold.elapsedMs,
2804
- includeLogTail
2805
- },
2806
- colorEnabled
2807
- );
2664
+ return formatFoldedControlStatusCard({ ...fold, includeLogTail: changed }, colorEnabled);
2808
2665
  };
2809
- const flushBuffers = () => {
2810
- let out = flushStatusFold();
2666
+ const flushToolBuffers = () => {
2667
+ let out = "";
2811
2668
  if (readBuffer.length > 0) {
2812
2669
  const items = readBuffer.map((evt) => {
2813
2670
  const call = pending.get(evt.toolCallId);
@@ -2863,6 +2720,12 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2863
2720
  }
2864
2721
  return out;
2865
2722
  };
2723
+ const flushBuffers = () => `${flushStatusFold()}${flushToolBuffers()}`;
2724
+ const bufferToolResult = (buffer, event) => {
2725
+ const flushed = flushStatusFold();
2726
+ buffer.push(event);
2727
+ return flushed;
2728
+ };
2866
2729
  const formatter = (event) => {
2867
2730
  if (mode === "hide") return "";
2868
2731
  if (mode === "verbose") return formatVerboseToolEvent(event, colorEnabled);
@@ -2877,28 +2740,13 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2877
2740
  if (event.type === "tool-result") {
2878
2741
  const snapshot = parseControlAgentRunStatusEvent(event);
2879
2742
  if (snapshot) {
2880
- let out = "";
2881
- if (statusFold && statusFold.runId !== snapshot.runId) {
2743
+ let out = flushToolBuffers();
2744
+ const open = statusFold;
2745
+ const sameRun = open?.runId === snapshot.runId;
2746
+ if (open && (!sameRun || open.status !== snapshot.status)) {
2882
2747
  out += flushStatusFold();
2883
2748
  }
2884
- if (!statusFold) {
2885
- statusFold = {
2886
- ...snapshot,
2887
- pollCount: 1,
2888
- elapsedMs: event.elapsedMs
2889
- };
2890
- } else {
2891
- statusFold = {
2892
- runId: snapshot.runId,
2893
- status: snapshot.status,
2894
- agentName: snapshot.agentName,
2895
- errorMessage: snapshot.errorMessage ?? statusFold.errorMessage,
2896
- logLines: snapshot.logLines ?? statusFold.logLines,
2897
- logKey: snapshot.logKey || statusFold.logKey,
2898
- pollCount: statusFold.pollCount + 1,
2899
- elapsedMs: event.elapsedMs
2900
- };
2901
- }
2749
+ statusFold = open && sameRun ? mergeRunSnapshot(open, snapshot) : snapshot;
2902
2750
  pending.delete(event.toolCallId);
2903
2751
  if (isAgentRunTerminalStatus(snapshot.status)) {
2904
2752
  out += flushBuffers();
@@ -2920,8 +2768,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2920
2768
  return "";
2921
2769
  }
2922
2770
  if (event.type === "tool-result") {
2923
- readBuffer.push(event);
2924
- return "";
2771
+ return bufferToolResult(readBuffer, event);
2925
2772
  }
2926
2773
  }
2927
2774
  if (isSearchToolName(event.toolName)) {
@@ -2933,8 +2780,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2933
2780
  return "";
2934
2781
  }
2935
2782
  if (event.type === "tool-result") {
2936
- searchBuffer.push(event);
2937
- return "";
2783
+ return bufferToolResult(searchBuffer, event);
2938
2784
  }
2939
2785
  }
2940
2786
  if (isRunToolName(event.toolName)) {
@@ -2952,8 +2798,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2952
2798
  return "";
2953
2799
  }
2954
2800
  if (event.type === "tool-result") {
2955
- runBuffer.push(event);
2956
- return "";
2801
+ return bufferToolResult(runBuffer, event);
2957
2802
  }
2958
2803
  }
2959
2804
  if (isFetchToolName(event.toolName)) {
@@ -2965,8 +2810,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2965
2810
  return "";
2966
2811
  }
2967
2812
  if (event.type === "tool-result") {
2968
- fetchBuffer.push(event);
2969
- return "";
2813
+ return bufferToolResult(fetchBuffer, event);
2970
2814
  }
2971
2815
  }
2972
2816
  if (isWebSearchToolName(event.toolName)) {
@@ -2978,8 +2822,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2978
2822
  return "";
2979
2823
  }
2980
2824
  if (event.type === "tool-result") {
2981
- webSearchBuffer.push(event);
2982
- return "";
2825
+ return bufferToolResult(webSearchBuffer, event);
2983
2826
  }
2984
2827
  }
2985
2828
  const flushed = flushBuffers();
@@ -3038,6 +2881,12 @@ function createSseToolEventAdapter(onEvent) {
3038
2881
  type: "tool-result",
3039
2882
  toolCallId,
3040
2883
  toolName,
2884
+ // The full payload, not just the clipped summary. Consumers that parse
2885
+ // structured results — the agent-run snapshot parser feeding the dock
2886
+ // panel, the orchestration card renderer, ask_user — all read
2887
+ // `content`; dropping it here made every one of them silently inert on
2888
+ // the HTTP/SSE path while working on the local path.
2889
+ ...rawContent ? { content: rawContent } : {},
3041
2890
  summary,
3042
2891
  metadata: payload.metadata,
3043
2892
  round
@@ -3061,6 +2910,11 @@ function formatElapsed(totalSeconds) {
3061
2910
  const mins = minutes % 60;
3062
2911
  return `${hours}h ${mins}m`;
3063
2912
  }
2913
+ function truncateThinkingHint(text, maxLen) {
2914
+ const cleaned = text.replace(/\n/g, " ").trim();
2915
+ if (cleaned.length <= maxLen) return cleaned;
2916
+ return "\u2026" + cleaned.slice(cleaned.length - maxLen + 1);
2917
+ }
3064
2918
  var Spinner = class {
3065
2919
  constructor(output, text, silent = false) {
3066
2920
  this.output = output;
@@ -3074,6 +2928,7 @@ var Spinner = class {
3074
2928
  frameIndex = 0;
3075
2929
  frames = ["\xB7", "~", "\u2248", "\u223F", "\u2248", "~"];
3076
2930
  isTTY;
2931
+ thinkingHint = "";
3077
2932
  start() {
3078
2933
  if (this.silent) {
3079
2934
  this.startTime = Date.now();
@@ -3109,9 +2964,11 @@ ${this.text}
3109
2964
  this.output.write("\r\x1B[K");
3110
2965
  this.output.write("\x1B[?25h");
3111
2966
  }
2967
+ this.thinkingHint = "";
3112
2968
  }
3113
2969
  show(text) {
3114
2970
  this.text = text;
2971
+ this.thinkingHint = "";
3115
2972
  if (this.silent) {
3116
2973
  if (!this.startTime) {
3117
2974
  this.startTime = Date.now();
@@ -3127,20 +2984,30 @@ ${this.text}
3127
2984
  this.startTime = Date.now();
3128
2985
  this.output.write(`\r${this.renderLine(this.frames[0])}`);
3129
2986
  }
2987
+ /**
2988
+ * Update the thinking hint displayed on the spinner line. The hint is
2989
+ * truncated to a reasonable length and shown as part of the spinner text.
2990
+ * Only meaningful while the spinner is active (TTY mode).
2991
+ */
2992
+ setThinkingHint(text) {
2993
+ this.thinkingHint = text;
2994
+ if (this.silent || !this.isTTY || !this.timer) return;
2995
+ this.output.write(`\r${this.renderLine(this.frames[this.frameIndex])}`);
2996
+ }
3130
2997
  renderLine(frame) {
3131
2998
  const elapsedSeconds = Math.max(
3132
2999
  0,
3133
3000
  Math.floor((Date.now() - this.startTime) / 1e3)
3134
3001
  );
3135
- return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text} (${formatElapsed(elapsedSeconds)})`;
3002
+ const thinkingPart = this.thinkingHint ? `: ${truncateThinkingHint(this.thinkingHint, 60)}` : "";
3003
+ return `${themeColorSequence("accent")}${frame}\x1B[39m ${this.text}${thinkingPart} (${formatElapsed(elapsedSeconds)})`;
3136
3004
  }
3137
3005
  };
3138
3006
 
3139
3007
  // packages/cli/client/agentRunOutput.ts
3140
- function formatAssistantResponseForCli(text, options) {
3141
- const thinkingMode = resolveThinkingDisplayMode(options.env);
3008
+ function formatAssistantResponseForCli(text) {
3142
3009
  return formatAssistantDisplay(
3143
- formatAssistantTextForCli(text, thinkingMode)
3010
+ formatAssistantTextForCli(text)
3144
3011
  );
3145
3012
  }
3146
3013
  function resolveAgentEventMode(options) {
@@ -3173,12 +3040,19 @@ function createCliTurnOutput(params) {
3173
3040
  let streamedAssistantText = false;
3174
3041
  let everStreamedAnyText = false;
3175
3042
  let printedAssistantLabel = false;
3176
- const thinkingMode = resolveThinkingDisplayMode(options.env);
3043
+ let thinkState = createThinkParserState();
3177
3044
  const renderWriter = createRenderAwareStreamWriter({
3178
3045
  write: (chunk) => options.output.write(chunk)
3179
3046
  });
3180
3047
  const writeVisibleAssistantChunk = (chunk) => {
3181
3048
  if (!chunk) return;
3049
+ const parsed = processThinkChunk(chunk, thinkState);
3050
+ thinkState = parsed.state;
3051
+ if (!parsed.content && !parsed.reasoning) return;
3052
+ if (parsed.reasoning) {
3053
+ spinner.setThinkingHint(parsed.reasoning);
3054
+ }
3055
+ if (!parsed.content) return;
3182
3056
  spinner.stop();
3183
3057
  options.activityReporter?.(null);
3184
3058
  if (!printedAssistantLabel) {
@@ -3188,17 +3062,8 @@ ${options.agentName} > `);
3188
3062
  }
3189
3063
  streamedAssistantText = true;
3190
3064
  everStreamedAnyText = true;
3191
- renderWriter.push(chunk);
3065
+ renderWriter.push(parsed.content);
3192
3066
  };
3193
- const thinkingFilter = createThinkingAwareStreamFilter(
3194
- writeVisibleAssistantChunk,
3195
- thinkingMode
3196
- );
3197
- const thinkingSink = createThinkingEventSink((chunk) => {
3198
- spinner.stop();
3199
- options.activityReporter?.(null);
3200
- options.output.write(chunk);
3201
- }, thinkingMode);
3202
3067
  const handleToolEvent = (event) => {
3203
3068
  if (!traceLocalTools) return;
3204
3069
  const chunk = eventMode === "jsonl" ? formatToolJsonEvent(event) : formatToolEvent(event);
@@ -3207,7 +3072,6 @@ ${options.agentName} > `);
3207
3072
  return;
3208
3073
  }
3209
3074
  if (event.type === "tool-call") {
3210
- thinkingFilter.flush();
3211
3075
  renderWriter.flush();
3212
3076
  }
3213
3077
  spinner.stop();
@@ -3224,16 +3088,15 @@ ${options.agentName} > `);
3224
3088
  spinner.show(activeLabel);
3225
3089
  options.activityReporter?.(activeLabel);
3226
3090
  }
3227
- if (event.type === "tool-result" && options.onAgentRunStatus && event.toolName === "startAgentRun") {
3228
- const snapshot = extractAgentRunStatusSnapshot(event);
3229
- if (snapshot) {
3230
- options.onAgentRunStatus(snapshot);
3091
+ if (options.onAgentRunStatus) {
3092
+ const parsed = parseAgentRunEvent(event);
3093
+ if (parsed) {
3094
+ options.onAgentRunStatus(parsed.kind === "gone" ? null : parsed.snapshot);
3231
3095
  }
3232
3096
  }
3233
3097
  };
3234
3098
  return {
3235
3099
  spinner,
3236
- thinkingMode,
3237
3100
  toolDisplayMode,
3238
3101
  traceLocalTools,
3239
3102
  eventMode,
@@ -3244,10 +3107,10 @@ ${options.agentName} > `);
3244
3107
  options.output.write(pendingToolOutput);
3245
3108
  }
3246
3109
  }
3247
- thinkingFilter.push(chunk);
3110
+ writeVisibleAssistantChunk(chunk);
3248
3111
  },
3249
3112
  pushThinking(chunk) {
3250
- thinkingSink.push(chunk);
3113
+ spinner.setThinkingHint(chunk);
3251
3114
  },
3252
3115
  handleToolEvent,
3253
3116
  showWorking(label) {
@@ -3258,19 +3121,22 @@ ${options.agentName} > `);
3258
3121
  finish(fallbackContent) {
3259
3122
  spinner.stop();
3260
3123
  options.activityReporter?.(null);
3124
+ const flushedThink = flushThinkParser(thinkState);
3125
+ thinkState = flushedThink.state;
3126
+ if (flushedThink.content) {
3127
+ writeVisibleAssistantChunk(flushedThink.content);
3128
+ }
3261
3129
  const pendingToolOutput = formatToolEvent.flush ? formatToolEvent.flush() : "";
3262
3130
  if (pendingToolOutput) {
3263
3131
  options.output.write(pendingToolOutput);
3264
3132
  }
3265
3133
  if (streamedAssistantText) {
3266
- thinkingFilter.flush();
3267
3134
  renderWriter.flush();
3268
3135
  options.output.write("\n");
3269
3136
  } else if (everStreamedAnyText) {
3270
- thinkingFilter.flush();
3271
3137
  options.output.write("\n");
3272
3138
  } else {
3273
- const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim(), options) : "";
3139
+ const content = fallbackContent ? formatAssistantResponseForCli(fallbackContent.trim()) : "";
3274
3140
  if (content) {
3275
3141
  options.output.write(`
3276
3142
  ${options.agentName} > ${content}
@@ -3284,35 +3150,6 @@ ${options.agentName} > (no text response)
3284
3150
  }
3285
3151
  };
3286
3152
  }
3287
- function extractAgentRunStatusSnapshot(event) {
3288
- if (event.type !== "tool-result") return null;
3289
- const content = typeof event.content === "string" ? event.content.trim() : "";
3290
- if (!content.startsWith("{")) return null;
3291
- try {
3292
- const parsed = JSON.parse(content);
3293
- const runId = typeof parsed.runId === "string" ? parsed.runId : "";
3294
- const status = typeof parsed.status === "string" ? parsed.status : "running";
3295
- const label = resolveRunLabel({
3296
- agentName: parsed.agentName,
3297
- name: parsed.name,
3298
- agentKey: parsed.agentKey
3299
- });
3300
- const agentName = isAgentNameFallback(label) ? void 0 : label;
3301
- const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
3302
- const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
3303
- const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
3304
- return {
3305
- runId,
3306
- agentName,
3307
- status,
3308
- logTail,
3309
- logLines,
3310
- errorMessage
3311
- };
3312
- } catch {
3313
- return null;
3314
- }
3315
- }
3316
3153
 
3317
3154
  // packages/cli/client/agentRunStream.ts
3318
3155
  async function readStreamingAgentRun(options, res, existingSpinner) {
@@ -3695,7 +3532,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3695
3532
  // packages/cli/client/agentRun.ts
3696
3533
  import { ulid } from "ulid";
3697
3534
  async function loadRunLocalAgentTurn() {
3698
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QNPNJRVH.js");
3535
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QUTBSY3I.js");
3699
3536
  return runLocalAgentTurn;
3700
3537
  }
3701
3538
  async function resolveCurrentMachineId(options) {
@@ -3722,7 +3559,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
3722
3559
  output: options.output,
3723
3560
  ...options.confirmDestructiveAction ? { confirmDestructiveAction: options.confirmDestructiveAction } : {},
3724
3561
  ...options.requestUserChoice ? { requestUserChoice: options.requestUserChoice } : {},
3725
- ...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {}
3562
+ ...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {},
3563
+ ...options.activityReporter ? { activityReporter: options.activityReporter } : {}
3726
3564
  });
3727
3565
  }
3728
3566
  function resolveLocalRuntimeAdapter(options) {
@@ -3961,6 +3799,7 @@ async function runHttpAgentTurn(options, authToken) {
3961
3799
  runtime: "bun",
3962
3800
  entrypoint: "nolo-cli",
3963
3801
  capabilities: ["text-io", "streaming", "slash-commands"],
3802
+ ...options.dialogAgentMode ? { dialogAgentMode: options.dialogAgentMode } : {},
3964
3803
  ...subjectRefs ? { subjectRefs } : {},
3965
3804
  ...allowedChildAgentKeys?.length ? { allowedChildAgentKeys } : {},
3966
3805
  ...blockedToolNames?.length ? { blockedToolNames } : {},
@@ -4063,8 +3902,7 @@ async function runHttpAgentTurn(options, authToken) {
4063
3902
  return dialogIdText ? { exitCode: 1, dialogId: dialogIdText } : { exitCode: 1 };
4064
3903
  }
4065
3904
  const content = formatAssistantResponseForCli(
4066
- String(data?.content ?? data?.message ?? ""),
4067
- options
3905
+ String(data?.content ?? data?.message ?? "")
4068
3906
  );
4069
3907
  if (content) {
4070
3908
  options.output.write(`
@@ -4123,8 +3961,9 @@ async function runLocalAgentTurnForCli(options, settings) {
4123
3961
  const blockedToolNames = options.blockedToolNames?.filter(
4124
3962
  (name) => name.trim()
4125
3963
  );
4126
- const runtimeContext = subjectRefs || allowedChildAgentKeys?.length || allowedToolNames?.length || blockedToolNames?.length || options.parentWakeOnTerminal ? {
3964
+ const runtimeContext = subjectRefs || allowedChildAgentKeys?.length || allowedToolNames?.length || blockedToolNames?.length || options.parentWakeOnTerminal || options.dialogAgentMode ? {
4127
3965
  ...subjectRefs ? { subjectRefs } : {},
3966
+ ...options.dialogAgentMode ? { dialogAgentMode: options.dialogAgentMode } : {},
4128
3967
  ...allowedChildAgentKeys?.length ? { allowedChildAgentKeys } : {},
4129
3968
  ...allowedToolNames?.length ? { allowedToolNames } : {},
4130
3969
  ...blockedToolNames?.length ? { blockedToolNames } : {},
@@ -4133,7 +3972,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4133
3972
  } : void 0;
4134
3973
  const currentDialogId = options.continueDialogId ?? ulid();
4135
3974
  const runChildTurn = async (input) => {
4136
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QNPNJRVH.js");
3975
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-QUTBSY3I.js");
4137
3976
  return runLocalAgentTurn(input);
4138
3977
  };
4139
3978
  const createFreshChildBaseAdapter = () => {
@@ -4905,6 +4744,7 @@ var resolveMemoryRuntime = async (input) => {
4905
4744
  userId: input.userId,
4906
4745
  spaceId: input.spaceId,
4907
4746
  agentKey: input.agentKey,
4747
+ memorySubjectId: input.memorySubjectId,
4908
4748
  policy
4909
4749
  }),
4910
4750
  kinds: ["episodic", "semantic", "procedural"],
@@ -5409,31 +5249,6 @@ ${mdContent}`);
5409
5249
  }
5410
5250
  return result.exitCode;
5411
5251
  }
5412
- var QUOTA_ERROR_PATTERNS = [
5413
- /429/,
5414
- /quota/i,
5415
- /rate\s*limit/i,
5416
- /too\s*many\s*requests/i,
5417
- /额度/,
5418
- /上限/,
5419
- /用尽/,
5420
- /CliProviderQuotaError/i
5421
- ];
5422
- function isQuotaExhaustedError(error) {
5423
- if (!error) return false;
5424
- if (error instanceof CliProviderQuotaError) return true;
5425
- if (error instanceof Error) {
5426
- return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error.message));
5427
- }
5428
- if (typeof error === "string") {
5429
- return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error));
5430
- }
5431
- const maybeStatus = error.status;
5432
- if (typeof maybeStatus === "number" && maybeStatus === 429) return true;
5433
- const maybeStatusCode = error.statusCode;
5434
- if (typeof maybeStatusCode === "number" && maybeStatusCode === 429) return true;
5435
- return false;
5436
- }
5437
5252
  var BALANCE_ERROR_PATTERNS = [
5438
5253
  /UPSTREAM_402/i,
5439
5254
  /Insufficient Balance/i,
@@ -5476,6 +5291,7 @@ export {
5476
5291
  setActiveBrightness,
5477
5292
  getActiveDensity,
5478
5293
  setActiveDensity,
5294
+ detectSystemBrightnessFromEnv,
5479
5295
  resolveTuiBrightness,
5480
5296
  setActiveTerminalBaseHex,
5481
5297
  applyDetectedBackground,
@@ -5483,7 +5299,6 @@ export {
5483
5299
  themeColorSequence,
5484
5300
  themeText,
5485
5301
  formatAssistantDisplay,
5486
- normalizeThinkingDisplayMode,
5487
5302
  normalizeToolDisplayMode,
5488
5303
  COLLAPSED_PASTE_PLACEHOLDER_RE,
5489
5304
  shouldCollapsePaste,
@@ -5503,6 +5318,5 @@ export {
5503
5318
  normalizeCliImageInput,
5504
5319
  inspectLocalRunWorkspace,
5505
5320
  runAgentRunCommand,
5506
- isQuotaExhaustedError,
5507
5321
  isBalanceExhaustedError
5508
5322
  };