@qwen-code/qwen-code 0.18.4 → 0.18.5-preview.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.
Files changed (179) hide show
  1. package/bundled/qc-helper/SKILL.md +13 -5
  2. package/bundled/qc-helper/docs/configuration/_meta.ts +1 -0
  3. package/bundled/qc-helper/docs/configuration/auth.md +75 -54
  4. package/bundled/qc-helper/docs/configuration/model-providers.md +221 -185
  5. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
  6. package/bundled/qc-helper/docs/configuration/settings.md +70 -53
  7. package/bundled/qc-helper/docs/configuration/themes.md +7 -4
  8. package/bundled/qc-helper/docs/extension/extension-releasing.md +1 -1
  9. package/bundled/qc-helper/docs/extension/introduction.md +27 -21
  10. package/bundled/qc-helper/docs/features/approval-mode.md +2 -0
  11. package/bundled/qc-helper/docs/features/arena.md +3 -3
  12. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  13. package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
  14. package/bundled/qc-helper/docs/features/commands.md +6 -1
  15. package/bundled/qc-helper/docs/features/headless.md +1 -1
  16. package/bundled/qc-helper/docs/features/mcp.md +78 -10
  17. package/bundled/qc-helper/docs/features/sandbox.md +2 -2
  18. package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
  19. package/bundled/qc-helper/docs/integration-github-action.md +2 -2
  20. package/bundled/qc-helper/docs/overview.md +1 -1
  21. package/bundled/qc-helper/docs/quickstart.md +9 -5
  22. package/bundled/qc-helper/docs/qwen-serve.md +14 -2
  23. package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
  24. package/chunks/{agent-LYTC56HT.js → agent-P4KSTVXX.js} +24 -22
  25. package/chunks/{agent-headless-FPUP5WHP.js → agent-headless-QUAPWF55.js} +24 -22
  26. package/chunks/{anthropicContentGenerator-OLOGBVLP.js → anthropicContentGenerator-7352A7I5.js} +17 -14
  27. package/chunks/artifact-tool-5J4HUZAV.js +675 -0
  28. package/chunks/{askUserQuestion-ANRVSBIJ.js → askUserQuestion-HF7HCWDD.js} +20 -7
  29. package/chunks/{ca-K6MD665I.js → ca-7WC7ELX6.js} +1 -0
  30. package/chunks/chunk-22IFUCVR.js +291 -0
  31. package/chunks/{chunk-M5VYHAHT.js → chunk-2BIF2NVV.js} +2 -2
  32. package/chunks/{chunk-AQDPHFDZ.js → chunk-2QDQTWCI.js} +1 -1
  33. package/chunks/{chunk-2ES3D3TW.js → chunk-3BR4OIOE.js} +3 -3
  34. package/chunks/{chunk-N5QHMPZU.js → chunk-3UALQ56H.js} +1 -1
  35. package/chunks/{chunk-5RVEAAD2.js → chunk-BC5POO46.js} +8 -7
  36. package/chunks/{chunk-DZCZZPCY.js → chunk-BGUDAULQ.js} +11 -290
  37. package/chunks/{chunk-FPZF3BNV.js → chunk-BNXANYLH.js} +1 -1
  38. package/chunks/{chunk-IKOWINH4.js → chunk-C4K3FEQ2.js} +42 -2
  39. package/chunks/{chunk-PTGKSUUJ.js → chunk-CGEGHF2C.js} +2 -207
  40. package/chunks/chunk-EEEZIVFJ.js +908 -0
  41. package/chunks/{chunk-GBTJHKQ6.js → chunk-EIJYMXXX.js} +619 -135
  42. package/chunks/chunk-EJYJYJZ2.js +3703 -0
  43. package/chunks/{chunk-F6FP3URI.js → chunk-EW6C27XX.js} +1 -1
  44. package/chunks/{chunk-HU3RKEK2.js → chunk-F6XNTYNE.js} +216 -1
  45. package/chunks/{chunk-4HMWGHPP.js → chunk-GZCJS5WH.js} +2 -2
  46. package/chunks/{chunk-E5SRTXRG.js → chunk-HGNSRCRB.js} +1 -1
  47. package/chunks/{chunk-IUEQOXOI.js → chunk-KBXLIVWQ.js} +2 -2
  48. package/chunks/{chunk-JJHY7NAD.js → chunk-L7U2RI5O.js} +59 -57
  49. package/chunks/{chunk-JN6FVOPP.js → chunk-NKJ6LRCR.js} +2 -2
  50. package/chunks/{chunk-7OCZ77KA.js → chunk-NWLUISRA.js} +1 -1
  51. package/chunks/{chunk-JIJBNW4A.js → chunk-OTBK43JR.js} +1 -1
  52. package/chunks/{chunk-WWU2KUSR.js → chunk-PRYMDRBV.js} +1 -1
  53. package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
  54. package/chunks/{chunk-VWPDSQZY.js → chunk-T2VDEFUU.js} +2 -2
  55. package/chunks/{chunk-LXUQBWQA.js → chunk-T336V435.js} +93 -45
  56. package/chunks/{chunk-4TW2JM5Q.js → chunk-TXVGVZYR.js} +3 -3
  57. package/chunks/{chunk-6Z2MVJIJ.js → chunk-UMRZ7XCR.js} +172 -5017
  58. package/chunks/{chunk-7GX7XYZU.js → chunk-XU5P23GN.js} +3 -3
  59. package/chunks/{chunk-SZWDOOGV.js → chunk-ZC675NGC.js} +11 -11
  60. package/chunks/{chunk-32SSXBMG.js → chunk-ZXNEOCW2.js} +8049 -5520
  61. package/chunks/{computer-use-P4WQBATW.js → computer-use-4TLHI3UR.js} +26 -23
  62. package/chunks/contextCommand-HFEITKSR.js +56 -0
  63. package/chunks/{cron-create-OKGQO6GX.js → cron-create-A5637KCI.js} +12 -9
  64. package/chunks/{cron-delete-DTJP7L6O.js → cron-delete-AADOSEOZ.js} +4 -4
  65. package/chunks/{cron-list-VKZUASFG.js → cron-list-OFCPTT2Y.js} +4 -4
  66. package/chunks/{de-K2F3T3TR.js → de-ACHALDED.js} +1 -0
  67. package/chunks/{dist-OLC6NBSB.js → dist-DZ6AJDX4.js} +1 -1
  68. package/chunks/{dist-QUSDBLAK.js → dist-ZBX7LPJZ.js} +6 -1
  69. package/chunks/{edit-CS7DSS4Z.js → edit-B7H73V6O.js} +24 -22
  70. package/chunks/{en-KGSAKBJP.js → en-7OGNWWME.js} +49 -0
  71. package/chunks/{enter-worktree-PA4HPHJK.js → enter-worktree-GG7ZHYPS.js} +24 -22
  72. package/chunks/{enterPlanMode-SFE5AFKZ.js → enterPlanMode-RHTAKG52.js} +32 -28
  73. package/chunks/{exit-worktree-FR3AZTC6.js → exit-worktree-U7VQZRMG.js} +24 -22
  74. package/chunks/{exitPlanMode-AHOUO44D.js → exitPlanMode-S35A36II.js} +36 -28
  75. package/chunks/{fr-2CAQEOK6.js → fr-GVKZ27MF.js} +1 -0
  76. package/chunks/{geminiContentGenerator-AXCVDKGI.js → geminiContentGenerator-W7KVATBA.js} +4 -4
  77. package/chunks/{glob-BQPAW3IW.js → glob-WOFF7ECI.js} +26 -23
  78. package/chunks/{grep-2F7BL5TQ.js → grep-MWNYWYWQ.js} +24 -22
  79. package/chunks/{ja-QWL7V6OJ.js → ja-FKZ2WZ4D.js} +1 -0
  80. package/chunks/{keychain-token-storage-ALKQXYJQ.js → keychain-token-storage-CSYMNRPP.js} +2 -2
  81. package/chunks/{loop-wakeup-RX6YIUSG.js → loop-wakeup-DGSMT4N6.js} +5 -5
  82. package/chunks/{ls-6PLNWHMU.js → ls-UGRZ4ZOM.js} +6 -6
  83. package/chunks/{lsp-3HFQU4OF.js → lsp-72IJURW3.js} +2 -2
  84. package/chunks/{monitor-YTTMDFW2.js → monitor-AYUINLYN.js} +24 -22
  85. package/chunks/{notebook-edit-7TNZMTBR.js → notebook-edit-EP4D4WFD.js} +25 -23
  86. package/chunks/{openaiContentGenerator-JA6YXXPI.js → openaiContentGenerator-SLYYF7AM.js} +12 -13
  87. package/chunks/{pt-2SPOLMAY.js → pt-SY5NCFGR.js} +1 -0
  88. package/chunks/{qwenContentGenerator-NBOVGW7B.js → qwenContentGenerator-VZ7JYU4A.js} +27 -25
  89. package/chunks/{qwenOAuth2-XWC5SU63.js → qwenOAuth2-K4AASPCV.js} +5 -4
  90. package/chunks/{read-file-RUBU3KUA.js → read-file-65EQ53KS.js} +9 -8
  91. package/chunks/{ripGrep-TPFC7KZF.js → ripGrep-5XLHJDDM.js} +24 -22
  92. package/chunks/{ru-35IVJTEH.js → ru-FWNXJG4F.js} +1 -0
  93. package/chunks/{scheduler-NTVF45LR.js → scheduler-5GLJSA2H.js} +73 -27
  94. package/chunks/{send-message-IIT3SHA7.js → send-message-URUZ7PLA.js} +24 -4
  95. package/chunks/{serve-J6VG37OX.js → serve-MUROZGCG.js} +7575 -6916
  96. package/chunks/{shell-EQQEHEFI.js → shell-ET3BQWKB.js} +24 -22
  97. package/chunks/{skill-QWRWJCQJ.js → skill-YEYABCAF.js} +11 -10
  98. package/chunks/{src-LNADIG5P.js → src-POVOI65Y.js} +165 -66
  99. package/chunks/{syntheticOutput-H67FYXU7.js → syntheticOutput-65FRJGWM.js} +3 -3
  100. package/chunks/{task-create-OVXHSHAI.js → task-create-IH45HOFT.js} +6 -6
  101. package/chunks/{task-list-QUUCQJ3U.js → task-list-FUB6JWSX.js} +5 -5
  102. package/chunks/{task-stop-WA5DMTKK.js → task-stop-P6IOHQM3.js} +2 -2
  103. package/chunks/{task-update-PC5427TI.js → task-update-RTUT7LJV.js} +6 -6
  104. package/chunks/{team-create-TXWQL777.js → team-create-EFZFKQFP.js} +28 -26
  105. package/chunks/{team-delete-ZTEMYRJ3.js → team-delete-RXGYRMHC.js} +5 -5
  106. package/chunks/{todoWrite-J6L6ELD6.js → todoWrite-O6JK24G6.js} +4 -4
  107. package/chunks/{tool-search-JAVM7ABF.js → tool-search-BRJC42TE.js} +9 -8
  108. package/chunks/{web-fetch-6XLPPTP7.js → web-fetch-KUMBROUI.js} +4 -4
  109. package/chunks/{workflow-7LN3L6KK.js → workflow-UDRBNFTT.js} +557 -97
  110. package/chunks/{write-file-DAKE7YKB.js → write-file-F7TAHAHF.js} +24 -22
  111. package/chunks/{zh-X4KM6MTW.js → zh-3RMSEO5M.js} +49 -0
  112. package/chunks/{zh-TW-BSG6BUWK.js → zh-TW-R7WRLTJS.js} +49 -0
  113. package/cli.js +9205 -5426
  114. package/locales/ca.js +2 -1
  115. package/locales/de.js +1 -0
  116. package/locales/en.js +70 -0
  117. package/locales/fr.js +1 -0
  118. package/locales/ja.js +1 -0
  119. package/locales/pt.js +1 -0
  120. package/locales/ru.js +1 -0
  121. package/locales/zh-TW.js +67 -0
  122. package/locales/zh.js +67 -0
  123. package/package.json +3 -2
  124. package/web-shell/assets/{arc-CRFN10gD.js → arc-DHUeMnnj.js} +1 -1
  125. package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
  126. package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
  127. package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
  128. package/web-shell/assets/channel-C3WhMjjP.js +1 -0
  129. package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
  130. package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
  131. package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
  132. package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
  133. package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
  134. package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
  135. package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
  136. package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DVCQST3O.js} +1 -1
  137. package/web-shell/assets/classDiagram-4FO5ZUOK-CQ6TXPif.js +1 -0
  138. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ6TXPif.js +1 -0
  139. package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
  140. package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
  141. package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
  142. package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
  143. package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
  144. package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
  145. package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
  146. package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
  147. package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
  148. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
  149. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-DJxdu2YS.js} +1 -1
  150. package/web-shell/assets/index-BPnhI7gl.css +1 -0
  151. package/web-shell/assets/index-De4rqTsW.js +706 -0
  152. package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
  153. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
  154. package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
  155. package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
  156. package/web-shell/assets/{linear-DpyMbKqT.js → linear-D2m9-ODE.js} +1 -1
  157. package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-dTtkZp2F.js} +5 -5
  158. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
  159. package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
  160. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
  161. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
  162. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
  163. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
  164. package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-DixFVzEs.js} +1 -1
  165. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DZgE04s3.js +1 -0
  166. package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
  167. package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
  168. package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
  169. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
  170. package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
  171. package/web-shell/index.html +3 -3
  172. package/chunks/chunk-77WXWU44.js +0 -26
  173. package/chunks/contextCommand-POQ6GYN3.js +0 -54
  174. package/web-shell/assets/channel-WwImfsc7.js +0 -1
  175. package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
  176. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
  177. package/web-shell/assets/index-BDZiTAkl.css +0 -1
  178. package/web-shell/assets/index-DaebdpHq.js +0 -516
  179. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +0 -1
@@ -2,37 +2,38 @@
2
2
  "use strict";
3
3
  import {
4
4
  RequestTokenizer
5
- } from "./chunk-IUEQOXOI.js";
5
+ } from "./chunk-KBXLIVWQ.js";
6
6
  import {
7
7
  OpenAIContentConverter,
8
8
  TaggedThinkingParser,
9
9
  openaiRequestCaptureContext
10
- } from "./chunk-6Z2MVJIJ.js";
10
+ } from "./chunk-UMRZ7XCR.js";
11
11
  import {
12
12
  createChildAbortController
13
13
  } from "./chunk-64WXLC72.js";
14
- import {
15
- buildRuntimeFetchOptions,
16
- redactProxyError
17
- } from "./chunk-HU3RKEK2.js";
18
14
  import {
19
15
  CAPPED_DEFAULT_MAX_TOKENS,
20
16
  DASHSCOPE_PROXY_BASE_URL,
21
17
  DEFAULT_DASHSCOPE_BASE_URL,
22
18
  DEFAULT_MAX_RETRIES,
23
19
  DEFAULT_TIMEOUT,
20
+ buildRuntimeFetchOptions,
24
21
  hasExplicitOutputLimit,
25
- runtimeDiagnostics,
26
- safeJsonParse,
22
+ parsePositiveIntegerEnvValue,
23
+ redactProxyError,
27
24
  tokenLimit
28
- } from "./chunk-PTGKSUUJ.js";
25
+ } from "./chunk-F6XNTYNE.js";
26
+ import {
27
+ runtimeDiagnostics,
28
+ safeJsonParse
29
+ } from "./chunk-CGEGHF2C.js";
29
30
  import {
30
31
  GenerateContentResponse
31
32
  } from "./chunk-55ZMG67I.js";
32
33
  import {
33
34
  createDebugLogger,
34
35
  isAbortError
35
- } from "./chunk-IKOWINH4.js";
36
+ } from "./chunk-C4K3FEQ2.js";
36
37
  import {
37
38
  init_esbuild_shims
38
39
  } from "./chunk-A4BMJM77.js";
@@ -7025,9 +7026,10 @@ var DefaultOpenAICompatibleProvider = class {
7025
7026
  effectiveMaxTokens = userMaxTokens;
7026
7027
  }
7027
7028
  } else {
7028
- const envVal = process.env["QWEN_CODE_MAX_OUTPUT_TOKENS"];
7029
- const envMaxTokens = envVal ? parseInt(envVal, 10) : NaN;
7030
- if (!isNaN(envMaxTokens) && envMaxTokens > 0) {
7029
+ const envMaxTokens = parsePositiveIntegerEnvValue(
7030
+ process.env["QWEN_CODE_MAX_OUTPUT_TOKENS"]
7031
+ );
7032
+ if (envMaxTokens !== void 0) {
7031
7033
  effectiveMaxTokens = isKnownModel ? Math.min(envMaxTokens, modelLimit) : envMaxTokens;
7032
7034
  } else {
7033
7035
  effectiveMaxTokens = Math.min(modelLimit, CAPPED_DEFAULT_MAX_TOKENS);
@@ -7049,7 +7051,14 @@ var ModelScopeOpenAICompatibleProvider = class extends DefaultOpenAICompatiblePr
7049
7051
  * Checks if the configuration is for ModelScope.
7050
7052
  */
7051
7053
  static isModelScopeProvider(config) {
7052
- return !!config.baseUrl?.includes("modelscope");
7054
+ const baseUrl = config.baseUrl ?? "";
7055
+ if (!baseUrl) return false;
7056
+ try {
7057
+ const hostname = new URL(baseUrl).hostname.toLowerCase();
7058
+ return hostname === "modelscope.cn" || hostname.endsWith(".modelscope.cn");
7059
+ } catch {
7060
+ return false;
7061
+ }
7053
7062
  }
7054
7063
  /**
7055
7064
  * ModelScope does not support `stream_options` when `stream` is false.
@@ -7165,7 +7174,10 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7165
7174
  buildRequest(request, userPromptId) {
7166
7175
  let messages = request.messages;
7167
7176
  let tools = request.tools;
7168
- if (this.shouldEnableCacheControl()) {
7177
+ const flattenPlainTextForGlm = this.isGlmModel(request.model) && !this.hasFunctionCallingContext(request);
7178
+ if (flattenPlainTextForGlm) {
7179
+ messages = this.flattenTextContent(messages);
7180
+ } else if (this.shouldEnableCacheControl()) {
7169
7181
  const { messages: updatedMessages, tools: updatedTools } = this.addDashScopeCacheControl(
7170
7182
  request,
7171
7183
  request.stream ? "all" : "system_only"
@@ -7183,6 +7195,12 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7183
7195
  ...this.buildMetadata(userPromptId) || {},
7184
7196
  /* @ts-expect-error dashscope exclusive */
7185
7197
  vl_high_resolution_images: true,
7198
+ // Default-on for supported reasoning models; user extra_body wins.
7199
+ // Several vision models (e.g. qwen3.6-plus, qwen3.7-plus) are reasoning
7200
+ // models that need this flag for multi-turn reasoning continuity.
7201
+ // (No @ts-expect-error needed: TS flags only the first excess property
7202
+ // in this cast, already suppressed on vl_high_resolution_images above.)
7203
+ preserve_thinking: true,
7186
7204
  ...extraBody ? extraBody : {}
7187
7205
  };
7188
7206
  }
@@ -7192,6 +7210,9 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7192
7210
  messages,
7193
7211
  ...tools ? { tools } : {},
7194
7212
  ...this.buildMetadata(userPromptId) || {},
7213
+ // Default-on for supported reasoning models; user extra_body wins.
7214
+ /* @ts-expect-error dashscope exclusive */
7215
+ preserve_thinking: true,
7195
7216
  ...extraBody ? extraBody : {}
7196
7217
  };
7197
7218
  }
@@ -7280,6 +7301,63 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7280
7301
  };
7281
7302
  return contentArray;
7282
7303
  }
7304
+ /**
7305
+ * True for glm-* models (e.g. glm-4.5, glm-5.2). Uses the same `^glm-` prefix
7306
+ * convention as the GLM matchers in tokenLimits.ts, keeping model detection
7307
+ * consistent across the codebase.
7308
+ */
7309
+ isGlmModel(model) {
7310
+ return !!model && model.toLowerCase().startsWith("glm-");
7311
+ }
7312
+ /**
7313
+ * Whether the request is in "function-calling mode" — it declares `tools`, or
7314
+ * its history already contains a tool result / assistant tool_call. glm needs
7315
+ * one of these present to parse structured content-part arrays.
7316
+ */
7317
+ hasFunctionCallingContext(request) {
7318
+ if (request.tools && request.tools.length > 0) {
7319
+ return true;
7320
+ }
7321
+ return request.messages.some((message) => {
7322
+ if (message.role === "tool") {
7323
+ return true;
7324
+ }
7325
+ if (message.role === "assistant") {
7326
+ const toolCalls = message.tool_calls;
7327
+ return Array.isArray(toolCalls) && toolCalls.length > 0;
7328
+ }
7329
+ return false;
7330
+ });
7331
+ }
7332
+ /**
7333
+ * Collapse text-only content arrays back to a plain string, leaving
7334
+ * media-bearing parts (image/audio/...) as arrays. Used for glm tool-less
7335
+ * requests, where the array form would otherwise be dropped server-side.
7336
+ * Multiple text parts are joined with a blank line, matching the DeepSeek
7337
+ * provider's flattening (separate parts read as separate blocks).
7338
+ * Only called on the flatten branch, which skips cache control, so no part
7339
+ * here carries a `cache_control` marker.
7340
+ */
7341
+ flattenTextContent(messages) {
7342
+ return messages.map((message) => {
7343
+ if (!("content" in message) || !Array.isArray(message.content)) {
7344
+ return message;
7345
+ }
7346
+ const parts = message.content;
7347
+ if (parts.length === 0) {
7348
+ return message;
7349
+ }
7350
+ const isTextOnly = parts.every((part) => part && part.type === "text");
7351
+ if (!isTextOnly) {
7352
+ return message;
7353
+ }
7354
+ const text = parts.map((part) => part.text ?? "").join("\n\n");
7355
+ return {
7356
+ ...message,
7357
+ content: text
7358
+ };
7359
+ });
7360
+ }
7283
7361
  /**
7284
7362
  * Vision-capable model patterns.
7285
7363
  * Supports exact matches and prefix patterns for easy extension.
@@ -7459,29 +7537,6 @@ function translateReasoningEffort(request) {
7459
7537
  }
7460
7538
  __name(translateReasoningEffort, "translateReasoningEffort");
7461
7539
 
7462
- // packages/core/src/core/openaiContentGenerator/provider/openrouter.ts
7463
- init_esbuild_shims();
7464
- var OpenRouterOpenAICompatibleProvider = class extends DefaultOpenAICompatibleProvider {
7465
- static {
7466
- __name(this, "OpenRouterOpenAICompatibleProvider");
7467
- }
7468
- constructor(contentGeneratorConfig, cliConfig) {
7469
- super(contentGeneratorConfig, cliConfig);
7470
- }
7471
- static isOpenRouterProvider(contentGeneratorConfig) {
7472
- const baseURL = contentGeneratorConfig.baseUrl || "";
7473
- return baseURL.includes("openrouter.ai");
7474
- }
7475
- buildHeaders() {
7476
- const baseHeaders = super.buildHeaders();
7477
- return {
7478
- ...baseHeaders,
7479
- "HTTP-Referer": "https://github.com/QwenLM/qwen-code.git",
7480
- "X-OpenRouter-Title": "Qwen Code"
7481
- };
7482
- }
7483
- };
7484
-
7485
7540
  // packages/core/src/core/openaiContentGenerator/provider/minimax.ts
7486
7541
  init_esbuild_shims();
7487
7542
  var MINIMAX_KNOWN_HOSTS = ["api.minimaxi.com", "api.minimax.io"];
@@ -8474,12 +8529,6 @@ function determineProvider(contentGeneratorConfig, cliConfig) {
8474
8529
  if (MiMoOpenAICompatibleProvider.isMiMoProvider(config)) {
8475
8530
  return new MiMoOpenAICompatibleProvider(contentGeneratorConfig, cliConfig);
8476
8531
  }
8477
- if (OpenRouterOpenAICompatibleProvider.isOpenRouterProvider(config)) {
8478
- return new OpenRouterOpenAICompatibleProvider(
8479
- contentGeneratorConfig,
8480
- cliConfig
8481
- );
8482
- }
8483
8532
  if (ModelScopeOpenAICompatibleProvider.isModelScopeProvider(config)) {
8484
8533
  return new ModelScopeOpenAICompatibleProvider(
8485
8534
  contentGeneratorConfig,
@@ -8505,7 +8554,6 @@ __name(determineProvider, "determineProvider");
8505
8554
  export {
8506
8555
  DashScopeOpenAICompatibleProvider,
8507
8556
  DeepSeekOpenAICompatibleProvider,
8508
- OpenRouterOpenAICompatibleProvider,
8509
8557
  MiniMaxOpenAICompatibleProvider,
8510
8558
  MistralOpenAICompatibleProvider,
8511
8559
  MiMoOpenAICompatibleProvider,
@@ -3,17 +3,17 @@
3
3
  import {
4
4
  getInboxesDir,
5
5
  require_proper_lockfile
6
- } from "./chunk-M5VYHAHT.js";
6
+ } from "./chunk-2BIF2NVV.js";
7
7
  import {
8
8
  Mutex
9
9
  } from "./chunk-OMX7CUOE.js";
10
10
  import {
11
11
  atomicWriteJSON
12
- } from "./chunk-N5QHMPZU.js";
12
+ } from "./chunk-3UALQ56H.js";
13
13
  import {
14
14
  createDebugLogger,
15
15
  isNodeError
16
- } from "./chunk-IKOWINH4.js";
16
+ } from "./chunk-C4K3FEQ2.js";
17
17
  import {
18
18
  init_esbuild_shims
19
19
  } from "./chunk-A4BMJM77.js";