@qwen-code/qwen-code 0.19.9 → 0.19.10-nightly.20260716.506ce0a1a
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/settings.md +14 -6
- package/bundled/qc-helper/docs/features/approval-mode.md +2 -2
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +33 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +64 -20
- package/bundled/qc-helper/docs/features/channels/wecom.md +8 -7
- package/bundled/qc-helper/docs/features/code-review.md +88 -44
- package/bundled/qc-helper/docs/features/commands.md +6 -6
- package/bundled/qc-helper/docs/features/hooks.md +29 -0
- package/bundled/qc-helper/docs/features/sandbox.md +2 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +21 -0
- package/bundled/qc-helper/docs/qwen-serve.md +49 -20
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +1 -1
- package/bundled/review/DESIGN.md +219 -33
- package/bundled/review/SKILL.md +429 -382
- package/chunks/{MaxSizedBox-6HYJ3ZPJ.js → MaxSizedBox-WOC3YDWA.js} +31 -32
- package/chunks/{StandaloneSessionPicker-WS4GXYOG.js → StandaloneSessionPicker-H5HZCAFD.js} +49 -48
- package/chunks/{acpAgent-5FWSOZL5.js → acpAgent-55YDJDNM.js} +922 -550
- package/chunks/{agent-HOLHB3RT.js → agent-H6VE5W3L.js} +26 -27
- package/chunks/{agent-headless-SXL6H56A.js → agent-headless-T4XJOCRU.js} +26 -27
- package/chunks/{anthropicContentGenerator-L73TO3DB.js → anthropicContentGenerator-HBRXJSP4.js} +78 -16
- package/chunks/{artifact-tool-U7IRTLIV.js → artifact-tool-MIZLXBLF.js} +2 -2
- package/chunks/{askUserQuestion-2DLUUZZG.js → askUserQuestion-XMJVPNWM.js} +2 -2
- package/chunks/{bridge-BCJQ7BBB.js → bridge-FTB6ZP3R.js} +31 -34
- package/chunks/{ca-UJ6HC4H2.js → ca-CODEN7TD.js} +9 -1
- package/chunks/channel-worker-group-K7QKH6IG.js +13 -0
- package/chunks/channel-worker-manager-CUDPU4CN.js +418 -0
- package/chunks/channel-worker-supervisor-4XTO2ZD3.js +20 -0
- package/chunks/{chunk-LXNEJD34.js → chunk-2FO5GFKZ.js} +1 -1
- package/chunks/{chunk-VA4KQY6V.js → chunk-2JNR4VP2.js} +3 -3
- package/chunks/{chunk-L36P3NBD.js → chunk-2W3OOD4W.js} +2 -0
- package/chunks/{chunk-7R3CZA3Q.js → chunk-2Z5UX4KI.js} +1 -1
- package/chunks/{chunk-CUMMSHH6.js → chunk-3DWIFU7L.js} +1 -1
- package/chunks/chunk-3MX7D6QN.js +516 -0
- package/chunks/{chunk-SJHDYNHF.js → chunk-4BJVSIS3.js} +3 -3
- package/chunks/{chunk-TO6QE22P.js → chunk-5CNYZ7TN.js} +26 -22
- package/chunks/{chunk-N3EMS75V.js → chunk-5DEJ4T6C.js} +1333 -1232
- package/chunks/chunk-5HBA2Z7V.js +28 -0
- package/chunks/{chunk-ZJE7NSL3.js → chunk-5M6IDOMF.js} +34 -97
- package/chunks/{chunk-SCGXUJBT.js → chunk-6LI3L22E.js} +3 -3
- package/chunks/{chunk-K434OPES.js → chunk-6WPJRYLZ.js} +3 -3
- package/chunks/{chunk-YAUFFXDS.js → chunk-7GM2RWCR.js} +12 -11
- package/chunks/{chunk-OQ4DRIOA.js → chunk-7HWE2W74.js} +2 -2
- package/chunks/{chunk-J4TSQ5EQ.js → chunk-7NFB7LBQ.js} +8 -1
- package/chunks/{chunk-MC23XKFE.js → chunk-A2HWMJVO.js} +37 -3
- package/chunks/{chunk-3G7CIHVV.js → chunk-ABNYOMDG.js} +4 -4
- package/chunks/{chunk-3AHXV67U.js → chunk-AGZLXLBY.js} +1 -1
- package/chunks/{chunk-RDJSGHZE.js → chunk-ALGGS7UH.js} +1 -38
- package/chunks/{chunk-Q4YQW46J.js → chunk-AMRZVQUY.js} +43 -40
- package/chunks/{chunk-W3JHSWRP.js → chunk-AN6C2U46.js} +4 -4
- package/chunks/{chunk-GWHYEOV2.js → chunk-ARKANCNX.js} +2 -1
- package/chunks/{chunk-5SFOMFG4.js → chunk-AVEOWVOM.js} +36 -2
- package/chunks/{chunk-34MW4KTI.js → chunk-BA5JGE5F.js} +2 -2
- package/chunks/{chunk-5HOMWMCL.js → chunk-BSJAQUFD.js} +5492 -1336
- package/chunks/{chunk-L6P4KPHR.js → chunk-BWJKL5DB.js} +58 -38
- package/chunks/{chunk-PVZM22CK.js → chunk-C32JFRGV.js} +5 -5
- package/chunks/{chunk-AKIVHSJR.js → chunk-CZIHPO7L.js} +163 -782
- package/chunks/chunk-DL7RCO6V.js +493 -0
- package/chunks/{chunk-KKNMOEZH.js → chunk-E2UVIFI2.js} +185 -398
- package/chunks/{chunk-5VXNZWGF.js → chunk-ENUQSKEY.js} +1 -1
- package/chunks/{chunk-PDZ7MBDG.js → chunk-EWILX3BM.js} +27 -6
- package/chunks/{chunk-BMGVRZN4.js → chunk-EZWX232B.js} +1 -1
- package/chunks/{chunk-4GORAUCN.js → chunk-F333XEAU.js} +1 -1
- package/chunks/{chunk-YLV3XXFB.js → chunk-FBU7WRZI.js} +17 -1
- package/chunks/chunk-FEOZBUMT.js +77 -0
- package/chunks/{chunk-5U27BZ72.js → chunk-FKEGVMPX.js} +269 -83
- package/chunks/chunk-FNX3LGAK.js +34 -0
- package/chunks/{chunk-LK7KUE55.js → chunk-FSA7ERJ2.js} +1 -1
- package/chunks/{chunk-PODM4SZ4.js → chunk-G3BIBPI7.js} +5 -5
- package/chunks/{chunk-A3XKDTSH.js → chunk-GA65O2TB.js} +4 -4
- package/chunks/{chunk-3BTRNWWD.js → chunk-GOXKNSDZ.js} +1 -64
- package/chunks/{channel-worker-supervisor-WSOAAYUO.js → chunk-GXGIM7QP.js} +67 -35
- package/chunks/{chunk-6PESIEKJ.js → chunk-GXUWGPYX.js} +68 -6
- package/chunks/chunk-GYTKQYDB.js +23 -0
- package/chunks/{chunk-GZRTYZ2R.js → chunk-H3XMJV7T.js} +218 -1
- package/chunks/{chunk-WQUQVGTF.js → chunk-HGRXW4HQ.js} +467 -106
- package/chunks/{chunk-YVEDCAUE.js → chunk-HGT6JR3U.js} +19 -0
- package/chunks/{chunk-ECNYL4AA.js → chunk-HUEWOHKV.js} +1 -1
- package/chunks/chunk-IDS7MSUP.js +74 -0
- package/chunks/{chunk-KHUQZZJ6.js → chunk-IHDRJLLR.js} +382 -36
- package/chunks/{chunk-CLFKOZEK.js → chunk-J4SEAF4X.js} +114 -4
- package/chunks/{chunk-B5ORX3FG.js → chunk-JGUT3LWZ.js} +6 -1
- package/chunks/{chunk-P67PFTUT.js → chunk-KEYEYCHZ.js} +4 -4
- package/chunks/{chunk-ORBGV7NJ.js → chunk-KKRTYONM.js} +6 -4
- package/chunks/{chunk-7PU4FYLG.js → chunk-KOXFAG6P.js} +4 -18
- package/chunks/{chunk-EGYZ275M.js → chunk-KWLVWNF5.js} +55 -7
- package/chunks/{chunk-XLA62MYB.js → chunk-KXECVZPD.js} +2 -2
- package/chunks/{chunk-IAVB3HM3.js → chunk-L4Y55KIS.js} +33 -1
- package/chunks/{chunk-4QLQE5WJ.js → chunk-L5U3ELZX.js} +1 -1
- package/chunks/{chunk-4ZVWQHEQ.js → chunk-LQIDP6K5.js} +1 -1
- package/chunks/{chunk-DC5Z3DU6.js → chunk-LXLTBIDP.js} +43 -6
- package/chunks/chunk-LXXMOYPL.js +22 -0
- package/chunks/{chunk-Q6I5QHMH.js → chunk-MFNKBXYH.js} +1 -1
- package/chunks/chunk-MR3PXB6E.js +48 -0
- package/chunks/{chunk-JZETEN3Z.js → chunk-N45S36AH.js} +3 -3
- package/chunks/{chunk-GWLSNBG4.js → chunk-NA3IG6XG.js} +748 -27
- package/chunks/{chunk-D5SKC4YG.js → chunk-O3M25JXE.js} +213 -29
- package/chunks/{chunk-EAXLGSFP.js → chunk-O6XGHDS5.js} +11 -11
- package/chunks/{chunk-WL4L7EZH.js → chunk-OA4JVLSA.js} +27 -1
- package/chunks/{chunk-X4NKFGFJ.js → chunk-OJAMDVF5.js} +0 -15
- package/chunks/{chunk-BZIFY5TF.js → chunk-OKAIGAYW.js} +3 -3
- package/chunks/{chunk-CNEIYWSA.js → chunk-OVIV236K.js} +5 -5
- package/chunks/{chunk-3SJSQXNS.js → chunk-PEJWA3QQ.js} +12 -8
- package/chunks/{chunk-E2IY465S.js → chunk-PWNOAWXB.js} +59 -12
- package/chunks/{chunk-B4G2WOFA.js → chunk-Q5MKHNIR.js} +28 -5
- package/chunks/{chunk-MXL5UP4X.js → chunk-Q6TUALBE.js} +1 -1
- package/chunks/{chunk-QYMQSECS.js → chunk-QAW7PIHT.js} +2 -2
- package/chunks/{chunk-HKMAENAO.js → chunk-QDTGDM2T.js} +14 -9
- package/chunks/{chunk-LUODI7WD.js → chunk-RCEEXIOO.js} +6 -4
- package/chunks/{chunk-W2UIXQDL.js → chunk-RTV5TUYB.js} +12 -4
- package/chunks/chunk-RW7DUKFO.js +91 -0
- package/chunks/{chunk-NVYTCB5Z.js → chunk-SA6QVLWI.js} +17325 -16259
- package/chunks/chunk-SJSI7PXU.js +59 -0
- package/chunks/{chunk-HVY356M2.js → chunk-SMGBWLNU.js} +3 -3
- package/chunks/{chunk-CEA3E3JB.js → chunk-SPJQO2CE.js} +2 -2
- package/chunks/{chunk-CC2ITGCF.js → chunk-STZQCNN3.js} +49 -6
- package/chunks/{chunk-HPDUL5MF.js → chunk-T2ZDAER2.js} +1 -1
- package/chunks/{chunk-XUOOWUZS.js → chunk-T3TQ3ACP.js} +1 -1
- package/chunks/{chunk-4C5BQ2D2.js → chunk-TIKDHS6V.js} +100 -17
- package/chunks/chunk-TV6K2FB4.js +224 -0
- package/chunks/{chunk-5XUCZNSY.js → chunk-TYLOFD2U.js} +1 -1
- package/chunks/{chunk-D2GFWEXB.js → chunk-UCUUH2JV.js} +6 -6
- package/chunks/{chunk-BAPGSC7U.js → chunk-UZP7K33Y.js} +23 -9
- package/chunks/{chunk-77XJ3SWN.js → chunk-VDAR6UO2.js} +8 -6
- package/chunks/{chunk-XYQSMABS.js → chunk-VKLVGA2D.js} +4 -4
- package/chunks/{chunk-JSG7ZSBC.js → chunk-VRR65QYW.js} +251 -3
- package/chunks/{chunk-U2NNEY4R.js → chunk-VT5AWJN4.js} +1 -1
- package/chunks/{chunk-ZLXQN2QS.js → chunk-WIEO4CWB.js} +1 -1
- package/chunks/{chunk-X6TJ3YZV.js → chunk-WKEO3GLZ.js} +160 -60
- package/chunks/{chunk-J3JA76CF.js → chunk-WTNZ6DXB.js} +1 -1
- package/chunks/{chunk-VWPVHAMO.js → chunk-XIWQ5QST.js} +8 -1
- package/chunks/{chunk-TDEXZKMT.js → chunk-Y66VOBRP.js} +2 -2
- package/chunks/{chunk-3VAGG5T5.js → chunk-YYBZUIPL.js} +1015 -100
- package/chunks/{chunk-CCDMCZPP.js → chunk-YZ3SBNP7.js} +1 -1
- package/chunks/{chunk-ATAKVRIF.js → chunk-Z3XA2TNG.js} +7 -7
- package/chunks/{chunk-EMDMPBJ4.js → chunk-Z7SVC7PJ.js} +10 -3
- package/chunks/{chunk-AURZZYMD.js → chunk-ZIVSSTUG.js} +4 -4
- package/chunks/{chunk-UOZWKTQG.js → chunk-ZPAHLFZU.js} +2 -2
- package/chunks/{chunk-34Z3U5RQ.js → chunk-ZQIYGQCG.js} +765 -168
- package/chunks/{computer-use-HM37RX6A.js → computer-use-NADT7ULB.js} +26 -27
- package/chunks/{config-utils-NV2SVGPB.js → config-utils-IQQT3GCI.js} +3 -2
- package/chunks/{contextCommand-OF5SFGH2.js → contextCommand-U7NEJYJ7.js} +28 -29
- package/chunks/{create-sub-session-INX7TXJI.js → create-sub-session-EAB2U5XW.js} +2 -2
- package/chunks/{create-sub-session-KPRT7ECJ.js → create-sub-session-SUN33INC.js} +26 -27
- package/chunks/{cron-create-AMBKGZX6.js → cron-create-GMVKSXZT.js} +4 -4
- package/chunks/{cron-delete-LRU4OJYG.js → cron-delete-VDZKUAVK.js} +4 -4
- package/chunks/{cron-list-WVP2JXER.js → cron-list-UG7C7RAR.js} +4 -4
- package/chunks/{daemon-ARHTSTXP.js → daemon-SJXEKP3H.js} +773 -126
- package/chunks/daemon-status-provider-WIIYLGZJ.js +74 -0
- package/chunks/{de-EBJN3OVN.js → de-NOXPCSYN.js} +9 -1
- package/chunks/{dist-XKU3ABM5.js → dist-4WCQEZIN.js} +4 -51
- package/chunks/{dist-QYCAEZIT.js → dist-DOPL5LSQ.js} +5 -1
- package/chunks/{dist-WKPOYU7O.js → dist-GXJVCOS7.js} +1 -1
- package/chunks/{dist-R7LN5AZE.js → dist-PX2ERZ6I.js} +2 -2
- package/chunks/{dist-PNVLTKTL.js → dist-V2YVLYOW.js} +215 -33
- package/chunks/{dist-VHV4EVHG.js → dist-VYWUKURL.js} +1 -1
- package/chunks/{earlyInputCapture-3VTHRC4C.js → earlyInputCapture-6FRM6UMU.js} +27 -28
- package/chunks/{edit-VNI4NJ73.js → edit-7GOIQTCZ.js} +27 -28
- package/chunks/{en-5A6LA7RK.js → en-JFVULHTB.js} +11 -1
- package/chunks/{enter-worktree-IYYBKPZT.js → enter-worktree-476E6WIK.js} +26 -27
- package/chunks/{enterPlanMode-GMC5FD5A.js → enterPlanMode-IRJM6W3C.js} +42 -28
- package/chunks/{environment-5HSSRMJ7.js → environment-ROMULS2X.js} +30 -30
- package/chunks/{errors-HMFCJJ7P.js → errors-OUIWPUDY.js} +28 -29
- package/chunks/{exit-worktree-6BHCMP5G.js → exit-worktree-PPSFK753.js} +26 -27
- package/chunks/{exitPlanMode-CJW7G74W.js → exitPlanMode-YKQMD4D7.js} +26 -27
- package/chunks/{fast-path-FRDMDVHG.js → fast-path-CNK2HHKH.js} +3 -3
- package/chunks/{fast-path-settings-5QZE64HR.js → fast-path-settings-DAOVFADC.js} +6 -4
- package/chunks/{fr-YXRABLYZ.js → fr-HVFNU42H.js} +9 -1
- package/chunks/{gemini-QYSEGHAX.js → gemini-WQNFT6TR.js} +216 -90
- package/chunks/{geminiContentGenerator-J7YNZDYP.js → geminiContentGenerator-4QJH2JDP.js} +4 -4
- package/chunks/{glob-BRCSGFOT.js → glob-36TVLBWW.js} +28 -28
- package/chunks/{grep-EE2DUOSY.js → grep-QTYLNO2M.js} +26 -27
- package/chunks/{handleAutoUpdate-5NWTLR67.js → handleAutoUpdate-36FQFODK.js} +30 -31
- package/chunks/{i18n-BASPENNQ.js → i18n-JUGYPVSP.js} +27 -28
- package/chunks/initializer-OBBJUS25.js +72 -0
- package/chunks/{installationInfo-W6V4DT7W.js → installationInfo-MCKTPX64.js} +27 -28
- package/chunks/{ja-7VQOANVG.js → ja-PY5AF544.js} +10 -2
- package/chunks/{keychain-token-storage-VKUBNCP4.js → keychain-token-storage-AU22CQI6.js} +2 -2
- package/chunks/list-VW5QY4VJ.js +75 -0
- package/chunks/loadedSettingsAdapter-IELOOXG6.js +69 -0
- package/chunks/{loop-wakeup-WX7BLWWP.js → loop-wakeup-QXWZSCYM.js} +5 -5
- package/chunks/{ls-ZB2BDP6T.js → ls-2OUTG3IZ.js} +4 -4
- package/chunks/{lsp-V5DN4YUJ.js → lsp-4VMNXZW6.js} +2 -2
- package/chunks/mcp-Q3EC37ZS.js +69 -0
- package/chunks/{monitor-X5Z3H4FY.js → monitor-DCZ27AFR.js} +26 -27
- package/chunks/nonInteractiveCli-KXD7PFO4.js +128 -0
- package/chunks/{notebook-edit-TRM2QIJK.js → notebook-edit-YU4XF5LI.js} +27 -28
- package/chunks/{openaiContentGenerator-AAYONPMF.js → openaiContentGenerator-KL5WER2D.js} +13 -13
- package/chunks/{pidfile-D4I4FTVA.js → pidfile-WBOD7EJV.js} +27 -28
- package/chunks/processUtils-AOV4R34M.js +29 -0
- package/chunks/{pt-2C6YCSHL.js → pt-A3PRQXMU.js} +9 -1
- package/chunks/{qwenContentGenerator-K3HZ2H76.js → qwenContentGenerator-YIGBHYE3.js} +28 -29
- package/chunks/{qwenOAuth2-PJQ27GSO.js → qwenOAuth2-LEYOU7RU.js} +5 -5
- package/chunks/{read-file-7SZSIZOL.js → read-file-WVL4Y76X.js} +9 -9
- package/chunks/{read-mcp-resource-SM5DA4RG.js → read-mcp-resource-JUFHCKSC.js} +2 -2
- package/chunks/{record-artifact-4XKZX3UW.js → record-artifact-DWSMBXYY.js} +2 -2
- package/chunks/{ripGrep-YNPFVCZP.js → ripGrep-6GSWJERP.js} +26 -27
- package/chunks/{ru-6BBHVZZV.js → ru-IBCWUTOC.js} +9 -1
- package/chunks/{run-qwen-serve-DMWV5N6L.js → run-qwen-serve-QYUQMEDT.js} +1233 -371
- package/chunks/{runtime-57WWRVHN.js → runtime-K2YZCNB3.js} +42 -38
- package/chunks/{scheduler-YBLGWSIL.js → scheduler-EQCSN7QV.js} +26 -27
- package/chunks/{send-message-F36YD6KQ.js → send-message-JZ752NWD.js} +3 -3
- package/chunks/{serve-R63NK3CV.js → serve-DX5UGZD4.js} +36 -35
- package/chunks/{server-Z22GCAXP.js → server-T6HJH3DR.js} +5869 -1398
- package/chunks/{session-HKAAI7BN.js → session-SNU6ACY6.js} +299 -100
- package/chunks/{settings-3EYN66GK.js → settings-AKHZZNEL.js} +34 -33
- package/chunks/{shell-6YXINTWJ.js → shell-EY74IEZK.js} +28 -27
- package/chunks/{skill-OO57P4X6.js → skill-DPU62O3H.js} +11 -11
- package/chunks/{spawnChannel-JD7G4VU6.js → spawnChannel-RQZRWJ2V.js} +28 -30
- package/chunks/{src-G5UPLZSZ.js → src-7FITDSVC.js} +164 -52
- package/chunks/{standalone-update-OB7F4JPZ.js → standalone-update-XO3RK6DO.js} +28 -29
- package/chunks/{startInteractiveUI-73EGLIIH.js → startInteractiveUI-DVWZRHYQ.js} +728 -382
- package/chunks/{syntheticOutput-34H7LGA7.js → syntheticOutput-LELY6HAI.js} +3 -3
- package/chunks/{task-create-FRGOEIKY.js → task-create-QY3BIMNM.js} +8 -7
- package/chunks/{task-list-OW766BXZ.js → task-list-D2U47WBJ.js} +6 -5
- package/chunks/{task-stop-SIR5SNBN.js → task-stop-N6E5IYLH.js} +2 -2
- package/chunks/{task-update-YRA532MT.js → task-update-HJCQILLB.js} +8 -7
- package/chunks/{team-create-PECAAPXK.js → team-create-FOSRT62K.js} +26 -27
- package/chunks/{team-delete-6OSECUZC.js → team-delete-RCWYDRF4.js} +6 -5
- package/chunks/{team-plan-approval-L6F434RY.js → team-plan-approval-6VUDV27J.js} +26 -27
- package/chunks/{theme-manager-ZG4RY6GU.js → theme-manager-6UT6IO5T.js} +27 -28
- package/chunks/{todoWrite-YDMFEV4G.js → todoWrite-FKCGATPJ.js} +4 -4
- package/chunks/{tool-search-THVIWAPB.js → tool-search-ASSFMMN5.js} +10 -10
- package/chunks/{total-session-admission-JOKNRIIA.js → total-session-admission-YYWUO23H.js} +32 -35
- package/chunks/tree-sitter-YJVE2ZUK.js +2980 -0
- package/chunks/{trustedFolders-EOGT3UVS.js → trustedFolders-4BWV2IBK.js} +29 -29
- package/chunks/types-ML3TRJQ5.js +16 -0
- package/chunks/update-relaunch-74DLGH73.js +87 -0
- package/chunks/{updateCheck-2KYEYVSB.js → updateCheck-CRFCGFO5.js} +31 -30
- package/chunks/{validateNonInterActiveAuth-EN6ZQSR2.js → validateNonInterActiveAuth-BTTEPBGQ.js} +76 -73
- package/chunks/{version-3UEA6ZIR.js → version-Y5JE5Q63.js} +1 -1
- package/chunks/{web-fetch-PAAEQKBW.js → web-fetch-CFCWTCAP.js} +5 -6
- package/chunks/{workflow-QCCCMYP3.js → workflow-6WC7VPQN.js} +27 -28
- package/chunks/workspace-providers-status-RVG2C5ZS.js +72 -0
- package/chunks/workspace-registration-store-SLEU3D3X.js +27 -0
- package/chunks/{workspace-registry-24QFLQYH.js → workspace-registry-QMWGVOTF.js} +32 -35
- package/chunks/workspace-service-G572JSEU.js +84 -0
- package/chunks/workspace-skills-status-VSSMSMNK.js +71 -0
- package/chunks/{write-file-I3MUDRIE.js → write-file-5XVDRORP.js} +27 -28
- package/chunks/{zh-RQE7I22T.js → zh-PAUNIMHQ.js} +12 -2
- package/chunks/{zh-TW-TBPQGHKH.js → zh-TW-GNEUIUFF.js} +12 -2
- package/cli-entry.js +92 -8
- package/cli.js +11 -11
- package/locales/ca.js +16 -0
- package/locales/de.js +16 -0
- package/locales/en.js +19 -0
- package/locales/fr.js +16 -0
- package/locales/ja.js +17 -1
- package/locales/pt.js +16 -0
- package/locales/ru.js +16 -0
- package/locales/zh-TW.js +20 -1
- package/locales/zh.js +20 -1
- package/package.json +3 -3
- package/web-shell/assets/{arc-C15hqnJe.js → arc-vx1tRwnX.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-B-At37J_.js → architectureDiagram-3BPJPVTR-DBi6iUA1.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-B51wjcU7.js → blockDiagram-GPEHLZMM-Ga9JJ4Ak.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-xBK7BAwN.js → c4Diagram-AAUBKEIU-D8Vi5FYw.js} +1 -1
- package/web-shell/assets/channel-B29zQDTL.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-xKmLg7Yr.js → chunk-2J33WTMH-CSV6yQpU.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-BfkdKZCM.js → chunk-4BX2VUAB-toYlppdI.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-DT713sZf.js → chunk-55IACEB6-DbjzuyAr.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CYEeAamv.js → chunk-727SXJPM-IkkSjSkk.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-DBN-5CFd.js → chunk-AQP2D5EJ-D5wUL6Zm.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-CGZKk4PH.js → chunk-FMBD7UC4-C3o2DXG0.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-qQbC2O-y.js → chunk-ND2GUHAM-CutIi14T.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-B3zeXwsX.js → chunk-QZHKN3VN-DZ0NRHH-.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-BNGI2SvC.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BNGI2SvC.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-BKsl1Wvy.js → cose-bilkent-S5V4N54A-B3Dl88UJ.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-CuuuLiBK.js → dagre-BM42HDAG-DfTxfF6-.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-CG4_eKiV.js → diagram-2AECGRRQ-CJyH98yO.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-DSFTmZB1.js → diagram-5GNKFQAL-EbOiJNmW.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BxwlEHn8.js → diagram-KO2AKTUF-AYNqpqqA.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BUAg-jMG.js → diagram-LMA3HP47-BY5VPa4H.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-BFM2jlO5.js → diagram-OG6HWLK6-BhMYAKlk.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-CerbFPa2.js → erDiagram-TEJ5UH35-Bp8S_F9l.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-BNeZz5Zz.js → flowDiagram-I6XJVG4X-az3TE9PU.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-CTOogLaM.js → ganttDiagram-6RSMTGT7-CfkAEpCe.js} +3 -3
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-yxSFkXPj.js → gitGraphDiagram-PVQCEYII-D1QmjMCy.js} +1 -1
- package/web-shell/assets/index-C8sDwQUv.js +1130 -0
- package/web-shell/assets/index-CaBoc5bb.js +3 -0
- package/web-shell/assets/index-Dpg5Wymg.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-DYdAUevm.js → infoDiagram-5YYISTIA-D3ompLrG.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-CNuijZ90.js → ishikawaDiagram-YF4QCWOH-D3MRWp9I.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-BTyiuonf.js → journeyDiagram-JHISSGLW-DVkKCa44.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-DPJo0Uow.js → kanban-definition-UN3LZRKU-BLif81wF.js} +1 -1
- package/web-shell/assets/{linear-C8wKCbIC.js → linear-BDU96EGS.js} +1 -1
- package/web-shell/assets/{mermaid.core-BV5o7nW5.js → mermaid.core-B-CwC26B.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BtLcBmSt.js → mindmap-definition-RKZ34NQL-CS1WOJ4G.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-C22J7A9Q.js → pieDiagram-4H26LBE5-BzgtNXVP.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DSL10wiL.js → quadrantDiagram-W4KKPZXB-BRfGC8MA.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-feqh0UpX.js → requirementDiagram-4Y6WPE33-CPBZkC7g.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-Z4OVaWaZ.js → sankeyDiagram-5OEKKPKP-nqNvinIk.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DIluIcb1.js → sequenceDiagram-3UESZ5HK-CM_Wdjh3.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-hlhnuoYH.js → stateDiagram-AJRCARHV-L0y-48VE.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BX1DdF8s.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-Dqf_CqgL.js → timeline-definition-PNZ67QCA-B_n5rb3A.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DD2QhaTX.js → vennDiagram-CIIHVFJN-C9NmLV5e.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-B2uI85U_.js → wardley-L42UT6IY-CrefK9gt.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-U1aJX71g.js → wardleyDiagram-YWT4CUSO-BUccf-bC.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-C0ODHUee.js → xychartDiagram-2RQKCTM6-DM6ef92l.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-524RQP4Q.js +0 -305
- package/chunks/chunk-CARU2RR2.js +0 -24
- package/chunks/chunk-CU3L64TP.js +0 -93
- package/chunks/chunk-OCPBI7J5.js +0 -18
- package/chunks/chunk-TEGEBB2I.js +0 -122
- package/chunks/chunk-VTU57BWZ.js +0 -30
- package/chunks/daemon-status-provider-B2UTZUJ2.js +0 -76
- package/chunks/initializer-UTQ7FB7G.js +0 -71
- package/chunks/list-DEICDL65.js +0 -74
- package/chunks/loadedSettingsAdapter-NOWEGDYJ.js +0 -68
- package/chunks/mcp-L5JXEEIA.js +0 -68
- package/chunks/nonInteractiveCli-LS2K4X6A.js +0 -124
- package/chunks/types-JNKGKUJT.js +0 -12
- package/chunks/workspace-providers-status-4KMGETOJ.js +0 -71
- package/chunks/workspace-service-RVLBMSMZ.js +0 -80
- package/chunks/workspace-skills-status-DS4ZVFTO.js +0 -70
- package/web-shell/assets/channel-CLiQD50f.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-D3sYqow5.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-D3sYqow5.js +0 -1
- package/web-shell/assets/index-D5IWFVk1.css +0 -5
- package/web-shell/assets/index-KFJRDhX7.js +0 -783
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BhQMwgpl.js +0 -1
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
LOAD_REPLAY_BULK_MODE,
|
|
5
|
+
LOAD_REPLAY_META_KEY,
|
|
6
|
+
LOAD_REPLAY_MODE_META_KEY,
|
|
7
|
+
LOAD_REPLAY_VERSION,
|
|
8
|
+
MID_TURN_QUEUE_DRAIN_METHOD
|
|
9
|
+
} from "./chunk-PZL23GTM.js";
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_RING_SIZE,
|
|
12
|
+
EVENT_SCHEMA_VERSION,
|
|
13
|
+
EventBus,
|
|
14
|
+
serializedBridgeEventByteLength
|
|
15
|
+
} from "./chunk-6RLROE6G.js";
|
|
16
|
+
import {
|
|
17
|
+
normalizeCompactedReplayMaxBytes
|
|
18
|
+
} from "./chunk-COH43MRJ.js";
|
|
6
19
|
import {
|
|
7
20
|
BranchWhilePromptActiveError,
|
|
8
21
|
CancelSentinelCollisionError,
|
|
@@ -12,6 +25,7 @@ import {
|
|
|
12
25
|
InvalidRewindTargetError,
|
|
13
26
|
InvalidSessionMetadataError,
|
|
14
27
|
InvalidSessionScopeError,
|
|
28
|
+
MCP_RESTART_SERVER_DEADLINE_MS,
|
|
15
29
|
PermissionForbiddenError,
|
|
16
30
|
PromptQueueFullError,
|
|
17
31
|
RestoreInProgressError,
|
|
@@ -22,29 +36,10 @@ import {
|
|
|
22
36
|
SessionShellDisabledError,
|
|
23
37
|
WorkspaceMismatchError,
|
|
24
38
|
isNotCurrentlyGeneratingCancelError
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
LOAD_REPLAY_BULK_MODE,
|
|
28
|
-
LOAD_REPLAY_META_KEY,
|
|
29
|
-
LOAD_REPLAY_MODE_META_KEY,
|
|
30
|
-
LOAD_REPLAY_VERSION,
|
|
31
|
-
MID_TURN_QUEUE_DRAIN_METHOD
|
|
32
|
-
} from "./chunk-PZL23GTM.js";
|
|
33
|
-
import {
|
|
34
|
-
canonicalizeWorkspace
|
|
35
|
-
} from "./chunk-W7FJ3N32.js";
|
|
36
|
-
import {
|
|
37
|
-
DEFAULT_RING_SIZE,
|
|
38
|
-
EVENT_SCHEMA_VERSION,
|
|
39
|
-
EventBus,
|
|
40
|
-
serializedBridgeEventByteLength
|
|
41
|
-
} from "./chunk-6RLROE6G.js";
|
|
42
|
-
import {
|
|
43
|
-
normalizeCompactedReplayMaxBytes
|
|
44
|
-
} from "./chunk-COH43MRJ.js";
|
|
39
|
+
} from "./chunk-L4Y55KIS.js";
|
|
45
40
|
import {
|
|
46
41
|
defaultSpawnChannelFactory
|
|
47
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-J4SEAF4X.js";
|
|
48
43
|
import {
|
|
49
44
|
BridgeChannelClosedError,
|
|
50
45
|
BridgeTimeoutError,
|
|
@@ -53,7 +48,10 @@ import {
|
|
|
53
48
|
STATUS_SCHEMA_VERSION,
|
|
54
49
|
createIdleWorkspaceExtensionsStatus,
|
|
55
50
|
createIdleWorkspaceHooksStatus
|
|
56
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-XIWQ5QST.js";
|
|
52
|
+
import {
|
|
53
|
+
canonicalizeWorkspace
|
|
54
|
+
} from "./chunk-W7FJ3N32.js";
|
|
57
55
|
import {
|
|
58
56
|
ClientSideConnection,
|
|
59
57
|
PROTOCOL_VERSION,
|
|
@@ -70,11 +68,11 @@ import {
|
|
|
70
68
|
metadataBudgetBytes,
|
|
71
69
|
normalizeSnapshotPayload,
|
|
72
70
|
stableSessionArtifactId
|
|
73
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-SA6QVLWI.js";
|
|
74
72
|
import {
|
|
75
73
|
DAEMON_TRACEPARENT_META_KEY,
|
|
76
74
|
DAEMON_TRACESTATE_META_KEY
|
|
77
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-YYBZUIPL.js";
|
|
78
76
|
import {
|
|
79
77
|
init_esbuild_shims
|
|
80
78
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -473,6 +471,30 @@ function mergeToolCallEvent(existing, incoming) {
|
|
|
473
471
|
}
|
|
474
472
|
__name(mergeToolCallEvent, "mergeToolCallEvent");
|
|
475
473
|
|
|
474
|
+
// packages/acp-bridge/src/session-source.ts
|
|
475
|
+
init_esbuild_shims();
|
|
476
|
+
var SESSION_SOURCE_TYPE_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
477
|
+
var MAX_SESSION_SOURCE_ID_LENGTH = 256;
|
|
478
|
+
function parseSessionSource(sourceType, sourceId) {
|
|
479
|
+
if (sourceType === void 0 && sourceId === void 0) return {};
|
|
480
|
+
if (typeof sourceType !== "string" || !SESSION_SOURCE_TYPE_PATTERN.test(sourceType)) {
|
|
481
|
+
return {
|
|
482
|
+
error: "`sourceType` must match [a-z][a-z0-9_-]{0,63} when provided"
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
if (sourceId === void 0) return { sourceType };
|
|
486
|
+
if (typeof sourceId !== "string" || sourceId.length === 0 || sourceId.length > MAX_SESSION_SOURCE_ID_LENGTH || [...sourceId].some((character) => {
|
|
487
|
+
const code = character.charCodeAt(0);
|
|
488
|
+
return code <= 31 || code === 127;
|
|
489
|
+
})) {
|
|
490
|
+
return {
|
|
491
|
+
error: `\`sourceId\` must be a non-empty string of at most ${MAX_SESSION_SOURCE_ID_LENGTH} characters without control characters`
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
return { sourceType, sourceId };
|
|
495
|
+
}
|
|
496
|
+
__name(parseSessionSource, "parseSessionSource");
|
|
497
|
+
|
|
476
498
|
// packages/acp-bridge/src/internal/stderrLine.ts
|
|
477
499
|
init_esbuild_shims();
|
|
478
500
|
function writeStderrLine(message) {
|
|
@@ -1332,7 +1354,8 @@ function isTrustedArtifactToolUpdate(params, updateMeta) {
|
|
|
1332
1354
|
__name(isTrustedArtifactToolUpdate, "isTrustedArtifactToolUpdate");
|
|
1333
1355
|
function preserveFsErrorOverAcp(err) {
|
|
1334
1356
|
if (isFsErrorShape(err)) {
|
|
1335
|
-
|
|
1357
|
+
const code = err.kind === "parse_error" ? -32602 : -32603;
|
|
1358
|
+
throw new RequestError(code, err.message, {
|
|
1336
1359
|
errorKind: err.kind,
|
|
1337
1360
|
...err.hint !== void 0 ? { hint: err.hint } : {},
|
|
1338
1361
|
...err.status !== void 0 ? { status: err.status } : {}
|
|
@@ -1391,7 +1414,7 @@ function sliceLineRange(content, startLine, endLine) {
|
|
|
1391
1414
|
}
|
|
1392
1415
|
__name(sliceLineRange, "sliceLineRange");
|
|
1393
1416
|
var BridgeClient = class {
|
|
1394
|
-
constructor(resolveEntry, resolvePendingRestoreEvents, mediator, permissionTimeoutMs, maxPendingPerSession, fileSystem, onModelPromoted, onModePromoted, clientMcpSender, ownsSession = () => true, onTokenUsage, onCreateSubSession) {
|
|
1417
|
+
constructor(resolveEntry, resolvePendingRestoreEvents, mediator, permissionTimeoutMs, maxPendingPerSession, fileSystem, onModelPromoted, onModePromoted, clientMcpSender, ownsSession = () => true, onTokenUsage, onCreateSubSession, onGenerationEvent) {
|
|
1395
1418
|
this.resolveEntry = resolveEntry;
|
|
1396
1419
|
this.resolvePendingRestoreEvents = resolvePendingRestoreEvents;
|
|
1397
1420
|
this.mediator = mediator;
|
|
@@ -1404,6 +1427,7 @@ var BridgeClient = class {
|
|
|
1404
1427
|
this.ownsSession = ownsSession;
|
|
1405
1428
|
this.onTokenUsage = onTokenUsage;
|
|
1406
1429
|
this.onCreateSubSession = onCreateSubSession;
|
|
1430
|
+
this.onGenerationEvent = onGenerationEvent;
|
|
1407
1431
|
}
|
|
1408
1432
|
static {
|
|
1409
1433
|
__name(this, "BridgeClient");
|
|
@@ -1587,18 +1611,23 @@ var BridgeClient = class {
|
|
|
1587
1611
|
return;
|
|
1588
1612
|
}
|
|
1589
1613
|
const durationMs = updateMeta?.["durationMs"];
|
|
1614
|
+
const apiErrors = updateMeta?.["apiErrors"];
|
|
1615
|
+
const apiRetries = updateMeta?.["apiRetries"];
|
|
1590
1616
|
this.onTokenUsage(
|
|
1591
1617
|
typeof inputTokens === "number" ? inputTokens : 0,
|
|
1592
1618
|
typeof outputTokens === "number" ? outputTokens : 0,
|
|
1593
|
-
typeof durationMs === "number" ? durationMs : void 0
|
|
1619
|
+
typeof durationMs === "number" ? durationMs : void 0,
|
|
1620
|
+
typeof apiErrors === "number" ? apiErrors : 0,
|
|
1621
|
+
typeof apiRetries === "number" ? apiRetries : 0
|
|
1594
1622
|
);
|
|
1595
1623
|
}
|
|
1596
1624
|
/**
|
|
1597
|
-
* Bounded early-event buffer.
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
1600
|
-
*
|
|
1601
|
-
*
|
|
1625
|
+
* Bounded early-event buffer. The map is scoped to this BridgeClient and
|
|
1626
|
+
* therefore to one channel; a stale channel cannot seed a fresh channel's
|
|
1627
|
+
* future session. Frames are keyed by sessionId; each entry tracks its
|
|
1628
|
+
* `expiresAt` for lazy TTL-based eviction in `bufferEarlyEvent`. Drained by
|
|
1629
|
+
* `drainEarlyEvents` whenever the bridge registers a session with a matching
|
|
1630
|
+
* id. See MAX_EARLY_EVENT_* constants for capacity bounds.
|
|
1602
1631
|
*/
|
|
1603
1632
|
earlyEvents = /* @__PURE__ */ new Map();
|
|
1604
1633
|
/**
|
|
@@ -1623,7 +1652,7 @@ var BridgeClient = class {
|
|
|
1623
1652
|
/**
|
|
1624
1653
|
* Allow-list of sessionIds currently being restored via
|
|
1625
1654
|
* `session/load` / `session/resume`. Bypasses the tombstone check
|
|
1626
|
-
* in `bufferEarlyEvent` so restore-time
|
|
1655
|
+
* in `bufferEarlyEvent` so restore-time events for a
|
|
1627
1656
|
* previously-closed id flow through to the future
|
|
1628
1657
|
* `createSessionEntry -> drainEarlyEvents` call.
|
|
1629
1658
|
*
|
|
@@ -1801,6 +1830,7 @@ var BridgeClient = class {
|
|
|
1801
1830
|
* `qwen/notify/session/model-update`,
|
|
1802
1831
|
* `qwen/notify/session/mode-update`,
|
|
1803
1832
|
* `qwen/notify/session/title-update` (auto/in-process session titles),
|
|
1833
|
+
* `qwen/notify/session/recording-degraded`,
|
|
1804
1834
|
* `qwen/notify/session/prompt-suggestion` (followup assist),
|
|
1805
1835
|
* `qwen/notify/session/artifact-event` (hook artifacts),
|
|
1806
1836
|
* `qwen/notify/session/terminal-sequence`, and
|
|
@@ -1809,6 +1839,51 @@ var BridgeClient = class {
|
|
|
1809
1839
|
* forward-compat.
|
|
1810
1840
|
*/
|
|
1811
1841
|
async extNotification(method, params) {
|
|
1842
|
+
if (method === "qwen/notify/session/generation/event") {
|
|
1843
|
+
const sessionId2 = params["sessionId"];
|
|
1844
|
+
const requestId = params["requestId"];
|
|
1845
|
+
const event = params["event"];
|
|
1846
|
+
if (params["v"] !== 1 || typeof sessionId2 !== "string" || typeof requestId !== "string" || !event || typeof event !== "object" || Array.isArray(event)) {
|
|
1847
|
+
return;
|
|
1848
|
+
}
|
|
1849
|
+
const record = event;
|
|
1850
|
+
if (record["type"] === "started") {
|
|
1851
|
+
const model = record["model"];
|
|
1852
|
+
const modelSource = record["modelSource"];
|
|
1853
|
+
if (typeof model !== "string" || modelSource !== "fast" && modelSource !== "main") {
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
this.onGenerationEvent?.(sessionId2, {
|
|
1857
|
+
type: "started",
|
|
1858
|
+
requestId,
|
|
1859
|
+
model,
|
|
1860
|
+
modelSource
|
|
1861
|
+
});
|
|
1862
|
+
return;
|
|
1863
|
+
}
|
|
1864
|
+
if (record["type"] === "thinking") {
|
|
1865
|
+
this.onGenerationEvent?.(sessionId2, {
|
|
1866
|
+
type: "thinking",
|
|
1867
|
+
requestId
|
|
1868
|
+
});
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
if (record["type"] === "delta") {
|
|
1872
|
+
const seq = record["seq"];
|
|
1873
|
+
const text = record["text"];
|
|
1874
|
+
if (typeof seq !== "number" || !Number.isSafeInteger(seq) || seq < 0 || typeof text !== "string" || text.length === 0) {
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1877
|
+
this.onGenerationEvent?.(sessionId2, {
|
|
1878
|
+
type: "delta",
|
|
1879
|
+
requestId,
|
|
1880
|
+
seq,
|
|
1881
|
+
text
|
|
1882
|
+
});
|
|
1883
|
+
return;
|
|
1884
|
+
}
|
|
1885
|
+
return;
|
|
1886
|
+
}
|
|
1812
1887
|
if (method === "qwen/notify/session/model-update") {
|
|
1813
1888
|
this.handleInSessionModelUpdate(params);
|
|
1814
1889
|
return;
|
|
@@ -1837,6 +1912,28 @@ var BridgeClient = class {
|
|
|
1837
1912
|
}
|
|
1838
1913
|
return;
|
|
1839
1914
|
}
|
|
1915
|
+
if (method === "qwen/notify/session/recording-degraded") {
|
|
1916
|
+
const sessionId2 = params["sessionId"];
|
|
1917
|
+
if (params["v"] !== 1 || typeof sessionId2 !== "string" || sessionId2.length === 0 || params["reason"] !== "write_failed") {
|
|
1918
|
+
writeStderrLine(
|
|
1919
|
+
`[demux] session=${typeof sessionId2 === "string" ? sessionId2 : "<missing>"} type=session_recording_degraded action=dropped reason=malformed`
|
|
1920
|
+
);
|
|
1921
|
+
return;
|
|
1922
|
+
}
|
|
1923
|
+
const entry = this.resolveEntry(sessionId2);
|
|
1924
|
+
if (entry && !this.ownsSession(sessionId2)) {
|
|
1925
|
+
writeStderrLine(
|
|
1926
|
+
`[demux] session=${sessionId2} type=session_recording_degraded action=dropped reason=session_not_owned`
|
|
1927
|
+
);
|
|
1928
|
+
return;
|
|
1929
|
+
}
|
|
1930
|
+
if (entry) entry.recordingDegraded = true;
|
|
1931
|
+
this.publishExtNotification(sessionId2, "session_recording_degraded", {
|
|
1932
|
+
sessionId: sessionId2,
|
|
1933
|
+
reason: "write_failed"
|
|
1934
|
+
});
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1840
1937
|
if (method === "qwen/notify/session/prompt-suggestion") {
|
|
1841
1938
|
const sessionId2 = params["sessionId"];
|
|
1842
1939
|
const suggestion = params["suggestion"];
|
|
@@ -2093,7 +2190,7 @@ var BridgeClient = class {
|
|
|
2093
2190
|
this.sweepExpiredTombstones(now);
|
|
2094
2191
|
if (this.tombstonedSessionIds.has(sessionId) && !this.inFlightRestoreIds.has(sessionId)) {
|
|
2095
2192
|
writeStderrLine(
|
|
2096
|
-
`qwen serve: dropping
|
|
2193
|
+
`qwen serve: dropping early extNotification for tombstoned session ${JSON.stringify(sessionId)} (post-close stale event)`
|
|
2097
2194
|
);
|
|
2098
2195
|
return;
|
|
2099
2196
|
}
|
|
@@ -2102,7 +2199,7 @@ var BridgeClient = class {
|
|
|
2102
2199
|
if (!buf) {
|
|
2103
2200
|
if (this.earlyEvents.size >= MAX_EARLY_EVENT_SESSIONS) {
|
|
2104
2201
|
writeStderrLine(
|
|
2105
|
-
`qwen serve: dropping
|
|
2202
|
+
`qwen serve: dropping early extNotification \u2014 early-event buffer at MAX_EARLY_EVENT_SESSIONS (${MAX_EARLY_EVENT_SESSIONS}); possible session-id fanout abuse`
|
|
2106
2203
|
);
|
|
2107
2204
|
return;
|
|
2108
2205
|
}
|
|
@@ -2111,7 +2208,7 @@ var BridgeClient = class {
|
|
|
2111
2208
|
}
|
|
2112
2209
|
if (buf.frames.length >= MAX_EARLY_EVENTS_PER_SESSION) {
|
|
2113
2210
|
writeStderrLine(
|
|
2114
|
-
`qwen serve: dropping
|
|
2211
|
+
`qwen serve: dropping early extNotification for session ${JSON.stringify(sessionId)} \u2014 per-session cap (${MAX_EARLY_EVENTS_PER_SESSION}) reached`
|
|
2115
2212
|
);
|
|
2116
2213
|
return;
|
|
2117
2214
|
}
|
|
@@ -2145,7 +2242,7 @@ var BridgeClient = class {
|
|
|
2145
2242
|
* Mark a sessionId as currently being restored via `session/load` /
|
|
2146
2243
|
* `session/resume`. While in this set, `bufferEarlyEvent` accepts
|
|
2147
2244
|
* frames for the id even if it's tombstoned — so restore-time
|
|
2148
|
-
*
|
|
2245
|
+
* early events from the freshly-restored child reach
|
|
2149
2246
|
* `drainEarlyEvents` instead of being rejected by the tombstone.
|
|
2150
2247
|
*
|
|
2151
2248
|
* Bridge factory calls this BEFORE awaiting the ACP restore call.
|
|
@@ -2179,7 +2276,12 @@ var BridgeClient = class {
|
|
|
2179
2276
|
this.tombstonedSessionIds.delete(sessionId);
|
|
2180
2277
|
const buf = this.earlyEvents.get(sessionId);
|
|
2181
2278
|
if (!buf) return;
|
|
2182
|
-
for (const frame of buf.frames)
|
|
2279
|
+
for (const frame of buf.frames) {
|
|
2280
|
+
if (frame.type === "session_recording_degraded") {
|
|
2281
|
+
entry.recordingDegraded = true;
|
|
2282
|
+
}
|
|
2283
|
+
entry.events.publish(frame);
|
|
2284
|
+
}
|
|
2183
2285
|
this.earlyEvents.delete(sessionId);
|
|
2184
2286
|
}
|
|
2185
2287
|
async writeTextFile(params) {
|
|
@@ -2246,6 +2348,18 @@ var BridgeClient = class {
|
|
|
2246
2348
|
if (typeof params.limit === "number" && params.limit <= 0) {
|
|
2247
2349
|
return { content: "" };
|
|
2248
2350
|
}
|
|
2351
|
+
if (typeof params.limit === "number" && params.limit > 0 && !Number.isSafeInteger(params.limit)) {
|
|
2352
|
+
throw RequestError.invalidParams(
|
|
2353
|
+
void 0,
|
|
2354
|
+
`\`limit\` must be a positive integer, got ${params.limit}`
|
|
2355
|
+
);
|
|
2356
|
+
}
|
|
2357
|
+
if (typeof params.line === "number" && params.line > 0 && !Number.isSafeInteger(params.line)) {
|
|
2358
|
+
throw RequestError.invalidParams(
|
|
2359
|
+
void 0,
|
|
2360
|
+
`\`line\` must be a positive integer, got ${params.line}`
|
|
2361
|
+
);
|
|
2362
|
+
}
|
|
2249
2363
|
const READ_FILE_SIZE_CAP = 100 * 1024 * 1024;
|
|
2250
2364
|
const stats = await fs.stat(params.path);
|
|
2251
2365
|
if (!stats.isFile()) {
|
|
@@ -2386,6 +2500,77 @@ function extractA2uiToolUpdate(params) {
|
|
|
2386
2500
|
}
|
|
2387
2501
|
__name(extractA2uiToolUpdate, "extractA2uiToolUpdate");
|
|
2388
2502
|
|
|
2503
|
+
// packages/acp-bridge/src/generation-stream.ts
|
|
2504
|
+
init_esbuild_shims();
|
|
2505
|
+
var GenerationStreamQueue = class {
|
|
2506
|
+
constructor(capacity) {
|
|
2507
|
+
this.capacity = capacity;
|
|
2508
|
+
}
|
|
2509
|
+
static {
|
|
2510
|
+
__name(this, "GenerationStreamQueue");
|
|
2511
|
+
}
|
|
2512
|
+
values = [];
|
|
2513
|
+
waiter;
|
|
2514
|
+
closed = false;
|
|
2515
|
+
failure;
|
|
2516
|
+
push(value) {
|
|
2517
|
+
if (this.closed) return false;
|
|
2518
|
+
if (this.waiter) {
|
|
2519
|
+
const waiter = this.waiter;
|
|
2520
|
+
this.waiter = void 0;
|
|
2521
|
+
waiter.resolve({ value, done: false });
|
|
2522
|
+
return true;
|
|
2523
|
+
}
|
|
2524
|
+
if (this.values.length >= this.capacity) return false;
|
|
2525
|
+
this.values.push(value);
|
|
2526
|
+
return true;
|
|
2527
|
+
}
|
|
2528
|
+
close() {
|
|
2529
|
+
if (this.closed) return;
|
|
2530
|
+
this.closed = true;
|
|
2531
|
+
this.settleWaiter();
|
|
2532
|
+
}
|
|
2533
|
+
fail(error) {
|
|
2534
|
+
if (this.closed) return;
|
|
2535
|
+
this.failure = error;
|
|
2536
|
+
this.closed = true;
|
|
2537
|
+
this.settleWaiter();
|
|
2538
|
+
}
|
|
2539
|
+
settleWaiter() {
|
|
2540
|
+
if (!this.waiter) return;
|
|
2541
|
+
const waiter = this.waiter;
|
|
2542
|
+
this.waiter = void 0;
|
|
2543
|
+
if (this.failure !== void 0) waiter.reject(this.failure);
|
|
2544
|
+
else waiter.resolve({ value: void 0, done: true });
|
|
2545
|
+
}
|
|
2546
|
+
next() {
|
|
2547
|
+
if (this.values.length > 0) {
|
|
2548
|
+
return Promise.resolve({ value: this.values.shift(), done: false });
|
|
2549
|
+
}
|
|
2550
|
+
if (this.failure !== void 0) return Promise.reject(this.failure);
|
|
2551
|
+
if (this.closed) {
|
|
2552
|
+
return Promise.resolve({ value: void 0, done: true });
|
|
2553
|
+
}
|
|
2554
|
+
if (this.waiter) {
|
|
2555
|
+
return Promise.reject(
|
|
2556
|
+
new Error("GenerationStreamQueue supports only one pending reader")
|
|
2557
|
+
);
|
|
2558
|
+
}
|
|
2559
|
+
return new Promise((resolve2, reject) => {
|
|
2560
|
+
this.waiter = { resolve: resolve2, reject };
|
|
2561
|
+
});
|
|
2562
|
+
}
|
|
2563
|
+
[Symbol.asyncIterator]() {
|
|
2564
|
+
return {
|
|
2565
|
+
next: /* @__PURE__ */ __name(() => this.next(), "next"),
|
|
2566
|
+
return: /* @__PURE__ */ __name(async () => {
|
|
2567
|
+
this.close();
|
|
2568
|
+
return { value: void 0, done: true };
|
|
2569
|
+
}, "return")
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2573
|
+
|
|
2389
2574
|
// packages/acp-bridge/src/sessionArtifacts.ts
|
|
2390
2575
|
init_esbuild_shims();
|
|
2391
2576
|
import { createHash } from "node:crypto";
|
|
@@ -4799,6 +4984,12 @@ function parseWorkspaceMemoryDreamResult(response) {
|
|
|
4799
4984
|
};
|
|
4800
4985
|
}
|
|
4801
4986
|
__name(parseWorkspaceMemoryDreamResult, "parseWorkspaceMemoryDreamResult");
|
|
4987
|
+
function pickUserInputEchoMeta(meta) {
|
|
4988
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta)) return {};
|
|
4989
|
+
const inputAnnotations = meta["inputAnnotations"];
|
|
4990
|
+
return Array.isArray(inputAnnotations) ? { inputAnnotations } : {};
|
|
4991
|
+
}
|
|
4992
|
+
__name(pickUserInputEchoMeta, "pickUserInputEchoMeta");
|
|
4802
4993
|
function echoPromptToSessionBus(entry, req, originatorClientId) {
|
|
4803
4994
|
const prompt = req.prompt;
|
|
4804
4995
|
if (!Array.isArray(prompt) || prompt.length === 0) return;
|
|
@@ -4820,7 +5011,11 @@ function echoPromptToSessionBus(entry, req, originatorClientId) {
|
|
|
4820
5011
|
// field permitted alongside spec fields, the SDK normalizer
|
|
4821
5012
|
// reads it from `update._meta`/`data._meta`, and every other
|
|
4822
5013
|
// agent-emitted session_update carries `_meta` the same way.
|
|
4823
|
-
_meta: {
|
|
5014
|
+
_meta: {
|
|
5015
|
+
...pickUserInputEchoMeta(req._meta),
|
|
5016
|
+
serverTimestamp,
|
|
5017
|
+
source: "bridge-echo"
|
|
5018
|
+
}
|
|
4824
5019
|
}
|
|
4825
5020
|
},
|
|
4826
5021
|
...originatorClientId ? { originatorClientId } : {}
|
|
@@ -4971,6 +5166,8 @@ var MCP_OAUTH_TIMEOUT_MS = 6e5;
|
|
|
4971
5166
|
var DAEMON_RETRY_META_KEY = "qwen.daemon.retry";
|
|
4972
5167
|
var DAEMON_CONTINUE_META_KEY = "qwen.daemon.continueLastTurn";
|
|
4973
5168
|
var SESSION_RECAP_TIMEOUT_MS = 6e4;
|
|
5169
|
+
var SESSION_GENERATION_TIMEOUT_MS = 65e3;
|
|
5170
|
+
var GENERATION_STREAM_QUEUE_CAPACITY = 128;
|
|
4974
5171
|
var SESSION_BTW_TIMEOUT_MS = 6e4;
|
|
4975
5172
|
var SESSION_TRANSCRIPT_TIMEOUT_MS = 6e4;
|
|
4976
5173
|
var SHELL_COMMAND_TIMEOUT_MS = 12e4;
|
|
@@ -5206,6 +5403,8 @@ function createAcpSessionBridge(opts) {
|
|
|
5206
5403
|
const aliveChannels = /* @__PURE__ */ new Set();
|
|
5207
5404
|
let inFlightChannelSpawn;
|
|
5208
5405
|
const byId = /* @__PURE__ */ new Map();
|
|
5406
|
+
const generationRequests = /* @__PURE__ */ new Map();
|
|
5407
|
+
const inFlightExtensionRefreshes = /* @__PURE__ */ new Map();
|
|
5209
5408
|
const toSessionSummary = /* @__PURE__ */ __name((entry) => {
|
|
5210
5409
|
let isWaitingForPermission = false;
|
|
5211
5410
|
let isWaitingForUserQuestion = false;
|
|
@@ -5222,6 +5421,8 @@ function createAcpSessionBridge(opts) {
|
|
|
5222
5421
|
createdAt: entry.createdAt,
|
|
5223
5422
|
displayName: entry.displayName,
|
|
5224
5423
|
...entry.parentSessionId ? { parentSessionId: entry.parentSessionId } : {},
|
|
5424
|
+
...entry.sourceType ? { sourceType: entry.sourceType } : {},
|
|
5425
|
+
...entry.sourceId !== void 0 ? { sourceId: entry.sourceId } : {},
|
|
5225
5426
|
clientCount: entry.clientIds.size,
|
|
5226
5427
|
hasActivePrompt: entry.promptActive,
|
|
5227
5428
|
isWaitingForPermission,
|
|
@@ -5257,6 +5458,7 @@ function createAcpSessionBridge(opts) {
|
|
|
5257
5458
|
}
|
|
5258
5459
|
);
|
|
5259
5460
|
let shuttingDown = false;
|
|
5461
|
+
let shutdownPromise;
|
|
5260
5462
|
const teeServeDebugLine = /* @__PURE__ */ __name((message) => {
|
|
5261
5463
|
writeServeDebugLine(message);
|
|
5262
5464
|
if (opts.onDiagnosticLine && isServeDebugLoggingEnabled()) {
|
|
@@ -5382,15 +5584,29 @@ function createAcpSessionBridge(opts) {
|
|
|
5382
5584
|
// at the session/update fan-in to the daemon host's metrics ring via
|
|
5383
5585
|
// the telemetry seam. Optional-chained so non-daemon callers (tests,
|
|
5384
5586
|
// Mode A) that wire no `tokenUsage` metric are a silent no-op.
|
|
5385
|
-
(inputTokens, outputTokens, durationMs) => telemetry.metrics?.tokenUsage?.(
|
|
5587
|
+
(inputTokens, outputTokens, durationMs, apiErrors, apiRetries) => telemetry.metrics?.tokenUsage?.(
|
|
5386
5588
|
inputTokens,
|
|
5387
5589
|
outputTokens,
|
|
5388
|
-
durationMs
|
|
5590
|
+
durationMs,
|
|
5591
|
+
apiErrors,
|
|
5592
|
+
apiRetries
|
|
5389
5593
|
),
|
|
5390
5594
|
// `create_sub_session` tool: forward the request/response hook so a child
|
|
5391
5595
|
// tool can ask the daemon to spawn a sub-session and (for 'first-turn')
|
|
5392
5596
|
// return its result. Omitted → the method reports daemon-only.
|
|
5393
|
-
opts.onCreateSubSession
|
|
5597
|
+
opts.onCreateSubSession,
|
|
5598
|
+
(sessionId, event) => {
|
|
5599
|
+
const request = generationRequests.get(event.requestId);
|
|
5600
|
+
if (!request || request.sessionId !== sessionId) return;
|
|
5601
|
+
if (request.queue.push(event)) return;
|
|
5602
|
+
request.settled = true;
|
|
5603
|
+
generationRequests.delete(event.requestId);
|
|
5604
|
+
request.queue.fail(new Error("Generation stream consumer too slow"));
|
|
5605
|
+
void request.connection.extMethod(SERVE_CONTROL_EXT_METHODS.sessionGenerationCancel, {
|
|
5606
|
+
sessionId,
|
|
5607
|
+
requestId: event.requestId
|
|
5608
|
+
}).catch(() => void 0);
|
|
5609
|
+
}
|
|
5394
5610
|
);
|
|
5395
5611
|
const connection = new ClientSideConnection(() => client, channel.stream);
|
|
5396
5612
|
const info = {
|
|
@@ -5509,7 +5725,7 @@ function createAcpSessionBridge(opts) {
|
|
|
5509
5725
|
}
|
|
5510
5726
|
}
|
|
5511
5727
|
__name(ensureChannel, "ensureChannel");
|
|
5512
|
-
async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId) {
|
|
5728
|
+
async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId, sourceType, sourceId) {
|
|
5513
5729
|
const ci = await ensureChannel();
|
|
5514
5730
|
ci.sessionSpawnsInFlight++;
|
|
5515
5731
|
let sessionRegistered = false;
|
|
@@ -5551,7 +5767,7 @@ function createAcpSessionBridge(opts) {
|
|
|
5551
5767
|
newSessionResp.sessionId,
|
|
5552
5768
|
boundWorkspace,
|
|
5553
5769
|
void 0,
|
|
5554
|
-
{ parentSessionId }
|
|
5770
|
+
{ parentSessionId, sourceType, sourceId }
|
|
5555
5771
|
);
|
|
5556
5772
|
initializedSessionId = entry.sessionId;
|
|
5557
5773
|
sessionRegistered = true;
|
|
@@ -5601,6 +5817,32 @@ function createAcpSessionBridge(opts) {
|
|
|
5601
5817
|
);
|
|
5602
5818
|
}
|
|
5603
5819
|
}
|
|
5820
|
+
let sourcePersisted;
|
|
5821
|
+
if (entry.sourceType) {
|
|
5822
|
+
try {
|
|
5823
|
+
const sourceResult = await Promise.race([
|
|
5824
|
+
withTimeout(
|
|
5825
|
+
entry.connection.extMethod(
|
|
5826
|
+
SERVE_CONTROL_EXT_METHODS.sessionSource,
|
|
5827
|
+
{
|
|
5828
|
+
sessionId: entry.sessionId,
|
|
5829
|
+
sourceType: entry.sourceType,
|
|
5830
|
+
...entry.sourceId !== void 0 ? { sourceId: entry.sourceId } : {}
|
|
5831
|
+
}
|
|
5832
|
+
),
|
|
5833
|
+
initTimeoutMs,
|
|
5834
|
+
"sessionSource"
|
|
5835
|
+
),
|
|
5836
|
+
getTransportClosedReject(entry)
|
|
5837
|
+
]);
|
|
5838
|
+
sourcePersisted = sourceResult?.persisted === true;
|
|
5839
|
+
} catch (err) {
|
|
5840
|
+
sourcePersisted = false;
|
|
5841
|
+
writeStderrLine(
|
|
5842
|
+
`qwen serve: source metadata for ${entry.sessionId} was not persisted (${err instanceof Error ? err.message : String(err)}) \u2014 the source is live-only until restart (reported to the caller via sourcePersisted=false)`
|
|
5843
|
+
);
|
|
5844
|
+
}
|
|
5845
|
+
}
|
|
5604
5846
|
if (modelServiceId) {
|
|
5605
5847
|
await applyModelServiceId(
|
|
5606
5848
|
entry,
|
|
@@ -5636,6 +5878,9 @@ function createAcpSessionBridge(opts) {
|
|
|
5636
5878
|
attached: false,
|
|
5637
5879
|
clientId,
|
|
5638
5880
|
createdAt: entry.createdAt,
|
|
5881
|
+
...entry.sourceType ? { sourceType: entry.sourceType } : {},
|
|
5882
|
+
...entry.sourceId !== void 0 ? { sourceId: entry.sourceId } : {},
|
|
5883
|
+
...entry.sourceType ? { sourcePersisted: sourcePersisted === true } : {},
|
|
5639
5884
|
...entry.parentSessionId ? { parentSessionPersisted: parentSessionPersisted === true } : {}
|
|
5640
5885
|
};
|
|
5641
5886
|
} finally {
|
|
@@ -6117,6 +6362,8 @@ function createAcpSessionBridge(opts) {
|
|
|
6117
6362
|
workspaceCwd,
|
|
6118
6363
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6119
6364
|
...options.parentSessionId ? { parentSessionId: options.parentSessionId } : {},
|
|
6365
|
+
...options.sourceType ? { sourceType: options.sourceType } : {},
|
|
6366
|
+
...options.sourceId !== void 0 ? { sourceId: options.sourceId } : {},
|
|
6120
6367
|
channel: ci.channel,
|
|
6121
6368
|
connection: ci.connection,
|
|
6122
6369
|
events,
|
|
@@ -6125,6 +6372,7 @@ function createAcpSessionBridge(opts) {
|
|
|
6125
6372
|
workspaceCwd,
|
|
6126
6373
|
persistence: createSessionArtifactPersistence(ci.connection, sessionId)
|
|
6127
6374
|
}),
|
|
6375
|
+
recordingDegraded: false,
|
|
6128
6376
|
promptQueue: Promise.resolve(),
|
|
6129
6377
|
pendingPromptCount: 0,
|
|
6130
6378
|
pendingPromptList: [],
|
|
@@ -6350,6 +6598,8 @@ function createAcpSessionBridge(opts) {
|
|
|
6350
6598
|
attached: true,
|
|
6351
6599
|
clientId,
|
|
6352
6600
|
createdAt: existing.createdAt,
|
|
6601
|
+
...existing.sourceType ? { sourceType: existing.sourceType } : {},
|
|
6602
|
+
...existing.sourceId !== void 0 ? { sourceId: existing.sourceId } : {},
|
|
6353
6603
|
// Late attachers get the same ACP state the original restore
|
|
6354
6604
|
// caller saw; spawn-only sessions don't carry a state payload.
|
|
6355
6605
|
state: existing.restoreState ?? {},
|
|
@@ -6522,6 +6772,8 @@ function createAcpSessionBridge(opts) {
|
|
|
6522
6772
|
attached: true,
|
|
6523
6773
|
clientId: clientId2,
|
|
6524
6774
|
createdAt: racedEntry.createdAt,
|
|
6775
|
+
...racedEntry.sourceType ? { sourceType: racedEntry.sourceType } : {},
|
|
6776
|
+
...racedEntry.sourceId !== void 0 ? { sourceId: racedEntry.sourceId } : {},
|
|
6525
6777
|
state: racedEntry.restoreState ?? {},
|
|
6526
6778
|
hasActivePrompt: racedEntry.promptActive,
|
|
6527
6779
|
...replayFieldsFor(racedEntry, action)
|
|
@@ -6537,7 +6789,9 @@ function createAcpSessionBridge(opts) {
|
|
|
6537
6789
|
lifecycleReason: action,
|
|
6538
6790
|
// Re-seed the persisted parent lineage the caller recovered from the
|
|
6539
6791
|
// transcript, so a restored sub-session's status reports its parent.
|
|
6540
|
-
...req.parentSessionId ? { parentSessionId: req.parentSessionId } : {}
|
|
6792
|
+
...req.parentSessionId ? { parentSessionId: req.parentSessionId } : {},
|
|
6793
|
+
...req.sourceType ? { sourceType: req.sourceType } : {},
|
|
6794
|
+
...req.sourceId !== void 0 ? { sourceId: req.sourceId } : {}
|
|
6541
6795
|
}
|
|
6542
6796
|
);
|
|
6543
6797
|
releaseAdmissionOnce();
|
|
@@ -6582,6 +6836,8 @@ function createAcpSessionBridge(opts) {
|
|
|
6582
6836
|
attached: false,
|
|
6583
6837
|
clientId,
|
|
6584
6838
|
createdAt: entry.createdAt,
|
|
6839
|
+
...entry.sourceType ? { sourceType: entry.sourceType } : {},
|
|
6840
|
+
...entry.sourceId !== void 0 ? { sourceId: entry.sourceId } : {},
|
|
6585
6841
|
state: publicState,
|
|
6586
6842
|
...artifactRestoreWarnings.length > 0 ? { artifactWarnings: artifactRestoreWarnings } : {},
|
|
6587
6843
|
hasActivePrompt: entry.promptActive,
|
|
@@ -6802,6 +7058,10 @@ function createAcpSessionBridge(opts) {
|
|
|
6802
7058
|
throw new InvalidSessionScopeError(req.sessionScope);
|
|
6803
7059
|
}
|
|
6804
7060
|
const effectiveScope = req.sessionScope ?? defaultSessionScope;
|
|
7061
|
+
const source = parseSessionSource(req.sourceType, req.sourceId);
|
|
7062
|
+
if ("error" in source) {
|
|
7063
|
+
throw new InvalidSessionMetadataError("sourceType", source.error);
|
|
7064
|
+
}
|
|
6805
7065
|
if (req.approvalMode !== void 0 && !KNOWN_APPROVAL_MODES.has(req.approvalMode)) {
|
|
6806
7066
|
throw new Error(
|
|
6807
7067
|
`Invalid approvalMode: ${JSON.stringify(req.approvalMode)}`
|
|
@@ -6834,6 +7094,8 @@ function createAcpSessionBridge(opts) {
|
|
|
6834
7094
|
attached: true,
|
|
6835
7095
|
clientId,
|
|
6836
7096
|
createdAt: existing.createdAt,
|
|
7097
|
+
...existing.sourceType ? { sourceType: existing.sourceType } : {},
|
|
7098
|
+
...existing.sourceId !== void 0 ? { sourceId: existing.sourceId } : {},
|
|
6837
7099
|
hasActivePrompt: existing.promptActive
|
|
6838
7100
|
};
|
|
6839
7101
|
}
|
|
@@ -6892,7 +7154,9 @@ function createAcpSessionBridge(opts) {
|
|
|
6892
7154
|
req.approvalMode,
|
|
6893
7155
|
req.clientId,
|
|
6894
7156
|
releaseAdmissionOnce,
|
|
6895
|
-
req.parentSessionId
|
|
7157
|
+
req.parentSessionId,
|
|
7158
|
+
source.sourceType,
|
|
7159
|
+
source.sourceId
|
|
6896
7160
|
);
|
|
6897
7161
|
const tracker = effectiveScope === "single" ? workspaceKey : `${workspaceKey}#${randomUUID2()}`;
|
|
6898
7162
|
inFlightSpawns.set(tracker, promise);
|
|
@@ -7241,7 +7505,8 @@ function createAcpSessionBridge(opts) {
|
|
|
7241
7505
|
data: {
|
|
7242
7506
|
sessionId: entry.sessionId,
|
|
7243
7507
|
currentModelId: entry.currentModelId ?? null,
|
|
7244
|
-
currentApprovalMode: entry.currentApprovalMode ?? null
|
|
7508
|
+
currentApprovalMode: entry.currentApprovalMode ?? null,
|
|
7509
|
+
recordingDegraded: entry.recordingDegraded
|
|
7245
7510
|
}
|
|
7246
7511
|
}), "snapshotFrame");
|
|
7247
7512
|
async function* withSnapshot() {
|
|
@@ -7535,7 +7800,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7535
7800
|
const r = res;
|
|
7536
7801
|
if (r && r.persisted === false) {
|
|
7537
7802
|
writeStderrLine(
|
|
7538
|
-
`qwen serve: displayName for ${sessionId} was not persisted
|
|
7803
|
+
`qwen serve: displayName for ${sessionId} was not persisted`
|
|
7539
7804
|
);
|
|
7540
7805
|
}
|
|
7541
7806
|
}).catch((err) => {
|
|
@@ -7975,12 +8240,26 @@ function createAcpSessionBridge(opts) {
|
|
|
7975
8240
|
return { refreshed: 0, failed: 0 };
|
|
7976
8241
|
}
|
|
7977
8242
|
try {
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
8243
|
+
let inFlight = inFlightExtensionRefreshes.get(entry.sessionId);
|
|
8244
|
+
if (!inFlight || inFlight.connection !== entry.connection) {
|
|
8245
|
+
const promise = (async () => {
|
|
8246
|
+
await entry.connection.extMethod(
|
|
7981
8247
|
SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh,
|
|
7982
8248
|
{ sessionId: entry.sessionId }
|
|
7983
|
-
)
|
|
8249
|
+
);
|
|
8250
|
+
})();
|
|
8251
|
+
inFlight = { connection: entry.connection, promise };
|
|
8252
|
+
inFlightExtensionRefreshes.set(entry.sessionId, inFlight);
|
|
8253
|
+
const clear = /* @__PURE__ */ __name(() => {
|
|
8254
|
+
if (inFlightExtensionRefreshes.get(entry.sessionId) === inFlight) {
|
|
8255
|
+
inFlightExtensionRefreshes.delete(entry.sessionId);
|
|
8256
|
+
}
|
|
8257
|
+
}, "clear");
|
|
8258
|
+
void promise.then(clear, clear);
|
|
8259
|
+
}
|
|
8260
|
+
await Promise.race([
|
|
8261
|
+
withTimeout(
|
|
8262
|
+
inFlight.promise,
|
|
7984
8263
|
3e4,
|
|
7985
8264
|
SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh
|
|
7986
8265
|
),
|
|
@@ -8169,6 +8448,75 @@ function createAcpSessionBridge(opts) {
|
|
|
8169
8448
|
recap: response.recap ?? null
|
|
8170
8449
|
};
|
|
8171
8450
|
},
|
|
8451
|
+
generateSessionContent(sessionId, prompt, signal, context) {
|
|
8452
|
+
const entry = byId.get(sessionId);
|
|
8453
|
+
if (!entry) throw new SessionNotFoundError(sessionId);
|
|
8454
|
+
const info = channelInfoForEntry(entry);
|
|
8455
|
+
if (!info || info.isDying) throw new SessionNotFoundError(sessionId);
|
|
8456
|
+
resolveTrustedClientId(entry, context?.clientId);
|
|
8457
|
+
const requestId = randomUUID2();
|
|
8458
|
+
const queue = new GenerationStreamQueue(
|
|
8459
|
+
GENERATION_STREAM_QUEUE_CAPACITY
|
|
8460
|
+
);
|
|
8461
|
+
const request = {
|
|
8462
|
+
sessionId,
|
|
8463
|
+
connection: entry.connection,
|
|
8464
|
+
queue,
|
|
8465
|
+
settled: false
|
|
8466
|
+
};
|
|
8467
|
+
generationRequests.set(requestId, request);
|
|
8468
|
+
const cancel = /* @__PURE__ */ __name(() => {
|
|
8469
|
+
if (request.settled) return;
|
|
8470
|
+
request.settled = true;
|
|
8471
|
+
generationRequests.delete(requestId);
|
|
8472
|
+
queue.close();
|
|
8473
|
+
void entry.connection.extMethod(SERVE_CONTROL_EXT_METHODS.sessionGenerationCancel, {
|
|
8474
|
+
sessionId,
|
|
8475
|
+
requestId
|
|
8476
|
+
}).catch(() => void 0);
|
|
8477
|
+
}, "cancel");
|
|
8478
|
+
signal.addEventListener("abort", cancel, { once: true });
|
|
8479
|
+
if (signal.aborted) {
|
|
8480
|
+
cancel();
|
|
8481
|
+
return queue;
|
|
8482
|
+
}
|
|
8483
|
+
void Promise.race([
|
|
8484
|
+
withTimeout(
|
|
8485
|
+
entry.connection.extMethod(
|
|
8486
|
+
SERVE_CONTROL_EXT_METHODS.sessionGenerationStart,
|
|
8487
|
+
{ sessionId, requestId, prompt }
|
|
8488
|
+
),
|
|
8489
|
+
SESSION_GENERATION_TIMEOUT_MS,
|
|
8490
|
+
SERVE_CONTROL_EXT_METHODS.sessionGenerationStart
|
|
8491
|
+
),
|
|
8492
|
+
getTransportClosedReject(entry)
|
|
8493
|
+
]).then((raw) => {
|
|
8494
|
+
if (request.settled) return;
|
|
8495
|
+
const response = raw;
|
|
8496
|
+
const model = response["model"];
|
|
8497
|
+
const modelSource = response["modelSource"];
|
|
8498
|
+
if (typeof model !== "string" || modelSource !== "fast" && modelSource !== "main") {
|
|
8499
|
+
throw new Error("Malformed generation completion");
|
|
8500
|
+
}
|
|
8501
|
+
const accepted = queue.push({
|
|
8502
|
+
type: "done",
|
|
8503
|
+
requestId,
|
|
8504
|
+
model,
|
|
8505
|
+
modelSource,
|
|
8506
|
+
...typeof response["inputTokens"] === "number" ? { inputTokens: response["inputTokens"] } : {},
|
|
8507
|
+
...typeof response["outputTokens"] === "number" ? { outputTokens: response["outputTokens"] } : {}
|
|
8508
|
+
});
|
|
8509
|
+
if (accepted) queue.close();
|
|
8510
|
+
else queue.fail(new Error("Generation stream consumer too slow"));
|
|
8511
|
+
}).catch((error) => {
|
|
8512
|
+
if (!request.settled) queue.fail(error);
|
|
8513
|
+
}).finally(() => {
|
|
8514
|
+
request.settled = true;
|
|
8515
|
+
signal.removeEventListener("abort", cancel);
|
|
8516
|
+
generationRequests.delete(requestId);
|
|
8517
|
+
});
|
|
8518
|
+
return queue;
|
|
8519
|
+
},
|
|
8172
8520
|
getPendingPrompts(sessionId, context) {
|
|
8173
8521
|
const entry = byId.get(sessionId);
|
|
8174
8522
|
if (!entry) throw new SessionNotFoundError(sessionId);
|
|
@@ -8675,10 +9023,10 @@ function createAcpSessionBridge(opts) {
|
|
|
8675
9023
|
},
|
|
8676
9024
|
async killSession(sessionId, opts2) {
|
|
8677
9025
|
const entry = byId.get(sessionId);
|
|
8678
|
-
if (!entry) return;
|
|
9026
|
+
if (!entry) return false;
|
|
8679
9027
|
if (opts2?.requireZeroAttaches && entry.attachCount > 0) {
|
|
8680
9028
|
entry.spawnOwnerWantedKill = true;
|
|
8681
|
-
return;
|
|
9029
|
+
return false;
|
|
8682
9030
|
}
|
|
8683
9031
|
permissionMediator.forgetSession(sessionId);
|
|
8684
9032
|
entry.pendingPermissionIds.clear();
|
|
@@ -8722,6 +9070,7 @@ function createAcpSessionBridge(opts) {
|
|
|
8722
9070
|
await startIdleTimer(ci, `killSession "${sessionId}"`);
|
|
8723
9071
|
}
|
|
8724
9072
|
}
|
|
9073
|
+
return true;
|
|
8725
9074
|
},
|
|
8726
9075
|
async detachClient(sessionId, clientId) {
|
|
8727
9076
|
const entry = byId.get(sessionId);
|
|
@@ -8764,60 +9113,71 @@ function createAcpSessionBridge(opts) {
|
|
|
8764
9113
|
}
|
|
8765
9114
|
}
|
|
8766
9115
|
},
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
9116
|
+
shutdown(options) {
|
|
9117
|
+
if (shutdownPromise) return shutdownPromise;
|
|
9118
|
+
const shutdownReason = options?.reason ?? "daemon_shutdown";
|
|
9119
|
+
let resolveShutdown;
|
|
9120
|
+
let rejectShutdown;
|
|
9121
|
+
shutdownPromise = new Promise((resolve2, reject) => {
|
|
9122
|
+
resolveShutdown = resolve2;
|
|
9123
|
+
rejectShutdown = reject;
|
|
9124
|
+
});
|
|
9125
|
+
void (async () => {
|
|
9126
|
+
shuttingDown = true;
|
|
9127
|
+
cancelIdleTimer();
|
|
9128
|
+
stopSessionReaper();
|
|
9129
|
+
const entries = Array.from(byId.values());
|
|
9130
|
+
const channels = Array.from(aliveChannels);
|
|
9131
|
+
for (const ci of channels) ci.isDying = true;
|
|
9132
|
+
for (const e of entries) {
|
|
9133
|
+
permissionMediator.forgetSession(e.sessionId);
|
|
9134
|
+
e.pendingPermissionIds.clear();
|
|
9135
|
+
e.pendingInteractions.clear();
|
|
9136
|
+
}
|
|
9137
|
+
defaultEntry = void 0;
|
|
9138
|
+
byId.clear();
|
|
9139
|
+
for (const e of entries) {
|
|
9140
|
+
telemetry.metrics?.sessionLifecycle("die");
|
|
9141
|
+
emitSessionLifecycle({
|
|
9142
|
+
type: "removed",
|
|
9143
|
+
sessionId: e.sessionId,
|
|
9144
|
+
workspaceCwd: e.workspaceCwd,
|
|
9145
|
+
reason: shutdownReason
|
|
8793
9146
|
});
|
|
8794
|
-
|
|
9147
|
+
try {
|
|
9148
|
+
e.events.publish({
|
|
9149
|
+
type: "session_died",
|
|
9150
|
+
data: { sessionId: e.sessionId, reason: shutdownReason }
|
|
9151
|
+
});
|
|
9152
|
+
} catch {
|
|
9153
|
+
}
|
|
9154
|
+
e.events.close();
|
|
8795
9155
|
}
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
)
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
9156
|
+
const inFlightSessionAwaits = Array.from(inFlightSpawns.values()).map(
|
|
9157
|
+
(p) => p.then(
|
|
9158
|
+
() => void 0,
|
|
9159
|
+
() => void 0
|
|
9160
|
+
)
|
|
9161
|
+
);
|
|
9162
|
+
const inFlightRestoreAwaits = Array.from(inFlightRestores.values()).map(
|
|
9163
|
+
(restore) => restore.promise.then(
|
|
9164
|
+
() => void 0,
|
|
9165
|
+
() => void 0
|
|
9166
|
+
)
|
|
9167
|
+
);
|
|
9168
|
+
const inFlightChannelAwait = inFlightChannelSpawn ? inFlightChannelSpawn.then(
|
|
8806
9169
|
() => void 0,
|
|
8807
9170
|
() => void 0
|
|
8808
|
-
)
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
...inFlightRestoreAwaits,
|
|
8819
|
-
inFlightChannelAwait
|
|
8820
|
-
]);
|
|
9171
|
+
) : Promise.resolve();
|
|
9172
|
+
await Promise.all([
|
|
9173
|
+
...channels.map((ci) => ci.channel.kill().catch(() => {
|
|
9174
|
+
})),
|
|
9175
|
+
...inFlightSessionAwaits,
|
|
9176
|
+
...inFlightRestoreAwaits,
|
|
9177
|
+
inFlightChannelAwait
|
|
9178
|
+
]);
|
|
9179
|
+
})().then(resolveShutdown, rejectShutdown);
|
|
9180
|
+
return shutdownPromise;
|
|
8821
9181
|
},
|
|
8822
9182
|
async preheat() {
|
|
8823
9183
|
if (shuttingDown) return;
|
|
@@ -8848,6 +9208,7 @@ var createHttpAcpBridge = createAcpSessionBridge;
|
|
|
8848
9208
|
export {
|
|
8849
9209
|
SessionArtifactValidationError,
|
|
8850
9210
|
SessionArtifactAuthorizationError,
|
|
9211
|
+
parseSessionSource,
|
|
8851
9212
|
extractErrorMessage,
|
|
8852
9213
|
extractErrorCode,
|
|
8853
9214
|
classifyTurnErrorKind,
|