@qwen-code/qwen-code 0.19.0 → 0.19.1
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/bundled/qc-helper/docs/features/mcp.md +6 -2
- package/bundled/qc-helper/docs/qwen-serve.md +1 -1
- package/chunks/{agent-IPSDEZNB.js → agent-7CZOLKXM.js} +2 -2
- package/chunks/{agent-headless-ZMTUWMZJ.js → agent-headless-K37PBQK5.js} +2 -2
- package/chunks/{chunk-YF3ORUIU.js → chunk-2X2WXY6L.js} +309 -352
- package/chunks/{chunk-GAAALA2X.js → chunk-FXT37TZS.js} +3 -3
- package/chunks/{chunk-VRIVIYRL.js → chunk-NQDRRVJD.js} +4 -4
- package/chunks/{chunk-KFR4QTV3.js → chunk-OJMCOR55.js} +64 -57
- package/chunks/{chunk-S7ILEIB4.js → chunk-PNT7QCLK.js} +2 -3
- package/chunks/{chunk-CICUTYTF.js → chunk-YMBWB67C.js} +24 -31
- package/chunks/{computer-use-YYK42DD5.js → computer-use-AY6HODX4.js} +2 -2
- package/chunks/{contextCommand-BO45MUAA.js → contextCommand-KVKJ63NZ.js} +4 -4
- package/chunks/{cron-create-DXKAP5KN.js → cron-create-NHRAAWT5.js} +8 -5
- package/chunks/{edit-QERNJN7K.js → edit-OXD4P5YK.js} +2 -2
- package/chunks/{en-UTXMGXIR.js → en-7OGNWWME.js} +1 -0
- package/chunks/{enter-worktree-6ZKH5IL3.js → enter-worktree-NKNFTLNO.js} +2 -2
- package/chunks/{enterPlanMode-B2PBF4MA.js → enterPlanMode-7W2FCILY.js} +2 -2
- package/chunks/{exit-worktree-EOCMQO4I.js → exit-worktree-NCRZ52XD.js} +2 -2
- package/chunks/{exitPlanMode-WSRXCBRZ.js → exitPlanMode-AZIUQQHA.js} +2 -2
- package/chunks/{geminiContentGenerator-NTR4LTKS.js → geminiContentGenerator-5HKVP4JF.js} +1 -1
- package/chunks/{glob-IWDJQI2V.js → glob-VCPO3AQO.js} +2 -2
- package/chunks/{grep-2DV5BXMH.js → grep-R3W7SG6T.js} +2 -2
- package/chunks/{monitor-6HBDS2RS.js → monitor-TQCZALTB.js} +2 -2
- package/chunks/{notebook-edit-J5AY5BRY.js → notebook-edit-RYYGIJTA.js} +2 -2
- package/chunks/{openaiContentGenerator-ENABCJDM.js → openaiContentGenerator-2AUZ47JU.js} +2 -2
- package/chunks/{qwenContentGenerator-ISW42U7C.js → qwenContentGenerator-QM6ENWSO.js} +3 -3
- package/chunks/{read-file-NRX2FSSQ.js → read-file-ZSIMNYPB.js} +1 -1
- package/chunks/{ripGrep-WF5CKHR5.js → ripGrep-LONCTNP3.js} +2 -2
- package/chunks/{scheduler-PNPG5WJ3.js → scheduler-FMNCHQQH.js} +2 -2
- package/chunks/{serve-ZBRCIIHW.js → serve-XLPTFQOQ.js} +32 -11
- package/chunks/{shell-DLIL6MLU.js → shell-G2CEO7D7.js} +2 -2
- package/chunks/{skill-32TXHY4A.js → skill-E5YLTHY3.js} +1 -1
- package/chunks/{src-PDDLF5BB.js → src-GCZS2DES.js} +2 -4
- package/chunks/{team-create-EHLDSJGI.js → team-create-RQCITTFK.js} +2 -2
- package/chunks/{tool-search-FU7IZAOO.js → tool-search-2COFGD5N.js} +1 -1
- package/chunks/{workflow-WUDNBCGX.js → workflow-A5VAXYUS.js} +18 -10
- package/chunks/{write-file-NVFPX6CH.js → write-file-P2RNFLJR.js} +2 -2
- package/chunks/{zh-YOXVTJU5.js → zh-3RMSEO5M.js} +1 -0
- package/chunks/{zh-TW-J2TTW67R.js → zh-TW-R7WRLTJS.js} +1 -0
- package/cli.js +358 -202
- package/locales/en.js +1 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +3 -3
package/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
formatContextUsageText,
|
|
8
8
|
isTerminalGoalStatusKind,
|
|
9
9
|
require_react
|
|
10
|
-
} from "./chunks/chunk-
|
|
10
|
+
} from "./chunks/chunk-FXT37TZS.js";
|
|
11
11
|
import {
|
|
12
12
|
noteInteraction
|
|
13
13
|
} from "./chunks/chunk-MRO43B25.js";
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
updateOutputLanguageFile,
|
|
110
110
|
validateCustomTheme,
|
|
111
111
|
writeOutputLanguageAndRegisterPath
|
|
112
|
-
} from "./chunks/chunk-
|
|
112
|
+
} from "./chunks/chunk-OJMCOR55.js";
|
|
113
113
|
import {
|
|
114
114
|
SUPPORTED_LANGUAGES,
|
|
115
115
|
clearScreen,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
ta,
|
|
126
126
|
writeStderrLine,
|
|
127
127
|
writeStdoutLine
|
|
128
|
-
} from "./chunks/chunk-
|
|
128
|
+
} from "./chunks/chunk-NQDRRVJD.js";
|
|
129
129
|
import {
|
|
130
130
|
AgentSideConnection,
|
|
131
131
|
PROTOCOL_VERSION,
|
|
@@ -358,7 +358,7 @@ import {
|
|
|
358
358
|
writeRuntimeStatus,
|
|
359
359
|
writeWorktreeSession,
|
|
360
360
|
writeWorktreeSessionMarker
|
|
361
|
-
} from "./chunks/chunk-
|
|
361
|
+
} from "./chunks/chunk-2X2WXY6L.js";
|
|
362
362
|
import {
|
|
363
363
|
external_exports
|
|
364
364
|
} from "./chunks/chunk-K5PGHDBN.js";
|
|
@@ -445,7 +445,7 @@ import {
|
|
|
445
445
|
startToolSpan,
|
|
446
446
|
uiTelemetryService,
|
|
447
447
|
withInteractionSpan
|
|
448
|
-
} from "./chunks/chunk-
|
|
448
|
+
} from "./chunks/chunk-YMBWB67C.js";
|
|
449
449
|
import "./chunks/chunk-3PJXIDKI.js";
|
|
450
450
|
import "./chunks/chunk-UWCTAVOD.js";
|
|
451
451
|
import {
|
|
@@ -11474,14 +11474,14 @@ var require_templates = __commonJS({
|
|
|
11474
11474
|
return results;
|
|
11475
11475
|
}
|
|
11476
11476
|
__name(parseStyle, "parseStyle");
|
|
11477
|
-
function buildStyle(
|
|
11477
|
+
function buildStyle(chalk6, styles10) {
|
|
11478
11478
|
const enabled2 = {};
|
|
11479
11479
|
for (const layer of styles10) {
|
|
11480
11480
|
for (const style of layer.styles) {
|
|
11481
11481
|
enabled2[style[0]] = layer.inverse ? null : style.slice(1);
|
|
11482
11482
|
}
|
|
11483
11483
|
}
|
|
11484
|
-
let current =
|
|
11484
|
+
let current = chalk6;
|
|
11485
11485
|
for (const [styleName, styles11] of Object.entries(enabled2)) {
|
|
11486
11486
|
if (!Array.isArray(styles11)) {
|
|
11487
11487
|
continue;
|
|
@@ -11494,7 +11494,7 @@ var require_templates = __commonJS({
|
|
|
11494
11494
|
return current;
|
|
11495
11495
|
}
|
|
11496
11496
|
__name(buildStyle, "buildStyle");
|
|
11497
|
-
module.exports = (
|
|
11497
|
+
module.exports = (chalk6, temporary) => {
|
|
11498
11498
|
const styles10 = [];
|
|
11499
11499
|
const chunks = [];
|
|
11500
11500
|
let chunk = [];
|
|
@@ -11504,13 +11504,13 @@ var require_templates = __commonJS({
|
|
|
11504
11504
|
} else if (style) {
|
|
11505
11505
|
const string = chunk.join("");
|
|
11506
11506
|
chunk = [];
|
|
11507
|
-
chunks.push(styles10.length === 0 ? string : buildStyle(
|
|
11507
|
+
chunks.push(styles10.length === 0 ? string : buildStyle(chalk6, styles10)(string));
|
|
11508
11508
|
styles10.push({ inverse, styles: parseStyle(style) });
|
|
11509
11509
|
} else if (close) {
|
|
11510
11510
|
if (styles10.length === 0) {
|
|
11511
11511
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
11512
11512
|
}
|
|
11513
|
-
chunks.push(buildStyle(
|
|
11513
|
+
chunks.push(buildStyle(chalk6, styles10)(chunk.join("")));
|
|
11514
11514
|
chunk = [];
|
|
11515
11515
|
styles10.pop();
|
|
11516
11516
|
} else {
|
|
@@ -11562,16 +11562,16 @@ var require_source = __commonJS({
|
|
|
11562
11562
|
}
|
|
11563
11563
|
};
|
|
11564
11564
|
var chalkFactory3 = /* @__PURE__ */ __name((options) => {
|
|
11565
|
-
const
|
|
11566
|
-
applyOptions3(
|
|
11567
|
-
|
|
11568
|
-
Object.setPrototypeOf(
|
|
11569
|
-
Object.setPrototypeOf(
|
|
11570
|
-
|
|
11565
|
+
const chalk7 = {};
|
|
11566
|
+
applyOptions3(chalk7, options);
|
|
11567
|
+
chalk7.template = (...arguments_) => chalkTag(chalk7.template, ...arguments_);
|
|
11568
|
+
Object.setPrototypeOf(chalk7, Chalk.prototype);
|
|
11569
|
+
Object.setPrototypeOf(chalk7.template, chalk7);
|
|
11570
|
+
chalk7.template.constructor = () => {
|
|
11571
11571
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
11572
11572
|
};
|
|
11573
|
-
|
|
11574
|
-
return
|
|
11573
|
+
chalk7.template.Instance = ChalkClass;
|
|
11574
|
+
return chalk7.template;
|
|
11575
11575
|
}, "chalkFactory");
|
|
11576
11576
|
function Chalk(options) {
|
|
11577
11577
|
return chalkFactory3(options);
|
|
@@ -11683,7 +11683,7 @@ var require_source = __commonJS({
|
|
|
11683
11683
|
return openAll + string + closeAll;
|
|
11684
11684
|
}, "applyStyle");
|
|
11685
11685
|
var template;
|
|
11686
|
-
var chalkTag = /* @__PURE__ */ __name((
|
|
11686
|
+
var chalkTag = /* @__PURE__ */ __name((chalk7, ...strings) => {
|
|
11687
11687
|
const [firstString] = strings;
|
|
11688
11688
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
11689
11689
|
return strings.join(" ");
|
|
@@ -11699,14 +11699,14 @@ var require_source = __commonJS({
|
|
|
11699
11699
|
if (template === void 0) {
|
|
11700
11700
|
template = require_templates();
|
|
11701
11701
|
}
|
|
11702
|
-
return template(
|
|
11702
|
+
return template(chalk7, parts.join(""));
|
|
11703
11703
|
}, "chalkTag");
|
|
11704
11704
|
Object.defineProperties(Chalk.prototype, styles10);
|
|
11705
|
-
var
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
module.exports =
|
|
11705
|
+
var chalk6 = Chalk();
|
|
11706
|
+
chalk6.supportsColor = stdoutColor3;
|
|
11707
|
+
chalk6.stderr = Chalk({ level: stderrColor3 ? stderrColor3.level : 0 });
|
|
11708
|
+
chalk6.stderr.supportsColor = stderrColor3;
|
|
11709
|
+
module.exports = chalk6;
|
|
11710
11710
|
}
|
|
11711
11711
|
});
|
|
11712
11712
|
|
|
@@ -32908,7 +32908,7 @@ var require_tinycolor = __commonJS({
|
|
|
32908
32908
|
var h = Math.round(hsl.h * 360), s = Math.round(hsl.s * 100), l = Math.round(hsl.l * 100);
|
|
32909
32909
|
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
|
|
32910
32910
|
}, "toHslString"),
|
|
32911
|
-
toHex: /* @__PURE__ */ __name(function
|
|
32911
|
+
toHex: /* @__PURE__ */ __name(function toHex2(allow3Char) {
|
|
32912
32912
|
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
|
32913
32913
|
}, "toHex"),
|
|
32914
32914
|
toHexString: /* @__PURE__ */ __name(function toHexString(allow3Char) {
|
|
@@ -34128,7 +34128,7 @@ var require_gradient_string = __commonJS({
|
|
|
34128
34128
|
"node_modules/gradient-string/index.js"(exports, module) {
|
|
34129
34129
|
"use strict";
|
|
34130
34130
|
init_esbuild_shims();
|
|
34131
|
-
var
|
|
34131
|
+
var chalk6 = require_source();
|
|
34132
34132
|
var tinygradient = require_tinygradient();
|
|
34133
34133
|
var forbiddenChars = /\s/g;
|
|
34134
34134
|
function InitGradient(...args) {
|
|
@@ -34145,7 +34145,7 @@ var require_gradient_string = __commonJS({
|
|
|
34145
34145
|
const colors = getColors(gradient, options, colorsCount);
|
|
34146
34146
|
let result = "";
|
|
34147
34147
|
for (const s of str) {
|
|
34148
|
-
result += s.match(forbiddenChars) ? s :
|
|
34148
|
+
result += s.match(forbiddenChars) ? s : chalk6.hex(colors.shift().toHex())(s);
|
|
34149
34149
|
}
|
|
34150
34150
|
return result;
|
|
34151
34151
|
}
|
|
@@ -34160,7 +34160,7 @@ var require_gradient_string = __commonJS({
|
|
|
34160
34160
|
const lineColors = colors.slice(0);
|
|
34161
34161
|
let lineResult = "";
|
|
34162
34162
|
for (const l of line) {
|
|
34163
|
-
lineResult +=
|
|
34163
|
+
lineResult += chalk6.hex(lineColors.shift().toHex())(l);
|
|
34164
34164
|
}
|
|
34165
34165
|
results.push(lineResult);
|
|
34166
34166
|
}
|
|
@@ -45297,10 +45297,10 @@ var applyOptions = /* @__PURE__ */ __name((object, options = {}) => {
|
|
|
45297
45297
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
45298
45298
|
}, "applyOptions");
|
|
45299
45299
|
var chalkFactory = /* @__PURE__ */ __name((options) => {
|
|
45300
|
-
const
|
|
45301
|
-
applyOptions(
|
|
45302
|
-
Object.setPrototypeOf(
|
|
45303
|
-
return
|
|
45300
|
+
const chalk6 = /* @__PURE__ */ __name((...strings) => strings.join(" "), "chalk");
|
|
45301
|
+
applyOptions(chalk6, options);
|
|
45302
|
+
Object.setPrototypeOf(chalk6, createChalk.prototype);
|
|
45303
|
+
return chalk6;
|
|
45304
45304
|
}, "chalkFactory");
|
|
45305
45305
|
function createChalk(options) {
|
|
45306
45306
|
return chalkFactory(options);
|
|
@@ -48848,18 +48848,17 @@ import v83 from "node:v8";
|
|
|
48848
48848
|
// packages/cli/src/config/auth.ts
|
|
48849
48849
|
init_esbuild_shims();
|
|
48850
48850
|
var DEFAULT_ENV_KEYS = {
|
|
48851
|
-
[
|
|
48852
|
-
[
|
|
48853
|
-
[
|
|
48854
|
-
[
|
|
48851
|
+
["openai" /* USE_OPENAI */]: "OPENAI_API_KEY",
|
|
48852
|
+
["anthropic" /* USE_ANTHROPIC */]: "ANTHROPIC_API_KEY",
|
|
48853
|
+
["gemini" /* USE_GEMINI */]: "GEMINI_API_KEY",
|
|
48854
|
+
["vertex-ai" /* USE_VERTEX_AI */]: "GOOGLE_API_KEY"
|
|
48855
48855
|
};
|
|
48856
48856
|
function findModelConfig(modelProviders, authType, modelId, baseUrl) {
|
|
48857
48857
|
if (!modelProviders || !modelId) {
|
|
48858
48858
|
return void 0;
|
|
48859
48859
|
}
|
|
48860
|
-
const
|
|
48861
|
-
|
|
48862
|
-
if (!models) {
|
|
48860
|
+
const models = modelProviders[authType];
|
|
48861
|
+
if (!Array.isArray(models)) {
|
|
48863
48862
|
return void 0;
|
|
48864
48863
|
}
|
|
48865
48864
|
if (baseUrl) {
|
|
@@ -48965,7 +48964,7 @@ __name(getApiKeyError, "getApiKeyError");
|
|
|
48965
48964
|
function validateAuthMethod(authMethod, config) {
|
|
48966
48965
|
const settings = loadSettings(process.cwd(), false);
|
|
48967
48966
|
loadEnvironment(settings.merged);
|
|
48968
|
-
if (authMethod ===
|
|
48967
|
+
if (authMethod === "openai" /* USE_OPENAI */) {
|
|
48969
48968
|
const { hasKey, checkedEnvKey, isExplicitEnvKey } = hasApiKeyForAuth(
|
|
48970
48969
|
authMethod,
|
|
48971
48970
|
settings.merged,
|
|
@@ -48986,12 +48985,12 @@ function validateAuthMethod(authMethod, config) {
|
|
|
48986
48985
|
}
|
|
48987
48986
|
return null;
|
|
48988
48987
|
}
|
|
48989
|
-
if (authMethod ===
|
|
48988
|
+
if (authMethod === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
48990
48989
|
return t(
|
|
48991
48990
|
"Qwen OAuth free tier was discontinued on 2026-04-15. Run /auth to switch to Coding Plan, OpenRouter, Fireworks AI, or another provider."
|
|
48992
48991
|
);
|
|
48993
48992
|
}
|
|
48994
|
-
if (authMethod ===
|
|
48993
|
+
if (authMethod === "anthropic" /* USE_ANTHROPIC */) {
|
|
48995
48994
|
const apiKeyError = getApiKeyError(authMethod, settings.merged, config);
|
|
48996
48995
|
if (apiKeyError) {
|
|
48997
48996
|
return apiKeyError;
|
|
@@ -49014,14 +49013,14 @@ function validateAuthMethod(authMethod, config) {
|
|
|
49014
49013
|
}
|
|
49015
49014
|
return null;
|
|
49016
49015
|
}
|
|
49017
|
-
if (authMethod ===
|
|
49016
|
+
if (authMethod === "gemini" /* USE_GEMINI */) {
|
|
49018
49017
|
const apiKeyError = getApiKeyError(authMethod, settings.merged, config);
|
|
49019
49018
|
if (apiKeyError) {
|
|
49020
49019
|
return apiKeyError;
|
|
49021
49020
|
}
|
|
49022
49021
|
return null;
|
|
49023
49022
|
}
|
|
49024
|
-
if (authMethod ===
|
|
49023
|
+
if (authMethod === "vertex-ai" /* USE_VERTEX_AI */) {
|
|
49025
49024
|
const apiKeyError = getApiKeyError(authMethod, settings.merged, config);
|
|
49026
49025
|
if (apiKeyError) {
|
|
49027
49026
|
return apiKeyError;
|
|
@@ -49277,7 +49276,9 @@ function extensionConsentString(extensionConfig, commands = [], skills = [], sub
|
|
|
49277
49276
|
}
|
|
49278
49277
|
const mcpServerEntries = Object.entries(extensionConfig.mcpServers || {});
|
|
49279
49278
|
const displayLabel = extensionConfig.displayName ?? extensionConfig.name;
|
|
49280
|
-
output.push(
|
|
49279
|
+
output.push(
|
|
49280
|
+
t('Installing extension "{{name}}".', { name: displayLabel })
|
|
49281
|
+
);
|
|
49281
49282
|
if (typeof extensionConfig.description === "string" && extensionConfig.description) {
|
|
49282
49283
|
output.push(stripAnsi(extensionConfig.description));
|
|
49283
49284
|
}
|
|
@@ -49584,6 +49585,30 @@ async function getExtensionManager() {
|
|
|
49584
49585
|
return extensionManager;
|
|
49585
49586
|
}
|
|
49586
49587
|
__name(getExtensionManager, "getExtensionManager");
|
|
49588
|
+
var EXTENSION_COMMAND_SCOPES = ["User" /* User */, "Workspace" /* Workspace */];
|
|
49589
|
+
function extensionCommandScopesList() {
|
|
49590
|
+
return EXTENSION_COMMAND_SCOPES.map((s) => s.toLowerCase()).join(", ");
|
|
49591
|
+
}
|
|
49592
|
+
__name(extensionCommandScopesList, "extensionCommandScopesList");
|
|
49593
|
+
function resolveExtensionCommandScope(scope) {
|
|
49594
|
+
if (!scope) {
|
|
49595
|
+
return "User" /* User */;
|
|
49596
|
+
}
|
|
49597
|
+
const normalized = scope.toLowerCase();
|
|
49598
|
+
const matched = EXTENSION_COMMAND_SCOPES.find(
|
|
49599
|
+
(candidate) => candidate.toLowerCase() === normalized
|
|
49600
|
+
);
|
|
49601
|
+
if (matched) {
|
|
49602
|
+
return matched;
|
|
49603
|
+
}
|
|
49604
|
+
throw new Error(
|
|
49605
|
+
t("Invalid scope: {{scope}}. Please use one of {{scopes}}.", {
|
|
49606
|
+
scope,
|
|
49607
|
+
scopes: extensionCommandScopesList()
|
|
49608
|
+
})
|
|
49609
|
+
);
|
|
49610
|
+
}
|
|
49611
|
+
__name(resolveExtensionCommandScope, "resolveExtensionCommandScope");
|
|
49587
49612
|
function extensionToOutputString(extension, extensionManager, workspaceDir, inline = false) {
|
|
49588
49613
|
const cwd5 = workspaceDir;
|
|
49589
49614
|
const userEnabled = extensionManager.isEnabled(
|
|
@@ -54922,11 +54947,8 @@ var yargs_default = Yargs;
|
|
|
54922
54947
|
async function handleDisable(args) {
|
|
54923
54948
|
const extensionManager = await getExtensionManager();
|
|
54924
54949
|
try {
|
|
54925
|
-
|
|
54926
|
-
|
|
54927
|
-
} else {
|
|
54928
|
-
extensionManager.disableExtension(args.name, "User" /* User */);
|
|
54929
|
-
}
|
|
54950
|
+
const scope = resolveExtensionCommandScope(args.scope);
|
|
54951
|
+
await extensionManager.disableExtension(args.name, scope);
|
|
54930
54952
|
writeStdoutLine(
|
|
54931
54953
|
t('Extension "{{name}}" successfully disabled for scope "{{scope}}".', {
|
|
54932
54954
|
name: args.name,
|
|
@@ -54950,14 +54972,7 @@ var disableCommand = {
|
|
|
54950
54972
|
type: "string",
|
|
54951
54973
|
default: "User" /* User */
|
|
54952
54974
|
}).check((argv) => {
|
|
54953
|
-
|
|
54954
|
-
throw new Error(
|
|
54955
|
-
t("Invalid scope: {{scope}}. Please use one of {{scopes}}.", {
|
|
54956
|
-
scope: argv.scope,
|
|
54957
|
-
scopes: Object.values(SettingScope).map((s) => s.toLowerCase()).join(", ")
|
|
54958
|
-
})
|
|
54959
|
-
);
|
|
54960
|
-
}
|
|
54975
|
+
resolveExtensionCommandScope(argv.scope);
|
|
54961
54976
|
return true;
|
|
54962
54977
|
}), "builder"),
|
|
54963
54978
|
handler: /* @__PURE__ */ __name(async (argv) => {
|
|
@@ -54973,11 +54988,8 @@ init_esbuild_shims();
|
|
|
54973
54988
|
async function handleEnable(args) {
|
|
54974
54989
|
const extensionManager = await getExtensionManager();
|
|
54975
54990
|
try {
|
|
54976
|
-
|
|
54977
|
-
|
|
54978
|
-
} else {
|
|
54979
|
-
extensionManager.enableExtension(args.name, "User" /* User */);
|
|
54980
|
-
}
|
|
54991
|
+
const scope = resolveExtensionCommandScope(args.scope);
|
|
54992
|
+
await extensionManager.enableExtension(args.name, scope);
|
|
54981
54993
|
if (args.scope) {
|
|
54982
54994
|
writeStdoutLine(
|
|
54983
54995
|
t('Extension "{{name}}" successfully enabled for scope "{{scope}}".', {
|
|
@@ -55009,14 +55021,7 @@ var enableCommand = {
|
|
|
55009
55021
|
),
|
|
55010
55022
|
type: "string"
|
|
55011
55023
|
}).check((argv) => {
|
|
55012
|
-
|
|
55013
|
-
throw new Error(
|
|
55014
|
-
t("Invalid scope: {{scope}}. Please use one of {{scopes}}.", {
|
|
55015
|
-
scope: argv.scope,
|
|
55016
|
-
scopes: Object.values(SettingScope).map((s) => s.toLowerCase()).join(", ")
|
|
55017
|
-
})
|
|
55018
|
-
);
|
|
55019
|
-
}
|
|
55024
|
+
resolveExtensionCommandScope(argv.scope);
|
|
55020
55025
|
return true;
|
|
55021
55026
|
}), "builder"),
|
|
55022
55027
|
handler: /* @__PURE__ */ __name(async (argv) => {
|
|
@@ -56536,6 +56541,19 @@ function findCliEntryPath() {
|
|
|
56536
56541
|
throw new Error("Cannot determine CLI entry path");
|
|
56537
56542
|
}
|
|
56538
56543
|
__name(findCliEntryPath, "findCliEntryPath");
|
|
56544
|
+
function resolveOptionalStringField(channelName, rawConfig, field) {
|
|
56545
|
+
const value = rawConfig[field];
|
|
56546
|
+
if (value === void 0 || value === null || value === "") {
|
|
56547
|
+
return void 0;
|
|
56548
|
+
}
|
|
56549
|
+
if (typeof value !== "string") {
|
|
56550
|
+
throw new Error(
|
|
56551
|
+
`Channel "${channelName}" field "${field}" must be a string.`
|
|
56552
|
+
);
|
|
56553
|
+
}
|
|
56554
|
+
return resolveEnvVars(value);
|
|
56555
|
+
}
|
|
56556
|
+
__name(resolveOptionalStringField, "resolveOptionalStringField");
|
|
56539
56557
|
async function parseChannelConfig(name, rawConfig) {
|
|
56540
56558
|
if (!rawConfig["type"]) {
|
|
56541
56559
|
throw new Error(`Channel "${name}" is missing required field "type".`);
|
|
@@ -56549,15 +56567,20 @@ async function parseChannelConfig(name, rawConfig) {
|
|
|
56549
56567
|
);
|
|
56550
56568
|
}
|
|
56551
56569
|
for (const field of plugin.requiredConfigFields ?? []) {
|
|
56552
|
-
|
|
56570
|
+
const value = rawConfig[field];
|
|
56571
|
+
if (value === void 0 || value === null || value === "") {
|
|
56553
56572
|
throw new Error(
|
|
56554
56573
|
`Channel "${name}" (${channelType}) requires "${field}".`
|
|
56555
56574
|
);
|
|
56556
56575
|
}
|
|
56557
56576
|
}
|
|
56558
|
-
const token = rawConfig
|
|
56559
|
-
const clientId = rawConfig
|
|
56560
|
-
const clientSecret =
|
|
56577
|
+
const token = resolveOptionalStringField(name, rawConfig, "token") ?? "";
|
|
56578
|
+
const clientId = resolveOptionalStringField(name, rawConfig, "clientId");
|
|
56579
|
+
const clientSecret = resolveOptionalStringField(
|
|
56580
|
+
name,
|
|
56581
|
+
rawConfig,
|
|
56582
|
+
"clientSecret"
|
|
56583
|
+
);
|
|
56561
56584
|
return {
|
|
56562
56585
|
...rawConfig,
|
|
56563
56586
|
type: channelType,
|
|
@@ -58951,7 +58974,7 @@ var serveCommand = {
|
|
|
58951
58974
|
process.exit(1);
|
|
58952
58975
|
}
|
|
58953
58976
|
}
|
|
58954
|
-
const { runQwenServe } = await import("./chunks/serve-
|
|
58977
|
+
const { runQwenServe } = await import("./chunks/serve-XLPTFQOQ.js");
|
|
58955
58978
|
try {
|
|
58956
58979
|
const handle = await runQwenServe({
|
|
58957
58980
|
port: argv.port,
|
|
@@ -60057,11 +60080,11 @@ async function parseArguments() {
|
|
|
60057
60080
|
}).option("auth-type", {
|
|
60058
60081
|
type: "string",
|
|
60059
60082
|
choices: [
|
|
60060
|
-
|
|
60061
|
-
|
|
60062
|
-
|
|
60063
|
-
|
|
60064
|
-
|
|
60083
|
+
"openai" /* USE_OPENAI */,
|
|
60084
|
+
"anthropic" /* USE_ANTHROPIC */,
|
|
60085
|
+
"qwen-oauth" /* QWEN_OAUTH */,
|
|
60086
|
+
"gemini" /* USE_GEMINI */,
|
|
60087
|
+
"vertex-ai" /* USE_VERTEX_AI */
|
|
60065
60088
|
],
|
|
60066
60089
|
description: "Authentication type"
|
|
60067
60090
|
}).deprecateOption(
|
|
@@ -63570,6 +63593,13 @@ var ThemeManager = class {
|
|
|
63570
63593
|
* when the app first rendered.
|
|
63571
63594
|
*/
|
|
63572
63595
|
cachedAutoDetection;
|
|
63596
|
+
/**
|
|
63597
|
+
* Memoised synchronous detection of the terminal's background brightness,
|
|
63598
|
+
* used when no async OSC 11 result is available (e.g. an explicitly
|
|
63599
|
+
* configured theme, for which the startup probe never runs). Detected at
|
|
63600
|
+
* most once per process.
|
|
63601
|
+
*/
|
|
63602
|
+
terminalBackground;
|
|
63573
63603
|
/**
|
|
63574
63604
|
* Detects the terminal's dark/light preference (synchronous) and returns
|
|
63575
63605
|
* the corresponding Qwen theme.
|
|
@@ -63593,6 +63623,21 @@ var ThemeManager = class {
|
|
|
63593
63623
|
this.activeTheme = detected === "light" ? QwenLight : QwenDark;
|
|
63594
63624
|
debugLogger6.info(`Auto-detected theme (async): ${this.activeTheme.name}`);
|
|
63595
63625
|
}
|
|
63626
|
+
/**
|
|
63627
|
+
* Returns the terminal's detected background brightness ('dark' | 'light').
|
|
63628
|
+
*
|
|
63629
|
+
* Prefers the accurate async OSC 11 result captured at startup (for 'auto'
|
|
63630
|
+
* themes); otherwise falls back to a memoised synchronous heuristic
|
|
63631
|
+
* (COLORFGBG → macOS appearance → default dark). Lets UI code decide whether
|
|
63632
|
+
* the active theme's background matches the terminal without re-probing.
|
|
63633
|
+
*/
|
|
63634
|
+
getTerminalBackgroundType() {
|
|
63635
|
+
if (this.cachedAutoDetection) {
|
|
63636
|
+
return this.cachedAutoDetection;
|
|
63637
|
+
}
|
|
63638
|
+
this.terminalBackground ??= detectTerminalTheme();
|
|
63639
|
+
return this.terminalBackground;
|
|
63640
|
+
}
|
|
63596
63641
|
/**
|
|
63597
63642
|
* Gets the currently active theme.
|
|
63598
63643
|
* @returns The active theme.
|
|
@@ -65515,7 +65560,7 @@ function buildArenaExecutionInput(parsed, config) {
|
|
|
65515
65560
|
};
|
|
65516
65561
|
}
|
|
65517
65562
|
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
65518
|
-
const defaultAuthType = contentGeneratorConfig?.authType ??
|
|
65563
|
+
const defaultAuthType = contentGeneratorConfig?.authType ?? "openai" /* USE_OPENAI */;
|
|
65519
65564
|
const modelsConfig = config.getModelsConfig();
|
|
65520
65565
|
const models = parsed.models.map((parsedModel) => {
|
|
65521
65566
|
const authType = parsedModel.authType ?? defaultAuthType;
|
|
@@ -72443,7 +72488,7 @@ async function extractMetadata(conversation, config) {
|
|
|
72443
72488
|
const gitBranch = firstRecord?.gitBranch;
|
|
72444
72489
|
let gitRepo;
|
|
72445
72490
|
if (cwd5) {
|
|
72446
|
-
const { getGitRepoName } = await import("./chunks/src-
|
|
72491
|
+
const { getGitRepoName } = await import("./chunks/src-GCZS2DES.js");
|
|
72447
72492
|
gitRepo = getGitRepoName(cwd5);
|
|
72448
72493
|
}
|
|
72449
72494
|
let model;
|
|
@@ -76655,7 +76700,7 @@ function resolveVoiceTransport(model) {
|
|
|
76655
76700
|
}
|
|
76656
76701
|
__name(resolveVoiceTransport, "resolveVoiceTransport");
|
|
76657
76702
|
function isTranscribableVoiceModel(model) {
|
|
76658
|
-
return model.authType ===
|
|
76703
|
+
return model.authType === "openai" /* USE_OPENAI */ && model.isRuntimeModel !== true && typeof model.baseUrl === "string" && model.baseUrl.trim().length > 0;
|
|
76659
76704
|
}
|
|
76660
76705
|
__name(isTranscribableVoiceModel, "isTranscribableVoiceModel");
|
|
76661
76706
|
function isSelectableVoiceModel(model) {
|
|
@@ -76685,7 +76730,7 @@ async function switchMainModel(config, settings, currentAuthType, modelArg) {
|
|
|
76685
76730
|
await config.switchModel(
|
|
76686
76731
|
parsed.authType,
|
|
76687
76732
|
parsed.modelId,
|
|
76688
|
-
parsed.authType !== currentAuthType && parsed.authType ===
|
|
76733
|
+
parsed.authType !== currentAuthType && parsed.authType === "qwen-oauth" /* QWEN_OAUTH */ ? { requireCachedCredentials: true } : void 0
|
|
76689
76734
|
);
|
|
76690
76735
|
persistSetting(settings, "security.auth.selectedType", parsed.authType);
|
|
76691
76736
|
persistSetting(settings, "model.name", parsed.modelId);
|
|
@@ -81186,7 +81231,7 @@ var lspCommand = {
|
|
|
81186
81231
|
return t("Show LSP server status. Usage: /lsp [status]");
|
|
81187
81232
|
},
|
|
81188
81233
|
kind: "built-in" /* BUILT_IN */,
|
|
81189
|
-
supportedModes: ["interactive", "non_interactive"],
|
|
81234
|
+
supportedModes: ["interactive", "non_interactive", "acp"],
|
|
81190
81235
|
action: /* @__PURE__ */ __name(async (context, _args) => {
|
|
81191
81236
|
const config = context.services.config;
|
|
81192
81237
|
if (!config) {
|
|
@@ -86271,7 +86316,7 @@ var SystemController = class extends BaseController {
|
|
|
86271
86316
|
throw new Error("Request aborted");
|
|
86272
86317
|
}
|
|
86273
86318
|
try {
|
|
86274
|
-
const mod = await import("./chunks/contextCommand-
|
|
86319
|
+
const mod = await import("./chunks/contextCommand-KVKJ63NZ.js");
|
|
86275
86320
|
if (signal.aborted) {
|
|
86276
86321
|
throw new Error("Request aborted");
|
|
86277
86322
|
}
|
|
@@ -89460,8 +89505,7 @@ function getInstalledOwnedModelIds(settings, provider) {
|
|
|
89460
89505
|
const mergedSettings = settings.merged;
|
|
89461
89506
|
const modelProviders = mergedSettings["modelProviders"];
|
|
89462
89507
|
if (!modelProviders) return [];
|
|
89463
|
-
const
|
|
89464
|
-
const allModels = Array.isArray(entry) ? entry : entry?.models ?? [];
|
|
89508
|
+
const allModels = modelProviders[protocol] ?? [];
|
|
89465
89509
|
const ownsFn = resolveOwnsModel(provider);
|
|
89466
89510
|
if (!ownsFn) return allModels.map((m) => m.id);
|
|
89467
89511
|
return allModels.filter(ownsFn).map((m) => m.id);
|
|
@@ -94926,6 +94970,30 @@ function formatDuration2(ms) {
|
|
|
94926
94970
|
}
|
|
94927
94971
|
__name(formatDuration2, "formatDuration");
|
|
94928
94972
|
|
|
94973
|
+
// packages/cli/src/ui/utils/theme-background.ts
|
|
94974
|
+
init_esbuild_shims();
|
|
94975
|
+
var DARK_TERMINAL_BACKGROUND = "#000000";
|
|
94976
|
+
var LIGHT_TERMINAL_BACKGROUND = "#ffffff";
|
|
94977
|
+
function themeBackgroundMatchesTerminal() {
|
|
94978
|
+
const activeType = themeManager.getActiveTheme().type;
|
|
94979
|
+
if (activeType !== "light" && activeType !== "dark") {
|
|
94980
|
+
return true;
|
|
94981
|
+
}
|
|
94982
|
+
return activeType === themeManager.getTerminalBackgroundType();
|
|
94983
|
+
}
|
|
94984
|
+
__name(themeBackgroundMatchesTerminal, "themeBackgroundMatchesTerminal");
|
|
94985
|
+
function getInputBackgroundFill() {
|
|
94986
|
+
return themeBackgroundMatchesTerminal() ? theme.background?.primary : void 0;
|
|
94987
|
+
}
|
|
94988
|
+
__name(getInputBackgroundFill, "getInputBackgroundFill");
|
|
94989
|
+
function getEffectiveInputBackground() {
|
|
94990
|
+
if (themeBackgroundMatchesTerminal()) {
|
|
94991
|
+
return theme.background?.primary ?? "";
|
|
94992
|
+
}
|
|
94993
|
+
return themeManager.getTerminalBackgroundType() === "light" ? LIGHT_TERMINAL_BACKGROUND : DARK_TERMINAL_BACKGROUND;
|
|
94994
|
+
}
|
|
94995
|
+
__name(getEffectiveInputBackground, "getEffectiveInputBackground");
|
|
94996
|
+
|
|
94929
94997
|
// packages/cli/src/ui/components/messages/ConversationMessages.tsx
|
|
94930
94998
|
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
94931
94999
|
var isUtf8 = /utf-?8/i.test(
|
|
@@ -95011,7 +95079,10 @@ var ContinuationMarkdownMessage = /* @__PURE__ */ __name(({
|
|
|
95011
95079
|
}, "ContinuationMarkdownMessage");
|
|
95012
95080
|
var UserMessage = /* @__PURE__ */ __name(({ text, width }) => {
|
|
95013
95081
|
const isScreenReaderEnabled = use_is_screen_reader_enabled_default();
|
|
95014
|
-
const useBand = width !== void 0 && width > 0 && !isScreenReaderEnabled && !!theme.background.primary &&
|
|
95082
|
+
const useBand = width !== void 0 && width > 0 && !isScreenReaderEnabled && !!theme.background.primary && // The band paints the theme background behind every user message; only do
|
|
95083
|
+
// so when it matches the terminal, else (e.g. a light theme forced onto a
|
|
95084
|
+
// dark terminal) it renders as bright stripes fighting the surroundings.
|
|
95085
|
+
themeBackgroundMatchesTerminal() && supportsTrueColor();
|
|
95015
95086
|
const fallback = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
95016
95087
|
PrefixedTextMessage,
|
|
95017
95088
|
{
|
|
@@ -95658,7 +95729,6 @@ var import_react61 = __toESM(require_react(), 1);
|
|
|
95658
95729
|
|
|
95659
95730
|
// packages/cli/src/ui/components/shared/TextInput.tsx
|
|
95660
95731
|
init_esbuild_shims();
|
|
95661
|
-
var import_chalk6 = __toESM(require_source(), 1);
|
|
95662
95732
|
|
|
95663
95733
|
// packages/cli/src/ui/components/shared/text-buffer.ts
|
|
95664
95734
|
init_esbuild_shims();
|
|
@@ -98370,6 +98440,62 @@ __name(usePreferredEditor, "usePreferredEditor");
|
|
|
98370
98440
|
|
|
98371
98441
|
// packages/cli/src/ui/components/shared/TextInput.tsx
|
|
98372
98442
|
var import_react60 = __toESM(require_react(), 1);
|
|
98443
|
+
|
|
98444
|
+
// packages/cli/src/ui/utils/software-cursor.ts
|
|
98445
|
+
init_esbuild_shims();
|
|
98446
|
+
var import_chalk6 = __toESM(require_source(), 1);
|
|
98447
|
+
var LIGHT_CURSOR_BACKGROUND = "#D4D4D4";
|
|
98448
|
+
var DARK_CURSOR_BACKGROUND = "#3A3A3A";
|
|
98449
|
+
var INK_NAME_TO_HEX = {
|
|
98450
|
+
black: "#000000",
|
|
98451
|
+
red: "#ff0000",
|
|
98452
|
+
green: "#00ff00",
|
|
98453
|
+
yellow: "#ffff00",
|
|
98454
|
+
blue: "#0000ff",
|
|
98455
|
+
cyan: "#00ffff",
|
|
98456
|
+
magenta: "#ff00ff",
|
|
98457
|
+
white: "#ffffff",
|
|
98458
|
+
gray: "#808080",
|
|
98459
|
+
grey: "#808080",
|
|
98460
|
+
blackbright: "#808080",
|
|
98461
|
+
redbright: "#ff8080",
|
|
98462
|
+
greenbright: "#80ff80",
|
|
98463
|
+
yellowbright: "#ffff80",
|
|
98464
|
+
bluebright: "#8080ff",
|
|
98465
|
+
cyanbright: "#80ffff",
|
|
98466
|
+
magentabright: "#ff80ff",
|
|
98467
|
+
whitebright: "#ffffff"
|
|
98468
|
+
};
|
|
98469
|
+
function toHex(color2) {
|
|
98470
|
+
const resolved = resolveColor(color2) ?? color2;
|
|
98471
|
+
const lower2 = resolved.toLowerCase();
|
|
98472
|
+
if (/^#[0-9a-f]{3}$/.test(lower2)) {
|
|
98473
|
+
return `#${lower2.slice(1).split("").map((c) => c + c).join("")}`;
|
|
98474
|
+
}
|
|
98475
|
+
if (/^#[0-9a-f]{6}$/.test(lower2)) {
|
|
98476
|
+
return lower2;
|
|
98477
|
+
}
|
|
98478
|
+
return INK_NAME_TO_HEX[lower2];
|
|
98479
|
+
}
|
|
98480
|
+
__name(toHex, "toHex");
|
|
98481
|
+
function getSoftwareCursorBackground(backgroundColor = getEffectiveInputBackground()) {
|
|
98482
|
+
const hex = backgroundColor ? toHex(backgroundColor) : void 0;
|
|
98483
|
+
if (!hex) {
|
|
98484
|
+
return LIGHT_CURSOR_BACKGROUND;
|
|
98485
|
+
}
|
|
98486
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
98487
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
98488
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
98489
|
+
const luminance = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
98490
|
+
return luminance >= 128 ? DARK_CURSOR_BACKGROUND : LIGHT_CURSOR_BACKGROUND;
|
|
98491
|
+
}
|
|
98492
|
+
__name(getSoftwareCursorBackground, "getSoftwareCursorBackground");
|
|
98493
|
+
function renderSoftwareCursor(text) {
|
|
98494
|
+
return import_chalk6.default.bgHex(getSoftwareCursorBackground())(text || " ");
|
|
98495
|
+
}
|
|
98496
|
+
__name(renderSoftwareCursor, "renderSoftwareCursor");
|
|
98497
|
+
|
|
98498
|
+
// packages/cli/src/ui/components/shared/TextInput.tsx
|
|
98373
98499
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
98374
98500
|
function ellipsizeMiddle(text, width) {
|
|
98375
98501
|
if (width <= 0) return "";
|
|
@@ -98496,7 +98622,7 @@ function TextInput({
|
|
|
98496
98622
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
|
|
98497
98623
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: theme.text.accent, children: "> " }),
|
|
98498
98624
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? shouldRenderCursor ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
|
|
98499
|
-
|
|
98625
|
+
renderSoftwareCursor(placeholder.slice(0, 1)),
|
|
98500
98626
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: Colors.Gray, children: placeholder.slice(1) })
|
|
98501
98627
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: Colors.Gray, children: placeholder }) : ellipsizeOverflow && stringWidth2(buffer.text) > inputWidth ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: ellipsizeMiddle(buffer.text, inputWidth) }) : linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
|
98502
98628
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
@@ -98514,10 +98640,10 @@ function TextInput({
|
|
|
98514
98640
|
relativeVisualColForHighlight,
|
|
98515
98641
|
relativeVisualColForHighlight + 1
|
|
98516
98642
|
) || " ";
|
|
98517
|
-
const highlighted =
|
|
98643
|
+
const highlighted = renderSoftwareCursor(charToHighlight);
|
|
98518
98644
|
display = cpSlice(display, 0, relativeVisualColForHighlight) + highlighted + cpSlice(display, relativeVisualColForHighlight + 1);
|
|
98519
98645
|
} else if (relativeVisualColForHighlight === cpLen(display) && cpLen(display) === inputWidth) {
|
|
98520
|
-
display = display +
|
|
98646
|
+
display = display + renderSoftwareCursor(" ");
|
|
98521
98647
|
}
|
|
98522
98648
|
}
|
|
98523
98649
|
}
|
|
@@ -104880,7 +105006,7 @@ function getAuthDisplayType(authType, baseUrl, apiKeyEnvKey) {
|
|
|
104880
105006
|
return matched.label;
|
|
104881
105007
|
}
|
|
104882
105008
|
switch (authType) {
|
|
104883
|
-
case
|
|
105009
|
+
case "qwen-oauth" /* QWEN_OAUTH */:
|
|
104884
105010
|
return "qwen_oauth" /* QWEN_OAUTH */;
|
|
104885
105011
|
default:
|
|
104886
105012
|
return "api_key" /* API_KEY */;
|
|
@@ -106638,7 +106764,6 @@ var ProviderUpdatePrompt = /* @__PURE__ */ __name(({
|
|
|
106638
106764
|
// packages/cli/src/ui/components/SettingInputPrompt.tsx
|
|
106639
106765
|
init_esbuild_shims();
|
|
106640
106766
|
var import_react95 = __toESM(require_react(), 1);
|
|
106641
|
-
var import_chalk7 = __toESM(require_source(), 1);
|
|
106642
106767
|
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
|
|
106643
106768
|
var PasswordInput = /* @__PURE__ */ __name(({
|
|
106644
106769
|
value,
|
|
@@ -106671,7 +106796,7 @@ var PasswordInput = /* @__PURE__ */ __name(({
|
|
|
106671
106796
|
);
|
|
106672
106797
|
const maskedValue = "*".repeat(value.length);
|
|
106673
106798
|
const displayValue = maskedValue || "";
|
|
106674
|
-
const cursorChar =
|
|
106799
|
+
const cursorChar = renderSoftwareCursor(" ");
|
|
106675
106800
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Box_default, { children: [
|
|
106676
106801
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Text, { color: theme.text.accent, children: "> " }),
|
|
106677
106802
|
value.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Text, { children: [
|
|
@@ -107236,7 +107361,6 @@ var useVimModeActions = /* @__PURE__ */ __name(() => {
|
|
|
107236
107361
|
}, "useVimModeActions");
|
|
107237
107362
|
|
|
107238
107363
|
// packages/cli/src/ui/components/SettingsDialog.tsx
|
|
107239
|
-
var import_chalk8 = __toESM(require_source(), 1);
|
|
107240
107364
|
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
|
|
107241
107365
|
var debugLogger46 = createDebugLogger("SETTINGS_DIALOG");
|
|
107242
107366
|
var maxItemsToShow = 8;
|
|
@@ -107803,9 +107927,9 @@ function SettingsDialog({
|
|
|
107803
107927
|
editCursorPos + 1
|
|
107804
107928
|
);
|
|
107805
107929
|
const afterCursor = cpSlice(editBuffer, editCursorPos + 1);
|
|
107806
|
-
displayValue = beforeCursor +
|
|
107930
|
+
displayValue = beforeCursor + renderSoftwareCursor(atCursor) + afterCursor;
|
|
107807
107931
|
} else if (cursorVisible && editCursorPos >= cpLen(editBuffer)) {
|
|
107808
|
-
displayValue = editBuffer +
|
|
107932
|
+
displayValue = editBuffer + renderSoftwareCursor(" ");
|
|
107809
107933
|
} else {
|
|
107810
107934
|
displayValue = editBuffer;
|
|
107811
107935
|
}
|
|
@@ -108813,7 +108937,7 @@ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) =>
|
|
|
108813
108937
|
authStatus: "idle",
|
|
108814
108938
|
authMessage: null
|
|
108815
108939
|
});
|
|
108816
|
-
const isQwenAuth = pendingAuthType ===
|
|
108940
|
+
const isQwenAuth = pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */;
|
|
108817
108941
|
(0, import_react103.useEffect)(() => {
|
|
108818
108942
|
if (!isQwenAuth || !isAuthenticating) {
|
|
108819
108943
|
setQwenAuthState({
|
|
@@ -108972,7 +109096,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthCh
|
|
|
108972
109096
|
setAuthError(null);
|
|
108973
109097
|
}, []);
|
|
108974
109098
|
const cancelAuthentication = (0, import_react104.useCallback)(() => {
|
|
108975
|
-
if (isAuthenticating && pendingAuthType ===
|
|
109099
|
+
if (isAuthenticating && pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
108976
109100
|
cancelQwenAuth();
|
|
108977
109101
|
}
|
|
108978
109102
|
if (isAuthenticating && pendingAuthType) {
|
|
@@ -108986,11 +109110,11 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthCh
|
|
|
108986
109110
|
(0, import_react104.useEffect)(() => {
|
|
108987
109111
|
const val = process.env["QWEN_DEFAULT_AUTH_TYPE"];
|
|
108988
109112
|
const valid = [
|
|
108989
|
-
|
|
108990
|
-
|
|
108991
|
-
|
|
108992
|
-
|
|
108993
|
-
|
|
109113
|
+
"qwen-oauth" /* QWEN_OAUTH */,
|
|
109114
|
+
"openai" /* USE_OPENAI */,
|
|
109115
|
+
"anthropic" /* USE_ANTHROPIC */,
|
|
109116
|
+
"gemini" /* USE_GEMINI */,
|
|
109117
|
+
"vertex-ai" /* USE_VERTEX_AI */
|
|
108994
109118
|
];
|
|
108995
109119
|
if (val && !valid.includes(val)) {
|
|
108996
109120
|
onAuthError(
|
|
@@ -109076,7 +109200,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
109076
109200
|
const [provider, setProvider] = (0, import_react105.useState)(null);
|
|
109077
109201
|
const [visibleSteps, setVisibleSteps] = (0, import_react105.useState)([]);
|
|
109078
109202
|
const [stepIndex, setStepIndex] = (0, import_react105.useState)(0);
|
|
109079
|
-
const [protocol, setProtocol] = (0, import_react105.useState)("openai" /*
|
|
109203
|
+
const [protocol, setProtocol] = (0, import_react105.useState)("openai" /* USE_OPENAI */);
|
|
109080
109204
|
const [baseUrl, setBaseUrl] = (0, import_react105.useState)("");
|
|
109081
109205
|
const [baseUrlPlaceholder, setBaseUrlPlaceholder] = (0, import_react105.useState)("");
|
|
109082
109206
|
const [baseUrlOptionIndex, setBaseUrlOptionIndex] = (0, import_react105.useState)(0);
|
|
@@ -109147,10 +109271,9 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
109147
109271
|
}, [visibleSteps]);
|
|
109148
109272
|
const selectProtocol = (0, import_react105.useCallback)(
|
|
109149
109273
|
(selectedProtocol) => {
|
|
109150
|
-
|
|
109151
|
-
setProtocol(proto3);
|
|
109274
|
+
setProtocol(selectedProtocol);
|
|
109152
109275
|
setBaseUrl("");
|
|
109153
|
-
setBaseUrlPlaceholder(getDefaultBaseUrlForProtocol(
|
|
109276
|
+
setBaseUrlPlaceholder(getDefaultBaseUrlForProtocol(selectedProtocol));
|
|
109154
109277
|
setApiKey("");
|
|
109155
109278
|
setApiKeyError(null);
|
|
109156
109279
|
goNext();
|
|
@@ -109923,25 +110046,25 @@ function ReviewStep({ flow }) {
|
|
|
109923
110046
|
__name(ReviewStep, "ReviewStep");
|
|
109924
110047
|
var PROTOCOL_ITEMS = [
|
|
109925
110048
|
{
|
|
109926
|
-
key:
|
|
110049
|
+
key: "openai" /* USE_OPENAI */,
|
|
109927
110050
|
title: t("OpenAI-compatible"),
|
|
109928
110051
|
label: t("OpenAI-compatible"),
|
|
109929
110052
|
description: t("Standard OpenAI API format (most common)"),
|
|
109930
|
-
value:
|
|
110053
|
+
value: "openai" /* USE_OPENAI */
|
|
109931
110054
|
},
|
|
109932
110055
|
{
|
|
109933
|
-
key:
|
|
110056
|
+
key: "anthropic" /* USE_ANTHROPIC */,
|
|
109934
110057
|
title: t("Anthropic-compatible"),
|
|
109935
110058
|
label: t("Anthropic-compatible"),
|
|
109936
110059
|
description: t("Anthropic Messages API format"),
|
|
109937
|
-
value:
|
|
110060
|
+
value: "anthropic" /* USE_ANTHROPIC */
|
|
109938
110061
|
},
|
|
109939
110062
|
{
|
|
109940
|
-
key:
|
|
110063
|
+
key: "gemini" /* USE_GEMINI */,
|
|
109941
110064
|
title: t("Gemini-compatible"),
|
|
109942
110065
|
label: t("Gemini-compatible"),
|
|
109943
110066
|
description: t("Google Gemini API format"),
|
|
109944
|
-
value:
|
|
110067
|
+
value: "gemini" /* USE_GEMINI */
|
|
109945
110068
|
}
|
|
109946
110069
|
];
|
|
109947
110070
|
function ProviderSetupSteps({
|
|
@@ -111491,7 +111614,7 @@ function ModelDialog({
|
|
|
111491
111614
|
const allModels = config ? config.getAllConfiguredModels() : [];
|
|
111492
111615
|
const runtimeModels = allModels.filter((m) => m.isRuntimeModel);
|
|
111493
111616
|
const registryModels = allModels.filter(
|
|
111494
|
-
(m) => !m.isRuntimeModel && (m.authType !==
|
|
111617
|
+
(m) => !m.isRuntimeModel && (m.authType !== "qwen-oauth" /* QWEN_OAUTH */ || authType === "qwen-oauth" /* QWEN_OAUTH */) && (isFastModelMode || !m.fastOnly) && (isVoiceModelMode || !m.voiceOnly)
|
|
111495
111618
|
);
|
|
111496
111619
|
const modelsByAuthTypeMap = /* @__PURE__ */ new Map();
|
|
111497
111620
|
for (const model of registryModels) {
|
|
@@ -111501,25 +111624,17 @@ function ModelDialog({
|
|
|
111501
111624
|
}
|
|
111502
111625
|
modelsByAuthTypeMap.get(authType2).push(model);
|
|
111503
111626
|
}
|
|
111504
|
-
const
|
|
111505
|
-
|
|
111506
|
-
|
|
111507
|
-
|
|
111508
|
-
|
|
111509
|
-
|
|
111627
|
+
const authTypeOrder = [
|
|
111628
|
+
"qwen-oauth" /* QWEN_OAUTH */,
|
|
111629
|
+
"openai" /* USE_OPENAI */,
|
|
111630
|
+
"anthropic" /* USE_ANTHROPIC */,
|
|
111631
|
+
"gemini" /* USE_GEMINI */,
|
|
111632
|
+
"vertex-ai" /* USE_VERTEX_AI */
|
|
111510
111633
|
];
|
|
111511
111634
|
const availableAuthTypes = new Set(modelsByAuthTypeMap.keys());
|
|
111512
|
-
const orderedAuthTypes =
|
|
111513
|
-
|
|
111514
|
-
|
|
111515
|
-
orderedAuthTypes.push(authType2);
|
|
111516
|
-
}
|
|
111517
|
-
}
|
|
111518
|
-
for (const authType2 of availableAuthTypes) {
|
|
111519
|
-
if (!builtinAuthTypeOrder.includes(authType2)) {
|
|
111520
|
-
orderedAuthTypes.push(authType2);
|
|
111521
|
-
}
|
|
111522
|
-
}
|
|
111635
|
+
const orderedAuthTypes = authTypeOrder.filter(
|
|
111636
|
+
(t2) => availableAuthTypes.has(t2)
|
|
111637
|
+
);
|
|
111523
111638
|
const result = [];
|
|
111524
111639
|
for (const runtimeModel of runtimeModels) {
|
|
111525
111640
|
result.push({
|
|
@@ -111540,7 +111655,7 @@ function ModelDialog({
|
|
|
111540
111655
|
() => availableModelEntries.map(
|
|
111541
111656
|
({ authType: t2, model, isRuntime, snapshotId }) => {
|
|
111542
111657
|
const value = isRuntime && snapshotId ? snapshotId : buildModelSelectionKey(t2, model.id, model.baseUrl);
|
|
111543
|
-
const isQwenOAuth = t2 ===
|
|
111658
|
+
const isQwenOAuth = t2 === "qwen-oauth" /* QWEN_OAUTH */;
|
|
111544
111659
|
const title = /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Text, { children: [
|
|
111545
111660
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
111546
111661
|
Text,
|
|
@@ -111709,9 +111824,9 @@ function ModelDialog({
|
|
|
111709
111824
|
onClose();
|
|
111710
111825
|
return;
|
|
111711
111826
|
}
|
|
111712
|
-
const isQwenOAuthSelection = selected.startsWith(`${
|
|
111827
|
+
const isQwenOAuthSelection = selected.startsWith(`${"qwen-oauth" /* QWEN_OAUTH */}::`) || selected.startsWith("$runtime|") && selected.split("|")[1] === "qwen-oauth" /* QWEN_OAUTH */;
|
|
111713
111828
|
const isRuntimeOAuthSelection = selected.startsWith(
|
|
111714
|
-
`$runtime|${
|
|
111829
|
+
`$runtime|${"qwen-oauth" /* QWEN_OAUTH */}|`
|
|
111715
111830
|
);
|
|
111716
111831
|
if (isQwenOAuthSelection && !isRuntimeOAuthSelection) {
|
|
111717
111832
|
setErrorMessage(
|
|
@@ -111749,7 +111864,7 @@ function ModelDialog({
|
|
|
111749
111864
|
selectedBaseUrl = parsed.baseUrl;
|
|
111750
111865
|
}
|
|
111751
111866
|
await config.switchModel(selectedAuthType, modelId, {
|
|
111752
|
-
...selectedAuthType !== authType && selectedAuthType ===
|
|
111867
|
+
...selectedAuthType !== authType && selectedAuthType === "qwen-oauth" /* QWEN_OAUTH */ ? { requireCachedCredentials: true } : {},
|
|
111753
111868
|
baseUrl: selectedBaseUrl
|
|
111754
111869
|
});
|
|
111755
111870
|
if (!isRuntime) {
|
|
@@ -111840,7 +111955,7 @@ ${baseErrorMessage}`);
|
|
|
111840
111955
|
borderColor: theme.border.default
|
|
111841
111956
|
}
|
|
111842
111957
|
),
|
|
111843
|
-
highlightedEntry.authType ===
|
|
111958
|
+
highlightedEntry.authType === "qwen-oauth" /* QWEN_OAUTH */ && !highlightedEntry.isRuntime && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Text, { color: theme.status.warning, children: [
|
|
111844
111959
|
"\u26A0 ",
|
|
111845
111960
|
t("Discontinued \u2014 switch to Coding Plan or API Key")
|
|
111846
111961
|
] }) }),
|
|
@@ -111860,7 +111975,7 @@ ${baseErrorMessage}`);
|
|
|
111860
111975
|
)
|
|
111861
111976
|
}
|
|
111862
111977
|
),
|
|
111863
|
-
highlightedEntry.authType !==
|
|
111978
|
+
highlightedEntry.authType !== "qwen-oauth" /* QWEN_OAUTH */ && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
111864
111979
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
111865
111980
|
DetailRow2,
|
|
111866
111981
|
{
|
|
@@ -111905,7 +112020,7 @@ function ArenaStartDialog({
|
|
|
111905
112020
|
const selectableModels = allModels.filter((model) => !model.isRuntimeModel);
|
|
111906
112021
|
return selectableModels.map((model) => {
|
|
111907
112022
|
const token = `${model.authType}:${model.id}`;
|
|
111908
|
-
const isQwenOauth = model.authType ===
|
|
112023
|
+
const isQwenOauth = model.authType === "qwen-oauth" /* QWEN_OAUTH */;
|
|
111909
112024
|
return {
|
|
111910
112025
|
key: token,
|
|
111911
112026
|
value: token,
|
|
@@ -117735,10 +117850,7 @@ function UninstallConfirmStep({
|
|
|
117735
117850
|
}
|
|
117736
117851
|
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
117737
117852
|
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Text, { color: theme.status.error, children: t('Are you sure you want to uninstall extension "{{name}}"?', {
|
|
117738
|
-
name: getExtensionDisplayName(
|
|
117739
|
-
selectedExtension,
|
|
117740
|
-
getCurrentLanguage()
|
|
117741
|
-
)
|
|
117853
|
+
name: getExtensionDisplayName(selectedExtension, getCurrentLanguage())
|
|
117742
117854
|
}) }),
|
|
117743
117855
|
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Text, { color: theme.status.error, children: t("Note: Uninstall permanently removes this extension.") })
|
|
117744
117856
|
] });
|
|
@@ -126411,7 +126523,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
126411
126523
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(AuthDialog, {}) });
|
|
126412
126524
|
}
|
|
126413
126525
|
if (uiState.auth.isAuthenticating) {
|
|
126414
|
-
if (uiState.auth.pendingAuthType ===
|
|
126526
|
+
if (uiState.auth.pendingAuthType === "openai" /* USE_OPENAI */ && uiState.auth.externalAuthState) {
|
|
126415
126527
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
126416
126528
|
ExternalAuthProgress,
|
|
126417
126529
|
{
|
|
@@ -126425,7 +126537,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
126425
126537
|
}
|
|
126426
126538
|
);
|
|
126427
126539
|
}
|
|
126428
|
-
if (uiState.auth.pendingAuthType ===
|
|
126540
|
+
if (uiState.auth.pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
126429
126541
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
126430
126542
|
QwenOAuthProgress,
|
|
126431
126543
|
{
|
|
@@ -126974,9 +127086,6 @@ function useInputHistory({
|
|
|
126974
127086
|
}
|
|
126975
127087
|
__name(useInputHistory, "useInputHistory");
|
|
126976
127088
|
|
|
126977
|
-
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
126978
|
-
var import_chalk10 = __toESM(require_source(), 1);
|
|
126979
|
-
|
|
126980
127089
|
// packages/cli/src/ui/hooks/useShellHistory.ts
|
|
126981
127090
|
init_esbuild_shims();
|
|
126982
127091
|
var import_react162 = __toESM(require_react(), 1);
|
|
@@ -127324,23 +127433,56 @@ function getMcpResourceSuggestions(config, pattern) {
|
|
|
127324
127433
|
const match = matchMcpServerPrefix(pattern, Object.keys(mcpServers));
|
|
127325
127434
|
if (!match) return null;
|
|
127326
127435
|
const serverName = match.serverName;
|
|
127327
|
-
const
|
|
127436
|
+
const query = match.rest.toLowerCase();
|
|
127437
|
+
const rankOf = /* @__PURE__ */ __name((uri, friendly) => {
|
|
127438
|
+
if (uri.startsWith(query)) return 0;
|
|
127439
|
+
if (friendly.startsWith(query)) return 1;
|
|
127440
|
+
if (uri.includes(query)) return 2;
|
|
127441
|
+
if (friendly.includes(query)) return 3;
|
|
127442
|
+
return Infinity;
|
|
127443
|
+
}, "rankOf");
|
|
127328
127444
|
const resources = config.getResourceRegistry?.()?.getResourcesByServer(serverName) ?? [];
|
|
127329
|
-
const matches = resources.
|
|
127330
|
-
const
|
|
127331
|
-
|
|
127332
|
-
|
|
127333
|
-
|
|
127334
|
-
|
|
127335
|
-
|
|
127445
|
+
const matches = resources.map((resource) => {
|
|
127446
|
+
const friendly = resource.title || resource.name || "";
|
|
127447
|
+
return {
|
|
127448
|
+
resource,
|
|
127449
|
+
friendly,
|
|
127450
|
+
rank: rankOf(resource.uri.toLowerCase(), friendly.toLowerCase())
|
|
127451
|
+
};
|
|
127452
|
+
}).filter((m) => m.rank !== Infinity).sort(
|
|
127453
|
+
(a, b) => a.rank - b.rank || a.resource.uri.localeCompare(b.resource.uri)
|
|
127454
|
+
);
|
|
127455
|
+
return matches.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3).map((m) => {
|
|
127456
|
+
const ref = buildMcpResourceRef(serverName, m.resource.uri);
|
|
127336
127457
|
return {
|
|
127337
127458
|
label: ref,
|
|
127338
127459
|
value: ref,
|
|
127460
|
+
// Only surface the friendly name when it adds information beyond the URI
|
|
127461
|
+
// (mirrors the `/mcp` resource list, which dims a redundant name).
|
|
127462
|
+
description: m.friendly && m.friendly !== m.resource.uri ? m.friendly : void 0,
|
|
127339
127463
|
isDirectory: false
|
|
127340
127464
|
};
|
|
127341
127465
|
});
|
|
127342
127466
|
}
|
|
127343
127467
|
__name(getMcpResourceSuggestions, "getMcpResourceSuggestions");
|
|
127468
|
+
function getMcpServerSuggestions(config, pattern) {
|
|
127469
|
+
if (!config) return [];
|
|
127470
|
+
if (config.isTrustedFolder?.() === false) return [];
|
|
127471
|
+
if (pattern.length === 0) return [];
|
|
127472
|
+
const registry2 = config.getResourceRegistry?.();
|
|
127473
|
+
if (!registry2) return [];
|
|
127474
|
+
const mcpServers = config.getMcpServers?.() || {};
|
|
127475
|
+
const query = pattern.toLowerCase();
|
|
127476
|
+
return Object.keys(mcpServers).filter(
|
|
127477
|
+
(name) => name.toLowerCase().startsWith(query) && (registry2.getResourcesByServer(name)?.length ?? 0) > 0
|
|
127478
|
+
).sort((a, b) => a.localeCompare(b)).map((name) => ({
|
|
127479
|
+
label: `${name}:`,
|
|
127480
|
+
value: `${name}:`,
|
|
127481
|
+
description: t("MCP resource server"),
|
|
127482
|
+
isDirectory: true
|
|
127483
|
+
}));
|
|
127484
|
+
}
|
|
127485
|
+
__name(getMcpServerSuggestions, "getMcpServerSuggestions");
|
|
127344
127486
|
var initialState = {
|
|
127345
127487
|
status: "idle" /* IDLE */,
|
|
127346
127488
|
suggestions: [],
|
|
@@ -127482,7 +127624,14 @@ function useAtCompletion(props) {
|
|
|
127482
127624
|
dispatch({ type: "SEARCH_SUCCESS", payload: resourceSuggestions });
|
|
127483
127625
|
return;
|
|
127484
127626
|
}
|
|
127627
|
+
const serverSuggestions = getMcpServerSuggestions(config, state2.pattern);
|
|
127485
127628
|
if (!fileSearch.current) {
|
|
127629
|
+
if (serverSuggestions.length > 0) {
|
|
127630
|
+
if (slowSearchTimer.current) {
|
|
127631
|
+
clearTimeout(slowSearchTimer.current);
|
|
127632
|
+
}
|
|
127633
|
+
dispatch({ type: "SEARCH_SUCCESS", payload: serverSuggestions });
|
|
127634
|
+
}
|
|
127486
127635
|
return;
|
|
127487
127636
|
}
|
|
127488
127637
|
if (slowSearchTimer.current) {
|
|
@@ -127504,15 +127653,22 @@ function useAtCompletion(props) {
|
|
|
127504
127653
|
if (controller.signal.aborted) {
|
|
127505
127654
|
return;
|
|
127506
127655
|
}
|
|
127507
|
-
const
|
|
127656
|
+
const fileSuggestions = results.map((p) => ({
|
|
127508
127657
|
label: p,
|
|
127509
127658
|
value: escapePath(p),
|
|
127510
127659
|
isDirectory: p.endsWith("/")
|
|
127511
127660
|
}));
|
|
127512
|
-
dispatch({
|
|
127661
|
+
dispatch({
|
|
127662
|
+
type: "SEARCH_SUCCESS",
|
|
127663
|
+
payload: [...serverSuggestions, ...fileSuggestions]
|
|
127664
|
+
});
|
|
127513
127665
|
} catch (error) {
|
|
127514
127666
|
if (!(error instanceof Error && error.name === "AbortError")) {
|
|
127515
|
-
|
|
127667
|
+
if (serverSuggestions.length > 0) {
|
|
127668
|
+
dispatch({ type: "SEARCH_SUCCESS", payload: serverSuggestions });
|
|
127669
|
+
} else {
|
|
127670
|
+
dispatch({ type: "ERROR" });
|
|
127671
|
+
}
|
|
127516
127672
|
}
|
|
127517
127673
|
}
|
|
127518
127674
|
}, "search");
|
|
@@ -129122,7 +129278,6 @@ var FeedbackDialog = /* @__PURE__ */ __name(() => {
|
|
|
129122
129278
|
// packages/cli/src/ui/components/BaseTextInput.tsx
|
|
129123
129279
|
init_esbuild_shims();
|
|
129124
129280
|
var import_react174 = __toESM(require_react(), 1);
|
|
129125
|
-
var import_chalk9 = __toESM(require_source(), 1);
|
|
129126
129281
|
var import_jsx_runtime159 = __toESM(require_jsx_runtime(), 1);
|
|
129127
129282
|
function defaultRenderLine({
|
|
129128
129283
|
lineText,
|
|
@@ -129137,7 +129292,7 @@ function defaultRenderLine({
|
|
|
129137
129292
|
if (cursorCol >= len) {
|
|
129138
129293
|
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Text, { children: [
|
|
129139
129294
|
lineText,
|
|
129140
|
-
|
|
129295
|
+
renderSoftwareCursor(" ") + "\u200B"
|
|
129141
129296
|
] });
|
|
129142
129297
|
}
|
|
129143
129298
|
const before = cpSlice(lineText, 0, cursorCol);
|
|
@@ -129145,7 +129300,7 @@ function defaultRenderLine({
|
|
|
129145
129300
|
const after = cpSlice(lineText, cursorCol + 1);
|
|
129146
129301
|
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Text, { children: [
|
|
129147
129302
|
before,
|
|
129148
|
-
|
|
129303
|
+
renderSoftwareCursor(cursorChar),
|
|
129149
129304
|
after
|
|
129150
129305
|
] });
|
|
129151
129306
|
}
|
|
@@ -129327,9 +129482,9 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
129327
129482
|
{
|
|
129328
129483
|
flexGrow: 1,
|
|
129329
129484
|
flexDirection: "column",
|
|
129330
|
-
backgroundColor:
|
|
129485
|
+
backgroundColor: getInputBackgroundFill(),
|
|
129331
129486
|
children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Text, { children: [
|
|
129332
|
-
|
|
129487
|
+
renderSoftwareCursor(placeholder.slice(0, 1)),
|
|
129333
129488
|
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Text, { color: theme.text.secondary, children: placeholder.slice(1) })
|
|
129334
129489
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Text, { color: theme.text.secondary, children: placeholder }) : linesToRender.map((lineText, idx) => {
|
|
129335
129490
|
const absoluteVisualIndex = scrollVisualRow + idx;
|
|
@@ -132385,7 +132540,7 @@ ${currentText}`);
|
|
|
132385
132540
|
cursorVisualColAbsolute - segStart,
|
|
132386
132541
|
cursorVisualColAbsolute - segStart + 1
|
|
132387
132542
|
);
|
|
132388
|
-
const highlighted = showCursorOpt ?
|
|
132543
|
+
const highlighted = showCursorOpt ? renderSoftwareCursor(charToHighlight) : charToHighlight;
|
|
132389
132544
|
display = cpSlice(seg.text, 0, cursorVisualColAbsolute - segStart) + highlighted + cpSlice(seg.text, cursorVisualColAbsolute - segStart + 1);
|
|
132390
132545
|
}
|
|
132391
132546
|
charCount = segEnd;
|
|
@@ -132400,7 +132555,7 @@ ${currentText}`);
|
|
|
132400
132555
|
if (ghostText && showCursorOpt && ghostText.text.length > 0) {
|
|
132401
132556
|
if (ghostText.showCursorBeforeText) {
|
|
132402
132557
|
renderedLine.push(
|
|
132403
|
-
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children:
|
|
132558
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: renderSoftwareCursor(" ") }, "ghost-cursor")
|
|
132404
132559
|
);
|
|
132405
132560
|
renderedLine.push(
|
|
132406
132561
|
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { color: theme.text.secondary, children: ghostText.text }, "ghost-rest")
|
|
@@ -132409,7 +132564,7 @@ ${currentText}`);
|
|
|
132409
132564
|
const firstChar = ghostText.text[0];
|
|
132410
132565
|
const rest = ghostText.text.slice(firstChar.length);
|
|
132411
132566
|
renderedLine.push(
|
|
132412
|
-
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children:
|
|
132567
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: renderSoftwareCursor(firstChar) }, "ghost-cursor")
|
|
132413
132568
|
);
|
|
132414
132569
|
if (rest.length > 0) {
|
|
132415
132570
|
renderedLine.push(
|
|
@@ -132420,7 +132575,7 @@ ${currentText}`);
|
|
|
132420
132575
|
renderedLine.push(/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: `\u200B` }, "ghost-zwsp"));
|
|
132421
132576
|
} else {
|
|
132422
132577
|
renderedLine.push(
|
|
132423
|
-
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: showCursorOpt ?
|
|
132578
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: showCursorOpt ? renderSoftwareCursor(" ") + "\u200B" : " \u200B" }, `cursor-end-${cursorVisualColAbsolute}`)
|
|
132424
132579
|
);
|
|
132425
132580
|
}
|
|
132426
132581
|
}
|
|
@@ -143033,10 +143188,10 @@ var applyOptions2 = /* @__PURE__ */ __name((object, options = {}) => {
|
|
|
143033
143188
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
143034
143189
|
}, "applyOptions");
|
|
143035
143190
|
var chalkFactory2 = /* @__PURE__ */ __name((options) => {
|
|
143036
|
-
const
|
|
143037
|
-
applyOptions2(
|
|
143038
|
-
Object.setPrototypeOf(
|
|
143039
|
-
return
|
|
143191
|
+
const chalk6 = /* @__PURE__ */ __name((...strings) => strings.join(" "), "chalk");
|
|
143192
|
+
applyOptions2(chalk6, options);
|
|
143193
|
+
Object.setPrototypeOf(chalk6, createChalk2.prototype);
|
|
143194
|
+
return chalk6;
|
|
143040
143195
|
}, "chalkFactory");
|
|
143041
143196
|
function createChalk2(options) {
|
|
143042
143197
|
return chalkFactory2(options);
|
|
@@ -143157,9 +143312,9 @@ var applyStyle2 = /* @__PURE__ */ __name((self2, string) => {
|
|
|
143157
143312
|
return openAll + string + closeAll;
|
|
143158
143313
|
}, "applyStyle");
|
|
143159
143314
|
Object.defineProperties(createChalk2.prototype, styles8);
|
|
143160
|
-
var
|
|
143315
|
+
var chalk5 = createChalk2();
|
|
143161
143316
|
var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
|
|
143162
|
-
var source_default2 =
|
|
143317
|
+
var source_default2 = chalk5;
|
|
143163
143318
|
|
|
143164
143319
|
// node_modules/update-notifier/update-notifier.js
|
|
143165
143320
|
var import_diff3 = __toESM(require_diff(), 1);
|
|
@@ -151309,7 +151464,7 @@ init_esbuild_shims();
|
|
|
151309
151464
|
function buildAuthMethods() {
|
|
151310
151465
|
return [
|
|
151311
151466
|
{
|
|
151312
|
-
id:
|
|
151467
|
+
id: "openai" /* USE_OPENAI */,
|
|
151313
151468
|
name: "Use OpenAI API key",
|
|
151314
151469
|
description: "Requires setting the `OPENAI_API_KEY` environment variable",
|
|
151315
151470
|
_meta: {
|
|
@@ -151384,7 +151539,7 @@ var AcpFileSystemService = class {
|
|
|
151384
151539
|
if (!this.capabilities.writeTextFile) {
|
|
151385
151540
|
return this.fallback.writeTextFile(params);
|
|
151386
151541
|
}
|
|
151387
|
-
const finalContent = params._meta?.["bom"] ? "\uFEFF" + params.content : params.content;
|
|
151542
|
+
const finalContent = params._meta?.["bom"] && params.content.charCodeAt(0) !== 65279 ? "\uFEFF" + params.content : params.content;
|
|
151388
151543
|
await this.connection.writeTextFile({
|
|
151389
151544
|
...params,
|
|
151390
151545
|
content: finalContent,
|
|
@@ -154184,7 +154339,7 @@ ${this.pendingWorktreeNotice}
|
|
|
154184
154339
|
await this.config.switchModel(
|
|
154185
154340
|
selectedAuthType,
|
|
154186
154341
|
parsed.modelId,
|
|
154187
|
-
selectedAuthType !== previousAuthType && selectedAuthType ===
|
|
154342
|
+
selectedAuthType !== previousAuthType && selectedAuthType === "qwen-oauth" /* QWEN_OAUTH */ ? { requireCachedCredentials: true } : void 0
|
|
154188
154343
|
);
|
|
154189
154344
|
const after = this.config.getContentGeneratorConfig?.();
|
|
154190
154345
|
const effectiveAuthType = after?.authType ?? selectedAuthType;
|
|
@@ -156274,10 +156429,8 @@ function readProviderModels(settings, protocol) {
|
|
|
156274
156429
|
const modelProviders = toRecord(
|
|
156275
156430
|
settings.merged["modelProviders"]
|
|
156276
156431
|
);
|
|
156277
|
-
const
|
|
156278
|
-
|
|
156279
|
-
const models = Array.isArray(entry) ? entry : Array.isArray(entryRecord?.["models"]) ? entryRecord["models"] : [];
|
|
156280
|
-
return models.filter(isProviderModelConfig);
|
|
156432
|
+
const models = modelProviders[protocol];
|
|
156433
|
+
return Array.isArray(models) ? models.filter(isProviderModelConfig) : [];
|
|
156281
156434
|
}
|
|
156282
156435
|
__name(readProviderModels, "readProviderModels");
|
|
156283
156436
|
function findExistingProviderModels(config, settings) {
|
|
@@ -157063,6 +157216,19 @@ function normalizeAcpSessionListSize(value) {
|
|
|
157063
157216
|
return Math.min(Math.max(value, 1), MAX_ACP_SESSION_PAGE_SIZE);
|
|
157064
157217
|
}
|
|
157065
157218
|
__name(normalizeAcpSessionListSize, "normalizeAcpSessionListSize");
|
|
157219
|
+
function parseAcpSessionListCursor(value) {
|
|
157220
|
+
if (value == null || value === "") return void 0;
|
|
157221
|
+
const trimmed = value.trim();
|
|
157222
|
+
const parsedCursor = Number(trimmed);
|
|
157223
|
+
if (trimmed === "" || !Number.isFinite(parsedCursor) || parsedCursor < 0 || parsedCursor > Number.MAX_SAFE_INTEGER) {
|
|
157224
|
+
throw RequestError.invalidParams(
|
|
157225
|
+
void 0,
|
|
157226
|
+
`Invalid cursor: "${value}" is not a valid numeric cursor`
|
|
157227
|
+
);
|
|
157228
|
+
}
|
|
157229
|
+
return parsedCursor;
|
|
157230
|
+
}
|
|
157231
|
+
__name(parseAcpSessionListCursor, "parseAcpSessionListCursor");
|
|
157066
157232
|
var QwenAgent = class {
|
|
157067
157233
|
constructor(config, settings, argv, connection) {
|
|
157068
157234
|
this.config = config;
|
|
@@ -157196,7 +157362,7 @@ var QwenAgent = class {
|
|
|
157196
157362
|
async initialize(args) {
|
|
157197
157363
|
this.clientCapabilities = args.clientCapabilities;
|
|
157198
157364
|
const authMethods = buildAuthMethods();
|
|
157199
|
-
const version = "0.19.
|
|
157365
|
+
const version = "0.19.1";
|
|
157200
157366
|
return {
|
|
157201
157367
|
protocolVersion: PROTOCOL_VERSION,
|
|
157202
157368
|
agentInfo: {
|
|
@@ -157224,7 +157390,7 @@ var QwenAgent = class {
|
|
|
157224
157390
|
};
|
|
157225
157391
|
}
|
|
157226
157392
|
async authenticate({ methodId }) {
|
|
157227
|
-
const method = methodId;
|
|
157393
|
+
const method = external_exports.nativeEnum(AuthType).parse(methodId);
|
|
157228
157394
|
let authUri;
|
|
157229
157395
|
const authUriHandler = /* @__PURE__ */ __name((deviceAuth) => {
|
|
157230
157396
|
authUri = deviceAuth.verification_uri_complete;
|
|
@@ -157232,7 +157398,7 @@ var QwenAgent = class {
|
|
|
157232
157398
|
_meta: { authUri }
|
|
157233
157399
|
});
|
|
157234
157400
|
}, "authUriHandler");
|
|
157235
|
-
if (method ===
|
|
157401
|
+
if (method === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
157236
157402
|
qwenOAuth2Events.once("auth-uri" /* AuthUri */, authUriHandler);
|
|
157237
157403
|
}
|
|
157238
157404
|
await clearCachedCredentialFile();
|
|
@@ -157244,7 +157410,7 @@ var QwenAgent = class {
|
|
|
157244
157410
|
method
|
|
157245
157411
|
);
|
|
157246
157412
|
} finally {
|
|
157247
|
-
if (method ===
|
|
157413
|
+
if (method === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
157248
157414
|
qwenOAuth2Events.off("auth-uri" /* AuthUri */, authUriHandler);
|
|
157249
157415
|
}
|
|
157250
157416
|
}
|
|
@@ -157356,17 +157522,7 @@ var QwenAgent = class {
|
|
|
157356
157522
|
}
|
|
157357
157523
|
async unstable_listSessions(params) {
|
|
157358
157524
|
const cwd5 = params.cwd || process.cwd();
|
|
157359
|
-
|
|
157360
|
-
if (params.cursor != null && params.cursor !== "") {
|
|
157361
|
-
const parsedCursor = Number(params.cursor);
|
|
157362
|
-
if (!Number.isFinite(parsedCursor)) {
|
|
157363
|
-
throw RequestError.invalidParams(
|
|
157364
|
-
void 0,
|
|
157365
|
-
`Invalid cursor: "${params.cursor}" is not a valid numeric cursor`
|
|
157366
|
-
);
|
|
157367
|
-
}
|
|
157368
|
-
numericCursor = parsedCursor;
|
|
157369
|
-
}
|
|
157525
|
+
const numericCursor = parseAcpSessionListCursor(params.cursor);
|
|
157370
157526
|
const size = normalizeAcpSessionListSize(params._meta?.["size"]);
|
|
157371
157527
|
const result = await runWithAcpRuntimeOutputDir(this.settings, cwd5, () => {
|
|
157372
157528
|
const sessionService = new SessionService(cwd5);
|
|
@@ -161449,7 +161605,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
161449
161605
|
process.exit(0);
|
|
161450
161606
|
}
|
|
161451
161607
|
if (config.isInteractive()) {
|
|
161452
|
-
void import("./chunks/scheduler-
|
|
161608
|
+
void import("./chunks/scheduler-FMNCHQQH.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
|
|
161453
161609
|
debugLogger92.warn("failed to start background housekeeping:", err);
|
|
161454
161610
|
});
|
|
161455
161611
|
}
|
|
@@ -161464,7 +161620,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
161464
161620
|
}),
|
|
161465
161621
|
...getSettingsWarnings(settings),
|
|
161466
161622
|
...config.getWarnings(),
|
|
161467
|
-
...config.getModelsConfig().getCurrentAuthType() ===
|
|
161623
|
+
...config.getModelsConfig().getCurrentAuthType() === "qwen-oauth" /* QWEN_OAUTH */ ? [
|
|
161468
161624
|
"Qwen OAuth free tier was discontinued on 2026-04-15. Run /auth to switch to Coding Plan or another provider."
|
|
161469
161625
|
] : []
|
|
161470
161626
|
])
|