@qwen-code/qwen-code 0.16.1-nightly.20260526.e8b79d772 → 0.16.1-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/chunks/{agent-B5PF5GU4.js → agent-KYFWAFRH.js} +2 -2
  2. package/chunks/{chunk-MYDM4QOE.js → chunk-DDU3LH4J.js} +3 -3
  3. package/chunks/{chunk-ANALJURO.js → chunk-F6MJMTLW.js} +47 -13
  4. package/chunks/{chunk-IP4GBLQC.js → chunk-JQF2373J.js} +1 -1
  5. package/chunks/{chunk-HG6K7DXU.js → chunk-M5TA67JI.js} +7 -4
  6. package/chunks/{chunk-ZKA3IIHA.js → chunk-QQAHXZS2.js} +665 -595
  7. package/chunks/{chunk-BA5NSL3Q.js → chunk-XS2N5WHQ.js} +1 -8
  8. package/chunks/{contextCommand-TTSLOTQ6.js → contextCommand-E3Z6QOHV.js} +4 -4
  9. package/chunks/{edit-UJMWLGYK.js → edit-2CY35GKJ.js} +2 -2
  10. package/chunks/{enter-worktree-E2EUJPD3.js → enter-worktree-HJGN4DH2.js} +2 -2
  11. package/chunks/{exit-worktree-I7UHJCUU.js → exit-worktree-VAPX5N2E.js} +2 -2
  12. package/chunks/{exitPlanMode-Q43DRSNG.js → exitPlanMode-3JP3BRRO.js} +2 -2
  13. package/chunks/{geminiContentGenerator-LCIN4ABZ.js → geminiContentGenerator-MD7IEVCK.js} +1 -1
  14. package/chunks/{glob-WU4BIR7K.js → glob-C5ZNGH7V.js} +2 -2
  15. package/chunks/{grep-NID7EZU4.js → grep-GKU7Y77F.js} +2 -2
  16. package/chunks/{monitor-4M5UH7WX.js → monitor-HJTGGH2N.js} +2 -2
  17. package/chunks/{notebook-edit-5SR3UTIM.js → notebook-edit-RWOEUTYU.js} +2 -2
  18. package/chunks/{openaiContentGenerator-MNHBU5EB.js → openaiContentGenerator-FDC4XT77.js} +2 -2
  19. package/chunks/{qwenContentGenerator-GNLT4NPW.js → qwenContentGenerator-J3C7NUMH.js} +3 -3
  20. package/chunks/{read-file-WSEYLDOV.js → read-file-5QUJ3ZIL.js} +1 -1
  21. package/chunks/{ripGrep-N67GL3K7.js → ripGrep-PA7M7MJS.js} +2 -2
  22. package/chunks/{serve-LH7POP2W.js → serve-FLSKL5TV.js} +4 -4
  23. package/chunks/{shell-JJBUJGJM.js → shell-DA54BZO2.js} +2 -2
  24. package/chunks/{skill-T3PI55OA.js → skill-47FZXDEM.js} +1 -1
  25. package/chunks/{src-Y3ZIBE6Z.js → src-6Y7NVY2L.js} +2 -2
  26. package/chunks/{tool-search-VS4IMEQF.js → tool-search-PONJXBSP.js} +1 -1
  27. package/chunks/{write-file-IPYT4F3N.js → write-file-2YX4NB3B.js} +2 -2
  28. package/cli.js +3731 -3431
  29. package/package.json +2 -2
@@ -160,7 +160,7 @@ import {
160
160
  truncateSpanError,
161
161
  truncateToolOutput,
162
162
  uiTelemetryService
163
- } from "./chunk-MYDM4QOE.js";
163
+ } from "./chunk-DDU3LH4J.js";
164
164
  import {
165
165
  DEFAULT_QWEN_EMBEDDING_MODEL,
166
166
  DEFAULT_QWEN_MODEL
@@ -2144,16 +2144,16 @@ var require_windows = __commonJS({
2144
2144
  return false;
2145
2145
  }
2146
2146
  __name(checkPathExt, "checkPathExt");
2147
- function checkStat(stat15, path84, options2) {
2148
- if (!stat15.isSymbolicLink() && !stat15.isFile()) {
2147
+ function checkStat(stat16, path84, options2) {
2148
+ if (!stat16.isSymbolicLink() && !stat16.isFile()) {
2149
2149
  return false;
2150
2150
  }
2151
2151
  return checkPathExt(path84, options2);
2152
2152
  }
2153
2153
  __name(checkStat, "checkStat");
2154
2154
  function isexe(path84, options2, cb) {
2155
- fs81.stat(path84, function(er, stat15) {
2156
- cb(er, er ? false : checkStat(stat15, path84, options2));
2155
+ fs81.stat(path84, function(er, stat16) {
2156
+ cb(er, er ? false : checkStat(stat16, path84, options2));
2157
2157
  });
2158
2158
  }
2159
2159
  __name(isexe, "isexe");
@@ -2172,8 +2172,8 @@ var require_mode = __commonJS({
2172
2172
  isexe.sync = sync2;
2173
2173
  var fs81 = __require("fs");
2174
2174
  function isexe(path84, options2, cb) {
2175
- fs81.stat(path84, function(er, stat15) {
2176
- cb(er, er ? false : checkStat(stat15, options2));
2175
+ fs81.stat(path84, function(er, stat16) {
2176
+ cb(er, er ? false : checkStat(stat16, options2));
2177
2177
  });
2178
2178
  }
2179
2179
  __name(isexe, "isexe");
@@ -2181,14 +2181,14 @@ var require_mode = __commonJS({
2181
2181
  return checkStat(fs81.statSync(path84), options2);
2182
2182
  }
2183
2183
  __name(sync2, "sync");
2184
- function checkStat(stat15, options2) {
2185
- return stat15.isFile() && checkMode(stat15, options2);
2184
+ function checkStat(stat16, options2) {
2185
+ return stat16.isFile() && checkMode(stat16, options2);
2186
2186
  }
2187
2187
  __name(checkStat, "checkStat");
2188
- function checkMode(stat15, options2) {
2189
- var mod = stat15.mode;
2190
- var uid = stat15.uid;
2191
- var gid = stat15.gid;
2188
+ function checkMode(stat16, options2) {
2189
+ var mod = stat16.mode;
2190
+ var uid = stat16.uid;
2191
+ var gid = stat16.gid;
2192
2192
  var myUid = options2.uid !== void 0 ? options2.uid : process.getuid && process.getuid();
2193
2193
  var myGid = options2.gid !== void 0 ? options2.gid : process.getgid && process.getgid();
2194
2194
  var u = parseInt("100", 8);
@@ -2668,12 +2668,12 @@ var require_src3 = __commonJS({
2668
2668
  function check(path84, isFile2, isDirectory) {
2669
2669
  log(`checking %s`, path84);
2670
2670
  try {
2671
- const stat15 = fs_1.statSync(path84);
2672
- if (stat15.isFile() && isFile2) {
2671
+ const stat16 = fs_1.statSync(path84);
2672
+ if (stat16.isFile() && isFile2) {
2673
2673
  log(`[OK] path represents a file`);
2674
2674
  return true;
2675
2675
  }
2676
- if (stat15.isDirectory() && isDirectory) {
2676
+ if (stat16.isDirectory() && isDirectory) {
2677
2677
  log(`[OK] path represents a directory`);
2678
2678
  return true;
2679
2679
  }
@@ -10526,10 +10526,10 @@ var require_resolve_block_map = __commonJS({
10526
10526
  let offset = bm.offset;
10527
10527
  let commentEnd = null;
10528
10528
  for (const collItem of bm.items) {
10529
- const { start: start2, key, sep: sep17, value } = collItem;
10529
+ const { start: start2, key, sep: sep16, value } = collItem;
10530
10530
  const keyProps = resolveProps.resolveProps(start2, {
10531
10531
  indicator: "explicit-key-ind",
10532
- next: key ?? sep17?.[0],
10532
+ next: key ?? sep16?.[0],
10533
10533
  offset,
10534
10534
  onError: onError2,
10535
10535
  parentIndent: bm.indent,
@@ -10543,7 +10543,7 @@ var require_resolve_block_map = __commonJS({
10543
10543
  else if ("indent" in key && key.indent !== bm.indent)
10544
10544
  onError2(offset, "BAD_INDENT", startColMsg);
10545
10545
  }
10546
- if (!keyProps.anchor && !keyProps.tag && !sep17) {
10546
+ if (!keyProps.anchor && !keyProps.tag && !sep16) {
10547
10547
  commentEnd = keyProps.end;
10548
10548
  if (keyProps.comment) {
10549
10549
  if (map.comment)
@@ -10567,7 +10567,7 @@ var require_resolve_block_map = __commonJS({
10567
10567
  ctx.atKey = false;
10568
10568
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
10569
10569
  onError2(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
10570
- const valueProps = resolveProps.resolveProps(sep17 ?? [], {
10570
+ const valueProps = resolveProps.resolveProps(sep16 ?? [], {
10571
10571
  indicator: "map-value-ind",
10572
10572
  next: value,
10573
10573
  offset: keyNode.range[2],
@@ -10583,7 +10583,7 @@ var require_resolve_block_map = __commonJS({
10583
10583
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
10584
10584
  onError2(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
10585
10585
  }
10586
- const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : composeEmptyNode(ctx, offset, sep17, null, valueProps, onError2);
10586
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : composeEmptyNode(ctx, offset, sep16, null, valueProps, onError2);
10587
10587
  if (ctx.schema.compat)
10588
10588
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError2);
10589
10589
  offset = valueNode.range[2];
@@ -10678,7 +10678,7 @@ var require_resolve_end = __commonJS({
10678
10678
  let comment = "";
10679
10679
  if (end) {
10680
10680
  let hasSpace = false;
10681
- let sep17 = "";
10681
+ let sep16 = "";
10682
10682
  for (const token of end) {
10683
10683
  const { source, type } = token;
10684
10684
  switch (type) {
@@ -10692,13 +10692,13 @@ var require_resolve_end = __commonJS({
10692
10692
  if (!comment)
10693
10693
  comment = cb;
10694
10694
  else
10695
- comment += sep17 + cb;
10696
- sep17 = "";
10695
+ comment += sep16 + cb;
10696
+ sep16 = "";
10697
10697
  break;
10698
10698
  }
10699
10699
  case "newline":
10700
10700
  if (comment)
10701
- sep17 += source;
10701
+ sep16 += source;
10702
10702
  hasSpace = true;
10703
10703
  break;
10704
10704
  default:
@@ -10743,18 +10743,18 @@ var require_resolve_flow_collection = __commonJS({
10743
10743
  let offset = fc.offset + fc.start.source.length;
10744
10744
  for (let i2 = 0; i2 < fc.items.length; ++i2) {
10745
10745
  const collItem = fc.items[i2];
10746
- const { start: start2, key, sep: sep17, value } = collItem;
10746
+ const { start: start2, key, sep: sep16, value } = collItem;
10747
10747
  const props = resolveProps.resolveProps(start2, {
10748
10748
  flow: fcName,
10749
10749
  indicator: "explicit-key-ind",
10750
- next: key ?? sep17?.[0],
10750
+ next: key ?? sep16?.[0],
10751
10751
  offset,
10752
10752
  onError: onError2,
10753
10753
  parentIndent: fc.indent,
10754
10754
  startOnNewline: false
10755
10755
  });
10756
10756
  if (!props.found) {
10757
- if (!props.anchor && !props.tag && !sep17 && !value) {
10757
+ if (!props.anchor && !props.tag && !sep16 && !value) {
10758
10758
  if (i2 === 0 && props.comma)
10759
10759
  onError2(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
10760
10760
  else if (i2 < fc.items.length - 1)
@@ -10808,8 +10808,8 @@ var require_resolve_flow_collection = __commonJS({
10808
10808
  }
10809
10809
  }
10810
10810
  }
10811
- if (!isMap && !sep17 && !props.found) {
10812
- const valueNode = value ? composeNode(ctx, value, props, onError2) : composeEmptyNode(ctx, props.end, sep17, null, props, onError2);
10811
+ if (!isMap && !sep16 && !props.found) {
10812
+ const valueNode = value ? composeNode(ctx, value, props, onError2) : composeEmptyNode(ctx, props.end, sep16, null, props, onError2);
10813
10813
  coll.items.push(valueNode);
10814
10814
  offset = valueNode.range[2];
10815
10815
  if (isBlock(value))
@@ -10821,7 +10821,7 @@ var require_resolve_flow_collection = __commonJS({
10821
10821
  if (isBlock(key))
10822
10822
  onError2(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
10823
10823
  ctx.atKey = false;
10824
- const valueProps = resolveProps.resolveProps(sep17 ?? [], {
10824
+ const valueProps = resolveProps.resolveProps(sep16 ?? [], {
10825
10825
  flow: fcName,
10826
10826
  indicator: "map-value-ind",
10827
10827
  next: value,
@@ -10832,8 +10832,8 @@ var require_resolve_flow_collection = __commonJS({
10832
10832
  });
10833
10833
  if (valueProps.found) {
10834
10834
  if (!isMap && !props.found && ctx.options.strict) {
10835
- if (sep17)
10836
- for (const st of sep17) {
10835
+ if (sep16)
10836
+ for (const st of sep16) {
10837
10837
  if (st === valueProps.found)
10838
10838
  break;
10839
10839
  if (st.type === "newline") {
@@ -10850,7 +10850,7 @@ var require_resolve_flow_collection = __commonJS({
10850
10850
  else
10851
10851
  onError2(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
10852
10852
  }
10853
- const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep17, null, valueProps, onError2) : null;
10853
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError2) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep16, null, valueProps, onError2) : null;
10854
10854
  if (valueNode) {
10855
10855
  if (isBlock(value))
10856
10856
  onError2(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -11035,7 +11035,7 @@ var require_resolve_block_scalar = __commonJS({
11035
11035
  chompStart = i2 + 1;
11036
11036
  }
11037
11037
  let value = "";
11038
- let sep17 = "";
11038
+ let sep16 = "";
11039
11039
  let prevMoreIndented = false;
11040
11040
  for (let i2 = 0; i2 < contentStart; ++i2)
11041
11041
  value += lines[i2][0].slice(trimIndent) + "\n";
@@ -11052,24 +11052,24 @@ var require_resolve_block_scalar = __commonJS({
11052
11052
  indent = "";
11053
11053
  }
11054
11054
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
11055
- value += sep17 + indent.slice(trimIndent) + content;
11056
- sep17 = "\n";
11055
+ value += sep16 + indent.slice(trimIndent) + content;
11056
+ sep16 = "\n";
11057
11057
  } else if (indent.length > trimIndent || content[0] === " ") {
11058
- if (sep17 === " ")
11059
- sep17 = "\n";
11060
- else if (!prevMoreIndented && sep17 === "\n")
11061
- sep17 = "\n\n";
11062
- value += sep17 + indent.slice(trimIndent) + content;
11063
- sep17 = "\n";
11058
+ if (sep16 === " ")
11059
+ sep16 = "\n";
11060
+ else if (!prevMoreIndented && sep16 === "\n")
11061
+ sep16 = "\n\n";
11062
+ value += sep16 + indent.slice(trimIndent) + content;
11063
+ sep16 = "\n";
11064
11064
  prevMoreIndented = true;
11065
11065
  } else if (content === "") {
11066
- if (sep17 === "\n")
11066
+ if (sep16 === "\n")
11067
11067
  value += "\n";
11068
11068
  else
11069
- sep17 = "\n";
11069
+ sep16 = "\n";
11070
11070
  } else {
11071
- value += sep17 + content;
11072
- sep17 = " ";
11071
+ value += sep16 + content;
11072
+ sep16 = " ";
11073
11073
  prevMoreIndented = false;
11074
11074
  }
11075
11075
  }
@@ -11258,25 +11258,25 @@ var require_resolve_flow_scalar = __commonJS({
11258
11258
  if (!match2)
11259
11259
  return source;
11260
11260
  let res = match2[1];
11261
- let sep17 = " ";
11261
+ let sep16 = " ";
11262
11262
  let pos2 = first2.lastIndex;
11263
11263
  line.lastIndex = pos2;
11264
11264
  while (match2 = line.exec(source)) {
11265
11265
  if (match2[1] === "") {
11266
- if (sep17 === "\n")
11267
- res += sep17;
11266
+ if (sep16 === "\n")
11267
+ res += sep16;
11268
11268
  else
11269
- sep17 = "\n";
11269
+ sep16 = "\n";
11270
11270
  } else {
11271
- res += sep17 + match2[1];
11272
- sep17 = " ";
11271
+ res += sep16 + match2[1];
11272
+ sep16 = " ";
11273
11273
  }
11274
11274
  pos2 = line.lastIndex;
11275
11275
  }
11276
11276
  const last2 = /[ \t]*(.*)/sy;
11277
11277
  last2.lastIndex = pos2;
11278
11278
  match2 = last2.exec(source);
11279
- return res + sep17 + (match2?.[1] ?? "");
11279
+ return res + sep16 + (match2?.[1] ?? "");
11280
11280
  }
11281
11281
  __name(foldLines, "foldLines");
11282
11282
  function doubleQuotedValue(source, onError2) {
@@ -12109,14 +12109,14 @@ var require_cst_stringify = __commonJS({
12109
12109
  }
12110
12110
  }
12111
12111
  __name(stringifyToken, "stringifyToken");
12112
- function stringifyItem({ start: start2, key, sep: sep17, value }) {
12112
+ function stringifyItem({ start: start2, key, sep: sep16, value }) {
12113
12113
  let res = "";
12114
12114
  for (const st of start2)
12115
12115
  res += st.source;
12116
12116
  if (key)
12117
12117
  res += stringifyToken(key);
12118
- if (sep17)
12119
- for (const st of sep17)
12118
+ if (sep16)
12119
+ for (const st of sep16)
12120
12120
  res += st.source;
12121
12121
  if (value)
12122
12122
  res += stringifyToken(value);
@@ -13292,18 +13292,18 @@ var require_parser = __commonJS({
13292
13292
  if (this.type === "map-value-ind") {
13293
13293
  const prev = getPrevProps(this.peek(2));
13294
13294
  const start2 = getFirstKeyStartProps(prev);
13295
- let sep17;
13295
+ let sep16;
13296
13296
  if (scalar.end) {
13297
- sep17 = scalar.end;
13298
- sep17.push(this.sourceToken);
13297
+ sep16 = scalar.end;
13298
+ sep16.push(this.sourceToken);
13299
13299
  delete scalar.end;
13300
13300
  } else
13301
- sep17 = [this.sourceToken];
13301
+ sep16 = [this.sourceToken];
13302
13302
  const map = {
13303
13303
  type: "block-map",
13304
13304
  offset: scalar.offset,
13305
13305
  indent: scalar.indent,
13306
- items: [{ start: start2, key: scalar, sep: sep17 }]
13306
+ items: [{ start: start2, key: scalar, sep: sep16 }]
13307
13307
  };
13308
13308
  this.onKeyLine = true;
13309
13309
  this.stack[this.stack.length - 1] = map;
@@ -13456,15 +13456,15 @@ var require_parser = __commonJS({
13456
13456
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
13457
13457
  const start3 = getFirstKeyStartProps(it.start);
13458
13458
  const key = it.key;
13459
- const sep17 = it.sep;
13460
- sep17.push(this.sourceToken);
13459
+ const sep16 = it.sep;
13460
+ sep16.push(this.sourceToken);
13461
13461
  delete it.key;
13462
13462
  delete it.sep;
13463
13463
  this.stack.push({
13464
13464
  type: "block-map",
13465
13465
  offset: this.offset,
13466
13466
  indent: this.indent,
13467
- items: [{ start: start3, key, sep: sep17 }]
13467
+ items: [{ start: start3, key, sep: sep16 }]
13468
13468
  });
13469
13469
  } else if (start2.length > 0) {
13470
13470
  it.sep = it.sep.concat(start2, this.sourceToken);
@@ -13658,13 +13658,13 @@ var require_parser = __commonJS({
13658
13658
  const prev = getPrevProps(parent);
13659
13659
  const start2 = getFirstKeyStartProps(prev);
13660
13660
  fixFlowSeqItems(fc);
13661
- const sep17 = fc.end.splice(1, fc.end.length);
13662
- sep17.push(this.sourceToken);
13661
+ const sep16 = fc.end.splice(1, fc.end.length);
13662
+ sep16.push(this.sourceToken);
13663
13663
  const map = {
13664
13664
  type: "block-map",
13665
13665
  offset: fc.offset,
13666
13666
  indent: fc.indent,
13667
- items: [{ start: start2, key: fc, sep: sep17 }]
13667
+ items: [{ start: start2, key: fc, sep: sep16 }]
13668
13668
  };
13669
13669
  this.onKeyLine = true;
13670
13670
  this.stack[this.stack.length - 1] = map;
@@ -18110,8 +18110,8 @@ var require_main = __commonJS({
18110
18110
  const shortPaths = [];
18111
18111
  for (const filePath of optionPaths) {
18112
18112
  try {
18113
- const relative13 = path84.relative(process.cwd(), filePath);
18114
- shortPaths.push(relative13);
18113
+ const relative12 = path84.relative(process.cwd(), filePath);
18114
+ shortPaths.push(relative12);
18115
18115
  } catch (e) {
18116
18116
  if (debug2) {
18117
18117
  _debug(`Failed to load ${filePath} ${e.message}`);
@@ -20767,9 +20767,9 @@ var require_prompts = __commonJS({
20767
20767
  $.date = (args2) => toPrompt("DatePrompt", args2);
20768
20768
  $.confirm = (args2) => toPrompt("ConfirmPrompt", args2);
20769
20769
  $.list = (args2) => {
20770
- const sep17 = args2.separator || ",";
20770
+ const sep16 = args2.separator || ",";
20771
20771
  return toPrompt("TextPrompt", args2, {
20772
- onSubmit: /* @__PURE__ */ __name((str) => str.split(sep17).map((s) => s.trim()), "onSubmit")
20772
+ onSubmit: /* @__PURE__ */ __name((str) => str.split(sep16).map((s) => s.trim()), "onSubmit")
20773
20773
  });
20774
20774
  };
20775
20775
  $.toggle = (args2) => toPrompt("TogglePrompt", args2);
@@ -23162,9 +23162,9 @@ var require_prompts2 = __commonJS({
23162
23162
  $.date = (args2) => toPrompt("DatePrompt", args2);
23163
23163
  $.confirm = (args2) => toPrompt("ConfirmPrompt", args2);
23164
23164
  $.list = (args2) => {
23165
- const sep17 = args2.separator || ",";
23165
+ const sep16 = args2.separator || ",";
23166
23166
  return toPrompt("TextPrompt", args2, {
23167
- onSubmit: /* @__PURE__ */ __name((str) => str.split(sep17).map((s) => s.trim()), "onSubmit")
23167
+ onSubmit: /* @__PURE__ */ __name((str) => str.split(sep16).map((s) => s.trim()), "onSubmit")
23168
23168
  });
23169
23169
  };
23170
23170
  $.toggle = (args2) => toPrompt("TogglePrompt", args2);
@@ -23525,12 +23525,12 @@ var require_resolve_symlink = __commonJS({
23525
23525
  fs_1.default.realpath(path84, (error, resolvedPath) => {
23526
23526
  if (error)
23527
23527
  return queue.dequeue(suppressErrors ? null : error, state);
23528
- fs_1.default.stat(resolvedPath, (error2, stat15) => {
23528
+ fs_1.default.stat(resolvedPath, (error2, stat16) => {
23529
23529
  if (error2)
23530
23530
  return queue.dequeue(suppressErrors ? null : error2, state);
23531
- if (stat15.isDirectory() && isRecursive(path84, resolvedPath, state))
23531
+ if (stat16.isDirectory() && isRecursive(path84, resolvedPath, state))
23532
23532
  return queue.dequeue(null, state);
23533
- callback(stat15, resolvedPath);
23533
+ callback(stat16, resolvedPath);
23534
23534
  queue.dequeue(null, state);
23535
23535
  });
23536
23536
  });
@@ -23540,10 +23540,10 @@ var require_resolve_symlink = __commonJS({
23540
23540
  queue.enqueue();
23541
23541
  try {
23542
23542
  const resolvedPath = fs_1.default.realpathSync(path84);
23543
- const stat15 = fs_1.default.statSync(resolvedPath);
23544
- if (stat15.isDirectory() && isRecursive(path84, resolvedPath, state))
23543
+ const stat16 = fs_1.default.statSync(resolvedPath);
23544
+ if (stat16.isDirectory() && isRecursive(path84, resolvedPath, state))
23545
23545
  return;
23546
- callback(stat15, resolvedPath);
23546
+ callback(stat16, resolvedPath);
23547
23547
  } catch (e) {
23548
23548
  if (!suppressErrors)
23549
23549
  throw e;
@@ -23862,8 +23862,8 @@ var require_walker = __commonJS({
23862
23862
  this.walkDirectory(this.state, path84, path84, depth - 1, this.walk);
23863
23863
  } else if (this.resolveSymlink && entry.isSymbolicLink()) {
23864
23864
  let path84 = joinPath.joinPathWithBasePath(entry.name, directoryPath);
23865
- this.resolveSymlink(path84, this.state, (stat15, resolvedPath) => {
23866
- if (stat15.isDirectory()) {
23865
+ this.resolveSymlink(path84, this.state, (stat16, resolvedPath) => {
23866
+ if (stat16.isDirectory()) {
23867
23867
  resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
23868
23868
  if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path84 + pathSeparator))
23869
23869
  return;
@@ -28380,8 +28380,8 @@ async function atomicWriteFile(filePath, data, options2) {
28380
28380
  const tmpPath = `${targetPath}.${crypto.randomBytes(6).toString("hex")}.tmp`;
28381
28381
  let existingMode;
28382
28382
  try {
28383
- const stat15 = await fs3.stat(targetPath);
28384
- existingMode = stat15.mode & 4095;
28383
+ const stat16 = await fs3.stat(targetPath);
28384
+ existingMode = stat16.mode & 4095;
28385
28385
  } catch (err2) {
28386
28386
  if (!isNodeError(err2) || err2.code !== "ENOENT") {
28387
28387
  throw err2;
@@ -37504,6 +37504,85 @@ import { randomUUID as randomUUID5 } from "node:crypto";
37504
37504
  init_esbuild_shims();
37505
37505
  import { randomUUID as randomUUID3 } from "node:crypto";
37506
37506
 
37507
+ // packages/core/src/utils/abortController.ts
37508
+ init_esbuild_shims();
37509
+ import { setMaxListeners } from "node:events";
37510
+ var DEFAULT_MAX_LISTENERS = 50;
37511
+ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
37512
+ const controller = new AbortController();
37513
+ setMaxListeners(maxListeners, controller.signal);
37514
+ return controller;
37515
+ }
37516
+ __name(createAbortController, "createAbortController");
37517
+ function asSignal(parent) {
37518
+ if (!parent) return void 0;
37519
+ return parent instanceof AbortController ? parent.signal : parent;
37520
+ }
37521
+ __name(asSignal, "asSignal");
37522
+ function createChildAbortController(parent, maxListeners) {
37523
+ const child = createAbortController(maxListeners);
37524
+ const parentSignal = asSignal(parent);
37525
+ if (!parentSignal) return child;
37526
+ if (parentSignal.aborted) {
37527
+ child.abort(parentSignal.reason);
37528
+ return child;
37529
+ }
37530
+ const weakParent = new WeakRef(parentSignal);
37531
+ const handler = /* @__PURE__ */ __name(() => {
37532
+ child.abort(weakParent.deref()?.reason);
37533
+ }, "handler");
37534
+ parentSignal.addEventListener("abort", handler, { once: true });
37535
+ child.signal.addEventListener(
37536
+ "abort",
37537
+ () => {
37538
+ weakParent.deref()?.removeEventListener("abort", handler);
37539
+ },
37540
+ { once: true }
37541
+ );
37542
+ return child;
37543
+ }
37544
+ __name(createChildAbortController, "createChildAbortController");
37545
+ function combineAbortSignals(signals, options2) {
37546
+ const controller = createAbortController(options2?.maxListeners);
37547
+ const alreadyAborted = signals.find((s) => s?.aborted);
37548
+ if (alreadyAborted) {
37549
+ controller.abort(alreadyAborted.reason);
37550
+ return { signal: controller.signal, cleanup: /* @__PURE__ */ __name(() => {
37551
+ }, "cleanup") };
37552
+ }
37553
+ const cleanups = [];
37554
+ for (const sourceSignal of signals) {
37555
+ if (!sourceSignal) continue;
37556
+ if (sourceSignal.aborted) {
37557
+ controller.abort(sourceSignal.reason);
37558
+ break;
37559
+ }
37560
+ const handler = /* @__PURE__ */ __name(() => controller.abort(sourceSignal.reason), "handler");
37561
+ sourceSignal.addEventListener("abort", handler, { once: true });
37562
+ cleanups.push(() => sourceSignal.removeEventListener("abort", handler));
37563
+ }
37564
+ const timeoutMs = options2?.timeoutMs;
37565
+ if (timeoutMs !== void 0 && timeoutMs > 0 && !controller.signal.aborted) {
37566
+ const timeoutId = setTimeout(() => {
37567
+ controller.abort(new DOMException("Operation timed out", "TimeoutError"));
37568
+ }, timeoutMs);
37569
+ cleanups.push(() => clearTimeout(timeoutId));
37570
+ }
37571
+ let done = false;
37572
+ const cleanup = /* @__PURE__ */ __name(() => {
37573
+ if (done) return;
37574
+ done = true;
37575
+ for (const fn of cleanups) fn();
37576
+ }, "cleanup");
37577
+ if (controller.signal.aborted) {
37578
+ cleanup();
37579
+ } else {
37580
+ controller.signal.addEventListener("abort", cleanup, { once: true });
37581
+ }
37582
+ return { signal: controller.signal, cleanup };
37583
+ }
37584
+ __name(combineAbortSignals, "combineAbortSignals");
37585
+
37507
37586
  // packages/core/src/core/coreToolScheduler.ts
37508
37587
  init_esbuild_shims();
37509
37588
 
@@ -46616,13 +46695,13 @@ var IdeClient = class _IdeClient {
46616
46695
  lockFiles.map(async (file) => {
46617
46696
  const fullPath = path13.join(ideDir, file);
46618
46697
  try {
46619
- const stat15 = await fs13.promises.stat(fullPath);
46698
+ const stat16 = await fs13.promises.stat(fullPath);
46620
46699
  const content = await fs13.promises.readFile(fullPath, "utf8");
46621
46700
  try {
46622
46701
  return {
46623
46702
  file,
46624
46703
  fullPath,
46625
- mtimeMs: stat15.mtimeMs,
46704
+ mtimeMs: stat16.mtimeMs,
46626
46705
  parsed: JSON.parse(content)
46627
46706
  };
46628
46707
  } catch (error) {
@@ -47726,8 +47805,8 @@ var CoreToolScheduler = class {
47726
47805
  if (this.validationRetryCounts.size > 0) {
47727
47806
  const currentToolNames = new Set(requestsToProcess.map((r) => r.name));
47728
47807
  for (const key of [...this.validationRetryCounts.keys()]) {
47729
- const sep17 = key.indexOf(":");
47730
- const toolName = sep17 === -1 ? key : key.slice(0, sep17);
47808
+ const sep16 = key.indexOf(":");
47809
+ const toolName = sep16 === -1 ? key : key.slice(0, sep16);
47731
47810
  if (!currentToolNames.has(toolName)) {
47732
47811
  this.validationRetryCounts.delete(key);
47733
47812
  }
@@ -49434,96 +49513,91 @@ var AgentHeadless = class _AgentHeadless {
49434
49513
  this.terminateMode = "ERROR" /* ERROR */;
49435
49514
  return;
49436
49515
  }
49437
- const abortController = new AbortController();
49438
- const onExternalAbort = /* @__PURE__ */ __name(() => {
49439
- abortController.abort();
49440
- }, "onExternalAbort");
49441
- if (externalSignal) {
49442
- externalSignal.addEventListener("abort", onExternalAbort);
49443
- }
49444
- if (externalSignal?.aborted) {
49445
- abortController.abort();
49446
- }
49447
- const toolsList = await this.core.prepareTools();
49448
- const initialMessages = initialMessagesOverride && initialMessagesOverride.length > 0 ? initialMessagesOverride : [{ role: "user", parts: [{ text: initialTaskText }] }];
49449
- const startTime = Date.now();
49450
- this.core.executionStats.startTimeMs = startTime;
49451
- this.core.stats.start(startTime);
49516
+ const abortController = createChildAbortController(externalSignal);
49452
49517
  try {
49453
- this.core.eventEmitter?.emit("start" /* START */, {
49454
- subagentId: this.core.subagentId,
49455
- name: this.core.name,
49456
- model: this.core.modelConfig.model || this.core.runtimeContext.getModel() || DEFAULT_QWEN_MODEL,
49457
- tools: (this.core.toolConfig?.tools || ["*"]).map(
49458
- (t) => typeof t === "string" ? t : t.name
49459
- ),
49460
- timestamp: Date.now()
49461
- });
49462
- const startEvent = new SubagentExecutionEvent(this.core.name, "started");
49463
- logSubagentExecution(this.core.runtimeContext, startEvent);
49464
- const result = await this.core.runReasoningLoop(
49465
- chat,
49466
- initialMessages,
49467
- toolsList,
49468
- abortController,
49469
- {
49470
- maxTurns: this.core.runConfig.max_turns,
49471
- maxTimeMinutes: this.core.runConfig.max_time_minutes,
49472
- startTimeMs: startTime,
49473
- getExternalMessages: this.externalMessageProvider,
49474
- waitForExternalMessages: this.externalMessageWaiter,
49475
- shouldWaitForExternalMessages: this.externalMessageWaitPredicate
49476
- }
49477
- );
49478
- this.finalText = result.text;
49479
- this.terminateMode = result.terminateMode ?? "GOAL" /* GOAL */;
49480
- } catch (error) {
49481
- debugLogger24.error("Error during subagent execution:", error);
49482
- this.terminateMode = "ERROR" /* ERROR */;
49483
- this.core.eventEmitter?.emit("error" /* ERROR */, {
49484
- subagentId: this.core.subagentId,
49485
- error: error instanceof Error ? error.message : String(error),
49486
- timestamp: Date.now()
49487
- });
49488
- throw error;
49518
+ const toolsList = await this.core.prepareTools();
49519
+ const initialMessages = initialMessagesOverride && initialMessagesOverride.length > 0 ? initialMessagesOverride : [{ role: "user", parts: [{ text: initialTaskText }] }];
49520
+ const startTime = Date.now();
49521
+ this.core.executionStats.startTimeMs = startTime;
49522
+ this.core.stats.start(startTime);
49523
+ try {
49524
+ this.core.eventEmitter?.emit("start" /* START */, {
49525
+ subagentId: this.core.subagentId,
49526
+ name: this.core.name,
49527
+ model: this.core.modelConfig.model || this.core.runtimeContext.getModel() || DEFAULT_QWEN_MODEL,
49528
+ tools: (this.core.toolConfig?.tools || ["*"]).map(
49529
+ (t) => typeof t === "string" ? t : t.name
49530
+ ),
49531
+ timestamp: Date.now()
49532
+ });
49533
+ const startEvent = new SubagentExecutionEvent(
49534
+ this.core.name,
49535
+ "started"
49536
+ );
49537
+ logSubagentExecution(this.core.runtimeContext, startEvent);
49538
+ const result = await this.core.runReasoningLoop(
49539
+ chat,
49540
+ initialMessages,
49541
+ toolsList,
49542
+ abortController,
49543
+ {
49544
+ maxTurns: this.core.runConfig.max_turns,
49545
+ maxTimeMinutes: this.core.runConfig.max_time_minutes,
49546
+ startTimeMs: startTime,
49547
+ getExternalMessages: this.externalMessageProvider,
49548
+ waitForExternalMessages: this.externalMessageWaiter,
49549
+ shouldWaitForExternalMessages: this.externalMessageWaitPredicate
49550
+ }
49551
+ );
49552
+ this.finalText = result.text;
49553
+ this.terminateMode = result.terminateMode ?? "GOAL" /* GOAL */;
49554
+ } catch (error) {
49555
+ debugLogger24.error("Error during subagent execution:", error);
49556
+ this.terminateMode = "ERROR" /* ERROR */;
49557
+ this.core.eventEmitter?.emit("error" /* ERROR */, {
49558
+ subagentId: this.core.subagentId,
49559
+ error: error instanceof Error ? error.message : String(error),
49560
+ timestamp: Date.now()
49561
+ });
49562
+ throw error;
49563
+ } finally {
49564
+ this.core.executionStats.totalDurationMs = Date.now() - startTime;
49565
+ const summary = this.core.stats.getSummary(Date.now());
49566
+ this.core.eventEmitter?.emit("finish" /* FINISH */, {
49567
+ subagentId: this.core.subagentId,
49568
+ terminateReason: this.terminateMode,
49569
+ timestamp: Date.now(),
49570
+ rounds: summary.rounds,
49571
+ totalDurationMs: summary.totalDurationMs,
49572
+ totalToolCalls: summary.totalToolCalls,
49573
+ successfulToolCalls: summary.successfulToolCalls,
49574
+ failedToolCalls: summary.failedToolCalls,
49575
+ inputTokens: summary.inputTokens,
49576
+ outputTokens: summary.outputTokens,
49577
+ totalTokens: summary.totalTokens
49578
+ });
49579
+ const completionEvent = new SubagentExecutionEvent(
49580
+ this.core.name,
49581
+ this.terminateMode === "GOAL" /* GOAL */ ? "completed" : "failed",
49582
+ {
49583
+ terminate_reason: this.terminateMode,
49584
+ result: this.finalText,
49585
+ execution_summary: this.core.stats.formatCompact(
49586
+ "Subagent execution completed"
49587
+ )
49588
+ }
49589
+ );
49590
+ logSubagentExecution(this.core.runtimeContext, completionEvent);
49591
+ await this.core.hooks?.onStop?.({
49592
+ subagentId: this.core.subagentId,
49593
+ name: this.core.name,
49594
+ terminateReason: this.terminateMode,
49595
+ summary,
49596
+ timestamp: Date.now()
49597
+ });
49598
+ }
49489
49599
  } finally {
49490
- if (externalSignal) {
49491
- externalSignal.removeEventListener("abort", onExternalAbort);
49492
- }
49493
- this.core.executionStats.totalDurationMs = Date.now() - startTime;
49494
- const summary = this.core.stats.getSummary(Date.now());
49495
- this.core.eventEmitter?.emit("finish" /* FINISH */, {
49496
- subagentId: this.core.subagentId,
49497
- terminateReason: this.terminateMode,
49498
- timestamp: Date.now(),
49499
- rounds: summary.rounds,
49500
- totalDurationMs: summary.totalDurationMs,
49501
- totalToolCalls: summary.totalToolCalls,
49502
- successfulToolCalls: summary.successfulToolCalls,
49503
- failedToolCalls: summary.failedToolCalls,
49504
- inputTokens: summary.inputTokens,
49505
- outputTokens: summary.outputTokens,
49506
- totalTokens: summary.totalTokens
49507
- });
49508
- const completionEvent = new SubagentExecutionEvent(
49509
- this.core.name,
49510
- this.terminateMode === "GOAL" /* GOAL */ ? "completed" : "failed",
49511
- {
49512
- terminate_reason: this.terminateMode,
49513
- result: this.finalText,
49514
- execution_summary: this.core.stats.formatCompact(
49515
- "Subagent execution completed"
49516
- )
49517
- }
49518
- );
49519
- logSubagentExecution(this.core.runtimeContext, completionEvent);
49520
- await this.core.hooks?.onStop?.({
49521
- subagentId: this.core.subagentId,
49522
- name: this.core.name,
49523
- terminateReason: this.terminateMode,
49524
- summary,
49525
- timestamp: Date.now()
49526
- });
49600
+ abortController.abort();
49527
49601
  }
49528
49602
  }
49529
49603
  // ─── Accessors ─────────────────────────────────────────────
@@ -49864,203 +49938,199 @@ var AgentCore = class {
49864
49938
  terminateMode = "TIMEOUT" /* TIMEOUT */;
49865
49939
  break;
49866
49940
  }
49867
- const roundAbortController = new AbortController();
49868
- const onParentAbort = /* @__PURE__ */ __name(() => roundAbortController.abort(), "onParentAbort");
49869
- abortController.signal.addEventListener("abort", onParentAbort);
49870
- if (abortController.signal.aborted) {
49871
- roundAbortController.abort();
49872
- }
49873
- const promptId = `${this.runtimeContext.getSessionId()}#${this.subagentId}#${turnCounter++}`;
49874
- const messageParams = {
49875
- message: currentMessages[0]?.parts || [],
49876
- config: {
49877
- abortSignal: roundAbortController.signal,
49878
- tools: [{ functionDeclarations: toolsList }]
49879
- }
49880
- };
49881
- const roundStreamStart = Date.now();
49882
- const responseStream = await chat.sendMessageStream(
49883
- this.modelConfig.model || this.runtimeContext.getModel() || DEFAULT_QWEN_MODEL,
49884
- messageParams,
49885
- promptId
49886
- );
49887
- this.eventEmitter?.emit("round_start" /* ROUND_START */, {
49888
- subagentId: this.subagentId,
49889
- round: turnCounter,
49890
- promptId,
49891
- timestamp: Date.now()
49892
- });
49893
- const functionCalls = [];
49894
- let roundText = "";
49895
- let roundThoughtText = "";
49896
- let lastUsage = void 0;
49897
- let currentResponseId = void 0;
49898
- let wasOutputTruncated = false;
49899
- for await (const streamEvent of responseStream) {
49900
- if (roundAbortController.signal.aborted) {
49901
- abortController.signal.removeEventListener("abort", onParentAbort);
49902
- return {
49903
- text: finalText,
49904
- terminateMode: "CANCELLED" /* CANCELLED */,
49905
- turnsUsed: turnCounter
49906
- };
49907
- }
49908
- if (streamEvent.type === "retry") {
49909
- functionCalls.length = 0;
49910
- roundText = "";
49911
- roundThoughtText = "";
49912
- lastUsage = void 0;
49913
- currentResponseId = void 0;
49914
- wasOutputTruncated = false;
49915
- continue;
49916
- }
49917
- if (streamEvent.type === "compressed") {
49918
- this.runtimeContext.getDebugLogger().debug(
49919
- `[AGENT-COMPACT] subagent=${this.subagentId} round=${turnCounter} tokens ${streamEvent.info.originalTokenCount} -> ${streamEvent.info.newTokenCount}`
49920
- );
49921
- continue;
49922
- }
49923
- if (streamEvent.type === "chunk") {
49924
- const resp = streamEvent.value;
49925
- if (resp.responseId) {
49926
- currentResponseId = resp.responseId;
49927
- }
49928
- if (resp.functionCalls) functionCalls.push(...resp.functionCalls);
49929
- if (resp.candidates?.[0]?.finishReason === FinishReason.MAX_TOKENS) {
49930
- wasOutputTruncated = true;
49931
- }
49932
- const content = resp.candidates?.[0]?.content;
49933
- const parts2 = content?.parts || [];
49934
- for (const p of parts2) {
49935
- const txt = p.text;
49936
- const isThought = p.thought ?? false;
49937
- if (txt && isThought) roundThoughtText += txt;
49938
- if (txt && !isThought) roundText += txt;
49939
- if (txt)
49940
- this.eventEmitter?.emit("stream_text" /* STREAM_TEXT */, {
49941
- subagentId: this.subagentId,
49942
- round: turnCounter,
49943
- text: txt,
49944
- thought: isThought,
49945
- timestamp: Date.now()
49946
- });
49941
+ const roundAbortController = createChildAbortController(abortController);
49942
+ try {
49943
+ const promptId = `${this.runtimeContext.getSessionId()}#${this.subagentId}#${turnCounter++}`;
49944
+ const messageParams = {
49945
+ message: currentMessages[0]?.parts || [],
49946
+ config: {
49947
+ abortSignal: roundAbortController.signal,
49948
+ tools: [{ functionDeclarations: toolsList }]
49947
49949
  }
49948
- if (resp.usageMetadata) lastUsage = resp.usageMetadata;
49949
- }
49950
- }
49951
- if (roundText || roundThoughtText) {
49952
- this.eventEmitter?.emit("round_text" /* ROUND_TEXT */, {
49950
+ };
49951
+ const roundStreamStart = Date.now();
49952
+ const responseStream = await chat.sendMessageStream(
49953
+ this.modelConfig.model || this.runtimeContext.getModel() || DEFAULT_QWEN_MODEL,
49954
+ messageParams,
49955
+ promptId
49956
+ );
49957
+ this.eventEmitter?.emit("round_start" /* ROUND_START */, {
49953
49958
  subagentId: this.subagentId,
49954
49959
  round: turnCounter,
49955
- text: roundText,
49956
- thoughtText: roundThoughtText,
49960
+ promptId,
49957
49961
  timestamp: Date.now()
49958
49962
  });
49959
- }
49960
- this.executionStats.rounds = turnCounter;
49961
- this.stats.setRounds(turnCounter);
49962
- durationMin = (Date.now() - startTime) / (1e3 * 60);
49963
- if (options2?.maxTimeMinutes && durationMin >= options2.maxTimeMinutes) {
49964
- abortController.signal.removeEventListener("abort", onParentAbort);
49965
- terminateMode = "TIMEOUT" /* TIMEOUT */;
49966
- break;
49967
- }
49968
- if (lastUsage) {
49969
- this.recordTokenUsage(lastUsage, turnCounter, roundStreamStart);
49970
- }
49971
- if (functionCalls.length > 0) {
49972
- currentMessages = await this.processFunctionCalls(
49973
- functionCalls,
49974
- roundAbortController,
49975
- promptId,
49976
- turnCounter,
49977
- toolsList,
49978
- currentResponseId,
49979
- wasOutputTruncated
49980
- );
49981
- const externalInputs = this.drainExternalInputs(options2);
49982
- if (externalInputs.length > 0) {
49983
- const last2 = currentMessages[currentMessages.length - 1];
49984
- last2.parts.push(...this.externalInputsToParts(externalInputs, true));
49985
- this.emitExternalInputEvents(externalInputs);
49963
+ const functionCalls = [];
49964
+ let roundText = "";
49965
+ let roundThoughtText = "";
49966
+ let lastUsage = void 0;
49967
+ let currentResponseId = void 0;
49968
+ let wasOutputTruncated = false;
49969
+ for await (const streamEvent of responseStream) {
49970
+ if (roundAbortController.signal.aborted) {
49971
+ return {
49972
+ text: finalText,
49973
+ terminateMode: "CANCELLED" /* CANCELLED */,
49974
+ turnsUsed: turnCounter
49975
+ };
49976
+ }
49977
+ if (streamEvent.type === "retry") {
49978
+ functionCalls.length = 0;
49979
+ roundText = "";
49980
+ roundThoughtText = "";
49981
+ lastUsage = void 0;
49982
+ currentResponseId = void 0;
49983
+ wasOutputTruncated = false;
49984
+ continue;
49985
+ }
49986
+ if (streamEvent.type === "compressed") {
49987
+ this.runtimeContext.getDebugLogger().debug(
49988
+ `[AGENT-COMPACT] subagent=${this.subagentId} round=${turnCounter} tokens ${streamEvent.info.originalTokenCount} -> ${streamEvent.info.newTokenCount}`
49989
+ );
49990
+ continue;
49991
+ }
49992
+ if (streamEvent.type === "chunk") {
49993
+ const resp = streamEvent.value;
49994
+ if (resp.responseId) {
49995
+ currentResponseId = resp.responseId;
49996
+ }
49997
+ if (resp.functionCalls) functionCalls.push(...resp.functionCalls);
49998
+ if (resp.candidates?.[0]?.finishReason === FinishReason.MAX_TOKENS) {
49999
+ wasOutputTruncated = true;
50000
+ }
50001
+ const content = resp.candidates?.[0]?.content;
50002
+ const parts2 = content?.parts || [];
50003
+ for (const p of parts2) {
50004
+ const txt = p.text;
50005
+ const isThought = p.thought ?? false;
50006
+ if (txt && isThought) roundThoughtText += txt;
50007
+ if (txt && !isThought) roundText += txt;
50008
+ if (txt)
50009
+ this.eventEmitter?.emit("stream_text" /* STREAM_TEXT */, {
50010
+ subagentId: this.subagentId,
50011
+ round: turnCounter,
50012
+ text: txt,
50013
+ thought: isThought,
50014
+ timestamp: Date.now()
50015
+ });
50016
+ }
50017
+ if (resp.usageMetadata) lastUsage = resp.usageMetadata;
50018
+ }
49986
50019
  }
49987
- } else {
49988
- const immediateExternalInputs = this.drainExternalInputs(options2);
49989
- if (immediateExternalInputs.length > 0) {
49990
- currentMessages = this.externalInputsToContent(
49991
- immediateExternalInputs
49992
- );
49993
- this.emitExternalInputEvents(immediateExternalInputs);
49994
- } else if (options2?.shouldWaitForExternalMessages?.()) {
49995
- this.eventEmitter?.emit("round_end" /* ROUND_END */, {
50020
+ if (roundText || roundThoughtText) {
50021
+ this.eventEmitter?.emit("round_text" /* ROUND_TEXT */, {
49996
50022
  subagentId: this.subagentId,
49997
50023
  round: turnCounter,
49998
- promptId,
50024
+ text: roundText,
50025
+ thoughtText: roundThoughtText,
49999
50026
  timestamp: Date.now()
50000
50027
  });
50001
- abortController.signal.removeEventListener("abort", onParentAbort);
50002
- const waitResult = await this.waitForExternalInputs(
50003
- options2,
50004
- abortController,
50005
- startTime,
50006
- turnCounter
50028
+ }
50029
+ this.executionStats.rounds = turnCounter;
50030
+ this.stats.setRounds(turnCounter);
50031
+ durationMin = (Date.now() - startTime) / (1e3 * 60);
50032
+ if (options2?.maxTimeMinutes && durationMin >= options2.maxTimeMinutes) {
50033
+ terminateMode = "TIMEOUT" /* TIMEOUT */;
50034
+ break;
50035
+ }
50036
+ if (lastUsage) {
50037
+ this.recordTokenUsage(lastUsage, turnCounter, roundStreamStart);
50038
+ }
50039
+ if (functionCalls.length > 0) {
50040
+ currentMessages = await this.processFunctionCalls(
50041
+ functionCalls,
50042
+ roundAbortController,
50043
+ promptId,
50044
+ turnCounter,
50045
+ toolsList,
50046
+ currentResponseId,
50047
+ wasOutputTruncated
50007
50048
  );
50008
- if (waitResult.terminateMode) {
50009
- finalText = roundText.trim();
50010
- terminateMode = waitResult.terminateMode;
50011
- break;
50012
- }
50013
- if (waitResult.inputs.length > 0) {
50014
- currentMessages = this.externalInputsToContent(waitResult.inputs);
50015
- this.emitExternalInputEvents(waitResult.inputs);
50016
- continue;
50017
- }
50018
- if (roundText && roundText.trim().length > 0) {
50019
- finalText = roundText.trim();
50020
- break;
50049
+ const externalInputs = this.drainExternalInputs(options2);
50050
+ if (externalInputs.length > 0) {
50051
+ const last2 = currentMessages[currentMessages.length - 1];
50052
+ last2.parts.push(
50053
+ ...this.externalInputsToParts(externalInputs, true)
50054
+ );
50055
+ this.emitExternalInputEvents(externalInputs);
50021
50056
  }
50022
- currentMessages = [
50023
- {
50024
- role: "user",
50025
- parts: [
50026
- {
50027
- text: "Please provide the final result now and stop calling tools."
50028
- }
50029
- ]
50030
- }
50031
- ];
50032
- continue;
50033
50057
  } else {
50034
- if (roundText && roundText.trim().length > 0) {
50035
- finalText = roundText.trim();
50058
+ const immediateExternalInputs = this.drainExternalInputs(options2);
50059
+ if (immediateExternalInputs.length > 0) {
50060
+ currentMessages = this.externalInputsToContent(
50061
+ immediateExternalInputs
50062
+ );
50063
+ this.emitExternalInputEvents(immediateExternalInputs);
50064
+ } else if (options2?.shouldWaitForExternalMessages?.()) {
50036
50065
  this.eventEmitter?.emit("round_end" /* ROUND_END */, {
50037
50066
  subagentId: this.subagentId,
50038
50067
  round: turnCounter,
50039
50068
  promptId,
50040
50069
  timestamp: Date.now()
50041
50070
  });
50042
- abortController.signal.removeEventListener("abort", onParentAbort);
50043
- break;
50044
- }
50045
- currentMessages = [
50046
- {
50047
- role: "user",
50048
- parts: [
50049
- {
50050
- text: "Please provide the final result now and stop calling tools."
50051
- }
50052
- ]
50071
+ const waitResult = await this.waitForExternalInputs(
50072
+ options2,
50073
+ abortController,
50074
+ startTime,
50075
+ turnCounter
50076
+ );
50077
+ if (waitResult.terminateMode) {
50078
+ finalText = roundText.trim();
50079
+ terminateMode = waitResult.terminateMode;
50080
+ break;
50053
50081
  }
50054
- ];
50082
+ if (waitResult.inputs.length > 0) {
50083
+ currentMessages = this.externalInputsToContent(waitResult.inputs);
50084
+ this.emitExternalInputEvents(waitResult.inputs);
50085
+ continue;
50086
+ }
50087
+ if (roundText && roundText.trim().length > 0) {
50088
+ finalText = roundText.trim();
50089
+ break;
50090
+ }
50091
+ currentMessages = [
50092
+ {
50093
+ role: "user",
50094
+ parts: [
50095
+ {
50096
+ text: "Please provide the final result now and stop calling tools."
50097
+ }
50098
+ ]
50099
+ }
50100
+ ];
50101
+ continue;
50102
+ } else {
50103
+ if (roundText && roundText.trim().length > 0) {
50104
+ finalText = roundText.trim();
50105
+ this.eventEmitter?.emit("round_end" /* ROUND_END */, {
50106
+ subagentId: this.subagentId,
50107
+ round: turnCounter,
50108
+ promptId,
50109
+ timestamp: Date.now()
50110
+ });
50111
+ break;
50112
+ }
50113
+ currentMessages = [
50114
+ {
50115
+ role: "user",
50116
+ parts: [
50117
+ {
50118
+ text: "Please provide the final result now and stop calling tools."
50119
+ }
50120
+ ]
50121
+ }
50122
+ ];
50123
+ }
50055
50124
  }
50125
+ this.eventEmitter?.emit("round_end" /* ROUND_END */, {
50126
+ subagentId: this.subagentId,
50127
+ round: turnCounter,
50128
+ promptId,
50129
+ timestamp: Date.now()
50130
+ });
50131
+ } finally {
50132
+ roundAbortController.abort();
50056
50133
  }
50057
- this.eventEmitter?.emit("round_end" /* ROUND_END */, {
50058
- subagentId: this.subagentId,
50059
- round: turnCounter,
50060
- promptId,
50061
- timestamp: Date.now()
50062
- });
50063
- abortController.signal.removeEventListener("abort", onParentAbort);
50064
50134
  }
50065
50135
  return {
50066
50136
  text: finalText,
@@ -50128,12 +50198,7 @@ ${text}` : text;
50128
50198
  if (!options2.shouldWaitForExternalMessages?.()) {
50129
50199
  return { inputs: [] };
50130
50200
  }
50131
- const waitAbortController = new AbortController();
50132
- const onAbort = /* @__PURE__ */ __name(() => waitAbortController.abort(), "onAbort");
50133
- abortController.signal.addEventListener("abort", onAbort, { once: true });
50134
- if (abortController.signal.aborted) {
50135
- waitAbortController.abort();
50136
- }
50201
+ const waitAbortController = createChildAbortController(abortController);
50137
50202
  let timedOut = false;
50138
50203
  let timeout;
50139
50204
  if (remainingTimeMs !== void 0) {
@@ -50169,7 +50234,7 @@ ${text}` : text;
50169
50234
  throw error;
50170
50235
  } finally {
50171
50236
  if (timeout) clearTimeout(timeout);
50172
- abortController.signal.removeEventListener("abort", onAbort);
50237
+ waitAbortController.abort();
50173
50238
  }
50174
50239
  }
50175
50240
  }
@@ -50420,12 +50485,15 @@ ${text}` : text;
50420
50485
  }
50421
50486
  }, "onAbort");
50422
50487
  abortController.signal.addEventListener("abort", onAbort, { once: true });
50423
- if (abortController.signal.aborted) {
50424
- onAbort();
50488
+ try {
50489
+ if (abortController.signal.aborted) {
50490
+ onAbort();
50491
+ }
50492
+ await scheduler.schedule(requests, abortController.signal);
50493
+ await batchDone;
50494
+ } finally {
50495
+ abortController.signal.removeEventListener("abort", onAbort);
50425
50496
  }
50426
- await scheduler.schedule(requests, abortController.signal);
50427
- await batchDone;
50428
- abortController.signal.removeEventListener("abort", onAbort);
50429
50497
  }
50430
50498
  if (functionCalls.length > 0 && toolResponseParts.length === 0) {
50431
50499
  toolResponseParts.push({
@@ -55625,8 +55693,8 @@ async function writeWorktreeSessionMarker(worktreePath, sessionId) {
55625
55693
  }
55626
55694
  const rule = WORKTREE_SESSION_FILE;
55627
55695
  if (!existing.split(/\r?\n/).includes(rule)) {
55628
- const sep17 = existing.length === 0 || existing.endsWith("\n") ? "" : "\n";
55629
- await fs15.writeFile(excludePath, `${existing}${sep17}${rule}
55696
+ const sep16 = existing.length === 0 || existing.endsWith("\n") ? "" : "\n";
55697
+ await fs15.writeFile(excludePath, `${existing}${sep16}${rule}
55630
55698
  `, "utf8");
55631
55699
  }
55632
55700
  } catch {
@@ -57097,8 +57165,8 @@ var WorkspaceContext = class _WorkspaceContext {
57097
57165
  }
57098
57166
  };
57099
57167
  function isPathWithinRoot(pathToCheck, rootDirectory) {
57100
- const relative13 = path19.relative(rootDirectory, pathToCheck);
57101
- return !relative13.startsWith(`..${path19.sep}`) && relative13 !== ".." && !path19.isAbsolute(relative13);
57168
+ const relative12 = path19.relative(rootDirectory, pathToCheck);
57169
+ return !relative12.startsWith(`..${path19.sep}`) && relative12 !== ".." && !path19.isAbsolute(relative12);
57102
57170
  }
57103
57171
  __name(isPathWithinRoot, "isPathWithinRoot");
57104
57172
 
@@ -60505,7 +60573,7 @@ var AgentInteractive = class {
60505
60573
  error;
60506
60574
  lastRoundError;
60507
60575
  executionPromise;
60508
- masterAbortController = new AbortController();
60576
+ masterAbortController = createAbortController();
60509
60577
  roundAbortController;
60510
60578
  chat;
60511
60579
  toolsList = [];
@@ -60586,12 +60654,9 @@ var AgentInteractive = class {
60586
60654
  this.setStatus("running" /* RUNNING */);
60587
60655
  this.lastRoundError = void 0;
60588
60656
  this.roundCancelledByUser = false;
60589
- this.roundAbortController = new AbortController();
60590
- const onMasterAbort = /* @__PURE__ */ __name(() => this.roundAbortController?.abort(), "onMasterAbort");
60591
- this.masterAbortController.signal.addEventListener("abort", onMasterAbort);
60592
- if (this.masterAbortController.signal.aborted) {
60593
- this.roundAbortController.abort();
60594
- }
60657
+ this.roundAbortController = createChildAbortController(
60658
+ this.masterAbortController
60659
+ );
60595
60660
  try {
60596
60661
  const initialMessages = [
60597
60662
  { role: "user", parts: [{ text: message }] }
@@ -60620,10 +60685,7 @@ var AgentInteractive = class {
60620
60685
  debugLogger33.error("AgentInteractive round error:", err2);
60621
60686
  this.addMessage("info", errorMessage, { metadata: { level: "error" } });
60622
60687
  } finally {
60623
- this.masterAbortController.signal.removeEventListener(
60624
- "abort",
60625
- onMasterAbort
60626
- );
60688
+ this.roundAbortController?.abort();
60627
60689
  this.roundAbortController = void 0;
60628
60690
  }
60629
60691
  }
@@ -66667,6 +66729,7 @@ init_esbuild_shims();
66667
66729
  import * as path28 from "node:path";
66668
66730
  import * as fs30 from "node:fs/promises";
66669
66731
  var PROJECT_SKILLS_RELATIVE_DIR = path28.join(".qwen", "skills");
66732
+ var SKILL_FILE_NAME = "SKILL.md";
66670
66733
  function getProjectSkillsRoot(projectRoot) {
66671
66734
  return path28.join(projectRoot, PROJECT_SKILLS_RELATIVE_DIR);
66672
66735
  }
@@ -66778,8 +66841,7 @@ async function evaluateScopedDecision3(ctx, projectRoot) {
66778
66841
  }
66779
66842
  return "deny";
66780
66843
  }
66781
- case ToolNames.EDIT:
66782
- case ToolNames.WRITE_FILE: {
66844
+ case ToolNames.EDIT: {
66783
66845
  if (!ctx.filePath || !isProjectSkillPath(ctx.filePath, projectRoot)) {
66784
66846
  return "deny";
66785
66847
  }
@@ -66794,6 +66856,26 @@ async function evaluateScopedDecision3(ctx, projectRoot) {
66794
66856
  }
66795
66857
  return sourceFlag ? "allow" : "deny";
66796
66858
  }
66859
+ case ToolNames.WRITE_FILE: {
66860
+ if (!ctx.filePath || !isProjectSkillPath(ctx.filePath, projectRoot)) {
66861
+ return "deny";
66862
+ }
66863
+ if (path29.basename(ctx.filePath) !== SKILL_FILE_NAME) {
66864
+ return "deny";
66865
+ }
66866
+ try {
66867
+ await assertRealProjectSkillPath(ctx.filePath, projectRoot);
66868
+ } catch {
66869
+ return "deny";
66870
+ }
66871
+ try {
66872
+ await fs31.stat(ctx.filePath);
66873
+ return "deny";
66874
+ } catch (err2) {
66875
+ if (err2.code === "ENOENT") return "allow";
66876
+ return "deny";
66877
+ }
66878
+ }
66797
66879
  default:
66798
66880
  return "default";
66799
66881
  }
@@ -66808,7 +66890,7 @@ function getScopedDenyRule3(ctx, projectRoot) {
66808
66890
  case ToolNames.EDIT:
66809
66891
  return `ManagedSkillReview(edit: only within ${getProjectSkillsRoot(projectRoot)} and only on skills with 'source: auto-skill' in frontmatter)`;
66810
66892
  case ToolNames.WRITE_FILE:
66811
- return `ManagedSkillReview(write_file: only within ${getProjectSkillsRoot(projectRoot)}; existing files must have 'source: auto-skill' in frontmatter)`;
66893
+ return `ManagedSkillReview(write_file: only within ${getProjectSkillsRoot(projectRoot)} and only to a path that does not yet exist \u2014 use a different skill name like \`<name>-2\`, or use \`edit\` to update an existing auto-skill)`;
66812
66894
  default:
66813
66895
  return void 0;
66814
66896
  }
@@ -66877,10 +66959,36 @@ function buildAgentHistory2(history) {
66877
66959
  ];
66878
66960
  }
66879
66961
  __name(buildAgentHistory2, "buildAgentHistory");
66880
- function buildTaskPrompt2(skillsRoot) {
66962
+ async function listExistingSkillDirNames(projectRoot) {
66963
+ const skillsRoot = getProjectSkillsRoot(projectRoot);
66964
+ let entries;
66965
+ try {
66966
+ entries = await fs31.readdir(skillsRoot, { withFileTypes: true });
66967
+ } catch {
66968
+ return [];
66969
+ }
66970
+ const names = [];
66971
+ for (const entry of entries) {
66972
+ if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;
66973
+ try {
66974
+ await fs31.stat(path29.join(skillsRoot, entry.name, SKILL_FILE_NAME));
66975
+ names.push(entry.name);
66976
+ } catch {
66977
+ }
66978
+ }
66979
+ names.sort();
66980
+ return names;
66981
+ }
66982
+ __name(listExistingSkillDirNames, "listExistingSkillDirNames");
66983
+ async function buildTaskPrompt2(projectRoot) {
66984
+ const skillsRoot = getProjectSkillsRoot(projectRoot);
66985
+ const existing = await listExistingSkillDirNames(projectRoot);
66986
+ const existingLine = existing.length === 0 ? "(no skills exist yet \u2014 any name is available)" : `Existing skill names (do NOT reuse for write_file; use \`edit\` if you want to update one of these): ${existing.join(", ")}`;
66881
66987
  return [
66882
66988
  `Project skills directory: \`${skillsRoot}\``,
66883
66989
  "",
66990
+ existingLine,
66991
+ "",
66884
66992
  "Use `ls` and `read_file` to inspect existing skills before writing.",
66885
66993
  "Use `write_file` to create a new skill, `edit` to update an existing auto-skill.",
66886
66994
  "Each skill lives at .qwen/skills/<name>/SKILL.md. Skills you create MUST include 'source: auto-skill' in the frontmatter:",
@@ -66897,7 +67005,6 @@ function buildTaskPrompt2(skillsRoot) {
66897
67005
  }
66898
67006
  __name(buildTaskPrompt2, "buildTaskPrompt");
66899
67007
  async function runSkillReviewByAgent(params) {
66900
- const skillsRoot = getProjectSkillsRoot(params.projectRoot);
66901
67008
  const scopedConfig = createSkillScopedAgentConfig(
66902
67009
  params.config,
66903
67010
  params.projectRoot
@@ -66905,7 +67012,7 @@ async function runSkillReviewByAgent(params) {
66905
67012
  const result = await runForkedAgent({
66906
67013
  name: SKILL_REVIEW_AGENT_NAME,
66907
67014
  config: scopedConfig,
66908
- taskPrompt: buildTaskPrompt2(skillsRoot),
67015
+ taskPrompt: await buildTaskPrompt2(params.projectRoot),
66909
67016
  systemPrompt: SKILL_REVIEW_SYSTEM_PROMPT,
66910
67017
  maxTurns: params.maxTurns ?? DEFAULT_AUTO_SKILL_MAX_TURNS,
66911
67018
  maxTimeMinutes: (params.timeoutMs ?? DEFAULT_AUTO_SKILL_TIMEOUT_MS) / 6e4,
@@ -69279,16 +69386,16 @@ import {
69279
69386
  mkdir as mkdir6,
69280
69387
  open as open2,
69281
69388
  readFile as readFile15,
69282
- stat as stat6,
69389
+ stat as stat7,
69283
69390
  unlink as unlink4
69284
69391
  } from "node:fs/promises";
69285
- import { dirname as dirname9, isAbsolute as isAbsolute6, join as join20, relative as relative5, sep as sep9 } from "node:path";
69392
+ import { dirname as dirname9, isAbsolute as isAbsolute6, join as join21, relative as relative5, sep as sep9 } from "node:path";
69286
69393
 
69287
69394
  // packages/core/src/utils/gitDiff.ts
69288
69395
  init_esbuild_shims();
69289
69396
  import { execFile as execFile2 } from "node:child_process";
69290
69397
  import * as nodeFs from "node:fs";
69291
- import { access as access3, lstat as lstat3, open, readFile as readFile14, stat as stat5 } from "node:fs/promises";
69398
+ import { access as access3, lstat as lstat3, open, readFile as readFile14, stat as stat6 } from "node:fs/promises";
69292
69399
  import * as path31 from "node:path";
69293
69400
  import { promisify as promisify2 } from "node:util";
69294
69401
  var execFileAsync2 = promisify2(execFile2);
@@ -69764,7 +69871,7 @@ __name(resolveGitDir, "resolveGitDir");
69764
69871
  async function resolveGitDirFromRoot(gitRoot) {
69765
69872
  const dotGit = path31.join(gitRoot, ".git");
69766
69873
  try {
69767
- const s = await stat5(dotGit);
69874
+ const s = await stat6(dotGit);
69768
69875
  if (s.isDirectory()) return dotGit;
69769
69876
  if (!s.isFile()) return null;
69770
69877
  const content = await readFile14(dotGit, "utf8");
@@ -69838,7 +69945,7 @@ function isENOENT(e) {
69838
69945
  __name(isENOENT, "isENOENT");
69839
69946
  async function pathExists(filePath) {
69840
69947
  try {
69841
- await stat6(filePath);
69948
+ await stat7(filePath);
69842
69949
  return true;
69843
69950
  } catch {
69844
69951
  return false;
@@ -69859,7 +69966,7 @@ function getBackupFileName(filePath, version) {
69859
69966
  }
69860
69967
  __name(getBackupFileName, "getBackupFileName");
69861
69968
  function resolveBackupPath(backupFileName, sessionId) {
69862
- return join20(
69969
+ return join21(
69863
69970
  Storage.getGlobalQwenDir(),
69864
69971
  FILE_HISTORY_DIR,
69865
69972
  sessionId,
@@ -69885,7 +69992,7 @@ async function createBackup(filePath, version, sessionId) {
69885
69992
  const backupPath = resolveBackupPath(backupFileName, sessionId);
69886
69993
  let srcStats;
69887
69994
  try {
69888
- srcStats = await stat6(filePath);
69995
+ srcStats = await stat7(filePath);
69889
69996
  } catch (e) {
69890
69997
  if (isENOENT(e)) {
69891
69998
  return { backupFileName: null, version, backupTime: /* @__PURE__ */ new Date() };
@@ -69904,7 +70011,7 @@ async function restoreBackup(filePath, backupFileName, sessionId) {
69904
70011
  const backupPath = resolveBackupPath(backupFileName, sessionId);
69905
70012
  let backupStats;
69906
70013
  try {
69907
- backupStats = await stat6(backupPath);
70014
+ backupStats = await stat7(backupPath);
69908
70015
  } catch (e) {
69909
70016
  if (isENOENT(e)) {
69910
70017
  debugLogger44.error(`FileHistory: Backup file not found: ${backupPath}`);
@@ -69928,14 +70035,14 @@ async function checkOriginFileChanged(originalFile, backupFileName, sessionId, o
69928
70035
  let originalStats = originalStatsHint ?? null;
69929
70036
  if (!originalStats) {
69930
70037
  try {
69931
- originalStats = await stat6(originalFile);
70038
+ originalStats = await stat7(originalFile);
69932
70039
  } catch (e) {
69933
70040
  if (!isENOENT(e)) return true;
69934
70041
  }
69935
70042
  }
69936
70043
  let backupStats;
69937
70044
  try {
69938
- backupStats = await stat6(backupPath);
70045
+ backupStats = await stat7(backupPath);
69939
70046
  } catch {
69940
70047
  return true;
69941
70048
  }
@@ -70128,7 +70235,7 @@ var FileHistoryService = class {
70128
70235
  const nextVersion = this.getMaxVersion(trackingPath) + 1;
70129
70236
  let fileStats;
70130
70237
  try {
70131
- fileStats = await stat6(filePath);
70238
+ fileStats = await stat7(filePath);
70132
70239
  } catch (e) {
70133
70240
  if (!isENOENT(e)) throw e;
70134
70241
  }
@@ -70564,7 +70671,7 @@ var FileHistoryService = class {
70564
70671
  }
70565
70672
  maybeExpandFilePath(filePath) {
70566
70673
  if (isAbsolute6(filePath)) return filePath;
70567
- return join20(this.cwd, filePath);
70674
+ return join21(this.cwd, filePath);
70568
70675
  }
70569
70676
  };
70570
70677
 
@@ -73323,7 +73430,7 @@ import { posix as posix3, win32 } from "node:path";
73323
73430
  import { fileURLToPath as fileURLToPath3 } from "node:url";
73324
73431
  import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync as readlinkSync2, realpathSync as rps } from "fs";
73325
73432
  import * as actualFS from "node:fs";
73326
- import { lstat as lstat4, readdir as readdir6, readlink as readlink2, realpath as realpath3 } from "node:fs/promises";
73433
+ import { lstat as lstat4, readdir as readdir7, readlink as readlink2, realpath as realpath3 } from "node:fs/promises";
73327
73434
 
73328
73435
  // node_modules/minipass/dist/esm/index.js
73329
73436
  init_esbuild_shims();
@@ -74223,7 +74330,7 @@ var defaultFS = {
74223
74330
  realpathSync: realpathSync4,
74224
74331
  promises: {
74225
74332
  lstat: lstat4,
74226
- readdir: readdir6,
74333
+ readdir: readdir7,
74227
74334
  readlink: readlink2,
74228
74335
  realpath: realpath3
74229
74336
  }
@@ -75348,7 +75455,7 @@ var PathScurryBase = class {
75348
75455
  *
75349
75456
  * @internal
75350
75457
  */
75351
- constructor(cwd2 = process.cwd(), pathImpl, sep17, { nocase, childrenCacheSize = 16 * 1024, fs: fs81 = defaultFS } = {}) {
75458
+ constructor(cwd2 = process.cwd(), pathImpl, sep16, { nocase, childrenCacheSize = 16 * 1024, fs: fs81 = defaultFS } = {}) {
75352
75459
  this.#fs = fsFromOption(fs81);
75353
75460
  if (cwd2 instanceof URL || cwd2.startsWith("file://")) {
75354
75461
  cwd2 = fileURLToPath3(cwd2);
@@ -75359,7 +75466,7 @@ var PathScurryBase = class {
75359
75466
  this.#resolveCache = new ResolveCache();
75360
75467
  this.#resolvePosixCache = new ResolveCache();
75361
75468
  this.#children = new ChildrenCache(childrenCacheSize);
75362
- const split = cwdPath.substring(this.rootPath.length).split(sep17);
75469
+ const split = cwdPath.substring(this.rootPath.length).split(sep16);
75363
75470
  if (split.length === 1 && !split[0]) {
75364
75471
  split.pop();
75365
75472
  }
@@ -76200,10 +76307,10 @@ var Ignore = class {
76200
76307
  ignored(p) {
76201
76308
  const fullpath = p.fullpath();
76202
76309
  const fullpaths = `${fullpath}/`;
76203
- const relative13 = p.relative() || ".";
76204
- const relatives = `${relative13}/`;
76310
+ const relative12 = p.relative() || ".";
76311
+ const relatives = `${relative12}/`;
76205
76312
  for (const m of this.relative) {
76206
- if (m.match(relative13) || m.match(relatives))
76313
+ if (m.match(relative12) || m.match(relatives))
76207
76314
  return true;
76208
76315
  }
76209
76316
  for (const m of this.absolute) {
@@ -76214,9 +76321,9 @@ var Ignore = class {
76214
76321
  }
76215
76322
  childrenIgnored(p) {
76216
76323
  const fullpath = p.fullpath() + "/";
76217
- const relative13 = (p.relative() || ".") + "/";
76324
+ const relative12 = (p.relative() || ".") + "/";
76218
76325
  for (const m of this.relativeChildren) {
76219
- if (m.match(relative13))
76326
+ if (m.match(relative12))
76220
76327
  return true;
76221
76328
  }
76222
76329
  for (const m of this.absoluteChildren) {
@@ -78410,7 +78517,7 @@ var SdkControlClientTransport = class {
78410
78517
 
78411
78518
  // packages/core/src/tools/mcp-client.ts
78412
78519
  import { existsSync as existsSync6 } from "node:fs";
78413
- import { basename as basename7 } from "node:path";
78520
+ import { basename as basename8 } from "node:path";
78414
78521
  import { pathToFileURL } from "node:url";
78415
78522
 
78416
78523
  // packages/core/src/mcp/oauth-provider.ts
@@ -79989,7 +80096,7 @@ var McpClient = class {
79989
80096
  for (const dir of this.workspaceContext.getDirectories()) {
79990
80097
  roots.push({
79991
80098
  uri: pathToFileURL(dir).toString(),
79992
- name: basename7(dir)
80099
+ name: basename8(dir)
79993
80100
  });
79994
80101
  }
79995
80102
  return {
@@ -80458,7 +80565,7 @@ async function connectToMcpServer(mcpServerName, mcpServerConfig, debugMode, wor
80458
80565
  for (const dir of workspaceContext.getDirectories()) {
80459
80566
  roots.push({
80460
80567
  uri: pathToFileURL(dir).toString(),
80461
- name: basename7(dir)
80568
+ name: basename8(dir)
80462
80569
  });
80463
80570
  }
80464
80571
  return {
@@ -83050,13 +83157,13 @@ import * as os9 from "os";
83050
83157
  // node_modules/chokidar/esm/index.js
83051
83158
  init_esbuild_shims();
83052
83159
  import { stat as statcb } from "fs";
83053
- import { stat as stat10, readdir as readdir9 } from "fs/promises";
83160
+ import { stat as stat11, readdir as readdir10 } from "fs/promises";
83054
83161
  import { EventEmitter as EventEmitter5 } from "events";
83055
83162
  import * as sysPath2 from "path";
83056
83163
 
83057
83164
  // node_modules/readdirp/esm/index.js
83058
83165
  init_esbuild_shims();
83059
- import { stat as stat8, lstat as lstat5, readdir as readdir8, realpath as realpath4 } from "node:fs/promises";
83166
+ import { stat as stat9, lstat as lstat5, readdir as readdir9, realpath as realpath4 } from "node:fs/promises";
83060
83167
  import { Readable } from "node:stream";
83061
83168
  import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from "node:path";
83062
83169
  var EntryTypes = {
@@ -83126,7 +83233,7 @@ var ReaddirpStream = class extends Readable {
83126
83233
  const { root, type } = opts;
83127
83234
  this._fileFilter = normalizeFilter(opts.fileFilter);
83128
83235
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
83129
- const statMethod = opts.lstat ? lstat5 : stat8;
83236
+ const statMethod = opts.lstat ? lstat5 : stat9;
83130
83237
  if (wantBigintFsStats) {
83131
83238
  this._stat = (path84) => statMethod(path84, { bigint: true });
83132
83239
  } else {
@@ -83197,7 +83304,7 @@ var ReaddirpStream = class extends Readable {
83197
83304
  async _exploreDir(path84, depth) {
83198
83305
  let files;
83199
83306
  try {
83200
- files = await readdir8(path84, this._rdOptions);
83307
+ files = await readdir9(path84, this._rdOptions);
83201
83308
  } catch (error) {
83202
83309
  this._onError(error);
83203
83310
  }
@@ -83205,10 +83312,10 @@ var ReaddirpStream = class extends Readable {
83205
83312
  }
83206
83313
  async _formatEntry(dirent, path84) {
83207
83314
  let entry;
83208
- const basename17 = this._isDirent ? dirent.name : dirent;
83315
+ const basename18 = this._isDirent ? dirent.name : dirent;
83209
83316
  try {
83210
- const fullPath = presolve(pjoin(path84, basename17));
83211
- entry = { path: prelative(this._root, fullPath), fullPath, basename: basename17 };
83317
+ const fullPath = presolve(pjoin(path84, basename18));
83318
+ entry = { path: prelative(this._root, fullPath), fullPath, basename: basename18 };
83212
83319
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
83213
83320
  } catch (err2) {
83214
83321
  this._onError(err2);
@@ -83281,7 +83388,7 @@ __name(readdirp, "readdirp");
83281
83388
  // node_modules/chokidar/esm/handler.js
83282
83389
  init_esbuild_shims();
83283
83390
  import { watchFile, unwatchFile, watch as fs_watch } from "fs";
83284
- import { open as open3, stat as stat9, lstat as lstat6, realpath as fsrealpath } from "fs/promises";
83391
+ import { open as open3, stat as stat10, lstat as lstat6, realpath as fsrealpath } from "fs/promises";
83285
83392
  import * as sysPath from "path";
83286
83393
  import { type as osType } from "os";
83287
83394
  var STR_DATA = "data";
@@ -83308,7 +83415,7 @@ var EVENTS = {
83308
83415
  };
83309
83416
  var EV = EVENTS;
83310
83417
  var THROTTLE_MODE_WATCH = "watch";
83311
- var statMethods = { lstat: lstat6, stat: stat9 };
83418
+ var statMethods = { lstat: lstat6, stat: stat10 };
83312
83419
  var KEY_LISTENERS = "listeners";
83313
83420
  var KEY_ERR = "errHandlers";
83314
83421
  var KEY_RAW = "rawEmitters";
@@ -83753,9 +83860,9 @@ var NodeFsHandler = class {
83753
83860
  _watchWithNodeFs(path84, listener) {
83754
83861
  const opts = this.fsw.options;
83755
83862
  const directory = sysPath.dirname(path84);
83756
- const basename17 = sysPath.basename(path84);
83863
+ const basename18 = sysPath.basename(path84);
83757
83864
  const parent = this.fsw._getWatchedDir(directory);
83758
- parent.add(basename17);
83865
+ parent.add(basename18);
83759
83866
  const absolutePath = sysPath.resolve(path84);
83760
83867
  const options2 = {
83761
83868
  persistent: opts.persistent
@@ -83765,7 +83872,7 @@ var NodeFsHandler = class {
83765
83872
  let closer;
83766
83873
  if (opts.usePolling) {
83767
83874
  const enableBin = opts.interval !== opts.binaryInterval;
83768
- options2.interval = enableBin && isBinaryPath(basename17) ? opts.binaryInterval : opts.interval;
83875
+ options2.interval = enableBin && isBinaryPath(basename18) ? opts.binaryInterval : opts.interval;
83769
83876
  closer = setFsWatchFileListener(path84, absolutePath, options2, {
83770
83877
  listener,
83771
83878
  rawEmitter: this.fsw._emitRaw
@@ -83788,17 +83895,17 @@ var NodeFsHandler = class {
83788
83895
  return;
83789
83896
  }
83790
83897
  const dirname29 = sysPath.dirname(file);
83791
- const basename17 = sysPath.basename(file);
83898
+ const basename18 = sysPath.basename(file);
83792
83899
  const parent = this.fsw._getWatchedDir(dirname29);
83793
83900
  let prevStats = stats;
83794
- if (parent.has(basename17))
83901
+ if (parent.has(basename18))
83795
83902
  return;
83796
83903
  const listener = /* @__PURE__ */ __name(async (path84, newStats) => {
83797
83904
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
83798
83905
  return;
83799
83906
  if (!newStats || newStats.mtimeMs === 0) {
83800
83907
  try {
83801
- const newStats2 = await stat9(file);
83908
+ const newStats2 = await stat10(file);
83802
83909
  if (this.fsw.closed)
83803
83910
  return;
83804
83911
  const at = newStats2.atimeMs;
@@ -83816,9 +83923,9 @@ var NodeFsHandler = class {
83816
83923
  prevStats = newStats2;
83817
83924
  }
83818
83925
  } catch (error) {
83819
- this.fsw._remove(dirname29, basename17);
83926
+ this.fsw._remove(dirname29, basename18);
83820
83927
  }
83821
- } else if (parent.has(basename17)) {
83928
+ } else if (parent.has(basename18)) {
83822
83929
  const at = newStats.atimeMs;
83823
83930
  const mt = newStats.mtimeMs;
83824
83931
  if (!at || at <= mt || mt !== prevStats.mtimeMs) {
@@ -84066,11 +84173,11 @@ function createPattern(matcher) {
84066
84173
  if (matcher.path === string2)
84067
84174
  return true;
84068
84175
  if (matcher.recursive) {
84069
- const relative13 = sysPath2.relative(matcher.path, string2);
84070
- if (!relative13) {
84176
+ const relative12 = sysPath2.relative(matcher.path, string2);
84177
+ if (!relative12) {
84071
84178
  return false;
84072
84179
  }
84073
- return !relative13.startsWith("..") && !sysPath2.isAbsolute(relative13);
84180
+ return !relative12.startsWith("..") && !sysPath2.isAbsolute(relative12);
84074
84181
  }
84075
84182
  return false;
84076
84183
  };
@@ -84180,7 +84287,7 @@ var DirEntry = class {
84180
84287
  return;
84181
84288
  const dir = this.path;
84182
84289
  try {
84183
- await readdir9(dir);
84290
+ await readdir10(dir);
84184
84291
  } catch (err2) {
84185
84292
  if (this._removeWatcher) {
84186
84293
  this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir));
@@ -84511,7 +84618,7 @@ var FSWatcher = class extends EventEmitter5 {
84511
84618
  const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path84) : path84;
84512
84619
  let stats2;
84513
84620
  try {
84514
- stats2 = await stat10(fullPath);
84621
+ stats2 = await stat11(fullPath);
84515
84622
  } catch (err2) {
84516
84623
  }
84517
84624
  if (!stats2 || this.closed)
@@ -84639,8 +84746,8 @@ var FSWatcher = class extends EventEmitter5 {
84639
84746
  }
84640
84747
  return this._userIgnored(path84, stats);
84641
84748
  }
84642
- _isntIgnored(path84, stat15) {
84643
- return !this._isIgnored(path84, stat15);
84749
+ _isntIgnored(path84, stat16) {
84750
+ return !this._isIgnored(path84, stat16);
84644
84751
  }
84645
84752
  /**
84646
84753
  * Provides a set of common helpers and properties relating to symlink handling.
@@ -91712,7 +91819,7 @@ var encString = /* @__PURE__ */ __name((buf, off, size, str) => str === void 0 ?
91712
91819
 
91713
91820
  // node_modules/tar/dist/esm/pax.js
91714
91821
  init_esbuild_shims();
91715
- import { basename as basename11 } from "node:path";
91822
+ import { basename as basename12 } from "node:path";
91716
91823
  var Pax = class _Pax {
91717
91824
  static {
91718
91825
  __name(this, "Pax");
@@ -91768,7 +91875,7 @@ var Pax = class _Pax {
91768
91875
  // then the path should be PaxHeader + basename, but less than 99,
91769
91876
  // prepend with the dirname
91770
91877
  /* c8 ignore start */
91771
- path: ("PaxHeader/" + basename11(this.path ?? "")).slice(0, 99),
91878
+ path: ("PaxHeader/" + basename12(this.path ?? "")).slice(0, 99),
91772
91879
  /* c8 ignore stop */
91773
91880
  mode: this.mode || 420,
91774
91881
  uid: this.uid,
@@ -92521,16 +92628,16 @@ var listFileSync = /* @__PURE__ */ __name((opt) => {
92521
92628
  let fd;
92522
92629
  try {
92523
92630
  fd = fs43.openSync(file, "r");
92524
- const stat15 = fs43.fstatSync(fd);
92631
+ const stat16 = fs43.fstatSync(fd);
92525
92632
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
92526
- if (stat15.size < readSize) {
92527
- const buf = Buffer.allocUnsafe(stat15.size);
92528
- const read3 = fs43.readSync(fd, buf, 0, stat15.size, 0);
92633
+ if (stat16.size < readSize) {
92634
+ const buf = Buffer.allocUnsafe(stat16.size);
92635
+ const read3 = fs43.readSync(fd, buf, 0, stat16.size, 0);
92529
92636
  p.end(read3 === buf.byteLength ? buf : buf.subarray(0, read3));
92530
92637
  } else {
92531
92638
  let pos2 = 0;
92532
92639
  const buf = Buffer.allocUnsafe(readSize);
92533
- while (pos2 < stat15.size) {
92640
+ while (pos2 < stat16.size) {
92534
92641
  const bytesRead = fs43.readSync(fd, buf, 0, readSize, pos2);
92535
92642
  if (bytesRead === 0)
92536
92643
  break;
@@ -92555,13 +92662,13 @@ var listFile = /* @__PURE__ */ __name((opt, _files) => {
92555
92662
  const p = new Promise((resolve31, reject) => {
92556
92663
  parse14.on("error", reject);
92557
92664
  parse14.on("end", resolve31);
92558
- fs43.stat(file, (er, stat15) => {
92665
+ fs43.stat(file, (er, stat16) => {
92559
92666
  if (er) {
92560
92667
  reject(er);
92561
92668
  } else {
92562
92669
  const stream2 = new ReadStream(file, {
92563
92670
  readSize,
92564
- size: stat15.size
92671
+ size: stat16.size
92565
92672
  });
92566
92673
  stream2.on("error", reject);
92567
92674
  stream2.pipe(parse14);
@@ -92753,21 +92860,21 @@ var WriteEntry = class extends Minipass {
92753
92860
  return super.emit(ev, ...data);
92754
92861
  }
92755
92862
  [LSTAT]() {
92756
- fs44.lstat(this.absolute, (er, stat15) => {
92863
+ fs44.lstat(this.absolute, (er, stat16) => {
92757
92864
  if (er) {
92758
92865
  return this.emit("error", er);
92759
92866
  }
92760
- this[ONLSTAT](stat15);
92867
+ this[ONLSTAT](stat16);
92761
92868
  });
92762
92869
  }
92763
- [ONLSTAT](stat15) {
92764
- this.statCache.set(this.absolute, stat15);
92765
- this.stat = stat15;
92766
- if (!stat15.isFile()) {
92767
- stat15.size = 0;
92870
+ [ONLSTAT](stat16) {
92871
+ this.statCache.set(this.absolute, stat16);
92872
+ this.stat = stat16;
92873
+ if (!stat16.isFile()) {
92874
+ stat16.size = 0;
92768
92875
  }
92769
- this.type = getType(stat15);
92770
- this.emit("stat", stat15);
92876
+ this.type = getType(stat16);
92877
+ this.emit("stat", stat16);
92771
92878
  this[PROCESS2]();
92772
92879
  }
92773
92880
  [PROCESS2]() {
@@ -93217,7 +93324,7 @@ var WriteEntryTar = class extends Minipass {
93217
93324
  return this;
93218
93325
  }
93219
93326
  };
93220
- var getType = /* @__PURE__ */ __name((stat15) => stat15.isFile() ? "File" : stat15.isDirectory() ? "Directory" : stat15.isSymbolicLink() ? "SymbolicLink" : "Unsupported", "getType");
93327
+ var getType = /* @__PURE__ */ __name((stat16) => stat16.isFile() ? "File" : stat16.isDirectory() ? "Directory" : stat16.isSymbolicLink() ? "SymbolicLink" : "Unsupported", "getType");
93221
93328
 
93222
93329
  // node_modules/yallist/dist/esm/index.js
93223
93330
  init_esbuild_shims();
@@ -93798,21 +93905,21 @@ var Pack = class extends Minipass {
93798
93905
  [STAT](job) {
93799
93906
  job.pending = true;
93800
93907
  this[JOBS] += 1;
93801
- const stat15 = this.follow ? "stat" : "lstat";
93802
- fs45[stat15](job.absolute, (er, stat16) => {
93908
+ const stat16 = this.follow ? "stat" : "lstat";
93909
+ fs45[stat16](job.absolute, (er, stat17) => {
93803
93910
  job.pending = false;
93804
93911
  this[JOBS] -= 1;
93805
93912
  if (er) {
93806
93913
  this.emit("error", er);
93807
93914
  } else {
93808
- this[ONSTAT](job, stat16);
93915
+ this[ONSTAT](job, stat17);
93809
93916
  }
93810
93917
  });
93811
93918
  }
93812
- [ONSTAT](job, stat15) {
93813
- this.statCache.set(job.absolute, stat15);
93814
- job.stat = stat15;
93815
- if (!this.filter(job.path, stat15)) {
93919
+ [ONSTAT](job, stat16) {
93920
+ this.statCache.set(job.absolute, stat16);
93921
+ job.stat = stat16;
93922
+ if (!this.filter(job.path, stat16)) {
93816
93923
  job.ignore = true;
93817
93924
  }
93818
93925
  this[PROCESS3]();
@@ -93994,8 +94101,8 @@ var PackSync = class extends Pack {
93994
94101
  resume() {
93995
94102
  }
93996
94103
  [STAT](job) {
93997
- const stat15 = this.follow ? "statSync" : "lstatSync";
93998
- this[ONSTAT](job, fs45[stat15](job.absolute));
94104
+ const stat16 = this.follow ? "statSync" : "lstatSync";
94105
+ this[ONSTAT](job, fs45[stat16](job.absolute));
93999
94106
  }
94000
94107
  [READDIR](job) {
94001
94108
  this[ONREADDIR](job, fs45.readdirSync(job.absolute));
@@ -94392,7 +94499,7 @@ var mkdirSync2 = /* @__PURE__ */ __name((dir, opt) => {
94392
94499
 
94393
94500
  // node_modules/tar/dist/esm/path-reservations.js
94394
94501
  init_esbuild_shims();
94395
- import { join as join30 } from "node:path";
94502
+ import { join as join31 } from "node:path";
94396
94503
 
94397
94504
  // node_modules/tar/dist/esm/normalize-unicode.js
94398
94505
  init_esbuild_shims();
@@ -94426,7 +94533,7 @@ var getDirs = /* @__PURE__ */ __name((path84) => {
94426
94533
  const dirs = path84.split("/").slice(0, -1).reduce((set, path85) => {
94427
94534
  const s = set[set.length - 1];
94428
94535
  if (s !== void 0) {
94429
- path85 = join30(s, path85);
94536
+ path85 = join31(s, path85);
94430
94537
  }
94431
94538
  set.push(path85 || "/");
94432
94539
  return set;
@@ -94447,7 +94554,7 @@ var PathReservations = class {
94447
94554
  #running = /* @__PURE__ */ new Set();
94448
94555
  reserve(paths, fn) {
94449
94556
  paths = isWindows3 ? ["win32 parallelization disabled"] : paths.map((p) => {
94450
- return stripTrailingSlashes(join30(normalizeUnicode(p))).toLowerCase();
94557
+ return stripTrailingSlashes(join31(normalizeUnicode(p))).toLowerCase();
94451
94558
  });
94452
94559
  const dirs = new Set(paths.map((path84) => getDirs(path84)).reduce((a, b) => a.concat(b)));
94453
94560
  this.#reservations.set(fn, { dirs, paths });
@@ -95231,11 +95338,11 @@ var UnpackSync = class extends Unpack {
95231
95338
  var extractFileSync = /* @__PURE__ */ __name((opt) => {
95232
95339
  const u = new UnpackSync(opt);
95233
95340
  const file = opt.file;
95234
- const stat15 = fs50.statSync(file);
95341
+ const stat16 = fs50.statSync(file);
95235
95342
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
95236
95343
  const stream2 = new ReadStreamSync(file, {
95237
95344
  readSize,
95238
- size: stat15.size
95345
+ size: stat16.size
95239
95346
  });
95240
95347
  stream2.pipe(u);
95241
95348
  }, "extractFileSync");
@@ -95246,13 +95353,13 @@ var extractFile = /* @__PURE__ */ __name((opt, _) => {
95246
95353
  const p = new Promise((resolve31, reject) => {
95247
95354
  u.on("error", reject);
95248
95355
  u.on("close", resolve31);
95249
- fs50.stat(file, (er, stat15) => {
95356
+ fs50.stat(file, (er, stat16) => {
95250
95357
  if (er) {
95251
95358
  reject(er);
95252
95359
  } else {
95253
95360
  const stream2 = new ReadStream(file, {
95254
95361
  readSize,
95255
- size: stat15.size
95362
+ size: stat16.size
95256
95363
  });
95257
95364
  stream2.on("error", reject);
95258
95365
  stream2.pipe(u);
@@ -95479,9 +95586,9 @@ var mtimeFilter = /* @__PURE__ */ __name((opt) => {
95479
95586
  if (!opt.mtimeCache) {
95480
95587
  opt.mtimeCache = /* @__PURE__ */ new Map();
95481
95588
  }
95482
- opt.filter = filter3 ? (path84, stat15) => filter3(path84, stat15) && !/* c8 ignore start */
95483
- ((opt.mtimeCache?.get(path84) ?? stat15.mtime ?? 0) > (stat15.mtime ?? 0)) : (path84, stat15) => !/* c8 ignore start */
95484
- ((opt.mtimeCache?.get(path84) ?? stat15.mtime ?? 0) > (stat15.mtime ?? 0));
95589
+ opt.filter = filter3 ? (path84, stat16) => filter3(path84, stat16) && !/* c8 ignore start */
95590
+ ((opt.mtimeCache?.get(path84) ?? stat16.mtime ?? 0) > (stat16.mtime ?? 0)) : (path84, stat16) => !/* c8 ignore start */
95591
+ ((opt.mtimeCache?.get(path84) ?? stat16.mtime ?? 0) > (stat16.mtime ?? 0));
95485
95592
  }, "mtimeFilter");
95486
95593
 
95487
95594
  // packages/core/src/extension/github.ts
@@ -96726,17 +96833,10 @@ async function collectResources(resourcePaths, pluginRoot, destDir) {
96726
96833
  debugLogger68.warn(`Resource path not found: ${resolvedPath}`);
96727
96834
  continue;
96728
96835
  }
96729
- const stat15 = fs56.statSync(resolvedPath);
96730
- if (stat15.isDirectory()) {
96836
+ const stat16 = fs56.statSync(resolvedPath);
96837
+ if (stat16.isDirectory()) {
96731
96838
  const dirName = path57.basename(resolvedPath);
96732
- const parentDir = path57.dirname(resolvedPath);
96733
- if (dirName === destFolderName && parentDir === pluginRoot) {
96734
- debugLogger68.debug(
96735
- `Skipping ${resolvedPath} as it's already in the correct location`
96736
- );
96737
- continue;
96738
- }
96739
- const finalDestDir = path57.join(destDir, dirName);
96839
+ const finalDestDir = dirName === destFolderName ? destDir : path57.join(destDir, dirName);
96740
96840
  const files = await glob("**/*", {
96741
96841
  cwd: resolvedPath,
96742
96842
  nodir: true,
@@ -96762,14 +96862,6 @@ async function collectResources(resourcePaths, pluginRoot, destDir) {
96762
96862
  fs56.copyFileSync(srcFile, destFile);
96763
96863
  }
96764
96864
  } else {
96765
- const relativePath = path57.relative(pluginRoot, resolvedPath);
96766
- const segments = relativePath.split(path57.sep);
96767
- if (segments.length > 0 && segments[0] === destFolderName) {
96768
- debugLogger68.debug(
96769
- `Skipping ${resolvedPath} as it's already in ${destFolderName}/`
96770
- );
96771
- continue;
96772
- }
96773
96865
  const fileName = path57.basename(resolvedPath);
96774
96866
  const destFile = path57.join(destDir, fileName);
96775
96867
  fs56.copyFileSync(resolvedPath, destFile);
@@ -98612,42 +98704,6 @@ var UrlValidator = class {
98612
98704
  }
98613
98705
  };
98614
98706
 
98615
- // packages/core/src/hooks/combinedAbortSignal.ts
98616
- init_esbuild_shims();
98617
- function createCombinedAbortSignal(externalSignal, options2) {
98618
- const controller = new AbortController();
98619
- const timeoutMs = options2?.timeoutMs;
98620
- let timeoutId;
98621
- if (timeoutMs !== void 0 && timeoutMs > 0) {
98622
- timeoutId = setTimeout(() => {
98623
- controller.abort();
98624
- }, timeoutMs);
98625
- }
98626
- let abortHandler;
98627
- if (externalSignal) {
98628
- if (externalSignal.aborted) {
98629
- controller.abort();
98630
- } else {
98631
- abortHandler = /* @__PURE__ */ __name(() => {
98632
- controller.abort();
98633
- }, "abortHandler");
98634
- externalSignal.addEventListener("abort", abortHandler, { once: true });
98635
- }
98636
- }
98637
- const cleanup = /* @__PURE__ */ __name(() => {
98638
- if (timeoutId !== void 0) {
98639
- clearTimeout(timeoutId);
98640
- timeoutId = void 0;
98641
- }
98642
- if (externalSignal && abortHandler) {
98643
- externalSignal.removeEventListener("abort", abortHandler);
98644
- abortHandler = void 0;
98645
- }
98646
- }, "cleanup");
98647
- return { signal: controller.signal, cleanup };
98648
- }
98649
- __name(createCombinedAbortSignal, "createCombinedAbortSignal");
98650
-
98651
98707
  // packages/core/src/hooks/httpHookRunner.ts
98652
98708
  import { lookup as dnsLookup } from "dns";
98653
98709
  var debugLogger73 = createDebugLogger("HTTP_HOOK_RUNNER");
@@ -98770,8 +98826,8 @@ var HttpHookRunner = class {
98770
98826
  hook_event_name: eventName
98771
98827
  });
98772
98828
  const timeout = hookConfig.timeout ? hookConfig.timeout * 1e3 : DEFAULT_HTTP_TIMEOUT;
98773
- const { signal: combinedSignal, cleanup } = createCombinedAbortSignal(
98774
- signal,
98829
+ const { signal: combinedSignal, cleanup } = combineAbortSignals(
98830
+ [signal],
98775
98831
  { timeoutMs: timeout }
98776
98832
  );
98777
98833
  try {
@@ -99100,7 +99156,7 @@ var FunctionHookRunner = class {
99100
99156
  abortHandler = /* @__PURE__ */ __name(() => {
99101
99157
  reject(new Error("Function hook execution aborted"));
99102
99158
  }, "abortHandler");
99103
- signal.addEventListener("abort", abortHandler);
99159
+ signal.addEventListener("abort", abortHandler, { once: true });
99104
99160
  }
99105
99161
  });
99106
99162
  const promises8 = [callback(input, context), timeoutPromise];
@@ -99272,17 +99328,8 @@ ${processedPrompt}`);
99272
99328
  parts: [{ text: prompt }]
99273
99329
  }
99274
99330
  ];
99275
- const internalAbortController = new AbortController();
99331
+ const internalAbortController = createChildAbortController(signal);
99276
99332
  const internalSignal = internalAbortController.signal;
99277
- if (signal) {
99278
- if (signal.aborted) {
99279
- internalAbortController.abort();
99280
- } else {
99281
- signal.addEventListener("abort", () => {
99282
- internalAbortController.abort();
99283
- });
99284
- }
99285
- }
99286
99333
  let timeoutId;
99287
99334
  const timeoutPromise = new Promise((_, reject) => {
99288
99335
  timeoutId = setTimeout(() => {
@@ -99340,6 +99387,7 @@ ${processedPrompt}`);
99340
99387
  if (timeoutId) {
99341
99388
  clearTimeout(timeoutId);
99342
99389
  }
99390
+ internalAbortController.abort();
99343
99391
  }
99344
99392
  }
99345
99393
  /**
@@ -100120,7 +100168,7 @@ var HookRunner = class {
100120
100168
  killChild();
100121
100169
  }, "abortHandler");
100122
100170
  if (signal) {
100123
- signal.addEventListener("abort", abortHandler);
100171
+ signal.addEventListener("abort", abortHandler, { once: true });
100124
100172
  }
100125
100173
  if (child.stdin) {
100126
100174
  child.stdin.on("error", (err2) => {
@@ -102033,7 +102081,7 @@ var MessageBus = class extends EventEmitter6 {
102033
102081
  reject(new Error("Request aborted"));
102034
102082
  }, "abortHandler");
102035
102083
  if (signal) {
102036
- signal.addEventListener("abort", abortHandler);
102084
+ signal.addEventListener("abort", abortHandler, { once: true });
102037
102085
  }
102038
102086
  const responseHandler = /* @__PURE__ */ __name((response) => {
102039
102087
  if ("correlationId" in response && response.correlationId === correlationId) {
@@ -107723,19 +107771,19 @@ var Config = class {
107723
107771
  }, "registerStructuredOutputIfRequested");
107724
107772
  if (this.getBareMode()) {
107725
107773
  await registerLazy(ToolNames.READ_FILE, async () => {
107726
- const { ReadFileTool } = await import("./read-file-WSEYLDOV.js");
107774
+ const { ReadFileTool } = await import("./read-file-5QUJ3ZIL.js");
107727
107775
  return new ReadFileTool(this);
107728
107776
  });
107729
107777
  await registerLazy(ToolNames.EDIT, async () => {
107730
- const { EditTool } = await import("./edit-UJMWLGYK.js");
107778
+ const { EditTool } = await import("./edit-2CY35GKJ.js");
107731
107779
  return new EditTool(this);
107732
107780
  });
107733
107781
  await registerLazy(ToolNames.NOTEBOOK_EDIT, async () => {
107734
- const { NotebookEditTool } = await import("./notebook-edit-5SR3UTIM.js");
107782
+ const { NotebookEditTool } = await import("./notebook-edit-RWOEUTYU.js");
107735
107783
  return new NotebookEditTool(this);
107736
107784
  });
107737
107785
  await registerLazy(ToolNames.SHELL, async () => {
107738
- const { ShellTool: ShellTool2 } = await import("./shell-JJBUJGJM.js");
107786
+ const { ShellTool: ShellTool2 } = await import("./shell-DA54BZO2.js");
107739
107787
  return new ShellTool2(this);
107740
107788
  });
107741
107789
  await registerStructuredOutputIfRequested();
@@ -107745,11 +107793,11 @@ var Config = class {
107745
107793
  return registry;
107746
107794
  }
107747
107795
  await registerLazy(ToolNames.TOOL_SEARCH, async () => {
107748
- const { ToolSearchTool } = await import("./tool-search-VS4IMEQF.js");
107796
+ const { ToolSearchTool } = await import("./tool-search-PONJXBSP.js");
107749
107797
  return new ToolSearchTool(this);
107750
107798
  });
107751
107799
  await registerLazy(ToolNames.AGENT, async () => {
107752
- const { AgentTool: AgentTool2 } = await import("./agent-B5PF5GU4.js");
107800
+ const { AgentTool: AgentTool2 } = await import("./agent-KYFWAFRH.js");
107753
107801
  return new AgentTool2(this);
107754
107802
  });
107755
107803
  await registerLazy(ToolNames.TASK_STOP, async () => {
@@ -107761,7 +107809,7 @@ var Config = class {
107761
107809
  return new SendMessageTool(this);
107762
107810
  });
107763
107811
  await registerLazy(ToolNames.SKILL, async () => {
107764
- const { SkillTool } = await import("./skill-T3PI55OA.js");
107812
+ const { SkillTool } = await import("./skill-47FZXDEM.js");
107765
107813
  return new SkillTool(this);
107766
107814
  });
107767
107815
  await registerLazy(ToolNames.LS, async () => {
@@ -107769,7 +107817,7 @@ var Config = class {
107769
107817
  return new LSTool(this);
107770
107818
  });
107771
107819
  await registerLazy(ToolNames.READ_FILE, async () => {
107772
- const { ReadFileTool } = await import("./read-file-WSEYLDOV.js");
107820
+ const { ReadFileTool } = await import("./read-file-5QUJ3ZIL.js");
107773
107821
  return new ReadFileTool(this);
107774
107822
  });
107775
107823
  if (this.getUseRipgrep()) {
@@ -107782,7 +107830,7 @@ var Config = class {
107782
107830
  }
107783
107831
  if (useRipgrep) {
107784
107832
  await registerLazy(ToolNames.GREP, async () => {
107785
- const { RipGrepTool: RipGrepTool2 } = await import("./ripGrep-N67GL3K7.js");
107833
+ const { RipGrepTool: RipGrepTool2 } = await import("./ripGrep-PA7M7MJS.js");
107786
107834
  return new RipGrepTool2(this);
107787
107835
  });
107788
107836
  } else {
@@ -107795,34 +107843,34 @@ var Config = class {
107795
107843
  )
107796
107844
  );
107797
107845
  await registerLazy(ToolNames.GREP, async () => {
107798
- const { GrepTool } = await import("./grep-NID7EZU4.js");
107846
+ const { GrepTool } = await import("./grep-GKU7Y77F.js");
107799
107847
  return new GrepTool(this);
107800
107848
  });
107801
107849
  }
107802
107850
  } else {
107803
107851
  await registerLazy(ToolNames.GREP, async () => {
107804
- const { GrepTool } = await import("./grep-NID7EZU4.js");
107852
+ const { GrepTool } = await import("./grep-GKU7Y77F.js");
107805
107853
  return new GrepTool(this);
107806
107854
  });
107807
107855
  }
107808
107856
  await registerLazy(ToolNames.GLOB, async () => {
107809
- const { GlobTool } = await import("./glob-WU4BIR7K.js");
107857
+ const { GlobTool } = await import("./glob-C5ZNGH7V.js");
107810
107858
  return new GlobTool(this);
107811
107859
  });
107812
107860
  await registerLazy(ToolNames.EDIT, async () => {
107813
- const { EditTool } = await import("./edit-UJMWLGYK.js");
107861
+ const { EditTool } = await import("./edit-2CY35GKJ.js");
107814
107862
  return new EditTool(this);
107815
107863
  });
107816
107864
  await registerLazy(ToolNames.NOTEBOOK_EDIT, async () => {
107817
- const { NotebookEditTool } = await import("./notebook-edit-5SR3UTIM.js");
107865
+ const { NotebookEditTool } = await import("./notebook-edit-RWOEUTYU.js");
107818
107866
  return new NotebookEditTool(this);
107819
107867
  });
107820
107868
  await registerLazy(ToolNames.WRITE_FILE, async () => {
107821
- const { WriteFileTool } = await import("./write-file-IPYT4F3N.js");
107869
+ const { WriteFileTool } = await import("./write-file-2YX4NB3B.js");
107822
107870
  return new WriteFileTool(this);
107823
107871
  });
107824
107872
  await registerLazy(ToolNames.SHELL, async () => {
107825
- const { ShellTool: ShellTool2 } = await import("./shell-JJBUJGJM.js");
107873
+ const { ShellTool: ShellTool2 } = await import("./shell-DA54BZO2.js");
107826
107874
  return new ShellTool2(this);
107827
107875
  });
107828
107876
  await registerLazy(ToolNames.TODO_WRITE, async () => {
@@ -107835,16 +107883,16 @@ var Config = class {
107835
107883
  });
107836
107884
  if (!this.sdkMode) {
107837
107885
  await registerLazy(ToolNames.EXIT_PLAN_MODE, async () => {
107838
- const { ExitPlanModeTool } = await import("./exitPlanMode-Q43DRSNG.js");
107886
+ const { ExitPlanModeTool } = await import("./exitPlanMode-3JP3BRRO.js");
107839
107887
  return new ExitPlanModeTool(this);
107840
107888
  });
107841
107889
  }
107842
107890
  await registerLazy(ToolNames.ENTER_WORKTREE, async () => {
107843
- const { EnterWorktreeTool } = await import("./enter-worktree-E2EUJPD3.js");
107891
+ const { EnterWorktreeTool } = await import("./enter-worktree-HJGN4DH2.js");
107844
107892
  return new EnterWorktreeTool(this);
107845
107893
  });
107846
107894
  await registerLazy(ToolNames.EXIT_WORKTREE, async () => {
107847
- const { ExitWorktreeTool } = await import("./exit-worktree-I7UHJCUU.js");
107895
+ const { ExitWorktreeTool } = await import("./exit-worktree-VAPX5N2E.js");
107848
107896
  return new ExitWorktreeTool(this);
107849
107897
  });
107850
107898
  await registerLazy(ToolNames.WEB_FETCH, async () => {
@@ -107873,7 +107921,7 @@ var Config = class {
107873
107921
  });
107874
107922
  }
107875
107923
  await registerLazy(ToolNames.MONITOR, async () => {
107876
- const { MonitorTool } = await import("./monitor-4M5UH7WX.js");
107924
+ const { MonitorTool } = await import("./monitor-HJTGGH2N.js");
107877
107925
  return new MonitorTool(this);
107878
107926
  });
107879
107927
  if (this.pendingMcpBudgetCallback) {
@@ -108713,15 +108761,15 @@ var GrepToolInvocation = class extends BaseToolInvocation {
108713
108761
  const parts2 = [];
108714
108762
  let currentLength = 0;
108715
108763
  for (const line of linesToInclude) {
108716
- const sep17 = includedLines > 0 ? 1 : 0;
108717
- const projectedLength = currentLength + line.rawLine.length + sep17;
108764
+ const sep16 = includedLines > 0 ? 1 : 0;
108765
+ const projectedLength = currentLength + line.rawLine.length + sep16;
108718
108766
  if (projectedLength <= charLimit) {
108719
108767
  parts2.push(line.rawLine);
108720
108768
  visibleLines.push(line);
108721
108769
  includedLines++;
108722
108770
  currentLength = projectedLength;
108723
108771
  } else {
108724
- const remaining = Math.max(charLimit - currentLength - sep17, 10);
108772
+ const remaining = Math.max(charLimit - currentLength - sep16, 10);
108725
108773
  const partialLine = line.rawLine.slice(0, remaining);
108726
108774
  parts2.push(partialLine + "...");
108727
108775
  visibleLines.push(line);
@@ -109259,9 +109307,31 @@ var TOKEN_PLAN_MODELS = [
109259
109307
  enableThinking: true,
109260
109308
  modalities: { image: true, video: true }
109261
109309
  },
109262
- { id: "deepseek-v3.2", contextWindowSize: 131072, enableThinking: true },
109310
+ { id: "qwen3.7-max", contextWindowSize: 1e6, enableThinking: true },
109311
+ {
109312
+ id: "qwen3.6-flash",
109313
+ contextWindowSize: 1e6,
109314
+ enableThinking: true,
109315
+ modalities: { image: true, video: true }
109316
+ },
109317
+ { id: "deepseek-v4-pro", contextWindowSize: 1e6 },
109318
+ { id: "deepseek-v4-flash", contextWindowSize: 1e6 },
109319
+ { id: "deepseek-v3.2", contextWindowSize: 131072 },
109320
+ {
109321
+ id: "kimi-k2.6",
109322
+ contextWindowSize: 262144,
109323
+ enableThinking: true,
109324
+ modalities: { image: true, video: true }
109325
+ },
109326
+ {
109327
+ id: "kimi-k2.5",
109328
+ contextWindowSize: 262144,
109329
+ enableThinking: true,
109330
+ modalities: { image: true, video: true }
109331
+ },
109332
+ { id: "glm-5.1", contextWindowSize: 202752, enableThinking: true },
109263
109333
  { id: "glm-5", contextWindowSize: 202752, enableThinking: true },
109264
- { id: "MiniMax-M2.5", contextWindowSize: 196608, enableThinking: true }
109334
+ { id: "MiniMax-M2.5", contextWindowSize: 196608 }
109265
109335
  ];
109266
109336
  var tokenPlanProvider = {
109267
109337
  id: "token-plan",
@@ -109961,8 +110031,8 @@ async function restoreWorktreeContext(sidecarPath, onWarn) {
109961
110031
  }
109962
110032
  let worktreeAlive = false;
109963
110033
  try {
109964
- const stat15 = await fs67.stat(session.worktreePath);
109965
- worktreeAlive = stat15.isDirectory();
110034
+ const stat16 = await fs67.stat(session.worktreePath);
110035
+ worktreeAlive = stat16.isDirectory();
109966
110036
  } catch {
109967
110037
  worktreeAlive = false;
109968
110038
  }
@@ -110262,11 +110332,11 @@ var WorkspaceMemoryFileTooLargeError = class extends Error {
110262
110332
  async function composeAppendedContent(filePath, newContent) {
110263
110333
  let existing = "";
110264
110334
  try {
110265
- const stat15 = await fs68.stat(filePath);
110266
- if (stat15.size > MAX_EXISTING_FILE_BYTES) {
110335
+ const stat16 = await fs68.stat(filePath);
110336
+ if (stat16.size > MAX_EXISTING_FILE_BYTES) {
110267
110337
  throw new WorkspaceMemoryFileTooLargeError(
110268
110338
  filePath,
110269
- stat15.size,
110339
+ stat16.size,
110270
110340
  MAX_EXISTING_FILE_BYTES
110271
110341
  );
110272
110342
  }
@@ -110284,8 +110354,8 @@ ${trimmed2}
110284
110354
  }
110285
110355
  const sectionIdx = existing.indexOf(MEMORY_SECTION_HEADER);
110286
110356
  if (sectionIdx === -1) {
110287
- const sep18 = existing.endsWith("\n") ? "" : "\n";
110288
- return `${existing}${sep18}
110357
+ const sep17 = existing.endsWith("\n") ? "" : "\n";
110358
+ return `${existing}${sep17}
110289
110359
  ${MEMORY_SECTION_HEADER}
110290
110360
  ${trimmed2}
110291
110361
  `;
@@ -110293,15 +110363,15 @@ ${trimmed2}
110293
110363
  const afterHeaderIdx = sectionIdx + MEMORY_SECTION_HEADER.length;
110294
110364
  const nextHeaderRel = findNextTopLevelHeading(existing, afterHeaderIdx);
110295
110365
  if (nextHeaderRel === -1) {
110296
- const sep18 = existing.endsWith("\n") ? "" : "\n";
110297
- return `${existing}${sep18}${trimmed2}
110366
+ const sep17 = existing.endsWith("\n") ? "" : "\n";
110367
+ return `${existing}${sep17}${trimmed2}
110298
110368
  `;
110299
110369
  }
110300
110370
  const insertAt = afterHeaderIdx + nextHeaderRel;
110301
110371
  const before = existing.slice(0, insertAt);
110302
110372
  const after = existing.slice(insertAt);
110303
- const sep17 = before.endsWith("\n") ? "" : "\n";
110304
- return `${before}${sep17}${trimmed2}
110373
+ const sep16 = before.endsWith("\n") ? "" : "\n";
110374
+ return `${before}${sep16}${trimmed2}
110305
110375
  ${after}`;
110306
110376
  }
110307
110377
  __name(composeAppendedContent, "composeAppendedContent");
@@ -113648,7 +113718,7 @@ init_esbuild_shims();
113648
113718
  import * as fs73 from "node:fs";
113649
113719
  import * as path74 from "node:path";
113650
113720
  import * as https3 from "node:https";
113651
- import { stat as stat13 } from "node:fs/promises";
113721
+ import { stat as stat14 } from "node:fs/promises";
113652
113722
  function parseSourceAndPluginName(source) {
113653
113723
  const urlSchemes = ["http://", "https://", "git@", "sso://"];
113654
113724
  let repoEndIndex = source.length;
@@ -113761,7 +113831,7 @@ async function parseInstallSource(source) {
113761
113831
  let marketplaceConfig = null;
113762
113832
  let isLocalPath = false;
113763
113833
  try {
113764
- await stat13(repo);
113834
+ await stat14(repo);
113765
113835
  isLocalPath = true;
113766
113836
  } catch {
113767
113837
  }
@@ -114213,7 +114283,7 @@ __name(reportSuggestionUsage, "reportSuggestionUsage");
114213
114283
  init_esbuild_shims();
114214
114284
  import { mkdir as mkdir13, copyFile as copyFile3, rm as rm4 } from "node:fs/promises";
114215
114285
  import { existsSync as existsSync16 } from "node:fs";
114216
- import { join as join46, dirname as dirname27, relative as relative12, isAbsolute as isAbsolute17 } from "node:path";
114286
+ import { join as join47, dirname as dirname27, relative as relative11, isAbsolute as isAbsolute17 } from "node:path";
114217
114287
  import { tmpdir as tmpdir4 } from "node:os";
114218
114288
  import { randomUUID as randomUUID10 } from "node:crypto";
114219
114289
  var OverlayFs = class {
@@ -114221,7 +114291,7 @@ var OverlayFs = class {
114221
114291
  constructor(realCwd) {
114222
114292
  this.realCwd = realCwd;
114223
114293
  const id = randomUUID10().slice(0, 8);
114224
- this.overlayDir = join46(
114294
+ this.overlayDir = join47(
114225
114295
  tmpdir4(),
114226
114296
  "qwen-speculation",
114227
114297
  String(process.pid),
@@ -114260,9 +114330,9 @@ var OverlayFs = class {
114260
114330
  if (this.writtenFiles.has(rel)) {
114261
114331
  return this.writtenFiles.get(rel);
114262
114332
  }
114263
- const overlayPath = join46(this.overlayDir, rel);
114333
+ const overlayPath = join47(this.overlayDir, rel);
114264
114334
  await mkdir13(dirname27(overlayPath), { recursive: true });
114265
- const originalPath = join46(this.realCwd, rel);
114335
+ const originalPath = join47(this.realCwd, rel);
114266
114336
  if (existsSync16(originalPath)) {
114267
114337
  try {
114268
114338
  await copyFile3(originalPath, overlayPath);
@@ -114285,7 +114355,7 @@ var OverlayFs = class {
114285
114355
  async applyToReal() {
114286
114356
  const applied = [];
114287
114357
  for (const [rel, overlayPath] of this.writtenFiles) {
114288
- const realPath = join46(this.realCwd, rel);
114358
+ const realPath = join47(this.realCwd, rel);
114289
114359
  try {
114290
114360
  await mkdir13(dirname27(realPath), { recursive: true });
114291
114361
  await copyFile3(overlayPath, realPath);
@@ -114309,8 +114379,8 @@ var OverlayFs = class {
114309
114379
  * Returns null if the path is outside cwd.
114310
114380
  */
114311
114381
  toRelative(inputPath) {
114312
- const abs = isAbsolute17(inputPath) ? inputPath : join46(this.realCwd, inputPath);
114313
- const rel = relative12(this.realCwd, abs);
114382
+ const abs = isAbsolute17(inputPath) ? inputPath : join47(this.realCwd, inputPath);
114383
+ const rel = relative11(this.realCwd, abs);
114314
114384
  if (isAbsolute17(rel) || rel.startsWith("..")) {
114315
114385
  return null;
114316
114386
  }
@@ -115161,12 +115231,12 @@ function resolveGitDir2(crawlDirectory) {
115161
115231
  while (current) {
115162
115232
  const gitPath = path76.join(current, ".git");
115163
115233
  try {
115164
- const stat15 = fs75.statSync(gitPath);
115165
- if (stat15.isDirectory()) {
115234
+ const stat16 = fs75.statSync(gitPath);
115235
+ if (stat16.isDirectory()) {
115166
115236
  pathCacheSet(resolveGitDirCache, cacheKey, gitPath);
115167
115237
  return gitPath;
115168
115238
  }
115169
- if (stat15.isFile()) {
115239
+ if (stat16.isFile()) {
115170
115240
  const contents = fs75.readFileSync(gitPath, "utf8").trim();
115171
115241
  const match2 = contents.match(/^gitdir:\s*(.+)$/i);
115172
115242
  if (!match2) {
@@ -115461,8 +115531,8 @@ function getPosixRelative(from, to) {
115461
115531
  toAbs = fs75.realpathSync(toResolved);
115462
115532
  } catch {
115463
115533
  }
115464
- const relative13 = path76.relative(fromAbs, toAbs);
115465
- const posixRel = toPosixPath2(relative13);
115534
+ const relative12 = path76.relative(fromAbs, toAbs);
115535
+ const posixRel = toPosixPath2(relative12);
115466
115536
  return posixRel === "" ? "." : posixRel;
115467
115537
  }
115468
115538
  __name(getPosixRelative, "getPosixRelative");
@@ -117252,7 +117322,7 @@ var formatMemoryUsage = /* @__PURE__ */ __name((bytes) => {
117252
117322
 
117253
117323
  // packages/core/src/utils/memoryDiagnostics.ts
117254
117324
  init_esbuild_shims();
117255
- import { readdir as readdir14, readFile as readFile26 } from "node:fs/promises";
117325
+ import { readdir as readdir15, readFile as readFile26 } from "node:fs/promises";
117256
117326
  import { execFile as execFile5 } from "node:child_process";
117257
117327
  import process7 from "node:process";
117258
117328
  import { promisify as promisify4 } from "node:util";
@@ -117382,7 +117452,7 @@ function getProcessInternalCount(name3, internalMethod, probe) {
117382
117452
  }
117383
117453
  __name(getProcessInternalCount, "getProcessInternalCount");
117384
117454
  async function countOpenFileDescriptors() {
117385
- return (await readdir14("/proc/self/fd")).length;
117455
+ return (await readdir15("/proc/self/fd")).length;
117386
117456
  }
117387
117457
  __name(countOpenFileDescriptors, "countOpenFileDescriptors");
117388
117458
  async function readProcSmapsRollup() {
@@ -117621,8 +117691,8 @@ function getWelcomeBackStatePath() {
117621
117691
  return path79.join(process.cwd(), ".qwen", WELCOME_BACK_STATE_FILENAME);
117622
117692
  }
117623
117693
  __name(getWelcomeBackStatePath, "getWelcomeBackStatePath");
117624
- function buildSummaryFingerprint(stat15) {
117625
- return `${stat15.mtimeMs}:${stat15.size}`;
117694
+ function buildSummaryFingerprint(stat16) {
117695
+ return `${stat16.mtimeMs}:${stat16.size}`;
117626
117696
  }
117627
117697
  __name(buildSummaryFingerprint, "buildSummaryFingerprint");
117628
117698
  async function getWelcomeBackState() {
@@ -122975,8 +123045,8 @@ function getShellDisplayName({
122975
123045
  case "cmd":
122976
123046
  return "cmd.exe";
122977
123047
  case "powershell": {
122978
- const basename17 = getExecutableBasename(executable).toLowerCase();
122979
- return basename17 === "pwsh.exe" ? "pwsh.exe" : "powershell.exe";
123048
+ const basename18 = getExecutableBasename(executable).toLowerCase();
123049
+ return basename18 === "pwsh.exe" ? "pwsh.exe" : "powershell.exe";
122980
123050
  }
122981
123051
  case "bash":
122982
123052
  return "bash";