nolo-cli 0.29.1 → 0.30.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/{_executeModel-TN7FW73L.js → _executeModel-VBHHG7LT.js} +62 -68
  2. package/{action-6BM26ZYM.js → action-FENWPT3C.js} +14 -15
  3. package/{addContentAction-HLTFX56O.js → addContentAction-Z5S5ZQ7I.js} +12 -12
  4. package/{addDialogAgentAction-Q2TYWDO6.js → addDialogAgentAction-VUNVD2XR.js} +11 -11
  5. package/{agentDeleteCommand-VP4VLCMG.js → agentDeleteCommand-LLGZXUYJ.js} +60 -39
  6. package/{agentEmailCommands-N32KWVCX.js → agentEmailCommands-LC2FPN6G.js} +76 -81
  7. package/{agentGrantCommands-JNDE4RWR.js → agentGrantCommands-E7ZZFRHK.js} +2 -1
  8. package/{agentListCommands-MXITEBUS.js → agentListCommands-A6OBQ3QX.js} +57 -40
  9. package/{agentMachineCommands-47Y2XEZZ.js → agentMachineCommands-4O4Q5B5X.js} +53 -35
  10. package/{agentPullCommand-ZZGU5KOY.js → agentPullCommand-4V36XNGV.js} +4 -3
  11. package/{agentRecordCommands-AK6ZRJLD.js → agentRecordCommands-W22RIQRV.js} +73 -78
  12. package/{agentRunCommand-24SNVDNC.js → agentRunCommand-V4OBU4FB.js} +77 -82
  13. package/{agentRunControl-SNUKXN6J.js → agentRunControl-AKBN2366.js} +13 -1
  14. package/{agentRuntimeLocal-VI3NHLDU.js → agentRuntimeLocal-I57YSGH4.js} +52 -34
  15. package/{agentSlice-D666DABC.js → agentSlice-3ZHY7RAO.js} +12 -13
  16. package/{appDeleteCommands-SF2V6QYZ.js → appDeleteCommands-DJJF466K.js} +53 -35
  17. package/{appDeployCommands-3EPVR545.js → appDeployCommands-WJZGIOEZ.js} +53 -35
  18. package/{appDeployStatusCommands-O65Y747J.js → appDeployStatusCommands-ICYXUJNO.js} +53 -35
  19. package/{appGetCommands-AHDOF4SS.js → appGetCommands-UOCWYJPV.js} +53 -35
  20. package/{appListCommands-Y7YCXODU.js → appListCommands-EOKWTXPW.js} +53 -35
  21. package/{authCommand-XMQHBK5L.js → authCommand-H5KE7K7K.js} +16 -16
  22. package/{authCommands-JSOG2H4E.js → authCommands-CXJ6PI2O.js} +7 -7
  23. package/{chunk-SNMJPH7J.js → chunk-2XM5KUNE.js} +4 -2
  24. package/{chunk-7H3UTGPM.js → chunk-3AUWC6EM.js} +82 -3
  25. package/{chunk-FVY6KI5A.js → chunk-3RIWR23B.js} +1 -1
  26. package/{chunk-ENUJPSZN.js → chunk-446VANPP.js} +18 -14
  27. package/{chunk-PB7G5MAM.js → chunk-44HACRCK.js} +4 -4
  28. package/{chunk-RZNYL4LW.js → chunk-4SAV7BD7.js} +65 -1
  29. package/{chunk-I5TJCJQP.js → chunk-56IUA7RU.js} +3 -3
  30. package/{chunk-STOUEEBU.js → chunk-66O5MZYH.js} +1 -1
  31. package/{chunk-PSK2RUHV.js → chunk-7CD24PU4.js} +360 -2
  32. package/{chunk-JYSXE6LE.js → chunk-A4JDTA5T.js} +13 -13
  33. package/{chunk-DZ3XJVET.js → chunk-AOS5IN2I.js} +1 -1
  34. package/{chunk-SKDNBYZK.js → chunk-BOL2D2JW.js} +1 -1
  35. package/{chunk-YTA2QOEE.js → chunk-CAENRKNJ.js} +15 -0
  36. package/{chunk-2TYLTEAH.js → chunk-CV6I4HBA.js} +1 -1
  37. package/chunk-DCDL3GC4.js +171 -0
  38. package/{chunk-WNENLKKI.js → chunk-DCWBP2O7.js} +42 -393
  39. package/{chunk-Y52E3TIS.js → chunk-DI6MXJK5.js} +37 -37
  40. package/{chunk-Z3LLUGD5.js → chunk-DKRT67FG.js} +11 -11
  41. package/{chunk-NWT2WUCY.js → chunk-DWQNDGO7.js} +20 -8
  42. package/{chunk-BPZSJH5X.js → chunk-FS5TTXPS.js} +6 -6
  43. package/chunk-G5JHHUAK.js +73 -0
  44. package/{chunk-GFVFYNL7.js → chunk-G6VITLCZ.js} +3 -3
  45. package/{chunk-MUI34IA2.js → chunk-GAGUBI42.js} +302 -14
  46. package/{chunk-YBHJZVWO.js → chunk-GVKTKT3O.js} +15 -8
  47. package/{chunk-GVYU3EVI.js → chunk-HI7QZNWX.js} +17 -10
  48. package/{chunk-MHHYH3JA.js → chunk-HLG6GAUD.js} +1 -1
  49. package/{chunk-MQRZ5QUH.js → chunk-IXZX5CJK.js} +1 -1
  50. package/{chunk-INWBJPQC.js → chunk-IZ3CBMD5.js} +3 -3
  51. package/{chunk-VHBWHNVT.js → chunk-K6QEHQZ3.js} +8 -4
  52. package/chunk-KW47OSRJ.js +3246 -0
  53. package/{chunk-F7S2SH5C.js → chunk-KWKD3BCC.js} +189 -122
  54. package/{chunk-L65QKSVJ.js → chunk-L3GCUVOH.js} +1 -1
  55. package/{chunk-XISENOC2.js → chunk-L3VQOVKK.js} +8 -8
  56. package/{chunk-HALKDXKP.js → chunk-MEUZFIAJ.js} +8 -4
  57. package/{chunk-XMAMUPXU.js → chunk-MMCVBEAD.js} +174 -149
  58. package/{chunk-XOIF2TNF.js → chunk-OB6FBSH3.js} +13 -0
  59. package/chunk-OYK7PA5U.js +1707 -0
  60. package/{chunk-WPRSBZYN.js → chunk-Q24P6TUS.js} +1 -1
  61. package/{chunk-7CP4UOUV.js → chunk-QLV2GKU5.js} +16 -178
  62. package/{chunk-2AX4ZWSG.js → chunk-SWOTB2TX.js} +135 -1166
  63. package/{chunk-BOPFLKHA.js → chunk-SWYMCHM7.js} +1 -69
  64. package/{chunk-YRMUYZ5H.js → chunk-SZ5CBYMZ.js} +4 -4
  65. package/chunk-T27IEBNQ.js +149 -0
  66. package/{chunk-WX3ZOSTL.js → chunk-T3Y5EMJS.js} +24 -26
  67. package/{chunk-RD6AOXQI.js → chunk-THTAR67C.js} +1056 -137
  68. package/{chunk-2FX23RGA.js → chunk-TJYWZ3LO.js} +4 -4
  69. package/{chunk-SLOGKB7M.js → chunk-TOW4E763.js} +9 -1
  70. package/{chunk-33K2M3AU.js → chunk-UKC5HU2C.js} +33 -40
  71. package/{chunk-STRCGEC6.js → chunk-UTQZ73QQ.js} +13 -9
  72. package/{chunk-GT3GG2H7.js → chunk-VSTUQGLT.js} +1 -1
  73. package/{chunk-4MCHUZUI.js → chunk-W2YKDXT7.js} +95 -95
  74. package/{chunk-L3QFIBZG.js → chunk-WTGCTVJG.js} +1 -1
  75. package/{chunk-XS7UPVR7.js → chunk-XD5NQEOH.js} +5 -5
  76. package/{chunk-WSQLK2KR.js → chunk-XFGM5PJP.js} +6 -6
  77. package/{chunk-DBUNOYLF.js → chunk-YLADSPDU.js} +3 -3
  78. package/{chunk-FRN5QOKN.js → chunk-YWGSCF37.js} +19 -4
  79. package/{codingSkills-EN6Z6G6U.js → codingSkills-V35TRR4Y.js} +1 -2
  80. package/{createAgentAutomationAction-VK3N263U.js → createAgentAutomationAction-3GMH6ORX.js} +30 -37
  81. package/{createDialogAction-KWZ74S2G.js → createDialogAction-R5MCL4RE.js} +32 -38
  82. package/{createPageAction-3CIZL5ZL.js → createPageAction-QYTG656R.js} +43 -50
  83. package/{db-W5UHK4P3.js → db-IPCJ43PW.js} +10 -6
  84. package/{dbSlice-GOKRGQ47.js → dbSlice-OBV7VFCF.js} +11 -11
  85. package/{deleteFile-WDZ3VM7B.js → deleteFile-AC45HYSM.js} +5 -5
  86. package/{dialogCommands-N4XKI6ZU.js → dialogCommands-NUQGIXVZ.js} +53 -37
  87. package/{dialogSlice-TKYB6VLO.js → dialogSlice-CFDECXEU.js} +27 -34
  88. package/{docCreateCommands-DTDKANXX.js → docCreateCommands-UNFCXB5N.js} +52 -36
  89. package/{docDeleteCommands-U4NB6OHK.js → docDeleteCommands-NG5IVKE5.js} +54 -38
  90. package/{docReadCommands-SDVQM3BH.js → docReadCommands-6J7MUUX6.js} +52 -36
  91. package/{docStore-E5QAM75M.js → docStore-MZZWJM4F.js} +28 -35
  92. package/{docUpdateCommands-O2O644FV.js → docUpdateCommands-6AW3VZOX.js} +55 -39
  93. package/{fetchMessages-W4IKHPCS.js → fetchMessages-VPPQDDZ4.js} +3 -3
  94. package/{getPricing-X6I23RN6.js → getPricing-XQYSSVV6.js} +6 -7
  95. package/{handleSendMessageAction-7OVC2SVU.js → handleSendMessageAction-IU2QNTLM.js} +30 -37
  96. package/index.js +72 -72
  97. package/localDialogRead-P72W2U2R.js +38 -0
  98. package/{machineCommands-6GNFKAVC.js → machineCommands-Z2QEWTHZ.js} +76 -81
  99. package/{machineWsRunDispatch-2DCHVG3U.js → machineWsRunDispatch-SJTYHZHN.js} +71 -76
  100. package/{models-YT32CTT5.js → models-WDUTTYFS.js} +2 -2
  101. package/{offlineMarxistsAgentCommand-5OOWZLJI.js → offlineMarxistsAgentCommand-E6LUG63A.js} +6 -2
  102. package/package.json +1 -1
  103. package/{read-A23NKT3O.js → read-QK7ZRX6G.js} +6 -6
  104. package/{readDocTool-JAM5BI5Q.js → readDocTool-EYDMVRBL.js} +2 -1
  105. package/{readlineWorkspace-KELDMUNZ.js → readlineWorkspace-EY3BPXIU.js} +151 -163
  106. package/{removeDialogAgentAction-K4HOWFHO.js → removeDialogAgentAction-TBW3UZJW.js} +15 -16
  107. package/{runAgentClientLoop-R3S7YN6Z.js → runAgentClientLoop-N3YDLTMS.js} +61 -66
  108. package/{setDialogExtraReferencesAction-JD7J7JM4.js → setDialogExtraReferencesAction-Q3ANF2NR.js} +12 -12
  109. package/{setPrimaryDialogAgentAction-YWSA5XEU.js → setPrimaryDialogAgentAction-FQ5R3EFJ.js} +15 -16
  110. package/{settingSlice-22GTX6CA.js → settingSlice-JKKV2T7O.js} +13 -14
  111. package/{skillDiscovery-ITA7BI7A.js → skillDiscovery-I3QRA7NE.js} +2 -2
  112. package/{spaceCommands-WM6W3WMQ.js → spaceCommands-R6AEQNLG.js} +57 -40
  113. package/{spaceSlice-RC2APBOD.js → spaceSlice-MCH7RLLP.js} +27 -34
  114. package/{streamAgentChatTurn-Q655CCVP.js → streamAgentChatTurn-Q4U2CVMI.js} +130 -1300
  115. package/{switchDialogAgentAction-6JKFBJVR.js → switchDialogAgentAction-QQGVE4SL.js} +11 -11
  116. package/{toolApiClient-ISM4ZQX4.js → toolApiClient-ARGFDJAG.js} +3 -3
  117. package/{tools-A6MUIA3Q.js → tools-Y3UBLLYW.js} +50 -56
  118. package/{tuiSummaryLlmCaller-GCUPULOV.js → tuiSummaryLlmCaller-4474IBTI.js} +12 -12
  119. package/{updateDialogTitleAction-DQYY564Y.js → updateDialogTitleAction-3J7GH67I.js} +35 -43
  120. package/chunk-3LJ4RSSF.js +0 -231
  121. package/chunk-5CS33IBL.js +0 -301
  122. package/chunk-5MMAK75Q.js +0 -15
  123. package/chunk-MRC4Q34M.js +0 -188
  124. package/chunk-P6TB7JIA.js +0 -1791
  125. package/chunk-PFTK5SEB.js +0 -620
  126. package/chunk-PMSG3OGF.js +0 -669
  127. package/chunk-SIZQB7BD.js +0 -91
  128. package/chunk-VIDPVFP3.js +0 -20
  129. package/chunk-Y5GCAMGP.js +0 -9
  130. package/chunk-YYLHWIW6.js +0 -48
  131. package/chunk-ZZ2MH7LE.js +0 -84
  132. package/localDialogRead-JXTAHW2E.js +0 -26
  133. package/{chunk-ZVZMT3EA.js → chunk-KWCLUYGQ.js} +3 -3
  134. package/{chunk-NRY4GCKJ.js → chunk-WHLVPK32.js} +3 -3
  135. package/{chunk-RQSOAMPJ.js → chunk-Z5MXSEOJ.js} +2 -2
  136. package/{chunk-XMLRJUU5.js → chunk-ZFTCLBEX.js} +9 -9
  137. package/{runtimeDoctorCommands-HSU632DY.js → runtimeDoctorCommands-E2OUORHK.js} +3 -3
  138. package/{tableCommands-QSZILI7I.js → tableCommands-PRJNWN6Q.js} +6 -6
@@ -6,7 +6,7 @@ import {
6
6
  resolveRawAgentInput,
7
7
  resolveServerUrl,
8
8
  writeUsage
9
- } from "./chunk-DZ3XJVET.js";
9
+ } from "./chunk-AOS5IN2I.js";
10
10
  import {
11
11
  resolveMachineId
12
12
  } from "./chunk-6HYVJV7B.js";
@@ -19,7 +19,18 @@ import {
19
19
  parseAgentRunEvent,
20
20
  t,
21
21
  toolLabel
22
- } from "./chunk-XMAMUPXU.js";
22
+ } from "./chunk-MMCVBEAD.js";
23
+ import {
24
+ createRunActivityTracker,
25
+ finalizeRunRecord,
26
+ spawnLocalBackgroundRun
27
+ } from "./chunk-4SAV7BD7.js";
28
+ import {
29
+ CliProviderQuotaError
30
+ } from "./chunk-JDSUTNYY.js";
31
+ import {
32
+ getDefaultCliLocalRuntimeDb
33
+ } from "./chunk-WJRJDX2W.js";
23
34
  import {
24
35
  getReadableCliDb
25
36
  } from "./chunk-WFHXMLHZ.js";
@@ -27,42 +38,18 @@ import {
27
38
  normalizeAgentHandle,
28
39
  readDbRecord,
29
40
  resolveAgentRecordFromHybridStore
30
- } from "./chunk-I5TJCJQP.js";
41
+ } from "./chunk-56IUA7RU.js";
31
42
  import {
32
43
  NOLO_PROJECT_MANAGER_AGENT_KEY,
33
44
  isLocalCliAgentKey
34
- } from "./chunk-VHBWHNVT.js";
45
+ } from "./chunk-K6QEHQZ3.js";
46
+ import {
47
+ buildSkillDiscoveryContextLayer
48
+ } from "./chunk-KWCLUYGQ.js";
35
49
  import {
36
50
  applyModelLayerOverride,
37
51
  buildModelLayerOverride
38
52
  } from "./chunk-LTRXGFMS.js";
39
- import {
40
- formatAgentListCard
41
- } from "./chunk-2AX4ZWSG.js";
42
- import {
43
- isGatewayHttpStatus
44
- } from "./chunk-RQSOAMPJ.js";
45
- import {
46
- getDefaultCliLocalRuntimeDb
47
- } from "./chunk-WJRJDX2W.js";
48
- import {
49
- buildMemorySubjectsForAgent,
50
- chooseMemoryOwners,
51
- loadMemoryCandidatesFromDb,
52
- resolveAgentMemoryPolicy
53
- } from "./chunk-7CP4UOUV.js";
54
- import {
55
- API_REPORTED_COST_MULTIPLIER,
56
- normalizeUsage,
57
- parseUiAskChoiceContent
58
- } from "./chunk-RD6AOXQI.js";
59
- import {
60
- buildSkillDiscoveryContextLayer
61
- } from "./chunk-ZVZMT3EA.js";
62
- import {
63
- parseExternalSkillMarkdown,
64
- parseSkillDocProtocol
65
- } from "./chunk-ZWJOGMKH.js";
66
53
  import {
67
54
  resolveAgentRuntimeConfigFromRecord
68
55
  } from "./chunk-OIQPORYI.js";
@@ -71,25 +58,12 @@ import {
71
58
  LOCAL_TURN_ABORTED_CODE,
72
59
  readActionGate,
73
60
  readCommandActionGatePayload
74
- } from "./chunk-P6TB7JIA.js";
61
+ } from "./chunk-KW47OSRJ.js";
75
62
  import {
76
63
  createThinkParserState,
77
64
  flushThinkParser,
78
65
  processThinkChunk
79
66
  } from "./chunk-N7J63Q6C.js";
80
- import {
81
- resolvePlatformAuthToken
82
- } from "./chunk-XS7UPVR7.js";
83
- import {
84
- DEFAULT_CONTEXT_WINDOW,
85
- getModelContextWindow
86
- } from "./chunk-PMSG3OGF.js";
87
- import {
88
- clipCompactText
89
- } from "./chunk-5MMAK75Q.js";
90
- import {
91
- findModelConfig
92
- } from "./chunk-GT3GG2H7.js";
93
67
  import {
94
68
  buildAgentsMdLayer,
95
69
  buildMemoryOverlayLayer,
@@ -98,13 +72,14 @@ import {
98
72
  renderTurnContextBlocksWithScope
99
73
  } from "./chunk-PJY5AH5A.js";
100
74
  import {
101
- compactWhitespace
102
- } from "./chunk-DWLEOOGR.js";
75
+ resolvePlatformAuthToken
76
+ } from "./chunk-XD5NQEOH.js";
103
77
  import {
104
- createRunActivityTracker,
105
- finalizeRunRecord,
106
- spawnLocalBackgroundRun
107
- } from "./chunk-RZNYL4LW.js";
78
+ formatAgentListCard
79
+ } from "./chunk-SWOTB2TX.js";
80
+ import {
81
+ isGatewayHttpStatus
82
+ } from "./chunk-Z5MXSEOJ.js";
108
83
  import {
109
84
  formatFinishedRunCard,
110
85
  formatListRunsCard,
@@ -116,11 +91,30 @@ import {
116
91
  runShowsLogTail
117
92
  } from "./chunk-KXKQO4Q6.js";
118
93
  import {
119
- CliProviderQuotaError
120
- } from "./chunk-JDSUTNYY.js";
94
+ buildMemorySubjectsForAgent,
95
+ chooseMemoryOwners,
96
+ loadMemoryCandidatesFromDb,
97
+ resolveAgentMemoryPolicy
98
+ } from "./chunk-QLV2GKU5.js";
99
+ import {
100
+ API_REPORTED_COST_MULTIPLIER,
101
+ DEFAULT_CONTEXT_WINDOW,
102
+ getModelContextWindow,
103
+ normalizeUsage,
104
+ parseUiAskChoiceContent
105
+ } from "./chunk-THTAR67C.js";
106
+ import {
107
+ clipCompactText
108
+ } from "./chunk-OB6FBSH3.js";
121
109
  import {
122
110
  toErrorMessage
123
111
  } from "./chunk-HNMXYYJR.js";
112
+ import {
113
+ compactWhitespace
114
+ } from "./chunk-DWLEOOGR.js";
115
+ import {
116
+ findModelConfig
117
+ } from "./chunk-VSTUQGLT.js";
124
118
  import {
125
119
  readPipeText,
126
120
  spawnProcess
@@ -130,24 +124,27 @@ import {
130
124
  } from "./chunk-A7GB5UGH.js";
131
125
  import {
132
126
  parsePositiveFiniteNumberOrFallback
133
- } from "./chunk-Y5GCAMGP.js";
134
- import {
135
- createMemoryKey
136
- } from "./chunk-NRY4GCKJ.js";
127
+ } from "./chunk-446VANPP.js";
137
128
  import {
138
129
  asTrimmedLowercaseString
139
130
  } from "./chunk-QSJ3HFEF.js";
140
131
  import {
141
132
  BUILTIN_NOLO_AGENT_KEY,
142
- PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
143
- PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
144
- } from "./chunk-NWT2WUCY.js";
133
+ PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY
134
+ } from "./chunk-DWQNDGO7.js";
135
+ import {
136
+ isLoopbackUrl
137
+ } from "./chunk-4SN6J65J.js";
138
+ import {
139
+ createMemoryKey
140
+ } from "./chunk-WHLVPK32.js";
145
141
  import {
146
142
  asTrimmedString
147
143
  } from "./chunk-3EUW3WEO.js";
148
144
  import {
149
- isLoopbackUrl
150
- } from "./chunk-4SN6J65J.js";
145
+ parseExternalSkillMarkdown,
146
+ parseSkillDocProtocol
147
+ } from "./chunk-ZWJOGMKH.js";
151
148
  import {
152
149
  asOptionalTrimmedString
153
150
  } from "./chunk-G3SUCT4W.js";
@@ -163,11 +160,6 @@ var CLI_AUTO_TIER_MODELS = {
163
160
  balanced: "deepseek-v4-flash",
164
161
  quality: "deepseek-v4-flash"
165
162
  };
166
- var CLI_IMAGE_AGENT_KEY = PUBLIC_KIMI_K26_IMAGE_AGENT_KEY;
167
- var CLI_IMAGE_AGENT_MODEL = "kimi-k2.6";
168
- var CLI_AUTO_TIER_AGENT_KEY_TABLE = {
169
- [CLI_AUTO_TIER_AGENT_KEYS.flash]: true
170
- };
171
163
  function resolveCliAutoAgentModel(agentKey) {
172
164
  if (agentKey === CLI_AUTO_TIER_AGENT_KEYS.flash) return CLI_AUTO_TIER_MODELS.flash;
173
165
  if (agentKey === CLI_AUTO_TIER_AGENT_KEYS.balanced) {
@@ -176,13 +168,9 @@ function resolveCliAutoAgentModel(agentKey) {
176
168
  if (agentKey === CLI_AUTO_TIER_AGENT_KEYS.quality) {
177
169
  return CLI_AUTO_TIER_MODELS.quality;
178
170
  }
179
- if (agentKey === CLI_IMAGE_AGENT_KEY) return CLI_IMAGE_AGENT_MODEL;
180
171
  return void 0;
181
172
  }
182
173
  function classifyCliAutoRoute(_text, options) {
183
- if (options.hasImages) {
184
- return { agentKey: CLI_IMAGE_AGENT_KEY, tier: "image", classified: true };
185
- }
186
174
  return {
187
175
  agentKey: CLI_AUTO_TIER_AGENT_KEYS.flash,
188
176
  tier: "flash",
@@ -948,19 +936,19 @@ function renderSurfaceLine(args) {
948
936
  return `${surface}${reopened}${padding}\x1B[0m`;
949
937
  }
950
938
  function renderDiffLine(args) {
951
- const { kind, text } = args;
939
+ const { kind, text, highlightedText } = args;
952
940
  const env = args.env ?? process.env;
953
941
  const colorEnabled = args.colorEnabled ?? resolveCliColorEnabled();
954
942
  if (!colorEnabled) return text;
955
943
  const seqs = diffLineSequences(env);
956
944
  if (!seqs) {
957
- if (kind === "context") return text;
945
+ if (kind === "context") return highlightedText ?? text;
958
946
  const token = kind === "added" ? "success" : kind === "removed" ? "danger" : "info";
959
- return `${themeColorSequence(token, env)}${text}\x1B[39m`;
947
+ return `${themeColorSequence(token, env)}${highlightedText ?? text}\x1B[39m`;
960
948
  }
961
949
  const seq = seqs[kind];
962
950
  return renderSurfaceLine({
963
- text: `${seq.fg}${text}`,
951
+ text: highlightedText ?? `${seq.fg}${text}`,
964
952
  surface: seq.bg,
965
953
  padTo: args.padTo ?? visibleWidth(text)
966
954
  });
@@ -1027,11 +1015,13 @@ function readFenceLanguage(line) {
1027
1015
  return m ? (m[1] ?? "").toLowerCase() : "";
1028
1016
  }
1029
1017
  function normalizeCodeLang(raw) {
1030
- switch (raw) {
1018
+ switch (raw.toLowerCase()) {
1031
1019
  case "js":
1032
1020
  case "jsx":
1033
1021
  case "ts":
1034
1022
  case "tsx":
1023
+ case "mjs":
1024
+ case "cjs":
1035
1025
  case "javascript":
1036
1026
  case "typescript":
1037
1027
  return "js";
@@ -1162,6 +1152,11 @@ function scanStringCommentRegions(line, lang) {
1162
1152
  }
1163
1153
  return regions;
1164
1154
  }
1155
+ function detectCodeLangFromPath(filePath) {
1156
+ if (!filePath) return "unknown";
1157
+ const ext = filePath.split(".").pop() ?? "";
1158
+ return normalizeCodeLang(ext);
1159
+ }
1165
1160
  function highlightCodeLine(line, lang, brightness) {
1166
1161
  const info = colorSeq("info", brightness);
1167
1162
  if (lang === "unknown") {
@@ -1943,8 +1938,20 @@ function compactResultHint(event) {
1943
1938
  if (range) return { inline: range };
1944
1939
  }
1945
1940
  if (event.toolName === "editFile" && event.metadata) {
1946
- const detail = formatEditFileSnippet(event.metadata);
1947
- if (detail) return { inline: "", detail };
1941
+ const res = formatEditFileSnippet(event.metadata);
1942
+ if (res) {
1943
+ const stats = [];
1944
+ if (res.addedCount > 0) stats.push(`+${res.addedCount}`);
1945
+ if (res.removedCount > 0) stats.push(`-${res.removedCount}`);
1946
+ const inline = stats.length > 0 ? `(${stats.join(", ")})` : "";
1947
+ return { inline, detail: res.lines };
1948
+ }
1949
+ }
1950
+ if (event.toolName === "writeFile" && event.metadata) {
1951
+ const totalLines = event.metadata.totalLines ?? event.metadata.lines;
1952
+ if (typeof totalLines === "number" && totalLines > 0) {
1953
+ return { inline: `(+${totalLines})` };
1954
+ }
1948
1955
  }
1949
1956
  const summary = event.summary;
1950
1957
  if (!summary) return { inline: "" };
@@ -1963,39 +1970,63 @@ function readReadFileRange(metadata) {
1963
1970
  if (!truncated && startLine === 1 && endLine === totalLines) return void 0;
1964
1971
  return `${startLine}-${endLine}/${totalLines}`;
1965
1972
  }
1966
- var EDIT_SNIPPET_MAX_LINES = 10;
1967
- var EDIT_SNIPPET_MAX_WIDTH = 96;
1973
+ var EDIT_SNIPPET_MAX_LINES = 24;
1974
+ var DEFAULT_EDIT_SNIPPET_MAX_WIDTH = 96;
1975
+ function resolveEditSnippetMaxWidth(env = process.env, columns) {
1976
+ if (env.NOLO_TEST_DIFF_WIDTH) {
1977
+ const parsed = parseInt(env.NOLO_TEST_DIFF_WIDTH, 10);
1978
+ if (!Number.isNaN(parsed) && parsed > 0) return parsed;
1979
+ }
1980
+ const cols = typeof columns === "number" ? columns : typeof process !== "undefined" && typeof process.stdout?.columns === "number" ? process.stdout.columns : 0;
1981
+ if (cols > 0) {
1982
+ return Math.max(80, Math.min(160, cols - 8));
1983
+ }
1984
+ return DEFAULT_EDIT_SNIPPET_MAX_WIDTH;
1985
+ }
1968
1986
  function formatEditFileSnippet(metadata) {
1969
1987
  const oldSnippet = typeof metadata.oldSnippet === "string" ? metadata.oldSnippet : void 0;
1970
1988
  const newSnippet = typeof metadata.newSnippet === "string" ? metadata.newSnippet : void 0;
1971
1989
  if (!oldSnippet && !newSnippet) return void 0;
1990
+ const maxWidth = resolveEditSnippetMaxWidth();
1972
1991
  if (oldSnippet && !newSnippet) {
1973
- return snippetLinesWithKind(oldSnippet, "removed");
1992
+ const lines = snippetLinesWithKind(oldSnippet, "removed", maxWidth);
1993
+ return { lines, addedCount: 0, removedCount: lines.length };
1974
1994
  }
1975
1995
  if (newSnippet && !oldSnippet) {
1976
- return snippetLinesWithKind(newSnippet, "added");
1996
+ const lines = snippetLinesWithKind(newSnippet, "added", maxWidth);
1997
+ return { lines, addedCount: lines.length, removedCount: 0 };
1977
1998
  }
1978
1999
  const parts = diffLines(oldSnippet, newSnippet);
1979
2000
  const all = [];
2001
+ let addedCount = 0;
2002
+ let removedCount = 0;
1980
2003
  for (const part of parts) {
1981
2004
  const kind = part.added ? "added" : part.removed ? "removed" : "context";
1982
2005
  const raw = part.value.split("\n");
1983
2006
  if (raw.length > 0 && raw[raw.length - 1] === "") raw.pop();
1984
- for (const line of raw) all.push(buildEditLine(kind, line));
2007
+ for (const line of raw) {
2008
+ if (kind === "added") addedCount++;
2009
+ if (kind === "removed") removedCount++;
2010
+ all.push(buildEditLine(kind, line, maxWidth));
2011
+ }
1985
2012
  }
1986
2013
  const changeCount = all.filter((l) => l.kind !== "context").length;
1987
2014
  if (changeCount === 0) return void 0;
1988
- return windowAndTruncate(all, EDIT_SNIPPET_MAX_LINES);
2015
+ return {
2016
+ lines: windowAndTruncate(all, EDIT_SNIPPET_MAX_LINES),
2017
+ addedCount,
2018
+ removedCount
2019
+ };
1989
2020
  }
1990
2021
  function prefixFor(kind) {
1991
2022
  return kind === "added" ? "+ " : kind === "removed" ? "- " : " ";
1992
2023
  }
1993
- function buildEditLine(kind, body) {
1994
- return { kind, text: prefixFor(kind) + truncateByDisplayWidth(body, EDIT_SNIPPET_MAX_WIDTH) };
2024
+ function buildEditLine(kind, body, maxWidth = resolveEditSnippetMaxWidth()) {
2025
+ return { kind, text: prefixFor(kind) + truncateByDisplayWidth(body, maxWidth) };
1995
2026
  }
1996
- function snippetLinesWithKind(snippet, kind) {
2027
+ function snippetLinesWithKind(snippet, kind, maxWidth = resolveEditSnippetMaxWidth()) {
1997
2028
  const lines = snippet.split(/\r?\n/).filter((line) => line.length > 0);
1998
- return lines.slice(0, EDIT_SNIPPET_MAX_LINES).map((line) => buildEditLine(kind, line));
2029
+ return lines.slice(0, EDIT_SNIPPET_MAX_LINES).map((line) => buildEditLine(kind, line, maxWidth));
1999
2030
  }
2000
2031
  function truncateByDisplayWidth(line, maxWidth) {
2001
2032
  if (displayWidth(line) <= maxWidth) return line;
@@ -2561,17 +2592,41 @@ function formatCompactToolLine(event, pending, colorEnabled) {
2561
2592
  `;
2562
2593
  }
2563
2594
  if (!hint.detail?.length) return mainLine;
2564
- return `${mainLine}${formatEditDetailBlock(hint.detail, colorEnabled)}`;
2595
+ const filePath = typeof event.metadata?.path === "string" ? event.metadata.path : event.argumentsPreview;
2596
+ return `${mainLine}${formatEditDetailBlock(hint.detail, colorEnabled, filePath)}`;
2565
2597
  }
2566
- function formatEditDetailBlock(lines, colorEnabled) {
2598
+ function formatEditDetailBlock(lines, colorEnabled, filePath, env = process.env) {
2567
2599
  if (!colorEnabled) {
2568
2600
  return lines.map((line) => ` ${line.text}
2569
2601
  `).join("");
2570
2602
  }
2603
+ const isTruecolor = supportsTruecolor(env);
2604
+ const lang = isTruecolor ? detectCodeLangFromPath(filePath) : "unknown";
2605
+ const brightness = resolveTuiBrightness(env);
2571
2606
  const padTo = Math.max(...lines.map((line) => displayWidth(line.text))) + 1;
2572
- return lines.map((line) => ` ${renderDiffLine({ kind: line.kind, text: line.text, padTo, colorEnabled: true })}
2607
+ return lines.map((line) => ` ${renderDiffLine({
2608
+ kind: line.kind,
2609
+ text: line.text,
2610
+ highlightedText: shouldHighlightEditLine(line, lang, isTruecolor) ? buildHighlightedEditLine(line, lang, brightness, env) : void 0,
2611
+ padTo,
2612
+ colorEnabled: true,
2613
+ env
2614
+ })}
2573
2615
  `).join("");
2574
2616
  }
2617
+ function shouldHighlightEditLine(line, lang, isTruecolor) {
2618
+ if (!isTruecolor || lang === "unknown") return false;
2619
+ if (line.text.startsWith(" \u2026") || line.text.startsWith("\u2026")) return false;
2620
+ return line.text.length >= 2;
2621
+ }
2622
+ function buildHighlightedEditLine(line, lang, brightness, env) {
2623
+ const prefix = line.text.slice(0, 2);
2624
+ const body = line.text.slice(2);
2625
+ const prefixToken = line.kind === "added" ? "success" : line.kind === "removed" ? "danger" : "chrome";
2626
+ const coloredPrefix = themeText(prefix, prefixToken, true, env);
2627
+ const highlightedBody = highlightCodeLine(body, lang, brightness);
2628
+ return `${coloredPrefix}${highlightedBody}`;
2629
+ }
2575
2630
  function createToolEventFormatter(mode, colorEnabled = resolveCliColorEnabled(), opts = {}) {
2576
2631
  const suppressRunProgressCards = opts.suppressRunProgressCards === true;
2577
2632
  const pending = /* @__PURE__ */ new Map();
@@ -3483,7 +3538,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3483
3538
  // packages/cli/client/agentRun.ts
3484
3539
  import { ulid } from "ulid";
3485
3540
  async function loadRunLocalAgentTurn() {
3486
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-VI3NHLDU.js");
3541
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-I57YSGH4.js");
3487
3542
  return runLocalAgentTurn;
3488
3543
  }
3489
3544
  async function resolveCurrentMachineId(options) {
@@ -3672,44 +3727,58 @@ function classifyLocalRunError(message) {
3672
3727
  return { kind: "upstream", transport, status };
3673
3728
  }
3674
3729
  var HISTORY_REPLAY_REJECTION_RE = /invalid_request_error|invalid\s+tool\s+call\s+arguments?/i;
3730
+ var RUN_UNAVAILABLE_PREFIX = "[nolo] auto runtime: local run unavailable";
3731
+ var NO_FALLBACK = "Not falling back to server.";
3732
+ var SERVER_FALLBACK_HINT = "or use --server to run on the server explicitly.";
3733
+ function buildAuthFailure(ctx) {
3734
+ const fix = ctx.where === "server chat proxy" ? `Check the agent's provider/api-key settings on nolo.chat` : `Fix the local credential/config and retry`;
3735
+ return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}, auth rejected). Detail: ${ctx.message} ${NO_FALLBACK} ${fix}, ${SERVER_FALLBACK_HINT}.
3736
+ `;
3737
+ }
3738
+ function buildRejectedPayloadFailure(ctx) {
3739
+ const looksLikeHistoryReplay = HISTORY_REPLAY_REJECTION_RE.test(ctx.message);
3740
+ const cause = looksLikeHistoryReplay ? ` This usually happens when the dialog history contains tool_calls or reasoning produced by a different model/provider (e.g. after /switch); the new provider rejects that history. Start a fresh dialog, or clean the offending history.` : "";
3741
+ return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}, the provider rejected the request body \u2014 this is NOT a local credential/config issue). Detail: ${ctx.message}${cause} ${NO_FALLBACK} Use --server to run on the server explicitly, or start a fresh dialog.
3742
+ `;
3743
+ }
3744
+ function buildRateLimitFailure(ctx) {
3745
+ return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}, rate limited). Detail: ${ctx.message} ${NO_FALLBACK} Retry shortly, ${SERVER_FALLBACK_HINT}.
3746
+ `;
3747
+ }
3748
+ function buildTransientFailure(ctx) {
3749
+ return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}; this is an upstream/gateway issue, not your local credential or config). Detail: ${ctx.message} ${NO_FALLBACK} Retry shortly, ${SERVER_FALLBACK_HINT}.
3750
+ `;
3751
+ }
3752
+ function buildUpstreamFailure(ctx) {
3753
+ const fix = ctx.where === "server chat proxy" ? `Check the agent's provider/api-key settings on nolo.chat` : `Check the agent's endpoint/model settings`;
3754
+ return `${RUN_UNAVAILABLE_PREFIX} (${ctx.where} returned HTTP ${ctx.status}). Detail: ${ctx.message} ${NO_FALLBACK} ${fix}, ${SERVER_FALLBACK_HINT}.
3755
+ `;
3756
+ }
3757
+ var FAILURE_BUILDERS = {
3758
+ auth: buildAuthFailure,
3759
+ "rejected-payload": buildRejectedPayloadFailure,
3760
+ "rate-limit": buildRateLimitFailure,
3761
+ transient: buildTransientFailure,
3762
+ upstream: buildUpstreamFailure
3763
+ };
3675
3764
  function describeLocalRunFailure(message) {
3676
3765
  if (/UPSTREAM_402|Insufficient Balance|余额不足|insufficient\s+balance/i.test(
3677
3766
  message
3678
3767
  )) {
3679
- return `[nolo] auto runtime: local run unavailable (${message}). Not falling back to server. Top up your balance, then send again (or say "\u7EE7\u7EED") \u2014 if a dialog was kept, context is preserved.
3768
+ return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} Top up your balance, then send again (or say "\u7EE7\u7EED") \u2014 if a dialog was kept, context is preserved.
3680
3769
  `;
3681
3770
  }
3682
3771
  const cls = classifyLocalRunError(message);
3683
3772
  if (cls.kind === "generic") {
3684
- return `[nolo] auto runtime: local run unavailable (${message}). Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
3685
- `;
3686
- }
3687
- const where = cls.transport === "platform" ? "server chat proxy" : "local provider";
3688
- const detail = message ? ` Detail: ${message}` : "";
3689
- switch (cls.kind) {
3690
- case "auth":
3691
- return cls.transport === "platform" ? `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, auth rejected).${detail} Not falling back to server. Check the agent's provider/api-key settings on nolo.chat, or use --server to run on the server explicitly.
3692
- ` : `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, auth rejected).${detail} Not falling back to server. Fix the local credential/config and retry, or use --server to run on the server explicitly.
3773
+ return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} Fix the local credential/config and retry, ${SERVER_FALLBACK_HINT}.
3693
3774
  `;
3694
- case "rejected-payload": {
3695
- const looksLikeHistoryReplay = HISTORY_REPLAY_REJECTION_RE.test(message);
3696
- const cause = looksLikeHistoryReplay ? ` This usually happens when the dialog history contains tool_calls or reasoning produced by a different model/provider (e.g. after /switch); the new provider rejects that history. Start a fresh dialog, or clean the offending history.` : "";
3697
- return `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, the provider rejected the request body \u2014 this is NOT a local credential/config issue).${detail}${cause} Not falling back to server. Use --server to run on the server explicitly, or start a fresh dialog.
3698
- `;
3699
- }
3700
- case "rate-limit":
3701
- return `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}, rate limited).${detail} Not falling back to server. Retry shortly, or use --server to run on the server explicitly.
3702
- `;
3703
- case "transient":
3704
- return `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}; this is an upstream/gateway issue, not your local credential or config).${detail} Not falling back to server. Retry shortly, or use --server to run on the server explicitly.
3705
- `;
3706
- case "upstream":
3707
- default: {
3708
- return cls.transport === "platform" ? `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}).${detail} Not falling back to server. Check the agent's provider/api-key settings on nolo.chat, or use --server to run on the server explicitly.
3709
- ` : `[nolo] auto runtime: local run unavailable (${where} returned HTTP ${cls.status}).${detail} Not falling back to server. Check the agent's endpoint/model settings, or use --server to run on the server explicitly.
3710
- `;
3711
- }
3712
3775
  }
3776
+ const ctx = {
3777
+ message,
3778
+ where: cls.transport === "platform" ? "server chat proxy" : "local provider",
3779
+ status: cls.status
3780
+ };
3781
+ return FAILURE_BUILDERS[cls.kind](ctx);
3713
3782
  }
3714
3783
  function shouldAttemptAutoLocal(options) {
3715
3784
  if (options.localRuntimeAdapter || options.localRuntimeAdapterFactory)
@@ -5238,8 +5307,6 @@ function isBalanceExhaustedError(error) {
5238
5307
  }
5239
5308
 
5240
5309
  export {
5241
- CLI_IMAGE_AGENT_KEY,
5242
- CLI_AUTO_TIER_AGENT_KEY_TABLE,
5243
5310
  classifyCliAutoRoute,
5244
5311
  resolveAgentContextWindow,
5245
5312
  formatTokenCount,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dialogMessageRange
3
- } from "./chunk-NRY4GCKJ.js";
3
+ } from "./chunk-WHLVPK32.js";
4
4
  import {
5
5
  isTombstoneRecord
6
6
  } from "./chunk-GBRG75BQ.js";
@@ -7,11 +7,11 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-MHHYH3JA.js";
10
+ } from "./chunk-HLG6GAUD.js";
11
11
  import {
12
12
  buildDialogAttachmentPlan,
13
13
  extractFileContentIds
14
- } from "./chunk-SIZQB7BD.js";
14
+ } from "./chunk-THTAR67C.js";
15
15
  import {
16
16
  toErrorMessage
17
17
  } from "./chunk-HNMXYYJR.js";
@@ -25,20 +25,20 @@ import {
25
25
  } from "./chunk-A7GB5UGH.js";
26
26
  import {
27
27
  parsePositiveFiniteNumberOrFallback
28
- } from "./chunk-Y5GCAMGP.js";
28
+ } from "./chunk-446VANPP.js";
29
29
  import {
30
30
  asRecordOrEmpty
31
31
  } from "./chunk-KX6YBIHG.js";
32
- import {
33
- asNonEmptyStringArray,
34
- asTrimmedNonEmptyStringArray
35
- } from "./chunk-I42VC5KR.js";
36
32
  import {
37
33
  asTrimmedString
38
34
  } from "./chunk-3EUW3WEO.js";
39
35
  import {
40
36
  isRecord
41
37
  } from "./chunk-KUG52IAP.js";
38
+ import {
39
+ asNonEmptyStringArray,
40
+ asTrimmedNonEmptyStringArray
41
+ } from "./chunk-I42VC5KR.js";
42
42
  import {
43
43
  asOptionalTrimmedString
44
44
  } from "./chunk-G3SUCT4W.js";
@@ -625,7 +625,7 @@ async function tryHttpDialogCandidates(args) {
625
625
  throw Object.assign(new Error("All HTTP dialog reads failed"), { attempts });
626
626
  }
627
627
  async function readDialogFromLocalDb(dialogKey, dialogId, limit, readLocalDialog) {
628
- const reader = readLocalDialog ?? (await import("./localDialogRead-JXTAHW2E.js")).readDialogFromLocalDb;
628
+ const reader = readLocalDialog ?? (await import("./localDialogRead-P72W2U2R.js")).readDialogFromLocalDb;
629
629
  const result = await reader({ dialogKey, dialogId, limit });
630
630
  return {
631
631
  ...result,
@@ -1,3 +1,6 @@
1
+ import {
2
+ sanitizeForOutbound
3
+ } from "./chunk-T27IEBNQ.js";
1
4
  import {
2
5
  accumulateToolCallDelta,
3
6
  extractThinkContent,
@@ -24,10 +27,10 @@ import {
24
27
  resolvePlatformAuthToken,
25
28
  resolvePlatformServerUrl,
26
29
  resolveProviderTransportDecision
27
- } from "./chunk-XS7UPVR7.js";
30
+ } from "./chunk-XD5NQEOH.js";
28
31
  import {
29
32
  clipCompactText
30
- } from "./chunk-5MMAK75Q.js";
33
+ } from "./chunk-OB6FBSH3.js";
31
34
  import {
32
35
  isRecord
33
36
  } from "./chunk-KUG52IAP.js";
@@ -351,12 +354,13 @@ function buildPlatformChatCompletionRequest(args) {
351
354
  args.providerConfig.provider,
352
355
  args.providerConfig.model
353
356
  );
357
+ const sanitizedMessages = sanitizeForOutbound(args.messages, args.tools);
354
358
  const body = {
355
359
  model: args.providerConfig.model,
356
360
  ...usesResponsesApi ? {
357
- input: convertMessagesToResponsesInput(args.messages)
361
+ input: convertMessagesToResponsesInput(sanitizedMessages)
358
362
  } : {
359
- messages: toOpenAiCompatibleMessages(args.messages, {
363
+ messages: toOpenAiCompatibleMessages(sanitizedMessages, {
360
364
  stripReasoningContent: shouldStripReasoning
361
365
  })
362
366
  },