nolo-cli 0.54.0-alpha.2 → 0.54.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 (133) hide show
  1. package/{_executeModel-ANY4SIAS.js → _executeModel-OPTKYHJA.js} +48 -42
  2. package/{action-Q4W5JPI5.js → action-ORXWW2ZG.js} +8 -8
  3. package/{addContentAction-O25HFR37.js → addContentAction-53BZ34AE.js} +8 -7
  4. package/{addDialogAgentAction-GH7AUPPB.js → addDialogAgentAction-JRYUS54Y.js} +10 -9
  5. package/{agentDeleteCommand-JWIKNWWI.js → agentDeleteCommand-FJIWU2BS.js} +30 -28
  6. package/{agentEmailCommands-PL22BEU5.js → agentEmailCommands-CE32L43B.js} +57 -52
  7. package/{agentListCommands-6NR7AQEK.js → agentListCommands-VJNKULIK.js} +42 -33
  8. package/{agentMachineCommands-TASPU6OA.js → agentMachineCommands-HCJ3WQXL.js} +30 -28
  9. package/{agentRecordCommands-Z64TA63M.js → agentRecordCommands-QFWERED4.js} +55 -50
  10. package/{agentRunCommand-4QJQLPRW.js → agentRunCommand-G3GQMUNN.js} +65 -53
  11. package/{agentRunControl-4GHHSXFZ.js → agentRunControl-INKFDXDA.js} +3 -1
  12. package/{agentRuntimeLocal-PCJJ56J2.js → agentRuntimeLocal-K327ELSL.js} +30 -26
  13. package/{agentSlice-KYLDUSNN.js → agentSlice-ODKF4J6M.js} +8 -8
  14. package/{agentSuperviseCommands-VB6BUS5H.js → agentSuperviseCommands-5AR3DKNN.js} +2 -2
  15. package/{appDeleteCommands-WLHMJAVT.js → appDeleteCommands-XUXMFDI4.js} +31 -29
  16. package/{appDeployCommands-CKON7N2E.js → appDeployCommands-37F4GPCU.js} +31 -29
  17. package/{appDeployStatusCommands-PXRLDASH.js → appDeployStatusCommands-WSPU7TUK.js} +31 -29
  18. package/{appGetCommands-RAB5RM4M.js → appGetCommands-YLOBA3EM.js} +31 -29
  19. package/{appListCommands-GU57FB62.js → appListCommands-UD62R5ME.js} +31 -29
  20. package/{authCommand-QOPOEYEK.js → authCommand-OK6HLHGS.js} +13 -13
  21. package/{authCommands-SBQVTD6V.js → authCommands-2DUIUEMT.js} +2 -2
  22. package/{chatQueueReduxAdapter-5O2WLITN.js → chatQueueReduxAdapter-TV2TUOQS.js} +26 -23
  23. package/{chunk-7CH6U3FL.js → chunk-2GRGFCF6.js} +2 -4
  24. package/{chunk-T27IEBNQ.js → chunk-2QDDKFG5.js} +74 -1
  25. package/{chunk-VULELK4T.js → chunk-2WBFJHQA.js} +4 -26
  26. package/{chunk-IKTHA3JH.js → chunk-3LKZRP7E.js} +2 -2
  27. package/{chunk-INXBNYCG.js → chunk-3Y2K5O2R.js} +64 -6
  28. package/{chunk-VRZIH5JO.js → chunk-3ZTR7ZO4.js} +1 -1
  29. package/{chunk-GV35EHNA.js → chunk-5FCIPEKT.js} +262 -96
  30. package/{chunk-RTLJUGQH.js → chunk-5UAYZEXO.js} +2 -2
  31. package/{chunk-TI5BCZCH.js → chunk-6COJEAYH.js} +32 -101
  32. package/{chunk-Y7LNKP32.js → chunk-6HDYSFLO.js} +4 -6
  33. package/chunk-6IGD47IC.js +19 -0
  34. package/chunk-6YTOJY35.js +352 -0
  35. package/{chunk-6FGXGFAH.js → chunk-75MSWWUE.js} +1 -1
  36. package/{chunk-3Z3DXZBD.js → chunk-7FAS3NEF.js} +16 -16
  37. package/{chunk-AV6KQCM5.js → chunk-7NYDJAQ7.js} +19 -14
  38. package/{chunk-CVT7L2WZ.js → chunk-A65UV3M5.js} +4 -4
  39. package/{chunk-7APQB6R6.js → chunk-AUVFJGPC.js} +3 -3
  40. package/{chunk-H4RYESI6.js → chunk-BBTN4NQD.js} +4 -4
  41. package/{chunk-757BGY6Y.js → chunk-BG7J6Y5X.js} +1 -1
  42. package/chunk-BY2FF2C4.js +526 -0
  43. package/{chunk-FA4SY4F5.js → chunk-BYEJ7K2Z.js} +1 -1
  44. package/chunk-BYXBJQAS.js +0 -0
  45. package/{chunk-3AOLVADY.js → chunk-DVINR3PL.js} +1 -1
  46. package/{chunk-UITMHBVK.js → chunk-EA5OYZVD.js} +1 -1
  47. package/{chunk-4NN3EK7H.js → chunk-EICIFHVS.js} +1 -1
  48. package/chunk-EJE33XNR.js +19059 -0
  49. package/{chunk-6SZ52ORL.js → chunk-FJHMLRDQ.js} +9 -9
  50. package/{chunk-RU5D3B22.js → chunk-GRFK2XP4.js} +2 -2
  51. package/{chunk-J3UALFHL.js → chunk-HJTAGT3W.js} +1 -1
  52. package/{chunk-WL3UOGYO.js → chunk-HPW5MNDQ.js} +38 -98
  53. package/{chunk-H2G6JXTR.js → chunk-HQUORJTM.js} +1 -1
  54. package/{chunk-OYNDYVSE.js → chunk-JON2PHYT.js} +1 -1
  55. package/{chunk-7K5VMB4Q.js → chunk-JXIP6ZWH.js} +7 -7
  56. package/{chunk-KUUTWU4I.js → chunk-K4NISKOR.js} +46 -8
  57. package/{chunk-SP3DPVBH.js → chunk-KLIBF3BY.js} +2 -2
  58. package/chunk-LRGKOI5Y.js +297 -0
  59. package/{chunk-LN3OQJGG.js → chunk-MLEZPE3U.js} +2 -2
  60. package/{chunk-FGEYVPPR.js → chunk-MYMBBB6Q.js} +5 -64
  61. package/{chunk-VRJUIUIY.js → chunk-N4JKMCY3.js} +2 -2
  62. package/{chunk-U5Z7LFZF.js → chunk-NFLA6GSU.js} +4 -4
  63. package/{chunk-SVEUG45B.js → chunk-NHRQCXIQ.js} +0 -24
  64. package/{chunk-56W233KG.js → chunk-NJUQBYFJ.js} +3 -1
  65. package/{chunk-Q24S4NDF.js → chunk-Q4XZVZPN.js} +1 -1
  66. package/{chunk-UW4INMD2.js → chunk-RHMDMTDK.js} +2 -2
  67. package/{chunk-MFI4FGHX.js → chunk-SAJSBPI2.js} +1 -1
  68. package/{chunk-WHVQA7PJ.js → chunk-SSXTSPSG.js} +27 -6
  69. package/{chunk-2BWU4ORW.js → chunk-SUEIAK5N.js} +1 -1
  70. package/{chunk-3QJTD6DO.js → chunk-SVC3GGUA.js} +5 -5
  71. package/{chunk-QDHZCAH3.js → chunk-SVDMVX4G.js} +118 -2
  72. package/{chunk-GBADO3SM.js → chunk-SWJGJMTW.js} +1 -1
  73. package/{chunk-DQLYEGP7.js → chunk-SYYUU7EV.js} +2 -2
  74. package/{chunk-U2A47SVI.js → chunk-TC6P4NDR.js} +7 -7
  75. package/{chunk-V4KZGLOI.js → chunk-TR4DXUYX.js} +1983 -447
  76. package/{chunk-BANYWEYY.js → chunk-TY3ADTX5.js} +1 -1
  77. package/chunk-UAD2WT54.js +64 -0
  78. package/{chunk-PAHILFNT.js → chunk-UGBHDMHI.js} +4 -4
  79. package/{chunk-6FQ2552G.js → chunk-UOWXD4VN.js} +799 -956
  80. package/{chunk-5WADL4O7.js → chunk-UR66XPVF.js} +3 -3
  81. package/{chunk-6BYAXNH5.js → chunk-VZMUOPYG.js} +12 -2
  82. package/{chunk-LA4IDAK7.js → chunk-WQHGJHAL.js} +440 -2981
  83. package/{chunk-GLGD2JGY.js → chunk-XIJZOCSP.js} +7 -7
  84. package/{chunk-BJLYCOZK.js → chunk-YBFJQC2M.js} +93 -776
  85. package/{chunk-MRWGHF56.js → chunk-YDH3FDFQ.js} +12 -356
  86. package/{chunk-32I5RVMY.js → chunk-YLCUU3WM.js} +3 -3
  87. package/{chunk-D3JQPONH.js → chunk-YQBXOHE6.js} +1 -1
  88. package/chunk-ZJ7UHBJS.js +89 -0
  89. package/{chunk-TNPCQNGQ.js → chunk-ZVOHVJI3.js} +4 -9
  90. package/contentThunks-KNI6VXLT.js +71 -0
  91. package/{createAgentAutomationAction-UJLNFFFC.js → createAgentAutomationAction-OK4L33KF.js} +27 -23
  92. package/{createDialogAction-TJCX6GUE.js → createDialogAction-JDSMY4AY.js} +28 -24
  93. package/{createPageAction-N3IYABHV.js → createPageAction-T7RA3HCG.js} +29 -24
  94. package/{dbSlice-D5CNGWPD.js → dbSlice-TVX6SN2T.js} +6 -6
  95. package/{deleteFile-44TUM34Y.js → deleteFile-JYKRT7C3.js} +3 -3
  96. package/{dialogCommands-35M6RBAC.js → dialogCommands-UQZYWOOV.js} +32 -30
  97. package/{dialogSlice-KO7ADD7H.js → dialogSlice-TYW2G7IL.js} +26 -23
  98. package/{docCreateCommands-VXHZWQ3P.js → docCreateCommands-OA6HZBWO.js} +34 -32
  99. package/{docDeleteCommands-4WFAJR6A.js → docDeleteCommands-KBB3YQI2.js} +31 -29
  100. package/{docReadCommands-OYREEFAR.js → docReadCommands-ZLMFVC67.js} +30 -28
  101. package/{docStore-5BU76DFK.js → docStore-2URPBVCS.js} +8 -33
  102. package/{docUpdateCommands-A7QERSME.js → docUpdateCommands-HMH5KUON.js} +34 -32
  103. package/{fetchMessages-KZQVBXKY.js → fetchMessages-DRABNDPZ.js} +3 -3
  104. package/{getPricing-HAU62AFM.js → getPricing-RFOPUWHY.js} +4 -4
  105. package/{handleSendMessageAction-OSGQJQ45.js → handleSendMessageAction-GO53TY7U.js} +28 -25
  106. package/index.js +56 -56
  107. package/{localDialogRead-NQ33HBSI.js → localDialogRead-PUQKFI73.js} +1 -1
  108. package/{machineCommands-J43U3TX5.js → machineCommands-RK6L7ZWL.js} +59 -54
  109. package/{machineWsRunDispatch-Z2Z6STXZ.js → machineWsRunDispatch-3X64DW2Z.js} +54 -49
  110. package/memberThunks-THZYZFSN.js +638 -0
  111. package/{models-4QF4BJVY.js → models-JVKUEER5.js} +2 -2
  112. package/package.json +1 -1
  113. package/{read-RGNPI5H2.js → read-K4JU4MQC.js} +3 -3
  114. package/{readDocTool-6ESWKTXD.js → readDocTool-LQGR6FUN.js} +1 -1
  115. package/{readlineWorkspace-YRPV6JPN.js → readlineWorkspace-XUFJV3RS.js} +604 -263
  116. package/{removeDialogAgentAction-JYT73FU2.js → removeDialogAgentAction-ECHCFB7N.js} +12 -11
  117. package/{runAgentClientLoop-5YM5WMAY.js → runAgentClientLoop-24GQ2AW6.js} +46 -40
  118. package/{setDialogExtraReferencesAction-D564LMYQ.js → setDialogExtraReferencesAction-KCVJNGMB.js} +9 -8
  119. package/{setPrimaryDialogAgentAction-ACY3BLYA.js → setPrimaryDialogAgentAction-VDOBOMKC.js} +12 -11
  120. package/{settingSlice-MKI3MNZJ.js → settingSlice-VR2IJSXC.js} +7 -7
  121. package/{skillDiscovery-GPUDHDTZ.js → skillDiscovery-2QTZINON.js} +3 -3
  122. package/{spaceCommands-MY26V52L.js → spaceCommands-S5YJJXL7.js} +30 -28
  123. package/{streamAgentChatTurn-XV5X5TNQ.js → streamAgentChatTurn-QHKP3ABO.js} +77 -64
  124. package/{switchDialogAgentAction-CJ5H6SAR.js → switchDialogAgentAction-5L4UP7VI.js} +10 -9
  125. package/{toolApiClient-B2MFXMEG.js → toolApiClient-53U4UDFF.js} +3 -2
  126. package/{tools-MIMELA2Y.js → tools-SSXSTC3O.js} +37 -32
  127. package/{tuiSummaryLlmCaller-XJ5BKNNS.js → tuiSummaryLlmCaller-URFJHFC5.js} +17 -15
  128. package/{updateDialogTitleAction-EIZUSWHR.js → updateDialogTitleAction-YFYAEW3T.js} +28 -24
  129. package/chunk-6BGAQ3KR.js +0 -7081
  130. package/chunk-YBV6QJKM.js +0 -441
  131. package/spaceSlice-JUIXC365.js +0 -127
  132. package/{chunk-NQ4N4IGO.js → chunk-CS6TCJ7E.js} +3 -3
  133. package/{chunk-PYKV6FSC.js → chunk-XOJRZUPF.js} +3 -3
@@ -4,7 +4,7 @@ import {
4
4
  refreshAntigravityOAuthToken,
5
5
  refreshOpenAiCodexToken,
6
6
  xaiRefresh
7
- } from "./chunk-U5Z7LFZF.js";
7
+ } from "./chunk-NFLA6GSU.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-JON2PHYT.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-SSXTSPSG.js";
50
50
  import {
51
51
  inferCaptureIntent
52
- } from "./chunk-4NN3EK7H.js";
52
+ } from "./chunk-EICIFHVS.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-UW4INMD2.js";
59
+ } from "./chunk-RHMDMTDK.js";
60
60
  import {
61
61
  getServerProviderSecret
62
62
  } from "./chunk-HS7MLR74.js";
@@ -65,9 +65,13 @@ import {
65
65
  isAntigravityOAuthAgent,
66
66
  readAntigravityProjectId,
67
67
  resolveAntigravityCloudCodeBaseUrl
68
- } from "./chunk-757BGY6Y.js";
68
+ } from "./chunk-BG7J6Y5X.js";
69
69
  import {
70
+ CONTROL_AGENT_RUN_ACTIONS,
71
+ buildControlAgentRunFunctionSchema,
72
+ buildStartAgentRunFunctionSchema,
70
73
  deleteMemoryFunctionSchema,
74
+ queryMemoryFunctionSchema,
71
75
  readXPostFunc,
72
76
  readXPostFunctionSchema,
73
77
  readXhsProfileFunc,
@@ -75,7 +79,7 @@ import {
75
79
  rememberMemoryFunctionSchema,
76
80
  resolveAgentRequiredPackIds,
77
81
  setTodoListFunc
78
- } from "./chunk-V4KZGLOI.js";
82
+ } from "./chunk-TR4DXUYX.js";
79
83
  import {
80
84
  fetchWithTransientRetry,
81
85
  isTransientFetchError
@@ -98,13 +102,13 @@ import {
98
102
  prepareTokenUsageData,
99
103
  resolveBuiltinPlatformAgentConfig,
100
104
  runKeyed
101
- } from "./chunk-BJLYCOZK.js";
105
+ } from "./chunk-YBFJQC2M.js";
102
106
  import {
103
107
  BUILTIN_TITLE_LLM_CONFIG
104
108
  } from "./chunk-EVBFYPDC.js";
105
109
  import {
106
110
  fetchServerSyncedCredential
107
- } from "./chunk-U2A47SVI.js";
111
+ } from "./chunk-TC6P4NDR.js";
108
112
  import {
109
113
  require_date_fns
110
114
  } from "./chunk-M76ECQRD.js";
@@ -122,6 +126,7 @@ import {
122
126
  resolveEffectiveEnabledPacks
123
127
  } from "./chunk-O5FLGN2L.js";
124
128
  import {
129
+ DEFAULT_HYBRID_READ_TIMEOUT_MS,
125
130
  aggregateResponsesStream,
126
131
  buildLoadSkillExecutor,
127
132
  buildLocalDialogWritePlan,
@@ -144,10 +149,11 @@ import {
144
149
  parseSyncServersEnv,
145
150
  resolveOpenAiCompatibleProviderConfig,
146
151
  summarizeToolArguments
147
- } from "./chunk-6BGAQ3KR.js";
152
+ } from "./chunk-EJE33XNR.js";
148
153
  import {
149
154
  buildPlatformChatCompletionRequest,
150
155
  canUsePlatformChatProvider,
156
+ collectStablePromptPrefix,
151
157
  hasDirectOpenAiCompatibleProvider,
152
158
  parsePlatformChatCompletionData,
153
159
  parsePlatformChatCompletionResponse,
@@ -155,24 +161,25 @@ import {
155
161
  readSseDataValues,
156
162
  resolvePlatformChatProviderConfig,
157
163
  shouldUsePlatformChatProvider,
164
+ stablePromptCacheKey,
158
165
  streamSseDataValues
159
- } from "./chunk-INXBNYCG.js";
166
+ } from "./chunk-3Y2K5O2R.js";
160
167
  import {
161
168
  resolveAgentRuntimeConfigFromRecord,
162
169
  resolveHistoricalToolContentCap
163
- } from "./chunk-CVT7L2WZ.js";
170
+ } from "./chunk-A65UV3M5.js";
164
171
  import {
165
172
  convertMessagesToResponsesInput,
166
173
  toResponsesTools
167
- } from "./chunk-6BYAXNH5.js";
174
+ } from "./chunk-VZMUOPYG.js";
168
175
  import {
169
176
  resolvePlatformAuthToken
170
- } from "./chunk-SP3DPVBH.js";
177
+ } from "./chunk-KLIBF3BY.js";
171
178
  import {
172
179
  buildNoloWorkspaceOpenAiTools,
173
180
  parseNoloWorkspaceToolArguments,
174
181
  resolveRuntimeToolSurfaceForAgent
175
- } from "./chunk-TNPCQNGQ.js";
182
+ } from "./chunk-ZVOHVJI3.js";
176
183
  import {
177
184
  mergeAvailabilityDeadline,
178
185
  resolveAvailabilityAction,
@@ -184,25 +191,25 @@ import {
184
191
  } from "./chunk-2MBTWINN.js";
185
192
  import {
186
193
  clipCompactText
187
- } from "./chunk-H4RYESI6.js";
194
+ } from "./chunk-BBTN4NQD.js";
195
+ import {
196
+ isAdaptiveThinkingModelId
197
+ } from "./chunk-SVDMVX4G.js";
198
+ import {
199
+ compactWhitespace
200
+ } from "./chunk-DWLEOOGR.js";
188
201
  import {
189
202
  createFileCredentialBroker,
190
203
  resolveCurrentRunRuntimeToolPolicy,
191
204
  resolveLocalWorkspaceExecutorOptionsFromPolicy,
192
205
  resolveRequestedRuntimeToolNames
193
- } from "./chunk-NQ4N4IGO.js";
206
+ } from "./chunk-CS6TCJ7E.js";
194
207
  import {
195
208
  createOAuthTokenStore,
196
209
  isTokenExpired,
197
210
  readOAuthCredential,
198
211
  resolveFreshAccessToken
199
212
  } from "./chunk-FD36SCCD.js";
200
- import {
201
- isAdaptiveThinkingModelId
202
- } from "./chunk-QDHZCAH3.js";
203
- import {
204
- compactWhitespace
205
- } from "./chunk-DWLEOOGR.js";
206
213
  import {
207
214
  toErrorMessage
208
215
  } from "./chunk-HNMXYYJR.js";
@@ -221,7 +228,7 @@ import {
221
228
  createTokenStatsKey,
222
229
  createUserKey,
223
230
  dialogMessageRange
224
- } from "./chunk-SVEUG45B.js";
231
+ } from "./chunk-NHRQCXIQ.js";
225
232
  import {
226
233
  asTrimmedNonEmptyStringArray
227
234
  } from "./chunk-I42VC5KR.js";
@@ -230,7 +237,7 @@ import {
230
237
  } from "./chunk-QSJ3HFEF.js";
231
238
  import {
232
239
  isSystemBuiltinTrustedAgentKey
233
- } from "./chunk-VULELK4T.js";
240
+ } from "./chunk-2WBFJHQA.js";
234
241
  import {
235
242
  isRecord
236
243
  } from "./chunk-KUG52IAP.js";
@@ -305,6 +312,12 @@ function isSubtaskRun(env) {
305
312
  const value = env.NOLO_AGENT_RUN_CHILD;
306
313
  return typeof value === "string" && value.length > 0 && value !== "0";
307
314
  }
315
+ var RUN_WAKE_CHANNEL_ENV = "NOLO_RUN_WAKE";
316
+ function hasRunWakeChannel(env) {
317
+ if (!env) return false;
318
+ const value = env[RUN_WAKE_CHANNEL_ENV];
319
+ return typeof value === "string" && value.length > 0 && value !== "0";
320
+ }
308
321
  function filterToolNamesForRunKind(toolNames, isSubtask) {
309
322
  if (!isSubtask) return [...toolNames];
310
323
  return toolNames.filter((name) => !SUBTASK_REMOVED_TOOL_NAMES.has(name));
@@ -651,10 +664,6 @@ var STRINGS = {
651
664
  },
652
665
  // Normal-mode safe projection: the raw errorMessage/logLines of a failed run
653
666
  // stay in pro/verbose; normal mode names the failure and points at pro.
654
- runDiagnosticsHidden: {
655
- en: "run failed \u2014 full diagnostics in pro mode",
656
- zh: "\u8FD0\u884C\u5931\u8D25\u2014\u2014\u5B8C\u6574\u8BCA\u65AD\u89C1 pro \u6A21\u5F0F"
657
- },
658
667
  runsListLabel: {
659
668
  en: "Runs ({0})",
660
669
  zh: "\u8FD0\u884C ({0})"
@@ -810,10 +819,6 @@ var STRINGS = {
810
819
  en: "runtime",
811
820
  zh: "\u8FD0\u884C\u65F6"
812
821
  },
813
- contextFieldTools: {
814
- en: "tools",
815
- zh: "\u5DE5\u5177"
816
- },
817
822
  contextFieldServer: {
818
823
  en: "server",
819
824
  zh: "\u670D\u52A1\u7AEF"
@@ -930,8 +935,8 @@ var STRINGS = {
930
935
  runtimeUsage: { en: "Usage: /runtime <auto|local|server>", zh: "\u7528\u6CD5\uFF1A/runtime <auto|local|server>" },
931
936
  runtimeSet: { en: "Runtime: {0}", zh: "\u8FD0\u884C\u6A21\u5F0F\uFF1A{0}" },
932
937
  displayFixedHint: {
933
- en: "The TUI now ships a single built-in display default, no switching needed. Power users can fall back to environment variables (applied on restart): NOLO_CLI_TOOLS=normal|pro|verbose|hide controls the tool trace, NOLO_CLI_THINKING=show|hide controls reasoning visibility.",
934
- zh: "TUI \u73B0\u5728\u53EA\u6709\u4E00\u5957\u5185\u7F6E\u9ED8\u8BA4\u663E\u793A\uFF0C\u65E0\u9700\u5207\u6362\u3002\u4E13\u4E1A\u7EC6\u8282\u53EF\u7528\u73AF\u5883\u53D8\u91CF\u515C\u5E95\uFF08\u91CD\u542F\u751F\u6548\uFF09\uFF1ANOLO_CLI_TOOLS=normal|pro|verbose|hide \u63A7\u5236\u5DE5\u5177\u8F68\u8FF9\uFF0CNOLO_CLI_THINKING=show|hide \u63A7\u5236\u601D\u8003\u8FC7\u7A0B\u3002"
938
+ 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).",
939
+ 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"
935
940
  },
936
941
  tasksRunning: { en: "Running processes ({0}):", zh: "\u8FD0\u884C\u4E2D\u7684\u8FDB\u7A0B\uFF08{0}\uFF09\uFF1A" },
937
942
  tasksStopped: { en: "Stopped/exited ({0}):", zh: "\u5DF2\u505C\u6B62/\u5DF2\u9000\u51FA\uFF08{0}\uFF09\uFF1A" },
@@ -1564,11 +1569,32 @@ function buildOpenAiTools(args) {
1564
1569
  }),
1565
1570
  ...buildServerPlatformOpenAiTools({ toolNames: args.toolNames }),
1566
1571
  ...buildNoloWorkspaceOpenAiTools({ toolNames: args.toolNames }),
1567
- ...prepareTools(
1568
- ["startAgentRun", "controlAgentRun"].filter((name) => toolNameSet.has(name))
1569
- )
1572
+ ...buildOrchestrationOpenAiTools({
1573
+ toolNameSet,
1574
+ env: args.env
1575
+ })
1570
1576
  ];
1571
1577
  }
1578
+ function buildOrchestrationOpenAiTools(args) {
1579
+ const names = ["startAgentRun", "controlAgentRun"].filter(
1580
+ (name) => args.toolNameSet.has(name)
1581
+ );
1582
+ if (names.length === 0) return [];
1583
+ const waitCapableActions = CONTROL_AGENT_RUN_ACTIONS.filter(
1584
+ (action) => action !== "wait"
1585
+ );
1586
+ const controlSchema = hasRunWakeChannel(args.env) ? buildControlAgentRunFunctionSchema({ actions: waitCapableActions }) : buildControlAgentRunFunctionSchema();
1587
+ const startSchema = buildStartAgentRunFunctionSchema({ supportsWait: false });
1588
+ return prepareTools(names).map((tool) => {
1589
+ if (tool?.function?.name === "controlAgentRun") {
1590
+ return { ...tool, function: controlSchema };
1591
+ }
1592
+ if (tool?.function?.name === "startAgentRun") {
1593
+ return { ...tool, function: startSchema };
1594
+ }
1595
+ return tool;
1596
+ });
1597
+ }
1572
1598
  var CLI_DEFAULT_TOOLS = ["exa_search", "fetchWebpage", "ask_user"];
1573
1599
  function addDefaultCliCoreTools(toolNames, env) {
1574
1600
  const declaredOnly = env && shouldUseDeclaredOnlyLocalWorkspaceTools(env);
@@ -1685,6 +1711,12 @@ function buildServerPlatformOpenAiTools(args) {
1685
1711
  function: rememberMemoryFunctionSchema
1686
1712
  }
1687
1713
  ] : [],
1714
+ ...toolNameSet.has("queryMemory") ? [
1715
+ {
1716
+ type: "function",
1717
+ function: queryMemoryFunctionSchema
1718
+ }
1719
+ ] : [],
1688
1720
  ...toolNameSet.has("deleteMemory") ? [
1689
1721
  {
1690
1722
  type: "function",
@@ -1750,7 +1782,8 @@ var resolveAnthropicOAuthTransport = async (ctx) => {
1750
1782
  });
1751
1783
  await recordLocalAvailability(result.status, result.body);
1752
1784
  if (result.status < 200 || result.status >= 300) {
1753
- const errMsg = result.body?.error && typeof result.body.error === "object" && typeof result.body.error.message === "string" ? result.body.error.message : JSON.stringify(result.body);
1785
+ const errorObj = result.body?.error;
1786
+ const errMsg = typeof errorObj?.message === "string" ? errorObj.message : JSON.stringify(result.body);
1754
1787
  throw new Error(
1755
1788
  `local Claude OAuth provider failed: HTTP ${result.status} ${errMsg}`
1756
1789
  );
@@ -1812,6 +1845,10 @@ var WIRE_PROFILES = {
1812
1845
  // The UI labels its effort variants (Low/Medium/High), but the literal
1813
1846
  // -medium/-high ids return 404 from streamGenerateContent.
1814
1847
  "gemini-3.7-flash-tiered": { modelEnum: "MODEL_PLACEHOLDER_M301", maxOutputTokens: 65536 },
1848
+ // Gemini 3.8 Flash 沿用 3.7 的 tiered 兼容策略:仓库内暂无 Antigravity discovery
1849
+ // 证据确认 3.8 的 wire modelEnum,禁止虚构,先只声明同档输出上限;enum 待
1850
+ // discovery 证据到位后补齐。
1851
+ "gemini-3.8-flash-tiered": { maxOutputTokens: 65536 },
1815
1852
  "gemini-3.6-flash-low": { maxOutputTokens: 65536 },
1816
1853
  "gemini-3.6-flash-medium": { maxOutputTokens: 65536 },
1817
1854
  "gemini-3.6-flash-high": { maxOutputTokens: 65536 },
@@ -1837,6 +1874,10 @@ function resolveAntigravityWireModel(logicalModelId) {
1837
1874
  const wireModelId = "gemini-3.7-flash-tiered";
1838
1875
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
1839
1876
  }
1877
+ if (lower === "gemini-3.8-flash" || ["gemini-3.8-flash-low", "gemini-3.8-flash-medium", "gemini-3.8-flash-high"].includes(lower)) {
1878
+ const wireModelId = "gemini-3.8-flash-tiered";
1879
+ return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
1880
+ }
1840
1881
  if (lower === "gemini-3.6-flash") {
1841
1882
  const wireModelId = "gemini-3.6-flash-low";
1842
1883
  return { wireModelId, profile: WIRE_PROFILES[wireModelId] };
@@ -1853,8 +1894,19 @@ function resolveAntigravityWireModel(logicalModelId) {
1853
1894
 
1854
1895
  // packages/agent-runtime/geminiNativeShared.ts
1855
1896
  var SKIP_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
1897
+ function resolveGeminiModelQuirks(modelId) {
1898
+ const lower = modelId.toLowerCase();
1899
+ const isGemini3 = lower.includes("gemini-3");
1900
+ const isStrictSignatureModel = lower.includes("gemini-3.5") || lower.includes("flash-preview");
1901
+ const isClaude = lower.includes("claude");
1902
+ return {
1903
+ requiresThoughtSignature: isGemini3,
1904
+ allowsThoughtSignatureSentinel: isGemini3 && !isStrictSignatureModel,
1905
+ isClaudeCrossModel: isClaude
1906
+ };
1907
+ }
1856
1908
  function isGemini3Model(modelId) {
1857
- return modelId.includes("gemini-3");
1909
+ return resolveGeminiModelQuirks(modelId).requiresThoughtSignature;
1858
1910
  }
1859
1911
  function messageText(content) {
1860
1912
  if (typeof content === "string") return content;
@@ -2049,10 +2101,15 @@ function applyGeminiChunk(chunk, state, options) {
2049
2101
  const prompt = typeof meta.promptTokenCount === "number" ? meta.promptTokenCount : 0;
2050
2102
  const candidates2 = typeof meta.candidatesTokenCount === "number" ? meta.candidatesTokenCount : 0;
2051
2103
  const total = typeof meta.totalTokenCount === "number" ? meta.totalTokenCount : prompt + candidates2;
2104
+ const cached = typeof meta.cachedContentTokenCount === "number" && Number.isFinite(meta.cachedContentTokenCount) ? (
2105
+ // cached ⊆ prompt;对畸形上游防御性钳位,避免 cache_read > input 破坏归一化与计费
2106
+ Math.min(Math.max(0, Math.floor(meta.cachedContentTokenCount)), prompt)
2107
+ ) : 0;
2052
2108
  state.usage = {
2053
2109
  prompt_tokens: prompt,
2054
2110
  completion_tokens: candidates2,
2055
- total_tokens: total
2111
+ total_tokens: total,
2112
+ ...cached > 0 ? { cache_read_input_tokens: cached } : {}
2056
2113
  };
2057
2114
  }
2058
2115
  const candidates = Array.isArray(response.candidates) ? response.candidates : [];
@@ -2165,9 +2222,10 @@ function buildCloudCodeAssistPayload(args) {
2165
2222
  const logicalModel = asOptionalTrimmedString(args.openAiBody.model) ?? asOptionalTrimmedString(args.agentConfig.model) ?? "gemini-3.1-pro";
2166
2223
  const { wireModelId: model, profile } = resolveAntigravityWireModel(logicalModel);
2167
2224
  const rawMessages = Array.isArray(args.openAiBody.messages) ? args.openAiBody.messages : [];
2168
- const isClaude = model.toLowerCase().includes("claude");
2225
+ const quirks = resolveGeminiModelQuirks(model);
2226
+ const isClaude = quirks.isClaudeCrossModel;
2169
2227
  const { contents, systemTexts } = convertOpenAiMessagesToGemini(rawMessages, {
2170
- attachSkipThoughtSignature: isGemini3Model(model)
2228
+ attachSkipThoughtSignature: quirks.allowsThoughtSignatureSentinel
2171
2229
  });
2172
2230
  if (contents.length === 0) {
2173
2231
  throw new Error("Antigravity Cloud Code Assist request has no user/model contents.");
@@ -2612,31 +2670,6 @@ function collectInstructions(messages, agentPrompt) {
2612
2670
  }
2613
2671
  return systemTexts.join("\n\n");
2614
2672
  }
2615
- function collectStableInstructions(messages, fallbackPrompt) {
2616
- const systemTexts = [];
2617
- if (fallbackPrompt?.trim()) systemTexts.push(fallbackPrompt.trim());
2618
- for (const raw of messages) {
2619
- if (!raw || typeof raw !== "object") continue;
2620
- const message = raw;
2621
- const role = String(message.role ?? "");
2622
- if (role !== "system" && role !== "developer") continue;
2623
- if (typeof message.content === "string") {
2624
- const boundary = Number(message.stable_prefix_chars);
2625
- const text = Number.isFinite(boundary) && boundary > 0 ? message.content.slice(0, boundary) : message.content;
2626
- if (text.trim()) systemTexts.push(text.trim());
2627
- }
2628
- }
2629
- return systemTexts.join("\n\n");
2630
- }
2631
- function stablePromptCacheKey(parts) {
2632
- const value = JSON.stringify(parts);
2633
- let hash = 2166136261;
2634
- for (let index = 0; index < value.length; index += 1) {
2635
- hash ^= value.charCodeAt(index);
2636
- hash = Math.imul(hash, 16777619) >>> 0;
2637
- }
2638
- return `nolo-codex-${hash.toString(16).padStart(8, "0")}`;
2639
- }
2640
2673
  function convertMessagesToCodexInput(messages) {
2641
2674
  return convertMessagesToResponsesInput(messages).map((item) => {
2642
2675
  if (item.type !== "reasoning") return item;
@@ -2657,7 +2690,7 @@ function buildCodexRequestBody(args, identity = createCodexRequestIdentity()) {
2657
2690
  });
2658
2691
  const input = convertMessagesToCodexInput(nonSystem);
2659
2692
  const instructions = collectInstructions(rawMessages, args.agentConfig.prompt);
2660
- const stableInstructions = collectStableInstructions(rawMessages, args.agentConfig.prompt);
2693
+ const stableInstructions = collectStablePromptPrefix(rawMessages, args.agentConfig.prompt);
2661
2694
  const model = asOptionalTrimmedString(args.openAiBody.model) ?? asOptionalTrimmedString(args.agentConfig.model) ?? "gpt-5.5";
2662
2695
  const tools = toResponsesTools(
2663
2696
  Array.isArray(args.openAiBody.tools) ? args.openAiBody.tools : void 0
@@ -2669,7 +2702,7 @@ function buildCodexRequestBody(args, identity = createCodexRequestIdentity()) {
2669
2702
  store: false,
2670
2703
  // Keep routing stable across turns and request UUIDs. Growing input/history
2671
2704
  // is intentionally excluded; only stable request-prefix material belongs.
2672
- prompt_cache_key: stablePromptCacheKey([model, stableInstructions, tools ?? []]),
2705
+ prompt_cache_key: stablePromptCacheKey([model, stableInstructions, tools ?? []], "nolo-codex"),
2673
2706
  client_metadata: identity.clientMetadata
2674
2707
  };
2675
2708
  if (instructions) body.instructions = instructions;
@@ -2817,7 +2850,8 @@ var resolveCodexOAuthTransport = async (ctx) => {
2817
2850
  });
2818
2851
  await recordLocalAvailability(result.status, result.body);
2819
2852
  if (result.status < 200 || result.status >= 300) {
2820
- const errMsg = result.body?.error && typeof result.body.error === "object" && typeof result.body.error.message === "string" ? result.body.error.message : JSON.stringify(result.body);
2853
+ const errorObj = result.body?.error;
2854
+ const errMsg = typeof errorObj?.message === "string" ? errorObj.message : JSON.stringify(result.body);
2821
2855
  throw new Error(
2822
2856
  `local Codex OAuth provider failed: HTTP ${result.status} ${errMsg}`
2823
2857
  );
@@ -2837,6 +2871,8 @@ var resolveCodexOAuthTransport = async (ctx) => {
2837
2871
  });
2838
2872
  return {
2839
2873
  content,
2874
+ model: agentConfig.model || "gpt-5.6-sol",
2875
+ provider: "openai",
2840
2876
  ...tool_calls ? { tool_calls } : {},
2841
2877
  // fetchCodexResponsesCompletion 已把 codex responses 流聚合完毕并归一化成
2842
2878
  // OpenAI chat.completions 形状:choices[0].finish_reason("stop"/"tool_calls")
@@ -9421,7 +9457,7 @@ async function resolveLocalProvider(ctx) {
9421
9457
  }
9422
9458
 
9423
9459
  // packages/cli/client/localRuntimeAdapter.ts
9424
- import { dirname as dirname2, extname, join as join2 } from "node:path";
9460
+ import { dirname as dirname2, extname, join as join3 } from "node:path";
9425
9461
  import { fileURLToPath } from "node:url";
9426
9462
 
9427
9463
  // packages/cli/client/providerStreamRetry.ts
@@ -9550,6 +9586,11 @@ function clipLocalWakeEvidence(value, max = 1200) {
9550
9586
  const compact = clipCompactText(value, max);
9551
9587
  return compact || void 0;
9552
9588
  }
9589
+ function buildLocalWakeDisplayText(args) {
9590
+ const failed = args.terminalStatus !== "done";
9591
+ const duration = typeof args.durationMs === "number" && args.durationMs >= 0 ? ` \xB7 ${Math.floor(args.durationMs / 6e4)}m${Math.floor(args.durationMs / 1e3) % 60}s` : "";
9592
+ return `1 \u6761\u540E\u53F0 run \u5DF2\u5B8C\u6210 \xB7 ${failed ? "\u2717" : "\u2713"} ${args.label || "\u540E\u53F0 run"}${failed ? ` ${args.terminalStatus}` : ""}${duration}`;
9593
+ }
9553
9594
  function buildLocalParentWakeMessage(args) {
9554
9595
  return [
9555
9596
  "A child agent dialog you started has reached a terminal status.",
@@ -9599,7 +9640,14 @@ async function postRemoteRecord(args) {
9599
9640
  },
9600
9641
  // evidence 写是 customKey 幂等覆盖写(同 key 重写结果相同),
9601
9642
  // 因此 502 重试安全:即便前一次已被服务端处理,重写结果不变。
9602
- { retryableStatuses: /* @__PURE__ */ new Set([429, 502, 503]) }
9643
+ // 402(ledger append conflict)同样幂等可重试:token 记录同 key
9644
+ // 覆盖写 + 扣费幂等键(token:<key>)在 prepare 阶段短路 duplicate,
9645
+ // 重试不会双扣。服务端 chargeTokenUsageWithLedger 内部已带 conflict
9646
+ // 重试,走到 402 说明多重冲突,客户端再退避重试一轮兜底。
9647
+ // Effect v4 迁移锚点:白名单重试 ≈ Effect.retry({ while: res =>
9648
+ // retryableStatuses.has(res.status), schedule: Schedule.exponential }),
9649
+ // 退避/抖动由 Schedule 组合表达,测试用 TestClock 免真实 sleep。
9650
+ { retryableStatuses: /* @__PURE__ */ new Set([402, 429, 502, 503]) }
9603
9651
  );
9604
9652
  if (!response.ok) {
9605
9653
  const text = await response.text().catch(() => "");
@@ -9676,6 +9724,12 @@ async function maybeWakeParentDialogAfterLocalSync(args) {
9676
9724
  host: "terminal",
9677
9725
  runtime: "bun",
9678
9726
  entrypoint: "agent-runtime:parent-child-terminal-wake",
9727
+ wakeChildDialogKey: args.childDialogKey,
9728
+ wakeTerminalStatus: "done",
9729
+ wakeDisplayText: buildLocalWakeDisplayText({
9730
+ label: args.childDialogRecord.taskLabel ?? args.childDialogRecord.title,
9731
+ terminalStatus: "done"
9732
+ }),
9679
9733
  subjectRefs,
9680
9734
  ...allowedChildAgentKeys.length ? { allowedChildAgentKeys } : {},
9681
9735
  ...allowedToolNames.length ? { allowedToolNames } : {},
@@ -10088,7 +10142,8 @@ function buildServerPlatformToolExecutors(args) {
10088
10142
  content,
10089
10143
  metadata: {
10090
10144
  serverPlatformTool: true,
10091
- webTool: toolName
10145
+ webTool: toolName,
10146
+ query: parsed.query
10092
10147
  }
10093
10148
  };
10094
10149
  }
@@ -10110,7 +10165,7 @@ function buildServerPlatformToolExecutors(args) {
10110
10165
  });
10111
10166
  return {
10112
10167
  content: raw,
10113
- metadata: { serverPlatformTool: true, memoryRead: true }
10168
+ metadata: { serverPlatformTool: true, memoryRead: true, query }
10114
10169
  };
10115
10170
  };
10116
10171
  const rememberMemory = async (call) => {
@@ -10130,13 +10185,16 @@ function buildServerPlatformToolExecutors(args) {
10130
10185
  kind: parsed.kind ?? "episodic",
10131
10186
  source: "agent-inferred"
10132
10187
  };
10188
+ if (typeof parsed.recurrenceEvidence === "string" && parsed.recurrenceEvidence.trim()) {
10189
+ body.recurrenceEvidence = parsed.recurrenceEvidence.trim();
10190
+ }
10133
10191
  if (args.agentKey) body.agentKey = args.agentKey;
10134
10192
  const raw = await postServer("/api/memory/remember", body, {
10135
10193
  retryTransient: true
10136
10194
  });
10137
10195
  return {
10138
10196
  content: raw,
10139
- metadata: { serverPlatformTool: true, memoryWrite: true }
10197
+ metadata: { serverPlatformTool: true, memoryWrite: true, content }
10140
10198
  };
10141
10199
  };
10142
10200
  const deleteMemory = async (call) => {
@@ -10187,6 +10245,7 @@ function buildServerPlatformToolExecutors(args) {
10187
10245
  }
10188
10246
 
10189
10247
  // packages/cli/client/cliAgentRunToolExecutors.ts
10248
+ import * as nodeFs2 from "node:fs";
10190
10249
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
10191
10250
 
10192
10251
  // packages/cli/client/agentRunSnapshot.ts
@@ -10235,6 +10294,7 @@ function buildSnapshot(parsed, event) {
10235
10294
  ...typeof parsed.toolCallCount === "number" && Number.isFinite(parsed.toolCallCount) ? { toolCallCount: parsed.toolCallCount } : {},
10236
10295
  ...lastToolNames ? { lastToolNames } : {},
10237
10296
  ...lastAssistantText ? { lastAssistantText } : {},
10297
+ ...typeof parsed.credits === "number" && Number.isFinite(parsed.credits) ? { credits: parsed.credits } : {},
10238
10298
  ...errorMessage ? { errorMessage } : {},
10239
10299
  ...startedAt !== void 0 ? { startedAt } : {},
10240
10300
  ...finishedAt !== void 0 ? { finishedAt } : {},
@@ -10413,18 +10473,18 @@ function deriveAgentRunTodoStatus(input) {
10413
10473
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
10414
10474
  import { homedir as nodeHomedir } from "node:os";
10415
10475
  import { dirname, join } from "node:path";
10416
- var nodeFs2 = {
10476
+ var nodeFs = {
10417
10477
  mkdirSync,
10418
10478
  writeFileSync,
10419
10479
  readFileSync,
10420
10480
  existsSync
10421
10481
  };
10422
- function resolveNoloHome(env, homedir) {
10482
+ function resolveNoloHome(env, homedir2) {
10423
10483
  const custom = env?.NOLO_HOME;
10424
10484
  if (custom && custom.trim()) return custom.trim();
10425
10485
  const ambient = process.env.NOLO_HOME?.trim();
10426
10486
  if (ambient) return ambient;
10427
- return join(homedir(), ".nolo");
10487
+ return join(homedir2(), ".nolo");
10428
10488
  }
10429
10489
  function ensureDir(dir, fs) {
10430
10490
  fs.mkdirSync(dir, { recursive: true });
@@ -10443,9 +10503,9 @@ function writeJson(path, data, fs) {
10443
10503
  }
10444
10504
  function createFileSystemTodoStore(opts = {}) {
10445
10505
  const env = opts.env ?? process.env;
10446
- const homedir = opts.homedir ?? nodeHomedir;
10447
- const fs = opts.fs ?? nodeFs2;
10448
- const noloHome = resolveNoloHome(env, homedir);
10506
+ const homedir2 = opts.homedir ?? nodeHomedir;
10507
+ const fs = opts.fs ?? nodeFs;
10508
+ const noloHome = resolveNoloHome(env, homedir2);
10449
10509
  const filePath = opts.filePath ?? join(noloHome, "agent_run_todos.json");
10450
10510
  const oldFilePath = join(noloHome, "todos.json");
10451
10511
  const loadMap = () => {
@@ -10898,7 +10958,7 @@ function createCliControlAgentRunExecutor(deps = {}) {
10898
10958
  if (!ourEntryFound) {
10899
10959
  if (remainingEntries.length > 0) {
10900
10960
  await withQueueLock(queuePath, deps, () => {
10901
- const fs = deps.fs ?? nodeFs;
10961
+ const fs = deps.fs ?? nodeFs2;
10902
10962
  const existing = fs.existsSync(queuePath) ? fs.readFileSync(queuePath, "utf8") : "";
10903
10963
  fs.writeFileSync(queuePath, serializeQueueEntries(remainingEntries) + existing, "utf8");
10904
10964
  });
@@ -11057,6 +11117,7 @@ function createCliControlAgentRunExecutor(deps = {}) {
11057
11117
  // packages/cli/client/cliLocalToolExecutors.ts
11058
11118
  var MAX_PASTED_TEXT_LINES_PER_READ = 200;
11059
11119
  var PASTED_TEXT_EXPLICIT_OVERSHOOT_LINES = 20;
11120
+ var FULLY_DELIVERED_SEGMENT_LINES = MAX_PASTED_TEXT_LINES_PER_READ + PASTED_TEXT_EXPLICIT_OVERSHOOT_LINES;
11060
11121
  var PASTE_LEDGER_MAX_RECORDS = 64;
11061
11122
  function createReadPastedTextExecutor(store) {
11062
11123
  const ledger = /* @__PURE__ */ new Map();
@@ -11124,8 +11185,19 @@ function createReadPastedTextExecutor(store) {
11124
11185
  const clamped = explicitEnd !== void 0 && endLine < explicitEnd && endLine < lines.length;
11125
11186
  const paged = explicitEnd === void 0 && endLine < lines.length;
11126
11187
  const needsFooter = clamped || paged;
11188
+ const nextStartLine = endLine + 1;
11189
+ const remainingLines = lines.length - endLine;
11190
+ const footer = !needsFooter ? void 0 : remainingLines <= FULLY_DELIVERED_SEGMENT_LINES ? `[readPastedText: returned lines ${startLine}-${endLine} of ${lines.length}. Continue with startLine=${nextStartLine}.]` : (() => {
11191
+ const firstEnd = Math.min(
11192
+ nextStartLine + FULLY_DELIVERED_SEGMENT_LINES - 1,
11193
+ lines.length
11194
+ );
11195
+ const secondStart = firstEnd + 1;
11196
+ const secondEnd = Math.min(secondStart + FULLY_DELIVERED_SEGMENT_LINES - 1, lines.length);
11197
+ return `[readPastedText: returned lines ${startLine}-${endLine} of ${lines.length}. Continue with startLine=${nextStartLine}, or fetch the remaining ${remainingLines} lines in one turn with parallel calls (e.g. ${nextStartLine}-${firstEnd}, ${secondStart}-${secondEnd})]`;
11198
+ })();
11127
11199
  const content = needsFooter ? `${delivered}
11128
- [readPastedText: returned lines ${startLine}-${endLine} of ${lines.length}. Continue with startLine=${endLine + 1}.]` : delivered;
11200
+ ${footer}` : delivered;
11129
11201
  const metadata = {
11130
11202
  pasteId,
11131
11203
  startLine,
@@ -11136,7 +11208,7 @@ function createReadPastedTextExecutor(store) {
11136
11208
  // Continuation pointer whenever more content exists, even when an
11137
11209
  // explicit request was honored in full — the schema contract says a
11138
11210
  // truncated read advertises the exact next startLine.
11139
- ...endLine < lines.length ? { nextStartLine: endLine + 1 } : {},
11211
+ ...endLine < lines.length ? { nextStartLine: endLine + 1, remainingLines: lines.length - endLine } : {},
11140
11212
  source: "tui-paste-store"
11141
11213
  };
11142
11214
  const persistedChars = content.length + "\n\n[tool metadata]\n".length + JSON.stringify(metadata).length;
@@ -11382,6 +11454,15 @@ function resolveFallbackServers(env) {
11382
11454
  function resolveAuthToken(env) {
11383
11455
  return resolvePlatformAuthToken(env);
11384
11456
  }
11457
+ function resolveHybridReadTimeoutMs(env = process.env) {
11458
+ const raw = env.NOLO_HYBRID_READ_TIMEOUT_MS?.trim();
11459
+ if (!raw) return DEFAULT_HYBRID_READ_TIMEOUT_MS;
11460
+ const parsed = Number(raw);
11461
+ if (!Number.isFinite(parsed) || parsed < 0) {
11462
+ return DEFAULT_HYBRID_READ_TIMEOUT_MS;
11463
+ }
11464
+ return parsed;
11465
+ }
11385
11466
  function createCliHybridRecordStore(deps) {
11386
11467
  return createHybridRecordStore({
11387
11468
  db: deps.db,
@@ -11390,7 +11471,8 @@ function createCliHybridRecordStore(deps) {
11390
11471
  ),
11391
11472
  fallbackServers: resolveFallbackServers(deps.env),
11392
11473
  authToken: resolveAuthToken(deps.env),
11393
- fetchImpl: deps.fetchImpl
11474
+ fetchImpl: deps.fetchImpl,
11475
+ requestTimeoutMs: resolveHybridReadTimeoutMs(deps.env)
11394
11476
  });
11395
11477
  }
11396
11478
 
@@ -11615,6 +11697,70 @@ function isRemoteAuthEndpoint(endpoint) {
11615
11697
 
11616
11698
  // packages/cli/client/localRuntimeDialog.ts
11617
11699
  var import_date_fns = __toESM(require_date_fns(), 1);
11700
+ import { appendFileSync, mkdirSync as mkdirSync2 } from "fs";
11701
+ import { homedir } from "os";
11702
+ import { join as join2 } from "path";
11703
+ var RAW_USAGE_SCALARS = [
11704
+ "prompt_tokens",
11705
+ "completion_tokens",
11706
+ "total_tokens",
11707
+ "input_tokens",
11708
+ "output_tokens",
11709
+ "cache_read_input_tokens",
11710
+ "cache_creation_input_tokens",
11711
+ "prompt_cache_hit_tokens",
11712
+ "prompt_cache_miss_tokens",
11713
+ "cost",
11714
+ "cost_in_usd_ticks",
11715
+ "provider_call_id"
11716
+ ];
11717
+ var RAW_USAGE_DETAIL_OBJECTS = [
11718
+ "prompt_tokens_details",
11719
+ "completion_tokens_details",
11720
+ "input_tokens_details",
11721
+ "output_tokens_details",
11722
+ "cost_details"
11723
+ ];
11724
+ function projectRawUsage(usage) {
11725
+ const out = {};
11726
+ for (const key of RAW_USAGE_SCALARS) {
11727
+ const value = usage[key];
11728
+ if (typeof value === "number" && Number.isFinite(value)) {
11729
+ out[key] = value;
11730
+ } else if (key === "provider_call_id" && typeof value === "string" && value.trim()) {
11731
+ out[key] = value;
11732
+ }
11733
+ }
11734
+ for (const key of RAW_USAGE_DETAIL_OBJECTS) {
11735
+ const value = usage[key];
11736
+ if (!value || typeof value !== "object" || Array.isArray(value)) continue;
11737
+ const numericLeaves = Object.fromEntries(
11738
+ Object.entries(value).filter(
11739
+ ([, leaf]) => typeof leaf === "number" && Number.isFinite(leaf)
11740
+ )
11741
+ );
11742
+ if (Object.keys(numericLeaves).length > 0) out[key] = numericLeaves;
11743
+ }
11744
+ return out;
11745
+ }
11746
+ function debugCaptureRawUsage(item) {
11747
+ if (!process.env.NOLO_DEBUG_RAW_USAGE) return;
11748
+ try {
11749
+ const noloHome = process.env.NOLO_HOME?.trim() || join2(homedir(), ".nolo");
11750
+ const dir = join2(noloHome, "logs");
11751
+ mkdirSync2(dir, { recursive: true });
11752
+ appendFileSync(
11753
+ join2(dir, "raw-usage.jsonl"),
11754
+ JSON.stringify({
11755
+ ts: Date.now(),
11756
+ model: item.model,
11757
+ provider: item.provider,
11758
+ usage: projectRawUsage(item.usage)
11759
+ }) + "\n"
11760
+ );
11761
+ } catch {
11762
+ }
11763
+ }
11618
11764
  async function resolveStore(deps) {
11619
11765
  if (deps.store) return deps.store;
11620
11766
  return createCliHybridRecordStore({
@@ -11703,6 +11849,7 @@ async function writeLocalTokenRecord(args) {
11703
11849
  const ops = [];
11704
11850
  for (const item of usageRecords) {
11705
11851
  if (!item.usage || Object.keys(item.usage).length === 0) continue;
11852
+ debugCaptureRawUsage(item);
11706
11853
  const timestamp = args.now();
11707
11854
  const callId = item.callId || typeof item.usage.provider_call_id === "string" && item.usage.provider_call_id.trim() || args.createId();
11708
11855
  const prepared = prepareTokenUsageData({
@@ -11722,7 +11869,11 @@ async function writeLocalTokenRecord(args) {
11722
11869
  agentId: args.input.agentKey,
11723
11870
  dialogId: args.dialogId,
11724
11871
  timestamp,
11725
- entry_path: "cli-local"
11872
+ entry_path: "cli-local",
11873
+ ...item.stablePrefixHash ? {
11874
+ stable_prefix_hash: item.stablePrefixHash,
11875
+ stable_prefix_estimated_tokens: item.stablePrefixEstimatedTokens
11876
+ } : {}
11726
11877
  });
11727
11878
  const recordKey = createTokenKey.recordForStableCall(args.userId, callId);
11728
11879
  const existingToken = await args.store.read(recordKey, { remote: false }).catch(() => null);
@@ -11967,7 +12118,7 @@ var currentMetaFile = fileURLToPath(import.meta.url);
11967
12118
  var isJsBundle = extname(currentMetaFile) === ".js";
11968
12119
  var SOURCE_CLI_DIR = isJsBundle ? dirname2(currentMetaFile) : dirname2(dirname2(currentMetaFile));
11969
12120
  var CLI_DIR = isCompiledBinary() ? dirname2(process.execPath) : SOURCE_CLI_DIR;
11970
- var CLI_ENTRYPOINT = isCompiledBinary() ? process.execPath : isJsBundle ? currentMetaFile : join2(SOURCE_CLI_DIR, "index.ts");
12121
+ var CLI_ENTRYPOINT = isCompiledBinary() ? process.execPath : isJsBundle ? currentMetaFile : join3(SOURCE_CLI_DIR, "index.ts");
11971
12122
  async function recordLocalAvailabilityForAgent(args) {
11972
12123
  const now = args.now ?? Date.now;
11973
12124
  const { deps, status } = args;
@@ -12263,17 +12414,22 @@ function createCliLocalRuntimeAdapter(deps) {
12263
12414
  executeTool: async (call, opts) => {
12264
12415
  const contextualCall = opts?.runtimeContext ? { ...call, runtimeContext: opts.runtimeContext } : call;
12265
12416
  let injectedCall = contextualCall;
12266
- if (contextualCall.name === "startAgentRun" && deps.parentDialogId && typeof contextualCall.arguments === "string") {
12417
+ let spawnedWithoutParent = false;
12418
+ if (contextualCall.name === "startAgentRun" && typeof contextualCall.arguments === "string") {
12267
12419
  try {
12268
12420
  const args = JSON.parse(contextualCall.arguments);
12269
12421
  if (!args.parentDialogId) {
12270
- injectedCall = {
12271
- ...contextualCall,
12272
- arguments: JSON.stringify({
12273
- ...args,
12274
- parentDialogId: deps.parentDialogId
12275
- })
12276
- };
12422
+ if (deps.parentDialogId) {
12423
+ injectedCall = {
12424
+ ...contextualCall,
12425
+ arguments: JSON.stringify({
12426
+ ...args,
12427
+ parentDialogId: deps.parentDialogId
12428
+ })
12429
+ };
12430
+ } else {
12431
+ spawnedWithoutParent = true;
12432
+ }
12277
12433
  }
12278
12434
  } catch {
12279
12435
  }
@@ -12292,6 +12448,15 @@ function createCliLocalRuntimeAdapter(deps) {
12292
12448
  detachMs: resolveExecShellDetachMs(deps.env),
12293
12449
  ...deps.confirmDestructiveAction ? { confirmDestructiveAction: deps.confirmDestructiveAction } : {}
12294
12450
  });
12451
+ if (spawnedWithoutParent && deps.onBackgroundRunSpawned) {
12452
+ try {
12453
+ const payload = JSON.parse(result?.content ?? "");
12454
+ if (payload && typeof payload.runId === "string" && payload.runId) {
12455
+ deps.onBackgroundRunSpawned(payload.runId);
12456
+ }
12457
+ } catch {
12458
+ }
12459
+ }
12295
12460
  return {
12296
12461
  ...result,
12297
12462
  metadata: {
@@ -12330,6 +12495,7 @@ function createCliLocalRuntimeAdapter(deps) {
12330
12495
  export {
12331
12496
  clearCliLocalRuntimePreparedAgentCache,
12332
12497
  isSubtaskRun,
12498
+ RUN_WAKE_CHANNEL_ENV,
12333
12499
  summarizeEndpoint,
12334
12500
  isBuiltinNoloAgentRef,
12335
12501
  readTimestamp,