@qwen-code/qwen-code 0.19.11-nightly.20260718.767a32484 → 0.19.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/model-providers.md +0 -11
- package/bundled/qc-helper/docs/configuration/settings.md +9 -9
- package/bundled/qc-helper/docs/features/channels/overview.md +11 -24
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +7 -42
- package/bundled/qc-helper/docs/qwen-serve.md +40 -66
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +1 -1
- package/chunks/{MaxSizedBox-ZFHA4QEQ.js → MaxSizedBox-L6TGYDM3.js} +27 -27
- package/chunks/{StandaloneSessionPicker-YRWOQVQA.js → StandaloneSessionPicker-AKEQHU5P.js} +39 -39
- package/chunks/{acpAgent-U2P2IESZ.js → acpAgent-PTNBGJDN.js} +228 -501
- package/chunks/{agent-GQXX6X5Y.js → agent-AJOMOZPJ.js} +24 -24
- package/chunks/{agent-headless-3572NBCK.js → agent-headless-CYKOMAXS.js} +24 -24
- package/chunks/{anthropicContentGenerator-Y65DMM64.js → anthropicContentGenerator-HBRXJSP4.js} +6 -29
- package/chunks/{artifact-tool-WR7I2XON.js → artifact-tool-MIZLXBLF.js} +2 -2
- package/chunks/{askUserQuestion-B4FUTPHD.js → askUserQuestion-XMJVPNWM.js} +44 -2
- package/chunks/{bridge-N5RMGD7G.js → bridge-QKISWPCI.js} +29 -29
- package/chunks/{ca-M3GQQ26D.js → ca-CODEN7TD.js} +2 -2
- package/chunks/{channel-worker-group-HZVJKLGX.js → channel-worker-group-SOUWTFHC.js} +4 -4
- package/chunks/{channel-worker-manager-3WDK4HNS.js → channel-worker-manager-LOVSV3WW.js} +4 -4
- package/chunks/{channel-worker-supervisor-U2W6Q5F7.js → channel-worker-supervisor-XW6MHJBQ.js} +3 -3
- package/chunks/{chunk-3DJY4IFO.js → chunk-2FO5GFKZ.js} +1 -1
- package/chunks/chunk-2HRYPZT5.js +25 -0
- package/chunks/{chunk-LSFVUGXT.js → chunk-2OG646IN.js} +3 -3
- package/chunks/{chunk-OSSDHJDU.js → chunk-2Z5UX4KI.js} +1 -1
- package/chunks/{chunk-O2K6BLPZ.js → chunk-3AYLDB6B.js} +1 -1
- package/chunks/{chunk-MI2V6IWU.js → chunk-3DWIFU7L.js} +1 -1
- package/chunks/{chunk-AEKYFMYE.js → chunk-3M75MSVA.js} +1 -1
- package/chunks/{chunk-HIMIG6PI.js → chunk-4AGTGMCQ.js} +11 -11
- package/chunks/{chunk-V2FRLYHN.js → chunk-4BJVSIS3.js} +2 -2
- package/chunks/{chunk-64XGKNSI.js → chunk-4HUDDSO5.js} +3 -3
- package/chunks/{chunk-FSJGBUQI.js → chunk-4IJMTYCB.js} +28 -817
- package/chunks/{chunk-TYQMGACW.js → chunk-4LD5APFL.js} +0 -1
- package/chunks/{chunk-2XRGFF5K.js → chunk-4ROQY23C.js} +6 -6
- package/chunks/{chunk-KEVDWH3U.js → chunk-574PTLMU.js} +55 -207
- package/chunks/{chunk-Y72B36CP.js → chunk-5CNYZ7TN.js} +7 -7
- package/chunks/{chunk-DPSHAB47.js → chunk-5VWYKIMW.js} +1 -1
- package/chunks/{chunk-OXOEOOQU.js → chunk-5Z452MMD.js} +37 -64
- package/chunks/{chunk-U6OPT4H2.js → chunk-6EDDYPI3.js} +4 -4
- package/chunks/{chunk-XA7OKDWM.js → chunk-6WGZDD67.js} +2 -2
- package/chunks/{chunk-IENO2YAT.js → chunk-6WPJRYLZ.js} +3 -3
- package/chunks/{chunk-PWYLF7SS.js → chunk-6Y6ORE2G.js} +10 -7
- package/chunks/{chunk-UE5TZ55T.js → chunk-7NFB7LBQ.js} +0 -8
- package/chunks/{chunk-3CL5SEDT.js → chunk-7NMU22Q3.js} +6 -6
- package/chunks/{chunk-ECZFTRTP.js → chunk-7ZYHLN67.js} +75 -26
- package/chunks/{chunk-LKR7QQ63.js → chunk-A2HWMJVO.js} +3 -3
- package/chunks/{chunk-SGPFJMRP.js → chunk-ARKANCNX.js} +1 -1
- package/chunks/{chunk-5QRK2VZG.js → chunk-AU3MFJPL.js} +8 -8
- package/chunks/{chunk-R3VWUU2E.js → chunk-AVEOWVOM.js} +1 -1
- package/chunks/{chunk-6ITLKEOZ.js → chunk-BUAXJVNP.js} +3 -3
- package/chunks/{chunk-U4FJ26D2.js → chunk-BXBDC476.js} +2 -2
- package/chunks/{chunk-ZTSDZQZO.js → chunk-BYB3GF2T.js} +3 -130
- package/chunks/{chunk-4JBTZBCW.js → chunk-BYH2JRK3.js} +5 -5
- package/chunks/{chunk-4HCYNDMG.js → chunk-CAHY5ABC.js} +1 -1
- package/chunks/{chunk-JBAQ5BYX.js → chunk-CF5VJRGC.js} +1 -1
- package/chunks/{chunk-3NWYQ7FX.js → chunk-CH2XVB47.js} +2 -2
- package/chunks/{chunk-FHUXCRAF.js → chunk-CITWNIXJ.js} +4 -4
- package/chunks/{chunk-6YIRYY3P.js → chunk-CPFIQVZJ.js} +1 -1
- package/chunks/{chunk-EKG3BHQY.js → chunk-DOPUYNXO.js} +3 -3
- package/chunks/{chunk-VNN3JNYT.js → chunk-F333XEAU.js} +1 -1
- package/chunks/{chunk-FUTHTZVV.js → chunk-FBU7WRZI.js} +1 -1
- package/chunks/{chunk-OBYAX5QZ.js → chunk-FMNYGWOD.js} +6 -6
- package/chunks/{chunk-FZRES4GK.js → chunk-FNX3LGAK.js} +1 -1
- package/chunks/{chunk-F2RR4HO2.js → chunk-FSA7ERJ2.js} +1 -1
- package/chunks/{chunk-OPVIKLKK.js → chunk-FXKOAEXP.js} +14 -14
- package/chunks/{chunk-U2XBPBO3.js → chunk-FYQ22K62.js} +3 -4
- package/chunks/{chunk-KTKETHMY.js → chunk-GLNHPRZT.js} +1 -1
- package/chunks/{chunk-C5NSOSF4.js → chunk-GNBBAQ6J.js} +13 -30
- package/chunks/{chunk-GAQOQMHY.js → chunk-HASK4LMI.js} +6 -6
- package/chunks/{chunk-GG6RSNWS.js → chunk-JD44PNGJ.js} +4 -9
- package/chunks/{chunk-ANRANWVE.js → chunk-JGUT3LWZ.js} +1 -4
- package/chunks/{chunk-336KPNNV.js → chunk-JWICTOXS.js} +2 -2
- package/chunks/{chunk-57RWF6R7.js → chunk-K7VD4XLT.js} +1 -1
- package/chunks/{chunk-XSPFQQRE.js → chunk-KKRTYONM.js} +3 -3
- package/chunks/{chunk-JDIUK2Y3.js → chunk-KSZKSE23.js} +1 -1
- package/chunks/{chunk-HQXQCIT2.js → chunk-KXYJPRT5.js} +5 -25
- package/chunks/{chunk-X6YQWCIJ.js → chunk-L4Y55KIS.js} +1 -1
- package/chunks/{chunk-335ECZTA.js → chunk-L5U3ELZX.js} +1 -1
- package/chunks/{chunk-4CHDYDG3.js → chunk-LQIDP6K5.js} +1 -1
- package/chunks/{chunk-5O34IMY5.js → chunk-LS56TX3M.js} +1 -1
- package/chunks/{chunk-HCCR43AY.js → chunk-LXLTBIDP.js} +1 -1
- package/chunks/{chunk-66IT3EY2.js → chunk-MQOVXZAF.js} +48 -164
- package/chunks/{chunk-JUVTV4NF.js → chunk-N5VIZTND.js} +1 -1
- package/chunks/{chunk-3YJZ6WNY.js → chunk-NJOFRXTM.js} +593 -1317
- package/chunks/{chunk-CZSAIBUB.js → chunk-NVTQZXR7.js} +7 -7
- package/chunks/{chunk-G274ETR6.js → chunk-OKAIGAYW.js} +3 -3
- package/chunks/{chunk-TVYM3Q3J.js → chunk-OWT2CAEQ.js} +7 -100
- package/chunks/{chunk-T3W4SDRB.js → chunk-PZL23GTM.js} +0 -2
- package/chunks/{chunk-XAAEDML2.js → chunk-Q6TUALBE.js} +1 -1
- package/chunks/chunk-QAW7PIHT.js +168 -0
- package/chunks/{chunk-HT7L5FCZ.js → chunk-QDJ2R4CM.js} +3 -3
- package/chunks/{chunk-IX7O5WI3.js → chunk-QOTQH4CB.js} +8 -23
- package/chunks/{chunk-S4N3G4BB.js → chunk-QYG4BY6Q.js} +1 -1
- package/chunks/{chunk-4XCVGEEX.js → chunk-RCEEXIOO.js} +3 -3
- package/chunks/{chunk-IK5TYYVR.js → chunk-RP5R7MB6.js} +12 -12
- package/chunks/{chunk-U2LNTX56.js → chunk-RTV5TUYB.js} +1 -1
- package/chunks/{chunk-K2GBHL73.js → chunk-S63Z5V42.js} +4 -4
- package/chunks/{chunk-J2MKYJKZ.js → chunk-SPJQO2CE.js} +2 -2
- package/chunks/{chunk-LTD3CHGS.js → chunk-SQ5BK3GO.js} +1 -1
- package/chunks/{chunk-W7H223ZZ.js → chunk-STZQCNN3.js} +1 -1
- package/chunks/{chunk-2YSZE74N.js → chunk-SY7NEYX4.js} +2 -2
- package/chunks/{chunk-GA3WUOO7.js → chunk-T76DGHGG.js} +5 -5
- package/chunks/{chunk-QPRDXJIC.js → chunk-THXDQSTA.js} +29 -30
- package/chunks/{chunk-DASWPKXR.js → chunk-TIOE2OPE.js} +2 -2
- package/chunks/{chunk-F5XYN5VF.js → chunk-TL4R5TRK.js} +2 -2
- package/chunks/{chunk-4RPARQ5D.js → chunk-TV6K2FB4.js} +2 -2
- package/chunks/{chunk-JCJPZMJV.js → chunk-TYLOFD2U.js} +1 -1
- package/chunks/{chunk-632KROVU.js → chunk-V2DXTLUE.js} +3 -3
- package/chunks/{chunk-URP6O2PP.js → chunk-VFX7EZIR.js} +1 -1
- package/chunks/{chunk-CMVFTMRD.js → chunk-VRR65QYW.js} +1 -1
- package/chunks/{chunk-VAJS2E2D.js → chunk-WIEO4CWB.js} +1 -1
- package/chunks/{chunk-OCQ2QTFJ.js → chunk-WMNXXRGL.js} +25 -25
- package/chunks/{chunk-WEPXQKGP.js → chunk-WTNZ6DXB.js} +1 -1
- package/chunks/{chunk-LGY7PG7Q.js → chunk-Y3KFTWVX.js} +5 -5
- package/chunks/{chunk-4CA4WUMS.js → chunk-Y66VOBRP.js} +2 -2
- package/chunks/{chunk-IVKLDHU6.js → chunk-YFVO2HOR.js} +4 -4
- package/chunks/{chunk-GUNTLALV.js → chunk-YGYSMY2R.js} +47 -61
- package/chunks/{chunk-3X2CFOUM.js → chunk-YLSSEUAM.js} +274 -345
- package/chunks/{chunk-6Z5NRZVU.js → chunk-ZIXOTAPZ.js} +3 -92
- package/chunks/{chunk-Z2LBNX3R.js → chunk-ZPAHLFZU.js} +2 -2
- package/chunks/{chunk-ATJ7H5AS.js → chunk-ZQIYGQCG.js} +84 -230
- package/chunks/{computer-use-UIFBH25Y.js → computer-use-VZZMJEQ7.js} +24 -24
- package/chunks/{config-utils-2LHI7JXU.js → config-utils-IQQT3GCI.js} +3 -3
- package/chunks/{contextCommand-VGZHKEH2.js → contextCommand-PORKIZSY.js} +26 -26
- package/chunks/{create-sub-session-DIJOV6HV.js → create-sub-session-EAB2U5XW.js} +2 -2
- package/chunks/{create-sub-session-OFVI4H6I.js → create-sub-session-XVFKHAFW.js} +24 -24
- package/chunks/{cron-create-34GVLSW5.js → cron-create-GMVKSXZT.js} +4 -4
- package/chunks/{cron-delete-NMVKUL45.js → cron-delete-VDZKUAVK.js} +4 -4
- package/chunks/{cron-list-277ZOR7L.js → cron-list-UG7C7RAR.js} +4 -4
- package/chunks/{daemon-72MEV3TY.js → daemon-IHR6WSPB.js} +14 -59
- package/chunks/{daemon-status-provider-ZJJ6AOG2.js → daemon-status-provider-ABLBA3UJ.js} +33 -33
- package/chunks/{de-56TMDIKS.js → de-NOXPCSYN.js} +2 -2
- package/chunks/{dist-ILVRL322.js → dist-4WCQEZIN.js} +1 -1
- package/chunks/{dist-SVHAGOLN.js → dist-DOPL5LSQ.js} +1 -1
- package/chunks/{dist-LQHDHBPP.js → dist-GXJVCOS7.js} +1 -1
- package/chunks/{dist-KEZ5JWH4.js → dist-PX2ERZ6I.js} +2 -2
- package/chunks/{dist-G6QCGO2K.js → dist-V2YVLYOW.js} +1 -1
- package/chunks/{dist-4W3UGU2A.js → dist-VYWUKURL.js} +1 -1
- package/chunks/{earlyInputCapture-NPF4PVUE.js → earlyInputCapture-DJCU5SPU.js} +25 -25
- package/chunks/{edit-F7CT6NZH.js → edit-O4VV5AO6.js} +25 -25
- package/chunks/{en-AXS2N62H.js → en-JFVULHTB.js} +3 -6
- package/chunks/{enter-worktree-Z4ET3MZL.js → enter-worktree-XQYDDI2I.js} +24 -24
- package/chunks/{enterPlanMode-VYR7T5NX.js → enterPlanMode-CESVMQBV.js} +27 -25
- package/chunks/{environment-MBTXL57Q.js → environment-5KXOLZNR.js} +26 -26
- package/chunks/{errors-HN36J4FR.js → errors-EBUTCBAQ.js} +26 -26
- package/chunks/{exit-worktree-RU7JYFMF.js → exit-worktree-MWGNSPNX.js} +24 -24
- package/chunks/exitPlanMode-HYQL4XMB.js +909 -0
- package/chunks/{fast-path-RFT3CDNZ.js → fast-path-6V73F2T2.js} +2 -2
- package/chunks/{fr-ZJPE5OVN.js → fr-HVFNU42H.js} +2 -2
- package/chunks/{gemini-37NTNKZF.js → gemini-TEFJZCIZ.js} +70 -98
- package/chunks/{geminiContentGenerator-76HNOYNQ.js → geminiContentGenerator-M56BEXWI.js} +5 -5
- package/chunks/{glob-DWD7JCZE.js → glob-DMYFEEAZ.js} +25 -30
- package/chunks/{grep-NJRXFV5C.js → grep-GYE47MD4.js} +25 -30
- package/chunks/{handleAutoUpdate-7GBDXW6U.js → handleAutoUpdate-OLUY4L7L.js} +28 -28
- package/chunks/{i18n-MYD5VGED.js → i18n-462JC7IY.js} +25 -25
- package/chunks/{initializer-4DHPNAZG.js → initializer-Y7WD4D2I.js} +30 -30
- package/chunks/{installationInfo-RWOW6BZO.js → installationInfo-I2Z3BKCE.js} +25 -25
- package/chunks/{ja-57GG4QSL.js → ja-PY5AF544.js} +2 -2
- package/chunks/{keychain-token-storage-K23CFKGN.js → keychain-token-storage-AU22CQI6.js} +2 -2
- package/chunks/{list-MMCNNHE7.js → list-XQ5MSAXP.js} +32 -32
- package/chunks/{loadedSettingsAdapter-UK4JWPYU.js → loadedSettingsAdapter-TQOWYE7C.js} +29 -29
- package/chunks/{loop-wakeup-KCLY4XQM.js → loop-wakeup-QXWZSCYM.js} +5 -5
- package/chunks/{ls-UNI4LAJ3.js → ls-2OUTG3IZ.js} +4 -4
- package/chunks/{lsp-HPACPJAN.js → lsp-4VMNXZW6.js} +2 -2
- package/chunks/{mcp-AFCVA4UV.js → mcp-22LLEEVM.js} +29 -29
- package/chunks/{monitor-RK637BNO.js → monitor-VKG324X3.js} +24 -24
- package/chunks/nonInteractiveCli-UMYUT643.js +129 -0
- package/chunks/{notebook-edit-LY2X3CMF.js → notebook-edit-FJJRBQ3S.js} +25 -25
- package/chunks/{openaiContentGenerator-MDYDW7IA.js → openaiContentGenerator-4T2OGTR5.js} +13 -13
- package/chunks/{pidfile-2NUYRLKB.js → pidfile-XL3MDCBM.js} +25 -25
- package/chunks/{processUtils-7QH3VBVN.js → processUtils-7UCFN34D.js} +2 -2
- package/chunks/{pt-MCGZ3RZ4.js → pt-A3PRQXMU.js} +2 -2
- package/chunks/{qwenContentGenerator-3HT4TVDL.js → qwenContentGenerator-PQUXJDIZ.js} +26 -26
- package/chunks/{qwenOAuth2-3A4TJVZT.js → qwenOAuth2-LEYOU7RU.js} +5 -5
- package/chunks/{read-file-NE4FREFR.js → read-file-3EYQML7E.js} +10 -10
- package/chunks/{read-mcp-resource-C6NT52T6.js → read-mcp-resource-JUFHCKSC.js} +2 -2
- package/chunks/{record-artifact-ENCU7QCL.js → record-artifact-DWSMBXYY.js} +2 -2
- package/chunks/{ripGrep-DBLXWQCJ.js → ripGrep-S6WPGQNA.js} +24 -24
- package/chunks/{ru-GA3NZW5Q.js → ru-IBCWUTOC.js} +2 -2
- package/chunks/{run-qwen-serve-3NOCI6IL.js → run-qwen-serve-NSKBT3HU.js} +36 -52
- package/chunks/{runtime-ZI7DSZSS.js → runtime-LG5ZZ3VH.js} +33 -33
- package/chunks/{scheduler-SOVEP5K7.js → scheduler-PLX3VVTB.js} +24 -24
- package/chunks/{send-message-5IFPZTPE.js → send-message-JZ752NWD.js} +3 -3
- package/chunks/{serve-DB6OCXIA.js → serve-S2ZLRZZR.js} +29 -29
- package/chunks/{server-LDY4YVU4.js → server-5ECMV4TM.js} +679 -1413
- package/chunks/{session-D6OG5SKX.js → session-ILSONWG4.js} +66 -93
- package/chunks/{settings-L52ZV5LO.js → settings-BOE7WWSA.js} +28 -28
- package/chunks/{shell-IU27OY3Q.js → shell-VW664JIZ.js} +24 -24
- package/chunks/{skill-BSOJT7LE.js → skill-COHV6625.js} +12 -12
- package/chunks/{spawnChannel-HQAM25DD.js → spawnChannel-5UUR5XOZ.js} +26 -26
- package/chunks/{src-7ZBIMTJZ.js → src-XPKFZ3RN.js} +25 -43
- package/chunks/{standalone-update-77457VVK.js → standalone-update-IOOJ2NZQ.js} +26 -26
- package/chunks/{startInteractiveUI-S7WC6EZG.js → startInteractiveUI-3NGJGXXS.js} +1733 -2194
- package/chunks/{syntheticOutput-ULOVVLY4.js → syntheticOutput-LELY6HAI.js} +3 -3
- package/chunks/{task-create-V2DCDSET.js → task-create-QY3BIMNM.js} +7 -7
- package/chunks/{task-list-DPL5ZN55.js → task-list-D2U47WBJ.js} +5 -5
- package/chunks/{task-stop-CPEQWOT6.js → task-stop-N6E5IYLH.js} +2 -2
- package/chunks/{task-update-ZR45M5Q7.js → task-update-HJCQILLB.js} +7 -7
- package/chunks/{team-create-CO7HSUON.js → team-create-UPLVZQFX.js} +24 -24
- package/chunks/{team-delete-HIWXCWJU.js → team-delete-RCWYDRF4.js} +5 -5
- package/chunks/{team-plan-approval-QDZF5YZY.js → team-plan-approval-F5F432RO.js} +24 -24
- package/chunks/{theme-manager-UTUT3I4P.js → theme-manager-JJE4BJ67.js} +25 -25
- package/chunks/todoWrite-FKCGATPJ.js +531 -0
- package/chunks/{tool-search-2UUORA35.js → tool-search-LRXI4JLZ.js} +11 -11
- package/chunks/{total-session-admission-NTWG6G3F.js → total-session-admission-I4DHN6UP.js} +30 -30
- package/chunks/{trustedFolders-YF37ZCN5.js → trustedFolders-SEH7LNX2.js} +25 -25
- package/chunks/{update-relaunch-QFNHPMZZ.js → update-relaunch-T6ZKBUA6.js} +5 -5
- package/chunks/{updateCheck-B6O42VMD.js → updateCheck-FWLXZPRO.js} +26 -26
- package/chunks/{validateNonInterActiveAuth-SCIWJ4CX.js → validateNonInterActiveAuth-X6K2VWYT.js} +59 -59
- package/chunks/{version-7DA6LAI3.js → version-LIFSOGSE.js} +1 -1
- package/chunks/{web-fetch-B62SJXM2.js → web-fetch-CFCWTCAP.js} +5 -5
- package/chunks/{workflow-Q5WG4THP.js → workflow-NX2DFWGD.js} +25 -25
- package/chunks/{workspace-providers-status-WWLAGWQW.js → workspace-providers-status-VYD6M2NE.js} +32 -32
- package/chunks/{workspace-registration-store-BVYQVY2H.js → workspace-registration-store-2Y6PWOEL.js} +1 -1
- package/chunks/{workspace-registry-OD7ACADD.js → workspace-registry-PKBDBWCA.js} +30 -30
- package/chunks/{workspace-service-4LYJWS63.js → workspace-service-HHORUHTS.js} +35 -35
- package/chunks/{workspace-skills-status-P2AQLZZS.js → workspace-skills-status-O5Q26LIY.js} +30 -30
- package/chunks/{write-file-TEPGXNM3.js → write-file-NVAEZ3J2.js} +25 -58
- package/chunks/{zh-E34DZ2S3.js → zh-PAUNIMHQ.js} +3 -6
- package/chunks/{zh-TW-PEI2ZWUR.js → zh-TW-GNEUIUFF.js} +3 -6
- package/cli.js +11 -11
- package/locales/ca.js +2 -2
- package/locales/de.js +2 -2
- package/locales/en.js +5 -9
- package/locales/fr.js +2 -2
- package/locales/ja.js +2 -2
- package/locales/pt.js +2 -2
- package/locales/ru.js +2 -2
- package/locales/zh-TW.js +3 -8
- package/locales/zh.js +3 -8
- package/package.json +3 -3
- package/web-shell/assets/{arc-Dh-N5oEG.js → arc-H74fE8UR.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-DBOQgtfF.js → architectureDiagram-3BPJPVTR-DN3kEq-I.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Dyxbuyju.js → blockDiagram-GPEHLZMM-BrqbsFUF.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DCJR5HPT.js → c4Diagram-AAUBKEIU-ClFhU1P-.js} +1 -1
- package/web-shell/assets/channel-NFC5ADAa.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-BkMUcy3O.js → chunk-2J33WTMH-jCIcG0_M.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-BSm4pLQk.js → chunk-4BX2VUAB-DSkGe62-.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CuRr-XgW.js → chunk-55IACEB6-BxBHOGTd.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CLv7-w3t.js → chunk-727SXJPM-v_DS7dH7.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-Cz_n3-JW.js → chunk-AQP2D5EJ-1RzEKRPq.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-CFT_62Hq.js → chunk-FMBD7UC4-DyrSbLOX.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-DWz6DOZ6.js → chunk-ND2GUHAM-BCmdsZiy.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-C-mRhUzw.js → chunk-QZHKN3VN-CphHGW2D.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-DHgwjz3X.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DHgwjz3X.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-BqCZS3i1.js → cose-bilkent-S5V4N54A-D5kRC7Fi.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-BGasdP8i.js → dagre-BM42HDAG-DIiyJJ0U.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-BSyLDkMy.js → diagram-2AECGRRQ-BOcuB8xU.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-CM-ZJxWC.js → diagram-5GNKFQAL-CMgiZ4d3.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-wJdzt_C5.js → diagram-KO2AKTUF-Ctx8pfN0.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-DiH2fhpL.js → diagram-LMA3HP47-BT5REAWC.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-BZ9z1ZBl.js → diagram-OG6HWLK6-CJkUqXcp.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BsyWDziR.js → erDiagram-TEJ5UH35-DyvNNX6v.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CzdkxIrq.js → flowDiagram-I6XJVG4X-VBf8_My8.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-javIv2r2.js → ganttDiagram-6RSMTGT7-CviJnR7B.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-CjHstylC.js → gitGraphDiagram-PVQCEYII-BY66_Oze.js} +1 -1
- package/web-shell/assets/index-8xIBbHV3.js +1143 -0
- package/web-shell/assets/index-DLyhlZZO.css +5 -0
- package/web-shell/assets/{index-BnJGxpah.js → index-DhYuvi3j.js} +1 -1
- package/web-shell/assets/{infoDiagram-5YYISTIA-yXuQsomo.js → infoDiagram-5YYISTIA-D2jaewWZ.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-a85JhE6F.js → ishikawaDiagram-YF4QCWOH-BpnNTyi5.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-Dak_4BVj.js → journeyDiagram-JHISSGLW-CA55GNZF.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-COA-LuCV.js → kanban-definition-UN3LZRKU-DyiSl_Ts.js} +1 -1
- package/web-shell/assets/{linear-DNAAAQWq.js → linear-B-sN3dkV.js} +1 -1
- package/web-shell/assets/{mermaid.core-7Ff3aIUD.js → mermaid.core-xf9SXDdb.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-_rCOIODU.js → mindmap-definition-RKZ34NQL-DXhr2kRk.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-C9QCQ8EW.js → pieDiagram-4H26LBE5-DUXpbfGQ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-CsaE4FA8.js → quadrantDiagram-W4KKPZXB-NeDQYeWw.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-tV78naTg.js → requirementDiagram-4Y6WPE33-BSbFRL1A.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-Dk3Rw7BZ.js → sankeyDiagram-5OEKKPKP-gg27cAaN.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BGsAWcMX.js → sequenceDiagram-3UESZ5HK-Bi_1TSs4.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-zSxdtdoB.js → stateDiagram-AJRCARHV-CboCCRaf.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CXRqms6P.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-j0BQh9Go.js → timeline-definition-PNZ67QCA-DrGpF_jn.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-CRaUFFIu.js → vennDiagram-CIIHVFJN-DCaJU67x.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-D7Py_ofm.js → wardley-L42UT6IY-p0QcW1aP.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BrDIAZcp.js → wardleyDiagram-YWT4CUSO-DiEVxj1W.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-Cecdw-w2.js → xychartDiagram-2RQKCTM6-iQB8nSlA.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-QFEY6OXH.js +0 -45
- package/chunks/exitPlanMode-LUBAWMZQ.js +0 -390
- package/chunks/nonInteractiveCli-OUGWLHNV.js +0 -129
- package/chunks/todoWrite-HK6B3RHJ.js +0 -358
- package/web-shell/assets/channel-DY0fkcKT.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-DBvJ6PZo.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DBvJ6PZo.js +0 -1
- package/web-shell/assets/index-DhXB9nTa.js +0 -1161
- package/web-shell/assets/index-vYHgZ7bL.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-vLEEtDpO.js +0 -1
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
buildPermissionSettings
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-K7VD4XLT.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveVoiceStreamConfig,
|
|
8
8
|
resolveVoiceTranscriptionConfig,
|
|
9
9
|
transcribeVoiceAudio
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BUAXJVNP.js";
|
|
11
11
|
import {
|
|
12
12
|
getVoiceSettingsScope,
|
|
13
13
|
isSelectableVoiceModel,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
readVoiceMode,
|
|
17
17
|
readVoiceModel,
|
|
18
18
|
resolveVoiceTransport
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3M75MSVA.js";
|
|
20
20
|
import {
|
|
21
21
|
WorkspacePermissionRulesSessionRequiredError,
|
|
22
22
|
WorkspaceSettingsPartialPersistError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WorkspaceInitPathEscapeError,
|
|
33
33
|
WorkspaceInitRaceError,
|
|
34
34
|
WorkspaceInitSymlinkError
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-L4Y55KIS.js";
|
|
36
36
|
import {
|
|
37
37
|
BridgeChannelClosedError,
|
|
38
38
|
SERVE_CONTROL_EXT_METHODS,
|
|
@@ -46,38 +46,34 @@ import {
|
|
|
46
46
|
createIdleWorkspaceProvidersStatus,
|
|
47
47
|
createIdleWorkspaceSkillsStatus,
|
|
48
48
|
mapDomainErrorToErrorKind
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-VFX7EZIR.js";
|
|
50
50
|
import {
|
|
51
51
|
getPersistScopeForModelSelection,
|
|
52
52
|
loadSettings
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-GNBBAQ6J.js";
|
|
54
54
|
import {
|
|
55
55
|
getWorkspaceTrustStatus
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-2OG646IN.js";
|
|
57
57
|
import {
|
|
58
58
|
writeStderrLine
|
|
59
59
|
} from "./chunk-YUZI3WAC.js";
|
|
60
60
|
import {
|
|
61
|
-
ModelsConfig
|
|
62
|
-
|
|
63
|
-
require_yauzl
|
|
64
|
-
} from "./chunk-3YJZ6WNY.js";
|
|
61
|
+
ModelsConfig
|
|
62
|
+
} from "./chunk-NJOFRXTM.js";
|
|
65
63
|
import {
|
|
66
|
-
Storage,
|
|
67
64
|
createDebugLogger
|
|
68
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-7NFB7LBQ.js";
|
|
69
66
|
import {
|
|
70
67
|
init_esbuild_shims
|
|
71
68
|
} from "./chunk-5O2XNYP6.js";
|
|
72
69
|
import {
|
|
73
|
-
__name
|
|
74
|
-
__toESM
|
|
70
|
+
__name
|
|
75
71
|
} from "./chunk-J2S4EL5Y.js";
|
|
76
72
|
|
|
77
73
|
// packages/cli/src/serve/workspace-service/index.ts
|
|
78
74
|
init_esbuild_shims();
|
|
79
|
-
import { promises as
|
|
80
|
-
import * as
|
|
75
|
+
import { promises as fs, constants as fsConstants } from "node:fs";
|
|
76
|
+
import * as path from "node:path";
|
|
81
77
|
|
|
82
78
|
// packages/cli/src/services/voice-service.ts
|
|
83
79
|
init_esbuild_shims();
|
|
@@ -310,748 +306,18 @@ async function transcribeWorkspaceVoiceAudio(input) {
|
|
|
310
306
|
}
|
|
311
307
|
__name(transcribeWorkspaceVoiceAudio, "transcribeWorkspaceVoiceAudio");
|
|
312
308
|
|
|
313
|
-
// packages/cli/src/serve/workspace-skill-management.ts
|
|
314
|
-
init_esbuild_shims();
|
|
315
|
-
import { promises as fs } from "node:fs";
|
|
316
|
-
import { execFile } from "node:child_process";
|
|
317
|
-
import * as os from "node:os";
|
|
318
|
-
import * as path from "node:path";
|
|
319
|
-
import { promisify } from "node:util";
|
|
320
|
-
var import_yauzl = __toESM(require_yauzl(), 1);
|
|
321
|
-
var MAX_FILES = 128;
|
|
322
|
-
var MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
323
|
-
var MAX_TOTAL_BYTES = 6 * 1024 * 1024;
|
|
324
|
-
var MAX_PATH_LENGTH = 512;
|
|
325
|
-
var MAX_PATH_DEPTH = 16;
|
|
326
|
-
var MAX_WORKSPACE_SKILL_NAME_LENGTH = 256;
|
|
327
|
-
var execFileAsync = promisify(execFile);
|
|
328
|
-
var WorkspaceSkillManagementError = class extends Error {
|
|
329
|
-
constructor(code, message, statusCode = 400) {
|
|
330
|
-
super(message);
|
|
331
|
-
this.code = code;
|
|
332
|
-
this.statusCode = statusCode;
|
|
333
|
-
this.name = "WorkspaceSkillManagementError";
|
|
334
|
-
}
|
|
335
|
-
static {
|
|
336
|
-
__name(this, "WorkspaceSkillManagementError");
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
function skillError(code, message, statusCode = 400) {
|
|
340
|
-
throw new WorkspaceSkillManagementError(code, message, statusCode);
|
|
341
|
-
}
|
|
342
|
-
__name(skillError, "skillError");
|
|
343
|
-
function validateWorkspaceSkillName(name) {
|
|
344
|
-
const normalized = name.trim();
|
|
345
|
-
if (!normalized || normalized === "." || normalized === ".." || normalized.length > MAX_WORKSPACE_SKILL_NAME_LENGTH || !/^[A-Za-z0-9._-]+$/.test(normalized)) {
|
|
346
|
-
skillError("invalid_skill_name", "Invalid skill name");
|
|
347
|
-
}
|
|
348
|
-
return normalized;
|
|
349
|
-
}
|
|
350
|
-
__name(validateWorkspaceSkillName, "validateWorkspaceSkillName");
|
|
351
|
-
function decodeBase64(value) {
|
|
352
|
-
if (!value || !/^[A-Za-z0-9+/]*={0,2}$/.test(value)) {
|
|
353
|
-
skillError("invalid_skill_source", "Invalid base64 skill content");
|
|
354
|
-
}
|
|
355
|
-
const content = Buffer.from(value, "base64");
|
|
356
|
-
if (content.length > MAX_TOTAL_BYTES) {
|
|
357
|
-
skillError(
|
|
358
|
-
"skill_package_too_large",
|
|
359
|
-
"Skill package exceeds the allowed size",
|
|
360
|
-
413
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
return content;
|
|
364
|
-
}
|
|
365
|
-
__name(decodeBase64, "decodeBase64");
|
|
366
|
-
function normalizeRelativePath(value) {
|
|
367
|
-
const normalized = value.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
368
|
-
const segments = normalized.split("/");
|
|
369
|
-
if (!normalized || normalized.length > MAX_PATH_LENGTH || normalized.startsWith("/") || segments.length > MAX_PATH_DEPTH || segments.some((segment) => !segment || segment === "." || segment === "..")) {
|
|
370
|
-
skillError("invalid_skill_package", `Invalid skill file path: ${value}`);
|
|
371
|
-
}
|
|
372
|
-
return segments.join("/");
|
|
373
|
-
}
|
|
374
|
-
__name(normalizeRelativePath, "normalizeRelativePath");
|
|
375
|
-
function isPlatformMetadataPath(value) {
|
|
376
|
-
return value.replaceAll("\\", "/").split("/").some(
|
|
377
|
-
(segment) => segment === "__MACOSX" || segment === ".DS_Store" || segment.startsWith("._")
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
__name(isPlatformMetadataPath, "isPlatformMetadataPath");
|
|
381
|
-
function normalizePackageFiles(files) {
|
|
382
|
-
files = files.filter((file) => !isPlatformMetadataPath(file.relativePath));
|
|
383
|
-
if (!files.length || files.length > MAX_FILES) {
|
|
384
|
-
skillError(
|
|
385
|
-
"invalid_skill_package",
|
|
386
|
-
"Skill package has an invalid file count"
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
let normalized = files.map((file) => ({
|
|
390
|
-
relativePath: normalizeRelativePath(file.relativePath),
|
|
391
|
-
content: file.content
|
|
392
|
-
}));
|
|
393
|
-
if (!normalized.some((file) => file.relativePath === "SKILL.md")) {
|
|
394
|
-
const roots = new Set(
|
|
395
|
-
normalized.map((file) => file.relativePath.split("/")[0])
|
|
396
|
-
);
|
|
397
|
-
if (roots.size !== 1) {
|
|
398
|
-
skillError(
|
|
399
|
-
"skill_manifest_missing",
|
|
400
|
-
"Skill package must contain a root SKILL.md"
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
const [root] = roots;
|
|
404
|
-
normalized = normalized.map((file) => ({
|
|
405
|
-
...file,
|
|
406
|
-
relativePath: file.relativePath.slice(root.length + 1)
|
|
407
|
-
}));
|
|
408
|
-
}
|
|
409
|
-
const seen = /* @__PURE__ */ new Set();
|
|
410
|
-
let totalBytes = 0;
|
|
411
|
-
for (const file of normalized) {
|
|
412
|
-
file.relativePath = normalizeRelativePath(file.relativePath);
|
|
413
|
-
if (seen.has(file.relativePath)) {
|
|
414
|
-
skillError(
|
|
415
|
-
"invalid_skill_package",
|
|
416
|
-
`Duplicate skill file path: ${file.relativePath}`
|
|
417
|
-
);
|
|
418
|
-
}
|
|
419
|
-
seen.add(file.relativePath);
|
|
420
|
-
if (file.content.length > MAX_FILE_BYTES) {
|
|
421
|
-
skillError(
|
|
422
|
-
"skill_package_too_large",
|
|
423
|
-
`Skill file is too large: ${file.relativePath}`,
|
|
424
|
-
413
|
|
425
|
-
);
|
|
426
|
-
}
|
|
427
|
-
totalBytes += file.content.length;
|
|
428
|
-
if (totalBytes > MAX_TOTAL_BYTES) {
|
|
429
|
-
skillError(
|
|
430
|
-
"skill_package_too_large",
|
|
431
|
-
"Skill package exceeds the allowed size",
|
|
432
|
-
413
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
if (!seen.has("SKILL.md")) {
|
|
437
|
-
skillError(
|
|
438
|
-
"skill_manifest_missing",
|
|
439
|
-
"Skill package must contain a root SKILL.md"
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
return normalized;
|
|
443
|
-
}
|
|
444
|
-
__name(normalizePackageFiles, "normalizePackageFiles");
|
|
445
|
-
function githubRequestError(code, status, resource) {
|
|
446
|
-
const message = status === 404 ? `GitHub ${resource} was not found; check the repository URL, branch, and path` : status === 401 ? "GitHub authentication failed; check GH_TOKEN or GITHUB_TOKEN" : status === 403 ? "GitHub access was denied; the repository may be private or API rate-limited" : status === 429 ? "GitHub API rate limit exceeded; try again later or configure GH_TOKEN" : `GitHub request failed (HTTP ${status})`;
|
|
447
|
-
return new WorkspaceSkillManagementError(
|
|
448
|
-
code,
|
|
449
|
-
message,
|
|
450
|
-
status === 404 ? 404 : 502
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
__name(githubRequestError, "githubRequestError");
|
|
454
|
-
async function fetchBytes(url, githubToken) {
|
|
455
|
-
const response = await fetch(url, {
|
|
456
|
-
headers: {
|
|
457
|
-
Accept: "application/vnd.github+json",
|
|
458
|
-
"User-Agent": "qwen-code",
|
|
459
|
-
...githubToken ? { Authorization: `Bearer ${githubToken}` } : {}
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
if (!response.ok) {
|
|
463
|
-
throw githubRequestError(
|
|
464
|
-
"github_skill_download_failed",
|
|
465
|
-
response.status,
|
|
466
|
-
"Skill file"
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
const declared = Number(response.headers.get("content-length"));
|
|
470
|
-
if (Number.isFinite(declared) && declared > MAX_FILE_BYTES) {
|
|
471
|
-
skillError("skill_package_too_large", "Skill file is too large", 413);
|
|
472
|
-
}
|
|
473
|
-
if (!response.body) return Buffer.alloc(0);
|
|
474
|
-
const reader = response.body.getReader();
|
|
475
|
-
const chunks = [];
|
|
476
|
-
let size = 0;
|
|
477
|
-
try {
|
|
478
|
-
while (true) {
|
|
479
|
-
const { done, value } = await reader.read();
|
|
480
|
-
if (done) break;
|
|
481
|
-
size += value.byteLength;
|
|
482
|
-
if (size > MAX_FILE_BYTES) {
|
|
483
|
-
await reader.cancel().catch(() => void 0);
|
|
484
|
-
skillError("skill_package_too_large", "Skill file is too large", 413);
|
|
485
|
-
}
|
|
486
|
-
chunks.push(Buffer.from(value));
|
|
487
|
-
}
|
|
488
|
-
} finally {
|
|
489
|
-
reader.releaseLock();
|
|
490
|
-
}
|
|
491
|
-
return Buffer.concat(chunks, size);
|
|
492
|
-
}
|
|
493
|
-
__name(fetchBytes, "fetchBytes");
|
|
494
|
-
async function downloadGitHubDirectory(owner, repo, ref, directory, githubToken, relativeRoot = "", depth = 0, state = {
|
|
495
|
-
files: [],
|
|
496
|
-
totalBytes: 0
|
|
497
|
-
}) {
|
|
498
|
-
if (depth > MAX_PATH_DEPTH)
|
|
499
|
-
skillError("invalid_skill_package", "GitHub Skill is nested too deeply");
|
|
500
|
-
const encodedDirectory = directory.split("/").filter(Boolean).map(encodeURIComponent).join("/");
|
|
501
|
-
const apiUrl = `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/contents${encodedDirectory ? `/${encodedDirectory}` : ""}?ref=${encodeURIComponent(ref)}`;
|
|
502
|
-
const response = await fetch(apiUrl, {
|
|
503
|
-
headers: {
|
|
504
|
-
Accept: "application/vnd.github+json",
|
|
505
|
-
"User-Agent": "qwen-code",
|
|
506
|
-
...githubToken ? { Authorization: `Bearer ${githubToken}` } : {}
|
|
507
|
-
}
|
|
508
|
-
});
|
|
509
|
-
if (!response.ok) {
|
|
510
|
-
throw githubRequestError(
|
|
511
|
-
"github_api_failed",
|
|
512
|
-
response.status,
|
|
513
|
-
"Skill path"
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
|
-
const items = await response.json();
|
|
517
|
-
if (!Array.isArray(items))
|
|
518
|
-
skillError("invalid_skill_source", "GitHub URL must point to SKILL.md");
|
|
519
|
-
for (const item of items) {
|
|
520
|
-
if (!item || typeof item !== "object") continue;
|
|
521
|
-
const record = item;
|
|
522
|
-
const itemName = typeof record["name"] === "string" ? record["name"] : "";
|
|
523
|
-
const itemPath = typeof record["path"] === "string" ? record["path"] : "";
|
|
524
|
-
const itemType = typeof record["type"] === "string" ? record["type"] : "";
|
|
525
|
-
const relativePath = relativeRoot ? `${relativeRoot}/${itemName}` : itemName;
|
|
526
|
-
if (itemType === "dir") {
|
|
527
|
-
await downloadGitHubDirectory(
|
|
528
|
-
owner,
|
|
529
|
-
repo,
|
|
530
|
-
ref,
|
|
531
|
-
itemPath,
|
|
532
|
-
githubToken,
|
|
533
|
-
relativePath,
|
|
534
|
-
depth + 1,
|
|
535
|
-
state
|
|
536
|
-
);
|
|
537
|
-
} else if (itemType === "file") {
|
|
538
|
-
const downloadUrl = record["download_url"];
|
|
539
|
-
if (typeof downloadUrl !== "string") continue;
|
|
540
|
-
const parsedDownloadUrl = new URL(downloadUrl);
|
|
541
|
-
if (parsedDownloadUrl.protocol !== "https:" || parsedDownloadUrl.hostname !== "raw.githubusercontent.com") {
|
|
542
|
-
skillError(
|
|
543
|
-
"github_skill_download_failed",
|
|
544
|
-
"GitHub returned an invalid Skill file URL",
|
|
545
|
-
502
|
|
546
|
-
);
|
|
547
|
-
}
|
|
548
|
-
const content = await fetchBytes(downloadUrl, githubToken);
|
|
549
|
-
state.files.push({ relativePath, content });
|
|
550
|
-
state.totalBytes += content.length;
|
|
551
|
-
if (state.files.length > MAX_FILES)
|
|
552
|
-
skillError("invalid_skill_package", "Skill package has too many files");
|
|
553
|
-
if (state.totalBytes > MAX_TOTAL_BYTES) {
|
|
554
|
-
skillError(
|
|
555
|
-
"skill_package_too_large",
|
|
556
|
-
"Skill package exceeds the allowed size",
|
|
557
|
-
413
|
|
558
|
-
);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
return state.files;
|
|
563
|
-
}
|
|
564
|
-
__name(downloadGitHubDirectory, "downloadGitHubDirectory");
|
|
565
|
-
async function downloadGitHubDirectoryWithGit(owner, repo, ref, directory) {
|
|
566
|
-
const checkout = await fs.mkdtemp(path.join(os.tmpdir(), "qwen-skill-git-"));
|
|
567
|
-
try {
|
|
568
|
-
await execFileAsync(
|
|
569
|
-
"git",
|
|
570
|
-
[
|
|
571
|
-
"clone",
|
|
572
|
-
"--depth",
|
|
573
|
-
"1",
|
|
574
|
-
"--filter=blob:none",
|
|
575
|
-
"--sparse",
|
|
576
|
-
"--branch",
|
|
577
|
-
ref,
|
|
578
|
-
`https://github.com/${owner}/${repo}.git`,
|
|
579
|
-
checkout
|
|
580
|
-
],
|
|
581
|
-
{ timeout: 6e4, maxBuffer: 1024 * 1024 }
|
|
582
|
-
);
|
|
583
|
-
if (directory) {
|
|
584
|
-
await execFileAsync(
|
|
585
|
-
"git",
|
|
586
|
-
["-C", checkout, "sparse-checkout", "set", "--cone", directory],
|
|
587
|
-
{ timeout: 3e4, maxBuffer: 1024 * 1024 }
|
|
588
|
-
);
|
|
589
|
-
} else {
|
|
590
|
-
await execFileAsync(
|
|
591
|
-
"git",
|
|
592
|
-
["-C", checkout, "sparse-checkout", "disable"],
|
|
593
|
-
{ timeout: 3e4, maxBuffer: 1024 * 1024 }
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
|
-
return await filesFromFolder(path.join(checkout, directory));
|
|
597
|
-
} catch (error) {
|
|
598
|
-
if (error instanceof WorkspaceSkillManagementError) throw error;
|
|
599
|
-
throw new WorkspaceSkillManagementError(
|
|
600
|
-
"github_skill_download_failed",
|
|
601
|
-
`Failed to download GitHub Skill: ${error instanceof Error ? error.message : String(error)}`,
|
|
602
|
-
502
|
|
603
|
-
);
|
|
604
|
-
} finally {
|
|
605
|
-
await fs.rm(checkout, { recursive: true, force: true });
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
__name(downloadGitHubDirectoryWithGit, "downloadGitHubDirectoryWithGit");
|
|
609
|
-
async function downloadGitHubSkill(sourceUrl, githubToken) {
|
|
610
|
-
let url;
|
|
611
|
-
try {
|
|
612
|
-
url = new URL(sourceUrl);
|
|
613
|
-
} catch {
|
|
614
|
-
skillError("invalid_skill_source", "Invalid GitHub Skill URL");
|
|
615
|
-
}
|
|
616
|
-
if (url.protocol !== "https:")
|
|
617
|
-
skillError("invalid_skill_source", "GitHub URL must use HTTPS");
|
|
618
|
-
if (url.hostname === "raw.githubusercontent.com") {
|
|
619
|
-
if (!url.pathname.endsWith("/SKILL.md")) {
|
|
620
|
-
skillError("invalid_skill_source", "GitHub URL must point to SKILL.md");
|
|
621
|
-
}
|
|
622
|
-
return [
|
|
623
|
-
{
|
|
624
|
-
relativePath: "SKILL.md",
|
|
625
|
-
content: await fetchBytes(url.toString(), githubToken)
|
|
626
|
-
}
|
|
627
|
-
];
|
|
628
|
-
}
|
|
629
|
-
if (url.hostname !== "github.com") {
|
|
630
|
-
skillError("invalid_skill_source", "Only GitHub Skill URLs are supported");
|
|
631
|
-
}
|
|
632
|
-
let segments;
|
|
633
|
-
try {
|
|
634
|
-
segments = url.pathname.split("/").filter(Boolean).map(decodeURIComponent);
|
|
635
|
-
} catch {
|
|
636
|
-
skillError("invalid_skill_source", "Invalid GitHub Skill URL");
|
|
637
|
-
}
|
|
638
|
-
if (segments.length < 5 || segments[2] !== "blob" || segments.at(-1) !== "SKILL.md") {
|
|
639
|
-
skillError(
|
|
640
|
-
"invalid_skill_source",
|
|
641
|
-
"GitHub URL must point to a repository SKILL.md file"
|
|
642
|
-
);
|
|
643
|
-
}
|
|
644
|
-
const [owner, repo, , ref, ...filePath] = segments;
|
|
645
|
-
if (!owner || !repo || !ref || ref.startsWith("-") || !/^[A-Za-z0-9._/+-]+$/.test(ref) || !/^[A-Za-z0-9._-]+$/.test(owner) || !/^[A-Za-z0-9._-]+$/.test(repo)) {
|
|
646
|
-
skillError("invalid_skill_source", "Invalid GitHub Skill URL");
|
|
647
|
-
}
|
|
648
|
-
const directory = filePath.slice(0, -1).join("/");
|
|
649
|
-
const directorySegments = directory.split("/");
|
|
650
|
-
if (directory && (directory.length > MAX_PATH_LENGTH || directory.includes("\\") || directory.startsWith("/") || directorySegments.length > MAX_PATH_DEPTH || directorySegments.some(
|
|
651
|
-
(segment) => !segment || segment === "." || segment === ".."
|
|
652
|
-
))) {
|
|
653
|
-
skillError("invalid_skill_source", "Invalid GitHub Skill URL path");
|
|
654
|
-
}
|
|
655
|
-
try {
|
|
656
|
-
return await downloadGitHubDirectory(
|
|
657
|
-
owner,
|
|
658
|
-
repo,
|
|
659
|
-
ref,
|
|
660
|
-
directory,
|
|
661
|
-
githubToken
|
|
662
|
-
);
|
|
663
|
-
} catch (error) {
|
|
664
|
-
if (!(error instanceof WorkspaceSkillManagementError) || error.code !== "github_api_failed" || error.statusCode === 404) {
|
|
665
|
-
throw error;
|
|
666
|
-
}
|
|
667
|
-
return downloadGitHubDirectoryWithGit(owner, repo, ref, directory);
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
__name(downloadGitHubSkill, "downloadGitHubSkill");
|
|
671
|
-
function openZip(content) {
|
|
672
|
-
return new Promise((resolve3, reject) => {
|
|
673
|
-
(0, import_yauzl.fromBuffer)(content, { lazyEntries: true }, (error, zipFile) => {
|
|
674
|
-
if (error) reject(error);
|
|
675
|
-
else resolve3(zipFile);
|
|
676
|
-
});
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
__name(openZip, "openZip");
|
|
680
|
-
function readZipEntry(zipFile, entry) {
|
|
681
|
-
return new Promise((resolve3, reject) => {
|
|
682
|
-
zipFile.openReadStream(entry, (error, stream) => {
|
|
683
|
-
if (error) {
|
|
684
|
-
reject(error);
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
const chunks = [];
|
|
688
|
-
let size = 0;
|
|
689
|
-
stream.on("data", (chunk) => {
|
|
690
|
-
size += chunk.length;
|
|
691
|
-
if (size > MAX_FILE_BYTES) {
|
|
692
|
-
stream.destroy(
|
|
693
|
-
new WorkspaceSkillManagementError(
|
|
694
|
-
"skill_package_too_large",
|
|
695
|
-
`Skill ZIP entry is too large: ${entry.fileName}`,
|
|
696
|
-
413
|
|
697
|
-
)
|
|
698
|
-
);
|
|
699
|
-
} else {
|
|
700
|
-
chunks.push(chunk);
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
stream.on("error", reject);
|
|
704
|
-
stream.on("end", () => resolve3(Buffer.concat(chunks)));
|
|
705
|
-
});
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
__name(readZipEntry, "readZipEntry");
|
|
709
|
-
async function filesFromZip(content) {
|
|
710
|
-
const zipFile = await openZip(content);
|
|
711
|
-
const files = [];
|
|
712
|
-
let totalBytes = 0;
|
|
713
|
-
return new Promise((resolve3, reject) => {
|
|
714
|
-
let settled = false;
|
|
715
|
-
const finish = /* @__PURE__ */ __name((error) => {
|
|
716
|
-
if (settled) return;
|
|
717
|
-
settled = true;
|
|
718
|
-
zipFile.close();
|
|
719
|
-
if (error) reject(error);
|
|
720
|
-
else resolve3(files);
|
|
721
|
-
}, "finish");
|
|
722
|
-
zipFile.on("error", finish);
|
|
723
|
-
zipFile.on("entry", (entry) => {
|
|
724
|
-
const mode = entry.externalFileAttributes >>> 16 & 65535;
|
|
725
|
-
const fileType = mode & 61440;
|
|
726
|
-
if (fileType === 40960) {
|
|
727
|
-
finish(new Error("Skill ZIP contains a symbolic link"));
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
if (entry.generalPurposeBitFlag & 1) {
|
|
731
|
-
finish(new Error("Encrypted Skill ZIP entries are not supported"));
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
if (entry.fileName.endsWith("/") || fileType === 16384) {
|
|
735
|
-
zipFile.readEntry();
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
if (files.length >= MAX_FILES) {
|
|
739
|
-
finish(
|
|
740
|
-
new WorkspaceSkillManagementError(
|
|
741
|
-
"invalid_skill_package",
|
|
742
|
-
"Skill ZIP contains too many files"
|
|
743
|
-
)
|
|
744
|
-
);
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
if (entry.uncompressedSize > MAX_FILE_BYTES) {
|
|
748
|
-
finish(
|
|
749
|
-
new WorkspaceSkillManagementError(
|
|
750
|
-
"skill_package_too_large",
|
|
751
|
-
"Skill ZIP entry exceeds the allowed size",
|
|
752
|
-
413
|
|
753
|
-
)
|
|
754
|
-
);
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
if (totalBytes + entry.uncompressedSize > MAX_TOTAL_BYTES) {
|
|
758
|
-
finish(
|
|
759
|
-
new WorkspaceSkillManagementError(
|
|
760
|
-
"skill_package_too_large",
|
|
761
|
-
"Skill ZIP expands beyond the allowed size",
|
|
762
|
-
413
|
|
763
|
-
)
|
|
764
|
-
);
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
void readZipEntry(zipFile, entry).then((entryContent) => {
|
|
768
|
-
totalBytes += entryContent.length;
|
|
769
|
-
if (totalBytes > MAX_TOTAL_BYTES) {
|
|
770
|
-
finish(
|
|
771
|
-
new WorkspaceSkillManagementError(
|
|
772
|
-
"skill_package_too_large",
|
|
773
|
-
"Skill ZIP expands beyond the allowed size",
|
|
774
|
-
413
|
|
775
|
-
)
|
|
776
|
-
);
|
|
777
|
-
return;
|
|
778
|
-
}
|
|
779
|
-
files.push({ relativePath: entry.fileName, content: entryContent });
|
|
780
|
-
if (!settled) zipFile.readEntry();
|
|
781
|
-
}, finish);
|
|
782
|
-
});
|
|
783
|
-
zipFile.on("end", () => finish());
|
|
784
|
-
zipFile.readEntry();
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
__name(filesFromZip, "filesFromZip");
|
|
788
|
-
async function filesFromSource(source, githubToken) {
|
|
789
|
-
try {
|
|
790
|
-
if (source.type === "github")
|
|
791
|
-
return normalizePackageFiles(
|
|
792
|
-
await downloadGitHubSkill(source.url, githubToken)
|
|
793
|
-
);
|
|
794
|
-
if (source.type === "folder")
|
|
795
|
-
return normalizePackageFiles(await filesFromFolder(source.path));
|
|
796
|
-
const archive = decodeBase64(source.contentBase64);
|
|
797
|
-
return normalizePackageFiles(await filesFromZip(archive));
|
|
798
|
-
} catch (error) {
|
|
799
|
-
if (error instanceof WorkspaceSkillManagementError) throw error;
|
|
800
|
-
const code = source.type === "github" ? "github_skill_download_failed" : source.type === "folder" ? "invalid_skill_folder" : "invalid_skill_package";
|
|
801
|
-
throw new WorkspaceSkillManagementError(
|
|
802
|
-
code,
|
|
803
|
-
error instanceof Error ? error.message : String(error),
|
|
804
|
-
source.type === "github" ? 502 : 400
|
|
805
|
-
);
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
__name(filesFromSource, "filesFromSource");
|
|
809
|
-
async function filesFromFolder(folderPath) {
|
|
810
|
-
if (!path.isAbsolute(folderPath)) {
|
|
811
|
-
skillError("invalid_skill_folder", "Skill folder path must be absolute");
|
|
812
|
-
}
|
|
813
|
-
if ((await fs.lstat(folderPath)).isSymbolicLink()) {
|
|
814
|
-
skillError(
|
|
815
|
-
"invalid_skill_folder",
|
|
816
|
-
"Skill folder path must not be a symbolic link"
|
|
817
|
-
);
|
|
818
|
-
}
|
|
819
|
-
const root = await fs.realpath(folderPath);
|
|
820
|
-
if (!(await fs.stat(root)).isDirectory()) {
|
|
821
|
-
skillError(
|
|
822
|
-
"invalid_skill_folder",
|
|
823
|
-
"Skill folder path must point to a directory"
|
|
824
|
-
);
|
|
825
|
-
}
|
|
826
|
-
const files = [];
|
|
827
|
-
let totalBytes = 0;
|
|
828
|
-
const visit = /* @__PURE__ */ __name(async (directory, relativeRoot = "", depth = 0) => {
|
|
829
|
-
if (depth > MAX_PATH_DEPTH)
|
|
830
|
-
skillError("invalid_skill_package", "Skill folder is nested too deeply");
|
|
831
|
-
for (const entry of await fs.readdir(directory, { withFileTypes: true })) {
|
|
832
|
-
if (depth === 0 && entry.name === ".git") continue;
|
|
833
|
-
const absolutePath = path.join(directory, entry.name);
|
|
834
|
-
const relativePath = relativeRoot ? `${relativeRoot}/${entry.name}` : entry.name;
|
|
835
|
-
if (entry.isSymbolicLink()) {
|
|
836
|
-
skillError(
|
|
837
|
-
"unsafe_skill_path",
|
|
838
|
-
"Skill folder contains a symbolic link"
|
|
839
|
-
);
|
|
840
|
-
}
|
|
841
|
-
if (entry.isDirectory()) {
|
|
842
|
-
await visit(absolutePath, relativePath, depth + 1);
|
|
843
|
-
continue;
|
|
844
|
-
}
|
|
845
|
-
if (!entry.isFile())
|
|
846
|
-
skillError("unsafe_skill_path", "Skill folder contains a special file");
|
|
847
|
-
if (files.length >= MAX_FILES) {
|
|
848
|
-
skillError("invalid_skill_package", "Skill package has too many files");
|
|
849
|
-
}
|
|
850
|
-
const stats = await fs.lstat(absolutePath);
|
|
851
|
-
if (stats.isSymbolicLink() || !stats.isFile()) {
|
|
852
|
-
skillError("unsafe_skill_path", "Skill folder contains an unsafe file");
|
|
853
|
-
}
|
|
854
|
-
if (stats.size > MAX_FILE_BYTES) {
|
|
855
|
-
skillError(
|
|
856
|
-
"skill_package_too_large",
|
|
857
|
-
`Skill file is too large: ${relativePath}`,
|
|
858
|
-
413
|
|
859
|
-
);
|
|
860
|
-
}
|
|
861
|
-
totalBytes += stats.size;
|
|
862
|
-
if (totalBytes > MAX_TOTAL_BYTES) {
|
|
863
|
-
skillError(
|
|
864
|
-
"skill_package_too_large",
|
|
865
|
-
"Skill package exceeds the allowed size",
|
|
866
|
-
413
|
|
867
|
-
);
|
|
868
|
-
}
|
|
869
|
-
const content = await fs.readFile(absolutePath);
|
|
870
|
-
if (content.length !== stats.size) {
|
|
871
|
-
skillError(
|
|
872
|
-
"invalid_skill_package",
|
|
873
|
-
`Skill file changed while reading: ${relativePath}`
|
|
874
|
-
);
|
|
875
|
-
}
|
|
876
|
-
files.push({ relativePath, content });
|
|
877
|
-
}
|
|
878
|
-
}, "visit");
|
|
879
|
-
await visit(root);
|
|
880
|
-
return files;
|
|
881
|
-
}
|
|
882
|
-
__name(filesFromFolder, "filesFromFolder");
|
|
883
|
-
function skillBaseDir(workspace, scope) {
|
|
884
|
-
return scope === "workspace" ? path.join(workspace, ".qwen", "skills") : path.join(Storage.getGlobalQwenDir(), "skills");
|
|
885
|
-
}
|
|
886
|
-
__name(skillBaseDir, "skillBaseDir");
|
|
887
|
-
async function removeInstallArtifacts(baseDir, skillName) {
|
|
888
|
-
const workDir = path.dirname(baseDir);
|
|
889
|
-
const workPrefix = `.${path.basename(baseDir)}-${skillName}`;
|
|
890
|
-
const locations = [
|
|
891
|
-
{
|
|
892
|
-
directory: baseDir,
|
|
893
|
-
prefixes: [`.${skillName}.installing-`, `.${skillName}.backup-`]
|
|
894
|
-
},
|
|
895
|
-
{
|
|
896
|
-
directory: workDir,
|
|
897
|
-
prefixes: [`${workPrefix}.installing-`, `${workPrefix}.backup-`]
|
|
898
|
-
}
|
|
899
|
-
];
|
|
900
|
-
for (const { directory, prefixes } of locations) {
|
|
901
|
-
const entries = await fs.readdir(directory, { withFileTypes: true });
|
|
902
|
-
await Promise.all(
|
|
903
|
-
entries.filter(
|
|
904
|
-
(entry) => prefixes.some((prefix) => entry.name.startsWith(prefix))
|
|
905
|
-
).map(
|
|
906
|
-
(entry) => fs.rm(path.join(directory, entry.name), {
|
|
907
|
-
recursive: true,
|
|
908
|
-
force: true
|
|
909
|
-
})
|
|
910
|
-
)
|
|
911
|
-
);
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
__name(removeInstallArtifacts, "removeInstallArtifacts");
|
|
915
|
-
async function ensureDirectoryWithoutSymlinks(directory) {
|
|
916
|
-
const missing = [];
|
|
917
|
-
let current = directory;
|
|
918
|
-
while (true) {
|
|
919
|
-
try {
|
|
920
|
-
const stats = await fs.lstat(current);
|
|
921
|
-
if (stats.isSymbolicLink() || !stats.isDirectory()) {
|
|
922
|
-
skillError("unsafe_skill_path", `Unsafe Skill directory: ${current}`);
|
|
923
|
-
}
|
|
924
|
-
break;
|
|
925
|
-
} catch (error) {
|
|
926
|
-
if (error.code !== "ENOENT") throw error;
|
|
927
|
-
missing.push(current);
|
|
928
|
-
const parent = path.dirname(current);
|
|
929
|
-
if (parent === current) throw error;
|
|
930
|
-
current = parent;
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
for (const entry of missing.reverse()) await fs.mkdir(entry);
|
|
934
|
-
}
|
|
935
|
-
__name(ensureDirectoryWithoutSymlinks, "ensureDirectoryWithoutSymlinks");
|
|
936
|
-
async function installWorkspaceSkill(workspace, request, githubToken) {
|
|
937
|
-
const skillName = validateWorkspaceSkillName(request.name);
|
|
938
|
-
const files = await filesFromSource(request.source, githubToken);
|
|
939
|
-
const baseDir = skillBaseDir(workspace, request.scope);
|
|
940
|
-
await ensureDirectoryWithoutSymlinks(baseDir);
|
|
941
|
-
await removeInstallArtifacts(baseDir, skillName);
|
|
942
|
-
const destination = path.join(baseDir, skillName);
|
|
943
|
-
const existing = await fs.lstat(destination).catch(() => void 0);
|
|
944
|
-
if (existing?.isSymbolicLink() || existing && !existing.isDirectory()) {
|
|
945
|
-
skillError("unsafe_skill_path", "Refusing to replace an unsafe Skill path");
|
|
946
|
-
}
|
|
947
|
-
const workDir = path.dirname(baseDir);
|
|
948
|
-
const workPrefix = `.${path.basename(baseDir)}-${skillName}`;
|
|
949
|
-
const staging = await fs.mkdtemp(
|
|
950
|
-
path.join(workDir, `${workPrefix}.installing-`)
|
|
951
|
-
);
|
|
952
|
-
const backup = path.join(workDir, `${workPrefix}.backup-${Date.now()}`);
|
|
953
|
-
let movedExisting = false;
|
|
954
|
-
try {
|
|
955
|
-
for (const file of files) {
|
|
956
|
-
const target = path.join(staging, ...file.relativePath.split("/"));
|
|
957
|
-
await fs.mkdir(path.dirname(target), { recursive: true });
|
|
958
|
-
await fs.writeFile(target, file.content);
|
|
959
|
-
}
|
|
960
|
-
const skillFile = path.join(staging, "SKILL.md");
|
|
961
|
-
let parsed;
|
|
962
|
-
try {
|
|
963
|
-
parsed = new SkillManager({}).parseSkillContent(
|
|
964
|
-
await fs.readFile(skillFile, "utf8"),
|
|
965
|
-
skillFile,
|
|
966
|
-
request.scope === "workspace" ? "project" : "user"
|
|
967
|
-
);
|
|
968
|
-
} catch (error) {
|
|
969
|
-
throw new WorkspaceSkillManagementError(
|
|
970
|
-
"invalid_skill_manifest",
|
|
971
|
-
error instanceof Error ? error.message : String(error)
|
|
972
|
-
);
|
|
973
|
-
}
|
|
974
|
-
if (parsed.name !== skillName) {
|
|
975
|
-
skillError(
|
|
976
|
-
"skill_name_mismatch",
|
|
977
|
-
`Skill name "${parsed.name}" does not match requested name "${skillName}"`
|
|
978
|
-
);
|
|
979
|
-
}
|
|
980
|
-
if (existing) {
|
|
981
|
-
await fs.rename(destination, backup);
|
|
982
|
-
movedExisting = true;
|
|
983
|
-
}
|
|
984
|
-
await fs.rename(staging, destination);
|
|
985
|
-
} catch (error) {
|
|
986
|
-
await fs.rm(staging, { recursive: true, force: true }).catch(() => void 0);
|
|
987
|
-
if (movedExisting) {
|
|
988
|
-
await fs.rename(backup, destination).catch(() => void 0);
|
|
989
|
-
}
|
|
990
|
-
throw error;
|
|
991
|
-
}
|
|
992
|
-
if (movedExisting) {
|
|
993
|
-
await fs.rm(backup, { recursive: true, force: true }).catch(() => void 0);
|
|
994
|
-
}
|
|
995
|
-
return {
|
|
996
|
-
skillName,
|
|
997
|
-
scope: request.scope,
|
|
998
|
-
installedPath: path.join(destination, "SKILL.md")
|
|
999
|
-
};
|
|
1000
|
-
}
|
|
1001
|
-
__name(installWorkspaceSkill, "installWorkspaceSkill");
|
|
1002
|
-
async function deleteWorkspaceSkill(workspace, scope, skillNameInput, installedPath) {
|
|
1003
|
-
const skillName = validateWorkspaceSkillName(skillNameInput);
|
|
1004
|
-
const skillDir = path.resolve(path.dirname(installedPath));
|
|
1005
|
-
const skillFile = path.resolve(installedPath);
|
|
1006
|
-
const allowedBaseDirs = new SkillManager({
|
|
1007
|
-
getProjectRoot: /* @__PURE__ */ __name(() => workspace, "getProjectRoot")
|
|
1008
|
-
}).getSkillsBaseDirs(scope === "workspace" ? "project" : "user").map((directory) => path.resolve(directory));
|
|
1009
|
-
const baseDir = path.dirname(skillDir);
|
|
1010
|
-
if (skillFile !== path.join(skillDir, "SKILL.md") || !allowedBaseDirs.includes(baseDir) || path.basename(skillDir) !== skillName) {
|
|
1011
|
-
skillError(
|
|
1012
|
-
"skill_not_managed",
|
|
1013
|
-
"Skill is not managed in the requested scope",
|
|
1014
|
-
409
|
|
1015
|
-
);
|
|
1016
|
-
}
|
|
1017
|
-
const baseRealPath = await fs.realpath(baseDir);
|
|
1018
|
-
const skillDirStats = await fs.lstat(skillDir);
|
|
1019
|
-
const skillFileStats = await fs.lstat(skillFile);
|
|
1020
|
-
if (skillDirStats.isSymbolicLink() || !skillDirStats.isDirectory() || skillFileStats.isSymbolicLink() || !skillFileStats.isFile()) {
|
|
1021
|
-
skillError("unsafe_skill_path", "Refusing to delete an unsafe Skill path");
|
|
1022
|
-
}
|
|
1023
|
-
const skillDirRealPath = await fs.realpath(skillDir);
|
|
1024
|
-
if (path.dirname(skillDirRealPath) !== baseRealPath) {
|
|
1025
|
-
skillError("unsafe_skill_path", "Refusing to delete an unsafe Skill path");
|
|
1026
|
-
}
|
|
1027
|
-
const parsed = new SkillManager({}).parseSkillContent(
|
|
1028
|
-
await fs.readFile(skillFile, "utf8"),
|
|
1029
|
-
skillFile,
|
|
1030
|
-
scope === "workspace" ? "project" : "user"
|
|
1031
|
-
);
|
|
1032
|
-
if (parsed.name !== skillName) {
|
|
1033
|
-
skillError(
|
|
1034
|
-
"skill_name_mismatch",
|
|
1035
|
-
"Skill name does not match its installed directory"
|
|
1036
|
-
);
|
|
1037
|
-
}
|
|
1038
|
-
await fs.rm(skillDir, { recursive: true, force: true });
|
|
1039
|
-
return { skillName, scope, deleted: true };
|
|
1040
|
-
}
|
|
1041
|
-
__name(deleteWorkspaceSkill, "deleteWorkspaceSkill");
|
|
1042
|
-
|
|
1043
309
|
// packages/cli/src/serve/workspace-service/index.ts
|
|
1044
310
|
async function canonicalizeExistingAncestor(inputPath) {
|
|
1045
311
|
let current = inputPath;
|
|
1046
312
|
while (true) {
|
|
1047
313
|
try {
|
|
1048
|
-
return await
|
|
314
|
+
return await fs.realpath(current);
|
|
1049
315
|
} catch (err) {
|
|
1050
316
|
const code = err?.code;
|
|
1051
317
|
if (code !== "ENOENT" && code !== "ENOTDIR" && code !== "ELOOP") {
|
|
1052
318
|
throw err;
|
|
1053
319
|
}
|
|
1054
|
-
const parent =
|
|
320
|
+
const parent = path.dirname(current);
|
|
1055
321
|
if (parent === current) throw err;
|
|
1056
322
|
current = parent;
|
|
1057
323
|
}
|
|
@@ -1060,9 +326,9 @@ async function canonicalizeExistingAncestor(inputPath) {
|
|
|
1060
326
|
__name(canonicalizeExistingAncestor, "canonicalizeExistingAncestor");
|
|
1061
327
|
async function verifyParentPostOpen(target, wsCanonical, _fh) {
|
|
1062
328
|
const parentCanonical = await canonicalizeExistingAncestor(
|
|
1063
|
-
|
|
329
|
+
path.dirname(target)
|
|
1064
330
|
);
|
|
1065
|
-
const within = parentCanonical === wsCanonical || parentCanonical.startsWith(wsCanonical +
|
|
331
|
+
const within = parentCanonical === wsCanonical || parentCanonical.startsWith(wsCanonical + path.sep);
|
|
1066
332
|
if (within) return;
|
|
1067
333
|
throw new WorkspaceInitSymlinkError(
|
|
1068
334
|
target,
|
|
@@ -1077,14 +343,14 @@ var TimeoutError = class extends Error {
|
|
|
1077
343
|
}
|
|
1078
344
|
};
|
|
1079
345
|
async function withTimeout(promise, timeoutMs, label) {
|
|
1080
|
-
return await new Promise((
|
|
346
|
+
return await new Promise((resolve2, reject) => {
|
|
1081
347
|
const timeout = setTimeout(() => {
|
|
1082
348
|
reject(new TimeoutError(`${label} timed out after ${timeoutMs}ms`));
|
|
1083
349
|
}, timeoutMs);
|
|
1084
350
|
promise.then(
|
|
1085
351
|
(value) => {
|
|
1086
352
|
clearTimeout(timeout);
|
|
1087
|
-
|
|
353
|
+
resolve2(value);
|
|
1088
354
|
},
|
|
1089
355
|
(err) => {
|
|
1090
356
|
clearTimeout(timeout);
|
|
@@ -1106,7 +372,6 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1106
372
|
persistDisabledSkills,
|
|
1107
373
|
persistSetting,
|
|
1108
374
|
persistSettings,
|
|
1109
|
-
skillInstallEnv,
|
|
1110
375
|
voiceEnv,
|
|
1111
376
|
voiceSettingsScope,
|
|
1112
377
|
preheatAcpChild: preheatAcpChildOnBridge,
|
|
@@ -1146,23 +411,6 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1146
411
|
}
|
|
1147
412
|
return status;
|
|
1148
413
|
}, "getWorkspaceSkillsStatus");
|
|
1149
|
-
const refreshWorkspaceSkillsAfterMutation = /* @__PURE__ */ __name(async () => {
|
|
1150
|
-
lastWorkspaceSkillsStatus = void 0;
|
|
1151
|
-
workspaceSkillsStatusProvider?.invalidate?.(boundWorkspace);
|
|
1152
|
-
if (!(isChannelLive?.() ?? false)) return;
|
|
1153
|
-
try {
|
|
1154
|
-
await invokeWorkspaceCommand(
|
|
1155
|
-
SERVE_CONTROL_EXT_METHODS.workspaceSkillsRefresh,
|
|
1156
|
-
{ cwd: boundWorkspace }
|
|
1157
|
-
);
|
|
1158
|
-
} catch (err) {
|
|
1159
|
-
if (!(err instanceof SessionNotFoundError) && !(err instanceof BridgeChannelClosedError)) {
|
|
1160
|
-
writeStderrLine(
|
|
1161
|
-
`qwen serve: workspace skill refresh after mutation failed: ${err instanceof Error ? err.message : String(err)}`
|
|
1162
|
-
);
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}, "refreshWorkspaceSkillsAfterMutation");
|
|
1166
414
|
return {
|
|
1167
415
|
// -- Status queries (delegate to ACP child via queryWorkspaceStatus) --
|
|
1168
416
|
async getWorkspaceMcpStatus(_ctx) {
|
|
@@ -1502,7 +750,6 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1502
750
|
let sessionsFailed = 0;
|
|
1503
751
|
if (persisted.changed) {
|
|
1504
752
|
lastWorkspaceSkillsStatus = void 0;
|
|
1505
|
-
workspaceSkillsStatusProvider?.invalidate?.(boundWorkspace);
|
|
1506
753
|
if (channelLive) {
|
|
1507
754
|
try {
|
|
1508
755
|
const refreshed = await invokeWorkspaceCommand(
|
|
@@ -1543,51 +790,18 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1543
790
|
sessionsFailed
|
|
1544
791
|
};
|
|
1545
792
|
},
|
|
1546
|
-
async installWorkspaceSkill(_ctx, request) {
|
|
1547
|
-
const result = await installWorkspaceSkill(
|
|
1548
|
-
boundWorkspace,
|
|
1549
|
-
request,
|
|
1550
|
-
skillInstallEnv?.["GH_TOKEN"] ?? skillInstallEnv?.["GITHUB_TOKEN"]
|
|
1551
|
-
);
|
|
1552
|
-
await refreshWorkspaceSkillsAfterMutation();
|
|
1553
|
-
return result;
|
|
1554
|
-
},
|
|
1555
|
-
async deleteWorkspaceSkill(_ctx, requestedSkillName, scope) {
|
|
1556
|
-
const normalizedName = requestedSkillName.trim().toLowerCase();
|
|
1557
|
-
const status = await getWorkspaceSkillsStatus();
|
|
1558
|
-
const skill = status.skills.find(
|
|
1559
|
-
(candidate) => candidate.name.trim().toLowerCase() === normalizedName
|
|
1560
|
-
);
|
|
1561
|
-
if (!skill) throw new WorkspaceSkillNotFoundError(requestedSkillName);
|
|
1562
|
-
const expectedLevel = scope === "workspace" ? "project" : "user";
|
|
1563
|
-
if (skill.level !== expectedLevel || !skill.installedPath) {
|
|
1564
|
-
throw new WorkspaceSkillManagementError(
|
|
1565
|
-
"skill_not_managed",
|
|
1566
|
-
"Skill is not managed in the requested scope",
|
|
1567
|
-
409
|
|
1568
|
-
);
|
|
1569
|
-
}
|
|
1570
|
-
const result = await deleteWorkspaceSkill(
|
|
1571
|
-
boundWorkspace,
|
|
1572
|
-
scope,
|
|
1573
|
-
skill.name,
|
|
1574
|
-
skill.installedPath
|
|
1575
|
-
);
|
|
1576
|
-
await refreshWorkspaceSkillsAfterMutation();
|
|
1577
|
-
return result;
|
|
1578
|
-
},
|
|
1579
793
|
async initWorkspace(ctx, opts) {
|
|
1580
794
|
const filename = contextFilename;
|
|
1581
|
-
const target =
|
|
1582
|
-
const withinWorkspace = target === boundWorkspace || target.startsWith(boundWorkspace +
|
|
795
|
+
const target = path.resolve(boundWorkspace, filename);
|
|
796
|
+
const withinWorkspace = target === boundWorkspace || target.startsWith(boundWorkspace + path.sep);
|
|
1583
797
|
if (!withinWorkspace) {
|
|
1584
798
|
throw new WorkspaceInitPathEscapeError(filename, boundWorkspace);
|
|
1585
799
|
}
|
|
1586
|
-
const wsCanonical = await
|
|
800
|
+
const wsCanonical = await fs.realpath(boundWorkspace);
|
|
1587
801
|
const parentCanonical = await canonicalizeExistingAncestor(
|
|
1588
|
-
|
|
802
|
+
path.dirname(target)
|
|
1589
803
|
);
|
|
1590
|
-
const parentWithinWorkspace = parentCanonical === wsCanonical || parentCanonical.startsWith(wsCanonical +
|
|
804
|
+
const parentWithinWorkspace = parentCanonical === wsCanonical || parentCanonical.startsWith(wsCanonical + path.sep);
|
|
1591
805
|
if (!parentWithinWorkspace) {
|
|
1592
806
|
throw new WorkspaceInitSymlinkError(
|
|
1593
807
|
target,
|
|
@@ -1596,7 +810,7 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1596
810
|
);
|
|
1597
811
|
}
|
|
1598
812
|
try {
|
|
1599
|
-
const lst = await
|
|
813
|
+
const lst = await fs.lstat(target);
|
|
1600
814
|
if (lst.isSymbolicLink()) {
|
|
1601
815
|
throw new WorkspaceInitSymlinkError(
|
|
1602
816
|
target,
|
|
@@ -1618,7 +832,7 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1618
832
|
}
|
|
1619
833
|
let action = "created";
|
|
1620
834
|
try {
|
|
1621
|
-
const existing = await
|
|
835
|
+
const existing = await fs.readFile(target, "utf8");
|
|
1622
836
|
if (existing.trim().length > 0) {
|
|
1623
837
|
const existingSize = Buffer.byteLength(existing, "utf8");
|
|
1624
838
|
if (opts.force !== true) {
|
|
@@ -1636,7 +850,7 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1636
850
|
if (action === "created") {
|
|
1637
851
|
let fh;
|
|
1638
852
|
try {
|
|
1639
|
-
fh = await
|
|
853
|
+
fh = await fs.open(target, "wx");
|
|
1640
854
|
} catch (err) {
|
|
1641
855
|
const code = err?.code;
|
|
1642
856
|
if (code === "EEXIST") {
|
|
@@ -1657,7 +871,7 @@ function createDaemonWorkspaceService(deps) {
|
|
|
1657
871
|
} else if (action === "overwrote") {
|
|
1658
872
|
let overwriteFh;
|
|
1659
873
|
try {
|
|
1660
|
-
overwriteFh = await
|
|
874
|
+
overwriteFh = await fs.open(
|
|
1661
875
|
target,
|
|
1662
876
|
fsConstants.O_WRONLY | (fsConstants.O_NOFOLLOW ?? 0)
|
|
1663
877
|
);
|
|
@@ -1871,9 +1085,6 @@ export {
|
|
|
1871
1085
|
buildWorkspaceVoiceStatus,
|
|
1872
1086
|
validateWorkspaceVoiceState,
|
|
1873
1087
|
transcribeWorkspaceVoiceAudio,
|
|
1874
|
-
MAX_WORKSPACE_SKILL_NAME_LENGTH,
|
|
1875
|
-
WorkspaceSkillManagementError,
|
|
1876
|
-
validateWorkspaceSkillName,
|
|
1877
1088
|
createDaemonWorkspaceService
|
|
1878
1089
|
};
|
|
1879
1090
|
/**
|