@qwen-code/qwen-code 0.21.0 → 0.21.1-nightly.20260730.1643a6c9a
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 +117 -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 +1 -1
- package/bundled/qc-helper/docs/features/hooks.md +70 -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 +20 -0
- 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-H77LGFDG.js +86 -0
- package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-NGKLCYX4.js} +68 -67
- package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-DFVPFQ6C.js} +2 -2
- package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-RUN53PRW.js} +1381 -543
- package/chunks/agent-4CFRD2OG.js +82 -0
- package/chunks/agent-headless-XPUCIZLL.js +76 -0
- package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-V2QOGVYD.js} +79 -27
- package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-6K6U7XYJ.js} +4 -4
- package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-GD2IJJ7I.js} +4 -4
- package/chunks/bridge-B2YJLSLT.js +92 -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-RAPKQK24.js +418 -0
- package/chunks/channel-settings-store-KJQKY6NN.js +89 -0
- package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-7SZ7MR3K.js} +11 -6
- package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-RN5KJYPF.js} +11 -6
- package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-CABBXYHK.js} +7 -5
- package/chunks/{chunk-M5JM7OSF.js → chunk-2DN4J57Y.js} +2 -3
- package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
- package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
- package/chunks/{chunk-EPDRMGT4.js → chunk-2LKVPASC.js} +4 -28
- package/chunks/{chunk-PWTZEM3C.js → chunk-2LQTH543.js} +3 -37
- package/chunks/{chunk-CIKQ7KKO.js → chunk-2Q4CZ3V6.js} +713 -419
- package/chunks/{chunk-HIJQF5B5.js → chunk-3L2SPEBH.js} +1 -1
- package/chunks/{chunk-JXJFVC6E.js → chunk-3QDXECUB.js} +46 -11
- package/chunks/{chunk-PSOO6YXD.js → chunk-3RMX26V7.js} +9 -7
- package/chunks/{chunk-PC6JANNU.js → chunk-4755HD5V.js} +4 -4
- package/chunks/{chunk-GSN55ZRI.js → chunk-4D3MHM5F.js} +19 -7
- package/chunks/{chunk-EBJQ6AXW.js → chunk-4FQ4OKOU.js} +260 -14
- package/chunks/{chunk-BIQWWWJN.js → chunk-4G2BISNC.js} +1 -1
- package/chunks/{chunk-IKYJHJNF.js → chunk-5EHIP3GX.js} +3 -3
- package/chunks/chunk-5IDU2UGL.js +2196 -0
- package/chunks/{chunk-DHHOYAPR.js → chunk-5TBMQLGG.js} +7 -7
- package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
- package/chunks/chunk-5YKDXHUY.js +463 -0
- package/chunks/{chunk-K36B6G2O.js → chunk-5ZEFGTII.js} +5 -5
- package/chunks/{chunk-K4XWPEWB.js → chunk-64LQLPL7.js} +4 -33
- package/chunks/{chunk-TGILQ3YH.js → chunk-6CH6PHMZ.js} +141 -64
- package/chunks/chunk-6FMJLI5M.js +1591 -0
- package/chunks/chunk-6MPDY6ZG.js +76 -0
- package/chunks/{chunk-2NH6DYI4.js → chunk-6OF62NPQ.js} +12 -12
- package/chunks/{chunk-JZA3JUDJ.js → chunk-6QIGFD5W.js} +1 -1
- package/chunks/{chunk-ETSW4KLJ.js → chunk-72E7TSGG.js} +2 -2
- package/chunks/{chunk-OHNBB4XR.js → chunk-75GFAX4R.js} +1 -1
- package/chunks/{chunk-UDX5OBWR.js → chunk-77IMMLN2.js} +94 -4
- package/chunks/{chunk-TEHGS6UP.js → chunk-7A4V5CJY.js} +154 -16
- package/chunks/{chunk-QAF7NMK7.js → chunk-7BV2P4S3.js} +1 -1
- package/chunks/{chunk-RIBKPMRP.js → chunk-7RFNMXPU.js} +19 -6
- package/chunks/{chunk-KMQ33DO4.js → chunk-7UKQW4JU.js} +4 -4
- package/chunks/{chunk-A5L3JMUA.js → chunk-7XATOOE7.js} +18 -4
- package/chunks/{chunk-5I2IWRSH.js → chunk-A3NDJ5SB.js} +2 -2
- package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
- package/chunks/{chunk-TPRQ7RZH.js → chunk-ANND7YTH.js} +2341 -940
- package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
- package/chunks/{chunk-KIM5GUMA.js → chunk-B47WVQ7T.js} +400 -162
- package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
- package/chunks/{chunk-BJX6ZSUK.js → chunk-BCZFQXWK.js} +2 -2
- package/chunks/{chunk-BKHWX6I2.js → chunk-CAEQL6GZ.js} +11 -3
- package/chunks/{chunk-J56UI34H.js → chunk-CI2PGI7Z.js} +4 -2
- package/chunks/{chunk-2SCDWPXI.js → chunk-CUWGNCKW.js} +5 -5
- package/chunks/{chunk-TOFQCPDC.js → chunk-CVHIL5IG.js} +4 -5
- package/chunks/{chunk-VRYUBFMC.js → chunk-CYIBLZBR.js} +1 -1
- package/chunks/{chunk-YBL3QUDD.js → chunk-CYPJYJIX.js} +1 -1
- package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
- package/chunks/{chunk-7MVVZO4N.js → chunk-DGV27C34.js} +4 -4
- package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
- package/chunks/chunk-DZLYR4U3.js +1252 -0
- package/chunks/{chunk-PHOF65IG.js → chunk-EYGWU66Z.js} +41594 -50416
- 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-L26JL52R.js → chunk-FH6SU2OG.js} +48 -61
- package/chunks/{chunk-OKY7HXPG.js → chunk-FNMZK765.js} +2 -2
- package/chunks/chunk-FYJ7W2PI.js +194 -0
- package/chunks/{chunk-BULDBTYC.js → chunk-G7XXKQYS.js} +3 -28
- package/chunks/{chunk-L5UHQJTJ.js → chunk-GATT5TKW.js} +1 -1
- package/chunks/{chunk-MVSUYZDT.js → chunk-GKWLJW7Z.js} +4 -4
- package/chunks/{chunk-VAK25FTU.js → chunk-GKX7E4CO.js} +1 -1
- package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
- package/chunks/{chunk-FSITMZJH.js → chunk-GOXRFPH5.js} +18 -9
- package/chunks/{chunk-3RN6GBKS.js → chunk-HFAV3POZ.js} +1 -1
- package/chunks/{chunk-YX324OPW.js → chunk-HGQIL6NG.js} +1 -1
- package/chunks/{chunk-55DJUCI2.js → chunk-HOSENQJL.js} +53 -43
- package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
- package/chunks/{chunk-YH6G52F2.js → chunk-I3V7RKRZ.js} +4 -4
- package/chunks/{chunk-RF3EXIHJ.js → chunk-IQMYZTDI.js} +30 -19
- package/chunks/{chunk-RWTEFFPU.js → chunk-JCJ7LKNA.js} +6140 -5616
- package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
- package/chunks/{chunk-63P4EL5V.js → chunk-JMONIXMJ.js} +1 -1
- package/chunks/{chunk-OFDOK3VM.js → chunk-JQTW5CA5.js} +8 -13
- package/chunks/chunk-JYBU6YUE.js +378 -0
- package/chunks/chunk-JZQUOT4B.js +81 -0
- package/chunks/{chunk-Q4M4MDQ4.js → chunk-K4GTOFKY.js} +1 -1
- package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
- package/chunks/{chunk-YPE6A4GC.js → chunk-KLESQCW6.js} +2 -2
- package/chunks/{chunk-JVPM2ULZ.js → chunk-KQGB3ME2.js} +6 -6
- package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
- package/chunks/{chunk-RHLZR4E5.js → chunk-LGAOC3ZS.js} +1 -1
- package/chunks/{chunk-LB6DUZ26.js → chunk-LI53FGDL.js} +258 -184
- package/chunks/{chunk-2X55UKQE.js → chunk-LIJID5PD.js} +3 -3
- package/chunks/{chunk-NH6KE4JX.js → chunk-LW3RFMG7.js} +3 -3
- package/chunks/{chunk-MZAXJAUM.js → chunk-LW67T6GH.js} +1 -1
- package/chunks/{chunk-RZIX2G32.js → chunk-M4O2DCE3.js} +1 -1
- package/chunks/{chunk-4WIZGAH3.js → chunk-MFW7APBA.js} +6 -58
- package/chunks/{chunk-VIA5XA4U.js → chunk-MKQOXP2O.js} +3 -1
- package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
- package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
- package/chunks/{chunk-H5FFA6TH.js → chunk-NOKIVHOL.js} +16 -3
- package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
- package/chunks/{chunk-LQIW3YFY.js → chunk-OAOPCTG6.js} +9 -7
- package/chunks/chunk-OCPBI7J5.js +18 -0
- package/chunks/{chunk-WCXCRJYB.js → chunk-OCUM7TJA.js} +1 -1
- package/chunks/{chunk-R5AFZNQW.js → chunk-OIG257JR.js} +14 -7
- package/chunks/{chunk-IKCX4CCL.js → chunk-OINT3ZNV.js} +118 -95
- package/chunks/{chunk-E5TUC6CA.js → chunk-OKF7JF3R.js} +3 -3
- package/chunks/chunk-PEK4ARMZ.js +319 -0
- package/chunks/chunk-PGHTM673.js +363 -0
- package/chunks/{record-artifact-RQKFYO5B.js → chunk-PMGFWLAZ.js} +22 -7
- package/chunks/{chunk-FNQ6T3CV.js → chunk-PONHVBRT.js} +10 -7
- package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
- package/chunks/{chunk-ZFDTEDCF.js → chunk-RF4FA22B.js} +6 -6
- package/chunks/{chunk-6FGBXPWM.js → chunk-RPLGZJV2.js} +38 -44
- package/chunks/{chunk-NIBLUX3Y.js → chunk-RQLRERVY.js} +148 -21
- package/chunks/{chunk-LKEJ26GS.js → chunk-RWZPM2BP.js} +16 -11
- package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
- package/chunks/{chunk-IO3IX5Q4.js → chunk-S7G7Z3MP.js} +1 -1
- package/chunks/{chunk-MUP3T3AD.js → chunk-SGFT55XI.js} +1 -35
- package/chunks/{chunk-PWVFN2LF.js → chunk-SMWPUA2A.js} +1 -1
- package/chunks/{chunk-U7M2DMGW.js → chunk-SWRHIQDT.js} +130 -5
- 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-SQCQ4KO2.js → chunk-TCBP4Q3K.js} +380 -317
- package/chunks/{chunk-ZNAUOR2I.js → chunk-TJHLQ45J.js} +2 -2
- package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
- package/chunks/{chunk-NL7LTRLR.js → chunk-UHUSJ6X7.js} +29 -68
- package/chunks/{chunk-LH2BYDQ5.js → chunk-UJBURGBH.js} +18 -12
- package/chunks/{chunk-ZOIFNCKL.js → chunk-UPUG4GXM.js} +3 -23
- package/chunks/{chunk-FQK6JAFG.js → chunk-URPQ5QZM.js} +4 -4
- package/chunks/{chunk-M4FMGVY4.js → chunk-V47JGII4.js} +3 -3
- package/chunks/{chunk-Y34KJKDC.js → chunk-VBX5IFEN.js} +1 -1
- package/chunks/{chunk-USTWD7QV.js → chunk-W4MIWP6M.js} +26 -16
- package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
- package/chunks/{chunk-J24WCGIN.js → chunk-W7D7QTCH.js} +4 -4
- package/chunks/{chunk-DLWL3Z7A.js → chunk-WBSMNTSV.js} +3 -3
- package/chunks/{chunk-2JZBVYTU.js → chunk-WZRWHXFE.js} +1 -8
- package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
- package/chunks/{chunk-IJTOWOD7.js → chunk-XTLTBZIH.js} +83 -9
- package/chunks/{chunk-H4SBPHSA.js → chunk-XVYRMUI5.js} +3 -3
- package/chunks/{chunk-3QMGYBFN.js → chunk-XWWKIXVD.js} +1 -80
- package/chunks/{chunk-VULLI6WQ.js → chunk-XZB72HUB.js} +6 -6
- package/chunks/{chunk-3SJ43L4W.js → chunk-XZC5VLBZ.js} +2 -0
- package/chunks/{chunk-UUUTRMI2.js → chunk-Y4IHBGBP.js} +1 -1
- package/chunks/{chunk-PR75REBZ.js → chunk-Y6AXW2OG.js} +12 -82
- package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
- package/chunks/{chunk-MB4MZHMJ.js → chunk-YX4DHA6S.js} +211 -522
- package/chunks/chunk-Z4X5MTRT.js +133 -0
- package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
- package/chunks/{chunk-ZD6UTE4A.js → chunk-ZHBO7WVX.js} +1 -1
- package/chunks/{chunk-7JURR4JT.js → chunk-ZM63TFJH.js} +167 -81
- package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
- package/chunks/{chunk-X5XDDSSH.js → chunk-ZPZ7ZJEE.js} +28 -5
- package/chunks/{chunk-ACY3A37B.js → chunk-ZS6Q44DY.js} +23 -18
- package/chunks/{chunk-ZJHVAS7M.js → chunk-ZWUDSQBD.js} +4 -5
- package/chunks/{computer-use-SOQ4E3VX.js → computer-use-HRVGY7OB.js} +50 -49
- package/chunks/{config-utils-7V7GGIW6.js → config-utils-RUFMEUYD.js} +4 -3
- package/chunks/contextCommand-V3N7Q3UM.js +81 -0
- package/chunks/core-runtime-QGEW6WBW.js +135 -0
- package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-SBYUMSSS.js} +3 -3
- package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-ZUWDNFO2.js} +47 -46
- package/chunks/{cron-create-YIID5XAW.js → cron-create-2QK6TCEC.js} +6 -6
- package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-FDCDFYMG.js} +5 -5
- package/chunks/{cron-list-XEGS463Q.js → cron-list-XN3WVBTP.js} +6 -6
- package/chunks/{daemon-YO6433NF.js → daemon-QH2G5B5E.js} +403 -17
- package/chunks/daemon-status-provider-MB54AMNV.js +91 -0
- package/chunks/daemon-trust-policy-3VFDF5LU.js +86 -0
- package/chunks/daemon-trust-policy-monitor-4KX2OK7G.js +173 -0
- package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
- package/chunks/deferred-core-runtime-UIJL6EEU.js +90 -0
- package/chunks/{dist-F6IBUDR4.js → dist-2PERFI23.js} +12 -9
- package/chunks/dist-AOOUOG5S.js +4389 -0
- 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-QBC4ZCV7.js +83 -0
- package/chunks/{edit-OBDSQURM.js → edit-7ABV72VV.js} +48 -47
- package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
- package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-4NOWT6I2.js} +48 -47
- package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-4NOQ6A56.js} +48 -47
- package/chunks/{environment-W5UFC2CH.js → environment-ABMFNOJO.js} +49 -48
- package/chunks/errors-UAX4AR5Q.js +89 -0
- package/chunks/esm-K5FARBNI.js +5548 -0
- package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-CF2O5AQM.js} +48 -47
- package/chunks/exitPlanMode-5KEF5DLM.js +74 -0
- package/chunks/{fast-path-JJZFJANL.js → fast-path-RWZGR7A6.js} +16 -6
- package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
- package/chunks/{gemini-QS36EBZV.js → gemini-A4LXWU5S.js} +103 -98
- package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-VPXAS3BM.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-P6ZPQOPR.js} +48 -47
- package/chunks/goal-tools-H2NHZKGN.js +335 -0
- package/chunks/{grep-QYPSK7OP.js → grep-56M3IJ36.js} +50 -48
- package/chunks/handleAutoUpdate-N3IMC273.js +82 -0
- package/chunks/i18n-UFV5QINW.js +98 -0
- package/chunks/{image-gen-Z3VPGKRC.js → image-gen-GPYAKETO.js} +12 -12
- package/chunks/initializer-OXWZKLEX.js +87 -0
- package/chunks/installationInfo-V2YEC52N.js +81 -0
- package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
- package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-72IYCAZV.js} +3 -3
- package/chunks/lib-RUF3WZA6.js +9 -0
- package/chunks/list-UN6EJ6WB.js +90 -0
- package/chunks/{list-agents-5KJJHR6I.js → list-agents-R6KDXQR3.js} +3 -3
- package/chunks/loadedSettingsAdapter-LZK2PMOY.js +84 -0
- package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-PSFMRX7M.js} +78 -113
- package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-3IQKCYAH.js} +7 -7
- package/chunks/{ls-NTK6VOQJ.js → ls-DKZ37A7N.js} +5 -5
- package/chunks/{lsp-2JI24STP.js → lsp-QNWN7KN3.js} +3 -3
- package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-D2AO3F47.js} +48 -47
- package/chunks/mcp-A2VAOKMH.js +84 -0
- package/chunks/{monitor-R3ODH5U6.js → monitor-7EJ3WBER.js} +48 -47
- package/chunks/nonInteractiveCli-43LIVN4A.js +146 -0
- package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-IQD53ULF.js} +48 -47
- package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-YPCMNGEZ.js} +26 -27
- package/chunks/pidfile-3SOOBWZA.js +87 -0
- package/chunks/process-registry-2CHQBXH5.js +157 -0
- package/chunks/{processUtils-RT7UNCC2.js → processUtils-FGVHFR4V.js} +2 -2
- package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
- package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-M6YW4D6A.js} +53 -52
- package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-XSYKLMNR.js} +10 -10
- package/chunks/read-file-XOMBFIS7.js +29 -0
- package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-GFTWYXMK.js} +4 -4
- package/chunks/record-artifact-JANPGVS4.js +21 -0
- package/chunks/resumeHistoryUtils-E4EVA4PO.js +92 -0
- package/chunks/ripGrep-M4NYA6AM.js +74 -0
- package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
- package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-QLCU2BAZ.js} +953 -248
- package/chunks/{runtime-XXRRTNP6.js → runtime-T36WUYIO.js} +57 -55
- package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-C3J45Z5W.js} +47 -46
- package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
- package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-BFOKQFRD.js} +7 -7
- package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-6CJ3JQZL.js} +14 -14
- package/chunks/{send-message-Q6OOR6BR.js → send-message-RJ2R4PIV.js} +6 -12
- package/chunks/serve-7SWJTL3K.js +90 -0
- package/chunks/{server-4UMH7OIZ.js → server-T2B64F4O.js} +3887 -852
- package/chunks/{session-K3O3Q2SV.js → session-D546I4HT.js} +99 -94
- package/chunks/{settings-CR2EWTBA.js → settings-ZQOOTRR7.js} +51 -50
- package/chunks/shell-5OR4RAKF.js +84 -0
- package/chunks/{skill-I3SDA4MB.js → skill-X4E5JMKV.js} +20 -21
- package/chunks/skill-settings-ZS3XPDMT.js +92 -0
- package/chunks/spawnChannel-MILVKB3G.js +83 -0
- package/chunks/standalone-update-UTYCSPUO.js +93 -0
- package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-S4R5J4EN.js} +1220 -895
- package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-355CB6CJ.js} +4 -4
- package/chunks/{task-create-N7WQSGYA.js → task-create-KUQIS7RA.js} +10 -10
- package/chunks/{task-list-FOPULZEP.js → task-list-5XNNGTF4.js} +7 -7
- package/chunks/{task-stop-H6RHXFVQ.js → task-stop-4ROAOBXH.js} +3 -3
- package/chunks/{task-update-M57TFZJT.js → task-update-4FPFYGE3.js} +10 -10
- package/chunks/{team-create-YJALH5D2.js → team-create-MGD3Q7W4.js} +50 -49
- package/chunks/{team-delete-QE2UXJL7.js → team-delete-S2RCXA4P.js} +7 -7
- package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-VMVGLPDQ.js} +48 -47
- package/chunks/theme-manager-U4QE2YSY.js +78 -0
- package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-7WM3VDMY.js} +7 -7
- package/chunks/{tool-search-NF7GB6LE.js → tool-search-6T7VYTYZ.js} +19 -21
- package/chunks/total-session-admission-PLKO4EET.js +86 -0
- package/chunks/trustedFolders-QZU6BO46.js +96 -0
- package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-NWPFNM5L.js} +5 -5
- package/chunks/updateCheck-KEOCGBZR.js +93 -0
- package/chunks/useAutoAcceptIndicator-O6XISZEA.js +94 -0
- package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-WCHAHO75.js} +94 -89
- package/chunks/{version-HS7YSFHV.js → version-VP3VZ2BM.js} +1 -1
- package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-KM2FSOKS.js} +19 -21
- package/chunks/{web-search-S62WAP4S.js → web-search-WUR6PYBO.js} +13 -13
- package/chunks/{workflow-QAGU5RU4.js → workflow-S6XMX55R.js} +49 -48
- package/chunks/workspace-providers-status-JGIZRHVT.js +87 -0
- package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-JDEMOOFX.js} +1 -1
- package/chunks/workspace-registry-NIL6253M.js +94 -0
- package/chunks/workspace-service-UYB6MMWL.js +101 -0
- package/chunks/workspace-skills-status-GSJRWER4.js +87 -0
- package/chunks/workspace-trust-reconciler-V2TICK2A.js +347 -0
- package/chunks/write-file-QHD5ELJS.js +76 -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-236QXDRH.js +224 -0
- package/cli.js +13 -13
- 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-DQN8gc5j.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-C6Z867cc.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-BkyNf4_J.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-BA7aurej.js} +1 -1
- package/web-shell/assets/channel-YzToqAUt.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-Dp_LERgD.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-CCwcnkeW.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-e0ytWiup.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-DBoZrQ--.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-dmHU5zKq.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-PP3UKzsN.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-Bjy0PNsP.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-CM0H6wrK.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-_le9LVNU.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-_le9LVNU.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-B1B_Fozz.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-DGFk7aBN.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-VdlYGHdV.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-xcEMWz6m.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-B6Dd23eT.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-C3bjiNTc.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-ChXfX8H6.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-D7RBC3FG.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-bNsx8Fqb.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-C_m4liOj.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-CzAqOmDr.js} +1 -1
- package/web-shell/assets/{index-D0GX0zZf.js → index-BArKGy43.js} +1 -1
- package/web-shell/assets/index-C2GE3DAF.js +74 -0
- package/web-shell/assets/index-_dIfJ82-.js +1625 -0
- package/web-shell/assets/index-heP6zO4t.css +5 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-BBw9H4RT.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-C8Ns7cDb.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-BkW5h5si.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-IUhsF7tq.js} +1 -1
- package/web-shell/assets/{linear-BkoihsaA.js → linear-CeDsMMjT.js} +1 -1
- package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-VTPU82QL.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-DVohXDmC.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-SxBFaID8.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-BJt8o3Cs.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-B02G8M7E.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-CzMCGPib.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-CzbJgSkE.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-DhiXBOKS.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DILbnhvR.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-Btj5idQV.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-CJz2YZq4.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-CavIou7m.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-BRf62x8X.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-ItOGZPM_.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/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/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/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-SGFT55XI.js";
|
|
9
|
+
import {
|
|
10
|
+
STRUCTURED_OUTPUT_REDACTED_ARGS
|
|
11
|
+
} from "./chunk-Y4IHBGBP.js";
|
|
12
|
+
import {
|
|
13
|
+
BaseDeclarativeTool,
|
|
14
|
+
BaseToolInvocation,
|
|
15
|
+
SchemaValidator,
|
|
16
|
+
ToolDisplayNames,
|
|
17
|
+
ToolNames
|
|
18
|
+
} from "./chunk-Y6AXW2OG.js";
|
|
9
19
|
import {
|
|
10
20
|
DEFAULT_QWEN_MODEL
|
|
11
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OINT3ZNV.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-A3NDJ5SB.js";
|
|
26
33
|
import {
|
|
27
|
-
atomicWriteFile
|
|
28
|
-
|
|
29
|
-
} from "./chunk-A5L3JMUA.js";
|
|
34
|
+
atomicWriteFile
|
|
35
|
+
} from "./chunk-7XATOOE7.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-YX4DHA6S.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-UHUSJ6X7.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";
|
|
@@ -8880,9 +8878,9 @@ var LargeNonUtf8TextError = class extends Error {
|
|
|
8880
8878
|
};
|
|
8881
8879
|
async function readTextRange(request2) {
|
|
8882
8880
|
request2.signal?.throwIfAborted();
|
|
8883
|
-
const stats = request2.stats ?? await stat(request2.path);
|
|
8881
|
+
const stats = request2.stats ?? (request2.fileHandle !== void 0 ? await request2.fileHandle.stat() : await stat(request2.path));
|
|
8884
8882
|
const maxOutputBytes = normalizeMaxBytes(request2.maxOutputBytes);
|
|
8885
|
-
if (stats.size < TEXT_RANGE_FAST_PATH_MAX_SIZE) {
|
|
8883
|
+
if (request2.fileHandle === void 0 && stats.size < TEXT_RANGE_FAST_PATH_MAX_SIZE) {
|
|
8886
8884
|
const { content, encoding, bom } = await readFileWithEncodingInfo(
|
|
8887
8885
|
request2.path,
|
|
8888
8886
|
request2.signal
|
|
@@ -8901,7 +8899,7 @@ async function readTextRange(request2) {
|
|
|
8901
8899
|
lineEnding: detectLineEndingFromContent(content)
|
|
8902
8900
|
};
|
|
8903
8901
|
}
|
|
8904
|
-
return readLargeUtf8Range(request2, maxOutputBytes);
|
|
8902
|
+
return readLargeUtf8Range(request2, maxOutputBytes, stats.size);
|
|
8905
8903
|
}
|
|
8906
8904
|
__name(readTextRange, "readTextRange");
|
|
8907
8905
|
function normalizeMaxBytes(maxOutputBytes) {
|
|
@@ -8929,8 +8927,12 @@ function sliceDecodedContent(content, offset, limit, maxOutputBytes) {
|
|
|
8929
8927
|
};
|
|
8930
8928
|
}
|
|
8931
8929
|
__name(sliceDecodedContent, "sliceDecodedContent");
|
|
8932
|
-
async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
8933
|
-
const encoding = await detectFileEncoding(request2.path)
|
|
8930
|
+
async function readLargeUtf8Range(request2, maxOutputBytes, sourceSize) {
|
|
8931
|
+
const encoding = request2.fileHandle === void 0 ? await detectFileEncoding(request2.path) : await detectFileHandleEncoding(
|
|
8932
|
+
request2.fileHandle,
|
|
8933
|
+
sourceSize,
|
|
8934
|
+
request2.signal
|
|
8935
|
+
);
|
|
8934
8936
|
if (!isUtf8CompatibleEncoding(encoding)) {
|
|
8935
8937
|
throw new LargeNonUtf8TextError(encoding);
|
|
8936
8938
|
}
|
|
@@ -8950,10 +8952,11 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
8950
8952
|
fatal: true,
|
|
8951
8953
|
ignoreBOM: true
|
|
8952
8954
|
});
|
|
8953
|
-
const
|
|
8955
|
+
const pathStream = request2.fileHandle === void 0 ? createReadStream(request2.path, {
|
|
8954
8956
|
highWaterMark: 512 * 1024,
|
|
8955
8957
|
signal: request2.signal
|
|
8956
|
-
});
|
|
8958
|
+
}) : void 0;
|
|
8959
|
+
const chunks = pathStream ?? readFileHandleChunks(request2.fileHandle, sourceSize, request2.signal);
|
|
8957
8960
|
function appendSelected(fragment) {
|
|
8958
8961
|
if (fragment.length === 0 || truncatedByBytes) {
|
|
8959
8962
|
return;
|
|
@@ -8984,7 +8987,7 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
8984
8987
|
}
|
|
8985
8988
|
__name(decodeUtf8Chunk, "decodeUtf8Chunk");
|
|
8986
8989
|
try {
|
|
8987
|
-
for await (const rawChunk of
|
|
8990
|
+
for await (const rawChunk of chunks) {
|
|
8988
8991
|
request2.signal?.throwIfAborted();
|
|
8989
8992
|
let chunk = decodeUtf8Chunk(rawChunk, { stream: true });
|
|
8990
8993
|
if (firstChunk) {
|
|
@@ -9026,7 +9029,9 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9026
9029
|
}
|
|
9027
9030
|
}
|
|
9028
9031
|
} finally {
|
|
9029
|
-
|
|
9032
|
+
if (pathStream !== void 0 && !pathStream.destroyed) {
|
|
9033
|
+
pathStream.destroy();
|
|
9034
|
+
}
|
|
9030
9035
|
}
|
|
9031
9036
|
if (!stoppedEarly) {
|
|
9032
9037
|
decodeUtf8Chunk();
|
|
@@ -9042,6 +9047,36 @@ async function readLargeUtf8Range(request2, maxOutputBytes) {
|
|
|
9042
9047
|
};
|
|
9043
9048
|
}
|
|
9044
9049
|
__name(readLargeUtf8Range, "readLargeUtf8Range");
|
|
9050
|
+
async function* readFileHandleChunks(fileHandle, sourceSize, signal) {
|
|
9051
|
+
const highWaterMark = 512 * 1024;
|
|
9052
|
+
const buffer = Buffer.allocUnsafe(highWaterMark);
|
|
9053
|
+
let position = 0;
|
|
9054
|
+
while (position < sourceSize) {
|
|
9055
|
+
signal?.throwIfAborted();
|
|
9056
|
+
const bytesToRead = Math.min(highWaterMark, sourceSize - position);
|
|
9057
|
+
const { bytesRead } = await fileHandle.read(
|
|
9058
|
+
buffer,
|
|
9059
|
+
0,
|
|
9060
|
+
bytesToRead,
|
|
9061
|
+
position
|
|
9062
|
+
);
|
|
9063
|
+
signal?.throwIfAborted();
|
|
9064
|
+
if (bytesRead === 0) return;
|
|
9065
|
+
position += bytesRead;
|
|
9066
|
+
yield buffer.subarray(0, bytesRead);
|
|
9067
|
+
}
|
|
9068
|
+
}
|
|
9069
|
+
__name(readFileHandleChunks, "readFileHandleChunks");
|
|
9070
|
+
async function detectFileHandleEncoding(fileHandle, sourceSize, signal) {
|
|
9071
|
+
signal?.throwIfAborted();
|
|
9072
|
+
if (sourceSize === 0) return "utf-8";
|
|
9073
|
+
const sample = Buffer.alloc(Math.min(8192, sourceSize));
|
|
9074
|
+
const { bytesRead } = await fileHandle.read(sample, 0, sample.length, 0);
|
|
9075
|
+
signal?.throwIfAborted();
|
|
9076
|
+
if (bytesRead === 0) return "utf-8";
|
|
9077
|
+
return (await decodeBufferWithEncodingInfoAsync(sample.subarray(0, bytesRead))).encoding ?? "utf-8";
|
|
9078
|
+
}
|
|
9079
|
+
__name(detectFileHandleEncoding, "detectFileHandleEncoding");
|
|
9045
9080
|
function truncateUtf8(content, maxBytes) {
|
|
9046
9081
|
const bytes = Buffer.byteLength(content, "utf8");
|
|
9047
9082
|
if (bytes <= maxBytes) {
|
|
@@ -9066,9 +9101,234 @@ function detectLineEndingFromContent(content) {
|
|
|
9066
9101
|
}
|
|
9067
9102
|
__name(detectLineEndingFromContent, "detectLineEndingFromContent");
|
|
9068
9103
|
|
|
9104
|
+
// packages/core/src/utils/image-view.ts
|
|
9105
|
+
init_esbuild_shims();
|
|
9106
|
+
import fs2 from "node:fs/promises";
|
|
9107
|
+
var IMAGE_VIEW_MAX_EDGE = 1568;
|
|
9108
|
+
var IMAGE_VIEW_MAX_PATCHES = 1568;
|
|
9109
|
+
var IMAGE_PATCH_SIZE = 28;
|
|
9110
|
+
var IMAGE_MAX_UPSCALE = 8;
|
|
9111
|
+
var IMAGE_JPEG_QUALITY = 92;
|
|
9112
|
+
var IMAGE_MAX_SOURCE_BYTES = 100 * 1024 * 1024;
|
|
9113
|
+
var IMAGE_MAX_OUTPUT_BYTES = 9 * 1024 * 1024;
|
|
9114
|
+
var SUPPORTED_IMAGE_FORMATS = /* @__PURE__ */ new Set(["jpeg", "png", "webp"]);
|
|
9115
|
+
var ImageViewError = class extends Error {
|
|
9116
|
+
constructor(code, message) {
|
|
9117
|
+
super(message);
|
|
9118
|
+
this.code = code;
|
|
9119
|
+
}
|
|
9120
|
+
static {
|
|
9121
|
+
__name(this, "ImageViewError");
|
|
9122
|
+
}
|
|
9123
|
+
};
|
|
9124
|
+
function fitsVisualBudget({ width, height }) {
|
|
9125
|
+
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;
|
|
9126
|
+
}
|
|
9127
|
+
__name(fitsVisualBudget, "fitsVisualBudget");
|
|
9128
|
+
function boundedSize(width, height, maxUpscale) {
|
|
9129
|
+
const widthIsLongEdge = width >= height;
|
|
9130
|
+
const maxLongEdge = Math.min(
|
|
9131
|
+
IMAGE_VIEW_MAX_EDGE,
|
|
9132
|
+
Math.max(width, height) * maxUpscale
|
|
9133
|
+
);
|
|
9134
|
+
let low = 1;
|
|
9135
|
+
let high = maxLongEdge;
|
|
9136
|
+
let best = { width: 1, height: 1 };
|
|
9137
|
+
while (low <= high) {
|
|
9138
|
+
const longEdge = Math.floor((low + high) / 2);
|
|
9139
|
+
const candidate = widthIsLongEdge ? {
|
|
9140
|
+
width: longEdge,
|
|
9141
|
+
height: Math.max(1, Math.round(height / width * longEdge))
|
|
9142
|
+
} : {
|
|
9143
|
+
width: Math.max(1, Math.round(width / height * longEdge)),
|
|
9144
|
+
height: longEdge
|
|
9145
|
+
};
|
|
9146
|
+
if (fitsVisualBudget(candidate)) {
|
|
9147
|
+
best = candidate;
|
|
9148
|
+
low = longEdge + 1;
|
|
9149
|
+
} else {
|
|
9150
|
+
high = longEdge - 1;
|
|
9151
|
+
}
|
|
9152
|
+
}
|
|
9153
|
+
return best;
|
|
9154
|
+
}
|
|
9155
|
+
__name(boundedSize, "boundedSize");
|
|
9156
|
+
async function prepareImage(filePath, signal) {
|
|
9157
|
+
signal.throwIfAborted();
|
|
9158
|
+
let sharp;
|
|
9159
|
+
try {
|
|
9160
|
+
sharp = (await import("sharp")).default;
|
|
9161
|
+
} catch {
|
|
9162
|
+
throw new ImageViewError(
|
|
9163
|
+
"renderer_unavailable",
|
|
9164
|
+
'Image rendering is unavailable because the "sharp" image module could not be loaded.'
|
|
9165
|
+
);
|
|
9166
|
+
}
|
|
9167
|
+
let stats;
|
|
9168
|
+
try {
|
|
9169
|
+
stats = await fs2.stat(filePath);
|
|
9170
|
+
} catch (error) {
|
|
9171
|
+
if (error.code === "ENOENT") {
|
|
9172
|
+
throw new ImageViewError(
|
|
9173
|
+
"file_not_found",
|
|
9174
|
+
`Image file not found: ${filePath}`
|
|
9175
|
+
);
|
|
9176
|
+
}
|
|
9177
|
+
throw error;
|
|
9178
|
+
}
|
|
9179
|
+
if (stats.isDirectory()) {
|
|
9180
|
+
throw new ImageViewError(
|
|
9181
|
+
"target_is_directory",
|
|
9182
|
+
`Image path is a directory: ${filePath}`
|
|
9183
|
+
);
|
|
9184
|
+
}
|
|
9185
|
+
if (!stats.isFile()) {
|
|
9186
|
+
throw new ImageViewError(
|
|
9187
|
+
"target_not_regular_file",
|
|
9188
|
+
`Image path is not a regular file: ${filePath}`
|
|
9189
|
+
);
|
|
9190
|
+
}
|
|
9191
|
+
if (stats.size > IMAGE_MAX_SOURCE_BYTES) {
|
|
9192
|
+
throw new ImageViewError(
|
|
9193
|
+
"source_too_large",
|
|
9194
|
+
`Image file exceeds the 100 MB source limit: ${filePath}`
|
|
9195
|
+
);
|
|
9196
|
+
}
|
|
9197
|
+
const bytes = await fs2.readFile(filePath, { signal });
|
|
9198
|
+
if (bytes.length > IMAGE_MAX_SOURCE_BYTES) {
|
|
9199
|
+
throw new ImageViewError(
|
|
9200
|
+
"source_too_large",
|
|
9201
|
+
`Image file exceeds the 100 MB source limit: ${filePath}`
|
|
9202
|
+
);
|
|
9203
|
+
}
|
|
9204
|
+
let metadata;
|
|
9205
|
+
try {
|
|
9206
|
+
metadata = await sharp(bytes, {
|
|
9207
|
+
failOn: "error",
|
|
9208
|
+
limitInputPixels: true
|
|
9209
|
+
}).metadata();
|
|
9210
|
+
} catch {
|
|
9211
|
+
signal.throwIfAborted();
|
|
9212
|
+
throw new ImageViewError(
|
|
9213
|
+
"decode_failed",
|
|
9214
|
+
`Failed to decode image (file may be corrupt or not a static PNG, JPEG, or WebP): ${filePath}`
|
|
9215
|
+
);
|
|
9216
|
+
}
|
|
9217
|
+
signal.throwIfAborted();
|
|
9218
|
+
if (!SUPPORTED_IMAGE_FORMATS.has(metadata.format)) {
|
|
9219
|
+
throw new ImageViewError(
|
|
9220
|
+
"unsupported_image",
|
|
9221
|
+
`Unsupported image. Expected a static PNG, JPEG, or WebP file: ${filePath}`
|
|
9222
|
+
);
|
|
9223
|
+
}
|
|
9224
|
+
if ((metadata.pages ?? 1) > 1) {
|
|
9225
|
+
throw new ImageViewError(
|
|
9226
|
+
"animated_image",
|
|
9227
|
+
`Only static images are supported: ${filePath}`
|
|
9228
|
+
);
|
|
9229
|
+
}
|
|
9230
|
+
return { bytes, metadata, sharp };
|
|
9231
|
+
}
|
|
9232
|
+
__name(prepareImage, "prepareImage");
|
|
9233
|
+
async function renderImageView(filePath, prepared, selection, outputSize, signal) {
|
|
9234
|
+
const { bytes, metadata, sharp } = prepared;
|
|
9235
|
+
let output;
|
|
9236
|
+
try {
|
|
9237
|
+
output = await sharp(bytes, {
|
|
9238
|
+
autoOrient: true,
|
|
9239
|
+
failOn: "error",
|
|
9240
|
+
limitInputPixels: true
|
|
9241
|
+
}).extract(selection).resize(outputSize.width, outputSize.height, {
|
|
9242
|
+
fit: "fill",
|
|
9243
|
+
kernel: sharp.kernel.lanczos3
|
|
9244
|
+
}).flatten({ background: "#ffffff" }).jpeg({
|
|
9245
|
+
quality: IMAGE_JPEG_QUALITY,
|
|
9246
|
+
chromaSubsampling: "4:4:4"
|
|
9247
|
+
}).toBuffer();
|
|
9248
|
+
} catch {
|
|
9249
|
+
signal.throwIfAborted();
|
|
9250
|
+
throw new ImageViewError(
|
|
9251
|
+
"decode_failed",
|
|
9252
|
+
`Failed to render image overview: ${filePath}`
|
|
9253
|
+
);
|
|
9254
|
+
}
|
|
9255
|
+
signal.throwIfAborted();
|
|
9256
|
+
if (output.length > IMAGE_MAX_OUTPUT_BYTES) {
|
|
9257
|
+
throw new ImageViewError(
|
|
9258
|
+
"output_too_large",
|
|
9259
|
+
`Rendered image exceeds the 9 MB output limit: ${filePath}`
|
|
9260
|
+
);
|
|
9261
|
+
}
|
|
9262
|
+
return {
|
|
9263
|
+
bytes: output,
|
|
9264
|
+
mimeType: "image/jpeg",
|
|
9265
|
+
sourceWidth: metadata.autoOrient.width,
|
|
9266
|
+
sourceHeight: metadata.autoOrient.height,
|
|
9267
|
+
selectedWidth: selection.width,
|
|
9268
|
+
selectedHeight: selection.height,
|
|
9269
|
+
outputWidth: outputSize.width,
|
|
9270
|
+
outputHeight: outputSize.height
|
|
9271
|
+
};
|
|
9272
|
+
}
|
|
9273
|
+
__name(renderImageView, "renderImageView");
|
|
9274
|
+
async function renderImageOverview(filePath, signal) {
|
|
9275
|
+
const prepared = await prepareImage(filePath, signal);
|
|
9276
|
+
const sourceWidth = prepared.metadata.autoOrient.width;
|
|
9277
|
+
const sourceHeight = prepared.metadata.autoOrient.height;
|
|
9278
|
+
const outputSize = boundedSize(sourceWidth, sourceHeight, 1);
|
|
9279
|
+
return renderImageView(
|
|
9280
|
+
filePath,
|
|
9281
|
+
prepared,
|
|
9282
|
+
{ left: 0, top: 0, width: sourceWidth, height: sourceHeight },
|
|
9283
|
+
outputSize,
|
|
9284
|
+
signal
|
|
9285
|
+
);
|
|
9286
|
+
}
|
|
9287
|
+
__name(renderImageOverview, "renderImageOverview");
|
|
9288
|
+
async function renderNormalizedImageCrop(filePath, region, signal) {
|
|
9289
|
+
const prepared = await prepareImage(filePath, signal);
|
|
9290
|
+
const sourceWidth = prepared.metadata.autoOrient.width;
|
|
9291
|
+
const sourceHeight = prepared.metadata.autoOrient.height;
|
|
9292
|
+
const left = Math.min(
|
|
9293
|
+
sourceWidth - 1,
|
|
9294
|
+
Math.max(0, Math.floor(region.x1 / 1e3 * sourceWidth))
|
|
9295
|
+
);
|
|
9296
|
+
const top = Math.min(
|
|
9297
|
+
sourceHeight - 1,
|
|
9298
|
+
Math.max(0, Math.floor(region.y1 / 1e3 * sourceHeight))
|
|
9299
|
+
);
|
|
9300
|
+
const right = Math.min(
|
|
9301
|
+
sourceWidth,
|
|
9302
|
+
Math.max(left + 1, Math.ceil(region.x2 / 1e3 * sourceWidth))
|
|
9303
|
+
);
|
|
9304
|
+
const bottom = Math.min(
|
|
9305
|
+
sourceHeight,
|
|
9306
|
+
Math.max(top + 1, Math.ceil(region.y2 / 1e3 * sourceHeight))
|
|
9307
|
+
);
|
|
9308
|
+
const selectedWidth = right - left;
|
|
9309
|
+
const selectedHeight = bottom - top;
|
|
9310
|
+
const outputSize = boundedSize(
|
|
9311
|
+
selectedWidth,
|
|
9312
|
+
selectedHeight,
|
|
9313
|
+
IMAGE_MAX_UPSCALE
|
|
9314
|
+
);
|
|
9315
|
+
return renderImageView(
|
|
9316
|
+
filePath,
|
|
9317
|
+
prepared,
|
|
9318
|
+
{ left, top, width: selectedWidth, height: selectedHeight },
|
|
9319
|
+
outputSize,
|
|
9320
|
+
signal
|
|
9321
|
+
);
|
|
9322
|
+
}
|
|
9323
|
+
__name(renderNormalizedImageCrop, "renderNormalizedImageCrop");
|
|
9324
|
+
|
|
9069
9325
|
// packages/core/src/utils/fileUtils.ts
|
|
9070
9326
|
var debugLogger2 = createDebugLogger("FILE_UTILS");
|
|
9071
|
-
var
|
|
9327
|
+
var CANONICAL_IMAGE_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
9328
|
+
"image/jpeg",
|
|
9329
|
+
"image/png",
|
|
9330
|
+
"image/webp"
|
|
9331
|
+
]);
|
|
9072
9332
|
var PDF_FULL_TEXT_EXTRACTION_MAX_MB = 100;
|
|
9073
9333
|
var PDF_PAGED_TEXT_EXTRACTION_MAX_MB = 512;
|
|
9074
9334
|
function detectBOM(buf) {
|
|
@@ -9127,7 +9387,7 @@ function isValidUtf8(buffer) {
|
|
|
9127
9387
|
}
|
|
9128
9388
|
}
|
|
9129
9389
|
__name(isValidUtf8, "isValidUtf8");
|
|
9130
|
-
function
|
|
9390
|
+
async function decodeBufferWithEncodingInfoAsync(full) {
|
|
9131
9391
|
if (full.length === 0) {
|
|
9132
9392
|
return { content: "", encoding: "utf-8", bom: false };
|
|
9133
9393
|
}
|
|
@@ -9147,9 +9407,10 @@ function decodeBufferWithEncodingInfo(full) {
|
|
|
9147
9407
|
const detected = detectEncodingFromBuffer(full);
|
|
9148
9408
|
if (detected && !isUtf8CompatibleEncoding(detected)) {
|
|
9149
9409
|
try {
|
|
9150
|
-
|
|
9410
|
+
const iconvLite = await loadIconvLite();
|
|
9411
|
+
if (iconvLite.encodingExists(detected)) {
|
|
9151
9412
|
return {
|
|
9152
|
-
content:
|
|
9413
|
+
content: iconvLite.decode(full, detected),
|
|
9153
9414
|
encoding: detected,
|
|
9154
9415
|
bom: false
|
|
9155
9416
|
};
|
|
@@ -9162,7 +9423,7 @@ function decodeBufferWithEncodingInfo(full) {
|
|
|
9162
9423
|
}
|
|
9163
9424
|
return { content: full.toString("utf8"), encoding: "utf-8", bom: false };
|
|
9164
9425
|
}
|
|
9165
|
-
__name(
|
|
9426
|
+
__name(decodeBufferWithEncodingInfoAsync, "decodeBufferWithEncodingInfoAsync");
|
|
9166
9427
|
function decodeBOMBuffer(buf, bomInfo) {
|
|
9167
9428
|
const content = buf.subarray(bomInfo.bomLength);
|
|
9168
9429
|
switch (bomInfo.encoding) {
|
|
@@ -9199,11 +9460,11 @@ function bomEncodingToName(bomEncoding) {
|
|
|
9199
9460
|
}
|
|
9200
9461
|
__name(bomEncodingToName, "bomEncodingToName");
|
|
9201
9462
|
async function readFileWithEncodingInfo(filePath, signal) {
|
|
9202
|
-
const full = await
|
|
9463
|
+
const full = await fs3.promises.readFile(
|
|
9203
9464
|
filePath,
|
|
9204
9465
|
signal === void 0 ? void 0 : { signal }
|
|
9205
9466
|
);
|
|
9206
|
-
return
|
|
9467
|
+
return await decodeBufferWithEncodingInfoAsync(full);
|
|
9207
9468
|
}
|
|
9208
9469
|
__name(readFileWithEncodingInfo, "readFileWithEncodingInfo");
|
|
9209
9470
|
async function readFileWithEncoding(filePath) {
|
|
@@ -9218,7 +9479,7 @@ async function countFileLines(filePath) {
|
|
|
9218
9479
|
__name(countFileLines, "countFileLines");
|
|
9219
9480
|
async function readFileWithLineAndLimit(params) {
|
|
9220
9481
|
const { path: filePath, limit, line, maxOutputBytes, signal } = params;
|
|
9221
|
-
const stats = params.stats ?? await
|
|
9482
|
+
const stats = params.stats ?? await fs3.promises.stat(filePath);
|
|
9222
9483
|
if (line !== void 0 && line > 0 || Number.isFinite(limit) || maxOutputBytes !== void 0) {
|
|
9223
9484
|
return readTextRange({
|
|
9224
9485
|
path: filePath,
|
|
@@ -9253,7 +9514,7 @@ __name(readFileWithLineAndLimit, "readFileWithLineAndLimit");
|
|
|
9253
9514
|
async function detectFileEncoding(filePath) {
|
|
9254
9515
|
let fh = null;
|
|
9255
9516
|
try {
|
|
9256
|
-
fh = await
|
|
9517
|
+
fh = await fs3.promises.open(filePath, "r");
|
|
9257
9518
|
const stats = await fh.stat();
|
|
9258
9519
|
if (stats.size === 0) return "utf-8";
|
|
9259
9520
|
const sampleSize = Math.min(8192, stats.size);
|
|
@@ -9311,7 +9572,7 @@ __name(isWithinRoot, "isWithinRoot");
|
|
|
9311
9572
|
async function isBinaryFile(filePath) {
|
|
9312
9573
|
let fh = null;
|
|
9313
9574
|
try {
|
|
9314
|
-
fh = await
|
|
9575
|
+
fh = await fs3.promises.open(filePath, "r");
|
|
9315
9576
|
const stats = await fh.stat();
|
|
9316
9577
|
const fileSize = stats.size;
|
|
9317
9578
|
if (fileSize === 0) return false;
|
|
@@ -9604,7 +9865,7 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9604
9865
|
signal?.throwIfAborted();
|
|
9605
9866
|
let stats;
|
|
9606
9867
|
try {
|
|
9607
|
-
stats = await
|
|
9868
|
+
stats = await fs3.promises.stat(filePath);
|
|
9608
9869
|
} catch (error) {
|
|
9609
9870
|
if (isNodeError(error) && error.code === "ENOENT") {
|
|
9610
9871
|
return {
|
|
@@ -9633,6 +9894,8 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9633
9894
|
};
|
|
9634
9895
|
}
|
|
9635
9896
|
const fileType = await detectFileType(filePath);
|
|
9897
|
+
const mediaMimeType = index_lite_default.getType(filePath) ?? MIME_LITE_MISSING_VIDEO_TYPES.get(path2.extname(filePath).toLowerCase()) ?? "application/octet-stream";
|
|
9898
|
+
const shouldRenderImageOverview = fileType === "image" && CANONICAL_IMAGE_MIME_TYPES.has(mediaMimeType);
|
|
9636
9899
|
const relativePathForDisplay = path2.relative(rootDirectory, filePath).replace(/\\/g, "/");
|
|
9637
9900
|
const displayName = path2.basename(filePath);
|
|
9638
9901
|
const modalities = config.getContentGeneratorConfig?.()?.modalities ?? {};
|
|
@@ -9717,7 +9980,15 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9717
9980
|
};
|
|
9718
9981
|
}
|
|
9719
9982
|
}
|
|
9720
|
-
if (
|
|
9983
|
+
if (shouldRenderImageOverview && stats.size > IMAGE_MAX_SOURCE_BYTES) {
|
|
9984
|
+
return {
|
|
9985
|
+
llmContent: "Image file exceeds the 100 MB source limit.",
|
|
9986
|
+
returnDisplay: "Image file exceeds the 100 MB source limit.",
|
|
9987
|
+
error: `Image file exceeds the 100 MB source limit: ${filePath}`,
|
|
9988
|
+
errorType: "file_too_large" /* FILE_TOO_LARGE */
|
|
9989
|
+
};
|
|
9990
|
+
}
|
|
9991
|
+
if (fileSizeInMB > 9.9 && !willExtractPdfText && fileType !== "text" && !shouldRenderImageOverview) {
|
|
9721
9992
|
return {
|
|
9722
9993
|
llmContent: "File size exceeds the 10MB limit.",
|
|
9723
9994
|
returnDisplay: "File size exceeds the 10MB limit.",
|
|
@@ -9849,10 +10120,70 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9849
10120
|
stats
|
|
9850
10121
|
};
|
|
9851
10122
|
}
|
|
9852
|
-
case "image":
|
|
10123
|
+
case "image": {
|
|
10124
|
+
if (shouldRenderImageOverview) {
|
|
10125
|
+
try {
|
|
10126
|
+
const view = await renderImageOverview(
|
|
10127
|
+
filePath,
|
|
10128
|
+
signal ?? new AbortController().signal
|
|
10129
|
+
);
|
|
10130
|
+
return {
|
|
10131
|
+
llmContent: [
|
|
10132
|
+
{
|
|
10133
|
+
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.`
|
|
10134
|
+
},
|
|
10135
|
+
{
|
|
10136
|
+
inlineData: {
|
|
10137
|
+
data: view.bytes.toString("base64"),
|
|
10138
|
+
mimeType: view.mimeType,
|
|
10139
|
+
displayName
|
|
10140
|
+
}
|
|
10141
|
+
}
|
|
10142
|
+
],
|
|
10143
|
+
returnDisplay: `Read image file: ${relativePathForDisplay}`
|
|
10144
|
+
};
|
|
10145
|
+
} catch (error) {
|
|
10146
|
+
signal?.throwIfAborted();
|
|
10147
|
+
if (error instanceof ImageViewError) {
|
|
10148
|
+
if (error.code === "source_too_large" || error.code === "output_too_large") {
|
|
10149
|
+
const userMessage = error.message.replace(`: ${filePath}`, "");
|
|
10150
|
+
return {
|
|
10151
|
+
llmContent: userMessage,
|
|
10152
|
+
returnDisplay: userMessage,
|
|
10153
|
+
error: error.message,
|
|
10154
|
+
errorType: "file_too_large" /* FILE_TOO_LARGE */
|
|
10155
|
+
};
|
|
10156
|
+
}
|
|
10157
|
+
} else {
|
|
10158
|
+
throw error;
|
|
10159
|
+
}
|
|
10160
|
+
}
|
|
10161
|
+
}
|
|
10162
|
+
const contentBuffer = await fs3.promises.readFile(filePath);
|
|
10163
|
+
const base64Data = contentBuffer.toString("base64");
|
|
10164
|
+
const base64SizeInMB = base64Data.length / (1024 * 1024);
|
|
10165
|
+
if (base64SizeInMB > 9.9) {
|
|
10166
|
+
return {
|
|
10167
|
+
llmContent: `File exceeds the 10MB data URI limit after base64 encoding (${base64SizeInMB.toFixed(2)}MB encoded).`,
|
|
10168
|
+
returnDisplay: `File exceeds the 10MB data URI limit after base64 encoding.`,
|
|
10169
|
+
error: `File exceeds the 10MB data URI limit after base64 encoding: ${filePath} (${base64SizeInMB.toFixed(2)}MB encoded)`,
|
|
10170
|
+
errorType: "file_too_large" /* FILE_TOO_LARGE */
|
|
10171
|
+
};
|
|
10172
|
+
}
|
|
10173
|
+
return {
|
|
10174
|
+
llmContent: {
|
|
10175
|
+
inlineData: {
|
|
10176
|
+
data: base64Data,
|
|
10177
|
+
mimeType: mediaMimeType,
|
|
10178
|
+
displayName
|
|
10179
|
+
}
|
|
10180
|
+
},
|
|
10181
|
+
returnDisplay: `Read image file: ${relativePathForDisplay}`
|
|
10182
|
+
};
|
|
10183
|
+
}
|
|
9853
10184
|
case "audio":
|
|
9854
10185
|
case "video": {
|
|
9855
|
-
const contentBuffer = await
|
|
10186
|
+
const contentBuffer = await fs3.promises.readFile(filePath);
|
|
9856
10187
|
const base64Data = contentBuffer.toString("base64");
|
|
9857
10188
|
const base64SizeInMB = base64Data.length / (1024 * 1024);
|
|
9858
10189
|
if (base64SizeInMB > 9.9) {
|
|
@@ -9867,9 +10198,7 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9867
10198
|
llmContent: {
|
|
9868
10199
|
inlineData: {
|
|
9869
10200
|
data: base64Data,
|
|
9870
|
-
mimeType:
|
|
9871
|
-
path2.extname(filePath).toLowerCase()
|
|
9872
|
-
) ?? "application/octet-stream",
|
|
10201
|
+
mimeType: mediaMimeType,
|
|
9873
10202
|
displayName
|
|
9874
10203
|
}
|
|
9875
10204
|
},
|
|
@@ -9878,7 +10207,7 @@ async function processSingleFileContent(filePath, config, optionsOrOffset, legac
|
|
|
9878
10207
|
}
|
|
9879
10208
|
case "pdf": {
|
|
9880
10209
|
if (!pageRange && modalities.pdf) {
|
|
9881
|
-
const contentBuffer = await
|
|
10210
|
+
const contentBuffer = await fs3.promises.readFile(filePath);
|
|
9882
10211
|
const base64Data = contentBuffer.toString("base64");
|
|
9883
10212
|
const base64SizeInMB = base64Data.length / (1024 * 1024);
|
|
9884
10213
|
if (base64SizeInMB > 9.9) {
|
|
@@ -10145,7 +10474,7 @@ function normalizeRangeReadByteLimit(maxOutputBytes) {
|
|
|
10145
10474
|
__name(normalizeRangeReadByteLimit, "normalizeRangeReadByteLimit");
|
|
10146
10475
|
async function fileExists(filePath) {
|
|
10147
10476
|
try {
|
|
10148
|
-
await fsPromises.access(filePath,
|
|
10477
|
+
await fsPromises.access(filePath, fs3.constants.F_OK);
|
|
10149
10478
|
return true;
|
|
10150
10479
|
} catch (_) {
|
|
10151
10480
|
return false;
|
|
@@ -10290,7 +10619,7 @@ var import_https_proxy_agent = __toESM(require_dist(), 1);
|
|
|
10290
10619
|
import { Buffer as Buffer2 } from "buffer";
|
|
10291
10620
|
import * as https from "https";
|
|
10292
10621
|
import * as os2 from "node:os";
|
|
10293
|
-
import
|
|
10622
|
+
import fs4 from "node:fs";
|
|
10294
10623
|
import path4 from "node:path";
|
|
10295
10624
|
|
|
10296
10625
|
// packages/core/src/telemetry/sanitize.ts
|
|
@@ -10495,8 +10824,8 @@ var QwenLogger = class _QwenLogger {
|
|
|
10495
10824
|
const legacyPath = path4.join(os2.homedir(), ".qwen", "source.json");
|
|
10496
10825
|
const candidates = path4.normalize(sourceJsonPath) !== path4.normalize(legacyPath) ? [sourceJsonPath, legacyPath] : [sourceJsonPath];
|
|
10497
10826
|
for (const candidate of candidates) {
|
|
10498
|
-
if (
|
|
10499
|
-
const sourceJsonContent =
|
|
10827
|
+
if (fs4.existsSync(candidate)) {
|
|
10828
|
+
const sourceJsonContent = fs4.readFileSync(candidate, "utf8");
|
|
10500
10829
|
const sourceData = JSON.parse(sourceJsonContent);
|
|
10501
10830
|
if (sourceData && typeof sourceData === "object" && sourceData.source && sourceData.source !== "unknown") {
|
|
10502
10831
|
return sourceData.source;
|
|
@@ -10969,6 +11298,24 @@ var QwenLogger = class _QwenLogger {
|
|
|
10969
11298
|
this.enqueueLogEvent(rumEvent);
|
|
10970
11299
|
this.flushIfNeeded();
|
|
10971
11300
|
}
|
|
11301
|
+
logRipgrepRuntimeRecoveryEvent(event) {
|
|
11302
|
+
const rumEvent = this.createActionEvent(
|
|
11303
|
+
"misc",
|
|
11304
|
+
"ripgrep_runtime_recovery",
|
|
11305
|
+
{
|
|
11306
|
+
properties: {
|
|
11307
|
+
platform: process.platform,
|
|
11308
|
+
arch: process.arch,
|
|
11309
|
+
selection_mode: event.selection_mode,
|
|
11310
|
+
retry_triggered: event.retry_triggered,
|
|
11311
|
+
...event.retry_succeeded !== void 0 ? { retry_succeeded: event.retry_succeeded } : {},
|
|
11312
|
+
failure_kind: event.failure_kind
|
|
11313
|
+
}
|
|
11314
|
+
}
|
|
11315
|
+
);
|
|
11316
|
+
this.enqueueLogEvent(rumEvent);
|
|
11317
|
+
this.flushIfNeeded();
|
|
11318
|
+
}
|
|
10972
11319
|
logLoopDetectionDisabledEvent() {
|
|
10973
11320
|
const rumEvent = this.createActionEvent(
|
|
10974
11321
|
"misc",
|
|
@@ -11232,6 +11579,12 @@ var createInitialSkillMetrics = /* @__PURE__ */ __name(() => ({
|
|
|
11232
11579
|
totalFail: 0,
|
|
11233
11580
|
byName: {}
|
|
11234
11581
|
}), "createInitialSkillMetrics");
|
|
11582
|
+
var createInitialGenerationMetrics = /* @__PURE__ */ __name(() => ({
|
|
11583
|
+
timedRequests: 0,
|
|
11584
|
+
totalTtftMs: 0,
|
|
11585
|
+
totalGenerationDurationMs: 0,
|
|
11586
|
+
totalThroughputOutputTokens: 0
|
|
11587
|
+
}), "createInitialGenerationMetrics");
|
|
11235
11588
|
var createInitialMetrics = /* @__PURE__ */ __name(() => ({
|
|
11236
11589
|
models: {},
|
|
11237
11590
|
tools: {
|
|
@@ -11376,6 +11729,23 @@ var UiTelemetryService = class _UiTelemetryService extends EventEmitter {
|
|
|
11376
11729
|
bucket.tokens.cached += event.cached_content_token_count;
|
|
11377
11730
|
bucket.tokens.thoughts += event.thoughts_token_count;
|
|
11378
11731
|
}
|
|
11732
|
+
if (event.ttft_ms === void 0 || !Number.isFinite(event.ttft_ms) || event.ttft_ms < 0 || isInternalPromptId(event.prompt_id)) {
|
|
11733
|
+
return;
|
|
11734
|
+
}
|
|
11735
|
+
const generation = metrics.generation ?? (metrics.generation = createInitialGenerationMetrics());
|
|
11736
|
+
const generationDurationMs = Math.max(0, event.duration_ms - event.ttft_ms);
|
|
11737
|
+
generation.timedRequests++;
|
|
11738
|
+
generation.totalTtftMs += event.ttft_ms;
|
|
11739
|
+
if (generationDurationMs > 0) {
|
|
11740
|
+
generation.totalGenerationDurationMs += generationDurationMs;
|
|
11741
|
+
generation.totalThroughputOutputTokens += event.output_token_count;
|
|
11742
|
+
}
|
|
11743
|
+
generation.last = {
|
|
11744
|
+
model: event.model,
|
|
11745
|
+
ttftMs: event.ttft_ms,
|
|
11746
|
+
generationDurationMs,
|
|
11747
|
+
outputTokens: event.output_token_count
|
|
11748
|
+
};
|
|
11379
11749
|
}
|
|
11380
11750
|
#accumulateApiError(metrics, event) {
|
|
11381
11751
|
const modelMetrics = this.#getOrCreateModelMetrics(metrics, event.model);
|
|
@@ -11525,7 +11895,7 @@ import { randomUUID } from "node:crypto";
|
|
|
11525
11895
|
|
|
11526
11896
|
// packages/core/src/utils/jsonl-utils.ts
|
|
11527
11897
|
init_esbuild_shims();
|
|
11528
|
-
import
|
|
11898
|
+
import fs5 from "node:fs";
|
|
11529
11899
|
import path5 from "node:path";
|
|
11530
11900
|
import readline from "node:readline";
|
|
11531
11901
|
import { finished } from "node:stream/promises";
|
|
@@ -11617,7 +11987,7 @@ async function readLines(filePath, count) {
|
|
|
11617
11987
|
let fileStream;
|
|
11618
11988
|
let rl;
|
|
11619
11989
|
try {
|
|
11620
|
-
fileStream =
|
|
11990
|
+
fileStream = fs5.createReadStream(filePath);
|
|
11621
11991
|
rl = readline.createInterface({
|
|
11622
11992
|
input: fileStream,
|
|
11623
11993
|
crlfDelay: Infinity
|
|
@@ -11650,7 +12020,7 @@ async function read(filePath, options = {}) {
|
|
|
11650
12020
|
let fileStream;
|
|
11651
12021
|
let rl;
|
|
11652
12022
|
try {
|
|
11653
|
-
fileStream =
|
|
12023
|
+
fileStream = fs5.createReadStream(filePath);
|
|
11654
12024
|
rl = readline.createInterface({
|
|
11655
12025
|
input: fileStream,
|
|
11656
12026
|
crlfDelay: Infinity
|
|
@@ -11678,10 +12048,6 @@ async function read(filePath, options = {}) {
|
|
|
11678
12048
|
}
|
|
11679
12049
|
__name(read, "read");
|
|
11680
12050
|
var ensuredDirs = /* @__PURE__ */ new Set();
|
|
11681
|
-
function _resetEnsuredDirsCacheForTest() {
|
|
11682
|
-
ensuredDirs.clear();
|
|
11683
|
-
}
|
|
11684
|
-
__name(_resetEnsuredDirsCacheForTest, "_resetEnsuredDirsCacheForTest");
|
|
11685
12051
|
async function writeLine(filePath, data) {
|
|
11686
12052
|
const lock = getFileLock(filePath);
|
|
11687
12053
|
await lock.runExclusive(async () => {
|
|
@@ -11689,10 +12055,10 @@ async function writeLine(filePath, data) {
|
|
|
11689
12055
|
`;
|
|
11690
12056
|
const dir = path5.dirname(filePath);
|
|
11691
12057
|
if (!ensuredDirs.has(dir)) {
|
|
11692
|
-
await
|
|
12058
|
+
await fs5.promises.mkdir(dir, { recursive: true });
|
|
11693
12059
|
ensuredDirs.add(dir);
|
|
11694
12060
|
}
|
|
11695
|
-
await
|
|
12061
|
+
await fs5.promises.appendFile(filePath, Buffer.from(line, "utf8"), {
|
|
11696
12062
|
flush: true
|
|
11697
12063
|
});
|
|
11698
12064
|
});
|
|
@@ -11702,51 +12068,15 @@ function writeLineSync(filePath, data) {
|
|
|
11702
12068
|
const line = `${JSON.stringify(data)}
|
|
11703
12069
|
`;
|
|
11704
12070
|
const dir = path5.dirname(filePath);
|
|
11705
|
-
if (!
|
|
11706
|
-
|
|
12071
|
+
if (!fs5.existsSync(dir)) {
|
|
12072
|
+
fs5.mkdirSync(dir, { recursive: true });
|
|
11707
12073
|
}
|
|
11708
|
-
|
|
12074
|
+
fs5.appendFileSync(filePath, Buffer.from(line, "utf8"), { flush: true });
|
|
11709
12075
|
}
|
|
11710
12076
|
__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
12077
|
function exists(filePath) {
|
|
11748
12078
|
try {
|
|
11749
|
-
const stats =
|
|
12079
|
+
const stats = fs5.statSync(filePath);
|
|
11750
12080
|
return stats.isFile() && stats.size > 0;
|
|
11751
12081
|
} catch {
|
|
11752
12082
|
return false;
|
|
@@ -11997,11 +12327,6 @@ function summarizeRecords(period, value, records) {
|
|
|
11997
12327
|
};
|
|
11998
12328
|
}
|
|
11999
12329
|
__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
12330
|
var lastLoggedTimeByCode = /* @__PURE__ */ new Map();
|
|
12006
12331
|
var suppressedCountByCode = /* @__PURE__ */ new Map();
|
|
12007
12332
|
var TOKEN_USAGE_FAILURE_LOG_COOLDOWN_MS = 6e4;
|
|
@@ -12137,12 +12462,6 @@ function formatTokenUsageSummaryAsJson(summary) {
|
|
|
12137
12462
|
`;
|
|
12138
12463
|
}
|
|
12139
12464
|
__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
12465
|
|
|
12147
12466
|
// packages/core/src/utils/chat-recording-suppression-context.ts
|
|
12148
12467
|
init_esbuild_shims();
|
|
@@ -12359,40 +12678,40 @@ function logApiRequest(config, event) {
|
|
|
12359
12678
|
logger.emit(logRecord);
|
|
12360
12679
|
}
|
|
12361
12680
|
__name(logApiRequest, "logApiRequest");
|
|
12362
|
-
function
|
|
12363
|
-
QwenLogger.getInstance(config)?.
|
|
12681
|
+
function logRipgrepFallback(config, event) {
|
|
12682
|
+
QwenLogger.getInstance(config)?.logRipgrepFallbackEvent(event);
|
|
12364
12683
|
if (!isTelemetrySdkInitialized()) return;
|
|
12365
12684
|
const attributes = {
|
|
12366
12685
|
...getCommonAttributes(config),
|
|
12367
12686
|
...event,
|
|
12368
|
-
"event.name":
|
|
12687
|
+
"event.name": EVENT_RIPGREP_FALLBACK,
|
|
12369
12688
|
"event.timestamp": (/* @__PURE__ */ new Date()).toISOString()
|
|
12370
12689
|
};
|
|
12371
12690
|
const logger = import_api_logs.logs.getLogger(SERVICE_NAME);
|
|
12372
12691
|
const logRecord = {
|
|
12373
|
-
body: `Switching to
|
|
12692
|
+
body: `Switching to grep as fallback.`,
|
|
12374
12693
|
attributes
|
|
12375
12694
|
};
|
|
12376
12695
|
logger.emit(logRecord);
|
|
12377
12696
|
}
|
|
12378
|
-
__name(
|
|
12379
|
-
function
|
|
12380
|
-
QwenLogger.getInstance(config)?.
|
|
12697
|
+
__name(logRipgrepFallback, "logRipgrepFallback");
|
|
12698
|
+
function logRipgrepRuntimeRecovery(config, event) {
|
|
12699
|
+
QwenLogger.getInstance(config)?.logRipgrepRuntimeRecoveryEvent(event);
|
|
12381
12700
|
if (!isTelemetrySdkInitialized()) return;
|
|
12382
12701
|
const attributes = {
|
|
12383
12702
|
...getCommonAttributes(config),
|
|
12384
12703
|
...event,
|
|
12385
|
-
"event.name":
|
|
12704
|
+
"event.name": EVENT_RIPGREP_RUNTIME_RECOVERY,
|
|
12386
12705
|
"event.timestamp": (/* @__PURE__ */ new Date()).toISOString()
|
|
12387
12706
|
};
|
|
12388
12707
|
const logger = import_api_logs.logs.getLogger(SERVICE_NAME);
|
|
12389
12708
|
const logRecord = {
|
|
12390
|
-
body: `
|
|
12709
|
+
body: `Ripgrep runtime recovery: ${event.failure_kind}.`,
|
|
12391
12710
|
attributes
|
|
12392
12711
|
};
|
|
12393
12712
|
logger.emit(logRecord);
|
|
12394
12713
|
}
|
|
12395
|
-
__name(
|
|
12714
|
+
__name(logRipgrepRuntimeRecovery, "logRipgrepRuntimeRecovery");
|
|
12396
12715
|
function logApiError(config, event) {
|
|
12397
12716
|
const uiEvent = {
|
|
12398
12717
|
...event,
|
|
@@ -13185,7 +13504,7 @@ init_esbuild_shims();
|
|
|
13185
13504
|
|
|
13186
13505
|
// packages/core/src/utils/truncation.ts
|
|
13187
13506
|
init_esbuild_shims();
|
|
13188
|
-
import * as
|
|
13507
|
+
import * as fs6 from "node:fs/promises";
|
|
13189
13508
|
import * as path7 from "node:path";
|
|
13190
13509
|
import * as crypto from "node:crypto";
|
|
13191
13510
|
var debugLogger5 = createDebugLogger("TRUNCATION");
|
|
@@ -13217,22 +13536,26 @@ async function truncateAndSaveToFile(content, fileName, projectTempDir, threshol
|
|
|
13217
13536
|
const separator = "\n\n---\n... [CONTENT TRUNCATED] ...\n---\n\n";
|
|
13218
13537
|
const ellipsis = "...";
|
|
13219
13538
|
const previewBudget = Math.max(0, previewChars);
|
|
13220
|
-
const
|
|
13539
|
+
const sep = previewBudget > separator.length ? separator : "";
|
|
13540
|
+
const contentBudget = previewBudget - sep.length;
|
|
13541
|
+
const headBudget = keep === "head" ? contentBudget : keep === "tail" ? 0 : Math.floor(contentBudget / 5);
|
|
13221
13542
|
const beginning = [];
|
|
13222
13543
|
let headChars = 0;
|
|
13223
13544
|
for (let i = 0; i < Math.min(headCount, lines.length); i++) {
|
|
13224
13545
|
const remaining = headBudget - headChars;
|
|
13225
13546
|
if (remaining <= 0) break;
|
|
13226
13547
|
if (lines[i].length + 1 > remaining) {
|
|
13227
|
-
|
|
13228
|
-
|
|
13548
|
+
if (remaining >= ellipsis.length) {
|
|
13549
|
+
const sliceLen = remaining - ellipsis.length;
|
|
13550
|
+
beginning.push(lines[i].slice(0, sliceLen) + ellipsis);
|
|
13551
|
+
}
|
|
13229
13552
|
headChars = headBudget;
|
|
13230
13553
|
break;
|
|
13231
13554
|
}
|
|
13232
13555
|
beginning.push(lines[i]);
|
|
13233
13556
|
headChars += lines[i].length + 1;
|
|
13234
13557
|
}
|
|
13235
|
-
const tailBudget = keep === "head" ? 0 : Math.max(
|
|
13558
|
+
const tailBudget = keep === "head" ? 0 : Math.max(contentBudget - headChars, 0);
|
|
13236
13559
|
const end = [];
|
|
13237
13560
|
let tailChars = 0;
|
|
13238
13561
|
const tailStart = Math.max(lines.length - tailCount, beginning.length);
|
|
@@ -13240,15 +13563,17 @@ async function truncateAndSaveToFile(content, fileName, projectTempDir, threshol
|
|
|
13240
13563
|
const remaining = tailBudget - tailChars;
|
|
13241
13564
|
if (remaining <= 0) break;
|
|
13242
13565
|
if (lines[i].length + 1 > remaining) {
|
|
13243
|
-
|
|
13244
|
-
|
|
13566
|
+
if (remaining >= ellipsis.length) {
|
|
13567
|
+
const sliceLen = remaining - ellipsis.length;
|
|
13568
|
+
end.unshift(ellipsis + (sliceLen > 0 ? lines[i].slice(-sliceLen) : ""));
|
|
13569
|
+
}
|
|
13245
13570
|
tailChars = tailBudget;
|
|
13246
13571
|
break;
|
|
13247
13572
|
}
|
|
13248
13573
|
end.unshift(lines[i]);
|
|
13249
13574
|
tailChars += lines[i].length + 1;
|
|
13250
13575
|
}
|
|
13251
|
-
const truncatedContent = keep === "head" ? beginning.join("\n") +
|
|
13576
|
+
const truncatedContent = keep === "head" ? beginning.join("\n") + sep : keep === "tail" ? sep + end.join("\n") : beginning.join("\n") + sep + end.join("\n");
|
|
13252
13577
|
const safeFileName = `${path7.basename(fileName)}.output`;
|
|
13253
13578
|
const outputFile = path7.join(projectTempDir, safeFileName);
|
|
13254
13579
|
const wrappedMessage = `${TOOL_OUTPUT_TRUNCATED_PREFIX}.
|
|
@@ -13262,8 +13587,8 @@ ${truncatedContent}`;
|
|
|
13262
13587
|
return { content };
|
|
13263
13588
|
}
|
|
13264
13589
|
try {
|
|
13265
|
-
await
|
|
13266
|
-
await
|
|
13590
|
+
await fs6.mkdir(projectTempDir, { recursive: true });
|
|
13591
|
+
await fs6.writeFile(outputFile, content, { mode: 384 });
|
|
13267
13592
|
return {
|
|
13268
13593
|
content: wrappedMessage,
|
|
13269
13594
|
outputFile
|
|
@@ -13413,7 +13738,7 @@ async function persistAndTruncateToolResult(callId, toolName, content, config) {
|
|
|
13413
13738
|
try {
|
|
13414
13739
|
const toolResultsDir = config.storage.getToolResultsDir();
|
|
13415
13740
|
const outputFile = path7.join(toolResultsDir, `${safeCallId}.txt`);
|
|
13416
|
-
await
|
|
13741
|
+
await fs6.mkdir(toolResultsDir, { recursive: true });
|
|
13417
13742
|
await atomicWriteFile(outputFile, content, {
|
|
13418
13743
|
mode: 384,
|
|
13419
13744
|
forceMode: true,
|
|
@@ -13478,12 +13803,6 @@ __name(buildStub, "buildStub");
|
|
|
13478
13803
|
|
|
13479
13804
|
// packages/core/src/tools/mcp-status.ts
|
|
13480
13805
|
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
13806
|
var serverStatuses = /* @__PURE__ */ new Map();
|
|
13488
13807
|
var statusChangeListeners = [];
|
|
13489
13808
|
function addMCPStatusChangeListener(listener) {
|
|
@@ -13575,6 +13894,75 @@ function getInvocationContext() {
|
|
|
13575
13894
|
}
|
|
13576
13895
|
__name(getInvocationContext, "getInvocationContext");
|
|
13577
13896
|
|
|
13897
|
+
// packages/core/src/services/visionBridge/image-part-utils.ts
|
|
13898
|
+
init_esbuild_shims();
|
|
13899
|
+
function normalizeParts(input) {
|
|
13900
|
+
if (typeof input === "string") {
|
|
13901
|
+
return [{ text: input }];
|
|
13902
|
+
}
|
|
13903
|
+
if (Array.isArray(input)) {
|
|
13904
|
+
return input.map(
|
|
13905
|
+
(part) => typeof part === "string" ? { text: part } : part
|
|
13906
|
+
);
|
|
13907
|
+
}
|
|
13908
|
+
return [input];
|
|
13909
|
+
}
|
|
13910
|
+
__name(normalizeParts, "normalizeParts");
|
|
13911
|
+
function isImagePart(part) {
|
|
13912
|
+
const mimeType = part.inlineData?.mimeType;
|
|
13913
|
+
const data = part.inlineData?.data;
|
|
13914
|
+
return typeof mimeType === "string" && mimeType.startsWith("image/") && typeof data === "string" && data.length > 0;
|
|
13915
|
+
}
|
|
13916
|
+
__name(isImagePart, "isImagePart");
|
|
13917
|
+
function hasImageParts(input) {
|
|
13918
|
+
return normalizeParts(input).some(isImagePart);
|
|
13919
|
+
}
|
|
13920
|
+
__name(hasImageParts, "hasImageParts");
|
|
13921
|
+
function splitImageParts(input) {
|
|
13922
|
+
const imageParts = [];
|
|
13923
|
+
const nonImageParts = [];
|
|
13924
|
+
for (const part of normalizeParts(input)) {
|
|
13925
|
+
if (isImagePart(part)) {
|
|
13926
|
+
imageParts.push(part);
|
|
13927
|
+
} else {
|
|
13928
|
+
nonImageParts.push(part);
|
|
13929
|
+
}
|
|
13930
|
+
}
|
|
13931
|
+
return { imageParts, nonImageParts };
|
|
13932
|
+
}
|
|
13933
|
+
__name(splitImageParts, "splitImageParts");
|
|
13934
|
+
function replaceImagesWithText(input, text) {
|
|
13935
|
+
const result = [];
|
|
13936
|
+
let replaced = false;
|
|
13937
|
+
for (const part of normalizeParts(input)) {
|
|
13938
|
+
if (isImagePart(part)) {
|
|
13939
|
+
if (!replaced) {
|
|
13940
|
+
result.push({ text });
|
|
13941
|
+
replaced = true;
|
|
13942
|
+
}
|
|
13943
|
+
continue;
|
|
13944
|
+
}
|
|
13945
|
+
result.push(part);
|
|
13946
|
+
}
|
|
13947
|
+
if (!replaced) {
|
|
13948
|
+
result.push({ text });
|
|
13949
|
+
}
|
|
13950
|
+
return result;
|
|
13951
|
+
}
|
|
13952
|
+
__name(replaceImagesWithText, "replaceImagesWithText");
|
|
13953
|
+
function isUsableImagePart(part) {
|
|
13954
|
+
const data = part.inlineData?.data;
|
|
13955
|
+
if (typeof data !== "string" || data.length === 0) {
|
|
13956
|
+
return false;
|
|
13957
|
+
}
|
|
13958
|
+
return data.length <= VISION_BRIDGE_MAX_IMAGE_BASE64_BYTES;
|
|
13959
|
+
}
|
|
13960
|
+
__name(isUsableImagePart, "isUsableImagePart");
|
|
13961
|
+
function collectText(parts) {
|
|
13962
|
+
return parts.map((part) => typeof part.text === "string" ? part.text : "").filter((text) => text.length > 0).join("\n").trim();
|
|
13963
|
+
}
|
|
13964
|
+
__name(collectText, "collectText");
|
|
13965
|
+
|
|
13578
13966
|
// packages/core/src/tools/mcp-tool.ts
|
|
13579
13967
|
var debugLogger6 = createDebugLogger("MCP_TOOL");
|
|
13580
13968
|
var MCP_CONNECTION_ERROR_PATTERNS = [
|
|
@@ -13796,18 +14184,10 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
|
|
|
13796
14184
|
callToolResult
|
|
13797
14185
|
);
|
|
13798
14186
|
if (this.isMCPToolError(rawResponseParts)) {
|
|
13799
|
-
|
|
14187
|
+
return await this.buildMcpToolError(rawResponseParts, {
|
|
13800
14188
|
name: this.serverToolName,
|
|
13801
14189
|
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
|
-
};
|
|
14190
|
+
});
|
|
13811
14191
|
}
|
|
13812
14192
|
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
13813
14193
|
const truncated = await this.truncateTextParts(transformedParts);
|
|
@@ -13865,17 +14245,7 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
|
|
|
13865
14245
|
});
|
|
13866
14246
|
});
|
|
13867
14247
|
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
|
-
};
|
|
14248
|
+
return await this.buildMcpToolError(rawResponseParts, functionCalls[0]);
|
|
13879
14249
|
}
|
|
13880
14250
|
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
13881
14251
|
const truncated = await this.truncateTextParts(transformedParts);
|
|
@@ -13891,6 +14261,34 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
|
|
|
13891
14261
|
return this.handleReconnectOnError(error, signal);
|
|
13892
14262
|
}
|
|
13893
14263
|
}
|
|
14264
|
+
async buildMcpToolError(rawResponseParts, functionCall) {
|
|
14265
|
+
const imageContent = getMcpErrorImageContent(rawResponseParts);
|
|
14266
|
+
let llmContent;
|
|
14267
|
+
let errorMessage;
|
|
14268
|
+
let persistedOutputFiles;
|
|
14269
|
+
if (imageContent) {
|
|
14270
|
+
const truncatedContent = await this.truncateTextParts(imageContent);
|
|
14271
|
+
llmContent = truncatedContent.parts;
|
|
14272
|
+
persistedOutputFiles = truncatedContent.persistedOutputFiles;
|
|
14273
|
+
errorMessage = `MCP tool '${this.serverToolName}' reported tool error for function call: ${safeJsonStringify(
|
|
14274
|
+
functionCall
|
|
14275
|
+
)} with response: ${getDisplayFromParts(truncatedContent.parts)}`;
|
|
14276
|
+
} else {
|
|
14277
|
+
errorMessage = `MCP tool '${this.serverToolName}' reported tool error for function call: ${safeJsonStringify(
|
|
14278
|
+
functionCall
|
|
14279
|
+
)} with response: ${safeJsonStringify(rawResponseParts)}`;
|
|
14280
|
+
llmContent = errorMessage;
|
|
14281
|
+
}
|
|
14282
|
+
return {
|
|
14283
|
+
llmContent,
|
|
14284
|
+
returnDisplay: `Error: MCP tool '${this.serverToolName}' reported an error.`,
|
|
14285
|
+
error: {
|
|
14286
|
+
message: errorMessage,
|
|
14287
|
+
type: "mcp_tool_error" /* MCP_TOOL_ERROR */
|
|
14288
|
+
},
|
|
14289
|
+
...persistedOutputFiles !== void 0 ? { persistedOutputFiles } : {}
|
|
14290
|
+
};
|
|
14291
|
+
}
|
|
13894
14292
|
/**
|
|
13895
14293
|
* Truncates text parts in the transformed result if they exceed the
|
|
13896
14294
|
* configured threshold. Non-text parts (images, audio, etc.) are preserved.
|
|
@@ -14145,6 +14543,11 @@ function transformMcpContentToParts(sdkResponse) {
|
|
|
14145
14543
|
return transformed.filter((part) => part !== null);
|
|
14146
14544
|
}
|
|
14147
14545
|
__name(transformMcpContentToParts, "transformMcpContentToParts");
|
|
14546
|
+
function getMcpErrorImageContent(rawResponseParts) {
|
|
14547
|
+
const transformedParts = transformMcpContentToParts(rawResponseParts);
|
|
14548
|
+
return transformedParts.some(isImagePart) ? transformedParts : void 0;
|
|
14549
|
+
}
|
|
14550
|
+
__name(getMcpErrorImageContent, "getMcpErrorImageContent");
|
|
14148
14551
|
function getDisplayFromParts(parts) {
|
|
14149
14552
|
if (parts.length === 0) {
|
|
14150
14553
|
return "";
|
|
@@ -14245,19 +14648,6 @@ var StartSessionEvent = class {
|
|
|
14245
14648
|
}
|
|
14246
14649
|
}
|
|
14247
14650
|
};
|
|
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
14651
|
var UserPromptEvent = class {
|
|
14262
14652
|
static {
|
|
14263
14653
|
__name(this, "UserPromptEvent");
|
|
@@ -14454,12 +14844,14 @@ var ApiResponseEvent = class {
|
|
|
14454
14844
|
response_text;
|
|
14455
14845
|
prompt_id;
|
|
14456
14846
|
auth_type;
|
|
14847
|
+
/** Time from stream dispatch to first user-visible content. */
|
|
14848
|
+
ttft_ms;
|
|
14457
14849
|
/**
|
|
14458
14850
|
* Name of the subagent that issued this request, or undefined when the
|
|
14459
14851
|
* request originates from the main conversation.
|
|
14460
14852
|
*/
|
|
14461
14853
|
subagent_name;
|
|
14462
|
-
constructor(response_id, model, duration_ms, prompt_id, auth_type, usage_data, response_text, subagent_name) {
|
|
14854
|
+
constructor(response_id, model, duration_ms, prompt_id, auth_type, usage_data, response_text, subagent_name, ttft_ms) {
|
|
14463
14855
|
this["event.name"] = "api_response";
|
|
14464
14856
|
this["event.timestamp"] = (/* @__PURE__ */ new Date()).toISOString();
|
|
14465
14857
|
this.response_id = response_id;
|
|
@@ -14475,19 +14867,7 @@ var ApiResponseEvent = class {
|
|
|
14475
14867
|
this.prompt_id = prompt_id;
|
|
14476
14868
|
this.auth_type = auth_type;
|
|
14477
14869
|
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;
|
|
14870
|
+
this.ttft_ms = ttft_ms;
|
|
14491
14871
|
}
|
|
14492
14872
|
};
|
|
14493
14873
|
var RipgrepFallbackEvent = class {
|
|
@@ -14507,19 +14887,27 @@ var RipgrepFallbackEvent = class {
|
|
|
14507
14887
|
this.error = error;
|
|
14508
14888
|
}
|
|
14509
14889
|
};
|
|
14510
|
-
var
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14890
|
+
var RipgrepRuntimeRecoveryEvent = class {
|
|
14891
|
+
static {
|
|
14892
|
+
__name(this, "RipgrepRuntimeRecoveryEvent");
|
|
14893
|
+
}
|
|
14894
|
+
"event.name";
|
|
14895
|
+
"event.timestamp";
|
|
14896
|
+
selection_mode;
|
|
14897
|
+
retry_triggered;
|
|
14898
|
+
retry_succeeded;
|
|
14899
|
+
failure_kind;
|
|
14900
|
+
constructor(params) {
|
|
14901
|
+
this["event.name"] = "ripgrep_runtime_recovery";
|
|
14902
|
+
this["event.timestamp"] = (/* @__PURE__ */ new Date()).toISOString();
|
|
14903
|
+
this.selection_mode = params.selection_mode;
|
|
14904
|
+
this.retry_triggered = params.retry_triggered;
|
|
14905
|
+
if (params.retry_succeeded !== void 0) {
|
|
14906
|
+
this.retry_succeeded = params.retry_succeeded;
|
|
14907
|
+
}
|
|
14908
|
+
this.failure_kind = params.failure_kind;
|
|
14909
|
+
}
|
|
14910
|
+
};
|
|
14523
14911
|
var LoopDetectedEvent = class {
|
|
14524
14912
|
static {
|
|
14525
14913
|
__name(this, "LoopDetectedEvent");
|
|
@@ -14579,11 +14967,6 @@ function makeSlashCommandEvent({
|
|
|
14579
14967
|
};
|
|
14580
14968
|
}
|
|
14581
14969
|
__name(makeSlashCommandEvent, "makeSlashCommandEvent");
|
|
14582
|
-
var SlashCommandStatus = /* @__PURE__ */ ((SlashCommandStatus2) => {
|
|
14583
|
-
SlashCommandStatus2["SUCCESS"] = "success";
|
|
14584
|
-
SlashCommandStatus2["ERROR"] = "error";
|
|
14585
|
-
return SlashCommandStatus2;
|
|
14586
|
-
})(SlashCommandStatus || {});
|
|
14587
14970
|
function makeChatCompressionEvent({
|
|
14588
14971
|
tokens_before,
|
|
14589
14972
|
tokens_after,
|
|
@@ -14600,11 +14983,6 @@ function makeChatCompressionEvent({
|
|
|
14600
14983
|
};
|
|
14601
14984
|
}
|
|
14602
14985
|
__name(makeChatCompressionEvent, "makeChatCompressionEvent");
|
|
14603
|
-
var IdeConnectionType = /* @__PURE__ */ ((IdeConnectionType2) => {
|
|
14604
|
-
IdeConnectionType2["START"] = "start";
|
|
14605
|
-
IdeConnectionType2["SESSION"] = "session";
|
|
14606
|
-
return IdeConnectionType2;
|
|
14607
|
-
})(IdeConnectionType || {});
|
|
14608
14986
|
var IdeConnectionEvent = class {
|
|
14609
14987
|
static {
|
|
14610
14988
|
__name(this, "IdeConnectionEvent");
|
|
@@ -14976,12 +15354,6 @@ var SkillLaunchEvent = class {
|
|
|
14976
15354
|
this.prompt_id = prompt_id;
|
|
14977
15355
|
}
|
|
14978
15356
|
};
|
|
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
15357
|
var UserFeedbackEvent = class {
|
|
14986
15358
|
static {
|
|
14987
15359
|
__name(this, "UserFeedbackEvent");
|
|
@@ -15302,6 +15674,38 @@ function memoryFreshnessNote(mtimeMs) {
|
|
|
15302
15674
|
}
|
|
15303
15675
|
__name(memoryFreshnessNote, "memoryFreshnessNote");
|
|
15304
15676
|
|
|
15677
|
+
// packages/core/src/tools/file-read-permission.ts
|
|
15678
|
+
init_esbuild_shims();
|
|
15679
|
+
import path8 from "node:path";
|
|
15680
|
+
function getFileReadDefaultPermission(config, requestedPath) {
|
|
15681
|
+
const filePath = path8.resolve(requestedPath);
|
|
15682
|
+
const workspaceContext = config.getWorkspaceContext();
|
|
15683
|
+
const allowedRoots = [
|
|
15684
|
+
config.storage.getProjectTempDir(),
|
|
15685
|
+
// Background subagent transcripts live under <projectDir>/subagents/ and
|
|
15686
|
+
// are advertised to the model as polling targets via read_file.
|
|
15687
|
+
path8.join(config.storage.getProjectDir(), "subagents"),
|
|
15688
|
+
Storage.getGlobalTempDir(),
|
|
15689
|
+
...config.storage.getUserSkillsDirs(),
|
|
15690
|
+
Storage.getUserExtensionsDir(),
|
|
15691
|
+
// Approved plans are persisted here (default ~/.qwen/plans, outside
|
|
15692
|
+
// the workspace) and after approval nothing re-injects the plan text,
|
|
15693
|
+
// so the saved file is the model's only recovery route — reading it
|
|
15694
|
+
// back must not stall on a confirmation prompt. The dir holds only
|
|
15695
|
+
// session plan files, never credentials or settings.
|
|
15696
|
+
config.getPlansDir()
|
|
15697
|
+
];
|
|
15698
|
+
if (workspaceContext.isPathWithinWorkspace(filePath) || isSubpaths(allowedRoots, filePath) || // isAnyAutoMemPath narrows to the managed auto-memory roots
|
|
15699
|
+
// (per-project + user-level under ~/.qwen/memories/) — never the
|
|
15700
|
+
// broad getMemoryBaseDir() — to avoid exposing sensitive ~/.qwen
|
|
15701
|
+
// files such as settings.json or OAuth credentials.
|
|
15702
|
+
isAnyAutoMemPath(filePath, config.getTargetDir())) {
|
|
15703
|
+
return "allow";
|
|
15704
|
+
}
|
|
15705
|
+
return "ask";
|
|
15706
|
+
}
|
|
15707
|
+
__name(getFileReadDefaultPermission, "getFileReadDefaultPermission");
|
|
15708
|
+
|
|
15305
15709
|
// packages/core/src/services/visionBridge/vision-bridge-service.ts
|
|
15306
15710
|
init_esbuild_shims();
|
|
15307
15711
|
|
|
@@ -15503,77 +15907,9 @@ async function runSideQuery(config, options) {
|
|
|
15503
15907
|
}
|
|
15504
15908
|
__name(runSideQuery, "runSideQuery");
|
|
15505
15909
|
|
|
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
15910
|
// packages/core/src/services/visionBridge/vision-bridge-service.ts
|
|
15576
15911
|
var debugLogger7 = createDebugLogger("VISION_BRIDGE");
|
|
15912
|
+
var turnImageCounts = /* @__PURE__ */ new WeakMap();
|
|
15577
15913
|
var BRIDGE_MAX_OUTPUT_TOKENS = 2048;
|
|
15578
15914
|
var VISION_BRIDGE_TIMEOUT_MS = 3e4;
|
|
15579
15915
|
var VISION_BRIDGE_MAX_ATTEMPTS = 2;
|
|
@@ -15730,8 +16066,10 @@ function formatFullTurnVisionNotice(selection) {
|
|
|
15730
16066
|
return `Routing this image turn to ${target}; retries and tool continuations will stay on that model until the turn ends.`;
|
|
15731
16067
|
}
|
|
15732
16068
|
__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.` :
|
|
16069
|
+
function buildIntentPart(intentText, sourceContext, imageParts = []) {
|
|
16070
|
+
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(
|
|
16071
|
+
(part, index) => `${index + 1}. ${JSON.stringify(part.inlineData?.displayName?.trim() || `image ${index + 1}`)}`
|
|
16072
|
+
).join("; ")}.` : "";
|
|
15735
16073
|
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
16074
|
return sourceHint ? `${sourceHint}
|
|
15737
16075
|
${focusHint}` : focusHint;
|
|
@@ -15779,7 +16117,7 @@ function failure(reason, parts, omittedCount, extra = {}) {
|
|
|
15779
16117
|
}
|
|
15780
16118
|
__name(failure, "failure");
|
|
15781
16119
|
async function runVisionBridge(params) {
|
|
15782
|
-
const { config, parts, signal, sourceContext } = params;
|
|
16120
|
+
const { config, parts, signal, sourceContext, intentText } = params;
|
|
15783
16121
|
const { imageParts, nonImageParts } = splitImageParts(parts);
|
|
15784
16122
|
if (imageParts.length === 0) {
|
|
15785
16123
|
return {
|
|
@@ -15790,9 +16128,14 @@ async function runVisionBridge(params) {
|
|
|
15790
16128
|
};
|
|
15791
16129
|
}
|
|
15792
16130
|
const validImages = imageParts.filter(isUsableImagePart);
|
|
15793
|
-
const
|
|
16131
|
+
const usedImages = turnImageCounts.get(signal) ?? 0;
|
|
16132
|
+
const remainingImages = Math.max(0, VISION_BRIDGE_MAX_IMAGES - usedImages);
|
|
16133
|
+
const toConvert = validImages.slice(0, remainingImages);
|
|
15794
16134
|
const omittedCount = imageParts.length - toConvert.length;
|
|
15795
|
-
const intent = collectText(nonImageParts).slice(
|
|
16135
|
+
const intent = (intentText ?? collectText(nonImageParts)).slice(
|
|
16136
|
+
0,
|
|
16137
|
+
BRIDGE_INTENT_MAX_CHARS
|
|
16138
|
+
);
|
|
15796
16139
|
const resolvedSourceContext = sourceContext ?? inferPdfSourceContext(toConvert);
|
|
15797
16140
|
const selection = config.getDefaultVisionBridgeModel?.();
|
|
15798
16141
|
const modelId = selection?.id;
|
|
@@ -15814,13 +16157,14 @@ async function runVisionBridge(params) {
|
|
|
15814
16157
|
{ modelId, ...modelEndpoint && { modelEndpoint } }
|
|
15815
16158
|
);
|
|
15816
16159
|
}
|
|
16160
|
+
turnImageCounts.set(signal, usedImages + toConvert.length);
|
|
15817
16161
|
const timeoutMs = config.getVisionBridgeTimeoutMs?.() ?? VISION_BRIDGE_TIMEOUT_MS;
|
|
15818
16162
|
const requestContents = [
|
|
15819
16163
|
{
|
|
15820
16164
|
role: "user",
|
|
15821
16165
|
parts: [
|
|
15822
16166
|
...toConvert,
|
|
15823
|
-
{ text: buildIntentPart(intent, resolvedSourceContext) }
|
|
16167
|
+
{ text: buildIntentPart(intent, resolvedSourceContext, toConvert) }
|
|
15824
16168
|
]
|
|
15825
16169
|
}
|
|
15826
16170
|
];
|
|
@@ -15955,29 +16299,13 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
15955
16299
|
* Returns 'ask' for paths outside the workspace/temp/userSkills directories,
|
|
15956
16300
|
* so that external file reads require user confirmation.
|
|
15957
16301
|
*/
|
|
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";
|
|
16302
|
+
getDefaultPermission() {
|
|
16303
|
+
return Promise.resolve(
|
|
16304
|
+
getFileReadDefaultPermission(this.config, this.params.file_path)
|
|
16305
|
+
);
|
|
15978
16306
|
}
|
|
15979
16307
|
async execute(signal) {
|
|
15980
|
-
const absPath =
|
|
16308
|
+
const absPath = path9.resolve(this.params.file_path);
|
|
15981
16309
|
const projectRoot = this.config.getTargetDir();
|
|
15982
16310
|
const isAutoMem = isAnyAutoMemPath(absPath, projectRoot);
|
|
15983
16311
|
const cacheEnabled = !this.config.getFileReadCacheDisabled();
|
|
@@ -15986,7 +16314,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
15986
16314
|
const isFullRead = this.params.offset === void 0 && this.params.limit === void 0 && this.params.pages === void 0;
|
|
15987
16315
|
let stats;
|
|
15988
16316
|
try {
|
|
15989
|
-
stats = await
|
|
16317
|
+
stats = await fs7.stat(absPath);
|
|
15990
16318
|
} catch (err) {
|
|
15991
16319
|
debugLogger8.debug("stat-failed", {
|
|
15992
16320
|
path: absPath,
|
|
@@ -16003,7 +16331,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
16003
16331
|
}
|
|
16004
16332
|
debugLogger8.debug("miss", { path: absPath, state: status.state });
|
|
16005
16333
|
}
|
|
16006
|
-
const
|
|
16334
|
+
const prepareForVisionBridge = shouldRunVisionBridge(this.config);
|
|
16007
16335
|
let result = await processSingleFileContent(
|
|
16008
16336
|
this.params.file_path,
|
|
16009
16337
|
this.config,
|
|
@@ -16011,7 +16339,8 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
|
|
|
16011
16339
|
offset: this.params.offset,
|
|
16012
16340
|
limit: this.params.limit,
|
|
16013
16341
|
pages: this.params.pages,
|
|
16014
|
-
|
|
16342
|
+
preserveUnsupportedImage: prepareForVisionBridge,
|
|
16343
|
+
preparePdfForVisionBridge: prepareForVisionBridge,
|
|
16015
16344
|
signal
|
|
16016
16345
|
}
|
|
16017
16346
|
);
|
|
@@ -16051,7 +16380,7 @@ ${result.llmContent}`;
|
|
|
16051
16380
|
}
|
|
16052
16381
|
if (typeof llmContent === "string" && isAutoMem) {
|
|
16053
16382
|
try {
|
|
16054
|
-
const memStat = stats ?? await
|
|
16383
|
+
const memStat = stats ?? await fs7.stat(absPath);
|
|
16055
16384
|
const note = memoryFreshnessNote(memStat.mtimeMs);
|
|
16056
16385
|
if (note) {
|
|
16057
16386
|
llmContent = note + llmContent;
|
|
@@ -16071,7 +16400,7 @@ ${result.llmContent}`;
|
|
|
16071
16400
|
"read" /* READ */,
|
|
16072
16401
|
lines,
|
|
16073
16402
|
mimetype,
|
|
16074
|
-
|
|
16403
|
+
path9.extname(this.params.file_path),
|
|
16075
16404
|
programming_language
|
|
16076
16405
|
)
|
|
16077
16406
|
);
|
|
@@ -16274,7 +16603,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
|
|
|
16274
16603
|
if (!filePath) {
|
|
16275
16604
|
return "The 'file_path' parameter must be non-empty.";
|
|
16276
16605
|
}
|
|
16277
|
-
if (!
|
|
16606
|
+
if (!path9.isAbsolute(filePath)) {
|
|
16278
16607
|
return `File path must be absolute, but was relative: ${filePath}. You must provide an absolute path.`;
|
|
16279
16608
|
}
|
|
16280
16609
|
if (params.offset !== void 0 && (!Number.isInteger(params.offset) || params.offset < 0)) {
|
|
@@ -16287,7 +16616,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
|
|
|
16287
16616
|
const pages = params.pages.trim();
|
|
16288
16617
|
params.pages = pages.length > 0 ? pages : void 0;
|
|
16289
16618
|
}
|
|
16290
|
-
const ext =
|
|
16619
|
+
const ext = path9.extname(filePath).toLowerCase();
|
|
16291
16620
|
if ((params.offset !== void 0 || params.limit !== void 0) && ext === ".ipynb") {
|
|
16292
16621
|
return "offset and limit are not supported for Jupyter notebook (.ipynb) files. Notebooks are always read in full with structured cell output.";
|
|
16293
16622
|
}
|
|
@@ -16327,13 +16656,10 @@ export {
|
|
|
16327
16656
|
isImagePart,
|
|
16328
16657
|
hasImageParts,
|
|
16329
16658
|
splitImageParts,
|
|
16330
|
-
replaceImagesWithText,
|
|
16331
|
-
isUsableImagePart,
|
|
16332
16659
|
collectText,
|
|
16333
16660
|
isImageCapable,
|
|
16334
16661
|
isFullTurnVisionCapable,
|
|
16335
16662
|
getQualifiedVisionModelId,
|
|
16336
|
-
getVisionModelSelector,
|
|
16337
16663
|
getFullTurnVisionModelSelector,
|
|
16338
16664
|
selectVisionBridgeModel,
|
|
16339
16665
|
shouldRunVisionBridge,
|
|
@@ -16344,41 +16670,30 @@ export {
|
|
|
16344
16670
|
runVisionBridge,
|
|
16345
16671
|
MAIN_SOURCE,
|
|
16346
16672
|
subagentNameContext,
|
|
16673
|
+
isInternalPromptId,
|
|
16347
16674
|
UiTelemetryService,
|
|
16348
16675
|
uiTelemetryService,
|
|
16349
|
-
isInternalPromptId,
|
|
16350
|
-
sanitizeHookName,
|
|
16351
16676
|
import_lru_cache,
|
|
16352
|
-
QwenLogger,
|
|
16353
16677
|
apiActivityTracker,
|
|
16354
16678
|
_recoverObjectsFromLine,
|
|
16355
16679
|
parseLineTolerant,
|
|
16356
16680
|
readLines,
|
|
16357
16681
|
read,
|
|
16358
|
-
_resetEnsuredDirsCacheForTest,
|
|
16359
16682
|
writeLine,
|
|
16360
16683
|
writeLineSync,
|
|
16361
|
-
write,
|
|
16362
|
-
countLines,
|
|
16363
16684
|
exists,
|
|
16364
|
-
getTokenUsageFilePath,
|
|
16365
|
-
apiResponseEventToTokenUsageRecord,
|
|
16366
|
-
recordTokenUsageFromApiResponse,
|
|
16367
|
-
recordTokenUsageFromApiResponseBestEffort,
|
|
16368
16685
|
queryTokenUsage,
|
|
16369
16686
|
formatTokenUsageSummaryAsCsv,
|
|
16370
16687
|
formatTokenUsageSummaryAsJson,
|
|
16371
|
-
exportTokenUsageSummary,
|
|
16372
16688
|
runWithChatRecordingSuppressed,
|
|
16373
16689
|
logStartSession,
|
|
16374
16690
|
logUserPrompt,
|
|
16375
16691
|
logUserRetry,
|
|
16376
16692
|
logToolCall,
|
|
16377
|
-
logToolOutputTruncated,
|
|
16378
16693
|
logFileOperation,
|
|
16379
16694
|
logApiRequest,
|
|
16380
|
-
logFlashFallback,
|
|
16381
16695
|
logRipgrepFallback,
|
|
16696
|
+
logRipgrepRuntimeRecovery,
|
|
16382
16697
|
logApiError,
|
|
16383
16698
|
logApiCancel,
|
|
16384
16699
|
logApiResponse,
|
|
@@ -16417,31 +16732,16 @@ export {
|
|
|
16417
16732
|
logMemoryDream,
|
|
16418
16733
|
logMemoryRecall,
|
|
16419
16734
|
logMemoryRecallDelivery,
|
|
16420
|
-
iconvEncode,
|
|
16421
|
-
iconvEncodingExists,
|
|
16422
16735
|
isUtf8CompatibleEncoding,
|
|
16423
|
-
|
|
16424
|
-
AGENT_CONTEXT_FILENAME,
|
|
16736
|
+
loadIconvLite,
|
|
16425
16737
|
LOCAL_CONTEXT_FILENAME,
|
|
16426
16738
|
MEMORY_SECTION_HEADER,
|
|
16427
16739
|
setGeminiMdFilename,
|
|
16428
16740
|
getCurrentGeminiMdFilename,
|
|
16429
16741
|
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
16742
|
FileExclusions,
|
|
16438
|
-
extractExtensionsFromPatterns,
|
|
16439
|
-
BINARY_EXTENSIONS,
|
|
16440
|
-
resetEncodingCache,
|
|
16441
16743
|
getCachedEncodingForBuffer,
|
|
16442
16744
|
getSystemEncoding,
|
|
16443
|
-
windowsCodePageToEncoding,
|
|
16444
|
-
detectEncodingFromBuffer,
|
|
16445
16745
|
extractPDFText,
|
|
16446
16746
|
normalizeSource,
|
|
16447
16747
|
parseNotebook,
|
|
@@ -16456,24 +16756,21 @@ export {
|
|
|
16456
16756
|
inferInsertedCellSourceArrayStyle,
|
|
16457
16757
|
toNotebookSource,
|
|
16458
16758
|
normalizeEditedCell,
|
|
16459
|
-
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
countFileLines,
|
|
16759
|
+
LargeNonUtf8TextError,
|
|
16760
|
+
readTextRange,
|
|
16761
|
+
ImageViewError,
|
|
16762
|
+
renderNormalizedImageCrop,
|
|
16763
|
+
decodeBufferWithEncodingInfoAsync,
|
|
16465
16764
|
readFileWithLineAndLimit,
|
|
16466
|
-
detectFileEncoding,
|
|
16467
16765
|
getSpecificMimeType,
|
|
16468
16766
|
isWithinRoot,
|
|
16469
|
-
isBinaryFile,
|
|
16470
|
-
detectFileType,
|
|
16471
16767
|
isCacheableReadResult,
|
|
16472
16768
|
processSingleFileContent,
|
|
16473
16769
|
fileExists,
|
|
16474
16770
|
getLanguageFromFilePath,
|
|
16475
16771
|
memoryAge,
|
|
16476
16772
|
memoryFreshnessText,
|
|
16773
|
+
getFileReadDefaultPermission,
|
|
16477
16774
|
ReadFileTool,
|
|
16478
16775
|
MAX_SESSION_BYTES,
|
|
16479
16776
|
TOOL_OUTPUT_TRUNCATED_PREFIX,
|
|
@@ -16482,7 +16779,6 @@ export {
|
|
|
16482
16779
|
isAlreadyTruncated,
|
|
16483
16780
|
normalizeToolResultCallId,
|
|
16484
16781
|
persistAndTruncateToolResult,
|
|
16485
|
-
MCPServerStatus,
|
|
16486
16782
|
addMCPStatusChangeListener,
|
|
16487
16783
|
removeMCPStatusChangeListener,
|
|
16488
16784
|
updateMCPServerStatus,
|
|
@@ -16496,9 +16792,7 @@ export {
|
|
|
16496
16792
|
runWithInvocationContext,
|
|
16497
16793
|
getInvocationContext,
|
|
16498
16794
|
DiscoveredMCPTool,
|
|
16499
|
-
generateValidName,
|
|
16500
16795
|
StartSessionEvent,
|
|
16501
|
-
EndSessionEvent,
|
|
16502
16796
|
UserPromptEvent,
|
|
16503
16797
|
UserRetryEvent,
|
|
16504
16798
|
ToolCallEvent,
|
|
@@ -16506,16 +16800,13 @@ export {
|
|
|
16506
16800
|
ApiErrorEvent,
|
|
16507
16801
|
ApiCancelEvent,
|
|
16508
16802
|
ApiResponseEvent,
|
|
16509
|
-
FlashFallbackEvent,
|
|
16510
16803
|
RipgrepFallbackEvent,
|
|
16511
|
-
|
|
16804
|
+
RipgrepRuntimeRecoveryEvent,
|
|
16512
16805
|
LoopDetectedEvent,
|
|
16513
16806
|
LoopDetectionDisabledEvent,
|
|
16514
16807
|
NextSpeakerCheckEvent,
|
|
16515
16808
|
makeSlashCommandEvent,
|
|
16516
|
-
SlashCommandStatus,
|
|
16517
16809
|
makeChatCompressionEvent,
|
|
16518
|
-
IdeConnectionType,
|
|
16519
16810
|
IdeConnectionEvent,
|
|
16520
16811
|
ConversationFinishedEvent,
|
|
16521
16812
|
KittySequenceOverflowEvent,
|
|
@@ -16525,7 +16816,6 @@ export {
|
|
|
16525
16816
|
ApiRetryEvent,
|
|
16526
16817
|
ContentRetryFailureEvent,
|
|
16527
16818
|
ExtensionInstallEvent,
|
|
16528
|
-
ToolOutputTruncatedEvent,
|
|
16529
16819
|
ExtensionUninstallEvent,
|
|
16530
16820
|
ExtensionUpdateEvent,
|
|
16531
16821
|
ExtensionEnableEvent,
|
|
@@ -16534,7 +16824,6 @@ export {
|
|
|
16534
16824
|
AuthEvent,
|
|
16535
16825
|
HookCallEvent,
|
|
16536
16826
|
SkillLaunchEvent,
|
|
16537
|
-
UserFeedbackRating,
|
|
16538
16827
|
UserFeedbackEvent,
|
|
16539
16828
|
makeArenaSessionStartedEvent,
|
|
16540
16829
|
makeArenaAgentCompletedEvent,
|
|
@@ -16549,6 +16838,11 @@ export {
|
|
|
16549
16838
|
MemoryRecallEvent,
|
|
16550
16839
|
MemoryRecallDeliveryEvent
|
|
16551
16840
|
};
|
|
16841
|
+
/**
|
|
16842
|
+
* @license
|
|
16843
|
+
* Copyright 2026 Qwen Team
|
|
16844
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16845
|
+
*/
|
|
16552
16846
|
/**
|
|
16553
16847
|
* @license
|
|
16554
16848
|
* Copyright 2025 Google LLC
|
|
@@ -16561,7 +16855,7 @@ export {
|
|
|
16561
16855
|
*/
|
|
16562
16856
|
/**
|
|
16563
16857
|
* @license
|
|
16564
|
-
* Copyright 2026 Qwen
|
|
16858
|
+
* Copyright 2026 Qwen
|
|
16565
16859
|
* SPDX-License-Identifier: Apache-2.0
|
|
16566
16860
|
*/
|
|
16567
16861
|
/**
|