@qwen-code/qwen-code 0.21.12 → 0.21.14-preview.0
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 +13 -5
- package/bundled/qc-helper/docs/features/code-review.md +18 -13
- package/bundled/qc-helper/docs/features/commands.md +120 -8
- package/bundled/qc-helper/docs/features/sub-agents.md +2 -2
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +1 -1
- package/bundled/qc-helper/docs/qwen-serve.md +20 -3
- package/bundled/review/SKILL.md +130 -82
- package/chunks/{MaxSizedBox-ZSJJ2D5S.js → MaxSizedBox-3PZITE2Y.js} +46 -45
- package/chunks/{StandaloneSessionPicker-WHUHQXSA.js → StandaloneSessionPicker-2C34PNGO.js} +68 -67
- package/chunks/{acp-startup-profiler-SVPUHLXV.js → acp-startup-profiler-HUYGO57H.js} +2 -2
- package/chunks/{acpAgent-7JOAESF5.js → acpAgent-3J4NHAYT.js} +1098 -366
- package/chunks/{agent-E6V3VXQR.js → agent-VFX4RPP5.js} +42 -41
- package/chunks/agent-headless-6WCF4J6N.js +88 -0
- package/chunks/{anthropicContentGenerator-YDT4EOKO.js → anthropicContentGenerator-M7XRJMSK.js} +8 -8
- package/chunks/{artifact-tool-4GCQQDZI.js → artifact-tool-GEXTOPVO.js} +2 -2
- package/chunks/{askUserQuestion-HZJJLR3Z.js → askUserQuestion-B33XRSB7.js} +2 -2
- package/chunks/{bridge-NPBV53UA.js → bridge-XR5ZSR7U.js} +46 -45
- package/chunks/{ca-4CQ6MYNQ.js → ca-SLZJD6QH.js} +8 -0
- package/chunks/{channel-management-service-OADNGQM3.js → channel-management-service-X6LCQUAD.js} +1 -1
- package/chunks/{channel-settings-store-4ODLJ4X2.js → channel-settings-store-Z7BUEUJE.js} +50 -49
- package/chunks/{channel-worker-group-IHBIHQ45.js → channel-worker-group-TJ35JDPE.js} +4 -4
- package/chunks/{channel-worker-manager-GEHYJ5AE.js → channel-worker-manager-G5LKWGOG.js} +4 -4
- package/chunks/{channel-worker-supervisor-ZJIIWM4I.js → channel-worker-supervisor-OEVWBHGT.js} +2 -2
- package/chunks/{chunk-47BGDLJG.js → chunk-25GHLMQQ.js} +42 -20
- package/chunks/{chunk-2ZWH53I4.js → chunk-2B2BF7P7.js} +3 -3
- package/chunks/chunk-2C6HJMG3.js +757 -0
- package/chunks/{chunk-WM3LUQLO.js → chunk-2JXDFSVE.js} +6 -6
- package/chunks/{chunk-OYWVIXHT.js → chunk-2M55OBEB.js} +1 -1
- package/chunks/{chunk-B4VN3VDH.js → chunk-2OA3JMRD.js} +5 -5
- package/chunks/{chunk-GZDWTBT3.js → chunk-3EZLLVDF.js} +2 -2
- package/chunks/chunk-3PWCMXIR.js +9169 -0
- package/chunks/{chunk-XAFIL4BD.js → chunk-4KQ2TI2K.js} +5 -5
- package/chunks/{chunk-OPVF453Q.js → chunk-4V4DFJBS.js} +3 -3
- package/chunks/{chunk-DPTMKFIH.js → chunk-4ZMS3JCR.js} +43 -12
- package/chunks/{chunk-6JEIRPLN.js → chunk-55PIFSP2.js} +2 -2
- package/chunks/{chunk-V6OBVAST.js → chunk-57KOJ2KZ.js} +1 -1
- package/chunks/{chunk-QLTATTPS.js → chunk-5CVO7YES.js} +1 -1
- package/chunks/{chunk-OK47XBYH.js → chunk-5IYS4WWR.js} +1 -1
- package/chunks/chunk-5MK45KZ3.js +492 -0
- package/chunks/{chunk-OWXFBIB6.js → chunk-6DFPR7CS.js} +1 -1
- package/chunks/{chunk-YIGGWOJE.js → chunk-6HY6IF3Z.js} +1 -1
- package/chunks/{chunk-XDRXOSAD.js → chunk-6LAPGPVA.js} +7 -5
- package/chunks/{chunk-Q4ZPYNIZ.js → chunk-6PDOHRN6.js} +4 -4
- package/chunks/{chunk-OWGRUU7F.js → chunk-6QFDQMQX.js} +1 -1
- package/chunks/{chunk-MUNA4QDC.js → chunk-6VDPDHIP.js} +29 -8
- package/chunks/{chunk-MDNUCDKZ.js → chunk-73G3Z7QS.js} +3 -3
- package/chunks/{chunk-VIFA5VJD.js → chunk-7OCSX7FC.js} +1 -1
- package/chunks/{chunk-D2RNVVH6.js → chunk-AKBOLMUF.js} +96 -18
- package/chunks/{chunk-S6TCTH4Z.js → chunk-AQBHJ2IG.js} +12 -12
- package/chunks/{chunk-WCEI6J56.js → chunk-BOJNAPUE.js} +2 -2
- package/chunks/{chunk-DAV4QFD5.js → chunk-BQWNIPTE.js} +44 -3
- package/chunks/{chunk-HOSVOUDK.js → chunk-BUQDLC2G.js} +3 -0
- package/chunks/{chunk-LUISTZXI.js → chunk-CH5OFRV7.js} +2 -2
- package/chunks/{chunk-G6MUFRNI.js → chunk-CHHABXPE.js} +1 -1
- package/chunks/{chunk-4AOVQPJU.js → chunk-CPHEPGAO.js} +1 -1
- package/chunks/{chunk-MS7GNABG.js → chunk-CXJHQVEK.js} +8 -0
- package/chunks/{chunk-K5IDV3PC.js → chunk-D34RDOLP.js} +12 -2
- package/chunks/{chunk-3GM5DLBI.js → chunk-DGJ7O55J.js} +3 -3
- package/chunks/{chunk-7KJPO7YH.js → chunk-DRKYT2TR.js} +2 -2
- package/chunks/{chunk-PZW46OTB.js → chunk-DVR7XKO5.js} +2 -2
- package/chunks/{chunk-CQ6IPDQW.js → chunk-DZCV3ZYU.js} +3 -3
- package/chunks/{chunk-ULNWG62W.js → chunk-E3DYKPYZ.js} +3 -3
- package/chunks/{chunk-YCHNAKC5.js → chunk-E5RS7LF4.js} +44 -13
- package/chunks/{chunk-4NFY2S7N.js → chunk-E7REAOTN.js} +15 -0
- package/chunks/chunk-EOCQCNV4.js +3887 -0
- package/chunks/{chunk-D7QGE3RT.js → chunk-FAAUPSY2.js} +1 -1
- package/chunks/{chunk-2IVYL3IF.js → chunk-FCTLOVYW.js} +1 -1
- package/chunks/{chunk-QPBFRWCP.js → chunk-FS5NGKWC.js} +3 -3
- package/chunks/{chunk-RQJA2YYO.js → chunk-G6FFFICU.js} +4 -4
- package/chunks/{chunk-36XKGB7E.js → chunk-GV3OIADZ.js} +3 -3
- package/chunks/{chunk-3AEKDXKT.js → chunk-H4A72DE5.js} +1 -1
- package/chunks/{chunk-IH4Z54RJ.js → chunk-HGPMOXLZ.js} +5 -5
- package/chunks/{chunk-DG4IQ6JG.js → chunk-I3N2Z25H.js} +3 -3
- package/chunks/{chunk-WI6GIM2M.js → chunk-I7NTHW4C.js} +2 -2
- package/chunks/{chunk-ZBB5EZZV.js → chunk-IA2K2HJE.js} +2 -2
- package/chunks/{chunk-IRSLAS4M.js → chunk-IOTPI425.js} +19 -11
- package/chunks/{chunk-ROIJYS5K.js → chunk-ISRHAMNL.js} +3 -3
- package/chunks/{chunk-CGM3E75C.js → chunk-J63PKMYA.js} +3 -3
- package/chunks/{chunk-PTSEETCO.js → chunk-J6YS7Z25.js} +107 -13
- package/chunks/{chunk-ZQUY3ZJU.js → chunk-K3CECR5C.js} +4 -4
- package/chunks/{chunk-QBJYSIQ4.js → chunk-K3LPAED5.js} +53 -12
- package/chunks/{chunk-FRHQQC2Z.js → chunk-KBXKR5R2.js} +1 -1
- package/chunks/{chunk-4KM2SYK5.js → chunk-KC4WMLZO.js} +1491 -10579
- package/chunks/{chunk-IX4PWUDU.js → chunk-KSGWAYNE.js} +14350 -8679
- package/chunks/{chunk-CPFFU46D.js → chunk-KV27IEHM.js} +1 -1
- package/chunks/{chunk-OR64CU46.js → chunk-L6CCLB3G.js} +1 -1
- package/chunks/{chunk-M6NDLY2T.js → chunk-LD5VIJ7S.js} +1 -1
- package/chunks/{chunk-GXTMEATA.js → chunk-LLR424CQ.js} +18 -15
- package/chunks/{chunk-RDVNSJQU.js → chunk-LRDB2OLB.js} +3 -3
- package/chunks/{chunk-LSRI3ND3.js → chunk-MA2HEDVP.js} +1 -1
- package/chunks/{chunk-DFVXU5YM.js → chunk-MCG53LWC.js} +1 -1
- package/chunks/{chunk-YBVVOSOH.js → chunk-MIPFDQAF.js} +1 -1
- package/chunks/{chunk-KRXPRVGL.js → chunk-MLXTMF7H.js} +0 -1
- package/chunks/{chunk-BSR5AXZR.js → chunk-NRPXRNN4.js} +1 -1
- package/chunks/{chunk-X5SLJOMF.js → chunk-NV6LW6FT.js} +4 -4
- package/chunks/{chunk-YILJKX2T.js → chunk-NVRMCWTP.js} +10 -6
- package/chunks/chunk-NYWWQ437.js +24 -0
- package/chunks/{chunk-AKBFSOC5.js → chunk-OBJYN4MX.js} +2 -2
- package/chunks/{chunk-NX4A23LY.js → chunk-OJOP26ET.js} +3 -3
- package/chunks/{chunk-3GDBZJD6.js → chunk-OLZSWUZR.js} +7 -7
- package/chunks/{chunk-K34GJQOZ.js → chunk-OO4FKHLO.js} +4 -4
- package/chunks/{chunk-BSSLSQEW.js → chunk-OSAFWBNR.js} +3 -3
- package/chunks/{chunk-TMFWI4RC.js → chunk-OVY67CYC.js} +1 -1
- package/chunks/{chunk-6ZKSO6K7.js → chunk-P425IVUK.js} +7 -7
- package/chunks/{chunk-4XA4QIUA.js → chunk-PMS7O6SA.js} +1 -1
- package/chunks/{chunk-LCX5B364.js → chunk-PPTM4O4R.js} +3 -3
- package/chunks/{chunk-VPV7WBVT.js → chunk-PT4I7NBA.js} +1 -1
- package/chunks/{chunk-3LDGOQXZ.js → chunk-QECSDJET.js} +6 -6
- package/chunks/{chunk-FMIH5KMQ.js → chunk-QEJZUXSK.js} +1 -1
- package/chunks/{chunk-NLFLYSS4.js → chunk-QFJ5JHQR.js} +1 -1
- package/chunks/{chunk-KWX56CHZ.js → chunk-QIHHJKXT.js} +7 -7
- package/chunks/{chunk-TDESMS7M.js → chunk-RAQBBGS6.js} +50 -70
- package/chunks/{chunk-KEC5FHLM.js → chunk-ROIYNTHJ.js} +3 -3
- package/chunks/{chunk-63FNZTWG.js → chunk-RWDNJBWN.js} +2 -2
- package/chunks/{chunk-56HVDG3M.js → chunk-RXHBTKMG.js} +6 -6
- package/chunks/{chunk-MAKIANMX.js → chunk-S6CXQKDD.js} +3 -3
- package/chunks/{chunk-CIDQISGM.js → chunk-SA7GBPEA.js} +5 -5
- package/chunks/{chunk-YX2RDGAL.js → chunk-SBRIBTYN.js} +1 -1
- package/chunks/{chunk-TTRH3RTQ.js → chunk-SG7ZP5PG.js} +4 -4
- package/chunks/{chunk-XH3KAV2G.js → chunk-SGLPDKRT.js} +3 -3
- package/chunks/{chunk-JRIVMPD2.js → chunk-SLILKYV2.js} +4 -4
- package/chunks/{chunk-NW2GIPG3.js → chunk-SNQZZ765.js} +2 -2
- package/chunks/{chunk-I7BT2MME.js → chunk-SR2LYSMT.js} +1 -1
- package/chunks/{chunk-TXP5NGG3.js → chunk-SXCOEJO4.js} +1 -1
- package/chunks/{chunk-MELQSJOU.js → chunk-TNPWODIZ.js} +1 -1
- package/chunks/{chunk-VLHR7F4E.js → chunk-U6RZRKNM.js} +247 -198
- package/chunks/{chunk-HTYND72J.js → chunk-UC67T4SF.js} +3 -1
- package/chunks/{chunk-HG3UBTJ4.js → chunk-UYDGFWIJ.js} +609 -23
- package/chunks/{chunk-6P5EXEBL.js → chunk-VGAAAMRD.js} +1126 -232
- package/chunks/{chunk-WDVDVWJ3.js → chunk-VHPMDDPT.js} +6 -6
- package/chunks/{chunk-H7TMVHKE.js → chunk-WGHHA7ZH.js} +1 -1
- package/chunks/{chunk-FQDCO3CJ.js → chunk-WP4WIUOJ.js} +7 -0
- package/chunks/{chunk-5RUCD4ED.js → chunk-WPVUOVYX.js} +3 -3
- package/chunks/{chunk-EJOGLSNJ.js → chunk-WSSH2BNO.js} +2 -2
- package/chunks/{chunk-5AFGJNY6.js → chunk-WVIABDXV.js} +4 -4
- package/chunks/chunk-WZAD4ZNJ.js +59 -0
- package/chunks/{chunk-62X3CM7Q.js → chunk-X3YA3YGG.js} +8 -5
- package/chunks/{chunk-EBPLKY6U.js → chunk-XC377TLN.js} +5483 -3168
- package/chunks/{chunk-KLOMACIR.js → chunk-XLLKYULU.js} +2 -2
- package/chunks/{chunk-QSD4UH74.js → chunk-XO24LIZC.js} +254 -56
- package/chunks/{chunk-N4SVADAV.js → chunk-XT4RKHVE.js} +5 -4
- package/chunks/{chunk-PVXEJB66.js → chunk-XUJNK7Y6.js} +1 -1
- package/chunks/{chunk-YBHUXEC6.js → chunk-YECDICIO.js} +3 -3
- package/chunks/{chunk-FA5K6YI2.js → chunk-YFPZ3NNC.js} +36 -4
- package/chunks/{chunk-46UV252V.js → chunk-YHC2EYYG.js} +35 -38
- package/chunks/{chunk-6SPD4Z7F.js → chunk-YIWH3MKK.js} +8 -3
- package/chunks/{chunk-ZMY2P4L3.js → chunk-YXC7JYUI.js} +4 -4
- package/chunks/{chunk-TB4YFWXG.js → chunk-YZHRN3CF.js} +2 -2
- package/chunks/{chunk-TQDFSQQF.js → chunk-YZOSNW4R.js} +1 -1
- package/chunks/{chunk-DD6O3ZRD.js → chunk-ZIGC3MUS.js} +3 -5
- package/chunks/{chunk-CZ4OWGQQ.js → chunk-ZXEAEZFN.js} +63 -19
- package/chunks/{computer-use-F4URV4TU.js → computer-use-ABECHPS5.js} +42 -41
- package/chunks/{config-utils-Z3OW3IQG.js → config-utils-NJQA5YLJ.js} +2 -2
- package/chunks/{contextCommand-IGSS2U5J.js → contextCommand-4CD5HZQQ.js} +44 -43
- package/chunks/{core-runtime-H5CZDN3A.js → core-runtime-2MOVQ4VX.js} +42 -41
- package/chunks/{create-sub-session-XT6DLYOE.js → create-sub-session-KRQULJE6.js} +2 -2
- package/chunks/{create-sub-session-PA7MFTHK.js → create-sub-session-L6NNHG5N.js} +46 -44
- package/chunks/{cron-create-2JZ2TWTF.js → cron-create-NFRZEOQX.js} +4 -4
- package/chunks/{cron-delete-CTPD2P26.js → cron-delete-GFVSVO7C.js} +4 -4
- package/chunks/{cron-list-V44KHAF6.js → cron-list-NRW34CLU.js} +4 -4
- package/chunks/{daemon-GED37WOX.js → daemon-XH76IXOC.js} +436 -29
- package/chunks/{daemon-git-worktree-guard-LZDCNJGV.js → daemon-git-worktree-guard-BLXFEG4Q.js} +44 -43
- package/chunks/daemon-status-provider-XGD3TPTO.js +103 -0
- package/chunks/daemon-trust-policy-THEGCWPO.js +100 -0
- package/chunks/{daemon-trust-policy-monitor-2K2YETMT.js → daemon-trust-policy-monitor-L7L4ACWQ.js} +49 -48
- package/chunks/{de-UBEBKG6V.js → de-AH4LGCF5.js} +8 -0
- package/chunks/{deferred-core-runtime-FKJ3OYE7.js → deferred-core-runtime-YQLHDUGE.js} +42 -41
- package/chunks/discovery-X2NV535U.js +27 -0
- package/chunks/{display-image-M2ELAVN4.js → display-image-ON3EYFRD.js} +4 -4
- package/chunks/{dist-WJ4BHIEW.js → dist-ESS34DHC.js} +72 -0
- package/chunks/{earlyInputCapture-WJBSJQUF.js → earlyInputCapture-PCTXNW7N.js} +43 -42
- package/chunks/{edit-X73LA4YO.js → edit-QX2EGWYW.js} +45 -43
- package/chunks/{en-X6YV7GME.js → en-MD3GP5YL.js} +8 -0
- package/chunks/{enter-worktree-CLRQTIVN.js → enter-worktree-EM3ZZ2SB.js} +42 -41
- package/chunks/{enterPlanMode-6BDYUQ5T.js → enterPlanMode-ESCMVAKB.js} +42 -41
- package/chunks/{environment-WOAJXJDJ.js → environment-TOJI56YV.js} +45 -44
- package/chunks/{errors-7OY5MXYY.js → errors-DZ5FWWEM.js} +44 -43
- package/chunks/{exit-worktree-TFFJXCRT.js → exit-worktree-KUIJ36XA.js} +42 -41
- package/chunks/exitPlanMode-NFVY54FV.js +86 -0
- package/chunks/{fast-path-QQLGC37M.js → fast-path-JLQXJSH6.js} +3 -3
- package/chunks/{fast-path-settings-LNOFM2YP.js → fast-path-settings-WHX3J3ZI.js} +2 -2
- package/chunks/{fr-VENTC2BS.js → fr-ZEML2JWS.js} +8 -0
- package/chunks/{gemini-VHE62IJL.js → gemini-I7OT4FWL.js} +92 -91
- package/chunks/{geminiContentGenerator-VSHIEGAQ.js → geminiContentGenerator-GRIS77NJ.js} +6 -6
- package/chunks/{glob-VMEEDDLO.js → glob-7TBUUV6R.js} +42 -41
- package/chunks/{goal-tools-M4UDAZXP.js → goal-tools-K5OHOJ6B.js} +56 -12
- package/chunks/{grep-F4UAR7KX.js → grep-743SYWCZ.js} +42 -41
- package/chunks/handleAutoUpdate-GAOYUYOD.js +95 -0
- package/chunks/{i18n-ETW24DHW.js → i18n-2ITURYX6.js} +43 -42
- package/chunks/{image-gen-YPK2AZT4.js → image-gen-4OIWDZD6.js} +10 -10
- package/chunks/initializer-OC7LWA6X.js +101 -0
- package/chunks/{installationInfo-P7OTIR4P.js → installationInfo-CO47QX3Q.js} +43 -42
- package/chunks/{ja-QHT4EQTO.js → ja-UM5B2HMD.js} +8 -0
- package/chunks/{keychain-token-storage-NKKCUHI2.js → keychain-token-storage-3XFJ5ZB2.js} +2 -2
- package/chunks/list-ATR2SFWT.js +104 -0
- package/chunks/{list-agents-O6WSY4CT.js → list-agents-OSVDFI6S.js} +2 -2
- package/chunks/loadedSettingsAdapter-NK4B7AGK.js +98 -0
- package/chunks/{loggingContentGenerator-J2J2AANS.js → loggingContentGenerator-3WXBU5TQ.js} +67 -41
- package/chunks/{loop-wakeup-GVQRMUKS.js → loop-wakeup-HWVUU5CF.js} +5 -5
- package/chunks/{ls-6W2D7TKU.js → ls-D3HUFHDP.js} +4 -4
- package/chunks/{lsp-NJ4KFBI2.js → lsp-3QDDJTCS.js} +2 -2
- package/chunks/{managed-npm-update-WMV5ITKU.js → managed-npm-update-4SSBWI2D.js} +43 -42
- package/chunks/mcp-C62AE2QI.js +98 -0
- package/chunks/{monitor-2MM23VDV.js → monitor-FEYEGASA.js} +42 -41
- package/chunks/nonInteractiveCli-AJEV5ZWO.js +165 -0
- package/chunks/{notebook-edit-QD4TRKLY.js → notebook-edit-SLLTEY4O.js} +46 -44
- package/chunks/{openaiContentGenerator-KLHSPVN2.js → openaiContentGenerator-WLUGIAPX.js} +27 -26
- package/chunks/{pidfile-RQGZBNXT.js → pidfile-TV2VWUMB.js} +43 -42
- package/chunks/{processUtils-HZZDA2VV.js → processUtils-3IN2ZR55.js} +2 -2
- package/chunks/proper-lockfile-3LHWIM44.js +8 -0
- package/chunks/{pt-VL3I5RNY.js → pt-5BMJ3XYH.js} +8 -0
- package/chunks/{qwenContentGenerator-T75M2Z3B.js → qwenContentGenerator-GSGRFPJE.js} +47 -46
- package/chunks/{qwenOAuth2-5QZU444W.js → qwenOAuth2-JLSTIS4Z.js} +9 -9
- package/chunks/{read-file-LOVUSBJC.js → read-file-6PZZRGZZ.js} +15 -13
- package/chunks/{read-mcp-resource-GWCP23WG.js → read-mcp-resource-XD54ZQMC.js} +2 -2
- package/chunks/{record-artifact-IYQDEYMV.js → record-artifact-GLU3UWBV.js} +5 -3
- package/chunks/{resumeHistoryUtils-LVKSSQII.js → resumeHistoryUtils-5GEWKOOO.js} +49 -48
- package/chunks/ripGrep-FX7GBGFN.js +86 -0
- package/chunks/{ru-4RCKL4PY.js → ru-6GL66ORV.js} +8 -0
- package/chunks/{run-qwen-serve-GZW7B4WK.js → run-qwen-serve-7RHU3NSV.js} +423 -212
- package/chunks/{runtime-MYRXEO2E.js → runtime-EPOXAMLP.js} +52 -51
- package/chunks/{scheduler-DPTPI6FW.js → scheduler-F4Y7ENVV.js} +44 -43
- package/chunks/{sdk-exporters-http-NHBYB5FZ.js → sdk-exporters-http-NC746HLT.js} +3 -3
- package/chunks/{sdk-impl-SK4P5WON.js → sdk-impl-YVL7BP6Y.js} +3 -3
- package/chunks/{send-message-O7FO63UK.js → send-message-TNBG5EVA.js} +7 -7
- package/chunks/{serve-XCG4XCDA.js → serve-LQV4TN5A.js} +49 -50
- package/chunks/{server-AWQHKXLG.js → server-IZCKLIYQ.js} +5042 -1725
- package/chunks/{session-P5FKNCNR.js → session-52ZGTDVB.js} +87 -85
- package/chunks/{settings-CSYVIP2R.js → settings-WCVB34HW.js} +48 -47
- package/chunks/{shell-EGTSUO2P.js → shell-33BIUBLH.js} +42 -41
- package/chunks/{skill-IFUD72GF.js → skill-IYVQ2QNK.js} +20 -18
- package/chunks/{skill-settings-YOE7LBHE.js → skill-settings-YG4ZS4OZ.js} +48 -47
- package/chunks/{spawnChannel-PQSZIOLY.js → spawnChannel-BLA4YT4W.js} +44 -43
- package/chunks/{standalone-update-RB2EGUSF.js → standalone-update-ALRIPWSM.js} +44 -43
- package/chunks/{startInteractiveUI-KMYUJ2MU.js → startInteractiveUI-PISBXWKA.js} +614 -294
- package/chunks/{syntheticOutput-DVHJMUGV.js → syntheticOutput-7GWFIDXT.js} +3 -3
- package/chunks/{task-create-4NC7PDI4.js → task-create-EILHJJB7.js} +11 -11
- package/chunks/{task-list-LBSRMOC7.js → task-list-WGJR6YL5.js} +21 -7
- package/chunks/{task-stop-YFNATTIM.js → task-stop-X37KYTKB.js} +2 -2
- package/chunks/{task-update-BPLM52GD.js → task-update-XZAHVXJ5.js} +86 -15
- package/chunks/{team-create-B6A6MJBT.js → team-create-CIQDCC6A.js} +43 -43
- package/chunks/{team-delete-MKYMYBFM.js → team-delete-UEP4QOOT.js} +6 -6
- package/chunks/{team-plan-approval-5WO3CXXU.js → team-plan-approval-664XCRB4.js} +42 -41
- package/chunks/{terminal-image-renderer-BTRE2GEU.js → terminal-image-renderer-TEBO6ONY.js} +44 -43
- package/chunks/theme-manager-3CIFH2JV.js +90 -0
- package/chunks/{todoWrite-K5K7NRE5.js → todoWrite-ATS62CAP.js} +4 -4
- package/chunks/{tool-search-QNBLXUGR.js → tool-search-IJX5JHJB.js} +19 -17
- package/chunks/{total-session-admission-N4E5SFBO.js → total-session-admission-XBK2NVRV.js} +46 -45
- package/chunks/{trustedFolders-MQS46LIU.js → trustedFolders-OOFNLRWK.js} +43 -42
- package/chunks/{update-relaunch-536KRL33.js → update-relaunch-EIG7EYAQ.js} +5 -5
- package/chunks/{updateCheck-QJI2SYWF.js → updateCheck-KYDCBLSF.js} +46 -45
- package/chunks/{useAutoAcceptIndicator-7QASHD46.js → useAutoAcceptIndicator-RFX3KNBN.js} +52 -51
- package/chunks/{validateNonInterActiveAuth-ZNRGWBLV.js → validateNonInterActiveAuth-MZXSAITU.js} +83 -81
- package/chunks/{version-DBEQAFRW.js → version-PJC6ZNXV.js} +1 -1
- package/chunks/{web-fetch-MBIVXKPE.js → web-fetch-XXICVGKQ.js} +21 -18
- package/chunks/{web-search-4LBIN6VF.js → web-search-LHPM6QWC.js} +9 -9
- package/chunks/{workflow-LNMA55HY.js → workflow-4CUO2BV7.js} +159 -57
- package/chunks/workspace-providers-status-G4MUGH3X.js +101 -0
- package/chunks/{workspace-registration-store-BGRKKIYR.js → workspace-registration-store-QMDMFWBE.js} +2 -2
- package/chunks/{workspace-registry-L4NCJ34K.js → workspace-registry-FKBB4MZK.js} +48 -46
- package/chunks/{workspace-service-LOXYKYTR.js → workspace-service-TIDTTA65.js} +55 -54
- package/chunks/workspace-skills-status-LBC2TZKM.js +101 -0
- package/chunks/{workspace-trust-reconciler-H36TCR2S.js → workspace-trust-reconciler-4KJ567XP.js} +58 -56
- package/chunks/{write-file-JJAY7JSP.js → write-file-R6LAEER5.js} +42 -41
- package/chunks/{zh-TW-SQ4HTSCW.js → zh-TW-LVLBK4KF.js} +8 -0
- package/chunks/{zh-LMSTK4WD.js → zh-UBMWS2BJ.js} +8 -0
- package/chunks/{zoom-image-4MVVVM7E.js → zoom-image-XLCK6DDK.js} +20 -17
- package/cli.js +13 -13
- package/locales/ca.js +13 -0
- package/locales/de.js +12 -0
- package/locales/en.js +11 -0
- package/locales/fr.js +13 -0
- package/locales/ja.js +13 -0
- package/locales/pt.js +12 -0
- package/locales/ru.js +12 -0
- package/locales/zh-TW.js +11 -0
- package/locales/zh.js +11 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-B-89zHN4.js → arc-DItbX0DI.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-BkcOncHk.js → architectureDiagram-3BPJPVTR-CmnIlH8y.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-DQ4yboaF.js → blockDiagram-GPEHLZMM-pObnB9kw.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-C_8ZjPDI.js → c4Diagram-AAUBKEIU-BNBmMS0Y.js} +1 -1
- package/web-shell/assets/channel-hZnMfWA9.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-naKVe1Bm.js → chunk-2J33WTMH-Dz4JBOO6.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DdoViKT2.js → chunk-4BX2VUAB-Cz2GnvAR.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-DUDQZEwU.js → chunk-55IACEB6-CC6kOQYx.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-BqpDTR5s.js → chunk-727SXJPM-Z4lY4gbh.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-CdmEknkT.js → chunk-AQP2D5EJ-Yz0hZr3D.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-CH7fFTLB.js → chunk-FMBD7UC4-nKmTWTv9.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-ObgSuFKF.js → chunk-ND2GUHAM-CjZz0f6Y.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-D9fKdv_s.js → chunk-QZHKN3VN-Bab3FpuS.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-BRnxm8DX.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BRnxm8DX.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-CvzATMx9.js → cose-bilkent-S5V4N54A-BuSAGFox.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-M_xU21QW.js → dagre-BM42HDAG-CRZXTg3g.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-CNrl9sW1.js → diagram-2AECGRRQ-BFx1Ayrz.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-CUweVT6T.js → diagram-5GNKFQAL-B2hMZ3gS.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-D3n6Lxjo.js → diagram-KO2AKTUF-DKxAQLmc.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-0SeFPK4t.js → diagram-LMA3HP47-Bo1xGqVY.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-DAgyEwge.js → diagram-OG6HWLK6-B9NG78d-.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-CzxBBDIK.js → erDiagram-TEJ5UH35-DltQKiqQ.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-B0uj0jyo.js → flowDiagram-I6XJVG4X-5xXGmS4I.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFzcj5km.js → ganttDiagram-6RSMTGT7-bhGL5n0l.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DylJ_Fc9.js → gitGraphDiagram-PVQCEYII-ZYnz9hgh.js} +1 -1
- package/web-shell/assets/{index-BKSAnXU9.js → index-CBBeUArD.js} +1 -1
- package/web-shell/assets/index-CbgU-jUo.css +5 -0
- package/web-shell/assets/index-_nhzXqab.js +1750 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-BYMcJVMI.js → infoDiagram-5YYISTIA-Cg-jamQf.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-t1quI1S3.js → ishikawaDiagram-YF4QCWOH-CcmvKlyq.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-YM_QVUJm.js → journeyDiagram-JHISSGLW-BRsOQZp1.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-jw8OddK1.js → kanban-definition-UN3LZRKU-xW-dmEHK.js} +1 -1
- package/web-shell/assets/{linear-Dlr3RVuP.js → linear-ClBfEZH2.js} +1 -1
- package/web-shell/assets/{mermaid.core-CqGKzNzd.js → mermaid.core-D65NDkzc.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BqureoOS.js → mindmap-definition-RKZ34NQL-CyvFslYa.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-Da20HkK1.js → pieDiagram-4H26LBE5-BwSefMyG.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BsNlMvJy.js → quadrantDiagram-W4KKPZXB-GqBJspFS.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-DzVCQCse.js → requirementDiagram-4Y6WPE33-B137PlTJ.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BMo16voT.js → sankeyDiagram-5OEKKPKP-maHkkt8i.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Bgi-pdHk.js → sequenceDiagram-3UESZ5HK-DJ1mRaG3.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-xaPQXwGk.js → stateDiagram-AJRCARHV-aRmP7Q4i.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Db39gvZ_.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-C_9RuvKG.js → timeline-definition-PNZ67QCA-CIQ3BRPA.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-Bgu6vdla.js → vennDiagram-CIIHVFJN-DR9VPd5h.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CFTZ8IrX.js → wardley-L42UT6IY-ZcfIbT4D.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BASW9Vmt.js → wardleyDiagram-YWT4CUSO-D0jgPi4T.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6--Nh-CD3F.js → xychartDiagram-2RQKCTM6-BGWU4s5o.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/agent-headless-OEQNFOMH.js +0 -87
- package/chunks/chunk-DEDESZDL.js +0 -358
- package/chunks/chunk-MPHPFVKK.js +0 -48
- package/chunks/chunk-UI5UGEF4.js +0 -3576
- package/chunks/daemon-status-provider-QYM57Z44.js +0 -102
- package/chunks/daemon-trust-policy-TSRVEYZR.js +0 -99
- package/chunks/discovery-XLHITE74.js +0 -220
- package/chunks/exitPlanMode-WDURQMIU.js +0 -85
- package/chunks/handleAutoUpdate-GN7Z6QAC.js +0 -94
- package/chunks/initializer-UA6KQ7MS.js +0 -100
- package/chunks/list-GRAMIQOT.js +0 -103
- package/chunks/loadedSettingsAdapter-5O2TDS3I.js +0 -97
- package/chunks/mcp-XLP33CAI.js +0 -97
- package/chunks/nonInteractiveCli-KTA5K6FS.js +0 -163
- package/chunks/ripGrep-ZJSHKB6H.js +0 -85
- package/chunks/theme-manager-XL2N5SBY.js +0 -89
- package/chunks/workspace-providers-status-PDDMI6ST.js +0 -100
- package/chunks/workspace-skills-status-IJ5FOQI6.js +0 -100
- package/web-shell/assets/channel-Du2WFns8.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Zw0HafH6.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Zw0HafH6.js +0 -1
- package/web-shell/assets/index-BIGQygTL.css +0 -5
- package/web-shell/assets/index-J7OMTqAN.js +0 -1789
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-D5RqimXD.js +0 -1
- package/chunks/{chunk-SYHXR6WM.js → chunk-4W5U2TUT.js} +3 -3
- /package/chunks/{chunk-NTTBXH7U.js → chunk-UGK4K2N2.js} +0 -0
|
@@ -12,9 +12,12 @@ import {
|
|
|
12
12
|
MIN_CHILD_HEAP_MB,
|
|
13
13
|
recommendedChildShareMb
|
|
14
14
|
} from "./chunk-UXEO7E3V.js";
|
|
15
|
+
import {
|
|
16
|
+
isInternalWorkspaceRuntime
|
|
17
|
+
} from "./chunk-NYWWQ437.js";
|
|
15
18
|
import {
|
|
16
19
|
CLIENT_MCP_OVER_WS_CONFIG_FLAG
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WP4WIUOJ.js";
|
|
18
21
|
import {
|
|
19
22
|
MAX_WORKSPACE_PATH_LENGTH,
|
|
20
23
|
translateAndCheckAbsoluteWorkspacePath
|
|
@@ -920,9 +923,107 @@ function isDeepHealthQuery(raw) {
|
|
|
920
923
|
}
|
|
921
924
|
__name(isDeepHealthQuery, "isDeepHealthQuery");
|
|
922
925
|
|
|
923
|
-
// packages/cli/src/serve/
|
|
926
|
+
// packages/cli/src/serve/local-control/credentials.ts
|
|
924
927
|
init_esbuild_shims();
|
|
925
928
|
import { createHash, timingSafeEqual } from "node:crypto";
|
|
929
|
+
var CredentialStore = class {
|
|
930
|
+
static {
|
|
931
|
+
__name(this, "CredentialStore");
|
|
932
|
+
}
|
|
933
|
+
#runtime;
|
|
934
|
+
/** Pairing id → sha256 of the pairing secret. */
|
|
935
|
+
#pairing = /* @__PURE__ */ new Map();
|
|
936
|
+
constructor(runtimeToken) {
|
|
937
|
+
this.#runtime = hashToken(runtimeToken);
|
|
938
|
+
}
|
|
939
|
+
addPairingToken(id, token) {
|
|
940
|
+
this.#pairing.set(id, createHash("sha256").update(token, "utf8").digest());
|
|
941
|
+
}
|
|
942
|
+
revokePairingToken(id) {
|
|
943
|
+
return this.#pairing.delete(id);
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Is the gate open — i.e. may an unauthenticated request through?
|
|
947
|
+
*
|
|
948
|
+
* Only ever true on the primary listener of a no-token loopback daemon,
|
|
949
|
+
* preserving today's developer default. The LAN listener is never open: it
|
|
950
|
+
* exists only while a pairing token does, and it must not inherit the
|
|
951
|
+
* "operator chose the surface area" reasoning that governs `--hostname`.
|
|
952
|
+
*/
|
|
953
|
+
isOpen(listener) {
|
|
954
|
+
if (listener.kind === "local-control") return false;
|
|
955
|
+
return this.#runtime === void 0;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Constant-time check of a presented credential against those valid for
|
|
959
|
+
* `listener`. Every candidate in scope is compared even after a match so the
|
|
960
|
+
* work is independent of which credential matched — with a handful of
|
|
961
|
+
* pairing tokens the cost is negligible and the timing signal is not worth
|
|
962
|
+
* reasoning about separately.
|
|
963
|
+
*/
|
|
964
|
+
verify(credentials, listener) {
|
|
965
|
+
const candidate = createHash("sha256").update(credentials, "utf8").digest();
|
|
966
|
+
let matched = false;
|
|
967
|
+
if (listener.kind === "local-control") {
|
|
968
|
+
for (const expected of this.#pairing.values()) {
|
|
969
|
+
if (equalDigest(candidate, expected)) matched = true;
|
|
970
|
+
}
|
|
971
|
+
return matched;
|
|
972
|
+
}
|
|
973
|
+
return this.#runtime !== void 0 && equalDigest(candidate, this.#runtime);
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
function singleTokenCredentials(token) {
|
|
977
|
+
const expected = hashToken(token);
|
|
978
|
+
return {
|
|
979
|
+
isOpen: /* @__PURE__ */ __name((listener) => expected === void 0 && listener.kind !== "local-control", "isOpen"),
|
|
980
|
+
verify: /* @__PURE__ */ __name((candidate, listener) => {
|
|
981
|
+
if (expected === void 0 || listener.kind === "local-control") {
|
|
982
|
+
return false;
|
|
983
|
+
}
|
|
984
|
+
return equalDigest(
|
|
985
|
+
createHash("sha256").update(candidate, "utf8").digest(),
|
|
986
|
+
expected
|
|
987
|
+
);
|
|
988
|
+
}, "verify")
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
__name(singleTokenCredentials, "singleTokenCredentials");
|
|
992
|
+
function hashToken(token) {
|
|
993
|
+
return token === void 0 || token === "" ? void 0 : createHash("sha256").update(token, "utf8").digest();
|
|
994
|
+
}
|
|
995
|
+
__name(hashToken, "hashToken");
|
|
996
|
+
function equalDigest(a, b) {
|
|
997
|
+
return a.length === b.length && timingSafeEqual(a, b);
|
|
998
|
+
}
|
|
999
|
+
__name(equalDigest, "equalDigest");
|
|
1000
|
+
|
|
1001
|
+
// packages/cli/src/serve/local-control/listener-identity.ts
|
|
1002
|
+
init_esbuild_shims();
|
|
1003
|
+
var LISTENER_TAG = Symbol.for("qwen.serve.listenerIdentity");
|
|
1004
|
+
function tagListener(server, identity) {
|
|
1005
|
+
server[LISTENER_TAG] = identity;
|
|
1006
|
+
}
|
|
1007
|
+
__name(tagListener, "tagListener");
|
|
1008
|
+
var PRIMARY = { kind: "primary" };
|
|
1009
|
+
function fromServer(server) {
|
|
1010
|
+
if (!server || typeof server !== "object") return void 0;
|
|
1011
|
+
return server[LISTENER_TAG];
|
|
1012
|
+
}
|
|
1013
|
+
__name(fromServer, "fromServer");
|
|
1014
|
+
function listenerIdentityOf(req) {
|
|
1015
|
+
const socket = req.socket;
|
|
1016
|
+
return fromServer(socket?.server) ?? PRIMARY;
|
|
1017
|
+
}
|
|
1018
|
+
__name(listenerIdentityOf, "listenerIdentityOf");
|
|
1019
|
+
function listenerIdentityOfSocket(socket) {
|
|
1020
|
+
const withServer = socket;
|
|
1021
|
+
return fromServer(withServer?.server) ?? PRIMARY;
|
|
1022
|
+
}
|
|
1023
|
+
__name(listenerIdentityOfSocket, "listenerIdentityOfSocket");
|
|
1024
|
+
|
|
1025
|
+
// packages/cli/src/serve/auth.ts
|
|
1026
|
+
init_esbuild_shims();
|
|
926
1027
|
var denyBrowserOriginCors = /* @__PURE__ */ __name((req, res, next) => {
|
|
927
1028
|
if (req.headers.origin) {
|
|
928
1029
|
res.setHeader("Vary", "Origin");
|
|
@@ -970,7 +1071,42 @@ function parseAllowOriginPatterns(raw) {
|
|
|
970
1071
|
return { allowAny, origins };
|
|
971
1072
|
}
|
|
972
1073
|
__name(parseAllowOriginPatterns, "parseAllowOriginPatterns");
|
|
1074
|
+
var MutableOriginAllowlist = class {
|
|
1075
|
+
static {
|
|
1076
|
+
__name(this, "MutableOriginAllowlist");
|
|
1077
|
+
}
|
|
1078
|
+
#allowAny;
|
|
1079
|
+
#static;
|
|
1080
|
+
#dynamic = /* @__PURE__ */ new Map();
|
|
1081
|
+
constructor(base) {
|
|
1082
|
+
this.#allowAny = base.allowAny;
|
|
1083
|
+
this.#static = new Set(base.origins);
|
|
1084
|
+
}
|
|
1085
|
+
allows(origin) {
|
|
1086
|
+
if (this.#allowAny) return true;
|
|
1087
|
+
const normalized = origin.toLowerCase();
|
|
1088
|
+
if (this.#static.has(normalized)) return true;
|
|
1089
|
+
for (const value of this.#dynamic.values()) {
|
|
1090
|
+
if (value === normalized) return true;
|
|
1091
|
+
}
|
|
1092
|
+
return false;
|
|
1093
|
+
}
|
|
1094
|
+
/** Add a runtime origin under `key`; re-adding the same key replaces it. */
|
|
1095
|
+
add(key, origin) {
|
|
1096
|
+
this.#dynamic.set(key, origin.toLowerCase());
|
|
1097
|
+
}
|
|
1098
|
+
remove(key) {
|
|
1099
|
+
this.#dynamic.delete(key);
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
function toMatcher(patterns) {
|
|
1103
|
+
return "allows" in patterns ? patterns : {
|
|
1104
|
+
allows: /* @__PURE__ */ __name((origin) => patterns.allowAny || patterns.origins.has(origin.toLowerCase()), "allows")
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
__name(toMatcher, "toMatcher");
|
|
973
1108
|
function allowOriginCors(patterns) {
|
|
1109
|
+
const matcher = toMatcher(patterns);
|
|
974
1110
|
const allowedMethods = "GET, POST, PATCH, DELETE, OPTIONS";
|
|
975
1111
|
const allowedHeaders = "Authorization, Content-Type, X-Qwen-Client-Id, Last-Event-ID, X-Qwen-Event-Epoch";
|
|
976
1112
|
const maxAgeSeconds = "86400";
|
|
@@ -986,7 +1122,7 @@ function allowOriginCors(patterns) {
|
|
|
986
1122
|
res.status(403).json({ error: "Request denied by CORS policy" });
|
|
987
1123
|
return;
|
|
988
1124
|
}
|
|
989
|
-
const matched =
|
|
1125
|
+
const matched = matcher.allows(origin);
|
|
990
1126
|
if (matched) {
|
|
991
1127
|
res.setHeader("Access-Control-Allow-Origin", origin);
|
|
992
1128
|
res.setHeader("Vary", "Origin");
|
|
@@ -1007,6 +1143,24 @@ function allowOriginCors(patterns) {
|
|
|
1007
1143
|
}
|
|
1008
1144
|
__name(allowOriginCors, "allowOriginCors");
|
|
1009
1145
|
function hostAllowlist(bind, getPort) {
|
|
1146
|
+
const primaryGate = buildPrimaryHostGate(bind, getPort);
|
|
1147
|
+
return (req, res, next) => {
|
|
1148
|
+
const listener = listenerIdentityOf(req);
|
|
1149
|
+
if (listener.kind !== "local-control") {
|
|
1150
|
+
primaryGate(req, res, next);
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
const host = (req.headers.host || "").toLowerCase();
|
|
1154
|
+
const browserHost = listener.origin === void 0 ? void 0 : new URL(listener.origin).host.toLowerCase();
|
|
1155
|
+
if (listener.authority === void 0 || host !== listener.authority && host !== browserHost) {
|
|
1156
|
+
res.status(403).json({ error: "Invalid Host header" });
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
next();
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
__name(hostAllowlist, "hostAllowlist");
|
|
1163
|
+
function buildPrimaryHostGate(bind, getPort) {
|
|
1010
1164
|
if (!isLoopbackBind(bind)) {
|
|
1011
1165
|
return (_req, _res, next) => next();
|
|
1012
1166
|
}
|
|
@@ -1039,13 +1193,15 @@ function hostAllowlist(bind, getPort) {
|
|
|
1039
1193
|
next();
|
|
1040
1194
|
};
|
|
1041
1195
|
}
|
|
1042
|
-
__name(
|
|
1043
|
-
function bearerAuth(
|
|
1044
|
-
|
|
1045
|
-
return (_req, _res, next) => next();
|
|
1046
|
-
}
|
|
1047
|
-
const expected = createHash("sha256").update(token, "utf8").digest();
|
|
1196
|
+
__name(buildPrimaryHostGate, "buildPrimaryHostGate");
|
|
1197
|
+
function bearerAuth(source) {
|
|
1198
|
+
const credentials = typeof source === "object" && source !== null ? source : singleTokenCredentials(source);
|
|
1048
1199
|
return (req, res, next) => {
|
|
1200
|
+
const listener = listenerIdentityOf(req);
|
|
1201
|
+
if (credentials.isOpen(listener)) {
|
|
1202
|
+
next();
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1049
1205
|
const header = req.headers.authorization;
|
|
1050
1206
|
if (!header) {
|
|
1051
1207
|
res.status(401).json({ error: "Unauthorized" });
|
|
@@ -1065,26 +1221,35 @@ function bearerAuth(token) {
|
|
|
1065
1221
|
while (credStart < header.length && (header.charCodeAt(credStart) === 32 || header.charCodeAt(credStart) === 9)) {
|
|
1066
1222
|
credStart++;
|
|
1067
1223
|
}
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1224
|
+
const presented = header.slice(credStart);
|
|
1225
|
+
if (presented.length === 0) {
|
|
1070
1226
|
res.status(401).json({ error: "Unauthorized" });
|
|
1071
1227
|
return;
|
|
1072
1228
|
}
|
|
1073
|
-
|
|
1074
|
-
if (!timingSafeEqual(candidate, expected)) {
|
|
1229
|
+
if (!credentials.verify(presented, listener)) {
|
|
1075
1230
|
res.status(401).json({ error: "Unauthorized" });
|
|
1076
1231
|
return;
|
|
1077
1232
|
}
|
|
1233
|
+
req[AUTHENTICATED_REQUEST] = true;
|
|
1078
1234
|
next();
|
|
1079
1235
|
};
|
|
1080
1236
|
}
|
|
1081
1237
|
__name(bearerAuth, "bearerAuth");
|
|
1238
|
+
var AUTHENTICATED_REQUEST = Symbol("qwen.serve.authenticatedRequest");
|
|
1239
|
+
function requestWasAuthenticated(req) {
|
|
1240
|
+
return req[AUTHENTICATED_REQUEST] === true;
|
|
1241
|
+
}
|
|
1242
|
+
__name(requestWasAuthenticated, "requestWasAuthenticated");
|
|
1082
1243
|
function createMutationGate(deps) {
|
|
1083
1244
|
const passthrough = /* @__PURE__ */ __name((_req, _res, next) => next(), "passthrough");
|
|
1084
1245
|
if (deps.requireAuth || deps.tokenConfigured) {
|
|
1085
1246
|
return () => passthrough;
|
|
1086
1247
|
}
|
|
1087
|
-
const strictDenier = /* @__PURE__ */ __name((
|
|
1248
|
+
const strictDenier = /* @__PURE__ */ __name((req, res, next) => {
|
|
1249
|
+
if (requestWasAuthenticated(req)) {
|
|
1250
|
+
next();
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1088
1253
|
res.status(401).json({
|
|
1089
1254
|
error: "This route requires the daemon to be configured with a bearer token. Set QWEN_SERVER_TOKEN or pass --token to enable bearer auth.",
|
|
1090
1255
|
code: "token_required"
|
|
@@ -1267,6 +1432,11 @@ var SERVE_CAPABILITY_REGISTRY = {
|
|
|
1267
1432
|
session_source_metadata: { since: "v1" },
|
|
1268
1433
|
session_side_task: { since: "v1" },
|
|
1269
1434
|
session_prompt: { since: "v1" },
|
|
1435
|
+
session_turn_status: { since: "v1" },
|
|
1436
|
+
// Prompts and mid-turn messages support session-scoped media uploaded once
|
|
1437
|
+
// and referenced by `mediaId`. The bridge resolves bytes only when ACP input
|
|
1438
|
+
// is dispatched, keeping base64 out of JSON and SSE payloads.
|
|
1439
|
+
session_media: { since: "v1" },
|
|
1270
1440
|
session_mid_turn_message_mutation: { since: "v1" },
|
|
1271
1441
|
// Daemon-owned reconciliation surface for mid-turn messages:
|
|
1272
1442
|
// `GET /session/:id/mid-turn-messages` returns the messages still waiting
|
|
@@ -1600,6 +1770,17 @@ var SERVE_CAPABILITY_REGISTRY = {
|
|
|
1600
1770
|
// This remains independent from active export so older daemons cannot ignore
|
|
1601
1771
|
// archive intent and return an active transcript with the same session id.
|
|
1602
1772
|
workspace_archived_session_export: { since: "v1" },
|
|
1773
|
+
// Workspace-qualified, memory-only session live-state snapshot plus the
|
|
1774
|
+
// in-memory catalog version token
|
|
1775
|
+
// (`GET /workspaces/:workspace/sessions/live-state`). Independent from
|
|
1776
|
+
// `workspace_qualified_rest_core`: released daemons can advertise that tag
|
|
1777
|
+
// without implementing this route, so clients must pre-flight it directly.
|
|
1778
|
+
// The route stays subject to the per-workspace trust check even when the
|
|
1779
|
+
// tag is advertised.
|
|
1780
|
+
workspace_session_live_state: { since: "v1" },
|
|
1781
|
+
// Workspace-qualified metadata updates for active, inactive, and archived
|
|
1782
|
+
// persisted sessions.
|
|
1783
|
+
workspace_session_metadata: { since: "v1" },
|
|
1603
1784
|
// Workspace-qualified ACP transport (issue #6378 Phase 4):
|
|
1604
1785
|
// `/workspaces/:workspace/acp` mounts a per-runtime ACP dispatcher (HTTP +
|
|
1605
1786
|
// WebSocket) for each registered workspace, with per-runtime device-flow and
|
|
@@ -1880,6 +2061,309 @@ async function createManagedScratchDirectory(root) {
|
|
|
1880
2061
|
}
|
|
1881
2062
|
__name(createManagedScratchDirectory, "createManagedScratchDirectory");
|
|
1882
2063
|
|
|
2064
|
+
// packages/cli/src/serve/conversations/conversation-runtime-errors.ts
|
|
2065
|
+
init_esbuild_shims();
|
|
2066
|
+
var DEFAULT_MESSAGES = {
|
|
2067
|
+
conversation_runtime_in_use: "The Conversations runtime is owned by another daemon.",
|
|
2068
|
+
conversation_runtime_unavailable: "The Conversations runtime is temporarily unavailable.",
|
|
2069
|
+
conversation_root_compromised: "The Conversations root could not be verified.",
|
|
2070
|
+
conversation_runtime_ownership_compromised: "The Conversations runtime ownership state could not be verified."
|
|
2071
|
+
};
|
|
2072
|
+
var ConversationRuntimeOwnershipError = class extends Error {
|
|
2073
|
+
constructor(code, retryable, options) {
|
|
2074
|
+
super(DEFAULT_MESSAGES[code], options);
|
|
2075
|
+
this.code = code;
|
|
2076
|
+
this.retryable = retryable;
|
|
2077
|
+
this.name = "ConversationRuntimeOwnershipError";
|
|
2078
|
+
}
|
|
2079
|
+
static {
|
|
2080
|
+
__name(this, "ConversationRuntimeOwnershipError");
|
|
2081
|
+
}
|
|
2082
|
+
status = 503;
|
|
2083
|
+
};
|
|
2084
|
+
function conversationRuntimeInUseError() {
|
|
2085
|
+
return new ConversationRuntimeOwnershipError(
|
|
2086
|
+
"conversation_runtime_in_use",
|
|
2087
|
+
true
|
|
2088
|
+
);
|
|
2089
|
+
}
|
|
2090
|
+
__name(conversationRuntimeInUseError, "conversationRuntimeInUseError");
|
|
2091
|
+
function conversationRuntimeUnavailableError(cause) {
|
|
2092
|
+
return new ConversationRuntimeOwnershipError(
|
|
2093
|
+
"conversation_runtime_unavailable",
|
|
2094
|
+
true,
|
|
2095
|
+
{ cause }
|
|
2096
|
+
);
|
|
2097
|
+
}
|
|
2098
|
+
__name(conversationRuntimeUnavailableError, "conversationRuntimeUnavailableError");
|
|
2099
|
+
function conversationRuntimeOwnershipCompromisedError(cause) {
|
|
2100
|
+
return new ConversationRuntimeOwnershipError(
|
|
2101
|
+
"conversation_runtime_ownership_compromised",
|
|
2102
|
+
false,
|
|
2103
|
+
{ cause }
|
|
2104
|
+
);
|
|
2105
|
+
}
|
|
2106
|
+
__name(conversationRuntimeOwnershipCompromisedError, "conversationRuntimeOwnershipCompromisedError");
|
|
2107
|
+
function conversationRootCompromisedError(cause) {
|
|
2108
|
+
return new ConversationRuntimeOwnershipError(
|
|
2109
|
+
"conversation_root_compromised",
|
|
2110
|
+
false,
|
|
2111
|
+
{ cause }
|
|
2112
|
+
);
|
|
2113
|
+
}
|
|
2114
|
+
__name(conversationRootCompromisedError, "conversationRootCompromisedError");
|
|
2115
|
+
|
|
2116
|
+
// packages/cli/src/serve/serve-app-lifecycle.ts
|
|
2117
|
+
init_esbuild_shims();
|
|
2118
|
+
var SERVE_APP_LIFECYCLE = Symbol("qwen.serveAppLifecycle");
|
|
2119
|
+
var DEFAULT_CLOSE_TIMEOUT_MS = 5e3;
|
|
2120
|
+
var SECONDARY_CLOSE_TIMEOUT_MS = 2e3;
|
|
2121
|
+
function deferred() {
|
|
2122
|
+
let resolve2;
|
|
2123
|
+
let reject;
|
|
2124
|
+
const promise = new Promise((resolvePromise, rejectPromise) => {
|
|
2125
|
+
resolve2 = resolvePromise;
|
|
2126
|
+
reject = rejectPromise;
|
|
2127
|
+
});
|
|
2128
|
+
void promise.catch(() => void 0);
|
|
2129
|
+
return { promise, resolve: resolve2, reject };
|
|
2130
|
+
}
|
|
2131
|
+
__name(deferred, "deferred");
|
|
2132
|
+
var ServeAppLifecycleController = class {
|
|
2133
|
+
static {
|
|
2134
|
+
__name(this, "ServeAppLifecycleController");
|
|
2135
|
+
}
|
|
2136
|
+
admission = deferred();
|
|
2137
|
+
server;
|
|
2138
|
+
startupReady = true;
|
|
2139
|
+
listenerReady = false;
|
|
2140
|
+
listenerClosed = false;
|
|
2141
|
+
sealed = false;
|
|
2142
|
+
closePending;
|
|
2143
|
+
ownership;
|
|
2144
|
+
appDrain;
|
|
2145
|
+
hostDrain;
|
|
2146
|
+
bootStarter;
|
|
2147
|
+
bootPending;
|
|
2148
|
+
bootStarted = false;
|
|
2149
|
+
bindServer(server, options = {}) {
|
|
2150
|
+
if (this.server || server.listening || this.bootStarted || this.sealed) {
|
|
2151
|
+
throw new Error(
|
|
2152
|
+
"Serve app lifecycle must bind one server before its first listen."
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
this.server = server;
|
|
2156
|
+
this.hostDrain = options.drainHost;
|
|
2157
|
+
this.startupReady = options.startupReady === void 0;
|
|
2158
|
+
server.once("listening", () => {
|
|
2159
|
+
this.listenerReady = true;
|
|
2160
|
+
if (this.sealed) {
|
|
2161
|
+
server.close();
|
|
2162
|
+
server.closeAllConnections();
|
|
2163
|
+
return;
|
|
2164
|
+
}
|
|
2165
|
+
this.openAdmissionIfReady();
|
|
2166
|
+
});
|
|
2167
|
+
server.on("close", () => {
|
|
2168
|
+
this.listenerClosed = true;
|
|
2169
|
+
this.seal();
|
|
2170
|
+
void this.close().catch(() => void 0);
|
|
2171
|
+
});
|
|
2172
|
+
server.on("error", (error) => {
|
|
2173
|
+
if (!this.listenerReady && options.startupReady === void 0) {
|
|
2174
|
+
this.seal(error);
|
|
2175
|
+
void this.close().catch(() => void 0);
|
|
2176
|
+
}
|
|
2177
|
+
});
|
|
2178
|
+
if (options.startupReady) {
|
|
2179
|
+
void options.startupReady.then(
|
|
2180
|
+
() => {
|
|
2181
|
+
this.startupReady = true;
|
|
2182
|
+
this.openAdmissionIfReady();
|
|
2183
|
+
},
|
|
2184
|
+
(error) => {
|
|
2185
|
+
this.seal(error instanceof Error ? error : new Error(String(error)));
|
|
2186
|
+
}
|
|
2187
|
+
);
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
close(options = {}) {
|
|
2191
|
+
if (this.closePending) return this.closePending;
|
|
2192
|
+
const pending = this.closeOnce(options);
|
|
2193
|
+
this.closePending = pending;
|
|
2194
|
+
void pending.catch(() => {
|
|
2195
|
+
if (this.closePending === pending) this.closePending = void 0;
|
|
2196
|
+
});
|
|
2197
|
+
return pending;
|
|
2198
|
+
}
|
|
2199
|
+
setOwnership(ownership) {
|
|
2200
|
+
if (this.ownership) {
|
|
2201
|
+
throw new Error("Serve app lifecycle ownership is already configured.");
|
|
2202
|
+
}
|
|
2203
|
+
this.ownership = ownership;
|
|
2204
|
+
}
|
|
2205
|
+
setAppDrain(drain) {
|
|
2206
|
+
this.appDrain = drain;
|
|
2207
|
+
}
|
|
2208
|
+
setBootStarter(starter) {
|
|
2209
|
+
this.bootStarter = starter;
|
|
2210
|
+
this.openAdmissionIfReady();
|
|
2211
|
+
}
|
|
2212
|
+
async awaitBootAdmission() {
|
|
2213
|
+
if (!this.server || this.sealed) {
|
|
2214
|
+
throw conversationRuntimeUnavailableError();
|
|
2215
|
+
}
|
|
2216
|
+
try {
|
|
2217
|
+
await this.admission.promise;
|
|
2218
|
+
} catch (error) {
|
|
2219
|
+
throw conversationRuntimeUnavailableError(error);
|
|
2220
|
+
}
|
|
2221
|
+
if (this.sealed) {
|
|
2222
|
+
throw conversationRuntimeUnavailableError();
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
async startBoot(starter = this.bootStarter) {
|
|
2226
|
+
await this.awaitBootAdmission();
|
|
2227
|
+
await this.beginBoot(starter);
|
|
2228
|
+
}
|
|
2229
|
+
getBootPromise() {
|
|
2230
|
+
return this.bootPending;
|
|
2231
|
+
}
|
|
2232
|
+
isBootStarted() {
|
|
2233
|
+
return this.bootStarted;
|
|
2234
|
+
}
|
|
2235
|
+
sealBoot() {
|
|
2236
|
+
this.seal();
|
|
2237
|
+
}
|
|
2238
|
+
openAdmissionIfReady() {
|
|
2239
|
+
if (this.sealed || !this.server || !this.listenerReady || !this.startupReady) {
|
|
2240
|
+
return;
|
|
2241
|
+
}
|
|
2242
|
+
this.admission.resolve();
|
|
2243
|
+
const bootStarter = this.bootStarter;
|
|
2244
|
+
if (bootStarter && !this.bootStarted) {
|
|
2245
|
+
void this.beginBoot(bootStarter)?.catch(() => void 0);
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
beginBoot(starter) {
|
|
2249
|
+
if (!starter) return void 0;
|
|
2250
|
+
if (this.sealed) {
|
|
2251
|
+
return Promise.reject(conversationRuntimeUnavailableError());
|
|
2252
|
+
}
|
|
2253
|
+
if (this.bootPending) return this.bootPending;
|
|
2254
|
+
this.bootStarted = true;
|
|
2255
|
+
const pending = Promise.resolve().then(starter);
|
|
2256
|
+
const tracked = pending.finally(() => {
|
|
2257
|
+
if (this.bootPending === tracked) this.bootPending = void 0;
|
|
2258
|
+
});
|
|
2259
|
+
this.bootPending = tracked;
|
|
2260
|
+
void tracked.catch(() => void 0);
|
|
2261
|
+
return tracked;
|
|
2262
|
+
}
|
|
2263
|
+
seal(error) {
|
|
2264
|
+
if (this.sealed) return;
|
|
2265
|
+
this.sealed = true;
|
|
2266
|
+
this.admission.reject(error ?? conversationRuntimeUnavailableError());
|
|
2267
|
+
}
|
|
2268
|
+
async closeOnce(options) {
|
|
2269
|
+
this.seal();
|
|
2270
|
+
const drains = [
|
|
2271
|
+
this.startDrain(this.appDrain),
|
|
2272
|
+
this.startDrain(this.hostDrain),
|
|
2273
|
+
this.bootPending?.catch(() => void 0)
|
|
2274
|
+
].filter((value) => value !== void 0);
|
|
2275
|
+
const listenerClose = this.closeListener(
|
|
2276
|
+
options.timeoutMs ?? DEFAULT_CLOSE_TIMEOUT_MS
|
|
2277
|
+
);
|
|
2278
|
+
const results = await Promise.allSettled([...drains, listenerClose]);
|
|
2279
|
+
const errors = results.filter(
|
|
2280
|
+
(result) => result.status === "rejected"
|
|
2281
|
+
).map((result) => result.reason);
|
|
2282
|
+
if (errors.length === 1) {
|
|
2283
|
+
throw errors[0];
|
|
2284
|
+
}
|
|
2285
|
+
if (errors.length > 1) {
|
|
2286
|
+
throw new AggregateError(errors, "Serve app shutdown is incomplete.");
|
|
2287
|
+
}
|
|
2288
|
+
await this.ownership?.release();
|
|
2289
|
+
}
|
|
2290
|
+
startDrain(drain) {
|
|
2291
|
+
if (!drain) return void 0;
|
|
2292
|
+
try {
|
|
2293
|
+
return drain();
|
|
2294
|
+
} catch (error) {
|
|
2295
|
+
return Promise.reject(error);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
closeListener(timeoutMs) {
|
|
2299
|
+
if (!this.server || this.listenerClosed || !this.listenerReady && !this.server.listening) {
|
|
2300
|
+
return Promise.resolve();
|
|
2301
|
+
}
|
|
2302
|
+
const server = this.server;
|
|
2303
|
+
if (!server.listening) {
|
|
2304
|
+
return this.waitForClosingListener(server, timeoutMs);
|
|
2305
|
+
}
|
|
2306
|
+
return new Promise((resolve2, reject) => {
|
|
2307
|
+
let secondaryTimer;
|
|
2308
|
+
const forceTimer = setTimeout(
|
|
2309
|
+
() => {
|
|
2310
|
+
server.closeAllConnections();
|
|
2311
|
+
secondaryTimer = setTimeout(() => {
|
|
2312
|
+
reject(new Error("The serve listener did not confirm shutdown."));
|
|
2313
|
+
}, SECONDARY_CLOSE_TIMEOUT_MS);
|
|
2314
|
+
secondaryTimer.unref();
|
|
2315
|
+
},
|
|
2316
|
+
Math.max(0, timeoutMs)
|
|
2317
|
+
);
|
|
2318
|
+
forceTimer.unref();
|
|
2319
|
+
server.close((error) => {
|
|
2320
|
+
clearTimeout(forceTimer);
|
|
2321
|
+
if (secondaryTimer) clearTimeout(secondaryTimer);
|
|
2322
|
+
if (error) reject(error);
|
|
2323
|
+
else {
|
|
2324
|
+
this.listenerClosed = true;
|
|
2325
|
+
resolve2();
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
waitForClosingListener(server, timeoutMs) {
|
|
2331
|
+
return new Promise((resolve2, reject) => {
|
|
2332
|
+
let secondaryTimer;
|
|
2333
|
+
const onClose = /* @__PURE__ */ __name(() => {
|
|
2334
|
+
server.off("close", onClose);
|
|
2335
|
+
clearTimeout(forceTimer);
|
|
2336
|
+
if (secondaryTimer) clearTimeout(secondaryTimer);
|
|
2337
|
+
this.listenerClosed = true;
|
|
2338
|
+
resolve2();
|
|
2339
|
+
}, "onClose");
|
|
2340
|
+
const forceTimer = setTimeout(
|
|
2341
|
+
() => {
|
|
2342
|
+
server.closeAllConnections();
|
|
2343
|
+
secondaryTimer = setTimeout(() => {
|
|
2344
|
+
server.off("close", onClose);
|
|
2345
|
+
reject(new Error("The serve listener did not confirm shutdown."));
|
|
2346
|
+
}, SECONDARY_CLOSE_TIMEOUT_MS);
|
|
2347
|
+
secondaryTimer.unref();
|
|
2348
|
+
},
|
|
2349
|
+
Math.max(0, timeoutMs)
|
|
2350
|
+
);
|
|
2351
|
+
forceTimer.unref();
|
|
2352
|
+
server.once("close", onClose);
|
|
2353
|
+
if (this.listenerClosed) onClose();
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
function installServeAppLifecycle(app, lifecycle = new ServeAppLifecycleController()) {
|
|
2358
|
+
const locals = app.locals;
|
|
2359
|
+
if (locals[SERVE_APP_LIFECYCLE]) {
|
|
2360
|
+
throw new Error("Serve app lifecycle is already installed.");
|
|
2361
|
+
}
|
|
2362
|
+
locals[SERVE_APP_LIFECYCLE] = lifecycle;
|
|
2363
|
+
return lifecycle;
|
|
2364
|
+
}
|
|
2365
|
+
__name(installServeAppLifecycle, "installServeAppLifecycle");
|
|
2366
|
+
|
|
1883
2367
|
// packages/cli/src/serve/server/request-helpers.ts
|
|
1884
2368
|
init_esbuild_shims();
|
|
1885
2369
|
function sendJsonBodyParserError(res, err) {
|
|
@@ -2349,6 +2833,70 @@ __name(resolveAcpHttpEnabled, "resolveAcpHttpEnabled");
|
|
|
2349
2833
|
// packages/cli/src/serve/daemon-status.ts
|
|
2350
2834
|
init_esbuild_shims();
|
|
2351
2835
|
|
|
2836
|
+
// packages/cli/src/serve/acp-http/pre-attach-budget.ts
|
|
2837
|
+
init_esbuild_shims();
|
|
2838
|
+
var ACP_PRE_ATTACH_MAX_FRAMES_PER_STREAM = 256;
|
|
2839
|
+
var ACP_PRE_ATTACH_MAX_FRAMES_PER_CONNECTION = 1024;
|
|
2840
|
+
var ACP_PRE_ATTACH_MAX_FRAMES_GLOBAL = 4096;
|
|
2841
|
+
var ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_PER_CONNECTION = 64 * 1024 * 1024;
|
|
2842
|
+
var ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_GLOBAL = 256 * 1024 * 1024;
|
|
2843
|
+
var AcpPreAttachBudget = class {
|
|
2844
|
+
constructor(limits = {
|
|
2845
|
+
maxFrames: ACP_PRE_ATTACH_MAX_FRAMES_GLOBAL,
|
|
2846
|
+
maxBytes: ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_GLOBAL
|
|
2847
|
+
}) {
|
|
2848
|
+
this.limits = limits;
|
|
2849
|
+
}
|
|
2850
|
+
static {
|
|
2851
|
+
__name(this, "AcpPreAttachBudget");
|
|
2852
|
+
}
|
|
2853
|
+
usedFrames = 0;
|
|
2854
|
+
usedBytes = 0;
|
|
2855
|
+
pendingDeliveryFrames = 0;
|
|
2856
|
+
highWaterFrames = 0;
|
|
2857
|
+
highWaterBytes = 0;
|
|
2858
|
+
guardFailures = 0;
|
|
2859
|
+
tryReserve(bytes) {
|
|
2860
|
+
if (this.usedFrames >= this.limits.maxFrames || bytes > this.limits.maxBytes - this.usedBytes) {
|
|
2861
|
+
this.guardFailures += 1;
|
|
2862
|
+
return void 0;
|
|
2863
|
+
}
|
|
2864
|
+
this.usedFrames += 1;
|
|
2865
|
+
this.usedBytes += bytes;
|
|
2866
|
+
this.highWaterFrames = Math.max(this.highWaterFrames, this.usedFrames);
|
|
2867
|
+
this.highWaterBytes = Math.max(this.highWaterBytes, this.usedBytes);
|
|
2868
|
+
let released = false;
|
|
2869
|
+
let pendingDelivery = false;
|
|
2870
|
+
return {
|
|
2871
|
+
markPendingDelivery: /* @__PURE__ */ __name(() => {
|
|
2872
|
+
if (released || pendingDelivery) return;
|
|
2873
|
+
pendingDelivery = true;
|
|
2874
|
+
this.pendingDeliveryFrames += 1;
|
|
2875
|
+
}, "markPendingDelivery"),
|
|
2876
|
+
release: /* @__PURE__ */ __name(() => {
|
|
2877
|
+
if (released) return;
|
|
2878
|
+
released = true;
|
|
2879
|
+
if (pendingDelivery) this.pendingDeliveryFrames -= 1;
|
|
2880
|
+
this.usedFrames -= 1;
|
|
2881
|
+
this.usedBytes -= bytes;
|
|
2882
|
+
}, "release")
|
|
2883
|
+
};
|
|
2884
|
+
}
|
|
2885
|
+
recordGuardFailure() {
|
|
2886
|
+
this.guardFailures += 1;
|
|
2887
|
+
}
|
|
2888
|
+
snapshot() {
|
|
2889
|
+
return {
|
|
2890
|
+
usedFrames: this.usedFrames,
|
|
2891
|
+
usedBytes: this.usedBytes,
|
|
2892
|
+
pendingDeliveryFrames: this.pendingDeliveryFrames,
|
|
2893
|
+
highWaterFrames: this.highWaterFrames,
|
|
2894
|
+
highWaterBytes: this.highWaterBytes,
|
|
2895
|
+
guardFailures: this.guardFailures
|
|
2896
|
+
};
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
|
|
2352
2900
|
// packages/cli/src/serve/daemon-memory-pressure.ts
|
|
2353
2901
|
init_esbuild_shims();
|
|
2354
2902
|
import { getHeapStatistics } from "node:v8";
|
|
@@ -2458,8 +3006,10 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2458
3006
|
const bridgeSnapshot = input.bridge.getDaemonStatusSnapshot();
|
|
2459
3007
|
const lastActivity = input.bridge.lastActivityAt ?? null;
|
|
2460
3008
|
const workspaceRuntimes = input.workspaceRegistry?.list();
|
|
2461
|
-
const
|
|
3009
|
+
const aggregateRuntimes = input.workspaceRegistry?.listAll?.() ?? workspaceRuntimes;
|
|
3010
|
+
const workspaceSnapshots = aggregateRuntimes?.map((runtime) => ({
|
|
2462
3011
|
workspaceCwd: runtime.workspaceCwd,
|
|
3012
|
+
internal: isInternalWorkspaceRuntime(runtime),
|
|
2463
3013
|
snapshot: runtime.bridge === input.bridge ? bridgeSnapshot : runtime.bridge.getDaemonStatusSnapshot(),
|
|
2464
3014
|
lastActivity: runtime.bridge === input.bridge ? lastActivity : runtime.bridge.lastActivityAt ?? null
|
|
2465
3015
|
})) ?? [
|
|
@@ -2485,7 +3035,7 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2485
3035
|
if (memoryBudget) {
|
|
2486
3036
|
const managedRuntimes = input.workspaceRegistry?.listManaged();
|
|
2487
3037
|
const activeAcpChildCount = managedRuntimes ? managedRuntimes.filter((runtime) => runtime.bridge.isChannelLive()).length : workspaceSnapshots.filter((item) => item.snapshot.channelLive).length;
|
|
2488
|
-
const registeredWorkspaceCount = input.workspaceRegistry ? input.workspaceRegistry.listEntries().length : workspaceSnapshots.length;
|
|
3038
|
+
const registeredWorkspaceCount = input.workspaceRegistry ? (input.workspaceRegistry.listAllEntries?.() ?? input.workspaceRegistry.listEntries()).length : workspaceSnapshots.length;
|
|
2489
3039
|
let childRssBytesTotal = 0;
|
|
2490
3040
|
let childRssSampled = 0;
|
|
2491
3041
|
let oldestChildReadingAgeMs = null;
|
|
@@ -2558,7 +3108,7 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2558
3108
|
}
|
|
2559
3109
|
derivedQueuedPromptsByWorkspace[index] = derivedQueuedPromptsForWorkspace;
|
|
2560
3110
|
}
|
|
2561
|
-
const queuedPrompts =
|
|
3111
|
+
const queuedPrompts = aggregateRuntimes?.reduce(
|
|
2562
3112
|
(sum, runtime, index) => sum + (runtime.bridge.pendingPromptTotal ?? derivedQueuedPromptsByWorkspace[index] ?? 0),
|
|
2563
3113
|
0
|
|
2564
3114
|
) ?? input.bridge.pendingPromptTotal ?? derivedQueuedPrompts;
|
|
@@ -2616,7 +3166,7 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2616
3166
|
full = await buildFullStatus(
|
|
2617
3167
|
input,
|
|
2618
3168
|
acpAggregate,
|
|
2619
|
-
workspaceSnapshots.flatMap((item) => item.snapshot.sessions)
|
|
3169
|
+
workspaceSnapshots.filter((item) => item.internal !== true).flatMap((item) => item.snapshot.sessions)
|
|
2620
3170
|
);
|
|
2621
3171
|
pushFullIssues(issues, full);
|
|
2622
3172
|
}
|
|
@@ -2668,6 +3218,11 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2668
3218
|
channelIdleTimeoutMs: bridgeSnapshot.limits.channelIdleTimeoutMs,
|
|
2669
3219
|
sessionIdleTimeoutMs: bridgeSnapshot.limits.sessionIdleTimeoutMs,
|
|
2670
3220
|
acpConnectionCap: acpSnapshot?.connectionCap ?? null,
|
|
3221
|
+
acpPreAttachMaxFramesPerStream: acpSnapshot !== void 0 ? ACP_PRE_ATTACH_MAX_FRAMES_PER_STREAM : null,
|
|
3222
|
+
acpPreAttachMaxFramesPerConnection: acpSnapshot !== void 0 ? ACP_PRE_ATTACH_MAX_FRAMES_PER_CONNECTION : null,
|
|
3223
|
+
acpPreAttachMaxFramesGlobal: acpSnapshot !== void 0 ? ACP_PRE_ATTACH_MAX_FRAMES_GLOBAL : null,
|
|
3224
|
+
acpPreAttachMaxPayloadBytesPerConnection: acpSnapshot !== void 0 ? ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_PER_CONNECTION : null,
|
|
3225
|
+
acpPreAttachMaxPayloadBytesGlobal: acpSnapshot !== void 0 ? ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_GLOBAL : null,
|
|
2671
3226
|
memory: toDaemonStatusMemoryLimits(
|
|
2672
3227
|
memoryBudget,
|
|
2673
3228
|
input.getChildHeapPolicySnapshot?.(),
|
|
@@ -2712,7 +3267,17 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2712
3267
|
sessionStreams: acpAggregate?.sessionStreams ?? 0,
|
|
2713
3268
|
sseStreams: acpAggregate?.sseStreams ?? 0,
|
|
2714
3269
|
wsStreams: acpAggregate?.wsStreams ?? 0,
|
|
2715
|
-
pendingClientRequests: acpAggregate?.pendingClientRequests ?? 0
|
|
3270
|
+
pendingClientRequests: acpAggregate?.pendingClientRequests ?? 0,
|
|
3271
|
+
preAttach: {
|
|
3272
|
+
bufferedConnectionFrames: acpAggregate?.bufferedConnectionFrames ?? 0,
|
|
3273
|
+
bufferedSessionFrames: acpAggregate?.bufferedSessionFrames ?? 0,
|
|
3274
|
+
pendingDeliveryFrames: acpAggregate?.pendingDeliveryFrames ?? 0,
|
|
3275
|
+
usedFrames: acpAggregate?.preAttach.usedFrames ?? 0,
|
|
3276
|
+
usedBytes: acpAggregate?.preAttach.usedBytes ?? 0,
|
|
3277
|
+
highWaterFrames: acpAggregate?.preAttach.highWaterFrames ?? 0,
|
|
3278
|
+
highWaterBytes: acpAggregate?.preAttach.highWaterBytes ?? 0,
|
|
3279
|
+
guardFailures: acpAggregate?.preAttach.guardFailures ?? 0
|
|
3280
|
+
}
|
|
2716
3281
|
}
|
|
2717
3282
|
},
|
|
2718
3283
|
rateLimit: {
|
|
@@ -2722,7 +3287,7 @@ async function buildDaemonStatusResponse(detail, input) {
|
|
|
2722
3287
|
...input.getPerfSnapshot ? { perf: input.getPerfSnapshot() } : {},
|
|
2723
3288
|
...input.getMetricsSeries ? { metrics: { series: input.getMetricsSeries() } } : {},
|
|
2724
3289
|
activity: {
|
|
2725
|
-
activePrompts:
|
|
3290
|
+
activePrompts: aggregateRuntimes?.reduce(
|
|
2726
3291
|
(sum, runtime) => sum + (runtime.bridge.activePromptCount ?? 0),
|
|
2727
3292
|
0
|
|
2728
3293
|
) ?? input.bridge.activePromptCount ?? 0,
|
|
@@ -2793,6 +3358,7 @@ async function buildFullStatus(input, acpSnapshot, sessions) {
|
|
|
2793
3358
|
]);
|
|
2794
3359
|
return {
|
|
2795
3360
|
sessions,
|
|
3361
|
+
acpMounts: acpSnapshot?.mounts ?? [],
|
|
2796
3362
|
acpConnections: acpSnapshot?.connections ?? [],
|
|
2797
3363
|
workspace: {
|
|
2798
3364
|
mcp,
|
|
@@ -2851,12 +3417,12 @@ async function withTimeout(promise, section, timeoutMs) {
|
|
|
2851
3417
|
}
|
|
2852
3418
|
__name(withTimeout, "withTimeout");
|
|
2853
3419
|
function pushRuntimeIssues(issues, acpSnapshot, acpAggregate, rateLimitHits, input, channelWorker, channelWorkers, totalAdmissionSnapshot, workspaceSnapshots) {
|
|
2854
|
-
for (const { workspaceCwd, snapshot } of workspaceSnapshots) {
|
|
3420
|
+
for (const { workspaceCwd, internal, snapshot } of workspaceSnapshots) {
|
|
2855
3421
|
if (snapshot.limits.maxSessions !== null && snapshot.limits.maxSessions > 0 && snapshot.sessionCount / snapshot.limits.maxSessions >= CAPACITY_WARNING_RATIO) {
|
|
2856
3422
|
issues.push({
|
|
2857
3423
|
code: "session_capacity_high",
|
|
2858
3424
|
severity: "warning",
|
|
2859
|
-
message: workspaceSnapshots.length > 1 ? `Workspace ${workspaceCwd} active sessions are at ${snapshot.sessionCount}/${snapshot.limits.maxSessions}.` : `Active sessions are at ${snapshot.sessionCount}/${snapshot.limits.maxSessions}.`
|
|
3425
|
+
message: workspaceSnapshots.length > 1 ? internal ? `An internal runtime's active sessions are at ${snapshot.sessionCount}/${snapshot.limits.maxSessions}.` : `Workspace ${workspaceCwd} active sessions are at ${snapshot.sessionCount}/${snapshot.limits.maxSessions}.` : `Active sessions are at ${snapshot.sessionCount}/${snapshot.limits.maxSessions}.`
|
|
2860
3426
|
});
|
|
2861
3427
|
}
|
|
2862
3428
|
}
|
|
@@ -2907,7 +3473,7 @@ function pushRuntimeIssues(issues, acpSnapshot, acpAggregate, rateLimitHits, inp
|
|
|
2907
3473
|
issues.push({
|
|
2908
3474
|
code: "acp_channel_down",
|
|
2909
3475
|
severity: "error",
|
|
2910
|
-
message: downWorkspaces.length === 1 ? `Active sessions exist but the ACP channel is not live for ${downWorkspaces[0].workspaceCwd}.` : `Active sessions exist but the ACP channel is not live for ${downWorkspaces.length} workspace(s).`
|
|
3476
|
+
message: downWorkspaces.length === 1 ? downWorkspaces[0].internal ? "Active sessions exist but the ACP channel is not live for an internal runtime." : `Active sessions exist but the ACP channel is not live for ${downWorkspaces[0].workspaceCwd}.` : `Active sessions exist but the ACP channel is not live for ${downWorkspaces.length} workspace(s).`
|
|
2911
3477
|
});
|
|
2912
3478
|
}
|
|
2913
3479
|
if (input.opts.rateLimit === true && sumRateHits(rateLimitHits) > 0) {
|
|
@@ -3494,11 +4060,18 @@ export {
|
|
|
3494
4060
|
createBridgeFileSystemAdapter,
|
|
3495
4061
|
PathMutexRegistry,
|
|
3496
4062
|
isDeepHealthQuery,
|
|
4063
|
+
CredentialStore,
|
|
4064
|
+
singleTokenCredentials,
|
|
4065
|
+
tagListener,
|
|
4066
|
+
listenerIdentityOf,
|
|
4067
|
+
listenerIdentityOfSocket,
|
|
3497
4068
|
denyBrowserOriginCors,
|
|
3498
4069
|
parseAllowOriginPatterns,
|
|
4070
|
+
MutableOriginAllowlist,
|
|
3499
4071
|
allowOriginCors,
|
|
3500
4072
|
hostAllowlist,
|
|
3501
4073
|
bearerAuth,
|
|
4074
|
+
requestWasAuthenticated,
|
|
3502
4075
|
createMutationGate,
|
|
3503
4076
|
ClientMcpSenderRegistry,
|
|
3504
4077
|
createClientMcpServerProvider,
|
|
@@ -3510,6 +4083,13 @@ export {
|
|
|
3510
4083
|
isScratchRootCompatible,
|
|
3511
4084
|
prepareManagedScratchRoot,
|
|
3512
4085
|
createManagedScratchDirectory,
|
|
4086
|
+
ConversationRuntimeOwnershipError,
|
|
4087
|
+
conversationRuntimeInUseError,
|
|
4088
|
+
conversationRuntimeUnavailableError,
|
|
4089
|
+
conversationRuntimeOwnershipCompromisedError,
|
|
4090
|
+
conversationRootCompromisedError,
|
|
4091
|
+
ServeAppLifecycleController,
|
|
4092
|
+
installServeAppLifecycle,
|
|
3513
4093
|
sendJsonBodyParserError,
|
|
3514
4094
|
CLIENT_ID_HEADER,
|
|
3515
4095
|
MAX_CLIENT_ID_LENGTH,
|
|
@@ -3534,6 +4114,12 @@ export {
|
|
|
3534
4114
|
setRateLimiter,
|
|
3535
4115
|
getRateLimiter,
|
|
3536
4116
|
resolveAcpHttpEnabled,
|
|
4117
|
+
ACP_PRE_ATTACH_MAX_FRAMES_PER_STREAM,
|
|
4118
|
+
ACP_PRE_ATTACH_MAX_FRAMES_PER_CONNECTION,
|
|
4119
|
+
ACP_PRE_ATTACH_MAX_FRAMES_GLOBAL,
|
|
4120
|
+
ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_PER_CONNECTION,
|
|
4121
|
+
ACP_PRE_ATTACH_MAX_PAYLOAD_BYTES_GLOBAL,
|
|
4122
|
+
AcpPreAttachBudget,
|
|
3537
4123
|
toDaemonStatusMemoryLimits,
|
|
3538
4124
|
parseDaemonStatusDetail,
|
|
3539
4125
|
buildDaemonStatusResponse,
|