nolo-cli 0.50.0-alpha.1 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/{_executeModel-4BPV4B2U.js → _executeModel-JKEH7ACW.js} +48 -42
  2. package/{action-IU6ON7ZB.js → action-VSG2IYP3.js} +8 -8
  3. package/{addContentAction-5V5CCI3I.js → addContentAction-2HJJITDI.js} +8 -7
  4. package/{addDialogAgentAction-KF3KZZNZ.js → addDialogAgentAction-7BSQVVL5.js} +10 -9
  5. package/{agentDeleteCommand-KZSETRE3.js → agentDeleteCommand-SVXKS5SC.js} +30 -28
  6. package/{agentEmailCommands-5TEW64UO.js → agentEmailCommands-WN7QBTP3.js} +57 -52
  7. package/{agentListCommands-KVLURCS7.js → agentListCommands-2BEBOQIG.js} +42 -33
  8. package/{agentMachineCommands-4LQF5YB5.js → agentMachineCommands-WALP3ONU.js} +30 -28
  9. package/{agentRecordCommands-OXC6JSH6.js → agentRecordCommands-E652SW57.js} +55 -50
  10. package/{agentRunCommand-4AXTA7MR.js → agentRunCommand-6VXWXKCS.js} +60 -53
  11. package/{agentRunControl-4GHHSXFZ.js → agentRunControl-LJVFDJGU.js} +3 -1
  12. package/{agentRuntimeLocal-SIQYQGSK.js → agentRuntimeLocal-SBG7BDFQ.js} +30 -26
  13. package/{agentSlice-VD3BAJAU.js → agentSlice-3WYXIGEO.js} +8 -8
  14. package/{agentSuperviseCommands-VB6BUS5H.js → agentSuperviseCommands-F3RFAL7K.js} +2 -2
  15. package/{appDeleteCommands-LSIIQFYN.js → appDeleteCommands-NTUNMEXY.js} +31 -29
  16. package/{appDeployCommands-VYGKN7HU.js → appDeployCommands-DISWXRTL.js} +31 -29
  17. package/{appDeployStatusCommands-ODFHFUR7.js → appDeployStatusCommands-IKRA6B6F.js} +31 -29
  18. package/{appGetCommands-DPQY67UZ.js → appGetCommands-UMOP2DFV.js} +31 -29
  19. package/{appListCommands-EFXENXWX.js → appListCommands-ZKFD2AKS.js} +31 -29
  20. package/{authCommand-WLWOEVYI.js → authCommand-BS3CQC6I.js} +11 -11
  21. package/{chatQueueReduxAdapter-N5432EP2.js → chatQueueReduxAdapter-A3YH4MT4.js} +24 -21
  22. package/{chunk-76UA7376.js → chunk-273FJUYI.js} +6 -6
  23. package/{chunk-7CH6U3FL.js → chunk-2GRGFCF6.js} +2 -4
  24. package/{chunk-T27IEBNQ.js → chunk-2QDDKFG5.js} +74 -1
  25. package/{chunk-WWXZYFWM.js → chunk-2TLYVDTN.js} +464 -1135
  26. package/{chunk-6BYAXNH5.js → chunk-3QOCS5IF.js} +11 -2
  27. package/chunk-6IGD47IC.js +19 -0
  28. package/{chunk-QDNFRWAX.js → chunk-6TUT5ZJD.js} +4 -6
  29. package/chunk-6YTOJY35.js +352 -0
  30. package/{chunk-B54WOZ77.js → chunk-7H7GQL6V.js} +2 -2
  31. package/{chunk-OYNDYVSE.js → chunk-B45YNDAE.js} +1 -1
  32. package/{chunk-OZ4JNDIL.js → chunk-BKIDF5LV.js} +1 -1
  33. package/{chunk-5XCW6RQG.js → chunk-BUBPRCIU.js} +1 -1
  34. package/chunk-BYXBJQAS.js +0 -0
  35. package/{chunk-X7S7OFUX.js → chunk-CEVCRRHU.js} +4 -4
  36. package/{chunk-JBL24PK6.js → chunk-DEIGUGP6.js} +2 -2
  37. package/{chunk-V2IPBG5U.js → chunk-DGEPT6FH.js} +1 -1
  38. package/{chunk-3AOLVADY.js → chunk-DVINR3PL.js} +1 -1
  39. package/{chunk-HMMOAG2I.js → chunk-DXOELY7S.js} +67 -69
  40. package/{chunk-OFZPJ3NT.js → chunk-E4MARS3Q.js} +1 -1
  41. package/{chunk-27MWS6HD.js → chunk-EAYBPWHX.js} +179 -86
  42. package/{chunk-DQLYEGP7.js → chunk-EGVY3GMT.js} +1 -1
  43. package/{chunk-2JYSSXLY.js → chunk-EJFW7TRP.js} +5 -26
  44. package/{chunk-4YAMAMNA.js → chunk-FGRCSLPV.js} +36 -46
  45. package/{chunk-VFN256RI.js → chunk-G4WSLTQF.js} +56 -97
  46. package/{chunk-HR5XDXYM.js → chunk-G5SQVIFZ.js} +3 -3
  47. package/{chunk-J3UALFHL.js → chunk-GHE5XMVR.js} +1 -1
  48. package/{chunk-7M72YPM2.js → chunk-GKB4AZKV.js} +440 -2981
  49. package/{chunk-S3HB4CQY.js → chunk-GKNGRBE6.js} +256 -40
  50. package/{chunk-Q24S4NDF.js → chunk-HQTK2SFT.js} +1 -1
  51. package/{chunk-XB7ACJFH.js → chunk-IPTZ5TVU.js} +7 -6
  52. package/{chunk-4RXXP6WD.js → chunk-J7KDNHUO.js} +5 -64
  53. package/{chunk-BO3YFOZR.js → chunk-KNQ5LYVZ.js} +57 -2
  54. package/{chunk-AV4Z57LV.js → chunk-KVVNC5V3.js} +2 -2
  55. package/{chunk-VKSBVRGP.js → chunk-LVCAWHI5.js} +4 -4
  56. package/{chunk-5JXRVJAC.js → chunk-N6SLQMSA.js} +6 -6
  57. package/{chunk-SQTVMYMU.js → chunk-NTZO3KX2.js} +3 -3
  58. package/{chunk-LGUQHYAL.js → chunk-O5FLGN2L.js} +3 -2
  59. package/{chunk-72COHDZR.js → chunk-OSUZKICS.js} +1600 -190
  60. package/{chunk-HIDPTO4B.js → chunk-Q2QN2RHG.js} +7 -7
  61. package/{chunk-L3JWI7WX.js → chunk-QOKAKDPE.js} +15 -11
  62. package/{chunk-4ZL2KBI7.js → chunk-RFYXK6KI.js} +1 -1
  63. package/chunk-RQSN75DW.js +1766 -0
  64. package/{chunk-RPO6WAZV.js → chunk-S3JNURSO.js} +2 -2
  65. package/{chunk-YZ2WE6CW.js → chunk-SAJSBPI2.js} +2 -2
  66. package/{chunk-WHVQA7PJ.js → chunk-SCBBGS2N.js} +23 -5
  67. package/chunk-SGSJBBKP.js +297 -0
  68. package/{chunk-FTSPVLKJ.js → chunk-TUBNQ3OF.js} +2 -2
  69. package/{chunk-BANYWEYY.js → chunk-TY3ADTX5.js} +1 -1
  70. package/chunk-UAD2WT54.js +64 -0
  71. package/{chunk-F22JQTSX.js → chunk-UEV5WVQV.js} +3 -3
  72. package/{chunk-MCX2LX27.js → chunk-UMCMW5R3.js} +51 -34
  73. package/{chunk-6L6UPZNH.js → chunk-VFDRZHPM.js} +16 -16
  74. package/{chunk-C2WF2OY7.js → chunk-W22UTILW.js} +3 -3
  75. package/{chunk-W3RZLXMA.js → chunk-WERPP2S7.js} +2 -2
  76. package/{chunk-AZ6DT2UD.js → chunk-WSUHBABG.js} +1 -1
  77. package/{chunk-3YVCM5PE.js → chunk-X3OGKR5Q.js} +4 -4
  78. package/{chunk-IERBSHMR.js → chunk-X5LRMXTS.js} +10 -10
  79. package/{chunk-DIQCV4FR.js → chunk-X665UCNM.js} +1 -1
  80. package/{chunk-HCBQVVFZ.js → chunk-X7P6EJUY.js} +4 -4
  81. package/{chunk-HHBXCRJS.js → chunk-XOJRZUPF.js} +4 -4
  82. package/{chunk-MRWGHF56.js → chunk-YDH3FDFQ.js} +12 -356
  83. package/{chunk-TNPCQNGQ.js → chunk-YEFRCO5N.js} +4 -9
  84. package/{chunk-RO2IUWZE.js → chunk-YUKTCDVN.js} +1 -1
  85. package/{chunk-Y7TGWSUN.js → chunk-YWY25N4V.js} +1 -1
  86. package/{chunk-Z7A54NFZ.js → chunk-ZDS63Y4O.js} +2 -2
  87. package/chunk-ZJ7UHBJS.js +89 -0
  88. package/{chunk-SG65C33A.js → chunk-ZLMG6NRV.js} +4 -4
  89. package/{codingSkills-BYQI6EPT.js → codingSkills-FQPCEIWL.js} +2 -2
  90. package/contentThunks-J33BZB3E.js +71 -0
  91. package/{createAgentAutomationAction-IHKV53QC.js → createAgentAutomationAction-HTMTGX6Q.js} +25 -21
  92. package/{createDialogAction-4ARDCKPP.js → createDialogAction-WYQBSN6A.js} +27 -23
  93. package/{createPageAction-GQOCPICU.js → createPageAction-ICRRK3SA.js} +27 -22
  94. package/{dbSlice-FWF5F4L7.js → dbSlice-YORO4VL4.js} +6 -6
  95. package/{deleteFile-NPZ64DFN.js → deleteFile-JYKRT7C3.js} +4 -4
  96. package/{dialogCommands-YOTCP26N.js → dialogCommands-FRSIAPKY.js} +31 -29
  97. package/{dialogSlice-NX26W623.js → dialogSlice-5KPVIAWH.js} +24 -21
  98. package/{docCreateCommands-JVAMHES4.js → docCreateCommands-DBRJMPDX.js} +30 -28
  99. package/{docDeleteCommands-LW5DWICT.js → docDeleteCommands-BCYPLWXN.js} +31 -29
  100. package/{docReadCommands-AQOZS3I5.js → docReadCommands-L5JX4Q7G.js} +30 -28
  101. package/{docStore-YAE7GYHZ.js → docStore-34NXLCEO.js} +8 -33
  102. package/{docUpdateCommands-FFGGX5RG.js → docUpdateCommands-RELG7XJD.js} +30 -28
  103. package/fetchMessages-KZQVBXKY.js +1 -1
  104. package/{getPricing-JNOCWYDH.js → getPricing-FM7TJZFV.js} +4 -4
  105. package/{handleSendMessageAction-7YKH4UBI.js → handleSendMessageAction-MEYK7RPD.js} +25 -22
  106. package/index.js +64 -64
  107. package/{machineCommands-FMMFBMCQ.js → machineCommands-YSXTOWHQ.js} +59 -54
  108. package/{machineWsRunDispatch-UODRJY63.js → machineWsRunDispatch-DNAYOPQT.js} +54 -49
  109. package/memberThunks-KVPBG4V7.js +638 -0
  110. package/{models-N4NXQ44D.js → models-CW5EL6Z7.js} +2 -2
  111. package/package.json +2 -3
  112. package/{read-J7RVVCHH.js → read-NIOV5F7W.js} +4 -4
  113. package/{readDocTool-G2WBM4IH.js → readDocTool-ULKJ5BEM.js} +1 -1
  114. package/{readlineWorkspace-GVDEA7RH.js → readlineWorkspace-KZ3LPQG2.js} +866 -377
  115. package/{removeDialogAgentAction-RMPISD42.js → removeDialogAgentAction-JGSCPML3.js} +12 -11
  116. package/{runAgentClientLoop-6NCW5AS6.js → runAgentClientLoop-O2AUHIJT.js} +46 -40
  117. package/{setDialogExtraReferencesAction-7BUTHDAL.js → setDialogExtraReferencesAction-CORU64NM.js} +9 -8
  118. package/{setPrimaryDialogAgentAction-WCYIBGZ4.js → setPrimaryDialogAgentAction-5VS2VKLZ.js} +12 -11
  119. package/{settingSlice-7NN2MI6Y.js → settingSlice-3GNGTC2T.js} +7 -7
  120. package/{skillDiscovery-COX56OBO.js → skillDiscovery-CYUCJMAG.js} +3 -3
  121. package/{spaceCommands-7MJVL4XR.js → spaceCommands-OI7RIB2T.js} +30 -28
  122. package/{streamAgentChatTurn-UAKCHWFN.js → streamAgentChatTurn-TA3PGS6C.js} +61 -54
  123. package/{switchDialogAgentAction-WGMMQHDI.js → switchDialogAgentAction-LP433X4D.js} +10 -9
  124. package/{tableCommands-P2TXJ3CF.js → tableCommands-R6WFRDYF.js} +1 -1
  125. package/{toolApiClient-B2MFXMEG.js → toolApiClient-53U4UDFF.js} +3 -2
  126. package/{tools-ROUITGAR.js → tools-6ZPQ75XA.js} +37 -32
  127. package/{tuiSummaryLlmCaller-U4EGD2SX.js → tuiSummaryLlmCaller-YKYQB4ZL.js} +17 -15
  128. package/{updateDialogTitleAction-R4M6ZXCX.js → updateDialogTitleAction-LRJ7NSOS.js} +26 -22
  129. package/chunk-EUG45QJR.js +0 -6104
  130. package/spaceSlice-JVVDCGA3.js +0 -127
  131. package/{chunk-NQ4N4IGO.js → chunk-CS6TCJ7E.js} +3 -3
@@ -4,7 +4,7 @@ import {
4
4
  refreshAntigravityOAuthToken,
5
5
  refreshOpenAiCodexToken,
6
6
  xaiRefresh
7
- } from "./chunk-3YVCM5PE.js";
7
+ } from "./chunk-X3OGKR5Q.js";
8
8
  import {
9
9
  defaultLoopbackRequest
10
10
  } from "./chunk-EADNWBAZ.js";
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-NI2BS6UD.js";
19
19
  import {
20
20
  buildLocalAgentLookupKeys
21
- } from "./chunk-OYNDYVSE.js";
21
+ } from "./chunk-B45YNDAE.js";
22
22
  import {
23
23
  LOCAL_CODEX_AGENT_ID,
24
24
  LOCAL_CODEX_AGENT_KEY,
@@ -46,17 +46,17 @@ import {
46
46
  spawnLocalBackgroundRun,
47
47
  terminateRunProcess,
48
48
  withQueueLock
49
- } from "./chunk-WHVQA7PJ.js";
49
+ } from "./chunk-SCBBGS2N.js";
50
50
  import {
51
51
  inferCaptureIntent
52
- } from "./chunk-RO2IUWZE.js";
52
+ } from "./chunk-YUKTCDVN.js";
53
53
  import {
54
54
  buildCliPrompt
55
55
  } from "./chunk-ATNTHIZI.js";
56
56
  import {
57
57
  inlineImageUrlsForCustomProvider,
58
58
  prepareTools
59
- } from "./chunk-RPO6WAZV.js";
59
+ } from "./chunk-S3JNURSO.js";
60
60
  import {
61
61
  getServerProviderSecret
62
62
  } from "./chunk-HS7MLR74.js";
@@ -65,7 +65,7 @@ import {
65
65
  isAntigravityOAuthAgent,
66
66
  readAntigravityProjectId,
67
67
  resolveAntigravityCloudCodeBaseUrl
68
- } from "./chunk-4ZL2KBI7.js";
68
+ } from "./chunk-RFYXK6KI.js";
69
69
  import {
70
70
  deleteMemoryFunctionSchema,
71
71
  readXPostFunc,
@@ -75,7 +75,7 @@ import {
75
75
  rememberMemoryFunctionSchema,
76
76
  resolveAgentRequiredPackIds,
77
77
  setTodoListFunc
78
- } from "./chunk-72COHDZR.js";
78
+ } from "./chunk-OSUZKICS.js";
79
79
  import {
80
80
  fetchWithTransientRetry,
81
81
  isTransientFetchError
@@ -98,13 +98,13 @@ import {
98
98
  prepareTokenUsageData,
99
99
  resolveBuiltinPlatformAgentConfig,
100
100
  runKeyed
101
- } from "./chunk-MCX2LX27.js";
101
+ } from "./chunk-UMCMW5R3.js";
102
102
  import {
103
103
  BUILTIN_TITLE_LLM_CONFIG
104
104
  } from "./chunk-EVBFYPDC.js";
105
105
  import {
106
106
  fetchServerSyncedCredential
107
- } from "./chunk-5JXRVJAC.js";
107
+ } from "./chunk-N6SLQMSA.js";
108
108
  import {
109
109
  require_date_fns
110
110
  } from "./chunk-M76ECQRD.js";
@@ -120,8 +120,9 @@ import {
120
120
  applySystemBuiltinSkillFilter,
121
121
  expandEnabledPacks,
122
122
  resolveEffectiveEnabledPacks
123
- } from "./chunk-LGUQHYAL.js";
123
+ } from "./chunk-O5FLGN2L.js";
124
124
  import {
125
+ DEFAULT_HYBRID_READ_TIMEOUT_MS,
125
126
  aggregateResponsesStream,
126
127
  buildLoadSkillExecutor,
127
128
  buildLocalDialogWritePlan,
@@ -131,6 +132,7 @@ import {
131
132
  codexStreamFailureStatus,
132
133
  createHybridRecordStore,
133
134
  createLocalWorkspaceToolExecutors,
135
+ evaluateFileWritePolicy,
134
136
  executeLocalToolWithPolicy,
135
137
  executeOpenAiCompatibleChatCompletion,
136
138
  filterRetainedLedgerRecords,
@@ -143,7 +145,7 @@ import {
143
145
  parseSyncServersEnv,
144
146
  resolveOpenAiCompatibleProviderConfig,
145
147
  summarizeToolArguments
146
- } from "./chunk-S3HB4CQY.js";
148
+ } from "./chunk-GKNGRBE6.js";
147
149
  import {
148
150
  buildPlatformChatCompletionRequest,
149
151
  canUsePlatformChatProvider,
@@ -155,23 +157,23 @@ import {
155
157
  resolvePlatformChatProviderConfig,
156
158
  shouldUsePlatformChatProvider,
157
159
  streamSseDataValues
158
- } from "./chunk-XB7ACJFH.js";
160
+ } from "./chunk-IPTZ5TVU.js";
159
161
  import {
160
162
  resolveAgentRuntimeConfigFromRecord,
161
163
  resolveHistoricalToolContentCap
162
- } from "./chunk-VKSBVRGP.js";
164
+ } from "./chunk-LVCAWHI5.js";
163
165
  import {
164
166
  convertMessagesToResponsesInput,
165
167
  toResponsesTools
166
- } from "./chunk-6BYAXNH5.js";
168
+ } from "./chunk-3QOCS5IF.js";
167
169
  import {
168
170
  resolvePlatformAuthToken
169
- } from "./chunk-JBL24PK6.js";
171
+ } from "./chunk-DEIGUGP6.js";
170
172
  import {
171
173
  buildNoloWorkspaceOpenAiTools,
172
174
  parseNoloWorkspaceToolArguments,
173
175
  resolveRuntimeToolSurfaceForAgent
174
- } from "./chunk-TNPCQNGQ.js";
176
+ } from "./chunk-YEFRCO5N.js";
175
177
  import {
176
178
  mergeAvailabilityDeadline,
177
179
  resolveAvailabilityAction,
@@ -183,25 +185,25 @@ import {
183
185
  } from "./chunk-2MBTWINN.js";
184
186
  import {
185
187
  clipCompactText
186
- } from "./chunk-HR5XDXYM.js";
188
+ } from "./chunk-G5SQVIFZ.js";
189
+ import {
190
+ isAdaptiveThinkingModelId
191
+ } from "./chunk-KNQ5LYVZ.js";
192
+ import {
193
+ compactWhitespace
194
+ } from "./chunk-DWLEOOGR.js";
187
195
  import {
188
196
  createFileCredentialBroker,
189
197
  resolveCurrentRunRuntimeToolPolicy,
190
198
  resolveLocalWorkspaceExecutorOptionsFromPolicy,
191
199
  resolveRequestedRuntimeToolNames
192
- } from "./chunk-NQ4N4IGO.js";
200
+ } from "./chunk-CS6TCJ7E.js";
193
201
  import {
194
202
  createOAuthTokenStore,
195
203
  isTokenExpired,
196
204
  readOAuthCredential,
197
205
  resolveFreshAccessToken
198
206
  } from "./chunk-FD36SCCD.js";
199
- import {
200
- isAdaptiveThinkingModelId
201
- } from "./chunk-BO3YFOZR.js";
202
- import {
203
- compactWhitespace
204
- } from "./chunk-DWLEOOGR.js";
205
207
  import {
206
208
  toErrorMessage
207
209
  } from "./chunk-HNMXYYJR.js";
@@ -229,7 +231,7 @@ import {
229
231
  } from "./chunk-QSJ3HFEF.js";
230
232
  import {
231
233
  isSystemBuiltinTrustedAgentKey
232
- } from "./chunk-2JYSSXLY.js";
234
+ } from "./chunk-EJFW7TRP.js";
233
235
  import {
234
236
  isRecord
235
237
  } from "./chunk-KUG52IAP.js";
@@ -472,8 +474,12 @@ var STRINGS = {
472
474
  zh: "[nolo] \u5F53\u524D agent \u4F3C\u4E4E\u989D\u5EA6/\u901F\u7387\u53D7\u9650\uFF08429\uFF09\u3002\n\u53EF\u4EE5\u7528 /agent \u5207\u6362\u5230\u5176\u4ED6 agent \u540E\u7EE7\u7EED\uFF0C\u540C\u4E00\u5BF9\u8BDD\u4F1A\u4FDD\u7559\u4E0A\u4E0B\u6587\u3002"
473
475
  },
474
476
  balanceExhaustedHint: {
475
- en: '[nolo] Insufficient balance. Your message is saved in this dialog \u2014 top up, then send again or say "continue".',
476
- zh: "[nolo] \u4F59\u989D\u4E0D\u8DB3\u3002\u4F60\u521A\u53D1\u7684\u8BDD\u5DF2\u4FDD\u5B58\u5728\u5F53\u524D\u5BF9\u8BDD\u91CC\u2014\u2014\u5145\u503C\u540E\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\u5373\u53EF\uFF0C\u4E0D\u4F1A\u4E22\u4E0A\u4E0B\u6587\u3002"
477
+ en: '[nolo] Your message is saved in this dialog \u2014 top up, then send again or say "continue" to pick up where you left off.',
478
+ zh: "[nolo] \u4F60\u521A\u53D1\u7684\u8BDD\u5DF2\u4FDD\u5B58\u5728\u5F53\u524D\u5BF9\u8BDD\u91CC\u2014\u2014\u5145\u503C\u540E\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\u5373\u53EF\u63A5\u7740\u804A\uFF0C\u4E0D\u4F1A\u4E22\u4E0A\u4E0B\u6587\u3002"
479
+ },
480
+ balanceInsufficientReason: {
481
+ en: "Insufficient balance: requires > {required}, current balance {current}.",
482
+ zh: "\u4F59\u989D\u4E0D\u8DB3\uFF1A\u9700\u8981\u4F59\u989D > {required}\uFF0C\u5F53\u524D {current}\u3002"
477
483
  },
478
484
  dialogPreservedHint: {
479
485
  en: '[nolo] This turn failed, but the dialog is kept. Send another message (or say "continue") to keep going in the same conversation.',
@@ -527,6 +533,11 @@ var STRINGS = {
527
533
  en: "Draft cleared.",
528
534
  zh: "\u8F93\u5165\u8349\u7A3F\u5DF2\u6E05\u7A7A\u3002"
529
535
  },
536
+ // 空草稿按 Backspace 逐个撤销附件(composer 附件条)。
537
+ attachmentRemovedHint: {
538
+ en: "Removed attachment {0}, {1} remaining",
539
+ zh: "\u5DF2\u79FB\u9664\u9644\u4EF6 {0}\uFF0C\u5269\u4F59 {1} \u5F20"
540
+ },
530
541
  historyNoToken: {
531
542
  en: "History requires an auth token. Run `nolo login` or set AUTH_TOKEN.",
532
543
  zh: "\u67E5\u770B\u5386\u53F2\u5BF9\u8BDD\u9700\u8981\u767B\u5F55\u51ED\u8BC1\u3002\u8BF7\u8FD0\u884C `nolo login` \u6216\u8BBE\u7F6E AUTH_TOKEN\u3002"
@@ -594,6 +605,10 @@ var STRINGS = {
594
605
  // --- Tool trace copy ------------------------------------------------------
595
606
  // The compact trace shows only status, never timing or output size: a line
596
607
  // count told the user nothing actionable and the ms figure read as noise.
608
+ thinkingTraceLine: {
609
+ en: "\u273B Thought for {0}",
610
+ zh: "\u273B \u601D\u8003 {0}"
611
+ },
597
612
  toolNeedsAction: {
598
613
  en: "needs action",
599
614
  zh: "\u5F85\u786E\u8BA4"
@@ -635,6 +650,12 @@ var STRINGS = {
635
650
  en: "Log tail:",
636
651
  zh: "\u65E5\u5FD7\u5C3E\u90E8\uFF1A"
637
652
  },
653
+ // Normal-mode safe projection: the raw errorMessage/logLines of a failed run
654
+ // stay in pro/verbose; normal mode names the failure and points at pro.
655
+ runDiagnosticsHidden: {
656
+ en: "run failed \u2014 full diagnostics in pro mode",
657
+ zh: "\u8FD0\u884C\u5931\u8D25\u2014\u2014\u5B8C\u6574\u8BCA\u65AD\u89C1 pro \u6A21\u5F0F"
658
+ },
638
659
  runsListLabel: {
639
660
  en: "Runs ({0})",
640
661
  zh: "\u8FD0\u884C ({0})"
@@ -790,10 +811,6 @@ var STRINGS = {
790
811
  en: "runtime",
791
812
  zh: "\u8FD0\u884C\u65F6"
792
813
  },
793
- contextFieldTools: {
794
- en: "tools",
795
- zh: "\u5DE5\u5177"
796
- },
797
814
  contextFieldServer: {
798
815
  en: "server",
799
816
  zh: "\u670D\u52A1\u7AEF"
@@ -829,9 +846,8 @@ var STRINGS = {
829
846
  " /new Clear screen and start a fresh dialog",
830
847
  " /compact Compact current dialog and fork a new one",
831
848
  " /context Show workspace context and next actions",
849
+ " /cd <path> Change the working directory (takes effect on the next turn)",
832
850
  " /runtime <mode> Use auto, local, or server runtime",
833
- " /tools <mode> Control tool trace: hide, compact, verbose",
834
- " /thinking <mode> Show or hide live model reasoning",
835
851
  " /switch Pick an agent interactively (\u2191\u2193, Enter)",
836
852
  " /switch list List agents as text",
837
853
  " /switch <name> Switch directly by name, alias, or key (alias: /agent)",
@@ -841,7 +857,7 @@ var STRINGS = {
841
857
  " /lang <zh|en> Switch interface language",
842
858
  ' /copy [all] Copy the last reply (or the full conversation with "all") to the clipboard',
843
859
  " /mouse <on|off> Toggle mouse mode (off = drag to select text)",
844
- " /auto <on|off> Toggle permission auto-approve (skip destructive-shell & external-file confirms)",
860
+ " /auto <on|off> Toggle permission auto-approve (skip destructive-shell, external-file & file-write confirms)",
845
861
  " /math <on|off> Toggle math formula rendering (Unicode transcription)",
846
862
  " /altscreen <on|off> Toggle the terminal alternate screen (default on; off shares shell scrollback)",
847
863
  " Shift+drag Select text natively even while mouse mode is on (terminal bypass)",
@@ -868,9 +884,8 @@ var STRINGS = {
868
884
  " /new \u6E05\u5C4F\u5E76\u5F00\u59CB\u65B0\u5BF9\u8BDD",
869
885
  " /compact \u538B\u7F29\u5F53\u524D\u5BF9\u8BDD\u5E76\u5206\u53C9\u51FA\u65B0\u5BF9\u8BDD",
870
886
  " /context \u67E5\u770B\u5DE5\u4F5C\u533A\u4E0A\u4E0B\u6587\u4E0E\u540E\u7EED\u64CD\u4F5C",
887
+ " /cd <path> \u5207\u6362\u5DE5\u4F5C\u76EE\u5F55\uFF08\u4E0B\u4E2A turn \u751F\u6548\uFF09",
871
888
  " /runtime <mode> \u5207\u6362 runtime\uFF1Aauto\u3001local\u3001server",
872
- " /tools <mode> \u5DE5\u5177\u8F68\u8FF9\u663E\u793A\uFF1Ahide\u3001compact\u3001verbose",
873
- " /thinking <mode> \u663E\u793A\u6216\u9690\u85CF\u6A21\u578B\u7684\u5B9E\u65F6\u601D\u8003\u8FC7\u7A0B",
874
889
  " /switch \u4EA4\u4E92\u5F0F\u9009\u62E9 agent\uFF08\u2191\u2193 \u79FB\u52A8\uFF0CEnter \u786E\u8BA4\uFF09",
875
890
  " /switch list \u4EE5\u6587\u672C\u5217\u51FA\u5168\u90E8 agent",
876
891
  " /switch <name> \u6309\u540D\u79F0\u3001\u522B\u540D\u6216 key \u76F4\u63A5\u5207\u6362\uFF08\u522B\u540D\uFF1A/agent\uFF09",
@@ -880,7 +895,7 @@ var STRINGS = {
880
895
  " /lang <zh|en> \u5207\u6362\u754C\u9762\u8BED\u8A00",
881
896
  " /copy [all] \u590D\u5236\u6700\u540E\u4E00\u6761\u56DE\u590D\u5230\u526A\u8D34\u677F\uFF08\u52A0 all \u590D\u5236\u5B8C\u6574\u5BF9\u8BDD\uFF09",
882
897
  " /mouse <on|off> \u5207\u6362\u9F20\u6807\u6A21\u5F0F\uFF08off \u540E\u53EF\u76F4\u63A5\u62D6\u9009\u6587\u672C\uFF09",
883
- " /auto <on|off> \u5207\u6362\u6743\u9650\u81EA\u52A8\u5316\uFF08\u81EA\u52A8\u653E\u884C\u7834\u574F\u6027 shell \u4E0E\u5916\u90E8\u6587\u4EF6\u786E\u8BA4\uFF09",
898
+ " /auto <on|off> \u5207\u6362\u6743\u9650\u81EA\u52A8\u5316\uFF08\u81EA\u52A8\u653E\u884C\u7834\u574F\u6027 shell\u3001\u5916\u90E8\u6587\u4EF6\u4E0E\u5199\u6587\u4EF6\u786E\u8BA4\uFF09",
884
899
  " /math <on|off> \u5207\u6362\u6570\u5B66\u516C\u5F0F\u6E32\u67D3\uFF08Unicode \u8F6C\u5199\uFF09",
885
900
  " /altscreen <on|off> \u5207\u6362\u7EC8\u7AEF\u5907\u7528\u5C4F\uFF08\u9ED8\u8BA4 on\uFF1Boff \u6539\u4E3A\u4E0E shell \u5171\u7528\u56DE\u6EDA\uFF09",
886
901
  " Shift+\u62D6\u62FD \u9F20\u6807\u6A21\u5F0F\u5F00\u542F\u65F6\u4E5F\u53EF\u539F\u751F\u9009\u4E2D\u6587\u672C\uFF08\u7EC8\u7AEF\u7ED5\u8FC7\u4FEE\u9970\u952E\uFF09",
@@ -911,21 +926,10 @@ var STRINGS = {
911
926
  },
912
927
  runtimeUsage: { en: "Usage: /runtime <auto|local|server>", zh: "\u7528\u6CD5\uFF1A/runtime <auto|local|server>" },
913
928
  runtimeSet: { en: "Runtime: {0}", zh: "\u8FD0\u884C\u6A21\u5F0F\uFF1A{0}" },
914
- toolsCurrent: {
915
- en: "Tool display: {0} (normal | pro | hide | verbose)",
916
- zh: "\u5DE5\u5177\u663E\u793A\uFF1A{0}\uFF08\u666E\u901A normal | \u4E13\u4E1A pro | hide | verbose\uFF09"
917
- },
918
- toolsUsage: { en: "Usage: /tools <normal|pro|hide|verbose>", zh: "\u7528\u6CD5\uFF1A/tools <normal|pro|hide|verbose>" },
919
- toolsSet: { en: "Tool display: {0}", zh: "\u5DE5\u5177\u663E\u793A\uFF1A{0}" },
920
- thinkingCurrent: {
921
- en: "Thinking display: {0} (show | hide)",
922
- zh: "\u601D\u8003\u663E\u793A\uFF1A{0}\uFF08show | hide\uFF09"
929
+ displayFixedHint: {
930
+ en: "The TUI ships a single built-in tool display \u2014 no configuration needed. Thinking process visibility is still controlled independently via NOLO_CLI_THINKING=show|hide (applied on restart).",
931
+ zh: "TUI \u53EA\u6709\u4E00\u5957\u5185\u7F6E\u5DE5\u5177\u663E\u793A\uFF0C\u65E0\u9700\u914D\u7F6E\u3002\u601D\u8003\u8FC7\u7A0B\u4ECD\u53EF\u7528 NOLO_CLI_THINKING=show|hide \u72EC\u7ACB\u63A7\u5236\uFF08\u91CD\u542F\u751F\u6548\uFF09\u3002"
923
932
  },
924
- thinkingUsage: {
925
- en: "Usage: /thinking <show|hide>",
926
- zh: "\u7528\u6CD5\uFF1A/thinking <show|hide>"
927
- },
928
- thinkingSet: { en: "Thinking display: {0}", zh: "\u601D\u8003\u663E\u793A\uFF1A{0}" },
929
933
  tasksRunning: { en: "Running processes ({0}):", zh: "\u8FD0\u884C\u4E2D\u7684\u8FDB\u7A0B\uFF08{0}\uFF09\uFF1A" },
930
934
  tasksStopped: { en: "Stopped/exited ({0}):", zh: "\u5DF2\u505C\u6B62/\u5DF2\u9000\u51FA\uFF08{0}\uFF09\uFF1A" },
931
935
  tasksNone: { en: "No processes.", zh: "\u6CA1\u6709\u8FD0\u884C\u4E2D\u7684\u8FDB\u7A0B\u3002" },
@@ -998,14 +1002,18 @@ Use /switch, /switch list, /switch minimax-m3, or a full agent key.`,
998
1002
  },
999
1003
  themeSwitched: { en: "Switched to theme: {0}", zh: "\u5DF2\u5207\u6362\u5230\u4E3B\u9898\uFF1A{0}" },
1000
1004
  themeUnknown: { en: "Unknown theme: {0}. Available themes: {1}", zh: "\u672A\u77E5\u4E3B\u9898\uFF1A{0}\u3002\u53EF\u7528\u4E3B\u9898\uFF1A{1}" },
1001
- densityCurrent: {
1002
- en: "Current density: {0}\nUsage: /density <cozy|spacious>",
1003
- zh: "\u5F53\u524D\u5BC6\u5EA6\uFF1A{0}\n\u7528\u6CD5\uFF1A/density <cozy|spacious>"
1004
- },
1005
- densitySwitched: { en: "Switched to layout density: {0}", zh: "\u5DF2\u5207\u6362\u5230\u5E03\u5C40\u5BC6\u5EA6\uFF1A{0}" },
1006
- densityUnknown: {
1007
- en: "Unknown density: {0}. Use 'cozy' or 'spacious'.",
1008
- zh: "\u672A\u77E5\u5BC6\u5EA6\uFF1A{0}\u3002\u8BF7\u4F7F\u7528 cozy \u6216 spacious\u3002"
1005
+ cdUsage: {
1006
+ en: "Usage: /cd <path> (relative, absolute, ~, or -; takes effect on the next turn)",
1007
+ zh: "\u7528\u6CD5\uFF1A/cd <path>\uFF08\u76F8\u5BF9\u3001\u7EDD\u5BF9\u3001~ \u6216 - \u8DEF\u5F84\uFF1B\u4E0B\u4E2A turn \u751F\u6548\uFF09"
1008
+ },
1009
+ cdCurrent: { en: "Current directory: {0}", zh: "\u5F53\u524D\u76EE\u5F55\uFF1A{0}" },
1010
+ cdSwitched: { en: "Working directory: {0}", zh: "\u5DE5\u4F5C\u76EE\u5F55\uFF1A{0}" },
1011
+ cdNotFound: { en: "Directory not found: {0}", zh: "\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A{0}" },
1012
+ cdNotDir: { en: "Not a directory: {0}", zh: "\u4E0D\u662F\u76EE\u5F55\uFF1A{0}" },
1013
+ cdNoPrevious: { en: "No previous directory.", zh: "\u6CA1\u6709\u4E0A\u4E00\u4E2A\u76EE\u5F55\u3002" },
1014
+ cdSwitchedMessage: {
1015
+ en: "Working directory changed: {0} \u2192 {1}. Subsequent tool execution and file operations use the new directory.",
1016
+ zh: "\u5DE5\u4F5C\u76EE\u5F55\u5DF2\u5207\u6362\uFF1A{0} \u2192 {1}\u3002\u540E\u7EED\u5DE5\u5177\u6267\u884C\u4E0E\u6587\u4EF6\u64CD\u4F5C\u4EE5\u65B0\u76EE\u5F55\u4E3A\u51C6\u3002"
1009
1017
  },
1010
1018
  docAttachUsage: { en: "Usage: /doc attach <doc>", zh: "\u7528\u6CD5\uFF1A/doc attach <doc>" },
1011
1019
  docList: { en: "Attached docs: {0}", zh: "\u5DF2\u6302\u8F7D\u6587\u6863\uFF1A{0}" },
@@ -1065,6 +1073,7 @@ Use /switch, /switch list, /switch minimax-m3, or a full agent key.`,
1065
1073
  en: "Press Enter to run it now. Follow any prompts below, or Ctrl+C to cancel.",
1066
1074
  zh: "\u6309 Enter \u7ACB\u5373\u6267\u884C\uFF0C\u6309\u4E0B\u65B9\u63D0\u793A\u64CD\u4F5C\uFF0C\u6216\u6309 Ctrl+C \u53D6\u6D88\u3002"
1067
1075
  },
1076
+ actionGateConfirmHint: { en: "Enter=approve, n=cancel (or type y/yes).", zh: "Enter=\u6279\u51C6\uFF0Cn=\u53D6\u6D88\uFF08\u4E5F\u53EF\u8F93\u5165 y/yes\uFF09\u3002" },
1068
1077
  actionGateInteractiveTitle: {
1069
1078
  en: "This command requires an interactive terminal.",
1070
1079
  zh: "\u8BE5\u547D\u4EE4\u9700\u8981\u4EA4\u4E92\u5F0F\u7EC8\u7AEF"
@@ -1090,8 +1099,9 @@ Use /switch, /switch list, /switch minimax-m3, or a full agent key.`,
1090
1099
  function t(key, ...params) {
1091
1100
  const text = STRINGS[key][currentLocale];
1092
1101
  if (params.length === 0) return text;
1093
- return text.replace(/\{(\d+)\}/g, (match, index) => {
1094
- const replacement = params[Number(index)];
1102
+ return text.replace(/\{(\d+|required|current)\}/g, (match, name) => {
1103
+ const index = name === "required" ? 0 : name === "current" ? 1 : Number(name);
1104
+ const replacement = params[index];
1095
1105
  return replacement === void 0 ? match : replacement;
1096
1106
  });
1097
1107
  }
@@ -7775,6 +7785,7 @@ async function streamCursorChat(messages, options) {
7775
7785
  const execCtx = {
7776
7786
  tools: buildMcpToolDefinitions(options.tools),
7777
7787
  executeTool: options.executeTool,
7788
+ ...options.onActionGate ? { onActionGate: options.onActionGate } : {},
7778
7789
  ...options.searchWorkspace ? { searchWorkspace: options.searchWorkspace } : {},
7779
7790
  ...options.listWorkspaceEntries ? { listWorkspaceEntries: options.listWorkspaceEntries } : {},
7780
7791
  toolCalls,
@@ -8318,6 +8329,23 @@ function decodeMcpArgValue(value) {
8318
8329
  }
8319
8330
  }
8320
8331
  }
8332
+ async function executeCursorTool(ctx, call) {
8333
+ if ((call.name === "writeFile" || call.name === "editFile") && ctx.onActionGate) {
8334
+ let path = "the requested file";
8335
+ try {
8336
+ const parsed = JSON.parse(call.arguments);
8337
+ if (typeof parsed.path === "string" && parsed.path.trim()) path = parsed.path.trim();
8338
+ } catch {
8339
+ }
8340
+ const policy = evaluateFileWritePolicy({ tool: call.name, path, sessionApproved: false });
8341
+ if (policy.permissionDecision !== "ask") return ctx.executeTool ? ctx.executeTool(call) : { content: "tool execution unavailable" };
8342
+ const gate = { ...policy.permissionRequest, kind: "confirm", toolName: call.name, toolCallId: call.id };
8343
+ const result = await ctx.onActionGate(gate);
8344
+ if (result?.metadata?.actionGateResult?.status !== "completed") return result ?? { content: `${call.name} cancelled: file write confirmation was not approved.`, metadata: { cancelled: true, actionGateResult: { gateId: gate.id, status: "cancelled" } } };
8345
+ ctx.onActionGate = void 0;
8346
+ }
8347
+ return ctx.executeTool ? ctx.executeTool(call) : { content: "tool execution unavailable" };
8348
+ }
8321
8349
  async function handleExecServerMessage(execMsg, h2Request, ctx) {
8322
8350
  const execCase = execMsg.message?.case;
8323
8351
  if (execCase === "requestContextArgs") {
@@ -8358,7 +8386,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
8358
8386
  });
8359
8387
  const startedAt = Date.now();
8360
8388
  try {
8361
- const toolResult = await ctx.executeTool({
8389
+ const toolResult = await executeCursorTool(ctx, {
8362
8390
  id: args.toolCallId,
8363
8391
  name: "readFile",
8364
8392
  arguments: toolCallArgs
@@ -8428,7 +8456,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
8428
8456
  });
8429
8457
  const startedAt = Date.now();
8430
8458
  try {
8431
- const toolResult = await ctx.executeTool({
8459
+ const toolResult = await executeCursorTool(ctx, {
8432
8460
  id: args.toolCallId,
8433
8461
  name: "execShell",
8434
8462
  arguments: toolCallArgs
@@ -8586,7 +8614,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
8586
8614
  });
8587
8615
  const startedAt = Date.now();
8588
8616
  try {
8589
- const toolResult = await ctx.executeTool({
8617
+ const toolResult = await executeCursorTool(ctx, {
8590
8618
  id: args.toolCallId,
8591
8619
  name: "writeFile",
8592
8620
  arguments: toolCallArgs
@@ -8648,7 +8676,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
8648
8676
  });
8649
8677
  const startedAt = Date.now();
8650
8678
  try {
8651
- const toolResult = await ctx.executeTool({
8679
+ const toolResult = await executeCursorTool(ctx, {
8652
8680
  id: args.toolCallId,
8653
8681
  name: "deleteFile",
8654
8682
  arguments: toolCallArgs
@@ -8767,7 +8795,7 @@ async function handleExecServerMessage(execMsg, h2Request, ctx) {
8767
8795
  });
8768
8796
  const startedAt = Date.now();
8769
8797
  try {
8770
- const toolResult = await ctx.executeTool({
8798
+ const toolResult = await executeCursorTool(ctx, {
8771
8799
  id: args.toolCallId,
8772
8800
  name: toolName,
8773
8801
  arguments: toolCallArgs
@@ -8876,6 +8904,7 @@ function createCursorProvider(config) {
8876
8904
  ...options?.onTextDelta ? { onTextDelta: options.onTextDelta } : {},
8877
8905
  ...options?.onReasoningDelta ? { onReasoningDelta: options.onReasoningDelta } : {},
8878
8906
  ...options?.onToolEvent ? { onToolEvent: options.onToolEvent } : {},
8907
+ ...options?.onActionGate ? { onActionGate: options.onActionGate } : {},
8879
8908
  ...typeof options?.toolEventRound === "number" ? { toolEventRound: options.toolEventRound } : {}
8880
8909
  });
8881
8910
  }
@@ -11350,6 +11379,15 @@ function resolveFallbackServers(env) {
11350
11379
  function resolveAuthToken(env) {
11351
11380
  return resolvePlatformAuthToken(env);
11352
11381
  }
11382
+ function resolveHybridReadTimeoutMs(env = process.env) {
11383
+ const raw = env.NOLO_HYBRID_READ_TIMEOUT_MS?.trim();
11384
+ if (!raw) return DEFAULT_HYBRID_READ_TIMEOUT_MS;
11385
+ const parsed = Number(raw);
11386
+ if (!Number.isFinite(parsed) || parsed < 0) {
11387
+ return DEFAULT_HYBRID_READ_TIMEOUT_MS;
11388
+ }
11389
+ return parsed;
11390
+ }
11353
11391
  function createCliHybridRecordStore(deps) {
11354
11392
  return createHybridRecordStore({
11355
11393
  db: deps.db,
@@ -11358,7 +11396,8 @@ function createCliHybridRecordStore(deps) {
11358
11396
  ),
11359
11397
  fallbackServers: resolveFallbackServers(deps.env),
11360
11398
  authToken: resolveAuthToken(deps.env),
11361
- fetchImpl: deps.fetchImpl
11399
+ fetchImpl: deps.fetchImpl,
11400
+ requestTimeoutMs: resolveHybridReadTimeoutMs(deps.env)
11362
11401
  });
11363
11402
  }
11364
11403
 
@@ -11385,9 +11424,10 @@ async function generateLocalDialogTitle(input) {
11385
11424
  const content = m.content.length > 500 ? `${m.content.slice(0, 500)}...` : m.content;
11386
11425
  return { role: m.role, content };
11387
11426
  });
11388
- while (visibleMessages.length > 1 && JSON.stringify(visibleMessages).length > 4e3) {
11427
+ while (visibleMessages.length > 1 && transcriptLength(visibleMessages) > 4e3) {
11389
11428
  visibleMessages.shift();
11390
11429
  }
11430
+ const compactTranscript = buildTitleTranscript(visibleMessages);
11391
11431
  if (visibleMessages.length === 0) {
11392
11432
  return { title: fallbackTitle, source: "fallback" };
11393
11433
  }
@@ -11403,11 +11443,11 @@ async function generateLocalDialogTitle(input) {
11403
11443
  messages: [
11404
11444
  {
11405
11445
  role: "system",
11406
- content: BUILTIN_TITLE_LLM_CONFIG.prompt
11446
+ content: buildTitleSystemPrompt(input.existingTitle)
11407
11447
  },
11408
11448
  {
11409
11449
  role: "user",
11410
- content: JSON.stringify(visibleMessages)
11450
+ content: compactTranscript
11411
11451
  }
11412
11452
  ],
11413
11453
  stream: false
@@ -11420,7 +11460,9 @@ async function generateLocalDialogTitle(input) {
11420
11460
  }
11421
11461
  const patchedBody = {
11422
11462
  ...parsedBody,
11423
- reasoning_effort: "low",
11463
+ // response_format 与 reasoning_effort 同发会被 RunInfra 400 拒绝,
11464
+ // 标题路径统一走 json mode(跳过 thinking,实测 completion 个位数 tokens)。
11465
+ response_format: { type: "json_object" },
11424
11466
  max_tokens: 512
11425
11467
  };
11426
11468
  const res = await input.fetchImpl(request.url, {
@@ -11433,7 +11475,9 @@ async function generateLocalDialogTitle(input) {
11433
11475
  const data = safeParseJson(raw);
11434
11476
  if (data) {
11435
11477
  const parsed = input.parseResponse({ providerConfig, data });
11436
- const generated = normalizeDialogTitle(parsed.content);
11478
+ const generated = normalizeDialogTitle(
11479
+ extractTitleFromLlmContent(parsed.content)
11480
+ );
11437
11481
  if (generated) {
11438
11482
  return { title: generated, source: "llm" };
11439
11483
  }
@@ -11479,11 +11523,12 @@ async function generateLocalDialogTitle(input) {
11479
11523
  body: JSON.stringify({
11480
11524
  model: directConfig.model || input.agentConfig?.model || BUILTIN_TITLE_LLM_CONFIG.model,
11481
11525
  messages: [
11482
- { role: "system", content: BUILTIN_TITLE_LLM_CONFIG.prompt },
11483
- { role: "user", content: JSON.stringify(visibleMessages) }
11526
+ { role: "system", content: buildTitleSystemPrompt(input.existingTitle) },
11527
+ { role: "user", content: compactTranscript }
11484
11528
  ],
11485
- // reasoning_effort/max_tokens 优化标题延迟与消耗;注意部分严格 OpenAI 兼容服务端(如某些 vLLM 部署)若拒绝未知参数会降级到 fallback。
11486
- reasoning_effort: "low",
11529
+ // 标题路径统一 json mode(跳过 thinking);response_format
11530
+ // reasoning_effort 同发会被 RunInfra 400 拒绝,故不发 reasoning_effort。
11531
+ response_format: { type: "json_object" },
11487
11532
  max_tokens: 512,
11488
11533
  stream: false
11489
11534
  }),
@@ -11493,7 +11538,9 @@ async function generateLocalDialogTitle(input) {
11493
11538
  const raw = await res.text().catch(() => "");
11494
11539
  const data = safeParseJson(raw);
11495
11540
  const rawContent = data?.choices?.[0]?.message?.content ?? "";
11496
- const generated = normalizeDialogTitle(rawContent);
11541
+ const generated = normalizeDialogTitle(
11542
+ extractTitleFromLlmContent(rawContent)
11543
+ );
11497
11544
  if (generated) {
11498
11545
  return { title: generated, source: "llm" };
11499
11546
  }
@@ -11504,6 +11551,33 @@ async function generateLocalDialogTitle(input) {
11504
11551
  }
11505
11552
  return { title: fallbackTitle, source: "fallback" };
11506
11553
  }
11554
+ function buildTitleTranscript(messages) {
11555
+ return messages.map((message) => `${message.role === "user" ? "User" : "Assistant"}: ${message.content}`).join("\n");
11556
+ }
11557
+ function transcriptLength(messages) {
11558
+ return buildTitleTranscript(messages).length;
11559
+ }
11560
+ function buildTitleSystemPrompt(existingTitle) {
11561
+ const title = existingTitle?.trim();
11562
+ const base = `${BUILTIN_TITLE_LLM_CONFIG.prompt}
11563
+ \u8F93\u51FA\u683C\u5F0F\uFF1A\u8FD4\u56DE JSON \u5BF9\u8C61 {"title": "<\u6807\u9898>"}\uFF0C\u9664\u6B64\u4E4B\u5916\u4E0D\u8981\u6709\u4EFB\u4F55\u5B57\u7B26\u3002`;
11564
+ return title ? `${base}
11565
+ \u5F53\u524D\u6807\u9898\uFF1A${title}\u3002\u5982\u679C\u5BF9\u8BDD\u4ECD\u5728\u8BA8\u8BBA\u540C\u4E00\u4E3B\u9898\uFF0C\u5FC5\u987B\u539F\u6837\u8F93\u51FA\u5F53\u524D\u6807\u9898\uFF0C\u4E0D\u8981\u6539\u5199\uFF1B\u53EA\u6709\u5F53\u5BF9\u8BDD\u660E\u786E\u8F6C\u5411\u4E86\u4E0D\u540C\u4E3B\u9898\u65F6\u624D\u751F\u6210\u65B0\u6807\u9898\u3002` : base;
11566
+ }
11567
+ function extractTitleFromLlmContent(raw) {
11568
+ if (raw.trim().startsWith("{")) {
11569
+ try {
11570
+ const parsed = JSON.parse(raw);
11571
+ if (typeof parsed?.title === "string" && parsed.title.trim()) {
11572
+ return parsed.title;
11573
+ }
11574
+ return "";
11575
+ } catch {
11576
+ return raw;
11577
+ }
11578
+ }
11579
+ return raw;
11580
+ }
11507
11581
  function extractText(content) {
11508
11582
  if (typeof content === "string") return content;
11509
11583
  if (Array.isArray(content)) {
@@ -11575,6 +11649,7 @@ function createLocalDialogTitleGenerator(deps, ctx) {
11575
11649
  return async (input) => {
11576
11650
  const result = await generateLocalDialogTitle({
11577
11651
  messages: input.messages,
11652
+ existingTitle: input.existingTitle,
11578
11653
  env: deps.env,
11579
11654
  fetchImpl: async (url, init) => fetchWithTransientRetry(
11580
11655
  deps.fetchImpl ?? fetch,
@@ -11725,7 +11800,11 @@ async function writeDialog(args) {
11725
11800
  if (needsTitleUpdate && args.titleGenerator) {
11726
11801
  const rawLastUserText = extractLastUserText(args.input.messages);
11727
11802
  const fallbackTitle = buildDialogFallbackTitleFromUserInput(rawLastUserText) || "Local agent run";
11728
- titlePromise = args.titleGenerator({ messages: args.input.messages, fallbackTitle }).catch(() => null);
11803
+ titlePromise = args.titleGenerator({
11804
+ messages: args.input.messages,
11805
+ fallbackTitle,
11806
+ existingTitle: existingTitle || void 0
11807
+ }).catch(() => null);
11729
11808
  }
11730
11809
  const plan = buildLocalDialogWritePlan({
11731
11810
  input: args.input,
@@ -12191,17 +12270,22 @@ function createCliLocalRuntimeAdapter(deps) {
12191
12270
  executeTool: async (call, opts) => {
12192
12271
  const contextualCall = opts?.runtimeContext ? { ...call, runtimeContext: opts.runtimeContext } : call;
12193
12272
  let injectedCall = contextualCall;
12194
- if (contextualCall.name === "startAgentRun" && deps.parentDialogId && typeof contextualCall.arguments === "string") {
12273
+ let spawnedWithoutParent = false;
12274
+ if (contextualCall.name === "startAgentRun" && typeof contextualCall.arguments === "string") {
12195
12275
  try {
12196
12276
  const args = JSON.parse(contextualCall.arguments);
12197
12277
  if (!args.parentDialogId) {
12198
- injectedCall = {
12199
- ...contextualCall,
12200
- arguments: JSON.stringify({
12201
- ...args,
12202
- parentDialogId: deps.parentDialogId
12203
- })
12204
- };
12278
+ if (deps.parentDialogId) {
12279
+ injectedCall = {
12280
+ ...contextualCall,
12281
+ arguments: JSON.stringify({
12282
+ ...args,
12283
+ parentDialogId: deps.parentDialogId
12284
+ })
12285
+ };
12286
+ } else {
12287
+ spawnedWithoutParent = true;
12288
+ }
12205
12289
  }
12206
12290
  } catch {
12207
12291
  }
@@ -12220,6 +12304,15 @@ function createCliLocalRuntimeAdapter(deps) {
12220
12304
  detachMs: resolveExecShellDetachMs(deps.env),
12221
12305
  ...deps.confirmDestructiveAction ? { confirmDestructiveAction: deps.confirmDestructiveAction } : {}
12222
12306
  });
12307
+ if (spawnedWithoutParent && deps.onBackgroundRunSpawned) {
12308
+ try {
12309
+ const payload = JSON.parse(result?.content ?? "");
12310
+ if (payload && typeof payload.runId === "string" && payload.runId) {
12311
+ deps.onBackgroundRunSpawned(payload.runId);
12312
+ }
12313
+ } catch {
12314
+ }
12315
+ }
12223
12316
  return {
12224
12317
  ...result,
12225
12318
  metadata: {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-OYNDYVSE.js";
4
+ } from "./chunk-B45YNDAE.js";
5
5
  import {
6
6
  resolveCliAgentKeyInput
7
7
  } from "./chunk-EKLRRZIN.js";