nolo-cli 0.32.0-alpha.4 → 0.33.0-alpha.2

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 (170) hide show
  1. package/README.md +6 -12
  2. package/{_executeModel-YXHDCXHF.js → _executeModel-RWPVI3YV.js} +76 -67
  3. package/{action-HI3VRQLP.js → action-SMLG6OTB.js} +17 -15
  4. package/{addContentAction-NCURJ6PK.js → addContentAction-SFO244QN.js} +14 -13
  5. package/{addDialogAgentAction-RCY4ECF4.js → addDialogAgentAction-W44ZCEHB.js} +14 -13
  6. package/{agentDeleteCommand-QWWT4EBM.js → agentDeleteCommand-KU2RXQPP.js} +42 -59
  7. package/{agentEmailCommands-T2WV6M3L.js → agentEmailCommands-MPCMDENS.js} +89 -80
  8. package/{agentGrantCommands-E7ZZFRHK.js → agentGrantCommands-2LEZDADN.js} +2 -2
  9. package/{agentListCommands-SQLSBSZX.js → agentListCommands-EPD4N6FX.js} +73 -78
  10. package/{agentMachineCommands-O7MZVQEL.js → agentMachineCommands-AF7C3YRT.js} +40 -57
  11. package/{agentPullCommand-ARSIDNVC.js → agentPullCommand-YH5GEBK4.js} +5 -5
  12. package/agentRecordCommands-EYE6MZZG.js +112 -0
  13. package/agentRunCommand-LL22SGTN.js +130 -0
  14. package/{agentRuntimeLocal-JPSR5BZ5.js → agentRuntimeLocal-JX34G47Z.js} +35 -50
  15. package/{agentSlice-QYJQOUVC.js → agentSlice-TNMFQQOV.js} +15 -13
  16. package/{appDeleteCommands-ZQLZ4R54.js → appDeleteCommands-43K5VXQB.js} +38 -55
  17. package/{appDeployCommands-A5ISQH7L.js → appDeployCommands-FEEJSVDZ.js} +38 -55
  18. package/{appDeployStatusCommands-PVIPXEJZ.js → appDeployStatusCommands-H76CG45R.js} +38 -55
  19. package/{appGetCommands-CTMVFLQF.js → appGetCommands-MDZYFTYZ.js} +38 -55
  20. package/{appListCommands-WXIHMKQQ.js → appListCommands-TUJJXPWG.js} +38 -55
  21. package/{authCommand-BBDHMSO6.js → authCommand-T7UK4CWS.js} +18 -18
  22. package/{authCommands-4UDEKRE6.js → authCommands-EAPFGNHN.js} +8 -8
  23. package/chatQueueReduxAdapter-LVQXC4ZY.js +180 -0
  24. package/chunk-2H3XIBY4.js +239 -0
  25. package/{chunk-IRZBFTQA.js → chunk-2IVEXF7P.js} +11 -4
  26. package/{chunk-WTGCTVJG.js → chunk-2QTEYCR7.js} +3 -6
  27. package/{chunk-DOISARTV.js → chunk-2UECQ7RE.js} +1 -1
  28. package/{chunk-SWYMCHM7.js → chunk-37V5LNEQ.js} +69 -1
  29. package/{chunk-E3APEOIM.js → chunk-3GZXL6FM.js} +4 -19
  30. package/{chunk-RMOJVZWX.js → chunk-3VAQHAXT.js} +44 -44
  31. package/{chunk-6VCKAMSL.js → chunk-3WXRAHCG.js} +6 -5
  32. package/{chunk-LAXMH7JY.js → chunk-57QJXIB6.js} +18 -15
  33. package/chunk-5CS33IBL.js +301 -0
  34. package/{chunk-MW4IK7L4.js → chunk-5SBK2MTI.js} +4 -365
  35. package/chunk-6PO2SYCS.js +1800 -0
  36. package/{chunk-7WEUX3P3.js → chunk-6SXC35F4.js} +182 -20
  37. package/{chunk-MXFQHRSS.js → chunk-6XIE5ZGI.js} +1 -1
  38. package/{chunk-Y7WMYFED.js → chunk-73GINUCW.js} +256 -451
  39. package/{chunk-VMWR7VNI.js → chunk-7E72JMBB.js} +7 -7
  40. package/{chunk-7YQOB4DH.js → chunk-AAGCMVFT.js} +106 -124
  41. package/chunk-ADLYMQB6.js +642 -0
  42. package/{chunk-ZWJOGMKH.js → chunk-AETZ7AD6.js} +1 -1
  43. package/{chunk-UDA3ZYLW.js → chunk-AFV4FOT2.js} +70 -24
  44. package/{chunk-BGTUGS3T.js → chunk-AOXVOC6D.js} +4 -30
  45. package/{chunk-3GX5X3X3.js → chunk-B2BSG6QQ.js} +12 -11
  46. package/{chunk-44HACRCK.js → chunk-BANYWEYY.js} +4 -4
  47. package/{chunk-TOW4E763.js → chunk-BJIRLHJR.js} +2 -0
  48. package/{chunk-ZJ2WITOO.js → chunk-BQXOGBFN.js} +2 -2
  49. package/{chunk-G5GVZAXF.js → chunk-CLP2K7U4.js} +15 -19
  50. package/{chunk-2K4NDPT5.js → chunk-DFUPZE6V.js} +20 -12
  51. package/{chunk-YHGHADBQ.js → chunk-DPMBNHOJ.js} +4 -4
  52. package/chunk-EGRJC4ZN.js +91 -0
  53. package/{chunk-K6QEHQZ3.js → chunk-EKLRRZIN.js} +1 -1
  54. package/{chunk-XFG3BAKN.js → chunk-FMEVI5TG.js} +65 -0
  55. package/{chunk-CHHN4XWM.js → chunk-FSSX3XRY.js} +2 -4
  56. package/{chunk-VP4WJWKW.js → chunk-GM6PU7B6.js} +431 -345
  57. package/{chunk-6AD7WQOJ.js → chunk-GMXWYXAF.js} +7 -7
  58. package/{chunk-SFWZUTCI.js → chunk-GTYM4HKV.js} +1 -1
  59. package/{chunk-NYBNI5MY.js → chunk-HDKRSRYU.js} +1461 -301
  60. package/chunk-HS7MLR74.js +38 -0
  61. package/{chunk-3AUWC6EM.js → chunk-HUCT7HID.js} +5 -84
  62. package/{chunk-PTHDLIRB.js → chunk-I6N2UVVY.js} +1 -1
  63. package/chunk-IDAU4UFS.js +437 -0
  64. package/{chunk-OF5JK63U.js → chunk-IHEC7VBF.js} +1 -1
  65. package/{chunk-NM3AVNMH.js → chunk-IL545V3E.js} +4 -4
  66. package/{chunk-3LY4F7SV.js → chunk-INZZJSQF.js} +348 -331
  67. package/{chunk-CF2WZF4N.js → chunk-J6WH4PYZ.js} +0 -8
  68. package/{chunk-VMRGMPNM.js → chunk-JMPYDFHY.js} +6 -6
  69. package/{chunk-V54H24CQ.js → chunk-JTSGWTYZ.js} +3 -3
  70. package/{chunk-ATK5WJOA.js → chunk-JZ5AMMXU.js} +4 -4
  71. package/chunk-KHCLMKZZ.js +3062 -0
  72. package/{chunk-WHLVPK32.js → chunk-KMSZPTM6.js} +27 -3
  73. package/{chunk-L3GCUVOH.js → chunk-KSRFVP36.js} +1 -1
  74. package/{chunk-33COESA5.js → chunk-LOD75GOS.js} +336 -32
  75. package/{chunk-C3POSH7K.js → chunk-M2YMQOLC.js} +44 -53
  76. package/chunk-M3JEW6N6.js +193 -0
  77. package/{chunk-MQFSFU3Y.js → chunk-M4NC7NF6.js} +95 -95
  78. package/{chunk-GVNRF276.js → chunk-MPZJVZDC.js} +3735 -1394
  79. package/{chunk-IXZX5CJK.js → chunk-MQRZ5QUH.js} +1 -1
  80. package/{chunk-3ASDTTEI.js → chunk-MRWGHF56.js} +2 -0
  81. package/{chunk-D34RI6NI.js → chunk-NNWHHCVP.js} +75 -1
  82. package/{chunk-6YABCOFU.js → chunk-NUO3QFWD.js} +1 -1
  83. package/{chunk-NSXTWXGH.js → chunk-O6GEBMIY.js} +269 -309
  84. package/{chunk-CAENRKNJ.js → chunk-OR2HNLVO.js} +126 -88
  85. package/chunk-OW765XBU.js +10 -0
  86. package/chunk-PREQU5QV.js +231 -0
  87. package/{chunk-Q3CSL43H.js → chunk-Q5ITEGIN.js} +1 -1
  88. package/{chunk-7S54ZGF6.js → chunk-RAZOLMJR.js} +256 -12
  89. package/chunk-RCFIB45Q.js +28 -0
  90. package/chunk-RY57GLGW.js +188 -0
  91. package/{chunk-KGEVMUMI.js → chunk-TFPUAELY.js} +11 -11
  92. package/{chunk-ZJH3LKEW.js → chunk-UK5JGQVU.js} +94 -15
  93. package/chunk-URMS4XY2.js +10 -0
  94. package/{chunk-POMSDOTR.js → chunk-VH2F7ZB6.js} +1 -1
  95. package/chunk-VIDPVFP3.js +20 -0
  96. package/{chunk-CBVEM475.js → chunk-WHD6BG7M.js} +400 -115
  97. package/{chunk-5RDLGLAP.js → chunk-WJSW43QZ.js} +4 -7
  98. package/{chunk-CF7S2RYZ.js → chunk-WLH5BAKX.js} +6 -6
  99. package/{chunk-2DQTFBJX.js → chunk-X2DAEZ3X.js} +1 -1
  100. package/{chunk-2IJAKBK2.js → chunk-X664KVEV.js} +426 -246
  101. package/{chunk-43EPBPZ2.js → chunk-XCCGU6QB.js} +2 -2
  102. package/chunk-Y5GCAMGP.js +9 -0
  103. package/{chunk-2VOSL35C.js → chunk-YDTYDA5W.js} +3 -3
  104. package/chunk-YYLHWIW6.js +48 -0
  105. package/{chunk-AOS5IN2I.js → chunk-ZHYK3N56.js} +1 -1
  106. package/{chunk-7MTP4AIU.js → chunk-ZJMME4DS.js} +19 -303
  107. package/{chunk-PJ2DDQQM.js → chunk-ZURFOV5J.js} +2 -2
  108. package/chunk-ZZ2MH7LE.js +84 -0
  109. package/{cliExecutor-BBUVQU4L.js → cliExecutor-DW3PHGEL.js} +2 -2
  110. package/{clipboardy-BVE3LVEH.js → clipboardy-MMBYVRLF.js} +166 -372
  111. package/{codingSkills-V35TRR4Y.js → codingSkills-DY5MINPG.js} +5 -4
  112. package/{createAgentAutomationAction-5I6ZMYIA.js → createAgentAutomationAction-INQT23LX.js} +40 -31
  113. package/createDialogAction-LDCPDI73.js +60 -0
  114. package/{createPageAction-M75JWNUP.js → createPageAction-5YXOG2M4.js} +56 -47
  115. package/{db-6DPSJ6WT.js → db-3H3JECGY.js} +45 -5
  116. package/{dbSlice-BBL3PEVW.js → dbSlice-3SD5L5H2.js} +13 -12
  117. package/{deleteFile-RJTEPOT4.js → deleteFile-XQXPBFFB.js} +7 -6
  118. package/dialogCommands-CHJO47AX.js +81 -0
  119. package/{dialogSlice-WDIOJW3W.js → dialogSlice-DOWKOILN.js} +36 -29
  120. package/{docCreateCommands-XU72LHUF.js → docCreateCommands-OVZARUFX.js} +40 -55
  121. package/{docDeleteCommands-EUN6IJ6O.js → docDeleteCommands-E2XJ62LD.js} +42 -57
  122. package/{docReadCommands-LKE4DVQI.js → docReadCommands-I7OSREPJ.js} +40 -55
  123. package/{docStore-BDOACT3C.js → docStore-UAWSKZ2Y.js} +39 -30
  124. package/{docUpdateCommands-SL6IUM52.js → docUpdateCommands-X4Z26VJM.js} +43 -58
  125. package/{fetchMessages-VPPQDDZ4.js → fetchMessages-7QRCCRYK.js} +3 -3
  126. package/{getPricing-QO5TYNCK.js → getPricing-L2ENXWHV.js} +7 -6
  127. package/{handleSendMessageAction-OUQ5QCMS.js → handleSendMessageAction-C3TSDWKH.js} +38 -31
  128. package/index.js +67 -67
  129. package/{lib-FYYBQIXS.js → lib-2ZTNRXR4.js} +432 -183
  130. package/{localDialogRead-3DBXVYXS.js → localDialogRead-SLMPV5SK.js} +2 -2
  131. package/{localRuntimeAuthority-NDUA2D7Y.js → localRuntimeAuthority-E3R24J4T.js} +4 -2
  132. package/{localRuntimeDb-GKYRBWLQ.js → localRuntimeDb-DDZCJFQZ.js} +1 -1
  133. package/{machineCommands-UUW4ZBMZ.js → machineCommands-BUOIYJAD.js} +93 -84
  134. package/{machineWsRunDispatch-HGYZ47ND.js → machineWsRunDispatch-7CRWAA6O.js} +83 -74
  135. package/{models-WDUTTYFS.js → models-OX2S5C6Q.js} +2 -2
  136. package/{offlineMarxistsAgentCommand-E6LUG63A.js → offlineMarxistsAgentCommand-GEH6SNNA.js} +1 -1
  137. package/package.json +1 -4
  138. package/{read-64OQDO3I.js → read-6G73BMEY.js} +8 -7
  139. package/{readDocTool-MXM3T6PE.js → readDocTool-DK4EI2GA.js} +1 -2
  140. package/{readlineWorkspace-IHXWZCWS.js → readlineWorkspace-ZDWEASJV.js} +265 -428
  141. package/{removeDialogAgentAction-NEKVAMSH.js → removeDialogAgentAction-E7H557UO.js} +19 -17
  142. package/{runAgentClientLoop-TBZZWCN6.js → runAgentClientLoop-U7HYA3O5.js} +72 -64
  143. package/{runtimeDoctorCommands-WI2YZUSJ.js → runtimeDoctorCommands-KIKM6BIO.js} +5 -5
  144. package/{setDialogExtraReferencesAction-WTOHQDIV.js → setDialogExtraReferencesAction-RMMGBR5F.js} +15 -14
  145. package/{setPrimaryDialogAgentAction-LDJOYC4F.js → setPrimaryDialogAgentAction-FWBKKLVA.js} +19 -17
  146. package/{settingSlice-4M37TN7V.js → settingSlice-73PV4KG4.js} +16 -14
  147. package/{skillDiscovery-5U6RYAHN.js → skillDiscovery-KLLKXPUO.js} +4 -4
  148. package/{slateUtils-2M7MUTWX.js → slateUtils-VO2FU36K.js} +1 -1
  149. package/{spaceCommands-B6SAUSGD.js → spaceCommands-GEWZXGHM.js} +43 -240
  150. package/{spaceSlice-Q6IMD5NX.js → spaceSlice-B6MOVY4N.js} +38 -61
  151. package/{streamAgentChatTurn-X4LGYPQX.js → streamAgentChatTurn-T527EQTT.js} +1261 -150
  152. package/{switchDialogAgentAction-XVWGKR2Z.js → switchDialogAgentAction-US6QNL3N.js} +14 -13
  153. package/syncMapping-RK2MANUX.js +43 -0
  154. package/{tableCommands-RJZ3V4TF.js → tableCommands-QE47K72R.js} +8 -7
  155. package/{toolApiClient-ARGFDJAG.js → toolApiClient-B2MFXMEG.js} +3 -3
  156. package/tools-XMWCVMPM.js +98 -0
  157. package/{tuiSummaryLlmCaller-SRZ4QQUP.js → tuiSummaryLlmCaller-NCAJSVSD.js} +24 -21
  158. package/{updateDialogTitleAction-HOYHEVOU.js → updateDialogTitleAction-XPJZRJEL.js} +48 -38
  159. package/agentRecordCommands-GFPAXOW5.js +0 -103
  160. package/agentRunCommand-IXI7BKCG.js +0 -121
  161. package/chunk-DCDL3GC4.js +0 -171
  162. package/chunk-F3MP7CP6.js +0 -73
  163. package/chunk-RPHGRXQM.js +0 -1707
  164. package/chunk-WI7I7UKC.js +0 -3158
  165. package/chunk-WZSRQNQG.js +0 -2587
  166. package/createDialogAction-WXVKBBRV.js +0 -52
  167. package/dialogCommands-7QDRPPWW.js +0 -95
  168. package/tools-44PI5ZON.js +0 -90
  169. package/{chunk-Z5MXSEOJ.js → chunk-RQSOAMPJ.js} +2 -2
  170. package/{chunk-JDSUTNYY.js → chunk-SAQQLJZ5.js} +3 -3
@@ -3,7 +3,19 @@ import {
3
3
  normalizeDialogRecord,
4
4
  readDialogSnapshot,
5
5
  sortDialogs
6
- } from "./chunk-C3POSH7K.js";
6
+ } from "./chunk-M2YMQOLC.js";
7
+ import {
8
+ listFavoriteAgentIdsAcrossServers,
9
+ listLocalCachedAgents,
10
+ listRemoteAgents,
11
+ listRemoteAgentsAcrossServers,
12
+ normalizeListedAgent
13
+ } from "./chunk-3WXRAHCG.js";
14
+ import "./chunk-ID4G2MAR.js";
15
+ import {
16
+ listUserRecordsFromServers,
17
+ readLiveDbRecordAfterTombstoneMerge
18
+ } from "./chunk-IHEC7VBF.js";
7
19
  import {
8
20
  ANSI_ESCAPE_REGEX,
9
21
  COLLAPSED_PASTE_PLACEHOLDER_RE,
@@ -13,7 +25,6 @@ import {
13
25
  applyTerminalOutputToText,
14
26
  buildSkillContextBlocks,
15
27
  buildWindowTitle,
16
- classifyCliAutoRoute,
17
28
  clearCollapsedPasteStore,
18
29
  countPhysicalLines,
19
30
  createCollapsedPasteStore,
@@ -38,6 +49,7 @@ import {
38
49
  renderTokenStatus,
39
50
  replaceCollapsedPastesWithReferences,
40
51
  resolveAgentContextWindow,
52
+ resolveAgentModelIdentity,
41
53
  resolveCliColorEnabled,
42
54
  resolveCliMemory,
43
55
  resolveSkillReference,
@@ -58,21 +70,16 @@ import {
58
70
  visibleWidth,
59
71
  wrapTextToLines,
60
72
  wrapTranscriptLine
61
- } from "./chunk-7YQOB4DH.js";
62
- import "./chunk-AOS5IN2I.js";
63
- import "./chunk-6HYVJV7B.js";
73
+ } from "./chunk-AAGCMVFT.js";
74
+ import "./chunk-ZHYK3N56.js";
64
75
  import {
65
- listFavoriteAgentIdsAcrossServers,
66
- listLocalCachedAgents,
67
- listRemoteAgents,
68
- listRemoteAgentsAcrossServers,
69
- normalizeListedAgent
70
- } from "./chunk-6VCKAMSL.js";
71
- import "./chunk-ID4G2MAR.js";
76
+ getReadableCliDb
77
+ } from "./chunk-NUO3QFWD.js";
72
78
  import {
73
- listUserRecordsFromServers,
74
- readLiveDbRecordAfterTombstoneMerge
75
- } from "./chunk-OF5JK63U.js";
79
+ deleteDbRecord,
80
+ queryUserRecords,
81
+ readDbRecord
82
+ } from "./chunk-YDTYDA5W.js";
76
83
  import {
77
84
  createCliLocalRuntimeAdapter,
78
85
  initCliLocale,
@@ -80,104 +87,84 @@ import {
80
87
  readTimestamp,
81
88
  setCliLocale,
82
89
  t
83
- } from "./chunk-NSXTWXGH.js";
84
- import "./chunk-SFWZUTCI.js";
85
- import {
86
- checkStaleRun,
87
- isRunRecordClaimed,
88
- readRunRecord
89
- } from "./chunk-7KNERA53.js";
90
- import "./chunk-JDSUTNYY.js";
91
- import "./chunk-Q3CSL43H.js";
92
- import "./chunk-LM6IYQ3F.js";
93
- import "./chunk-JBTJAPUF.js";
94
- import {
95
- getReadableCliDb
96
- } from "./chunk-6YABCOFU.js";
97
- import {
98
- deleteDbRecord,
99
- queryUserRecords,
100
- readDbRecord
101
- } from "./chunk-2VOSL35C.js";
102
- import "./chunk-2DQTFBJX.js";
90
+ } from "./chunk-O6GEBMIY.js";
91
+ import "./chunk-GTYM4HKV.js";
92
+ import "./chunk-X2DAEZ3X.js";
103
93
  import {
104
94
  NOLO_DEFAULT_AGENT_KEY,
105
95
  resolveCliAgentKeyInput
106
- } from "./chunk-K6QEHQZ3.js";
96
+ } from "./chunk-EKLRRZIN.js";
97
+ import "./chunk-LTRXGFMS.js";
98
+ import "./chunk-PREQU5QV.js";
99
+ import "./chunk-6HYVJV7B.js";
100
+ import "./chunk-JEXVIMYZ.js";
107
101
  import {
108
- buildSkillDiscoveryContextBlock,
109
- buildSkillDiscoveryContextLayer
110
- } from "./chunk-PJ2DDQQM.js";
102
+ prepareTools
103
+ } from "./chunk-M4NC7NF6.js";
104
+ import "./chunk-HS7MLR74.js";
105
+ import "./chunk-DPMBNHOJ.js";
106
+ import "./chunk-HDKRSRYU.js";
107
+ import "./chunk-RQSOAMPJ.js";
108
+ import "./chunk-2IVEXF7P.js";
109
+ import "./chunk-KQHGZWSV.js";
110
+ import "./chunk-37V5LNEQ.js";
111
+ import "./chunk-INZZJSQF.js";
112
+ import "./chunk-GM6PU7B6.js";
113
+ import "./chunk-63W5N6P3.js";
114
+ import "./chunk-VF4K2QE6.js";
115
+ import "./chunk-GMXWYXAF.js";
116
+ import "./chunk-XCCGU6QB.js";
117
+ import "./chunk-Q5ITEGIN.js";
118
+ import {
119
+ createChatQueueRuntime,
120
+ createTurnRequest,
121
+ normalizeRunCompletionShape
122
+ } from "./chunk-RY57GLGW.js";
123
+ import "./chunk-6SXC35F4.js";
124
+ import "./chunk-MPZJVZDC.js";
125
+ import "./chunk-M3JEW6N6.js";
126
+ import "./chunk-IDAU4UFS.js";
127
+ import {
128
+ extractReferenceKeysFromMessage
129
+ } from "./chunk-73GINUCW.js";
130
+ import "./chunk-RCFIB45Q.js";
131
+ import "./chunk-EGRJC4ZN.js";
132
+ import "./chunk-YYLHWIW6.js";
133
+ import "./chunk-CWMSB67P.js";
134
+ import "./chunk-ZJMME4DS.js";
135
+ import "./chunk-JZ5AMMXU.js";
136
+ import "./chunk-5RGU3J7P.js";
137
+ import "./chunk-M76ECQRD.js";
138
+ import "./chunk-KSRFVP36.js";
111
139
  import {
112
140
  buildLocalWorkspaceOpenAiTools,
113
141
  buildLocalWorkspaceToolset,
114
142
  getProcessRegistry
115
- } from "./chunk-33COESA5.js";
143
+ } from "./chunk-LOD75GOS.js";
116
144
  import "./chunk-ZNFJWEN4.js";
117
- import "./chunk-7S54ZGF6.js";
118
- import "./chunk-LTRXGFMS.js";
119
- import "./chunk-ATNTHIZI.js";
145
+ import "./chunk-RAZOLMJR.js";
120
146
  import "./chunk-OIQPORYI.js";
121
147
  import "./chunk-T27IEBNQ.js";
122
- import "./chunk-JEXVIMYZ.js";
123
- import {
124
- prepareTools
125
- } from "./chunk-MQFSFU3Y.js";
126
148
  import {
127
149
  readCommandActionGatePayload
128
- } from "./chunk-WI7I7UKC.js";
150
+ } from "./chunk-6PO2SYCS.js";
129
151
  import "./chunk-N7J63Q6C.js";
130
- import {
131
- buildAgentsMdLayer,
132
- buildMemoryOverlayLayer,
133
- buildMemoryUseGuidanceLayer,
134
- partitionScopedBlocks,
135
- renderTurnContextBlocksWithScope
136
- } from "./chunk-DOISARTV.js";
137
- import "./chunk-YHGHADBQ.js";
138
152
  import {
139
153
  buildCurrentTimeBlock,
140
154
  buildIdentityBlock,
141
155
  buildRuntimeGuidanceBlocks,
142
156
  resolveToolGuidedSections
143
- } from "./chunk-MW4IK7L4.js";
144
- import "./chunk-D34RI6NI.js";
157
+ } from "./chunk-5SBK2MTI.js";
158
+ import "./chunk-NNWHHCVP.js";
145
159
  import {
146
160
  resolvePlatformAuthToken
147
- } from "./chunk-UDA3ZYLW.js";
148
- import "./chunk-XFG3BAKN.js";
161
+ } from "./chunk-AFV4FOT2.js";
162
+ import "./chunk-ADLYMQB6.js";
149
163
  import "./chunk-2MBTWINN.js";
150
- import "./chunk-NYBNI5MY.js";
151
- import "./chunk-Z5MXSEOJ.js";
152
- import {
153
- clipText,
154
- formatDuration,
155
- formatRunAge,
156
- getAgentRunStatusIcon,
157
- isAgentNameFallback,
158
- isAgentRunTerminalStatus,
159
- resolveRunLabel,
160
- runShowsLogTail,
161
- shortRunId
162
- } from "./chunk-KXKQO4Q6.js";
163
- import "./chunk-IRZBFTQA.js";
164
- import "./chunk-KQHGZWSV.js";
165
- import "./chunk-RPHGRXQM.js";
166
- import "./chunk-6AD7WQOJ.js";
167
- import "./chunk-43EPBPZ2.js";
168
- import "./chunk-F3MP7CP6.js";
169
- import "./chunk-SWYMCHM7.js";
170
- import "./chunk-44HACRCK.js";
171
- import "./chunk-7WEUX3P3.js";
172
- import "./chunk-DCDL3GC4.js";
173
- import "./chunk-E3APEOIM.js";
174
- import "./chunk-3LY4F7SV.js";
175
- import "./chunk-GVNRF276.js";
176
164
  import {
177
165
  DEFAULT_CONTEXT_WINDOW,
178
- extractReferenceKeysFromMessage,
179
166
  getModelContextWindow
180
- } from "./chunk-Y7WMYFED.js";
167
+ } from "./chunk-2H3XIBY4.js";
181
168
  import {
182
169
  buildCompactionMetricsFromPlan,
183
170
  buildCompactionUserContent,
@@ -188,27 +175,63 @@ import {
188
175
  formatMessagesForSummaryWithTruncation,
189
176
  planCompression,
190
177
  serializeMessageContent
191
- } from "./chunk-BGTUGS3T.js";
192
- import "./chunk-ATK5WJOA.js";
193
- import "./chunk-7MTP4AIU.js";
178
+ } from "./chunk-AOXVOC6D.js";
179
+ import "./chunk-DFUPZE6V.js";
180
+ import "./chunk-5CS33IBL.js";
194
181
  import "./chunk-JZPBVBIY.js";
195
- import "./chunk-5RGU3J7P.js";
196
- import "./chunk-M76ECQRD.js";
182
+ import "./chunk-ZHXJ6M7T.js";
197
183
  import {
198
- toErrorMessage
199
- } from "./chunk-HNMXYYJR.js";
184
+ buildSkillDiscoveryContextBlock,
185
+ buildSkillDiscoveryContextLayer
186
+ } from "./chunk-ZURFOV5J.js";
187
+ import {
188
+ buildAgentsMdLayer,
189
+ buildMemoryOverlayLayer,
190
+ buildMemoryUseGuidanceLayer,
191
+ partitionScopedBlocks,
192
+ renderTurnContextBlocksWithScope
193
+ } from "./chunk-2UECQ7RE.js";
194
+ import {
195
+ buildUserResponseLanguageContext
196
+ } from "./chunk-FMEVI5TG.js";
197
+ import "./chunk-HUCT7HID.js";
198
+ import {
199
+ expandEnabledPacks
200
+ } from "./chunk-WLH5BAKX.js";
201
+ import "./chunk-AETZ7AD6.js";
202
+ import {
203
+ canonicalizeToolNames
204
+ } from "./chunk-ZZ2MH7LE.js";
205
+ import "./chunk-KHCLMKZZ.js";
206
+ import "./chunk-BANYWEYY.js";
207
+ import "./chunk-MRWGHF56.js";
200
208
  import {
201
209
  compactWhitespace
202
210
  } from "./chunk-DWLEOOGR.js";
203
- import "./chunk-3ASDTTEI.js";
204
- import "./chunk-V54H24CQ.js";
205
- import "./chunk-WTGCTVJG.js";
206
- import "./chunk-CWMSB67P.js";
207
- import "./chunk-2K4NDPT5.js";
208
- import "./chunk-ZHXJ6M7T.js";
209
- import "./chunk-CAENRKNJ.js";
210
- import "./chunk-63W5N6P3.js";
211
- import "./chunk-VF4K2QE6.js";
211
+ import {
212
+ checkStaleRun,
213
+ isRunRecordClaimed,
214
+ readRunRecord
215
+ } from "./chunk-7KNERA53.js";
216
+ import {
217
+ clipText,
218
+ formatDuration,
219
+ formatRunAge,
220
+ getAgentRunStatusIcon,
221
+ isAgentNameFallback,
222
+ isAgentRunTerminalStatus,
223
+ resolveRunLabel,
224
+ runShowsLogTail,
225
+ shortRunId
226
+ } from "./chunk-KXKQO4Q6.js";
227
+ import "./chunk-SAQQLJZ5.js";
228
+ import "./chunk-ATNTHIZI.js";
229
+ import "./chunk-JBTJAPUF.js";
230
+ import "./chunk-URMS4XY2.js";
231
+ import "./chunk-LM6IYQ3F.js";
232
+ import {
233
+ toErrorMessage
234
+ } from "./chunk-HNMXYYJR.js";
212
235
  import {
213
236
  checkForCliUpdate,
214
237
  runSelfUpdate
@@ -230,41 +253,42 @@ import {
230
253
  import {
231
254
  DEFAULT_NOLO_SERVER_URL
232
255
  } from "./chunk-OLZBQWZU.js";
233
- import "./chunk-KGEVMUMI.js";
234
- import "./chunk-G5GVZAXF.js";
256
+ import "./chunk-2QTEYCR7.js";
257
+ import "./chunk-OR2HNLVO.js";
258
+ import "./chunk-TFPUAELY.js";
259
+ import "./chunk-CLP2K7U4.js";
260
+ import "./chunk-Y5GCAMGP.js";
235
261
  import "./chunk-KX6YBIHG.js";
236
- import "./chunk-LAXMH7JY.js";
237
- import "./chunk-ZJ2WITOO.js";
262
+ import "./chunk-UZ6XXCVR.js";
263
+ import "./chunk-JTSGWTYZ.js";
264
+ import "./chunk-57QJXIB6.js";
265
+ import "./chunk-KMSZPTM6.js";
266
+ import "./chunk-BQXOGBFN.js";
267
+ import "./chunk-WWC7I6TA.js";
268
+ import "./chunk-I42VC5KR.js";
238
269
  import {
239
270
  asTrimmedLowercaseString
240
271
  } from "./chunk-QSJ3HFEF.js";
241
- import "./chunk-ZJH3LKEW.js";
242
272
  import {
243
- extractCustomId
244
- } from "./chunk-TOW4E763.js";
245
- import "./chunk-2IJAKBK2.js";
246
- import "./chunk-5RDLGLAP.js";
247
- import "./chunk-LCBAMY2M.js";
248
- import "./chunk-4SN6J65J.js";
249
- import "./chunk-CF7PE763.js";
250
- import "./chunk-VP4WJWKW.js";
251
- import "./chunk-L3GCUVOH.js";
252
- import "./chunk-WHLVPK32.js";
253
- import "./chunk-WWC7I6TA.js";
273
+ BUILTIN_NOLO_AGENT_KEY,
274
+ BUILTIN_NOLO_AGENT_MODEL,
275
+ BUILTIN_NOLO_AGENT_NAME,
276
+ builtinAgentCatalogEntryById
277
+ } from "./chunk-UK5JGQVU.js";
278
+ import "./chunk-X664KVEV.js";
279
+ import "./chunk-WJSW43QZ.js";
254
280
  import "./chunk-GBRG75BQ.js";
281
+ import "./chunk-OW765XBU.js";
255
282
  import "./chunk-3EUW3WEO.js";
256
283
  import "./chunk-U6VC4MU4.js";
257
- import "./chunk-KUG52IAP.js";
258
- import {
259
- canonicalizeToolNames
260
- } from "./chunk-3AUWC6EM.js";
261
284
  import {
262
- expandEnabledPacks
263
- } from "./chunk-CF7S2RYZ.js";
264
- import "./chunk-ZWJOGMKH.js";
265
- import "./chunk-WZSRQNQG.js";
266
- import "./chunk-UZ6XXCVR.js";
267
- import "./chunk-I42VC5KR.js";
285
+ extractCustomId,
286
+ parsePublicAgentId
287
+ } from "./chunk-BJIRLHJR.js";
288
+ import "./chunk-KUG52IAP.js";
289
+ import "./chunk-LCBAMY2M.js";
290
+ import "./chunk-4SN6J65J.js";
291
+ import "./chunk-CF7PE763.js";
268
292
  import {
269
293
  asOptionalTrimmedString
270
294
  } from "./chunk-G3SUCT4W.js";
@@ -281,11 +305,10 @@ import { existsSync, readFileSync } from "node:fs";
281
305
  import { join } from "node:path";
282
306
  var DEFAULT_CLI_PACKS = ["code", "agent-orchestration", "skills"];
283
307
  var DEFAULT_CLI_PLATFORM_TOOLS = [
284
- "ask_user",
285
308
  "exa_search",
286
309
  "fetchWebpage"
287
310
  ];
288
- var DEFAULT_FLASH_PROMPT = "\u4F60\u662F\u5171\u4EAB\u7A7A\u95F4\u91CC\u7684\u9AD8\u6027\u4EF7\u6BD4\u901A\u7528 AI \u52A9\u624B\u3002\u4F18\u5148\u5FEB\u901F\u3001\u76F4\u63A5\u3001\u7A33\u5B9A\u5730\u5B8C\u6210\u4EFB\u52A1\uFF1B\u9700\u8981\u63A8\u7406\u65F6\u4FDD\u6301\u6B65\u9AA4\u6E05\u6670\u3002";
311
+ var DEFAULT_PROMPT_ESTIMATE_BASELINE = "\u4F60\u662F\u5171\u4EAB\u7A7A\u95F4\u91CC\u7684\u9AD8\u6027\u4EF7\u6BD4\u901A\u7528 AI \u52A9\u624B\u3002\u4F18\u5148\u5FEB\u901F\u3001\u76F4\u63A5\u3001\u7A33\u5B9A\u5730\u5B8C\u6210\u4EFB\u52A1\uFF1B\u9700\u8981\u63A8\u7406\u65F6\u4FDD\u6301\u6B65\u9AA4\u6E05\u6670\u3002";
289
312
  function readAgentsMd(cwd) {
290
313
  for (const name of ["AGENTS.md", "agents.md"]) {
291
314
  const path = join(cwd, name);
@@ -315,10 +338,10 @@ function estimateToolSchemas(toolNames) {
315
338
  }
316
339
  function estimateDefaultCliContextTokens(opts = {}) {
317
340
  const cwd = opts.cwd?.trim() || process.cwd();
318
- const model = opts.model?.trim() || "deepseek-v4-flash";
319
- const agentName = opts.agentName?.trim() || "DeepSeek V4 Flash";
320
- const agentKey = opts.agentKey?.trim() || "agent-pub-deepseek-v4-flash";
321
- const prompt = opts.agentPrompt?.trim() || DEFAULT_FLASH_PROMPT;
341
+ const model = opts.model?.trim() || BUILTIN_NOLO_AGENT_MODEL;
342
+ const agentName = opts.agentName?.trim() || BUILTIN_NOLO_AGENT_NAME;
343
+ const agentKey = opts.agentKey?.trim() || BUILTIN_NOLO_AGENT_KEY;
344
+ const prompt = opts.agentPrompt?.trim() || DEFAULT_PROMPT_ESTIMATE_BASELINE;
322
345
  const packTools = canonicalizeToolNames(
323
346
  expandEnabledPacks([...DEFAULT_CLI_PACKS], [])
324
347
  );
@@ -330,6 +353,7 @@ function estimateDefaultCliContextTokens(opts = {}) {
330
353
  const toolSections = resolveToolGuidedSections(toolNames);
331
354
  const systemParts = [
332
355
  prompt,
356
+ opts.userLanguage?.trim() ? buildUserResponseLanguageContext({ language: opts.userLanguage }) : "",
333
357
  buildIdentityBlock({
334
358
  agentName,
335
359
  agentId: agentKey,
@@ -2219,54 +2243,6 @@ function createRunRegistryPoller(deps) {
2219
2243
  };
2220
2244
  }
2221
2245
 
2222
- // packages/core/chat/internalTurnEvent.ts
2223
- function normalizeRunCompletionShape(record) {
2224
- const runId = String(record.runId ?? record.id ?? "");
2225
- const agentKey = String(record.agentKey ?? record.agent ?? "");
2226
- const status = String(record.status ?? "done");
2227
- const counters = record.activity?.counters;
2228
- return {
2229
- runId,
2230
- agentKey,
2231
- ...typeof record.agentName === "string" ? { agentName: record.agentName } : {},
2232
- status,
2233
- ...typeof record.exitCode === "number" ? { exitCode: record.exitCode } : {},
2234
- ...typeof record.parentDialogId === "string" ? { parentDialogId: record.parentDialogId } : {},
2235
- ...typeof record.dialogId === "string" ? { dialogId: record.dialogId } : {},
2236
- ...typeof record.ephemeral === "boolean" ? { ephemeral: record.ephemeral } : {},
2237
- ...record.startedAt !== void 0 ? { startedAt: record.startedAt } : {},
2238
- ...record.endedAt !== void 0 ? { endedAt: record.endedAt } : {},
2239
- ...typeof record.note === "string" ? { note: record.note } : {},
2240
- ...typeof record.error === "string" ? { error: record.error } : {},
2241
- ...typeof record.ack === "boolean" ? { ack: record.ack } : {},
2242
- ...counters ? {
2243
- activity: {
2244
- counters: {
2245
- toolCalls: typeof counters.toolCalls === "number" ? counters.toolCalls : 0,
2246
- llmCalls: typeof counters.llmCalls === "number" ? counters.llmCalls : 0,
2247
- fileEdits: typeof counters.fileEdits === "number" ? counters.fileEdits : 0
2248
- }
2249
- }
2250
- } : {}
2251
- };
2252
- }
2253
- function createTurnRequest(input) {
2254
- if (typeof input === "string") {
2255
- return {
2256
- event: { kind: "user", text: input },
2257
- text: input
2258
- };
2259
- }
2260
- if ("event" in input && typeof input.event === "object" && typeof input.text === "string") {
2261
- return input;
2262
- }
2263
- const event = input;
2264
- return {
2265
- event,
2266
- text: event.text
2267
- };
2268
- }
2269
-
2270
2246
  // packages/cli/tui/runCompletionWatcher.ts
2271
2247
  var WAKE_NOTE_MAX_CHARS = 300;
2272
2248
  function createRunCompletionWatcher(deps) {
@@ -2449,26 +2425,17 @@ function formatAgentSourceLabel(entry) {
2449
2425
  }
2450
2426
  var PLATFORM_AGENTS = [
2451
2427
  {
2452
- name: "nolo",
2428
+ // 名称与模型都从 builtinAgentCatalog 派生:`/switch` 里的 nolo 项直接显示
2429
+ // 它实际指向的模型(当前 DeepSeek V4 Flash Vision Exp),换代自动跟随。
2430
+ name: BUILTIN_NOLO_AGENT_NAME,
2453
2431
  key: DEFAULT_TUI_AGENT_KEY,
2454
- model: "-",
2432
+ model: BUILTIN_NOLO_AGENT_MODEL,
2455
2433
  kind: "platform",
2456
2434
  description: "one assistant that routes work across your agents and data"
2457
2435
  }
2458
2436
  ];
2459
- var AUTO_ROUTE_CATALOG_ENTRY = {
2460
- name: "auto",
2461
- key: DEFAULT_TUI_AGENT_KEY,
2462
- model: "auto",
2463
- kind: "platform",
2464
- description: "auto-route each new dialog across flash / balanced / quality tiers"
2465
- };
2466
- function resolveCatalogPlatformAgents(env = process.env) {
2467
- if (env.NOLO_AUTO_ROUTE === "0") return PLATFORM_AGENTS;
2468
- return [
2469
- AUTO_ROUTE_CATALOG_ENTRY,
2470
- ...PLATFORM_AGENTS.filter((entry) => entry.key !== DEFAULT_TUI_AGENT_KEY)
2471
- ];
2437
+ function resolveCatalogPlatformAgents(_env = process.env) {
2438
+ return PLATFORM_AGENTS;
2472
2439
  }
2473
2440
  function toUpdatedAt(value) {
2474
2441
  if (value == null) return 0;
@@ -2676,31 +2643,41 @@ function renderAgentCatalogList(entries, currentKey) {
2676
2643
  lines.push("Tip: run /switch in an interactive terminal to pick with \u2191\u2193.");
2677
2644
  return lines.join("\n");
2678
2645
  }
2646
+ function resolveEntryApiSource(entry) {
2647
+ if (entry.apiSource) return entry.apiSource;
2648
+ return entry.kind === "platform" ? "platform" : void 0;
2649
+ }
2650
+ function toSwitchTarget(entry) {
2651
+ const apiSource = resolveEntryApiSource(entry);
2652
+ return {
2653
+ name: entry.name,
2654
+ key: entry.key,
2655
+ model: entry.model,
2656
+ ...apiSource ? { apiSource } : {}
2657
+ };
2658
+ }
2679
2659
  function findAgentCatalogEntry(entries, rawTarget) {
2680
2660
  const target = rawTarget.trim();
2681
2661
  if (!target) return null;
2682
2662
  if (/^\d+$/.test(target)) {
2683
2663
  const entry = entries[Number(target) - 1];
2684
- return entry ? {
2685
- name: entry.name,
2686
- key: entry.key,
2687
- model: entry.model,
2688
- ...entry.apiSource ? { apiSource: entry.apiSource } : entry.kind === "platform" ? { apiSource: "platform" } : {}
2689
- } : null;
2664
+ return entry ? toSwitchTarget(entry) : null;
2690
2665
  }
2691
2666
  const lower = target.toLowerCase();
2692
2667
  const byName = entries.find(
2693
2668
  (entry) => entry.name.toLowerCase() === lower || entry.key.toLowerCase() === lower || entry.key.toLowerCase().endsWith(`-${lower}`)
2694
2669
  );
2695
- if (byName) {
2696
- return {
2697
- name: byName.name,
2698
- key: byName.key,
2699
- model: byName.model,
2700
- ...byName.apiSource ? { apiSource: byName.apiSource } : byName.kind === "platform" ? { apiSource: "platform" } : {}
2701
- };
2702
- }
2670
+ if (byName) return toSwitchTarget(byName);
2703
2671
  if (target.startsWith("agent-") || target.startsWith("agent-pub-")) {
2672
+ const builtin = builtinAgentCatalogEntryById(parsePublicAgentId(target));
2673
+ if (builtin) {
2674
+ return {
2675
+ name: builtin.name,
2676
+ key: target,
2677
+ model: builtin.model,
2678
+ apiSource: builtin.apiSource ?? "platform"
2679
+ };
2680
+ }
2704
2681
  return { name: target, key: target };
2705
2682
  }
2706
2683
  return null;
@@ -2775,11 +2752,12 @@ async function runAgentPicker(args) {
2775
2752
  };
2776
2753
  }
2777
2754
  function resolveAgentSwitchTarget(rawTarget, catalogEntries = []) {
2778
- const resolvedKey = resolveCliAgentKeyInput(rawTarget);
2779
- if (resolvedKey !== rawTarget.trim()) {
2755
+ const target = rawTarget.trim() === "auto" ? "nolo" : rawTarget.trim();
2756
+ const resolvedKey = resolveCliAgentKeyInput(target);
2757
+ if (resolvedKey !== target) {
2780
2758
  const aliasEntry = catalogEntries.find((entry) => entry.key === resolvedKey);
2781
2759
  return {
2782
- name: aliasEntry?.name ?? asTrimmedLowercaseString(rawTarget),
2760
+ name: aliasEntry?.name ?? asTrimmedLowercaseString(target),
2783
2761
  key: resolvedKey,
2784
2762
  ...aliasEntry?.model ? { model: aliasEntry.model } : {},
2785
2763
  ...aliasEntry ? {
@@ -3215,8 +3193,7 @@ function renderComposerTokenChip(tokens, fallbackContextWindow, estimatedContext
3215
3193
  function renderStatusLine(state) {
3216
3194
  const colorEnabled = resolveCliColorEnabled();
3217
3195
  const sep = themeText(" \xB7 ", "chrome", colorEnabled);
3218
- const autoRouteActive = state.agentKey === DEFAULT_TUI_AGENT_KEY && (typeof process === "undefined" || process.env?.NOLO_AUTO_ROUTE !== "0");
3219
- const agentDisplayName = autoRouteActive ? "auto" : state.agentName;
3196
+ const agentDisplayName = state.agentName;
3220
3197
  const modeSuffix = state.modeLabel && state.modeLabel !== "auto" ? ` \xB7 ${state.modeLabel}` : "";
3221
3198
  const agentLabel = `\u{1F3D4} ${agentDisplayName}${modeSuffix}`;
3222
3199
  const agentSegment = themeText(agentLabel, "accent", colorEnabled);
@@ -3721,7 +3698,6 @@ function createInitialTuiState(env = process.env) {
3721
3698
  ) || void 0;
3722
3699
  const dialogEnvValue = asOptionalTrimmedString(env.NOLO_DIALOG);
3723
3700
  const explicitDialogKey = asOptionalTrimmedString(env.NOLO_DIALOG_KEY) ?? (dialogEnvValue?.startsWith("dialog-") ? dialogEnvValue : void 0);
3724
- const autoRouteDefault = env.NOLO_AUTO_ROUTE !== "0";
3725
3701
  return {
3726
3702
  agentKey,
3727
3703
  agentName,
@@ -3741,29 +3717,24 @@ function createInitialTuiState(env = process.env) {
3741
3717
  attachedImages: [],
3742
3718
  runtimeMode,
3743
3719
  modeLabel: asOptionalTrimmedString(env.NOLO_CLI_STATUS_MODE) ?? runtimeMode,
3720
+ userLanguage: asOptionalTrimmedString(env.NOLO_LANG),
3744
3721
  gitStatus: void 0,
3745
3722
  toolDisplay: normalizeToolDisplayMode(env.NOLO_CLI_TOOLS ?? env.NOLO_TOOLS, "compact"),
3746
- contextWindow: resolveAgentContextWindow({
3747
- agentKey,
3748
- agentName,
3749
- autoRouteDefault
3750
- }),
3723
+ contextWindow: resolveAgentContextWindow({ agentKey, agentName }),
3751
3724
  estimatedContextTokens: estimateDefaultCliContextTokens({
3752
3725
  cwd,
3753
3726
  agentKey,
3754
- agentName: autoRouteDefault ? "DeepSeek V4 Flash" : agentName,
3755
- model: autoRouteDefault ? "deepseek-v4-flash" : void 0
3727
+ userLanguage: asOptionalTrimmedString(env.NOLO_LANG),
3728
+ ...resolveAgentModelIdentity({ agentKey, agentName })
3756
3729
  }),
3757
3730
  apiSource: PLATFORM_AGENTS.some((entry) => entry.key === agentKey) ? "platform" : void 0
3758
3731
  };
3759
3732
  }
3760
- function applyAgentSwitch(state, target, opts) {
3761
- const autoRouteDefault = opts?.autoRouteDefault ?? process.env.NOLO_AUTO_ROUTE !== "0";
3733
+ function applyAgentSwitch(state, target) {
3762
3734
  const contextWindow = resolveAgentContextWindow({
3763
3735
  agentKey: target.key,
3764
3736
  agentName: target.name,
3765
- model: target.model,
3766
- autoRouteDefault
3737
+ model: target.model
3767
3738
  });
3768
3739
  return {
3769
3740
  nextState: {
@@ -3775,7 +3746,8 @@ function applyAgentSwitch(state, target, opts) {
3775
3746
  cwd: state.cwd,
3776
3747
  agentKey: target.key,
3777
3748
  agentName: target.name,
3778
- model: target.model
3749
+ model: target.model,
3750
+ userLanguage: state.userLanguage
3779
3751
  }),
3780
3752
  apiSource: target.apiSource
3781
3753
  },
@@ -4085,7 +4057,19 @@ function handleTuiInput(input, state) {
4085
4057
  }
4086
4058
  setCliLocale(locale);
4087
4059
  return {
4088
- nextState: state,
4060
+ nextState: {
4061
+ ...state,
4062
+ userLanguage: locale,
4063
+ estimatedContextTokens: estimateDefaultCliContextTokens({
4064
+ cwd: state.cwd,
4065
+ agentKey: state.agentKey,
4066
+ userLanguage: locale,
4067
+ ...resolveAgentModelIdentity({
4068
+ agentKey: state.agentKey,
4069
+ agentName: state.agentName
4070
+ })
4071
+ })
4072
+ },
4089
4073
  output: t("langSwitched"),
4090
4074
  action: { type: "set-locale", locale }
4091
4075
  };
@@ -4362,141 +4346,6 @@ function detectSystemBrightness(env = process.env, options = {}) {
4362
4346
  return null;
4363
4347
  }
4364
4348
 
4365
- // packages/core/chat/chatQueueMachine.ts
4366
- var initialChatQueueState = {
4367
- running: false,
4368
- queue: [],
4369
- drainPaused: false,
4370
- lastDrainError: null
4371
- };
4372
- function reduceChatQueue(state, event) {
4373
- switch (event.type) {
4374
- case "turn-start":
4375
- if (state.running && state.lastDrainError === null) return state;
4376
- return {
4377
- ...state,
4378
- running: true,
4379
- lastDrainError: null
4380
- };
4381
- case "turn-end":
4382
- return {
4383
- ...state,
4384
- running: false,
4385
- queue: event.aborted ? [] : state.queue,
4386
- lastDrainError: !event.ok && !event.aborted ? "previous turn failed" : state.lastDrainError
4387
- };
4388
- case "enqueue": {
4389
- const req = createTurnRequest(event.text);
4390
- if (!req.text.trim() && req.event.kind === "user") {
4391
- return state;
4392
- }
4393
- return {
4394
- ...state,
4395
- queue: [...state.queue, req]
4396
- };
4397
- }
4398
- case "dequeue":
4399
- if (state.queue.length === 0) return state;
4400
- return {
4401
- ...state,
4402
- queue: state.queue.slice(1)
4403
- };
4404
- case "clear":
4405
- if (state.queue.length === 0 && state.lastDrainError === null) return state;
4406
- return {
4407
- ...state,
4408
- queue: [],
4409
- lastDrainError: null
4410
- };
4411
- case "pause-drain":
4412
- if (state.drainPaused) return state;
4413
- return {
4414
- ...state,
4415
- drainPaused: true
4416
- };
4417
- case "resume-drain":
4418
- if (!state.drainPaused) return state;
4419
- return {
4420
- ...state,
4421
- drainPaused: false
4422
- };
4423
- case "drain-error":
4424
- return {
4425
- ...state,
4426
- lastDrainError: event.message || null
4427
- };
4428
- default:
4429
- return state;
4430
- }
4431
- }
4432
- function shouldDrainAfterTurnEnd(state, cleanTurnEnd) {
4433
- return cleanTurnEnd && !state.running && !state.drainPaused && state.queue.length > 0;
4434
- }
4435
- function applyChatQueueEvent(state, event) {
4436
- const prevQueueLen = state.queue.length;
4437
- const prevRunning = state.running;
4438
- const prevPaused = state.drainPaused;
4439
- const next = reduceChatQueue(state, event);
4440
- const outgoing = [];
4441
- if (next.queue.length !== prevQueueLen) {
4442
- outgoing.push({ type: "queue-changed", length: next.queue.length });
4443
- }
4444
- if (next.running !== prevRunning) {
4445
- outgoing.push({ type: "running-changed", running: next.running });
4446
- }
4447
- if (next.drainPaused !== prevPaused) {
4448
- outgoing.push({ type: "drain-paused-changed", paused: next.drainPaused });
4449
- }
4450
- if (event.type === "turn-end" && !event.aborted && event.ok) {
4451
- if (shouldDrainAfterTurnEnd(next, true)) {
4452
- const head = next.queue[0];
4453
- outgoing.push({ type: "drain-ready", text: head.text, request: head });
4454
- }
4455
- }
4456
- return { state: next, outgoing };
4457
- }
4458
-
4459
- // packages/core/chat/chatQueueRuntime.ts
4460
- function createChatQueueRuntime(initialState = initialChatQueueState) {
4461
- let state = initialState;
4462
- const listeners = /* @__PURE__ */ new Set();
4463
- const dispatch = (events) => {
4464
- for (const e of events) {
4465
- for (const l of listeners) l(e);
4466
- }
4467
- };
4468
- return {
4469
- getState: () => state,
4470
- send(event) {
4471
- const result = applyChatQueueEvent(state, event);
4472
- state = result.state;
4473
- dispatch(result.outgoing);
4474
- return state;
4475
- },
4476
- subscribe(listener) {
4477
- listeners.add(listener);
4478
- return () => {
4479
- listeners.delete(listener);
4480
- };
4481
- },
4482
- on(type, listener) {
4483
- const wrapped = (e) => {
4484
- if (e.type === type) {
4485
- listener(e);
4486
- }
4487
- };
4488
- listeners.add(wrapped);
4489
- return () => {
4490
- listeners.delete(wrapped);
4491
- };
4492
- },
4493
- dispose() {
4494
- listeners.clear();
4495
- state = initialChatQueueState;
4496
- }
4497
- };
4498
- }
4499
-
4500
4349
  // packages/core/chat/resolveChatSendDecision.ts
4501
4350
  function resolveChatSendDecision(input) {
4502
4351
  const trimmed = input.text.trim();
@@ -5753,32 +5602,10 @@ function readAgentsMdLayer(cwd) {
5753
5602
  }
5754
5603
  return null;
5755
5604
  }
5756
- var autoRouteByDialog = /* @__PURE__ */ new Map();
5757
5605
  async function runAgentChat(scriptDir, state, message, env, output, agentRunner = runAgentTurn, options = {}) {
5758
- let effectiveAgentKey = state.agentKey;
5759
- let effectiveAgentName = state.agentName;
5606
+ const effectiveAgentKey = state.agentKey;
5607
+ const effectiveAgentName = state.agentName;
5760
5608
  const continueId = state.dialogId;
5761
- const cachedRoute = continueId ? autoRouteByDialog.get(continueId) : void 0;
5762
- const hasImages = options.imageUrls && options.imageUrls.length > 0;
5763
- if (cachedRoute && !options.explicitAgentSwitch) {
5764
- effectiveAgentKey = cachedRoute.agentKey;
5765
- effectiveAgentName = cachedRoute.agentName;
5766
- } else if (!continueId && env.NOLO_AUTO_ROUTE !== "0" && state.agentKey === DEFAULT_TUI_AGENT_KEY) {
5767
- const route = classifyCliAutoRoute(message, {
5768
- serverUrl: state.serverUrl,
5769
- authToken: resolvePlatformAuthToken(env),
5770
- hasImages
5771
- });
5772
- effectiveAgentKey = route.agentKey;
5773
- effectiveAgentName = `auto\u2192${route.tier}`;
5774
- if (effectiveAgentKey !== state.agentKey) {
5775
- output.write(
5776
- `
5777
- [nolo] auto \u2192 ${route.tier}
5778
- `
5779
- );
5780
- }
5781
- }
5782
5609
  let effectiveMessage = message;
5783
5610
  let skillAllowedTools;
5784
5611
  let skillContextBlocks;
@@ -5854,10 +5681,15 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
5854
5681
  continueDialogId: state.dialogId,
5855
5682
  ...state.agentKey === DEFAULT_TUI_AGENT_KEY && env.NOLO_AUTO_ROUTE !== "0" ? { dialogAgentMode: "auto" } : { dialogAgentMode: "fixed" },
5856
5683
  runtimeMode: state.runtimeMode,
5684
+ // `/lang` updates the in-memory TUI state immediately. Pass that state
5685
+ // explicitly so the next real turn cannot keep using the workspace's
5686
+ // launch-time NOLO_LANG value while the estimator already uses the new one.
5687
+ userLanguage: state.userLanguage,
5857
5688
  localRuntimeCwd: process.cwd(),
5858
5689
  scriptDir,
5859
5690
  env: {
5860
5691
  ...env,
5692
+ NOLO_LANG: state.userLanguage,
5861
5693
  NOLO_CLI_TOOLS: state.toolDisplay
5862
5694
  },
5863
5695
  output,
@@ -5889,18 +5721,11 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
5889
5721
  ...skillAllowedTools !== void 0 ? { allowedToolNames: skillAllowedTools } : {},
5890
5722
  ...contextBlockScopes.length > 0 ? { contextBlockScopes } : {}
5891
5723
  });
5892
- if (!continueId && result.dialogId && effectiveAgentKey !== state.agentKey) {
5893
- autoRouteByDialog.set(result.dialogId, {
5894
- agentKey: effectiveAgentKey,
5895
- agentName: effectiveAgentName
5896
- });
5897
- }
5898
5724
  return {
5899
5725
  ...result,
5900
5726
  contextWindow: resolveAgentContextWindow({
5901
5727
  agentKey: effectiveAgentKey,
5902
- agentName: effectiveAgentName,
5903
- autoRouteDefault: env.NOLO_AUTO_ROUTE !== "0"
5728
+ agentName: effectiveAgentName
5904
5729
  }),
5905
5730
  cachedMemoryOverlay: memoryPromptBlock
5906
5731
  };
@@ -5992,22 +5817,18 @@ function waitForActionGate(rl, input, output, gate, spawnRunner) {
5992
5817
  });
5993
5818
  }
5994
5819
  function persistAgentSelection(state, env, saveSelection = saveProfileAgentSelection) {
5995
- const isAuto = state.agentKey === DEFAULT_TUI_AGENT_KEY && state.agentName.trim().toLowerCase() === "auto";
5820
+ const selection = state.agentKey === DEFAULT_TUI_AGENT_KEY ? { agentKey: "", agentName: "" } : { agentKey: state.agentKey, agentName: state.agentName };
5996
5821
  try {
5997
- saveSelection({
5998
- agentKey: isAuto ? "" : state.agentKey,
5999
- agentName: isAuto ? "" : state.agentName
6000
- });
5822
+ saveSelection(selection);
6001
5823
  } catch {
6002
5824
  }
6003
- if (env) {
6004
- if (isAuto) {
6005
- delete env.NOLO_AGENT;
6006
- delete env.NOLO_AGENT_NAME;
6007
- } else {
6008
- env.NOLO_AGENT = state.agentKey;
6009
- env.NOLO_AGENT_NAME = state.agentName;
6010
- }
5825
+ if (!env) return;
5826
+ if (selection.agentKey) {
5827
+ env.NOLO_AGENT = selection.agentKey;
5828
+ env.NOLO_AGENT_NAME = selection.agentName;
5829
+ } else {
5830
+ delete env.NOLO_AGENT;
5831
+ delete env.NOLO_AGENT_NAME;
6011
5832
  }
6012
5833
  }
6013
5834
  function isInteractiveInput(input) {
@@ -6196,7 +6017,6 @@ async function startTuiWorkspace(options) {
6196
6017
  reconcile: (runId) => checkStaleRun(runId, { env: process.env }),
6197
6018
  onRecordsPolled: (records) => runCompletionWatcher.observe(records)
6198
6019
  });
6199
- let explicitAgentSwitch = false;
6200
6020
  let copyViewExitResolver = null;
6201
6021
  let copyViewRender = null;
6202
6022
  let copyViewScrollTop = 0;
@@ -6393,6 +6213,22 @@ async function startTuiWorkspace(options) {
6393
6213
  }, AUTO_THEME_POLL_MS);
6394
6214
  }
6395
6215
  const runOneAgentTurn = async (inputMsg, imageUrls, actionGateHandler, confirmDestructiveAction) => {
6216
+ const scheduleTitlePatchSync = (runResult) => {
6217
+ if (!runResult.titlePatchPromise || !runResult.dialogId) return;
6218
+ const patchDialogId = runResult.dialogId;
6219
+ runResult.titlePatchPromise.then((patchedTitle) => {
6220
+ if (!patchedTitle || sessionEnded) return;
6221
+ if (state.dialogId !== patchDialogId) return;
6222
+ if (state.dialogLabel === patchedTitle) return;
6223
+ state = {
6224
+ ...state,
6225
+ dialogLabel: patchedTitle,
6226
+ dialogTitle: patchedTitle
6227
+ };
6228
+ syncWindowTitle();
6229
+ }).catch(() => {
6230
+ });
6231
+ };
6396
6232
  const req = createTurnRequest(inputMsg);
6397
6233
  if (req.event.kind === "child-run-completed") {
6398
6234
  for (const r of req.event.runs) {
@@ -6452,7 +6288,6 @@ async function startTuiWorkspace(options) {
6452
6288
  ...requestUserChoice ? { requestUserChoice } : {},
6453
6289
  abortSignal: activeTurnAbort.signal,
6454
6290
  pastedTextStore: pasteStore,
6455
- explicitAgentSwitch,
6456
6291
  activityReporter,
6457
6292
  onAgentRunStatus: (snapshot) => {
6458
6293
  if (snapshot) {
@@ -6480,6 +6315,7 @@ async function startTuiWorkspace(options) {
6480
6315
  ...runResult.cachedMemoryOverlay !== void 0 ? { cachedMemoryOverlay: runResult.cachedMemoryOverlay } : {}
6481
6316
  };
6482
6317
  }
6318
+ scheduleTitlePatchSync(runResult);
6483
6319
  return { ok: false, aborted: true };
6484
6320
  }
6485
6321
  const wasAborted = activeTurnAbort.signal.aborted;
@@ -6492,7 +6328,6 @@ async function startTuiWorkspace(options) {
6492
6328
  })) {
6493
6329
  emitTerminalBell(output);
6494
6330
  }
6495
- explicitAgentSwitch = false;
6496
6331
  if (isInteractiveInput(input)) {
6497
6332
  finalizeCurrentTurn(history);
6498
6333
  flushPendingRender();
@@ -6525,6 +6360,7 @@ async function startTuiWorkspace(options) {
6525
6360
  ...runResult.cachedMemoryOverlay !== void 0 ? { cachedMemoryOverlay: runResult.cachedMemoryOverlay } : {}
6526
6361
  };
6527
6362
  }
6363
+ scheduleTitlePatchSync(runResult);
6528
6364
  if (!wasAborted && runResult.exitCode !== 0) {
6529
6365
  if (isBalanceExhaustedError(runResult.localError) && runResult.dialogId) {
6530
6366
  emitCommandOutput(t("balanceExhaustedHint"));
@@ -6540,7 +6376,6 @@ async function startTuiWorkspace(options) {
6540
6376
  } finally {
6541
6377
  activityIndicator.stop();
6542
6378
  activeTurnAbort = null;
6543
- explicitAgentSwitch = false;
6544
6379
  }
6545
6380
  };
6546
6381
  let chatQueueBinding = null;
@@ -6570,8 +6405,6 @@ async function startTuiWorkspace(options) {
6570
6405
  };
6571
6406
  const persistExplicitAgentSwitch = (previousAgentKey) => {
6572
6407
  if (state.agentKey === previousAgentKey) return false;
6573
- if (state.dialogId) autoRouteByDialog.delete(state.dialogId);
6574
- explicitAgentSwitch = true;
6575
6408
  persistAgentSelection(
6576
6409
  state,
6577
6410
  options.env ?? process.env,
@@ -6625,8 +6458,11 @@ async function startTuiWorkspace(options) {
6625
6458
  estimatedContextTokens: estimateDefaultCliContextTokens({
6626
6459
  cwd: state.cwd,
6627
6460
  agentKey: state.agentKey,
6628
- agentName: state.agentKey === DEFAULT_TUI_AGENT_KEY && (options.env ?? process.env).NOLO_AUTO_ROUTE !== "0" ? "DeepSeek V4 Flash" : state.agentName,
6629
- model: state.agentKey === DEFAULT_TUI_AGENT_KEY && (options.env ?? process.env).NOLO_AUTO_ROUTE !== "0" ? "deepseek-v4-flash" : void 0
6461
+ userLanguage: state.userLanguage,
6462
+ ...resolveAgentModelIdentity({
6463
+ agentKey: state.agentKey,
6464
+ agentName: state.agentName
6465
+ })
6630
6466
  })
6631
6467
  };
6632
6468
  history.turns.length = 0;
@@ -6671,8 +6507,11 @@ async function startTuiWorkspace(options) {
6671
6507
  estimatedContextTokens: estimateDefaultCliContextTokens({
6672
6508
  cwd: state.cwd,
6673
6509
  agentKey: state.agentKey,
6674
- agentName: state.agentKey === DEFAULT_TUI_AGENT_KEY && (options.env ?? process.env).NOLO_AUTO_ROUTE !== "0" ? "DeepSeek V4 Flash" : state.agentName,
6675
- model: state.agentKey === DEFAULT_TUI_AGENT_KEY && (options.env ?? process.env).NOLO_AUTO_ROUTE !== "0" ? "deepseek-v4-flash" : void 0
6510
+ userLanguage: state.userLanguage,
6511
+ ...resolveAgentModelIdentity({
6512
+ agentKey: state.agentKey,
6513
+ agentName: state.agentName
6514
+ })
6676
6515
  })
6677
6516
  };
6678
6517
  const elapsed = `${elapsedSec}s`;
@@ -6752,21 +6591,19 @@ async function startTuiWorkspace(options) {
6752
6591
  contextWindow: resolveAgentContextWindow({
6753
6592
  agentKey: pickResult.key,
6754
6593
  agentName: pickResult.name,
6755
- model: pickResult.model,
6756
- autoRouteDefault: (options.env ?? process.env).NOLO_AUTO_ROUTE !== "0"
6594
+ model: pickResult.model
6757
6595
  }),
6758
6596
  estimatedContextTokens: estimateDefaultCliContextTokens({
6759
6597
  cwd: state.cwd,
6760
6598
  agentKey: pickResult.key,
6761
6599
  agentName: pickResult.name,
6762
- model: pickResult.model
6600
+ model: pickResult.model,
6601
+ userLanguage: state.userLanguage
6763
6602
  }),
6764
6603
  ...pickResult.apiSource ? { apiSource: pickResult.apiSource } : {},
6765
6604
  cachedMemoryOverlay: void 0
6766
6605
  // 切换 agent 后重新加载记忆
6767
6606
  };
6768
- if (state.dialogId) autoRouteByDialog.delete(state.dialogId);
6769
- explicitAgentSwitch = true;
6770
6607
  persistAgentSelection(state, options.env ?? process.env);
6771
6608
  output.write(
6772
6609
  `${formatAgentSwitchMessage({
@@ -6815,7 +6652,7 @@ async function startTuiWorkspace(options) {
6815
6652
  emitCommandOutput(t("copyNothing"));
6816
6653
  } else {
6817
6654
  try {
6818
- const { default: clipboard } = await import("./clipboardy-BVE3LVEH.js");
6655
+ const { default: clipboard } = await import("./clipboardy-MMBYVRLF.js");
6819
6656
  await clipboard.write(text);
6820
6657
  emitCommandOutput(t("copiedLastReply"));
6821
6658
  } catch (error) {