@qwen-code/qwen-code 0.21.0 → 0.21.1-nightly.20260731.702932cc7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/model-providers.md +2 -0
- package/bundled/qc-helper/docs/configuration/settings.md +39 -28
- package/bundled/qc-helper/docs/features/channels/_meta.ts +2 -0
- package/bundled/qc-helper/docs/features/channels/github.md +139 -0
- package/bundled/qc-helper/docs/features/channels/gitlab.md +171 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +61 -6
- package/bundled/qc-helper/docs/features/code-review.md +21 -1
- package/bundled/qc-helper/docs/features/hooks.md +72 -15
- package/bundled/qc-helper/docs/features/mcp.md +9 -1
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +3 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +42 -8
- package/bundled/qc-helper/docs/qwen-serve.md +11 -7
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +2 -2
- package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
- package/bundled/review/DESIGN.md +19 -0
- package/bundled/review/SKILL.md +120 -61
- package/chunks/MaxSizedBox-LAFHK4VO.js +88 -0
- package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-EMNOBN3S.js} +71 -68
- package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-2C4A5ZTJ.js} +2 -2
- package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-ERFA6HWV.js} +1674 -591
- package/chunks/agent-PLKF6JK4.js +84 -0
- package/chunks/agent-headless-JAORDQ63.js +78 -0
- package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-OFHSZJBF.js} +79 -27
- package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-RDN2W7ND.js} +4 -4
- package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-OZERWH5R.js} +4 -4
- package/chunks/bridge-NYOBVRIT.js +94 -0
- package/chunks/{build-RV63TIRH.js → build-GDBLPA24.js} +1 -1
- package/chunks/{ca-25EDXPFZ.js → ca-6W3SK7OQ.js} +6 -1
- package/chunks/channel-management-service-5S7YCWX5.js +418 -0
- package/chunks/channel-settings-store-NLOKYO23.js +91 -0
- package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-OVWGYMZS.js} +11 -6
- package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-H55GKOQA.js} +11 -6
- package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-CABBXYHK.js} +7 -5
- package/chunks/{chunk-RIBKPMRP.js → chunk-23F4XGWO.js} +19 -6
- package/chunks/{chunk-ACY3A37B.js → chunk-25VHI5T7.js} +23 -18
- package/chunks/{chunk-MZAXJAUM.js → chunk-26JK4RPD.js} +1 -1
- package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
- package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
- package/chunks/{chunk-2X55UKQE.js → chunk-2JZR3B4A.js} +3 -3
- package/chunks/{chunk-7JURR4JT.js → chunk-2OQUICDM.js} +167 -81
- package/chunks/{chunk-ZJHVAS7M.js → chunk-2YCYFWYZ.js} +4 -5
- package/chunks/{chunk-3QMGYBFN.js → chunk-3APUUXRF.js} +1 -80
- package/chunks/{chunk-MUP3T3AD.js → chunk-3I6DUGQD.js} +1 -35
- package/chunks/{chunk-JVPM2ULZ.js → chunk-3XZ5SSNR.js} +6 -6
- package/chunks/chunk-42VPM33K.js +319 -0
- package/chunks/{chunk-VAK25FTU.js → chunk-45IOTAUS.js} +1 -1
- package/chunks/chunk-45UYUCJ6.js +363 -0
- package/chunks/{chunk-JZA3JUDJ.js → chunk-4KP2F2TE.js} +1 -1
- package/chunks/{chunk-IO3IX5Q4.js → chunk-4YJQD2IO.js} +1 -1
- package/chunks/{chunk-JXJFVC6E.js → chunk-5G6XUGXO.js} +61 -14
- package/chunks/{chunk-ZOIFNCKL.js → chunk-5NNHICSA.js} +3 -23
- package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
- package/chunks/{chunk-RHLZR4E5.js → chunk-675H6PLP.js} +1 -1
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/chunk-6MPDY6ZG.js +76 -0
- package/chunks/{chunk-PSOO6YXD.js → chunk-6NUWQ3R7.js} +9 -7
- package/chunks/{chunk-7MVVZO4N.js → chunk-6ZRWX46I.js} +4 -4
- package/chunks/{chunk-TPRQ7RZH.js → chunk-76E5Y3UZ.js} +3117 -993
- package/chunks/{chunk-UUUTRMI2.js → chunk-7ULQIS27.js} +1 -1
- package/chunks/{chunk-BKHWX6I2.js → chunk-A5BZ722X.js} +11 -3
- package/chunks/{chunk-TEHGS6UP.js → chunk-A5T5W7PR.js} +154 -16
- package/chunks/{chunk-VIA5XA4U.js → chunk-A5UODYG3.js} +4 -1
- package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
- package/chunks/{chunk-EBJQ6AXW.js → chunk-ANDVK2JN.js} +358 -14
- package/chunks/{chunk-TOFQCPDC.js → chunk-AOHY3QJ3.js} +14 -8
- package/chunks/chunk-AQ37AY7B.js +93 -0
- package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
- package/chunks/{chunk-LKEJ26GS.js → chunk-B3TA3IF5.js} +16 -11
- package/chunks/{chunk-Q4M4MDQ4.js → chunk-B43QHWY6.js} +1 -1
- package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
- package/chunks/{chunk-K36B6G2O.js → chunk-B6FOGNGH.js} +5 -5
- package/chunks/{chunk-PWVFN2LF.js → chunk-BP2H5K25.js} +1 -1
- package/chunks/{chunk-LB6DUZ26.js → chunk-BTWSGZCT.js} +264 -185
- package/chunks/{chunk-ZNAUOR2I.js → chunk-BZBPT52P.js} +2 -2
- package/chunks/{chunk-L26JL52R.js → chunk-CBBP4BMC.js} +64 -67
- package/chunks/{chunk-ZD6UTE4A.js → chunk-CNTR4GR6.js} +1 -1
- package/chunks/{chunk-3SJ43L4W.js → chunk-CPZAH673.js} +6 -0
- package/chunks/{chunk-EPDRMGT4.js → chunk-D4HTUMGX.js} +4 -28
- package/chunks/{chunk-QAF7NMK7.js → chunk-D7CQTWRS.js} +1 -1
- package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
- package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
- package/chunks/{chunk-IKCX4CCL.js → chunk-DKPJUF5F.js} +118 -95
- package/chunks/{chunk-DLWL3Z7A.js → chunk-DSFHVTWD.js} +3 -3
- package/chunks/{chunk-FSITMZJH.js → chunk-DYRYLJ3O.js} +18 -9
- package/chunks/{chunk-NL7LTRLR.js → chunk-E2BHWIDT.js} +48 -72
- package/chunks/{chunk-UDX5OBWR.js → chunk-E2FN6SM7.js} +94 -4
- package/chunks/{chunk-USTWD7QV.js → chunk-E6CJ2SMM.js} +26 -16
- package/chunks/{chunk-KMQ33DO4.js → chunk-EDB7A72S.js} +4 -4
- package/chunks/{chunk-7ZCNENPP.js → chunk-FANRZEAJ.js} +1 -1
- package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
- package/chunks/{chunk-5NBDS5S6.js → chunk-FCYYAB4S.js} +162 -7
- package/chunks/{chunk-OKY7HXPG.js → chunk-FJ5WUMUQ.js} +2 -2
- package/chunks/{chunk-PHOF65IG.js → chunk-FRXG4ARO.js} +36273 -44436
- package/chunks/{chunk-FQK6JAFG.js → chunk-FS674JW4.js} +4 -4
- package/chunks/chunk-FYJ7W2PI.js +194 -0
- package/chunks/{chunk-BULDBTYC.js → chunk-G7XXKQYS.js} +3 -28
- package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
- package/chunks/{chunk-VRYUBFMC.js → chunk-GRUAVQQR.js} +1 -1
- package/chunks/{chunk-MVSUYZDT.js → chunk-GWV7DI3S.js} +4 -4
- package/chunks/{chunk-A5L3JMUA.js → chunk-HC45LTEN.js} +18 -4
- package/chunks/{chunk-PC6JANNU.js → chunk-HKRVXYDN.js} +4 -4
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-4WIZGAH3.js → chunk-I5BT7ADR.js} +6 -58
- package/chunks/{chunk-GSN55ZRI.js → chunk-ID3O7PRB.js} +19 -7
- package/chunks/{chunk-L5UHQJTJ.js → chunk-IGTHU3T4.js} +1 -1
- package/chunks/{chunk-BIQWWWJN.js → chunk-IIUGIWWY.js} +1 -1
- package/chunks/{chunk-RWTEFFPU.js → chunk-JCJ7LKNA.js} +6140 -5616
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-PWTZEM3C.js → chunk-JXVC2PL3.js} +3 -37
- package/chunks/chunk-JYBU6YUE.js +378 -0
- package/chunks/{chunk-RF3EXIHJ.js → chunk-K3PFMM5U.js} +49 -26
- package/chunks/{chunk-JCW2R7WC.js → chunk-K623ENWT.js} +3 -79
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/chunk-KWHKHSIS.js +81 -0
- package/chunks/{chunk-DHHOYAPR.js → chunk-L2E5GFAG.js} +7 -7
- package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
- package/chunks/{chunk-E5TUC6CA.js → chunk-LHKCY7DY.js} +3 -3
- package/chunks/{chunk-NH6KE4JX.js → chunk-LOY7RWQG.js} +3 -3
- package/chunks/{chunk-U7M2DMGW.js → chunk-M4MSAE7U.js} +130 -5
- package/chunks/{chunk-IJTOWOD7.js → chunk-MB32MS4U.js} +92 -9
- package/chunks/{chunk-PR75REBZ.js → chunk-MM7TH7ZM.js} +12 -82
- package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
- package/chunks/{chunk-M5JM7OSF.js → chunk-N4ACHWNH.js} +2 -3
- package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
- package/chunks/{chunk-J56UI34H.js → chunk-NBD76HUW.js} +4 -2
- package/chunks/{chunk-2SCDWPXI.js → chunk-NC4U4I3Y.js} +5 -5
- package/chunks/{chunk-H4SBPHSA.js → chunk-NNL7WPPK.js} +3 -3
- package/chunks/{chunk-YBL3QUDD.js → chunk-NQCXWP5D.js} +1 -1
- package/chunks/{chunk-CIKQ7KKO.js → chunk-NVFSGPIF.js} +954 -444
- package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
- package/chunks/chunk-O6GEWCJA.js +21 -0
- package/chunks/chunk-OCPBI7J5.js +18 -0
- package/chunks/{chunk-KIM5GUMA.js → chunk-OE6F6ZWQ.js} +589 -220
- package/chunks/{chunk-SQCQ4KO2.js → chunk-P5DEY3NF.js} +380 -317
- package/chunks/{chunk-2JZBVYTU.js → chunk-Q3T5KA2V.js} +1 -8
- package/chunks/{chunk-MB4MZHMJ.js → chunk-QARJNL2V.js} +211 -522
- package/chunks/{chunk-YH6G52F2.js → chunk-QCXGC7QB.js} +4 -4
- package/chunks/chunk-QDK4F2N5.js +1252 -0
- package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
- package/chunks/{chunk-VULLI6WQ.js → chunk-QIERF2GQ.js} +6 -6
- package/chunks/{chunk-TGILQ3YH.js → chunk-QQTJK5GB.js} +200 -77
- package/chunks/{chunk-H5FFA6TH.js → chunk-QTHQ6Z5X.js} +16 -3
- package/chunks/{chunk-5I2IWRSH.js → chunk-R2XWGR75.js} +2 -2
- package/chunks/{chunk-YPE6A4GC.js → chunk-RT7FNC2O.js} +2 -2
- package/chunks/{chunk-OFDOK3VM.js → chunk-RX7NJOPE.js} +8 -13
- package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
- package/chunks/{chunk-K4XWPEWB.js → chunk-SHN4KHDK.js} +4 -33
- package/chunks/{chunk-VYPFXUCB.js → chunk-SZ3KHTDR.js} +1 -1
- package/chunks/chunk-T26EAKDL.js +13 -0
- package/chunks/chunk-T3CHYWJZ.js +758 -0
- package/chunks/{chunk-FNQ6T3CV.js → chunk-TEGJSJDF.js} +10 -7
- package/chunks/{chunk-RZIX2G32.js → chunk-THPORXSI.js} +1 -1
- package/chunks/{chunk-OHNBB4XR.js → chunk-THVU3RNH.js} +1 -1
- package/chunks/{record-artifact-RQKFYO5B.js → chunk-TIRRPCFS.js} +22 -7
- package/chunks/{chunk-ETSW4KLJ.js → chunk-TUCOXPHJ.js} +2 -2
- package/chunks/{chunk-63P4EL5V.js → chunk-TZTAV5RH.js} +1 -1
- package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
- package/chunks/{chunk-3RN6GBKS.js → chunk-U5CODIJW.js} +1 -1
- package/chunks/chunk-UU2B5YG6.js +2196 -0
- package/chunks/{chunk-R5AFZNQW.js → chunk-VAVHTGU4.js} +15 -8
- package/chunks/{chunk-2NH6DYI4.js → chunk-VHPFWR2O.js} +12 -12
- package/chunks/{chunk-IKYJHJNF.js → chunk-VOMQ2P6B.js} +3 -3
- package/chunks/{chunk-ZFDTEDCF.js → chunk-VX22DUW2.js} +6 -6
- package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
- package/chunks/{chunk-M4FMGVY4.js → chunk-WQP7BKWA.js} +3 -3
- package/chunks/{chunk-LH2BYDQ5.js → chunk-X2E5TFJ5.js} +18 -12
- package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
- package/chunks/{chunk-YX324OPW.js → chunk-XDS22O52.js} +1 -1
- package/chunks/chunk-XP4L6KS3.js +463 -0
- package/chunks/{chunk-6FGBXPWM.js → chunk-XQK4XXTN.js} +38 -44
- package/chunks/{chunk-55DJUCI2.js → chunk-XWYPFDB5.js} +53 -43
- package/chunks/{chunk-Y34KJKDC.js → chunk-Y7BVNVVW.js} +1 -1
- package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
- package/chunks/{chunk-HIJQF5B5.js → chunk-YGE3IXJP.js} +1 -1
- package/chunks/{chunk-LQIW3YFY.js → chunk-YJFPRUWX.js} +9 -7
- package/chunks/{chunk-J24WCGIN.js → chunk-YQIIG4NA.js} +4 -4
- package/chunks/{chunk-BJX6ZSUK.js → chunk-YUFIEIWC.js} +2 -2
- package/chunks/{chunk-NIBLUX3Y.js → chunk-Z3S5EMOW.js} +148 -21
- package/chunks/{chunk-WCXCRJYB.js → chunk-Z3YLHKB7.js} +1 -1
- package/chunks/chunk-Z4X5MTRT.js +133 -0
- package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
- package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
- package/chunks/{chunk-X5XDDSSH.js → chunk-ZPZ7ZJEE.js} +28 -5
- package/chunks/{computer-use-SOQ4E3VX.js → computer-use-GOM42LNK.js} +53 -50
- package/chunks/{config-utils-7V7GGIW6.js → config-utils-WADIDWGG.js} +4 -3
- package/chunks/contextCommand-6LVPTIWD.js +83 -0
- package/chunks/core-runtime-253XV2DB.js +137 -0
- package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-45POYEVP.js} +50 -47
- package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-62YZWVAY.js} +3 -3
- package/chunks/{cron-create-YIID5XAW.js → cron-create-6E7GIQTG.js} +6 -6
- package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-JD26XY3W.js} +5 -5
- package/chunks/{cron-list-XEGS463Q.js → cron-list-CUWFB44G.js} +6 -6
- package/chunks/{daemon-YO6433NF.js → daemon-PCNCI5YU.js} +428 -18
- package/chunks/daemon-status-provider-AKALDYJJ.js +93 -0
- package/chunks/daemon-trust-policy-XB7ZSQFQ.js +88 -0
- package/chunks/daemon-trust-policy-monitor-FUTKP42Q.js +175 -0
- package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
- package/chunks/deferred-core-runtime-RKLCO7V5.js +92 -0
- package/chunks/dist-26BIMQT6.js +4487 -0
- package/chunks/{dist-F6IBUDR4.js → dist-2PERFI23.js} +12 -9
- package/chunks/{dist-46NQKLTW.js → dist-OAOC5OV4.js} +2 -2
- package/chunks/{dist-YFNEUWSE.js → dist-PVEAFLHY.js} +5 -4
- package/chunks/{dist-AIKFMUKK.js → dist-SL2LUMML.js} +1449 -14
- package/chunks/dist-ULIG4M5H.js +13415 -0
- package/chunks/{dist-WEAHOXDM.js → dist-WGMNT3JQ.js} +2 -1
- package/chunks/{dist-BBLXMS3N.js → dist-ZHXOBXDN.js} +3 -3
- package/chunks/earlyInputCapture-FCWU47OB.js +85 -0
- package/chunks/{edit-OBDSQURM.js → edit-TTACM3LN.js} +51 -48
- package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
- package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-R34GFDX6.js} +51 -48
- package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-KJPBB6G5.js} +51 -48
- package/chunks/environment-IJG3N2PR.js +105 -0
- package/chunks/errors-MRON5OJD.js +91 -0
- package/chunks/esm-K5FARBNI.js +5548 -0
- package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-UBA66Y4I.js} +51 -48
- package/chunks/exitPlanMode-SMSPGNSK.js +76 -0
- package/chunks/{fast-path-JJZFJANL.js → fast-path-ZBAMZDCP.js} +16 -6
- package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
- package/chunks/{gemini-QS36EBZV.js → gemini-XFT7HRNL.js} +106 -99
- package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-XD3MLYQX.js} +40 -11
- package/chunks/{getMachineId-bsd-V7W3GODC.js → getMachineId-bsd-FG7IUY6U.js} +1 -1
- package/chunks/{getMachineId-darwin-TDO75DQP.js → getMachineId-darwin-GLCJI2RA.js} +1 -1
- package/chunks/{getMachineId-linux-TF43WQT2.js → getMachineId-linux-O6OPPAKO.js} +1 -1
- package/chunks/{getMachineId-unsupported-ZGUO3TXT.js → getMachineId-unsupported-S6CKYVGC.js} +1 -1
- package/chunks/{getMachineId-win-ECFYZZFQ.js → getMachineId-win-X5SRNEH7.js} +1 -1
- package/chunks/{glob-V7R3PSK3.js → glob-HFKY7HXZ.js} +51 -48
- package/chunks/goal-tools-HGO6VXPB.js +335 -0
- package/chunks/{grep-QYPSK7OP.js → grep-EO5Z3PFV.js} +53 -49
- package/chunks/handleAutoUpdate-WRENFE6C.js +84 -0
- package/chunks/i18n-ZG5OTVSV.js +100 -0
- package/chunks/{image-gen-Z3VPGKRC.js → image-gen-CKWZ4MJI.js} +12 -12
- package/chunks/initializer-FYPLLRC7.js +89 -0
- package/chunks/installationInfo-5RV4HRMC.js +83 -0
- package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
- package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-IKO4G53C.js} +3 -3
- package/chunks/lib-RUF3WZA6.js +9 -0
- package/chunks/list-ZNWVL3AT.js +92 -0
- package/chunks/{list-agents-5KJJHR6I.js → list-agents-PXJ7ZUFB.js} +3 -3
- package/chunks/loadedSettingsAdapter-GQGNHP5I.js +86 -0
- package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-MS5DFAWH.js} +78 -113
- package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-Y26NQZ5I.js} +15 -8
- package/chunks/{ls-NTK6VOQJ.js → ls-ONQTTMQR.js} +5 -5
- package/chunks/{lsp-2JI24STP.js → lsp-YGHHRGMD.js} +3 -3
- package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-67AK4GTL.js} +51 -48
- package/chunks/mcp-FVQ4VTLM.js +86 -0
- package/chunks/{monitor-R3ODH5U6.js → monitor-BXB33EOZ.js} +51 -48
- package/chunks/nonInteractiveCli-CN2GYSN3.js +148 -0
- package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-FKYRBV4L.js} +51 -48
- package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-UUXV5DGU.js} +26 -27
- package/chunks/pidfile-MV347TTZ.js +89 -0
- package/chunks/process-registry-2CHQBXH5.js +157 -0
- package/chunks/{processUtils-RT7UNCC2.js → processUtils-LKFG52RV.js} +2 -2
- package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
- package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-3WYI2HRW.js} +56 -53
- package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-B46MW45O.js} +10 -10
- package/chunks/read-file-ACSHVWP3.js +29 -0
- package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-U2IJN5HM.js} +4 -4
- package/chunks/record-artifact-MGPJ7EG4.js +21 -0
- package/chunks/resumeHistoryUtils-AMS4767B.js +94 -0
- package/chunks/ripGrep-BAPM2UKC.js +76 -0
- package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
- package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-JEN6FO2A.js} +1018 -263
- package/chunks/runtime-WVP22ISH.js +122 -0
- package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-HTX5ACVR.js} +50 -47
- package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
- package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-4BQANSJ6.js} +7 -7
- package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-Z4VXWVFX.js} +14 -14
- package/chunks/{send-message-Q6OOR6BR.js → send-message-PMP4ATVM.js} +8 -13
- package/chunks/serve-ELQIVNWN.js +92 -0
- package/chunks/{server-4UMH7OIZ.js → server-JNW2NOSQ.js} +5288 -1364
- package/chunks/{session-K3O3Q2SV.js → session-NC356XNS.js} +102 -95
- package/chunks/{settings-CR2EWTBA.js → settings-73RMIOJ6.js} +54 -51
- package/chunks/shell-NMHF5TFG.js +86 -0
- package/chunks/{skill-I3SDA4MB.js → skill-XPGXHEKO.js} +22 -22
- package/chunks/skill-settings-5IGIJDGA.js +94 -0
- package/chunks/spawnChannel-T5THBHFN.js +85 -0
- package/chunks/standalone-update-ODXEPDLP.js +95 -0
- package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-S27DXVAE.js} +1241 -905
- package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-D7E6ZFKR.js} +4 -4
- package/chunks/task-create-NFCYD43L.js +26 -0
- package/chunks/{task-list-FOPULZEP.js → task-list-TAVMGEVD.js} +7 -7
- package/chunks/{task-stop-H6RHXFVQ.js → task-stop-ZDF2UJRM.js} +3 -3
- package/chunks/{task-update-M57TFZJT.js → task-update-6L7LHGEX.js} +12 -11
- package/chunks/{team-create-YJALH5D2.js → team-create-CTLQWTJ2.js} +53 -50
- package/chunks/{team-delete-QE2UXJL7.js → team-delete-DPGGRQBU.js} +7 -7
- package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-WKRUAPJ4.js} +51 -48
- package/chunks/theme-manager-XQHXQQX6.js +80 -0
- package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-2UO5G6G6.js} +34 -6
- package/chunks/{tool-search-NF7GB6LE.js → tool-search-45YINAJA.js} +21 -22
- package/chunks/total-session-admission-QPUKGHKO.js +88 -0
- package/chunks/trustedFolders-YMUTRHEQ.js +98 -0
- package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-PZUXTVHC.js} +5 -5
- package/chunks/updateCheck-IZAN4XTB.js +95 -0
- package/chunks/useAutoAcceptIndicator-CGL2MAYE.js +96 -0
- package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-GBGNJ65K.js} +97 -90
- package/chunks/{version-HS7YSFHV.js → version-Z7EX24NZ.js} +1 -1
- package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-ETTT2H3V.js} +19 -21
- package/chunks/{web-search-S62WAP4S.js → web-search-Y3ZSVRJ6.js} +13 -13
- package/chunks/{workflow-QAGU5RU4.js → workflow-ATRJSAO7.js} +52 -49
- package/chunks/workspace-providers-status-YM3WLW3N.js +89 -0
- package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-4EGNCIPG.js} +1 -1
- package/chunks/workspace-registry-NGZOZKQP.js +96 -0
- package/chunks/workspace-service-SVWOXX2B.js +103 -0
- package/chunks/workspace-skills-status-YZHZ3PT5.js +89 -0
- package/chunks/workspace-trust-reconciler-GGBQV2U5.js +349 -0
- package/chunks/write-file-HLGCEB72.js +78 -0
- package/chunks/xterm-headless-NTYVIBT3.js +3475 -0
- package/chunks/{zh-LUIGBD55.js → zh-H3YDK5QW.js} +9 -1
- package/chunks/{zh-TW-F5KG2IYD.js → zh-TW-JYCP7XUA.js} +9 -1
- package/chunks/zoom-image-LDECT475.js +224 -0
- package/cli.js +50 -16
- package/locales/ca.js +7 -2
- package/locales/de.js +7 -2
- package/locales/en.js +10 -2
- package/locales/fr.js +7 -2
- package/locales/ja.js +7 -2
- package/locales/pt.js +7 -2
- package/locales/ru.js +7 -2
- package/locales/zh-TW.js +10 -2
- package/locales/zh.js +10 -2
- package/package.json +5 -4
- package/web-shell/assets/{arc-DcbWnB9T.js → arc-Dpy_U6Bb.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-DgDOg-c5.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-tADd9Ja3.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-68wj9MCU.js} +1 -1
- package/web-shell/assets/channel-Do7fFnFl.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-DjJLOeVU.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-CMbzGeVC.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-SlKgejv9.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-CijXssHZ.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-D8w25nvR.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-Bv9dcx_e.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-Bzf6sAOd.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-whNoNeW5.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-By_XOP3X.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-By_XOP3X.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-rpQS44Lz.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-Ck7VE6nT.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-CgRrsodR.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-CsTZtE5A.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-D5EAdVq4.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-DNrjHC7Z.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-ClJSJGgC.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-DuVnos_y.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-DEpIVl1s.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-COnQM2-C.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-C-lX5H3_.js} +1 -1
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/{index-D0GX0zZf.js → index-DfcyS2E7.js} +1 -1
- package/web-shell/assets/index-Qxt6kN7i.js +1700 -0
- package/web-shell/assets/index-bo0Z8hfu.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-D0WP-wmU.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-DgsI3Clu.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-4yCoMZO6.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-D_05au1N.js} +1 -1
- package/web-shell/assets/{linear-BkoihsaA.js → linear-B38fDz0Q.js} +1 -1
- package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-aGNwTaHi.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-C2yf_5WM.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-DiHABBT-.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-W9xkeAGe.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-BGmRXl9k.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-CvOmT43_.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-C8pdd0Z-.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-C-CYdFx2.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BieEHeN9.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-w2KQn1cI.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-DuorhRku.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-BAXm2cWy.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-8PHaOXn5.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-Do84JFSc.js} +1 -1
- package/web-shell/index.html +2 -2
- package/chunks/MaxSizedBox-5DPPWPGT.js +0 -85
- package/chunks/agent-6ODUANDO.js +0 -81
- package/chunks/agent-headless-7BYQTMHW.js +0 -75
- package/chunks/bridge-ZUB64FAE.js +0 -90
- package/chunks/chunk-LEH5C7FV.js +0 -232
- package/chunks/chunk-SZRN75WQ.js +0 -29
- package/chunks/chunk-UGYMA4EI.js +0 -219
- package/chunks/chunk-Z2BC6UJ5.js +0 -8575
- package/chunks/contextCommand-JLHYA34Z.js +0 -80
- package/chunks/daemon-status-provider-2233Q37D.js +0 -89
- package/chunks/earlyInputCapture-A7NDU3PF.js +0 -82
- package/chunks/environment-W5UFC2CH.js +0 -102
- package/chunks/errors-M7CLORXH.js +0 -88
- package/chunks/exitPlanMode-GXTBWQAR.js +0 -403
- package/chunks/handleAutoUpdate-6DBEZYPV.js +0 -81
- package/chunks/i18n-VUJJZIMU.js +0 -97
- package/chunks/initializer-UWAK5U5O.js +0 -86
- package/chunks/installationInfo-6O2YAA52.js +0 -80
- package/chunks/list-GB4ESM3T.js +0 -89
- package/chunks/loadedSettingsAdapter-OT6JVQ7U.js +0 -83
- package/chunks/mcp-6DBDJPFU.js +0 -83
- package/chunks/nonInteractiveCli-MOYCYBBU.js +0 -141
- package/chunks/pidfile-TFRZZZIO.js +0 -86
- package/chunks/read-file-APMO3PSX.js +0 -31
- package/chunks/resumeHistoryUtils-6KRYEAWZ.js +0 -91
- package/chunks/ripGrep-BEJDEDXW.js +0 -73
- package/chunks/runtime-XXRRTNP6.js +0 -118
- package/chunks/serve-7BSTXJ4T.js +0 -89
- package/chunks/shell-HH3PF3A2.js +0 -83
- package/chunks/spawnChannel-RWNDBXGA.js +0 -82
- package/chunks/src-GE4TTTML.js +0 -3147
- package/chunks/standalone-update-Q6WFRZZQ.js +0 -92
- package/chunks/task-create-N7WQSGYA.js +0 -25
- package/chunks/theme-manager-SWRILQHI.js +0 -77
- package/chunks/total-session-admission-DLHHHLD3.js +0 -84
- package/chunks/trustedFolders-KHXHY6PY.js +0 -93
- package/chunks/updateCheck-RKL6M5XN.js +0 -92
- package/chunks/useAutoAcceptIndicator-CFQ5BUJL.js +0 -93
- package/chunks/workspace-providers-status-QSVZUETE.js +0 -86
- package/chunks/workspace-registry-UT4RBNBM.js +0 -88
- package/chunks/workspace-service-JFWRUS4V.js +0 -98
- package/chunks/workspace-skills-status-ZBBKJOI2.js +0 -85
- package/chunks/write-file-VHIXW5M7.js +0 -73
- package/web-shell/assets/channel-Cq7YKtfC.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ9aC1Tg.js +0 -1
- package/web-shell/assets/index-D9haPt0X.css +0 -5
- package/web-shell/assets/index-ckX9Pq5k.js +0 -1230
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-B7W4zlCr.js +0 -1
- package/chunks/{chunk-TARRHLLG.js → chunk-QUGAUQGJ.js} +25 -25
- package/chunks/{chunk-U7ZFW55U.js → chunk-VOQXFAY5.js} +977 -977
- /package/chunks/{chunk-LXXMOYPL.js → chunk-VXZBKKQR.js} +0 -0
|
@@ -5,28 +5,34 @@ import {
|
|
|
5
5
|
} from "./chunk-VGC4I5JJ.js";
|
|
6
6
|
import {
|
|
7
7
|
isAnyAutoMemPath
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3I6DUGQD.js";
|
|
9
|
+
import {
|
|
10
|
+
STRUCTURED_OUTPUT_REDACTED_ARGS
|
|
11
|
+
} from "./chunk-7ULQIS27.js";
|
|
12
|
+
import {
|
|
13
|
+
BaseDeclarativeTool,
|
|
14
|
+
BaseToolInvocation,
|
|
15
|
+
SchemaValidator,
|
|
16
|
+
ToolDisplayNames,
|
|
17
|
+
ToolNames
|
|
18
|
+
} from "./chunk-MM7TH7ZM.js";
|
|
9
19
|
import {
|
|
10
20
|
DEFAULT_QWEN_MODEL
|
|
11
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-DKPJUF5F.js";
|
|
12
22
|
import {
|
|
13
23
|
estimateTextTokens,
|
|
14
24
|
generateLegacyMcpToolName,
|
|
15
25
|
normalizeToolNameForProvider
|
|
16
26
|
} from "./chunk-46UV252V.js";
|
|
17
|
-
import {
|
|
18
|
-
require_lib
|
|
19
|
-
} from "./chunk-A4UCTEB5.js";
|
|
20
27
|
import {
|
|
21
28
|
normalize
|
|
22
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZBVS26BY.js";
|
|
23
30
|
import {
|
|
24
31
|
InstallationManager
|
|
25
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-R2XWGR75.js";
|
|
26
33
|
import {
|
|
27
|
-
atomicWriteFile
|
|
28
|
-
|
|
29
|
-
} from "./chunk-A5L3JMUA.js";
|
|
34
|
+
atomicWriteFile
|
|
35
|
+
} from "./chunk-HC45LTEN.js";
|
|
30
36
|
import {
|
|
31
37
|
isTelemetrySdkInitialized,
|
|
32
38
|
recordApiErrorMetrics,
|
|
@@ -47,10 +53,11 @@ import {
|
|
|
47
53
|
recordSubagentExecutionMetrics,
|
|
48
54
|
recordTokenUsageMetrics,
|
|
49
55
|
recordToolCallMetrics
|
|
50
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-QARJNL2V.js";
|
|
51
57
|
import {
|
|
52
|
-
require_src
|
|
53
|
-
|
|
58
|
+
require_src,
|
|
59
|
+
safeJsonStringify
|
|
60
|
+
} from "./chunk-W4RQUHY3.js";
|
|
54
61
|
import {
|
|
55
62
|
EVENT_API_CANCEL,
|
|
56
63
|
EVENT_API_ERROR,
|
|
@@ -72,7 +79,6 @@ import {
|
|
|
72
79
|
EVENT_EXTENSION_UNINSTALL,
|
|
73
80
|
EVENT_EXTENSION_UPDATE,
|
|
74
81
|
EVENT_FILE_OPERATION,
|
|
75
|
-
EVENT_FLASH_FALLBACK,
|
|
76
82
|
EVENT_IDE_CONNECTION,
|
|
77
83
|
EVENT_MEMORY_DREAM,
|
|
78
84
|
EVENT_MEMORY_EXTRACT,
|
|
@@ -83,6 +89,7 @@ import {
|
|
|
83
89
|
EVENT_PROMPT_SUGGESTION,
|
|
84
90
|
EVENT_PROTOCOL_TAG_SANITIZED,
|
|
85
91
|
EVENT_RIPGREP_FALLBACK,
|
|
92
|
+
EVENT_RIPGREP_RUNTIME_RECOVERY,
|
|
86
93
|
EVENT_SKILL_LAUNCH,
|
|
87
94
|
EVENT_SLASH_COMMAND,
|
|
88
95
|
EVENT_SPECULATION,
|
|
@@ -94,23 +101,8 @@ import {
|
|
|
94
101
|
EVENT_USER_RETRY,
|
|
95
102
|
EVENT_WORKFLOW_KEYWORD,
|
|
96
103
|
EVENT_WORKFLOW_RUN,
|
|
97
|
-
SERVICE_NAME
|
|
98
|
-
|
|
99
|
-
} from "./chunk-BULDBTYC.js";
|
|
100
|
-
import {
|
|
101
|
-
SemanticAttributes,
|
|
102
|
-
init_esm
|
|
103
|
-
} from "./chunk-U7ZFW55U.js";
|
|
104
|
-
import {
|
|
105
|
-
STRUCTURED_OUTPUT_REDACTED_ARGS
|
|
106
|
-
} from "./chunk-UUUTRMI2.js";
|
|
107
|
-
import {
|
|
108
|
-
BaseDeclarativeTool,
|
|
109
|
-
BaseToolInvocation,
|
|
110
|
-
SchemaValidator,
|
|
111
|
-
ToolDisplayNames,
|
|
112
|
-
ToolNames
|
|
113
|
-
} from "./chunk-PR75REBZ.js";
|
|
104
|
+
SERVICE_NAME
|
|
105
|
+
} from "./chunk-G7XXKQYS.js";
|
|
114
106
|
import {
|
|
115
107
|
Storage,
|
|
116
108
|
createDebugLogger,
|
|
@@ -121,7 +113,11 @@ import {
|
|
|
121
113
|
makeRelative,
|
|
122
114
|
shortenPath,
|
|
123
115
|
unescapePath
|
|
124
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-E2BHWIDT.js";
|
|
117
|
+
import {
|
|
118
|
+
SemanticAttributes,
|
|
119
|
+
init_esm
|
|
120
|
+
} from "./chunk-VOQXFAY5.js";
|
|
125
121
|
import {
|
|
126
122
|
require_dist
|
|
127
123
|
} from "./chunk-75DOP5OR.js";
|
|
@@ -5697,7 +5693,7 @@ var require_utils = __commonJS({
|
|
|
5697
5693
|
});
|
|
5698
5694
|
|
|
5699
5695
|
// node_modules/chardet/lib/index.js
|
|
5700
|
-
var
|
|
5696
|
+
var require_lib = __commonJS({
|
|
5701
5697
|
"node_modules/chardet/lib/index.js"(exports) {
|
|
5702
5698
|
"use strict";
|
|
5703
5699
|
init_esbuild_shims();
|
|
@@ -5818,10 +5814,10 @@ var require_lib2 = __commonJS({
|
|
|
5818
5814
|
exports.analyse = analyse;
|
|
5819
5815
|
var detectFile = /* @__PURE__ */ __name((filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
5820
5816
|
let fd;
|
|
5821
|
-
const
|
|
5817
|
+
const fs8 = (0, node_1.default)();
|
|
5822
5818
|
const handler = /* @__PURE__ */ __name((err, buffer) => {
|
|
5823
5819
|
if (fd) {
|
|
5824
|
-
|
|
5820
|
+
fs8.closeSync(fd);
|
|
5825
5821
|
}
|
|
5826
5822
|
if (err) {
|
|
5827
5823
|
reject(err);
|
|
@@ -5830,26 +5826,26 @@ var require_lib2 = __commonJS({
|
|
|
5830
5826
|
}
|
|
5831
5827
|
}, "handler");
|
|
5832
5828
|
if (opts && opts.sampleSize) {
|
|
5833
|
-
fd =
|
|
5829
|
+
fd = fs8.openSync(filepath, "r");
|
|
5834
5830
|
const sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
5835
|
-
|
|
5831
|
+
fs8.read(fd, sample, 0, opts.sampleSize, opts.offset, (err) => {
|
|
5836
5832
|
handler(err, sample);
|
|
5837
5833
|
});
|
|
5838
5834
|
return;
|
|
5839
5835
|
}
|
|
5840
|
-
|
|
5836
|
+
fs8.readFile(filepath, handler);
|
|
5841
5837
|
}), "detectFile");
|
|
5842
5838
|
exports.detectFile = detectFile;
|
|
5843
5839
|
var detectFileSync = /* @__PURE__ */ __name((filepath, opts = {}) => {
|
|
5844
|
-
const
|
|
5840
|
+
const fs8 = (0, node_1.default)();
|
|
5845
5841
|
if (opts && opts.sampleSize) {
|
|
5846
|
-
const fd =
|
|
5842
|
+
const fd = fs8.openSync(filepath, "r");
|
|
5847
5843
|
const sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
5848
|
-
|
|
5849
|
-
|
|
5844
|
+
fs8.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
5845
|
+
fs8.closeSync(fd);
|
|
5850
5846
|
return (0, exports.detect)(sample);
|
|
5851
5847
|
}
|
|
5852
|
-
return (0, exports.detect)(
|
|
5848
|
+
return (0, exports.detect)(fs8.readFileSync(filepath));
|
|
5853
5849
|
}, "detectFileSync");
|
|
5854
5850
|
exports.detectFileSync = detectFileSync;
|
|
5855
5851
|
exports.default = {
|
|
@@ -7399,12 +7395,12 @@ var require_lru_cache = __commonJS({
|
|
|
7399
7395
|
|
|
7400
7396
|
// packages/core/src/tools/read-file.ts
|
|
7401
7397
|
init_esbuild_shims();
|
|
7402
|
-
import
|
|
7403
|
-
import
|
|
7398
|
+
import path9 from "node:path";
|
|
7399
|
+
import fs7 from "node:fs/promises";
|
|
7404
7400
|
|
|
7405
7401
|
// packages/core/src/utils/fileUtils.ts
|
|
7406
7402
|
init_esbuild_shims();
|
|
7407
|
-
import
|
|
7403
|
+
import fs3 from "node:fs";
|
|
7408
7404
|
import fsPromises from "node:fs/promises";
|
|
7409
7405
|
import path2 from "node:path";
|
|
7410
7406
|
|
|
@@ -7830,12 +7826,12 @@ var Mime = class {
|
|
|
7830
7826
|
}
|
|
7831
7827
|
return this;
|
|
7832
7828
|
}
|
|
7833
|
-
getType(
|
|
7834
|
-
if (typeof
|
|
7829
|
+
getType(path10) {
|
|
7830
|
+
if (typeof path10 !== "string")
|
|
7835
7831
|
return null;
|
|
7836
|
-
const last =
|
|
7832
|
+
const last = path10.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
7837
7833
|
const ext = last.replace(/^.*\./s, "").toLowerCase();
|
|
7838
|
-
const hasPath = last.length <
|
|
7834
|
+
const hasPath = last.length < path10.length;
|
|
7839
7835
|
const hasDot = ext.length < last.length - 1;
|
|
7840
7836
|
if (!hasDot && hasPath)
|
|
7841
7837
|
return null;
|
|
@@ -7875,28 +7871,34 @@ var Mime_default = Mime;
|
|
|
7875
7871
|
// packages/core/node_modules/mime/dist/src/index_lite.js
|
|
7876
7872
|
var index_lite_default = new Mime_default(standard_default)._freeze();
|
|
7877
7873
|
|
|
7878
|
-
// packages/core/src/utils/
|
|
7874
|
+
// packages/core/src/utils/encoding.ts
|
|
7879
7875
|
init_esbuild_shims();
|
|
7880
|
-
var import_iconv_lite = __toESM(require_lib(), 1);
|
|
7881
|
-
var iconvLite = import_iconv_lite.default;
|
|
7882
|
-
function iconvDecode(buffer, encoding) {
|
|
7883
|
-
return iconvLite.decode(buffer, encoding);
|
|
7884
|
-
}
|
|
7885
|
-
__name(iconvDecode, "iconvDecode");
|
|
7886
|
-
function iconvEncode(content, encoding) {
|
|
7887
|
-
return iconvLite.encode(content, encoding);
|
|
7888
|
-
}
|
|
7889
|
-
__name(iconvEncode, "iconvEncode");
|
|
7890
|
-
function iconvEncodingExists(encoding) {
|
|
7891
|
-
return iconvLite.encodingExists(encoding);
|
|
7892
|
-
}
|
|
7893
|
-
__name(iconvEncodingExists, "iconvEncodingExists");
|
|
7894
7876
|
function isUtf8CompatibleEncoding(encoding) {
|
|
7895
7877
|
const lower = encoding.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
7896
7878
|
return lower === "utf8" || lower === "ascii" || lower === "usascii";
|
|
7897
7879
|
}
|
|
7898
7880
|
__name(isUtf8CompatibleEncoding, "isUtf8CompatibleEncoding");
|
|
7899
7881
|
|
|
7882
|
+
// packages/core/src/utils/load-iconv-lite.ts
|
|
7883
|
+
init_esbuild_shims();
|
|
7884
|
+
var iconvLiteModulePromise;
|
|
7885
|
+
function isIconvLite(candidate) {
|
|
7886
|
+
return "decode" in candidate && typeof candidate.decode === "function" && "encode" in candidate && typeof candidate.encode === "function" && "encodingExists" in candidate && typeof candidate.encodingExists === "function";
|
|
7887
|
+
}
|
|
7888
|
+
__name(isIconvLite, "isIconvLite");
|
|
7889
|
+
function loadIconvLite() {
|
|
7890
|
+
iconvLiteModulePromise ??= import("./lib-RUF3WZA6.js").then((module) => {
|
|
7891
|
+
const imported = module;
|
|
7892
|
+
const candidate = "default" in imported && imported.default ? imported.default : imported;
|
|
7893
|
+
if (!isIconvLite(candidate)) {
|
|
7894
|
+
throw new Error("iconv-lite module does not match the expected API");
|
|
7895
|
+
}
|
|
7896
|
+
return candidate;
|
|
7897
|
+
});
|
|
7898
|
+
return iconvLiteModulePromise;
|
|
7899
|
+
}
|
|
7900
|
+
__name(loadIconvLite, "loadIconvLite");
|
|
7901
|
+
|
|
7900
7902
|
// packages/core/src/utils/ignorePatterns.ts
|
|
7901
7903
|
init_esbuild_shims();
|
|
7902
7904
|
import path from "node:path";
|
|
@@ -8106,16 +8108,12 @@ var BINARY_EXTENSIONS = [
|
|
|
8106
8108
|
|
|
8107
8109
|
// packages/core/src/utils/systemEncoding.ts
|
|
8108
8110
|
init_esbuild_shims();
|
|
8109
|
-
var import_chardet = __toESM(
|
|
8111
|
+
var import_chardet = __toESM(require_lib(), 1);
|
|
8110
8112
|
import { isUtf8 } from "node:buffer";
|
|
8111
8113
|
import { execSync } from "node:child_process";
|
|
8112
8114
|
import os from "node:os";
|
|
8113
8115
|
var debugLogger = createDebugLogger("ENCODING");
|
|
8114
8116
|
var cachedSystemEncoding = void 0;
|
|
8115
|
-
function resetEncodingCache() {
|
|
8116
|
-
cachedSystemEncoding = void 0;
|
|
8117
|
-
}
|
|
8118
|
-
__name(resetEncodingCache, "resetEncodingCache");
|
|
8119
8117
|
function getCachedEncodingForBuffer(buffer) {
|
|
8120
8118
|
if (isUtf8(buffer)) {
|
|
8121
8119
|
return "utf-8";
|
|
@@ -8865,6 +8863,19 @@ var TEXT_RANGE_FAST_PATH_MAX_SIZE = 10 * 1024 * 1024;
|
|
|
8865
8863
|
var DEFAULT_RANGE_READ_BYTES = 25e3;
|
|
8866
8864
|
|
|
8867
8865
|
// packages/core/src/utils/read-text-range.ts
|
|
8866
|
+
var CursorNotAtLineBoundaryError = class extends Error {
|
|
8867
|
+
constructor(startOffset, maxSnapBytes) {
|
|
8868
|
+
super(
|
|
8869
|
+
`Byte offset ${startOffset} is not the start of a line, and no line break was found within ${maxSnapBytes} bytes after it. Resume from a cursor this reader returned.`
|
|
8870
|
+
);
|
|
8871
|
+
this.startOffset = startOffset;
|
|
8872
|
+
this.maxSnapBytes = maxSnapBytes;
|
|
8873
|
+
this.name = "CursorNotAtLineBoundaryError";
|
|
8874
|
+
}
|
|
8875
|
+
static {
|
|
8876
|
+
__name(this, "CursorNotAtLineBoundaryError");
|
|
8877
|
+
}
|
|
8878
|
+
};
|
|
8868
8879
|
var LargeNonUtf8TextError = class extends Error {
|
|
8869
8880
|
constructor(encoding, reason) {
|
|
8870
8881
|
super(
|
|
@@ -8878,11 +8889,25 @@ var LargeNonUtf8TextError = class extends Error {
|
|
|
8878
8889
|
__name(this, "LargeNonUtf8TextError");
|
|
8879
8890
|
}
|
|
8880
8891
|
};
|
|
8892
|
+
var TextScanBudgetExceededError = class extends Error {
|
|
8893
|
+
constructor(scannedBytes, maxScanBytes) {
|
|
8894
|
+
super(
|
|
8895
|
+
`Locating the requested line window would read more than ${maxScanBytes} bytes (line offsets are resolved by scanning from the start of the file). Use a byte-offset read to reach this part of the file.`
|
|
8896
|
+
);
|
|
8897
|
+
this.scannedBytes = scannedBytes;
|
|
8898
|
+
this.maxScanBytes = maxScanBytes;
|
|
8899
|
+
this.name = "TextScanBudgetExceededError";
|
|
8900
|
+
}
|
|
8901
|
+
static {
|
|
8902
|
+
__name(this, "TextScanBudgetExceededError");
|
|
8903
|
+
}
|
|
8904
|
+
};
|
|
8881
8905
|
async function readTextRange(request2) {
|
|
8882
8906
|
request2.signal?.throwIfAborted();
|
|
8883
8907
|
const stats = request2.stats ?? await stat(request2.path);
|
|
8884
8908
|
const maxOutputBytes = normalizeMaxBytes(request2.maxOutputBytes);
|
|
8885
|
-
|
|
8909
|
+
const maxScanBytes = request2.maxScanBytes ?? Number.POSITIVE_INFINITY;
|
|
8910
|
+
if (stats.size < TEXT_RANGE_FAST_PATH_MAX_SIZE && stats.size <= maxScanBytes) {
|
|
8886
8911
|
const { content, encoding, bom } = await readFileWithEncodingInfo(
|
|
8887
8912
|
request2.path,
|
|
8888
8913
|
request2.signal
|
|
@@ -8901,9 +8926,193 @@ async function readTextRange(request2) {
|
|
|
8901
8926
|
lineEnding: detectLineEndingFromContent(content)
|
|
8902
8927
|
};
|
|
8903
8928
|
}
|
|
8904
|
-
return readLargeUtf8Range(
|
|
8929
|
+
return readLargeUtf8Range(
|
|
8930
|
+
request2.path,
|
|
8931
|
+
request2,
|
|
8932
|
+
maxOutputBytes,
|
|
8933
|
+
maxScanBytes,
|
|
8934
|
+
stats.size
|
|
8935
|
+
);
|
|
8905
8936
|
}
|
|
8906
8937
|
__name(readTextRange, "readTextRange");
|
|
8938
|
+
async function readTextRangeFromHandle(fileHandle, request2) {
|
|
8939
|
+
request2.signal?.throwIfAborted();
|
|
8940
|
+
return readLargeUtf8Range(
|
|
8941
|
+
fileHandle,
|
|
8942
|
+
request2,
|
|
8943
|
+
normalizeMaxBytes(request2.maxOutputBytes),
|
|
8944
|
+
request2.maxScanBytes,
|
|
8945
|
+
request2.fileSize
|
|
8946
|
+
);
|
|
8947
|
+
}
|
|
8948
|
+
__name(readTextRangeFromHandle, "readTextRangeFromHandle");
|
|
8949
|
+
async function readTextCursorWindowFromHandle(fileHandle, request2) {
|
|
8950
|
+
request2.signal?.throwIfAborted();
|
|
8951
|
+
const encoding = await detectFileEncoding(fileHandle);
|
|
8952
|
+
request2.signal?.throwIfAborted();
|
|
8953
|
+
if (!isUtf8CompatibleEncoding(encoding)) {
|
|
8954
|
+
throw new LargeNonUtf8TextError(encoding);
|
|
8955
|
+
}
|
|
8956
|
+
const bom = await hasUtf8Bom(fileHandle, request2.fileSize);
|
|
8957
|
+
const maxOutputBytes = normalizeMaxBytes(request2.maxOutputBytes);
|
|
8958
|
+
const startOffset = await snapToLineStart(fileHandle, request2);
|
|
8959
|
+
if (startOffset >= request2.fileSize) {
|
|
8960
|
+
return {
|
|
8961
|
+
content: "",
|
|
8962
|
+
startOffset,
|
|
8963
|
+
encoding: "utf-8",
|
|
8964
|
+
bom,
|
|
8965
|
+
lineEnding: "lf",
|
|
8966
|
+
truncatedByBytes: false
|
|
8967
|
+
};
|
|
8968
|
+
}
|
|
8969
|
+
const decoder = new TextDecoder2("utf-8", { fatal: true, ignoreBOM: true });
|
|
8970
|
+
const decode = /* @__PURE__ */ __name((chunk, options) => {
|
|
8971
|
+
try {
|
|
8972
|
+
return decoder.decode(chunk, options);
|
|
8973
|
+
} catch {
|
|
8974
|
+
throw new LargeNonUtf8TextError(encoding, "invalid-utf8");
|
|
8975
|
+
}
|
|
8976
|
+
}, "decode");
|
|
8977
|
+
const lines = [];
|
|
8978
|
+
let contentBytes = 0;
|
|
8979
|
+
let consumedBytes = 0;
|
|
8980
|
+
let truncatedByBytes = false;
|
|
8981
|
+
let stop = false;
|
|
8982
|
+
let skipRestOfLine = false;
|
|
8983
|
+
let sawCrlf = false;
|
|
8984
|
+
const emit = /* @__PURE__ */ __name((line, hadNewline) => {
|
|
8985
|
+
const separator = lines.length > 0 ? 1 : 0;
|
|
8986
|
+
const lineBytes = Buffer.byteLength(line, "utf8");
|
|
8987
|
+
if (contentBytes + separator + lineBytes > maxOutputBytes) {
|
|
8988
|
+
if (lines.length > 0) {
|
|
8989
|
+
stop = true;
|
|
8990
|
+
return;
|
|
8991
|
+
}
|
|
8992
|
+
const cut = truncateUtf8(line, maxOutputBytes);
|
|
8993
|
+
lines.push(cut.content);
|
|
8994
|
+
if (hadNewline && line.endsWith("\r")) sawCrlf = true;
|
|
8995
|
+
contentBytes = Buffer.byteLength(cut.content, "utf8");
|
|
8996
|
+
consumedBytes += contentBytes;
|
|
8997
|
+
truncatedByBytes = true;
|
|
8998
|
+
skipRestOfLine = true;
|
|
8999
|
+
stop = true;
|
|
9000
|
+
return;
|
|
9001
|
+
}
|
|
9002
|
+
lines.push(line);
|
|
9003
|
+
if (hadNewline && line.endsWith("\r")) sawCrlf = true;
|
|
9004
|
+
contentBytes += separator + lineBytes;
|
|
9005
|
+
consumedBytes += lineBytes + (hadNewline ? 1 : 0);
|
|
9006
|
+
if (request2.limit !== void 0 && lines.length >= request2.limit) {
|
|
9007
|
+
stop = true;
|
|
9008
|
+
}
|
|
9009
|
+
}, "emit");
|
|
9010
|
+
let pending = "";
|
|
9011
|
+
let firstChunk = true;
|
|
9012
|
+
let reachedEof = true;
|
|
9013
|
+
for await (const raw of chunksFromHandle(
|
|
9014
|
+
fileHandle,
|
|
9015
|
+
startOffset,
|
|
9016
|
+
request2.fileSize,
|
|
9017
|
+
request2.signal
|
|
9018
|
+
)) {
|
|
9019
|
+
request2.signal?.throwIfAborted();
|
|
9020
|
+
let text = decode(raw, { stream: true });
|
|
9021
|
+
if (firstChunk) {
|
|
9022
|
+
firstChunk = false;
|
|
9023
|
+
if (startOffset === 0 && text.charCodeAt(0) === 65279) {
|
|
9024
|
+
text = text.slice(1);
|
|
9025
|
+
consumedBytes += UTF8_BOM_BYTES;
|
|
9026
|
+
}
|
|
9027
|
+
}
|
|
9028
|
+
pending += text;
|
|
9029
|
+
let newline = pending.indexOf("\n");
|
|
9030
|
+
const pendingLine = newline === -1 ? pending : pending.slice(0, newline);
|
|
9031
|
+
const pendingSeparator = lines.length > 0 ? 1 : 0;
|
|
9032
|
+
if (contentBytes + pendingSeparator + Buffer.byteLength(pendingLine, "utf8") > maxOutputBytes) {
|
|
9033
|
+
if (lines.length === 0) {
|
|
9034
|
+
emit(pendingLine, newline !== -1);
|
|
9035
|
+
} else {
|
|
9036
|
+
stop = true;
|
|
9037
|
+
}
|
|
9038
|
+
reachedEof = false;
|
|
9039
|
+
break;
|
|
9040
|
+
}
|
|
9041
|
+
while (newline !== -1) {
|
|
9042
|
+
emit(pending.slice(0, newline), true);
|
|
9043
|
+
pending = pending.slice(newline + 1);
|
|
9044
|
+
if (stop) break;
|
|
9045
|
+
newline = pending.indexOf("\n");
|
|
9046
|
+
}
|
|
9047
|
+
if (stop) {
|
|
9048
|
+
reachedEof = false;
|
|
9049
|
+
break;
|
|
9050
|
+
}
|
|
9051
|
+
}
|
|
9052
|
+
if (reachedEof) {
|
|
9053
|
+
decode();
|
|
9054
|
+
if (!stop) emit(pending, false);
|
|
9055
|
+
}
|
|
9056
|
+
if (skipRestOfLine) {
|
|
9057
|
+
const resumeAt = await snapToLineStart(
|
|
9058
|
+
fileHandle,
|
|
9059
|
+
{
|
|
9060
|
+
...request2,
|
|
9061
|
+
startOffset: startOffset + Math.max(consumedBytes, 1),
|
|
9062
|
+
// This offset was produced internally after returning a truncated prefix,
|
|
9063
|
+
// so it must advance past the rest of that line. `maxSnapBytes` protects
|
|
9064
|
+
// only client-supplied offsets.
|
|
9065
|
+
maxSnapBytes: request2.fileSize
|
|
9066
|
+
},
|
|
9067
|
+
true
|
|
9068
|
+
);
|
|
9069
|
+
consumedBytes = resumeAt - startOffset;
|
|
9070
|
+
}
|
|
9071
|
+
const content = lines.join("\n");
|
|
9072
|
+
const nextOffset = startOffset + consumedBytes;
|
|
9073
|
+
return {
|
|
9074
|
+
content,
|
|
9075
|
+
startOffset,
|
|
9076
|
+
...nextOffset < request2.fileSize ? { nextOffset } : {},
|
|
9077
|
+
encoding: "utf-8",
|
|
9078
|
+
bom,
|
|
9079
|
+
lineEnding: sawCrlf ? "crlf" : "lf",
|
|
9080
|
+
truncatedByBytes
|
|
9081
|
+
};
|
|
9082
|
+
}
|
|
9083
|
+
__name(readTextCursorWindowFromHandle, "readTextCursorWindowFromHandle");
|
|
9084
|
+
var UTF8_BOM_BYTES = 3;
|
|
9085
|
+
var LINE_FEED = 10;
|
|
9086
|
+
async function hasUtf8Bom(fileHandle, fileSize) {
|
|
9087
|
+
if (fileSize < UTF8_BOM_BYTES) return false;
|
|
9088
|
+
const probe = Buffer.alloc(UTF8_BOM_BYTES);
|
|
9089
|
+
const { bytesRead } = await fileHandle.read(probe, 0, UTF8_BOM_BYTES, 0);
|
|
9090
|
+
return bytesRead === UTF8_BOM_BYTES && probe[0] === 239 && probe[1] === 187 && probe[2] === 191;
|
|
9091
|
+
}
|
|
9092
|
+
__name(hasUtf8Bom, "hasUtf8Bom");
|
|
9093
|
+
async function snapToLineStart(fileHandle, request2, allowEof = false) {
|
|
9094
|
+
const { startOffset, fileSize, maxSnapBytes, signal } = request2;
|
|
9095
|
+
if (startOffset <= 0) return 0;
|
|
9096
|
+
if (startOffset >= fileSize) return startOffset;
|
|
9097
|
+
const previous = Buffer.alloc(1);
|
|
9098
|
+
const { bytesRead } = await fileHandle.read(previous, 0, 1, startOffset - 1);
|
|
9099
|
+
if (bytesRead === 1 && previous[0] === LINE_FEED) return startOffset;
|
|
9100
|
+
let scanned = 0;
|
|
9101
|
+
const snapEnd = Math.min(fileSize, startOffset + maxSnapBytes);
|
|
9102
|
+
for await (const chunk of chunksFromHandle(
|
|
9103
|
+
fileHandle,
|
|
9104
|
+
startOffset,
|
|
9105
|
+
snapEnd,
|
|
9106
|
+
signal
|
|
9107
|
+
)) {
|
|
9108
|
+
const index = chunk.indexOf(LINE_FEED);
|
|
9109
|
+
if (index !== -1) return startOffset + scanned + index + 1;
|
|
9110
|
+
scanned += chunk.length;
|
|
9111
|
+
}
|
|
9112
|
+
if (allowEof) return fileSize;
|
|
9113
|
+
throw new CursorNotAtLineBoundaryError(startOffset, maxSnapBytes);
|
|
9114
|
+
}
|
|
9115
|
+
__name(snapToLineStart, "snapToLineStart");
|
|
8907
9116
|
function normalizeMaxBytes(maxOutputBytes) {
|
|
8908
9117
|
if (maxOutputBytes === Number.POSITIVE_INFINITY) {
|
|
8909
9118
|
return Number.POSITIVE_INFINITY;
|
|
@@ -8929,8 +9138,9 @@ function sliceDecodedContent(content, offset, limit, maxOutputBytes) {
|
|
|
8929
9138
|
};
|
|
8930
9139
|
}
|
|
8931
9140
|
__name(sliceDecodedContent, "sliceDecodedContent");
|
|
8932
|
-
async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
8933
|
-
const encoding = await detectFileEncoding(
|
|
9141
|
+
async function readLargeUtf8Range(source, request2, maxOutputBytes, maxScanBytes, sourceSize) {
|
|
9142
|
+
const encoding = await detectFileEncoding(source);
|
|
9143
|
+
request2.signal?.throwIfAborted();
|
|
8934
9144
|
if (!isUtf8CompatibleEncoding(encoding)) {
|
|
8935
9145
|
throw new LargeNonUtf8TextError(encoding);
|
|
8936
9146
|
}
|
|
@@ -8946,14 +9156,31 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
8946
9156
|
let previousChunkEndedWithCR = false;
|
|
8947
9157
|
let originalLineCountExact = true;
|
|
8948
9158
|
let stoppedEarly = false;
|
|
9159
|
+
let scannedBytes = 0;
|
|
9160
|
+
let consumedBytes = 0;
|
|
8949
9161
|
const decoder = new TextDecoder2("utf-8", {
|
|
8950
9162
|
fatal: true,
|
|
8951
9163
|
ignoreBOM: true
|
|
8952
9164
|
});
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
9165
|
+
let pathStream;
|
|
9166
|
+
let chunks;
|
|
9167
|
+
const sourceEnd = Math.min(
|
|
9168
|
+
sourceSize ?? Number.POSITIVE_INFINITY,
|
|
9169
|
+
maxScanBytes
|
|
9170
|
+
);
|
|
9171
|
+
if (sourceEnd <= 0 && (sourceSize ?? 0) > 0) {
|
|
9172
|
+
throw new TextScanBudgetExceededError(0, maxScanBytes);
|
|
9173
|
+
}
|
|
9174
|
+
if (typeof source === "string") {
|
|
9175
|
+
pathStream = createReadStream(source, {
|
|
9176
|
+
highWaterMark: 512 * 1024,
|
|
9177
|
+
signal: request2.signal,
|
|
9178
|
+
...Number.isFinite(sourceEnd) ? { end: Math.max(0, sourceEnd - 1) } : {}
|
|
9179
|
+
});
|
|
9180
|
+
chunks = pathStream;
|
|
9181
|
+
} else {
|
|
9182
|
+
chunks = chunksFromHandle(source, 0, sourceEnd, request2.signal);
|
|
9183
|
+
}
|
|
8957
9184
|
function appendSelected(fragment) {
|
|
8958
9185
|
if (fragment.length === 0 || truncatedByBytes) {
|
|
8959
9186
|
return;
|
|
@@ -8984,17 +9211,19 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
8984
9211
|
}
|
|
8985
9212
|
__name(decodeUtf8Chunk, "decodeUtf8Chunk");
|
|
8986
9213
|
try {
|
|
8987
|
-
for await (const rawChunk of
|
|
9214
|
+
for await (const rawChunk of chunks) {
|
|
8988
9215
|
request2.signal?.throwIfAborted();
|
|
9216
|
+
scannedBytes += rawChunk.length;
|
|
8989
9217
|
let chunk = decodeUtf8Chunk(rawChunk, { stream: true });
|
|
8990
9218
|
if (firstChunk) {
|
|
8991
9219
|
firstChunk = false;
|
|
8992
9220
|
if (chunk.charCodeAt(0) === 65279) {
|
|
8993
9221
|
chunk = chunk.slice(1);
|
|
8994
9222
|
bom = true;
|
|
9223
|
+
consumedBytes += 3;
|
|
8995
9224
|
}
|
|
8996
9225
|
}
|
|
8997
|
-
if (previousChunkEndedWithCR && chunk.startsWith("\n")
|
|
9226
|
+
if (isSelectedLine() && previousChunkEndedWithCR && chunk.startsWith("\n")) {
|
|
8998
9227
|
lineEnding = "crlf";
|
|
8999
9228
|
}
|
|
9000
9229
|
previousChunkEndedWithCR = chunk.endsWith("\r");
|
|
@@ -9002,11 +9231,14 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9002
9231
|
let newline = chunk.indexOf("\n", start);
|
|
9003
9232
|
while (newline !== -1) {
|
|
9004
9233
|
if (isSelectedLine()) {
|
|
9005
|
-
|
|
9234
|
+
const fragment = chunk.slice(start, newline);
|
|
9235
|
+
if (fragment.endsWith("\r")) lineEnding = "crlf";
|
|
9236
|
+
appendSelected(fragment);
|
|
9006
9237
|
if (currentLine + 1 < endLine) {
|
|
9007
9238
|
appendSelected("\n");
|
|
9008
9239
|
}
|
|
9009
9240
|
}
|
|
9241
|
+
consumedBytes += Buffer.byteLength(chunk.slice(start, newline), "utf8") + 1;
|
|
9010
9242
|
currentLine++;
|
|
9011
9243
|
start = newline + 1;
|
|
9012
9244
|
if (currentLine >= endLine || truncatedByBytes) {
|
|
@@ -9016,8 +9248,12 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9016
9248
|
}
|
|
9017
9249
|
newline = chunk.indexOf("\n", start);
|
|
9018
9250
|
}
|
|
9019
|
-
if (start < chunk.length
|
|
9020
|
-
|
|
9251
|
+
if (!stoppedEarly && start < chunk.length) {
|
|
9252
|
+
const tail = chunk.slice(start);
|
|
9253
|
+
if (isSelectedLine()) {
|
|
9254
|
+
appendSelected(tail);
|
|
9255
|
+
}
|
|
9256
|
+
consumedBytes += Buffer.byteLength(tail, "utf8");
|
|
9021
9257
|
}
|
|
9022
9258
|
if (currentLine >= endLine || truncatedByBytes) {
|
|
9023
9259
|
originalLineCountExact = false;
|
|
@@ -9026,7 +9262,13 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9026
9262
|
}
|
|
9027
9263
|
}
|
|
9028
9264
|
} finally {
|
|
9029
|
-
|
|
9265
|
+
if (pathStream !== void 0 && !pathStream.destroyed) {
|
|
9266
|
+
pathStream.destroy();
|
|
9267
|
+
}
|
|
9268
|
+
}
|
|
9269
|
+
const budgetExhausted = !stoppedEarly && sourceSize !== void 0 && sourceSize > maxScanBytes && scannedBytes >= maxScanBytes;
|
|
9270
|
+
if (budgetExhausted) {
|
|
9271
|
+
throw new TextScanBudgetExceededError(scannedBytes, maxScanBytes);
|
|
9030
9272
|
}
|
|
9031
9273
|
if (!stoppedEarly) {
|
|
9032
9274
|
decodeUtf8Chunk();
|
|
@@ -9034,6 +9276,7 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9034
9276
|
return {
|
|
9035
9277
|
content: output,
|
|
9036
9278
|
originalLineCount: currentLine + 1,
|
|
9279
|
+
...stoppedEarly && !truncatedByBytes && consumedBytes < (sourceSize ?? Number.POSITIVE_INFINITY) ? { nextByteOffset: consumedBytes } : {},
|
|
9037
9280
|
encoding: "utf-8",
|
|
9038
9281
|
bom,
|
|
9039
9282
|
lineEnding,
|
|
@@ -9042,6 +9285,26 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9042
9285
|
};
|
|
9043
9286
|
}
|
|
9044
9287
|
__name(readLargeUtf8Range, "readLargeUtf8Range");
|
|
9288
|
+
async function* chunksFromHandle(fileHandle, from = 0, toExclusive = Number.POSITIVE_INFINITY, signal) {
|
|
9289
|
+
const highWaterMark = 512 * 1024;
|
|
9290
|
+
const buffer = Buffer.allocUnsafe(highWaterMark);
|
|
9291
|
+
let position = from;
|
|
9292
|
+
while (position < toExclusive) {
|
|
9293
|
+
signal?.throwIfAborted();
|
|
9294
|
+
const bytesToRead = Math.min(highWaterMark, toExclusive - position);
|
|
9295
|
+
const { bytesRead } = await fileHandle.read(
|
|
9296
|
+
buffer,
|
|
9297
|
+
0,
|
|
9298
|
+
bytesToRead,
|
|
9299
|
+
position
|
|
9300
|
+
);
|
|
9301
|
+
signal?.throwIfAborted();
|
|
9302
|
+
if (bytesRead === 0) return;
|
|
9303
|
+
position += bytesRead;
|
|
9304
|
+
yield buffer.subarray(0, bytesRead);
|
|
9305
|
+
}
|
|
9306
|
+
}
|
|
9307
|
+
__name(chunksFromHandle, "chunksFromHandle");
|
|
9045
9308
|
function truncateUtf8(content, maxBytes) {
|
|
9046
9309
|
const bytes = Buffer.byteLength(content, "utf8");
|
|
9047
9310
|
if (bytes <= maxBytes) {
|
|
@@ -9066,9 +9329,234 @@ function detectLineEndingFromContent(content) {
|
|
|
9066
9329
|
}
|
|
9067
9330
|
__name(detectLineEndingFromContent, "detectLineEndingFromContent");
|
|
9068
9331
|
|
|
9332
|
+
// packages/core/src/utils/image-view.ts
|
|
9333
|
+
init_esbuild_shims();
|
|
9334
|
+
import fs2 from "node:fs/promises";
|
|
9335
|
+
var IMAGE_VIEW_MAX_EDGE = 1568;
|
|
9336
|
+
var IMAGE_VIEW_MAX_PATCHES = 1568;
|
|
9337
|
+
var IMAGE_PATCH_SIZE = 28;
|
|
9338
|
+
var IMAGE_MAX_UPSCALE = 8;
|
|
9339
|
+
var IMAGE_JPEG_QUALITY = 92;
|
|
9340
|
+
var IMAGE_MAX_SOURCE_BYTES = 100 * 1024 * 1024;
|
|
9341
|
+
var IMAGE_MAX_OUTPUT_BYTES = 9 * 1024 * 1024;
|
|
9342
|
+
var SUPPORTED_IMAGE_FORMATS = /* @__PURE__ */ new Set(["jpeg", "png", "webp"]);
|
|
9343
|
+
var ImageViewError = class extends Error {
|
|
9344
|
+
constructor(code, message) {
|
|
9345
|
+
super(message);
|
|
9346
|
+
this.code = code;
|
|
9347
|
+
}
|
|
9348
|
+
static {
|
|
9349
|
+
__name(this, "ImageViewError");
|
|
9350
|
+
}
|
|
9351
|
+
};
|
|
9352
|
+
function fitsVisualBudget({ width, height }) {
|
|
9353
|
+
return width <= IMAGE_VIEW_MAX_EDGE && height <= IMAGE_VIEW_MAX_EDGE && Math.ceil(width / IMAGE_PATCH_SIZE) * Math.ceil(height / IMAGE_PATCH_SIZE) <= IMAGE_VIEW_MAX_PATCHES;
|
|
9354
|
+
}
|
|
9355
|
+
__name(fitsVisualBudget, "fitsVisualBudget");
|
|
9356
|
+
function boundedSize(width, height, maxUpscale) {
|
|
9357
|
+
const widthIsLongEdge = width >= height;
|
|
9358
|
+
const maxLongEdge = Math.min(
|
|
9359
|
+
IMAGE_VIEW_MAX_EDGE,
|
|
9360
|
+
Math.max(width, height) * maxUpscale
|
|
9361
|
+
);
|
|
9362
|
+
let low = 1;
|
|
9363
|
+
let high = maxLongEdge;
|
|
9364
|
+
let best = { width: 1, height: 1 };
|
|
9365
|
+
while (low <= high) {
|
|
9366
|
+
const longEdge = Math.floor((low + high) / 2);
|
|
9367
|
+
const candidate = widthIsLongEdge ? {
|
|
9368
|
+
width: longEdge,
|
|
9369
|
+
height: Math.max(1, Math.round(height / width * longEdge))
|
|
9370
|
+
} : {
|
|
9371
|
+
width: Math.max(1, Math.round(width / height * longEdge)),
|
|
9372
|
+
height: longEdge
|
|
9373
|
+
};
|
|
9374
|
+
if (fitsVisualBudget(candidate)) {
|
|
9375
|
+
best = candidate;
|
|
9376
|
+
low = longEdge + 1;
|
|
9377
|
+
} else {
|
|
9378
|
+
high = longEdge - 1;
|
|
9379
|
+
}
|
|
9380
|
+
}
|
|
9381
|
+
return best;
|
|
9382
|
+
}
|
|
9383
|
+
__name(boundedSize, "boundedSize");
|
|
9384
|
+
async function prepareImage(filePath, signal) {
|
|
9385
|
+
signal.throwIfAborted();
|
|
9386
|
+
let sharp;
|
|
9387
|
+
try {
|
|
9388
|
+
sharp = (await import("sharp")).default;
|
|
9389
|
+
} catch {
|
|
9390
|
+
throw new ImageViewError(
|
|
9391
|
+
"renderer_unavailable",
|
|
9392
|
+
'Image rendering is unavailable because the "sharp" image module could not be loaded.'
|
|
9393
|
+
);
|
|
9394
|
+
}
|
|
9395
|
+
let stats;
|
|
9396
|
+
try {
|
|
9397
|
+
stats = await fs2.stat(filePath);
|
|
9398
|
+
} catch (error) {
|
|
9399
|
+
if (error.code === "ENOENT") {
|
|
9400
|
+
throw new ImageViewError(
|
|
9401
|
+
"file_not_found",
|
|
9402
|
+
`Image file not found: ${filePath}`
|
|
9403
|
+
);
|
|
9404
|
+
}
|
|
9405
|
+
throw error;
|
|
9406
|
+
}
|
|
9407
|
+
if (stats.isDirectory()) {
|
|
9408
|
+
throw new ImageViewError(
|
|
9409
|
+
"target_is_directory",
|
|
9410
|
+
`Image path is a directory: ${filePath}`
|
|
9411
|
+
);
|
|
9412
|
+
}
|
|
9413
|
+
if (!stats.isFile()) {
|
|
9414
|
+
throw new ImageViewError(
|
|
9415
|
+
"target_not_regular_file",
|
|
9416
|
+
`Image path is not a regular file: ${filePath}`
|
|
9417
|
+
);
|
|
9418
|
+
}
|
|
9419
|
+
if (stats.size > IMAGE_MAX_SOURCE_BYTES) {
|
|
9420
|
+
throw new ImageViewError(
|
|
9421
|
+
"source_too_large",
|
|
9422
|
+
`Image file exceeds the 100 MB source limit: ${filePath}`
|
|
9423
|
+
);
|
|
9424
|
+
}
|
|
9425
|
+
const bytes = await fs2.readFile(filePath, { signal });
|
|
9426
|
+
if (bytes.length > IMAGE_MAX_SOURCE_BYTES) {
|
|
9427
|
+
throw new ImageViewError(
|
|
9428
|
+
"source_too_large",
|
|
9429
|
+
`Image file exceeds the 100 MB source limit: ${filePath}`
|
|
9430
|
+
);
|
|
9431
|
+
}
|
|
9432
|
+
let metadata;
|
|
9433
|
+
try {
|
|
9434
|
+
metadata = await sharp(bytes, {
|
|
9435
|
+
failOn: "error",
|
|
9436
|
+
limitInputPixels: true
|
|
9437
|
+
}).metadata();
|
|
9438
|
+
} catch {
|
|
9439
|
+
signal.throwIfAborted();
|
|
9440
|
+
throw new ImageViewError(
|
|
9441
|
+
"decode_failed",
|
|
9442
|
+
`Failed to decode image (file may be corrupt or not a static PNG, JPEG, or WebP): ${filePath}`
|
|
9443
|
+
);
|
|
9444
|
+
}
|
|
9445
|
+
signal.throwIfAborted();
|
|
9446
|
+
if (!SUPPORTED_IMAGE_FORMATS.has(metadata.format)) {
|
|
9447
|
+
throw new ImageViewError(
|
|
9448
|
+
"unsupported_image",
|
|
9449
|
+
`Unsupported image. Expected a static PNG, JPEG, or WebP file: ${filePath}`
|
|
9450
|
+
);
|
|
9451
|
+
}
|
|
9452
|
+
if ((metadata.pages ?? 1) > 1) {
|
|
9453
|
+
throw new ImageViewError(
|
|
9454
|
+
"animated_image",
|
|
9455
|
+
`Only static images are supported: ${filePath}`
|
|
9456
|
+
);
|
|
9457
|
+
}
|
|
9458
|
+
return { bytes, metadata, sharp };
|
|
9459
|
+
}
|
|
9460
|
+
__name(prepareImage, "prepareImage");
|
|
9461
|
+
async function renderImageView(filePath, prepared, selection, outputSize, signal) {
|
|
9462
|
+
const { bytes, metadata, sharp } = prepared;
|
|
9463
|
+
let output;
|
|
9464
|
+
try {
|
|
9465
|
+
output = await sharp(bytes, {
|
|
9466
|
+
autoOrient: true,
|
|
9467
|
+
failOn: "error",
|
|
9468
|
+
limitInputPixels: true
|
|
9469
|
+
}).extract(selection).resize(outputSize.width, outputSize.height, {
|
|
9470
|
+
fit: "fill",
|
|
9471
|
+
kernel: sharp.kernel.lanczos3
|
|
9472
|
+
}).flatten({ background: "#ffffff" }).jpeg({
|
|
9473
|
+
quality: IMAGE_JPEG_QUALITY,
|
|
9474
|
+
chromaSubsampling: "4:4:4"
|
|
9475
|
+
}).toBuffer();
|
|
9476
|
+
} catch {
|
|
9477
|
+
signal.throwIfAborted();
|
|
9478
|
+
throw new ImageViewError(
|
|
9479
|
+
"decode_failed",
|
|
9480
|
+
`Failed to render image overview: ${filePath}`
|
|
9481
|
+
);
|
|
9482
|
+
}
|
|
9483
|
+
signal.throwIfAborted();
|
|
9484
|
+
if (output.length > IMAGE_MAX_OUTPUT_BYTES) {
|
|
9485
|
+
throw new ImageViewError(
|
|
9486
|
+
"output_too_large",
|
|
9487
|
+
`Rendered image exceeds the 9 MB output limit: ${filePath}`
|
|
9488
|
+
);
|
|
9489
|
+
}
|
|
9490
|
+
return {
|
|
9491
|
+
bytes: output,
|
|
9492
|
+
mimeType: "image/jpeg",
|
|
9493
|
+
sourceWidth: metadata.autoOrient.width,
|
|
9494
|
+
sourceHeight: metadata.autoOrient.height,
|
|
9495
|
+
selectedWidth: selection.width,
|
|
9496
|
+
selectedHeight: selection.height,
|
|
9497
|
+
outputWidth: outputSize.width,
|
|
9498
|
+
outputHeight: outputSize.height
|
|
9499
|
+
};
|
|
9500
|
+
}
|
|
9501
|
+
__name(renderImageView, "renderImageView");
|
|
9502
|
+
async function renderImageOverview(filePath, signal) {
|
|
9503
|
+
const prepared = await prepareImage(filePath, signal);
|
|
9504
|
+
const sourceWidth = prepared.metadata.autoOrient.width;
|
|
9505
|
+
const sourceHeight = prepared.metadata.autoOrient.height;
|
|
9506
|
+
const outputSize = boundedSize(sourceWidth, sourceHeight, 1);
|
|
9507
|
+
return renderImageView(
|
|
9508
|
+
filePath,
|
|
9509
|
+
prepared,
|
|
9510
|
+
{ left: 0, top: 0, width: sourceWidth, height: sourceHeight },
|
|
9511
|
+
outputSize,
|
|
9512
|
+
signal
|
|
9513
|
+
);
|
|
9514
|
+
}
|
|
9515
|
+
__name(renderImageOverview, "renderImageOverview");
|
|
9516
|
+
async function renderNormalizedImageCrop(filePath, region, signal) {
|
|
9517
|
+
const prepared = await prepareImage(filePath, signal);
|
|
9518
|
+
const sourceWidth = prepared.metadata.autoOrient.width;
|
|
9519
|
+
const sourceHeight = prepared.metadata.autoOrient.height;
|
|
9520
|
+
const left = Math.min(
|
|
9521
|
+
sourceWidth - 1,
|
|
9522
|
+
Math.max(0, Math.floor(region.x1 / 1e3 * sourceWidth))
|
|
9523
|
+
);
|
|
9524
|
+
const top = Math.min(
|
|
9525
|
+
sourceHeight - 1,
|
|
9526
|
+
Math.max(0, Math.floor(region.y1 / 1e3 * sourceHeight))
|
|
9527
|
+
);
|
|
9528
|
+
const right = Math.min(
|
|
9529
|
+
sourceWidth,
|
|
9530
|
+
Math.max(left + 1, Math.ceil(region.x2 / 1e3 * sourceWidth))
|
|
9531
|
+
);
|
|
9532
|
+
const bottom = Math.min(
|
|
9533
|
+
sourceHeight,
|
|
9534
|
+
Math.max(top + 1, Math.ceil(region.y2 / 1e3 * sourceHeight))
|
|
9535
|
+
);
|
|
9536
|
+
const selectedWidth = right - left;
|
|
9537
|
+
const selectedHeight = bottom - top;
|
|
9538
|
+
const outputSize = boundedSize(
|
|
9539
|
+
selectedWidth,
|
|
9540
|
+
selectedHeight,
|
|
9541
|
+
IMAGE_MAX_UPSCALE
|
|
9542
|
+
);
|
|
9543
|
+
return renderImageView(
|
|
9544
|
+
filePath,
|
|
9545
|
+
prepared,
|
|
9546
|
+
{ left, top, width: selectedWidth, height: selectedHeight },
|
|
9547
|
+
outputSize,
|
|
9548
|
+
signal
|
|
9549
|
+
);
|
|
9550
|
+
}
|
|
9551
|
+
__name(renderNormalizedImageCrop, "renderNormalizedImageCrop");
|
|
9552
|
+
|
|
9069
9553
|
// packages/core/src/utils/fileUtils.ts
|
|
9070
9554
|
var debugLogger2 = createDebugLogger("FILE_UTILS");
|
|
9071
|
-
var
|
|
9555
|
+
var CANONICAL_IMAGE_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
9556
|
+
"image/jpeg",
|
|
9557
|
+
"image/png",
|
|
9558
|
+
"image/webp"
|
|
9559
|
+
]);
|
|
9072
9560
|
var PDF_FULL_TEXT_EXTRACTION_MAX_MB = 100;
|
|
9073
9561
|
var PDF_PAGED_TEXT_EXTRACTION_MAX_MB = 512;
|
|
9074
9562
|
function detectBOM(buf) {
|
|
@@ -9127,7 +9615,7 @@ function isValidUtf8(buffer) {
|
|
|
9127
9615
|
}
|
|
9128
9616
|
}
|
|
9129
9617
|
__name(isValidUtf8, "isValidUtf8");
|
|
9130
|
-
function
|
|
9618
|
+
async function decodeBufferWithEncodingInfoAsync(full) {
|
|
9131
9619
|
if (full.length === 0) {
|
|
9132
9620
|
return { content: "", encoding: "utf-8", bom: false };
|
|
9133
9621
|
}
|
|
@@ -9147,9 +9635,10 @@ function decodeBufferWithEncodingInfo(full) {
|
|
|
9147
9635
|
const detected = detectEncodingFromBuffer(full);
|
|
9148
9636
|
if (detected && !isUtf8CompatibleEncoding(detected)) {
|
|
9149
9637
|
try {
|
|
9150
|
-
|
|
9638
|
+
const iconvLite = await loadIconvLite();
|
|
9639
|
+
if (iconvLite.encodingExists(detected)) {
|
|
9151
9640
|
return {
|
|
9152
|
-
content:
|
|
9641
|
+
content: iconvLite.decode(full, detected),
|
|
9153
9642
|
encoding: detected,
|
|
9154
9643
|
bom: false
|
|
9155
9644
|
};
|
|
@@ -9162,7 +9651,7 @@ function decodeBufferWithEncodingInfo(full) {
|
|
|
9162
9651
|
}
|
|
9163
9652
|
return { content: full.toString("utf8"), encoding: "utf-8", bom: false };
|
|
9164
9653
|
}
|
|
9165
|
-
__name(
|
|
9654
|
+
__name(decodeBufferWithEncodingInfoAsync, "decodeBufferWithEncodingInfoAsync");
|
|
9166
9655
|
function decodeBOMBuffer(buf, bomInfo) {
|
|
9167
9656
|
const content = buf.subarray(bomInfo.bomLength);
|
|
9168
9657
|
switch (bomInfo.encoding) {
|
|
@@ -9199,11 +9688,11 @@ function bomEncodingToName(bomEncoding) {
|
|
|
9199
9688
|
}
|
|
9200
9689
|
__name(bomEncodingToName, "bomEncodingToName");
|
|
9201
9690
|
async function readFileWithEncodingInfo(filePath, signal) {
|
|
9202
|
-
const full = await
|
|
9691
|
+
const full = await fs3.promises.readFile(
|
|
9203
9692
|
filePath,
|
|
9204
9693
|
signal === void 0 ? void 0 : { signal }
|
|
9205
9694
|
);
|
|
9206
|
-
return
|
|
9695
|
+
return await decodeBufferWithEncodingInfoAsync(full);
|
|
9207
9696
|
}
|
|
9208
9697
|
__name(readFileWithEncodingInfo, "readFileWithEncodingInfo");
|
|
9209
9698
|
async function readFileWithEncoding(filePath) {
|
|
@@ -9218,7 +9707,7 @@ async function countFileLines(filePath) {
|
|
|
9218
9707
|
__name(countFileLines, "countFileLines");
|
|
9219
9708
|
async function readFileWithLineAndLimit(params) {
|
|
9220
9709
|
const { path: filePath, limit, line, maxOutputBytes, signal } = params;
|
|
9221
|
-
const stats = params.stats ?? await
|
|
9710
|
+
const stats = params.stats ?? await fs3.promises.stat(filePath);
|
|
9222
9711
|
if (line !== void 0 && line > 0 || Number.isFinite(limit) || maxOutputBytes !== void 0) {
|
|
9223
9712
|
return readTextRange({
|
|
9224
9713
|
path: filePath,
|
|
@@ -9250,10 +9739,10 @@ async function readFileWithLineAndLimit(params) {
|
|
|
9250
9739
|
};
|
|
9251
9740
|
}
|
|
9252
9741
|
__name(readFileWithLineAndLimit, "readFileWithLineAndLimit");
|
|
9253
|
-
async function detectFileEncoding(
|
|
9254
|
-
let
|
|
9742
|
+
async function detectFileEncoding(source) {
|
|
9743
|
+
let opened = null;
|
|
9255
9744
|
try {
|
|
9256
|
-
fh = await
|
|
9745
|
+
const fh = typeof source === "string" ? opened = await fs3.promises.open(source, "r") : source;
|
|
9257
9746
|
const stats = await fh.stat();
|
|
9258
9747
|
if (stats.size === 0) return "utf-8";
|
|
9259
9748
|
const sampleSize = Math.min(8192, stats.size);
|
|
@@ -9262,22 +9751,7 @@ async function detectFileEncoding(filePath) {
|
|
|
9262
9751
|
if (bytesRead === 0) return "utf-8";
|
|
9263
9752
|
const sample = buf.subarray(0, bytesRead);
|
|
9264
9753
|
const bom = detectBOM(sample);
|
|
9265
|
-
if (bom)
|
|
9266
|
-
switch (bom.encoding) {
|
|
9267
|
-
case "utf8":
|
|
9268
|
-
return "utf-8";
|
|
9269
|
-
case "utf16le":
|
|
9270
|
-
return "utf-16le";
|
|
9271
|
-
case "utf16be":
|
|
9272
|
-
return "utf-16be";
|
|
9273
|
-
case "utf32le":
|
|
9274
|
-
return "utf-32le";
|
|
9275
|
-
case "utf32be":
|
|
9276
|
-
return "utf-32be";
|
|
9277
|
-
default:
|
|
9278
|
-
return "utf-8";
|
|
9279
|
-
}
|
|
9280
|
-
}
|
|
9754
|
+
if (bom) return bomEncodingToName(bom.encoding);
|
|
9281
9755
|
if (isValidUtf8(sample)) return "utf-8";
|
|
9282
9756
|
const detected = detectEncodingFromBuffer(sample);
|
|
9283
9757
|
if (detected && !isUtf8CompatibleEncoding(detected)) {
|
|
@@ -9287,9 +9761,9 @@ async function detectFileEncoding(filePath) {
|
|
|
9287
9761
|
} catch {
|
|
9288
9762
|
return "utf-8";
|
|
9289
9763
|
} finally {
|
|
9290
|
-
if (
|
|
9764
|
+
if (opened) {
|
|
9291
9765
|
try {
|
|
9292
|
-
await
|
|
9766
|
+
await opened.close();
|
|
9293
9767
|
} catch {
|
|
9294
9768
|
}
|
|
9295
9769
|
}
|
|
@@ -9311,7 +9785,7 @@ __name(isWithinRoot, "isWithinRoot");
|
|
|
9311
9785
|
async function isBinaryFile(filePath) {
|
|
9312
9786
|
let fh = null;
|
|
9313
9787
|
try {
|
|
9314
|
-
fh = await
|
|
9788
|
+
fh = await fs3.promises.open(filePath, "r");
|
|
9315
9789
|
const stats = await fh.stat();
|
|
9316
9790
|
const fileSize = stats.size;
|
|
9317
9791
|
if (fileSize === 0) return false;
|
|
@@ -9604,7 +10078,7 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9604
10078
|
signal?.throwIfAborted();
|
|
9605
10079
|
let stats;
|
|
9606
10080
|
try {
|
|
9607
|
-
stats = await
|
|
10081
|
+
stats = await fs3.promises.stat(filePath);
|
|
9608
10082
|
} catch (error) {
|
|
9609
10083
|
if (isNodeError(error) && error.code === "ENOENT") {
|
|
9610
10084
|
return {
|
|
@@ -9633,6 +10107,8 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9633
10107
|
};
|
|
9634
10108
|
}
|
|
9635
10109
|
const fileType = await detectFileType(filePath);
|
|
10110
|
+
const mediaMimeType = index_lite_default.getType(filePath) ?? MIME_LITE_MISSING_VIDEO_TYPES.get(path2.extname(filePath).toLowerCase()) ?? "application/octet-stream";
|
|
10111
|
+
const shouldRenderImageOverview = fileType === "image" && CANONICAL_IMAGE_MIME_TYPES.has(mediaMimeType);
|
|
9636
10112
|
const relativePathForDisplay = path2.relative(rootDirectory, filePath).replace(/\\/g, "/");
|
|
9637
10113
|
const displayName = path2.basename(filePath);
|
|
9638
10114
|
const modalities = config.getContentGeneratorConfig?.()?.modalities ?? {};
|
|
@@ -9717,7 +10193,15 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9717
10193
|
};
|
|
9718
10194
|
}
|
|
9719
10195
|
}
|
|
9720
|
-
if (
|
|
10196
|
+
if (shouldRenderImageOverview && stats.size > IMAGE_MAX_SOURCE_BYTES) {
|
|
10197
|
+
return {
|
|
10198
|
+
llmContent: "Image file exceeds the 100 MB source limit.",
|
|
10199
|
+
returnDisplay: "Image file exceeds the 100 MB source limit.",
|
|
10200
|
+
error: `Image file exceeds the 100 MB source limit: ${filePath}`,
|
|
10201
|
+
errorType: "file_too_large" /* FILE_TOO_LARGE */
|
|
10202
|
+
};
|
|
10203
|
+
}
|
|
10204
|
+
if (fileSizeInMB > 9.9 && !willExtractPdfText && fileType !== "text" && !shouldRenderImageOverview) {
|
|
9721
10205
|
return {
|
|
9722
10206
|
llmContent: "File size exceeds the 10MB limit.",
|
|
9723
10207
|
returnDisplay: "File size exceeds the 10MB limit.",
|
|
@@ -9849,10 +10333,70 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9849
10333
|
stats
|
|
9850
10334
|
};
|
|
9851
10335
|
}
|
|
9852
|
-
case "image":
|
|
10336
|
+
case "image": {
|
|
10337
|
+
if (shouldRenderImageOverview) {
|
|
10338
|
+
try {
|
|
10339
|
+
const view = await renderImageOverview(
|
|
10340
|
+
filePath,
|
|
10341
|
+
signal ?? new AbortController().signal
|
|
10342
|
+
);
|
|
10343
|
+
return {
|
|
10344
|
+
llmContent: [
|
|
10345
|
+
{
|
|
10346
|
+
text: `Image overview: ${view.outputWidth}x${view.outputHeight}; oriented source: ${view.sourceWidth}x${view.sourceHeight}. If details are too small, use tool_search for "zoom image", then call zoom_image with coordinates normalized from 0 to 1000.`
|
|
10347
|
+
},
|
|
10348
|
+
{
|
|
10349
|
+
inlineData: {
|
|
10350
|
+
data: view.bytes.toString("base64"),
|
|
10351
|
+
mimeType: view.mimeType,
|
|
10352
|
+
displayName
|
|
10353
|
+
}
|
|
10354
|
+
}
|
|
10355
|
+
],
|
|
10356
|
+
returnDisplay: `Read image file: ${relativePathForDisplay}`
|
|
10357
|
+
};
|
|
10358
|
+
} catch (error) {
|
|
10359
|
+
signal?.throwIfAborted();
|
|
10360
|
+
if (error instanceof ImageViewError) {
|
|
10361
|
+
if (error.code === "source_too_large" || error.code === "output_too_large") {
|
|
10362
|
+
const userMessage = error.message.replace(`: ${filePath}`, "");
|
|
10363
|
+
return {
|
|
10364
|
+
llmContent: userMessage,
|
|
10365
|
+
returnDisplay: userMessage,
|
|
10366
|
+
error: error.message,
|
|
10367
|
+
errorType: "file_too_large" /* FILE_TOO_LARGE */
|
|
10368
|
+
};
|
|
10369
|
+
}
|
|
10370
|
+
} else {
|
|
10371
|
+
throw error;
|
|
10372
|
+
}
|
|
10373
|
+
}
|
|
10374
|
+
}
|
|
10375
|
+
const contentBuffer = await fs3.promises.readFile(filePath);
|
|
10376
|
+
const base64Data = contentBuffer.toString("base64");
|
|
10377
|
+
const base64SizeInMB = base64Data.length / (1024 * 1024);
|
|
10378
|
+
if (base64SizeInMB > 9.9) {
|
|
10379
|
+
return {
|
|
10380
|
+
llmContent: `File exceeds the 10MB data URI limit after base64 encoding (${base64SizeInMB.toFixed(2)}MB encoded).`,
|
|
10381
|
+
returnDisplay: `File exceeds the 10MB data URI limit after base64 encoding.`,
|
|
10382
|
+
error: `File exceeds the 10MB data URI limit after base64 encoding: ${filePath} (${base64SizeInMB.toFixed(2)}MB encoded)`,
|
|
10383
|
+
errorType: "file_too_large" /* FILE_TOO_LARGE */
|
|
10384
|
+
};
|
|
10385
|
+
}
|
|
10386
|
+
return {
|
|
10387
|
+
llmContent: {
|
|
10388
|
+
inlineData: {
|
|
10389
|
+
data: base64Data,
|
|
10390
|
+
mimeType: mediaMimeType,
|
|
10391
|
+
displayName
|
|
10392
|
+
}
|
|
10393
|
+
},
|
|
10394
|
+
returnDisplay: `Read image file: ${relativePathForDisplay}`
|
|
10395
|
+
};
|
|
10396
|
+
}
|
|
9853
10397
|
case "audio":
|
|
9854
10398
|
case "video": {
|
|
9855
|
-
const contentBuffer = await
|
|
10399
|
+
const contentBuffer = await fs3.promises.readFile(filePath);
|
|
9856
10400
|
const base64Data = contentBuffer.toString("base64");
|
|
9857
10401
|
const base64SizeInMB = base64Data.length / (1024 * 1024);
|
|
9858
10402
|
if (base64SizeInMB > 9.9) {
|
|
@@ -9867,9 +10411,7 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9867
10411
|
llmContent: {
|
|
9868
10412
|
inlineData: {
|
|
9869
10413
|
data: base64Data,
|
|
9870
|
-
mimeType:
|
|
9871
|
-
path2.extname(filePath).toLowerCase()
|
|
9872
|
-
) ?? "application/octet-stream",
|
|
10414
|
+
mimeType: mediaMimeType,
|
|
9873
10415
|
displayName
|
|
9874
10416
|
}
|
|
9875
10417
|
},
|
|
@@ -9878,7 +10420,7 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9878
10420
|
}
|
|
9879
10421
|
case "pdf": {
|
|
9880
10422
|
if (!pageRange && modalities.pdf) {
|
|
9881
|
-
const contentBuffer = await
|
|
10423
|
+
const contentBuffer = await fs3.promises.readFile(filePath);
|
|
9882
10424
|
const base64Data = contentBuffer.toString("base64");
|
|
9883
10425
|
const base64SizeInMB = base64Data.length / (1024 * 1024);
|
|
9884
10426
|
if (base64SizeInMB > 9.9) {
|
|
@@ -10145,7 +10687,7 @@ function normalizeRangeReadByteLimit(maxOutputBytes) {
|
|
|
10145
10687
|
__name(normalizeRangeReadByteLimit, "normalizeRangeReadByteLimit");
|
|
10146
10688
|
async function fileExists(filePath) {
|
|
10147
10689
|
try {
|
|
10148
|
-
await fsPromises.access(filePath,
|
|
10690
|
+
await fsPromises.access(filePath, fs3.constants.F_OK);
|
|
10149
10691
|
return true;
|
|
10150
10692
|
} catch (_) {
|
|
10151
10693
|
return false;
|
|
@@ -10290,7 +10832,7 @@ var import_https_proxy_agent = __toESM(require_dist(), 1);
|
|
|
10290
10832
|
import { Buffer as Buffer2 } from "buffer";
|
|
10291
10833
|
import * as https from "https";
|
|
10292
10834
|
import * as os2 from "node:os";
|
|
10293
|
-
import
|
|
10835
|
+
import fs4 from "node:fs";
|
|
10294
10836
|
import path4 from "node:path";
|
|
10295
10837
|
|
|
10296
10838
|
// packages/core/src/telemetry/sanitize.ts
|
|
@@ -10495,8 +11037,8 @@ var QwenLogger = class _QwenLogger {
|
|
|
10495
11037
|
const legacyPath = path4.join(os2.homedir(), ".qwen", "source.json");
|
|
10496
11038
|
const candidates = path4.normalize(sourceJsonPath) !== path4.normalize(legacyPath) ? [sourceJsonPath, legacyPath] : [sourceJsonPath];
|
|
10497
11039
|
for (const candidate of candidates) {
|
|
10498
|
-
if (
|
|
10499
|
-
const sourceJsonContent =
|
|
11040
|
+
if (fs4.existsSync(candidate)) {
|
|
11041
|
+
const sourceJsonContent = fs4.readFileSync(candidate, "utf8");
|
|
10500
11042
|
const sourceData = JSON.parse(sourceJsonContent);
|
|
10501
11043
|
if (sourceData && typeof sourceData === "object" && sourceData.source && sourceData.source !== "unknown") {
|
|
10502
11044
|
return sourceData.source;
|
|
@@ -10969,6 +11511,24 @@ var QwenLogger = class _QwenLogger {
|
|
|
10969
11511
|
this.enqueueLogEvent(rumEvent);
|
|
10970
11512
|
this.flushIfNeeded();
|
|
10971
11513
|
}
|
|
11514
|
+
logRipgrepRuntimeRecoveryEvent(event) {
|
|
11515
|
+
const rumEvent = this.createActionEvent(
|
|
11516
|
+
"misc",
|
|
11517
|
+
"ripgrep_runtime_recovery",
|
|
11518
|
+
{
|
|
11519
|
+
properties: {
|
|
11520
|
+
platform: process.platform,
|
|
11521
|
+
arch: process.arch,
|
|
11522
|
+
selection_mode: event.selection_mode,
|
|
11523
|
+
retry_triggered: event.retry_triggered,
|
|
11524
|
+
...event.retry_succeeded !== void 0 ? { retry_succeeded: event.retry_succeeded } : {},
|
|
11525
|
+
failure_kind: event.failure_kind
|
|
11526
|
+
}
|
|
11527
|
+
}
|
|
11528
|
+
);
|
|
11529
|
+
this.enqueueLogEvent(rumEvent);
|
|
11530
|
+
this.flushIfNeeded();
|
|
11531
|
+
}
|
|
10972
11532
|
logLoopDetectionDisabledEvent() {
|
|
10973
11533
|
const rumEvent = this.createActionEvent(
|
|
10974
11534
|
"misc",
|
|
@@ -11232,6 +11792,12 @@ var createInitialSkillMetrics = /* @__PURE__ */ __name(() => ({
|
|
|
11232
11792
|
totalFail: 0,
|
|
11233
11793
|
byName: {}
|
|
11234
11794
|
}), "createInitialSkillMetrics");
|
|
11795
|
+
var createInitialGenerationMetrics = /* @__PURE__ */ __name(() => ({
|
|
11796
|
+
timedRequests: 0,
|
|
11797
|
+
totalTtftMs: 0,
|
|
11798
|
+
totalGenerationDurationMs: 0,
|
|
11799
|
+
totalThroughputOutputTokens: 0
|
|
11800
|
+
}), "createInitialGenerationMetrics");
|
|
11235
11801
|
var createInitialMetrics = /* @__PURE__ */ __name(() => ({
|
|
11236
11802
|
models: {},
|
|
11237
11803
|
tools: {
|
|
@@ -11376,6 +11942,23 @@ var UiTelemetryService = class _UiTelemetryService extends EventEmitter {
|
|
|
11376
11942
|
bucket.tokens.cached += event.cached_content_token_count;
|
|
11377
11943
|
bucket.tokens.thoughts += event.thoughts_token_count;
|
|
11378
11944
|
}
|
|
11945
|
+
if (event.ttft_ms === void 0 || !Number.isFinite(event.ttft_ms) || event.ttft_ms < 0 || isInternalPromptId(event.prompt_id)) {
|
|
11946
|
+
return;
|
|
11947
|
+
}
|
|
11948
|
+
const generation = metrics.generation ?? (metrics.generation = createInitialGenerationMetrics());
|
|
11949
|
+
const generationDurationMs = Math.max(0, event.duration_ms - event.ttft_ms);
|
|
11950
|
+
generation.timedRequests++;
|
|
11951
|
+
generation.totalTtftMs += event.ttft_ms;
|
|
11952
|
+
if (generationDurationMs > 0) {
|
|
11953
|
+
generation.totalGenerationDurationMs += generationDurationMs;
|
|
11954
|
+
generation.totalThroughputOutputTokens += event.output_token_count;
|
|
11955
|
+
}
|
|
11956
|
+
generation.last = {
|
|
11957
|
+
model: event.model,
|
|
11958
|
+
ttftMs: event.ttft_ms,
|
|
11959
|
+
generationDurationMs,
|
|
11960
|
+
outputTokens: event.output_token_count
|
|
11961
|
+
};
|
|
11379
11962
|
}
|
|
11380
11963
|
#accumulateApiError(metrics, event) {
|
|
11381
11964
|
const modelMetrics = this.#getOrCreateModelMetrics(metrics, event.model);
|
|
@@ -11525,7 +12108,7 @@ import { randomUUID } from "node:crypto";
|
|
|
11525
12108
|
|
|
11526
12109
|
// packages/core/src/utils/jsonl-utils.ts
|
|
11527
12110
|
init_esbuild_shims();
|
|
11528
|
-
import
|
|
12111
|
+
import fs5 from "node:fs";
|
|
11529
12112
|
import path5 from "node:path";
|
|
11530
12113
|
import readline from "node:readline";
|
|
11531
12114
|
import { finished } from "node:stream/promises";
|
|
@@ -11617,7 +12200,7 @@ async function readLines(filePath, count) {
|
|
|
11617
12200
|
let fileStream;
|
|
11618
12201
|
let rl;
|
|
11619
12202
|
try {
|
|
11620
|
-
fileStream =
|
|
12203
|
+
fileStream = fs5.createReadStream(filePath);
|
|
11621
12204
|
rl = readline.createInterface({
|
|
11622
12205
|
input: fileStream,
|
|
11623
12206
|
crlfDelay: Infinity
|
|
@@ -11650,7 +12233,7 @@ async function read(filePath, options = {}) {
|
|
|
11650
12233
|
let fileStream;
|
|
11651
12234
|
let rl;
|
|
11652
12235
|
try {
|
|
11653
|
-
fileStream =
|
|
12236
|
+
fileStream = fs5.createReadStream(filePath);
|
|
11654
12237
|
rl = readline.createInterface({
|
|
11655
12238
|
input: fileStream,
|
|
11656
12239
|
crlfDelay: Infinity
|
|
@@ -11678,10 +12261,6 @@ async function read(filePath, options = {}) {
|
|
|
11678
12261
|
}
|
|
11679
12262
|
__name(read, "read");
|
|
11680
12263
|
var ensuredDirs = /* @__PURE__ */ new Set();
|
|
11681
|
-
function _resetEnsuredDirsCacheForTest() {
|
|
11682
|
-
ensuredDirs.clear();
|
|
11683
|
-
}
|
|
11684
|
-
__name(_resetEnsuredDirsCacheForTest, "_resetEnsuredDirsCacheForTest");
|
|
11685
12264
|
async function writeLine(filePath, data) {
|
|
11686
12265
|
const lock = getFileLock(filePath);
|
|
11687
12266
|
await lock.runExclusive(async () => {
|
|
@@ -11689,10 +12268,10 @@ async function writeLine(filePath, data) {
|
|
|
11689
12268
|
`;
|
|
11690
12269
|
const dir = path5.dirname(filePath);
|
|
11691
12270
|
if (!ensuredDirs.has(dir)) {
|
|
11692
|
-
await
|
|
12271
|
+
await fs5.promises.mkdir(dir, { recursive: true });
|
|
11693
12272
|
ensuredDirs.add(dir);
|
|
11694
12273
|
}
|
|
11695
|
-
await
|
|
12274
|
+
await fs5.promises.appendFile(filePath, Buffer.from(line, "utf8"), {
|
|
11696
12275
|
flush: true
|
|
11697
12276
|
});
|
|
11698
12277
|
});
|
|
@@ -11702,51 +12281,15 @@ function writeLineSync(filePath, data) {
|
|
|
11702
12281
|
const line = `${JSON.stringify(data)}
|
|
11703
12282
|
`;
|
|
11704
12283
|
const dir = path5.dirname(filePath);
|
|
11705
|
-
if (!
|
|
11706
|
-
|
|
12284
|
+
if (!fs5.existsSync(dir)) {
|
|
12285
|
+
fs5.mkdirSync(dir, { recursive: true });
|
|
11707
12286
|
}
|
|
11708
|
-
|
|
12287
|
+
fs5.appendFileSync(filePath, Buffer.from(line, "utf8"), { flush: true });
|
|
11709
12288
|
}
|
|
11710
12289
|
__name(writeLineSync, "writeLineSync");
|
|
11711
|
-
function write(filePath, data) {
|
|
11712
|
-
const lines = data.map((item) => `${JSON.stringify(item)}
|
|
11713
|
-
`).join("");
|
|
11714
|
-
const dir = path5.dirname(filePath);
|
|
11715
|
-
if (!fs4.existsSync(dir)) {
|
|
11716
|
-
fs4.mkdirSync(dir, { recursive: true });
|
|
11717
|
-
}
|
|
11718
|
-
atomicWriteFileSync(filePath, lines, { encoding: "utf8" });
|
|
11719
|
-
}
|
|
11720
|
-
__name(write, "write");
|
|
11721
|
-
async function countLines(filePath) {
|
|
11722
|
-
let fileStream;
|
|
11723
|
-
let rl;
|
|
11724
|
-
try {
|
|
11725
|
-
fileStream = fs4.createReadStream(filePath);
|
|
11726
|
-
rl = readline.createInterface({
|
|
11727
|
-
input: fileStream,
|
|
11728
|
-
crlfDelay: Infinity
|
|
11729
|
-
});
|
|
11730
|
-
let count = 0;
|
|
11731
|
-
for await (const line of rl) {
|
|
11732
|
-
if (line.trim().length > 0) {
|
|
11733
|
-
count++;
|
|
11734
|
-
}
|
|
11735
|
-
}
|
|
11736
|
-
return count;
|
|
11737
|
-
} catch (error) {
|
|
11738
|
-
if (error.code !== "ENOENT") {
|
|
11739
|
-
debugLogger3.error(`Error counting lines in ${filePath}:`, error);
|
|
11740
|
-
}
|
|
11741
|
-
return 0;
|
|
11742
|
-
} finally {
|
|
11743
|
-
await closeLineReader(rl, fileStream);
|
|
11744
|
-
}
|
|
11745
|
-
}
|
|
11746
|
-
__name(countLines, "countLines");
|
|
11747
12290
|
function exists(filePath) {
|
|
11748
12291
|
try {
|
|
11749
|
-
const stats =
|
|
12292
|
+
const stats = fs5.statSync(filePath);
|
|
11750
12293
|
return stats.isFile() && stats.size > 0;
|
|
11751
12294
|
} catch {
|
|
11752
12295
|
return false;
|
|
@@ -11997,11 +12540,6 @@ function summarizeRecords(period, value, records) {
|
|
|
11997
12540
|
};
|
|
11998
12541
|
}
|
|
11999
12542
|
__name(summarizeRecords, "summarizeRecords");
|
|
12000
|
-
async function recordTokenUsageFromApiResponse(config, event) {
|
|
12001
|
-
const record = apiResponseEventToTokenUsageRecord(config, event);
|
|
12002
|
-
await writeLine(getTokenUsageFilePath(record.localMonth), record);
|
|
12003
|
-
}
|
|
12004
|
-
__name(recordTokenUsageFromApiResponse, "recordTokenUsageFromApiResponse");
|
|
12005
12543
|
var lastLoggedTimeByCode = /* @__PURE__ */ new Map();
|
|
12006
12544
|
var suppressedCountByCode = /* @__PURE__ */ new Map();
|
|
12007
12545
|
var TOKEN_USAGE_FAILURE_LOG_COOLDOWN_MS = 6e4;
|
|
@@ -12137,12 +12675,6 @@ function formatTokenUsageSummaryAsJson(summary) {
|
|
|
12137
12675
|
`;
|
|
12138
12676
|
}
|
|
12139
12677
|
__name(formatTokenUsageSummaryAsJson, "formatTokenUsageSummaryAsJson");
|
|
12140
|
-
async function exportTokenUsageSummary(options) {
|
|
12141
|
-
const summary = await queryTokenUsage(options);
|
|
12142
|
-
return options.format === "json" ? formatTokenUsageSummaryAsJson(summary) : `${formatTokenUsageSummaryAsCsv(summary)}
|
|
12143
|
-
`;
|
|
12144
|
-
}
|
|
12145
|
-
__name(exportTokenUsageSummary, "exportTokenUsageSummary");
|
|
12146
12678
|
|
|
12147
12679
|
// packages/core/src/utils/chat-recording-suppression-context.ts
|
|
12148
12680
|
init_esbuild_shims();
|
|
@@ -12359,40 +12891,40 @@ function logApiRequest(config, event) {
|
|
|
12359
12891
|
logger.emit(logRecord);
|
|
12360
12892
|
}
|
|
12361
12893
|
__name(logApiRequest, "logApiRequest");
|
|
12362
|
-
function
|
|
12363
|
-
QwenLogger.getInstance(config)?.
|
|
12894
|
+
function logRipgrepFallback(config, event) {
|
|
12895
|
+
QwenLogger.getInstance(config)?.logRipgrepFallbackEvent(event);
|
|
12364
12896
|
if (!isTelemetrySdkInitialized()) return;
|
|
12365
12897
|
const attributes = {
|
|
12366
12898
|
...getCommonAttributes(config),
|
|
12367
12899
|
...event,
|
|
12368
|
-
"event.name":
|
|
12900
|
+
"event.name": EVENT_RIPGREP_FALLBACK,
|
|
12369
12901
|
"event.timestamp": (/* @__PURE__ */ new Date()).toISOString()
|
|
12370
12902
|
};
|
|
12371
12903
|
const logger = import_api_logs.logs.getLogger(SERVICE_NAME);
|
|
12372
12904
|
const logRecord = {
|
|
12373
|
-
body: `Switching to
|
|
12905
|
+
body: `Switching to grep as fallback.`,
|
|
12374
12906
|
attributes
|
|
12375
12907
|
};
|
|
12376
12908
|
logger.emit(logRecord);
|
|
12377
12909
|
}
|
|
12378
|
-
__name(
|
|
12379
|
-
function
|
|
12380
|
-
QwenLogger.getInstance(config)?.
|
|
12910
|
+
__name(logRipgrepFallback, "logRipgrepFallback");
|
|
12911
|
+
function logRipgrepRuntimeRecovery(config, event) {
|
|
12912
|
+
QwenLogger.getInstance(config)?.logRipgrepRuntimeRecoveryEvent(event);
|
|
12381
12913
|
if (!isTelemetrySdkInitialized()) return;
|
|
12382
12914
|
const attributes = {
|
|
12383
12915
|
...getCommonAttributes(config),
|
|
12384
12916
|
...event,
|
|
12385
|
-
"event.name":
|
|
12917
|
+
"event.name": EVENT_RIPGREP_RUNTIME_RECOVERY,
|
|
12386
12918
|
"event.timestamp": (/* @__PURE__ */ new Date()).toISOString()
|
|
12387
12919
|
};
|
|
12388
12920
|
const logger = import_api_logs.logs.getLogger(SERVICE_NAME);
|
|
12389
12921
|
const logRecord = {
|
|
12390
|
-
body: `
|
|
12922
|
+
body: `Ripgrep runtime recovery: ${event.failure_kind}.`,
|
|
12391
12923
|
attributes
|
|
12392
12924
|
};
|
|
12393
12925
|
logger.emit(logRecord);
|
|
12394
12926
|
}
|
|
12395
|
-
__name(
|
|
12927
|
+
__name(logRipgrepRuntimeRecovery, "logRipgrepRuntimeRecovery");
|
|
12396
12928
|
function logApiError(config, event) {
|
|
12397
12929
|
const uiEvent = {
|
|
12398
12930
|
...event,
|
|
@@ -13185,7 +13717,7 @@ init_esbuild_shims();
|
|
|
13185
13717
|
|
|
13186
13718
|
// packages/core/src/utils/truncation.ts
|
|
13187
13719
|
init_esbuild_shims();
|
|
13188
|
-
import * as
|
|
13720
|
+
import * as fs6 from "node:fs/promises";
|
|
13189
13721
|
import * as path7 from "node:path";
|
|
13190
13722
|
import * as crypto from "node:crypto";
|
|
13191
13723
|
var debugLogger5 = createDebugLogger("TRUNCATION");
|
|
@@ -13217,22 +13749,26 @@ async function truncateAndSaveToFile(content, fileName, projectTempDir, threshol
|
|
|
13217
13749
|
const separator = "\n\n---\n... [CONTENT TRUNCATED] ...\n---\n\n";
|
|
13218
13750
|
const ellipsis = "...";
|
|
13219
13751
|
const previewBudget = Math.max(0, previewChars);
|
|
13220
|
-
const
|
|
13752
|
+
const sep = previewBudget > separator.length ? separator : "";
|
|
13753
|
+
const contentBudget = previewBudget - sep.length;
|
|
13754
|
+
const headBudget = keep === "head" ? contentBudget : keep === "tail" ? 0 : Math.floor(contentBudget / 5);
|
|
13221
13755
|
const beginning = [];
|
|
13222
13756
|
let headChars = 0;
|
|
13223
13757
|
for (let i = 0; i < Math.min(headCount, lines.length); i++) {
|
|
13224
13758
|
const remaining = headBudget - headChars;
|
|
13225
13759
|
if (remaining <= 0) break;
|
|
13226
13760
|
if (lines[i].length + 1 > remaining) {
|
|
13227
|
-
|
|
13228
|
-
|
|
13761
|
+
if (remaining >= ellipsis.length) {
|
|
13762
|
+
const sliceLen = remaining - ellipsis.length;
|
|
13763
|
+
beginning.push(lines[i].slice(0, sliceLen) + ellipsis);
|
|
13764
|
+
}
|
|
13229
13765
|
headChars = headBudget;
|
|
13230
13766
|
break;
|
|
13231
13767
|
}
|
|
13232
13768
|
beginning.push(lines[i]);
|
|
13233
13769
|
headChars += lines[i].length + 1;
|
|
13234
13770
|
}
|
|
13235
|
-
const tailBudget = keep === "head" ? 0 : Math.max(
|
|
13771
|
+
const tailBudget = keep === "head" ? 0 : Math.max(contentBudget - headChars, 0);
|
|
13236
13772
|
const end = [];
|
|
13237
13773
|
let tailChars = 0;
|
|
13238
13774
|
const tailStart = Math.max(lines.length - tailCount, beginning.length);
|
|
@@ -13240,15 +13776,17 @@ async function truncateAndSaveToFile(content, fileName, projectTempDir, threshol
|
|
|
13240
13776
|
const remaining = tailBudget - tailChars;
|
|
13241
13777
|
if (remaining <= 0) break;
|
|
13242
13778
|
if (lines[i].length + 1 > remaining) {
|
|
13243
|
-
|
|
13244
|
-
|
|
13779
|
+
if (remaining >= ellipsis.length) {
|
|
13780
|
+
const sliceLen = remaining - ellipsis.length;
|
|
13781
|
+
end.unshift(ellipsis + (sliceLen > 0 ? lines[i].slice(-sliceLen) : ""));
|
|
13782
|
+
}
|
|
13245
13783
|
tailChars = tailBudget;
|
|
13246
13784
|
break;
|
|
13247
13785
|
}
|
|
13248
13786
|
end.unshift(lines[i]);
|
|
13249
13787
|
tailChars += lines[i].length + 1;
|
|
13250
13788
|
}
|
|
13251
|
-
const truncatedContent = keep === "head" ? beginning.join("\n") +
|
|
13789
|
+
const truncatedContent = keep === "head" ? beginning.join("\n") + sep : keep === "tail" ? sep + end.join("\n") : beginning.join("\n") + sep + end.join("\n");
|
|
13252
13790
|
const safeFileName = `${path7.basename(fileName)}.output`;
|
|
13253
13791
|
const outputFile = path7.join(projectTempDir, safeFileName);
|
|
13254
13792
|
const wrappedMessage = `${TOOL_OUTPUT_TRUNCATED_PREFIX}.
|
|
@@ -13262,8 +13800,8 @@ ${truncatedContent}`;
|
|
|
13262
13800
|
return { content };
|
|
13263
13801
|
}
|
|
13264
13802
|
try {
|
|
13265
|
-
await
|
|
13266
|
-
await
|
|
13803
|
+
await fs6.mkdir(projectTempDir, { recursive: true });
|
|
13804
|
+
await fs6.writeFile(outputFile, content, { mode: 384 });
|
|
13267
13805
|
return {
|
|
13268
13806
|
content: wrappedMessage,
|
|
13269
13807
|
outputFile
|
|
@@ -13413,7 +13951,7 @@ async function persistAndTruncateToolResult(callId, toolName, content, config) {
|
|
|
13413
13951
|
try {
|
|
13414
13952
|
const toolResultsDir = config.storage.getToolResultsDir();
|
|
13415
13953
|
const outputFile = path7.join(toolResultsDir, `${safeCallId}.txt`);
|
|
13416
|
-
await
|
|
13954
|
+
await fs6.mkdir(toolResultsDir, { recursive: true });
|
|
13417
13955
|
await atomicWriteFile(outputFile, content, {
|
|
13418
13956
|
mode: 384,
|
|
13419
13957
|
forceMode: true,
|
|
@@ -13478,12 +14016,6 @@ __name(buildStub, "buildStub");
|
|
|
13478
14016
|
|
|
13479
14017
|
// packages/core/src/tools/mcp-status.ts
|
|
13480
14018
|
init_esbuild_shims();
|
|
13481
|
-
var MCPServerStatus = /* @__PURE__ */ ((MCPServerStatus2) => {
|
|
13482
|
-
MCPServerStatus2["DISCONNECTED"] = "disconnected";
|
|
13483
|
-
MCPServerStatus2["CONNECTING"] = "connecting";
|
|
13484
|
-
MCPServerStatus2["CONNECTED"] = "connected";
|
|
13485
|
-
return MCPServerStatus2;
|
|
13486
|
-
})(MCPServerStatus || {});
|
|
13487
14019
|
var serverStatuses = /* @__PURE__ */ new Map();
|
|
13488
14020
|
var statusChangeListeners = [];
|
|
13489
14021
|
function addMCPStatusChangeListener(listener) {
|
|
@@ -13575,6 +14107,75 @@ function getInvocationContext() {
|
|
|
13575
14107
|
}
|
|
13576
14108
|
__name(getInvocationContext, "getInvocationContext");
|
|
13577
14109
|
|
|
14110
|
+
// packages/core/src/services/visionBridge/image-part-utils.ts
|
|
14111
|
+
init_esbuild_shims();
|
|
14112
|
+
function normalizeParts(input) {
|
|
14113
|
+
if (typeof input === "string") {
|
|
14114
|
+
return [{ text: input }];
|
|
14115
|
+
}
|
|
14116
|
+
if (Array.isArray(input)) {
|
|
14117
|
+
return input.map(
|
|
14118
|
+
(part) => typeof part === "string" ? { text: part } : part
|
|
14119
|
+
);
|
|
14120
|
+
}
|
|
14121
|
+
return [input];
|
|
14122
|
+
}
|
|
14123
|
+
__name(normalizeParts, "normalizeParts");
|
|
14124
|
+
function isImagePart(part) {
|
|
14125
|
+
const mimeType = part.inlineData?.mimeType;
|
|
14126
|
+
const data = part.inlineData?.data;
|
|
14127
|
+
return typeof mimeType === "string" && mimeType.startsWith("image/") && typeof data === "string" && data.length > 0;
|
|
14128
|
+
}
|
|
14129
|
+
__name(isImagePart, "isImagePart");
|
|
14130
|
+
function hasImageParts(input) {
|
|
14131
|
+
return normalizeParts(input).some(isImagePart);
|
|
14132
|
+
}
|
|
14133
|
+
__name(hasImageParts, "hasImageParts");
|
|
14134
|
+
function splitImageParts(input) {
|
|
14135
|
+
const imageParts = [];
|
|
14136
|
+
const nonImageParts = [];
|
|
14137
|
+
for (const part of normalizeParts(input)) {
|
|
14138
|
+
if (isImagePart(part)) {
|
|
14139
|
+
imageParts.push(part);
|
|
14140
|
+
} else {
|
|
14141
|
+
nonImageParts.push(part);
|
|
14142
|
+
}
|
|
14143
|
+
}
|
|
14144
|
+
return { imageParts, nonImageParts };
|
|
14145
|
+
}
|
|
14146
|
+
__name(splitImageParts, "splitImageParts");
|
|
14147
|
+
function replaceImagesWithText(input, text) {
|
|
14148
|
+
const result = [];
|
|
14149
|
+
let replaced = false;
|
|
14150
|
+
for (const part of normalizeParts(input)) {
|
|
14151
|
+
if (isImagePart(part)) {
|
|
14152
|
+
if (!replaced) {
|
|
14153
|
+
result.push({ text });
|
|
14154
|
+
replaced = true;
|
|
14155
|
+
}
|
|
14156
|
+
continue;
|
|
14157
|
+
}
|
|
14158
|
+
result.push(part);
|
|
14159
|
+
}
|
|
14160
|
+
if (!replaced) {
|
|
14161
|
+
result.push({ text });
|
|
14162
|
+
}
|
|
14163
|
+
return result;
|
|
14164
|
+
}
|
|
14165
|
+
__name(replaceImagesWithText, "replaceImagesWithText");
|
|
14166
|
+
function isUsableImagePart(part) {
|
|
14167
|
+
const data = part.inlineData?.data;
|
|
14168
|
+
if (typeof data !== "string" || data.length === 0) {
|
|
14169
|
+
return false;
|
|
14170
|
+
}
|
|
14171
|
+
return data.length <= VISION_BRIDGE_MAX_IMAGE_BASE64_BYTES;
|
|
14172
|
+
}
|
|
14173
|
+
__name(isUsableImagePart, "isUsableImagePart");
|
|
14174
|
+
function collectText(parts) {
|
|
14175
|
+
return parts.map((part) => typeof part.text === "string" ? part.text : "").filter((text) => text.length > 0).join("\n").trim();
|
|
14176
|
+
}
|
|
14177
|
+
__name(collectText, "collectText");
|
|
14178
|
+
|
|
13578
14179
|
// packages/core/src/tools/mcp-tool.ts
|
|
13579
14180
|
var debugLogger6 = createDebugLogger("MCP_TOOL");
|
|
13580
14181
|
var MCP_CONNECTION_ERROR_PATTERNS = [
|
|
@@ -13796,18 +14397,10 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
|
|
|
13796
14397
|
callToolResult
|
|
13797
14398
|
);
|
|
13798
14399
|
if (this.isMCPToolError(rawResponseParts)) {
|
|
13799
|
-
|
|
14400
|
+
return await this.buildMcpToolError(rawResponseParts, {
|
|
13800
14401
|
name: this.serverToolName,
|
|
13801
14402
|
args: this.params
|
|
13802
|
-
})
|
|
13803
|
-
return {
|
|
13804
|
-
llmContent: errorMessage,
|
|
13805
|
-
returnDisplay: `Error: MCP tool '${this.serverToolName}' reported an error.`,
|
|
13806
|
-
error: {
|
|
13807
|
-
message: errorMessage,
|
|
13808
|
-
type: "mcp_tool_error" /* MCP_TOOL_ERROR */
|
|
13809
|
-
}
|
|
13810
|
-
};
|
|
14403
|
+
});
|
|
13811
14404
|
}
|
|
13812
14405
|
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
13813
14406
|
const truncated = await this.truncateTextParts(transformedParts);
|
|
@@ -13865,17 +14458,7 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
|
|
|
13865
14458
|
});
|
|
13866
14459
|
});
|
|
13867
14460
|
if (this.isMCPToolError(rawResponseParts)) {
|
|
13868
|
-
|
|
13869
|
-
functionCalls[0]
|
|
13870
|
-
)} with response: ${safeJsonStringify(rawResponseParts)}`;
|
|
13871
|
-
return {
|
|
13872
|
-
llmContent: errorMessage,
|
|
13873
|
-
returnDisplay: `Error: MCP tool '${this.serverToolName}' reported an error.`,
|
|
13874
|
-
error: {
|
|
13875
|
-
message: errorMessage,
|
|
13876
|
-
type: "mcp_tool_error" /* MCP_TOOL_ERROR */
|
|
13877
|
-
}
|
|
13878
|
-
};
|
|
14461
|
+
return await this.buildMcpToolError(rawResponseParts, functionCalls[0]);
|
|
13879
14462
|
}
|
|
13880
14463
|
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
13881
14464
|
const truncated = await this.truncateTextParts(transformedParts);
|
|
@@ -13891,6 +14474,34 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
|
|
|
13891
14474
|
return this.handleReconnectOnError(error, signal);
|
|
13892
14475
|
}
|
|
13893
14476
|
}
|
|
14477
|
+
async buildMcpToolError(rawResponseParts, functionCall) {
|
|
14478
|
+
const imageContent = getMcpErrorImageContent(rawResponseParts);
|
|
14479
|
+
let llmContent;
|
|
14480
|
+
let errorMessage;
|
|
14481
|
+
let persistedOutputFiles;
|
|
14482
|
+
if (imageContent) {
|
|
14483
|
+
const truncatedContent = await this.truncateTextParts(imageContent);
|
|
14484
|
+
llmContent = truncatedContent.parts;
|
|
14485
|
+
persistedOutputFiles = truncatedContent.persistedOutputFiles;
|
|
14486
|
+
errorMessage = `MCP tool '${this.serverToolName}' reported tool error for function call: ${safeJsonStringify(
|
|
14487
|
+
functionCall
|
|
14488
|
+
)} with response: ${getDisplayFromParts(truncatedContent.parts)}`;
|
|
14489
|
+
} else {
|
|
14490
|
+
errorMessage = `MCP tool '${this.serverToolName}' reported tool error for function call: ${safeJsonStringify(
|
|
14491
|
+
functionCall
|
|
14492
|
+
)} with response: ${safeJsonStringify(rawResponseParts)}`;
|
|
14493
|
+
llmContent = errorMessage;
|
|
14494
|
+
}
|
|
14495
|
+
return {
|
|
14496
|
+
llmContent,
|
|
14497
|
+
returnDisplay: `Error: MCP tool '${this.serverToolName}' reported an error.`,
|
|
14498
|
+
error: {
|
|
14499
|
+
message: errorMessage,
|
|
14500
|
+
type: "mcp_tool_error" /* MCP_TOOL_ERROR */
|
|
14501
|
+
},
|
|
14502
|
+
...persistedOutputFiles !== void 0 ? { persistedOutputFiles } : {}
|
|
14503
|
+
};
|
|
14504
|
+
}
|
|
13894
14505
|
/**
|
|
13895
14506
|
* Truncates text parts in the transformed result if they exceed the
|
|
13896
14507
|
* configured threshold. Non-text parts (images, audio, etc.) are preserved.
|
|
@@ -14145,6 +14756,11 @@ function transformMcpContentToParts(sdkResponse) {
|
|
|
14145
14756
|
return transformed.filter((part) => part !== null);
|
|
14146
14757
|
}
|
|
14147
14758
|
__name(transformMcpContentToParts, "transformMcpContentToParts");
|
|
14759
|
+
function getMcpErrorImageContent(rawResponseParts) {
|
|
14760
|
+
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
14761
|
+
return transformedParts.some(isImagePart) ? transformedParts : void 0;
|
|
14762
|
+
}
|
|
14763
|
+
__name(getMcpErrorImageContent, "getMcpErrorImageContent");
|
|
14148
14764
|
function getDisplayFromParts(parts) {
|
|
14149
14765
|
if (parts.length === 0) {
|
|
14150
14766
|
return "";
|
|
@@ -14245,19 +14861,6 @@ var StartSessionEvent = class {
|
|
|
14245
14861
|
}
|
|
14246
14862
|
}
|
|
14247
14863
|
};
|
|
14248
|
-
var EndSessionEvent = class {
|
|
14249
|
-
static {
|
|
14250
|
-
__name(this, "EndSessionEvent");
|
|
14251
|
-
}
|
|
14252
|
-
"event.name";
|
|
14253
|
-
"event.timestamp";
|
|
14254
|
-
session_id;
|
|
14255
|
-
constructor(config) {
|
|
14256
|
-
this["event.name"] = "end_session";
|
|
14257
|
-
this["event.timestamp"] = (/* @__PURE__ */ new Date()).toISOString();
|
|
14258
|
-
this.session_id = config?.getSessionId();
|
|
14259
|
-
}
|
|
14260
|
-
};
|
|
14261
14864
|
var UserPromptEvent = class {
|
|
14262
14865
|
static {
|
|
14263
14866
|
__name(this, "UserPromptEvent");
|
|
@@ -14454,12 +15057,14 @@ var ApiResponseEvent = class {
|
|
|
14454
15057
|
response_text;
|
|
14455
15058
|
prompt_id;
|
|
14456
15059
|
auth_type;
|
|
15060
|
+
/** Time from stream dispatch to first user-visible content. */
|
|
15061
|
+
ttft_ms;
|
|
14457
15062
|
/**
|
|
14458
15063
|
* Name of the subagent that issued this request, or undefined when the
|
|
14459
15064
|
* request originates from the main conversation.
|
|
14460
15065
|
*/
|
|
14461
15066
|
subagent_name;
|
|
14462
|
-
constructor(response_id, model, duration_ms, prompt_id, auth_type, usage_data, response_text, subagent_name) {
|
|
15067
|
+
constructor(response_id, model, duration_ms, prompt_id, auth_type, usage_data, response_text, subagent_name, ttft_ms) {
|
|
14463
15068
|
this["event.name"] = "api_response";
|
|
14464
15069
|
this["event.timestamp"] = (/* @__PURE__ */ new Date()).toISOString();
|
|
14465
15070
|
this.response_id = response_id;
|
|
@@ -14475,19 +15080,7 @@ var ApiResponseEvent = class {
|
|
|
14475
15080
|
this.prompt_id = prompt_id;
|
|
14476
15081
|
this.auth_type = auth_type;
|
|
14477
15082
|
this.subagent_name = subagent_name;
|
|
14478
|
-
|
|
14479
|
-
};
|
|
14480
|
-
var FlashFallbackEvent = class {
|
|
14481
|
-
static {
|
|
14482
|
-
__name(this, "FlashFallbackEvent");
|
|
14483
|
-
}
|
|
14484
|
-
"event.name";
|
|
14485
|
-
"event.timestamp";
|
|
14486
|
-
auth_type;
|
|
14487
|
-
constructor(auth_type) {
|
|
14488
|
-
this["event.name"] = "flash_fallback";
|
|
14489
|
-
this["event.timestamp"] = (/* @__PURE__ */ new Date()).toISOString();
|
|
14490
|
-
this.auth_type = auth_type;
|
|
15083
|
+
this.ttft_ms = ttft_ms;
|
|
14491
15084
|
}
|
|
14492
15085
|
};
|
|
14493
15086
|
var RipgrepFallbackEvent = class {
|
|
@@ -14507,19 +15100,27 @@ var RipgrepFallbackEvent = class {
|
|
|
14507
15100
|
this.error = error;
|
|
14508
15101
|
}
|
|
14509
15102
|
};
|
|
14510
|
-
var
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
15103
|
+
var RipgrepRuntimeRecoveryEvent = class {
|
|
15104
|
+
static {
|
|
15105
|
+
__name(this, "RipgrepRuntimeRecoveryEvent");
|
|
15106
|
+
}
|
|
15107
|
+
"event.name";
|
|
15108
|
+
"event.timestamp";
|
|
15109
|
+
selection_mode;
|
|
15110
|
+
retry_triggered;
|
|
15111
|
+
retry_succeeded;
|
|
15112
|
+
failure_kind;
|
|
15113
|
+
constructor(params) {
|
|
15114
|
+
this["event.name"] = "ripgrep_runtime_recovery";
|
|
15115
|
+
this["event.timestamp"] = (/* @__PURE__ */ new Date()).toISOString();
|
|
15116
|
+
this.selection_mode = params.selection_mode;
|
|
15117
|
+
this.retry_triggered = params.retry_triggered;
|
|
15118
|
+
if (params.retry_succeeded !== void 0) {
|
|
15119
|
+
this.retry_succeeded = params.retry_succeeded;
|
|
15120
|
+
}
|
|
15121
|
+
this.failure_kind = params.failure_kind;
|
|
15122
|
+
}
|
|
15123
|
+
};
|
|
14523
15124
|
var LoopDetectedEvent = class {
|
|
14524
15125
|
static {
|
|
14525
15126
|
__name(this, "LoopDetectedEvent");
|
|
@@ -14579,11 +15180,6 @@ function makeSlashCommandEvent({
|
|
|
14579
15180
|
};
|
|
14580
15181
|
}
|
|
14581
15182
|
__name(makeSlashCommandEvent, "makeSlashCommandEvent");
|
|
14582
|
-
var SlashCommandStatus = /* @__PURE__ */ ((SlashCommandStatus2) => {
|
|
14583
|
-
SlashCommandStatus2["SUCCESS"] = "success";
|
|
14584
|
-
SlashCommandStatus2["ERROR"] = "error";
|
|
14585
|
-
return SlashCommandStatus2;
|
|
14586
|
-
})(SlashCommandStatus || {});
|
|
14587
15183
|
function makeChatCompressionEvent({
|
|
14588
15184
|
tokens_before,
|
|
14589
15185
|
tokens_after,
|
|
@@ -14600,11 +15196,6 @@ function makeChatCompressionEvent({
|
|
|
14600
15196
|
};
|
|
14601
15197
|
}
|
|
14602
15198
|
__name(makeChatCompressionEvent, "makeChatCompressionEvent");
|
|
14603
|
-
var IdeConnectionType = /* @__PURE__ */ ((IdeConnectionType2) => {
|
|
14604
|
-
IdeConnectionType2["START"] = "start";
|
|
14605
|
-
IdeConnectionType2["SESSION"] = "session";
|
|
14606
|
-
return IdeConnectionType2;
|
|
14607
|
-
})(IdeConnectionType || {});
|
|
14608
15199
|
var IdeConnectionEvent = class {
|
|
14609
15200
|
static {
|
|
14610
15201
|
__name(this, "IdeConnectionEvent");
|
|
@@ -14976,12 +15567,6 @@ var SkillLaunchEvent = class {
|
|
|
14976
15567
|
this.prompt_id = prompt_id;
|
|
14977
15568
|
}
|
|
14978
15569
|
};
|
|
14979
|
-
var UserFeedbackRating = /* @__PURE__ */ ((UserFeedbackRating2) => {
|
|
14980
|
-
UserFeedbackRating2[UserFeedbackRating2["BAD"] = 1] = "BAD";
|
|
14981
|
-
UserFeedbackRating2[UserFeedbackRating2["FINE"] = 2] = "FINE";
|
|
14982
|
-
UserFeedbackRating2[UserFeedbackRating2["GOOD"] = 3] = "GOOD";
|
|
14983
|
-
return UserFeedbackRating2;
|
|
14984
|
-
})(UserFeedbackRating || {});
|
|
14985
15570
|
var UserFeedbackEvent = class {
|
|
14986
15571
|
static {
|
|
14987
15572
|
__name(this, "UserFeedbackEvent");
|
|
@@ -15302,6 +15887,38 @@ function memoryFreshnessNote(mtimeMs) {
|
|
|
15302
15887
|
}
|
|
15303
15888
|
__name(memoryFreshnessNote, "memoryFreshnessNote");
|
|
15304
15889
|
|
|
15890
|
+
// packages/core/src/tools/file-read-permission.ts
|
|
15891
|
+
init_esbuild_shims();
|
|
15892
|
+
import path8 from "node:path";
|
|
15893
|
+
function getFileReadDefaultPermission(config, requestedPath) {
|
|
15894
|
+
const filePath = path8.resolve(requestedPath);
|
|
15895
|
+
const workspaceContext = config.getWorkspaceContext();
|
|
15896
|
+
const allowedRoots = [
|
|
15897
|
+
config.storage.getProjectTempDir(),
|
|
15898
|
+
// Background subagent transcripts live under <projectDir>/subagents/ and
|
|
15899
|
+
// are advertised to the model as polling targets via read_file.
|
|
15900
|
+
path8.join(config.storage.getProjectDir(), "subagents"),
|
|
15901
|
+
Storage.getGlobalTempDir(),
|
|
15902
|
+
...config.storage.getUserSkillsDirs(),
|
|
15903
|
+
Storage.getUserExtensionsDir(),
|
|
15904
|
+
// Approved plans are persisted here (default ~/.qwen/plans, outside
|
|
15905
|
+
// the workspace) and after approval nothing re-injects the plan text,
|
|
15906
|
+
// so the saved file is the model's only recovery route — reading it
|
|
15907
|
+
// back must not stall on a confirmation prompt. The dir holds only
|
|
15908
|
+
// session plan files, never credentials or settings.
|
|
15909
|
+
config.getPlansDir()
|
|
15910
|
+
];
|
|
15911
|
+
if (workspaceContext.isPathWithinWorkspace(filePath) || isSubpaths(allowedRoots, filePath) || // isAnyAutoMemPath narrows to the managed auto-memory roots
|
|
15912
|
+
// (per-project + user-level under ~/.qwen/memories/) — never the
|
|
15913
|
+
// broad getMemoryBaseDir() — to avoid exposing sensitive ~/.qwen
|
|
15914
|
+
// files such as settings.json or OAuth credentials.
|
|
15915
|
+
isAnyAutoMemPath(filePath, config.getTargetDir())) {
|
|
15916
|
+
return "allow";
|
|
15917
|
+
}
|
|
15918
|
+
return "ask";
|
|
15919
|
+
}
|
|
15920
|
+
__name(getFileReadDefaultPermission, "getFileReadDefaultPermission");
|
|
15921
|
+
|
|
15305
15922
|
// packages/core/src/services/visionBridge/vision-bridge-service.ts
|
|
15306
15923
|
init_esbuild_shims();
|
|
15307
15924
|
|
|
@@ -15503,77 +16120,9 @@ async function runSideQuery(config, options) {
|
|
|
15503
16120
|
}
|
|
15504
16121
|
__name(runSideQuery, "runSideQuery");
|
|
15505
16122
|
|
|
15506
|
-
// packages/core/src/services/visionBridge/image-part-utils.ts
|
|
15507
|
-
init_esbuild_shims();
|
|
15508
|
-
function normalizeParts(input) {
|
|
15509
|
-
if (typeof input === "string") {
|
|
15510
|
-
return [{ text: input }];
|
|
15511
|
-
}
|
|
15512
|
-
if (Array.isArray(input)) {
|
|
15513
|
-
return input.map(
|
|
15514
|
-
(part) => typeof part === "string" ? { text: part } : part
|
|
15515
|
-
);
|
|
15516
|
-
}
|
|
15517
|
-
return [input];
|
|
15518
|
-
}
|
|
15519
|
-
__name(normalizeParts, "normalizeParts");
|
|
15520
|
-
function isImagePart(part) {
|
|
15521
|
-
const mimeType = part.inlineData?.mimeType;
|
|
15522
|
-
const data = part.inlineData?.data;
|
|
15523
|
-
return typeof mimeType === "string" && mimeType.startsWith("image/") && typeof data === "string" && data.length > 0;
|
|
15524
|
-
}
|
|
15525
|
-
__name(isImagePart, "isImagePart");
|
|
15526
|
-
function hasImageParts(input) {
|
|
15527
|
-
return normalizeParts(input).some(isImagePart);
|
|
15528
|
-
}
|
|
15529
|
-
__name(hasImageParts, "hasImageParts");
|
|
15530
|
-
function splitImageParts(input) {
|
|
15531
|
-
const imageParts = [];
|
|
15532
|
-
const nonImageParts = [];
|
|
15533
|
-
for (const part of normalizeParts(input)) {
|
|
15534
|
-
if (isImagePart(part)) {
|
|
15535
|
-
imageParts.push(part);
|
|
15536
|
-
} else {
|
|
15537
|
-
nonImageParts.push(part);
|
|
15538
|
-
}
|
|
15539
|
-
}
|
|
15540
|
-
return { imageParts, nonImageParts };
|
|
15541
|
-
}
|
|
15542
|
-
__name(splitImageParts, "splitImageParts");
|
|
15543
|
-
function replaceImagesWithText(input, text) {
|
|
15544
|
-
const result = [];
|
|
15545
|
-
let replaced = false;
|
|
15546
|
-
for (const part of normalizeParts(input)) {
|
|
15547
|
-
if (isImagePart(part)) {
|
|
15548
|
-
if (!replaced) {
|
|
15549
|
-
result.push({ text });
|
|
15550
|
-
replaced = true;
|
|
15551
|
-
}
|
|
15552
|
-
continue;
|
|
15553
|
-
}
|
|
15554
|
-
result.push(part);
|
|
15555
|
-
}
|
|
15556
|
-
if (!replaced) {
|
|
15557
|
-
result.push({ text });
|
|
15558
|
-
}
|
|
15559
|
-
return result;
|
|
15560
|
-
}
|
|
15561
|
-
__name(replaceImagesWithText, "replaceImagesWithText");
|
|
15562
|
-
function isUsableImagePart(part) {
|
|
15563
|
-
const data = part.inlineData?.data;
|
|
15564
|
-
if (typeof data !== "string" || data.length === 0) {
|
|
15565
|
-
return false;
|
|
15566
|
-
}
|
|
15567
|
-
return data.length <= VISION_BRIDGE_MAX_IMAGE_BASE64_BYTES;
|
|
15568
|
-
}
|
|
15569
|
-
__name(isUsableImagePart, "isUsableImagePart");
|
|
15570
|
-
function collectText(parts) {
|
|
15571
|
-
return parts.map((part) => typeof part.text === "string" ? part.text : "").filter((text) => text.length > 0).join("\n").trim();
|
|
15572
|
-
}
|
|
15573
|
-
__name(collectText, "collectText");
|
|
15574
|
-
|
|
15575
16123
|
// packages/core/src/services/visionBridge/vision-bridge-service.ts
|
|
15576
16124
|
var debugLogger7 = createDebugLogger("VISION_BRIDGE");
|
|
16125
|
+
var turnImageCounts = /* @__PURE__ */ new WeakMap();
|
|
15577
16126
|
var BRIDGE_MAX_OUTPUT_TOKENS = 2048;
|
|
15578
16127
|
var VISION_BRIDGE_TIMEOUT_MS = 3e4;
|
|
15579
16128
|
var VISION_BRIDGE_MAX_ATTEMPTS = 2;
|
|
@@ -15730,8 +16279,10 @@ function formatFullTurnVisionNotice(selection) {
|
|
|
15730
16279
|
return `Routing this image turn to ${target}; retries and tool continuations will stay on that model until the turn ends.`;
|
|
15731
16280
|
}
|
|
15732
16281
|
__name(formatFullTurnVisionNotice, "formatFullTurnVisionNotice");
|
|
15733
|
-
function buildIntentPart(intentText, sourceContext) {
|
|
15734
|
-
const sourceHint = sourceContext ? `The images are consecutive pages ${sourceContext.renderedRange.firstPage}-${sourceContext.renderedRange.lastPage} from PDF ${JSON.stringify(sourceContext.displayName)}. Transcribe each page separately and label each section with its original PDF page number.` :
|
|
16282
|
+
function buildIntentPart(intentText, sourceContext, imageParts = []) {
|
|
16283
|
+
const sourceHint = sourceContext ? `The images are consecutive pages ${sourceContext.renderedRange.firstPage}-${sourceContext.renderedRange.lastPage} from PDF ${JSON.stringify(sourceContext.displayName)}. Transcribe each page separately and label each section with its original PDF page number.` : imageParts.length > 0 ? `Describe each image separately under these ordered labels: ${imageParts.map(
|
|
16284
|
+
(part, index) => `${index + 1}. ${JSON.stringify(part.inlineData?.displayName?.trim() || `image ${index + 1}`)}`
|
|
16285
|
+
).join("; ")}.` : "";
|
|
15735
16286
|
const focusHint = intentText.length > 0 ? `Focus hint \u2014 do NOT answer this, use it only to decide which details to transcribe thoroughly: ${intentText}` : "Describe the image(s) and transcribe any visible text, code, and errors.";
|
|
15736
16287
|
return sourceHint ? `${sourceHint}
|
|
15737
16288
|
${focusHint}` : focusHint;
|
|
@@ -15779,7 +16330,7 @@ function failure(reason, parts, omittedCount, extra = {}) {
|
|
|
15779
16330
|
}
|
|
15780
16331
|
__name(failure, "failure");
|
|
15781
16332
|
async function runVisionBridge(params) {
|
|
15782
|
-
const { config, parts, signal, sourceContext } = params;
|
|
16333
|
+
const { config, parts, signal, sourceContext, intentText } = params;
|
|
15783
16334
|
const { imageParts, nonImageParts } = splitImageParts(parts);
|
|
15784
16335
|
if (imageParts.length === 0) {
|
|
15785
16336
|
return {
|
|
@@ -15790,9 +16341,14 @@ async function runVisionBridge(params) {
|
|
|
15790
16341
|
};
|
|
15791
16342
|
}
|
|
15792
16343
|
const validImages = imageParts.filter(isUsableImagePart);
|
|
15793
|
-
const
|
|
16344
|
+
const usedImages = turnImageCounts.get(signal) ?? 0;
|
|
16345
|
+
const remainingImages = Math.max(0, VISION_BRIDGE_MAX_IMAGES - usedImages);
|
|
16346
|
+
const toConvert = validImages.slice(0, remainingImages);
|
|
15794
16347
|
const omittedCount = imageParts.length - toConvert.length;
|
|
15795
|
-
const intent = collectText(nonImageParts).slice(
|
|
16348
|
+
const intent = (intentText ?? collectText(nonImageParts)).slice(
|
|
16349
|
+
0,
|
|
16350
|
+
BRIDGE_INTENT_MAX_CHARS
|
|
16351
|
+
);
|
|
15796
16352
|
const resolvedSourceContext = sourceContext ?? inferPdfSourceContext(toConvert);
|
|
15797
16353
|
const selection = config.getDefaultVisionBridgeModel?.();
|
|
15798
16354
|
const modelId = selection?.id;
|
|
@@ -15814,13 +16370,14 @@ async function runVisionBridge(params) {
|
|
|
15814
16370
|
{ modelId, ...modelEndpoint && { modelEndpoint } }
|
|
15815
16371
|
);
|
|
15816
16372
|
}
|
|
16373
|
+
turnImageCounts.set(signal, usedImages + toConvert.length);
|
|
15817
16374
|
const timeoutMs = config.getVisionBridgeTimeoutMs?.() ?? VISION_BRIDGE_TIMEOUT_MS;
|
|
15818
16375
|
const requestContents = [
|
|
15819
16376
|
{
|
|
15820
16377
|
role: "user",
|
|
15821
16378
|
parts: [
|
|
15822
16379
|
...toConvert,
|
|
15823
|
-
{ text: buildIntentPart(intent, resolvedSourceContext) }
|
|
16380
|
+
{ text: buildIntentPart(intent, resolvedSourceContext, toConvert) }
|
|
15824
16381
|
]
|
|
15825
16382
|
}
|
|
15826
16383
|
];
|
|
@@ -15955,29 +16512,13 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
15955
16512
|
* Returns 'ask' for paths outside the workspace/temp/userSkills directories,
|
|
15956
16513
|
* so that external file reads require user confirmation.
|
|
15957
16514
|
*/
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
this.config.storage.getProjectTempDir(),
|
|
15963
|
-
// Background subagent transcripts live under <projectDir>/subagents/ and
|
|
15964
|
-
// are advertised to the model as polling targets via read_file.
|
|
15965
|
-
path8.join(this.config.storage.getProjectDir(), "subagents"),
|
|
15966
|
-
Storage.getGlobalTempDir(),
|
|
15967
|
-
...this.config.storage.getUserSkillsDirs(),
|
|
15968
|
-
Storage.getUserExtensionsDir()
|
|
15969
|
-
];
|
|
15970
|
-
if (workspaceContext.isPathWithinWorkspace(filePath) || isSubpaths(allowedRoots, filePath) || // isAnyAutoMemPath narrows to the managed auto-memory roots
|
|
15971
|
-
// (per-project + user-level under ~/.qwen/memories/) — never the
|
|
15972
|
-
// broad getMemoryBaseDir() — to avoid exposing sensitive ~/.qwen
|
|
15973
|
-
// files such as settings.json or OAuth credentials.
|
|
15974
|
-
isAnyAutoMemPath(filePath, this.config.getTargetDir())) {
|
|
15975
|
-
return "allow";
|
|
15976
|
-
}
|
|
15977
|
-
return "ask";
|
|
16515
|
+
getDefaultPermission() {
|
|
16516
|
+
return Promise.resolve(
|
|
16517
|
+
getFileReadDefaultPermission(this.config, this.params.file_path)
|
|
16518
|
+
);
|
|
15978
16519
|
}
|
|
15979
16520
|
async execute(signal) {
|
|
15980
|
-
const absPath =
|
|
16521
|
+
const absPath = path9.resolve(this.params.file_path);
|
|
15981
16522
|
const projectRoot = this.config.getTargetDir();
|
|
15982
16523
|
const isAutoMem = isAnyAutoMemPath(absPath, projectRoot);
|
|
15983
16524
|
const cacheEnabled = !this.config.getFileReadCacheDisabled();
|
|
@@ -15986,7 +16527,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
15986
16527
|
const isFullRead = this.params.offset === void 0 && this.params.limit === void 0 && this.params.pages === void 0;
|
|
15987
16528
|
let stats;
|
|
15988
16529
|
try {
|
|
15989
|
-
stats = await
|
|
16530
|
+
stats = await fs7.stat(absPath);
|
|
15990
16531
|
} catch (err) {
|
|
15991
16532
|
debugLogger8.debug("stat-failed", {
|
|
15992
16533
|
path: absPath,
|
|
@@ -16003,7 +16544,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
16003
16544
|
}
|
|
16004
16545
|
debugLogger8.debug("miss", { path: absPath, state: status.state });
|
|
16005
16546
|
}
|
|
16006
|
-
const
|
|
16547
|
+
const prepareForVisionBridge = shouldRunVisionBridge(this.config);
|
|
16007
16548
|
let result = await processSingleFileContent(
|
|
16008
16549
|
this.params.file_path,
|
|
16009
16550
|
this.config,
|
|
@@ -16011,7 +16552,8 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
16011
16552
|
offset: this.params.offset,
|
|
16012
16553
|
limit: this.params.limit,
|
|
16013
16554
|
pages: this.params.pages,
|
|
16014
|
-
|
|
16555
|
+
preserveUnsupportedImage: prepareForVisionBridge,
|
|
16556
|
+
preparePdfForVisionBridge: prepareForVisionBridge,
|
|
16015
16557
|
signal
|
|
16016
16558
|
}
|
|
16017
16559
|
);
|
|
@@ -16051,7 +16593,7 @@ ${result.llmContent}`;
|
|
|
16051
16593
|
}
|
|
16052
16594
|
if (typeof llmContent === "string" && isAutoMem) {
|
|
16053
16595
|
try {
|
|
16054
|
-
const memStat = stats ?? await
|
|
16596
|
+
const memStat = stats ?? await fs7.stat(absPath);
|
|
16055
16597
|
const note = memoryFreshnessNote(memStat.mtimeMs);
|
|
16056
16598
|
if (note) {
|
|
16057
16599
|
llmContent = note + llmContent;
|
|
@@ -16071,7 +16613,7 @@ ${result.llmContent}`;
|
|
|
16071
16613
|
"read" /* READ */,
|
|
16072
16614
|
lines,
|
|
16073
16615
|
mimetype,
|
|
16074
|
-
|
|
16616
|
+
path9.extname(this.params.file_path),
|
|
16075
16617
|
programming_language
|
|
16076
16618
|
)
|
|
16077
16619
|
);
|
|
@@ -16274,7 +16816,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
|
|
|
16274
16816
|
if (!filePath) {
|
|
16275
16817
|
return "The 'file_path' parameter must be non-empty.";
|
|
16276
16818
|
}
|
|
16277
|
-
if (!
|
|
16819
|
+
if (!path9.isAbsolute(filePath)) {
|
|
16278
16820
|
return `File path must be absolute, but was relative: ${filePath}. You must provide an absolute path.`;
|
|
16279
16821
|
}
|
|
16280
16822
|
if (params.offset !== void 0 && (!Number.isInteger(params.offset) || params.offset < 0)) {
|
|
@@ -16287,7 +16829,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
|
|
|
16287
16829
|
const pages = params.pages.trim();
|
|
16288
16830
|
params.pages = pages.length > 0 ? pages : void 0;
|
|
16289
16831
|
}
|
|
16290
|
-
const ext =
|
|
16832
|
+
const ext = path9.extname(filePath).toLowerCase();
|
|
16291
16833
|
if ((params.offset !== void 0 || params.limit !== void 0) && ext === ".ipynb") {
|
|
16292
16834
|
return "offset and limit are not supported for Jupyter notebook (.ipynb) files. Notebooks are always read in full with structured cell output.";
|
|
16293
16835
|
}
|
|
@@ -16327,13 +16869,10 @@ export {
|
|
|
16327
16869
|
isImagePart,
|
|
16328
16870
|
hasImageParts,
|
|
16329
16871
|
splitImageParts,
|
|
16330
|
-
replaceImagesWithText,
|
|
16331
|
-
isUsableImagePart,
|
|
16332
16872
|
collectText,
|
|
16333
16873
|
isImageCapable,
|
|
16334
16874
|
isFullTurnVisionCapable,
|
|
16335
16875
|
getQualifiedVisionModelId,
|
|
16336
|
-
getVisionModelSelector,
|
|
16337
16876
|
getFullTurnVisionModelSelector,
|
|
16338
16877
|
selectVisionBridgeModel,
|
|
16339
16878
|
shouldRunVisionBridge,
|
|
@@ -16344,41 +16883,30 @@ export {
|
|
|
16344
16883
|
runVisionBridge,
|
|
16345
16884
|
MAIN_SOURCE,
|
|
16346
16885
|
subagentNameContext,
|
|
16886
|
+
isInternalPromptId,
|
|
16347
16887
|
UiTelemetryService,
|
|
16348
16888
|
uiTelemetryService,
|
|
16349
|
-
isInternalPromptId,
|
|
16350
|
-
sanitizeHookName,
|
|
16351
16889
|
import_lru_cache,
|
|
16352
|
-
QwenLogger,
|
|
16353
16890
|
apiActivityTracker,
|
|
16354
16891
|
_recoverObjectsFromLine,
|
|
16355
16892
|
parseLineTolerant,
|
|
16356
16893
|
readLines,
|
|
16357
16894
|
read,
|
|
16358
|
-
_resetEnsuredDirsCacheForTest,
|
|
16359
16895
|
writeLine,
|
|
16360
16896
|
writeLineSync,
|
|
16361
|
-
write,
|
|
16362
|
-
countLines,
|
|
16363
16897
|
exists,
|
|
16364
|
-
getTokenUsageFilePath,
|
|
16365
|
-
apiResponseEventToTokenUsageRecord,
|
|
16366
|
-
recordTokenUsageFromApiResponse,
|
|
16367
|
-
recordTokenUsageFromApiResponseBestEffort,
|
|
16368
16898
|
queryTokenUsage,
|
|
16369
16899
|
formatTokenUsageSummaryAsCsv,
|
|
16370
16900
|
formatTokenUsageSummaryAsJson,
|
|
16371
|
-
exportTokenUsageSummary,
|
|
16372
16901
|
runWithChatRecordingSuppressed,
|
|
16373
16902
|
logStartSession,
|
|
16374
16903
|
logUserPrompt,
|
|
16375
16904
|
logUserRetry,
|
|
16376
16905
|
logToolCall,
|
|
16377
|
-
logToolOutputTruncated,
|
|
16378
16906
|
logFileOperation,
|
|
16379
16907
|
logApiRequest,
|
|
16380
|
-
logFlashFallback,
|
|
16381
16908
|
logRipgrepFallback,
|
|
16909
|
+
logRipgrepRuntimeRecovery,
|
|
16382
16910
|
logApiError,
|
|
16383
16911
|
logApiCancel,
|
|
16384
16912
|
logApiResponse,
|
|
@@ -16417,31 +16945,16 @@ export {
|
|
|
16417
16945
|
logMemoryDream,
|
|
16418
16946
|
logMemoryRecall,
|
|
16419
16947
|
logMemoryRecallDelivery,
|
|
16420
|
-
iconvEncode,
|
|
16421
|
-
iconvEncodingExists,
|
|
16422
16948
|
isUtf8CompatibleEncoding,
|
|
16423
|
-
|
|
16424
|
-
AGENT_CONTEXT_FILENAME,
|
|
16949
|
+
loadIconvLite,
|
|
16425
16950
|
LOCAL_CONTEXT_FILENAME,
|
|
16426
16951
|
MEMORY_SECTION_HEADER,
|
|
16427
16952
|
setGeminiMdFilename,
|
|
16428
16953
|
getCurrentGeminiMdFilename,
|
|
16429
16954
|
getAllGeminiMdFilenames,
|
|
16430
|
-
COMMON_IGNORE_PATTERNS,
|
|
16431
|
-
BINARY_FILE_PATTERNS,
|
|
16432
|
-
MEDIA_FILE_PATTERNS,
|
|
16433
|
-
COMMON_DIRECTORY_EXCLUDES,
|
|
16434
|
-
PYTHON_EXCLUDES,
|
|
16435
|
-
SYSTEM_FILE_EXCLUDES,
|
|
16436
|
-
DEFAULT_FILE_EXCLUDES,
|
|
16437
16955
|
FileExclusions,
|
|
16438
|
-
extractExtensionsFromPatterns,
|
|
16439
|
-
BINARY_EXTENSIONS,
|
|
16440
|
-
resetEncodingCache,
|
|
16441
16956
|
getCachedEncodingForBuffer,
|
|
16442
16957
|
getSystemEncoding,
|
|
16443
|
-
windowsCodePageToEncoding,
|
|
16444
|
-
detectEncodingFromBuffer,
|
|
16445
16958
|
extractPDFText,
|
|
16446
16959
|
normalizeSource,
|
|
16447
16960
|
parseNotebook,
|
|
@@ -16456,24 +16969,24 @@ export {
|
|
|
16456
16969
|
inferInsertedCellSourceArrayStyle,
|
|
16457
16970
|
toNotebookSource,
|
|
16458
16971
|
normalizeEditedCell,
|
|
16459
|
-
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
|
|
16972
|
+
CursorNotAtLineBoundaryError,
|
|
16973
|
+
LargeNonUtf8TextError,
|
|
16974
|
+
TextScanBudgetExceededError,
|
|
16975
|
+
readTextRangeFromHandle,
|
|
16976
|
+
readTextCursorWindowFromHandle,
|
|
16977
|
+
ImageViewError,
|
|
16978
|
+
renderNormalizedImageCrop,
|
|
16979
|
+
decodeBufferWithEncodingInfoAsync,
|
|
16465
16980
|
readFileWithLineAndLimit,
|
|
16466
|
-
detectFileEncoding,
|
|
16467
16981
|
getSpecificMimeType,
|
|
16468
16982
|
isWithinRoot,
|
|
16469
|
-
isBinaryFile,
|
|
16470
|
-
detectFileType,
|
|
16471
16983
|
isCacheableReadResult,
|
|
16472
16984
|
processSingleFileContent,
|
|
16473
16985
|
fileExists,
|
|
16474
16986
|
getLanguageFromFilePath,
|
|
16475
16987
|
memoryAge,
|
|
16476
16988
|
memoryFreshnessText,
|
|
16989
|
+
getFileReadDefaultPermission,
|
|
16477
16990
|
ReadFileTool,
|
|
16478
16991
|
MAX_SESSION_BYTES,
|
|
16479
16992
|
TOOL_OUTPUT_TRUNCATED_PREFIX,
|
|
@@ -16482,7 +16995,6 @@ export {
|
|
|
16482
16995
|
isAlreadyTruncated,
|
|
16483
16996
|
normalizeToolResultCallId,
|
|
16484
16997
|
persistAndTruncateToolResult,
|
|
16485
|
-
MCPServerStatus,
|
|
16486
16998
|
addMCPStatusChangeListener,
|
|
16487
16999
|
removeMCPStatusChangeListener,
|
|
16488
17000
|
updateMCPServerStatus,
|
|
@@ -16496,9 +17008,7 @@ export {
|
|
|
16496
17008
|
runWithInvocationContext,
|
|
16497
17009
|
getInvocationContext,
|
|
16498
17010
|
DiscoveredMCPTool,
|
|
16499
|
-
generateValidName,
|
|
16500
17011
|
StartSessionEvent,
|
|
16501
|
-
EndSessionEvent,
|
|
16502
17012
|
UserPromptEvent,
|
|
16503
17013
|
UserRetryEvent,
|
|
16504
17014
|
ToolCallEvent,
|
|
@@ -16506,16 +17016,13 @@ export {
|
|
|
16506
17016
|
ApiErrorEvent,
|
|
16507
17017
|
ApiCancelEvent,
|
|
16508
17018
|
ApiResponseEvent,
|
|
16509
|
-
FlashFallbackEvent,
|
|
16510
17019
|
RipgrepFallbackEvent,
|
|
16511
|
-
|
|
17020
|
+
RipgrepRuntimeRecoveryEvent,
|
|
16512
17021
|
LoopDetectedEvent,
|
|
16513
17022
|
LoopDetectionDisabledEvent,
|
|
16514
17023
|
NextSpeakerCheckEvent,
|
|
16515
17024
|
makeSlashCommandEvent,
|
|
16516
|
-
SlashCommandStatus,
|
|
16517
17025
|
makeChatCompressionEvent,
|
|
16518
|
-
IdeConnectionType,
|
|
16519
17026
|
IdeConnectionEvent,
|
|
16520
17027
|
ConversationFinishedEvent,
|
|
16521
17028
|
KittySequenceOverflowEvent,
|
|
@@ -16525,7 +17032,6 @@ export {
|
|
|
16525
17032
|
ApiRetryEvent,
|
|
16526
17033
|
ContentRetryFailureEvent,
|
|
16527
17034
|
ExtensionInstallEvent,
|
|
16528
|
-
ToolOutputTruncatedEvent,
|
|
16529
17035
|
ExtensionUninstallEvent,
|
|
16530
17036
|
ExtensionUpdateEvent,
|
|
16531
17037
|
ExtensionEnableEvent,
|
|
@@ -16534,7 +17040,6 @@ export {
|
|
|
16534
17040
|
AuthEvent,
|
|
16535
17041
|
HookCallEvent,
|
|
16536
17042
|
SkillLaunchEvent,
|
|
16537
|
-
UserFeedbackRating,
|
|
16538
17043
|
UserFeedbackEvent,
|
|
16539
17044
|
makeArenaSessionStartedEvent,
|
|
16540
17045
|
makeArenaAgentCompletedEvent,
|
|
@@ -16549,6 +17054,11 @@ export {
|
|
|
16549
17054
|
MemoryRecallEvent,
|
|
16550
17055
|
MemoryRecallDeliveryEvent
|
|
16551
17056
|
};
|
|
17057
|
+
/**
|
|
17058
|
+
* @license
|
|
17059
|
+
* Copyright 2026 Qwen Team
|
|
17060
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17061
|
+
*/
|
|
16552
17062
|
/**
|
|
16553
17063
|
* @license
|
|
16554
17064
|
* Copyright 2025 Google LLC
|
|
@@ -16561,7 +17071,7 @@ export {
|
|
|
16561
17071
|
*/
|
|
16562
17072
|
/**
|
|
16563
17073
|
* @license
|
|
16564
|
-
* Copyright 2026 Qwen
|
|
17074
|
+
* Copyright 2026 Qwen
|
|
16565
17075
|
* SPDX-License-Identifier: Apache-2.0
|
|
16566
17076
|
*/
|
|
16567
17077
|
/**
|