@qwen-code/qwen-code 0.19.4 → 0.19.5-nightly.20260703.b16baf1ff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/settings.md +22 -6
- package/bundled/qc-helper/docs/features/commands.md +41 -34
- package/bundled/qc-helper/docs/features/headless.md +19 -18
- package/bundled/qc-helper/docs/qwen-serve.md +34 -0
- package/bundled/qc-helper/docs/support/troubleshooting.md +5 -0
- package/chunks/{MaxSizedBox-ERTNFI22.js → MaxSizedBox-42KZ5OFE.js} +12 -11
- package/chunks/{StandaloneSessionPicker-Y5NGRLRY.js → StandaloneSessionPicker-G4VTICMM.js} +23 -22
- package/chunks/{acpAgent-UMN6OYTR.js → acpAgent-6O25PA3M.js} +82 -78
- package/chunks/{agent-56DZU4ZU.js → agent-SNVTRNV7.js} +9 -8
- package/chunks/{agent-headless-SR7N2IJG.js → agent-headless-LNKVTSBX.js} +9 -8
- package/chunks/{anthropicContentGenerator-5OZFO6WQ.js → anthropicContentGenerator-WL3LJOUB.js} +99 -23
- package/chunks/{artifact-tool-JVZMHA4B.js → artifact-tool-W76WC2JX.js} +1 -1
- package/chunks/{askUserQuestion-CMJZ2F3D.js → askUserQuestion-J3P6TH3V.js} +1 -1
- package/chunks/{bridge-AUHNFOUS.js → bridge-AZZAYKI2.js} +15 -13
- package/chunks/{ca-RYOETBUW.js → ca-HCMB2I54.js} +1 -0
- package/chunks/channel-worker-supervisor-C2J3TIOV.js +665 -0
- package/chunks/{chunk-W2ZOAX7F.js → chunk-26UO4PLG.js} +3 -3
- package/chunks/chunk-2Z43HUXT.js +99 -0
- package/chunks/{chunk-VKGG724L.js → chunk-3GCPLNVF.js} +11 -10
- package/chunks/chunk-3RW4AZJV.js +5063 -0
- package/chunks/{chunk-6AQR7732.js → chunk-46IAL3RB.js} +1 -1
- package/chunks/{chunk-QAFQLTXG.js → chunk-4JWM2UGC.js} +1 -1
- package/chunks/{chunk-C2IHHGBZ.js → chunk-4PGQKUIV.js} +10 -10
- package/chunks/{chunk-PPFWEV7G.js → chunk-4RQIB5UZ.js} +62 -62
- package/chunks/{chunk-L7VH7HQA.js → chunk-4UEWG5AS.js} +29 -4
- package/chunks/{chunk-J3F7X3LW.js → chunk-5B2WNM6V.js} +1 -1
- package/chunks/{chunk-XCUFHOAD.js → chunk-6NHUWPNL.js} +1 -1
- package/chunks/{chunk-HI55Z6PR.js → chunk-7DMQRPC7.js} +401 -58
- package/chunks/{chunk-Q7VHIRDD.js → chunk-7K4G2H2H.js} +1 -1
- package/chunks/{chunk-W6X4FGWX.js → chunk-7XS7CMSU.js} +1 -1
- package/chunks/{chunk-SFN4TEHY.js → chunk-APTOAKV5.js} +4 -4
- package/chunks/{chunk-BNJLLAQ7.js → chunk-AYUVPH6L.js} +1 -1
- package/chunks/chunk-BPFJQGY7.js +193 -0
- package/chunks/{chunk-CUGEBAKG.js → chunk-C47IJLUT.js} +1 -1
- package/chunks/chunk-CXBG27SF.js +35 -0
- package/chunks/{chunk-UQFP2FEF.js → chunk-DG573EOO.js} +1 -1
- package/chunks/{chunk-ND25GXEU.js → chunk-DLJKEPXB.js} +14 -6
- package/chunks/{chunk-MNDTD5E5.js → chunk-DNJ2KHWN.js} +4 -4
- package/chunks/{chunk-KKQWC6WS.js → chunk-DNV4FSN5.js} +1 -1
- package/chunks/chunk-DOYHOG47.js +949 -0
- package/chunks/chunk-E2K45AJ7.js +5448 -0
- package/chunks/{chunk-75X2VLSH.js → chunk-F26BNXI2.js} +26 -5
- package/chunks/{chunk-6TLY5W3B.js → chunk-FB6LGUF4.js} +127 -23
- package/chunks/{chunk-UT5JU5DJ.js → chunk-FEPEMQR4.js} +42 -15
- package/chunks/{chunk-2X2JUE47.js → chunk-FKHE7ZNF.js} +2 -2
- package/chunks/{chunk-YBDZ63KI.js → chunk-FVRLDQ7T.js} +8 -4
- package/chunks/{chunk-DQ74W65K.js → chunk-HCLTQ3PV.js} +47 -20
- package/chunks/{chunk-BQNJBEUA.js → chunk-KFO6YNQT.js} +16 -2
- package/chunks/{chunk-UQYOMM6J.js → chunk-L4CYPEA7.js} +10 -10
- package/chunks/{chunk-MEQWZGK5.js → chunk-L7OJ3ZO3.js} +1 -1
- package/chunks/chunk-LOEYAC6N.js +86 -0
- package/chunks/{chunk-4VZH35PN.js → chunk-MTNTVOJR.js} +2 -0
- package/chunks/{chunk-6CIIP6OE.js → chunk-O2EZ4VRP.js} +3 -3
- package/chunks/{chunk-ZJP5T7IA.js → chunk-ODPWORQZ.js} +1 -1
- package/chunks/{chunk-TTFNVEO5.js → chunk-P5GH4DTN.js} +3 -3
- package/chunks/{chunk-7KPI4LAI.js → chunk-QURP4S5U.js} +3 -3
- package/chunks/{chunk-UANCYOOQ.js → chunk-R6RI2HIC.js} +1 -1
- package/chunks/{chunk-FYKX6XOT.js → chunk-RBLDOR7U.js} +1 -1
- package/chunks/{chunk-EDAGQADF.js → chunk-S6RLAIUR.js} +2 -0
- package/chunks/chunk-SIUQ3YYX.js +78 -0
- package/chunks/{chunk-GICCHL2Q.js → chunk-STP6AYKH.js} +1 -1
- package/chunks/{chunk-HJDF3ZVU.js → chunk-UEGNXWAX.js} +6 -6
- package/chunks/{chunk-PIYV6COW.js → chunk-UTWYG2WA.js} +1 -1
- package/chunks/{chunk-QMIND2AS.js → chunk-UY2TCIZS.js} +15 -1
- package/chunks/{chunk-CG7SVARK.js → chunk-VDIZBM46.js} +2 -2
- package/chunks/{chunk-73H73ASU.js → chunk-VJSWLYUL.js} +1 -1
- package/chunks/{chunk-FNLXLI4I.js → chunk-WMLQKZ64.js} +2 -2
- package/chunks/{chunk-KVPFPC4J.js → chunk-WSAAEPPQ.js} +14 -14
- package/chunks/{chunk-BFG6OZN7.js → chunk-WWOVV2PW.js} +3742 -2737
- package/chunks/{chunk-MKHC4BYZ.js → chunk-XAVV2JAM.js} +21 -5
- package/chunks/{chunk-ZXCVPMIK.js → chunk-XR7W5VRL.js} +167 -54
- package/chunks/{chunk-CS5XYDBO.js → chunk-XS7IHJ63.js} +5 -5
- package/chunks/{chunk-B7KGXIPZ.js → chunk-YCU7QV7Q.js} +11 -4
- package/chunks/{chunk-OJCECIJA.js → chunk-YHTNWGRR.js} +5 -4
- package/chunks/{chunk-7VPC7D7O.js → chunk-YLQSGKAN.js} +2 -2
- package/chunks/{chunk-OAFUMTWW.js → chunk-Z75MFQFL.js} +2 -2
- package/chunks/{chunk-HRZB5CSC.js → chunk-ZRHHQFV4.js} +1 -1
- package/chunks/{computer-use-VWN5HH6A.js → computer-use-UHZAYYGO.js} +9 -8
- package/chunks/{contextCommand-DFFG5KDJ.js → contextCommand-X4WOJ2L4.js} +11 -10
- package/chunks/{cron-create-CSSWJ67I.js → cron-create-6YTCOX6P.js} +1 -1
- package/chunks/{cron-delete-E56CFQ7A.js → cron-delete-E3NIFSUK.js} +1 -1
- package/chunks/{cron-list-BKSINY6Y.js → cron-list-Q64MNQNE.js} +1 -1
- package/chunks/{daemon-5T6IHWJV.js → daemon-EEB2RYOL.js} +23 -0
- package/chunks/{daemon-status-provider-V5UY7O7J.js → daemon-status-provider-YXWNGOAF.js} +18 -16
- package/chunks/{de-HB5NJXGB.js → de-PLLFDERI.js} +1 -0
- package/chunks/{dist-TAVAGZU6.js → dist-AP5V4WYU.js} +54 -14
- package/chunks/{dist-XBOVZ3R5.js → dist-IZP2VV4C.js} +156 -57
- package/chunks/{dist-B7SSDVWT.js → dist-SNXOUPYS.js} +201 -7
- package/chunks/{dist-2HDL5SHQ.js → dist-X4ZDE726.js} +43 -8
- package/chunks/{dist-BL3SL665.js → dist-Z57Q4YF5.js} +1 -1
- package/chunks/{earlyInputCapture-VVYU4FDO.js → earlyInputCapture-3HUGMAFL.js} +9 -8
- package/chunks/{edit-F35PTMBA.js → edit-QDKRNFZK.js} +14 -17
- package/chunks/{en-FZREZFPO.js → en-M4EBUBNU.js} +2 -0
- package/chunks/{enter-worktree-3DIW7EGJ.js → enter-worktree-ODWIPMOP.js} +9 -8
- package/chunks/{enterPlanMode-QNXT77KP.js → enterPlanMode-XROL6G5C.js} +11 -10
- package/chunks/{errors-M53YG76R.js → errors-RCPBWFTG.js} +11 -10
- package/chunks/{exit-worktree-BSDWNWHZ.js → exit-worktree-BIU7P4TR.js} +9 -8
- package/chunks/{exitPlanMode-EL7AY327.js → exitPlanMode-LWZHZ7CF.js} +107 -12
- package/chunks/{fast-path-DUCSMUFW.js → fast-path-7S4NR2WI.js} +6 -4
- package/chunks/{fast-path-settings-UQLRFDQP.js → fast-path-settings-RCRXH2JG.js} +2 -2
- package/chunks/{fr-XY3NQFCM.js → fr-MBMNQSQ6.js} +1 -0
- package/chunks/{gemini-F3IERB37.js → gemini-W7CZCFFV.js} +75 -67
- package/chunks/{geminiContentGenerator-6OULAKFQ.js → geminiContentGenerator-MWZWJAWR.js} +39 -3
- package/chunks/{glob-ZMLFTD4T.js → glob-GZ4LUOQT.js} +9 -8
- package/chunks/{grep-H5X66EI7.js → grep-BZ34WAQJ.js} +9 -8
- package/chunks/{initializer-LEOT2OLH.js → initializer-W4EUD3H7.js} +14 -13
- package/chunks/{ja-J7YAG7SA.js → ja-HFV5QCHR.js} +1 -0
- package/chunks/{list-M3DKXML6.js → list-S325XJ2Y.js} +16 -15
- package/chunks/{loadedSettingsAdapter-OKMQFGGG.js → loadedSettingsAdapter-QP3XBMQI.js} +14 -13
- package/chunks/{loop-wakeup-FPBAVVPR.js → loop-wakeup-G2EHBRGR.js} +2 -2
- package/chunks/{ls-UGWQXPTY.js → ls-IDHUVSAG.js} +1 -1
- package/chunks/{lsp-24WV7NXB.js → lsp-FSRYXGFT.js} +1 -1
- package/chunks/mcp-LRKXM6OS.js +66 -0
- package/chunks/{monitor-ARL5P45R.js → monitor-7C33CWA5.js} +11 -10
- package/chunks/{nonInteractiveCli-NUVLF3YR.js → nonInteractiveCli-FPZS7ROR.js} +46 -43
- package/chunks/{notebook-edit-ANTZ2DDY.js → notebook-edit-ZXQ25NWU.js} +14 -16
- package/chunks/{openaiContentGenerator-TFGMKGHN.js → openaiContentGenerator-FUQ7GNK6.js} +4 -4
- package/chunks/{pidfile-AWTL4C63.js → pidfile-NPZV5ZIA.js} +10 -9
- package/chunks/{pt-6RTAA6SS.js → pt-2THT3YHA.js} +1 -0
- package/chunks/{qwenContentGenerator-6QWAYTWS.js → qwenContentGenerator-LNEWYA52.js} +10 -9
- package/chunks/{read-file-EJY73XQ3.js → read-file-G6GBNSM3.js} +3 -3
- package/chunks/{read-mcp-resource-NCBTPP7X.js → read-mcp-resource-PIJF24RO.js} +1 -1
- package/chunks/{ripGrep-HC4SA6CQ.js → ripGrep-IGOC7PVL.js} +9 -8
- package/chunks/{ru-AUBGJ2C4.js → ru-Z67YJHBG.js} +1 -0
- package/chunks/{run-qwen-serve-AGLZ642J.js → run-qwen-serve-AAA53KS4.js} +131 -38
- package/chunks/{scheduler-TURO7NGY.js → scheduler-SPGJ7ILO.js} +9 -8
- package/chunks/{send-message-3S2NYS3O.js → send-message-33PYFMCT.js} +15 -1
- package/chunks/{serve-5DAMOIDW.js → serve-37UIHUYP.js} +15 -14
- package/chunks/{server-4AGEK2HC.js → server-MFMOYMEB.js} +187 -173
- package/chunks/{session-7ZOQUC4Y.js → session-XRY2CG4Z.js} +47 -44
- package/chunks/{settings-DR4V6L5Y.js → settings-X5GXXGKH.js} +13 -12
- package/chunks/{shell-H5WFKUXH.js → shell-E5HOWJMT.js} +9 -8
- package/chunks/{skill-ANHU5ZCR.js → skill-FELDZMWO.js} +3 -3
- package/chunks/{spawnChannel-VN5LJV7Z.js → spawnChannel-XLTVHAT6.js} +12 -10
- package/chunks/{src-OVZLTVVM.js → src-ZWPLTWTV.js} +21 -10
- package/chunks/{startInteractiveUI-OA22V32P.js → startInteractiveUI-GO6J3SJ7.js} +2609 -2458
- package/chunks/{syntheticOutput-SV7GBHZ5.js → syntheticOutput-YOSWIHDJ.js} +2 -2
- package/chunks/{task-create-W2H2UJCH.js → task-create-NHS2NGB3.js} +3 -2
- package/chunks/{task-list-THBOPV4G.js → task-list-5UIB564R.js} +1 -1
- package/chunks/{task-stop-33FVCNCJ.js → task-stop-HGXZ2VZ3.js} +1 -1
- package/chunks/{task-update-LVFQLXEI.js → task-update-IYYWUILG.js} +34 -2
- package/chunks/{team-create-OYL5CAQO.js → team-create-WWMKZ3UO.js} +9 -8
- package/chunks/{team-delete-NTUQ25UY.js → team-delete-FEKJCU4P.js} +1 -1
- package/chunks/team-plan-approval-CUNEZJOV.js +202 -0
- package/chunks/{theme-manager-XCMPF2SI.js → theme-manager-LRBEA5ID.js} +9 -8
- package/chunks/{todoWrite-SEPO2RI3.js → todoWrite-TKMVZ2HT.js} +1 -1
- package/chunks/{tool-search-YXW55X6Z.js → tool-search-L57ZRBJF.js} +8 -6
- package/chunks/{trustedFolders-TEPGM5YL.js → trustedFolders-DYAOFXN2.js} +10 -9
- package/chunks/{validateNonInterActiveAuth-OQIS7WUE.js → validateNonInterActiveAuth-AB4C2FLG.js} +43 -40
- package/chunks/version-2A66AIB2.js +10 -0
- package/chunks/{web-fetch-OE7LHURA.js → web-fetch-J4PIW36Q.js} +2 -2
- package/chunks/{workflow-RTUWORAP.js → workflow-H7YLGTBI.js} +12 -11
- package/chunks/{workspace-providers-status-DM2XANVB.js → workspace-providers-status-UUIBOTKI.js} +16 -15
- package/chunks/{workspace-service-VKBI2KZD.js → workspace-service-FATHYK5C.js} +21 -20
- package/chunks/workspace-skills-status-KIC3KYPR.js +62 -0
- package/chunks/{write-file-WGALQ53L.js → write-file-ETGUMYAK.js} +14 -18
- package/chunks/yargs-B64EYTCF.js +10 -0
- package/chunks/{zh-V3B4TFWL.js → zh-SLZNSSZB.js} +2 -0
- package/chunks/{zh-TW-6GIKXEAN.js → zh-TW-P53C2SL5.js} +2 -0
- package/cli-entry.js +81 -8
- package/cli.js +348 -55
- package/locales/ca.js +2 -0
- package/locales/de.js +2 -0
- package/locales/en.js +3 -0
- package/locales/fr.js +2 -0
- package/locales/ja.js +2 -0
- package/locales/pt.js +2 -0
- package/locales/ru.js +2 -0
- package/locales/zh-TW.js +3 -0
- package/locales/zh.js +3 -0
- 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 +6 -15
- package/web-shell/assets/{arc-Det5Ccum.js → arc-QjIJgYzv.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-DqNWVFpl.js → architectureDiagram-3BPJPVTR-DJkZ9KoB.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CYl7tYBi.js → blockDiagram-GPEHLZMM-BlNeekUB.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-DaAEi0NQ.js → c4Diagram-AAUBKEIU-B6FDrE3D.js} +1 -1
- package/web-shell/assets/channel-M6R-XOoS.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-Df2CDEE2.js → chunk-2J33WTMH-CZO5-3og.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DNBFcyL2.js → chunk-4BX2VUAB-CZ2VJPFe.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-BKjF-0HI.js → chunk-55IACEB6-3zVP6pGF.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-DYwAwfIM.js → chunk-727SXJPM-omuP8Zhh.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C6FswLqy.js → chunk-AQP2D5EJ-BK6Ivmyv.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-DRWAcZSY.js → chunk-FMBD7UC4-NLjjxV0s.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-AoL16mNR.js → chunk-ND2GUHAM-Dc0JTV8t.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-a8PtLMck.js → chunk-QZHKN3VN-ZYp-8jN-.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-B7rcL2Jc.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B7rcL2Jc.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-C4Aeu5qf.js → cose-bilkent-S5V4N54A-BNu1jqy7.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-BOulamjo.js → dagre-BM42HDAG-0AHvPm2v.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-D1wt2ykO.js → diagram-2AECGRRQ-BJsDQdp0.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-BRseus-O.js → diagram-5GNKFQAL-C1gNnoxj.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-XSMkNzpZ.js → diagram-KO2AKTUF-FmgehSoq.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-21KNLqoi.js → diagram-LMA3HP47-i7_13R2F.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DnUI8F5G.js → diagram-OG6HWLK6-DkUUR1x-.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BVSOMuM2.js → erDiagram-TEJ5UH35-BcwJzw0n.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-fYtDPJsW.js → flowDiagram-I6XJVG4X-CCPgwkQS.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-CmRXosW_.js → ganttDiagram-6RSMTGT7-C3g0sliF.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DPrmySxO.js → gitGraphDiagram-PVQCEYII-DLt4J_oG.js} +1 -1
- package/web-shell/assets/index-9qfvU0_r.css +5 -0
- package/web-shell/assets/index-DasTT8n6.js +717 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-x3VbEuCV.js → infoDiagram-5YYISTIA-DMO0nW8F.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-SmitHRMC.js → ishikawaDiagram-YF4QCWOH-qSN9LjC5.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-BxvA551S.js → journeyDiagram-JHISSGLW-CQZH-jC2.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-DNHC16jY.js → kanban-definition-UN3LZRKU-Cu6qk5En.js} +1 -1
- package/web-shell/assets/{linear-CQ6irBL9.js → linear-Dpp4BWJF.js} +1 -1
- package/web-shell/assets/{mermaid.core-DtB6NO1e.js → mermaid.core-DDAcmZsz.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-QKMAgV2v.js → mindmap-definition-RKZ34NQL-G3JXxnUU.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-bvb6dGn6.js → pieDiagram-4H26LBE5-ABQwHraX.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DLgdlG4D.js → quadrantDiagram-W4KKPZXB-BUWZV-ho.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-2M9YH4GF.js → requirementDiagram-4Y6WPE33-XHg5n00A.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-DzwfclTH.js → sankeyDiagram-5OEKKPKP-Bwzw0RtM.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BvPmTuy2.js → sequenceDiagram-3UESZ5HK-CGYLtnFV.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-BjwUmrJF.js → stateDiagram-AJRCARHV-BG1UhKch.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CSG8MpoN.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-CXzS6qqz.js → timeline-definition-PNZ67QCA-B_tY-Dyz.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-yRSolF5B.js → vennDiagram-CIIHVFJN-Crp_Rw_L.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-ClLJjHPG.js → wardley-L42UT6IY-DR27pFXX.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-VIa6t2p2.js → wardleyDiagram-YWT4CUSO-BM_CRFgm.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-CtmrkezW.js → xychartDiagram-2RQKCTM6-DO2Z2lWl.js} +1 -1
- package/web-shell/index.html +28 -3
- package/chunks/channel-worker-supervisor-A74FV522.js +0 -308
- package/chunks/chunk-MVZXZWGT.js +0 -11323
- package/chunks/chunk-S5EQPDTM.js +0 -91
- package/patches/chrome-devtools-mcp+1.4.0.patch +0 -31
- package/postinstall.js +0 -50
- package/web-shell/assets/channel-Bm0bFauD.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK--NgUfb55.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2--NgUfb55.js +0 -1
- package/web-shell/assets/index-BpKnmyFV.js +0 -717
- package/web-shell/assets/index-fLrtxpOG.css +0 -5
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-C4L8zXeL.js +0 -1
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
sanitizeLogText
|
|
5
|
+
} from "./chunk-7DMQRPC7.js";
|
|
6
|
+
import {
|
|
7
|
+
CHANNEL_DAEMON_WORKER_SENTINEL,
|
|
8
|
+
CHANNEL_WORKER_HEARTBEAT_INTERVAL_MS,
|
|
9
|
+
QWEN_DAEMON_TOKEN_ENV,
|
|
10
|
+
QWEN_DAEMON_URL_ENV,
|
|
11
|
+
QWEN_DAEMON_WORKSPACE_ENV,
|
|
12
|
+
QWEN_SERVER_TOKEN_ENV
|
|
13
|
+
} from "./chunk-S6RLAIUR.js";
|
|
14
|
+
import {
|
|
15
|
+
channelSelectionNames
|
|
16
|
+
} from "./chunk-MX2YXRER.js";
|
|
17
|
+
import {
|
|
18
|
+
redactLogCredentials
|
|
19
|
+
} from "./chunk-2Z43HUXT.js";
|
|
20
|
+
import "./chunk-UFC57OYT.js";
|
|
21
|
+
import "./chunk-K5PGHDBN.js";
|
|
22
|
+
import {
|
|
23
|
+
init_esbuild_shims
|
|
24
|
+
} from "./chunk-A4BMJM77.js";
|
|
25
|
+
import {
|
|
26
|
+
__name
|
|
27
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
28
|
+
|
|
29
|
+
// packages/cli/src/serve/channel-worker-supervisor.ts
|
|
30
|
+
init_esbuild_shims();
|
|
31
|
+
import { fork } from "node:child_process";
|
|
32
|
+
import { randomUUID } from "node:crypto";
|
|
33
|
+
var DEFAULT_CHANNEL_WORKER_STARTUP_TIMEOUT_MS = 3e4;
|
|
34
|
+
var DEFAULT_CHANNEL_WORKER_HEARTBEAT_TIMEOUT_MS = 45e3;
|
|
35
|
+
var MAX_WORKER_LOG_LINE_LENGTH = 4096;
|
|
36
|
+
var MAX_WORKER_LOG_BUFFER_LENGTH = 64 * 1024;
|
|
37
|
+
var MAX_WORKER_LOG_DISCARDED_REMAINDER_LENGTH = MAX_WORKER_LOG_BUFFER_LENGTH;
|
|
38
|
+
var ANSI_CSI_SEQUENCE_RE = new RegExp(
|
|
39
|
+
`${String.fromCharCode(27)}\\[[0-?]*[ -/]*[@-~]`,
|
|
40
|
+
"g"
|
|
41
|
+
);
|
|
42
|
+
var WORKER_LOG_INVISIBLE_RE = new RegExp("[\\p{Cf}\\u2028\\u2029]|\\p{Variation_Selector}", "gu");
|
|
43
|
+
var WORKER_LOG_CONTROL_RE = /[\x00-\x08\x0a-\x1f\x7f]/g;
|
|
44
|
+
var DEFAULT_RESTART_POLICY = {
|
|
45
|
+
maxRestarts: 3,
|
|
46
|
+
windowMs: 5 * 6e4,
|
|
47
|
+
delaysMs: [1e3, 5e3, 15e3]
|
|
48
|
+
};
|
|
49
|
+
function selectionChannelArgs(selection) {
|
|
50
|
+
return channelSelectionNames(selection).flatMap((name) => [
|
|
51
|
+
"--channel",
|
|
52
|
+
name
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
__name(selectionChannelArgs, "selectionChannelArgs");
|
|
56
|
+
function defaultSpawnWorker(execPath, argv, options) {
|
|
57
|
+
const child = fork(argv[0], argv.slice(1), {
|
|
58
|
+
execPath,
|
|
59
|
+
cwd: options.cwd,
|
|
60
|
+
env: options.env,
|
|
61
|
+
stdio: options.stdio
|
|
62
|
+
});
|
|
63
|
+
return child;
|
|
64
|
+
}
|
|
65
|
+
__name(defaultSpawnWorker, "defaultSpawnWorker");
|
|
66
|
+
function isReadyMessage(message) {
|
|
67
|
+
return typeof message === "object" && message !== null && message.type === "ready";
|
|
68
|
+
}
|
|
69
|
+
__name(isReadyMessage, "isReadyMessage");
|
|
70
|
+
function isHeartbeatMessage(message) {
|
|
71
|
+
return typeof message === "object" && message !== null && message.type === "heartbeat";
|
|
72
|
+
}
|
|
73
|
+
__name(isHeartbeatMessage, "isHeartbeatMessage");
|
|
74
|
+
function requestedChannelNames(selection) {
|
|
75
|
+
return selection.mode === "names" ? [...selection.names] : void 0;
|
|
76
|
+
}
|
|
77
|
+
__name(requestedChannelNames, "requestedChannelNames");
|
|
78
|
+
function workerLogRedactionOptions(daemonToken, workerEnv) {
|
|
79
|
+
return {
|
|
80
|
+
...daemonToken ? { daemonToken } : {},
|
|
81
|
+
workerEnv
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
__name(workerLogRedactionOptions, "workerLogRedactionOptions");
|
|
85
|
+
function sanitizeWorkerError(error, redaction) {
|
|
86
|
+
const normalized = normalizeWorkerLogLineForRedaction(error);
|
|
87
|
+
const redacted = redaction ? redactWorkerLogLine(normalized, redaction) : normalized;
|
|
88
|
+
return Array.from(sanitizeLogText(redacted, 512)).slice(0, 512).join("");
|
|
89
|
+
}
|
|
90
|
+
__name(sanitizeWorkerError, "sanitizeWorkerError");
|
|
91
|
+
function notifyExit(onExit, snapshot) {
|
|
92
|
+
try {
|
|
93
|
+
onExit?.(snapshot);
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
__name(notifyExit, "notifyExit");
|
|
98
|
+
function notifyReady(onReady, snapshot) {
|
|
99
|
+
try {
|
|
100
|
+
onReady?.(snapshot);
|
|
101
|
+
} catch {
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
__name(notifyReady, "notifyReady");
|
|
105
|
+
function notifyLog(onLog, entry) {
|
|
106
|
+
try {
|
|
107
|
+
onLog?.(entry);
|
|
108
|
+
} catch {
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
__name(notifyLog, "notifyLog");
|
|
112
|
+
function waitForExit(child, timeoutMs) {
|
|
113
|
+
return new Promise((resolve) => {
|
|
114
|
+
let settled = false;
|
|
115
|
+
const done = /* @__PURE__ */ __name((exited) => {
|
|
116
|
+
if (settled) return;
|
|
117
|
+
settled = true;
|
|
118
|
+
if (timer) clearTimeout(timer);
|
|
119
|
+
resolve(exited);
|
|
120
|
+
}, "done");
|
|
121
|
+
const timer = setTimeout(() => done(false), timeoutMs);
|
|
122
|
+
timer.unref();
|
|
123
|
+
child.once("exit", () => done(true));
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
__name(waitForExit, "waitForExit");
|
|
127
|
+
function hasObservedExit(snapshot) {
|
|
128
|
+
return snapshot.exitCode !== void 0 || snapshot.signal !== void 0;
|
|
129
|
+
}
|
|
130
|
+
__name(hasObservedExit, "hasObservedExit");
|
|
131
|
+
function createWorkerEnv(opts) {
|
|
132
|
+
const env = { ...process.env };
|
|
133
|
+
env["QWEN_CODE_NO_RELAUNCH"] = "true";
|
|
134
|
+
env[CHANNEL_DAEMON_WORKER_SENTINEL] = randomUUID();
|
|
135
|
+
env[QWEN_DAEMON_URL_ENV] = opts.daemonUrl;
|
|
136
|
+
env[QWEN_DAEMON_WORKSPACE_ENV] = opts.workspace;
|
|
137
|
+
delete env[QWEN_SERVER_TOKEN_ENV];
|
|
138
|
+
delete env[QWEN_DAEMON_TOKEN_ENV];
|
|
139
|
+
if (opts.daemonToken) {
|
|
140
|
+
env[QWEN_DAEMON_TOKEN_ENV] = opts.daemonToken;
|
|
141
|
+
}
|
|
142
|
+
return env;
|
|
143
|
+
}
|
|
144
|
+
__name(createWorkerEnv, "createWorkerEnv");
|
|
145
|
+
function escapeRegExp(value) {
|
|
146
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
147
|
+
}
|
|
148
|
+
__name(escapeRegExp, "escapeRegExp");
|
|
149
|
+
function sensitiveEnvValues(env) {
|
|
150
|
+
const sensitiveKey = /(^|_)(TOKEN|SECRET|API_KEY|ACCESS_KEY|PRIVATE_KEY|CREDENTIAL|PASSWORD|PASSWD|PASSPHRASE|BASIC_AUTH|AUTH_TOKEN|AUTHORIZATION|SESSION_SECRET|SESSION_TOKEN|SESSION_KEY|SESSION_COOKIE|DSN|CONNECTION_STRING)($|_)/i;
|
|
151
|
+
return Object.entries(env).filter(([key, value]) => sensitiveKey.test(key) && value !== void 0).flatMap(([, value]) => {
|
|
152
|
+
const lines = value.split("\n").filter((l) => l.length >= 4);
|
|
153
|
+
return lines.length > 0 ? [value, ...lines] : [value];
|
|
154
|
+
}).filter((value) => value.length >= 4);
|
|
155
|
+
}
|
|
156
|
+
__name(sensitiveEnvValues, "sensitiveEnvValues");
|
|
157
|
+
function redactWorkerLogLine(line, opts) {
|
|
158
|
+
return createWorkerLogRedactor(opts)(line);
|
|
159
|
+
}
|
|
160
|
+
__name(redactWorkerLogLine, "redactWorkerLogLine");
|
|
161
|
+
function createWorkerLogRedactor(opts) {
|
|
162
|
+
const secretPatterns = [
|
|
163
|
+
.../* @__PURE__ */ new Set([
|
|
164
|
+
...opts.daemonToken && opts.daemonToken.length >= 4 ? [opts.daemonToken] : [],
|
|
165
|
+
...sensitiveEnvValues(opts.workerEnv)
|
|
166
|
+
])
|
|
167
|
+
].sort((a, b) => b.length - a.length).map((secret) => new RegExp(escapeRegExp(secret), "g"));
|
|
168
|
+
return (line) => {
|
|
169
|
+
let redacted = line.replace(
|
|
170
|
+
/\b([a-z][a-z0-9+.-]{0,31}:\/\/)([^\s/]*@)([^\s/]+)([^\s]*)/gi,
|
|
171
|
+
"$1<redacted>@$3$4"
|
|
172
|
+
);
|
|
173
|
+
for (const secretPattern of secretPatterns) {
|
|
174
|
+
redacted = redacted.replace(secretPattern, "<redacted>");
|
|
175
|
+
}
|
|
176
|
+
return redactLogCredentials(redacted);
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
__name(createWorkerLogRedactor, "createWorkerLogRedactor");
|
|
180
|
+
function normalizeWorkerLogLineForRedaction(line) {
|
|
181
|
+
return line.replace(ANSI_CSI_SEQUENCE_RE, "").replace(WORKER_LOG_INVISIBLE_RE, "").replace(WORKER_LOG_CONTROL_RE, "");
|
|
182
|
+
}
|
|
183
|
+
__name(normalizeWorkerLogLineForRedaction, "normalizeWorkerLogLineForRedaction");
|
|
184
|
+
function attachWorkerLogStream(stream, streamName, opts) {
|
|
185
|
+
if (!stream) return () => {
|
|
186
|
+
};
|
|
187
|
+
let buffer = "";
|
|
188
|
+
let discardingOversizedLineRemainder = false;
|
|
189
|
+
let discardedOversizedLineRemainderLength = 0;
|
|
190
|
+
const redactWorkerLogLineForStream = createWorkerLogRedactor({
|
|
191
|
+
...opts.daemonToken ? { daemonToken: opts.daemonToken } : {},
|
|
192
|
+
workerEnv: opts.workerEnv
|
|
193
|
+
});
|
|
194
|
+
const flushLine = /* @__PURE__ */ __name((line) => {
|
|
195
|
+
const redacted = redactWorkerLogLineForStream(
|
|
196
|
+
normalizeWorkerLogLineForRedaction(line)
|
|
197
|
+
);
|
|
198
|
+
notifyLog(opts.onLog, {
|
|
199
|
+
stream: streamName,
|
|
200
|
+
line: sanitizeLogText(redacted, MAX_WORKER_LOG_LINE_LENGTH)
|
|
201
|
+
});
|
|
202
|
+
}, "flushLine");
|
|
203
|
+
const flushPartial = /* @__PURE__ */ __name(() => {
|
|
204
|
+
if (buffer.length === 0) return;
|
|
205
|
+
flushLine(buffer);
|
|
206
|
+
buffer = "";
|
|
207
|
+
}, "flushPartial");
|
|
208
|
+
const flushOversizedBuffer = /* @__PURE__ */ __name(() => {
|
|
209
|
+
if (buffer.length <= MAX_WORKER_LOG_BUFFER_LENGTH) return;
|
|
210
|
+
flushLine(buffer);
|
|
211
|
+
buffer = "";
|
|
212
|
+
discardingOversizedLineRemainder = true;
|
|
213
|
+
discardedOversizedLineRemainderLength = 0;
|
|
214
|
+
}, "flushOversizedBuffer");
|
|
215
|
+
stream.on("data", (chunk) => {
|
|
216
|
+
buffer += typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
217
|
+
for (; ; ) {
|
|
218
|
+
const newlineIndex = buffer.search(/\r?\n/);
|
|
219
|
+
if (newlineIndex < 0) break;
|
|
220
|
+
const line = buffer.slice(0, newlineIndex);
|
|
221
|
+
const newlineLength = buffer[newlineIndex] === "\r" && buffer[newlineIndex + 1] === "\n" ? 2 : 1;
|
|
222
|
+
buffer = buffer.slice(newlineIndex + newlineLength);
|
|
223
|
+
if (!discardingOversizedLineRemainder) {
|
|
224
|
+
flushLine(line);
|
|
225
|
+
}
|
|
226
|
+
discardingOversizedLineRemainder = false;
|
|
227
|
+
discardedOversizedLineRemainderLength = 0;
|
|
228
|
+
}
|
|
229
|
+
if (discardingOversizedLineRemainder) {
|
|
230
|
+
discardedOversizedLineRemainderLength += buffer.length;
|
|
231
|
+
buffer = "";
|
|
232
|
+
if (discardedOversizedLineRemainderLength >= MAX_WORKER_LOG_DISCARDED_REMAINDER_LENGTH) {
|
|
233
|
+
discardingOversizedLineRemainder = false;
|
|
234
|
+
discardedOversizedLineRemainderLength = 0;
|
|
235
|
+
}
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
flushOversizedBuffer();
|
|
239
|
+
});
|
|
240
|
+
stream.on("end", flushPartial);
|
|
241
|
+
stream.on("close", flushPartial);
|
|
242
|
+
stream.on("error", () => {
|
|
243
|
+
flushPartial();
|
|
244
|
+
});
|
|
245
|
+
return flushPartial;
|
|
246
|
+
}
|
|
247
|
+
__name(attachWorkerLogStream, "attachWorkerLogStream");
|
|
248
|
+
function createChannelWorkerSupervisor(opts) {
|
|
249
|
+
const spawnWorker = opts.spawnWorker ?? defaultSpawnWorker;
|
|
250
|
+
const restartPolicy = opts.restartPolicy ?? DEFAULT_RESTART_POLICY;
|
|
251
|
+
if (restartPolicy.delaysMs.length === 0) {
|
|
252
|
+
throw new Error("restartPolicy.delaysMs must be non-empty.");
|
|
253
|
+
}
|
|
254
|
+
const heartbeatTimeoutMs = opts.heartbeatTimeoutMs ?? DEFAULT_CHANNEL_WORKER_HEARTBEAT_TIMEOUT_MS;
|
|
255
|
+
if (heartbeatTimeoutMs > 0 && heartbeatTimeoutMs <= CHANNEL_WORKER_HEARTBEAT_INTERVAL_MS) {
|
|
256
|
+
throw new Error(
|
|
257
|
+
`heartbeatTimeoutMs (${heartbeatTimeoutMs}) must exceed the worker heartbeat interval (${CHANNEL_WORKER_HEARTBEAT_INTERVAL_MS}ms) or be 0 to disable.`
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
let child;
|
|
261
|
+
let snapshot = {
|
|
262
|
+
enabled: true,
|
|
263
|
+
state: "disabled",
|
|
264
|
+
channels: channelSelectionNames(opts.selection),
|
|
265
|
+
restartCount: 0
|
|
266
|
+
};
|
|
267
|
+
let stopping = false;
|
|
268
|
+
let restartTimer;
|
|
269
|
+
let staleHeartbeatTimer;
|
|
270
|
+
let restartAttemptTimes = [];
|
|
271
|
+
const snapshotCopy = /* @__PURE__ */ __name(() => ({
|
|
272
|
+
...snapshot,
|
|
273
|
+
channels: [...snapshot.channels],
|
|
274
|
+
...snapshot.requestedChannels ? { requestedChannels: [...snapshot.requestedChannels] } : {}
|
|
275
|
+
}), "snapshotCopy");
|
|
276
|
+
const clearRestartTimer = /* @__PURE__ */ __name(() => {
|
|
277
|
+
if (restartTimer) {
|
|
278
|
+
clearTimeout(restartTimer);
|
|
279
|
+
restartTimer = void 0;
|
|
280
|
+
}
|
|
281
|
+
if (snapshot.nextRestartAt) {
|
|
282
|
+
const next = { ...snapshot };
|
|
283
|
+
delete next.nextRestartAt;
|
|
284
|
+
snapshot = next;
|
|
285
|
+
}
|
|
286
|
+
}, "clearRestartTimer");
|
|
287
|
+
const clearStaleHeartbeatTimer = /* @__PURE__ */ __name(() => {
|
|
288
|
+
if (!staleHeartbeatTimer) return;
|
|
289
|
+
clearTimeout(staleHeartbeatTimer);
|
|
290
|
+
staleHeartbeatTimer = void 0;
|
|
291
|
+
}, "clearStaleHeartbeatTimer");
|
|
292
|
+
const pruneRestartAttempts = /* @__PURE__ */ __name((nowMs) => {
|
|
293
|
+
restartAttemptTimes = restartAttemptTimes.filter(
|
|
294
|
+
(attemptMs) => nowMs - attemptMs < restartPolicy.windowMs
|
|
295
|
+
);
|
|
296
|
+
}, "pruneRestartAttempts");
|
|
297
|
+
const canScheduleRestart = /* @__PURE__ */ __name((nowMs) => {
|
|
298
|
+
pruneRestartAttempts(nowMs);
|
|
299
|
+
return restartAttemptTimes.length < restartPolicy.maxRestarts;
|
|
300
|
+
}, "canScheduleRestart");
|
|
301
|
+
const nextRestartDelayMs = /* @__PURE__ */ __name(() => {
|
|
302
|
+
const index = Math.min(
|
|
303
|
+
restartAttemptTimes.length,
|
|
304
|
+
restartPolicy.delaysMs.length - 1
|
|
305
|
+
);
|
|
306
|
+
return restartPolicy.delaysMs[index] ?? 0;
|
|
307
|
+
}, "nextRestartDelayMs");
|
|
308
|
+
const setExited = /* @__PURE__ */ __name((state, code, signal, error) => {
|
|
309
|
+
const next = {
|
|
310
|
+
...snapshot,
|
|
311
|
+
state,
|
|
312
|
+
exitCode: code,
|
|
313
|
+
signal,
|
|
314
|
+
lastExitAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
315
|
+
};
|
|
316
|
+
if (error) {
|
|
317
|
+
next.error = error;
|
|
318
|
+
} else {
|
|
319
|
+
delete next.error;
|
|
320
|
+
}
|
|
321
|
+
snapshot = {
|
|
322
|
+
...next
|
|
323
|
+
};
|
|
324
|
+
}, "setExited");
|
|
325
|
+
const scheduleRestart = /* @__PURE__ */ __name(() => {
|
|
326
|
+
if (stopping) return false;
|
|
327
|
+
const nowMs = Date.now();
|
|
328
|
+
if (!canScheduleRestart(nowMs)) {
|
|
329
|
+
const lastError = snapshot.error;
|
|
330
|
+
snapshot = {
|
|
331
|
+
...snapshot,
|
|
332
|
+
state: "failed",
|
|
333
|
+
error: lastError ? `Channel worker restart budget exhausted. Last error: ${lastError}` : "Channel worker restart budget exhausted.",
|
|
334
|
+
nextRestartAt: void 0
|
|
335
|
+
};
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
clearRestartTimer();
|
|
339
|
+
const delayMs = nextRestartDelayMs();
|
|
340
|
+
const nextRestartAt = new Date(nowMs + delayMs).toISOString();
|
|
341
|
+
snapshot = {
|
|
342
|
+
...snapshot,
|
|
343
|
+
nextRestartAt
|
|
344
|
+
};
|
|
345
|
+
restartTimer = setTimeout(() => {
|
|
346
|
+
restartTimer = void 0;
|
|
347
|
+
void launch("restart").catch((err) => {
|
|
348
|
+
handleRestartFailure(err instanceof Error ? err.message : String(err));
|
|
349
|
+
});
|
|
350
|
+
}, delayMs);
|
|
351
|
+
restartTimer.unref();
|
|
352
|
+
return true;
|
|
353
|
+
}, "scheduleRestart");
|
|
354
|
+
const handleRestartFailure = /* @__PURE__ */ __name((error, redaction) => {
|
|
355
|
+
snapshot = {
|
|
356
|
+
...snapshot,
|
|
357
|
+
state: "failed",
|
|
358
|
+
error: sanitizeWorkerError(error, redaction)
|
|
359
|
+
};
|
|
360
|
+
scheduleRestart();
|
|
361
|
+
notifyExit(opts.onExit, snapshotCopy());
|
|
362
|
+
}, "handleRestartFailure");
|
|
363
|
+
const armStaleHeartbeatTimer = /* @__PURE__ */ __name((startedChild) => {
|
|
364
|
+
clearStaleHeartbeatTimer();
|
|
365
|
+
if (heartbeatTimeoutMs <= 0) return;
|
|
366
|
+
staleHeartbeatTimer = setTimeout(() => {
|
|
367
|
+
if (child !== startedChild || stopping) return;
|
|
368
|
+
snapshot = {
|
|
369
|
+
...snapshot,
|
|
370
|
+
error: "Channel worker heartbeat timed out.",
|
|
371
|
+
staleHeartbeatAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
372
|
+
};
|
|
373
|
+
startedChild.kill("SIGKILL");
|
|
374
|
+
}, heartbeatTimeoutMs);
|
|
375
|
+
staleHeartbeatTimer.unref();
|
|
376
|
+
}, "armStaleHeartbeatTimer");
|
|
377
|
+
const launch = /* @__PURE__ */ __name(async (kind) => {
|
|
378
|
+
clearStaleHeartbeatTimer();
|
|
379
|
+
const argv = [
|
|
380
|
+
opts.cliEntryPath,
|
|
381
|
+
"channel",
|
|
382
|
+
"daemon-worker",
|
|
383
|
+
...selectionChannelArgs(opts.selection)
|
|
384
|
+
];
|
|
385
|
+
const env = createWorkerEnv({
|
|
386
|
+
daemonUrl: opts.daemonUrl,
|
|
387
|
+
workspace: opts.workspace,
|
|
388
|
+
...opts.daemonToken ? { daemonToken: opts.daemonToken } : {}
|
|
389
|
+
});
|
|
390
|
+
const redaction = workerLogRedactionOptions(opts.daemonToken, env);
|
|
391
|
+
const requestedChannels = requestedChannelNames(opts.selection);
|
|
392
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
393
|
+
snapshot = {
|
|
394
|
+
enabled: true,
|
|
395
|
+
state: "starting",
|
|
396
|
+
channels: channelSelectionNames(opts.selection),
|
|
397
|
+
...requestedChannels ? { requestedChannels } : {},
|
|
398
|
+
startedAt,
|
|
399
|
+
restartCount: snapshot.restartCount ?? 0,
|
|
400
|
+
...snapshot.lastExitAt ? { lastExitAt: snapshot.lastExitAt } : {},
|
|
401
|
+
...snapshot.lastHeartbeatAt ? { lastHeartbeatAt: snapshot.lastHeartbeatAt } : {},
|
|
402
|
+
...snapshot.staleHeartbeatAt ? { staleHeartbeatAt: snapshot.staleHeartbeatAt } : {}
|
|
403
|
+
};
|
|
404
|
+
if (kind === "restart") {
|
|
405
|
+
const nowMs = Date.now();
|
|
406
|
+
restartAttemptTimes.push(nowMs);
|
|
407
|
+
snapshot = {
|
|
408
|
+
...snapshot,
|
|
409
|
+
restartCount: (snapshot.restartCount ?? 0) + 1,
|
|
410
|
+
lastRestartAt: new Date(nowMs).toISOString(),
|
|
411
|
+
nextRestartAt: void 0
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
let startedChild;
|
|
415
|
+
try {
|
|
416
|
+
startedChild = spawnWorker(process.execPath, argv, {
|
|
417
|
+
cwd: opts.workspace,
|
|
418
|
+
env,
|
|
419
|
+
stdio: ["ignore", "pipe", "pipe", "ipc"]
|
|
420
|
+
});
|
|
421
|
+
} catch (err) {
|
|
422
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
423
|
+
const error = sanitizeWorkerError(message, redaction);
|
|
424
|
+
if (kind === "initial") {
|
|
425
|
+
snapshot = {
|
|
426
|
+
...snapshot,
|
|
427
|
+
state: "failed",
|
|
428
|
+
error
|
|
429
|
+
};
|
|
430
|
+
throw new Error(error);
|
|
431
|
+
}
|
|
432
|
+
handleRestartFailure(message, redaction);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
child = startedChild;
|
|
436
|
+
attachWorkerLogStream(startedChild.stdout, "stdout", {
|
|
437
|
+
...redaction,
|
|
438
|
+
onLog: opts.onLog
|
|
439
|
+
});
|
|
440
|
+
attachWorkerLogStream(startedChild.stderr, "stderr", {
|
|
441
|
+
...redaction,
|
|
442
|
+
onLog: opts.onLog
|
|
443
|
+
});
|
|
444
|
+
if (startedChild.pid !== void 0) {
|
|
445
|
+
snapshot = { ...snapshot, pid: startedChild.pid };
|
|
446
|
+
}
|
|
447
|
+
await new Promise((resolve, reject) => {
|
|
448
|
+
let settled = false;
|
|
449
|
+
let ready = false;
|
|
450
|
+
let exitObserved = false;
|
|
451
|
+
let terminatingBeforeReady = false;
|
|
452
|
+
let startupTimer;
|
|
453
|
+
const cleanupStartupTimer = /* @__PURE__ */ __name(() => {
|
|
454
|
+
if (!startupTimer) return;
|
|
455
|
+
clearTimeout(startupTimer);
|
|
456
|
+
startupTimer = void 0;
|
|
457
|
+
}, "cleanupStartupTimer");
|
|
458
|
+
const cleanupLaunch = /* @__PURE__ */ __name(() => {
|
|
459
|
+
cleanupStartupTimer();
|
|
460
|
+
startedChild.removeListener("message", handleMessage);
|
|
461
|
+
clearStaleHeartbeatTimer();
|
|
462
|
+
}, "cleanupLaunch");
|
|
463
|
+
const terminateBeforeReady = /* @__PURE__ */ __name(() => {
|
|
464
|
+
cleanupLaunch();
|
|
465
|
+
if (terminatingBeforeReady) return;
|
|
466
|
+
terminatingBeforeReady = true;
|
|
467
|
+
const exited = waitForExit(startedChild, 2e3);
|
|
468
|
+
startedChild.kill("SIGTERM");
|
|
469
|
+
void exited.then(async (didExit) => {
|
|
470
|
+
if (!didExit && child === startedChild && !exitObserved) {
|
|
471
|
+
const killed = waitForExit(startedChild, 2e3);
|
|
472
|
+
startedChild.kill("SIGKILL");
|
|
473
|
+
if (!await killed && child === startedChild && !exitObserved) {
|
|
474
|
+
child = void 0;
|
|
475
|
+
if (kind === "restart" && !stopping) {
|
|
476
|
+
scheduleRestart();
|
|
477
|
+
notifyExit(opts.onExit, snapshotCopy());
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
}, "terminateBeforeReady");
|
|
483
|
+
const failBeforeReady = /* @__PURE__ */ __name((err) => {
|
|
484
|
+
if (settled) return;
|
|
485
|
+
settled = true;
|
|
486
|
+
cleanupStartupTimer();
|
|
487
|
+
if (kind === "initial") {
|
|
488
|
+
reject(err);
|
|
489
|
+
} else {
|
|
490
|
+
resolve();
|
|
491
|
+
}
|
|
492
|
+
}, "failBeforeReady");
|
|
493
|
+
const completeReady = /* @__PURE__ */ __name((message) => {
|
|
494
|
+
if (settled || child !== startedChild) return;
|
|
495
|
+
settled = true;
|
|
496
|
+
ready = true;
|
|
497
|
+
cleanupStartupTimer();
|
|
498
|
+
const next = {
|
|
499
|
+
...snapshot,
|
|
500
|
+
state: "running",
|
|
501
|
+
pid: message.pid ?? startedChild.pid,
|
|
502
|
+
channels: message.channels && message.channels.length > 0 ? [...message.channels] : [...snapshot.channels]
|
|
503
|
+
};
|
|
504
|
+
delete next.error;
|
|
505
|
+
delete next.lastHeartbeatAt;
|
|
506
|
+
delete next.nextRestartAt;
|
|
507
|
+
delete next.staleHeartbeatAt;
|
|
508
|
+
if (message.requestedChannels?.length) {
|
|
509
|
+
next.requestedChannels = [...message.requestedChannels];
|
|
510
|
+
}
|
|
511
|
+
snapshot = next;
|
|
512
|
+
armStaleHeartbeatTimer(startedChild);
|
|
513
|
+
notifyReady(opts.onReady, snapshotCopy());
|
|
514
|
+
resolve();
|
|
515
|
+
}, "completeReady");
|
|
516
|
+
const handleHeartbeat = /* @__PURE__ */ __name((message) => {
|
|
517
|
+
if (!ready || child !== startedChild) return;
|
|
518
|
+
const currentPid = snapshot.pid ?? startedChild.pid;
|
|
519
|
+
if (message.pid !== void 0 && currentPid !== void 0) {
|
|
520
|
+
if (message.pid !== currentPid) return;
|
|
521
|
+
}
|
|
522
|
+
snapshot = {
|
|
523
|
+
...snapshot,
|
|
524
|
+
lastHeartbeatAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
525
|
+
};
|
|
526
|
+
armStaleHeartbeatTimer(startedChild);
|
|
527
|
+
}, "handleHeartbeat");
|
|
528
|
+
function handleMessage(message) {
|
|
529
|
+
if (child !== startedChild) return;
|
|
530
|
+
if (!ready && isReadyMessage(message)) {
|
|
531
|
+
completeReady(message);
|
|
532
|
+
} else if (isHeartbeatMessage(message)) {
|
|
533
|
+
handleHeartbeat(message);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
__name(handleMessage, "handleMessage");
|
|
537
|
+
function settleExit(code, signal) {
|
|
538
|
+
if (child !== startedChild) return;
|
|
539
|
+
exitObserved = true;
|
|
540
|
+
cleanupLaunch();
|
|
541
|
+
const state = ready ? "exited" : "failed";
|
|
542
|
+
const message = `Channel worker exited before ready (code=${code ?? "null"}, signal=${signal ?? "null"}).`;
|
|
543
|
+
setExited(
|
|
544
|
+
state,
|
|
545
|
+
code,
|
|
546
|
+
signal,
|
|
547
|
+
snapshot.error ?? (ready ? void 0 : sanitizeWorkerError(message, redaction))
|
|
548
|
+
);
|
|
549
|
+
child = void 0;
|
|
550
|
+
if ((ready || kind === "restart") && !stopping) {
|
|
551
|
+
scheduleRestart();
|
|
552
|
+
notifyExit(opts.onExit, snapshotCopy());
|
|
553
|
+
}
|
|
554
|
+
if (!settled) {
|
|
555
|
+
failBeforeReady(new Error(snapshot.error ?? message));
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
__name(settleExit, "settleExit");
|
|
559
|
+
function settleError(err) {
|
|
560
|
+
if (child !== startedChild || exitObserved) return;
|
|
561
|
+
if (settled && ready) {
|
|
562
|
+
snapshot = {
|
|
563
|
+
...snapshot,
|
|
564
|
+
error: sanitizeWorkerError(err.message, redaction)
|
|
565
|
+
};
|
|
566
|
+
startedChild.kill("SIGTERM");
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
snapshot = {
|
|
570
|
+
...snapshot,
|
|
571
|
+
state: "failed",
|
|
572
|
+
error: sanitizeWorkerError(err.message, redaction)
|
|
573
|
+
};
|
|
574
|
+
terminateBeforeReady();
|
|
575
|
+
if (!settled) {
|
|
576
|
+
failBeforeReady(new Error(snapshot.error));
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
__name(settleError, "settleError");
|
|
580
|
+
startupTimer = setTimeout(() => {
|
|
581
|
+
const timeoutMs = opts.startupTimeoutMs ?? DEFAULT_CHANNEL_WORKER_STARTUP_TIMEOUT_MS;
|
|
582
|
+
const error = `Channel worker did not become ready within ${timeoutMs}ms.`;
|
|
583
|
+
snapshot = {
|
|
584
|
+
...snapshot,
|
|
585
|
+
state: "failed",
|
|
586
|
+
error: sanitizeWorkerError(error, redaction)
|
|
587
|
+
};
|
|
588
|
+
failBeforeReady(new Error(error));
|
|
589
|
+
if (child === startedChild) {
|
|
590
|
+
terminateBeforeReady();
|
|
591
|
+
}
|
|
592
|
+
}, opts.startupTimeoutMs ?? DEFAULT_CHANNEL_WORKER_STARTUP_TIMEOUT_MS);
|
|
593
|
+
startupTimer.unref();
|
|
594
|
+
startedChild.on("message", handleMessage);
|
|
595
|
+
startedChild.once("exit", settleExit);
|
|
596
|
+
startedChild.once("error", settleError);
|
|
597
|
+
});
|
|
598
|
+
}, "launch");
|
|
599
|
+
return {
|
|
600
|
+
async start() {
|
|
601
|
+
if (child) return;
|
|
602
|
+
stopping = false;
|
|
603
|
+
clearRestartTimer();
|
|
604
|
+
restartAttemptTimes = [];
|
|
605
|
+
await launch("initial");
|
|
606
|
+
},
|
|
607
|
+
async stop() {
|
|
608
|
+
clearRestartTimer();
|
|
609
|
+
clearStaleHeartbeatTimer();
|
|
610
|
+
if (!child || snapshot.state === "exited" || snapshot.state === "failed" && hasObservedExit(snapshot) || snapshot.state === "stopped") {
|
|
611
|
+
child = void 0;
|
|
612
|
+
snapshot = { ...snapshot, state: "stopped" };
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const exited = waitForExit(child, 5e3);
|
|
616
|
+
stopping = true;
|
|
617
|
+
child.kill("SIGTERM");
|
|
618
|
+
if (!await exited) {
|
|
619
|
+
const killed = waitForExit(child, 2e3);
|
|
620
|
+
child.kill("SIGKILL");
|
|
621
|
+
if (!await killed) {
|
|
622
|
+
child = void 0;
|
|
623
|
+
stopping = false;
|
|
624
|
+
snapshot = {
|
|
625
|
+
...snapshot,
|
|
626
|
+
state: "failed",
|
|
627
|
+
signal: "SIGKILL",
|
|
628
|
+
error: "Channel worker did not exit after SIGKILL."
|
|
629
|
+
};
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
child = void 0;
|
|
634
|
+
stopping = false;
|
|
635
|
+
snapshot = { ...snapshot, state: "stopped" };
|
|
636
|
+
},
|
|
637
|
+
killAllSync() {
|
|
638
|
+
if (!child || snapshot.state === "exited" || snapshot.state === "failed" && hasObservedExit(snapshot) || snapshot.state === "stopped") {
|
|
639
|
+
clearRestartTimer();
|
|
640
|
+
clearStaleHeartbeatTimer();
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const preserveFailure = snapshot.state === "failed" && !hasObservedExit(snapshot);
|
|
644
|
+
clearRestartTimer();
|
|
645
|
+
clearStaleHeartbeatTimer();
|
|
646
|
+
stopping = true;
|
|
647
|
+
child.kill("SIGKILL");
|
|
648
|
+
child = void 0;
|
|
649
|
+
if (!preserveFailure) {
|
|
650
|
+
snapshot = {
|
|
651
|
+
...snapshot,
|
|
652
|
+
state: "stopped",
|
|
653
|
+
signal: "SIGKILL"
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
snapshot() {
|
|
658
|
+
return snapshotCopy();
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
__name(createChannelWorkerSupervisor, "createChannelWorkerSupervisor");
|
|
663
|
+
export {
|
|
664
|
+
createChannelWorkerSupervisor
|
|
665
|
+
};
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-KHDZHZMH.js";
|
|
6
6
|
import {
|
|
7
7
|
getCliVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7XS7CMSU.js";
|
|
9
9
|
import {
|
|
10
10
|
IdeClient
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WWOVV2PW.js";
|
|
12
12
|
import {
|
|
13
13
|
createDebugLogger
|
|
14
14
|
} from "./chunk-AVQDCKNF.js";
|
|
@@ -27,7 +27,7 @@ import { execFile } from "node:child_process";
|
|
|
27
27
|
|
|
28
28
|
// packages/cli/src/generated/git-commit.ts
|
|
29
29
|
init_esbuild_shims();
|
|
30
|
-
var GIT_COMMIT_INFO = "
|
|
30
|
+
var GIT_COMMIT_INFO = "1f1d61780";
|
|
31
31
|
|
|
32
32
|
// packages/cli/src/utils/systemInfo.ts
|
|
33
33
|
var debugLogger = createDebugLogger("STATUS");
|