@mmmbuto/qwen-code-termux 0.6.1-termux → 0.6.2-termux
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/README.md +19 -190
- package/{dist/cli.js → cli.js} +187 -52
- package/locales/en.js +1073 -0
- package/locales/ru.js +1092 -0
- package/locales/zh.js +927 -0
- package/package.json +16 -122
- package/tiktoken_bg.wasm +0 -0
- package/scripts/postinstall.cjs +0 -13
- /package/{dist/sandbox-macos-permissive-closed.sb → sandbox-macos-permissive-closed.sb} +0 -0
- /package/{dist/sandbox-macos-permissive-open.sb → sandbox-macos-permissive-open.sb} +0 -0
- /package/{dist/sandbox-macos-permissive-proxied.sb → sandbox-macos-permissive-proxied.sb} +0 -0
- /package/{dist/sandbox-macos-restrictive-closed.sb → sandbox-macos-restrictive-closed.sb} +0 -0
- /package/{dist/sandbox-macos-restrictive-open.sb → sandbox-macos-restrictive-open.sb} +0 -0
- /package/{dist/sandbox-macos-restrictive-proxied.sb → sandbox-macos-restrictive-proxied.sb} +0 -0
- /package/{dist/vendor → vendor}/ripgrep/COPYING +0 -0
- /package/{dist/vendor → vendor}/ripgrep/arm64-darwin/rg +0 -0
- /package/{dist/vendor → vendor}/ripgrep/arm64-linux/rg +0 -0
- /package/{dist/vendor → vendor}/ripgrep/x64-darwin/rg +0 -0
- /package/{dist/vendor → vendor}/ripgrep/x64-linux/rg +0 -0
- /package/{dist/vendor → vendor}/ripgrep/x64-win32/rg.exe +0 -0
package/{dist/cli.js → cli.js}
RENAMED
|
@@ -142952,8 +142952,42 @@ import crypto5 from "crypto";
|
|
|
142952
142952
|
import path9 from "node:path";
|
|
142953
142953
|
import { promises as fs13 } from "node:fs";
|
|
142954
142954
|
import * as os7 from "os";
|
|
142955
|
+
import { execSync } from "node:child_process";
|
|
142955
142956
|
import { EventEmitter as EventEmitter2 } from "events";
|
|
142956
142957
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
142958
|
+
function isTermux() {
|
|
142959
|
+
return process.platform === "android" || process.env["PREFIX"]?.includes("com.termux") || process.env["TERMUX_VERSION"] !== void 0;
|
|
142960
|
+
}
|
|
142961
|
+
async function openBrowserUrl(url2) {
|
|
142962
|
+
if (isTermux()) {
|
|
142963
|
+
try {
|
|
142964
|
+
const possiblePaths = [
|
|
142965
|
+
"/data/data/com.termux/files/usr/bin/termux-open-url",
|
|
142966
|
+
"/usr/bin/termux-open-url",
|
|
142967
|
+
"termux-open-url"
|
|
142968
|
+
];
|
|
142969
|
+
let termuxOpenUrl = "termux-open-url";
|
|
142970
|
+
for (const path112 of possiblePaths) {
|
|
142971
|
+
try {
|
|
142972
|
+
execSync(`test -x "${path112}"`, { stdio: "ignore" });
|
|
142973
|
+
termuxOpenUrl = path112;
|
|
142974
|
+
break;
|
|
142975
|
+
} catch {
|
|
142976
|
+
}
|
|
142977
|
+
}
|
|
142978
|
+
console.debug(`Opening URL with: ${termuxOpenUrl}`);
|
|
142979
|
+
execSync(`"${termuxOpenUrl}" "${url2}"`, {
|
|
142980
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
142981
|
+
env: { ...process.env, PATH: process.env["PATH"] }
|
|
142982
|
+
});
|
|
142983
|
+
} catch (error2) {
|
|
142984
|
+
console.error(`Failed to open URL with termux-open-url: ${error2 instanceof Error ? error2.message : String(error2)}`);
|
|
142985
|
+
throw error2;
|
|
142986
|
+
}
|
|
142987
|
+
} else {
|
|
142988
|
+
await open_default(url2);
|
|
142989
|
+
}
|
|
142990
|
+
}
|
|
142957
142991
|
function generateCodeVerifier() {
|
|
142958
142992
|
return crypto5.randomBytes(32).toString("base64url");
|
|
142959
142993
|
}
|
|
@@ -143059,13 +143093,7 @@ ${deviceAuth.verification_uri_complete}
|
|
|
143059
143093
|
}, "showFallbackMessage");
|
|
143060
143094
|
if (!config2.isBrowserLaunchSuppressed()) {
|
|
143061
143095
|
try {
|
|
143062
|
-
|
|
143063
|
-
if (childProcess3) {
|
|
143064
|
-
childProcess3.on("error", () => {
|
|
143065
|
-
console.debug("Failed to open browser. Visit this URL to authorize:");
|
|
143066
|
-
showFallbackMessage();
|
|
143067
|
-
});
|
|
143068
|
-
}
|
|
143096
|
+
await openBrowserUrl(deviceAuth.verification_uri_complete);
|
|
143069
143097
|
} catch (_err) {
|
|
143070
143098
|
showFallbackMessage();
|
|
143071
143099
|
}
|
|
@@ -143237,6 +143265,8 @@ var init_qwenOAuth2 = __esm({
|
|
|
143237
143265
|
QWEN_OAUTH_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
143238
143266
|
QWEN_DIR3 = ".qwen";
|
|
143239
143267
|
QWEN_CREDENTIAL_FILENAME2 = "oauth_creds.json";
|
|
143268
|
+
__name(isTermux, "isTermux");
|
|
143269
|
+
__name(openBrowserUrl, "openBrowserUrl");
|
|
143240
143270
|
__name(generateCodeVerifier, "generateCodeVerifier");
|
|
143241
143271
|
__name(generateCodeChallenge, "generateCodeChallenge");
|
|
143242
143272
|
__name(generatePKCEPair, "generatePKCEPair");
|
|
@@ -154897,7 +154927,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
154897
154927
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
154898
154928
|
});
|
|
154899
154929
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
154900
|
-
const version2 = "0.6.
|
|
154930
|
+
const version2 = "0.6.2-termux";
|
|
154901
154931
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
154902
154932
|
const baseHeaders = {
|
|
154903
154933
|
"User-Agent": userAgent2
|
|
@@ -155493,7 +155523,7 @@ var init_jsonl_utils = __esm({
|
|
|
155493
155523
|
// packages/core/dist/src/utils/gitUtils.js
|
|
155494
155524
|
import * as fs16 from "node:fs";
|
|
155495
155525
|
import * as path11 from "node:path";
|
|
155496
|
-
import { execSync } from "node:child_process";
|
|
155526
|
+
import { execSync as execSync2 } from "node:child_process";
|
|
155497
155527
|
function isGitRepository(directory) {
|
|
155498
155528
|
try {
|
|
155499
155529
|
let currentDir = path11.resolve(directory);
|
|
@@ -155521,7 +155551,7 @@ var init_gitUtils = __esm({
|
|
|
155521
155551
|
__name(isGitRepository, "isGitRepository");
|
|
155522
155552
|
getGitBranch = /* @__PURE__ */ __name((cwd7) => {
|
|
155523
155553
|
try {
|
|
155524
|
-
const branch =
|
|
155554
|
+
const branch = execSync2("git rev-parse --abbrev-ref HEAD", {
|
|
155525
155555
|
cwd: cwd7,
|
|
155526
155556
|
encoding: "utf8",
|
|
155527
155557
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -159438,7 +159468,7 @@ var init_types4 = __esm({
|
|
|
159438
159468
|
});
|
|
159439
159469
|
|
|
159440
159470
|
// packages/core/dist/src/utils/editor.js
|
|
159441
|
-
import { execSync as
|
|
159471
|
+
import { execSync as execSync3, spawn, spawnSync } from "node:child_process";
|
|
159442
159472
|
function isValidEditorType(editor) {
|
|
159443
159473
|
return [
|
|
159444
159474
|
"vscode",
|
|
@@ -159454,7 +159484,7 @@ function isValidEditorType(editor) {
|
|
|
159454
159484
|
}
|
|
159455
159485
|
function commandExists(cmd) {
|
|
159456
159486
|
try {
|
|
159457
|
-
|
|
159487
|
+
execSync3(process.platform === "win32" ? `where.exe ${cmd}` : `command -v ${cmd}`, { stdio: "ignore" });
|
|
159458
159488
|
return true;
|
|
159459
159489
|
} catch {
|
|
159460
159490
|
return false;
|
|
@@ -165717,7 +165747,7 @@ var require_lib3 = __commonJS({
|
|
|
165717
165747
|
});
|
|
165718
165748
|
|
|
165719
165749
|
// packages/core/dist/src/utils/systemEncoding.js
|
|
165720
|
-
import { execSync as
|
|
165750
|
+
import { execSync as execSync4 } from "node:child_process";
|
|
165721
165751
|
import os11 from "node:os";
|
|
165722
165752
|
function getCachedEncodingForBuffer(buffer) {
|
|
165723
165753
|
if (cachedSystemEncoding === void 0) {
|
|
@@ -165737,7 +165767,7 @@ function getCachedEncodingForBuffer(buffer) {
|
|
|
165737
165767
|
function getSystemEncoding() {
|
|
165738
165768
|
if (os11.platform() === "win32") {
|
|
165739
165769
|
try {
|
|
165740
|
-
const output =
|
|
165770
|
+
const output = execSync4("chcp", { encoding: "utf8" });
|
|
165741
165771
|
const match3 = output.match(/:\s*(\d+)/);
|
|
165742
165772
|
if (match3) {
|
|
165743
165773
|
const codePage = parseInt(match3[1], 10);
|
|
@@ -165755,7 +165785,7 @@ function getSystemEncoding() {
|
|
|
165755
165785
|
let locale = env7["LC_ALL"] || env7["LC_CTYPE"] || env7["LANG"] || "";
|
|
165756
165786
|
if (!locale) {
|
|
165757
165787
|
try {
|
|
165758
|
-
locale =
|
|
165788
|
+
locale = execSync4("locale charmap", { encoding: "utf8" }).toString().trim();
|
|
165759
165789
|
} catch (_e2) {
|
|
165760
165790
|
console.warn("Failed to get locale charmap.");
|
|
165761
165791
|
return null;
|
|
@@ -281316,7 +281346,7 @@ var require_command_exists = __commonJS({
|
|
|
281316
281346
|
"use strict";
|
|
281317
281347
|
init_esbuild_shims();
|
|
281318
281348
|
var exec5 = __require("child_process").exec;
|
|
281319
|
-
var
|
|
281349
|
+
var execSync10 = __require("child_process").execSync;
|
|
281320
281350
|
var fs101 = __require("fs");
|
|
281321
281351
|
var path112 = __require("path");
|
|
281322
281352
|
var access7 = fs101.access;
|
|
@@ -281390,7 +281420,7 @@ var require_command_exists = __commonJS({
|
|
|
281390
281420
|
var commandExistsUnixSync = /* @__PURE__ */ __name(function(commandName, cleanedCommandName) {
|
|
281391
281421
|
if (fileNotExistsSync(commandName)) {
|
|
281392
281422
|
try {
|
|
281393
|
-
var stdout =
|
|
281423
|
+
var stdout = execSync10(
|
|
281394
281424
|
"command -v " + cleanedCommandName + " 2>/dev/null && { echo >&1 " + cleanedCommandName + "; exit 0; }"
|
|
281395
281425
|
);
|
|
281396
281426
|
return !!stdout;
|
|
@@ -281405,7 +281435,7 @@ var require_command_exists = __commonJS({
|
|
|
281405
281435
|
return false;
|
|
281406
281436
|
}
|
|
281407
281437
|
try {
|
|
281408
|
-
var stdout =
|
|
281438
|
+
var stdout = execSync10("where " + cleanedCommandName, { stdio: [] });
|
|
281409
281439
|
return !!stdout;
|
|
281410
281440
|
} catch (error2) {
|
|
281411
281441
|
return false;
|
|
@@ -349331,6 +349361,7 @@ function getMergeStrategyForPath(path112) {
|
|
|
349331
349361
|
}
|
|
349332
349362
|
__name(getMergeStrategyForPath, "getMergeStrategyForPath");
|
|
349333
349363
|
var SETTINGS_DIRECTORY_NAME2 = ".qwen";
|
|
349364
|
+
var LEGACY_SETTINGS_FILENAME = "config.json";
|
|
349334
349365
|
var USER_SETTINGS_PATH = Storage.getGlobalSettingsPath();
|
|
349335
349366
|
var USER_SETTINGS_DIR2 = path72.dirname(USER_SETTINGS_PATH);
|
|
349336
349367
|
var DEFAULT_EXCLUDED_ENV_VARS = ["DEBUG", "DEBUG_MODE"];
|
|
@@ -349412,6 +349443,10 @@ var MIGRATION_MAP = {
|
|
|
349412
349443
|
vlmSwitchMode: "experimental.vlmSwitchMode",
|
|
349413
349444
|
visionModelPreview: "experimental.visionModelPreview"
|
|
349414
349445
|
};
|
|
349446
|
+
function isTermux2() {
|
|
349447
|
+
return process25.platform === "android" || !!process25.env["TERMUX_VERSION"] || !!(process25.env["PREFIX"] && process25.env["PREFIX"].includes("com.termux"));
|
|
349448
|
+
}
|
|
349449
|
+
__name(isTermux2, "isTermux");
|
|
349415
349450
|
function getSystemSettingsPath() {
|
|
349416
349451
|
if (process25.env["QWEN_CODE_SYSTEM_SETTINGS_PATH"]) {
|
|
349417
349452
|
return process25.env["QWEN_CODE_SYSTEM_SETTINGS_PATH"];
|
|
@@ -349731,6 +349766,11 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349731
349766
|
const systemSettingsPath = getSystemSettingsPath();
|
|
349732
349767
|
const systemDefaultsPath = getSystemDefaultsPath();
|
|
349733
349768
|
const migratedInMemorScopes = /* @__PURE__ */ new Set();
|
|
349769
|
+
const legacyUserSettingsPath = path72.join(
|
|
349770
|
+
homedir13(),
|
|
349771
|
+
SETTINGS_DIRECTORY_NAME2,
|
|
349772
|
+
LEGACY_SETTINGS_FILENAME
|
|
349773
|
+
);
|
|
349734
349774
|
const resolvedWorkspaceDir = path72.resolve(workspaceDir);
|
|
349735
349775
|
const resolvedHomeDir = path72.resolve(homedir13());
|
|
349736
349776
|
let realWorkspaceDir = resolvedWorkspaceDir;
|
|
@@ -349742,15 +349782,29 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349742
349782
|
const workspaceSettingsPath = new Storage(
|
|
349743
349783
|
workspaceDir
|
|
349744
349784
|
).getWorkspaceSettingsPath();
|
|
349745
|
-
const
|
|
349785
|
+
const legacyWorkspaceSettingsPath = path72.join(
|
|
349786
|
+
workspaceDir,
|
|
349787
|
+
SETTINGS_DIRECTORY_NAME2,
|
|
349788
|
+
LEGACY_SETTINGS_FILENAME
|
|
349789
|
+
);
|
|
349790
|
+
let warnedLegacySettings = false;
|
|
349791
|
+
const loadAndMigrate = /* @__PURE__ */ __name((filePath, scope, legacyFilePath) => {
|
|
349746
349792
|
try {
|
|
349747
|
-
|
|
349748
|
-
|
|
349793
|
+
let sourcePath = filePath;
|
|
349794
|
+
let usingLegacy = false;
|
|
349795
|
+
if (!fs70.existsSync(sourcePath) && legacyFilePath) {
|
|
349796
|
+
if (fs70.existsSync(legacyFilePath)) {
|
|
349797
|
+
sourcePath = legacyFilePath;
|
|
349798
|
+
usingLegacy = true;
|
|
349799
|
+
}
|
|
349800
|
+
}
|
|
349801
|
+
if (fs70.existsSync(sourcePath)) {
|
|
349802
|
+
const content = fs70.readFileSync(sourcePath, "utf-8");
|
|
349749
349803
|
const rawSettings = JSON.parse((0, import_strip_json_comments2.default)(content));
|
|
349750
349804
|
if (typeof rawSettings !== "object" || rawSettings === null || Array.isArray(rawSettings)) {
|
|
349751
349805
|
settingsErrors.push({
|
|
349752
349806
|
message: "Settings file is not a valid JSON object.",
|
|
349753
|
-
path:
|
|
349807
|
+
path: sourcePath
|
|
349754
349808
|
});
|
|
349755
349809
|
return { settings: {} };
|
|
349756
349810
|
}
|
|
@@ -349760,12 +349814,20 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349760
349814
|
if (migratedSettings) {
|
|
349761
349815
|
if (MIGRATE_V2_OVERWRITE) {
|
|
349762
349816
|
try {
|
|
349763
|
-
|
|
349764
|
-
|
|
349765
|
-
|
|
349766
|
-
|
|
349767
|
-
|
|
349768
|
-
|
|
349817
|
+
if (!usingLegacy) {
|
|
349818
|
+
fs70.renameSync(sourcePath, `${sourcePath}.orig`);
|
|
349819
|
+
fs70.writeFileSync(
|
|
349820
|
+
sourcePath,
|
|
349821
|
+
JSON.stringify(migratedSettings, null, 2),
|
|
349822
|
+
"utf-8"
|
|
349823
|
+
);
|
|
349824
|
+
} else {
|
|
349825
|
+
fs70.writeFileSync(
|
|
349826
|
+
filePath,
|
|
349827
|
+
JSON.stringify(migratedSettings, null, 2),
|
|
349828
|
+
"utf-8"
|
|
349829
|
+
);
|
|
349830
|
+
}
|
|
349769
349831
|
} catch (e4) {
|
|
349770
349832
|
console.error(
|
|
349771
349833
|
`Error migrating settings file on disk: ${getErrorMessage(
|
|
@@ -349782,8 +349844,9 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349782
349844
|
settingsObject[SETTINGS_VERSION_KEY] = SETTINGS_VERSION;
|
|
349783
349845
|
if (MIGRATE_V2_OVERWRITE) {
|
|
349784
349846
|
try {
|
|
349847
|
+
const targetPath = usingLegacy && sourcePath !== filePath ? filePath : sourcePath;
|
|
349785
349848
|
fs70.writeFileSync(
|
|
349786
|
-
|
|
349849
|
+
targetPath,
|
|
349787
349850
|
JSON.stringify(settingsObject, null, 2),
|
|
349788
349851
|
"utf-8"
|
|
349789
349852
|
);
|
|
@@ -349794,6 +349857,27 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349794
349857
|
}
|
|
349795
349858
|
}
|
|
349796
349859
|
}
|
|
349860
|
+
if (usingLegacy && !warnedLegacySettings) {
|
|
349861
|
+
console.warn(
|
|
349862
|
+
`Loaded legacy settings from ${sourcePath}. Please migrate to ${filePath}.`
|
|
349863
|
+
);
|
|
349864
|
+
warnedLegacySettings = true;
|
|
349865
|
+
}
|
|
349866
|
+
if (usingLegacy && MIGRATE_V2_OVERWRITE) {
|
|
349867
|
+
try {
|
|
349868
|
+
fs70.writeFileSync(
|
|
349869
|
+
filePath,
|
|
349870
|
+
JSON.stringify(settingsObject, null, 2),
|
|
349871
|
+
"utf-8"
|
|
349872
|
+
);
|
|
349873
|
+
} catch (e4) {
|
|
349874
|
+
console.error(
|
|
349875
|
+
`Error writing migrated settings to ${filePath}: ${getErrorMessage(
|
|
349876
|
+
e4
|
|
349877
|
+
)}`
|
|
349878
|
+
);
|
|
349879
|
+
}
|
|
349880
|
+
}
|
|
349797
349881
|
return { settings: settingsObject, rawJson: content };
|
|
349798
349882
|
}
|
|
349799
349883
|
} catch (error2) {
|
|
@@ -349809,7 +349893,11 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349809
349893
|
systemDefaultsPath,
|
|
349810
349894
|
"SystemDefaults" /* SystemDefaults */
|
|
349811
349895
|
);
|
|
349812
|
-
const userResult = loadAndMigrate(
|
|
349896
|
+
const userResult = loadAndMigrate(
|
|
349897
|
+
USER_SETTINGS_PATH,
|
|
349898
|
+
"User" /* User */,
|
|
349899
|
+
legacyUserSettingsPath
|
|
349900
|
+
);
|
|
349813
349901
|
let workspaceResult = {
|
|
349814
349902
|
settings: {},
|
|
349815
349903
|
rawJson: void 0
|
|
@@ -349817,7 +349905,8 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349817
349905
|
if (realWorkspaceDir !== realHomeDir) {
|
|
349818
349906
|
workspaceResult = loadAndMigrate(
|
|
349819
349907
|
workspaceSettingsPath,
|
|
349820
|
-
"Workspace" /* Workspace
|
|
349908
|
+
"Workspace" /* Workspace */,
|
|
349909
|
+
legacyWorkspaceSettingsPath
|
|
349821
349910
|
);
|
|
349822
349911
|
}
|
|
349823
349912
|
const systemOriginalSettings = structuredClone(systemResult.settings);
|
|
@@ -349830,6 +349919,39 @@ function loadSettings(workspaceDir = process25.cwd()) {
|
|
|
349830
349919
|
systemDefaultSettings = resolveEnvVarsInObject(systemDefaultsResult.settings);
|
|
349831
349920
|
userSettings = resolveEnvVarsInObject(userResult.settings);
|
|
349832
349921
|
workspaceSettings = resolveEnvVarsInObject(workspaceResult.settings);
|
|
349922
|
+
if (isTermux2()) {
|
|
349923
|
+
const hasHideBannerSetting = [
|
|
349924
|
+
systemSettings.ui?.hideBanner,
|
|
349925
|
+
systemDefaultSettings.ui?.hideBanner,
|
|
349926
|
+
userSettings.ui?.hideBanner,
|
|
349927
|
+
workspaceSettings.ui?.hideBanner
|
|
349928
|
+
].some((value) => typeof value === "boolean");
|
|
349929
|
+
if (!hasHideBannerSetting) {
|
|
349930
|
+
systemDefaultSettings = {
|
|
349931
|
+
...systemDefaultSettings,
|
|
349932
|
+
ui: {
|
|
349933
|
+
...systemDefaultSettings.ui ?? {},
|
|
349934
|
+
hideBanner: true
|
|
349935
|
+
}
|
|
349936
|
+
};
|
|
349937
|
+
}
|
|
349938
|
+
const hasUseRipgrepSetting = [
|
|
349939
|
+
systemSettings.tools?.useRipgrep,
|
|
349940
|
+
systemDefaultSettings.tools?.useRipgrep,
|
|
349941
|
+
userSettings.tools?.useRipgrep,
|
|
349942
|
+
workspaceSettings.tools?.useRipgrep
|
|
349943
|
+
].some((value) => typeof value === "boolean");
|
|
349944
|
+
if (!hasUseRipgrepSetting) {
|
|
349945
|
+
systemDefaultSettings = {
|
|
349946
|
+
...systemDefaultSettings,
|
|
349947
|
+
tools: {
|
|
349948
|
+
...systemDefaultSettings.tools ?? {},
|
|
349949
|
+
useRipgrep: false,
|
|
349950
|
+
useBuiltinRipgrep: false
|
|
349951
|
+
}
|
|
349952
|
+
};
|
|
349953
|
+
}
|
|
349954
|
+
}
|
|
349833
349955
|
if (userSettings.ui?.theme === "VS") {
|
|
349834
349956
|
userSettings.ui.theme = DefaultLight.name;
|
|
349835
349957
|
} else if (userSettings.ui?.theme === "VS2015") {
|
|
@@ -355880,7 +356002,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
355880
356002
|
// packages/cli/src/utils/version.ts
|
|
355881
356003
|
async function getCliVersion() {
|
|
355882
356004
|
const pkgJson = await getPackageJson();
|
|
355883
|
-
return "0.6.
|
|
356005
|
+
return "0.6.2-termux";
|
|
355884
356006
|
}
|
|
355885
356007
|
__name(getCliVersion, "getCliVersion");
|
|
355886
356008
|
|
|
@@ -363854,7 +363976,7 @@ var import_react26 = __toESM(require_react(), 1);
|
|
|
363854
363976
|
init_esbuild_shims();
|
|
363855
363977
|
import process28 from "node:process";
|
|
363856
363978
|
import os28 from "node:os";
|
|
363857
|
-
import { execSync as
|
|
363979
|
+
import { execSync as execSync6 } from "node:child_process";
|
|
363858
363980
|
|
|
363859
363981
|
// packages/cli/src/ui/utils/formatters.ts
|
|
363860
363982
|
init_esbuild_shims();
|
|
@@ -363928,12 +364050,12 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
363928
364050
|
|
|
363929
364051
|
// packages/cli/src/generated/git-commit.ts
|
|
363930
364052
|
init_esbuild_shims();
|
|
363931
|
-
var GIT_COMMIT_INFO2 = "
|
|
364053
|
+
var GIT_COMMIT_INFO2 = "6e378690";
|
|
363932
364054
|
|
|
363933
364055
|
// packages/cli/src/utils/systemInfo.ts
|
|
363934
364056
|
async function getNpmVersion() {
|
|
363935
364057
|
try {
|
|
363936
|
-
return
|
|
364058
|
+
return execSync6("npm --version", { encoding: "utf-8" }).trim();
|
|
363937
364059
|
} catch {
|
|
363938
364060
|
return "unknown";
|
|
363939
364061
|
}
|
|
@@ -366893,10 +367015,10 @@ import { Writable } from "node:stream";
|
|
|
366893
367015
|
// packages/cli/src/utils/gitUtils.ts
|
|
366894
367016
|
init_esbuild_shims();
|
|
366895
367017
|
var import_undici4 = __toESM(require_undici2(), 1);
|
|
366896
|
-
import { execSync as
|
|
367018
|
+
import { execSync as execSync7 } from "node:child_process";
|
|
366897
367019
|
var isGitHubRepository = /* @__PURE__ */ __name(() => {
|
|
366898
367020
|
try {
|
|
366899
|
-
const remotes = (
|
|
367021
|
+
const remotes = (execSync7("git remote -v", {
|
|
366900
367022
|
encoding: "utf-8"
|
|
366901
367023
|
}) || "").trim();
|
|
366902
367024
|
const pattern = /github\.com/;
|
|
@@ -366907,7 +367029,7 @@ var isGitHubRepository = /* @__PURE__ */ __name(() => {
|
|
|
366907
367029
|
}
|
|
366908
367030
|
}, "isGitHubRepository");
|
|
366909
367031
|
var getGitRepoRoot = /* @__PURE__ */ __name(() => {
|
|
366910
|
-
const gitRepoRoot = (
|
|
367032
|
+
const gitRepoRoot = (execSync7("git rev-parse --show-toplevel", {
|
|
366911
367033
|
encoding: "utf-8"
|
|
366912
367034
|
}) || "").trim();
|
|
366913
367035
|
if (!gitRepoRoot) {
|
|
@@ -366950,7 +367072,7 @@ var getLatestGitHubRelease = /* @__PURE__ */ __name(async (proxy) => {
|
|
|
366950
367072
|
}
|
|
366951
367073
|
}, "getLatestGitHubRelease");
|
|
366952
367074
|
function getGitHubRepoInfo() {
|
|
366953
|
-
const remoteUrl =
|
|
367075
|
+
const remoteUrl = execSync7("git remote get-url origin", {
|
|
366954
367076
|
encoding: "utf-8"
|
|
366955
367077
|
}).trim();
|
|
366956
367078
|
let urlToParse = remoteUrl;
|
|
@@ -395527,7 +395649,9 @@ var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
|
|
|
395527
395649
|
var Notifications = /* @__PURE__ */ __name(() => {
|
|
395528
395650
|
const { startupWarnings } = useAppContext();
|
|
395529
395651
|
const { initError, streamingState, updateInfo } = useUIState();
|
|
395530
|
-
const
|
|
395652
|
+
const settings = useSettings();
|
|
395653
|
+
const config2 = useConfig();
|
|
395654
|
+
const showStartupWarnings = !settings.merged.ui?.hideBanner && !config2.getScreenReader() && startupWarnings.length > 0;
|
|
395531
395655
|
const showInitError = initError && streamingState !== "responding" /* Responding */;
|
|
395532
395656
|
if (!showStartupWarnings && !showInitError && !updateInfo) {
|
|
395533
395657
|
return null;
|
|
@@ -411753,7 +411877,7 @@ __name(relaunchAppInChildProcess, "relaunchAppInChildProcess");
|
|
|
411753
411877
|
// packages/cli/src/utils/sandbox.ts
|
|
411754
411878
|
init_esbuild_shims();
|
|
411755
411879
|
var import_shell_quote5 = __toESM(require_shell_quote(), 1);
|
|
411756
|
-
import { exec as exec4, execSync as
|
|
411880
|
+
import { exec as exec4, execSync as execSync9, spawn as spawn10 } from "node:child_process";
|
|
411757
411881
|
import os39 from "node:os";
|
|
411758
411882
|
import path109 from "node:path";
|
|
411759
411883
|
import fs97 from "node:fs";
|
|
@@ -411912,7 +412036,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
411912
412036
|
"-D",
|
|
411913
412037
|
`HOME_DIR=${fs97.realpathSync(os39.homedir())}`,
|
|
411914
412038
|
"-D",
|
|
411915
|
-
`CACHE_DIR=${fs97.realpathSync(
|
|
412039
|
+
`CACHE_DIR=${fs97.realpathSync(execSync9(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`
|
|
411916
412040
|
];
|
|
411917
412041
|
const MAX_INCLUDE_DIRS = 5;
|
|
411918
412042
|
const targetDir = fs97.realpathSync(cliConfig?.getTargetDir() || "");
|
|
@@ -412030,7 +412154,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
412030
412154
|
console.error(`using ${projectSandboxDockerfile2} for sandbox`);
|
|
412031
412155
|
buildArgs += `-f ${path109.resolve(projectSandboxDockerfile2)} -i ${image2}`;
|
|
412032
412156
|
}
|
|
412033
|
-
|
|
412157
|
+
execSync9(
|
|
412034
412158
|
`cd ${gcRoot} && node scripts/build_sandbox.js -s ${buildArgs}`,
|
|
412035
412159
|
{
|
|
412036
412160
|
stdio: "inherit",
|
|
@@ -412139,12 +412263,12 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
412139
412263
|
args.push("--env", `no_proxy=${noProxy}`);
|
|
412140
412264
|
}
|
|
412141
412265
|
if (proxy) {
|
|
412142
|
-
|
|
412266
|
+
execSync9(
|
|
412143
412267
|
`${config2.command} network inspect ${SANDBOX_NETWORK_NAME} || ${config2.command} network create --internal ${SANDBOX_NETWORK_NAME}`
|
|
412144
412268
|
);
|
|
412145
412269
|
args.push("--network", SANDBOX_NETWORK_NAME);
|
|
412146
412270
|
if (proxyCommand) {
|
|
412147
|
-
|
|
412271
|
+
execSync9(
|
|
412148
412272
|
`${config2.command} network inspect ${SANDBOX_PROXY_NAME} || ${config2.command} network create ${SANDBOX_PROXY_NAME}`
|
|
412149
412273
|
);
|
|
412150
412274
|
}
|
|
@@ -412160,7 +412284,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
412160
412284
|
console.log(`ContainerName: ${containerName}`);
|
|
412161
412285
|
} else {
|
|
412162
412286
|
let index = 0;
|
|
412163
|
-
const containerNameCheck =
|
|
412287
|
+
const containerNameCheck = execSync9(
|
|
412164
412288
|
`${config2.command} ps -a --format "{{.Names}}"`
|
|
412165
412289
|
).toString().trim();
|
|
412166
412290
|
while (containerNameCheck.includes(`${imageName}-${index}`)) {
|
|
@@ -412288,8 +412412,8 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
412288
412412
|
userFlag = "--user root";
|
|
412289
412413
|
} else if (await shouldUseCurrentUserInSandbox()) {
|
|
412290
412414
|
args.push("--user", "root");
|
|
412291
|
-
const uid =
|
|
412292
|
-
const gid =
|
|
412415
|
+
const uid = execSync9("id -u").toString().trim();
|
|
412416
|
+
const gid = execSync9("id -g").toString().trim();
|
|
412293
412417
|
const username = "gemini";
|
|
412294
412418
|
const homeDir = getContainerPath(os39.homedir());
|
|
412295
412419
|
const setupUserCommands = [
|
|
@@ -412318,7 +412442,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
412318
412442
|
});
|
|
412319
412443
|
const stopProxy = /* @__PURE__ */ __name(() => {
|
|
412320
412444
|
console.log("stopping proxy container ...");
|
|
412321
|
-
|
|
412445
|
+
execSync9(`${config2.command} rm -f ${SANDBOX_PROXY_NAME}`);
|
|
412322
412446
|
}, "stopProxy");
|
|
412323
412447
|
process.on("exit", stopProxy);
|
|
412324
412448
|
process.on("SIGINT", stopProxy);
|
|
@@ -412508,6 +412632,11 @@ init_esbuild_shims();
|
|
|
412508
412632
|
import fs99 from "node:fs/promises";
|
|
412509
412633
|
import * as os41 from "node:os";
|
|
412510
412634
|
import path110 from "node:path";
|
|
412635
|
+
function isTermux3() {
|
|
412636
|
+
return process.platform === "android" || !!process.env["TERMUX_VERSION"] || !!(process.env["PREFIX"] && process.env["PREFIX"].includes("com.termux"));
|
|
412637
|
+
}
|
|
412638
|
+
__name(isTermux3, "isTermux");
|
|
412639
|
+
var IS_TERMUX = isTermux3();
|
|
412511
412640
|
var homeDirectoryCheck = {
|
|
412512
412641
|
id: "home-directory",
|
|
412513
412642
|
check: /* @__PURE__ */ __name(async (options2) => {
|
|
@@ -412543,6 +412672,9 @@ var rootDirectoryCheck = {
|
|
|
412543
412672
|
var ripgrepAvailabilityCheck = {
|
|
412544
412673
|
id: "ripgrep-availability",
|
|
412545
412674
|
check: /* @__PURE__ */ __name(async (options2) => {
|
|
412675
|
+
if (IS_TERMUX) {
|
|
412676
|
+
return null;
|
|
412677
|
+
}
|
|
412546
412678
|
if (!options2.useRipgrep) {
|
|
412547
412679
|
return null;
|
|
412548
412680
|
}
|
|
@@ -412558,7 +412690,7 @@ var ripgrepAvailabilityCheck = {
|
|
|
412558
412690
|
}, "check")
|
|
412559
412691
|
};
|
|
412560
412692
|
var WARNING_CHECKS = [
|
|
412561
|
-
homeDirectoryCheck,
|
|
412693
|
+
...IS_TERMUX ? [] : [homeDirectoryCheck],
|
|
412562
412694
|
rootDirectoryCheck,
|
|
412563
412695
|
ripgrepAvailabilityCheck
|
|
412564
412696
|
];
|
|
@@ -415043,7 +415175,7 @@ var GeminiAgent = class {
|
|
|
415043
415175
|
name: APPROVAL_MODE_INFO[mode].name,
|
|
415044
415176
|
description: APPROVAL_MODE_INFO[mode].description
|
|
415045
415177
|
}));
|
|
415046
|
-
const version2 = "0.6.
|
|
415178
|
+
const version2 = "0.6.2-termux";
|
|
415047
415179
|
return {
|
|
415048
415180
|
protocolVersion: PROTOCOL_VERSION,
|
|
415049
415181
|
agentInfo: {
|
|
@@ -415501,7 +415633,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
415501
415633
|
return runAcpAgent(config2, settings, extensions, argv);
|
|
415502
415634
|
}
|
|
415503
415635
|
let input = config2.getQuestion();
|
|
415504
|
-
|
|
415636
|
+
let startupWarnings = [
|
|
415505
415637
|
...await getStartupWarnings(),
|
|
415506
415638
|
...await getUserStartupWarnings({
|
|
415507
415639
|
workspaceRoot: process.cwd(),
|
|
@@ -415509,6 +415641,9 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
415509
415641
|
useBuiltinRipgrep: settings.merged.tools?.useBuiltinRipgrep ?? true
|
|
415510
415642
|
})
|
|
415511
415643
|
];
|
|
415644
|
+
if (settings.merged.ui?.hideBanner || config2.getScreenReader()) {
|
|
415645
|
+
startupWarnings = [];
|
|
415646
|
+
}
|
|
415512
415647
|
if (config2.isInteractive()) {
|
|
415513
415648
|
await kittyProtocolDetectionComplete;
|
|
415514
415649
|
await startInteractiveUI(
|