@qwen-code/qwen-code 0.5.1-nightly.20251217.0a39c912 → 0.5.1-nightly.20251218.8106a6b0
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 +121 -11
- package/locales/en.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -143387,6 +143387,74 @@ var init_streamingToolCallParser = __esm({
|
|
|
143387
143387
|
}
|
|
143388
143388
|
});
|
|
143389
143389
|
|
|
143390
|
+
// packages/core/dist/src/utils/schemaConverter.js
|
|
143391
|
+
function convertSchema(schema, mode = "auto") {
|
|
143392
|
+
if (mode === "openapi_30") {
|
|
143393
|
+
return toOpenAPI30(schema);
|
|
143394
|
+
}
|
|
143395
|
+
return schema;
|
|
143396
|
+
}
|
|
143397
|
+
function toOpenAPI30(schema) {
|
|
143398
|
+
const convert2 = /* @__PURE__ */ __name((obj) => {
|
|
143399
|
+
if (typeof obj !== "object" || obj === null) {
|
|
143400
|
+
return obj;
|
|
143401
|
+
}
|
|
143402
|
+
if (Array.isArray(obj)) {
|
|
143403
|
+
return obj.map(convert2);
|
|
143404
|
+
}
|
|
143405
|
+
const source2 = obj;
|
|
143406
|
+
const target = {};
|
|
143407
|
+
if (Array.isArray(source2["type"])) {
|
|
143408
|
+
const types3 = source2["type"];
|
|
143409
|
+
if (types3.length === 2 && types3.includes("null")) {
|
|
143410
|
+
target["type"] = types3.find((t3) => t3 !== "null");
|
|
143411
|
+
target["nullable"] = true;
|
|
143412
|
+
} else {
|
|
143413
|
+
target["type"] = types3[0];
|
|
143414
|
+
}
|
|
143415
|
+
} else if (source2["type"] !== void 0) {
|
|
143416
|
+
target["type"] = source2["type"];
|
|
143417
|
+
}
|
|
143418
|
+
if (source2["const"] !== void 0) {
|
|
143419
|
+
target["enum"] = [source2["const"]];
|
|
143420
|
+
delete target["const"];
|
|
143421
|
+
}
|
|
143422
|
+
if (typeof source2["exclusiveMinimum"] === "number") {
|
|
143423
|
+
target["minimum"] = source2["exclusiveMinimum"];
|
|
143424
|
+
target["exclusiveMinimum"] = true;
|
|
143425
|
+
}
|
|
143426
|
+
if (typeof source2["exclusiveMaximum"] === "number") {
|
|
143427
|
+
target["maximum"] = source2["exclusiveMaximum"];
|
|
143428
|
+
target["exclusiveMaximum"] = true;
|
|
143429
|
+
}
|
|
143430
|
+
if (Array.isArray(source2["items"])) {
|
|
143431
|
+
delete target["items"];
|
|
143432
|
+
} else if (typeof source2["items"] === "object" && source2["items"] !== null) {
|
|
143433
|
+
target["items"] = convert2(source2["items"]);
|
|
143434
|
+
}
|
|
143435
|
+
if (Array.isArray(source2["enum"])) {
|
|
143436
|
+
target["enum"] = source2["enum"].map(String);
|
|
143437
|
+
}
|
|
143438
|
+
for (const [key, value] of Object.entries(source2)) {
|
|
143439
|
+
if (key === "type" || key === "const" || key === "exclusiveMinimum" || key === "exclusiveMaximum" || key === "items" || key === "enum" || key === "$schema" || key === "$id" || key === "default" || // Optional: Gemini sometimes complains about defaults conflicting with types
|
|
143440
|
+
key === "dependencies" || key === "patternProperties") {
|
|
143441
|
+
continue;
|
|
143442
|
+
}
|
|
143443
|
+
target[key] = convert2(value);
|
|
143444
|
+
}
|
|
143445
|
+
return target;
|
|
143446
|
+
}, "convert");
|
|
143447
|
+
return convert2(schema);
|
|
143448
|
+
}
|
|
143449
|
+
var init_schemaConverter = __esm({
|
|
143450
|
+
"packages/core/dist/src/utils/schemaConverter.js"() {
|
|
143451
|
+
"use strict";
|
|
143452
|
+
init_esbuild_shims();
|
|
143453
|
+
__name(convertSchema, "convertSchema");
|
|
143454
|
+
__name(toOpenAPI30, "toOpenAPI30");
|
|
143455
|
+
}
|
|
143456
|
+
});
|
|
143457
|
+
|
|
143390
143458
|
// packages/core/dist/src/core/openaiContentGenerator/converter.js
|
|
143391
143459
|
var OpenAIContentConverter;
|
|
143392
143460
|
var init_converter2 = __esm({
|
|
@@ -143396,14 +143464,17 @@ var init_converter2 = __esm({
|
|
|
143396
143464
|
init_node();
|
|
143397
143465
|
init_safeJsonParse();
|
|
143398
143466
|
init_streamingToolCallParser();
|
|
143467
|
+
init_schemaConverter();
|
|
143399
143468
|
OpenAIContentConverter = class {
|
|
143400
143469
|
static {
|
|
143401
143470
|
__name(this, "OpenAIContentConverter");
|
|
143402
143471
|
}
|
|
143403
143472
|
model;
|
|
143473
|
+
schemaCompliance;
|
|
143404
143474
|
streamingToolCallParser = new StreamingToolCallParser();
|
|
143405
|
-
constructor(model) {
|
|
143475
|
+
constructor(model, schemaCompliance = "auto") {
|
|
143406
143476
|
this.model = model;
|
|
143477
|
+
this.schemaCompliance = schemaCompliance;
|
|
143407
143478
|
}
|
|
143408
143479
|
/**
|
|
143409
143480
|
* Reset streaming tool calls parser for new stream processing
|
|
@@ -143486,6 +143557,9 @@ var init_converter2 = __esm({
|
|
|
143486
143557
|
} else if (func.parameters) {
|
|
143487
143558
|
parameters = this.convertGeminiToolParametersToOpenAI(func.parameters);
|
|
143488
143559
|
}
|
|
143560
|
+
if (parameters) {
|
|
143561
|
+
parameters = convertSchema(parameters, this.schemaCompliance);
|
|
143562
|
+
}
|
|
143489
143563
|
openAITools.push({
|
|
143490
143564
|
type: "function",
|
|
143491
143565
|
function: {
|
|
@@ -144143,7 +144217,7 @@ var init_pipeline = __esm({
|
|
|
144143
144217
|
this.config = config;
|
|
144144
144218
|
this.contentGeneratorConfig = config.contentGeneratorConfig;
|
|
144145
144219
|
this.client = this.config.provider.buildClient();
|
|
144146
|
-
this.converter = new OpenAIContentConverter(this.contentGeneratorConfig.model);
|
|
144220
|
+
this.converter = new OpenAIContentConverter(this.contentGeneratorConfig.model, this.contentGeneratorConfig.schemaCompliance);
|
|
144147
144221
|
}
|
|
144148
144222
|
async execute(request4, userPromptId) {
|
|
144149
144223
|
return this.executeWithErrorHandling(request4, userPromptId, false, async (openaiRequest, context2) => {
|
|
@@ -145740,7 +145814,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
145740
145814
|
};
|
|
145741
145815
|
}
|
|
145742
145816
|
async function createContentGenerator(config, gcConfig, isInitialAuth) {
|
|
145743
|
-
const version2 = "0.5.1-nightly.
|
|
145817
|
+
const version2 = "0.5.1-nightly.20251218.8106a6b0";
|
|
145744
145818
|
const userAgent2 = `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
145745
145819
|
const baseHeaders = {
|
|
145746
145820
|
"User-Agent": userAgent2
|
|
@@ -270734,6 +270808,7 @@ var init_en2 = __esm({
|
|
|
270734
270808
|
"Tool Output Truncation Lines": "Tool Output Truncation Lines",
|
|
270735
270809
|
"Folder Trust": "Folder Trust",
|
|
270736
270810
|
"Vision Model Preview": "Vision Model Preview",
|
|
270811
|
+
"Tool Schema Compliance": "Tool Schema Compliance",
|
|
270737
270812
|
// Settings enum options
|
|
270738
270813
|
"Auto (detect from system)": "Auto (detect from system)",
|
|
270739
270814
|
Text: "Text",
|
|
@@ -272386,6 +272461,7 @@ var init_zh = __esm({
|
|
|
272386
272461
|
"Tool Output Truncation Lines": "\u5DE5\u5177\u8F93\u51FA\u622A\u65AD\u884C\u6570",
|
|
272387
272462
|
"Folder Trust": "\u6587\u4EF6\u5939\u4FE1\u4EFB",
|
|
272388
272463
|
"Vision Model Preview": "\u89C6\u89C9\u6A21\u578B\u9884\u89C8",
|
|
272464
|
+
"Tool Schema Compliance": "\u5DE5\u5177 Schema \u517C\u5BB9\u6027",
|
|
272389
272465
|
// Settings enum options
|
|
272390
272466
|
"Auto (detect from system)": "\u81EA\u52A8\uFF08\u4ECE\u7CFB\u7EDF\u68C0\u6D4B\uFF09",
|
|
272391
272467
|
Text: "\u6587\u672C",
|
|
@@ -296298,6 +296374,21 @@ var SETTINGS_SCHEMA = {
|
|
|
296298
296374
|
parentKey: "generationConfig",
|
|
296299
296375
|
childKey: "disableCacheControl",
|
|
296300
296376
|
showInDialog: true
|
|
296377
|
+
},
|
|
296378
|
+
schemaCompliance: {
|
|
296379
|
+
type: "enum",
|
|
296380
|
+
label: "Tool Schema Compliance",
|
|
296381
|
+
category: "Generation Configuration",
|
|
296382
|
+
requiresRestart: false,
|
|
296383
|
+
default: "auto",
|
|
296384
|
+
description: 'The compliance mode for tool schemas sent to the model. Use "openapi_30" for strict OpenAPI 3.0 compatibility (e.g., for Gemini).',
|
|
296385
|
+
parentKey: "generationConfig",
|
|
296386
|
+
childKey: "schemaCompliance",
|
|
296387
|
+
showInDialog: true,
|
|
296388
|
+
options: [
|
|
296389
|
+
{ value: "auto", label: "Auto (Default)" },
|
|
296390
|
+
{ value: "openapi_30", label: "OpenAPI 3.0 Strict" }
|
|
296391
|
+
]
|
|
296301
296392
|
}
|
|
296302
296393
|
}
|
|
296303
296394
|
}
|
|
@@ -309872,7 +309963,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
309872
309963
|
// packages/cli/src/utils/version.ts
|
|
309873
309964
|
async function getCliVersion() {
|
|
309874
309965
|
const pkgJson = await getPackageJson();
|
|
309875
|
-
return "0.5.1-nightly.
|
|
309966
|
+
return "0.5.1-nightly.20251218.8106a6b0";
|
|
309876
309967
|
}
|
|
309877
309968
|
__name(getCliVersion, "getCliVersion");
|
|
309878
309969
|
|
|
@@ -313957,7 +314048,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
313957
314048
|
|
|
313958
314049
|
// packages/cli/src/generated/git-commit.ts
|
|
313959
314050
|
init_esbuild_shims();
|
|
313960
|
-
var GIT_COMMIT_INFO2 = "
|
|
314051
|
+
var GIT_COMMIT_INFO2 = "b42d4104";
|
|
313961
314052
|
|
|
313962
314053
|
// packages/cli/src/utils/systemInfo.ts
|
|
313963
314054
|
async function getNpmVersion() {
|
|
@@ -317187,15 +317278,34 @@ function getGitHubRepoInfo() {
|
|
|
317187
317278
|
const remoteUrl = execSync6("git remote get-url origin", {
|
|
317188
317279
|
encoding: "utf-8"
|
|
317189
317280
|
}).trim();
|
|
317190
|
-
|
|
317191
|
-
|
|
317192
|
-
|
|
317193
|
-
if (
|
|
317281
|
+
let urlToParse = remoteUrl;
|
|
317282
|
+
if (remoteUrl.startsWith("git@github.com:")) {
|
|
317283
|
+
urlToParse = remoteUrl.replace("git@github.com:", "");
|
|
317284
|
+
} else if (remoteUrl.startsWith("git@")) {
|
|
317285
|
+
throw new Error(
|
|
317286
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
317287
|
+
);
|
|
317288
|
+
}
|
|
317289
|
+
let parsedUrl;
|
|
317290
|
+
try {
|
|
317291
|
+
parsedUrl = new URL(urlToParse, "https://github.com");
|
|
317292
|
+
} catch {
|
|
317293
|
+
throw new Error(
|
|
317294
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
317295
|
+
);
|
|
317296
|
+
}
|
|
317297
|
+
if (parsedUrl.host !== "github.com") {
|
|
317298
|
+
throw new Error(
|
|
317299
|
+
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
317300
|
+
);
|
|
317301
|
+
}
|
|
317302
|
+
const parts = parsedUrl.pathname.split("/").filter((part) => part !== "");
|
|
317303
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
317194
317304
|
throw new Error(
|
|
317195
317305
|
`Owner & repo could not be extracted from remote URL: ${remoteUrl}`
|
|
317196
317306
|
);
|
|
317197
317307
|
}
|
|
317198
|
-
return { owner:
|
|
317308
|
+
return { owner: parts[0], repo: parts[1].replace(/\.git$/, "") };
|
|
317199
317309
|
}
|
|
317200
317310
|
__name(getGitHubRepoInfo, "getGitHubRepoInfo");
|
|
317201
317311
|
|
|
@@ -364758,7 +364868,7 @@ var GeminiAgent = class {
|
|
|
364758
364868
|
name: APPROVAL_MODE_INFO[mode].name,
|
|
364759
364869
|
description: APPROVAL_MODE_INFO[mode].description
|
|
364760
364870
|
}));
|
|
364761
|
-
const version2 = "0.5.1-nightly.
|
|
364871
|
+
const version2 = "0.5.1-nightly.20251218.8106a6b0";
|
|
364762
364872
|
return {
|
|
364763
364873
|
protocolVersion: PROTOCOL_VERSION,
|
|
364764
364874
|
agentInfo: {
|
package/locales/en.js
CHANGED
|
@@ -310,6 +310,7 @@ export default {
|
|
|
310
310
|
'Tool Output Truncation Lines': 'Tool Output Truncation Lines',
|
|
311
311
|
'Folder Trust': 'Folder Trust',
|
|
312
312
|
'Vision Model Preview': 'Vision Model Preview',
|
|
313
|
+
'Tool Schema Compliance': 'Tool Schema Compliance',
|
|
313
314
|
// Settings enum options
|
|
314
315
|
'Auto (detect from system)': 'Auto (detect from system)',
|
|
315
316
|
Text: 'Text',
|
package/locales/zh.js
CHANGED
|
@@ -300,6 +300,7 @@ export default {
|
|
|
300
300
|
'Tool Output Truncation Lines': '工具输出截断行数',
|
|
301
301
|
'Folder Trust': '文件夹信任',
|
|
302
302
|
'Vision Model Preview': '视觉模型预览',
|
|
303
|
+
'Tool Schema Compliance': '工具 Schema 兼容性',
|
|
303
304
|
// Settings enum options
|
|
304
305
|
'Auto (detect from system)': '自动(从系统检测)',
|
|
305
306
|
Text: '文本',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwen-code/qwen-code",
|
|
3
|
-
"version": "0.5.1-nightly.
|
|
3
|
+
"version": "0.5.1-nightly.20251218.8106a6b0",
|
|
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.5.1-nightly.
|
|
23
|
+
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.5.1-nightly.20251218.8106a6b0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"tiktoken": "^1.0.21"
|