anyfile-cli 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/README.md +55 -2
- package/SKILL.md +101 -0
- package/chunks/browser-probe-5STDX455.mjs +17 -0
- package/chunks/browser-probe-F5RX44T3.mjs +24 -0
- package/chunks/chunk-2C34VMNV.mjs +108 -0
- package/chunks/chunk-3OZ56PUH.mjs +97 -0
- package/chunks/chunk-3YRWCQGV.mjs +38 -0
- package/chunks/chunk-53MJMIN4.mjs +23 -0
- package/chunks/chunk-5LOC7IST.mjs +372 -0
- package/chunks/chunk-5XTYLZF3.mjs +559 -0
- package/chunks/chunk-5ZHDYRGV.mjs +64 -0
- package/chunks/chunk-6CQL4K2K.mjs +21 -0
- package/chunks/chunk-6EVJJFOH.mjs +243 -0
- package/chunks/chunk-6NWSQGYE.mjs +68 -0
- package/chunks/chunk-7O5JLQE7.mjs +1 -0
- package/chunks/chunk-A6AQI6DF.mjs +321 -0
- package/chunks/chunk-AYF63UBE.mjs +79 -0
- package/chunks/chunk-B27PR6Q4.mjs +17 -0
- package/chunks/chunk-BP7LORL4.mjs +13 -0
- package/chunks/chunk-BVCRJLCD.mjs +109 -0
- package/chunks/chunk-CLSEE3VA.mjs +28 -0
- package/chunks/chunk-CO2ZAQIK.mjs +52 -0
- package/chunks/chunk-CQWM5GMU.mjs +167 -0
- package/chunks/chunk-CZFFYCMJ.mjs +136 -0
- package/chunks/chunk-D3CS6TIK.mjs +419 -0
- package/chunks/chunk-DJLFVMDJ.mjs +807 -0
- package/chunks/chunk-DJXVCKIO.mjs +30 -0
- package/chunks/chunk-EMXODK3K.mjs +94 -0
- package/chunks/chunk-EOJ7ZCDK.mjs +227 -0
- package/chunks/chunk-H4TBN22D.mjs +100 -0
- package/chunks/chunk-HI7TURZM.mjs +2256 -0
- package/chunks/chunk-HUSX3ZU3.mjs +58 -0
- package/chunks/chunk-IC3G2XE2.mjs +436 -0
- package/chunks/chunk-IGEGIF35.mjs +2034 -0
- package/chunks/chunk-IZGTVZHE.mjs +90 -0
- package/chunks/chunk-J4G7LUPA.mjs +117 -0
- package/chunks/chunk-JBAJW66L.mjs +4220 -0
- package/chunks/chunk-JKQUF2MM.mjs +438 -0
- package/chunks/chunk-KAMPC5TK.mjs +131 -0
- package/chunks/chunk-KSKEMJVC.mjs +145 -0
- package/chunks/chunk-LRHHRZLE.mjs +29 -0
- package/chunks/chunk-M37ZOAUG.mjs +93 -0
- package/chunks/chunk-MG7LUDXO.mjs +187 -0
- package/chunks/chunk-NGVHHTQD.mjs +125 -0
- package/chunks/chunk-NQ7J2NH6.mjs +50 -0
- package/chunks/chunk-NUMNHVSI.mjs +60 -0
- package/chunks/chunk-ORJ3DN65.mjs +58 -0
- package/chunks/chunk-QOUEBPPL.mjs +15 -0
- package/chunks/chunk-QR3Y3UKM.mjs +194 -0
- package/chunks/chunk-RFKYE7SE.mjs +50 -0
- package/chunks/chunk-SH57XOAV.mjs +33 -0
- package/chunks/chunk-TB5ISPA4.mjs +1 -0
- package/chunks/chunk-UGAU3V4V.mjs +206 -0
- package/chunks/chunk-WDN6NMVU.mjs +36 -0
- package/chunks/chunk-WWTLSPEG.mjs +3999 -0
- package/chunks/chunk-XDW56XVX.mjs +69 -0
- package/chunks/chunk-XRT7TAAY.mjs +27 -0
- package/chunks/chunk-XTW4HNIJ.mjs +418 -0
- package/chunks/chunk-YPLWNGCC.mjs +17 -0
- package/chunks/chunk-ZBR7RQQE.mjs +64 -0
- package/chunks/chunk-ZUHJIGHP.mjs +300 -0
- package/chunks/deflate-IINN6MRE.mjs +19 -0
- package/chunks/jpeg-N3DSYEAQ.mjs +964 -0
- package/chunks/jxl_oxide_wasm-3UN6G3YN.mjs +589 -0
- package/chunks/lerc-5LP7Q554.mjs +2086 -0
- package/chunks/lzw-Z2ZZBEWD.mjs +137 -0
- package/chunks/packbits-3S2JASDB.mjs +34 -0
- package/chunks/pdf.worker-PUGU2NS2.mjs +67416 -0
- package/chunks/probe-22WNVZ3I.mjs +17 -0
- package/chunks/probe-2P4CTFCY.mjs +14 -0
- package/chunks/probe-2QBNDPYK.mjs +18 -0
- package/chunks/probe-34TOVXUI.mjs +11 -0
- package/chunks/probe-3W2HOWBM.mjs +20 -0
- package/chunks/probe-42OBMD35.mjs +23 -0
- package/chunks/probe-43RVHUBG.mjs +17 -0
- package/chunks/probe-4O362IEX.mjs +18 -0
- package/chunks/probe-4WF34ZXS.mjs +11 -0
- package/chunks/probe-5ZITS3T5.mjs +40 -0
- package/chunks/probe-5ZS5DHFP.mjs +21 -0
- package/chunks/probe-62RFYKCP.mjs +14 -0
- package/chunks/probe-64JTFRH4.mjs +41 -0
- package/chunks/probe-6YJQJJ3R.mjs +518 -0
- package/chunks/probe-6YMOOV53.mjs +39 -0
- package/chunks/probe-BYBD2WAK.mjs +239 -0
- package/chunks/probe-CZZNJOHV.mjs +20 -0
- package/chunks/probe-DJMPK6HU.mjs +11 -0
- package/chunks/probe-FMWIF4LX.mjs +33 -0
- package/chunks/probe-FYPH6CYY.mjs +206 -0
- package/chunks/probe-G6PPXKBE.mjs +15 -0
- package/chunks/probe-GJ5OUOQ3.mjs +32 -0
- package/chunks/probe-H6J7TUY2.mjs +95 -0
- package/chunks/probe-IGZ47OE3.mjs +68 -0
- package/chunks/probe-IL5HO3OK.mjs +46 -0
- package/chunks/probe-INYCDZHO.mjs +27 -0
- package/chunks/probe-JFH545GO.mjs +11 -0
- package/chunks/probe-JZYDRITV.mjs +18 -0
- package/chunks/probe-K3WW5O5K.mjs +26 -0
- package/chunks/probe-KB4T466L.mjs +70 -0
- package/chunks/probe-KY7SIIXD.mjs +13 -0
- package/chunks/probe-L2P263WT.mjs +16 -0
- package/chunks/probe-LEP3RQPD.mjs +11 -0
- package/chunks/probe-M2QWULOI.mjs +119 -0
- package/chunks/probe-M7AYZBD3.mjs +35 -0
- package/chunks/probe-MEN3BMBB.mjs +22 -0
- package/chunks/probe-MNIGKDWT.mjs +163 -0
- package/chunks/probe-NFVFWB4M.mjs +56 -0
- package/chunks/probe-NJGSTL6R.mjs +161 -0
- package/chunks/probe-O73EHWT3.mjs +14 -0
- package/chunks/probe-OG2XYCG2.mjs +25 -0
- package/chunks/probe-OTKJKTNS.mjs +10 -0
- package/chunks/probe-OZKO3C2V.mjs +27 -0
- package/chunks/probe-PBL4KITG.mjs +12 -0
- package/chunks/probe-PEFZNH2T.mjs +21 -0
- package/chunks/probe-R4SSEXES.mjs +27 -0
- package/chunks/probe-RCAUVV27.mjs +29 -0
- package/chunks/probe-RPGBKGPI.mjs +20 -0
- package/chunks/probe-S2I46SEO.mjs +10 -0
- package/chunks/probe-SGDD4U4Q.mjs +165 -0
- package/chunks/probe-SPQO5LHI.mjs +9 -0
- package/chunks/probe-TBR6UGRZ.mjs +19 -0
- package/chunks/probe-TNKNILAW.mjs +21 -0
- package/chunks/probe-TVRJBPXH.mjs +48 -0
- package/chunks/probe-UESMTUQ5.mjs +33 -0
- package/chunks/probe-VDXFEZ5Q.mjs +16 -0
- package/chunks/probe-VX7JCDW6.mjs +39 -0
- package/chunks/probe-W7M55OPE.mjs +64 -0
- package/chunks/probe-XUBTIWGE.mjs +13 -0
- package/chunks/probe-ZF7KIRHO.mjs +36 -0
- package/chunks/raw-JJRPYAXO.mjs +16 -0
- package/chunks/tiff-metadata-7MWLNVW2.mjs +2990 -0
- package/chunks/webimage-D6XSCCTJ.mjs +56 -0
- package/chunks/zip-reader-YUGANW4Z.mjs +92 -0
- package/chunks/zstd-AH2S24PU.mjs +121 -0
- package/cli-main.mjs +297 -0
- package/cli.mjs +3 -0
- package/extractors/apple-plist.mjs +145 -0
- package/extractors/archive-metadata-viewer.mjs +1401 -0
- package/extractors/bittorrent-metadata.mjs +369 -0
- package/extractors/calendar-contacts.mjs +328 -0
- package/extractors/camera-raw.mjs +201 -0
- package/extractors/chm-reader.mjs +1842 -0
- package/extractors/comic-book-reader.mjs +307 -0
- package/extractors/design-source.mjs +1801 -0
- package/extractors/dev-array-viewer.mjs +825 -0
- package/extractors/dev-native-binary-viewer.mjs +1661 -0
- package/extractors/dev-source-map-viewer.mjs +416 -0
- package/extractors/dev-wasm-viewer.mjs +506 -0
- package/extractors/dicom.mjs +383 -0
- package/extractors/djvu-reader.mjs +337 -0
- package/extractors/duckdb-data.mjs +49174 -0
- package/extractors/epub-reader.mjs +222 -0
- package/extractors/excel-workbook.mjs +27057 -0
- package/extractors/fictionbook-reader.mjs +362 -0
- package/extractors/font-viewer.mjs +441 -0
- package/extractors/general-raster.mjs +444 -0
- package/extractors/hdr-image.mjs +1685 -0
- package/extractors/http-archive.mjs +306 -0
- package/extractors/ifc.mjs +341 -0
- package/extractors/iwork.mjs +640 -0
- package/extractors/microsoft-project.mjs +174 -0
- package/extractors/mind-map.mjs +607 -0
- package/extractors/ml-weights.mjs +649 -0
- package/extractors/modern-raster.mjs +620 -0
- package/extractors/ofd-reader.mjs +973 -0
- package/extractors/outlook-pst.mjs +997 -0
- package/extractors/pdfjs-pdf.mjs +32056 -0
- package/extractors/photoshop-document.mjs +17448 -0
- package/extractors/safe-svg.mjs +163 -0
- package/extractors/scientific-data.mjs +2041 -0
- package/extractors/sqlite-database.mjs +333 -0
- package/extractors/statistical-data.mjs +297 -0
- package/extractors/visio.mjs +141 -0
- package/extractors/x509-certificate.mjs +588 -0
- package/extractors/xps-reader.mjs +896 -0
- package/index.mjs +83 -0
- package/licenses/dicom-parser/1.8.21/LICENSE +21 -0
- package/licenses/libraw-wasm/1.6.0/COPYRIGHT.LibRaw +27 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.Emscripten +102 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.LibRaw-CDDL-1.0 +340 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.Little-CMS-MIT +22 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.libpng +134 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.libraw-wasm-ISC +15 -0
- package/licenses/libraw-wasm/1.6.0/LICENSE.zlib +22 -0
- package/licenses/libraw-wasm/1.6.0/NOTICE.IJG-libjpeg +49 -0
- package/licenses/libraw-wasm/1.6.0/SOURCE.md +25 -0
- package/licenses/libraw-wasm/1.6.0/THIRD_PARTY_NOTICES.md +14 -0
- package/licenses/mediabunny/1.55.3/MPL-2.0.txt +373 -0
- package/licenses/mediabunny/1.55.3/SOURCE.md +16 -0
- package/licenses/openskp/1.3.0/LICENSE +21 -0
- package/package.json +34 -4
- package/renderer-host/assets/ColladaComposer-TCm9fgZa.js +1 -0
- package/renderer-host/assets/ColladaParser-BHTzbhBz.js +3 -0
- package/renderer-host/assets/FBXLoader-D1vDnL3o.js +8 -0
- package/renderer-host/assets/agent-CKvDbj87.js +1 -0
- package/renderer-host/assets/amf-BkE--DNX.js +1 -0
- package/renderer-host/assets/animation-Dt0WW2cB.js +1 -0
- package/renderer-host/assets/archive-client-CL5yOgwH.js +1 -0
- package/renderer-host/assets/archive.worker-CcLnJ9FC.js +1 -0
- package/renderer-host/assets/audio-visualizer-CiyGNhY2.js +1 -0
- package/renderer-host/assets/basedecoder-BuG7fe0q.js +1 -0
- package/renderer-host/assets/book-source-28BQcBKR.js +1 -0
- package/renderer-host/assets/book-worker-DUt14LJO.js +1 -0
- package/renderer-host/assets/browser-C0pGRq_c.js +1 -0
- package/renderer-host/assets/client-CU2ERPtk.js +1 -0
- package/renderer-host/assets/container-inspection-ekEPWWcy.js +1 -0
- package/renderer-host/assets/data-table-OJQe3aN5.js +1 -0
- package/renderer-host/assets/decode-hBroL8C1.js +1 -0
- package/renderer-host/assets/decode-tiff-CP1xdrF_.js +5 -0
- package/renderer-host/assets/decoder-worker-B0sdTVlF.js +1 -0
- package/renderer-host/assets/decoder-worker-CBiHE971.js +3 -0
- package/renderer-host/assets/decoder-worker-Cr5oP97p.js +5 -0
- package/renderer-host/assets/decoder-worker-DIdLFebY.js +11 -0
- package/renderer-host/assets/decoder-worker-DLeuEYxq.js +1 -0
- package/renderer-host/assets/decoder.worker-BXAaF0Qj.js +1 -0
- package/renderer-host/assets/decoder.worker-yaM6uups.js +1 -0
- package/renderer-host/assets/deflate-DPjr4M2G.js +1 -0
- package/renderer-host/assets/deflate-S3QmZI-f.js +1 -0
- package/renderer-host/assets/dual-track-playback-CxjGms-W.js +1 -0
- package/renderer-host/assets/ext-searchbox-BIdon51Z.js +164 -0
- package/renderer-host/assets/ffmpeg-playback-DzCJz9Ny.js +1 -0
- package/renderer-host/assets/gltf-PozNLKNg.js +1 -0
- package/renderer-host/assets/hdf5.worker-BO3TrRup.js +1 -0
- package/renderer-host/assets/heif-worker-CC9DI3ZR.js +1 -0
- package/renderer-host/assets/id3-uzaDmDwy.js +1 -0
- package/renderer-host/assets/ifc.worker-KIbgAIsy.js +1 -0
- package/renderer-host/assets/image-load-SK3ULGWm.js +1 -0
- package/renderer-host/assets/index-DtiyOy_J.js +2 -0
- package/renderer-host/assets/jpeg-AGQ46WDa.js +1 -0
- package/renderer-host/assets/jpeg-Dm0yBuYB.js +1 -0
- package/renderer-host/assets/jszip.min-DCdQ6XWv.js +2 -0
- package/renderer-host/assets/jxl_oxide_wasm-BJKDqoXP.js +1 -0
- package/renderer-host/assets/jxl_oxide_wasm_bg-C5JqlrFv.wasm +0 -0
- package/renderer-host/assets/kernel.worker-B58X9XWu.js +1 -0
- package/renderer-host/assets/kernel.worker-BcQYKb39.js +8 -0
- package/renderer-host/assets/kernel.worker-BdWmPdqg.js +1 -0
- package/renderer-host/assets/kernel.worker-C7qxomuK.js +1 -0
- package/renderer-host/assets/kernel.worker-D88TbQnz.js +1 -0
- package/renderer-host/assets/laz-Lt10LsWd.js +1 -0
- package/renderer-host/assets/lerc-BxVqCKaH.js +3 -0
- package/renderer-host/assets/lerc-Cuor-Zm2.js +1 -0
- package/renderer-host/assets/lzw-D2FslT4L.js +1 -0
- package/renderer-host/assets/lzw-DODNa9l5.js +1 -0
- package/renderer-host/assets/mediabunny-viewer-BniHVEWJ.js +16 -0
- package/renderer-host/assets/model-Drd3vqcF.js +1 -0
- package/renderer-host/assets/obj-B3p81LL2.js +9 -0
- package/renderer-host/assets/off-QQbiKPTX.js +1 -0
- package/renderer-host/assets/ogg-probe-C2TT74FL.js +1 -0
- package/renderer-host/assets/ogg-viewer-Dc8K-tas.js +9 -0
- package/renderer-host/assets/packbits-DCimUQ1T.js +1 -0
- package/renderer-host/assets/paged-C8AQD7sX.js +319 -0
- package/renderer-host/assets/pako.esm-0UYEm1Jg.js +2 -0
- package/renderer-host/assets/pako.esm-CtVA0R7W.js +1 -0
- package/renderer-host/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
- package/renderer-host/assets/ply-C3_RRA7n.js +2 -0
- package/renderer-host/assets/points.worker-CA8v75dl.js +2 -0
- package/renderer-host/assets/probe-asf-C_UpCBly.js +14 -0
- package/renderer-host/assets/range-reader-BMfLhWcp.js +1 -0
- package/renderer-host/assets/raw-A-vJRPpa.js +1 -0
- package/renderer-host/assets/resource-cache-CHocY8K3.js +1 -0
- package/renderer-host/assets/resources-6AmS6O5e.js +1 -0
- package/renderer-host/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/renderer-host/assets/safe-content-CWHf8jex.js +1 -0
- package/renderer-host/assets/sanitize-D56ODnaM.js +1 -0
- package/renderer-host/assets/scene-adapter-CaCLr1am.js +1 -0
- package/renderer-host/assets/scene.worker-CJViWLYo.js +24 -0
- package/renderer-host/assets/scene.worker-D7koFZY8.js +2 -0
- package/renderer-host/assets/skp-adapter-jl6q24fW.js +1 -0
- package/renderer-host/assets/skp.worker-D9ujTXFV.js +1 -0
- package/renderer-host/assets/src-1Won7FxU.js +88 -0
- package/renderer-host/assets/src-3RoHqOkA.js +7 -0
- package/renderer-host/assets/src-4zBOL6Jt.js +1 -0
- package/renderer-host/assets/src-6v8-hoR3.js +24 -0
- package/renderer-host/assets/src-8Jx9gbII.js +1 -0
- package/renderer-host/assets/src-B1WA0dRu.js +64 -0
- package/renderer-host/assets/src-B5ijbemo.js +9 -0
- package/renderer-host/assets/src-B8DH2GJe.js +17 -0
- package/renderer-host/assets/src-B9t_iEO3.js +58 -0
- package/renderer-host/assets/src-BCC58C0X.js +1 -0
- package/renderer-host/assets/src-BCwENs26.js +1 -0
- package/renderer-host/assets/src-BEirBh4c.js +27 -0
- package/renderer-host/assets/src-BHR6n7Fj.js +1 -0
- package/renderer-host/assets/src-BIlLq0QT.js +169 -0
- package/renderer-host/assets/src-BKlK1jcN.js +1 -0
- package/renderer-host/assets/src-BN0FUJhs.js +8 -0
- package/renderer-host/assets/src-BWElAdlq.js +52 -0
- package/renderer-host/assets/src-BXg11IjY.js +4 -0
- package/renderer-host/assets/src-BbBdnTjJ.js +2 -0
- package/renderer-host/assets/src-BbFZbZsL.js +2 -0
- package/renderer-host/assets/src-BdPbFRd-.js +24 -0
- package/renderer-host/assets/src-BpbGaBrT.js +182 -0
- package/renderer-host/assets/src-BwIl76_H.js +7 -0
- package/renderer-host/assets/src-C2e6QJIj.js +10 -0
- package/renderer-host/assets/src-C2gNidHF.js +989 -0
- package/renderer-host/assets/src-C9Uz3C-q.js +432 -0
- package/renderer-host/assets/src-CBUhG6W5.js +7 -0
- package/renderer-host/assets/src-CQDGi3Qa.js +10 -0
- package/renderer-host/assets/src-CRLCRg0N.js +21 -0
- package/renderer-host/assets/src-CS5rqxBy.js +10 -0
- package/renderer-host/assets/src-CWZdSJQw.js +7 -0
- package/renderer-host/assets/src-CXnpsVpU.js +27 -0
- package/renderer-host/assets/src-CnhXvqQY.js +8 -0
- package/renderer-host/assets/src-CpExg0ZA.js +9 -0
- package/renderer-host/assets/src-CrLmL3wU.js +5 -0
- package/renderer-host/assets/src-CrYEJ5uz.js +2 -0
- package/renderer-host/assets/src-D-iIkSqZ.js +222 -0
- package/renderer-host/assets/src-D6sH9uTT.js +23 -0
- package/renderer-host/assets/src-D8zHDJh_.js +10 -0
- package/renderer-host/assets/src-D9OFaPNV.js +1 -0
- package/renderer-host/assets/src-DCI_ff7c.js +1 -0
- package/renderer-host/assets/src-DCrbiTpH.js +18 -0
- package/renderer-host/assets/src-DK8DvtMd.js +115 -0
- package/renderer-host/assets/src-DWGlOVjt.js +17 -0
- package/renderer-host/assets/src-DbvEX_Ct.js +6 -0
- package/renderer-host/assets/src-Dezc2dj1.js +1 -0
- package/renderer-host/assets/src-Dh5VD1lL.js +11 -0
- package/renderer-host/assets/src-DlwABqw5.js +1 -0
- package/renderer-host/assets/src-DlxETlTh.js +44 -0
- package/renderer-host/assets/src-Dmd6BvBh.js +387 -0
- package/renderer-host/assets/src-DpgvaJNJ.js +24 -0
- package/renderer-host/assets/src-DpjRB2sv.js +1 -0
- package/renderer-host/assets/src-Dvn41FR7.js +90 -0
- package/renderer-host/assets/src-DwcPYp7X.js +1 -0
- package/renderer-host/assets/src-HUxhcDlO.js +2 -0
- package/renderer-host/assets/src-Jhqg3J8L.js +2 -0
- package/renderer-host/assets/src-MO5bLsLj.js +4126 -0
- package/renderer-host/assets/src-N8XBQaK4.js +20 -0
- package/renderer-host/assets/src-XZ_0U972.js +1 -0
- package/renderer-host/assets/src-Y6mXl4vh.js +29 -0
- package/renderer-host/assets/src-b9aXVJde.js +100 -0
- package/renderer-host/assets/src-d2U6neq8.js +37 -0
- package/renderer-host/assets/src-hCrza_Lf.js +1 -0
- package/renderer-host/assets/src-jUGjKzOV.js +1 -0
- package/renderer-host/assets/src-rJN_jaC5.js +1 -0
- package/renderer-host/assets/src-vOBd-1zk.js +5 -0
- package/renderer-host/assets/src-wrrVkfrK.js +1 -0
- package/renderer-host/assets/src-yCrAObB-.js +1 -0
- package/renderer-host/assets/src-zrBiCtay.js +7 -0
- package/renderer-host/assets/stl-adapter-CLkWHoOn.js +1 -0
- package/renderer-host/assets/stl.worker-C-anHijM.js +1 -0
- package/renderer-host/assets/three-mf-BSrcsdQD.js +2 -0
- package/renderer-host/assets/webimage-zQMH-_zR.js +1 -0
- package/renderer-host/assets/webm-14HHwfWy.js +1 -0
- package/renderer-host/assets/worker-QK2gViTu.js +1 -0
- package/renderer-host/assets/x6-dng-worker-CNf3zUP-.js +1 -0
- package/renderer-host/assets/xml.browser-CC8-XAyN.js +1 -0
- package/renderer-host/assets/zip-core-base-DD8akpjq.js +1 -0
- package/renderer-host/assets/zip-core-custom-CfPFs1lw.js +1 -0
- package/renderer-host/assets/zip-source-CLF3Hfcg.js +1 -0
- package/renderer-host/assets/zstd-CmwSLjHB.js +1 -0
- package/renderer-host/assets/zstd-i4Jwubnx.js +1 -0
- package/renderer-host/index.html +65 -0
- package/vendor-manifest.json +1433 -0
- package/worker.mjs +262 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { createRequire as __anyfileCreateRequire } from "node:module"; import { dirname as __anyfileDirname } from "node:path"; import { fileURLToPath as __anyfileFileURLToPath } from "node:url"; const require = __anyfileCreateRequire(import.meta.url); const __filename = __anyfileFileURLToPath(import.meta.url); const __dirname = __anyfileDirname(__filename);
|
|
2
|
+
import {
|
|
3
|
+
BinaryCursor,
|
|
4
|
+
FileByteSource
|
|
5
|
+
} from "../chunks/chunk-H4TBN22D.mjs";
|
|
6
|
+
import {
|
|
7
|
+
AgentError,
|
|
8
|
+
HARD_READ_MAX_BYTES,
|
|
9
|
+
ViewerError,
|
|
10
|
+
abortError,
|
|
11
|
+
isViewerAbortError,
|
|
12
|
+
markdownDocumentHeader,
|
|
13
|
+
paginateLines,
|
|
14
|
+
parsePositionCursor,
|
|
15
|
+
renderMarkdownTablePage
|
|
16
|
+
} from "../chunks/chunk-IC3G2XE2.mjs";
|
|
17
|
+
import "../chunks/chunk-ORJ3DN65.mjs";
|
|
18
|
+
|
|
19
|
+
// ../plugins/dev-wasm/src/parser.ts
|
|
20
|
+
var MAX_FILE_BYTES = 512 * 1024 * 1024;
|
|
21
|
+
var MAX_ENTRIES = 1e5;
|
|
22
|
+
var MAX_SECTIONS = 256;
|
|
23
|
+
var MAX_STRING_BYTES = 64 * 1024;
|
|
24
|
+
var MAX_TOTAL_STRING_BYTES = 8 * 1024 * 1024;
|
|
25
|
+
var SECTION_ORDER = /* @__PURE__ */ new Map([
|
|
26
|
+
[1, 1],
|
|
27
|
+
[2, 2],
|
|
28
|
+
[3, 3],
|
|
29
|
+
[4, 4],
|
|
30
|
+
[5, 5],
|
|
31
|
+
[13, 6],
|
|
32
|
+
[6, 7],
|
|
33
|
+
[7, 8],
|
|
34
|
+
[8, 9],
|
|
35
|
+
[9, 10],
|
|
36
|
+
[12, 11],
|
|
37
|
+
[10, 12],
|
|
38
|
+
[11, 13]
|
|
39
|
+
]);
|
|
40
|
+
var SECTION_NAMES = {
|
|
41
|
+
0: "custom",
|
|
42
|
+
1: "type",
|
|
43
|
+
2: "import",
|
|
44
|
+
3: "function",
|
|
45
|
+
4: "table",
|
|
46
|
+
5: "memory",
|
|
47
|
+
6: "global",
|
|
48
|
+
7: "export",
|
|
49
|
+
8: "start",
|
|
50
|
+
9: "element",
|
|
51
|
+
10: "code",
|
|
52
|
+
11: "data",
|
|
53
|
+
12: "data count",
|
|
54
|
+
13: "tag"
|
|
55
|
+
};
|
|
56
|
+
var VALUE_TYPES = {
|
|
57
|
+
127: "i32",
|
|
58
|
+
126: "i64",
|
|
59
|
+
125: "f32",
|
|
60
|
+
124: "f64",
|
|
61
|
+
123: "v128",
|
|
62
|
+
112: "funcref",
|
|
63
|
+
111: "externref"
|
|
64
|
+
};
|
|
65
|
+
var EXTERNAL_KINDS = ["function", "table", "memory", "global", "tag"];
|
|
66
|
+
function invalid(message) {
|
|
67
|
+
throw new ViewerError("invalid-file", message);
|
|
68
|
+
}
|
|
69
|
+
function limit(message) {
|
|
70
|
+
throw new ViewerError("resource-limit", message);
|
|
71
|
+
}
|
|
72
|
+
function asCount(value, label) {
|
|
73
|
+
if (value > MAX_ENTRIES) limit(`${label}\u6570\u91CF\u8D85\u8FC7\u6D4F\u89C8\u5668\u5B89\u5168\u4E0A\u9650\u3002`);
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
async function valueType(cursor) {
|
|
77
|
+
const byte = await cursor.readByte();
|
|
78
|
+
return VALUE_TYPES[byte] ?? invalid(`\u672A\u77E5\u7684 WebAssembly \u503C\u7C7B\u578B 0x${byte.toString(16)}\u3002`);
|
|
79
|
+
}
|
|
80
|
+
async function vectorTypes(cursor) {
|
|
81
|
+
const count = asCount(await cursor.readULEBNumber(), "\u503C\u7C7B\u578B");
|
|
82
|
+
const values = [];
|
|
83
|
+
for (let index = 0; index < count; index += 1) values.push(await valueType(cursor));
|
|
84
|
+
return values;
|
|
85
|
+
}
|
|
86
|
+
async function readLimits(cursor) {
|
|
87
|
+
const flags = await cursor.readULEBNumber();
|
|
88
|
+
if ((flags & ~7) !== 0) invalid("WebAssembly limits \u6807\u5FD7\u65E0\u6548\u3002");
|
|
89
|
+
const is64 = (flags & 4) !== 0;
|
|
90
|
+
const minimum = await cursor.readULEB(is64 ? 64 : 32);
|
|
91
|
+
const maximum = (flags & 1) !== 0 ? await cursor.readULEB(is64 ? 64 : 32) : void 0;
|
|
92
|
+
if (maximum !== void 0 && maximum < minimum) invalid("WebAssembly limits \u7684\u6700\u5927\u503C\u5C0F\u4E8E\u6700\u5C0F\u503C\u3002");
|
|
93
|
+
if ((flags & 2) !== 0 && maximum === void 0) invalid("\u5171\u4EAB WebAssembly limits \u5FC5\u987B\u58F0\u660E\u6700\u5927\u503C\u3002");
|
|
94
|
+
const suffix = `${minimum}${maximum === void 0 ? "+" : `\u2013${maximum}`}`;
|
|
95
|
+
return `${is64 ? "64-bit " : ""}${(flags & 2) !== 0 ? "shared " : ""}${suffix}`;
|
|
96
|
+
}
|
|
97
|
+
async function tableType(cursor) {
|
|
98
|
+
return `${await valueType(cursor)} ${await readLimits(cursor)}`;
|
|
99
|
+
}
|
|
100
|
+
async function globalType(cursor) {
|
|
101
|
+
const type = await valueType(cursor);
|
|
102
|
+
const mutable = await cursor.readByte();
|
|
103
|
+
if (mutable > 1) invalid("WebAssembly global \u53EF\u53D8\u6027\u6807\u5FD7\u65E0\u6548\u3002");
|
|
104
|
+
return `${mutable ? "mutable " : ""}${type}`;
|
|
105
|
+
}
|
|
106
|
+
var Strings = class {
|
|
107
|
+
constructor() {
|
|
108
|
+
this.total = 0;
|
|
109
|
+
}
|
|
110
|
+
async read(cursor) {
|
|
111
|
+
const length = await cursor.readULEBNumber();
|
|
112
|
+
if (length > MAX_STRING_BYTES || this.total + length > MAX_TOTAL_STRING_BYTES) {
|
|
113
|
+
limit("WebAssembly \u5B57\u7B26\u4E32\u8D85\u8FC7\u6D4F\u89C8\u5668\u5B89\u5168\u4E0A\u9650\u3002");
|
|
114
|
+
}
|
|
115
|
+
this.total += length;
|
|
116
|
+
try {
|
|
117
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(await cursor.readBytes(length));
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (error instanceof ViewerError) throw error;
|
|
120
|
+
if (error instanceof RangeError || error instanceof DOMException && error.name === "AbortError") throw error;
|
|
121
|
+
invalid("WebAssembly \u540D\u79F0\u4E0D\u662F\u6709\u6548 UTF-8\u3002");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
async function parseTypeSection(cursor) {
|
|
126
|
+
const count = asCount(await cursor.readULEBNumber(), "\u7C7B\u578B");
|
|
127
|
+
const types = [];
|
|
128
|
+
for (let index = 0; index < count; index += 1) {
|
|
129
|
+
if (await cursor.readByte() !== 96) invalid("\u9996\u7248\u67E5\u770B\u5668\u53EA\u652F\u6301\u6807\u51C6\u51FD\u6570\u7C7B\u578B\u3002");
|
|
130
|
+
types.push({ params: await vectorTypes(cursor), results: await vectorTypes(cursor) });
|
|
131
|
+
}
|
|
132
|
+
return types;
|
|
133
|
+
}
|
|
134
|
+
async function parseImports(cursor, strings) {
|
|
135
|
+
const count = asCount(await cursor.readULEBNumber(), "\u5BFC\u5165");
|
|
136
|
+
const imports = [];
|
|
137
|
+
for (let index = 0; index < count; index += 1) {
|
|
138
|
+
const moduleName = await strings.read(cursor);
|
|
139
|
+
const name = await strings.read(cursor);
|
|
140
|
+
const kindIndex = await cursor.readByte();
|
|
141
|
+
const kind = EXTERNAL_KINDS[kindIndex] ?? invalid("WebAssembly \u5BFC\u5165\u7C7B\u578B\u65E0\u6548\u3002");
|
|
142
|
+
let detail;
|
|
143
|
+
let typeIndex;
|
|
144
|
+
if (kindIndex === 0) {
|
|
145
|
+
typeIndex = await cursor.readULEBNumber();
|
|
146
|
+
detail = `type ${typeIndex}`;
|
|
147
|
+
} else if (kindIndex === 1) detail = await tableType(cursor);
|
|
148
|
+
else if (kindIndex === 2) detail = await readLimits(cursor);
|
|
149
|
+
else if (kindIndex === 3) detail = await globalType(cursor);
|
|
150
|
+
else {
|
|
151
|
+
const attribute = await cursor.readULEBNumber();
|
|
152
|
+
if (attribute !== 0) invalid("WebAssembly tag attribute \u65E0\u6548\u3002");
|
|
153
|
+
typeIndex = await cursor.readULEBNumber();
|
|
154
|
+
detail = `type ${typeIndex}`;
|
|
155
|
+
}
|
|
156
|
+
imports.push({ module: moduleName, name, kind, detail, typeIndex });
|
|
157
|
+
}
|
|
158
|
+
return imports;
|
|
159
|
+
}
|
|
160
|
+
async function parseExports(cursor, strings) {
|
|
161
|
+
const count = asCount(await cursor.readULEBNumber(), "\u5BFC\u51FA");
|
|
162
|
+
const exports = [];
|
|
163
|
+
const names = /* @__PURE__ */ new Set();
|
|
164
|
+
for (let index = 0; index < count; index += 1) {
|
|
165
|
+
const name = await strings.read(cursor);
|
|
166
|
+
if (names.has(name)) invalid("WebAssembly \u5BFC\u51FA\u540D\u79F0\u91CD\u590D\u3002");
|
|
167
|
+
names.add(name);
|
|
168
|
+
const kind = EXTERNAL_KINDS[await cursor.readByte()] ?? invalid("WebAssembly \u5BFC\u51FA\u7C7B\u578B\u65E0\u6548\u3002");
|
|
169
|
+
exports.push({ name, kind, index: await cursor.readULEBNumber() });
|
|
170
|
+
}
|
|
171
|
+
return exports;
|
|
172
|
+
}
|
|
173
|
+
async function parseVectorIndices(cursor, label) {
|
|
174
|
+
const count = asCount(await cursor.readULEBNumber(), label);
|
|
175
|
+
const values = [];
|
|
176
|
+
for (let index = 0; index < count; index += 1) values.push(await cursor.readULEBNumber());
|
|
177
|
+
return values;
|
|
178
|
+
}
|
|
179
|
+
async function parseCode(cursor, typeIndices) {
|
|
180
|
+
const count = asCount(await cursor.readULEBNumber(), "\u51FD\u6570\u4F53");
|
|
181
|
+
if (count !== typeIndices.length) invalid("\u51FD\u6570\u58F0\u660E\u4E0E\u51FD\u6570\u4F53\u6570\u91CF\u4E0D\u4E00\u81F4\u3002");
|
|
182
|
+
const functions = [];
|
|
183
|
+
for (let index = 0; index < count; index += 1) {
|
|
184
|
+
const bodySize = await cursor.readULEBNumber();
|
|
185
|
+
cursor.skip(bodySize);
|
|
186
|
+
functions.push({ typeIndex: typeIndices[index], bodySize });
|
|
187
|
+
}
|
|
188
|
+
return functions;
|
|
189
|
+
}
|
|
190
|
+
function ensureConsumed(cursor, name) {
|
|
191
|
+
if (cursor.remaining !== 0) invalid(`WebAssembly ${name} section \u542B\u6709\u65E0\u6CD5\u8BC6\u522B\u7684\u6570\u636E\u3002`);
|
|
192
|
+
}
|
|
193
|
+
async function parseWasm(file, signal) {
|
|
194
|
+
if (file.size > MAX_FILE_BYTES) limit("WebAssembly \u6587\u4EF6\u8D85\u8FC7 512 MiB \u5B89\u5168\u4E0A\u9650\u3002");
|
|
195
|
+
const source = new FileByteSource(file, signal);
|
|
196
|
+
const cursor = new BinaryCursor(source);
|
|
197
|
+
try {
|
|
198
|
+
const header = await cursor.readBytes(8);
|
|
199
|
+
if (header[0] !== 0 || header[1] !== 97 || header[2] !== 115 || header[3] !== 109) {
|
|
200
|
+
invalid("\u6587\u4EF6\u4E0D\u662F WebAssembly \u6A21\u5757\u3002");
|
|
201
|
+
}
|
|
202
|
+
if (header[4] !== 1 || header[5] !== 0 || header[6] !== 0 || header[7] !== 0) {
|
|
203
|
+
invalid("\u4E0D\u652F\u6301\u8FD9\u4E2A WebAssembly \u4E8C\u8FDB\u5236\u7248\u672C\u3002");
|
|
204
|
+
}
|
|
205
|
+
const strings = new Strings();
|
|
206
|
+
const sections = [];
|
|
207
|
+
const types = [];
|
|
208
|
+
const imports = [];
|
|
209
|
+
const exports = [];
|
|
210
|
+
const memories = [];
|
|
211
|
+
const tables = [];
|
|
212
|
+
const customSections = [];
|
|
213
|
+
let functionTypes = [];
|
|
214
|
+
let functions = [];
|
|
215
|
+
let startFunction;
|
|
216
|
+
let globalCount = 0;
|
|
217
|
+
let tagCount = 0;
|
|
218
|
+
let lastOrder = 0;
|
|
219
|
+
const seen = /* @__PURE__ */ new Set();
|
|
220
|
+
while (cursor.remaining > 0) {
|
|
221
|
+
if (sections.length >= MAX_SECTIONS) limit("WebAssembly section \u6570\u91CF\u8D85\u8FC7\u5B89\u5168\u4E0A\u9650\u3002");
|
|
222
|
+
const id = await cursor.readByte();
|
|
223
|
+
const size = await cursor.readULEBNumber();
|
|
224
|
+
if (!(id in SECTION_NAMES)) invalid(`\u672A\u77E5\u7684 WebAssembly section id ${id}\u3002`);
|
|
225
|
+
if (size > cursor.remaining) invalid("WebAssembly section \u8D85\u51FA\u6587\u4EF6\u672B\u5C3E\u3002");
|
|
226
|
+
if (id !== 0) {
|
|
227
|
+
const order = SECTION_ORDER.get(id);
|
|
228
|
+
if (seen.has(id) || order < lastOrder) invalid("WebAssembly section \u91CD\u590D\u6216\u987A\u5E8F\u65E0\u6548\u3002");
|
|
229
|
+
seen.add(id);
|
|
230
|
+
lastOrder = order;
|
|
231
|
+
}
|
|
232
|
+
const sectionCursor = new BinaryCursor(source, cursor.position, cursor.position + size);
|
|
233
|
+
let count;
|
|
234
|
+
if (id === 0) {
|
|
235
|
+
const name = await strings.read(sectionCursor);
|
|
236
|
+
customSections.push({ name, size: sectionCursor.remaining });
|
|
237
|
+
sectionCursor.skip(sectionCursor.remaining);
|
|
238
|
+
} else if (id === 1) {
|
|
239
|
+
types.push(...await parseTypeSection(sectionCursor));
|
|
240
|
+
count = types.length;
|
|
241
|
+
} else if (id === 2) {
|
|
242
|
+
imports.push(...await parseImports(sectionCursor, strings));
|
|
243
|
+
count = imports.length;
|
|
244
|
+
} else if (id === 3) {
|
|
245
|
+
functionTypes = await parseVectorIndices(sectionCursor, "\u51FD\u6570\u58F0\u660E");
|
|
246
|
+
count = functionTypes.length;
|
|
247
|
+
} else if (id === 4) {
|
|
248
|
+
count = asCount(await sectionCursor.readULEBNumber(), "\u8868");
|
|
249
|
+
for (let index = 0; index < count; index += 1) tables.push(await tableType(sectionCursor));
|
|
250
|
+
} else if (id === 5) {
|
|
251
|
+
count = asCount(await sectionCursor.readULEBNumber(), "\u5185\u5B58");
|
|
252
|
+
for (let index = 0; index < count; index += 1) memories.push(await readLimits(sectionCursor));
|
|
253
|
+
} else if (id === 7) {
|
|
254
|
+
exports.push(...await parseExports(sectionCursor, strings));
|
|
255
|
+
count = exports.length;
|
|
256
|
+
} else if (id === 8) {
|
|
257
|
+
startFunction = await sectionCursor.readULEBNumber();
|
|
258
|
+
} else if (id === 10) {
|
|
259
|
+
functions = await parseCode(sectionCursor, functionTypes);
|
|
260
|
+
count = functions.length;
|
|
261
|
+
} else if (id === 12) {
|
|
262
|
+
count = await sectionCursor.readULEBNumber();
|
|
263
|
+
} else {
|
|
264
|
+
count = asCount(await sectionCursor.readULEBNumber(), SECTION_NAMES[id]);
|
|
265
|
+
if (id === 6) globalCount = count;
|
|
266
|
+
if (id === 13) tagCount = count;
|
|
267
|
+
sectionCursor.skip(sectionCursor.remaining);
|
|
268
|
+
}
|
|
269
|
+
ensureConsumed(sectionCursor, SECTION_NAMES[id]);
|
|
270
|
+
sections.push({ id, name: SECTION_NAMES[id], size, count });
|
|
271
|
+
cursor.skip(size);
|
|
272
|
+
}
|
|
273
|
+
for (const typeIndex of functionTypes) {
|
|
274
|
+
if (typeIndex >= types.length) invalid("WebAssembly \u51FD\u6570\u58F0\u660E\u5F15\u7528\u4E86\u65E0\u6548\u7C7B\u578B\u3002");
|
|
275
|
+
}
|
|
276
|
+
for (const item of imports) {
|
|
277
|
+
if (item.typeIndex !== void 0 && item.typeIndex >= types.length) {
|
|
278
|
+
invalid("WebAssembly \u5BFC\u5165\u5F15\u7528\u4E86\u65E0\u6548\u51FD\u6570\u7C7B\u578B\u3002");
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const totals = /* @__PURE__ */ new Map([
|
|
282
|
+
["function", imports.filter((item) => item.kind === "function").length + functionTypes.length],
|
|
283
|
+
["table", imports.filter((item) => item.kind === "table").length + tables.length],
|
|
284
|
+
["memory", imports.filter((item) => item.kind === "memory").length + memories.length],
|
|
285
|
+
["global", imports.filter((item) => item.kind === "global").length + globalCount],
|
|
286
|
+
["tag", imports.filter((item) => item.kind === "tag").length + tagCount]
|
|
287
|
+
]);
|
|
288
|
+
for (const item of exports) {
|
|
289
|
+
if (item.index >= (totals.get(item.kind) ?? 0)) invalid("WebAssembly \u5BFC\u51FA\u7D22\u5F15\u8D8A\u754C\u3002");
|
|
290
|
+
}
|
|
291
|
+
if (startFunction !== void 0 && startFunction >= (totals.get("function") ?? 0)) {
|
|
292
|
+
invalid("WebAssembly start function \u7D22\u5F15\u8D8A\u754C\u3002");
|
|
293
|
+
}
|
|
294
|
+
return { version: 1, sections, types, imports, exports, functions, memories, tables, customSections, startFunction };
|
|
295
|
+
} catch (error) {
|
|
296
|
+
if (error instanceof ViewerError || error instanceof DOMException && error.name === "AbortError") throw error;
|
|
297
|
+
if (error instanceof RangeError) invalid("WebAssembly \u6570\u636E\u5DF2\u622A\u65AD\u6216\u5305\u542B\u65E0\u6548\u6574\u6570\u3002");
|
|
298
|
+
throw error;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// ../plugins/dev-wasm/src/extract.ts
|
|
303
|
+
var PLUGIN_ID = "dev-wasm-viewer";
|
|
304
|
+
function mapError(error) {
|
|
305
|
+
if (error instanceof AgentError) throw error;
|
|
306
|
+
if (isViewerAbortError(error)) throw error;
|
|
307
|
+
if (error instanceof ViewerError) {
|
|
308
|
+
const code = error.code === "resource-limit" ? "resource-limit" : "invalid-file";
|
|
309
|
+
throw new AgentError(code, error.message, { pluginId: PLUGIN_ID, cause: error });
|
|
310
|
+
}
|
|
311
|
+
throw new AgentError(
|
|
312
|
+
"invalid-file",
|
|
313
|
+
error instanceof Error ? error.message : "Failed to parse WebAssembly module.",
|
|
314
|
+
{ pluginId: PLUGIN_ID, cause: error }
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
async function loadModule(context) {
|
|
318
|
+
if (context.signal.aborted) throw abortError();
|
|
319
|
+
try {
|
|
320
|
+
return await parseWasm(context.file, context.signal);
|
|
321
|
+
} catch (error) {
|
|
322
|
+
mapError(error);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function formatSignature(type) {
|
|
326
|
+
if (!type) return "() -> ()";
|
|
327
|
+
return `(${type.params.join(", ")}) -> (${type.results.join(", ")})`;
|
|
328
|
+
}
|
|
329
|
+
function buildOverviewLines(fileName, sizeBytes, mod) {
|
|
330
|
+
const fields = {
|
|
331
|
+
Version: String(mod.version),
|
|
332
|
+
"File Size": `${sizeBytes} bytes`,
|
|
333
|
+
Sections: String(mod.sections.length),
|
|
334
|
+
Types: String(mod.types.length),
|
|
335
|
+
Imports: String(mod.imports.length),
|
|
336
|
+
Exports: String(mod.exports.length),
|
|
337
|
+
"Defined Functions": String(mod.functions.length),
|
|
338
|
+
Memories: mod.memories.length > 0 ? mod.memories.join(", ") : "0",
|
|
339
|
+
Tables: mod.tables.length > 0 ? mod.tables.join(", ") : "0",
|
|
340
|
+
"Custom Sections": String(mod.customSections.length),
|
|
341
|
+
...mod.startFunction !== void 0 ? { "Start Function": `#${mod.startFunction}` } : {}
|
|
342
|
+
};
|
|
343
|
+
const lines = markdownDocumentHeader(fileName, fields).split("\n");
|
|
344
|
+
if (mod.exports.length > 0) {
|
|
345
|
+
lines.push("", "## Exports", "");
|
|
346
|
+
for (const exp of mod.exports.slice(0, 50)) {
|
|
347
|
+
lines.push(`- \`${exp.name}\` (${exp.kind} #${exp.index})`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (mod.imports.length > 0) {
|
|
351
|
+
lines.push("", "## Imports", "");
|
|
352
|
+
for (const imp of mod.imports.slice(0, 50)) {
|
|
353
|
+
const sig = imp.typeIndex !== void 0 ? formatSignature(mod.types[imp.typeIndex]) : imp.detail;
|
|
354
|
+
lines.push(`- \`${imp.module}.${imp.name}\` (${imp.kind}: ${sig})`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (mod.customSections.length > 0) {
|
|
358
|
+
lines.push("", "## Custom Sections", "");
|
|
359
|
+
for (const custom of mod.customSections) {
|
|
360
|
+
lines.push(`- \`${custom.name}\` (${custom.size} bytes)`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return lines;
|
|
364
|
+
}
|
|
365
|
+
function readFilteredLines(lines, params, maxBytes) {
|
|
366
|
+
const needle = params.filter?.trim().toLowerCase();
|
|
367
|
+
const filtered = needle ? lines.filter((line) => line.toLowerCase().includes(needle)) : lines;
|
|
368
|
+
const page = paginateLines(filtered, params.cursor, maxBytes, PLUGIN_ID);
|
|
369
|
+
return {
|
|
370
|
+
content: page.content,
|
|
371
|
+
contentType: "markdown",
|
|
372
|
+
...page.nextCursor ? { nextCursor: page.nextCursor } : {},
|
|
373
|
+
truncated: page.truncated,
|
|
374
|
+
...needle ? { filterApplied: true } : {}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function readTable(columns, allRows, params, maxBytes) {
|
|
378
|
+
const start = parsePositionCursor(params.cursor, "row:", PLUGIN_ID);
|
|
379
|
+
if (start > allRows.length) {
|
|
380
|
+
throw new AgentError("target-not-found", `Cursor row ${start} is out of range.`, { pluginId: PLUGIN_ID });
|
|
381
|
+
}
|
|
382
|
+
const needle = params.filter?.trim().toLowerCase();
|
|
383
|
+
function* rows() {
|
|
384
|
+
for (let i = start; i < allRows.length; i += 1) {
|
|
385
|
+
const row = allRows[i];
|
|
386
|
+
yield needle && !row.some((cell) => cell.toLowerCase().includes(needle)) ? null : row;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
const result = renderMarkdownTablePage({
|
|
390
|
+
columns,
|
|
391
|
+
rows: rows(),
|
|
392
|
+
start,
|
|
393
|
+
maxBytes,
|
|
394
|
+
cursorPrefix: "row:"
|
|
395
|
+
});
|
|
396
|
+
return { ...result, ...needle ? { filterApplied: true } : {} };
|
|
397
|
+
}
|
|
398
|
+
var devWasmExtractor = {
|
|
399
|
+
async inspect(context) {
|
|
400
|
+
const mod = await loadModule(context);
|
|
401
|
+
const targets = [
|
|
402
|
+
{ id: "overview", title: "WASM Module Overview", kind: "summary" },
|
|
403
|
+
{ id: "sections", title: "Sections", kind: "table", size: mod.sections.length },
|
|
404
|
+
...mod.types.length > 0 ? [{ id: "types", title: "Function Types", kind: "table", size: mod.types.length }] : [],
|
|
405
|
+
...mod.imports.length > 0 ? [{ id: "imports", title: "Imports", kind: "table", size: mod.imports.length }] : [],
|
|
406
|
+
...mod.exports.length > 0 ? [{ id: "exports", title: "Exports", kind: "table", size: mod.exports.length }] : [],
|
|
407
|
+
...mod.functions.length > 0 ? [{ id: "functions", title: "Defined Functions", kind: "table", size: mod.functions.length }] : [],
|
|
408
|
+
...mod.customSections.length > 0 ? [{ id: "custom-sections", title: "Custom Sections", kind: "table", size: mod.customSections.length }] : []
|
|
409
|
+
];
|
|
410
|
+
return {
|
|
411
|
+
metadata: {
|
|
412
|
+
version: mod.version,
|
|
413
|
+
sizeBytes: context.source.size,
|
|
414
|
+
sectionCount: mod.sections.length,
|
|
415
|
+
typeCount: mod.types.length,
|
|
416
|
+
importCount: mod.imports.length,
|
|
417
|
+
exportCount: mod.exports.length,
|
|
418
|
+
functionCount: mod.functions.length,
|
|
419
|
+
memoryCount: mod.memories.length,
|
|
420
|
+
tableCount: mod.tables.length,
|
|
421
|
+
customSectionCount: mod.customSections.length,
|
|
422
|
+
startFunction: mod.startFunction ?? null
|
|
423
|
+
},
|
|
424
|
+
targets
|
|
425
|
+
};
|
|
426
|
+
},
|
|
427
|
+
async read(context, params) {
|
|
428
|
+
const mod = await loadModule(context);
|
|
429
|
+
const maxBytes = Math.min(params.maxBytes, HARD_READ_MAX_BYTES);
|
|
430
|
+
const target = params.target ?? "overview";
|
|
431
|
+
if (target === "overview") {
|
|
432
|
+
return readFilteredLines(buildOverviewLines(context.source.name, context.source.size, mod), params, maxBytes);
|
|
433
|
+
}
|
|
434
|
+
if (target === "sections") {
|
|
435
|
+
return readTable(
|
|
436
|
+
["#", "ID", "Name", "Size (bytes)", "Entries"],
|
|
437
|
+
mod.sections.map((section, index) => [
|
|
438
|
+
String(index),
|
|
439
|
+
String(section.id),
|
|
440
|
+
section.name,
|
|
441
|
+
String(section.size),
|
|
442
|
+
section.count !== void 0 ? String(section.count) : ""
|
|
443
|
+
]),
|
|
444
|
+
params,
|
|
445
|
+
maxBytes
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
if (target === "types" && mod.types.length > 0) {
|
|
449
|
+
return readTable(
|
|
450
|
+
["Index", "Signature"],
|
|
451
|
+
mod.types.map((type, index) => [String(index), formatSignature(type)]),
|
|
452
|
+
params,
|
|
453
|
+
maxBytes
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
if (target === "imports" && mod.imports.length > 0) {
|
|
457
|
+
return readTable(
|
|
458
|
+
["Index", "Module", "Name", "Kind", "Detail"],
|
|
459
|
+
mod.imports.map((imp, index) => [
|
|
460
|
+
String(index),
|
|
461
|
+
imp.module,
|
|
462
|
+
imp.name,
|
|
463
|
+
imp.kind,
|
|
464
|
+
imp.typeIndex !== void 0 ? formatSignature(mod.types[imp.typeIndex]) : imp.detail
|
|
465
|
+
]),
|
|
466
|
+
params,
|
|
467
|
+
maxBytes
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
if (target === "exports" && mod.exports.length > 0) {
|
|
471
|
+
return readTable(
|
|
472
|
+
["Name", "Kind", "Index"],
|
|
473
|
+
mod.exports.map((exp) => [exp.name, exp.kind, String(exp.index)]),
|
|
474
|
+
params,
|
|
475
|
+
maxBytes
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
if (target === "functions" && mod.functions.length > 0) {
|
|
479
|
+
const importedFunctions = mod.imports.filter((imp) => imp.kind === "function").length;
|
|
480
|
+
return readTable(
|
|
481
|
+
["Function Index", "Type Index", "Signature", "Body Size (bytes)"],
|
|
482
|
+
mod.functions.map((fn, index) => [
|
|
483
|
+
String(importedFunctions + index),
|
|
484
|
+
String(fn.typeIndex),
|
|
485
|
+
formatSignature(mod.types[fn.typeIndex]),
|
|
486
|
+
String(fn.bodySize)
|
|
487
|
+
]),
|
|
488
|
+
params,
|
|
489
|
+
maxBytes
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
if (target === "custom-sections" && mod.customSections.length > 0) {
|
|
493
|
+
return readTable(
|
|
494
|
+
["Name", "Payload Size (bytes)"],
|
|
495
|
+
mod.customSections.map((custom) => [custom.name, String(custom.size)]),
|
|
496
|
+
params,
|
|
497
|
+
maxBytes
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
throw new AgentError("target-not-found", `WASM target not found: "${target}".`, { pluginId: PLUGIN_ID });
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
var extract_default = devWasmExtractor;
|
|
504
|
+
export {
|
|
505
|
+
extract_default as default
|
|
506
|
+
};
|