@qwen-code/qwen-code 0.21.0 → 0.21.1-nightly.20260731.702932cc7
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 +2 -0
- package/bundled/qc-helper/docs/configuration/settings.md +39 -28
- package/bundled/qc-helper/docs/features/channels/_meta.ts +2 -0
- package/bundled/qc-helper/docs/features/channels/github.md +139 -0
- package/bundled/qc-helper/docs/features/channels/gitlab.md +171 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +61 -6
- package/bundled/qc-helper/docs/features/code-review.md +21 -1
- package/bundled/qc-helper/docs/features/hooks.md +72 -15
- package/bundled/qc-helper/docs/features/mcp.md +9 -1
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +3 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +42 -8
- package/bundled/qc-helper/docs/qwen-serve.md +11 -7
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +2 -2
- package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
- package/bundled/review/DESIGN.md +19 -0
- package/bundled/review/SKILL.md +120 -61
- package/chunks/MaxSizedBox-LAFHK4VO.js +88 -0
- package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-EMNOBN3S.js} +71 -68
- package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-2C4A5ZTJ.js} +2 -2
- package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-ERFA6HWV.js} +1674 -591
- package/chunks/agent-PLKF6JK4.js +84 -0
- package/chunks/agent-headless-JAORDQ63.js +78 -0
- package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-OFHSZJBF.js} +79 -27
- package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-RDN2W7ND.js} +4 -4
- package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-OZERWH5R.js} +4 -4
- package/chunks/bridge-NYOBVRIT.js +94 -0
- package/chunks/{build-RV63TIRH.js → build-GDBLPA24.js} +1 -1
- package/chunks/{ca-25EDXPFZ.js → ca-6W3SK7OQ.js} +6 -1
- package/chunks/channel-management-service-5S7YCWX5.js +418 -0
- package/chunks/channel-settings-store-NLOKYO23.js +91 -0
- package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-OVWGYMZS.js} +11 -6
- package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-H55GKOQA.js} +11 -6
- package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-CABBXYHK.js} +7 -5
- package/chunks/{chunk-RIBKPMRP.js → chunk-23F4XGWO.js} +19 -6
- package/chunks/{chunk-ACY3A37B.js → chunk-25VHI5T7.js} +23 -18
- package/chunks/{chunk-MZAXJAUM.js → chunk-26JK4RPD.js} +1 -1
- package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
- package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
- package/chunks/{chunk-2X55UKQE.js → chunk-2JZR3B4A.js} +3 -3
- package/chunks/{chunk-7JURR4JT.js → chunk-2OQUICDM.js} +167 -81
- package/chunks/{chunk-ZJHVAS7M.js → chunk-2YCYFWYZ.js} +4 -5
- package/chunks/{chunk-3QMGYBFN.js → chunk-3APUUXRF.js} +1 -80
- package/chunks/{chunk-MUP3T3AD.js → chunk-3I6DUGQD.js} +1 -35
- package/chunks/{chunk-JVPM2ULZ.js → chunk-3XZ5SSNR.js} +6 -6
- package/chunks/chunk-42VPM33K.js +319 -0
- package/chunks/{chunk-VAK25FTU.js → chunk-45IOTAUS.js} +1 -1
- package/chunks/chunk-45UYUCJ6.js +363 -0
- package/chunks/{chunk-JZA3JUDJ.js → chunk-4KP2F2TE.js} +1 -1
- package/chunks/{chunk-IO3IX5Q4.js → chunk-4YJQD2IO.js} +1 -1
- package/chunks/{chunk-JXJFVC6E.js → chunk-5G6XUGXO.js} +61 -14
- package/chunks/{chunk-ZOIFNCKL.js → chunk-5NNHICSA.js} +3 -23
- package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
- package/chunks/{chunk-RHLZR4E5.js → chunk-675H6PLP.js} +1 -1
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/chunk-6MPDY6ZG.js +76 -0
- package/chunks/{chunk-PSOO6YXD.js → chunk-6NUWQ3R7.js} +9 -7
- package/chunks/{chunk-7MVVZO4N.js → chunk-6ZRWX46I.js} +4 -4
- package/chunks/{chunk-TPRQ7RZH.js → chunk-76E5Y3UZ.js} +3117 -993
- package/chunks/{chunk-UUUTRMI2.js → chunk-7ULQIS27.js} +1 -1
- package/chunks/{chunk-BKHWX6I2.js → chunk-A5BZ722X.js} +11 -3
- package/chunks/{chunk-TEHGS6UP.js → chunk-A5T5W7PR.js} +154 -16
- package/chunks/{chunk-VIA5XA4U.js → chunk-A5UODYG3.js} +4 -1
- package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
- package/chunks/{chunk-EBJQ6AXW.js → chunk-ANDVK2JN.js} +358 -14
- package/chunks/{chunk-TOFQCPDC.js → chunk-AOHY3QJ3.js} +14 -8
- package/chunks/chunk-AQ37AY7B.js +93 -0
- package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
- package/chunks/{chunk-LKEJ26GS.js → chunk-B3TA3IF5.js} +16 -11
- package/chunks/{chunk-Q4M4MDQ4.js → chunk-B43QHWY6.js} +1 -1
- package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
- package/chunks/{chunk-K36B6G2O.js → chunk-B6FOGNGH.js} +5 -5
- package/chunks/{chunk-PWVFN2LF.js → chunk-BP2H5K25.js} +1 -1
- package/chunks/{chunk-LB6DUZ26.js → chunk-BTWSGZCT.js} +264 -185
- package/chunks/{chunk-ZNAUOR2I.js → chunk-BZBPT52P.js} +2 -2
- package/chunks/{chunk-L26JL52R.js → chunk-CBBP4BMC.js} +64 -67
- package/chunks/{chunk-ZD6UTE4A.js → chunk-CNTR4GR6.js} +1 -1
- package/chunks/{chunk-3SJ43L4W.js → chunk-CPZAH673.js} +6 -0
- package/chunks/{chunk-EPDRMGT4.js → chunk-D4HTUMGX.js} +4 -28
- package/chunks/{chunk-QAF7NMK7.js → chunk-D7CQTWRS.js} +1 -1
- package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
- package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
- package/chunks/{chunk-IKCX4CCL.js → chunk-DKPJUF5F.js} +118 -95
- package/chunks/{chunk-DLWL3Z7A.js → chunk-DSFHVTWD.js} +3 -3
- package/chunks/{chunk-FSITMZJH.js → chunk-DYRYLJ3O.js} +18 -9
- package/chunks/{chunk-NL7LTRLR.js → chunk-E2BHWIDT.js} +48 -72
- package/chunks/{chunk-UDX5OBWR.js → chunk-E2FN6SM7.js} +94 -4
- package/chunks/{chunk-USTWD7QV.js → chunk-E6CJ2SMM.js} +26 -16
- package/chunks/{chunk-KMQ33DO4.js → chunk-EDB7A72S.js} +4 -4
- package/chunks/{chunk-7ZCNENPP.js → chunk-FANRZEAJ.js} +1 -1
- package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
- package/chunks/{chunk-5NBDS5S6.js → chunk-FCYYAB4S.js} +162 -7
- package/chunks/{chunk-OKY7HXPG.js → chunk-FJ5WUMUQ.js} +2 -2
- package/chunks/{chunk-PHOF65IG.js → chunk-FRXG4ARO.js} +36273 -44436
- package/chunks/{chunk-FQK6JAFG.js → chunk-FS674JW4.js} +4 -4
- package/chunks/chunk-FYJ7W2PI.js +194 -0
- package/chunks/{chunk-BULDBTYC.js → chunk-G7XXKQYS.js} +3 -28
- package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
- package/chunks/{chunk-VRYUBFMC.js → chunk-GRUAVQQR.js} +1 -1
- package/chunks/{chunk-MVSUYZDT.js → chunk-GWV7DI3S.js} +4 -4
- package/chunks/{chunk-A5L3JMUA.js → chunk-HC45LTEN.js} +18 -4
- package/chunks/{chunk-PC6JANNU.js → chunk-HKRVXYDN.js} +4 -4
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-4WIZGAH3.js → chunk-I5BT7ADR.js} +6 -58
- package/chunks/{chunk-GSN55ZRI.js → chunk-ID3O7PRB.js} +19 -7
- package/chunks/{chunk-L5UHQJTJ.js → chunk-IGTHU3T4.js} +1 -1
- package/chunks/{chunk-BIQWWWJN.js → chunk-IIUGIWWY.js} +1 -1
- package/chunks/{chunk-RWTEFFPU.js → chunk-JCJ7LKNA.js} +6140 -5616
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-PWTZEM3C.js → chunk-JXVC2PL3.js} +3 -37
- package/chunks/chunk-JYBU6YUE.js +378 -0
- package/chunks/{chunk-RF3EXIHJ.js → chunk-K3PFMM5U.js} +49 -26
- package/chunks/{chunk-JCW2R7WC.js → chunk-K623ENWT.js} +3 -79
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/chunk-KWHKHSIS.js +81 -0
- package/chunks/{chunk-DHHOYAPR.js → chunk-L2E5GFAG.js} +7 -7
- package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
- package/chunks/{chunk-E5TUC6CA.js → chunk-LHKCY7DY.js} +3 -3
- package/chunks/{chunk-NH6KE4JX.js → chunk-LOY7RWQG.js} +3 -3
- package/chunks/{chunk-U7M2DMGW.js → chunk-M4MSAE7U.js} +130 -5
- package/chunks/{chunk-IJTOWOD7.js → chunk-MB32MS4U.js} +92 -9
- package/chunks/{chunk-PR75REBZ.js → chunk-MM7TH7ZM.js} +12 -82
- package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
- package/chunks/{chunk-M5JM7OSF.js → chunk-N4ACHWNH.js} +2 -3
- package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
- package/chunks/{chunk-J56UI34H.js → chunk-NBD76HUW.js} +4 -2
- package/chunks/{chunk-2SCDWPXI.js → chunk-NC4U4I3Y.js} +5 -5
- package/chunks/{chunk-H4SBPHSA.js → chunk-NNL7WPPK.js} +3 -3
- package/chunks/{chunk-YBL3QUDD.js → chunk-NQCXWP5D.js} +1 -1
- package/chunks/{chunk-CIKQ7KKO.js → chunk-NVFSGPIF.js} +954 -444
- package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
- package/chunks/chunk-O6GEWCJA.js +21 -0
- package/chunks/chunk-OCPBI7J5.js +18 -0
- package/chunks/{chunk-KIM5GUMA.js → chunk-OE6F6ZWQ.js} +589 -220
- package/chunks/{chunk-SQCQ4KO2.js → chunk-P5DEY3NF.js} +380 -317
- package/chunks/{chunk-2JZBVYTU.js → chunk-Q3T5KA2V.js} +1 -8
- package/chunks/{chunk-MB4MZHMJ.js → chunk-QARJNL2V.js} +211 -522
- package/chunks/{chunk-YH6G52F2.js → chunk-QCXGC7QB.js} +4 -4
- package/chunks/chunk-QDK4F2N5.js +1252 -0
- package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
- package/chunks/{chunk-VULLI6WQ.js → chunk-QIERF2GQ.js} +6 -6
- package/chunks/{chunk-TGILQ3YH.js → chunk-QQTJK5GB.js} +200 -77
- package/chunks/{chunk-H5FFA6TH.js → chunk-QTHQ6Z5X.js} +16 -3
- package/chunks/{chunk-5I2IWRSH.js → chunk-R2XWGR75.js} +2 -2
- package/chunks/{chunk-YPE6A4GC.js → chunk-RT7FNC2O.js} +2 -2
- package/chunks/{chunk-OFDOK3VM.js → chunk-RX7NJOPE.js} +8 -13
- package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
- package/chunks/{chunk-K4XWPEWB.js → chunk-SHN4KHDK.js} +4 -33
- package/chunks/{chunk-VYPFXUCB.js → chunk-SZ3KHTDR.js} +1 -1
- package/chunks/chunk-T26EAKDL.js +13 -0
- package/chunks/chunk-T3CHYWJZ.js +758 -0
- package/chunks/{chunk-FNQ6T3CV.js → chunk-TEGJSJDF.js} +10 -7
- package/chunks/{chunk-RZIX2G32.js → chunk-THPORXSI.js} +1 -1
- package/chunks/{chunk-OHNBB4XR.js → chunk-THVU3RNH.js} +1 -1
- package/chunks/{record-artifact-RQKFYO5B.js → chunk-TIRRPCFS.js} +22 -7
- package/chunks/{chunk-ETSW4KLJ.js → chunk-TUCOXPHJ.js} +2 -2
- package/chunks/{chunk-63P4EL5V.js → chunk-TZTAV5RH.js} +1 -1
- package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
- package/chunks/{chunk-3RN6GBKS.js → chunk-U5CODIJW.js} +1 -1
- package/chunks/chunk-UU2B5YG6.js +2196 -0
- package/chunks/{chunk-R5AFZNQW.js → chunk-VAVHTGU4.js} +15 -8
- package/chunks/{chunk-2NH6DYI4.js → chunk-VHPFWR2O.js} +12 -12
- package/chunks/{chunk-IKYJHJNF.js → chunk-VOMQ2P6B.js} +3 -3
- package/chunks/{chunk-ZFDTEDCF.js → chunk-VX22DUW2.js} +6 -6
- package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
- package/chunks/{chunk-M4FMGVY4.js → chunk-WQP7BKWA.js} +3 -3
- package/chunks/{chunk-LH2BYDQ5.js → chunk-X2E5TFJ5.js} +18 -12
- package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
- package/chunks/{chunk-YX324OPW.js → chunk-XDS22O52.js} +1 -1
- package/chunks/chunk-XP4L6KS3.js +463 -0
- package/chunks/{chunk-6FGBXPWM.js → chunk-XQK4XXTN.js} +38 -44
- package/chunks/{chunk-55DJUCI2.js → chunk-XWYPFDB5.js} +53 -43
- package/chunks/{chunk-Y34KJKDC.js → chunk-Y7BVNVVW.js} +1 -1
- package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
- package/chunks/{chunk-HIJQF5B5.js → chunk-YGE3IXJP.js} +1 -1
- package/chunks/{chunk-LQIW3YFY.js → chunk-YJFPRUWX.js} +9 -7
- package/chunks/{chunk-J24WCGIN.js → chunk-YQIIG4NA.js} +4 -4
- package/chunks/{chunk-BJX6ZSUK.js → chunk-YUFIEIWC.js} +2 -2
- package/chunks/{chunk-NIBLUX3Y.js → chunk-Z3S5EMOW.js} +148 -21
- package/chunks/{chunk-WCXCRJYB.js → chunk-Z3YLHKB7.js} +1 -1
- package/chunks/chunk-Z4X5MTRT.js +133 -0
- package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
- package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
- package/chunks/{chunk-X5XDDSSH.js → chunk-ZPZ7ZJEE.js} +28 -5
- package/chunks/{computer-use-SOQ4E3VX.js → computer-use-GOM42LNK.js} +53 -50
- package/chunks/{config-utils-7V7GGIW6.js → config-utils-WADIDWGG.js} +4 -3
- package/chunks/contextCommand-6LVPTIWD.js +83 -0
- package/chunks/core-runtime-253XV2DB.js +137 -0
- package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-45POYEVP.js} +50 -47
- package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-62YZWVAY.js} +3 -3
- package/chunks/{cron-create-YIID5XAW.js → cron-create-6E7GIQTG.js} +6 -6
- package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-JD26XY3W.js} +5 -5
- package/chunks/{cron-list-XEGS463Q.js → cron-list-CUWFB44G.js} +6 -6
- package/chunks/{daemon-YO6433NF.js → daemon-PCNCI5YU.js} +428 -18
- package/chunks/daemon-status-provider-AKALDYJJ.js +93 -0
- package/chunks/daemon-trust-policy-XB7ZSQFQ.js +88 -0
- package/chunks/daemon-trust-policy-monitor-FUTKP42Q.js +175 -0
- package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
- package/chunks/deferred-core-runtime-RKLCO7V5.js +92 -0
- package/chunks/dist-26BIMQT6.js +4487 -0
- package/chunks/{dist-F6IBUDR4.js → dist-2PERFI23.js} +12 -9
- package/chunks/{dist-46NQKLTW.js → dist-OAOC5OV4.js} +2 -2
- package/chunks/{dist-YFNEUWSE.js → dist-PVEAFLHY.js} +5 -4
- package/chunks/{dist-AIKFMUKK.js → dist-SL2LUMML.js} +1449 -14
- package/chunks/dist-ULIG4M5H.js +13415 -0
- package/chunks/{dist-WEAHOXDM.js → dist-WGMNT3JQ.js} +2 -1
- package/chunks/{dist-BBLXMS3N.js → dist-ZHXOBXDN.js} +3 -3
- package/chunks/earlyInputCapture-FCWU47OB.js +85 -0
- package/chunks/{edit-OBDSQURM.js → edit-TTACM3LN.js} +51 -48
- package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
- package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-R34GFDX6.js} +51 -48
- package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-KJPBB6G5.js} +51 -48
- package/chunks/environment-IJG3N2PR.js +105 -0
- package/chunks/errors-MRON5OJD.js +91 -0
- package/chunks/esm-K5FARBNI.js +5548 -0
- package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-UBA66Y4I.js} +51 -48
- package/chunks/exitPlanMode-SMSPGNSK.js +76 -0
- package/chunks/{fast-path-JJZFJANL.js → fast-path-ZBAMZDCP.js} +16 -6
- package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
- package/chunks/{gemini-QS36EBZV.js → gemini-XFT7HRNL.js} +106 -99
- package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-XD3MLYQX.js} +40 -11
- package/chunks/{getMachineId-bsd-V7W3GODC.js → getMachineId-bsd-FG7IUY6U.js} +1 -1
- package/chunks/{getMachineId-darwin-TDO75DQP.js → getMachineId-darwin-GLCJI2RA.js} +1 -1
- package/chunks/{getMachineId-linux-TF43WQT2.js → getMachineId-linux-O6OPPAKO.js} +1 -1
- package/chunks/{getMachineId-unsupported-ZGUO3TXT.js → getMachineId-unsupported-S6CKYVGC.js} +1 -1
- package/chunks/{getMachineId-win-ECFYZZFQ.js → getMachineId-win-X5SRNEH7.js} +1 -1
- package/chunks/{glob-V7R3PSK3.js → glob-HFKY7HXZ.js} +51 -48
- package/chunks/goal-tools-HGO6VXPB.js +335 -0
- package/chunks/{grep-QYPSK7OP.js → grep-EO5Z3PFV.js} +53 -49
- package/chunks/handleAutoUpdate-WRENFE6C.js +84 -0
- package/chunks/i18n-ZG5OTVSV.js +100 -0
- package/chunks/{image-gen-Z3VPGKRC.js → image-gen-CKWZ4MJI.js} +12 -12
- package/chunks/initializer-FYPLLRC7.js +89 -0
- package/chunks/installationInfo-5RV4HRMC.js +83 -0
- package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
- package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-IKO4G53C.js} +3 -3
- package/chunks/lib-RUF3WZA6.js +9 -0
- package/chunks/list-ZNWVL3AT.js +92 -0
- package/chunks/{list-agents-5KJJHR6I.js → list-agents-PXJ7ZUFB.js} +3 -3
- package/chunks/loadedSettingsAdapter-GQGNHP5I.js +86 -0
- package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-MS5DFAWH.js} +78 -113
- package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-Y26NQZ5I.js} +15 -8
- package/chunks/{ls-NTK6VOQJ.js → ls-ONQTTMQR.js} +5 -5
- package/chunks/{lsp-2JI24STP.js → lsp-YGHHRGMD.js} +3 -3
- package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-67AK4GTL.js} +51 -48
- package/chunks/mcp-FVQ4VTLM.js +86 -0
- package/chunks/{monitor-R3ODH5U6.js → monitor-BXB33EOZ.js} +51 -48
- package/chunks/nonInteractiveCli-CN2GYSN3.js +148 -0
- package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-FKYRBV4L.js} +51 -48
- package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-UUXV5DGU.js} +26 -27
- package/chunks/pidfile-MV347TTZ.js +89 -0
- package/chunks/process-registry-2CHQBXH5.js +157 -0
- package/chunks/{processUtils-RT7UNCC2.js → processUtils-LKFG52RV.js} +2 -2
- package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
- package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-3WYI2HRW.js} +56 -53
- package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-B46MW45O.js} +10 -10
- package/chunks/read-file-ACSHVWP3.js +29 -0
- package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-U2IJN5HM.js} +4 -4
- package/chunks/record-artifact-MGPJ7EG4.js +21 -0
- package/chunks/resumeHistoryUtils-AMS4767B.js +94 -0
- package/chunks/ripGrep-BAPM2UKC.js +76 -0
- package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
- package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-JEN6FO2A.js} +1018 -263
- package/chunks/runtime-WVP22ISH.js +122 -0
- package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-HTX5ACVR.js} +50 -47
- package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
- package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-4BQANSJ6.js} +7 -7
- package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-Z4VXWVFX.js} +14 -14
- package/chunks/{send-message-Q6OOR6BR.js → send-message-PMP4ATVM.js} +8 -13
- package/chunks/serve-ELQIVNWN.js +92 -0
- package/chunks/{server-4UMH7OIZ.js → server-JNW2NOSQ.js} +5288 -1364
- package/chunks/{session-K3O3Q2SV.js → session-NC356XNS.js} +102 -95
- package/chunks/{settings-CR2EWTBA.js → settings-73RMIOJ6.js} +54 -51
- package/chunks/shell-NMHF5TFG.js +86 -0
- package/chunks/{skill-I3SDA4MB.js → skill-XPGXHEKO.js} +22 -22
- package/chunks/skill-settings-5IGIJDGA.js +94 -0
- package/chunks/spawnChannel-T5THBHFN.js +85 -0
- package/chunks/standalone-update-ODXEPDLP.js +95 -0
- package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-S27DXVAE.js} +1241 -905
- package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-D7E6ZFKR.js} +4 -4
- package/chunks/task-create-NFCYD43L.js +26 -0
- package/chunks/{task-list-FOPULZEP.js → task-list-TAVMGEVD.js} +7 -7
- package/chunks/{task-stop-H6RHXFVQ.js → task-stop-ZDF2UJRM.js} +3 -3
- package/chunks/{task-update-M57TFZJT.js → task-update-6L7LHGEX.js} +12 -11
- package/chunks/{team-create-YJALH5D2.js → team-create-CTLQWTJ2.js} +53 -50
- package/chunks/{team-delete-QE2UXJL7.js → team-delete-DPGGRQBU.js} +7 -7
- package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-WKRUAPJ4.js} +51 -48
- package/chunks/theme-manager-XQHXQQX6.js +80 -0
- package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-2UO5G6G6.js} +34 -6
- package/chunks/{tool-search-NF7GB6LE.js → tool-search-45YINAJA.js} +21 -22
- package/chunks/total-session-admission-QPUKGHKO.js +88 -0
- package/chunks/trustedFolders-YMUTRHEQ.js +98 -0
- package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-PZUXTVHC.js} +5 -5
- package/chunks/updateCheck-IZAN4XTB.js +95 -0
- package/chunks/useAutoAcceptIndicator-CGL2MAYE.js +96 -0
- package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-GBGNJ65K.js} +97 -90
- package/chunks/{version-HS7YSFHV.js → version-Z7EX24NZ.js} +1 -1
- package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-ETTT2H3V.js} +19 -21
- package/chunks/{web-search-S62WAP4S.js → web-search-Y3ZSVRJ6.js} +13 -13
- package/chunks/{workflow-QAGU5RU4.js → workflow-ATRJSAO7.js} +52 -49
- package/chunks/workspace-providers-status-YM3WLW3N.js +89 -0
- package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-4EGNCIPG.js} +1 -1
- package/chunks/workspace-registry-NGZOZKQP.js +96 -0
- package/chunks/workspace-service-SVWOXX2B.js +103 -0
- package/chunks/workspace-skills-status-YZHZ3PT5.js +89 -0
- package/chunks/workspace-trust-reconciler-GGBQV2U5.js +349 -0
- package/chunks/write-file-HLGCEB72.js +78 -0
- package/chunks/xterm-headless-NTYVIBT3.js +3475 -0
- package/chunks/{zh-LUIGBD55.js → zh-H3YDK5QW.js} +9 -1
- package/chunks/{zh-TW-F5KG2IYD.js → zh-TW-JYCP7XUA.js} +9 -1
- package/chunks/zoom-image-LDECT475.js +224 -0
- package/cli.js +50 -16
- package/locales/ca.js +7 -2
- package/locales/de.js +7 -2
- package/locales/en.js +10 -2
- package/locales/fr.js +7 -2
- package/locales/ja.js +7 -2
- package/locales/pt.js +7 -2
- package/locales/ru.js +7 -2
- package/locales/zh-TW.js +10 -2
- package/locales/zh.js +10 -2
- package/package.json +5 -4
- package/web-shell/assets/{arc-DcbWnB9T.js → arc-Dpy_U6Bb.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-DgDOg-c5.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-tADd9Ja3.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-68wj9MCU.js} +1 -1
- package/web-shell/assets/channel-Do7fFnFl.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-DjJLOeVU.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-CMbzGeVC.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-SlKgejv9.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-CijXssHZ.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-D8w25nvR.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-Bv9dcx_e.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-Bzf6sAOd.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-whNoNeW5.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-By_XOP3X.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-By_XOP3X.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-rpQS44Lz.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-Ck7VE6nT.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-CgRrsodR.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-CsTZtE5A.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-D5EAdVq4.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-DNrjHC7Z.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-ClJSJGgC.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-DuVnos_y.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-DEpIVl1s.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-COnQM2-C.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-C-lX5H3_.js} +1 -1
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/{index-D0GX0zZf.js → index-DfcyS2E7.js} +1 -1
- package/web-shell/assets/index-Qxt6kN7i.js +1700 -0
- package/web-shell/assets/index-bo0Z8hfu.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-D0WP-wmU.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-DgsI3Clu.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-4yCoMZO6.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-D_05au1N.js} +1 -1
- package/web-shell/assets/{linear-BkoihsaA.js → linear-B38fDz0Q.js} +1 -1
- package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-aGNwTaHi.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-C2yf_5WM.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-DiHABBT-.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-W9xkeAGe.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-BGmRXl9k.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-CvOmT43_.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-C8pdd0Z-.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-C-CYdFx2.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BieEHeN9.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-w2KQn1cI.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-DuorhRku.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-BAXm2cWy.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-8PHaOXn5.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-Do84JFSc.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/MaxSizedBox-5DPPWPGT.js +0 -85
- package/chunks/agent-6ODUANDO.js +0 -81
- package/chunks/agent-headless-7BYQTMHW.js +0 -75
- package/chunks/bridge-ZUB64FAE.js +0 -90
- package/chunks/chunk-LEH5C7FV.js +0 -232
- package/chunks/chunk-SZRN75WQ.js +0 -29
- package/chunks/chunk-UGYMA4EI.js +0 -219
- package/chunks/chunk-Z2BC6UJ5.js +0 -8575
- package/chunks/contextCommand-JLHYA34Z.js +0 -80
- package/chunks/daemon-status-provider-2233Q37D.js +0 -89
- package/chunks/earlyInputCapture-A7NDU3PF.js +0 -82
- package/chunks/environment-W5UFC2CH.js +0 -102
- package/chunks/errors-M7CLORXH.js +0 -88
- package/chunks/exitPlanMode-GXTBWQAR.js +0 -403
- package/chunks/handleAutoUpdate-6DBEZYPV.js +0 -81
- package/chunks/i18n-VUJJZIMU.js +0 -97
- package/chunks/initializer-UWAK5U5O.js +0 -86
- package/chunks/installationInfo-6O2YAA52.js +0 -80
- package/chunks/list-GB4ESM3T.js +0 -89
- package/chunks/loadedSettingsAdapter-OT6JVQ7U.js +0 -83
- package/chunks/mcp-6DBDJPFU.js +0 -83
- package/chunks/nonInteractiveCli-MOYCYBBU.js +0 -141
- package/chunks/pidfile-TFRZZZIO.js +0 -86
- package/chunks/read-file-APMO3PSX.js +0 -31
- package/chunks/resumeHistoryUtils-6KRYEAWZ.js +0 -91
- package/chunks/ripGrep-BEJDEDXW.js +0 -73
- package/chunks/runtime-XXRRTNP6.js +0 -118
- package/chunks/serve-7BSTXJ4T.js +0 -89
- package/chunks/shell-HH3PF3A2.js +0 -83
- package/chunks/spawnChannel-RWNDBXGA.js +0 -82
- package/chunks/src-GE4TTTML.js +0 -3147
- package/chunks/standalone-update-Q6WFRZZQ.js +0 -92
- package/chunks/task-create-N7WQSGYA.js +0 -25
- package/chunks/theme-manager-SWRILQHI.js +0 -77
- package/chunks/total-session-admission-DLHHHLD3.js +0 -84
- package/chunks/trustedFolders-KHXHY6PY.js +0 -93
- package/chunks/updateCheck-RKL6M5XN.js +0 -92
- package/chunks/useAutoAcceptIndicator-CFQ5BUJL.js +0 -93
- package/chunks/workspace-providers-status-QSVZUETE.js +0 -86
- package/chunks/workspace-registry-UT4RBNBM.js +0 -88
- package/chunks/workspace-service-JFWRUS4V.js +0 -98
- package/chunks/workspace-skills-status-ZBBKJOI2.js +0 -85
- package/chunks/write-file-VHIXW5M7.js +0 -73
- package/web-shell/assets/channel-Cq7YKtfC.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/index-D9haPt0X.css +0 -5
- package/web-shell/assets/index-ckX9Pq5k.js +0 -1230
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-B7W4zlCr.js +0 -1
- package/chunks/{chunk-TARRHLLG.js → chunk-QUGAUQGJ.js} +25 -25
- package/chunks/{chunk-U7ZFW55U.js → chunk-VOQXFAY5.js} +977 -977
- /package/chunks/{chunk-LXXMOYPL.js → chunk-VXZBKKQR.js} +0 -0
|
@@ -7,6 +7,42 @@ import {
|
|
|
7
7
|
logEventSizingFailed,
|
|
8
8
|
serializedBridgeEventByteLength
|
|
9
9
|
} from "./chunk-GLWP3FDB.js";
|
|
10
|
+
import {
|
|
11
|
+
normalizeCompactedReplayMaxBytes,
|
|
12
|
+
normalizeMaxJournalBytes,
|
|
13
|
+
normalizeMaxJournalEvents
|
|
14
|
+
} from "./chunk-XCGIMOLN.js";
|
|
15
|
+
import {
|
|
16
|
+
MCP_RESTART_SERVER_DEADLINE_MS
|
|
17
|
+
} from "./chunk-OCPBI7J5.js";
|
|
18
|
+
import {
|
|
19
|
+
defaultSpawnChannelFactory
|
|
20
|
+
} from "./chunk-2OQUICDM.js";
|
|
21
|
+
import {
|
|
22
|
+
BridgeChannelClosedError,
|
|
23
|
+
BridgeTimeoutError,
|
|
24
|
+
SERVE_CONTROL_EXT_METHODS,
|
|
25
|
+
SERVE_STATUS_EXT_METHODS,
|
|
26
|
+
STATUS_SCHEMA_VERSION,
|
|
27
|
+
createIdleWorkspaceExtensionsStatus,
|
|
28
|
+
createIdleWorkspaceHooksStatus
|
|
29
|
+
} from "./chunk-A5UODYG3.js";
|
|
30
|
+
import {
|
|
31
|
+
CHANNEL_STARTUP_PROFILE_META_KEY,
|
|
32
|
+
CHANNEL_STARTUP_PROFILE_VERSION,
|
|
33
|
+
DAEMON_CHANNEL_DELIVERY_META_KEY,
|
|
34
|
+
LOAD_REPLAY_BULK_MODE,
|
|
35
|
+
LOAD_REPLAY_HIDE_INHERITED_META_KEY,
|
|
36
|
+
LOAD_REPLAY_META_KEY,
|
|
37
|
+
LOAD_REPLAY_MODE_META_KEY,
|
|
38
|
+
LOAD_REPLAY_PAGE_SIZE_META_KEY,
|
|
39
|
+
LOAD_REPLAY_VERSION,
|
|
40
|
+
MID_TURN_QUEUE_DRAIN_METHOD,
|
|
41
|
+
PROMPT_CANCEL_METHOD,
|
|
42
|
+
TODO_STOP_GUARD_CONTINUATION_CLAIM_METHOD,
|
|
43
|
+
TODO_STOP_GUARD_QUEUE_RELEASE_METHOD,
|
|
44
|
+
WORKTREE_MCP_DEFER_META_KEY
|
|
45
|
+
} from "./chunk-CPZAH673.js";
|
|
10
46
|
import {
|
|
11
47
|
BranchWhilePromptActiveError,
|
|
12
48
|
CancelSentinelCollisionError,
|
|
@@ -16,7 +52,6 @@ import {
|
|
|
16
52
|
InvalidRewindTargetError,
|
|
17
53
|
InvalidSessionMetadataError,
|
|
18
54
|
InvalidSessionScopeError,
|
|
19
|
-
MCP_RESTART_SERVER_DEADLINE_MS,
|
|
20
55
|
PermissionForbiddenError,
|
|
21
56
|
PromptDeadlineExceededError,
|
|
22
57
|
PromptQueueFullError,
|
|
@@ -28,35 +63,7 @@ import {
|
|
|
28
63
|
SessionShellDisabledError,
|
|
29
64
|
WorkspaceMismatchError,
|
|
30
65
|
isNotCurrentlyGeneratingCancelError
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import {
|
|
33
|
-
normalizeCompactedReplayMaxBytes
|
|
34
|
-
} from "./chunk-COH43MRJ.js";
|
|
35
|
-
import {
|
|
36
|
-
CHANNEL_STARTUP_PROFILE_META_KEY,
|
|
37
|
-
CHANNEL_STARTUP_PROFILE_VERSION,
|
|
38
|
-
DAEMON_CHANNEL_DELIVERY_META_KEY,
|
|
39
|
-
LOAD_REPLAY_BULK_MODE,
|
|
40
|
-
LOAD_REPLAY_META_KEY,
|
|
41
|
-
LOAD_REPLAY_MODE_META_KEY,
|
|
42
|
-
LOAD_REPLAY_PAGE_SIZE_META_KEY,
|
|
43
|
-
LOAD_REPLAY_VERSION,
|
|
44
|
-
MID_TURN_QUEUE_DRAIN_METHOD,
|
|
45
|
-
PROMPT_CANCEL_METHOD,
|
|
46
|
-
TODO_STOP_GUARD_QUEUE_RELEASE_METHOD
|
|
47
|
-
} from "./chunk-3SJ43L4W.js";
|
|
48
|
-
import {
|
|
49
|
-
defaultSpawnChannelFactory
|
|
50
|
-
} from "./chunk-7JURR4JT.js";
|
|
51
|
-
import {
|
|
52
|
-
BridgeChannelClosedError,
|
|
53
|
-
BridgeTimeoutError,
|
|
54
|
-
SERVE_CONTROL_EXT_METHODS,
|
|
55
|
-
SERVE_STATUS_EXT_METHODS,
|
|
56
|
-
STATUS_SCHEMA_VERSION,
|
|
57
|
-
createIdleWorkspaceExtensionsStatus,
|
|
58
|
-
createIdleWorkspaceHooksStatus
|
|
59
|
-
} from "./chunk-VIA5XA4U.js";
|
|
66
|
+
} from "./chunk-B4AJNNOL.js";
|
|
60
67
|
import {
|
|
61
68
|
canonicalizeWorkspace,
|
|
62
69
|
translateAndCheckAbsoluteWorkspacePath
|
|
@@ -82,16 +89,16 @@ import {
|
|
|
82
89
|
metadataBudgetBytes,
|
|
83
90
|
normalizeSnapshotPayload,
|
|
84
91
|
stableSessionArtifactId
|
|
85
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-FRXG4ARO.js";
|
|
86
93
|
import {
|
|
87
94
|
DAEMON_TRACEPARENT_META_KEY,
|
|
88
95
|
DAEMON_TRACESTATE_META_KEY
|
|
89
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-Z3S5EMOW.js";
|
|
90
97
|
import {
|
|
91
98
|
INVOCATION_CONTEXT_META_KEY,
|
|
92
99
|
PRIVATE_ACP_CAPABILITY_ENV,
|
|
93
100
|
PRIVATE_PARENT_CAPABILITY_META_KEY
|
|
94
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-NVFSGPIF.js";
|
|
95
102
|
import {
|
|
96
103
|
init_esbuild_shims
|
|
97
104
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -136,16 +143,14 @@ function replayRecordId(event) {
|
|
|
136
143
|
return typeof recordId === "string" ? recordId : void 0;
|
|
137
144
|
}
|
|
138
145
|
__name(replayRecordId, "replayRecordId");
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (!Number.isSafeInteger(value) || value < 1) {
|
|
144
|
-
throw new TypeError(`${name} must be a positive safe integer`);
|
|
146
|
+
function lastRecordIdIn(events) {
|
|
147
|
+
for (let i = events.length - 1; i >= 0; i--) {
|
|
148
|
+
const id = replayRecordId(events[i]);
|
|
149
|
+
if (id !== void 0) return id;
|
|
145
150
|
}
|
|
146
|
-
return
|
|
151
|
+
return void 0;
|
|
147
152
|
}
|
|
148
|
-
__name(
|
|
153
|
+
__name(lastRecordIdIn, "lastRecordIdIn");
|
|
149
154
|
var TurnBoundaryCompactionEngine = class {
|
|
150
155
|
static {
|
|
151
156
|
__name(this, "TurnBoundaryCompactionEngine");
|
|
@@ -166,6 +171,24 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
166
171
|
closed = false;
|
|
167
172
|
truncatedEvents = 0;
|
|
168
173
|
truncatedTurns = 0;
|
|
174
|
+
// Most recent `qwen.session.recordId` observed on an ingested or seeded
|
|
175
|
+
// `session_update`. Surfaced on the `history_truncated` marker emitted by
|
|
176
|
+
// `snapshot()` so clients that lost every turn-boundary event from their
|
|
177
|
+
// retained window (e.g. a live-journal truncation during a single long
|
|
178
|
+
// in-flight turn) still have an anchor for `beforeRecordId` transcript
|
|
179
|
+
// pagination. Undefined until at least one recordId has been observed;
|
|
180
|
+
// omitted from the marker in that case.
|
|
181
|
+
activeRecordId;
|
|
182
|
+
// Pagination anchor for the replay-path `history_truncated` marker,
|
|
183
|
+
// frozen at the first replay-window eviction. Prefers the first
|
|
184
|
+
// retained recordId (the eviction boundary, so `beforeRecordId`
|
|
185
|
+
// fetches exactly the dropped records with no overlap); falls back to
|
|
186
|
+
// the last dropped recordId when the retained window carries no
|
|
187
|
+
// recordId. Deliberately NOT `activeRecordId` — that one is advanced
|
|
188
|
+
// by `ingest()` on every turn boundary and, when a retained segment
|
|
189
|
+
// carries the last seed recordId, would place the anchor inside the
|
|
190
|
+
// retained window and re-fetch records the client already displays.
|
|
191
|
+
replayAnchorRecordId;
|
|
169
192
|
slots = [];
|
|
170
193
|
toolSlotIndex = /* @__PURE__ */ new Map();
|
|
171
194
|
textSlotIndex = {
|
|
@@ -174,16 +197,8 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
174
197
|
};
|
|
175
198
|
constructor(opts = {}) {
|
|
176
199
|
this.maxReplayBytes = normalizeCompactedReplayMaxBytes(opts.maxReplayBytes);
|
|
177
|
-
this.maxJournalEvents =
|
|
178
|
-
|
|
179
|
-
DEFAULT_MAX_JOURNAL_EVENTS,
|
|
180
|
-
"maxJournalEvents"
|
|
181
|
-
);
|
|
182
|
-
this.maxJournalBytes = normalizeJournalCap(
|
|
183
|
-
opts.maxJournalBytes,
|
|
184
|
-
DEFAULT_MAX_JOURNAL_BYTES,
|
|
185
|
-
"maxJournalBytes"
|
|
186
|
-
);
|
|
200
|
+
this.maxJournalEvents = normalizeMaxJournalEvents(opts.maxJournalEvents);
|
|
201
|
+
this.maxJournalBytes = normalizeMaxJournalBytes(opts.maxJournalBytes);
|
|
187
202
|
this.onReplayWindowEviction = opts.onReplayWindowEviction;
|
|
188
203
|
}
|
|
189
204
|
ingest(event, byteLength) {
|
|
@@ -192,6 +207,10 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
192
207
|
this.lastEventId = event.id;
|
|
193
208
|
}
|
|
194
209
|
if (TRANSIENT_TYPES.has(event.type)) return;
|
|
210
|
+
const seenRecordId = replayRecordId(event);
|
|
211
|
+
if (seenRecordId !== void 0) {
|
|
212
|
+
this.activeRecordId = seenRecordId;
|
|
213
|
+
}
|
|
195
214
|
this.liveJournal.push(event);
|
|
196
215
|
const bytes = byteLength ?? serializedBridgeEventByteLength(event) ?? 0;
|
|
197
216
|
this.journalEntryBytes.push(bytes);
|
|
@@ -230,6 +249,8 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
230
249
|
retainedEvents: this.liveJournal.length,
|
|
231
250
|
maxBytes: this.maxJournalBytes,
|
|
232
251
|
maxEvents: this.maxJournalEvents,
|
|
252
|
+
// Pagination anchor — see makeHistoryTruncatedEvent.
|
|
253
|
+
...this.activeRecordId !== void 0 ? { recordId: this.activeRecordId } : {},
|
|
233
254
|
fullTranscriptAvailable: true
|
|
234
255
|
}
|
|
235
256
|
});
|
|
@@ -244,6 +265,8 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
244
265
|
if (this.closed) return;
|
|
245
266
|
this.resetReplayWindow();
|
|
246
267
|
this.lastEventId = snapshot.lastEventId;
|
|
268
|
+
this.activeRecordId = void 0;
|
|
269
|
+
this.activeRecordId = lastRecordIdIn(snapshot.compactedTurns);
|
|
247
270
|
for (const event of snapshot.compactedTurns) {
|
|
248
271
|
if (TRANSIENT_TYPES.has(event.type)) continue;
|
|
249
272
|
this.addReplaySegment([event], 0);
|
|
@@ -256,6 +279,8 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
256
279
|
seedReplayEvents(events) {
|
|
257
280
|
if (this.closed) return;
|
|
258
281
|
this.resetReplayWindow();
|
|
282
|
+
this.activeRecordId = void 0;
|
|
283
|
+
this.activeRecordId = lastRecordIdIn(events);
|
|
259
284
|
let recordEvents = [];
|
|
260
285
|
let recordId;
|
|
261
286
|
const flushRecord = /* @__PURE__ */ __name(() => {
|
|
@@ -289,6 +314,7 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
289
314
|
this.closed = true;
|
|
290
315
|
this.resetReplayWindow();
|
|
291
316
|
this.resetJournal();
|
|
317
|
+
this.activeRecordId = void 0;
|
|
292
318
|
this.slots = [];
|
|
293
319
|
this.toolSlotIndex.clear();
|
|
294
320
|
this.clearTextSlotIndex();
|
|
@@ -487,6 +513,7 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
487
513
|
let droppedBytes = 0;
|
|
488
514
|
let droppedEvents = 0;
|
|
489
515
|
let droppedTurns = 0;
|
|
516
|
+
let lastDroppedRecordId;
|
|
490
517
|
while (this.replayBytes > this.maxReplayBytes && this.activeReplaySegmentCount() > 1) {
|
|
491
518
|
const dropped = this.replaySegments[this.replaySegmentStart];
|
|
492
519
|
this.replaySegmentStart += 1;
|
|
@@ -497,8 +524,13 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
497
524
|
this.replayBytes -= dropped.bytes;
|
|
498
525
|
this.truncatedEvents += dropped.events.length;
|
|
499
526
|
this.truncatedTurns += dropped.turnCount;
|
|
527
|
+
const droppedRecordId = lastRecordIdIn(dropped.events);
|
|
528
|
+
if (droppedRecordId !== void 0) {
|
|
529
|
+
lastDroppedRecordId = droppedRecordId;
|
|
530
|
+
}
|
|
500
531
|
}
|
|
501
532
|
if (droppedSegmentCount > 0) {
|
|
533
|
+
this.replayAnchorRecordId ??= this.firstRetainedReplayRecordId() ?? lastDroppedRecordId;
|
|
502
534
|
this.compactReplaySegmentQueueIfNeeded();
|
|
503
535
|
this.notifyReplayWindowEviction({
|
|
504
536
|
droppedBytes,
|
|
@@ -511,6 +543,13 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
511
543
|
});
|
|
512
544
|
}
|
|
513
545
|
}
|
|
546
|
+
firstRetainedReplayRecordId() {
|
|
547
|
+
for (let i = this.replaySegmentStart; i < this.replaySegments.length; i++) {
|
|
548
|
+
const recordId = lastRecordIdIn(this.replaySegments[i].events);
|
|
549
|
+
if (recordId !== void 0) return recordId;
|
|
550
|
+
}
|
|
551
|
+
return void 0;
|
|
552
|
+
}
|
|
514
553
|
flattenReplaySegments() {
|
|
515
554
|
return this.replaySegments.slice(this.replaySegmentStart).flatMap((segment) => segment.events);
|
|
516
555
|
}
|
|
@@ -538,6 +577,15 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
538
577
|
retainedEvents,
|
|
539
578
|
maxBytes: this.maxReplayBytes,
|
|
540
579
|
...this.truncatedTurns > 0 ? { truncatedTurns: this.truncatedTurns } : {},
|
|
580
|
+
// Pagination anchor for clients whose retained window lost every
|
|
581
|
+
// turn-boundary event (e.g. live-journal truncation during one
|
|
582
|
+
// long in-flight turn). Uses the eviction-time anchor, not
|
|
583
|
+
// `activeRecordId`, so a post-seed `ingest()` can't push it past
|
|
584
|
+
// records the client already displays. Undefined when no recordId
|
|
585
|
+
// was observed before the first eviction — the field is
|
|
586
|
+
// intentionally omitted in that case so old clients continue to
|
|
587
|
+
// validate the marker shape.
|
|
588
|
+
...this.replayAnchorRecordId !== void 0 ? { recordId: this.replayAnchorRecordId } : {},
|
|
541
589
|
fullTranscriptAvailable: true
|
|
542
590
|
}
|
|
543
591
|
};
|
|
@@ -548,6 +596,7 @@ var TurnBoundaryCompactionEngine = class {
|
|
|
548
596
|
this.replayBytes = 0;
|
|
549
597
|
this.truncatedEvents = 0;
|
|
550
598
|
this.truncatedTurns = 0;
|
|
599
|
+
this.replayAnchorRecordId = void 0;
|
|
551
600
|
}
|
|
552
601
|
clearTextSlotIndex() {
|
|
553
602
|
this.textSlotIndex.text.clear();
|
|
@@ -693,6 +742,7 @@ __name(mergeTranscriptUpdateMeta, "mergeTranscriptUpdateMeta");
|
|
|
693
742
|
|
|
694
743
|
// packages/acp-bridge/src/session-source.ts
|
|
695
744
|
init_esbuild_shims();
|
|
745
|
+
var SESSION_SOURCE_META_KEY = "qwen.session.source";
|
|
696
746
|
var SESSION_SOURCE_TYPE_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
697
747
|
var MAX_SESSION_SOURCE_ID_LENGTH = 256;
|
|
698
748
|
function parseSessionSource(sourceType, sourceId) {
|
|
@@ -1760,7 +1810,7 @@ function sliceLineRange(content, startLine, endLine) {
|
|
|
1760
1810
|
}
|
|
1761
1811
|
__name(sliceLineRange, "sliceLineRange");
|
|
1762
1812
|
var BridgeClient = class {
|
|
1763
|
-
constructor(resolveEntry, resolvePendingRestoreEvents, mediator, permissionTimeoutMs, maxPendingPerSession, fileSystem, onModelPromoted, onModePromoted, clientMcpSender, ownsSession = () => true, onTokenUsage, onCreateSubSession, onGenerationEvent, onWorkspaceGenerationEvent, onChannelDelivery) {
|
|
1813
|
+
constructor(resolveEntry, resolvePendingRestoreEvents, mediator, permissionTimeoutMs, maxPendingPerSession, fileSystem, onModelPromoted, onModePromoted, clientMcpSender, ownsSession = () => true, onTokenUsage, onCreateSubSession, onGenerationEvent, onWorkspaceGenerationEvent, onChannelDelivery, hasSessionSpawnInFlight = () => false) {
|
|
1764
1814
|
this.resolveEntry = resolveEntry;
|
|
1765
1815
|
this.resolvePendingRestoreEvents = resolvePendingRestoreEvents;
|
|
1766
1816
|
this.mediator = mediator;
|
|
@@ -1776,6 +1826,7 @@ var BridgeClient = class {
|
|
|
1776
1826
|
this.onGenerationEvent = onGenerationEvent;
|
|
1777
1827
|
this.onWorkspaceGenerationEvent = onWorkspaceGenerationEvent;
|
|
1778
1828
|
this.onChannelDelivery = onChannelDelivery;
|
|
1829
|
+
this.hasSessionSpawnInFlight = hasSessionSpawnInFlight;
|
|
1779
1830
|
}
|
|
1780
1831
|
static {
|
|
1781
1832
|
__name(this, "BridgeClient");
|
|
@@ -2056,6 +2107,9 @@ var BridgeClient = class {
|
|
|
2056
2107
|
if (method === SERVE_CONTROL_EXT_METHODS.channelDelivery) {
|
|
2057
2108
|
return this.handleChannelDelivery(params);
|
|
2058
2109
|
}
|
|
2110
|
+
if (method === TODO_STOP_GUARD_CONTINUATION_CLAIM_METHOD) {
|
|
2111
|
+
return this.handleTodoStopGuardContinuationClaim(params);
|
|
2112
|
+
}
|
|
2059
2113
|
if (method !== MID_TURN_QUEUE_DRAIN_METHOD) {
|
|
2060
2114
|
throw RequestError.methodNotFound(method);
|
|
2061
2115
|
}
|
|
@@ -2068,9 +2122,6 @@ var BridgeClient = class {
|
|
|
2068
2122
|
const hasQueuedPrompt = entry.pendingPromptList.some(
|
|
2069
2123
|
(prompt) => prompt.state === "queued" && !prompt.abortController.signal.aborted
|
|
2070
2124
|
);
|
|
2071
|
-
if (params["todoStopGuardWatchQueuedPrompt"] === true) {
|
|
2072
|
-
entry.todoStopGuardAwaitingQueuedPrompt = hasQueuedPrompt;
|
|
2073
|
-
}
|
|
2074
2125
|
if (drained.length > 0) {
|
|
2075
2126
|
const byOriginator = /* @__PURE__ */ new Map();
|
|
2076
2127
|
for (const item of drained) {
|
|
@@ -2092,6 +2143,45 @@ var BridgeClient = class {
|
|
|
2092
2143
|
}
|
|
2093
2144
|
return { messages, hasQueuedPrompt };
|
|
2094
2145
|
}
|
|
2146
|
+
handleTodoStopGuardContinuationClaim(params) {
|
|
2147
|
+
const sessionId = typeof params["sessionId"] === "string" && params["sessionId"].length > 0 ? params["sessionId"] : void 0;
|
|
2148
|
+
if (!sessionId) return { claimed: false, hasQueuedPrompt: false };
|
|
2149
|
+
if (!this.ownsSession(sessionId)) {
|
|
2150
|
+
return { claimed: false, hasQueuedPrompt: false };
|
|
2151
|
+
}
|
|
2152
|
+
const entry = this.resolveEntry(sessionId);
|
|
2153
|
+
if (!entry) return { claimed: false, hasQueuedPrompt: false };
|
|
2154
|
+
const livePrompts = entry.pendingPromptList.filter(
|
|
2155
|
+
(prompt) => !prompt.abortController.signal.aborted
|
|
2156
|
+
);
|
|
2157
|
+
const promptId = typeof params["promptId"] === "string" && params["promptId"].length > 0 ? params["promptId"] : void 0;
|
|
2158
|
+
if (promptId) {
|
|
2159
|
+
const ownsRunningPrompt = entry.activePromptId === promptId && livePrompts.some(
|
|
2160
|
+
(prompt) => prompt.promptId === promptId && prompt.state === "running"
|
|
2161
|
+
);
|
|
2162
|
+
const hasCompetingRunningPrompt = livePrompts.some(
|
|
2163
|
+
(prompt) => prompt.promptId !== promptId && prompt.state === "running"
|
|
2164
|
+
);
|
|
2165
|
+
if (!ownsRunningPrompt || hasCompetingRunningPrompt) {
|
|
2166
|
+
return { claimed: false, hasQueuedPrompt: false };
|
|
2167
|
+
}
|
|
2168
|
+
const hasQueuedPrompt = livePrompts.some(
|
|
2169
|
+
(prompt) => prompt.state === "queued"
|
|
2170
|
+
);
|
|
2171
|
+
if (hasQueuedPrompt) {
|
|
2172
|
+
entry.todoStopGuardAwaitingQueuedPromptOwnerPromptId = promptId;
|
|
2173
|
+
return { claimed: false, hasQueuedPrompt: true };
|
|
2174
|
+
}
|
|
2175
|
+
if (entry.todoStopGuardAwaitingQueuedPromptOwnerPromptId === promptId) {
|
|
2176
|
+
delete entry.todoStopGuardAwaitingQueuedPromptOwnerPromptId;
|
|
2177
|
+
}
|
|
2178
|
+
return { claimed: true, hasQueuedPrompt: false };
|
|
2179
|
+
}
|
|
2180
|
+
if (entry.promptActive || livePrompts.length > 0) {
|
|
2181
|
+
return { claimed: false, hasQueuedPrompt: false };
|
|
2182
|
+
}
|
|
2183
|
+
return { claimed: true, hasQueuedPrompt: false };
|
|
2184
|
+
}
|
|
2095
2185
|
async handleChannelDelivery(params) {
|
|
2096
2186
|
if (!this.onChannelDelivery) {
|
|
2097
2187
|
throw RequestError.methodNotFound(
|
|
@@ -2227,7 +2317,29 @@ var BridgeClient = class {
|
|
|
2227
2317
|
`client-hosted MCP server '${server}' is not currently connected`
|
|
2228
2318
|
);
|
|
2229
2319
|
}
|
|
2230
|
-
const
|
|
2320
|
+
const sessionId = params["sessionId"];
|
|
2321
|
+
if (sessionId !== void 0 && (typeof sessionId !== "string" || sessionId.length === 0)) {
|
|
2322
|
+
throw RequestError.invalidParams(
|
|
2323
|
+
void 0,
|
|
2324
|
+
"`sessionId` must be a non-empty string when provided"
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
const ownsSession = typeof sessionId === "string" && this.ownsSession(sessionId);
|
|
2328
|
+
if (typeof sessionId === "string" && !ownsSession && !this.hasSessionSpawnInFlight()) {
|
|
2329
|
+
throw RequestError.invalidParams(
|
|
2330
|
+
void 0,
|
|
2331
|
+
`Session not owned by this channel: ${sessionId}`
|
|
2332
|
+
);
|
|
2333
|
+
}
|
|
2334
|
+
if (typeof sessionId === "string" && !ownsSession) {
|
|
2335
|
+
writeStderrLine(
|
|
2336
|
+
`[demux] session=${sessionId} type=client_mcp_message action=forwarded_without_session reason=session_registration_pending`
|
|
2337
|
+
);
|
|
2338
|
+
}
|
|
2339
|
+
const response = await send(
|
|
2340
|
+
payload,
|
|
2341
|
+
typeof sessionId === "string" && ownsSession ? { sessionId } : void 0
|
|
2342
|
+
);
|
|
2231
2343
|
return { payload: response };
|
|
2232
2344
|
}
|
|
2233
2345
|
/**
|
|
@@ -5315,6 +5427,15 @@ function isRecord3(value) {
|
|
|
5315
5427
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5316
5428
|
}
|
|
5317
5429
|
__name(isRecord3, "isRecord");
|
|
5430
|
+
function sessionSourceRequestMeta(sourceType, sourceId) {
|
|
5431
|
+
return sourceType ? {
|
|
5432
|
+
[SESSION_SOURCE_META_KEY]: {
|
|
5433
|
+
sourceType,
|
|
5434
|
+
...sourceId !== void 0 ? { sourceId } : {}
|
|
5435
|
+
}
|
|
5436
|
+
} : {};
|
|
5437
|
+
}
|
|
5438
|
+
__name(sessionSourceRequestMeta, "sessionSourceRequestMeta");
|
|
5318
5439
|
function isDefinitiveAcpRequestError(error) {
|
|
5319
5440
|
if (error instanceof RequestError) return true;
|
|
5320
5441
|
if (!isRecord3(error)) return false;
|
|
@@ -5844,6 +5965,8 @@ function createAcpSessionBridge(opts) {
|
|
|
5844
5965
|
const compactedReplayMaxBytes = normalizeCompactedReplayMaxBytes(
|
|
5845
5966
|
opts.compactedReplayMaxBytes
|
|
5846
5967
|
);
|
|
5968
|
+
const maxJournalEvents = normalizeMaxJournalEvents(opts.maxJournalEvents);
|
|
5969
|
+
const maxJournalBytes = normalizeMaxJournalBytes(opts.maxJournalBytes);
|
|
5847
5970
|
const channelFactory = opts.channelFactory ?? defaultSpawnChannelFactory;
|
|
5848
5971
|
const childEnvOverrides = opts.childEnvOverrides ? Object.freeze({ ...opts.childEnvOverrides }) : Object.freeze({});
|
|
5849
5972
|
const initTimeoutMs = opts.initializeTimeoutMs ?? DEFAULT_INIT_TIMEOUT_MS;
|
|
@@ -6259,98 +6382,124 @@ function createAcpSessionBridge(opts) {
|
|
|
6259
6382
|
})
|
|
6260
6383
|
);
|
|
6261
6384
|
const sessionIds = /* @__PURE__ */ new Set();
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6385
|
+
let client;
|
|
6386
|
+
let connection;
|
|
6387
|
+
try {
|
|
6388
|
+
client = new BridgeClient(
|
|
6389
|
+
// BfFut: ACP today carries a sessionId on every per-session
|
|
6390
|
+
// notification / request, so the no-sessionId branch is
|
|
6391
|
+
// technically unreachable. But the channel is multi-session
|
|
6392
|
+
// (Stage 1.5 multiplex), so if ACP ever grows a no-sessionId
|
|
6393
|
+
// call we'd silently drop it on a multi-session channel
|
|
6394
|
+
// instead of throwing. Surface that ambiguity loudly.
|
|
6395
|
+
(sessionId) => {
|
|
6396
|
+
if (sessionId) return byId.get(sessionId);
|
|
6397
|
+
if (channelInfo && channelInfo.sessionIds.size > 1) {
|
|
6398
|
+
throw new Error(
|
|
6399
|
+
"BridgeClient: ACP call without sessionId on a multi-session channel cannot be routed \u2014 workspace=" + boundWorkspace
|
|
6400
|
+
);
|
|
6401
|
+
}
|
|
6402
|
+
return void 0;
|
|
6403
|
+
},
|
|
6404
|
+
(sessionId) => sessionId ? pendingRestoreEvents.get(sessionId) : void 0,
|
|
6405
|
+
permissionMediator,
|
|
6406
|
+
permissionTimeoutMs,
|
|
6407
|
+
maxPendingPerSession,
|
|
6408
|
+
// Forward the optional `BridgeFileSystem` injection so
|
|
6409
|
+
// production `qwen serve` can wire the `WorkspaceFileSystem`
|
|
6410
|
+
// adapter into BridgeClient's fs proxy methods. Tests + Mode A
|
|
6411
|
+
// consumers + channels / IDE companion omit it; BridgeClient
|
|
6412
|
+
// falls back to its inline fs proxy.
|
|
6413
|
+
opts.fileSystem,
|
|
6414
|
+
// §2.3: centralised model_switched publish — keeps cache + generation
|
|
6415
|
+
// update atomic. BridgeClient calls this instead of inlining publish.
|
|
6416
|
+
(entry, modelId, originator) => publishModelSwitched(entry, modelId, originator),
|
|
6417
|
+
// A2: centralised approval_mode_changed publish on in-session mode
|
|
6418
|
+
// promotion. `previous` is read from the bridge state cache.
|
|
6419
|
+
(entry, modeId, originator) => {
|
|
6420
|
+
const se = entry;
|
|
6421
|
+
publishApprovalModeChanged(
|
|
6422
|
+
se,
|
|
6423
|
+
{
|
|
6424
|
+
previous: se.currentApprovalMode ?? "default",
|
|
6425
|
+
next: modeId,
|
|
6426
|
+
persisted: false
|
|
6427
|
+
},
|
|
6428
|
+
originator
|
|
6274
6429
|
);
|
|
6275
|
-
}
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6430
|
+
},
|
|
6431
|
+
// Reverse tool channel (issue #5626, Phase 2): forward the optional
|
|
6432
|
+
// client-hosted-MCP sender lookup so `BridgeClient.extMethod` can
|
|
6433
|
+
// answer `qwen/control/client_mcp/message` from the child by reaching
|
|
6434
|
+
// the per-WS-connection `ClientMcpRegistrar`. Omitted callers (tests,
|
|
6435
|
+
// Mode A) never host a client MCP server, so the method stays
|
|
6436
|
+
// unreachable.
|
|
6437
|
+
opts.clientMcpSender,
|
|
6438
|
+
(sessionId) => sessionIds.has(sessionId),
|
|
6439
|
+
// Daemon token-burn accounting: forward per-round token usage observed
|
|
6440
|
+
// at the session/update fan-in to the daemon host's metrics ring via
|
|
6441
|
+
// the telemetry seam. Optional-chained so non-daemon callers (tests,
|
|
6442
|
+
// Mode A) that wire no `tokenUsage` metric are a silent no-op.
|
|
6443
|
+
(inputTokens, outputTokens, durationMs, apiErrors, apiRetries) => telemetry.metrics?.tokenUsage?.(
|
|
6444
|
+
inputTokens,
|
|
6445
|
+
outputTokens,
|
|
6446
|
+
durationMs,
|
|
6447
|
+
apiErrors,
|
|
6448
|
+
apiRetries
|
|
6449
|
+
),
|
|
6450
|
+
// `create_sub_session` tool: forward the request/response hook so a child
|
|
6451
|
+
// tool can ask the daemon to spawn a sub-session and (for 'first-turn')
|
|
6452
|
+
// return its result. Omitted → the method reports daemon-only.
|
|
6453
|
+
opts.onCreateSubSession,
|
|
6454
|
+
(sessionId, event) => {
|
|
6455
|
+
const request = generationRequests.get(event.requestId);
|
|
6456
|
+
if (!request || request.sessionId !== sessionId) return;
|
|
6457
|
+
if (request.queue.push(event)) return;
|
|
6458
|
+
request.settled = true;
|
|
6459
|
+
generationRequests.delete(event.requestId);
|
|
6460
|
+
request.queue.fail(
|
|
6461
|
+
new Error("Generation stream consumer too slow")
|
|
6462
|
+
);
|
|
6463
|
+
void request.connection.extMethod(SERVE_CONTROL_EXT_METHODS.sessionGenerationCancel, {
|
|
6464
|
+
sessionId,
|
|
6465
|
+
requestId: event.requestId
|
|
6466
|
+
}).catch(() => void 0);
|
|
6467
|
+
},
|
|
6468
|
+
(event) => {
|
|
6469
|
+
const request = workspaceGenerationRequests.get(event.requestId);
|
|
6470
|
+
if (!request) return;
|
|
6471
|
+
if (request.queue.push(event)) return;
|
|
6472
|
+
request.settled = true;
|
|
6473
|
+
workspaceGenerationRequests.delete(event.requestId);
|
|
6474
|
+
request.queue.fail(
|
|
6475
|
+
new Error("Generation stream consumer too slow")
|
|
6476
|
+
);
|
|
6477
|
+
void request.connection?.extMethod(SERVE_CONTROL_EXT_METHODS.workspaceGenerationCancel, {
|
|
6478
|
+
requestId: event.requestId
|
|
6479
|
+
}).catch(() => void 0);
|
|
6480
|
+
},
|
|
6481
|
+
opts.onChannelDelivery,
|
|
6482
|
+
() => channelInfo?.sessionIds === sessionIds && channelInfo.sessionSpawnsInFlight > 0
|
|
6483
|
+
);
|
|
6484
|
+
connection = new ClientSideConnection(() => client, channel.stream);
|
|
6485
|
+
} catch (error) {
|
|
6486
|
+
try {
|
|
6487
|
+
channel.killSync();
|
|
6488
|
+
} catch {
|
|
6489
|
+
}
|
|
6490
|
+
try {
|
|
6491
|
+
await Promise.race([
|
|
6492
|
+
channel.exited.then(() => void 0),
|
|
6493
|
+
channel.kill()
|
|
6494
|
+
]);
|
|
6495
|
+
} catch (teardownError) {
|
|
6496
|
+
throw new AggregateError(
|
|
6497
|
+
[error, teardownError],
|
|
6498
|
+
"ACP channel construction and teardown failed"
|
|
6303
6499
|
);
|
|
6304
|
-
}
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
// answer `qwen/control/client_mcp/message` from the child by reaching
|
|
6308
|
-
// the per-WS-connection `ClientMcpRegistrar`. Omitted callers (tests,
|
|
6309
|
-
// Mode A) never host a client MCP server, so the method stays
|
|
6310
|
-
// unreachable.
|
|
6311
|
-
opts.clientMcpSender,
|
|
6312
|
-
(sessionId) => sessionIds.has(sessionId),
|
|
6313
|
-
// Daemon token-burn accounting: forward per-round token usage observed
|
|
6314
|
-
// at the session/update fan-in to the daemon host's metrics ring via
|
|
6315
|
-
// the telemetry seam. Optional-chained so non-daemon callers (tests,
|
|
6316
|
-
// Mode A) that wire no `tokenUsage` metric are a silent no-op.
|
|
6317
|
-
(inputTokens, outputTokens, durationMs, apiErrors, apiRetries) => telemetry.metrics?.tokenUsage?.(
|
|
6318
|
-
inputTokens,
|
|
6319
|
-
outputTokens,
|
|
6320
|
-
durationMs,
|
|
6321
|
-
apiErrors,
|
|
6322
|
-
apiRetries
|
|
6323
|
-
),
|
|
6324
|
-
// `create_sub_session` tool: forward the request/response hook so a child
|
|
6325
|
-
// tool can ask the daemon to spawn a sub-session and (for 'first-turn')
|
|
6326
|
-
// return its result. Omitted → the method reports daemon-only.
|
|
6327
|
-
opts.onCreateSubSession,
|
|
6328
|
-
(sessionId, event) => {
|
|
6329
|
-
const request = generationRequests.get(event.requestId);
|
|
6330
|
-
if (!request || request.sessionId !== sessionId) return;
|
|
6331
|
-
if (request.queue.push(event)) return;
|
|
6332
|
-
request.settled = true;
|
|
6333
|
-
generationRequests.delete(event.requestId);
|
|
6334
|
-
request.queue.fail(new Error("Generation stream consumer too slow"));
|
|
6335
|
-
void request.connection.extMethod(SERVE_CONTROL_EXT_METHODS.sessionGenerationCancel, {
|
|
6336
|
-
sessionId,
|
|
6337
|
-
requestId: event.requestId
|
|
6338
|
-
}).catch(() => void 0);
|
|
6339
|
-
},
|
|
6340
|
-
(event) => {
|
|
6341
|
-
const request = workspaceGenerationRequests.get(event.requestId);
|
|
6342
|
-
if (!request) return;
|
|
6343
|
-
if (request.queue.push(event)) return;
|
|
6344
|
-
request.settled = true;
|
|
6345
|
-
workspaceGenerationRequests.delete(event.requestId);
|
|
6346
|
-
request.queue.fail(new Error("Generation stream consumer too slow"));
|
|
6347
|
-
void request.connection?.extMethod(SERVE_CONTROL_EXT_METHODS.workspaceGenerationCancel, {
|
|
6348
|
-
requestId: event.requestId
|
|
6349
|
-
}).catch(() => void 0);
|
|
6350
|
-
},
|
|
6351
|
-
opts.onChannelDelivery
|
|
6352
|
-
);
|
|
6353
|
-
const connection = new ClientSideConnection(() => client, channel.stream);
|
|
6500
|
+
}
|
|
6501
|
+
throw error;
|
|
6502
|
+
}
|
|
6354
6503
|
const info = {
|
|
6355
6504
|
id: acpChannelId,
|
|
6356
6505
|
channel,
|
|
@@ -6533,12 +6682,20 @@ function createAcpSessionBridge(opts) {
|
|
|
6533
6682
|
"qwen-code.daemon.acp_channel.id": ci.id
|
|
6534
6683
|
},
|
|
6535
6684
|
async () => {
|
|
6685
|
+
const request = telemetry.injectPromptContext({
|
|
6686
|
+
cwd: boundWorkspace,
|
|
6687
|
+
mcpServers: [],
|
|
6688
|
+
...sourceType ? { _meta: sessionSourceRequestMeta(sourceType, sourceId) } : {}
|
|
6689
|
+
});
|
|
6536
6690
|
const response = await withTimeout(
|
|
6537
6691
|
ci.connection.newSession(
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6692
|
+
worktree ? {
|
|
6693
|
+
...request,
|
|
6694
|
+
_meta: {
|
|
6695
|
+
...isRecord3(request._meta) ? request._meta : {},
|
|
6696
|
+
[WORKTREE_MCP_DEFER_META_KEY]: true
|
|
6697
|
+
}
|
|
6698
|
+
} : request
|
|
6542
6699
|
),
|
|
6543
6700
|
initTimeoutMs,
|
|
6544
6701
|
"newSession"
|
|
@@ -7109,7 +7266,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7109
7266
|
cpuPercent: info.childCpuPercent ?? 0
|
|
7110
7267
|
};
|
|
7111
7268
|
}, "getChildResourceSnapshot");
|
|
7112
|
-
const requestSessionStatus = /* @__PURE__ */ __name(async (sessionId, method, params = {}) => {
|
|
7269
|
+
const requestSessionStatus = /* @__PURE__ */ __name(async (sessionId, method, params = {}, timeoutMs = initTimeoutMs) => {
|
|
7113
7270
|
const entry = byId.get(sessionId);
|
|
7114
7271
|
if (!entry) throw new SessionNotFoundError(sessionId);
|
|
7115
7272
|
const info = channelInfoForEntry(entry);
|
|
@@ -7117,7 +7274,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7117
7274
|
const response = await Promise.race([
|
|
7118
7275
|
withTimeout(
|
|
7119
7276
|
entry.connection.extMethod(method, { ...params, sessionId }),
|
|
7120
|
-
|
|
7277
|
+
timeoutMs,
|
|
7121
7278
|
method
|
|
7122
7279
|
),
|
|
7123
7280
|
getTransportClosedReject(entry)
|
|
@@ -7207,6 +7364,8 @@ function createAcpSessionBridge(opts) {
|
|
|
7207
7364
|
void 0,
|
|
7208
7365
|
new TurnBoundaryCompactionEngine({
|
|
7209
7366
|
maxReplayBytes: compactedReplayMaxBytes,
|
|
7367
|
+
maxJournalEvents,
|
|
7368
|
+
maxJournalBytes,
|
|
7210
7369
|
onReplayWindowEviction: /* @__PURE__ */ __name((eviction) => {
|
|
7211
7370
|
teeServeDebugLine(
|
|
7212
7371
|
`replay window evicted ${JSON.stringify(eviction)}`
|
|
@@ -7310,6 +7469,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7310
7469
|
const entry = {
|
|
7311
7470
|
sessionId,
|
|
7312
7471
|
workspaceCwd,
|
|
7472
|
+
effectiveCwd: workspaceCwd,
|
|
7313
7473
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7314
7474
|
...options.parentSessionId ? { parentSessionId: options.parentSessionId } : {},
|
|
7315
7475
|
...options.sourceType ? { sourceType: options.sourceType } : {},
|
|
@@ -7326,6 +7486,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7326
7486
|
}),
|
|
7327
7487
|
recordingDegraded: false,
|
|
7328
7488
|
closing: false,
|
|
7489
|
+
cwdChangeQueue: Promise.resolve(),
|
|
7329
7490
|
promptQueue: Promise.resolve(),
|
|
7330
7491
|
pendingPromptCount: 0,
|
|
7331
7492
|
pendingPromptList: [],
|
|
@@ -7592,6 +7753,46 @@ function createAcpSessionBridge(opts) {
|
|
|
7592
7753
|
return replayFieldsFor(entry, "load");
|
|
7593
7754
|
}
|
|
7594
7755
|
__name(refreshedReplayFieldsFor, "refreshedReplayFieldsFor");
|
|
7756
|
+
function transcriptEventRecordId(event) {
|
|
7757
|
+
if (event.type !== "session_update") return void 0;
|
|
7758
|
+
const data = event.data;
|
|
7759
|
+
if (!data || typeof data !== "object" || Array.isArray(data))
|
|
7760
|
+
return void 0;
|
|
7761
|
+
const rec = data;
|
|
7762
|
+
const update = rec["update"];
|
|
7763
|
+
const meta = update && typeof update === "object" && !Array.isArray(update) ? update["_meta"] : rec["_meta"];
|
|
7764
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta))
|
|
7765
|
+
return void 0;
|
|
7766
|
+
const recordId = meta["qwen.session.recordId"];
|
|
7767
|
+
return typeof recordId === "string" ? recordId : void 0;
|
|
7768
|
+
}
|
|
7769
|
+
__name(transcriptEventRecordId, "transcriptEventRecordId");
|
|
7770
|
+
async function resolveHistoryAnchorRecordId(entry, replayFields) {
|
|
7771
|
+
const events = [
|
|
7772
|
+
...replayFields.compactedReplay ?? [],
|
|
7773
|
+
...replayFields.liveJournal ?? []
|
|
7774
|
+
];
|
|
7775
|
+
const hasMarker = events.some((e) => e.type === "history_truncated");
|
|
7776
|
+
if (!hasMarker) return void 0;
|
|
7777
|
+
const hasRecordId = events.some(
|
|
7778
|
+
(e) => transcriptEventRecordId(e) !== void 0 || e.type === "history_truncated" && isRecord3(e.data) && typeof e.data["recordId"] === "string"
|
|
7779
|
+
);
|
|
7780
|
+
if (hasRecordId) return void 0;
|
|
7781
|
+
try {
|
|
7782
|
+
const page = await requestSessionTranscriptPage({
|
|
7783
|
+
sessionId: entry.sessionId,
|
|
7784
|
+
direction: "backward",
|
|
7785
|
+
limit: 50
|
|
7786
|
+
});
|
|
7787
|
+
for (const event of page.events) {
|
|
7788
|
+
const recordId = transcriptEventRecordId(event);
|
|
7789
|
+
if (recordId !== void 0) return recordId;
|
|
7790
|
+
}
|
|
7791
|
+
} catch {
|
|
7792
|
+
}
|
|
7793
|
+
return void 0;
|
|
7794
|
+
}
|
|
7795
|
+
__name(resolveHistoryAnchorRecordId, "resolveHistoryAnchorRecordId");
|
|
7595
7796
|
async function restoreSession(action, req, options = {}) {
|
|
7596
7797
|
if (shuttingDown) {
|
|
7597
7798
|
throw new Error("AcpSessionBridge is shutting down");
|
|
@@ -7603,6 +7804,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7603
7804
|
);
|
|
7604
7805
|
}
|
|
7605
7806
|
const historyReplay = action === "load" ? req.historyReplay ?? "stream" : "stream";
|
|
7807
|
+
const hideInheritedHistory = action === "load" && req.hideInheritedHistory === true;
|
|
7606
7808
|
const existing = byId.get(req.sessionId);
|
|
7607
7809
|
if (existing) {
|
|
7608
7810
|
if (existing.closing) {
|
|
@@ -7612,6 +7814,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7612
7814
|
);
|
|
7613
7815
|
}
|
|
7614
7816
|
const replayFields = action === "load" && req.historyPageSize !== void 0 ? await refreshedReplayFieldsFor(existing, req.historyPageSize) : replayFieldsFor(existing, action);
|
|
7817
|
+
const historyAnchorRecordId = action === "load" ? await resolveHistoryAnchorRecordId(existing, replayFields) : void 0;
|
|
7615
7818
|
if (byId.get(req.sessionId) !== existing || existing.closing) {
|
|
7616
7819
|
throw new SessionNotFoundError(req.sessionId);
|
|
7617
7820
|
}
|
|
@@ -7633,12 +7836,13 @@ function createAcpSessionBridge(opts) {
|
|
|
7633
7836
|
// caller saw; spawn-only sessions don't carry a state payload.
|
|
7634
7837
|
state: existing.restoreState ?? {},
|
|
7635
7838
|
hasActivePrompt: existing.promptActive,
|
|
7636
|
-
...replayFields
|
|
7839
|
+
...replayFields,
|
|
7840
|
+
...historyAnchorRecordId !== void 0 ? { historyAnchorRecordId } : {}
|
|
7637
7841
|
};
|
|
7638
7842
|
}
|
|
7639
7843
|
const inFlight = inFlightRestores.get(req.sessionId);
|
|
7640
7844
|
if (inFlight) {
|
|
7641
|
-
if (action !== inFlight.action || historyReplay !== inFlight.historyReplay) {
|
|
7845
|
+
if (action !== inFlight.action || historyReplay !== inFlight.historyReplay || hideInheritedHistory !== inFlight.hideInheritedHistory) {
|
|
7642
7846
|
throw new RestoreInProgressError(
|
|
7643
7847
|
req.sessionId,
|
|
7644
7848
|
inFlight.action,
|
|
@@ -7720,11 +7924,20 @@ function createAcpSessionBridge(opts) {
|
|
|
7720
7924
|
// intentionally has no `mcpServers` field for the
|
|
7721
7925
|
// same reason.
|
|
7722
7926
|
mcpServers: [],
|
|
7723
|
-
...historyReplay === "response" ? {
|
|
7927
|
+
...historyReplay === "response" || hideInheritedHistory || req.sourceType ? {
|
|
7724
7928
|
_meta: {
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7929
|
+
...sessionSourceRequestMeta(
|
|
7930
|
+
req.sourceType,
|
|
7931
|
+
req.sourceId
|
|
7932
|
+
),
|
|
7933
|
+
...historyReplay === "response" ? {
|
|
7934
|
+
[LOAD_REPLAY_MODE_META_KEY]: LOAD_REPLAY_BULK_MODE,
|
|
7935
|
+
...req.historyPageSize !== void 0 ? {
|
|
7936
|
+
[LOAD_REPLAY_PAGE_SIZE_META_KEY]: req.historyPageSize
|
|
7937
|
+
} : {}
|
|
7938
|
+
} : {},
|
|
7939
|
+
...hideInheritedHistory ? {
|
|
7940
|
+
[LOAD_REPLAY_HIDE_INHERITED_META_KEY]: true
|
|
7728
7941
|
} : {}
|
|
7729
7942
|
}
|
|
7730
7943
|
} : {}
|
|
@@ -7740,7 +7953,13 @@ function createAcpSessionBridge(opts) {
|
|
|
7740
7953
|
ci.connection.unstable_resumeSession({
|
|
7741
7954
|
sessionId: req.sessionId,
|
|
7742
7955
|
cwd: workspaceKey,
|
|
7743
|
-
mcpServers: []
|
|
7956
|
+
mcpServers: [],
|
|
7957
|
+
...req.sourceType ? {
|
|
7958
|
+
_meta: sessionSourceRequestMeta(
|
|
7959
|
+
req.sourceType,
|
|
7960
|
+
req.sourceId
|
|
7961
|
+
)
|
|
7962
|
+
} : {}
|
|
7744
7963
|
}),
|
|
7745
7964
|
initTimeoutMs,
|
|
7746
7965
|
"resumeSession"
|
|
@@ -7918,6 +8137,7 @@ function createAcpSessionBridge(opts) {
|
|
|
7918
8137
|
inFlightRestores.set(req.sessionId, {
|
|
7919
8138
|
action,
|
|
7920
8139
|
historyReplay,
|
|
8140
|
+
hideInheritedHistory,
|
|
7921
8141
|
promise,
|
|
7922
8142
|
coalesceState
|
|
7923
8143
|
});
|
|
@@ -8046,6 +8266,8 @@ function createAcpSessionBridge(opts) {
|
|
|
8046
8266
|
maxPendingPromptsPerSession: maxPendingPromptsPerSession === Infinity ? null : maxPendingPromptsPerSession,
|
|
8047
8267
|
eventRingSize,
|
|
8048
8268
|
compactedReplayMaxBytes,
|
|
8269
|
+
maxJournalEvents,
|
|
8270
|
+
maxJournalBytes,
|
|
8049
8271
|
channelIdleTimeoutMs: resolvedChannelIdleTimeoutMs(),
|
|
8050
8272
|
sessionIdleTimeoutMs
|
|
8051
8273
|
},
|
|
@@ -8348,13 +8570,17 @@ function createAcpSessionBridge(opts) {
|
|
|
8348
8570
|
"abort",
|
|
8349
8571
|
() => {
|
|
8350
8572
|
if (pendingEntry.state !== "queued") return;
|
|
8351
|
-
|
|
8573
|
+
const waitingOwnerPromptId = entry.todoStopGuardAwaitingQueuedPromptOwnerPromptId;
|
|
8574
|
+
if (!waitingOwnerPromptId) return;
|
|
8352
8575
|
const hasAnotherQueuedPrompt = entry.pendingPromptList.some(
|
|
8353
8576
|
(candidate) => candidate !== pendingEntry && candidate.state === "queued" && !candidate.abortController.signal.aborted
|
|
8354
8577
|
);
|
|
8355
8578
|
if (hasAnotherQueuedPrompt) return;
|
|
8356
|
-
entry.
|
|
8357
|
-
void entry.connection.extMethod(TODO_STOP_GUARD_QUEUE_RELEASE_METHOD, {
|
|
8579
|
+
delete entry.todoStopGuardAwaitingQueuedPromptOwnerPromptId;
|
|
8580
|
+
void entry.connection.extMethod(TODO_STOP_GUARD_QUEUE_RELEASE_METHOD, {
|
|
8581
|
+
sessionId,
|
|
8582
|
+
promptId: waitingOwnerPromptId
|
|
8583
|
+
}).catch((error) => {
|
|
8358
8584
|
writeStderrLine(
|
|
8359
8585
|
`qwen serve: Todo Stop Guard queued-prompt release failed for ${JSON.stringify(sessionId)}: ${error instanceof Error ? error.message : String(error)}`
|
|
8360
8586
|
);
|
|
@@ -8385,7 +8611,7 @@ function createAcpSessionBridge(opts) {
|
|
|
8385
8611
|
throw new DOMException("Prompt aborted", "AbortError");
|
|
8386
8612
|
}
|
|
8387
8613
|
if (pendingEntry.state === "queued") {
|
|
8388
|
-
entry.
|
|
8614
|
+
delete entry.todoStopGuardAwaitingQueuedPromptOwnerPromptId;
|
|
8389
8615
|
pendingEntry.state = "running";
|
|
8390
8616
|
entry.events.publish({
|
|
8391
8617
|
type: "pending_prompt_started",
|
|
@@ -8790,12 +9016,18 @@ function createAcpSessionBridge(opts) {
|
|
|
8790
9016
|
if (shuttingDown) throw new Error("AcpSessionBridge is shutting down");
|
|
8791
9017
|
const entry = byId.get(sessionId);
|
|
8792
9018
|
if (!entry) throw new SessionNotFoundError(sessionId);
|
|
9019
|
+
const source = parseSessionSource(req.sourceType, req.sourceId);
|
|
9020
|
+
if ("error" in source) {
|
|
9021
|
+
throw new InvalidSessionMetadataError("sourceType", source.error);
|
|
9022
|
+
}
|
|
9023
|
+
const isSideTask = source.sourceType === "side_task";
|
|
8793
9024
|
let originatorClientId;
|
|
8794
9025
|
if (context?.clientId !== void 0) {
|
|
8795
9026
|
originatorClientId = resolveTrustedClientId(entry, context.clientId);
|
|
8796
9027
|
}
|
|
8797
|
-
const
|
|
8798
|
-
|
|
9028
|
+
const concurrentSideTask = isSideTask && entry.promptActive;
|
|
9029
|
+
const branchResult = (concurrentSideTask ? Promise.resolve() : entry.promptQueue).then(async () => {
|
|
9030
|
+
if (entry.promptActive && !isSideTask) {
|
|
8799
9031
|
throw new BranchWhilePromptActiveError(sessionId);
|
|
8800
9032
|
}
|
|
8801
9033
|
if (byId.size + inFlightSpawns.size + inFlightRestores.size >= maxSessions) {
|
|
@@ -8815,13 +9047,16 @@ function createAcpSessionBridge(opts) {
|
|
|
8815
9047
|
try {
|
|
8816
9048
|
const ci = await ensureChannel();
|
|
8817
9049
|
const result = await withTimeout(
|
|
8818
|
-
ci.connection.extMethod(
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
9050
|
+
ci.connection.extMethod(
|
|
9051
|
+
isSideTask ? SERVE_CONTROL_EXT_METHODS.sessionSideTask : SERVE_CONTROL_EXT_METHODS.sessionBranch,
|
|
9052
|
+
{
|
|
9053
|
+
sessionId,
|
|
9054
|
+
cwd: boundWorkspace,
|
|
9055
|
+
name: req.name
|
|
9056
|
+
}
|
|
9057
|
+
),
|
|
8823
9058
|
initTimeoutMs,
|
|
8824
|
-
"branchSession"
|
|
9059
|
+
isSideTask ? "createSideTaskSession" : "branchSession"
|
|
8825
9060
|
);
|
|
8826
9061
|
if (!result || typeof result.newSessionId !== "string") {
|
|
8827
9062
|
throw new Error(
|
|
@@ -8832,12 +9067,18 @@ function createAcpSessionBridge(opts) {
|
|
|
8832
9067
|
const branchDisplayName = typeof rawBranchName === "string" ? rawBranchName : result.newSessionId.slice(0, 8);
|
|
8833
9068
|
let restored;
|
|
8834
9069
|
try {
|
|
9070
|
+
const hideInheritedHistory = req.replayInheritedHistory === false;
|
|
8835
9071
|
restored = await restoreSession(
|
|
8836
9072
|
"load",
|
|
8837
9073
|
{
|
|
8838
9074
|
sessionId: result.newSessionId,
|
|
8839
9075
|
workspaceCwd: boundWorkspace,
|
|
8840
|
-
clientId: context?.clientId
|
|
9076
|
+
clientId: context?.clientId,
|
|
9077
|
+
...hideInheritedHistory ? {
|
|
9078
|
+
historyReplay: "response",
|
|
9079
|
+
hideInheritedHistory: true
|
|
9080
|
+
} : {},
|
|
9081
|
+
...source
|
|
8841
9082
|
},
|
|
8842
9083
|
{
|
|
8843
9084
|
skipFreshSessionAdmission: true
|
|
@@ -8862,35 +9103,80 @@ function createAcpSessionBridge(opts) {
|
|
|
8862
9103
|
}
|
|
8863
9104
|
const newEntry = byId.get(result.newSessionId);
|
|
8864
9105
|
if (newEntry) newEntry.displayName = branchDisplayName;
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
9106
|
+
let sourcePersisted;
|
|
9107
|
+
if (newEntry?.sourceType) {
|
|
9108
|
+
try {
|
|
9109
|
+
const sourceResult = await withTimeout(
|
|
9110
|
+
newEntry.connection.extMethod(
|
|
9111
|
+
SERVE_CONTROL_EXT_METHODS.sessionSource,
|
|
9112
|
+
{
|
|
9113
|
+
sessionId: newEntry.sessionId,
|
|
9114
|
+
sourceType: newEntry.sourceType,
|
|
9115
|
+
...newEntry.sourceId !== void 0 ? { sourceId: newEntry.sourceId } : {}
|
|
9116
|
+
}
|
|
9117
|
+
),
|
|
9118
|
+
initTimeoutMs,
|
|
9119
|
+
"sessionSource"
|
|
9120
|
+
);
|
|
9121
|
+
sourcePersisted = sourceResult?.persisted === true;
|
|
9122
|
+
} catch (error) {
|
|
9123
|
+
sourcePersisted = false;
|
|
9124
|
+
writeStderrLine(
|
|
9125
|
+
`qwen serve: source metadata for branched session ${result.newSessionId} was not persisted: ${error instanceof Error ? error.message : String(error)}`
|
|
9126
|
+
);
|
|
9127
|
+
}
|
|
9128
|
+
}
|
|
9129
|
+
if (!isSideTask) {
|
|
9130
|
+
const eventData = {
|
|
9131
|
+
sourceSessionId: sessionId,
|
|
9132
|
+
newSessionId: result.newSessionId,
|
|
9133
|
+
displayName: branchDisplayName
|
|
9134
|
+
};
|
|
9135
|
+
const branchEnvelope = {
|
|
9136
|
+
type: "session_branched",
|
|
9137
|
+
data: eventData,
|
|
9138
|
+
...originatorClientId ? { originatorClientId } : {}
|
|
9139
|
+
};
|
|
9140
|
+
newEntry?.events.publish(branchEnvelope);
|
|
9141
|
+
}
|
|
8876
9142
|
return {
|
|
8877
9143
|
...restored,
|
|
8878
9144
|
displayName: branchDisplayName,
|
|
8879
9145
|
forkedFrom: {
|
|
8880
9146
|
sessionId,
|
|
8881
9147
|
displayName: entry.displayName ?? sessionId.slice(0, 8)
|
|
8882
|
-
}
|
|
9148
|
+
},
|
|
9149
|
+
...sourcePersisted !== void 0 ? { sourcePersisted } : {}
|
|
8883
9150
|
};
|
|
8884
9151
|
} finally {
|
|
8885
9152
|
releaseAdmissionOnce();
|
|
8886
9153
|
}
|
|
8887
9154
|
});
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
9155
|
+
if (!concurrentSideTask) {
|
|
9156
|
+
entry.promptQueue = branchResult.then(
|
|
9157
|
+
() => void 0,
|
|
9158
|
+
() => void 0
|
|
9159
|
+
);
|
|
9160
|
+
}
|
|
8892
9161
|
return branchResult;
|
|
8893
9162
|
},
|
|
9163
|
+
async createSideTaskSession(sessionId, req, context) {
|
|
9164
|
+
const result = await this.branchSession(
|
|
9165
|
+
sessionId,
|
|
9166
|
+
{
|
|
9167
|
+
name: req.name,
|
|
9168
|
+
sourceType: "side_task",
|
|
9169
|
+
sourceId: sessionId,
|
|
9170
|
+
replayInheritedHistory: false
|
|
9171
|
+
},
|
|
9172
|
+
context
|
|
9173
|
+
);
|
|
9174
|
+
const { forkedFrom: _forkedFrom, ...sideTask } = result;
|
|
9175
|
+
return {
|
|
9176
|
+
...sideTask,
|
|
9177
|
+
parentSessionId: sessionId
|
|
9178
|
+
};
|
|
9179
|
+
},
|
|
8894
9180
|
async changeSessionCwd(sessionId, req, context) {
|
|
8895
9181
|
if (shuttingDown) throw new Error("AcpSessionBridge is shutting down");
|
|
8896
9182
|
const entry = byId.get(sessionId);
|
|
@@ -8918,6 +9204,7 @@ function createAcpSessionBridge(opts) {
|
|
|
8918
9204
|
`changeSessionCwd: unexpected response shape from agent: ${JSON.stringify(raw)}`
|
|
8919
9205
|
);
|
|
8920
9206
|
}
|
|
9207
|
+
entry.effectiveCwd = extResult.newCwd;
|
|
8921
9208
|
if (extResult.previousCwd !== extResult.newCwd) {
|
|
8922
9209
|
entry.events.publish({
|
|
8923
9210
|
type: "session_cwd_changed",
|
|
@@ -8935,6 +9222,10 @@ function createAcpSessionBridge(opts) {
|
|
|
8935
9222
|
() => void 0,
|
|
8936
9223
|
() => void 0
|
|
8937
9224
|
);
|
|
9225
|
+
entry.cwdChangeQueue = cdPromise.then(
|
|
9226
|
+
() => void 0,
|
|
9227
|
+
() => void 0
|
|
9228
|
+
);
|
|
8938
9229
|
const result = await withTimeout(
|
|
8939
9230
|
cdPromise,
|
|
8940
9231
|
Math.max(initTimeoutMs, 3e4),
|
|
@@ -9436,44 +9727,79 @@ function createAcpSessionBridge(opts) {
|
|
|
9436
9727
|
},
|
|
9437
9728
|
async refreshExtensionsForAllSessions(data) {
|
|
9438
9729
|
const sessions = Array.from(byId.values());
|
|
9730
|
+
const bootstrapRefreshConnections = /* @__PURE__ */ new Set();
|
|
9731
|
+
const refreshSession = /* @__PURE__ */ __name(async (entry, refreshBootstrap) => {
|
|
9732
|
+
let inFlight = inFlightExtensionRefreshes.get(entry.sessionId);
|
|
9733
|
+
if (!inFlight || inFlight.connection !== entry.connection || refreshBootstrap && !inFlight.refreshBootstrap) {
|
|
9734
|
+
const promise = (async () => {
|
|
9735
|
+
await entry.connection.extMethod(
|
|
9736
|
+
SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh,
|
|
9737
|
+
{
|
|
9738
|
+
sessionId: entry.sessionId,
|
|
9739
|
+
...refreshBootstrap ? {} : { refreshBootstrap: false }
|
|
9740
|
+
}
|
|
9741
|
+
);
|
|
9742
|
+
})();
|
|
9743
|
+
inFlight = {
|
|
9744
|
+
connection: entry.connection,
|
|
9745
|
+
promise,
|
|
9746
|
+
refreshBootstrap
|
|
9747
|
+
};
|
|
9748
|
+
inFlightExtensionRefreshes.set(entry.sessionId, inFlight);
|
|
9749
|
+
const clear = /* @__PURE__ */ __name(() => {
|
|
9750
|
+
if (inFlightExtensionRefreshes.get(entry.sessionId) === inFlight) {
|
|
9751
|
+
inFlightExtensionRefreshes.delete(entry.sessionId);
|
|
9752
|
+
}
|
|
9753
|
+
}, "clear");
|
|
9754
|
+
void promise.then(clear, clear);
|
|
9755
|
+
}
|
|
9756
|
+
await Promise.race([
|
|
9757
|
+
withTimeout(
|
|
9758
|
+
inFlight.promise,
|
|
9759
|
+
3e4,
|
|
9760
|
+
SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh
|
|
9761
|
+
),
|
|
9762
|
+
getTransportClosedReject(entry)
|
|
9763
|
+
]);
|
|
9764
|
+
}, "refreshSession");
|
|
9439
9765
|
const results = await Promise.all(
|
|
9440
9766
|
sessions.map(async (entry) => {
|
|
9441
9767
|
const info = channelInfoForEntry(entry);
|
|
9442
9768
|
if (!info || info.isDying) {
|
|
9443
|
-
return {
|
|
9769
|
+
return {
|
|
9770
|
+
refreshed: 0,
|
|
9771
|
+
failed: 0,
|
|
9772
|
+
entry,
|
|
9773
|
+
refreshBootstrap: false
|
|
9774
|
+
};
|
|
9444
9775
|
}
|
|
9776
|
+
const refreshBootstrap = !bootstrapRefreshConnections.has(
|
|
9777
|
+
entry.connection
|
|
9778
|
+
);
|
|
9779
|
+
bootstrapRefreshConnections.add(entry.connection);
|
|
9445
9780
|
try {
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
const promise = (async () => {
|
|
9449
|
-
await entry.connection.extMethod(
|
|
9450
|
-
SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh,
|
|
9451
|
-
{ sessionId: entry.sessionId }
|
|
9452
|
-
);
|
|
9453
|
-
})();
|
|
9454
|
-
inFlight = { connection: entry.connection, promise };
|
|
9455
|
-
inFlightExtensionRefreshes.set(entry.sessionId, inFlight);
|
|
9456
|
-
const clear = /* @__PURE__ */ __name(() => {
|
|
9457
|
-
if (inFlightExtensionRefreshes.get(entry.sessionId) === inFlight) {
|
|
9458
|
-
inFlightExtensionRefreshes.delete(entry.sessionId);
|
|
9459
|
-
}
|
|
9460
|
-
}, "clear");
|
|
9461
|
-
void promise.then(clear, clear);
|
|
9462
|
-
}
|
|
9463
|
-
await Promise.race([
|
|
9464
|
-
withTimeout(
|
|
9465
|
-
inFlight.promise,
|
|
9466
|
-
3e4,
|
|
9467
|
-
SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh
|
|
9468
|
-
),
|
|
9469
|
-
getTransportClosedReject(entry)
|
|
9470
|
-
]);
|
|
9471
|
-
return { refreshed: 1, failed: 0 };
|
|
9781
|
+
await refreshSession(entry, refreshBootstrap);
|
|
9782
|
+
return { refreshed: 1, failed: 0, entry, refreshBootstrap };
|
|
9472
9783
|
} catch (err) {
|
|
9473
9784
|
writeServeDebugLine(
|
|
9474
9785
|
`refreshExtensions: session ${entry.sessionId} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
9475
9786
|
);
|
|
9476
|
-
return { refreshed: 0, failed: 1 };
|
|
9787
|
+
return { refreshed: 0, failed: 1, entry, refreshBootstrap };
|
|
9788
|
+
}
|
|
9789
|
+
})
|
|
9790
|
+
);
|
|
9791
|
+
await Promise.all(
|
|
9792
|
+
results.filter((result) => result.failed > 0 && result.refreshBootstrap).map(async (failedBootstrap) => {
|
|
9793
|
+
const retry = results.find(
|
|
9794
|
+
(result) => result.refreshed > 0 && result.entry.connection === failedBootstrap.entry.connection
|
|
9795
|
+
);
|
|
9796
|
+
if (!retry) return;
|
|
9797
|
+
try {
|
|
9798
|
+
await refreshSession(retry.entry, true);
|
|
9799
|
+
} catch (err) {
|
|
9800
|
+
writeServeDebugLine(
|
|
9801
|
+
`refreshExtensions: bootstrap retry via session ${retry.entry.sessionId} failed: ${err instanceof Error ? err.message : String(err)}`
|
|
9802
|
+
);
|
|
9477
9803
|
}
|
|
9478
9804
|
})
|
|
9479
9805
|
);
|
|
@@ -9910,7 +10236,24 @@ function createAcpSessionBridge(opts) {
|
|
|
9910
10236
|
if (signal?.aborted) {
|
|
9911
10237
|
return { exitCode: null, output: "", aborted: true };
|
|
9912
10238
|
}
|
|
9913
|
-
|
|
10239
|
+
let abortResolve;
|
|
10240
|
+
const onAbort = /* @__PURE__ */ __name(() => abortResolve?.(), "onAbort");
|
|
10241
|
+
try {
|
|
10242
|
+
await Promise.race([
|
|
10243
|
+
entry.cwdChangeQueue,
|
|
10244
|
+
new Promise((resolve2) => {
|
|
10245
|
+
abortResolve = resolve2;
|
|
10246
|
+
if (signal?.aborted) return resolve2();
|
|
10247
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
10248
|
+
})
|
|
10249
|
+
]);
|
|
10250
|
+
} finally {
|
|
10251
|
+
signal?.removeEventListener("abort", onAbort);
|
|
10252
|
+
}
|
|
10253
|
+
if (signal?.aborted) {
|
|
10254
|
+
return { exitCode: null, output: "", aborted: true };
|
|
10255
|
+
}
|
|
10256
|
+
const cwd = entry.effectiveCwd;
|
|
9914
10257
|
entry.events.publish({
|
|
9915
10258
|
type: "user_shell_command",
|
|
9916
10259
|
data: { sessionId, command, cwd },
|
|
@@ -10398,6 +10741,22 @@ function createAcpSessionBridge(opts) {
|
|
|
10398
10741
|
}
|
|
10399
10742
|
return response;
|
|
10400
10743
|
},
|
|
10744
|
+
async addSessionRuntimeMcpServer(sessionId, name, config, originatorClientId) {
|
|
10745
|
+
return requestSessionStatus(
|
|
10746
|
+
sessionId,
|
|
10747
|
+
SERVE_CONTROL_EXT_METHODS.sessionMcpRuntimeAdd,
|
|
10748
|
+
{ name, config, originatorClientId },
|
|
10749
|
+
MCP_RESTART_SERVER_DEADLINE_MS
|
|
10750
|
+
);
|
|
10751
|
+
},
|
|
10752
|
+
async removeSessionRuntimeMcpServer(sessionId, name, originatorClientId) {
|
|
10753
|
+
return requestSessionStatus(
|
|
10754
|
+
sessionId,
|
|
10755
|
+
SERVE_CONTROL_EXT_METHODS.sessionMcpRuntimeRemove,
|
|
10756
|
+
{ name, originatorClientId },
|
|
10757
|
+
MCP_RESTART_SERVER_DEADLINE_MS
|
|
10758
|
+
);
|
|
10759
|
+
},
|
|
10401
10760
|
async killSession(sessionId, opts2) {
|
|
10402
10761
|
const entry = byId.get(sessionId);
|
|
10403
10762
|
if (!entry) return false;
|
|
@@ -10583,13 +10942,22 @@ function createAcpSessionBridge(opts) {
|
|
|
10583
10942
|
() => void 0,
|
|
10584
10943
|
() => void 0
|
|
10585
10944
|
) : Promise.resolve();
|
|
10586
|
-
await Promise.
|
|
10587
|
-
...channels.map((ci) => ci.channel.kill()
|
|
10588
|
-
})),
|
|
10945
|
+
const teardownResults = await Promise.allSettled([
|
|
10946
|
+
...channels.map((ci) => ci.channel.kill()),
|
|
10589
10947
|
...inFlightSessionAwaits,
|
|
10590
10948
|
...inFlightRestoreAwaits,
|
|
10591
10949
|
inFlightChannelAwait
|
|
10592
10950
|
]);
|
|
10951
|
+
const teardownFailures = teardownResults.flatMap(
|
|
10952
|
+
(result) => result.status === "rejected" ? [result.reason] : []
|
|
10953
|
+
);
|
|
10954
|
+
if (teardownFailures.length === 1) throw teardownFailures[0];
|
|
10955
|
+
if (teardownFailures.length > 1) {
|
|
10956
|
+
throw new AggregateError(
|
|
10957
|
+
teardownFailures,
|
|
10958
|
+
"ACP bridge shutdown failed"
|
|
10959
|
+
);
|
|
10960
|
+
}
|
|
10593
10961
|
})().then(resolveShutdown, rejectShutdown);
|
|
10594
10962
|
return shutdownPromise;
|
|
10595
10963
|
},
|
|
@@ -10628,6 +10996,7 @@ var createHttpAcpBridge = createAcpSessionBridge;
|
|
|
10628
10996
|
export {
|
|
10629
10997
|
SessionArtifactValidationError,
|
|
10630
10998
|
SessionArtifactAuthorizationError,
|
|
10999
|
+
SESSION_SOURCE_META_KEY,
|
|
10631
11000
|
parseSessionSource,
|
|
10632
11001
|
extractErrorMessage,
|
|
10633
11002
|
extractErrorCode,
|