@qwen-code/qwen-code 0.12.4-preview.0 → 0.12.5
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.
- package/cli.js +293 -170
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -17012,7 +17012,7 @@ var require_util7 = __commonJS({
|
|
|
17012
17012
|
var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols5();
|
|
17013
17013
|
var { states, opcodes } = require_constants5();
|
|
17014
17014
|
var { ErrorEvent: ErrorEvent2, createFastMessageEvent } = require_events();
|
|
17015
|
-
var { isUtf8 } = __require("node:buffer");
|
|
17015
|
+
var { isUtf8: isUtf82 } = __require("node:buffer");
|
|
17016
17016
|
var { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require_data_url();
|
|
17017
17017
|
function isConnecting(ws2) {
|
|
17018
17018
|
return ws2[kReadyState] === states.CONNECTING;
|
|
@@ -17164,7 +17164,7 @@ var require_util7 = __commonJS({
|
|
|
17164
17164
|
var hasIntl = typeof process.versions.icu === "string";
|
|
17165
17165
|
var fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0;
|
|
17166
17166
|
var utf8Decode = hasIntl ? fatalDecoder.decode.bind(fatalDecoder) : function(buffer) {
|
|
17167
|
-
if (
|
|
17167
|
+
if (isUtf82(buffer)) {
|
|
17168
17168
|
return buffer.toString("utf-8");
|
|
17169
17169
|
}
|
|
17170
17170
|
throw new TypeError("Invalid utf-8 received.");
|
|
@@ -20733,7 +20733,7 @@ var require_supports_color = __commonJS({
|
|
|
20733
20733
|
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
20734
20734
|
"use strict";
|
|
20735
20735
|
init_esbuild_shims();
|
|
20736
|
-
var
|
|
20736
|
+
var os48 = __require("os");
|
|
20737
20737
|
var hasFlag3 = require_has_flag();
|
|
20738
20738
|
var env7 = process.env;
|
|
20739
20739
|
var forceColor;
|
|
@@ -20772,7 +20772,7 @@ var require_supports_color = __commonJS({
|
|
|
20772
20772
|
}
|
|
20773
20773
|
const min = forceColor ? 1 : 0;
|
|
20774
20774
|
if (process.platform === "win32") {
|
|
20775
|
-
const osRelease =
|
|
20775
|
+
const osRelease = os48.release().split(".");
|
|
20776
20776
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
20777
20777
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
20778
20778
|
}
|
|
@@ -32035,7 +32035,7 @@ var require_util10 = __commonJS({
|
|
|
32035
32035
|
exports2.isValidFile = isValidFile;
|
|
32036
32036
|
exports2.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
32037
32037
|
var fs116 = __require("fs");
|
|
32038
|
-
var
|
|
32038
|
+
var os48 = __require("os");
|
|
32039
32039
|
var path128 = __require("path");
|
|
32040
32040
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
32041
32041
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
@@ -32142,7 +32142,7 @@ var require_util10 = __commonJS({
|
|
|
32142
32142
|
}
|
|
32143
32143
|
__name(getWellKnownCertificateConfigFileLocation, "getWellKnownCertificateConfigFileLocation");
|
|
32144
32144
|
function _isWindows() {
|
|
32145
|
-
return
|
|
32145
|
+
return os48.platform().startsWith("win");
|
|
32146
32146
|
}
|
|
32147
32147
|
__name(_isWindows, "_isWindows");
|
|
32148
32148
|
}
|
|
@@ -37698,7 +37698,7 @@ var require_googleauth = __commonJS({
|
|
|
37698
37698
|
var fs116 = __require("fs");
|
|
37699
37699
|
var gaxios_1 = require_src2();
|
|
37700
37700
|
var gcpMetadata = require_src4();
|
|
37701
|
-
var
|
|
37701
|
+
var os48 = __require("os");
|
|
37702
37702
|
var path128 = __require("path");
|
|
37703
37703
|
var crypto_1 = require_crypto3();
|
|
37704
37704
|
var computeclient_1 = require_computeclient();
|
|
@@ -38204,7 +38204,7 @@ var require_googleauth = __commonJS({
|
|
|
38204
38204
|
* @api private
|
|
38205
38205
|
*/
|
|
38206
38206
|
_isWindows() {
|
|
38207
|
-
const sys =
|
|
38207
|
+
const sys = os48.platform();
|
|
38208
38208
|
if (sys && sys.length >= 3) {
|
|
38209
38209
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
38210
38210
|
return true;
|
|
@@ -39425,7 +39425,7 @@ var require_validation = __commonJS({
|
|
|
39425
39425
|
"node_modules/ws/lib/validation.js"(exports2, module2) {
|
|
39426
39426
|
"use strict";
|
|
39427
39427
|
init_esbuild_shims();
|
|
39428
|
-
var { isUtf8 } = __require("buffer");
|
|
39428
|
+
var { isUtf8: isUtf82 } = __require("buffer");
|
|
39429
39429
|
var { hasBlob } = require_constants6();
|
|
39430
39430
|
var tokenChars = [
|
|
39431
39431
|
0,
|
|
@@ -39609,9 +39609,9 @@ var require_validation = __commonJS({
|
|
|
39609
39609
|
isValidUTF8: _isValidUTF8,
|
|
39610
39610
|
tokenChars
|
|
39611
39611
|
};
|
|
39612
|
-
if (
|
|
39612
|
+
if (isUtf82) {
|
|
39613
39613
|
module2.exports.isValidUTF8 = function(buf) {
|
|
39614
|
-
return buf.length < 24 ? _isValidUTF8(buf) :
|
|
39614
|
+
return buf.length < 24 ? _isValidUTF8(buf) : isUtf82(buf);
|
|
39615
39615
|
};
|
|
39616
39616
|
} else if (!process.env.WS_NO_UTF_8_VALIDATE) {
|
|
39617
39617
|
try {
|
|
@@ -83692,7 +83692,7 @@ var require_service_config = __commonJS({
|
|
|
83692
83692
|
exports2.validateRetryThrottling = validateRetryThrottling;
|
|
83693
83693
|
exports2.validateServiceConfig = validateServiceConfig;
|
|
83694
83694
|
exports2.extractAndSelectServiceConfig = extractAndSelectServiceConfig;
|
|
83695
|
-
var
|
|
83695
|
+
var os48 = __require("os");
|
|
83696
83696
|
var constants_1 = require_constants8();
|
|
83697
83697
|
var DURATION_REGEX = /^\d+(\.\d{1,9})?s$/;
|
|
83698
83698
|
var CLIENT_LANGUAGE_STRING = "node";
|
|
@@ -83999,7 +83999,7 @@ var require_service_config = __commonJS({
|
|
|
83999
83999
|
if (Array.isArray(validatedConfig.clientHostname)) {
|
|
84000
84000
|
let hostnameMatched = false;
|
|
84001
84001
|
for (const hostname4 of validatedConfig.clientHostname) {
|
|
84002
|
-
if (hostname4 ===
|
|
84002
|
+
if (hostname4 === os48.hostname()) {
|
|
84003
84003
|
hostnameMatched = true;
|
|
84004
84004
|
}
|
|
84005
84005
|
}
|
|
@@ -97965,7 +97965,7 @@ var require_subchannel_call = __commonJS({
|
|
|
97965
97965
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
97966
97966
|
exports2.Http2SubchannelCall = void 0;
|
|
97967
97967
|
var http22 = __require("http2");
|
|
97968
|
-
var
|
|
97968
|
+
var os48 = __require("os");
|
|
97969
97969
|
var constants_1 = require_constants8();
|
|
97970
97970
|
var metadata_1 = require_metadata3();
|
|
97971
97971
|
var stream_decoder_1 = require_stream_decoder();
|
|
@@ -97973,7 +97973,7 @@ var require_subchannel_call = __commonJS({
|
|
|
97973
97973
|
var constants_2 = require_constants8();
|
|
97974
97974
|
var TRACER_NAME = "subchannel_call";
|
|
97975
97975
|
function getSystemErrorName(errno) {
|
|
97976
|
-
for (const [name3, num] of Object.entries(
|
|
97976
|
+
for (const [name3, num] of Object.entries(os48.constants.errno)) {
|
|
97977
97977
|
if (num === errno) {
|
|
97978
97978
|
return name3;
|
|
97979
97979
|
}
|
|
@@ -117941,7 +117941,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
117941
117941
|
exports2.processDetector = void 0;
|
|
117942
117942
|
var api_1 = (init_esm2(), __toCommonJS(esm_exports2));
|
|
117943
117943
|
var semconv_1 = require_semconv2();
|
|
117944
|
-
var
|
|
117944
|
+
var os48 = __require("os");
|
|
117945
117945
|
var ProcessDetector = class {
|
|
117946
117946
|
static {
|
|
117947
117947
|
__name(this, "ProcessDetector");
|
|
@@ -117964,7 +117964,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
117964
117964
|
attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
117965
117965
|
}
|
|
117966
117966
|
try {
|
|
117967
|
-
const userInfo2 =
|
|
117967
|
+
const userInfo2 = os48.userInfo();
|
|
117968
117968
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo2.username;
|
|
117969
117969
|
} catch (e4) {
|
|
117970
117970
|
api_1.diag.debug(`error obtaining process owner: ${e4}`);
|
|
@@ -124314,8 +124314,8 @@ var require_homedir = __commonJS({
|
|
|
124314
124314
|
"node_modules/resolve/lib/homedir.js"(exports2, module2) {
|
|
124315
124315
|
"use strict";
|
|
124316
124316
|
init_esbuild_shims();
|
|
124317
|
-
var
|
|
124318
|
-
module2.exports =
|
|
124317
|
+
var os48 = __require("os");
|
|
124318
|
+
module2.exports = os48.homedir || /* @__PURE__ */ __name(function homedir24() {
|
|
124319
124319
|
var home = process.env.HOME;
|
|
124320
124320
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
124321
124321
|
if (process.platform === "win32") {
|
|
@@ -133808,7 +133808,7 @@ var init_tokenLimits = __esm({
|
|
|
133808
133808
|
"use strict";
|
|
133809
133809
|
init_esbuild_shims();
|
|
133810
133810
|
DEFAULT_TOKEN_LIMIT = 131072;
|
|
133811
|
-
DEFAULT_OUTPUT_TOKEN_LIMIT =
|
|
133811
|
+
DEFAULT_OUTPUT_TOKEN_LIMIT = 16384;
|
|
133812
133812
|
LIMITS = {
|
|
133813
133813
|
"32k": 32768,
|
|
133814
133814
|
"64k": 65536,
|
|
@@ -133918,6 +133918,8 @@ var init_tokenLimits = __esm({
|
|
|
133918
133918
|
[/^qwen3\.5/, LIMITS["64k"]],
|
|
133919
133919
|
[/^coder-model$/, LIMITS["64k"]],
|
|
133920
133920
|
[/^qwen3-max/, LIMITS["64k"]],
|
|
133921
|
+
[/^qwen/, LIMITS["8k"]],
|
|
133922
|
+
// Qwen fallback (VL, turbo, plus, etc.): 8K
|
|
133921
133923
|
// DeepSeek
|
|
133922
133924
|
[/^deepseek-reasoner/, LIMITS["64k"]],
|
|
133923
133925
|
[/^deepseek-r1/, LIMITS["64k"]],
|
|
@@ -134799,6 +134801,18 @@ var init_modelsConfig = __esm({
|
|
|
134799
134801
|
detail: "auto-detected from model"
|
|
134800
134802
|
};
|
|
134801
134803
|
}
|
|
134804
|
+
if (!this._generationConfig.samplingParams?.max_tokens) {
|
|
134805
|
+
const outputLimit = tokenLimit(model.id, "output");
|
|
134806
|
+
if (!this._generationConfig.samplingParams) {
|
|
134807
|
+
this._generationConfig.samplingParams = {};
|
|
134808
|
+
}
|
|
134809
|
+
this._generationConfig.samplingParams.max_tokens = outputLimit;
|
|
134810
|
+
const existingSource = this.generationConfigSources["samplingParams"];
|
|
134811
|
+
this.generationConfigSources["samplingParams"] = {
|
|
134812
|
+
kind: "computed",
|
|
134813
|
+
detail: existingSource ? `max_tokens auto-detected from model (other params from ${existingSource.kind})` : "max_tokens auto-detected from model"
|
|
134814
|
+
};
|
|
134815
|
+
}
|
|
134802
134816
|
if (gc.modalities === void 0) {
|
|
134803
134817
|
this._generationConfig.modalities = defaultModalities(model.id);
|
|
134804
134818
|
this.generationConfigSources["modalities"] = {
|
|
@@ -157764,7 +157778,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
157764
157778
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
157765
157779
|
});
|
|
157766
157780
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
157767
|
-
const version2 = "0.12.
|
|
157781
|
+
const version2 = "0.12.5";
|
|
157768
157782
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
157769
157783
|
const baseHeaders = {
|
|
157770
157784
|
"User-Agent": userAgent2
|
|
@@ -172804,22 +172818,24 @@ var require_lib4 = __commonJS({
|
|
|
172804
172818
|
});
|
|
172805
172819
|
|
|
172806
172820
|
// packages/core/dist/src/utils/systemEncoding.js
|
|
172821
|
+
import { isUtf8 } from "node:buffer";
|
|
172807
172822
|
import { execSync as execSync3 } from "node:child_process";
|
|
172808
172823
|
import os10 from "node:os";
|
|
172809
172824
|
function getCachedEncodingForBuffer(buffer) {
|
|
172825
|
+
if (isUtf8(buffer)) {
|
|
172826
|
+
return "utf-8";
|
|
172827
|
+
}
|
|
172828
|
+
const detected = detectEncodingFromBuffer(buffer);
|
|
172829
|
+
if (detected) {
|
|
172830
|
+
return detected;
|
|
172831
|
+
}
|
|
172810
172832
|
if (cachedSystemEncoding === void 0) {
|
|
172811
172833
|
cachedSystemEncoding = getSystemEncoding();
|
|
172812
172834
|
}
|
|
172813
172835
|
if (cachedSystemEncoding) {
|
|
172814
|
-
if (cachedSystemEncoding !== "utf-8") {
|
|
172815
|
-
const detected = detectEncodingFromBuffer(buffer);
|
|
172816
|
-
if (detected === "utf-8") {
|
|
172817
|
-
return "utf-8";
|
|
172818
|
-
}
|
|
172819
|
-
}
|
|
172820
172836
|
return cachedSystemEncoding;
|
|
172821
172837
|
}
|
|
172822
|
-
return
|
|
172838
|
+
return "utf-8";
|
|
172823
172839
|
}
|
|
172824
172840
|
function getSystemEncoding() {
|
|
172825
172841
|
if (os10.platform() === "win32") {
|
|
@@ -172865,7 +172881,7 @@ function windowsCodePageToEncoding(cp3) {
|
|
|
172865
172881
|
866: "cp866",
|
|
172866
172882
|
874: "windows-874",
|
|
172867
172883
|
932: "shift_jis",
|
|
172868
|
-
936: "
|
|
172884
|
+
936: "gbk",
|
|
172869
172885
|
949: "euc-kr",
|
|
172870
172886
|
950: "big5",
|
|
172871
172887
|
1200: "utf-16le",
|
|
@@ -178808,7 +178824,68 @@ var init_terminalSerializer = __esm({
|
|
|
178808
178824
|
import { spawn as cpSpawn, spawnSync as spawnSync2 } from "node:child_process";
|
|
178809
178825
|
import { TextDecoder as TextDecoder2 } from "node:util";
|
|
178810
178826
|
import os12 from "node:os";
|
|
178811
|
-
|
|
178827
|
+
function mergeWindowsPathValues(env7, pathKeys) {
|
|
178828
|
+
const mergedEntries = [];
|
|
178829
|
+
const seenEntries = /* @__PURE__ */ new Set();
|
|
178830
|
+
for (const key of pathKeys) {
|
|
178831
|
+
const value = env7[key];
|
|
178832
|
+
if (value === void 0) {
|
|
178833
|
+
continue;
|
|
178834
|
+
}
|
|
178835
|
+
for (const entry of value.split(WINDOWS_PATH_DELIMITER)) {
|
|
178836
|
+
if (seenEntries.has(entry)) {
|
|
178837
|
+
continue;
|
|
178838
|
+
}
|
|
178839
|
+
seenEntries.add(entry);
|
|
178840
|
+
mergedEntries.push(entry);
|
|
178841
|
+
}
|
|
178842
|
+
}
|
|
178843
|
+
return mergedEntries.length > 0 ? mergedEntries.join(WINDOWS_PATH_DELIMITER) : void 0;
|
|
178844
|
+
}
|
|
178845
|
+
function getWindowsPathFingerprint(env7, pathKeys) {
|
|
178846
|
+
return pathKeys.map((key) => `${key}=${env7[key] ?? ""}`).join("\0");
|
|
178847
|
+
}
|
|
178848
|
+
function normalizePathEnvForWindows(env7) {
|
|
178849
|
+
if (os12.platform() !== "win32") {
|
|
178850
|
+
return env7;
|
|
178851
|
+
}
|
|
178852
|
+
const normalized2 = { ...env7 };
|
|
178853
|
+
const pathKeys = Object.keys(normalized2).filter((key) => key.toLowerCase() === "path");
|
|
178854
|
+
if (pathKeys.length === 0) {
|
|
178855
|
+
return normalized2;
|
|
178856
|
+
}
|
|
178857
|
+
const orderedPathKeys = [...pathKeys].sort((left3, right3) => {
|
|
178858
|
+
if (left3 === "PATH") {
|
|
178859
|
+
return -1;
|
|
178860
|
+
}
|
|
178861
|
+
if (right3 === "PATH") {
|
|
178862
|
+
return 1;
|
|
178863
|
+
}
|
|
178864
|
+
return left3.localeCompare(right3);
|
|
178865
|
+
});
|
|
178866
|
+
const fingerprint = getWindowsPathFingerprint(normalized2, orderedPathKeys);
|
|
178867
|
+
const canonicalValue = fingerprint === cachedWindowsPathFingerprint ? cachedMergedWindowsPath : mergeWindowsPathValues(normalized2, orderedPathKeys);
|
|
178868
|
+
if (fingerprint !== cachedWindowsPathFingerprint) {
|
|
178869
|
+
cachedWindowsPathFingerprint = fingerprint;
|
|
178870
|
+
cachedMergedWindowsPath = canonicalValue;
|
|
178871
|
+
}
|
|
178872
|
+
for (const key of pathKeys) {
|
|
178873
|
+
if (key !== "PATH") {
|
|
178874
|
+
delete normalized2[key];
|
|
178875
|
+
}
|
|
178876
|
+
}
|
|
178877
|
+
if (canonicalValue !== void 0) {
|
|
178878
|
+
normalized2["PATH"] = canonicalValue;
|
|
178879
|
+
}
|
|
178880
|
+
return normalized2;
|
|
178881
|
+
}
|
|
178882
|
+
function applyPowerShellUtf8Prefix(command2, shell2) {
|
|
178883
|
+
if (os12.platform() === "win32" && shell2 === "powershell") {
|
|
178884
|
+
return "[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" + command2;
|
|
178885
|
+
}
|
|
178886
|
+
return command2;
|
|
178887
|
+
}
|
|
178888
|
+
var import_headless, Terminal, SIGKILL_TIMEOUT_MS, WINDOWS_PATH_DELIMITER, cachedWindowsPathFingerprint, cachedMergedWindowsPath, getFullBufferText, replayTerminalOutput, windowsStrategy, posixStrategy, getCleanupStrategy, ShellExecutionService;
|
|
178812
178889
|
var init_shellExecutionService = __esm({
|
|
178813
178890
|
"packages/core/dist/src/services/shellExecutionService.js"() {
|
|
178814
178891
|
"use strict";
|
|
@@ -178822,9 +178899,11 @@ var init_shellExecutionService = __esm({
|
|
|
178822
178899
|
init_terminalSerializer();
|
|
178823
178900
|
({ Terminal } = import_headless.default);
|
|
178824
178901
|
SIGKILL_TIMEOUT_MS = 200;
|
|
178825
|
-
|
|
178826
|
-
|
|
178827
|
-
|
|
178902
|
+
WINDOWS_PATH_DELIMITER = ";";
|
|
178903
|
+
__name(mergeWindowsPathValues, "mergeWindowsPathValues");
|
|
178904
|
+
__name(getWindowsPathFingerprint, "getWindowsPathFingerprint");
|
|
178905
|
+
__name(normalizePathEnvForWindows, "normalizePathEnvForWindows");
|
|
178906
|
+
__name(applyPowerShellUtf8Prefix, "applyPowerShellUtf8Prefix");
|
|
178828
178907
|
getFullBufferText = /* @__PURE__ */ __name((terminal) => {
|
|
178829
178908
|
const buffer = terminal.buffer.active;
|
|
178830
178909
|
const lines = [];
|
|
@@ -178835,12 +178914,12 @@ var init_shellExecutionService = __esm({
|
|
|
178835
178914
|
}
|
|
178836
178915
|
return lines.join("\n").trimEnd();
|
|
178837
178916
|
}, "getFullBufferText");
|
|
178838
|
-
replayTerminalOutput = /* @__PURE__ */ __name(async (output) => {
|
|
178917
|
+
replayTerminalOutput = /* @__PURE__ */ __name(async (output, cols, rows) => {
|
|
178839
178918
|
const replayTerminal = new Terminal({
|
|
178840
178919
|
allowProposedApi: true,
|
|
178841
|
-
cols
|
|
178842
|
-
rows
|
|
178843
|
-
scrollback:
|
|
178920
|
+
cols,
|
|
178921
|
+
rows,
|
|
178922
|
+
scrollback: 1e4,
|
|
178844
178923
|
convertEol: true
|
|
178845
178924
|
});
|
|
178846
178925
|
await new Promise((resolve30) => {
|
|
@@ -178926,6 +179005,7 @@ var init_shellExecutionService = __esm({
|
|
|
178926
179005
|
try {
|
|
178927
179006
|
const isWindows9 = os12.platform() === "win32";
|
|
178928
179007
|
const { executable, argsPrefix, shell: shell2 } = getShellConfiguration();
|
|
179008
|
+
commandToExecute = applyPowerShellUtf8Prefix(commandToExecute, shell2);
|
|
178929
179009
|
const shellArgs = [...argsPrefix, commandToExecute];
|
|
178930
179010
|
const child = cpSpawn(executable, shellArgs, {
|
|
178931
179011
|
cwd: cwd7,
|
|
@@ -178934,7 +179014,7 @@ var init_shellExecutionService = __esm({
|
|
|
178934
179014
|
detached: !isWindows9,
|
|
178935
179015
|
windowsHide: isWindows9,
|
|
178936
179016
|
env: {
|
|
178937
|
-
...process.env,
|
|
179017
|
+
...normalizePathEnvForWindows(process.env),
|
|
178938
179018
|
QWEN_CODE: "1",
|
|
178939
179019
|
TERM: "xterm-256color",
|
|
178940
179020
|
PAGER: "cat"
|
|
@@ -179083,6 +179163,7 @@ var init_shellExecutionService = __esm({
|
|
|
179083
179163
|
const cols = shellExecutionConfig.terminalWidth ?? 80;
|
|
179084
179164
|
const rows = shellExecutionConfig.terminalHeight ?? 30;
|
|
179085
179165
|
const { executable, argsPrefix, shell: shell2 } = getShellConfiguration();
|
|
179166
|
+
commandToExecute = applyPowerShellUtf8Prefix(commandToExecute, shell2);
|
|
179086
179167
|
const args = os12.platform() === "win32" && shell2 === "cmd" ? [...argsPrefix, commandToExecute].join(" ") : [...argsPrefix, commandToExecute];
|
|
179087
179168
|
const ptyProcess = ptyInfo.module.spawn(executable, args, {
|
|
179088
179169
|
cwd: cwd7,
|
|
@@ -179090,7 +179171,7 @@ var init_shellExecutionService = __esm({
|
|
|
179090
179171
|
cols,
|
|
179091
179172
|
rows,
|
|
179092
179173
|
env: {
|
|
179093
|
-
...process.env,
|
|
179174
|
+
...normalizePathEnvForWindows(process.env),
|
|
179094
179175
|
QWEN_CODE: "1",
|
|
179095
179176
|
TERM: "xterm-256color",
|
|
179096
179177
|
PAGER: shellExecutionConfig.pager ?? "cat",
|
|
@@ -179108,7 +179189,6 @@ var init_shellExecutionService = __esm({
|
|
|
179108
179189
|
this.activePtys.set(ptyProcess.pid, { ptyProcess, headlessTerminal });
|
|
179109
179190
|
let processingChain = Promise.resolve();
|
|
179110
179191
|
let decoder = null;
|
|
179111
|
-
let outputEncoding = "utf-8";
|
|
179112
179192
|
let output = null;
|
|
179113
179193
|
const outputChunks = [];
|
|
179114
179194
|
const error40 = null;
|
|
@@ -179211,10 +179291,8 @@ var init_shellExecutionService = __esm({
|
|
|
179211
179291
|
const encoding = getCachedEncodingForBuffer(data);
|
|
179212
179292
|
try {
|
|
179213
179293
|
decoder = new TextDecoder2(encoding);
|
|
179214
|
-
outputEncoding = encoding;
|
|
179215
179294
|
} catch {
|
|
179216
179295
|
decoder = new TextDecoder2("utf-8");
|
|
179217
|
-
outputEncoding = "utf-8";
|
|
179218
179296
|
}
|
|
179219
179297
|
}, "ensureDecoder");
|
|
179220
179298
|
const handleOutput = /* @__PURE__ */ __name((data) => {
|
|
@@ -179262,8 +179340,9 @@ var init_shellExecutionService = __esm({
|
|
|
179262
179340
|
let fullOutput = "";
|
|
179263
179341
|
try {
|
|
179264
179342
|
if (isStreamingRawContent) {
|
|
179265
|
-
const
|
|
179266
|
-
|
|
179343
|
+
const finalEncoding = getCachedEncodingForBuffer(finalBuffer);
|
|
179344
|
+
const decodedOutput = new TextDecoder2(finalEncoding).decode(finalBuffer);
|
|
179345
|
+
fullOutput = await replayTerminalOutput(decodedOutput, cols, rows);
|
|
179267
179346
|
} else {
|
|
179268
179347
|
fullOutput = getFullBufferText(headlessTerminal);
|
|
179269
179348
|
}
|
|
@@ -195361,7 +195440,33 @@ var init_esm11 = __esm({
|
|
|
195361
195440
|
|
|
195362
195441
|
// packages/core/dist/src/services/fileSystemService.js
|
|
195363
195442
|
import fs32 from "node:fs/promises";
|
|
195443
|
+
import os14 from "node:os";
|
|
195364
195444
|
import * as path31 from "node:path";
|
|
195445
|
+
function needsUtf8Bom(filePath) {
|
|
195446
|
+
const ext2 = path31.extname(filePath).toLowerCase();
|
|
195447
|
+
if (!UTF8_BOM_EXTENSIONS.has(ext2)) {
|
|
195448
|
+
return false;
|
|
195449
|
+
}
|
|
195450
|
+
if (cachedIsNonUtf8Windows === void 0) {
|
|
195451
|
+
if (os14.platform() !== "win32") {
|
|
195452
|
+
cachedIsNonUtf8Windows = false;
|
|
195453
|
+
} else {
|
|
195454
|
+
const sysEnc = getSystemEncoding();
|
|
195455
|
+
cachedIsNonUtf8Windows = sysEnc !== "utf-8";
|
|
195456
|
+
}
|
|
195457
|
+
}
|
|
195458
|
+
return cachedIsNonUtf8Windows;
|
|
195459
|
+
}
|
|
195460
|
+
function needsCrlfLineEndings(filePath) {
|
|
195461
|
+
if (os14.platform() !== "win32") {
|
|
195462
|
+
return false;
|
|
195463
|
+
}
|
|
195464
|
+
const ext2 = path31.extname(filePath).toLowerCase();
|
|
195465
|
+
return CRLF_EXTENSIONS.has(ext2);
|
|
195466
|
+
}
|
|
195467
|
+
function ensureCrlfLineEndings(content) {
|
|
195468
|
+
return content.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n");
|
|
195469
|
+
}
|
|
195365
195470
|
function getBOMBytesForEncoding(encoding) {
|
|
195366
195471
|
const lower3 = encoding.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
195367
195472
|
switch (lower3) {
|
|
@@ -195381,7 +195486,7 @@ function getBOMBytesForEncoding(encoding) {
|
|
|
195381
195486
|
return null;
|
|
195382
195487
|
}
|
|
195383
195488
|
}
|
|
195384
|
-
var FileEncoding, StandardFileSystemService;
|
|
195489
|
+
var FileEncoding, CRLF_EXTENSIONS, UTF8_BOM_EXTENSIONS, cachedIsNonUtf8Windows, StandardFileSystemService;
|
|
195385
195490
|
var init_fileSystemService = __esm({
|
|
195386
195491
|
"packages/core/dist/src/services/fileSystemService.js"() {
|
|
195387
195492
|
"use strict";
|
|
@@ -195389,10 +195494,16 @@ var init_fileSystemService = __esm({
|
|
|
195389
195494
|
init_esm11();
|
|
195390
195495
|
init_fileUtils();
|
|
195391
195496
|
init_iconvHelper();
|
|
195497
|
+
init_systemEncoding();
|
|
195392
195498
|
FileEncoding = {
|
|
195393
195499
|
UTF8: "utf-8",
|
|
195394
195500
|
UTF8_BOM: "utf-8-bom"
|
|
195395
195501
|
};
|
|
195502
|
+
CRLF_EXTENSIONS = /* @__PURE__ */ new Set([".bat", ".cmd"]);
|
|
195503
|
+
UTF8_BOM_EXTENSIONS = /* @__PURE__ */ new Set([".ps1"]);
|
|
195504
|
+
__name(needsUtf8Bom, "needsUtf8Bom");
|
|
195505
|
+
__name(needsCrlfLineEndings, "needsCrlfLineEndings");
|
|
195506
|
+
__name(ensureCrlfLineEndings, "ensureCrlfLineEndings");
|
|
195396
195507
|
__name(getBOMBytesForEncoding, "getBOMBytesForEncoding");
|
|
195397
195508
|
StandardFileSystemService = class {
|
|
195398
195509
|
static {
|
|
@@ -195408,7 +195519,8 @@ var init_fileSystemService = __esm({
|
|
|
195408
195519
|
return { content, _meta: { bom, encoding, originalLineCount } };
|
|
195409
195520
|
}
|
|
195410
195521
|
async writeTextFile(params) {
|
|
195411
|
-
const {
|
|
195522
|
+
const { path: filePath, _meta } = params;
|
|
195523
|
+
const content = needsCrlfLineEndings(filePath) ? ensureCrlfLineEndings(params.content) : params.content;
|
|
195412
195524
|
const bom = _meta?.["bom"] ?? false;
|
|
195413
195525
|
const encoding = _meta?.["encoding"];
|
|
195414
195526
|
const isNonUtf8Encoding = encoding && !isUtf8CompatibleEncoding(encoding) && iconvEncodingExists(encoding);
|
|
@@ -200686,7 +200798,7 @@ var init_detect_ide = __esm({
|
|
|
200686
200798
|
// packages/core/dist/src/ide/process-utils.js
|
|
200687
200799
|
import { exec, execFile as execFile7 } from "node:child_process";
|
|
200688
200800
|
import { promisify as promisify7 } from "node:util";
|
|
200689
|
-
import
|
|
200801
|
+
import os15 from "node:os";
|
|
200690
200802
|
import path33 from "node:path";
|
|
200691
200803
|
async function getProcessInfo(pid) {
|
|
200692
200804
|
try {
|
|
@@ -200797,7 +200909,7 @@ async function getIdeProcessInfoForWindows() {
|
|
|
200797
200909
|
return { pid: myPid, command: myProc.command };
|
|
200798
200910
|
}
|
|
200799
200911
|
async function getIdeProcessInfo() {
|
|
200800
|
-
const platform15 =
|
|
200912
|
+
const platform15 = os15.platform();
|
|
200801
200913
|
if (platform15 === "win32") {
|
|
200802
200914
|
return getIdeProcessInfoForWindows();
|
|
200803
200915
|
}
|
|
@@ -219004,7 +219116,7 @@ var init_stdio2 = __esm({
|
|
|
219004
219116
|
// packages/core/dist/src/ide/ide-client.js
|
|
219005
219117
|
import * as dns from "node:dns";
|
|
219006
219118
|
import * as fs34 from "node:fs";
|
|
219007
|
-
import * as
|
|
219119
|
+
import * as os16 from "node:os";
|
|
219008
219120
|
import * as path34 from "node:path";
|
|
219009
219121
|
function getRealPath(path128) {
|
|
219010
219122
|
try {
|
|
@@ -219458,7 +219570,7 @@ var init_ide_client = __esm({
|
|
|
219458
219570
|
async getLegacyConnectionConfig(portFromEnv) {
|
|
219459
219571
|
if (this.ideProcessInfo) {
|
|
219460
219572
|
try {
|
|
219461
|
-
const portFile = path34.join(
|
|
219573
|
+
const portFile = path34.join(os16.tmpdir(), `qwen-code-ide-server-${this.ideProcessInfo.pid}.json`);
|
|
219462
219574
|
const portFileContents = await fs34.promises.readFile(portFile, "utf8");
|
|
219463
219575
|
return JSON.parse(portFileContents);
|
|
219464
219576
|
} catch (_2) {
|
|
@@ -219466,7 +219578,7 @@ var init_ide_client = __esm({
|
|
|
219466
219578
|
}
|
|
219467
219579
|
if (portFromEnv) {
|
|
219468
219580
|
try {
|
|
219469
|
-
const portFile = path34.join(
|
|
219581
|
+
const portFile = path34.join(os16.tmpdir(), `qwen-code-ide-server-${portFromEnv}.json`);
|
|
219470
219582
|
const portFileContents = await fs34.promises.readFile(portFile, "utf8");
|
|
219471
219583
|
return JSON.parse(portFileContents);
|
|
219472
219584
|
} catch (_2) {
|
|
@@ -220270,7 +220382,13 @@ var init_edit = __esm({
|
|
|
220270
220382
|
try {
|
|
220271
220383
|
this.ensureParentDirectoriesExist(this.params.file_path);
|
|
220272
220384
|
if (editData.isNewFile) {
|
|
220273
|
-
const
|
|
220385
|
+
const userEncoding = this.config.getDefaultFileEncoding();
|
|
220386
|
+
let useBOM = false;
|
|
220387
|
+
if (userEncoding === FileEncoding.UTF8_BOM) {
|
|
220388
|
+
useBOM = true;
|
|
220389
|
+
} else if (userEncoding === void 0) {
|
|
220390
|
+
useBOM = needsUtf8Bom(this.params.file_path);
|
|
220391
|
+
}
|
|
220274
220392
|
await this.config.getFileSystemService().writeTextFile({
|
|
220275
220393
|
path: this.params.file_path,
|
|
220276
220394
|
content: editData.newContent,
|
|
@@ -223281,7 +223399,7 @@ var init_base_token_storage = __esm({
|
|
|
223281
223399
|
// packages/core/dist/src/mcp/token-storage/file-token-storage.js
|
|
223282
223400
|
import { promises as fs40 } from "node:fs";
|
|
223283
223401
|
import * as path43 from "node:path";
|
|
223284
|
-
import * as
|
|
223402
|
+
import * as os17 from "node:os";
|
|
223285
223403
|
import * as crypto8 from "node:crypto";
|
|
223286
223404
|
var FileTokenStorage;
|
|
223287
223405
|
var init_file_token_storage = __esm({
|
|
@@ -223297,12 +223415,12 @@ var init_file_token_storage = __esm({
|
|
|
223297
223415
|
encryptionKey;
|
|
223298
223416
|
constructor(serviceName) {
|
|
223299
223417
|
super(serviceName);
|
|
223300
|
-
const configDir = path43.join(
|
|
223418
|
+
const configDir = path43.join(os17.homedir(), ".qwen");
|
|
223301
223419
|
this.tokenFilePath = path43.join(configDir, "mcp-oauth-tokens-v2.json");
|
|
223302
223420
|
this.encryptionKey = this.deriveEncryptionKey();
|
|
223303
223421
|
}
|
|
223304
223422
|
deriveEncryptionKey() {
|
|
223305
|
-
const salt = `${
|
|
223423
|
+
const salt = `${os17.hostname()}-${os17.userInfo().username}-qwen-code`;
|
|
223306
223424
|
return crypto8.scryptSync("qwen-code-oauth", salt, 32);
|
|
223307
223425
|
}
|
|
223308
223426
|
encrypt(text) {
|
|
@@ -231776,10 +231894,10 @@ var init_google_provider = __esm({
|
|
|
231776
231894
|
|
|
231777
231895
|
// packages/core/dist/src/tools/web-search/providers/dashscope-provider.js
|
|
231778
231896
|
import { promises as fs42 } from "node:fs";
|
|
231779
|
-
import * as
|
|
231897
|
+
import * as os18 from "os";
|
|
231780
231898
|
import * as path45 from "path";
|
|
231781
231899
|
function getQwenCachedCredentialPath2() {
|
|
231782
|
-
return path45.join(
|
|
231900
|
+
return path45.join(os18.homedir(), QWEN_DIR5, QWEN_CREDENTIAL_FILENAME3);
|
|
231783
231901
|
}
|
|
231784
231902
|
async function loadQwenCredentials() {
|
|
231785
231903
|
try {
|
|
@@ -232244,7 +232362,12 @@ var init_write_file = __esm({
|
|
|
232244
232362
|
}
|
|
232245
232363
|
if (!fileExists2) {
|
|
232246
232364
|
fs43.mkdirSync(dirName, { recursive: true });
|
|
232247
|
-
|
|
232365
|
+
const userEncoding = this.config.getDefaultFileEncoding();
|
|
232366
|
+
if (userEncoding === FileEncoding.UTF8_BOM) {
|
|
232367
|
+
useBOM = true;
|
|
232368
|
+
} else if (userEncoding === void 0) {
|
|
232369
|
+
useBOM = needsUtf8Bom(file_path);
|
|
232370
|
+
}
|
|
232248
232371
|
detectedEncoding = void 0;
|
|
232249
232372
|
}
|
|
232250
232373
|
try {
|
|
@@ -235341,7 +235464,7 @@ var init_skill_load = __esm({
|
|
|
235341
235464
|
import * as fs45 from "fs/promises";
|
|
235342
235465
|
import * as fsSync2 from "fs";
|
|
235343
235466
|
import * as path49 from "path";
|
|
235344
|
-
import * as
|
|
235467
|
+
import * as os19 from "os";
|
|
235345
235468
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
235346
235469
|
var debugLogger58, QWEN_CONFIG_DIR2, SKILLS_CONFIG_DIR, SKILL_MANIFEST_FILE2, SkillManager;
|
|
235347
235470
|
var init_skill_manager = __esm({
|
|
@@ -235655,7 +235778,7 @@ var init_skill_manager = __esm({
|
|
|
235655
235778
|
case "project":
|
|
235656
235779
|
return path49.join(this.config.getProjectRoot(), QWEN_CONFIG_DIR2, SKILLS_CONFIG_DIR);
|
|
235657
235780
|
case "user":
|
|
235658
|
-
return path49.join(
|
|
235781
|
+
return path49.join(os19.homedir(), QWEN_CONFIG_DIR2, SKILLS_CONFIG_DIR);
|
|
235659
235782
|
case "bundled":
|
|
235660
235783
|
return this.bundledSkillsDir;
|
|
235661
235784
|
case "extension":
|
|
@@ -235672,7 +235795,7 @@ var init_skill_manager = __esm({
|
|
|
235672
235795
|
*/
|
|
235673
235796
|
async listSkillsAtLevel(level) {
|
|
235674
235797
|
const projectRoot = this.config.getProjectRoot();
|
|
235675
|
-
const homeDir =
|
|
235798
|
+
const homeDir = os19.homedir();
|
|
235676
235799
|
const isHomeDirectory = path49.resolve(projectRoot) === path49.resolve(homeDir);
|
|
235677
235800
|
if (level === "project" && isHomeDirectory) {
|
|
235678
235801
|
debugLogger58.debug("Skipping project-level skills: project root is home directory");
|
|
@@ -236186,7 +236309,7 @@ Notes:
|
|
|
236186
236309
|
// packages/core/dist/src/subagents/subagent-manager.js
|
|
236187
236310
|
import * as fs46 from "fs/promises";
|
|
236188
236311
|
import * as path50 from "path";
|
|
236189
|
-
import * as
|
|
236312
|
+
import * as os20 from "os";
|
|
236190
236313
|
async function loadSubagentFromDir(baseDir) {
|
|
236191
236314
|
try {
|
|
236192
236315
|
const files = await fs46.readdir(baseDir);
|
|
@@ -236724,7 +236847,7 @@ ${config2.systemPrompt}
|
|
|
236724
236847
|
if (level === "session") {
|
|
236725
236848
|
return `<session:${name3}>`;
|
|
236726
236849
|
}
|
|
236727
|
-
const baseDir = level === "project" ? path50.join(this.config.getProjectRoot(), QWEN_CONFIG_DIR3, AGENT_CONFIG_DIR) : path50.join(
|
|
236850
|
+
const baseDir = level === "project" ? path50.join(this.config.getProjectRoot(), QWEN_CONFIG_DIR3, AGENT_CONFIG_DIR) : path50.join(os20.homedir(), QWEN_CONFIG_DIR3, AGENT_CONFIG_DIR);
|
|
236728
236851
|
return path50.join(baseDir, `${name3}.md`);
|
|
236729
236852
|
}
|
|
236730
236853
|
/**
|
|
@@ -236743,7 +236866,7 @@ ${config2.systemPrompt}
|
|
|
236743
236866
|
return extensions.flatMap((extension) => extension.agents || []);
|
|
236744
236867
|
}
|
|
236745
236868
|
const projectRoot = this.config.getProjectRoot();
|
|
236746
|
-
const homeDir =
|
|
236869
|
+
const homeDir = os20.homedir();
|
|
236747
236870
|
const isHomeDirectory = path50.resolve(projectRoot) === path50.resolve(homeDir);
|
|
236748
236871
|
if (level === "project" && isHomeDirectory) {
|
|
236749
236872
|
return [];
|
|
@@ -243432,8 +243555,8 @@ var require_yauzl = __commonJS({
|
|
|
243432
243555
|
readAndAssertNoEof(self2.reader, buffer, 0, buffer.length, self2.readEntryCursor, function(err2) {
|
|
243433
243556
|
if (err2) return emitErrorAndAutoClose(self2, err2);
|
|
243434
243557
|
if (self2.emittedError) return;
|
|
243435
|
-
var
|
|
243436
|
-
entry.fileName = self2.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength,
|
|
243558
|
+
var isUtf82 = (entry.generalPurposeBitFlag & 2048) !== 0;
|
|
243559
|
+
entry.fileName = self2.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf82) : buffer.slice(0, entry.fileNameLength);
|
|
243437
243560
|
var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
|
|
243438
243561
|
var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
|
|
243439
243562
|
entry.extraFields = [];
|
|
@@ -243452,7 +243575,7 @@ var require_yauzl = __commonJS({
|
|
|
243452
243575
|
});
|
|
243453
243576
|
i3 = dataEnd;
|
|
243454
243577
|
}
|
|
243455
|
-
entry.fileComment = self2.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength,
|
|
243578
|
+
entry.fileComment = self2.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf82) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
|
|
243456
243579
|
entry.comment = entry.fileComment;
|
|
243457
243580
|
self2.readEntryCursor += buffer.length;
|
|
243458
243581
|
self2.entriesRead += 1;
|
|
@@ -243815,8 +243938,8 @@ var require_yauzl = __commonJS({
|
|
|
243815
243938
|
this.context.unref();
|
|
243816
243939
|
};
|
|
243817
243940
|
var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
|
|
243818
|
-
function decodeBuffer(buffer, start, end,
|
|
243819
|
-
if (
|
|
243941
|
+
function decodeBuffer(buffer, start, end, isUtf82) {
|
|
243942
|
+
if (isUtf82) {
|
|
243820
243943
|
return buffer.toString("utf8", start, end);
|
|
243821
243944
|
} else {
|
|
243822
243945
|
var result = "";
|
|
@@ -243991,7 +244114,7 @@ var require_extract_zip = __commonJS({
|
|
|
243991
244114
|
});
|
|
243992
244115
|
|
|
243993
244116
|
// packages/core/dist/src/extension/github.js
|
|
243994
|
-
import * as
|
|
244117
|
+
import * as os21 from "node:os";
|
|
243995
244118
|
import * as https4 from "node:https";
|
|
243996
244119
|
import * as fs57 from "node:fs";
|
|
243997
244120
|
import * as path59 from "node:path";
|
|
@@ -244015,7 +244138,7 @@ async function cloneFromGit(installMetadata, destination) {
|
|
|
244015
244138
|
} catch {
|
|
244016
244139
|
}
|
|
244017
244140
|
}
|
|
244018
|
-
const symlinkValue =
|
|
244141
|
+
const symlinkValue = os21.platform() === "win32" ? "false" : "true";
|
|
244019
244142
|
await git.clone(sourceUrl, "./", [
|
|
244020
244143
|
"-c",
|
|
244021
244144
|
`core.symlinks=${symlinkValue}`,
|
|
@@ -244188,8 +244311,8 @@ async function downloadFromGitHubRelease(installMetadata, destination) {
|
|
|
244188
244311
|
}
|
|
244189
244312
|
}
|
|
244190
244313
|
function findReleaseAsset(assets) {
|
|
244191
|
-
const platform15 =
|
|
244192
|
-
const arch3 =
|
|
244314
|
+
const platform15 = os21.platform();
|
|
244315
|
+
const arch3 = os21.arch();
|
|
244193
244316
|
const platformArchPrefix = `${platform15}.${arch3}.`;
|
|
244194
244317
|
const platformPrefix = `${platform15}.`;
|
|
244195
244318
|
const platformArchAsset = assets.find((asset) => asset.name.toLowerCase().startsWith(platformArchPrefix));
|
|
@@ -244365,7 +244488,7 @@ var init_override = __esm({
|
|
|
244365
244488
|
|
|
244366
244489
|
// packages/core/dist/src/extension/storage.js
|
|
244367
244490
|
import path60 from "node:path";
|
|
244368
|
-
import * as
|
|
244491
|
+
import * as os22 from "node:os";
|
|
244369
244492
|
import * as fs58 from "node:fs";
|
|
244370
244493
|
var ExtensionStorage;
|
|
244371
244494
|
var init_storage2 = __esm({
|
|
@@ -244392,9 +244515,9 @@ var init_storage2 = __esm({
|
|
|
244392
244515
|
return path60.join(this.getExtensionDir(), EXTENSION_SETTINGS_FILENAME);
|
|
244393
244516
|
}
|
|
244394
244517
|
static getUserExtensionsDir() {
|
|
244395
|
-
const homeDir =
|
|
244518
|
+
const homeDir = os22.homedir();
|
|
244396
244519
|
if (!homeDir) {
|
|
244397
|
-
const tmpDir =
|
|
244520
|
+
const tmpDir = os22.tmpdir();
|
|
244398
244521
|
if (!tmpDir) {
|
|
244399
244522
|
return "/tmp/.qwen/extensions";
|
|
244400
244523
|
}
|
|
@@ -244404,7 +244527,7 @@ var init_storage2 = __esm({
|
|
|
244404
244527
|
return storage.getExtensionsDir();
|
|
244405
244528
|
}
|
|
244406
244529
|
static async createTmpDir() {
|
|
244407
|
-
return await fs58.promises.mkdtemp(path60.join(
|
|
244530
|
+
return await fs58.promises.mkdtemp(path60.join(os22.tmpdir(), "qwen-extension"));
|
|
244408
244531
|
}
|
|
244409
244532
|
};
|
|
244410
244533
|
}
|
|
@@ -247162,7 +247285,7 @@ var require_main = __commonJS({
|
|
|
247162
247285
|
init_esbuild_shims();
|
|
247163
247286
|
var fs116 = __require("fs");
|
|
247164
247287
|
var path128 = __require("path");
|
|
247165
|
-
var
|
|
247288
|
+
var os48 = __require("os");
|
|
247166
247289
|
var crypto14 = __require("crypto");
|
|
247167
247290
|
var packageJson4 = require_package5();
|
|
247168
247291
|
var version2 = packageJson4.version;
|
|
@@ -247317,7 +247440,7 @@ var require_main = __commonJS({
|
|
|
247317
247440
|
}
|
|
247318
247441
|
__name(_vaultPath, "_vaultPath");
|
|
247319
247442
|
function _resolveHome(envPath) {
|
|
247320
|
-
return envPath[0] === "~" ? path128.join(
|
|
247443
|
+
return envPath[0] === "~" ? path128.join(os48.homedir(), envPath.slice(1)) : envPath;
|
|
247321
247444
|
}
|
|
247322
247445
|
__name(_resolveHome, "_resolveHome");
|
|
247323
247446
|
function _configVault(options2) {
|
|
@@ -252757,7 +252880,7 @@ var init_extensionSettings = __esm({
|
|
|
252757
252880
|
// packages/core/dist/src/extension/extensionManager.js
|
|
252758
252881
|
import * as fs62 from "node:fs";
|
|
252759
252882
|
import * as path64 from "node:path";
|
|
252760
|
-
import * as
|
|
252883
|
+
import * as os23 from "node:os";
|
|
252761
252884
|
import { createHash as createHash5 } from "node:crypto";
|
|
252762
252885
|
function ensureLeadingAndTrailingSlash2(dirPath) {
|
|
252763
252886
|
let result = dirPath.replace(/\\/g, "/");
|
|
@@ -253001,7 +253124,7 @@ var init_extensionManager = __esm({
|
|
|
253001
253124
|
if (!extension) {
|
|
253002
253125
|
throw new Error(`Extension with name ${name3} does not exist.`);
|
|
253003
253126
|
}
|
|
253004
|
-
const scopePath = scope === SettingScope.Workspace ? currentDir :
|
|
253127
|
+
const scopePath = scope === SettingScope.Workspace ? currentDir : os23.homedir();
|
|
253005
253128
|
this.enableByPath(name3, true, scopePath);
|
|
253006
253129
|
const config2 = getTelemetryConfig(currentDir, this.telemetrySettings);
|
|
253007
253130
|
logExtensionEnable(config2, new ExtensionEnableEvent(name3, scope));
|
|
@@ -253021,7 +253144,7 @@ var init_extensionManager = __esm({
|
|
|
253021
253144
|
if (!extension) {
|
|
253022
253145
|
throw new Error(`Extension with name ${name3} does not exist.`);
|
|
253023
253146
|
}
|
|
253024
|
-
const scopePath = scope === SettingScope.Workspace ? currentDir :
|
|
253147
|
+
const scopePath = scope === SettingScope.Workspace ? currentDir : os23.homedir();
|
|
253025
253148
|
this.disableByPath(name3, true, scopePath);
|
|
253026
253149
|
logExtensionDisable(config2, new ExtensionDisableEvent(name3, scope));
|
|
253027
253150
|
extension.isActive = false;
|
|
@@ -253078,7 +253201,7 @@ var init_extensionManager = __esm({
|
|
|
253078
253201
|
*/
|
|
253079
253202
|
async refreshCache() {
|
|
253080
253203
|
this.extensionCache = /* @__PURE__ */ new Map();
|
|
253081
|
-
const extensions = await this.loadExtensionsFromDir(
|
|
253204
|
+
const extensions = await this.loadExtensionsFromDir(os23.homedir());
|
|
253082
253205
|
extensions.forEach((extension) => {
|
|
253083
253206
|
this.extensionCache.set(extension.name, extension);
|
|
253084
253207
|
});
|
|
@@ -258113,7 +258236,7 @@ var init_config3 = __esm({
|
|
|
258113
258236
|
this.truncateToolOutputThreshold = params.truncateToolOutputThreshold ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD;
|
|
258114
258237
|
this.truncateToolOutputLines = params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
|
258115
258238
|
this.channel = params.channel;
|
|
258116
|
-
this.defaultFileEncoding = params.defaultFileEncoding
|
|
258239
|
+
this.defaultFileEncoding = params.defaultFileEncoding;
|
|
258117
258240
|
this.storage = new Storage(this.targetDir);
|
|
258118
258241
|
this.inputFormat = params.inputFormat ?? InputFormat.TEXT;
|
|
258119
258242
|
this.fileExclusions = new FileExclusions(this);
|
|
@@ -259379,7 +259502,7 @@ import * as child_process from "node:child_process";
|
|
|
259379
259502
|
import * as process15 from "node:process";
|
|
259380
259503
|
import * as path71 from "node:path";
|
|
259381
259504
|
import * as fs68 from "node:fs";
|
|
259382
|
-
import * as
|
|
259505
|
+
import * as os24 from "node:os";
|
|
259383
259506
|
function getVsCodeCommand(platform15 = process15.platform) {
|
|
259384
259507
|
return platform15 === "win32" ? "code.cmd" : "code";
|
|
259385
259508
|
}
|
|
@@ -259401,7 +259524,7 @@ async function findVsCodeCommand(platform15 = process15.platform) {
|
|
|
259401
259524
|
} catch {
|
|
259402
259525
|
}
|
|
259403
259526
|
const locations = [];
|
|
259404
|
-
const homeDir =
|
|
259527
|
+
const homeDir = os24.homedir();
|
|
259405
259528
|
if (platform15 === "darwin") {
|
|
259406
259529
|
locations.push("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code", path71.join(homeDir, "Library/Application Support/Code/bin/code"));
|
|
259407
259530
|
} else if (platform15 === "linux") {
|
|
@@ -320273,7 +320396,7 @@ var require_supports_color2 = __commonJS({
|
|
|
320273
320396
|
"node_modules/chalk/node_modules/supports-color/index.js"(exports2, module2) {
|
|
320274
320397
|
"use strict";
|
|
320275
320398
|
init_esbuild_shims();
|
|
320276
|
-
var
|
|
320399
|
+
var os48 = __require("os");
|
|
320277
320400
|
var tty3 = __require("tty");
|
|
320278
320401
|
var hasFlag3 = require_has_flag2();
|
|
320279
320402
|
var { env: env7 } = process;
|
|
@@ -320322,7 +320445,7 @@ var require_supports_color2 = __commonJS({
|
|
|
320322
320445
|
return min;
|
|
320323
320446
|
}
|
|
320324
320447
|
if (process.platform === "win32") {
|
|
320325
|
-
const osRelease =
|
|
320448
|
+
const osRelease = os48.release().split(".");
|
|
320326
320449
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
320327
320450
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
320328
320451
|
}
|
|
@@ -348844,7 +348967,7 @@ var require_util28 = __commonJS({
|
|
|
348844
348967
|
var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols10();
|
|
348845
348968
|
var { states, opcodes } = require_constants18();
|
|
348846
348969
|
var { ErrorEvent: ErrorEvent2, createFastMessageEvent } = require_events2();
|
|
348847
|
-
var { isUtf8 } = __require("node:buffer");
|
|
348970
|
+
var { isUtf8: isUtf82 } = __require("node:buffer");
|
|
348848
348971
|
var { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require_data_url2();
|
|
348849
348972
|
function isConnecting(ws2) {
|
|
348850
348973
|
return ws2[kReadyState] === states.CONNECTING;
|
|
@@ -348996,7 +349119,7 @@ var require_util28 = __commonJS({
|
|
|
348996
349119
|
var hasIntl = typeof process.versions.icu === "string";
|
|
348997
349120
|
var fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0;
|
|
348998
349121
|
var utf8Decode = hasIntl ? fatalDecoder.decode.bind(fatalDecoder) : function(buffer) {
|
|
348999
|
-
if (
|
|
349122
|
+
if (isUtf82(buffer)) {
|
|
349000
349123
|
return buffer.toString("utf-8");
|
|
349001
349124
|
}
|
|
349002
349125
|
throw new TypeError("Invalid utf-8 received.");
|
|
@@ -356879,7 +357002,7 @@ var require_supports_color3 = __commonJS({
|
|
|
356879
357002
|
"node_modules/ink-link/node_modules/supports-color/index.js"(exports2, module2) {
|
|
356880
357003
|
"use strict";
|
|
356881
357004
|
init_esbuild_shims();
|
|
356882
|
-
var
|
|
357005
|
+
var os48 = __require("os");
|
|
356883
357006
|
var tty3 = __require("tty");
|
|
356884
357007
|
var hasFlag3 = require_has_flag2();
|
|
356885
357008
|
var { env: env7 } = process;
|
|
@@ -356928,7 +357051,7 @@ var require_supports_color3 = __commonJS({
|
|
|
356928
357051
|
return min;
|
|
356929
357052
|
}
|
|
356930
357053
|
if (process.platform === "win32") {
|
|
356931
|
-
const osRelease =
|
|
357054
|
+
const osRelease = os48.release().split(".");
|
|
356932
357055
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
356933
357056
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
356934
357057
|
}
|
|
@@ -360806,7 +360929,7 @@ var require_util31 = __commonJS({
|
|
|
360806
360929
|
exports2.isValidFile = isValidFile;
|
|
360807
360930
|
exports2.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
360808
360931
|
var fs116 = __require("fs");
|
|
360809
|
-
var
|
|
360932
|
+
var os48 = __require("os");
|
|
360810
360933
|
var path128 = __require("path");
|
|
360811
360934
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
360812
360935
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
@@ -360913,7 +361036,7 @@ var require_util31 = __commonJS({
|
|
|
360913
361036
|
}
|
|
360914
361037
|
__name(getWellKnownCertificateConfigFileLocation, "getWellKnownCertificateConfigFileLocation");
|
|
360915
361038
|
function _isWindows() {
|
|
360916
|
-
return
|
|
361039
|
+
return os48.platform().startsWith("win");
|
|
360917
361040
|
}
|
|
360918
361041
|
__name(_isWindows, "_isWindows");
|
|
360919
361042
|
}
|
|
@@ -365885,7 +366008,7 @@ var require_googleauth2 = __commonJS({
|
|
|
365885
366008
|
var fs116 = __require("fs");
|
|
365886
366009
|
var gaxios_1 = require_src40();
|
|
365887
366010
|
var gcpMetadata = require_src42();
|
|
365888
|
-
var
|
|
366011
|
+
var os48 = __require("os");
|
|
365889
366012
|
var path128 = __require("path");
|
|
365890
366013
|
var crypto_1 = require_crypto6();
|
|
365891
366014
|
var computeclient_1 = require_computeclient2();
|
|
@@ -366391,7 +366514,7 @@ var require_googleauth2 = __commonJS({
|
|
|
366391
366514
|
* @api private
|
|
366392
366515
|
*/
|
|
366393
366516
|
_isWindows() {
|
|
366394
|
-
const sys =
|
|
366517
|
+
const sys = os48.platform();
|
|
366395
366518
|
if (sys && sys.length >= 3) {
|
|
366396
366519
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
366397
366520
|
return true;
|
|
@@ -370522,9 +370645,9 @@ var require_defaults4 = __commonJS({
|
|
|
370522
370645
|
"node_modules/@pnpm/npm-conf/lib/defaults.js"(exports2) {
|
|
370523
370646
|
"use strict";
|
|
370524
370647
|
init_esbuild_shims();
|
|
370525
|
-
var
|
|
370648
|
+
var os48 = __require("os");
|
|
370526
370649
|
var path128 = __require("path");
|
|
370527
|
-
var temp =
|
|
370650
|
+
var temp = os48.tmpdir();
|
|
370528
370651
|
var uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
370529
370652
|
var hasUnicode = /* @__PURE__ */ __name(() => true, "hasUnicode");
|
|
370530
370653
|
var isWindows9 = process.platform === "win32";
|
|
@@ -370535,7 +370658,7 @@ var require_defaults4 = __commonJS({
|
|
|
370535
370658
|
var umask = {
|
|
370536
370659
|
fromString: /* @__PURE__ */ __name(() => process.umask(), "fromString")
|
|
370537
370660
|
};
|
|
370538
|
-
var home =
|
|
370661
|
+
var home = os48.homedir();
|
|
370539
370662
|
if (home) {
|
|
370540
370663
|
process.env.HOME = home;
|
|
370541
370664
|
} else {
|
|
@@ -376552,7 +376675,7 @@ var ansi_styles_default3 = ansiStyles3;
|
|
|
376552
376675
|
// node_modules/ink/node_modules/chalk/source/vendor/supports-color/index.js
|
|
376553
376676
|
init_esbuild_shims();
|
|
376554
376677
|
import process18 from "node:process";
|
|
376555
|
-
import
|
|
376678
|
+
import os25 from "node:os";
|
|
376556
376679
|
import tty from "node:tty";
|
|
376557
376680
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process18.argv) {
|
|
376558
376681
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -376620,7 +376743,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
376620
376743
|
return min;
|
|
376621
376744
|
}
|
|
376622
376745
|
if (process18.platform === "win32") {
|
|
376623
|
-
const osRelease =
|
|
376746
|
+
const osRelease = os25.release().split(".");
|
|
376624
376747
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
376625
376748
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
376626
376749
|
}
|
|
@@ -379232,7 +379355,7 @@ var measure_element_default = measureElement;
|
|
|
379232
379355
|
// packages/cli/src/gemini.tsx
|
|
379233
379356
|
var import_react148 = __toESM(require_react(), 1);
|
|
379234
379357
|
import dns2 from "node:dns";
|
|
379235
|
-
import
|
|
379358
|
+
import os47 from "node:os";
|
|
379236
379359
|
import { basename as basename25 } from "node:path";
|
|
379237
379360
|
import v8 from "node:v8";
|
|
379238
379361
|
|
|
@@ -383797,7 +383920,7 @@ init_esbuild_shims();
|
|
|
383797
383920
|
// packages/cli/src/commands/extensions/utils.ts
|
|
383798
383921
|
init_esbuild_shims();
|
|
383799
383922
|
var import_chalk5 = __toESM(require_source(), 1);
|
|
383800
|
-
import * as
|
|
383923
|
+
import * as os26 from "node:os";
|
|
383801
383924
|
async function getExtensionManager() {
|
|
383802
383925
|
const workspaceDir = process.cwd();
|
|
383803
383926
|
const extensionManager = new ExtensionManager({
|
|
@@ -383817,7 +383940,7 @@ function extensionToOutputString(extension, extensionManager, workspaceDir, inli
|
|
|
383817
383940
|
const cwd7 = workspaceDir;
|
|
383818
383941
|
const userEnabled = extensionManager.isEnabled(
|
|
383819
383942
|
extension.config.name,
|
|
383820
|
-
|
|
383943
|
+
os26.homedir()
|
|
383821
383944
|
);
|
|
383822
383945
|
const workspaceEnabled = extensionManager.isEnabled(
|
|
383823
383946
|
extension.config.name,
|
|
@@ -385477,7 +385600,7 @@ yargsParser.looksLikeNumber = looksLikeNumber;
|
|
|
385477
385600
|
var lib_default = yargsParser;
|
|
385478
385601
|
|
|
385479
385602
|
// node_modules/yargs/lib/platform-shims/esm.mjs
|
|
385480
|
-
import { basename as basename18, dirname as dirname24, extname as
|
|
385603
|
+
import { basename as basename18, dirname as dirname24, extname as extname6, relative as relative9, resolve as resolve26 } from "path";
|
|
385481
385604
|
|
|
385482
385605
|
// node_modules/yargs/build/lib/utils/process-argv.js
|
|
385483
385606
|
init_esbuild_shims();
|
|
@@ -385745,7 +385868,7 @@ var esm_default3 = {
|
|
|
385745
385868
|
path: {
|
|
385746
385869
|
basename: basename18,
|
|
385747
385870
|
dirname: dirname24,
|
|
385748
|
-
extname:
|
|
385871
|
+
extname: extname6,
|
|
385749
385872
|
relative: relative9,
|
|
385750
385873
|
resolve: resolve26
|
|
385751
385874
|
},
|
|
@@ -389679,7 +389802,7 @@ import { homedir as homedir19 } from "node:os";
|
|
|
389679
389802
|
|
|
389680
389803
|
// packages/cli/src/utils/resolvePath.ts
|
|
389681
389804
|
init_esbuild_shims();
|
|
389682
|
-
import * as
|
|
389805
|
+
import * as os27 from "node:os";
|
|
389683
389806
|
import * as path87 from "node:path";
|
|
389684
389807
|
function resolvePath2(p2) {
|
|
389685
389808
|
if (!p2) {
|
|
@@ -389687,9 +389810,9 @@ function resolvePath2(p2) {
|
|
|
389687
389810
|
}
|
|
389688
389811
|
let expandedPath = p2;
|
|
389689
389812
|
if (p2.toLowerCase().startsWith("%userprofile%")) {
|
|
389690
|
-
expandedPath =
|
|
389813
|
+
expandedPath = os27.homedir() + p2.substring("%userprofile%".length);
|
|
389691
389814
|
} else if (p2 === "~" || p2.startsWith("~/")) {
|
|
389692
|
-
expandedPath =
|
|
389815
|
+
expandedPath = os27.homedir() + p2.substring(1);
|
|
389693
389816
|
}
|
|
389694
389817
|
return path87.normalize(expandedPath);
|
|
389695
389818
|
}
|
|
@@ -389929,14 +390052,14 @@ __name(getPackageJson, "getPackageJson");
|
|
|
389929
390052
|
// packages/cli/src/utils/version.ts
|
|
389930
390053
|
async function getCliVersion() {
|
|
389931
390054
|
const pkgJson = await getPackageJson();
|
|
389932
|
-
return "0.12.
|
|
390055
|
+
return "0.12.5";
|
|
389933
390056
|
}
|
|
389934
390057
|
__name(getCliVersion, "getCliVersion");
|
|
389935
390058
|
|
|
389936
390059
|
// packages/cli/src/config/sandboxConfig.ts
|
|
389937
390060
|
init_esbuild_shims();
|
|
389938
390061
|
var import_command_exists = __toESM(require_command_exists2(), 1);
|
|
389939
|
-
import * as
|
|
390062
|
+
import * as os28 from "node:os";
|
|
389940
390063
|
var VALID_SANDBOX_COMMANDS = [
|
|
389941
390064
|
"docker",
|
|
389942
390065
|
"podman",
|
|
@@ -389972,7 +390095,7 @@ function getSandboxCommand(sandbox) {
|
|
|
389972
390095
|
`Missing sandbox command '${sandbox}' (from QWEN_SANDBOX)`
|
|
389973
390096
|
);
|
|
389974
390097
|
}
|
|
389975
|
-
if (
|
|
390098
|
+
if (os28.platform() === "darwin" && import_command_exists.default.sync("sandbox-exec")) {
|
|
389976
390099
|
return "sandbox-exec";
|
|
389977
390100
|
} else if (import_command_exists.default.sync("docker") && sandbox === true) {
|
|
389978
390101
|
return "docker";
|
|
@@ -394539,7 +394662,7 @@ async function loadCliConfig(settings, argv, cwd7 = process.cwd(), overrideExten
|
|
|
394539
394662
|
// NOTE: do NOT set a yargs default for `chat-recording`, otherwise argv will
|
|
394540
394663
|
// always be true and the settings file can never disable recording.
|
|
394541
394664
|
chatRecording: argv.chatRecording ?? settings.general?.chatRecording ?? true,
|
|
394542
|
-
defaultFileEncoding: settings.general?.defaultFileEncoding
|
|
394665
|
+
defaultFileEncoding: settings.general?.defaultFileEncoding,
|
|
394543
394666
|
lsp: {
|
|
394544
394667
|
enabled: lspEnabled
|
|
394545
394668
|
}
|
|
@@ -396344,7 +396467,7 @@ var QwenDark = new Theme(
|
|
|
396344
396467
|
// packages/cli/src/ui/themes/theme-manager.ts
|
|
396345
396468
|
import * as fs87 from "node:fs";
|
|
396346
396469
|
import * as path93 from "node:path";
|
|
396347
|
-
import * as
|
|
396470
|
+
import * as os29 from "node:os";
|
|
396348
396471
|
|
|
396349
396472
|
// packages/cli/src/ui/themes/ansi.ts
|
|
396350
396473
|
init_esbuild_shims();
|
|
@@ -396996,7 +397119,7 @@ var ThemeManager = class {
|
|
|
396996
397119
|
if (this.customThemes.has(canonicalPath)) {
|
|
396997
397120
|
return this.customThemes.get(canonicalPath);
|
|
396998
397121
|
}
|
|
396999
|
-
const homeDir = path93.resolve(
|
|
397122
|
+
const homeDir = path93.resolve(os29.homedir());
|
|
397000
397123
|
if (!canonicalPath.startsWith(homeDir)) {
|
|
397001
397124
|
debugLogger84.warn(
|
|
397002
397125
|
`Theme file at "${themePath}" is outside your home directory. Only load themes from trusted sources.`
|
|
@@ -397415,7 +397538,7 @@ var import_react26 = __toESM(require_react(), 1);
|
|
|
397415
397538
|
// packages/cli/src/utils/systemInfo.ts
|
|
397416
397539
|
init_esbuild_shims();
|
|
397417
397540
|
import process30 from "node:process";
|
|
397418
|
-
import
|
|
397541
|
+
import os30 from "node:os";
|
|
397419
397542
|
import { execSync as execSync5 } from "node:child_process";
|
|
397420
397543
|
|
|
397421
397544
|
// packages/cli/src/ui/utils/formatters.ts
|
|
@@ -397490,7 +397613,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
397490
397613
|
|
|
397491
397614
|
// packages/cli/src/generated/git-commit.ts
|
|
397492
397615
|
init_esbuild_shims();
|
|
397493
|
-
var GIT_COMMIT_INFO = "
|
|
397616
|
+
var GIT_COMMIT_INFO = "dbfa5b3e8";
|
|
397494
397617
|
|
|
397495
397618
|
// packages/cli/src/utils/systemInfo.ts
|
|
397496
397619
|
async function getNpmVersion() {
|
|
@@ -397531,7 +397654,7 @@ __name(getSandboxEnv, "getSandboxEnv");
|
|
|
397531
397654
|
async function getSystemInfo(context2) {
|
|
397532
397655
|
const osPlatform = process30.platform;
|
|
397533
397656
|
const osArch = process30.arch;
|
|
397534
|
-
const osRelease =
|
|
397657
|
+
const osRelease = os30.release();
|
|
397535
397658
|
const nodeVersion2 = process30.version;
|
|
397536
397659
|
const npmVersion = await getNpmVersion();
|
|
397537
397660
|
const sandboxEnv = getSandboxEnv();
|
|
@@ -398350,7 +398473,7 @@ var docsCommand = {
|
|
|
398350
398473
|
|
|
398351
398474
|
// packages/cli/src/ui/commands/directoryCommand.tsx
|
|
398352
398475
|
init_esbuild_shims();
|
|
398353
|
-
import * as
|
|
398476
|
+
import * as os31 from "node:os";
|
|
398354
398477
|
import * as path94 from "node:path";
|
|
398355
398478
|
function expandHomeDir(p2) {
|
|
398356
398479
|
if (!p2) {
|
|
@@ -398358,9 +398481,9 @@ function expandHomeDir(p2) {
|
|
|
398358
398481
|
}
|
|
398359
398482
|
let expandedPath = p2;
|
|
398360
398483
|
if (p2.toLowerCase().startsWith("%userprofile%")) {
|
|
398361
|
-
expandedPath =
|
|
398484
|
+
expandedPath = os31.homedir() + p2.substring("%userprofile%".length);
|
|
398362
398485
|
} else if (p2 === "~" || p2.startsWith("~/")) {
|
|
398363
|
-
expandedPath =
|
|
398486
|
+
expandedPath = os31.homedir() + p2.substring(1);
|
|
398364
398487
|
}
|
|
398365
398488
|
return path94.normalize(expandedPath);
|
|
398366
398489
|
}
|
|
@@ -401234,7 +401357,7 @@ var mcpCommand2 = {
|
|
|
401234
401357
|
// packages/cli/src/ui/commands/memoryCommand.ts
|
|
401235
401358
|
init_esbuild_shims();
|
|
401236
401359
|
import path98 from "node:path";
|
|
401237
|
-
import
|
|
401360
|
+
import os32 from "node:os";
|
|
401238
401361
|
import fs90 from "node:fs/promises";
|
|
401239
401362
|
var memoryCommand = {
|
|
401240
401363
|
name: "memory",
|
|
@@ -401319,7 +401442,7 @@ ${memoryContent}
|
|
|
401319
401442
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
401320
401443
|
try {
|
|
401321
401444
|
const globalMemoryPath = path98.join(
|
|
401322
|
-
|
|
401445
|
+
os32.homedir(),
|
|
401323
401446
|
QWEN_DIR,
|
|
401324
401447
|
getCurrentGeminiMdFilename()
|
|
401325
401448
|
);
|
|
@@ -402192,7 +402315,7 @@ init_esbuild_shims();
|
|
|
402192
402315
|
// packages/cli/src/ui/utils/terminalSetup.ts
|
|
402193
402316
|
init_esbuild_shims();
|
|
402194
402317
|
import { promises as fs92 } from "node:fs";
|
|
402195
|
-
import * as
|
|
402318
|
+
import * as os33 from "node:os";
|
|
402196
402319
|
import * as path101 from "node:path";
|
|
402197
402320
|
import { exec as exec3 } from "node:child_process";
|
|
402198
402321
|
import { promisify as promisify9 } from "node:util";
|
|
@@ -402317,7 +402440,7 @@ async function detectTerminal() {
|
|
|
402317
402440
|
if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
|
|
402318
402441
|
return "vscode";
|
|
402319
402442
|
}
|
|
402320
|
-
if (
|
|
402443
|
+
if (os33.platform() !== "win32") {
|
|
402321
402444
|
try {
|
|
402322
402445
|
const { stdout } = await execAsync2("ps -o comm= -p $PPID");
|
|
402323
402446
|
const parentName = stdout.trim();
|
|
@@ -402347,10 +402470,10 @@ async function backupFile(filePath) {
|
|
|
402347
402470
|
}
|
|
402348
402471
|
__name(backupFile, "backupFile");
|
|
402349
402472
|
function getVSCodeStyleConfigDir(appName) {
|
|
402350
|
-
const platform15 =
|
|
402473
|
+
const platform15 = os33.platform();
|
|
402351
402474
|
if (platform15 === "darwin") {
|
|
402352
402475
|
return path101.join(
|
|
402353
|
-
|
|
402476
|
+
os33.homedir(),
|
|
402354
402477
|
"Library",
|
|
402355
402478
|
"Application Support",
|
|
402356
402479
|
appName,
|
|
@@ -402362,7 +402485,7 @@ function getVSCodeStyleConfigDir(appName) {
|
|
|
402362
402485
|
}
|
|
402363
402486
|
return path101.join(process.env["APPDATA"], appName, "User");
|
|
402364
402487
|
} else {
|
|
402365
|
-
return path101.join(
|
|
402488
|
+
return path101.join(os33.homedir(), ".config", appName, "User");
|
|
402366
402489
|
}
|
|
402367
402490
|
}
|
|
402368
402491
|
__name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
|
|
@@ -402904,13 +403027,13 @@ var setupGithubCommand = {
|
|
|
402904
403027
|
// packages/cli/src/ui/commands/insightCommand.ts
|
|
402905
403028
|
init_esbuild_shims();
|
|
402906
403029
|
import { join as join43 } from "path";
|
|
402907
|
-
import
|
|
403030
|
+
import os35 from "os";
|
|
402908
403031
|
|
|
402909
403032
|
// packages/cli/src/services/insight/generators/StaticInsightGenerator.ts
|
|
402910
403033
|
init_esbuild_shims();
|
|
402911
403034
|
import fs95 from "fs/promises";
|
|
402912
403035
|
import path104 from "path";
|
|
402913
|
-
import
|
|
403036
|
+
import os34 from "os";
|
|
402914
403037
|
|
|
402915
403038
|
// packages/cli/src/services/insight/generators/DataProcessor.ts
|
|
402916
403039
|
init_esbuild_shims();
|
|
@@ -404018,7 +404141,7 @@ var StaticInsightGenerator = class {
|
|
|
404018
404141
|
}
|
|
404019
404142
|
// Ensure the output directory exists
|
|
404020
404143
|
async ensureOutputDirectory() {
|
|
404021
|
-
const outputDir = path104.join(
|
|
404144
|
+
const outputDir = path104.join(os34.homedir(), ".qwen", "insights");
|
|
404022
404145
|
await fs95.mkdir(outputDir, { recursive: true });
|
|
404023
404146
|
return outputDir;
|
|
404024
404147
|
}
|
|
@@ -404071,7 +404194,7 @@ var insightCommand = {
|
|
|
404071
404194
|
action: /* @__PURE__ */ __name(async (context2) => {
|
|
404072
404195
|
try {
|
|
404073
404196
|
context2.ui.setDebugMessage(t4("Generating insights..."));
|
|
404074
|
-
const projectsDir = join43(
|
|
404197
|
+
const projectsDir = join43(os35.homedir(), ".qwen", "projects");
|
|
404075
404198
|
if (!context2.services.config) {
|
|
404076
404199
|
throw new Error("Config service is not available");
|
|
404077
404200
|
}
|
|
@@ -426583,7 +426706,7 @@ init_esbuild_shims();
|
|
|
426583
426706
|
var import_react46 = __toESM(require_react(), 1);
|
|
426584
426707
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
426585
426708
|
import fs99 from "node:fs";
|
|
426586
|
-
import
|
|
426709
|
+
import os36 from "node:os";
|
|
426587
426710
|
import pathMod from "node:path";
|
|
426588
426711
|
|
|
426589
426712
|
// packages/cli/src/ui/components/shared/vim-buffer-actions.ts
|
|
@@ -428416,7 +428539,7 @@ function useTextBuffer({
|
|
|
428416
428539
|
const openInExternalEditor = (0, import_react46.useCallback)(
|
|
428417
428540
|
async (opts = {}) => {
|
|
428418
428541
|
const editor = opts.editor ?? process.env["VISUAL"] ?? process.env["EDITOR"] ?? (process.platform === "win32" ? "notepad" : "vi");
|
|
428419
|
-
const tmpDir = fs99.mkdtempSync(pathMod.join(
|
|
428542
|
+
const tmpDir = fs99.mkdtempSync(pathMod.join(os36.tmpdir(), "qwen-edit-"));
|
|
428420
428543
|
const filePath = pathMod.join(tmpDir, "buffer.txt");
|
|
428421
428544
|
fs99.writeFileSync(filePath, text, "utf8");
|
|
428422
428545
|
dispatch({ type: "create_undo_snapshot" });
|
|
@@ -444907,7 +445030,7 @@ init_esbuild_shims();
|
|
|
444907
445030
|
var import_react122 = __toESM(require_react(), 1);
|
|
444908
445031
|
import crypto13 from "node:crypto";
|
|
444909
445032
|
import path113 from "node:path";
|
|
444910
|
-
import
|
|
445033
|
+
import os37 from "node:os";
|
|
444911
445034
|
import fs103 from "node:fs";
|
|
444912
445035
|
var OUTPUT_UPDATE_INTERVAL_MS2 = 1e3;
|
|
444913
445036
|
var MAX_OUTPUT_LENGTH2 = 1e4;
|
|
@@ -444945,14 +445068,14 @@ var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPend
|
|
|
444945
445068
|
{ type: "user_shell", text: rawQuery },
|
|
444946
445069
|
userMessageTimestamp
|
|
444947
445070
|
);
|
|
444948
|
-
const isWindows9 =
|
|
445071
|
+
const isWindows9 = os37.platform() === "win32";
|
|
444949
445072
|
const targetDir = config2.getTargetDir();
|
|
444950
445073
|
let commandToExecute = rawQuery;
|
|
444951
445074
|
let pwdFilePath;
|
|
444952
445075
|
if (!isWindows9) {
|
|
444953
445076
|
let command2 = rawQuery.trim();
|
|
444954
445077
|
const pwdFileName = `shell_pwd_${crypto13.randomBytes(6).toString("hex")}.tmp`;
|
|
444955
|
-
pwdFilePath = path113.join(
|
|
445078
|
+
pwdFilePath = path113.join(os37.tmpdir(), pwdFileName);
|
|
444956
445079
|
if (!command2.endsWith(";") && !command2.endsWith("&")) {
|
|
444957
445080
|
command2 += ";";
|
|
444958
445081
|
}
|
|
@@ -447486,13 +447609,13 @@ import { format as format3 } from "node:util";
|
|
|
447486
447609
|
init_esbuild_shims();
|
|
447487
447610
|
var import_graceful_fs = __toESM(require_graceful_fs(), 1);
|
|
447488
447611
|
import path119 from "node:path";
|
|
447489
|
-
import
|
|
447612
|
+
import os40 from "node:os";
|
|
447490
447613
|
|
|
447491
447614
|
// node_modules/xdg-basedir/index.js
|
|
447492
447615
|
init_esbuild_shims();
|
|
447493
|
-
import
|
|
447616
|
+
import os38 from "os";
|
|
447494
447617
|
import path116 from "path";
|
|
447495
|
-
var homeDirectory =
|
|
447618
|
+
var homeDirectory = os38.homedir();
|
|
447496
447619
|
var { env: env5 } = process;
|
|
447497
447620
|
var xdgData = env5.XDG_DATA_HOME || (homeDirectory ? path116.join(homeDirectory, ".local", "share") : void 0);
|
|
447498
447621
|
var xdgConfig = env5.XDG_CONFIG_HOME || (homeDirectory ? path116.join(homeDirectory, ".config") : void 0);
|
|
@@ -447727,14 +447850,14 @@ var dist_default7 = FS;
|
|
|
447727
447850
|
|
|
447728
447851
|
// node_modules/atomically/dist/constants.js
|
|
447729
447852
|
init_esbuild_shims();
|
|
447730
|
-
import
|
|
447853
|
+
import os39 from "node:os";
|
|
447731
447854
|
import process40 from "node:process";
|
|
447732
447855
|
var DEFAULT_ENCODING = "utf8";
|
|
447733
447856
|
var DEFAULT_FILE_MODE = 438;
|
|
447734
447857
|
var DEFAULT_FOLDER_MODE = 511;
|
|
447735
447858
|
var DEFAULT_WRITE_OPTIONS = {};
|
|
447736
|
-
var DEFAULT_USER_UID =
|
|
447737
|
-
var DEFAULT_USER_GID =
|
|
447859
|
+
var DEFAULT_USER_UID = os39.userInfo().uid;
|
|
447860
|
+
var DEFAULT_USER_GID = os39.userInfo().gid;
|
|
447738
447861
|
var DEFAULT_TIMEOUT_SYNC = 1e3;
|
|
447739
447862
|
var IS_POSIX = !!process40.getuid;
|
|
447740
447863
|
var IS_USER_ROOT2 = process40.getuid ? !process40.getuid() : false;
|
|
@@ -448187,7 +448310,7 @@ __name(hasProperty, "hasProperty");
|
|
|
448187
448310
|
// node_modules/configstore/index.js
|
|
448188
448311
|
function getConfigDirectory(id, globalConfigPath) {
|
|
448189
448312
|
const pathPrefix = globalConfigPath ? path119.join(id, "config.json") : path119.join("configstore", `${id}.json`);
|
|
448190
|
-
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(
|
|
448313
|
+
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os40.tmpdir()) + path119.sep);
|
|
448191
448314
|
return path119.join(configDirectory, pathPrefix);
|
|
448192
448315
|
}
|
|
448193
448316
|
__name(getConfigDirectory, "getConfigDirectory");
|
|
@@ -448466,7 +448589,7 @@ var ansi_styles_default6 = ansiStyles6;
|
|
|
448466
448589
|
// node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
|
|
448467
448590
|
init_esbuild_shims();
|
|
448468
448591
|
import process43 from "node:process";
|
|
448469
|
-
import
|
|
448592
|
+
import os41 from "node:os";
|
|
448470
448593
|
import tty2 from "node:tty";
|
|
448471
448594
|
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process43.argv) {
|
|
448472
448595
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -448534,7 +448657,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
448534
448657
|
return min;
|
|
448535
448658
|
}
|
|
448536
448659
|
if (process43.platform === "win32") {
|
|
448537
|
-
const osRelease =
|
|
448660
|
+
const osRelease = os41.release().split(".");
|
|
448538
448661
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
448539
448662
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
448540
448663
|
}
|
|
@@ -449531,7 +449654,7 @@ init_esbuild_shims();
|
|
|
449531
449654
|
var import_ini2 = __toESM(require_ini3(), 1);
|
|
449532
449655
|
import process45 from "node:process";
|
|
449533
449656
|
import path120 from "node:path";
|
|
449534
|
-
import
|
|
449657
|
+
import os42 from "node:os";
|
|
449535
449658
|
import fs108 from "node:fs";
|
|
449536
449659
|
var isWindows8 = process45.platform === "win32";
|
|
449537
449660
|
var readRc = /* @__PURE__ */ __name((filePath) => {
|
|
@@ -449566,7 +449689,7 @@ var getNpmPrefix = /* @__PURE__ */ __name(() => {
|
|
|
449566
449689
|
if (envPrefix) {
|
|
449567
449690
|
return envPrefix;
|
|
449568
449691
|
}
|
|
449569
|
-
const homePrefix = readRc(path120.join(
|
|
449692
|
+
const homePrefix = readRc(path120.join(os42.homedir(), ".npmrc"));
|
|
449570
449693
|
if (homePrefix) {
|
|
449571
449694
|
return homePrefix;
|
|
449572
449695
|
}
|
|
@@ -449597,11 +449720,11 @@ var getYarnPrefix = /* @__PURE__ */ __name(() => {
|
|
|
449597
449720
|
if (windowsPrefix) {
|
|
449598
449721
|
return windowsPrefix;
|
|
449599
449722
|
}
|
|
449600
|
-
const configPrefix = path120.join(
|
|
449723
|
+
const configPrefix = path120.join(os42.homedir(), ".config/yarn");
|
|
449601
449724
|
if (fs108.existsSync(configPrefix)) {
|
|
449602
449725
|
return configPrefix;
|
|
449603
449726
|
}
|
|
449604
|
-
const homePrefix = path120.join(
|
|
449727
|
+
const homePrefix = path120.join(os42.homedir(), ".yarn-config");
|
|
449605
449728
|
if (fs108.existsSync(homePrefix)) {
|
|
449606
449729
|
return homePrefix;
|
|
449607
449730
|
}
|
|
@@ -450448,7 +450571,7 @@ import { spawn as spawn11 } from "node:child_process";
|
|
|
450448
450571
|
var spawnWrapper = spawn11;
|
|
450449
450572
|
|
|
450450
450573
|
// packages/cli/src/utils/handleAutoUpdate.ts
|
|
450451
|
-
import
|
|
450574
|
+
import os43 from "node:os";
|
|
450452
450575
|
function handleAutoUpdate(info, settings, projectRoot, spawnFn = spawnWrapper) {
|
|
450453
450576
|
if (!info) {
|
|
450454
450577
|
return;
|
|
@@ -450474,7 +450597,7 @@ ${installationInfo.updateMessage}`;
|
|
|
450474
450597
|
"@latest",
|
|
450475
450598
|
isNightly ? "@nightly" : `@${info.update.latest}`
|
|
450476
450599
|
);
|
|
450477
|
-
const isWindows9 =
|
|
450600
|
+
const isWindows9 = os43.platform() === "win32";
|
|
450478
450601
|
const shell2 = isWindows9 ? "cmd.exe" : "bash";
|
|
450479
450602
|
const shellArgs = isWindows9 ? ["/c", updateCommand2] : ["-c", updateCommand2];
|
|
450480
450603
|
const updateProcess = spawnFn(shell2, shellArgs, { stdio: "pipe" });
|
|
@@ -452562,7 +452685,7 @@ __name(relaunchAppInChildProcess, "relaunchAppInChildProcess");
|
|
|
452562
452685
|
init_esbuild_shims();
|
|
452563
452686
|
var import_shell_quote5 = __toESM(require_shell_quote(), 1);
|
|
452564
452687
|
import { exec as exec4, execSync as execSync8, spawn as spawn13 } from "node:child_process";
|
|
452565
|
-
import
|
|
452688
|
+
import os44 from "node:os";
|
|
452566
452689
|
import path126 from "node:path";
|
|
452567
452690
|
import fs113 from "node:fs";
|
|
452568
452691
|
import { fileURLToPath as fileURLToPath17 } from "node:url";
|
|
@@ -452570,7 +452693,7 @@ import { promisify as promisify12 } from "node:util";
|
|
|
452570
452693
|
import { randomBytes as randomBytes5 } from "node:crypto";
|
|
452571
452694
|
var execAsync3 = promisify12(exec4);
|
|
452572
452695
|
function getContainerPath(hostPath) {
|
|
452573
|
-
if (
|
|
452696
|
+
if (os44.platform() !== "win32") {
|
|
452574
452697
|
return hostPath;
|
|
452575
452698
|
}
|
|
452576
452699
|
const withForwardSlashes = hostPath.replace(/\\/g, "/");
|
|
@@ -452600,7 +452723,7 @@ async function shouldUseCurrentUserInSandbox() {
|
|
|
452600
452723
|
if (envVar === "0" || envVar === "false") {
|
|
452601
452724
|
return false;
|
|
452602
452725
|
}
|
|
452603
|
-
if (
|
|
452726
|
+
if (os44.platform() === "linux") {
|
|
452604
452727
|
const debugEnv = [process.env["DEBUG"], process.env["DEBUG_MODE"]].some(
|
|
452605
452728
|
(v2) => v2 === "true" || v2 === "1"
|
|
452606
452729
|
);
|
|
@@ -452625,7 +452748,7 @@ function ports() {
|
|
|
452625
452748
|
}
|
|
452626
452749
|
__name(ports, "ports");
|
|
452627
452750
|
function entrypoint(workdir, cliArgs) {
|
|
452628
|
-
const isWindows9 =
|
|
452751
|
+
const isWindows9 = os44.platform() === "win32";
|
|
452629
452752
|
const containerWorkdir = getContainerPath(workdir);
|
|
452630
452753
|
const shellCmds = [];
|
|
452631
452754
|
const pathSeparator = isWindows9 ? ";" : ":";
|
|
@@ -452704,9 +452827,9 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
452704
452827
|
"-D",
|
|
452705
452828
|
`TARGET_DIR=${fs113.realpathSync(process.cwd())}`,
|
|
452706
452829
|
"-D",
|
|
452707
|
-
`TMP_DIR=${fs113.realpathSync(
|
|
452830
|
+
`TMP_DIR=${fs113.realpathSync(os44.tmpdir())}`,
|
|
452708
452831
|
"-D",
|
|
452709
|
-
`HOME_DIR=${fs113.realpathSync(
|
|
452832
|
+
`HOME_DIR=${fs113.realpathSync(os44.homedir())}`,
|
|
452710
452833
|
"-D",
|
|
452711
452834
|
`CACHE_DIR=${fs113.realpathSync(execSync8(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`
|
|
452712
452835
|
];
|
|
@@ -452870,8 +452993,8 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
452870
452993
|
`${userSettingsDirOnHost}:${getContainerPath(userSettingsDirOnHost)}`
|
|
452871
452994
|
);
|
|
452872
452995
|
}
|
|
452873
|
-
args.push("--volume", `${
|
|
452874
|
-
const gcloudConfigDir = path126.join(
|
|
452996
|
+
args.push("--volume", `${os44.tmpdir()}:${getContainerPath(os44.tmpdir())}`);
|
|
452997
|
+
const gcloudConfigDir = path126.join(os44.homedir(), ".config", "gcloud");
|
|
452875
452998
|
if (fs113.existsSync(gcloudConfigDir)) {
|
|
452876
452999
|
args.push(
|
|
452877
453000
|
"--volume",
|
|
@@ -453069,7 +453192,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
453069
453192
|
}
|
|
453070
453193
|
args.push("--env", `SANDBOX=${containerName}`);
|
|
453071
453194
|
if (config2.command === "podman") {
|
|
453072
|
-
const emptyAuthFilePath = path126.join(
|
|
453195
|
+
const emptyAuthFilePath = path126.join(os44.tmpdir(), "empty_auth.json");
|
|
453073
453196
|
fs113.writeFileSync(emptyAuthFilePath, "{}", "utf-8");
|
|
453074
453197
|
args.push("--authfile", emptyAuthFilePath);
|
|
453075
453198
|
}
|
|
@@ -453081,7 +453204,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
453081
453204
|
const uid = execSync8("id -u").toString().trim();
|
|
453082
453205
|
const gid = execSync8("id -g").toString().trim();
|
|
453083
453206
|
const username = "qwen";
|
|
453084
|
-
const homeDir = getContainerPath(
|
|
453207
|
+
const homeDir = getContainerPath(os44.homedir());
|
|
453085
453208
|
const setupUserCommands = [
|
|
453086
453209
|
// Use -f with groupadd to avoid errors if the group already exists.
|
|
453087
453210
|
`groupadd -f -g ${gid} ${username}`,
|
|
@@ -453093,7 +453216,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
453093
453216
|
const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
|
|
453094
453217
|
finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
|
|
453095
453218
|
userFlag = `--user ${uid}:${gid}`;
|
|
453096
|
-
args.push("--env", `HOME=${
|
|
453219
|
+
args.push("--env", `HOME=${os44.homedir()}`);
|
|
453097
453220
|
} else if (isIntegrationTest) {
|
|
453098
453221
|
args.push("--user", "root");
|
|
453099
453222
|
userFlag = "--user root";
|
|
@@ -453104,7 +453227,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
453104
453227
|
let sandboxProcess = void 0;
|
|
453105
453228
|
if (proxyCommand) {
|
|
453106
453229
|
const proxyContainerCommand = `${config2.command} run --rm --init ${userFlag} --name ${SANDBOX_PROXY_NAME} --network ${SANDBOX_PROXY_NAME} -p 8877:8877 -v ${process.cwd()}:${workdir} --workdir ${workdir} ${image2} ${proxyCommand}`;
|
|
453107
|
-
const isWindows9 =
|
|
453230
|
+
const isWindows9 = os44.platform() === "win32";
|
|
453108
453231
|
const proxyShell = isWindows9 ? "cmd.exe" : "bash";
|
|
453109
453232
|
const proxyShellArgs = isWindows9 ? ["/c", proxyContainerCommand] : ["-c", proxyContainerCommand];
|
|
453110
453233
|
proxyProcess = spawn13(proxyShell, proxyShellArgs, {
|
|
@@ -453272,9 +453395,9 @@ __name(ensureSandboxImageIsPresent, "ensureSandboxImageIsPresent");
|
|
|
453272
453395
|
// packages/cli/src/utils/startupWarnings.ts
|
|
453273
453396
|
init_esbuild_shims();
|
|
453274
453397
|
import fs114 from "node:fs/promises";
|
|
453275
|
-
import
|
|
453398
|
+
import os45 from "node:os";
|
|
453276
453399
|
import { join as pathJoin } from "node:path";
|
|
453277
|
-
var warningsFilePath = pathJoin(
|
|
453400
|
+
var warningsFilePath = pathJoin(os45.tmpdir(), "qwen-code-warnings.txt");
|
|
453278
453401
|
async function getStartupWarnings() {
|
|
453279
453402
|
try {
|
|
453280
453403
|
await fs114.access(warningsFilePath);
|
|
@@ -453298,7 +453421,7 @@ __name(getStartupWarnings, "getStartupWarnings");
|
|
|
453298
453421
|
// packages/cli/src/utils/userStartupWarnings.ts
|
|
453299
453422
|
init_esbuild_shims();
|
|
453300
453423
|
import fs115 from "node:fs/promises";
|
|
453301
|
-
import * as
|
|
453424
|
+
import * as os46 from "node:os";
|
|
453302
453425
|
import path127 from "node:path";
|
|
453303
453426
|
var homeDirectoryCheck = {
|
|
453304
453427
|
id: "home-directory",
|
|
@@ -453306,7 +453429,7 @@ var homeDirectoryCheck = {
|
|
|
453306
453429
|
try {
|
|
453307
453430
|
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
|
453308
453431
|
fs115.realpath(options2.workspaceRoot),
|
|
453309
|
-
fs115.realpath(
|
|
453432
|
+
fs115.realpath(os46.homedir())
|
|
453310
453433
|
]);
|
|
453311
453434
|
if (workspaceRealPath === homeRealPath) {
|
|
453312
453435
|
return "You are running Qwen Code in your home directory. It is recommended to run in a project-specific directory.";
|
|
@@ -456167,7 +456290,7 @@ var QwenAgent = class {
|
|
|
456167
456290
|
async initialize(args) {
|
|
456168
456291
|
this.clientCapabilities = args.clientCapabilities;
|
|
456169
456292
|
const authMethods = buildAuthMethods();
|
|
456170
|
-
const version2 = "0.12.
|
|
456293
|
+
const version2 = "0.12.5";
|
|
456171
456294
|
return {
|
|
456172
456295
|
protocolVersion: PROTOCOL_VERSION,
|
|
456173
456296
|
agentInfo: {
|
|
@@ -456563,7 +456686,7 @@ function validateDnsResolutionOrder(order) {
|
|
|
456563
456686
|
}
|
|
456564
456687
|
__name(validateDnsResolutionOrder, "validateDnsResolutionOrder");
|
|
456565
456688
|
function getNodeMemoryArgs(isDebugMode2) {
|
|
456566
|
-
const totalMemoryMB =
|
|
456689
|
+
const totalMemoryMB = os47.totalmem() / (1024 * 1024);
|
|
456567
456690
|
const heapStats = v8.getHeapStatistics();
|
|
456568
456691
|
const currentMaxOldSpaceSizeMb = Math.floor(
|
|
456569
456692
|
heapStats.heap_size_limit / 1024 / 1024
|