@qwen-code/qwen-code 0.10.0-preview.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +19 -158
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -71639,17 +71639,6 @@ var init_tools = __esm({
|
|
|
71639
71639
|
});
|
|
71640
71640
|
|
|
71641
71641
|
// packages/core/dist/src/tools/mcp-tool.js
|
|
71642
|
-
function wrapMcpCallToolResultAsParts(toolName, result) {
|
|
71643
|
-
const response = result.isError ? { error: result, content: result.content } : result;
|
|
71644
|
-
return [
|
|
71645
|
-
{
|
|
71646
|
-
functionResponse: {
|
|
71647
|
-
name: toolName,
|
|
71648
|
-
response
|
|
71649
|
-
}
|
|
71650
|
-
}
|
|
71651
|
-
];
|
|
71652
|
-
}
|
|
71653
71642
|
function transformTextBlock(block2) {
|
|
71654
71643
|
return { text: block2.text };
|
|
71655
71644
|
}
|
|
@@ -71767,10 +71756,8 @@ var init_mcp_tool = __esm({
|
|
|
71767
71756
|
displayName;
|
|
71768
71757
|
trust;
|
|
71769
71758
|
cliConfig;
|
|
71770
|
-
mcpClient;
|
|
71771
|
-
mcpTimeout;
|
|
71772
71759
|
static allowlist = /* @__PURE__ */ new Set();
|
|
71773
|
-
constructor(mcpTool, serverName, serverToolName, displayName, trust, params = {}, cliConfig
|
|
71760
|
+
constructor(mcpTool, serverName, serverToolName, displayName, trust, params = {}, cliConfig) {
|
|
71774
71761
|
super(params);
|
|
71775
71762
|
this.mcpTool = mcpTool;
|
|
71776
71763
|
this.serverName = serverName;
|
|
@@ -71778,8 +71765,6 @@ var init_mcp_tool = __esm({
|
|
|
71778
71765
|
this.displayName = displayName;
|
|
71779
71766
|
this.trust = trust;
|
|
71780
71767
|
this.cliConfig = cliConfig;
|
|
71781
|
-
this.mcpClient = mcpClient;
|
|
71782
|
-
this.mcpTimeout = mcpTimeout;
|
|
71783
71768
|
}
|
|
71784
71769
|
async shouldConfirmExecute(_abortSignal) {
|
|
71785
71770
|
const serverAllowListKey = this.serverName;
|
|
@@ -71823,63 +71808,7 @@ var init_mcp_tool = __esm({
|
|
|
71823
71808
|
}
|
|
71824
71809
|
return false;
|
|
71825
71810
|
}
|
|
71826
|
-
async execute(signal
|
|
71827
|
-
if (this.mcpClient) {
|
|
71828
|
-
return this.executeWithDirectClient(signal, updateOutput2);
|
|
71829
|
-
}
|
|
71830
|
-
return this.executeWithCallableTool(signal);
|
|
71831
|
-
}
|
|
71832
|
-
/**
|
|
71833
|
-
* Execute using the raw MCP SDK Client, which supports progress
|
|
71834
|
-
* notifications via the onprogress callback. This enables real-time
|
|
71835
|
-
* streaming of progress updates to the user during long-running
|
|
71836
|
-
* MCP tool calls (e.g., browser automation).
|
|
71837
|
-
*/
|
|
71838
|
-
async executeWithDirectClient(signal, updateOutput2) {
|
|
71839
|
-
const callToolResult = await this.mcpClient.callTool({
|
|
71840
|
-
name: this.serverToolName,
|
|
71841
|
-
arguments: this.params
|
|
71842
|
-
}, void 0, {
|
|
71843
|
-
onprogress: /* @__PURE__ */ __name((progress) => {
|
|
71844
|
-
if (updateOutput2) {
|
|
71845
|
-
const progressData = {
|
|
71846
|
-
type: "mcp_tool_progress",
|
|
71847
|
-
progress: progress.progress,
|
|
71848
|
-
...progress.total != null && { total: progress.total },
|
|
71849
|
-
...progress.message != null && { message: progress.message }
|
|
71850
|
-
};
|
|
71851
|
-
updateOutput2(progressData);
|
|
71852
|
-
}
|
|
71853
|
-
}, "onprogress"),
|
|
71854
|
-
timeout: this.mcpTimeout,
|
|
71855
|
-
signal
|
|
71856
|
-
});
|
|
71857
|
-
const rawResponseParts = wrapMcpCallToolResultAsParts(this.serverToolName, callToolResult);
|
|
71858
|
-
if (this.isMCPToolError(rawResponseParts)) {
|
|
71859
|
-
const errorMessage = `MCP tool '${this.serverToolName}' reported tool error for function call: ${safeJsonStringify({
|
|
71860
|
-
name: this.serverToolName,
|
|
71861
|
-
args: this.params
|
|
71862
|
-
})} with response: ${safeJsonStringify(rawResponseParts)}`;
|
|
71863
|
-
return {
|
|
71864
|
-
llmContent: errorMessage,
|
|
71865
|
-
returnDisplay: `Error: MCP tool '${this.serverToolName}' reported an error.`,
|
|
71866
|
-
error: {
|
|
71867
|
-
message: errorMessage,
|
|
71868
|
-
type: ToolErrorType.MCP_TOOL_ERROR
|
|
71869
|
-
}
|
|
71870
|
-
};
|
|
71871
|
-
}
|
|
71872
|
-
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
71873
|
-
return {
|
|
71874
|
-
llmContent: transformedParts,
|
|
71875
|
-
returnDisplay: getStringifiedResultForDisplay(rawResponseParts)
|
|
71876
|
-
};
|
|
71877
|
-
}
|
|
71878
|
-
/**
|
|
71879
|
-
* Fallback: execute using the @google/genai CallableTool wrapper.
|
|
71880
|
-
* This path does NOT support progress notifications.
|
|
71881
|
-
*/
|
|
71882
|
-
async executeWithCallableTool(signal) {
|
|
71811
|
+
async execute(signal) {
|
|
71883
71812
|
const functionCalls = [
|
|
71884
71813
|
{
|
|
71885
71814
|
name: this.serverToolName,
|
|
@@ -71942,9 +71871,7 @@ var init_mcp_tool = __esm({
|
|
|
71942
71871
|
parameterSchema;
|
|
71943
71872
|
trust;
|
|
71944
71873
|
cliConfig;
|
|
71945
|
-
|
|
71946
|
-
mcpTimeout;
|
|
71947
|
-
constructor(mcpTool, serverName, serverToolName, description, parameterSchema, trust, nameOverride, cliConfig, mcpClient, mcpTimeout) {
|
|
71874
|
+
constructor(mcpTool, serverName, serverToolName, description, parameterSchema, trust, nameOverride, cliConfig) {
|
|
71948
71875
|
super(
|
|
71949
71876
|
nameOverride ?? generateValidName(`mcp__${serverName}__${serverToolName}`),
|
|
71950
71877
|
`${serverToolName} (${serverName} MCP Server)`,
|
|
@@ -71953,7 +71880,7 @@ var init_mcp_tool = __esm({
|
|
|
71953
71880
|
parameterSchema,
|
|
71954
71881
|
true,
|
|
71955
71882
|
// isOutputMarkdown
|
|
71956
|
-
|
|
71883
|
+
false
|
|
71957
71884
|
);
|
|
71958
71885
|
this.mcpTool = mcpTool;
|
|
71959
71886
|
this.serverName = serverName;
|
|
@@ -71961,17 +71888,14 @@ var init_mcp_tool = __esm({
|
|
|
71961
71888
|
this.parameterSchema = parameterSchema;
|
|
71962
71889
|
this.trust = trust;
|
|
71963
71890
|
this.cliConfig = cliConfig;
|
|
71964
|
-
this.mcpClient = mcpClient;
|
|
71965
|
-
this.mcpTimeout = mcpTimeout;
|
|
71966
71891
|
}
|
|
71967
71892
|
asFullyQualifiedTool() {
|
|
71968
|
-
return new _DiscoveredMCPTool(this.mcpTool, this.serverName, this.serverToolName, this.description, this.parameterSchema, this.trust, generateValidName(`mcp__${this.serverName}__${this.serverToolName}`), this.cliConfig
|
|
71893
|
+
return new _DiscoveredMCPTool(this.mcpTool, this.serverName, this.serverToolName, this.description, this.parameterSchema, this.trust, generateValidName(`mcp__${this.serverName}__${this.serverToolName}`), this.cliConfig);
|
|
71969
71894
|
}
|
|
71970
71895
|
createInvocation(params) {
|
|
71971
|
-
return new DiscoveredMCPToolInvocation(this.mcpTool, this.serverName, this.serverToolName, this.displayName, this.trust, params, this.cliConfig
|
|
71896
|
+
return new DiscoveredMCPToolInvocation(this.mcpTool, this.serverName, this.serverToolName, this.displayName, this.trust, params, this.cliConfig);
|
|
71972
71897
|
}
|
|
71973
71898
|
};
|
|
71974
|
-
__name(wrapMcpCallToolResultAsParts, "wrapMcpCallToolResultAsParts");
|
|
71975
71899
|
__name(transformTextBlock, "transformTextBlock");
|
|
71976
71900
|
__name(transformImageAudioBlock, "transformImageAudioBlock");
|
|
71977
71901
|
__name(transformResourceBlock, "transformResourceBlock");
|
|
@@ -156388,7 +156312,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
156388
156312
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
156389
156313
|
});
|
|
156390
156314
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
156391
|
-
const version2 = "0.10.0
|
|
156315
|
+
const version2 = "0.10.0";
|
|
156392
156316
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
156393
156317
|
const baseHeaders = {
|
|
156394
156318
|
"User-Agent": userAgent2
|
|
@@ -210595,26 +210519,13 @@ async function discoverTools(mcpServerName, mcpServerConfig, mcpClient, cliConfi
|
|
|
210595
210519
|
if (!Array.isArray(tool.functionDeclarations)) {
|
|
210596
210520
|
return [];
|
|
210597
210521
|
}
|
|
210598
|
-
const mcpTimeout = mcpServerConfig.timeout ?? MCP_DEFAULT_TIMEOUT_MSEC;
|
|
210599
210522
|
const discoveredTools = [];
|
|
210600
210523
|
for (const funcDecl of tool.functionDeclarations) {
|
|
210601
210524
|
try {
|
|
210602
210525
|
if (!isEnabled(funcDecl, mcpServerName, mcpServerConfig)) {
|
|
210603
210526
|
continue;
|
|
210604
210527
|
}
|
|
210605
|
-
discoveredTools.push(new DiscoveredMCPTool(
|
|
210606
|
-
mcpCallableTool,
|
|
210607
|
-
mcpServerName,
|
|
210608
|
-
funcDecl.name,
|
|
210609
|
-
funcDecl.description ?? "",
|
|
210610
|
-
funcDecl.parametersJsonSchema ?? { type: "object", properties: {} },
|
|
210611
|
-
mcpServerConfig.trust,
|
|
210612
|
-
void 0,
|
|
210613
|
-
cliConfig,
|
|
210614
|
-
mcpClient,
|
|
210615
|
-
// raw MCP Client for direct callTool with progress
|
|
210616
|
-
mcpTimeout
|
|
210617
|
-
));
|
|
210528
|
+
discoveredTools.push(new DiscoveredMCPTool(mcpCallableTool, mcpServerName, funcDecl.name, funcDecl.description ?? "", funcDecl.parametersJsonSchema ?? { type: "object", properties: {} }, mcpServerConfig.trust, void 0, cliConfig));
|
|
210618
210529
|
} catch (error2) {
|
|
210619
210530
|
debugLogger49.error(`Error discovering tool: '${funcDecl.name}' from MCP server '${mcpServerName}': ${error2.message}`);
|
|
210620
210531
|
}
|
|
@@ -373111,7 +373022,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
373111
373022
|
// packages/cli/src/utils/version.ts
|
|
373112
373023
|
async function getCliVersion() {
|
|
373113
373024
|
const pkgJson = await getPackageJson();
|
|
373114
|
-
return "0.10.0
|
|
373025
|
+
return "0.10.0";
|
|
373115
373026
|
}
|
|
373116
373027
|
__name(getCliVersion, "getCliVersion");
|
|
373117
373028
|
|
|
@@ -380634,7 +380545,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
380634
380545
|
|
|
380635
380546
|
// packages/cli/src/generated/git-commit.ts
|
|
380636
380547
|
init_esbuild_shims();
|
|
380637
|
-
var GIT_COMMIT_INFO = "
|
|
380548
|
+
var GIT_COMMIT_INFO = "9bccd497";
|
|
380638
380549
|
|
|
380639
380550
|
// packages/cli/src/utils/systemInfo.ts
|
|
380640
380551
|
async function getNpmVersion() {
|
|
@@ -387351,19 +387262,6 @@ async function buildSystemMessage(config2, sessionId, permissionMode, allowedBui
|
|
|
387351
387262
|
return systemMessage;
|
|
387352
387263
|
}
|
|
387353
387264
|
__name(buildSystemMessage, "buildSystemMessage");
|
|
387354
|
-
function isMcpToolProgressData(output) {
|
|
387355
|
-
return typeof output === "object" && output !== null && "type" in output && output.type === "mcp_tool_progress";
|
|
387356
|
-
}
|
|
387357
|
-
__name(isMcpToolProgressData, "isMcpToolProgressData");
|
|
387358
|
-
function createToolProgressHandler(request4, adapter) {
|
|
387359
|
-
const handler = /* @__PURE__ */ __name((_callId, output) => {
|
|
387360
|
-
if (isMcpToolProgressData(output)) {
|
|
387361
|
-
adapter.emitToolProgress(request4, output);
|
|
387362
|
-
}
|
|
387363
|
-
}, "handler");
|
|
387364
|
-
return { handler };
|
|
387365
|
-
}
|
|
387366
|
-
__name(createToolProgressHandler, "createToolProgressHandler");
|
|
387367
387265
|
function createTaskToolProgressHandler(config2, taskToolCallId, adapter) {
|
|
387368
387266
|
const previousTaskStates = /* @__PURE__ */ new Map();
|
|
387369
387267
|
const emittedToolUseIds = /* @__PURE__ */ new Set();
|
|
@@ -388196,16 +388094,6 @@ ${event.value}`, null);
|
|
|
388196
388094
|
};
|
|
388197
388095
|
this.emitMessageImpl(systemMessage);
|
|
388198
388096
|
}
|
|
388199
|
-
/**
|
|
388200
|
-
* Emits a tool progress stream event.
|
|
388201
|
-
* Default implementation is a no-op. StreamJsonOutputAdapter overrides this
|
|
388202
|
-
* to emit stream events when includePartialMessages is enabled.
|
|
388203
|
-
*
|
|
388204
|
-
* @param _request - Tool call request info
|
|
388205
|
-
* @param _progress - Structured MCP progress data
|
|
388206
|
-
*/
|
|
388207
|
-
emitToolProgress(_request, _progress) {
|
|
388208
|
-
}
|
|
388209
388097
|
/**
|
|
388210
388098
|
* Builds a result message from options.
|
|
388211
388099
|
* Helper method used by both emitResult implementations.
|
|
@@ -388585,27 +388473,6 @@ var StreamJsonOutputAdapter = class extends BaseJsonOutputAdapter {
|
|
|
388585
388473
|
);
|
|
388586
388474
|
}
|
|
388587
388475
|
}
|
|
388588
|
-
/**
|
|
388589
|
-
* Emits a tool progress stream event when partial messages are enabled.
|
|
388590
|
-
* This overrides the no-op in BaseJsonOutputAdapter.
|
|
388591
|
-
*/
|
|
388592
|
-
emitToolProgress(request4, progress) {
|
|
388593
|
-
if (!this.includePartialMessages) {
|
|
388594
|
-
return;
|
|
388595
|
-
}
|
|
388596
|
-
const partial2 = {
|
|
388597
|
-
type: "stream_event",
|
|
388598
|
-
uuid: randomUUID8(),
|
|
388599
|
-
session_id: this.getSessionId(),
|
|
388600
|
-
parent_tool_use_id: null,
|
|
388601
|
-
event: {
|
|
388602
|
-
type: "tool_progress",
|
|
388603
|
-
tool_use_id: request4.callId,
|
|
388604
|
-
content: progress
|
|
388605
|
-
}
|
|
388606
|
-
};
|
|
388607
|
-
this.emitMessageImpl(partial2);
|
|
388608
|
-
}
|
|
388609
388476
|
/**
|
|
388610
388477
|
* Emits stream events when partial messages are enabled.
|
|
388611
388478
|
* This is a private method specific to StreamJsonOutputAdapter.
|
|
@@ -389095,21 +388962,24 @@ async function runNonInteractive(config2, settings, input, prompt_id, options2 =
|
|
|
389095
388962
|
const inputFormat = typeof config2.getInputFormat === "function" ? config2.getInputFormat() : InputFormat.TEXT;
|
|
389096
388963
|
const toolCallUpdateCallback = inputFormat === InputFormat.STREAM_JSON && options2.controlService ? options2.controlService.permission.getToolCallUpdateCallback() : void 0;
|
|
389097
388964
|
const isTaskTool = finalRequestInfo.name === "task";
|
|
389098
|
-
const
|
|
388965
|
+
const taskToolProgress = isTaskTool ? createTaskToolProgressHandler(
|
|
389099
388966
|
config2,
|
|
389100
388967
|
finalRequestInfo.callId,
|
|
389101
388968
|
adapter
|
|
389102
|
-
) :
|
|
388969
|
+
) : void 0;
|
|
388970
|
+
const taskToolProgressHandler = taskToolProgress?.handler;
|
|
389103
388971
|
const toolResponse = await executeToolCall(
|
|
389104
388972
|
config2,
|
|
389105
388973
|
finalRequestInfo,
|
|
389106
388974
|
abortController.signal,
|
|
389107
|
-
{
|
|
389108
|
-
|
|
388975
|
+
taskToolProgressHandler || toolCallUpdateCallback ? {
|
|
388976
|
+
...taskToolProgressHandler && {
|
|
388977
|
+
outputUpdateHandler: taskToolProgressHandler
|
|
388978
|
+
},
|
|
389109
388979
|
...toolCallUpdateCallback && {
|
|
389110
388980
|
onToolCallsUpdate: toolCallUpdateCallback
|
|
389111
388981
|
}
|
|
389112
|
-
}
|
|
388982
|
+
} : void 0
|
|
389113
388983
|
);
|
|
389114
388984
|
if (toolResponse.error) {
|
|
389115
388985
|
handleToolError(
|
|
@@ -412929,15 +412799,6 @@ var useResultDisplayRenderer = /* @__PURE__ */ __name((resultDisplay) => import_
|
|
|
412929
412799
|
data: resultDisplay
|
|
412930
412800
|
};
|
|
412931
412801
|
}
|
|
412932
|
-
if (typeof resultDisplay === "object" && resultDisplay !== null && "type" in resultDisplay && resultDisplay.type === "mcp_tool_progress") {
|
|
412933
|
-
const progress = resultDisplay;
|
|
412934
|
-
const msg = progress.message ?? `Progress: ${progress.progress}`;
|
|
412935
|
-
const totalStr = progress.total != null ? `/${progress.total}` : "";
|
|
412936
|
-
return {
|
|
412937
|
-
type: "string",
|
|
412938
|
-
data: `\u23F3 [${progress.progress}${totalStr}] ${msg}`
|
|
412939
|
-
};
|
|
412940
|
-
}
|
|
412941
412802
|
if (typeof resultDisplay === "object" && resultDisplay !== null && "ansiOutput" in resultDisplay) {
|
|
412942
412803
|
return { type: "ansi", data: resultDisplay.ansiOutput };
|
|
412943
412804
|
}
|
|
@@ -434952,7 +434813,7 @@ var GeminiAgent = class {
|
|
|
434952
434813
|
name: APPROVAL_MODE_INFO[mode].name,
|
|
434953
434814
|
description: APPROVAL_MODE_INFO[mode].description
|
|
434954
434815
|
}));
|
|
434955
|
-
const version2 = "0.10.0
|
|
434816
|
+
const version2 = "0.10.0";
|
|
434956
434817
|
return {
|
|
434957
434818
|
protocolVersion: PROTOCOL_VERSION,
|
|
434958
434819
|
agentInfo: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwen-code/qwen-code",
|
|
3
|
-
"version": "0.10.0
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Qwen Code - AI-powered coding assistant",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"locales"
|
|
21
21
|
],
|
|
22
22
|
"config": {
|
|
23
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.10.0
|
|
23
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.10.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {},
|
|
26
26
|
"optionalDependencies": {
|