@qwen-code/qwen-code 0.12.1 → 0.12.2-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 (2) hide show
  1. package/cli.js +251 -1321
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -31045,9 +31045,9 @@ var require_logging_utils = __commonJS({
31045
31045
  this.debugPkg = pkg2;
31046
31046
  }
31047
31047
  makeLogger(namespace) {
31048
- const debugLogger138 = this.debugPkg(namespace);
31048
+ const debugLogger137 = this.debugPkg(namespace);
31049
31049
  return (fields, ...args) => {
31050
- debugLogger138(args[0], ...args.slice(1));
31050
+ debugLogger137(args[0], ...args.slice(1));
31051
31051
  };
31052
31052
  }
31053
31053
  setFilters() {
@@ -31071,7 +31071,7 @@ var require_logging_utils = __commonJS({
31071
31071
  }
31072
31072
  makeLogger(namespace) {
31073
31073
  var _a7;
31074
- const debugLogger138 = (_a7 = this.upstream) === null || _a7 === void 0 ? void 0 : _a7.makeLogger(namespace);
31074
+ const debugLogger137 = (_a7 = this.upstream) === null || _a7 === void 0 ? void 0 : _a7.makeLogger(namespace);
31075
31075
  return (fields, ...args) => {
31076
31076
  var _a8;
31077
31077
  const severity = (_a8 = fields.severity) !== null && _a8 !== void 0 ? _a8 : LogSeverity.INFO;
@@ -31080,8 +31080,8 @@ var require_logging_utils = __commonJS({
31080
31080
  message: util3.format(...args)
31081
31081
  }, fields);
31082
31082
  const jsonString = JSON.stringify(json3);
31083
- if (debugLogger138) {
31084
- debugLogger138(fields, jsonString);
31083
+ if (debugLogger137) {
31084
+ debugLogger137(fields, jsonString);
31085
31085
  } else {
31086
31086
  console.log("%s", jsonString);
31087
31087
  }
@@ -82560,7 +82560,7 @@ var require_error = __commonJS({
82560
82560
  init_esbuild_shims();
82561
82561
  Object.defineProperty(exports2, "__esModule", { value: true });
82562
82562
  exports2.getErrorMessage = getErrorMessage4;
82563
- exports2.getErrorCode = getErrorCode3;
82563
+ exports2.getErrorCode = getErrorCode4;
82564
82564
  function getErrorMessage4(error40) {
82565
82565
  if (error40 instanceof Error) {
82566
82566
  return error40.message;
@@ -82569,14 +82569,14 @@ var require_error = __commonJS({
82569
82569
  }
82570
82570
  }
82571
82571
  __name(getErrorMessage4, "getErrorMessage");
82572
- function getErrorCode3(error40) {
82572
+ function getErrorCode4(error40) {
82573
82573
  if (typeof error40 === "object" && error40 !== null && "code" in error40 && typeof error40.code === "number") {
82574
82574
  return error40.code;
82575
82575
  } else {
82576
82576
  return null;
82577
82577
  }
82578
82578
  }
82579
- __name(getErrorCode3, "getErrorCode");
82579
+ __name(getErrorCode4, "getErrorCode");
82580
82580
  }
82581
82581
  });
82582
82582
 
@@ -130045,7 +130045,7 @@ function initializeTelemetry(config2) {
130045
130045
  if (telemetryInitialized || !config2.getTelemetryEnabled()) {
130046
130046
  return;
130047
130047
  }
130048
- const debugLogger138 = createDebugLogger("OTEL");
130048
+ const debugLogger137 = createDebugLogger("OTEL");
130049
130049
  const resource = (0, import_resources.resourceFromAttributes)({
130050
130050
  [SemanticResourceAttributes.SERVICE_NAME]: SERVICE_NAME,
130051
130051
  [SemanticResourceAttributes.SERVICE_VERSION]: process.version,
@@ -130114,11 +130114,11 @@ function initializeTelemetry(config2) {
130114
130114
  });
130115
130115
  try {
130116
130116
  sdk.start();
130117
- debugLogger138.debug("OpenTelemetry SDK started successfully.");
130117
+ debugLogger137.debug("OpenTelemetry SDK started successfully.");
130118
130118
  telemetryInitialized = true;
130119
130119
  initializeMetrics(config2);
130120
130120
  } catch (error40) {
130121
- debugLogger138.error("Error starting OpenTelemetry SDK:", error40);
130121
+ debugLogger137.error("Error starting OpenTelemetry SDK:", error40);
130122
130122
  }
130123
130123
  process.on("SIGTERM", () => {
130124
130124
  shutdownTelemetry();
@@ -130134,12 +130134,12 @@ async function shutdownTelemetry() {
130134
130134
  if (!telemetryInitialized || !sdk) {
130135
130135
  return;
130136
130136
  }
130137
- const debugLogger138 = createDebugLogger("OTEL");
130137
+ const debugLogger137 = createDebugLogger("OTEL");
130138
130138
  try {
130139
130139
  await sdk.shutdown();
130140
- debugLogger138.debug("OpenTelemetry SDK shut down successfully.");
130140
+ debugLogger137.debug("OpenTelemetry SDK shut down successfully.");
130141
130141
  } catch (error40) {
130142
- debugLogger138.error("Error shutting down SDK:", error40);
130142
+ debugLogger137.error("Error shutting down SDK:", error40);
130143
130143
  } finally {
130144
130144
  telemetryInitialized = false;
130145
130145
  }
@@ -142990,6 +142990,46 @@ var init_deepseek = __esm({
142990
142990
  const baseUrl = contentGeneratorConfig.baseUrl ?? "";
142991
142991
  return baseUrl.toLowerCase().includes("api.deepseek.com");
142992
142992
  }
142993
+ /**
142994
+ * DeepSeek's API requires message content to be a plain string, not an
142995
+ * array of content parts. Flatten any text-part arrays into joined strings
142996
+ * and reject non-text parts that DeepSeek cannot handle.
142997
+ */
142998
+ buildRequest(request4, userPromptId) {
142999
+ const baseRequest = super.buildRequest(request4, userPromptId);
143000
+ if (!baseRequest.messages?.length) {
143001
+ return baseRequest;
143002
+ }
143003
+ const messages = baseRequest.messages.map((message) => {
143004
+ if (!("content" in message)) {
143005
+ return message;
143006
+ }
143007
+ const { content } = message;
143008
+ if (typeof content === "string" || content === null || content === void 0) {
143009
+ return message;
143010
+ }
143011
+ if (!Array.isArray(content)) {
143012
+ return message;
143013
+ }
143014
+ const text = content.map((part) => {
143015
+ if (typeof part === "string") {
143016
+ return part;
143017
+ }
143018
+ if (part.type === "text") {
143019
+ return part.text ?? "";
143020
+ }
143021
+ return `[Unsupported content type: ${part.type}]`;
143022
+ }).join("\n\n");
143023
+ return {
143024
+ ...message,
143025
+ content: text
143026
+ };
143027
+ });
143028
+ return {
143029
+ ...baseRequest,
143030
+ messages
143031
+ };
143032
+ }
142993
143033
  getDefaultGenerationConfig() {
142994
143034
  return {
142995
143035
  temperature: 0
@@ -157672,7 +157712,7 @@ __export(geminiContentGenerator_exports, {
157672
157712
  createGeminiContentGenerator: () => createGeminiContentGenerator
157673
157713
  });
157674
157714
  function createGeminiContentGenerator(config2, gcConfig) {
157675
- const version2 = "0.12.1";
157715
+ const version2 = "0.12.2-preview.0";
157676
157716
  const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
157677
157717
  const baseHeaders = {
157678
157718
  "User-Agent": userAgent2
@@ -231900,7 +231940,7 @@ var init_write_file = __esm({
231900
231940
  };
231901
231941
  }
231902
231942
  const { originalContent, correctedContent: fileContent, fileExists: fileExists2 } = correctedContentResult;
231903
- const isNewFile = !fileExists2 || correctedContentResult.error !== void 0 && !correctedContentResult.fileExists;
231943
+ let isNewFile = !fileExists2;
231904
231944
  try {
231905
231945
  const dirName = path46.dirname(file_path);
231906
231946
  if (!fs43.existsSync(dirName)) {
@@ -231909,11 +231949,20 @@ var init_write_file = __esm({
231909
231949
  let useBOM = false;
231910
231950
  let detectedEncoding;
231911
231951
  if (!isNewFile) {
231912
- const fileInfo = await this.config.getFileSystemService().readTextFileWithInfo(file_path);
231913
- useBOM = fileInfo.bom;
231914
- detectedEncoding = fileInfo.encoding;
231915
- } else {
231952
+ try {
231953
+ const fileInfo = await this.config.getFileSystemService().readTextFileWithInfo(file_path);
231954
+ useBOM = fileInfo.bom;
231955
+ detectedEncoding = fileInfo.encoding;
231956
+ } catch (error40) {
231957
+ if (!isNodeError(error40) || error40.code !== "ENOENT") {
231958
+ throw error40;
231959
+ }
231960
+ isNewFile = true;
231961
+ }
231962
+ }
231963
+ if (isNewFile) {
231916
231964
  useBOM = this.config.getDefaultFileEncoding() === FileEncoding.UTF8_BOM;
231965
+ detectedEncoding = void 0;
231917
231966
  }
231918
231967
  await this.config.getFileSystemService().writeTextFile(file_path, fileContent, {
231919
231968
  bom: useBOM,
@@ -289605,7 +289654,7 @@ var require_backend = __commonJS({
289605
289654
  value: a2
289606
289655
  });
289607
289656
  }, "useInsertionEffect"),
289608
- useMemo: /* @__PURE__ */ __name(function useMemo34(a2) {
289657
+ useMemo: /* @__PURE__ */ __name(function useMemo33(a2) {
289609
289658
  var b2 = C2();
289610
289659
  a2 = null !== b2 ? b2.memoizedState[0] : a2();
289611
289660
  x3.push({
@@ -356553,1092 +356602,6 @@ var require_supports_hyperlinks = __commonJS({
356553
356602
  }
356554
356603
  });
356555
356604
 
356556
- // node_modules/qrcode-terminal/vendor/QRCode/QRMode.js
356557
- var require_QRMode = __commonJS({
356558
- "node_modules/qrcode-terminal/vendor/QRCode/QRMode.js"(exports2, module2) {
356559
- init_esbuild_shims();
356560
- module2.exports = {
356561
- MODE_NUMBER: 1 << 0,
356562
- MODE_ALPHA_NUM: 1 << 1,
356563
- MODE_8BIT_BYTE: 1 << 2,
356564
- MODE_KANJI: 1 << 3
356565
- };
356566
- }
356567
- });
356568
-
356569
- // node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js
356570
- var require_QR8bitByte = __commonJS({
356571
- "node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js"(exports2, module2) {
356572
- init_esbuild_shims();
356573
- var QRMode = require_QRMode();
356574
- function QR8bitByte(data) {
356575
- this.mode = QRMode.MODE_8BIT_BYTE;
356576
- this.data = data;
356577
- }
356578
- __name(QR8bitByte, "QR8bitByte");
356579
- QR8bitByte.prototype = {
356580
- getLength: /* @__PURE__ */ __name(function() {
356581
- return this.data.length;
356582
- }, "getLength"),
356583
- write: /* @__PURE__ */ __name(function(buffer) {
356584
- for (var i3 = 0; i3 < this.data.length; i3++) {
356585
- buffer.put(this.data.charCodeAt(i3), 8);
356586
- }
356587
- }, "write")
356588
- };
356589
- module2.exports = QR8bitByte;
356590
- }
356591
- });
356592
-
356593
- // node_modules/qrcode-terminal/vendor/QRCode/QRMath.js
356594
- var require_QRMath = __commonJS({
356595
- "node_modules/qrcode-terminal/vendor/QRCode/QRMath.js"(exports2, module2) {
356596
- init_esbuild_shims();
356597
- var QRMath = {
356598
- glog: /* @__PURE__ */ __name(function(n3) {
356599
- if (n3 < 1) {
356600
- throw new Error("glog(" + n3 + ")");
356601
- }
356602
- return QRMath.LOG_TABLE[n3];
356603
- }, "glog"),
356604
- gexp: /* @__PURE__ */ __name(function(n3) {
356605
- while (n3 < 0) {
356606
- n3 += 255;
356607
- }
356608
- while (n3 >= 256) {
356609
- n3 -= 255;
356610
- }
356611
- return QRMath.EXP_TABLE[n3];
356612
- }, "gexp"),
356613
- EXP_TABLE: new Array(256),
356614
- LOG_TABLE: new Array(256)
356615
- };
356616
- for (i3 = 0; i3 < 8; i3++) {
356617
- QRMath.EXP_TABLE[i3] = 1 << i3;
356618
- }
356619
- var i3;
356620
- for (i3 = 8; i3 < 256; i3++) {
356621
- QRMath.EXP_TABLE[i3] = QRMath.EXP_TABLE[i3 - 4] ^ QRMath.EXP_TABLE[i3 - 5] ^ QRMath.EXP_TABLE[i3 - 6] ^ QRMath.EXP_TABLE[i3 - 8];
356622
- }
356623
- var i3;
356624
- for (i3 = 0; i3 < 255; i3++) {
356625
- QRMath.LOG_TABLE[QRMath.EXP_TABLE[i3]] = i3;
356626
- }
356627
- var i3;
356628
- module2.exports = QRMath;
356629
- }
356630
- });
356631
-
356632
- // node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js
356633
- var require_QRPolynomial = __commonJS({
356634
- "node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js"(exports2, module2) {
356635
- init_esbuild_shims();
356636
- var QRMath = require_QRMath();
356637
- function QRPolynomial(num, shift) {
356638
- if (num.length === void 0) {
356639
- throw new Error(num.length + "/" + shift);
356640
- }
356641
- var offset = 0;
356642
- while (offset < num.length && num[offset] === 0) {
356643
- offset++;
356644
- }
356645
- this.num = new Array(num.length - offset + shift);
356646
- for (var i3 = 0; i3 < num.length - offset; i3++) {
356647
- this.num[i3] = num[i3 + offset];
356648
- }
356649
- }
356650
- __name(QRPolynomial, "QRPolynomial");
356651
- QRPolynomial.prototype = {
356652
- get: /* @__PURE__ */ __name(function(index) {
356653
- return this.num[index];
356654
- }, "get"),
356655
- getLength: /* @__PURE__ */ __name(function() {
356656
- return this.num.length;
356657
- }, "getLength"),
356658
- multiply: /* @__PURE__ */ __name(function(e4) {
356659
- var num = new Array(this.getLength() + e4.getLength() - 1);
356660
- for (var i3 = 0; i3 < this.getLength(); i3++) {
356661
- for (var j2 = 0; j2 < e4.getLength(); j2++) {
356662
- num[i3 + j2] ^= QRMath.gexp(QRMath.glog(this.get(i3)) + QRMath.glog(e4.get(j2)));
356663
- }
356664
- }
356665
- return new QRPolynomial(num, 0);
356666
- }, "multiply"),
356667
- mod: /* @__PURE__ */ __name(function(e4) {
356668
- if (this.getLength() - e4.getLength() < 0) {
356669
- return this;
356670
- }
356671
- var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e4.get(0));
356672
- var num = new Array(this.getLength());
356673
- for (var i3 = 0; i3 < this.getLength(); i3++) {
356674
- num[i3] = this.get(i3);
356675
- }
356676
- for (var x3 = 0; x3 < e4.getLength(); x3++) {
356677
- num[x3] ^= QRMath.gexp(QRMath.glog(e4.get(x3)) + ratio);
356678
- }
356679
- return new QRPolynomial(num, 0).mod(e4);
356680
- }, "mod")
356681
- };
356682
- module2.exports = QRPolynomial;
356683
- }
356684
- });
356685
-
356686
- // node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js
356687
- var require_QRMaskPattern = __commonJS({
356688
- "node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js"(exports2, module2) {
356689
- init_esbuild_shims();
356690
- module2.exports = {
356691
- PATTERN000: 0,
356692
- PATTERN001: 1,
356693
- PATTERN010: 2,
356694
- PATTERN011: 3,
356695
- PATTERN100: 4,
356696
- PATTERN101: 5,
356697
- PATTERN110: 6,
356698
- PATTERN111: 7
356699
- };
356700
- }
356701
- });
356702
-
356703
- // node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js
356704
- var require_QRUtil = __commonJS({
356705
- "node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js"(exports2, module2) {
356706
- init_esbuild_shims();
356707
- var QRMode = require_QRMode();
356708
- var QRPolynomial = require_QRPolynomial();
356709
- var QRMath = require_QRMath();
356710
- var QRMaskPattern = require_QRMaskPattern();
356711
- var QRUtil = {
356712
- PATTERN_POSITION_TABLE: [
356713
- [],
356714
- [6, 18],
356715
- [6, 22],
356716
- [6, 26],
356717
- [6, 30],
356718
- [6, 34],
356719
- [6, 22, 38],
356720
- [6, 24, 42],
356721
- [6, 26, 46],
356722
- [6, 28, 50],
356723
- [6, 30, 54],
356724
- [6, 32, 58],
356725
- [6, 34, 62],
356726
- [6, 26, 46, 66],
356727
- [6, 26, 48, 70],
356728
- [6, 26, 50, 74],
356729
- [6, 30, 54, 78],
356730
- [6, 30, 56, 82],
356731
- [6, 30, 58, 86],
356732
- [6, 34, 62, 90],
356733
- [6, 28, 50, 72, 94],
356734
- [6, 26, 50, 74, 98],
356735
- [6, 30, 54, 78, 102],
356736
- [6, 28, 54, 80, 106],
356737
- [6, 32, 58, 84, 110],
356738
- [6, 30, 58, 86, 114],
356739
- [6, 34, 62, 90, 118],
356740
- [6, 26, 50, 74, 98, 122],
356741
- [6, 30, 54, 78, 102, 126],
356742
- [6, 26, 52, 78, 104, 130],
356743
- [6, 30, 56, 82, 108, 134],
356744
- [6, 34, 60, 86, 112, 138],
356745
- [6, 30, 58, 86, 114, 142],
356746
- [6, 34, 62, 90, 118, 146],
356747
- [6, 30, 54, 78, 102, 126, 150],
356748
- [6, 24, 50, 76, 102, 128, 154],
356749
- [6, 28, 54, 80, 106, 132, 158],
356750
- [6, 32, 58, 84, 110, 136, 162],
356751
- [6, 26, 54, 82, 110, 138, 166],
356752
- [6, 30, 58, 86, 114, 142, 170]
356753
- ],
356754
- G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
356755
- G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
356756
- G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
356757
- getBCHTypeInfo: /* @__PURE__ */ __name(function(data) {
356758
- var d2 = data << 10;
356759
- while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
356760
- d2 ^= QRUtil.G15 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G15);
356761
- }
356762
- return (data << 10 | d2) ^ QRUtil.G15_MASK;
356763
- }, "getBCHTypeInfo"),
356764
- getBCHTypeNumber: /* @__PURE__ */ __name(function(data) {
356765
- var d2 = data << 12;
356766
- while (QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
356767
- d2 ^= QRUtil.G18 << QRUtil.getBCHDigit(d2) - QRUtil.getBCHDigit(QRUtil.G18);
356768
- }
356769
- return data << 12 | d2;
356770
- }, "getBCHTypeNumber"),
356771
- getBCHDigit: /* @__PURE__ */ __name(function(data) {
356772
- var digit = 0;
356773
- while (data !== 0) {
356774
- digit++;
356775
- data >>>= 1;
356776
- }
356777
- return digit;
356778
- }, "getBCHDigit"),
356779
- getPatternPosition: /* @__PURE__ */ __name(function(typeNumber) {
356780
- return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
356781
- }, "getPatternPosition"),
356782
- getMask: /* @__PURE__ */ __name(function(maskPattern, i3, j2) {
356783
- switch (maskPattern) {
356784
- case QRMaskPattern.PATTERN000:
356785
- return (i3 + j2) % 2 === 0;
356786
- case QRMaskPattern.PATTERN001:
356787
- return i3 % 2 === 0;
356788
- case QRMaskPattern.PATTERN010:
356789
- return j2 % 3 === 0;
356790
- case QRMaskPattern.PATTERN011:
356791
- return (i3 + j2) % 3 === 0;
356792
- case QRMaskPattern.PATTERN100:
356793
- return (Math.floor(i3 / 2) + Math.floor(j2 / 3)) % 2 === 0;
356794
- case QRMaskPattern.PATTERN101:
356795
- return i3 * j2 % 2 + i3 * j2 % 3 === 0;
356796
- case QRMaskPattern.PATTERN110:
356797
- return (i3 * j2 % 2 + i3 * j2 % 3) % 2 === 0;
356798
- case QRMaskPattern.PATTERN111:
356799
- return (i3 * j2 % 3 + (i3 + j2) % 2) % 2 === 0;
356800
- default:
356801
- throw new Error("bad maskPattern:" + maskPattern);
356802
- }
356803
- }, "getMask"),
356804
- getErrorCorrectPolynomial: /* @__PURE__ */ __name(function(errorCorrectLength) {
356805
- var a2 = new QRPolynomial([1], 0);
356806
- for (var i3 = 0; i3 < errorCorrectLength; i3++) {
356807
- a2 = a2.multiply(new QRPolynomial([1, QRMath.gexp(i3)], 0));
356808
- }
356809
- return a2;
356810
- }, "getErrorCorrectPolynomial"),
356811
- getLengthInBits: /* @__PURE__ */ __name(function(mode, type) {
356812
- if (1 <= type && type < 10) {
356813
- switch (mode) {
356814
- case QRMode.MODE_NUMBER:
356815
- return 10;
356816
- case QRMode.MODE_ALPHA_NUM:
356817
- return 9;
356818
- case QRMode.MODE_8BIT_BYTE:
356819
- return 8;
356820
- case QRMode.MODE_KANJI:
356821
- return 8;
356822
- default:
356823
- throw new Error("mode:" + mode);
356824
- }
356825
- } else if (type < 27) {
356826
- switch (mode) {
356827
- case QRMode.MODE_NUMBER:
356828
- return 12;
356829
- case QRMode.MODE_ALPHA_NUM:
356830
- return 11;
356831
- case QRMode.MODE_8BIT_BYTE:
356832
- return 16;
356833
- case QRMode.MODE_KANJI:
356834
- return 10;
356835
- default:
356836
- throw new Error("mode:" + mode);
356837
- }
356838
- } else if (type < 41) {
356839
- switch (mode) {
356840
- case QRMode.MODE_NUMBER:
356841
- return 14;
356842
- case QRMode.MODE_ALPHA_NUM:
356843
- return 13;
356844
- case QRMode.MODE_8BIT_BYTE:
356845
- return 16;
356846
- case QRMode.MODE_KANJI:
356847
- return 12;
356848
- default:
356849
- throw new Error("mode:" + mode);
356850
- }
356851
- } else {
356852
- throw new Error("type:" + type);
356853
- }
356854
- }, "getLengthInBits"),
356855
- getLostPoint: /* @__PURE__ */ __name(function(qrCode) {
356856
- var moduleCount = qrCode.getModuleCount();
356857
- var lostPoint = 0;
356858
- var row = 0;
356859
- var col = 0;
356860
- for (row = 0; row < moduleCount; row++) {
356861
- for (col = 0; col < moduleCount; col++) {
356862
- var sameCount = 0;
356863
- var dark = qrCode.isDark(row, col);
356864
- for (var r5 = -1; r5 <= 1; r5++) {
356865
- if (row + r5 < 0 || moduleCount <= row + r5) {
356866
- continue;
356867
- }
356868
- for (var c4 = -1; c4 <= 1; c4++) {
356869
- if (col + c4 < 0 || moduleCount <= col + c4) {
356870
- continue;
356871
- }
356872
- if (r5 === 0 && c4 === 0) {
356873
- continue;
356874
- }
356875
- if (dark === qrCode.isDark(row + r5, col + c4)) {
356876
- sameCount++;
356877
- }
356878
- }
356879
- }
356880
- if (sameCount > 5) {
356881
- lostPoint += 3 + sameCount - 5;
356882
- }
356883
- }
356884
- }
356885
- for (row = 0; row < moduleCount - 1; row++) {
356886
- for (col = 0; col < moduleCount - 1; col++) {
356887
- var count = 0;
356888
- if (qrCode.isDark(row, col)) count++;
356889
- if (qrCode.isDark(row + 1, col)) count++;
356890
- if (qrCode.isDark(row, col + 1)) count++;
356891
- if (qrCode.isDark(row + 1, col + 1)) count++;
356892
- if (count === 0 || count === 4) {
356893
- lostPoint += 3;
356894
- }
356895
- }
356896
- }
356897
- for (row = 0; row < moduleCount; row++) {
356898
- for (col = 0; col < moduleCount - 6; col++) {
356899
- if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
356900
- lostPoint += 40;
356901
- }
356902
- }
356903
- }
356904
- for (col = 0; col < moduleCount; col++) {
356905
- for (row = 0; row < moduleCount - 6; row++) {
356906
- if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
356907
- lostPoint += 40;
356908
- }
356909
- }
356910
- }
356911
- var darkCount = 0;
356912
- for (col = 0; col < moduleCount; col++) {
356913
- for (row = 0; row < moduleCount; row++) {
356914
- if (qrCode.isDark(row, col)) {
356915
- darkCount++;
356916
- }
356917
- }
356918
- }
356919
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
356920
- lostPoint += ratio * 10;
356921
- return lostPoint;
356922
- }, "getLostPoint")
356923
- };
356924
- module2.exports = QRUtil;
356925
- }
356926
- });
356927
-
356928
- // node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js
356929
- var require_QRErrorCorrectLevel = __commonJS({
356930
- "node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js"(exports2, module2) {
356931
- init_esbuild_shims();
356932
- module2.exports = {
356933
- L: 1,
356934
- M: 0,
356935
- Q: 3,
356936
- H: 2
356937
- };
356938
- }
356939
- });
356940
-
356941
- // node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js
356942
- var require_QRRSBlock = __commonJS({
356943
- "node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js"(exports2, module2) {
356944
- init_esbuild_shims();
356945
- var QRErrorCorrectLevel = require_QRErrorCorrectLevel();
356946
- function QRRSBlock(totalCount, dataCount) {
356947
- this.totalCount = totalCount;
356948
- this.dataCount = dataCount;
356949
- }
356950
- __name(QRRSBlock, "QRRSBlock");
356951
- QRRSBlock.RS_BLOCK_TABLE = [
356952
- // L
356953
- // M
356954
- // Q
356955
- // H
356956
- // 1
356957
- [1, 26, 19],
356958
- [1, 26, 16],
356959
- [1, 26, 13],
356960
- [1, 26, 9],
356961
- // 2
356962
- [1, 44, 34],
356963
- [1, 44, 28],
356964
- [1, 44, 22],
356965
- [1, 44, 16],
356966
- // 3
356967
- [1, 70, 55],
356968
- [1, 70, 44],
356969
- [2, 35, 17],
356970
- [2, 35, 13],
356971
- // 4
356972
- [1, 100, 80],
356973
- [2, 50, 32],
356974
- [2, 50, 24],
356975
- [4, 25, 9],
356976
- // 5
356977
- [1, 134, 108],
356978
- [2, 67, 43],
356979
- [2, 33, 15, 2, 34, 16],
356980
- [2, 33, 11, 2, 34, 12],
356981
- // 6
356982
- [2, 86, 68],
356983
- [4, 43, 27],
356984
- [4, 43, 19],
356985
- [4, 43, 15],
356986
- // 7
356987
- [2, 98, 78],
356988
- [4, 49, 31],
356989
- [2, 32, 14, 4, 33, 15],
356990
- [4, 39, 13, 1, 40, 14],
356991
- // 8
356992
- [2, 121, 97],
356993
- [2, 60, 38, 2, 61, 39],
356994
- [4, 40, 18, 2, 41, 19],
356995
- [4, 40, 14, 2, 41, 15],
356996
- // 9
356997
- [2, 146, 116],
356998
- [3, 58, 36, 2, 59, 37],
356999
- [4, 36, 16, 4, 37, 17],
357000
- [4, 36, 12, 4, 37, 13],
357001
- // 10
357002
- [2, 86, 68, 2, 87, 69],
357003
- [4, 69, 43, 1, 70, 44],
357004
- [6, 43, 19, 2, 44, 20],
357005
- [6, 43, 15, 2, 44, 16],
357006
- // 11
357007
- [4, 101, 81],
357008
- [1, 80, 50, 4, 81, 51],
357009
- [4, 50, 22, 4, 51, 23],
357010
- [3, 36, 12, 8, 37, 13],
357011
- // 12
357012
- [2, 116, 92, 2, 117, 93],
357013
- [6, 58, 36, 2, 59, 37],
357014
- [4, 46, 20, 6, 47, 21],
357015
- [7, 42, 14, 4, 43, 15],
357016
- // 13
357017
- [4, 133, 107],
357018
- [8, 59, 37, 1, 60, 38],
357019
- [8, 44, 20, 4, 45, 21],
357020
- [12, 33, 11, 4, 34, 12],
357021
- // 14
357022
- [3, 145, 115, 1, 146, 116],
357023
- [4, 64, 40, 5, 65, 41],
357024
- [11, 36, 16, 5, 37, 17],
357025
- [11, 36, 12, 5, 37, 13],
357026
- // 15
357027
- [5, 109, 87, 1, 110, 88],
357028
- [5, 65, 41, 5, 66, 42],
357029
- [5, 54, 24, 7, 55, 25],
357030
- [11, 36, 12],
357031
- // 16
357032
- [5, 122, 98, 1, 123, 99],
357033
- [7, 73, 45, 3, 74, 46],
357034
- [15, 43, 19, 2, 44, 20],
357035
- [3, 45, 15, 13, 46, 16],
357036
- // 17
357037
- [1, 135, 107, 5, 136, 108],
357038
- [10, 74, 46, 1, 75, 47],
357039
- [1, 50, 22, 15, 51, 23],
357040
- [2, 42, 14, 17, 43, 15],
357041
- // 18
357042
- [5, 150, 120, 1, 151, 121],
357043
- [9, 69, 43, 4, 70, 44],
357044
- [17, 50, 22, 1, 51, 23],
357045
- [2, 42, 14, 19, 43, 15],
357046
- // 19
357047
- [3, 141, 113, 4, 142, 114],
357048
- [3, 70, 44, 11, 71, 45],
357049
- [17, 47, 21, 4, 48, 22],
357050
- [9, 39, 13, 16, 40, 14],
357051
- // 20
357052
- [3, 135, 107, 5, 136, 108],
357053
- [3, 67, 41, 13, 68, 42],
357054
- [15, 54, 24, 5, 55, 25],
357055
- [15, 43, 15, 10, 44, 16],
357056
- // 21
357057
- [4, 144, 116, 4, 145, 117],
357058
- [17, 68, 42],
357059
- [17, 50, 22, 6, 51, 23],
357060
- [19, 46, 16, 6, 47, 17],
357061
- // 22
357062
- [2, 139, 111, 7, 140, 112],
357063
- [17, 74, 46],
357064
- [7, 54, 24, 16, 55, 25],
357065
- [34, 37, 13],
357066
- // 23
357067
- [4, 151, 121, 5, 152, 122],
357068
- [4, 75, 47, 14, 76, 48],
357069
- [11, 54, 24, 14, 55, 25],
357070
- [16, 45, 15, 14, 46, 16],
357071
- // 24
357072
- [6, 147, 117, 4, 148, 118],
357073
- [6, 73, 45, 14, 74, 46],
357074
- [11, 54, 24, 16, 55, 25],
357075
- [30, 46, 16, 2, 47, 17],
357076
- // 25
357077
- [8, 132, 106, 4, 133, 107],
357078
- [8, 75, 47, 13, 76, 48],
357079
- [7, 54, 24, 22, 55, 25],
357080
- [22, 45, 15, 13, 46, 16],
357081
- // 26
357082
- [10, 142, 114, 2, 143, 115],
357083
- [19, 74, 46, 4, 75, 47],
357084
- [28, 50, 22, 6, 51, 23],
357085
- [33, 46, 16, 4, 47, 17],
357086
- // 27
357087
- [8, 152, 122, 4, 153, 123],
357088
- [22, 73, 45, 3, 74, 46],
357089
- [8, 53, 23, 26, 54, 24],
357090
- [12, 45, 15, 28, 46, 16],
357091
- // 28
357092
- [3, 147, 117, 10, 148, 118],
357093
- [3, 73, 45, 23, 74, 46],
357094
- [4, 54, 24, 31, 55, 25],
357095
- [11, 45, 15, 31, 46, 16],
357096
- // 29
357097
- [7, 146, 116, 7, 147, 117],
357098
- [21, 73, 45, 7, 74, 46],
357099
- [1, 53, 23, 37, 54, 24],
357100
- [19, 45, 15, 26, 46, 16],
357101
- // 30
357102
- [5, 145, 115, 10, 146, 116],
357103
- [19, 75, 47, 10, 76, 48],
357104
- [15, 54, 24, 25, 55, 25],
357105
- [23, 45, 15, 25, 46, 16],
357106
- // 31
357107
- [13, 145, 115, 3, 146, 116],
357108
- [2, 74, 46, 29, 75, 47],
357109
- [42, 54, 24, 1, 55, 25],
357110
- [23, 45, 15, 28, 46, 16],
357111
- // 32
357112
- [17, 145, 115],
357113
- [10, 74, 46, 23, 75, 47],
357114
- [10, 54, 24, 35, 55, 25],
357115
- [19, 45, 15, 35, 46, 16],
357116
- // 33
357117
- [17, 145, 115, 1, 146, 116],
357118
- [14, 74, 46, 21, 75, 47],
357119
- [29, 54, 24, 19, 55, 25],
357120
- [11, 45, 15, 46, 46, 16],
357121
- // 34
357122
- [13, 145, 115, 6, 146, 116],
357123
- [14, 74, 46, 23, 75, 47],
357124
- [44, 54, 24, 7, 55, 25],
357125
- [59, 46, 16, 1, 47, 17],
357126
- // 35
357127
- [12, 151, 121, 7, 152, 122],
357128
- [12, 75, 47, 26, 76, 48],
357129
- [39, 54, 24, 14, 55, 25],
357130
- [22, 45, 15, 41, 46, 16],
357131
- // 36
357132
- [6, 151, 121, 14, 152, 122],
357133
- [6, 75, 47, 34, 76, 48],
357134
- [46, 54, 24, 10, 55, 25],
357135
- [2, 45, 15, 64, 46, 16],
357136
- // 37
357137
- [17, 152, 122, 4, 153, 123],
357138
- [29, 74, 46, 14, 75, 47],
357139
- [49, 54, 24, 10, 55, 25],
357140
- [24, 45, 15, 46, 46, 16],
357141
- // 38
357142
- [4, 152, 122, 18, 153, 123],
357143
- [13, 74, 46, 32, 75, 47],
357144
- [48, 54, 24, 14, 55, 25],
357145
- [42, 45, 15, 32, 46, 16],
357146
- // 39
357147
- [20, 147, 117, 4, 148, 118],
357148
- [40, 75, 47, 7, 76, 48],
357149
- [43, 54, 24, 22, 55, 25],
357150
- [10, 45, 15, 67, 46, 16],
357151
- // 40
357152
- [19, 148, 118, 6, 149, 119],
357153
- [18, 75, 47, 31, 76, 48],
357154
- [34, 54, 24, 34, 55, 25],
357155
- [20, 45, 15, 61, 46, 16]
357156
- ];
357157
- QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {
357158
- var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
357159
- if (rsBlock === void 0) {
357160
- throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
357161
- }
357162
- var length = rsBlock.length / 3;
357163
- var list3 = [];
357164
- for (var i3 = 0; i3 < length; i3++) {
357165
- var count = rsBlock[i3 * 3 + 0];
357166
- var totalCount = rsBlock[i3 * 3 + 1];
357167
- var dataCount = rsBlock[i3 * 3 + 2];
357168
- for (var j2 = 0; j2 < count; j2++) {
357169
- list3.push(new QRRSBlock(totalCount, dataCount));
357170
- }
357171
- }
357172
- return list3;
357173
- };
357174
- QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {
357175
- switch (errorCorrectLevel) {
357176
- case QRErrorCorrectLevel.L:
357177
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
357178
- case QRErrorCorrectLevel.M:
357179
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
357180
- case QRErrorCorrectLevel.Q:
357181
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
357182
- case QRErrorCorrectLevel.H:
357183
- return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
357184
- default:
357185
- return void 0;
357186
- }
357187
- };
357188
- module2.exports = QRRSBlock;
357189
- }
357190
- });
357191
-
357192
- // node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js
357193
- var require_QRBitBuffer = __commonJS({
357194
- "node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js"(exports2, module2) {
357195
- init_esbuild_shims();
357196
- function QRBitBuffer() {
357197
- this.buffer = [];
357198
- this.length = 0;
357199
- }
357200
- __name(QRBitBuffer, "QRBitBuffer");
357201
- QRBitBuffer.prototype = {
357202
- get: /* @__PURE__ */ __name(function(index) {
357203
- var bufIndex = Math.floor(index / 8);
357204
- return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
357205
- }, "get"),
357206
- put: /* @__PURE__ */ __name(function(num, length) {
357207
- for (var i3 = 0; i3 < length; i3++) {
357208
- this.putBit((num >>> length - i3 - 1 & 1) == 1);
357209
- }
357210
- }, "put"),
357211
- getLengthInBits: /* @__PURE__ */ __name(function() {
357212
- return this.length;
357213
- }, "getLengthInBits"),
357214
- putBit: /* @__PURE__ */ __name(function(bit) {
357215
- var bufIndex = Math.floor(this.length / 8);
357216
- if (this.buffer.length <= bufIndex) {
357217
- this.buffer.push(0);
357218
- }
357219
- if (bit) {
357220
- this.buffer[bufIndex] |= 128 >>> this.length % 8;
357221
- }
357222
- this.length++;
357223
- }, "putBit")
357224
- };
357225
- module2.exports = QRBitBuffer;
357226
- }
357227
- });
357228
-
357229
- // node_modules/qrcode-terminal/vendor/QRCode/index.js
357230
- var require_QRCode = __commonJS({
357231
- "node_modules/qrcode-terminal/vendor/QRCode/index.js"(exports2, module2) {
357232
- init_esbuild_shims();
357233
- var QR8bitByte = require_QR8bitByte();
357234
- var QRUtil = require_QRUtil();
357235
- var QRPolynomial = require_QRPolynomial();
357236
- var QRRSBlock = require_QRRSBlock();
357237
- var QRBitBuffer = require_QRBitBuffer();
357238
- function QRCode(typeNumber, errorCorrectLevel) {
357239
- this.typeNumber = typeNumber;
357240
- this.errorCorrectLevel = errorCorrectLevel;
357241
- this.modules = null;
357242
- this.moduleCount = 0;
357243
- this.dataCache = null;
357244
- this.dataList = [];
357245
- }
357246
- __name(QRCode, "QRCode");
357247
- QRCode.prototype = {
357248
- addData: /* @__PURE__ */ __name(function(data) {
357249
- var newData = new QR8bitByte(data);
357250
- this.dataList.push(newData);
357251
- this.dataCache = null;
357252
- }, "addData"),
357253
- isDark: /* @__PURE__ */ __name(function(row, col) {
357254
- if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
357255
- throw new Error(row + "," + col);
357256
- }
357257
- return this.modules[row][col];
357258
- }, "isDark"),
357259
- getModuleCount: /* @__PURE__ */ __name(function() {
357260
- return this.moduleCount;
357261
- }, "getModuleCount"),
357262
- make: /* @__PURE__ */ __name(function() {
357263
- if (this.typeNumber < 1) {
357264
- var typeNumber = 1;
357265
- for (typeNumber = 1; typeNumber < 40; typeNumber++) {
357266
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
357267
- var buffer = new QRBitBuffer();
357268
- var totalDataCount = 0;
357269
- for (var i3 = 0; i3 < rsBlocks.length; i3++) {
357270
- totalDataCount += rsBlocks[i3].dataCount;
357271
- }
357272
- for (var x3 = 0; x3 < this.dataList.length; x3++) {
357273
- var data = this.dataList[x3];
357274
- buffer.put(data.mode, 4);
357275
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
357276
- data.write(buffer);
357277
- }
357278
- if (buffer.getLengthInBits() <= totalDataCount * 8)
357279
- break;
357280
- }
357281
- this.typeNumber = typeNumber;
357282
- }
357283
- this.makeImpl(false, this.getBestMaskPattern());
357284
- }, "make"),
357285
- makeImpl: /* @__PURE__ */ __name(function(test, maskPattern) {
357286
- this.moduleCount = this.typeNumber * 4 + 17;
357287
- this.modules = new Array(this.moduleCount);
357288
- for (var row = 0; row < this.moduleCount; row++) {
357289
- this.modules[row] = new Array(this.moduleCount);
357290
- for (var col = 0; col < this.moduleCount; col++) {
357291
- this.modules[row][col] = null;
357292
- }
357293
- }
357294
- this.setupPositionProbePattern(0, 0);
357295
- this.setupPositionProbePattern(this.moduleCount - 7, 0);
357296
- this.setupPositionProbePattern(0, this.moduleCount - 7);
357297
- this.setupPositionAdjustPattern();
357298
- this.setupTimingPattern();
357299
- this.setupTypeInfo(test, maskPattern);
357300
- if (this.typeNumber >= 7) {
357301
- this.setupTypeNumber(test);
357302
- }
357303
- if (this.dataCache === null) {
357304
- this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
357305
- }
357306
- this.mapData(this.dataCache, maskPattern);
357307
- }, "makeImpl"),
357308
- setupPositionProbePattern: /* @__PURE__ */ __name(function(row, col) {
357309
- for (var r5 = -1; r5 <= 7; r5++) {
357310
- if (row + r5 <= -1 || this.moduleCount <= row + r5) continue;
357311
- for (var c4 = -1; c4 <= 7; c4++) {
357312
- if (col + c4 <= -1 || this.moduleCount <= col + c4) continue;
357313
- if (0 <= r5 && r5 <= 6 && (c4 === 0 || c4 === 6) || 0 <= c4 && c4 <= 6 && (r5 === 0 || r5 === 6) || 2 <= r5 && r5 <= 4 && 2 <= c4 && c4 <= 4) {
357314
- this.modules[row + r5][col + c4] = true;
357315
- } else {
357316
- this.modules[row + r5][col + c4] = false;
357317
- }
357318
- }
357319
- }
357320
- }, "setupPositionProbePattern"),
357321
- getBestMaskPattern: /* @__PURE__ */ __name(function() {
357322
- var minLostPoint = 0;
357323
- var pattern = 0;
357324
- for (var i3 = 0; i3 < 8; i3++) {
357325
- this.makeImpl(true, i3);
357326
- var lostPoint = QRUtil.getLostPoint(this);
357327
- if (i3 === 0 || minLostPoint > lostPoint) {
357328
- minLostPoint = lostPoint;
357329
- pattern = i3;
357330
- }
357331
- }
357332
- return pattern;
357333
- }, "getBestMaskPattern"),
357334
- createMovieClip: /* @__PURE__ */ __name(function(target_mc, instance_name, depth) {
357335
- var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
357336
- var cs = 1;
357337
- this.make();
357338
- for (var row = 0; row < this.modules.length; row++) {
357339
- var y2 = row * cs;
357340
- for (var col = 0; col < this.modules[row].length; col++) {
357341
- var x3 = col * cs;
357342
- var dark = this.modules[row][col];
357343
- if (dark) {
357344
- qr_mc.beginFill(0, 100);
357345
- qr_mc.moveTo(x3, y2);
357346
- qr_mc.lineTo(x3 + cs, y2);
357347
- qr_mc.lineTo(x3 + cs, y2 + cs);
357348
- qr_mc.lineTo(x3, y2 + cs);
357349
- qr_mc.endFill();
357350
- }
357351
- }
357352
- }
357353
- return qr_mc;
357354
- }, "createMovieClip"),
357355
- setupTimingPattern: /* @__PURE__ */ __name(function() {
357356
- for (var r5 = 8; r5 < this.moduleCount - 8; r5++) {
357357
- if (this.modules[r5][6] !== null) {
357358
- continue;
357359
- }
357360
- this.modules[r5][6] = r5 % 2 === 0;
357361
- }
357362
- for (var c4 = 8; c4 < this.moduleCount - 8; c4++) {
357363
- if (this.modules[6][c4] !== null) {
357364
- continue;
357365
- }
357366
- this.modules[6][c4] = c4 % 2 === 0;
357367
- }
357368
- }, "setupTimingPattern"),
357369
- setupPositionAdjustPattern: /* @__PURE__ */ __name(function() {
357370
- var pos2 = QRUtil.getPatternPosition(this.typeNumber);
357371
- for (var i3 = 0; i3 < pos2.length; i3++) {
357372
- for (var j2 = 0; j2 < pos2.length; j2++) {
357373
- var row = pos2[i3];
357374
- var col = pos2[j2];
357375
- if (this.modules[row][col] !== null) {
357376
- continue;
357377
- }
357378
- for (var r5 = -2; r5 <= 2; r5++) {
357379
- for (var c4 = -2; c4 <= 2; c4++) {
357380
- if (Math.abs(r5) === 2 || Math.abs(c4) === 2 || r5 === 0 && c4 === 0) {
357381
- this.modules[row + r5][col + c4] = true;
357382
- } else {
357383
- this.modules[row + r5][col + c4] = false;
357384
- }
357385
- }
357386
- }
357387
- }
357388
- }
357389
- }, "setupPositionAdjustPattern"),
357390
- setupTypeNumber: /* @__PURE__ */ __name(function(test) {
357391
- var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
357392
- var mod2;
357393
- for (var i3 = 0; i3 < 18; i3++) {
357394
- mod2 = !test && (bits >> i3 & 1) === 1;
357395
- this.modules[Math.floor(i3 / 3)][i3 % 3 + this.moduleCount - 8 - 3] = mod2;
357396
- }
357397
- for (var x3 = 0; x3 < 18; x3++) {
357398
- mod2 = !test && (bits >> x3 & 1) === 1;
357399
- this.modules[x3 % 3 + this.moduleCount - 8 - 3][Math.floor(x3 / 3)] = mod2;
357400
- }
357401
- }, "setupTypeNumber"),
357402
- setupTypeInfo: /* @__PURE__ */ __name(function(test, maskPattern) {
357403
- var data = this.errorCorrectLevel << 3 | maskPattern;
357404
- var bits = QRUtil.getBCHTypeInfo(data);
357405
- var mod2;
357406
- for (var v2 = 0; v2 < 15; v2++) {
357407
- mod2 = !test && (bits >> v2 & 1) === 1;
357408
- if (v2 < 6) {
357409
- this.modules[v2][8] = mod2;
357410
- } else if (v2 < 8) {
357411
- this.modules[v2 + 1][8] = mod2;
357412
- } else {
357413
- this.modules[this.moduleCount - 15 + v2][8] = mod2;
357414
- }
357415
- }
357416
- for (var h3 = 0; h3 < 15; h3++) {
357417
- mod2 = !test && (bits >> h3 & 1) === 1;
357418
- if (h3 < 8) {
357419
- this.modules[8][this.moduleCount - h3 - 1] = mod2;
357420
- } else if (h3 < 9) {
357421
- this.modules[8][15 - h3 - 1 + 1] = mod2;
357422
- } else {
357423
- this.modules[8][15 - h3 - 1] = mod2;
357424
- }
357425
- }
357426
- this.modules[this.moduleCount - 8][8] = !test;
357427
- }, "setupTypeInfo"),
357428
- mapData: /* @__PURE__ */ __name(function(data, maskPattern) {
357429
- var inc = -1;
357430
- var row = this.moduleCount - 1;
357431
- var bitIndex = 7;
357432
- var byteIndex = 0;
357433
- for (var col = this.moduleCount - 1; col > 0; col -= 2) {
357434
- if (col === 6) col--;
357435
- while (true) {
357436
- for (var c4 = 0; c4 < 2; c4++) {
357437
- if (this.modules[row][col - c4] === null) {
357438
- var dark = false;
357439
- if (byteIndex < data.length) {
357440
- dark = (data[byteIndex] >>> bitIndex & 1) === 1;
357441
- }
357442
- var mask = QRUtil.getMask(maskPattern, row, col - c4);
357443
- if (mask) {
357444
- dark = !dark;
357445
- }
357446
- this.modules[row][col - c4] = dark;
357447
- bitIndex--;
357448
- if (bitIndex === -1) {
357449
- byteIndex++;
357450
- bitIndex = 7;
357451
- }
357452
- }
357453
- }
357454
- row += inc;
357455
- if (row < 0 || this.moduleCount <= row) {
357456
- row -= inc;
357457
- inc = -inc;
357458
- break;
357459
- }
357460
- }
357461
- }
357462
- }, "mapData")
357463
- };
357464
- QRCode.PAD0 = 236;
357465
- QRCode.PAD1 = 17;
357466
- QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
357467
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
357468
- var buffer = new QRBitBuffer();
357469
- for (var i3 = 0; i3 < dataList.length; i3++) {
357470
- var data = dataList[i3];
357471
- buffer.put(data.mode, 4);
357472
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
357473
- data.write(buffer);
357474
- }
357475
- var totalDataCount = 0;
357476
- for (var x3 = 0; x3 < rsBlocks.length; x3++) {
357477
- totalDataCount += rsBlocks[x3].dataCount;
357478
- }
357479
- if (buffer.getLengthInBits() > totalDataCount * 8) {
357480
- throw new Error("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
357481
- }
357482
- if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
357483
- buffer.put(0, 4);
357484
- }
357485
- while (buffer.getLengthInBits() % 8 !== 0) {
357486
- buffer.putBit(false);
357487
- }
357488
- while (true) {
357489
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
357490
- break;
357491
- }
357492
- buffer.put(QRCode.PAD0, 8);
357493
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
357494
- break;
357495
- }
357496
- buffer.put(QRCode.PAD1, 8);
357497
- }
357498
- return QRCode.createBytes(buffer, rsBlocks);
357499
- };
357500
- QRCode.createBytes = function(buffer, rsBlocks) {
357501
- var offset = 0;
357502
- var maxDcCount = 0;
357503
- var maxEcCount = 0;
357504
- var dcdata = new Array(rsBlocks.length);
357505
- var ecdata = new Array(rsBlocks.length);
357506
- for (var r5 = 0; r5 < rsBlocks.length; r5++) {
357507
- var dcCount = rsBlocks[r5].dataCount;
357508
- var ecCount = rsBlocks[r5].totalCount - dcCount;
357509
- maxDcCount = Math.max(maxDcCount, dcCount);
357510
- maxEcCount = Math.max(maxEcCount, ecCount);
357511
- dcdata[r5] = new Array(dcCount);
357512
- for (var i3 = 0; i3 < dcdata[r5].length; i3++) {
357513
- dcdata[r5][i3] = 255 & buffer.buffer[i3 + offset];
357514
- }
357515
- offset += dcCount;
357516
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
357517
- var rawPoly = new QRPolynomial(dcdata[r5], rsPoly.getLength() - 1);
357518
- var modPoly = rawPoly.mod(rsPoly);
357519
- ecdata[r5] = new Array(rsPoly.getLength() - 1);
357520
- for (var x3 = 0; x3 < ecdata[r5].length; x3++) {
357521
- var modIndex = x3 + modPoly.getLength() - ecdata[r5].length;
357522
- ecdata[r5][x3] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
357523
- }
357524
- }
357525
- var totalCodeCount = 0;
357526
- for (var y2 = 0; y2 < rsBlocks.length; y2++) {
357527
- totalCodeCount += rsBlocks[y2].totalCount;
357528
- }
357529
- var data = new Array(totalCodeCount);
357530
- var index = 0;
357531
- for (var z2 = 0; z2 < maxDcCount; z2++) {
357532
- for (var s5 = 0; s5 < rsBlocks.length; s5++) {
357533
- if (z2 < dcdata[s5].length) {
357534
- data[index++] = dcdata[s5][z2];
357535
- }
357536
- }
357537
- }
357538
- for (var xx = 0; xx < maxEcCount; xx++) {
357539
- for (var t5 = 0; t5 < rsBlocks.length; t5++) {
357540
- if (xx < ecdata[t5].length) {
357541
- data[index++] = ecdata[t5][xx];
357542
- }
357543
- }
357544
- }
357545
- return data;
357546
- };
357547
- module2.exports = QRCode;
357548
- }
357549
- });
357550
-
357551
- // node_modules/qrcode-terminal/lib/main.js
357552
- var require_main2 = __commonJS({
357553
- "node_modules/qrcode-terminal/lib/main.js"(exports2, module2) {
357554
- init_esbuild_shims();
357555
- var QRCode = require_QRCode();
357556
- var QRErrorCorrectLevel = require_QRErrorCorrectLevel();
357557
- var black = "\x1B[40m \x1B[0m";
357558
- var white = "\x1B[47m \x1B[0m";
357559
- var toCell = /* @__PURE__ */ __name(function(isBlack) {
357560
- return isBlack ? black : white;
357561
- }, "toCell");
357562
- var repeat = /* @__PURE__ */ __name(function(color) {
357563
- return {
357564
- times: /* @__PURE__ */ __name(function(count) {
357565
- return new Array(count).join(color);
357566
- }, "times")
357567
- };
357568
- }, "repeat");
357569
- var fill = /* @__PURE__ */ __name(function(length, value) {
357570
- var arr = new Array(length);
357571
- for (var i3 = 0; i3 < length; i3++) {
357572
- arr[i3] = value;
357573
- }
357574
- return arr;
357575
- }, "fill");
357576
- module2.exports = {
357577
- error: QRErrorCorrectLevel.L,
357578
- generate: /* @__PURE__ */ __name(function(input, opts, cb) {
357579
- if (typeof opts === "function") {
357580
- cb = opts;
357581
- opts = {};
357582
- }
357583
- var qrcode2 = new QRCode(-1, this.error);
357584
- qrcode2.addData(input);
357585
- qrcode2.make();
357586
- var output = "";
357587
- if (opts && opts.small) {
357588
- var BLACK = true, WHITE = false;
357589
- var moduleCount = qrcode2.getModuleCount();
357590
- var moduleData = qrcode2.modules.slice();
357591
- var oddRow = moduleCount % 2 === 1;
357592
- if (oddRow) {
357593
- moduleData.push(fill(moduleCount, WHITE));
357594
- }
357595
- var platte = {
357596
- WHITE_ALL: "\u2588",
357597
- WHITE_BLACK: "\u2580",
357598
- BLACK_WHITE: "\u2584",
357599
- BLACK_ALL: " "
357600
- };
357601
- var borderTop = repeat(platte.BLACK_WHITE).times(moduleCount + 3);
357602
- var borderBottom = repeat(platte.WHITE_BLACK).times(moduleCount + 3);
357603
- output += borderTop + "\n";
357604
- for (var row = 0; row < moduleCount; row += 2) {
357605
- output += platte.WHITE_ALL;
357606
- for (var col = 0; col < moduleCount; col++) {
357607
- if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === WHITE) {
357608
- output += platte.WHITE_ALL;
357609
- } else if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === BLACK) {
357610
- output += platte.WHITE_BLACK;
357611
- } else if (moduleData[row][col] === BLACK && moduleData[row + 1][col] === WHITE) {
357612
- output += platte.BLACK_WHITE;
357613
- } else {
357614
- output += platte.BLACK_ALL;
357615
- }
357616
- }
357617
- output += platte.WHITE_ALL + "\n";
357618
- }
357619
- if (!oddRow) {
357620
- output += borderBottom;
357621
- }
357622
- } else {
357623
- var border = repeat(white).times(qrcode2.getModuleCount() + 3);
357624
- output += border + "\n";
357625
- qrcode2.modules.forEach(function(row2) {
357626
- output += white;
357627
- output += row2.map(toCell).join("");
357628
- output += white + "\n";
357629
- });
357630
- output += border;
357631
- }
357632
- if (cb) cb(output);
357633
- else console.log(output);
357634
- }, "generate"),
357635
- setErrorLevel: /* @__PURE__ */ __name(function(error40) {
357636
- this.error = QRErrorCorrectLevel[error40] || this.error;
357637
- }, "setErrorLevel")
357638
- };
357639
- }
357640
- });
357641
-
357642
356605
  // packages/cli/node_modules/gaxios/package.json
357643
356606
  var require_package6 = __commonJS({
357644
356607
  "packages/cli/node_modules/gaxios/package.json"(exports2, module2) {
@@ -360733,9 +359696,9 @@ var require_logging_utils2 = __commonJS({
360733
359696
  this.debugPkg = pkg2;
360734
359697
  }
360735
359698
  makeLogger(namespace) {
360736
- const debugLogger138 = this.debugPkg(namespace);
359699
+ const debugLogger137 = this.debugPkg(namespace);
360737
359700
  return (fields, ...args) => {
360738
- debugLogger138(args[0], ...args.slice(1));
359701
+ debugLogger137(args[0], ...args.slice(1));
360739
359702
  };
360740
359703
  }
360741
359704
  setFilters() {
@@ -360759,7 +359722,7 @@ var require_logging_utils2 = __commonJS({
360759
359722
  }
360760
359723
  makeLogger(namespace) {
360761
359724
  var _a7;
360762
- const debugLogger138 = (_a7 = this.upstream) === null || _a7 === void 0 ? void 0 : _a7.makeLogger(namespace);
359725
+ const debugLogger137 = (_a7 = this.upstream) === null || _a7 === void 0 ? void 0 : _a7.makeLogger(namespace);
360763
359726
  return (fields, ...args) => {
360764
359727
  var _a8;
360765
359728
  const severity = (_a8 = fields.severity) !== null && _a8 !== void 0 ? _a8 : LogSeverity.INFO;
@@ -360768,8 +359731,8 @@ var require_logging_utils2 = __commonJS({
360768
359731
  message: util3.format(...args)
360769
359732
  }, fields);
360770
359733
  const jsonString = JSON.stringify(json3);
360771
- if (debugLogger138) {
360772
- debugLogger138(fields, jsonString);
359734
+ if (debugLogger137) {
359735
+ debugLogger137(fields, jsonString);
360773
359736
  } else {
360774
359737
  console.log("%s", jsonString);
360775
359738
  }
@@ -390472,7 +389435,7 @@ __name(getPackageJson, "getPackageJson");
390472
389435
  // packages/cli/src/utils/version.ts
390473
389436
  async function getCliVersion() {
390474
389437
  const pkgJson = await getPackageJson();
390475
- return "0.12.1";
389438
+ return "0.12.2-preview.0";
390476
389439
  }
390477
389440
  __name(getCliVersion, "getCliVersion");
390478
389441
 
@@ -398033,7 +396996,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
398033
396996
 
398034
396997
  // packages/cli/src/generated/git-commit.ts
398035
396998
  init_esbuild_shims();
398036
- var GIT_COMMIT_INFO = "150521d8";
396999
+ var GIT_COMMIT_INFO = "c23c3a82";
398037
397000
 
398038
397001
  // packages/cli/src/utils/systemInfo.ts
398039
397002
  async function getNpmVersion() {
@@ -400430,7 +399393,8 @@ async function exportMarkdownAction(context2) {
400430
399393
  }
400431
399394
  try {
400432
399395
  const sessionService = new SessionService(cwd7);
400433
- const sessionData = await sessionService.loadLastSession();
399396
+ const sessionId = config2.getSessionId();
399397
+ const sessionData = await sessionService.loadSession(sessionId);
400434
399398
  if (!sessionData) {
400435
399399
  return {
400436
399400
  type: "message",
@@ -400483,7 +399447,8 @@ async function exportHtmlAction(context2) {
400483
399447
  }
400484
399448
  try {
400485
399449
  const sessionService = new SessionService(cwd7);
400486
- const sessionData = await sessionService.loadLastSession();
399450
+ const sessionId = config2.getSessionId();
399451
+ const sessionData = await sessionService.loadSession(sessionId);
400487
399452
  if (!sessionData) {
400488
399453
  return {
400489
399454
  type: "message",
@@ -400536,7 +399501,8 @@ async function exportJsonAction(context2) {
400536
399501
  }
400537
399502
  try {
400538
399503
  const sessionService = new SessionService(cwd7);
400539
- const sessionData = await sessionService.loadLastSession();
399504
+ const sessionId = config2.getSessionId();
399505
+ const sessionData = await sessionService.loadSession(sessionId);
400540
399506
  if (!sessionData) {
400541
399507
  return {
400542
399508
  type: "message",
@@ -400589,7 +399555,8 @@ async function exportJsonlAction(context2) {
400589
399555
  }
400590
399556
  try {
400591
399557
  const sessionService = new SessionService(cwd7);
400592
- const sessionData = await sessionService.loadLastSession();
399558
+ const sessionId = config2.getSessionId();
399559
+ const sessionData = await sessionService.loadSession(sessionId);
400593
399560
  if (!sessionData) {
400594
399561
  return {
400595
399562
  type: "message",
@@ -434279,7 +433246,7 @@ var Header2 = /* @__PURE__ */ __name(({
434279
433246
  Box_default,
434280
433247
  {
434281
433248
  flexDirection: "column",
434282
- borderStyle: "round",
433249
+ borderStyle: "single",
434283
433250
  borderColor: theme.border.default,
434284
433251
  paddingX: infoPanelPaddingX,
434285
433252
  flexGrow: showLogo ? 0 : 1,
@@ -436289,72 +435256,13 @@ Link.propTypes = {
436289
435256
  var dist_default6 = Link;
436290
435257
 
436291
435258
  // packages/cli/src/ui/components/QwenOAuthProgress.tsx
436292
- var import_qrcode_terminal = __toESM(require_main2(), 1);
436293
435259
  var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
436294
- var debugLogger115 = createDebugLogger("QWEN_OAUTH_PROGRESS");
436295
- function QrCodeDisplay({
436296
- verificationUrl,
436297
- qrCodeData
436298
- }) {
436299
- if (!qrCodeData) {
436300
- return null;
436301
- }
436302
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
436303
- Box_default,
436304
- {
436305
- borderStyle: "round",
436306
- borderColor: Colors.AccentBlue,
436307
- flexDirection: "column",
436308
- padding: 1,
436309
- width: "100%",
436310
- children: [
436311
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, color: Colors.AccentBlue, children: t4("Qwen OAuth Authentication") }),
436312
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: t4("Please visit this URL to authorize:") }) }),
436313
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(dist_default6, { url: verificationUrl, fallback: false, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: Colors.AccentGreen, bold: true, children: verificationUrl }) }),
436314
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: t4("Or scan the QR code below:") }) }),
436315
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: qrCodeData }) })
436316
- ]
436317
- }
436318
- );
436319
- }
436320
- __name(QrCodeDisplay, "QrCodeDisplay");
436321
- function StatusDisplay({
436322
- timeRemaining,
436323
- dots
436324
- }) {
436325
- const formatTime = /* @__PURE__ */ __name((seconds) => {
436326
- const minutes = Math.floor(seconds / 60);
436327
- const remainingSeconds = seconds % 60;
436328
- return `${minutes}:${remainingSeconds.toString().padStart(2, "0")}`;
436329
- }, "formatTime");
436330
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
436331
- Box_default,
436332
- {
436333
- borderStyle: "round",
436334
- borderColor: Colors.AccentBlue,
436335
- flexDirection: "column",
436336
- padding: 1,
436337
- width: "100%",
436338
- children: [
436339
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { children: [
436340
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(build_default, { type: "dots" }),
436341
- " ",
436342
- t4("Waiting for authorization"),
436343
- dots
436344
- ] }) }),
436345
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Box_default, { marginTop: 1, justifyContent: "space-between", children: [
436346
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { color: Colors.Gray, children: [
436347
- t4("Time remaining:"),
436348
- " ",
436349
- formatTime(timeRemaining)
436350
- ] }),
436351
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: Colors.AccentPurple, children: t4("(Press ESC or CTRL+C to cancel)") })
436352
- ] })
436353
- ]
436354
- }
436355
- );
435260
+ function formatTime(seconds) {
435261
+ const minutes = Math.floor(seconds / 60);
435262
+ const remainingSeconds = seconds % 60;
435263
+ return `${minutes}:${remainingSeconds.toString().padStart(2, "0")}`;
436356
435264
  }
436357
- __name(StatusDisplay, "StatusDisplay");
435265
+ __name(formatTime, "formatTime");
436358
435266
  function QwenOAuthProgress({
436359
435267
  onTimeout,
436360
435268
  onCancel,
@@ -436364,8 +435272,7 @@ function QwenOAuthProgress({
436364
435272
  }) {
436365
435273
  const defaultTimeout = deviceAuth?.expires_in || 300;
436366
435274
  const [timeRemaining, setTimeRemaining] = (0, import_react80.useState)(defaultTimeout);
436367
- const [dots, setDots] = (0, import_react80.useState)("");
436368
- const [qrCodeData, setQrCodeData] = (0, import_react80.useState)(null);
435275
+ const [dots, setDots] = (0, import_react80.useState)("...");
436369
435276
  useKeypress(
436370
435277
  (key) => {
436371
435278
  if (authStatus === "timeout" || authStatus === "error") {
@@ -436376,26 +435283,6 @@ function QwenOAuthProgress({
436376
435283
  },
436377
435284
  { isActive: true }
436378
435285
  );
436379
- (0, import_react80.useEffect)(() => {
436380
- if (!deviceAuth?.verification_uri_complete) {
436381
- return;
436382
- }
436383
- const generateQR = /* @__PURE__ */ __name(() => {
436384
- try {
436385
- import_qrcode_terminal.default.generate(
436386
- deviceAuth.verification_uri_complete,
436387
- { small: true },
436388
- (qrcode2) => {
436389
- setQrCodeData(qrcode2);
436390
- }
436391
- );
436392
- } catch (error40) {
436393
- debugLogger115.error("Failed to generate QR code:", error40);
436394
- setQrCodeData(null);
436395
- }
436396
- }, "generateQR");
436397
- generateQR();
436398
- }, [deviceAuth?.verification_uri_complete]);
436399
435286
  (0, import_react80.useEffect)(() => {
436400
435287
  const timer = setInterval(() => {
436401
435288
  setTimeRemaining((prev) => {
@@ -436409,42 +435296,32 @@ function QwenOAuthProgress({
436409
435296
  return () => clearInterval(timer);
436410
435297
  }, [onTimeout]);
436411
435298
  (0, import_react80.useEffect)(() => {
435299
+ const dotFrames = [". ", ".. ", "..."];
435300
+ let frameIndex = 0;
436412
435301
  const dotsTimer = setInterval(() => {
436413
- setDots((prev) => {
436414
- if (prev.length >= 3) return "";
436415
- return prev + ".";
436416
- });
435302
+ frameIndex = (frameIndex + 1) % dotFrames.length;
435303
+ setDots(dotFrames[frameIndex]);
436417
435304
  }, 500);
436418
435305
  return () => clearInterval(dotsTimer);
436419
435306
  }, []);
436420
- const qrCodeDisplay = (0, import_react80.useMemo)(() => {
436421
- if (!deviceAuth?.verification_uri_complete) return null;
436422
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
436423
- QrCodeDisplay,
436424
- {
436425
- verificationUrl: deviceAuth.verification_uri_complete,
436426
- qrCodeData
436427
- }
436428
- );
436429
- }, [deviceAuth?.verification_uri_complete, qrCodeData]);
436430
435307
  if (authStatus === "timeout") {
436431
435308
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
436432
435309
  Box_default,
436433
435310
  {
436434
- borderStyle: "round",
436435
- borderColor: Colors.AccentRed,
435311
+ borderStyle: "single",
435312
+ borderColor: theme.border.default,
436436
435313
  flexDirection: "column",
436437
435314
  padding: 1,
436438
435315
  width: "100%",
436439
435316
  children: [
436440
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, color: Colors.AccentRed, children: t4("Qwen OAuth Authentication Timeout") }),
435317
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, color: theme.status.error, children: t4("Qwen OAuth Authentication Timeout") }),
436441
435318
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: authMessage || t4(
436442
435319
  "OAuth token expired (over {{seconds}} seconds). Please select authentication method again.",
436443
435320
  {
436444
435321
  seconds: defaultTimeout.toString()
436445
435322
  }
436446
435323
  ) }) }),
436447
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: Colors.Gray, children: t4("Press any key to return to authentication type selection.") }) })
435324
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: theme.text.secondary, children: t4("Press any key to return to authentication type selection.") }) })
436448
435325
  ]
436449
435326
  }
436450
435327
  );
@@ -436453,15 +435330,15 @@ function QwenOAuthProgress({
436453
435330
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
436454
435331
  Box_default,
436455
435332
  {
436456
- borderStyle: "round",
436457
- borderColor: Colors.AccentRed,
435333
+ borderStyle: "single",
435334
+ borderColor: theme.border.default,
436458
435335
  flexDirection: "column",
436459
435336
  padding: 1,
436460
435337
  width: "100%",
436461
435338
  children: [
436462
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, color: Colors.AccentRed, children: "Qwen OAuth Authentication Error" }),
436463
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: authMessage || "An error occurred during authentication. Please try again." }) }),
436464
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: Colors.Gray, children: "Press any key to return to authentication type selection." }) })
435339
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, color: theme.status.error, children: t4("Qwen OAuth Authentication Error") }),
435340
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: authMessage || t4("An error occurred during authentication. Please try again.") }) }),
435341
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: theme.text.secondary, children: t4("Press any key to return to authentication type selection.") }) })
436465
435342
  ]
436466
435343
  }
436467
435344
  );
@@ -436470,34 +435347,53 @@ function QwenOAuthProgress({
436470
435347
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
436471
435348
  Box_default,
436472
435349
  {
436473
- borderStyle: "round",
436474
- borderColor: Colors.Gray,
435350
+ borderStyle: "single",
435351
+ borderColor: theme.border.default,
436475
435352
  flexDirection: "column",
436476
435353
  padding: 1,
436477
435354
  width: "100%",
436478
435355
  children: [
436479
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { children: [
436480
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(build_default, { type: "dots" }),
436481
- t4("Waiting for Qwen OAuth authentication...")
436482
- ] }) }),
436483
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Box_default, { marginTop: 1, justifyContent: "space-between", children: [
436484
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { color: Colors.Gray, children: [
435356
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, children: t4("Qwen OAuth Authentication") }),
435357
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
435358
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: t4("Waiting for Qwen OAuth authentication...") }),
435359
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { children: [
436485
435360
  t4("Time remaining:"),
436486
435361
  " ",
436487
- Math.floor(timeRemaining / 60),
436488
- ":",
436489
- (timeRemaining % 60).toString().padStart(2, "0")
436490
- ] }),
436491
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: Colors.AccentPurple, children: t4("(Press ESC or CTRL+C to cancel)") })
436492
- ] })
435362
+ formatTime(timeRemaining)
435363
+ ] })
435364
+ ] }),
435365
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: theme.text.secondary, children: t4("Esc to cancel") }) })
436493
435366
  ]
436494
435367
  }
436495
435368
  );
436496
435369
  }
436497
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Box_default, { flexDirection: "column", width: "100%", children: [
436498
- qrCodeDisplay,
436499
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(StatusDisplay, { timeRemaining, dots })
436500
- ] });
435370
+ return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
435371
+ Box_default,
435372
+ {
435373
+ borderStyle: "single",
435374
+ borderColor: theme.border.default,
435375
+ flexDirection: "column",
435376
+ padding: 1,
435377
+ width: "100%",
435378
+ children: [
435379
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { bold: true, children: t4("Qwen OAuth Authentication") }),
435380
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { children: t4("Please visit this URL to authorize:") }) }),
435381
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(dist_default6, { url: deviceAuth.verification_uri_complete || "", fallback: false, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: theme.text.link, bold: true, children: deviceAuth.verification_uri_complete }) }),
435382
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
435383
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { children: [
435384
+ t4("Waiting for authorization"),
435385
+ dots
435386
+ ] }),
435387
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text3, { children: [
435388
+ t4("Time remaining:"),
435389
+ " ",
435390
+ formatTime(timeRemaining)
435391
+ ] })
435392
+ ] }),
435393
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text3, { color: theme.text.secondary, children: t4("Esc to cancel") }) })
435394
+ ]
435395
+ }
435396
+ );
436501
435397
  }
436502
435398
  __name(QwenOAuthProgress, "QwenOAuthProgress");
436503
435399
 
@@ -436830,7 +435726,7 @@ function AuthDialog() {
436830
435726
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
436831
435727
  Box_default,
436832
435728
  {
436833
- borderStyle: "round",
435729
+ borderStyle: "single",
436834
435730
  borderColor: theme?.border?.default,
436835
435731
  flexDirection: "column",
436836
435732
  padding: 1,
@@ -436916,7 +435812,7 @@ var editorSettingsManager = new EditorSettingsManager();
436916
435812
 
436917
435813
  // packages/cli/src/ui/components/EditorSettingsDialog.tsx
436918
435814
  var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
436919
- var debugLogger116 = createDebugLogger("EDITOR_SETTINGS_DIALOG");
435815
+ var debugLogger115 = createDebugLogger("EDITOR_SETTINGS_DIALOG");
436920
435816
  function EditorSettingsDialog({
436921
435817
  onSelect,
436922
435818
  settings,
@@ -436943,7 +435839,7 @@ function EditorSettingsDialog({
436943
435839
  (item) => item.type === currentPreference
436944
435840
  ) : 0;
436945
435841
  if (editorIndex === -1) {
436946
- debugLogger116.error(`Editor is not supported: ${currentPreference}`);
435842
+ debugLogger115.error(`Editor is not supported: ${currentPreference}`);
436947
435843
  editorIndex = 0;
436948
435844
  }
436949
435845
  const handleEditorSelect = /* @__PURE__ */ __name((editorType) => {
@@ -437687,7 +436583,7 @@ import process35 from "node:process";
437687
436583
  // packages/cli/src/ui/components/IdeTrustChangeDialog.tsx
437688
436584
  init_esbuild_shims();
437689
436585
  var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
437690
- var debugLogger117 = createDebugLogger("IDE_TRUST_DIALOG");
436586
+ var debugLogger116 = createDebugLogger("IDE_TRUST_DIALOG");
437691
436587
  var IdeTrustChangeDialog = /* @__PURE__ */ __name(({ reason }) => {
437692
436588
  useKeypress(
437693
436589
  (key) => {
@@ -437699,7 +436595,7 @@ var IdeTrustChangeDialog = /* @__PURE__ */ __name(({ reason }) => {
437699
436595
  );
437700
436596
  let message = "Workspace trust has changed.";
437701
436597
  if (reason === "NONE") {
437702
- debugLogger117.error(
436598
+ debugLogger116.error(
437703
436599
  'IdeTrustChangeDialog rendered with unexpected reason "NONE"'
437704
436600
  );
437705
436601
  } else if (reason === "CONNECTION_CHANGE") {
@@ -438088,7 +436984,7 @@ var ActionSelectionStep2 = /* @__PURE__ */ __name(({
438088
436984
  // packages/cli/src/ui/components/extensions/steps/UninstallConfirmStep.tsx
438089
436985
  init_esbuild_shims();
438090
436986
  var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
438091
- var debugLogger118 = createDebugLogger("EXTENSION_UNINSTALL_STEP");
436987
+ var debugLogger117 = createDebugLogger("EXTENSION_UNINSTALL_STEP");
438092
436988
  function UninstallConfirmStep({
438093
436989
  selectedExtension,
438094
436990
  onConfirm,
@@ -438101,7 +436997,7 @@ function UninstallConfirmStep({
438101
436997
  try {
438102
436998
  await onConfirm(selectedExtension);
438103
436999
  } catch (error40) {
438104
- debugLogger118.error("Failed to uninstall extension:", error40);
437000
+ debugLogger117.error("Failed to uninstall extension:", error40);
438105
437001
  }
438106
437002
  } else if (key.name === "n" || key.name === "escape") {
438107
437003
  onNavigateBack();
@@ -438168,7 +437064,7 @@ __name(ScopeSelectStep, "ScopeSelectStep");
438168
437064
 
438169
437065
  // packages/cli/src/ui/components/extensions/ExtensionsManagerDialog.tsx
438170
437066
  var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
438171
- var debugLogger119 = createDebugLogger("EXTENSIONS_MANAGER_DIALOG");
437067
+ var debugLogger118 = createDebugLogger("EXTENSIONS_MANAGER_DIALOG");
438172
437068
  function ExtensionsManagerDialog({
438173
437069
  onClose,
438174
437070
  config: config2
@@ -438189,7 +437085,7 @@ function ExtensionsManagerDialog({
438189
437085
  if (!config2) return;
438190
437086
  const extensionManager = config2.getExtensionManager();
438191
437087
  if (!extensionManager) {
438192
- debugLogger119.error("ExtensionManager not available");
437088
+ debugLogger118.error("ExtensionManager not available");
438193
437089
  return;
438194
437090
  }
438195
437091
  try {
@@ -438197,7 +437093,7 @@ function ExtensionsManagerDialog({
438197
437093
  const loadedExtensions = extensionManager.getLoadedExtensions();
438198
437094
  setExtensions(loadedExtensions);
438199
437095
  } catch (error40) {
438200
- debugLogger119.error("Failed to load extensions:", error40);
437096
+ debugLogger118.error("Failed to load extensions:", error40);
438201
437097
  }
438202
437098
  }, [config2]);
438203
437099
  (0, import_react90.useEffect)(() => {
@@ -438251,12 +437147,12 @@ function ExtensionsManagerDialog({
438251
437147
  selectedExtension,
438252
437148
  "update available" /* UPDATE_AVAILABLE */,
438253
437149
  (name3, newState) => {
438254
- debugLogger119.debug(`Update state for ${name3}:`, newState);
437150
+ debugLogger118.debug(`Update state for ${name3}:`, newState);
438255
437151
  }
438256
437152
  );
438257
437153
  await loadExtensions();
438258
437154
  await extensionManager.checkForAllExtensionUpdates((name3, newState) => {
438259
- debugLogger119.debug(`Recheck update state for ${name3}:`, newState);
437155
+ debugLogger118.debug(`Recheck update state for ${name3}:`, newState);
438260
437156
  });
438261
437157
  setSuccessMessage(
438262
437158
  t4('Extension "{{name}}" updated successfully.', {
@@ -438265,7 +437161,7 @@ function ExtensionsManagerDialog({
438265
437161
  );
438266
437162
  handleNavigateBack();
438267
437163
  } catch (error40) {
438268
- debugLogger119.error("Failed to update extension:", error40);
437164
+ debugLogger118.error("Failed to update extension:", error40);
438269
437165
  setUpdateError(
438270
437166
  error40 instanceof Error ? error40.message : "Unknown error occurred"
438271
437167
  );
@@ -438338,7 +437234,7 @@ function ExtensionsManagerDialog({
438338
437234
  setErrorMessage(null);
438339
437235
  setNavigationStack([MANAGEMENT_STEPS2.EXTENSION_LIST]);
438340
437236
  } catch (error40) {
438341
- debugLogger119.error(
437237
+ debugLogger118.error(
438342
437238
  `Failed to ${newState ? "enable" : "disable"} extension:`,
438343
437239
  error40
438344
437240
  );
@@ -438379,7 +437275,7 @@ function ExtensionsManagerDialog({
438379
437275
  setNavigationStack([MANAGEMENT_STEPS2.EXTENSION_LIST]);
438380
437276
  setSelectedExtensionIndex(-1);
438381
437277
  } catch (error40) {
438382
- debugLogger119.error("Failed to uninstall extension:", error40);
437278
+ debugLogger118.error("Failed to uninstall extension:", error40);
438383
437279
  throw error40;
438384
437280
  }
438385
437281
  },
@@ -439251,7 +438147,7 @@ var AuthenticateStep = /* @__PURE__ */ __name(({
439251
438147
 
439252
438148
  // packages/cli/src/ui/components/mcp/MCPManagementDialog.tsx
439253
438149
  var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
439254
- var debugLogger120 = createDebugLogger("MCP_DIALOG");
438150
+ var debugLogger119 = createDebugLogger("MCP_DIALOG");
439255
438151
  var MCPManagementDialog = /* @__PURE__ */ __name(({
439256
438152
  onClose
439257
438153
  }) => {
@@ -439320,7 +438216,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439320
438216
  const serverInfos = await fetchServerData();
439321
438217
  setServers(serverInfos);
439322
438218
  } catch (error40) {
439323
- debugLogger120.error("Error loading MCP servers:", error40);
438219
+ debugLogger119.error("Error loading MCP servers:", error40);
439324
438220
  } finally {
439325
438221
  setIsLoading(false);
439326
438222
  }
@@ -439401,7 +438297,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439401
438297
  const serverInfos = await fetchServerData();
439402
438298
  setServers(serverInfos);
439403
438299
  } catch (error40) {
439404
- debugLogger120.error("Error reloading MCP servers:", error40);
438300
+ debugLogger119.error("Error reloading MCP servers:", error40);
439405
438301
  } finally {
439406
438302
  setIsLoading(false);
439407
438303
  }
@@ -439416,7 +438312,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439416
438312
  }
439417
438313
  await reloadServers();
439418
438314
  } catch (error40) {
439419
- debugLogger120.error(
438315
+ debugLogger119.error(
439420
438316
  `Error reconnecting to server '${selectedServer.name}':`,
439421
438317
  error40
439422
438318
  );
@@ -439451,7 +438347,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439451
438347
  }
439452
438348
  await reloadServers();
439453
438349
  } catch (error40) {
439454
- debugLogger120.error(
438350
+ debugLogger119.error(
439455
438351
  `Error enabling server '${selectedServer.name}':`,
439456
438352
  error40
439457
438353
  );
@@ -439470,7 +438366,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439470
438366
  const settings = loadSettings();
439471
438367
  let targetScope = "user";
439472
438368
  if (server.source === "extension") {
439473
- debugLogger120.warn(
438369
+ debugLogger119.warn(
439474
438370
  `Cannot disable extension MCP server '${server.name}'`
439475
438371
  );
439476
438372
  setIsLoading(false);
@@ -439496,7 +438392,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439496
438392
  }
439497
438393
  await reloadServers();
439498
438394
  } catch (error40) {
439499
- debugLogger120.error(
438395
+ debugLogger119.error(
439500
438396
  `Error disabling server '${selectedServer.name}':`,
439501
438397
  error40
439502
438398
  );
@@ -439531,7 +438427,7 @@ var MCPManagementDialog = /* @__PURE__ */ __name(({
439531
438427
  await reloadServers();
439532
438428
  handleNavigateBack();
439533
438429
  } catch (error40) {
439534
- debugLogger120.error(
438430
+ debugLogger119.error(
439535
438431
  `Error disabling server '${selectedServer.name}':`,
439536
438432
  error40
439537
438433
  );
@@ -440653,7 +439549,7 @@ var import_react100 = __toESM(require_react(), 1);
440653
439549
  import * as fs101 from "node:fs/promises";
440654
439550
  import * as path110 from "node:path";
440655
439551
  var MAX_HISTORY_LENGTH2 = 100;
440656
- var debugLogger121 = createDebugLogger("SHELL_HISTORY");
439552
+ var debugLogger120 = createDebugLogger("SHELL_HISTORY");
440657
439553
  async function getHistoryFilePath(projectRoot, configStorage) {
440658
439554
  const storage = configStorage ?? new Storage(projectRoot);
440659
439555
  return storage.getHistoryFilePath();
@@ -440679,7 +439575,7 @@ async function readHistoryFile(filePath) {
440679
439575
  return result;
440680
439576
  } catch (err) {
440681
439577
  if (isNodeError(err) && err.code === "ENOENT") return [];
440682
- debugLogger121.error("Error reading history:", err);
439578
+ debugLogger120.error("Error reading history:", err);
440683
439579
  return [];
440684
439580
  }
440685
439581
  }
@@ -440689,7 +439585,7 @@ async function writeHistoryFile(filePath, history) {
440689
439585
  await fs101.mkdir(path110.dirname(filePath), { recursive: true });
440690
439586
  await fs101.writeFile(filePath, history.join("\n"));
440691
439587
  } catch (error40) {
440692
- debugLogger121.error("Error writing shell history:", error40);
439588
+ debugLogger120.error("Error writing shell history:", error40);
440693
439589
  }
440694
439590
  }
440695
439591
  __name(writeHistoryFile, "writeHistoryFile");
@@ -441107,12 +440003,12 @@ __name(useAtCompletion, "useAtCompletion");
441107
440003
  init_esbuild_shims();
441108
440004
  var import_react104 = __toESM(require_react(), 1);
441109
440005
  init_fzf_es();
441110
- var debugLogger122 = createDebugLogger("SLASH_COMPLETION");
440006
+ var debugLogger121 = createDebugLogger("SLASH_COMPLETION");
441111
440007
  function logErrorSafely(error40, context2) {
441112
440008
  if (error40 instanceof Error) {
441113
- debugLogger122.error(`[${context2}]`, error40);
440009
+ debugLogger121.error(`[${context2}]`, error40);
441114
440010
  } else {
441115
- debugLogger122.error(`[${context2}] Non-error thrown:`, error40);
440011
+ debugLogger121.error(`[${context2}] Non-error thrown:`, error40);
441116
440012
  }
441117
440013
  }
441118
440014
  __name(logErrorSafely, "logErrorSafely");
@@ -441207,7 +440103,7 @@ function useCommandSuggestions(parserResult, commandContext, getFzfForCommands,
441207
440103
  const fetchAndSetSuggestions = /* @__PURE__ */ __name(async () => {
441208
440104
  if (signal.aborted) return;
441209
440105
  if (!leafCommand?.completion) {
441210
- debugLogger122.warn(
440106
+ debugLogger121.warn(
441211
440107
  "Attempted argument completion without completion function"
441212
440108
  );
441213
440109
  return;
@@ -441812,7 +440708,7 @@ var FeedbackDialog = /* @__PURE__ */ __name(() => {
441812
440708
 
441813
440709
  // packages/cli/src/ui/components/InputPrompt.tsx
441814
440710
  var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
441815
- var debugLogger123 = createDebugLogger("INPUT_PROMPT");
440711
+ var debugLogger122 = createDebugLogger("INPUT_PROMPT");
441816
440712
  var calculatePromptWidths = /* @__PURE__ */ __name((terminalWidth) => {
441817
440713
  const widthFraction = 0.9;
441818
440714
  const FRAME_PADDING_AND_BORDER = 4;
@@ -442067,7 +440963,7 @@ ${finalValue.trim()}`;
442067
440963
  }
442068
440964
  }
442069
440965
  } catch (error40) {
442070
- debugLogger123.error("Error handling clipboard image:", error40);
440966
+ debugLogger122.error("Error handling clipboard image:", error40);
442071
440967
  }
442072
440968
  }, []);
442073
440969
  const handleAttachmentDelete = (0, import_react107.useCallback)((index) => {
@@ -443471,7 +442367,7 @@ var FEEDBACK_SHOW_PROBABILITY = 0.25;
443471
442367
  var MIN_TOOL_CALLS = 10;
443472
442368
  var MIN_USER_MESSAGES = 5;
443473
442369
  var FEEDBACK_COOLDOWN_HOURS = 24;
443474
- var debugLogger124 = createDebugLogger("FEEDBACK_DIALOG");
442370
+ var debugLogger123 = createDebugLogger("FEEDBACK_DIALOG");
443475
442371
  var lastMessageIsAIResponse = /* @__PURE__ */ __name((history) => history.length > 0 && history[history.length - 1].type === "gemini" /* GEMINI */, "lastMessageIsAIResponse");
443476
442372
  var getFeedbackLastShownTimestampFromFile = /* @__PURE__ */ __name(() => {
443477
442373
  try {
@@ -443482,7 +442378,7 @@ var getFeedbackLastShownTimestampFromFile = /* @__PURE__ */ __name(() => {
443482
442378
  }
443483
442379
  } catch (error40) {
443484
442380
  if (isNodeError(error40) && error40.code !== "ENOENT") {
443485
- debugLogger124.warn(
442381
+ debugLogger123.warn(
443486
442382
  "Failed to read feedbackLastShownTimestamp from settings file:",
443487
442383
  error40
443488
442384
  );
@@ -444805,7 +443701,7 @@ var McpPromptLoader = class {
444805
443701
  };
444806
443702
 
444807
443703
  // packages/cli/src/ui/hooks/slashCommandProcessor.ts
444808
- var debugLogger125 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
443704
+ var debugLogger124 = createDebugLogger("SLASH_COMMAND_PROCESSOR");
444809
443705
  function serializeHistoryItemForRecording(item) {
444810
443706
  const clone4 = { ...item };
444811
443707
  if ("timestamp" in clone4 && clone4["timestamp"] instanceof Date) {
@@ -445303,7 +444199,7 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
445303
444199
  });
445304
444200
  }
445305
444201
  } catch (recordError) {
445306
- debugLogger125.error(
444202
+ debugLogger124.error(
445307
444203
  "[slashCommand] Failed to record slash command:",
445308
444204
  recordError
445309
444205
  );
@@ -445390,7 +444286,7 @@ import os36 from "node:os";
445390
444286
  import fs103 from "node:fs";
445391
444287
  var OUTPUT_UPDATE_INTERVAL_MS2 = 1e3;
445392
444288
  var MAX_OUTPUT_LENGTH2 = 1e4;
445393
- var debugLogger126 = createDebugLogger("SHELL_COMMAND_PROCESSOR");
444289
+ var debugLogger125 = createDebugLogger("SHELL_COMMAND_PROCESSOR");
445394
444290
  function addShellCommandToGeminiHistory(geminiClient, rawQuery, resultText) {
445395
444291
  const modelContent = resultText.length > MAX_OUTPUT_LENGTH2 ? resultText.substring(0, MAX_OUTPUT_LENGTH2) + "\n... (truncated)" : resultText;
445396
444292
  geminiClient.addHistory({
@@ -445532,7 +444428,7 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
445532
444428
  config2.getShouldUseNodePtyShell(),
445533
444429
  shellExecutionConfig
445534
444430
  );
445535
- debugLogger126.debug(terminalHeight, terminalWidth);
444431
+ debugLogger125.debug(terminalHeight, terminalWidth);
445536
444432
  executionPid = pid;
445537
444433
  if (pid) {
445538
444434
  setActiveShellPtyId(pid);
@@ -445743,7 +444639,7 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
445743
444639
  // packages/cli/src/ui/hooks/useReactToolScheduler.ts
445744
444640
  init_esbuild_shims();
445745
444641
  var import_react124 = __toESM(require_react(), 1);
445746
- var debugLogger127 = createDebugLogger("REACT_TOOL_SCHEDULER");
444642
+ var debugLogger126 = createDebugLogger("REACT_TOOL_SCHEDULER");
445747
444643
  function useReactToolScheduler(onComplete, config2, getPreferredEditor, onEditorClose) {
445748
444644
  const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react124.useState)([]);
445749
444645
  const outputUpdateHandler = (0, import_react124.useCallback)(
@@ -445849,7 +444745,7 @@ function mapCoreStatusToDisplayStatus(coreStatus) {
445849
444745
  return "Pending" /* Pending */;
445850
444746
  default: {
445851
444747
  const exhaustiveCheck = coreStatus;
445852
- debugLogger127.warn(`Unknown core status encountered: ${exhaustiveCheck}`);
444748
+ debugLogger126.warn(`Unknown core status encountered: ${exhaustiveCheck}`);
445853
444749
  return "Error" /* Error */;
445854
444750
  }
445855
444751
  }
@@ -445948,7 +444844,7 @@ __name(mapToDisplay, "mapToDisplay");
445948
444844
  // packages/cli/src/ui/hooks/useGeminiStream.ts
445949
444845
  import { promises as fs104 } from "node:fs";
445950
444846
  import path114 from "node:path";
445951
- var debugLogger128 = createDebugLogger("GEMINI_STREAM");
444847
+ var debugLogger127 = createDebugLogger("GEMINI_STREAM");
445952
444848
  function checkImageFormatsSupport(parts) {
445953
444849
  const unsupportedMimeTypes = [];
445954
444850
  let hasImages = false;
@@ -446880,7 +445776,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
446880
445776
  ToolConfirmationOutcome.ProceedOnce
446881
445777
  );
446882
445778
  } catch (error40) {
446883
- debugLogger128.error(
445779
+ debugLogger127.error(
446884
445780
  `Failed to auto-approve tool call ${call.request.callId}:`,
446885
445781
  error40
446886
445782
  );
@@ -447114,7 +446010,7 @@ var import_react126 = __toESM(require_react(), 1);
447114
446010
  var DIGIT_MULTIPLIER = 10;
447115
446011
  var DEFAULT_COUNT = 1;
447116
446012
  var DIGIT_1_TO_9 = /^[1-9]$/;
447117
- var debugLogger129 = createDebugLogger("VIM_MODE");
446013
+ var debugLogger128 = createDebugLogger("VIM_MODE");
447118
446014
  var CMD_TYPES = {
447119
446015
  DELETE_WORD_FORWARD: "dw",
447120
446016
  DELETE_WORD_BACKWARD: "db",
@@ -447364,7 +446260,7 @@ function useVim(buffer, onSubmit) {
447364
446260
  try {
447365
446261
  normalizedKey = normalizeKey(key);
447366
446262
  } catch (error40) {
447367
- debugLogger129.warn("Malformed key input in vim mode:", key, error40);
446263
+ debugLogger128.warn("Malformed key input in vim mode:", key, error40);
447368
446264
  return false;
447369
446265
  }
447370
446266
  if (state.mode === "INSERT") {
@@ -450752,7 +449648,7 @@ __name(updateNotifier, "updateNotifier");
450752
449648
 
450753
449649
  // packages/cli/src/ui/utils/updateCheck.ts
450754
449650
  var import_semver3 = __toESM(require_semver3(), 1);
450755
- var debugLogger130 = createDebugLogger("UPDATE_CHECK");
449651
+ var debugLogger129 = createDebugLogger("UPDATE_CHECK");
450756
449652
  function getBestAvailableUpdate(nightly, stable) {
450757
449653
  if (!nightly) return stable || null;
450758
449654
  if (!stable) return nightly || null;
@@ -450812,7 +449708,7 @@ async function checkForUpdates() {
450812
449708
  }
450813
449709
  return null;
450814
449710
  } catch (e4) {
450815
- debugLogger130.warn("Failed to check for updates: " + e4);
449711
+ debugLogger129.warn("Failed to check for updates: " + e4);
450816
449712
  return null;
450817
449713
  }
450818
449714
  }
@@ -450826,7 +449722,7 @@ init_esbuild_shims();
450826
449722
  import * as fs110 from "node:fs";
450827
449723
  import * as path124 from "node:path";
450828
449724
  import * as childProcess2 from "node:child_process";
450829
- var debugLogger131 = createDebugLogger("INSTALLATION_INFO");
449725
+ var debugLogger130 = createDebugLogger("INSTALLATION_INFO");
450830
449726
  function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
450831
449727
  const cliPath = process.argv[1];
450832
449728
  if (!cliPath) {
@@ -450928,7 +449824,7 @@ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
450928
449824
  updateMessage: isAutoUpdateEnabled ? "Installed with npm. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
450929
449825
  };
450930
449826
  } catch (error40) {
450931
- debugLogger131.error("Failed to detect installation info:", error40);
449827
+ debugLogger130.error("Failed to detect installation info:", error40);
450932
449828
  return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
450933
449829
  }
450934
449830
  }
@@ -451660,7 +450556,7 @@ var import_react144 = __toESM(require_react(), 1);
451660
450556
  init_esbuild_shims();
451661
450557
  import process48 from "node:process";
451662
450558
  var TERMINAL_BELL = "\x07";
451663
- var debugLogger132 = createDebugLogger("ATTENTION_NOTIFICATION");
450559
+ var debugLogger131 = createDebugLogger("ATTENTION_NOTIFICATION");
451664
450560
  function notifyTerminalAttention(_reason, options2 = {}) {
451665
450561
  if (options2.enabled === false) {
451666
450562
  return false;
@@ -451673,7 +450569,7 @@ function notifyTerminalAttention(_reason, options2 = {}) {
451673
450569
  stream2.write(TERMINAL_BELL);
451674
450570
  return true;
451675
450571
  } catch (error40) {
451676
- debugLogger132.warn("Failed to send terminal bell:", error40);
450572
+ debugLogger131.warn("Failed to send terminal bell:", error40);
451677
450573
  return false;
451678
450574
  }
451679
450575
  }
@@ -451722,7 +450618,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
451722
450618
  // packages/cli/src/ui/AppContainer.tsx
451723
450619
  var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1);
451724
450620
  var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
451725
- var debugLogger133 = createDebugLogger("APP_CONTAINER");
450621
+ var debugLogger132 = createDebugLogger("APP_CONTAINER");
451726
450622
  function isToolExecuting(pendingHistoryItems) {
451727
450623
  return pendingHistoryItems.some((item) => {
451728
450624
  if (item && item.type === "tool_group") {
@@ -452108,7 +451004,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
452108
451004
  },
452109
451005
  Date.now()
452110
451006
  );
452111
- debugLogger133.debug(
451007
+ debugLogger132.debug(
452112
451008
  `[DEBUG] Refreshed memory content in config: ${memoryContent.substring(
452113
451009
  0,
452114
451010
  200
@@ -452123,7 +451019,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
452123
451019
  },
452124
451020
  Date.now()
452125
451021
  );
452126
- debugLogger133.error("Error refreshing memory:", error40);
451022
+ debugLogger132.error("Error refreshing memory:", error40);
452127
451023
  }
452128
451024
  }, [config2, historyManager, settings.merged]);
452129
451025
  const cancelHandlerRef = (0, import_react145.useRef)(() => {
@@ -452490,7 +451386,7 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
452490
451386
  const handleGlobalKeypress = (0, import_react145.useCallback)(
452491
451387
  (key) => {
452492
451388
  if (settings.merged.general?.debugKeystrokeLogging) {
452493
- debugLogger133.debug("[DEBUG] Keystroke:", JSON.stringify(key));
451389
+ debugLogger132.debug("[DEBUG] Keystroke:", JSON.stringify(key));
452494
451390
  }
452495
451391
  if (keyMatchers["quit" /* QUIT */](key)) {
452496
451392
  if (isAuthenticating) {
@@ -455519,6 +454415,24 @@ __name(buildAuthMethods, "buildAuthMethods");
455519
454415
  // packages/cli/src/acp-integration/service/filesystem.ts
455520
454416
  init_esbuild_shims();
455521
454417
  var RESOURCE_NOT_FOUND_CODE = -32002;
454418
+ function getErrorCode3(error40) {
454419
+ if (error40 instanceof RequestError) {
454420
+ return error40.code;
454421
+ }
454422
+ if (typeof error40 === "object" && error40 !== null && "code" in error40) {
454423
+ return error40.code;
454424
+ }
454425
+ return void 0;
454426
+ }
454427
+ __name(getErrorCode3, "getErrorCode");
454428
+ function createEnoentError(filePath) {
454429
+ const err = new Error(`File not found: ${filePath}`);
454430
+ err.code = "ENOENT";
454431
+ err.errno = -2;
454432
+ err.path = filePath;
454433
+ return err;
454434
+ }
454435
+ __name(createEnoentError, "createEnoentError");
455522
454436
  var AcpFileSystemService = class {
455523
454437
  constructor(connection, sessionId, capabilities, fallback) {
455524
454438
  this.connection = connection;
@@ -455540,22 +454454,38 @@ var AcpFileSystemService = class {
455540
454454
  sessionId: this.sessionId
455541
454455
  });
455542
454456
  } catch (error40) {
455543
- const errorCode = error40 instanceof RequestError ? error40.code : typeof error40 === "object" && error40 !== null && "code" in error40 ? error40.code : void 0;
454457
+ const errorCode = getErrorCode3(error40);
455544
454458
  if (errorCode === RESOURCE_NOT_FOUND_CODE) {
455545
- const err = new Error(
455546
- `File not found: ${filePath}`
455547
- );
455548
- err.code = "ENOENT";
455549
- err.errno = -2;
455550
- err.path = filePath;
455551
- throw err;
454459
+ throw createEnoentError(filePath);
455552
454460
  }
455553
454461
  throw error40;
455554
454462
  }
455555
454463
  return response.content;
455556
454464
  }
455557
454465
  async readTextFileWithInfo(filePath) {
455558
- return this.fallback.readTextFileWithInfo(filePath);
454466
+ if (!this.capabilities.readTextFile) {
454467
+ return this.fallback.readTextFileWithInfo(filePath);
454468
+ }
454469
+ let response;
454470
+ try {
454471
+ response = await this.connection.readTextFile({
454472
+ path: filePath,
454473
+ sessionId: this.sessionId
454474
+ });
454475
+ } catch (error40) {
454476
+ const errorCode = getErrorCode3(error40);
454477
+ if (errorCode === RESOURCE_NOT_FOUND_CODE) {
454478
+ throw createEnoentError(filePath);
454479
+ }
454480
+ throw error40;
454481
+ }
454482
+ const hasUtf8Bom = response.content.length > 0 && response.content.codePointAt(0) === 65279;
454483
+ return {
454484
+ content: hasUtf8Bom ? response.content.slice(1) : response.content,
454485
+ // ACP protocol currently returns text only and does not expose source encoding.
454486
+ encoding: "utf-8",
454487
+ bom: hasUtf8Bom
454488
+ };
455559
454489
  }
455560
454490
  async writeTextFile(filePath, content, options2) {
455561
454491
  if (!this.capabilities.writeTextFile) {
@@ -455621,7 +454551,7 @@ __name(parseAcpModelOption, "parseAcpModelOption");
455621
454551
  // packages/cli/src/acp-integration/session/SubAgentTracker.ts
455622
454552
  init_esbuild_shims();
455623
454553
  init_zod();
455624
- var debugLogger134 = createDebugLogger("ACP_SUBAGENT_TRACKER");
454554
+ var debugLogger133 = createDebugLogger("ACP_SUBAGENT_TRACKER");
455625
454555
  var basicPermissionOptions = [
455626
454556
  {
455627
454557
  optionId: ToolConfirmationOutcome.ProceedOnce,
@@ -455701,7 +454631,7 @@ var SubAgentTracker = class {
455701
454631
  try {
455702
454632
  invocation = tool.build(event.args);
455703
454633
  } catch (e4) {
455704
- debugLogger134.warn(`Failed to build subagent tool ${event.name}:`, e4);
454634
+ debugLogger133.warn(`Failed to build subagent tool ${event.name}:`, e4);
455705
454635
  }
455706
454636
  }
455707
454637
  this.toolStates.set(event.callId, {
@@ -455779,7 +454709,7 @@ var SubAgentTracker = class {
455779
454709
  const outcome = output.outcome.outcome === "cancelled" ? ToolConfirmationOutcome.Cancel : external_exports.nativeEnum(ToolConfirmationOutcome).parse(output.outcome.optionId);
455780
454710
  await event.respond(outcome);
455781
454711
  } catch (error40) {
455782
- debugLogger134.error(
454712
+ debugLogger133.error(
455783
454713
  `Permission request failed for subagent tool ${event.name}:`,
455784
454714
  error40
455785
454715
  );
@@ -455880,7 +454810,7 @@ var SubAgentTracker = class {
455880
454810
  };
455881
454811
 
455882
454812
  // packages/cli/src/acp-integration/session/Session.ts
455883
- var debugLogger135 = createDebugLogger("SESSION");
454813
+ var debugLogger134 = createDebugLogger("SESSION");
455884
454814
  var Session3 = class {
455885
454815
  constructor(id, chat, config2, client, settings) {
455886
454816
  this.chat = chat;
@@ -456060,7 +454990,7 @@ var Session3 = class {
456060
454990
  };
456061
454991
  await this.sendUpdate(update2);
456062
454992
  } catch (error40) {
456063
- debugLogger135.error("Error sending available commands update:", error40);
454993
+ debugLogger134.error("Error sending available commands update:", error40);
456064
454994
  }
456065
454995
  }
456066
454996
  /**
@@ -456504,7 +455434,7 @@ ${contextPart.text}`
456504
455434
  }
456505
455435
  debug(msg) {
456506
455436
  if (this.config.getDebugMode()) {
456507
- debugLogger135.warn(msg);
455437
+ debugLogger134.warn(msg);
456508
455438
  }
456509
455439
  }
456510
455440
  };
@@ -456603,7 +455533,7 @@ function toPermissionOptions(confirmation) {
456603
455533
  __name(toPermissionOptions, "toPermissionOptions");
456604
455534
 
456605
455535
  // packages/cli/src/acp-integration/acpAgent.ts
456606
- var debugLogger136 = createDebugLogger("ACP_AGENT");
455536
+ var debugLogger135 = createDebugLogger("ACP_AGENT");
456607
455537
  async function runAcpAgent(config2, settings, argv) {
456608
455538
  const stdout = Writable2.toWeb(process.stdout);
456609
455539
  const stdin = Readable5.toWeb(process.stdin);
@@ -456640,7 +455570,7 @@ var QwenAgent = class {
456640
455570
  async initialize(args) {
456641
455571
  this.clientCapabilities = args.clientCapabilities;
456642
455572
  const authMethods = buildAuthMethods();
456643
- const version2 = "0.12.1";
455573
+ const version2 = "0.12.2-preview.0";
456644
455574
  return {
456645
455575
  protocolVersion: PROTOCOL_VERSION,
456646
455576
  agentInfo: {
@@ -456867,7 +455797,7 @@ var QwenAgent = class {
456867
455797
  try {
456868
455798
  await config2.refreshAuth(selectedType, true);
456869
455799
  } catch (e4) {
456870
- debugLogger136.error(`Authentication failed: ${e4}`);
455800
+ debugLogger135.error(`Authentication failed: ${e4}`);
456871
455801
  throw RequestError.authRequired(
456872
455802
  {
456873
455803
  authMethods: this.pickAuthMethodsForAuthRequired(selectedType, e4)
@@ -457020,7 +455950,7 @@ var QwenAgent = class {
457020
455950
 
457021
455951
  // packages/cli/src/gemini.tsx
457022
455952
  var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1);
457023
- var debugLogger137 = createDebugLogger("STARTUP");
455953
+ var debugLogger136 = createDebugLogger("STARTUP");
457024
455954
  function validateDnsResolutionOrder(order) {
457025
455955
  const defaultValue = "ipv4first";
457026
455956
  if (order === void 0) {
@@ -457116,7 +456046,7 @@ async function startInteractiveUI(config2, settings, startupWarnings, workspaceR
457116
456046
  checkForUpdates().then((info) => {
457117
456047
  handleAutoUpdate(info, settings, config2.getProjectRoot());
457118
456048
  }).catch((err) => {
457119
- debugLogger137.warn(`Update check failed: ${err}`);
456049
+ debugLogger136.warn(`Update check failed: ${err}`);
457120
456050
  });
457121
456051
  }
457122
456052
  registerCleanup(() => instance.unmount());
@@ -457309,7 +456239,7 @@ ${input}`;
457309
456239
  auth_type: config2.getContentGeneratorConfig()?.authType,
457310
456240
  prompt_length: input.length
457311
456241
  });
457312
- debugLogger137.debug(`Session ID: ${config2.getSessionId()}`);
456242
+ debugLogger136.debug(`Session ID: ${config2.getSessionId()}`);
457313
456243
  await runNonInteractive(nonInteractiveConfig, settings, input, prompt_id);
457314
456244
  await runExitCleanup();
457315
456245
  process.exit(0);