@qwen-code/qwen-code 0.22.2-preview.1 → 0.22.3-nightly.20260829.e5cb60ad48
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/computer-use/SKILL.md +3 -3
- package/bundled/goal-draft/SKILL.md +109 -0
- package/bundled/qc-helper/docs/configuration/settings.md +37 -36
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/dws.md +2 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +34 -3
- package/bundled/qc-helper/docs/features/code-review.md +3 -3
- package/bundled/qc-helper/docs/features/commands.md +2 -1
- package/bundled/qc-helper/docs/features/computer-use.md +2 -2
- package/bundled/qc-helper/docs/features/goals.md +58 -0
- package/bundled/qc-helper/docs/features/headless.md +13 -11
- package/bundled/qc-helper/docs/features/status-line.md +3 -3
- package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
- package/bundled/qc-helper/docs/qwen-serve.md +1 -1
- package/bundled/review/SKILL.md +81 -31
- package/bundled/review/references/persistence.md +7 -3
- package/bundled/review/references/posting.md +10 -4
- package/chunks/MaxSizedBox-JK4LFKJ3.js +111 -0
- package/chunks/{StandaloneSessionPicker-5D2L22SF.js → StandaloneSessionPicker-UA2MQCCS.js} +83 -84
- package/chunks/{acpAgent-4DCKLA32.js → acpAgent-ZKIVHQKW.js} +1159 -360
- package/chunks/{agent-B4AFZL6H.js → agent-Z3Q5C3RX.js} +46 -47
- package/chunks/agent-headless-BIVZ3KYZ.js +86 -0
- package/chunks/{anthropicContentGenerator-U76GTVB6.js → anthropicContentGenerator-YVTB6QX7.js} +46 -50
- package/chunks/{artifact-tool-XDJCZZCF.js → artifact-tool-XSMPHZBT.js} +11 -3
- package/chunks/{askUserQuestion-ZXXERLEV.js → askUserQuestion-66I3U2QX.js} +31 -7
- package/chunks/bridge-KDQTHAR7.js +120 -0
- package/chunks/{channel-management-service-HXXS3HOZ.js → channel-management-service-HQ6KDS7C.js} +6 -6
- package/chunks/channel-settings-store-X4WWBVYW.js +121 -0
- package/chunks/{channel-worker-group-EVDC2P4K.js → channel-worker-group-6NA6BBZV.js} +8 -7
- package/chunks/{channel-worker-manager-IJJZHGEI.js → channel-worker-manager-NEZ2J6RK.js} +10 -8
- package/chunks/{channel-worker-supervisor-YSKB5GVB.js → channel-worker-supervisor-FKU7DIHJ.js} +6 -5
- package/chunks/{chunk-7QGEJI7M.js → chunk-23RFD54N.js} +1 -1
- package/chunks/{chunk-7DPKPBOQ.js → chunk-2AEHQRY2.js} +2 -2
- package/chunks/{chunk-LJP2BBMK.js → chunk-2SXSLSQE.js} +4 -4
- package/chunks/chunk-2TNL5KPM.js +49 -0
- package/chunks/chunk-36LGBEM6.js +130 -0
- package/chunks/{chunk-QR4AHMGQ.js → chunk-3CAI35FS.js} +13 -13
- package/chunks/{chunk-ZWKGZB2K.js → chunk-3JXM2CVW.js} +3 -3
- package/chunks/{chunk-CZFQ62RM.js → chunk-3WJLDA3X.js} +4 -4
- package/chunks/{chunk-ILPXSKGQ.js → chunk-3WK3QDNV.js} +2 -2
- package/chunks/{chunk-IKN3IUJP.js → chunk-3XKLXHGK.js} +17 -9
- package/chunks/{chunk-ZLTEQYNC.js → chunk-42IDLQWS.js} +26 -20
- package/chunks/{chunk-7UJTY5V3.js → chunk-44LKG3IY.js} +1 -1
- package/chunks/chunk-4CMJKUND.js +95 -0
- package/chunks/{chunk-77TOMRBG.js → chunk-4K7KNVWH.js} +3 -3
- package/chunks/{chunk-SQPOJ4ZI.js → chunk-4NDLQAY2.js} +27 -270
- package/chunks/{chunk-V3GINY6K.js → chunk-4QHPPXK2.js} +16 -8
- package/chunks/chunk-4VQBQLIZ.js +293 -0
- package/chunks/{chunk-FJAITR4L.js → chunk-5CALJAH7.js} +2 -2
- package/chunks/{chunk-TDQBVEPK.js → chunk-5SBVOOA2.js} +10 -8
- package/chunks/{chunk-R7G7GKOX.js → chunk-5ZJL3AIV.js} +3 -3
- package/chunks/{chunk-UCSV2IZW.js → chunk-62GQFYID.js} +3 -3
- package/chunks/{chunk-SLEWBQWM.js → chunk-6DIGWMGT.js} +2 -2
- package/chunks/{chunk-BRVWYMKV.js → chunk-6MBXY6WM.js} +1 -1
- package/chunks/{chunk-PVBT5QPD.js → chunk-6PJOTWAN.js} +1 -1
- package/chunks/{chunk-5CMWFBML.js → chunk-6XOIV7MI.js} +1 -1
- package/chunks/{chunk-ELY4QVIB.js → chunk-7EQQR46F.js} +1 -1
- package/chunks/{chunk-KGJGEEVR.js → chunk-7FA2II6K.js} +10 -1
- package/chunks/chunk-7GUOXWPY.js +2597 -0
- package/chunks/chunk-7J6OTNGO.js +424 -0
- package/chunks/{chunk-DIMEPKCW.js → chunk-7S226YTK.js} +1 -1
- package/chunks/{chunk-2MHGD7EE.js → chunk-A3LWD5MK.js} +1 -1
- package/chunks/{chunk-E4I5MVBR.js → chunk-ABS25QER.js} +1 -1
- package/chunks/{chunk-F7M6ZFGU.js → chunk-AMLXTTJJ.js} +8 -8
- package/chunks/{chunk-AA7VBRBG.js → chunk-ARF6IJHM.js} +8 -8
- package/chunks/{chunk-NEZZHGEI.js → chunk-AYFA7MZV.js} +6 -6
- package/chunks/{chunk-XMSMTU6H.js → chunk-B42A5ZHA.js} +4 -4
- package/chunks/{chunk-FVDQ5E67.js → chunk-B466ZSHZ.js} +3 -3
- package/chunks/{chunk-6US7BF3G.js → chunk-B5PHIJGI.js} +183 -5
- package/chunks/{chunk-4TPAG3O7.js → chunk-BFPESSTR.js} +1 -1
- package/chunks/{chunk-5URK47RN.js → chunk-BFYGL2XL.js} +11629 -10405
- package/chunks/{chunk-66GIFJ63.js → chunk-BIJEBAAQ.js} +1 -1
- package/chunks/{chunk-WBT3STGU.js → chunk-BKWNKLZB.js} +20 -20
- package/chunks/{chunk-T45CL2NT.js → chunk-BOWFGCEU.js} +3 -3
- package/chunks/{chunk-GTUZ3R6I.js → chunk-BP5PTNCU.js} +357 -117
- package/chunks/{chunk-IPQA4SR5.js → chunk-BWORX6FA.js} +1 -1
- package/chunks/{chunk-BKDAF7ES.js → chunk-BXDAPVQU.js} +2 -2
- package/chunks/{chunk-ZEADBZLO.js → chunk-C2X7KY45.js} +3 -3
- package/chunks/{chunk-7OBH4AM2.js → chunk-CAJTKR6W.js} +5 -5
- package/chunks/{chunk-2FN2HNTI.js → chunk-CFJY4DGX.js} +2 -2
- package/chunks/{chunk-W2WRNJKX.js → chunk-CLWO3B77.js} +6 -6
- package/chunks/{chunk-U45D46O5.js → chunk-CMHFCLBU.js} +1 -1
- package/chunks/{chunk-LRKMQPMD.js → chunk-CQH5KTKC.js} +1 -1
- package/chunks/{chunk-TR7G7XFQ.js → chunk-CVUBULIX.js} +5 -5
- package/chunks/{chunk-MCKJTBZN.js → chunk-CWQZUDB7.js} +2 -2
- package/chunks/{chunk-JECO75XD.js → chunk-D5LUXLUH.js} +2 -2
- package/chunks/chunk-DJBQCO2E.js +842 -0
- package/chunks/{chunk-BQBUZDDH.js → chunk-DJECZIJX.js} +42 -42
- package/chunks/{chunk-VYWCFWI5.js → chunk-DMLVSW7L.js} +542 -654
- package/chunks/{chunk-EB4VDXNI.js → chunk-DYXFD5RO.js} +182 -3
- package/chunks/{chunk-ZKAZP2ZG.js → chunk-EB6QRGHM.js} +3 -3
- package/chunks/{chunk-XIRDDFRS.js → chunk-ECE3UYVO.js} +5266 -6055
- package/chunks/{chunk-3UZCLCXR.js → chunk-EKSCLBBF.js} +3 -3
- package/chunks/{chunk-624NHDGB.js → chunk-ERFDKH32.js} +11 -0
- package/chunks/{chunk-3JKUX4PB.js → chunk-F5RB4S23.js} +9 -9
- package/chunks/{chunk-VBF4KZRQ.js → chunk-FIKYKQOO.js} +1 -1
- package/chunks/{chunk-DID6IRGC.js → chunk-FKET6VOO.js} +56 -39
- package/chunks/{chunk-4K44OMLI.js → chunk-FROAFEFB.js} +3 -3
- package/chunks/{chunk-MZS7GEC7.js → chunk-FTF2YIZ5.js} +1 -1
- package/chunks/{chunk-Z7VOMGDC.js → chunk-FTJMWDND.js} +0 -24
- package/chunks/{chunk-ZJG323IA.js → chunk-G6FECKTJ.js} +7 -5
- package/chunks/{chunk-H3HZ4AWW.js → chunk-GIHXH2KO.js} +1 -1
- package/chunks/{chunk-ZGWDHSUM.js → chunk-H4LCV44K.js} +4 -4
- package/chunks/{chunk-OLS3MAXQ.js → chunk-H5WQZTAW.js} +15 -9
- package/chunks/chunk-H72BQNM3.js +645 -0
- package/chunks/{chunk-Z4X5MTRT.js → chunk-HCOBAG2L.js} +2 -4
- package/chunks/{chunk-ATLGYSYH.js → chunk-HHQJANFM.js} +4 -4
- package/chunks/{chunk-7JPW6IYH.js → chunk-HVC3PNVC.js} +1 -1
- package/chunks/{chunk-OI2DR6QB.js → chunk-I6LYRJPB.js} +3 -3
- package/chunks/{chunk-E55H6BZ7.js → chunk-ICURCKIU.js} +1335 -119
- package/chunks/{chunk-2YDYDDE2.js → chunk-IJMEPQ5N.js} +3 -3
- package/chunks/{chunk-PAJGKZAA.js → chunk-ISKH4QX3.js} +14 -12
- package/chunks/{chunk-VOEMVOM4.js → chunk-IZDKYNKN.js} +2 -2
- package/chunks/{chunk-FCSWZAS3.js → chunk-J7SS77YW.js} +5 -5
- package/chunks/{chunk-AYVIGUUK.js → chunk-JB4JIVTJ.js} +1 -1
- package/chunks/chunk-JCMS65DJ.js +1584 -0
- package/chunks/{chunk-BHTJAO36.js → chunk-JHDPOPQG.js} +7 -7
- package/chunks/{chunk-FN5C6C7G.js → chunk-JHYH6PYQ.js} +192 -478
- package/chunks/{chunk-T6OODF2U.js → chunk-JWALNCLT.js} +1 -1
- package/chunks/{chunk-KQYW2GB5.js → chunk-JWDMKJG5.js} +6 -6
- package/chunks/{chunk-SKNVVYIJ.js → chunk-K5KXUXWC.js} +3 -3
- package/chunks/{chunk-TFV4RXPU.js → chunk-K6CTN5TU.js} +1 -1
- package/chunks/{chunk-X3XGCJ32.js → chunk-KEIMKAM4.js} +28 -111
- package/chunks/{chunk-XUX6O2ZT.js → chunk-KID24ZFN.js} +4 -1
- package/chunks/{chunk-I6DY753S.js → chunk-KJO2LBUK.js} +944 -18
- package/chunks/{chunk-5T4LWWNX.js → chunk-KYWTPLBJ.js} +18 -21
- package/chunks/chunk-LGO7DEXL.js +1186 -0
- package/chunks/{chunk-TOF4UZHH.js → chunk-LUEHOUHM.js} +3 -3
- package/chunks/{chunk-GNMJNDZE.js → chunk-M6FOJXW3.js} +1 -1
- package/chunks/{chunk-JLU3FPQR.js → chunk-MAQ2W4IF.js} +5 -5
- package/chunks/{chunk-K3LPAED5.js → chunk-MQM5PJML.js} +24 -4
- package/chunks/{chunk-AKQA3WCH.js → chunk-MVDPFLWM.js} +723 -3399
- package/chunks/{chunk-5PA6UEYA.js → chunk-MZCJWS5Y.js} +1 -1
- package/chunks/{chunk-BGXZBI5B.js → chunk-N4X7G4J2.js} +2 -1
- package/chunks/{chunk-WXDZZFH3.js → chunk-NEBSNUMX.js} +6 -6
- package/chunks/{chunk-J3CBIEDS.js → chunk-NENQE7VH.js} +32 -15
- package/chunks/{chunk-TMGAS5TO.js → chunk-NHDNYMBU.js} +26 -4
- package/chunks/{chunk-27ONXAFY.js → chunk-NIFYWDYN.js} +1 -1
- package/chunks/{chunk-IJVDHPKD.js → chunk-NU7RKEZR.js} +2 -2
- package/chunks/{chunk-CDUN63IN.js → chunk-OJEMXKA4.js} +3 -3
- package/chunks/{chunk-RRKNX553.js → chunk-PDQGMSZK.js} +1 -1
- package/chunks/{chunk-R3T33BG5.js → chunk-PI6HYGBE.js} +3 -3
- package/chunks/{chunk-5SM2AK65.js → chunk-PO6YCWIQ.js} +5 -5
- package/chunks/{chunk-GTUKW3I6.js → chunk-PPKZ7JOE.js} +1 -1
- package/chunks/{chunk-SAH4BD2J.js → chunk-PQEISIKS.js} +67 -0
- package/chunks/{chunk-ALTQLFEG.js → chunk-PQZBDDNG.js} +5 -194
- package/chunks/{chunk-WEGXPP5E.js → chunk-QFCDF5PL.js} +1 -1
- package/chunks/{chunk-DEYPMJPD.js → chunk-QJNDUTOL.js} +45 -239
- package/chunks/{chunk-OF2DPXUS.js → chunk-QYMAKPY5.js} +119 -24
- package/chunks/{chunk-JVPFTDBK.js → chunk-RFIDDFAL.js} +1 -1
- package/chunks/chunk-RKFGE7JH.js +93 -0
- package/chunks/{chunk-CPPYZHBN.js → chunk-RU7BK6B3.js} +1 -1
- package/chunks/{chunk-KPF2K55D.js → chunk-RZKOA4JE.js} +39 -8
- package/chunks/{chunk-AWFZDYSD.js → chunk-SEDFP3ZI.js} +1 -1
- package/chunks/chunk-SEONHUS3.js +275 -0
- package/chunks/chunk-SS4MRMKE.js +3525 -0
- package/chunks/{chunk-BPMVPWBT.js → chunk-SS5SDCD3.js} +6 -6
- package/chunks/{chunk-J5352S3S.js → chunk-ST5V3ZOC.js} +3 -3
- package/chunks/{chunk-7CWEZQ6T.js → chunk-STUJ7IMZ.js} +0 -77
- package/chunks/{chunk-4K7NQDCG.js → chunk-T4EFG2P5.js} +18 -9
- package/chunks/{chunk-TWSKM647.js → chunk-T7KMERIX.js} +1 -1
- package/chunks/{chunk-HPECDZ6X.js → chunk-TGJ2PKCW.js} +4341 -1408
- package/chunks/{chunk-EC5BONC3.js → chunk-TPI7O7HR.js} +1 -1
- package/chunks/{chunk-T2CRBIDJ.js → chunk-TTX2JUE6.js} +1 -1
- package/chunks/{chunk-AP7WZONS.js → chunk-TU6WVK67.js} +19 -9
- package/chunks/chunk-U54AYGEC.js +337 -0
- package/chunks/{chunk-3WBMPR3S.js → chunk-UAOTD2BN.js} +1 -1
- package/chunks/{chunk-2NNTE2ED.js → chunk-UHQFIS7N.js} +15 -0
- package/chunks/{chunk-SUE2ZMUH.js → chunk-UI4DXRZW.js} +49 -31
- package/chunks/{chunk-76WGY6LW.js → chunk-URE3QBBB.js} +3 -3
- package/chunks/{chunk-KOJ6MHD5.js → chunk-UTLCH2FK.js} +1 -1
- package/chunks/chunk-UVY67MSH.js +205 -0
- package/chunks/{chunk-FJWICLG7.js → chunk-V4264FEG.js} +9 -9
- package/chunks/{chunk-XR7OIAQF.js → chunk-V5J4J5TP.js} +2 -2
- package/chunks/{chunk-Z6L3C4VF.js → chunk-VBCPNIQD.js} +39 -39
- package/chunks/{chunk-HABT2Z7R.js → chunk-VKCJPNGU.js} +4 -4
- package/chunks/{chunk-UCQOSV6A.js → chunk-VKIGT4OG.js} +3 -3
- package/chunks/{chunk-JSY43GMI.js → chunk-VNMZLAVG.js} +185 -174
- package/chunks/{chunk-X2UOOG5V.js → chunk-VQUGEVGR.js} +1 -1
- package/chunks/{chunk-XJS54K4A.js → chunk-VTHREBQM.js} +2 -2
- package/chunks/{chunk-PTQF7WRA.js → chunk-W3CY4QIO.js} +6 -6
- package/chunks/{chunk-LWLEPXKK.js → chunk-W4XG7IZ4.js} +19 -2
- package/chunks/{chunk-IOGKXPL3.js → chunk-W7HH77GN.js} +6 -6
- package/chunks/{chunk-FPH6TXD3.js → chunk-WAOIHTJS.js} +1 -1
- package/chunks/{chunk-3D6PDLNJ.js → chunk-WD3WSEW3.js} +49 -32
- package/chunks/chunk-WLEYH7CD.js +332 -0
- package/chunks/{chunk-JLGFGPZJ.js → chunk-WNPDGUJO.js} +22 -3
- package/chunks/{chunk-O3BUXIPM.js → chunk-WXEA74YB.js} +3 -3
- package/chunks/{chunk-YRLW2MSX.js → chunk-XBVNNDPK.js} +11 -4
- package/chunks/{chunk-VL4YX3FH.js → chunk-XF63PKEN.js} +1 -1
- package/chunks/{chunk-3FSBMAYD.js → chunk-XQFT3QUF.js} +1 -1
- package/chunks/{chunk-5JCZ3UKB.js → chunk-Y5S7LBOZ.js} +44 -7
- package/chunks/{chunk-WZ3QKPMQ.js → chunk-YN44TEOZ.js} +19 -31
- package/chunks/{chunk-2SERYG4T.js → chunk-YTDVNSUQ.js} +1 -1
- package/chunks/{chunk-UWICO5KN.js → chunk-Z44FUM77.js} +3 -3
- package/chunks/{chunk-OT4YKUUV.js → chunk-ZU4UDIWX.js} +2 -2
- package/chunks/{chunk-L436XFLJ.js → chunk-ZZUKP7HV.js} +1 -1
- package/chunks/config-utils-NOCNFTQP.js +114 -0
- package/chunks/contextCommand-DH2NOQBI.js +107 -0
- package/chunks/{core-runtime-CEJRHCRF.js → core-runtime-OLW4OXMV.js} +61 -62
- package/chunks/{create-sub-session-RVHSWVAP.js → create-sub-session-23ITIELI.js} +3 -3
- package/chunks/{create-sub-session-DFZVIG56.js → create-sub-session-ZCGPQTIE.js} +166 -86
- package/chunks/{cron-create-IJGVR5R2.js → cron-create-KJ4IY6PP.js} +57 -10
- package/chunks/{cron-delete-4N5BI6GL.js → cron-delete-MBLQCAYY.js} +4 -4
- package/chunks/{cron-list-2CATIPUX.js → cron-list-DWH2PQ47.js} +4 -4
- package/chunks/{daemon-NAYK4XXU.js → daemon-3GNHB3M2.js} +523 -8
- package/chunks/{daemon-git-worktree-guard-L6ZUFKF7.js → daemon-git-worktree-guard-SHIU7MPJ.js} +58 -59
- package/chunks/daemon-status-provider-WECDBDF7.js +118 -0
- package/chunks/daemon-trust-policy-MX4OYXF3.js +113 -0
- package/chunks/{daemon-trust-policy-monitor-2G3EKQEU.js → daemon-trust-policy-monitor-73WXIKNL.js} +66 -67
- package/chunks/deferred-core-runtime-BKS7O3D6.js +115 -0
- package/chunks/{display-image-6KHQNEAE.js → display-image-BE7I6ZB6.js} +5 -5
- package/chunks/{dist-DJBNNPLN.js → dist-4WXLCBDR.js} +1 -1
- package/chunks/{dist-TJUDJTCB.js → dist-5VXFRTWU.js} +280 -48
- package/chunks/{dist-6H6RZ5H6.js → dist-6BPYWHVD.js} +89 -65
- package/chunks/{dist-ZBVOXSKF.js → dist-GFN5DCBX.js} +74 -65
- package/chunks/{dist-SATKXKUR.js → dist-HZNT6GQS.js} +1 -1
- package/chunks/{dist-FVJZSIO4.js → dist-LVZCXVPF.js} +72 -20
- package/chunks/{dist-7CKN54NL.js → dist-N6W6E753.js} +71 -64
- package/chunks/{dist-4Q7NTUNB.js → dist-NSV4NBPK.js} +31 -14
- package/chunks/{dist-UQUFZDIY.js → dist-SWQMYP2Q.js} +18 -16
- package/chunks/earlyInputCapture-5NNZSVL7.js +108 -0
- package/chunks/{edit-ZERGX3RV.js → edit-IGHPT4I2.js} +47 -48
- package/chunks/{en-6MDBWMTG.js → en-YLXBXM4Z.js} +2 -1
- package/chunks/{enter-worktree-UOZ6ZTP7.js → enter-worktree-35QCAAFP.js} +7 -7
- package/chunks/{enterPlanMode-W2RP3P5B.js → enterPlanMode-LVTPJSAA.js} +51 -52
- package/chunks/environment-HC2PPYDO.js +130 -0
- package/chunks/errors-VCWSG25A.js +114 -0
- package/chunks/{exit-worktree-G2QATUCV.js → exit-worktree-XQD6D543.js} +7 -7
- package/chunks/exitPlanMode-RHI2K2O7.js +84 -0
- package/chunks/{fast-path-4MWBCEUF.js → fast-path-IQNCJOPE.js} +7 -7
- package/chunks/{fast-path-settings-XMFBYFUH.js → fast-path-settings-XH426LUU.js} +3 -3
- package/chunks/{glob-DKTNG32L.js → glob-EANAXPNR.js} +46 -47
- package/chunks/{goal-tools-CNVXMSZD.js → goal-tools-PTD3MBA7.js} +10 -8
- package/chunks/{grep-3NLSS32D.js → grep-3REG7TO6.js} +9 -7
- package/chunks/handleAutoUpdate-PVVFLDQ4.js +110 -0
- package/chunks/i18n-VOKX5QIF.js +125 -0
- package/chunks/{image-gen-63NN2H5N.js → image-gen-J6FDGUZP.js} +8 -10
- package/chunks/initializer-SZVVTGZL.js +114 -0
- package/chunks/installationInfo-R22453J5.js +108 -0
- package/chunks/{keychain-token-storage-3MGFRYGM.js → keychain-token-storage-37XPR34V.js} +2 -2
- package/chunks/list-LK5M5W2N.js +117 -0
- package/chunks/{list-agents-EXRSHIDJ.js → list-agents-DI3YFTDT.js} +2 -2
- package/chunks/{gemini-X5GQHQYF.js → llm-6RQJUVIS.js} +120 -115
- package/chunks/{geminiContentGenerator-UDSWXZXL.js → llm-content-generator-Q7JJDSJR.js} +29 -29
- package/chunks/loadedSettingsAdapter-KF2ZPSPG.js +111 -0
- package/chunks/{loggingContentGenerator-73C7TKDK.js → loggingContentGenerator-SBCIJG2J.js} +330 -37
- package/chunks/{loop-wakeup-XBPB2BRO.js → loop-wakeup-XJFONSQ7.js} +5 -5
- package/chunks/{ls-WFONAND2.js → ls-3VAT2J7A.js} +4 -4
- package/chunks/{lsp-DUKPDUXN.js → lsp-5W7IRUBH.js} +2 -2
- package/chunks/{managed-npm-update-H2KOLQZU.js → managed-npm-update-UG324XFY.js} +59 -60
- package/chunks/mcp-PUSCFGS5.js +111 -0
- package/chunks/{monitor-TGCMNJJH.js → monitor-RJW5AP64.js} +46 -47
- package/chunks/nonInteractiveCli-OIXN4WSR.js +187 -0
- package/chunks/{notebook-edit-YEUNZYDX.js → notebook-edit-5MWEIMS2.js} +47 -48
- package/chunks/{open-with-auth-4UI3KHUR.js → open-with-auth-YN3QZHVM.js} +1 -1
- package/chunks/{openaiContentGenerator-J7LD4VSL.js → openaiContentGenerator-AGTNYSCJ.js} +26 -28
- package/chunks/pidfile-LTA6NT3P.js +112 -0
- package/chunks/process-registry-OAEG6WGC.js +662 -0
- package/chunks/{processUtils-ZHFC7CSL.js → processUtils-GY3Q66CJ.js} +2 -2
- package/chunks/prompt-terminal-ledger-3QS6TCMF.js +106 -0
- package/chunks/{qwenContentGenerator-YEWWK3JQ.js → qwenContentGenerator-NU6PCDA7.js} +51 -52
- package/chunks/{qwenOAuth2-JIYAWXTW.js → qwenOAuth2-OF5WRBQT.js} +7 -9
- package/chunks/{read-file-ZQI3WPVK.js → read-file-DTQL5V62.js} +13 -13
- package/chunks/{read-mcp-resource-7A7NFSFL.js → read-mcp-resource-XD257PGJ.js} +2 -2
- package/chunks/{record-artifact-CPJ4IJSD.js → record-artifact-VW23GS4F.js} +4 -4
- package/chunks/{report-findings-VFM5DENC.js → report-findings-AO5VYFLR.js} +9 -5
- package/chunks/{request-shutdown-6IW46GD7.js → request-shutdown-BCLA3JV2.js} +7 -7
- package/chunks/resumeHistoryUtils-PZ4BER55.js +119 -0
- package/chunks/ripGrep-A2FGBZGY.js +39 -0
- package/chunks/{run-qwen-serve-WHWU7NZ6.js → run-qwen-serve-AESOSKFC.js} +371 -357
- package/chunks/{runtime-E7BSPWQP.js → runtime-YQHSEKG4.js} +71 -72
- package/chunks/scheduled-tasks-XG6KK6NY.js +128 -0
- package/chunks/{scheduler-TJPATFOM.js → scheduler-I4WKXWRZ.js} +60 -61
- package/chunks/{sdk-exporters-http-XXSKBD2C.js → sdk-exporters-http-TTU2CHBU.js} +2 -2
- package/chunks/{sdk-impl-VPNBLV7I.js → sdk-impl-UUMVYMAL.js} +11 -5
- package/chunks/{send-message-OXZK6USO.js → send-message-AJ4OCUBV.js} +25 -9
- package/chunks/serve-MQDTVC7X.js +119 -0
- package/chunks/{server-AXCN7QBJ.js → server-L5ETIKEW.js} +6083 -4965
- package/chunks/{session-HO4US3AG.js → session-LKKXRUJM.js} +116 -114
- package/chunks/session-pr-refresh-5OWA6MC2.js +365 -0
- package/chunks/{settings-B2PFJJN4.js → settings-S6KG7JST.js} +65 -66
- package/chunks/shell-JEQE5AHC.js +94 -0
- package/chunks/{skill-NL3VH562.js → skill-QEGMZXKI.js} +68 -24
- package/chunks/skill-settings-EVY7QF4H.js +119 -0
- package/chunks/spawnChannel-AQP72WPN.js +113 -0
- package/chunks/standalone-update-JUJA4BKV.js +119 -0
- package/chunks/{startInteractiveUI-G2XKSCQ7.js → startInteractiveUI-5ZMSJZ3J.js} +3081 -2477
- package/chunks/{stdioHelpers-7A2EE64Z.js → stdioHelpers-AY6XCDY2.js} +3 -1
- package/chunks/{syntheticOutput-5AJ444QT.js → syntheticOutput-ML43GEFN.js} +3 -3
- package/chunks/{task-create-TY7P6UHG.js → task-create-QN4LYRSE.js} +11 -11
- package/chunks/{task-list-BELMPA75.js → task-list-JPLGK45U.js} +5 -5
- package/chunks/{task-stop-U3S3KZG2.js → task-stop-CXEH5L2D.js} +2 -2
- package/chunks/{task-update-O4IGDPCK.js → task-update-IWEOJFV2.js} +11 -11
- package/chunks/{team-create-IYBUOORE.js → team-create-ZEGP7KVD.js} +46 -47
- package/chunks/{team-delete-YWFXX77L.js → team-delete-RZVVSGCY.js} +5 -5
- package/chunks/{team-plan-approval-YKU57LBM.js → team-plan-approval-SXWT2WZN.js} +46 -47
- package/chunks/terminal-image-renderer-42B6N55E.js +115 -0
- package/chunks/theme-manager-DDYUBC25.js +103 -0
- package/chunks/{todoWrite-435EO2CS.js → todoWrite-WDJNQEMW.js} +43 -25
- package/chunks/{tool-search-4Q3KASIQ.js → tool-search-GDDBA4X4.js} +22 -22
- package/chunks/total-session-admission-6MYP4GBA.js +115 -0
- package/chunks/trustedFolders-LPEIY3GE.js +123 -0
- package/chunks/{types-WYCFCEHR.js → types-HKLPXZB3.js} +1 -3
- package/chunks/{update-relaunch-4DC2KKFS.js → update-relaunch-BOIIZNT3.js} +6 -6
- package/chunks/updateCheck-KSVHYJYE.js +119 -0
- package/chunks/useAutoAcceptIndicator-43D2A4ZN.js +121 -0
- package/chunks/{validateNonInterActiveAuth-YAE4YPO3.js → validateNonInterActiveAuth-WSD4SOIM.js} +108 -106
- package/chunks/{version-QFP7OGWX.js → version-B4CM7RNG.js} +1 -1
- package/chunks/{web-fetch-6T23IK6Q.js → web-fetch-MOHILUZL.js} +16 -18
- package/chunks/{web-search-WBWTCZK2.js → web-search-G4HIMY2V.js} +9 -11
- package/chunks/{web-shell-static-A6QMUNNV.js → web-shell-static-HNB4FDOE.js} +2 -2
- package/chunks/{workflow-FMAA3D4R.js → workflow-H3PCYU5F.js} +130 -95
- package/chunks/workspace-providers-status-AAX7VWMT.js +115 -0
- package/chunks/{workspace-registration-store-CMMX7EPX.js → workspace-registration-store-YTHZ6SL4.js} +1 -1
- package/chunks/workspace-registry-URHGBL4U.js +124 -0
- package/chunks/workspace-service-XJMSLRCU.js +127 -0
- package/chunks/workspace-skills-status-JGEDANNT.js +114 -0
- package/chunks/{workspace-trust-reconciler-PJDQUTJL.js → workspace-trust-reconciler-ZHI5TDYB.js} +74 -73
- package/chunks/write-file-5O4S63L6.js +89 -0
- package/chunks/{zh-TW-MV4FWFB6.js → zh-TW-RPTMRTHG.js} +2 -1
- package/chunks/{zh-X3WGU6SI.js → zh-UNY63FR3.js} +2 -1
- package/chunks/{zoom-image-WVYVFRXF.js → zoom-image-N2IBUVXE.js} +13 -13
- package/cli.js +130 -93
- package/locales/en.js +2 -0
- package/locales/zh-TW.js +2 -0
- package/locales/zh.js +2 -0
- package/package.json +3 -3
- package/web-shell/assets/{abnfDiagram-VCTEODGH-d-8xa8uz.js → abnfDiagram-VCTEODGH-OJQpqC9m.js} +1 -1
- package/web-shell/assets/{arc-BhB7CrGK.js → arc-BxH0YR17.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BDCd_IcJ.js → architectureDiagram-5GKGNRK7-CxyWiGfF.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-C-AHu6mi.js → blockDiagram-NRAW4CY4-DukXbJQ7.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-CFjQt0vl.js → c4Diagram-UCG6FXSJ-DvS1T6pK.js} +1 -1
- package/web-shell/assets/channel-Dbbg7P-u.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-DRjwqaDq.js → chunk-2Q5K7J3B-qvqfJ7VZ.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-eHM9noJE.js → chunk-5VM5RSS4-BJ3kJYte.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-CcSWUYn1.js → chunk-F27PBJKO-BYPVESil.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-DNr-RF5S.js → chunk-G27WJ6UU-B4UYFElk.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-rVJHoNF8.js → chunk-JWPE2WC7-8zGKVNUU.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-B2aX0Gzy.js → chunk-LCL6LL3I-CbaHONpI.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-DVp07n32.js → chunk-POPQ4Y6H-f8kAjzlF.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-C6QB_KUr.js → chunk-SVP7TREG-Dm8ahq7K.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-CLVxDNCy.js → chunk-XXDRQBXY-yrcLzv8z.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-cDYs8iT0.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-cDYs8iT0.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-B_aKX3A3.js → cose-bilkent-JH36ORCC-DN1C22IH.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-BBw2pPUa.js → cynefin-OW5HDTMX-B2oF7XD_.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-WWPiBTwk.js → cynefinDiagram-5FMLGOSQ-DGgIKpiM.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-CPtIdka-.js → dagre-3AP2YEHR-BHKawzoP.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-Dj5og1Xi.js → diagram-S7CK7UJ4-6UgKqreR.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-CC_x70YC.js → diagram-UQ7AKVKN-BXJbPJ6F.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-rXMfsO4n.js → diagram-VSXAHHWV-DVnYFPkS.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-DEmLYQbh.js → diagram-VX7I27RA-CjBoC0Rq.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-B0ys6Vxx.js → diagram-Z3DM3KII-KZdUceQT.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-Bq6y6lKH.js → ebnfDiagram-PWID7BFC-5UekGScM.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-l69JeBZ4.js → erDiagram-SSCWMZ5O-TRWexoj1.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-Cm-EzGY4.js → flowDiagram-A5DVABFB-Di5bhBVo.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BRS9ZOp7.js → ganttDiagram-EL5Y4UJY-DpJUJ8Dp.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-DAMRKgLk.js → gitGraphDiagram-WWUBYQGX-b08xIx2C.js} +1 -1
- package/web-shell/assets/index-BvDpDHTN.css +36 -0
- package/web-shell/assets/index-Cg60lhnI.js +1913 -0
- package/web-shell/assets/{index-Bncx8E8M.js → index-n6dFH09O.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-DasffaZp.js → infoDiagram-RXCK75RN-Cz14FAt7.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CmRUt3C-.js → ishikawaDiagram-5VMMS53U-7nxp2bIU.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL-DzhE_c1Z.js → journeyDiagram-EYS64GPL-CjL47fk0.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-BH5b6nn3.js → kanban-definition-3QL26DDD-CWFl-mHs.js} +1 -1
- package/web-shell/assets/{layout-BxoLK-LY.js → layout-BUP1BcwB.js} +1 -1
- package/web-shell/assets/{linear-CqDPvVI7.js → linear-CqbwqSbW.js} +1 -1
- package/web-shell/assets/{mermaid.core-DBoN4plo.js → mermaid.core-C_50HLol.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-DJJtXPEM.js → mindmap-definition-FBJOCRG2-DbyD_AoU.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-DmgPXP5l.js → pegDiagram-XKGWAZYB-VozWyqyY.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-1ezjzcI5.js → pieDiagram-E7YTZNPT-O7EKamBL.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-ChKARz3k.js → quadrantDiagram-AXDQQJYC-DOmPZxHg.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-k7mNB_QT.js → railroadDiagram-O6MQD6OU-ElyfC2zE.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-B0XFsii0.js → requirementDiagram-EFPCY7ZU-DbnqPbzR.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-repJ2Ukk.js → sankeyDiagram-P5KCCOFB-yPWliSHr.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-D0gUSKGu.js → sequenceDiagram-WJ2MYXX4-BImQFomC.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-CE463F74.js → sizeCapture-X5ZJPWSS-DEvqeEHo.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-003zYtJa.js → stateDiagram-HBIQ2CUA-BbLtiF9u.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DGtlzdpx.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-DBj8MFpu.js → swimlanes-XN3QIQJK-RFewDF6v.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-CITCVFdx.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-D2aCh4a9.js → timeline-definition-24CTP7MA-DF4L3-UR.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-BHMfWBpl.js → vennDiagram-4TSXK5OY-BtlSJXaA.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-RdHAj66j.js → wardleyDiagram-VM6X3IG4-C8ogG8Fh.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-BgJWOvq0.js → xychartDiagram-S5SC5T6Z-C5QVfsGQ.js} +1 -1
- package/web-shell/index.html +3 -3
- package/chunks/MaxSizedBox-BFVLZP2E.js +0 -112
- package/chunks/agent-headless-UCBCS4V4.js +0 -87
- package/chunks/bridge-FRNYLYY7.js +0 -119
- package/chunks/channel-settings-store-IV4KDL7N.js +0 -117
- package/chunks/chunk-I6VVOZDK.js +0 -202
- package/chunks/chunk-JS73NNWF.js +0 -30
- package/chunks/chunk-K2OJUPOE.js +0 -78
- package/chunks/chunk-P3QQPMQA.js +0 -19
- package/chunks/chunk-SDVF6A42.js +0 -945
- package/chunks/chunk-T26EAKDL.js +0 -13
- package/chunks/chunk-VGHZT6JR.js +0 -51
- package/chunks/config-utils-PMX4QZ5Y.js +0 -113
- package/chunks/contextCommand-NZRLVAFC.js +0 -108
- package/chunks/daemon-status-provider-FTTYZEKN.js +0 -118
- package/chunks/daemon-trust-policy-WMGFPA3Z.js +0 -114
- package/chunks/deferred-core-runtime-BUFEFYNA.js +0 -116
- package/chunks/earlyInputCapture-ROPLMXA7.js +0 -109
- package/chunks/environment-ZBJ23YVR.js +0 -131
- package/chunks/errors-U5KNAADB.js +0 -115
- package/chunks/exitPlanMode-VFJ5R5DD.js +0 -85
- package/chunks/handleAutoUpdate-W4BUYFT7.js +0 -111
- package/chunks/i18n-KX7FEKJJ.js +0 -126
- package/chunks/initializer-SNVVLS7Y.js +0 -115
- package/chunks/installationInfo-D4XGQNHJ.js +0 -109
- package/chunks/list-WYECMLXZ.js +0 -118
- package/chunks/loadedSettingsAdapter-5WZBXBCR.js +0 -112
- package/chunks/mcp-CBWAROY3.js +0 -112
- package/chunks/nonInteractiveCli-O232UUV7.js +0 -185
- package/chunks/pidfile-MSPQ255Y.js +0 -113
- package/chunks/process-registry-PMJOA5CO.js +0 -172
- package/chunks/prompt-terminal-ledger-YPGMNDXT.js +0 -107
- package/chunks/resumeHistoryUtils-35D4KAVT.js +0 -120
- package/chunks/ripGrep-46N4FLOS.js +0 -39
- package/chunks/serve-WQ54UIYG.js +0 -120
- package/chunks/shell-7XMSANI3.js +0 -95
- package/chunks/skill-settings-SKMN5YXC.js +0 -120
- package/chunks/spawnChannel-NE43EEO3.js +0 -113
- package/chunks/standalone-update-XOCWGXAH.js +0 -120
- package/chunks/terminal-image-renderer-NREKYTAD.js +0 -116
- package/chunks/theme-manager-IJS6OICX.js +0 -104
- package/chunks/total-session-admission-L5RPEFZ2.js +0 -114
- package/chunks/trustedFolders-OILZCHRD.js +0 -124
- package/chunks/updateCheck-AK4COHNK.js +0 -120
- package/chunks/useAutoAcceptIndicator-O2N2Q6KG.js +0 -122
- package/chunks/workspace-providers-status-OCFEWIPQ.js +0 -116
- package/chunks/workspace-registry-WJLZPRTG.js +0 -123
- package/chunks/workspace-service-5ZOBMMIB.js +0 -131
- package/chunks/workspace-skills-status-B6NJZD4B.js +0 -115
- package/chunks/write-file-B2RNX6SU.js +0 -90
- package/web-shell/assets/channel-CU-Zyv0r.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-C0J2_LKs.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-C0J2_LKs.js +0 -1
- package/web-shell/assets/index-C-XlQn24.css +0 -5
- package/web-shell/assets/index-gdvMN4J1.js +0 -1860
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-2uACDdJN.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-C4JJkavU.js +0 -8
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
recomputeMcpGating
|
|
5
|
+
} from "./chunk-MAQ2W4IF.js";
|
|
3
6
|
import {
|
|
4
7
|
classifyApiError,
|
|
5
8
|
fireSessionDeleteHook
|
|
@@ -14,7 +17,7 @@ import {
|
|
|
14
17
|
normalizePartList,
|
|
15
18
|
parseExtensionRef,
|
|
16
19
|
parseMcpServerRef
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PO6YCWIQ.js";
|
|
18
21
|
import {
|
|
19
22
|
getAvailableCommands,
|
|
20
23
|
getSlashCommandFirstToken,
|
|
@@ -23,14 +26,7 @@ import {
|
|
|
23
26
|
isSlashCommand,
|
|
24
27
|
recordDaemonSessionModel,
|
|
25
28
|
restoreSessionModelThenAuthenticate
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import {
|
|
28
|
-
collectContextData,
|
|
29
|
-
formatContextUsageText
|
|
30
|
-
} from "./chunk-WZ3QKPMQ.js";
|
|
31
|
-
import {
|
|
32
|
-
recomputeMcpGating
|
|
33
|
-
} from "./chunk-JLU3FPQR.js";
|
|
29
|
+
} from "./chunk-BP5PTNCU.js";
|
|
34
30
|
import {
|
|
35
31
|
SessionIdConflictError,
|
|
36
32
|
appEvents,
|
|
@@ -38,41 +34,45 @@ import {
|
|
|
38
34
|
cleanupReviewWorktreeLeases,
|
|
39
35
|
loadCliConfig,
|
|
40
36
|
normalizeDisabledToolList
|
|
41
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TGJ2PKCW.js";
|
|
38
|
+
import "./chunk-NYX53SV4.js";
|
|
39
|
+
import {
|
|
40
|
+
collectContextData,
|
|
41
|
+
formatContextUsageText
|
|
42
|
+
} from "./chunk-YN44TEOZ.js";
|
|
42
43
|
import {
|
|
43
44
|
getCommandSubcommandNames
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-FIKYKQOO.js";
|
|
45
46
|
import {
|
|
46
47
|
getEffectiveSupportedModes
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-OJEMXKA4.js";
|
|
49
|
+
import "./chunk-CFJY4DGX.js";
|
|
49
50
|
import "./chunk-4WGODMVR.js";
|
|
50
51
|
import "./chunk-3SH53ANB.js";
|
|
51
|
-
import "./chunk-NYX53SV4.js";
|
|
52
52
|
import {
|
|
53
53
|
isGoalStatusKind
|
|
54
54
|
} from "./chunk-EKTCKZV5.js";
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-PI6HYGBE.js";
|
|
56
|
+
import "./chunk-YAF2MQZ6.js";
|
|
57
|
+
import "./chunk-QFCDF5PL.js";
|
|
57
58
|
import {
|
|
58
59
|
startNonInteractiveOpenAILogHousekeeping
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-3WJLDA3X.js";
|
|
60
61
|
import "./chunk-KW7NOTN6.js";
|
|
62
|
+
import "./chunk-W7HH77GN.js";
|
|
63
|
+
import "./chunk-6H67XLET.js";
|
|
61
64
|
import {
|
|
62
65
|
beginAcpBootstrapConfigProfiling,
|
|
63
66
|
buildAndFreezeAcpStartupProfile,
|
|
64
67
|
endAcpBootstrapConfigProfiling,
|
|
65
68
|
markAcpStartup
|
|
66
69
|
} from "./chunk-5JTIYALA.js";
|
|
67
|
-
import "./chunk-
|
|
68
|
-
import "./chunk-
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import "./chunk-YAF2MQZ6.js";
|
|
70
|
+
import "./chunk-J7SS77YW.js";
|
|
71
|
+
import "./chunk-CVUBULIX.js";
|
|
72
|
+
import "./chunk-UAOTD2BN.js";
|
|
71
73
|
import {
|
|
72
74
|
computeCpuPercent
|
|
73
75
|
} from "./chunk-LBOVL47Y.js";
|
|
74
|
-
import "./chunk-IOGKXPL3.js";
|
|
75
|
-
import "./chunk-6H67XLET.js";
|
|
76
76
|
import {
|
|
77
77
|
GENERATION_MAX_PROMPT_BYTES,
|
|
78
78
|
GENERATION_TIMEOUT_MS,
|
|
@@ -85,9 +85,7 @@ import {
|
|
|
85
85
|
createWorkspaceMemoryExtractionErrorLogger,
|
|
86
86
|
executeGeneration,
|
|
87
87
|
formatWorkspaceMemoryForgetSummary,
|
|
88
|
-
isCompatibleLiveSessionSource,
|
|
89
88
|
isValidServerName,
|
|
90
|
-
normalizeChannelDeliveryText,
|
|
91
89
|
projectAcpToolResultUpdate,
|
|
92
90
|
redactMcpServerSecrets,
|
|
93
91
|
replayTranscriptRecordPage,
|
|
@@ -95,7 +93,7 @@ import {
|
|
|
95
93
|
shouldSuppressRememberErrorDetails,
|
|
96
94
|
workspaceMemoryFailureCode,
|
|
97
95
|
workspaceMemoryFailureDiagnostics
|
|
98
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-PQZBDDNG.js";
|
|
99
97
|
import {
|
|
100
98
|
BaseEmitter,
|
|
101
99
|
HistoryReplayer,
|
|
@@ -106,48 +104,58 @@ import {
|
|
|
106
104
|
hasFullSessionContext,
|
|
107
105
|
observeAcpToolResultProjection,
|
|
108
106
|
observeAcpToolResultWire
|
|
109
|
-
} from "./chunk-
|
|
110
|
-
import "./chunk-
|
|
107
|
+
} from "./chunk-NENQE7VH.js";
|
|
108
|
+
import "./chunk-BFPESSTR.js";
|
|
111
109
|
import "./chunk-E7REAOTN.js";
|
|
112
|
-
import "./chunk-
|
|
110
|
+
import "./chunk-ZZUKP7HV.js";
|
|
113
111
|
import "./chunk-2MIN6GRR.js";
|
|
114
112
|
import "./chunk-QHTIBUWB.js";
|
|
115
113
|
import "./chunk-TXASDT2M.js";
|
|
116
114
|
import {
|
|
117
|
-
|
|
118
|
-
} from "./chunk-
|
|
115
|
+
isCompatibleLiveSessionSource
|
|
116
|
+
} from "./chunk-36LGBEM6.js";
|
|
117
|
+
import "./chunk-4VQBQLIZ.js";
|
|
118
|
+
import {
|
|
119
|
+
DAEMON_OWNED_STANDALONE_CREATION_KEY,
|
|
120
|
+
SESSION_SOURCE_META_KEY,
|
|
121
|
+
isReservedStandaloneSessionSourceType,
|
|
122
|
+
parseSessionSource
|
|
123
|
+
} from "./chunk-2TNL5KPM.js";
|
|
124
|
+
import {
|
|
125
|
+
buildToolWriteOriginMeta,
|
|
126
|
+
getConversationDirectoryName,
|
|
127
|
+
isSameConversationPath
|
|
128
|
+
} from "./chunk-U54AYGEC.js";
|
|
129
|
+
import "./chunk-RXFQM6FQ.js";
|
|
130
|
+
import "./chunk-UXEO7E3V.js";
|
|
131
|
+
import {
|
|
132
|
+
normalizeChannelDeliveryText
|
|
133
|
+
} from "./chunk-4CMJKUND.js";
|
|
119
134
|
import {
|
|
120
135
|
normalizeSessionIdForLookup,
|
|
121
136
|
parseCallerSuppliedSessionId
|
|
122
137
|
} from "./chunk-ZEZKIS2K.js";
|
|
123
|
-
import "./chunk-RXFQM6FQ.js";
|
|
124
|
-
import "./chunk-UXEO7E3V.js";
|
|
125
138
|
import {
|
|
126
139
|
PERMISSION_RULE_TYPES,
|
|
127
140
|
PermissionRulesValidationError,
|
|
128
141
|
buildPermissionSettings,
|
|
129
142
|
normalizePermissionRules,
|
|
130
143
|
readPermissionRuleSet
|
|
131
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-44LKG3IY.js";
|
|
132
145
|
import {
|
|
133
146
|
MAX_AUDIO_BYTES,
|
|
134
147
|
sanitizeVoiceErrorMessage,
|
|
135
148
|
transcribeVoiceAudio
|
|
136
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-URE3QBBB.js";
|
|
137
150
|
import {
|
|
138
151
|
readVoiceModel
|
|
139
|
-
} from "./chunk-
|
|
140
|
-
import "./chunk-
|
|
141
|
-
import "./chunk-
|
|
142
|
-
import "./chunk-
|
|
143
|
-
import "./chunk-
|
|
144
|
-
import {
|
|
145
|
-
SESSION_SOURCE_META_KEY,
|
|
146
|
-
parseSessionSource
|
|
147
|
-
} from "./chunk-AKQA3WCH.js";
|
|
152
|
+
} from "./chunk-A3LWD5MK.js";
|
|
153
|
+
import "./chunk-YTDVNSUQ.js";
|
|
154
|
+
import "./chunk-HHQJANFM.js";
|
|
155
|
+
import "./chunk-IZDKYNKN.js";
|
|
156
|
+
import "./chunk-SS4MRMKE.js";
|
|
148
157
|
import "./chunk-7U5G6JXI.js";
|
|
149
158
|
import "./chunk-WCCLLK7X.js";
|
|
150
|
-
import "./chunk-OCPBI7J5.js";
|
|
151
159
|
import {
|
|
152
160
|
REASONING_EFFORT_DEFAULT,
|
|
153
161
|
REASONING_EFFORT_NAMES,
|
|
@@ -155,7 +163,7 @@ import {
|
|
|
155
163
|
buildModelReasoningConfigOption,
|
|
156
164
|
buildModelReasoningConfigPreview,
|
|
157
165
|
getModelConfiguration
|
|
158
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-T4EFG2P5.js";
|
|
159
167
|
import {
|
|
160
168
|
ACP_ROUTE_ID_PREFIX,
|
|
161
169
|
buildAcpModelOptions,
|
|
@@ -164,26 +172,26 @@ import {
|
|
|
164
172
|
parseAcpModelOption,
|
|
165
173
|
resolveAcpModelOption,
|
|
166
174
|
sanitizeProviderBaseUrl
|
|
167
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-VKCJPNGU.js";
|
|
168
176
|
import {
|
|
169
177
|
mapSkillConfigToStatus
|
|
170
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-N4X7G4J2.js";
|
|
171
179
|
import {
|
|
172
180
|
resolveSkillSettings
|
|
173
|
-
} from "./chunk-
|
|
174
|
-
import "./chunk-
|
|
175
|
-
import "./chunk-
|
|
181
|
+
} from "./chunk-HCOBAG2L.js";
|
|
182
|
+
import "./chunk-AMLXTTJJ.js";
|
|
183
|
+
import "./chunk-JWDMKJG5.js";
|
|
176
184
|
import "./chunk-57OAHC2Y.js";
|
|
177
|
-
import "./chunk-
|
|
178
|
-
import "./chunk-
|
|
179
|
-
import "./chunk-
|
|
185
|
+
import "./chunk-Y5S7LBOZ.js";
|
|
186
|
+
import "./chunk-3XKLXHGK.js";
|
|
187
|
+
import "./chunk-HVC3PNVC.js";
|
|
180
188
|
import "./chunk-V6WHFGST.js";
|
|
181
189
|
import {
|
|
182
190
|
createLoadedSettingsAdapter
|
|
183
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-SEDFP3ZI.js";
|
|
184
192
|
import {
|
|
185
193
|
ndJsonStream
|
|
186
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-H72BQNM3.js";
|
|
187
195
|
import {
|
|
188
196
|
ACP_PREFLIGHT_KINDS,
|
|
189
197
|
IDLE_HOOK_EVENTS,
|
|
@@ -191,8 +199,8 @@ import {
|
|
|
191
199
|
SERVE_STATUS_EXT_METHODS,
|
|
192
200
|
STATUS_SCHEMA_VERSION,
|
|
193
201
|
mapDomainErrorToErrorKind
|
|
194
|
-
} from "./chunk-
|
|
195
|
-
import "./chunk-
|
|
202
|
+
} from "./chunk-KID24ZFN.js";
|
|
203
|
+
import "./chunk-FTF2YIZ5.js";
|
|
196
204
|
import {
|
|
197
205
|
ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
|
|
198
206
|
ACTIVE_WORK_HEARTBEAT_META_KEY,
|
|
@@ -232,15 +240,15 @@ import {
|
|
|
232
240
|
import {
|
|
233
241
|
NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
|
|
234
242
|
isNotCurrentlyGeneratingCancelError
|
|
235
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-ERFDKH32.js";
|
|
236
244
|
import "./chunk-6PLDPT2C.js";
|
|
237
245
|
import "./chunk-FYJ7W2PI.js";
|
|
238
|
-
import "./chunk-
|
|
239
|
-
import "./chunk-JVPFTDBK.js";
|
|
246
|
+
import "./chunk-STUJ7IMZ.js";
|
|
240
247
|
import "./chunk-GYTKQYDB.js";
|
|
248
|
+
import "./chunk-RFIDDFAL.js";
|
|
241
249
|
import "./chunk-ALMR3E6Q.js";
|
|
250
|
+
import "./chunk-RKFGE7JH.js";
|
|
242
251
|
import "./chunk-UDG5EZJI.js";
|
|
243
|
-
import "./chunk-M5GB774H.js";
|
|
244
252
|
import {
|
|
245
253
|
EXTERNAL_TOOL_GUARD_READY_META_KEY,
|
|
246
254
|
EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
|
|
@@ -250,11 +258,12 @@ import {
|
|
|
250
258
|
SHELL_EXECUTING_TOOL_NAMES,
|
|
251
259
|
isValidExternalToolGuardDenialReason
|
|
252
260
|
} from "./chunk-3VUENPWF.js";
|
|
253
|
-
import "./chunk-
|
|
261
|
+
import "./chunk-M5GB774H.js";
|
|
262
|
+
import "./chunk-7EQQR46F.js";
|
|
254
263
|
import {
|
|
255
264
|
ACP_EVENT_LOOP_STALL_RESTART_MS,
|
|
256
265
|
CHANNEL_PROMPT_META_KEY
|
|
257
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-ICURCKIU.js";
|
|
258
267
|
import {
|
|
259
268
|
AgentSideConnection,
|
|
260
269
|
PROTOCOL_VERSION,
|
|
@@ -263,7 +272,7 @@ import {
|
|
|
263
272
|
import {
|
|
264
273
|
assembleMcpServers,
|
|
265
274
|
loadMcpApprovals
|
|
266
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-F5RB4S23.js";
|
|
267
276
|
import {
|
|
268
277
|
getOutputLanguageFilePath,
|
|
269
278
|
getPersistScopeForModelSelection,
|
|
@@ -272,9 +281,9 @@ import {
|
|
|
272
281
|
resolveOutputLanguageOrPreserveAuto,
|
|
273
282
|
updateOutputLanguageFile,
|
|
274
283
|
writeOutputLanguageAndRegisterPath
|
|
275
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-5SBVOOA2.js";
|
|
276
285
|
import "./chunk-RKUWKYED.js";
|
|
277
|
-
import "./chunk-
|
|
286
|
+
import "./chunk-RZKOA4JE.js";
|
|
278
287
|
import "./chunk-GOXKNSDZ.js";
|
|
279
288
|
import {
|
|
280
289
|
getSystemDefaultsPath,
|
|
@@ -283,7 +292,7 @@ import {
|
|
|
283
292
|
import {
|
|
284
293
|
getCurrentLanguage,
|
|
285
294
|
setLanguageAsync
|
|
286
|
-
} from "./chunk-
|
|
295
|
+
} from "./chunk-CLWO3B77.js";
|
|
287
296
|
import {
|
|
288
297
|
SUPPORTED_LANGUAGES
|
|
289
298
|
} from "./chunk-5EJZE3FP.js";
|
|
@@ -291,19 +300,19 @@ import {
|
|
|
291
300
|
findEnvFiles,
|
|
292
301
|
preResolveHomeEnvOverrides,
|
|
293
302
|
reloadEnvironment
|
|
294
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-5ZJL3AIV.js";
|
|
295
304
|
import {
|
|
296
305
|
ENV_ACP_REPEATED_TOOL_FAILURE_GUARD,
|
|
297
306
|
QWEN_CODE_SERVE_ENV
|
|
298
|
-
} from "./chunk-
|
|
299
|
-
import "./chunk-
|
|
300
|
-
import "./chunk-
|
|
307
|
+
} from "./chunk-MZCJWS5Y.js";
|
|
308
|
+
import "./chunk-2AEHQRY2.js";
|
|
309
|
+
import "./chunk-GIHXH2KO.js";
|
|
301
310
|
import "./chunk-W3N5XAZ6.js";
|
|
302
311
|
import {
|
|
303
312
|
isFolderTrustEnabled,
|
|
304
313
|
isWorkspaceTrusted,
|
|
305
314
|
loadTrustedFolders
|
|
306
|
-
} from "./chunk-
|
|
315
|
+
} from "./chunk-H4LCV44K.js";
|
|
307
316
|
import "./chunk-NPQ5ZKRP.js";
|
|
308
317
|
import "./chunk-MR3PXB6E.js";
|
|
309
318
|
import {
|
|
@@ -333,30 +342,30 @@ import {
|
|
|
333
342
|
resolveBaseUrl,
|
|
334
343
|
runManagedRememberByAgent,
|
|
335
344
|
subagentGenerator
|
|
336
|
-
} from "./chunk-
|
|
337
|
-
import "./chunk-
|
|
345
|
+
} from "./chunk-BFYGL2XL.js";
|
|
346
|
+
import "./chunk-VNMZLAVG.js";
|
|
338
347
|
import "./chunk-XFSFZCM5.js";
|
|
339
348
|
import "./chunk-2EAZ43JQ.js";
|
|
340
349
|
import "./chunk-NF5J2WFA.js";
|
|
341
350
|
import {
|
|
342
351
|
CreateSubSessionTool
|
|
343
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-CQH5KTKC.js";
|
|
344
353
|
import "./chunk-LJZSMWOH.js";
|
|
345
|
-
import "./chunk-
|
|
346
|
-
import "./chunk-
|
|
347
|
-
import "./chunk-
|
|
354
|
+
import "./chunk-TU6WVK67.js";
|
|
355
|
+
import "./chunk-WNPDGUJO.js";
|
|
356
|
+
import "./chunk-K5KXUXWC.js";
|
|
348
357
|
import {
|
|
349
358
|
restoreWorktreeContext
|
|
350
|
-
} from "./chunk-
|
|
351
|
-
import "./chunk-
|
|
352
|
-
import "./chunk-
|
|
353
|
-
import "./chunk-
|
|
359
|
+
} from "./chunk-62GQFYID.js";
|
|
360
|
+
import "./chunk-AYFA7MZV.js";
|
|
361
|
+
import "./chunk-XQFT3QUF.js";
|
|
362
|
+
import "./chunk-VTHREBQM.js";
|
|
354
363
|
import "./chunk-ZPJWUGCS.js";
|
|
355
364
|
import {
|
|
356
365
|
clearCachedCredentialFile,
|
|
357
366
|
qwenOAuth2Events
|
|
358
|
-
} from "./chunk-
|
|
359
|
-
import "./chunk-
|
|
367
|
+
} from "./chunk-3JXM2CVW.js";
|
|
368
|
+
import "./chunk-ST5V3ZOC.js";
|
|
360
369
|
import {
|
|
361
370
|
APPROVAL_MODE_INFO,
|
|
362
371
|
BranchPointInvalidError,
|
|
@@ -374,7 +383,6 @@ import {
|
|
|
374
383
|
MessageDisplayDispatcher,
|
|
375
384
|
PLAN_MODE_ENTRY_SIBLING_SKIP_MESSAGE,
|
|
376
385
|
POOLED_TRANSPORTS_DEFAULT,
|
|
377
|
-
SESSION_ARTIFACT_PERSISTENCE_VERSION,
|
|
378
386
|
SESSION_TITLE_MAX_LENGTH,
|
|
379
387
|
SESSION_TRANSCRIPT_MAX_LIMIT,
|
|
380
388
|
SESSION_TRANSCRIPT_MAX_PAGE_BYTES,
|
|
@@ -391,6 +399,7 @@ import {
|
|
|
391
399
|
TURN_RESULT_TEXT_MAX_CHARS,
|
|
392
400
|
abortGoalForStopHookCap,
|
|
393
401
|
acquireSleepInhibitor,
|
|
402
|
+
ambientGoalToolResultProvenance,
|
|
394
403
|
applyAutoModeDecision,
|
|
395
404
|
approxBase64Bytes,
|
|
396
405
|
bridgeToolResultImages,
|
|
@@ -425,12 +434,10 @@ import {
|
|
|
425
434
|
formatStopHookBlockingCapWarning,
|
|
426
435
|
generateToolUseId,
|
|
427
436
|
getActiveGoal,
|
|
428
|
-
getArenaSystemReminder,
|
|
429
437
|
getAutoModePermissionDeniedReason,
|
|
430
438
|
getEffectivePermissionForConfirmation,
|
|
431
439
|
getFunctionCallFingerprint,
|
|
432
440
|
getMCPDiscoveryState,
|
|
433
|
-
getPlanModeSystemReminder,
|
|
434
441
|
getProviderToolCallId,
|
|
435
442
|
getScopedEnvContents,
|
|
436
443
|
getStopHookContinuationReason,
|
|
@@ -448,8 +455,6 @@ import {
|
|
|
448
455
|
mcpServerRequiresOAuth,
|
|
449
456
|
needsConfirmation,
|
|
450
457
|
normalizeDerivedBranchTitle,
|
|
451
|
-
normalizeEventPayload,
|
|
452
|
-
normalizeSnapshotPayload,
|
|
453
458
|
normalizeTurnResultError,
|
|
454
459
|
observeToolResultBoundary,
|
|
455
460
|
persistPermissionOutcome,
|
|
@@ -473,43 +478,59 @@ import {
|
|
|
473
478
|
updateSetting,
|
|
474
479
|
validatePlanModeShellApproval,
|
|
475
480
|
validatePlanModeShellContext
|
|
476
|
-
} from "./chunk-
|
|
481
|
+
} from "./chunk-ECE3UYVO.js";
|
|
477
482
|
import "./chunk-GOFAQQZA.js";
|
|
478
483
|
import "./chunk-5M6IDOMF.js";
|
|
479
484
|
import "./chunk-TWPJO254.js";
|
|
480
485
|
import {
|
|
481
486
|
external_exports
|
|
482
487
|
} from "./chunk-CQ35AJ4Z.js";
|
|
483
|
-
import "./chunk-
|
|
484
|
-
import "./chunk-
|
|
485
|
-
import "./chunk-
|
|
486
|
-
import "./chunk-
|
|
488
|
+
import "./chunk-EKSCLBBF.js";
|
|
489
|
+
import "./chunk-LUEHOUHM.js";
|
|
490
|
+
import "./chunk-WXEA74YB.js";
|
|
491
|
+
import "./chunk-42IDLQWS.js";
|
|
487
492
|
import {
|
|
488
493
|
parsePositiveIntegerEnv
|
|
489
494
|
} from "./chunk-6PVPNMXU.js";
|
|
490
495
|
import {
|
|
491
496
|
RUNTIME_SNAPSHOT_PREFIX
|
|
492
|
-
} from "./chunk-
|
|
497
|
+
} from "./chunk-JB4JIVTJ.js";
|
|
498
|
+
import {
|
|
499
|
+
SESSION_ARTIFACT_PERSISTENCE_VERSION,
|
|
500
|
+
normalizeEventPayload,
|
|
501
|
+
normalizeSnapshotPayload
|
|
502
|
+
} from "./chunk-DJBQCO2E.js";
|
|
493
503
|
import "./chunk-IRH27ZC2.js";
|
|
494
504
|
import "./chunk-QHWCP53L.js";
|
|
495
|
-
import "./chunk-
|
|
505
|
+
import "./chunk-D5LUXLUH.js";
|
|
496
506
|
import {
|
|
497
507
|
promptIdContext,
|
|
498
508
|
todoWorkChainContext
|
|
499
509
|
} from "./chunk-O6GEWCJA.js";
|
|
500
|
-
import
|
|
501
|
-
|
|
510
|
+
import {
|
|
511
|
+
getArenaSystemReminder,
|
|
512
|
+
getPlanModeSystemReminder
|
|
513
|
+
} from "./chunk-LGO7DEXL.js";
|
|
514
|
+
import "./chunk-2SXSLSQE.js";
|
|
502
515
|
import "./chunk-CPBF7KYF.js";
|
|
503
|
-
import
|
|
516
|
+
import {
|
|
517
|
+
AgentOutputMessageCapture,
|
|
518
|
+
addAgentInputMessageAttributes,
|
|
519
|
+
addToolArgumentsAttributes,
|
|
520
|
+
addToolCallResultAttributes,
|
|
521
|
+
registerAcpEventLoopLagGauge,
|
|
522
|
+
startEventLoopLagMonitor
|
|
523
|
+
} from "./chunk-KJO2LBUK.js";
|
|
504
524
|
import {
|
|
505
525
|
HookEventName,
|
|
506
526
|
createHookOutput
|
|
507
|
-
} from "./chunk-
|
|
508
|
-
import "./chunk-
|
|
509
|
-
import "./chunk-
|
|
510
|
-
import "./chunk-
|
|
511
|
-
import "./chunk-
|
|
512
|
-
import "./chunk-
|
|
527
|
+
} from "./chunk-TTX2JUE6.js";
|
|
528
|
+
import "./chunk-4K7KNVWH.js";
|
|
529
|
+
import "./chunk-QJNDUTOL.js";
|
|
530
|
+
import "./chunk-UVY67MSH.js";
|
|
531
|
+
import "./chunk-JWALNCLT.js";
|
|
532
|
+
import "./chunk-NIFYWDYN.js";
|
|
533
|
+
import "./chunk-C2X7KY45.js";
|
|
513
534
|
import {
|
|
514
535
|
GoalConflictError,
|
|
515
536
|
GoalInvalidTransitionError,
|
|
@@ -518,50 +539,41 @@ import {
|
|
|
518
539
|
goalTurnContext,
|
|
519
540
|
parseGoalControlRequest,
|
|
520
541
|
parseGoalSnapshotV2,
|
|
521
|
-
parseGoalStateCause
|
|
542
|
+
parseGoalStateCause
|
|
543
|
+
} from "./chunk-JHYH6PYQ.js";
|
|
544
|
+
import {
|
|
522
545
|
wrapUserPromptSubmitContext
|
|
523
|
-
} from "./chunk-
|
|
546
|
+
} from "./chunk-7J6OTNGO.js";
|
|
524
547
|
import {
|
|
525
548
|
APPROVAL_MODES
|
|
526
|
-
} from "./chunk-
|
|
549
|
+
} from "./chunk-V5J4J5TP.js";
|
|
527
550
|
import "./chunk-MLXTMF7H.js";
|
|
528
551
|
import "./chunk-NAVJD2PQ.js";
|
|
529
|
-
import "./chunk-
|
|
530
|
-
import "./chunk-
|
|
552
|
+
import "./chunk-B466ZSHZ.js";
|
|
553
|
+
import "./chunk-4QHPPXK2.js";
|
|
531
554
|
import "./chunk-QHMLYMMS.js";
|
|
532
|
-
import {
|
|
533
|
-
AgentOutputMessageCapture,
|
|
534
|
-
addAgentInputMessageAttributes,
|
|
535
|
-
addToolArgumentsAttributes,
|
|
536
|
-
addToolCallResultAttributes,
|
|
537
|
-
registerAcpEventLoopLagGauge,
|
|
538
|
-
startEventLoopLagMonitor
|
|
539
|
-
} from "./chunk-SDVF6A42.js";
|
|
540
|
-
import "./chunk-P3QQPMQA.js";
|
|
541
555
|
import {
|
|
542
556
|
addDaemonRequestAttribute,
|
|
543
557
|
extractDaemonTraceContext,
|
|
544
558
|
withDaemonSpan
|
|
545
|
-
} from "./chunk-
|
|
559
|
+
} from "./chunk-3WK3QDNV.js";
|
|
546
560
|
import "./chunk-VNOVK4I7.js";
|
|
547
|
-
import "./chunk-
|
|
548
|
-
import "./chunk-
|
|
561
|
+
import "./chunk-PQEISIKS.js";
|
|
562
|
+
import "./chunk-EB6QRGHM.js";
|
|
549
563
|
import {
|
|
550
564
|
runWithRuntimeContentGenerator
|
|
551
|
-
} from "./chunk-
|
|
565
|
+
} from "./chunk-CMHFCLBU.js";
|
|
552
566
|
import "./chunk-S6LOFUVP.js";
|
|
567
|
+
import {
|
|
568
|
+
getToolCallPreparations
|
|
569
|
+
} from "./chunk-CFKIH3D3.js";
|
|
553
570
|
import {
|
|
554
571
|
REASONING_EFFORT_TIERS,
|
|
555
572
|
applyReasoningEffort
|
|
556
573
|
} from "./chunk-2LD5U7Q3.js";
|
|
557
574
|
import "./chunk-DJ2GSRLV.js";
|
|
558
|
-
import "./chunk-
|
|
559
|
-
import "./chunk-
|
|
560
|
-
import {
|
|
561
|
-
getToolCallPreparations
|
|
562
|
-
} from "./chunk-CFKIH3D3.js";
|
|
563
|
-
import "./chunk-EB4VDXNI.js";
|
|
564
|
-
import "./chunk-FJWICLG7.js";
|
|
575
|
+
import "./chunk-DYXFD5RO.js";
|
|
576
|
+
import "./chunk-V4264FEG.js";
|
|
565
577
|
import {
|
|
566
578
|
ConversationFinishedEvent,
|
|
567
579
|
DiscoveredMCPTool,
|
|
@@ -592,35 +604,35 @@ import {
|
|
|
592
604
|
shouldRunVisionBridge,
|
|
593
605
|
splitImageParts,
|
|
594
606
|
uiTelemetryService
|
|
595
|
-
} from "./chunk-
|
|
596
|
-
import "./chunk-
|
|
607
|
+
} from "./chunk-QYMAKPY5.js";
|
|
608
|
+
import "./chunk-XBVNNDPK.js";
|
|
597
609
|
import "./chunk-VGC4I5JJ.js";
|
|
598
610
|
import {
|
|
599
|
-
|
|
611
|
+
getAllMemoryFilenames,
|
|
600
612
|
getSpecificMimeType
|
|
601
|
-
} from "./chunk-
|
|
613
|
+
} from "./chunk-BKWNKLZB.js";
|
|
602
614
|
import {
|
|
603
615
|
getAutoMemoryRoot,
|
|
604
616
|
getUserAutoMemoryRoot
|
|
605
|
-
} from "./chunk-
|
|
617
|
+
} from "./chunk-6PJOTWAN.js";
|
|
606
618
|
import {
|
|
607
619
|
runSideQuery
|
|
608
|
-
} from "./chunk-
|
|
620
|
+
} from "./chunk-BWORX6FA.js";
|
|
609
621
|
import "./chunk-WZAD4ZNJ.js";
|
|
610
622
|
import {
|
|
611
623
|
DEFAULT_TOKEN_LIMIT,
|
|
612
624
|
tokenLimit
|
|
613
625
|
} from "./chunk-FPGTNKCP.js";
|
|
614
|
-
import "./chunk-
|
|
626
|
+
import "./chunk-6DIGWMGT.js";
|
|
615
627
|
import {
|
|
616
628
|
hasVertexProjectConfigured,
|
|
617
629
|
preloadContentGenerator
|
|
618
|
-
} from "./chunk-
|
|
630
|
+
} from "./chunk-ARF6IJHM.js";
|
|
619
631
|
import "./chunk-XZA32HII.js";
|
|
620
|
-
import "./chunk-
|
|
632
|
+
import "./chunk-23RFD54N.js";
|
|
621
633
|
import {
|
|
622
634
|
AuthType
|
|
623
|
-
} from "./chunk-
|
|
635
|
+
} from "./chunk-PPKZ7JOE.js";
|
|
624
636
|
import "./chunk-HHJLM3WQ.js";
|
|
625
637
|
import {
|
|
626
638
|
endToolExecutionSpan,
|
|
@@ -632,17 +644,17 @@ import {
|
|
|
632
644
|
startToolExecutionSpan,
|
|
633
645
|
startToolSpan,
|
|
634
646
|
withInteractionSpan
|
|
635
|
-
} from "./chunk-
|
|
647
|
+
} from "./chunk-B5PHIJGI.js";
|
|
636
648
|
import "./chunk-74TONY4F.js";
|
|
637
|
-
import "./chunk-
|
|
649
|
+
import "./chunk-XF63PKEN.js";
|
|
638
650
|
import {
|
|
639
651
|
FORK_SUBAGENT_TYPE,
|
|
640
652
|
getStartupContextLength,
|
|
641
653
|
isSystemReminderContent
|
|
642
|
-
} from "./chunk-
|
|
643
|
-
import "./chunk-
|
|
654
|
+
} from "./chunk-CAJTKR6W.js";
|
|
655
|
+
import "./chunk-ZU4UDIWX.js";
|
|
644
656
|
import "./chunk-AQ37AY7B.js";
|
|
645
|
-
import "./chunk-
|
|
657
|
+
import "./chunk-PDQGMSZK.js";
|
|
646
658
|
import {
|
|
647
659
|
BaseDeclarativeTool,
|
|
648
660
|
BaseToolInvocation,
|
|
@@ -650,7 +662,7 @@ import {
|
|
|
650
662
|
ToolNames,
|
|
651
663
|
canonicalToolName,
|
|
652
664
|
isShellProgressData
|
|
653
|
-
} from "./chunk-
|
|
665
|
+
} from "./chunk-UTLCH2FK.js";
|
|
654
666
|
import {
|
|
655
667
|
Storage,
|
|
656
668
|
createDebugLogger,
|
|
@@ -658,15 +670,16 @@ import {
|
|
|
658
670
|
getErrorStatus,
|
|
659
671
|
isSubpath,
|
|
660
672
|
sessionIdContext
|
|
661
|
-
} from "./chunk-
|
|
662
|
-
import "./chunk-
|
|
673
|
+
} from "./chunk-UHQFIS7N.js";
|
|
674
|
+
import "./chunk-BIJEBAAQ.js";
|
|
675
|
+
import "./chunk-WLEYH7CD.js";
|
|
663
676
|
import {
|
|
664
677
|
runExitCleanup
|
|
665
|
-
} from "./chunk-
|
|
678
|
+
} from "./chunk-K6CTN5TU.js";
|
|
666
679
|
import {
|
|
667
680
|
writeStderrLine,
|
|
668
681
|
writeStderrLineSafe
|
|
669
|
-
} from "./chunk-
|
|
682
|
+
} from "./chunk-7FA2II6K.js";
|
|
670
683
|
import "./chunk-75DOP5OR.js";
|
|
671
684
|
import "./chunk-DMTGGOSA.js";
|
|
672
685
|
import "./chunk-YQ3U5MUC.js";
|
|
@@ -1044,9 +1057,6 @@ function inactiveExtensionSkillRefs(config) {
|
|
|
1044
1057
|
if (extension.isActive) continue;
|
|
1045
1058
|
for (const skill of extension.skills ?? []) {
|
|
1046
1059
|
refs.add(extensionSkillRef(extension.name, skill.name));
|
|
1047
|
-
if (extension.displayName) {
|
|
1048
|
-
refs.add(extensionSkillRef(extension.displayName, skill.name));
|
|
1049
|
-
}
|
|
1050
1060
|
}
|
|
1051
1061
|
}
|
|
1052
1062
|
return refs;
|
|
@@ -1952,6 +1962,19 @@ var basicPermissionOptions = [
|
|
|
1952
1962
|
kind: "reject_once"
|
|
1953
1963
|
}
|
|
1954
1964
|
];
|
|
1965
|
+
function filterPermissionPersistenceOptions(options, policy) {
|
|
1966
|
+
if (!policy) return options;
|
|
1967
|
+
return options.filter((option) => {
|
|
1968
|
+
if (option.optionId === "proceed_always_project" /* ProceedAlwaysProject */ && !policy.allowProjectPersistence) {
|
|
1969
|
+
return false;
|
|
1970
|
+
}
|
|
1971
|
+
if (option.optionId === "proceed_always_user" /* ProceedAlwaysUser */ && !policy.allowUserPersistence) {
|
|
1972
|
+
return false;
|
|
1973
|
+
}
|
|
1974
|
+
return true;
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
__name(filterPermissionPersistenceOptions, "filterPermissionPersistenceOptions");
|
|
1955
1978
|
function supportsHideAlwaysAllow(confirmation) {
|
|
1956
1979
|
return confirmation.type !== "ask_user_question";
|
|
1957
1980
|
}
|
|
@@ -2087,7 +2110,7 @@ function resolvePermissionOutcome(response, offeredOptions) {
|
|
|
2087
2110
|
return optionId;
|
|
2088
2111
|
}
|
|
2089
2112
|
__name(resolvePermissionOutcome, "resolvePermissionOutcome");
|
|
2090
|
-
function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
|
|
2113
|
+
function toPermissionOptions(confirmation, forceHideAlwaysAllow = false, persistencePolicy) {
|
|
2091
2114
|
switch (confirmation.type) {
|
|
2092
2115
|
case "edit":
|
|
2093
2116
|
return filterAlwaysAllowOptions(
|
|
@@ -2106,56 +2129,65 @@ function toPermissionOptions(confirmation, forceHideAlwaysAllow = false) {
|
|
|
2106
2129
|
const label = formatExecPermissionScopeLabel(confirmation);
|
|
2107
2130
|
return filterAlwaysAllowOptions(
|
|
2108
2131
|
confirmation,
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2132
|
+
filterPermissionPersistenceOptions(
|
|
2133
|
+
[
|
|
2134
|
+
{
|
|
2135
|
+
optionId: "proceed_always_project" /* ProceedAlwaysProject */,
|
|
2136
|
+
name: `Always Allow in project: ${label}`,
|
|
2137
|
+
kind: "allow_always"
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
optionId: "proceed_always_user" /* ProceedAlwaysUser */,
|
|
2141
|
+
name: `Always Allow for user: ${label}`,
|
|
2142
|
+
kind: "allow_always"
|
|
2143
|
+
},
|
|
2144
|
+
...basicPermissionOptions
|
|
2145
|
+
],
|
|
2146
|
+
persistencePolicy
|
|
2147
|
+
),
|
|
2122
2148
|
forceHideAlwaysAllow
|
|
2123
2149
|
);
|
|
2124
2150
|
}
|
|
2125
2151
|
case "mcp":
|
|
2126
2152
|
return filterAlwaysAllowOptions(
|
|
2127
2153
|
confirmation,
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2154
|
+
filterPermissionPersistenceOptions(
|
|
2155
|
+
[
|
|
2156
|
+
{
|
|
2157
|
+
optionId: "proceed_always_project" /* ProceedAlwaysProject */,
|
|
2158
|
+
name: `Always Allow in project: ${confirmation.toolName}`,
|
|
2159
|
+
kind: "allow_always"
|
|
2160
|
+
},
|
|
2161
|
+
{
|
|
2162
|
+
optionId: "proceed_always_user" /* ProceedAlwaysUser */,
|
|
2163
|
+
name: `Always Allow for user: ${confirmation.toolName}`,
|
|
2164
|
+
kind: "allow_always"
|
|
2165
|
+
},
|
|
2166
|
+
...basicPermissionOptions
|
|
2167
|
+
],
|
|
2168
|
+
persistencePolicy
|
|
2169
|
+
),
|
|
2141
2170
|
forceHideAlwaysAllow
|
|
2142
2171
|
);
|
|
2143
2172
|
case "info":
|
|
2144
2173
|
return filterAlwaysAllowOptions(
|
|
2145
2174
|
confirmation,
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2175
|
+
filterPermissionPersistenceOptions(
|
|
2176
|
+
[
|
|
2177
|
+
{
|
|
2178
|
+
optionId: "proceed_always_project" /* ProceedAlwaysProject */,
|
|
2179
|
+
name: "Always Allow in project",
|
|
2180
|
+
kind: "allow_always"
|
|
2181
|
+
},
|
|
2182
|
+
{
|
|
2183
|
+
optionId: "proceed_always_user" /* ProceedAlwaysUser */,
|
|
2184
|
+
name: "Always Allow for user",
|
|
2185
|
+
kind: "allow_always"
|
|
2186
|
+
},
|
|
2187
|
+
...basicPermissionOptions
|
|
2188
|
+
],
|
|
2189
|
+
persistencePolicy
|
|
2190
|
+
),
|
|
2159
2191
|
forceHideAlwaysAllow
|
|
2160
2192
|
);
|
|
2161
2193
|
case "plan":
|
|
@@ -2205,11 +2237,12 @@ __name(toPermissionOptions, "toPermissionOptions");
|
|
|
2205
2237
|
// packages/cli/src/acp-integration/session/SubAgentTracker.ts
|
|
2206
2238
|
var debugLogger3 = createDebugLogger("ACP_SUBAGENT_TRACKER");
|
|
2207
2239
|
var SubAgentTracker = class {
|
|
2208
|
-
constructor(ctx, client, parentToolCallId, subagentType, onPermissionCancel, permissionRequester = (params, signal) => requestPermissionWithAbort(this.client, params, signal)) {
|
|
2240
|
+
constructor(ctx, client, parentToolCallId, subagentType, onPermissionCancel, permissionRequester = (params, signal) => requestPermissionWithAbort(this.client, params, signal), permissionPersistencePolicy) {
|
|
2209
2241
|
this.ctx = ctx;
|
|
2210
2242
|
this.client = client;
|
|
2211
2243
|
this.onPermissionCancel = onPermissionCancel;
|
|
2212
2244
|
this.permissionRequester = permissionRequester;
|
|
2245
|
+
this.permissionPersistencePolicy = permissionPersistencePolicy;
|
|
2213
2246
|
this.toolCallEmitter = new ToolCallEmitter(ctx);
|
|
2214
2247
|
this.messageEmitter = new MessageEmitter(ctx);
|
|
2215
2248
|
this.subagentMeta = { parentToolCallId, subagentType };
|
|
@@ -2325,7 +2358,11 @@ var SubAgentTracker = class {
|
|
|
2325
2358
|
}, "onConfirm")
|
|
2326
2359
|
};
|
|
2327
2360
|
const { title, locations, kind } = this.toolCallEmitter.resolveToolMetadata(event.name, state?.args);
|
|
2328
|
-
const permissionOptions = toPermissionOptions(
|
|
2361
|
+
const permissionOptions = toPermissionOptions(
|
|
2362
|
+
fullConfirmationDetails,
|
|
2363
|
+
false,
|
|
2364
|
+
this.permissionPersistencePolicy
|
|
2365
|
+
);
|
|
2329
2366
|
const offeredPermissionOptions = permissionOptions.map((option) => ({
|
|
2330
2367
|
...option
|
|
2331
2368
|
}));
|
|
@@ -3248,6 +3285,18 @@ var LOOP_DETECTED_CONTEXT_MESSAGE = "System: this turn was terminated because th
|
|
|
3248
3285
|
var LOOP_DETECTED_TURN_ERROR_MESSAGE = "Tool-call loop protection stopped this turn. The session is still available; send a more specific instruction to continue.";
|
|
3249
3286
|
var TOOL_EXECUTION_CANCELLED_MESSAGE = "Tool execution was cancelled.";
|
|
3250
3287
|
var TOOL_POST_EXECUTION_CANCELLED_MESSAGE = "The tool had already completed; its output was discarded.";
|
|
3288
|
+
function sameManagedConversationExpectation(left, right) {
|
|
3289
|
+
return left.canonicalSessionId === right.canonicalSessionId && left.root.canonicalPath === right.root.canonicalPath && left.root.device === right.root.device && left.root.inode === right.root.inode && left.child.name === right.child.name && left.child.canonicalPath === right.child.canonicalPath && left.child.device === right.child.device && left.child.inode === right.child.inode;
|
|
3290
|
+
}
|
|
3291
|
+
__name(sameManagedConversationExpectation, "sameManagedConversationExpectation");
|
|
3292
|
+
function managedConversationBindingError() {
|
|
3293
|
+
return new RequestError(
|
|
3294
|
+
-32004,
|
|
3295
|
+
"The standalone working directory is missing.",
|
|
3296
|
+
{ errorKind: "working_directory_missing" }
|
|
3297
|
+
);
|
|
3298
|
+
}
|
|
3299
|
+
__name(managedConversationBindingError, "managedConversationBindingError");
|
|
3251
3300
|
function createDaemonToolLoopState(repeatedToolFailureMode) {
|
|
3252
3301
|
return {
|
|
3253
3302
|
totalToolCalls: 0,
|
|
@@ -3814,22 +3863,55 @@ async function registerCreateSubSessionTool(config) {
|
|
|
3814
3863
|
return;
|
|
3815
3864
|
}
|
|
3816
3865
|
const permissionManager = config.getPermissionManager();
|
|
3817
|
-
|
|
3866
|
+
const registrationStatus = permissionManager ? await permissionManager.getToolRegistrationStatus(
|
|
3867
|
+
ToolNames.CREATE_SUB_SESSION
|
|
3868
|
+
) : "registered";
|
|
3869
|
+
if (registrationStatus === "disabled") {
|
|
3818
3870
|
return;
|
|
3819
3871
|
}
|
|
3820
3872
|
const toolRegistry = config.getToolRegistry();
|
|
3873
|
+
if (registrationStatus === "deferred") {
|
|
3874
|
+
toolRegistry.registerPermissionDeferredFactory(
|
|
3875
|
+
ToolNames.CREATE_SUB_SESSION,
|
|
3876
|
+
async () => new CreateSubSessionTool(config)
|
|
3877
|
+
);
|
|
3878
|
+
await config.getLlmClient().setTools();
|
|
3879
|
+
return;
|
|
3880
|
+
}
|
|
3821
3881
|
toolRegistry.registerTool(new CreateSubSessionTool(config));
|
|
3822
3882
|
toolRegistry.revealDeferredTool(ToolNames.CREATE_SUB_SESSION);
|
|
3823
3883
|
toolRegistry.pinDeferredToolReveal(ToolNames.CREATE_SUB_SESSION);
|
|
3824
|
-
await config.
|
|
3884
|
+
await config.getLlmClient().setTools();
|
|
3825
3885
|
}
|
|
3826
3886
|
__name(registerCreateSubSessionTool, "registerCreateSubSessionTool");
|
|
3827
|
-
|
|
3887
|
+
var STANDALONE_SLASH_COMMAND_POLICY = Object.freeze({
|
|
3888
|
+
allowSessionReset: false,
|
|
3889
|
+
allowWorkspaceSettingsWrite: false,
|
|
3890
|
+
persistModelSelection: false,
|
|
3891
|
+
blockedBuiltinCommandNames: Object.freeze([
|
|
3892
|
+
"cd",
|
|
3893
|
+
"clear",
|
|
3894
|
+
"directory",
|
|
3895
|
+
"diff",
|
|
3896
|
+
"dream",
|
|
3897
|
+
"export",
|
|
3898
|
+
"learn",
|
|
3899
|
+
"curator",
|
|
3900
|
+
"workflows"
|
|
3901
|
+
])
|
|
3902
|
+
});
|
|
3903
|
+
var STANDALONE_PERMISSION_PERSISTENCE_POLICY = Object.freeze({
|
|
3904
|
+
allowProjectPersistence: false,
|
|
3905
|
+
allowUserPersistence: true
|
|
3906
|
+
});
|
|
3907
|
+
var STANDALONE_WORKTREE_ACTION_ERROR = "Standalone sessions cannot change or override their working directory.";
|
|
3908
|
+
async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.timeout(1e4), settings, executionPolicy) {
|
|
3828
3909
|
const slashCommands = await getAvailableCommands(
|
|
3829
3910
|
config,
|
|
3830
3911
|
abortSignal,
|
|
3831
3912
|
"acp",
|
|
3832
|
-
settings
|
|
3913
|
+
settings,
|
|
3914
|
+
executionPolicy
|
|
3833
3915
|
);
|
|
3834
3916
|
const disabledSkillNames = config.getDisabledSkillNames();
|
|
3835
3917
|
const inactiveSkillRefs = inactiveExtensionSkillRefs(config);
|
|
@@ -3923,6 +4005,11 @@ var Session = class {
|
|
|
3923
4005
|
this.runExclusiveAutomaticHistoryMutation = runExclusiveAutomaticHistoryMutation;
|
|
3924
4006
|
this.onActiveWorkChanged = onActiveWorkChanged;
|
|
3925
4007
|
this.sessionId = id;
|
|
4008
|
+
this.requiresManagedConversationBinding = isReservedStandaloneSessionSourceType(
|
|
4009
|
+
this.config.getSessionSourceType?.()
|
|
4010
|
+
);
|
|
4011
|
+
this.requiresManagedConversationActivation = this.requiresManagedConversationBinding && this.config.isProvisionalWorkspace?.() === true;
|
|
4012
|
+
this.slashCommandPolicy = this.requiresManagedConversationBinding ? STANDALONE_SLASH_COMMAND_POLICY : void 0;
|
|
3926
4013
|
this.runtimeBaseDir = config.storage.getRuntimeBaseDir();
|
|
3927
4014
|
const todoStopGuardEnabled = this.settings.merged.experimental?.todoStopGuard === true && !this.config.getBareMode() && !this.config.isSafeMode();
|
|
3928
4015
|
this.todoStopGuard = new DaemonTodoStopGuard(todoStopGuardEnabled);
|
|
@@ -3942,6 +4029,7 @@ var Session = class {
|
|
|
3942
4029
|
this.#bindGoalRuntime();
|
|
3943
4030
|
this.#registerBackgroundNotificationCallbacks();
|
|
3944
4031
|
this.#registerSubSessionSpawner();
|
|
4032
|
+
this.#registerCurrentSessionScheduledTaskCreator();
|
|
3945
4033
|
this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(
|
|
3946
4034
|
(entry, approval, rawArgs, signal) => this.#requestWorkflowApproval(entry.runId, approval, rawArgs, signal)
|
|
3947
4035
|
);
|
|
@@ -4066,6 +4154,11 @@ var Session = class {
|
|
|
4066
4154
|
liveSpeakToUserTool;
|
|
4067
4155
|
liveConversationActive;
|
|
4068
4156
|
liveEndInstructionPending = false;
|
|
4157
|
+
requiresManagedConversationBinding;
|
|
4158
|
+
requiresManagedConversationActivation;
|
|
4159
|
+
slashCommandPolicy;
|
|
4160
|
+
managedConversationBinding;
|
|
4161
|
+
managedConversationActivation;
|
|
4069
4162
|
// Message rewrite middleware (optional, installed after history replay)
|
|
4070
4163
|
messageRewriter;
|
|
4071
4164
|
/**
|
|
@@ -4122,6 +4215,8 @@ var Session = class {
|
|
|
4122
4215
|
controller: new AbortController(),
|
|
4123
4216
|
origin: "runtime",
|
|
4124
4217
|
continuationContext: input.continuationContext,
|
|
4218
|
+
...input.objectiveUpdated ? { objectiveUpdated: input.objectiveUpdated } : {},
|
|
4219
|
+
...input.windDown ? { windDown: true } : {},
|
|
4125
4220
|
...input.verifierFeedback ? { verifierFeedback: input.verifierFeedback } : {},
|
|
4126
4221
|
modelStarted: false
|
|
4127
4222
|
});
|
|
@@ -4278,13 +4373,14 @@ var Session = class {
|
|
|
4278
4373
|
return publication;
|
|
4279
4374
|
}
|
|
4280
4375
|
async #drainGoalQueue() {
|
|
4376
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
4281
4377
|
if (this.goalQueue.length === 0) return;
|
|
4282
4378
|
await this.runExclusiveAutomaticHistoryMutation(
|
|
4283
4379
|
() => this.#drainGoalQueueExclusive()
|
|
4284
4380
|
);
|
|
4285
4381
|
}
|
|
4286
4382
|
async #drainGoalQueueExclusive() {
|
|
4287
|
-
if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController) {
|
|
4383
|
+
if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController || this.#isAutomaticWorkHeld()) {
|
|
4288
4384
|
return;
|
|
4289
4385
|
}
|
|
4290
4386
|
const turn = this.goalQueue.shift();
|
|
@@ -4322,6 +4418,24 @@ var Session = class {
|
|
|
4322
4418
|
void this.#drainGoalQueue();
|
|
4323
4419
|
}
|
|
4324
4420
|
}
|
|
4421
|
+
/**
|
|
4422
|
+
* Confirms the continuation's prompt reached the model.
|
|
4423
|
+
*
|
|
4424
|
+
* `startGoalTurn` resolves at enqueue time, so the runtime cannot tell a
|
|
4425
|
+
* delivered turn from a queued one when it settles; `#settleGoalTurn`'s
|
|
4426
|
+
* degraded-persistence fallback settles a model-started turn through
|
|
4427
|
+
* `releaseTurn`, and only this confirmation keeps that turn's objective
|
|
4428
|
+
* announcement from rolling back and re-firing on the next continuation.
|
|
4429
|
+
*/
|
|
4430
|
+
#markGoalTurnDelivered(turnKey) {
|
|
4431
|
+
try {
|
|
4432
|
+
this.config.getGoalRuntime().markTurnDelivered(turnKey);
|
|
4433
|
+
} catch (error) {
|
|
4434
|
+
debugLogger6.debug(
|
|
4435
|
+
`Failed to confirm ACP Goal turn delivery: ${error instanceof Error ? error.message : String(error)}`
|
|
4436
|
+
);
|
|
4437
|
+
}
|
|
4438
|
+
}
|
|
4325
4439
|
async #settleGoalTurn(turn, result, failed) {
|
|
4326
4440
|
try {
|
|
4327
4441
|
const runtime = await this.config.getGoalRuntimeReady();
|
|
@@ -4826,6 +4940,48 @@ var Session = class {
|
|
|
4826
4940
|
};
|
|
4827
4941
|
});
|
|
4828
4942
|
}
|
|
4943
|
+
#registerCurrentSessionScheduledTaskCreator() {
|
|
4944
|
+
if (process.env[QWEN_CODE_SERVE_ENV] !== "1") {
|
|
4945
|
+
return;
|
|
4946
|
+
}
|
|
4947
|
+
this.config.setCurrentSessionScheduledTaskCreator(async (req) => {
|
|
4948
|
+
let resp;
|
|
4949
|
+
try {
|
|
4950
|
+
resp = await this.client.extMethod(
|
|
4951
|
+
SERVE_CONTROL_EXT_METHODS.createCurrentSessionScheduledTask,
|
|
4952
|
+
{
|
|
4953
|
+
callerSessionId: this.sessionId,
|
|
4954
|
+
promptId: getInvocationContext()?.promptId ?? req.promptId,
|
|
4955
|
+
cron: req.cron,
|
|
4956
|
+
prompt: req.prompt,
|
|
4957
|
+
recurring: req.recurring
|
|
4958
|
+
}
|
|
4959
|
+
);
|
|
4960
|
+
} catch (error) {
|
|
4961
|
+
const code = error && typeof error === "object" && "code" in error ? error.code : void 0;
|
|
4962
|
+
if (code === -32601) {
|
|
4963
|
+
throw new Error(
|
|
4964
|
+
"current_session_scheduling_unavailable: The daemon does not support current-session scheduling."
|
|
4965
|
+
);
|
|
4966
|
+
}
|
|
4967
|
+
const data = isRecord2(error) && isRecord2(error["data"]) ? error["data"] : void 0;
|
|
4968
|
+
const errorKind = data?.["errorKind"];
|
|
4969
|
+
if (typeof errorKind === "string") {
|
|
4970
|
+
const hint = data?.["hint"];
|
|
4971
|
+
throw new Error(
|
|
4972
|
+
`${errorKind}: ${typeof hint === "string" && hint.length > 0 ? hint : "Current-session scheduled task creation was rejected."}`
|
|
4973
|
+
);
|
|
4974
|
+
}
|
|
4975
|
+
throw error;
|
|
4976
|
+
}
|
|
4977
|
+
if (typeof resp["id"] !== "string" || resp["id"].length === 0 || typeof resp["cron"] !== "string" || resp["cron"].length === 0) {
|
|
4978
|
+
throw new Error(
|
|
4979
|
+
"cron_create: bridge returned an invalid scheduled-task result"
|
|
4980
|
+
);
|
|
4981
|
+
}
|
|
4982
|
+
return { id: resp["id"], cron: resp["cron"] };
|
|
4983
|
+
});
|
|
4984
|
+
}
|
|
4829
4985
|
async enableLiveScreenContext() {
|
|
4830
4986
|
const registry = this.config.getToolRegistry();
|
|
4831
4987
|
const existing = registry.getTool(CAPTURE_SCREEN_CONTEXT_TOOL_NAME);
|
|
@@ -4911,11 +5067,11 @@ var Session = class {
|
|
|
4911
5067
|
await this.#syncLiveToolDeclarations();
|
|
4912
5068
|
}
|
|
4913
5069
|
async #syncLiveToolDeclarations() {
|
|
4914
|
-
const
|
|
4915
|
-
if (!
|
|
5070
|
+
const llmClient = this.config.getLlmClient();
|
|
5071
|
+
if (!llmClient) {
|
|
4916
5072
|
throw new Error("The Live backend model client is unavailable.");
|
|
4917
5073
|
}
|
|
4918
|
-
await
|
|
5074
|
+
await llmClient.setTools();
|
|
4919
5075
|
}
|
|
4920
5076
|
async setLiveConversationActive(active) {
|
|
4921
5077
|
if (this.liveConversationActive === active) return;
|
|
@@ -4932,7 +5088,7 @@ var Session = class {
|
|
|
4932
5088
|
this.liveEndInstructionPending = true;
|
|
4933
5089
|
this.config.setLiveAppendSystemPrompt(LIVE_BACKEND_END_INSTRUCTIONS);
|
|
4934
5090
|
}
|
|
4935
|
-
await this.config.
|
|
5091
|
+
await this.config.getLlmClient()?.refreshSystemInstruction();
|
|
4936
5092
|
}
|
|
4937
5093
|
async appendLiveConversationTranscript(entries, model) {
|
|
4938
5094
|
if (this.liveConversationActive !== true) {
|
|
@@ -4970,7 +5126,7 @@ var Session = class {
|
|
|
4970
5126
|
if (this.liveConversationActive || !this.liveEndInstructionPending) return;
|
|
4971
5127
|
this.liveEndInstructionPending = false;
|
|
4972
5128
|
this.config.setLiveAppendSystemPrompt(void 0);
|
|
4973
|
-
await this.config.
|
|
5129
|
+
await this.config.getLlmClient()?.refreshSystemInstruction();
|
|
4974
5130
|
}
|
|
4975
5131
|
getId() {
|
|
4976
5132
|
return this.sessionId;
|
|
@@ -4984,6 +5140,7 @@ var Session = class {
|
|
|
4984
5140
|
* mount.
|
|
4985
5141
|
*/
|
|
4986
5142
|
startCronScheduler() {
|
|
5143
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
4987
5144
|
this.#startCronSchedulerInRuntime().catch((error) => {
|
|
4988
5145
|
debugLogger6.warn(
|
|
4989
5146
|
`Cron scheduler startup failed [session ${this.sessionId}]: ${error}`
|
|
@@ -4993,6 +5150,113 @@ var Session = class {
|
|
|
4993
5150
|
getConfig() {
|
|
4994
5151
|
return this.config;
|
|
4995
5152
|
}
|
|
5153
|
+
installPendingManagedConversationBinding(expectation, assertIdentity) {
|
|
5154
|
+
if (!this.requiresManagedConversationBinding || expectation.canonicalSessionId !== this.sessionId) {
|
|
5155
|
+
throw managedConversationBindingError();
|
|
5156
|
+
}
|
|
5157
|
+
if (this.managedConversationBinding && this.managedConversationBinding.state !== "released" && !sameManagedConversationExpectation(
|
|
5158
|
+
this.managedConversationBinding.expectation,
|
|
5159
|
+
expectation
|
|
5160
|
+
)) {
|
|
5161
|
+
throw managedConversationBindingError();
|
|
5162
|
+
}
|
|
5163
|
+
this.managedConversationBinding = {
|
|
5164
|
+
expectation,
|
|
5165
|
+
assertIdentity,
|
|
5166
|
+
state: "pending"
|
|
5167
|
+
};
|
|
5168
|
+
}
|
|
5169
|
+
installManagedConversationActivation(run, onRelease) {
|
|
5170
|
+
if (!this.requiresManagedConversationActivation || this.managedConversationActivation) {
|
|
5171
|
+
throw managedConversationBindingError();
|
|
5172
|
+
}
|
|
5173
|
+
this.managedConversationActivation = {
|
|
5174
|
+
run,
|
|
5175
|
+
...onRelease ? { onRelease } : {},
|
|
5176
|
+
releaseScheduled: false,
|
|
5177
|
+
state: "pending"
|
|
5178
|
+
};
|
|
5179
|
+
}
|
|
5180
|
+
async activateManagedConversation() {
|
|
5181
|
+
if (!this.requiresManagedConversationActivation) return;
|
|
5182
|
+
const activation = this.managedConversationActivation;
|
|
5183
|
+
if (!activation) throw managedConversationBindingError();
|
|
5184
|
+
if (activation.state === "ready") return;
|
|
5185
|
+
if (activation.state === "poisoned") throw activation.error;
|
|
5186
|
+
if (activation.promise) return activation.promise;
|
|
5187
|
+
activation.state = "activating";
|
|
5188
|
+
const promise = activation.run().then(() => {
|
|
5189
|
+
activation.state = "ready";
|
|
5190
|
+
}).catch((error) => {
|
|
5191
|
+
activation.state = "poisoned";
|
|
5192
|
+
activation.error = error;
|
|
5193
|
+
throw error;
|
|
5194
|
+
});
|
|
5195
|
+
activation.promise = promise;
|
|
5196
|
+
return promise;
|
|
5197
|
+
}
|
|
5198
|
+
async commitManagedConversationBinding(expectation) {
|
|
5199
|
+
const binding = this.managedConversationBinding;
|
|
5200
|
+
if (!this.requiresManagedConversationBinding || !binding || !sameManagedConversationExpectation(binding.expectation, expectation)) {
|
|
5201
|
+
throw managedConversationBindingError();
|
|
5202
|
+
}
|
|
5203
|
+
if (binding.state === "committed" || binding.state === "released") return;
|
|
5204
|
+
if (!isSameConversationPath(
|
|
5205
|
+
this.config.getTargetDir(),
|
|
5206
|
+
binding.expectation.child.canonicalPath
|
|
5207
|
+
)) {
|
|
5208
|
+
throw managedConversationBindingError();
|
|
5209
|
+
}
|
|
5210
|
+
await binding.assertIdentity();
|
|
5211
|
+
await this.activateManagedConversation();
|
|
5212
|
+
await binding.assertIdentity();
|
|
5213
|
+
binding.state = "committed";
|
|
5214
|
+
}
|
|
5215
|
+
async releaseManagedConversationBinding(expectation) {
|
|
5216
|
+
const binding = this.managedConversationBinding;
|
|
5217
|
+
if (!this.requiresManagedConversationBinding || !binding || binding.state === "pending" || !sameManagedConversationExpectation(binding.expectation, expectation)) {
|
|
5218
|
+
throw managedConversationBindingError();
|
|
5219
|
+
}
|
|
5220
|
+
if (binding.state === "released") return;
|
|
5221
|
+
if (!isSameConversationPath(
|
|
5222
|
+
this.config.getTargetDir(),
|
|
5223
|
+
binding.expectation.child.canonicalPath
|
|
5224
|
+
)) {
|
|
5225
|
+
throw managedConversationBindingError();
|
|
5226
|
+
}
|
|
5227
|
+
await binding.assertIdentity();
|
|
5228
|
+
binding.state = "released";
|
|
5229
|
+
const activation = this.managedConversationActivation;
|
|
5230
|
+
if (activation && !activation.releaseScheduled) {
|
|
5231
|
+
activation.releaseScheduled = true;
|
|
5232
|
+
try {
|
|
5233
|
+
activation.onRelease?.();
|
|
5234
|
+
} catch (error) {
|
|
5235
|
+
debugLogger6.warn(
|
|
5236
|
+
`Managed conversation release callback failed [session ${this.sessionId}]: ${error}`
|
|
5237
|
+
);
|
|
5238
|
+
}
|
|
5239
|
+
}
|
|
5240
|
+
this.startCronScheduler();
|
|
5241
|
+
void this.sendAvailableCommandsUpdate();
|
|
5242
|
+
void this.#drainGoalQueue();
|
|
5243
|
+
void this.#drainCronQueue();
|
|
5244
|
+
void this.#drainNotificationQueue();
|
|
5245
|
+
}
|
|
5246
|
+
async assertManagedConversationBindingReady() {
|
|
5247
|
+
if (!this.requiresManagedConversationBinding) return;
|
|
5248
|
+
const binding = this.managedConversationBinding;
|
|
5249
|
+
if (binding?.state !== "released" || !isSameConversationPath(
|
|
5250
|
+
this.config.getTargetDir(),
|
|
5251
|
+
binding.expectation.child.canonicalPath
|
|
5252
|
+
)) {
|
|
5253
|
+
throw managedConversationBindingError();
|
|
5254
|
+
}
|
|
5255
|
+
await binding.assertIdentity();
|
|
5256
|
+
}
|
|
5257
|
+
#isAutomaticWorkHeld() {
|
|
5258
|
+
return this.requiresManagedConversationBinding && this.managedConversationBinding?.state !== "released";
|
|
5259
|
+
}
|
|
4996
5260
|
shouldHintAskUserQuestionRestore() {
|
|
4997
5261
|
if (this.config.getRestoreAskUserQuestion?.() !== true) return false;
|
|
4998
5262
|
if (this.pendingPrompt && !this.pendingPrompt.signal.aborted) return false;
|
|
@@ -5010,6 +5274,9 @@ var Session = class {
|
|
|
5010
5274
|
"Session history mutation is in progress"
|
|
5011
5275
|
);
|
|
5012
5276
|
}
|
|
5277
|
+
if (this.requiresManagedConversationBinding) {
|
|
5278
|
+
await this.assertManagedConversationBindingReady();
|
|
5279
|
+
}
|
|
5013
5280
|
try {
|
|
5014
5281
|
await this.config.assertCanStartTurn();
|
|
5015
5282
|
} catch (error) {
|
|
@@ -5020,6 +5287,9 @@ var Session = class {
|
|
|
5020
5287
|
}
|
|
5021
5288
|
throw error;
|
|
5022
5289
|
}
|
|
5290
|
+
if (this.requiresManagedConversationBinding) {
|
|
5291
|
+
await this.assertManagedConversationBindingReady();
|
|
5292
|
+
}
|
|
5023
5293
|
if (this.closing) {
|
|
5024
5294
|
throw RequestError.invalidParams(void 0, "Session is closing");
|
|
5025
5295
|
}
|
|
@@ -5081,6 +5351,9 @@ var Session = class {
|
|
|
5081
5351
|
}
|
|
5082
5352
|
return holds;
|
|
5083
5353
|
}
|
|
5354
|
+
hasStandaloneRelocationBlockers() {
|
|
5355
|
+
return this.collectActiveWorkHolds().length > 0 || this.config.getMonitorRegistry().getAll().some((monitor) => monitor.status === "running");
|
|
5356
|
+
}
|
|
5084
5357
|
#activeWorkChanged() {
|
|
5085
5358
|
this.onActiveWorkChanged?.();
|
|
5086
5359
|
}
|
|
@@ -5236,6 +5509,7 @@ var Session = class {
|
|
|
5236
5509
|
this.unsubscribeChatRecordingFailure?.();
|
|
5237
5510
|
this.unsubscribeChatRecordingFailure = void 0;
|
|
5238
5511
|
this.config.setSubSessionSpawner(void 0);
|
|
5512
|
+
this.config.setCurrentSessionScheduledTaskCreator(void 0);
|
|
5239
5513
|
this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(void 0);
|
|
5240
5514
|
this.workflowApprovalAbortController.abort(SESSION_DISPOSE_ABORT_REASON);
|
|
5241
5515
|
}
|
|
@@ -5304,7 +5578,7 @@ var Session = class {
|
|
|
5304
5578
|
"Cannot rewind while a prompt is running"
|
|
5305
5579
|
);
|
|
5306
5580
|
}
|
|
5307
|
-
const chat = this.config.
|
|
5581
|
+
const chat = this.config.getLlmClient().getChat();
|
|
5308
5582
|
const apiHistory = chat.getHistoryShallow();
|
|
5309
5583
|
const apiTruncateIndex = this.#computeApiTruncationIndexForUserTurn(
|
|
5310
5584
|
apiHistory,
|
|
@@ -5340,7 +5614,7 @@ var Session = class {
|
|
|
5340
5614
|
return { targetTurnIndex, apiTruncateIndex };
|
|
5341
5615
|
}
|
|
5342
5616
|
captureHistorySnapshot() {
|
|
5343
|
-
return this.config.
|
|
5617
|
+
return this.config.getLlmClient().getChat().getHistoryShallow();
|
|
5344
5618
|
}
|
|
5345
5619
|
getRewindableUserTurnCount() {
|
|
5346
5620
|
const apiHistory = this.captureHistorySnapshot();
|
|
@@ -5362,7 +5636,7 @@ var Session = class {
|
|
|
5362
5636
|
"Cannot restore history while a prompt is running"
|
|
5363
5637
|
);
|
|
5364
5638
|
}
|
|
5365
|
-
this.config.
|
|
5639
|
+
this.config.getLlmClient().getChat().setHistory(structuredClone(history));
|
|
5366
5640
|
this.activeTodoPlanRevision = void 0;
|
|
5367
5641
|
this.#clearTodoStopGuardTrustAndDrainAutomaticQueues();
|
|
5368
5642
|
}
|
|
@@ -5789,8 +6063,8 @@ var Session = class {
|
|
|
5789
6063
|
* authoritatively. Powers `qwen/control/session/continue`.
|
|
5790
6064
|
*/
|
|
5791
6065
|
async continueLastTurn() {
|
|
5792
|
-
const
|
|
5793
|
-
if (!
|
|
6066
|
+
const llmClient = this.config.getLlmClient();
|
|
6067
|
+
if (!llmClient || !llmClient.isInitialized()) {
|
|
5794
6068
|
return { accepted: false, interruption: "none" };
|
|
5795
6069
|
}
|
|
5796
6070
|
const chat = this.#getCurrentChat();
|
|
@@ -5839,7 +6113,7 @@ var Session = class {
|
|
|
5839
6113
|
}
|
|
5840
6114
|
if (this.settings.merged.ui?.enableFollowupSuggestions === false) return;
|
|
5841
6115
|
if (this.config.getApprovalMode() === "plan" /* PLAN */) return;
|
|
5842
|
-
const chat = this.config.
|
|
6116
|
+
const chat = this.config.getLlmClient()?.getChat();
|
|
5843
6117
|
if (!chat) return;
|
|
5844
6118
|
const ac = new AbortController();
|
|
5845
6119
|
this.followupAbort = ac;
|
|
@@ -5926,6 +6200,7 @@ var Session = class {
|
|
|
5926
6200
|
return goalTurn ? goalTurnContext.run(goalTurn.permit, execute) : goalTurnContext.exit(execute);
|
|
5927
6201
|
}
|
|
5928
6202
|
async #executePromptInner(params, pendingSend, responseCapture, modelPrompt, rejectOnLoopDetected = false, goalTurn, channelTurn = false) {
|
|
6203
|
+
let managedMemoryRecallStarted = false;
|
|
5929
6204
|
return Storage.runWithRuntimeBaseDir(
|
|
5930
6205
|
this.runtimeBaseDir,
|
|
5931
6206
|
this.config.getWorkingDir(),
|
|
@@ -6071,7 +6346,8 @@ var Session = class {
|
|
|
6071
6346
|
// long-lived Session; without this the goal-state
|
|
6072
6347
|
// subscription stays on the disposed instance.
|
|
6073
6348
|
startNewSession: /* @__PURE__ */ __name(() => this.rebindGoalRuntimeForNewSession(), "startNewSession")
|
|
6074
|
-
}
|
|
6349
|
+
},
|
|
6350
|
+
this.slashCommandPolicy
|
|
6075
6351
|
);
|
|
6076
6352
|
if (slashCommandName === "advisor" && pendingSend.signal.aborted && slashCommandResult.type === "message") {
|
|
6077
6353
|
this.todoStopGuard.suspend();
|
|
@@ -6137,6 +6413,7 @@ var Session = class {
|
|
|
6137
6413
|
const hooksEnabled = !this.config.getDisableAllHooks?.();
|
|
6138
6414
|
const messageBus = this.config.getMessageBus?.();
|
|
6139
6415
|
const isRuntimeContinuation = goalTurn?.origin === "runtime";
|
|
6416
|
+
const isFreshUserTurn = !isRetry && !isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation;
|
|
6140
6417
|
if (!isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation && hooksEnabled && messageBus && this.config.hasHooksForEvent?.("UserPromptSubmit")) {
|
|
6141
6418
|
const response = await messageBus.request(
|
|
6142
6419
|
{
|
|
@@ -6165,6 +6442,10 @@ var Session = class {
|
|
|
6165
6442
|
];
|
|
6166
6443
|
}
|
|
6167
6444
|
}
|
|
6445
|
+
if (isFreshUserTurn) {
|
|
6446
|
+
managedMemoryRecallStarted = true;
|
|
6447
|
+
this.config.getLlmClient().beginManagedAutoMemoryRecall(promptText, pendingSend.signal);
|
|
6448
|
+
}
|
|
6168
6449
|
if (!continuesCurrentWorkChain && !this.todoStopGuard.enabled) {
|
|
6169
6450
|
this.#resetTodoStopGuardBackgroundLineage();
|
|
6170
6451
|
}
|
|
@@ -6190,6 +6471,12 @@ var Session = class {
|
|
|
6190
6471
|
}
|
|
6191
6472
|
}
|
|
6192
6473
|
const systemReminders = await this.#buildInitialSystemReminders();
|
|
6474
|
+
if (isFreshUserTurn) {
|
|
6475
|
+
const memory = await this.config.getLlmClient().consumeManagedAutoMemoryRecall("initial");
|
|
6476
|
+
if (memory?.prompt) {
|
|
6477
|
+
systemReminders.unshift({ text: memory.prompt });
|
|
6478
|
+
}
|
|
6479
|
+
}
|
|
6193
6480
|
if (systemReminders.length > 0 && !isRestoreAskUserQuestion) {
|
|
6194
6481
|
const alreadyHasReminder = isContinue && parts.some(
|
|
6195
6482
|
(part) => isSystemReminderContent({ role: "user", parts: [part] })
|
|
@@ -6366,7 +6653,12 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
6366
6653
|
let channelDeliveryResponseBlock;
|
|
6367
6654
|
let channelDeliveryCheckpoint = 0;
|
|
6368
6655
|
try {
|
|
6369
|
-
if (goalTurn)
|
|
6656
|
+
if (goalTurn) {
|
|
6657
|
+
goalTurn.modelStarted = true;
|
|
6658
|
+
if (goalTurn.origin === "runtime") {
|
|
6659
|
+
this.#markGoalTurnDelivered(goalTurn.turnKey);
|
|
6660
|
+
}
|
|
6661
|
+
}
|
|
6370
6662
|
const sendResult = await this.#sendMessageStreamWithAutoCompression(
|
|
6371
6663
|
promptId,
|
|
6372
6664
|
nextMessage?.parts ?? [],
|
|
@@ -6587,7 +6879,32 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
6587
6879
|
getActiveInteractionSpan()
|
|
6588
6880
|
);
|
|
6589
6881
|
}
|
|
6590
|
-
|
|
6882
|
+
if (isFreshUserTurn && result.stopReason === "end_turn" && !result.loopProtectionStopped && this.config.getManagedAutoMemoryEnabled()) {
|
|
6883
|
+
const memoryManager = this.config.getMemoryManager();
|
|
6884
|
+
const history = this.#getCurrentChat().getHistoryShallow();
|
|
6885
|
+
void memoryManager.scheduleExtract({
|
|
6886
|
+
projectRoot: this.config.getProjectRoot(),
|
|
6887
|
+
sessionId: this.config.getSessionId(),
|
|
6888
|
+
history,
|
|
6889
|
+
config: this.config
|
|
6890
|
+
}).catch((error) => {
|
|
6891
|
+
debugLogger6.warn(
|
|
6892
|
+
"Failed to schedule ACP managed auto-memory extraction.",
|
|
6893
|
+
error
|
|
6894
|
+
);
|
|
6895
|
+
});
|
|
6896
|
+
void memoryManager.scheduleDream({
|
|
6897
|
+
projectRoot: this.config.getProjectRoot(),
|
|
6898
|
+
sessionId: this.config.getSessionId(),
|
|
6899
|
+
config: this.config
|
|
6900
|
+
}).catch((error) => {
|
|
6901
|
+
debugLogger6.warn(
|
|
6902
|
+
"Failed to schedule ACP managed auto-memory dream.",
|
|
6903
|
+
error
|
|
6904
|
+
);
|
|
6905
|
+
});
|
|
6906
|
+
}
|
|
6907
|
+
return { stopReason: result.stopReason };
|
|
6591
6908
|
} finally {
|
|
6592
6909
|
logConversationFinishedEvent(
|
|
6593
6910
|
this.config,
|
|
@@ -6606,7 +6923,11 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
6606
6923
|
(result) => result.stopReason === "cancelled" ? "cancelled" : "ok"
|
|
6607
6924
|
);
|
|
6608
6925
|
}
|
|
6609
|
-
)
|
|
6926
|
+
).finally(() => {
|
|
6927
|
+
if (managedMemoryRecallStarted) {
|
|
6928
|
+
this.config.getLlmClient().finishManagedAutoMemoryRecall();
|
|
6929
|
+
}
|
|
6930
|
+
});
|
|
6610
6931
|
}
|
|
6611
6932
|
async #handleStopHookLoop(pendingSend, promptId, hooksEnabled, messageBus, allowExternalHooks = true, modelOverride, responseCapture, rejectOnLoopDetected = false) {
|
|
6612
6933
|
const stopHookBlockingCap = this.config.getStopHookBlockingCap();
|
|
@@ -6673,7 +6994,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
6673
6994
|
}
|
|
6674
6995
|
);
|
|
6675
6996
|
if (continuation2.kind === "terminal") {
|
|
6676
|
-
return
|
|
6997
|
+
return continuation2;
|
|
6677
6998
|
}
|
|
6678
6999
|
continue;
|
|
6679
7000
|
}
|
|
@@ -6758,7 +7079,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
6758
7079
|
}
|
|
6759
7080
|
);
|
|
6760
7081
|
if (continuation2.kind === "terminal") {
|
|
6761
|
-
return
|
|
7082
|
+
return continuation2;
|
|
6762
7083
|
}
|
|
6763
7084
|
continue;
|
|
6764
7085
|
}
|
|
@@ -6862,7 +7183,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
6862
7183
|
stopHookReasons = stopHookReasons.slice(0, -1);
|
|
6863
7184
|
}
|
|
6864
7185
|
if (continuation.kind === "terminal") {
|
|
6865
|
-
return
|
|
7186
|
+
return continuation;
|
|
6866
7187
|
}
|
|
6867
7188
|
}
|
|
6868
7189
|
}
|
|
@@ -7317,6 +7638,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7317
7638
|
// and background-notification turns keep the graceful end-turn
|
|
7318
7639
|
// handling they had before loop stops became rejections.
|
|
7319
7640
|
stopReason: options.rejectOnLoopDetected ? cancelledOrThrowLoopDetected(pendingSend.signal, toolLoopState) : getAbortAwareEndTurnStopReason(pendingSend.signal),
|
|
7641
|
+
loopProtectionStopped: true,
|
|
7320
7642
|
...supersededAutomaticContinuation ? { supersededAutomaticContinuation: true } : {}
|
|
7321
7643
|
};
|
|
7322
7644
|
}
|
|
@@ -7329,6 +7651,14 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7329
7651
|
options.rejectOnLoopDetected ?? false
|
|
7330
7652
|
);
|
|
7331
7653
|
nextMessage = nextAfterTools.message;
|
|
7654
|
+
if (nextAfterTools.stoppedByRepeatedToolFailure) {
|
|
7655
|
+
return {
|
|
7656
|
+
kind: "terminal",
|
|
7657
|
+
stopReason: options.rejectOnLoopDetected ? cancelledOrThrowLoopDetected(pendingSend.signal, toolLoopState) : getAbortAwareEndTurnStopReason(pendingSend.signal),
|
|
7658
|
+
loopProtectionStopped: true,
|
|
7659
|
+
...supersededAutomaticContinuation ? { supersededAutomaticContinuation: true } : {}
|
|
7660
|
+
};
|
|
7661
|
+
}
|
|
7332
7662
|
if (nextAfterTools.hadMidTurnUserInput) {
|
|
7333
7663
|
nextGuardContinuation = void 0;
|
|
7334
7664
|
continue;
|
|
@@ -7490,7 +7820,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7490
7820
|
}
|
|
7491
7821
|
}
|
|
7492
7822
|
#getCurrentChat() {
|
|
7493
|
-
return this.config.
|
|
7823
|
+
return this.config.getLlmClient().getChat();
|
|
7494
7824
|
}
|
|
7495
7825
|
async #runWithFullTurnModel(modelOverride, fn) {
|
|
7496
7826
|
if (!modelOverride?.endsWith("\0")) {
|
|
@@ -7502,9 +7832,9 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7502
7832
|
/**
|
|
7503
7833
|
* Create the MessageDisplay hook dispatcher for one model call's streamed
|
|
7504
7834
|
* reply, or null when the hook isn't registered (the common case — keeps
|
|
7505
|
-
* the streaming loops zero-cost). The ACP surface consumes
|
|
7835
|
+
* the streaming loops zero-cost). The ACP surface consumes LlmChat's
|
|
7506
7836
|
* raw stream directly rather than going through
|
|
7507
|
-
*
|
|
7837
|
+
* LlmClient.sendMessageStream, so it has to fire this hook itself —
|
|
7508
7838
|
* with the same contract as the terminal UI path in client.ts: debounced
|
|
7509
7839
|
* cumulative text, one message_id per model call, and an is_final firing
|
|
7510
7840
|
* on every non-aborted exit (delivered by awaiting `finish()` in a
|
|
@@ -7530,7 +7860,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7530
7860
|
* was cancelled or the session token limit was exceeded.
|
|
7531
7861
|
*/
|
|
7532
7862
|
async #sendMessageStreamWithAutoCompression(promptId, message, abortSignal, options = {}) {
|
|
7533
|
-
const
|
|
7863
|
+
const llmClient = this.config.getLlmClient();
|
|
7534
7864
|
if (options.prepareBeforeCompression) {
|
|
7535
7865
|
const decision = await options.prepareBeforeCompression();
|
|
7536
7866
|
if (decision.kind === "stop") {
|
|
@@ -7549,7 +7879,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7549
7879
|
let compressionFailed = false;
|
|
7550
7880
|
if (!options.skipCompression && !(options.getModelOverride?.() ?? options.modelOverride)) {
|
|
7551
7881
|
try {
|
|
7552
|
-
const compressed = await
|
|
7882
|
+
const compressed = await llmClient.tryCompressChat(
|
|
7553
7883
|
promptId,
|
|
7554
7884
|
false,
|
|
7555
7885
|
abortSignal
|
|
@@ -7627,6 +7957,14 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
7627
7957
|
);
|
|
7628
7958
|
return { responseStream: null, stopReason: "cancelled" };
|
|
7629
7959
|
}
|
|
7960
|
+
if (message[0]?.functionResponse) {
|
|
7961
|
+
const memory = await llmClient.consumeManagedAutoMemoryRecall("tool_result");
|
|
7962
|
+
if (memory?.prompt) {
|
|
7963
|
+
message = insertAfterFunctionResponses(message, [
|
|
7964
|
+
{ text: memory.prompt }
|
|
7965
|
+
]);
|
|
7966
|
+
}
|
|
7967
|
+
}
|
|
7630
7968
|
const chat = this.#getCurrentChat();
|
|
7631
7969
|
const model = options.getModelOverride?.() ?? options.modelOverride ?? this.config.getModel();
|
|
7632
7970
|
const request = {
|
|
@@ -8062,15 +8400,18 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8062
8400
|
*/
|
|
8063
8401
|
async #startCronSchedulerIfNeeded() {
|
|
8064
8402
|
if (this.disposed) return;
|
|
8403
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
8065
8404
|
if (!this.config.isCronEnabled()) return;
|
|
8066
8405
|
if (this.cronDisabledByTokenLimit) return;
|
|
8067
8406
|
const scheduler = this.config.getCronScheduler();
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8407
|
+
if (!this.requiresManagedConversationBinding) {
|
|
8408
|
+
try {
|
|
8409
|
+
await scheduler.enableDurable(this.sessionId);
|
|
8410
|
+
} catch (err) {
|
|
8411
|
+
debugLogger6.warn(
|
|
8412
|
+
`Durable cron init failed \u2014 persistent tasks will not fire in this session: ${err}`
|
|
8413
|
+
);
|
|
8414
|
+
}
|
|
8074
8415
|
}
|
|
8075
8416
|
if (this.disposed) return;
|
|
8076
8417
|
if (!scheduler.hasPendingWork) return;
|
|
@@ -8146,6 +8487,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8146
8487
|
async #drainCronQueue() {
|
|
8147
8488
|
if (this.disposed) return;
|
|
8148
8489
|
if (this.closing) return;
|
|
8490
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
8149
8491
|
if (this.cronProcessing) return;
|
|
8150
8492
|
if (this.pendingPrompt) return;
|
|
8151
8493
|
if (this.goalProcessing) return;
|
|
@@ -8158,6 +8500,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8158
8500
|
}
|
|
8159
8501
|
async #drainCronQueueExclusive() {
|
|
8160
8502
|
if (this.disposed || this.closing || this.cronProcessing) return;
|
|
8503
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
8161
8504
|
if (this.pendingPrompt || this.notificationProcessing) return;
|
|
8162
8505
|
if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
|
|
8163
8506
|
if (this.#nextCronQueueIndex() < 0) return;
|
|
@@ -8234,11 +8577,13 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8234
8577
|
* `_meta.source='cron'`, streams the model response, and handles tool calls.
|
|
8235
8578
|
*/
|
|
8236
8579
|
async #executeCronPrompt(item) {
|
|
8237
|
-
return
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8580
|
+
return goalTurnContext.exit(
|
|
8581
|
+
() => runWithInvocationContext(
|
|
8582
|
+
void 0,
|
|
8583
|
+
() => sessionIdContext.run(
|
|
8584
|
+
this.config.getSessionId(),
|
|
8585
|
+
() => this.#executeCronPromptInner(item)
|
|
8586
|
+
)
|
|
8242
8587
|
)
|
|
8243
8588
|
);
|
|
8244
8589
|
}
|
|
@@ -8751,6 +9096,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8751
9096
|
async #drainNotificationQueue() {
|
|
8752
9097
|
if (this.disposed) return;
|
|
8753
9098
|
if (this.closing) return;
|
|
9099
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
8754
9100
|
if (this.notificationProcessing) return;
|
|
8755
9101
|
if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
|
|
8756
9102
|
return;
|
|
@@ -8764,6 +9110,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8764
9110
|
}
|
|
8765
9111
|
async #drainNotificationQueueExclusive() {
|
|
8766
9112
|
if (this.disposed || this.closing || this.notificationProcessing) return;
|
|
9113
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
8767
9114
|
if (this.pendingPrompt || this.cronProcessing || this.cronAbortController) {
|
|
8768
9115
|
return;
|
|
8769
9116
|
}
|
|
@@ -8800,11 +9147,13 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
8800
9147
|
this.currentShellNotificationActive = item.kind === "shell";
|
|
8801
9148
|
this.#activeWorkChanged();
|
|
8802
9149
|
try {
|
|
8803
|
-
await
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
9150
|
+
await goalTurnContext.exit(
|
|
9151
|
+
() => runWithInvocationContext(
|
|
9152
|
+
void 0,
|
|
9153
|
+
() => sessionIdContext.run(
|
|
9154
|
+
this.config.getSessionId(),
|
|
9155
|
+
() => this.#executeBackgroundNotificationPromptInner(item)
|
|
9156
|
+
)
|
|
8808
9157
|
)
|
|
8809
9158
|
);
|
|
8810
9159
|
} finally {
|
|
@@ -9183,12 +9532,17 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
9183
9532
|
reloadSkillSettings() {
|
|
9184
9533
|
this.settings.reloadScopeFromDisk("Workspace" /* Workspace */);
|
|
9185
9534
|
}
|
|
9186
|
-
|
|
9187
|
-
|
|
9535
|
+
buildAvailableCommandsSnapshot() {
|
|
9536
|
+
return buildAvailableCommandsSnapshot(
|
|
9188
9537
|
this.config,
|
|
9189
9538
|
void 0,
|
|
9190
|
-
this.settings
|
|
9539
|
+
this.settings,
|
|
9540
|
+
this.slashCommandPolicy
|
|
9191
9541
|
);
|
|
9542
|
+
}
|
|
9543
|
+
async sendAvailableCommandsUpdateOrThrow() {
|
|
9544
|
+
if (this.#isAutomaticWorkHeld()) return;
|
|
9545
|
+
const { availableCommands, availableSkills, availableSkillDetails } = await this.buildAvailableCommandsSnapshot();
|
|
9192
9546
|
const update = {
|
|
9193
9547
|
sessionUpdate: "available_commands_update",
|
|
9194
9548
|
availableCommands,
|
|
@@ -9331,7 +9685,8 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
9331
9685
|
}).catch((error) => {
|
|
9332
9686
|
debugLogger6.debug("model-update extNotification failed", error);
|
|
9333
9687
|
});
|
|
9334
|
-
|
|
9688
|
+
const persistDefault = !this.requiresManagedConversationBinding && (options.persistDefault ?? true);
|
|
9689
|
+
if (persistDefault) {
|
|
9335
9690
|
const persistScope = getPersistScopeForModelSelection(this.settings);
|
|
9336
9691
|
this.settings.setValue(
|
|
9337
9692
|
persistScope,
|
|
@@ -9455,11 +9810,16 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
9455
9810
|
if (record.skipPersistence === true || this.#shouldSkipRestoredAskUserQuestionPersistence(record.callId)) {
|
|
9456
9811
|
return;
|
|
9457
9812
|
}
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9813
|
+
const goalProvenance = ambientGoalToolResultProvenance(record.toolName);
|
|
9814
|
+
this.config.getChatRecordingService()?.recordToolResult(
|
|
9815
|
+
finalized[index].responseParts,
|
|
9816
|
+
{
|
|
9817
|
+
...record.metadata,
|
|
9818
|
+
persistedOutputFiles: finalized[index].persistedOutputFiles,
|
|
9819
|
+
artifacts: finalized[index].artifacts
|
|
9820
|
+
},
|
|
9821
|
+
...goalProvenance ? [goalProvenance] : []
|
|
9822
|
+
);
|
|
9463
9823
|
});
|
|
9464
9824
|
return {
|
|
9465
9825
|
...result,
|
|
@@ -9943,13 +10303,13 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
9943
10303
|
/**
|
|
9944
10304
|
* Assemble the per-turn system reminders the model needs to see at the
|
|
9945
10305
|
* start of a user query or cron fire. Mirrors the subagent/plan/arena
|
|
9946
|
-
* branches in `
|
|
10306
|
+
* branches in `LlmClient.sendMessageStream` (`client.ts:848-878`) —
|
|
9947
10307
|
* the ACP path bypasses that code, so without this helper plan mode is
|
|
9948
10308
|
* silently inert and subagent/arena sessions lose context.
|
|
9949
10309
|
*
|
|
9950
10310
|
* Scope note: the `relevantAutoMemory` reminder is intentionally NOT
|
|
9951
10311
|
* included here. Managed auto-memory requires a prefetch pipeline that
|
|
9952
|
-
* lives in `
|
|
10312
|
+
* lives in `LlmClient`, and porting it into the ACP path is tracked
|
|
9953
10313
|
* separately as part of the broader middleware-alignment work.
|
|
9954
10314
|
*/
|
|
9955
10315
|
async #buildInitialSystemReminders() {
|
|
@@ -10231,6 +10591,18 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
10231
10591
|
const isAgentTool = tool.name === ToolNames.AGENT;
|
|
10232
10592
|
const isExitPlanModeTool = tool.name === ToolNames.EXIT_PLAN_MODE;
|
|
10233
10593
|
const isEnterPlanModeTool = tool.name === ToolNames.ENTER_PLAN_MODE;
|
|
10594
|
+
const requestsAgentWorkingDirectory = isAgentTool && (args["isolation"] === "worktree" || typeof args["working_dir"] === "string" && args["working_dir"].trim().length > 0);
|
|
10595
|
+
if (this.requiresManagedConversationBinding && (requestsAgentWorkingDirectory || tool.name === ToolNames.ENTER_WORKTREE || tool.name === ToolNames.EXIT_WORKTREE)) {
|
|
10596
|
+
return earlyErrorResponse(
|
|
10597
|
+
new Error(STANDALONE_WORKTREE_ACTION_ERROR),
|
|
10598
|
+
toolName,
|
|
10599
|
+
{
|
|
10600
|
+
status: "error",
|
|
10601
|
+
errorType: "execution_denied" /* EXECUTION_DENIED */,
|
|
10602
|
+
executionStatus: "not_started"
|
|
10603
|
+
}
|
|
10604
|
+
);
|
|
10605
|
+
}
|
|
10234
10606
|
if (isAgentTool) {
|
|
10235
10607
|
agentToolAbortController = new AbortController();
|
|
10236
10608
|
activeToolAbortSignal = agentToolAbortController.signal;
|
|
@@ -10270,7 +10642,8 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
10270
10642
|
agentToolAbortController?.abort(USER_CANCEL_ABORT_REASON);
|
|
10271
10643
|
onStopAfterPermissionCancel?.();
|
|
10272
10644
|
},
|
|
10273
|
-
(params, signal) => this.#requestPermissionQueued(params, signal)
|
|
10645
|
+
(params, signal) => this.#requestPermissionQueued(params, signal),
|
|
10646
|
+
this.requiresManagedConversationBinding ? STANDALONE_PERMISSION_PERSISTENCE_POLICY : void 0
|
|
10274
10647
|
);
|
|
10275
10648
|
subAgentCleanupFunctions = subSubAgentTracker.setup(
|
|
10276
10649
|
taskEventEmitter,
|
|
@@ -10398,7 +10771,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
10398
10771
|
if (!autoModeAllowed && !requiresUserInteraction && shouldRunAutoModeForCall(approvalMode, policyToolName)) {
|
|
10399
10772
|
const denialState = this.config.getAutoModeDenialState();
|
|
10400
10773
|
const fallback = shouldFallback(denialState);
|
|
10401
|
-
const messages = this.config.
|
|
10774
|
+
const messages = this.config.getLlmClient?.()?.getHistoryTail(MAX_TRANSCRIPT_MESSAGES, false) ?? [];
|
|
10402
10775
|
const decision = await evaluateAutoMode({
|
|
10403
10776
|
ctx: pmCtx,
|
|
10404
10777
|
pmForcedAsk,
|
|
@@ -10688,7 +11061,8 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
10688
11061
|
}
|
|
10689
11062
|
const permissionOptions = toPermissionOptions(
|
|
10690
11063
|
confirmationDetails,
|
|
10691
|
-
pmForcedAsk
|
|
11064
|
+
pmForcedAsk,
|
|
11065
|
+
this.requiresManagedConversationBinding ? STANDALONE_PERMISSION_PERSISTENCE_POLICY : void 0
|
|
10692
11066
|
);
|
|
10693
11067
|
const offeredPermissionOptions = permissionOptions.map(
|
|
10694
11068
|
(option) => ({ ...option })
|
|
@@ -10841,7 +11215,7 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
10841
11215
|
const modeUpdateCancellation = cancelBeforeExecutionIfAborted(toolName);
|
|
10842
11216
|
if (modeUpdateCancellation) return modeUpdateCancellation;
|
|
10843
11217
|
}
|
|
10844
|
-
if (outcome === "
|
|
11218
|
+
if (outcome === "proceed_always_project" /* ProceedAlwaysProject */ || outcome === "proceed_always_user" /* ProceedAlwaysUser */) {
|
|
10845
11219
|
await persistPermissionOutcome(
|
|
10846
11220
|
outcome,
|
|
10847
11221
|
confirmationDetails,
|
|
@@ -11479,6 +11853,9 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
11479
11853
|
executionStatus
|
|
11480
11854
|
});
|
|
11481
11855
|
} finally {
|
|
11856
|
+
if (terminalStatus && terminalStatus !== "cancelled") {
|
|
11857
|
+
this.config.getLlmClient().recordCompletedToolCall(toolName, args);
|
|
11858
|
+
}
|
|
11482
11859
|
if (terminalStatus === "cancelled") {
|
|
11483
11860
|
endToolSpan(toolSpan, { success: false, cancelled: true });
|
|
11484
11861
|
} else {
|
|
@@ -11551,6 +11928,13 @@ ${this.pendingRecoveredAgentsNotice}
|
|
|
11551
11928
|
return null;
|
|
11552
11929
|
}
|
|
11553
11930
|
case "unsupported": {
|
|
11931
|
+
if (result.originalType === "unsupported_action") {
|
|
11932
|
+
throw new RequestError(
|
|
11933
|
+
-32004,
|
|
11934
|
+
"This action is not supported in this standalone session.",
|
|
11935
|
+
{ errorKind: "unsupported_action" }
|
|
11936
|
+
);
|
|
11937
|
+
}
|
|
11554
11938
|
const unsupportedError = `Slash command not supported in ACP integration: ${result.reason}`;
|
|
11555
11939
|
throw new Error(unsupportedError);
|
|
11556
11940
|
}
|
|
@@ -13706,7 +14090,8 @@ function getSessionSource(params) {
|
|
|
13706
14090
|
}
|
|
13707
14091
|
return {
|
|
13708
14092
|
sourceType: value["sourceType"],
|
|
13709
|
-
...typeof value["sourceId"] === "string" ? { sourceId: value["sourceId"] } : {}
|
|
14093
|
+
...typeof value["sourceId"] === "string" ? { sourceId: value["sourceId"] } : {},
|
|
14094
|
+
...value[DAEMON_OWNED_STANDALONE_CREATION_KEY] === true ? { daemonOwnedStandaloneCreation: true } : {}
|
|
13710
14095
|
};
|
|
13711
14096
|
}
|
|
13712
14097
|
__name(getSessionSource, "getSessionSource");
|
|
@@ -14524,7 +14909,7 @@ function readScopeSettings(settings, scope) {
|
|
|
14524
14909
|
}
|
|
14525
14910
|
__name(readScopeSettings, "readScopeSettings");
|
|
14526
14911
|
async function resolvePreferredMemoryFile(dir, fallbackFilename) {
|
|
14527
|
-
for (const filename of
|
|
14912
|
+
for (const filename of getAllMemoryFilenames()) {
|
|
14528
14913
|
const filePath = path6.join(dir, filename);
|
|
14529
14914
|
try {
|
|
14530
14915
|
await fs3.access(filePath);
|
|
@@ -14536,7 +14921,7 @@ async function resolvePreferredMemoryFile(dir, fallbackFilename) {
|
|
|
14536
14921
|
}
|
|
14537
14922
|
__name(resolvePreferredMemoryFile, "resolvePreferredMemoryFile");
|
|
14538
14923
|
async function resolveQwenMemoryPaths(params) {
|
|
14539
|
-
const fallbackFilename =
|
|
14924
|
+
const fallbackFilename = getAllMemoryFilenames()[0] ?? "QWEN.md";
|
|
14540
14925
|
const userMemoryFile = await resolvePreferredMemoryFile(
|
|
14541
14926
|
Storage.getGlobalQwenDir(),
|
|
14542
14927
|
fallbackFilename
|
|
@@ -14760,7 +15145,7 @@ async function runAcpAgent(config, settings, argv, options) {
|
|
|
14760
15145
|
beginAcpBootstrapConfigProfiling();
|
|
14761
15146
|
try {
|
|
14762
15147
|
await config.initialize({
|
|
14763
|
-
|
|
15148
|
+
skipLlmInitialization: true,
|
|
14764
15149
|
// Bootstrap skips MCP discovery — each session runs its own
|
|
14765
15150
|
// pool-routed discovery, so bootstrap-level spawns would be
|
|
14766
15151
|
// redundant subprocess leaks (W119).
|
|
@@ -15152,6 +15537,100 @@ function isOwnerOnlyDirectory(stats) {
|
|
|
15152
15537
|
return (stats.mode & 63) === 0;
|
|
15153
15538
|
}
|
|
15154
15539
|
__name(isOwnerOnlyDirectory, "isOwnerOnlyDirectory");
|
|
15540
|
+
function hasOnlyKeys(value, keys) {
|
|
15541
|
+
const actual = Object.keys(value).sort();
|
|
15542
|
+
const expected = [...keys].sort();
|
|
15543
|
+
return actual.length === expected.length && actual.every((key, index) => key === expected[index]);
|
|
15544
|
+
}
|
|
15545
|
+
__name(hasOnlyKeys, "hasOnlyKeys");
|
|
15546
|
+
function isManagedConversationPath(value) {
|
|
15547
|
+
return typeof value === "string" && value.length > 0 && !value.includes("\0") && path6.isAbsolute(value);
|
|
15548
|
+
}
|
|
15549
|
+
__name(isManagedConversationPath, "isManagedConversationPath");
|
|
15550
|
+
function isManagedConversationIdentityNumber(value) {
|
|
15551
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
15552
|
+
}
|
|
15553
|
+
__name(isManagedConversationIdentityNumber, "isManagedConversationIdentityNumber");
|
|
15554
|
+
function parseConversationDirectoryExpectation(value) {
|
|
15555
|
+
if (value === void 0) return void 0;
|
|
15556
|
+
if (!isObjectRecord(value) || !hasOnlyKeys(value, ["canonicalSessionId", "root", "child"])) {
|
|
15557
|
+
throw RequestError.invalidParams(
|
|
15558
|
+
void 0,
|
|
15559
|
+
"Invalid managed conversation directory expectation"
|
|
15560
|
+
);
|
|
15561
|
+
}
|
|
15562
|
+
const canonicalSessionId = value["canonicalSessionId"];
|
|
15563
|
+
const root = value["root"];
|
|
15564
|
+
const child = value["child"];
|
|
15565
|
+
const parsedSessionId = parseCallerSuppliedSessionId(canonicalSessionId);
|
|
15566
|
+
if (parsedSessionId.kind !== "valid" || parsedSessionId.sessionId !== canonicalSessionId || !isObjectRecord(root) || !hasOnlyKeys(root, ["canonicalPath", "device", "inode"]) || !isManagedConversationPath(root["canonicalPath"]) || !isManagedConversationIdentityNumber(root["device"]) || !isManagedConversationIdentityNumber(root["inode"]) || !isObjectRecord(child) || !hasOnlyKeys(child, ["name", "canonicalPath", "device", "inode"]) || typeof child["name"] !== "string" || child["name"] !== getConversationDirectoryName(canonicalSessionId) || !isManagedConversationPath(child["canonicalPath"]) || !isManagedConversationIdentityNumber(child["device"]) || !isManagedConversationIdentityNumber(child["inode"]) || !isSameConversationPath(
|
|
15567
|
+
path6.dirname(child["canonicalPath"]),
|
|
15568
|
+
root["canonicalPath"]
|
|
15569
|
+
) || path6.basename(child["canonicalPath"]) !== child["name"]) {
|
|
15570
|
+
throw RequestError.invalidParams(
|
|
15571
|
+
void 0,
|
|
15572
|
+
"Invalid managed conversation directory expectation"
|
|
15573
|
+
);
|
|
15574
|
+
}
|
|
15575
|
+
return {
|
|
15576
|
+
canonicalSessionId,
|
|
15577
|
+
root: {
|
|
15578
|
+
canonicalPath: root["canonicalPath"],
|
|
15579
|
+
device: root["device"],
|
|
15580
|
+
inode: root["inode"]
|
|
15581
|
+
},
|
|
15582
|
+
child: {
|
|
15583
|
+
name: child["name"],
|
|
15584
|
+
canonicalPath: child["canonicalPath"],
|
|
15585
|
+
device: child["device"],
|
|
15586
|
+
inode: child["inode"]
|
|
15587
|
+
}
|
|
15588
|
+
};
|
|
15589
|
+
}
|
|
15590
|
+
__name(parseConversationDirectoryExpectation, "parseConversationDirectoryExpectation");
|
|
15591
|
+
function managedConversationDirectoryError(missing) {
|
|
15592
|
+
return new RequestError(
|
|
15593
|
+
-32004,
|
|
15594
|
+
missing ? "The standalone working directory is missing." : "The standalone working directory identity is compromised.",
|
|
15595
|
+
{
|
|
15596
|
+
errorKind: missing ? "working_directory_missing" : "working_directory_compromised"
|
|
15597
|
+
}
|
|
15598
|
+
);
|
|
15599
|
+
}
|
|
15600
|
+
__name(managedConversationDirectoryError, "managedConversationDirectoryError");
|
|
15601
|
+
async function assertManagedConversationDirectoryIdentity(expectation) {
|
|
15602
|
+
let rootBefore;
|
|
15603
|
+
let canonicalRoot;
|
|
15604
|
+
let rootAfter;
|
|
15605
|
+
try {
|
|
15606
|
+
rootBefore = await fs3.lstat(expectation.root.canonicalPath);
|
|
15607
|
+
canonicalRoot = await fs3.realpath(expectation.root.canonicalPath);
|
|
15608
|
+
rootAfter = await fs3.lstat(canonicalRoot);
|
|
15609
|
+
} catch (error) {
|
|
15610
|
+
throw managedConversationDirectoryError(
|
|
15611
|
+
error.code === "ENOENT"
|
|
15612
|
+
);
|
|
15613
|
+
}
|
|
15614
|
+
if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || !isSameConversationPath(canonicalRoot, expectation.root.canonicalPath) || rootBefore.dev !== expectation.root.device || rootBefore.ino !== expectation.root.inode || rootAfter.dev !== expectation.root.device || rootAfter.ino !== expectation.root.inode) {
|
|
15615
|
+
throw managedConversationDirectoryError(false);
|
|
15616
|
+
}
|
|
15617
|
+
let childBefore;
|
|
15618
|
+
let canonicalChild;
|
|
15619
|
+
let childAfter;
|
|
15620
|
+
try {
|
|
15621
|
+
childBefore = await fs3.lstat(expectation.child.canonicalPath);
|
|
15622
|
+
canonicalChild = await fs3.realpath(expectation.child.canonicalPath);
|
|
15623
|
+
childAfter = await fs3.lstat(canonicalChild);
|
|
15624
|
+
} catch (error) {
|
|
15625
|
+
throw managedConversationDirectoryError(
|
|
15626
|
+
error.code === "ENOENT"
|
|
15627
|
+
);
|
|
15628
|
+
}
|
|
15629
|
+
if (!isOwnerOnlyDirectory(childBefore) || !isOwnerOnlyDirectory(childAfter) || !isSameConversationPath(canonicalChild, expectation.child.canonicalPath) || childBefore.dev !== expectation.child.device || childBefore.ino !== expectation.child.inode || childAfter.dev !== expectation.child.device || childAfter.ino !== expectation.child.inode) {
|
|
15630
|
+
throw managedConversationDirectoryError(false);
|
|
15631
|
+
}
|
|
15632
|
+
}
|
|
15633
|
+
__name(assertManagedConversationDirectoryIdentity, "assertManagedConversationDirectoryIdentity");
|
|
15155
15634
|
var QwenAgent = class {
|
|
15156
15635
|
constructor(config, settings, argv, connection, expectedPrivateParentCapability, sessionWriterLeaseEnabledAtStartup = false, managedToolInvocationGuard, externalToolGuardProviderAttached = false) {
|
|
15157
15636
|
this.config = config;
|
|
@@ -15447,9 +15926,9 @@ var QwenAgent = class {
|
|
|
15447
15926
|
const registry = config.getToolRegistry();
|
|
15448
15927
|
if (operation === "discover") {
|
|
15449
15928
|
await registry?.discoverToolsForServer(serverName);
|
|
15450
|
-
const
|
|
15451
|
-
if (
|
|
15452
|
-
await
|
|
15929
|
+
const llmClient = config.getLlmClient?.();
|
|
15930
|
+
if (llmClient?.isInitialized?.()) {
|
|
15931
|
+
await llmClient.setTools?.();
|
|
15453
15932
|
}
|
|
15454
15933
|
} else if (operation === "disable") {
|
|
15455
15934
|
await registry?.disableMcpServer(serverName);
|
|
@@ -15519,7 +15998,7 @@ var QwenAgent = class {
|
|
|
15519
15998
|
config.setMcpTransportPool(this.mcpPool);
|
|
15520
15999
|
try {
|
|
15521
16000
|
await config.initialize({
|
|
15522
|
-
|
|
16001
|
+
skipLlmInitialization: true,
|
|
15523
16002
|
skipFileCheckpointing: true,
|
|
15524
16003
|
skipHooks: true,
|
|
15525
16004
|
skipSkillManager: true,
|
|
@@ -15635,9 +16114,9 @@ var QwenAgent = class {
|
|
|
15635
16114
|
}
|
|
15636
16115
|
await Promise.all(
|
|
15637
16116
|
this.getLiveMcpConfigs(serverName).map(async (config) => {
|
|
15638
|
-
const
|
|
15639
|
-
if (
|
|
15640
|
-
await
|
|
16117
|
+
const llmClient = config.getLlmClient?.();
|
|
16118
|
+
if (llmClient?.isInitialized?.()) {
|
|
16119
|
+
await llmClient.setTools?.();
|
|
15641
16120
|
}
|
|
15642
16121
|
})
|
|
15643
16122
|
);
|
|
@@ -16046,7 +16525,7 @@ var QwenAgent = class {
|
|
|
16046
16525
|
}
|
|
16047
16526
|
this.clientCapabilities = args.clientCapabilities;
|
|
16048
16527
|
const authMethods = buildAuthMethods();
|
|
16049
|
-
const version = "0.22.
|
|
16528
|
+
const version = "0.22.3-nightly.20260829.e5cb60ad48";
|
|
16050
16529
|
const response = {
|
|
16051
16530
|
protocolVersion: PROTOCOL_VERSION,
|
|
16052
16531
|
agentInfo: {
|
|
@@ -16183,6 +16662,15 @@ var QwenAgent = class {
|
|
|
16183
16662
|
const releaseStartingSessionId = requestedSessionId ? this.reserveStartingSessionId(requestedSessionId) : void 0;
|
|
16184
16663
|
try {
|
|
16185
16664
|
const sessionSource = getSessionSource(params);
|
|
16665
|
+
const provisionalStandalone = isReservedStandaloneSessionSourceType(
|
|
16666
|
+
sessionSource?.sourceType
|
|
16667
|
+
);
|
|
16668
|
+
if (sessionSource && isReservedStandaloneSessionSourceType(sessionSource.sourceType) && (sessionSource.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
|
|
16669
|
+
throw RequestError.invalidParams(
|
|
16670
|
+
void 0,
|
|
16671
|
+
"`standalone` is reserved for daemon-owned session creation"
|
|
16672
|
+
);
|
|
16673
|
+
}
|
|
16186
16674
|
const parentContext = extractDaemonTraceContext(params);
|
|
16187
16675
|
return await withDaemonSpan(
|
|
16188
16676
|
"qwen-code.daemon.session_start",
|
|
@@ -16208,14 +16696,21 @@ var QwenAgent = class {
|
|
|
16208
16696
|
);
|
|
16209
16697
|
let session;
|
|
16210
16698
|
try {
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16699
|
+
if (!provisionalStandalone) {
|
|
16700
|
+
await profiler.time(
|
|
16701
|
+
"auth",
|
|
16702
|
+
() => this.ensureAuthenticated(config)
|
|
16703
|
+
);
|
|
16704
|
+
profiler.timeSync(
|
|
16705
|
+
"file_system_setup",
|
|
16706
|
+
() => this.setupFileSystem(config)
|
|
16707
|
+
);
|
|
16708
|
+
}
|
|
16216
16709
|
session = await profiler.time(
|
|
16217
16710
|
"session_register",
|
|
16218
|
-
() => this.createAndStoreSession(config, settings
|
|
16711
|
+
() => this.createAndStoreSession(config, settings, void 0, {
|
|
16712
|
+
deferWorkspaceActivation: provisionalStandalone
|
|
16713
|
+
})
|
|
16219
16714
|
);
|
|
16220
16715
|
} catch (error) {
|
|
16221
16716
|
return this.cleanupAfterRequestFailure(error, async () => {
|
|
@@ -16259,6 +16754,15 @@ var QwenAgent = class {
|
|
|
16259
16754
|
async loadSessionWithProfiler(params, initialSessionId, profiler) {
|
|
16260
16755
|
let sessionId = initialSessionId;
|
|
16261
16756
|
const sessionSource = getSessionSource(params);
|
|
16757
|
+
const provisionalStandalone = isReservedStandaloneSessionSourceType(
|
|
16758
|
+
sessionSource?.sourceType
|
|
16759
|
+
);
|
|
16760
|
+
if (provisionalStandalone && (sessionSource?.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
|
|
16761
|
+
throw RequestError.invalidParams(
|
|
16762
|
+
void 0,
|
|
16763
|
+
"`standalone` is reserved for daemon-owned session restore"
|
|
16764
|
+
);
|
|
16765
|
+
}
|
|
16262
16766
|
const restoreOptions = loadRestoreOptions(params);
|
|
16263
16767
|
const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
|
|
16264
16768
|
const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
|
|
@@ -16421,21 +16925,37 @@ var QwenAgent = class {
|
|
|
16421
16925
|
} : {}
|
|
16422
16926
|
})), "buildResponse");
|
|
16423
16927
|
try {
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16928
|
+
if (!provisionalStandalone) {
|
|
16929
|
+
await profiler.time(
|
|
16930
|
+
"restore_session_model",
|
|
16931
|
+
() => restoreSessionModelThenAuthenticate(
|
|
16932
|
+
config,
|
|
16933
|
+
projection,
|
|
16934
|
+
() => profiler.time("auth", () => this.ensureAuthenticated(config))
|
|
16935
|
+
)
|
|
16936
|
+
);
|
|
16937
|
+
profiler.timeSync(
|
|
16938
|
+
"file_system_setup",
|
|
16939
|
+
() => this.setupFileSystem(config)
|
|
16940
|
+
);
|
|
16941
|
+
}
|
|
16436
16942
|
await profiler.time(
|
|
16437
16943
|
"session_register",
|
|
16438
16944
|
() => this.createAndStoreSession(config, settings, void 0, {
|
|
16945
|
+
deferWorkspaceActivation: provisionalStandalone,
|
|
16946
|
+
...provisionalStandalone ? {
|
|
16947
|
+
beforeDeferredWorkspaceActivation: /* @__PURE__ */ __name(() => profiler.time(
|
|
16948
|
+
"restore_session_model",
|
|
16949
|
+
() => restoreSessionModelThenAuthenticate(
|
|
16950
|
+
config,
|
|
16951
|
+
projection,
|
|
16952
|
+
() => profiler.time(
|
|
16953
|
+
"auth",
|
|
16954
|
+
() => this.ensureAuthenticated(config)
|
|
16955
|
+
)
|
|
16956
|
+
)
|
|
16957
|
+
), "beforeDeferredWorkspaceActivation")
|
|
16958
|
+
} : {},
|
|
16439
16959
|
enableLiveScreenContext: isCompatibleLiveSessionSource(
|
|
16440
16960
|
sessionSource ?? {}
|
|
16441
16961
|
),
|
|
@@ -16581,7 +17101,9 @@ var QwenAgent = class {
|
|
|
16581
17101
|
}
|
|
16582
17102
|
}
|
|
16583
17103
|
await profiler.time("post_replay_services", async () => {
|
|
16584
|
-
|
|
17104
|
+
if (!provisionalStandalone) {
|
|
17105
|
+
await this.#restoreWorktreeOnResume(config, createdSession);
|
|
17106
|
+
}
|
|
16585
17107
|
await this.#restoreBackgroundAgentsOnResume(
|
|
16586
17108
|
config,
|
|
16587
17109
|
createdSession
|
|
@@ -16630,6 +17152,15 @@ var QwenAgent = class {
|
|
|
16630
17152
|
async resumeSessionWithProfiler(params, initialSessionId, profiler) {
|
|
16631
17153
|
let sessionId = initialSessionId;
|
|
16632
17154
|
const sessionSource = getSessionSource(params);
|
|
17155
|
+
const provisionalStandalone = isReservedStandaloneSessionSourceType(
|
|
17156
|
+
sessionSource?.sourceType
|
|
17157
|
+
);
|
|
17158
|
+
if (provisionalStandalone && (sessionSource?.daemonOwnedStandaloneCreation !== true || !this.isTrustedManagedParent())) {
|
|
17159
|
+
throw RequestError.invalidParams(
|
|
17160
|
+
void 0,
|
|
17161
|
+
"`standalone` is reserved for daemon-owned session restore"
|
|
17162
|
+
);
|
|
17163
|
+
}
|
|
16633
17164
|
const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
|
|
16634
17165
|
const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
|
|
16635
17166
|
const liveSession = this.sessions.get(sessionId);
|
|
@@ -16700,21 +17231,37 @@ var QwenAgent = class {
|
|
|
16700
17231
|
const projection = config.consumeSessionRestoreProjection?.();
|
|
16701
17232
|
let response;
|
|
16702
17233
|
try {
|
|
16703
|
-
|
|
16704
|
-
|
|
16705
|
-
|
|
16706
|
-
|
|
16707
|
-
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
|
|
16713
|
-
|
|
16714
|
-
|
|
17234
|
+
if (!provisionalStandalone) {
|
|
17235
|
+
await profiler.time(
|
|
17236
|
+
"restore_session_model",
|
|
17237
|
+
() => restoreSessionModelThenAuthenticate(
|
|
17238
|
+
config,
|
|
17239
|
+
projection,
|
|
17240
|
+
() => profiler.time("auth", () => this.ensureAuthenticated(config))
|
|
17241
|
+
)
|
|
17242
|
+
);
|
|
17243
|
+
profiler.timeSync(
|
|
17244
|
+
"file_system_setup",
|
|
17245
|
+
() => this.setupFileSystem(config)
|
|
17246
|
+
);
|
|
17247
|
+
}
|
|
16715
17248
|
await profiler.time(
|
|
16716
17249
|
"session_register",
|
|
16717
17250
|
() => this.createAndStoreSession(config, settings, void 0, {
|
|
17251
|
+
deferWorkspaceActivation: provisionalStandalone,
|
|
17252
|
+
...provisionalStandalone ? {
|
|
17253
|
+
beforeDeferredWorkspaceActivation: /* @__PURE__ */ __name(() => profiler.time(
|
|
17254
|
+
"restore_session_model",
|
|
17255
|
+
() => restoreSessionModelThenAuthenticate(
|
|
17256
|
+
config,
|
|
17257
|
+
projection,
|
|
17258
|
+
() => profiler.time(
|
|
17259
|
+
"auth",
|
|
17260
|
+
() => this.ensureAuthenticated(config)
|
|
17261
|
+
)
|
|
17262
|
+
)
|
|
17263
|
+
), "beforeDeferredWorkspaceActivation")
|
|
17264
|
+
} : {},
|
|
16718
17265
|
enableLiveScreenContext: isCompatibleLiveSessionSource(
|
|
16719
17266
|
sessionSource ?? {}
|
|
16720
17267
|
),
|
|
@@ -16738,7 +17285,9 @@ var QwenAgent = class {
|
|
|
16738
17285
|
}, "primeSession"),
|
|
16739
17286
|
beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
|
|
16740
17287
|
await profiler.time("post_replay_services", async () => {
|
|
16741
|
-
|
|
17288
|
+
if (!provisionalStandalone) {
|
|
17289
|
+
await this.#restoreWorktreeOnResume(config, createdSession);
|
|
17290
|
+
}
|
|
16742
17291
|
await this.#restoreBackgroundAgentsOnResume(
|
|
16743
17292
|
config,
|
|
16744
17293
|
createdSession
|
|
@@ -16874,15 +17423,17 @@ var QwenAgent = class {
|
|
|
16874
17423
|
break;
|
|
16875
17424
|
}
|
|
16876
17425
|
case "reasoning_effort": {
|
|
17426
|
+
const generation = session.getConfig().getContentGeneratorConfig();
|
|
17427
|
+
const thinkingMandatory = generation.thinkingMandatory === true;
|
|
16877
17428
|
const modelReasoning = this.getModelReasoningConfiguration(
|
|
16878
17429
|
session.getConfig()
|
|
16879
17430
|
);
|
|
16880
17431
|
if (modelReasoning) {
|
|
16881
17432
|
const effortValues = modelReasoning.toggleOnly ? void 0 : modelReasoning.efforts;
|
|
16882
|
-
const selected = value === REASONING_EFFORT_NONE ? REASONING_EFFORT_NONE : modelReasoning.toggleOnly ? value === REASONING_EFFORT_DEFAULT ? REASONING_EFFORT_DEFAULT : void 0 : effortValues?.find((effort2) => effort2 === value);
|
|
17433
|
+
const selected = value === REASONING_EFFORT_NONE && !thinkingMandatory ? REASONING_EFFORT_NONE : modelReasoning.toggleOnly ? value === REASONING_EFFORT_DEFAULT ? REASONING_EFFORT_DEFAULT : void 0 : effortValues?.find((effort2) => effort2 === value);
|
|
16883
17434
|
if (!selected) {
|
|
16884
17435
|
const choices = [
|
|
16885
|
-
REASONING_EFFORT_NONE,
|
|
17436
|
+
...thinkingMandatory ? [] : [REASONING_EFFORT_NONE],
|
|
16886
17437
|
...effortValues ?? [REASONING_EFFORT_DEFAULT]
|
|
16887
17438
|
];
|
|
16888
17439
|
throw RequestError.invalidParams(
|
|
@@ -16890,7 +17441,17 @@ var QwenAgent = class {
|
|
|
16890
17441
|
`Unknown reasoning effort: ${value}. Choose one of: ${choices.join(", ")}`
|
|
16891
17442
|
);
|
|
16892
17443
|
}
|
|
16893
|
-
|
|
17444
|
+
if (!modelReasoning.toggleOnly) {
|
|
17445
|
+
for (const source of ["extra_body", "samplingParams"]) {
|
|
17446
|
+
const layer = generation[source];
|
|
17447
|
+
if (!layer) continue;
|
|
17448
|
+
const next = { ...layer };
|
|
17449
|
+
delete next["enable_thinking"];
|
|
17450
|
+
delete next["reasoning_effort"];
|
|
17451
|
+
delete next["thinking_budget"];
|
|
17452
|
+
generation[source] = next;
|
|
17453
|
+
}
|
|
17454
|
+
}
|
|
16894
17455
|
if (selected === REASONING_EFFORT_NONE) {
|
|
16895
17456
|
generation.reasoning = false;
|
|
16896
17457
|
} else if (selected === REASONING_EFFORT_DEFAULT) {
|
|
@@ -17774,18 +18335,17 @@ var QwenAgent = class {
|
|
|
17774
18335
|
for (const extension of config.getExtensions()) {
|
|
17775
18336
|
if (extension.isActive) continue;
|
|
17776
18337
|
for (const skill of extension.skills ?? []) {
|
|
17777
|
-
const extensionName = extension.
|
|
18338
|
+
const extensionName = extension.name;
|
|
17778
18339
|
const key = `extension:${extensionName}:${skill.name}`;
|
|
17779
|
-
if (skillsByKey.has(
|
|
17780
|
-
continue;
|
|
17781
|
-
}
|
|
18340
|
+
if (skillsByKey.has(key)) continue;
|
|
17782
18341
|
skillsByKey.set(
|
|
17783
18342
|
key,
|
|
17784
18343
|
mapSkillConfigToStatus(
|
|
17785
18344
|
{
|
|
17786
18345
|
...skill,
|
|
17787
18346
|
level: "extension",
|
|
17788
|
-
extensionName
|
|
18347
|
+
extensionName,
|
|
18348
|
+
extensionDisplayName: extension.displayName
|
|
17789
18349
|
},
|
|
17790
18350
|
disablements,
|
|
17791
18351
|
{ disabled: true }
|
|
@@ -17844,7 +18404,13 @@ var QwenAgent = class {
|
|
|
17844
18404
|
providers.set(authType, provider);
|
|
17845
18405
|
}
|
|
17846
18406
|
const isCurrent = currentAuth === model.authType && currentAcpModelId === modelId;
|
|
17847
|
-
const configOptions = model.isRuntimeModel || modelId.startsWith(ACP_ROUTE_ID_PREFIX) ? void 0 : buildModelReasoningConfigPreview(model.id
|
|
18407
|
+
const configOptions = model.isRuntimeModel || modelId.startsWith(ACP_ROUTE_ID_PREFIX) ? void 0 : buildModelReasoningConfigPreview(model.id, {
|
|
18408
|
+
thinkingMandatory: config.getResolvedModelConfig?.(
|
|
18409
|
+
model.authType,
|
|
18410
|
+
model.id,
|
|
18411
|
+
model.registryBaseUrl ?? model.baseUrl
|
|
18412
|
+
)?.generationConfig.thinkingMandatory === true
|
|
18413
|
+
});
|
|
17848
18414
|
const providerModel = {
|
|
17849
18415
|
modelId,
|
|
17850
18416
|
baseModelId: parseAcpBaseModelId(effectiveModelId),
|
|
@@ -18299,7 +18865,7 @@ var QwenAgent = class {
|
|
|
18299
18865
|
}
|
|
18300
18866
|
async buildSessionSupportedCommandsStatus(sessionId) {
|
|
18301
18867
|
const session = this.sessionOrThrow(sessionId);
|
|
18302
|
-
const { availableCommands, availableSkills } = await
|
|
18868
|
+
const { availableCommands, availableSkills } = await session.buildAvailableCommandsSnapshot();
|
|
18303
18869
|
return {
|
|
18304
18870
|
v: STATUS_SCHEMA_VERSION,
|
|
18305
18871
|
sessionId,
|
|
@@ -18344,12 +18910,26 @@ var QwenAgent = class {
|
|
|
18344
18910
|
const now = Date.now();
|
|
18345
18911
|
const createdAt = session.getCreatedAt();
|
|
18346
18912
|
const models = {};
|
|
18347
|
-
for (const [name,
|
|
18913
|
+
for (const [name, rawMetrics] of Object.entries(metrics.models)) {
|
|
18914
|
+
const m = metrics.statsModels?.[name] ?? rawMetrics;
|
|
18348
18915
|
models[name] = {
|
|
18349
18916
|
api: { ...m.api },
|
|
18350
18917
|
tokens: { ...m.tokens }
|
|
18351
18918
|
};
|
|
18352
18919
|
}
|
|
18920
|
+
const sources = [];
|
|
18921
|
+
for (const [id, source] of Object.entries(metrics.sourceMetrics ?? {})) {
|
|
18922
|
+
const meta = metrics.sourceMeta?.[id];
|
|
18923
|
+
sources.push({
|
|
18924
|
+
id,
|
|
18925
|
+
type: meta?.type ?? "",
|
|
18926
|
+
name: meta?.name ?? id,
|
|
18927
|
+
tokens: { ...source.tokens }
|
|
18928
|
+
});
|
|
18929
|
+
}
|
|
18930
|
+
sources.sort(
|
|
18931
|
+
(a, b) => b.tokens.total - a.tokens.total || a.id.localeCompare(b.id)
|
|
18932
|
+
);
|
|
18353
18933
|
const byName = {};
|
|
18354
18934
|
for (const [name, t] of Object.entries(metrics.tools.byName)) {
|
|
18355
18935
|
byName[name] = {
|
|
@@ -18392,6 +18972,7 @@ var QwenAgent = class {
|
|
|
18392
18972
|
durationMs: now - createdAt,
|
|
18393
18973
|
promptCount: session.getTurnCount(),
|
|
18394
18974
|
models,
|
|
18975
|
+
sources,
|
|
18395
18976
|
tools: {
|
|
18396
18977
|
totalCalls: metrics.tools.totalCalls,
|
|
18397
18978
|
totalSuccess: metrics.tools.totalSuccess,
|
|
@@ -19527,9 +20108,9 @@ var QwenAgent = class {
|
|
|
19527
20108
|
});
|
|
19528
20109
|
await Promise.all(
|
|
19529
20110
|
this.getLiveMcpConfigs(serverName).map(async (liveConfig) => {
|
|
19530
|
-
const
|
|
19531
|
-
if (
|
|
19532
|
-
await
|
|
20111
|
+
const llmClient = liveConfig.getLlmClient?.();
|
|
20112
|
+
if (llmClient?.isInitialized?.()) {
|
|
20113
|
+
await llmClient.setTools?.();
|
|
19533
20114
|
}
|
|
19534
20115
|
})
|
|
19535
20116
|
);
|
|
@@ -20067,6 +20648,17 @@ var QwenAgent = class {
|
|
|
20067
20648
|
"error" in source ? source.error : "Invalid or missing sourceType"
|
|
20068
20649
|
);
|
|
20069
20650
|
}
|
|
20651
|
+
if (isReservedStandaloneSessionSourceType(source.sourceType)) {
|
|
20652
|
+
const standaloneSession = this.sessionOrThrow(sessionId);
|
|
20653
|
+
if (params[DAEMON_OWNED_STANDALONE_CREATION_KEY] !== true || this.privateParentState !== "trusted" || !isReservedStandaloneSessionSourceType(
|
|
20654
|
+
standaloneSession.getConfig().getSessionSourceType()
|
|
20655
|
+
)) {
|
|
20656
|
+
throw RequestError.invalidParams(
|
|
20657
|
+
void 0,
|
|
20658
|
+
"`standalone` is reserved for daemon-owned session creation"
|
|
20659
|
+
);
|
|
20660
|
+
}
|
|
20661
|
+
}
|
|
20070
20662
|
const session = this.sessionOrThrow(sessionId);
|
|
20071
20663
|
if (isCompatibleLiveSessionSource(source)) {
|
|
20072
20664
|
await session.enableLiveScreenContext();
|
|
@@ -20263,9 +20855,41 @@ var QwenAgent = class {
|
|
|
20263
20855
|
"Invalid managed relocation capability"
|
|
20264
20856
|
);
|
|
20265
20857
|
}
|
|
20858
|
+
const conversationDirectoryExpectation = parseConversationDirectoryExpectation(
|
|
20859
|
+
params["conversationDirectoryExpectation"]
|
|
20860
|
+
);
|
|
20861
|
+
if (conversationDirectoryExpectation !== void 0 && managedRelocation !== "live-conversation") {
|
|
20862
|
+
throw RequestError.invalidParams(
|
|
20863
|
+
void 0,
|
|
20864
|
+
"Managed conversation directory expectation requires managed relocation"
|
|
20865
|
+
);
|
|
20866
|
+
}
|
|
20266
20867
|
const allowedRoots = params["allowedRoots"];
|
|
20267
20868
|
const session = this.sessionOrThrow(sessionId);
|
|
20268
20869
|
const config = session.getConfig();
|
|
20870
|
+
const standalone = isReservedStandaloneSessionSourceType(
|
|
20871
|
+
config.getSessionSourceType()
|
|
20872
|
+
);
|
|
20873
|
+
if (standalone && (managedRelocation !== "live-conversation" || conversationDirectoryExpectation === void 0)) {
|
|
20874
|
+
throw RequestError.invalidParams(
|
|
20875
|
+
void 0,
|
|
20876
|
+
"Standalone relocation requires an exact managed directory expectation"
|
|
20877
|
+
);
|
|
20878
|
+
}
|
|
20879
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20880
|
+
if (this.privateParentState !== "trusted" || conversationDirectoryExpectation.canonicalSessionId !== normalizeSessionIdForLookup(sessionId) || !Array.isArray(allowedRoots) || allowedRoots.length !== 1 || typeof allowedRoots[0] !== "string" || !isSameConversationPath(
|
|
20881
|
+
allowedRoots[0],
|
|
20882
|
+
conversationDirectoryExpectation.root.canonicalPath
|
|
20883
|
+
) || !isSameConversationPath(
|
|
20884
|
+
targetPath,
|
|
20885
|
+
conversationDirectoryExpectation.child.canonicalPath
|
|
20886
|
+
)) {
|
|
20887
|
+
throw managedConversationDirectoryError(false);
|
|
20888
|
+
}
|
|
20889
|
+
await assertManagedConversationDirectoryIdentity(
|
|
20890
|
+
conversationDirectoryExpectation
|
|
20891
|
+
);
|
|
20892
|
+
}
|
|
20269
20893
|
if (config.isRestrictiveSandbox()) {
|
|
20270
20894
|
throw new RequestError(-32003, "Restrictive sandbox mode active", {
|
|
20271
20895
|
errorKind: "restrictive_sandbox"
|
|
@@ -20275,18 +20899,34 @@ var QwenAgent = class {
|
|
|
20275
20899
|
try {
|
|
20276
20900
|
stats = await fs3.stat(targetPath);
|
|
20277
20901
|
} catch {
|
|
20902
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20903
|
+
throw managedConversationDirectoryError(true);
|
|
20904
|
+
}
|
|
20278
20905
|
throw new RequestError(-32002, `Directory not found: ${targetPath}`, {
|
|
20279
20906
|
errorKind: "directory_not_found",
|
|
20280
20907
|
path: targetPath
|
|
20281
20908
|
});
|
|
20282
20909
|
}
|
|
20283
20910
|
if (!stats.isDirectory()) {
|
|
20911
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20912
|
+
throw managedConversationDirectoryError(false);
|
|
20913
|
+
}
|
|
20284
20914
|
throw new RequestError(-32002, `Not a directory: ${targetPath}`, {
|
|
20285
20915
|
errorKind: "directory_not_found",
|
|
20286
20916
|
path: targetPath
|
|
20287
20917
|
});
|
|
20288
20918
|
}
|
|
20289
|
-
|
|
20919
|
+
let canonicalPath;
|
|
20920
|
+
try {
|
|
20921
|
+
canonicalPath = await fs3.realpath(targetPath);
|
|
20922
|
+
} catch (error) {
|
|
20923
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20924
|
+
throw managedConversationDirectoryError(
|
|
20925
|
+
error.code === "ENOENT"
|
|
20926
|
+
);
|
|
20927
|
+
}
|
|
20928
|
+
throw error;
|
|
20929
|
+
}
|
|
20290
20930
|
let containmentRoots = allowedRoots;
|
|
20291
20931
|
let managedTrustAllowed = false;
|
|
20292
20932
|
if (managedRelocation === "live-conversation") {
|
|
@@ -20311,13 +20951,22 @@ var QwenAgent = class {
|
|
|
20311
20951
|
canonicalRoot = await fs3.realpath(rootPath);
|
|
20312
20952
|
rootAfter = await fs3.lstat(canonicalRoot);
|
|
20313
20953
|
} catch {
|
|
20954
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20955
|
+
throw managedConversationDirectoryError(false);
|
|
20956
|
+
}
|
|
20314
20957
|
throw new RequestError(
|
|
20315
20958
|
-32004,
|
|
20316
20959
|
"Live managed relocation requires an owner-only allowed root",
|
|
20317
20960
|
{ errorKind: "containment_violation", path: rootPath }
|
|
20318
20961
|
);
|
|
20319
20962
|
}
|
|
20320
|
-
if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || rootBefore.dev !== rootAfter.dev || rootBefore.ino !== rootAfter.ino
|
|
20963
|
+
if (!isOwnerOnlyDirectory(rootBefore) || !isOwnerOnlyDirectory(rootAfter) || rootBefore.dev !== rootAfter.dev || rootBefore.ino !== rootAfter.ino || conversationDirectoryExpectation !== void 0 && (!isSameConversationPath(
|
|
20964
|
+
canonicalRoot,
|
|
20965
|
+
conversationDirectoryExpectation.root.canonicalPath
|
|
20966
|
+
) || rootAfter.dev !== conversationDirectoryExpectation.root.device || rootAfter.ino !== conversationDirectoryExpectation.root.inode)) {
|
|
20967
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20968
|
+
throw managedConversationDirectoryError(false);
|
|
20969
|
+
}
|
|
20321
20970
|
throw new RequestError(
|
|
20322
20971
|
-32004,
|
|
20323
20972
|
"Live managed relocation requires an owner-only allowed root",
|
|
@@ -20329,7 +20978,12 @@ var QwenAgent = class {
|
|
|
20329
20978
|
try {
|
|
20330
20979
|
targetBefore = await fs3.lstat(targetPath);
|
|
20331
20980
|
targetAfter = await fs3.lstat(canonicalPath);
|
|
20332
|
-
} catch {
|
|
20981
|
+
} catch (error) {
|
|
20982
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20983
|
+
throw managedConversationDirectoryError(
|
|
20984
|
+
error.code === "ENOENT"
|
|
20985
|
+
);
|
|
20986
|
+
}
|
|
20333
20987
|
throw new RequestError(
|
|
20334
20988
|
-32004,
|
|
20335
20989
|
"Live managed relocation requires an owner-only direct child",
|
|
@@ -20337,7 +20991,13 @@ var QwenAgent = class {
|
|
|
20337
20991
|
);
|
|
20338
20992
|
}
|
|
20339
20993
|
const relativeTarget = path6.relative(canonicalRoot, canonicalPath);
|
|
20340
|
-
if (!isOwnerOnlyDirectory(targetBefore) || !isOwnerOnlyDirectory(targetAfter) || targetBefore.dev !== targetAfter.dev || targetBefore.ino !== targetAfter.ino ||
|
|
20994
|
+
if (!isOwnerOnlyDirectory(targetBefore) || !isOwnerOnlyDirectory(targetAfter) || targetBefore.dev !== targetAfter.dev || targetBefore.ino !== targetAfter.ino || conversationDirectoryExpectation !== void 0 && (!isSameConversationPath(
|
|
20995
|
+
canonicalPath,
|
|
20996
|
+
conversationDirectoryExpectation.child.canonicalPath
|
|
20997
|
+
) || targetAfter.dev !== conversationDirectoryExpectation.child.device || targetAfter.ino !== conversationDirectoryExpectation.child.inode) || relativeTarget.length === 0 || relativeTarget.startsWith("..") || path6.isAbsolute(relativeTarget) || relativeTarget.includes(path6.sep)) {
|
|
20998
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
20999
|
+
throw managedConversationDirectoryError(false);
|
|
21000
|
+
}
|
|
20341
21001
|
throw new RequestError(
|
|
20342
21002
|
-32004,
|
|
20343
21003
|
"Live managed relocation requires an owner-only direct child",
|
|
@@ -20348,13 +21008,19 @@ var QwenAgent = class {
|
|
|
20348
21008
|
try {
|
|
20349
21009
|
rootFinal = await fs3.lstat(canonicalRoot);
|
|
20350
21010
|
} catch {
|
|
21011
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
21012
|
+
throw managedConversationDirectoryError(false);
|
|
21013
|
+
}
|
|
20351
21014
|
throw new RequestError(
|
|
20352
21015
|
-32004,
|
|
20353
21016
|
"Live managed relocation allowed root changed during validation",
|
|
20354
21017
|
{ errorKind: "containment_violation", path: canonicalRoot }
|
|
20355
21018
|
);
|
|
20356
21019
|
}
|
|
20357
|
-
if (!isOwnerOnlyDirectory(rootFinal) || rootFinal.dev !== rootAfter.dev || rootFinal.ino !== rootAfter.ino) {
|
|
21020
|
+
if (!isOwnerOnlyDirectory(rootFinal) || rootFinal.dev !== rootAfter.dev || rootFinal.ino !== rootAfter.ino || conversationDirectoryExpectation !== void 0 && (rootFinal.dev !== conversationDirectoryExpectation.root.device || rootFinal.ino !== conversationDirectoryExpectation.root.inode)) {
|
|
21021
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
21022
|
+
throw managedConversationDirectoryError(false);
|
|
21023
|
+
}
|
|
20358
21024
|
throw new RequestError(
|
|
20359
21025
|
-32004,
|
|
20360
21026
|
"Live managed relocation allowed root changed during validation",
|
|
@@ -20371,6 +21037,9 @@ var QwenAgent = class {
|
|
|
20371
21037
|
return !rel.startsWith("..") && !path6.isAbsolute(rel);
|
|
20372
21038
|
});
|
|
20373
21039
|
if (!contained) {
|
|
21040
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
21041
|
+
throw managedConversationDirectoryError(false);
|
|
21042
|
+
}
|
|
20374
21043
|
throw new RequestError(
|
|
20375
21044
|
-32004,
|
|
20376
21045
|
`Path outside allowed roots: ${canonicalPath}`,
|
|
@@ -20404,7 +21073,7 @@ var QwenAgent = class {
|
|
|
20404
21073
|
);
|
|
20405
21074
|
try {
|
|
20406
21075
|
const settledPreviousCwd = config.getTargetDir();
|
|
20407
|
-
if (canonicalPath === settledPreviousCwd) {
|
|
21076
|
+
if (canonicalPath === settledPreviousCwd && conversationDirectoryExpectation === void 0) {
|
|
20408
21077
|
return {
|
|
20409
21078
|
previousCwd: settledPreviousCwd,
|
|
20410
21079
|
newCwd: canonicalPath,
|
|
@@ -20420,12 +21089,30 @@ var QwenAgent = class {
|
|
|
20420
21089
|
SESSION_DRAIN_TIMEOUT_MS,
|
|
20421
21090
|
"close"
|
|
20422
21091
|
);
|
|
21092
|
+
if (conversationDirectoryExpectation !== void 0 && session.hasStandaloneRelocationBlockers()) {
|
|
21093
|
+
throw new RequestError(
|
|
21094
|
+
-32602,
|
|
21095
|
+
"Cannot relocate while standalone background work is active",
|
|
21096
|
+
{ errorKind: "session_busy" }
|
|
21097
|
+
);
|
|
21098
|
+
}
|
|
20423
21099
|
const warnings = [];
|
|
20424
21100
|
const relocation = await config.relocateWorkingDirectory(
|
|
20425
21101
|
canonicalPath,
|
|
20426
21102
|
canonicalPath,
|
|
20427
21103
|
{ skipProcessChdir: true, skipArtifactMigration: true }
|
|
20428
21104
|
);
|
|
21105
|
+
if (conversationDirectoryExpectation !== void 0) {
|
|
21106
|
+
await assertManagedConversationDirectoryIdentity(
|
|
21107
|
+
conversationDirectoryExpectation
|
|
21108
|
+
);
|
|
21109
|
+
session.installPendingManagedConversationBinding(
|
|
21110
|
+
conversationDirectoryExpectation,
|
|
21111
|
+
() => assertManagedConversationDirectoryIdentity(
|
|
21112
|
+
conversationDirectoryExpectation
|
|
21113
|
+
)
|
|
21114
|
+
);
|
|
21115
|
+
}
|
|
20429
21116
|
if (relocation.memoryRefreshError) {
|
|
20430
21117
|
warnings.push(
|
|
20431
21118
|
`Memory refresh failed: ${relocation.memoryRefreshError instanceof Error ? relocation.memoryRefreshError.message : String(relocation.memoryRefreshError)}`
|
|
@@ -20437,7 +21124,7 @@ var QwenAgent = class {
|
|
|
20437
21124
|
);
|
|
20438
21125
|
}
|
|
20439
21126
|
try {
|
|
20440
|
-
await config.
|
|
21127
|
+
await config.getLlmClient()?.addWorkingDirectoryChangedContext(
|
|
20441
21128
|
settledPreviousCwd,
|
|
20442
21129
|
canonicalPath
|
|
20443
21130
|
);
|
|
@@ -20455,6 +21142,41 @@ var QwenAgent = class {
|
|
|
20455
21142
|
releaseGate();
|
|
20456
21143
|
}
|
|
20457
21144
|
}
|
|
21145
|
+
case SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingCommit:
|
|
21146
|
+
case SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingRelease: {
|
|
21147
|
+
const sessionId = params["sessionId"];
|
|
21148
|
+
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
21149
|
+
throw RequestError.invalidParams(
|
|
21150
|
+
void 0,
|
|
21151
|
+
"Invalid or missing sessionId"
|
|
21152
|
+
);
|
|
21153
|
+
}
|
|
21154
|
+
if (this.privateParentState !== "trusted") {
|
|
21155
|
+
throw RequestError.invalidParams(
|
|
21156
|
+
void 0,
|
|
21157
|
+
"Managed conversation binding requires a trusted private ACP parent"
|
|
21158
|
+
);
|
|
21159
|
+
}
|
|
21160
|
+
const expectation = parseConversationDirectoryExpectation(
|
|
21161
|
+
params["conversationDirectoryExpectation"]
|
|
21162
|
+
);
|
|
21163
|
+
if (expectation === void 0 || expectation.canonicalSessionId !== normalizeSessionIdForLookup(sessionId)) {
|
|
21164
|
+
throw managedConversationDirectoryError(false);
|
|
21165
|
+
}
|
|
21166
|
+
const session = this.sessionOrThrow(sessionId);
|
|
21167
|
+
if (!isReservedStandaloneSessionSourceType(
|
|
21168
|
+
session.getConfig().getSessionSourceType()
|
|
21169
|
+
)) {
|
|
21170
|
+
throw managedConversationDirectoryError(false);
|
|
21171
|
+
}
|
|
21172
|
+
await assertManagedConversationDirectoryIdentity(expectation);
|
|
21173
|
+
if (method === SERVE_CONTROL_EXT_METHODS.sessionManagedConversationBindingCommit) {
|
|
21174
|
+
await session.commitManagedConversationBinding(expectation);
|
|
21175
|
+
return { sessionId, committed: true };
|
|
21176
|
+
}
|
|
21177
|
+
await session.releaseManagedConversationBinding(expectation);
|
|
21178
|
+
return { sessionId, released: true };
|
|
21179
|
+
}
|
|
20458
21180
|
case SERVE_CONTROL_EXT_METHODS.sessionApprovalMode: {
|
|
20459
21181
|
const sessionId = params["sessionId"];
|
|
20460
21182
|
const mode = params["mode"];
|
|
@@ -20580,7 +21302,7 @@ var QwenAgent = class {
|
|
|
20580
21302
|
);
|
|
20581
21303
|
}
|
|
20582
21304
|
await cfg.refreshHierarchicalMemory();
|
|
20583
|
-
await cfg.
|
|
21305
|
+
await cfg.getLlmClient()?.refreshSystemInstruction();
|
|
20584
21306
|
})
|
|
20585
21307
|
);
|
|
20586
21308
|
const failedCount = results.filter(
|
|
@@ -20746,7 +21468,7 @@ var QwenAgent = class {
|
|
|
20746
21468
|
}
|
|
20747
21469
|
let hasHistory = false;
|
|
20748
21470
|
try {
|
|
20749
|
-
hasHistory = (config.
|
|
21471
|
+
hasHistory = (config.getLlmClient().getHistoryShallow() ?? []).length > 0;
|
|
20750
21472
|
} catch (error) {
|
|
20751
21473
|
debugLogger9.debug("Failed to read history before /fork:", error);
|
|
20752
21474
|
}
|
|
@@ -20779,7 +21501,7 @@ var QwenAgent = class {
|
|
|
20779
21501
|
);
|
|
20780
21502
|
}
|
|
20781
21503
|
try {
|
|
20782
|
-
config.
|
|
21504
|
+
config.getLlmClient().addHistory({
|
|
20783
21505
|
role: "user",
|
|
20784
21506
|
parts: [
|
|
20785
21507
|
{
|
|
@@ -20811,9 +21533,9 @@ var QwenAgent = class {
|
|
|
20811
21533
|
}
|
|
20812
21534
|
const session = this.sessionOrThrow(sessionId);
|
|
20813
21535
|
const config = session.getConfig();
|
|
20814
|
-
const
|
|
21536
|
+
const llmClient = config.getLlmClient();
|
|
20815
21537
|
const outputText = typeof params["output"] === "string" ? params["output"] : "";
|
|
20816
|
-
|
|
21538
|
+
llmClient.addHistory({
|
|
20817
21539
|
role: "user",
|
|
20818
21540
|
parts: [
|
|
20819
21541
|
{
|
|
@@ -21219,7 +21941,7 @@ ${outputText}
|
|
|
21219
21941
|
);
|
|
21220
21942
|
}
|
|
21221
21943
|
await runRefresh(
|
|
21222
|
-
async () => await config.
|
|
21944
|
+
async () => await config.getLlmClient()?.refreshSystemInstruction()
|
|
21223
21945
|
);
|
|
21224
21946
|
await runRefresh(
|
|
21225
21947
|
async () => await session.sendAvailableCommandsUpdate()
|
|
@@ -21942,7 +22664,7 @@ ${outputText}
|
|
|
21942
22664
|
);
|
|
21943
22665
|
}
|
|
21944
22666
|
try {
|
|
21945
|
-
await config.
|
|
22667
|
+
await config.getLlmClient()?.refreshSystemInstruction();
|
|
21946
22668
|
} catch (err) {
|
|
21947
22669
|
debugLogger9.warn(
|
|
21948
22670
|
`reload: refreshSystemInstruction failed for session ${id}: ${err}`
|
|
@@ -22178,6 +22900,9 @@ ${outputText}
|
|
|
22178
22900
|
}
|
|
22179
22901
|
}
|
|
22180
22902
|
async newSessionConfigInRuntimeContext(cwd, mcpServers, settings, sessionSource, sessionId, resume, initializeOptions = {}, chatRecording, restoreOptions) {
|
|
22903
|
+
const provisionalWorkspace = isReservedStandaloneSessionSourceType(
|
|
22904
|
+
sessionSource?.sourceType
|
|
22905
|
+
);
|
|
22181
22906
|
const sessionMcpServers = {};
|
|
22182
22907
|
for (const server of mcpServers) {
|
|
22183
22908
|
const stdioServer = toStdioServer(server);
|
|
@@ -22239,6 +22964,7 @@ ${outputText}
|
|
|
22239
22964
|
const sessionArg = resume === true ? { resume: sessionId, sessionId: void 0 } : { sessionId, resume: void 0 };
|
|
22240
22965
|
const argvForSession = {
|
|
22241
22966
|
...this.argv,
|
|
22967
|
+
...provisionalWorkspace ? { experimentalLsp: false } : {},
|
|
22242
22968
|
// Docker sandbox relaunch injects a fixed --sandbox-session-id into
|
|
22243
22969
|
// the ACP process argv. Without clearing it, every newSession()
|
|
22244
22970
|
// inherits the same ID and the second session collides with the
|
|
@@ -22275,7 +23001,8 @@ ${outputText}
|
|
|
22275
23001
|
// not process.exit(1) the shared ACP child and every session on its
|
|
22276
23002
|
// channel. newSessionConfig maps the throw to a RequestError.
|
|
22277
23003
|
true,
|
|
22278
|
-
this.managedToolInvocationGuard || restoreOptions ? {
|
|
23004
|
+
this.managedToolInvocationGuard || restoreOptions || provisionalWorkspace ? {
|
|
23005
|
+
...provisionalWorkspace ? { provisionalWorkspace: true } : {},
|
|
22279
23006
|
...this.managedToolInvocationGuard ? { toolInvocationGuard: this.managedToolInvocationGuard } : {},
|
|
22280
23007
|
...restoreOptions && sessionId ? {
|
|
22281
23008
|
sessionRestore: {
|
|
@@ -22354,8 +23081,12 @@ ${outputText}
|
|
|
22354
23081
|
() => this.cleanupUnstoredConfig(config)
|
|
22355
23082
|
);
|
|
22356
23083
|
}
|
|
22357
|
-
|
|
22358
|
-
|
|
23084
|
+
if (!provisionalWorkspace) {
|
|
23085
|
+
startNonInteractiveOpenAILogHousekeeping(config, settings);
|
|
23086
|
+
}
|
|
23087
|
+
if (!provisionalWorkspace) {
|
|
23088
|
+
void this.surfaceMcpFailuresWhenReady(config);
|
|
23089
|
+
}
|
|
22359
23090
|
return config;
|
|
22360
23091
|
}
|
|
22361
23092
|
async surfaceMcpFailuresWhenReady(config) {
|
|
@@ -22411,10 +23142,10 @@ ${outputText}
|
|
|
22411
23142
|
async createAndStoreSession(config, settings, sessionData, options = {}) {
|
|
22412
23143
|
this.assertManagedSessionAdmission();
|
|
22413
23144
|
const sessionId = normalizeSessionIdForLookup(config.getSessionId());
|
|
22414
|
-
const
|
|
22415
|
-
const needsInitialize = !
|
|
22416
|
-
if (needsInitialize) {
|
|
22417
|
-
await
|
|
23145
|
+
const llmClient = config.getLlmClient();
|
|
23146
|
+
const needsInitialize = !llmClient.isInitialized();
|
|
23147
|
+
if (needsInitialize && options.deferWorkspaceActivation !== true) {
|
|
23148
|
+
await llmClient.initialize();
|
|
22418
23149
|
}
|
|
22419
23150
|
this.assertManagedSessionAdmission();
|
|
22420
23151
|
if (this.sessions.has(sessionId)) {
|
|
@@ -22442,11 +23173,59 @@ ${outputText}
|
|
|
22442
23173
|
(operation) => this.runExclusiveHistoryMutation(sessionId, operation),
|
|
22443
23174
|
() => this.activeWorkReporter?.notifyChanged()
|
|
22444
23175
|
);
|
|
23176
|
+
const replaySessionHistory = /* @__PURE__ */ __name(async () => {
|
|
23177
|
+
if (options.replayHistory === false || !sessionData?.conversation.messages) {
|
|
23178
|
+
return;
|
|
23179
|
+
}
|
|
23180
|
+
await session.replayHistory(
|
|
23181
|
+
sessionData.conversation.messages,
|
|
23182
|
+
sessionData.historyGaps
|
|
23183
|
+
);
|
|
23184
|
+
try {
|
|
23185
|
+
await session.publishRecoveredGoalState(
|
|
23186
|
+
sessionData.conversation.messages
|
|
23187
|
+
);
|
|
23188
|
+
} catch (error) {
|
|
23189
|
+
debugLogger9.debug(
|
|
23190
|
+
`Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
|
|
23191
|
+
);
|
|
23192
|
+
}
|
|
23193
|
+
}, "replaySessionHistory");
|
|
23194
|
+
if (options.deferWorkspaceActivation === true) {
|
|
23195
|
+
session.installManagedConversationActivation(
|
|
23196
|
+
async () => {
|
|
23197
|
+
this.assertManagedSessionAdmission();
|
|
23198
|
+
if (options.beforeDeferredWorkspaceActivation) {
|
|
23199
|
+
await options.beforeDeferredWorkspaceActivation();
|
|
23200
|
+
} else {
|
|
23201
|
+
await this.ensureAuthenticated(config);
|
|
23202
|
+
}
|
|
23203
|
+
this.assertManagedSessionAdmission();
|
|
23204
|
+
await config.activateProvisionalWorkspace();
|
|
23205
|
+
this.assertManagedSessionAdmission();
|
|
23206
|
+
this.setupFileSystem(config);
|
|
23207
|
+
config.hydrateSessionRestoreFileHistory?.();
|
|
23208
|
+
if (sessionData?.fileHistorySnapshots?.length) {
|
|
23209
|
+
config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
|
|
23210
|
+
}
|
|
23211
|
+
await replaySessionHistory();
|
|
23212
|
+
await options.beforeStartPostReplayServices?.(session);
|
|
23213
|
+
session.installRewriter();
|
|
23214
|
+
config.finalizeSessionRestore?.();
|
|
23215
|
+
startNonInteractiveOpenAILogHousekeeping(config, settings);
|
|
23216
|
+
},
|
|
23217
|
+
() => {
|
|
23218
|
+
void this.surfaceMcpFailuresWhenReady(config);
|
|
23219
|
+
}
|
|
23220
|
+
);
|
|
23221
|
+
}
|
|
22445
23222
|
let published = false;
|
|
22446
23223
|
try {
|
|
22447
23224
|
await registerCreateSubSessionTool(config);
|
|
22448
23225
|
options.primeSession?.(session);
|
|
22449
|
-
|
|
23226
|
+
if (options.deferWorkspaceActivation !== true) {
|
|
23227
|
+
config.hydrateSessionRestoreFileHistory?.();
|
|
23228
|
+
}
|
|
22450
23229
|
this.sessions.set(sessionId, session);
|
|
22451
23230
|
published = true;
|
|
22452
23231
|
this.activeWorkReporter?.notifyChanged();
|
|
@@ -22454,30 +23233,24 @@ ${outputText}
|
|
|
22454
23233
|
if (options.enableLiveScreenContext) {
|
|
22455
23234
|
await session.enableLiveScreenContext();
|
|
22456
23235
|
}
|
|
22457
|
-
if (sessionData?.fileHistorySnapshots?.length) {
|
|
23236
|
+
if (options.deferWorkspaceActivation !== true && sessionData?.fileHistorySnapshots?.length) {
|
|
22458
23237
|
config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
|
|
22459
23238
|
}
|
|
22460
23239
|
if (sessionData?.conversation.messages) {
|
|
22461
23240
|
config.getChatRecordingService()?.rebuildTurnBoundaries(sessionData.conversation.messages);
|
|
22462
23241
|
}
|
|
22463
|
-
if (options.
|
|
22464
|
-
await
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
);
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
`Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
|
|
22475
|
-
);
|
|
22476
|
-
}
|
|
23242
|
+
if (options.deferWorkspaceActivation !== true) {
|
|
23243
|
+
await replaySessionHistory();
|
|
23244
|
+
}
|
|
23245
|
+
if (options.deferWorkspaceActivation !== true) {
|
|
23246
|
+
await options.beforeStartPostReplayServices?.(session);
|
|
23247
|
+
}
|
|
23248
|
+
if (options.deferWorkspaceActivation !== true) {
|
|
23249
|
+
session.installRewriter();
|
|
23250
|
+
}
|
|
23251
|
+
if (options.deferWorkspaceActivation !== true) {
|
|
23252
|
+
config.finalizeSessionRestore?.();
|
|
22477
23253
|
}
|
|
22478
|
-
await options.beforeStartPostReplayServices?.(session);
|
|
22479
|
-
session.installRewriter();
|
|
22480
|
-
config.finalizeSessionRestore?.();
|
|
22481
23254
|
session.startCronScheduler();
|
|
22482
23255
|
setTimeout(() => {
|
|
22483
23256
|
void session.sendAvailableCommandsUpdate();
|
|
@@ -22585,11 +23358,29 @@ ${outputText}
|
|
|
22585
23358
|
currentValue: currentModelId,
|
|
22586
23359
|
options: configModelOptions
|
|
22587
23360
|
};
|
|
22588
|
-
const
|
|
23361
|
+
const generation = config.getContentGeneratorConfig();
|
|
23362
|
+
const modelReasoning = this.getModelReasoningConfiguration(
|
|
23363
|
+
config,
|
|
23364
|
+
currentModelId
|
|
23365
|
+
);
|
|
22589
23366
|
const currentModelEffort = config.getReasoningEffort?.();
|
|
23367
|
+
const reasoningOverride = config.getReasoningEffortOverride?.();
|
|
23368
|
+
const reasoningOverrideValue = reasoningOverride ? generation[reasoningOverride.source]?.[reasoningOverride.field] : void 0;
|
|
23369
|
+
const normalizedEffortOverride = reasoningOverride?.field === "reasoning_effort" && typeof reasoningOverrideValue === "string" ? reasoningOverrideValue === "minimal" ? "low" : REASONING_EFFORT_TIERS.find(
|
|
23370
|
+
(effort) => effort === reasoningOverrideValue
|
|
23371
|
+
) : void 0;
|
|
23372
|
+
const normalizedBudgetOverride = reasoningOverride?.field === "thinking_budget" && typeof reasoningOverrideValue === "number" && Number.isFinite(reasoningOverrideValue) && reasoningOverrideValue >= 0 && reasoningOverrideValue <= 262144 ? reasoningOverrideValue <= 4096 ? "low" : reasoningOverrideValue <= 16384 ? "medium" : "xhigh" : void 0;
|
|
23373
|
+
const normalizedOverrideEffort = normalizedEffortOverride ?? normalizedBudgetOverride;
|
|
23374
|
+
const overrideDisablesReasoning = reasoningOverride?.field === "enable_thinking" && reasoningOverrideValue === false || reasoningOverride?.field === "reasoning_effort" && reasoningOverrideValue === REASONING_EFFORT_NONE;
|
|
23375
|
+
const mandatoryUsesDefaultEffort = generation.thinkingMandatory === true && (overrideDisablesReasoning || generation.reasoning === false && reasoningOverride?.field === "reasoning_effort");
|
|
23376
|
+
const effectiveModelEffort = modelReasoning && !modelReasoning.toggleOnly ? mandatoryUsesDefaultEffort ? modelReasoning.defaultEffort : normalizedOverrideEffort ? modelReasoning.efforts.find(
|
|
23377
|
+
(effort) => effort === normalizedOverrideEffort
|
|
23378
|
+
) ?? modelReasoning.defaultEffort : currentModelEffort : currentModelEffort;
|
|
23379
|
+
const reasoningEnabled = generation.reasoning !== false && (!reasoningOverride || !overrideDisablesReasoning);
|
|
22590
23380
|
const reasoningEffortConfigOption = (modelReasoning ? buildModelReasoningConfigOption(rawCurrentModelId, {
|
|
22591
|
-
enabled:
|
|
22592
|
-
effort:
|
|
23381
|
+
enabled: reasoningEnabled,
|
|
23382
|
+
effort: effectiveModelEffort,
|
|
23383
|
+
thinkingMandatory: generation.thinkingMandatory === true
|
|
22593
23384
|
}) : void 0) ?? {
|
|
22594
23385
|
id: "reasoning_effort",
|
|
22595
23386
|
name: "Reasoning effort",
|
|
@@ -22612,13 +23403,21 @@ ${outputText}
|
|
|
22612
23403
|
};
|
|
22613
23404
|
return [modeConfigOption, modelConfigOption, reasoningEffortConfigOption];
|
|
22614
23405
|
}
|
|
22615
|
-
getModelReasoningConfiguration(config) {
|
|
22616
|
-
if (config.getActiveRuntimeModelSnapshot?.()
|
|
23406
|
+
getModelReasoningConfiguration(config, currentAcpModelId) {
|
|
23407
|
+
if (config.getActiveRuntimeModelSnapshot?.()) {
|
|
23408
|
+
return void 0;
|
|
23409
|
+
}
|
|
23410
|
+
const completeModelId = currentAcpModelId ?? getCurrentAcpModelId(
|
|
23411
|
+
this.buildSelectableModelOptions(config),
|
|
23412
|
+
(config.getModel() || "").trim(),
|
|
23413
|
+
config.getAuthType?.(),
|
|
23414
|
+
config.getCurrentModelRegistryBaseUrl?.()
|
|
23415
|
+
);
|
|
23416
|
+
if (completeModelId.startsWith(ACP_ROUTE_ID_PREFIX)) {
|
|
22617
23417
|
return void 0;
|
|
22618
23418
|
}
|
|
22619
23419
|
const reasoning = getModelConfiguration(config.getModel())?.reasoning;
|
|
22620
|
-
|
|
22621
|
-
return reasoning?.thinking && (reasoning.toggleOnly || !currentEffort || reasoning.efforts.includes(currentEffort)) ? reasoning : void 0;
|
|
23420
|
+
return reasoning?.thinking ? reasoning : void 0;
|
|
22622
23421
|
}
|
|
22623
23422
|
buildSelectableModelOptions(config) {
|
|
22624
23423
|
const currentAuthType = config.getAuthType();
|