@qwen-code/qwen-code 0.18.5 → 0.19.1

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 (145) hide show
  1. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
  2. package/bundled/qc-helper/docs/configuration/settings.md +15 -14
  3. package/bundled/qc-helper/docs/extension/introduction.md +24 -6
  4. package/bundled/qc-helper/docs/features/mcp.md +15 -8
  5. package/chunks/{agent-2TEY55UD.js → agent-7CZOLKXM.js} +24 -22
  6. package/chunks/{agent-headless-SCUAXEEE.js → agent-headless-K37PBQK5.js} +24 -22
  7. package/chunks/{anthropicContentGenerator-5S4OMMNL.js → anthropicContentGenerator-6MCH4X6S.js} +12 -11
  8. package/chunks/artifact-tool-PBX64YTT.js +675 -0
  9. package/chunks/{askUserQuestion-WHVYL2S2.js → askUserQuestion-5ZQOWSRT.js} +20 -7
  10. package/chunks/chunk-22IFUCVR.js +291 -0
  11. package/chunks/{chunk-XGU3ETVO.js → chunk-255L5QYW.js} +3 -3
  12. package/chunks/{chunk-26ZYKTYZ.js → chunk-2BIF2NVV.js} +2 -2
  13. package/chunks/{chunk-VECKCOH6.js → chunk-2X2WXY6L.js} +6104 -4673
  14. package/chunks/{chunk-LTN3VYMZ.js → chunk-3UALQ56H.js} +1 -1
  15. package/chunks/{chunk-2O3NAOJG.js → chunk-57XRIZVC.js} +1 -1
  16. package/chunks/{chunk-MSJ2MXJ6.js → chunk-BGUDAULQ.js} +11 -290
  17. package/chunks/{chunk-FH4P6RQA.js → chunk-BNXANYLH.js} +1 -1
  18. package/chunks/{chunk-WE6TNQJU.js → chunk-C4K3FEQ2.js} +36 -0
  19. package/chunks/{chunk-G4BUMVEY.js → chunk-CGEGHF2C.js} +2 -217
  20. package/chunks/chunk-EEEZIVFJ.js +908 -0
  21. package/chunks/chunk-EJYJYJZ2.js +3703 -0
  22. package/chunks/{chunk-ATLUHLZE.js → chunk-EW6C27XX.js} +1 -1
  23. package/chunks/{chunk-SIJKWK35.js → chunk-FXT37TZS.js} +6 -6
  24. package/chunks/{chunk-C6MI2ASN.js → chunk-GZCJS5WH.js} +2 -2
  25. package/chunks/{chunk-KGV3F6UF.js → chunk-HGNSRCRB.js} +1 -1
  26. package/chunks/{chunk-42HGOMED.js → chunk-JDV3VBPY.js} +216 -1
  27. package/chunks/{chunk-CX3SGIPK.js → chunk-JRVB4QUY.js} +2 -2
  28. package/chunks/{chunk-C7JA3XCX.js → chunk-NQDRRVJD.js} +5 -5
  29. package/chunks/{chunk-F5E6IKYN.js → chunk-OJMCOR55.js} +560 -18
  30. package/chunks/{chunk-ID533GA3.js → chunk-OTBK43JR.js} +1 -1
  31. package/chunks/{chunk-GOMVJKBL.js → chunk-PLY4F7QW.js} +5 -3
  32. package/chunks/{chunk-KZGQ3G3Q.js → chunk-PNT7QCLK.js} +80 -83
  33. package/chunks/{chunk-VKILGMZQ.js → chunk-PO5LVPK3.js} +1 -1
  34. package/chunks/{chunk-AE6RQU6F.js → chunk-PRYMDRBV.js} +1 -1
  35. package/chunks/{chunk-GBN55AWZ.js → chunk-QKUAGMGE.js} +2 -2
  36. package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
  37. package/chunks/{chunk-CTHZVIMD.js → chunk-T2VDEFUU.js} +2 -2
  38. package/chunks/{chunk-LF6BKGZT.js → chunk-TXVGVZYR.js} +3 -3
  39. package/chunks/{chunk-XU7BKR3B.js → chunk-XU5P23GN.js} +3 -3
  40. package/chunks/{chunk-2CNO5W47.js → chunk-YMBWB67C.js} +146 -5005
  41. package/chunks/{computer-use-OB3C5QG2.js → computer-use-AY6HODX4.js} +24 -22
  42. package/chunks/contextCommand-KVKJ63NZ.js +56 -0
  43. package/chunks/{cron-create-THNDTYXU.js → cron-create-NHRAAWT5.js} +12 -9
  44. package/chunks/{cron-delete-BS5H6TFJ.js → cron-delete-WGO4PZTF.js} +4 -4
  45. package/chunks/{cron-list-7OBVHT7K.js → cron-list-EY7D3ZUC.js} +4 -4
  46. package/chunks/{dist-GKRNVFBH.js → dist-ZBX7LPJZ.js} +2 -1
  47. package/chunks/{edit-GNCLIF67.js → edit-OXD4P5YK.js} +24 -22
  48. package/chunks/{en-S3OQBISC.js → en-7OGNWWME.js} +48 -0
  49. package/chunks/{enter-worktree-E7BNZOGT.js → enter-worktree-NKNFTLNO.js} +24 -22
  50. package/chunks/{enterPlanMode-IA42A5EU.js → enterPlanMode-7W2FCILY.js} +27 -23
  51. package/chunks/{exit-worktree-QJ2K74UT.js → exit-worktree-NCRZ52XD.js} +24 -22
  52. package/chunks/{exitPlanMode-UKKHBUYJ.js → exitPlanMode-AZIUQQHA.js} +36 -28
  53. package/chunks/{geminiContentGenerator-ICSDM37U.js → geminiContentGenerator-5HKVP4JF.js} +4 -4
  54. package/chunks/{glob-IGD7LWYX.js → glob-VCPO3AQO.js} +26 -23
  55. package/chunks/{grep-IZM3IVND.js → grep-R3W7SG6T.js} +24 -22
  56. package/chunks/{keychain-token-storage-YHXIWXIB.js → keychain-token-storage-CSYMNRPP.js} +2 -2
  57. package/chunks/{loop-wakeup-SSBWZ64K.js → loop-wakeup-XVSDE7QR.js} +5 -5
  58. package/chunks/{ls-YPFUHZRQ.js → ls-LPY3ATQQ.js} +6 -6
  59. package/chunks/{lsp-FD6DNVAF.js → lsp-ZT3AAXIF.js} +2 -2
  60. package/chunks/{monitor-ALJNE3R4.js → monitor-TQCZALTB.js} +24 -22
  61. package/chunks/{notebook-edit-7XRZX55T.js → notebook-edit-RYYGIJTA.js} +25 -23
  62. package/chunks/{openaiContentGenerator-FWKITDFJ.js → openaiContentGenerator-2AUZ47JU.js} +12 -15
  63. package/chunks/{qwenContentGenerator-5RPGQZ63.js → qwenContentGenerator-QM6ENWSO.js} +26 -24
  64. package/chunks/{qwenOAuth2-WZ54YZ4J.js → qwenOAuth2-K4AASPCV.js} +5 -4
  65. package/chunks/{read-file-4WN2DT5N.js → read-file-ZSIMNYPB.js} +9 -8
  66. package/chunks/{ripGrep-4ZKT6KBQ.js → ripGrep-LONCTNP3.js} +24 -22
  67. package/chunks/{scheduler-O2E65VDK.js → scheduler-FMNCHQQH.js} +73 -27
  68. package/chunks/{send-message-FWFTX62Q.js → send-message-447W6NH6.js} +24 -4
  69. package/chunks/{serve-3DM6CRGD.js → serve-XLPTFQOQ.js} +458 -77
  70. package/chunks/{shell-ARVZK6RF.js → shell-G2CEO7D7.js} +24 -22
  71. package/chunks/{skill-BFUBGA4I.js → skill-E5YLTHY3.js} +11 -10
  72. package/chunks/{src-5YMCDSII.js → src-GCZS2DES.js} +112 -67
  73. package/chunks/{syntheticOutput-JY5NEDTV.js → syntheticOutput-GQRDRLGR.js} +3 -3
  74. package/chunks/{task-create-IGILDV25.js → task-create-66DDSTVI.js} +6 -6
  75. package/chunks/{task-list-KBEJVAAG.js → task-list-GOPXRSHG.js} +5 -5
  76. package/chunks/{task-stop-WFTMQ6AC.js → task-stop-M7NKGFX2.js} +2 -2
  77. package/chunks/{task-update-UIVX7ZEV.js → task-update-M5TBHLZV.js} +6 -6
  78. package/chunks/{team-create-HRBV5ATK.js → team-create-RQCITTFK.js} +28 -26
  79. package/chunks/{team-delete-LPOXDPVB.js → team-delete-DKKDS65W.js} +5 -5
  80. package/chunks/{todoWrite-R4RIJKOD.js → todoWrite-4VX7X44D.js} +4 -4
  81. package/chunks/{tool-search-67HI54YA.js → tool-search-2COFGD5N.js} +9 -8
  82. package/chunks/{web-fetch-JU7SS6KE.js → web-fetch-YPP3V4FJ.js} +4 -4
  83. package/chunks/{workflow-W4SCLWLU.js → workflow-A5VAXYUS.js} +557 -97
  84. package/chunks/{write-file-TLNXC2NR.js → write-file-P2RNFLJR.js} +24 -22
  85. package/chunks/{zh-QXLZV2PX.js → zh-3RMSEO5M.js} +48 -0
  86. package/chunks/{zh-TW-3OKU7LDA.js → zh-TW-R7WRLTJS.js} +48 -0
  87. package/cli.js +8200 -4981
  88. package/locales/en.js +69 -0
  89. package/locales/zh-TW.js +66 -0
  90. package/locales/zh.js +66 -0
  91. package/package.json +3 -2
  92. package/web-shell/assets/{arc-CRFN10gD.js → arc-pxOt9B72.js} +1 -1
  93. package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-B9XuYYOT.js} +1 -1
  94. package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-5yK68iu4.js} +1 -1
  95. package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-B1LY-qNI.js} +1 -1
  96. package/web-shell/assets/channel-Cx7egbSX.js +1 -0
  97. package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-DkgXg7cM.js} +1 -1
  98. package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-DdM45KFM.js} +1 -1
  99. package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CmdsDjD4.js} +1 -1
  100. package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-CQ4pJ5GH.js} +1 -1
  101. package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-Dy6UWz37.js} +1 -1
  102. package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-CC8nFqap.js} +1 -1
  103. package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-CkmS7lx7.js} +1 -1
  104. package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DynyqleZ.js} +1 -1
  105. package/web-shell/assets/classDiagram-4FO5ZUOK-CwH_F8cH.js +1 -0
  106. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CwH_F8cH.js +1 -0
  107. package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-DA0fzCsY.js} +1 -1
  108. package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-DHYXRqCo.js} +1 -1
  109. package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DWD6BcPs.js} +1 -1
  110. package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-CX9wnqVc.js} +1 -1
  111. package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BpE8Kbt8.js} +1 -1
  112. package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-DLPcrP0C.js} +1 -1
  113. package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CSUCBsCe.js} +1 -1
  114. package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-d3Z0uMXS.js} +1 -1
  115. package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-C7vj5FX3.js} +1 -1
  116. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-BV9UvDV_.js} +1 -1
  117. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-CoWp0mW4.js} +1 -1
  118. package/web-shell/assets/index-CjTH6cLP.js +516 -0
  119. package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-DUswfJHA.js} +1 -1
  120. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-WidEKukx.js} +1 -1
  121. package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-D7IRK3VN.js} +1 -1
  122. package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-CwFJ6Cja.js} +1 -1
  123. package/web-shell/assets/{linear-DpyMbKqT.js → linear-BQ8GvDRY.js} +1 -1
  124. package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-CwF8A_xO.js} +5 -5
  125. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-TR1s0iZi.js} +1 -1
  126. package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cd91pMl9.js} +1 -1
  127. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-BGxGDNMl.js} +1 -1
  128. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cq3fWmYz.js} +1 -1
  129. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-ChLyGdq0.js} +1 -1
  130. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-tazy79aB.js} +1 -1
  131. package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-dIYLUNSf.js} +1 -1
  132. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-luL7KTiX.js +1 -0
  133. package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-BuENhrC2.js} +1 -1
  134. package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-DLtum9dF.js} +1 -1
  135. package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-Bf7OSF3y.js} +1 -1
  136. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-slMw3OB3.js} +1 -1
  137. package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CdxOm8oC.js} +1 -1
  138. package/web-shell/index.html +1 -1
  139. package/chunks/chunk-77WXWU44.js +0 -26
  140. package/chunks/contextCommand-3327KUC4.js +0 -54
  141. package/web-shell/assets/channel-WwImfsc7.js +0 -1
  142. package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
  143. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
  144. package/web-shell/assets/index-DaebdpHq.js +0 -516
  145. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +0 -1
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-WE6TNQJU.js";
5
+ } from "./chunk-C4K3FEQ2.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-WE6TNQJU.js";
5
+ } from "./chunk-C4K3FEQ2.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -15458,7 +15458,8 @@ var ToolNames = {
15458
15458
  // subset here only goes stale on every cua-driver version bump — review
15459
15459
  // round 1 removed the old ocu-era 9-name list, which still carried
15460
15460
  // `get_app_state` / `perform_secondary_action` that no longer exist.
15461
- WORKFLOW: "workflow"
15461
+ WORKFLOW: "workflow",
15462
+ ARTIFACT: "artifact"
15462
15463
  };
15463
15464
  var ToolDisplayNames = {
15464
15465
  EDIT: "Edit",
@@ -15495,7 +15496,8 @@ var ToolDisplayNames = {
15495
15496
  ENTER_WORKTREE: "EnterWorktree",
15496
15497
  EXIT_WORKTREE: "ExitWorktree",
15497
15498
  // computer_use__* display names are not enumerated here (see ToolNames).
15498
- WORKFLOW: "Workflow"
15499
+ WORKFLOW: "Workflow",
15500
+ ARTIFACT: "Artifact"
15499
15501
  };
15500
15502
  var ToolNamesMigration = {
15501
15503
  search_file_content: ToolNames.GREP,
@@ -2,38 +2,38 @@
2
2
  "use strict";
3
3
  import {
4
4
  RequestTokenizer
5
- } from "./chunk-CX3SGIPK.js";
5
+ } from "./chunk-JRVB4QUY.js";
6
6
  import {
7
7
  OpenAIContentConverter,
8
8
  TaggedThinkingParser,
9
9
  openaiRequestCaptureContext
10
- } from "./chunk-2CNO5W47.js";
10
+ } from "./chunk-YMBWB67C.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-JDV3VBPY.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,
@@ -5,7 +5,7 @@ import {
5
5
  BaseToolInvocation,
6
6
  ToolDisplayNames,
7
7
  ToolNames
8
- } from "./chunk-GOMVJKBL.js";
8
+ } from "./chunk-PLY4F7QW.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-WE6TNQJU.js";
5
+ } from "./chunk-C4K3FEQ2.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createTask
5
- } from "./chunk-XU7BKR3B.js";
5
+ } from "./chunk-XU5P23GN.js";
6
6
  import {
7
7
  resolveActiveTeamName
8
8
  } from "./chunk-LD2XBG6Z.js";
@@ -11,7 +11,7 @@ import {
11
11
  BaseToolInvocation,
12
12
  ToolDisplayNames,
13
13
  ToolNames
14
- } from "./chunk-GOMVJKBL.js";
14
+ } from "./chunk-PLY4F7QW.js";
15
15
  import {
16
16
  init_esbuild_shims
17
17
  } from "./chunk-A4BMJM77.js";
@@ -1,5 +1,8 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
+ import {
4
+ require_lib
5
+ } from "./chunk-EJYJYJZ2.js";
3
6
  import {
4
7
  init_esbuild_shims
5
8
  } from "./chunk-A4BMJM77.js";
@@ -10,7 +13,7 @@ import {
10
13
  } from "./chunk-J2S4EL5Y.js";
11
14
 
12
15
  // node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js
13
- var require_lib = __commonJS({
16
+ var require_lib2 = __commonJS({
14
17
  "node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js"(exports, module) {
15
18
  "use strict";
16
19
  init_esbuild_shims();
@@ -1887,7 +1890,7 @@ var require_URL = __commonJS({
1887
1890
  "node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js"(exports, module) {
1888
1891
  "use strict";
1889
1892
  init_esbuild_shims();
1890
- var conversions = require_lib();
1893
+ var conversions = require_lib2();
1891
1894
  var utils = require_utils();
1892
1895
  var Impl = require_URL_impl();
1893
1896
  var impl = utils.implSymbol;
@@ -2083,8 +2086,60 @@ var require_public_api = __commonJS({
2083
2086
  }
2084
2087
  });
2085
2088
 
2089
+ // node_modules/encoding/lib/encoding.js
2090
+ var require_encoding = __commonJS({
2091
+ "node_modules/encoding/lib/encoding.js"(exports, module) {
2092
+ "use strict";
2093
+ init_esbuild_shims();
2094
+ var iconvLite = require_lib();
2095
+ module.exports.convert = convert;
2096
+ function convert(str, to, from) {
2097
+ from = checkEncoding(from || "UTF-8");
2098
+ to = checkEncoding(to || "UTF-8");
2099
+ str = str || "";
2100
+ var result;
2101
+ if (from !== "UTF-8" && typeof str === "string") {
2102
+ str = Buffer.from(str, "binary");
2103
+ }
2104
+ if (from === to) {
2105
+ if (typeof str === "string") {
2106
+ result = Buffer.from(str);
2107
+ } else {
2108
+ result = str;
2109
+ }
2110
+ } else {
2111
+ try {
2112
+ result = convertIconvLite(str, to, from);
2113
+ } catch (E) {
2114
+ console.error(E);
2115
+ result = str;
2116
+ }
2117
+ }
2118
+ if (typeof result === "string") {
2119
+ result = Buffer.from(result, "utf-8");
2120
+ }
2121
+ return result;
2122
+ }
2123
+ __name(convert, "convert");
2124
+ function convertIconvLite(str, to, from) {
2125
+ if (to === "UTF-8") {
2126
+ return iconvLite.decode(str, from);
2127
+ } else if (from === "UTF-8") {
2128
+ return iconvLite.encode(str, to);
2129
+ } else {
2130
+ return iconvLite.encode(iconvLite.decode(str, from), to);
2131
+ }
2132
+ }
2133
+ __name(convertIconvLite, "convertIconvLite");
2134
+ function checkEncoding(name) {
2135
+ return (name || "").toString().trim().replace(/^latin[\-_]?(\d+)$/i, "ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i, "WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i, "UTF-$1").replace(/^ks_c_5601\-1987$/i, "CP949").replace(/^us[\-_]?ascii$/i, "ASCII").toUpperCase();
2136
+ }
2137
+ __name(checkEncoding, "checkEncoding");
2138
+ }
2139
+ });
2140
+
2086
2141
  // node_modules/node-fetch/lib/index.js
2087
- var require_lib2 = __commonJS({
2142
+ var require_lib3 = __commonJS({
2088
2143
  "node_modules/node-fetch/lib/index.js"(exports, module) {
2089
2144
  "use strict";
2090
2145
  init_esbuild_shims();
@@ -2217,7 +2272,7 @@ var require_lib2 = __commonJS({
2217
2272
  FetchError.prototype.name = "FetchError";
2218
2273
  var convert;
2219
2274
  try {
2220
- convert = __require("encoding").convert;
2275
+ convert = require_encoding().convert;
2221
2276
  } catch (e) {
2222
2277
  }
2223
2278
  var INTERNALS = Symbol("Body internals");
@@ -4062,6 +4117,6 @@ var require_abort_controller = __commonJS({
4062
4117
  });
4063
4118
 
4064
4119
  export {
4065
- require_lib2 as require_lib,
4120
+ require_lib3 as require_lib,
4066
4121
  require_abort_controller
4067
4122
  };
@@ -2,11 +2,11 @@
2
2
  "use strict";
3
3
  import {
4
4
  atomicWriteFileSync
5
- } from "./chunk-LTN3VYMZ.js";
5
+ } from "./chunk-3UALQ56H.js";
6
6
  import {
7
7
  Storage,
8
8
  createDebugLogger
9
- } from "./chunk-WE6TNQJU.js";
9
+ } from "./chunk-C4K3FEQ2.js";
10
10
  import {
11
11
  init_esbuild_shims
12
12
  } from "./chunk-A4BMJM77.js";
@@ -3,17 +3,17 @@
3
3
  import {
4
4
  getInboxesDir,
5
5
  require_proper_lockfile
6
- } from "./chunk-26ZYKTYZ.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-LTN3VYMZ.js";
12
+ } from "./chunk-3UALQ56H.js";
13
13
  import {
14
14
  createDebugLogger,
15
15
  isNodeError
16
- } from "./chunk-WE6TNQJU.js";
16
+ } from "./chunk-C4K3FEQ2.js";
17
17
  import {
18
18
  init_esbuild_shims
19
19
  } from "./chunk-A4BMJM77.js";
@@ -3,17 +3,17 @@
3
3
  import {
4
4
  getTasksDir,
5
5
  require_proper_lockfile
6
- } from "./chunk-26ZYKTYZ.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-LTN3VYMZ.js";
12
+ } from "./chunk-3UALQ56H.js";
13
13
  import {
14
14
  createDebugLogger,
15
15
  isNodeError
16
- } from "./chunk-WE6TNQJU.js";
16
+ } from "./chunk-C4K3FEQ2.js";
17
17
  import {
18
18
  init_esbuild_shims
19
19
  } from "./chunk-A4BMJM77.js";