@qwen-code/qwen-code 0.21.0 → 0.21.1-nightly.20260730.1643a6c9a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/model-providers.md +2 -0
- package/bundled/qc-helper/docs/configuration/settings.md +39 -28
- package/bundled/qc-helper/docs/features/channels/_meta.ts +2 -0
- package/bundled/qc-helper/docs/features/channels/github.md +117 -0
- package/bundled/qc-helper/docs/features/channels/gitlab.md +171 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +61 -6
- package/bundled/qc-helper/docs/features/code-review.md +1 -1
- package/bundled/qc-helper/docs/features/hooks.md +70 -15
- package/bundled/qc-helper/docs/features/mcp.md +9 -1
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +3 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +20 -0
- package/bundled/qc-helper/docs/qwen-serve.md +11 -7
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +2 -2
- package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
- package/bundled/review/DESIGN.md +19 -0
- package/bundled/review/SKILL.md +120 -61
- package/chunks/MaxSizedBox-H77LGFDG.js +86 -0
- package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-NGKLCYX4.js} +68 -67
- package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-DFVPFQ6C.js} +2 -2
- package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-RUN53PRW.js} +1381 -543
- package/chunks/agent-4CFRD2OG.js +82 -0
- package/chunks/agent-headless-XPUCIZLL.js +76 -0
- package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-V2QOGVYD.js} +79 -27
- package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-6K6U7XYJ.js} +4 -4
- package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-GD2IJJ7I.js} +4 -4
- package/chunks/bridge-B2YJLSLT.js +92 -0
- package/chunks/{build-RV63TIRH.js → build-GDBLPA24.js} +1 -1
- package/chunks/{ca-25EDXPFZ.js → ca-6W3SK7OQ.js} +6 -1
- package/chunks/channel-management-service-RAPKQK24.js +418 -0
- package/chunks/channel-settings-store-KJQKY6NN.js +89 -0
- package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-7SZ7MR3K.js} +11 -6
- package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-RN5KJYPF.js} +11 -6
- package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-CABBXYHK.js} +7 -5
- package/chunks/{chunk-M5JM7OSF.js → chunk-2DN4J57Y.js} +2 -3
- package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
- package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
- package/chunks/{chunk-EPDRMGT4.js → chunk-2LKVPASC.js} +4 -28
- package/chunks/{chunk-PWTZEM3C.js → chunk-2LQTH543.js} +3 -37
- package/chunks/{chunk-CIKQ7KKO.js → chunk-2Q4CZ3V6.js} +713 -419
- package/chunks/{chunk-HIJQF5B5.js → chunk-3L2SPEBH.js} +1 -1
- package/chunks/{chunk-JXJFVC6E.js → chunk-3QDXECUB.js} +46 -11
- package/chunks/{chunk-PSOO6YXD.js → chunk-3RMX26V7.js} +9 -7
- package/chunks/{chunk-PC6JANNU.js → chunk-4755HD5V.js} +4 -4
- package/chunks/{chunk-GSN55ZRI.js → chunk-4D3MHM5F.js} +19 -7
- package/chunks/{chunk-EBJQ6AXW.js → chunk-4FQ4OKOU.js} +260 -14
- package/chunks/{chunk-BIQWWWJN.js → chunk-4G2BISNC.js} +1 -1
- package/chunks/{chunk-IKYJHJNF.js → chunk-5EHIP3GX.js} +3 -3
- package/chunks/chunk-5IDU2UGL.js +2196 -0
- package/chunks/{chunk-DHHOYAPR.js → chunk-5TBMQLGG.js} +7 -7
- package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
- package/chunks/chunk-5YKDXHUY.js +463 -0
- package/chunks/{chunk-K36B6G2O.js → chunk-5ZEFGTII.js} +5 -5
- package/chunks/{chunk-K4XWPEWB.js → chunk-64LQLPL7.js} +4 -33
- package/chunks/{chunk-TGILQ3YH.js → chunk-6CH6PHMZ.js} +141 -64
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/chunk-6MPDY6ZG.js +76 -0
- package/chunks/{chunk-2NH6DYI4.js → chunk-6OF62NPQ.js} +12 -12
- package/chunks/{chunk-JZA3JUDJ.js → chunk-6QIGFD5W.js} +1 -1
- package/chunks/{chunk-ETSW4KLJ.js → chunk-72E7TSGG.js} +2 -2
- package/chunks/{chunk-OHNBB4XR.js → chunk-75GFAX4R.js} +1 -1
- package/chunks/{chunk-UDX5OBWR.js → chunk-77IMMLN2.js} +94 -4
- package/chunks/{chunk-TEHGS6UP.js → chunk-7A4V5CJY.js} +154 -16
- package/chunks/{chunk-QAF7NMK7.js → chunk-7BV2P4S3.js} +1 -1
- package/chunks/{chunk-RIBKPMRP.js → chunk-7RFNMXPU.js} +19 -6
- package/chunks/{chunk-KMQ33DO4.js → chunk-7UKQW4JU.js} +4 -4
- package/chunks/{chunk-A5L3JMUA.js → chunk-7XATOOE7.js} +18 -4
- package/chunks/{chunk-5I2IWRSH.js → chunk-A3NDJ5SB.js} +2 -2
- package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
- package/chunks/{chunk-TPRQ7RZH.js → chunk-ANND7YTH.js} +2341 -940
- package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
- package/chunks/{chunk-KIM5GUMA.js → chunk-B47WVQ7T.js} +400 -162
- package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
- package/chunks/{chunk-BJX6ZSUK.js → chunk-BCZFQXWK.js} +2 -2
- package/chunks/{chunk-BKHWX6I2.js → chunk-CAEQL6GZ.js} +11 -3
- package/chunks/{chunk-J56UI34H.js → chunk-CI2PGI7Z.js} +4 -2
- package/chunks/{chunk-2SCDWPXI.js → chunk-CUWGNCKW.js} +5 -5
- package/chunks/{chunk-TOFQCPDC.js → chunk-CVHIL5IG.js} +4 -5
- package/chunks/{chunk-VRYUBFMC.js → chunk-CYIBLZBR.js} +1 -1
- package/chunks/{chunk-YBL3QUDD.js → chunk-CYPJYJIX.js} +1 -1
- package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
- package/chunks/{chunk-7MVVZO4N.js → chunk-DGV27C34.js} +4 -4
- package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
- package/chunks/chunk-DZLYR4U3.js +1252 -0
- package/chunks/{chunk-PHOF65IG.js → chunk-EYGWU66Z.js} +41594 -50416
- package/chunks/{chunk-7ZCNENPP.js → chunk-FANRZEAJ.js} +1 -1
- package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
- package/chunks/{chunk-5NBDS5S6.js → chunk-FCYYAB4S.js} +162 -7
- package/chunks/{chunk-L26JL52R.js → chunk-FH6SU2OG.js} +48 -61
- package/chunks/{chunk-OKY7HXPG.js → chunk-FNMZK765.js} +2 -2
- package/chunks/chunk-FYJ7W2PI.js +194 -0
- package/chunks/{chunk-BULDBTYC.js → chunk-G7XXKQYS.js} +3 -28
- package/chunks/{chunk-L5UHQJTJ.js → chunk-GATT5TKW.js} +1 -1
- package/chunks/{chunk-MVSUYZDT.js → chunk-GKWLJW7Z.js} +4 -4
- package/chunks/{chunk-VAK25FTU.js → chunk-GKX7E4CO.js} +1 -1
- package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
- package/chunks/{chunk-FSITMZJH.js → chunk-GOXRFPH5.js} +18 -9
- package/chunks/{chunk-3RN6GBKS.js → chunk-HFAV3POZ.js} +1 -1
- package/chunks/{chunk-YX324OPW.js → chunk-HGQIL6NG.js} +1 -1
- package/chunks/{chunk-55DJUCI2.js → chunk-HOSENQJL.js} +53 -43
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-YH6G52F2.js → chunk-I3V7RKRZ.js} +4 -4
- package/chunks/{chunk-RF3EXIHJ.js → chunk-IQMYZTDI.js} +30 -19
- package/chunks/{chunk-RWTEFFPU.js → chunk-JCJ7LKNA.js} +6140 -5616
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-63P4EL5V.js → chunk-JMONIXMJ.js} +1 -1
- package/chunks/{chunk-OFDOK3VM.js → chunk-JQTW5CA5.js} +8 -13
- package/chunks/chunk-JYBU6YUE.js +378 -0
- package/chunks/chunk-JZQUOT4B.js +81 -0
- package/chunks/{chunk-Q4M4MDQ4.js → chunk-K4GTOFKY.js} +1 -1
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/{chunk-YPE6A4GC.js → chunk-KLESQCW6.js} +2 -2
- package/chunks/{chunk-JVPM2ULZ.js → chunk-KQGB3ME2.js} +6 -6
- package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
- package/chunks/{chunk-RHLZR4E5.js → chunk-LGAOC3ZS.js} +1 -1
- package/chunks/{chunk-LB6DUZ26.js → chunk-LI53FGDL.js} +258 -184
- package/chunks/{chunk-2X55UKQE.js → chunk-LIJID5PD.js} +3 -3
- package/chunks/{chunk-NH6KE4JX.js → chunk-LW3RFMG7.js} +3 -3
- package/chunks/{chunk-MZAXJAUM.js → chunk-LW67T6GH.js} +1 -1
- package/chunks/{chunk-RZIX2G32.js → chunk-M4O2DCE3.js} +1 -1
- package/chunks/{chunk-4WIZGAH3.js → chunk-MFW7APBA.js} +6 -58
- package/chunks/{chunk-VIA5XA4U.js → chunk-MKQOXP2O.js} +3 -1
- package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
- package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
- package/chunks/{chunk-H5FFA6TH.js → chunk-NOKIVHOL.js} +16 -3
- package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
- package/chunks/{chunk-LQIW3YFY.js → chunk-OAOPCTG6.js} +9 -7
- package/chunks/chunk-OCPBI7J5.js +18 -0
- package/chunks/{chunk-WCXCRJYB.js → chunk-OCUM7TJA.js} +1 -1
- package/chunks/{chunk-R5AFZNQW.js → chunk-OIG257JR.js} +14 -7
- package/chunks/{chunk-IKCX4CCL.js → chunk-OINT3ZNV.js} +118 -95
- package/chunks/{chunk-E5TUC6CA.js → chunk-OKF7JF3R.js} +3 -3
- package/chunks/chunk-PEK4ARMZ.js +319 -0
- package/chunks/chunk-PGHTM673.js +363 -0
- package/chunks/{record-artifact-RQKFYO5B.js → chunk-PMGFWLAZ.js} +22 -7
- package/chunks/{chunk-FNQ6T3CV.js → chunk-PONHVBRT.js} +10 -7
- package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
- package/chunks/{chunk-ZFDTEDCF.js → chunk-RF4FA22B.js} +6 -6
- package/chunks/{chunk-6FGBXPWM.js → chunk-RPLGZJV2.js} +38 -44
- package/chunks/{chunk-NIBLUX3Y.js → chunk-RQLRERVY.js} +148 -21
- package/chunks/{chunk-LKEJ26GS.js → chunk-RWZPM2BP.js} +16 -11
- package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
- package/chunks/{chunk-IO3IX5Q4.js → chunk-S7G7Z3MP.js} +1 -1
- package/chunks/{chunk-MUP3T3AD.js → chunk-SGFT55XI.js} +1 -35
- package/chunks/{chunk-PWVFN2LF.js → chunk-SMWPUA2A.js} +1 -1
- package/chunks/{chunk-U7M2DMGW.js → chunk-SWRHIQDT.js} +130 -5
- package/chunks/{chunk-VYPFXUCB.js → chunk-SZ3KHTDR.js} +1 -1
- package/chunks/chunk-T26EAKDL.js +13 -0
- package/chunks/chunk-T3CHYWJZ.js +758 -0
- package/chunks/{chunk-SQCQ4KO2.js → chunk-TCBP4Q3K.js} +380 -317
- package/chunks/{chunk-ZNAUOR2I.js → chunk-TJHLQ45J.js} +2 -2
- package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
- package/chunks/{chunk-NL7LTRLR.js → chunk-UHUSJ6X7.js} +29 -68
- package/chunks/{chunk-LH2BYDQ5.js → chunk-UJBURGBH.js} +18 -12
- package/chunks/{chunk-ZOIFNCKL.js → chunk-UPUG4GXM.js} +3 -23
- package/chunks/{chunk-FQK6JAFG.js → chunk-URPQ5QZM.js} +4 -4
- package/chunks/{chunk-M4FMGVY4.js → chunk-V47JGII4.js} +3 -3
- package/chunks/{chunk-Y34KJKDC.js → chunk-VBX5IFEN.js} +1 -1
- package/chunks/{chunk-USTWD7QV.js → chunk-W4MIWP6M.js} +26 -16
- package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
- package/chunks/{chunk-J24WCGIN.js → chunk-W7D7QTCH.js} +4 -4
- package/chunks/{chunk-DLWL3Z7A.js → chunk-WBSMNTSV.js} +3 -3
- package/chunks/{chunk-2JZBVYTU.js → chunk-WZRWHXFE.js} +1 -8
- package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
- package/chunks/{chunk-IJTOWOD7.js → chunk-XTLTBZIH.js} +83 -9
- package/chunks/{chunk-H4SBPHSA.js → chunk-XVYRMUI5.js} +3 -3
- package/chunks/{chunk-3QMGYBFN.js → chunk-XWWKIXVD.js} +1 -80
- package/chunks/{chunk-VULLI6WQ.js → chunk-XZB72HUB.js} +6 -6
- package/chunks/{chunk-3SJ43L4W.js → chunk-XZC5VLBZ.js} +2 -0
- package/chunks/{chunk-UUUTRMI2.js → chunk-Y4IHBGBP.js} +1 -1
- package/chunks/{chunk-PR75REBZ.js → chunk-Y6AXW2OG.js} +12 -82
- package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
- package/chunks/{chunk-MB4MZHMJ.js → chunk-YX4DHA6S.js} +211 -522
- package/chunks/chunk-Z4X5MTRT.js +133 -0
- package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
- package/chunks/{chunk-ZD6UTE4A.js → chunk-ZHBO7WVX.js} +1 -1
- package/chunks/{chunk-7JURR4JT.js → chunk-ZM63TFJH.js} +167 -81
- package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
- package/chunks/{chunk-X5XDDSSH.js → chunk-ZPZ7ZJEE.js} +28 -5
- package/chunks/{chunk-ACY3A37B.js → chunk-ZS6Q44DY.js} +23 -18
- package/chunks/{chunk-ZJHVAS7M.js → chunk-ZWUDSQBD.js} +4 -5
- package/chunks/{computer-use-SOQ4E3VX.js → computer-use-HRVGY7OB.js} +50 -49
- package/chunks/{config-utils-7V7GGIW6.js → config-utils-RUFMEUYD.js} +4 -3
- package/chunks/contextCommand-V3N7Q3UM.js +81 -0
- package/chunks/core-runtime-QGEW6WBW.js +135 -0
- package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-SBYUMSSS.js} +3 -3
- package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-ZUWDNFO2.js} +47 -46
- package/chunks/{cron-create-YIID5XAW.js → cron-create-2QK6TCEC.js} +6 -6
- package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-FDCDFYMG.js} +5 -5
- package/chunks/{cron-list-XEGS463Q.js → cron-list-XN3WVBTP.js} +6 -6
- package/chunks/{daemon-YO6433NF.js → daemon-QH2G5B5E.js} +403 -17
- package/chunks/daemon-status-provider-MB54AMNV.js +91 -0
- package/chunks/daemon-trust-policy-3VFDF5LU.js +86 -0
- package/chunks/daemon-trust-policy-monitor-4KX2OK7G.js +173 -0
- package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
- package/chunks/deferred-core-runtime-UIJL6EEU.js +90 -0
- package/chunks/{dist-F6IBUDR4.js → dist-2PERFI23.js} +12 -9
- package/chunks/dist-AOOUOG5S.js +4389 -0
- package/chunks/{dist-46NQKLTW.js → dist-OAOC5OV4.js} +2 -2
- package/chunks/{dist-YFNEUWSE.js → dist-PVEAFLHY.js} +5 -4
- package/chunks/{dist-AIKFMUKK.js → dist-SL2LUMML.js} +1449 -14
- package/chunks/dist-ULIG4M5H.js +13415 -0
- package/chunks/{dist-WEAHOXDM.js → dist-WGMNT3JQ.js} +2 -1
- package/chunks/{dist-BBLXMS3N.js → dist-ZHXOBXDN.js} +3 -3
- package/chunks/earlyInputCapture-QBC4ZCV7.js +83 -0
- package/chunks/{edit-OBDSQURM.js → edit-7ABV72VV.js} +48 -47
- package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
- package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-4NOWT6I2.js} +48 -47
- package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-4NOQ6A56.js} +48 -47
- package/chunks/{environment-W5UFC2CH.js → environment-ABMFNOJO.js} +49 -48
- package/chunks/errors-UAX4AR5Q.js +89 -0
- package/chunks/esm-K5FARBNI.js +5548 -0
- package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-CF2O5AQM.js} +48 -47
- package/chunks/exitPlanMode-5KEF5DLM.js +74 -0
- package/chunks/{fast-path-JJZFJANL.js → fast-path-RWZGR7A6.js} +16 -6
- package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
- package/chunks/{gemini-QS36EBZV.js → gemini-A4LXWU5S.js} +103 -98
- package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-VPXAS3BM.js} +40 -11
- package/chunks/{getMachineId-bsd-V7W3GODC.js → getMachineId-bsd-FG7IUY6U.js} +1 -1
- package/chunks/{getMachineId-darwin-TDO75DQP.js → getMachineId-darwin-GLCJI2RA.js} +1 -1
- package/chunks/{getMachineId-linux-TF43WQT2.js → getMachineId-linux-O6OPPAKO.js} +1 -1
- package/chunks/{getMachineId-unsupported-ZGUO3TXT.js → getMachineId-unsupported-S6CKYVGC.js} +1 -1
- package/chunks/{getMachineId-win-ECFYZZFQ.js → getMachineId-win-X5SRNEH7.js} +1 -1
- package/chunks/{glob-V7R3PSK3.js → glob-P6ZPQOPR.js} +48 -47
- package/chunks/goal-tools-H2NHZKGN.js +335 -0
- package/chunks/{grep-QYPSK7OP.js → grep-56M3IJ36.js} +50 -48
- package/chunks/handleAutoUpdate-N3IMC273.js +82 -0
- package/chunks/i18n-UFV5QINW.js +98 -0
- package/chunks/{image-gen-Z3VPGKRC.js → image-gen-GPYAKETO.js} +12 -12
- package/chunks/initializer-OXWZKLEX.js +87 -0
- package/chunks/installationInfo-V2YEC52N.js +81 -0
- package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
- package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-72IYCAZV.js} +3 -3
- package/chunks/lib-RUF3WZA6.js +9 -0
- package/chunks/list-UN6EJ6WB.js +90 -0
- package/chunks/{list-agents-5KJJHR6I.js → list-agents-R6KDXQR3.js} +3 -3
- package/chunks/loadedSettingsAdapter-LZK2PMOY.js +84 -0
- package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-PSFMRX7M.js} +78 -113
- package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-3IQKCYAH.js} +7 -7
- package/chunks/{ls-NTK6VOQJ.js → ls-DKZ37A7N.js} +5 -5
- package/chunks/{lsp-2JI24STP.js → lsp-QNWN7KN3.js} +3 -3
- package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-D2AO3F47.js} +48 -47
- package/chunks/mcp-A2VAOKMH.js +84 -0
- package/chunks/{monitor-R3ODH5U6.js → monitor-7EJ3WBER.js} +48 -47
- package/chunks/nonInteractiveCli-43LIVN4A.js +146 -0
- package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-IQD53ULF.js} +48 -47
- package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-YPCMNGEZ.js} +26 -27
- package/chunks/pidfile-3SOOBWZA.js +87 -0
- package/chunks/process-registry-2CHQBXH5.js +157 -0
- package/chunks/{processUtils-RT7UNCC2.js → processUtils-FGVHFR4V.js} +2 -2
- package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
- package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-M6YW4D6A.js} +53 -52
- package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-XSYKLMNR.js} +10 -10
- package/chunks/read-file-XOMBFIS7.js +29 -0
- package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-GFTWYXMK.js} +4 -4
- package/chunks/record-artifact-JANPGVS4.js +21 -0
- package/chunks/resumeHistoryUtils-E4EVA4PO.js +92 -0
- package/chunks/ripGrep-M4NYA6AM.js +74 -0
- package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
- package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-QLCU2BAZ.js} +953 -248
- package/chunks/{runtime-XXRRTNP6.js → runtime-T36WUYIO.js} +57 -55
- package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-C3J45Z5W.js} +47 -46
- package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
- package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-BFOKQFRD.js} +7 -7
- package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-6CJ3JQZL.js} +14 -14
- package/chunks/{send-message-Q6OOR6BR.js → send-message-RJ2R4PIV.js} +6 -12
- package/chunks/serve-7SWJTL3K.js +90 -0
- package/chunks/{server-4UMH7OIZ.js → server-T2B64F4O.js} +3887 -852
- package/chunks/{session-K3O3Q2SV.js → session-D546I4HT.js} +99 -94
- package/chunks/{settings-CR2EWTBA.js → settings-ZQOOTRR7.js} +51 -50
- package/chunks/shell-5OR4RAKF.js +84 -0
- package/chunks/{skill-I3SDA4MB.js → skill-X4E5JMKV.js} +20 -21
- package/chunks/skill-settings-ZS3XPDMT.js +92 -0
- package/chunks/spawnChannel-MILVKB3G.js +83 -0
- package/chunks/standalone-update-UTYCSPUO.js +93 -0
- package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-S4R5J4EN.js} +1220 -895
- package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-355CB6CJ.js} +4 -4
- package/chunks/{task-create-N7WQSGYA.js → task-create-KUQIS7RA.js} +10 -10
- package/chunks/{task-list-FOPULZEP.js → task-list-5XNNGTF4.js} +7 -7
- package/chunks/{task-stop-H6RHXFVQ.js → task-stop-4ROAOBXH.js} +3 -3
- package/chunks/{task-update-M57TFZJT.js → task-update-4FPFYGE3.js} +10 -10
- package/chunks/{team-create-YJALH5D2.js → team-create-MGD3Q7W4.js} +50 -49
- package/chunks/{team-delete-QE2UXJL7.js → team-delete-S2RCXA4P.js} +7 -7
- package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-VMVGLPDQ.js} +48 -47
- package/chunks/theme-manager-U4QE2YSY.js +78 -0
- package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-7WM3VDMY.js} +7 -7
- package/chunks/{tool-search-NF7GB6LE.js → tool-search-6T7VYTYZ.js} +19 -21
- package/chunks/total-session-admission-PLKO4EET.js +86 -0
- package/chunks/trustedFolders-QZU6BO46.js +96 -0
- package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-NWPFNM5L.js} +5 -5
- package/chunks/updateCheck-KEOCGBZR.js +93 -0
- package/chunks/useAutoAcceptIndicator-O6XISZEA.js +94 -0
- package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-WCHAHO75.js} +94 -89
- package/chunks/{version-HS7YSFHV.js → version-VP3VZ2BM.js} +1 -1
- package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-KM2FSOKS.js} +19 -21
- package/chunks/{web-search-S62WAP4S.js → web-search-WUR6PYBO.js} +13 -13
- package/chunks/{workflow-QAGU5RU4.js → workflow-S6XMX55R.js} +49 -48
- package/chunks/workspace-providers-status-JGIZRHVT.js +87 -0
- package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-JDEMOOFX.js} +1 -1
- package/chunks/workspace-registry-NIL6253M.js +94 -0
- package/chunks/workspace-service-UYB6MMWL.js +101 -0
- package/chunks/workspace-skills-status-GSJRWER4.js +87 -0
- package/chunks/workspace-trust-reconciler-V2TICK2A.js +347 -0
- package/chunks/write-file-QHD5ELJS.js +76 -0
- package/chunks/xterm-headless-NTYVIBT3.js +3475 -0
- package/chunks/{zh-LUIGBD55.js → zh-H3YDK5QW.js} +9 -1
- package/chunks/{zh-TW-F5KG2IYD.js → zh-TW-JYCP7XUA.js} +9 -1
- package/chunks/zoom-image-236QXDRH.js +224 -0
- package/cli.js +13 -13
- package/locales/ca.js +7 -2
- package/locales/de.js +7 -2
- package/locales/en.js +10 -2
- package/locales/fr.js +7 -2
- package/locales/ja.js +7 -2
- package/locales/pt.js +7 -2
- package/locales/ru.js +7 -2
- package/locales/zh-TW.js +10 -2
- package/locales/zh.js +10 -2
- package/package.json +5 -4
- package/web-shell/assets/{arc-DcbWnB9T.js → arc-DQN8gc5j.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-C6Z867cc.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-BkyNf4_J.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-BA7aurej.js} +1 -1
- package/web-shell/assets/channel-YzToqAUt.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-Dp_LERgD.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-CCwcnkeW.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-e0ytWiup.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-DBoZrQ--.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-dmHU5zKq.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-PP3UKzsN.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-Bjy0PNsP.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-CM0H6wrK.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-_le9LVNU.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-_le9LVNU.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-B1B_Fozz.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-DGFk7aBN.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-VdlYGHdV.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-xcEMWz6m.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-B6Dd23eT.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-C3bjiNTc.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-ChXfX8H6.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-D7RBC3FG.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-bNsx8Fqb.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-C_m4liOj.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-CzAqOmDr.js} +1 -1
- package/web-shell/assets/{index-D0GX0zZf.js → index-BArKGy43.js} +1 -1
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/index-_dIfJ82-.js +1625 -0
- package/web-shell/assets/index-heP6zO4t.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-BBw9H4RT.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-C8Ns7cDb.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-BkW5h5si.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-IUhsF7tq.js} +1 -1
- package/web-shell/assets/{linear-BkoihsaA.js → linear-CeDsMMjT.js} +1 -1
- package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-VTPU82QL.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-DVohXDmC.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-SxBFaID8.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-BJt8o3Cs.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-B02G8M7E.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-CzMCGPib.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-CzbJgSkE.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-DhiXBOKS.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DILbnhvR.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-Btj5idQV.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-CJz2YZq4.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-CavIou7m.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-BRf62x8X.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-ItOGZPM_.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/MaxSizedBox-5DPPWPGT.js +0 -85
- package/chunks/agent-6ODUANDO.js +0 -81
- package/chunks/agent-headless-7BYQTMHW.js +0 -75
- package/chunks/bridge-ZUB64FAE.js +0 -90
- package/chunks/chunk-LEH5C7FV.js +0 -232
- package/chunks/chunk-SZRN75WQ.js +0 -29
- package/chunks/chunk-UGYMA4EI.js +0 -219
- package/chunks/chunk-Z2BC6UJ5.js +0 -8575
- package/chunks/contextCommand-JLHYA34Z.js +0 -80
- package/chunks/daemon-status-provider-2233Q37D.js +0 -89
- package/chunks/earlyInputCapture-A7NDU3PF.js +0 -82
- package/chunks/errors-M7CLORXH.js +0 -88
- package/chunks/exitPlanMode-GXTBWQAR.js +0 -403
- package/chunks/handleAutoUpdate-6DBEZYPV.js +0 -81
- package/chunks/i18n-VUJJZIMU.js +0 -97
- package/chunks/initializer-UWAK5U5O.js +0 -86
- package/chunks/installationInfo-6O2YAA52.js +0 -80
- package/chunks/list-GB4ESM3T.js +0 -89
- package/chunks/loadedSettingsAdapter-OT6JVQ7U.js +0 -83
- package/chunks/mcp-6DBDJPFU.js +0 -83
- package/chunks/nonInteractiveCli-MOYCYBBU.js +0 -141
- package/chunks/pidfile-TFRZZZIO.js +0 -86
- package/chunks/read-file-APMO3PSX.js +0 -31
- package/chunks/resumeHistoryUtils-6KRYEAWZ.js +0 -91
- package/chunks/ripGrep-BEJDEDXW.js +0 -73
- package/chunks/serve-7BSTXJ4T.js +0 -89
- package/chunks/shell-HH3PF3A2.js +0 -83
- package/chunks/spawnChannel-RWNDBXGA.js +0 -82
- package/chunks/src-GE4TTTML.js +0 -3147
- package/chunks/standalone-update-Q6WFRZZQ.js +0 -92
- package/chunks/theme-manager-SWRILQHI.js +0 -77
- package/chunks/total-session-admission-DLHHHLD3.js +0 -84
- package/chunks/trustedFolders-KHXHY6PY.js +0 -93
- package/chunks/updateCheck-RKL6M5XN.js +0 -92
- package/chunks/useAutoAcceptIndicator-CFQ5BUJL.js +0 -93
- package/chunks/workspace-providers-status-QSVZUETE.js +0 -86
- package/chunks/workspace-registry-UT4RBNBM.js +0 -88
- package/chunks/workspace-service-JFWRUS4V.js +0 -98
- package/chunks/workspace-skills-status-ZBBKJOI2.js +0 -85
- package/chunks/write-file-VHIXW5M7.js +0 -73
- package/web-shell/assets/channel-Cq7YKtfC.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/index-D9haPt0X.css +0 -5
- package/web-shell/assets/index-ckX9Pq5k.js +0 -1230
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-B7W4zlCr.js +0 -1
- package/chunks/{chunk-TARRHLLG.js → chunk-QUGAUQGJ.js} +25 -25
- package/chunks/{chunk-U7ZFW55U.js → chunk-VOQXFAY5.js} +977 -977
- /package/chunks/{chunk-LXXMOYPL.js → chunk-VXZBKKQR.js} +0 -0
|
@@ -35,22 +35,22 @@ import {
|
|
|
35
35
|
require_express,
|
|
36
36
|
resolveWebShellDir,
|
|
37
37
|
setDeferredRuntimeRequestTiming
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-XTLTBZIH.js";
|
|
39
39
|
import {
|
|
40
40
|
isLoopbackBind
|
|
41
41
|
} from "./chunk-RXFQM6FQ.js";
|
|
42
42
|
import {
|
|
43
43
|
DEFAULT_COMPACTED_REPLAY_MAX_BYTES,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
import "./chunk-
|
|
44
|
+
DEFAULT_MAX_JOURNAL_BYTES,
|
|
45
|
+
DEFAULT_MAX_JOURNAL_EVENTS,
|
|
46
|
+
normalizeCompactedReplayMaxBytes,
|
|
47
|
+
normalizeMaxJournalBytes,
|
|
48
|
+
normalizeMaxJournalEvents
|
|
49
|
+
} from "./chunk-XCGIMOLN.js";
|
|
50
|
+
import "./chunk-FC4KQFCS.js";
|
|
51
51
|
import {
|
|
52
52
|
resolveChannelCwd
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-FANRZEAJ.js";
|
|
54
54
|
import {
|
|
55
55
|
loadServeFastPathSettings,
|
|
56
56
|
preResolveServeFastPathHomeEnvOverrides
|
|
@@ -59,45 +59,54 @@ import {
|
|
|
59
59
|
MAX_REGISTERED_WORKSPACES,
|
|
60
60
|
resolveWorkspaceInputs,
|
|
61
61
|
workspaceRegistrationId
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-K4GTOFKY.js";
|
|
63
|
+
import "./chunk-77IMMLN2.js";
|
|
64
|
+
import {
|
|
65
|
+
LOAD_REPLAY_META_KEY
|
|
66
|
+
} from "./chunk-XZC5VLBZ.js";
|
|
67
|
+
import "./chunk-B4AJNNOL.js";
|
|
63
68
|
import {
|
|
64
69
|
canonicalizeWorkspace,
|
|
65
70
|
translateAndCheckAbsoluteWorkspacePath
|
|
66
71
|
} from "./chunk-2RFKHEXL.js";
|
|
67
|
-
import "./chunk-
|
|
68
|
-
import "./chunk-
|
|
72
|
+
import "./chunk-FCYYAB4S.js";
|
|
73
|
+
import "./chunk-FYJ7W2PI.js";
|
|
69
74
|
import {
|
|
70
75
|
ChannelDeliveryError,
|
|
71
76
|
ChannelWebhookEnqueueError,
|
|
72
77
|
QWEN_SERVER_TOKEN_ENV,
|
|
73
|
-
isChannelDeliveryError
|
|
78
|
+
isChannelDeliveryError
|
|
79
|
+
} from "./chunk-U4VTUMMK.js";
|
|
80
|
+
import {
|
|
74
81
|
normalizeWorkerDiagnostic,
|
|
75
82
|
sanitizeWorkerDiagnostic
|
|
76
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-6MPDY6ZG.js";
|
|
77
84
|
import {
|
|
78
85
|
channelSelectionNames
|
|
79
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-ALMR3E6Q.js";
|
|
80
87
|
import "./chunk-BK2UNYWD.js";
|
|
81
88
|
import "./chunk-M5GB774H.js";
|
|
89
|
+
import "./chunk-5HBA2Z7V.js";
|
|
90
|
+
import "./chunk-K6KS3LTN.js";
|
|
91
|
+
import "./chunk-T3CHYWJZ.js";
|
|
82
92
|
import {
|
|
83
93
|
sanitizeLogText
|
|
84
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-JCJ7LKNA.js";
|
|
85
95
|
import "./chunk-UDXSXLER.js";
|
|
86
|
-
import "./chunk-5HBA2Z7V.js";
|
|
87
96
|
import "./chunk-GOXKNSDZ.js";
|
|
88
97
|
import {
|
|
89
98
|
getGlobalQwenDirLite,
|
|
90
99
|
resolveConfigPathLite
|
|
91
100
|
} from "./chunk-IDS7MSUP.js";
|
|
92
101
|
import "./chunk-6PEXNQTX.js";
|
|
93
|
-
import {
|
|
94
|
-
getCliVersion
|
|
95
|
-
} from "./chunk-YX324OPW.js";
|
|
96
|
-
import "./chunk-VJNBRRZG.js";
|
|
97
102
|
import "./chunk-ALGGS7UH.js";
|
|
98
103
|
import {
|
|
99
104
|
isWithinRoot
|
|
100
105
|
} from "./chunk-MR3PXB6E.js";
|
|
106
|
+
import {
|
|
107
|
+
getCliVersion
|
|
108
|
+
} from "./chunk-HGQIL6NG.js";
|
|
109
|
+
import "./chunk-VJNBRRZG.js";
|
|
101
110
|
import {
|
|
102
111
|
writeStderrLine,
|
|
103
112
|
writeStdoutLine
|
|
@@ -2492,6 +2501,13 @@ function formatHostForUrl(host) {
|
|
|
2492
2501
|
return host;
|
|
2493
2502
|
}
|
|
2494
2503
|
__name(formatHostForUrl, "formatHostForUrl");
|
|
2504
|
+
function workspaceRuntimeEffectiveEnv(runtime, daemonEnv) {
|
|
2505
|
+
if (runtime.env.mode === "runtime-overlay") {
|
|
2506
|
+
return runtime.env.effectiveEnv ?? {};
|
|
2507
|
+
}
|
|
2508
|
+
return runtime.env.effectiveEnv ?? daemonEnv;
|
|
2509
|
+
}
|
|
2510
|
+
__name(workspaceRuntimeEffectiveEnv, "workspaceRuntimeEffectiveEnv");
|
|
2495
2511
|
function formatChannelWorkerDaemonUrl(host, port) {
|
|
2496
2512
|
const normalized = host.trim().toLowerCase();
|
|
2497
2513
|
if (normalized === "" || normalized === "0.0.0.0" || normalized === "::" || normalized === "[::]") {
|
|
@@ -2529,15 +2545,16 @@ function withSettingsLock(workspace, fn) {
|
|
|
2529
2545
|
return next;
|
|
2530
2546
|
}
|
|
2531
2547
|
__name(withSettingsLock, "withSettingsLock");
|
|
2548
|
+
var retryableChannelWorkerShutdownErrors = /* @__PURE__ */ new WeakSet();
|
|
2532
2549
|
var channelWorkerRuntimePromise;
|
|
2533
2550
|
async function loadChannelWorkerRuntime() {
|
|
2534
2551
|
channelWorkerRuntimePromise ??= Promise.all([
|
|
2535
|
-
import("./channel-worker-supervisor-
|
|
2536
|
-
import("./pidfile-
|
|
2537
|
-
import("./runtime-
|
|
2552
|
+
import("./channel-worker-supervisor-CABBXYHK.js"),
|
|
2553
|
+
import("./pidfile-3SOOBWZA.js"),
|
|
2554
|
+
import("./runtime-T36WUYIO.js"),
|
|
2538
2555
|
import("./cli-entry-path-4VJ3Y6T2.js"),
|
|
2539
|
-
import("./channel-worker-group-
|
|
2540
|
-
import("./channel-worker-manager-
|
|
2556
|
+
import("./channel-worker-group-7SZ7MR3K.js"),
|
|
2557
|
+
import("./channel-worker-manager-RN5KJYPF.js")
|
|
2541
2558
|
]).then(
|
|
2542
2559
|
([
|
|
2543
2560
|
supervisor,
|
|
@@ -2642,7 +2659,7 @@ function shouldPreheatBridge(deps) {
|
|
|
2642
2659
|
__name(shouldPreheatBridge, "shouldPreheatBridge");
|
|
2643
2660
|
var coreRuntimePromise;
|
|
2644
2661
|
function loadCoreRuntime() {
|
|
2645
|
-
coreRuntimePromise ??= import("./
|
|
2662
|
+
coreRuntimePromise ??= import("./core-runtime-QGEW6WBW.js");
|
|
2646
2663
|
return coreRuntimePromise;
|
|
2647
2664
|
}
|
|
2648
2665
|
__name(loadCoreRuntime, "loadCoreRuntime");
|
|
@@ -2672,10 +2689,10 @@ __name(resolveDaemonLogBaseDirForRun, "resolveDaemonLogBaseDirForRun");
|
|
|
2672
2689
|
var settingsRuntimePromise;
|
|
2673
2690
|
function loadSettingsRuntimeModules() {
|
|
2674
2691
|
settingsRuntimePromise ??= Promise.all([
|
|
2675
|
-
import("./settings-
|
|
2676
|
-
import("./environment-
|
|
2677
|
-
import("./loadedSettingsAdapter-
|
|
2678
|
-
import("./trustedFolders-
|
|
2692
|
+
import("./settings-ZQOOTRR7.js"),
|
|
2693
|
+
import("./environment-ABMFNOJO.js"),
|
|
2694
|
+
import("./loadedSettingsAdapter-LZK2PMOY.js"),
|
|
2695
|
+
import("./trustedFolders-QZU6BO46.js")
|
|
2679
2696
|
]).then(([settings, environment, loadedSettingsAdapter, trustedFolders]) => ({
|
|
2680
2697
|
settings,
|
|
2681
2698
|
environment,
|
|
@@ -2688,8 +2705,8 @@ __name(loadSettingsRuntimeModules, "loadSettingsRuntimeModules");
|
|
|
2688
2705
|
var channelWebhookConfigRuntimePromise;
|
|
2689
2706
|
function loadChannelWebhookConfigRuntime() {
|
|
2690
2707
|
channelWebhookConfigRuntimePromise ??= Promise.all([
|
|
2691
|
-
import("./runtime-
|
|
2692
|
-
import("./config-utils-
|
|
2708
|
+
import("./runtime-T36WUYIO.js"),
|
|
2709
|
+
import("./config-utils-RUFMEUYD.js")
|
|
2693
2710
|
]).then(([channelRuntime, configUtils]) => ({
|
|
2694
2711
|
loadChannelsConfig: channelRuntime.loadChannelsConfig,
|
|
2695
2712
|
parseChannelWebhookConfig: configUtils.parseChannelWebhookConfig
|
|
@@ -2705,6 +2722,7 @@ async function loadServeRuntimeModules() {
|
|
|
2705
2722
|
serverModule,
|
|
2706
2723
|
bridgeModule,
|
|
2707
2724
|
spawnChannelModule,
|
|
2725
|
+
processRegistryModule,
|
|
2708
2726
|
workspaceModule,
|
|
2709
2727
|
workspaceTypesModule,
|
|
2710
2728
|
daemonStatusProviderModule,
|
|
@@ -2713,16 +2731,17 @@ async function loadServeRuntimeModules() {
|
|
|
2713
2731
|
totalSessionAdmissionModule,
|
|
2714
2732
|
workspaceRegistryModule
|
|
2715
2733
|
] = await Promise.all([
|
|
2716
|
-
import("./server-
|
|
2717
|
-
import("./bridge-
|
|
2718
|
-
import("./spawnChannel-
|
|
2719
|
-
import("./
|
|
2734
|
+
import("./server-T2B64F4O.js"),
|
|
2735
|
+
import("./bridge-B2YJLSLT.js"),
|
|
2736
|
+
import("./spawnChannel-MILVKB3G.js"),
|
|
2737
|
+
import("./process-registry-2CHQBXH5.js"),
|
|
2738
|
+
import("./workspace-service-UYB6MMWL.js"),
|
|
2720
2739
|
import("./types-ML3TRJQ5.js"),
|
|
2721
|
-
import("./daemon-status-provider-
|
|
2722
|
-
import("./workspace-providers-status-
|
|
2723
|
-
import("./workspace-skills-status-
|
|
2724
|
-
import("./total-session-admission-
|
|
2725
|
-
import("./workspace-registry-
|
|
2740
|
+
import("./daemon-status-provider-MB54AMNV.js"),
|
|
2741
|
+
import("./workspace-providers-status-JGIZRHVT.js"),
|
|
2742
|
+
import("./workspace-skills-status-GSJRWER4.js"),
|
|
2743
|
+
import("./total-session-admission-PLKO4EET.js"),
|
|
2744
|
+
import("./workspace-registry-NIL6253M.js")
|
|
2726
2745
|
]);
|
|
2727
2746
|
return {
|
|
2728
2747
|
createServeApp: serverModule.createServeApp,
|
|
@@ -2731,6 +2750,7 @@ async function loadServeRuntimeModules() {
|
|
|
2731
2750
|
resolveBridgeFsFactory: serverModule.resolveBridgeFsFactory,
|
|
2732
2751
|
createAcpSessionBridge: bridgeModule.createAcpSessionBridge,
|
|
2733
2752
|
createSpawnChannelFactory: spawnChannelModule.createSpawnChannelFactory,
|
|
2753
|
+
ProcessRegistry: processRegistryModule.ProcessRegistry,
|
|
2734
2754
|
createDaemonWorkspaceService: workspaceModule.createDaemonWorkspaceService,
|
|
2735
2755
|
WorkspaceSettingsPartialPersistError: workspaceTypesModule.WorkspaceSettingsPartialPersistError,
|
|
2736
2756
|
WorkspaceSkillNotToggleableError: workspaceTypesModule.WorkspaceSkillNotToggleableError,
|
|
@@ -2739,7 +2759,8 @@ async function loadServeRuntimeModules() {
|
|
|
2739
2759
|
createWorkspaceSkillsStatusProvider: workspaceSkillsStatusModule.createWorkspaceSkillsStatusProvider,
|
|
2740
2760
|
createTotalSessionAdmissionController: totalSessionAdmissionModule.createTotalSessionAdmissionController,
|
|
2741
2761
|
createWorkspaceRegistry: workspaceRegistryModule.createWorkspaceRegistry,
|
|
2742
|
-
createWorkspaceSessionOwnerIndex: workspaceRegistryModule.createWorkspaceSessionOwnerIndex
|
|
2762
|
+
createWorkspaceSessionOwnerIndex: workspaceRegistryModule.createWorkspaceSessionOwnerIndex,
|
|
2763
|
+
createWorkspaceGenerationGuard: workspaceRegistryModule.createWorkspaceGenerationGuard
|
|
2743
2764
|
};
|
|
2744
2765
|
}
|
|
2745
2766
|
__name(loadServeRuntimeModules, "loadServeRuntimeModules");
|
|
@@ -2779,6 +2800,7 @@ function currentServeFeaturesForRunQwenServe(opts, sessionShellCommandEnabled, s
|
|
|
2779
2800
|
reloadAvailable: true,
|
|
2780
2801
|
channelReloadAvailable: opts.channelSelection !== void 0,
|
|
2781
2802
|
channelControlAvailable: true,
|
|
2803
|
+
channelManagementAvailable: true,
|
|
2782
2804
|
persistentWorkspaceRegistrationAvailable: true,
|
|
2783
2805
|
workspaceRuntimeRemovalAvailable: true,
|
|
2784
2806
|
// Advertise the same WS feature flags as the runtime path (serve-features.ts)
|
|
@@ -3087,6 +3109,8 @@ function createBootstrapServeApp(input) {
|
|
|
3087
3109
|
listenerMaxConnections: listenerMaxConnections(opts.maxConnections),
|
|
3088
3110
|
eventRingSize: opts.eventRingSize ?? DEFAULT_EVENT_RING_SIZE,
|
|
3089
3111
|
compactedReplayMaxBytes: opts.compactedReplayMaxBytes ?? DEFAULT_COMPACTED_REPLAY_MAX_BYTES,
|
|
3112
|
+
maxJournalEvents: opts.maxJournalEvents ?? DEFAULT_MAX_JOURNAL_EVENTS,
|
|
3113
|
+
maxJournalBytes: opts.maxJournalBytes ?? DEFAULT_MAX_JOURNAL_BYTES,
|
|
3090
3114
|
promptDeadlineMs: positiveFiniteOrNull(opts.promptDeadlineMs),
|
|
3091
3115
|
writerIdleTimeoutMs: positiveFiniteOrNull(opts.writerIdleTimeoutMs),
|
|
3092
3116
|
channelIdleTimeoutMs: channelIdleTimeoutMs(opts.channelIdleTimeoutMs),
|
|
@@ -3610,7 +3634,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
3610
3634
|
}
|
|
3611
3635
|
let workspaceRegistrationStore = deps.workspaceRegistrationStore;
|
|
3612
3636
|
if (workspaceRegistrationStore === void 0 && process.env["QWEN_SERVE_NO_PERSISTENT_REGISTRATION"] !== "1") {
|
|
3613
|
-
const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-
|
|
3637
|
+
const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-JDEMOOFX.js");
|
|
3614
3638
|
workspaceRegistrationStore = new WorkspaceRegistrationStore(boundWorkspace);
|
|
3615
3639
|
}
|
|
3616
3640
|
if (workspaceRegistrationStore) {
|
|
@@ -3765,6 +3789,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
3765
3789
|
if (opts.compactedReplayMaxBytes !== void 0) {
|
|
3766
3790
|
normalizeCompactedReplayMaxBytes(opts.compactedReplayMaxBytes);
|
|
3767
3791
|
}
|
|
3792
|
+
if (opts.maxJournalEvents !== void 0) {
|
|
3793
|
+
normalizeMaxJournalEvents(opts.maxJournalEvents);
|
|
3794
|
+
}
|
|
3795
|
+
if (opts.maxJournalBytes !== void 0) {
|
|
3796
|
+
normalizeMaxJournalBytes(opts.maxJournalBytes);
|
|
3797
|
+
}
|
|
3768
3798
|
if (opts.writerIdleTimeoutMs !== void 0) {
|
|
3769
3799
|
if (!isPositiveIntegerMs(opts.writerIdleTimeoutMs)) {
|
|
3770
3800
|
throw new TypeError(
|
|
@@ -3849,6 +3879,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
3849
3879
|
let runtimeApp;
|
|
3850
3880
|
let runtimeAppForCleanup;
|
|
3851
3881
|
let bridgeRef = deps.bridge;
|
|
3882
|
+
let managedProcessRegistry;
|
|
3852
3883
|
const internalRuntimeBridgesForCleanup = [];
|
|
3853
3884
|
let daemonEventLoopMonitor;
|
|
3854
3885
|
let daemonMetricsSampler;
|
|
@@ -4015,6 +4046,19 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4015
4046
|
const disposedRuntimeApps = /* @__PURE__ */ new WeakSet();
|
|
4016
4047
|
const stoppedRuntimeAppProducers = /* @__PURE__ */ new WeakSet();
|
|
4017
4048
|
const stoppedExtensionReconcilers = /* @__PURE__ */ new WeakSet();
|
|
4049
|
+
const stoppedTrustPolicyMonitors = /* @__PURE__ */ new WeakSet();
|
|
4050
|
+
const stopTrustPolicyMonitor = /* @__PURE__ */ __name((app2) => {
|
|
4051
|
+
if (!app2 || stoppedTrustPolicyMonitors.has(app2)) return;
|
|
4052
|
+
stoppedTrustPolicyMonitors.add(app2);
|
|
4053
|
+
const stop = app2.locals?.["stopTrustPolicyMonitor"];
|
|
4054
|
+
try {
|
|
4055
|
+
stop?.();
|
|
4056
|
+
} catch (err) {
|
|
4057
|
+
daemonLog.warn(
|
|
4058
|
+
`trust policy monitor dispose error: ${err instanceof Error ? err.message : String(err)}`
|
|
4059
|
+
);
|
|
4060
|
+
}
|
|
4061
|
+
}, "stopTrustPolicyMonitor");
|
|
4018
4062
|
const stopExtensionReconciler = /* @__PURE__ */ __name((app2) => {
|
|
4019
4063
|
if (!app2 || stoppedExtensionReconcilers.has(app2)) return;
|
|
4020
4064
|
stoppedExtensionReconcilers.add(app2);
|
|
@@ -4042,6 +4086,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4042
4086
|
}, "stopSafely");
|
|
4043
4087
|
stopSafely("scheduled-task keepalive", locals.stopScheduledTaskKeepalive);
|
|
4044
4088
|
stopSafely("workspace git state", locals.stopWorkspaceGitState);
|
|
4089
|
+
stopTrustPolicyMonitor(app2);
|
|
4045
4090
|
for (const stop of locals.subSessionStoppers ?? []) {
|
|
4046
4091
|
stopSafely("sub-session launcher", stop);
|
|
4047
4092
|
}
|
|
@@ -4095,13 +4140,23 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4095
4140
|
return [...new Set(bridges)];
|
|
4096
4141
|
}, "getRuntimeBridgesForCleanup");
|
|
4097
4142
|
const buildRuntime = /* @__PURE__ */ __name(async () => {
|
|
4098
|
-
const [runtime, core, settingsRuntime, resolvedCliVersion] = await Promise.all([
|
|
4143
|
+
const [runtime, core, settingsRuntime, resolvedCliVersion, trustPolicy] = await Promise.all([
|
|
4099
4144
|
loadServeRuntimeModules(),
|
|
4100
4145
|
loadCoreRuntime(),
|
|
4101
4146
|
loadSettingsRuntimeModules(),
|
|
4102
|
-
cliVersionPromise
|
|
4147
|
+
cliVersionPromise,
|
|
4148
|
+
import("./daemon-trust-policy-3VFDF5LU.js")
|
|
4103
4149
|
]);
|
|
4104
4150
|
cliVersion = resolvedCliVersion;
|
|
4151
|
+
settingsRuntime.environment.preResolveHomeEnvOverrides();
|
|
4152
|
+
const bootTrustSnapshot = await trustPolicy.readDaemonTrustPolicySnapshot();
|
|
4153
|
+
let latestTrustPolicySnapshot = bootTrustSnapshot;
|
|
4154
|
+
const bootPrimaryTrustDecision = trustPolicy.evaluateDaemonWorkspaceTrust(
|
|
4155
|
+
bootTrustSnapshot,
|
|
4156
|
+
boundWorkspace
|
|
4157
|
+
);
|
|
4158
|
+
const trustedWorkspace = deps.trustedWorkspace ?? bootPrimaryTrustDecision.targetTrusted;
|
|
4159
|
+
const workspaceTrustHotReloadAvailable = deps.trustedWorkspace === void 0 && deps.bridge === void 0 && deps.fsFactory === void 0;
|
|
4105
4160
|
let managedScratchRoot;
|
|
4106
4161
|
try {
|
|
4107
4162
|
managedScratchRoot = prepareManagedScratchRoot(
|
|
@@ -4115,16 +4170,19 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4115
4170
|
}
|
|
4116
4171
|
let runtimeBootSettings;
|
|
4117
4172
|
try {
|
|
4118
|
-
runtimeBootSettings = settingsRuntime.settings.loadSettings(
|
|
4173
|
+
runtimeBootSettings = settingsRuntime.settings.loadSettings(
|
|
4174
|
+
boundWorkspace,
|
|
4175
|
+
{
|
|
4176
|
+
skipLoadEnvironment: true,
|
|
4177
|
+
skipWorkspaceSettings: !trustedWorkspace,
|
|
4178
|
+
workspaceTrusted: trustedWorkspace
|
|
4179
|
+
}
|
|
4180
|
+
);
|
|
4119
4181
|
} catch (err) {
|
|
4120
4182
|
writeStderrLine(
|
|
4121
4183
|
`qwen serve: could not read full settings for runtime startup (${err instanceof Error ? err.message : String(err)}); falling back to defaults.`
|
|
4122
4184
|
);
|
|
4123
4185
|
}
|
|
4124
|
-
const trustedWorkspace = deps.trustedWorkspace ?? (runtimeBootSettings ? settingsRuntime.trustedFolders.getWorkspaceTrustStatus(
|
|
4125
|
-
runtimeBootSettings.merged,
|
|
4126
|
-
boundWorkspace
|
|
4127
|
-
).effective.state === "trusted" : true);
|
|
4128
4186
|
if (deps.trustedWorkspace === void 0 && runtimeBootSettings && !trustedWorkspace) {
|
|
4129
4187
|
daemonLog.warn(
|
|
4130
4188
|
"workspace file writes are disabled because the bound workspace is not trusted",
|
|
@@ -4134,7 +4192,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4134
4192
|
const runtimeEnvSnapshot = runtimeBootSettings ? settingsRuntime.environment.buildRuntimeEnvironment(
|
|
4135
4193
|
runtimeBootSettings.merged,
|
|
4136
4194
|
boundWorkspace,
|
|
4137
|
-
daemonRuntimeBaseEnv
|
|
4195
|
+
daemonRuntimeBaseEnv,
|
|
4196
|
+
trustedWorkspace
|
|
4138
4197
|
) : {
|
|
4139
4198
|
effectiveEnv: { ...daemonRuntimeBaseEnv },
|
|
4140
4199
|
overlayKeys: Object.freeze([]),
|
|
@@ -4305,17 +4364,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4305
4364
|
void 0,
|
|
4306
4365
|
(workspace, index) => {
|
|
4307
4366
|
if (index === 0) return true;
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
"excluding secondary workspace root because trust settings are unavailable",
|
|
4311
|
-
{ workspace }
|
|
4312
|
-
);
|
|
4313
|
-
return false;
|
|
4314
|
-
}
|
|
4315
|
-
const trustedSecondary = settingsRuntime.trustedFolders.getWorkspaceTrustStatus(
|
|
4316
|
-
runtimeBootSettings.merged,
|
|
4367
|
+
const trustedSecondary = trustPolicy.evaluateDaemonWorkspaceTrust(
|
|
4368
|
+
bootTrustSnapshot,
|
|
4317
4369
|
workspace
|
|
4318
|
-
).
|
|
4370
|
+
).targetTrusted;
|
|
4319
4371
|
if (!trustedSecondary) {
|
|
4320
4372
|
daemonLog.warn(
|
|
4321
4373
|
"excluding untrusted secondary workspace root from file-system access",
|
|
@@ -4330,7 +4382,16 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4330
4382
|
secondary: boundWorkspaces.slice(1),
|
|
4331
4383
|
ideEnvPresent: !!process.env["QWEN_CODE_IDE_WORKSPACE_PATH"]
|
|
4332
4384
|
});
|
|
4385
|
+
const primaryGenerationGuard = runtime.createWorkspaceGenerationGuard();
|
|
4386
|
+
const primaryTrustMaterialization = JSON.stringify({
|
|
4387
|
+
trusted: trustedWorkspace,
|
|
4388
|
+
boundWorkspaces: [...boundWorkspaces].sort()
|
|
4389
|
+
});
|
|
4333
4390
|
const sharedPathLocks = new PathMutexRegistry();
|
|
4391
|
+
const workspaceTrustOperationGate = new PathMutexRegistry();
|
|
4392
|
+
const runWorkspaceTrustOperation = /* @__PURE__ */ __name((operation) => workspaceTrustOperationGate.runExclusive("runtime-topology", operation), "runWorkspaceTrustOperation");
|
|
4393
|
+
const processRegistry = new runtime.ProcessRegistry();
|
|
4394
|
+
managedProcessRegistry = processRegistry;
|
|
4334
4395
|
const fsFactory = runtime.resolveBridgeFsFactory({
|
|
4335
4396
|
// Secondary roots share a write-capable factory only after their own
|
|
4336
4397
|
// folder trust check passes; untrusted secondary roots stay outside.
|
|
@@ -4339,6 +4400,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4339
4400
|
trusted: trustedWorkspace,
|
|
4340
4401
|
emit: deps.fsAuditEmit,
|
|
4341
4402
|
pathLocks: sharedPathLocks,
|
|
4403
|
+
generationGuard: primaryGenerationGuard,
|
|
4342
4404
|
...customIgnoreFiles !== void 0 ? { customIgnoreFiles } : {}
|
|
4343
4405
|
});
|
|
4344
4406
|
const routeFsFactory = runtime.resolveBridgeFsFactory({
|
|
@@ -4348,9 +4410,11 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4348
4410
|
trusted: trustedWorkspace,
|
|
4349
4411
|
emit: deps.fsAuditEmit,
|
|
4350
4412
|
pathLocks: sharedPathLocks,
|
|
4413
|
+
generationGuard: primaryGenerationGuard,
|
|
4351
4414
|
...customIgnoreFiles !== void 0 ? { customIgnoreFiles } : {}
|
|
4352
4415
|
});
|
|
4353
4416
|
const channelFactory = runtime.createSpawnChannelFactory({
|
|
4417
|
+
processRegistry,
|
|
4354
4418
|
sourceEnv: runtimeEffectiveEnv,
|
|
4355
4419
|
onDiagnosticLine: diagnosticSink,
|
|
4356
4420
|
pipeHooks: {
|
|
@@ -4368,9 +4432,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4368
4432
|
env: runtimeEffectiveEnv
|
|
4369
4433
|
});
|
|
4370
4434
|
const workspaceProvidersStatusProvider = runtime.createWorkspaceProvidersStatusProvider({
|
|
4371
|
-
env: runtimeEffectiveEnv
|
|
4435
|
+
env: runtimeEffectiveEnv,
|
|
4436
|
+
workspaceTrusted: trustedWorkspace
|
|
4437
|
+
});
|
|
4438
|
+
const workspaceSkillsStatusProvider = runtime.createWorkspaceSkillsStatusProvider({
|
|
4439
|
+
workspaceTrusted: trustedWorkspace
|
|
4372
4440
|
});
|
|
4373
|
-
const workspaceSkillsStatusProvider = runtime.createWorkspaceSkillsStatusProvider();
|
|
4374
4441
|
const clientMcpSenderRegistry = new ClientMcpSenderRegistry();
|
|
4375
4442
|
const runtimeBridges = [];
|
|
4376
4443
|
const totalSessionAdmission = runtime.createTotalSessionAdmissionController(
|
|
@@ -4380,84 +4447,108 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4380
4447
|
}
|
|
4381
4448
|
);
|
|
4382
4449
|
const sessionOwnerIndex = runtime.createWorkspaceSessionOwnerIndex();
|
|
4383
|
-
const
|
|
4384
|
-
|
|
4450
|
+
const workspaceRegistryForPersistence = { current: void 0 };
|
|
4451
|
+
const isWorkspaceTrustedForPersistence = /* @__PURE__ */ __name((workspace) => workspaceRegistryForPersistence.current?.getByWorkspaceCwd(workspace)?.trusted ?? (workspaceRegistryForPersistence.current === void 0 && workspace === boundWorkspace && trustedWorkspace), "isWorkspaceTrustedForPersistence");
|
|
4452
|
+
const loadSettingsForPersistence = /* @__PURE__ */ __name((workspace) => {
|
|
4453
|
+
const trusted = isWorkspaceTrustedForPersistence(workspace);
|
|
4454
|
+
return settingsRuntime.settings.loadSettings(workspace, {
|
|
4455
|
+
skipLoadEnvironment: true,
|
|
4456
|
+
skipWorkspaceSettings: !trusted,
|
|
4457
|
+
workspaceTrusted: trusted
|
|
4458
|
+
});
|
|
4459
|
+
}, "loadSettingsForPersistence");
|
|
4460
|
+
const persistDisabledToolsFn = /* @__PURE__ */ __name((workspace, toolName, enabled, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
4461
|
+
assertGenerationOpen?.();
|
|
4462
|
+
const fresh = loadSettingsForPersistence(workspace);
|
|
4385
4463
|
const wsScope = fresh.forScope(WORKSPACE_SETTING_SCOPE).settings;
|
|
4386
4464
|
const wsDisabled = wsScope.tools?.disabled;
|
|
4387
4465
|
const current = Array.isArray(wsDisabled) ? wsDisabled.filter((v) => typeof v === "string") : [];
|
|
4388
4466
|
const next = new Set(current);
|
|
4389
4467
|
if (enabled) next.delete(toolName);
|
|
4390
4468
|
else next.add(toolName);
|
|
4469
|
+
assertGenerationOpen?.();
|
|
4391
4470
|
fresh.setValue(
|
|
4392
4471
|
WORKSPACE_SETTING_SCOPE,
|
|
4393
4472
|
"tools.disabled",
|
|
4394
|
-
[...next].sort()
|
|
4473
|
+
[...next].sort(),
|
|
4474
|
+
assertGenerationOpen
|
|
4395
4475
|
);
|
|
4396
4476
|
}), "persistDisabledToolsFn");
|
|
4397
|
-
const persistDisabledSkillsFn = /* @__PURE__ */ __name((workspace, skillName, enabled) => withSettingsLock(workspace, async () => {
|
|
4398
|
-
|
|
4477
|
+
const persistDisabledSkillsFn = /* @__PURE__ */ __name((workspace, skillName, enabled, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
4478
|
+
assertGenerationOpen?.();
|
|
4479
|
+
const {
|
|
4480
|
+
resolveSkillSettings,
|
|
4481
|
+
skillSettingStrings,
|
|
4482
|
+
updateWorkspaceSkillSettingLists
|
|
4483
|
+
} = await import("./skill-settings-ZS3XPDMT.js");
|
|
4484
|
+
const fresh = loadSettingsForPersistence(workspace);
|
|
4399
4485
|
const normalizedName = skillName.trim().toLowerCase();
|
|
4400
|
-
const
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
for (const [scope, names] of lockedScopes) {
|
|
4409
|
-
if (disabledNames(names).some(
|
|
4410
|
-
(name) => name.trim().toLowerCase() === normalizedName
|
|
4411
|
-
)) {
|
|
4412
|
-
throw new runtime.WorkspaceSkillNotToggleableError(
|
|
4413
|
-
skillName,
|
|
4414
|
-
"locked",
|
|
4415
|
-
scope
|
|
4416
|
-
);
|
|
4417
|
-
}
|
|
4486
|
+
const resolved = resolveSkillSettings(fresh);
|
|
4487
|
+
const disablement = resolved.disablements.get(normalizedName);
|
|
4488
|
+
if (disablement?.reason === "hard" && disablement.lockedScope) {
|
|
4489
|
+
throw new runtime.WorkspaceSkillNotToggleableError(
|
|
4490
|
+
skillName,
|
|
4491
|
+
"locked",
|
|
4492
|
+
disablement.lockedScope
|
|
4493
|
+
);
|
|
4418
4494
|
}
|
|
4419
|
-
const workspaceDisabled =
|
|
4420
|
-
fresh
|
|
4495
|
+
const workspaceDisabled = skillSettingStrings(
|
|
4496
|
+
fresh,
|
|
4497
|
+
WORKSPACE_SETTING_SCOPE,
|
|
4498
|
+
"disabled"
|
|
4421
4499
|
);
|
|
4422
|
-
const
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
}
|
|
4439
|
-
changed = true;
|
|
4440
|
-
}
|
|
4500
|
+
const workspaceEnabled = skillSettingStrings(
|
|
4501
|
+
fresh,
|
|
4502
|
+
WORKSPACE_SETTING_SCOPE,
|
|
4503
|
+
"enabled"
|
|
4504
|
+
);
|
|
4505
|
+
const next = updateWorkspaceSkillSettingLists(
|
|
4506
|
+
{ disabled: workspaceDisabled, enabled: workspaceEnabled },
|
|
4507
|
+
skillName,
|
|
4508
|
+
enabled,
|
|
4509
|
+
resolved.defaultDisabledNames.has(normalizedName) && !resolved.enabledNames.has(normalizedName)
|
|
4510
|
+
);
|
|
4511
|
+
const settingsChanges = [];
|
|
4512
|
+
if (JSON.stringify(next.disabled) !== JSON.stringify(workspaceDisabled)) {
|
|
4513
|
+
settingsChanges.push({
|
|
4514
|
+
key: "skills.disabled",
|
|
4515
|
+
value: next.disabled.length > 0 ? next.disabled : void 0
|
|
4516
|
+
});
|
|
4441
4517
|
}
|
|
4442
|
-
if (
|
|
4443
|
-
|
|
4444
|
-
|
|
4518
|
+
if (JSON.stringify(next.enabled) !== JSON.stringify(workspaceEnabled)) {
|
|
4519
|
+
settingsChanges.push({
|
|
4520
|
+
key: "skills.enabled",
|
|
4521
|
+
value: next.enabled.length > 0 ? next.enabled : void 0
|
|
4522
|
+
});
|
|
4445
4523
|
}
|
|
4446
|
-
if (
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4524
|
+
if (settingsChanges.length === 0) {
|
|
4525
|
+
return { changed: false, disabled: workspaceDisabled };
|
|
4526
|
+
}
|
|
4527
|
+
assertGenerationOpen?.();
|
|
4528
|
+
fresh.setValues(
|
|
4529
|
+
settingsChanges.map((change) => ({
|
|
4530
|
+
scope: WORKSPACE_SETTING_SCOPE,
|
|
4531
|
+
...change
|
|
4532
|
+
})),
|
|
4533
|
+
void 0,
|
|
4534
|
+
assertGenerationOpen
|
|
4451
4535
|
);
|
|
4452
|
-
return {
|
|
4536
|
+
return {
|
|
4537
|
+
changed: true,
|
|
4538
|
+
disabled: next.disabled,
|
|
4539
|
+
settingsChanges
|
|
4540
|
+
};
|
|
4453
4541
|
}), "persistDisabledSkillsFn");
|
|
4454
|
-
const persistSettingFn = /* @__PURE__ */ __name((workspace, scope, key, value) => withSettingsLock(workspace, async () => {
|
|
4455
|
-
|
|
4456
|
-
fresh
|
|
4542
|
+
const persistSettingFn = /* @__PURE__ */ __name((workspace, scope, key, value, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
4543
|
+
assertGenerationOpen?.();
|
|
4544
|
+
const fresh = loadSettingsForPersistence(workspace);
|
|
4545
|
+
assertGenerationOpen?.();
|
|
4546
|
+
fresh.setValue(scope, key, value, assertGenerationOpen);
|
|
4457
4547
|
return fresh;
|
|
4458
4548
|
}), "persistSettingFn");
|
|
4459
|
-
const persistSettingsFn = /* @__PURE__ */ __name((workspace, writes) => withSettingsLock(workspace, async () => {
|
|
4460
|
-
|
|
4549
|
+
const persistSettingsFn = /* @__PURE__ */ __name((workspace, writes, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
4550
|
+
assertGenerationOpen?.();
|
|
4551
|
+
const fresh = loadSettingsForPersistence(workspace);
|
|
4461
4552
|
const writesByScope = /* @__PURE__ */ new Map();
|
|
4462
4553
|
for (const write of writes) {
|
|
4463
4554
|
writesByScope.set(
|
|
@@ -4468,10 +4559,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4468
4559
|
const committedScopes = /* @__PURE__ */ new Set();
|
|
4469
4560
|
let committed = 0;
|
|
4470
4561
|
try {
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4562
|
+
assertGenerationOpen?.();
|
|
4563
|
+
fresh.setValues(
|
|
4564
|
+
writes,
|
|
4565
|
+
(scope) => {
|
|
4566
|
+
committedScopes.add(scope);
|
|
4567
|
+
committed += writesByScope.get(scope) ?? 0;
|
|
4568
|
+
},
|
|
4569
|
+
assertGenerationOpen
|
|
4570
|
+
);
|
|
4475
4571
|
} catch (err) {
|
|
4476
4572
|
const failedWrite = writes.find((write) => !committedScopes.has(write.scope)) ?? writes[committed];
|
|
4477
4573
|
const message = `persistSettings partial failure (workspace=${workspace}, committed=${committed}/${writes.length}, failedKey=${failedWrite?.key ?? "<unknown>"}, failedScope=${failedWrite?.scope ?? "<unknown>"}): ${err instanceof Error ? err.message : String(err)}`;
|
|
@@ -4483,7 +4579,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4483
4579
|
);
|
|
4484
4580
|
}
|
|
4485
4581
|
}), "persistSettingsFn");
|
|
4486
|
-
const { createSubSessionLauncher } = await import("./create-sub-session-
|
|
4582
|
+
const { createSubSessionLauncher } = await import("./create-sub-session-ZUWDNFO2.js");
|
|
4487
4583
|
const subSessionLauncher = createSubSessionLauncher({
|
|
4488
4584
|
getBridge: /* @__PURE__ */ __name(() => bridgeRef, "getBridge"),
|
|
4489
4585
|
boundWorkspace
|
|
@@ -4502,10 +4598,17 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4502
4598
|
),
|
|
4503
4599
|
maxSessions: opts.maxSessions,
|
|
4504
4600
|
freshSessionAdmission: totalSessionAdmission.admit,
|
|
4505
|
-
sessionLifecycle:
|
|
4601
|
+
sessionLifecycle: /* @__PURE__ */ __name((event) => {
|
|
4602
|
+
if (event.type === "registered" && primaryGenerationGuard.closed) {
|
|
4603
|
+
return;
|
|
4604
|
+
}
|
|
4605
|
+
sessionOwnerIndex.handleBridgeSessionLifecycle(event);
|
|
4606
|
+
}, "sessionLifecycle"),
|
|
4506
4607
|
...opts.maxPendingPromptsPerSession !== void 0 ? { maxPendingPromptsPerSession: opts.maxPendingPromptsPerSession } : {},
|
|
4507
4608
|
...opts.eventRingSize !== void 0 ? { eventRingSize: opts.eventRingSize } : {},
|
|
4508
4609
|
...opts.compactedReplayMaxBytes !== void 0 ? { compactedReplayMaxBytes: opts.compactedReplayMaxBytes } : {},
|
|
4610
|
+
...opts.maxJournalEvents !== void 0 ? { maxJournalEvents: opts.maxJournalEvents } : {},
|
|
4611
|
+
...opts.maxJournalBytes !== void 0 ? { maxJournalBytes: opts.maxJournalBytes } : {},
|
|
4509
4612
|
...opts.channelIdleTimeoutMs !== void 0 ? { channelIdleTimeoutMs: opts.channelIdleTimeoutMs } : {},
|
|
4510
4613
|
...opts.initializeTimeoutMs !== void 0 ? { initializeTimeoutMs: opts.initializeTimeoutMs } : {},
|
|
4511
4614
|
...opts.sessionReapIntervalMs !== void 0 ? { sessionReapIntervalMs: opts.sessionReapIntervalMs } : {},
|
|
@@ -4523,8 +4626,23 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4523
4626
|
statusProvider,
|
|
4524
4627
|
fileSystem: createBridgeFileSystemAdapter(fsFactory),
|
|
4525
4628
|
persistApprovalMode: /* @__PURE__ */ __name((workspace, mode) => withSettingsLock(workspace, async () => {
|
|
4526
|
-
|
|
4527
|
-
|
|
4629
|
+
primaryGenerationGuard.assertOpen();
|
|
4630
|
+
if (!trustedWorkspace) {
|
|
4631
|
+
throw new Error(
|
|
4632
|
+
"Cannot persist approval mode for an untrusted workspace."
|
|
4633
|
+
);
|
|
4634
|
+
}
|
|
4635
|
+
const fresh = settingsRuntime.settings.loadSettings(workspace, {
|
|
4636
|
+
skipLoadEnvironment: true,
|
|
4637
|
+
workspaceTrusted: trustedWorkspace
|
|
4638
|
+
});
|
|
4639
|
+
primaryGenerationGuard.assertOpen();
|
|
4640
|
+
fresh.setValue(
|
|
4641
|
+
WORKSPACE_SETTING_SCOPE,
|
|
4642
|
+
"tools.approvalMode",
|
|
4643
|
+
mode,
|
|
4644
|
+
() => primaryGenerationGuard.assertOpen()
|
|
4645
|
+
);
|
|
4528
4646
|
}), "persistApprovalMode")
|
|
4529
4647
|
});
|
|
4530
4648
|
if (!deps.bridge) {
|
|
@@ -4536,6 +4654,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4536
4654
|
}, "invalidatePrimaryServeFeaturesCache");
|
|
4537
4655
|
const workspaceService = runtime.createDaemonWorkspaceService({
|
|
4538
4656
|
boundWorkspace,
|
|
4657
|
+
isWorkspaceTrusted: /* @__PURE__ */ __name(() => trustedWorkspace, "isWorkspaceTrusted"),
|
|
4658
|
+
assertGenerationOpen: /* @__PURE__ */ __name(() => primaryGenerationGuard.assertOpen(), "assertGenerationOpen"),
|
|
4539
4659
|
contextFilename: contextFilenameForInit ?? "QWEN.md",
|
|
4540
4660
|
statusProvider,
|
|
4541
4661
|
workspaceProvidersStatusProvider,
|
|
@@ -4548,13 +4668,18 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4548
4668
|
persistSetting: persistSettingFn,
|
|
4549
4669
|
persistSettings: persistSettingsFn,
|
|
4550
4670
|
preheatAcpChild: /* @__PURE__ */ __name(() => bridge.preheat(), "preheatAcpChild"),
|
|
4551
|
-
reloadDaemonEnv: /* @__PURE__ */ __name((workspace) => withSettingsLock(workspace, async () => {
|
|
4671
|
+
reloadDaemonEnv: /* @__PURE__ */ __name((workspace, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
4672
|
+
assertGenerationOpen?.();
|
|
4552
4673
|
const fresh = settingsRuntime.settings.loadSettings(workspace, {
|
|
4553
|
-
skipLoadEnvironment: true
|
|
4674
|
+
skipLoadEnvironment: true,
|
|
4675
|
+
skipWorkspaceSettings: !trustedWorkspace,
|
|
4676
|
+
workspaceTrusted: trustedWorkspace
|
|
4554
4677
|
});
|
|
4678
|
+
assertGenerationOpen?.();
|
|
4555
4679
|
const result = settingsRuntime.settings.reloadEnvironment(
|
|
4556
4680
|
fresh.merged,
|
|
4557
|
-
workspace
|
|
4681
|
+
workspace,
|
|
4682
|
+
trustedWorkspace
|
|
4558
4683
|
);
|
|
4559
4684
|
let refreshedRuntimeEnv;
|
|
4560
4685
|
let fallbackReason;
|
|
@@ -4562,7 +4687,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4562
4687
|
refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
|
|
4563
4688
|
fresh.merged,
|
|
4564
4689
|
workspace,
|
|
4565
|
-
daemonRuntimeBaseEnv
|
|
4690
|
+
daemonRuntimeBaseEnv,
|
|
4691
|
+
trustedWorkspace
|
|
4566
4692
|
);
|
|
4567
4693
|
} catch (err) {
|
|
4568
4694
|
fallbackReason = err instanceof Error ? err.message : String(err);
|
|
@@ -4630,14 +4756,17 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4630
4756
|
bridge,
|
|
4631
4757
|
workspaceService,
|
|
4632
4758
|
routeFileSystemFactory: routeFsFactory,
|
|
4633
|
-
clientMcpSenderRegistry
|
|
4759
|
+
clientMcpSenderRegistry,
|
|
4760
|
+
generationGuard: primaryGenerationGuard,
|
|
4761
|
+
trustMaterialization: primaryTrustMaterialization
|
|
4634
4762
|
}
|
|
4635
4763
|
];
|
|
4636
|
-
const createRuntimeEnvMetadata = /* @__PURE__ */ __name((workspace, settings) => {
|
|
4764
|
+
const createRuntimeEnvMetadata = /* @__PURE__ */ __name((workspace, settings, trusted) => {
|
|
4637
4765
|
const snapshot = settings ? settingsRuntime.environment.buildRuntimeEnvironment(
|
|
4638
4766
|
settings.merged,
|
|
4639
4767
|
workspace,
|
|
4640
|
-
daemonRuntimeBaseEnv
|
|
4768
|
+
daemonRuntimeBaseEnv,
|
|
4769
|
+
trusted
|
|
4641
4770
|
) : {
|
|
4642
4771
|
effectiveEnv: { ...daemonRuntimeBaseEnv },
|
|
4643
4772
|
overlayKeys: Object.freeze([]),
|
|
@@ -4667,27 +4796,33 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4667
4796
|
};
|
|
4668
4797
|
}, "createRuntimeEnvMetadata");
|
|
4669
4798
|
const subSessionStoppers = [];
|
|
4670
|
-
const
|
|
4799
|
+
const subSessionStoppersByRuntime = /* @__PURE__ */ new WeakMap();
|
|
4671
4800
|
const runtimeCleanupPromises = /* @__PURE__ */ new WeakMap();
|
|
4672
4801
|
const removeArrayValue = /* @__PURE__ */ __name((values, value) => {
|
|
4673
4802
|
const index = values.indexOf(value);
|
|
4674
4803
|
if (index >= 0) values.splice(index, 1);
|
|
4675
4804
|
}, "removeArrayValue");
|
|
4676
4805
|
for (const workspaceInput of workspaceInputs.slice(1)) {
|
|
4806
|
+
const secondaryDecision = trustPolicy.evaluateDaemonWorkspaceTrust(
|
|
4807
|
+
bootTrustSnapshot,
|
|
4808
|
+
workspaceInput.cwd
|
|
4809
|
+
);
|
|
4810
|
+
const secondaryTrusted = secondaryDecision.targetTrusted;
|
|
4677
4811
|
let secondarySettings;
|
|
4678
4812
|
try {
|
|
4679
4813
|
secondarySettings = settingsRuntime.settings.loadSettings(
|
|
4680
|
-
workspaceInput.cwd
|
|
4814
|
+
workspaceInput.cwd,
|
|
4815
|
+
{
|
|
4816
|
+
skipLoadEnvironment: true,
|
|
4817
|
+
skipWorkspaceSettings: !secondaryTrusted,
|
|
4818
|
+
workspaceTrusted: secondaryTrusted
|
|
4819
|
+
}
|
|
4681
4820
|
);
|
|
4682
4821
|
} catch (err) {
|
|
4683
4822
|
writeStderrLine(
|
|
4684
4823
|
`qwen serve: could not read full settings for secondary workspace ${workspaceInput.cwd} (${err instanceof Error ? err.message : String(err)}); falling back to defaults.`
|
|
4685
4824
|
);
|
|
4686
4825
|
}
|
|
4687
|
-
const secondaryTrusted = secondarySettings ? settingsRuntime.trustedFolders.getWorkspaceTrustStatus(
|
|
4688
|
-
secondarySettings.merged,
|
|
4689
|
-
workspaceInput.cwd
|
|
4690
|
-
).effective.state === "trusted" : false;
|
|
4691
4826
|
if (!secondaryTrusted) {
|
|
4692
4827
|
daemonLog.warn("secondary workspace is not trusted", {
|
|
4693
4828
|
workspace: workspaceInput.cwd,
|
|
@@ -4696,11 +4831,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4696
4831
|
}
|
|
4697
4832
|
const secondaryEnv = createRuntimeEnvMetadata(
|
|
4698
4833
|
workspaceInput.cwd,
|
|
4699
|
-
secondarySettings
|
|
4834
|
+
secondarySettings,
|
|
4835
|
+
secondaryTrusted
|
|
4700
4836
|
);
|
|
4837
|
+
const secondaryCustomIgnoreFiles = secondarySettings?.merged.context?.fileFiltering?.customIgnoreFiles;
|
|
4838
|
+
const secondaryContextFilename = extractContextFilename(secondarySettings?.merged.context?.fileName) ?? contextFilenameForInit ?? "QWEN.md";
|
|
4701
4839
|
const secondaryWorkspaceHash = core.hashDaemonWorkspace(
|
|
4702
4840
|
workspaceInput.cwd
|
|
4703
4841
|
);
|
|
4842
|
+
const secondaryGenerationGuard = runtime.createWorkspaceGenerationGuard();
|
|
4704
4843
|
const secondaryStatusProvider = runtime.createDaemonStatusProvider({
|
|
4705
4844
|
env: secondaryEnv.effectiveEnv
|
|
4706
4845
|
});
|
|
@@ -4709,9 +4848,11 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4709
4848
|
trusted: secondaryTrusted,
|
|
4710
4849
|
emit: deps.fsAuditEmit,
|
|
4711
4850
|
pathLocks: sharedPathLocks,
|
|
4712
|
-
|
|
4851
|
+
generationGuard: secondaryGenerationGuard,
|
|
4852
|
+
...secondaryCustomIgnoreFiles !== void 0 ? { customIgnoreFiles: secondaryCustomIgnoreFiles } : {}
|
|
4713
4853
|
});
|
|
4714
4854
|
const secondaryChannelFactory = runtime.createSpawnChannelFactory({
|
|
4855
|
+
processRegistry,
|
|
4715
4856
|
sourceEnv: secondaryEnv.effectiveEnv,
|
|
4716
4857
|
onDiagnosticLine: diagnosticSink,
|
|
4717
4858
|
pipeHooks: {
|
|
@@ -4743,10 +4884,17 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4743
4884
|
),
|
|
4744
4885
|
maxSessions: opts.maxSessions,
|
|
4745
4886
|
freshSessionAdmission: totalSessionAdmission.admit,
|
|
4746
|
-
sessionLifecycle:
|
|
4887
|
+
sessionLifecycle: /* @__PURE__ */ __name((event) => {
|
|
4888
|
+
if (event.type === "registered" && secondaryGenerationGuard.closed) {
|
|
4889
|
+
return;
|
|
4890
|
+
}
|
|
4891
|
+
sessionOwnerIndex.handleBridgeSessionLifecycle(event);
|
|
4892
|
+
}, "sessionLifecycle"),
|
|
4747
4893
|
...opts.maxPendingPromptsPerSession !== void 0 ? { maxPendingPromptsPerSession: opts.maxPendingPromptsPerSession } : {},
|
|
4748
4894
|
...opts.eventRingSize !== void 0 ? { eventRingSize: opts.eventRingSize } : {},
|
|
4749
4895
|
...opts.compactedReplayMaxBytes !== void 0 ? { compactedReplayMaxBytes: opts.compactedReplayMaxBytes } : {},
|
|
4896
|
+
...opts.maxJournalEvents !== void 0 ? { maxJournalEvents: opts.maxJournalEvents } : {},
|
|
4897
|
+
...opts.maxJournalBytes !== void 0 ? { maxJournalBytes: opts.maxJournalBytes } : {},
|
|
4750
4898
|
...opts.channelIdleTimeoutMs !== void 0 ? { channelIdleTimeoutMs: opts.channelIdleTimeoutMs } : {},
|
|
4751
4899
|
...opts.initializeTimeoutMs !== void 0 ? { initializeTimeoutMs: opts.initializeTimeoutMs } : {},
|
|
4752
4900
|
...opts.sessionReapIntervalMs !== void 0 ? { sessionReapIntervalMs: opts.sessionReapIntervalMs } : {},
|
|
@@ -4766,26 +4914,42 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4766
4914
|
statusProvider: secondaryStatusProvider,
|
|
4767
4915
|
fileSystem: createBridgeFileSystemAdapter(secondaryBridgeFsFactory),
|
|
4768
4916
|
persistApprovalMode: /* @__PURE__ */ __name((workspace, mode) => withSettingsLock(workspace, async () => {
|
|
4769
|
-
|
|
4770
|
-
|
|
4917
|
+
secondaryGenerationGuard.assertOpen();
|
|
4918
|
+
if (!secondaryTrusted) {
|
|
4919
|
+
throw new Error(
|
|
4920
|
+
"Cannot persist approval mode for an untrusted workspace."
|
|
4921
|
+
);
|
|
4922
|
+
}
|
|
4923
|
+
const fresh = settingsRuntime.settings.loadSettings(workspace, {
|
|
4924
|
+
skipLoadEnvironment: true,
|
|
4925
|
+
workspaceTrusted: secondaryTrusted
|
|
4926
|
+
});
|
|
4927
|
+
secondaryGenerationGuard.assertOpen();
|
|
4928
|
+
fresh.setValue(
|
|
4929
|
+
WORKSPACE_SETTING_SCOPE,
|
|
4930
|
+
"tools.approvalMode",
|
|
4931
|
+
mode,
|
|
4932
|
+
() => secondaryGenerationGuard.assertOpen()
|
|
4933
|
+
);
|
|
4771
4934
|
}), "persistApprovalMode")
|
|
4772
4935
|
});
|
|
4773
4936
|
secondaryBridgeRef = secondaryBridge;
|
|
4774
4937
|
runtimeBridges.push(secondaryBridge);
|
|
4775
4938
|
internalRuntimeBridgesForCleanup.push(secondaryBridge);
|
|
4776
4939
|
subSessionStoppers.push(secondarySubSessionLauncher.stop);
|
|
4777
|
-
subSessionStoppersByWorkspace.set(
|
|
4778
|
-
workspaceInput.cwd,
|
|
4779
|
-
secondarySubSessionLauncher.stop
|
|
4780
|
-
);
|
|
4781
4940
|
const secondaryWorkspaceService = runtime.createDaemonWorkspaceService({
|
|
4782
4941
|
boundWorkspace: workspaceInput.cwd,
|
|
4783
|
-
|
|
4942
|
+
isWorkspaceTrusted: /* @__PURE__ */ __name(() => secondaryTrusted, "isWorkspaceTrusted"),
|
|
4943
|
+
assertGenerationOpen: /* @__PURE__ */ __name(() => secondaryGenerationGuard.assertOpen(), "assertGenerationOpen"),
|
|
4944
|
+
contextFilename: secondaryContextFilename,
|
|
4784
4945
|
statusProvider: secondaryStatusProvider,
|
|
4785
4946
|
workspaceProvidersStatusProvider: runtime.createWorkspaceProvidersStatusProvider({
|
|
4786
|
-
env: secondaryEnv.effectiveEnv
|
|
4947
|
+
env: secondaryEnv.effectiveEnv,
|
|
4948
|
+
workspaceTrusted: secondaryTrusted
|
|
4949
|
+
}),
|
|
4950
|
+
workspaceSkillsStatusProvider: runtime.createWorkspaceSkillsStatusProvider({
|
|
4951
|
+
workspaceTrusted: secondaryTrusted
|
|
4787
4952
|
}),
|
|
4788
|
-
workspaceSkillsStatusProvider: runtime.createWorkspaceSkillsStatusProvider(),
|
|
4789
4953
|
skillInstallEnv: secondaryEnv.effectiveEnv,
|
|
4790
4954
|
voiceEnv: secondaryEnv.effectiveEnv,
|
|
4791
4955
|
voiceSettingsScope: WORKSPACE_SETTING_SCOPE,
|
|
@@ -4795,19 +4959,25 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4795
4959
|
persistDisabledSkills: persistDisabledSkillsFn,
|
|
4796
4960
|
persistSetting: persistSettingFn,
|
|
4797
4961
|
persistSettings: persistSettingsFn,
|
|
4798
|
-
reloadDaemonEnv: /* @__PURE__ */ __name((workspace) => withSettingsLock(workspace, async () => {
|
|
4962
|
+
reloadDaemonEnv: /* @__PURE__ */ __name((workspace, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
4963
|
+
assertGenerationOpen?.();
|
|
4799
4964
|
const fresh = settingsRuntime.settings.loadSettings(workspace, {
|
|
4800
|
-
skipLoadEnvironment: true
|
|
4965
|
+
skipLoadEnvironment: true,
|
|
4966
|
+
skipWorkspaceSettings: !secondaryTrusted,
|
|
4967
|
+
workspaceTrusted: secondaryTrusted
|
|
4801
4968
|
});
|
|
4969
|
+
assertGenerationOpen?.();
|
|
4802
4970
|
const result = settingsRuntime.settings.reloadEnvironment(
|
|
4803
4971
|
fresh.merged,
|
|
4804
|
-
workspace
|
|
4972
|
+
workspace,
|
|
4973
|
+
secondaryTrusted
|
|
4805
4974
|
);
|
|
4806
4975
|
try {
|
|
4807
4976
|
const refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
|
|
4808
4977
|
fresh.merged,
|
|
4809
4978
|
workspace,
|
|
4810
|
-
daemonRuntimeBaseEnv
|
|
4979
|
+
daemonRuntimeBaseEnv,
|
|
4980
|
+
secondaryTrusted
|
|
4811
4981
|
);
|
|
4812
4982
|
logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
|
|
4813
4983
|
secondaryEnv.replace(refreshedRuntimeEnv.effectiveEnv);
|
|
@@ -4845,7 +5015,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4845
5015
|
refreshExtensionsForAllSessions: /* @__PURE__ */ __name(() => secondaryBridge.refreshExtensionsForAllSessions(), "refreshExtensionsForAllSessions"),
|
|
4846
5016
|
publishWorkspaceEvent: /* @__PURE__ */ __name((event) => secondaryBridge.publishWorkspaceEvent(event), "publishWorkspaceEvent")
|
|
4847
5017
|
});
|
|
4848
|
-
|
|
5018
|
+
const secondaryRuntime = {
|
|
4849
5019
|
workspaceId: secondaryWorkspaceHash,
|
|
4850
5020
|
workspaceCwd: workspaceInput.cwd,
|
|
4851
5021
|
...workspaceInput.displayName ? { displayName: workspaceInput.displayName } : {},
|
|
@@ -4857,12 +5027,24 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4857
5027
|
bridge: secondaryBridge,
|
|
4858
5028
|
workspaceService: secondaryWorkspaceService,
|
|
4859
5029
|
routeFileSystemFactory: secondaryBridgeFsFactory,
|
|
4860
|
-
clientMcpSenderRegistry: secondaryClientMcpSenderRegistry
|
|
4861
|
-
|
|
5030
|
+
clientMcpSenderRegistry: secondaryClientMcpSenderRegistry,
|
|
5031
|
+
generationGuard: secondaryGenerationGuard,
|
|
5032
|
+
trustMaterialization: JSON.stringify({
|
|
5033
|
+
trusted: secondaryTrusted,
|
|
5034
|
+
boundWorkspaces: [workspaceInput.cwd]
|
|
5035
|
+
})
|
|
5036
|
+
};
|
|
5037
|
+
subSessionStoppersByRuntime.set(
|
|
5038
|
+
secondaryRuntime,
|
|
5039
|
+
secondarySubSessionLauncher.stop
|
|
5040
|
+
);
|
|
5041
|
+
workspaceRuntimes.push(secondaryRuntime);
|
|
4862
5042
|
}
|
|
4863
5043
|
const workspaceRegistry = runtime.createWorkspaceRegistry(workspaceRuntimes, {
|
|
4864
|
-
sessionOwnerIndex
|
|
5044
|
+
sessionOwnerIndex,
|
|
5045
|
+
scanUnindexedOwners: deps.bridge !== void 0
|
|
4865
5046
|
});
|
|
5047
|
+
workspaceRegistryForPersistence.current = workspaceRegistry;
|
|
4866
5048
|
const workspaceVoiceCoordinator = new WorkspaceVoiceCoordinator();
|
|
4867
5049
|
core.registerDaemonGaugeCallbacks({
|
|
4868
5050
|
sessionCount: /* @__PURE__ */ __name(() => workspaceRegistry.list().reduce((sum, item) => sum + item.bridge.sessionCount, 0), "sessionCount"),
|
|
@@ -4897,9 +5079,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4897
5079
|
const rejectedTotal = hits ? hits.prompt + hits.mutation + hits.read : 0;
|
|
4898
5080
|
const rateLimitRejected = prevRateRejected === void 0 ? 0 : Math.max(0, rejectedTotal - prevRateRejected);
|
|
4899
5081
|
prevRateRejected = rejectedTotal;
|
|
4900
|
-
const
|
|
5082
|
+
const primaryEntry = workspaceRegistry.primaryEntry;
|
|
5083
|
+
const primaryRuntimeBridge = primaryEntry.state === "active" ? primaryEntry.current?.runtime.bridge : void 0;
|
|
5084
|
+
const child = primaryRuntimeBridge?.getChildResourceSnapshot?.();
|
|
4901
5085
|
if (runtime.getActiveSseCount() > 0 || (acp?.wsStreams ?? 0) > 0) {
|
|
4902
|
-
void
|
|
5086
|
+
void primaryRuntimeBridge?.refreshChildResource?.().catch((err) => {
|
|
5087
|
+
daemonLog.warn(
|
|
5088
|
+
`ACP child resource refresh failed: ${err instanceof Error ? err.message : String(err)}`
|
|
5089
|
+
);
|
|
5090
|
+
});
|
|
4903
5091
|
}
|
|
4904
5092
|
metricsRing.sample(nowMs, {
|
|
4905
5093
|
cpuPercent,
|
|
@@ -4955,34 +5143,52 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
4955
5143
|
metricsLoopDelay.disable();
|
|
4956
5144
|
}
|
|
4957
5145
|
};
|
|
4958
|
-
const createDynamicWorkspaceRuntime = /* @__PURE__ */ __name(async (cwd,
|
|
4959
|
-
|
|
5146
|
+
const createDynamicWorkspaceRuntime = /* @__PURE__ */ __name(async (cwd, buildOptions) => {
|
|
5147
|
+
const provenance = buildOptions?.provenance ?? "existing";
|
|
5148
|
+
if (provenance === "managed-scratch" && (!managedScratchRoot || !isManagedScratchChild(cwd, managedScratchRoot.canonicalRoot))) {
|
|
4960
5149
|
throw new Error(
|
|
4961
5150
|
"Managed scratch runtime must use an accepted direct child directory"
|
|
4962
5151
|
);
|
|
4963
5152
|
}
|
|
5153
|
+
const snapshot = buildOptions?.snapshot ?? await trustPolicy.readDaemonTrustPolicySnapshot();
|
|
5154
|
+
const decision = buildOptions?.decision ?? trustPolicy.evaluateDaemonWorkspaceTrust(snapshot, cwd);
|
|
5155
|
+
const trusted = provenance === "managed-scratch" ? true : buildOptions?.trusted ?? decision.targetTrusted;
|
|
4964
5156
|
let wsSettings;
|
|
4965
5157
|
try {
|
|
4966
|
-
wsSettings = settingsRuntime.settings.loadSettings(cwd
|
|
5158
|
+
wsSettings = settingsRuntime.settings.loadSettings(cwd, {
|
|
5159
|
+
skipLoadEnvironment: true,
|
|
5160
|
+
skipWorkspaceSettings: !trusted,
|
|
5161
|
+
workspaceTrusted: trusted
|
|
5162
|
+
});
|
|
4967
5163
|
} catch (err) {
|
|
4968
5164
|
writeStderrLine(
|
|
4969
5165
|
`qwen serve: could not read full settings for dynamic workspace ${cwd} (${err instanceof Error ? err.message : String(err)}); falling back to defaults.`
|
|
4970
5166
|
);
|
|
4971
5167
|
}
|
|
4972
|
-
const
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
).effective.state === "trusted" : false);
|
|
4976
|
-
const wsEnv = createRuntimeEnvMetadata(cwd, wsSettings);
|
|
5168
|
+
const wsEnv = createRuntimeEnvMetadata(cwd, wsSettings, trusted);
|
|
5169
|
+
const wsCustomIgnoreFiles = wsSettings?.merged.context?.fileFiltering?.customIgnoreFiles;
|
|
5170
|
+
const wsContextFilename = extractContextFilename(wsSettings?.merged.context?.fileName) ?? contextFilenameForInit ?? "QWEN.md";
|
|
4977
5171
|
const wsHash = core.hashDaemonWorkspace(cwd);
|
|
5172
|
+
const generationGuard = buildOptions?.generationGuard ?? runtime.createWorkspaceGenerationGuard();
|
|
5173
|
+
const runtimeBoundWorkspaces = buildOptions?.boundWorkspaces ?? [cwd];
|
|
4978
5174
|
const wsFsFactory = runtime.resolveBridgeFsFactory({
|
|
4979
|
-
boundWorkspaces:
|
|
5175
|
+
boundWorkspaces: runtimeBoundWorkspaces,
|
|
4980
5176
|
trusted,
|
|
4981
5177
|
emit: deps.fsAuditEmit,
|
|
4982
5178
|
pathLocks: sharedPathLocks,
|
|
4983
|
-
|
|
5179
|
+
generationGuard,
|
|
5180
|
+
...wsCustomIgnoreFiles !== void 0 ? { customIgnoreFiles: wsCustomIgnoreFiles } : {}
|
|
4984
5181
|
});
|
|
5182
|
+
const wsRouteFsFactory = buildOptions?.primary === true && runtimeBoundWorkspaces.length > 1 ? runtime.resolveBridgeFsFactory({
|
|
5183
|
+
boundWorkspaces: [cwd],
|
|
5184
|
+
trusted,
|
|
5185
|
+
emit: deps.fsAuditEmit,
|
|
5186
|
+
pathLocks: sharedPathLocks,
|
|
5187
|
+
generationGuard,
|
|
5188
|
+
...wsCustomIgnoreFiles !== void 0 ? { customIgnoreFiles: wsCustomIgnoreFiles } : {}
|
|
5189
|
+
}) : wsFsFactory;
|
|
4985
5190
|
const wsChannelFactory = runtime.createSpawnChannelFactory({
|
|
5191
|
+
processRegistry,
|
|
4986
5192
|
sourceEnv: wsEnv.effectiveEnv,
|
|
4987
5193
|
onDiagnosticLine: diagnosticSink,
|
|
4988
5194
|
pipeHooks: {
|
|
@@ -5016,10 +5222,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5016
5222
|
),
|
|
5017
5223
|
maxSessions: opts.maxSessions,
|
|
5018
5224
|
freshSessionAdmission: totalSessionAdmission.admit,
|
|
5019
|
-
sessionLifecycle:
|
|
5225
|
+
sessionLifecycle: /* @__PURE__ */ __name((event) => {
|
|
5226
|
+
if (event.type === "registered" && generationGuard.closed) return;
|
|
5227
|
+
sessionOwnerIndex.handleBridgeSessionLifecycle(event);
|
|
5228
|
+
}, "sessionLifecycle"),
|
|
5020
5229
|
...opts.maxPendingPromptsPerSession !== void 0 ? { maxPendingPromptsPerSession: opts.maxPendingPromptsPerSession } : {},
|
|
5021
5230
|
...opts.eventRingSize !== void 0 ? { eventRingSize: opts.eventRingSize } : {},
|
|
5022
5231
|
...opts.compactedReplayMaxBytes !== void 0 ? { compactedReplayMaxBytes: opts.compactedReplayMaxBytes } : {},
|
|
5232
|
+
...opts.maxJournalEvents !== void 0 ? { maxJournalEvents: opts.maxJournalEvents } : {},
|
|
5233
|
+
...opts.maxJournalBytes !== void 0 ? { maxJournalBytes: opts.maxJournalBytes } : {},
|
|
5023
5234
|
...opts.channelIdleTimeoutMs !== void 0 ? { channelIdleTimeoutMs: opts.channelIdleTimeoutMs } : {},
|
|
5024
5235
|
...opts.initializeTimeoutMs !== void 0 ? { initializeTimeoutMs: opts.initializeTimeoutMs } : {},
|
|
5025
5236
|
...opts.sessionReapIntervalMs !== void 0 ? { sessionReapIntervalMs: opts.sessionReapIntervalMs } : {},
|
|
@@ -5032,18 +5243,31 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5032
5243
|
onDiagnosticLine: diagnosticSink,
|
|
5033
5244
|
telemetry: createRuntimeBridgeTelemetry(wsHash),
|
|
5034
5245
|
...permissionPolicy !== void 0 ? { permissionPolicy } : {},
|
|
5035
|
-
...permissionConsensusQuorum !== void 0 ? {
|
|
5246
|
+
...permissionConsensusQuorum !== void 0 ? {
|
|
5247
|
+
permissionConsensusQuorum
|
|
5248
|
+
} : {},
|
|
5036
5249
|
permissionAudit: permissionAuditPublisher,
|
|
5037
5250
|
statusProvider: runtime.createDaemonStatusProvider({
|
|
5038
5251
|
env: wsEnv.effectiveEnv
|
|
5039
5252
|
}),
|
|
5040
5253
|
fileSystem: createBridgeFileSystemAdapter(wsFsFactory),
|
|
5041
5254
|
persistApprovalMode: /* @__PURE__ */ __name((workspace, mode) => withSettingsLock(workspace, async () => {
|
|
5042
|
-
|
|
5255
|
+
generationGuard.assertOpen();
|
|
5256
|
+
if (!trusted) {
|
|
5257
|
+
throw new Error(
|
|
5258
|
+
"Cannot persist approval mode for an untrusted workspace."
|
|
5259
|
+
);
|
|
5260
|
+
}
|
|
5261
|
+
const fresh = settingsRuntime.settings.loadSettings(workspace, {
|
|
5262
|
+
skipLoadEnvironment: true,
|
|
5263
|
+
workspaceTrusted: trusted
|
|
5264
|
+
});
|
|
5265
|
+
generationGuard.assertOpen();
|
|
5043
5266
|
fresh.setValue(
|
|
5044
5267
|
WORKSPACE_SETTING_SCOPE,
|
|
5045
5268
|
"tools.approvalMode",
|
|
5046
|
-
mode
|
|
5269
|
+
mode,
|
|
5270
|
+
() => generationGuard.assertOpen()
|
|
5047
5271
|
);
|
|
5048
5272
|
}), "persistApprovalMode")
|
|
5049
5273
|
});
|
|
@@ -5056,36 +5280,47 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5056
5280
|
try {
|
|
5057
5281
|
wsService = runtime.createDaemonWorkspaceService({
|
|
5058
5282
|
boundWorkspace: cwd,
|
|
5059
|
-
|
|
5283
|
+
isWorkspaceTrusted: /* @__PURE__ */ __name(() => trusted, "isWorkspaceTrusted"),
|
|
5284
|
+
assertGenerationOpen: /* @__PURE__ */ __name(() => generationGuard.assertOpen(), "assertGenerationOpen"),
|
|
5285
|
+
contextFilename: wsContextFilename,
|
|
5060
5286
|
statusProvider: runtime.createDaemonStatusProvider({
|
|
5061
5287
|
env: wsEnv.effectiveEnv
|
|
5062
5288
|
}),
|
|
5063
5289
|
workspaceProvidersStatusProvider: runtime.createWorkspaceProvidersStatusProvider({
|
|
5064
|
-
env: wsEnv.effectiveEnv
|
|
5290
|
+
env: wsEnv.effectiveEnv,
|
|
5291
|
+
workspaceTrusted: trusted
|
|
5292
|
+
}),
|
|
5293
|
+
workspaceSkillsStatusProvider: runtime.createWorkspaceSkillsStatusProvider({
|
|
5294
|
+
workspaceTrusted: trusted
|
|
5065
5295
|
}),
|
|
5066
|
-
workspaceSkillsStatusProvider: runtime.createWorkspaceSkillsStatusProvider(),
|
|
5067
5296
|
skillInstallEnv: wsEnv.effectiveEnv,
|
|
5068
5297
|
voiceEnv: wsEnv.effectiveEnv,
|
|
5069
|
-
voiceSettingsScope: WORKSPACE_SETTING_SCOPE,
|
|
5298
|
+
...buildOptions?.primary === true ? {} : { voiceSettingsScope: WORKSPACE_SETTING_SCOPE },
|
|
5070
5299
|
isChannelLive: /* @__PURE__ */ __name(() => wsBridge.isChannelLive(), "isChannelLive"),
|
|
5071
5300
|
preheatAcpChild: /* @__PURE__ */ __name(() => wsBridge.preheat(), "preheatAcpChild"),
|
|
5072
5301
|
persistDisabledTools: persistDisabledToolsFn,
|
|
5073
5302
|
persistDisabledSkills: persistDisabledSkillsFn,
|
|
5074
5303
|
persistSetting: persistSettingFn,
|
|
5075
5304
|
persistSettings: persistSettingsFn,
|
|
5076
|
-
reloadDaemonEnv: /* @__PURE__ */ __name((workspace) => withSettingsLock(workspace, async () => {
|
|
5305
|
+
reloadDaemonEnv: /* @__PURE__ */ __name((workspace, assertGenerationOpen) => withSettingsLock(workspace, async () => {
|
|
5306
|
+
assertGenerationOpen?.();
|
|
5077
5307
|
const fresh = settingsRuntime.settings.loadSettings(workspace, {
|
|
5078
|
-
skipLoadEnvironment: true
|
|
5308
|
+
skipLoadEnvironment: true,
|
|
5309
|
+
skipWorkspaceSettings: !trusted,
|
|
5310
|
+
workspaceTrusted: trusted
|
|
5079
5311
|
});
|
|
5312
|
+
assertGenerationOpen?.();
|
|
5080
5313
|
const result = settingsRuntime.settings.reloadEnvironment(
|
|
5081
5314
|
fresh.merged,
|
|
5082
|
-
workspace
|
|
5315
|
+
workspace,
|
|
5316
|
+
trusted
|
|
5083
5317
|
);
|
|
5084
5318
|
try {
|
|
5085
5319
|
const refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
|
|
5086
5320
|
fresh.merged,
|
|
5087
5321
|
workspace,
|
|
5088
|
-
daemonRuntimeBaseEnv
|
|
5322
|
+
daemonRuntimeBaseEnv,
|
|
5323
|
+
trusted
|
|
5089
5324
|
);
|
|
5090
5325
|
logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
|
|
5091
5326
|
wsEnv.replace(refreshedRuntimeEnv.effectiveEnv);
|
|
@@ -5121,7 +5356,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5121
5356
|
queryWorkspaceStatus: /* @__PURE__ */ __name((method, idle) => wsBridge.queryWorkspaceStatus(method, idle), "queryWorkspaceStatus"),
|
|
5122
5357
|
invokeWorkspaceCommand: /* @__PURE__ */ __name((method, params, invokeOpts) => wsBridge.invokeWorkspaceCommand(method, params, invokeOpts), "invokeWorkspaceCommand"),
|
|
5123
5358
|
refreshExtensionsForAllSessions: /* @__PURE__ */ __name(() => wsBridge.refreshExtensionsForAllSessions(), "refreshExtensionsForAllSessions"),
|
|
5124
|
-
publishWorkspaceEvent: /* @__PURE__ */ __name((event) =>
|
|
5359
|
+
publishWorkspaceEvent: /* @__PURE__ */ __name((event) => {
|
|
5360
|
+
if (buildOptions?.primary === true && (event.type === "settings_changed" || event.type === "settings_reloaded")) {
|
|
5361
|
+
invalidatePrimaryServeFeaturesCache();
|
|
5362
|
+
}
|
|
5363
|
+
wsBridge.publishWorkspaceEvent(event);
|
|
5364
|
+
}, "publishWorkspaceEvent")
|
|
5125
5365
|
});
|
|
5126
5366
|
} catch (err) {
|
|
5127
5367
|
wsSubSessionLauncher.stop();
|
|
@@ -5136,31 +5376,75 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5136
5376
|
runtimeBridges.push(wsBridge);
|
|
5137
5377
|
internalRuntimeBridgesForCleanup.push(wsBridge);
|
|
5138
5378
|
subSessionStoppers.push(wsSubSessionLauncher.stop);
|
|
5139
|
-
|
|
5140
|
-
return {
|
|
5379
|
+
const wsRuntime = {
|
|
5141
5380
|
workspaceId: wsHash,
|
|
5142
5381
|
workspaceCwd: cwd,
|
|
5143
|
-
|
|
5382
|
+
...buildOptions?.displayName !== void 0 ? { displayName: buildOptions.displayName } : {},
|
|
5383
|
+
primary: buildOptions?.primary ?? false,
|
|
5144
5384
|
trusted,
|
|
5145
|
-
|
|
5146
|
-
|
|
5385
|
+
provenance,
|
|
5386
|
+
removable: buildOptions?.removable ?? true,
|
|
5387
|
+
registrationIds: [...buildOptions?.registrationIds ?? []],
|
|
5147
5388
|
env: wsEnv.metadata,
|
|
5148
5389
|
bridge: wsBridge,
|
|
5149
5390
|
workspaceService: wsService,
|
|
5150
|
-
routeFileSystemFactory:
|
|
5151
|
-
clientMcpSenderRegistry: wsClientMcpRegistry
|
|
5391
|
+
routeFileSystemFactory: wsRouteFsFactory,
|
|
5392
|
+
clientMcpSenderRegistry: wsClientMcpRegistry,
|
|
5393
|
+
generationGuard,
|
|
5394
|
+
trustMaterialization: buildOptions?.trustMaterialization ?? JSON.stringify({
|
|
5395
|
+
trusted,
|
|
5396
|
+
boundWorkspaces: [...runtimeBoundWorkspaces].sort()
|
|
5397
|
+
})
|
|
5152
5398
|
};
|
|
5399
|
+
subSessionStoppersByRuntime.set(wsRuntime, wsSubSessionLauncher.stop);
|
|
5400
|
+
if (provenance !== "managed-scratch" && !buildOptions?.snapshot) {
|
|
5401
|
+
const latest = await trustPolicy.readDaemonTrustPolicySnapshot();
|
|
5402
|
+
if (latest.revision !== snapshot.revision) {
|
|
5403
|
+
generationGuard.close();
|
|
5404
|
+
wsSubSessionLauncher.stop();
|
|
5405
|
+
await wsBridge.shutdown({ reason: "trust_reconfigured" }).catch(() => {
|
|
5406
|
+
try {
|
|
5407
|
+
wsBridge.killAllSync();
|
|
5408
|
+
} catch {
|
|
5409
|
+
}
|
|
5410
|
+
});
|
|
5411
|
+
subSessionStoppersByRuntime.delete(wsRuntime);
|
|
5412
|
+
removeArrayValue(subSessionStoppers, wsSubSessionLauncher.stop);
|
|
5413
|
+
removeArrayValue(runtimeBridges, wsBridge);
|
|
5414
|
+
removeArrayValue(internalRuntimeBridgesForCleanup, wsBridge);
|
|
5415
|
+
if ((buildOptions?.validationAttempt ?? 0) >= 2) {
|
|
5416
|
+
throw new Error(
|
|
5417
|
+
"Workspace trust policy kept changing during runtime creation."
|
|
5418
|
+
);
|
|
5419
|
+
}
|
|
5420
|
+
const { generationGuard: _staleGuard, ...retryOptions } = buildOptions ?? {};
|
|
5421
|
+
return createDynamicWorkspaceRuntime(cwd, {
|
|
5422
|
+
...retryOptions,
|
|
5423
|
+
validationAttempt: (buildOptions?.validationAttempt ?? 0) + 1
|
|
5424
|
+
});
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
return wsRuntime;
|
|
5153
5428
|
}, "createDynamicWorkspaceRuntime");
|
|
5429
|
+
const serveAppForRuntimeLifecycle = { current: void 0 };
|
|
5154
5430
|
const workspaceRuntimeRemoval = {
|
|
5155
5431
|
async runtimeAdded(runtimeAdded) {
|
|
5156
|
-
|
|
5432
|
+
channelWebhookEnvByWorkspace.set(
|
|
5433
|
+
runtimeAdded.workspaceCwd,
|
|
5434
|
+
workspaceRuntimeEffectiveEnv(runtimeAdded, daemonRuntimeBaseEnv)
|
|
5435
|
+
);
|
|
5436
|
+
channelWebhookConfigVersion += 1;
|
|
5437
|
+
refreshChannelWebhookConfigs?.();
|
|
5438
|
+
const app3 = serveAppForRuntimeLifecycle.current ?? runtimeApp ?? runtimeAppForCleanup;
|
|
5157
5439
|
const startScheduledTaskKeepaliveForWorkspace = app3?.locals?.["startScheduledTaskKeepaliveForWorkspace"];
|
|
5158
5440
|
startScheduledTaskKeepaliveForWorkspace?.(runtimeAdded);
|
|
5159
5441
|
if (!channelWorkerManager) return;
|
|
5160
5442
|
try {
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5443
|
+
if (runtimeAdded.trusted) {
|
|
5444
|
+
await channelWorkerManager.restoreWorkspace(
|
|
5445
|
+
runtimeAdded.workspaceCwd
|
|
5446
|
+
);
|
|
5447
|
+
}
|
|
5164
5448
|
await channelWorkerManager.refreshWorkspaces();
|
|
5165
5449
|
} catch (err) {
|
|
5166
5450
|
daemonLog.error(
|
|
@@ -5172,14 +5456,51 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5172
5456
|
}
|
|
5173
5457
|
},
|
|
5174
5458
|
beginDrain(runtimeToDrain) {
|
|
5459
|
+
if (runtimeToDrain.primary) {
|
|
5460
|
+
if (bridgeRef === runtimeToDrain.bridge) bridgeRef = void 0;
|
|
5461
|
+
invalidatePrimaryServeFeaturesCache();
|
|
5462
|
+
}
|
|
5175
5463
|
totalSessionAdmission.beginWorkspaceDrain(runtimeToDrain.workspaceCwd);
|
|
5176
5464
|
channelWorkerManager?.beginWorkspaceDrain(runtimeToDrain.workspaceCwd);
|
|
5177
5465
|
workspaceVoiceCoordinator.beginWorkspaceDrain(runtimeToDrain);
|
|
5466
|
+
channelWebhookEnvByWorkspace.delete(runtimeToDrain.workspaceCwd);
|
|
5467
|
+
channelWebhookConfigVersion += 1;
|
|
5468
|
+
refreshChannelWebhookConfigs?.();
|
|
5469
|
+
const app3 = serveAppForRuntimeLifecycle.current ?? runtimeApp ?? runtimeAppForCleanup;
|
|
5470
|
+
const stopScheduledTaskKeepaliveForWorkspace = app3?.locals?.["stopScheduledTaskKeepaliveForWorkspace"];
|
|
5471
|
+
try {
|
|
5472
|
+
stopScheduledTaskKeepaliveForWorkspace?.(runtimeToDrain.workspaceCwd);
|
|
5473
|
+
} catch (err) {
|
|
5474
|
+
daemonLog.error(
|
|
5475
|
+
"workspace scheduled-task drain error",
|
|
5476
|
+
err instanceof Error ? err : null
|
|
5477
|
+
);
|
|
5478
|
+
}
|
|
5178
5479
|
},
|
|
5179
5480
|
cancelDrain(runtimeToDrain) {
|
|
5481
|
+
if (runtimeToDrain.primary && bridgeRef === void 0) {
|
|
5482
|
+
bridgeRef = runtimeToDrain.bridge;
|
|
5483
|
+
invalidatePrimaryServeFeaturesCache();
|
|
5484
|
+
}
|
|
5180
5485
|
channelWorkerManager?.cancelWorkspaceDrain(runtimeToDrain.workspaceCwd);
|
|
5181
5486
|
totalSessionAdmission.cancelWorkspaceDrain(runtimeToDrain.workspaceCwd);
|
|
5182
5487
|
workspaceVoiceCoordinator.cancelWorkspaceDrain(runtimeToDrain);
|
|
5488
|
+
channelWebhookEnvByWorkspace.set(
|
|
5489
|
+
runtimeToDrain.workspaceCwd,
|
|
5490
|
+
workspaceRuntimeEffectiveEnv(runtimeToDrain, daemonRuntimeBaseEnv)
|
|
5491
|
+
);
|
|
5492
|
+
channelWebhookConfigVersion += 1;
|
|
5493
|
+
refreshChannelWebhookConfigs?.();
|
|
5494
|
+
const app3 = serveAppForRuntimeLifecycle.current ?? runtimeApp ?? runtimeAppForCleanup;
|
|
5495
|
+
const startScheduledTaskKeepaliveForWorkspace = app3?.locals?.["startScheduledTaskKeepaliveForWorkspace"];
|
|
5496
|
+
try {
|
|
5497
|
+
startScheduledTaskKeepaliveForWorkspace?.(runtimeToDrain);
|
|
5498
|
+
} catch (err) {
|
|
5499
|
+
daemonLog.error(
|
|
5500
|
+
"workspace scheduled-task drain rollback error",
|
|
5501
|
+
err instanceof Error ? err : null
|
|
5502
|
+
);
|
|
5503
|
+
}
|
|
5183
5504
|
},
|
|
5184
5505
|
completeDrain(runtimeToDrain) {
|
|
5185
5506
|
totalSessionAdmission.completeWorkspaceDrain(
|
|
@@ -5202,18 +5523,29 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5202
5523
|
const existing = runtimeCleanupPromises.get(runtimeToDrain);
|
|
5203
5524
|
if (existing) return existing;
|
|
5204
5525
|
const cleanup = (async () => {
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
)
|
|
5526
|
+
const containmentErrors = [];
|
|
5527
|
+
try {
|
|
5528
|
+
await workspaceVoiceCoordinator.disposeRuntime(
|
|
5529
|
+
runtimeToDrain,
|
|
5530
|
+
reason
|
|
5531
|
+
);
|
|
5532
|
+
} catch (err) {
|
|
5533
|
+
daemonLog.error(
|
|
5534
|
+
"workspace voice cleanup error",
|
|
5535
|
+
err instanceof Error ? err : null
|
|
5536
|
+
);
|
|
5537
|
+
}
|
|
5538
|
+
if (reason === "trust_reconfigured" && workspaceVoiceCoordinator.getWorkspaceActivity(runtimeToDrain) > 0) {
|
|
5539
|
+
containmentErrors.push(
|
|
5540
|
+
new Error("Workspace voice sessions are still active.")
|
|
5541
|
+
);
|
|
5542
|
+
}
|
|
5543
|
+
const stopSubSessions = subSessionStoppersByRuntime.get(runtimeToDrain);
|
|
5212
5544
|
try {
|
|
5213
5545
|
stopSubSessions?.();
|
|
5214
5546
|
} catch {
|
|
5215
5547
|
}
|
|
5216
|
-
if (reason
|
|
5548
|
+
if (reason !== "daemon_shutdown" && channelWorkerManager) {
|
|
5217
5549
|
await channelWorkerManager.removeWorkspace(runtimeToDrain.workspaceCwd).catch((err) => {
|
|
5218
5550
|
daemonLog.error(
|
|
5219
5551
|
"workspace channel worker cleanup error",
|
|
@@ -5234,25 +5566,65 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5234
5566
|
);
|
|
5235
5567
|
}
|
|
5236
5568
|
writeChannelWorkerPidfile();
|
|
5569
|
+
if (reason === "trust_reconfigured" && channelWorkerManager.workspaceActivity(
|
|
5570
|
+
runtimeToDrain.workspaceCwd
|
|
5571
|
+
) > 0) {
|
|
5572
|
+
containmentErrors.push(
|
|
5573
|
+
new Error("Workspace channel workers are still active.")
|
|
5574
|
+
);
|
|
5575
|
+
}
|
|
5237
5576
|
}
|
|
5238
|
-
if (reason
|
|
5239
|
-
const app3 = runtimeApp ?? runtimeAppForCleanup;
|
|
5577
|
+
if (reason !== "daemon_shutdown") {
|
|
5578
|
+
const app3 = serveAppForRuntimeLifecycle.current ?? runtimeApp ?? runtimeAppForCleanup;
|
|
5240
5579
|
const stopWorkspaceGitStateForWorkspace = app3?.locals?.["stopWorkspaceGitStateForWorkspace"];
|
|
5241
5580
|
const stopScheduledTaskKeepaliveForWorkspace = app3?.locals?.["stopScheduledTaskKeepaliveForWorkspace"];
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5581
|
+
try {
|
|
5582
|
+
stopWorkspaceGitStateForWorkspace?.(runtimeToDrain.workspaceCwd);
|
|
5583
|
+
} catch (err) {
|
|
5584
|
+
daemonLog.error(
|
|
5585
|
+
"workspace git-state cleanup error",
|
|
5586
|
+
err instanceof Error ? err : null
|
|
5587
|
+
);
|
|
5588
|
+
}
|
|
5589
|
+
try {
|
|
5590
|
+
stopScheduledTaskKeepaliveForWorkspace?.(
|
|
5591
|
+
runtimeToDrain.workspaceCwd
|
|
5592
|
+
);
|
|
5593
|
+
} catch (err) {
|
|
5594
|
+
daemonLog.error(
|
|
5595
|
+
"workspace scheduled-task cleanup error",
|
|
5596
|
+
err instanceof Error ? err : null
|
|
5597
|
+
);
|
|
5598
|
+
}
|
|
5246
5599
|
}
|
|
5247
5600
|
let bridgeStopped = false;
|
|
5248
5601
|
try {
|
|
5249
5602
|
if (!shutdownBridges.has(runtimeToDrain.bridge)) {
|
|
5250
|
-
|
|
5603
|
+
try {
|
|
5604
|
+
await runtimeToDrain.bridge.shutdown({ reason });
|
|
5605
|
+
} catch (shutdownError) {
|
|
5606
|
+
try {
|
|
5607
|
+
runtimeToDrain.bridge.killAllSync();
|
|
5608
|
+
daemonLog.warn(
|
|
5609
|
+
"workspace bridge required forceful shutdown",
|
|
5610
|
+
{
|
|
5611
|
+
workspace: runtimeToDrain.workspaceCwd,
|
|
5612
|
+
reason,
|
|
5613
|
+
error: shutdownError instanceof Error ? shutdownError.message : String(shutdownError)
|
|
5614
|
+
}
|
|
5615
|
+
);
|
|
5616
|
+
} catch (killError) {
|
|
5617
|
+
throw new AggregateError(
|
|
5618
|
+
[shutdownError, killError],
|
|
5619
|
+
"Workspace bridge shutdown could not be confirmed."
|
|
5620
|
+
);
|
|
5621
|
+
}
|
|
5622
|
+
}
|
|
5251
5623
|
}
|
|
5252
5624
|
bridgeStopped = true;
|
|
5253
5625
|
} finally {
|
|
5254
|
-
if (bridgeStopped
|
|
5255
|
-
|
|
5626
|
+
if (bridgeStopped) {
|
|
5627
|
+
subSessionStoppersByRuntime.delete(runtimeToDrain);
|
|
5256
5628
|
if (stopSubSessions) {
|
|
5257
5629
|
removeArrayValue(subSessionStoppers, stopSubSessions);
|
|
5258
5630
|
}
|
|
@@ -5264,22 +5636,103 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5264
5636
|
shutdownBridges.add(runtimeToDrain.bridge);
|
|
5265
5637
|
}
|
|
5266
5638
|
}
|
|
5639
|
+
if (containmentErrors.length > 0) {
|
|
5640
|
+
throw new AggregateError(
|
|
5641
|
+
containmentErrors,
|
|
5642
|
+
"Workspace runtime containment could not be confirmed."
|
|
5643
|
+
);
|
|
5644
|
+
}
|
|
5267
5645
|
})();
|
|
5268
5646
|
runtimeCleanupPromises.set(runtimeToDrain, cleanup);
|
|
5269
5647
|
void cleanup.catch(() => {
|
|
5270
|
-
if (
|
|
5648
|
+
if (runtimeCleanupPromises.get(runtimeToDrain) === cleanup) {
|
|
5271
5649
|
runtimeCleanupPromises.delete(runtimeToDrain);
|
|
5272
5650
|
}
|
|
5273
5651
|
});
|
|
5274
5652
|
return cleanup;
|
|
5275
5653
|
}
|
|
5276
5654
|
};
|
|
5655
|
+
const channelManagementServices = /* @__PURE__ */ new WeakMap();
|
|
5656
|
+
const channelManagementService = /* @__PURE__ */ __name((targetRuntime) => {
|
|
5657
|
+
const existing = channelManagementServices.get(targetRuntime);
|
|
5658
|
+
if (existing) return existing;
|
|
5659
|
+
const pending = (async () => {
|
|
5660
|
+
if (!ensureChannelWorkerManager) {
|
|
5661
|
+
throw Object.assign(
|
|
5662
|
+
new Error("Channel worker manager is unavailable."),
|
|
5663
|
+
{ code: "channel_worker_unavailable" }
|
|
5664
|
+
);
|
|
5665
|
+
}
|
|
5666
|
+
const [
|
|
5667
|
+
{ createChannelManagementService },
|
|
5668
|
+
{ WorkspaceChannelSettingsStore }
|
|
5669
|
+
] = await Promise.all([
|
|
5670
|
+
import("./channel-management-service-RAPKQK24.js"),
|
|
5671
|
+
import("./channel-settings-store-KJQKY6NN.js")
|
|
5672
|
+
]);
|
|
5673
|
+
return createChannelManagementService({
|
|
5674
|
+
workspaceCwd: targetRuntime.workspaceCwd,
|
|
5675
|
+
store: new WorkspaceChannelSettingsStore(targetRuntime.workspaceCwd),
|
|
5676
|
+
manager: await ensureChannelWorkerManager()
|
|
5677
|
+
});
|
|
5678
|
+
})();
|
|
5679
|
+
channelManagementServices.set(targetRuntime, pending);
|
|
5680
|
+
void pending.catch(() => {
|
|
5681
|
+
if (channelManagementServices.get(targetRuntime) === pending) {
|
|
5682
|
+
channelManagementServices.delete(targetRuntime);
|
|
5683
|
+
}
|
|
5684
|
+
});
|
|
5685
|
+
return pending;
|
|
5686
|
+
}, "channelManagementService");
|
|
5687
|
+
const validateWorkspaceRuntimeForPublication = /* @__PURE__ */ __name(async (runtimeForPublication) => {
|
|
5688
|
+
let candidate = runtimeForPublication;
|
|
5689
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
5690
|
+
const snapshot = await trustPolicy.readDaemonTrustPolicySnapshot();
|
|
5691
|
+
const decision = trustPolicy.evaluateDaemonWorkspaceTrust(
|
|
5692
|
+
snapshot,
|
|
5693
|
+
candidate.workspaceCwd
|
|
5694
|
+
);
|
|
5695
|
+
const materialization = JSON.stringify({
|
|
5696
|
+
trusted: decision.targetTrusted,
|
|
5697
|
+
boundWorkspaces: [candidate.workspaceCwd]
|
|
5698
|
+
});
|
|
5699
|
+
if (candidate.trustMaterialization === materialization) {
|
|
5700
|
+
return candidate;
|
|
5701
|
+
}
|
|
5702
|
+
candidate.generationGuard?.close();
|
|
5703
|
+
await workspaceRuntimeRemoval.disposeRuntime(
|
|
5704
|
+
candidate,
|
|
5705
|
+
"trust_reconfigured"
|
|
5706
|
+
);
|
|
5707
|
+
if (attempt === 2) {
|
|
5708
|
+
throw new Error(
|
|
5709
|
+
"Workspace trust policy kept changing before runtime publication."
|
|
5710
|
+
);
|
|
5711
|
+
}
|
|
5712
|
+
candidate = await createDynamicWorkspaceRuntime(
|
|
5713
|
+
runtimeForPublication.workspaceCwd,
|
|
5714
|
+
{
|
|
5715
|
+
primary: runtimeForPublication.primary,
|
|
5716
|
+
removable: runtimeForPublication.removable,
|
|
5717
|
+
displayName: runtimeForPublication.displayName,
|
|
5718
|
+
registrationIds: runtimeForPublication.registrationIds
|
|
5719
|
+
}
|
|
5720
|
+
);
|
|
5721
|
+
}
|
|
5722
|
+
throw new Error("Workspace runtime publication validation failed.");
|
|
5723
|
+
}, "validateWorkspaceRuntimeForPublication");
|
|
5277
5724
|
const app2 = runtime.createServeApp(opts, () => actualPort, {
|
|
5278
5725
|
workspaceRegistry,
|
|
5279
5726
|
createWorkspaceRuntime: createDynamicWorkspaceRuntime,
|
|
5727
|
+
...workspaceTrustHotReloadAvailable ? {
|
|
5728
|
+
validateWorkspaceRuntimeForPublication,
|
|
5729
|
+
runWorkspaceTrustOperation,
|
|
5730
|
+
getWorkspaceTrustPolicySnapshot: /* @__PURE__ */ __name(() => latestTrustPolicySnapshot, "getWorkspaceTrustPolicySnapshot")
|
|
5731
|
+
} : {},
|
|
5280
5732
|
managedScratchRoot,
|
|
5281
5733
|
workspaceRegistrationStore,
|
|
5282
5734
|
workspaceRuntimeRemoval,
|
|
5735
|
+
workspaceTrustHotReloadAvailable,
|
|
5283
5736
|
voiceCoordinator: workspaceVoiceCoordinator,
|
|
5284
5737
|
bridge,
|
|
5285
5738
|
webShellDir,
|
|
@@ -5330,6 +5783,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5330
5783
|
}, "deliverChannelMessage"),
|
|
5331
5784
|
channelDeliveryAuthorizations,
|
|
5332
5785
|
reloadChannelWorker,
|
|
5786
|
+
channelManagementService,
|
|
5333
5787
|
getPerfSnapshot: /* @__PURE__ */ __name(() => ({
|
|
5334
5788
|
eventLoop: currentDaemonEventLoopMonitor.snapshot(),
|
|
5335
5789
|
promptQueueWait: {
|
|
@@ -5357,9 +5811,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5357
5811
|
sessionArtifactsPersistenceAvailable: sessionArtifactsPersistenceAvailableFromSettings(
|
|
5358
5812
|
runtimeBootSettings?.merged
|
|
5359
5813
|
),
|
|
5360
|
-
installAuthProvider: /* @__PURE__ */ __name((req) => withSettingsLock(
|
|
5814
|
+
installAuthProvider: /* @__PURE__ */ __name((req, assertGenerationOpen) => withSettingsLock(
|
|
5361
5815
|
boundWorkspace,
|
|
5362
5816
|
async () => {
|
|
5817
|
+
assertGenerationOpen?.();
|
|
5363
5818
|
const provider = core.findProviderById(req.providerId);
|
|
5364
5819
|
if (!provider) {
|
|
5365
5820
|
throw new Error(`Unsupported auth provider: ${req.providerId}`);
|
|
@@ -5369,7 +5824,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5369
5824
|
resolveBaseUrl: core.resolveBaseUrl
|
|
5370
5825
|
});
|
|
5371
5826
|
const plan = core.buildInstallPlan(provider, inputs);
|
|
5372
|
-
const fresh =
|
|
5827
|
+
const fresh = loadSettingsForPersistence(boundWorkspace);
|
|
5373
5828
|
const adapter = settingsRuntime.loadedSettingsAdapter.createLoadedSettingsAdapter(
|
|
5374
5829
|
fresh
|
|
5375
5830
|
);
|
|
@@ -5377,6 +5832,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5377
5832
|
settings: adapter,
|
|
5378
5833
|
doRefreshAuth: false
|
|
5379
5834
|
});
|
|
5835
|
+
assertGenerationOpen?.();
|
|
5380
5836
|
core.emitDaemonLog("Auth provider installed.", {
|
|
5381
5837
|
"qwen-code.daemon.auth.provider_id": provider.id,
|
|
5382
5838
|
"qwen-code.daemon.auth.auth_type": plan.authType
|
|
@@ -5395,11 +5851,171 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5395
5851
|
}
|
|
5396
5852
|
), "installAuthProvider")
|
|
5397
5853
|
});
|
|
5854
|
+
serveAppForRuntimeLifecycle.current = app2;
|
|
5398
5855
|
invalidatePrimaryServeFeaturesCache = app2.locals.invalidateServeFeaturesCache ?? invalidatePrimaryServeFeaturesCache;
|
|
5399
5856
|
app2.locals.subSessionStoppers = subSessionStoppers;
|
|
5400
5857
|
subSessionStoppers.push(subSessionLauncher.stop);
|
|
5401
|
-
|
|
5402
|
-
|
|
5858
|
+
subSessionStoppersByRuntime.set(
|
|
5859
|
+
workspaceRegistry.primary,
|
|
5860
|
+
subSessionLauncher.stop
|
|
5861
|
+
);
|
|
5862
|
+
if (workspaceTrustHotReloadAvailable) {
|
|
5863
|
+
const [
|
|
5864
|
+
{ createWorkspaceTrustReconciler },
|
|
5865
|
+
{ createDaemonTrustPolicyMonitor }
|
|
5866
|
+
] = await Promise.all([
|
|
5867
|
+
import("./workspace-trust-reconciler-V2TICK2A.js"),
|
|
5868
|
+
import("./daemon-trust-policy-monitor-4KX2OK7G.js")
|
|
5869
|
+
]);
|
|
5870
|
+
const materializationFor = /* @__PURE__ */ __name((entry, snapshot, decision) => {
|
|
5871
|
+
const boundWorkspaces2 = entry.primary && decision.targetTrusted ? runtime.resolveBoundWorkspacesFromIdeEnv(
|
|
5872
|
+
entry.workspaceCwd,
|
|
5873
|
+
void 0,
|
|
5874
|
+
(workspace, index) => index === 0 || trustPolicy.evaluateDaemonWorkspaceTrust(snapshot, workspace).targetTrusted
|
|
5875
|
+
) : [entry.workspaceCwd];
|
|
5876
|
+
return {
|
|
5877
|
+
key: JSON.stringify({
|
|
5878
|
+
trusted: decision.targetTrusted,
|
|
5879
|
+
boundWorkspaces: [...boundWorkspaces2].sort()
|
|
5880
|
+
}),
|
|
5881
|
+
boundWorkspaces: boundWorkspaces2
|
|
5882
|
+
};
|
|
5883
|
+
}, "materializationFor");
|
|
5884
|
+
const acpHandle = /* @__PURE__ */ __name(() => app2.locals?.["acpHandle"], "acpHandle");
|
|
5885
|
+
const trustReconciler = createWorkspaceTrustReconciler({
|
|
5886
|
+
registry: workspaceRegistry,
|
|
5887
|
+
readLatestSnapshot: trustPolicy.readDaemonTrustPolicySnapshot,
|
|
5888
|
+
materializationKey: /* @__PURE__ */ __name(({ entry, snapshot, decision }) => materializationFor(entry, snapshot, decision).key, "materializationKey"),
|
|
5889
|
+
isTrustDecrease: /* @__PURE__ */ __name(({
|
|
5890
|
+
runtime: current,
|
|
5891
|
+
nextMaterialization,
|
|
5892
|
+
decision
|
|
5893
|
+
}) => {
|
|
5894
|
+
if (current.trusted && !decision.targetTrusted) return true;
|
|
5895
|
+
if (!current.primary || !current.trusted) return false;
|
|
5896
|
+
try {
|
|
5897
|
+
const previous = JSON.parse(
|
|
5898
|
+
current.trustMaterialization ?? "{}"
|
|
5899
|
+
);
|
|
5900
|
+
const next = JSON.parse(nextMaterialization);
|
|
5901
|
+
if (!Array.isArray(previous.boundWorkspaces) || !Array.isArray(next.boundWorkspaces)) {
|
|
5902
|
+
return true;
|
|
5903
|
+
}
|
|
5904
|
+
const nextRoots = new Set(
|
|
5905
|
+
next.boundWorkspaces.filter(
|
|
5906
|
+
(value) => typeof value === "string"
|
|
5907
|
+
)
|
|
5908
|
+
);
|
|
5909
|
+
return previous.boundWorkspaces.some(
|
|
5910
|
+
(value) => typeof value !== "string" || !nextRoots.has(value)
|
|
5911
|
+
);
|
|
5912
|
+
} catch {
|
|
5913
|
+
return true;
|
|
5914
|
+
}
|
|
5915
|
+
}, "isTrustDecrease"),
|
|
5916
|
+
buildRuntime: /* @__PURE__ */ __name(async ({
|
|
5917
|
+
entry,
|
|
5918
|
+
trusted,
|
|
5919
|
+
snapshot,
|
|
5920
|
+
decision,
|
|
5921
|
+
generationGuard
|
|
5922
|
+
}) => {
|
|
5923
|
+
const materialized = materializationFor(
|
|
5924
|
+
entry,
|
|
5925
|
+
snapshot,
|
|
5926
|
+
trusted === decision.targetTrusted ? decision : { ...decision, targetTrusted: trusted }
|
|
5927
|
+
);
|
|
5928
|
+
return createDynamicWorkspaceRuntime(entry.workspaceCwd, {
|
|
5929
|
+
trusted,
|
|
5930
|
+
snapshot,
|
|
5931
|
+
decision,
|
|
5932
|
+
generationGuard,
|
|
5933
|
+
primary: entry.primary,
|
|
5934
|
+
removable: entry.removable,
|
|
5935
|
+
displayName: entry.displayName,
|
|
5936
|
+
registrationIds: entry.registrationIds,
|
|
5937
|
+
boundWorkspaces: materialized.boundWorkspaces,
|
|
5938
|
+
trustMaterialization: materialized.key
|
|
5939
|
+
});
|
|
5940
|
+
}, "buildRuntime"),
|
|
5941
|
+
drainRuntime: /* @__PURE__ */ __name(async (runtimeToDrain) => {
|
|
5942
|
+
workspaceRuntimeRemoval.beginDrain(runtimeToDrain);
|
|
5943
|
+
acpHandle()?.beginWorkspaceDrain(runtimeToDrain.workspaceId);
|
|
5944
|
+
}, "drainRuntime"),
|
|
5945
|
+
disposeRuntime: /* @__PURE__ */ __name(async (runtimeToDispose, reason) => {
|
|
5946
|
+
const errors = [];
|
|
5947
|
+
try {
|
|
5948
|
+
await workspaceRuntimeRemoval.disposeRuntime(
|
|
5949
|
+
runtimeToDispose,
|
|
5950
|
+
reason
|
|
5951
|
+
);
|
|
5952
|
+
} catch (error) {
|
|
5953
|
+
errors.push(error);
|
|
5954
|
+
}
|
|
5955
|
+
try {
|
|
5956
|
+
const handle = acpHandle();
|
|
5957
|
+
if (!runtimeToDispose.primary) {
|
|
5958
|
+
handle?.commitWorkspaceRemoval(runtimeToDispose.workspaceId);
|
|
5959
|
+
}
|
|
5960
|
+
handle?.disposeWorkspace(runtimeToDispose.workspaceId);
|
|
5961
|
+
const deadline = Date.now() + 1e3;
|
|
5962
|
+
while ((handle?.getWorkspaceActivity(runtimeToDispose.workspaceId).memoryTasks ?? 0) > 0 && Date.now() < deadline) {
|
|
5963
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
5964
|
+
}
|
|
5965
|
+
if ((handle?.getWorkspaceActivity(runtimeToDispose.workspaceId).memoryTasks ?? 0) > 0) {
|
|
5966
|
+
throw new Error(
|
|
5967
|
+
"Workspace memory tasks did not stop after runtime disposal."
|
|
5968
|
+
);
|
|
5969
|
+
}
|
|
5970
|
+
} catch (error) {
|
|
5971
|
+
errors.push(error);
|
|
5972
|
+
}
|
|
5973
|
+
if (errors.length === 1) throw errors[0];
|
|
5974
|
+
if (errors.length > 1) {
|
|
5975
|
+
throw new AggregateError(
|
|
5976
|
+
errors,
|
|
5977
|
+
"Workspace runtime and ACP cleanup failed."
|
|
5978
|
+
);
|
|
5979
|
+
}
|
|
5980
|
+
}, "disposeRuntime"),
|
|
5981
|
+
runtimeActivated: /* @__PURE__ */ __name(async (runtimeAdded) => {
|
|
5982
|
+
workspaceRuntimeRemoval.cancelDrain(runtimeAdded);
|
|
5983
|
+
acpHandle()?.cancelWorkspaceDrain(runtimeAdded.workspaceId);
|
|
5984
|
+
if (runtimeAdded.primary) {
|
|
5985
|
+
bridgeRef = runtimeAdded.bridge;
|
|
5986
|
+
invalidatePrimaryServeFeaturesCache();
|
|
5987
|
+
}
|
|
5988
|
+
await workspaceRuntimeRemoval.runtimeAdded(runtimeAdded);
|
|
5989
|
+
}, "runtimeActivated"),
|
|
5990
|
+
onError: /* @__PURE__ */ __name((entry, error) => {
|
|
5991
|
+
daemonLog.error(
|
|
5992
|
+
`workspace trust reconciliation failed for ${entry.workspaceCwd}`,
|
|
5993
|
+
error instanceof Error ? error : null
|
|
5994
|
+
);
|
|
5995
|
+
}, "onError")
|
|
5996
|
+
});
|
|
5997
|
+
const trustMonitor = createDaemonTrustPolicyMonitor({
|
|
5998
|
+
onSnapshot: /* @__PURE__ */ __name((snapshot) => {
|
|
5999
|
+
latestTrustPolicySnapshot = snapshot;
|
|
6000
|
+
return runWorkspaceTrustOperation(
|
|
6001
|
+
() => trustReconciler.reconcile(snapshot)
|
|
6002
|
+
);
|
|
6003
|
+
}, "onSnapshot"),
|
|
6004
|
+
onError: /* @__PURE__ */ __name((error) => {
|
|
6005
|
+
daemonLog.error(
|
|
6006
|
+
"workspace trust policy monitor failed",
|
|
6007
|
+
error instanceof Error ? error : null
|
|
6008
|
+
);
|
|
6009
|
+
}, "onError")
|
|
6010
|
+
});
|
|
6011
|
+
app2.locals.stopTrustPolicyMonitor = () => trustMonitor.stop();
|
|
6012
|
+
app2.locals.requestTrustReconcile = () => trustMonitor.requestReconcile("manual");
|
|
6013
|
+
app2.locals.waitForTrustPolicyIdle = () => runWorkspaceTrustOperation(async () => void 0);
|
|
6014
|
+
await trustMonitor.start();
|
|
6015
|
+
}
|
|
6016
|
+
const activePrimaryBridge = workspaceRegistry.primaryEntry.current?.runtime.bridge;
|
|
6017
|
+
bridgeRef = activePrimaryBridge;
|
|
6018
|
+
return { app: app2, bridge: activePrimaryBridge };
|
|
5403
6019
|
}, "buildRuntime");
|
|
5404
6020
|
if (deps.bridge) {
|
|
5405
6021
|
const runtime = await buildRuntime();
|
|
@@ -5456,46 +6072,89 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5456
6072
|
);
|
|
5457
6073
|
}
|
|
5458
6074
|
const channelValidationSettingsRuntime = opts.channelSelection ? await loadSettingsRuntimeModules() : void 0;
|
|
6075
|
+
const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-3VFDF5LU.js") : void 0;
|
|
6076
|
+
const channelValidationTrustSnapshot = channelValidationTrustPolicy ? await channelValidationTrustPolicy.readDaemonTrustPolicySnapshot() : void 0;
|
|
5459
6077
|
const resolveChannelWorkspaceGroupsAtListen = /* @__PURE__ */ __name(() => {
|
|
5460
6078
|
if (!opts.channelSelection || !channelValidationSettingsRuntime || !channelRuntime) {
|
|
5461
6079
|
return void 0;
|
|
5462
6080
|
}
|
|
6081
|
+
const registry = (runtimeApp ?? runtimeAppForCleanup)?.locals?.["workspaceRegistry"];
|
|
6082
|
+
const resolveRuntime = /* @__PURE__ */ __name((workspaceCwd) => {
|
|
6083
|
+
const runtime = registry?.getByWorkspaceCwd(workspaceCwd);
|
|
6084
|
+
if (registry && !runtime) {
|
|
6085
|
+
throw Object.assign(
|
|
6086
|
+
new Error(`Workspace "${workspaceCwd}" is unavailable.`),
|
|
6087
|
+
{ code: "workspace_unavailable" }
|
|
6088
|
+
);
|
|
6089
|
+
}
|
|
6090
|
+
return runtime;
|
|
6091
|
+
}, "resolveRuntime");
|
|
6092
|
+
const resolveTrusted = /* @__PURE__ */ __name((workspaceCwd, primary, runtime) => {
|
|
6093
|
+
if (runtime) return runtime.trusted;
|
|
6094
|
+
if (primary && deps.trustedWorkspace !== void 0) {
|
|
6095
|
+
return deps.trustedWorkspace;
|
|
6096
|
+
}
|
|
6097
|
+
if (!channelValidationTrustPolicy || !channelValidationTrustSnapshot) {
|
|
6098
|
+
return false;
|
|
6099
|
+
}
|
|
6100
|
+
return channelValidationTrustPolicy.evaluateDaemonWorkspaceTrust(
|
|
6101
|
+
channelValidationTrustSnapshot,
|
|
6102
|
+
workspaceCwd
|
|
6103
|
+
).targetTrusted;
|
|
6104
|
+
}, "resolveTrusted");
|
|
5463
6105
|
const settingsByWorkspace = /* @__PURE__ */ new Map();
|
|
5464
6106
|
if (workspaceInputs.length === 1) {
|
|
5465
6107
|
const workspace = workspaceInputs[0];
|
|
5466
|
-
const
|
|
5467
|
-
|
|
5468
|
-
)
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
6108
|
+
const runtime = resolveRuntime(workspace.cwd);
|
|
6109
|
+
const trusted = resolveTrusted(workspace.cwd, true, runtime);
|
|
6110
|
+
if (!trusted) {
|
|
6111
|
+
throw Object.assign(
|
|
6112
|
+
new Error(
|
|
6113
|
+
`Primary workspace "${workspace.cwd}" is not trusted; cannot host channels.`
|
|
6114
|
+
),
|
|
6115
|
+
{ code: "untrusted_workspace" }
|
|
6116
|
+
);
|
|
6117
|
+
}
|
|
6118
|
+
const effectiveEnv = runtime ? workspaceRuntimeEffectiveEnv(runtime, daemonRuntimeBaseEnv) : channelValidationSettingsRuntime.environment.buildRuntimeEnvironment(
|
|
6119
|
+
channelValidationSettingsRuntime.settings.loadSettings(
|
|
5473
6120
|
workspace.cwd,
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
6121
|
+
{
|
|
6122
|
+
skipLoadEnvironment: true,
|
|
6123
|
+
skipWorkspaceSettings: false,
|
|
6124
|
+
workspaceTrusted: true
|
|
6125
|
+
}
|
|
6126
|
+
).merged,
|
|
6127
|
+
workspace.cwd,
|
|
6128
|
+
daemonRuntimeBaseEnv,
|
|
6129
|
+
trusted
|
|
6130
|
+
).effectiveEnv;
|
|
6131
|
+
channelWebhookEnvByWorkspace.set(workspace.cwd, effectiveEnv);
|
|
5477
6132
|
return void 0;
|
|
5478
6133
|
}
|
|
5479
6134
|
const workspaces = workspaceInputs.map((workspace, index) => {
|
|
6135
|
+
const runtime = resolveRuntime(workspace.cwd);
|
|
6136
|
+
const trusted = resolveTrusted(workspace.cwd, index === 0, runtime);
|
|
5480
6137
|
const settings = channelValidationSettingsRuntime.settings.loadSettings(
|
|
5481
|
-
workspace.cwd
|
|
6138
|
+
workspace.cwd,
|
|
6139
|
+
{
|
|
6140
|
+
skipLoadEnvironment: true,
|
|
6141
|
+
skipWorkspaceSettings: !trusted,
|
|
6142
|
+
workspaceTrusted: trusted
|
|
6143
|
+
}
|
|
5482
6144
|
);
|
|
5483
6145
|
settingsByWorkspace.set(workspace.cwd, settings);
|
|
5484
6146
|
channelWebhookEnvByWorkspace.set(
|
|
5485
6147
|
workspace.cwd,
|
|
5486
|
-
channelValidationSettingsRuntime.environment.buildRuntimeEnvironment(
|
|
6148
|
+
runtime ? workspaceRuntimeEffectiveEnv(runtime, daemonRuntimeBaseEnv) : channelValidationSettingsRuntime.environment.buildRuntimeEnvironment(
|
|
5487
6149
|
settings.merged,
|
|
5488
6150
|
workspace.cwd,
|
|
5489
|
-
daemonRuntimeBaseEnv
|
|
6151
|
+
daemonRuntimeBaseEnv,
|
|
6152
|
+
trusted
|
|
5490
6153
|
).effectiveEnv
|
|
5491
6154
|
);
|
|
5492
|
-
const trusted = index === 0 && deps.trustedWorkspace !== void 0 ? deps.trustedWorkspace : channelValidationSettingsRuntime.trustedFolders.getWorkspaceTrustStatus(
|
|
5493
|
-
settings.merged,
|
|
5494
|
-
workspace.cwd
|
|
5495
|
-
).effective.state === "trusted";
|
|
5496
6155
|
return {
|
|
5497
6156
|
workspaceCwd: workspace.cwd,
|
|
5498
|
-
primary: index === 0,
|
|
6157
|
+
primary: runtime?.primary ?? index === 0,
|
|
5499
6158
|
trusted
|
|
5500
6159
|
};
|
|
5501
6160
|
});
|
|
@@ -5715,9 +6374,18 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5715
6374
|
}
|
|
5716
6375
|
const runtimes = registry.list();
|
|
5717
6376
|
if (runtimes.length <= 1 && operation === "initial") {
|
|
6377
|
+
const primary = registry.primary;
|
|
6378
|
+
if (!primary.trusted) {
|
|
6379
|
+
throw Object.assign(
|
|
6380
|
+
new Error(
|
|
6381
|
+
`Primary workspace "${primary.workspaceCwd}" is not trusted; cannot host channels.`
|
|
6382
|
+
),
|
|
6383
|
+
{ code: "untrusted_workspace" }
|
|
6384
|
+
);
|
|
6385
|
+
}
|
|
5718
6386
|
return [
|
|
5719
6387
|
{
|
|
5720
|
-
workspaceCwd:
|
|
6388
|
+
workspaceCwd: primary.workspaceCwd,
|
|
5721
6389
|
selection: channelSelection
|
|
5722
6390
|
}
|
|
5723
6391
|
];
|
|
@@ -5728,7 +6396,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5728
6396
|
const grouping = resolveChannelWorkspaceGroups({
|
|
5729
6397
|
workspaces: runtimes.map((runtime) => {
|
|
5730
6398
|
const settings = settingsRuntime.settings.loadSettings(
|
|
5731
|
-
runtime.workspaceCwd
|
|
6399
|
+
runtime.workspaceCwd,
|
|
6400
|
+
{
|
|
6401
|
+
skipLoadEnvironment: true,
|
|
6402
|
+
skipWorkspaceSettings: !runtime.trusted,
|
|
6403
|
+
workspaceTrusted: runtime.trusted
|
|
6404
|
+
}
|
|
5732
6405
|
);
|
|
5733
6406
|
settingsByWorkspace.set(runtime.workspaceCwd, settings);
|
|
5734
6407
|
return {
|
|
@@ -5899,7 +6572,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5899
6572
|
);
|
|
5900
6573
|
return;
|
|
5901
6574
|
}
|
|
5902
|
-
if (shouldPreheat) {
|
|
6575
|
+
if (shouldPreheat && runtime.bridge) {
|
|
5903
6576
|
startBridgePreheat(runtime.bridge);
|
|
5904
6577
|
}
|
|
5905
6578
|
await completeRuntimeStartup(runtime.app);
|
|
@@ -5941,6 +6614,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5941
6614
|
if (shuttingDown) {
|
|
5942
6615
|
daemonLog.warn(`received ${signal} during drain \u2014 forcing exit`);
|
|
5943
6616
|
try {
|
|
6617
|
+
managedProcessRegistry?.killAllSync();
|
|
5944
6618
|
channelWorkerManager?.killAllSync();
|
|
5945
6619
|
for (const runtimeBridge of getRuntimeBridgesForCleanup()) {
|
|
5946
6620
|
runtimeBridge.killAllSync();
|
|
@@ -5968,7 +6642,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
5968
6642
|
process.exit(runtimeStartupError === void 0 ? 0 : 1);
|
|
5969
6643
|
} catch (err) {
|
|
5970
6644
|
daemonLog.error("shutdown error", err instanceof Error ? err : null);
|
|
5971
|
-
if (
|
|
6645
|
+
if (err instanceof Error && retryableChannelWorkerShutdownErrors.has(err)) {
|
|
5972
6646
|
daemonLog.error(
|
|
5973
6647
|
"refusing to exit while a channel worker or service lease remains; signal again to retry after the child exits (another signal during that retry forces exit)"
|
|
5974
6648
|
);
|
|
@@ -6001,6 +6675,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
6001
6675
|
const initiallyMountedApp = runtimeApp ?? runtimeAppForCleanup;
|
|
6002
6676
|
const initiallyMountedManagement = initiallyMountedApp?.locals?.["workspaceManagementHandle"];
|
|
6003
6677
|
const initialManagementWait = initiallyMountedManagement?.sealAndWait?.();
|
|
6678
|
+
let processRegistryShutdown;
|
|
6679
|
+
const startProcessRegistryShutdown = /* @__PURE__ */ __name(() => {
|
|
6680
|
+
processRegistryShutdown ??= managedProcessRegistry?.shutdown().then(
|
|
6681
|
+
() => void 0,
|
|
6682
|
+
(error2) => error2 instanceof Error ? error2 : new Error(String(error2))
|
|
6683
|
+
);
|
|
6684
|
+
}, "startProcessRegistryShutdown");
|
|
6685
|
+
startProcessRegistryShutdown();
|
|
6004
6686
|
clearRuntimeStartAfterHealthTimer();
|
|
6005
6687
|
clearRuntimeStartFallbackTimer();
|
|
6006
6688
|
cancelDeferredRuntimeStartup();
|
|
@@ -6029,6 +6711,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
6029
6711
|
const finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
|
|
6030
6712
|
const retryableChannelClose = channelWorkerShutdownError !== void 0 && channelWorkerManager?.state().enabled === true;
|
|
6031
6713
|
if (retryableChannelClose) {
|
|
6714
|
+
const retryableError = channelWorkerShutdownError;
|
|
6032
6715
|
await flushDaemonLogBounded(
|
|
6033
6716
|
daemonLog,
|
|
6034
6717
|
DAEMON_LOG_FORCED_FLUSH_BUDGET_MS
|
|
@@ -6036,13 +6719,18 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
6036
6719
|
closePromise = void 0;
|
|
6037
6720
|
shuttingDown = false;
|
|
6038
6721
|
channelControlDraining = false;
|
|
6039
|
-
|
|
6722
|
+
retryableChannelWorkerShutdownErrors.add(retryableError);
|
|
6723
|
+
rej(retryableError);
|
|
6040
6724
|
return;
|
|
6041
6725
|
}
|
|
6042
6726
|
if (loggerPublished || loggerSignalOwned) {
|
|
6043
|
-
writeDaemonLifecycleBestEffort(
|
|
6044
|
-
()
|
|
6045
|
-
|
|
6727
|
+
writeDaemonLifecycleBestEffort(() => {
|
|
6728
|
+
if (finalErr) {
|
|
6729
|
+
daemonLog.error("daemon shutdown incomplete", finalErr);
|
|
6730
|
+
} else {
|
|
6731
|
+
daemonLog.info("daemon stopped");
|
|
6732
|
+
}
|
|
6733
|
+
});
|
|
6046
6734
|
await daemonLog.close();
|
|
6047
6735
|
}
|
|
6048
6736
|
if (finalErr) rej(finalErr);
|
|
@@ -6065,6 +6753,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
6065
6753
|
if (workspaceManagementHandle !== initiallyMountedManagement) {
|
|
6066
6754
|
await workspaceManagementHandle?.sealAndWait?.();
|
|
6067
6755
|
}
|
|
6756
|
+
stopTrustPolicyMonitor(appForCleanup);
|
|
6757
|
+
const waitForTrustPolicyIdle = appForCleanup?.locals?.["waitForTrustPolicyIdle"];
|
|
6758
|
+
await waitForTrustPolicyIdle?.().catch((err) => {
|
|
6759
|
+
daemonLog.error(
|
|
6760
|
+
"workspace trust reconciliation shutdown wait failed",
|
|
6761
|
+
err instanceof Error ? err : null
|
|
6762
|
+
);
|
|
6763
|
+
});
|
|
6764
|
+
startProcessRegistryShutdown();
|
|
6068
6765
|
disposeRuntimeAppResources(appForCleanup);
|
|
6069
6766
|
disposeDaemonEventLoopMonitor();
|
|
6070
6767
|
if (channelWorkerManager) {
|
|
@@ -6115,6 +6812,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
6115
6812
|
bridgeShutdownError = err instanceof Error ? err : new Error(String(err));
|
|
6116
6813
|
});
|
|
6117
6814
|
}
|
|
6815
|
+
const processRegistryError = await processRegistryShutdown;
|
|
6816
|
+
if (processRegistryError) {
|
|
6817
|
+
daemonLog.error(
|
|
6818
|
+
"ACP process registry shutdown error",
|
|
6819
|
+
processRegistryError
|
|
6820
|
+
);
|
|
6821
|
+
bridgeShutdownError ??= processRegistryError;
|
|
6822
|
+
}
|
|
6118
6823
|
}).finally(() => {
|
|
6119
6824
|
if (!server.listening) {
|
|
6120
6825
|
void (runtimeFailureListenerClose ?? Promise.resolve()).then(
|
|
@@ -6197,7 +6902,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
|
|
|
6197
6902
|
closeErr instanceof Error ? closeErr : null
|
|
6198
6903
|
)
|
|
6199
6904
|
);
|
|
6200
|
-
if (
|
|
6905
|
+
if (closeErr instanceof Error && retryableChannelWorkerShutdownErrors.has(closeErr)) {
|
|
6201
6906
|
writeDaemonLifecycleBestEffort(
|
|
6202
6907
|
() => daemonLog.error(
|
|
6203
6908
|
"runtime startup failed, but qwen serve remains alive to retain the channel service lease until worker exit is confirmed"
|