@qwen-code/qwen-code 0.26.2-preview.0 → 0.26.2-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{MaxSizedBox-K6YUM3DX.js → MaxSizedBox-EGHZ2BPF.js} +1 -1
- package/chunks/{StandaloneSessionPicker-75IC33SN.js → StandaloneSessionPicker-UVCW6YW3.js} +1 -1
- package/chunks/{acp-subagent-executor-3NHBJRPL.js → acp-subagent-executor-AQ7AWSD4.js} +1 -1
- package/chunks/{acpAgent-JT6KQPTH.js → acpAgent-IV7JAGD7.js} +3 -3
- package/chunks/{advisor-TI2UVEZK.js → advisor-UZ4TF65D.js} +1 -1
- package/chunks/{agent-SWIZZZMY.js → agent-CNLVAWDD.js} +1 -1
- package/chunks/{agent-headless-USWEJ4GW.js → agent-headless-ZJUJLUJS.js} +1 -1
- package/chunks/{agent-host-client-ZFIMQX33.js → agent-host-client-SN5V2KBH.js} +1 -1
- package/chunks/{agent-host-connections-LOFD7O7Q.js → agent-host-connections-VKMAJIIU.js} +1 -1
- package/chunks/{anthropicContentGenerator-HMLEI4FI.js → anthropicContentGenerator-QTJVPAMI.js} +1 -1
- package/chunks/{autofix-pr-NKR2VSLB.js → autofix-pr-U7GNSH27.js} +1 -1
- package/chunks/{batch-JQZ3TOHA.js → batch-MBEWETXN.js} +1 -1
- package/chunks/{bridge-EIWWT4P6.js → bridge-TEJLNYV3.js} +1 -1
- package/chunks/{channel-settings-store-FLRLUA67.js → channel-settings-store-QNCKWWBL.js} +1 -1
- package/chunks/{chunk-244YTFYD.js → chunk-23KDY7UW.js} +1 -1
- package/chunks/{chunk-7TDMQJTD.js → chunk-2DWWSMTV.js} +1 -1
- package/chunks/{chunk-UU2LTNSF.js → chunk-3IZMVLVZ.js} +1 -1
- package/chunks/{chunk-B6T4ESBM.js → chunk-3JI7IKJL.js} +1 -1
- package/chunks/{chunk-Y5TT2G3N.js → chunk-427MARCP.js} +1 -1
- package/chunks/{chunk-KX7JS2P7.js → chunk-4NNNGSQY.js} +3 -3
- package/chunks/{chunk-6TQS2WQO.js → chunk-4RM7KY3Z.js} +2 -2
- package/chunks/{chunk-YL3N2UGG.js → chunk-5X7S4AE6.js} +5 -5
- package/chunks/{chunk-K2HAY5PY.js → chunk-5XAECBED.js} +1 -1
- package/chunks/{chunk-VCHFBETO.js → chunk-66KKSLUO.js} +1 -1
- package/chunks/{chunk-BSJR2KEF.js → chunk-6CIIDUZW.js} +1 -1
- package/chunks/{chunk-22CLK7PK.js → chunk-7EBRMQYW.js} +1 -1
- package/chunks/{chunk-J4TFGZ4A.js → chunk-7FSC2NKA.js} +1 -1
- package/chunks/{chunk-6JFC5M6B.js → chunk-A5TAAMML.js} +1 -1
- package/chunks/{chunk-DHHACQVN.js → chunk-AOYSX44A.js} +1 -1
- package/chunks/{chunk-VFVZ2DY7.js → chunk-AZCMQ3DD.js} +2 -2
- package/chunks/{chunk-BQJXWIMR.js → chunk-B6F7CVBP.js} +1 -1
- package/chunks/{chunk-OVPEAKOQ.js → chunk-BDQOLT37.js} +1 -1
- package/chunks/{chunk-5SYUBQNO.js → chunk-BIWEUAKG.js} +1 -1
- package/chunks/{chunk-BZM66PQO.js → chunk-BJ5R7LOM.js} +1 -1
- package/chunks/{chunk-4R2OHBH3.js → chunk-BKUFRNME.js} +1 -1
- package/chunks/{chunk-NIYWNFVF.js → chunk-BNZSPX2I.js} +1 -1
- package/chunks/{chunk-FJV2ECNY.js → chunk-D2URRVOK.js} +1 -1
- package/chunks/{chunk-GT6CHVAI.js → chunk-DANP7CMW.js} +1 -1
- package/chunks/{chunk-FHFLD4DR.js → chunk-DBHLRZGI.js} +1 -1
- package/chunks/{chunk-Y2UXZJLM.js → chunk-DL7TKH2E.js} +2 -2
- package/chunks/{chunk-MCQE2U7N.js → chunk-DOWKH5OZ.js} +6 -6
- package/chunks/{chunk-UHRLBY3C.js → chunk-DPHQJPCU.js} +1 -1
- package/chunks/{chunk-PV2VT25U.js → chunk-DPNGBOI7.js} +1 -1
- package/chunks/{chunk-NCDNF7UJ.js → chunk-DXRXF4QD.js} +1 -1
- package/chunks/{chunk-OCVRMNEQ.js → chunk-DZ3GV34J.js} +1 -1
- package/chunks/{chunk-3QIAXWWW.js → chunk-EU2MKUK4.js} +1 -1
- package/chunks/{chunk-KMAVI6FB.js → chunk-EVBUXPGM.js} +1 -1
- package/chunks/{chunk-BVSTV4JM.js → chunk-F3ZRU2SA.js} +1 -1
- package/chunks/{chunk-TBZY477Y.js → chunk-FCZYH27X.js} +1 -1
- package/chunks/{chunk-JCOK67LT.js → chunk-FNDMWG43.js} +1 -1
- package/chunks/{chunk-5SF32OGU.js → chunk-GDXLJJSW.js} +1 -1
- package/chunks/{chunk-SO6FCPRI.js → chunk-GZYIXB7Y.js} +1 -1
- package/chunks/{chunk-WZPTWC7X.js → chunk-HHNAH4IH.js} +1 -1
- package/chunks/{chunk-7KCAOXNL.js → chunk-HOKROBQZ.js} +1 -1
- package/chunks/{chunk-34ZBUQJV.js → chunk-IGPAATQW.js} +1 -1
- package/chunks/{chunk-2ZTRKK2O.js → chunk-INFBJDWM.js} +1 -1
- package/chunks/{chunk-IEJ2CGRN.js → chunk-J3R7ZNSA.js} +1 -1
- package/chunks/{chunk-KT5MPRYB.js → chunk-JCRS367I.js} +1 -1
- package/chunks/{chunk-7JWJTRP6.js → chunk-JFVXZFMV.js} +1 -1
- package/chunks/{chunk-47LP4MBD.js → chunk-JKMGS2VD.js} +1 -1
- package/chunks/{chunk-WRJ3PMDZ.js → chunk-JUQ7T2MV.js} +1 -1
- package/chunks/{chunk-NZX3UWNF.js → chunk-KQ4TDFNE.js} +1 -1
- package/chunks/{chunk-X7D4VKMX.js → chunk-L6BKKN42.js} +1 -1
- package/chunks/{chunk-YG5HVFMY.js → chunk-L7Y6MOHS.js} +1 -1
- package/chunks/{chunk-UFTIUKD4.js → chunk-LGYXZJI3.js} +1 -1
- package/chunks/{chunk-JQGGILML.js → chunk-LPOEVTKD.js} +1 -1
- package/chunks/{chunk-5KI55A6S.js → chunk-LRXS7ZI2.js} +1 -1
- package/chunks/{chunk-CKVHEYXW.js → chunk-LYYVSCNL.js} +1 -1
- package/chunks/{chunk-LIIMQ4DI.js → chunk-LZNBHBAJ.js} +6 -6
- package/chunks/{chunk-H4GDEXMF.js → chunk-M3C6RDGC.js} +1 -1
- package/chunks/{chunk-KKKUB3RQ.js → chunk-MNVMHVQJ.js} +1 -1
- package/chunks/{chunk-2B3W7IQY.js → chunk-MVGQFFIK.js} +1 -1
- package/chunks/{chunk-Q35A2RGO.js → chunk-NC7BCZPQ.js} +1 -1
- package/chunks/{chunk-2ZOTG3NW.js → chunk-NE627MUW.js} +1 -1
- package/chunks/{chunk-W4P2EN3V.js → chunk-NZNRCPGE.js} +1 -1
- package/chunks/{chunk-YPDQJQ3S.js → chunk-P3M4WWRA.js} +1 -1
- package/chunks/{chunk-DVB36ASH.js → chunk-P534ONQN.js} +1 -1
- package/chunks/{chunk-EL5J4ESB.js → chunk-QF44NNSC.js} +1 -1
- package/chunks/{chunk-IQPJOBPI.js → chunk-QHGCDHNW.js} +1 -1
- package/chunks/{chunk-EVZC4KEQ.js → chunk-QWJX7NIP.js} +1 -1
- package/chunks/{chunk-J2TJL2F4.js → chunk-S53G54DW.js} +2 -2
- package/chunks/{chunk-3A6LFJJV.js → chunk-SMNFL3AD.js} +1 -1
- package/chunks/{chunk-WDO3K3P2.js → chunk-TOBNWST4.js} +1 -1
- package/chunks/{chunk-AVGJ4HE3.js → chunk-TQSBUHAM.js} +1 -1
- package/chunks/{chunk-ABUS7DNN.js → chunk-TW5QEP2J.js} +1 -1
- package/chunks/{chunk-WYM4Z4D5.js → chunk-UEB2F43V.js} +1 -1
- package/chunks/{chunk-FUUPMVD2.js → chunk-UPPE4I6H.js} +1 -1
- package/chunks/{chunk-UHBJVFZA.js → chunk-US42COBM.js} +1 -1
- package/chunks/{chunk-RMQNBSMK.js → chunk-UUY6XSQI.js} +1 -1
- package/chunks/{chunk-UVQUQNCA.js → chunk-UZI3IA27.js} +1 -1
- package/chunks/{chunk-SXJ2E33J.js → chunk-V6VMUJ47.js} +1 -1
- package/chunks/{chunk-5UFCNJGN.js → chunk-VG2ZINTO.js} +1 -1
- package/chunks/{chunk-JPPPJ2GN.js → chunk-VJI6MHWX.js} +1 -1
- package/chunks/{chunk-AUI7WVSU.js → chunk-VOBNHBCJ.js} +1 -1
- package/chunks/{chunk-3BNJDZHU.js → chunk-VUEZWMI4.js} +1 -1
- package/chunks/{chunk-LMNKCL55.js → chunk-W7ZX6WB3.js} +2 -2
- package/chunks/{chunk-HVS6V2UZ.js → chunk-WA2LKUVP.js} +1 -1
- package/chunks/{chunk-7APLU2XE.js → chunk-WFFCJ5PF.js} +1 -1
- package/chunks/{chunk-3TD4WAG5.js → chunk-WQY5GE65.js} +1 -1
- package/chunks/{chunk-3YWRMF6C.js → chunk-WSESLSKK.js} +1 -1
- package/chunks/{chunk-NILCQMZ7.js → chunk-XFJV5NYT.js} +1 -1
- package/chunks/{chunk-LGBGUITT.js → chunk-XIYLRIW4.js} +1 -1
- package/chunks/{chunk-KS74L67R.js → chunk-XQ2NYKJH.js} +1 -1
- package/chunks/{chunk-JB2NOB6W.js → chunk-Y3VRWG52.js} +1 -1
- package/chunks/{chunk-GVZ6D2NL.js → chunk-YBISME5B.js} +1 -1
- package/chunks/{chunk-2C2253QI.js → chunk-YJNWPSB3.js} +1 -1
- package/chunks/{chunk-O2T3GQ6F.js → chunk-YWVV5STA.js} +1 -1
- package/chunks/{chunk-MAQZSOHI.js → chunk-ZH4J3FL6.js} +1 -1
- package/chunks/{chunk-THNEKTPK.js → chunk-ZSKCF6DI.js} +1 -1
- package/chunks/{chunk-Z7BAHKO5.js → chunk-ZW6456SD.js} +1 -1
- package/chunks/{chunk-DMSZ2TB3.js → chunk-ZWM3LLT7.js} +1 -1
- package/chunks/{codex-subagent-executor-DQ5LQQWO.js → codex-subagent-executor-DWWT7246.js} +1 -1
- package/chunks/{config-utils-CY6HLKZ5.js → config-utils-NGZB522W.js} +1 -1
- package/chunks/{contextCommand-SGBWI7O6.js → contextCommand-7QCW2YNX.js} +1 -1
- package/chunks/{core-runtime-4DP27LCC.js → core-runtime-PSVNDJPD.js} +1 -1
- package/chunks/{create-sub-session-ECPDZMBX.js → create-sub-session-JTSEMEJE.js} +1 -1
- package/chunks/{cron-create-OO4OG3EI.js → cron-create-VGIDTUMX.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-OYDNHT7P.js → daemon-git-worktree-guard-IQRGS7IH.js} +1 -1
- package/chunks/{daemon-status-provider-JGDLXPC6.js → daemon-status-provider-R4MYCYPG.js} +1 -1
- package/chunks/{daemon-trust-policy-5HRARS54.js → daemon-trust-policy-VAUKFZ2N.js} +1 -1
- package/chunks/{daemon-trust-policy-monitor-RM7FVIIC.js → daemon-trust-policy-monitor-E5HIO6RP.js} +1 -1
- package/chunks/{deferred-core-runtime-3CXBZIOG.js → deferred-core-runtime-FLOFQJPU.js} +1 -1
- package/chunks/{edit-DJPESAAY.js → edit-OOVQUGKV.js} +1 -1
- package/chunks/{enterPlanMode-IHBLRIF3.js → enterPlanMode-AUWVTQLT.js} +1 -1
- package/chunks/{environment-JN5SD347.js → environment-RM5OXYP4.js} +1 -1
- package/chunks/{errors-NUJCME3Y.js → errors-CLDJGHVD.js} +1 -1
- package/chunks/{execution-tool-I3SWG6I3.js → execution-tool-JFBVOKPW.js} +1 -1
- package/chunks/{execution-worker-62UZMAMJ.js → execution-worker-MNJZD72W.js} +1 -1
- package/chunks/{exitPlanMode-JIC4V3FE.js → exitPlanMode-PC6XG4TW.js} +1 -1
- package/chunks/{fast-path-NIOIL5YI.js → fast-path-V4DN3CRZ.js} +1 -1
- package/chunks/{glob-EQ4QNAHF.js → glob-DTZROBDS.js} +1 -1
- package/chunks/{goal-tools-DYTTSBQG.js → goal-tools-FUVGTY33.js} +1 -1
- package/chunks/{handleAutoUpdate-44BTG5L5.js → handleAutoUpdate-U4LVTHGU.js} +1 -1
- package/chunks/{i18n-FTHZAHCT.js → i18n-XOKNDFYP.js} +1 -1
- package/chunks/{initializer-MSGKXC75.js → initializer-XBR5J4CY.js} +1 -1
- package/chunks/{installationInfo-4XJMJJYU.js → installationInfo-4AOEOUI6.js} +1 -1
- package/chunks/{interactive-mod-session-DFLRYO2Q.js → interactive-mod-session-YGZK2JK2.js} +1 -1
- package/chunks/{list-ODZ7Z6VI.js → list-TCGKVPH4.js} +1 -1
- package/chunks/{llm-O64DHKP7.js → llm-SKFTN5UN.js} +4 -4
- package/chunks/{llm-content-generator-SK24I6QS.js → llm-content-generator-GWHXT3WS.js} +1 -1
- package/chunks/{loadedSettingsAdapter-6PEBUZT5.js → loadedSettingsAdapter-ZALZGZE7.js} +1 -1
- package/chunks/{local-ED3UEKWP.js → local-RWTWYS5Z.js} +1 -1
- package/chunks/{local-execution-environment-PUKES5LO.js → local-execution-environment-R6JWLD65.js} +1 -1
- package/chunks/{loggingContentGenerator-UHOJVSRR.js → loggingContentGenerator-UJV6QFOY.js} +1 -1
- package/chunks/{loop-wakeup-NSJQETPZ.js → loop-wakeup-BU2RRYHA.js} +1 -1
- package/chunks/{manage-memory-5RRB6FLH.js → manage-memory-XI57JN4T.js} +1 -1
- package/chunks/{managed-execution-engine-MZAP7SK6.js → managed-execution-engine-BA5PABMP.js} +1 -1
- package/chunks/{managed-local-serve-XMES3HXL.js → managed-local-serve-MFKN22K6.js} +1 -1
- package/chunks/{managed-npm-update-R5KGY7G2.js → managed-npm-update-ZGN43NUA.js} +1 -1
- package/chunks/{managed-runtime-attestation-worker-O2KNHHV6.js → managed-runtime-attestation-worker-YN2VBGYN.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-HOTLM6DE.js → managed-runtime-bootstrap-SGQVMUJE.js} +1 -1
- package/chunks/{managed-runtime-session-worker-QZX44ZTD.js → managed-runtime-session-worker-4UMF3VBY.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-U425WQ65.js → managed-runtime-ssh-worker-7XA6KRBN.js} +1 -1
- package/chunks/{managed-session-authority-THHDHCBP.js → managed-session-authority-IJGYAOEL.js} +1 -1
- package/chunks/{mcp-AR7EK4WY.js → mcp-V3L7B5YK.js} +1 -1
- package/chunks/{memory-C2TSF6BK.js → memory-3T6FPNAK.js} +1 -1
- package/chunks/{model-call-collection-25WR55OH.js → model-call-collection-WTTITWWM.js} +1 -1
- package/chunks/{model-configuration-KC7DQGKV.js → model-configuration-T6SSGI4J.js} +1 -1
- package/chunks/{modelConfigUtils-QEHMVLSQ.js → modelConfigUtils-TQA25QJC.js} +1 -1
- package/chunks/{monitor-PDQUZD23.js → monitor-5ZAOJSEE.js} +1 -1
- package/chunks/{nonInteractiveCli-WY2YFONU.js → nonInteractiveCli-YFINLVA7.js} +1 -1
- package/chunks/{nonInteractiveToolExecutor-7RJZYPHJ.js → nonInteractiveToolExecutor-DE3WACL5.js} +1 -1
- package/chunks/{notebook-edit-P4ITXF5H.js → notebook-edit-UK6HBRO3.js} +1 -1
- package/chunks/{omni-AYUPB2QM.js → omni-65LF5QK4.js} +1 -1
- package/chunks/{openaiContentGenerator-V5IK4ITO.js → openaiContentGenerator-HX7NCSV5.js} +1 -1
- package/chunks/{openaiResponsesContentGenerator-DYDH6KWT.js → openaiResponsesContentGenerator-CFA6U6Y5.js} +1 -1
- package/chunks/{pidfile-INPBL2DK.js → pidfile-ZVKJUNTZ.js} +1 -1
- package/chunks/{processUtils-J4UDEDS4.js → processUtils-VS6CJT7E.js} +1 -1
- package/chunks/{prompt-terminal-ledger-QLOQWHYE.js → prompt-terminal-ledger-UF5RDB57.js} +1 -1
- package/chunks/{qwenContentGenerator-RU43XKKB.js → qwenContentGenerator-GM3ZSI7E.js} +1 -1
- package/chunks/{reactive-degrade-2Q3Z3KAR.js → reactive-degrade-TSAQWZ5F.js} +1 -1
- package/chunks/{read-file-472BQ25I.js → read-file-J267NT45.js} +1 -1
- package/chunks/{resumeHistoryUtils-7SUFKZDC.js → resumeHistoryUtils-IM46VFDV.js} +1 -1
- package/chunks/{review-WX52IWJR.js → review-4B64XTCL.js} +1 -1
- package/chunks/{ripGrep-4GPGLKAM.js → ripGrep-YLOSXO7P.js} +1 -1
- package/chunks/{run-qwen-serve-MXK4RBKL.js → run-qwen-serve-SAHEC44O.js} +1 -1
- package/chunks/{runtime-WHU3AGFT.js → runtime-SJDZHV6J.js} +1 -1
- package/chunks/{sandboxConfig-7DBXEQJH.js → sandboxConfig-47EXXMUA.js} +1 -1
- package/chunks/{scheduled-tasks-O5RV6G6U.js → scheduled-tasks-E6RCTUUS.js} +1 -1
- package/chunks/{scheduler-HLMS5LR5.js → scheduler-SE3IWIWA.js} +1 -1
- package/chunks/{search-memory-PYND7ZX3.js → search-memory-2W7VJC4Q.js} +1 -1
- package/chunks/{send-message-TMLYTQOI.js → send-message-63YGQP6G.js} +1 -1
- package/chunks/{serve-EBNBRAME.js → serve-F4ML2WNL.js} +1 -1
- package/chunks/{server-63BRDBL5.js → server-S56IB4TT.js} +3 -3
- package/chunks/{session-XB6J4CZD.js → session-2CUVLZ4H.js} +1 -1
- package/chunks/{session-attachments-root-PFK475N2.js → session-attachments-root-FINBX7K5.js} +1 -1
- package/chunks/{session-execution-engine-selector-P6TJTCKR.js → session-execution-engine-selector-UGC7DGUN.js} +1 -1
- package/chunks/{session-pr-refresh-PM7VAQTV.js → session-pr-refresh-KQLQ4MZY.js} +1 -1
- package/chunks/{sessionService-PO3LLZIZ.js → sessionService-Q6N7LF7Z.js} +1 -1
- package/chunks/{settings-JDQSRXP3.js → settings-23I6H76E.js} +1 -1
- package/chunks/{shell-JCEX3HKM.js → shell-IUECEVVY.js} +1 -1
- package/chunks/{skill-JSZBONIZ.js → skill-YKUETMPC.js} +1 -1
- package/chunks/{skill-settings-YGFG6GPN.js → skill-settings-ODYXOPCA.js} +1 -1
- package/chunks/{spawnChannel-VIIWSWTL.js → spawnChannel-7XU2SRWZ.js} +1 -1
- package/chunks/{standalone-update-2UU6FQZL.js → standalone-update-SWI2RL3L.js} +1 -1
- package/chunks/{start-opentui-ui-OSZZNSLY.js → start-opentui-ui-T53QJGCH.js} +1 -1
- package/chunks/{startInteractiveUI-FFH66MYH.js → startInteractiveUI-USTZGQOE.js} +1 -1
- package/chunks/{team-create-TKGDJ3NU.js → team-create-4A2XUE3D.js} +1 -1
- package/chunks/{team-plan-approval-3VJF4G6Z.js → team-plan-approval-4TS5CYN6.js} +1 -1
- package/chunks/{terminal-image-renderer-T3VJRZGP.js → terminal-image-renderer-C7553YV6.js} +1 -1
- package/chunks/{theme-manager-ZGUFLFUI.js → theme-manager-GTW75GOO.js} +1 -1
- package/chunks/{tool-call-3EQS5KSE.js → tool-call-YTUMWL3A.js} +1 -1
- package/chunks/{tool-result-media-7LFNVQ6E.js → tool-result-media-JYOYBX4J.js} +1 -1
- package/chunks/{tool-search-UDZ4S7T5.js → tool-search-Y4XTT2WF.js} +1 -1
- package/chunks/{total-session-admission-U4MII4RA.js → total-session-admission-EMJ5NRGL.js} +1 -1
- package/chunks/{trustedFolders-2NQJCIN3.js → trustedFolders-YG6WAVRE.js} +1 -1
- package/chunks/{update-relaunch-YKLWSCLC.js → update-relaunch-4QYQRCP4.js} +1 -1
- package/chunks/{updateCheck-YDLTQQRU.js → updateCheck-VRFPSX4G.js} +1 -1
- package/chunks/{upload-config-5QQKWF4O.js → upload-config-UCKGUYYQ.js} +1 -1
- package/chunks/{useAutoAcceptIndicator-AJS4WTU2.js → useAutoAcceptIndicator-2VGLKD7B.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-AETOT7ZW.js → validateNonInterActiveAuth-GGMQXKKU.js} +1 -1
- package/chunks/{version-IB6DLRAG.js → version-Y46PG7II.js} +1 -1
- package/chunks/{web-fetch-LS3QARNR.js → web-fetch-7MPU555L.js} +1 -1
- package/chunks/{web-search-FGHRIVEB.js → web-search-HU2CL2X2.js} +1 -1
- package/chunks/{workflow-FX6XNETQ.js → workflow-U3D34QQX.js} +1 -1
- package/chunks/{workflow-ancestor-trust-5XXBGN6F.js → workflow-ancestor-trust-OWC4YTMR.js} +1 -1
- package/chunks/{workspace-agents-UJKLYPUK.js → workspace-agents-KHLAWSAR.js} +1 -1
- package/chunks/{workspace-providers-status-4JOHMTAW.js → workspace-providers-status-T57SE3YX.js} +1 -1
- package/chunks/{workspace-recovery-worker-XFEYQ4TP.js → workspace-recovery-worker-VYQ723ZE.js} +1 -1
- package/chunks/{workspace-registration-store-LWAPVNYC.js → workspace-registration-store-I7PR3A2Y.js} +1 -1
- package/chunks/{workspace-registry-M7OC376O.js → workspace-registry-YYUBXCLH.js} +1 -1
- package/chunks/{workspace-runtime-coordinator-CYHIL47L.js → workspace-runtime-coordinator-5ICAQO7W.js} +1 -1
- package/chunks/{workspace-service-43VZZ56B.js → workspace-service-YROWXOLQ.js} +1 -1
- package/chunks/{workspace-skills-status-V2TT6UJQ.js → workspace-skills-status-DKKQDTZJ.js} +1 -1
- package/chunks/{workspace-trust-reconciler-YZ4AG5ZW.js → workspace-trust-reconciler-3FPMUZDO.js} +1 -1
- package/chunks/{write-file-TGEH5MEZ.js → write-file-7QQVYFDT.js} +1 -1
- package/chunks/{zoom-image-TT6R7H2H.js → zoom-image-WL5EB6Q7.js} +1 -1
- package/cli.js +2 -2
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/package.json +3 -3
- package/web-shell/assets/{PierreFilePreview-OsApm5-S.js → PierreFilePreview-BZ17f56_.js} +1 -1
- package/web-shell/assets/{SpreadsheetPreview-I1v1EzV7.js → SpreadsheetPreview-Bvkvr_5u.js} +1 -1
- package/web-shell/assets/{WorkspaceFileBrowser-BO6aug7i.js → WorkspaceFileBrowser-BJ_I4Uoz.js} +1 -1
- package/web-shell/assets/{abnfDiagram-VCTEODGH-DxuLMyN0.js → abnfDiagram-VCTEODGH-iuaBM15V.js} +1 -1
- package/web-shell/assets/{agents-route-CSJf6QPO.js → agents-route-CycwfNSC.js} +1 -1
- package/web-shell/assets/{arc-3--LekYQ.js → arc-C0lt8n55.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-Dihq4uto.js → architectureDiagram-5GKGNRK7-Bw326d-A.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-BnaRPM2o.js → blockDiagram-NRAW4CY4-CHtFgBjV.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-BtC94eMa.js → c4Diagram-UCG6FXSJ-Bx66oJT9.js} +1 -1
- package/web-shell/assets/channel-CRJuO00u.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-2ZTXWP6M.js → chunk-2Q5K7J3B-BIshvfa_.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-DBh7DP1F.js → chunk-5VM5RSS4-BZeRS6uD.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-xzqbWXBw.js → chunk-F27PBJKO-El-CGY2R.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-DxnCrpxK.js → chunk-G27WJ6UU-DO8ZfQL_.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-BPjRsozm.js → chunk-JWPE2WC7-yYFrrKAj.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-Q2HgB3lf.js → chunk-LCL6LL3I-BFGuOKN0.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-9tlPaKu-.js → chunk-POPQ4Y6H-GRHK6sdV.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DkNdOHCU.js → chunk-SVP7TREG-DwDu6GqZ.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-D0G-Dhfi.js → chunk-XXDRQBXY-RoNDjkIy.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-pPPByLA7.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-pPPByLA7.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-Ck0tHxul.js → cose-bilkent-JH36ORCC-CYNiiONE.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-a4-NTMHi.js → cynefin-OW5HDTMX-DC1_lDIG.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Pg41Zbf2.js → cynefinDiagram-5FMLGOSQ-D2VxKm2n.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-DT_ZmqkF.js → dagre-3AP2YEHR-C4_BHzpM.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-hapdMOl1.js → diagram-S7CK7UJ4-BpAO4-Gv.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-YZ0nbk56.js → diagram-UQ7AKVKN-DqUsFdsX.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-DA_yNbWy.js → diagram-VSXAHHWV-DcMXIYMy.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DoULuCLT.js → diagram-VX7I27RA-I3nr09ex.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-B5c9o9zL.js → diagram-Z3DM3KII-CN-gvsTo.js} +1 -1
- package/web-shell/assets/{docx-preview-BulxdBjs.js → docx-preview-31J6RsS0.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-B5hgIg3m.js → ebnfDiagram-PWID7BFC-DOQvLWlM.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-BEfEPozi.js → erDiagram-SSCWMZ5O-Cb5ijFZh.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-CQHNk92v.js → flowDiagram-A5DVABFB-BecqqjnZ.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BabdVgIM.js → ganttDiagram-EL5Y4UJY-DWY5vzQl.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-ujRZBFUo.js → gitGraphDiagram-WWUBYQGX-DqBnsZmZ.js} +1 -1
- package/web-shell/assets/{index-B9uXebIR.js → index-DDmiUW3b.js} +6 -6
- package/web-shell/assets/{index-DSZXdZnu.js → index-DabH7kHA.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-CUHj9jJC.js → infoDiagram-RXCK75RN-MlotyOdT.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CulW_q81.js → ishikawaDiagram-5VMMS53U-Daq_85C7.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-BR46CvRQ.js → journeyDiagram-EYS64GPL-OipivCxL.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-HAoUqzFy.js → kanban-definition-3QL26DDD-zqaz7dLu.js} +1 -1
- package/web-shell/assets/{layout-DYLl7fyA.js → layout-Bi3msQMQ.js} +1 -1
- package/web-shell/assets/{linear-DPXABjDZ.js → linear-D4gPORvD.js} +1 -1
- package/web-shell/assets/{mermaid.core-Bi30Gi0n.js → mermaid.core-BUnytF7a.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-B1_lUq4o.js → mindmap-definition-FBJOCRG2-B_X4iChu.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-Cy8tjJJC.js → pegDiagram-XKGWAZYB-z4wYBoBW.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-D6waLVVi.js → pieDiagram-E7YTZNPT-Dvyg6FYo.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC--6ehi_FI.js → quadrantDiagram-AXDQQJYC-CJBWU2Dk.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-BhLy40X4.js → railroadDiagram-O6MQD6OU-Dl_An1O0.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BVNXTgNP.js → requirementDiagram-EFPCY7ZU-Tw8FwaYU.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BHgTytxV.js → sankeyDiagram-P5KCCOFB-BCPCkbR0.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CgOsTvhu.js → sequenceDiagram-WJ2MYXX4-DDj7uFTG.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-vCQBQ5FI.js → sizeCapture-X5ZJPWSS-B9eVSpKb.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-DytMYRWJ.js → stateDiagram-HBIQ2CUA-Bf4BZP_V.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BPJi6Gre.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-CTGnifOP.js → swimlanes-XN3QIQJK-dyTWsZFj.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Bw4NRtJQ.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-DEJ1cbn2.js → timeline-definition-24CTP7MA-DVl1A4uL.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-K1e4SjS0.js → vennDiagram-4TSXK5OY-Boosxy9D.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-DEX-GkRp.js → wardleyDiagram-VM6X3IG4-C6wlY8jy.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-B6wYXreH.js → xychartDiagram-S5SC5T6Z-CkzZe3ro.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/web-shell/assets/channel-CLVrtVFX.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-Df2T70oB.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-Df2T70oB.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CcjUJGng.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dt8NvQfX.js +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{buildModelReasoningRoutePreview}from"./chunk-
|
|
3
|
+
import{buildModelReasoningRoutePreview}from"./chunk-BKUFRNME.js";import{snapshotProcessEnv}from"./chunk-DWPCE3QI.js";import{publicAuxModelSelectorValue}from"./chunk-L42NTHIT.js";import{STATUS_SCHEMA_VERSION}from"./chunk-LUDNUVSA.js";import{getModelConfigurationKey}from"./chunk-EVBUXPGM.js";import{loadSettings}from"./chunk-MVGQFFIK.js";import{getAuthTypeFromEnv,resolveCliGenerationConfig}from"./chunk-VOBNHBCJ.js";import{ACP_ROUTE_ID_PREFIX,buildAcpModelOptions,getCurrentAcpModelId,parseAcpBaseModelId,sanitizeProviderBaseUrl}from"./chunk-GT4TCQ3R.js";import{APPROVAL_MODES}from"./chunk-JZK2WGXA.js";import{ModelsConfig,captureReasoningSnapshot,resolveReasoningForModel}from"./chunk-BDQOLT37.js";import{tokenLimit}from"./chunk-HEDN54OB.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var debugLogger=createDebugLogger("WORKSPACE_PROVIDERS_STATUS");function createWorkspaceProvidersStatusProvider(options={}){return async(workspaceCwd,acpChannelLive)=>buildWorkspaceProvidersStatus(workspaceCwd,acpChannelLive,options)}__name(createWorkspaceProvidersStatusProvider,"createWorkspaceProvidersStatusProvider");function buildWorkspaceProvidersStatus(workspaceCwd,acpChannelLive,options){try{const loaded=loadSettings(workspaceCwd,options.env?{skipLoadEnvironment:true,skipWorkspaceSettings:options.workspaceTrusted===false,workspaceTrusted:options.workspaceTrusted}:{consumeCorruptionEnvVars:true,skipLoadEnvironment:options.workspaceTrusted===false,skipWorkspaceSettings:options.workspaceTrusted===false,workspaceTrusted:options.workspaceTrusted});const settings=loaded.merged;const env=options.env??snapshotProcessEnv();const selectedAuthType=settings.security?.auth?.selectedType??getAuthTypeFromEnv(env);const argv={model:options.argv?.model,openaiApiKey:options.argv?.openaiApiKey,openaiBaseUrl:options.argv?.openaiBaseUrl,openaiLogging:options.argv?.openaiLogging,openaiLoggingDir:options.argv?.openaiLoggingDir};const resolvedCliConfig=resolveCliGenerationConfig({argv,settings,selectedAuthType,env});const modelsConfig=new ModelsConfig({initialAuthType:resolvedCliConfig.authType,modelProvidersConfig:settings.modelProviders,providerProtocolConfig:settings.providerProtocol,generationConfig:resolvedCliConfig.generationConfig,generationConfigSources:resolvedCliConfig.sources});const currentAuth=resolvedCliConfig.authType;const currentModelId=(resolvedCliConfig.model||modelsConfig.getModel()||"").trim();const hasCurrentModel=currentModelId.length>0;const modelCameFromSettings=!argv.model&&settings.model?.name?.trim()===currentModelId;const currentBaseUrl=modelCameFromSettings&&settings.model?.baseUrl!==void 0?settings.model.baseUrl||void 0:resolvedCliConfig.sources["baseUrl"]?resolvedCliConfig.baseUrl||void 0:void 0;const currentRegistryBaseUrl=modelCameFromSettings&¤tAuth?settings.model?.baseUrl!==void 0?settings.model.baseUrl||null:modelsConfig.getResolvedModel(currentAuth,currentModelId)?.registryBaseUrl??null:void 0;const models=modelsConfig.getAllConfiguredModels();const modelOptions=buildAcpModelOptions(models);const reasoningSnapshot=captureReasoningSnapshot(models);const currentAcpModelId=hasCurrentModel?getCurrentAcpModelId(modelOptions,currentModelId,currentAuth,currentRegistryBaseUrl):void 0;const fastModelId=typeof settings.fastModel==="string"&&settings.fastModel.length>0?settings.fastModel:void 0;const visionModelId=typeof settings.visionModel==="string"&&settings.visionModel.length>0?settings.visionModel:void 0;const approvalMode=resolveApprovalMode(settings);const providers=new Map;for(const option of modelOptions){const{model,effectiveModelId,modelId}=option;if(model.isRuntimeModel)continue;const authType=String(model.authType);let provider=providers.get(authType);if(!provider){provider={kind:"model_provider",status:"ok",authType,current:false,models:[]};providers.set(authType,provider)}const isCurrent=currentAuth===model.authType&¤tAcpModelId===modelId;const resolved=modelsConfig.getResolvedModel(model.authType,model.id,model.registryBaseUrl);const generation={...resolved?.generationConfig,model:model.id,authType:model.authType,baseUrl:resolved?.baseUrl,reasoningSnapshot,reasoningRouteBaseUrl:model.registryBaseUrl??null};const configOptions=buildModelReasoningRoutePreview(generation,resolveReasoningForModel(void 0,generation),settings.model?.reasoningEffort,modelId.startsWith(ACP_ROUTE_ID_PREFIX));const configurationKey=getModelConfigurationKey(loaded,authType,model.id,model.registryBaseUrl);const providerModel={...configurationKey?{configurationKey}:{},modelId,baseModelId:parseAcpBaseModelId(effectiveModelId),name:model.label,...model.description!==void 0?{description:model.description}:{},contextLimit:model.contextWindowSize!==void 0&&model.contextWindowSize>0?model.contextWindowSize:tokenLimit(effectiveModelId),...model.modalities!==void 0?{modalities:model.modalities}:{},...model.baseUrl!==void 0?{baseUrl:sanitizeProviderBaseUrl(model.baseUrl)}:{},...model.envKey!==void 0?{envKey:model.envKey}:{},isCurrent,isRuntime:false,...configOptions?{configOptions}:{}};provider.models.push(providerModel);if(isCurrent)provider.current=true}const current=buildCurrent(currentAuth,currentAcpModelId,currentBaseUrl,fastModelId,visionModelId);return{v:STATUS_SCHEMA_VERSION,workspaceCwd,initialized:true,acpChannelLive,...current?{current}:{},approvalMode,providers:[...providers.values()],...resolvedCliConfig.warnings.length>0?{errors:resolvedCliConfig.warnings.map(warning=>({kind:"providers",status:"warning",error:sanitizeProviderWarning(warning)}))}:{}}}catch(error){return{v:STATUS_SCHEMA_VERSION,workspaceCwd,initialized:false,acpChannelLive,providers:[],errors:[{kind:"providers",status:"error",error:sanitizeProviderWarning(error instanceof Error?error.message:String(error))}]}}}__name(buildWorkspaceProvidersStatus,"buildWorkspaceProvidersStatus");function resolveApprovalMode(settings){const value=settings.tools?.approvalMode;if(typeof value!=="string")return"auto";const normalized=value.trim().toLowerCase().replaceAll("_","-");const mode=normalized==="autoedit"?"auto-edit":normalized;if(APPROVAL_MODES.includes(mode)){return mode}if(value.trim().length>0){debugLogger.warn(`[workspace-providers-status] unrecognized approvalMode "${value}", falling back to auto`)}return"auto"}__name(resolveApprovalMode,"resolveApprovalMode");var URL_LIKE_PATTERN=/\b[A-Za-z][A-Za-z\d+.-]*:\/\/[^\s'"`<>]+/g;var URL_START_PATTERN=/\b[A-Za-z][A-Za-z\d+.-]*:\/\//g;function sanitizeProviderWarning(warning){let result="";let index=0;let next=findNextUrlStart(warning,index);while(next){result+=warning.slice(index,next.index);const segmentEnd=findUrlSegmentEnd(warning,next.index,next.marker);const segment=warning.slice(next.index,segmentEnd);result+=sanitizeProviderWarningSegment(segment,next.marker.length);index=segmentEnd;next=findNextUrlStart(warning,index)}return result+warning.slice(index)}__name(sanitizeProviderWarning,"sanitizeProviderWarning");function findNextUrlStart(value,from){URL_START_PATTERN.lastIndex=from;const match=URL_START_PATTERN.exec(value);return match?{index:match.index,marker:match[0]}:void 0}__name(findNextUrlStart,"findNextUrlStart");function findUrlSegmentEnd(value,start,marker){const afterMarker=start+marker.length;const carriageReturn=value.indexOf("\r",afterMarker);const lineFeed=value.indexOf("\n",afterMarker);let lineEnd=value.length;if(carriageReturn!==-1)lineEnd=Math.min(lineEnd,carriageReturn);if(lineFeed!==-1)lineEnd=Math.min(lineEnd,lineFeed);const nextUrl=findNextUrlStart(value,afterMarker);return Math.min(lineEnd,nextUrl?.index??value.length)}__name(findUrlSegmentEnd,"findUrlSegmentEnd");function sanitizeProviderWarningSegment(segment,markerLength){const at=segment.indexOf("@",markerLength);if(at!==-1&&hasCredentialPrefix(segment,markerLength,at)&&segment[at+1]!==void 0&&/[A-Za-z0-9.[\]-]/.test(segment[at+1])){return`${segment.slice(0,markerLength)}${segment.slice(at+1)}`}return segment.replace(URL_LIKE_PATTERN,url=>sanitizeProviderBaseUrl(url))}__name(sanitizeProviderWarningSegment,"sanitizeProviderWarningSegment");function hasCredentialPrefix(segment,markerLength,at){const colon=segment.indexOf(":",markerLength);if(colon===-1||colon>at)return false;const username=segment.slice(markerLength,colon);return!/[/?#\s'"`<>]/.test(username)}__name(hasCredentialPrefix,"hasCredentialPrefix");function buildCurrent(authType,modelId,baseUrl,fastModelId,visionModelId){if(!authType&&!modelId&&!baseUrl&&!fastModelId&&!visionModelId)return void 0;return{...authType?{authType:String(authType)}:{},...modelId?{modelId}:{},...baseUrl?{baseUrl:sanitizeProviderBaseUrl(baseUrl)}:{},...fastModelId?{fastModelId:publicAuxModelSelectorValue(fastModelId)}:{},...visionModelId?{visionModelId:publicAuxModelSelectorValue(visionModelId)}:{}}}__name(buildCurrent,"buildCurrent");export{createWorkspaceProvidersStatusProvider};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{DashScopeOpenAICompatibleProvider}from"./chunk-
|
|
3
|
+
import{DashScopeOpenAICompatibleProvider}from"./chunk-FNDMWG43.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var QWEN_OAUTH_PLACEHOLDER_API_KEY="QWEN_OAUTH_DYNAMIC_TOKEN";var ENV_VAR_NAME_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/;var OmniUploadConfigError=class extends Error{static{__name(this,"OmniUploadConfigError")}constructor(message){super(message);this.name="OmniUploadConfigError"}};function normalizeDedicatedOmniUploadConfig(raw,env=process.env){const configured=raw.baseUrl!==void 0||raw.apiKeyEnv!==void 0||raw.model!==void 0;if(!configured)return void 0;const baseUrl=raw.baseUrl?.trim();const apiKeyEnv=raw.apiKeyEnv?.trim();const model=raw.model?.trim();if(!baseUrl||!apiKeyEnv||!model){throw new OmniUploadConfigError("omni.delivery.upload.baseUrl, apiKeyEnv, and model must all be set when a dedicated upload channel is configured.")}if(!ENV_VAR_NAME_PATTERN.test(apiKeyEnv)){throw new OmniUploadConfigError("omni.delivery.upload.apiKeyEnv must be a valid environment variable name.")}if(!DashScopeOpenAICompatibleProvider.isDashScopeProvider({authType:"openai",baseUrl})){throw new OmniUploadConfigError("omni.delivery.upload.baseUrl must be a DashScope-compatible endpoint.")}const apiKey=env[apiKeyEnv]?.trim();if(!apiKey){throw new OmniUploadConfigError(`omni.delivery.upload.apiKeyEnv names ${apiKeyEnv}, but that environment variable is not set or is empty.`)}return{baseUrl,apiKey,model}}__name(normalizeDedicatedOmniUploadConfig,"normalizeDedicatedOmniUploadConfig");function resolveLegacyOmniUploadConfig(contentGeneratorConfig,model){if(!contentGeneratorConfig||contentGeneratorConfig.authType==="qwen-oauth"||!contentGeneratorConfig.apiKey||contentGeneratorConfig.apiKey===QWEN_OAUTH_PLACEHOLDER_API_KEY||!contentGeneratorConfig.baseUrl||!model||!DashScopeOpenAICompatibleProvider.isDashScopeProvider(contentGeneratorConfig)){return void 0}return{baseUrl:contentGeneratorConfig.baseUrl,apiKey:contentGeneratorConfig.apiKey,model}}__name(resolveLegacyOmniUploadConfig,"resolveLegacyOmniUploadConfig");function getEffectiveOmniUploadConfig(config){const dedicated=config.getOmniUploadConfig?.();if(dedicated)return dedicated;return resolveLegacyOmniUploadConfig(config.getContentGeneratorConfig?.(),config.getModel?.())}__name(getEffectiveOmniUploadConfig,"getEffectiveOmniUploadConfig");function requireEffectiveOmniUploadConfig(config){const upload=getEffectiveOmniUploadConfig(config);if(!upload){throw new OmniUploadConfigError("Omni upload is not configured. Set all of omni.delivery.upload.baseUrl, apiKeyEnv, and model, or use a static DashScope inference configuration.")}return upload}__name(requireEffectiveOmniUploadConfig,"requireEffectiveOmniUploadConfig");export{OmniUploadConfigError,normalizeDedicatedOmniUploadConfig,getEffectiveOmniUploadConfig,requireEffectiveOmniUploadConfig};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{loadUndici}from"./chunk-XKSB7VTV.js";import{require_semver}from"./chunk-YZUKMJW7.js";import{updateEventEmitter}from"./chunk-VDUNIK4I.js";import{t}from"./chunk-EZMTX4EU.js";import{So}from"./chunk-LIIMQ4DI.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{createHash}from"node:crypto";import*as fs from"node:fs";import*as os from"node:os";import*as path from"node:path";import{Readable,Transform}from"node:stream";import{spawn,execFile}from"node:child_process";import{pipeline}from"node:stream/promises";var import_semver=__toESM(require_semver(),1);init_esbuild_shims();import{createPublicKey,verify}from"node:crypto";var RELEASE_PUBLIC_KEY_DER_B64="MCowBQYDK2VwAyEAr9WRFLDauibZQKCe1oKfuFZn6zRMaEkD5+KVqN6mKM4=";function verifySignature(sha256sumsContent,signatureBase64){const key=createPublicKey({key:Buffer.from(RELEASE_PUBLIC_KEY_DER_B64,"base64"),format:"der",type:"spki"});const signature=Buffer.from(signatureBase64,"base64");if(signature.length!==64){throw new Error(`Invalid signature length: expected 64 bytes, got ${signature.length}`)}const valid=verify(null,Buffer.from(sha256sumsContent),key,signature);if(!valid){throw new Error("SHA256SUMS signature verification failed \u2014 possible tampering detected")}}__name(verifySignature,"verifySignature");var debugLogger=createDebugLogger("STANDALONE_UPDATE");var OSS_BASE="https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/releases/qwen-code";var GITHUB_BASE="https://github.com/QwenLM/qwen-code/releases/download";var FETCH_TIMEOUT_MS=3e4;var ARCHIVE_TIMEOUT_MS=3e5;var VALID_TARGETS=new Set(["darwin-arm64","darwin-x64","linux-arm64","linux-x64","win-x64"]);var SEMVER_RE=/^v?\d+\.\d+\.\d+(-[\w.]+)?$/;function normalizeVersion(version){if(!SEMVER_RE.test(version)){throw new Error(`Invalid version format: ${version}`)}return version.startsWith("v")?version:`v${version}`}__name(normalizeVersion,"normalizeVersion");function validateTarget(target){if(!VALID_TARGETS.has(target)){throw new Error(`Unknown target: ${target}`)}}__name(validateTarget,"validateTarget");function archiveFilename(target,runtime){const ext=target.startsWith("win")?"zip":"tar.gz";const suffix=runtime==="bun"?"-opentui-preview":"";return`qwen-code-${target}${suffix}.${ext}`}__name(archiveFilename,"archiveFilename");function escapePS(s){return s.replace(/'/g,"''")}__name(escapePS,"escapePS");function resolveUpdateBaseUrl(){const value=process.env["QWEN_UPDATE_BASE_URL"]?.trim();if(!value)return void 0;const invalidUrl=__name(()=>new Error("QWEN_UPDATE_BASE_URL must be an absolute HTTPS URL without credentials, query parameters, or a fragment."),"invalidUrl");let url;try{url=new URL(value)}catch{throw invalidUrl()}if(!/^https:\/\//i.test(value)||url.username||url.password||/[?#\s]/.test(value)){throw invalidUrl()}return url.href.replace(/\/+$/,"")}__name(resolveUpdateBaseUrl,"resolveUpdateBaseUrl");async function tryFetch(url,timeoutMs=FETCH_TIMEOUT_MS){try{const{fetch}=await loadUndici();const res=await fetch(url,{signal:AbortSignal.timeout(timeoutMs)});if(res.ok)return{response:res};await res.body?.cancel().catch(()=>{});return{error:new Error(`HTTP ${res.status} ${res.statusText}`)}}catch(err){const error=err instanceof Error?err:new Error(String(err));debugLogger.debug(`Fetch failed for ${url}: ${error.message}`);return{error}}}__name(tryFetch,"tryFetch");async function downloadWithFallback(versionPath,filename,timeoutMs=FETCH_TIMEOUT_MS,baseUrl){if(baseUrl){const result=await tryFetch(`${baseUrl}/${versionPath}/${filename}`,timeoutMs);if(result.response)return result.response;throw new Error(`Failed to download ${filename} from QWEN_UPDATE_BASE_URL: ${result.error.message}`)}const ossUrl=`${OSS_BASE}/${versionPath}/${filename}`;const ossResult=await tryFetch(ossUrl,timeoutMs);if(ossResult.response)return ossResult.response;const ghUrl=`${GITHUB_BASE}/${versionPath}/${filename}`;const ghResult=await tryFetch(ghUrl,timeoutMs);if(ghResult.response)return ghResult.response;throw new Error(`Failed to download ${filename}: OSS (${ossResult.error?.message??"unknown"}), GitHub (${ghResult.error?.message??"unknown"})`)}__name(downloadWithFallback,"downloadWithFallback");async function verifyChecksum(actualHash,filename,versionPath,baseUrl){const response=await downloadWithFallback(versionPath,"SHA256SUMS",FETCH_TIMEOUT_MS,baseUrl);const text=await response.text();const requireSig=process.env["QWEN_REQUIRE_SIGNATURE"]==="1";let sigResponse;try{sigResponse=await downloadWithFallback(versionPath,"SHA256SUMS.sig",FETCH_TIMEOUT_MS,baseUrl)}catch(err){debugLogger.debug("SHA256SUMS.sig not available:",err)}if(sigResponse){const sigContent=await sigResponse.text();verifySignature(text,sigContent.trim());debugLogger.info("SHA256SUMS signature verified.")}else if(requireSig){throw new Error("SHA256SUMS.sig not found and QWEN_REQUIRE_SIGNATURE=1 is set")}else{debugLogger.warn("SHA256SUMS.sig not available \u2014 update integrity relies on SHA256 checksum only. Set QWEN_REQUIRE_SIGNATURE=1 to enforce signature verification.")}const expectedLine=text.split("\n").find(line=>{const parts=line.trim().split(/\s+/);if(parts.length<2)return false;const name=parts[parts.length-1].replace(/^\*/,"");return name===filename});if(!expectedLine){throw new Error(`No checksum found for ${filename} in SHA256SUMS`)}const expectedHash=expectedLine.trim().split(/\s+/)[0];if(actualHash!==expectedHash){throw new Error(`Checksum mismatch: expected ${expectedHash}, got ${actualHash}`)}}__name(verifyChecksum,"verifyChecksum");var MAX_DOWNLOAD_BYTES=512*1024*1024;async function downloadToFile(versionPath,filename,destPath,baseUrl){const response=await downloadWithFallback(versionPath,filename,ARCHIVE_TIMEOUT_MS,baseUrl);const body=response.body;if(!body)throw new Error("Empty response body");const contentLength=response.headers.get("content-length");if(contentLength&&parseInt(contentLength,10)>MAX_DOWNLOAD_BYTES){await body.cancel().catch(()=>{});throw new Error(`Download too large: ${contentLength} bytes exceeds ${MAX_DOWNLOAD_BYTES} limit`)}const hash=createHash("sha256");let bytesWritten=0;const dest=fs.createWriteStream(destPath);const sizeGuard=new Transform({transform(chunk,_encoding,callback){bytesWritten+=chunk.length;if(bytesWritten>MAX_DOWNLOAD_BYTES){callback(new Error(`Download exceeded ${MAX_DOWNLOAD_BYTES} byte limit`))}else{hash.update(chunk);callback(null,chunk)}}});await pipeline(Readable.fromWeb(body),sizeGuard,dest);return hash.digest("hex")}__name(downloadToFile,"downloadToFile");function isPathInside(base,candidate){const rel=path.relative(base,candidate);return rel===""||!!rel&&rel!==".."&&!rel.startsWith(`..${path.sep}`)&&!path.isAbsolute(rel)}__name(isPathInside,"isPathInside");function normalizeTarEntryPath(entryPath){const parts=entryPath.split(/[\\/]+/).filter(part=>part&&part!==".");if(parts.length===0||parts.includes("..")){return null}return parts.join("/")}__name(normalizeTarEntryPath,"normalizeTarEntryPath");function isSafeTarLinkTarget(entryPath,linkPath,resolvedDest){if(path.posix.isAbsolute(linkPath)||path.win32.isAbsolute(linkPath)){return false}const normalizedEntryPath=normalizeTarEntryPath(entryPath);if(!normalizedEntryPath){return false}const archiveRoot=normalizedEntryPath.split("/")[0];const linkTarget=path.resolve(resolvedDest,path.posix.dirname(normalizedEntryPath),linkPath);return isPathInside(path.join(resolvedDest,archiveRoot),linkTarget)}__name(isSafeTarLinkTarget,"isSafeTarLinkTarget");function getTarEntryType(entry){if("type"in entry)return entry.type;if("isFile"in entry&&entry.isFile())return"File";if("isDirectory"in entry&&entry.isDirectory())return"Directory";if("isSymbolicLink"in entry&&entry.isSymbolicLink()){return"SymbolicLink"}return void 0}__name(getTarEntryType,"getTarEntryType");function isSafeTarEntry(entryPath,entry,resolvedDest){if(!isSafeTarEntryPath(entryPath))return false;const entryType=getTarEntryType(entry);const linkPath="linkpath"in entry?entry.linkpath:void 0;if(entryType!=="File"&&entryType!=="Directory"&&entryType!=="SymbolicLink"){return false}if(entryType==="SymbolicLink"){if(linkPath===void 0)return false;return isSafeTarLinkTarget(entryPath,String(linkPath),resolvedDest)}return true}__name(isSafeTarEntry,"isSafeTarEntry");function isAlreadyExistsError(err){return typeof err==="object"&&err!==null&&"code"in err&&err.code==="EEXIST"}__name(isAlreadyExistsError,"isAlreadyExistsError");function validateExtractedPaths(resolvedDest,options={}){const entries=fs.readdirSync(resolvedDest,{recursive:true,withFileTypes:true});for(const entry of entries){if(options.symlinksOnly&&!entry.isSymbolicLink()){continue}const fullPath=path.join(String(entry.parentPath||entry.path),entry.name);let resolved;try{resolved=fs.realpathSync(fullPath)}catch(err){fs.rmSync(resolvedDest,{recursive:true,force:true});const detail=err instanceof Error?err.message:String(err);throw new Error(`Invalid archive entry: ${entry.name} could not be resolved (${detail})`)}if(!isPathInside(resolvedDest,resolved)){fs.rmSync(resolvedDest,{recursive:true,force:true});throw new Error(`Path traversal detected in archive: ${entry.name} resolves to ${resolved}`)}}}__name(validateExtractedPaths,"validateExtractedPaths");function isSafeTarEntryPath(entryPath){if(entryPath.length===0)return false;if(path.posix.isAbsolute(entryPath)||path.win32.isAbsolute(entryPath)){return false}return normalizeTarEntryPath(entryPath)!==null}__name(isSafeTarEntryPath,"isSafeTarEntryPath");async function extractArchive(archivePath,destDir,target){fs.mkdirSync(destDir,{recursive:true});if(target.startsWith("win")){await new Promise((resolve2,reject)=>{const ps=spawn("powershell.exe",["-NoProfile","-Command",`Expand-Archive -Path '${escapePS(archivePath)}' -DestinationPath '${escapePS(destDir)}' -Force`],{stdio:"ignore"});ps.on("close",code=>code===0?resolve2():reject(new Error(`Expand-Archive exited with code ${code}`)));ps.on("error",reject)});const resolvedDest=fs.realpathSync(destDir);validateExtractedPaths(resolvedDest)}else{const resolvedDest=fs.realpathSync(destDir);await So({file:archivePath,cwd:destDir,preservePaths:false,filter:__name((p,entry)=>isSafeTarEntry(p,entry,resolvedDest),"filter")});validateExtractedPaths(fs.realpathSync(destDir),{symlinksOnly:true})}}__name(extractArchive,"extractArchive");function spawnAndCapture(command,args,timeoutMs,cwd){const env={...process.env};for(const key of Object.keys(env)){if(/^(NODE_OPTIONS|BUN_OPTIONS|CLI_VERSION|QWEN_CODE_RELAUNCH_ARGS)$/i.test(key))delete env[key]}return new Promise((resolve2,reject)=>{let settled=false;const child=execFile(command,args,{env,cwd,timeout:timeoutMs,killSignal:"SIGKILL",maxBuffer:64*1024},(err,out,stderr)=>{if(settled)return;settled=true;if(err&&("killed"in err&&err.killed||"signal"in err&&err.signal)){reject(new Error("Smoke test timed out"));return}if(err){const exitCode="code"in err&&typeof err.code==="number"?err.code:1;resolve2({exitCode,stdout:out||"",stderr:stderr||""});return}resolve2({exitCode:0,stdout:out||"",stderr:stderr||""})});child.on("error",()=>{if(settled)return;settled=true;reject(new Error("Smoke test failed: unable to start new binary"))})})}__name(spawnAndCapture,"spawnAndCapture");async function smokeTest(newInstallDir,target,runtime,expectedVersion){const resolvedInstallDir=path.resolve(newInstallDir);const interpreter=target.startsWith("win")?path.join(resolvedInstallDir,runtime,`${runtime}.exe`):path.join(resolvedInstallDir,runtime,"bin",runtime);const cliBin=path.join(resolvedInstallDir,"lib","cli.js");if(!fs.existsSync(interpreter)){throw new Error(`Smoke test failed: ${runtime} binary not found at ${interpreter}`)}if(!fs.existsSync(cliBin)){throw new Error(`Smoke test failed: CLI entry not found at ${cliBin}`)}const cwd=fs.mkdtempSync(path.join(os.tmpdir(),"qwen-code-smoke-"));try{const identity=await spawnAndCapture(interpreter,["-e",'console.log(JSON.stringify({runtime:process.versions.bun?"bun":"node",platform:process.platform,arch:process.arch}))'],1e4,cwd);let actual;try{actual=JSON.parse(identity.stdout)}catch{throw new Error("Smoke test failed: invalid interpreter identity")}const[platform2,arch2]=target.split("-");if(identity.exitCode!==0||!actual||typeof actual!=="object"||Array.isArray(actual)||Reflect.get(actual,"runtime")!==runtime||Reflect.get(actual,"platform")!==(platform2==="win"?"win32":platform2)||Reflect.get(actual,"arch")!==arch2){throw new Error("Smoke test failed: interpreter identity does not match the expected runtime and target")}const{exitCode,stdout}=await spawnAndCapture(interpreter,[cliBin,"--version"],1e4,cwd);if(exitCode!==0){throw new Error(`Smoke test failed: new binary exited with code ${exitCode}`)}const version=stdout.trim();if(!SEMVER_RE.test(version)){throw new Error("Smoke test failed: unexpected version output")}let versionMatches;try{versionMatches=import_semver.default.eq(version,expectedVersion)}catch{versionMatches=false}if(!versionMatches){throw new Error("Smoke test failed: CLI version does not match the expected version")}const launcher=await spawnAndCapture(interpreter,[path.join(resolvedInstallDir,"lib","cli-entry.js"),"--help"],1e4,cwd);if(launcher.exitCode!==0){throw new Error("Smoke test failed: launcher could not load CLI")}debugLogger.info(`Smoke test passed: ${version}`)}finally{try{fs.rmSync(cwd,{recursive:true,force:true})}catch{debugLogger.warn("Could not remove the smoke test temporary directory")}}}__name(smokeTest,"smokeTest");function pendingSwapError(standaloneDir){return new Error(`A previous update left a pending swap at ${standaloneDir}.new. If no qwen-update.bat process is running, remove the pending swap and .qwen-update.lock, then try again.`)}__name(pendingSwapError,"pendingSwapError");function deferredMarkerError(standaloneDir){return new Error(`A previous update left a deferred-swap marker at ${standaloneDir}.deferred. If no qwen-update.bat process is running, remove the marker, the pending swap at ${standaloneDir}.new, and .qwen-update.lock, then try again.`)}__name(deferredMarkerError,"deferredMarkerError");var PENDING_SWAP_STALE_MS=15*60*1e3;function checkDeferredSwap(standaloneDir){const deferredMarker=`${standaloneDir}.deferred`;let swapProvenDead=false;if(fs.existsSync(deferredMarker)){let marker;try{marker=fs.readFileSync(deferredMarker,"utf-8").trim()}catch{throw deferredMarkerError(standaloneDir)}const batPid=parseInt(marker,10);if(!Number.isSafeInteger(batPid)||batPid<=0||batPid>2147483647){throw deferredMarkerError(standaloneDir)}if(!isProcessProvablyGone(batPid)){let markerStale=false;try{markerStale=Date.now()-fs.statSync(deferredMarker).mtimeMs>PENDING_SWAP_STALE_MS}catch{}if(markerStale){throw new Error(`A previous update left a deferred-swap marker at ${standaloneDir}.deferred. If a qwen-update.bat process is still running, end it first; then remove the marker, the pending swap at ${standaloneDir}.new, and .qwen-update.lock, and try again.`)}throw new Error("A previous update is still being applied. Please wait a moment and try again.")}swapProvenDead=true;try{fs.unlinkSync(deferredMarker)}catch{}}const pendingDir=`${standaloneDir}.new`;if(fs.existsSync(pendingDir)){if(!swapProvenDead){let stale=false;try{stale=Date.now()-fs.statSync(pendingDir).mtimeMs>PENDING_SWAP_STALE_MS}catch{}if(!stale){throw pendingSwapError(standaloneDir)}}try{fs.rmSync(pendingDir,{recursive:true,force:true})}catch(err){const reason=err instanceof Error?err.message:String(err);throw new Error(`A previous update left a pending swap at ${pendingDir} that could not be removed (${reason}). Remove it and .qwen-update.lock, then try again.`)}}}__name(checkDeferredSwap,"checkDeferredSwap");function acquireLock(lockPath,standaloneDir){try{fs.writeFileSync(lockPath,String(process.pid),{flag:"wx"});if(standaloneDir){checkDeferredSwap(standaloneDir)}return true}catch(fastPathErr){if(fastPathErr instanceof Error&&(fastPathErr.message.startsWith("A previous update")||fastPathErr.message.includes("pending swap"))){try{fs.unlinkSync(lockPath)}catch{}throw fastPathErr}let pidStr;try{pidStr=fs.readFileSync(lockPath,"utf-8").trim()}catch{return false}const pid=parseInt(pidStr,10);if(!Number.isNaN(pid)&&isProcessAlive(pid)){return false}if(standaloneDir){checkDeferredSwap(standaloneDir)}try{fs.unlinkSync(lockPath);fs.writeFileSync(lockPath,String(process.pid),{flag:"wx"});return true}catch{return false}}}__name(acquireLock,"acquireLock");function releaseLock(lockPath){try{fs.unlinkSync(lockPath)}catch{}}__name(releaseLock,"releaseLock");function cleanupEmptyStandaloneDir(standaloneDir){const manifestPath=path.join(standaloneDir,"manifest.json");if(fs.existsSync(standaloneDir)&&!fs.existsSync(manifestPath)){fs.rmSync(standaloneDir,{recursive:true,force:true})}}__name(cleanupEmptyStandaloneDir,"cleanupEmptyStandaloneDir");var UNSAFE_SHELL_CHARS=/[\0\n\r]/;var UNSAFE_CMD_CHARS=/[&|<>^%!"`\n\r]/;function assertSafeForSingleQuotedShellPath(p,context){if(UNSAFE_SHELL_CHARS.test(p)){throw new Error(`${context} contains characters unsafe for shell embedding: ${p}`)}}__name(assertSafeForSingleQuotedShellPath,"assertSafeForSingleQuotedShellPath");function shellQuoteForSh(p){return`'${p.replace(/'/g,"'\\''")}'`}__name(shellQuoteForSh,"shellQuoteForSh");function shellQuoteForFish(p){return shellQuoteForSh(p)}__name(shellQuoteForFish,"shellQuoteForFish");function isProcessAlive(pid){try{process.kill(pid,0);return true}catch{return false}}__name(isProcessAlive,"isProcessAlive");function isProcessProvablyGone(pid){try{process.kill(pid,0);return false}catch(err){return err.code==="ESRCH"}}__name(isProcessProvablyGone,"isProcessProvablyGone");function atomicReplace(standaloneDir,newDir,lockPath){const oldDir=`${standaloneDir}.old`;const pendingDir=`${standaloneDir}.new`;if(fs.existsSync(oldDir)){fs.rmSync(oldDir,{recursive:true,force:true})}if(os.platform()==="win32"){if(UNSAFE_CMD_CHARS.test(standaloneDir)||UNSAFE_CMD_CHARS.test(oldDir)||UNSAFE_CMD_CHARS.test(pendingDir)){throw new Error("Installation path contains characters unsafe for deferred update script")}if(fs.existsSync(pendingDir)){fs.rmSync(pendingDir,{recursive:true,force:true})}fs.renameSync(newDir,pendingDir);const lockFile=lockPath;const deferredMarker=`${standaloneDir}.deferred`;const logFile=path.join(path.dirname(standaloneDir),"qwen-update.log");const script=["@echo off","set /a TRIES=0",":wait","set /a TRIES+=1","if %TRIES% GTR 30 goto proceed",`tasklist /FI "PID eq ${process.pid}" 2>nul | find "${process.pid}" >nul && (timeout /t 1 >nul & goto wait)`,...process.env["QWEN_CODE_LAUNCHER_PID"]?.match(/^\d+$/)?["set /a LAUNCHER_TRIES=0",":wait_launcher","set /a LAUNCHER_TRIES+=1","if %LAUNCHER_TRIES% GTR 30 goto proceed",`tasklist /FI "PID eq ${process.env["QWEN_CODE_LAUNCHER_PID"]}" 2>nul | find "${process.env["QWEN_CODE_LAUNCHER_PID"]}" >nul && (timeout /t 1 >nul & goto wait_launcher)`]:[],":proceed",`echo [%DATE% %TIME%] starting swap >> "${logFile}"`,`move /Y "${standaloneDir}" "${oldDir}"`,"if errorlevel 1 goto move1_failed",`move /Y "${pendingDir}" "${standaloneDir}"`,"if errorlevel 1 goto move2_failed",`echo [%DATE% %TIME%] swap completed >> "${logFile}"`,"goto cleanup",":move1_failed",`echo [%DATE% %TIME%] ERROR: failed to rename install to .old (errorlevel %errorlevel%) >> "${logFile}"`,"goto cleanup",":move2_failed",`echo [%DATE% %TIME%] ERROR: failed to promote .new; rolling back >> "${logFile}"`,`move /Y "${oldDir}" "${standaloneDir}"`,"if errorlevel 1 (",` echo [%DATE% %TIME%] CRITICAL: rollback also failed; manual recovery: move "${oldDir}" "${standaloneDir}" >> "${logFile}"`,") else (",` echo [%DATE% %TIME%] rollback succeeded >> "${logFile}"`,")",":cleanup",`del /F /Q "${deferredMarker}" 2>nul`,`del /F /Q "${lockFile}" 2>nul`,`del "%~f0"`].join("\r\n");const scriptPath=path.join(path.dirname(standaloneDir),"qwen-update.bat");fs.writeFileSync(scriptPath,script);const child=spawn("cmd.exe",["/c",scriptPath],{detached:true,stdio:"ignore",windowsHide:true});child.on("error",err=>{debugLogger.warn("Deferred bat script failed to spawn:",err)});child.unref();if(!child.pid){throw new Error("Failed to spawn deferred update script. Update was not applied.")}fs.writeFileSync(deferredMarker,String(child.pid));return"deferred"}else{fs.renameSync(standaloneDir,oldDir);try{fs.renameSync(newDir,standaloneDir)}catch(promoteErr){try{fs.renameSync(oldDir,standaloneDir)}catch(rollbackErr){const detail=`Standalone update failed AND rollback failed.
|
|
3
|
+
import{loadUndici}from"./chunk-XKSB7VTV.js";import{require_semver}from"./chunk-YZUKMJW7.js";import{updateEventEmitter}from"./chunk-VDUNIK4I.js";import{t}from"./chunk-EZMTX4EU.js";import{So}from"./chunk-LZNBHBAJ.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{createHash}from"node:crypto";import*as fs from"node:fs";import*as os from"node:os";import*as path from"node:path";import{Readable,Transform}from"node:stream";import{spawn,execFile}from"node:child_process";import{pipeline}from"node:stream/promises";var import_semver=__toESM(require_semver(),1);init_esbuild_shims();import{createPublicKey,verify}from"node:crypto";var RELEASE_PUBLIC_KEY_DER_B64="MCowBQYDK2VwAyEAr9WRFLDauibZQKCe1oKfuFZn6zRMaEkD5+KVqN6mKM4=";function verifySignature(sha256sumsContent,signatureBase64){const key=createPublicKey({key:Buffer.from(RELEASE_PUBLIC_KEY_DER_B64,"base64"),format:"der",type:"spki"});const signature=Buffer.from(signatureBase64,"base64");if(signature.length!==64){throw new Error(`Invalid signature length: expected 64 bytes, got ${signature.length}`)}const valid=verify(null,Buffer.from(sha256sumsContent),key,signature);if(!valid){throw new Error("SHA256SUMS signature verification failed \u2014 possible tampering detected")}}__name(verifySignature,"verifySignature");var debugLogger=createDebugLogger("STANDALONE_UPDATE");var OSS_BASE="https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/releases/qwen-code";var GITHUB_BASE="https://github.com/QwenLM/qwen-code/releases/download";var FETCH_TIMEOUT_MS=3e4;var ARCHIVE_TIMEOUT_MS=3e5;var VALID_TARGETS=new Set(["darwin-arm64","darwin-x64","linux-arm64","linux-x64","win-x64"]);var SEMVER_RE=/^v?\d+\.\d+\.\d+(-[\w.]+)?$/;function normalizeVersion(version){if(!SEMVER_RE.test(version)){throw new Error(`Invalid version format: ${version}`)}return version.startsWith("v")?version:`v${version}`}__name(normalizeVersion,"normalizeVersion");function validateTarget(target){if(!VALID_TARGETS.has(target)){throw new Error(`Unknown target: ${target}`)}}__name(validateTarget,"validateTarget");function archiveFilename(target,runtime){const ext=target.startsWith("win")?"zip":"tar.gz";const suffix=runtime==="bun"?"-opentui-preview":"";return`qwen-code-${target}${suffix}.${ext}`}__name(archiveFilename,"archiveFilename");function escapePS(s){return s.replace(/'/g,"''")}__name(escapePS,"escapePS");function resolveUpdateBaseUrl(){const value=process.env["QWEN_UPDATE_BASE_URL"]?.trim();if(!value)return void 0;const invalidUrl=__name(()=>new Error("QWEN_UPDATE_BASE_URL must be an absolute HTTPS URL without credentials, query parameters, or a fragment."),"invalidUrl");let url;try{url=new URL(value)}catch{throw invalidUrl()}if(!/^https:\/\//i.test(value)||url.username||url.password||/[?#\s]/.test(value)){throw invalidUrl()}return url.href.replace(/\/+$/,"")}__name(resolveUpdateBaseUrl,"resolveUpdateBaseUrl");async function tryFetch(url,timeoutMs=FETCH_TIMEOUT_MS){try{const{fetch}=await loadUndici();const res=await fetch(url,{signal:AbortSignal.timeout(timeoutMs)});if(res.ok)return{response:res};await res.body?.cancel().catch(()=>{});return{error:new Error(`HTTP ${res.status} ${res.statusText}`)}}catch(err){const error=err instanceof Error?err:new Error(String(err));debugLogger.debug(`Fetch failed for ${url}: ${error.message}`);return{error}}}__name(tryFetch,"tryFetch");async function downloadWithFallback(versionPath,filename,timeoutMs=FETCH_TIMEOUT_MS,baseUrl){if(baseUrl){const result=await tryFetch(`${baseUrl}/${versionPath}/${filename}`,timeoutMs);if(result.response)return result.response;throw new Error(`Failed to download ${filename} from QWEN_UPDATE_BASE_URL: ${result.error.message}`)}const ossUrl=`${OSS_BASE}/${versionPath}/${filename}`;const ossResult=await tryFetch(ossUrl,timeoutMs);if(ossResult.response)return ossResult.response;const ghUrl=`${GITHUB_BASE}/${versionPath}/${filename}`;const ghResult=await tryFetch(ghUrl,timeoutMs);if(ghResult.response)return ghResult.response;throw new Error(`Failed to download ${filename}: OSS (${ossResult.error?.message??"unknown"}), GitHub (${ghResult.error?.message??"unknown"})`)}__name(downloadWithFallback,"downloadWithFallback");async function verifyChecksum(actualHash,filename,versionPath,baseUrl){const response=await downloadWithFallback(versionPath,"SHA256SUMS",FETCH_TIMEOUT_MS,baseUrl);const text=await response.text();const requireSig=process.env["QWEN_REQUIRE_SIGNATURE"]==="1";let sigResponse;try{sigResponse=await downloadWithFallback(versionPath,"SHA256SUMS.sig",FETCH_TIMEOUT_MS,baseUrl)}catch(err){debugLogger.debug("SHA256SUMS.sig not available:",err)}if(sigResponse){const sigContent=await sigResponse.text();verifySignature(text,sigContent.trim());debugLogger.info("SHA256SUMS signature verified.")}else if(requireSig){throw new Error("SHA256SUMS.sig not found and QWEN_REQUIRE_SIGNATURE=1 is set")}else{debugLogger.warn("SHA256SUMS.sig not available \u2014 update integrity relies on SHA256 checksum only. Set QWEN_REQUIRE_SIGNATURE=1 to enforce signature verification.")}const expectedLine=text.split("\n").find(line=>{const parts=line.trim().split(/\s+/);if(parts.length<2)return false;const name=parts[parts.length-1].replace(/^\*/,"");return name===filename});if(!expectedLine){throw new Error(`No checksum found for ${filename} in SHA256SUMS`)}const expectedHash=expectedLine.trim().split(/\s+/)[0];if(actualHash!==expectedHash){throw new Error(`Checksum mismatch: expected ${expectedHash}, got ${actualHash}`)}}__name(verifyChecksum,"verifyChecksum");var MAX_DOWNLOAD_BYTES=512*1024*1024;async function downloadToFile(versionPath,filename,destPath,baseUrl){const response=await downloadWithFallback(versionPath,filename,ARCHIVE_TIMEOUT_MS,baseUrl);const body=response.body;if(!body)throw new Error("Empty response body");const contentLength=response.headers.get("content-length");if(contentLength&&parseInt(contentLength,10)>MAX_DOWNLOAD_BYTES){await body.cancel().catch(()=>{});throw new Error(`Download too large: ${contentLength} bytes exceeds ${MAX_DOWNLOAD_BYTES} limit`)}const hash=createHash("sha256");let bytesWritten=0;const dest=fs.createWriteStream(destPath);const sizeGuard=new Transform({transform(chunk,_encoding,callback){bytesWritten+=chunk.length;if(bytesWritten>MAX_DOWNLOAD_BYTES){callback(new Error(`Download exceeded ${MAX_DOWNLOAD_BYTES} byte limit`))}else{hash.update(chunk);callback(null,chunk)}}});await pipeline(Readable.fromWeb(body),sizeGuard,dest);return hash.digest("hex")}__name(downloadToFile,"downloadToFile");function isPathInside(base,candidate){const rel=path.relative(base,candidate);return rel===""||!!rel&&rel!==".."&&!rel.startsWith(`..${path.sep}`)&&!path.isAbsolute(rel)}__name(isPathInside,"isPathInside");function normalizeTarEntryPath(entryPath){const parts=entryPath.split(/[\\/]+/).filter(part=>part&&part!==".");if(parts.length===0||parts.includes("..")){return null}return parts.join("/")}__name(normalizeTarEntryPath,"normalizeTarEntryPath");function isSafeTarLinkTarget(entryPath,linkPath,resolvedDest){if(path.posix.isAbsolute(linkPath)||path.win32.isAbsolute(linkPath)){return false}const normalizedEntryPath=normalizeTarEntryPath(entryPath);if(!normalizedEntryPath){return false}const archiveRoot=normalizedEntryPath.split("/")[0];const linkTarget=path.resolve(resolvedDest,path.posix.dirname(normalizedEntryPath),linkPath);return isPathInside(path.join(resolvedDest,archiveRoot),linkTarget)}__name(isSafeTarLinkTarget,"isSafeTarLinkTarget");function getTarEntryType(entry){if("type"in entry)return entry.type;if("isFile"in entry&&entry.isFile())return"File";if("isDirectory"in entry&&entry.isDirectory())return"Directory";if("isSymbolicLink"in entry&&entry.isSymbolicLink()){return"SymbolicLink"}return void 0}__name(getTarEntryType,"getTarEntryType");function isSafeTarEntry(entryPath,entry,resolvedDest){if(!isSafeTarEntryPath(entryPath))return false;const entryType=getTarEntryType(entry);const linkPath="linkpath"in entry?entry.linkpath:void 0;if(entryType!=="File"&&entryType!=="Directory"&&entryType!=="SymbolicLink"){return false}if(entryType==="SymbolicLink"){if(linkPath===void 0)return false;return isSafeTarLinkTarget(entryPath,String(linkPath),resolvedDest)}return true}__name(isSafeTarEntry,"isSafeTarEntry");function isAlreadyExistsError(err){return typeof err==="object"&&err!==null&&"code"in err&&err.code==="EEXIST"}__name(isAlreadyExistsError,"isAlreadyExistsError");function validateExtractedPaths(resolvedDest,options={}){const entries=fs.readdirSync(resolvedDest,{recursive:true,withFileTypes:true});for(const entry of entries){if(options.symlinksOnly&&!entry.isSymbolicLink()){continue}const fullPath=path.join(String(entry.parentPath||entry.path),entry.name);let resolved;try{resolved=fs.realpathSync(fullPath)}catch(err){fs.rmSync(resolvedDest,{recursive:true,force:true});const detail=err instanceof Error?err.message:String(err);throw new Error(`Invalid archive entry: ${entry.name} could not be resolved (${detail})`)}if(!isPathInside(resolvedDest,resolved)){fs.rmSync(resolvedDest,{recursive:true,force:true});throw new Error(`Path traversal detected in archive: ${entry.name} resolves to ${resolved}`)}}}__name(validateExtractedPaths,"validateExtractedPaths");function isSafeTarEntryPath(entryPath){if(entryPath.length===0)return false;if(path.posix.isAbsolute(entryPath)||path.win32.isAbsolute(entryPath)){return false}return normalizeTarEntryPath(entryPath)!==null}__name(isSafeTarEntryPath,"isSafeTarEntryPath");async function extractArchive(archivePath,destDir,target){fs.mkdirSync(destDir,{recursive:true});if(target.startsWith("win")){await new Promise((resolve2,reject)=>{const ps=spawn("powershell.exe",["-NoProfile","-Command",`Expand-Archive -Path '${escapePS(archivePath)}' -DestinationPath '${escapePS(destDir)}' -Force`],{stdio:"ignore"});ps.on("close",code=>code===0?resolve2():reject(new Error(`Expand-Archive exited with code ${code}`)));ps.on("error",reject)});const resolvedDest=fs.realpathSync(destDir);validateExtractedPaths(resolvedDest)}else{const resolvedDest=fs.realpathSync(destDir);await So({file:archivePath,cwd:destDir,preservePaths:false,filter:__name((p,entry)=>isSafeTarEntry(p,entry,resolvedDest),"filter")});validateExtractedPaths(fs.realpathSync(destDir),{symlinksOnly:true})}}__name(extractArchive,"extractArchive");function spawnAndCapture(command,args,timeoutMs,cwd){const env={...process.env};for(const key of Object.keys(env)){if(/^(NODE_OPTIONS|BUN_OPTIONS|CLI_VERSION|QWEN_CODE_RELAUNCH_ARGS)$/i.test(key))delete env[key]}return new Promise((resolve2,reject)=>{let settled=false;const child=execFile(command,args,{env,cwd,timeout:timeoutMs,killSignal:"SIGKILL",maxBuffer:64*1024},(err,out,stderr)=>{if(settled)return;settled=true;if(err&&("killed"in err&&err.killed||"signal"in err&&err.signal)){reject(new Error("Smoke test timed out"));return}if(err){const exitCode="code"in err&&typeof err.code==="number"?err.code:1;resolve2({exitCode,stdout:out||"",stderr:stderr||""});return}resolve2({exitCode:0,stdout:out||"",stderr:stderr||""})});child.on("error",()=>{if(settled)return;settled=true;reject(new Error("Smoke test failed: unable to start new binary"))})})}__name(spawnAndCapture,"spawnAndCapture");async function smokeTest(newInstallDir,target,runtime,expectedVersion){const resolvedInstallDir=path.resolve(newInstallDir);const interpreter=target.startsWith("win")?path.join(resolvedInstallDir,runtime,`${runtime}.exe`):path.join(resolvedInstallDir,runtime,"bin",runtime);const cliBin=path.join(resolvedInstallDir,"lib","cli.js");if(!fs.existsSync(interpreter)){throw new Error(`Smoke test failed: ${runtime} binary not found at ${interpreter}`)}if(!fs.existsSync(cliBin)){throw new Error(`Smoke test failed: CLI entry not found at ${cliBin}`)}const cwd=fs.mkdtempSync(path.join(os.tmpdir(),"qwen-code-smoke-"));try{const identity=await spawnAndCapture(interpreter,["-e",'console.log(JSON.stringify({runtime:process.versions.bun?"bun":"node",platform:process.platform,arch:process.arch}))'],1e4,cwd);let actual;try{actual=JSON.parse(identity.stdout)}catch{throw new Error("Smoke test failed: invalid interpreter identity")}const[platform2,arch2]=target.split("-");if(identity.exitCode!==0||!actual||typeof actual!=="object"||Array.isArray(actual)||Reflect.get(actual,"runtime")!==runtime||Reflect.get(actual,"platform")!==(platform2==="win"?"win32":platform2)||Reflect.get(actual,"arch")!==arch2){throw new Error("Smoke test failed: interpreter identity does not match the expected runtime and target")}const{exitCode,stdout}=await spawnAndCapture(interpreter,[cliBin,"--version"],1e4,cwd);if(exitCode!==0){throw new Error(`Smoke test failed: new binary exited with code ${exitCode}`)}const version=stdout.trim();if(!SEMVER_RE.test(version)){throw new Error("Smoke test failed: unexpected version output")}let versionMatches;try{versionMatches=import_semver.default.eq(version,expectedVersion)}catch{versionMatches=false}if(!versionMatches){throw new Error("Smoke test failed: CLI version does not match the expected version")}const launcher=await spawnAndCapture(interpreter,[path.join(resolvedInstallDir,"lib","cli-entry.js"),"--help"],1e4,cwd);if(launcher.exitCode!==0){throw new Error("Smoke test failed: launcher could not load CLI")}debugLogger.info(`Smoke test passed: ${version}`)}finally{try{fs.rmSync(cwd,{recursive:true,force:true})}catch{debugLogger.warn("Could not remove the smoke test temporary directory")}}}__name(smokeTest,"smokeTest");function pendingSwapError(standaloneDir){return new Error(`A previous update left a pending swap at ${standaloneDir}.new. If no qwen-update.bat process is running, remove the pending swap and .qwen-update.lock, then try again.`)}__name(pendingSwapError,"pendingSwapError");function deferredMarkerError(standaloneDir){return new Error(`A previous update left a deferred-swap marker at ${standaloneDir}.deferred. If no qwen-update.bat process is running, remove the marker, the pending swap at ${standaloneDir}.new, and .qwen-update.lock, then try again.`)}__name(deferredMarkerError,"deferredMarkerError");var PENDING_SWAP_STALE_MS=15*60*1e3;function checkDeferredSwap(standaloneDir){const deferredMarker=`${standaloneDir}.deferred`;let swapProvenDead=false;if(fs.existsSync(deferredMarker)){let marker;try{marker=fs.readFileSync(deferredMarker,"utf-8").trim()}catch{throw deferredMarkerError(standaloneDir)}const batPid=parseInt(marker,10);if(!Number.isSafeInteger(batPid)||batPid<=0||batPid>2147483647){throw deferredMarkerError(standaloneDir)}if(!isProcessProvablyGone(batPid)){let markerStale=false;try{markerStale=Date.now()-fs.statSync(deferredMarker).mtimeMs>PENDING_SWAP_STALE_MS}catch{}if(markerStale){throw new Error(`A previous update left a deferred-swap marker at ${standaloneDir}.deferred. If a qwen-update.bat process is still running, end it first; then remove the marker, the pending swap at ${standaloneDir}.new, and .qwen-update.lock, and try again.`)}throw new Error("A previous update is still being applied. Please wait a moment and try again.")}swapProvenDead=true;try{fs.unlinkSync(deferredMarker)}catch{}}const pendingDir=`${standaloneDir}.new`;if(fs.existsSync(pendingDir)){if(!swapProvenDead){let stale=false;try{stale=Date.now()-fs.statSync(pendingDir).mtimeMs>PENDING_SWAP_STALE_MS}catch{}if(!stale){throw pendingSwapError(standaloneDir)}}try{fs.rmSync(pendingDir,{recursive:true,force:true})}catch(err){const reason=err instanceof Error?err.message:String(err);throw new Error(`A previous update left a pending swap at ${pendingDir} that could not be removed (${reason}). Remove it and .qwen-update.lock, then try again.`)}}}__name(checkDeferredSwap,"checkDeferredSwap");function acquireLock(lockPath,standaloneDir){try{fs.writeFileSync(lockPath,String(process.pid),{flag:"wx"});if(standaloneDir){checkDeferredSwap(standaloneDir)}return true}catch(fastPathErr){if(fastPathErr instanceof Error&&(fastPathErr.message.startsWith("A previous update")||fastPathErr.message.includes("pending swap"))){try{fs.unlinkSync(lockPath)}catch{}throw fastPathErr}let pidStr;try{pidStr=fs.readFileSync(lockPath,"utf-8").trim()}catch{return false}const pid=parseInt(pidStr,10);if(!Number.isNaN(pid)&&isProcessAlive(pid)){return false}if(standaloneDir){checkDeferredSwap(standaloneDir)}try{fs.unlinkSync(lockPath);fs.writeFileSync(lockPath,String(process.pid),{flag:"wx"});return true}catch{return false}}}__name(acquireLock,"acquireLock");function releaseLock(lockPath){try{fs.unlinkSync(lockPath)}catch{}}__name(releaseLock,"releaseLock");function cleanupEmptyStandaloneDir(standaloneDir){const manifestPath=path.join(standaloneDir,"manifest.json");if(fs.existsSync(standaloneDir)&&!fs.existsSync(manifestPath)){fs.rmSync(standaloneDir,{recursive:true,force:true})}}__name(cleanupEmptyStandaloneDir,"cleanupEmptyStandaloneDir");var UNSAFE_SHELL_CHARS=/[\0\n\r]/;var UNSAFE_CMD_CHARS=/[&|<>^%!"`\n\r]/;function assertSafeForSingleQuotedShellPath(p,context){if(UNSAFE_SHELL_CHARS.test(p)){throw new Error(`${context} contains characters unsafe for shell embedding: ${p}`)}}__name(assertSafeForSingleQuotedShellPath,"assertSafeForSingleQuotedShellPath");function shellQuoteForSh(p){return`'${p.replace(/'/g,"'\\''")}'`}__name(shellQuoteForSh,"shellQuoteForSh");function shellQuoteForFish(p){return shellQuoteForSh(p)}__name(shellQuoteForFish,"shellQuoteForFish");function isProcessAlive(pid){try{process.kill(pid,0);return true}catch{return false}}__name(isProcessAlive,"isProcessAlive");function isProcessProvablyGone(pid){try{process.kill(pid,0);return false}catch(err){return err.code==="ESRCH"}}__name(isProcessProvablyGone,"isProcessProvablyGone");function atomicReplace(standaloneDir,newDir,lockPath){const oldDir=`${standaloneDir}.old`;const pendingDir=`${standaloneDir}.new`;if(fs.existsSync(oldDir)){fs.rmSync(oldDir,{recursive:true,force:true})}if(os.platform()==="win32"){if(UNSAFE_CMD_CHARS.test(standaloneDir)||UNSAFE_CMD_CHARS.test(oldDir)||UNSAFE_CMD_CHARS.test(pendingDir)){throw new Error("Installation path contains characters unsafe for deferred update script")}if(fs.existsSync(pendingDir)){fs.rmSync(pendingDir,{recursive:true,force:true})}fs.renameSync(newDir,pendingDir);const lockFile=lockPath;const deferredMarker=`${standaloneDir}.deferred`;const logFile=path.join(path.dirname(standaloneDir),"qwen-update.log");const script=["@echo off","set /a TRIES=0",":wait","set /a TRIES+=1","if %TRIES% GTR 30 goto proceed",`tasklist /FI "PID eq ${process.pid}" 2>nul | find "${process.pid}" >nul && (timeout /t 1 >nul & goto wait)`,...process.env["QWEN_CODE_LAUNCHER_PID"]?.match(/^\d+$/)?["set /a LAUNCHER_TRIES=0",":wait_launcher","set /a LAUNCHER_TRIES+=1","if %LAUNCHER_TRIES% GTR 30 goto proceed",`tasklist /FI "PID eq ${process.env["QWEN_CODE_LAUNCHER_PID"]}" 2>nul | find "${process.env["QWEN_CODE_LAUNCHER_PID"]}" >nul && (timeout /t 1 >nul & goto wait_launcher)`]:[],":proceed",`echo [%DATE% %TIME%] starting swap >> "${logFile}"`,`move /Y "${standaloneDir}" "${oldDir}"`,"if errorlevel 1 goto move1_failed",`move /Y "${pendingDir}" "${standaloneDir}"`,"if errorlevel 1 goto move2_failed",`echo [%DATE% %TIME%] swap completed >> "${logFile}"`,"goto cleanup",":move1_failed",`echo [%DATE% %TIME%] ERROR: failed to rename install to .old (errorlevel %errorlevel%) >> "${logFile}"`,"goto cleanup",":move2_failed",`echo [%DATE% %TIME%] ERROR: failed to promote .new; rolling back >> "${logFile}"`,`move /Y "${oldDir}" "${standaloneDir}"`,"if errorlevel 1 (",` echo [%DATE% %TIME%] CRITICAL: rollback also failed; manual recovery: move "${oldDir}" "${standaloneDir}" >> "${logFile}"`,") else (",` echo [%DATE% %TIME%] rollback succeeded >> "${logFile}"`,")",":cleanup",`del /F /Q "${deferredMarker}" 2>nul`,`del /F /Q "${lockFile}" 2>nul`,`del "%~f0"`].join("\r\n");const scriptPath=path.join(path.dirname(standaloneDir),"qwen-update.bat");fs.writeFileSync(scriptPath,script);const child=spawn("cmd.exe",["/c",scriptPath],{detached:true,stdio:"ignore",windowsHide:true});child.on("error",err=>{debugLogger.warn("Deferred bat script failed to spawn:",err)});child.unref();if(!child.pid){throw new Error("Failed to spawn deferred update script. Update was not applied.")}fs.writeFileSync(deferredMarker,String(child.pid));return"deferred"}else{fs.renameSync(standaloneDir,oldDir);try{fs.renameSync(newDir,standaloneDir)}catch(promoteErr){try{fs.renameSync(oldDir,standaloneDir)}catch(rollbackErr){const detail=`Standalone update failed AND rollback failed.
|
|
4
4
|
Original error: ${promoteErr.message}
|
|
5
5
|
Rollback error: ${rollbackErr.message}
|
|
6
6
|
Manual recovery: mv "${oldDir}" "${standaloneDir}"`;throw new Error(detail)}throw promoteErr}return"done"}}__name(atomicReplace,"atomicReplace");function ensureBinWrapper(standaloneDir,target){const binDir=path.join(path.dirname(standaloneDir),"..","bin");const artifacts={wrapperCreated:false};try{fs.mkdirSync(binDir,{recursive:true});if(target.startsWith("win")){if(UNSAFE_CMD_CHARS.test(standaloneDir)){throw new Error("standaloneDir contains characters unsafe for cmd.exe wrapper")}const wrapperPath=path.join(binDir,"qwen.cmd");artifacts.wrapperPath=wrapperPath;const content=`@echo off\r
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
3
|
import{DEFAULT_QWEN_MODEL}from"./chunk-4ZBZL23U.js";import{preloadRuntimeFetchModule}from"./chunk-ZZZAYAJW.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();function getDefaultApiKeyEnvVar(authType){switch(authType){case"openai":case"openai-responses":return"OPENAI_API_KEY";case"anthropic":return"ANTHROPIC_API_KEY";case"gemini":return"GEMINI_API_KEY";case"vertex-ai":return"GOOGLE_API_KEY";default:return"API_KEY"}}__name(getDefaultApiKeyEnvVar,"getDefaultApiKeyEnvVar");function getDefaultModelEnvVar(authType){switch(authType){case"openai":case"openai-responses":return"OPENAI_MODEL";case"anthropic":return"ANTHROPIC_MODEL";case"gemini":return"GEMINI_MODEL";case"vertex-ai":return"GOOGLE_MODEL";default:return"MODEL"}}__name(getDefaultModelEnvVar,"getDefaultModelEnvVar");var VERTEX_ADC_HINT=" Alternatively, set GOOGLE_CLOUD_PROJECT to authenticate with Application Default Credentials instead of an API key.";function adcHint(authType,explicitEnvKey){return authType==="vertex-ai"&&!explicitEnvKey?VERTEX_ADC_HINT:""}__name(adcHint,"adcHint");var ModelConfigError=class extends Error{static{__name(this,"ModelConfigError")}constructor(message){super(message);this.name=new.target.name;Object.setPrototypeOf(this,new.target.prototype)}};var StrictMissingCredentialsError=class extends ModelConfigError{static{__name(this,"StrictMissingCredentialsError")}code="STRICT_MISSING_CREDENTIALS";constructor(authType,model,envKey){const providerKey=authType||"(unknown)";const modelName=model||"(unknown)";super(`Missing credentials for modelProviders model '${modelName}'. `+(envKey?`Current configured envKey: '${envKey}'. Set that environment variable, or update modelProviders.${providerKey}[].envKey.`:`Configure modelProviders.${providerKey}[].envKey and set that environment variable.`)+adcHint(authType,envKey))}};var StrictMissingModelIdError=class extends ModelConfigError{static{__name(this,"StrictMissingModelIdError")}code="STRICT_MISSING_MODEL_ID";constructor(authType){super(`Missing model id for strict modelProviders resolution (authType: ${authType}).`)}};var MissingApiKeyError=class extends ModelConfigError{static{__name(this,"MissingApiKeyError")}code="MISSING_API_KEY";constructor(params){super(`Missing API key for ${params.authType} auth. Current model: '${params.model||"(unknown)"}', baseUrl: '${params.baseUrl||"(default)"}'. Provide an API key via settings (security.auth.apiKey), or set the environment variable '${params.envKey}'.`+adcHint(params.authType,params.explicitEnvKey))}};var MissingModelError=class extends ModelConfigError{static{__name(this,"MissingModelError")}code="MISSING_MODEL";constructor(params){super(`Missing model for ${params.authType} auth. Set the environment variable '${params.envKey}'.`)}};var MissingBaseUrlError=class extends ModelConfigError{static{__name(this,"MissingBaseUrlError")}code="MISSING_BASE_URL";constructor(params){super(`Missing baseUrl for modelProviders model '${params.model||"(unknown)"}'. Configure modelProviders.${params.authType||"(unknown)"}[].baseUrl.`)}};var MissingAnthropicBaseUrlEnvError=class extends ModelConfigError{static{__name(this,"MissingAnthropicBaseUrlEnvError")}code="MISSING_ANTHROPIC_BASE_URL_ENV";constructor(){super("ANTHROPIC_BASE_URL environment variable not found.")}};init_esbuild_shims();var DEFAULT_QWEN_EMBEDDING_MODEL="text-embedding-v4";var MAINLINE_CODER_MODEL="qwen3.7-max";init_esbuild_shims();var MODEL_GENERATION_CONFIG_FIELDS=["samplingParams","timeout","streamIdleTimeoutMs","maxRetries","retryInitialDelayMs","retryMaxDelayMs","retryErrorCodes","enableCacheControl","enableRequestMetadata","forceGlobalCacheScope","cacheRetention","cacheRetentionByBlock","schemaCompliance","reasoning","contextWindowSize","customHeaders","extra_body","thinkingMandatory","modalities","splitToolMedia","toolResultContentFormat"];var CREDENTIAL_FIELDS=["model","apiKey","apiKeyEnvKey","baseUrl"];var PROVIDER_SOURCED_FIELDS=[...CREDENTIAL_FIELDS,...MODEL_GENERATION_CONFIG_FIELDS];var AUTH_ENV_MAPPINGS={openai:{apiKey:["OPENAI_API_KEY"],baseUrl:["OPENAI_BASE_URL"],model:["OPENAI_MODEL","QWEN_MODEL"]},"openai-responses":{apiKey:["OPENAI_API_KEY"],baseUrl:["OPENAI_BASE_URL"],model:["OPENAI_MODEL"]},anthropic:{apiKey:["ANTHROPIC_API_KEY"],baseUrl:["ANTHROPIC_BASE_URL"],model:["ANTHROPIC_MODEL"]},gemini:{apiKey:["GEMINI_API_KEY"],baseUrl:[],model:["GEMINI_MODEL"]},"vertex-ai":{apiKey:["GOOGLE_API_KEY"],baseUrl:[],model:["GOOGLE_MODEL"]},"qwen-oauth":{apiKey:[],baseUrl:[],model:[]}};var DEFAULT_MODELS={openai:MAINLINE_CODER_MODEL,"qwen-oauth":DEFAULT_QWEN_MODEL};var QWEN_OAUTH_MODELS=[{id:"coder-model",name:"coder-model",description:"Qwen 3.7 Max \u2014 efficient hybrid model with leading coding performance",capabilities:{vision:true}}];var QWEN_OAUTH_ALLOWED_MODELS=QWEN_OAUTH_MODELS.map(model=>model.id);init_esbuild_shims();function setSource(sources,path,source){sources[path]=source}__name(setSource,"setSource");function getSeedSource(seed,path){return seed?.[path]}__name(getSeedSource,"getSeedSource");function resolveContentGeneratorConfigWithSources(config,authType,generationConfig,seedSources,options){const sources={...seedSources||{}};const strictModelProvider=options?.strictModelProvider===true;const newContentGeneratorConfig={...generationConfig||{},authType,reasoningSnapshot:generationConfig?.reasoningSnapshot??config?.getReasoningSnapshot?.(),reasoningRouteBaseUrl:generationConfig&&"reasoningRouteBaseUrl"in generationConfig?generationConfig.reasoningRouteBaseUrl:config?.getCurrentModelRegistryBaseUrl?.(),proxy:config?.getProxy()};setSource(sources,"authType",{kind:"computed",detail:"provided by caller"});if(config?.getProxy()){setSource(sources,"proxy",{kind:"computed",detail:"Config.getProxy()"})}const seedOrUnknown=__name(path=>getSeedSource(seedSources,path)??{kind:"unknown"},"seedOrUnknown");for(const field of PROVIDER_SOURCED_FIELDS){if(generationConfig&&field in generationConfig&&!sources[field]){setSource(sources,field,seedOrUnknown(field))}}const validation=validateModelConfig(newContentGeneratorConfig,strictModelProvider);if(!validation.valid){throw new Error(validation.errors.map(e=>e.message).join("\n"))}return{config:newContentGeneratorConfig,sources}}__name(resolveContentGeneratorConfigWithSources,"resolveContentGeneratorConfigWithSources");var VERTEX_PROJECT_ENV_VAR="GOOGLE_CLOUD_PROJECT";function hasVertexProjectConfigured(lookup=key=>process.env[key]){return!!lookup(VERTEX_PROJECT_ENV_VAR)?.trim()}__name(hasVertexProjectConfigured,"hasVertexProjectConfigured");function usesVertexApplicationDefaultCredentials(config){return config.authType==="vertex-ai"&&!config.apiKeyEnvKey&&hasVertexProjectConfigured()}__name(usesVertexApplicationDefaultCredentials,"usesVertexApplicationDefaultCredentials");function validateModelConfig(config,isStrictModelProvider=false){const errors=[];if(config.authType==="qwen-oauth"){return{valid:true,errors:[]}}if(!config.apiKey&&!usesVertexApplicationDefaultCredentials(config)){if(isStrictModelProvider){errors.push(new StrictMissingCredentialsError(config.authType,config.model,config.apiKeyEnvKey))}else{const envKey=config.apiKeyEnvKey||getDefaultApiKeyEnvVar(config.authType);errors.push(new MissingApiKeyError({authType:config.authType,model:config.model,baseUrl:config.baseUrl,envKey,explicitEnvKey:config.apiKeyEnvKey}))}}if(!config.model){if(isStrictModelProvider){errors.push(new StrictMissingModelIdError(config.authType))}else{const envKey=getDefaultModelEnvVar(config.authType);errors.push(new MissingModelError({authType:config.authType,envKey}))}}if(config.authType==="anthropic"&&!config.baseUrl){if(isStrictModelProvider){errors.push(new MissingBaseUrlError({authType:config.authType,model:config.model}))}else if(config.authType==="anthropic"){errors.push(new MissingAnthropicBaseUrlEnvError)}}return{valid:errors.length===0,errors}}__name(validateModelConfig,"validateModelConfig");function getModuleNotFoundError(error){let current=error;while(current instanceof Error){if("code"in current&¤t.code==="ERR_MODULE_NOT_FOUND"){return current}current=current.cause}return void 0}__name(getModuleNotFoundError,"getModuleNotFoundError");function wrapProviderLoadError(error,authType){const moduleNotFoundError=getModuleNotFoundError(error);if(!moduleNotFoundError){return error}return new Error(`Qwen Code was updated in the background and needs to be restarted.
|
|
4
|
-
Please exit and restart Qwen Code to use the '${authType}' provider.`,{cause:moduleNotFoundError})}__name(wrapProviderLoadError,"wrapProviderLoadError");var LazyContentGenerator=class{constructor(loader){this.loader=loader}static{__name(this,"LazyContentGenerator")}generatorPromise;preloadedOnly=false;getGenerator(){this.generatorPromise??=this.loader();return this.generatorPromise}getGeneratorForUse(){this.preloadedOnly=false;return this.getGenerator()}preload(){if(!this.generatorPromise){this.preloadedOnly=true}return this.getGenerator()}resetPreload(){if(!this.preloadedOnly)return;this.preloadedOnly=false;this.generatorPromise=void 0}async generateContent(request,userPromptId){return(await this.getGeneratorForUse()).generateContent(request,userPromptId)}async generateContentStream(request,userPromptId){return(await this.getGeneratorForUse()).generateContentStream(request,userPromptId)}async embedContent(request){return(await this.getGeneratorForUse()).embedContent(request)}};async function preloadContentGenerator(generator){if(generator instanceof LazyContentGenerator){await generator.preload()}}__name(preloadContentGenerator,"preloadContentGenerator");function resetPreloadedContentGenerator(generator){if(generator instanceof LazyContentGenerator){generator.resetPreload()}}__name(resetPreloadedContentGenerator,"resetPreloadedContentGenerator");async function createContentGenerator(generatorConfig,config,isInitialAuth){const validation=validateModelConfig(generatorConfig,false);if(!validation.valid){throw new Error(validation.errors.map(e=>e.message).join("\n"))}const authType=generatorConfig.authType;if(!authType){throw new Error("ContentGeneratorConfig must have an authType")}await preloadRuntimeFetchModule();let loadBaseGenerator;try{if(authType==="openai"){loadBaseGenerator=__name(async()=>{const{createOpenAIContentGenerator}=await import("./openaiContentGenerator-
|
|
4
|
+
Please exit and restart Qwen Code to use the '${authType}' provider.`,{cause:moduleNotFoundError})}__name(wrapProviderLoadError,"wrapProviderLoadError");var LazyContentGenerator=class{constructor(loader){this.loader=loader}static{__name(this,"LazyContentGenerator")}generatorPromise;preloadedOnly=false;getGenerator(){this.generatorPromise??=this.loader();return this.generatorPromise}getGeneratorForUse(){this.preloadedOnly=false;return this.getGenerator()}preload(){if(!this.generatorPromise){this.preloadedOnly=true}return this.getGenerator()}resetPreload(){if(!this.preloadedOnly)return;this.preloadedOnly=false;this.generatorPromise=void 0}async generateContent(request,userPromptId){return(await this.getGeneratorForUse()).generateContent(request,userPromptId)}async generateContentStream(request,userPromptId){return(await this.getGeneratorForUse()).generateContentStream(request,userPromptId)}async embedContent(request){return(await this.getGeneratorForUse()).embedContent(request)}};async function preloadContentGenerator(generator){if(generator instanceof LazyContentGenerator){await generator.preload()}}__name(preloadContentGenerator,"preloadContentGenerator");function resetPreloadedContentGenerator(generator){if(generator instanceof LazyContentGenerator){generator.resetPreload()}}__name(resetPreloadedContentGenerator,"resetPreloadedContentGenerator");async function createContentGenerator(generatorConfig,config,isInitialAuth){const validation=validateModelConfig(generatorConfig,false);if(!validation.valid){throw new Error(validation.errors.map(e=>e.message).join("\n"))}const authType=generatorConfig.authType;if(!authType){throw new Error("ContentGeneratorConfig must have an authType")}await preloadRuntimeFetchModule();let loadBaseGenerator;try{if(authType==="openai"){loadBaseGenerator=__name(async()=>{const{createOpenAIContentGenerator}=await import("./openaiContentGenerator-HX7NCSV5.js");return createOpenAIContentGenerator(generatorConfig,config)},"loadBaseGenerator")}else if(authType==="openai-responses"){loadBaseGenerator=__name(async()=>{const{createOpenAIResponsesContentGenerator}=await import("./openaiResponsesContentGenerator-CFA6U6Y5.js");return createOpenAIResponsesContentGenerator(generatorConfig,config)},"loadBaseGenerator")}else if(authType==="qwen-oauth"){const{getQwenOAuthClient:getQwenOauthClient}=await import("./qwenOAuth2-GMGLANLC.js");try{const qwenClient=await getQwenOauthClient(config,isInitialAuth?{requireCachedCredentials:true}:void 0);loadBaseGenerator=__name(async()=>{const{QwenContentGenerator}=await import("./qwenContentGenerator-GM3ZSI7E.js");return new QwenContentGenerator(qwenClient,generatorConfig,config)},"loadBaseGenerator")}catch(error){if(getModuleNotFoundError(error)){throw error}throw new Error(error instanceof Error?error.message:String(error))}}else if(authType==="anthropic"){loadBaseGenerator=__name(async()=>{const{createAnthropicContentGenerator}=await import("./anthropicContentGenerator-QTJVPAMI.js");return createAnthropicContentGenerator(generatorConfig,config)},"loadBaseGenerator")}else if(authType==="gemini"||authType==="vertex-ai"){loadBaseGenerator=__name(async()=>{const{createLlmContentGenerator}=await import("./llm-content-generator-GWHXT3WS.js");return createLlmContentGenerator(generatorConfig,config)},"loadBaseGenerator")}else{throw new Error(`Error creating contentGenerator: Unsupported authType: ${authType}`)}}catch(error){throw wrapProviderLoadError(error,authType)}return new LazyContentGenerator(async()=>{try{const[baseGenerator,{LoggingContentGenerator}]=await Promise.all([loadBaseGenerator(),import("./loggingContentGenerator-UJV6QFOY.js")]);return new LoggingContentGenerator(baseGenerator,config,generatorConfig)}catch(error){throw wrapProviderLoadError(error,authType)}})}__name(createContentGenerator,"createContentGenerator");export{getDefaultApiKeyEnvVar,VERTEX_ADC_HINT,DEFAULT_QWEN_EMBEDDING_MODEL,MAINLINE_CODER_MODEL,MODEL_GENERATION_CONFIG_FIELDS,PROVIDER_SOURCED_FIELDS,AUTH_ENV_MAPPINGS,DEFAULT_MODELS,QWEN_OAUTH_MODELS,QWEN_OAUTH_ALLOWED_MODELS,resolveContentGeneratorConfigWithSources,hasVertexProjectConfigured,preloadContentGenerator,resetPreloadedContentGenerator,createContentGenerator};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2025 Qwen Team
|