@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
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
shouldSuppressRememberErrorDetails,
|
|
15
15
|
workspaceMemoryFailureCode,
|
|
16
16
|
workspaceMemoryFailureDiagnostics
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QOTQH4CB.js";
|
|
18
18
|
import {
|
|
19
19
|
openQwenAsrRealtimeStream,
|
|
20
20
|
openVoiceStream,
|
|
21
21
|
openVoiceStreamWithRetry
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-5VWYKIMW.js";
|
|
23
23
|
import {
|
|
24
24
|
SetupGithubError,
|
|
25
25
|
collectSessionData,
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
toJson,
|
|
31
31
|
toJsonl,
|
|
32
32
|
toMarkdown
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-6Y6ORE2G.js";
|
|
34
|
+
import "./chunk-CF5VJRGC.js";
|
|
35
35
|
import "./chunk-SUARMD4Q.js";
|
|
36
36
|
import "./chunk-QHTIBUWB.js";
|
|
37
37
|
import "./chunk-L573Z2QZ.js";
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
MAX_CLIENT_ID_LENGTH,
|
|
45
45
|
MAX_CONCURRENT_VOICE_SESSIONS,
|
|
46
46
|
MAX_SERVER_NAME_LENGTH,
|
|
47
|
+
MAX_SKILL_NAME_LENGTH,
|
|
47
48
|
MAX_TOOL_NAME_LENGTH,
|
|
48
49
|
PathMutexRegistry,
|
|
49
50
|
QWEN_CDP_MCP_COMMAND_ENV,
|
|
@@ -64,7 +65,6 @@ import {
|
|
|
64
65
|
denyBrowserOriginCors,
|
|
65
66
|
detectFromLoopback,
|
|
66
67
|
getAdvertisedServeFeatures,
|
|
67
|
-
getDeferredRuntimeRequestTiming,
|
|
68
68
|
getServeProtocolVersions,
|
|
69
69
|
hostAllowlist,
|
|
70
70
|
isBrowserAutomationMcpAvailable,
|
|
@@ -89,51 +89,48 @@ import {
|
|
|
89
89
|
setRateLimiter,
|
|
90
90
|
unsafeRevealSecret,
|
|
91
91
|
validateMcpRuntimeServerName
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-KXYJPRT5.js";
|
|
93
93
|
import {
|
|
94
94
|
isLoopbackBind
|
|
95
95
|
} from "./chunk-RXFQM6FQ.js";
|
|
96
96
|
import {
|
|
97
97
|
createDaemonStatusProvider
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-6EDDYPI3.js";
|
|
99
99
|
import "./chunk-LXXMOYPL.js";
|
|
100
|
-
import "./chunk-
|
|
100
|
+
import "./chunk-S63Z5V42.js";
|
|
101
101
|
import "./chunk-E5Z2AVNV.js";
|
|
102
102
|
import {
|
|
103
103
|
createWorkspaceProvidersStatusProvider
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-7ZYHLN67.js";
|
|
105
105
|
import {
|
|
106
106
|
getAuthTypeFromEnv,
|
|
107
107
|
resolveCliGenerationConfig
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-ZIXOTAPZ.js";
|
|
109
109
|
import {
|
|
110
110
|
snapshotProcessEnv
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-SY7NEYX4.js";
|
|
112
112
|
import {
|
|
113
113
|
createWorkspaceSkillsStatusProvider
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-JD44PNGJ.js";
|
|
115
115
|
import "./chunk-2W3OOD4W.js";
|
|
116
116
|
import {
|
|
117
117
|
EMPTY_WORKSPACE_VOICE_UPDATE_ERROR,
|
|
118
|
-
MAX_WORKSPACE_SKILL_NAME_LENGTH,
|
|
119
|
-
WorkspaceSkillManagementError,
|
|
120
118
|
WorkspaceVoiceError,
|
|
121
119
|
buildWorkspaceVoiceSettingsWrites,
|
|
122
120
|
buildWorkspaceVoiceStatus,
|
|
123
121
|
createDaemonWorkspaceService,
|
|
124
122
|
hasConfiguredBatchVoiceTranscriptionModel,
|
|
125
123
|
transcribeWorkspaceVoiceAudio,
|
|
126
|
-
validateWorkspaceSkillName,
|
|
127
124
|
validateWorkspaceVoiceState,
|
|
128
125
|
voiceSettingsScopeToWire
|
|
129
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-4IJMTYCB.js";
|
|
130
127
|
import {
|
|
131
128
|
PermissionRulesValidationError,
|
|
132
129
|
buildPermissionSettings,
|
|
133
130
|
isPermissionRuleType,
|
|
134
131
|
normalizePermissionRules,
|
|
135
132
|
readPermissionRuleSet
|
|
136
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-K7VD4XLT.js";
|
|
137
134
|
import {
|
|
138
135
|
assertVoiceBaseUrlNetworkAllowed,
|
|
139
136
|
isStreamingVoiceModel,
|
|
@@ -141,13 +138,13 @@ import {
|
|
|
141
138
|
resolveVoiceTranscriptionConfig,
|
|
142
139
|
sanitizeVoiceErrorMessage,
|
|
143
140
|
transcribeVoiceAudio
|
|
144
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-BUAXJVNP.js";
|
|
145
142
|
import {
|
|
146
143
|
isVoiceEnabled,
|
|
147
144
|
isVoiceMode,
|
|
148
145
|
readVoiceModel
|
|
149
|
-
} from "./chunk-
|
|
150
|
-
import "./chunk-
|
|
146
|
+
} from "./chunk-3M75MSVA.js";
|
|
147
|
+
import "./chunk-FSA7ERJ2.js";
|
|
151
148
|
import {
|
|
152
149
|
WorkspacePermissionRulesSessionRequiredError,
|
|
153
150
|
WorkspaceSettingsPartialPersistError,
|
|
@@ -156,19 +153,19 @@ import {
|
|
|
156
153
|
} from "./chunk-OA4JVLSA.js";
|
|
157
154
|
import {
|
|
158
155
|
createTotalSessionAdmissionController
|
|
159
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-AVEOWVOM.js";
|
|
160
157
|
import {
|
|
161
158
|
createSingleWorkspaceRegistry,
|
|
162
159
|
createWorkspaceSessionOwnerIndex
|
|
163
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-STZQCNN3.js";
|
|
164
161
|
import "./chunk-GRC5HGPI.js";
|
|
165
162
|
import {
|
|
166
163
|
SessionArtifactAuthorizationError,
|
|
167
164
|
SessionArtifactValidationError,
|
|
168
165
|
createAcpSessionBridge,
|
|
169
166
|
parseSessionSource
|
|
170
|
-
} from "./chunk-
|
|
171
|
-
import "./chunk-
|
|
167
|
+
} from "./chunk-574PTLMU.js";
|
|
168
|
+
import "./chunk-PZL23GTM.js";
|
|
172
169
|
import {
|
|
173
170
|
EVENT_SCHEMA_VERSION,
|
|
174
171
|
SubscriberLimitExceededError
|
|
@@ -205,30 +202,30 @@ import {
|
|
|
205
202
|
WorkspaceInitRaceError,
|
|
206
203
|
WorkspaceInitSymlinkError,
|
|
207
204
|
WorkspaceMismatchError
|
|
208
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-L4Y55KIS.js";
|
|
209
206
|
import "./chunk-WBL3FJEU.js";
|
|
210
207
|
import {
|
|
211
208
|
loadChannelsConfig
|
|
212
|
-
} from "./chunk-
|
|
213
|
-
import "./chunk-
|
|
209
|
+
} from "./chunk-7NMU22Q3.js";
|
|
210
|
+
import "./chunk-YFVO2HOR.js";
|
|
214
211
|
import "./chunk-57OAHC2Y.js";
|
|
215
212
|
import {
|
|
216
213
|
parseChannelWebhookConfigLenient
|
|
217
|
-
} from "./chunk-
|
|
218
|
-
import "./chunk-
|
|
214
|
+
} from "./chunk-5CNYZ7TN.js";
|
|
215
|
+
import "./chunk-FNX3LGAK.js";
|
|
219
216
|
import "./chunk-V6WHFGST.js";
|
|
220
|
-
import "./chunk-
|
|
217
|
+
import "./chunk-3AYLDB6B.js";
|
|
221
218
|
import {
|
|
222
219
|
STATUS_SCHEMA_VERSION,
|
|
223
220
|
createIdleWorkspaceMemoryStatus,
|
|
224
221
|
mapDomainErrorToErrorKind
|
|
225
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-VFX7EZIR.js";
|
|
226
223
|
import {
|
|
227
224
|
MAX_REGISTERED_WORKSPACES,
|
|
228
225
|
WorkspaceRegistrationStoreCommittedError,
|
|
229
226
|
WorkspaceRegistrationStoreLimitError,
|
|
230
227
|
workspaceRegistrationId
|
|
231
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-N5VIZTND.js";
|
|
232
229
|
import {
|
|
233
230
|
MAX_WORKSPACE_PATH_LENGTH,
|
|
234
231
|
canonicalizeWorkspace,
|
|
@@ -242,7 +239,7 @@ import {
|
|
|
242
239
|
QWEN_SERVER_TOKEN_ENV,
|
|
243
240
|
isChannelWebhookEnqueueError,
|
|
244
241
|
normalizeWorkerDiagnostic
|
|
245
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-KSZKSE23.js";
|
|
246
243
|
import {
|
|
247
244
|
normalizeServeChannelSelection
|
|
248
245
|
} from "./chunk-TJTKSVIV.js";
|
|
@@ -253,7 +250,7 @@ import "./chunk-5HBA2Z7V.js";
|
|
|
253
250
|
import "./chunk-T2NCM2ET.js";
|
|
254
251
|
import {
|
|
255
252
|
sanitizeLogText
|
|
256
|
-
} from "./chunk-
|
|
253
|
+
} from "./chunk-ZQIYGQCG.js";
|
|
257
254
|
import "./chunk-UDXSXLER.js";
|
|
258
255
|
import {
|
|
259
256
|
getDialogSettingKeys,
|
|
@@ -264,18 +261,18 @@ import {
|
|
|
264
261
|
getWritableScopes,
|
|
265
262
|
loadSettings,
|
|
266
263
|
validateSettingValue
|
|
267
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-GNBBAQ6J.js";
|
|
268
265
|
import "./chunk-RKUWKYED.js";
|
|
269
266
|
import {
|
|
270
267
|
SUPPORTED_LANGUAGES
|
|
271
|
-
} from "./chunk-
|
|
272
|
-
import "./chunk-
|
|
268
|
+
} from "./chunk-4AGTGMCQ.js";
|
|
269
|
+
import "./chunk-JWICTOXS.js";
|
|
273
270
|
import "./chunk-GOXKNSDZ.js";
|
|
274
271
|
import "./chunk-IDS7MSUP.js";
|
|
275
272
|
import "./chunk-QRUIS3DN.js";
|
|
276
273
|
import {
|
|
277
274
|
getWorkspaceTrustStatus
|
|
278
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-2OG646IN.js";
|
|
279
276
|
import "./chunk-ALGGS7UH.js";
|
|
280
277
|
import {
|
|
281
278
|
isWithinRoot as isWithinRoot2
|
|
@@ -283,7 +280,7 @@ import {
|
|
|
283
280
|
import {
|
|
284
281
|
writeStderrLine
|
|
285
282
|
} from "./chunk-YUZI3WAC.js";
|
|
286
|
-
import "./chunk-
|
|
283
|
+
import "./chunk-GLNHPRZT.js";
|
|
287
284
|
import "./chunk-VJNBRRZG.js";
|
|
288
285
|
import {
|
|
289
286
|
ALL_PROVIDERS,
|
|
@@ -299,7 +296,6 @@ import {
|
|
|
299
296
|
RUNTIME_MCP_IF_ABSENT_CONFIG_FLAG,
|
|
300
297
|
SESSION_TRANSCRIPT_MAX_INDEX_BYTES,
|
|
301
298
|
SESSION_TRANSCRIPT_MAX_LIMIT,
|
|
302
|
-
SESSION_TRANSCRIPT_MAX_PAGE_BYTES,
|
|
303
299
|
SessionOrganizationError,
|
|
304
300
|
SessionOrganizationService,
|
|
305
301
|
SessionService,
|
|
@@ -330,17 +326,17 @@ import {
|
|
|
330
326
|
stripTerminalControlSequences,
|
|
331
327
|
watchRepoBranch,
|
|
332
328
|
writeWorkspaceContextFile
|
|
333
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-NJOFRXTM.js";
|
|
334
330
|
import "./chunk-T4TZQJ7W.js";
|
|
335
331
|
import "./chunk-H6XPXXMH.js";
|
|
336
332
|
import "./chunk-5M6IDOMF.js";
|
|
337
333
|
import {
|
|
338
334
|
MAX_JOBS,
|
|
339
335
|
nextDurableFireMs
|
|
340
|
-
} from "./chunk-
|
|
341
|
-
import "./chunk-
|
|
342
|
-
import "./chunk-
|
|
343
|
-
import "./chunk-
|
|
336
|
+
} from "./chunk-A2HWMJVO.js";
|
|
337
|
+
import "./chunk-RCEEXIOO.js";
|
|
338
|
+
import "./chunk-KKRTYONM.js";
|
|
339
|
+
import "./chunk-TV6K2FB4.js";
|
|
344
340
|
import "./chunk-E2UVIFI2.js";
|
|
345
341
|
import {
|
|
346
342
|
nextFireTime,
|
|
@@ -354,7 +350,7 @@ import {
|
|
|
354
350
|
readCronTasks,
|
|
355
351
|
taskHasLegacyCondition,
|
|
356
352
|
updateCronTasks
|
|
357
|
-
} from "./chunk-
|
|
353
|
+
} from "./chunk-SPJQO2CE.js";
|
|
358
354
|
import "./chunk-SZRN75WQ.js";
|
|
359
355
|
import "./chunk-HTO4JFDZ.js";
|
|
360
356
|
import "./chunk-CPBF7KYF.js";
|
|
@@ -362,12 +358,12 @@ import {
|
|
|
362
358
|
APPROVAL_MODES,
|
|
363
359
|
SubagentError,
|
|
364
360
|
SubagentErrorCode
|
|
365
|
-
} from "./chunk-
|
|
361
|
+
} from "./chunk-F333XEAU.js";
|
|
366
362
|
import "./chunk-6AM5D4ME.js";
|
|
367
|
-
import "./chunk-
|
|
368
|
-
import "./chunk-
|
|
369
|
-
import "./chunk-
|
|
370
|
-
import "./chunk-
|
|
363
|
+
import "./chunk-2Z5UX4KI.js";
|
|
364
|
+
import "./chunk-ARKANCNX.js";
|
|
365
|
+
import "./chunk-L5U3ELZX.js";
|
|
366
|
+
import "./chunk-TYLOFD2U.js";
|
|
371
367
|
import {
|
|
372
368
|
addDaemonRequestAttribute,
|
|
373
369
|
decodeBufferWithEncodingInfo,
|
|
@@ -381,15 +377,15 @@ import {
|
|
|
381
377
|
recordDaemonHttpRequest,
|
|
382
378
|
recordDaemonHttpResponse,
|
|
383
379
|
withDaemonRequestSpan
|
|
384
|
-
} from "./chunk-
|
|
380
|
+
} from "./chunk-MQOVXZAF.js";
|
|
385
381
|
import "./chunk-4WKAA4KS.js";
|
|
386
382
|
import "./chunk-CR3C7WXL.js";
|
|
387
|
-
import "./chunk-
|
|
383
|
+
import "./chunk-RTV5TUYB.js";
|
|
388
384
|
import "./chunk-VGC4I5JJ.js";
|
|
389
|
-
import "./chunk-
|
|
390
|
-
import "./chunk-
|
|
391
|
-
import "./chunk-
|
|
392
|
-
import "./chunk-
|
|
385
|
+
import "./chunk-FBU7WRZI.js";
|
|
386
|
+
import "./chunk-Y66VOBRP.js";
|
|
387
|
+
import "./chunk-WTNZ6DXB.js";
|
|
388
|
+
import "./chunk-JGUT3LWZ.js";
|
|
393
389
|
import {
|
|
394
390
|
QwenOAuth2Client,
|
|
395
391
|
QwenOAuthPollError,
|
|
@@ -398,28 +394,28 @@ import {
|
|
|
398
394
|
isDeviceAuthorizationSuccess,
|
|
399
395
|
isDeviceTokenPending,
|
|
400
396
|
isDeviceTokenSuccess
|
|
401
|
-
} from "./chunk-
|
|
402
|
-
import "./chunk-
|
|
397
|
+
} from "./chunk-OKAIGAYW.js";
|
|
398
|
+
import "./chunk-ZPAHLFZU.js";
|
|
403
399
|
import "./chunk-JESCGQM3.js";
|
|
404
|
-
import "./chunk-
|
|
400
|
+
import "./chunk-WIEO4CWB.js";
|
|
405
401
|
import "./chunk-XVNQMZ2I.js";
|
|
406
402
|
import "./chunk-FEOZBUMT.js";
|
|
407
|
-
import "./chunk-
|
|
403
|
+
import "./chunk-VRR65QYW.js";
|
|
408
404
|
import "./chunk-A4UCTEB5.js";
|
|
409
405
|
import "./chunk-XWRJCPHC.js";
|
|
410
|
-
import "./chunk-
|
|
406
|
+
import "./chunk-4LD5APFL.js";
|
|
411
407
|
import {
|
|
412
408
|
import_websocket_server
|
|
413
409
|
} from "./chunk-TYAMGABM.js";
|
|
414
410
|
import "./chunk-FCMNKVXT.js";
|
|
415
411
|
import "./chunk-DJ2GSRLV.js";
|
|
416
|
-
import "./chunk-
|
|
412
|
+
import "./chunk-LQIDP6K5.js";
|
|
417
413
|
import {
|
|
418
414
|
FatalConfigError,
|
|
419
415
|
Storage,
|
|
420
416
|
createDebugLogger,
|
|
421
417
|
runWithoutDebugLogSession
|
|
422
|
-
} from "./chunk-
|
|
418
|
+
} from "./chunk-7NFB7LBQ.js";
|
|
423
419
|
import "./chunk-75DOP5OR.js";
|
|
424
420
|
import "./chunk-DMTGGOSA.js";
|
|
425
421
|
import "./chunk-YQ3U5MUC.js";
|
|
@@ -2915,7 +2911,7 @@ async function handleSetupGithub(req, res, deps) {
|
|
|
2915
2911
|
const result = await setupGithub({
|
|
2916
2912
|
cwd: deps.boundWorkspace,
|
|
2917
2913
|
workspaceRoot: deps.boundWorkspace,
|
|
2918
|
-
proxy: resolveSetupGithubProxy(deps.boundWorkspace
|
|
2914
|
+
proxy: resolveSetupGithubProxy(deps.boundWorkspace),
|
|
2919
2915
|
abortSignal: requestAbortSignal(req, res),
|
|
2920
2916
|
fileOps: createSetupGithubFileOps(factory, ROUTE, originatorClientId)
|
|
2921
2917
|
});
|
|
@@ -3133,14 +3129,14 @@ function setupGithubEventData(result) {
|
|
|
3133
3129
|
};
|
|
3134
3130
|
}
|
|
3135
3131
|
__name(setupGithubEventData, "setupGithubEventData");
|
|
3136
|
-
function resolveSetupGithubProxy(boundWorkspace
|
|
3132
|
+
function resolveSetupGithubProxy(boundWorkspace) {
|
|
3137
3133
|
const settings = loadSettings(boundWorkspace, { skipLoadEnvironment: true });
|
|
3138
3134
|
const trustState = getWorkspaceTrustStatus(
|
|
3139
3135
|
settingsForSetupGithubTrust(settings),
|
|
3140
3136
|
boundWorkspace
|
|
3141
3137
|
).effective.state;
|
|
3142
3138
|
const settingsProxy = trustState === "trusted" ? settings.merged.proxy : settings.user.settings.proxy || settings.system.settings.proxy || settings.systemDefaults.settings.proxy;
|
|
3143
|
-
return settingsProxy || env["HTTPS_PROXY"] || env["https_proxy"] || env["HTTP_PROXY"] || env["http_proxy"];
|
|
3139
|
+
return settingsProxy || process.env["HTTPS_PROXY"] || process.env["https_proxy"] || process.env["HTTP_PROXY"] || process.env["http_proxy"];
|
|
3144
3140
|
}
|
|
3145
3141
|
__name(resolveSetupGithubProxy, "resolveSetupGithubProxy");
|
|
3146
3142
|
function settingsForSetupGithubTrust(settings) {
|
|
@@ -6958,10 +6954,9 @@ function rpcErrorFrame(id, err) {
|
|
|
6958
6954
|
__name(rpcErrorFrame, "rpcErrorFrame");
|
|
6959
6955
|
var ACP_PROTOCOL_VERSION = 1;
|
|
6960
6956
|
var AcpDispatcher = class {
|
|
6961
|
-
constructor(bridge, boundWorkspace,
|
|
6957
|
+
constructor(bridge, boundWorkspace, workspace, workspaceRememberLane, fsFactory, deviceFlowRegistry, sessionShellCommandEnabled = false, registry, archiveCoordinator = new SessionArchiveCoordinator()) {
|
|
6962
6958
|
this.bridge = bridge;
|
|
6963
6959
|
this.boundWorkspace = boundWorkspace;
|
|
6964
|
-
this.env = env;
|
|
6965
6960
|
this.workspace = workspace;
|
|
6966
6961
|
this.workspaceRememberLane = workspaceRememberLane;
|
|
6967
6962
|
this.fsFactory = fsFactory;
|
|
@@ -8338,7 +8333,7 @@ var AcpDispatcher = class {
|
|
|
8338
8333
|
const result = await setupGithub({
|
|
8339
8334
|
cwd: this.boundWorkspace,
|
|
8340
8335
|
workspaceRoot: this.boundWorkspace,
|
|
8341
|
-
proxy: resolveSetupGithubProxy(this.boundWorkspace
|
|
8336
|
+
proxy: resolveSetupGithubProxy(this.boundWorkspace),
|
|
8342
8337
|
abortSignal: conn.abortSignal,
|
|
8343
8338
|
fileOps: createSetupGithubFileOps(
|
|
8344
8339
|
this.fsFactory,
|
|
@@ -11809,11 +11804,11 @@ function delay(ms) {
|
|
|
11809
11804
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
11810
11805
|
}
|
|
11811
11806
|
__name(delay, "delay");
|
|
11812
|
-
function buildChromeDevToolsMcpRuntimeConfig(localPort, hostname
|
|
11807
|
+
function buildChromeDevToolsMcpRuntimeConfig(localPort, hostname) {
|
|
11813
11808
|
if (localPort === void 0 || !Number.isInteger(localPort) || localPort <= 0) {
|
|
11814
11809
|
return void 0;
|
|
11815
11810
|
}
|
|
11816
|
-
const command = resolveCdpMcpCommand(env);
|
|
11811
|
+
const command = resolveCdpMcpCommand(process.env);
|
|
11817
11812
|
if (!command) {
|
|
11818
11813
|
writeStderrLine(
|
|
11819
11814
|
`qwen serve: set ${QWEN_CDP_MCP_COMMAND_ENV} to enable browser automation MCP (no adapter is bundled)`
|
|
@@ -11919,18 +11914,9 @@ function workspaceRateLimitKey(mount, clientKey) {
|
|
|
11919
11914
|
return JSON.stringify([clientKey, mount.rateLimitScope]);
|
|
11920
11915
|
}
|
|
11921
11916
|
__name(workspaceRateLimitKey, "workspaceRateLimitKey");
|
|
11922
|
-
function runtimeEffectiveEnv(runtime, daemonEnv) {
|
|
11923
|
-
if (runtime.env.mode === "runtime-overlay") {
|
|
11924
|
-
return runtime.env.effectiveEnv ?? {};
|
|
11925
|
-
}
|
|
11926
|
-
return runtime.env.effectiveEnv ?? daemonEnv;
|
|
11927
|
-
}
|
|
11928
|
-
__name(runtimeEffectiveEnv, "runtimeEffectiveEnv");
|
|
11929
11917
|
function mountAcpHttp(app, bridge, opts) {
|
|
11930
11918
|
const enabled = opts.enabled ?? resolveAcpHttpEnabled();
|
|
11931
11919
|
if (!enabled) return void 0;
|
|
11932
|
-
const daemonEnv = opts.daemonEnv ?? process.env;
|
|
11933
|
-
const primaryEnv = opts.workspaceRegistry ? runtimeEffectiveEnv(opts.workspaceRegistry.primary, daemonEnv) : daemonEnv;
|
|
11934
11920
|
const path15 = opts.path ?? "/acp";
|
|
11935
11921
|
const dispatcherRef = {};
|
|
11936
11922
|
let disposed = false;
|
|
@@ -12020,8 +12006,7 @@ function mountAcpHttp(app, bridge, opts) {
|
|
|
12020
12006
|
}
|
|
12021
12007
|
const runtimeConfig = buildChromeDevToolsMcpRuntimeConfig(
|
|
12022
12008
|
localPort,
|
|
12023
|
-
opts.hostname
|
|
12024
|
-
daemonEnv
|
|
12009
|
+
opts.hostname
|
|
12025
12010
|
);
|
|
12026
12011
|
if (!runtimeConfig) {
|
|
12027
12012
|
cdpMcpTerminalSkipLogged = true;
|
|
@@ -12080,7 +12065,6 @@ function mountAcpHttp(app, bridge, opts) {
|
|
|
12080
12065
|
const dispatcher = new AcpDispatcher(
|
|
12081
12066
|
bridge,
|
|
12082
12067
|
opts.boundWorkspace,
|
|
12083
|
-
primaryEnv,
|
|
12084
12068
|
opts.workspace,
|
|
12085
12069
|
opts.workspaceRememberLane,
|
|
12086
12070
|
opts.fsFactory,
|
|
@@ -12369,7 +12353,6 @@ function mountAcpHttp(app, bridge, opts) {
|
|
|
12369
12353
|
const secondaryDispatcher = new AcpDispatcher(
|
|
12370
12354
|
rt.bridge,
|
|
12371
12355
|
rt.workspaceCwd,
|
|
12372
|
-
runtimeEffectiveEnv(rt, daemonEnv),
|
|
12373
12356
|
rt.workspaceService,
|
|
12374
12357
|
workspaceRememberLane,
|
|
12375
12358
|
rt.routeFileSystemFactory,
|
|
@@ -17731,810 +17714,195 @@ init_esbuild_shims();
|
|
|
17731
17714
|
|
|
17732
17715
|
// packages/cli/src/serve/routes/session-runtime.ts
|
|
17733
17716
|
init_esbuild_shims();
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
method: "POST",
|
|
17746
|
-
path: "/session/:id/load",
|
|
17747
|
-
attribution: "handler_resolved",
|
|
17748
|
-
route: "POST /session/:id/load"
|
|
17749
|
-
},
|
|
17750
|
-
{
|
|
17751
|
-
method: "POST",
|
|
17752
|
-
path: "/session/:id/resume",
|
|
17753
|
-
attribution: "handler_resolved",
|
|
17754
|
-
route: "POST /session/:id/resume"
|
|
17755
|
-
},
|
|
17756
|
-
{
|
|
17757
|
-
method: "POST",
|
|
17758
|
-
path: "/session/:id/branch",
|
|
17759
|
-
attribution: "handler_resolved",
|
|
17760
|
-
route: "POST /session/:id/branch"
|
|
17761
|
-
},
|
|
17762
|
-
{
|
|
17763
|
-
method: "POST",
|
|
17764
|
-
path: "/session/:id/fork",
|
|
17765
|
-
attribution: "handler_resolved",
|
|
17766
|
-
route: "POST /session/:id/fork"
|
|
17767
|
-
},
|
|
17768
|
-
{
|
|
17769
|
-
method: "POST",
|
|
17770
|
-
path: "/session/:id/cd",
|
|
17771
|
-
attribution: "handler_resolved",
|
|
17772
|
-
route: "POST /session/:id/cd"
|
|
17773
|
-
},
|
|
17774
|
-
{
|
|
17775
|
-
method: "GET",
|
|
17776
|
-
path: "/session/:id/status",
|
|
17777
|
-
attribution: "handler_resolved",
|
|
17778
|
-
route: "GET /session/:id/status"
|
|
17779
|
-
},
|
|
17780
|
-
{
|
|
17781
|
-
method: "GET",
|
|
17782
|
-
path: "/session/:id/export",
|
|
17783
|
-
attribution: "pre_resolved",
|
|
17784
|
-
route: "GET /session/:id/export"
|
|
17785
|
-
},
|
|
17786
|
-
{
|
|
17787
|
-
method: "GET",
|
|
17788
|
-
path: "/session/:id/transcript",
|
|
17789
|
-
attribution: "handler_resolved",
|
|
17790
|
-
route: "GET /session/:id/transcript"
|
|
17791
|
-
},
|
|
17792
|
-
{
|
|
17793
|
-
method: "GET",
|
|
17794
|
-
path: "/session/:id/context",
|
|
17795
|
-
attribution: "handler_resolved",
|
|
17796
|
-
route: "GET /session/:id/context"
|
|
17797
|
-
},
|
|
17798
|
-
{
|
|
17799
|
-
method: "GET",
|
|
17800
|
-
path: "/session/:id/context-usage",
|
|
17801
|
-
attribution: "handler_resolved",
|
|
17802
|
-
route: "GET /session/:id/context-usage"
|
|
17803
|
-
},
|
|
17804
|
-
{
|
|
17805
|
-
method: "GET",
|
|
17806
|
-
path: "/session/:id/stats",
|
|
17807
|
-
attribution: "handler_resolved",
|
|
17808
|
-
route: "GET /session/:id/stats"
|
|
17809
|
-
},
|
|
17810
|
-
{
|
|
17811
|
-
method: "GET",
|
|
17812
|
-
path: "/session/:id/supported-commands",
|
|
17813
|
-
attribution: "handler_resolved",
|
|
17814
|
-
route: "GET /session/:id/supported-commands"
|
|
17815
|
-
},
|
|
17816
|
-
{
|
|
17817
|
-
method: "GET",
|
|
17818
|
-
path: "/session/:id/tasks",
|
|
17819
|
-
attribution: "handler_resolved",
|
|
17820
|
-
route: "GET /session/:id/tasks"
|
|
17821
|
-
},
|
|
17822
|
-
{
|
|
17823
|
-
method: "GET",
|
|
17824
|
-
path: "/session/:id/lsp",
|
|
17825
|
-
attribution: "handler_resolved",
|
|
17826
|
-
route: "GET /session/:id/lsp"
|
|
17827
|
-
},
|
|
17828
|
-
{
|
|
17829
|
-
method: "GET",
|
|
17830
|
-
path: "/session/:id/hooks",
|
|
17831
|
-
attribution: "handler_resolved",
|
|
17832
|
-
route: "GET /session/:id/hooks"
|
|
17833
|
-
},
|
|
17834
|
-
{
|
|
17835
|
-
method: "GET",
|
|
17836
|
-
path: "/session/:id/artifacts",
|
|
17837
|
-
attribution: "handler_resolved",
|
|
17838
|
-
route: "GET /session/:id/artifacts"
|
|
17839
|
-
},
|
|
17840
|
-
{
|
|
17841
|
-
method: "POST",
|
|
17842
|
-
path: "/session/:id/artifacts",
|
|
17843
|
-
attribution: "handler_resolved",
|
|
17844
|
-
route: "POST /session/:id/artifacts"
|
|
17845
|
-
},
|
|
17846
|
-
{
|
|
17847
|
-
method: "DELETE",
|
|
17848
|
-
path: "/session/:id/artifacts/:artifactId",
|
|
17849
|
-
attribution: "handler_resolved",
|
|
17850
|
-
route: "DELETE /session/:id/artifacts/:artifactId"
|
|
17851
|
-
},
|
|
17852
|
-
{
|
|
17853
|
-
method: "POST",
|
|
17854
|
-
path: "/session/:id/tasks/:taskId/cancel",
|
|
17855
|
-
attribution: "handler_resolved",
|
|
17856
|
-
route: "POST /session/:id/tasks/:taskId/cancel"
|
|
17857
|
-
},
|
|
17858
|
-
{
|
|
17859
|
-
method: "POST",
|
|
17860
|
-
path: "/session/:id/goal/clear",
|
|
17861
|
-
attribution: "handler_resolved",
|
|
17862
|
-
route: "POST /session/:id/goal/clear"
|
|
17863
|
-
},
|
|
17864
|
-
{
|
|
17865
|
-
method: "POST",
|
|
17866
|
-
path: "/session/:id/continue",
|
|
17867
|
-
attribution: "handler_resolved",
|
|
17868
|
-
route: "POST /session/:id/continue"
|
|
17869
|
-
},
|
|
17870
|
-
{
|
|
17871
|
-
method: "POST",
|
|
17872
|
-
path: "/session/:id/prompt",
|
|
17873
|
-
attribution: "handler_resolved",
|
|
17874
|
-
route: "POST /session/:id/prompt"
|
|
17875
|
-
},
|
|
17876
|
-
{
|
|
17877
|
-
method: "POST",
|
|
17878
|
-
path: "/session/:id/generate",
|
|
17879
|
-
attribution: "handler_resolved",
|
|
17880
|
-
route: "POST /session/:id/generate"
|
|
17881
|
-
},
|
|
17882
|
-
{
|
|
17883
|
-
method: "POST",
|
|
17884
|
-
path: "/session/:id/heartbeat",
|
|
17885
|
-
attribution: "handler_resolved",
|
|
17886
|
-
route: "POST /session/:id/heartbeat"
|
|
17887
|
-
},
|
|
17888
|
-
{
|
|
17889
|
-
method: "POST",
|
|
17890
|
-
path: "/session/:id/detach",
|
|
17891
|
-
attribution: "handler_resolved",
|
|
17892
|
-
route: "POST /session/:id/detach"
|
|
17893
|
-
},
|
|
17894
|
-
{
|
|
17895
|
-
method: "POST",
|
|
17896
|
-
path: "/session/:id/cancel",
|
|
17897
|
-
attribution: "handler_resolved",
|
|
17898
|
-
route: "POST /session/:id/cancel"
|
|
17899
|
-
},
|
|
17900
|
-
{
|
|
17901
|
-
method: "DELETE",
|
|
17902
|
-
path: "/session/:id",
|
|
17903
|
-
attribution: "handler_resolved",
|
|
17904
|
-
route: "DELETE /session/:id"
|
|
17905
|
-
},
|
|
17906
|
-
{
|
|
17907
|
-
method: "POST",
|
|
17908
|
-
path: "/sessions/delete",
|
|
17909
|
-
attribution: "pre_resolved",
|
|
17910
|
-
route: "POST /sessions/delete"
|
|
17911
|
-
},
|
|
17912
|
-
{
|
|
17913
|
-
method: "POST",
|
|
17914
|
-
path: "/sessions/archive",
|
|
17915
|
-
attribution: "pre_resolved",
|
|
17916
|
-
route: "POST /sessions/archive"
|
|
17917
|
-
},
|
|
17918
|
-
{
|
|
17919
|
-
method: "POST",
|
|
17920
|
-
path: "/sessions/unarchive",
|
|
17921
|
-
attribution: "pre_resolved",
|
|
17922
|
-
route: "POST /sessions/unarchive"
|
|
17923
|
-
},
|
|
17924
|
-
{
|
|
17925
|
-
method: "PATCH",
|
|
17926
|
-
path: "/session/:id/metadata",
|
|
17927
|
-
attribution: "handler_resolved",
|
|
17928
|
-
route: "PATCH /session/:id/metadata"
|
|
17929
|
-
},
|
|
17930
|
-
{
|
|
17931
|
-
method: "PATCH",
|
|
17932
|
-
path: "/session/:id/organization",
|
|
17933
|
-
attribution: "pre_resolved",
|
|
17934
|
-
route: "PATCH /session/:id/organization"
|
|
17935
|
-
},
|
|
17936
|
-
{
|
|
17937
|
-
method: "POST",
|
|
17938
|
-
path: "/session/:id/model",
|
|
17939
|
-
attribution: "handler_resolved",
|
|
17940
|
-
route: "POST /session/:id/model"
|
|
17941
|
-
},
|
|
17942
|
-
{
|
|
17943
|
-
method: "POST",
|
|
17944
|
-
path: "/session/:id/recap",
|
|
17945
|
-
attribution: "handler_resolved",
|
|
17946
|
-
route: "POST /session/:id/recap"
|
|
17947
|
-
},
|
|
17948
|
-
{
|
|
17949
|
-
method: "POST",
|
|
17950
|
-
path: "/session/:id/btw",
|
|
17951
|
-
attribution: "handler_resolved",
|
|
17952
|
-
route: "POST /session/:id/btw"
|
|
17953
|
-
},
|
|
17954
|
-
{
|
|
17955
|
-
method: "POST",
|
|
17956
|
-
path: "/session/:id/mid-turn-message",
|
|
17957
|
-
attribution: "handler_resolved",
|
|
17958
|
-
route: "POST /session/:id/mid-turn-message"
|
|
17959
|
-
},
|
|
17960
|
-
{
|
|
17961
|
-
method: "GET",
|
|
17962
|
-
path: "/session/:id/pending-prompts",
|
|
17963
|
-
attribution: "handler_resolved",
|
|
17964
|
-
route: "GET /session/:id/pending-prompts"
|
|
17965
|
-
},
|
|
17966
|
-
{
|
|
17967
|
-
method: "DELETE",
|
|
17968
|
-
path: "/session/:id/pending-prompts/:promptId",
|
|
17969
|
-
attribution: "handler_resolved",
|
|
17970
|
-
route: "DELETE /session/:id/pending-prompts/:promptId"
|
|
17971
|
-
},
|
|
17972
|
-
{
|
|
17973
|
-
method: "POST",
|
|
17974
|
-
path: "/session/:id/shell",
|
|
17975
|
-
attribution: "handler_resolved",
|
|
17976
|
-
route: "POST /session/:id/shell"
|
|
17977
|
-
},
|
|
17978
|
-
{
|
|
17979
|
-
method: "GET",
|
|
17980
|
-
path: "/session/:id/rewind/snapshots",
|
|
17981
|
-
attribution: "handler_resolved",
|
|
17982
|
-
route: "GET /session/:id/rewind/snapshots"
|
|
17983
|
-
},
|
|
17984
|
-
{
|
|
17985
|
-
method: "POST",
|
|
17986
|
-
path: "/session/:id/rewind",
|
|
17987
|
-
attribution: "handler_resolved",
|
|
17988
|
-
route: "POST /session/:id/rewind"
|
|
17989
|
-
},
|
|
17990
|
-
{
|
|
17991
|
-
method: "POST",
|
|
17992
|
-
path: "/session/:id/approval-mode",
|
|
17993
|
-
attribution: "handler_resolved",
|
|
17994
|
-
route: "POST /session/:id/approval-mode"
|
|
17995
|
-
},
|
|
17996
|
-
{
|
|
17997
|
-
method: "POST",
|
|
17998
|
-
path: "/session/:id/language",
|
|
17999
|
-
attribution: "handler_resolved",
|
|
18000
|
-
route: "POST /session/:id/language"
|
|
18001
|
-
},
|
|
18002
|
-
{
|
|
18003
|
-
method: "POST",
|
|
18004
|
-
path: "/session/:id/permission/:requestId",
|
|
18005
|
-
attribution: "handler_resolved",
|
|
18006
|
-
route: "POST /session/:id/permission/:requestId"
|
|
18007
|
-
},
|
|
18008
|
-
{
|
|
18009
|
-
method: "POST",
|
|
18010
|
-
path: "/permission/:requestId",
|
|
18011
|
-
attribution: "pre_resolved",
|
|
18012
|
-
route: "POST /permission/:requestId"
|
|
18013
|
-
},
|
|
18014
|
-
{
|
|
18015
|
-
method: "GET",
|
|
18016
|
-
path: "/session/:id/events",
|
|
18017
|
-
attribution: "handler_resolved",
|
|
18018
|
-
route: "GET /session/:id/events"
|
|
18019
|
-
},
|
|
18020
|
-
{
|
|
18021
|
-
method: "POST",
|
|
18022
|
-
path: "/session/:id/a2ui-action",
|
|
18023
|
-
attribution: "pre_resolved",
|
|
18024
|
-
route: "POST /session/:id/a2ui-action"
|
|
17717
|
+
function requireSessionRuntime(opts) {
|
|
17718
|
+
const {
|
|
17719
|
+
sessionId,
|
|
17720
|
+
route,
|
|
17721
|
+
res,
|
|
17722
|
+
workspaceRegistry,
|
|
17723
|
+
daemonLog,
|
|
17724
|
+
details = {}
|
|
17725
|
+
} = opts;
|
|
17726
|
+
if (workspaceRegistry.list().length === 1) {
|
|
17727
|
+
return workspaceRegistry.primary;
|
|
18025
17728
|
}
|
|
18026
|
-
|
|
18027
|
-
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
|
|
18032
|
-
|
|
17729
|
+
const resolution = workspaceRegistry.resolveLiveSessionOwner(sessionId);
|
|
17730
|
+
if (resolution.kind === "found") {
|
|
17731
|
+
const runtime = resolution.runtime;
|
|
17732
|
+
if (!runtime.primary && !runtime.trusted) {
|
|
17733
|
+
daemonLog?.warn("session routing failed", {
|
|
17734
|
+
route,
|
|
17735
|
+
resolutionKind: "untrusted_workspace",
|
|
17736
|
+
sessionId,
|
|
17737
|
+
workspaceId: runtime.workspaceId,
|
|
17738
|
+
workspaceCwd: runtime.workspaceCwd,
|
|
17739
|
+
...details
|
|
17740
|
+
});
|
|
17741
|
+
sendUntrustedWorkspaceResponse(res, {
|
|
17742
|
+
sessionId,
|
|
17743
|
+
workspaceCwd: runtime.workspaceCwd,
|
|
17744
|
+
workspaceId: runtime.workspaceId
|
|
17745
|
+
});
|
|
17746
|
+
return void 0;
|
|
17747
|
+
}
|
|
17748
|
+
return runtime;
|
|
18033
17749
|
}
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
|
|
18037
|
-
|
|
18038
|
-
|
|
18039
|
-
|
|
18040
|
-
|
|
17750
|
+
if (resolution.kind === "not_found") {
|
|
17751
|
+
daemonLog?.warn("session routing failed", {
|
|
17752
|
+
route,
|
|
17753
|
+
resolutionKind: "not_found",
|
|
17754
|
+
sessionId,
|
|
17755
|
+
...details
|
|
17756
|
+
});
|
|
17757
|
+
res.status(404).json({
|
|
17758
|
+
error: `No session with id "${sessionId}"`,
|
|
17759
|
+
code: "session_not_found",
|
|
17760
|
+
sessionId
|
|
17761
|
+
});
|
|
18041
17762
|
return void 0;
|
|
18042
17763
|
}
|
|
18043
|
-
|
|
18044
|
-
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
|
-
|
|
18058
|
-
|
|
18059
|
-
|
|
18060
|
-
break;
|
|
18061
|
-
}
|
|
18062
|
-
}
|
|
18063
|
-
if (!matched) continue;
|
|
18064
|
-
const rawSessionId = params.get("id");
|
|
18065
|
-
const rawRequestId = params.get("requestId");
|
|
18066
|
-
const requestId = rawRequestId !== void 0 ? decodePathSegment(rawRequestId) : void 0;
|
|
18067
|
-
return {
|
|
18068
|
-
route: entry.route,
|
|
18069
|
-
attribution: entry.attribution,
|
|
18070
|
-
...rawSessionId ? { sessionId: decodePathSegment(rawSessionId) } : {},
|
|
18071
|
-
...requestId !== void 0 && requestId.length <= MAX_CLIENT_ID_LENGTH && CLIENT_ID_RE.test(requestId) ? { permissionRequestId: requestId } : {}
|
|
18072
|
-
};
|
|
18073
|
-
}
|
|
17764
|
+
const workspaceIds = resolution.runtimes.map(
|
|
17765
|
+
(runtime) => runtime.workspaceId
|
|
17766
|
+
);
|
|
17767
|
+
daemonLog?.warn("session routing failed", {
|
|
17768
|
+
route,
|
|
17769
|
+
resolutionKind: "ambiguous",
|
|
17770
|
+
sessionId,
|
|
17771
|
+
workspaceIds,
|
|
17772
|
+
...details
|
|
17773
|
+
});
|
|
17774
|
+
res.status(500).json({
|
|
17775
|
+
error: `Session owner is ambiguous for "${sessionId}"`,
|
|
17776
|
+
code: "ambiguous_session_owner",
|
|
17777
|
+
sessionId,
|
|
17778
|
+
route,
|
|
17779
|
+
workspaceIds
|
|
17780
|
+
});
|
|
18074
17781
|
return void 0;
|
|
18075
17782
|
}
|
|
18076
|
-
__name(
|
|
18077
|
-
|
|
18078
|
-
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
17783
|
+
__name(requireSessionRuntime, "requireSessionRuntime");
|
|
17784
|
+
|
|
17785
|
+
// packages/cli/src/serve/routes/permission.ts
|
|
17786
|
+
function registerPermissionRoutes(app, deps) {
|
|
17787
|
+
const {
|
|
17788
|
+
bridge,
|
|
17789
|
+
workspaceRegistry,
|
|
17790
|
+
daemonLog,
|
|
17791
|
+
mutate,
|
|
17792
|
+
sendPermissionVoteError: sendPermissionVoteError2
|
|
17793
|
+
} = deps;
|
|
17794
|
+
app.post("/session/:id/permission/:requestId", mutate(), (req, res) => {
|
|
17795
|
+
const sessionId = req.params["id"];
|
|
17796
|
+
const requestId = req.params["requestId"];
|
|
17797
|
+
const response = parsePermissionVoteBody(req, res);
|
|
17798
|
+
if (response === void 0) return;
|
|
17799
|
+
const clientId = parseClientIdHeader(req, res);
|
|
17800
|
+
if (clientId === null) return;
|
|
17801
|
+
const fromLoopback = detectFromLoopback(req);
|
|
17802
|
+
const context = {
|
|
17803
|
+
...clientId !== void 0 ? { clientId } : {},
|
|
17804
|
+
fromLoopback
|
|
17805
|
+
};
|
|
17806
|
+
let accepted;
|
|
17807
|
+
try {
|
|
17808
|
+
const runtime = requireSessionRuntime({
|
|
17809
|
+
sessionId,
|
|
17810
|
+
route: "POST /session/:id/permission/:requestId",
|
|
17811
|
+
res,
|
|
17812
|
+
workspaceRegistry,
|
|
17813
|
+
daemonLog,
|
|
17814
|
+
details: { requestId }
|
|
17815
|
+
});
|
|
17816
|
+
if (!runtime) return;
|
|
17817
|
+
accepted = runtime.bridge.respondToSessionPermission(
|
|
17818
|
+
sessionId,
|
|
17819
|
+
requestId,
|
|
17820
|
+
response,
|
|
17821
|
+
context
|
|
17822
|
+
);
|
|
17823
|
+
} catch (err) {
|
|
17824
|
+
sendPermissionVoteError2(res, err, {
|
|
17825
|
+
route: "POST /session/:id/permission/:requestId",
|
|
17826
|
+
sessionId
|
|
17827
|
+
});
|
|
17828
|
+
return;
|
|
18082
17829
|
}
|
|
18083
|
-
|
|
18084
|
-
|
|
17830
|
+
if (!accepted) {
|
|
17831
|
+
res.status(404).json({
|
|
17832
|
+
error: "No pending permission request for session",
|
|
17833
|
+
sessionId,
|
|
17834
|
+
requestId
|
|
17835
|
+
});
|
|
17836
|
+
return;
|
|
17837
|
+
}
|
|
17838
|
+
res.status(200).json({});
|
|
17839
|
+
});
|
|
17840
|
+
app.post("/permission/:requestId", mutate(), (req, res) => {
|
|
17841
|
+
const requestId = req.params["requestId"];
|
|
17842
|
+
const response = parsePermissionVoteBody(req, res);
|
|
17843
|
+
if (response === void 0) return;
|
|
17844
|
+
const clientId = parseClientIdHeader(req, res);
|
|
17845
|
+
if (clientId === null) return;
|
|
17846
|
+
const fromLoopback = detectFromLoopback(req);
|
|
17847
|
+
const context = {
|
|
17848
|
+
...clientId !== void 0 ? { clientId } : {},
|
|
17849
|
+
fromLoopback
|
|
17850
|
+
};
|
|
17851
|
+
let accepted;
|
|
17852
|
+
try {
|
|
17853
|
+
accepted = bridge.respondToPermission(requestId, response, context);
|
|
17854
|
+
} catch (err) {
|
|
17855
|
+
sendPermissionVoteError2(res, err, {
|
|
17856
|
+
route: "POST /permission/:requestId"
|
|
17857
|
+
});
|
|
17858
|
+
return;
|
|
17859
|
+
}
|
|
17860
|
+
if (!accepted) {
|
|
17861
|
+
res.status(404).json({ error: "No pending permission request", requestId });
|
|
17862
|
+
return;
|
|
17863
|
+
}
|
|
17864
|
+
res.status(200).json({});
|
|
17865
|
+
});
|
|
18085
17866
|
}
|
|
18086
|
-
__name(
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
17867
|
+
__name(registerPermissionRoutes, "registerPermissionRoutes");
|
|
17868
|
+
|
|
17869
|
+
// packages/cli/src/serve/routes/session.ts
|
|
17870
|
+
init_esbuild_shims();
|
|
17871
|
+
import * as crypto3 from "node:crypto";
|
|
17872
|
+
import * as path11 from "node:path";
|
|
17873
|
+
|
|
17874
|
+
// packages/cli/src/serve/server/prompt-deadline.ts
|
|
17875
|
+
init_esbuild_shims();
|
|
17876
|
+
var PromptDeadlineExceededError = class extends Error {
|
|
17877
|
+
static {
|
|
17878
|
+
__name(this, "PromptDeadlineExceededError");
|
|
18093
17879
|
}
|
|
18094
|
-
|
|
18095
|
-
|
|
17880
|
+
deadlineMs;
|
|
17881
|
+
constructor(deadlineMs) {
|
|
17882
|
+
super(`prompt exceeded the ${deadlineMs}ms deadline`);
|
|
17883
|
+
this.name = "PromptDeadlineExceededError";
|
|
17884
|
+
this.deadlineMs = deadlineMs;
|
|
18096
17885
|
}
|
|
18097
|
-
|
|
18098
|
-
|
|
17886
|
+
};
|
|
17887
|
+
function resolvePromptDeadlineMs(serverMs, requestMs) {
|
|
17888
|
+
if (serverMs === void 0 || !Number.isFinite(serverMs) || serverMs <= 0) {
|
|
17889
|
+
return void 0;
|
|
18099
17890
|
}
|
|
18100
|
-
if (
|
|
18101
|
-
return
|
|
17891
|
+
if (requestMs === void 0 || !Number.isFinite(requestMs) || requestMs <= 0) {
|
|
17892
|
+
return serverMs;
|
|
18102
17893
|
}
|
|
18103
|
-
|
|
18104
|
-
|
|
18105
|
-
|
|
18106
|
-
|
|
18107
|
-
|
|
18108
|
-
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
const workspaceExport = path15.match(
|
|
18116
|
-
/^\/workspaces\/[^/]+\/session\/([^/]+)\/export$/
|
|
18117
|
-
);
|
|
18118
|
-
if (workspaceExport?.[1] && req.method === "GET") {
|
|
18119
|
-
return {
|
|
18120
|
-
route: "GET /workspaces/:workspace/session/:id/export",
|
|
18121
|
-
sessionId: decodePathSegment(workspaceExport[1])
|
|
18122
|
-
};
|
|
18123
|
-
}
|
|
18124
|
-
const workspaceArchivedExport = path15.match(
|
|
18125
|
-
/^\/workspaces\/[^/]+\/session\/([^/]+)\/archive\/export$/
|
|
18126
|
-
);
|
|
18127
|
-
if (workspaceArchivedExport?.[1] && req.method === "GET") {
|
|
18128
|
-
return {
|
|
18129
|
-
route: "GET /workspaces/:workspace/session/:id/archive/export",
|
|
18130
|
-
sessionId: decodePathSegment(workspaceArchivedExport[1])
|
|
18131
|
-
};
|
|
18132
|
-
}
|
|
18133
|
-
const pluralWorkspacePrefix = /^\/workspaces\/[^/]+/;
|
|
18134
|
-
if (pluralWorkspacePrefix.test(path15)) {
|
|
18135
|
-
const suffix = path15.replace(pluralWorkspacePrefix, "/workspace");
|
|
18136
|
-
if (req.method === "GET") {
|
|
18137
|
-
if (suffix === "/workspace/mcp" || suffix === "/workspace/skills" || suffix === "/workspace/tools" || suffix === "/workspace/providers" || suffix === "/workspace/env" || suffix === "/workspace/preflight" || suffix === "/workspace/hooks" || suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/permissions" || suffix === "/workspace/trust" || suffix === "/workspace/memory" || suffix === "/workspace/agents") {
|
|
18138
|
-
return { route: `GET ${suffix}` };
|
|
18139
|
-
}
|
|
18140
|
-
if (/^\/workspace\/agents\/[^/]+$/.test(suffix)) {
|
|
18141
|
-
return { route: "GET /workspace/agents/:agentType" };
|
|
18142
|
-
}
|
|
18143
|
-
if (suffix === "/workspace/file") return { route: "GET /file" };
|
|
18144
|
-
if (suffix === "/workspace/file/bytes") {
|
|
18145
|
-
return { route: "GET /file/bytes" };
|
|
18146
|
-
}
|
|
18147
|
-
if (suffix === "/workspace/stat") return { route: "GET /stat" };
|
|
18148
|
-
if (suffix === "/workspace/list") return { route: "GET /list" };
|
|
18149
|
-
if (suffix === "/workspace/glob") return { route: "GET /glob" };
|
|
18150
|
-
if (/^\/workspace\/mcp\/[^/]+\/tools$/.test(suffix)) {
|
|
18151
|
-
return { route: "GET /workspace/mcp/:server/tools" };
|
|
18152
|
-
}
|
|
18153
|
-
if (/^\/workspace\/mcp\/[^/]+\/resources$/.test(suffix)) {
|
|
18154
|
-
return { route: "GET /workspace/mcp/:server/resources" };
|
|
18155
|
-
}
|
|
18156
|
-
}
|
|
18157
|
-
if (req.method === "POST") {
|
|
18158
|
-
if (suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/voice/transcribe" || suffix === "/workspace/permissions" || suffix === "/workspace/trust/request" || suffix === "/workspace/init" || suffix === "/workspace/reload" || suffix === "/workspace/file/write" || suffix === "/workspace/file/edit" || suffix === "/workspace/mcp/servers" || suffix === "/workspace/memory" || suffix === "/workspace/agents" || suffix === "/workspace/sessions/delete" || suffix === "/workspace/sessions/archive" || suffix === "/workspace/sessions/unarchive" || suffix === "/workspace/session-groups") {
|
|
18159
|
-
return { route: `POST ${suffix}` };
|
|
18160
|
-
}
|
|
18161
|
-
if (/^\/workspace\/tools\/[^/]+\/enable$/.test(suffix)) {
|
|
18162
|
-
return { route: "POST /workspace/tools/:name/enable" };
|
|
18163
|
-
}
|
|
18164
|
-
if (/^\/workspace\/mcp\/[^/]+\/restart$/.test(suffix)) {
|
|
18165
|
-
return { route: "POST /workspace/mcp/:server/restart" };
|
|
18166
|
-
}
|
|
18167
|
-
if (/^\/workspace\/agents\/[^/]+$/.test(suffix)) {
|
|
18168
|
-
return { route: "POST /workspace/agents/:agentType" };
|
|
18169
|
-
}
|
|
18170
|
-
if (/^\/workspace\/mcp\/[^/]+\/(approve|enable|disable|authenticate|clear-auth)$/.test(
|
|
18171
|
-
suffix
|
|
18172
|
-
)) {
|
|
18173
|
-
return {
|
|
18174
|
-
route: `POST /workspace/mcp/:server/${suffix.split("/").at(-1)}`
|
|
18175
|
-
};
|
|
18176
|
-
}
|
|
18177
|
-
}
|
|
18178
|
-
if (req.method === "DELETE" && /^\/workspace\/mcp\/servers\/[^/]+$/.test(suffix)) {
|
|
18179
|
-
return { route: "DELETE /workspace/mcp/servers/:name" };
|
|
18180
|
-
}
|
|
18181
|
-
if (req.method === "DELETE" && /^\/workspace\/agents\/[^/]+$/.test(suffix)) {
|
|
18182
|
-
return { route: "DELETE /workspace/agents/:agentType" };
|
|
18183
|
-
}
|
|
18184
|
-
if (suffix === "/workspace/session-groups" && req.method === "GET") {
|
|
18185
|
-
return { route: "GET /workspace/session-groups" };
|
|
18186
|
-
}
|
|
18187
|
-
if (/^\/workspace\/session-groups\/[^/]+$/.test(suffix) && req.method === "PATCH") {
|
|
18188
|
-
return { route: "PATCH /workspace/session-groups/:groupId" };
|
|
18189
|
-
}
|
|
18190
|
-
if (/^\/workspace\/session-groups\/[^/]+$/.test(suffix) && req.method === "DELETE") {
|
|
18191
|
-
return { route: "DELETE /workspace/session-groups/:groupId" };
|
|
18192
|
-
}
|
|
18193
|
-
}
|
|
18194
|
-
if (req.method === "POST" && path15 === "/workspace/init") {
|
|
18195
|
-
return { route: "POST /workspace/init" };
|
|
18196
|
-
}
|
|
18197
|
-
if (req.method === "POST" && path15 === "/workspace/setup-github") {
|
|
18198
|
-
return { route: "POST /workspace/setup-github" };
|
|
18199
|
-
}
|
|
18200
|
-
if (req.method === "POST" && path15 === "/workspace/reload") {
|
|
18201
|
-
return { route: "POST /workspace/reload" };
|
|
18202
|
-
}
|
|
18203
|
-
const mcpRestart = path15.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
|
|
18204
|
-
if (mcpRestart?.[1] && req.method === "POST") {
|
|
18205
|
-
return { route: "POST /workspace/mcp/:server/restart" };
|
|
18206
|
-
}
|
|
18207
|
-
if (req.method === "POST" && path15 === "/workspace/mcp/servers") {
|
|
18208
|
-
return { route: "POST /workspace/mcp/servers" };
|
|
18209
|
-
}
|
|
18210
|
-
const mcpDelete = path15.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
|
|
18211
|
-
if (mcpDelete?.[1] && req.method === "DELETE") {
|
|
18212
|
-
return { route: "DELETE /workspace/mcp/servers/:name" };
|
|
18213
|
-
}
|
|
18214
|
-
if (req.method === "POST" && path15 === "/workspace/auth/device-flow") {
|
|
18215
|
-
return { route: "POST /workspace/auth/device-flow" };
|
|
18216
|
-
}
|
|
18217
|
-
const deviceFlowDelete = path15.match(
|
|
18218
|
-
/^\/workspace\/auth\/device-flow\/([^/]+)$/
|
|
18219
|
-
);
|
|
18220
|
-
if (deviceFlowDelete?.[1] && req.method === "DELETE") {
|
|
18221
|
-
return { route: "DELETE /workspace/auth/device-flow/:id" };
|
|
18222
|
-
}
|
|
18223
|
-
const toolEnable = path15.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
|
|
18224
|
-
if (toolEnable?.[1] && req.method === "POST") {
|
|
18225
|
-
return { route: "POST /workspace/tools/:name/enable" };
|
|
18226
|
-
}
|
|
18227
|
-
if (path15 === "/workspace/settings") {
|
|
18228
|
-
if (req.method === "GET") return { route: "GET /workspace/settings" };
|
|
18229
|
-
if (req.method === "POST") return { route: "POST /workspace/settings" };
|
|
18230
|
-
}
|
|
18231
|
-
if (path15 === "/workspace/permissions") {
|
|
18232
|
-
if (req.method === "GET") return { route: "GET /workspace/permissions" };
|
|
18233
|
-
if (req.method === "POST") return { route: "POST /workspace/permissions" };
|
|
18234
|
-
}
|
|
18235
|
-
if (path15 === "/workspace/trust") {
|
|
18236
|
-
if (req.method === "GET") return { route: "GET /workspace/trust" };
|
|
18237
|
-
}
|
|
18238
|
-
if (req.method === "POST" && path15 === "/workspace/trust/request") {
|
|
18239
|
-
return { route: "POST /workspace/trust/request" };
|
|
18240
|
-
}
|
|
18241
|
-
if (path15 === "/workspace/voice") {
|
|
18242
|
-
if (req.method === "GET") return { route: "GET /workspace/voice" };
|
|
18243
|
-
if (req.method === "POST") return { route: "POST /workspace/voice" };
|
|
18244
|
-
}
|
|
18245
|
-
if (req.method === "POST" && path15 === "/workspace/voice/transcribe") {
|
|
18246
|
-
return { route: "POST /workspace/voice/transcribe" };
|
|
18247
|
-
}
|
|
18248
|
-
return void 0;
|
|
18249
|
-
}
|
|
18250
|
-
__name(resolveDaemonTelemetryRoute, "resolveDaemonTelemetryRoute");
|
|
18251
|
-
function daemonTelemetryMiddleware(resolveWorkspaceCwd, recordRequest) {
|
|
18252
|
-
const workspaceHashByCwd = /* @__PURE__ */ new Map();
|
|
18253
|
-
const resolveWorkspaceHash = /* @__PURE__ */ __name((workspaceCwd) => {
|
|
18254
|
-
const existing = workspaceHashByCwd.get(workspaceCwd);
|
|
18255
|
-
if (existing !== void 0) return existing;
|
|
18256
|
-
const workspaceHash = hashDaemonWorkspace(workspaceCwd);
|
|
18257
|
-
workspaceHashByCwd.set(workspaceCwd, workspaceHash);
|
|
18258
|
-
return workspaceHash;
|
|
18259
|
-
}, "resolveWorkspaceHash");
|
|
18260
|
-
return (req, res, next) => {
|
|
18261
|
-
const route = resolveDaemonTelemetryRoute(req);
|
|
18262
|
-
if (!route) {
|
|
18263
|
-
next();
|
|
18264
|
-
return;
|
|
18265
|
-
}
|
|
18266
|
-
const sessionId = route.sessionId;
|
|
18267
|
-
let workspaceHash;
|
|
18268
|
-
if (route.attribution !== "handler_resolved") {
|
|
18269
|
-
try {
|
|
18270
|
-
workspaceHash = resolveWorkspaceHash(resolveWorkspaceCwd(req));
|
|
18271
|
-
} catch {
|
|
18272
|
-
}
|
|
18273
|
-
}
|
|
18274
|
-
const rawClientId = req.get(CLIENT_ID_HEADER);
|
|
18275
|
-
const clientId = rawClientId !== void 0 && rawClientId !== "" && rawClientId.length <= MAX_CLIENT_ID_LENGTH && CLIENT_ID_RE.test(rawClientId) ? rawClientId : void 0;
|
|
18276
|
-
const deferredRuntime = getDeferredRuntimeRequestTiming(req);
|
|
18277
|
-
const startMs = deferredRuntime?.startedAt.getTime() ?? Date.now();
|
|
18278
|
-
const telemetryRes = res;
|
|
18279
|
-
if (route.attribution === "handler_resolved") {
|
|
18280
|
-
try {
|
|
18281
|
-
telemetryRes[daemonTelemetryResponseContext] = {};
|
|
18282
|
-
} catch {
|
|
18283
|
-
}
|
|
18284
|
-
}
|
|
18285
|
-
void withDaemonRequestSpan(
|
|
18286
|
-
{
|
|
18287
|
-
method: req.method,
|
|
18288
|
-
route: route.route,
|
|
18289
|
-
...workspaceHash !== void 0 ? { workspaceHash } : {},
|
|
18290
|
-
...sessionId ? { sessionId } : {},
|
|
18291
|
-
...route.permissionRequestId ? { permissionRequestId: route.permissionRequestId } : {},
|
|
18292
|
-
...clientId ? { clientId } : {},
|
|
18293
|
-
...deferredRuntime?.waitMs !== void 0 ? {
|
|
18294
|
-
startTime: deferredRuntime.startedAt,
|
|
18295
|
-
deferredRuntimeWaitMs: deferredRuntime.waitMs,
|
|
18296
|
-
deferredRuntimePath: deferredRuntime.path
|
|
18297
|
-
} : {}
|
|
18298
|
-
},
|
|
18299
|
-
async (span) => await new Promise((resolve5, reject) => {
|
|
18300
|
-
let done = false;
|
|
18301
|
-
const finish = /* @__PURE__ */ __name(() => {
|
|
18302
|
-
if (done) return;
|
|
18303
|
-
done = true;
|
|
18304
|
-
try {
|
|
18305
|
-
const context = telemetryRes[daemonTelemetryResponseContext];
|
|
18306
|
-
delete telemetryRes[daemonTelemetryResponseContext];
|
|
18307
|
-
if (context?.workspaceCwd !== void 0) {
|
|
18308
|
-
span?.setAttribute(
|
|
18309
|
-
"qwen-code.workspace.hash",
|
|
18310
|
-
resolveWorkspaceHash(context.workspaceCwd)
|
|
18311
|
-
);
|
|
18312
|
-
}
|
|
18313
|
-
} catch {
|
|
18314
|
-
}
|
|
18315
|
-
recordDaemonHttpResponse(span, res.statusCode);
|
|
18316
|
-
const durationMs = Date.now() - startMs;
|
|
18317
|
-
const successfulSse = route.route === "GET /session/:id/events" && res.statusCode === 200 && res.headersSent;
|
|
18318
|
-
if (!successfulSse) {
|
|
18319
|
-
recordDaemonHttpRequest(
|
|
18320
|
-
durationMs,
|
|
18321
|
-
route.route,
|
|
18322
|
-
res.statusCode,
|
|
18323
|
-
deferredRuntime?.path
|
|
18324
|
-
);
|
|
18325
|
-
}
|
|
18326
|
-
if (!successfulSse && route.route !== "GET /daemon/status" && route.route !== "POST /session/:id/heartbeat") {
|
|
18327
|
-
recordRequest?.(durationMs, res.statusCode);
|
|
18328
|
-
}
|
|
18329
|
-
resolve5();
|
|
18330
|
-
}, "finish");
|
|
18331
|
-
res.once("finish", finish);
|
|
18332
|
-
res.once("close", finish);
|
|
18333
|
-
try {
|
|
18334
|
-
next();
|
|
18335
|
-
} catch (error2) {
|
|
18336
|
-
recordDaemonError(span, error2);
|
|
18337
|
-
reject(error2);
|
|
18338
|
-
}
|
|
18339
|
-
})
|
|
18340
|
-
).catch(next);
|
|
18341
|
-
};
|
|
18342
|
-
}
|
|
18343
|
-
__name(daemonTelemetryMiddleware, "daemonTelemetryMiddleware");
|
|
18344
|
-
|
|
18345
|
-
// packages/cli/src/serve/routes/session-runtime.ts
|
|
18346
|
-
function requireSessionRuntime(opts) {
|
|
18347
|
-
const {
|
|
18348
|
-
sessionId,
|
|
18349
|
-
route,
|
|
18350
|
-
res,
|
|
18351
|
-
workspaceRegistry,
|
|
18352
|
-
daemonLog,
|
|
18353
|
-
details = {}
|
|
18354
|
-
} = opts;
|
|
18355
|
-
if (workspaceRegistry.list().length === 1) {
|
|
18356
|
-
const runtime = workspaceRegistry.primary;
|
|
18357
|
-
setDaemonTelemetryWorkspace(res, runtime.workspaceCwd);
|
|
18358
|
-
return runtime;
|
|
18359
|
-
}
|
|
18360
|
-
const resolution = workspaceRegistry.resolveLiveSessionOwner(sessionId);
|
|
18361
|
-
if (resolution.kind === "found") {
|
|
18362
|
-
const runtime = resolution.runtime;
|
|
18363
|
-
setDaemonTelemetryWorkspace(res, runtime.workspaceCwd);
|
|
18364
|
-
if (!runtime.primary && !runtime.trusted) {
|
|
18365
|
-
daemonLog?.warn("session routing failed", {
|
|
18366
|
-
route,
|
|
18367
|
-
resolutionKind: "untrusted_workspace",
|
|
18368
|
-
sessionId,
|
|
18369
|
-
workspaceId: runtime.workspaceId,
|
|
18370
|
-
workspaceCwd: runtime.workspaceCwd,
|
|
18371
|
-
...details
|
|
18372
|
-
});
|
|
18373
|
-
sendUntrustedWorkspaceResponse(res, {
|
|
18374
|
-
sessionId,
|
|
18375
|
-
workspaceCwd: runtime.workspaceCwd,
|
|
18376
|
-
workspaceId: runtime.workspaceId
|
|
18377
|
-
});
|
|
18378
|
-
return void 0;
|
|
18379
|
-
}
|
|
18380
|
-
return runtime;
|
|
18381
|
-
}
|
|
18382
|
-
if (resolution.kind === "not_found") {
|
|
18383
|
-
daemonLog?.warn("session routing failed", {
|
|
18384
|
-
route,
|
|
18385
|
-
resolutionKind: "not_found",
|
|
18386
|
-
sessionId,
|
|
18387
|
-
...details
|
|
18388
|
-
});
|
|
18389
|
-
res.status(404).json({
|
|
18390
|
-
error: `No session with id "${sessionId}"`,
|
|
18391
|
-
code: "session_not_found",
|
|
18392
|
-
sessionId
|
|
18393
|
-
});
|
|
18394
|
-
return void 0;
|
|
18395
|
-
}
|
|
18396
|
-
const workspaceIds = resolution.runtimes.map(
|
|
18397
|
-
(runtime) => runtime.workspaceId
|
|
18398
|
-
);
|
|
18399
|
-
daemonLog?.warn("session routing failed", {
|
|
18400
|
-
route,
|
|
18401
|
-
resolutionKind: "ambiguous",
|
|
18402
|
-
sessionId,
|
|
18403
|
-
workspaceIds,
|
|
18404
|
-
...details
|
|
18405
|
-
});
|
|
18406
|
-
res.status(500).json({
|
|
18407
|
-
error: `Session owner is ambiguous for "${sessionId}"`,
|
|
18408
|
-
code: "ambiguous_session_owner",
|
|
18409
|
-
sessionId,
|
|
18410
|
-
route,
|
|
18411
|
-
workspaceIds
|
|
18412
|
-
});
|
|
18413
|
-
return void 0;
|
|
18414
|
-
}
|
|
18415
|
-
__name(requireSessionRuntime, "requireSessionRuntime");
|
|
18416
|
-
|
|
18417
|
-
// packages/cli/src/serve/routes/permission.ts
|
|
18418
|
-
function registerPermissionRoutes(app, deps) {
|
|
18419
|
-
const {
|
|
18420
|
-
bridge,
|
|
18421
|
-
workspaceRegistry,
|
|
18422
|
-
daemonLog,
|
|
18423
|
-
mutate,
|
|
18424
|
-
sendPermissionVoteError: sendPermissionVoteError2
|
|
18425
|
-
} = deps;
|
|
18426
|
-
app.post("/session/:id/permission/:requestId", mutate(), (req, res) => {
|
|
18427
|
-
const sessionId = req.params["id"];
|
|
18428
|
-
const requestId = req.params["requestId"];
|
|
18429
|
-
const response = parsePermissionVoteBody(req, res);
|
|
18430
|
-
if (response === void 0) return;
|
|
18431
|
-
const clientId = parseClientIdHeader(req, res);
|
|
18432
|
-
if (clientId === null) return;
|
|
18433
|
-
const fromLoopback = detectFromLoopback(req);
|
|
18434
|
-
const context = {
|
|
18435
|
-
...clientId !== void 0 ? { clientId } : {},
|
|
18436
|
-
fromLoopback
|
|
18437
|
-
};
|
|
18438
|
-
let accepted;
|
|
18439
|
-
try {
|
|
18440
|
-
const runtime = requireSessionRuntime({
|
|
18441
|
-
sessionId,
|
|
18442
|
-
route: "POST /session/:id/permission/:requestId",
|
|
18443
|
-
res,
|
|
18444
|
-
workspaceRegistry,
|
|
18445
|
-
daemonLog,
|
|
18446
|
-
details: { requestId }
|
|
18447
|
-
});
|
|
18448
|
-
if (!runtime) return;
|
|
18449
|
-
accepted = runtime.bridge.respondToSessionPermission(
|
|
18450
|
-
sessionId,
|
|
18451
|
-
requestId,
|
|
18452
|
-
response,
|
|
18453
|
-
context
|
|
18454
|
-
);
|
|
18455
|
-
} catch (err) {
|
|
18456
|
-
sendPermissionVoteError2(res, err, {
|
|
18457
|
-
route: "POST /session/:id/permission/:requestId",
|
|
18458
|
-
sessionId
|
|
18459
|
-
});
|
|
18460
|
-
return;
|
|
18461
|
-
}
|
|
18462
|
-
if (!accepted) {
|
|
18463
|
-
res.status(404).json({
|
|
18464
|
-
error: "No pending permission request for session",
|
|
18465
|
-
sessionId,
|
|
18466
|
-
requestId
|
|
18467
|
-
});
|
|
18468
|
-
return;
|
|
18469
|
-
}
|
|
18470
|
-
res.status(200).json({});
|
|
18471
|
-
});
|
|
18472
|
-
app.post("/permission/:requestId", mutate(), (req, res) => {
|
|
18473
|
-
const requestId = req.params["requestId"];
|
|
18474
|
-
const response = parsePermissionVoteBody(req, res);
|
|
18475
|
-
if (response === void 0) return;
|
|
18476
|
-
const clientId = parseClientIdHeader(req, res);
|
|
18477
|
-
if (clientId === null) return;
|
|
18478
|
-
const fromLoopback = detectFromLoopback(req);
|
|
18479
|
-
const context = {
|
|
18480
|
-
...clientId !== void 0 ? { clientId } : {},
|
|
18481
|
-
fromLoopback
|
|
18482
|
-
};
|
|
18483
|
-
let accepted;
|
|
18484
|
-
try {
|
|
18485
|
-
accepted = bridge.respondToPermission(requestId, response, context);
|
|
18486
|
-
} catch (err) {
|
|
18487
|
-
sendPermissionVoteError2(res, err, {
|
|
18488
|
-
route: "POST /permission/:requestId"
|
|
18489
|
-
});
|
|
18490
|
-
return;
|
|
18491
|
-
}
|
|
18492
|
-
if (!accepted) {
|
|
18493
|
-
res.status(404).json({ error: "No pending permission request", requestId });
|
|
18494
|
-
return;
|
|
18495
|
-
}
|
|
18496
|
-
res.status(200).json({});
|
|
18497
|
-
});
|
|
18498
|
-
}
|
|
18499
|
-
__name(registerPermissionRoutes, "registerPermissionRoutes");
|
|
18500
|
-
|
|
18501
|
-
// packages/cli/src/serve/routes/session.ts
|
|
18502
|
-
init_esbuild_shims();
|
|
18503
|
-
import * as crypto3 from "node:crypto";
|
|
18504
|
-
import * as path11 from "node:path";
|
|
18505
|
-
|
|
18506
|
-
// packages/cli/src/serve/server/prompt-deadline.ts
|
|
18507
|
-
init_esbuild_shims();
|
|
18508
|
-
var PromptDeadlineExceededError = class extends Error {
|
|
18509
|
-
static {
|
|
18510
|
-
__name(this, "PromptDeadlineExceededError");
|
|
18511
|
-
}
|
|
18512
|
-
deadlineMs;
|
|
18513
|
-
constructor(deadlineMs) {
|
|
18514
|
-
super(`prompt exceeded the ${deadlineMs}ms deadline`);
|
|
18515
|
-
this.name = "PromptDeadlineExceededError";
|
|
18516
|
-
this.deadlineMs = deadlineMs;
|
|
18517
|
-
}
|
|
18518
|
-
};
|
|
18519
|
-
function resolvePromptDeadlineMs(serverMs, requestMs) {
|
|
18520
|
-
if (serverMs === void 0 || !Number.isFinite(serverMs) || serverMs <= 0) {
|
|
18521
|
-
return void 0;
|
|
18522
|
-
}
|
|
18523
|
-
if (requestMs === void 0 || !Number.isFinite(requestMs) || requestMs <= 0) {
|
|
18524
|
-
return serverMs;
|
|
18525
|
-
}
|
|
18526
|
-
return Math.min(serverMs, requestMs);
|
|
18527
|
-
}
|
|
18528
|
-
__name(resolvePromptDeadlineMs, "resolvePromptDeadlineMs");
|
|
18529
|
-
|
|
18530
|
-
// packages/cli/src/serve/server/session-list.ts
|
|
18531
|
-
init_esbuild_shims();
|
|
18532
|
-
var DEFAULT_SESSION_PAGE_SIZE = 20;
|
|
18533
|
-
var MAX_SESSION_PAGE_SIZE = 100;
|
|
18534
|
-
var MAX_ORGANIZED_SESSIONS = 5e4;
|
|
18535
|
-
var InvalidCursorError = class extends Error {
|
|
18536
|
-
static {
|
|
18537
|
-
__name(this, "InvalidCursorError");
|
|
17894
|
+
return Math.min(serverMs, requestMs);
|
|
17895
|
+
}
|
|
17896
|
+
__name(resolvePromptDeadlineMs, "resolvePromptDeadlineMs");
|
|
17897
|
+
|
|
17898
|
+
// packages/cli/src/serve/server/session-list.ts
|
|
17899
|
+
init_esbuild_shims();
|
|
17900
|
+
var DEFAULT_SESSION_PAGE_SIZE = 20;
|
|
17901
|
+
var MAX_SESSION_PAGE_SIZE = 100;
|
|
17902
|
+
var MAX_ORGANIZED_SESSIONS = 5e4;
|
|
17903
|
+
var InvalidCursorError = class extends Error {
|
|
17904
|
+
static {
|
|
17905
|
+
__name(this, "InvalidCursorError");
|
|
18538
17906
|
}
|
|
18539
17907
|
constructor(cursor, kind = "numeric") {
|
|
18540
17908
|
super(`Invalid cursor: "${cursor}" is not a valid ${kind} cursor`);
|
|
@@ -19011,19 +18379,6 @@ function listLiveWorkspaceSessionsForResponse(bridge, workspaceCwd, options) {
|
|
|
19011
18379
|
};
|
|
19012
18380
|
}
|
|
19013
18381
|
__name(listLiveWorkspaceSessionsForResponse, "listLiveWorkspaceSessionsForResponse");
|
|
19014
|
-
async function getWorkspaceSessionInfoForResponse(bridge, workspaceCwd, options = {}) {
|
|
19015
|
-
const counts = await new SessionService(workspaceCwd).getSessionInfoCounts();
|
|
19016
|
-
return {
|
|
19017
|
-
active: counts.active,
|
|
19018
|
-
archived: counts.archived,
|
|
19019
|
-
total: counts.total,
|
|
19020
|
-
...options.includeLive === false ? {} : { live: bridge.listWorkspaceSessions(workspaceCwd).length },
|
|
19021
|
-
expensive: true,
|
|
19022
|
-
cost: "disk_scan",
|
|
19023
|
-
...counts.truncated ? { truncated: true } : {}
|
|
19024
|
-
};
|
|
19025
|
-
}
|
|
19026
|
-
__name(getWorkspaceSessionInfoForResponse, "getWorkspaceSessionInfoForResponse");
|
|
19027
18382
|
function parseSessionPageSizeQuery(raw) {
|
|
19028
18383
|
if (typeof raw !== "string") return void 0;
|
|
19029
18384
|
const trimmed = raw.trim();
|
|
@@ -19096,21 +18451,11 @@ async function exportSessionTranscript(params) {
|
|
|
19096
18451
|
__name(exportSessionTranscript, "exportSessionTranscript");
|
|
19097
18452
|
|
|
19098
18453
|
// packages/cli/src/serve/routes/session.ts
|
|
18454
|
+
var WORKSPACE_TRANSCRIPT_PAGE_SOURCE_MAX_BYTES = 4 * 1024 * 1024;
|
|
19099
18455
|
var WORKSPACE_TRANSCRIPT_RESPONSE_MAX_BYTES = 32 * 1024 * 1024;
|
|
19100
18456
|
var WORKSPACE_TRANSCRIPT_CURSOR_MAX_BYTES = 64 * 1024;
|
|
19101
18457
|
var TRANSCRIPT_CURSOR_TOO_LARGE_REPLAY_ERROR = "Transcript pagination state exceeds the safe limit";
|
|
19102
18458
|
var GENERATION_HEARTBEAT_MS = 15e3;
|
|
19103
|
-
var PRIMARY_ONLY_LIVE_SESSION_ROUTES = [
|
|
19104
|
-
"POST /session/:id/branch",
|
|
19105
|
-
"POST /session/:id/fork",
|
|
19106
|
-
"POST /session/:id/cd"
|
|
19107
|
-
];
|
|
19108
|
-
function isPrimaryOnlyLiveSessionRoute(route) {
|
|
19109
|
-
return PRIMARY_ONLY_LIVE_SESSION_ROUTES.includes(
|
|
19110
|
-
route
|
|
19111
|
-
);
|
|
19112
|
-
}
|
|
19113
|
-
__name(isPrimaryOnlyLiveSessionRoute, "isPrimaryOnlyLiveSessionRoute");
|
|
19114
18459
|
function formatGenerationSse(event, data) {
|
|
19115
18460
|
return `event: ${event}
|
|
19116
18461
|
data: ${JSON.stringify({ v: 1, ...data })}
|
|
@@ -19239,32 +18584,6 @@ function parseTranscriptCursorQuery(rawCursor, res) {
|
|
|
19239
18584
|
return rawCursor;
|
|
19240
18585
|
}
|
|
19241
18586
|
__name(parseTranscriptCursorQuery, "parseTranscriptCursorQuery");
|
|
19242
|
-
function parseTranscriptRecordBoundaryQuery(rawBoundary, res) {
|
|
19243
|
-
if (rawBoundary === void 0) return void 0;
|
|
19244
|
-
if (typeof rawBoundary !== "string" || rawBoundary.trim() === "" || rawBoundary.length > 200) {
|
|
19245
|
-
res.status(400).json({
|
|
19246
|
-
error: "`beforeRecordId` must be a non-empty record id",
|
|
19247
|
-
code: "invalid_transcript_cursor"
|
|
19248
|
-
});
|
|
19249
|
-
return null;
|
|
19250
|
-
}
|
|
19251
|
-
return rawBoundary;
|
|
19252
|
-
}
|
|
19253
|
-
__name(parseTranscriptRecordBoundaryQuery, "parseTranscriptRecordBoundaryQuery");
|
|
19254
|
-
function parseHistoryPageSize(body, res) {
|
|
19255
|
-
const value = body["historyPageSize"];
|
|
19256
|
-
if (value === void 0) return void 0;
|
|
19257
|
-
if (!Number.isSafeInteger(value) || value < 1 || value > SESSION_TRANSCRIPT_MAX_LIMIT) {
|
|
19258
|
-
res.status(400).json({
|
|
19259
|
-
error: `\`historyPageSize\` must be between 1 and ${SESSION_TRANSCRIPT_MAX_LIMIT}`,
|
|
19260
|
-
code: "invalid_transcript_limit",
|
|
19261
|
-
maxLimit: SESSION_TRANSCRIPT_MAX_LIMIT
|
|
19262
|
-
});
|
|
19263
|
-
return null;
|
|
19264
|
-
}
|
|
19265
|
-
return value;
|
|
19266
|
-
}
|
|
19267
|
-
__name(parseHistoryPageSize, "parseHistoryPageSize");
|
|
19268
18587
|
function workspaceTranscriptCursorExceedsLimit(cursor, maxBytes = WORKSPACE_TRANSCRIPT_CURSOR_MAX_BYTES) {
|
|
19269
18588
|
return Buffer.byteLength(cursor) > maxBytes;
|
|
19270
18589
|
}
|
|
@@ -19386,7 +18705,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19386
18705
|
return void 0;
|
|
19387
18706
|
}
|
|
19388
18707
|
if (workspaceRegistry.list().length === 1) {
|
|
19389
|
-
setDaemonTelemetryWorkspace(res, workspaceRegistry.primary.workspaceCwd);
|
|
19390
18708
|
return {
|
|
19391
18709
|
runtime: workspaceRegistry.primary,
|
|
19392
18710
|
workspaceCwd: "cwd" in body ? key : workspaceRegistry.primary.workspaceCwd
|
|
@@ -19402,7 +18720,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19402
18720
|
sendWorkspaceMismatch2(res, key);
|
|
19403
18721
|
return void 0;
|
|
19404
18722
|
}
|
|
19405
|
-
setDaemonTelemetryWorkspace(res, runtime.workspaceCwd);
|
|
19406
18723
|
if (!runtime.primary && !runtime.trusted) {
|
|
19407
18724
|
logSessionRoutingFailure("POST /session", "untrusted_workspace", {
|
|
19408
18725
|
workspaceId: runtime.workspaceId,
|
|
@@ -19655,7 +18972,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19655
18972
|
sendWorkspaceMismatch2(res, key);
|
|
19656
18973
|
return void 0;
|
|
19657
18974
|
}
|
|
19658
|
-
setDaemonTelemetryWorkspace(res, runtime.workspaceCwd);
|
|
19659
18975
|
if (!runtime.primary && !runtime.trusted) {
|
|
19660
18976
|
logSessionRoutingFailure(route, "untrusted_workspace", {
|
|
19661
18977
|
workspaceId: runtime.workspaceId,
|
|
@@ -19693,7 +19009,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
19693
19009
|
}), "resolveLiveSessionRuntime");
|
|
19694
19010
|
const sendNonPrimarySessionRouteUnsupported = /* @__PURE__ */ __name((res, route, sessionId, runtime) => {
|
|
19695
19011
|
res.status(400).json({
|
|
19696
|
-
error: `Route "${route}" is only
|
|
19012
|
+
error: `Route "${route}" is primary-only for non-primary workspace sessions in Phase 2a.`,
|
|
19697
19013
|
code: "non_primary_session_route_not_supported",
|
|
19698
19014
|
sessionId,
|
|
19699
19015
|
workspaceId: runtime.workspaceId,
|
|
@@ -19741,7 +19057,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19741
19057
|
}, "throwMissingActiveTranscript");
|
|
19742
19058
|
if (workspaceRegistry.list().length === 1) {
|
|
19743
19059
|
const runtime = workspaceRegistry.primary;
|
|
19744
|
-
setDaemonTelemetryWorkspace(res, runtime.workspaceCwd);
|
|
19745
19060
|
if (await activeInRuntime(runtime)) {
|
|
19746
19061
|
return runtime;
|
|
19747
19062
|
}
|
|
@@ -19753,7 +19068,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19753
19068
|
return void 0;
|
|
19754
19069
|
}
|
|
19755
19070
|
if (liveOwner.kind === "found") {
|
|
19756
|
-
setDaemonTelemetryWorkspace(res, liveOwner.runtime.workspaceCwd);
|
|
19757
19071
|
if (!assertTrustedSessionOwner(res, route, sessionId, liveOwner.runtime)) {
|
|
19758
19072
|
return void 0;
|
|
19759
19073
|
}
|
|
@@ -19788,7 +19102,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19788
19102
|
}
|
|
19789
19103
|
if (activeRuntimes.length === 1) {
|
|
19790
19104
|
const runtime = activeRuntimes[0];
|
|
19791
|
-
setDaemonTelemetryWorkspace(res, runtime.workspaceCwd);
|
|
19792
19105
|
if (!assertTrustedSessionOwner(res, route, sessionId, runtime)) {
|
|
19793
19106
|
return void 0;
|
|
19794
19107
|
}
|
|
@@ -19845,37 +19158,23 @@ function registerSessionRoutes(app, deps) {
|
|
|
19845
19158
|
}
|
|
19846
19159
|
return key;
|
|
19847
19160
|
}, "resolveWorkspaceParam");
|
|
19848
|
-
const
|
|
19849
|
-
|
|
19850
|
-
|
|
19161
|
+
const withMutableSession = /* @__PURE__ */ __name((route, handler) => async (req, res) => {
|
|
19162
|
+
const sessionId = requireSessionId(req, res);
|
|
19163
|
+
if (sessionId === null) return;
|
|
19164
|
+
const runtime = resolveLiveSessionRuntime(sessionId, res, route);
|
|
19165
|
+
if (!runtime) return;
|
|
19166
|
+
if (!runtime.primary) {
|
|
19167
|
+
sendNonPrimarySessionRouteUnsupported(res, route, sessionId, runtime);
|
|
19168
|
+
return;
|
|
19851
19169
|
}
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
"non_primary_session_route_not_supported",
|
|
19861
|
-
{
|
|
19862
|
-
sessionId,
|
|
19863
|
-
workspaceId: runtime.workspaceId,
|
|
19864
|
-
workspaceCwd: runtime.workspaceCwd
|
|
19865
|
-
}
|
|
19866
|
-
);
|
|
19867
|
-
sendNonPrimarySessionRouteUnsupported(res, route, sessionId, runtime);
|
|
19868
|
-
return;
|
|
19869
|
-
}
|
|
19870
|
-
try {
|
|
19871
|
-
await archiveCoordinator.runSharedMany([sessionId], async () => {
|
|
19872
|
-
await handler(req, res, sessionId);
|
|
19873
|
-
});
|
|
19874
|
-
} catch (err) {
|
|
19875
|
-
sendBridgeError2(res, err, { route, sessionId });
|
|
19876
|
-
}
|
|
19877
|
-
};
|
|
19878
|
-
}, "withPrimaryOnlyMutableSession");
|
|
19170
|
+
try {
|
|
19171
|
+
await archiveCoordinator.runSharedMany([sessionId], async () => {
|
|
19172
|
+
await handler(req, res, sessionId);
|
|
19173
|
+
});
|
|
19174
|
+
} catch (err) {
|
|
19175
|
+
sendBridgeError2(res, err, { route, sessionId });
|
|
19176
|
+
}
|
|
19177
|
+
}, "withMutableSession");
|
|
19879
19178
|
app.post("/session", mutate(), async (req, res) => {
|
|
19880
19179
|
const body = safeBody(req);
|
|
19881
19180
|
const resolvedRuntime = resolveRuntimeForSessionCreation(body, res);
|
|
@@ -19986,11 +19285,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
19986
19285
|
releaseRestoreOwner();
|
|
19987
19286
|
return;
|
|
19988
19287
|
}
|
|
19989
|
-
const historyPageSize = action === "load" ? parseHistoryPageSize(body ?? {}, res) : void 0;
|
|
19990
|
-
if (historyPageSize === null) {
|
|
19991
|
-
releaseRestoreOwner();
|
|
19992
|
-
return;
|
|
19993
|
-
}
|
|
19994
19288
|
const clientId = parseClientIdHeader(req, res);
|
|
19995
19289
|
if (clientId === null) {
|
|
19996
19290
|
releaseRestoreOwner();
|
|
@@ -20008,7 +19302,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
20008
19302
|
sessionId,
|
|
20009
19303
|
workspaceCwd,
|
|
20010
19304
|
historyReplay: "response",
|
|
20011
|
-
...historyPageSize !== void 0 ? { historyPageSize } : {},
|
|
20012
19305
|
...clientId !== void 0 ? { clientId } : {},
|
|
20013
19306
|
...approvalMode !== void 0 ? { approvalMode } : {},
|
|
20014
19307
|
...metadata
|
|
@@ -20052,7 +19345,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
20052
19345
|
app.post(
|
|
20053
19346
|
"/session/:id/branch",
|
|
20054
19347
|
mutate(),
|
|
20055
|
-
|
|
19348
|
+
withMutableSession(
|
|
20056
19349
|
"POST /session/:id/branch",
|
|
20057
19350
|
async (req, res, sessionId) => {
|
|
20058
19351
|
const body = safeBody(req);
|
|
@@ -20087,7 +19380,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
20087
19380
|
app.post(
|
|
20088
19381
|
"/session/:id/fork",
|
|
20089
19382
|
mutate(),
|
|
20090
|
-
|
|
19383
|
+
withMutableSession(
|
|
20091
19384
|
"POST /session/:id/fork",
|
|
20092
19385
|
async (req, res, sessionId) => {
|
|
20093
19386
|
const body = safeBody(req);
|
|
@@ -20113,28 +19406,25 @@ function registerSessionRoutes(app, deps) {
|
|
|
20113
19406
|
app.post(
|
|
20114
19407
|
"/session/:id/cd",
|
|
20115
19408
|
mutate(),
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
});
|
|
20126
|
-
return;
|
|
20127
|
-
}
|
|
20128
|
-
const clientId = parseClientIdHeader(req, res);
|
|
20129
|
-
if (clientId === null) return;
|
|
20130
|
-
const result = await bridge.changeSessionCwd(
|
|
20131
|
-
sessionId,
|
|
20132
|
-
{ path: targetPath },
|
|
20133
|
-
clientId !== void 0 ? { clientId } : void 0
|
|
20134
|
-
);
|
|
20135
|
-
res.status(200).json(result);
|
|
19409
|
+
withMutableSession("POST /session/:id/cd", async (req, res, sessionId) => {
|
|
19410
|
+
const body = safeBody(req);
|
|
19411
|
+
const targetPath = body["path"];
|
|
19412
|
+
if (typeof targetPath !== "string" || targetPath.length === 0 || !path11.isAbsolute(targetPath)) {
|
|
19413
|
+
res.status(400).json({
|
|
19414
|
+
error: "`path` is required and must be an absolute path",
|
|
19415
|
+
code: "invalid_path"
|
|
19416
|
+
});
|
|
19417
|
+
return;
|
|
20136
19418
|
}
|
|
20137
|
-
|
|
19419
|
+
const clientId = parseClientIdHeader(req, res);
|
|
19420
|
+
if (clientId === null) return;
|
|
19421
|
+
const result = await bridge.changeSessionCwd(
|
|
19422
|
+
sessionId,
|
|
19423
|
+
{ path: targetPath },
|
|
19424
|
+
clientId !== void 0 ? { clientId } : void 0
|
|
19425
|
+
);
|
|
19426
|
+
res.status(200).json(result);
|
|
19427
|
+
})
|
|
20138
19428
|
);
|
|
20139
19429
|
app.get("/session/:id/status", (req, res) => {
|
|
20140
19430
|
const sessionId = requireSessionId(req, res);
|
|
@@ -20192,18 +19482,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
20192
19482
|
if (limit === null) return;
|
|
20193
19483
|
const cursor = parseTranscriptCursorQuery(req.query["cursor"], res);
|
|
20194
19484
|
if (cursor === null) return;
|
|
20195
|
-
const beforeRecordId = parseTranscriptRecordBoundaryQuery(
|
|
20196
|
-
req.query["beforeRecordId"],
|
|
20197
|
-
res
|
|
20198
|
-
);
|
|
20199
|
-
if (beforeRecordId === null) return;
|
|
20200
|
-
if (cursor !== void 0 && beforeRecordId !== void 0) {
|
|
20201
|
-
res.status(400).json({
|
|
20202
|
-
error: "`cursor` and `beforeRecordId` are mutually exclusive",
|
|
20203
|
-
code: "invalid_transcript_cursor"
|
|
20204
|
-
});
|
|
20205
|
-
return;
|
|
20206
|
-
}
|
|
20207
19485
|
try {
|
|
20208
19486
|
const result = await archiveCoordinator.runSharedMany(
|
|
20209
19487
|
[sessionId],
|
|
@@ -20218,8 +19496,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
20218
19496
|
return runtime.bridge.getSessionTranscriptPage({
|
|
20219
19497
|
sessionId,
|
|
20220
19498
|
...limit !== void 0 ? { limit } : {},
|
|
20221
|
-
...cursor !== void 0 ? { cursor } : {}
|
|
20222
|
-
...beforeRecordId !== void 0 ? { beforeRecordId } : {}
|
|
19499
|
+
...cursor !== void 0 ? { cursor } : {}
|
|
20223
19500
|
});
|
|
20224
19501
|
}
|
|
20225
19502
|
);
|
|
@@ -20254,18 +19531,6 @@ function registerSessionRoutes(app, deps) {
|
|
|
20254
19531
|
if (limit === null) return;
|
|
20255
19532
|
const cursor = parseTranscriptCursorQuery(req.query["cursor"], res);
|
|
20256
19533
|
if (cursor === null) return;
|
|
20257
|
-
const beforeRecordId = parseTranscriptRecordBoundaryQuery(
|
|
20258
|
-
req.query["beforeRecordId"],
|
|
20259
|
-
res
|
|
20260
|
-
);
|
|
20261
|
-
if (beforeRecordId === null) return;
|
|
20262
|
-
if (cursor !== void 0 && beforeRecordId !== void 0) {
|
|
20263
|
-
res.status(400).json({
|
|
20264
|
-
error: "`cursor` and `beforeRecordId` are mutually exclusive",
|
|
20265
|
-
code: "invalid_transcript_cursor"
|
|
20266
|
-
});
|
|
20267
|
-
return;
|
|
20268
|
-
}
|
|
20269
19534
|
if (cursor !== void 0 && workspaceTranscriptCursorExceedsLimit(cursor)) {
|
|
20270
19535
|
res.status(400).json({
|
|
20271
19536
|
error: "`cursor` exceeds the maximum size",
|
|
@@ -20290,8 +19555,7 @@ function registerSessionRoutes(app, deps) {
|
|
|
20290
19555
|
page = await reader.readPage(sessionId, {
|
|
20291
19556
|
...limit !== void 0 ? { limit } : {},
|
|
20292
19557
|
...cursor !== void 0 ? { cursor } : {},
|
|
20293
|
-
|
|
20294
|
-
maxBytes: SESSION_TRANSCRIPT_MAX_PAGE_BYTES
|
|
19558
|
+
maxBytes: WORKSPACE_TRANSCRIPT_PAGE_SOURCE_MAX_BYTES
|
|
20295
19559
|
});
|
|
20296
19560
|
} catch (error2) {
|
|
20297
19561
|
if (error2.code !== "ENOENT") {
|
|
@@ -21404,53 +20668,23 @@ function registerSessionRoutes(app, deps) {
|
|
|
21404
20668
|
)} (options=${safeLogValue(
|
|
21405
20669
|
JSON.stringify({
|
|
21406
20670
|
view: req.query["view"],
|
|
21407
|
-
archiveState: req.query["archiveState"],
|
|
21408
|
-
group: req.query["group"]
|
|
21409
|
-
})
|
|
21410
|
-
)}): ${safeLogValue(
|
|
21411
|
-
err instanceof Error ? err.message : String(err)
|
|
21412
|
-
)}`
|
|
21413
|
-
);
|
|
21414
|
-
res.status(500).json({
|
|
21415
|
-
error: "Failed to list sessions",
|
|
21416
|
-
code: "session_list_failed"
|
|
21417
|
-
});
|
|
21418
|
-
}
|
|
21419
|
-
}, "listWorkspaceSessionsHandler");
|
|
21420
|
-
app.get("/workspace/:id/sessions", listWorkspaceSessionsHandler("id"));
|
|
21421
|
-
app.get(
|
|
21422
|
-
"/workspaces/:workspace/sessions",
|
|
21423
|
-
listWorkspaceSessionsHandler("workspace")
|
|
21424
|
-
);
|
|
21425
|
-
const workspaceSessionInfoHandler = /* @__PURE__ */ __name((paramName) => async (req, res) => {
|
|
21426
|
-
const route = paramName === "workspace" ? "GET /workspaces/:workspace/session-info" : "GET /workspace/:id/session-info";
|
|
21427
|
-
const runtime = resolveRuntimeForCatalogRoute(req, res, paramName, route);
|
|
21428
|
-
if (runtime === null) return;
|
|
21429
|
-
const key = runtime.workspaceCwd;
|
|
21430
|
-
try {
|
|
21431
|
-
const info = await runWorkspaceInspectionWithLogPolicy(
|
|
21432
|
-
runtime,
|
|
21433
|
-
() => getWorkspaceSessionInfoForResponse(runtime.bridge, key, {
|
|
21434
|
-
includeLive: !isReadOnlyWorkspaceInspection(runtime)
|
|
21435
|
-
})
|
|
21436
|
-
);
|
|
21437
|
-
res.status(200).json(info);
|
|
21438
|
-
} catch (err) {
|
|
21439
|
-
writeStderrLine(
|
|
21440
|
-
`qwen serve: failed to read session-info for workspace ${safeLogValue(
|
|
21441
|
-
key
|
|
21442
|
-
)}: ${safeLogValue(err instanceof Error ? err.message : String(err))}`
|
|
20671
|
+
archiveState: req.query["archiveState"],
|
|
20672
|
+
group: req.query["group"]
|
|
20673
|
+
})
|
|
20674
|
+
)}): ${safeLogValue(
|
|
20675
|
+
err instanceof Error ? err.message : String(err)
|
|
20676
|
+
)}`
|
|
21443
20677
|
);
|
|
21444
20678
|
res.status(500).json({
|
|
21445
|
-
error: "Failed to
|
|
21446
|
-
code: "
|
|
20679
|
+
error: "Failed to list sessions",
|
|
20680
|
+
code: "session_list_failed"
|
|
21447
20681
|
});
|
|
21448
20682
|
}
|
|
21449
|
-
}, "
|
|
21450
|
-
app.get("/workspace/:id/
|
|
20683
|
+
}, "listWorkspaceSessionsHandler");
|
|
20684
|
+
app.get("/workspace/:id/sessions", listWorkspaceSessionsHandler("id"));
|
|
21451
20685
|
app.get(
|
|
21452
|
-
"/workspaces/:workspace/
|
|
21453
|
-
|
|
20686
|
+
"/workspaces/:workspace/sessions",
|
|
20687
|
+
listWorkspaceSessionsHandler("workspace")
|
|
21454
20688
|
);
|
|
21455
20689
|
app.post(
|
|
21456
20690
|
"/session/:id/model",
|
|
@@ -23954,7 +23188,7 @@ function sendBridgeError(res, err, ctx, daemonLog) {
|
|
|
23954
23188
|
if (err instanceof WorkspaceSkillNotToggleableError) {
|
|
23955
23189
|
res.status(409).json({
|
|
23956
23190
|
error: err.message,
|
|
23957
|
-
code:
|
|
23191
|
+
code: "skill_not_toggleable",
|
|
23958
23192
|
skillName: err.skillName,
|
|
23959
23193
|
reason: err.reason,
|
|
23960
23194
|
...err.lockedScope ? { lockedScope: err.lockedScope } : {}
|
|
@@ -24157,7 +23391,7 @@ function sendBridgeError(res, err, ctx, daemonLog) {
|
|
|
24157
23391
|
}
|
|
24158
23392
|
if (err instanceof WorkspaceMismatchError) {
|
|
24159
23393
|
writeStderrLine(
|
|
24160
|
-
`qwen serve: workspace_mismatch (POST /session):
|
|
23394
|
+
`qwen serve: workspace_mismatch (POST /session): daemon bound to ${JSON.stringify(err.bound)}, rejected ${JSON.stringify(err.requested)}`
|
|
24161
23395
|
);
|
|
24162
23396
|
res.status(400).json({
|
|
24163
23397
|
error: err.message,
|
|
@@ -24352,17 +23586,6 @@ function sendBridgeError(res, err, ctx, daemonLog) {
|
|
|
24352
23586
|
});
|
|
24353
23587
|
return;
|
|
24354
23588
|
}
|
|
24355
|
-
if (kind === "transcript_page_too_large") {
|
|
24356
|
-
const d = data;
|
|
24357
|
-
res.status(413).json({
|
|
24358
|
-
error: errorMessage2(err),
|
|
24359
|
-
code: "transcript_page_too_large",
|
|
24360
|
-
...d.sessionId ? { sessionId: d.sessionId } : {},
|
|
24361
|
-
...typeof d.pageBytes === "number" ? { pageBytes: d.pageBytes } : {},
|
|
24362
|
-
...typeof d.maxBytes === "number" ? { maxBytes: d.maxBytes } : {}
|
|
24363
|
-
});
|
|
24364
|
-
return;
|
|
24365
|
-
}
|
|
24366
23589
|
}
|
|
24367
23590
|
}
|
|
24368
23591
|
recordDaemonBridgeError(err);
|
|
@@ -25100,55 +24323,358 @@ function resolveBoundWorkspacesFromIdeEnv(primaryWorkspace, ideWorkspacePath = p
|
|
|
25100
24323
|
);
|
|
25101
24324
|
}
|
|
25102
24325
|
}
|
|
25103
|
-
if (envCanonicals.length > 0 && !envCanonicals.some(
|
|
25104
|
-
(workspace) => isWithinRoot2(primary, workspace) || isWithinRoot2(workspace, primary)
|
|
25105
|
-
)) {
|
|
25106
|
-
writeStderrLine(
|
|
25107
|
-
"qwen serve: ignoring stale IDE workspace paths that do not overlap the selected workspace"
|
|
25108
|
-
);
|
|
25109
|
-
return [primary];
|
|
24326
|
+
if (envCanonicals.length > 0 && !envCanonicals.some(
|
|
24327
|
+
(workspace) => isWithinRoot2(primary, workspace) || isWithinRoot2(workspace, primary)
|
|
24328
|
+
)) {
|
|
24329
|
+
writeStderrLine(
|
|
24330
|
+
"qwen serve: ignoring stale IDE workspace paths that do not overlap the selected workspace"
|
|
24331
|
+
);
|
|
24332
|
+
return [primary];
|
|
24333
|
+
}
|
|
24334
|
+
const workspaces = [primary, ...envCanonicals.filter((w) => w !== primary)];
|
|
24335
|
+
const filteredWorkspaces = includeWorkspace === void 0 ? workspaces : workspaces.filter(includeWorkspace);
|
|
24336
|
+
return dropNestedWorkspacesPreservingPrimary(filteredWorkspaces);
|
|
24337
|
+
}
|
|
24338
|
+
__name(resolveBoundWorkspacesFromIdeEnv, "resolveBoundWorkspacesFromIdeEnv");
|
|
24339
|
+
function parseIdeWorkspacePathEnv(value) {
|
|
24340
|
+
if (value === void 0 || value.length === 0) return [];
|
|
24341
|
+
if (value.trimStart().startsWith("[")) {
|
|
24342
|
+
try {
|
|
24343
|
+
const parsed = JSON.parse(value);
|
|
24344
|
+
if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
|
|
24345
|
+
return parsed.filter(
|
|
24346
|
+
(workspace) => workspace.length > 0 && path14.isAbsolute(workspace)
|
|
24347
|
+
);
|
|
24348
|
+
}
|
|
24349
|
+
throw new Error("IDE workspace path JSON must be a string array");
|
|
24350
|
+
} catch {
|
|
24351
|
+
}
|
|
24352
|
+
}
|
|
24353
|
+
return value.split(path14.delimiter).filter((workspace) => workspace.length > 0 && path14.isAbsolute(workspace));
|
|
24354
|
+
}
|
|
24355
|
+
__name(parseIdeWorkspacePathEnv, "parseIdeWorkspacePathEnv");
|
|
24356
|
+
function dropNestedWorkspacesPreservingPrimary(workspaces) {
|
|
24357
|
+
const primary = workspaces[0];
|
|
24358
|
+
if (primary === void 0) return [];
|
|
24359
|
+
const withoutPrimaryOverlaps = workspaces.filter(
|
|
24360
|
+
(workspace, i) => i === 0 || workspace !== primary && !isWithinRoot2(workspace, primary) && !isWithinRoot2(primary, workspace)
|
|
24361
|
+
);
|
|
24362
|
+
const filtered = withoutPrimaryOverlaps.filter(
|
|
24363
|
+
(workspace, i) => i === 0 || !withoutPrimaryOverlaps.some(
|
|
24364
|
+
(other, j) => i !== j && j !== 0 && workspace !== other && isWithinRoot2(workspace, other)
|
|
24365
|
+
)
|
|
24366
|
+
);
|
|
24367
|
+
if (filtered.length < workspaces.length) {
|
|
24368
|
+
writeStderrLine(
|
|
24369
|
+
"qwen serve: dropping nested IDE workspace roots (parent folders already cover children)"
|
|
24370
|
+
);
|
|
24371
|
+
}
|
|
24372
|
+
return filtered;
|
|
24373
|
+
}
|
|
24374
|
+
__name(dropNestedWorkspacesPreservingPrimary, "dropNestedWorkspacesPreservingPrimary");
|
|
24375
|
+
|
|
24376
|
+
// packages/cli/src/serve/server/telemetry.ts
|
|
24377
|
+
init_esbuild_shims();
|
|
24378
|
+
function decodePathSegment(value) {
|
|
24379
|
+
try {
|
|
24380
|
+
return decodeURIComponent(value);
|
|
24381
|
+
} catch {
|
|
24382
|
+
return value;
|
|
24383
|
+
}
|
|
24384
|
+
}
|
|
24385
|
+
__name(decodePathSegment, "decodePathSegment");
|
|
24386
|
+
function resolveDaemonTelemetryRoute(req) {
|
|
24387
|
+
const path15 = req.path.replace(/\/$/, "") || "/";
|
|
24388
|
+
if (req.method === "POST" && path15 === "/session") {
|
|
24389
|
+
return { route: "POST /session" };
|
|
24390
|
+
}
|
|
24391
|
+
if (req.method === "POST" && path15 === "/sessions/delete") {
|
|
24392
|
+
return { route: "POST /sessions/delete" };
|
|
24393
|
+
}
|
|
24394
|
+
if (req.method === "GET" && path15 === "/daemon/status") {
|
|
24395
|
+
return { route: "GET /daemon/status" };
|
|
24396
|
+
}
|
|
24397
|
+
const rewindSnapshots = path15.match(/^\/session\/([^/]+)\/rewind\/snapshots$/);
|
|
24398
|
+
if (rewindSnapshots?.[1] && req.method === "GET") {
|
|
24399
|
+
return {
|
|
24400
|
+
route: "GET /session/:id/rewind/snapshots",
|
|
24401
|
+
sessionId: rewindSnapshots[1]
|
|
24402
|
+
};
|
|
24403
|
+
}
|
|
24404
|
+
const sessionAction = path15.match(
|
|
24405
|
+
/^\/session\/([^/]+)\/(load|resume|prompt|cancel|recap|btw|mid-turn-message|model|shell|detach|rewind|approval-mode|language|a2ui-action)$/
|
|
24406
|
+
);
|
|
24407
|
+
const sessionActionId = sessionAction?.[1];
|
|
24408
|
+
const sessionActionName = sessionAction?.[2];
|
|
24409
|
+
if (sessionActionId && sessionActionName && req.method === "POST") {
|
|
24410
|
+
return {
|
|
24411
|
+
route: `POST /session/:id/${sessionActionName}`,
|
|
24412
|
+
sessionId: sessionActionId
|
|
24413
|
+
};
|
|
24414
|
+
}
|
|
24415
|
+
const sessionMetadata = path15.match(/^\/session\/([^/]+)\/metadata$/);
|
|
24416
|
+
if (sessionMetadata?.[1] && req.method === "PATCH") {
|
|
24417
|
+
return {
|
|
24418
|
+
route: "PATCH /session/:id/metadata",
|
|
24419
|
+
sessionId: sessionMetadata[1]
|
|
24420
|
+
};
|
|
24421
|
+
}
|
|
24422
|
+
const sessionArtifacts = path15.match(/^\/session\/([^/]+)\/artifacts$/);
|
|
24423
|
+
if (sessionArtifacts?.[1]) {
|
|
24424
|
+
if (req.method === "GET") {
|
|
24425
|
+
return {
|
|
24426
|
+
route: "GET /session/:id/artifacts",
|
|
24427
|
+
sessionId: sessionArtifacts[1]
|
|
24428
|
+
};
|
|
24429
|
+
}
|
|
24430
|
+
if (req.method === "POST") {
|
|
24431
|
+
return {
|
|
24432
|
+
route: "POST /session/:id/artifacts",
|
|
24433
|
+
sessionId: sessionArtifacts[1]
|
|
24434
|
+
};
|
|
24435
|
+
}
|
|
24436
|
+
}
|
|
24437
|
+
const sessionArtifact = path15.match(
|
|
24438
|
+
/^\/session\/([^/]+)\/artifacts\/([^/]+)$/
|
|
24439
|
+
);
|
|
24440
|
+
if (sessionArtifact?.[1] && req.method === "DELETE") {
|
|
24441
|
+
return {
|
|
24442
|
+
route: "DELETE /session/:id/artifacts/:artifactId",
|
|
24443
|
+
sessionId: sessionArtifact[1]
|
|
24444
|
+
};
|
|
24445
|
+
}
|
|
24446
|
+
const sessionPermission = path15.match(
|
|
24447
|
+
/^\/session\/([^/]+)\/permission\/([^/]+)$/
|
|
24448
|
+
);
|
|
24449
|
+
if (sessionPermission?.[1] && sessionPermission?.[2] && req.method === "POST") {
|
|
24450
|
+
const rawRequestId = sessionPermission[2];
|
|
24451
|
+
return {
|
|
24452
|
+
route: "POST /session/:id/permission/:requestId",
|
|
24453
|
+
sessionId: sessionPermission[1],
|
|
24454
|
+
...rawRequestId.length <= MAX_CLIENT_ID_LENGTH && CLIENT_ID_RE.test(rawRequestId) ? { permissionRequestId: rawRequestId } : {}
|
|
24455
|
+
};
|
|
24456
|
+
}
|
|
24457
|
+
const globalPermission = path15.match(/^\/permission\/([^/]+)$/);
|
|
24458
|
+
if (globalPermission?.[1] && req.method === "POST") {
|
|
24459
|
+
const rawRequestId = globalPermission[1];
|
|
24460
|
+
return {
|
|
24461
|
+
route: "POST /permission/:requestId",
|
|
24462
|
+
...rawRequestId.length <= MAX_CLIENT_ID_LENGTH && CLIENT_ID_RE.test(rawRequestId) ? { permissionRequestId: rawRequestId } : {}
|
|
24463
|
+
};
|
|
24464
|
+
}
|
|
24465
|
+
const deleteSession = path15.match(/^\/session\/([^/]+)$/);
|
|
24466
|
+
const deleteSessionId = deleteSession?.[1];
|
|
24467
|
+
if (deleteSessionId && req.method === "DELETE") {
|
|
24468
|
+
return { route: "DELETE /session/:id", sessionId: deleteSessionId };
|
|
24469
|
+
}
|
|
24470
|
+
if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path15)) {
|
|
24471
|
+
return { route: "GET /workspace/:id/sessions" };
|
|
24472
|
+
}
|
|
24473
|
+
if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path15)) {
|
|
24474
|
+
return { route: "GET /workspace/:id/sessions" };
|
|
24475
|
+
}
|
|
24476
|
+
const workspaceTranscript = path15.match(
|
|
24477
|
+
/^\/workspaces\/[^/]+\/session\/([^/]+)\/transcript$/
|
|
24478
|
+
);
|
|
24479
|
+
if (workspaceTranscript?.[1] && req.method === "GET") {
|
|
24480
|
+
return {
|
|
24481
|
+
route: "GET /workspaces/:workspace/session/:id/transcript",
|
|
24482
|
+
sessionId: workspaceTranscript[1]
|
|
24483
|
+
};
|
|
24484
|
+
}
|
|
24485
|
+
const workspaceExport = path15.match(
|
|
24486
|
+
/^\/workspaces\/[^/]+\/session\/([^/]+)\/export$/
|
|
24487
|
+
);
|
|
24488
|
+
if (workspaceExport?.[1] && req.method === "GET") {
|
|
24489
|
+
return {
|
|
24490
|
+
route: "GET /workspaces/:workspace/session/:id/export",
|
|
24491
|
+
sessionId: workspaceExport[1]
|
|
24492
|
+
};
|
|
24493
|
+
}
|
|
24494
|
+
const workspaceArchivedExport = path15.match(
|
|
24495
|
+
/^\/workspaces\/[^/]+\/session\/([^/]+)\/archive\/export$/
|
|
24496
|
+
);
|
|
24497
|
+
if (workspaceArchivedExport?.[1] && req.method === "GET") {
|
|
24498
|
+
return {
|
|
24499
|
+
route: "GET /workspaces/:workspace/session/:id/archive/export",
|
|
24500
|
+
sessionId: workspaceArchivedExport[1]
|
|
24501
|
+
};
|
|
24502
|
+
}
|
|
24503
|
+
const pluralWorkspacePrefix = /^\/workspaces\/[^/]+/;
|
|
24504
|
+
if (pluralWorkspacePrefix.test(path15)) {
|
|
24505
|
+
const suffix = path15.replace(pluralWorkspacePrefix, "/workspace");
|
|
24506
|
+
if (req.method === "GET") {
|
|
24507
|
+
if (suffix === "/workspace/mcp" || suffix === "/workspace/skills" || suffix === "/workspace/tools" || suffix === "/workspace/providers" || suffix === "/workspace/env" || suffix === "/workspace/preflight" || suffix === "/workspace/hooks" || suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/permissions" || suffix === "/workspace/trust" || suffix === "/workspace/memory" || suffix === "/workspace/agents") {
|
|
24508
|
+
return { route: `GET ${suffix}` };
|
|
24509
|
+
}
|
|
24510
|
+
if (/^\/workspace\/agents\/[^/]+$/.test(suffix)) {
|
|
24511
|
+
return { route: "GET /workspace/agents/:agentType" };
|
|
24512
|
+
}
|
|
24513
|
+
if (suffix === "/workspace/file") return { route: "GET /file" };
|
|
24514
|
+
if (suffix === "/workspace/file/bytes") {
|
|
24515
|
+
return { route: "GET /file/bytes" };
|
|
24516
|
+
}
|
|
24517
|
+
if (suffix === "/workspace/stat") return { route: "GET /stat" };
|
|
24518
|
+
if (suffix === "/workspace/list") return { route: "GET /list" };
|
|
24519
|
+
if (suffix === "/workspace/glob") return { route: "GET /glob" };
|
|
24520
|
+
if (/^\/workspace\/mcp\/[^/]+\/tools$/.test(suffix)) {
|
|
24521
|
+
return { route: "GET /workspace/mcp/:server/tools" };
|
|
24522
|
+
}
|
|
24523
|
+
if (/^\/workspace\/mcp\/[^/]+\/resources$/.test(suffix)) {
|
|
24524
|
+
return { route: "GET /workspace/mcp/:server/resources" };
|
|
24525
|
+
}
|
|
24526
|
+
}
|
|
24527
|
+
if (req.method === "POST") {
|
|
24528
|
+
if (suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/voice/transcribe" || suffix === "/workspace/permissions" || suffix === "/workspace/trust/request" || suffix === "/workspace/init" || suffix === "/workspace/reload" || suffix === "/workspace/file/write" || suffix === "/workspace/file/edit" || suffix === "/workspace/mcp/servers" || suffix === "/workspace/memory" || suffix === "/workspace/agents" || suffix === "/workspace/sessions/delete" || suffix === "/workspace/sessions/archive" || suffix === "/workspace/sessions/unarchive" || suffix === "/workspace/session-groups") {
|
|
24529
|
+
return { route: `POST ${suffix}` };
|
|
24530
|
+
}
|
|
24531
|
+
if (/^\/workspace\/tools\/[^/]+\/enable$/.test(suffix)) {
|
|
24532
|
+
return { route: "POST /workspace/tools/:name/enable" };
|
|
24533
|
+
}
|
|
24534
|
+
if (/^\/workspace\/mcp\/[^/]+\/restart$/.test(suffix)) {
|
|
24535
|
+
return { route: "POST /workspace/mcp/:server/restart" };
|
|
24536
|
+
}
|
|
24537
|
+
if (/^\/workspace\/agents\/[^/]+$/.test(suffix)) {
|
|
24538
|
+
return { route: "POST /workspace/agents/:agentType" };
|
|
24539
|
+
}
|
|
24540
|
+
if (/^\/workspace\/mcp\/[^/]+\/(approve|enable|disable|authenticate|clear-auth)$/.test(
|
|
24541
|
+
suffix
|
|
24542
|
+
)) {
|
|
24543
|
+
return {
|
|
24544
|
+
route: `POST /workspace/mcp/:server/${suffix.split("/").at(-1)}`
|
|
24545
|
+
};
|
|
24546
|
+
}
|
|
24547
|
+
}
|
|
24548
|
+
if (req.method === "DELETE" && /^\/workspace\/mcp\/servers\/[^/]+$/.test(suffix)) {
|
|
24549
|
+
return { route: "DELETE /workspace/mcp/servers/:name" };
|
|
24550
|
+
}
|
|
24551
|
+
if (req.method === "DELETE" && /^\/workspace\/agents\/[^/]+$/.test(suffix)) {
|
|
24552
|
+
return { route: "DELETE /workspace/agents/:agentType" };
|
|
24553
|
+
}
|
|
24554
|
+
if (suffix === "/workspace/session-groups" && req.method === "GET") {
|
|
24555
|
+
return { route: "GET /workspace/session-groups" };
|
|
24556
|
+
}
|
|
24557
|
+
if (/^\/workspace\/session-groups\/[^/]+$/.test(suffix) && req.method === "PATCH") {
|
|
24558
|
+
return { route: "PATCH /workspace/session-groups/:groupId" };
|
|
24559
|
+
}
|
|
24560
|
+
if (/^\/workspace\/session-groups\/[^/]+$/.test(suffix) && req.method === "DELETE") {
|
|
24561
|
+
return { route: "DELETE /workspace/session-groups/:groupId" };
|
|
24562
|
+
}
|
|
24563
|
+
}
|
|
24564
|
+
if (req.method === "POST" && path15 === "/workspace/init") {
|
|
24565
|
+
return { route: "POST /workspace/init" };
|
|
24566
|
+
}
|
|
24567
|
+
if (req.method === "POST" && path15 === "/workspace/setup-github") {
|
|
24568
|
+
return { route: "POST /workspace/setup-github" };
|
|
24569
|
+
}
|
|
24570
|
+
if (req.method === "POST" && path15 === "/workspace/reload") {
|
|
24571
|
+
return { route: "POST /workspace/reload" };
|
|
24572
|
+
}
|
|
24573
|
+
const mcpRestart = path15.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
|
|
24574
|
+
if (mcpRestart?.[1] && req.method === "POST") {
|
|
24575
|
+
return { route: "POST /workspace/mcp/:server/restart" };
|
|
24576
|
+
}
|
|
24577
|
+
if (req.method === "POST" && path15 === "/workspace/mcp/servers") {
|
|
24578
|
+
return { route: "POST /workspace/mcp/servers" };
|
|
24579
|
+
}
|
|
24580
|
+
const mcpDelete = path15.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
|
|
24581
|
+
if (mcpDelete?.[1] && req.method === "DELETE") {
|
|
24582
|
+
return { route: "DELETE /workspace/mcp/servers/:name" };
|
|
24583
|
+
}
|
|
24584
|
+
if (req.method === "POST" && path15 === "/workspace/auth/device-flow") {
|
|
24585
|
+
return { route: "POST /workspace/auth/device-flow" };
|
|
24586
|
+
}
|
|
24587
|
+
const deviceFlowDelete = path15.match(
|
|
24588
|
+
/^\/workspace\/auth\/device-flow\/([^/]+)$/
|
|
24589
|
+
);
|
|
24590
|
+
if (deviceFlowDelete?.[1] && req.method === "DELETE") {
|
|
24591
|
+
return { route: "DELETE /workspace/auth/device-flow/:id" };
|
|
24592
|
+
}
|
|
24593
|
+
const toolEnable = path15.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
|
|
24594
|
+
if (toolEnable?.[1] && req.method === "POST") {
|
|
24595
|
+
return { route: "POST /workspace/tools/:name/enable" };
|
|
24596
|
+
}
|
|
24597
|
+
if (path15 === "/workspace/settings") {
|
|
24598
|
+
if (req.method === "GET") return { route: "GET /workspace/settings" };
|
|
24599
|
+
if (req.method === "POST") return { route: "POST /workspace/settings" };
|
|
24600
|
+
}
|
|
24601
|
+
if (path15 === "/workspace/permissions") {
|
|
24602
|
+
if (req.method === "GET") return { route: "GET /workspace/permissions" };
|
|
24603
|
+
if (req.method === "POST") return { route: "POST /workspace/permissions" };
|
|
24604
|
+
}
|
|
24605
|
+
if (path15 === "/workspace/trust") {
|
|
24606
|
+
if (req.method === "GET") return { route: "GET /workspace/trust" };
|
|
24607
|
+
}
|
|
24608
|
+
if (req.method === "POST" && path15 === "/workspace/trust/request") {
|
|
24609
|
+
return { route: "POST /workspace/trust/request" };
|
|
24610
|
+
}
|
|
24611
|
+
if (path15 === "/workspace/voice") {
|
|
24612
|
+
if (req.method === "GET") return { route: "GET /workspace/voice" };
|
|
24613
|
+
if (req.method === "POST") return { route: "POST /workspace/voice" };
|
|
25110
24614
|
}
|
|
25111
|
-
|
|
25112
|
-
|
|
25113
|
-
return dropNestedWorkspacesPreservingPrimary(filteredWorkspaces);
|
|
25114
|
-
}
|
|
25115
|
-
__name(resolveBoundWorkspacesFromIdeEnv, "resolveBoundWorkspacesFromIdeEnv");
|
|
25116
|
-
function parseIdeWorkspacePathEnv(value) {
|
|
25117
|
-
if (value === void 0 || value.length === 0) return [];
|
|
25118
|
-
if (value.trimStart().startsWith("[")) {
|
|
25119
|
-
try {
|
|
25120
|
-
const parsed = JSON.parse(value);
|
|
25121
|
-
if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
|
|
25122
|
-
return parsed.filter(
|
|
25123
|
-
(workspace) => workspace.length > 0 && path14.isAbsolute(workspace)
|
|
25124
|
-
);
|
|
25125
|
-
}
|
|
25126
|
-
throw new Error("IDE workspace path JSON must be a string array");
|
|
25127
|
-
} catch {
|
|
25128
|
-
}
|
|
24615
|
+
if (req.method === "POST" && path15 === "/workspace/voice/transcribe") {
|
|
24616
|
+
return { route: "POST /workspace/voice/transcribe" };
|
|
25129
24617
|
}
|
|
25130
|
-
return
|
|
24618
|
+
return void 0;
|
|
25131
24619
|
}
|
|
25132
|
-
__name(
|
|
25133
|
-
function
|
|
25134
|
-
const
|
|
25135
|
-
|
|
25136
|
-
|
|
25137
|
-
(
|
|
25138
|
-
|
|
25139
|
-
|
|
25140
|
-
|
|
25141
|
-
|
|
25142
|
-
|
|
25143
|
-
|
|
25144
|
-
|
|
25145
|
-
|
|
25146
|
-
|
|
25147
|
-
|
|
25148
|
-
|
|
25149
|
-
|
|
24620
|
+
__name(resolveDaemonTelemetryRoute, "resolveDaemonTelemetryRoute");
|
|
24621
|
+
function daemonTelemetryMiddleware(resolveWorkspaceCwd, recordRequest, resolveSessionWorkspaceCwd) {
|
|
24622
|
+
const workspaceHashByCwd = /* @__PURE__ */ new Map();
|
|
24623
|
+
const resolveWorkspaceHash = /* @__PURE__ */ __name((workspaceCwd) => {
|
|
24624
|
+
const existing = workspaceHashByCwd.get(workspaceCwd);
|
|
24625
|
+
if (existing !== void 0) return existing;
|
|
24626
|
+
const workspaceHash = hashDaemonWorkspace(workspaceCwd);
|
|
24627
|
+
workspaceHashByCwd.set(workspaceCwd, workspaceHash);
|
|
24628
|
+
return workspaceHash;
|
|
24629
|
+
}, "resolveWorkspaceHash");
|
|
24630
|
+
return (req, res, next) => {
|
|
24631
|
+
const route = resolveDaemonTelemetryRoute(req);
|
|
24632
|
+
if (!route) {
|
|
24633
|
+
next();
|
|
24634
|
+
return;
|
|
24635
|
+
}
|
|
24636
|
+
const resolveOwnerWorkspace = route.route === "GET /session/:id/rewind/snapshots" || route.route === "POST /session/:id/rewind" || route.route === "POST /session/:id/shell";
|
|
24637
|
+
const sessionId = route.sessionId ? decodePathSegment(route.sessionId) : void 0;
|
|
24638
|
+
const workspaceCwd = (resolveOwnerWorkspace && sessionId ? resolveSessionWorkspaceCwd?.(sessionId) : void 0) ?? resolveWorkspaceCwd(req);
|
|
24639
|
+
const workspaceHash = resolveWorkspaceHash(workspaceCwd);
|
|
24640
|
+
const rawClientId = req.get(CLIENT_ID_HEADER);
|
|
24641
|
+
const clientId = rawClientId !== void 0 && rawClientId !== "" && rawClientId.length <= MAX_CLIENT_ID_LENGTH && CLIENT_ID_RE.test(rawClientId) ? rawClientId : void 0;
|
|
24642
|
+
const startMs = Date.now();
|
|
24643
|
+
void withDaemonRequestSpan(
|
|
24644
|
+
{
|
|
24645
|
+
method: req.method,
|
|
24646
|
+
route: route.route,
|
|
24647
|
+
workspaceHash,
|
|
24648
|
+
...sessionId ? { sessionId } : {},
|
|
24649
|
+
...route.permissionRequestId ? { permissionRequestId: route.permissionRequestId } : {},
|
|
24650
|
+
...clientId ? { clientId } : {}
|
|
24651
|
+
},
|
|
24652
|
+
async (span) => await new Promise((resolve5, reject) => {
|
|
24653
|
+
let done = false;
|
|
24654
|
+
const finish = /* @__PURE__ */ __name(() => {
|
|
24655
|
+
if (done) return;
|
|
24656
|
+
done = true;
|
|
24657
|
+
recordDaemonHttpResponse(span, res.statusCode);
|
|
24658
|
+
const durationMs = Date.now() - startMs;
|
|
24659
|
+
recordDaemonHttpRequest(durationMs, route.route, res.statusCode);
|
|
24660
|
+
if (route.route !== "GET /daemon/status") {
|
|
24661
|
+
recordRequest?.(durationMs, res.statusCode);
|
|
24662
|
+
}
|
|
24663
|
+
resolve5();
|
|
24664
|
+
}, "finish");
|
|
24665
|
+
res.once("finish", finish);
|
|
24666
|
+
res.once("close", finish);
|
|
24667
|
+
try {
|
|
24668
|
+
next();
|
|
24669
|
+
} catch (error2) {
|
|
24670
|
+
recordDaemonError(span, error2);
|
|
24671
|
+
reject(error2);
|
|
24672
|
+
}
|
|
24673
|
+
})
|
|
24674
|
+
).catch(next);
|
|
24675
|
+
};
|
|
25150
24676
|
}
|
|
25151
|
-
__name(
|
|
24677
|
+
__name(daemonTelemetryMiddleware, "daemonTelemetryMiddleware");
|
|
25152
24678
|
|
|
25153
24679
|
// packages/cli/src/serve/server/access-log.ts
|
|
25154
24680
|
init_esbuild_shims();
|
|
@@ -25673,10 +25199,9 @@ __name(registerWorkspaceQualifiedLifecycleRoutes, "registerWorkspaceQualifiedLif
|
|
|
25673
25199
|
|
|
25674
25200
|
// packages/cli/src/serve/routes/workspace-management.ts
|
|
25675
25201
|
init_esbuild_shims();
|
|
25676
|
-
import {
|
|
25202
|
+
import { stat } from "node:fs/promises";
|
|
25677
25203
|
import { realpathSync } from "node:fs";
|
|
25678
|
-
import {
|
|
25679
|
-
var MAX_PATH_SUGGESTIONS = 50;
|
|
25204
|
+
import { isAbsolute as isAbsolute7, resolve as resolve4 } from "node:path";
|
|
25680
25205
|
function registerWorkspaceManagementRoutes(app, deps) {
|
|
25681
25206
|
const {
|
|
25682
25207
|
workspaceRegistry,
|
|
@@ -25706,72 +25231,6 @@ function registerWorkspaceManagementRoutes(app, deps) {
|
|
|
25706
25231
|
code: "daemon_shutting_down"
|
|
25707
25232
|
});
|
|
25708
25233
|
}, "sendSealed");
|
|
25709
|
-
app.get(
|
|
25710
|
-
"/workspace-path-suggestions",
|
|
25711
|
-
async (req, res) => {
|
|
25712
|
-
const prefixRaw = req.query["prefix"];
|
|
25713
|
-
if (typeof prefixRaw !== "string" || prefixRaw.trim().length === 0) {
|
|
25714
|
-
res.status(400).json({
|
|
25715
|
-
error: "`prefix` must be a non-empty string",
|
|
25716
|
-
code: "invalid_prefix"
|
|
25717
|
-
});
|
|
25718
|
-
return;
|
|
25719
|
-
}
|
|
25720
|
-
const prefix = prefixRaw;
|
|
25721
|
-
if (prefix.length > MAX_WORKSPACE_PATH_LENGTH) {
|
|
25722
|
-
res.status(400).json({
|
|
25723
|
-
error: `\`prefix\` exceeds the ${MAX_WORKSPACE_PATH_LENGTH}-character limit`,
|
|
25724
|
-
code: "invalid_prefix"
|
|
25725
|
-
});
|
|
25726
|
-
return;
|
|
25727
|
-
}
|
|
25728
|
-
if (!isAbsolute7(prefix)) {
|
|
25729
|
-
res.status(400).json({
|
|
25730
|
-
error: "`prefix` must be an absolute path",
|
|
25731
|
-
code: "invalid_prefix"
|
|
25732
|
-
});
|
|
25733
|
-
return;
|
|
25734
|
-
}
|
|
25735
|
-
const endsWithSep = prefix.endsWith("/") || process.platform === "win32" && prefix.endsWith("\\");
|
|
25736
|
-
const dir = endsWithSep ? join7(prefix, ".") : dirname4(prefix);
|
|
25737
|
-
const filter = endsWithSep ? "" : basename4(prefix);
|
|
25738
|
-
const filterLower = filter.toLowerCase();
|
|
25739
|
-
const suggestions = [];
|
|
25740
|
-
let truncated = false;
|
|
25741
|
-
try {
|
|
25742
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
25743
|
-
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
25744
|
-
for (const entry of entries) {
|
|
25745
|
-
if (entry.name.startsWith(".") && !filter.startsWith(".")) continue;
|
|
25746
|
-
if (filter && !entry.name.toLowerCase().startsWith(filterLower)) {
|
|
25747
|
-
continue;
|
|
25748
|
-
}
|
|
25749
|
-
let isDir = entry.isDirectory();
|
|
25750
|
-
if (!isDir && entry.isSymbolicLink()) {
|
|
25751
|
-
try {
|
|
25752
|
-
isDir = (await stat(join7(dir, entry.name))).isDirectory();
|
|
25753
|
-
} catch {
|
|
25754
|
-
continue;
|
|
25755
|
-
}
|
|
25756
|
-
}
|
|
25757
|
-
if (!isDir) continue;
|
|
25758
|
-
if (suggestions.length >= MAX_PATH_SUGGESTIONS) {
|
|
25759
|
-
truncated = true;
|
|
25760
|
-
break;
|
|
25761
|
-
}
|
|
25762
|
-
suggestions.push({ name: entry.name, path: join7(dir, entry.name) });
|
|
25763
|
-
}
|
|
25764
|
-
} catch {
|
|
25765
|
-
}
|
|
25766
|
-
res.status(200).json({
|
|
25767
|
-
kind: "workspace-path-suggestions",
|
|
25768
|
-
dir,
|
|
25769
|
-
sep: sep3,
|
|
25770
|
-
suggestions,
|
|
25771
|
-
truncated
|
|
25772
|
-
});
|
|
25773
|
-
}
|
|
25774
|
-
);
|
|
25775
25234
|
app.post(
|
|
25776
25235
|
"/workspaces",
|
|
25777
25236
|
mutate({ strict: true }),
|
|
@@ -27463,9 +26922,9 @@ function parseSkillToggleRequest(req, res, safeBody2) {
|
|
|
27463
26922
|
});
|
|
27464
26923
|
return void 0;
|
|
27465
26924
|
}
|
|
27466
|
-
if (skillName.length >
|
|
26925
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH) {
|
|
27467
26926
|
res.status(400).json({
|
|
27468
|
-
error: `Skill name exceeds ${
|
|
26927
|
+
error: `Skill name exceeds ${MAX_SKILL_NAME_LENGTH}-character limit`,
|
|
27469
26928
|
code: "invalid_skill_name"
|
|
27470
26929
|
});
|
|
27471
26930
|
return void 0;
|
|
@@ -27481,138 +26940,11 @@ function parseSkillToggleRequest(req, res, safeBody2) {
|
|
|
27481
26940
|
return { skillName, enabled };
|
|
27482
26941
|
}
|
|
27483
26942
|
__name(parseSkillToggleRequest, "parseSkillToggleRequest");
|
|
27484
|
-
function parseSkillScope(value, res) {
|
|
27485
|
-
if (value === "workspace" || value === "global") return value;
|
|
27486
|
-
res.status(400).json({
|
|
27487
|
-
error: '`scope` must be "workspace" or "global"',
|
|
27488
|
-
code: "invalid_skill_scope"
|
|
27489
|
-
});
|
|
27490
|
-
return void 0;
|
|
27491
|
-
}
|
|
27492
|
-
__name(parseSkillScope, "parseSkillScope");
|
|
27493
|
-
function parseSkillInstallRequest(req, res, safeBody2) {
|
|
27494
|
-
const body = safeBody2(req);
|
|
27495
|
-
const name = body["name"];
|
|
27496
|
-
if (typeof name !== "string" || !name.trim()) {
|
|
27497
|
-
res.status(400).json({
|
|
27498
|
-
error: "`name` is required and must be a string",
|
|
27499
|
-
code: "invalid_skill_name"
|
|
27500
|
-
});
|
|
27501
|
-
return void 0;
|
|
27502
|
-
}
|
|
27503
|
-
if (name.trim().length > MAX_WORKSPACE_SKILL_NAME_LENGTH) {
|
|
27504
|
-
res.status(400).json({
|
|
27505
|
-
error: `Skill name exceeds ${MAX_WORKSPACE_SKILL_NAME_LENGTH}-character limit`,
|
|
27506
|
-
code: "invalid_skill_name"
|
|
27507
|
-
});
|
|
27508
|
-
return void 0;
|
|
27509
|
-
}
|
|
27510
|
-
const scope = parseSkillScope(body["scope"], res);
|
|
27511
|
-
if (!scope) return void 0;
|
|
27512
|
-
const rawSource = body["source"];
|
|
27513
|
-
if (!rawSource || typeof rawSource !== "object" || Array.isArray(rawSource)) {
|
|
27514
|
-
res.status(400).json({
|
|
27515
|
-
error: "`source` is required",
|
|
27516
|
-
code: "invalid_skill_source"
|
|
27517
|
-
});
|
|
27518
|
-
return void 0;
|
|
27519
|
-
}
|
|
27520
|
-
const source = rawSource;
|
|
27521
|
-
if (source["type"] === "github" && typeof source["url"] === "string") {
|
|
27522
|
-
return { name, scope, source: { type: "github", url: source["url"] } };
|
|
27523
|
-
}
|
|
27524
|
-
if (source["type"] === "zip" && typeof source["contentBase64"] === "string") {
|
|
27525
|
-
return {
|
|
27526
|
-
name,
|
|
27527
|
-
scope,
|
|
27528
|
-
source: { type: "zip", contentBase64: source["contentBase64"] }
|
|
27529
|
-
};
|
|
27530
|
-
}
|
|
27531
|
-
if (source["type"] === "folder" && typeof source["path"] === "string") {
|
|
27532
|
-
return {
|
|
27533
|
-
name,
|
|
27534
|
-
scope,
|
|
27535
|
-
source: { type: "folder", path: source["path"] }
|
|
27536
|
-
};
|
|
27537
|
-
}
|
|
27538
|
-
res.status(400).json({
|
|
27539
|
-
error: "Invalid Skill install source",
|
|
27540
|
-
code: "invalid_skill_source"
|
|
27541
|
-
});
|
|
27542
|
-
return void 0;
|
|
27543
|
-
}
|
|
27544
|
-
__name(parseSkillInstallRequest, "parseSkillInstallRequest");
|
|
27545
|
-
function parseDeleteScope(req, res) {
|
|
27546
|
-
return parseSkillScope(req.query["scope"], res);
|
|
27547
|
-
}
|
|
27548
|
-
__name(parseDeleteScope, "parseDeleteScope");
|
|
27549
|
-
function sendSkillManagementError(res, error2) {
|
|
27550
|
-
if (!(error2 instanceof WorkspaceSkillManagementError)) return false;
|
|
27551
|
-
res.status(error2.statusCode).json({
|
|
27552
|
-
error: error2.message,
|
|
27553
|
-
code: error2.code
|
|
27554
|
-
});
|
|
27555
|
-
return true;
|
|
27556
|
-
}
|
|
27557
|
-
__name(sendSkillManagementError, "sendSkillManagementError");
|
|
27558
26943
|
function registerWorkspaceSkillsRoutes(app, deps) {
|
|
27559
26944
|
const buildWorkspaceCtx = createBuildWorkspaceCtx(
|
|
27560
26945
|
deps.workspaceRuntime.workspaceCwd
|
|
27561
26946
|
);
|
|
27562
26947
|
const route = "POST /workspace/skills/:name/enable";
|
|
27563
|
-
app.post(
|
|
27564
|
-
"/workspace/skills/install",
|
|
27565
|
-
deps.mutate({ strict: true }),
|
|
27566
|
-
async (req, res) => {
|
|
27567
|
-
if (!requireTrustedWorkspaceRuntime(deps.workspaceRuntime, res)) return;
|
|
27568
|
-
const input = parseSkillInstallRequest(req, res, deps.safeBody);
|
|
27569
|
-
if (!input) return;
|
|
27570
|
-
const clientId = deps.parseAndValidateClientId(req, res);
|
|
27571
|
-
if (clientId === null) return;
|
|
27572
|
-
const installRoute = "POST /workspace/skills/install";
|
|
27573
|
-
try {
|
|
27574
|
-
const result = await deps.workspaceRuntime.workspaceService.installWorkspaceSkill(
|
|
27575
|
-
buildWorkspaceCtx(installRoute, clientId),
|
|
27576
|
-
input
|
|
27577
|
-
);
|
|
27578
|
-
res.status(200).json(result);
|
|
27579
|
-
} catch (err) {
|
|
27580
|
-
if (!sendSkillManagementError(res, err))
|
|
27581
|
-
deps.sendBridgeError(res, err, { route: installRoute });
|
|
27582
|
-
}
|
|
27583
|
-
}
|
|
27584
|
-
);
|
|
27585
|
-
app.delete(
|
|
27586
|
-
"/workspace/skills/:name",
|
|
27587
|
-
deps.mutate({ strict: true }),
|
|
27588
|
-
async (req, res) => {
|
|
27589
|
-
if (!requireTrustedWorkspaceRuntime(deps.workspaceRuntime, res)) return;
|
|
27590
|
-
const rawSkillName = req.params["name"];
|
|
27591
|
-
const scope = parseDeleteScope(req, res);
|
|
27592
|
-
if (!rawSkillName || !scope) return;
|
|
27593
|
-
let skillName;
|
|
27594
|
-
try {
|
|
27595
|
-
skillName = validateWorkspaceSkillName(rawSkillName);
|
|
27596
|
-
} catch (error2) {
|
|
27597
|
-
sendSkillManagementError(res, error2);
|
|
27598
|
-
return;
|
|
27599
|
-
}
|
|
27600
|
-
const clientId = deps.parseAndValidateClientId(req, res);
|
|
27601
|
-
if (clientId === null) return;
|
|
27602
|
-
const deleteRoute = "DELETE /workspace/skills/:name";
|
|
27603
|
-
try {
|
|
27604
|
-
const result = await deps.workspaceRuntime.workspaceService.deleteWorkspaceSkill(
|
|
27605
|
-
buildWorkspaceCtx(deleteRoute, clientId),
|
|
27606
|
-
skillName,
|
|
27607
|
-
scope
|
|
27608
|
-
);
|
|
27609
|
-
res.status(200).json(result);
|
|
27610
|
-
} catch (err) {
|
|
27611
|
-
if (!sendSkillManagementError(res, err))
|
|
27612
|
-
deps.sendBridgeError(res, err, { route: deleteRoute });
|
|
27613
|
-
}
|
|
27614
|
-
}
|
|
27615
|
-
);
|
|
27616
26948
|
app.post(
|
|
27617
26949
|
"/workspace/skills/:name/enable",
|
|
27618
26950
|
deps.mutate({ strict: true }),
|
|
@@ -27638,77 +26970,6 @@ function registerWorkspaceSkillsRoutes(app, deps) {
|
|
|
27638
26970
|
__name(registerWorkspaceSkillsRoutes, "registerWorkspaceSkillsRoutes");
|
|
27639
26971
|
function registerWorkspaceQualifiedSkillsRoutes(app, deps) {
|
|
27640
26972
|
const route = "POST /workspaces/:workspace/skills/:name/enable";
|
|
27641
|
-
app.post(
|
|
27642
|
-
"/workspaces/:workspace/skills/install",
|
|
27643
|
-
deps.mutate({ strict: true }),
|
|
27644
|
-
async (req, res) => {
|
|
27645
|
-
const runtime = resolveWorkspaceRuntimeFromParam(
|
|
27646
|
-
deps.workspaceRegistry,
|
|
27647
|
-
req,
|
|
27648
|
-
res
|
|
27649
|
-
);
|
|
27650
|
-
if (!runtime || !requireTrustedWorkspaceRuntime(runtime, res)) return;
|
|
27651
|
-
const input = parseSkillInstallRequest(req, res, deps.safeBody);
|
|
27652
|
-
if (!input) return;
|
|
27653
|
-
const clientId = parseAndValidateWorkspaceClientId(
|
|
27654
|
-
req,
|
|
27655
|
-
res,
|
|
27656
|
-
runtime.bridge
|
|
27657
|
-
);
|
|
27658
|
-
if (clientId === null) return;
|
|
27659
|
-
const installRoute = "POST /workspaces/:workspace/skills/install";
|
|
27660
|
-
try {
|
|
27661
|
-
const result = await runtime.workspaceService.installWorkspaceSkill(
|
|
27662
|
-
createBuildWorkspaceCtx(runtime.workspaceCwd)(installRoute, clientId),
|
|
27663
|
-
input
|
|
27664
|
-
);
|
|
27665
|
-
res.status(200).json(result);
|
|
27666
|
-
} catch (err) {
|
|
27667
|
-
if (!sendSkillManagementError(res, err))
|
|
27668
|
-
deps.sendBridgeError(res, err, { route: installRoute });
|
|
27669
|
-
}
|
|
27670
|
-
}
|
|
27671
|
-
);
|
|
27672
|
-
app.delete(
|
|
27673
|
-
"/workspaces/:workspace/skills/:name",
|
|
27674
|
-
deps.mutate({ strict: true }),
|
|
27675
|
-
async (req, res) => {
|
|
27676
|
-
const runtime = resolveWorkspaceRuntimeFromParam(
|
|
27677
|
-
deps.workspaceRegistry,
|
|
27678
|
-
req,
|
|
27679
|
-
res
|
|
27680
|
-
);
|
|
27681
|
-
if (!runtime || !requireTrustedWorkspaceRuntime(runtime, res)) return;
|
|
27682
|
-
const rawSkillName = req.params["name"];
|
|
27683
|
-
const scope = parseDeleteScope(req, res);
|
|
27684
|
-
if (!rawSkillName || !scope) return;
|
|
27685
|
-
let skillName;
|
|
27686
|
-
try {
|
|
27687
|
-
skillName = validateWorkspaceSkillName(rawSkillName);
|
|
27688
|
-
} catch (error2) {
|
|
27689
|
-
sendSkillManagementError(res, error2);
|
|
27690
|
-
return;
|
|
27691
|
-
}
|
|
27692
|
-
const clientId = parseAndValidateWorkspaceClientId(
|
|
27693
|
-
req,
|
|
27694
|
-
res,
|
|
27695
|
-
runtime.bridge
|
|
27696
|
-
);
|
|
27697
|
-
if (clientId === null) return;
|
|
27698
|
-
const deleteRoute = "DELETE /workspaces/:workspace/skills/:name";
|
|
27699
|
-
try {
|
|
27700
|
-
const result = await runtime.workspaceService.deleteWorkspaceSkill(
|
|
27701
|
-
createBuildWorkspaceCtx(runtime.workspaceCwd)(deleteRoute, clientId),
|
|
27702
|
-
skillName,
|
|
27703
|
-
scope
|
|
27704
|
-
);
|
|
27705
|
-
res.status(200).json(result);
|
|
27706
|
-
} catch (err) {
|
|
27707
|
-
if (!sendSkillManagementError(res, err))
|
|
27708
|
-
deps.sendBridgeError(res, err, { route: deleteRoute });
|
|
27709
|
-
}
|
|
27710
|
-
}
|
|
27711
|
-
);
|
|
27712
26973
|
app.post(
|
|
27713
26974
|
"/workspaces/:workspace/skills/:name/enable",
|
|
27714
26975
|
deps.mutate({ strict: true }),
|
|
@@ -28223,7 +27484,6 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
28223
27484
|
primaryEffectiveEnv ? { env: primaryEffectiveEnv } : {}
|
|
28224
27485
|
),
|
|
28225
27486
|
workspaceSkillsStatusProvider: createWorkspaceSkillsStatusProvider(),
|
|
28226
|
-
...primaryEffectiveEnv ? { skillInstallEnv: primaryEffectiveEnv } : {},
|
|
28227
27487
|
...primaryEffectiveEnv ? { voiceEnv: primaryEffectiveEnv } : {},
|
|
28228
27488
|
isChannelLive: /* @__PURE__ */ __name(() => bridge.isChannelLive(), "isChannelLive"),
|
|
28229
27489
|
persistDisabledTools: deps.persistDisabledTools ?? (async () => {
|
|
@@ -28268,8 +27528,6 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
28268
27528
|
);
|
|
28269
27529
|
app.locals.workspaceRegistry = workspaceRegistry;
|
|
28270
27530
|
const primaryRuntime = workspaceRegistry.primary;
|
|
28271
|
-
const daemonEnv = deps.daemonEnv ?? process.env;
|
|
28272
|
-
const primaryRuntimeEffectiveEnv = getRuntimeEffectiveEnv(primaryRuntime.env) ?? daemonEnv;
|
|
28273
27531
|
const voiceCoordinator = deps.voiceCoordinator ?? new WorkspaceVoiceCoordinator();
|
|
28274
27532
|
const primaryBoundWorkspace = primaryRuntime.workspaceCwd;
|
|
28275
27533
|
const primaryBridge = primaryRuntime.bridge;
|
|
@@ -28359,27 +27617,38 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
28359
27617
|
requireAuth: opts.requireAuth === true
|
|
28360
27618
|
});
|
|
28361
27619
|
app.use(
|
|
28362
|
-
daemonTelemetryMiddleware(
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
27620
|
+
daemonTelemetryMiddleware(
|
|
27621
|
+
(req) => {
|
|
27622
|
+
const match = req.path.match(/^\/workspaces\/([^/]+)/);
|
|
27623
|
+
const rawSelector = match?.[1];
|
|
27624
|
+
if (rawSelector) {
|
|
27625
|
+
try {
|
|
27626
|
+
const selector = decodeURIComponent(rawSelector);
|
|
27627
|
+
const byId = workspaceRegistry.getByWorkspaceId(selector);
|
|
27628
|
+
if (byId) return byId.workspaceCwd;
|
|
27629
|
+
if (isPortableAbsolutePath(selector)) {
|
|
27630
|
+
const runtime = resolveRegisteredWorkspaceRuntimeByPathSelector(
|
|
27631
|
+
workspaceRegistry,
|
|
27632
|
+
selector
|
|
27633
|
+
);
|
|
27634
|
+
if (runtime) return runtime.workspaceCwd;
|
|
27635
|
+
}
|
|
27636
|
+
} catch {
|
|
27637
|
+
return primaryBoundWorkspace;
|
|
28376
27638
|
}
|
|
27639
|
+
}
|
|
27640
|
+
return primaryBoundWorkspace;
|
|
27641
|
+
},
|
|
27642
|
+
deps.recordDaemonRequest,
|
|
27643
|
+
(sessionId) => {
|
|
27644
|
+
try {
|
|
27645
|
+
const owner = workspaceRegistry.resolveLiveSessionOwner(sessionId);
|
|
27646
|
+
return owner.kind === "found" ? owner.runtime.workspaceCwd : void 0;
|
|
28377
27647
|
} catch {
|
|
28378
|
-
return
|
|
27648
|
+
return void 0;
|
|
28379
27649
|
}
|
|
28380
27650
|
}
|
|
28381
|
-
|
|
28382
|
-
}, deps.recordDaemonRequest)
|
|
27651
|
+
)
|
|
28383
27652
|
);
|
|
28384
27653
|
const buildWorkspaceCtx = createBuildWorkspaceCtx(primaryBoundWorkspace);
|
|
28385
27654
|
const acpHandleRef = {};
|
|
@@ -28521,7 +27790,6 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
28521
27790
|
registerWorkspaceSetupGithubRoutes(app, {
|
|
28522
27791
|
boundWorkspace: primaryBoundWorkspace,
|
|
28523
27792
|
bridge: primaryBridge,
|
|
28524
|
-
env: primaryRuntimeEffectiveEnv,
|
|
28525
27793
|
mutate,
|
|
28526
27794
|
parseClientId: parseClientIdHeader,
|
|
28527
27795
|
safeBody
|
|
@@ -28818,7 +28086,6 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
|
|
|
28818
28086
|
});
|
|
28819
28087
|
acpHandleRef.current = mountAcpHttp(app, primaryBridge, {
|
|
28820
28088
|
boundWorkspace: primaryBoundWorkspace,
|
|
28821
|
-
daemonEnv,
|
|
28822
28089
|
// Phase 4 (issue #6378): pass the registry so `/workspaces/:workspace/acp`
|
|
28823
28090
|
// mounts a per-runtime ACP dispatcher for each registered workspace.
|
|
28824
28091
|
workspaceRegistry,
|
|
@@ -28890,7 +28157,6 @@ export {
|
|
|
28890
28157
|
createServeApp,
|
|
28891
28158
|
detectFromLoopback,
|
|
28892
28159
|
getActiveSseCount,
|
|
28893
|
-
getWorkspaceSessionInfoForResponse,
|
|
28894
28160
|
listWorkspaceSessionsForResponse,
|
|
28895
28161
|
resolveBoundWorkspacesFromIdeEnv,
|
|
28896
28162
|
resolveBridgeFsFactory,
|