@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
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
DASHSCOPE_PROXY_BASE_URL,
|
|
5
|
-
DEFAULT_DASHSCOPE_BASE_URL,
|
|
6
|
-
DEFAULT_MAX_RETRIES,
|
|
7
|
-
REASONING_EFFORT_TIERS,
|
|
8
|
-
clampReasoningEffort,
|
|
9
|
-
getGptReasoningCapabilities,
|
|
10
|
-
isReasoningEffortPlaceholder,
|
|
11
|
-
parseModelReasoningCapabilities,
|
|
12
|
-
resolveRequestTimeout
|
|
13
|
-
} from "./chunk-VBLAI2HA.js";
|
|
14
|
-
import {
|
|
15
|
-
buildSessionAwareFetch
|
|
16
|
-
} from "./chunk-NOO4QFXM.js";
|
|
17
|
-
import {
|
|
18
|
-
isQwenFamilyWireModel,
|
|
19
|
-
isTieredEffortWireModel
|
|
20
|
-
} from "./chunk-XBVNNDPK.js";
|
|
21
|
-
import {
|
|
22
|
-
defaultOutputCeiling,
|
|
23
|
-
hasExplicitOutputLimit,
|
|
24
|
-
parsePositiveIntegerEnvValue,
|
|
25
|
-
tokenLimit
|
|
26
|
-
} from "./chunk-FPGTNKCP.js";
|
|
27
|
-
import {
|
|
28
|
-
buildRuntimeFetchOptions
|
|
29
|
-
} from "./chunk-4HOEU2OR.js";
|
|
30
|
-
import {
|
|
31
|
-
createDebugLogger
|
|
32
|
-
} from "./chunk-ZAFYHRVY.js";
|
|
33
3
|
import {
|
|
34
4
|
init_esbuild_shims
|
|
35
5
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -37,6 +7,9 @@ import {
|
|
|
37
7
|
__name
|
|
38
8
|
} from "./chunk-J2S4EL5Y.js";
|
|
39
9
|
|
|
10
|
+
// node_modules/openai/index.mjs
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
|
|
40
13
|
// node_modules/openai/client.mjs
|
|
41
14
|
init_esbuild_shims();
|
|
42
15
|
|
|
@@ -6881,892 +6854,140 @@ OpenAI.Responses = Responses;
|
|
|
6881
6854
|
OpenAI.Evals = Evals;
|
|
6882
6855
|
OpenAI.Containers = Containers;
|
|
6883
6856
|
|
|
6884
|
-
// node_modules/openai/index.mjs
|
|
6885
|
-
init_esbuild_shims();
|
|
6886
|
-
|
|
6887
6857
|
// node_modules/openai/azure.mjs
|
|
6888
6858
|
init_esbuild_shims();
|
|
6889
|
-
|
|
6890
|
-
// packages/core/src/core/openaiContentGenerator/provider/default.ts
|
|
6891
|
-
init_esbuild_shims();
|
|
6892
|
-
|
|
6893
|
-
// packages/core/src/core/openaiContentGenerator/provider/openrouter.ts
|
|
6894
|
-
init_esbuild_shims();
|
|
6895
|
-
function isOpenRouterHostname(contentGeneratorConfig) {
|
|
6896
|
-
const baseUrl = contentGeneratorConfig.baseUrl ?? "";
|
|
6897
|
-
if (!baseUrl) return false;
|
|
6898
|
-
try {
|
|
6899
|
-
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
6900
|
-
return hostname === "openrouter.ai" || hostname.endsWith(".openrouter.ai");
|
|
6901
|
-
} catch {
|
|
6902
|
-
return false;
|
|
6903
|
-
}
|
|
6904
|
-
}
|
|
6905
|
-
__name(isOpenRouterHostname, "isOpenRouterHostname");
|
|
6906
|
-
|
|
6907
|
-
// packages/core/src/core/openaiContentGenerator/provider/default.ts
|
|
6908
|
-
var debugLogger = createDebugLogger("DefaultOpenAICompatibleProvider");
|
|
6909
|
-
var OPENAI_COMPATIBLE_EFFORTS = [
|
|
6910
|
-
"low",
|
|
6911
|
-
"medium",
|
|
6912
|
-
"high",
|
|
6913
|
-
"xhigh"
|
|
6914
|
-
];
|
|
6915
|
-
function isQwen3Model(model) {
|
|
6916
|
-
return model.toLowerCase().includes("qwen3");
|
|
6917
|
-
}
|
|
6918
|
-
__name(isQwen3Model, "isQwen3Model");
|
|
6919
|
-
function mirrorReasoningContentToReasoning(message) {
|
|
6920
|
-
if (message.role !== "assistant") {
|
|
6921
|
-
return message;
|
|
6922
|
-
}
|
|
6923
|
-
const assistant = message;
|
|
6924
|
-
if (typeof assistant.reasoning_content !== "string" || assistant.reasoning_content.length === 0 || typeof assistant.reasoning === "string") {
|
|
6925
|
-
return message;
|
|
6926
|
-
}
|
|
6927
|
-
return {
|
|
6928
|
-
...assistant,
|
|
6929
|
-
reasoning: assistant.reasoning_content
|
|
6930
|
-
};
|
|
6931
|
-
}
|
|
6932
|
-
__name(mirrorReasoningContentToReasoning, "mirrorReasoningContentToReasoning");
|
|
6933
|
-
var DefaultOpenAICompatibleProvider = class {
|
|
6859
|
+
var AzureOpenAI = class extends OpenAI {
|
|
6934
6860
|
static {
|
|
6935
|
-
__name(this, "
|
|
6936
|
-
}
|
|
6937
|
-
contentGeneratorConfig;
|
|
6938
|
-
cliConfig;
|
|
6939
|
-
/**
|
|
6940
|
-
* Latch so an effort-clamp warning fires once per provider lifetime. Shared
|
|
6941
|
-
* with subclasses that clamp on their own wire shape (see DashScope) so one
|
|
6942
|
-
* provider instance never repeats the notice.
|
|
6943
|
-
*/
|
|
6944
|
-
effortClampWarned = false;
|
|
6945
|
-
constructor(contentGeneratorConfig, cliConfig) {
|
|
6946
|
-
this.cliConfig = cliConfig;
|
|
6947
|
-
this.contentGeneratorConfig = contentGeneratorConfig;
|
|
6948
|
-
}
|
|
6949
|
-
buildHeaders() {
|
|
6950
|
-
const version = this.cliConfig.getCliVersion() || "unknown";
|
|
6951
|
-
const userAgent = `QwenCode/${version} (${process.platform}; ${process.arch})`;
|
|
6952
|
-
const { customHeaders } = this.contentGeneratorConfig;
|
|
6953
|
-
const defaultHeaders = {
|
|
6954
|
-
"User-Agent": userAgent
|
|
6955
|
-
};
|
|
6956
|
-
return customHeaders ? { ...defaultHeaders, ...customHeaders } : defaultHeaders;
|
|
6957
|
-
}
|
|
6958
|
-
buildClient() {
|
|
6959
|
-
const {
|
|
6960
|
-
apiKey,
|
|
6961
|
-
baseUrl,
|
|
6962
|
-
maxRetries = DEFAULT_MAX_RETRIES
|
|
6963
|
-
} = this.contentGeneratorConfig;
|
|
6964
|
-
const timeout = resolveRequestTimeout(this.contentGeneratorConfig.timeout);
|
|
6965
|
-
const defaultHeaders = this.buildHeaders();
|
|
6966
|
-
const runtimeOptions = buildRuntimeFetchOptions(
|
|
6967
|
-
"openai",
|
|
6968
|
-
this.cliConfig.getProxy()
|
|
6969
|
-
);
|
|
6970
|
-
return new OpenAI({
|
|
6971
|
-
apiKey,
|
|
6972
|
-
baseURL: baseUrl,
|
|
6973
|
-
timeout,
|
|
6974
|
-
maxRetries,
|
|
6975
|
-
defaultHeaders,
|
|
6976
|
-
...runtimeOptions || {},
|
|
6977
|
-
fetch: buildSessionAwareFetch(
|
|
6978
|
-
runtimeOptions?.fetch,
|
|
6979
|
-
this.cliConfig,
|
|
6980
|
-
this.contentGeneratorConfig.customHeaders
|
|
6981
|
-
)
|
|
6982
|
-
});
|
|
6861
|
+
__name(this, "AzureOpenAI");
|
|
6983
6862
|
}
|
|
6984
6863
|
/**
|
|
6985
|
-
*
|
|
6986
|
-
* rather than reading the configured one, because a request may override it
|
|
6987
|
-
* (`pipeline.ts` resolves `request.model || contentGeneratorConfig.model`),
|
|
6988
|
-
* and a capability answered for the wrong model is how an unaccepted tier
|
|
6989
|
-
* reaches the wire. Override in a subclass whose endpoint takes `max`; the
|
|
6990
|
-
* clamp calls it through `this`, so a subclass answer applies even on the
|
|
6991
|
-
* `super.buildRequest` path.
|
|
6992
|
-
*/
|
|
6993
|
-
supportedReasoningEffortsFor(model) {
|
|
6994
|
-
const gpt = getGptReasoningCapabilities(model);
|
|
6995
|
-
if (!gpt) return OPENAI_COMPATIBLE_EFFORTS;
|
|
6996
|
-
const { authType, baseUrl } = this.contentGeneratorConfig;
|
|
6997
|
-
const configured = authType && model ? parseModelReasoningCapabilities(
|
|
6998
|
-
this.cliConfig.getResolvedModelConfig?.(authType, model, baseUrl)?.capabilities.reasoning
|
|
6999
|
-
) : void 0;
|
|
7000
|
-
return configured && !configured.toggleOnly ? configured.efforts : gpt.efforts;
|
|
7001
|
-
}
|
|
7002
|
-
/**
|
|
7003
|
-
* Cap the pipeline-injected `reasoning.effort` at what this endpoint accepts.
|
|
7004
|
-
* The tier is configured once (`/effort`) and persisted, so an unaccepted
|
|
7005
|
-
* value is not a one-off rejection: it 400s every later request in the
|
|
7006
|
-
* session too.
|
|
6864
|
+
* API Client for interfacing with the Azure OpenAI API.
|
|
7007
6865
|
*
|
|
7008
|
-
*
|
|
7009
|
-
*
|
|
7010
|
-
*
|
|
7011
|
-
*
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
this.supportedReasoningEffortsFor(
|
|
7026
|
-
loose["model"] ?? this.contentGeneratorConfig.model
|
|
7027
|
-
)
|
|
7028
|
-
);
|
|
7029
|
-
if (clamped === effort) {
|
|
7030
|
-
return request;
|
|
6866
|
+
* @param {string | undefined} [opts.apiVersion=process.env['OPENAI_API_VERSION'] ?? undefined]
|
|
6867
|
+
* @param {string | undefined} [opts.endpoint=process.env['AZURE_OPENAI_ENDPOINT'] ?? undefined] - Your Azure endpoint, including the resource, e.g. `https://example-resource.azure.openai.com/`
|
|
6868
|
+
* @param {string | undefined} [opts.apiKey=process.env['AZURE_OPENAI_API_KEY'] ?? undefined]
|
|
6869
|
+
* @param {string | undefined} opts.deployment - A model deployment, if given, sets the base client URL to include `/deployments/{deployment}`.
|
|
6870
|
+
* @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null]
|
|
6871
|
+
* @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL']] - Sets the base URL for the API, e.g. `https://example-resource.azure.openai.com/openai/`.
|
|
6872
|
+
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
6873
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
6874
|
+
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
6875
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
6876
|
+
* @param {Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
6877
|
+
* @param {DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
6878
|
+
* @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
6879
|
+
*/
|
|
6880
|
+
constructor({ baseURL = readEnv("OPENAI_BASE_URL"), apiKey = readEnv("AZURE_OPENAI_API_KEY"), apiVersion = readEnv("OPENAI_API_VERSION"), endpoint, deployment, azureADTokenProvider, dangerouslyAllowBrowser, ...opts } = {}) {
|
|
6881
|
+
if (!apiVersion) {
|
|
6882
|
+
throw new OpenAIError("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");
|
|
7031
6883
|
}
|
|
7032
|
-
if (
|
|
7033
|
-
|
|
7034
|
-
`reasoning.effort='${effort}' is not accepted by this OpenAI-compatible endpoint; using '${clamped}'.`
|
|
7035
|
-
);
|
|
7036
|
-
this.effortClampWarned = true;
|
|
6884
|
+
if (typeof azureADTokenProvider === "function") {
|
|
6885
|
+
dangerouslyAllowBrowser = true;
|
|
7037
6886
|
}
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
reasoning: { ...reasoning, effort: clamped }
|
|
7041
|
-
};
|
|
7042
|
-
}
|
|
7043
|
-
buildRequest(request, _userPromptId) {
|
|
7044
|
-
const extraBody = this.contentGeneratorConfig.extra_body;
|
|
7045
|
-
const requestWithTokenLimits = this.clampConfiguredReasoningEffort(
|
|
7046
|
-
this.applyOutputTokenLimit(request)
|
|
7047
|
-
);
|
|
7048
|
-
const messages = isQwen3Model(request.model) ? requestWithTokenLimits.messages.map(mirrorReasoningContentToReasoning) : requestWithTokenLimits.messages;
|
|
7049
|
-
const result = {
|
|
7050
|
-
...requestWithTokenLimits,
|
|
7051
|
-
messages,
|
|
7052
|
-
...extraBody ? extraBody : {}
|
|
7053
|
-
};
|
|
7054
|
-
this.flattenGptReasoningEffort(result);
|
|
7055
|
-
return result;
|
|
7056
|
-
}
|
|
7057
|
-
flattenGptReasoningEffort(body) {
|
|
7058
|
-
if (!getGptReasoningCapabilities(body["model"]) || isOpenRouterHostname(this.contentGeneratorConfig) || this.contentGeneratorConfig.samplingParams?.["reasoning"] !== void 0 || this.contentGeneratorConfig.extra_body?.["reasoning"] !== void 0)
|
|
7059
|
-
return;
|
|
7060
|
-
const reasoning = body["reasoning"];
|
|
7061
|
-
if (typeof reasoning?.effort !== "string" || !reasoning.effort) return;
|
|
7062
|
-
if (isReasoningEffortPlaceholder(body["reasoning_effort"])) {
|
|
7063
|
-
body["reasoning_effort"] = reasoning.effort;
|
|
6887
|
+
if (!azureADTokenProvider && !apiKey) {
|
|
6888
|
+
throw new OpenAIError("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");
|
|
7064
6889
|
}
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
};
|
|
7077
|
-
}
|
|
7078
|
-
/**
|
|
7079
|
-
* Apply output token limit to a request's max_tokens parameter.
|
|
7080
|
-
*
|
|
7081
|
-
* Purpose:
|
|
7082
|
-
* Some APIs (e.g., OpenAI-compatible) default to a very small max_tokens value,
|
|
7083
|
-
* which can cause responses to be truncated mid-output. This function ensures
|
|
7084
|
-
* a reasonable default is set while respecting user configuration.
|
|
7085
|
-
*
|
|
7086
|
-
* Logic:
|
|
7087
|
-
* 1. If user explicitly configured max_tokens:
|
|
7088
|
-
* - For known models (in OUTPUT_PATTERNS): use the user's value, but cap at
|
|
7089
|
-
* model's max output limit to avoid API errors
|
|
7090
|
-
* (input + max_output > contextWindowSize would cause 400 errors on some APIs)
|
|
7091
|
-
* - For unknown models (deployment aliases, self-hosted): respect user's
|
|
7092
|
-
* configured value entirely (backend may support larger limits)
|
|
7093
|
-
* 2. If user didn't configure max_tokens:
|
|
7094
|
-
* - Check QWEN_CODE_MAX_OUTPUT_TOKENS env var first
|
|
7095
|
-
* - Otherwise use the model's output limit, clipped to
|
|
7096
|
-
* OUTPUT_TOKEN_CEILING (64K)
|
|
7097
|
-
* 3. If model has no specific limit (tokenLimit returns default):
|
|
7098
|
-
* - Use DEFAULT_OUTPUT_TOKEN_LIMIT
|
|
7099
|
-
*
|
|
7100
|
-
* Examples:
|
|
7101
|
-
* - User sets 4K, known model limit 64K → uses 4K (respects user preference)
|
|
7102
|
-
* - User sets 100K, known model limit 64K → uses 64K (capped to avoid API error)
|
|
7103
|
-
* - User sets 100K, unknown model → uses 100K (respects user, backend may support it)
|
|
7104
|
-
* - User not set, model limit 64K → uses 64K
|
|
7105
|
-
* - User not set, model limit 4K → uses 4K (model limit is lower)
|
|
7106
|
-
* - User not set, env QWEN_CODE_MAX_OUTPUT_TOKENS=16000 -> uses 16K
|
|
7107
|
-
*
|
|
7108
|
-
* @param request - The chat completion request parameters
|
|
7109
|
-
* @returns The request with max_tokens adjusted according to the logic
|
|
7110
|
-
*/
|
|
7111
|
-
applyOutputTokenLimit(request) {
|
|
7112
|
-
if (this.contentGeneratorConfig.samplingParams !== void 0) {
|
|
7113
|
-
return request;
|
|
7114
|
-
}
|
|
7115
|
-
const userMaxTokens = request.max_tokens;
|
|
7116
|
-
const modelLimit = tokenLimit(request.model, "output");
|
|
7117
|
-
const isKnownModel = hasExplicitOutputLimit(request.model);
|
|
7118
|
-
let effectiveMaxTokens;
|
|
7119
|
-
if (userMaxTokens !== void 0 && userMaxTokens !== null) {
|
|
7120
|
-
if (isKnownModel) {
|
|
7121
|
-
effectiveMaxTokens = Math.min(userMaxTokens, modelLimit);
|
|
7122
|
-
} else {
|
|
7123
|
-
effectiveMaxTokens = userMaxTokens;
|
|
6890
|
+
if (azureADTokenProvider && apiKey) {
|
|
6891
|
+
throw new OpenAIError("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");
|
|
6892
|
+
}
|
|
6893
|
+
apiKey ?? (apiKey = API_KEY_SENTINEL);
|
|
6894
|
+
opts.defaultQuery = { ...opts.defaultQuery, "api-version": apiVersion };
|
|
6895
|
+
if (!baseURL) {
|
|
6896
|
+
if (!endpoint) {
|
|
6897
|
+
endpoint = process.env["AZURE_OPENAI_ENDPOINT"];
|
|
6898
|
+
}
|
|
6899
|
+
if (!endpoint) {
|
|
6900
|
+
throw new OpenAIError("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable");
|
|
7124
6901
|
}
|
|
6902
|
+
baseURL = `${endpoint}/openai`;
|
|
7125
6903
|
} else {
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
);
|
|
7129
|
-
if (envMaxTokens !== void 0) {
|
|
7130
|
-
effectiveMaxTokens = isKnownModel ? Math.min(envMaxTokens, modelLimit) : envMaxTokens;
|
|
7131
|
-
} else {
|
|
7132
|
-
effectiveMaxTokens = defaultOutputCeiling(request.model);
|
|
6904
|
+
if (endpoint) {
|
|
6905
|
+
throw new OpenAIError("baseURL and endpoint are mutually exclusive");
|
|
7133
6906
|
}
|
|
7134
6907
|
}
|
|
7135
|
-
|
|
7136
|
-
...request,
|
|
7137
|
-
max_tokens: effectiveMaxTokens
|
|
7138
|
-
};
|
|
7139
|
-
}
|
|
7140
|
-
};
|
|
7141
|
-
|
|
7142
|
-
// packages/core/src/core/openaiContentGenerator/provider/dashscope.ts
|
|
7143
|
-
init_esbuild_shims();
|
|
7144
|
-
var debugLogger2 = createDebugLogger("DashScopeOpenAICompatibleProvider");
|
|
7145
|
-
var DASHSCOPE_TIERED_EFFORTS = [
|
|
7146
|
-
"low",
|
|
7147
|
-
"medium",
|
|
7148
|
-
"high",
|
|
7149
|
-
"xhigh"
|
|
7150
|
-
];
|
|
7151
|
-
function selectDashScopeThinkingKnob(model, extraBody, samplingParams, reasoningEffort) {
|
|
7152
|
-
if (!isTieredEffortWireModel((model ?? "").toLowerCase())) {
|
|
7153
|
-
return void 0;
|
|
7154
|
-
}
|
|
7155
|
-
const selectFromLayer = /* @__PURE__ */ __name((source, layer) => {
|
|
7156
|
-
if (layer?.["enable_thinking"] === false) {
|
|
7157
|
-
return { source, field: "enable_thinking", value: false };
|
|
7158
|
-
}
|
|
7159
|
-
return selectValueFromLayer(source, layer) ?? selectOnSwitch(source, layer);
|
|
7160
|
-
}, "selectFromLayer");
|
|
7161
|
-
const selectValueFromLayer = /* @__PURE__ */ __name((source, layer) => {
|
|
7162
|
-
if (layer?.["reasoning_effort"] != null) {
|
|
7163
|
-
return {
|
|
7164
|
-
source,
|
|
7165
|
-
field: "reasoning_effort",
|
|
7166
|
-
value: layer["reasoning_effort"]
|
|
7167
|
-
};
|
|
7168
|
-
}
|
|
7169
|
-
if (layer?.["thinking_budget"] != null) {
|
|
7170
|
-
return {
|
|
7171
|
-
source,
|
|
7172
|
-
field: "thinking_budget",
|
|
7173
|
-
value: layer["thinking_budget"]
|
|
7174
|
-
};
|
|
7175
|
-
}
|
|
7176
|
-
return void 0;
|
|
7177
|
-
}, "selectValueFromLayer");
|
|
7178
|
-
const selectOnSwitch = /* @__PURE__ */ __name((source, layer) => {
|
|
7179
|
-
if (layer?.["enable_thinking"] === true) {
|
|
7180
|
-
return { source, field: "enable_thinking", value: true };
|
|
7181
|
-
}
|
|
7182
|
-
return void 0;
|
|
7183
|
-
}, "selectOnSwitch");
|
|
7184
|
-
const reasoningSelection = reasoningEffort !== void 0 ? {
|
|
7185
|
-
source: "reasoning",
|
|
7186
|
-
field: "reasoning_effort",
|
|
7187
|
-
value: reasoningEffort
|
|
7188
|
-
} : void 0;
|
|
7189
|
-
const extraBodySelection = selectFromLayer("extra_body", extraBody);
|
|
7190
|
-
if (extraBodySelection?.field === "enable_thinking" && extraBodySelection.value === true) {
|
|
7191
|
-
return selectValueFromLayer("samplingParams", samplingParams) ?? reasoningSelection ?? extraBodySelection;
|
|
7192
|
-
}
|
|
7193
|
-
if (extraBodySelection) {
|
|
7194
|
-
return extraBodySelection;
|
|
7195
|
-
}
|
|
7196
|
-
const samplingSelection = selectFromLayer("samplingParams", samplingParams);
|
|
7197
|
-
return samplingSelection?.field === "enable_thinking" && samplingSelection.value === true ? reasoningSelection ?? samplingSelection : samplingSelection ?? reasoningSelection;
|
|
7198
|
-
}
|
|
7199
|
-
__name(selectDashScopeThinkingKnob, "selectDashScopeThinkingKnob");
|
|
7200
|
-
function withoutNullishThinkingKnobs(layer) {
|
|
7201
|
-
if (!layer) {
|
|
7202
|
-
return void 0;
|
|
7203
|
-
}
|
|
7204
|
-
const hasNullishEnableThinking = "enable_thinking" in layer && layer["enable_thinking"] == null;
|
|
7205
|
-
const hasNullishEffort = "reasoning_effort" in layer && layer["reasoning_effort"] == null;
|
|
7206
|
-
const hasNullishBudget = "thinking_budget" in layer && layer["thinking_budget"] == null;
|
|
7207
|
-
if (!hasNullishEnableThinking && !hasNullishEffort && !hasNullishBudget) {
|
|
7208
|
-
return layer;
|
|
7209
|
-
}
|
|
7210
|
-
const sanitized = { ...layer };
|
|
7211
|
-
if (hasNullishEnableThinking) {
|
|
7212
|
-
delete sanitized["enable_thinking"];
|
|
7213
|
-
}
|
|
7214
|
-
if (hasNullishEffort) {
|
|
7215
|
-
delete sanitized["reasoning_effort"];
|
|
7216
|
-
}
|
|
7217
|
-
if (hasNullishBudget) {
|
|
7218
|
-
delete sanitized["thinking_budget"];
|
|
7219
|
-
}
|
|
7220
|
-
return sanitized;
|
|
7221
|
-
}
|
|
7222
|
-
__name(withoutNullishThinkingKnobs, "withoutNullishThinkingKnobs");
|
|
7223
|
-
var DASHSCOPE_REGIONAL_HOSTS = [
|
|
7224
|
-
"dashscope.aliyuncs.com",
|
|
7225
|
-
"dashscope-intl.aliyuncs.com",
|
|
7226
|
-
"dashscope-us.aliyuncs.com"
|
|
7227
|
-
];
|
|
7228
|
-
var DashScopeOpenAICompatibleProvider = class _DashScopeOpenAICompatibleProvider extends DefaultOpenAICompatibleProvider {
|
|
7229
|
-
static {
|
|
7230
|
-
__name(this, "DashScopeOpenAICompatibleProvider");
|
|
7231
|
-
}
|
|
7232
|
-
constructor(contentGeneratorConfig, cliConfig) {
|
|
7233
|
-
super(contentGeneratorConfig, cliConfig);
|
|
7234
|
-
}
|
|
7235
|
-
/**
|
|
7236
|
-
* Determines whether to use the DashScope-compatible provider.
|
|
7237
|
-
* Covers the official regional hosts (DASHSCOPE_REGIONAL_HOSTS),
|
|
7238
|
-
* Token Plan endpoints under token-plan.<region>.maas.aliyuncs.com,
|
|
7239
|
-
* internal Alibaba domains (*.alibaba-inc.com, *.aliyun-inc.com),
|
|
7240
|
-
* Alibaba Cloud API Gateway domains (*.alicloudapi.com),
|
|
7241
|
-
* and proxy matches.
|
|
7242
|
-
*
|
|
7243
|
-
* Note: any *.alibaba-inc.com / *.aliyun-inc.com host is treated as a
|
|
7244
|
-
* DashScope-compatible endpoint by design. Keep this generic and avoid
|
|
7245
|
-
* embedding individual private gateway hostnames in provider detection.
|
|
7246
|
-
*/
|
|
7247
|
-
static isDashScopeProvider(contentGeneratorConfig) {
|
|
7248
|
-
const { authType, baseUrl } = contentGeneratorConfig;
|
|
7249
|
-
if (authType === "qwen-oauth" /* QWEN_OAUTH */) return true;
|
|
7250
|
-
if (!baseUrl) return true;
|
|
7251
|
-
const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
7252
|
-
let hostname = null;
|
|
7253
|
-
try {
|
|
7254
|
-
hostname = new URL(normalizedBaseUrl).hostname.toLowerCase();
|
|
7255
|
-
} catch {
|
|
7256
|
-
hostname = null;
|
|
7257
|
-
}
|
|
7258
|
-
const isDashscopeOrigin = hostname !== null && DASHSCOPE_REGIONAL_HOSTS.some(
|
|
7259
|
-
(host) => hostname === host || hostname.endsWith("." + host)
|
|
7260
|
-
);
|
|
7261
|
-
const isTokenPlanOrigin = hostname !== null && hostname.startsWith("token-plan.") && hostname.endsWith(".maas.aliyuncs.com");
|
|
7262
|
-
const isInternalOrigin = hostname !== null && (hostname.endsWith(".alibaba-inc.com") || hostname.endsWith(".aliyun-inc.com"));
|
|
7263
|
-
const isAliCloudApiOrigin = hostname !== null && hostname.endsWith(".alicloudapi.com");
|
|
7264
|
-
const normalizedProxyUrl = DASHSCOPE_PROXY_BASE_URL?.endsWith("/") ? DASHSCOPE_PROXY_BASE_URL.slice(0, -1) : DASHSCOPE_PROXY_BASE_URL;
|
|
7265
|
-
const isProxyMatch = Boolean(
|
|
7266
|
-
normalizedProxyUrl && normalizedBaseUrl.toLowerCase() === normalizedProxyUrl.toLowerCase()
|
|
7267
|
-
);
|
|
7268
|
-
if (normalizedProxyUrl && !isDashscopeOrigin && !isTokenPlanOrigin && !isInternalOrigin && !isAliCloudApiOrigin && !isProxyMatch) {
|
|
7269
|
-
debugLogger2.debug(
|
|
7270
|
-
`DASHSCOPE_PROXY_BASE_URL is configured but the request baseUrl does not match. DashScope headers/cache control will be skipped.`
|
|
7271
|
-
);
|
|
7272
|
-
}
|
|
7273
|
-
if (isInternalOrigin) {
|
|
7274
|
-
debugLogger2.debug(
|
|
7275
|
-
`DashScope provider activated via internal origin: ${hostname}`
|
|
7276
|
-
);
|
|
7277
|
-
}
|
|
7278
|
-
if (isAliCloudApiOrigin) {
|
|
7279
|
-
debugLogger2.debug(
|
|
7280
|
-
`DashScope provider activated via alicloudapi origin: ${hostname}`
|
|
7281
|
-
);
|
|
7282
|
-
}
|
|
7283
|
-
return isDashscopeOrigin || isTokenPlanOrigin || isInternalOrigin || isAliCloudApiOrigin || isProxyMatch;
|
|
7284
|
-
}
|
|
7285
|
-
buildHeaders() {
|
|
7286
|
-
const version = this.cliConfig.getCliVersion() || "unknown";
|
|
7287
|
-
const userAgent = `QwenCode/${version} (${process.platform}; ${process.arch})`;
|
|
7288
|
-
const { authType, customHeaders } = this.contentGeneratorConfig;
|
|
7289
|
-
const defaultHeaders = {
|
|
7290
|
-
"User-Agent": userAgent,
|
|
7291
|
-
"X-DashScope-CacheControl": "enable",
|
|
7292
|
-
"X-DashScope-UserAgent": userAgent,
|
|
7293
|
-
"X-DashScope-AuthType": authType
|
|
7294
|
-
};
|
|
7295
|
-
return customHeaders ? { ...defaultHeaders, ...customHeaders } : defaultHeaders;
|
|
7296
|
-
}
|
|
7297
|
-
buildClient() {
|
|
7298
|
-
const {
|
|
6908
|
+
super({
|
|
7299
6909
|
apiKey,
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
const timeout = resolveRequestTimeout(this.contentGeneratorConfig.timeout);
|
|
7304
|
-
const defaultHeaders = this.buildHeaders();
|
|
7305
|
-
const runtimeOptions = buildRuntimeFetchOptions(
|
|
7306
|
-
"openai",
|
|
7307
|
-
this.cliConfig.getProxy()
|
|
7308
|
-
);
|
|
7309
|
-
return new OpenAI({
|
|
7310
|
-
apiKey,
|
|
7311
|
-
baseURL: baseUrl,
|
|
7312
|
-
timeout,
|
|
7313
|
-
maxRetries,
|
|
7314
|
-
defaultHeaders,
|
|
7315
|
-
...runtimeOptions || {},
|
|
7316
|
-
fetch: buildSessionAwareFetch(
|
|
7317
|
-
runtimeOptions?.fetch,
|
|
7318
|
-
this.cliConfig,
|
|
7319
|
-
this.contentGeneratorConfig.customHeaders
|
|
7320
|
-
)
|
|
6910
|
+
baseURL,
|
|
6911
|
+
...opts,
|
|
6912
|
+
...dangerouslyAllowBrowser !== void 0 ? { dangerouslyAllowBrowser } : {}
|
|
7321
6913
|
});
|
|
6914
|
+
this.apiVersion = "";
|
|
6915
|
+
this._azureADTokenProvider = azureADTokenProvider;
|
|
6916
|
+
this.apiVersion = apiVersion;
|
|
6917
|
+
this.deploymentName = deployment;
|
|
7322
6918
|
}
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
* - Cache control for the system message, last tool message (when tools are configured),
|
|
7328
|
-
* and the latest history message
|
|
7329
|
-
* - Output token limits based on model capabilities
|
|
7330
|
-
* - Vision model specific parameters (vl_high_resolution_images)
|
|
7331
|
-
* - Request metadata for session tracking
|
|
7332
|
-
*
|
|
7333
|
-
* @param request - The original chat completion request parameters
|
|
7334
|
-
* @param userPromptId - Unique identifier for the user prompt for session tracking
|
|
7335
|
-
* @returns Configured request with DashScope-specific parameters applied
|
|
7336
|
-
*/
|
|
7337
|
-
buildRequest(request, userPromptId) {
|
|
7338
|
-
let messages = request.messages;
|
|
7339
|
-
let tools = request.tools;
|
|
7340
|
-
const flattenPlainTextForGlm = this.isGlmModel(request.model) && !this.hasFunctionCallingContext(request);
|
|
7341
|
-
if (flattenPlainTextForGlm) {
|
|
7342
|
-
messages = this.flattenTextContent(messages);
|
|
7343
|
-
} else if (this.shouldEnableCacheControl()) {
|
|
7344
|
-
const { messages: updatedMessages, tools: updatedTools } = this.addDashScopeCacheControl(
|
|
7345
|
-
request,
|
|
7346
|
-
request.stream ? "all" : "system_only"
|
|
7347
|
-
);
|
|
7348
|
-
messages = updatedMessages;
|
|
7349
|
-
tools = updatedTools;
|
|
7350
|
-
}
|
|
7351
|
-
const requestWithTokenLimits = this.applyOutputTokenLimit(request);
|
|
7352
|
-
const isTieredQwenModel = isTieredEffortWireModel(
|
|
7353
|
-
this.resolveWireModel(request.model)
|
|
7354
|
-
);
|
|
7355
|
-
const extraBody = isTieredQwenModel ? withoutNullishThinkingKnobs(this.contentGeneratorConfig.extra_body) : this.contentGeneratorConfig.extra_body;
|
|
7356
|
-
const qwenEffortConfig = this.buildQwenEffortConfig(request.model);
|
|
7357
|
-
const rawRequestParams = requestWithTokenLimits;
|
|
7358
|
-
const requestParams = isTieredQwenModel ? withoutNullishThinkingKnobs(rawRequestParams) : rawRequestParams;
|
|
7359
|
-
if ("reasoning_effort" in requestParams && "reasoning_effort" in qwenEffortConfig) {
|
|
7360
|
-
qwenEffortConfig["reasoning_effort"] = requestParams["reasoning_effort"];
|
|
7361
|
-
}
|
|
7362
|
-
const hasQwenEffortConfig = Object.keys(qwenEffortConfig).length > 0;
|
|
7363
|
-
const selectedThinkingKnob = isTieredQwenModel ? selectDashScopeThinkingKnob(
|
|
7364
|
-
this.resolveWireModel(request.model),
|
|
7365
|
-
extraBody,
|
|
7366
|
-
requestParams,
|
|
7367
|
-
qwenEffortConfig["reasoning_effort"]
|
|
7368
|
-
) : void 0;
|
|
7369
|
-
if (this.isVisionModel(request.model)) {
|
|
7370
|
-
const dashscopeExtras2 = {
|
|
7371
|
-
vl_high_resolution_images: true,
|
|
7372
|
-
preserve_thinking: true,
|
|
7373
|
-
...qwenEffortConfig
|
|
7374
|
-
};
|
|
7375
|
-
const visionResult = {
|
|
7376
|
-
...requestParams,
|
|
7377
|
-
messages,
|
|
7378
|
-
...tools ? { tools } : {},
|
|
7379
|
-
...this.buildMetadata(userPromptId) || {},
|
|
7380
|
-
...dashscopeExtras2
|
|
7381
|
-
};
|
|
7382
|
-
if (hasQwenEffortConfig && "reasoning" in visionResult) {
|
|
7383
|
-
delete visionResult["reasoning"];
|
|
6919
|
+
async buildRequest(options, props = {}) {
|
|
6920
|
+
if (_deployments_endpoints.has(options.path) && options.method === "post" && options.body !== void 0) {
|
|
6921
|
+
if (!isObj(options.body)) {
|
|
6922
|
+
throw new Error("Expected request body to be an object");
|
|
7384
6923
|
}
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
request.model,
|
|
7389
|
-
selectedThinkingKnob
|
|
7390
|
-
);
|
|
7391
|
-
}
|
|
7392
|
-
const dashscopeExtras = {
|
|
7393
|
-
preserve_thinking: true,
|
|
7394
|
-
...qwenEffortConfig
|
|
7395
|
-
};
|
|
7396
|
-
const result = {
|
|
7397
|
-
...requestParams,
|
|
7398
|
-
// Preserve all original parameters including sampling params and adjusted max_tokens
|
|
7399
|
-
messages,
|
|
7400
|
-
...tools ? { tools } : {},
|
|
7401
|
-
...this.buildMetadata(userPromptId) || {},
|
|
7402
|
-
...dashscopeExtras
|
|
7403
|
-
};
|
|
7404
|
-
if (hasQwenEffortConfig && "reasoning" in result) {
|
|
7405
|
-
delete result["reasoning"];
|
|
7406
|
-
}
|
|
7407
|
-
return this.mergeExtraBodyAndResolveKnobs(
|
|
7408
|
-
hasQwenEffortConfig ? result : this.clampConfiguredReasoningEffort(result),
|
|
7409
|
-
extraBody,
|
|
7410
|
-
request.model,
|
|
7411
|
-
selectedThinkingKnob
|
|
7412
|
-
);
|
|
7413
|
-
}
|
|
7414
|
-
/**
|
|
7415
|
-
* Shared tail for the vision and text branches: merge user extra_body
|
|
7416
|
-
* last, then resolve thinking-knob conflicts against the wire model.
|
|
7417
|
-
*/
|
|
7418
|
-
mergeExtraBodyAndResolveKnobs(result, extraBody, model, selectedThinkingKnob) {
|
|
7419
|
-
const merged = {
|
|
7420
|
-
...result,
|
|
7421
|
-
...extraBody ? extraBody : {}
|
|
7422
|
-
};
|
|
7423
|
-
const reasoningEffort = merged["reasoning_effort"];
|
|
7424
|
-
const dropped = /* @__PURE__ */ new Set();
|
|
7425
|
-
if (selectedThinkingKnob?.field === "thinking_budget") {
|
|
7426
|
-
if (reasoningEffort !== void 0) {
|
|
7427
|
-
dropped.add("reasoning_effort");
|
|
6924
|
+
const model = this.deploymentName || options.body["model"] || options.__metadata?.["model"];
|
|
6925
|
+
if (model !== void 0 && !this.baseURL.includes("/deployments")) {
|
|
6926
|
+
options.path = `/deployments/${model}${options.path}`;
|
|
7428
6927
|
}
|
|
7429
|
-
if (merged["enable_thinking"] === false) {
|
|
7430
|
-
dropped.add("enable_thinking");
|
|
7431
|
-
}
|
|
7432
|
-
}
|
|
7433
|
-
if (selectedThinkingKnob?.field === "reasoning_effort" && merged["thinking_budget"] !== void 0) {
|
|
7434
|
-
dropped.add("thinking_budget");
|
|
7435
|
-
}
|
|
7436
|
-
for (const key of dropped) {
|
|
7437
|
-
delete merged[key];
|
|
7438
|
-
}
|
|
7439
|
-
for (const key of this.dropConflictingThinkingKnobs(
|
|
7440
|
-
model,
|
|
7441
|
-
merged,
|
|
7442
|
-
selectedThinkingKnob
|
|
7443
|
-
)) {
|
|
7444
|
-
dropped.add(key);
|
|
7445
6928
|
}
|
|
7446
|
-
|
|
7447
|
-
this.flattenGptReasoningEffort(merged);
|
|
7448
|
-
return merged;
|
|
6929
|
+
return super.buildRequest(options, props);
|
|
7449
6930
|
}
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
* accepts. The qwen3.8-max family takes the tiered `reasoning_effort`
|
|
7456
|
-
* directly; older qwen hybrid models expose only the on/off
|
|
7457
|
-
* `enable_thinking` switch, so the effort ladder collapses to on/off
|
|
7458
|
-
* there. Gated to qwen-family wire models (mirroring the pipeline's
|
|
7459
|
-
* disable gate) so the qwen-specific fields never leak to a non-qwen
|
|
7460
|
-
* model sharing the DashScope endpoint.
|
|
7461
|
-
*/
|
|
7462
|
-
buildQwenEffortConfig(model) {
|
|
7463
|
-
const reasoning = this.contentGeneratorConfig.reasoning;
|
|
7464
|
-
if (!reasoning || reasoning.effort === void 0) {
|
|
7465
|
-
return {};
|
|
7466
|
-
}
|
|
7467
|
-
const wireModel = this.resolveWireModel(model);
|
|
7468
|
-
if (isTieredEffortWireModel(wireModel)) {
|
|
7469
|
-
return { reasoning_effort: this.clampTieredEffort(reasoning.effort) };
|
|
7470
|
-
}
|
|
7471
|
-
if (isQwenFamilyWireModel(wireModel)) {
|
|
7472
|
-
return { enable_thinking: true };
|
|
7473
|
-
}
|
|
7474
|
-
return {};
|
|
7475
|
-
}
|
|
7476
|
-
/**
|
|
7477
|
-
* Cap a configured tier at what the qwen3.8-max family actually accepts.
|
|
7478
|
-
* This family does not take `max`, and the rejection is a 400 on every
|
|
7479
|
-
* subsequent request rather than a one-off, so the tier is clamped to the
|
|
7480
|
-
* strongest supported tier and reported once. Only the
|
|
7481
|
-
* configured `reasoning.effort` passes through here: an explicit
|
|
7482
|
-
* `extra_body` / `samplingParams` `reasoning_effort` is a documented
|
|
7483
|
-
* verbatim override and is merged after this, so it still ships unchanged.
|
|
7484
|
-
*/
|
|
7485
|
-
clampTieredEffort(effort) {
|
|
7486
|
-
const clamped = clampReasoningEffort(effort, DASHSCOPE_TIERED_EFFORTS);
|
|
7487
|
-
if (clamped !== effort && !this.effortClampWarned) {
|
|
7488
|
-
debugLogger2.warn(
|
|
7489
|
-
`reasoning.effort='${effort}' is not accepted by the DashScope tiered-effort family; using '${clamped}'.`
|
|
7490
|
-
);
|
|
7491
|
-
this.effortClampWarned = true;
|
|
7492
|
-
}
|
|
7493
|
-
return clamped;
|
|
7494
|
-
}
|
|
7495
|
-
/**
|
|
7496
|
-
* Resolve thinking knobs that conflict with a shipping `reasoning_effort`.
|
|
7497
|
-
* Preset extra_body injects `enable_thinking` for models declared with
|
|
7498
|
-
* enableThinking (provider-config.ts), and user extra_body merges last.
|
|
7499
|
-
* Only the qwen3.8-max family reads `reasoning_effort` itself — there an
|
|
7500
|
-
* effort tier ships alone: an `enable_thinking: true` alongside an effort
|
|
7501
|
-
* tier is a second competing knob (the shape the nested-`reasoning` strip
|
|
7502
|
-
* in buildRequest exists to prevent), and DashScope rejects
|
|
7503
|
-
* `reasoning_effort` combined with `thinking_budget`. The `'none'`
|
|
7504
|
-
* disable and a winning `thinking_budget` intentionally keep a co-present
|
|
7505
|
-
* `enable_thinking: true`. Explicit same-layer effort/budget pairs retain
|
|
7506
|
-
* reasoning_effort, matching the provider's behavior before cross-layer
|
|
7507
|
-
* resolution. An explicit `enable_thinking: false` is the documented
|
|
7508
|
-
* extra_body escape hatch winning over the config tier, so it is honoured
|
|
7509
|
-
* as the family's canonical disable (`reasoning_effort: 'none'`, preserved
|
|
7510
|
-
* by the pipeline's disable strip) rather than silently deleted; a
|
|
7511
|
-
* higher-priority `enable_thinking: true` conversely keeps the shipping
|
|
7512
|
-
* tier. Older qwen
|
|
7513
|
-
* hybrids read `enable_thinking` / `thinking_budget`, not
|
|
7514
|
-
* `reasoning_effort`, so when an opaque reasoning_effort override
|
|
7515
|
-
* conflicts with a meaningful thinking_budget the inert field goes and
|
|
7516
|
-
* the knobs the model reads survive. Non-qwen models treat
|
|
7517
|
-
* `reasoning_effort` as an opaque sampling override and keep every knob.
|
|
7518
|
-
*/
|
|
7519
|
-
dropConflictingThinkingKnobs(model, merged, selectedThinkingKnob) {
|
|
7520
|
-
const wireModel = this.resolveWireModel(model);
|
|
7521
|
-
if (!isQwenFamilyWireModel(wireModel)) {
|
|
7522
|
-
return [];
|
|
7523
|
-
}
|
|
7524
|
-
const isTieredEffortModel = isTieredEffortWireModel(wireModel);
|
|
7525
|
-
if (isTieredEffortModel && selectedThinkingKnob?.field === "enable_thinking" && selectedThinkingKnob.value === false) {
|
|
7526
|
-
merged["reasoning_effort"] = "none";
|
|
7527
|
-
const dropped = ["enable_thinking"];
|
|
7528
|
-
if (merged["thinking_budget"] !== void 0) {
|
|
7529
|
-
dropped.push("thinking_budget");
|
|
7530
|
-
}
|
|
7531
|
-
for (const key of dropped) {
|
|
7532
|
-
delete merged[key];
|
|
7533
|
-
}
|
|
7534
|
-
return dropped;
|
|
7535
|
-
}
|
|
7536
|
-
const effort = merged["reasoning_effort"];
|
|
7537
|
-
if (typeof effort !== "string") {
|
|
7538
|
-
return [];
|
|
7539
|
-
}
|
|
7540
|
-
if (isTieredEffortModel && effort === "none") {
|
|
7541
|
-
if (merged["thinking_budget"] === void 0) {
|
|
7542
|
-
return [];
|
|
6931
|
+
async _getAzureADToken() {
|
|
6932
|
+
if (typeof this._azureADTokenProvider === "function") {
|
|
6933
|
+
const token = await this._azureADTokenProvider();
|
|
6934
|
+
if (!token || typeof token !== "string") {
|
|
6935
|
+
throw new OpenAIError(`Expected 'azureADTokenProvider' argument to return a string but it returned ${token}`);
|
|
7543
6936
|
}
|
|
7544
|
-
|
|
7545
|
-
return ["thinking_budget"];
|
|
6937
|
+
return token;
|
|
7546
6938
|
}
|
|
7547
|
-
|
|
7548
|
-
if (selectedThinkingKnob?.field === "reasoning_effort" && "enable_thinking" in merged) {
|
|
7549
|
-
delete merged["enable_thinking"];
|
|
7550
|
-
return ["enable_thinking"];
|
|
7551
|
-
}
|
|
7552
|
-
return [];
|
|
7553
|
-
}
|
|
7554
|
-
if (merged["thinking_budget"] === void 0) {
|
|
7555
|
-
return [];
|
|
7556
|
-
}
|
|
7557
|
-
delete merged["reasoning_effort"];
|
|
7558
|
-
return ["reasoning_effort"];
|
|
7559
|
-
}
|
|
7560
|
-
warnConflictingKnobDrop(model, reasoningEffort, dropped) {
|
|
7561
|
-
if (dropped.length === 0) {
|
|
7562
|
-
return;
|
|
7563
|
-
}
|
|
7564
|
-
if (!this.conflictingKnobDropWarned) {
|
|
7565
|
-
this.conflictingKnobDropWarned = true;
|
|
7566
|
-
debugLogger2.warn("DashScope: dropped conflicting thinking knobs", {
|
|
7567
|
-
model: this.resolveWireModel(model),
|
|
7568
|
-
reasoningEffort,
|
|
7569
|
-
dropped
|
|
7570
|
-
});
|
|
7571
|
-
}
|
|
7572
|
-
}
|
|
7573
|
-
conflictingKnobDropWarned = false;
|
|
7574
|
-
buildMetadata(userPromptId) {
|
|
7575
|
-
const channel = this.cliConfig.getChannel?.();
|
|
7576
|
-
return {
|
|
7577
|
-
metadata: {
|
|
7578
|
-
sessionId: this.cliConfig.getSessionId?.(),
|
|
7579
|
-
promptId: userPromptId,
|
|
7580
|
-
...channel ? { channel } : {}
|
|
7581
|
-
}
|
|
7582
|
-
};
|
|
7583
|
-
}
|
|
7584
|
-
getDefaultGenerationConfig() {
|
|
7585
|
-
return {};
|
|
7586
|
-
}
|
|
7587
|
-
/**
|
|
7588
|
-
* Add cache control flag to specified message(s) for DashScope providers
|
|
7589
|
-
*/
|
|
7590
|
-
addDashScopeCacheControl(request, cacheControl) {
|
|
7591
|
-
const messages = request.messages;
|
|
7592
|
-
const systemIndex = messages.findIndex((msg) => msg.role === "system");
|
|
7593
|
-
const lastIndex = messages.length - 1;
|
|
7594
|
-
const updatedMessages = messages.length === 0 ? messages : messages.map((message, index) => {
|
|
7595
|
-
const shouldAddCacheControl = Boolean(
|
|
7596
|
-
index === systemIndex && systemIndex !== -1 || index === lastIndex && cacheControl === "all"
|
|
7597
|
-
);
|
|
7598
|
-
if (!shouldAddCacheControl || !("content" in message) || message.content === null || message.content === void 0) {
|
|
7599
|
-
return message;
|
|
7600
|
-
}
|
|
7601
|
-
return {
|
|
7602
|
-
...message,
|
|
7603
|
-
content: this.addCacheControlToContent(message.content)
|
|
7604
|
-
};
|
|
7605
|
-
});
|
|
7606
|
-
const updatedTools = cacheControl === "all" && request.tools?.length ? this.addCacheControlToTools(request.tools) : request.tools;
|
|
7607
|
-
return {
|
|
7608
|
-
messages: updatedMessages,
|
|
7609
|
-
tools: updatedTools
|
|
7610
|
-
};
|
|
7611
|
-
}
|
|
7612
|
-
addCacheControlToTools(tools) {
|
|
7613
|
-
if (tools.length === 0) {
|
|
7614
|
-
return tools;
|
|
7615
|
-
}
|
|
7616
|
-
const updatedTools = [...tools];
|
|
7617
|
-
const lastToolIndex = tools.length - 1;
|
|
7618
|
-
updatedTools[lastToolIndex] = {
|
|
7619
|
-
...updatedTools[lastToolIndex],
|
|
7620
|
-
cache_control: { type: "ephemeral" }
|
|
7621
|
-
};
|
|
7622
|
-
return updatedTools;
|
|
7623
|
-
}
|
|
7624
|
-
/**
|
|
7625
|
-
* Add cache control to message content, handling both string and array formats
|
|
7626
|
-
*/
|
|
7627
|
-
addCacheControlToContent(content) {
|
|
7628
|
-
const contentArray = this.normalizeContentToArray(content);
|
|
7629
|
-
return this.addCacheControlToContentArray(contentArray);
|
|
7630
|
-
}
|
|
7631
|
-
/**
|
|
7632
|
-
* Normalize content to array format
|
|
7633
|
-
*/
|
|
7634
|
-
normalizeContentToArray(content) {
|
|
7635
|
-
if (typeof content === "string") {
|
|
7636
|
-
return [
|
|
7637
|
-
{
|
|
7638
|
-
type: "text",
|
|
7639
|
-
text: content
|
|
7640
|
-
}
|
|
7641
|
-
];
|
|
7642
|
-
}
|
|
7643
|
-
return [...content];
|
|
7644
|
-
}
|
|
7645
|
-
/**
|
|
7646
|
-
* Add cache control to the content array
|
|
7647
|
-
*/
|
|
7648
|
-
addCacheControlToContentArray(contentArray) {
|
|
7649
|
-
if (contentArray.length === 0) {
|
|
7650
|
-
return contentArray;
|
|
7651
|
-
}
|
|
7652
|
-
const lastItem = contentArray[contentArray.length - 1];
|
|
7653
|
-
contentArray[contentArray.length - 1] = {
|
|
7654
|
-
...lastItem,
|
|
7655
|
-
cache_control: { type: "ephemeral" }
|
|
7656
|
-
};
|
|
7657
|
-
return contentArray;
|
|
7658
|
-
}
|
|
7659
|
-
/**
|
|
7660
|
-
* True for glm-* models (e.g. glm-4.5, glm-5.2). Uses the same `^glm-` prefix
|
|
7661
|
-
* convention as the GLM matchers in tokenLimits.ts, keeping model detection
|
|
7662
|
-
* consistent across the codebase.
|
|
7663
|
-
*/
|
|
7664
|
-
isGlmModel(model) {
|
|
7665
|
-
return !!model && model.toLowerCase().startsWith("glm-");
|
|
7666
|
-
}
|
|
7667
|
-
/**
|
|
7668
|
-
* Whether the request is in "function-calling mode" — it declares `tools`, or
|
|
7669
|
-
* its history already contains a tool result / assistant tool_call. glm needs
|
|
7670
|
-
* one of these present to parse structured content-part arrays.
|
|
7671
|
-
*/
|
|
7672
|
-
hasFunctionCallingContext(request) {
|
|
7673
|
-
if (request.tools && request.tools.length > 0) {
|
|
7674
|
-
return true;
|
|
7675
|
-
}
|
|
7676
|
-
return request.messages.some((message) => {
|
|
7677
|
-
if (message.role === "tool") {
|
|
7678
|
-
return true;
|
|
7679
|
-
}
|
|
7680
|
-
if (message.role === "assistant") {
|
|
7681
|
-
const toolCalls = message.tool_calls;
|
|
7682
|
-
return Array.isArray(toolCalls) && toolCalls.length > 0;
|
|
7683
|
-
}
|
|
7684
|
-
return false;
|
|
7685
|
-
});
|
|
6939
|
+
return void 0;
|
|
7686
6940
|
}
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
* media-bearing parts (image/audio/...) as arrays. Used for glm tool-less
|
|
7690
|
-
* requests, where the array form would otherwise be dropped server-side.
|
|
7691
|
-
* Multiple text parts are joined with a blank line, matching the DeepSeek
|
|
7692
|
-
* provider's flattening (separate parts read as separate blocks).
|
|
7693
|
-
* Only called on the flatten branch, which skips cache control, so no part
|
|
7694
|
-
* here carries a `cache_control` marker.
|
|
7695
|
-
*/
|
|
7696
|
-
flattenTextContent(messages) {
|
|
7697
|
-
return messages.map((message) => {
|
|
7698
|
-
if (!("content" in message) || !Array.isArray(message.content)) {
|
|
7699
|
-
return message;
|
|
7700
|
-
}
|
|
7701
|
-
const parts = message.content;
|
|
7702
|
-
if (parts.length === 0) {
|
|
7703
|
-
return message;
|
|
7704
|
-
}
|
|
7705
|
-
const isTextOnly = parts.every((part) => part && part.type === "text");
|
|
7706
|
-
if (!isTextOnly) {
|
|
7707
|
-
return message;
|
|
7708
|
-
}
|
|
7709
|
-
const text = parts.map((part) => part.text ?? "").join("\n\n");
|
|
7710
|
-
return {
|
|
7711
|
-
...message,
|
|
7712
|
-
content: text
|
|
7713
|
-
};
|
|
7714
|
-
});
|
|
6941
|
+
async authHeaders(opts) {
|
|
6942
|
+
return;
|
|
7715
6943
|
}
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
static VISION_MODEL_EXACT_MATCHES = /* @__PURE__ */ new Set(["coder-model"]);
|
|
7721
|
-
static VISION_MODEL_PREFIX_PATTERNS = [
|
|
7722
|
-
"qwen-vl",
|
|
7723
|
-
// qwen-vl-max, qwen-vl-max-latest, etc.
|
|
7724
|
-
"qwen3-vl-plus",
|
|
7725
|
-
// qwen3-vl-plus variants
|
|
7726
|
-
"qwen3.5-plus",
|
|
7727
|
-
// qwen3.5-plus (has built-in vision capabilities)
|
|
7728
|
-
"qwen3.6-plus",
|
|
7729
|
-
// qwen3.6-plus (multimodal)
|
|
7730
|
-
"qwen3.7-plus"
|
|
7731
|
-
// qwen3.7-plus (multimodal)
|
|
7732
|
-
];
|
|
7733
|
-
isVisionModel(model) {
|
|
7734
|
-
if (!model) {
|
|
7735
|
-
return false;
|
|
6944
|
+
async prepareOptions(opts) {
|
|
6945
|
+
opts.headers = buildHeaders([opts.headers]);
|
|
6946
|
+
if (opts.headers.values.get("Authorization") || opts.headers.values.get("api-key")) {
|
|
6947
|
+
return super.prepareOptions(opts);
|
|
7736
6948
|
}
|
|
7737
|
-
const
|
|
7738
|
-
if (
|
|
7739
|
-
|
|
7740
|
-
)
|
|
7741
|
-
|
|
7742
|
-
}
|
|
7743
|
-
|
|
7744
|
-
if (normalized.startsWith(prefix)) {
|
|
7745
|
-
return true;
|
|
7746
|
-
}
|
|
6949
|
+
const token = await this._getAzureADToken();
|
|
6950
|
+
if (token) {
|
|
6951
|
+
opts.headers.values.set("Authorization", `Bearer ${token}`);
|
|
6952
|
+
} else if (this.apiKey !== API_KEY_SENTINEL) {
|
|
6953
|
+
opts.headers.values.set("api-key", this.apiKey);
|
|
6954
|
+
} else {
|
|
6955
|
+
throw new OpenAIError("Unable to handle auth");
|
|
7747
6956
|
}
|
|
7748
|
-
return
|
|
7749
|
-
}
|
|
7750
|
-
/**
|
|
7751
|
-
* Check if cache control should be disabled based on configuration.
|
|
7752
|
-
*
|
|
7753
|
-
* @returns true if cache control should be enabled, false otherwise
|
|
7754
|
-
*/
|
|
7755
|
-
shouldEnableCacheControl() {
|
|
7756
|
-
return this.cliConfig.getContentGeneratorConfig()?.enableCacheControl !== false;
|
|
6957
|
+
return super.prepareOptions(opts);
|
|
7757
6958
|
}
|
|
7758
6959
|
};
|
|
6960
|
+
var _deployments_endpoints = /* @__PURE__ */ new Set([
|
|
6961
|
+
"/completions",
|
|
6962
|
+
"/chat/completions",
|
|
6963
|
+
"/embeddings",
|
|
6964
|
+
"/audio/transcriptions",
|
|
6965
|
+
"/audio/translations",
|
|
6966
|
+
"/audio/speech",
|
|
6967
|
+
"/images/generations",
|
|
6968
|
+
"/batches",
|
|
6969
|
+
"/images/edits"
|
|
6970
|
+
]);
|
|
6971
|
+
var API_KEY_SENTINEL = "<Missing Key>";
|
|
7759
6972
|
|
|
7760
6973
|
export {
|
|
6974
|
+
OpenAIError,
|
|
6975
|
+
APIError,
|
|
6976
|
+
APIUserAbortError,
|
|
6977
|
+
APIConnectionError,
|
|
6978
|
+
APIConnectionTimeoutError,
|
|
6979
|
+
BadRequestError,
|
|
6980
|
+
AuthenticationError,
|
|
6981
|
+
PermissionDeniedError,
|
|
6982
|
+
NotFoundError,
|
|
6983
|
+
ConflictError,
|
|
6984
|
+
UnprocessableEntityError,
|
|
6985
|
+
RateLimitError,
|
|
6986
|
+
InternalServerError,
|
|
6987
|
+
InvalidWebhookSignatureError,
|
|
6988
|
+
APIPromise,
|
|
6989
|
+
PagePromise,
|
|
6990
|
+
toFile,
|
|
7761
6991
|
OpenAI,
|
|
7762
|
-
|
|
7763
|
-
DefaultOpenAICompatibleProvider,
|
|
7764
|
-
selectDashScopeThinkingKnob,
|
|
7765
|
-
DASHSCOPE_REGIONAL_HOSTS,
|
|
7766
|
-
DashScopeOpenAICompatibleProvider
|
|
6992
|
+
AzureOpenAI
|
|
7767
6993
|
};
|
|
7768
|
-
/**
|
|
7769
|
-
* @license
|
|
7770
|
-
* Copyright 2025 Qwen
|
|
7771
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7772
|
-
*/
|