@qwen-code/qwen-code 0.5.1-nightly.20251217.0a39c912 → 0.5.1-nightly.20251219.d07ae35c

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 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.20251217.0a39c912";
145817
+ const version2 = "0.5.1-nightly.20251219.d07ae35c";
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.20251217.0a39c912";
309966
+ return "0.5.1-nightly.20251219.d07ae35c";
309876
309967
  }
309877
309968
  __name(getCliVersion, "getCliVersion");
309878
309969
 
@@ -310492,7 +310583,6 @@ async function parseArguments(settings) {
310492
310583
  choices: ["plan", "default", "auto-edit", "yolo"],
310493
310584
  description: "Set the approval mode: plan (plan only), default (prompt for approval), auto-edit (auto-approve edit tools), yolo (auto-approve all tools)"
310494
310585
  }).option("checkpointing", {
310495
- alias: "c",
310496
310586
  type: "boolean",
310497
310587
  description: "Enables checkpointing of file edits",
310498
310588
  default: false
@@ -310591,10 +310681,12 @@ async function parseArguments(settings) {
310591
310681
  description: "Include partial assistant messages when using stream-json output.",
310592
310682
  default: false
310593
310683
  }).option("continue", {
310684
+ alias: "c",
310594
310685
  type: "boolean",
310595
310686
  description: "Resume the most recent session for the current project.",
310596
310687
  default: false
310597
310688
  }).option("resume", {
310689
+ alias: "r",
310598
310690
  type: "string",
310599
310691
  description: "Resume a specific session by its ID. Use without an ID to show session picker."
310600
310692
  }).option("max-session-turns", {
@@ -313957,7 +314049,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
313957
314049
 
313958
314050
  // packages/cli/src/generated/git-commit.ts
313959
314051
  init_esbuild_shims();
313960
- var GIT_COMMIT_INFO2 = "7ecd2520";
314052
+ var GIT_COMMIT_INFO2 = "ad3b8af3";
313961
314053
 
313962
314054
  // packages/cli/src/utils/systemInfo.ts
313963
314055
  async function getNpmVersion() {
@@ -317187,15 +317279,34 @@ function getGitHubRepoInfo() {
317187
317279
  const remoteUrl = execSync6("git remote get-url origin", {
317188
317280
  encoding: "utf-8"
317189
317281
  }).trim();
317190
- const match2 = remoteUrl.match(
317191
- /(?:https?:\/\/|git@)github\.com(?::|\/)([^/]+)\/([^/]+?)(?:\.git)?$/
317192
- );
317193
- if (!match2 || !match2[1] || !match2[2]) {
317282
+ let urlToParse = remoteUrl;
317283
+ if (remoteUrl.startsWith("git@github.com:")) {
317284
+ urlToParse = remoteUrl.replace("git@github.com:", "");
317285
+ } else if (remoteUrl.startsWith("git@")) {
317286
+ throw new Error(
317287
+ `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
317288
+ );
317289
+ }
317290
+ let parsedUrl;
317291
+ try {
317292
+ parsedUrl = new URL(urlToParse, "https://github.com");
317293
+ } catch {
317294
+ throw new Error(
317295
+ `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
317296
+ );
317297
+ }
317298
+ if (parsedUrl.host !== "github.com") {
317299
+ throw new Error(
317300
+ `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
317301
+ );
317302
+ }
317303
+ const parts = parsedUrl.pathname.split("/").filter((part) => part !== "");
317304
+ if (parts.length !== 2 || !parts[0] || !parts[1]) {
317194
317305
  throw new Error(
317195
317306
  `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
317196
317307
  );
317197
317308
  }
317198
- return { owner: match2[1], repo: match2[2] };
317309
+ return { owner: parts[0], repo: parts[1].replace(/\.git$/, "") };
317199
317310
  }
317200
317311
  __name(getGitHubRepoInfo, "getGitHubRepoInfo");
317201
317312
 
@@ -364758,7 +364869,7 @@ var GeminiAgent = class {
364758
364869
  name: APPROVAL_MODE_INFO[mode].name,
364759
364870
  description: APPROVAL_MODE_INFO[mode].description
364760
364871
  }));
364761
- const version2 = "0.5.1-nightly.20251217.0a39c912";
364872
+ const version2 = "0.5.1-nightly.20251219.d07ae35c";
364762
364873
  return {
364763
364874
  protocolVersion: PROTOCOL_VERSION,
364764
364875
  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.20251217.0a39c912",
3
+ "version": "0.5.1-nightly.20251219.d07ae35c",
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.20251217.0a39c912"
23
+ "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.5.1-nightly.20251219.d07ae35c"
24
24
  },
25
25
  "dependencies": {
26
26
  "tiktoken": "^1.0.21"