@qwen-code/qwen-code 0.18.5-nightly.20260622.6bc3f853e → 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.
- package/bundled/qc-helper/SKILL.md +13 -5
- package/bundled/qc-helper/docs/configuration/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/auth.md +68 -48
- package/bundled/qc-helper/docs/configuration/model-providers.md +217 -195
- package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
- package/bundled/qc-helper/docs/configuration/settings.md +44 -27
- package/bundled/qc-helper/docs/configuration/themes.md +7 -4
- package/bundled/qc-helper/docs/extension/extension-releasing.md +1 -1
- package/bundled/qc-helper/docs/extension/introduction.md +27 -21
- package/bundled/qc-helper/docs/features/arena.md +3 -3
- package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
- package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
- package/bundled/qc-helper/docs/features/commands.md +6 -1
- package/bundled/qc-helper/docs/features/headless.md +1 -1
- package/bundled/qc-helper/docs/features/mcp.md +33 -14
- package/bundled/qc-helper/docs/features/sandbox.md +2 -2
- package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
- package/bundled/qc-helper/docs/integration-github-action.md +2 -2
- package/bundled/qc-helper/docs/overview.md +1 -1
- package/bundled/qc-helper/docs/quickstart.md +9 -5
- package/bundled/qc-helper/docs/qwen-serve.md +14 -2
- package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
- package/chunks/{agent-WFLPE5MW.js → agent-P4KSTVXX.js} +24 -22
- package/chunks/{agent-headless-Q27MG73I.js → agent-headless-QUAPWF55.js} +24 -22
- package/chunks/{anthropicContentGenerator-5S4OMMNL.js → anthropicContentGenerator-7352A7I5.js} +12 -11
- package/chunks/artifact-tool-5J4HUZAV.js +675 -0
- package/chunks/{askUserQuestion-WHVYL2S2.js → askUserQuestion-HF7HCWDD.js} +20 -7
- package/chunks/chunk-22IFUCVR.js +291 -0
- package/chunks/{chunk-26ZYKTYZ.js → chunk-2BIF2NVV.js} +2 -2
- package/chunks/{chunk-VKILGMZQ.js → chunk-2QDQTWCI.js} +1 -1
- package/chunks/{chunk-XGU3ETVO.js → chunk-3BR4OIOE.js} +3 -3
- package/chunks/{chunk-LTN3VYMZ.js → chunk-3UALQ56H.js} +1 -1
- package/chunks/{chunk-QBUR6J4B.js → chunk-BC5POO46.js} +8 -7
- package/chunks/{chunk-MSJ2MXJ6.js → chunk-BGUDAULQ.js} +11 -290
- package/chunks/{chunk-FH4P6RQA.js → chunk-BNXANYLH.js} +1 -1
- package/chunks/{chunk-WE6TNQJU.js → chunk-C4K3FEQ2.js} +36 -0
- package/chunks/{chunk-G4BUMVEY.js → chunk-CGEGHF2C.js} +2 -217
- package/chunks/chunk-EEEZIVFJ.js +908 -0
- package/chunks/{chunk-7Z2O7IBO.js → chunk-EIJYMXXX.js} +619 -135
- package/chunks/chunk-EJYJYJZ2.js +3703 -0
- package/chunks/{chunk-ATLUHLZE.js → chunk-EW6C27XX.js} +1 -1
- package/chunks/{chunk-42HGOMED.js → chunk-F6XNTYNE.js} +216 -1
- package/chunks/{chunk-C6MI2ASN.js → chunk-GZCJS5WH.js} +2 -2
- package/chunks/{chunk-KGV3F6UF.js → chunk-HGNSRCRB.js} +1 -1
- package/chunks/{chunk-CX3SGIPK.js → chunk-KBXLIVWQ.js} +2 -2
- package/chunks/{chunk-GOMVJKBL.js → chunk-L7U2RI5O.js} +59 -57
- package/chunks/{chunk-GBN55AWZ.js → chunk-NKJ6LRCR.js} +2 -2
- package/chunks/{chunk-2O3NAOJG.js → chunk-NWLUISRA.js} +1 -1
- package/chunks/{chunk-ID533GA3.js → chunk-OTBK43JR.js} +1 -1
- package/chunks/{chunk-AE6RQU6F.js → chunk-PRYMDRBV.js} +1 -1
- package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
- package/chunks/{chunk-CTHZVIMD.js → chunk-T2VDEFUU.js} +2 -2
- package/chunks/{chunk-SWGPABMH.js → chunk-T336V435.js} +80 -83
- package/chunks/{chunk-LF6BKGZT.js → chunk-TXVGVZYR.js} +3 -3
- package/chunks/{chunk-GM3LTU6K.js → chunk-UMRZ7XCR.js} +170 -5015
- package/chunks/{chunk-XU7BKR3B.js → chunk-XU5P23GN.js} +3 -3
- package/chunks/{chunk-EJ6NFQ2L.js → chunk-ZC675NGC.js} +5 -5
- package/chunks/{chunk-CXZV4Q4J.js → chunk-ZXNEOCW2.js} +7118 -5113
- package/chunks/{computer-use-F5O56FVW.js → computer-use-4TLHI3UR.js} +24 -22
- package/chunks/contextCommand-HFEITKSR.js +56 -0
- package/chunks/{cron-create-THNDTYXU.js → cron-create-A5637KCI.js} +12 -9
- package/chunks/{cron-delete-BS5H6TFJ.js → cron-delete-AADOSEOZ.js} +4 -4
- package/chunks/{cron-list-7OBVHT7K.js → cron-list-OFCPTT2Y.js} +4 -4
- package/chunks/{dist-GKRNVFBH.js → dist-ZBX7LPJZ.js} +2 -1
- package/chunks/{edit-UV7MBOJU.js → edit-B7H73V6O.js} +24 -22
- package/chunks/{en-S3OQBISC.js → en-7OGNWWME.js} +48 -0
- package/chunks/{enter-worktree-TSCHZMJ3.js → enter-worktree-GG7ZHYPS.js} +24 -22
- package/chunks/{enterPlanMode-LKS7VIUG.js → enterPlanMode-RHTAKG52.js} +27 -23
- package/chunks/{exit-worktree-Q6EWFLZU.js → exit-worktree-U7VQZRMG.js} +24 -22
- package/chunks/{exitPlanMode-HS6I4D2O.js → exitPlanMode-S35A36II.js} +36 -28
- package/chunks/{geminiContentGenerator-GEZ63VSW.js → geminiContentGenerator-W7KVATBA.js} +4 -4
- package/chunks/{glob-ZN5LKB7E.js → glob-WOFF7ECI.js} +26 -23
- package/chunks/{grep-NIKBBYBU.js → grep-MWNYWYWQ.js} +24 -22
- package/chunks/{keychain-token-storage-YHXIWXIB.js → keychain-token-storage-CSYMNRPP.js} +2 -2
- package/chunks/{loop-wakeup-SSBWZ64K.js → loop-wakeup-DGSMT4N6.js} +5 -5
- package/chunks/{ls-YPFUHZRQ.js → ls-UGRZ4ZOM.js} +6 -6
- package/chunks/{lsp-FD6DNVAF.js → lsp-72IJURW3.js} +2 -2
- package/chunks/{monitor-A25XKPU5.js → monitor-AYUINLYN.js} +24 -22
- package/chunks/{notebook-edit-E72AIOUS.js → notebook-edit-EP4D4WFD.js} +25 -23
- package/chunks/{openaiContentGenerator-ZDLZDXLU.js → openaiContentGenerator-SLYYF7AM.js} +12 -15
- package/chunks/{qwenContentGenerator-HVJPPMTT.js → qwenContentGenerator-VZ7JYU4A.js} +26 -24
- package/chunks/{qwenOAuth2-WZ54YZ4J.js → qwenOAuth2-K4AASPCV.js} +5 -4
- package/chunks/{read-file-L6FM3KUX.js → read-file-65EQ53KS.js} +9 -8
- package/chunks/{ripGrep-YRJCUISE.js → ripGrep-5XLHJDDM.js} +24 -22
- package/chunks/{scheduler-M3742P2I.js → scheduler-5GLJSA2H.js} +73 -27
- package/chunks/{send-message-FWFTX62Q.js → send-message-URUZ7PLA.js} +24 -4
- package/chunks/{serve-ZIP2GDFY.js → serve-MUROZGCG.js} +618 -92
- package/chunks/{shell-T5VSPJLU.js → shell-ET3BQWKB.js} +24 -22
- package/chunks/{skill-ETTFYDOV.js → skill-YEYABCAF.js} +11 -10
- package/chunks/{src-UKOPSYDK.js → src-POVOI65Y.js} +140 -67
- package/chunks/{syntheticOutput-JY5NEDTV.js → syntheticOutput-65FRJGWM.js} +3 -3
- package/chunks/{task-create-IGILDV25.js → task-create-IH45HOFT.js} +6 -6
- package/chunks/{task-list-KBEJVAAG.js → task-list-FUB6JWSX.js} +5 -5
- package/chunks/{task-stop-WFTMQ6AC.js → task-stop-P6IOHQM3.js} +2 -2
- package/chunks/{task-update-UIVX7ZEV.js → task-update-RTUT7LJV.js} +6 -6
- package/chunks/{team-create-DRKUVGBN.js → team-create-EFZFKQFP.js} +28 -26
- package/chunks/{team-delete-LPOXDPVB.js → team-delete-RXGYRMHC.js} +5 -5
- package/chunks/{todoWrite-R4RIJKOD.js → todoWrite-O6JK24G6.js} +4 -4
- package/chunks/{tool-search-EIIK27ON.js → tool-search-BRJC42TE.js} +9 -8
- package/chunks/{web-fetch-JU7SS6KE.js → web-fetch-KUMBROUI.js} +4 -4
- package/chunks/{workflow-4RGAYFSJ.js → workflow-UDRBNFTT.js} +557 -97
- package/chunks/{write-file-GLQYJFEZ.js → write-file-F7TAHAHF.js} +24 -22
- package/chunks/{zh-QXLZV2PX.js → zh-3RMSEO5M.js} +48 -0
- package/chunks/{zh-TW-3OKU7LDA.js → zh-TW-R7WRLTJS.js} +48 -0
- package/cli.js +8473 -5091
- package/locales/en.js +69 -0
- package/locales/zh-TW.js +66 -0
- package/locales/zh.js +66 -0
- package/package.json +3 -2
- package/web-shell/assets/{arc-CRFN10gD.js → arc-DHUeMnnj.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
- package/web-shell/assets/channel-C3WhMjjP.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DVCQST3O.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CQ6TXPif.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ6TXPif.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-DJxdu2YS.js} +1 -1
- package/web-shell/assets/index-BPnhI7gl.css +1 -0
- package/web-shell/assets/index-De4rqTsW.js +706 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
- package/web-shell/assets/{linear-DpyMbKqT.js → linear-D2m9-ODE.js} +1 -1
- package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-dTtkZp2F.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-DixFVzEs.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DZgE04s3.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
- package/web-shell/index.html +3 -3
- package/chunks/chunk-77WXWU44.js +0 -26
- package/chunks/contextCommand-WBVNKL2C.js +0 -54
- package/web-shell/assets/channel-WwImfsc7.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
- package/web-shell/assets/index-BDZiTAkl.css +0 -1
- package/web-shell/assets/index-DaebdpHq.js +0 -516
- 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-
|
|
5
|
+
} from "./chunk-KBXLIVWQ.js";
|
|
6
6
|
import {
|
|
7
7
|
OpenAIContentConverter,
|
|
8
8
|
TaggedThinkingParser,
|
|
9
9
|
openaiRequestCaptureContext
|
|
10
|
-
} from "./chunk-
|
|
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-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
|
-
|
|
27
|
-
safeJsonParse,
|
|
23
|
+
redactProxyError,
|
|
28
24
|
tokenLimit
|
|
29
|
-
} from "./chunk-
|
|
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-
|
|
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
|
-
|
|
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,
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import {
|
|
4
4
|
getInboxesDir,
|
|
5
5
|
require_proper_lockfile
|
|
6
|
-
} from "./chunk-
|
|
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-
|
|
12
|
+
} from "./chunk-3UALQ56H.js";
|
|
13
13
|
import {
|
|
14
14
|
createDebugLogger,
|
|
15
15
|
isNodeError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-C4K3FEQ2.js";
|
|
17
17
|
import {
|
|
18
18
|
init_esbuild_shims
|
|
19
19
|
} from "./chunk-A4BMJM77.js";
|