@qwen-code/qwen-code 0.19.6 → 0.19.7-nightly.20260708.394c1a289
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 +5 -1
- package/bundled/qc-helper/docs/configuration/settings.md +33 -1
- package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +41 -31
- package/bundled/qc-helper/docs/features/channels/wecom.md +111 -0
- package/bundled/qc-helper/docs/features/code-review.md +16 -6
- package/bundled/qc-helper/docs/features/commands.md +1 -1
- package/bundled/qc-helper/docs/features/hooks.md +6 -0
- package/bundled/qc-helper/docs/features/skills.md +5 -3
- package/bundled/qc-helper/docs/integration-github-action.md +1 -1
- package/bundled/review/DESIGN.md +50 -18
- package/bundled/review/SKILL.md +102 -12
- package/chunks/{MaxSizedBox-SK7CUWZQ.js → MaxSizedBox-XS37LWTD.js} +31 -29
- package/chunks/{StandaloneSessionPicker-G44HGSAP.js → StandaloneSessionPicker-LPALJTKN.js} +44 -41
- package/chunks/{acpAgent-PKCTYWJV.js → acpAgent-4VE3FGJX.js} +769 -366
- package/chunks/{agent-IYMHUXWB.js → agent-CCHERW6L.js} +24 -24
- package/chunks/{agent-headless-L2DAW6I5.js → agent-headless-55N6UBUU.js} +24 -24
- package/chunks/{anthropicContentGenerator-H5ZOEENQ.js → anthropicContentGenerator-AKYPSZIV.js} +7 -7
- package/chunks/{artifact-tool-SLYPWG3C.js → artifact-tool-D233YJFH.js} +27 -8
- package/chunks/{askUserQuestion-OKPTECON.js → askUserQuestion-MKL5ZTMC.js} +2 -2
- package/chunks/{bridge-DF3IJQ5V.js → bridge-U6HXOHE7.js} +34 -32
- package/chunks/{channel-worker-supervisor-JUYQ5Z4R.js → channel-worker-supervisor-CRCVYQIE.js} +1 -1
- package/chunks/{chunk-AVQDCKNF.js → chunk-22MNNNXE.js} +4 -0
- package/chunks/chunk-2DYY5XUZ.js +8223 -0
- package/chunks/chunk-2FHWCKWA.js +262 -0
- package/chunks/{chunk-6BEOH4KK.js → chunk-2NPS2UDH.js} +767 -122
- package/chunks/{chunk-N2IJLN2L.js → chunk-2SWMCXVR.js} +13 -5
- package/chunks/{chunk-OBVBTAX5.js → chunk-2YELHTUE.js} +2 -2
- package/chunks/chunk-332PWN27.js +19 -0
- package/chunks/{chunk-CLQPBI4H.js → chunk-3B26UVCX.js} +132 -26
- package/chunks/{chunk-HCFSKO6K.js → chunk-3QDZDAJG.js} +1 -1
- package/chunks/{chunk-G7OQ3RFJ.js → chunk-42XGFRJS.js} +3 -3
- package/chunks/{chunk-SL2P3JUA.js → chunk-43W4YSO6.js} +1 -12
- package/chunks/{chunk-JA5KWZTJ.js → chunk-44NROQYV.js} +5 -3
- package/chunks/{chunk-BOAWGUY6.js → chunk-4AFOWB47.js} +121 -49
- package/chunks/{chunk-MOUXUCXQ.js → chunk-4KJ2BPIT.js} +1 -1
- package/chunks/{chunk-YTWX5TT2.js → chunk-5FL2K3ZB.js} +1 -1
- package/chunks/{chunk-UNXGEDX2.js → chunk-5OSSOBZC.js} +133 -25
- package/chunks/{chunk-JN2VJ33O.js → chunk-7I4MGFBN.js} +966 -121
- package/chunks/{chunk-T42ACHFI.js → chunk-7LTB54MK.js} +1 -1
- package/chunks/chunk-A2X3KLC3.js +3807 -0
- package/chunks/{chunk-EWALXUAD.js → chunk-AGHU5VRK.js} +8 -0
- package/chunks/{chunk-GLPV75ES.js → chunk-AHNJGLFV.js} +2 -2
- package/chunks/{chunk-IUSKVKH5.js → chunk-AXTPFMRS.js} +1 -1
- package/chunks/{chunk-T22H4V4R.js → chunk-B34OV7K2.js} +1 -1
- package/chunks/{chunk-FZ5NVRVK.js → chunk-B5FOCTEZ.js} +3 -3
- package/chunks/{chunk-3UC7ZC43.js → chunk-B6WUEODT.js} +7 -7
- package/chunks/{chunk-MJKEQSZI.js → chunk-BGL43SJ3.js} +1 -1
- package/chunks/{chunk-OAYOHSGP.js → chunk-BHRU4SDF.js} +4 -4
- package/chunks/{chunk-YPCPZSZB.js → chunk-CCGOFQV3.js} +56 -4
- package/chunks/{chunk-FDY3XOTM.js → chunk-CR5IU2RX.js} +4 -4
- package/chunks/{chunk-LWGLBVWA.js → chunk-CSOTA7KX.js} +1 -1
- package/chunks/{chunk-AGZF43UV.js → chunk-E7HM76PR.js} +7153 -4406
- package/chunks/{chunk-NIOPRZNN.js → chunk-E7KNELIZ.js} +1 -1
- package/chunks/{chunk-YSU33ACT.js → chunk-ELMPRVCB.js} +5 -13
- package/chunks/{chunk-SEZC2725.js → chunk-ER3BKOLB.js} +13 -0
- package/chunks/{chunk-3VJ7MT3N.js → chunk-EXPMGZZV.js} +14 -3
- package/chunks/{chunk-DBF3HTLT.js → chunk-FB2ULV4M.js} +4 -4
- package/chunks/{chunk-RZORUN6X.js → chunk-FEJ2FZ3U.js} +1 -1
- package/chunks/chunk-FK77ILF5.js +2477 -0
- package/chunks/{chunk-DMSNJDWG.js → chunk-FV7425LN.js} +38 -3
- package/chunks/{chunk-ALX6BUYW.js → chunk-G7ZG7CA6.js} +186 -27
- package/chunks/{chunk-2INJBYLJ.js → chunk-GIY6JTTC.js} +6 -6
- package/chunks/{chunk-D5KISTLW.js → chunk-H6EMK6QK.js} +1 -1
- package/chunks/{chunk-KYTQOCDE.js → chunk-HW4N45EE.js} +17 -46
- package/chunks/{chunk-VXGPYF7U.js → chunk-IFEWJXFS.js} +1 -1
- package/chunks/chunk-II73RK2S.js +158 -0
- package/chunks/{chunk-TENOUWY2.js → chunk-IJRL2S3D.js} +3 -3
- package/chunks/{chunk-GQBRGBLS.js → chunk-J43WPR6U.js} +9 -9
- package/chunks/{chunk-SRNPMG7J.js → chunk-JYOWO2F7.js} +16 -10
- package/chunks/{chunk-57NRQM3P.js → chunk-K34DD7FH.js} +2 -2
- package/chunks/{chunk-O2RJARYU.js → chunk-KKWO4IX2.js} +1409 -4088
- package/chunks/{chunk-SOT7OMGL.js → chunk-KT3SI3CQ.js} +2 -2
- package/chunks/{chunk-NUK2PFSU.js → chunk-L7IWK7JY.js} +1 -1
- package/chunks/{chunk-MHQKYQDS.js → chunk-LC4SMGYY.js} +158 -3
- package/chunks/chunk-LGFAYIKX.js +115 -0
- package/chunks/{chunk-MBWLP5OT.js → chunk-LKXDC3AW.js} +162 -40
- package/chunks/{chunk-7Z6UEJA4.js → chunk-ME344634.js} +5 -2
- package/chunks/{chunk-V6NH3CUC.js → chunk-MOQOAH7N.js} +3 -3
- package/chunks/{chunk-FPHA7WIZ.js → chunk-MYZWWRVW.js} +3 -3
- package/chunks/{chunk-YHTNWGRR.js → chunk-MZ7BABX3.js} +1 -1
- package/chunks/chunk-N74BA4VP.js +949 -0
- package/chunks/{chunk-B236XPGF.js → chunk-NQKLOAVJ.js} +29 -2
- package/chunks/{chunk-LXFCHX4X.js → chunk-OU6FPTJZ.js} +312 -25
- package/chunks/{chunk-HTWHAN44.js → chunk-PC4ZXHU2.js} +1 -1
- package/chunks/{chunk-3X76L4UF.js → chunk-PLGONYEL.js} +5 -5
- package/chunks/{chunk-WXUDZHOJ.js → chunk-PVXPDMGP.js} +10 -2
- package/chunks/{chunk-ZO5EA3XJ.js → chunk-QCSLZO6J.js} +1 -1
- package/chunks/{chunk-CEYA7K7C.js → chunk-QHT5USLK.js} +62 -12
- package/chunks/{chunk-NPQWQYU6.js → chunk-QYNNN7BK.js} +1 -1
- package/chunks/{chunk-N4YJQTRL.js → chunk-RFIL6REB.js} +71 -2
- package/chunks/{chunk-KSPVDFE4.js → chunk-SAIILPQ3.js} +0 -3
- package/chunks/{chunk-OIFSBXSP.js → chunk-SJHAUELE.js} +3 -3
- package/chunks/{chunk-BZHLWC6T.js → chunk-SUAKHHK7.js} +2 -2
- package/chunks/{chunk-QOKV6AO4.js → chunk-T2EJHSE3.js} +184 -147
- package/chunks/{chunk-ZI4MGBB5.js → chunk-TBAZMRW3.js} +1 -1
- package/chunks/{chunk-6QVRLKTZ.js → chunk-TBLJNMI7.js} +7 -7
- package/chunks/{chunk-J6ABRKAB.js → chunk-TDGF35EN.js} +2 -2
- package/chunks/chunk-TEYGKLIZ.js +167 -0
- package/chunks/{chunk-TOAUDIS7.js → chunk-TLWA7TPR.js} +6 -2
- package/chunks/chunk-UIDXQNMV.js +13 -0
- package/chunks/{chunk-MX7CTJHR.js → chunk-UZCT5OLN.js} +9 -9
- package/chunks/{chunk-LM3YCCZJ.js → chunk-VEB3NYSO.js} +1 -1
- package/chunks/{chunk-UTL7KABL.js → chunk-VQJ64BIQ.js} +7 -7
- package/chunks/{chunk-C2QKQZEQ.js → chunk-VTCPREC7.js} +3 -3
- package/chunks/{chunk-5ES5YPED.js → chunk-VZ7HY3YU.js} +1 -1
- package/chunks/{chunk-QOMAHFYI.js → chunk-W7EEOR7D.js} +3 -3
- package/chunks/{chunk-NVFJSIAX.js → chunk-WMPVYQ4P.js} +1 -1
- package/chunks/{chunk-V5VTULL5.js → chunk-X265R5C6.js} +3 -3
- package/chunks/{chunk-LKWAVAB5.js → chunk-X2XNQQJI.js} +2 -2
- package/chunks/{chunk-MJKMIQMK.js → chunk-X3YGAX7V.js} +1 -1
- package/chunks/{chunk-5WQF27GW.js → chunk-XQ2GVLNJ.js} +1 -1
- package/chunks/chunk-XUSONNJ4.js +28 -0
- package/chunks/{chunk-DXXNMPJH.js → chunk-YMWIKAEE.js} +460 -93
- package/chunks/{chunk-A34EPIUV.js → chunk-YYU6H66M.js} +18 -15
- package/chunks/{chunk-XH7H6YG4.js → chunk-ZK5EI6NR.js} +4 -107
- package/chunks/{computer-use-5S3NVXRA.js → computer-use-4CTF6WS3.js} +24 -24
- package/chunks/{contextCommand-DPBALZFK.js → contextCommand-Z3XWQCY6.js} +28 -27
- package/chunks/{cron-create-7JYUDTUY.js → cron-create-JSXEIPVS.js} +4 -4
- package/chunks/{cron-delete-YPULQQAK.js → cron-delete-OIFVEPGU.js} +4 -4
- package/chunks/{cron-list-HJIW5MHP.js → cron-list-D4ZX4IOE.js} +11 -7
- package/chunks/{daemon-7XYW4BC3.js → daemon-F3I2RXP6.js} +208 -63
- package/chunks/daemon-status-provider-6A4QCG6Q.js +74 -0
- package/chunks/dist-573HNSVO.js +3217 -0
- package/chunks/{dist-ABQ7VWRR.js → dist-FQ5WRJPL.js} +2 -2
- package/chunks/{dist-JPSVN367.js → dist-IMFFBMAT.js} +6 -3792
- package/chunks/{dist-BV56HW3W.js → dist-OT7G2WNM.js} +250 -1
- package/chunks/{dist-AW5ZYMUI.js → dist-PKFTNUHO.js} +10 -11
- package/chunks/{dist-AAO65DPC.js → dist-YTRKAVUB.js} +1 -1
- package/chunks/{earlyInputCapture-GGPV4IFT.js → earlyInputCapture-7O47HW62.js} +25 -25
- package/chunks/{edit-HJ7ISN4C.js → edit-E32KWLF2.js} +25 -25
- package/chunks/{en-XR3S5VWY.js → en-GA2RMXY5.js} +6 -1
- package/chunks/{enter-worktree-2BQT675D.js → enter-worktree-ZKFFMHUD.js} +24 -24
- package/chunks/{enterPlanMode-SJXHJ3WD.js → enterPlanMode-HLDC6NGX.js} +24 -24
- package/chunks/{errors-EVGER4AZ.js → errors-MTIDDXX7.js} +26 -26
- package/chunks/{exit-worktree-RPDDOSPM.js → exit-worktree-YHY72XA2.js} +24 -24
- package/chunks/{exitPlanMode-BQEROAJ7.js → exitPlanMode-JNXKBZ2C.js} +24 -24
- package/chunks/{fast-path-FX2ICJ2O.js → fast-path-DVAGBROV.js} +5 -2
- package/chunks/{fr-MBMNQSQ6.js → fr-GWNQG4XH.js} +4 -0
- package/chunks/{gemini-EHUXCOUI.js → gemini-2TMHJVRC.js} +444 -256
- package/chunks/{geminiContentGenerator-YDUUKAM2.js → geminiContentGenerator-WCH4GWD3.js} +4 -4
- package/chunks/{glob-3VIGV2DL.js → glob-I6Y4AGKO.js} +52 -28
- package/chunks/{grep-4D3S4NUC.js → grep-3P2J3LU5.js} +24 -24
- package/chunks/handleAutoUpdate-4IVRMRG4.js +65 -0
- package/chunks/{initializer-QZTZSSLW.js → initializer-DVNCPVTC.js} +31 -29
- package/chunks/{ja-HFV5QCHR.js → ja-2HOTA47X.js} +4 -0
- package/chunks/{keychain-token-storage-GPAKRDKQ.js → keychain-token-storage-UJV5XP4Z.js} +2 -2
- package/chunks/{list-WQ24EAMK.js → list-4D6QK2KZ.js} +30 -30
- package/chunks/{loadedSettingsAdapter-XV74KOSR.js → loadedSettingsAdapter-GNGELH6Q.js} +28 -28
- package/chunks/{loop-wakeup-34YK7T7O.js → loop-wakeup-OHWEMFP5.js} +5 -5
- package/chunks/{ls-MPD5OJUX.js → ls-L654WOAT.js} +4 -4
- package/chunks/{lsp-72PWTDW7.js → lsp-M35KE54Y.js} +2 -2
- package/chunks/{mcp-CO3MKM7N.js → mcp-2IL72YJP.js} +28 -28
- package/chunks/{monitor-GB56T65A.js → monitor-BLVCZAVX.js} +32 -27
- package/chunks/nonInteractiveCli-UD3V7UOO.js +116 -0
- package/chunks/{notebook-edit-VMXAAE3R.js → notebook-edit-5TVMWIWY.js} +25 -25
- package/chunks/{openaiContentGenerator-GM77FLII.js → openaiContentGenerator-5LJ5A7YY.js} +12 -12
- package/chunks/{pidfile-HFXSHR64.js → pidfile-AN5JQJ2T.js} +25 -25
- package/chunks/{qwenContentGenerator-QSCXQIKJ.js → qwenContentGenerator-E2JSB4FJ.js} +26 -26
- package/chunks/{qwenOAuth2-LWLA6MQG.js → qwenOAuth2-ZV7YLMND.js} +5 -5
- package/chunks/{read-file-SVH6CGQY.js → read-file-N5DEFUDU.js} +8 -8
- package/chunks/{read-mcp-resource-OWOBJY72.js → read-mcp-resource-CNQHBSJM.js} +2 -2
- package/chunks/{record-artifact-URK3YUDJ.js → record-artifact-PP3LKHTS.js} +2 -2
- package/chunks/{ripGrep-JD5O2FLX.js → ripGrep-BLJHTHKE.js} +24 -24
- package/chunks/{run-qwen-serve-FADLRJUN.js → run-qwen-serve-4JDO64RN.js} +785 -35
- package/chunks/{scheduler-Q65SB7DJ.js → scheduler-FQR4XA7J.js} +24 -24
- package/chunks/{send-message-L7OLQEKH.js → send-message-OA6MV4EU.js} +3 -3
- package/chunks/{serve-6ZXAMQ4M.js → serve-ZOCFC7YM.js} +29 -29
- package/chunks/{server-WKDQA6XR.js → server-GEOYEPYT.js} +2504 -439
- package/chunks/{session-STWOX7RA.js → session-NJCONHGX.js} +66 -61
- package/chunks/{settings-LC4CCWQQ.js → settings-QBGGXANI.js} +27 -27
- package/chunks/{shell-FEG3RLPW.js → shell-2DVPSEKT.js} +24 -24
- package/chunks/{skill-XTXAMDAP.js → skill-HIPXUHV7.js} +24 -12
- package/chunks/{spawnChannel-B6JJPBPV.js → spawnChannel-3JYXY52G.js} +27 -27
- package/chunks/{src-HITDGVRM.js → src-NLEX4CUC.js} +91 -36
- package/chunks/{startInteractiveUI-IT423PW4.js → startInteractiveUI-TYGZIU27.js} +6213 -14273
- package/chunks/{syntheticOutput-J3MLCQAR.js → syntheticOutput-F7LSDCAR.js} +3 -3
- package/chunks/{task-create-ELEBZ7H2.js → task-create-RPFZNB4B.js} +7 -7
- package/chunks/{task-list-IEUZLF3Y.js → task-list-TGGJX7EA.js} +5 -5
- package/chunks/{task-stop-QEZW3UDY.js → task-stop-W7NGTMYQ.js} +2 -2
- package/chunks/{task-update-DW36J5P5.js → task-update-5WUG5MVQ.js} +7 -7
- package/chunks/{team-create-DAG6SNHZ.js → team-create-MGX57SZJ.js} +24 -24
- package/chunks/{team-delete-SVITIMBO.js → team-delete-UHQQ2QQX.js} +5 -5
- package/chunks/{team-plan-approval-DRDY5OPC.js → team-plan-approval-BO2N7J3E.js} +24 -24
- package/chunks/{theme-manager-N67EZC6B.js → theme-manager-WU7LOA64.js} +25 -25
- package/chunks/{todoWrite-SFFQHZYY.js → todoWrite-C4ZAMSR3.js} +4 -4
- package/chunks/{tool-search-CMDJ5HGM.js → tool-search-CLBKVEVK.js} +11 -28
- package/chunks/{trustedFolders-JD4QX6UJ.js → trustedFolders-GAQM2GHB.js} +25 -25
- package/chunks/updateCheck-RIK2YIQE.js +65 -0
- package/chunks/{validateNonInterActiveAuth-ADDCGZ6A.js → validateNonInterActiveAuth-NS3GBIJZ.js} +61 -56
- package/chunks/{version-VAONYVE5.js → version-B3RSLP54.js} +2 -1
- package/chunks/{web-fetch-SXAXJHIO.js → web-fetch-UYGMOHW4.js} +5 -5
- package/chunks/{workflow-DG2BR42M.js → workflow-7APPIGND.js} +25 -25
- package/chunks/{workspace-providers-status-XGW5OZTD.js → workspace-providers-status-SC67GLMY.js} +30 -30
- package/chunks/{workspace-service-GX3GGZLU.js → workspace-service-ZJHF22WA.js} +35 -35
- package/chunks/{workspace-skills-status-LFK5WV2V.js → workspace-skills-status-NJEK6P6Y.js} +29 -29
- package/chunks/{write-file-UR7FXWOU.js → write-file-R6Z3VLRY.js} +25 -25
- package/chunks/{zh-FSVJTXA4.js → zh-7XVVRTDH.js} +6 -1
- package/chunks/{zh-TW-66MG4LWL.js → zh-TW-DPH554OG.js} +6 -1
- package/cli.js +19 -11
- package/locales/en.js +9 -2
- package/locales/fr.js +6 -0
- package/locales/ja.js +6 -0
- package/locales/zh-TW.js +9 -2
- package/locales/zh.js +9 -2
- package/node_modules/@qwen-code/audio-capture/package.json +1 -1
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-arm64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-x64/@qwen-code+audio-capture.node +0 -0
- package/node_modules/@qwen-code/audio-capture/prebuilds/win32-x64/@qwen-code+audio-capture.node +0 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-CUpe0ibu.js → arc-C7hjaa7g.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-JvyrY_mK.js → architectureDiagram-3BPJPVTR-pm9KtMZY.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CK3Y_vom.js → blockDiagram-GPEHLZMM-CApElKsU.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DprSnyrf.js → c4Diagram-AAUBKEIU-BeDe0-9N.js} +1 -1
- package/web-shell/assets/channel-BNf1dW-j.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DJtRJPmu.js → chunk-2J33WTMH-DJEkmLdl.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-ON6Q2-BG.js → chunk-4BX2VUAB-DXX8gdpe.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-c60ou5HZ.js → chunk-55IACEB6-DORmk1kQ.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-BamtPKxx.js → chunk-727SXJPM-DWmO4mCZ.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-CsVgpu-T.js → chunk-AQP2D5EJ-C7LRaYw2.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-vZrpjAx4.js → chunk-FMBD7UC4-CCdXgyC5.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-qxyNOd5t.js → chunk-ND2GUHAM-SyL_xvWc.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-BvTJSM_S.js → chunk-QZHKN3VN-BzOuCKxa.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-uOIGlzgi.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-uOIGlzgi.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-1tXB4pju.js → cose-bilkent-S5V4N54A-BMPWyDKc.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DglBzme8.js → dagre-BM42HDAG-B_GnPWik.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-DEJpqsWz.js → diagram-2AECGRRQ-fJqMc3S_.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-CsQ1NrMG.js → diagram-5GNKFQAL-ximV3O9D.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-Z-3codAi.js → diagram-KO2AKTUF-2vVyjzqw.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-mBuPTA2i.js → diagram-LMA3HP47-Dckcx1sT.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-tcA3K3s9.js → diagram-OG6HWLK6-BAVv47ga.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-D9bXFRyZ.js → erDiagram-TEJ5UH35-Bn3nf5J0.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-Ck0Py04s.js → flowDiagram-I6XJVG4X-BIbGF9JT.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-rOevCekE.js → ganttDiagram-6RSMTGT7-CDbhb3AH.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-CoPQaLj0.js → gitGraphDiagram-PVQCEYII-CbKG1a_w.js} +1 -1
- package/web-shell/assets/index-CnE2ur2L.js +779 -0
- package/web-shell/assets/index-hSKXrlSE.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-a77CUKoI.js → infoDiagram-5YYISTIA-DUFxTy8m.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DlLgUAO-.js → ishikawaDiagram-YF4QCWOH-D69hrBG8.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-BXR5kVAZ.js → journeyDiagram-JHISSGLW-DsvEw51Y.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-h5CoHZg7.js → kanban-definition-UN3LZRKU-lFFjZEYd.js} +1 -1
- package/web-shell/assets/{linear-BkaREbyD.js → linear-Bo5bWzvo.js} +1 -1
- package/web-shell/assets/{mermaid.core-Bkagz0ng.js → mermaid.core-C_HKMJx5.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D7EMKR_5.js → mindmap-definition-RKZ34NQL-DlV-NUTs.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-DAmPOjsL.js → pieDiagram-4H26LBE5-B2e6FH2a.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-e4WFQkQu.js → quadrantDiagram-W4KKPZXB-D75kSk-b.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-v1zo7OiV.js → requirementDiagram-4Y6WPE33-CQ6xakhM.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-Bstm4aW_.js → sankeyDiagram-5OEKKPKP-J_XTKrcY.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DzcZy6xN.js → sequenceDiagram-3UESZ5HK-D7jTcBtf.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-BEJH6YbH.js → stateDiagram-AJRCARHV-CrlM_OT3.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Bs4TK_84.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-TI1wH-Pm.js → timeline-definition-PNZ67QCA-5oZi76Ef.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-YaH8VDMS.js → vennDiagram-CIIHVFJN-DO5YptPK.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-B80co7OP.js → wardley-L42UT6IY-4t1eJDvM.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-4fHNDEMl.js → wardleyDiagram-YWT4CUSO-DKZc661S.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-DT3q4Z3J.js → xychartDiagram-2RQKCTM6-su9hp08G.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/chunk-L7QPM2YD.js +0 -481
- package/chunks/daemon-status-provider-2EWTHT7Y.js +0 -73
- package/chunks/nonInteractiveCli-HNZRIM5I.js +0 -111
- package/web-shell/assets/channel-BAxQ2-aZ.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Cvd_xhZI.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Cvd_xhZI.js +0 -1
- package/web-shell/assets/index-Cr7MYW6T.css +0 -5
- package/web-shell/assets/index-DCHPAUp3.js +0 -730
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BopifCBI.js +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
DaemonMetricsRing,
|
|
5
|
+
computeCpuPercent
|
|
6
|
+
} from "./chunk-II73RK2S.js";
|
|
3
7
|
import {
|
|
4
8
|
findCliEntryPath
|
|
5
9
|
} from "./chunk-AHNXYU4O.js";
|
|
@@ -9,6 +13,7 @@ import {
|
|
|
9
13
|
import {
|
|
10
14
|
CAPABILITIES_SCHEMA_VERSION,
|
|
11
15
|
ClientMcpSenderRegistry,
|
|
16
|
+
PathMutexRegistry,
|
|
12
17
|
SERVE_CAPABILITY_REGISTRY,
|
|
13
18
|
allowOriginCors,
|
|
14
19
|
allowOriginMode,
|
|
@@ -26,7 +31,7 @@ import {
|
|
|
26
31
|
positiveFiniteOrNull,
|
|
27
32
|
require_express,
|
|
28
33
|
resolveWebShellDir
|
|
29
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RFIL6REB.js";
|
|
30
35
|
import {
|
|
31
36
|
isLoopbackBind
|
|
32
37
|
} from "./chunk-RNBYOUGV.js";
|
|
@@ -46,18 +51,23 @@ import {
|
|
|
46
51
|
getGlobalQwenDirLite,
|
|
47
52
|
resolveConfigPathLite
|
|
48
53
|
} from "./chunk-4RQIB5UZ.js";
|
|
49
|
-
import
|
|
54
|
+
import {
|
|
55
|
+
LOAD_REPLAY_META_KEY
|
|
56
|
+
} from "./chunk-AGHU5VRK.js";
|
|
50
57
|
import {
|
|
51
58
|
canonicalizeWorkspace
|
|
52
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-ER3BKOLB.js";
|
|
53
60
|
import {
|
|
54
61
|
getCliVersion
|
|
55
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-XUSONNJ4.js";
|
|
63
|
+
import "./chunk-43W4YSO6.js";
|
|
56
64
|
import {
|
|
57
65
|
writeStderrLine,
|
|
58
66
|
writeStdoutLine
|
|
59
67
|
} from "./chunk-Y6Z2O3WR.js";
|
|
60
|
-
import
|
|
68
|
+
import {
|
|
69
|
+
isWithinRoot
|
|
70
|
+
} from "./chunk-QYUE6W3T.js";
|
|
61
71
|
import "./chunk-5P5XGNYH.js";
|
|
62
72
|
import "./chunk-SKAZWEV5.js";
|
|
63
73
|
import "./chunk-UWCTAVOD.js";
|
|
@@ -84,7 +94,106 @@ import { X509Certificate } from "node:crypto";
|
|
|
84
94
|
import * as fs from "node:fs";
|
|
85
95
|
import * as https from "node:https";
|
|
86
96
|
import * as path from "node:path";
|
|
87
|
-
import
|
|
97
|
+
import * as os from "node:os";
|
|
98
|
+
import { monitorEventLoopDelay, performance } from "node:perf_hooks";
|
|
99
|
+
|
|
100
|
+
// packages/cli/src/serve/workspace-inputs.ts
|
|
101
|
+
init_esbuild_shims();
|
|
102
|
+
var DuplicateWorkspaceInputError = class extends Error {
|
|
103
|
+
static {
|
|
104
|
+
__name(this, "DuplicateWorkspaceInputError");
|
|
105
|
+
}
|
|
106
|
+
constructor(workspace) {
|
|
107
|
+
super(
|
|
108
|
+
`Duplicate --workspace value resolves to ${JSON.stringify(workspace)}. Multi-workspace serve is not enabled; pass one --workspace.`
|
|
109
|
+
);
|
|
110
|
+
this.name = "DuplicateWorkspaceInputError";
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
var NestedWorkspaceInputError = class extends Error {
|
|
114
|
+
static {
|
|
115
|
+
__name(this, "NestedWorkspaceInputError");
|
|
116
|
+
}
|
|
117
|
+
constructor(parent, child) {
|
|
118
|
+
super(
|
|
119
|
+
`Nested --workspace values are not supported yet: ${JSON.stringify(child)} is inside ${JSON.stringify(parent)}. Multi-workspace serve is not enabled; pass one --workspace.`
|
|
120
|
+
);
|
|
121
|
+
this.name = "NestedWorkspaceInputError";
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
var MultipleWorkspaceInputError = class extends Error {
|
|
125
|
+
static {
|
|
126
|
+
__name(this, "MultipleWorkspaceInputError");
|
|
127
|
+
}
|
|
128
|
+
constructor() {
|
|
129
|
+
super(
|
|
130
|
+
"Multiple --workspace values are not supported yet. Multi-workspace serve is not enabled; pass one --workspace."
|
|
131
|
+
);
|
|
132
|
+
this.name = "MultipleWorkspaceInputError";
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var MissingWorkspaceInputError = class extends Error {
|
|
136
|
+
static {
|
|
137
|
+
__name(this, "MissingWorkspaceInputError");
|
|
138
|
+
}
|
|
139
|
+
constructor() {
|
|
140
|
+
super("--workspace requires a value.");
|
|
141
|
+
this.name = "MissingWorkspaceInputError";
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
function normalizeWorkspaceInputs(workspace) {
|
|
145
|
+
if (Array.isArray(workspace)) {
|
|
146
|
+
if (workspace.length === 0) {
|
|
147
|
+
throw new MissingWorkspaceInputError();
|
|
148
|
+
}
|
|
149
|
+
return workspace.map((value) => String(value));
|
|
150
|
+
}
|
|
151
|
+
if (workspace === void 0) return [process.cwd()];
|
|
152
|
+
return [String(workspace)];
|
|
153
|
+
}
|
|
154
|
+
__name(normalizeWorkspaceInputs, "normalizeWorkspaceInputs");
|
|
155
|
+
function isNestedWorkspace(parent, child) {
|
|
156
|
+
return parent !== child && isWithinRoot(child, parent);
|
|
157
|
+
}
|
|
158
|
+
__name(isNestedWorkspace, "isNestedWorkspace");
|
|
159
|
+
function rejectUnsupportedMultiWorkspaceInputs(workspaces) {
|
|
160
|
+
if (workspaces.length <= 1) return;
|
|
161
|
+
let canonicalWorkspaces;
|
|
162
|
+
try {
|
|
163
|
+
canonicalWorkspaces = workspaces.map(
|
|
164
|
+
(workspace) => canonicalizeWorkspace(workspace)
|
|
165
|
+
);
|
|
166
|
+
} catch {
|
|
167
|
+
throw new MultipleWorkspaceInputError();
|
|
168
|
+
}
|
|
169
|
+
const seen = /* @__PURE__ */ new Set();
|
|
170
|
+
for (const workspace of canonicalWorkspaces) {
|
|
171
|
+
if (seen.has(workspace)) {
|
|
172
|
+
throw new DuplicateWorkspaceInputError(workspace);
|
|
173
|
+
}
|
|
174
|
+
seen.add(workspace);
|
|
175
|
+
}
|
|
176
|
+
for (let i = 0; i < canonicalWorkspaces.length; i++) {
|
|
177
|
+
for (let j = i + 1; j < canonicalWorkspaces.length; j++) {
|
|
178
|
+
const first = canonicalWorkspaces[i];
|
|
179
|
+
const second = canonicalWorkspaces[j];
|
|
180
|
+
if (isNestedWorkspace(first, second)) {
|
|
181
|
+
throw new NestedWorkspaceInputError(first, second);
|
|
182
|
+
}
|
|
183
|
+
if (isNestedWorkspace(second, first)) {
|
|
184
|
+
throw new NestedWorkspaceInputError(second, first);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
throw new MultipleWorkspaceInputError();
|
|
189
|
+
}
|
|
190
|
+
__name(rejectUnsupportedMultiWorkspaceInputs, "rejectUnsupportedMultiWorkspaceInputs");
|
|
191
|
+
function resolveSingleWorkspaceInput(workspace) {
|
|
192
|
+
const workspaces = normalizeWorkspaceInputs(workspace);
|
|
193
|
+
rejectUnsupportedMultiWorkspaceInputs(workspaces);
|
|
194
|
+
return workspaces[0];
|
|
195
|
+
}
|
|
196
|
+
__name(resolveSingleWorkspaceInput, "resolveSingleWorkspaceInput");
|
|
88
197
|
|
|
89
198
|
// packages/cli/src/serve/permission-audit.ts
|
|
90
199
|
init_esbuild_shims();
|
|
@@ -295,26 +404,35 @@ function isOptedOut() {
|
|
|
295
404
|
return ["0", "false", "off", "no"].includes(raw.trim().toLowerCase());
|
|
296
405
|
}
|
|
297
406
|
__name(isOptedOut, "isOptedOut");
|
|
298
|
-
function
|
|
299
|
-
|
|
300
|
-
|
|
407
|
+
function computeWorkspaceHash(boundWorkspace) {
|
|
408
|
+
return crypto.createHash("sha256").update(boundWorkspace).digest("hex").slice(0, 8);
|
|
409
|
+
}
|
|
410
|
+
__name(computeWorkspaceHash, "computeWorkspaceHash");
|
|
411
|
+
function computeDaemonId(pid) {
|
|
412
|
+
return `daemon:${pid}`;
|
|
301
413
|
}
|
|
302
414
|
__name(computeDaemonId, "computeDaemonId");
|
|
415
|
+
function computeDaemonLogFileName(pid) {
|
|
416
|
+
return `serve-${pid}.log`;
|
|
417
|
+
}
|
|
418
|
+
__name(computeDaemonLogFileName, "computeDaemonLogFileName");
|
|
303
419
|
function initDaemonLogger(opts) {
|
|
304
420
|
if (isOptedOut()) return NOOP_LOGGER;
|
|
305
421
|
const pid = opts.pid ?? process.pid;
|
|
306
422
|
const now = opts.now ?? (() => /* @__PURE__ */ new Date());
|
|
307
423
|
const stderr = opts.stderr ?? writeStderrLine;
|
|
308
424
|
const baseDir = opts.baseDir ?? resolveDaemonLogBaseDir();
|
|
309
|
-
const daemonId = computeDaemonId(pid
|
|
425
|
+
const daemonId = computeDaemonId(pid);
|
|
426
|
+
const workspaceHash = computeWorkspaceHash(opts.boundWorkspace);
|
|
310
427
|
const daemonDir = nodePath.join(baseDir, "daemon");
|
|
311
|
-
const logPath = nodePath.join(daemonDir,
|
|
428
|
+
const logPath = nodePath.join(daemonDir, computeDaemonLogFileName(pid));
|
|
312
429
|
try {
|
|
313
430
|
nodeFs.mkdirSync(daemonDir, { recursive: true });
|
|
314
431
|
const firstLine = buildDaemonLogLine({
|
|
315
432
|
level: "INFO",
|
|
316
|
-
message: `daemon started pid=${pid}
|
|
317
|
-
now: now()
|
|
433
|
+
message: `daemon started pid=${pid}`,
|
|
434
|
+
now: now(),
|
|
435
|
+
ctx: { workspace: opts.boundWorkspace, workspaceHash }
|
|
318
436
|
});
|
|
319
437
|
nodeFs.appendFileSync(logPath, firstLine);
|
|
320
438
|
} catch (err) {
|
|
@@ -364,12 +482,445 @@ function initDaemonLogger(opts) {
|
|
|
364
482
|
}
|
|
365
483
|
__name(initDaemonLogger, "initDaemonLogger");
|
|
366
484
|
|
|
485
|
+
// packages/cli/src/serve/large-pipe-frame-observer.ts
|
|
486
|
+
init_esbuild_shims();
|
|
487
|
+
var LARGE_PIPE_FRAME_THRESHOLD_BYTES = 256 * 1024;
|
|
488
|
+
var LARGE_PIPE_FRAME_LOG_LIMIT = 50;
|
|
489
|
+
var LARGE_PIPE_FRAME_LOG_WINDOW_MS = 6e4;
|
|
490
|
+
var LARGE_PIPE_FRAME_EVENT_NAME = "qwen-code.daemon.pipe.large_frame";
|
|
491
|
+
var MAX_ATTR_STRING_LENGTH = 128;
|
|
492
|
+
var MAX_CONTENT_DEPTH = 32;
|
|
493
|
+
var MAX_JSON_APPROX_DEPTH = 32;
|
|
494
|
+
var MAX_RAW_OUTPUT_APPROX_BYTES = LARGE_PIPE_FRAME_THRESHOLD_BYTES;
|
|
495
|
+
var MAX_SUMMARIZED_UPDATES = 500;
|
|
496
|
+
var SUMMARIZED_UPDATE_PREFIX_COUNT = Math.ceil(MAX_SUMMARIZED_UPDATES / 2);
|
|
497
|
+
var SUMMARIZED_UPDATE_SUFFIX_COUNT = MAX_SUMMARIZED_UPDATES - SUMMARIZED_UPDATE_PREFIX_COUNT;
|
|
498
|
+
function createLargePipeFrameObserver(options) {
|
|
499
|
+
const thresholdBytes = options.thresholdBytes ?? LARGE_PIPE_FRAME_THRESHOLD_BYTES;
|
|
500
|
+
const windowMs = options.windowMs ?? LARGE_PIPE_FRAME_LOG_WINDOW_MS;
|
|
501
|
+
const logLimit = options.logLimit ?? LARGE_PIPE_FRAME_LOG_LIMIT;
|
|
502
|
+
const now = options.now ?? Date.now;
|
|
503
|
+
let windowStartedAt = now();
|
|
504
|
+
let emittedInWindow = 0;
|
|
505
|
+
let suppressedCount = 0;
|
|
506
|
+
let suppressedWindowStartMs;
|
|
507
|
+
return (observation) => {
|
|
508
|
+
try {
|
|
509
|
+
if (observation.bytes < thresholdBytes) return;
|
|
510
|
+
const currentTime = now();
|
|
511
|
+
if (currentTime - windowStartedAt >= windowMs) {
|
|
512
|
+
windowStartedAt = currentTime;
|
|
513
|
+
emittedInWindow = 0;
|
|
514
|
+
}
|
|
515
|
+
if (emittedInWindow >= logLimit) {
|
|
516
|
+
suppressedCount += 1;
|
|
517
|
+
suppressedWindowStartMs ??= windowStartedAt;
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
const context = classifyLargePipeFrame(observation, thresholdBytes);
|
|
521
|
+
if (!context) return;
|
|
522
|
+
if (suppressedCount > 0) {
|
|
523
|
+
context["suppressedCount"] = suppressedCount;
|
|
524
|
+
if (suppressedWindowStartMs !== void 0) {
|
|
525
|
+
context["suppressedWindowStartMs"] = suppressedWindowStartMs;
|
|
526
|
+
}
|
|
527
|
+
suppressedCount = 0;
|
|
528
|
+
suppressedWindowStartMs = void 0;
|
|
529
|
+
}
|
|
530
|
+
emittedInWindow += 1;
|
|
531
|
+
try {
|
|
532
|
+
options.daemonLog.warn("large ACP pipe frame observed", context);
|
|
533
|
+
} catch {
|
|
534
|
+
}
|
|
535
|
+
try {
|
|
536
|
+
options.emitTelemetryLog?.("Large ACP pipe frame observed.", context, {
|
|
537
|
+
eventName: LARGE_PIPE_FRAME_EVENT_NAME
|
|
538
|
+
});
|
|
539
|
+
} catch {
|
|
540
|
+
}
|
|
541
|
+
} catch {
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
__name(createLargePipeFrameObserver, "createLargePipeFrameObserver");
|
|
546
|
+
function classifyLargePipeFrame(observation, thresholdBytes = LARGE_PIPE_FRAME_THRESHOLD_BYTES) {
|
|
547
|
+
if (observation.bytes < thresholdBytes) return void 0;
|
|
548
|
+
const message = asRecord(observation.message);
|
|
549
|
+
const messageKind = message ? getMessageKind(message) : "unknown";
|
|
550
|
+
const method = message ? stringValue(message["method"]) : void 0;
|
|
551
|
+
const classification = classifySource(message, messageKind, method);
|
|
552
|
+
const context = {
|
|
553
|
+
direction: observation.direction,
|
|
554
|
+
bytes: observation.bytes,
|
|
555
|
+
thresholdBytes,
|
|
556
|
+
messageKind,
|
|
557
|
+
sourceClass: classification.sourceClass
|
|
558
|
+
};
|
|
559
|
+
addString(context, "method", method);
|
|
560
|
+
if (classification.sourceClass === "session_update_notification") {
|
|
561
|
+
addUpdateSummary(context, summarizeUpdate(classification.update));
|
|
562
|
+
} else if (classification.sourceClass === "load_session_bulk_replay_response") {
|
|
563
|
+
addUpdatesSummary(context, classification.replay?.["updates"]);
|
|
564
|
+
} else if (classification.sourceClass === "load_updates_response") {
|
|
565
|
+
addUpdatesSummary(context, classification.result?.["updates"]);
|
|
566
|
+
}
|
|
567
|
+
return context;
|
|
568
|
+
}
|
|
569
|
+
__name(classifyLargePipeFrame, "classifyLargePipeFrame");
|
|
570
|
+
function classifySource(message, messageKind, method) {
|
|
571
|
+
if (!message) return { sourceClass: "unknown" };
|
|
572
|
+
const params = asRecord(message["params"]);
|
|
573
|
+
const update = asRecord(params?.["update"]);
|
|
574
|
+
if (messageKind === "notification" && method === "session/update" && update) {
|
|
575
|
+
return { sourceClass: "session_update_notification", update };
|
|
576
|
+
}
|
|
577
|
+
if (messageKind === "response") {
|
|
578
|
+
const replay = getBulkReplay(message);
|
|
579
|
+
if (replay) {
|
|
580
|
+
return { sourceClass: "load_session_bulk_replay_response", replay };
|
|
581
|
+
}
|
|
582
|
+
const result = asRecord(message["result"]);
|
|
583
|
+
if (isLoadUpdatesResult(result)) {
|
|
584
|
+
return { sourceClass: "load_updates_response", result };
|
|
585
|
+
}
|
|
586
|
+
return { sourceClass: "jsonrpc_response" };
|
|
587
|
+
}
|
|
588
|
+
if (method) return { sourceClass: "jsonrpc_request" };
|
|
589
|
+
return { sourceClass: "unknown" };
|
|
590
|
+
}
|
|
591
|
+
__name(classifySource, "classifySource");
|
|
592
|
+
function getMessageKind(message) {
|
|
593
|
+
const method = stringValue(message["method"]);
|
|
594
|
+
const hasId = Object.hasOwn(message, "id");
|
|
595
|
+
if (method) return hasId ? "request" : "notification";
|
|
596
|
+
if (hasId && (Object.hasOwn(message, "result") || Object.hasOwn(message, "error"))) {
|
|
597
|
+
return "response";
|
|
598
|
+
}
|
|
599
|
+
return "unknown";
|
|
600
|
+
}
|
|
601
|
+
__name(getMessageKind, "getMessageKind");
|
|
602
|
+
function getBulkReplay(message) {
|
|
603
|
+
const result = asRecord(message?.["result"]);
|
|
604
|
+
const meta = asRecord(result?.["_meta"]);
|
|
605
|
+
return asRecord(meta?.[LOAD_REPLAY_META_KEY]);
|
|
606
|
+
}
|
|
607
|
+
__name(getBulkReplay, "getBulkReplay");
|
|
608
|
+
function isLoadUpdatesResult(result) {
|
|
609
|
+
if (!Array.isArray(result?.["updates"])) return false;
|
|
610
|
+
return typeof result["startTime"] === "string" || typeof result["lastUpdated"] === "string" || typeof result["replayError"] === "string" || typeof result["partial"] === "boolean";
|
|
611
|
+
}
|
|
612
|
+
__name(isLoadUpdatesResult, "isLoadUpdatesResult");
|
|
613
|
+
function addUpdatesSummary(context, updates) {
|
|
614
|
+
if (!Array.isArray(updates)) return;
|
|
615
|
+
context["updateCount"] = updates.length;
|
|
616
|
+
const sampledIndexes = sampleUpdateIndexes(updates.length);
|
|
617
|
+
if (sampledIndexes.length < updates.length) {
|
|
618
|
+
context["summarizedUpdateCount"] = sampledIndexes.length;
|
|
619
|
+
context["summarizedUpdateStrategy"] = "prefix_and_suffix";
|
|
620
|
+
}
|
|
621
|
+
const summary = {};
|
|
622
|
+
for (const index of sampledIndexes) {
|
|
623
|
+
mergeUpdateSummary(summary, summarizeUpdate(asRecord(updates[index])));
|
|
624
|
+
}
|
|
625
|
+
addUpdateSummary(context, summary);
|
|
626
|
+
}
|
|
627
|
+
__name(addUpdatesSummary, "addUpdatesSummary");
|
|
628
|
+
function sampleUpdateIndexes(updateCount) {
|
|
629
|
+
if (updateCount <= MAX_SUMMARIZED_UPDATES) {
|
|
630
|
+
return Array.from({ length: updateCount }, (_, index) => index);
|
|
631
|
+
}
|
|
632
|
+
const indexes = [];
|
|
633
|
+
for (let i = 0; i < SUMMARIZED_UPDATE_PREFIX_COUNT; i += 1) {
|
|
634
|
+
indexes.push(i);
|
|
635
|
+
}
|
|
636
|
+
for (let i = updateCount - SUMMARIZED_UPDATE_SUFFIX_COUNT; i < updateCount; i += 1) {
|
|
637
|
+
indexes.push(i);
|
|
638
|
+
}
|
|
639
|
+
return indexes;
|
|
640
|
+
}
|
|
641
|
+
__name(sampleUpdateIndexes, "sampleUpdateIndexes");
|
|
642
|
+
function summarizeUpdate(update) {
|
|
643
|
+
if (!update) return {};
|
|
644
|
+
const meta = asRecord(update["_meta"]);
|
|
645
|
+
const summary = {};
|
|
646
|
+
summary.sessionUpdate = stringValue(update["sessionUpdate"]);
|
|
647
|
+
summary.toolName = stringValue(meta?.["toolName"]);
|
|
648
|
+
summary.toolProvenance = stringValue(meta?.["provenance"]);
|
|
649
|
+
const contentBytes = contentTextBytes(update["content"]);
|
|
650
|
+
if (contentBytes > 0) {
|
|
651
|
+
summary.maxContentTextBytes = contentBytes;
|
|
652
|
+
}
|
|
653
|
+
summary.maxObservedUpdateBytes = contentBytes;
|
|
654
|
+
if (Object.hasOwn(update, "rawOutput")) {
|
|
655
|
+
const rawOutput = update["rawOutput"];
|
|
656
|
+
summary.rawOutputKind = rawOutputKind(rawOutput);
|
|
657
|
+
if (typeof rawOutput === "string") {
|
|
658
|
+
const rawOutputTextBytes = Buffer.byteLength(rawOutput, "utf8");
|
|
659
|
+
summary.maxRawOutputTextBytes = rawOutputTextBytes;
|
|
660
|
+
summary.maxRawOutputObservedBytes = rawOutputTextBytes;
|
|
661
|
+
summary.maxObservedUpdateBytes = Math.max(
|
|
662
|
+
summary.maxObservedUpdateBytes,
|
|
663
|
+
rawOutputTextBytes
|
|
664
|
+
);
|
|
665
|
+
} else {
|
|
666
|
+
const rawOutputApprox = approximateJsonByteLength(rawOutput);
|
|
667
|
+
if (rawOutputApprox !== void 0) {
|
|
668
|
+
summary.maxRawOutputApproxBytes = rawOutputApprox.bytes;
|
|
669
|
+
if (rawOutputApprox.capped) {
|
|
670
|
+
summary.maxRawOutputApproxBytesCapped = true;
|
|
671
|
+
}
|
|
672
|
+
summary.maxRawOutputObservedBytes = rawOutputApprox.bytes;
|
|
673
|
+
summary.maxObservedUpdateBytes = Math.max(
|
|
674
|
+
summary.maxObservedUpdateBytes,
|
|
675
|
+
rawOutputApprox.bytes
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return summary;
|
|
681
|
+
}
|
|
682
|
+
__name(summarizeUpdate, "summarizeUpdate");
|
|
683
|
+
function mergeUpdateSummary(target, next) {
|
|
684
|
+
if (next.sessionUpdate && target.sessionUpdate && next.sessionUpdate !== target.sessionUpdate) {
|
|
685
|
+
target.mixedSessionUpdate = true;
|
|
686
|
+
}
|
|
687
|
+
if (next.mixedSessionUpdate) {
|
|
688
|
+
target.mixedSessionUpdate = true;
|
|
689
|
+
}
|
|
690
|
+
if (next.maxObservedUpdateBytes !== void 0 && (target.maxObservedUpdateBytes === void 0 || next.maxObservedUpdateBytes > target.maxObservedUpdateBytes)) {
|
|
691
|
+
target.maxObservedUpdateBytes = next.maxObservedUpdateBytes;
|
|
692
|
+
target.sessionUpdate = next.sessionUpdate ?? target.sessionUpdate;
|
|
693
|
+
target.toolName = next.toolName ?? target.toolName;
|
|
694
|
+
target.toolProvenance = next.toolProvenance ?? target.toolProvenance;
|
|
695
|
+
}
|
|
696
|
+
if (next.maxContentTextBytes !== void 0 && (target.maxContentTextBytes === void 0 || next.maxContentTextBytes > target.maxContentTextBytes)) {
|
|
697
|
+
target.maxContentTextBytes = next.maxContentTextBytes;
|
|
698
|
+
}
|
|
699
|
+
if (next.maxRawOutputTextBytes !== void 0 && (target.maxRawOutputTextBytes === void 0 || next.maxRawOutputTextBytes > target.maxRawOutputTextBytes)) {
|
|
700
|
+
target.maxRawOutputTextBytes = next.maxRawOutputTextBytes;
|
|
701
|
+
}
|
|
702
|
+
if (next.maxRawOutputApproxBytes !== void 0 && (target.maxRawOutputApproxBytes === void 0 || next.maxRawOutputApproxBytes > target.maxRawOutputApproxBytes)) {
|
|
703
|
+
target.maxRawOutputApproxBytes = next.maxRawOutputApproxBytes;
|
|
704
|
+
}
|
|
705
|
+
if (next.maxRawOutputApproxBytesCapped) {
|
|
706
|
+
target.maxRawOutputApproxBytesCapped = true;
|
|
707
|
+
}
|
|
708
|
+
if (next.maxRawOutputObservedBytes !== void 0 && (target.maxRawOutputObservedBytes === void 0 || next.maxRawOutputObservedBytes > target.maxRawOutputObservedBytes)) {
|
|
709
|
+
target.maxRawOutputObservedBytes = next.maxRawOutputObservedBytes;
|
|
710
|
+
target.rawOutputKind = next.rawOutputKind;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
__name(mergeUpdateSummary, "mergeUpdateSummary");
|
|
714
|
+
function addUpdateSummary(context, summary) {
|
|
715
|
+
addString(context, "sessionUpdate", summary.sessionUpdate);
|
|
716
|
+
addString(context, "toolName", summary.toolName);
|
|
717
|
+
addString(context, "toolProvenance", summary.toolProvenance);
|
|
718
|
+
if (summary.mixedSessionUpdate) context["mixedSessionUpdate"] = true;
|
|
719
|
+
addNumber(context, "maxContentTextBytes", summary.maxContentTextBytes);
|
|
720
|
+
addNumber(context, "maxRawOutputTextBytes", summary.maxRawOutputTextBytes);
|
|
721
|
+
addNumber(
|
|
722
|
+
context,
|
|
723
|
+
"maxRawOutputApproxBytes",
|
|
724
|
+
summary.maxRawOutputApproxBytes
|
|
725
|
+
);
|
|
726
|
+
if (summary.maxRawOutputApproxBytesCapped) {
|
|
727
|
+
context["maxRawOutputApproxBytesCapped"] = true;
|
|
728
|
+
}
|
|
729
|
+
addString(context, "rawOutputKind", summary.rawOutputKind);
|
|
730
|
+
}
|
|
731
|
+
__name(addUpdateSummary, "addUpdateSummary");
|
|
732
|
+
function contentTextBytes(value, depth = 0) {
|
|
733
|
+
if (depth > MAX_CONTENT_DEPTH) return 0;
|
|
734
|
+
if (typeof value === "string") return Buffer.byteLength(value, "utf8");
|
|
735
|
+
if (Array.isArray(value)) {
|
|
736
|
+
return value.reduce(
|
|
737
|
+
(sum, item) => sum + contentTextBytes(item, depth + 1),
|
|
738
|
+
0
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
const record = asRecord(value);
|
|
742
|
+
if (!record) return 0;
|
|
743
|
+
let total = 0;
|
|
744
|
+
const text = stringValue(record["text"]);
|
|
745
|
+
if (text) total += Buffer.byteLength(text, "utf8");
|
|
746
|
+
if (Object.hasOwn(record, "content")) {
|
|
747
|
+
total += contentTextBytes(record["content"], depth + 1);
|
|
748
|
+
}
|
|
749
|
+
return total;
|
|
750
|
+
}
|
|
751
|
+
__name(contentTextBytes, "contentTextBytes");
|
|
752
|
+
function approximateJsonByteLength(value) {
|
|
753
|
+
const state = {
|
|
754
|
+
budget: MAX_RAW_OUTPUT_APPROX_BYTES,
|
|
755
|
+
bytes: 0,
|
|
756
|
+
capped: false,
|
|
757
|
+
seen: /* @__PURE__ */ new WeakSet()
|
|
758
|
+
};
|
|
759
|
+
if (!addJsonValueBytes(value, state, 0)) return void 0;
|
|
760
|
+
return { bytes: state.bytes, capped: state.capped };
|
|
761
|
+
}
|
|
762
|
+
__name(approximateJsonByteLength, "approximateJsonByteLength");
|
|
763
|
+
function addJsonValueBytes(value, state, depth) {
|
|
764
|
+
if (state.capped) return true;
|
|
765
|
+
switch (typeof value) {
|
|
766
|
+
case "string":
|
|
767
|
+
addJsonStringBytes(value, state);
|
|
768
|
+
return true;
|
|
769
|
+
case "number":
|
|
770
|
+
addJsonBytes(state, Number.isFinite(value) ? String(value).length : 4);
|
|
771
|
+
return true;
|
|
772
|
+
case "boolean":
|
|
773
|
+
addJsonBytes(state, value ? 4 : 5);
|
|
774
|
+
return true;
|
|
775
|
+
case "object":
|
|
776
|
+
if (value === null) {
|
|
777
|
+
addJsonBytes(state, 4);
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
if (depth >= MAX_JSON_APPROX_DEPTH) {
|
|
781
|
+
capJsonBytes(state);
|
|
782
|
+
return true;
|
|
783
|
+
}
|
|
784
|
+
if (Array.isArray(value)) {
|
|
785
|
+
addJsonArrayBytes(value, state, depth);
|
|
786
|
+
} else {
|
|
787
|
+
addJsonObjectBytes(value, state, depth);
|
|
788
|
+
}
|
|
789
|
+
return true;
|
|
790
|
+
default:
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
__name(addJsonValueBytes, "addJsonValueBytes");
|
|
795
|
+
function addJsonArrayBytes(value, state, depth) {
|
|
796
|
+
if (state.seen.has(value)) {
|
|
797
|
+
capJsonBytes(state);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
state.seen.add(value);
|
|
801
|
+
addJsonBytes(state, 1);
|
|
802
|
+
for (let i = 0; i < value.length && !state.capped; i += 1) {
|
|
803
|
+
if (i > 0) addJsonBytes(state, 1);
|
|
804
|
+
if (!addJsonValueBytes(value[i], state, depth + 1)) {
|
|
805
|
+
addJsonBytes(state, 4);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
addJsonBytes(state, 1);
|
|
809
|
+
state.seen.delete(value);
|
|
810
|
+
}
|
|
811
|
+
__name(addJsonArrayBytes, "addJsonArrayBytes");
|
|
812
|
+
function addJsonObjectBytes(value, state, depth) {
|
|
813
|
+
if (state.seen.has(value)) {
|
|
814
|
+
capJsonBytes(state);
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
state.seen.add(value);
|
|
818
|
+
addJsonBytes(state, 1);
|
|
819
|
+
const record = value;
|
|
820
|
+
let propertyCount = 0;
|
|
821
|
+
for (const key in record) {
|
|
822
|
+
if (state.capped) break;
|
|
823
|
+
if (!Object.hasOwn(record, key)) continue;
|
|
824
|
+
const item = record[key];
|
|
825
|
+
if (isOmittedJsonObjectValue(item)) continue;
|
|
826
|
+
if (propertyCount > 0) addJsonBytes(state, 1);
|
|
827
|
+
addJsonStringBytes(key, state);
|
|
828
|
+
addJsonBytes(state, 1);
|
|
829
|
+
if (!addJsonValueBytes(item, state, depth + 1)) {
|
|
830
|
+
addJsonBytes(state, 4);
|
|
831
|
+
}
|
|
832
|
+
propertyCount += 1;
|
|
833
|
+
}
|
|
834
|
+
addJsonBytes(state, 1);
|
|
835
|
+
state.seen.delete(value);
|
|
836
|
+
}
|
|
837
|
+
__name(addJsonObjectBytes, "addJsonObjectBytes");
|
|
838
|
+
function addJsonStringBytes(value, state) {
|
|
839
|
+
addJsonBytes(state, 1);
|
|
840
|
+
if (state.capped) return;
|
|
841
|
+
const remainingForContent = Math.max(0, state.budget - state.bytes - 1);
|
|
842
|
+
const sampleLength = Math.min(value.length, remainingForContent);
|
|
843
|
+
const sample = sampleLength < value.length ? value.slice(0, sampleLength) : value;
|
|
844
|
+
addJsonBytes(state, Buffer.byteLength(sample, "utf8"));
|
|
845
|
+
if (sampleLength < value.length) {
|
|
846
|
+
capJsonBytes(state);
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
addJsonBytes(state, 1);
|
|
850
|
+
}
|
|
851
|
+
__name(addJsonStringBytes, "addJsonStringBytes");
|
|
852
|
+
function addJsonBytes(state, bytes) {
|
|
853
|
+
if (state.capped || bytes <= 0) return;
|
|
854
|
+
const nextBytes = state.bytes + bytes;
|
|
855
|
+
if (nextBytes >= state.budget) {
|
|
856
|
+
capJsonBytes(state);
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
state.bytes = nextBytes;
|
|
860
|
+
}
|
|
861
|
+
__name(addJsonBytes, "addJsonBytes");
|
|
862
|
+
function capJsonBytes(state) {
|
|
863
|
+
state.bytes = state.budget;
|
|
864
|
+
state.capped = true;
|
|
865
|
+
}
|
|
866
|
+
__name(capJsonBytes, "capJsonBytes");
|
|
867
|
+
function isOmittedJsonObjectValue(value) {
|
|
868
|
+
return typeof value === "undefined" || typeof value === "function" || typeof value === "symbol";
|
|
869
|
+
}
|
|
870
|
+
__name(isOmittedJsonObjectValue, "isOmittedJsonObjectValue");
|
|
871
|
+
function rawOutputKind(value) {
|
|
872
|
+
if (Array.isArray(value)) return "array";
|
|
873
|
+
if (value === null) return "null";
|
|
874
|
+
return typeof value;
|
|
875
|
+
}
|
|
876
|
+
__name(rawOutputKind, "rawOutputKind");
|
|
877
|
+
function addString(context, key, value) {
|
|
878
|
+
if (value === void 0) return;
|
|
879
|
+
context[key] = value.length > MAX_ATTR_STRING_LENGTH ? value.slice(0, MAX_ATTR_STRING_LENGTH) : value;
|
|
880
|
+
}
|
|
881
|
+
__name(addString, "addString");
|
|
882
|
+
function addNumber(context, key, value) {
|
|
883
|
+
if (value !== void 0) context[key] = value;
|
|
884
|
+
}
|
|
885
|
+
__name(addNumber, "addNumber");
|
|
886
|
+
function stringValue(value) {
|
|
887
|
+
return typeof value === "string" ? value : void 0;
|
|
888
|
+
}
|
|
889
|
+
__name(stringValue, "stringValue");
|
|
890
|
+
function asRecord(value) {
|
|
891
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
892
|
+
}
|
|
893
|
+
__name(asRecord, "asRecord");
|
|
894
|
+
|
|
367
895
|
// packages/cli/src/serve/run-qwen-serve.ts
|
|
368
896
|
var QWEN_SERVE_CLIENT_MCP_OVER_WS_ENV = "QWEN_SERVE_CLIENT_MCP_OVER_WS";
|
|
369
897
|
var QWEN_SERVE_CDP_TUNNEL_OVER_WS_ENV = "QWEN_SERVE_CDP_TUNNEL_OVER_WS";
|
|
370
898
|
var QWEN_SERVE_PROMPT_DEADLINE_MS_ENV = "QWEN_SERVE_PROMPT_DEADLINE_MS";
|
|
371
899
|
var QWEN_SERVE_WRITER_IDLE_TIMEOUT_MS_ENV = "QWEN_SERVE_WRITER_IDLE_TIMEOUT_MS";
|
|
372
900
|
var SHUTDOWN_FORCE_CLOSE_MS = 5e3;
|
|
901
|
+
function daemonPipeDirection(direction) {
|
|
902
|
+
switch (direction) {
|
|
903
|
+
case "sent":
|
|
904
|
+
return "outbound";
|
|
905
|
+
case "received":
|
|
906
|
+
return "inbound";
|
|
907
|
+
default: {
|
|
908
|
+
const exhaustive = direction;
|
|
909
|
+
return exhaustive;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
__name(daemonPipeDirection, "daemonPipeDirection");
|
|
914
|
+
var DAEMON_METRICS_SAMPLE_MS = 5e3;
|
|
915
|
+
var DAEMON_METRICS_CAPACITY = 180;
|
|
916
|
+
function safeCpuUsage() {
|
|
917
|
+
try {
|
|
918
|
+
return process.cpuUsage();
|
|
919
|
+
} catch {
|
|
920
|
+
return null;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
__name(safeCpuUsage, "safeCpuUsage");
|
|
373
924
|
var DEFAULT_RUNTIME_STARTUP_TIMEOUT_MS = 12e4;
|
|
374
925
|
var FAST_PATH_RUNTIME_START_AFTER_HEALTH_MS = 50;
|
|
375
926
|
var FAST_PATH_RUNTIME_START_FALLBACK_MS = 1e3;
|
|
@@ -531,8 +1082,8 @@ __name(withSettingsLock, "withSettingsLock");
|
|
|
531
1082
|
var channelWorkerRuntimePromise;
|
|
532
1083
|
async function loadChannelWorkerRuntime() {
|
|
533
1084
|
channelWorkerRuntimePromise ??= Promise.all([
|
|
534
|
-
import("./channel-worker-supervisor-
|
|
535
|
-
import("./pidfile-
|
|
1085
|
+
import("./channel-worker-supervisor-CRCVYQIE.js"),
|
|
1086
|
+
import("./pidfile-AN5JQJ2T.js")
|
|
536
1087
|
]).then(([supervisor, pidfile]) => ({
|
|
537
1088
|
createChannelWorkerSupervisor: supervisor.createChannelWorkerSupervisor,
|
|
538
1089
|
channelServicePidfile: pidfile
|
|
@@ -603,7 +1154,7 @@ function shouldPreheatBridge(deps) {
|
|
|
603
1154
|
__name(shouldPreheatBridge, "shouldPreheatBridge");
|
|
604
1155
|
var coreRuntimePromise;
|
|
605
1156
|
function loadCoreRuntime() {
|
|
606
|
-
coreRuntimePromise ??= import("./src-
|
|
1157
|
+
coreRuntimePromise ??= import("./src-NLEX4CUC.js");
|
|
607
1158
|
return coreRuntimePromise;
|
|
608
1159
|
}
|
|
609
1160
|
__name(loadCoreRuntime, "loadCoreRuntime");
|
|
@@ -633,9 +1184,9 @@ __name(resolveDaemonLogBaseDirForRun, "resolveDaemonLogBaseDirForRun");
|
|
|
633
1184
|
var settingsRuntimePromise;
|
|
634
1185
|
function loadSettingsRuntimeModules() {
|
|
635
1186
|
settingsRuntimePromise ??= Promise.all([
|
|
636
|
-
import("./settings-
|
|
637
|
-
import("./loadedSettingsAdapter-
|
|
638
|
-
import("./trustedFolders-
|
|
1187
|
+
import("./settings-QBGGXANI.js"),
|
|
1188
|
+
import("./loadedSettingsAdapter-GNGELH6Q.js"),
|
|
1189
|
+
import("./trustedFolders-GAQM2GHB.js")
|
|
639
1190
|
]).then(([settings, loadedSettingsAdapter, trustedFolders]) => ({
|
|
640
1191
|
settings,
|
|
641
1192
|
loadedSettingsAdapter,
|
|
@@ -655,18 +1206,19 @@ async function loadServeRuntimeModules() {
|
|
|
655
1206
|
workspaceProvidersStatusModule,
|
|
656
1207
|
workspaceSkillsStatusModule
|
|
657
1208
|
] = await Promise.all([
|
|
658
|
-
import("./server-
|
|
659
|
-
import("./bridge-
|
|
660
|
-
import("./spawnChannel-
|
|
661
|
-
import("./workspace-service-
|
|
1209
|
+
import("./server-GEOYEPYT.js"),
|
|
1210
|
+
import("./bridge-U6HXOHE7.js"),
|
|
1211
|
+
import("./spawnChannel-3JYXY52G.js"),
|
|
1212
|
+
import("./workspace-service-ZJHF22WA.js"),
|
|
662
1213
|
import("./types-QX5C3CHJ.js"),
|
|
663
|
-
import("./daemon-status-provider-
|
|
664
|
-
import("./workspace-providers-status-
|
|
665
|
-
import("./workspace-skills-status-
|
|
1214
|
+
import("./daemon-status-provider-6A4QCG6Q.js"),
|
|
1215
|
+
import("./workspace-providers-status-SC67GLMY.js"),
|
|
1216
|
+
import("./workspace-skills-status-NJEK6P6Y.js")
|
|
666
1217
|
]);
|
|
667
1218
|
return {
|
|
668
1219
|
createServeApp: serverModule.createServeApp,
|
|
669
1220
|
getActiveSseCount: serverModule.getActiveSseCount,
|
|
1221
|
+
resolveBoundWorkspacesFromIdeEnv: serverModule.resolveBoundWorkspacesFromIdeEnv,
|
|
670
1222
|
resolveBridgeFsFactory: serverModule.resolveBridgeFsFactory,
|
|
671
1223
|
createAcpSessionBridge: bridgeModule.createAcpSessionBridge,
|
|
672
1224
|
createSpawnChannelFactory: spawnChannelModule.createSpawnChannelFactory,
|
|
@@ -1014,6 +1566,13 @@ function createBootstrapServeApp(input) {
|
|
|
1014
1566
|
read: 0
|
|
1015
1567
|
}
|
|
1016
1568
|
},
|
|
1569
|
+
activity: {
|
|
1570
|
+
activePrompts: 0,
|
|
1571
|
+
pendingPrompts: 0,
|
|
1572
|
+
queuedPrompts: 0,
|
|
1573
|
+
lastActivityAt: null,
|
|
1574
|
+
idleSinceMs: null
|
|
1575
|
+
},
|
|
1017
1576
|
process: process.memoryUsage()
|
|
1018
1577
|
},
|
|
1019
1578
|
...detail.detail === "full" ? {
|
|
@@ -1125,11 +1684,13 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1125
1684
|
const chromeExtensionOriginAllowed = hasChromeExtensionOrigin(
|
|
1126
1685
|
optsIn.allowOrigins
|
|
1127
1686
|
);
|
|
1687
|
+
const rawWorkspace = resolveSingleWorkspaceInput(optsIn.workspace);
|
|
1128
1688
|
const opts = {
|
|
1129
1689
|
...optsIn,
|
|
1130
1690
|
token,
|
|
1131
1691
|
promptDeadlineMs,
|
|
1132
1692
|
writerIdleTimeoutMs,
|
|
1693
|
+
workspace: rawWorkspace,
|
|
1133
1694
|
clientMcpOverWs: optsIn.clientMcpOverWs ?? (!envFlagDisabled(clientMcpOverWsEnv) && clientMcpOverWsEnv !== void 0),
|
|
1134
1695
|
cdpTunnelOverWs: optsIn.cdpTunnelOverWs ?? (!envFlagDisabled(cdpTunnelOverWsEnv) && (cdpTunnelOverWsEnv !== void 0 || chromeExtensionOriginAllowed))
|
|
1135
1696
|
};
|
|
@@ -1269,7 +1830,6 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1269
1830
|
"qwen serve: --allow-private-auth-base-url enabled; /workspace/auth/provider may install localhost/private-network model endpoints. Use only for local development with trusted clients."
|
|
1270
1831
|
);
|
|
1271
1832
|
}
|
|
1272
|
-
const rawWorkspace = opts.workspace ?? process.cwd();
|
|
1273
1833
|
if (!path.isAbsolute(rawWorkspace)) {
|
|
1274
1834
|
throw new Error(
|
|
1275
1835
|
`Invalid --workspace "${rawWorkspace}": must be an absolute path.`
|
|
@@ -1446,6 +2006,7 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1446
2006
|
let runtimeAppForCleanup;
|
|
1447
2007
|
let bridgeRef = deps.bridge;
|
|
1448
2008
|
let daemonEventLoopMonitor;
|
|
2009
|
+
let daemonMetricsSampler;
|
|
1449
2010
|
let runtimeStartupError;
|
|
1450
2011
|
let runtimeStarting;
|
|
1451
2012
|
let markRuntimeReady;
|
|
@@ -1463,6 +2024,8 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1463
2024
|
const disposeDaemonEventLoopMonitor = /* @__PURE__ */ __name(() => {
|
|
1464
2025
|
daemonEventLoopMonitor?.dispose();
|
|
1465
2026
|
daemonEventLoopMonitor = void 0;
|
|
2027
|
+
daemonMetricsSampler?.dispose();
|
|
2028
|
+
daemonMetricsSampler = void 0;
|
|
1466
2029
|
}, "disposeDaemonEventLoopMonitor");
|
|
1467
2030
|
let channelWorker = createDisabledChannelWorkerSupervisor();
|
|
1468
2031
|
const getChannelWorkerSnapshot = /* @__PURE__ */ __name(() => channelWorker.snapshot(), "getChannelWorkerSnapshot");
|
|
@@ -1529,7 +2092,7 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1529
2092
|
createDaemonTelemetryRuntimeConfig(
|
|
1530
2093
|
daemonTelemetrySettings,
|
|
1531
2094
|
resolvedCliVersion,
|
|
1532
|
-
`daemon:${
|
|
2095
|
+
`daemon:${process.pid}`,
|
|
1533
2096
|
{
|
|
1534
2097
|
otlpEndpoint: core.DEFAULT_OTLP_ENDPOINT,
|
|
1535
2098
|
telemetryTarget: core.DEFAULT_TELEMETRY_TARGET
|
|
@@ -1547,17 +2110,41 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1547
2110
|
core.registerDaemonEventLoopLagGauge(
|
|
1548
2111
|
() => currentDaemonEventLoopMonitor.snapshot()
|
|
1549
2112
|
);
|
|
2113
|
+
const metricsRing = new DaemonMetricsRing({
|
|
2114
|
+
capacity: DAEMON_METRICS_CAPACITY
|
|
2115
|
+
});
|
|
1550
2116
|
const pipeStats = {
|
|
1551
2117
|
inbound: { count: 0, totalBytes: 0, maxBytes: 0 },
|
|
1552
2118
|
outbound: { count: 0, totalBytes: 0, maxBytes: 0 }
|
|
1553
2119
|
};
|
|
2120
|
+
const promptQueueWaitStats = {
|
|
2121
|
+
count: 0,
|
|
2122
|
+
totalMs: 0,
|
|
2123
|
+
maxMs: 0,
|
|
2124
|
+
lastMs: null
|
|
2125
|
+
};
|
|
1554
2126
|
const recordPipeMessage = /* @__PURE__ */ __name((direction, bytes) => {
|
|
1555
2127
|
const stats = pipeStats[direction];
|
|
1556
2128
|
stats.count += 1;
|
|
1557
2129
|
stats.totalBytes += bytes;
|
|
1558
2130
|
stats.maxBytes = Math.max(stats.maxBytes, bytes);
|
|
1559
2131
|
core.recordDaemonPipeMessage(direction, bytes);
|
|
2132
|
+
metricsRing.recordPipe(direction, bytes);
|
|
1560
2133
|
}, "recordPipeMessage");
|
|
2134
|
+
const observeLargePipeFrame = createLargePipeFrameObserver({
|
|
2135
|
+
daemonLog,
|
|
2136
|
+
emitTelemetryLog: core.emitDaemonLog
|
|
2137
|
+
});
|
|
2138
|
+
const recordPromptQueueWait = /* @__PURE__ */ __name((durationMs) => {
|
|
2139
|
+
promptQueueWaitStats.count += 1;
|
|
2140
|
+
promptQueueWaitStats.totalMs += durationMs;
|
|
2141
|
+
promptQueueWaitStats.maxMs = Math.max(
|
|
2142
|
+
promptQueueWaitStats.maxMs,
|
|
2143
|
+
durationMs
|
|
2144
|
+
);
|
|
2145
|
+
promptQueueWaitStats.lastMs = durationMs;
|
|
2146
|
+
core.recordDaemonPromptQueueWait(durationMs);
|
|
2147
|
+
}, "recordPromptQueueWait");
|
|
1561
2148
|
const daemonTelemetry = core.createDaemonBridgeTelemetry();
|
|
1562
2149
|
daemonTelemetry.metrics = {
|
|
1563
2150
|
sessionLifecycle(action) {
|
|
@@ -1585,27 +2172,83 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1585
2172
|
}
|
|
1586
2173
|
);
|
|
1587
2174
|
},
|
|
1588
|
-
promptQueueWait
|
|
1589
|
-
|
|
1590
|
-
|
|
2175
|
+
promptQueueWait(durationMs) {
|
|
2176
|
+
recordPromptQueueWait(durationMs);
|
|
2177
|
+
metricsRing.recordPromptQueueWait(durationMs);
|
|
2178
|
+
},
|
|
2179
|
+
promptDuration(durationMs) {
|
|
2180
|
+
core.recordDaemonPromptDuration(durationMs);
|
|
2181
|
+
metricsRing.recordPromptDuration(durationMs);
|
|
2182
|
+
},
|
|
2183
|
+
cancelled: core.recordDaemonCancel,
|
|
2184
|
+
// Per-round model token usage + LLM round-trip time sniffed off
|
|
2185
|
+
// `agent_message_chunk._meta` (`usage` + `durationMs`) at the bridge's
|
|
2186
|
+
// single session/update fan-in. Increments (not cumulative), so the ring
|
|
2187
|
+
// sums tokens per window (token-burn chart) and pools the round-trip times
|
|
2188
|
+
// for the LLM-latency percentiles.
|
|
2189
|
+
tokenUsage(inputTokens, outputTokens, durationMs) {
|
|
2190
|
+
metricsRing.recordTokens(inputTokens, outputTokens);
|
|
2191
|
+
if (typeof durationMs === "number") {
|
|
2192
|
+
metricsRing.recordLlmDuration(durationMs);
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
1591
2195
|
};
|
|
1592
2196
|
const permissionAuditRing = new PermissionAuditRing();
|
|
1593
2197
|
const permissionAuditPublisher = createPermissionAuditPublisher({
|
|
1594
2198
|
ring: permissionAuditRing
|
|
1595
2199
|
});
|
|
1596
2200
|
const customIgnoreFiles = runtimeBootSettings?.merged.context?.fileFiltering?.customIgnoreFiles;
|
|
1597
|
-
const
|
|
2201
|
+
const boundWorkspaces = runtime.resolveBoundWorkspacesFromIdeEnv(
|
|
1598
2202
|
boundWorkspace,
|
|
2203
|
+
void 0,
|
|
2204
|
+
(workspace, index) => {
|
|
2205
|
+
if (index === 0) return true;
|
|
2206
|
+
if (!runtimeBootSettings) {
|
|
2207
|
+
daemonLog.warn(
|
|
2208
|
+
"excluding secondary workspace root because trust settings are unavailable",
|
|
2209
|
+
{ workspace }
|
|
2210
|
+
);
|
|
2211
|
+
return false;
|
|
2212
|
+
}
|
|
2213
|
+
const trustedSecondary = settingsRuntime.trustedFolders.getWorkspaceTrustStatus(
|
|
2214
|
+
runtimeBootSettings.merged,
|
|
2215
|
+
workspace
|
|
2216
|
+
).effective.state === "trusted";
|
|
2217
|
+
if (!trustedSecondary) {
|
|
2218
|
+
daemonLog.warn(
|
|
2219
|
+
"excluding untrusted secondary workspace root from file-system access",
|
|
2220
|
+
{ workspace }
|
|
2221
|
+
);
|
|
2222
|
+
}
|
|
2223
|
+
return trustedSecondary;
|
|
2224
|
+
}
|
|
2225
|
+
);
|
|
2226
|
+
daemonLog.info("daemon workspace roots initialized", {
|
|
2227
|
+
primary: boundWorkspaces[0],
|
|
2228
|
+
secondary: boundWorkspaces.slice(1),
|
|
2229
|
+
ideEnvPresent: !!process.env["QWEN_CODE_IDE_WORKSPACE_PATH"]
|
|
2230
|
+
});
|
|
2231
|
+
const sharedPathLocks = new PathMutexRegistry();
|
|
2232
|
+
const fsFactory = runtime.resolveBridgeFsFactory({
|
|
2233
|
+
// Secondary roots share a write-capable factory only after their own
|
|
2234
|
+
// folder trust check passes; untrusted secondary roots stay outside.
|
|
2235
|
+
boundWorkspaces,
|
|
1599
2236
|
injected: deps.fsFactory,
|
|
1600
2237
|
trusted: trustedWorkspace,
|
|
1601
2238
|
emit: deps.fsAuditEmit,
|
|
2239
|
+
pathLocks: sharedPathLocks,
|
|
1602
2240
|
...customIgnoreFiles !== void 0 ? { customIgnoreFiles } : {}
|
|
1603
2241
|
});
|
|
1604
2242
|
const channelFactory = runtime.createSpawnChannelFactory({
|
|
1605
2243
|
onDiagnosticLine: diagnosticSink,
|
|
1606
2244
|
pipeHooks: {
|
|
1607
2245
|
onMessageSent: /* @__PURE__ */ __name((bytes) => recordPipeMessage("outbound", bytes), "onMessageSent"),
|
|
1608
|
-
onMessageReceived: /* @__PURE__ */ __name((bytes) => recordPipeMessage("inbound", bytes), "onMessageReceived")
|
|
2246
|
+
onMessageReceived: /* @__PURE__ */ __name((bytes) => recordPipeMessage("inbound", bytes), "onMessageReceived"),
|
|
2247
|
+
onMessageObserved: /* @__PURE__ */ __name(({ direction, bytes, message }) => observeLargePipeFrame({
|
|
2248
|
+
direction: daemonPipeDirection(direction),
|
|
2249
|
+
bytes,
|
|
2250
|
+
message
|
|
2251
|
+
}), "onMessageObserved")
|
|
1609
2252
|
},
|
|
1610
2253
|
...opts.experimentalLsp === true ? { extraArgs: ["--experimental-lsp"] } : {}
|
|
1611
2254
|
});
|
|
@@ -1718,22 +2361,123 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1718
2361
|
sseCount: /* @__PURE__ */ __name(() => runtime.getActiveSseCount(), "sseCount"),
|
|
1719
2362
|
heapUsed: /* @__PURE__ */ __name(() => process.memoryUsage().heapUsed, "heapUsed")
|
|
1720
2363
|
});
|
|
2364
|
+
daemonMetricsSampler?.dispose();
|
|
2365
|
+
const metricsLoopDelay = monitorEventLoopDelay({ resolution: 20 });
|
|
2366
|
+
metricsLoopDelay.enable();
|
|
2367
|
+
const cpuCoreCount = os.availableParallelism?.() ?? os.cpus().length ?? 1;
|
|
2368
|
+
let prevCpu = safeCpuUsage();
|
|
2369
|
+
let prevCpuAt = Date.now();
|
|
2370
|
+
let prevRateRejected;
|
|
2371
|
+
const metricsSamplerTimer = setInterval(() => {
|
|
2372
|
+
const nowMs = Date.now();
|
|
2373
|
+
const eventLoopLagP99Ms = metricsLoopDelay.percentile(99) / 1e6;
|
|
2374
|
+
try {
|
|
2375
|
+
const mem = process.memoryUsage();
|
|
2376
|
+
const cpu = safeCpuUsage();
|
|
2377
|
+
const cpuPercent = computeCpuPercent(
|
|
2378
|
+
prevCpu,
|
|
2379
|
+
cpu,
|
|
2380
|
+
nowMs - prevCpuAt,
|
|
2381
|
+
cpuCoreCount
|
|
2382
|
+
);
|
|
2383
|
+
if (cpu) {
|
|
2384
|
+
prevCpu = cpu;
|
|
2385
|
+
prevCpuAt = nowMs;
|
|
2386
|
+
}
|
|
2387
|
+
const acp = app2.locals?.["acpHandle"]?.registry.getSnapshot();
|
|
2388
|
+
const hits = getRateLimiter(app2)?.getHitCounts();
|
|
2389
|
+
const rejectedTotal = hits ? hits.prompt + hits.mutation + hits.read : 0;
|
|
2390
|
+
const rateLimitRejected = prevRateRejected === void 0 ? 0 : Math.max(0, rejectedTotal - prevRateRejected);
|
|
2391
|
+
prevRateRejected = rejectedTotal;
|
|
2392
|
+
const child = bridge.getChildResourceSnapshot?.();
|
|
2393
|
+
if (runtime.getActiveSseCount() > 0 || (acp?.wsStreams ?? 0) > 0) {
|
|
2394
|
+
void bridge.refreshChildResource?.();
|
|
2395
|
+
}
|
|
2396
|
+
metricsRing.sample(nowMs, {
|
|
2397
|
+
cpuPercent,
|
|
2398
|
+
rssBytes: mem.rss,
|
|
2399
|
+
heapUsedBytes: mem.heapUsed,
|
|
2400
|
+
activeSessions: bridge.sessionCount,
|
|
2401
|
+
activePrompts: bridge.activePromptCount,
|
|
2402
|
+
queuedPrompts: bridge.pendingPromptTotal ?? 0,
|
|
2403
|
+
eventLoopLagP99Ms,
|
|
2404
|
+
sseConnections: runtime.getActiveSseCount(),
|
|
2405
|
+
wsConnections: acp?.wsStreams ?? 0,
|
|
2406
|
+
acpConnections: acp?.connectionCount ?? 0,
|
|
2407
|
+
rateLimitRejected,
|
|
2408
|
+
childCpuPercent: child?.cpuPercent ?? 0,
|
|
2409
|
+
childRssBytes: child?.rssBytes ?? 0
|
|
2410
|
+
});
|
|
2411
|
+
} catch (err) {
|
|
2412
|
+
daemonLog.warn(
|
|
2413
|
+
`metrics sampler tick failed: ${err instanceof Error ? err.message : String(err)}`
|
|
2414
|
+
);
|
|
2415
|
+
try {
|
|
2416
|
+
metricsRing.sample(nowMs, {
|
|
2417
|
+
cpuPercent: 0,
|
|
2418
|
+
rssBytes: 0,
|
|
2419
|
+
heapUsedBytes: 0,
|
|
2420
|
+
activeSessions: 0,
|
|
2421
|
+
activePrompts: 0,
|
|
2422
|
+
queuedPrompts: 0,
|
|
2423
|
+
eventLoopLagP99Ms,
|
|
2424
|
+
sseConnections: 0,
|
|
2425
|
+
wsConnections: 0,
|
|
2426
|
+
acpConnections: 0,
|
|
2427
|
+
rateLimitRejected: 0,
|
|
2428
|
+
childCpuPercent: 0,
|
|
2429
|
+
childRssBytes: 0
|
|
2430
|
+
});
|
|
2431
|
+
} catch {
|
|
2432
|
+
}
|
|
2433
|
+
} finally {
|
|
2434
|
+
metricsLoopDelay.reset();
|
|
2435
|
+
}
|
|
2436
|
+
}, DAEMON_METRICS_SAMPLE_MS);
|
|
2437
|
+
metricsSamplerTimer.unref();
|
|
2438
|
+
daemonMetricsSampler = {
|
|
2439
|
+
dispose() {
|
|
2440
|
+
clearInterval(metricsSamplerTimer);
|
|
2441
|
+
metricsLoopDelay.disable();
|
|
2442
|
+
}
|
|
2443
|
+
};
|
|
1721
2444
|
const app2 = runtime.createServeApp(opts, () => actualPort, {
|
|
1722
2445
|
bridge,
|
|
1723
2446
|
webShellDir,
|
|
1724
2447
|
boundWorkspace,
|
|
1725
2448
|
qwenCodeVersion: resolvedCliVersion,
|
|
1726
2449
|
startup,
|
|
1727
|
-
|
|
2450
|
+
// The real long-running daemon keeps scheduled-task sessions resident
|
|
2451
|
+
// (keepalive) and reloads them on boot (rehydration). Off by default so
|
|
2452
|
+
// direct createServeApp embeds/tests don't spawn sessions.
|
|
2453
|
+
manageScheduledTaskSessions: true,
|
|
2454
|
+
fsFactory: runtime.resolveBridgeFsFactory({
|
|
2455
|
+
// REST routes still return primary-relative paths, so keep their
|
|
2456
|
+
// filesystem boundary primary-only until responses carry root IDs.
|
|
2457
|
+
boundWorkspaces: [boundWorkspace],
|
|
2458
|
+
trusted: trustedWorkspace,
|
|
2459
|
+
emit: deps.fsAuditEmit,
|
|
2460
|
+
pathLocks: sharedPathLocks,
|
|
2461
|
+
...customIgnoreFiles !== void 0 ? { customIgnoreFiles } : {}
|
|
2462
|
+
}),
|
|
2463
|
+
primaryWorkspaceTrusted: trustedWorkspace,
|
|
1728
2464
|
daemonLog,
|
|
1729
2465
|
getChannelWorkerSnapshot,
|
|
1730
2466
|
getPerfSnapshot: /* @__PURE__ */ __name(() => ({
|
|
1731
2467
|
eventLoop: currentDaemonEventLoopMonitor.snapshot(),
|
|
2468
|
+
promptQueueWait: {
|
|
2469
|
+
count: promptQueueWaitStats.count,
|
|
2470
|
+
meanMs: promptQueueWaitStats.count === 0 ? 0 : promptQueueWaitStats.totalMs / promptQueueWaitStats.count,
|
|
2471
|
+
maxMs: promptQueueWaitStats.maxMs,
|
|
2472
|
+
lastMs: promptQueueWaitStats.lastMs
|
|
2473
|
+
},
|
|
1732
2474
|
pipe: {
|
|
1733
2475
|
inbound: { ...pipeStats.inbound },
|
|
1734
2476
|
outbound: { ...pipeStats.outbound }
|
|
1735
2477
|
}
|
|
1736
2478
|
}), "getPerfSnapshot"),
|
|
2479
|
+
getMetricsSeries: /* @__PURE__ */ __name(() => metricsRing.snapshot(), "getMetricsSeries"),
|
|
2480
|
+
recordDaemonRequest: /* @__PURE__ */ __name((durationMs, statusCode) => metricsRing.recordRequest(durationMs, statusCode), "recordDaemonRequest"),
|
|
1737
2481
|
workspace: workspaceService,
|
|
1738
2482
|
// Reverse tool channel (#5626): the SAME registry wired into `bridge` above,
|
|
1739
2483
|
// so the WS provider and the child-answering bridge share one sender map.
|
|
@@ -1835,7 +2579,7 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
1835
2579
|
performance.now() - runStartedAt
|
|
1836
2580
|
);
|
|
1837
2581
|
profileCheckpoint("serve_listener_ready");
|
|
1838
|
-
finalizeStartupProfile(
|
|
2582
|
+
finalizeStartupProfile(`serve-${process.pid}`);
|
|
1839
2583
|
const cap = opts.maxConnections ?? 256;
|
|
1840
2584
|
if (cap > 0 && Number.isFinite(cap)) {
|
|
1841
2585
|
server.maxConnections = cap;
|
|
@@ -2140,6 +2884,7 @@ async function runQwenServe(optsIn, deps = {}) {
|
|
|
2140
2884
|
if (closePromise) return closePromise;
|
|
2141
2885
|
closePromise = new Promise((res, rej) => {
|
|
2142
2886
|
shuttingDown = true;
|
|
2887
|
+
app.locals.stopScheduledTaskKeepalive?.();
|
|
2143
2888
|
clearRuntimeStartAfterHealthTimer();
|
|
2144
2889
|
clearRuntimeStartFallbackTimer();
|
|
2145
2890
|
cancelDeferredRuntimeStartup();
|
|
@@ -2322,6 +3067,11 @@ export {
|
|
|
2322
3067
|
validatePolicyConfig,
|
|
2323
3068
|
waitForRuntimeStartingForShutdown
|
|
2324
3069
|
};
|
|
3070
|
+
/**
|
|
3071
|
+
* @license
|
|
3072
|
+
* Copyright 2026 Qwen Team
|
|
3073
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3074
|
+
*/
|
|
2325
3075
|
/**
|
|
2326
3076
|
* @license
|
|
2327
3077
|
* Copyright 2025 Qwen Team
|