@qwen-code/qwen-code 0.23.2 → 0.23.3
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/README.md +35 -15
- package/bundled/computer-use/SKILL.md +1 -1
- package/bundled/qc-helper/docs/configuration/model-providers.md +66 -28
- package/bundled/qc-helper/docs/configuration/settings.md +5 -3
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/dws.md +7 -1
- package/bundled/qc-helper/docs/features/commands.md +57 -9
- package/bundled/qc-helper/docs/features/computer-use.md +1 -1
- package/bundled/qc-helper/docs/features/cross-session-protocol.md +320 -0
- package/bundled/qc-helper/docs/features/goals.md +1 -1
- package/bundled/qc-helper/docs/qwen-serve.md +16 -3
- package/bundled/review/SKILL.md +82 -79
- package/bundled/review/references/posting.md +31 -14
- package/chunks/{MaxSizedBox-4C3BKKKY.js → MaxSizedBox-D4LW7RZZ.js} +58 -51
- package/chunks/{StandaloneSessionPicker-TXVF65YW.js → StandaloneSessionPicker-ALTTRWUP.js} +80 -73
- package/chunks/acp-subagent-executor-LEUN3N7N.js +919 -0
- package/chunks/{acpAgent-H5XBKGB4.js → acpAgent-BBSW7XZG.js} +509 -201
- package/chunks/{agent-T5LEFJIU.js → agent-SQ6OY3QD.js} +42 -36
- package/chunks/{agent-headless-VZKSRH36.js → agent-headless-RI2THRQ7.js} +42 -36
- package/chunks/{anthropicContentGenerator-PRJWWVYJ.js → anthropicContentGenerator-JSKMKS6V.js} +66 -34
- package/chunks/{artifact-tool-G5LHNECG.js → artifact-tool-PMYZCYNH.js} +2 -2
- package/chunks/{askUserQuestion-I5W5S3D6.js → askUserQuestion-4M4YYIB4.js} +2 -2
- package/chunks/{bridge-AOX5IY44.js → bridge-DAFMI72L.js} +62 -55
- package/chunks/{channel-management-service-MWQGHPAS.js → channel-management-service-OWDXVL7R.js} +8 -8
- package/chunks/{channel-settings-store-XZCGDGHW.js → channel-settings-store-4I6JONT7.js} +69 -62
- package/chunks/{channel-worker-group-SQ5FRWOH.js → channel-worker-group-F2ZZMLNS.js} +8 -8
- package/chunks/{channel-worker-manager-TU4ZNWOE.js → channel-worker-manager-2SZLJJSJ.js} +18 -9
- package/chunks/{channel-worker-supervisor-EMITFMCP.js → channel-worker-supervisor-ZFNWMG6D.js} +6 -6
- package/chunks/{chunk-GNY7B3CA.js → chunk-2ALXPGB4.js} +1 -1
- package/chunks/{chunk-LUNC5KCL.js → chunk-2PJRI3EH.js} +7 -7
- package/chunks/{chunk-CLKE4IY3.js → chunk-2SZH22YO.js} +1 -1
- package/chunks/{chunk-RNAJVXUG.js → chunk-2ZN3O5FT.js} +6 -6
- package/chunks/{chunk-HIXUUCGY.js → chunk-36HCNKDS.js} +1 -1
- package/chunks/{chunk-FGHPZGOP.js → chunk-3BTSSIJO.js} +38 -54
- package/chunks/{chunk-VBLAI2HA.js → chunk-3FPYT6QC.js} +0 -31
- package/chunks/{chunk-QB3KS3N3.js → chunk-3I7W2POO.js} +1 -1
- package/chunks/{chunk-QTB4VP4K.js → chunk-3KQBQ6FM.js} +136 -11
- package/chunks/{chunk-JO77FGNZ.js → chunk-3UXUOFO6.js} +19 -7
- package/chunks/{chunk-WDN64MVT.js → chunk-3XLK2QMY.js} +82 -16
- package/chunks/chunk-532WHF4F.js +127 -0
- package/chunks/{chunk-NX7ZTXFF.js → chunk-53GWJOLP.js} +1 -1
- package/chunks/{chunk-QQK4L3UU.js → chunk-5GLDOLNQ.js} +131 -26
- package/chunks/{chunk-WK7P62DV.js → chunk-5KI7ZDTB.js} +6 -6
- package/chunks/{chunk-ERXNTINK.js → chunk-6JACAGYH.js} +1 -1
- package/chunks/{chunk-CMWU6P4D.js → chunk-6W4HBUA2.js} +1 -1
- package/chunks/{chunk-AUTUFD5X.js → chunk-76RGWKLS.js} +1 -1
- package/chunks/{chunk-PDN7FJZV.js → chunk-7APZIRH3.js} +2 -2
- package/chunks/{chunk-WBU2PIZ5.js → chunk-7BXXIQG4.js} +16 -16
- package/chunks/{chunk-APXIW2TF.js → chunk-7ICHPMBQ.js} +4 -4
- package/chunks/{chunk-CWVZBIZJ.js → chunk-7Q2AXRDJ.js} +1 -1
- package/chunks/{chunk-WDVV3LRM.js → chunk-7QYWGTHB.js} +1 -1
- package/chunks/{chunk-RM244SCQ.js → chunk-AC6KDLH3.js} +1 -1
- package/chunks/{chunk-2WC3Y7YY.js → chunk-AEY27Z35.js} +401 -23
- package/chunks/{chunk-XDNFODER.js → chunk-AXTFYDXT.js} +1 -1
- package/chunks/chunk-AYEJOTIU.js +43 -0
- package/chunks/{chunk-ZN5TKAVR.js → chunk-BV6Q5HMY.js} +3 -3
- package/chunks/{chunk-TOOOLHVS.js → chunk-BWAMMKIS.js} +3 -3
- package/chunks/{chunk-IRGDIDGJ.js → chunk-BWQLXU37.js} +26 -19
- package/chunks/{process-registry-OAEG6WGC.js → chunk-BYUAT5OC.js} +1 -0
- package/chunks/{chunk-GOEVQADN.js → chunk-BZM5U74J.js} +287 -169
- package/chunks/chunk-CF5KXZZX.js +150 -0
- package/chunks/{chunk-TGNNLRC3.js → chunk-CJ3DHN5I.js} +1 -0
- package/chunks/{chunk-PFKGV6PO.js → chunk-CUEXOHQH.js} +9 -9
- package/chunks/chunk-CXTPVBFA.js +937 -0
- package/chunks/{chunk-LEAOJ43M.js → chunk-DAWWT2ID.js} +62 -59
- package/chunks/{chunk-CALTQWTZ.js → chunk-DLH7YIX6.js} +2 -2
- package/chunks/chunk-DT75RKNH.js +691 -0
- package/chunks/{chunk-TRWQQBVH.js → chunk-DTNV6UZY.js} +1 -1
- package/chunks/{chunk-3OAXF3UK.js → chunk-DYFOSJHU.js} +3080 -933
- package/chunks/{chunk-GSFV5RQW.js → chunk-E4UEO3XM.js} +3 -2
- package/chunks/{chunk-A7EFXK7P.js → chunk-E7LB57MB.js} +5 -5
- package/chunks/{chunk-KEPC5BOL.js → chunk-EDMXGXAK.js} +9 -9
- package/chunks/chunk-ELRMZTPF.js +374 -0
- package/chunks/chunk-ERU3SDXT.js +27 -0
- package/chunks/{chunk-O2FEO2CB.js → chunk-EUURTIV6.js} +18 -2
- package/chunks/{chunk-QFJZAY7W.js → chunk-EVTNACMT.js} +3 -3
- package/chunks/{chunk-4HOEU2OR.js → chunk-EWJTAP3Y.js} +1 -19
- package/chunks/{chunk-YQGW3M6Z.js → chunk-F42YYSCK.js} +8 -8
- package/chunks/{chunk-7PD7ZMX5.js → chunk-FCQJLMA2.js} +98 -5
- package/chunks/{chunk-4VY3ITHR.js → chunk-FN3JNDRU.js} +3 -3
- package/chunks/{chunk-R457KFV7.js → chunk-GCDXVPFK.js} +3 -3
- package/chunks/{chunk-IR6JKBAP.js → chunk-GOXQL4YH.js} +2 -2
- package/chunks/{chunk-YLOHCA6I.js → chunk-GSILBZLN.js} +2 -2
- package/chunks/{chunk-LNYV4GXX.js → chunk-GSKX53AN.js} +0 -139
- package/chunks/{chunk-4WMGYG3F.js → chunk-HBQ2NXOU.js} +2 -2
- package/chunks/{chunk-F2NYVASI.js → chunk-HBU7EKY4.js} +14 -12
- package/chunks/{chunk-6G4V7SE4.js → chunk-HG46TTAG.js} +1 -1
- package/chunks/{chunk-G5VOXCRX.js → chunk-HGAELO7B.js} +2 -2
- package/chunks/{chunk-FETY36NQ.js → chunk-HGEUHUEV.js} +1 -1
- package/chunks/{chunk-E6TI726I.js → chunk-HUXPEUFL.js} +1 -1
- package/chunks/{chunk-LYT2OU7D.js → chunk-IAEXTMED.js} +1 -1
- package/chunks/{chunk-IW6RQPQB.js → chunk-IJOS26LH.js} +1 -3
- package/chunks/{chunk-ORFIYTI2.js → chunk-IK2MWJP5.js} +1 -1
- package/chunks/{chunk-WXD7INFV.js → chunk-IL5M5NYD.js} +8 -8
- package/chunks/{chunk-KA5HR3G2.js → chunk-IUVIBDKU.js} +2 -2
- package/chunks/{chunk-5DQ4YTIZ.js → chunk-IV7GDNKC.js} +1 -1
- package/chunks/chunk-JL6APGBX.js +43 -0
- package/chunks/{chunk-N6S3NUYJ.js → chunk-JXNIF2O5.js} +1 -1
- package/chunks/{chunk-DAI65CMX.js → chunk-JYKWOREU.js} +1 -1
- package/chunks/chunk-K2OJUPOE.js +78 -0
- package/chunks/{chunk-KFECPHLV.js → chunk-KFZYGSJN.js} +3 -3
- package/chunks/{chunk-BK7D2JR6.js → chunk-KOKPXIAN.js} +3 -3
- package/chunks/{chunk-4I3WFI3U.js → chunk-LDVNJZGH.js} +12 -12
- package/chunks/{chunk-WXFCI3O5.js → chunk-LG5Y4OWO.js} +2 -2
- package/chunks/{chunk-3LPJ776W.js → chunk-LILGKQ4B.js} +10 -7
- package/chunks/{chunk-X7LFJF5D.js → chunk-LK2WUCDQ.js} +36 -84
- package/chunks/{chunk-7LTCFO6T.js → chunk-MF6E7FSA.js} +6 -5
- package/chunks/{chunk-ELD3OBPU.js → chunk-MHAADZOZ.js} +3 -3
- package/chunks/{chunk-4JNHNVAZ.js → chunk-MLQNSPRZ.js} +4 -4
- package/chunks/{chunk-NPKCVSXX.js → chunk-MOS5OAOG.js} +10 -8
- package/chunks/{chunk-IWABUX6T.js → chunk-MSNHNAQZ.js} +6 -6
- package/chunks/{chunk-HJ5UJQQL.js → chunk-N7VWZDWW.js} +1699 -1312
- package/chunks/{chunk-NB3NDQQK.js → chunk-NE624IVP.js} +1 -1
- package/chunks/{chunk-SOA4HKRJ.js → chunk-NFYEQRLG.js} +2 -2
- package/chunks/{chunk-G3ZUMSFS.js → chunk-NHCZJQE4.js} +6 -6
- package/chunks/{chunk-B25JYXZE.js → chunk-NHJKAR6E.js} +4 -4
- package/chunks/{chunk-ZP5XDLSA.js → chunk-NJQTG2G3.js} +12 -12
- package/chunks/{chunk-DARWOZY6.js → chunk-NLNQNBZ2.js} +1 -1
- package/chunks/{chunk-CCBTNJB4.js → chunk-NMCDMLHL.js} +27 -27
- package/chunks/{chunk-AO2VMS72.js → chunk-NMRCXKQ5.js} +3 -3
- package/chunks/{chunk-5BH2AIEY.js → chunk-NOAG7N22.js} +2 -2
- package/chunks/{chunk-VJJXG73H.js → chunk-NRXWJXJ4.js} +15 -0
- package/chunks/chunk-NUQ4GK5I.js +315 -0
- package/chunks/{chunk-J3VZF2AL.js → chunk-NUQVB25K.js} +2 -2
- package/chunks/{chunk-U6REWGVR.js → chunk-OLTN767L.js} +2 -2
- package/chunks/{chunk-R3JIDRUL.js → chunk-OX7IZ2G5.js} +4 -4
- package/chunks/{chunk-QAZ2MGYT.js → chunk-PLLIWEM3.js} +2 -2
- package/chunks/{chunk-KCF2436G.js → chunk-POC3YMHG.js} +4 -4
- package/chunks/{chunk-HZ2HUXX7.js → chunk-Q2LVVIKF.js} +1 -1
- package/chunks/{chunk-7NDZKE2M.js → chunk-Q5BD56BW.js} +3 -3
- package/chunks/{chunk-22GORRNY.js → chunk-QMUYLYT5.js} +1 -1
- package/chunks/{chunk-MV5DTLJV.js → chunk-R4Q2PEFV.js} +1 -1
- package/chunks/{chunk-GOKAOSCN.js → chunk-RLLRJJDR.js} +1 -1
- package/chunks/{chunk-5OZUKLL7.js → chunk-RWVD5RRY.js} +4 -4
- package/chunks/{chunk-ULZECEIP.js → chunk-RZHU3K6M.js} +2 -2
- package/chunks/{chunk-UYDQYDW2.js → chunk-S6Q6Q4P2.js} +1 -1
- package/chunks/{chunk-PQEISIKS.js → chunk-SAH4BD2J.js} +0 -67
- package/chunks/{chunk-LWX4WDFF.js → chunk-SBRX4BDI.js} +43 -15
- package/chunks/{chunk-TODNHE76.js → chunk-SODMFNAR.js} +5 -5
- package/chunks/{chunk-FAJPLSYF.js → chunk-SSGAAWLY.js} +89 -85
- package/chunks/{chunk-46MMBZHI.js → chunk-SYLECP23.js} +4 -4
- package/chunks/{chunk-6RZX2HIH.js → chunk-TBEXLLAO.js} +2 -2
- package/chunks/{chunk-MWIO7MF6.js → chunk-TP6FYVQT.js} +2 -0
- package/chunks/{chunk-HRPFBHW7.js → chunk-TPKQIA7G.js} +1 -0
- package/chunks/{chunk-QHLHE2OT.js → chunk-TWUKBNWM.js} +1 -1
- package/chunks/{chunk-H3Q3RSKZ.js → chunk-U7O65WKL.js} +1 -1
- package/chunks/{chunk-S5QR6CB5.js → chunk-UKMWZ5NS.js} +108 -887
- package/chunks/{chunk-OXR34GCD.js → chunk-UKZ45TJL.js} +1851 -34
- package/chunks/{chunk-CALNF3Z3.js → chunk-V2P3DOQR.js} +1 -1
- package/chunks/{chunk-FV4DM2M4.js → chunk-VG3Q2NC4.js} +7 -7
- package/chunks/{chunk-QTNCGZHQ.js → chunk-VX63RJXE.js} +9 -0
- package/chunks/{chunk-CRZBDVP2.js → chunk-VZUCTJ2P.js} +4 -4
- package/chunks/{chunk-2BMXHB6N.js → chunk-W5FIP7FC.js} +7 -7
- package/chunks/{chunk-7VEYUF3N.js → chunk-W5ZQMAEM.js} +1 -1
- package/chunks/{chunk-XQ4RDO5B.js → chunk-WBCPROWX.js} +1 -1
- package/chunks/{chunk-JYGIJA4W.js → chunk-X6K77VHC.js} +1 -1
- package/chunks/{chunk-7SVM3RP2.js → chunk-X7UJKOHZ.js} +3 -3
- package/chunks/{chunk-WXPPUPHM.js → chunk-XBZTAGB7.js} +1 -1
- package/chunks/{chunk-TRQNRP2H.js → chunk-XGYHNWL3.js} +45 -2
- package/chunks/{chunk-2EKVPSIJ.js → chunk-Y2MYW47X.js} +1 -1
- package/chunks/{chunk-OFVAS4AR.js → chunk-YBUMTY7B.js} +1 -1
- package/chunks/{chunk-67XTVRVB.js → chunk-YQHLFCPU.js} +7 -7
- package/chunks/{chunk-G37O7YO6.js → chunk-Z3GF56ME.js} +2 -2
- package/chunks/{chunk-XBVNNDPK.js → chunk-ZHKTKHMO.js} +8 -1
- package/chunks/{chunk-OWCFKIFQ.js → chunk-ZKYR7QS4.js} +1 -1
- package/chunks/{chunk-YZTGGCEE.js → chunk-ZKZHSB5W.js} +1 -1
- package/chunks/{chunk-565U2ANU.js → chunk-ZTTC7T4X.js} +1 -1
- package/chunks/{chunk-XSOXPG2L.js → chunk-ZU47FBOC.js} +36 -7
- package/chunks/{chunk-7OCIQNKX.js → chunk-ZW2EUO2A.js} +1 -1
- package/chunks/{config-utils-GPLIABL2.js → config-utils-L6KLDYIV.js} +62 -55
- package/chunks/{contextCommand-NCUQUDBY.js → contextCommand-UYEH7NIU.js} +59 -52
- package/chunks/{core-runtime-WKYKWVYU.js → core-runtime-NVHT3Z3V.js} +61 -54
- package/chunks/{create-sub-session-TGIX63YU.js → create-sub-session-TIGCFGCS.js} +2 -2
- package/chunks/{create-sub-session-PPLXB3JJ.js → create-sub-session-YWASE5VH.js} +59 -52
- package/chunks/{cron-create-GTPVMJCF.js → cron-create-AKWX67FO.js} +1 -1
- package/chunks/{cron-delete-ZBK27Z4K.js → cron-delete-XPB6IYZJ.js} +1 -1
- package/chunks/{cron-list-KTFKFDKC.js → cron-list-XBKO4WU5.js} +1 -1
- package/chunks/{daemon-2CKIAO3I.js → daemon-G5TYKZD6.js} +2 -2
- package/chunks/{daemon-git-worktree-guard-73ZWOLKL.js → daemon-git-worktree-guard-FOW4RQSK.js} +60 -53
- package/chunks/{daemon-status-provider-OK7VONJG.js → daemon-status-provider-O5KQZYMP.js} +67 -60
- package/chunks/{daemon-trust-policy-CAUCREG2.js → daemon-trust-policy-3ATXEON7.js} +64 -57
- package/chunks/{daemon-trust-policy-monitor-3Y36OOEQ.js → daemon-trust-policy-monitor-7MCNDNEC.js} +64 -57
- package/chunks/{deferred-core-runtime-Q7WFWYD3.js → deferred-core-runtime-JK5IXL5K.js} +57 -50
- package/chunks/{display-image-CTNHJRZC.js → display-image-NAH3AZ63.js} +3 -3
- package/chunks/{dist-NP7QKLVG.js → dist-AHJYPSJL.js} +3 -3
- package/chunks/{dist-6YDUH3BB.js → dist-AIKC5E5P.js} +2 -2
- package/chunks/{dist-Y5KC3IHW.js → dist-F2DVGTL3.js} +225 -6
- package/chunks/{dist-BNQVF565.js → dist-GWNQVPZT.js} +5 -5
- package/chunks/{dist-F6JLAJLE.js → dist-H6G3K26N.js} +3 -3
- package/chunks/{dist-ZDNJK74R.js → dist-KJGRVIGJ.js} +2 -2
- package/chunks/{dist-F34J4FZX.js → dist-KLZ7XGEQ.js} +2 -2
- package/chunks/{dist-UFTFGI6I.js → dist-ZA52JXAS.js} +2 -2
- package/chunks/{dist-XLV33CLY.js → dist-ZXTZTE54.js} +2 -2
- package/chunks/{edit-YJD6IETK.js → edit-SY35KYIE.js} +45 -39
- package/chunks/{en-YJNRUQG4.js → en-CAJHTIQT.js} +1 -0
- package/chunks/{enter-worktree-YFTKHXHZ.js → enter-worktree-54L5QJ3N.js} +4 -4
- package/chunks/{enterPlanMode-EFPVTWIH.js → enterPlanMode-HXX6KQJR.js} +42 -36
- package/chunks/{environment-HP3AXFTB.js → environment-DKXHG4HB.js} +60 -53
- package/chunks/{errors-22ON46G7.js → errors-ADY7LQJJ.js} +59 -52
- package/chunks/{exit-worktree-NF2XEMES.js → exit-worktree-EORJDKDS.js} +4 -4
- package/chunks/{exitPlanMode-MOQUNCBH.js → exitPlanMode-HSK2CQI6.js} +42 -36
- package/chunks/{fast-path-2X7BPMXX.js → fast-path-U636VWN2.js} +6 -6
- package/chunks/{fast-path-settings-SATXY3PD.js → fast-path-settings-V7MI7EZJ.js} +2 -2
- package/chunks/{glob-Y7ACIB3P.js → glob-GUGGTH5L.js} +45 -39
- package/chunks/{goal-tools-DABMICUC.js → goal-tools-PXYRSQGX.js} +42 -36
- package/chunks/{grep-BLHF2S5D.js → grep-3PKFKLCA.js} +2 -2
- package/chunks/{handleAutoUpdate-MCAMHYDI.js → handleAutoUpdate-5KHS4HIN.js} +60 -53
- package/chunks/{i18n-C3GDCALP.js → i18n-KSGKMUPT.js} +58 -51
- package/chunks/{image-gen-XP4NNIYG.js → image-gen-OCCR2WWU.js} +5 -4
- package/chunks/{initializer-4URDQL2G.js → initializer-YYT5XEZF.js} +64 -57
- package/chunks/{installationInfo-LBOL6SBV.js → installationInfo-UNSBPYW2.js} +57 -50
- package/chunks/{list-JOGBAC2R.js → list-YL6LDQKQ.js} +67 -60
- package/chunks/{list-agents-2CXPGJUE.js → list-agents-QLDXS5OD.js} +17 -7
- package/chunks/{llm-2KPNSAVY.js → llm-XGGLBGPH.js} +126 -119
- package/chunks/{llm-content-generator-GR3FOHLB.js → llm-content-generator-ZHQQT5W7.js} +5 -4
- package/chunks/{loadedSettingsAdapter-DVKROEJD.js → loadedSettingsAdapter-3DXLASK7.js} +64 -57
- package/chunks/{loggingContentGenerator-P4K6K5W4.js → loggingContentGenerator-V72OCCJO.js} +64 -57
- package/chunks/{loop-wakeup-HL6XOWI4.js → loop-wakeup-HHMYIC7Z.js} +2 -2
- package/chunks/{ls-YV7RKLKY.js → ls-N7ABR6HI.js} +4 -4
- package/chunks/{lsp-NO3AMRZT.js → lsp-LTOFWG5P.js} +1 -1
- package/chunks/{managed-npm-update-VWBKHNIN.js → managed-npm-update-HV5LPZH2.js} +57 -50
- package/chunks/{mcp-6YYNSYLK.js → mcp-IYVSIW6O.js} +64 -57
- package/chunks/{monitor-A255TNZR.js → monitor-TLBNM4MV.js} +44 -38
- package/chunks/{nonInteractiveCli-LXGIKQAT.js → nonInteractiveCli-LSJSQ2W4.js} +110 -103
- package/chunks/{notebook-edit-5UYHS2DM.js → notebook-edit-OSPOLZP6.js} +43 -37
- package/chunks/openai-WX26N5OJ.js +47 -0
- package/chunks/{openaiContentGenerator-A6MAMEO5.js → openaiContentGenerator-BE4S5TRD.js} +29 -23
- package/chunks/openaiResponsesContentGenerator-RTCAJ5V5.js +1658 -0
- package/chunks/{pidfile-B7DZC4TP.js → pidfile-H32FEPWA.js} +57 -50
- package/chunks/process-registry-X6ZCASEN.js +10 -0
- package/chunks/{processUtils-BPZ2MCZS.js → processUtils-SSLIPDEA.js} +2 -2
- package/chunks/{prompt-terminal-ledger-FYYTAOXS.js → prompt-terminal-ledger-I5SLL6UF.js} +58 -51
- package/chunks/{qwenContentGenerator-4IOJFD4S.js → qwenContentGenerator-TMQC623Z.js} +55 -47
- package/chunks/{qwenOAuth2-KX6LVYQ3.js → qwenOAuth2-3ZRQHHTC.js} +4 -3
- package/chunks/{read-file-A4H4O3VQ.js → read-file-T2QAIZE2.js} +11 -9
- package/chunks/{read-mcp-resource-D3N75DGF.js → read-mcp-resource-B37WANAQ.js} +1 -1
- package/chunks/{record-artifact-Q5CRGJTP.js → record-artifact-OAXWXZ5D.js} +2 -2
- package/chunks/record-source-D7R7X3GT.js +22 -0
- package/chunks/{report-findings-TJ34R7QK.js → report-findings-AR3VC6EQ.js} +3 -3
- package/chunks/{request-shutdown-LRKMTBAD.js → request-shutdown-IKNWTX5M.js} +5 -5
- package/chunks/{resumeHistoryUtils-YQQ43E4N.js → resumeHistoryUtils-QLKDH5GY.js} +63 -56
- package/chunks/{ripGrep-W32NWFTA.js → ripGrep-YGWL7KCV.js} +15 -13
- package/chunks/{run-qwen-serve-WBSWWIRV.js → run-qwen-serve-26KZDECC.js} +127 -102
- package/chunks/{runtime-VRVBX2E5.js → runtime-BMEIVDDG.js} +70 -63
- package/chunks/{scheduled-tasks-D65KJDA3.js → scheduled-tasks-NCFPP6VQ.js} +64 -57
- package/chunks/{scheduler-M2YPN7Z7.js → scheduler-47TVMUVN.js} +59 -52
- package/chunks/{sdk-exporters-grpc-MXTVSE3C.js → sdk-exporters-grpc-Y2ZUQDUQ.js} +2 -2
- package/chunks/{sdk-exporters-http-7R2ARBPV.js → sdk-exporters-http-VWTF4W6K.js} +3 -3
- package/chunks/{sdk-impl-YOLO7LV4.js → sdk-impl-G6FVTBQZ.js} +9 -9
- package/chunks/{send-message-76BKWKFZ.js → send-message-TWOGWCBG.js} +12 -9
- package/chunks/{serve-BE3H2P6P.js → serve-KL3G6LQQ.js} +64 -57
- package/chunks/{server-FLY5JERG.js → server-LBPYXZ5G.js} +2931 -518
- package/chunks/{session-JVN62R5K.js → session-YG6742LO.js} +118 -111
- package/chunks/{session-attachments-root-7ACGLHXA.js → session-attachments-root-OUBQDYC4.js} +57 -50
- package/chunks/{session-pr-refresh-TQS57SDK.js → session-pr-refresh-EKGMYNAW.js} +64 -57
- package/chunks/{settings-D44YMZFT.js → settings-DDNHJX2L.js} +69 -62
- package/chunks/{shell-3VE6I4V5.js → shell-KUCXWITU.js} +42 -36
- package/chunks/{skill-FHEGRRZU.js → skill-JQLKPNWZ.js} +33 -23
- package/chunks/{skill-settings-VHEJMBFL.js → skill-settings-XERQCUXZ.js} +63 -56
- package/chunks/{spawnChannel-T6MX2ZDN.js → spawnChannel-GQ45QFGB.js} +60 -53
- package/chunks/{standalone-update-QUGHFMCS.js → standalone-update-PRF3ILGZ.js} +59 -52
- package/chunks/{start-opentui-ui-IHIIZ2LE.js → start-opentui-ui-JDSOZE3N.js} +174 -157
- package/chunks/{startInteractiveUI-LR7K2ARZ.js → startInteractiveUI-RRW3JVHN.js} +533 -1119
- package/chunks/{syntheticOutput-D2P5V6RG.js → syntheticOutput-F6F27JMK.js} +2 -2
- package/chunks/{task-create-MWXJFRRM.js → task-create-Y623TBHB.js} +8 -8
- package/chunks/{task-list-EYO3FE57.js → task-list-FCPEEGWL.js} +1 -1
- package/chunks/{task-stop-BFSKRTGV.js → task-stop-QTKZXLPH.js} +1 -1
- package/chunks/{task-update-2JJJRHMT.js → task-update-YLSXF25N.js} +8 -8
- package/chunks/{team-create-GY3VFY47.js → team-create-5DRLOLOE.js} +44 -38
- package/chunks/{team-delete-IQZ6XGFI.js → team-delete-S7TLHZCF.js} +1 -1
- package/chunks/{team-plan-approval-BQPGZOT5.js → team-plan-approval-MWSGAL5T.js} +42 -36
- package/chunks/{terminal-image-renderer-YNYW5CQG.js → terminal-image-renderer-H7PD4FQW.js} +59 -52
- package/chunks/{theme-manager-U6CIK3GM.js → theme-manager-7AV73D6R.js} +57 -50
- package/chunks/{todoWrite-5ERKFWAK.js → todoWrite-5QI2H2FW.js} +4 -4
- package/chunks/{tool-search-XI3QWD5I.js → tool-search-UGYTBLUV.js} +17 -15
- package/chunks/{total-session-admission-3SNSJJ32.js → total-session-admission-JIHSTJ5S.js} +62 -55
- package/chunks/{trustedFolders-OVAQKNV5.js → trustedFolders-5VCBXFOP.js} +58 -51
- package/chunks/{update-relaunch-XV5O74E3.js → update-relaunch-4LF3APCV.js} +5 -5
- package/chunks/{updateCheck-CHUYWD6L.js → updateCheck-4T3WUE5F.js} +59 -52
- package/chunks/{useAutoAcceptIndicator-VKSVIXZC.js → useAutoAcceptIndicator-UMGB64Z6.js} +67 -60
- package/chunks/{validateNonInterActiveAuth-ZNUTD3E5.js → validateNonInterActiveAuth-GFJ72U2C.js} +107 -100
- package/chunks/{version-EK7VAGSI.js → version-EAAZN4T2.js} +1 -1
- package/chunks/{web-fetch-24KZO763.js → web-fetch-VRU3A2NI.js} +13 -11
- package/chunks/{web-search-CRNXKZ2X.js → web-search-NEGYQNDJ.js} +14 -10
- package/chunks/{web-shell-static-BFDESDD4.js → web-shell-static-CCN4JZEE.js} +1 -1
- package/chunks/workflow-UHPFALVZ.js +1224 -0
- package/chunks/{workspace-providers-status-MAM42IZS.js → workspace-providers-status-AEYISSU2.js} +68 -61
- package/chunks/{workspace-registration-store-HKLJEDQX.js → workspace-registration-store-A7RGKW62.js} +3 -1
- package/chunks/{workspace-registry-7RDDOBLN.js → workspace-registry-C2NGE6SD.js} +62 -55
- package/chunks/{workspace-runtime-coordinator-LEPDPXJO.js → workspace-runtime-coordinator-QKMZ24YF.js} +63 -56
- package/chunks/{workspace-service-5IFDCNN3.js → workspace-service-RQTTAGGC.js} +70 -63
- package/chunks/{workspace-skills-status-FJ3HNH4H.js → workspace-skills-status-5HWZU3HX.js} +65 -58
- package/chunks/{workspace-trust-reconciler-PQFHIWLR.js → workspace-trust-reconciler-KFWATZUU.js} +69 -62
- package/chunks/{write-file-ERG67ZFX.js → write-file-DPVB2SBQ.js} +44 -38
- package/chunks/{zh-VBFCRQBL.js → zh-S5V3Z5CR.js} +1 -0
- package/chunks/{zh-TW-N2TBF2F2.js → zh-TW-2K2WRFPY.js} +1 -0
- package/chunks/{zoom-image-WQYEC3SR.js → zoom-image-S7AWLAPC.js} +12 -10
- package/cli.js +13 -13
- package/export-transcript-document.css +1 -0
- package/export-transcript-document.js +164 -165
- package/locales/en.js +1 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +5 -4
- package/web-shell/assets/{abnfDiagram-VCTEODGH-BRLgQbnT.js → abnfDiagram-VCTEODGH-nU24rpIE.js} +1 -1
- package/web-shell/assets/{arc-qAF9_XsR.js → arc-D1hTu8QI.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BorUttEz.js → architectureDiagram-5GKGNRK7-B_fgkKe7.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-Bj0qZVxu.js → blockDiagram-NRAW4CY4-C3pddUNg.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BTqJis32.js → c4Diagram-UCG6FXSJ-kEFoC1ei.js} +1 -1
- package/web-shell/assets/channel-Blod4z1X.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-RrQ5X8m-.js → chunk-2Q5K7J3B-DbT9wS7j.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-uUjDl8wO.js → chunk-5VM5RSS4-CNbULt6O.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-C3JhpyzI.js → chunk-F27PBJKO-CbQRy4Tb.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-C8ZNFs7F.js → chunk-G27WJ6UU-CVbXTxYk.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-DNpXtEOs.js → chunk-JWPE2WC7-D89c_BXy.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-DagA2ZLw.js → chunk-LCL6LL3I-B7-I_9KB.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-R23uH7Xm.js → chunk-POPQ4Y6H-DcLQFzS4.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-Qz9RN_BR.js → chunk-SVP7TREG-DyBb2Axj.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-jYb1_hni.js → chunk-XXDRQBXY-BIA0eb5B.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-D6hFDMqb.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-D6hFDMqb.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-Cv2OunpE.js → cose-bilkent-JH36ORCC-Db2FYN85.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-LH42KFJx.js → cynefin-OW5HDTMX-i4GwmBVy.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Dha4_OoR.js → cynefinDiagram-5FMLGOSQ-LENf_IUy.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-Br5lnUKD.js → dagre-3AP2YEHR-CF9XVrD9.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-dpKq2bBX.js → diagram-S7CK7UJ4-DD5PJfSm.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-BAgHWpXr.js → diagram-UQ7AKVKN-CjD_sBMj.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-GRRzpyE2.js → diagram-VSXAHHWV-U5WwMqyA.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-BNFiaYpG.js → diagram-VX7I27RA-BujpHJJf.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-BisZzB_h.js → diagram-Z3DM3KII-3ZLtKEXo.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-B1xbwycf.js → ebnfDiagram-PWID7BFC-BGpiquRm.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-CQMzbGE5.js → erDiagram-SSCWMZ5O-D0besu_U.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-CZ_Zondl.js → flowDiagram-A5DVABFB-9DwDuIyr.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BTh2ShxS.js → ganttDiagram-EL5Y4UJY-CNlsAeNr.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-oHOB-Uxt.js → gitGraphDiagram-WWUBYQGX-C_pPFiTR.js} +1 -1
- package/web-shell/assets/{index-DWoFMu5x.js → index-BYWs4JWq.js} +1 -1
- package/web-shell/assets/index-D3YS6KuJ.js +2173 -0
- package/web-shell/assets/index-eBxK3rs2.css +36 -0
- package/web-shell/assets/{infoDiagram-RXCK75RN-C0QpudbG.js → infoDiagram-RXCK75RN-Bpai64Ll.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-a6B741uT.js → ishikawaDiagram-5VMMS53U-ktpJFq4r.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-Dbht9ICp.js → journeyDiagram-EYS64GPL-iz_DKgFX.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-D4OFR8-h.js → kanban-definition-3QL26DDD-m_gG00Yt.js} +1 -1
- package/web-shell/assets/{layout-Dvdh5jRH.js → layout-qEvKgnvU.js} +1 -1
- package/web-shell/assets/{linear-Dvc6KIW2.js → linear-C6lklGdq.js} +1 -1
- package/web-shell/assets/{mermaid.core-CB36RfIb.js → mermaid.core-DSCYB_2P.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-Fmqo1CjP.js → mindmap-definition-FBJOCRG2-DRQbT8w-.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-CCxYBoA4.js → pegDiagram-XKGWAZYB-BhD0q0i6.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-BVHKQFzt.js → pieDiagram-E7YTZNPT-BvIGQCSd.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-l95IznwR.js → quadrantDiagram-AXDQQJYC-BDQtfpU-.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-BlLdRdXp.js → railroadDiagram-O6MQD6OU-E1g2KIFK.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BkDLBR5w.js → requirementDiagram-EFPCY7ZU-CuerYJOe.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-jAIqRp65.js → sankeyDiagram-P5KCCOFB-CqWyCZGA.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-f-soZYPr.js → sequenceDiagram-WJ2MYXX4-B-YWb8x4.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-BzOuAfB2.js → sizeCapture-X5ZJPWSS-BB7YY4Tl.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-BPLSs12r.js → stateDiagram-HBIQ2CUA-C8LDpNHS.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C4CbdvGa.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-D-9E_RIR.js → swimlanes-XN3QIQJK-D94vOoxZ.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN--QNSIOC8.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-CT56K-gV.js → timeline-definition-24CTP7MA-C9C8uEYm.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-B-vi4IyO.js → vennDiagram-4TSXK5OY-CYzMHbVW.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-C9O7Ju98.js → wardleyDiagram-VM6X3IG4-G9nhtLES.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-6d8w3jg2.js → xychartDiagram-S5SC5T6Z-ruD2Wjhg.js} +1 -1
- package/web-shell/index.html +29 -5
- package/chunks/chunk-V7RNNPGC.js +0 -44
- package/chunks/workflow-HD5NYMW5.js +0 -2907
- package/web-shell/assets/channel-COIuCrVH.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DoX6OYqu.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DoX6OYqu.js +0 -1
- package/web-shell/assets/index-CI1ysIEv.js +0 -2154
- package/web-shell/assets/index-CpxXGH-8.css +0 -36
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-IRul-LaT.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-D6lgKepA.js +0 -8
- /package/chunks/{chunk-JA5CBKRP.js → chunk-7NXSVSFB.js} +0 -0
|
@@ -0,0 +1,937 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
DASHSCOPE_PROXY_BASE_URL,
|
|
5
|
+
DEFAULT_DASHSCOPE_BASE_URL,
|
|
6
|
+
DEFAULT_MAX_RETRIES,
|
|
7
|
+
resolveRequestTimeout
|
|
8
|
+
} from "./chunk-JL6APGBX.js";
|
|
9
|
+
import {
|
|
10
|
+
buildSessionAwareFetch
|
|
11
|
+
} from "./chunk-NOO4QFXM.js";
|
|
12
|
+
import {
|
|
13
|
+
isQwenFamilyWireModel,
|
|
14
|
+
isTieredEffortWireModel
|
|
15
|
+
} from "./chunk-ZHKTKHMO.js";
|
|
16
|
+
import {
|
|
17
|
+
REASONING_EFFORT_TIERS,
|
|
18
|
+
clampReasoningEffort,
|
|
19
|
+
getGptReasoningCapabilities,
|
|
20
|
+
isReasoningEffortPlaceholder,
|
|
21
|
+
parseModelReasoningCapabilities
|
|
22
|
+
} from "./chunk-3FPYT6QC.js";
|
|
23
|
+
import {
|
|
24
|
+
defaultOutputCeiling,
|
|
25
|
+
hasExplicitOutputLimit,
|
|
26
|
+
parsePositiveIntegerEnvValue,
|
|
27
|
+
tokenLimit
|
|
28
|
+
} from "./chunk-FPGTNKCP.js";
|
|
29
|
+
import {
|
|
30
|
+
buildRuntimeFetchOptions
|
|
31
|
+
} from "./chunk-EWJTAP3Y.js";
|
|
32
|
+
import {
|
|
33
|
+
createDebugLogger
|
|
34
|
+
} from "./chunk-ZAFYHRVY.js";
|
|
35
|
+
import {
|
|
36
|
+
OpenAI
|
|
37
|
+
} from "./chunk-UKMWZ5NS.js";
|
|
38
|
+
import {
|
|
39
|
+
init_esbuild_shims
|
|
40
|
+
} from "./chunk-5O2XNYP6.js";
|
|
41
|
+
import {
|
|
42
|
+
__name
|
|
43
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
44
|
+
|
|
45
|
+
// packages/core/src/core/openaiContentGenerator/provider/default.ts
|
|
46
|
+
init_esbuild_shims();
|
|
47
|
+
|
|
48
|
+
// packages/core/src/core/openaiContentGenerator/provider/openrouter.ts
|
|
49
|
+
init_esbuild_shims();
|
|
50
|
+
function isOpenRouterHostname(contentGeneratorConfig) {
|
|
51
|
+
const baseUrl = contentGeneratorConfig.baseUrl ?? "";
|
|
52
|
+
if (!baseUrl) return false;
|
|
53
|
+
try {
|
|
54
|
+
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
55
|
+
return hostname === "openrouter.ai" || hostname.endsWith(".openrouter.ai");
|
|
56
|
+
} catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
__name(isOpenRouterHostname, "isOpenRouterHostname");
|
|
61
|
+
|
|
62
|
+
// packages/core/src/core/openaiContentGenerator/provider/default.ts
|
|
63
|
+
var debugLogger = createDebugLogger("DefaultOpenAICompatibleProvider");
|
|
64
|
+
var OPENAI_COMPATIBLE_EFFORTS = [
|
|
65
|
+
"low",
|
|
66
|
+
"medium",
|
|
67
|
+
"high",
|
|
68
|
+
"xhigh"
|
|
69
|
+
];
|
|
70
|
+
function isQwen3Model(model) {
|
|
71
|
+
return model.toLowerCase().includes("qwen3");
|
|
72
|
+
}
|
|
73
|
+
__name(isQwen3Model, "isQwen3Model");
|
|
74
|
+
function mirrorReasoningContentToReasoning(message) {
|
|
75
|
+
if (message.role !== "assistant") {
|
|
76
|
+
return message;
|
|
77
|
+
}
|
|
78
|
+
const assistant = message;
|
|
79
|
+
if (typeof assistant.reasoning_content !== "string" || assistant.reasoning_content.length === 0 || typeof assistant.reasoning === "string") {
|
|
80
|
+
return message;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
...assistant,
|
|
84
|
+
reasoning: assistant.reasoning_content
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
__name(mirrorReasoningContentToReasoning, "mirrorReasoningContentToReasoning");
|
|
88
|
+
var DefaultOpenAICompatibleProvider = class {
|
|
89
|
+
static {
|
|
90
|
+
__name(this, "DefaultOpenAICompatibleProvider");
|
|
91
|
+
}
|
|
92
|
+
contentGeneratorConfig;
|
|
93
|
+
cliConfig;
|
|
94
|
+
/**
|
|
95
|
+
* Latch so an effort-clamp warning fires once per provider lifetime. Shared
|
|
96
|
+
* with subclasses that clamp on their own wire shape (see DashScope) so one
|
|
97
|
+
* provider instance never repeats the notice.
|
|
98
|
+
*/
|
|
99
|
+
effortClampWarned = false;
|
|
100
|
+
constructor(contentGeneratorConfig, cliConfig) {
|
|
101
|
+
this.cliConfig = cliConfig;
|
|
102
|
+
this.contentGeneratorConfig = contentGeneratorConfig;
|
|
103
|
+
}
|
|
104
|
+
buildHeaders() {
|
|
105
|
+
const version = this.cliConfig.getCliVersion() || "unknown";
|
|
106
|
+
const userAgent = `QwenCode/${version} (${process.platform}; ${process.arch})`;
|
|
107
|
+
const { customHeaders } = this.contentGeneratorConfig;
|
|
108
|
+
const defaultHeaders = {
|
|
109
|
+
"User-Agent": userAgent
|
|
110
|
+
};
|
|
111
|
+
return customHeaders ? { ...defaultHeaders, ...customHeaders } : defaultHeaders;
|
|
112
|
+
}
|
|
113
|
+
buildClient() {
|
|
114
|
+
const {
|
|
115
|
+
apiKey,
|
|
116
|
+
baseUrl,
|
|
117
|
+
maxRetries = DEFAULT_MAX_RETRIES
|
|
118
|
+
} = this.contentGeneratorConfig;
|
|
119
|
+
const timeout = resolveRequestTimeout(this.contentGeneratorConfig.timeout);
|
|
120
|
+
const defaultHeaders = this.buildHeaders();
|
|
121
|
+
const runtimeOptions = buildRuntimeFetchOptions(
|
|
122
|
+
"openai",
|
|
123
|
+
this.cliConfig.getProxy()
|
|
124
|
+
);
|
|
125
|
+
return new OpenAI({
|
|
126
|
+
apiKey,
|
|
127
|
+
baseURL: baseUrl,
|
|
128
|
+
timeout,
|
|
129
|
+
maxRetries,
|
|
130
|
+
defaultHeaders,
|
|
131
|
+
...runtimeOptions || {},
|
|
132
|
+
fetch: buildSessionAwareFetch(
|
|
133
|
+
runtimeOptions?.fetch,
|
|
134
|
+
this.cliConfig,
|
|
135
|
+
this.contentGeneratorConfig.customHeaders
|
|
136
|
+
)
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Effort tiers this endpoint accepts for `model`. Takes the wire model
|
|
141
|
+
* rather than reading the configured one, because a request may override it
|
|
142
|
+
* (`pipeline.ts` resolves `request.model || contentGeneratorConfig.model`),
|
|
143
|
+
* and a capability answered for the wrong model is how an unaccepted tier
|
|
144
|
+
* reaches the wire. Override in a subclass whose endpoint takes `max`; the
|
|
145
|
+
* clamp calls it through `this`, so a subclass answer applies even on the
|
|
146
|
+
* `super.buildRequest` path.
|
|
147
|
+
*/
|
|
148
|
+
supportedReasoningEffortsFor(model) {
|
|
149
|
+
const gpt = getGptReasoningCapabilities(model);
|
|
150
|
+
if (!gpt) return OPENAI_COMPATIBLE_EFFORTS;
|
|
151
|
+
const { authType, baseUrl } = this.contentGeneratorConfig;
|
|
152
|
+
const configured = authType && model ? parseModelReasoningCapabilities(
|
|
153
|
+
this.cliConfig.getResolvedModelConfig?.(authType, model, baseUrl)?.capabilities.reasoning
|
|
154
|
+
) : void 0;
|
|
155
|
+
return configured && !configured.toggleOnly ? configured.efforts : gpt.efforts;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Cap the pipeline-injected `reasoning.effort` at what this endpoint accepts.
|
|
159
|
+
* The tier is configured once (`/effort`) and persisted, so an unaccepted
|
|
160
|
+
* value is not a one-off rejection: it 400s every later request in the
|
|
161
|
+
* session too.
|
|
162
|
+
*
|
|
163
|
+
* Only the pipeline-injected tier is capped. A `reasoning` object the user
|
|
164
|
+
* put in `samplingParams` ships verbatim. Unrelated GPT sampling options
|
|
165
|
+
* still receive the configured effort and need clamping. `extra_body`
|
|
166
|
+
* merges after this, so both explicit overrides survive unchanged.
|
|
167
|
+
*/
|
|
168
|
+
clampConfiguredReasoningEffort(request) {
|
|
169
|
+
if (this.contentGeneratorConfig.samplingParams?.["reasoning"] !== void 0) {
|
|
170
|
+
return request;
|
|
171
|
+
}
|
|
172
|
+
const loose = request;
|
|
173
|
+
const reasoning = loose["reasoning"];
|
|
174
|
+
const effort = reasoning?.effort;
|
|
175
|
+
if (typeof effort !== "string" || !REASONING_EFFORT_TIERS.includes(effort)) {
|
|
176
|
+
return request;
|
|
177
|
+
}
|
|
178
|
+
const clamped = clampReasoningEffort(
|
|
179
|
+
effort,
|
|
180
|
+
this.supportedReasoningEffortsFor(
|
|
181
|
+
loose["model"] ?? this.contentGeneratorConfig.model
|
|
182
|
+
)
|
|
183
|
+
);
|
|
184
|
+
if (clamped === effort) {
|
|
185
|
+
return request;
|
|
186
|
+
}
|
|
187
|
+
if (!this.effortClampWarned) {
|
|
188
|
+
debugLogger.warn(
|
|
189
|
+
`reasoning.effort='${effort}' is not accepted by this OpenAI-compatible endpoint; using '${clamped}'.`
|
|
190
|
+
);
|
|
191
|
+
this.effortClampWarned = true;
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
...loose,
|
|
195
|
+
reasoning: { ...reasoning, effort: clamped }
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
buildRequest(request, _userPromptId) {
|
|
199
|
+
const extraBody = this.contentGeneratorConfig.extra_body;
|
|
200
|
+
const requestWithTokenLimits = this.clampConfiguredReasoningEffort(
|
|
201
|
+
this.applyOutputTokenLimit(request)
|
|
202
|
+
);
|
|
203
|
+
const messages = isQwen3Model(request.model) ? requestWithTokenLimits.messages.map(mirrorReasoningContentToReasoning) : requestWithTokenLimits.messages;
|
|
204
|
+
const result = {
|
|
205
|
+
...requestWithTokenLimits,
|
|
206
|
+
messages,
|
|
207
|
+
...extraBody ? extraBody : {}
|
|
208
|
+
};
|
|
209
|
+
this.flattenGptReasoningEffort(result);
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
flattenGptReasoningEffort(body) {
|
|
213
|
+
if (!getGptReasoningCapabilities(body["model"]) || isOpenRouterHostname(this.contentGeneratorConfig) || this.contentGeneratorConfig.samplingParams?.["reasoning"] !== void 0 || this.contentGeneratorConfig.extra_body?.["reasoning"] !== void 0)
|
|
214
|
+
return;
|
|
215
|
+
const reasoning = body["reasoning"];
|
|
216
|
+
if (typeof reasoning?.effort !== "string" || !reasoning.effort) return;
|
|
217
|
+
if (isReasoningEffortPlaceholder(body["reasoning_effort"])) {
|
|
218
|
+
body["reasoning_effort"] = reasoning.effort;
|
|
219
|
+
}
|
|
220
|
+
const { effort: _drop, ...rest } = reasoning;
|
|
221
|
+
if (Object.keys(rest).length > 0) body["reasoning"] = rest;
|
|
222
|
+
else delete body["reasoning"];
|
|
223
|
+
}
|
|
224
|
+
getDefaultGenerationConfig() {
|
|
225
|
+
return {};
|
|
226
|
+
}
|
|
227
|
+
getResponseParsingOptions(model) {
|
|
228
|
+
return {
|
|
229
|
+
contentOnlyThinkingTagLeaks: true,
|
|
230
|
+
...model && isQwen3Model(model) ? { taggedThinkingTagsAfterReasoning: true } : {}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Apply output token limit to a request's max_tokens parameter.
|
|
235
|
+
*
|
|
236
|
+
* Purpose:
|
|
237
|
+
* Some APIs (e.g., OpenAI-compatible) default to a very small max_tokens value,
|
|
238
|
+
* which can cause responses to be truncated mid-output. This function ensures
|
|
239
|
+
* a reasonable default is set while respecting user configuration.
|
|
240
|
+
*
|
|
241
|
+
* Logic:
|
|
242
|
+
* 1. If user explicitly configured max_tokens:
|
|
243
|
+
* - For known models (in OUTPUT_PATTERNS): use the user's value, but cap at
|
|
244
|
+
* model's max output limit to avoid API errors
|
|
245
|
+
* (input + max_output > contextWindowSize would cause 400 errors on some APIs)
|
|
246
|
+
* - For unknown models (deployment aliases, self-hosted): respect user's
|
|
247
|
+
* configured value entirely (backend may support larger limits)
|
|
248
|
+
* 2. If user didn't configure max_tokens:
|
|
249
|
+
* - Check QWEN_CODE_MAX_OUTPUT_TOKENS env var first
|
|
250
|
+
* - Otherwise use the model's output limit, clipped to
|
|
251
|
+
* OUTPUT_TOKEN_CEILING (64K)
|
|
252
|
+
* 3. If model has no specific limit (tokenLimit returns default):
|
|
253
|
+
* - Use DEFAULT_OUTPUT_TOKEN_LIMIT
|
|
254
|
+
*
|
|
255
|
+
* Examples:
|
|
256
|
+
* - User sets 4K, known model limit 64K → uses 4K (respects user preference)
|
|
257
|
+
* - User sets 100K, known model limit 64K → uses 64K (capped to avoid API error)
|
|
258
|
+
* - User sets 100K, unknown model → uses 100K (respects user, backend may support it)
|
|
259
|
+
* - User not set, model limit 64K → uses 64K
|
|
260
|
+
* - User not set, model limit 4K → uses 4K (model limit is lower)
|
|
261
|
+
* - User not set, env QWEN_CODE_MAX_OUTPUT_TOKENS=16000 -> uses 16K
|
|
262
|
+
*
|
|
263
|
+
* @param request - The chat completion request parameters
|
|
264
|
+
* @returns The request with max_tokens adjusted according to the logic
|
|
265
|
+
*/
|
|
266
|
+
applyOutputTokenLimit(request) {
|
|
267
|
+
if (this.contentGeneratorConfig.samplingParams !== void 0) {
|
|
268
|
+
return request;
|
|
269
|
+
}
|
|
270
|
+
const userMaxTokens = request.max_tokens;
|
|
271
|
+
const modelLimit = tokenLimit(request.model, "output");
|
|
272
|
+
const isKnownModel = hasExplicitOutputLimit(request.model);
|
|
273
|
+
let effectiveMaxTokens;
|
|
274
|
+
if (userMaxTokens !== void 0 && userMaxTokens !== null) {
|
|
275
|
+
if (isKnownModel) {
|
|
276
|
+
effectiveMaxTokens = Math.min(userMaxTokens, modelLimit);
|
|
277
|
+
} else {
|
|
278
|
+
effectiveMaxTokens = userMaxTokens;
|
|
279
|
+
}
|
|
280
|
+
} else {
|
|
281
|
+
const envMaxTokens = parsePositiveIntegerEnvValue(
|
|
282
|
+
process.env["QWEN_CODE_MAX_OUTPUT_TOKENS"]
|
|
283
|
+
);
|
|
284
|
+
if (envMaxTokens !== void 0) {
|
|
285
|
+
effectiveMaxTokens = isKnownModel ? Math.min(envMaxTokens, modelLimit) : envMaxTokens;
|
|
286
|
+
} else {
|
|
287
|
+
effectiveMaxTokens = defaultOutputCeiling(request.model);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
...request,
|
|
292
|
+
max_tokens: effectiveMaxTokens
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// packages/core/src/core/openaiContentGenerator/provider/dashscope.ts
|
|
298
|
+
init_esbuild_shims();
|
|
299
|
+
var debugLogger2 = createDebugLogger("DashScopeOpenAICompatibleProvider");
|
|
300
|
+
var DASHSCOPE_TIERED_EFFORTS = [
|
|
301
|
+
"low",
|
|
302
|
+
"medium",
|
|
303
|
+
"high",
|
|
304
|
+
"xhigh"
|
|
305
|
+
];
|
|
306
|
+
function selectDashScopeThinkingKnob(model, extraBody, samplingParams, reasoningEffort, tieredModel = isTieredEffortWireModel(model)) {
|
|
307
|
+
if (!tieredModel) {
|
|
308
|
+
return void 0;
|
|
309
|
+
}
|
|
310
|
+
const selectFromLayer = /* @__PURE__ */ __name((source, layer) => {
|
|
311
|
+
if (layer?.["enable_thinking"] === false) {
|
|
312
|
+
return { source, field: "enable_thinking", value: false };
|
|
313
|
+
}
|
|
314
|
+
return selectValueFromLayer(source, layer) ?? selectOnSwitch(source, layer);
|
|
315
|
+
}, "selectFromLayer");
|
|
316
|
+
const selectValueFromLayer = /* @__PURE__ */ __name((source, layer) => {
|
|
317
|
+
if (layer?.["reasoning_effort"] != null) {
|
|
318
|
+
return {
|
|
319
|
+
source,
|
|
320
|
+
field: "reasoning_effort",
|
|
321
|
+
value: layer["reasoning_effort"]
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
if (layer?.["thinking_budget"] != null) {
|
|
325
|
+
return {
|
|
326
|
+
source,
|
|
327
|
+
field: "thinking_budget",
|
|
328
|
+
value: layer["thinking_budget"]
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
return void 0;
|
|
332
|
+
}, "selectValueFromLayer");
|
|
333
|
+
const selectOnSwitch = /* @__PURE__ */ __name((source, layer) => {
|
|
334
|
+
if (layer?.["enable_thinking"] === true) {
|
|
335
|
+
return { source, field: "enable_thinking", value: true };
|
|
336
|
+
}
|
|
337
|
+
return void 0;
|
|
338
|
+
}, "selectOnSwitch");
|
|
339
|
+
const reasoningSelection = reasoningEffort !== void 0 ? {
|
|
340
|
+
source: "reasoning",
|
|
341
|
+
field: "reasoning_effort",
|
|
342
|
+
value: reasoningEffort
|
|
343
|
+
} : void 0;
|
|
344
|
+
const extraBodySelection = selectFromLayer("extra_body", extraBody);
|
|
345
|
+
if (extraBodySelection?.field === "enable_thinking" && extraBodySelection.value === true) {
|
|
346
|
+
return selectValueFromLayer("samplingParams", samplingParams) ?? reasoningSelection ?? extraBodySelection;
|
|
347
|
+
}
|
|
348
|
+
if (extraBodySelection) {
|
|
349
|
+
return extraBodySelection;
|
|
350
|
+
}
|
|
351
|
+
const samplingSelection = selectFromLayer("samplingParams", samplingParams);
|
|
352
|
+
return samplingSelection?.field === "enable_thinking" && samplingSelection.value === true ? reasoningSelection ?? samplingSelection : samplingSelection ?? reasoningSelection;
|
|
353
|
+
}
|
|
354
|
+
__name(selectDashScopeThinkingKnob, "selectDashScopeThinkingKnob");
|
|
355
|
+
function withoutNullishThinkingKnobs(layer) {
|
|
356
|
+
if (!layer) {
|
|
357
|
+
return void 0;
|
|
358
|
+
}
|
|
359
|
+
const hasNullishEnableThinking = "enable_thinking" in layer && layer["enable_thinking"] == null;
|
|
360
|
+
const hasNullishEffort = "reasoning_effort" in layer && layer["reasoning_effort"] == null;
|
|
361
|
+
const hasNullishBudget = "thinking_budget" in layer && layer["thinking_budget"] == null;
|
|
362
|
+
if (!hasNullishEnableThinking && !hasNullishEffort && !hasNullishBudget) {
|
|
363
|
+
return layer;
|
|
364
|
+
}
|
|
365
|
+
const sanitized = { ...layer };
|
|
366
|
+
if (hasNullishEnableThinking) {
|
|
367
|
+
delete sanitized["enable_thinking"];
|
|
368
|
+
}
|
|
369
|
+
if (hasNullishEffort) {
|
|
370
|
+
delete sanitized["reasoning_effort"];
|
|
371
|
+
}
|
|
372
|
+
if (hasNullishBudget) {
|
|
373
|
+
delete sanitized["thinking_budget"];
|
|
374
|
+
}
|
|
375
|
+
return sanitized;
|
|
376
|
+
}
|
|
377
|
+
__name(withoutNullishThinkingKnobs, "withoutNullishThinkingKnobs");
|
|
378
|
+
var DASHSCOPE_REGIONAL_HOSTS = [
|
|
379
|
+
"dashscope.aliyuncs.com",
|
|
380
|
+
"dashscope-intl.aliyuncs.com",
|
|
381
|
+
"dashscope-us.aliyuncs.com"
|
|
382
|
+
];
|
|
383
|
+
var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider extends DefaultOpenAICompatibleProvider {
|
|
384
|
+
static {
|
|
385
|
+
__name(this, "DashScopeOpenAICompatibleProvider");
|
|
386
|
+
}
|
|
387
|
+
constructor(contentGeneratorConfig, cliConfig) {
|
|
388
|
+
super(contentGeneratorConfig, cliConfig);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Determines whether to use the DashScope-compatible provider.
|
|
392
|
+
* Covers the official regional hosts (DASHSCOPE_REGIONAL_HOSTS),
|
|
393
|
+
* Token Plan endpoints under token-plan.<region>.maas.aliyuncs.com,
|
|
394
|
+
* internal Alibaba domains (*.alibaba-inc.com, *.aliyun-inc.com),
|
|
395
|
+
* Alibaba Cloud API Gateway domains (*.alicloudapi.com),
|
|
396
|
+
* and proxy matches.
|
|
397
|
+
*
|
|
398
|
+
* Note: any *.alibaba-inc.com / *.aliyun-inc.com host is treated as a
|
|
399
|
+
* DashScope-compatible endpoint by design. Keep this generic and avoid
|
|
400
|
+
* embedding individual private gateway hostnames in provider detection.
|
|
401
|
+
*/
|
|
402
|
+
static isDashScopeProvider(contentGeneratorConfig) {
|
|
403
|
+
const { authType, baseUrl } = contentGeneratorConfig;
|
|
404
|
+
if (authType === "qwen-oauth" /* QWEN_OAUTH */) return true;
|
|
405
|
+
if (!baseUrl) return true;
|
|
406
|
+
const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
407
|
+
let hostname = null;
|
|
408
|
+
try {
|
|
409
|
+
hostname = new URL(normalizedBaseUrl).hostname.toLowerCase();
|
|
410
|
+
} catch {
|
|
411
|
+
hostname = null;
|
|
412
|
+
}
|
|
413
|
+
const isDashscopeOrigin = hostname !== null && DASHSCOPE_REGIONAL_HOSTS.some(
|
|
414
|
+
(host) => hostname === host || hostname.endsWith("." + host)
|
|
415
|
+
);
|
|
416
|
+
const isTokenPlanOrigin = hostname !== null && hostname.startsWith("token-plan.") && hostname.endsWith(".maas.aliyuncs.com");
|
|
417
|
+
const isInternalOrigin = hostname !== null && (hostname.endsWith(".alibaba-inc.com") || hostname.endsWith(".aliyun-inc.com"));
|
|
418
|
+
const isAliCloudApiOrigin = hostname !== null && hostname.endsWith(".alicloudapi.com");
|
|
419
|
+
const normalizedProxyUrl = DASHSCOPE_PROXY_BASE_URL?.endsWith("/") ? DASHSCOPE_PROXY_BASE_URL.slice(0, -1) : DASHSCOPE_PROXY_BASE_URL;
|
|
420
|
+
const isProxyMatch = Boolean(
|
|
421
|
+
normalizedProxyUrl && normalizedBaseUrl.toLowerCase() === normalizedProxyUrl.toLowerCase()
|
|
422
|
+
);
|
|
423
|
+
if (normalizedProxyUrl && !isDashscopeOrigin && !isTokenPlanOrigin && !isInternalOrigin && !isAliCloudApiOrigin && !isProxyMatch) {
|
|
424
|
+
debugLogger2.debug(
|
|
425
|
+
`DASHSCOPE_PROXY_BASE_URL is configured but the request baseUrl does not match. DashScope headers/cache control will be skipped.`
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
if (isInternalOrigin) {
|
|
429
|
+
debugLogger2.debug(
|
|
430
|
+
`DashScope provider activated via internal origin: ${hostname}`
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
if (isAliCloudApiOrigin) {
|
|
434
|
+
debugLogger2.debug(
|
|
435
|
+
`DashScope provider activated via alicloudapi origin: ${hostname}`
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
return isDashscopeOrigin || isTokenPlanOrigin || isInternalOrigin || isAliCloudApiOrigin || isProxyMatch;
|
|
439
|
+
}
|
|
440
|
+
buildHeaders() {
|
|
441
|
+
const version = this.cliConfig.getCliVersion() || "unknown";
|
|
442
|
+
const userAgent = `QwenCode/${version} (${process.platform}; ${process.arch})`;
|
|
443
|
+
const { authType, customHeaders } = this.contentGeneratorConfig;
|
|
444
|
+
const defaultHeaders = {
|
|
445
|
+
"User-Agent": userAgent,
|
|
446
|
+
"X-DashScope-CacheControl": "enable",
|
|
447
|
+
"X-DashScope-UserAgent": userAgent,
|
|
448
|
+
"X-DashScope-AuthType": authType
|
|
449
|
+
};
|
|
450
|
+
return customHeaders ? { ...defaultHeaders, ...customHeaders } : defaultHeaders;
|
|
451
|
+
}
|
|
452
|
+
buildClient() {
|
|
453
|
+
const {
|
|
454
|
+
apiKey,
|
|
455
|
+
baseUrl = DEFAULT_DASHSCOPE_BASE_URL,
|
|
456
|
+
maxRetries = DEFAULT_MAX_RETRIES
|
|
457
|
+
} = this.contentGeneratorConfig;
|
|
458
|
+
const timeout = resolveRequestTimeout(this.contentGeneratorConfig.timeout);
|
|
459
|
+
const defaultHeaders = this.buildHeaders();
|
|
460
|
+
const runtimeOptions = buildRuntimeFetchOptions(
|
|
461
|
+
"openai",
|
|
462
|
+
this.cliConfig.getProxy()
|
|
463
|
+
);
|
|
464
|
+
return new OpenAI({
|
|
465
|
+
apiKey,
|
|
466
|
+
baseURL: baseUrl,
|
|
467
|
+
timeout,
|
|
468
|
+
maxRetries,
|
|
469
|
+
defaultHeaders,
|
|
470
|
+
...runtimeOptions || {},
|
|
471
|
+
fetch: buildSessionAwareFetch(
|
|
472
|
+
runtimeOptions?.fetch,
|
|
473
|
+
this.cliConfig,
|
|
474
|
+
this.contentGeneratorConfig.customHeaders
|
|
475
|
+
)
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Build and configure the request for DashScope API.
|
|
480
|
+
*
|
|
481
|
+
* This method applies DashScope-specific configurations including:
|
|
482
|
+
* - Cache control for the system message, last tool message (when tools are configured),
|
|
483
|
+
* and the latest history message
|
|
484
|
+
* - Output token limits based on model capabilities
|
|
485
|
+
* - Vision model specific parameters (vl_high_resolution_images)
|
|
486
|
+
* - Request metadata for session tracking
|
|
487
|
+
*
|
|
488
|
+
* @param request - The original chat completion request parameters
|
|
489
|
+
* @param userPromptId - Unique identifier for the user prompt for session tracking
|
|
490
|
+
* @returns Configured request with DashScope-specific parameters applied
|
|
491
|
+
*/
|
|
492
|
+
buildRequest(request, userPromptId) {
|
|
493
|
+
let messages = request.messages;
|
|
494
|
+
let tools = request.tools;
|
|
495
|
+
const flattenPlainTextForGlm = this.isGlmModel(request.model) && !this.hasFunctionCallingContext(request);
|
|
496
|
+
if (flattenPlainTextForGlm) {
|
|
497
|
+
messages = this.flattenTextContent(messages);
|
|
498
|
+
} else if (this.shouldEnableCacheControl()) {
|
|
499
|
+
const { messages: updatedMessages, tools: updatedTools } = this.addDashScopeCacheControl(
|
|
500
|
+
request,
|
|
501
|
+
request.stream ? "all" : "system_only"
|
|
502
|
+
);
|
|
503
|
+
messages = updatedMessages;
|
|
504
|
+
tools = updatedTools;
|
|
505
|
+
}
|
|
506
|
+
const requestWithTokenLimits = this.applyOutputTokenLimit(request);
|
|
507
|
+
const isTieredQwenModel = this.isTieredEffortModel(request.model);
|
|
508
|
+
const extraBody = isTieredQwenModel ? withoutNullishThinkingKnobs(this.contentGeneratorConfig.extra_body) : this.contentGeneratorConfig.extra_body;
|
|
509
|
+
const qwenEffortConfig = this.buildQwenEffortConfig(request.model);
|
|
510
|
+
const rawRequestParams = requestWithTokenLimits;
|
|
511
|
+
const requestParams = isTieredQwenModel ? withoutNullishThinkingKnobs(rawRequestParams) : rawRequestParams;
|
|
512
|
+
if ("reasoning_effort" in requestParams && "reasoning_effort" in qwenEffortConfig) {
|
|
513
|
+
qwenEffortConfig["reasoning_effort"] = requestParams["reasoning_effort"];
|
|
514
|
+
}
|
|
515
|
+
const hasQwenEffortConfig = Object.keys(qwenEffortConfig).length > 0;
|
|
516
|
+
const selectedThinkingKnob = isTieredQwenModel ? selectDashScopeThinkingKnob(
|
|
517
|
+
this.resolveWireModel(request.model),
|
|
518
|
+
extraBody,
|
|
519
|
+
requestParams,
|
|
520
|
+
qwenEffortConfig["reasoning_effort"],
|
|
521
|
+
isTieredQwenModel
|
|
522
|
+
) : void 0;
|
|
523
|
+
if (this.isVisionModel(request.model)) {
|
|
524
|
+
const dashscopeExtras2 = {
|
|
525
|
+
vl_high_resolution_images: true,
|
|
526
|
+
preserve_thinking: true,
|
|
527
|
+
...qwenEffortConfig
|
|
528
|
+
};
|
|
529
|
+
const visionResult = {
|
|
530
|
+
...requestParams,
|
|
531
|
+
messages,
|
|
532
|
+
...tools ? { tools } : {},
|
|
533
|
+
...this.buildMetadata(userPromptId) || {},
|
|
534
|
+
...dashscopeExtras2
|
|
535
|
+
};
|
|
536
|
+
if (hasQwenEffortConfig && "reasoning" in visionResult) {
|
|
537
|
+
delete visionResult["reasoning"];
|
|
538
|
+
}
|
|
539
|
+
return this.mergeExtraBodyAndResolveKnobs(
|
|
540
|
+
hasQwenEffortConfig ? visionResult : this.clampConfiguredReasoningEffort(visionResult),
|
|
541
|
+
extraBody,
|
|
542
|
+
request.model,
|
|
543
|
+
selectedThinkingKnob
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
const dashscopeExtras = {
|
|
547
|
+
preserve_thinking: true,
|
|
548
|
+
...qwenEffortConfig
|
|
549
|
+
};
|
|
550
|
+
const result = {
|
|
551
|
+
...requestParams,
|
|
552
|
+
// Preserve all original parameters including sampling params and adjusted max_tokens
|
|
553
|
+
messages,
|
|
554
|
+
...tools ? { tools } : {},
|
|
555
|
+
...this.buildMetadata(userPromptId) || {},
|
|
556
|
+
...dashscopeExtras
|
|
557
|
+
};
|
|
558
|
+
if (hasQwenEffortConfig && "reasoning" in result) {
|
|
559
|
+
delete result["reasoning"];
|
|
560
|
+
}
|
|
561
|
+
return this.mergeExtraBodyAndResolveKnobs(
|
|
562
|
+
hasQwenEffortConfig ? result : this.clampConfiguredReasoningEffort(result),
|
|
563
|
+
extraBody,
|
|
564
|
+
request.model,
|
|
565
|
+
selectedThinkingKnob
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Shared tail for the vision and text branches: merge user extra_body
|
|
570
|
+
* last, then resolve thinking-knob conflicts against the wire model.
|
|
571
|
+
*/
|
|
572
|
+
mergeExtraBodyAndResolveKnobs(result, extraBody, model, selectedThinkingKnob) {
|
|
573
|
+
const merged = {
|
|
574
|
+
...result,
|
|
575
|
+
...extraBody ? extraBody : {}
|
|
576
|
+
};
|
|
577
|
+
const reasoningEffort = merged["reasoning_effort"];
|
|
578
|
+
const dropped = /* @__PURE__ */ new Set();
|
|
579
|
+
if (selectedThinkingKnob?.field === "thinking_budget") {
|
|
580
|
+
if (reasoningEffort !== void 0) {
|
|
581
|
+
dropped.add("reasoning_effort");
|
|
582
|
+
}
|
|
583
|
+
if (merged["enable_thinking"] === false) {
|
|
584
|
+
dropped.add("enable_thinking");
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
if (selectedThinkingKnob?.field === "reasoning_effort" && merged["thinking_budget"] !== void 0) {
|
|
588
|
+
dropped.add("thinking_budget");
|
|
589
|
+
}
|
|
590
|
+
for (const key of dropped) {
|
|
591
|
+
delete merged[key];
|
|
592
|
+
}
|
|
593
|
+
for (const key of this.dropConflictingThinkingKnobs(
|
|
594
|
+
model,
|
|
595
|
+
merged,
|
|
596
|
+
selectedThinkingKnob
|
|
597
|
+
)) {
|
|
598
|
+
dropped.add(key);
|
|
599
|
+
}
|
|
600
|
+
this.warnConflictingKnobDrop(model, reasoningEffort, [...dropped]);
|
|
601
|
+
this.flattenGptReasoningEffort(merged);
|
|
602
|
+
return merged;
|
|
603
|
+
}
|
|
604
|
+
getConfiguredReasoning(model) {
|
|
605
|
+
const { authType, baseUrl } = this.contentGeneratorConfig;
|
|
606
|
+
const wireModel = model ?? this.contentGeneratorConfig.model;
|
|
607
|
+
const reasoning = authType ? this.cliConfig.getResolvedModelConfig?.(authType, wireModel, baseUrl)?.capabilities.reasoning : void 0;
|
|
608
|
+
return parseModelReasoningCapabilities(reasoning);
|
|
609
|
+
}
|
|
610
|
+
isTieredEffortModel(model) {
|
|
611
|
+
return isTieredEffortWireModel(
|
|
612
|
+
model ?? this.contentGeneratorConfig.model,
|
|
613
|
+
this.getConfiguredReasoning(model)
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
resolveWireModel(model) {
|
|
617
|
+
return (model ?? this.contentGeneratorConfig.model ?? "").toLowerCase();
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Translate the unified reasoning effort into the wire shape the model
|
|
621
|
+
* accepts. The qwen3.8-max family takes the tiered `reasoning_effort`
|
|
622
|
+
* directly; older qwen hybrid models expose only the on/off
|
|
623
|
+
* `enable_thinking` switch, so the effort ladder collapses to on/off
|
|
624
|
+
* there. Gated to qwen-family wire models (mirroring the pipeline's
|
|
625
|
+
* disable gate) so the qwen-specific fields never leak to a non-qwen
|
|
626
|
+
* model sharing the DashScope endpoint.
|
|
627
|
+
*/
|
|
628
|
+
buildQwenEffortConfig(model) {
|
|
629
|
+
const reasoning = this.contentGeneratorConfig.reasoning;
|
|
630
|
+
if (!reasoning || reasoning.effort === void 0) {
|
|
631
|
+
return {};
|
|
632
|
+
}
|
|
633
|
+
const wireModel = this.resolveWireModel(model);
|
|
634
|
+
if (this.isTieredEffortModel(model)) {
|
|
635
|
+
const configured = this.getConfiguredReasoning(model);
|
|
636
|
+
if (configured && !configured.toggleOnly) {
|
|
637
|
+
return configured.efforts.includes(reasoning.effort) ? { reasoning_effort: reasoning.effort } : {};
|
|
638
|
+
}
|
|
639
|
+
return { reasoning_effort: this.clampTieredEffort(reasoning.effort) };
|
|
640
|
+
}
|
|
641
|
+
if (isQwenFamilyWireModel(wireModel)) {
|
|
642
|
+
return { enable_thinking: true };
|
|
643
|
+
}
|
|
644
|
+
return {};
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Preserve the legacy clamp for a route without an explicit capability.
|
|
648
|
+
* Only the unified reasoning.effort preference reaches this fallback;
|
|
649
|
+
* extra_body and samplingParams remain verbatim provider overrides.
|
|
650
|
+
*/
|
|
651
|
+
clampTieredEffort(effort) {
|
|
652
|
+
const clamped = clampReasoningEffort(effort, DASHSCOPE_TIERED_EFFORTS);
|
|
653
|
+
if (clamped !== effort && !this.effortClampWarned) {
|
|
654
|
+
debugLogger2.warn(
|
|
655
|
+
`reasoning.effort='${effort}' is not accepted by the DashScope tiered-effort family; using '${clamped}'.`
|
|
656
|
+
);
|
|
657
|
+
this.effortClampWarned = true;
|
|
658
|
+
}
|
|
659
|
+
return clamped;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Resolve thinking knobs that conflict with a shipping `reasoning_effort`.
|
|
663
|
+
* Preset extra_body injects `enable_thinking` for models declared with
|
|
664
|
+
* enableThinking (provider-config.ts), and user extra_body merges last.
|
|
665
|
+
* Only the qwen3.8-max family reads `reasoning_effort` itself — there an
|
|
666
|
+
* effort tier ships alone: an `enable_thinking: true` alongside an effort
|
|
667
|
+
* tier is a second competing knob (the shape the nested-`reasoning` strip
|
|
668
|
+
* in buildRequest exists to prevent), and DashScope rejects
|
|
669
|
+
* `reasoning_effort` combined with `thinking_budget`. The `'none'`
|
|
670
|
+
* disable and a winning `thinking_budget` intentionally keep a co-present
|
|
671
|
+
* `enable_thinking: true`. Explicit same-layer effort/budget pairs retain
|
|
672
|
+
* reasoning_effort, matching the provider's behavior before cross-layer
|
|
673
|
+
* resolution. An explicit `enable_thinking: false` is the documented
|
|
674
|
+
* extra_body escape hatch winning over the config tier, so it is honoured
|
|
675
|
+
* as the family's canonical disable (`reasoning_effort: 'none'`, preserved
|
|
676
|
+
* by the pipeline's disable strip) rather than silently deleted; a
|
|
677
|
+
* higher-priority `enable_thinking: true` conversely keeps the shipping
|
|
678
|
+
* tier. Older qwen
|
|
679
|
+
* hybrids read `enable_thinking` / `thinking_budget`, not
|
|
680
|
+
* `reasoning_effort`, so when an opaque reasoning_effort override
|
|
681
|
+
* conflicts with a meaningful thinking_budget the inert field goes and
|
|
682
|
+
* the knobs the model reads survive. Non-qwen models treat
|
|
683
|
+
* `reasoning_effort` as an opaque sampling override and keep every knob.
|
|
684
|
+
*/
|
|
685
|
+
dropConflictingThinkingKnobs(model, merged, selectedThinkingKnob) {
|
|
686
|
+
const wireModel = this.resolveWireModel(model);
|
|
687
|
+
if (!isQwenFamilyWireModel(wireModel)) {
|
|
688
|
+
return [];
|
|
689
|
+
}
|
|
690
|
+
const isTieredEffortModel = this.isTieredEffortModel(model);
|
|
691
|
+
if (isTieredEffortModel && selectedThinkingKnob?.field === "enable_thinking" && selectedThinkingKnob.value === false) {
|
|
692
|
+
merged["reasoning_effort"] = "none";
|
|
693
|
+
const dropped = ["enable_thinking"];
|
|
694
|
+
if (merged["thinking_budget"] !== void 0) {
|
|
695
|
+
dropped.push("thinking_budget");
|
|
696
|
+
}
|
|
697
|
+
for (const key of dropped) {
|
|
698
|
+
delete merged[key];
|
|
699
|
+
}
|
|
700
|
+
return dropped;
|
|
701
|
+
}
|
|
702
|
+
const effort = merged["reasoning_effort"];
|
|
703
|
+
if (typeof effort !== "string") {
|
|
704
|
+
return [];
|
|
705
|
+
}
|
|
706
|
+
if (isTieredEffortModel && effort === "none") {
|
|
707
|
+
if (merged["thinking_budget"] === void 0) {
|
|
708
|
+
return [];
|
|
709
|
+
}
|
|
710
|
+
delete merged["thinking_budget"];
|
|
711
|
+
return ["thinking_budget"];
|
|
712
|
+
}
|
|
713
|
+
if (isTieredEffortModel) {
|
|
714
|
+
if (selectedThinkingKnob?.field === "reasoning_effort" && "enable_thinking" in merged) {
|
|
715
|
+
delete merged["enable_thinking"];
|
|
716
|
+
return ["enable_thinking"];
|
|
717
|
+
}
|
|
718
|
+
return [];
|
|
719
|
+
}
|
|
720
|
+
if (merged["thinking_budget"] === void 0) {
|
|
721
|
+
return [];
|
|
722
|
+
}
|
|
723
|
+
delete merged["reasoning_effort"];
|
|
724
|
+
return ["reasoning_effort"];
|
|
725
|
+
}
|
|
726
|
+
warnConflictingKnobDrop(model, reasoningEffort, dropped) {
|
|
727
|
+
if (dropped.length === 0) {
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
if (!this.conflictingKnobDropWarned) {
|
|
731
|
+
this.conflictingKnobDropWarned = true;
|
|
732
|
+
debugLogger2.warn("DashScope: dropped conflicting thinking knobs", {
|
|
733
|
+
model: this.resolveWireModel(model),
|
|
734
|
+
reasoningEffort,
|
|
735
|
+
dropped
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
conflictingKnobDropWarned = false;
|
|
740
|
+
buildMetadata(userPromptId) {
|
|
741
|
+
const channel = this.cliConfig.getChannel?.();
|
|
742
|
+
return {
|
|
743
|
+
metadata: {
|
|
744
|
+
sessionId: this.cliConfig.getSessionId?.(),
|
|
745
|
+
promptId: userPromptId,
|
|
746
|
+
...channel ? { channel } : {}
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
getDefaultGenerationConfig() {
|
|
751
|
+
return {};
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Add cache control flag to specified message(s) for DashScope providers
|
|
755
|
+
*/
|
|
756
|
+
addDashScopeCacheControl(request, cacheControl) {
|
|
757
|
+
const messages = request.messages;
|
|
758
|
+
const systemIndex = messages.findIndex((msg) => msg.role === "system");
|
|
759
|
+
const lastIndex = messages.length - 1;
|
|
760
|
+
const updatedMessages = messages.length === 0 ? messages : messages.map((message, index) => {
|
|
761
|
+
const shouldAddCacheControl = Boolean(
|
|
762
|
+
index === systemIndex && systemIndex !== -1 || index === lastIndex && cacheControl === "all"
|
|
763
|
+
);
|
|
764
|
+
if (!shouldAddCacheControl || !("content" in message) || message.content === null || message.content === void 0) {
|
|
765
|
+
return message;
|
|
766
|
+
}
|
|
767
|
+
return {
|
|
768
|
+
...message,
|
|
769
|
+
content: this.addCacheControlToContent(message.content)
|
|
770
|
+
};
|
|
771
|
+
});
|
|
772
|
+
const updatedTools = cacheControl === "all" && request.tools?.length ? this.addCacheControlToTools(request.tools) : request.tools;
|
|
773
|
+
return {
|
|
774
|
+
messages: updatedMessages,
|
|
775
|
+
tools: updatedTools
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
addCacheControlToTools(tools) {
|
|
779
|
+
if (tools.length === 0) {
|
|
780
|
+
return tools;
|
|
781
|
+
}
|
|
782
|
+
const updatedTools = [...tools];
|
|
783
|
+
const lastToolIndex = tools.length - 1;
|
|
784
|
+
updatedTools[lastToolIndex] = {
|
|
785
|
+
...updatedTools[lastToolIndex],
|
|
786
|
+
cache_control: { type: "ephemeral" }
|
|
787
|
+
};
|
|
788
|
+
return updatedTools;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Add cache control to message content, handling both string and array formats
|
|
792
|
+
*/
|
|
793
|
+
addCacheControlToContent(content) {
|
|
794
|
+
const contentArray = this.normalizeContentToArray(content);
|
|
795
|
+
return this.addCacheControlToContentArray(contentArray);
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Normalize content to array format
|
|
799
|
+
*/
|
|
800
|
+
normalizeContentToArray(content) {
|
|
801
|
+
if (typeof content === "string") {
|
|
802
|
+
return [
|
|
803
|
+
{
|
|
804
|
+
type: "text",
|
|
805
|
+
text: content
|
|
806
|
+
}
|
|
807
|
+
];
|
|
808
|
+
}
|
|
809
|
+
return [...content];
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Add cache control to the content array
|
|
813
|
+
*/
|
|
814
|
+
addCacheControlToContentArray(contentArray) {
|
|
815
|
+
if (contentArray.length === 0) {
|
|
816
|
+
return contentArray;
|
|
817
|
+
}
|
|
818
|
+
const lastItem = contentArray[contentArray.length - 1];
|
|
819
|
+
contentArray[contentArray.length - 1] = {
|
|
820
|
+
...lastItem,
|
|
821
|
+
cache_control: { type: "ephemeral" }
|
|
822
|
+
};
|
|
823
|
+
return contentArray;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* True for glm-* models (e.g. glm-4.5, glm-5.2). Uses the same `^glm-` prefix
|
|
827
|
+
* convention as the GLM matchers in tokenLimits.ts, keeping model detection
|
|
828
|
+
* consistent across the codebase.
|
|
829
|
+
*/
|
|
830
|
+
isGlmModel(model) {
|
|
831
|
+
return !!model && model.toLowerCase().startsWith("glm-");
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Whether the request is in "function-calling mode" — it declares `tools`, or
|
|
835
|
+
* its history already contains a tool result / assistant tool_call. glm needs
|
|
836
|
+
* one of these present to parse structured content-part arrays.
|
|
837
|
+
*/
|
|
838
|
+
hasFunctionCallingContext(request) {
|
|
839
|
+
if (request.tools && request.tools.length > 0) {
|
|
840
|
+
return true;
|
|
841
|
+
}
|
|
842
|
+
return request.messages.some((message) => {
|
|
843
|
+
if (message.role === "tool") {
|
|
844
|
+
return true;
|
|
845
|
+
}
|
|
846
|
+
if (message.role === "assistant") {
|
|
847
|
+
const toolCalls = message.tool_calls;
|
|
848
|
+
return Array.isArray(toolCalls) && toolCalls.length > 0;
|
|
849
|
+
}
|
|
850
|
+
return false;
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Collapse text-only content arrays back to a plain string, leaving
|
|
855
|
+
* media-bearing parts (image/audio/...) as arrays. Used for glm tool-less
|
|
856
|
+
* requests, where the array form would otherwise be dropped server-side.
|
|
857
|
+
* Multiple text parts are joined with a blank line, matching the DeepSeek
|
|
858
|
+
* provider's flattening (separate parts read as separate blocks).
|
|
859
|
+
* Only called on the flatten branch, which skips cache control, so no part
|
|
860
|
+
* here carries a `cache_control` marker.
|
|
861
|
+
*/
|
|
862
|
+
flattenTextContent(messages) {
|
|
863
|
+
return messages.map((message) => {
|
|
864
|
+
if (!("content" in message) || !Array.isArray(message.content)) {
|
|
865
|
+
return message;
|
|
866
|
+
}
|
|
867
|
+
const parts = message.content;
|
|
868
|
+
if (parts.length === 0) {
|
|
869
|
+
return message;
|
|
870
|
+
}
|
|
871
|
+
const isTextOnly = parts.every((part) => part && part.type === "text");
|
|
872
|
+
if (!isTextOnly) {
|
|
873
|
+
return message;
|
|
874
|
+
}
|
|
875
|
+
const text = parts.map((part) => part.text ?? "").join("\n\n");
|
|
876
|
+
return {
|
|
877
|
+
...message,
|
|
878
|
+
content: text
|
|
879
|
+
};
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Vision-capable model patterns.
|
|
884
|
+
* Supports exact matches and prefix patterns for easy extension.
|
|
885
|
+
*/
|
|
886
|
+
static VISION_MODEL_EXACT_MATCHES = /* @__PURE__ */ new Set(["coder-model"]);
|
|
887
|
+
static VISION_MODEL_PREFIX_PATTERNS = [
|
|
888
|
+
"qwen-vl",
|
|
889
|
+
// qwen-vl-max, qwen-vl-max-latest, etc.
|
|
890
|
+
"qwen3-vl-plus",
|
|
891
|
+
// qwen3-vl-plus variants
|
|
892
|
+
"qwen3.5-plus",
|
|
893
|
+
// qwen3.5-plus (has built-in vision capabilities)
|
|
894
|
+
"qwen3.6-plus",
|
|
895
|
+
// qwen3.6-plus (multimodal)
|
|
896
|
+
"qwen3.7-plus"
|
|
897
|
+
// qwen3.7-plus (multimodal)
|
|
898
|
+
];
|
|
899
|
+
isVisionModel(model) {
|
|
900
|
+
if (!model) {
|
|
901
|
+
return false;
|
|
902
|
+
}
|
|
903
|
+
const normalized = model.toLowerCase();
|
|
904
|
+
if (_DashScopeOpenAICompatibleProvider.VISION_MODEL_EXACT_MATCHES.has(
|
|
905
|
+
normalized
|
|
906
|
+
)) {
|
|
907
|
+
return true;
|
|
908
|
+
}
|
|
909
|
+
for (const prefix of _DashScopeOpenAICompatibleProvider.VISION_MODEL_PREFIX_PATTERNS) {
|
|
910
|
+
if (normalized.startsWith(prefix)) {
|
|
911
|
+
return true;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
return false;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Check if cache control should be disabled based on configuration.
|
|
918
|
+
*
|
|
919
|
+
* @returns true if cache control should be enabled, false otherwise
|
|
920
|
+
*/
|
|
921
|
+
shouldEnableCacheControl() {
|
|
922
|
+
return this.cliConfig.getContentGeneratorConfig()?.enableCacheControl !== false;
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
export {
|
|
927
|
+
isOpenRouterHostname,
|
|
928
|
+
DefaultOpenAICompatibleProvider,
|
|
929
|
+
selectDashScopeThinkingKnob,
|
|
930
|
+
DASHSCOPE_REGIONAL_HOSTS,
|
|
931
|
+
DashScopeOpenAICompatibleProvider
|
|
932
|
+
};
|
|
933
|
+
/**
|
|
934
|
+
* @license
|
|
935
|
+
* Copyright 2025 Qwen
|
|
936
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
937
|
+
*/
|