nolo-cli 0.16.0-alpha.2 → 0.16.0-alpha.21

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 (136) hide show
  1. package/{_executeModel-QAUS6B7J.js → _executeModel-GRCQXT5R.js} +51 -45
  2. package/{action-GUOZYYGN.js → action-LT7BRFLK.js} +10 -9
  3. package/{addContentAction-QDGHGUBH.js → addContentAction-PL3KKBDH.js} +9 -8
  4. package/{addDialogAgentAction-Z4YCYZIV.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
  5. package/{agentDeleteCommand-365DMKHW.js → agentDeleteCommand-WNL3CNQX.js} +32 -29
  6. package/{agentEmailCommands-TQMXL36I.js → agentEmailCommands-MPEUMRAS.js} +63 -57
  7. package/{agentListCommands-6B5X4RC6.js → agentListCommands-YO4AOQMS.js} +31 -28
  8. package/{agentMachineCommands-LOEARB6V.js → agentMachineCommands-WYM6YRYJ.js} +30 -27
  9. package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
  10. package/agentRecordCommands-BVWSHMIY.js +105 -0
  11. package/{agentRunCommand-SGMH67WT.js → agentRunCommand-E3ZI6RSF.js} +64 -55
  12. package/{agentRunControl-6ADXVYMR.js → agentRunControl-Y5AFH5PQ.js} +24 -1
  13. package/{agentRuntimeLocal-YSYZ33ER.js → agentRuntimeLocal-P4VGX6H6.js} +26 -25
  14. package/{agentSlice-IVE735EV.js → agentSlice-D33GU3JL.js} +9 -8
  15. package/{appDeleteCommands-6QYOO3JB.js → appDeleteCommands-VA4R2SWX.js} +29 -26
  16. package/{appDeployCommands-WTCT6XO6.js → appDeployCommands-JWMWQNG6.js} +29 -26
  17. package/{appDeployStatusCommands-CGWGZJKB.js → appDeployStatusCommands-KYXGLZSQ.js} +29 -26
  18. package/{appGetCommands-O4OCAMRW.js → appGetCommands-ELOO3JG6.js} +29 -26
  19. package/{appListCommands-UENFP4XY.js → appListCommands-SJUW4RLW.js} +29 -26
  20. package/{authCommand-YFTR3347.js → authCommand-WJZPOLSS.js} +16 -9
  21. package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
  22. package/{chunk-RKM3K52F.js → chunk-34WPV75U.js} +23 -2
  23. package/{chunk-VPTJB4HM.js → chunk-3ND52WIL.js} +2 -5
  24. package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
  25. package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
  26. package/{chunk-U7LEGLEB.js → chunk-4T5F7YZQ.js} +1 -1
  27. package/{chunk-OQMPU2ML.js → chunk-5PGGCJGV.js} +6 -6
  28. package/chunk-7BUYEZ6U.js +671 -0
  29. package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
  30. package/{chunk-WA6KZL5V.js → chunk-AAODAAUQ.js} +23 -20
  31. package/{chunk-GRTFNYLR.js → chunk-AKVLLMOU.js} +3 -3
  32. package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
  33. package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
  34. package/{chunk-QZVGMD5F.js → chunk-BE2GNT5E.js} +2 -8
  35. package/{chunk-JKWWVF2I.js → chunk-D3HVJJIA.js} +1 -1
  36. package/{chunk-B4KT7RN2.js → chunk-DKZFOK24.js} +18 -89
  37. package/chunk-DL6EPNIK.js +50 -0
  38. package/{chunk-YYIRR6QC.js → chunk-E5KQTMMJ.js} +212 -250
  39. package/{chunk-4QQFLN5C.js → chunk-EGPCU42M.js} +58 -8
  40. package/{chunk-XVP3C2KY.js → chunk-ELT65PZW.js} +2 -2
  41. package/{chunk-EMXI3N3Z.js → chunk-ENP2ELIL.js} +5 -5
  42. package/{chunk-6565R2TI.js → chunk-EXAEHRLI.js} +112 -191
  43. package/chunk-FQZZLA3C.js +223 -0
  44. package/{chunk-WPN6RMDF.js → chunk-GMZZ5EKJ.js} +3 -3
  45. package/{chunk-RSYUDGGZ.js → chunk-HQNPCMWL.js} +3 -3
  46. package/{chunk-OGGHETUE.js → chunk-HQPG2PIV.js} +62 -19
  47. package/{chunk-4NLUNENX.js → chunk-IQZ6TGVW.js} +10 -3
  48. package/{chunk-VE6XMVKG.js → chunk-J67FKTTY.js} +330 -213
  49. package/{chunk-G2MKOQCB.js → chunk-JFE7XW4D.js} +1 -1
  50. package/{setDialogExtraReferencesAction-2VLGWQKG.js → chunk-JLA4FXYC.js} +2 -17
  51. package/{chunk-OOIN7HSO.js → chunk-JP7REMYP.js} +19 -1
  52. package/chunk-KFEVY3ST.js +255 -0
  53. package/{chunk-I66RU7P7.js → chunk-KKWJ5VPZ.js} +1 -1
  54. package/{chunk-WRN5EQT7.js → chunk-L2RRMXNJ.js} +13 -4
  55. package/{chunk-ISYE6GZB.js → chunk-L6NVTGI7.js} +1 -1
  56. package/{chunk-HRQCKQA5.js → chunk-MUCU6ATG.js} +8 -257
  57. package/{chunk-BFRVXJJJ.js → chunk-MUIT5AAM.js} +112 -27
  58. package/{chunk-WNLPAOIT.js → chunk-MVQ4TBSD.js} +1 -1
  59. package/{chunk-O53CP2QR.js → chunk-N2HYIBLH.js} +6 -6
  60. package/{chunk-524BDL33.js → chunk-O6W2O2DA.js} +1 -15
  61. package/{chunk-YC3DJILJ.js → chunk-PUSK7HXJ.js} +64 -22
  62. package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
  63. package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
  64. package/{chunk-Z24FGIU2.js → chunk-RIDWN7AP.js} +34 -15
  65. package/{chunk-IKXL2HZ3.js → chunk-RK5NYQEL.js} +1 -1
  66. package/{chunk-QLFCNUVQ.js → chunk-RUTSBLDM.js} +1629 -261
  67. package/{chunk-TTGAVETO.js → chunk-RVOUXDFU.js} +5 -5
  68. package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
  69. package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
  70. package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
  71. package/{chunk-N5424GSW.js → chunk-UGUW3FHG.js} +4 -4
  72. package/{chunk-YNHQIXX5.js → chunk-UIOYWBU7.js} +395 -326
  73. package/chunk-V5R4NZP2.js +78 -0
  74. package/{chunk-MYMMNKYL.js → chunk-VNAEBGDK.js} +156 -6
  75. package/{chunk-J55UHASN.js → chunk-VST53WEL.js} +1 -1
  76. package/{chunk-6MHDWKOT.js → chunk-VVKQFITN.js} +25 -12
  77. package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
  78. package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
  79. package/chunk-X4Q4UZEY.js +26 -0
  80. package/{chunk-E237VE6U.js → chunk-XFYDGBXL.js} +4 -4
  81. package/{chunk-JS33TCQ3.js → chunk-XHG22OEX.js} +4 -4
  82. package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
  83. package/{chunk-V2J635L5.js → chunk-XOIF2TNF.js} +2 -2
  84. package/{chunk-SFXYKGK2.js → chunk-XRZJGPFI.js} +7 -7
  85. package/chunk-ZHXJ6M7T.js +27 -0
  86. package/chunk-ZZ2MH7LE.js +84 -0
  87. package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
  88. package/codingSkills-36KN5NQT.js +48 -0
  89. package/{createAgentAutomationAction-TS6NNZ4X.js → createAgentAutomationAction-ONKZ46XE.js} +22 -21
  90. package/{createDialogAction-5HVQ33EX.js → createDialogAction-7QWJEBKU.js} +24 -23
  91. package/{createPageAction-4F3ZGQJD.js → createPageAction-PB3KXZIA.js} +28 -27
  92. package/{dbSlice-OP6UPXKA.js → dbSlice-CGSRFJN3.js} +8 -7
  93. package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
  94. package/{dialogCommands-ZL6L24BS.js → dialogCommands-YZFU4Q26.js} +30 -27
  95. package/{dialogSlice-FAWUQDJW.js → dialogSlice-53B5ISGQ.js} +22 -21
  96. package/{docCreateCommands-LYROQTFH.js → docCreateCommands-LOUC5PFB.js} +28 -25
  97. package/{docDeleteCommands-6TWGTZNR.js → docDeleteCommands-HHPGT4BR.js} +29 -26
  98. package/{docReadCommands-PRULNF26.js → docReadCommands-YPSN4HEF.js} +28 -25
  99. package/{docStore-2UHVWLTV.js → docStore-LJXXRB5W.js} +23 -22
  100. package/{docUpdateCommands-NNYYWJBI.js → docUpdateCommands-CJCZO54M.js} +28 -25
  101. package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
  102. package/{getPricing-UGDJHI7M.js → getPricing-RYY6OBA4.js} +4 -4
  103. package/handleSendMessageAction-ICGX4QCM.js +402 -0
  104. package/index.js +68 -68
  105. package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
  106. package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
  107. package/{machineCommands-JQPEQFSE.js → machineCommands-YLDZXK4D.js} +64 -58
  108. package/{machineWsRunDispatch-FFFNWVEW.js → machineWsRunDispatch-LTQL3DRE.js} +56 -50
  109. package/{models-LSCRJJ6P.js → models-5K5G2CZI.js} +2 -2
  110. package/package.json +1 -1
  111. package/queryRunOverlay-O4LOMMPO.js +161 -0
  112. package/{read-HXHAZBKH.js → read-3FMPZPER.js} +3 -3
  113. package/{readDocTool-VPBDTO4G.js → readDocTool-VSYHKK3V.js} +1 -1
  114. package/{readlineWorkspace-QSXHSBHA.js → readlineWorkspace-OSPVWNAT.js} +699 -168
  115. package/{removeDialogAgentAction-HUFVN35S.js → removeDialogAgentAction-OAGA2G3U.js} +11 -10
  116. package/{runAgentClientLoop-A75BUU6D.js → runAgentClientLoop-76SUKKPX.js} +46 -40
  117. package/runOverlayPresentation-ZO4VCWEU.js +11 -0
  118. package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
  119. package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
  120. package/{setPrimaryDialogAgentAction-VB4UV2CC.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +27 -18
  121. package/{settingSlice-7JYPQNAC.js → settingSlice-7MNKHZ6R.js} +9 -8
  122. package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
  123. package/{spaceCommands-4LE45GB7.js → spaceCommands-GIF7MKVD.js} +31 -28
  124. package/{spaceSlice-444MFUP6.js → spaceSlice-M4PVN5PO.js} +22 -21
  125. package/{streamAgentChatTurn-DJAE7USZ.js → streamAgentChatTurn-GCKTFSHQ.js} +96 -55
  126. package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
  127. package/{tools-YB6LXSVN.js → tools-RJVFXOLR.js} +35 -30
  128. package/{tuiSummaryLlmCaller-QQL3JA5I.js → tuiSummaryLlmCaller-VUNVBRX3.js} +7 -6
  129. package/types-ZSTJ7MPR.js +7 -0
  130. package/{updateDialogTitleAction-6HGFBM64.js → updateDialogTitleAction-PSR67DLV.js} +25 -24
  131. package/agentRecordCommands-DCH2WBL2.js +0 -99
  132. package/chunk-BYXBJQAS.js +0 -0
  133. package/handleSendMessageAction-LJPUYNOH.js +0 -215
  134. package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
  135. package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
  136. 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-IQZ6TGVW.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-QLFCNUVQ.js";
22
- import {
23
- getReadableCliDb
24
- } from "./chunk-W4NVOSFF.js";
25
- import {
26
- readDbRecord,
27
- resolveAgentRecordFromHybridStore
28
- } from "./chunk-4NLUNENX.js";
29
- import {
30
- normalizeAgentHandle
31
- } from "./chunk-QZVGMD5F.js";
28
+ } from "./chunk-RUTSBLDM.js";
32
29
  import {
33
30
  NOLO_PROJECT_MANAGER_AGENT_KEY,
34
31
  isLocalCliAgentKey
@@ -38,39 +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
- isAgentRunTerminalStatus
48
- } from "./chunk-VE6XMVKG.js";
38
+ resolveMachineId
39
+ } from "./chunk-6HYVJV7B.js";
40
+ import {
41
+ formatAgentListCard
42
+ } from "./chunk-J67FKTTY.js";
49
43
  import {
50
44
  isGatewayHttpStatus
51
45
  } from "./chunk-RQSOAMPJ.js";
46
+ import {
47
+ getDefaultCliLocalRuntimeDb
48
+ } from "./chunk-WJRJDX2W.js";
52
49
  import {
53
50
  buildMemorySubjectsForAgent,
54
51
  chooseMemoryOwners,
55
52
  loadMemoryCandidatesFromDb,
56
53
  resolveAgentMemoryPolicy
57
- } from "./chunk-Z24FGIU2.js";
58
- import {
59
- parseExternalSkillMarkdown,
60
- parseSkillDocProtocol
61
- } from "./chunk-VC6OZXO5.js";
54
+ } from "./chunk-RIDWN7AP.js";
62
55
  import {
63
56
  API_REPORTED_COST_MULTIPLIER,
64
57
  normalizeUsage,
65
58
  parseUiAskChoiceContent
66
- } from "./chunk-YNHQIXX5.js";
59
+ } from "./chunk-UIOYWBU7.js";
67
60
  import {
68
61
  buildSkillDiscoveryContextBlock
69
- } from "./chunk-AS3ZQ3O2.js";
62
+ } from "./chunk-7OBMZCRD.js";
63
+ import {
64
+ parseExternalSkillMarkdown,
65
+ parseSkillDocProtocol
66
+ } from "./chunk-VC6OZXO5.js";
70
67
  import {
71
68
  buildPlatformChatCompletionRequest,
72
69
  parsePlatformChatCompletionData
73
- } from "./chunk-WA6KZL5V.js";
70
+ } from "./chunk-AAODAAUQ.js";
74
71
  import {
75
72
  resolveAgentRuntimeConfigFromRecord
76
73
  } from "./chunk-OIQPORYI.js";
@@ -79,7 +76,7 @@ import {
79
76
  LOCAL_TURN_ABORTED_CODE,
80
77
  readActionGate,
81
78
  readCommandActionGatePayload
82
- } from "./chunk-6MHDWKOT.js";
79
+ } from "./chunk-VVKQFITN.js";
83
80
  import {
84
81
  createThinkParserState,
85
82
  flushThinkParser,
@@ -88,21 +85,24 @@ import {
88
85
  import {
89
86
  resolvePlatformAuthToken,
90
87
  resolvePlatformChatCompletionsEndpoint
91
- } from "./chunk-HRQCKQA5.js";
88
+ } from "./chunk-MUCU6ATG.js";
92
89
  import {
93
90
  DEFAULT_CONTEXT_WINDOW,
94
91
  getModelContextWindow
95
- } from "./chunk-4QQFLN5C.js";
92
+ } from "./chunk-EGPCU42M.js";
96
93
  import {
97
94
  clipCompactText
98
95
  } from "./chunk-5MMAK75Q.js";
99
96
  import {
100
97
  findModelConfig
101
- } from "./chunk-OGGHETUE.js";
98
+ } from "./chunk-HQPG2PIV.js";
99
+ import {
100
+ toErrorMessage
101
+ } from "./chunk-HNMXYYJR.js";
102
102
  import {
103
103
  buildMemoryOverlayLayer,
104
104
  buildMemoryUseGuidanceLayer
105
- } from "./chunk-QLUFR47U.js";
105
+ } from "./chunk-AL2V7U3E.js";
106
106
  import {
107
107
  compactWhitespace
108
108
  } from "./chunk-DWLEOOGR.js";
@@ -110,16 +110,20 @@ import {
110
110
  createRunActivityTracker,
111
111
  finalizeRunRecord,
112
112
  spawnLocalBackgroundRun
113
- } from "./chunk-MYMMNKYL.js";
113
+ } from "./chunk-VNAEBGDK.js";
114
114
  import {
115
- CliProviderQuotaError
116
- } from "./chunk-CMKUBIGW.js";
117
- import {
118
- toErrorMessage
119
- } from "./chunk-HNMXYYJR.js";
115
+ formatFinishedRunCard,
116
+ formatListRunsCard,
117
+ formatNotFoundRunCard,
118
+ formatStartRunCard,
119
+ formatStatusRunCard,
120
+ formatStopRunCard,
121
+ isAgentRunTerminalStatus,
122
+ runShowsLogTail
123
+ } from "./chunk-FQZZLA3C.js";
120
124
  import {
121
- getDefaultCliLocalRuntimeDb
122
- } from "./chunk-H33743XH.js";
125
+ CliProviderQuotaError
126
+ } from "./chunk-X7W4TNB4.js";
123
127
  import {
124
128
  readPipeText,
125
129
  spawnProcess
@@ -132,7 +136,7 @@ import {
132
136
  } from "./chunk-Y5GCAMGP.js";
133
137
  import {
134
138
  createMemoryKey
135
- } from "./chunk-O4BU24WZ.js";
139
+ } from "./chunk-6Y7A3OQQ.js";
136
140
  import {
137
141
  asTrimmedLowercaseString
138
142
  } from "./chunk-QSJ3HFEF.js";
@@ -140,7 +144,7 @@ import {
140
144
  BUILTIN_NOLO_AGENT_KEY,
141
145
  PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
142
146
  PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
143
- } from "./chunk-VPTJB4HM.js";
147
+ } from "./chunk-3ND52WIL.js";
144
148
  import {
145
149
  asTrimmedString
146
150
  } from "./chunk-3EUW3WEO.js";
@@ -153,7 +157,7 @@ import {
153
157
 
154
158
  // packages/agent-runtime/quickChatIntentCore.ts
155
159
  var INTENT_MODEL = "deepseek-v4-flash";
156
- var INTENT_PROVIDER = "deepseek";
160
+ var INTENT_PROVIDER = "nolo";
157
161
  var QUICK_CHAT_INTENT_TIMEOUT_MS = 4e3;
158
162
  var SHORT_GREETING_MAX_LENGTH = 20;
159
163
  var SHORT_GREETING_PATTERN = /^(?:hi|hello|hey|hiya|yo|sup|howdy|嗨|哈喽|哈囉|你好|您好|在吗|在嘛|喂|早上好|中午好|下午好|晚上好|拜拜|再见|谢谢|thanks|thx|ok|好的|收到|了解)[!.。,、~~]?$/iu;
@@ -194,23 +198,18 @@ function buildQuickChatIntentSystemPrompt(tierAgents) {
194
198
  \u53EF\u9009 agent \u5217\u8868\uFF08agentKey \u4E0E\u63CF\u8FF0\uFF09\uFF1A
195
199
  ${agentList}
196
200
 
197
- \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
198
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
199
203
  - \u7B80\u5355\u95EE\u5019\u3001\u95F2\u804A\u3001\u5FEB\u901F\u95EE\u7B54\u3001\u7FFB\u8BD1\u3001\u77ED\u6587 \u2192 \u9009 flash \u6863
200
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
201
205
  - \u590D\u6742\u63A8\u7406\u3001\u957F\u6587\u3001\u67B6\u6784\u8BBE\u8BA1\u3001\u6DF1\u5EA6\u5206\u6790 \u2192 \u9009 quality \u6863
202
- - **\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
203
207
  - \u4E13\u804C agent \u8DEF\u7531\u89C4\u5219\uFF08\u6709\u660E\u786E\u5339\u914D\u65F6\u4F7F\u7528\uFF09\uFF1A
204
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
205
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
206
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
207
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
208
- - **\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
209
-
210
- \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
211
- - 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
212
- - 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
213
- - \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
214
213
 
215
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
216
215
 
@@ -222,7 +221,7 @@ ${agentList}
222
221
  - \u666E\u901A\u95EE\u7B54/\u7EAF\u95F2\u804A/\u5EFA\u5E94\u7528 \u2192 skills \u4E3A []
223
222
 
224
223
  \u53EA\u8F93\u51FA JSON\uFF0C\u4E0D\u8981\u8F93\u51FA\u5176\u4ED6\u5185\u5BB9\uFF1A
225
- {"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 []>}`;
226
225
  }
227
226
  function parseQuickChatIntentResult(content, tierAgents) {
228
227
  try {
@@ -231,8 +230,6 @@ function parseQuickChatIntentResult(content, tierAgents) {
231
230
  const key = parsed.agentKey;
232
231
  if (typeof key !== "string") return null;
233
232
  if (!tierAgents.some((t2) => t2.agentKey === key)) return null;
234
- const rawNeedsWorkspace = parsed.needsWorkspace;
235
- const needsWorkspace = rawNeedsWorkspace === true;
236
233
  const rawConfidence = parsed.confidence;
237
234
  const confidence = typeof rawConfidence === "number" && Number.isFinite(rawConfidence) && rawConfidence >= 0 && rawConfidence <= 1 ? rawConfidence : void 0;
238
235
  const rawSkills = parsed.skills;
@@ -243,7 +240,7 @@ function parseQuickChatIntentResult(content, tierAgents) {
243
240
  );
244
241
  if (filtered.length > 0) skills = filtered;
245
242
  }
246
- return { agentKey: key, needsWorkspace, confidence, skills };
243
+ return { agentKey: key, confidence, skills };
247
244
  } catch {
248
245
  return null;
249
246
  }
@@ -355,7 +352,6 @@ async function classifyCliAutoRoute(text, options) {
355
352
  tier,
356
353
  classified: true,
357
354
  confidence: parsed.confidence,
358
- needsWorkspace: parsed.needsWorkspace,
359
355
  skills: parsed.skills
360
356
  };
361
357
  } catch {
@@ -394,7 +390,7 @@ var PROVIDER_LOOKUP_ORDER = [
394
390
  "mimo",
395
391
  "gmi",
396
392
  "google",
397
- "deepseek",
393
+ "nolo",
398
394
  "mistral",
399
395
  "vultr",
400
396
  "deepinfra",
@@ -958,6 +954,17 @@ function supportsTruecolor(env = process.env) {
958
954
  const program = (env.TERM_PROGRAM ?? "").toLowerCase();
959
955
  return TRUECOLOR_TERM_PROGRAMS.has(program);
960
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
+ }
961
968
  function resolveTuiBrightness(env = process.env) {
962
969
  const explicit = (env.NOLO_TUI_THEME ?? "").trim().toLowerCase();
963
970
  if (explicit === "light") return "light";
@@ -970,6 +977,8 @@ function resolveTuiBrightness(env = process.env) {
970
977
  if (!Number.isNaN(bg) && bg >= 0 && bg <= 6) return "dark";
971
978
  if (!Number.isNaN(bg) && bg >= 7 && bg <= 15) return "light";
972
979
  }
980
+ const sys = detectSystemBrightnessFromEnv(env);
981
+ if (sys) return sys;
973
982
  return "dark";
974
983
  }
975
984
  function hexToSgr(hex) {
@@ -1000,7 +1009,8 @@ function setActiveTerminalBaseHex(hex) {
1000
1009
  }
1001
1010
  function applyDetectedBackground(detected) {
1002
1011
  const normalizedHex = detected.hex.replace(/^#/, "").toUpperCase();
1003
- const changed = detected.brightness !== activeBrightness || normalizedHex !== activeTerminalBaseHex;
1012
+ const hexChanged = normalizedHex !== "" && normalizedHex !== activeTerminalBaseHex;
1013
+ const changed = detected.brightness !== activeBrightness || hexChanged;
1004
1014
  setActiveBrightness(detected.brightness);
1005
1015
  setActiveTerminalBaseHex(detected.hex);
1006
1016
  return changed;
@@ -2128,24 +2138,8 @@ function isFailedToolResult(event) {
2128
2138
  function isNeedsActionToolResult(event) {
2129
2139
  return Boolean(event.metadata?.actionGate);
2130
2140
  }
2131
- function readRunAgentName(parsed) {
2132
- const agentName = typeof parsed.agentName === "string" ? parsed.agentName.trim() : "";
2133
- if (agentName) return agentName;
2134
- const name = typeof parsed.name === "string" ? parsed.name.trim() : "";
2135
- return name || "agent";
2136
- }
2137
- function readRunLogLines(parsed) {
2138
- if (Array.isArray(parsed.logLines)) return parsed.logLines;
2139
- if (typeof parsed.logTail === "string" && parsed.logTail.trim()) {
2140
- return parsed.logTail.split("\n");
2141
- }
2142
- return void 0;
2143
- }
2144
- function readRunErrorMessage(parsed) {
2145
- return typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
2146
- }
2147
2141
  function parseUiAskChoiceForCli(event) {
2148
- if (event.toolName !== "ui_ask_choice" && !event.metadata?.uiAskChoice) {
2142
+ if (event.toolName !== "ask_user" && !event.metadata?.uiAskChoice) {
2149
2143
  return null;
2150
2144
  }
2151
2145
  const parsed = parseUiAskChoiceContent(event.content);
@@ -2246,70 +2240,84 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
2246
2240
  return `${dimCliText(text, true)}
2247
2241
  `;
2248
2242
  }
2249
- 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 : "";
2250
2274
  const trimmed = content.trim();
2251
- if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return content;
2275
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
2252
2276
  const labels = agentRunCardLabels();
2253
- try {
2254
- const parsed = JSON.parse(trimmed);
2255
- if (toolName === "listAgents") {
2277
+ if (toolName === "listAgents") {
2278
+ try {
2279
+ const parsed = JSON.parse(trimmed);
2256
2280
  const agents = Array.isArray(parsed.agents) ? parsed.agents : [];
2257
2281
  return formatAgentListCard(agents);
2282
+ } catch {
2283
+ return null;
2258
2284
  }
2259
- if (toolName === "startAgentRun") {
2260
- const name = typeof parsed.agentName === "string" && parsed.agentName.trim() ? parsed.agentName.trim() : typeof parsed.name === "string" && parsed.name.trim() ? parsed.name.trim() : "agent";
2261
- const status = typeof parsed.status === "string" ? parsed.status : "running";
2262
- return formatStartRunCard(name, status, labels);
2263
- }
2264
- if (toolName === "controlAgentRun") {
2285
+ }
2286
+ if (toolName === "controlAgentRun") {
2287
+ try {
2288
+ const parsed = JSON.parse(trimmed);
2265
2289
  if (Array.isArray(parsed.runs)) {
2266
- const runs = parsed.runs;
2267
- return formatListRunsCard(runs, labels);
2268
- }
2269
- const status = typeof parsed.status === "string" ? parsed.status : void 0;
2270
- if (parsed.found === false || status === "not_found") {
2271
- return formatNotFoundRunCard(labels);
2272
- }
2273
- if (status === "killed" || status === "cancelled" || status === "cancelling") {
2274
- return formatStopRunCard(status, labels);
2290
+ return formatListRunsCard(
2291
+ parsed.runs,
2292
+ labels
2293
+ );
2275
2294
  }
2276
- return formatStatusRunCard(readRunAgentName(parsed), status ?? "\u2014", {
2277
- errorMessage: readRunErrorMessage(parsed),
2278
- logLines: readRunLogLines(parsed),
2279
- labels
2280
- });
2295
+ } catch {
2296
+ return null;
2281
2297
  }
2282
- } catch {
2283
2298
  }
2284
- 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);
2285
2312
  }
2286
2313
  function parseControlAgentRunStatusEvent(event) {
2287
- const raw = typeof event.content === "string" && event.content.trim() ? event.content.trim() : "";
2288
- if (!raw.startsWith("{")) return null;
2289
- try {
2290
- const parsed = JSON.parse(raw);
2291
- if (Array.isArray(parsed.runs)) return null;
2292
- const status = typeof parsed.status === "string" ? parsed.status : void 0;
2293
- if (parsed.found === false || status === "not_found") return null;
2294
- if (status === "killed" || status === "cancelled" || status === "cancelling") return null;
2295
- if (!status) return null;
2296
- const runId = typeof parsed.runId === "string" && parsed.runId.trim() ? parsed.runId.trim() : typeof event.metadata?.runId === "string" ? event.metadata.runId : "";
2297
- if (!runId) return null;
2298
- const agentName = readRunAgentName(parsed);
2299
- const errorMessage = readRunErrorMessage(parsed);
2300
- const logLines = readRunLogLines(parsed);
2301
- const logKey = logLines && logLines.length > 0 ? logLines.join("\n") : "";
2302
- return { runId, status, agentName, errorMessage, logLines, logKey };
2303
- } catch {
2304
- return null;
2305
- }
2314
+ const parsed = parseAgentRunEvent(event);
2315
+ return parsed?.kind === "status" ? parsed.snapshot : null;
2306
2316
  }
2307
2317
  function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
2308
2318
  const rawLabel = toolLabel(toolName);
2309
- let rawDataStr = typeof event.metadata?.displayData === "string" && event.metadata.displayData.trim() ? event.metadata.displayData : typeof event.content === "string" ? event.content : "";
2310
- if (typeof event.metadata?.displayData !== "string" && typeof event.content === "string" && event.content.trim()) {
2311
- rawDataStr = recoverOrchestrationDisplayFromContent(toolName, event.content);
2312
- }
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 : "");
2313
2321
  const failed = event.type === "tool-error" || isFailedToolResult(event) || Boolean(event.metadata?.failed) || /^Error:/i.test(rawDataStr.trim());
2314
2322
  if (failed) {
2315
2323
  const firstLine = rawDataStr.trim().split("\n")[0] || event.summary || event.message || t("toolFailed");
@@ -2345,16 +2353,22 @@ function formatOrchestrationCardBlock(event, toolName, colorEnabled) {
2345
2353
  }
2346
2354
  return out;
2347
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
+ }
2348
2370
  function formatFoldedControlStatusCard(snapshot, colorEnabled) {
2349
- const labels = agentRunCardLabels();
2350
- const body = formatStatusRunCard(snapshot.agentName, snapshot.status, {
2351
- errorMessage: snapshot.errorMessage,
2352
- logLines: snapshot.logLines,
2353
- pollCount: snapshot.pollCount,
2354
- elapsedMs: snapshot.elapsedMs,
2355
- includeLogTail: snapshot.includeLogTail,
2356
- labels
2357
- });
2371
+ const body = renderRunCard(snapshot, { includeLogTail: snapshot.includeLogTail });
2358
2372
  return formatOrchestrationCardBlock(
2359
2373
  {
2360
2374
  type: "tool-result",
@@ -2362,8 +2376,7 @@ function formatFoldedControlStatusCard(snapshot, colorEnabled) {
2362
2376
  toolCallId: `fold-${snapshot.runId}`,
2363
2377
  toolName: "controlAgentRun",
2364
2378
  content: "",
2365
- metadata: { displayData: body },
2366
- elapsedMs: snapshot.elapsedMs
2379
+ metadata: { displayData: body }
2367
2380
  },
2368
2381
  "controlAgentRun",
2369
2382
  colorEnabled
@@ -2384,7 +2397,7 @@ function formatVerboseToolEvent(event, colorEnabled) {
2384
2397
  );
2385
2398
  }
2386
2399
  const elapsed = typeof event.elapsedMs === "number" ? ` ${event.elapsedMs}ms` : "";
2387
- 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)) {
2388
2401
  const block = formatUiAskChoiceBlock(event, colorEnabled);
2389
2402
  if (block) return `${formatToolTraceLine(`[nolo:tool] #${round} <- ${event.toolName}${elapsed}`, colorEnabled)}${block}`;
2390
2403
  }
@@ -2597,7 +2610,7 @@ function formatCompactToolLine(event, pending, colorEnabled) {
2597
2610
  if (event.type === "tool-result" && (toolName === "listAgents" || toolName === "startAgentRun" || toolName === "controlAgentRun")) {
2598
2611
  return formatOrchestrationCardBlock(event, toolName, colorEnabled);
2599
2612
  }
2600
- 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)) {
2601
2614
  const block = formatUiAskChoiceBlock(event, colorEnabled);
2602
2615
  if (block) return block;
2603
2616
  }
@@ -2639,31 +2652,31 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2639
2652
  let webSearchBuffer = [];
2640
2653
  let statusFold = null;
2641
2654
  const lastEmittedLogByRunId = /* @__PURE__ */ new Map();
2655
+ const lastPrintedCardByRunId = /* @__PURE__ */ new Map();
2656
+ const cardSubstance = (snapshot) => JSON.stringify([
2657
+ snapshot.status,
2658
+ snapshot.toolCallCount ?? -1,
2659
+ snapshot.lastToolNames ?? [],
2660
+ snapshot.lastAssistantText ?? "",
2661
+ snapshot.errorMessage ?? "",
2662
+ snapshot.logKey
2663
+ ]);
2642
2664
  const flushStatusFold = () => {
2643
2665
  if (!statusFold) return "";
2644
2666
  const fold = statusFold;
2645
2667
  statusFold = null;
2668
+ const substance = cardSubstance(fold);
2669
+ if (lastPrintedCardByRunId.get(fold.runId) === substance) return "";
2670
+ lastPrintedCardByRunId.set(fold.runId, substance);
2646
2671
  const prevLog = lastEmittedLogByRunId.get(fold.runId);
2647
- const includeLogTail = Boolean(fold.logKey) && fold.logKey !== prevLog;
2648
- if (fold.logKey) {
2672
+ const changed = Boolean(fold.logKey) && fold.logKey !== prevLog;
2673
+ if (changed && runShowsLogTail(fold.status)) {
2649
2674
  lastEmittedLogByRunId.set(fold.runId, fold.logKey);
2650
2675
  }
2651
- return formatFoldedControlStatusCard(
2652
- {
2653
- runId: fold.runId,
2654
- status: fold.status,
2655
- agentName: fold.agentName,
2656
- errorMessage: fold.errorMessage,
2657
- logLines: fold.logLines,
2658
- pollCount: fold.pollCount,
2659
- elapsedMs: fold.elapsedMs,
2660
- includeLogTail
2661
- },
2662
- colorEnabled
2663
- );
2676
+ return formatFoldedControlStatusCard({ ...fold, includeLogTail: changed }, colorEnabled);
2664
2677
  };
2665
- const flushBuffers = () => {
2666
- let out = flushStatusFold();
2678
+ const flushToolBuffers = () => {
2679
+ let out = "";
2667
2680
  if (readBuffer.length > 0) {
2668
2681
  const items = readBuffer.map((evt) => {
2669
2682
  const call = pending.get(evt.toolCallId);
@@ -2719,6 +2732,12 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2719
2732
  }
2720
2733
  return out;
2721
2734
  };
2735
+ const flushBuffers = () => `${flushStatusFold()}${flushToolBuffers()}`;
2736
+ const bufferToolResult = (buffer, event) => {
2737
+ const flushed = flushStatusFold();
2738
+ buffer.push(event);
2739
+ return flushed;
2740
+ };
2722
2741
  const formatter = (event) => {
2723
2742
  if (mode === "hide") return "";
2724
2743
  if (mode === "verbose") return formatVerboseToolEvent(event, colorEnabled);
@@ -2733,28 +2752,13 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2733
2752
  if (event.type === "tool-result") {
2734
2753
  const snapshot = parseControlAgentRunStatusEvent(event);
2735
2754
  if (snapshot) {
2736
- let out = "";
2737
- if (statusFold && statusFold.runId !== snapshot.runId) {
2755
+ let out = flushToolBuffers();
2756
+ const open = statusFold;
2757
+ const sameRun = open?.runId === snapshot.runId;
2758
+ if (open && (!sameRun || open.status !== snapshot.status)) {
2738
2759
  out += flushStatusFold();
2739
2760
  }
2740
- if (!statusFold) {
2741
- statusFold = {
2742
- ...snapshot,
2743
- pollCount: 1,
2744
- elapsedMs: event.elapsedMs
2745
- };
2746
- } else {
2747
- statusFold = {
2748
- runId: snapshot.runId,
2749
- status: snapshot.status,
2750
- agentName: snapshot.agentName,
2751
- errorMessage: snapshot.errorMessage ?? statusFold.errorMessage,
2752
- logLines: snapshot.logLines ?? statusFold.logLines,
2753
- logKey: snapshot.logKey || statusFold.logKey,
2754
- pollCount: statusFold.pollCount + 1,
2755
- elapsedMs: event.elapsedMs
2756
- };
2757
- }
2761
+ statusFold = open && sameRun ? mergeRunSnapshot(open, snapshot) : snapshot;
2758
2762
  pending.delete(event.toolCallId);
2759
2763
  if (isAgentRunTerminalStatus(snapshot.status)) {
2760
2764
  out += flushBuffers();
@@ -2776,8 +2780,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2776
2780
  return "";
2777
2781
  }
2778
2782
  if (event.type === "tool-result") {
2779
- readBuffer.push(event);
2780
- return "";
2783
+ return bufferToolResult(readBuffer, event);
2781
2784
  }
2782
2785
  }
2783
2786
  if (isSearchToolName(event.toolName)) {
@@ -2789,8 +2792,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2789
2792
  return "";
2790
2793
  }
2791
2794
  if (event.type === "tool-result") {
2792
- searchBuffer.push(event);
2793
- return "";
2795
+ return bufferToolResult(searchBuffer, event);
2794
2796
  }
2795
2797
  }
2796
2798
  if (isRunToolName(event.toolName)) {
@@ -2808,8 +2810,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2808
2810
  return "";
2809
2811
  }
2810
2812
  if (event.type === "tool-result") {
2811
- runBuffer.push(event);
2812
- return "";
2813
+ return bufferToolResult(runBuffer, event);
2813
2814
  }
2814
2815
  }
2815
2816
  if (isFetchToolName(event.toolName)) {
@@ -2821,8 +2822,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2821
2822
  return "";
2822
2823
  }
2823
2824
  if (event.type === "tool-result") {
2824
- fetchBuffer.push(event);
2825
- return "";
2825
+ return bufferToolResult(fetchBuffer, event);
2826
2826
  }
2827
2827
  }
2828
2828
  if (isWebSearchToolName(event.toolName)) {
@@ -2834,8 +2834,7 @@ function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled())
2834
2834
  return "";
2835
2835
  }
2836
2836
  if (event.type === "tool-result") {
2837
- webSearchBuffer.push(event);
2838
- return "";
2837
+ return bufferToolResult(webSearchBuffer, event);
2839
2838
  }
2840
2839
  }
2841
2840
  const flushed = flushBuffers();
@@ -2894,6 +2893,12 @@ function createSseToolEventAdapter(onEvent) {
2894
2893
  type: "tool-result",
2895
2894
  toolCallId,
2896
2895
  toolName,
2896
+ // The full payload, not just the clipped summary. Consumers that parse
2897
+ // structured results — the agent-run snapshot parser feeding the dock
2898
+ // panel, the orchestration card renderer, ask_user — all read
2899
+ // `content`; dropping it here made every one of them silently inert on
2900
+ // the HTTP/SSE path while working on the local path.
2901
+ ...rawContent ? { content: rawContent } : {},
2897
2902
  summary,
2898
2903
  metadata: payload.metadata,
2899
2904
  round
@@ -3095,10 +3100,10 @@ ${options.agentName} > `);
3095
3100
  spinner.show(activeLabel);
3096
3101
  options.activityReporter?.(activeLabel);
3097
3102
  }
3098
- if (event.type === "tool-result" && options.onAgentRunStatus && event.toolName === "startAgentRun") {
3099
- const snapshot = extractAgentRunStatusSnapshot(event);
3100
- if (snapshot) {
3101
- options.onAgentRunStatus(snapshot);
3103
+ if (options.onAgentRunStatus) {
3104
+ const parsed = parseAgentRunEvent(event);
3105
+ if (parsed) {
3106
+ options.onAgentRunStatus(parsed.snapshot);
3102
3107
  }
3103
3108
  }
3104
3109
  };
@@ -3108,6 +3113,12 @@ ${options.agentName} > `);
3108
3113
  traceLocalTools,
3109
3114
  eventMode,
3110
3115
  pushText(chunk) {
3116
+ if (eventMode !== "jsonl" && formatToolEvent.flush) {
3117
+ const pendingToolOutput = formatToolEvent.flush();
3118
+ if (pendingToolOutput) {
3119
+ options.output.write(pendingToolOutput);
3120
+ }
3121
+ }
3111
3122
  writeVisibleAssistantChunk(chunk);
3112
3123
  },
3113
3124
  pushThinking(chunk) {
@@ -3151,30 +3162,6 @@ ${options.agentName} > (no text response)
3151
3162
  }
3152
3163
  };
3153
3164
  }
3154
- function extractAgentRunStatusSnapshot(event) {
3155
- if (event.type !== "tool-result") return null;
3156
- const content = typeof event.content === "string" ? event.content.trim() : "";
3157
- if (!content.startsWith("{")) return null;
3158
- try {
3159
- const parsed = JSON.parse(content);
3160
- const runId = typeof parsed.runId === "string" ? parsed.runId : "";
3161
- const status = typeof parsed.status === "string" ? parsed.status : "running";
3162
- const agentName = typeof parsed.agentName === "string" ? parsed.agentName : typeof parsed.name === "string" ? parsed.name : void 0;
3163
- const logTail = typeof parsed.logTail === "string" ? parsed.logTail : void 0;
3164
- const logLines = Array.isArray(parsed.logLines) ? parsed.logLines : void 0;
3165
- const errorMessage = typeof parsed.errorMessage === "string" ? parsed.errorMessage : void 0;
3166
- return {
3167
- runId,
3168
- agentName,
3169
- status,
3170
- logTail,
3171
- logLines,
3172
- errorMessage
3173
- };
3174
- } catch {
3175
- return null;
3176
- }
3177
- }
3178
3165
 
3179
3166
  // packages/cli/client/agentRunStream.ts
3180
3167
  async function readStreamingAgentRun(options, res, existingSpinner) {
@@ -3557,7 +3544,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3557
3544
  // packages/cli/client/agentRun.ts
3558
3545
  import { ulid } from "ulid";
3559
3546
  async function loadRunLocalAgentTurn() {
3560
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YSYZ33ER.js");
3547
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-P4VGX6H6.js");
3561
3548
  return runLocalAgentTurn;
3562
3549
  }
3563
3550
  async function resolveCurrentMachineId(options) {
@@ -3584,7 +3571,8 @@ function buildDefaultLocalRuntimeAdapter(options) {
3584
3571
  output: options.output,
3585
3572
  ...options.confirmDestructiveAction ? { confirmDestructiveAction: options.confirmDestructiveAction } : {},
3586
3573
  ...options.requestUserChoice ? { requestUserChoice: options.requestUserChoice } : {},
3587
- ...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {}
3574
+ ...options.pastedTextStore?.items.size ? { pastedTextStore: options.pastedTextStore } : {},
3575
+ ...options.activityReporter ? { activityReporter: options.activityReporter } : {}
3588
3576
  });
3589
3577
  }
3590
3578
  function resolveLocalRuntimeAdapter(options) {
@@ -3823,6 +3811,7 @@ async function runHttpAgentTurn(options, authToken) {
3823
3811
  runtime: "bun",
3824
3812
  entrypoint: "nolo-cli",
3825
3813
  capabilities: ["text-io", "streaming", "slash-commands"],
3814
+ ...options.dialogAgentMode ? { dialogAgentMode: options.dialogAgentMode } : {},
3826
3815
  ...subjectRefs ? { subjectRefs } : {},
3827
3816
  ...allowedChildAgentKeys?.length ? { allowedChildAgentKeys } : {},
3828
3817
  ...blockedToolNames?.length ? { blockedToolNames } : {},
@@ -3834,6 +3823,7 @@ async function runHttpAgentTurn(options, authToken) {
3834
3823
  ...options.inheritedFromDialogKey ? { inheritedFromDialogKey: options.inheritedFromDialogKey } : {},
3835
3824
  ...options.parentDialogId ? { parentDialogId: options.parentDialogId } : {},
3836
3825
  ...options.background ? { background: true } : {},
3826
+ ...options.ephemeral ? { ephemeral: true } : {},
3837
3827
  ...typeof options.timeoutMs === "number" ? { timeoutMs: options.timeoutMs } : {},
3838
3828
  ...options.modelOverride ? { runtimeOptions: { quickChatModelOverride: options.modelOverride } } : {},
3839
3829
  ...serverContextBlockScopes ? { contextBlockScopes: serverContextBlockScopes } : {},
@@ -3983,8 +3973,9 @@ async function runLocalAgentTurnForCli(options, settings) {
3983
3973
  const blockedToolNames = options.blockedToolNames?.filter(
3984
3974
  (name) => name.trim()
3985
3975
  );
3986
- const runtimeContext = subjectRefs || allowedChildAgentKeys?.length || allowedToolNames?.length || blockedToolNames?.length || options.parentWakeOnTerminal ? {
3976
+ const runtimeContext = subjectRefs || allowedChildAgentKeys?.length || allowedToolNames?.length || blockedToolNames?.length || options.parentWakeOnTerminal || options.dialogAgentMode ? {
3987
3977
  ...subjectRefs ? { subjectRefs } : {},
3978
+ ...options.dialogAgentMode ? { dialogAgentMode: options.dialogAgentMode } : {},
3988
3979
  ...allowedChildAgentKeys?.length ? { allowedChildAgentKeys } : {},
3989
3980
  ...allowedToolNames?.length ? { allowedToolNames } : {},
3990
3981
  ...blockedToolNames?.length ? { blockedToolNames } : {},
@@ -3993,7 +3984,7 @@ async function runLocalAgentTurnForCli(options, settings) {
3993
3984
  } : void 0;
3994
3985
  const currentDialogId = options.continueDialogId ?? ulid();
3995
3986
  const runChildTurn = async (input) => {
3996
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-YSYZ33ER.js");
3987
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-P4VGX6H6.js");
3997
3988
  return runLocalAgentTurn(input);
3998
3989
  };
3999
3990
  const createFreshChildBaseAdapter = () => {
@@ -4195,11 +4186,6 @@ async function runAgentTurn(options) {
4195
4186
  );
4196
4187
  return { exitCode: 1 };
4197
4188
  }
4198
- if (options.ephemeral) {
4199
- options.output.write(
4200
- "[nolo] --ephemeral/--memory-only is only effective with the local runtime (--local); the server stores dialogs on its own and cannot run memory-only.\n"
4201
- );
4202
- }
4203
4189
  return runHttpAgentTurn(options, authToken);
4204
4190
  }
4205
4191
 
@@ -4770,6 +4756,7 @@ var resolveMemoryRuntime = async (input) => {
4770
4756
  userId: input.userId,
4771
4757
  spaceId: input.spaceId,
4772
4758
  agentKey: input.agentKey,
4759
+ memorySubjectId: input.memorySubjectId,
4773
4760
  policy
4774
4761
  }),
4775
4762
  kinds: ["episodic", "semantic", "procedural"],
@@ -5274,31 +5261,6 @@ ${mdContent}`);
5274
5261
  }
5275
5262
  return result.exitCode;
5276
5263
  }
5277
- var QUOTA_ERROR_PATTERNS = [
5278
- /429/,
5279
- /quota/i,
5280
- /rate\s*limit/i,
5281
- /too\s*many\s*requests/i,
5282
- /额度/,
5283
- /上限/,
5284
- /用尽/,
5285
- /CliProviderQuotaError/i
5286
- ];
5287
- function isQuotaExhaustedError(error) {
5288
- if (!error) return false;
5289
- if (error instanceof CliProviderQuotaError) return true;
5290
- if (error instanceof Error) {
5291
- return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error.message));
5292
- }
5293
- if (typeof error === "string") {
5294
- return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error));
5295
- }
5296
- const maybeStatus = error.status;
5297
- if (typeof maybeStatus === "number" && maybeStatus === 429) return true;
5298
- const maybeStatusCode = error.statusCode;
5299
- if (typeof maybeStatusCode === "number" && maybeStatusCode === 429) return true;
5300
- return false;
5301
- }
5302
5264
  var BALANCE_ERROR_PATTERNS = [
5303
5265
  /UPSTREAM_402/i,
5304
5266
  /Insufficient Balance/i,
@@ -5341,6 +5303,7 @@ export {
5341
5303
  setActiveBrightness,
5342
5304
  getActiveDensity,
5343
5305
  setActiveDensity,
5306
+ detectSystemBrightnessFromEnv,
5344
5307
  resolveTuiBrightness,
5345
5308
  setActiveTerminalBaseHex,
5346
5309
  applyDetectedBackground,
@@ -5367,6 +5330,5 @@ export {
5367
5330
  normalizeCliImageInput,
5368
5331
  inspectLocalRunWorkspace,
5369
5332
  runAgentRunCommand,
5370
- isQuotaExhaustedError,
5371
5333
  isBalanceExhaustedError
5372
5334
  };