@qwen-code/qwen-code 0.18.5 → 0.19.1-nightly.20260624.a234860a4

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 (165) 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 +68 -48
  4. package/bundled/qc-helper/docs/configuration/model-providers.md +217 -195
  5. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
  6. package/bundled/qc-helper/docs/configuration/settings.md +44 -27
  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/arena.md +3 -3
  11. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  12. package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
  13. package/bundled/qc-helper/docs/features/commands.md +6 -1
  14. package/bundled/qc-helper/docs/features/headless.md +1 -1
  15. package/bundled/qc-helper/docs/features/mcp.md +33 -14
  16. package/bundled/qc-helper/docs/features/sandbox.md +2 -2
  17. package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
  18. package/bundled/qc-helper/docs/integration-github-action.md +2 -2
  19. package/bundled/qc-helper/docs/overview.md +1 -1
  20. package/bundled/qc-helper/docs/quickstart.md +9 -5
  21. package/bundled/qc-helper/docs/qwen-serve.md +14 -2
  22. package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
  23. package/chunks/{agent-2TEY55UD.js → agent-6KV474S5.js} +24 -22
  24. package/chunks/{agent-headless-SCUAXEEE.js → agent-headless-XO7MM6JT.js} +24 -22
  25. package/chunks/{anthropicContentGenerator-5S4OMMNL.js → anthropicContentGenerator-7352A7I5.js} +12 -11
  26. package/chunks/artifact-tool-5J4HUZAV.js +675 -0
  27. package/chunks/{askUserQuestion-WHVYL2S2.js → askUserQuestion-HF7HCWDD.js} +20 -7
  28. package/chunks/chunk-22IFUCVR.js +291 -0
  29. package/chunks/{chunk-26ZYKTYZ.js → chunk-2BIF2NVV.js} +2 -2
  30. package/chunks/{chunk-VKILGMZQ.js → chunk-2QDQTWCI.js} +1 -1
  31. package/chunks/{chunk-XGU3ETVO.js → chunk-3BR4OIOE.js} +3 -3
  32. package/chunks/{chunk-LTN3VYMZ.js → chunk-3UALQ56H.js} +1 -1
  33. package/chunks/{chunk-F5E6IKYN.js → chunk-54J4JDWT.js} +619 -135
  34. package/chunks/{chunk-KZGQ3G3Q.js → chunk-76BDT2HH.js} +80 -83
  35. package/chunks/{chunk-VECKCOH6.js → chunk-7QBKO4A6.js} +7118 -5113
  36. package/chunks/{chunk-MSJ2MXJ6.js → chunk-BGUDAULQ.js} +11 -290
  37. package/chunks/{chunk-FH4P6RQA.js → chunk-BNXANYLH.js} +1 -1
  38. package/chunks/{chunk-SIJKWK35.js → chunk-C4JC2FL3.js} +8 -7
  39. package/chunks/{chunk-WE6TNQJU.js → chunk-C4K3FEQ2.js} +36 -0
  40. package/chunks/{chunk-G4BUMVEY.js → chunk-CGEGHF2C.js} +2 -217
  41. package/chunks/chunk-EEEZIVFJ.js +908 -0
  42. package/chunks/chunk-EJYJYJZ2.js +3703 -0
  43. package/chunks/{chunk-ATLUHLZE.js → chunk-EW6C27XX.js} +1 -1
  44. package/chunks/{chunk-42HGOMED.js → chunk-F6XNTYNE.js} +216 -1
  45. package/chunks/{chunk-C6MI2ASN.js → chunk-GZCJS5WH.js} +2 -2
  46. package/chunks/{chunk-KGV3F6UF.js → chunk-HGNSRCRB.js} +1 -1
  47. package/chunks/{chunk-2CNO5W47.js → chunk-HNYTRFAM.js} +171 -5016
  48. package/chunks/{chunk-CX3SGIPK.js → chunk-KBXLIVWQ.js} +2 -2
  49. package/chunks/{chunk-GOMVJKBL.js → chunk-L7U2RI5O.js} +59 -57
  50. package/chunks/{chunk-GBN55AWZ.js → chunk-NKJ6LRCR.js} +2 -2
  51. package/chunks/{chunk-2O3NAOJG.js → chunk-NWLUISRA.js} +1 -1
  52. package/chunks/{chunk-ID533GA3.js → chunk-OTBK43JR.js} +1 -1
  53. package/chunks/{chunk-AE6RQU6F.js → chunk-PRYMDRBV.js} +1 -1
  54. package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
  55. package/chunks/{chunk-CTHZVIMD.js → chunk-T2VDEFUU.js} +2 -2
  56. package/chunks/{chunk-C7JA3XCX.js → chunk-TKXRLRTF.js} +5 -5
  57. package/chunks/{chunk-LF6BKGZT.js → chunk-TXVGVZYR.js} +3 -3
  58. package/chunks/{chunk-XU7BKR3B.js → chunk-XU5P23GN.js} +3 -3
  59. package/chunks/{computer-use-OB3C5QG2.js → computer-use-WOKHYISX.js} +24 -22
  60. package/chunks/contextCommand-JSYQAO3O.js +56 -0
  61. package/chunks/{cron-create-THNDTYXU.js → cron-create-A5637KCI.js} +12 -9
  62. package/chunks/{cron-delete-BS5H6TFJ.js → cron-delete-AADOSEOZ.js} +4 -4
  63. package/chunks/{cron-list-7OBVHT7K.js → cron-list-OFCPTT2Y.js} +4 -4
  64. package/chunks/{dist-GKRNVFBH.js → dist-ZBX7LPJZ.js} +2 -1
  65. package/chunks/{edit-GNCLIF67.js → edit-6EN6NO6G.js} +24 -22
  66. package/chunks/{en-S3OQBISC.js → en-7OGNWWME.js} +48 -0
  67. package/chunks/{enter-worktree-E7BNZOGT.js → enter-worktree-XJ4S74CL.js} +24 -22
  68. package/chunks/{enterPlanMode-IA42A5EU.js → enterPlanMode-GQNQIH2V.js} +27 -23
  69. package/chunks/{exit-worktree-QJ2K74UT.js → exit-worktree-6MKLATVB.js} +24 -22
  70. package/chunks/{exitPlanMode-UKKHBUYJ.js → exitPlanMode-YACWA5GO.js} +36 -28
  71. package/chunks/{geminiContentGenerator-ICSDM37U.js → geminiContentGenerator-OLJGOIWO.js} +4 -4
  72. package/chunks/{glob-IGD7LWYX.js → glob-YHSIN2LG.js} +26 -23
  73. package/chunks/{grep-IZM3IVND.js → grep-5EMEAJBO.js} +24 -22
  74. package/chunks/{keychain-token-storage-YHXIWXIB.js → keychain-token-storage-CSYMNRPP.js} +2 -2
  75. package/chunks/{loop-wakeup-SSBWZ64K.js → loop-wakeup-DGSMT4N6.js} +5 -5
  76. package/chunks/{ls-YPFUHZRQ.js → ls-UGRZ4ZOM.js} +6 -6
  77. package/chunks/{lsp-FD6DNVAF.js → lsp-72IJURW3.js} +2 -2
  78. package/chunks/{monitor-ALJNE3R4.js → monitor-ZGXTGINM.js} +24 -22
  79. package/chunks/{notebook-edit-7XRZX55T.js → notebook-edit-O7WO3APR.js} +25 -23
  80. package/chunks/{openaiContentGenerator-FWKITDFJ.js → openaiContentGenerator-N4FCEGU2.js} +12 -15
  81. package/chunks/{qwenContentGenerator-5RPGQZ63.js → qwenContentGenerator-BOAZ7MMG.js} +26 -24
  82. package/chunks/{qwenOAuth2-WZ54YZ4J.js → qwenOAuth2-K4AASPCV.js} +5 -4
  83. package/chunks/{read-file-4WN2DT5N.js → read-file-RB35MI5I.js} +9 -8
  84. package/chunks/{ripGrep-4ZKT6KBQ.js → ripGrep-CWJOA6JG.js} +24 -22
  85. package/chunks/{scheduler-O2E65VDK.js → scheduler-XUBHNI2Z.js} +73 -27
  86. package/chunks/{send-message-FWFTX62Q.js → send-message-URUZ7PLA.js} +24 -4
  87. package/chunks/{serve-3DM6CRGD.js → serve-P356SCA2.js} +618 -92
  88. package/chunks/{shell-ARVZK6RF.js → shell-5TRHTPML.js} +24 -22
  89. package/chunks/{skill-BFUBGA4I.js → skill-RW6N7GHL.js} +11 -10
  90. package/chunks/{src-5YMCDSII.js → src-SPEHQKTK.js} +140 -67
  91. package/chunks/{syntheticOutput-JY5NEDTV.js → syntheticOutput-65FRJGWM.js} +3 -3
  92. package/chunks/{task-create-IGILDV25.js → task-create-IH45HOFT.js} +6 -6
  93. package/chunks/{task-list-KBEJVAAG.js → task-list-FUB6JWSX.js} +5 -5
  94. package/chunks/{task-stop-WFTMQ6AC.js → task-stop-P6IOHQM3.js} +2 -2
  95. package/chunks/{task-update-UIVX7ZEV.js → task-update-RTUT7LJV.js} +6 -6
  96. package/chunks/{team-create-HRBV5ATK.js → team-create-D6GSPXCO.js} +28 -26
  97. package/chunks/{team-delete-LPOXDPVB.js → team-delete-RXGYRMHC.js} +5 -5
  98. package/chunks/{todoWrite-R4RIJKOD.js → todoWrite-O6JK24G6.js} +4 -4
  99. package/chunks/{tool-search-67HI54YA.js → tool-search-6YIMUUVD.js} +9 -8
  100. package/chunks/{web-fetch-JU7SS6KE.js → web-fetch-KUMBROUI.js} +4 -4
  101. package/chunks/{workflow-W4SCLWLU.js → workflow-ML3XFTCN.js} +557 -97
  102. package/chunks/{write-file-TLNXC2NR.js → write-file-VLT6ODLK.js} +24 -22
  103. package/chunks/{zh-QXLZV2PX.js → zh-3RMSEO5M.js} +48 -0
  104. package/chunks/{zh-TW-3OKU7LDA.js → zh-TW-R7WRLTJS.js} +48 -0
  105. package/cli.js +8559 -5100
  106. package/locales/en.js +69 -0
  107. package/locales/zh-TW.js +66 -0
  108. package/locales/zh.js +66 -0
  109. package/package.json +3 -2
  110. package/web-shell/assets/{arc-CRFN10gD.js → arc-DHUeMnnj.js} +1 -1
  111. package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
  112. package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
  113. package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
  114. package/web-shell/assets/channel-C3WhMjjP.js +1 -0
  115. package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
  116. package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
  117. package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
  118. package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
  119. package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
  120. package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
  121. package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
  122. package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DVCQST3O.js} +1 -1
  123. package/web-shell/assets/classDiagram-4FO5ZUOK-CQ6TXPif.js +1 -0
  124. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ6TXPif.js +1 -0
  125. package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
  126. package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
  127. package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
  128. package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
  129. package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
  130. package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
  131. package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
  132. package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
  133. package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
  134. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
  135. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-DJxdu2YS.js} +1 -1
  136. package/web-shell/assets/index-BPnhI7gl.css +1 -0
  137. package/web-shell/assets/index-De4rqTsW.js +706 -0
  138. package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
  139. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
  140. package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
  141. package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
  142. package/web-shell/assets/{linear-DpyMbKqT.js → linear-D2m9-ODE.js} +1 -1
  143. package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-dTtkZp2F.js} +5 -5
  144. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
  145. package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
  146. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
  147. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
  148. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
  149. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
  150. package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-DixFVzEs.js} +1 -1
  151. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DZgE04s3.js +1 -0
  152. package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
  153. package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
  154. package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
  155. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
  156. package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
  157. package/web-shell/index.html +3 -3
  158. package/chunks/chunk-77WXWU44.js +0 -26
  159. package/chunks/contextCommand-3327KUC4.js +0 -54
  160. package/web-shell/assets/channel-WwImfsc7.js +0 -1
  161. package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
  162. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
  163. package/web-shell/assets/index-BDZiTAkl.css +0 -1
  164. package/web-shell/assets/index-DaebdpHq.js +0 -516
  165. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +0 -1
@@ -2,38 +2,38 @@
2
2
  "use strict";
3
3
  import {
4
4
  RequestTokenizer
5
- } from "./chunk-CX3SGIPK.js";
5
+ } from "./chunk-KBXLIVWQ.js";
6
6
  import {
7
7
  OpenAIContentConverter,
8
8
  TaggedThinkingParser,
9
9
  openaiRequestCaptureContext
10
- } from "./chunk-2CNO5W47.js";
10
+ } from "./chunk-HNYTRFAM.js";
11
11
  import {
12
12
  createChildAbortController
13
13
  } from "./chunk-64WXLC72.js";
14
- import {
15
- buildRuntimeFetchOptions,
16
- redactProxyError
17
- } from "./chunk-42HGOMED.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
22
  parsePositiveIntegerEnvValue,
26
- runtimeDiagnostics,
27
- safeJsonParse,
23
+ redactProxyError,
28
24
  tokenLimit
29
- } from "./chunk-G4BUMVEY.js";
25
+ } from "./chunk-F6XNTYNE.js";
26
+ import {
27
+ runtimeDiagnostics,
28
+ safeJsonParse
29
+ } from "./chunk-CGEGHF2C.js";
30
30
  import {
31
31
  GenerateContentResponse
32
32
  } from "./chunk-55ZMG67I.js";
33
33
  import {
34
34
  createDebugLogger,
35
35
  isAbortError
36
- } from "./chunk-WE6TNQJU.js";
36
+ } from "./chunk-C4K3FEQ2.js";
37
37
  import {
38
38
  init_esbuild_shims
39
39
  } from "./chunk-A4BMJM77.js";
@@ -7174,7 +7174,10 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7174
7174
  buildRequest(request, userPromptId) {
7175
7175
  let messages = request.messages;
7176
7176
  let tools = request.tools;
7177
- 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()) {
7178
7181
  const { messages: updatedMessages, tools: updatedTools } = this.addDashScopeCacheControl(
7179
7182
  request,
7180
7183
  request.stream ? "all" : "system_only"
@@ -7192,6 +7195,12 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7192
7195
  ...this.buildMetadata(userPromptId) || {},
7193
7196
  /* @ts-expect-error dashscope exclusive */
7194
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,
7195
7204
  ...extraBody ? extraBody : {}
7196
7205
  };
7197
7206
  }
@@ -7201,6 +7210,9 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7201
7210
  messages,
7202
7211
  ...tools ? { tools } : {},
7203
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,
7204
7216
  ...extraBody ? extraBody : {}
7205
7217
  };
7206
7218
  }
@@ -7289,6 +7301,63 @@ var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider
7289
7301
  };
7290
7302
  return contentArray;
7291
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
+ }
7292
7361
  /**
7293
7362
  * Vision-capable model patterns.
7294
7363
  * Supports exact matches and prefix patterns for easy extension.
@@ -7468,64 +7537,6 @@ function translateReasoningEffort(request) {
7468
7537
  }
7469
7538
  __name(translateReasoningEffort, "translateReasoningEffort");
7470
7539
 
7471
- // packages/core/src/core/openaiContentGenerator/provider/openrouter.ts
7472
- init_esbuild_shims();
7473
- var OpenRouterOpenAICompatibleProvider = class extends DefaultOpenAICompatibleProvider {
7474
- static {
7475
- __name(this, "OpenRouterOpenAICompatibleProvider");
7476
- }
7477
- constructor(contentGeneratorConfig, cliConfig) {
7478
- super(contentGeneratorConfig, cliConfig);
7479
- }
7480
- static isOpenRouterProvider(contentGeneratorConfig) {
7481
- const baseURL = contentGeneratorConfig.baseUrl ?? "";
7482
- if (!baseURL) return false;
7483
- try {
7484
- const hostname = new URL(baseURL).hostname.toLowerCase();
7485
- return hostname === "openrouter.ai" || hostname.endsWith(".openrouter.ai");
7486
- } catch {
7487
- return false;
7488
- }
7489
- }
7490
- buildHeaders() {
7491
- const baseHeaders = super.buildHeaders();
7492
- return {
7493
- ...baseHeaders,
7494
- "HTTP-Referer": "https://github.com/QwenLM/qwen-code.git",
7495
- "X-OpenRouter-Title": "Qwen Code"
7496
- };
7497
- }
7498
- };
7499
-
7500
- // packages/core/src/core/openaiContentGenerator/provider/requesty.ts
7501
- init_esbuild_shims();
7502
- var RequestyOpenAICompatibleProvider = class extends DefaultOpenAICompatibleProvider {
7503
- static {
7504
- __name(this, "RequestyOpenAICompatibleProvider");
7505
- }
7506
- constructor(contentGeneratorConfig, cliConfig) {
7507
- super(contentGeneratorConfig, cliConfig);
7508
- }
7509
- static isRequestyProvider(contentGeneratorConfig) {
7510
- const baseURL = contentGeneratorConfig.baseUrl || "";
7511
- if (!baseURL) return false;
7512
- try {
7513
- const host = new URL(baseURL).hostname.toLowerCase();
7514
- return host === "router.requesty.ai" || host.endsWith(".requesty.ai");
7515
- } catch {
7516
- return false;
7517
- }
7518
- }
7519
- buildHeaders() {
7520
- const baseHeaders = super.buildHeaders();
7521
- return {
7522
- ...baseHeaders,
7523
- "HTTP-Referer": "https://github.com/QwenLM/qwen-code.git",
7524
- "X-Title": "Qwen Code"
7525
- };
7526
- }
7527
- };
7528
-
7529
7540
  // packages/core/src/core/openaiContentGenerator/provider/minimax.ts
7530
7541
  init_esbuild_shims();
7531
7542
  var MINIMAX_KNOWN_HOSTS = ["api.minimaxi.com", "api.minimax.io"];
@@ -8518,18 +8529,6 @@ function determineProvider(contentGeneratorConfig, cliConfig) {
8518
8529
  if (MiMoOpenAICompatibleProvider.isMiMoProvider(config)) {
8519
8530
  return new MiMoOpenAICompatibleProvider(contentGeneratorConfig, cliConfig);
8520
8531
  }
8521
- if (OpenRouterOpenAICompatibleProvider.isOpenRouterProvider(config)) {
8522
- return new OpenRouterOpenAICompatibleProvider(
8523
- contentGeneratorConfig,
8524
- cliConfig
8525
- );
8526
- }
8527
- if (RequestyOpenAICompatibleProvider.isRequestyProvider(config)) {
8528
- return new RequestyOpenAICompatibleProvider(
8529
- contentGeneratorConfig,
8530
- cliConfig
8531
- );
8532
- }
8533
8532
  if (ModelScopeOpenAICompatibleProvider.isModelScopeProvider(config)) {
8534
8533
  return new ModelScopeOpenAICompatibleProvider(
8535
8534
  contentGeneratorConfig,
@@ -8555,8 +8554,6 @@ __name(determineProvider, "determineProvider");
8555
8554
  export {
8556
8555
  DashScopeOpenAICompatibleProvider,
8557
8556
  DeepSeekOpenAICompatibleProvider,
8558
- OpenRouterOpenAICompatibleProvider,
8559
- RequestyOpenAICompatibleProvider,
8560
8557
  MiniMaxOpenAICompatibleProvider,
8561
8558
  MistralOpenAICompatibleProvider,
8562
8559
  MiMoOpenAICompatibleProvider,