@qwen-code/qwen-code 0.21.11-preview.0 → 0.21.12-preview.1
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/coordinate/SKILL.md +52 -0
- package/bundled/qc-helper/docs/configuration/model-providers.md +10 -8
- package/bundled/qc-helper/docs/features/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/arena.md +4 -3
- package/bundled/qc-helper/docs/features/commands.md +7 -6
- package/bundled/qc-helper/docs/features/dual-output.md +5 -0
- package/bundled/qc-helper/docs/features/headless.md +8 -0
- package/bundled/qc-helper/docs/features/multi-agent-coordination.md +30 -0
- package/bundled/qc-helper/docs/qwen-serve.md +7 -7
- package/bundled/review/SKILL.md +17 -7
- package/chunks/{MaxSizedBox-FVSXOMKP.js → MaxSizedBox-VSAJNP52.js} +49 -48
- package/chunks/{StandaloneSessionPicker-Q27UAQ3X.js → StandaloneSessionPicker-N5MC42M2.js} +73 -70
- package/chunks/{acp-startup-profiler-VNTFWYAC.js → acp-startup-profiler-JMJBZDVO.js} +2 -2
- package/chunks/{acpAgent-C6TV2BIU.js → acpAgent-GUV7LTDH.js} +1143 -317
- package/chunks/{agent-IPODFZTU.js → agent-WJT3BALC.js} +45 -44
- package/chunks/agent-headless-JRRUUVP3.js +87 -0
- package/chunks/{anthropicContentGenerator-D3Y4RFT4.js → anthropicContentGenerator-4JSC3ZFL.js} +27 -27
- package/chunks/{artifact-tool-N652YE4L.js → artifact-tool-FRMBPDPB.js} +5 -5
- package/chunks/{askUserQuestion-ONW74PKJ.js → askUserQuestion-7G3LI3IZ.js} +2 -2
- package/chunks/{bridge-YX2R6VVM.js → bridge-VB3BPG7G.js} +50 -49
- package/chunks/{build-GDBLPA24.js → build-RZS65IIX.js} +1 -1
- package/chunks/{ca-ZLKAB4K3.js → ca-4CQ6MYNQ.js} +2 -1
- package/chunks/{channel-management-service-PHELKOW2.js → channel-management-service-SKAN6NOB.js} +6 -6
- package/chunks/channel-settings-store-UM7JZEW7.js +102 -0
- package/chunks/{channel-worker-group-WQP4RCDO.js → channel-worker-group-YPTB5ASD.js} +8 -7
- package/chunks/{channel-worker-manager-MRDFAKIM.js → channel-worker-manager-4EHJSPRH.js} +8 -7
- package/chunks/{channel-worker-supervisor-IVSDIMI4.js → channel-worker-supervisor-DZKHYFHV.js} +6 -5
- package/chunks/{chunk-J6SZID63.js → chunk-2AZMF6G5.js} +2 -2
- package/chunks/{chunk-2IIJTXYF.js → chunk-2SB4SLKC.js} +3 -1
- package/chunks/{chunk-VKJ4KTPJ.js → chunk-3GCU5O2E.js} +1 -1
- package/chunks/{chunk-PDUIXSYP.js → chunk-3SIXC6QC.js} +7 -7
- package/chunks/{chunk-Q3JQ7OSU.js → chunk-3XZYK76R.js} +2 -2
- package/chunks/{chunk-SVY7G3WS.js → chunk-3ZLUA4GV.js} +9 -9
- package/chunks/{chunk-6CONQTS2.js → chunk-45TYWBCB.js} +1 -1
- package/chunks/{chunk-OWMAZHIX.js → chunk-47FQVRCO.js} +1 -1
- package/chunks/{chunk-VNNWAZSI.js → chunk-4W25XH7F.js} +7 -7
- package/chunks/{chunk-VVSMEI6C.js → chunk-5AWARYOK.js} +22 -101
- package/chunks/{chunk-I7XTOGIS.js → chunk-5DDUYIY6.js} +7 -7
- package/chunks/{chunk-HV76SFIA.js → chunk-5HBFERG5.js} +3 -3
- package/chunks/{chunk-IIJEYBNH.js → chunk-5PWLQ7SK.js} +191 -61
- package/chunks/{chunk-BSI645OU.js → chunk-5TXOGH4I.js} +3 -3
- package/chunks/{chunk-BO2VRKY2.js → chunk-67LXZ6LV.js} +7 -7
- package/chunks/{chunk-KHLBIO6M.js → chunk-6LK2QPIA.js} +11 -11
- package/chunks/{chunk-WAUGQKUU.js → chunk-6LYDH7VT.js} +9 -5
- package/chunks/{chunk-S6HYI3MF.js → chunk-6S52N6PG.js} +2 -2
- package/chunks/{chunk-DZUO626D.js → chunk-6XZERB6P.js} +5 -5
- package/chunks/{chunk-FVKHVJZQ.js → chunk-732MOPEM.js} +1 -1
- package/chunks/{chunk-5C7FDVHB.js → chunk-7L64FSYQ.js} +55 -477
- package/chunks/{chunk-V3KCCRKA.js → chunk-7N6WK2W6.js} +3 -3
- package/chunks/chunk-7P32M35F.js +51 -0
- package/chunks/{chunk-T3FNRMFJ.js → chunk-7PBUQKMT.js} +1 -1
- package/chunks/{chunk-WCG5O7IP.js → chunk-7SUQZ7QH.js} +2 -2
- package/chunks/{chunk-LU7RJB2W.js → chunk-A7M57KOL.js} +8 -8
- package/chunks/{chunk-6WIKTX4C.js → chunk-ABGS4FDQ.js} +1 -1
- package/chunks/{chunk-DVQECPGW.js → chunk-AJL3SAZG.js} +12 -12
- package/chunks/{chunk-NV3F44FL.js → chunk-AMXMM7DH.js} +2 -2
- package/chunks/{chunk-UVX4Y6IN.js → chunk-AQHNAA7E.js} +1 -1
- package/chunks/{chunk-TG3IUQ6M.js → chunk-C2VGLLNA.js} +4 -4
- package/chunks/{chunk-H6XPXXMH.js → chunk-CQ35AJ4Z.js} +252 -254
- package/chunks/{chunk-COBO5EBO.js → chunk-CTQE2NB2.js} +1 -1
- package/chunks/{chunk-PWYEWOZM.js → chunk-CX2MARRJ.js} +1 -1
- package/chunks/{chunk-E2FPSSKP.js → chunk-DEG7R6Z6.js} +57 -13
- package/chunks/{chunk-A6PSUNCY.js → chunk-DEVFUPC5.js} +8 -8
- package/chunks/{chunk-RKCPPZV6.js → chunk-DGM2XA3R.js} +1 -1
- package/chunks/{chunk-4P66JPNV.js → chunk-DNRV2US3.js} +5 -5
- package/chunks/{chunk-TYAMGABM.js → chunk-E3GLDLYB.js} +6 -0
- package/chunks/{chunk-L2AFWWJE.js → chunk-E5BWLU5J.js} +50 -5
- package/chunks/{chunk-7C7RTJPC.js → chunk-EAJESCBT.js} +7 -9
- package/chunks/{chunk-KKBPOU75.js → chunk-EFIMD5VA.js} +1 -1
- package/chunks/{chunk-CTJLZLB5.js → chunk-EN2J77G7.js} +1 -1
- package/chunks/{chunk-67EWJE77.js → chunk-ENEEQMGM.js} +1 -1
- package/chunks/{chunk-CPG6P4GG.js → chunk-EYS3GGM3.js} +1 -1
- package/chunks/{chunk-4PYCZH2V.js → chunk-EYW54TBD.js} +3 -3
- package/chunks/{chunk-FOGU3LJX.js → chunk-F6AOBFUN.js} +1 -1
- package/chunks/{chunk-F32C6V5B.js → chunk-FLUYVAQZ.js} +3 -3
- package/chunks/{chunk-7WUUNAJP.js → chunk-FMLUVVQ6.js} +3 -3
- package/chunks/{chunk-ZBVS26BY.js → chunk-FPGTNKCP.js} +7 -5
- package/chunks/{chunk-HOUK5CR2.js → chunk-FWJRWCKU.js} +6 -6
- package/chunks/{chunk-HGBUHVFO.js → chunk-G4C5RLX6.js} +3 -3
- package/chunks/{chunk-EI3HZX6C.js → chunk-GJJQV4PY.js} +1 -1
- package/chunks/{chunk-CKASRHZI.js → chunk-GLWWPFTW.js} +1 -1
- package/chunks/{chunk-2Z6PYTOK.js → chunk-GQW6P73F.js} +1 -1
- package/chunks/{chunk-GM463R2B.js → chunk-GZGDJ4E6.js} +1 -1
- package/chunks/{chunk-YGT2AUJ7.js → chunk-HB6QW4LM.js} +37 -20
- package/chunks/{chunk-W5UC37EE.js → chunk-HHGQGTJQ.js} +2 -0
- package/chunks/chunk-HHJLM3WQ.js +41 -0
- package/chunks/{chunk-6ZRFAKXK.js → chunk-IEP44U2R.js} +1 -1
- package/chunks/{chunk-O3VWAZLP.js → chunk-INQN4KIA.js} +871 -1033
- package/chunks/{chunk-AOHJKPKL.js → chunk-IQFYO5BF.js} +1 -1
- package/chunks/{chunk-UDXSXLER.js → chunk-IW6RQPQB.js} +14 -4
- package/chunks/{chunk-XCWO3SMQ.js → chunk-IX7CFQGA.js} +3 -3
- package/chunks/{chunk-6S4NCX23.js → chunk-JO45C3OY.js} +3 -3
- package/chunks/{chunk-HDHLWOG5.js → chunk-JRRZFO4A.js} +2 -2
- package/chunks/{chunk-OQTXYMKW.js → chunk-JS4Q5NG5.js} +3 -3
- package/chunks/{chunk-UMEB4DHF.js → chunk-JWXBLIQL.js} +4 -4
- package/chunks/{chunk-PBRVUF5B.js → chunk-K7JW6V5O.js} +1 -1
- package/chunks/{chunk-ZZCWJWTF.js → chunk-KNQZXSLW.js} +9 -3
- package/chunks/{chunk-M6HMMKVG.js → chunk-KPVVWKF3.js} +1 -1
- package/chunks/{chunk-MVUQRLOH.js → chunk-KT4OWAAZ.js} +3 -3
- package/chunks/{chunk-W4RQUHY3.js → chunk-L2GTEEEU.js} +142 -23
- package/chunks/{chunk-X7XXP7CN.js → chunk-L2O7DJIE.js} +2 -2
- package/chunks/{chunk-BCZ2TTSH.js → chunk-LCWRQA5U.js} +1 -1
- package/chunks/{chunk-22C7BQ6D.js → chunk-LHOG4E6Y.js} +3 -3
- package/chunks/{chunk-3WOZVMGJ.js → chunk-LOJO2RPW.js} +7 -7
- package/chunks/{chunk-DX3RGJMS.js → chunk-LT532KF4.js} +71 -12
- package/chunks/{chunk-JT7XS4YW.js → chunk-M2NMFAFR.js} +1 -1
- package/chunks/{chunk-P6RBCBBE.js → chunk-M2S67TPJ.js} +3 -3
- package/chunks/{chunk-AJ6LQ5A6.js → chunk-M3QYOPGN.js} +1 -1
- package/chunks/{chunk-AZQ3DT76.js → chunk-M4NWDIFU.js} +1 -1
- package/chunks/{chunk-YTFDX4PR.js → chunk-M6NDLY2T.js} +1 -1
- package/chunks/{chunk-X76PVMPQ.js → chunk-MJ5FMYVQ.js} +3 -3
- package/chunks/{chunk-EKPKKXY2.js → chunk-MLZCPGDX.js} +1 -1
- package/chunks/{chunk-CQGGDOR5.js → chunk-MM4XBXF7.js} +1 -1
- package/chunks/{chunk-UHJ5S7DF.js → chunk-MMH3GO4Z.js} +11 -11
- package/chunks/{chunk-OIVKILPI.js → chunk-MPBRV3UU.js} +3 -0
- package/chunks/{chunk-VFMASYQA.js → chunk-MS7GNABG.js} +3 -0
- package/chunks/{chunk-2FRY5CRX.js → chunk-MWZYNOCG.js} +3 -3
- package/chunks/chunk-N2TNM3QB.js +9 -0
- package/chunks/{chunk-7MH4J33A.js → chunk-N7NBMAMW.js} +2 -2
- package/chunks/{chunk-EUNWC2VS.js → chunk-NC4O6UE6.js} +2 -2
- package/chunks/{chunk-HUWENAHO.js → chunk-NWPO6I7V.js} +1 -1
- package/chunks/{chunk-SR7RZ4MS.js → chunk-O4BBDP2G.js} +2 -2
- package/chunks/{chunk-4TRQPFDP.js → chunk-O5AZPHYZ.js} +6 -8
- package/chunks/{chunk-XGLVQQ6F.js → chunk-OH5UKBLL.js} +4 -4
- package/chunks/{chunk-PIA35YOG.js → chunk-OLU7GIF4.js} +14 -45
- package/chunks/{chunk-DA4HRSBW.js → chunk-OPBATTFQ.js} +1 -1
- package/chunks/{chunk-7S4DYMFG.js → chunk-OSPIZEAM.js} +34 -23
- package/chunks/{chunk-K4QON4BH.js → chunk-OYLNJPY3.js} +61 -364
- package/chunks/{chunk-DREZZAZM.js → chunk-P2UCMHDT.js} +14 -6
- package/chunks/chunk-PDKLO2DN.js +526 -0
- package/chunks/{chunk-TZ3FN4B2.js → chunk-PRWGIKKU.js} +5 -5
- package/chunks/{chunk-FYTHSJDQ.js → chunk-Q6FGSG6B.js} +2 -2
- package/chunks/{chunk-VBU76UYP.js → chunk-QIN5P5BP.js} +315 -1081
- package/chunks/{chunk-2UUMVNYT.js → chunk-QTI7SRXI.js} +3 -3
- package/chunks/{chunk-B2GJNDTV.js → chunk-QUESTNOP.js} +1 -1
- package/chunks/{chunk-6Q5ABMTU.js → chunk-QZ5G26ZE.js} +36 -32
- package/chunks/{chunk-7OFX3YZW.js → chunk-RE6JD2BH.js} +1 -1
- package/chunks/{chunk-QUI267ZP.js → chunk-SAQHDAUJ.js} +42 -8
- package/chunks/{chunk-UXV3DYVT.js → chunk-SZ36WFVK.js} +1 -1
- package/chunks/{chunk-FTO3P6PZ.js → chunk-T2VEHZH3.js} +3 -3
- package/chunks/{chunk-TZEZYNYD.js → chunk-T4FTABSW.js} +1 -1
- package/chunks/chunk-T5ZFG4CI.js +830 -0
- package/chunks/{chunk-SEZ556DZ.js → chunk-T6W4KACQ.js} +1 -1
- package/chunks/{chunk-3P2LV43B.js → chunk-TBVNYG5B.js} +5 -5
- package/chunks/{chunk-EV3LZGGK.js → chunk-TKAEODJR.js} +572 -42
- package/chunks/{chunk-TCRQD7F6.js → chunk-U6LT3QBF.js} +1 -1
- package/chunks/{chunk-EQL65XGA.js → chunk-V3LXMASR.js} +47 -21
- package/chunks/{chunk-MTE6R5HF.js → chunk-VESDV72K.js} +3 -3
- package/chunks/{chunk-SKSOLRPK.js → chunk-VO52SIZW.js} +3 -3
- package/chunks/{chunk-ZUIOLZ4V.js → chunk-VUFEW3SF.js} +8471 -2375
- package/chunks/{chunk-E2XBEWAK.js → chunk-VUTOKX6F.js} +650 -129
- package/chunks/{chunk-5BRSWOSC.js → chunk-WFBG4MF5.js} +4 -4
- package/chunks/chunk-WLML6VIA.js +18 -0
- package/chunks/{chunk-ONSZH6VM.js → chunk-WQOE4IYF.js} +3 -3
- package/chunks/{chunk-PFWPBYL2.js → chunk-XAAL4IFG.js} +3 -3
- package/chunks/{chunk-UO2N5QWP.js → chunk-XDN6SMAQ.js} +27 -4
- package/chunks/{chunk-GNPNYXJB.js → chunk-XLQS3VI6.js} +2 -2
- package/chunks/{chunk-PYQADEFD.js → chunk-XTH2OMDS.js} +1 -1
- package/chunks/chunk-XYVBANG5.js +336 -0
- package/chunks/{chunk-Y3NNBNGM.js → chunk-YQB3HSQ7.js} +6 -6
- package/chunks/{chunk-WOJZWRAZ.js → chunk-YRLW2MSX.js} +1 -1
- package/chunks/{chunk-LHEC5V6G.js → chunk-YTYPRVIZ.js} +2 -2
- package/chunks/chunk-Z7B6SRPM.js +32 -0
- package/chunks/chunk-ZBBVBZBR.js +137 -0
- package/chunks/{chunk-MFDYOYZZ.js → chunk-ZGWY4YUB.js} +27 -4
- package/chunks/{chunk-B7SQOICP.js → chunk-ZIS5I56G.js} +4 -4
- package/chunks/{chunk-IA7TGCN2.js → chunk-ZV4XVYL3.js} +4 -4
- package/chunks/{chunk-PJRW65JO.js → chunk-ZWPWQEF5.js} +1 -1
- package/chunks/{chunk-DCGYLIYO.js → chunk-ZXUMPZRT.js} +5 -5
- package/chunks/chunk-bdqvmfwv-OHYAFAAO.js +17446 -0
- package/chunks/{computer-use-5LGM2YO5.js → computer-use-YOYLKIHT.js} +48 -47
- package/chunks/{config-utils-ULCSRMWD.js → config-utils-TXVKR27S.js} +6 -6
- package/chunks/{contextCommand-JT44ADUD.js → contextCommand-KZMV5EOI.js} +47 -46
- package/chunks/{core-runtime-XHEJM2VB.js → core-runtime-VFUL2R7U.js} +45 -44
- package/chunks/{create-sub-session-UQBDJF5G.js → create-sub-session-EZW2NP4Z.js} +45 -44
- package/chunks/{create-sub-session-QIDZUOPU.js → create-sub-session-Y4WYDZGC.js} +2 -2
- package/chunks/{cron-create-VONA5JYY.js → cron-create-ZOVA3CC2.js} +4 -4
- package/chunks/{cron-delete-5JXSP2MI.js → cron-delete-7Z3H4LJY.js} +4 -4
- package/chunks/{cron-list-KE4F2CIR.js → cron-list-UHGX3IQG.js} +4 -4
- package/chunks/{daemon-GWD7BT6E.js → daemon-PXIC4ZDK.js} +186 -7
- package/chunks/daemon-status-provider-6L3ZKVVR.js +103 -0
- package/chunks/daemon-trust-policy-SZ3V4JEY.js +99 -0
- package/chunks/{daemon-trust-policy-monitor-LUMB46CL.js → daemon-trust-policy-monitor-HN34EJQ5.js} +52 -51
- package/chunks/{de-LIW4XVLN.js → de-UBEBKG6V.js} +2 -1
- package/chunks/{deferred-core-runtime-BFB6YRTZ.js → deferred-core-runtime-Z462KPKI.js} +47 -46
- package/chunks/{devtools-4QFYJT6U.js → devtools-X6ROTKHE.js} +1 -1
- package/chunks/dispatch-B53LNEO4.js +37 -0
- package/chunks/{display-image-NQRSIBXM.js → display-image-ZE3GZNIK.js} +4 -4
- package/chunks/{dist-Z3CS4OVP.js → dist-AVUYBK7L.js} +11 -5
- package/chunks/{dist-6BMOAE3Z.js → dist-BNWP6IZL.js} +4 -4
- package/chunks/{dist-EZE3V3Q7.js → dist-BW2LDPV3.js} +4 -4
- package/chunks/{dist-3NTTUAHT.js → dist-EFJILGIS.js} +3 -3
- package/chunks/{dist-OTUO3AS2.js → dist-KTYDJNYM.js} +14 -6
- package/chunks/{dist-B2CGTW6T.js → dist-NPS52B2V.js} +3 -3
- package/chunks/{dist-J47AXBZC.js → dist-PKSRQAR2.js} +3 -3
- package/chunks/{dist-EWW3J4HQ.js → dist-ZWDH5HLS.js} +3 -3
- package/chunks/{earlyInputCapture-GPULMO2H.js → earlyInputCapture-GSE6MMC7.js} +46 -45
- package/chunks/{edit-XYMQNMWU.js → edit-YJX2HMSA.js} +51 -50
- package/chunks/{en-SY5GTIGX.js → en-X6YV7GME.js} +2 -1
- package/chunks/{enter-worktree-TIASENJP.js → enter-worktree-H3GV4KQ7.js} +50 -49
- package/chunks/{enterPlanMode-K6LTIGWM.js → enterPlanMode-6LPSFIN2.js} +51 -50
- package/chunks/{environment-3XX7LUMG.js → environment-IVCQ3H7T.js} +48 -47
- package/chunks/{errors-VTFZ6M4W.js → errors-2K5VJQVK.js} +47 -46
- package/chunks/{exit-worktree-IBKPEHUJ.js → exit-worktree-QZC6DXGO.js} +50 -49
- package/chunks/exitPlanMode-UHGM7I4A.js +85 -0
- package/chunks/{fast-path-QOBSDLA6.js → fast-path-BDDOO4H6.js} +3 -3
- package/chunks/{fast-path-settings-RPAVBD7P.js → fast-path-settings-LNOFM2YP.js} +2 -2
- package/chunks/{fr-RQFO7U4P.js → fr-VENTC2BS.js} +2 -1
- package/chunks/{gemini-OCRXJUWF.js → gemini-VDUDROF7.js} +105 -104
- package/chunks/{geminiContentGenerator-VHSPCS6F.js → geminiContentGenerator-O4HYJOR7.js} +11 -11
- package/chunks/{glob-BVX4L3CM.js → glob-Z7VZDN7C.js} +52 -51
- package/chunks/{goal-tools-SWNB6GP4.js → goal-tools-JDK2SNMV.js} +4 -4
- package/chunks/{grep-CJSUX5NJ.js → grep-JQ6AGN62.js} +51 -50
- package/chunks/handleAutoUpdate-XZCLKEMR.js +94 -0
- package/chunks/{i18n-BPEDXABF.js → i18n-G2BMPGAS.js} +46 -45
- package/chunks/{image-gen-DEEXNNA2.js → image-gen-NMKTIERQ.js} +11 -11
- package/chunks/initializer-JEYFVIIG.js +100 -0
- package/chunks/{installationInfo-JCUKPGDB.js → installationInfo-GY2OCLIS.js} +46 -45
- package/chunks/{ja-KOZKHJHZ.js → ja-QHT4EQTO.js} +2 -1
- package/chunks/{keychain-token-storage-TVAMTNP7.js → keychain-token-storage-JTWUYFU7.js} +2 -2
- package/chunks/list-ZJ4GEKM4.js +103 -0
- package/chunks/{list-agents-Z4WABFDZ.js → list-agents-4GQ2XNEU.js} +2 -2
- package/chunks/loadedSettingsAdapter-5BO2PZLD.js +97 -0
- package/chunks/{loggingContentGenerator-MOOIBKKR.js → loggingContentGenerator-ER2Z5L3L.js} +59 -40
- package/chunks/{loop-wakeup-UZ5RL5Y2.js → loop-wakeup-HOQI3K5D.js} +5 -5
- package/chunks/{ls-TVHDGIES.js → ls-FSHISLLA.js} +6 -6
- package/chunks/{lsp-CVN6OQPI.js → lsp-APQJ5ZEZ.js} +2 -2
- package/chunks/{managed-npm-update-7K2LDL7V.js → managed-npm-update-X66EZDQD.js} +46 -45
- package/chunks/mcp-BDWPEXJF.js +97 -0
- package/chunks/{monitor-EXI73A5P.js → monitor-7J3DCMBL.js} +50 -49
- package/chunks/{node-UUDY34IG.js → node-YSOU44FX.js} +3 -3
- package/chunks/nonInteractiveCli-THJJIXKG.js +166 -0
- package/chunks/{notebook-edit-GKKQJQQU.js → notebook-edit-IX7GCTIL.js} +51 -50
- package/chunks/{openaiContentGenerator-NSPCP4FY.js → openaiContentGenerator-K65IDMQ6.js} +35 -35
- package/chunks/opentui-entry-L76XJNPE.js +47945 -0
- package/chunks/{pidfile-IU4ETBRE.js → pidfile-NNWTPHX2.js} +46 -45
- package/chunks/{processUtils-GZOVMFK4.js → processUtils-ILOXESNR.js} +2 -2
- package/chunks/{pt-U6AOCTMF.js → pt-VL3I5RNY.js} +2 -1
- package/chunks/{qwenContentGenerator-BBTNTOMB.js → qwenContentGenerator-YIKX3NHW.js} +54 -54
- package/chunks/{qwenOAuth2-D6L2W25Z.js → qwenOAuth2-BLYU65Y4.js} +10 -10
- package/chunks/read-file-GLBZFPNV.js +32 -0
- package/chunks/{read-mcp-resource-PZ4ZF6YL.js → read-mcp-resource-TJSJRH4F.js} +2 -2
- package/chunks/{record-artifact-P4HFMS7X.js → record-artifact-FXF5LHPE.js} +3 -3
- package/chunks/{resumeHistoryUtils-VUY4B6BO.js → resumeHistoryUtils-UMC4Y3E2.js} +54 -52
- package/chunks/ripGrep-53XOGSZ4.js +85 -0
- package/chunks/{ru-CMX4UMYP.js → ru-4RCKL4PY.js} +2 -1
- package/chunks/{run-qwen-serve-7BDTKCFP.js → run-qwen-serve-BTZ46CLW.js} +67 -60
- package/chunks/{runtime-VMWGIAX7.js → runtime-RQ3ACQKH.js} +58 -57
- package/chunks/runtime-gate-T4ICWGQJ.js +89 -0
- package/chunks/{scheduler-MUKPARY5.js → scheduler-WEIFVKQH.js} +47 -46
- package/chunks/{sdk-exporters-grpc-54L4LS5L.js → sdk-exporters-grpc-4QKV6MCX.js} +2 -2
- package/chunks/{sdk-exporters-http-XVTZQRCE.js → sdk-exporters-http-2VPMAPFI.js} +13 -13
- package/chunks/{sdk-impl-7W7AKCS4.js → sdk-impl-5W3JUCWF.js} +12 -12
- package/chunks/{send-message-CAMSLG2L.js → send-message-RBYLV5NY.js} +6 -6
- package/chunks/{serve-7G5R52HX.js → serve-RJUR5OJH.js} +52 -51
- package/chunks/{server-FTSWAHXF.js → server-WQ2ID4U7.js} +961 -322
- package/chunks/{session-FLUDUMZJ.js → session-O4OXRVNI.js} +124 -101
- package/chunks/{settings-CJVTBEW7.js → settings-4BVJ36YG.js} +51 -50
- package/chunks/{shell-2DOQIYEE.js → shell-DCQZWM5T.js} +45 -44
- package/chunks/{skill-2GOEKN34.js → skill-4KWZ4J7U.js} +24 -24
- package/chunks/{skill-settings-5FEOMZQS.js → skill-settings-TEMNXCLU.js} +51 -50
- package/chunks/{spawnChannel-VJRIO75F.js → spawnChannel-ROYEZK57.js} +48 -46
- package/chunks/{standalone-update-OC5IKJGY.js → standalone-update-G4BETY4B.js} +47 -46
- package/chunks/{startInteractiveUI-HFHFI2ZR.js → startInteractiveUI-PDFQ7N7A.js} +2665 -2827
- package/chunks/{syntheticOutput-PEBJQYJV.js → syntheticOutput-D3Z64LJC.js} +3 -3
- package/chunks/{task-create-5NWCQSJF.js → task-create-URFZ5EUX.js} +11 -11
- package/chunks/{task-list-53265TRZ.js → task-list-6JDFMPUW.js} +5 -5
- package/chunks/{task-stop-FPCOIRYX.js → task-stop-HHUGCD25.js} +2 -2
- package/chunks/{task-update-5HN577LS.js → task-update-DVV6CUGI.js} +12 -12
- package/chunks/{team-create-ZWAXZR75.js → team-create-KW4LOVHD.js} +52 -51
- package/chunks/{team-delete-MMQB4OSC.js → team-delete-PZGGBQLM.js} +5 -5
- package/chunks/{team-plan-approval-LH23GCUV.js → team-plan-approval-XHFK2RTF.js} +51 -50
- package/chunks/{terminal-image-renderer-7L3GCHD5.js → terminal-image-renderer-46R2LHGR.js} +47 -46
- package/chunks/theme-manager-E56XY2JG.js +89 -0
- package/chunks/{todoWrite-JGV6VLOX.js → todoWrite-WINAZSZI.js} +4 -4
- package/chunks/{tool-search-BZOZHGKI.js → tool-search-EVVFQUMJ.js} +21 -21
- package/chunks/{total-session-admission-KP4CJTSB.js → total-session-admission-CULMHRTA.js} +50 -49
- package/chunks/{trustedFolders-57QEHV67.js → trustedFolders-BKLVSCXW.js} +46 -45
- package/chunks/{update-relaunch-53MODFE4.js → update-relaunch-46H4Q4VL.js} +5 -5
- package/chunks/{updateCheck-4QDI7CUZ.js → updateCheck-3BQA7KNI.js} +49 -48
- package/chunks/{useAutoAcceptIndicator-VVQUPTM5.js → useAutoAcceptIndicator-3QJ7QV5R.js} +57 -56
- package/chunks/{validateNonInterActiveAuth-KKVD5E43.js → validateNonInterActiveAuth-QVFJVBSY.js} +90 -87
- package/chunks/{version-IB5ASN63.js → version-6JJA54HH.js} +1 -1
- package/chunks/{web-fetch-APSFQMIH.js → web-fetch-75JBSDA3.js} +24 -24
- package/chunks/{web-search-EWEHMFIW.js → web-search-PKBISWS3.js} +17 -17
- package/chunks/{workflow-LA4ACRO4.js → workflow-KEZDQISR.js} +58 -57
- package/chunks/workspace-providers-status-YQW4VNIV.js +100 -0
- package/chunks/{workspace-registration-store-WSLHN7HA.js → workspace-registration-store-GQ42PR72.js} +1 -1
- package/chunks/{workspace-registry-5HXRV7L4.js → workspace-registry-ZR6DVZQ6.js} +50 -49
- package/chunks/{workspace-service-SSP4PLBC.js → workspace-service-BCMK3NLA.js} +58 -57
- package/chunks/workspace-skills-status-ZHBYM2X7.js +100 -0
- package/chunks/{workspace-trust-reconciler-PASUNEKQ.js → workspace-trust-reconciler-TWRB3TW2.js} +59 -58
- package/chunks/wrapper-46Z24CTM.js +35 -0
- package/chunks/write-file-CQBI7HXO.js +87 -0
- package/chunks/{zh-AGL2FVBI.js → zh-LMSTK4WD.js} +2 -1
- package/chunks/{zh-TW-KI66MHQY.js → zh-TW-SQ4HTSCW.js} +2 -1
- package/chunks/{zoom-image-NAVVM4R2.js → zoom-image-36I4WZIL.js} +15 -15
- package/cli.js +13 -13
- package/locales/ca.js +1 -0
- package/locales/de.js +1 -0
- package/locales/en.js +1 -0
- package/locales/fr.js +1 -0
- package/locales/ja.js +1 -0
- package/locales/pt.js +1 -0
- package/locales/ru.js +1 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-BGiARkbG.js → arc-CgGUyHWd.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-3QBZDeqg.js → architectureDiagram-3BPJPVTR-BR0Qv-1Y.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-CbJI0j0o.js → blockDiagram-GPEHLZMM-DIoaceaI.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-pita1IYy.js → c4Diagram-AAUBKEIU-Bc5k6BbI.js} +1 -1
- package/web-shell/assets/channel-D2b9IYpS.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-WzTFww1i.js → chunk-2J33WTMH-DtPEz2WX.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-8TIRo9bL.js → chunk-4BX2VUAB-Dydo6ydE.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CuCr34qf.js → chunk-55IACEB6-DD9_VWXm.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Bb_xWEAx.js → chunk-727SXJPM-DVI2m59k.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C8T1b2Qw.js → chunk-AQP2D5EJ-luatmaTN.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-kjpyMkNM.js → chunk-FMBD7UC4-Duy8NTIi.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-Dm35jDmi.js → chunk-ND2GUHAM-CrL1yhms.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-BPVKwuby.js → chunk-QZHKN3VN-C7BX6bu1.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-DHatTCmD.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DHatTCmD.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-M-7J9Xyz.js → cose-bilkent-S5V4N54A-BTzs7mIi.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-u6rmS689.js → dagre-BM42HDAG-3VTUmWts.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-nAisfOUB.js → diagram-2AECGRRQ-Ehdp75GN.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-CpobRd3l.js → diagram-5GNKFQAL-B3wu3teE.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-B82W_wPq.js → diagram-KO2AKTUF-DjgTSf2S.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-ClTkmPW6.js → diagram-LMA3HP47-Br9mwjY3.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-42fbxGPW.js → diagram-OG6HWLK6-D4xz5M-z.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-8_zQfzlQ.js → erDiagram-TEJ5UH35-CXayWlG_.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-DQDoN_oV.js → flowDiagram-I6XJVG4X-CLonjQTi.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cqd646fB.js → ganttDiagram-6RSMTGT7-BTySFT-1.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-B6qWs_tS.js → gitGraphDiagram-PVQCEYII--2WcUjOe.js} +1 -1
- package/web-shell/assets/{index-eYjX7fQg.css → index-CIFO52Wx.css} +1 -1
- package/web-shell/assets/{index-BCeQB_tk.js → index-DPJHkFOG.js} +1 -1
- package/web-shell/assets/index-bhq3CUUF.js +1789 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-BVyDAHuu.js → infoDiagram-5YYISTIA-9vpgAf1m.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BBHM904I.js → ishikawaDiagram-YF4QCWOH-DcRpHnAW.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-B5Bv5Z_0.js → journeyDiagram-JHISSGLW-C2TKorRm.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BwSTb0YF.js → kanban-definition-UN3LZRKU-DdsFwB8b.js} +1 -1
- package/web-shell/assets/{linear-CHtTm36c.js → linear-7PjRvJrf.js} +1 -1
- package/web-shell/assets/{mermaid.core-vBCuAUkf.js → mermaid.core-raDXa11C.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-CNfKHJrA.js → mindmap-definition-RKZ34NQL-DLHc-PRN.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-DT6QMLhc.js → pieDiagram-4H26LBE5-BftYpeTW.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Rb2Dar4i.js → quadrantDiagram-W4KKPZXB-O-6ygOYn.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CA9YzPUY.js → requirementDiagram-4Y6WPE33-BmZWVufJ.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-CJ5SkhJw.js → sankeyDiagram-5OEKKPKP-2x5beiWt.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-T31AiuVM.js → sequenceDiagram-3UESZ5HK-BH8uKokQ.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-f7Xpd_Xh.js → stateDiagram-AJRCARHV-Dq1MFgX_.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-spuAYji6.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-dCwsTscr.js → timeline-definition-PNZ67QCA-Cl2WKbv9.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-SQtBFYkQ.js → vennDiagram-CIIHVFJN-BqoRo_Q-.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-Dfh4eW0B.js → wardley-L42UT6IY-BTxp-Yot.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BWBKXBsC.js → wardleyDiagram-YWT4CUSO-DFXVCSH2.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-DVqzcaxh.js → xychartDiagram-2RQKCTM6-qQhWx0aE.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/agent-headless-JOL3STCJ.js +0 -86
- package/chunks/channel-settings-store-CDUEUDYS.js +0 -101
- package/chunks/chunk-PDPFQ2FO.js +0 -156
- package/chunks/daemon-status-provider-67M3LFIJ.js +0 -102
- package/chunks/daemon-trust-policy-3XCIBLLT.js +0 -98
- package/chunks/exitPlanMode-2U23CG2U.js +0 -84
- package/chunks/handleAutoUpdate-2F3RWBIT.js +0 -93
- package/chunks/initializer-QRD7X25L.js +0 -99
- package/chunks/list-G6SHYRHQ.js +0 -102
- package/chunks/loadedSettingsAdapter-S4EPYP35.js +0 -96
- package/chunks/mcp-R2Z6IKPN.js +0 -96
- package/chunks/nonInteractiveCli-E6CEE6IG.js +0 -162
- package/chunks/read-file-S2BROE4F.js +0 -32
- package/chunks/ripGrep-V4EX6SLA.js +0 -84
- package/chunks/theme-manager-7WO6DXIT.js +0 -88
- package/chunks/workspace-providers-status-5C3HGWHF.js +0 -99
- package/chunks/workspace-skills-status-DX7CA34S.js +0 -99
- package/chunks/write-file-3N2WAE3F.js +0 -86
- package/web-shell/assets/channel-3vYOf77E.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-Dr2aqxvr.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Dr2aqxvr.js +0 -1
- package/web-shell/assets/index-Dv9zBWC9.js +0 -1775
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-wucbNzkr.js +0 -1
- /package/chunks/{chunk-NWNEANAT.js → chunk-44CTCCLY.js} +0 -0
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
MissingCliEntryError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OPBATTFQ.js";
|
|
6
6
|
import {
|
|
7
7
|
redactLogCredentials
|
|
8
8
|
} from "./chunk-M5GB774H.js";
|
|
9
9
|
import {
|
|
10
10
|
EXTERNAL_TOOL_GUARD_TOKEN_ENV
|
|
11
11
|
} from "./chunk-BKHCW2BI.js";
|
|
12
|
+
import {
|
|
13
|
+
CLIENT_METHODS,
|
|
14
|
+
zCreateTerminalRequest,
|
|
15
|
+
zKillTerminalCommandRequest,
|
|
16
|
+
zReadTextFileRequest,
|
|
17
|
+
zReleaseTerminalRequest,
|
|
18
|
+
zRequestPermissionRequest,
|
|
19
|
+
zSessionNotification,
|
|
20
|
+
zTerminalOutputRequest,
|
|
21
|
+
zWaitForTerminalExitRequest,
|
|
22
|
+
zWriteTextFileRequest
|
|
23
|
+
} from "./chunk-IW6RQPQB.js";
|
|
12
24
|
import {
|
|
13
25
|
init_esbuild_shims
|
|
14
26
|
} from "./chunk-5O2XNYP6.js";
|
|
@@ -26,6 +38,7 @@ import { getHeapStatistics } from "node:v8";
|
|
|
26
38
|
// packages/acp-bridge/src/ndJsonStream.ts
|
|
27
39
|
init_esbuild_shims();
|
|
28
40
|
import { createHash } from "node:crypto";
|
|
41
|
+
import { inspect } from "node:util";
|
|
29
42
|
var NdJsonFrameTooLargeError = class extends Error {
|
|
30
43
|
constructor(direction, limitBytes, observedBytes) {
|
|
31
44
|
super(
|
|
@@ -68,31 +81,74 @@ var NdJsonIncompleteFrameError = class extends Error {
|
|
|
68
81
|
}
|
|
69
82
|
code = "ndjson_incomplete_frame";
|
|
70
83
|
};
|
|
71
|
-
|
|
84
|
+
var NdJsonUnexpectedEofError = class extends Error {
|
|
85
|
+
static {
|
|
86
|
+
__name(this, "NdJsonUnexpectedEofError");
|
|
87
|
+
}
|
|
88
|
+
code = "ndjson_unexpected_eof";
|
|
89
|
+
constructor() {
|
|
90
|
+
super("NDJSON input ended while the bounded transport was active");
|
|
91
|
+
this.name = "NdJsonUnexpectedEofError";
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var NdJsonInvalidMessageError = class extends Error {
|
|
95
|
+
constructor(code, observedBytes) {
|
|
96
|
+
super(`NDJSON input contains an invalid ${observedBytes}-byte message`);
|
|
97
|
+
this.code = code;
|
|
98
|
+
this.observedBytes = observedBytes;
|
|
99
|
+
this.name = "NdJsonInvalidMessageError";
|
|
100
|
+
}
|
|
101
|
+
static {
|
|
102
|
+
__name(this, "NdJsonInvalidMessageError");
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var MAX_JSON_RPC_METHOD_BYTES = 1024;
|
|
106
|
+
var MAX_JSON_RPC_ID_BYTES = 256;
|
|
107
|
+
var MAX_JSON_RPC_ERROR_MESSAGE_BYTES = 1024;
|
|
108
|
+
var MAX_JSON_DEPTH = 64;
|
|
109
|
+
var MAX_JSON_NODES = 1e4;
|
|
110
|
+
var MAX_JSON_ARRAY_LENGTH = 4096;
|
|
111
|
+
function ndJsonStream(output, input, hooks, limits, validateInboundMessage, fatalCleanEof = false) {
|
|
72
112
|
const textEncoder = new TextEncoder();
|
|
73
113
|
const textDecoder = new TextDecoder();
|
|
74
114
|
if (limits) validateNdJsonStreamLimits(limits);
|
|
75
|
-
const
|
|
115
|
+
const outboundRequests = limits ? new BoundedOutstandingRequestLedger(limits) : void 0;
|
|
116
|
+
const inboundRequests = limits ? new BoundedInboundRequestLedger(limits) : void 0;
|
|
117
|
+
const readable = limits ? createBoundedReadable(
|
|
118
|
+
input,
|
|
119
|
+
textDecoder,
|
|
120
|
+
hooks,
|
|
121
|
+
limits,
|
|
122
|
+
outboundRequests,
|
|
123
|
+
inboundRequests,
|
|
124
|
+
validateInboundMessage,
|
|
125
|
+
fatalCleanEof
|
|
126
|
+
) : createLegacyReadable(input, textDecoder, hooks);
|
|
76
127
|
const writable = new WritableStream({
|
|
77
128
|
async write(message) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const frameBytes = payload.byteLength + 1;
|
|
81
|
-
if (limits && frameBytes > limits.maxFrameBytes) {
|
|
82
|
-
const error = new NdJsonFrameTooLargeError(
|
|
83
|
-
"sent",
|
|
84
|
-
limits.maxFrameBytes,
|
|
85
|
-
frameBytes
|
|
86
|
-
);
|
|
87
|
-
callHook(hooks?.onTransportError, error);
|
|
88
|
-
throw error;
|
|
89
|
-
}
|
|
90
|
-
const frame = new Uint8Array(frameBytes);
|
|
91
|
-
frame.set(payload);
|
|
92
|
-
frame[payload.byteLength] = 10;
|
|
93
|
-
const writer = output.getWriter();
|
|
129
|
+
let writer;
|
|
130
|
+
let expectedResponseId;
|
|
94
131
|
try {
|
|
132
|
+
const content = JSON.stringify(message);
|
|
133
|
+
const payload = textEncoder.encode(content);
|
|
134
|
+
const frameBytes = payload.byteLength + 1;
|
|
135
|
+
if (limits && frameBytes > limits.maxFrameBytes) {
|
|
136
|
+
throw new NdJsonFrameTooLargeError(
|
|
137
|
+
"sent",
|
|
138
|
+
limits.maxFrameBytes,
|
|
139
|
+
frameBytes
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
const frame = new Uint8Array(frameBytes);
|
|
143
|
+
frame.set(payload);
|
|
144
|
+
frame[payload.byteLength] = 10;
|
|
145
|
+
if (outboundRequests && isJsonRpcRequestMessage(message)) {
|
|
146
|
+
outboundRequests.admit(message.id, frameBytes);
|
|
147
|
+
expectedResponseId = message.id;
|
|
148
|
+
}
|
|
149
|
+
writer = output.getWriter();
|
|
95
150
|
await writer.write(frame);
|
|
151
|
+
inboundRequests?.release(message);
|
|
96
152
|
callHook(hooks?.onMessageSent, payload.byteLength);
|
|
97
153
|
callHook(hooks?.onMessageObserved, {
|
|
98
154
|
direction: "sent",
|
|
@@ -100,10 +156,13 @@ function ndJsonStream(output, input, hooks, limits) {
|
|
|
100
156
|
message
|
|
101
157
|
});
|
|
102
158
|
} catch (error) {
|
|
159
|
+
if (expectedResponseId !== void 0) {
|
|
160
|
+
outboundRequests?.discard(expectedResponseId);
|
|
161
|
+
}
|
|
103
162
|
if (limits) callHook(hooks?.onTransportError, error);
|
|
104
163
|
throw error;
|
|
105
164
|
} finally {
|
|
106
|
-
writer
|
|
165
|
+
writer?.releaseLock();
|
|
107
166
|
}
|
|
108
167
|
}
|
|
109
168
|
});
|
|
@@ -130,7 +189,7 @@ function createLegacyReadable(input, textDecoder, hooks) {
|
|
|
130
189
|
});
|
|
131
190
|
}
|
|
132
191
|
__name(createLegacyReadable, "createLegacyReadable");
|
|
133
|
-
function createBoundedReadable(input, textDecoder, hooks, limits) {
|
|
192
|
+
function createBoundedReadable(input, textDecoder, hooks, limits, outboundRequests, inboundRequests, validateInboundMessage, fatalCleanEof) {
|
|
134
193
|
const pending = new BoundedFrameBuffer(limits.maxFrameBytes);
|
|
135
194
|
const minimumQueueCharge = Math.ceil(
|
|
136
195
|
limits.maxQueuedBytes / limits.maxQueuedMessages
|
|
@@ -149,6 +208,10 @@ function createBoundedReadable(input, textDecoder, hooks, limits) {
|
|
|
149
208
|
textDecoder,
|
|
150
209
|
hooks,
|
|
151
210
|
limits,
|
|
211
|
+
outboundRequests,
|
|
212
|
+
inboundRequests,
|
|
213
|
+
validateInboundMessage,
|
|
214
|
+
fatalCleanEof,
|
|
152
215
|
minimumQueueCharge,
|
|
153
216
|
(charge) => {
|
|
154
217
|
nextQueueCharge = charge;
|
|
@@ -169,7 +232,7 @@ function createBoundedReadable(input, textDecoder, hooks, limits) {
|
|
|
169
232
|
);
|
|
170
233
|
}
|
|
171
234
|
__name(createBoundedReadable, "createBoundedReadable");
|
|
172
|
-
async function pumpBoundedInput(reader, pending, controller, textDecoder, hooks, limits, minimumQueueCharge, setNextQueueCharge, isCanceled) {
|
|
235
|
+
async function pumpBoundedInput(reader, pending, controller, textDecoder, hooks, limits, outboundRequests, inboundRequests, validateInboundMessage, fatalCleanEof, minimumQueueCharge, setNextQueueCharge, isCanceled) {
|
|
173
236
|
try {
|
|
174
237
|
while (true) {
|
|
175
238
|
const result = await reader.read();
|
|
@@ -178,6 +241,7 @@ async function pumpBoundedInput(reader, pending, controller, textDecoder, hooks,
|
|
|
178
241
|
if (pending.byteLength > 0) {
|
|
179
242
|
throw new NdJsonIncompleteFrameError(pending.byteLength);
|
|
180
243
|
}
|
|
244
|
+
if (fatalCleanEof) throw new NdJsonUnexpectedEofError();
|
|
181
245
|
controller.close();
|
|
182
246
|
return;
|
|
183
247
|
}
|
|
@@ -189,6 +253,9 @@ async function pumpBoundedInput(reader, pending, controller, textDecoder, hooks,
|
|
|
189
253
|
textDecoder,
|
|
190
254
|
hooks,
|
|
191
255
|
limits,
|
|
256
|
+
outboundRequests,
|
|
257
|
+
inboundRequests,
|
|
258
|
+
validateInboundMessage,
|
|
192
259
|
minimumQueueCharge,
|
|
193
260
|
setNextQueueCharge
|
|
194
261
|
);
|
|
@@ -201,6 +268,8 @@ async function pumpBoundedInput(reader, pending, controller, textDecoder, hooks,
|
|
|
201
268
|
if (!isCanceled()) controller.close();
|
|
202
269
|
} finally {
|
|
203
270
|
pending.clear();
|
|
271
|
+
outboundRequests.clear();
|
|
272
|
+
inboundRequests.clear();
|
|
204
273
|
reader.releaseLock();
|
|
205
274
|
}
|
|
206
275
|
}
|
|
@@ -222,7 +291,7 @@ function readLegacyChunk(chunk, pending, controller, textDecoder, hooks) {
|
|
|
222
291
|
}
|
|
223
292
|
}
|
|
224
293
|
__name(readLegacyChunk, "readLegacyChunk");
|
|
225
|
-
function readBoundedChunk(chunk, pending, controller, textDecoder, hooks, limits, minimumQueueCharge, setNextQueueCharge) {
|
|
294
|
+
function readBoundedChunk(chunk, pending, controller, textDecoder, hooks, limits, outboundRequests, inboundRequests, validateInboundMessage, minimumQueueCharge, setNextQueueCharge) {
|
|
226
295
|
let start = 0;
|
|
227
296
|
let newline = chunk.indexOf(10, start);
|
|
228
297
|
while (newline !== -1) {
|
|
@@ -246,7 +315,15 @@ function readBoundedChunk(chunk, pending, controller, textDecoder, hooks, limits
|
|
|
246
315
|
);
|
|
247
316
|
}
|
|
248
317
|
setNextQueueCharge(queueCharge);
|
|
249
|
-
handleBoundedLine(
|
|
318
|
+
handleBoundedLine(
|
|
319
|
+
pending.take(current),
|
|
320
|
+
controller,
|
|
321
|
+
textDecoder,
|
|
322
|
+
hooks,
|
|
323
|
+
outboundRequests,
|
|
324
|
+
inboundRequests,
|
|
325
|
+
validateInboundMessage
|
|
326
|
+
);
|
|
250
327
|
start = newline + 1;
|
|
251
328
|
newline = chunk.indexOf(10, start);
|
|
252
329
|
}
|
|
@@ -280,28 +357,206 @@ function handleLegacyLine(lineBytes, controller, textDecoder, hooks) {
|
|
|
280
357
|
}
|
|
281
358
|
}
|
|
282
359
|
__name(handleLegacyLine, "handleLegacyLine");
|
|
283
|
-
function handleBoundedLine(lineBytes, controller, textDecoder, hooks) {
|
|
360
|
+
function handleBoundedLine(lineBytes, controller, textDecoder, hooks, outboundRequests, inboundRequests, validateInboundMessage) {
|
|
284
361
|
const line = textDecoder.decode(lineBytes);
|
|
285
362
|
const trimmedLine = line.trim();
|
|
286
363
|
if (!trimmedLine) return;
|
|
287
|
-
let
|
|
364
|
+
let parsed;
|
|
288
365
|
try {
|
|
289
|
-
|
|
366
|
+
parsed = JSON.parse(trimmedLine);
|
|
290
367
|
} catch {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return;
|
|
368
|
+
throw logBoundedInvalidMessage("ndjson_parse_error", lineBytes);
|
|
369
|
+
}
|
|
370
|
+
if (!isJsonRpcMessage(parsed)) {
|
|
371
|
+
throw logBoundedInvalidMessage("ndjson_invalid_message", lineBytes);
|
|
372
|
+
}
|
|
373
|
+
const isResponse = isJsonRpcResponseMessage(parsed);
|
|
374
|
+
if (!isResponse && !hasBoundedJsonStructure(parsed) || validateInboundMessage && !validateInboundMessage(parsed)) {
|
|
375
|
+
throw logBoundedInvalidMessage("ndjson_invalid_message", lineBytes);
|
|
300
376
|
}
|
|
377
|
+
if (isJsonRpcResponseMessage(parsed) && !outboundRequests?.consumeResponse(parsed.id)) {
|
|
378
|
+
throw logBoundedInvalidMessage("ndjson_invalid_message", lineBytes);
|
|
379
|
+
}
|
|
380
|
+
inboundRequests?.admit(parsed, lineBytes.byteLength + 1);
|
|
381
|
+
const message = installBoundedLogRedaction(parsed);
|
|
301
382
|
controller.enqueue(message);
|
|
302
383
|
reportReceivedMessage(lineBytes, message, hooks);
|
|
303
384
|
}
|
|
304
385
|
__name(handleBoundedLine, "handleBoundedLine");
|
|
386
|
+
function installBoundedLogRedaction(message) {
|
|
387
|
+
Object.defineProperty(message, inspect.custom, {
|
|
388
|
+
configurable: false,
|
|
389
|
+
enumerable: false,
|
|
390
|
+
value: inspectBoundedJsonRpcMessage,
|
|
391
|
+
writable: false
|
|
392
|
+
});
|
|
393
|
+
return message;
|
|
394
|
+
}
|
|
395
|
+
__name(installBoundedLogRedaction, "installBoundedLogRedaction");
|
|
396
|
+
function inspectBoundedJsonRpcMessage() {
|
|
397
|
+
return {
|
|
398
|
+
jsonrpc: "2.0",
|
|
399
|
+
messageType: "method" in this ? "id" in this ? "request" : "notification" : "response",
|
|
400
|
+
payloadOmitted: true
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
__name(inspectBoundedJsonRpcMessage, "inspectBoundedJsonRpcMessage");
|
|
404
|
+
function isJsonRpcMessage(value) {
|
|
405
|
+
if (!isRecord(value) || value["jsonrpc"] !== "2.0") return false;
|
|
406
|
+
const hasMethod = Object.hasOwn(value, "method");
|
|
407
|
+
const hasId = Object.hasOwn(value, "id");
|
|
408
|
+
if (hasMethod) {
|
|
409
|
+
return typeof value["method"] === "string" && Buffer.byteLength(value["method"]) <= MAX_JSON_RPC_METHOD_BYTES && (!hasId || isJsonRpcId(value["id"]));
|
|
410
|
+
}
|
|
411
|
+
if (!hasId || !isJsonRpcId(value["id"])) return false;
|
|
412
|
+
const hasResult = Object.hasOwn(value, "result");
|
|
413
|
+
const hasError = Object.hasOwn(value, "error");
|
|
414
|
+
if (hasResult === hasError) return false;
|
|
415
|
+
if (!hasError) return true;
|
|
416
|
+
const error = value["error"];
|
|
417
|
+
return isRecord(error) && typeof error["code"] === "number" && Number.isFinite(error["code"]) && typeof error["message"] === "string" && Buffer.byteLength(error["message"]) <= MAX_JSON_RPC_ERROR_MESSAGE_BYTES;
|
|
418
|
+
}
|
|
419
|
+
__name(isJsonRpcMessage, "isJsonRpcMessage");
|
|
420
|
+
function isRecord(value) {
|
|
421
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
422
|
+
}
|
|
423
|
+
__name(isRecord, "isRecord");
|
|
424
|
+
function hasBoundedJsonStructure(value) {
|
|
425
|
+
const stack = [{ value, depth: 1 }];
|
|
426
|
+
let nodes = 0;
|
|
427
|
+
while (stack.length > 0) {
|
|
428
|
+
const current = stack.pop();
|
|
429
|
+
nodes++;
|
|
430
|
+
if (nodes > MAX_JSON_NODES || current.depth > MAX_JSON_DEPTH) return false;
|
|
431
|
+
if (Array.isArray(current.value)) {
|
|
432
|
+
if (current.value.length > MAX_JSON_ARRAY_LENGTH) return false;
|
|
433
|
+
for (let index = current.value.length - 1; index >= 0; index--) {
|
|
434
|
+
if (nodes + stack.length >= MAX_JSON_NODES || current.depth + 1 > MAX_JSON_DEPTH) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
stack.push({
|
|
438
|
+
value: current.value[index],
|
|
439
|
+
depth: current.depth + 1
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
} else if (isRecord(current.value)) {
|
|
443
|
+
for (const key in current.value) {
|
|
444
|
+
if (!Object.hasOwn(current.value, key)) continue;
|
|
445
|
+
if (nodes + stack.length >= MAX_JSON_NODES || current.depth + 1 > MAX_JSON_DEPTH) {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
stack.push({
|
|
449
|
+
value: current.value[key],
|
|
450
|
+
depth: current.depth + 1
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
__name(hasBoundedJsonStructure, "hasBoundedJsonStructure");
|
|
458
|
+
function isJsonRpcId(value) {
|
|
459
|
+
return value === null || typeof value === "string" && Buffer.byteLength(value) <= MAX_JSON_RPC_ID_BYTES || typeof value === "number" && Number.isFinite(value);
|
|
460
|
+
}
|
|
461
|
+
__name(isJsonRpcId, "isJsonRpcId");
|
|
462
|
+
function isJsonRpcRequestMessage(value) {
|
|
463
|
+
return "method" in value && "id" in value && typeof value.method === "string" && isJsonRpcId(value.id);
|
|
464
|
+
}
|
|
465
|
+
__name(isJsonRpcRequestMessage, "isJsonRpcRequestMessage");
|
|
466
|
+
function isJsonRpcResponseMessage(value) {
|
|
467
|
+
return !("method" in value) && "id" in value;
|
|
468
|
+
}
|
|
469
|
+
__name(isJsonRpcResponseMessage, "isJsonRpcResponseMessage");
|
|
470
|
+
var BoundedInboundRequestLedger = class {
|
|
471
|
+
constructor(limits) {
|
|
472
|
+
this.limits = limits;
|
|
473
|
+
}
|
|
474
|
+
static {
|
|
475
|
+
__name(this, "BoundedInboundRequestLedger");
|
|
476
|
+
}
|
|
477
|
+
requests = /* @__PURE__ */ new Map();
|
|
478
|
+
retainedBytes = 0;
|
|
479
|
+
admit(message, frameBytes) {
|
|
480
|
+
if (!isJsonRpcRequestMessage(message)) return;
|
|
481
|
+
const availableBytes = Math.max(
|
|
482
|
+
0,
|
|
483
|
+
this.limits.maxQueuedBytes - this.retainedBytes
|
|
484
|
+
);
|
|
485
|
+
if (this.requests.has(message.id) || this.requests.size >= this.limits.maxQueuedMessages || frameBytes > availableBytes) {
|
|
486
|
+
throw new NdJsonQueueLimitError(
|
|
487
|
+
this.limits.maxQueuedMessages,
|
|
488
|
+
this.limits.maxQueuedBytes,
|
|
489
|
+
frameBytes,
|
|
490
|
+
this.requests.has(message.id) ? 0 : availableBytes
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
this.requests.set(message.id, frameBytes);
|
|
494
|
+
this.retainedBytes += frameBytes;
|
|
495
|
+
}
|
|
496
|
+
release(message) {
|
|
497
|
+
if (!isJsonRpcResponseMessage(message)) return;
|
|
498
|
+
const frameBytes = this.requests.get(message.id);
|
|
499
|
+
if (frameBytes === void 0) return;
|
|
500
|
+
this.requests.delete(message.id);
|
|
501
|
+
this.retainedBytes -= frameBytes;
|
|
502
|
+
}
|
|
503
|
+
clear() {
|
|
504
|
+
this.requests.clear();
|
|
505
|
+
this.retainedBytes = 0;
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
var BoundedOutstandingRequestLedger = class {
|
|
509
|
+
constructor(limits) {
|
|
510
|
+
this.limits = limits;
|
|
511
|
+
}
|
|
512
|
+
static {
|
|
513
|
+
__name(this, "BoundedOutstandingRequestLedger");
|
|
514
|
+
}
|
|
515
|
+
requests = /* @__PURE__ */ new Map();
|
|
516
|
+
retainedBytes = 0;
|
|
517
|
+
admit(id, frameBytes) {
|
|
518
|
+
const availableBytes = Math.max(
|
|
519
|
+
0,
|
|
520
|
+
this.limits.maxQueuedBytes - this.retainedBytes
|
|
521
|
+
);
|
|
522
|
+
if (this.requests.has(id) || this.requests.size >= this.limits.maxQueuedMessages || frameBytes > availableBytes) {
|
|
523
|
+
throw new NdJsonQueueLimitError(
|
|
524
|
+
this.limits.maxQueuedMessages,
|
|
525
|
+
this.limits.maxQueuedBytes,
|
|
526
|
+
frameBytes,
|
|
527
|
+
this.requests.has(id) ? 0 : availableBytes
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
this.requests.set(id, frameBytes);
|
|
531
|
+
this.retainedBytes += frameBytes;
|
|
532
|
+
}
|
|
533
|
+
consumeResponse(id) {
|
|
534
|
+
return this.discard(id);
|
|
535
|
+
}
|
|
536
|
+
discard(id) {
|
|
537
|
+
const frameBytes = this.requests.get(id);
|
|
538
|
+
if (frameBytes === void 0) return false;
|
|
539
|
+
this.requests.delete(id);
|
|
540
|
+
this.retainedBytes -= frameBytes;
|
|
541
|
+
return true;
|
|
542
|
+
}
|
|
543
|
+
clear() {
|
|
544
|
+
this.requests.clear();
|
|
545
|
+
this.retainedBytes = 0;
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
function logBoundedInvalidMessage(errorKind, lineBytes) {
|
|
549
|
+
const bytes = jsonPayloadByteLength(lineBytes);
|
|
550
|
+
const digest = createHash("sha256").update(lineBytes.subarray(0, bytes)).digest("hex");
|
|
551
|
+
console.error("Failed to parse JSON message:", {
|
|
552
|
+
errorKind,
|
|
553
|
+
bytes,
|
|
554
|
+
sha256: digest,
|
|
555
|
+
payloadOmitted: true
|
|
556
|
+
});
|
|
557
|
+
return new NdJsonInvalidMessageError(errorKind, bytes);
|
|
558
|
+
}
|
|
559
|
+
__name(logBoundedInvalidMessage, "logBoundedInvalidMessage");
|
|
305
560
|
function reportReceivedMessage(lineBytes, message, hooks) {
|
|
306
561
|
const bytes = jsonPayloadByteLength(lineBytes);
|
|
307
562
|
callHook(hooks?.onMessageReceived, bytes);
|
|
@@ -566,6 +821,232 @@ var DAEMON_ACP_NDJSON_LIMITS = Object.freeze({
|
|
|
566
821
|
maxQueuedMessages: 256,
|
|
567
822
|
maxQueuedBytes: 64 * 1024 * 1024
|
|
568
823
|
});
|
|
824
|
+
var daemonClientParamValidators = /* @__PURE__ */ new Map([
|
|
825
|
+
[CLIENT_METHODS.fs_read_text_file, zReadTextFileRequest],
|
|
826
|
+
[CLIENT_METHODS.fs_write_text_file, zWriteTextFileRequest],
|
|
827
|
+
[CLIENT_METHODS.session_request_permission, zRequestPermissionRequest],
|
|
828
|
+
[CLIENT_METHODS.session_update, zSessionNotification],
|
|
829
|
+
[CLIENT_METHODS.terminal_create, zCreateTerminalRequest],
|
|
830
|
+
[CLIENT_METHODS.terminal_kill, zKillTerminalCommandRequest],
|
|
831
|
+
[CLIENT_METHODS.terminal_output, zTerminalOutputRequest],
|
|
832
|
+
[CLIENT_METHODS.terminal_release, zReleaseTerminalRequest],
|
|
833
|
+
[CLIENT_METHODS.terminal_wait_for_exit, zWaitForTerminalExitRequest]
|
|
834
|
+
]);
|
|
835
|
+
function validateDaemonInboundMessage(message) {
|
|
836
|
+
if (!("method" in message)) return true;
|
|
837
|
+
const validator = daemonClientParamValidators.get(message.method);
|
|
838
|
+
return !validator || validator.safeParse(message.params).success;
|
|
839
|
+
}
|
|
840
|
+
__name(validateDaemonInboundMessage, "validateDaemonInboundMessage");
|
|
841
|
+
var PreparedResponseBudget = class {
|
|
842
|
+
constructor(limits) {
|
|
843
|
+
this.limits = limits;
|
|
844
|
+
}
|
|
845
|
+
static {
|
|
846
|
+
__name(this, "PreparedResponseBudget");
|
|
847
|
+
}
|
|
848
|
+
objectCharges = /* @__PURE__ */ new WeakMap();
|
|
849
|
+
primitiveCharges = /* @__PURE__ */ new Map();
|
|
850
|
+
retainedCount = 0;
|
|
851
|
+
retainedBytes = 0;
|
|
852
|
+
closed = false;
|
|
853
|
+
reserve(value) {
|
|
854
|
+
if (this.closed) return;
|
|
855
|
+
const availableBytes = Math.max(
|
|
856
|
+
0,
|
|
857
|
+
this.limits.maxQueuedBytes - this.retainedBytes
|
|
858
|
+
);
|
|
859
|
+
const envelopeBytes = Math.min(2048, this.limits.maxQueuedBytes);
|
|
860
|
+
const charge = envelopeBytes + estimatePreparedResponseBytes(
|
|
861
|
+
value,
|
|
862
|
+
Math.max(0, availableBytes - envelopeBytes)
|
|
863
|
+
);
|
|
864
|
+
if (this.retainedCount >= this.limits.maxQueuedMessages || charge > availableBytes) {
|
|
865
|
+
throw new NdJsonQueueLimitError(
|
|
866
|
+
this.limits.maxQueuedMessages,
|
|
867
|
+
this.limits.maxQueuedBytes,
|
|
868
|
+
charge,
|
|
869
|
+
availableBytes
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
const charges = this.getCharges(value, true);
|
|
873
|
+
charges.push(charge);
|
|
874
|
+
this.retainedCount++;
|
|
875
|
+
this.retainedBytes += charge;
|
|
876
|
+
}
|
|
877
|
+
releaseMessage(message) {
|
|
878
|
+
if (!isPlainRecord(message) || Object.hasOwn(message, "method") || !Object.hasOwn(message, "id")) {
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
const value = Object.hasOwn(message, "result") ? message["result"] : message["error"];
|
|
882
|
+
const charges = this.getCharges(value, false);
|
|
883
|
+
if (!charges) return;
|
|
884
|
+
const charge = charges.shift();
|
|
885
|
+
if (charge === void 0) return;
|
|
886
|
+
if (charges.length === 0 && !isObjectValue(value)) {
|
|
887
|
+
this.primitiveCharges.delete(value);
|
|
888
|
+
}
|
|
889
|
+
this.retainedCount--;
|
|
890
|
+
this.retainedBytes -= charge;
|
|
891
|
+
}
|
|
892
|
+
close() {
|
|
893
|
+
this.closed = true;
|
|
894
|
+
this.objectCharges = /* @__PURE__ */ new WeakMap();
|
|
895
|
+
this.primitiveCharges.clear();
|
|
896
|
+
this.retainedCount = 0;
|
|
897
|
+
this.retainedBytes = 0;
|
|
898
|
+
}
|
|
899
|
+
getCharges(value, create) {
|
|
900
|
+
const charges = isObjectValue(value) ? this.objectCharges.get(value) : this.primitiveCharges.get(value);
|
|
901
|
+
if (charges || !create) return charges;
|
|
902
|
+
const created = [];
|
|
903
|
+
if (isObjectValue(value)) {
|
|
904
|
+
this.objectCharges.set(value, created);
|
|
905
|
+
} else {
|
|
906
|
+
this.primitiveCharges.set(value, created);
|
|
907
|
+
}
|
|
908
|
+
return created;
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
var OutboundOperationBudget = class {
|
|
912
|
+
constructor(limits) {
|
|
913
|
+
this.limits = limits;
|
|
914
|
+
}
|
|
915
|
+
static {
|
|
916
|
+
__name(this, "OutboundOperationBudget");
|
|
917
|
+
}
|
|
918
|
+
retainedCount = 0;
|
|
919
|
+
retainedBytes = 0;
|
|
920
|
+
generation = 0;
|
|
921
|
+
closed = false;
|
|
922
|
+
reserve(value) {
|
|
923
|
+
if (this.closed) return () => {
|
|
924
|
+
};
|
|
925
|
+
const availableBytes = Math.max(
|
|
926
|
+
0,
|
|
927
|
+
this.limits.maxQueuedBytes - this.retainedBytes
|
|
928
|
+
);
|
|
929
|
+
const envelopeBytes = Math.min(2048, this.limits.maxQueuedBytes);
|
|
930
|
+
const charge = envelopeBytes + estimatePreparedResponseBytes(
|
|
931
|
+
value,
|
|
932
|
+
Math.max(0, availableBytes - envelopeBytes)
|
|
933
|
+
);
|
|
934
|
+
if (this.retainedCount >= this.limits.maxQueuedMessages || charge > availableBytes) {
|
|
935
|
+
throw new NdJsonQueueLimitError(
|
|
936
|
+
this.limits.maxQueuedMessages,
|
|
937
|
+
this.limits.maxQueuedBytes,
|
|
938
|
+
charge,
|
|
939
|
+
availableBytes
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
this.retainedCount++;
|
|
943
|
+
this.retainedBytes += charge;
|
|
944
|
+
const generation = this.generation;
|
|
945
|
+
let active = true;
|
|
946
|
+
return () => {
|
|
947
|
+
if (!active) return;
|
|
948
|
+
active = false;
|
|
949
|
+
if (this.closed || this.generation !== generation) return;
|
|
950
|
+
this.retainedCount--;
|
|
951
|
+
this.retainedBytes -= charge;
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
close() {
|
|
955
|
+
this.closed = true;
|
|
956
|
+
this.generation++;
|
|
957
|
+
this.retainedCount = 0;
|
|
958
|
+
this.retainedBytes = 0;
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
function* enumerableOwnKeys(value) {
|
|
962
|
+
for (const key in value) {
|
|
963
|
+
if (Object.hasOwn(value, key)) yield key;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
__name(enumerableOwnKeys, "enumerableOwnKeys");
|
|
967
|
+
function estimatePreparedResponseBytes(value, limitBytes) {
|
|
968
|
+
let bytes = 0;
|
|
969
|
+
const stack = [{ kind: "value", value }];
|
|
970
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
971
|
+
while (stack.length > 0) {
|
|
972
|
+
const frame = stack.pop();
|
|
973
|
+
if (frame.kind === "array") {
|
|
974
|
+
if (frame.index >= frame.value.length) continue;
|
|
975
|
+
if (frame.index > 0) bytes++;
|
|
976
|
+
if (bytes > limitBytes) return limitBytes + 1;
|
|
977
|
+
const descriptor = Object.getOwnPropertyDescriptor(
|
|
978
|
+
frame.value,
|
|
979
|
+
String(frame.index)
|
|
980
|
+
);
|
|
981
|
+
if (descriptor?.get || descriptor?.set) return limitBytes + 1;
|
|
982
|
+
stack.push({ ...frame, index: frame.index + 1 });
|
|
983
|
+
stack.push({ kind: "value", value: descriptor?.value });
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
if (frame.kind === "record") {
|
|
987
|
+
const next = frame.keys.next();
|
|
988
|
+
if (next.done) continue;
|
|
989
|
+
const descriptor = Object.getOwnPropertyDescriptor(
|
|
990
|
+
frame.value,
|
|
991
|
+
next.value
|
|
992
|
+
);
|
|
993
|
+
if (!descriptor || descriptor.get || descriptor.set) {
|
|
994
|
+
return limitBytes + 1;
|
|
995
|
+
}
|
|
996
|
+
bytes += (frame.first ? 0 : 1) + Buffer.byteLength(next.value) + 3;
|
|
997
|
+
if (bytes > limitBytes) return limitBytes + 1;
|
|
998
|
+
stack.push({ ...frame, first: false });
|
|
999
|
+
stack.push({ kind: "value", value: descriptor.value });
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
1002
|
+
const current = frame.value;
|
|
1003
|
+
if (current === null) {
|
|
1004
|
+
bytes += 4;
|
|
1005
|
+
} else if (current === void 0) {
|
|
1006
|
+
bytes += 4;
|
|
1007
|
+
} else if (typeof current === "string") {
|
|
1008
|
+
bytes += Buffer.byteLength(current) + 2;
|
|
1009
|
+
} else if (typeof current === "number") {
|
|
1010
|
+
bytes += 24;
|
|
1011
|
+
} else if (typeof current === "boolean") {
|
|
1012
|
+
bytes += 5;
|
|
1013
|
+
} else if (Array.isArray(current)) {
|
|
1014
|
+
if (seen.has(current) || Object.hasOwn(current, "toJSON")) {
|
|
1015
|
+
return limitBytes + 1;
|
|
1016
|
+
}
|
|
1017
|
+
seen.add(current);
|
|
1018
|
+
bytes += 2;
|
|
1019
|
+
stack.push({ kind: "array", value: current, index: 0 });
|
|
1020
|
+
} else if (isPlainRecord(current)) {
|
|
1021
|
+
if (seen.has(current) || Object.hasOwn(current, "toJSON")) {
|
|
1022
|
+
return limitBytes + 1;
|
|
1023
|
+
}
|
|
1024
|
+
seen.add(current);
|
|
1025
|
+
bytes += 2;
|
|
1026
|
+
stack.push({
|
|
1027
|
+
kind: "record",
|
|
1028
|
+
value: current,
|
|
1029
|
+
keys: enumerableOwnKeys(current),
|
|
1030
|
+
first: true
|
|
1031
|
+
});
|
|
1032
|
+
} else {
|
|
1033
|
+
return limitBytes + 1;
|
|
1034
|
+
}
|
|
1035
|
+
if (bytes > limitBytes) return limitBytes + 1;
|
|
1036
|
+
}
|
|
1037
|
+
return Math.max(1, bytes);
|
|
1038
|
+
}
|
|
1039
|
+
__name(estimatePreparedResponseBytes, "estimatePreparedResponseBytes");
|
|
1040
|
+
function isObjectValue(value) {
|
|
1041
|
+
return typeof value === "object" && value !== null;
|
|
1042
|
+
}
|
|
1043
|
+
__name(isObjectValue, "isObjectValue");
|
|
1044
|
+
function isPlainRecord(value) {
|
|
1045
|
+
if (!isObjectValue(value) || Array.isArray(value)) return false;
|
|
1046
|
+
const prototype = Object.getPrototypeOf(value);
|
|
1047
|
+
return prototype === Object.prototype || prototype === null;
|
|
1048
|
+
}
|
|
1049
|
+
__name(isPlainRecord, "isPlainRecord");
|
|
569
1050
|
function getAcpMemoryArgs() {
|
|
570
1051
|
if (cachedMemoryArgs) return cachedMemoryArgs;
|
|
571
1052
|
const constrainedMemory = process.constrainedMemory;
|
|
@@ -680,22 +1161,71 @@ function createSpawnChannelFactory(options = {}) {
|
|
|
680
1161
|
}
|
|
681
1162
|
const writable = Writable.toWeb(child.stdin);
|
|
682
1163
|
const readable = Readable.toWeb(child.stdout);
|
|
1164
|
+
const preparedResponses = options.pipeLimits ? new PreparedResponseBudget(options.pipeLimits) : void 0;
|
|
1165
|
+
const outboundOperations = options.pipeLimits ? new OutboundOperationBudget(options.pipeLimits) : void 0;
|
|
1166
|
+
let reportTransportFailure;
|
|
1167
|
+
let transportFailureReported = false;
|
|
1168
|
+
const transportFailed = options.pipeLimits ? new Promise((resolve) => {
|
|
1169
|
+
reportTransportFailure = resolve;
|
|
1170
|
+
}) : void 0;
|
|
1171
|
+
const failTransport = options.pipeLimits ? (error) => {
|
|
1172
|
+
if (transportFailureReported) return;
|
|
1173
|
+
transportFailureReported = true;
|
|
1174
|
+
reportTransportFailure?.(error);
|
|
1175
|
+
reportTransportFailure = void 0;
|
|
1176
|
+
preparedResponses?.close();
|
|
1177
|
+
outboundOperations?.close();
|
|
1178
|
+
child.stdout?.destroy();
|
|
1179
|
+
child.stdin?.destroy();
|
|
1180
|
+
void trackedChild.terminate().catch(() => {
|
|
1181
|
+
});
|
|
1182
|
+
options.pipeHooks?.onTransportError?.(error);
|
|
1183
|
+
} : void 0;
|
|
683
1184
|
const pipeHooks = options.pipeLimits ? {
|
|
684
1185
|
...options.pipeHooks,
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
1186
|
+
onMessageObserved: /* @__PURE__ */ __name((observation) => {
|
|
1187
|
+
if (observation.direction === "sent") {
|
|
1188
|
+
preparedResponses?.releaseMessage(observation.message);
|
|
1189
|
+
}
|
|
1190
|
+
options.pipeHooks?.onMessageObserved?.(observation);
|
|
1191
|
+
}, "onMessageObserved"),
|
|
1192
|
+
onTransportError: failTransport
|
|
690
1193
|
} : options.pipeHooks;
|
|
691
1194
|
const stream = ndJsonStream(
|
|
692
1195
|
writable,
|
|
693
1196
|
readable,
|
|
694
1197
|
pipeHooks,
|
|
695
|
-
options.pipeLimits
|
|
1198
|
+
options.pipeLimits,
|
|
1199
|
+
options.pipeLimits ? validateDaemonInboundMessage : void 0,
|
|
1200
|
+
options.pipeLimits !== void 0
|
|
696
1201
|
);
|
|
697
1202
|
return {
|
|
698
1203
|
stream,
|
|
1204
|
+
...transportFailed ? { transportFailed } : {},
|
|
1205
|
+
...failTransport && options.pipeLimits ? {
|
|
1206
|
+
transportGuard: {
|
|
1207
|
+
maxActiveHandlers: options.pipeLimits.maxQueuedMessages,
|
|
1208
|
+
maxActiveHandlerBytes: options.pipeLimits.maxQueuedBytes,
|
|
1209
|
+
reserveOutboundOperation: /* @__PURE__ */ __name((value) => {
|
|
1210
|
+
try {
|
|
1211
|
+
return outboundOperations?.reserve(value) ?? (() => {
|
|
1212
|
+
});
|
|
1213
|
+
} catch (error) {
|
|
1214
|
+
failTransport(error);
|
|
1215
|
+
throw error;
|
|
1216
|
+
}
|
|
1217
|
+
}, "reserveOutboundOperation"),
|
|
1218
|
+
reservePreparedResponse: /* @__PURE__ */ __name((value) => {
|
|
1219
|
+
try {
|
|
1220
|
+
preparedResponses?.reserve(value);
|
|
1221
|
+
} catch (error) {
|
|
1222
|
+
failTransport(error);
|
|
1223
|
+
throw error;
|
|
1224
|
+
}
|
|
1225
|
+
}, "reservePreparedResponse"),
|
|
1226
|
+
fail: failTransport
|
|
1227
|
+
}
|
|
1228
|
+
} : {},
|
|
699
1229
|
kill: /* @__PURE__ */ __name(() => trackedChild.terminate(), "kill"),
|
|
700
1230
|
killSync: /* @__PURE__ */ __name(() => trackedChild.killSync(), "killSync"),
|
|
701
1231
|
exited: trackedChild.exited
|