@qwen-code/qwen-code 0.16.2 → 0.17.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 (73) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +5 -1
  2. package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
  3. package/bundled/qc-helper/docs/features/channels/feishu.md +170 -0
  4. package/chunks/{agent-RY5EB3XR.js → agent-KVXFGIOU.js} +17 -12
  5. package/chunks/{anthropicContentGenerator-LYI3OHBB.js → anthropicContentGenerator-L4HWAOIV.js} +5 -5
  6. package/chunks/{askUserQuestion-R3MKD2JT.js → askUserQuestion-DC6OWQIL.js} +5 -3
  7. package/chunks/chunk-24YKA2DA.js +233 -0
  8. package/chunks/{chunk-UFC57OYT.js → chunk-33RDTIU6.js} +5 -3
  9. package/chunks/{chunk-C6WMLUNB.js → chunk-3BJBCG2K.js} +1 -1
  10. package/chunks/chunk-3HX5LZ6R.js +1798 -0
  11. package/chunks/{chunk-GQXXO5HJ.js → chunk-4O2TWJK4.js} +25 -5
  12. package/chunks/{chunk-RDYWTWEM.js → chunk-5IFG2VC4.js} +299 -232
  13. package/chunks/chunk-6RQTH7UQ.js +115 -0
  14. package/chunks/{chunk-7HM6OB7M.js → chunk-7EHPK6TK.js} +1336 -5164
  15. package/chunks/{chunk-PJLEMR7N.js → chunk-7NNBQRV7.js} +6 -6
  16. package/chunks/{chunk-K5PGHDBN.js → chunk-AKBFRR6J.js} +112 -132
  17. package/chunks/{chunk-C27V5A2J.js → chunk-EMVEDSVZ.js} +1 -1
  18. package/chunks/{chunk-TXQI3VZ7.js → chunk-GJHMAWS7.js} +1 -1
  19. package/chunks/{chunk-K72FHBFO.js → chunk-HAQCNXSG.js} +1 -0
  20. package/chunks/{chunk-T4VD6OJ4.js → chunk-HCSJIOLR.js} +1 -1
  21. package/chunks/chunk-J37FGIOA.js +1623 -0
  22. package/chunks/chunk-J5VCSWPA.js +1467 -0
  23. package/chunks/{chunk-UE5LPQF7.js → chunk-JI7FDD65.js} +7 -7
  24. package/chunks/{chunk-4YNZFYJY.js → chunk-MEN6IEKX.js} +2533 -3943
  25. package/chunks/{chunk-USE2VQ5P.js → chunk-NP3ICQCN.js} +1 -1
  26. package/chunks/{chunk-66CJCYYZ.js → chunk-QEXSIXLX.js} +1 -1
  27. package/chunks/{chunk-YMDXEEOW.js → chunk-R2B65CAN.js} +1 -82
  28. package/chunks/chunk-SZOEIL6S.js +35 -0
  29. package/chunks/chunk-TI4GXJKO.js +4277 -0
  30. package/chunks/{chunk-E7E2MFYM.js → chunk-U2K6HDUJ.js} +434 -13
  31. package/chunks/{chunk-FO7BIVSR.js → chunk-UQRYJQBE.js} +5 -3
  32. package/chunks/{chunk-VMOWXTRC.js → chunk-V7LMZR76.js} +1 -1
  33. package/chunks/chunk-W57YDFU5.js +41 -0
  34. package/chunks/computer-use-2J5ZXEER.js +768 -0
  35. package/chunks/{contextCommand-DDGVLQSF.js → contextCommand-52NTEMCT.js} +19 -14
  36. package/chunks/{cron-create-BTEOGHPH.js → cron-create-FXRORK2U.js} +5 -3
  37. package/chunks/{cron-delete-56CEWELN.js → cron-delete-D24IN6CA.js} +5 -3
  38. package/chunks/{cron-list-SV6QRZW2.js → cron-list-SMOX26SL.js} +5 -3
  39. package/chunks/{devtools-WN62SQPV.js → devtools-IXE4UP72.js} +31 -3748
  40. package/chunks/{dist-MN2PDDPR.js → dist-6RUZ2JD6.js} +13 -1612
  41. package/chunks/{dist-R2SXPG74.js → dist-AHZNZWRI.js} +5 -4
  42. package/chunks/dist-GRQVFL3G.js +94147 -0
  43. package/chunks/{dist-BXDUQ2QY.js → dist-XTTPOFAH.js} +4 -3
  44. package/chunks/{edit-4LLGNYVZ.js → edit-RLFUTT5F.js} +20 -14
  45. package/chunks/{enter-worktree-E2R5XAFT.js → enter-worktree-CYRAPQKJ.js} +20 -14
  46. package/chunks/{exit-worktree-YVBYYYDD.js → exit-worktree-WQZM72QD.js} +20 -14
  47. package/chunks/{exitPlanMode-WD5IH7NS.js → exitPlanMode-STFEBQZE.js} +20 -14
  48. package/chunks/{geminiContentGenerator-LM65ADWM.js → geminiContentGenerator-DIV32SKO.js} +4 -3
  49. package/chunks/{glob-6X6OCEWE.js → glob-N3XO4RVI.js} +20 -14
  50. package/chunks/{grep-2UUPSSIQ.js → grep-AK5MP7P3.js} +20 -14
  51. package/chunks/{ls-MYXAM7LJ.js → ls-7FYQHPWF.js} +5 -3
  52. package/chunks/{lsp-PFGI35JL.js → lsp-DKG34USR.js} +5 -3
  53. package/chunks/{monitor-VUHPEGUW.js → monitor-IVBWJZEZ.js} +20 -14
  54. package/chunks/{notebook-edit-P4QVLW6I.js → notebook-edit-PM46AXFS.js} +21 -15
  55. package/chunks/{openaiContentGenerator-JH4YNZ3H.js → openaiContentGenerator-4QXCH7L2.js} +13 -10
  56. package/chunks/{qwenContentGenerator-5FE4UYUT.js → qwenContentGenerator-BLXQIIMX.js} +21 -16
  57. package/chunks/{read-file-J7DH4OKV.js → read-file-IEQAS3EZ.js} +10 -6
  58. package/chunks/{ripGrep-33DECY4F.js → ripGrep-HQO7IE4C.js} +17 -12
  59. package/chunks/{send-message-JUFP62VD.js → send-message-ZL7CDM7K.js} +5 -3
  60. package/chunks/{serve-7FX7MREA.js → serve-CYRAK4UM.js} +63 -1837
  61. package/chunks/{shell-ZNTQIRK6.js → shell-UZBGNO2Q.js} +17 -12
  62. package/chunks/{skill-CFCUIY23.js → skill-JVC34QYN.js} +24 -13
  63. package/chunks/{src-AHV2CWEQ.js → src-FOODLH7B.js} +49 -41
  64. package/chunks/{syntheticOutput-AKTXC6FR.js → syntheticOutput-U3YJ3GOO.js} +3 -2
  65. package/chunks/{task-stop-2NYFR2ES.js → task-stop-NPUI3YBA.js} +5 -3
  66. package/chunks/{todoWrite-WHZ2O2XP.js → todoWrite-Y6F7YEIM.js} +6 -4
  67. package/chunks/{tool-search-C2EMLFBJ.js → tool-search-P7PRPOW3.js} +13 -8
  68. package/chunks/{web-fetch-S6MZXPZ5.js → web-fetch-XWEK4TFX.js} +6 -4
  69. package/chunks/{write-file-EEPVRS4Q.js → write-file-SIIEUON5.js} +21 -15
  70. package/cli.js +412 -329
  71. package/package.json +2 -2
  72. package/chunks/chunk-JVD46YJV.js +0 -434
  73. package/chunks/undici-4ARNOH74.js +0 -8
package/cli.js CHANGED
@@ -7,13 +7,13 @@ import {
7
7
  clearAccount,
8
8
  loadAccount,
9
9
  saveAccount
10
- } from "./chunks/chunk-C6WMLUNB.js";
10
+ } from "./chunks/chunk-3BJBCG2K.js";
11
11
  import {
12
12
  AcpBridge,
13
13
  PairingStore,
14
14
  SessionRouter,
15
15
  resolvePath
16
- } from "./chunks/chunk-USE2VQ5P.js";
16
+ } from "./chunks/chunk-NP3ICQCN.js";
17
17
  import {
18
18
  ACP_PREFLIGHT_KINDS,
19
19
  DEFAULT_RING_SIZE,
@@ -82,18 +82,18 @@ import {
82
82
  settingExistsInScope,
83
83
  updateOutputLanguageFile,
84
84
  validateCustomTheme
85
- } from "./chunks/chunk-GQXXO5HJ.js";
85
+ } from "./chunks/chunk-4O2TWJK4.js";
86
86
  import {
87
87
  AgentSideConnection,
88
88
  PROTOCOL_VERSION,
89
89
  RequestError,
90
90
  ndJsonStream
91
- } from "./chunks/chunk-UFC57OYT.js";
91
+ } from "./chunks/chunk-33RDTIU6.js";
92
92
  import {
93
93
  contextCommand,
94
94
  isTerminalGoalStatusKind,
95
95
  require_react
96
- } from "./chunks/chunk-PJLEMR7N.js";
96
+ } from "./chunks/chunk-7NNBQRV7.js";
97
97
  import {
98
98
  SUPPORTED_LANGUAGES,
99
99
  clearScreen,
@@ -106,7 +106,7 @@ import {
106
106
  ta,
107
107
  writeStderrLine,
108
108
  writeStdoutLine
109
- } from "./chunks/chunk-66CJCYYZ.js";
109
+ } from "./chunks/chunk-QEXSIXLX.js";
110
110
  import {
111
111
  ALIBABA_PROVIDERS,
112
112
  ALL_PROVIDERS,
@@ -205,6 +205,7 @@ import {
205
205
  getAllMCPServerStatuses,
206
206
  getAllProviderBaseUrls,
207
207
  getArenaSystemReminder,
208
+ getAutoModePermissionDeniedReason,
208
209
  getCacheSafeParams,
209
210
  getDefaultBaseUrlForProtocol,
210
211
  getDefaultModelIds,
@@ -280,6 +281,7 @@ import {
280
281
  setLastGoalTerminal,
281
282
  setStartupEventSink,
282
283
  shouldFallback,
284
+ shouldFirePermissionDeniedForAutoMode,
283
285
  shouldRunAutoModeForCall,
284
286
  shouldShowStep,
285
287
  startSpeculation,
@@ -294,15 +296,20 @@ import {
294
296
  writeRuntimeStatus,
295
297
  writeWorktreeSession,
296
298
  writeWorktreeSessionMarker
297
- } from "./chunks/chunk-7HM6OB7M.js";
299
+ } from "./chunks/chunk-7EHPK6TK.js";
300
+ import {
301
+ external_exports
302
+ } from "./chunks/chunk-24YKA2DA.js";
303
+ import "./chunks/chunk-O4PICXES.js";
304
+ import "./chunks/chunk-TW522KN6.js";
305
+ import "./chunks/chunk-TI4GXJKO.js";
298
306
  import {
299
307
  _enum,
300
308
  _null,
301
309
  array,
302
310
  boolean,
303
- custom,
311
+ custom2 as custom,
304
312
  discriminatedUnion,
305
- external_exports,
306
313
  intersection,
307
314
  iso_exports,
308
315
  literal,
@@ -316,13 +323,11 @@ import {
316
323
  string,
317
324
  union,
318
325
  unknown
319
- } from "./chunks/chunk-K5PGHDBN.js";
320
- import "./chunks/chunk-O4PICXES.js";
321
- import "./chunks/chunk-TW522KN6.js";
326
+ } from "./chunks/chunk-AKBFRR6J.js";
322
327
  import "./chunks/chunk-MLZQVCF3.js";
323
328
  import {
324
329
  runSideQuery
325
- } from "./chunks/chunk-C27V5A2J.js";
330
+ } from "./chunks/chunk-EMVEDSVZ.js";
326
331
  import {
327
332
  buildSkillLlmContent
328
333
  } from "./chunks/chunk-EY6BDW7Y.js";
@@ -330,16 +335,9 @@ import {
330
335
  HOOKS_CONFIG_FIELDS,
331
336
  HookEventName,
332
337
  createHookOutput
333
- } from "./chunks/chunk-K72FHBFO.js";
338
+ } from "./chunks/chunk-HAQCNXSG.js";
334
339
  import "./chunks/chunk-77WXWU44.js";
335
340
  import "./chunks/chunk-GVWPJCXU.js";
336
- import {
337
- detectRuntime,
338
- getOrCreateSharedDispatcher,
339
- getUnsupportedImageFormatWarning,
340
- isSupportedImageMimeType,
341
- redactProxyCredentials
342
- } from "./chunks/chunk-JVD46YJV.js";
343
341
  import {
344
342
  ApiCancelEvent,
345
343
  AuthEvent,
@@ -378,8 +376,10 @@ import {
378
376
  setGeminiMdFilename,
379
377
  shutdownTelemetry,
380
378
  uiTelemetryService
381
- } from "./chunks/chunk-4YNZFYJY.js";
379
+ } from "./chunks/chunk-MEN6IEKX.js";
380
+ import "./chunks/chunk-J5VCSWPA.js";
382
381
  import "./chunks/chunk-UWCTAVOD.js";
382
+ import "./chunks/chunk-W57YDFU5.js";
383
383
  import {
384
384
  DEFAULT_QWEN_EMBEDDING_MODEL,
385
385
  MAINLINE_CODER_MODEL
@@ -389,35 +389,45 @@ import {
389
389
  getAutoMemoryRoot,
390
390
  isAutoMemPath
391
391
  } from "./chunks/chunk-NQ3E7YLD.js";
392
- import {
393
- DEFAULT_TOKEN_LIMIT,
394
- tokenLimit
395
- } from "./chunks/chunk-6NUSWV4M.js";
396
392
  import "./chunks/chunk-ODPVJ6JJ.js";
393
+ import "./chunks/chunk-UQRYJQBE.js";
397
394
  import {
398
- require_base64_js,
399
- require_ecdsa_sig_formatter,
400
- require_extend,
401
- require_json_bigint,
402
- require_jws
403
- } from "./chunks/chunk-T4VD6OJ4.js";
404
- import "./chunks/chunk-RDYWTWEM.js";
405
- import "./chunks/chunk-FO7BIVSR.js";
395
+ ToolDisplayNames,
396
+ ToolNames
397
+ } from "./chunks/chunk-6RQTH7UQ.js";
406
398
  import {
407
399
  SchemaValidator,
408
400
  ToolConfirmationOutcome,
409
- ToolDisplayNames,
410
- ToolNames,
411
401
  require_dist,
412
402
  require_fast_deep_equal,
413
403
  require_fast_uri
414
- } from "./chunks/chunk-YMDXEEOW.js";
404
+ } from "./chunks/chunk-R2B65CAN.js";
415
405
  import {
416
406
  clearCachedCredentialFile,
417
407
  open_default,
418
408
  qwenOAuth2Events
419
409
  } from "./chunks/chunk-7YJIR2FX.js";
420
410
  import "./chunks/chunk-OIL7KDWV.js";
411
+ import {
412
+ detectRuntime,
413
+ getOrCreateSharedDispatcher,
414
+ getUnsupportedImageFormatWarning,
415
+ isSupportedImageMimeType,
416
+ redactProxyCredentials
417
+ } from "./chunks/chunk-U2K6HDUJ.js";
418
+ import {
419
+ DEFAULT_TOKEN_LIMIT,
420
+ tokenLimit
421
+ } from "./chunks/chunk-6NUSWV4M.js";
422
+ import {
423
+ require_base64_js,
424
+ require_ecdsa_sig_formatter,
425
+ require_extend,
426
+ require_json_bigint,
427
+ require_jws
428
+ } from "./chunks/chunk-HCSJIOLR.js";
429
+ import "./chunks/chunk-SZOEIL6S.js";
430
+ import "./chunks/chunk-5IFG2VC4.js";
421
431
  import {
422
432
  FatalBudgetExceededError,
423
433
  FatalCancellationError,
@@ -440,7 +450,6 @@ import {
440
450
  unescapePath,
441
451
  updateSymlink
442
452
  } from "./chunks/chunk-ACBGEKB7.js";
443
- import "./chunks/chunk-E7E2MFYM.js";
444
453
  import "./chunks/chunk-ZERZSAZL.js";
445
454
  import "./chunks/chunk-QN5NZ3UQ.js";
446
455
  import "./chunks/chunk-BR4QREVK.js";
@@ -41567,9 +41576,9 @@ var require_logging_utils = __commonJS({
41567
41576
  this.debugPkg = pkg;
41568
41577
  }
41569
41578
  makeLogger(namespace) {
41570
- const debugLogger76 = this.debugPkg(namespace);
41579
+ const debugLogger77 = this.debugPkg(namespace);
41571
41580
  return (fields, ...args) => {
41572
- debugLogger76(args[0], ...args.slice(1));
41581
+ debugLogger77(args[0], ...args.slice(1));
41573
41582
  };
41574
41583
  }
41575
41584
  setFilters() {
@@ -41593,7 +41602,7 @@ var require_logging_utils = __commonJS({
41593
41602
  }
41594
41603
  makeLogger(namespace) {
41595
41604
  var _a2;
41596
- const debugLogger76 = (_a2 = this.upstream) === null || _a2 === void 0 ? void 0 : _a2.makeLogger(namespace);
41605
+ const debugLogger77 = (_a2 = this.upstream) === null || _a2 === void 0 ? void 0 : _a2.makeLogger(namespace);
41597
41606
  return (fields, ...args) => {
41598
41607
  var _a3;
41599
41608
  const severity = (_a3 = fields.severity) !== null && _a3 !== void 0 ? _a3 : LogSeverity.INFO;
@@ -41602,8 +41611,8 @@ var require_logging_utils = __commonJS({
41602
41611
  message: util.format(...args)
41603
41612
  }, fields);
41604
41613
  const jsonString = JSON.stringify(json);
41605
- if (debugLogger76) {
41606
- debugLogger76(fields, jsonString);
41614
+ if (debugLogger77) {
41615
+ debugLogger77(fields, jsonString);
41607
41616
  } else {
41608
41617
  console.log("%s", jsonString);
41609
41618
  }
@@ -59233,7 +59242,7 @@ if (process4.env["DEV"] === "true") {
59233
59242
  } catch {
59234
59243
  }
59235
59244
  if (isDevtoolsInstalled) {
59236
- await import("./chunks/devtools-WN62SQPV.js");
59245
+ await import("./chunks/devtools-IXE4UP72.js");
59237
59246
  }
59238
59247
  }
59239
59248
  var diff = /* @__PURE__ */ __name((before, after) => {
@@ -74232,12 +74241,13 @@ var builtinsPromise = null;
74232
74241
  function ensureBuiltins() {
74233
74242
  if (!builtinsPromise) {
74234
74243
  builtinsPromise = (async () => {
74235
- const [telegram, weixin, dingtalk] = await Promise.all([
74236
- import("./chunks/dist-BXDUQ2QY.js"),
74237
- import("./chunks/dist-R2SXPG74.js"),
74238
- import("./chunks/dist-MN2PDDPR.js")
74244
+ const [telegram, weixin, dingtalk, feishu] = await Promise.all([
74245
+ import("./chunks/dist-XTTPOFAH.js"),
74246
+ import("./chunks/dist-AHZNZWRI.js"),
74247
+ import("./chunks/dist-6RUZ2JD6.js"),
74248
+ import("./chunks/dist-GRQVFL3G.js")
74239
74249
  ]);
74240
- for (const mod of [telegram, weixin, dingtalk]) {
74250
+ for (const mod of [telegram, weixin, dingtalk, feishu]) {
74241
74251
  registry.set(mod.plugin.channelType, mod.plugin);
74242
74252
  }
74243
74253
  })();
@@ -76559,7 +76569,7 @@ var serveCommand = {
76559
76569
  }
76560
76570
  } catch {
76561
76571
  }
76562
- const { runQwenServe } = await import("./chunks/serve-7FX7MREA.js");
76572
+ const { runQwenServe } = await import("./chunks/serve-CYRAK4UM.js");
76563
76573
  try {
76564
76574
  await runQwenServe({
76565
76575
  port: argv.port,
@@ -77774,6 +77784,7 @@ async function loadCliConfig(settings, argv, cwd5 = process.cwd(), overrideExten
77774
77784
  maxToolCalls: resolveMaxToolCalls(argv, settings),
77775
77785
  experimentalZedIntegration: argv.acp || argv.experimentalAcp || false,
77776
77786
  cronEnabled: settings.experimental?.cron ?? false,
77787
+ computerUseEnabled: settings.tools?.computerUse?.enabled ?? true,
77777
77788
  emitToolUseSummaries: settings.experimental?.emitToolUseSummaries ?? true,
77778
77789
  listExtensions: argv.listExtensions || false,
77779
77790
  overrideExtensions: overrideExtensions || argv.extensions,
@@ -80620,7 +80631,7 @@ var isAtCommand = /* @__PURE__ */ __name((query) => (
80620
80631
  query.startsWith("@") || /\s@/.test(query)
80621
80632
  ), "isAtCommand");
80622
80633
  var SLASH_PATH_SEPARATOR_RE = /[/\\]/;
80623
- var getSlashCommandFirstToken = /* @__PURE__ */ __name((query) => query.slice(1).trimStart().split(/\s+/)[0] ?? "", "getSlashCommandFirstToken");
80634
+ var getSlashCommandFirstToken = /* @__PURE__ */ __name((query) => query.slice(1).trimStart().split(/\s+/u)[0] ?? "", "getSlashCommandFirstToken");
80624
80635
  var hasSlashCommandPathSeparator = /* @__PURE__ */ __name((query) => SLASH_PATH_SEPARATOR_RE.test(getSlashCommandFirstToken(query)), "hasSlashCommandPathSeparator");
80625
80636
  var isSlashCommand = /* @__PURE__ */ __name((query) => {
80626
80637
  if (!query.startsWith("/")) {
@@ -86859,7 +86870,7 @@ async function extractMetadata(conversation, config) {
86859
86870
  const gitBranch = firstRecord?.gitBranch;
86860
86871
  let gitRepo;
86861
86872
  if (cwd5) {
86862
- const { getGitRepoName } = await import("./chunks/src-AHV2CWEQ.js");
86873
+ const { getGitRepoName } = await import("./chunks/src-FOODLH7B.js");
86863
86874
  gitRepo = getGitRepoName(cwd5);
86864
86875
  }
86865
86876
  let model;
@@ -97355,7 +97366,7 @@ var SystemController = class extends BaseController {
97355
97366
  throw new Error("Request aborted");
97356
97367
  }
97357
97368
  try {
97358
- const mod = await import("./chunks/contextCommand-DDGVLQSF.js");
97369
+ const mod = await import("./chunks/contextCommand-52NTEMCT.js");
97359
97370
  if (signal.aborted) {
97360
97371
  throw new Error("Request aborted");
97361
97372
  }
@@ -99193,6 +99204,7 @@ var import_react48 = __toESM(require_react(), 1);
99193
99204
  // packages/cli/src/ui/hooks/useHistoryManager.ts
99194
99205
  init_esbuild_shims();
99195
99206
  var import_react39 = __toESM(require_react(), 1);
99207
+ var debugLogger31 = createDebugLogger("HISTORY_MANAGER");
99196
99208
  function useHistory() {
99197
99209
  const [history, setHistory] = (0, import_react39.useState)([]);
99198
99210
  const messageIdCounterRef = (0, import_react39.useRef)(0);
@@ -99222,15 +99234,24 @@ function useHistory() {
99222
99234
  );
99223
99235
  const updateItem = (0, import_react39.useCallback)(
99224
99236
  (id, updates) => {
99225
- setHistory(
99226
- (prevHistory) => prevHistory.map((item) => {
99237
+ setHistory((prevHistory) => {
99238
+ let updated = false;
99239
+ const nextHistory = prevHistory.map((item) => {
99227
99240
  if (item.id === id) {
99241
+ updated = true;
99228
99242
  const newUpdates = typeof updates === "function" ? updates(item) : updates;
99229
99243
  return { ...item, ...newUpdates };
99230
99244
  }
99231
99245
  return item;
99232
- })
99233
- );
99246
+ });
99247
+ if (!updated) {
99248
+ debugLogger31.debug(
99249
+ `Skipped history update; item ${id} was not found.`
99250
+ );
99251
+ return prevHistory;
99252
+ }
99253
+ return nextHistory;
99254
+ });
99234
99255
  },
99235
99256
  []
99236
99257
  );
@@ -99489,7 +99510,7 @@ __name(createKeyMatchers, "createKeyMatchers");
99489
99510
  var keyMatchers = createKeyMatchers(defaultKeyBindings);
99490
99511
 
99491
99512
  // packages/cli/src/ui/hooks/useSelectionList.ts
99492
- var debugLogger31 = createDebugLogger("SELECTION_LIST");
99513
+ var debugLogger32 = createDebugLogger("SELECTION_LIST");
99493
99514
  var NUMBER_INPUT_TIMEOUT_MS = 1e3;
99494
99515
  var findNextValidIndex = /* @__PURE__ */ __name((currentIndex, direction, items) => {
99495
99516
  const len = items.length;
@@ -99599,7 +99620,7 @@ function selectionListReducer(state, action) {
99599
99620
  }
99600
99621
  default: {
99601
99622
  const exhaustiveCheck = action;
99602
- debugLogger31.error(`Unknown selection list action: ${exhaustiveCheck}`);
99623
+ debugLogger32.error(`Unknown selection list action: ${exhaustiveCheck}`);
99603
99624
  return state;
99604
99625
  }
99605
99626
  }
@@ -100576,7 +100597,7 @@ var OverflowProvider = /* @__PURE__ */ __name(({
100576
100597
  // packages/cli/src/ui/components/shared/MaxSizedBox.tsx
100577
100598
  var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
100578
100599
  var enableDebugLog = false;
100579
- var debugLogger32 = createDebugLogger("MAX_SIZED_BOX");
100600
+ var debugLogger33 = createDebugLogger("MAX_SIZED_BOX");
100580
100601
  var MINIMUM_MAX_HEIGHT = 2;
100581
100602
  function setMaxSizedBoxDebugging(value) {
100582
100603
  enableDebugLog = value;
@@ -100585,7 +100606,7 @@ __name(setMaxSizedBoxDebugging, "setMaxSizedBoxDebugging");
100585
100606
  function debugReportError(message, element) {
100586
100607
  if (!enableDebugLog) return;
100587
100608
  if (!import_react51.default.isValidElement(element)) {
100588
- debugLogger32.error(
100609
+ debugLogger33.error(
100589
100610
  message,
100590
100611
  `Invalid element: '${String(element)}' typeof=${typeof element}`
100591
100612
  );
@@ -100598,9 +100619,9 @@ function debugReportError(message, element) {
100598
100619
  const lineNumber = elementWithSource._source?.lineNumber;
100599
100620
  sourceMessage = fileName ? `${fileName}:${lineNumber}` : "<Unknown file>";
100600
100621
  } catch (error) {
100601
- debugLogger32.error("Error while trying to get file name:", error);
100622
+ debugLogger33.error("Error while trying to get file name:", error);
100602
100623
  }
100603
- debugLogger32.error(
100624
+ debugLogger33.error(
100604
100625
  message,
100605
100626
  `${String(element.type)}. Source: ${sourceMessage}`
100606
100627
  );
@@ -100996,7 +101017,7 @@ __name(loadLowlight, "loadLowlight");
100996
101017
 
100997
101018
  // packages/cli/src/ui/utils/CodeColorizer.tsx
100998
101019
  var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
100999
- var debugLogger33 = createDebugLogger("CODE_COLORIZER");
101020
+ var debugLogger34 = createDebugLogger("CODE_COLORIZER");
101000
101021
  function renderHastNode(node, theme2, inheritedColor) {
101001
101022
  if (node.type === "text") {
101002
101023
  const color2 = inheritedColor || theme2.defaultColor;
@@ -101032,7 +101053,7 @@ function ensureLowlightLoading() {
101032
101053
  if (ll) return ll;
101033
101054
  if (!isLowlightCoolingDown()) {
101034
101055
  void loadLowlight().catch((err) => {
101035
- debugLogger33.error("[CodeColorizer] failed to load lowlight:", err);
101056
+ debugLogger34.error("[CodeColorizer] failed to load lowlight:", err);
101036
101057
  });
101037
101058
  }
101038
101059
  return null;
@@ -101103,7 +101124,7 @@ function colorizeCode(code, language, availableHeight, maxWidth, theme2, setting
101103
101124
  }
101104
101125
  );
101105
101126
  } catch (error) {
101106
- debugLogger33.error(
101127
+ debugLogger34.error(
101107
101128
  `[colorizeCode] Error highlighting code for language "${language}":`,
101108
101129
  error
101109
101130
  );
@@ -102779,7 +102800,7 @@ var INLINE_MARKDOWN_WITH_MATH_REGEX2 = new RegExp(
102779
102800
  String.raw`(\*\*.*?\*\*|\*.*?\*|_.*?_|~~.*?~~|${MD_LINK_PATTERN}|` + String.raw`\`+.+?\`+|(?<![\w$])\$(?![\s\d$])(?=[^$\n]{1,${INLINE_MATH_MAX_CHARS3}}\S\$)[^$\n]{1,${INLINE_MATH_MAX_CHARS3}}\$(?![\w$])|<u>.*?<\/u>|https?:\/\/\S+)`,
102780
102801
  "g"
102781
102802
  );
102782
- var debugLogger34 = createDebugLogger("INLINE_MARKDOWN");
102803
+ var debugLogger35 = createDebugLogger("INLINE_MARKDOWN");
102783
102804
  var RenderInlineInternal = /* @__PURE__ */ __name(({
102784
102805
  text,
102785
102806
  textColor = theme.text.primary,
@@ -102873,7 +102894,7 @@ var RenderInlineInternal = /* @__PURE__ */ __name(({
102873
102894
  ] }, key);
102874
102895
  }
102875
102896
  } catch (e) {
102876
- debugLogger34.error("Error parsing inline markdown part:", fullMatch, e);
102897
+ debugLogger35.error("Error parsing inline markdown part:", fullMatch, e);
102877
102898
  renderedNode = null;
102878
102899
  }
102879
102900
  nodes.push(renderedNode ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { children: fullMatch }, key));
@@ -107033,7 +107054,7 @@ function handleVimAction(state, action) {
107033
107054
  __name(handleVimAction, "handleVimAction");
107034
107055
 
107035
107056
  // packages/cli/src/ui/components/shared/text-buffer.ts
107036
- var debugLogger35 = createDebugLogger("TEXT_BUFFER");
107057
+ var debugLogger36 = createDebugLogger("TEXT_BUFFER");
107037
107058
  var isWordCharStrict = /* @__PURE__ */ __name((char) => /[\w\p{L}\p{N}]/u.test(char), "isWordCharStrict");
107038
107059
  var isWhitespace = /* @__PURE__ */ __name((char) => /\s/.test(char), "isWhitespace");
107039
107060
  var isCombiningMark = /* @__PURE__ */ __name((char) => new RegExp("\\p{M}", "u").test(char), "isCombiningMark");
@@ -107061,9 +107082,9 @@ function ensureSegmenterLoaded() {
107061
107082
  if (segmenter7 !== null) return;
107062
107083
  try {
107063
107084
  segmenter7 = new Intl.Segmenter("zh", { granularity: "word" });
107064
- debugLogger35.info("Intl.Segmenter: initialized successfully");
107085
+ debugLogger36.info("Intl.Segmenter: initialized successfully");
107065
107086
  } catch (err) {
107066
- debugLogger35.warn("Intl.Segmenter: failed to initialize", err);
107087
+ debugLogger36.warn("Intl.Segmenter: failed to initialize", err);
107067
107088
  segmenter7 = false;
107068
107089
  }
107069
107090
  }
@@ -107165,7 +107186,7 @@ function getWordBoundaries(line, codePoints) {
107165
107186
  wordBoundariesCache.set(line, boundaries);
107166
107187
  return boundaries;
107167
107188
  } catch (err) {
107168
- debugLogger35.warn("getWordBoundaries: error, using char fallback", err);
107189
+ debugLogger36.warn("getWordBoundaries: error, using char fallback", err);
107169
107190
  const fallback = charByCharFallback(line);
107170
107191
  evictCacheIfNeeded();
107171
107192
  wordBoundariesCache.set(line, fallback);
@@ -107818,7 +107839,7 @@ function textBufferReducerLogic(state, action) {
107818
107839
  break;
107819
107840
  default: {
107820
107841
  const exhaustiveCheck = dir;
107821
- debugLogger35.error(
107842
+ debugLogger36.error(
107822
107843
  `Unknown visual movement direction: ${exhaustiveCheck}`
107823
107844
  );
107824
107845
  return state;
@@ -108184,7 +108205,7 @@ function textBufferReducerLogic(state, action) {
108184
108205
  return handleVimAction(state, action);
108185
108206
  default: {
108186
108207
  const exhaustiveCheck = action;
108187
- debugLogger35.error(`Unknown action encountered: ${exhaustiveCheck}`);
108208
+ debugLogger36.error(`Unknown action encountered: ${exhaustiveCheck}`);
108188
108209
  return state;
108189
108210
  }
108190
108211
  }
@@ -108615,7 +108636,7 @@ function useTextBuffer({
108615
108636
  tmpDir = fs21.mkdtempSync(pathMod.join(os13.tmpdir(), "qwen-edit-"));
108616
108637
  filePath = pathMod.join(tmpDir, "buffer.txt");
108617
108638
  } catch (err) {
108618
- debugLogger35.error(
108639
+ debugLogger36.error(
108619
108640
  "[useTextBuffer] failed to create temp directory",
108620
108641
  err
108621
108642
  );
@@ -108631,7 +108652,7 @@ function useTextBuffer({
108631
108652
  editorSource = "opts";
108632
108653
  if (process.platform === "win32" && /\.(cmd|bat)$/i.test(editorCmd)) {
108633
108654
  if (/["|%!]/.test(editorCmd)) {
108634
- debugLogger35.error(
108655
+ debugLogger36.error(
108635
108656
  `[useTextBuffer] opts.editor command contains unsafe characters: ${editorCmd}`
108636
108657
  );
108637
108658
  try {
@@ -108651,7 +108672,7 @@ function useTextBuffer({
108651
108672
  editorSource = "preferred";
108652
108673
  } else {
108653
108674
  if (preferredEditor) {
108654
- debugLogger35.warn(
108675
+ debugLogger36.warn(
108655
108676
  `[useTextBuffer] preferred editor "${preferredEditor}" not found, falling back to env/default`
108656
108677
  );
108657
108678
  }
@@ -108659,7 +108680,7 @@ function useTextBuffer({
108659
108680
  editorArgs = [filePath];
108660
108681
  if (process.platform === "win32" && /\.(cmd|bat)$/i.test(editorCmd)) {
108661
108682
  if (/["|%!]/.test(editorCmd)) {
108662
- debugLogger35.error(
108683
+ debugLogger36.error(
108663
108684
  `[useTextBuffer] Editor command from environment contains unsafe characters: ${editorCmd}`
108664
108685
  );
108665
108686
  try {
@@ -108684,7 +108705,7 @@ function useTextBuffer({
108684
108705
  mode: 384
108685
108706
  });
108686
108707
  setRawMode?.(false);
108687
- debugLogger35.warn(
108708
+ debugLogger36.warn(
108688
108709
  `[useTextBuffer] launching external editor (cmd=${editorCmd}, shell=${useShell}, source=${editorSource}, file=${filePath})`
108689
108710
  );
108690
108711
  const { status, error, signal } = spawnSync2(editorCmd, editorArgs, {
@@ -108704,7 +108725,7 @@ function useTextBuffer({
108704
108725
  dispatch({ type: "set_text", payload: newText, pushToUndo: false });
108705
108726
  }
108706
108727
  } catch (err) {
108707
- debugLogger35.error(
108728
+ debugLogger36.error(
108708
108729
  `[useTextBuffer] external editor error (cmd=${editorCmd}, shell=${useShell}, source=${editorSource}, file=${filePath})`,
108709
108730
  err
108710
108731
  );
@@ -108712,7 +108733,7 @@ function useTextBuffer({
108712
108733
  try {
108713
108734
  if (wasRaw) setRawMode?.(true);
108714
108735
  } catch (rawErr) {
108715
- debugLogger35.error(
108736
+ debugLogger36.error(
108716
108737
  "[useTextBuffer] failed to restore raw mode after external editor",
108717
108738
  rawErr
108718
108739
  );
@@ -108939,19 +108960,19 @@ __name(useTextBuffer, "useTextBuffer");
108939
108960
  // packages/cli/src/ui/hooks/usePreferredEditor.ts
108940
108961
  init_esbuild_shims();
108941
108962
  var import_react59 = __toESM(require_react(), 1);
108942
- var debugLogger36 = createDebugLogger("PREFERRED_EDITOR");
108963
+ var debugLogger37 = createDebugLogger("PREFERRED_EDITOR");
108943
108964
  function usePreferredEditor() {
108944
108965
  const settings = useSettings();
108945
108966
  return (0, import_react59.useMemo)(() => {
108946
108967
  const raw = settings.merged.general?.preferredEditor ?? "";
108947
108968
  if (raw && !isValidEditorType(raw)) {
108948
- debugLogger36.warn(
108969
+ debugLogger37.warn(
108949
108970
  `[usePreferredEditor] invalid preferredEditor value "${raw}", ignoring`
108950
108971
  );
108951
108972
  return void 0;
108952
108973
  }
108953
108974
  if (isValidEditorType(raw) && !allowEditorTypeInSandbox(raw)) {
108954
- debugLogger36.warn(
108975
+ debugLogger37.warn(
108955
108976
  `[usePreferredEditor] editor "${raw}" is not allowed in sandbox mode, ignoring`
108956
108977
  );
108957
108978
  return void 0;
@@ -112828,7 +112849,7 @@ __name(truncateText, "truncateText");
112828
112849
  // packages/cli/src/ui/components/views/ExtensionsList.tsx
112829
112850
  init_esbuild_shims();
112830
112851
  var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
112831
- var debugLogger37 = createDebugLogger("EXTENSIONS_LIST");
112852
+ var debugLogger38 = createDebugLogger("EXTENSIONS_LIST");
112832
112853
  var ExtensionsList = /* @__PURE__ */ __name(() => {
112833
112854
  const { extensionsUpdateState, commandContext } = useUIState();
112834
112855
  const extensions = commandContext.services.config?.getExtensions() || [];
@@ -112862,7 +112883,7 @@ var ExtensionsList = /* @__PURE__ */ __name(() => {
112862
112883
  stateColor = "green";
112863
112884
  break;
112864
112885
  default:
112865
- debugLogger37.error(`Unhandled ExtensionUpdateState ${state}`);
112886
+ debugLogger38.error(`Unhandled ExtensionUpdateState ${state}`);
112866
112887
  break;
112867
112888
  }
112868
112889
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
@@ -114584,7 +114605,7 @@ var shortAsciiLogo = `
114584
114605
  init_esbuild_shims();
114585
114606
  import * as fs22 from "node:fs";
114586
114607
  import * as path29 from "node:path";
114587
- var debugLogger38 = createDebugLogger("BANNER");
114608
+ var debugLogger39 = createDebugLogger("BANNER");
114588
114609
  var MAX_FILE_BYTES = 64 * 1024;
114589
114610
  var MAX_ART_LINES = 200;
114590
114611
  var MAX_ART_COLS = 200;
@@ -114626,7 +114647,7 @@ function collectScopedTiers(settings) {
114626
114647
  if (tier === void 0) return void 0;
114627
114648
  const isPathSource = typeof tier === "object";
114628
114649
  if (isPathSource && !dir) {
114629
- debugLogger38.warn(
114650
+ debugLogger39.warn(
114630
114651
  `Ignoring ui.customAsciiArt.${label}: {path} entry has no owning settings file directory to resolve against.`
114631
114652
  );
114632
114653
  return void 0;
@@ -114650,7 +114671,7 @@ function normalizeTiers(value) {
114650
114671
  return { small: value, large: value };
114651
114672
  }
114652
114673
  if (!value || typeof value !== "object") {
114653
- debugLogger38.warn(
114674
+ debugLogger39.warn(
114654
114675
  "Ignoring ui.customAsciiArt: expected a string, {path}, or {small,large} object."
114655
114676
  );
114656
114677
  return void 0;
@@ -114658,7 +114679,7 @@ function normalizeTiers(value) {
114658
114679
  const hasPath = "path" in value && typeof value.path === "string";
114659
114680
  const hasTierKeys = "small" in value || "large" in value;
114660
114681
  if (hasPath && hasTierKeys) {
114661
- debugLogger38.warn(
114682
+ debugLogger39.warn(
114662
114683
  "Ignoring ui.customAsciiArt: object combines `path` with `small` / `large`. Use one shape or the other."
114663
114684
  );
114664
114685
  return void 0;
@@ -114673,7 +114694,7 @@ function normalizeTiers(value) {
114673
114694
  large: validateSource(tiered.large)
114674
114695
  };
114675
114696
  }
114676
- debugLogger38.warn(
114697
+ debugLogger39.warn(
114677
114698
  "Ignoring ui.customAsciiArt: expected a string, {path}, or {small,large} object."
114678
114699
  );
114679
114700
  return void 0;
@@ -114685,7 +114706,7 @@ function validateSource(source) {
114685
114706
  if (typeof source === "object" && "path" in source && typeof source.path === "string") {
114686
114707
  return { path: source.path };
114687
114708
  }
114688
- debugLogger38.warn(
114709
+ debugLogger39.warn(
114689
114710
  "Ignoring ui.customAsciiArt tier: expected a string or {path} object."
114690
114711
  );
114691
114712
  return void 0;
@@ -114722,13 +114743,13 @@ function readArtFile(absolutePath) {
114722
114743
  try {
114723
114744
  preOpenStat = fs22.lstatSync(absolutePath);
114724
114745
  } catch (err) {
114725
- debugLogger38.warn(
114746
+ debugLogger39.warn(
114726
114747
  `Failed to stat ui.customAsciiArt at ${absolutePath}: ${err.message}`
114727
114748
  );
114728
114749
  return void 0;
114729
114750
  }
114730
114751
  if (!preOpenStat.isFile()) {
114731
- debugLogger38.warn(
114752
+ debugLogger39.warn(
114732
114753
  `Ignoring ui.customAsciiArt: ${absolutePath} is not a regular file.`
114733
114754
  );
114734
114755
  return void 0;
@@ -114737,7 +114758,7 @@ function readArtFile(absolutePath) {
114737
114758
  fd = fs22.openSync(absolutePath, flags);
114738
114759
  const stat3 = fs22.fstatSync(fd);
114739
114760
  if (!stat3.isFile()) {
114740
- debugLogger38.warn(
114761
+ debugLogger39.warn(
114741
114762
  `Ignoring ui.customAsciiArt: ${absolutePath} is not a regular file.`
114742
114763
  );
114743
114764
  return void 0;
@@ -114746,13 +114767,13 @@ function readArtFile(absolutePath) {
114746
114767
  const buffer = Buffer.alloc(size);
114747
114768
  fs22.readSync(fd, buffer, 0, size, 0);
114748
114769
  if (stat3.size > MAX_FILE_BYTES) {
114749
- debugLogger38.warn(
114770
+ debugLogger39.warn(
114750
114771
  `Truncated ui.customAsciiArt at ${absolutePath}: file is ${stat3.size} bytes, capped at ${MAX_FILE_BYTES}.`
114751
114772
  );
114752
114773
  }
114753
114774
  return buffer.toString("utf8");
114754
114775
  } catch (err) {
114755
- debugLogger38.warn(
114776
+ debugLogger39.warn(
114756
114777
  `Failed to read ui.customAsciiArt at ${absolutePath}: ${err.message}`
114757
114778
  );
114758
114779
  return void 0;
@@ -114794,10 +114815,10 @@ function sanitizeArt(input) {
114794
114815
  }
114795
114816
  if (cappedLines.length === 0) return "";
114796
114817
  if (truncatedRows) {
114797
- debugLogger38.warn(`Truncated ui.customAsciiArt to ${MAX_ART_LINES} lines.`);
114818
+ debugLogger39.warn(`Truncated ui.customAsciiArt to ${MAX_ART_LINES} lines.`);
114798
114819
  }
114799
114820
  if (truncatedCols) {
114800
- debugLogger38.warn(
114821
+ debugLogger39.warn(
114801
114822
  `Truncated ui.customAsciiArt to ${MAX_ART_COLS} columns per line.`
114802
114823
  );
114803
114824
  }
@@ -114821,7 +114842,7 @@ function sanitizeSingleLine(raw, maxLength, fieldLabel) {
114821
114842
  let t2 = stripTerminalControlSequences(raw).replace(/\s+/g, " ").trim();
114822
114843
  if (!t2) return void 0;
114823
114844
  if (t2.length > maxLength) {
114824
- debugLogger38.warn(`Truncated ${fieldLabel} to ${maxLength} characters.`);
114845
+ debugLogger39.warn(`Truncated ${fieldLabel} to ${maxLength} characters.`);
114825
114846
  t2 = t2.slice(0, maxLength);
114826
114847
  }
114827
114848
  return t2;
@@ -116554,7 +116575,7 @@ var useVimMode = /* @__PURE__ */ __name(() => {
116554
116575
  // packages/cli/src/ui/components/SettingsDialog.tsx
116555
116576
  var import_chalk8 = __toESM(require_source(), 1);
116556
116577
  var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
116557
- var debugLogger39 = createDebugLogger("SETTINGS_DIALOG");
116578
+ var debugLogger40 = createDebugLogger("SETTINGS_DIALOG");
116558
116579
  var maxItemsToShow = 8;
116559
116580
  function SettingsDialog({
116560
116581
  settings,
@@ -116640,7 +116661,7 @@ function SettingsDialog({
116640
116661
  newValue,
116641
116662
  {}
116642
116663
  );
116643
- debugLogger39.debug(
116664
+ debugLogger40.debug(
116644
116665
  `[DEBUG SettingsDialog] Saving ${key} immediately with value:`,
116645
116666
  newValue
116646
116667
  );
@@ -116652,7 +116673,7 @@ function SettingsDialog({
116652
116673
  );
116653
116674
  if (key === "general.vimMode" && newValue !== vimEnabled) {
116654
116675
  toggleVimEnabled().catch((error) => {
116655
- debugLogger39.error("Failed to toggle vim mode:", error);
116676
+ debugLogger40.error("Failed to toggle vim mode:", error);
116656
116677
  });
116657
116678
  }
116658
116679
  if (key === "ui.compactMode" && newValue !== compactMode) {
@@ -116663,7 +116684,7 @@ function SettingsDialog({
116663
116684
  try {
116664
116685
  config?.setApprovalMode(settings.merged.tools.approvalMode);
116665
116686
  } catch (error) {
116666
- debugLogger39.error(
116687
+ debugLogger40.error(
116667
116688
  "Failed to apply approval mode to current session:",
116668
116689
  error
116669
116690
  );
@@ -117029,7 +117050,7 @@ function SettingsDialog({
117029
117050
  try {
117030
117051
  config?.setApprovalMode(settings.merged.tools.approvalMode);
117031
117052
  } catch (error) {
117032
- debugLogger39.error(
117053
+ debugLogger40.error(
117033
117054
  "Failed to apply approval mode to current session:",
117034
117055
  error
117035
117056
  );
@@ -119373,7 +119394,7 @@ var editorSettingsManager = new EditorSettingsManager();
119373
119394
 
119374
119395
  // packages/cli/src/ui/components/EditorSettingsDialog.tsx
119375
119396
  var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
119376
- var debugLogger40 = createDebugLogger("EDITOR_SETTINGS_DIALOG");
119397
+ var debugLogger41 = createDebugLogger("EDITOR_SETTINGS_DIALOG");
119377
119398
  function EditorSettingsDialog({
119378
119399
  onSelect,
119379
119400
  settings,
@@ -119400,7 +119421,7 @@ function EditorSettingsDialog({
119400
119421
  (item) => item.type === currentPreference
119401
119422
  ) : 0;
119402
119423
  if (editorIndex === -1) {
119403
- debugLogger40.error(`Editor is not supported: ${currentPreference}`);
119424
+ debugLogger41.error(`Editor is not supported: ${currentPreference}`);
119404
119425
  editorIndex = 0;
119405
119426
  }
119406
119427
  const handleEditorSelect = /* @__PURE__ */ __name((editorType) => {
@@ -121270,7 +121291,7 @@ __name(getDiffLineColor, "getDiffLineColor");
121270
121291
  init_esbuild_shims();
121271
121292
  var import_react104 = __toESM(require_react(), 1);
121272
121293
  var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1);
121273
- var debugLogger41 = createDebugLogger("ARENA_STOP_DIALOG");
121294
+ var debugLogger42 = createDebugLogger("ARENA_STOP_DIALOG");
121274
121295
  function ArenaStopDialog({
121275
121296
  config,
121276
121297
  addItem,
@@ -121342,7 +121363,7 @@ function ArenaStopDialog({
121342
121363
  }
121343
121364
  } catch (error) {
121344
121365
  const message = error instanceof Error ? error.message : String(error);
121345
- debugLogger41.error("Failed to stop Arena session:", error);
121366
+ debugLogger42.error("Failed to stop Arena session:", error);
121346
121367
  pushMessage({
121347
121368
  messageType: "error",
121348
121369
  content: `Failed to stop Arena session: ${message}`
@@ -121703,7 +121724,7 @@ import process21 from "node:process";
121703
121724
  // packages/cli/src/ui/components/IdeTrustChangeDialog.tsx
121704
121725
  init_esbuild_shims();
121705
121726
  var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
121706
- var debugLogger42 = createDebugLogger("IDE_TRUST_DIALOG");
121727
+ var debugLogger43 = createDebugLogger("IDE_TRUST_DIALOG");
121707
121728
  var IdeTrustChangeDialog = /* @__PURE__ */ __name(({ reason }) => {
121708
121729
  useKeypress(
121709
121730
  (key) => {
@@ -121715,7 +121736,7 @@ var IdeTrustChangeDialog = /* @__PURE__ */ __name(({ reason }) => {
121715
121736
  );
121716
121737
  let message = "Workspace trust has changed.";
121717
121738
  if (reason === "NONE") {
121718
- debugLogger42.error(
121739
+ debugLogger43.error(
121719
121740
  'IdeTrustChangeDialog rendered with unexpected reason "NONE"'
121720
121741
  );
121721
121742
  } else if (reason === "CONNECTION_CHANGE") {
@@ -122730,7 +122751,7 @@ __name(useLaunchEditor, "useLaunchEditor");
122730
122751
 
122731
122752
  // packages/cli/src/ui/components/subagents/create/CreationSummary.tsx
122732
122753
  var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
122733
- var debugLogger43 = createDebugLogger("SUBAGENT_CREATION_SUMMARY");
122754
+ var debugLogger44 = createDebugLogger("SUBAGENT_CREATION_SUMMARY");
122734
122755
  function CreationSummary({
122735
122756
  state,
122736
122757
  onPrevious: _onPrevious,
@@ -122786,7 +122807,7 @@ function CreationSummary({
122786
122807
  }
122787
122808
  }
122788
122809
  } catch (error) {
122789
- debugLogger43.warn("Error checking subagent name availability:", error);
122810
+ debugLogger44.warn("Error checking subagent name availability:", error);
122790
122811
  }
122791
122812
  if (state.generatedDescription.length > 1e3) {
122792
122813
  allWarnings.push(
@@ -123696,7 +123717,7 @@ __name(EditOptionsStep, "EditOptionsStep");
123696
123717
  // packages/cli/src/ui/components/subagents/manage/AgentDeleteStep.tsx
123697
123718
  init_esbuild_shims();
123698
123719
  var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
123699
- var debugLogger44 = createDebugLogger("AGENT_DELETE_STEP");
123720
+ var debugLogger45 = createDebugLogger("AGENT_DELETE_STEP");
123700
123721
  function AgentDeleteStep({
123701
123722
  selectedAgent,
123702
123723
  onDelete,
@@ -123709,7 +123730,7 @@ function AgentDeleteStep({
123709
123730
  try {
123710
123731
  await onDelete(selectedAgent);
123711
123732
  } catch (error) {
123712
- debugLogger44.error("Failed to delete agent:", error);
123733
+ debugLogger45.error("Failed to delete agent:", error);
123713
123734
  }
123714
123735
  } else if (key.name === "n") {
123715
123736
  onNavigateBack();
@@ -123728,7 +123749,7 @@ __name(AgentDeleteStep, "AgentDeleteStep");
123728
123749
 
123729
123750
  // packages/cli/src/ui/components/subagents/manage/AgentsManagerDialog.tsx
123730
123751
  var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
123731
- var debugLogger45 = createDebugLogger("AGENTS_MANAGER_DIALOG");
123752
+ var debugLogger46 = createDebugLogger("AGENTS_MANAGER_DIALOG");
123732
123753
  function AgentsManagerDialog({
123733
123754
  onClose,
123734
123755
  config
@@ -123784,7 +123805,7 @@ function AgentsManagerDialog({
123784
123805
  setNavigationStack([MANAGEMENT_STEPS.AGENT_SELECTION]);
123785
123806
  setSelectedAgentIndex(-1);
123786
123807
  } catch (error) {
123787
- debugLogger45.error("Failed to delete agent:", error);
123808
+ debugLogger46.error("Failed to delete agent:", error);
123788
123809
  throw error;
123789
123810
  }
123790
123811
  },
@@ -123890,7 +123911,7 @@ function AgentsManagerDialog({
123890
123911
  await loadAgents();
123891
123912
  handleNavigateBack();
123892
123913
  } catch (error) {
123893
- debugLogger45.error("Failed to save agent changes:", error);
123914
+ debugLogger46.error("Failed to save agent changes:", error);
123894
123915
  }
123895
123916
  }
123896
123917
  },
@@ -123915,7 +123936,7 @@ function AgentsManagerDialog({
123915
123936
  await loadAgents();
123916
123937
  handleNavigateBack();
123917
123938
  } catch (error) {
123918
- debugLogger45.error("Failed to save color changes:", error);
123939
+ debugLogger46.error("Failed to save color changes:", error);
123919
123940
  }
123920
123941
  }
123921
123942
  }
@@ -124252,7 +124273,7 @@ var ActionSelectionStep2 = /* @__PURE__ */ __name(({
124252
124273
  // packages/cli/src/ui/components/extensions/steps/UninstallConfirmStep.tsx
124253
124274
  init_esbuild_shims();
124254
124275
  var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
124255
- var debugLogger46 = createDebugLogger("EXTENSION_UNINSTALL_STEP");
124276
+ var debugLogger47 = createDebugLogger("EXTENSION_UNINSTALL_STEP");
124256
124277
  function UninstallConfirmStep({
124257
124278
  selectedExtension,
124258
124279
  onConfirm,
@@ -124265,7 +124286,7 @@ function UninstallConfirmStep({
124265
124286
  try {
124266
124287
  await onConfirm(selectedExtension);
124267
124288
  } catch (error) {
124268
- debugLogger46.error("Failed to uninstall extension:", error);
124289
+ debugLogger47.error("Failed to uninstall extension:", error);
124269
124290
  }
124270
124291
  } else if (key.name === "n" || key.name === "escape") {
124271
124292
  onNavigateBack();
@@ -124332,7 +124353,7 @@ __name(ScopeSelectStep, "ScopeSelectStep");
124332
124353
 
124333
124354
  // packages/cli/src/ui/components/extensions/ExtensionsManagerDialog.tsx
124334
124355
  var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
124335
- var debugLogger47 = createDebugLogger("EXTENSIONS_MANAGER_DIALOG");
124356
+ var debugLogger48 = createDebugLogger("EXTENSIONS_MANAGER_DIALOG");
124336
124357
  function ExtensionsManagerDialog({
124337
124358
  onClose,
124338
124359
  config
@@ -124353,7 +124374,7 @@ function ExtensionsManagerDialog({
124353
124374
  if (!config) return;
124354
124375
  const extensionManager = config.getExtensionManager();
124355
124376
  if (!extensionManager) {
124356
- debugLogger47.error("ExtensionManager not available");
124377
+ debugLogger48.error("ExtensionManager not available");
124357
124378
  return;
124358
124379
  }
124359
124380
  try {
@@ -124361,7 +124382,7 @@ function ExtensionsManagerDialog({
124361
124382
  const loadedExtensions = extensionManager.getLoadedExtensions();
124362
124383
  setExtensions(loadedExtensions);
124363
124384
  } catch (error) {
124364
- debugLogger47.error("Failed to load extensions:", error);
124385
+ debugLogger48.error("Failed to load extensions:", error);
124365
124386
  }
124366
124387
  }, [config]);
124367
124388
  (0, import_react121.useEffect)(() => {
@@ -124415,12 +124436,12 @@ function ExtensionsManagerDialog({
124415
124436
  selectedExtension,
124416
124437
  "update available" /* UPDATE_AVAILABLE */,
124417
124438
  (name, newState) => {
124418
- debugLogger47.debug(`Update state for ${name}:`, newState);
124439
+ debugLogger48.debug(`Update state for ${name}:`, newState);
124419
124440
  }
124420
124441
  );
124421
124442
  await loadExtensions();
124422
124443
  await extensionManager.checkForAllExtensionUpdates((name, newState) => {
124423
- debugLogger47.debug(`Recheck update state for ${name}:`, newState);
124444
+ debugLogger48.debug(`Recheck update state for ${name}:`, newState);
124424
124445
  });
124425
124446
  setSuccessMessage(
124426
124447
  t('Extension "{{name}}" updated successfully.', {
@@ -124429,7 +124450,7 @@ function ExtensionsManagerDialog({
124429
124450
  );
124430
124451
  handleNavigateBack();
124431
124452
  } catch (error) {
124432
- debugLogger47.error("Failed to update extension:", error);
124453
+ debugLogger48.error("Failed to update extension:", error);
124433
124454
  setUpdateError(
124434
124455
  error instanceof Error ? error.message : "Unknown error occurred"
124435
124456
  );
@@ -124502,7 +124523,7 @@ function ExtensionsManagerDialog({
124502
124523
  setErrorMessage(null);
124503
124524
  setNavigationStack([MANAGEMENT_STEPS2.EXTENSION_LIST]);
124504
124525
  } catch (error) {
124505
- debugLogger47.error(
124526
+ debugLogger48.error(
124506
124527
  `Failed to ${newState ? "enable" : "disable"} extension:`,
124507
124528
  error
124508
124529
  );
@@ -124543,7 +124564,7 @@ function ExtensionsManagerDialog({
124543
124564
  setNavigationStack([MANAGEMENT_STEPS2.EXTENSION_LIST]);
124544
124565
  setSelectedExtensionIndex(-1);
124545
124566
  } catch (error) {
124546
- debugLogger47.error("Failed to uninstall extension:", error);
124567
+ debugLogger48.error("Failed to uninstall extension:", error);
124547
124568
  throw error;
124548
124569
  }
124549
124570
  },
@@ -125508,7 +125529,7 @@ var AuthenticateStep = /* @__PURE__ */ __name(({
125508
125529
 
125509
125530
  // packages/cli/src/ui/components/mcp/MCPManagementDialog.tsx
125510
125531
  var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1);
125511
- var debugLogger48 = createDebugLogger("MCP_DIALOG");
125532
+ var debugLogger49 = createDebugLogger("MCP_DIALOG");
125512
125533
  var MCPManagementDialog = /* @__PURE__ */ __name(({
125513
125534
  onClose
125514
125535
  }) => {
@@ -125585,7 +125606,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125585
125606
  const serverInfos = await fetchServerData();
125586
125607
  setServers(serverInfos);
125587
125608
  } catch (error) {
125588
- debugLogger48.error("Error loading MCP servers:", error);
125609
+ debugLogger49.error("Error loading MCP servers:", error);
125589
125610
  } finally {
125590
125611
  setIsLoading(false);
125591
125612
  }
@@ -125666,7 +125687,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125666
125687
  const serverInfos = await fetchServerData();
125667
125688
  setServers(serverInfos);
125668
125689
  } catch (error) {
125669
- debugLogger48.error("Error reloading MCP servers:", error);
125690
+ debugLogger49.error("Error reloading MCP servers:", error);
125670
125691
  } finally {
125671
125692
  setIsLoading(false);
125672
125693
  }
@@ -125677,7 +125698,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125677
125698
  setIsLoading(true);
125678
125699
  const tokenStorage = new MCPOAuthTokenStorage();
125679
125700
  await tokenStorage.deleteCredentials(selectedServer.name);
125680
- debugLogger48.info(
125701
+ debugLogger49.info(
125681
125702
  `Cleared OAuth tokens for server '${selectedServer.name}'`
125682
125703
  );
125683
125704
  const toolRegistry = config.getToolRegistry();
@@ -125686,7 +125707,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125686
125707
  }
125687
125708
  await reloadServers();
125688
125709
  } catch (error) {
125689
- debugLogger48.error(
125710
+ debugLogger49.error(
125690
125711
  `Error clearing OAuth tokens for server '${selectedServer.name}':`,
125691
125712
  error
125692
125713
  );
@@ -125704,7 +125725,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125704
125725
  }
125705
125726
  await reloadServers();
125706
125727
  } catch (error) {
125707
- debugLogger48.error(
125728
+ debugLogger49.error(
125708
125729
  `Error reconnecting to server '${selectedServer.name}':`,
125709
125730
  error
125710
125731
  );
@@ -125739,7 +125760,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125739
125760
  }
125740
125761
  await reloadServers();
125741
125762
  } catch (error) {
125742
- debugLogger48.error(
125763
+ debugLogger49.error(
125743
125764
  `Error enabling server '${selectedServer.name}':`,
125744
125765
  error
125745
125766
  );
@@ -125758,7 +125779,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125758
125779
  const settings = loadSettings();
125759
125780
  let targetScope = "user";
125760
125781
  if (server.source === "extension") {
125761
- debugLogger48.warn(
125782
+ debugLogger49.warn(
125762
125783
  `Cannot disable extension MCP server '${server.name}'`
125763
125784
  );
125764
125785
  setIsLoading(false);
@@ -125784,7 +125805,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125784
125805
  }
125785
125806
  await reloadServers();
125786
125807
  } catch (error) {
125787
- debugLogger48.error(
125808
+ debugLogger49.error(
125788
125809
  `Error disabling server '${selectedServer.name}':`,
125789
125810
  error
125790
125811
  );
@@ -125819,7 +125840,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
125819
125840
  await reloadServers();
125820
125841
  handleNavigateBack();
125821
125842
  } catch (error) {
125822
- debugLogger48.error(
125843
+ debugLogger49.error(
125823
125844
  `Error disabling server '${selectedServer.name}':`,
125824
125845
  error
125825
125846
  );
@@ -126187,6 +126208,10 @@ function getHookExitCodes(eventName) {
126187
126208
  { code: 0, description: t("use hook decision if provided") },
126188
126209
  { code: "Other", description: t("show stderr to user only") }
126189
126210
  ],
126211
+ ["PermissionDenied" /* PermissionDenied */]: [
126212
+ { code: 0, description: t("stdout/stderr not shown") },
126213
+ { code: "Other", description: t("show stderr to user only") }
126214
+ ],
126190
126215
  ["TodoCreated" /* TodoCreated */]: [
126191
126216
  { code: 0, description: t("allow todo creation") },
126192
126217
  {
@@ -126227,6 +126252,9 @@ function getHookShortDescription(eventName) {
126227
126252
  ["PermissionRequest" /* PermissionRequest */]: t(
126228
126253
  "When a permission dialog is displayed"
126229
126254
  ),
126255
+ ["PermissionDenied" /* PermissionDenied */]: t(
126256
+ "When a tool call is denied before a permission dialog is displayed"
126257
+ ),
126230
126258
  ["TodoCreated" /* TodoCreated */]: t("When a new todo item is created"),
126231
126259
  ["TodoCompleted" /* TodoCompleted */]: t("When a todo item is marked as completed")
126232
126260
  };
@@ -126269,6 +126297,9 @@ function getHookDescription(eventName) {
126269
126297
  ["PermissionRequest" /* PermissionRequest */]: t(
126270
126298
  "Input to command is JSON with tool_name, tool_input, and tool_use_id. Output JSON with hookSpecificOutput containing decision to allow or deny."
126271
126299
  ),
126300
+ ["PermissionDenied" /* PermissionDenied */]: t(
126301
+ "Input to command is JSON with tool_name, tool_input, tool_use_id, and reason."
126302
+ ),
126272
126303
  ["TodoCreated" /* TodoCreated */]: t(
126273
126304
  "Input to command is JSON with todo_id, todo_content, todo_status, all_todos, and phase. In validation, output JSON with decision (allow/block/deny) and reason. In postWrite, block/deny is ignored."
126274
126305
  ),
@@ -126544,7 +126575,7 @@ __name(HooksDisabledStep, "HooksDisabledStep");
126544
126575
 
126545
126576
  // packages/cli/src/ui/components/hooks/HooksManagementDialog.tsx
126546
126577
  var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1);
126547
- var debugLogger49 = createDebugLogger("HOOKS_DIALOG");
126578
+ var debugLogger50 = createDebugLogger("HOOKS_DIALOG");
126548
126579
  function isValidHookConfig(config) {
126549
126580
  if (typeof config !== "object" || config === null || !("type" in config)) {
126550
126581
  return false;
@@ -126613,7 +126644,7 @@ function getValidHookDefinitions(hooksRecord, eventName) {
126613
126644
  if (isValidHookDefinition(def)) {
126614
126645
  result.push(def);
126615
126646
  } else {
126616
- debugLogger49.warn(
126647
+ debugLogger50.warn(
126617
126648
  `Skipping invalid hook definition for ${eventName}:`,
126618
126649
  def
126619
126650
  );
@@ -126805,15 +126836,15 @@ function HooksManagementDialog({
126805
126836
  setIsLoading(true);
126806
126837
  setLoadError(null);
126807
126838
  try {
126808
- debugLogger49.debug("Fetching hooks data for dialog");
126839
+ debugLogger50.debug("Fetching hooks data for dialog");
126809
126840
  const hooksData = fetchHooksData();
126810
- debugLogger49.debug("Hooks data fetched:", hooksData.length, "events");
126841
+ debugLogger50.debug("Hooks data fetched:", hooksData.length, "events");
126811
126842
  if (!cancelled) {
126812
126843
  setHooks(hooksData);
126813
126844
  }
126814
126845
  } catch (error) {
126815
126846
  if (!cancelled) {
126816
- debugLogger49.error("Error loading hooks:", error);
126847
+ debugLogger50.error("Error loading hooks:", error);
126817
126848
  setLoadError(
126818
126849
  error instanceof Error ? error.message : "Failed to load hooks"
126819
126850
  );
@@ -127477,7 +127508,12 @@ function convertToHistoryItems(conversation, config) {
127477
127508
  const payload = record2.systemPayload;
127478
127509
  if (!payload) continue;
127479
127510
  if (payload.phase === "invocation" && payload.rawCommand) {
127480
- items.push({ type: "user", text: payload.rawCommand });
127511
+ const sentToModel = typeof payload.sentToModel === "boolean" ? payload.sentToModel : void 0;
127512
+ items.push({
127513
+ type: "user",
127514
+ text: payload.rawCommand,
127515
+ ...sentToModel === void 0 ? {} : { sentToModel }
127516
+ });
127481
127517
  }
127482
127518
  if (payload.phase === "result") {
127483
127519
  const outputs = payload.outputHistoryItems ?? [];
@@ -127984,6 +128020,7 @@ var import_react132 = __toESM(require_react(), 1);
127984
128020
  init_esbuild_shims();
127985
128021
  function isRealUserTurn(item) {
127986
128022
  if (item.type !== "user" || !item.text) return false;
128023
+ if (typeof item.sentToModel === "boolean") return item.sentToModel;
127987
128024
  return !isSlashCommand(item.text) && !item.text.startsWith("?");
127988
128025
  }
127989
128026
  __name(isRealUserTurn, "isRealUserTurn");
@@ -128441,7 +128478,7 @@ var import_react135 = __toESM(require_react(), 1);
128441
128478
  // packages/cli/src/ui/hooks/useTurnDiffs.ts
128442
128479
  init_esbuild_shims();
128443
128480
  var import_react133 = __toESM(require_react(), 1);
128444
- var debugLogger50 = createDebugLogger("DiffDialog");
128481
+ var debugLogger51 = createDebugLogger("DiffDialog");
128445
128482
  var TURN_CONCURRENCY = 4;
128446
128483
  function useTurnDiffs(history, fileHistoryService, enabled2) {
128447
128484
  const [turns, setTurns] = (0, import_react133.useState)([]);
@@ -128492,7 +128529,7 @@ function useTurnDiffs(history, fileHistoryService, enabled2) {
128492
128529
  setTurns(entries);
128493
128530
  setLoading(false);
128494
128531
  }).catch((err) => {
128495
- debugLogger50.debug(`useTurnDiffs pipeline failed: ${err}`);
128532
+ debugLogger51.debug(`useTurnDiffs pipeline failed: ${err}`);
128496
128533
  if (!cancelled) setLoading(false);
128497
128534
  });
128498
128535
  return () => {
@@ -128515,7 +128552,7 @@ __name(previewOfUserItem, "previewOfUserItem");
128515
128552
  // packages/cli/src/ui/hooks/useDiffData.ts
128516
128553
  init_esbuild_shims();
128517
128554
  var import_react134 = __toESM(require_react(), 1);
128518
- var debugLogger51 = createDebugLogger("DiffDialog");
128555
+ var debugLogger52 = createDebugLogger("DiffDialog");
128519
128556
  function useDiffData(cwd5) {
128520
128557
  const [result, setResult] = (0, import_react134.useState)(null);
128521
128558
  const [hunks, setHunks] = (0, import_react134.useState)(/* @__PURE__ */ new Map());
@@ -128531,11 +128568,11 @@ function useDiffData(cwd5) {
128531
128568
  setLoading(true);
128532
128569
  Promise.all([
128533
128570
  fetchGitDiff(cwd5).catch((err) => {
128534
- debugLogger51.debug(`fetchGitDiff failed: ${err}`);
128571
+ debugLogger52.debug(`fetchGitDiff failed: ${err}`);
128535
128572
  return null;
128536
128573
  }),
128537
128574
  fetchGitDiffHunks(cwd5).catch((err) => {
128538
- debugLogger51.debug(`fetchGitDiffHunks failed: ${err}`);
128575
+ debugLogger52.debug(`fetchGitDiffHunks failed: ${err}`);
128539
128576
  return /* @__PURE__ */ new Map();
128540
128577
  })
128541
128578
  ]).then(([statsRes, hunksRes]) => {
@@ -128544,7 +128581,7 @@ function useDiffData(cwd5) {
128544
128581
  setHunks(hunksRes);
128545
128582
  setLoading(false);
128546
128583
  }).catch((err) => {
128547
- debugLogger51.debug(`useDiffData pipeline failed: ${err}`);
128584
+ debugLogger52.debug(`useDiffData pipeline failed: ${err}`);
128548
128585
  if (!cancelled) setLoading(false);
128549
128586
  });
128550
128587
  return () => {
@@ -129519,7 +129556,7 @@ __name(useBackgroundTaskView, "useBackgroundTaskView");
129519
129556
 
129520
129557
  // packages/cli/src/ui/contexts/BackgroundTaskViewContext.tsx
129521
129558
  var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1);
129522
- var debugLogger52 = createDebugLogger("BG_TASK_VIEW");
129559
+ var debugLogger53 = createDebugLogger("BG_TASK_VIEW");
129523
129560
  var BackgroundTaskViewStateContext = (0, import_react138.createContext)(null);
129524
129561
  var BackgroundTaskViewActionsContext = (0, import_react138.createContext)(null);
129525
129562
  var DEFAULT_STATE = {
@@ -129637,7 +129674,7 @@ function BackgroundTaskViewProvider({
129637
129674
  case "dream": {
129638
129675
  const ok = config.getMemoryManager().cancelTask(target.dreamId);
129639
129676
  if (!ok) {
129640
- debugLogger52.warn(
129677
+ debugLogger53.warn(
129641
129678
  `cancelSelected: dream task ${target.dreamId} could not be cancelled (internal state inconsistency \u2014 see MemoryManager.cancelTask warn).`
129642
129679
  );
129643
129680
  }
@@ -131216,7 +131253,7 @@ var import_react144 = __toESM(require_react(), 1);
131216
131253
  import * as fs26 from "node:fs/promises";
131217
131254
  import * as path33 from "node:path";
131218
131255
  var MAX_HISTORY_LENGTH = 100;
131219
- var debugLogger53 = createDebugLogger("SHELL_HISTORY");
131256
+ var debugLogger54 = createDebugLogger("SHELL_HISTORY");
131220
131257
  async function getHistoryFilePath(projectRoot, configStorage) {
131221
131258
  const storage = configStorage ?? new Storage(projectRoot);
131222
131259
  return storage.getHistoryFilePath();
@@ -131242,7 +131279,7 @@ async function readHistoryFile(filePath) {
131242
131279
  return result;
131243
131280
  } catch (err) {
131244
131281
  if (isNodeError(err) && err.code === "ENOENT") return [];
131245
- debugLogger53.error("Error reading history:", err);
131282
+ debugLogger54.error("Error reading history:", err);
131246
131283
  return [];
131247
131284
  }
131248
131285
  }
@@ -131252,7 +131289,7 @@ async function writeHistoryFile(filePath, history) {
131252
131289
  await fs26.mkdir(path33.dirname(filePath), { recursive: true });
131253
131290
  await fs26.writeFile(filePath, history.join("\n"));
131254
131291
  } catch (error) {
131255
- debugLogger53.error("Error writing shell history:", error);
131292
+ debugLogger54.error("Error writing shell history:", error);
131256
131293
  }
131257
131294
  }
131258
131295
  __name(writeHistoryFile, "writeHistoryFile");
@@ -131670,12 +131707,12 @@ __name(useAtCompletion, "useAtCompletion");
131670
131707
  // packages/cli/src/ui/hooks/useSlashCompletion.ts
131671
131708
  init_esbuild_shims();
131672
131709
  var import_react148 = __toESM(require_react(), 1);
131673
- var debugLogger54 = createDebugLogger("SLASH_COMPLETION");
131710
+ var debugLogger55 = createDebugLogger("SLASH_COMPLETION");
131674
131711
  function logErrorSafely(error, context) {
131675
131712
  if (error instanceof Error) {
131676
- debugLogger54.error(`[${context}]`, error);
131713
+ debugLogger55.error(`[${context}]`, error);
131677
131714
  } else {
131678
- debugLogger54.error(`[${context}] Non-error thrown:`, error);
131715
+ debugLogger55.error(`[${context}] Non-error thrown:`, error);
131679
131716
  }
131680
131717
  }
131681
131718
  __name(logErrorSafely, "logErrorSafely");
@@ -131846,7 +131883,7 @@ function useCommandSuggestions(parserResult, commandContext, getFzfForCommands,
131846
131883
  const fetchAndSetSuggestions = /* @__PURE__ */ __name(async () => {
131847
131884
  if (signal.aborted) return;
131848
131885
  if (!leafCommand?.completion) {
131849
- debugLogger54.warn(
131886
+ debugLogger55.warn(
131850
131887
  "Attempted argument completion without completion function"
131851
131888
  );
131852
131889
  return;
@@ -133297,7 +133334,7 @@ var calculatePromptWidths = /* @__PURE__ */ __name((terminalWidth) => {
133297
133334
 
133298
133335
  // packages/cli/src/ui/components/InputPrompt.tsx
133299
133336
  var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
133300
- var debugLogger55 = createDebugLogger("INPUT_PROMPT");
133337
+ var debugLogger56 = createDebugLogger("INPUT_PROMPT");
133301
133338
  var LARGE_PASTE_CHAR_THRESHOLD = 1e3;
133302
133339
  var LARGE_PASTE_LINE_THRESHOLD = 10;
133303
133340
  var InputPrompt = /* @__PURE__ */ __name(({
@@ -133586,7 +133623,7 @@ ${finalValue.trim()}`;
133586
133623
  }
133587
133624
  }
133588
133625
  } catch (error) {
133589
- debugLogger55.error("Error handling clipboard image:", error);
133626
+ debugLogger56.error("Error handling clipboard image:", error);
133590
133627
  }
133591
133628
  }, []);
133592
133629
  const handleAttachmentDelete = (0, import_react156.useCallback)((index) => {
@@ -136831,7 +136868,7 @@ var FEEDBACK_SHOW_PROBABILITY = 0.25;
136831
136868
  var MIN_TOOL_CALLS = 10;
136832
136869
  var MIN_USER_MESSAGES = 5;
136833
136870
  var FEEDBACK_COOLDOWN_HOURS = 24;
136834
- var debugLogger56 = createDebugLogger("FEEDBACK_DIALOG");
136871
+ var debugLogger57 = createDebugLogger("FEEDBACK_DIALOG");
136835
136872
  var lastMessageIsAIResponse = /* @__PURE__ */ __name((history) => history.length > 0 && history[history.length - 1].type === "gemini" /* GEMINI */, "lastMessageIsAIResponse");
136836
136873
  var getFeedbackLastShownTimestampFromFile = /* @__PURE__ */ __name(() => {
136837
136874
  try {
@@ -136843,7 +136880,7 @@ var getFeedbackLastShownTimestampFromFile = /* @__PURE__ */ __name(() => {
136843
136880
  }
136844
136881
  } catch (error) {
136845
136882
  if (isNodeError(error) && error.code !== "ENOENT") {
136846
- debugLogger56.warn(
136883
+ debugLogger57.warn(
136847
136884
  "Failed to read feedbackLastShownTimestamp from settings file:",
136848
136885
  error
136849
136886
  );
@@ -137218,13 +137255,11 @@ function useResumeCommand(options) {
137218
137255
  }
137219
137256
  if (hasBlockingBackgroundWork(config)) {
137220
137257
  closeResumeDialog();
137221
- addItem?.(
137222
- {
137223
- type: "error" /* ERROR */,
137224
- text: BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE
137225
- },
137226
- Date.now()
137227
- );
137258
+ const blockedMessage = {
137259
+ type: "error" /* ERROR */,
137260
+ text: BACKGROUND_WORK_SWITCH_BLOCKED_MESSAGE
137261
+ };
137262
+ addItem?.(blockedMessage, Date.now());
137228
137263
  return;
137229
137264
  }
137230
137265
  closeResumeDialog();
@@ -137250,13 +137285,11 @@ function useResumeCommand(options) {
137250
137285
  await config.getGeminiClient()?.initialize?.();
137251
137286
  const recovered = await config.loadPausedBackgroundAgents(sessionId);
137252
137287
  if (recovered.length > 0) {
137253
- addItem?.(
137254
- {
137255
- type: "info" /* INFO */,
137256
- text: config.getBackgroundAgentResumeService().buildRecoveredBackgroundAgentsNotice(recovered.length)
137257
- },
137258
- Date.now()
137259
- );
137288
+ const recoveredMessage = {
137289
+ type: "info" /* INFO */,
137290
+ text: config.getBackgroundAgentResumeService().buildRecoveredBackgroundAgentsNotice(recovered.length)
137291
+ };
137292
+ addItem?.(recoveredMessage, Date.now());
137260
137293
  }
137261
137294
  remount?.();
137262
137295
  },
@@ -137938,7 +137971,7 @@ var LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
137938
137971
  var MAX_CHUNK_SIZE = 1024 * 1024 * 8;
137939
137972
 
137940
137973
  // packages/cli/src/ui/hooks/slashCommandProcessor.ts
137941
- var debugLogger57 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
137974
+ var debugLogger58 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
137942
137975
  function serializeHistoryItemForRecording(item) {
137943
137976
  const clone = { ...item };
137944
137977
  if ("timestamp" in clone && clone["timestamp"] instanceof Date) {
@@ -137958,7 +137991,7 @@ var SLASH_COMMANDS_SKIP_RECORDING = /* @__PURE__ */ new Set([
137958
137991
  "branch",
137959
137992
  "btw"
137960
137993
  ]);
137961
- var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger3, setSessionName) => {
137994
+ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, isProcessing, setIsProcessing, isIdleRef, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized, logger3, updateItem, setSessionName) => {
137962
137995
  const { stats: sessionStats, startNewSession } = useSessionStats();
137963
137996
  const [commands, setCommands] = (0, import_react182.useState)([]);
137964
137997
  const [recentCommands, setRecentCommands] = (0, import_react182.useState)(/* @__PURE__ */ new Map());
@@ -138256,7 +138289,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
138256
138289
  }
138257
138290
  setCommands(commandService.getCommandsForMode("interactive"));
138258
138291
  } catch (error) {
138259
- debugLogger57.error("Failed to load slash commands:", error);
138292
+ debugLogger58.error("Failed to load slash commands:", error);
138260
138293
  } finally {
138261
138294
  if (!controller.signal.aborted) {
138262
138295
  resolveCommandReloads(reloadTrigger);
@@ -138276,7 +138309,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
138276
138309
  resolveCommandReloads
138277
138310
  ]);
138278
138311
  const handleSlashCommand2 = (0, import_react182.useCallback)(
138279
- async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed) => {
138312
+ async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed, existingInvocationItemId) => {
138280
138313
  if (typeof rawQuery !== "string") {
138281
138314
  return false;
138282
138315
  }
@@ -138299,13 +138332,16 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
138299
138332
  const abortController = new AbortController();
138300
138333
  abortControllerRef.current = abortController;
138301
138334
  const userMessageTimestamp = Date.now();
138302
- if (!isBtwCommand(trimmed)) {
138303
- addItemWithRecording(
138304
- { type: "user" /* USER */, text: trimmed },
138335
+ let invocationItemId = existingInvocationItemId;
138336
+ let invocationSentToModel = false;
138337
+ if (!isBtwCommand(trimmed) && invocationItemId === void 0) {
138338
+ invocationItemId = addItemWithRecording(
138339
+ { type: "user" /* USER */, text: trimmed, sentToModel: false },
138305
138340
  userMessageTimestamp
138306
138341
  );
138307
138342
  }
138308
138343
  let hasError = false;
138344
+ let delegatedToRecursiveInvocation = false;
138309
138345
  const {
138310
138346
  commandToExecute,
138311
138347
  args,
@@ -138496,6 +138532,15 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
138496
138532
  actions.quit(result.messages);
138497
138533
  return { type: "handled" };
138498
138534
  case "submit_prompt":
138535
+ if (invocationItemId !== void 0) {
138536
+ invocationSentToModel = true;
138537
+ debugLogger58.debug(
138538
+ `Marked slash command invocation as model-sent: /${resolvedCommandPath.join(
138539
+ " "
138540
+ )}`
138541
+ );
138542
+ updateItem(invocationItemId, { sentToModel: true });
138543
+ }
138499
138544
  return {
138500
138545
  type: "submit_prompt",
138501
138546
  content: result.content,
@@ -138522,10 +138567,13 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
138522
138567
  (prev) => /* @__PURE__ */ new Set([...prev, ...approvedCommands])
138523
138568
  );
138524
138569
  }
138570
+ delegatedToRecursiveInvocation = true;
138525
138571
  return await handleSlashCommand2(
138526
138572
  result.originalInvocation.raw,
138527
138573
  // Pass the approved commands as a one-time grant for this execution.
138528
- new Set(approvedCommands)
138574
+ new Set(approvedCommands),
138575
+ void 0,
138576
+ invocationItemId
138529
138577
  );
138530
138578
  }
138531
138579
  case "confirm_action": {
@@ -138548,10 +138596,12 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
138548
138596
  );
138549
138597
  return { type: "handled" };
138550
138598
  }
138599
+ delegatedToRecursiveInvocation = true;
138551
138600
  return await handleSlashCommand2(
138552
138601
  result.originalInvocation.raw,
138553
138602
  void 0,
138554
- true
138603
+ true,
138604
+ invocationItemId
138555
138605
  );
138556
138606
  }
138557
138607
  case "stream_messages": {
@@ -138609,13 +138659,14 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
138609
138659
  } finally {
138610
138660
  if (config?.getChatRecordingService) {
138611
138661
  const chatRecorder = config.getChatRecordingService();
138612
- const primaryCommand = resolvedCommandPath[0] || trimmed.replace(/^[/?]/, "").split(/\s+/)[0] || trimmed;
138613
- const shouldRecord = !SLASH_COMMANDS_SKIP_RECORDING.has(primaryCommand);
138662
+ const primaryCommand = resolvedCommandPath[0] || trimmed.replace(/^[/?]/, "").split(/\s+/u)[0] || trimmed;
138663
+ const shouldRecord = !delegatedToRecursiveInvocation && !SLASH_COMMANDS_SKIP_RECORDING.has(primaryCommand);
138614
138664
  try {
138615
138665
  if (shouldRecord) {
138616
138666
  chatRecorder?.recordSlashCommand({
138617
138667
  phase: "invocation",
138618
- rawCommand: trimmed
138668
+ rawCommand: trimmed,
138669
+ sentToModel: invocationSentToModel
138619
138670
  });
138620
138671
  const outputItems = recordedItems.filter((item) => item.type !== "user").map(serializeHistoryItemForRecording);
138621
138672
  chatRecorder?.recordSlashCommand({
@@ -138625,13 +138676,13 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
138625
138676
  });
138626
138677
  }
138627
138678
  } catch (recordError) {
138628
- debugLogger57.error(
138679
+ debugLogger58.error(
138629
138680
  "[slashCommand] Failed to record slash command:",
138630
138681
  recordError
138631
138682
  );
138632
138683
  }
138633
138684
  }
138634
- if (config && resolvedCommandPath[0] && !hasError) {
138685
+ if (config && resolvedCommandPath[0] && !hasError && !delegatedToRecursiveInvocation) {
138635
138686
  const event = makeSlashCommandEvent({
138636
138687
  command: resolvedCommandPath[0],
138637
138688
  subcommand,
@@ -138652,7 +138703,8 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
138652
138703
  setShellConfirmationRequest,
138653
138704
  setSessionShellAllowlist,
138654
138705
  setIsProcessing,
138655
- setConfirmationRequest
138706
+ setConfirmationRequest,
138707
+ updateItem
138656
138708
  ]
138657
138709
  );
138658
138710
  return {
@@ -138748,7 +138800,7 @@ import os16 from "node:os";
138748
138800
  import fs28 from "node:fs";
138749
138801
  var OUTPUT_UPDATE_INTERVAL_MS = 1e3;
138750
138802
  var MAX_OUTPUT_LENGTH = 1e4;
138751
- var debugLogger58 = createDebugLogger("SHELL_COMMAND_PROCESSOR");
138803
+ var debugLogger59 = createDebugLogger("SHELL_COMMAND_PROCESSOR");
138752
138804
  function addShellCommandToGeminiHistory(geminiClient, rawQuery, resultText) {
138753
138805
  const modelContent = resultText.length > MAX_OUTPUT_LENGTH ? resultText.substring(0, MAX_OUTPUT_LENGTH) + "\n... (truncated)" : resultText;
138754
138806
  geminiClient.addHistory({
@@ -138891,7 +138943,7 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
138891
138943
  config.getShouldUseNodePtyShell(),
138892
138944
  shellExecutionConfig
138893
138945
  );
138894
- debugLogger58.debug(terminalHeight, terminalWidth);
138946
+ debugLogger59.debug(terminalHeight, terminalWidth);
138895
138947
  executionPid = pid;
138896
138948
  if (pid) {
138897
138949
  setActiveShellPtyId(pid);
@@ -139104,7 +139156,7 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
139104
139156
  init_esbuild_shims();
139105
139157
  var import_react187 = __toESM(require_react(), 1);
139106
139158
  import * as path36 from "node:path";
139107
- var debugLogger59 = createDebugLogger("REACT_TOOL_SCHEDULER");
139159
+ var debugLogger60 = createDebugLogger("REACT_TOOL_SCHEDULER");
139108
139160
  function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
139109
139161
  const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react187.useState)([]);
139110
139162
  const outputUpdateHandler = (0, import_react187.useCallback)(
@@ -139210,7 +139262,7 @@ function mapCoreStatusToDisplayStatus(coreStatus) {
139210
139262
  return "Pending" /* Pending */;
139211
139263
  default: {
139212
139264
  const exhaustiveCheck = coreStatus;
139213
- debugLogger59.warn(`Unknown core status encountered: ${exhaustiveCheck}`);
139265
+ debugLogger60.warn(`Unknown core status encountered: ${exhaustiveCheck}`);
139214
139266
  return "Error" /* Error */;
139215
139267
  }
139216
139268
  }
@@ -139339,7 +139391,7 @@ function useDualOutput() {
139339
139391
  __name(useDualOutput, "useDualOutput");
139340
139392
 
139341
139393
  // packages/cli/src/ui/hooks/useGeminiStream.ts
139342
- var debugLogger60 = createDebugLogger("GEMINI_STREAM");
139394
+ var debugLogger61 = createDebugLogger("GEMINI_STREAM");
139343
139395
  function extractLastAssistantText(history) {
139344
139396
  for (let i = history.length - 1; i >= 0; i--) {
139345
139397
  const item = history[i];
@@ -139978,7 +140030,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
139978
140030
  eventValue.error.message,
139979
140031
  formattedErrorText
139980
140032
  ).catch((err) => {
139981
- debugLogger60.warn(`StopFailure hook failed: ${err}`);
140033
+ debugLogger61.warn(`StopFailure hook failed: ${err}`);
139982
140034
  });
139983
140035
  },
139984
140036
  [
@@ -140049,10 +140101,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
140049
140101
  addItem(pendingHistoryItemRef.current, userMessageTimestamp);
140050
140102
  setPendingHistoryItem(null);
140051
140103
  }
140104
+ const reasonClause = eventValue?.triggerReason === "image_overflow" ? `accumulated enough tool screenshots to trigger compaction for ${config.getModel()}` : `approached the input token limit for ${config.getModel()}`;
140052
140105
  return addItem(
140053
140106
  {
140054
140107
  type: "info",
140055
- text: `IMPORTANT: This conversation approached the input token limit for ${config.getModel()}. A compressed context will be sent for future messages (compressed from: ${eventValue?.originalTokenCount ?? "unknown"} to ${eventValue?.newTokenCount ?? "unknown"} tokens).`
140108
+ text: `IMPORTANT: This conversation ${reasonClause}. A compressed context will be sent for future messages (compressed from: ${eventValue?.originalTokenCount ?? "unknown"} to ${eventValue?.newTokenCount ?? "unknown"} tokens).`
140056
140109
  },
140057
140110
  Date.now()
140058
140111
  );
@@ -140638,7 +140691,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
140638
140691
  "proceed_once" /* ProceedOnce */
140639
140692
  );
140640
140693
  } catch (error) {
140641
- debugLogger60.error(
140694
+ debugLogger61.error(
140642
140695
  `Failed to auto-approve tool call ${call.request.callId}:`,
140643
140696
  error
140644
140697
  );
@@ -140667,7 +140720,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
140667
140720
  );
140668
140721
  const dedupedCallIds = dedupedTools.map((tc) => tc.request.callId);
140669
140722
  if (dedupedCallIds.length > 0) {
140670
- debugLogger60.warn(
140723
+ debugLogger61.warn(
140671
140724
  `[REPAIR] Dropping ${dedupedCallIds.length} late tool result(s) whose callId already has a functionResponse in history: ${dedupedCallIds.join(", ")}`
140672
140725
  );
140673
140726
  for (const tc of dedupedTools) {
@@ -141038,7 +141091,7 @@ var import_react190 = __toESM(require_react(), 1);
141038
141091
  var DIGIT_MULTIPLIER = 10;
141039
141092
  var DEFAULT_COUNT = 1;
141040
141093
  var DIGIT_1_TO_9 = /^[1-9]$/;
141041
- var debugLogger61 = createDebugLogger("VIM_MODE");
141094
+ var debugLogger62 = createDebugLogger("VIM_MODE");
141042
141095
  var CMD_TYPES = {
141043
141096
  DELETE_WORD_FORWARD: "dw",
141044
141097
  DELETE_WORD_BACKWARD: "db",
@@ -141288,7 +141341,7 @@ function useVim(buffer, onSubmit) {
141288
141341
  try {
141289
141342
  normalizedKey = normalizeKey(key);
141290
141343
  } catch (error) {
141291
- debugLogger61.warn("Malformed key input in vim mode:", key, error);
141344
+ debugLogger62.warn("Malformed key input in vim mode:", key, error);
141292
141345
  return false;
141293
141346
  }
141294
141347
  if (state.mode === "INSERT") {
@@ -145189,7 +145242,7 @@ __name(updateNotifier, "updateNotifier");
145189
145242
 
145190
145243
  // packages/cli/src/ui/utils/updateCheck.ts
145191
145244
  var import_semver2 = __toESM(require_semver2(), 1);
145192
- var debugLogger62 = createDebugLogger("UPDATE_CHECK");
145245
+ var debugLogger63 = createDebugLogger("UPDATE_CHECK");
145193
145246
  function getBestAvailableUpdate(nightly, stable) {
145194
145247
  if (!nightly) return stable || null;
145195
145248
  if (!stable) return nightly || null;
@@ -145249,7 +145302,7 @@ async function checkForUpdates() {
145249
145302
  }
145250
145303
  return null;
145251
145304
  } catch (e) {
145252
- debugLogger62.warn("Failed to check for updates: " + e);
145305
+ debugLogger63.warn("Failed to check for updates: " + e);
145253
145306
  return null;
145254
145307
  }
145255
145308
  }
@@ -145263,7 +145316,7 @@ init_esbuild_shims();
145263
145316
  import * as fs35 from "node:fs";
145264
145317
  import * as path47 from "node:path";
145265
145318
  import * as childProcess from "node:child_process";
145266
- var debugLogger63 = createDebugLogger("INSTALLATION_INFO");
145319
+ var debugLogger64 = createDebugLogger("INSTALLATION_INFO");
145267
145320
  function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
145268
145321
  const cliPath = process.argv[1];
145269
145322
  if (!cliPath) {
@@ -145365,7 +145418,7 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
145365
145418
  updateMessage: isAutoUpdateEnabled ? "Installed with npm. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
145366
145419
  };
145367
145420
  } catch (error) {
145368
- debugLogger63.error("Failed to detect installation info:", error);
145421
+ debugLogger64.error("Failed to detect installation info:", error);
145369
145422
  return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
145370
145423
  }
145371
145424
  }
@@ -146199,7 +146252,7 @@ var import_react211 = __toESM(require_react(), 1);
146199
146252
 
146200
146253
  // packages/cli/src/services/notificationService.ts
146201
146254
  init_esbuild_shims();
146202
- var debugLogger64 = createDebugLogger("NOTIFICATION_SERVICE");
146255
+ var debugLogger65 = createDebugLogger("NOTIFICATION_SERVICE");
146203
146256
  var DEFAULT_TITLE = "Qwen Code";
146204
146257
  function sendNotification(opts, terminal, enabled2) {
146205
146258
  if (!enabled2) {
@@ -146227,7 +146280,7 @@ function sendNotification(opts, terminal, enabled2) {
146227
146280
  return "terminal_bell";
146228
146281
  }
146229
146282
  } catch (error) {
146230
- debugLogger64.warn("Failed to send notification:", error);
146283
+ debugLogger65.warn("Failed to send notification:", error);
146231
146284
  return "error";
146232
146285
  }
146233
146286
  }
@@ -146502,7 +146555,7 @@ var import_jsx_runtime160 = __toESM(require_jsx_runtime(), 1);
146502
146555
  var MCP_BATCH_FLUSH_MS = 16;
146503
146556
  var STARTUP_PROFILE_FINALIZE_CAP_MS = 35e3;
146504
146557
  var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
146505
- var debugLogger65 = createDebugLogger("APP_CONTAINER");
146558
+ var debugLogger66 = createDebugLogger("APP_CONTAINER");
146506
146559
  function isRenderModeToggleKey(key) {
146507
146560
  return keyMatchers["toggleRenderMode" /* TOGGLE_RENDER_MODE */](key) || key.name === "m" && key.meta && !key.ctrl && !key.paste;
146508
146561
  }
@@ -146682,7 +146735,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
146682
146735
  const staticExtraHeight = 3;
146683
146736
  (0, import_react214.useEffect)(() => {
146684
146737
  void loadLowlight().catch((err) => {
146685
- debugLogger65.warn(
146738
+ debugLogger66.warn(
146686
146739
  `Failed to load lowlight chunk; code blocks will render as plain text: ${err instanceof Error ? err.message : String(err)}`
146687
146740
  );
146688
146741
  });
@@ -146754,9 +146807,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
146754
146807
  registerCleanup(async () => {
146755
146808
  try {
146756
146809
  await config.getHookSystem()?.fireSessionEndEvent("prompt_input_exit" /* PromptInputExit */);
146757
- debugLogger65.debug("SessionEnd event completed successfully!!!");
146810
+ debugLogger66.debug("SessionEnd event completed successfully!!!");
146758
146811
  } catch (err) {
146759
- debugLogger65.error(`SessionEnd hook failed: ${err}`);
146812
+ debugLogger66.error(`SessionEnd hook failed: ${err}`);
146760
146813
  }
146761
146814
  });
146762
146815
  registerCleanup(async () => {
@@ -146782,7 +146835,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
146782
146835
  flushTimer = null;
146783
146836
  }
146784
146837
  return geminiClient2.setTools().catch((err) => {
146785
- debugLogger65.error(
146838
+ debugLogger66.error(
146786
146839
  `setTools() batch-flush failed: ${err instanceof Error ? err.message : String(err)}`
146787
146840
  );
146788
146841
  });
@@ -146800,7 +146853,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
146800
146853
  failureSurfaced = true;
146801
146854
  const failedNames = typeof config.getFailedMcpServerNames === "function" ? config.getFailedMcpServerNames() : [];
146802
146855
  if (failedNames.length > 0) {
146803
- debugLogger65.warn(
146856
+ debugLogger66.warn(
146804
146857
  `MCP server(s) failed to start: ${failedNames.join(", ")}. Continuing with built-in tools and any servers that did connect.`
146805
146858
  );
146806
146859
  }
@@ -147127,6 +147180,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
147127
147180
  extensionsUpdateStateInternal,
147128
147181
  isConfigInitialized,
147129
147182
  logger3,
147183
+ historyManager.updateItem,
147130
147184
  setSessionName
147131
147185
  );
147132
147186
  const onDebugMessage = (0, import_react214.useCallback)(
@@ -147221,7 +147275,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
147221
147275
  },
147222
147276
  Date.now()
147223
147277
  );
147224
- debugLogger65.debug(
147278
+ debugLogger66.debug(
147225
147279
  `[DEBUG] Refreshed memory content in config: ${memoryContent.substring(
147226
147280
  0,
147227
147281
  200
@@ -147236,7 +147290,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
147236
147290
  },
147237
147291
  Date.now()
147238
147292
  );
147239
- debugLogger65.error("Error refreshing memory:", error);
147293
+ debugLogger66.error("Error refreshing memory:", error);
147240
147294
  }
147241
147295
  }, [config, historyManager, settings.merged]);
147242
147296
  const cancelHandlerRef = (0, import_react214.useRef)(() => {
@@ -147582,30 +147636,30 @@ ${worktreeNotice}
147582
147636
  ${currentText}` : popped);
147583
147637
  }
147584
147638
  if (!draftWasEmpty) {
147585
- debugLogger65.debug("auto-restore bail: buffer was non-empty");
147639
+ debugLogger66.debug("auto-restore bail: buffer was non-empty");
147586
147640
  return;
147587
147641
  }
147588
147642
  if (popped !== null) {
147589
- debugLogger65.debug(
147643
+ debugLogger66.debug(
147590
147644
  "auto-restore bail: queue had items (drained to buffer)"
147591
147645
  );
147592
147646
  return;
147593
147647
  }
147594
147648
  if (pendingHistoryItems2.some((item) => !isSyntheticHistoryItem(item))) {
147595
- debugLogger65.debug(
147649
+ debugLogger66.debug(
147596
147650
  "auto-restore bail: pending stream item has meaningful content"
147597
147651
  );
147598
147652
  return;
147599
147653
  }
147600
147654
  if (info?.turnProducedMeaningfulContent) {
147601
- debugLogger65.debug(
147655
+ debugLogger66.debug(
147602
147656
  "auto-restore bail: turn produced meaningful content during stream/flush"
147603
147657
  );
147604
147658
  return;
147605
147659
  }
147606
147660
  const cancelledTurnUserItem = info?.lastTurnUserItem;
147607
147661
  if (cancelledTurnUserItem == null) {
147608
- debugLogger65.debug(
147662
+ debugLogger66.debug(
147609
147663
  "auto-restore bail: cancelled turn did not add a user history item"
147610
147664
  );
147611
147665
  return;
@@ -147613,29 +147667,29 @@ ${currentText}` : popped);
147613
147667
  const history = historyRef.current;
147614
147668
  const lastUserIdx = findLastUserItemIndex(history);
147615
147669
  if (lastUserIdx === -1) {
147616
- debugLogger65.debug("auto-restore bail: no user item in history");
147670
+ debugLogger66.debug("auto-restore bail: no user item in history");
147617
147671
  return;
147618
147672
  }
147619
147673
  if (!itemsAfterAreOnlySynthetic(history, lastUserIdx)) {
147620
- debugLogger65.debug(
147674
+ debugLogger66.debug(
147621
147675
  "auto-restore bail: meaningful content committed after last user item"
147622
147676
  );
147623
147677
  return;
147624
147678
  }
147625
147679
  const lastUserItem = history[lastUserIdx];
147626
147680
  if (lastUserItem.type !== "user") {
147627
- debugLogger65.debug(
147681
+ debugLogger66.debug(
147628
147682
  "auto-restore bail: lastUserItem type narrowing failed (unexpected)"
147629
147683
  );
147630
147684
  return;
147631
147685
  }
147632
147686
  if (lastUserItem.id !== cancelledTurnUserItem.id || lastUserItem.text !== cancelledTurnUserItem.text) {
147633
- debugLogger65.debug(
147687
+ debugLogger66.debug(
147634
147688
  "auto-restore bail: lastUserItem identity does not match cancelled-turn user item"
147635
147689
  );
147636
147690
  return;
147637
147691
  }
147638
- debugLogger65.debug(
147692
+ debugLogger66.debug(
147639
147693
  "auto-restore: rewinding cancelled turn and restoring prompt"
147640
147694
  );
147641
147695
  historyManager.truncateToItem(lastUserItem.id);
@@ -147643,7 +147697,7 @@ ${currentText}` : popped);
147643
147697
  buffer.setText(lastUserItem.text);
147644
147698
  geminiClient?.stripOrphanedUserEntriesFromHistory?.();
147645
147699
  void logger3?.removeLastUserMessage().catch((err) => {
147646
- debugLogger65.debug("Failed to undo cancelled prompt from log:", err);
147700
+ debugLogger66.debug("Failed to undo cancelled prompt from log:", err);
147647
147701
  });
147648
147702
  },
147649
147703
  [
@@ -148284,7 +148338,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
148284
148338
  const handleGlobalKeypress = (0, import_react214.useCallback)(
148285
148339
  (key) => {
148286
148340
  if (settings.merged.general?.debugKeystrokeLogging) {
148287
- debugLogger65.debug("[DEBUG] Keystroke:", JSON.stringify(key));
148341
+ debugLogger66.debug("[DEBUG] Keystroke:", JSON.stringify(key));
148288
148342
  }
148289
148343
  if (keyMatchers["quit" /* QUIT */](key)) {
148290
148344
  if (isAuthenticating) {
@@ -148400,7 +148454,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
148400
148454
  tc.request.name === ToolNames.SHELL && tc.promoteAbortController !== void 0
148401
148455
  );
148402
148456
  if (executingShell?.promoteAbortController) {
148403
- debugLogger65.debug(
148457
+ debugLogger66.debug(
148404
148458
  `Ctrl+B promote: matched executing shell tool call ${executingShell.request.callId}`
148405
148459
  );
148406
148460
  executingShell.promoteAbortController.abort({
@@ -148408,7 +148462,7 @@ ${migrationResult.failedFiles.map((f) => ` \u2022 ${f.file}: ${f.error}`).join(
148408
148462
  });
148409
148463
  return;
148410
148464
  }
148411
- debugLogger65.debug(
148465
+ debugLogger66.debug(
148412
148466
  `Ctrl+B promote: no executing shell tool call; falling through (streamingState=${streamingState}, pendingToolCalls=${pendingToolCallsRef.current.length})`
148413
148467
  );
148414
148468
  }
@@ -149931,7 +149985,7 @@ __name(initializeWarningHandler, "initializeWarningHandler");
149931
149985
 
149932
149986
  // packages/cli/src/utils/earlyInputCapture.ts
149933
149987
  init_esbuild_shims();
149934
- var debugLogger66 = createDebugLogger("EARLY_INPUT");
149988
+ var debugLogger67 = createDebugLogger("EARLY_INPUT");
149935
149989
  var MAX_BUFFER_SIZE = 64 * 1024;
149936
149990
  var inputBuffer = {
149937
149991
  chunks: [],
@@ -150064,12 +150118,12 @@ __name(shouldReplayPendingAtStop, "shouldReplayPendingAtStop");
150064
150118
  function startEarlyInputCapture() {
150065
150119
  if (isCapturing || !process.stdin.isTTY) {
150066
150120
  if (!process.stdin.isTTY) {
150067
- debugLogger66.debug("Early input capture skipped: stdin is not a TTY");
150121
+ debugLogger67.debug("Early input capture skipped: stdin is not a TTY");
150068
150122
  }
150069
150123
  return;
150070
150124
  }
150071
150125
  if (process.env["QWEN_CODE_DISABLE_EARLY_CAPTURE"] === "1") {
150072
- debugLogger66.debug("Early input capture disabled by environment variable");
150126
+ debugLogger67.debug("Early input capture disabled by environment variable");
150073
150127
  return;
150074
150128
  }
150075
150129
  isCapturing = true;
@@ -150079,13 +150133,13 @@ function startEarlyInputCapture() {
150079
150133
  captured: false
150080
150134
  };
150081
150135
  pendingTerminalResponse = Buffer.alloc(0);
150082
- debugLogger66.debug("Starting early input capture");
150136
+ debugLogger67.debug("Starting early input capture");
150083
150137
  captureHandler = /* @__PURE__ */ __name((data) => {
150084
150138
  if (inputBuffer.captured) {
150085
150139
  return;
150086
150140
  }
150087
150141
  if (inputBuffer.totalBytes >= MAX_BUFFER_SIZE) {
150088
- debugLogger66.warn(
150142
+ debugLogger67.warn(
150089
150143
  `Early input capture buffer full (${MAX_BUFFER_SIZE} bytes). Stopping capture; additional keystrokes during startup will be lost.`
150090
150144
  );
150091
150145
  stopEarlyInputCapture();
@@ -150106,11 +150160,11 @@ function startEarlyInputCapture() {
150106
150160
  );
150107
150161
  inputBuffer.chunks.push(Buffer.from(truncated));
150108
150162
  inputBuffer.totalBytes += truncated.length;
150109
- debugLogger66.debug(`Buffer truncated at ${MAX_BUFFER_SIZE} bytes`);
150163
+ debugLogger67.debug(`Buffer truncated at ${MAX_BUFFER_SIZE} bytes`);
150110
150164
  } else {
150111
150165
  inputBuffer.chunks.push(Buffer.from(filtered));
150112
150166
  inputBuffer.totalBytes += filtered.length;
150113
- debugLogger66.debug(
150167
+ debugLogger67.debug(
150114
150168
  `Captured ${filtered.length} bytes (total: ${inputBuffer.totalBytes})`
150115
150169
  );
150116
150170
  }
@@ -150129,7 +150183,7 @@ function stopEarlyInputCapture() {
150129
150183
  captureHandler = null;
150130
150184
  isCapturing = false;
150131
150185
  inputBuffer.captured = true;
150132
- debugLogger66.debug(
150186
+ debugLogger67.debug(
150133
150187
  `Stopped early input capture: ${inputBuffer.totalBytes} bytes`
150134
150188
  );
150135
150189
  }
@@ -150155,7 +150209,7 @@ __name(stopAndGetCapturedInput, "stopAndGetCapturedInput");
150155
150209
  // packages/cli/src/utils/apiPreconnect.ts
150156
150210
  init_esbuild_shims();
150157
150211
  var import_undici4 = __toESM(require_undici(), 1);
150158
- var debugLogger67 = createDebugLogger("PRECONNECT");
150212
+ var debugLogger68 = createDebugLogger("PRECONNECT");
150159
150213
  var preconnectFired = false;
150160
150214
  var DEFAULT_BASE_URLS = {
150161
150215
  openai: "https://api.openai.com",
@@ -150169,7 +150223,7 @@ var ALL_DEFAULT_URLS = [
150169
150223
  ];
150170
150224
  function shouldSkipPreconnect() {
150171
150225
  if (process.env["NODE_EXTRA_CA_CERTS"]) {
150172
- debugLogger67.debug("Skipping preconnect: custom CA certificate configured");
150226
+ debugLogger68.debug("Skipping preconnect: custom CA certificate configured");
150173
150227
  return true;
150174
150228
  }
150175
150229
  return false;
@@ -150192,7 +150246,7 @@ function getPreconnectTargetUrl(authType, resolvedBaseUrl) {
150192
150246
  if (isDefaultBaseUrl(resolvedBaseUrl)) {
150193
150247
  return resolvedBaseUrl;
150194
150248
  }
150195
- debugLogger67.debug(
150249
+ debugLogger68.debug(
150196
150250
  "Skipping preconnect: resolved baseUrl is not a default URL"
150197
150251
  );
150198
150252
  return void 0;
@@ -150208,12 +150262,12 @@ function preconnectApi(authType, options = {}) {
150208
150262
  return;
150209
150263
  }
150210
150264
  if (process.env["QWEN_CODE_DISABLE_PRECONNECT"] === "1") {
150211
- debugLogger67.debug("Preconnect disabled by environment variable");
150265
+ debugLogger68.debug("Preconnect disabled by environment variable");
150212
150266
  preconnectFired = true;
150213
150267
  return;
150214
150268
  }
150215
150269
  if (isInSandboxMode()) {
150216
- debugLogger67.debug("Skipping preconnect: sandbox mode detected");
150270
+ debugLogger68.debug("Skipping preconnect: sandbox mode detected");
150217
150271
  preconnectFired = true;
150218
150272
  return;
150219
150273
  }
@@ -150222,22 +150276,22 @@ function preconnectApi(authType, options = {}) {
150222
150276
  return;
150223
150277
  }
150224
150278
  if (detectRuntime() !== "node") {
150225
- debugLogger67.debug("Skipping preconnect: unsupported runtime");
150279
+ debugLogger68.debug("Skipping preconnect: unsupported runtime");
150226
150280
  preconnectFired = true;
150227
150281
  return;
150228
150282
  }
150229
150283
  if (!options.proxy) {
150230
- debugLogger67.debug("Skipping preconnect dispatcher: no proxy configured");
150284
+ debugLogger68.debug("Skipping preconnect dispatcher: no proxy configured");
150231
150285
  return;
150232
150286
  }
150233
150287
  const proxy = options.proxy;
150234
150288
  const targetUrl = getPreconnectTargetUrl(authType, options.resolvedBaseUrl);
150235
150289
  if (!targetUrl) {
150236
- debugLogger67.debug("No target URL for preconnect");
150290
+ debugLogger68.debug("No target URL for preconnect");
150237
150291
  return;
150238
150292
  }
150239
150293
  preconnectFired = true;
150240
- debugLogger67.debug(`Preconnecting to: ${targetUrl}`);
150294
+ debugLogger68.debug(`Preconnecting to: ${targetUrl}`);
150241
150295
  try {
150242
150296
  const dispatcher = getOrCreateSharedDispatcher(proxy);
150243
150297
  (0, import_undici4.fetch)(targetUrl, {
@@ -150248,14 +150302,14 @@ function preconnectApi(authType, options = {}) {
150248
150302
  },
150249
150303
  dispatcher
150250
150304
  }).then(() => {
150251
- debugLogger67.debug("Preconnect completed");
150305
+ debugLogger68.debug("Preconnect completed");
150252
150306
  }).catch((error) => {
150253
150307
  const redactedError = redactProxyCredentials(String(error));
150254
- debugLogger67.debug(`Preconnect failed (ignored): ${redactedError}`);
150308
+ debugLogger68.debug(`Preconnect failed (ignored): ${redactedError}`);
150255
150309
  });
150256
150310
  } catch (error) {
150257
150311
  const redactedError = redactProxyCredentials(String(error));
150258
- debugLogger67.debug(`Preconnect failed (ignored): ${redactedError}`);
150312
+ debugLogger68.debug(`Preconnect failed (ignored): ${redactedError}`);
150259
150313
  }
150260
150314
  }
150261
150315
  __name(preconnectApi, "preconnectApi");
@@ -150433,7 +150487,7 @@ import {
150433
150487
  init_esbuild_shims();
150434
150488
 
150435
150489
  // packages/cli/src/dualOutput/DualOutputBridge.ts
150436
- var debugLogger68 = createDebugLogger("DUAL_OUTPUT");
150490
+ var debugLogger69 = createDebugLogger("DUAL_OUTPUT");
150437
150491
  var SUPPORTED_EVENTS = [
150438
150492
  "system",
150439
150493
  "user",
@@ -150488,9 +150542,9 @@ var DualOutputBridge = class {
150488
150542
  this.stream.on("error", (err) => {
150489
150543
  const code = err.code;
150490
150544
  if (code === "EPIPE" || code === "ERR_STREAM_DESTROYED") {
150491
- debugLogger68.warn("DualOutput: consumer disconnected, disabling");
150545
+ debugLogger69.warn("DualOutput: consumer disconnected, disabling");
150492
150546
  } else {
150493
- debugLogger68.error("DualOutput stream error:", err);
150547
+ debugLogger69.error("DualOutput stream error:", err);
150494
150548
  }
150495
150549
  this.active = false;
150496
150550
  });
@@ -150509,7 +150563,7 @@ var DualOutputBridge = class {
150509
150563
  supported_events: [...SUPPORTED_EVENTS]
150510
150564
  });
150511
150565
  } catch (err) {
150512
- debugLogger68.error("DualOutput session_start error:", err);
150566
+ debugLogger69.error("DualOutput session_start error:", err);
150513
150567
  this.active = false;
150514
150568
  }
150515
150569
  }
@@ -150518,7 +150572,7 @@ var DualOutputBridge = class {
150518
150572
  try {
150519
150573
  this.adapter.processEvent(event);
150520
150574
  } catch (err) {
150521
- debugLogger68.error("DualOutput processEvent error:", err);
150575
+ debugLogger69.error("DualOutput processEvent error:", err);
150522
150576
  this.active = false;
150523
150577
  }
150524
150578
  }
@@ -150527,7 +150581,7 @@ var DualOutputBridge = class {
150527
150581
  try {
150528
150582
  this.adapter.startAssistantMessage();
150529
150583
  } catch (err) {
150530
- debugLogger68.error("DualOutput startAssistantMessage error:", err);
150584
+ debugLogger69.error("DualOutput startAssistantMessage error:", err);
150531
150585
  this.active = false;
150532
150586
  }
150533
150587
  }
@@ -150536,7 +150590,7 @@ var DualOutputBridge = class {
150536
150590
  try {
150537
150591
  this.adapter.finalizeAssistantMessage();
150538
150592
  } catch (err) {
150539
- debugLogger68.error("DualOutput finalizeAssistantMessage error:", err);
150593
+ debugLogger69.error("DualOutput finalizeAssistantMessage error:", err);
150540
150594
  this.active = false;
150541
150595
  }
150542
150596
  }
@@ -150545,7 +150599,7 @@ var DualOutputBridge = class {
150545
150599
  try {
150546
150600
  this.adapter.emitUserMessage(parts);
150547
150601
  } catch (err) {
150548
- debugLogger68.error("DualOutput emitUserMessage error:", err);
150602
+ debugLogger69.error("DualOutput emitUserMessage error:", err);
150549
150603
  this.active = false;
150550
150604
  }
150551
150605
  }
@@ -150554,7 +150608,7 @@ var DualOutputBridge = class {
150554
150608
  try {
150555
150609
  this.adapter.emitToolResult(request, response);
150556
150610
  } catch (err) {
150557
- debugLogger68.error("DualOutput emitToolResult error:", err);
150611
+ debugLogger69.error("DualOutput emitToolResult error:", err);
150558
150612
  this.active = false;
150559
150613
  }
150560
150614
  }
@@ -150577,7 +150631,7 @@ var DualOutputBridge = class {
150577
150631
  blockedPath
150578
150632
  );
150579
150633
  } catch (err) {
150580
- debugLogger68.error("DualOutput emitPermissionRequest error:", err);
150634
+ debugLogger69.error("DualOutput emitPermissionRequest error:", err);
150581
150635
  this.active = false;
150582
150636
  }
150583
150637
  }
@@ -150590,7 +150644,7 @@ var DualOutputBridge = class {
150590
150644
  try {
150591
150645
  this.adapter.emitControlResponse(requestId, allowed);
150592
150646
  } catch (err) {
150593
- debugLogger68.error("DualOutput emitControlResponse error:", err);
150647
+ debugLogger69.error("DualOutput emitControlResponse error:", err);
150594
150648
  this.active = false;
150595
150649
  }
150596
150650
  }
@@ -150605,7 +150659,7 @@ var DualOutputBridge = class {
150605
150659
  try {
150606
150660
  this.adapter.emitControlError(requestId, message);
150607
150661
  } catch (err) {
150608
- debugLogger68.error("DualOutput emitControlError error:", err);
150662
+ debugLogger69.error("DualOutput emitControlError error:", err);
150609
150663
  this.active = false;
150610
150664
  }
150611
150665
  }
@@ -150615,7 +150669,7 @@ var DualOutputBridge = class {
150615
150669
  try {
150616
150670
  this.adapter.emitSystemMessage(subtype, data);
150617
150671
  } catch (err) {
150618
- debugLogger68.error("DualOutput emitSystemMessage error:", err);
150672
+ debugLogger69.error("DualOutput emitSystemMessage error:", err);
150619
150673
  this.active = false;
150620
150674
  }
150621
150675
  }
@@ -150644,7 +150698,7 @@ var DualOutputBridge = class {
150644
150698
  resolve17();
150645
150699
  }, "onClose");
150646
150700
  const onError = /* @__PURE__ */ __name((err) => {
150647
- debugLogger68.debug("DualOutput: stream error during shutdown:", err);
150701
+ debugLogger69.debug("DualOutput: stream error during shutdown:", err);
150648
150702
  }, "onError");
150649
150703
  this.stream.once("close", onClose);
150650
150704
  this.stream.once("error", onError);
@@ -150652,7 +150706,7 @@ var DualOutputBridge = class {
150652
150706
  this.stream.end();
150653
150707
  } catch (err) {
150654
150708
  cleanup();
150655
- debugLogger68.debug("DualOutput: stream end error during shutdown:", err);
150709
+ debugLogger69.debug("DualOutput: stream end error during shutdown:", err);
150656
150710
  resolve17();
150657
150711
  }
150658
150712
  });
@@ -150664,7 +150718,7 @@ var DualOutputBridge = class {
150664
150718
  init_esbuild_shims();
150665
150719
  import { createReadStream, watchFile, unwatchFile, statSync as statSync6 } from "node:fs";
150666
150720
  import { createInterface as createInterface2 } from "node:readline";
150667
- var debugLogger69 = createDebugLogger("REMOTE_INPUT");
150721
+ var debugLogger70 = createDebugLogger("REMOTE_INPUT");
150668
150722
  var RemoteInputWatcher = class {
150669
150723
  static {
150670
150724
  __name(this, "RemoteInputWatcher");
@@ -150721,7 +150775,7 @@ var RemoteInputWatcher = class {
150721
150775
  if (!this.active) return;
150722
150776
  this.readNewLines();
150723
150777
  });
150724
- debugLogger69.debug(`RemoteInput: watching ${this.filePath}`);
150778
+ debugLogger70.debug(`RemoteInput: watching ${this.filePath}`);
150725
150779
  }
150726
150780
  /**
150727
150781
  * Manually trigger a check for new input. Returns a promise that resolves
@@ -150754,24 +150808,24 @@ var RemoteInputWatcher = class {
150754
150808
  try {
150755
150809
  const cmd = JSON.parse(trimmed);
150756
150810
  if (cmd && cmd.type === "confirmation_response" && typeof cmd.request_id === "string" && typeof cmd.allowed === "boolean") {
150757
- debugLogger69.debug(
150811
+ debugLogger70.debug(
150758
150812
  `RemoteInput: confirmation_response for ${cmd.request_id} (allowed=${cmd.allowed})`
150759
150813
  );
150760
150814
  this.confirmationHandler?.(cmd.request_id, cmd.allowed);
150761
150815
  } else if (cmd && cmd.type === "submit" && typeof cmd.text === "string") {
150762
- debugLogger69.debug(
150816
+ debugLogger70.debug(
150763
150817
  `RemoteInput: queued command: ${cmd.text.slice(0, 50)}...`
150764
150818
  );
150765
150819
  this.queue.push(
150766
150820
  cmd
150767
150821
  );
150768
150822
  } else {
150769
- debugLogger69.warn(
150823
+ debugLogger70.warn(
150770
150824
  `RemoteInput: unknown command type: ${String(cmd?.type)}`
150771
150825
  );
150772
150826
  }
150773
150827
  } catch (_err) {
150774
- debugLogger69.warn(`RemoteInput: failed to parse line: ${trimmed}`);
150828
+ debugLogger70.warn(`RemoteInput: failed to parse line: ${trimmed}`);
150775
150829
  }
150776
150830
  });
150777
150831
  return new Promise((resolve17) => {
@@ -150794,19 +150848,19 @@ var RemoteInputWatcher = class {
150794
150848
  while (this.queue.length > 0 && this.active) {
150795
150849
  if (!this.submitFn) break;
150796
150850
  const cmd = this.queue[0];
150797
- debugLogger69.debug(
150851
+ debugLogger70.debug(
150798
150852
  `RemoteInput: submitting: ${cmd.text.slice(0, 50)}...`
150799
150853
  );
150800
150854
  try {
150801
150855
  const result = await this.submitFn(cmd.text);
150802
150856
  if (result === false) {
150803
- debugLogger69.debug("RemoteInput: TUI busy, will retry on idle");
150857
+ debugLogger70.debug("RemoteInput: TUI busy, will retry on idle");
150804
150858
  this.scheduleRetry();
150805
150859
  break;
150806
150860
  }
150807
150861
  this.queue.shift();
150808
150862
  } catch (err) {
150809
- debugLogger69.error("RemoteInput: submit failed:", err);
150863
+ debugLogger70.error("RemoteInput: submit failed:", err);
150810
150864
  this.queue.shift();
150811
150865
  }
150812
150866
  if (this.queue.length > 0) {
@@ -150831,7 +150885,7 @@ var RemoteInputWatcher = class {
150831
150885
  unwatchFile(this.filePath);
150832
150886
  if (this.retryTimer) clearTimeout(this.retryTimer);
150833
150887
  this.queue.length = 0;
150834
- debugLogger69.debug("RemoteInput: shut down");
150888
+ debugLogger70.debug("RemoteInput: shut down");
150835
150889
  }
150836
150890
  };
150837
150891
 
@@ -151304,7 +151358,7 @@ function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
151304
151358
  __name(toPermissionOptions, "toPermissionOptions");
151305
151359
 
151306
151360
  // packages/cli/src/acp-integration/session/SubAgentTracker.ts
151307
- var debugLogger70 = createDebugLogger("ACP_SUBAGENT_TRACKER");
151361
+ var debugLogger71 = createDebugLogger("ACP_SUBAGENT_TRACKER");
151308
151362
  var SubAgentTracker = class {
151309
151363
  constructor(ctx, client, parentToolCallId, subagentType) {
151310
151364
  this.ctx = ctx;
@@ -151372,7 +151426,7 @@ var SubAgentTracker = class {
151372
151426
  try {
151373
151427
  invocation = tool.build(event.args);
151374
151428
  } catch (e) {
151375
- debugLogger70.warn(`Failed to build subagent tool ${event.name}:`, e);
151429
+ debugLogger71.warn(`Failed to build subagent tool ${event.name}:`, e);
151376
151430
  }
151377
151431
  }
151378
151432
  this.toolStates.set(event.callId, {
@@ -151442,7 +151496,7 @@ var SubAgentTracker = class {
151442
151496
  answers: "answers" in output ? output.answers : void 0
151443
151497
  });
151444
151498
  } catch (error) {
151445
- debugLogger70.error(
151499
+ debugLogger71.error(
151446
151500
  `Permission request failed for subagent tool ${event.name}:`,
151447
151501
  error
151448
151502
  );
@@ -151539,7 +151593,7 @@ var TurnBuffer = class {
151539
151593
  init_esbuild_shims();
151540
151594
  import { readFileSync as readFileSync15, existsSync as existsSync15 } from "node:fs";
151541
151595
  import { resolve as resolve16 } from "node:path";
151542
- var debugLogger71 = createDebugLogger("MESSAGE_REWRITER");
151596
+ var debugLogger72 = createDebugLogger("MESSAGE_REWRITER");
151543
151597
  var DEFAULT_REWRITE_PROMPT = `You are an assistant that rewrites raw coding-agent output into concise, user-friendly progress updates.
151544
151598
 
151545
151599
  The agent is a software engineering assistant that reads files, writes code, runs commands, and uses tools. Its raw output mixes internal reasoning with user-facing information. Your job: extract what the user cares about, drop what they don't.
@@ -151568,11 +151622,11 @@ var LlmRewriter = class {
151568
151622
  const filePath = resolve16(rewriteConfig.promptFile);
151569
151623
  if (existsSync15(filePath)) {
151570
151624
  this.prompt = readFileSync15(filePath, "utf-8").trim();
151571
- debugLogger71.info(
151625
+ debugLogger72.info(
151572
151626
  `Loaded rewrite prompt from file: ${filePath} (${this.prompt.length} chars)`
151573
151627
  );
151574
151628
  } else {
151575
- debugLogger71.warn(
151629
+ debugLogger72.warn(
151576
151630
  `Rewrite prompt file not found: ${filePath}, using default`
151577
151631
  );
151578
151632
  this.prompt = DEFAULT_REWRITE_PROMPT;
@@ -151609,7 +151663,7 @@ var LlmRewriter = class {
151609
151663
  const inputText = inputParts.join("\n\n");
151610
151664
  if (!inputText.trim()) return null;
151611
151665
  if (inputText.length < 10) return null;
151612
- debugLogger71.info(
151666
+ debugLogger72.info(
151613
151667
  `[REWRITE INPUT] system_prompt_len=${this.prompt.length} input_len=${inputText.length} context_turns=${this.outputHistory.length}
151614
151668
  --- INPUT TEXT ---
151615
151669
  ${inputText}
@@ -151638,10 +151692,10 @@ ${inputText}
151638
151692
  });
151639
151693
  const rewritten = result.text;
151640
151694
  if (!rewritten || rewritten.length < 5) {
151641
- debugLogger71.info(`[REWRITE OUTPUT] empty or too short, skipping`);
151695
+ debugLogger72.info(`[REWRITE OUTPUT] empty or too short, skipping`);
151642
151696
  return null;
151643
151697
  }
151644
- debugLogger71.info(
151698
+ debugLogger72.info(
151645
151699
  `[REWRITE OUTPUT] len=${rewritten.length}
151646
151700
  --- OUTPUT ---
151647
151701
  ${rewritten}
@@ -151650,7 +151704,7 @@ ${rewritten}
151650
151704
  this.outputHistory.push(rewritten);
151651
151705
  return rewritten;
151652
151706
  } catch (error) {
151653
- debugLogger71.warn(
151707
+ debugLogger72.warn(
151654
151708
  `LLM rewrite failed, skipping: ${error instanceof Error ? error.message : String(error)}`
151655
151709
  );
151656
151710
  return null;
@@ -151659,7 +151713,7 @@ ${rewritten}
151659
151713
  };
151660
151714
 
151661
151715
  // packages/cli/src/acp-integration/session/rewrite/MessageRewriteMiddleware.ts
151662
- var debugLogger72 = createDebugLogger("MESSAGE_REWRITE");
151716
+ var debugLogger73 = createDebugLogger("MESSAGE_REWRITE");
151663
151717
  var DEFAULT_REWRITE_TIMEOUT_MS = 3e4;
151664
151718
  var MessageRewriteMiddleware = class {
151665
151719
  constructor(config, rewriteConfig, sendUpdate) {
@@ -151729,10 +151783,10 @@ var MessageRewriteMiddleware = class {
151729
151783
  try {
151730
151784
  const rewritten = await this.rewriter.rewrite(content, rewriteSignal);
151731
151785
  if (!rewritten) {
151732
- debugLogger72.info(`Turn ${turnIdx}: no rewrite output`);
151786
+ debugLogger73.info(`Turn ${turnIdx}: no rewrite output`);
151733
151787
  return;
151734
151788
  }
151735
- debugLogger72.info(
151789
+ debugLogger73.info(
151736
151790
  `Turn ${turnIdx}: rewritten ${rewritten.length} chars`
151737
151791
  );
151738
151792
  await this.sendUpdate({
@@ -151744,7 +151798,7 @@ var MessageRewriteMiddleware = class {
151744
151798
  }
151745
151799
  });
151746
151800
  } catch (error) {
151747
- debugLogger72.warn(
151801
+ debugLogger73.warn(
151748
151802
  `Turn ${turnIdx}: rewrite failed: ${error instanceof Error ? error.message : String(error)}`
151749
151803
  );
151750
151804
  }
@@ -151773,7 +151827,7 @@ function loadRewriteConfig(settings) {
151773
151827
  __name(loadRewriteConfig, "loadRewriteConfig");
151774
151828
 
151775
151829
  // packages/cli/src/acp-integration/session/Session.ts
151776
- var debugLogger73 = createDebugLogger("SESSION");
151830
+ var debugLogger74 = createDebugLogger("SESSION");
151777
151831
  function computeInitialTurnFromHistory(records, sessionId) {
151778
151832
  let maxPromptTurn = 0;
151779
151833
  let userMessageCount = 0;
@@ -151796,6 +151850,18 @@ function computeInitialTurnFromHistory(records, sessionId) {
151796
151850
  return maxPromptTurn > 0 ? maxPromptTurn : userMessageCount;
151797
151851
  }
151798
151852
  __name(computeInitialTurnFromHistory, "computeInitialTurnFromHistory");
151853
+ async function fireSessionPermissionDeniedForAutoMode(config, decision, outcome, toolName, toolParams, callId, signal) {
151854
+ if (!config.getDisableAllHooks?.() && shouldFirePermissionDeniedForAutoMode(decision, outcome)) {
151855
+ await config.getHookSystem?.()?.firePermissionDeniedEvent(
151856
+ toolName,
151857
+ toolParams,
151858
+ callId,
151859
+ getAutoModePermissionDeniedReason(decision),
151860
+ signal
151861
+ );
151862
+ }
151863
+ }
151864
+ __name(fireSessionPermissionDeniedForAutoMode, "fireSessionPermissionDeniedForAutoMode");
151799
151865
  function getRecordPromptIds(record2) {
151800
151866
  const promptIds = [];
151801
151867
  const recordPromptId = record2.promptId;
@@ -151856,7 +151922,7 @@ async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.
151856
151922
  availableSkills = skills.map((skill) => skill.name);
151857
151923
  }
151858
151924
  } catch (error) {
151859
- debugLogger73.error("Error loading available skills:", error);
151925
+ debugLogger74.error("Error loading available skills:", error);
151860
151926
  }
151861
151927
  return {
151862
151928
  availableCommands,
@@ -151934,7 +152000,7 @@ var Session2 = class {
151934
152000
  installRewriter() {
151935
152001
  const rewriteConfig = loadRewriteConfig(this.settings);
151936
152002
  if (rewriteConfig?.enabled) {
151937
- debugLogger73.info("Message rewrite middleware enabled");
152003
+ debugLogger74.info("Message rewrite middleware enabled");
151938
152004
  this.messageRewriter = new MessageRewriteMiddleware(
151939
152005
  this.config,
151940
152006
  rewriteConfig,
@@ -152240,7 +152306,7 @@ ${this.pendingWorktreeNotice}
152240
152306
  const hooksEnabledForStopFailure = !this.config.getDisableAllHooks?.();
152241
152307
  if (hooksEnabledForStopFailure && hookSystem && this.config.hasHooksForEvent?.("StopFailure")) {
152242
152308
  hookSystem.fireStopFailureEvent(errorType, errorMessage2).catch((err) => {
152243
- debugLogger73.warn(`StopFailure hook failed: ${err}`);
152309
+ debugLogger74.warn(`StopFailure hook failed: ${err}`);
152244
152310
  });
152245
152311
  }
152246
152312
  if (errorStatus === 429) {
@@ -152342,7 +152408,7 @@ ${this.pendingWorktreeNotice}
152342
152408
  warning
152343
152409
  );
152344
152410
  await this.messageEmitter.emitAgentMessage(warning);
152345
- debugLogger73.warn(warning);
152411
+ debugLogger74.warn(warning);
152346
152412
  return { stopReason: "end_turn" };
152347
152413
  }
152348
152414
  if (stopHookIterationCount > 1) {
@@ -152413,7 +152479,7 @@ ${this.pendingWorktreeNotice}
152413
152479
  const hooksEnabledForStopFailure = !this.config.getDisableAllHooks?.();
152414
152480
  if (hooksEnabledForStopFailure && hookSystem && this.config.hasHooksForEvent?.("StopFailure")) {
152415
152481
  hookSystem.fireStopFailureEvent(errorType, errorMessage2).catch((err) => {
152416
- debugLogger73.warn(`StopFailure hook failed: ${err}`);
152482
+ debugLogger74.warn(`StopFailure hook failed: ${err}`);
152417
152483
  });
152418
152484
  }
152419
152485
  if (errorStatus === 429) {
@@ -152480,20 +152546,21 @@ ${this.pendingWorktreeNotice}
152480
152546
  compressionInfo = compressed;
152481
152547
  this.#recordCompressionTokenCount(compressed);
152482
152548
  if (compressed.compressionStatus === 1 /* COMPRESSED */) {
152483
- compressionDiagnostic = `IMPORTANT: This conversation approached the input token limit for ${this.config.getModel()}. A compressed context will be sent for future messages (compressed from: ${compressed.originalTokenCount ?? "unknown"} to ${compressed.newTokenCount ?? "unknown"} tokens).`;
152549
+ const reasonClause = compressed.triggerReason === "image_overflow" ? `accumulated enough tool screenshots to trigger compaction for ${this.config.getModel()}` : `approached the input token limit for ${this.config.getModel()}`;
152550
+ compressionDiagnostic = `IMPORTANT: This conversation ${reasonClause}. A compressed context will be sent for future messages (compressed from: ${compressed.originalTokenCount ?? "unknown"} to ${compressed.newTokenCount ?? "unknown"} tokens).`;
152484
152551
  }
152485
152552
  } catch (compressionError) {
152486
152553
  if (abortSignal.aborted || this.#isAbortError(compressionError)) {
152487
- debugLogger73.debug(`Auto-compression aborted for prompt ${promptId}`);
152554
+ debugLogger74.debug(`Auto-compression aborted for prompt ${promptId}`);
152488
152555
  return { responseStream: null, stopReason: "cancelled" };
152489
152556
  }
152490
- debugLogger73.warn(
152557
+ debugLogger74.warn(
152491
152558
  `Auto-compression failed for prompt ${promptId}; proceeding without compression: ` + this.#formatError(compressionError)
152492
152559
  );
152493
152560
  }
152494
152561
  }
152495
152562
  if (abortSignal.aborted) {
152496
- debugLogger73.debug(`Auto-compression aborted for prompt ${promptId}`);
152563
+ debugLogger74.debug(`Auto-compression aborted for prompt ${promptId}`);
152497
152564
  return { responseStream: null, stopReason: "cancelled" };
152498
152565
  }
152499
152566
  if (!compressionInfo) {
@@ -152503,7 +152570,7 @@ ${this.pendingWorktreeNotice}
152503
152570
  if (sessionTokenLimit > 0) {
152504
152571
  const lastPromptTokenCount = this.#getPostCompressionTokenCount(compressionInfo);
152505
152572
  if (lastPromptTokenCount > sessionTokenLimit) {
152506
- debugLogger73.warn(
152573
+ debugLogger74.warn(
152507
152574
  `Session token limit exceeded for prompt ${promptId}: ${lastPromptTokenCount} > ${sessionTokenLimit}. Send dropped.`
152508
152575
  );
152509
152576
  await this.#emitAgentDiagnosticMessageSafely(
@@ -152520,7 +152587,7 @@ ${this.pendingWorktreeNotice}
152520
152587
  );
152521
152588
  }
152522
152589
  if (abortSignal.aborted) {
152523
- debugLogger73.debug(
152590
+ debugLogger74.debug(
152524
152591
  `Send aborted after compression diagnostic for prompt ${promptId}`
152525
152592
  );
152526
152593
  return { responseStream: null, stopReason: "cancelled" };
@@ -152548,7 +152615,7 @@ ${this.pendingWorktreeNotice}
152548
152615
  ) ?? [];
152549
152616
  const droppedParts = (message.parts?.length ?? 0) - functionResponseParts.length;
152550
152617
  if (droppedParts > 0) {
152551
- debugLogger73.debug(
152618
+ debugLogger74.debug(
152552
152619
  `Dropping ${droppedParts} non-functionResponse part(s) from unsent ACP message after send was skipped.`
152553
152620
  );
152554
152621
  }
@@ -152626,7 +152693,7 @@ ${this.pendingWorktreeNotice}
152626
152693
  try {
152627
152694
  await this.#emitAgentDiagnosticMessage(text);
152628
152695
  } catch (notifyError) {
152629
- debugLogger73.warn(`${failureContext}: ${this.#formatError(notifyError)}`);
152696
+ debugLogger74.warn(`${failureContext}: ${this.#formatError(notifyError)}`);
152630
152697
  }
152631
152698
  }
152632
152699
  async #emitAgentDiagnosticMessage(text) {
@@ -152768,7 +152835,7 @@ ${this.pendingWorktreeNotice}
152768
152835
  }
152769
152836
  } catch (error) {
152770
152837
  if (ac.signal.aborted) return;
152771
- debugLogger73.error("Error processing cron prompt:", error);
152838
+ debugLogger74.error("Error processing cron prompt:", error);
152772
152839
  const msg = error instanceof Error ? error.message : String(error);
152773
152840
  await this.messageEmitter.emitAgentMessage(`[cron error] ${msg}`);
152774
152841
  } finally {
@@ -152803,7 +152870,7 @@ ${this.pendingWorktreeNotice}
152803
152870
  };
152804
152871
  await this.sendUpdate(update);
152805
152872
  } catch (error) {
152806
- debugLogger73.error("Error sending available commands update:", error);
152873
+ debugLogger74.error("Error sending available commands update:", error);
152807
152874
  }
152808
152875
  }
152809
152876
  /**
@@ -153101,6 +153168,15 @@ ${this.pendingWorktreeNotice}
153101
153168
  this.config,
153102
153169
  denialState
153103
153170
  );
153171
+ await fireSessionPermissionDeniedForAutoMode(
153172
+ this.config,
153173
+ decision,
153174
+ outcome,
153175
+ fc.name,
153176
+ toolParams,
153177
+ callId,
153178
+ abortSignal
153179
+ );
153104
153180
  switch (outcome.kind) {
153105
153181
  case "approved":
153106
153182
  autoModeAllowed = true;
@@ -153269,7 +153345,7 @@ ${this.pendingWorktreeNotice}
153269
153345
  return earlyErrorResponse(new Error(blockReason), fc.name);
153270
153346
  }
153271
153347
  if (preHookResult.additionalContext) {
153272
- debugLogger73.debug(
153348
+ debugLogger74.debug(
153273
153349
  `PreToolUse hook additional context for ${fc.name}: ${preHookResult.additionalContext}`
153274
153350
  );
153275
153351
  }
@@ -153297,7 +153373,7 @@ ${this.pendingWorktreeNotice}
153297
153373
  );
153298
153374
  if (postHookResult.shouldStop) {
153299
153375
  const stopMessage = postHookResult.stopReason || "Execution stopped by PostToolUse hook";
153300
- debugLogger73.info(
153376
+ debugLogger74.info(
153301
153377
  `PostToolUse hook requested stop for ${fc.name}: ${stopMessage}`
153302
153378
  );
153303
153379
  return earlyErrorResponse(new Error(stopMessage), fc.name);
@@ -153319,7 +153395,7 @@ ${this.pendingWorktreeNotice}
153319
153395
  abortSignal
153320
153396
  );
153321
153397
  if (failureHookResult.additionalContext) {
153322
- debugLogger73.debug(
153398
+ debugLogger74.debug(
153323
153399
  `PostToolUseFailure hook additional context for ${fc.name}: ${failureHookResult.additionalContext}`
153324
153400
  );
153325
153401
  }
@@ -153382,7 +153458,7 @@ ${this.pendingWorktreeNotice}
153382
153458
  abortSignal
153383
153459
  );
153384
153460
  if (failureHookResult.additionalContext) {
153385
- debugLogger73.debug(
153461
+ debugLogger74.debug(
153386
153462
  `PostToolUseFailure hook additional context for ${fc.name}: ${failureHookResult.additionalContext}`
153387
153463
  );
153388
153464
  }
@@ -153582,7 +153658,7 @@ ${contextPart.text}`
153582
153658
  }
153583
153659
  debug(msg) {
153584
153660
  if (this.config.getDebugMode()) {
153585
- debugLogger73.warn(msg);
153661
+ debugLogger74.warn(msg);
153586
153662
  }
153587
153663
  }
153588
153664
  };
@@ -153599,7 +153675,7 @@ function runWithAcpRuntimeOutputDir(settings, cwd5, fn) {
153599
153675
  __name(runWithAcpRuntimeOutputDir, "runWithAcpRuntimeOutputDir");
153600
153676
 
153601
153677
  // packages/cli/src/acp-integration/acpAgent.ts
153602
- var debugLogger74 = createDebugLogger("ACP_AGENT");
153678
+ var debugLogger75 = createDebugLogger("ACP_AGENT");
153603
153679
  var AUTH_PREFLIGHT_ENV_KEYS = {
153604
153680
  openai: ["OPENAI_API_KEY"],
153605
153681
  anthropic: ["ANTHROPIC_API_KEY"],
@@ -153651,7 +153727,7 @@ async function runAcpAgent(config, settings, argv) {
153651
153727
  try {
153652
153728
  await hookSystem.fireSessionEndEvent(reason);
153653
153729
  } catch (err) {
153654
- debugLogger74.warn(
153730
+ debugLogger75.warn(
153655
153731
  `SessionEnd hook failed: ${err instanceof Error ? err.message : String(err)}`
153656
153732
  );
153657
153733
  }
@@ -153660,7 +153736,7 @@ async function runAcpAgent(config, settings, argv) {
153660
153736
  const shutdownHandler = /* @__PURE__ */ __name(async () => {
153661
153737
  if (shuttingDown) return;
153662
153738
  shuttingDown = true;
153663
- debugLogger74.debug("[ACP] Shutdown signal received, closing streams");
153739
+ debugLogger75.debug("[ACP] Shutdown signal received, closing streams");
153664
153740
  await fireSessionEndOnce("other" /* Other */);
153665
153741
  try {
153666
153742
  process.stdin.destroy();
@@ -153671,7 +153747,7 @@ async function runAcpAgent(config, settings, argv) {
153671
153747
  } catch {
153672
153748
  }
153673
153749
  runExitCleanup().catch((err) => {
153674
- debugLogger74.error("[ACP] Cleanup error:", err);
153750
+ debugLogger75.error("[ACP] Cleanup error:", err);
153675
153751
  }).finally(() => {
153676
153752
  process.exit(0);
153677
153753
  });
@@ -153723,7 +153799,7 @@ var QwenAgent = class {
153723
153799
  async initialize(args) {
153724
153800
  this.clientCapabilities = args.clientCapabilities;
153725
153801
  const authMethods = buildAuthMethods();
153726
- const version = "0.16.2";
153802
+ const version = "0.17.0";
153727
153803
  return {
153728
153804
  protocolVersion: PROTOCOL_VERSION,
153729
153805
  agentInfo: {
@@ -153883,7 +153959,7 @@ var QwenAgent = class {
153883
153959
  session.pendingWorktreeNotice = restored.contextMessage;
153884
153960
  }
153885
153961
  } catch (error) {
153886
- debugLogger74.warn(`ACP worktree restore failed: ${error}`);
153962
+ debugLogger75.warn(`ACP worktree restore failed: ${error}`);
153887
153963
  }
153888
153964
  }
153889
153965
  async unstable_listSessions(params) {
@@ -154931,7 +155007,7 @@ var QwenAgent = class {
154931
155007
  sessionId: sid,
154932
155008
  ...event
154933
155009
  }).catch((err) => {
154934
- debugLogger74.debug(
155010
+ debugLogger75.debug(
154935
155011
  `MCP budget extNotification dropped (session=${sid}, kind=${event.kind}): ${err instanceof Error ? err.message : String(err)}`
154936
155012
  );
154937
155013
  });
@@ -154959,7 +155035,7 @@ var QwenAgent = class {
154959
155035
  try {
154960
155036
  await config.refreshAuth(selectedType, true);
154961
155037
  } catch (e) {
154962
- debugLogger74.error(`Authentication failed: ${e}`);
155038
+ debugLogger75.error(`Authentication failed: ${e}`);
154963
155039
  throw RequestError.authRequired(
154964
155040
  {
154965
155041
  authMethods: this.pickAuthMethodsForAuthRequired(selectedType, e)
@@ -155112,7 +155188,7 @@ var QwenAgent = class {
155112
155188
 
155113
155189
  // packages/cli/src/gemini.tsx
155114
155190
  var import_jsx_runtime162 = __toESM(require_jsx_runtime(), 1);
155115
- var debugLogger75 = createDebugLogger("STARTUP");
155191
+ var debugLogger76 = createDebugLogger("STARTUP");
155116
155192
  function validateDnsResolutionOrder(order) {
155117
155193
  const defaultValue2 = "ipv4first";
155118
155194
  if (order === void 0) {
@@ -155186,7 +155262,7 @@ function installInteractiveSignalHandlers(wasRaw) {
155186
155262
  }
155187
155263
  cleanupStarted = true;
155188
155264
  void runExitCleanup().catch((error) => {
155189
- debugLogger75.error(`Error during ${signal} cleanup:`, error);
155265
+ debugLogger76.error(`Error during ${signal} cleanup:`, error);
155190
155266
  }).finally(() => {
155191
155267
  process.exit(getSignalExitCode(signal));
155192
155268
  });
@@ -155241,7 +155317,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
155241
155317
  );
155242
155318
  }
155243
155319
  } catch (err) {
155244
- debugLogger75.error("Failed to initialize dual output bridge:", err);
155320
+ debugLogger76.error("Failed to initialize dual output bridge:", err);
155245
155321
  writeStderrLine(
155246
155322
  `Warning: dual output disabled \u2014 ${err instanceof Error ? err.message : String(err)}`
155247
155323
  );
@@ -155252,7 +155328,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
155252
155328
  try {
155253
155329
  remoteInputWatcher = new RemoteInputWatcher(inputFile);
155254
155330
  } catch (err) {
155255
- debugLogger75.error("Failed to initialize remote input watcher:", err);
155331
+ debugLogger76.error("Failed to initialize remote input watcher:", err);
155256
155332
  writeStderrLine(
155257
155333
  `Warning: remote input disabled \u2014 ${err instanceof Error ? err.message : String(err)}`
155258
155334
  );
@@ -155295,7 +155371,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
155295
155371
  checkForUpdates().then((info) => {
155296
155372
  handleAutoUpdate(info, settings, config.getProjectRoot());
155297
155373
  }).catch((err) => {
155298
- debugLogger75.warn(`Update check failed: ${err}`);
155374
+ debugLogger76.warn(`Update check failed: ${err}`);
155299
155375
  });
155300
155376
  }
155301
155377
  registerCleanup(async () => {
@@ -155327,6 +155403,10 @@ async function main() {
155327
155403
  const settings = isBareMode(argv.bare) ? createMinimalSettings() : loadSettings();
155328
155404
  await cleanupCheckpoints();
155329
155405
  profileCheckpoint("after_load_settings");
155406
+ const settingsWarnings = getSettingsWarnings(settings);
155407
+ for (const warning of settingsWarnings) {
155408
+ writeStderrLine(warning);
155409
+ }
155330
155410
  if (argv.promptInteractive && !process.stdin.isTTY) {
155331
155411
  writeStderrLine(
155332
155412
  "Error: The --prompt-interactive flag cannot be used when input is piped from stdin."
@@ -155548,7 +155628,7 @@ ${finalArgs[promptIndex + 1]}`;
155548
155628
  )
155549
155629
  );
155550
155630
  } catch (error) {
155551
- debugLogger75.warn(
155631
+ debugLogger76.warn(
155552
155632
  `--worktree sidecar persist failed (non-fatal, notice preserved): ${error instanceof Error ? error.message : String(error)}`
155553
155633
  );
155554
155634
  }
@@ -155561,7 +155641,7 @@ ${finalArgs[promptIndex + 1]}`;
155561
155641
  const proxy = config.getProxy();
155562
155642
  preconnectApi(authType, { resolvedBaseUrl, proxy });
155563
155643
  } catch (error) {
155564
- debugLogger75.debug(
155644
+ debugLogger76.debug(
155565
155645
  `Preconnect skipped due to error getting authType: ${error}`
155566
155646
  );
155567
155647
  }
@@ -155578,7 +155658,7 @@ ${finalArgs[promptIndex + 1]}`;
155578
155658
  kittyProtocolDetectionComplete = detectAndEnableKittyProtocol();
155579
155659
  if (!configuredTheme || configuredTheme === AUTO_THEME_NAME) {
155580
155660
  themeAutoDetectionComplete = themeManager.resolveAutoThemeAsync().catch((err) => {
155581
- debugLogger75.warn("Async theme auto-detection failed:", err);
155661
+ debugLogger76.warn("Async theme auto-detection failed:", err);
155582
155662
  });
155583
155663
  }
155584
155664
  }
@@ -155607,6 +155687,9 @@ ${finalArgs[promptIndex + 1]}`;
155607
155687
  ] : []
155608
155688
  ])
155609
155689
  ];
155690
+ for (const warning of startupWarnings) {
155691
+ writeStderrLine(warning);
155692
+ }
155610
155693
  profileCheckpoint("before_render");
155611
155694
  if (config.isInteractive()) {
155612
155695
  if (config.getJsonSchema?.()) {
@@ -155694,7 +155777,7 @@ ${input}`;
155694
155777
  auth_type: config.getContentGeneratorConfig()?.authType,
155695
155778
  prompt_length: input.length
155696
155779
  });
155697
- debugLogger75.debug(`Session ID: ${config.getSessionId()}`);
155780
+ debugLogger76.debug(`Session ID: ${config.getSessionId()}`);
155698
155781
  const exitCode = await runNonInteractive(
155699
155782
  nonInteractiveConfig,
155700
155783
  settings,