@qwen-code/qwen-code 0.1.0-preview.0 → 0.1.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 +65 -42
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -180414,7 +180414,7 @@ var init_converter2 = __esm({
|
|
|
180414
180414
|
messages.push({
|
|
180415
180415
|
role: "tool",
|
|
180416
180416
|
tool_call_id: funcResponse.id || "",
|
|
180417
|
-
content:
|
|
180417
|
+
content: this.extractFunctionResponseContent(funcResponse.response)
|
|
180418
180418
|
});
|
|
180419
180419
|
}
|
|
180420
180420
|
return;
|
|
@@ -180479,6 +180479,31 @@ var init_converter2 = __esm({
|
|
|
180479
180479
|
}
|
|
180480
180480
|
return { textParts, functionCalls, functionResponses, mediaParts };
|
|
180481
180481
|
}
|
|
180482
|
+
extractFunctionResponseContent(response) {
|
|
180483
|
+
if (response === null || response === void 0) {
|
|
180484
|
+
return "";
|
|
180485
|
+
}
|
|
180486
|
+
if (typeof response === "string") {
|
|
180487
|
+
return response;
|
|
180488
|
+
}
|
|
180489
|
+
if (typeof response === "object") {
|
|
180490
|
+
const responseObject = response;
|
|
180491
|
+
const output = responseObject["output"];
|
|
180492
|
+
if (typeof output === "string") {
|
|
180493
|
+
return output;
|
|
180494
|
+
}
|
|
180495
|
+
const error = responseObject["error"];
|
|
180496
|
+
if (typeof error === "string") {
|
|
180497
|
+
return error;
|
|
180498
|
+
}
|
|
180499
|
+
}
|
|
180500
|
+
try {
|
|
180501
|
+
const serialized = JSON.stringify(response);
|
|
180502
|
+
return serialized ?? String(response);
|
|
180503
|
+
} catch {
|
|
180504
|
+
return String(response);
|
|
180505
|
+
}
|
|
180506
|
+
}
|
|
180482
180507
|
/**
|
|
180483
180508
|
* Determine media type from MIME type
|
|
180484
180509
|
*/
|
|
@@ -182520,7 +182545,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
182520
182545
|
return newContentGeneratorConfig;
|
|
182521
182546
|
}
|
|
182522
182547
|
async function createContentGenerator(config, gcConfig, sessionId2) {
|
|
182523
|
-
const version2 = "0.1.0
|
|
182548
|
+
const version2 = "0.1.0";
|
|
182524
182549
|
const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
182525
182550
|
const baseHeaders = {
|
|
182526
182551
|
"User-Agent": userAgent2
|
|
@@ -242871,7 +242896,7 @@ ${newContent2}`,
|
|
|
242871
242896
|
if (!fact || typeof fact !== "string" || fact.trim() === "") {
|
|
242872
242897
|
const errorMessage = 'Parameter "fact" must be a non-empty string.';
|
|
242873
242898
|
return {
|
|
242874
|
-
llmContent:
|
|
242899
|
+
llmContent: `Error: ${errorMessage}`,
|
|
242875
242900
|
returnDisplay: `Error: ${errorMessage}`
|
|
242876
242901
|
};
|
|
242877
242902
|
}
|
|
@@ -242883,10 +242908,7 @@ ${newContent2}`,
|
|
|
242883
242908
|
Global: ${globalPath} (shared across all projects)
|
|
242884
242909
|
Project: ${projectPath} (current project only)`;
|
|
242885
242910
|
return {
|
|
242886
|
-
llmContent:
|
|
242887
|
-
success: false,
|
|
242888
|
-
error: "Please specify where to save this memory"
|
|
242889
|
-
}),
|
|
242911
|
+
llmContent: errorMessage,
|
|
242890
242912
|
returnDisplay: errorMessage
|
|
242891
242913
|
};
|
|
242892
242914
|
}
|
|
@@ -242900,10 +242922,7 @@ Project: ${projectPath} (current project only)`;
|
|
|
242900
242922
|
await fs19.writeFile(memoryFilePath, modified_content, "utf-8");
|
|
242901
242923
|
const successMessage = `Okay, I've updated the ${scope} memory file with your modifications.`;
|
|
242902
242924
|
return {
|
|
242903
|
-
llmContent:
|
|
242904
|
-
success: true,
|
|
242905
|
-
message: successMessage
|
|
242906
|
-
}),
|
|
242925
|
+
llmContent: successMessage,
|
|
242907
242926
|
returnDisplay: successMessage
|
|
242908
242927
|
};
|
|
242909
242928
|
} else {
|
|
@@ -242914,10 +242933,7 @@ Project: ${projectPath} (current project only)`;
|
|
|
242914
242933
|
});
|
|
242915
242934
|
const successMessage = `Okay, I've remembered that in ${scope} memory: "${fact}"`;
|
|
242916
242935
|
return {
|
|
242917
|
-
llmContent:
|
|
242918
|
-
success: true,
|
|
242919
|
-
message: successMessage
|
|
242920
|
-
}),
|
|
242936
|
+
llmContent: successMessage,
|
|
242921
242937
|
returnDisplay: successMessage
|
|
242922
242938
|
};
|
|
242923
242939
|
}
|
|
@@ -242925,10 +242941,7 @@ Project: ${projectPath} (current project only)`;
|
|
|
242925
242941
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
242926
242942
|
console.error(`[MemoryTool] Error executing save_memory for fact "${fact}" in ${scope}: ${errorMessage}`);
|
|
242927
242943
|
return {
|
|
242928
|
-
llmContent:
|
|
242929
|
-
success: false,
|
|
242930
|
-
error: `Failed to save memory. Detail: ${errorMessage}`
|
|
242931
|
-
}),
|
|
242944
|
+
llmContent: `Error saving memory: ${errorMessage}`,
|
|
242932
242945
|
returnDisplay: `Error saving memory: ${errorMessage}`,
|
|
242933
242946
|
error: {
|
|
242934
242947
|
message: errorMessage,
|
|
@@ -270980,15 +270993,11 @@ var ExitPlanModeToolInvocation = class extends BaseToolInvocation {
|
|
|
270980
270993
|
if (!this.wasApproved) {
|
|
270981
270994
|
const rejectionMessage = "Plan execution was not approved. Remaining in plan mode.";
|
|
270982
270995
|
return {
|
|
270983
|
-
llmContent:
|
|
270984
|
-
success: false,
|
|
270985
|
-
plan,
|
|
270986
|
-
error: rejectionMessage
|
|
270987
|
-
}),
|
|
270996
|
+
llmContent: rejectionMessage,
|
|
270988
270997
|
returnDisplay: rejectionMessage
|
|
270989
270998
|
};
|
|
270990
270999
|
}
|
|
270991
|
-
const llmMessage =
|
|
271000
|
+
const llmMessage = `User has approved your plan. You can now start coding. Start with updating your todo list if applicable.`;
|
|
270992
271001
|
const displayMessage = "User approved the plan.";
|
|
270993
271002
|
return {
|
|
270994
271003
|
llmContent: llmMessage,
|
|
@@ -271001,11 +271010,9 @@ var ExitPlanModeToolInvocation = class extends BaseToolInvocation {
|
|
|
271001
271010
|
} catch (error) {
|
|
271002
271011
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
271003
271012
|
console.error(`[ExitPlanModeTool] Error executing exit_plan_mode: ${errorMessage}`);
|
|
271013
|
+
const errorLlmContent = `Failed to present plan: ${errorMessage}`;
|
|
271004
271014
|
return {
|
|
271005
|
-
llmContent:
|
|
271006
|
-
success: false,
|
|
271007
|
-
error: `Failed to present plan. Detail: ${errorMessage}`
|
|
271008
|
-
}),
|
|
271015
|
+
llmContent: errorLlmContent,
|
|
271009
271016
|
returnDisplay: `Error presenting plan: ${errorMessage}`
|
|
271010
271017
|
};
|
|
271011
271018
|
}
|
|
@@ -273783,21 +273790,37 @@ var TodoWriteToolInvocation = class extends BaseToolInvocation {
|
|
|
273783
273790
|
type: "todo_list",
|
|
273784
273791
|
todos: finalTodos
|
|
273785
273792
|
};
|
|
273793
|
+
const todosJson = JSON.stringify(finalTodos);
|
|
273794
|
+
let llmContent;
|
|
273795
|
+
if (finalTodos.length === 0) {
|
|
273796
|
+
llmContent = `Todo list has been cleared.
|
|
273797
|
+
|
|
273798
|
+
<system-reminder>
|
|
273799
|
+
Your todo list is now empty. DO NOT mention this explicitly to the user. You have no pending tasks in your todo list.
|
|
273800
|
+
</system-reminder>`;
|
|
273801
|
+
} else {
|
|
273802
|
+
llmContent = `Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable
|
|
273803
|
+
|
|
273804
|
+
<system-reminder>
|
|
273805
|
+
Your todo list has changed. DO NOT mention this explicitly to the user. Here are the latest contents of your todo list:
|
|
273806
|
+
|
|
273807
|
+
${todosJson}. Continue on with the tasks at hand if applicable.
|
|
273808
|
+
</system-reminder>`;
|
|
273809
|
+
}
|
|
273786
273810
|
return {
|
|
273787
|
-
llmContent
|
|
273788
|
-
success: true,
|
|
273789
|
-
todos: finalTodos
|
|
273790
|
-
}),
|
|
273811
|
+
llmContent,
|
|
273791
273812
|
returnDisplay: todoResultDisplay
|
|
273792
273813
|
};
|
|
273793
273814
|
} catch (error) {
|
|
273794
273815
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
273795
273816
|
console.error(`[TodoWriteTool] Error executing todo_write: ${errorMessage}`);
|
|
273817
|
+
const errorLlmContent = `Failed to modify todos. An error occurred during the operation.
|
|
273818
|
+
|
|
273819
|
+
<system-reminder>
|
|
273820
|
+
Todo list modification failed with error: ${errorMessage}. You may need to retry or handle this error appropriately.
|
|
273821
|
+
</system-reminder>`;
|
|
273796
273822
|
return {
|
|
273797
|
-
llmContent:
|
|
273798
|
-
success: false,
|
|
273799
|
-
error: `Failed to write todos. Detail: ${errorMessage}`
|
|
273800
|
-
}),
|
|
273823
|
+
llmContent: errorLlmContent,
|
|
273801
273824
|
returnDisplay: `Error writing todos: ${errorMessage}`
|
|
273802
273825
|
};
|
|
273803
273826
|
}
|
|
@@ -315039,7 +315062,7 @@ init_esbuild_shims();
|
|
|
315039
315062
|
|
|
315040
315063
|
// packages/cli/src/generated/git-commit.ts
|
|
315041
315064
|
init_esbuild_shims();
|
|
315042
|
-
var GIT_COMMIT_INFO2 = "
|
|
315065
|
+
var GIT_COMMIT_INFO2 = "1577dabf";
|
|
315043
315066
|
|
|
315044
315067
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
315045
315068
|
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -327561,12 +327584,12 @@ var AVAILABLE_MODELS_QWEN = [
|
|
|
327561
327584
|
{
|
|
327562
327585
|
id: MAINLINE_CODER,
|
|
327563
327586
|
label: MAINLINE_CODER,
|
|
327564
|
-
description: "
|
|
327587
|
+
description: "The latest Qwen Coder model from Alibaba Cloud ModelStudio (version: qwen3-coder-plus-2025-09-23)"
|
|
327565
327588
|
},
|
|
327566
327589
|
{
|
|
327567
327590
|
id: MAINLINE_VLM,
|
|
327568
327591
|
label: MAINLINE_VLM,
|
|
327569
|
-
description: "Vision model
|
|
327592
|
+
description: "The latest Qwen Vision model from Alibaba Cloud ModelStudio (version: qwen3-vl-plus-2025-09-23)",
|
|
327570
327593
|
isVision: true
|
|
327571
327594
|
}
|
|
327572
327595
|
];
|
|
@@ -337073,7 +337096,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
337073
337096
|
// packages/cli/src/utils/version.ts
|
|
337074
337097
|
async function getCliVersion() {
|
|
337075
337098
|
const pkgJson = await getPackageJson();
|
|
337076
|
-
return "0.1.0
|
|
337099
|
+
return "0.1.0";
|
|
337077
337100
|
}
|
|
337078
337101
|
__name(getCliVersion, "getCliVersion");
|
|
337079
337102
|
|
|
@@ -350169,7 +350192,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
350169
350192
|
historyManager.addItem(
|
|
350170
350193
|
{
|
|
350171
350194
|
type: "info" /* INFO */,
|
|
350172
|
-
text: "Refreshing hierarchical memory (
|
|
350195
|
+
text: "Refreshing hierarchical memory (QWEN.md or other context files)..."
|
|
350173
350196
|
},
|
|
350174
350197
|
Date.now()
|
|
350175
350198
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwen-code/qwen-code",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Qwen Code - AI-powered coding assistant",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"LICENSE"
|
|
19
19
|
],
|
|
20
20
|
"config": {
|
|
21
|
-
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.0
|
|
21
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.1.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"tiktoken": "^1.0.21"
|