@rdmind/rdmind 0.0.26 → 0.0.27

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 (2) hide show
  1. package/cli.js +715 -473
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -1550,11 +1550,11 @@ var require_signals = __commonJS({
1550
1550
  var require_signal_exit = __commonJS({
1551
1551
  "node_modules/ink/node_modules/signal-exit/index.js"(exports2, module2) {
1552
1552
  init_esbuild_shims();
1553
- var process50 = globalThis.process;
1554
- var processOk = /* @__PURE__ */ __name(function(process51) {
1555
- return process51 && typeof process51 === "object" && typeof process51.removeListener === "function" && typeof process51.emit === "function" && typeof process51.reallyExit === "function" && typeof process51.listeners === "function" && typeof process51.kill === "function" && typeof process51.pid === "number" && typeof process51.on === "function";
1553
+ var process51 = globalThis.process;
1554
+ var processOk = /* @__PURE__ */ __name(function(process52) {
1555
+ return process52 && typeof process52 === "object" && typeof process52.removeListener === "function" && typeof process52.emit === "function" && typeof process52.reallyExit === "function" && typeof process52.listeners === "function" && typeof process52.kill === "function" && typeof process52.pid === "number" && typeof process52.on === "function";
1556
1556
  }, "processOk");
1557
- if (!processOk(process50)) {
1557
+ if (!processOk(process51)) {
1558
1558
  module2.exports = function() {
1559
1559
  return function() {
1560
1560
  };
@@ -1562,15 +1562,15 @@ var require_signal_exit = __commonJS({
1562
1562
  } else {
1563
1563
  assert3 = __require("assert");
1564
1564
  signals = require_signals();
1565
- isWin = /^win/i.test(process50.platform);
1565
+ isWin = /^win/i.test(process51.platform);
1566
1566
  EE3 = __require("events");
1567
1567
  if (typeof EE3 !== "function") {
1568
1568
  EE3 = EE3.EventEmitter;
1569
1569
  }
1570
- if (process50.__signal_exit_emitter__) {
1571
- emitter = process50.__signal_exit_emitter__;
1570
+ if (process51.__signal_exit_emitter__) {
1571
+ emitter = process51.__signal_exit_emitter__;
1572
1572
  } else {
1573
- emitter = process50.__signal_exit_emitter__ = new EE3();
1573
+ emitter = process51.__signal_exit_emitter__ = new EE3();
1574
1574
  emitter.count = 0;
1575
1575
  emitter.emitted = {};
1576
1576
  }
@@ -1607,12 +1607,12 @@ var require_signal_exit = __commonJS({
1607
1607
  loaded = false;
1608
1608
  signals.forEach(function(sig) {
1609
1609
  try {
1610
- process50.removeListener(sig, sigListeners[sig]);
1610
+ process51.removeListener(sig, sigListeners[sig]);
1611
1611
  } catch (er) {
1612
1612
  }
1613
1613
  });
1614
- process50.emit = originalProcessEmit;
1615
- process50.reallyExit = originalProcessReallyExit;
1614
+ process51.emit = originalProcessEmit;
1615
+ process51.reallyExit = originalProcessReallyExit;
1616
1616
  emitter.count -= 1;
1617
1617
  }, "unload");
1618
1618
  module2.exports.unload = unload;
@@ -1629,7 +1629,7 @@ var require_signal_exit = __commonJS({
1629
1629
  if (!processOk(globalThis.process)) {
1630
1630
  return;
1631
1631
  }
1632
- var listeners = process50.listeners(sig);
1632
+ var listeners = process51.listeners(sig);
1633
1633
  if (listeners.length === emitter.count) {
1634
1634
  unload();
1635
1635
  emit("exit", null, sig);
@@ -1637,7 +1637,7 @@ var require_signal_exit = __commonJS({
1637
1637
  if (isWin && sig === "SIGHUP") {
1638
1638
  sig = "SIGINT";
1639
1639
  }
1640
- process50.kill(process50.pid, sig);
1640
+ process51.kill(process51.pid, sig);
1641
1641
  }
1642
1642
  }, "listener");
1643
1643
  });
@@ -1653,36 +1653,36 @@ var require_signal_exit = __commonJS({
1653
1653
  emitter.count += 1;
1654
1654
  signals = signals.filter(function(sig) {
1655
1655
  try {
1656
- process50.on(sig, sigListeners[sig]);
1656
+ process51.on(sig, sigListeners[sig]);
1657
1657
  return true;
1658
1658
  } catch (er) {
1659
1659
  return false;
1660
1660
  }
1661
1661
  });
1662
- process50.emit = processEmit;
1663
- process50.reallyExit = processReallyExit;
1662
+ process51.emit = processEmit;
1663
+ process51.reallyExit = processReallyExit;
1664
1664
  }, "load");
1665
1665
  module2.exports.load = load;
1666
- originalProcessReallyExit = process50.reallyExit;
1666
+ originalProcessReallyExit = process51.reallyExit;
1667
1667
  processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code2) {
1668
1668
  if (!processOk(globalThis.process)) {
1669
1669
  return;
1670
1670
  }
1671
- process50.exitCode = code2 || /* istanbul ignore next */
1671
+ process51.exitCode = code2 || /* istanbul ignore next */
1672
1672
  0;
1673
- emit("exit", process50.exitCode, null);
1674
- emit("afterexit", process50.exitCode, null);
1675
- originalProcessReallyExit.call(process50, process50.exitCode);
1673
+ emit("exit", process51.exitCode, null);
1674
+ emit("afterexit", process51.exitCode, null);
1675
+ originalProcessReallyExit.call(process51, process51.exitCode);
1676
1676
  }, "processReallyExit");
1677
- originalProcessEmit = process50.emit;
1677
+ originalProcessEmit = process51.emit;
1678
1678
  processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg) {
1679
1679
  if (ev === "exit" && processOk(globalThis.process)) {
1680
1680
  if (arg !== void 0) {
1681
- process50.exitCode = arg;
1681
+ process51.exitCode = arg;
1682
1682
  }
1683
1683
  var ret = originalProcessEmit.apply(this, arguments);
1684
- emit("exit", process50.exitCode, null);
1685
- emit("afterexit", process50.exitCode, null);
1684
+ emit("exit", process51.exitCode, null);
1685
+ emit("afterexit", process51.exitCode, null);
1686
1686
  return ret;
1687
1687
  } else {
1688
1688
  return originalProcessEmit.apply(this, arguments);
@@ -26803,7 +26803,7 @@ var require_backend = __commonJS({
26803
26803
  });
26804
26804
  return a._currentValue;
26805
26805
  }, "useContext"),
26806
- useEffect: /* @__PURE__ */ __name(function useEffect57(a) {
26806
+ useEffect: /* @__PURE__ */ __name(function useEffect58(a) {
26807
26807
  C();
26808
26808
  x.push({
26809
26809
  primitive: "Effect",
@@ -26868,7 +26868,7 @@ var require_backend = __commonJS({
26868
26868
  return [b, function() {
26869
26869
  }];
26870
26870
  }, "useReducer"),
26871
- useRef: /* @__PURE__ */ __name(function useRef20(a) {
26871
+ useRef: /* @__PURE__ */ __name(function useRef21(a) {
26872
26872
  var b = C();
26873
26873
  a = null !== b ? b.memoizedState : {
26874
26874
  current: a
@@ -28118,12 +28118,12 @@ var require_backend = __commonJS({
28118
28118
  /***/
28119
28119
  (module3, __unused_webpack_exports, __webpack_require__2) => {
28120
28120
  "use strict";
28121
- var process50 = __webpack_require__2(169);
28121
+ var process51 = __webpack_require__2(169);
28122
28122
  module3.exports = LRUCache2;
28123
28123
  var Map2 = __webpack_require__2(307);
28124
28124
  var util4 = __webpack_require__2(82);
28125
28125
  var Yallist2 = __webpack_require__2(695);
28126
- var hasSymbol = typeof Symbol === "function" && process50.env._nodeLRUCacheForceNoSymbol !== "1";
28126
+ var hasSymbol = typeof Symbol === "function" && process51.env._nodeLRUCacheForceNoSymbol !== "1";
28127
28127
  var makeSymbol;
28128
28128
  if (hasSymbol) {
28129
28129
  makeSymbol = /* @__PURE__ */ __name(function makeSymbol2(key) {
@@ -28522,7 +28522,7 @@ var require_backend = __commonJS({
28522
28522
  169: (
28523
28523
  /***/
28524
28524
  (module3) => {
28525
- var process50 = module3.exports = {};
28525
+ var process51 = module3.exports = {};
28526
28526
  var cachedSetTimeout;
28527
28527
  var cachedClearTimeout;
28528
28528
  function defaultSetTimout() {
@@ -28633,7 +28633,7 @@ var require_backend = __commonJS({
28633
28633
  runClearTimeout(timeout2);
28634
28634
  }
28635
28635
  __name(drainQueue, "drainQueue");
28636
- process50.nextTick = function(fun) {
28636
+ process51.nextTick = function(fun) {
28637
28637
  var args = new Array(arguments.length - 1);
28638
28638
  if (arguments.length > 1) {
28639
28639
  for (var i = 1; i < arguments.length; i++) {
@@ -28653,37 +28653,37 @@ var require_backend = __commonJS({
28653
28653
  Item.prototype.run = function() {
28654
28654
  this.fun.apply(null, this.array);
28655
28655
  };
28656
- process50.title = "browser";
28657
- process50.browser = true;
28658
- process50.env = {};
28659
- process50.argv = [];
28660
- process50.version = "";
28661
- process50.versions = {};
28656
+ process51.title = "browser";
28657
+ process51.browser = true;
28658
+ process51.env = {};
28659
+ process51.argv = [];
28660
+ process51.version = "";
28661
+ process51.versions = {};
28662
28662
  function noop6() {
28663
28663
  }
28664
28664
  __name(noop6, "noop");
28665
- process50.on = noop6;
28666
- process50.addListener = noop6;
28667
- process50.once = noop6;
28668
- process50.off = noop6;
28669
- process50.removeListener = noop6;
28670
- process50.removeAllListeners = noop6;
28671
- process50.emit = noop6;
28672
- process50.prependListener = noop6;
28673
- process50.prependOnceListener = noop6;
28674
- process50.listeners = function(name3) {
28665
+ process51.on = noop6;
28666
+ process51.addListener = noop6;
28667
+ process51.once = noop6;
28668
+ process51.off = noop6;
28669
+ process51.removeListener = noop6;
28670
+ process51.removeAllListeners = noop6;
28671
+ process51.emit = noop6;
28672
+ process51.prependListener = noop6;
28673
+ process51.prependOnceListener = noop6;
28674
+ process51.listeners = function(name3) {
28675
28675
  return [];
28676
28676
  };
28677
- process50.binding = function(name3) {
28677
+ process51.binding = function(name3) {
28678
28678
  throw new Error("process.binding is not supported");
28679
28679
  };
28680
- process50.cwd = function() {
28680
+ process51.cwd = function() {
28681
28681
  return "/";
28682
28682
  };
28683
- process50.chdir = function(dir) {
28683
+ process51.chdir = function(dir) {
28684
28684
  throw new Error("process.chdir is not supported");
28685
28685
  };
28686
- process50.umask = function() {
28686
+ process51.umask = function() {
28687
28687
  return 0;
28688
28688
  };
28689
28689
  }
@@ -28692,9 +28692,9 @@ var require_backend = __commonJS({
28692
28692
  307: (
28693
28693
  /***/
28694
28694
  (module3, __unused_webpack_exports, __webpack_require__2) => {
28695
- var process50 = __webpack_require__2(169);
28696
- if (process50.env.npm_package_name === "pseudomap" && process50.env.npm_lifecycle_script === "test") process50.env.TEST_PSEUDOMAP = "true";
28697
- if (typeof Map === "function" && !process50.env.TEST_PSEUDOMAP) {
28695
+ var process51 = __webpack_require__2(169);
28696
+ if (process51.env.npm_package_name === "pseudomap" && process51.env.npm_lifecycle_script === "test") process51.env.TEST_PSEUDOMAP = "true";
28697
+ if (typeof Map === "function" && !process51.env.TEST_PSEUDOMAP) {
28698
28698
  module3.exports = Map;
28699
28699
  } else {
28700
28700
  module3.exports = __webpack_require__2(761);
@@ -28996,7 +28996,7 @@ var require_backend = __commonJS({
28996
28996
  82: (
28997
28997
  /***/
28998
28998
  (__unused_webpack_module, exports3, __webpack_require__2) => {
28999
- var process50 = __webpack_require__2(169);
28999
+ var process51 = __webpack_require__2(169);
29000
29000
  function _typeof2(obj) {
29001
29001
  "@babel/helpers - typeof";
29002
29002
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
@@ -29056,15 +29056,15 @@ var require_backend = __commonJS({
29056
29056
  return exports3.deprecate(fn, msg).apply(this, arguments);
29057
29057
  };
29058
29058
  }
29059
- if (process50.noDeprecation === true) {
29059
+ if (process51.noDeprecation === true) {
29060
29060
  return fn;
29061
29061
  }
29062
29062
  var warned2 = false;
29063
29063
  function deprecated() {
29064
29064
  if (!warned2) {
29065
- if (process50.throwDeprecation) {
29065
+ if (process51.throwDeprecation) {
29066
29066
  throw new Error(msg);
29067
- } else if (process50.traceDeprecation) {
29067
+ } else if (process51.traceDeprecation) {
29068
29068
  console.trace(msg);
29069
29069
  } else {
29070
29070
  console.error(msg);
@@ -29079,11 +29079,11 @@ var require_backend = __commonJS({
29079
29079
  var debugs = {};
29080
29080
  var debugEnviron;
29081
29081
  exports3.debuglog = function(set) {
29082
- if (isUndefined2(debugEnviron)) debugEnviron = process50.env.NODE_DEBUG || "";
29082
+ if (isUndefined2(debugEnviron)) debugEnviron = process51.env.NODE_DEBUG || "";
29083
29083
  set = set.toUpperCase();
29084
29084
  if (!debugs[set]) {
29085
29085
  if (new RegExp("\\b" + set + "\\b", "i").test(debugEnviron)) {
29086
- var pid = process50.pid;
29086
+ var pid = process51.pid;
29087
29087
  debugs[set] = function() {
29088
29088
  var msg = exports3.format.apply(exports3, arguments);
29089
29089
  console.error("%s %d: %s", set, pid, msg);
@@ -31031,7 +31031,7 @@ var require_backend = __commonJS({
31031
31031
  var isArray2 = Array.isArray;
31032
31032
  const src_isArray = isArray2;
31033
31033
  ;
31034
- var process50 = __webpack_require__(169);
31034
+ var process51 = __webpack_require__(169);
31035
31035
  function utils_typeof(obj) {
31036
31036
  "@babel/helpers - typeof";
31037
31037
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
@@ -31332,7 +31332,7 @@ var require_backend = __commonJS({
31332
31332
  }
31333
31333
  __name(getShowInlineWarningsAndErrors, "getShowInlineWarningsAndErrors");
31334
31334
  function getDefaultOpenInEditorURL() {
31335
- return typeof process50.env.EDITOR_URL === "string" ? process50.env.EDITOR_URL : "";
31335
+ return typeof process51.env.EDITOR_URL === "string" ? process51.env.EDITOR_URL : "";
31336
31336
  }
31337
31337
  __name(getDefaultOpenInEditorURL, "getDefaultOpenInEditorURL");
31338
31338
  function getOpenInEditorURL() {
@@ -40442,11 +40442,11 @@ var require_signals2 = __commonJS({
40442
40442
  var require_signal_exit2 = __commonJS({
40443
40443
  "node_modules/restore-cursor/node_modules/signal-exit/index.js"(exports2, module2) {
40444
40444
  init_esbuild_shims();
40445
- var process50 = globalThis.process;
40446
- var processOk = /* @__PURE__ */ __name(function(process51) {
40447
- return process51 && typeof process51 === "object" && typeof process51.removeListener === "function" && typeof process51.emit === "function" && typeof process51.reallyExit === "function" && typeof process51.listeners === "function" && typeof process51.kill === "function" && typeof process51.pid === "number" && typeof process51.on === "function";
40445
+ var process51 = globalThis.process;
40446
+ var processOk = /* @__PURE__ */ __name(function(process52) {
40447
+ return process52 && typeof process52 === "object" && typeof process52.removeListener === "function" && typeof process52.emit === "function" && typeof process52.reallyExit === "function" && typeof process52.listeners === "function" && typeof process52.kill === "function" && typeof process52.pid === "number" && typeof process52.on === "function";
40448
40448
  }, "processOk");
40449
- if (!processOk(process50)) {
40449
+ if (!processOk(process51)) {
40450
40450
  module2.exports = function() {
40451
40451
  return function() {
40452
40452
  };
@@ -40454,15 +40454,15 @@ var require_signal_exit2 = __commonJS({
40454
40454
  } else {
40455
40455
  assert3 = __require("assert");
40456
40456
  signals = require_signals2();
40457
- isWin = /^win/i.test(process50.platform);
40457
+ isWin = /^win/i.test(process51.platform);
40458
40458
  EE3 = __require("events");
40459
40459
  if (typeof EE3 !== "function") {
40460
40460
  EE3 = EE3.EventEmitter;
40461
40461
  }
40462
- if (process50.__signal_exit_emitter__) {
40463
- emitter = process50.__signal_exit_emitter__;
40462
+ if (process51.__signal_exit_emitter__) {
40463
+ emitter = process51.__signal_exit_emitter__;
40464
40464
  } else {
40465
- emitter = process50.__signal_exit_emitter__ = new EE3();
40465
+ emitter = process51.__signal_exit_emitter__ = new EE3();
40466
40466
  emitter.count = 0;
40467
40467
  emitter.emitted = {};
40468
40468
  }
@@ -40499,12 +40499,12 @@ var require_signal_exit2 = __commonJS({
40499
40499
  loaded = false;
40500
40500
  signals.forEach(function(sig) {
40501
40501
  try {
40502
- process50.removeListener(sig, sigListeners[sig]);
40502
+ process51.removeListener(sig, sigListeners[sig]);
40503
40503
  } catch (er) {
40504
40504
  }
40505
40505
  });
40506
- process50.emit = originalProcessEmit;
40507
- process50.reallyExit = originalProcessReallyExit;
40506
+ process51.emit = originalProcessEmit;
40507
+ process51.reallyExit = originalProcessReallyExit;
40508
40508
  emitter.count -= 1;
40509
40509
  }, "unload");
40510
40510
  module2.exports.unload = unload;
@@ -40521,7 +40521,7 @@ var require_signal_exit2 = __commonJS({
40521
40521
  if (!processOk(globalThis.process)) {
40522
40522
  return;
40523
40523
  }
40524
- var listeners = process50.listeners(sig);
40524
+ var listeners = process51.listeners(sig);
40525
40525
  if (listeners.length === emitter.count) {
40526
40526
  unload();
40527
40527
  emit("exit", null, sig);
@@ -40529,7 +40529,7 @@ var require_signal_exit2 = __commonJS({
40529
40529
  if (isWin && sig === "SIGHUP") {
40530
40530
  sig = "SIGINT";
40531
40531
  }
40532
- process50.kill(process50.pid, sig);
40532
+ process51.kill(process51.pid, sig);
40533
40533
  }
40534
40534
  }, "listener");
40535
40535
  });
@@ -40545,36 +40545,36 @@ var require_signal_exit2 = __commonJS({
40545
40545
  emitter.count += 1;
40546
40546
  signals = signals.filter(function(sig) {
40547
40547
  try {
40548
- process50.on(sig, sigListeners[sig]);
40548
+ process51.on(sig, sigListeners[sig]);
40549
40549
  return true;
40550
40550
  } catch (er) {
40551
40551
  return false;
40552
40552
  }
40553
40553
  });
40554
- process50.emit = processEmit;
40555
- process50.reallyExit = processReallyExit;
40554
+ process51.emit = processEmit;
40555
+ process51.reallyExit = processReallyExit;
40556
40556
  }, "load");
40557
40557
  module2.exports.load = load;
40558
- originalProcessReallyExit = process50.reallyExit;
40558
+ originalProcessReallyExit = process51.reallyExit;
40559
40559
  processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code2) {
40560
40560
  if (!processOk(globalThis.process)) {
40561
40561
  return;
40562
40562
  }
40563
- process50.exitCode = code2 || /* istanbul ignore next */
40563
+ process51.exitCode = code2 || /* istanbul ignore next */
40564
40564
  0;
40565
- emit("exit", process50.exitCode, null);
40566
- emit("afterexit", process50.exitCode, null);
40567
- originalProcessReallyExit.call(process50, process50.exitCode);
40565
+ emit("exit", process51.exitCode, null);
40566
+ emit("afterexit", process51.exitCode, null);
40567
+ originalProcessReallyExit.call(process51, process51.exitCode);
40568
40568
  }, "processReallyExit");
40569
- originalProcessEmit = process50.emit;
40569
+ originalProcessEmit = process51.emit;
40570
40570
  processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg) {
40571
40571
  if (ev === "exit" && processOk(globalThis.process)) {
40572
40572
  if (arg !== void 0) {
40573
- process50.exitCode = arg;
40573
+ process51.exitCode = arg;
40574
40574
  }
40575
40575
  var ret = originalProcessEmit.apply(this, arguments);
40576
- emit("exit", process50.exitCode, null);
40577
- emit("afterexit", process50.exitCode, null);
40576
+ emit("exit", process51.exitCode, null);
40577
+ emit("afterexit", process51.exitCode, null);
40578
40578
  return ret;
40579
40579
  } else {
40580
40580
  return originalProcessEmit.apply(this, arguments);
@@ -71896,7 +71896,7 @@ var require_logging_utils = __commonJS({
71896
71896
  exports2.setBackend = setBackend;
71897
71897
  exports2.log = log;
71898
71898
  var node_events_1 = __require("node:events");
71899
- var process50 = __importStar(__require("node:process"));
71899
+ var process51 = __importStar(__require("node:process"));
71900
71900
  var util4 = __importStar(__require("node:util"));
71901
71901
  var colours_1 = require_colours();
71902
71902
  var LogSeverity;
@@ -71953,7 +71953,7 @@ var require_logging_utils = __commonJS({
71953
71953
  this.cached = /* @__PURE__ */ new Map();
71954
71954
  this.filters = [];
71955
71955
  this.filtersSet = false;
71956
- let nodeFlag = (_a6 = process50.env[exports2.env.nodeEnables]) !== null && _a6 !== void 0 ? _a6 : "*";
71956
+ let nodeFlag = (_a6 = process51.env[exports2.env.nodeEnables]) !== null && _a6 !== void 0 ? _a6 : "*";
71957
71957
  if (nodeFlag === "all") {
71958
71958
  nodeFlag = "*";
71959
71959
  }
@@ -71996,7 +71996,7 @@ var require_logging_utils = __commonJS({
71996
71996
  return (fields, ...args) => {
71997
71997
  var _a6;
71998
71998
  const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`;
71999
- const pid = `${colours_1.Colours.yellow}${process50.pid}${colours_1.Colours.reset}`;
71999
+ const pid = `${colours_1.Colours.yellow}${process51.pid}${colours_1.Colours.reset}`;
72000
72000
  let level;
72001
72001
  switch (fields.severity) {
72002
72002
  case LogSeverity.ERROR:
@@ -72048,8 +72048,8 @@ var require_logging_utils = __commonJS({
72048
72048
  }
72049
72049
  setFilters() {
72050
72050
  var _a6;
72051
- const existingFilters = (_a6 = process50.env["NODE_DEBUG"]) !== null && _a6 !== void 0 ? _a6 : "";
72052
- process50.env["NODE_DEBUG"] = `${existingFilters}${existingFilters ? "," : ""}${this.filters.join(",")}`;
72051
+ const existingFilters = (_a6 = process51.env["NODE_DEBUG"]) !== null && _a6 !== void 0 ? _a6 : "";
72052
+ process51.env["NODE_DEBUG"] = `${existingFilters}${existingFilters ? "," : ""}${this.filters.join(",")}`;
72053
72053
  }
72054
72054
  };
72055
72055
  function getDebugBackend(debugPkg) {
@@ -72101,7 +72101,7 @@ var require_logging_utils = __commonJS({
72101
72101
  }
72102
72102
  __name(setBackend, "setBackend");
72103
72103
  function log(namespace, parent) {
72104
- const enablesFlag = process50.env[exports2.env.nodeEnables];
72104
+ const enablesFlag = process51.env[exports2.env.nodeEnables];
72105
72105
  if (!enablesFlag) {
72106
72106
  return exports2.placeholder;
72107
72107
  }
@@ -77806,7 +77806,7 @@ var require_googleauth = __commonJS({
77806
77806
  var child_process_1 = __require("child_process");
77807
77807
  var fs98 = __require("fs");
77808
77808
  var gcpMetadata = require_src4();
77809
- var os42 = __require("os");
77809
+ var os43 = __require("os");
77810
77810
  var path110 = __require("path");
77811
77811
  var crypto_1 = require_crypto3();
77812
77812
  var transporters_1 = require_transporters();
@@ -78250,7 +78250,7 @@ var require_googleauth = __commonJS({
78250
78250
  * @api private
78251
78251
  */
78252
78252
  _isWindows() {
78253
- const sys = os42.platform();
78253
+ const sys = os43.platform();
78254
78254
  if (sys && sys.length >= 3) {
78255
78255
  if (sys.substring(0, 3).toLowerCase() === "win") {
78256
78256
  return true;
@@ -120638,6 +120638,7 @@ var init_mnemonist = __esm({
120638
120638
  // packages/core/src/telemetry/qwen-logger/qwen-logger.ts
120639
120639
  import { Buffer as Buffer3 } from "buffer";
120640
120640
  import * as https from "https";
120641
+ import * as os9 from "node:os";
120641
120642
  var import_https_proxy_agent, USAGE_STATS_HOSTNAME, USAGE_STATS_PATH, RUN_APP_ID, FLUSH_INTERVAL_MS, MAX_EVENTS, MAX_RETRY_EVENTS, QwenLogger;
120642
120643
  var init_qwen_logger = __esm({
120643
120644
  "packages/core/src/telemetry/qwen-logger/qwen-logger.ts"() {
@@ -120745,9 +120746,16 @@ var init_qwen_logger = __esm({
120745
120746
  createExceptionEvent(type, name3, properties) {
120746
120747
  return this.createRumEvent("exception", type, name3, properties);
120747
120748
  }
120749
+ getOsMetadata() {
120750
+ return {
120751
+ type: os9.platform(),
120752
+ version: os9.release()
120753
+ };
120754
+ }
120748
120755
  async createRumPayload() {
120749
120756
  const authType = this.config?.getAuthType();
120750
120757
  const version2 = this.config?.getCliVersion() || "unknown";
120758
+ const osMetadata = this.getOsMetadata();
120751
120759
  return {
120752
120760
  app: {
120753
120761
  id: RUN_APP_ID,
@@ -120765,6 +120773,7 @@ var init_qwen_logger = __esm({
120765
120773
  id: this.sessionId,
120766
120774
  name: "qwen-code-cli"
120767
120775
  },
120776
+ os: osMetadata,
120768
120777
  events: this.events.toArray(),
120769
120778
  properties: {
120770
120779
  auth_type: authType,
@@ -124498,7 +124507,7 @@ var require_service_config = __commonJS({
124498
124507
  exports2.validateRetryThrottling = validateRetryThrottling;
124499
124508
  exports2.validateServiceConfig = validateServiceConfig;
124500
124509
  exports2.extractAndSelectServiceConfig = extractAndSelectServiceConfig;
124501
- var os42 = __require("os");
124510
+ var os43 = __require("os");
124502
124511
  var constants_1 = require_constants9();
124503
124512
  var DURATION_REGEX = /^\d+(\.\d{1,9})?s$/;
124504
124513
  var CLIENT_LANGUAGE_STRING = "node";
@@ -124805,7 +124814,7 @@ var require_service_config = __commonJS({
124805
124814
  if (Array.isArray(validatedConfig.clientHostname)) {
124806
124815
  let hostnameMatched = false;
124807
124816
  for (const hostname3 of validatedConfig.clientHostname) {
124808
- if (hostname3 === os42.hostname()) {
124817
+ if (hostname3 === os43.hostname()) {
124809
124818
  hostnameMatched = true;
124810
124819
  }
124811
124820
  }
@@ -131036,7 +131045,7 @@ var require_root = __commonJS({
131036
131045
  return null;
131037
131046
  }
131038
131047
  __name(getBundledFileName, "getBundledFileName");
131039
- function process50(filename2, source2) {
131048
+ function process51(filename2, source2) {
131040
131049
  try {
131041
131050
  if (util4.isString(source2) && source2.charAt(0) === "{")
131042
131051
  source2 = JSON.parse(source2);
@@ -131063,7 +131072,7 @@ var require_root = __commonJS({
131063
131072
  finish(null, self2);
131064
131073
  }
131065
131074
  }
131066
- __name(process50, "process");
131075
+ __name(process51, "process");
131067
131076
  function fetch2(filename2, weak) {
131068
131077
  filename2 = getBundledFileName(filename2) || filename2;
131069
131078
  if (self2.files.indexOf(filename2) > -1) {
@@ -131072,12 +131081,12 @@ var require_root = __commonJS({
131072
131081
  self2.files.push(filename2);
131073
131082
  if (filename2 in common) {
131074
131083
  if (sync2) {
131075
- process50(filename2, common[filename2]);
131084
+ process51(filename2, common[filename2]);
131076
131085
  } else {
131077
131086
  ++queued;
131078
131087
  setTimeout(function() {
131079
131088
  --queued;
131080
- process50(filename2, common[filename2]);
131089
+ process51(filename2, common[filename2]);
131081
131090
  });
131082
131091
  }
131083
131092
  return;
@@ -131091,7 +131100,7 @@ var require_root = __commonJS({
131091
131100
  finish(err);
131092
131101
  return;
131093
131102
  }
131094
- process50(filename2, source2);
131103
+ process51(filename2, source2);
131095
131104
  } else {
131096
131105
  ++queued;
131097
131106
  self2.fetch(filename2, function(err, source3) {
@@ -131106,7 +131115,7 @@ var require_root = __commonJS({
131106
131115
  finish(null, self2);
131107
131116
  return;
131108
131117
  }
131109
- process50(filename2, source3);
131118
+ process51(filename2, source3);
131110
131119
  });
131111
131120
  }
131112
131121
  }
@@ -138771,7 +138780,7 @@ var require_subchannel_call = __commonJS({
138771
138780
  Object.defineProperty(exports2, "__esModule", { value: true });
138772
138781
  exports2.Http2SubchannelCall = void 0;
138773
138782
  var http22 = __require("http2");
138774
- var os42 = __require("os");
138783
+ var os43 = __require("os");
138775
138784
  var constants_1 = require_constants9();
138776
138785
  var metadata_1 = require_metadata3();
138777
138786
  var stream_decoder_1 = require_stream_decoder();
@@ -138779,7 +138788,7 @@ var require_subchannel_call = __commonJS({
138779
138788
  var constants_2 = require_constants9();
138780
138789
  var TRACER_NAME = "subchannel_call";
138781
138790
  function getSystemErrorName(errno) {
138782
- for (const [name3, num] of Object.entries(os42.constants.errno)) {
138791
+ for (const [name3, num] of Object.entries(os43.constants.errno)) {
138783
138792
  if (num === errno) {
138784
138793
  return name3;
138785
138794
  }
@@ -158572,13 +158581,13 @@ var require_getMachineId_win = __commonJS({
158572
158581
  init_esbuild_shims();
158573
158582
  Object.defineProperty(exports2, "__esModule", { value: true });
158574
158583
  exports2.getMachineId = void 0;
158575
- var process50 = __require("process");
158584
+ var process51 = __require("process");
158576
158585
  var execAsync_1 = require_execAsync();
158577
158586
  var api_1 = (init_esm2(), __toCommonJS(esm_exports2));
158578
158587
  async function getMachineId() {
158579
158588
  const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
158580
158589
  let command2 = "%windir%\\System32\\REG.exe";
158581
- if (process50.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process50.env) {
158590
+ if (process51.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process51.env) {
158582
158591
  command2 = "%windir%\\sysnative\\cmd.exe /c " + command2;
158583
158592
  }
158584
158593
  try {
@@ -158621,11 +158630,11 @@ var require_getMachineId = __commonJS({
158621
158630
  init_esbuild_shims();
158622
158631
  Object.defineProperty(exports2, "__esModule", { value: true });
158623
158632
  exports2.getMachineId = void 0;
158624
- var process50 = __require("process");
158633
+ var process51 = __require("process");
158625
158634
  var getMachineIdImpl;
158626
158635
  async function getMachineId() {
158627
158636
  if (!getMachineIdImpl) {
158628
- switch (process50.platform) {
158637
+ switch (process51.platform) {
158629
158638
  case "darwin":
158630
158639
  getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_darwin()))).getMachineId;
158631
158640
  break;
@@ -158747,7 +158756,7 @@ var require_ProcessDetector = __commonJS({
158747
158756
  exports2.processDetector = void 0;
158748
158757
  var api_1 = (init_esm2(), __toCommonJS(esm_exports2));
158749
158758
  var semconv_1 = require_semconv2();
158750
- var os42 = __require("os");
158759
+ var os43 = __require("os");
158751
158760
  var ProcessDetector = class {
158752
158761
  static {
158753
158762
  __name(this, "ProcessDetector");
@@ -158770,7 +158779,7 @@ var require_ProcessDetector = __commonJS({
158770
158779
  attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
158771
158780
  }
158772
158781
  try {
158773
- const userInfo2 = os42.userInfo();
158782
+ const userInfo2 = os43.userInfo();
158774
158783
  attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo2.username;
158775
158784
  } catch (e2) {
158776
158785
  api_1.diag.debug(`error obtaining process owner: ${e2}`);
@@ -165120,8 +165129,8 @@ var require_homedir = __commonJS({
165120
165129
  "node_modules/resolve/lib/homedir.js"(exports2, module2) {
165121
165130
  "use strict";
165122
165131
  init_esbuild_shims();
165123
- var os42 = __require("os");
165124
- module2.exports = os42.homedir || /* @__PURE__ */ __name(function homedir20() {
165132
+ var os43 = __require("os");
165133
+ module2.exports = os43.homedir || /* @__PURE__ */ __name(function homedir20() {
165125
165134
  var home = process.env.HOME;
165126
165135
  var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
165127
165136
  if (process.platform === "win32") {
@@ -172491,24 +172500,24 @@ var init_detect_platform = __esm({
172491
172500
  return `other:${arch3}`;
172492
172501
  return "unknown";
172493
172502
  }, "normalizeArch");
172494
- normalizePlatform = /* @__PURE__ */ __name((platform14) => {
172495
- platform14 = platform14.toLowerCase();
172496
- if (platform14.includes("ios"))
172503
+ normalizePlatform = /* @__PURE__ */ __name((platform15) => {
172504
+ platform15 = platform15.toLowerCase();
172505
+ if (platform15.includes("ios"))
172497
172506
  return "iOS";
172498
- if (platform14 === "android")
172507
+ if (platform15 === "android")
172499
172508
  return "Android";
172500
- if (platform14 === "darwin")
172509
+ if (platform15 === "darwin")
172501
172510
  return "MacOS";
172502
- if (platform14 === "win32")
172511
+ if (platform15 === "win32")
172503
172512
  return "Windows";
172504
- if (platform14 === "freebsd")
172513
+ if (platform15 === "freebsd")
172505
172514
  return "FreeBSD";
172506
- if (platform14 === "openbsd")
172515
+ if (platform15 === "openbsd")
172507
172516
  return "OpenBSD";
172508
- if (platform14 === "linux")
172517
+ if (platform15 === "linux")
172509
172518
  return "Linux";
172510
- if (platform14)
172511
- return `Other:${platform14}`;
172519
+ if (platform15)
172520
+ return `Other:${platform15}`;
172512
172521
  return "Unknown";
172513
172522
  }, "normalizePlatform");
172514
172523
  getPlatformHeaders = /* @__PURE__ */ __name(() => {
@@ -173791,8 +173800,8 @@ var init_uploads = __esm({
173791
173800
  init_shims();
173792
173801
  checkFileSupport = /* @__PURE__ */ __name(() => {
173793
173802
  if (typeof File === "undefined") {
173794
- const { process: process50 } = globalThis;
173795
- const isOldNode = typeof process50?.versions?.node === "string" && parseInt(process50.versions.node.split(".")) < 20;
173803
+ const { process: process51 } = globalThis;
173804
+ const isOldNode = typeof process51?.versions?.node === "string" && parseInt(process51.versions.node.split(".")) < 20;
173796
173805
  throw new Error("`File` is not defined as a global, which is required for file uploads." + (isOldNode ? " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`." : ""));
173797
173806
  }
173798
173807
  }, "checkFileSupport");
@@ -179589,6 +179598,89 @@ var init_constants2 = __esm({
179589
179598
  }
179590
179599
  });
179591
179600
 
179601
+ // packages/core/src/core/openaiContentGenerator/provider/default.ts
179602
+ var DefaultOpenAICompatibleProvider;
179603
+ var init_default = __esm({
179604
+ "packages/core/src/core/openaiContentGenerator/provider/default.ts"() {
179605
+ "use strict";
179606
+ init_esbuild_shims();
179607
+ init_openai();
179608
+ init_constants2();
179609
+ DefaultOpenAICompatibleProvider = class {
179610
+ static {
179611
+ __name(this, "DefaultOpenAICompatibleProvider");
179612
+ }
179613
+ contentGeneratorConfig;
179614
+ cliConfig;
179615
+ constructor(contentGeneratorConfig, cliConfig) {
179616
+ this.cliConfig = cliConfig;
179617
+ this.contentGeneratorConfig = contentGeneratorConfig;
179618
+ }
179619
+ buildHeaders() {
179620
+ const version2 = this.cliConfig.getCliVersion() || "unknown";
179621
+ const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
179622
+ return {
179623
+ "User-Agent": userAgent2
179624
+ };
179625
+ }
179626
+ buildClient() {
179627
+ const {
179628
+ apiKey,
179629
+ baseUrl,
179630
+ timeout: timeout2 = DEFAULT_TIMEOUT,
179631
+ maxRetries = DEFAULT_MAX_RETRIES
179632
+ } = this.contentGeneratorConfig;
179633
+ const defaultHeaders = this.buildHeaders();
179634
+ return new OpenAI({
179635
+ apiKey,
179636
+ baseURL: baseUrl,
179637
+ timeout: timeout2,
179638
+ maxRetries,
179639
+ defaultHeaders
179640
+ });
179641
+ }
179642
+ buildRequest(request4, _userPromptId) {
179643
+ return {
179644
+ ...request4
179645
+ // Preserve all original parameters including sampling params
179646
+ };
179647
+ }
179648
+ };
179649
+ }
179650
+ });
179651
+
179652
+ // packages/core/src/core/openaiContentGenerator/provider/modelscope.ts
179653
+ var ModelScopeOpenAICompatibleProvider;
179654
+ var init_modelscope = __esm({
179655
+ "packages/core/src/core/openaiContentGenerator/provider/modelscope.ts"() {
179656
+ "use strict";
179657
+ init_esbuild_shims();
179658
+ init_default();
179659
+ ModelScopeOpenAICompatibleProvider = class extends DefaultOpenAICompatibleProvider {
179660
+ static {
179661
+ __name(this, "ModelScopeOpenAICompatibleProvider");
179662
+ }
179663
+ /**
179664
+ * Checks if the configuration is for ModelScope.
179665
+ */
179666
+ static isModelScopeProvider(config) {
179667
+ return !!config.baseUrl?.includes("modelscope");
179668
+ }
179669
+ /**
179670
+ * ModelScope does not support `stream_options` when `stream` is false.
179671
+ * This method removes `stream_options` if `stream` is not true.
179672
+ */
179673
+ buildRequest(request4, userPromptId) {
179674
+ const newRequest = super.buildRequest(request4, userPromptId);
179675
+ if (!newRequest.stream) {
179676
+ delete newRequest.stream_options;
179677
+ }
179678
+ return newRequest;
179679
+ }
179680
+ };
179681
+ }
179682
+ });
179683
+
179592
179684
  // packages/core/src/core/tokenLimits.ts
179593
179685
  function normalize(model) {
179594
179686
  let s2 = (model ?? "").toLowerCase().trim();
@@ -180011,57 +180103,6 @@ var init_dashscope = __esm({
180011
180103
  }
180012
180104
  });
180013
180105
 
180014
- // packages/core/src/core/openaiContentGenerator/provider/default.ts
180015
- var DefaultOpenAICompatibleProvider;
180016
- var init_default = __esm({
180017
- "packages/core/src/core/openaiContentGenerator/provider/default.ts"() {
180018
- "use strict";
180019
- init_esbuild_shims();
180020
- init_openai();
180021
- init_constants2();
180022
- DefaultOpenAICompatibleProvider = class {
180023
- static {
180024
- __name(this, "DefaultOpenAICompatibleProvider");
180025
- }
180026
- contentGeneratorConfig;
180027
- cliConfig;
180028
- constructor(contentGeneratorConfig, cliConfig) {
180029
- this.cliConfig = cliConfig;
180030
- this.contentGeneratorConfig = contentGeneratorConfig;
180031
- }
180032
- buildHeaders() {
180033
- const version2 = this.cliConfig.getCliVersion() || "unknown";
180034
- const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
180035
- return {
180036
- "User-Agent": userAgent2
180037
- };
180038
- }
180039
- buildClient() {
180040
- const {
180041
- apiKey,
180042
- baseUrl,
180043
- timeout: timeout2 = DEFAULT_TIMEOUT,
180044
- maxRetries = DEFAULT_MAX_RETRIES
180045
- } = this.contentGeneratorConfig;
180046
- const defaultHeaders = this.buildHeaders();
180047
- return new OpenAI({
180048
- apiKey,
180049
- baseURL: baseUrl,
180050
- timeout: timeout2,
180051
- maxRetries,
180052
- defaultHeaders
180053
- });
180054
- }
180055
- buildRequest(request4, _userPromptId) {
180056
- return {
180057
- ...request4
180058
- // Preserve all original parameters including sampling params
180059
- };
180060
- }
180061
- };
180062
- }
180063
- });
180064
-
180065
180106
  // packages/core/src/core/openaiContentGenerator/provider/deepseek.ts
180066
180107
  var DeepSeekOpenAICompatibleProvider;
180067
180108
  var init_deepseek = __esm({
@@ -180222,6 +180263,7 @@ var init_provider = __esm({
180222
180263
  "packages/core/src/core/openaiContentGenerator/provider/index.ts"() {
180223
180264
  "use strict";
180224
180265
  init_esbuild_shims();
180266
+ init_modelscope();
180225
180267
  init_dashscope();
180226
180268
  init_deepseek();
180227
180269
  init_openrouter();
@@ -181693,7 +181735,8 @@ var init_converter2 = __esm({
181693
181735
  const promptTokens = usage2.prompt_tokens || 0;
181694
181736
  const completionTokens = usage2.completion_tokens || 0;
181695
181737
  const totalTokens = usage2.total_tokens || 0;
181696
- const cachedTokens = usage2.prompt_tokens_details?.cached_tokens || 0;
181738
+ const extendedUsage = usage2;
181739
+ const cachedTokens = usage2.prompt_tokens_details?.cached_tokens ?? extendedUsage.cached_tokens ?? 0;
181697
181740
  let finalPromptTokens = promptTokens;
181698
181741
  let finalCompletionTokens = completionTokens;
181699
181742
  if (totalTokens > 0 && promptTokens === 0 && completionTokens === 0) {
@@ -181784,7 +181827,8 @@ var init_converter2 = __esm({
181784
181827
  const promptTokens = usage2.prompt_tokens || 0;
181785
181828
  const completionTokens = usage2.completion_tokens || 0;
181786
181829
  const totalTokens = usage2.total_tokens || 0;
181787
- const cachedTokens = usage2.prompt_tokens_details?.cached_tokens || 0;
181830
+ const extendedUsage = usage2;
181831
+ const cachedTokens = usage2.prompt_tokens_details?.cached_tokens ?? extendedUsage.cached_tokens ?? 0;
181788
181832
  let finalPromptTokens = promptTokens;
181789
181833
  let finalCompletionTokens = completionTokens;
181790
181834
  if (totalTokens > 0 && promptTokens === 0 && completionTokens === 0) {
@@ -182301,7 +182345,7 @@ var init_pipeline = __esm({
182301
182345
  // packages/core/src/utils/openaiLogger.ts
182302
182346
  import * as path12 from "node:path";
182303
182347
  import { promises as fs16 } from "node:fs";
182304
- import * as os9 from "os";
182348
+ import * as os10 from "os";
182305
182349
  var OpenAILogger, openaiLogger;
182306
182350
  var init_openaiLogger = __esm({
182307
182351
  "packages/core/src/utils/openaiLogger.ts"() {
@@ -182322,7 +182366,7 @@ var init_openaiLogger = __esm({
182322
182366
  if (customLogDir) {
182323
182367
  let resolvedPath = customLogDir;
182324
182368
  if (customLogDir === "~" || customLogDir.startsWith("~/")) {
182325
- resolvedPath = path12.join(os9.homedir(), customLogDir.slice(1));
182369
+ resolvedPath = path12.join(os10.homedir(), customLogDir.slice(1));
182326
182370
  } else if (!path12.isAbsolute(customLogDir)) {
182327
182371
  resolvedPath = path12.resolve(process.cwd(), customLogDir);
182328
182372
  }
@@ -182368,9 +182412,9 @@ var init_openaiLogger = __esm({
182368
182412
  stack: error.stack
182369
182413
  } : null,
182370
182414
  system: {
182371
- hostname: os9.hostname(),
182372
- platform: os9.platform(),
182373
- release: os9.release(),
182415
+ hostname: os10.hostname(),
182416
+ platform: os10.platform(),
182417
+ release: os10.release(),
182374
182418
  nodeVersion: process.version
182375
182419
  }
182376
182420
  };
@@ -183543,6 +183587,12 @@ function determineProvider(contentGeneratorConfig, cliConfig) {
183543
183587
  cliConfig
183544
183588
  );
183545
183589
  }
183590
+ if (ModelScopeOpenAICompatibleProvider.isModelScopeProvider(config)) {
183591
+ return new ModelScopeOpenAICompatibleProvider(
183592
+ contentGeneratorConfig,
183593
+ cliConfig
183594
+ );
183595
+ }
183546
183596
  return new DefaultOpenAICompatibleProvider(contentGeneratorConfig, cliConfig);
183547
183597
  }
183548
183598
  var init_openaiContentGenerator2 = __esm({
@@ -183754,7 +183804,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
183754
183804
  };
183755
183805
  }
183756
183806
  async function createContentGenerator(config, gcConfig, sessionId2) {
183757
- const version2 = "0.0.26";
183807
+ const version2 = "0.0.27";
183758
183808
  const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
183759
183809
  const baseHeaders = {
183760
183810
  "User-Agent": userAgent2
@@ -184327,7 +184377,8 @@ function isValidEditorType(editor) {
184327
184377
  "vim",
184328
184378
  "neovim",
184329
184379
  "zed",
184330
- "emacs"
184380
+ "emacs",
184381
+ "trae"
184331
184382
  ].includes(editor);
184332
184383
  }
184333
184384
  function commandExists(cmd) {
@@ -184348,7 +184399,7 @@ function checkHasEditorType(editor) {
184348
184399
  }
184349
184400
  function allowEditorTypeInSandbox(editor) {
184350
184401
  const notUsingSandbox = !process.env["SANDBOX"];
184351
- if (["vscode", "vscodium", "windsurf", "cursor", "zed"].includes(editor)) {
184402
+ if (["vscode", "vscodium", "windsurf", "cursor", "zed", "trae"].includes(editor)) {
184352
184403
  return notUsingSandbox;
184353
184404
  }
184354
184405
  return true;
@@ -184372,6 +184423,7 @@ function getDiffCommand(oldPath, newPath, editor) {
184372
184423
  case "windsurf":
184373
184424
  case "cursor":
184374
184425
  case "zed":
184426
+ case "trae":
184375
184427
  return { command: command2, args: ["--wait", "--diff", oldPath, newPath] };
184376
184428
  case "vim":
184377
184429
  case "neovim":
@@ -184471,7 +184523,8 @@ var init_editor = __esm({
184471
184523
  vim: { win32: ["vim"], default: ["vim"] },
184472
184524
  neovim: { win32: ["nvim"], default: ["nvim"] },
184473
184525
  zed: { win32: ["zed"], default: ["zed", "zeditor"] },
184474
- emacs: { win32: ["emacs.exe"], default: ["emacs"] }
184526
+ emacs: { win32: ["emacs.exe"], default: ["emacs"] },
184527
+ trae: { win32: ["trae"], default: ["trae"] }
184475
184528
  };
184476
184529
  __name(checkHasEditorType, "checkHasEditorType");
184477
184530
  __name(allowEditorTypeInSandbox, "allowEditorTypeInSandbox");
@@ -185392,14 +185445,14 @@ var init_diffOptions = __esm({
185392
185445
  });
185393
185446
 
185394
185447
  // packages/core/src/tools/modifiable-tool.ts
185395
- import os10 from "node:os";
185448
+ import os11 from "node:os";
185396
185449
  import path13 from "node:path";
185397
185450
  import fs17 from "node:fs";
185398
185451
  function isModifiableDeclarativeTool(tool) {
185399
185452
  return "getModifyContext" in tool;
185400
185453
  }
185401
185454
  function createTempFilesForModify(currentContent, proposedContent, file_path) {
185402
- const tempDir = os10.tmpdir();
185455
+ const tempDir = os11.tmpdir();
185403
185456
  const diffDir = path13.join(tempDir, "qwen-code-tool-modify-diffs");
185404
185457
  if (!fs17.existsSync(diffDir)) {
185405
185458
  fs17.mkdirSync(diffDir, { recursive: true });
@@ -185797,10 +185850,10 @@ var init_gitUtils = __esm({
185797
185850
  // packages/core/src/utils/paths.ts
185798
185851
  import fs19 from "node:fs";
185799
185852
  import path15 from "node:path";
185800
- import os11 from "node:os";
185853
+ import os12 from "node:os";
185801
185854
  import * as crypto11 from "node:crypto";
185802
185855
  function tildeifyPath(path110) {
185803
- const homeDir = os11.homedir();
185856
+ const homeDir = os12.homedir();
185804
185857
  if (path110.startsWith(homeDir)) {
185805
185858
  return path110.replace(homeDir, "~");
185806
185859
  }
@@ -185882,13 +185935,13 @@ function getProjectHash(projectRoot) {
185882
185935
  return crypto11.createHash("sha256").update(projectRoot).digest("hex");
185883
185936
  }
185884
185937
  function isSubpath(parentPath, childPath) {
185885
- const isWindows8 = os11.platform() === "win32";
185938
+ const isWindows8 = os12.platform() === "win32";
185886
185939
  const pathModule2 = isWindows8 ? path15.win32 : path15;
185887
185940
  const relative10 = pathModule2.relative(parentPath, childPath);
185888
185941
  return !relative10.startsWith(`..${pathModule2.sep}`) && relative10 !== ".." && !pathModule2.isAbsolute(relative10);
185889
185942
  }
185890
185943
  function resolvePath(baseDir = process.cwd(), relativePath) {
185891
- const homeDir = os11.homedir();
185944
+ const homeDir = os12.homedir();
185892
185945
  if (relativePath === "~") {
185893
185946
  return homeDir;
185894
185947
  } else if (relativePath.startsWith("~/")) {
@@ -186389,7 +186442,7 @@ ${newContent}`;
186389
186442
  // packages/core/src/core/prompts.ts
186390
186443
  import path17 from "node:path";
186391
186444
  import fs21 from "node:fs";
186392
- import os12 from "node:os";
186445
+ import os13 from "node:os";
186393
186446
  import process18 from "node:process";
186394
186447
  function resolvePathFromEnv(envVar) {
186395
186448
  const trimmedEnvVar = envVar?.trim();
@@ -186404,7 +186457,7 @@ function resolvePathFromEnv(envVar) {
186404
186457
  let customPath = trimmedEnvVar;
186405
186458
  if (customPath.startsWith("~/") || customPath === "~") {
186406
186459
  try {
186407
- const home = os12.homedir();
186460
+ const home = os13.homedir();
186408
186461
  if (customPath === "~") {
186409
186462
  customPath = home;
186410
186463
  } else {
@@ -192923,7 +192976,7 @@ var require_lib3 = __commonJS({
192923
192976
 
192924
192977
  // packages/core/src/utils/systemEncoding.ts
192925
192978
  import { execSync as execSync2 } from "node:child_process";
192926
- import os13 from "node:os";
192979
+ import os14 from "node:os";
192927
192980
  function getCachedEncodingForBuffer(buffer) {
192928
192981
  if (cachedSystemEncoding === void 0) {
192929
192982
  cachedSystemEncoding = getSystemEncoding();
@@ -192934,7 +192987,7 @@ function getCachedEncodingForBuffer(buffer) {
192934
192987
  return detectEncodingFromBuffer(buffer) || "utf-8";
192935
192988
  }
192936
192989
  function getSystemEncoding() {
192937
- if (os13.platform() === "win32") {
192990
+ if (os14.platform() === "win32") {
192938
192991
  try {
192939
192992
  const output = execSync2("chcp", { encoding: "utf8" });
192940
192993
  const match3 = output.match(/:\s*(\d+)/);
@@ -196940,7 +196993,7 @@ var init_terminalSerializer = __esm({
196940
196993
  // packages/core/src/services/shellExecutionService.ts
196941
196994
  import { spawn as cpSpawn } from "node:child_process";
196942
196995
  import { TextDecoder as TextDecoder2 } from "node:util";
196943
- import os14 from "node:os";
196996
+ import os15 from "node:os";
196944
196997
  var import_headless, Terminal, SIGKILL_TIMEOUT_MS, getFullBufferText, ShellExecutionService;
196945
196998
  var init_shellExecutionService = __esm({
196946
196999
  "packages/core/src/services/shellExecutionService.ts"() {
@@ -197005,7 +197058,7 @@ var init_shellExecutionService = __esm({
197005
197058
  }
197006
197059
  static childProcessFallback(commandToExecute, cwd7, onOutputEvent, abortSignal) {
197007
197060
  try {
197008
- const isWindows8 = os14.platform() === "win32";
197061
+ const isWindows8 = os15.platform() === "win32";
197009
197062
  const child = cpSpawn(commandToExecute, [], {
197010
197063
  cwd: cwd7,
197011
197064
  stdio: ["ignore", "pipe", "pipe"],
@@ -197075,7 +197128,7 @@ var init_shellExecutionService = __esm({
197075
197128
  rawOutput: finalBuffer,
197076
197129
  output: finalStrippedOutput,
197077
197130
  exitCode: code2,
197078
- signal: signal ? os14.constants.signals[signal] : null,
197131
+ signal: signal ? os15.constants.signals[signal] : null,
197079
197132
  error,
197080
197133
  aborted: abortSignal.aborted,
197081
197134
  pid: void 0,
@@ -197157,7 +197210,7 @@ var init_shellExecutionService = __esm({
197157
197210
  try {
197158
197211
  const cols = shellExecutionConfig.terminalWidth ?? 80;
197159
197212
  const rows = shellExecutionConfig.terminalHeight ?? 30;
197160
- const isWindows8 = os14.platform() === "win32";
197213
+ const isWindows8 = os15.platform() === "win32";
197161
197214
  const shell2 = isWindows8 ? "cmd.exe" : "bash";
197162
197215
  const args = isWindows8 ? `/c ${commandToExecute}` : ["-c", commandToExecute];
197163
197216
  const ptyProcess = ptyInfo.module.spawn(shell2, args, {
@@ -197332,7 +197385,7 @@ var init_shellExecutionService = __esm({
197332
197385
  );
197333
197386
  const abortHandler = /* @__PURE__ */ __name(async () => {
197334
197387
  if (ptyProcess.pid && !exited) {
197335
- if (os14.platform() === "win32") {
197388
+ if (os15.platform() === "win32") {
197336
197389
  ptyProcess.kill();
197337
197390
  } else {
197338
197391
  try {
@@ -197954,7 +198007,7 @@ var init_shellReadOnlyChecker = __esm({
197954
198007
  });
197955
198008
 
197956
198009
  // packages/core/src/utils/shell-utils.ts
197957
- import os15 from "node:os";
198010
+ import os16 from "node:os";
197958
198011
  import { spawn as spawn2 } from "node:child_process";
197959
198012
  function getShellConfiguration() {
197960
198013
  if (isWindows3()) {
@@ -198230,7 +198283,7 @@ var init_shell_utils = __esm({
198230
198283
  init_shellReadOnlyChecker();
198231
198284
  SHELL_TOOL_NAMES2 = ["run_shell_command", "ShellTool"];
198232
198285
  __name(getShellConfiguration, "getShellConfiguration");
198233
- isWindows3 = /* @__PURE__ */ __name(() => os15.platform() === "win32", "isWindows");
198286
+ isWindows3 = /* @__PURE__ */ __name(() => os16.platform() === "win32", "isWindows");
198234
198287
  __name(escapeShellArg, "escapeShellArg");
198235
198288
  __name(splitCommands, "splitCommands");
198236
198289
  __name(getCommandRoot, "getCommandRoot");
@@ -198268,7 +198321,7 @@ ${stderr}`));
198268
198321
  // packages/core/src/tools/shell.ts
198269
198322
  import fs22 from "node:fs";
198270
198323
  import path18 from "node:path";
198271
- import os16, { EOL } from "node:os";
198324
+ import os17, { EOL } from "node:os";
198272
198325
  import crypto12 from "node:crypto";
198273
198326
  function getShellToolDescription() {
198274
198327
  const toolDescription = `
@@ -198301,7 +198354,7 @@ function getShellToolDescription() {
198301
198354
  Signal: Signal number or \`(none)\` if no signal was received.
198302
198355
  Background PIDs: List of background processes started or \`(none)\`.
198303
198356
  Process Group PGID: Process group started or \`(none)\``;
198304
- if (os16.platform() === "win32") {
198357
+ if (os17.platform() === "win32") {
198305
198358
  return `This tool executes a given shell command as \`cmd.exe /c <command>\`. Command can start background processes using \`start /b\`.${toolDescription}`;
198306
198359
  } else {
198307
198360
  return `This tool executes a given shell command as \`bash -c <command>\`. Command can start background processes using \`&\`. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`.${toolDescription}`;
@@ -198309,7 +198362,7 @@ function getShellToolDescription() {
198309
198362
  }
198310
198363
  function getCommandDescription() {
198311
198364
  const cmd_substitution_warning = "\n*** WARNING: Command substitution using $(), `` ` ``, <(), or >() is not allowed for security reasons.";
198312
- if (os16.platform() === "win32") {
198365
+ if (os17.platform() === "win32") {
198313
198366
  return "Exact command to execute as `cmd.exe /c <command>`" + cmd_substitution_warning;
198314
198367
  } else {
198315
198368
  return "Exact bash command to execute as `bash -c <command>`" + cmd_substitution_warning;
@@ -198385,9 +198438,9 @@ var init_shell = __esm({
198385
198438
  returnDisplay: "Command cancelled by user."
198386
198439
  };
198387
198440
  }
198388
- const isWindows8 = os16.platform() === "win32";
198441
+ const isWindows8 = os17.platform() === "win32";
198389
198442
  const tempFileName = `shell_pgrep_${crypto12.randomBytes(6).toString("hex")}.tmp`;
198390
- const tempFilePath = path18.join(os16.tmpdir(), tempFileName);
198443
+ const tempFilePath = path18.join(os17.tmpdir(), tempFileName);
198391
198444
  try {
198392
198445
  const processedCommand = this.addCoAuthorToGitCommit(strippedCommand);
198393
198446
  const shouldRunInBackground = this.params.is_background;
@@ -198452,7 +198505,7 @@ var init_shell = __esm({
198452
198505
  }
198453
198506
  const result = await resultPromise;
198454
198507
  const backgroundPIDs = [];
198455
- if (os16.platform() !== "win32") {
198508
+ if (os17.platform() !== "win32") {
198456
198509
  if (fs22.existsSync(tempFilePath)) {
198457
198510
  const pgrepLines = fs22.readFileSync(tempFilePath, "utf8").split(EOL).filter(Boolean);
198458
198511
  for (const line of pgrepLines) {
@@ -200849,12 +200902,12 @@ async function getEnvironmentContext(config) {
200849
200902
  month: "long",
200850
200903
  day: "numeric"
200851
200904
  });
200852
- const platform14 = process.platform;
200905
+ const platform15 = process.platform;
200853
200906
  const directoryContext = await getDirectoryContextString(config);
200854
200907
  const context2 = `
200855
200908
  This is the RDMind. We are setting up the context for our chat.
200856
200909
  Today's date is ${today} (formatted according to the user's locale).
200857
- My operating system is: ${platform14}
200910
+ My operating system is: ${platform15}
200858
200911
  ${directoryContext}
200859
200912
  `.trim();
200860
200913
  const initialParts = [{ text: context2 }];
@@ -213871,7 +213924,7 @@ var init_esm8 = __esm({
213871
213924
  const dirs = /* @__PURE__ */ new Set();
213872
213925
  const queue = [entry];
213873
213926
  let processing = 0;
213874
- const process50 = /* @__PURE__ */ __name(() => {
213927
+ const process51 = /* @__PURE__ */ __name(() => {
213875
213928
  let paused = false;
213876
213929
  while (!paused) {
213877
213930
  const dir = queue.shift();
@@ -213912,9 +213965,9 @@ var init_esm8 = __esm({
213912
213965
  }
213913
213966
  }
213914
213967
  if (paused && !results.flowing) {
213915
- results.once("drain", process50);
213968
+ results.once("drain", process51);
213916
213969
  } else if (!sync2) {
213917
- process50();
213970
+ process51();
213918
213971
  }
213919
213972
  }, "onReaddir");
213920
213973
  let sync2 = true;
@@ -213922,7 +213975,7 @@ var init_esm8 = __esm({
213922
213975
  sync2 = false;
213923
213976
  }
213924
213977
  }, "process");
213925
- process50();
213978
+ process51();
213926
213979
  return results;
213927
213980
  }
213928
213981
  streamSync(entry = this.cwd, opts = {}) {
@@ -213940,7 +213993,7 @@ var init_esm8 = __esm({
213940
213993
  }
213941
213994
  const queue = [entry];
213942
213995
  let processing = 0;
213943
- const process50 = /* @__PURE__ */ __name(() => {
213996
+ const process51 = /* @__PURE__ */ __name(() => {
213944
213997
  let paused = false;
213945
213998
  while (!paused) {
213946
213999
  const dir = queue.shift();
@@ -213974,9 +214027,9 @@ var init_esm8 = __esm({
213974
214027
  }
213975
214028
  }
213976
214029
  if (paused && !results.flowing)
213977
- results.once("drain", process50);
214030
+ results.once("drain", process51);
213978
214031
  }, "process");
213979
- process50();
214032
+ process51();
213980
214033
  return results;
213981
214034
  }
213982
214035
  chdir(path110 = this.cwd) {
@@ -214089,7 +214142,7 @@ var init_pattern = __esm({
214089
214142
  #isUNC;
214090
214143
  #isAbsolute;
214091
214144
  #followGlobstar = true;
214092
- constructor(patternList, globList, index, platform14) {
214145
+ constructor(patternList, globList, index, platform15) {
214093
214146
  if (!isPatternList(patternList)) {
214094
214147
  throw new TypeError("empty pattern list");
214095
214148
  }
@@ -214106,7 +214159,7 @@ var init_pattern = __esm({
214106
214159
  this.#patternList = patternList;
214107
214160
  this.#globList = globList;
214108
214161
  this.#index = index;
214109
- this.#platform = platform14;
214162
+ this.#platform = platform15;
214110
214163
  if (this.#index === 0) {
214111
214164
  if (this.isUNC()) {
214112
214165
  const [p0, p1, p2, p3, ...prest] = this.#patternList;
@@ -214259,12 +214312,12 @@ var init_ignore = __esm({
214259
214312
  absoluteChildren;
214260
214313
  platform;
214261
214314
  mmopts;
214262
- constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform14 = defaultPlatform2 }) {
214315
+ constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform15 = defaultPlatform2 }) {
214263
214316
  this.relative = [];
214264
214317
  this.absolute = [];
214265
214318
  this.relativeChildren = [];
214266
214319
  this.absoluteChildren = [];
214267
- this.platform = platform14;
214320
+ this.platform = platform15;
214268
214321
  this.mmopts = {
214269
214322
  dot: true,
214270
214323
  nobrace,
@@ -214272,7 +214325,7 @@ var init_ignore = __esm({
214272
214325
  noext,
214273
214326
  noglobstar,
214274
214327
  optimizationLevel: 2,
214275
- platform: platform14,
214328
+ platform: platform15,
214276
214329
  nocomment: true,
214277
214330
  nonegate: true
214278
214331
  };
@@ -221512,12 +221565,12 @@ var init_detect_ide = __esm({
221512
221565
  // packages/core/src/ide/process-utils.ts
221513
221566
  import { exec as exec2 } from "node:child_process";
221514
221567
  import { promisify as promisify5 } from "node:util";
221515
- import os17 from "node:os";
221568
+ import os18 from "node:os";
221516
221569
  import path32 from "node:path";
221517
221570
  async function getProcessInfo(pid) {
221518
221571
  try {
221519
- const platform14 = os17.platform();
221520
- if (platform14 === "win32") {
221572
+ const platform15 = os18.platform();
221573
+ if (platform15 === "win32") {
221521
221574
  const powershellCommand = [
221522
221575
  "$p = Get-CimInstance Win32_Process",
221523
221576
  `-Filter 'ProcessId=${pid}'`,
@@ -221621,8 +221674,8 @@ async function getIdeProcessInfoForWindows() {
221621
221674
  return { pid: currentPid, command: command2 };
221622
221675
  }
221623
221676
  async function getIdeProcessInfo() {
221624
- const platform14 = os17.platform();
221625
- if (platform14 === "win32") {
221677
+ const platform15 = os18.platform();
221678
+ if (platform15 === "win32") {
221626
221679
  return getIdeProcessInfoForWindows();
221627
221680
  }
221628
221681
  return getIdeProcessInfoForUnix();
@@ -230883,8 +230936,8 @@ var require_path_key = __commonJS({
230883
230936
  init_esbuild_shims();
230884
230937
  var pathKey = /* @__PURE__ */ __name((options2 = {}) => {
230885
230938
  const environment = options2.env || process.env;
230886
- const platform14 = options2.platform || process.platform;
230887
- if (platform14 !== "win32") {
230939
+ const platform15 = options2.platform || process.platform;
230940
+ if (platform15 !== "win32") {
230888
230941
  return "PATH";
230889
230942
  }
230890
230943
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
@@ -231387,7 +231440,7 @@ var init_stdio2 = __esm({
231387
231440
 
231388
231441
  // packages/core/src/ide/ide-client.ts
231389
231442
  import * as fs31 from "node:fs";
231390
- import * as os18 from "node:os";
231443
+ import * as os19 from "node:os";
231391
231444
  import * as path33 from "node:path";
231392
231445
  function getRealPath(path110) {
231393
231446
  try {
@@ -231557,7 +231610,7 @@ var init_ide_client = __esm({
231557
231610
  * content if accepted.
231558
231611
  */
231559
231612
  async openDiff(filePath, newContent) {
231560
- const release2 = await this.acquireMutex();
231613
+ const release3 = await this.acquireMutex();
231561
231614
  const promise = new Promise((resolve26, reject) => {
231562
231615
  if (!this.client) {
231563
231616
  return reject(new Error("IDE client is not connected."));
@@ -231595,7 +231648,7 @@ var init_ide_client = __esm({
231595
231648
  reject(err);
231596
231649
  });
231597
231650
  });
231598
- promise.finally(release2);
231651
+ promise.finally(release3);
231599
231652
  return promise;
231600
231653
  }
231601
231654
  /**
@@ -231616,13 +231669,13 @@ var init_ide_client = __esm({
231616
231669
  * release the lock.
231617
231670
  */
231618
231671
  acquireMutex() {
231619
- let release2;
231672
+ let release3;
231620
231673
  const newMutex = new Promise((resolve26) => {
231621
- release2 = resolve26;
231674
+ release3 = resolve26;
231622
231675
  });
231623
231676
  const oldMutex = this.diffMutex;
231624
231677
  this.diffMutex = newMutex;
231625
- return oldMutex.then(() => release2);
231678
+ return oldMutex.then(() => release3);
231626
231679
  }
231627
231680
  async closeDiff(filePath, options2) {
231628
231681
  try {
@@ -231836,14 +231889,14 @@ var init_ide_client = __esm({
231836
231889
  }
231837
231890
  try {
231838
231891
  const portFile = path33.join(
231839
- os18.tmpdir(),
231892
+ os19.tmpdir(),
231840
231893
  `qwen-code-ide-server-${this.ideProcessInfo.pid}.json`
231841
231894
  );
231842
231895
  const portFileContents = await fs31.promises.readFile(portFile, "utf8");
231843
231896
  return JSON.parse(portFileContents);
231844
231897
  } catch (_) {
231845
231898
  }
231846
- const portFileDir = path33.join(os18.tmpdir(), "gemini", "ide");
231899
+ const portFileDir = path33.join(os19.tmpdir(), "gemini", "ide");
231847
231900
  let portFiles;
231848
231901
  try {
231849
231902
  portFiles = await fs31.promises.readdir(portFileDir);
@@ -234286,14 +234339,14 @@ Use this tool when the user's query implies needing the content of several files
234286
234339
  // packages/core/src/utils/ripgrepUtils.ts
234287
234340
  import path39 from "node:path";
234288
234341
  import { fileURLToPath as fileURLToPath5 } from "node:url";
234289
- function getPlatformString(platform14) {
234290
- switch (platform14) {
234342
+ function getPlatformString(platform15) {
234343
+ switch (platform15) {
234291
234344
  case "darwin":
234292
234345
  case "linux":
234293
234346
  case "win32":
234294
- return platform14;
234347
+ return platform15;
234295
234348
  default:
234296
- throw new Error(`Unsupported platform: ${platform14}`);
234349
+ throw new Error(`Unsupported platform: ${platform15}`);
234297
234350
  }
234298
234351
  }
234299
234352
  function getArchitectureString(arch3) {
@@ -234306,15 +234359,15 @@ function getArchitectureString(arch3) {
234306
234359
  }
234307
234360
  }
234308
234361
  function getRipgrepPath() {
234309
- const platform14 = getPlatformString(process.platform);
234362
+ const platform15 = getPlatformString(process.platform);
234310
234363
  const arch3 = getArchitectureString(process.arch);
234311
- const binaryName = platform14 === "win32" ? "rg.exe" : "rg";
234364
+ const binaryName = platform15 === "win32" ? "rg.exe" : "rg";
234312
234365
  const isBundled = !__filename2.includes(path39.join("src", "utils"));
234313
234366
  const vendorPath = isBundled ? path39.join(
234314
234367
  __dirname3,
234315
234368
  "vendor",
234316
234369
  "ripgrep",
234317
- `${arch3}-${platform14}`,
234370
+ `${arch3}-${platform15}`,
234318
234371
  binaryName
234319
234372
  ) : path39.join(
234320
234373
  __dirname3,
@@ -234323,7 +234376,7 @@ function getRipgrepPath() {
234323
234376
  "..",
234324
234377
  "vendor",
234325
234378
  "ripgrep",
234326
- `${arch3}-${platform14}`,
234379
+ `${arch3}-${platform15}`,
234327
234380
  binaryName
234328
234381
  );
234329
234382
  return vendorPath;
@@ -236896,7 +236949,7 @@ var init_sa_impersonation_provider = __esm({
236896
236949
  // packages/core/src/utils/secure-browser-launcher.ts
236897
236950
  import { execFile as execFile6 } from "node:child_process";
236898
236951
  import { promisify as promisify6 } from "node:util";
236899
- import { platform as platform4 } from "node:os";
236952
+ import { platform as platform5 } from "node:os";
236900
236953
  import { URL as URL3 } from "node:url";
236901
236954
  function validateUrl(url2) {
236902
236955
  let parsedUrl;
@@ -236916,7 +236969,7 @@ function validateUrl(url2) {
236916
236969
  }
236917
236970
  async function openBrowserSecurely(url2) {
236918
236971
  validateUrl(url2);
236919
- const platformName = platform4();
236972
+ const platformName = platform5();
236920
236973
  let command2;
236921
236974
  let args;
236922
236975
  switch (platformName) {
@@ -245662,10 +245715,10 @@ var init_google_provider = __esm({
245662
245715
 
245663
245716
  // packages/core/src/tools/web-search/providers/dashscope-provider.ts
245664
245717
  import { promises as fs41 } from "node:fs";
245665
- import * as os19 from "os";
245718
+ import * as os20 from "os";
245666
245719
  import * as path45 from "path";
245667
245720
  function getQwenCachedCredentialPath2() {
245668
- return path45.join(os19.homedir(), QWEN_DIR6, QWEN_CREDENTIAL_FILENAME3);
245721
+ return path45.join(os20.homedir(), QWEN_DIR6, QWEN_CREDENTIAL_FILENAME3);
245669
245722
  }
245670
245723
  async function loadQwenCredentials() {
245671
245724
  try {
@@ -246968,7 +247021,7 @@ YYYY-MM-DD \u5173\u952E\u8BCD: \u6982\u62EC (\u5E94\u7528\u5177\u4F53\u63CF\u8F
246968
247021
  // packages/core/src/subagents/subagent-manager.ts
246969
247022
  import * as fs43 from "fs/promises";
246970
247023
  import * as path47 from "path";
246971
- import * as os20 from "os";
247024
+ import * as os21 from "os";
246972
247025
  var QWEN_CONFIG_DIR2, AGENT_CONFIG_DIR, SubagentManager;
246973
247026
  var init_subagent_manager = __esm({
246974
247027
  "packages/core/src/subagents/subagent-manager.ts"() {
@@ -247467,7 +247520,7 @@ ${config.systemPrompt}
247467
247520
  this.config.getProjectRoot(),
247468
247521
  QWEN_CONFIG_DIR2,
247469
247522
  AGENT_CONFIG_DIR
247470
- ) : path47.join(os20.homedir(), QWEN_CONFIG_DIR2, AGENT_CONFIG_DIR);
247523
+ ) : path47.join(os21.homedir(), QWEN_CONFIG_DIR2, AGENT_CONFIG_DIR);
247471
247524
  return path47.join(baseDir, `${name3}.md`);
247472
247525
  }
247473
247526
  /**
@@ -247482,7 +247535,7 @@ ${config.systemPrompt}
247482
247535
  return BuiltinAgentRegistry.getBuiltinAgents();
247483
247536
  }
247484
247537
  const projectRoot = this.config.getProjectRoot();
247485
- const homeDir = os20.homedir();
247538
+ const homeDir = os21.homedir();
247486
247539
  const isHomeDirectory = path47.resolve(projectRoot) === path47.resolve(homeDir);
247487
247540
  if (level === "project" && isHomeDirectory) {
247488
247541
  return [];
@@ -252114,8 +252167,8 @@ var require_utils14 = __commonJS({
252114
252167
  exports2.toPosixSlashes = (str2) => str2.replace(REGEX_BACKSLASH, "/");
252115
252168
  exports2.isWindows = () => {
252116
252169
  if (typeof navigator !== "undefined" && navigator.platform) {
252117
- const platform14 = navigator.platform.toLowerCase();
252118
- return platform14 === "win32" || platform14 === "windows";
252170
+ const platform15 = navigator.platform.toLowerCase();
252171
+ return platform15 === "win32" || platform15 === "windows";
252119
252172
  }
252120
252173
  if (typeof process !== "undefined" && process.platform) {
252121
252174
  return process.platform === "win32";
@@ -256007,14 +256060,14 @@ import * as child_process from "node:child_process";
256007
256060
  import * as process24 from "node:process";
256008
256061
  import * as path58 from "node:path";
256009
256062
  import * as fs51 from "node:fs";
256010
- import * as os21 from "node:os";
256011
- function getVsCodeCommand(platform14 = process24.platform) {
256012
- return platform14 === "win32" ? "code.cmd" : "code";
256063
+ import * as os22 from "node:os";
256064
+ function getVsCodeCommand(platform15 = process24.platform) {
256065
+ return platform15 === "win32" ? "code.cmd" : "code";
256013
256066
  }
256014
- async function findVsCodeCommand(platform14 = process24.platform) {
256015
- const vscodeCommand = getVsCodeCommand(platform14);
256067
+ async function findVsCodeCommand(platform15 = process24.platform) {
256068
+ const vscodeCommand = getVsCodeCommand(platform15);
256016
256069
  try {
256017
- if (platform14 === "win32") {
256070
+ if (platform15 === "win32") {
256018
256071
  const result = child_process.execSync(`where.exe ${vscodeCommand}`).toString().trim();
256019
256072
  const firstPath = result.split(/\r?\n/)[0];
256020
256073
  if (firstPath) {
@@ -256029,19 +256082,19 @@ async function findVsCodeCommand(platform14 = process24.platform) {
256029
256082
  } catch {
256030
256083
  }
256031
256084
  const locations = [];
256032
- const homeDir = os21.homedir();
256033
- if (platform14 === "darwin") {
256085
+ const homeDir = os22.homedir();
256086
+ if (platform15 === "darwin") {
256034
256087
  locations.push(
256035
256088
  "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code",
256036
256089
  path58.join(homeDir, "Library/Application Support/Code/bin/code")
256037
256090
  );
256038
- } else if (platform14 === "linux") {
256091
+ } else if (platform15 === "linux") {
256039
256092
  locations.push(
256040
256093
  "/usr/share/code/bin/code",
256041
256094
  "/snap/bin/code",
256042
256095
  path58.join(homeDir, ".local/share/code/bin/code")
256043
256096
  );
256044
- } else if (platform14 === "win32") {
256097
+ } else if (platform15 === "win32") {
256045
256098
  locations.push(
256046
256099
  path58.join(
256047
256100
  process24.env["ProgramFiles"] || "C:\\Program Files",
@@ -256067,11 +256120,11 @@ async function findVsCodeCommand(platform14 = process24.platform) {
256067
256120
  }
256068
256121
  return null;
256069
256122
  }
256070
- function getIdeInstaller(ide, platform14 = process24.platform) {
256123
+ function getIdeInstaller(ide, platform15 = process24.platform) {
256071
256124
  switch (ide.name) {
256072
256125
  case IDE_DEFINITIONS.vscode.name:
256073
256126
  case IDE_DEFINITIONS.firebasestudio.name:
256074
- return new VsCodeInstaller(ide, platform14);
256127
+ return new VsCodeInstaller(ide, platform15);
256075
256128
  default:
256076
256129
  return null;
256077
256130
  }
@@ -256086,10 +256139,10 @@ var init_ide_installer = __esm({
256086
256139
  __name(getVsCodeCommand, "getVsCodeCommand");
256087
256140
  __name(findVsCodeCommand, "findVsCodeCommand");
256088
256141
  VsCodeInstaller = class {
256089
- constructor(ideInfo, platform14 = process24.platform) {
256142
+ constructor(ideInfo, platform15 = process24.platform) {
256090
256143
  this.ideInfo = ideInfo;
256091
- this.platform = platform14;
256092
- this.vsCodeCommand = findVsCodeCommand(platform14);
256144
+ this.platform = platform15;
256145
+ this.vsCodeCommand = findVsCodeCommand(platform15);
256093
256146
  }
256094
256147
  static {
256095
256148
  __name(this, "VsCodeInstaller");
@@ -261269,7 +261322,7 @@ var require_supports_color = __commonJS({
261269
261322
  "node_modules/chalk/node_modules/supports-color/index.js"(exports2, module2) {
261270
261323
  "use strict";
261271
261324
  init_esbuild_shims();
261272
- var os42 = __require("os");
261325
+ var os43 = __require("os");
261273
261326
  var tty3 = __require("tty");
261274
261327
  var hasFlag3 = require_has_flag();
261275
261328
  var { env: env7 } = process;
@@ -261318,7 +261371,7 @@ var require_supports_color = __commonJS({
261318
261371
  return min;
261319
261372
  }
261320
261373
  if (process.platform === "win32") {
261321
- const osRelease = os42.release().split(".");
261374
+ const osRelease = os43.release().split(".");
261322
261375
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
261323
261376
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
261324
261377
  }
@@ -264205,7 +264258,7 @@ var require_main = __commonJS({
264205
264258
  init_esbuild_shims();
264206
264259
  var fs98 = __require("fs");
264207
264260
  var path110 = __require("path");
264208
- var os42 = __require("os");
264261
+ var os43 = __require("os");
264209
264262
  var crypto18 = __require("crypto");
264210
264263
  var packageJson4 = require_package5();
264211
264264
  var version2 = packageJson4.version;
@@ -264360,7 +264413,7 @@ var require_main = __commonJS({
264360
264413
  }
264361
264414
  __name(_vaultPath, "_vaultPath");
264362
264415
  function _resolveHome(envPath) {
264363
- return envPath[0] === "~" ? path110.join(os42.homedir(), envPath.slice(1)) : envPath;
264416
+ return envPath[0] === "~" ? path110.join(os43.homedir(), envPath.slice(1)) : envPath;
264364
264417
  }
264365
264418
  __name(_resolveHome, "_resolveHome");
264366
264419
  function _configVault(options2) {
@@ -274342,7 +274395,7 @@ var require_supports_color2 = __commonJS({
274342
274395
  "node_modules/supports-hyperlinks/node_modules/supports-color/index.js"(exports2, module2) {
274343
274396
  "use strict";
274344
274397
  init_esbuild_shims();
274345
- var os42 = __require("os");
274398
+ var os43 = __require("os");
274346
274399
  var tty3 = __require("tty");
274347
274400
  var hasFlag3 = require_has_flag();
274348
274401
  var { env: env7 } = process;
@@ -274391,7 +274444,7 @@ var require_supports_color2 = __commonJS({
274391
274444
  return min;
274392
274445
  }
274393
274446
  if (process.platform === "win32") {
274394
- const osRelease = os42.release().split(".");
274447
+ const osRelease = os43.release().split(".");
274395
274448
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
274396
274449
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
274397
274450
  }
@@ -276462,8 +276515,8 @@ var require_semver2 = __commonJS({
276462
276515
  }
276463
276516
  // preminor will bump the version up to the next minor release, and immediately
276464
276517
  // down to pre-release. premajor and prepatch work the same way.
276465
- inc(release2, identifier2, identifierBase) {
276466
- if (release2.startsWith("pre")) {
276518
+ inc(release3, identifier2, identifierBase) {
276519
+ if (release3.startsWith("pre")) {
276467
276520
  if (!identifier2 && identifierBase === false) {
276468
276521
  throw new Error("invalid increment argument: identifier is empty");
276469
276522
  }
@@ -276474,7 +276527,7 @@ var require_semver2 = __commonJS({
276474
276527
  }
276475
276528
  }
276476
276529
  }
276477
- switch (release2) {
276530
+ switch (release3) {
276478
276531
  case "premajor":
276479
276532
  this.prerelease.length = 0;
276480
276533
  this.patch = 0;
@@ -276565,7 +276618,7 @@ var require_semver2 = __commonJS({
276565
276618
  break;
276566
276619
  }
276567
276620
  default:
276568
- throw new Error(`invalid increment argument: ${release2}`);
276621
+ throw new Error(`invalid increment argument: ${release3}`);
276569
276622
  }
276570
276623
  this.raw = this.format();
276571
276624
  if (this.build.length) {
@@ -282801,7 +282854,7 @@ var require_polyfills = __commonJS({
282801
282854
  var constants4 = __require("constants");
282802
282855
  var origCwd = process.cwd;
282803
282856
  var cwd7 = null;
282804
- var platform14 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
282857
+ var platform15 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
282805
282858
  process.cwd = function() {
282806
282859
  if (!cwd7)
282807
282860
  cwd7 = origCwd.call(process);
@@ -282860,7 +282913,7 @@ var require_polyfills = __commonJS({
282860
282913
  fs98.lchownSync = function() {
282861
282914
  };
282862
282915
  }
282863
- if (platform14 === "win32") {
282916
+ if (platform15 === "win32") {
282864
282917
  fs98.rename = typeof fs98.rename !== "function" ? fs98.rename : function(fs$rename) {
282865
282918
  function rename(from, to, cb) {
282866
282919
  var start = Date.now();
@@ -284377,7 +284430,7 @@ var require_polyfills2 = __commonJS({
284377
284430
  var constants4 = __require("constants");
284378
284431
  var origCwd = process.cwd;
284379
284432
  var cwd7 = null;
284380
- var platform14 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
284433
+ var platform15 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
284381
284434
  process.cwd = function() {
284382
284435
  if (!cwd7)
284383
284436
  cwd7 = origCwd.call(process);
@@ -284436,7 +284489,7 @@ var require_polyfills2 = __commonJS({
284436
284489
  fs98.lchownSync = function() {
284437
284490
  };
284438
284491
  }
284439
- if (platform14 === "win32") {
284492
+ if (platform15 === "win32") {
284440
284493
  fs98.rename = typeof fs98.rename !== "function" ? fs98.rename : function(fs$rename) {
284441
284494
  function rename(from, to, cb) {
284442
284495
  var start = Date.now();
@@ -286257,9 +286310,9 @@ var require_defaults3 = __commonJS({
286257
286310
  "node_modules/@pnpm/npm-conf/lib/defaults.js"(exports2) {
286258
286311
  "use strict";
286259
286312
  init_esbuild_shims();
286260
- var os42 = __require("os");
286313
+ var os43 = __require("os");
286261
286314
  var path110 = __require("path");
286262
- var temp = os42.tmpdir();
286315
+ var temp = os43.tmpdir();
286263
286316
  var uidOrPid = process.getuid ? process.getuid() : process.pid;
286264
286317
  var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
286265
286318
  var isWindows8 = process.platform === "win32";
@@ -286270,7 +286323,7 @@ var require_defaults3 = __commonJS({
286270
286323
  var umask = {
286271
286324
  fromString: /* @__PURE__ */ __name(() => process.umask(), "fromString")
286272
286325
  };
286273
- var home = os42.homedir();
286326
+ var home = os43.homedir();
286274
286327
  if (home) {
286275
286328
  process.env.HOME = home;
286276
286329
  } else {
@@ -286618,7 +286671,7 @@ var require_inc = __commonJS({
286618
286671
  "use strict";
286619
286672
  init_esbuild_shims();
286620
286673
  var SemVer = require_semver2();
286621
- var inc = /* @__PURE__ */ __name((version2, release2, options2, identifier2, identifierBase) => {
286674
+ var inc = /* @__PURE__ */ __name((version2, release3, options2, identifier2, identifierBase) => {
286622
286675
  if (typeof options2 === "string") {
286623
286676
  identifierBase = identifier2;
286624
286677
  identifier2 = options2;
@@ -286628,7 +286681,7 @@ var require_inc = __commonJS({
286628
286681
  return new SemVer(
286629
286682
  version2 instanceof SemVer ? version2.version : version2,
286630
286683
  options2
286631
- ).inc(release2, identifier2, identifierBase).version;
286684
+ ).inc(release3, identifier2, identifierBase).version;
286632
286685
  } catch (er) {
286633
286686
  return null;
286634
286687
  }
@@ -288397,7 +288450,7 @@ init_esbuild_shims();
288397
288450
 
288398
288451
  // packages/cli/src/gemini.tsx
288399
288452
  init_esbuild_shims();
288400
- var import_react136 = __toESM(require_react(), 1);
288453
+ var import_react137 = __toESM(require_react(), 1);
288401
288454
 
288402
288455
  // node_modules/ink/build/index.js
288403
288456
  init_esbuild_shims();
@@ -294961,7 +295014,7 @@ var measure_element_default = measureElement;
294961
295014
 
294962
295015
  // packages/cli/src/ui/AppContainer.tsx
294963
295016
  init_esbuild_shims();
294964
- var import_react134 = __toESM(require_react(), 1);
295017
+ var import_react135 = __toESM(require_react(), 1);
294965
295018
 
294966
295019
  // packages/cli/src/ui/App.tsx
294967
295020
  init_esbuild_shims();
@@ -297997,7 +298050,7 @@ var QwenDark = new Theme(
297997
298050
  // packages/cli/src/ui/themes/theme-manager.ts
297998
298051
  import * as fs54 from "node:fs";
297999
298052
  import * as path61 from "node:path";
298000
- import * as os22 from "node:os";
298053
+ import * as os23 from "node:os";
298001
298054
 
298002
298055
  // packages/cli/src/ui/themes/ansi.ts
298003
298056
  init_esbuild_shims();
@@ -298639,7 +298692,7 @@ var ThemeManager = class {
298639
298692
  if (this.customThemes.has(canonicalPath)) {
298640
298693
  return this.customThemes.get(canonicalPath);
298641
298694
  }
298642
- const homeDir = path61.resolve(os22.homedir());
298695
+ const homeDir = path61.resolve(os23.homedir());
298643
298696
  if (!canonicalPath.startsWith(homeDir)) {
298644
298697
  console.warn(
298645
298698
  `Theme file at "${themePath}" is outside your home directory. Only load themes from trusted sources.`
@@ -315584,7 +315637,7 @@ var import_react45 = __toESM(require_react(), 1);
315584
315637
  init_core2();
315585
315638
  import { spawnSync as spawnSync3 } from "node:child_process";
315586
315639
  import fs55 from "node:fs";
315587
- import os23 from "node:os";
315640
+ import os24 from "node:os";
315588
315641
  import pathMod from "node:path";
315589
315642
 
315590
315643
  // packages/cli/src/ui/components/shared/vim-buffer-actions.ts
@@ -317429,7 +317482,7 @@ function useTextBuffer({
317429
317482
  const openInExternalEditor = (0, import_react45.useCallback)(
317430
317483
  async (opts = {}) => {
317431
317484
  const editor = opts.editor ?? process.env["VISUAL"] ?? process.env["EDITOR"] ?? (process.platform === "win32" ? "notepad" : "vi");
317432
- const tmpDir = fs55.mkdtempSync(pathMod.join(os23.tmpdir(), "gemini-edit-"));
317485
+ const tmpDir = fs55.mkdtempSync(pathMod.join(os24.tmpdir(), "gemini-edit-"));
317433
317486
  const filePath = pathMod.join(tmpDir, "buffer.txt");
317434
317487
  fs55.writeFileSync(filePath, text, "utf8");
317435
317488
  dispatch({ type: "create_undo_snapshot" });
@@ -322720,7 +322773,7 @@ init_core2();
322720
322773
  var import_strip_json_comments2 = __toESM(require_strip_json_comments(), 1);
322721
322774
  import * as fs71 from "node:fs";
322722
322775
  import * as path73 from "node:path";
322723
- import { homedir as homedir14, platform as platform11 } from "node:os";
322776
+ import { homedir as homedir14, platform as platform12 } from "node:os";
322724
322777
  import process27 from "node:process";
322725
322778
 
322726
322779
  // packages/cli/src/config/settingsSchema.ts
@@ -323961,7 +324014,7 @@ init_esbuild_shims();
323961
324014
  init_core2();
323962
324015
  import * as fs70 from "node:fs";
323963
324016
  import * as path72 from "node:path";
323964
- import * as os25 from "node:os";
324017
+ import * as os26 from "node:os";
323965
324018
 
323966
324019
  // packages/cli/src/utils/errors.ts
323967
324020
  init_esbuild_shims();
@@ -324131,7 +324184,7 @@ import { randomUUID as randomUUID6 } from "node:crypto";
324131
324184
  // packages/cli/src/config/extensions/github.ts
324132
324185
  init_esbuild_shims();
324133
324186
  init_esm10();
324134
- import * as os24 from "node:os";
324187
+ import * as os25 from "node:os";
324135
324188
  import * as https3 from "node:https";
324136
324189
  import * as fs68 from "node:fs";
324137
324190
  import * as path70 from "node:path";
@@ -325539,8 +325592,8 @@ init_esm7();
325539
325592
 
325540
325593
  // node_modules/tar/dist/esm/normalize-windows-path.js
325541
325594
  init_esbuild_shims();
325542
- var platform6 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
325543
- var normalizeWindowsPath = platform6 !== "win32" ? (p) => p : (p) => p && p.replace(/\\/g, "/");
325595
+ var platform7 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
325596
+ var normalizeWindowsPath = platform7 !== "win32" ? (p) => p : (p) => p && p.replace(/\\/g, "/");
325544
325597
 
325545
325598
  // node_modules/tar/dist/esm/read-entry.js
325546
325599
  var ReadEntry = class extends Minipass {
@@ -327815,8 +327868,8 @@ import path68 from "node:path";
327815
327868
  // node_modules/tar/dist/esm/get-write-flag.js
327816
327869
  init_esbuild_shims();
327817
327870
  import fs62 from "fs";
327818
- var platform7 = process.env.__FAKE_PLATFORM__ || process.platform;
327819
- var isWindows4 = platform7 === "win32";
327871
+ var platform8 = process.env.__FAKE_PLATFORM__ || process.platform;
327872
+ var isWindows4 = platform8 === "win32";
327820
327873
  var { O_CREAT, O_TRUNC, O_WRONLY } = fs62.constants;
327821
327874
  var UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || fs62.constants.UV_FS_O_FILEMAP || 0;
327822
327875
  var fMapEnabled = isWindows4 && !!UV_FS_O_FILEMAP;
@@ -328125,8 +328178,8 @@ var normalizeUnicode = /* @__PURE__ */ __name((s2) => {
328125
328178
  }, "normalizeUnicode");
328126
328179
 
328127
328180
  // node_modules/tar/dist/esm/path-reservations.js
328128
- var platform8 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
328129
- var isWindows5 = platform8 === "win32";
328181
+ var platform9 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
328182
+ var isWindows5 = platform9 === "win32";
328130
328183
  var getDirs = /* @__PURE__ */ __name((path110) => {
328131
328184
  const dirs = path110.split("/").slice(0, -1).reduce((set, path111) => {
328132
328185
  const s2 = set[set.length - 1];
@@ -328284,8 +328337,8 @@ var DOCHOWN = Symbol("doChown");
328284
328337
  var UID = Symbol("uid");
328285
328338
  var GID = Symbol("gid");
328286
328339
  var CHECKED_CWD = Symbol("checkedCwd");
328287
- var platform9 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
328288
- var isWindows6 = platform9 === "win32";
328340
+ var platform10 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
328341
+ var isWindows6 = platform10 === "win32";
328289
328342
  var DEFAULT_MAX_DEPTH = 1024;
328290
328343
  var unlinkFile = /* @__PURE__ */ __name((path110, cb) => {
328291
328344
  if (!isWindows6) {
@@ -329421,10 +329474,10 @@ async function downloadFromGitHubRelease(installMetadata, destination) {
329421
329474
  }
329422
329475
  __name(downloadFromGitHubRelease, "downloadFromGitHubRelease");
329423
329476
  function findReleaseAsset(assets) {
329424
- const platform14 = os24.platform();
329425
- const arch3 = os24.arch();
329426
- const platformArchPrefix = `${platform14}.${arch3}.`;
329427
- const platformPrefix = `${platform14}.`;
329477
+ const platform15 = os25.platform();
329478
+ const arch3 = os25.arch();
329479
+ const platformArchPrefix = `${platform15}.${arch3}.`;
329480
+ const platformPrefix = `${platform15}.`;
329428
329481
  const platformArchAsset = assets.find(
329429
329482
  (asset) => asset.name.toLowerCase().startsWith(platformArchPrefix)
329430
329483
  );
@@ -329698,17 +329751,17 @@ var ExtensionStorage = class _ExtensionStorage {
329698
329751
  return path72.join(this.getExtensionDir(), EXTENSIONS_CONFIG_FILENAME);
329699
329752
  }
329700
329753
  static getUserExtensionsDir() {
329701
- const storage = new Storage(os25.homedir());
329754
+ const storage = new Storage(os26.homedir());
329702
329755
  return storage.getExtensionsDir();
329703
329756
  }
329704
329757
  static async createTmpDir() {
329705
329758
  return await fs70.promises.mkdtemp(
329706
- path72.join(os25.tmpdir(), "rdmind-extension")
329759
+ path72.join(os26.tmpdir(), "rdmind-extension")
329707
329760
  );
329708
329761
  }
329709
329762
  };
329710
329763
  function getWorkspaceExtensions(workspaceDir) {
329711
- if (path72.resolve(workspaceDir) === path72.resolve(os25.homedir())) {
329764
+ if (path72.resolve(workspaceDir) === path72.resolve(os26.homedir())) {
329712
329765
  return [];
329713
329766
  }
329714
329767
  return loadExtensionsFromDir(workspaceDir);
@@ -329765,7 +329818,7 @@ function loadExtensions(extensionEnablementManager, workspaceDir = process.cwd()
329765
329818
  }
329766
329819
  __name(loadExtensions, "loadExtensions");
329767
329820
  function loadUserExtensions() {
329768
- const userExtensions = loadExtensionsFromDir(os25.homedir());
329821
+ const userExtensions = loadExtensionsFromDir(os26.homedir());
329769
329822
  const uniqueExtensions = /* @__PURE__ */ new Map();
329770
329823
  for (const extension of userExtensions) {
329771
329824
  if (!uniqueExtensions.has(extension.config.name)) {
@@ -330145,7 +330198,7 @@ function toOutputString(extension, workspaceDir) {
330145
330198
  const manager = new ExtensionEnablementManager(
330146
330199
  ExtensionStorage.getUserExtensionsDir()
330147
330200
  );
330148
- const userEnabled = manager.isEnabled(extension.config.name, os25.homedir());
330201
+ const userEnabled = manager.isEnabled(extension.config.name, os26.homedir());
330149
330202
  const workspaceEnabled = manager.isEnabled(
330150
330203
  extension.config.name,
330151
330204
  workspaceDir
@@ -330210,7 +330263,7 @@ function disableExtension(name3, scope, cwd7 = process.cwd()) {
330210
330263
  ExtensionStorage.getUserExtensionsDir(),
330211
330264
  [name3]
330212
330265
  );
330213
- const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 : os25.homedir();
330266
+ const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 : os26.homedir();
330214
330267
  manager.disable(name3, true, scopePath);
330215
330268
  logExtensionDisable(config, new ExtensionDisableEvent(name3, scope));
330216
330269
  }
@@ -330226,7 +330279,7 @@ function enableExtension(name3, scope, cwd7 = process.cwd()) {
330226
330279
  const manager = new ExtensionEnablementManager(
330227
330280
  ExtensionStorage.getUserExtensionsDir()
330228
330281
  );
330229
- const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 : os25.homedir();
330282
+ const scopePath = scope === "Workspace" /* Workspace */ ? cwd7 : os26.homedir();
330230
330283
  manager.enable(name3, true, scopePath);
330231
330284
  const config = getTelemetryConfig(cwd7);
330232
330285
  logExtensionEnable(config, new ExtensionEnableEvent(name3, scope));
@@ -330334,9 +330387,9 @@ function getSystemSettingsPath() {
330334
330387
  if (process27.env["RDMIND_SYSTEM_SETTINGS_PATH"]) {
330335
330388
  return process27.env["RDMIND_SYSTEM_SETTINGS_PATH"];
330336
330389
  }
330337
- if (platform11() === "darwin") {
330390
+ if (platform12() === "darwin") {
330338
330391
  return "/Library/Application Support/RDMind/settings.json";
330339
- } else if (platform11() === "win32") {
330392
+ } else if (platform12() === "win32") {
330340
330393
  return "C:\\ProgramData\\rdmind\\settings.json";
330341
330394
  } else {
330342
330395
  return "/etc/rdmind/settings.json";
@@ -332757,7 +332810,8 @@ var EDITOR_DISPLAY_NAMES = {
332757
332810
  vscode: "VS Code",
332758
332811
  vscodium: "VSCodium",
332759
332812
  windsurf: "Windsurf",
332760
- zed: "Zed"
332813
+ zed: "Zed",
332814
+ trae: "Trae"
332761
332815
  };
332762
332816
  var EditorSettingsManager = class {
332763
332817
  static {
@@ -342712,7 +342766,7 @@ import { homedir as homedir16 } from "node:os";
342712
342766
 
342713
342767
  // packages/cli/src/utils/resolvePath.ts
342714
342768
  init_esbuild_shims();
342715
- import * as os26 from "node:os";
342769
+ import * as os27 from "node:os";
342716
342770
  import * as path77 from "node:path";
342717
342771
  function resolvePath2(p) {
342718
342772
  if (!p) {
@@ -342720,9 +342774,9 @@ function resolvePath2(p) {
342720
342774
  }
342721
342775
  let expandedPath = p;
342722
342776
  if (p.toLowerCase().startsWith("%userprofile%")) {
342723
- expandedPath = os26.homedir() + p.substring("%userprofile%".length);
342777
+ expandedPath = os27.homedir() + p.substring("%userprofile%".length);
342724
342778
  } else if (p === "~" || p.startsWith("~/")) {
342725
- expandedPath = os26.homedir() + p.substring(1);
342779
+ expandedPath = os27.homedir() + p.substring(1);
342726
342780
  }
342727
342781
  return path77.normalize(expandedPath);
342728
342782
  }
@@ -342962,7 +343016,7 @@ __name(getPackageJson, "getPackageJson");
342962
343016
  // packages/cli/src/utils/version.ts
342963
343017
  async function getCliVersion() {
342964
343018
  const pkgJson = await getPackageJson();
342965
- return "0.0.26";
343019
+ return "0.0.27";
342966
343020
  }
342967
343021
  __name(getCliVersion, "getCliVersion");
342968
343022
 
@@ -342970,7 +343024,7 @@ __name(getCliVersion, "getCliVersion");
342970
343024
  init_esbuild_shims();
342971
343025
  init_core2();
342972
343026
  var import_command_exists = __toESM(require_command_exists2(), 1);
342973
- import * as os27 from "node:os";
343027
+ import * as os28 from "node:os";
342974
343028
  var VALID_SANDBOX_COMMANDS = [
342975
343029
  "docker",
342976
343030
  "podman",
@@ -343006,7 +343060,7 @@ function getSandboxCommand(sandbox) {
343006
343060
  `Missing sandbox command '${sandbox}' (from GEMINI_SANDBOX)`
343007
343061
  );
343008
343062
  }
343009
- if (os27.platform() === "darwin" && import_command_exists.default.sync("sandbox-exec")) {
343063
+ if (os28.platform() === "darwin" && import_command_exists.default.sync("sandbox-exec")) {
343010
343064
  return "sandbox-exec";
343011
343065
  } else if (import_command_exists.default.sync("docker") && sandbox === true) {
343012
343066
  return "docker";
@@ -344006,7 +344060,7 @@ function mergeExcludeTools(settings, extensions, extraExcludes) {
344006
344060
  __name(mergeExcludeTools, "mergeExcludeTools");
344007
344061
 
344008
344062
  // packages/cli/src/ui/AppContainer.tsx
344009
- import process49 from "node:process";
344063
+ import process50 from "node:process";
344010
344064
 
344011
344065
  // packages/cli/src/ui/hooks/useMemoryMonitor.ts
344012
344066
  init_esbuild_shims();
@@ -344989,13 +345043,13 @@ init_esbuild_shims();
344989
345043
  // packages/cli/src/utils/systemInfo.ts
344990
345044
  init_esbuild_shims();
344991
345045
  import process35 from "node:process";
344992
- import os28 from "node:os";
345046
+ import os29 from "node:os";
344993
345047
  import { execSync as execSync4 } from "node:child_process";
344994
345048
  init_core2();
344995
345049
 
344996
345050
  // packages/cli/src/generated/git-commit.ts
344997
345051
  init_esbuild_shims();
344998
- var GIT_COMMIT_INFO2 = "f5a2ea25";
345052
+ var GIT_COMMIT_INFO2 = "7f84e4ce";
344999
345053
 
345000
345054
  // packages/cli/src/utils/systemInfo.ts
345001
345055
  async function getNpmVersion() {
@@ -345036,7 +345090,7 @@ __name(getSandboxEnv, "getSandboxEnv");
345036
345090
  async function getSystemInfo(context2) {
345037
345091
  const osPlatform = process35.platform;
345038
345092
  const osArch = process35.arch;
345039
- const osRelease = os28.release();
345093
+ const osRelease = os29.release();
345040
345094
  const nodeVersion2 = process35.version;
345041
345095
  const npmVersion = await getNpmVersion();
345042
345096
  const sandboxEnv = getSandboxEnv();
@@ -346270,7 +346324,7 @@ ${docsUrl}`
346270
346324
  // packages/cli/src/ui/commands/directoryCommand.tsx
346271
346325
  init_esbuild_shims();
346272
346326
  init_core2();
346273
- import * as os29 from "node:os";
346327
+ import * as os30 from "node:os";
346274
346328
  import * as path85 from "node:path";
346275
346329
  import * as fs77 from "node:fs/promises";
346276
346330
  function expandHomeDir(p) {
@@ -346279,9 +346333,9 @@ function expandHomeDir(p) {
346279
346333
  }
346280
346334
  let expandedPath = p;
346281
346335
  if (p.toLowerCase().startsWith("%userprofile%")) {
346282
- expandedPath = os29.homedir() + p.substring("%userprofile%".length);
346336
+ expandedPath = os30.homedir() + p.substring("%userprofile%".length);
346283
346337
  } else if (p === "~" || p.startsWith("~/")) {
346284
- expandedPath = os29.homedir() + p.substring(1);
346338
+ expandedPath = os30.homedir() + p.substring(1);
346285
346339
  }
346286
346340
  return path85.normalize(expandedPath);
346287
346341
  }
@@ -346542,7 +346596,7 @@ async function resolveCompletionPaths(partialPath, baseDir) {
346542
346596
  resolvedPath = baseDir;
346543
346597
  displayPrefix = "";
346544
346598
  } else if (partialPath.startsWith("~")) {
346545
- resolvedPath = path85.join(os29.homedir(), partialPath.slice(1));
346599
+ resolvedPath = path85.join(os30.homedir(), partialPath.slice(1));
346546
346600
  } else {
346547
346601
  resolvedPath = path85.isAbsolute(partialPath) ? path85.resolve(partialPath || "/") : path85.resolve(baseDir, partialPath || ".");
346548
346602
  }
@@ -348104,7 +348158,7 @@ var mcpCommand2 = {
348104
348158
  init_esbuild_shims();
348105
348159
  init_core2();
348106
348160
  import path88 from "node:path";
348107
- import os30 from "os";
348161
+ import os31 from "os";
348108
348162
  import fs79 from "fs/promises";
348109
348163
  var memoryCommand = {
348110
348164
  name: "memory",
@@ -348173,7 +348227,7 @@ ${memoryContent}
348173
348227
  action: /* @__PURE__ */ __name(async (context2) => {
348174
348228
  try {
348175
348229
  const globalMemoryPath = path88.join(
348176
- os30.homedir(),
348230
+ os31.homedir(),
348177
348231
  QWEN_DIR5,
348178
348232
  "RDMind.md"
348179
348233
  );
@@ -349975,7 +350029,7 @@ init_esbuild_shims();
349975
350029
  // packages/cli/src/ui/utils/terminalSetup.ts
349976
350030
  init_esbuild_shims();
349977
350031
  import { promises as fs82 } from "node:fs";
349978
- import * as os31 from "node:os";
350032
+ import * as os32 from "node:os";
349979
350033
  import * as path92 from "node:path";
349980
350034
  import { exec as exec3 } from "node:child_process";
349981
350035
  import { promisify as promisify7 } from "node:util";
@@ -350076,10 +350130,13 @@ async function detectTerminal() {
350076
350130
  if (process.env["VSCODE_GIT_ASKPASS_MAIN"]?.toLowerCase().includes("windsurf")) {
350077
350131
  return "windsurf";
350078
350132
  }
350133
+ if (process.env["TERM_PRODUCT"]?.toLowerCase().includes("trae")) {
350134
+ return "trae";
350135
+ }
350079
350136
  if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
350080
350137
  return "vscode";
350081
350138
  }
350082
- if (os31.platform() !== "win32") {
350139
+ if (os32.platform() !== "win32") {
350083
350140
  try {
350084
350141
  const { stdout } = await execAsync2("ps -o comm= -p $PPID");
350085
350142
  const parentName = stdout.trim();
@@ -350089,6 +350146,8 @@ async function detectTerminal() {
350089
350146
  return "cursor";
350090
350147
  if (parentName.includes("code") || parentName.includes("Code"))
350091
350148
  return "vscode";
350149
+ if (parentName.includes("trae") || parentName.includes("Trae"))
350150
+ return "trae";
350092
350151
  } catch (error) {
350093
350152
  console.debug("Parent process detection failed:", error);
350094
350153
  }
@@ -350107,22 +350166,22 @@ async function backupFile(filePath) {
350107
350166
  }
350108
350167
  __name(backupFile, "backupFile");
350109
350168
  function getVSCodeStyleConfigDir(appName) {
350110
- const platform14 = os31.platform();
350111
- if (platform14 === "darwin") {
350169
+ const platform15 = os32.platform();
350170
+ if (platform15 === "darwin") {
350112
350171
  return path92.join(
350113
- os31.homedir(),
350172
+ os32.homedir(),
350114
350173
  "Library",
350115
350174
  "Application Support",
350116
350175
  appName,
350117
350176
  "User"
350118
350177
  );
350119
- } else if (platform14 === "win32") {
350178
+ } else if (platform15 === "win32") {
350120
350179
  if (!process.env["APPDATA"]) {
350121
350180
  return null;
350122
350181
  }
350123
350182
  return path92.join(process.env["APPDATA"], appName, "User");
350124
350183
  } else {
350125
- return path92.join(os31.homedir(), ".config", appName, "User");
350184
+ return path92.join(os32.homedir(), ".config", appName, "User");
350126
350185
  }
350127
350186
  }
350128
350187
  __name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
@@ -350244,6 +350303,10 @@ async function configureWindsurf() {
350244
350303
  return configureVSCodeStyle("Windsurf", "Windsurf");
350245
350304
  }
350246
350305
  __name(configureWindsurf, "configureWindsurf");
350306
+ async function configureTrae() {
350307
+ return configureVSCodeStyle("Trae", "Trae");
350308
+ }
350309
+ __name(configureTrae, "configureTrae");
350247
350310
  async function terminalSetup() {
350248
350311
  if (isKittyProtocolEnabled()) {
350249
350312
  return {
@@ -350265,6 +350328,8 @@ async function terminalSetup() {
350265
350328
  return configureCursor();
350266
350329
  case "windsurf":
350267
350330
  return configureWindsurf();
350331
+ case "trae":
350332
+ return configureTrae();
350268
350333
  default:
350269
350334
  return {
350270
350335
  success: false,
@@ -351797,7 +351862,7 @@ var import_react113 = __toESM(require_react(), 1);
351797
351862
  init_core2();
351798
351863
  import crypto17 from "node:crypto";
351799
351864
  import path94 from "node:path";
351800
- import os32 from "node:os";
351865
+ import os33 from "node:os";
351801
351866
  import fs84 from "node:fs";
351802
351867
  var OUTPUT_UPDATE_INTERVAL_MS2 = 1e3;
351803
351868
  var MAX_OUTPUT_LENGTH = 1e4;
@@ -351834,14 +351899,14 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
351834
351899
  { type: "user_shell", text: rawQuery },
351835
351900
  userMessageTimestamp
351836
351901
  );
351837
- const isWindows8 = os32.platform() === "win32";
351902
+ const isWindows8 = os33.platform() === "win32";
351838
351903
  const targetDir = config.getTargetDir();
351839
351904
  let commandToExecute = rawQuery;
351840
351905
  let pwdFilePath;
351841
351906
  if (!isWindows8) {
351842
351907
  let command2 = rawQuery.trim();
351843
351908
  const pwdFileName = `shell_pwd_${crypto17.randomBytes(6).toString("hex")}.tmp`;
351844
- pwdFilePath = path94.join(os32.tmpdir(), pwdFileName);
351909
+ pwdFilePath = path94.join(os33.tmpdir(), pwdFileName);
351845
351910
  if (!command2.endsWith(";") && !command2.endsWith("&")) {
351846
351911
  command2 += ";";
351847
351912
  }
@@ -354747,13 +354812,13 @@ import { format as format3 } from "node:util";
354747
354812
  init_esbuild_shims();
354748
354813
  var import_graceful_fs = __toESM(require_graceful_fs(), 1);
354749
354814
  import path100 from "node:path";
354750
- import os35 from "node:os";
354815
+ import os36 from "node:os";
354751
354816
 
354752
354817
  // node_modules/xdg-basedir/index.js
354753
354818
  init_esbuild_shims();
354754
- import os33 from "os";
354819
+ import os34 from "os";
354755
354820
  import path97 from "path";
354756
- var homeDirectory = os33.homedir();
354821
+ var homeDirectory = os34.homedir();
354757
354822
  var { env: env5 } = process;
354758
354823
  var xdgData = env5.XDG_DATA_HOME || (homeDirectory ? path97.join(homeDirectory, ".local", "share") : void 0);
354759
354824
  var xdgConfig = env5.XDG_CONFIG_HOME || (homeDirectory ? path97.join(homeDirectory, ".config") : void 0);
@@ -354988,14 +355053,14 @@ var dist_default6 = FS;
354988
355053
 
354989
355054
  // node_modules/atomically/dist/constants.js
354990
355055
  init_esbuild_shims();
354991
- import os34 from "node:os";
355056
+ import os35 from "node:os";
354992
355057
  import process40 from "node:process";
354993
355058
  var DEFAULT_ENCODING2 = "utf8";
354994
355059
  var DEFAULT_FILE_MODE = 438;
354995
355060
  var DEFAULT_FOLDER_MODE = 511;
354996
355061
  var DEFAULT_WRITE_OPTIONS = {};
354997
- var DEFAULT_USER_UID = os34.userInfo().uid;
354998
- var DEFAULT_USER_GID = os34.userInfo().gid;
355062
+ var DEFAULT_USER_UID = os35.userInfo().uid;
355063
+ var DEFAULT_USER_GID = os35.userInfo().gid;
354999
355064
  var DEFAULT_TIMEOUT_SYNC = 1e3;
355000
355065
  var IS_POSIX = !!process40.getuid;
355001
355066
  var IS_USER_ROOT2 = process40.getuid ? !process40.getuid() : false;
@@ -355448,7 +355513,7 @@ __name(hasProperty, "hasProperty");
355448
355513
  // node_modules/configstore/index.js
355449
355514
  function getConfigDirectory(id, globalConfigPath) {
355450
355515
  const pathPrefix = globalConfigPath ? path100.join(id, "config.json") : path100.join("configstore", `${id}.json`);
355451
- const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os35.tmpdir()) + path100.sep);
355516
+ const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os36.tmpdir()) + path100.sep);
355452
355517
  return path100.join(configDirectory, pathPrefix);
355453
355518
  }
355454
355519
  __name(getConfigDirectory, "getConfigDirectory");
@@ -355727,7 +355792,7 @@ var ansi_styles_default6 = ansiStyles6;
355727
355792
  // node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
355728
355793
  init_esbuild_shims();
355729
355794
  import process43 from "node:process";
355730
- import os36 from "node:os";
355795
+ import os37 from "node:os";
355731
355796
  import tty2 from "node:tty";
355732
355797
  function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process43.argv) {
355733
355798
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -355795,7 +355860,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
355795
355860
  return min;
355796
355861
  }
355797
355862
  if (process43.platform === "win32") {
355798
- const osRelease = os36.release().split(".");
355863
+ const osRelease = os37.release().split(".");
355799
355864
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
355800
355865
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
355801
355866
  }
@@ -356792,7 +356857,7 @@ init_esbuild_shims();
356792
356857
  var import_ini2 = __toESM(require_ini3(), 1);
356793
356858
  import process45 from "node:process";
356794
356859
  import path101 from "node:path";
356795
- import os37 from "node:os";
356860
+ import os38 from "node:os";
356796
356861
  import fs89 from "node:fs";
356797
356862
  var isWindows7 = process45.platform === "win32";
356798
356863
  var readRc = /* @__PURE__ */ __name((filePath) => {
@@ -356827,7 +356892,7 @@ var getNpmPrefix = /* @__PURE__ */ __name(() => {
356827
356892
  if (envPrefix) {
356828
356893
  return envPrefix;
356829
356894
  }
356830
- const homePrefix = readRc(path101.join(os37.homedir(), ".npmrc"));
356895
+ const homePrefix = readRc(path101.join(os38.homedir(), ".npmrc"));
356831
356896
  if (homePrefix) {
356832
356897
  return homePrefix;
356833
356898
  }
@@ -356858,11 +356923,11 @@ var getYarnPrefix = /* @__PURE__ */ __name(() => {
356858
356923
  if (windowsPrefix) {
356859
356924
  return windowsPrefix;
356860
356925
  }
356861
- const configPrefix = path101.join(os37.homedir(), ".config/yarn");
356926
+ const configPrefix = path101.join(os38.homedir(), ".config/yarn");
356862
356927
  if (fs89.existsSync(configPrefix)) {
356863
356928
  return configPrefix;
356864
356929
  }
356865
- const homePrefix = path101.join(os37.homedir(), ".yarn-config");
356930
+ const homePrefix = path101.join(os38.homedir(), ".yarn-config");
356866
356931
  if (fs89.existsSync(homePrefix)) {
356867
356932
  return homePrefix;
356868
356933
  }
@@ -358358,6 +358423,63 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
358358
358423
  };
358359
358424
  }, "useAgentsManagerDialog");
358360
358425
 
358426
+ // packages/cli/src/ui/hooks/useAttentionNotifications.ts
358427
+ init_esbuild_shims();
358428
+ var import_react134 = __toESM(require_react(), 1);
358429
+
358430
+ // packages/cli/src/utils/attentionNotification.ts
358431
+ init_esbuild_shims();
358432
+ import process49 from "node:process";
358433
+ var TERMINAL_BELL = "\x07";
358434
+ function notifyTerminalAttention(_reason, options2 = {}) {
358435
+ const stream2 = options2.stream ?? process49.stdout;
358436
+ if (!stream2?.write || stream2.isTTY === false) {
358437
+ return false;
358438
+ }
358439
+ try {
358440
+ stream2.write(TERMINAL_BELL);
358441
+ return true;
358442
+ } catch (error) {
358443
+ console.warn("Failed to send terminal bell:", error);
358444
+ return false;
358445
+ }
358446
+ }
358447
+ __name(notifyTerminalAttention, "notifyTerminalAttention");
358448
+
358449
+ // packages/cli/src/ui/hooks/useAttentionNotifications.ts
358450
+ var LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS = 20;
358451
+ var useAttentionNotifications = /* @__PURE__ */ __name(({
358452
+ isFocused,
358453
+ streamingState,
358454
+ elapsedTime
358455
+ }) => {
358456
+ const awaitingNotificationSentRef = (0, import_react134.useRef)(false);
358457
+ const respondingElapsedRef = (0, import_react134.useRef)(0);
358458
+ (0, import_react134.useEffect)(() => {
358459
+ if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
358460
+ notifyTerminalAttention("tool_approval" /* ToolApproval */);
358461
+ awaitingNotificationSentRef.current = true;
358462
+ }
358463
+ if (streamingState !== "waiting_for_confirmation" /* WaitingForConfirmation */ || isFocused) {
358464
+ awaitingNotificationSentRef.current = false;
358465
+ }
358466
+ }, [isFocused, streamingState]);
358467
+ (0, import_react134.useEffect)(() => {
358468
+ if (streamingState === "responding" /* Responding */) {
358469
+ respondingElapsedRef.current = elapsedTime;
358470
+ return;
358471
+ }
358472
+ if (streamingState === "idle" /* Idle */) {
358473
+ const wasLongTask = respondingElapsedRef.current >= LONG_TASK_NOTIFICATION_THRESHOLD_SECONDS;
358474
+ if (wasLongTask && !isFocused) {
358475
+ notifyTerminalAttention("long_task_complete" /* LongTaskComplete */);
358476
+ }
358477
+ respondingElapsedRef.current = 0;
358478
+ return;
358479
+ }
358480
+ }, [streamingState, elapsedTime, isFocused]);
358481
+ }, "useAttentionNotifications");
358482
+
358361
358483
  // packages/cli/src/ui/AppContainer.tsx
358362
358484
  var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
358363
358485
  var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
@@ -358378,22 +358500,22 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358378
358500
  const { settings, config, initializationResult } = props;
358379
358501
  const historyManager = useHistory();
358380
358502
  useMemoryMonitor(historyManager);
358381
- const [corgiMode, setCorgiMode] = (0, import_react134.useState)(false);
358382
- const [debugMessage, setDebugMessage] = (0, import_react134.useState)("");
358383
- const [quittingMessages, setQuittingMessages] = (0, import_react134.useState)(null);
358384
- const [themeError, setThemeError] = (0, import_react134.useState)(
358503
+ const [corgiMode, setCorgiMode] = (0, import_react135.useState)(false);
358504
+ const [debugMessage, setDebugMessage] = (0, import_react135.useState)("");
358505
+ const [quittingMessages, setQuittingMessages] = (0, import_react135.useState)(null);
358506
+ const [themeError, setThemeError] = (0, import_react135.useState)(
358385
358507
  initializationResult.themeError
358386
358508
  );
358387
- const [isProcessing, setIsProcessing] = (0, import_react134.useState)(false);
358388
- const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react134.useState)(false);
358389
- const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react134.useState)(
358509
+ const [isProcessing, setIsProcessing] = (0, import_react135.useState)(false);
358510
+ const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react135.useState)(false);
358511
+ const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react135.useState)(
358390
358512
  initializationResult.geminiMdFileCount
358391
358513
  );
358392
- const [shellModeActive, setShellModeActive] = (0, import_react134.useState)(false);
358393
- const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react134.useState)(false);
358394
- const [historyRemountKey, setHistoryRemountKey] = (0, import_react134.useState)(0);
358395
- const [updateInfo, setUpdateInfo] = (0, import_react134.useState)(null);
358396
- const [isTrustedFolder, setIsTrustedFolder] = (0, import_react134.useState)(
358514
+ const [shellModeActive, setShellModeActive] = (0, import_react135.useState)(false);
358515
+ const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react135.useState)(false);
358516
+ const [historyRemountKey, setHistoryRemountKey] = (0, import_react135.useState)(0);
358517
+ const [updateInfo, setUpdateInfo] = (0, import_react135.useState)(null);
358518
+ const [isTrustedFolder, setIsTrustedFolder] = (0, import_react135.useState)(
358397
358519
  config.isTrustedFolder()
358398
358520
  );
358399
358521
  const extensions = config.getExtensions();
@@ -358408,38 +358530,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358408
358530
  historyManager.addItem,
358409
358531
  config.getWorkingDir()
358410
358532
  );
358411
- const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react134.useState)(false);
358412
- const openPermissionsDialog = (0, import_react134.useCallback)(
358533
+ const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react135.useState)(false);
358534
+ const openPermissionsDialog = (0, import_react135.useCallback)(
358413
358535
  () => setPermissionsDialogOpen(true),
358414
358536
  []
358415
358537
  );
358416
- const closePermissionsDialog = (0, import_react134.useCallback)(
358538
+ const closePermissionsDialog = (0, import_react135.useCallback)(
358417
358539
  () => setPermissionsDialogOpen(false),
358418
358540
  []
358419
358541
  );
358420
- const getEffectiveModel2 = (0, import_react134.useCallback)(() => {
358542
+ const getEffectiveModel2 = (0, import_react135.useCallback)(() => {
358421
358543
  if (config.isInFallbackMode()) {
358422
358544
  return DEFAULT_GEMINI_FLASH_MODEL;
358423
358545
  }
358424
358546
  return config.getModel();
358425
358547
  }, [config]);
358426
- const [currentModel, setCurrentModel] = (0, import_react134.useState)(getEffectiveModel2());
358427
- const [userTier] = (0, import_react134.useState)(void 0);
358428
- const [isConfigInitialized, setConfigInitialized] = (0, import_react134.useState)(false);
358548
+ const [currentModel, setCurrentModel] = (0, import_react135.useState)(getEffectiveModel2());
358549
+ const [userTier] = (0, import_react135.useState)(void 0);
358550
+ const [isConfigInitialized, setConfigInitialized] = (0, import_react135.useState)(false);
358429
358551
  const logger6 = useLogger(config.storage);
358430
- const [userMessages, setUserMessages] = (0, import_react134.useState)([]);
358552
+ const [userMessages, setUserMessages] = (0, import_react135.useState)([]);
358431
358553
  const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
358432
358554
  const { stdin, setRawMode } = use_stdin_default();
358433
358555
  const { stdout } = use_stdout_default();
358434
358556
  const { stats: sessionStats } = useSessionStats();
358435
358557
  const branchName = useGitBranchName(config.getTargetDir());
358436
- const mainControlsRef = (0, import_react134.useRef)(null);
358437
- const originalTitleRef = (0, import_react134.useRef)(
358558
+ const mainControlsRef = (0, import_react135.useRef)(null);
358559
+ const originalTitleRef = (0, import_react135.useRef)(
358438
358560
  computeWindowTitle(basename15(config.getTargetDir()))
358439
358561
  );
358440
- const lastTitleRef = (0, import_react134.useRef)(null);
358562
+ const lastTitleRef = (0, import_react135.useRef)(null);
358441
358563
  const staticExtraHeight = 3;
358442
- (0, import_react134.useEffect)(() => {
358564
+ (0, import_react135.useEffect)(() => {
358443
358565
  (async () => {
358444
358566
  await config.initialize();
358445
358567
  setConfigInitialized(true);
@@ -358449,11 +358571,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358449
358571
  await ideClient.disconnect();
358450
358572
  });
358451
358573
  }, [config]);
358452
- (0, import_react134.useEffect)(
358574
+ (0, import_react135.useEffect)(
358453
358575
  () => setUpdateHandler(historyManager.addItem, setUpdateInfo),
358454
358576
  [historyManager.addItem]
358455
358577
  );
358456
- (0, import_react134.useEffect)(() => {
358578
+ (0, import_react135.useEffect)(() => {
358457
358579
  const checkModelChange = /* @__PURE__ */ __name(() => {
358458
358580
  const effectiveModel = getEffectiveModel2();
358459
358581
  if (effectiveModel !== currentModel) {
@@ -358469,7 +358591,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358469
358591
  handleNewMessage,
358470
358592
  clearConsoleMessages: clearConsoleMessagesState
358471
358593
  } = useConsoleMessages();
358472
- (0, import_react134.useEffect)(() => {
358594
+ (0, import_react135.useEffect)(() => {
358473
358595
  const consolePatcher = new ConsolePatcher({
358474
358596
  onNewMessage: handleNewMessage,
358475
358597
  debugMode: config.getDebugMode()
@@ -358477,13 +358599,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358477
358599
  consolePatcher.patch();
358478
358600
  registerCleanup(consolePatcher.cleanup);
358479
358601
  }, [handleNewMessage, config]);
358480
- const { inputWidth, suggestionsWidth } = (0, import_react134.useMemo)(() => {
358602
+ const { inputWidth, suggestionsWidth } = (0, import_react135.useMemo)(() => {
358481
358603
  const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
358482
358604
  return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
358483
358605
  }, [terminalWidth]);
358484
358606
  const mainAreaWidth = Math.floor(terminalWidth * 0.9);
358485
358607
  const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
358486
- const isValidPath = (0, import_react134.useCallback)((filePath) => {
358608
+ const isValidPath = (0, import_react135.useCallback)((filePath) => {
358487
358609
  try {
358488
358610
  return fs93.existsSync(filePath) && fs93.statSync(filePath).isFile();
358489
358611
  } catch (_e) {
@@ -358498,7 +358620,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358498
358620
  isValidPath,
358499
358621
  shellModeActive
358500
358622
  });
358501
- (0, import_react134.useEffect)(() => {
358623
+ (0, import_react135.useEffect)(() => {
358502
358624
  const fetchUserMessages = /* @__PURE__ */ __name(async () => {
358503
358625
  const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
358504
358626
  const currentSessionUserMessages = historyManager.history.filter(
@@ -358521,7 +358643,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358521
358643
  }, "fetchUserMessages");
358522
358644
  fetchUserMessages();
358523
358645
  }, [historyManager.history, logger6]);
358524
- const refreshStatic = (0, import_react134.useCallback)(() => {
358646
+ const refreshStatic = (0, import_react135.useCallback)(() => {
358525
358647
  stdout.write(base_exports.clearTerminal);
358526
358648
  setHistoryRemountKey((prev) => prev + 1);
358527
358649
  }, [setHistoryRemountKey, stdout]);
@@ -358565,17 +358687,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358565
358687
  setAuthState,
358566
358688
  setModelSwitchedFromQuotaError
358567
358689
  });
358568
- const handleQwenAuthTimeout = (0, import_react134.useCallback)(() => {
358690
+ const handleQwenAuthTimeout = (0, import_react135.useCallback)(() => {
358569
358691
  onAuthError("Qwen OAuth authentication timed out. Please try again.");
358570
358692
  cancelQwenAuth();
358571
358693
  setAuthState("updating" /* Updating */);
358572
358694
  }, [onAuthError, cancelQwenAuth, setAuthState]);
358573
- const handleQwenAuthCancel = (0, import_react134.useCallback)(() => {
358695
+ const handleQwenAuthCancel = (0, import_react135.useCallback)(() => {
358574
358696
  onAuthError("Qwen OAuth authentication cancelled.");
358575
358697
  cancelQwenAuth();
358576
358698
  setAuthState("updating" /* Updating */);
358577
358699
  }, [onAuthError, cancelQwenAuth, setAuthState]);
358578
- (0, import_react134.useEffect)(() => {
358700
+ (0, import_react135.useEffect)(() => {
358579
358701
  if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
358580
358702
  onAuthError(
358581
358703
  `Authentication is enforced to be ${settings.merged.security?.auth.enforcedType}, but you are currently using ${settings.merged.security?.auth.selectedType}.`
@@ -358594,7 +358716,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358594
358716
  settings.merged.security?.auth?.useExternal,
358595
358717
  onAuthError
358596
358718
  ]);
358597
- const [editorError, setEditorError] = (0, import_react134.useState)(null);
358719
+ const [editorError, setEditorError] = (0, import_react135.useState)(null);
358598
358720
  const {
358599
358721
  isEditorDialogOpen,
358600
358722
  openEditorDialog,
@@ -358621,9 +358743,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358621
358743
  openAgentsManagerDialog,
358622
358744
  closeAgentsManagerDialog
358623
358745
  } = useAgentsManagerDialog();
358624
- const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0, import_react134.useState)(false);
358625
- const [visionSwitchResolver, setVisionSwitchResolver] = (0, import_react134.useState)(null);
358626
- const slashCommandActions = (0, import_react134.useMemo)(
358746
+ const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0, import_react135.useState)(false);
358747
+ const [visionSwitchResolver, setVisionSwitchResolver] = (0, import_react135.useState)(null);
358748
+ const slashCommandActions = (0, import_react135.useMemo)(
358627
358749
  () => ({
358628
358750
  openAuthDialog,
358629
358751
  openThemeDialog,
@@ -358636,7 +358758,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358636
358758
  setQuittingMessages(messages);
358637
358759
  setTimeout(async () => {
358638
358760
  await runExitCleanup();
358639
- process49.exit(0);
358761
+ process50.exit(0);
358640
358762
  }, 100);
358641
358763
  }, "quit"),
358642
358764
  setDebugMessage,
@@ -358686,14 +358808,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358686
358808
  extensionsUpdateStateInternal,
358687
358809
  isConfigInitialized
358688
358810
  );
358689
- const handleVisionSwitchRequired = (0, import_react134.useCallback)(
358811
+ const handleVisionSwitchRequired = (0, import_react135.useCallback)(
358690
358812
  async (_query) => new Promise((resolve26, reject) => {
358691
358813
  setVisionSwitchResolver({ resolve: resolve26, reject });
358692
358814
  setIsVisionSwitchDialogOpen(true);
358693
358815
  }),
358694
358816
  []
358695
358817
  );
358696
- const handleVisionSwitchSelect = (0, import_react134.useCallback)(
358818
+ const handleVisionSwitchSelect = (0, import_react135.useCallback)(
358697
358819
  (outcome) => {
358698
358820
  setIsVisionSwitchDialogOpen(false);
358699
358821
  if (visionSwitchResolver) {
@@ -358704,10 +358826,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358704
358826
  },
358705
358827
  [visionSwitchResolver]
358706
358828
  );
358707
- const onDebugMessage = (0, import_react134.useCallback)((message) => {
358829
+ const onDebugMessage = (0, import_react135.useCallback)((message) => {
358708
358830
  console.debug(message);
358709
358831
  }, []);
358710
- const performMemoryRefresh = (0, import_react134.useCallback)(async () => {
358832
+ const performMemoryRefresh = (0, import_react135.useCallback)(async () => {
358711
358833
  historyManager.addItem(
358712
358834
  {
358713
358835
  type: "info" /* INFO */,
@@ -358717,7 +358839,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358717
358839
  );
358718
358840
  try {
358719
358841
  const { memoryContent, fileCount } = await loadHierarchicalGeminiMemory(
358720
- process49.cwd(),
358842
+ process50.cwd(),
358721
358843
  settings.merged.context?.loadMemoryFromIncludeDirectories ? config.getWorkspaceContext().getDirectories() : [],
358722
358844
  config.getDebugMode(),
358723
358845
  config.getFileService(),
@@ -358758,7 +358880,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358758
358880
  console.error("Error refreshing memory:", error);
358759
358881
  }
358760
358882
  }, [config, historyManager, settings.merged]);
358761
- const cancelHandlerRef = (0, import_react134.useRef)(() => {
358883
+ const cancelHandlerRef = (0, import_react135.useRef)(() => {
358762
358884
  });
358763
358885
  const {
358764
358886
  streamingState,
@@ -358805,7 +358927,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358805
358927
  streamingState,
358806
358928
  submitQuery
358807
358929
  });
358808
- const handleFinalSubmit = (0, import_react134.useCallback)(
358930
+ const handleFinalSubmit = (0, import_react135.useCallback)(
358809
358931
  (submittedValue) => {
358810
358932
  addMessage(submittedValue);
358811
358933
  },
@@ -358818,7 +358940,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
358818
358940
  handleWelcomeBackSelection,
358819
358941
  handleWelcomeBackClose
358820
358942
  } = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
358821
- cancelHandlerRef.current = (0, import_react134.useCallback)(() => {
358943
+ cancelHandlerRef.current = (0, import_react135.useCallback)(() => {
358822
358944
  const pendingHistoryItems2 = [
358823
358945
  ...pendingSlashCommandHistoryItems,
358824
358946
  ...pendingGeminiHistoryItems
@@ -358847,7 +358969,7 @@ ${queuedText}` : queuedText;
358847
358969
  pendingSlashCommandHistoryItems,
358848
358970
  pendingGeminiHistoryItems
358849
358971
  ]);
358850
- const handleClearScreen = (0, import_react134.useCallback)(() => {
358972
+ const handleClearScreen = (0, import_react135.useCallback)(() => {
358851
358973
  historyManager.clearItems();
358852
358974
  clearConsoleMessagesState();
358853
358975
  console.clear();
@@ -358855,8 +358977,8 @@ ${queuedText}` : queuedText;
358855
358977
  }, [historyManager, clearConsoleMessagesState, refreshStatic]);
358856
358978
  const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
358857
358979
  const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
358858
- const [controlsHeight, setControlsHeight] = (0, import_react134.useState)(0);
358859
- (0, import_react134.useLayoutEffect)(() => {
358980
+ const [controlsHeight, setControlsHeight] = (0, import_react135.useState)(0);
358981
+ (0, import_react135.useLayoutEffect)(() => {
358860
358982
  if (mainControlsRef.current) {
358861
358983
  const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
358862
358984
  if (fullFooterMeasurement.height > 0) {
@@ -358879,14 +359001,14 @@ ${queuedText}` : queuedText;
358879
359001
  });
358880
359002
  const isFocused = useFocus();
358881
359003
  useBracketedPaste();
358882
- const contextFileNames = (0, import_react134.useMemo)(() => {
359004
+ const contextFileNames = (0, import_react135.useMemo)(() => {
358883
359005
  const fromSettings = settings.merged.context?.fileName;
358884
359006
  return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
358885
359007
  }, [settings.merged.context?.fileName]);
358886
- const initialPrompt = (0, import_react134.useMemo)(() => config.getQuestion(), [config]);
358887
- const initialPromptSubmitted = (0, import_react134.useRef)(false);
359008
+ const initialPrompt = (0, import_react135.useMemo)(() => config.getQuestion(), [config]);
359009
+ const initialPromptSubmitted = (0, import_react135.useRef)(false);
358888
359010
  const geminiClient = config.getGeminiClient();
358889
- (0, import_react134.useEffect)(() => {
359011
+ (0, import_react135.useEffect)(() => {
358890
359012
  if (activePtyId) {
358891
359013
  ShellExecutionService.resizePty(
358892
359014
  activePtyId,
@@ -358895,7 +359017,7 @@ ${queuedText}` : queuedText;
358895
359017
  );
358896
359018
  }
358897
359019
  }, [terminalWidth, availableTerminalHeight, activePtyId]);
358898
- (0, import_react134.useEffect)(() => {
359020
+ (0, import_react135.useEffect)(() => {
358899
359021
  if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
358900
359022
  handleFinalSubmit(initialPrompt);
358901
359023
  initialPromptSubmitted.current = true;
@@ -358913,9 +359035,9 @@ ${queuedText}` : queuedText;
358913
359035
  welcomeBackChoice,
358914
359036
  geminiClient
358915
359037
  ]);
358916
- const [idePromptAnswered, setIdePromptAnswered] = (0, import_react134.useState)(false);
358917
- const [currentIDE, setCurrentIDE] = (0, import_react134.useState)(null);
358918
- (0, import_react134.useEffect)(() => {
359038
+ const [idePromptAnswered, setIdePromptAnswered] = (0, import_react135.useState)(false);
359039
+ const [currentIDE, setCurrentIDE] = (0, import_react135.useState)(null);
359040
+ (0, import_react135.useEffect)(() => {
358919
359041
  const getIde = /* @__PURE__ */ __name(async () => {
358920
359042
  const ideClient = await IdeClient.getInstance();
358921
359043
  const currentIde = ideClient.getCurrentIde();
@@ -358926,28 +359048,28 @@ ${queuedText}` : queuedText;
358926
359048
  const shouldShowIdePrompt = Boolean(
358927
359049
  currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
358928
359050
  );
358929
- const [showErrorDetails, setShowErrorDetails] = (0, import_react134.useState)(false);
358930
- const [showToolDescriptions, setShowToolDescriptions] = (0, import_react134.useState)(false);
358931
- const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react134.useState)(false);
358932
- const ctrlCTimerRef = (0, import_react134.useRef)(null);
358933
- const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react134.useState)(false);
358934
- const ctrlDTimerRef = (0, import_react134.useRef)(null);
358935
- const [constrainHeight, setConstrainHeight] = (0, import_react134.useState)(true);
358936
- const [ideContextState, setIdeContextState] = (0, import_react134.useState)();
358937
- const [showEscapePrompt, setShowEscapePrompt] = (0, import_react134.useState)(false);
358938
- const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react134.useState)(false);
359051
+ const [showErrorDetails, setShowErrorDetails] = (0, import_react135.useState)(false);
359052
+ const [showToolDescriptions, setShowToolDescriptions] = (0, import_react135.useState)(false);
359053
+ const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react135.useState)(false);
359054
+ const ctrlCTimerRef = (0, import_react135.useRef)(null);
359055
+ const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react135.useState)(false);
359056
+ const ctrlDTimerRef = (0, import_react135.useRef)(null);
359057
+ const [constrainHeight, setConstrainHeight] = (0, import_react135.useState)(true);
359058
+ const [ideContextState, setIdeContextState] = (0, import_react135.useState)();
359059
+ const [showEscapePrompt, setShowEscapePrompt] = (0, import_react135.useState)(false);
359060
+ const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react135.useState)(false);
358939
359061
  const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
358940
359062
  const {
358941
359063
  needsRestart: ideNeedsRestart,
358942
359064
  restartReason: ideTrustRestartReason
358943
359065
  } = useIdeTrustListener();
358944
- const isInitialMount = (0, import_react134.useRef)(true);
358945
- (0, import_react134.useEffect)(() => {
359066
+ const isInitialMount = (0, import_react135.useRef)(true);
359067
+ (0, import_react135.useEffect)(() => {
358946
359068
  if (ideNeedsRestart) {
358947
359069
  setShowIdeRestartPrompt(true);
358948
359070
  }
358949
359071
  }, [ideNeedsRestart]);
358950
- (0, import_react134.useEffect)(() => {
359072
+ (0, import_react135.useEffect)(() => {
358951
359073
  if (isInitialMount.current) {
358952
359074
  isInitialMount.current = false;
358953
359075
  return;
@@ -358959,12 +359081,12 @@ ${queuedText}` : queuedText;
358959
359081
  clearTimeout(handler);
358960
359082
  };
358961
359083
  }, [terminalWidth, refreshStatic]);
358962
- (0, import_react134.useEffect)(() => {
359084
+ (0, import_react135.useEffect)(() => {
358963
359085
  const unsubscribe = ideContextStore.subscribe(setIdeContextState);
358964
359086
  setIdeContextState(ideContextStore.get());
358965
359087
  return unsubscribe;
358966
359088
  }, []);
358967
- (0, import_react134.useEffect)(() => {
359089
+ (0, import_react135.useEffect)(() => {
358968
359090
  const openDebugConsole = /* @__PURE__ */ __name(() => {
358969
359091
  setShowErrorDetails(true);
358970
359092
  setConstrainHeight(false);
@@ -358983,10 +359105,10 @@ ${queuedText}` : queuedText;
358983
359105
  appEvents.off("log-error" /* LogError */, logErrorHandler);
358984
359106
  };
358985
359107
  }, [handleNewMessage]);
358986
- const handleEscapePromptChange = (0, import_react134.useCallback)((showPrompt) => {
359108
+ const handleEscapePromptChange = (0, import_react135.useCallback)((showPrompt) => {
358987
359109
  setShowEscapePrompt(showPrompt);
358988
359110
  }, []);
358989
- const handleIdePromptComplete = (0, import_react134.useCallback)(
359111
+ const handleIdePromptComplete = (0, import_react135.useCallback)(
358990
359112
  (result) => {
358991
359113
  if (result.userSelection === "yes") {
358992
359114
  handleSlashCommand2("/ide install");
@@ -359002,6 +359124,11 @@ ${queuedText}` : queuedText;
359002
359124
  streamingState,
359003
359125
  settings.merged.ui?.customWittyPhrases
359004
359126
  );
359127
+ useAttentionNotifications({
359128
+ isFocused,
359129
+ streamingState,
359130
+ elapsedTime
359131
+ });
359005
359132
  const { closeAnyOpenDialog } = useDialogClose({
359006
359133
  isThemeDialogOpen,
359007
359134
  handleThemeSelect,
@@ -359019,7 +359146,7 @@ ${queuedText}` : queuedText;
359019
359146
  handleWelcomeBackClose,
359020
359147
  quitConfirmationRequest
359021
359148
  });
359022
- const handleExit = (0, import_react134.useCallback)(
359149
+ const handleExit = (0, import_react135.useCallback)(
359023
359150
  (pressedOnce, setPressedOnce, timerRef) => {
359024
359151
  if (pressedOnce) {
359025
359152
  if (timerRef.current) {
@@ -359062,7 +359189,7 @@ ${queuedText}` : queuedText;
359062
359189
  buffer
359063
359190
  ]
359064
359191
  );
359065
- const handleGlobalKeypress = (0, import_react134.useCallback)(
359192
+ const handleGlobalKeypress = (0, import_react135.useCallback)(
359066
359193
  (key) => {
359067
359194
  if (settings.merged.general?.debugKeystrokeLogging) {
359068
359195
  console.log("[DEBUG] Keystroke:", JSON.stringify(key));
@@ -359135,7 +359262,7 @@ ${queuedText}` : queuedText;
359135
359262
  ]
359136
359263
  );
359137
359264
  useKeypress(handleGlobalKeypress, { isActive: true });
359138
- (0, import_react134.useEffect)(() => {
359265
+ (0, import_react135.useEffect)(() => {
359139
359266
  if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
359140
359267
  return;
359141
359268
  let title;
@@ -359157,23 +359284,23 @@ ${queuedText}` : queuedText;
359157
359284
  settings.merged.ui?.hideWindowTitle,
359158
359285
  stdout
359159
359286
  ]);
359160
- const filteredConsoleMessages = (0, import_react134.useMemo)(() => {
359287
+ const filteredConsoleMessages = (0, import_react135.useMemo)(() => {
359161
359288
  if (config.getDebugMode()) {
359162
359289
  return consoleMessages;
359163
359290
  }
359164
359291
  return consoleMessages.filter((msg) => msg.type !== "debug");
359165
359292
  }, [consoleMessages, config]);
359166
- const errorCount = (0, import_react134.useMemo)(
359293
+ const errorCount = (0, import_react135.useMemo)(
359167
359294
  () => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
359168
359295
  [filteredConsoleMessages]
359169
359296
  );
359170
359297
  const nightly = props.version.includes("nightly");
359171
359298
  const dialogsVisible = showWelcomeBackDialog || showWorkspaceMigrationDialog || shouldShowIdePrompt || isFolderTrustDialogOpen || !!shellConfirmationRequest || !!confirmationRequest || confirmUpdateExtensionRequests.length > 0 || !!loopDetectionConfirmationRequest || !!quitConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isModelDialogOpen || isVisionSwitchDialogOpen || isPermissionsDialogOpen || isAuthDialogOpen || isAuthenticating && isQwenAuthenticating || isEditorDialogOpen || showIdeRestartPrompt || !!proQuotaRequest || isSubagentCreateDialogOpen || isAgentsManagerDialogOpen || isApprovalModeDialogOpen;
359172
- const pendingHistoryItems = (0, import_react134.useMemo)(
359299
+ const pendingHistoryItems = (0, import_react135.useMemo)(
359173
359300
  () => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
359174
359301
  [pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
359175
359302
  );
359176
- const uiState = (0, import_react134.useMemo)(
359303
+ const uiState = (0, import_react135.useMemo)(
359177
359304
  () => ({
359178
359305
  history: historyManager.history,
359179
359306
  historyManager,
@@ -359368,7 +359495,7 @@ ${queuedText}` : queuedText;
359368
359495
  isAgentsManagerDialogOpen
359369
359496
  ]
359370
359497
  );
359371
- const uiActions = (0, import_react134.useMemo)(
359498
+ const uiActions = (0, import_react135.useMemo)(
359372
359499
  () => ({
359373
359500
  handleThemeSelect,
359374
359501
  handleThemeHighlight,
@@ -359511,7 +359638,7 @@ __name(readStdin, "readStdin");
359511
359638
  // packages/cli/src/gemini.tsx
359512
359639
  import { basename as basename16 } from "node:path";
359513
359640
  import v8 from "node:v8";
359514
- import os41 from "node:os";
359641
+ import os42 from "node:os";
359515
359642
  import dns from "node:dns";
359516
359643
  import { randomUUID as randomUUID8 } from "node:crypto";
359517
359644
 
@@ -359519,7 +359646,7 @@ import { randomUUID as randomUUID8 } from "node:crypto";
359519
359646
  init_esbuild_shims();
359520
359647
  var import_shell_quote5 = __toESM(require_shell_quote(), 1);
359521
359648
  import { exec as exec4, execSync as execSync6, spawn as spawn11 } from "node:child_process";
359522
- import os38 from "node:os";
359649
+ import os39 from "node:os";
359523
359650
  import path107 from "node:path";
359524
359651
  import fs94 from "node:fs";
359525
359652
  import { readFile as readFile11 } from "node:fs/promises";
@@ -359529,7 +359656,7 @@ import { promisify as promisify9 } from "node:util";
359529
359656
  import { randomBytes as randomBytes5 } from "node:crypto";
359530
359657
  var execAsync3 = promisify9(exec4);
359531
359658
  function getContainerPath(hostPath) {
359532
- if (os38.platform() !== "win32") {
359659
+ if (os39.platform() !== "win32") {
359533
359660
  return hostPath;
359534
359661
  }
359535
359662
  const withForwardSlashes = hostPath.replace(/\\/g, "/");
@@ -359559,7 +359686,7 @@ async function shouldUseCurrentUserInSandbox() {
359559
359686
  if (envVar === "0" || envVar === "false") {
359560
359687
  return false;
359561
359688
  }
359562
- if (os38.platform() === "linux") {
359689
+ if (os39.platform() === "linux") {
359563
359690
  try {
359564
359691
  const osReleaseContent = await readFile11("/etc/os-release", "utf8");
359565
359692
  if (osReleaseContent.includes("ID=debian") || osReleaseContent.includes("ID=ubuntu") || osReleaseContent.match(/^ID_LIKE=.*debian.*/m) || // Covers derivatives
@@ -359589,7 +359716,7 @@ function ports() {
359589
359716
  }
359590
359717
  __name(ports, "ports");
359591
359718
  function entrypoint(workdir, cliArgs) {
359592
- const isWindows8 = os38.platform() === "win32";
359719
+ const isWindows8 = os39.platform() === "win32";
359593
359720
  const containerWorkdir = getContainerPath(workdir);
359594
359721
  const shellCmds = [];
359595
359722
  const pathSeparator = isWindows8 ? ";" : ":";
@@ -359674,9 +359801,9 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
359674
359801
  "-D",
359675
359802
  `TARGET_DIR=${fs94.realpathSync(process.cwd())}`,
359676
359803
  "-D",
359677
- `TMP_DIR=${fs94.realpathSync(os38.tmpdir())}`,
359804
+ `TMP_DIR=${fs94.realpathSync(os39.tmpdir())}`,
359678
359805
  "-D",
359679
- `HOME_DIR=${fs94.realpathSync(os38.homedir())}`,
359806
+ `HOME_DIR=${fs94.realpathSync(os39.homedir())}`,
359680
359807
  "-D",
359681
359808
  `CACHE_DIR=${fs94.realpathSync(execSync6(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`
359682
359809
  ];
@@ -359844,8 +359971,8 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
359844
359971
  `${userSettingsDirOnHost}:${getContainerPath(userSettingsDirOnHost)}`
359845
359972
  );
359846
359973
  }
359847
- args.push("--volume", `${os38.tmpdir()}:${getContainerPath(os38.tmpdir())}`);
359848
- const gcloudConfigDir = path107.join(os38.homedir(), ".config", "gcloud");
359974
+ args.push("--volume", `${os39.tmpdir()}:${getContainerPath(os39.tmpdir())}`);
359975
+ const gcloudConfigDir = path107.join(os39.homedir(), ".config", "gcloud");
359849
359976
  if (fs94.existsSync(gcloudConfigDir)) {
359850
359977
  args.push(
359851
359978
  "--volume",
@@ -360043,7 +360170,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
360043
360170
  }
360044
360171
  args.push("--env", `SANDBOX=${containerName}`);
360045
360172
  if (config.command === "podman") {
360046
- const emptyAuthFilePath = path107.join(os38.tmpdir(), "empty_auth.json");
360173
+ const emptyAuthFilePath = path107.join(os39.tmpdir(), "empty_auth.json");
360047
360174
  fs94.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
360048
360175
  args.push("--authfile", emptyAuthFilePath);
360049
360176
  }
@@ -360057,7 +360184,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
360057
360184
  const uid = execSync6("id -u").toString().trim();
360058
360185
  const gid = execSync6("id -g").toString().trim();
360059
360186
  const username = "gemini";
360060
- const homeDir = getContainerPath(os38.homedir());
360187
+ const homeDir = getContainerPath(os39.homedir());
360061
360188
  const setupUserCommands = [
360062
360189
  // Use -f with groupadd to avoid errors if the group already exists.
360063
360190
  `groupadd -f -g ${gid} ${username}`,
@@ -360069,7 +360196,7 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
360069
360196
  const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
360070
360197
  finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
360071
360198
  userFlag = `--user ${uid}:${gid}`;
360072
- args.push("--env", `HOME=${os38.homedir()}`);
360199
+ args.push("--env", `HOME=${os39.homedir()}`);
360073
360200
  }
360074
360201
  args.push(image2);
360075
360202
  args.push(...finalEntrypoint);
@@ -360247,9 +360374,9 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
360247
360374
  init_esbuild_shims();
360248
360375
  init_core2();
360249
360376
  import fs95 from "node:fs/promises";
360250
- import os39 from "node:os";
360377
+ import os40 from "node:os";
360251
360378
  import { join as pathJoin } from "node:path";
360252
- var warningsFilePath = pathJoin(os39.tmpdir(), "qwen-code-warnings.txt");
360379
+ var warningsFilePath = pathJoin(os40.tmpdir(), "qwen-code-warnings.txt");
360253
360380
  async function getStartupWarnings() {
360254
360381
  try {
360255
360382
  await fs95.access(warningsFilePath);
@@ -360274,7 +360401,7 @@ __name(getStartupWarnings, "getStartupWarnings");
360274
360401
  init_esbuild_shims();
360275
360402
  init_core2();
360276
360403
  import fs96 from "node:fs/promises";
360277
- import * as os40 from "node:os";
360404
+ import * as os41 from "node:os";
360278
360405
  import path108 from "node:path";
360279
360406
  var homeDirectoryCheck = {
360280
360407
  id: "home-directory",
@@ -360282,7 +360409,7 @@ var homeDirectoryCheck = {
360282
360409
  try {
360283
360410
  const [workspaceRealPath, homeRealPath] = await Promise.all([
360284
360411
  fs96.realpath(options2.workspaceRoot),
360285
- fs96.realpath(os40.homedir())
360412
+ fs96.realpath(os41.homedir())
360286
360413
  ]);
360287
360414
  if (workspaceRealPath === homeRealPath) {
360288
360415
  return "\u5F53\u524D\u6B63\u5728 ~ \u76EE\u5F55\u4E0B\u8FD0\u884C RDMind\uFF0C\u5EFA\u8BAE\u8FDB\u5165\u9879\u76EE\u76EE\u5F55";
@@ -360373,18 +360500,38 @@ function createNonInteractiveUI() {
360373
360500
  __name(createNonInteractiveUI, "createNonInteractiveUI");
360374
360501
 
360375
360502
  // packages/cli/src/nonInteractiveCliCommands.ts
360376
- var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController, config, settings) => {
360503
+ function filterCommandsForNonInteractive(commands, allowedBuiltinCommandNames) {
360504
+ return commands.filter((cmd) => {
360505
+ if (cmd.kind === "file" /* FILE */) {
360506
+ return true;
360507
+ }
360508
+ if (cmd.kind === "built-in" /* BUILT_IN */) {
360509
+ return allowedBuiltinCommandNames.has(cmd.name);
360510
+ }
360511
+ return false;
360512
+ });
360513
+ }
360514
+ __name(filterCommandsForNonInteractive, "filterCommandsForNonInteractive");
360515
+ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController, config, settings, allowedBuiltinCommandNames) => {
360377
360516
  const trimmed2 = rawQuery.trim();
360378
360517
  if (!trimmed2.startsWith("/")) {
360379
360518
  return;
360380
360519
  }
360381
- const loaders = [new FileCommandLoader(config)];
360520
+ const allowedBuiltinSet = new Set(allowedBuiltinCommandNames ?? []);
360521
+ const loaders = allowedBuiltinSet.size > 0 ? [new BuiltinCommandLoader(config), new FileCommandLoader(config)] : [new FileCommandLoader(config)];
360382
360522
  const commandService = await CommandService.create(
360383
360523
  loaders,
360384
360524
  abortController.signal
360385
360525
  );
360386
360526
  const commands = commandService.getCommands();
360387
- const { commandToExecute, args } = parseSlashCommand(rawQuery, commands);
360527
+ const filteredCommands = filterCommandsForNonInteractive(
360528
+ commands,
360529
+ allowedBuiltinSet
360530
+ );
360531
+ const { commandToExecute, args } = parseSlashCommand(
360532
+ rawQuery,
360533
+ filteredCommands
360534
+ );
360388
360535
  if (commandToExecute) {
360389
360536
  if (commandToExecute.action) {
360390
360537
  const sessionStats = {
@@ -360432,6 +360579,22 @@ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController
360432
360579
  }
360433
360580
  return;
360434
360581
  }, "handleSlashCommand");
360582
+ var getAvailableCommands = /* @__PURE__ */ __name(async (config, settings, abortSignal, allowedBuiltinCommandNames) => {
360583
+ try {
360584
+ const allowedBuiltinSet = new Set(allowedBuiltinCommandNames ?? []);
360585
+ const loaders = allowedBuiltinSet.size > 0 ? [new BuiltinCommandLoader(config), new FileCommandLoader(config)] : [new FileCommandLoader(config)];
360586
+ const commandService = await CommandService.create(loaders, abortSignal);
360587
+ const commands = commandService.getCommands();
360588
+ const filteredCommands = filterCommandsForNonInteractive(
360589
+ commands,
360590
+ allowedBuiltinSet
360591
+ );
360592
+ return filteredCommands.filter((cmd) => !cmd.hidden);
360593
+ } catch (error) {
360594
+ console.error("Error loading available commands:", error);
360595
+ return [];
360596
+ }
360597
+ }, "getAvailableCommands");
360435
360598
 
360436
360599
  // packages/cli/src/nonInteractiveCli.ts
360437
360600
  async function runNonInteractive(config, settings, input, prompt_id) {
@@ -360556,9 +360719,9 @@ init_core2();
360556
360719
 
360557
360720
  // packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
360558
360721
  init_esbuild_shims();
360559
- var import_react135 = __toESM(require_react(), 1);
360722
+ var import_react136 = __toESM(require_react(), 1);
360560
360723
  function useKittyKeyboardProtocol() {
360561
- const [status] = (0, import_react135.useState)({
360724
+ const [status] = (0, import_react136.useState)({
360562
360725
  supported: isKittyProtocolSupported(),
360563
360726
  enabled: isKittyProtocolEnabled(),
360564
360727
  checking: false
@@ -360912,6 +361075,18 @@ var promptRequestSchema = external_exports.object({
360912
361075
  prompt: external_exports.array(contentBlockSchema),
360913
361076
  sessionId: external_exports.string()
360914
361077
  });
361078
+ var availableCommandInputSchema = external_exports.object({
361079
+ hint: external_exports.string()
361080
+ });
361081
+ var availableCommandSchema = external_exports.object({
361082
+ description: external_exports.string(),
361083
+ input: availableCommandInputSchema.nullable().optional(),
361084
+ name: external_exports.string()
361085
+ });
361086
+ var availableCommandsUpdateSchema = external_exports.object({
361087
+ availableCommands: external_exports.array(availableCommandSchema),
361088
+ sessionUpdate: external_exports.literal("available_commands_update")
361089
+ });
360915
361090
  var sessionUpdateSchema = external_exports.union([
360916
361091
  external_exports.object({
360917
361092
  content: contentBlockSchema,
@@ -360948,7 +361123,8 @@ var sessionUpdateSchema = external_exports.union([
360948
361123
  external_exports.object({
360949
361124
  entries: external_exports.array(planEntrySchema),
360950
361125
  sessionUpdate: external_exports.literal("plan")
360951
- })
361126
+ }),
361127
+ availableCommandsUpdateSchema
360952
361128
  ]);
360953
361129
  var agentResponseSchema = external_exports.union([
360954
361130
  initializeResponseSchema,
@@ -361255,6 +361431,7 @@ init_zod();
361255
361431
  import * as fs97 from "node:fs/promises";
361256
361432
  import * as path109 from "node:path";
361257
361433
  import { randomUUID as randomUUID7 } from "node:crypto";
361434
+ var ALLOWED_BUILTIN_COMMANDS_FOR_ACP = ["init"];
361258
361435
  function resolveModel(model, isInFallbackMode) {
361259
361436
  if (model === DEFAULT_GEMINI_MODEL_AUTO) {
361260
361437
  return isInFallbackMode ? DEFAULT_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_MODEL;
@@ -361329,7 +361506,7 @@ var GeminiAgent = class {
361329
361506
  cwd: cwd7,
361330
361507
  mcpServers
361331
361508
  }) {
361332
- const sessionId2 = randomUUID7();
361509
+ const sessionId2 = this.config.getSessionId() || randomUUID7();
361333
361510
  const config = await this.newSessionConfig(sessionId2, cwd7, mcpServers);
361334
361511
  let isAuthenticated = false;
361335
361512
  if (this.settings.merged.security?.auth?.selectedType) {
@@ -361356,8 +361533,17 @@ var GeminiAgent = class {
361356
361533
  }
361357
361534
  const geminiClient = config.getGeminiClient();
361358
361535
  const chat = await geminiClient.startChat();
361359
- const session = new Session2(sessionId2, chat, config, this.client);
361536
+ const session = new Session2(
361537
+ sessionId2,
361538
+ chat,
361539
+ config,
361540
+ this.client,
361541
+ this.settings
361542
+ );
361360
361543
  this.sessions.set(sessionId2, session);
361544
+ setTimeout(async () => {
361545
+ await session.sendAvailableCommandsUpdate();
361546
+ }, 0);
361361
361547
  return {
361362
361548
  sessionId: sessionId2
361363
361549
  };
@@ -361402,16 +361588,18 @@ var GeminiAgent = class {
361402
361588
  }
361403
361589
  };
361404
361590
  var Session2 = class {
361405
- constructor(id, chat, config, client) {
361591
+ constructor(id, chat, config, client, settings) {
361406
361592
  this.id = id;
361407
361593
  this.chat = chat;
361408
361594
  this.config = config;
361409
361595
  this.client = client;
361596
+ this.settings = settings;
361410
361597
  }
361411
361598
  static {
361412
361599
  __name(this, "Session");
361413
361600
  }
361414
361601
  pendingPrompt = null;
361602
+ turn = 0;
361415
361603
  async cancelPendingPrompt() {
361416
361604
  if (!this.pendingPrompt) {
361417
361605
  throw new Error("Not currently generating");
@@ -361423,9 +361611,38 @@ var Session2 = class {
361423
361611
  this.pendingPrompt?.abort();
361424
361612
  const pendingSend = new AbortController();
361425
361613
  this.pendingPrompt = pendingSend;
361426
- const promptId = Math.random().toString(16).slice(2);
361614
+ this.turn += 1;
361427
361615
  const chat = this.chat;
361428
- const parts = await this.#resolvePrompt(params.prompt, pendingSend.signal);
361616
+ const promptId = this.config.getSessionId() + "########" + this.turn;
361617
+ const promptText = params.prompt.filter((block2) => block2.type === "text").map((block2) => block2.type === "text" ? block2.text : "").join(" ");
361618
+ logUserPrompt(
361619
+ this.config,
361620
+ new UserPromptEvent(
361621
+ promptText.length,
361622
+ promptId,
361623
+ this.config.getContentGeneratorConfig()?.authType,
361624
+ promptText
361625
+ )
361626
+ );
361627
+ const firstTextBlock = params.prompt.find((block2) => block2.type === "text");
361628
+ const inputText = firstTextBlock?.text || "";
361629
+ let parts;
361630
+ if (isSlashCommand(inputText)) {
361631
+ const slashCommandResult = await handleSlashCommand(
361632
+ inputText,
361633
+ pendingSend,
361634
+ this.config,
361635
+ this.settings,
361636
+ ALLOWED_BUILTIN_COMMANDS_FOR_ACP
361637
+ );
361638
+ if (slashCommandResult) {
361639
+ parts = slashCommandResult;
361640
+ } else {
361641
+ parts = await this.#resolvePrompt(params.prompt, pendingSend.signal);
361642
+ }
361643
+ } else {
361644
+ parts = await this.#resolvePrompt(params.prompt, pendingSend.signal);
361645
+ }
361429
361646
  let nextMessage = { role: "user", parts };
361430
361647
  while (nextMessage !== null) {
361431
361648
  if (pendingSend.signal.aborted) {
@@ -361496,6 +361713,31 @@ var Session2 = class {
361496
361713
  };
361497
361714
  await this.client.sessionUpdate(params);
361498
361715
  }
361716
+ async sendAvailableCommandsUpdate() {
361717
+ const abortController = new AbortController();
361718
+ try {
361719
+ const slashCommands = await getAvailableCommands(
361720
+ this.config,
361721
+ this.settings,
361722
+ abortController.signal,
361723
+ ALLOWED_BUILTIN_COMMANDS_FOR_ACP
361724
+ );
361725
+ const availableCommands = slashCommands.map(
361726
+ (cmd) => ({
361727
+ name: cmd.name,
361728
+ description: cmd.description,
361729
+ input: null
361730
+ })
361731
+ );
361732
+ const update2 = {
361733
+ sessionUpdate: "available_commands_update",
361734
+ availableCommands
361735
+ };
361736
+ await this.sendUpdate(update2);
361737
+ } catch (error) {
361738
+ console.error("Error sending available commands update:", error);
361739
+ }
361740
+ }
361499
361741
  async runTool(abortSignal, promptId, fc) {
361500
361742
  const callId = fc.id ?? `${fc.name}-${Date.now()}`;
361501
361743
  const args = fc.args ?? {};
@@ -362262,7 +362504,7 @@ function validateDnsResolutionOrder(order) {
362262
362504
  }
362263
362505
  __name(validateDnsResolutionOrder, "validateDnsResolutionOrder");
362264
362506
  function getNodeMemoryArgs(isDebugMode2) {
362265
- const totalMemoryMB = os41.totalmem() / (1024 * 1024);
362507
+ const totalMemoryMB = os42.totalmem() / (1024 * 1024);
362266
362508
  const heapStats = v8.getHeapStatistics();
362267
362509
  const currentMaxOldSpaceSizeMb = Math.floor(
362268
362510
  heapStats.heap_size_limit / 1024 / 1024
@@ -362332,7 +362574,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
362332
362574
  ) });
362333
362575
  }, "AppWrapper");
362334
362576
  const instance = render_default(
362335
- process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_react136.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AppWrapper, {}),
362577
+ process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_react137.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(AppWrapper, {}),
362336
362578
  {
362337
362579
  exitOnCtrlC: false,
362338
362580
  isScreenReaderEnabled: config.getScreenReader()