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,306 @@
|
|
|
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
|
+
AgentError,
|
|
4
|
+
ViewerError,
|
|
5
|
+
abortError,
|
|
6
|
+
isViewerAbortError,
|
|
7
|
+
paginateLines,
|
|
8
|
+
parsePositionCursor,
|
|
9
|
+
renderMarkdownTablePage,
|
|
10
|
+
truncateUtf8
|
|
11
|
+
} from "../chunks/chunk-IC3G2XE2.mjs";
|
|
12
|
+
import "../chunks/chunk-ORJ3DN65.mjs";
|
|
13
|
+
|
|
14
|
+
// ../plugins/har/src/parse.ts
|
|
15
|
+
var MAX_HAR_BYTES = 128 * 1024 * 1024;
|
|
16
|
+
function record(value) {
|
|
17
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
18
|
+
}
|
|
19
|
+
function optionalString(value) {
|
|
20
|
+
return typeof value === "string" ? value : void 0;
|
|
21
|
+
}
|
|
22
|
+
function optionalNumber(value) {
|
|
23
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
24
|
+
}
|
|
25
|
+
function nameValues(value) {
|
|
26
|
+
if (!Array.isArray(value)) return [];
|
|
27
|
+
return value.flatMap((item) => {
|
|
28
|
+
const pair = record(item);
|
|
29
|
+
return pair && typeof pair.name === "string" && typeof pair.value === "string" ? [{ name: pair.name, value: pair.value }] : [];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function postData(value) {
|
|
33
|
+
const data = record(value);
|
|
34
|
+
if (!data) return void 0;
|
|
35
|
+
return {
|
|
36
|
+
mimeType: optionalString(data.mimeType),
|
|
37
|
+
text: optionalString(data.text),
|
|
38
|
+
params: nameValues(data.params)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function parseEntry(value) {
|
|
42
|
+
const entry = record(value);
|
|
43
|
+
const request = record(entry?.request);
|
|
44
|
+
const response = record(entry?.response);
|
|
45
|
+
const content = record(response?.content) ?? {};
|
|
46
|
+
const rawTimings = record(entry?.timings) ?? {};
|
|
47
|
+
if (!entry || !request || !response || typeof request.method !== "string" || typeof request.url !== "string" || optionalNumber(response.status) === void 0) {
|
|
48
|
+
throw new Error("Invalid HAR entry");
|
|
49
|
+
}
|
|
50
|
+
const timings = Object.fromEntries(
|
|
51
|
+
Object.entries(rawTimings).filter((item) => optionalNumber(item[1]) !== void 0)
|
|
52
|
+
);
|
|
53
|
+
return {
|
|
54
|
+
startedDateTime: optionalString(entry.startedDateTime),
|
|
55
|
+
time: optionalNumber(entry.time) ?? 0,
|
|
56
|
+
serverIPAddress: optionalString(entry.serverIPAddress),
|
|
57
|
+
connection: optionalString(entry.connection),
|
|
58
|
+
request: {
|
|
59
|
+
method: request.method,
|
|
60
|
+
url: request.url,
|
|
61
|
+
httpVersion: optionalString(request.httpVersion),
|
|
62
|
+
headers: nameValues(request.headers),
|
|
63
|
+
queryString: nameValues(request.queryString),
|
|
64
|
+
headersSize: optionalNumber(request.headersSize),
|
|
65
|
+
bodySize: optionalNumber(request.bodySize),
|
|
66
|
+
postData: postData(request.postData)
|
|
67
|
+
},
|
|
68
|
+
response: {
|
|
69
|
+
status: response.status,
|
|
70
|
+
statusText: optionalString(response.statusText),
|
|
71
|
+
httpVersion: optionalString(response.httpVersion),
|
|
72
|
+
headers: nameValues(response.headers),
|
|
73
|
+
redirectURL: optionalString(response.redirectURL),
|
|
74
|
+
headersSize: optionalNumber(response.headersSize),
|
|
75
|
+
bodySize: optionalNumber(response.bodySize),
|
|
76
|
+
content: {
|
|
77
|
+
size: optionalNumber(content.size),
|
|
78
|
+
compression: optionalNumber(content.compression),
|
|
79
|
+
mimeType: optionalString(content.mimeType),
|
|
80
|
+
text: optionalString(content.text),
|
|
81
|
+
encoding: optionalString(content.encoding)
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
timings
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function parseDocument(text) {
|
|
88
|
+
const root = record(JSON.parse(text));
|
|
89
|
+
const log = record(root?.log);
|
|
90
|
+
if (!log || !Array.isArray(log.entries)) throw new Error("Invalid HAR document");
|
|
91
|
+
const creator = record(log.creator);
|
|
92
|
+
return {
|
|
93
|
+
version: optionalString(log.version),
|
|
94
|
+
creator: optionalString(creator?.name),
|
|
95
|
+
pageCount: Array.isArray(log.pages) ? log.pages.length : 0,
|
|
96
|
+
entries: log.entries.map(parseEntry)
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
async function readHar(file, signal, reportProgress) {
|
|
100
|
+
if (file.size > MAX_HAR_BYTES) {
|
|
101
|
+
throw new ViewerError("resource-limit", "HAR \u6587\u4EF6\u8D85\u8FC7 128 MiB\uFF0C\u65E0\u6CD5\u5728\u6D4F\u89C8\u5668\u4E2D\u5B89\u5168\u89E3\u6790\u3002", { cause: file.size });
|
|
102
|
+
}
|
|
103
|
+
if (signal.aborted) throw abortError();
|
|
104
|
+
const reader = file.slice(0, file.size).stream().getReader();
|
|
105
|
+
const decoder = new TextDecoder();
|
|
106
|
+
const chunks = [];
|
|
107
|
+
let loaded = 0;
|
|
108
|
+
const cancel = () => void reader.cancel();
|
|
109
|
+
signal.addEventListener("abort", cancel, { once: true });
|
|
110
|
+
try {
|
|
111
|
+
while (true) {
|
|
112
|
+
const result = await reader.read();
|
|
113
|
+
if (result.done) break;
|
|
114
|
+
loaded += result.value.byteLength;
|
|
115
|
+
chunks.push(decoder.decode(result.value, { stream: true }));
|
|
116
|
+
reportProgress({ stage: "reading", loaded, total: file.size });
|
|
117
|
+
}
|
|
118
|
+
chunks.push(decoder.decode());
|
|
119
|
+
if (signal.aborted) throw abortError();
|
|
120
|
+
return parseDocument(chunks.join(""));
|
|
121
|
+
} finally {
|
|
122
|
+
signal.removeEventListener("abort", cancel);
|
|
123
|
+
reader.releaseLock();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ../plugins/har/src/extract.ts
|
|
128
|
+
var PLUGIN_ID = "http-archive";
|
|
129
|
+
var MAX_ENTRY_TARGETS = 50;
|
|
130
|
+
var MAX_HOSTS = 20;
|
|
131
|
+
var BODY_CAP = 16 * 1024;
|
|
132
|
+
var ENTRY_COLUMNS = ["#", "Started", "Method", "Status", "URL", "MIME", "Size", "Time (ms)"];
|
|
133
|
+
async function load(context) {
|
|
134
|
+
if (context.signal.aborted) throw abortError();
|
|
135
|
+
try {
|
|
136
|
+
return await readHar(context.file, context.signal, () => void 0);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
if (isViewerAbortError(error)) throw error;
|
|
139
|
+
if (error instanceof ViewerError && error.code === "resource-limit") {
|
|
140
|
+
throw new AgentError("resource-limit", "The HAR file is larger than 128 MiB.", { pluginId: PLUGIN_ID, cause: error });
|
|
141
|
+
}
|
|
142
|
+
throw new AgentError("invalid-file", "The file is damaged or is not a valid HAR file.", { pluginId: PLUGIN_ID, cause: error });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function host(url) {
|
|
146
|
+
try {
|
|
147
|
+
return new URL(url).host || "(none)";
|
|
148
|
+
} catch {
|
|
149
|
+
return "(invalid URL)";
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
var responseSize = (entry) => entry.response.content.size ?? entry.response.bodySize;
|
|
153
|
+
var startMs = (entry) => entry.startedDateTime ? Date.parse(entry.startedDateTime) : Number.NaN;
|
|
154
|
+
function entryRow(entry, index) {
|
|
155
|
+
const size = responseSize(entry);
|
|
156
|
+
return [
|
|
157
|
+
String(index + 1),
|
|
158
|
+
entry.startedDateTime ?? "",
|
|
159
|
+
entry.request.method,
|
|
160
|
+
String(entry.response.status),
|
|
161
|
+
entry.request.url,
|
|
162
|
+
entry.response.content.mimeType ?? "",
|
|
163
|
+
size === void 0 || size < 0 ? "" : String(size),
|
|
164
|
+
String(Math.round(entry.time * 10) / 10)
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
function readEntries(entries, params) {
|
|
168
|
+
const start = parsePositionCursor(params.cursor, "row:", PLUGIN_ID);
|
|
169
|
+
if (start > entries.length) {
|
|
170
|
+
throw new AgentError("target-not-found", `Cursor row ${start} is out of range.`, { pluginId: PLUGIN_ID });
|
|
171
|
+
}
|
|
172
|
+
const needle = params.filter?.trim().toLowerCase();
|
|
173
|
+
const result = renderMarkdownTablePage({
|
|
174
|
+
columns: ENTRY_COLUMNS,
|
|
175
|
+
rows: entries.slice(start).map((entry, offset) => {
|
|
176
|
+
const row = entryRow(entry, start + offset);
|
|
177
|
+
return !needle || row.some((cell) => cell.toLowerCase().includes(needle)) ? row : null;
|
|
178
|
+
}),
|
|
179
|
+
start,
|
|
180
|
+
maxBytes: params.maxBytes,
|
|
181
|
+
cursorPrefix: "row:"
|
|
182
|
+
});
|
|
183
|
+
return needle ? { ...result, filterApplied: true } : result;
|
|
184
|
+
}
|
|
185
|
+
function bodyText(text, encoding) {
|
|
186
|
+
let decoded = text;
|
|
187
|
+
let more = false;
|
|
188
|
+
if (encoding === "base64") {
|
|
189
|
+
const head = text.slice(0, (Math.ceil(BODY_CAP / 3) + 1) * 4);
|
|
190
|
+
more = head.length < text.length;
|
|
191
|
+
try {
|
|
192
|
+
const bytes = Uint8Array.from(atob(head), (char) => char.charCodeAt(0));
|
|
193
|
+
if (bytes.includes(0)) return void 0;
|
|
194
|
+
decoded = new TextDecoder("utf-8", { fatal: true }).decode(bytes, { stream: true });
|
|
195
|
+
} catch {
|
|
196
|
+
return void 0;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const capped = truncateUtf8(decoded, BODY_CAP);
|
|
200
|
+
return { text: capped.text, truncated: capped.truncated || more };
|
|
201
|
+
}
|
|
202
|
+
function bodyLines(mimeType, text, encoding) {
|
|
203
|
+
if (!text) return [];
|
|
204
|
+
const heading = `### Body${mimeType ? ` (${mimeType})` : ""}`;
|
|
205
|
+
const body = bodyText(text, encoding);
|
|
206
|
+
if (!body) return [heading, `<binary body, ${text.length} encoded chars; not shown>`];
|
|
207
|
+
return [
|
|
208
|
+
heading,
|
|
209
|
+
"~~~~",
|
|
210
|
+
...body.text.split(/\r?\n/),
|
|
211
|
+
"~~~~",
|
|
212
|
+
...body.truncated ? [`[body truncated to ${BODY_CAP} bytes]`] : []
|
|
213
|
+
];
|
|
214
|
+
}
|
|
215
|
+
var pairLines = (title, pairs) => pairs.length ? [`### ${title}`, ...pairs.map(({ name, value }) => `- ${name}: ${value}`)] : [];
|
|
216
|
+
function entryDetail(entry, index) {
|
|
217
|
+
const { request, response } = entry;
|
|
218
|
+
const timings = Object.entries(entry.timings).filter(([, value]) => value >= 0);
|
|
219
|
+
const size = responseSize(entry);
|
|
220
|
+
return [
|
|
221
|
+
`# Entry ${index + 1}: ${request.method} ${request.url}`,
|
|
222
|
+
"",
|
|
223
|
+
...entry.startedDateTime ? [`- **Started**: ${entry.startedDateTime}`] : [],
|
|
224
|
+
`- **Time**: ${entry.time} ms`,
|
|
225
|
+
...timings.length ? [`- **Timings**: ${timings.map(([name, value]) => `${name}=${value}`).join(", ")}`] : [],
|
|
226
|
+
...entry.serverIPAddress ? [`- **Server IP**: ${entry.serverIPAddress}`] : [],
|
|
227
|
+
"",
|
|
228
|
+
"## Request",
|
|
229
|
+
...request.httpVersion ? [`- **HTTP version**: ${request.httpVersion}`] : [],
|
|
230
|
+
...pairLines("Headers", request.headers),
|
|
231
|
+
...pairLines("Query string", request.queryString),
|
|
232
|
+
...pairLines("Form parameters", request.postData?.params ?? []),
|
|
233
|
+
...bodyLines(request.postData?.mimeType, request.postData?.text),
|
|
234
|
+
"",
|
|
235
|
+
"## Response",
|
|
236
|
+
`- **Status**: ${response.status}${response.statusText ? ` ${response.statusText}` : ""}`,
|
|
237
|
+
...response.httpVersion ? [`- **HTTP version**: ${response.httpVersion}`] : [],
|
|
238
|
+
...size !== void 0 && size >= 0 ? [`- **Content size**: ${size} bytes`] : [],
|
|
239
|
+
...response.redirectURL ? [`- **Redirect**: ${response.redirectURL}`] : [],
|
|
240
|
+
...pairLines("Headers", response.headers),
|
|
241
|
+
...bodyLines(response.content.mimeType, response.content.text, response.content.encoding)
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
function countBy(items, key) {
|
|
245
|
+
const counts = /* @__PURE__ */ new Map();
|
|
246
|
+
for (const item of items) counts.set(key(item), (counts.get(key(item)) ?? 0) + 1);
|
|
247
|
+
return Object.fromEntries([...counts].sort((a, b) => b[1] - a[1]));
|
|
248
|
+
}
|
|
249
|
+
var harExtractor = {
|
|
250
|
+
async inspect(context) {
|
|
251
|
+
const document = await load(context);
|
|
252
|
+
const { entries } = document;
|
|
253
|
+
const starts = entries.map(startMs).filter(Number.isFinite);
|
|
254
|
+
const ends = entries.map((entry) => startMs(entry) + entry.time).filter(Number.isFinite);
|
|
255
|
+
const hosts = countBy(entries, (entry) => host(entry.request.url));
|
|
256
|
+
const targets = [{ id: "entries", title: "Requests", kind: "table", size: entries.length }];
|
|
257
|
+
for (const [index, entry] of entries.slice(0, MAX_ENTRY_TARGETS).entries()) {
|
|
258
|
+
targets.push({ id: `entry:${index + 1}`, title: `${entry.request.method} ${entry.request.url}`.slice(0, 160), kind: "entry" });
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
metadata: {
|
|
262
|
+
version: document.version ?? null,
|
|
263
|
+
creator: document.creator ?? null,
|
|
264
|
+
pageCount: document.pageCount,
|
|
265
|
+
entryCount: entries.length,
|
|
266
|
+
hostCount: Object.keys(hosts).length,
|
|
267
|
+
hosts: Object.fromEntries(Object.entries(hosts).slice(0, MAX_HOSTS)),
|
|
268
|
+
methods: countBy(entries, (entry) => entry.request.method),
|
|
269
|
+
statusClasses: countBy(entries, (entry) => entry.response.status > 0 ? `${String(entry.response.status)[0]}xx` : "failed"),
|
|
270
|
+
...starts.length ? {
|
|
271
|
+
firstStarted: new Date(Math.min(...starts)).toISOString(),
|
|
272
|
+
lastFinished: new Date(Math.max(...ends)).toISOString(),
|
|
273
|
+
spanMs: Math.round(Math.max(...ends) - Math.min(...starts))
|
|
274
|
+
} : {},
|
|
275
|
+
totalResponseBytes: entries.reduce((total, entry) => total + Math.max(0, responseSize(entry) ?? 0), 0),
|
|
276
|
+
sizeBytes: context.source.size
|
|
277
|
+
},
|
|
278
|
+
targets,
|
|
279
|
+
...entries.length > MAX_ENTRY_TARGETS ? { targetsTruncated: true } : {}
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
async read(context, params) {
|
|
283
|
+
const { entries } = await load(context);
|
|
284
|
+
const target = params.target ?? "entries";
|
|
285
|
+
if (target === "entries") return readEntries(entries, params);
|
|
286
|
+
const match = /^entry:(\d+)$/.exec(target);
|
|
287
|
+
const index = match ? Number(match[1]) - 1 : -1;
|
|
288
|
+
const entry = entries[index];
|
|
289
|
+
if (!entry) throw new AgentError("target-not-found", `HAR target not found: "${target}".`, { pluginId: PLUGIN_ID });
|
|
290
|
+
let lines = entryDetail(entry, index);
|
|
291
|
+
const needle = params.filter?.trim().toLowerCase();
|
|
292
|
+
if (needle) lines = lines.filter((line) => line.toLowerCase().includes(needle));
|
|
293
|
+
const page = paginateLines(lines, params.cursor, params.maxBytes, PLUGIN_ID);
|
|
294
|
+
return {
|
|
295
|
+
content: page.content,
|
|
296
|
+
contentType: "markdown",
|
|
297
|
+
truncated: page.truncated,
|
|
298
|
+
...page.nextCursor ? { nextCursor: page.nextCursor } : {},
|
|
299
|
+
...needle ? { filterApplied: true } : {}
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
var extract_default = harExtractor;
|
|
304
|
+
export {
|
|
305
|
+
extract_default as default
|
|
306
|
+
};
|
|
@@ -0,0 +1,341 @@
|
|
|
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
|
+
isIfcHeader
|
|
4
|
+
} from "../chunks/chunk-B27PR6Q4.mjs";
|
|
5
|
+
import {
|
|
6
|
+
AgentError,
|
|
7
|
+
abortError,
|
|
8
|
+
escapeMarkdownCell,
|
|
9
|
+
isViewerAbortError,
|
|
10
|
+
paginateLines,
|
|
11
|
+
readBlob
|
|
12
|
+
} from "../chunks/chunk-IC3G2XE2.mjs";
|
|
13
|
+
import "../chunks/chunk-ORJ3DN65.mjs";
|
|
14
|
+
|
|
15
|
+
// ../plugins/ifc/src/extract.ts
|
|
16
|
+
var MAX_EXTRACT_BYTES = 128 * 1024 * 1024;
|
|
17
|
+
var MAX_NAMED_ELEMENTS = 5e3;
|
|
18
|
+
var MAX_STORED_INSTANCES_PER_TYPE = 500;
|
|
19
|
+
function decodeStepString(raw) {
|
|
20
|
+
let out = raw.replace(/''/g, "'");
|
|
21
|
+
out = out.replace(/\\X2\\([0-9A-Fa-f]+)\\X0\\/g, (_, hex) => {
|
|
22
|
+
let decoded = "";
|
|
23
|
+
for (let i = 0; i + 4 <= hex.length; i += 4) {
|
|
24
|
+
decoded += String.fromCharCode(Number.parseInt(hex.slice(i, i + 4), 16));
|
|
25
|
+
}
|
|
26
|
+
return decoded;
|
|
27
|
+
});
|
|
28
|
+
out = out.replace(/\\X4\\([0-9A-Fa-f]+)\\X0\\/g, (_, hex) => {
|
|
29
|
+
let decoded = "";
|
|
30
|
+
for (let i = 0; i + 8 <= hex.length; i += 8) {
|
|
31
|
+
decoded += String.fromCodePoint(Number.parseInt(hex.slice(i, i + 8), 16));
|
|
32
|
+
}
|
|
33
|
+
return decoded;
|
|
34
|
+
});
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
function stripStepComments(input) {
|
|
38
|
+
let out = "";
|
|
39
|
+
let inString = false;
|
|
40
|
+
let i = 0;
|
|
41
|
+
while (i < input.length) {
|
|
42
|
+
const ch = input[i];
|
|
43
|
+
if (inString) {
|
|
44
|
+
out += ch;
|
|
45
|
+
if (ch === "'") {
|
|
46
|
+
if (input[i + 1] === "'") {
|
|
47
|
+
out += "'";
|
|
48
|
+
i += 2;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
inString = false;
|
|
52
|
+
}
|
|
53
|
+
i += 1;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (ch === "'") {
|
|
57
|
+
inString = true;
|
|
58
|
+
out += ch;
|
|
59
|
+
i += 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (ch === "/" && input[i + 1] === "*") {
|
|
63
|
+
const end = input.indexOf("*/", i + 2);
|
|
64
|
+
if (end === -1) break;
|
|
65
|
+
out += " ";
|
|
66
|
+
i = end + 2;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
out += ch;
|
|
70
|
+
i += 1;
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
function splitStepArgs(argsText) {
|
|
75
|
+
const args = [];
|
|
76
|
+
let depth = 0;
|
|
77
|
+
let inString = false;
|
|
78
|
+
let start = 0;
|
|
79
|
+
for (let i = 0; i < argsText.length; i += 1) {
|
|
80
|
+
const ch = argsText[i];
|
|
81
|
+
if (inString) {
|
|
82
|
+
if (ch === "'") {
|
|
83
|
+
if (argsText[i + 1] === "'") {
|
|
84
|
+
i += 1;
|
|
85
|
+
} else {
|
|
86
|
+
inString = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (ch === "'") {
|
|
92
|
+
inString = true;
|
|
93
|
+
} else if (ch === "(") {
|
|
94
|
+
depth += 1;
|
|
95
|
+
} else if (ch === ")") {
|
|
96
|
+
depth -= 1;
|
|
97
|
+
} else if (ch === "," && depth === 0) {
|
|
98
|
+
args.push(argsText.slice(start, i).trim());
|
|
99
|
+
start = i + 1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const tail = argsText.slice(start).trim();
|
|
103
|
+
if (tail.length > 0 || args.length > 0) args.push(tail);
|
|
104
|
+
return args;
|
|
105
|
+
}
|
|
106
|
+
function parseStepScalarString(token) {
|
|
107
|
+
if (!token) return "";
|
|
108
|
+
const trimmed = token.trim();
|
|
109
|
+
if (trimmed.length >= 2 && trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
110
|
+
return decodeStepString(trimmed.slice(1, -1));
|
|
111
|
+
}
|
|
112
|
+
return "";
|
|
113
|
+
}
|
|
114
|
+
function parseStepStringList(token) {
|
|
115
|
+
if (!token) return [];
|
|
116
|
+
const trimmed = token.trim();
|
|
117
|
+
if (!trimmed.startsWith("(") || !trimmed.endsWith(")")) {
|
|
118
|
+
const single = parseStepScalarString(trimmed);
|
|
119
|
+
return single ? [single] : [];
|
|
120
|
+
}
|
|
121
|
+
const inner = trimmed.slice(1, -1).trim();
|
|
122
|
+
if (!inner) return [];
|
|
123
|
+
return splitStepArgs(inner).map(parseStepScalarString).filter(Boolean);
|
|
124
|
+
}
|
|
125
|
+
function extractHeaderCall(headerSection, name) {
|
|
126
|
+
const match = new RegExp(`\\b${name}\\s*\\(([\\s\\S]*?)\\)\\s*;`, "i").exec(headerSection);
|
|
127
|
+
return match ? splitStepArgs(match[1]) : [];
|
|
128
|
+
}
|
|
129
|
+
function parseHeaderSection(headerSection) {
|
|
130
|
+
const descArgs = extractHeaderCall(headerSection, "FILE_DESCRIPTION");
|
|
131
|
+
const nameArgs = extractHeaderCall(headerSection, "FILE_NAME");
|
|
132
|
+
const schemaArgs = extractHeaderCall(headerSection, "FILE_SCHEMA");
|
|
133
|
+
return {
|
|
134
|
+
description: parseStepStringList(descArgs[0]),
|
|
135
|
+
implementationLevel: parseStepScalarString(descArgs[1]),
|
|
136
|
+
name: parseStepScalarString(nameArgs[0]),
|
|
137
|
+
timeStamp: parseStepScalarString(nameArgs[1]),
|
|
138
|
+
author: parseStepStringList(nameArgs[2]),
|
|
139
|
+
organization: parseStepStringList(nameArgs[3]),
|
|
140
|
+
preprocessorVersion: parseStepScalarString(nameArgs[4]),
|
|
141
|
+
originatingSystem: parseStepScalarString(nameArgs[5]),
|
|
142
|
+
authorization: parseStepScalarString(nameArgs[6]),
|
|
143
|
+
schemas: parseStepStringList(schemaArgs[0])
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function parseIfcText(text) {
|
|
147
|
+
const cleaned = stripStepComments(text);
|
|
148
|
+
const headerMatch = /\bHEADER\s*;([\s\S]*?)\bENDSEC\s*;/i.exec(cleaned);
|
|
149
|
+
const header = parseHeaderSection(headerMatch?.[1] ?? "");
|
|
150
|
+
const dataStartMatch = /\bDATA\s*;/i.exec(cleaned);
|
|
151
|
+
const dataBody = dataStartMatch ? cleaned.slice(dataStartMatch.index + dataStartMatch[0].length) : "";
|
|
152
|
+
const endSecIndex = dataBody.search(/\bENDSEC\s*;/i);
|
|
153
|
+
const dataSection = endSecIndex >= 0 ? dataBody.slice(0, endSecIndex) : dataBody;
|
|
154
|
+
const entityCounts = /* @__PURE__ */ new Map();
|
|
155
|
+
const instancesByType = /* @__PURE__ */ new Map();
|
|
156
|
+
const namedElements = [];
|
|
157
|
+
let projectName;
|
|
158
|
+
let totalEntities = 0;
|
|
159
|
+
const entityPattern = /#(\d+)\s*=\s*([A-Z0-9_]+)\s*\(([^;]*)\)\s*;/gi;
|
|
160
|
+
let match;
|
|
161
|
+
while ((match = entityPattern.exec(dataSection)) !== null) {
|
|
162
|
+
const id = Number(match[1]);
|
|
163
|
+
const type = match[2].toUpperCase();
|
|
164
|
+
const rawArgs = match[3];
|
|
165
|
+
totalEntities += 1;
|
|
166
|
+
entityCounts.set(type, (entityCounts.get(type) ?? 0) + 1);
|
|
167
|
+
let list = instancesByType.get(type);
|
|
168
|
+
if (!list) {
|
|
169
|
+
list = [];
|
|
170
|
+
instancesByType.set(type, list);
|
|
171
|
+
}
|
|
172
|
+
if (list.length < MAX_STORED_INSTANCES_PER_TYPE) {
|
|
173
|
+
const compactArgs = rawArgs.replace(/\s+/g, " ").trim();
|
|
174
|
+
const preview = compactArgs.length > 200 ? `${compactArgs.slice(0, 197)}...` : compactArgs;
|
|
175
|
+
list.push(`#${id}=${type}(${preview});`);
|
|
176
|
+
}
|
|
177
|
+
const args = splitStepArgs(rawArgs);
|
|
178
|
+
const globalId = parseStepScalarString(args[0]);
|
|
179
|
+
const name = parseStepScalarString(args[2]);
|
|
180
|
+
if (globalId.length === 22) {
|
|
181
|
+
if (type === "IFCPROJECT" && name && !projectName) {
|
|
182
|
+
projectName = name;
|
|
183
|
+
}
|
|
184
|
+
if (name && namedElements.length < MAX_NAMED_ELEMENTS) {
|
|
185
|
+
namedElements.push({ id, type, globalId, name });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return { header, projectName, totalEntities, entityCounts, namedElements, instancesByType };
|
|
190
|
+
}
|
|
191
|
+
async function loadAndParseIfc(context) {
|
|
192
|
+
if (context.signal.aborted) throw abortError();
|
|
193
|
+
if (context.source.size > MAX_EXTRACT_BYTES) {
|
|
194
|
+
throw new AgentError("resource-limit", "IFC file exceeds the 128 MiB extraction limit.", { pluginId: "ifc" });
|
|
195
|
+
}
|
|
196
|
+
let bytes;
|
|
197
|
+
try {
|
|
198
|
+
bytes = await readBlob(context.file, context.signal);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
if (isViewerAbortError(error)) throw error;
|
|
201
|
+
throw new AgentError("invalid-file", "Failed to read IFC file.", { pluginId: "ifc", cause: error });
|
|
202
|
+
}
|
|
203
|
+
if (context.signal.aborted) throw abortError();
|
|
204
|
+
const decoder = new TextDecoder("utf-8", { fatal: false });
|
|
205
|
+
const headerSlice = decoder.decode(bytes.subarray(0, Math.min(bytes.byteLength, 65536)));
|
|
206
|
+
if (!isIfcHeader(headerSlice)) {
|
|
207
|
+
throw new AgentError("invalid-file", "The file is not a valid IFC (ISO-10303-21) document.", { pluginId: "ifc" });
|
|
208
|
+
}
|
|
209
|
+
return parseIfcText(decoder.decode(bytes));
|
|
210
|
+
}
|
|
211
|
+
function sortedEntityCounts(counts) {
|
|
212
|
+
return [...counts.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
|
|
213
|
+
}
|
|
214
|
+
function buildHeaderJson(header) {
|
|
215
|
+
return {
|
|
216
|
+
schemas: [...header.schemas],
|
|
217
|
+
name: header.name,
|
|
218
|
+
timeStamp: header.timeStamp,
|
|
219
|
+
description: [...header.description],
|
|
220
|
+
implementationLevel: header.implementationLevel,
|
|
221
|
+
author: [...header.author],
|
|
222
|
+
organization: [...header.organization],
|
|
223
|
+
preprocessorVersion: header.preprocessorVersion,
|
|
224
|
+
originatingSystem: header.originatingSystem,
|
|
225
|
+
authorization: header.authorization
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function buildSummaryLines(parsed) {
|
|
229
|
+
const lines = [];
|
|
230
|
+
const primarySchema = parsed.header.schemas[0] ?? "IFC";
|
|
231
|
+
lines.push(`# IFC Model Summary (${primarySchema})`, "");
|
|
232
|
+
if (parsed.projectName) lines.push(`- **Project**: ${parsed.projectName}`);
|
|
233
|
+
if (parsed.header.name) lines.push(`- **File Name**: ${parsed.header.name}`);
|
|
234
|
+
if (parsed.header.timeStamp) lines.push(`- **Timestamp**: ${parsed.header.timeStamp}`);
|
|
235
|
+
if (parsed.header.originatingSystem) lines.push(`- **Originating System**: ${parsed.header.originatingSystem}`);
|
|
236
|
+
if (parsed.header.description.length > 0) lines.push(`- **Description**: ${parsed.header.description.join("; ")}`);
|
|
237
|
+
lines.push(`- **Total Entities**: ${parsed.totalEntities}`);
|
|
238
|
+
lines.push(`- **Unique Entity Types**: ${parsed.entityCounts.size}`);
|
|
239
|
+
lines.push(`- **Named Root Elements**: ${parsed.namedElements.length}`, "");
|
|
240
|
+
const topEntities = sortedEntityCounts(parsed.entityCounts).slice(0, 20);
|
|
241
|
+
if (topEntities.length > 0) {
|
|
242
|
+
lines.push("## Top Entity Types", "", "| Entity Type | Count |", "| --- | ---: |");
|
|
243
|
+
for (const [type, count] of topEntities) {
|
|
244
|
+
lines.push(`| ${escapeMarkdownCell(type)} | ${count} |`);
|
|
245
|
+
}
|
|
246
|
+
lines.push("");
|
|
247
|
+
}
|
|
248
|
+
if (parsed.namedElements.length > 0) {
|
|
249
|
+
lines.push("## Named Elements (Sample)", "", "| ID | Type | Name |", "| ---: | --- | --- |");
|
|
250
|
+
for (const el of parsed.namedElements.slice(0, 25)) {
|
|
251
|
+
lines.push(`| #${el.id} | ${escapeMarkdownCell(el.type)} | ${escapeMarkdownCell(el.name)} |`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return lines;
|
|
255
|
+
}
|
|
256
|
+
var ifcExtractor = {
|
|
257
|
+
async inspect(context) {
|
|
258
|
+
const parsed = await loadAndParseIfc(context);
|
|
259
|
+
const metadata = {
|
|
260
|
+
schema: parsed.header.schemas[0] ?? "UNKNOWN",
|
|
261
|
+
schemas: [...parsed.header.schemas],
|
|
262
|
+
totalEntities: parsed.totalEntities,
|
|
263
|
+
uniqueEntityTypes: parsed.entityCounts.size,
|
|
264
|
+
namedElementCount: parsed.namedElements.length,
|
|
265
|
+
sizeBytes: context.source.size,
|
|
266
|
+
...parsed.projectName ? { projectName: parsed.projectName } : {},
|
|
267
|
+
...parsed.header.name ? { fileName: parsed.header.name } : {},
|
|
268
|
+
...parsed.header.timeStamp ? { timeStamp: parsed.header.timeStamp } : {},
|
|
269
|
+
...parsed.header.originatingSystem ? { originatingSystem: parsed.header.originatingSystem } : {},
|
|
270
|
+
...parsed.header.preprocessorVersion ? { preprocessorVersion: parsed.header.preprocessorVersion } : {},
|
|
271
|
+
...parsed.header.description.length > 0 ? { description: [...parsed.header.description] } : {},
|
|
272
|
+
...parsed.header.author.length > 0 ? { author: [...parsed.header.author] } : {},
|
|
273
|
+
...parsed.header.organization.length > 0 ? { organization: [...parsed.header.organization] } : {}
|
|
274
|
+
};
|
|
275
|
+
const targets = [
|
|
276
|
+
{ id: "summary", title: "Model Summary", kind: "entry", size: parsed.totalEntities },
|
|
277
|
+
{ id: "header", title: "STEP Header", kind: "entry" },
|
|
278
|
+
{ id: "entities", title: "Entity Type Counts", kind: "table", size: parsed.entityCounts.size }
|
|
279
|
+
];
|
|
280
|
+
if (parsed.namedElements.length > 0) {
|
|
281
|
+
targets.push({ id: "elements", title: "Named Elements", kind: "table", size: parsed.namedElements.length });
|
|
282
|
+
}
|
|
283
|
+
for (const [type, count] of sortedEntityCounts(parsed.entityCounts).slice(0, 12)) {
|
|
284
|
+
targets.push({ id: `type:${type}`, title: type, kind: "entity-type", size: count });
|
|
285
|
+
}
|
|
286
|
+
return { metadata, targets };
|
|
287
|
+
},
|
|
288
|
+
async read(context, params) {
|
|
289
|
+
const parsed = await loadAndParseIfc(context);
|
|
290
|
+
const target = params.target?.trim() || "summary";
|
|
291
|
+
let lines;
|
|
292
|
+
let contentType = "markdown";
|
|
293
|
+
if (target === "summary") {
|
|
294
|
+
lines = buildSummaryLines(parsed);
|
|
295
|
+
} else if (target === "header") {
|
|
296
|
+
lines = JSON.stringify(buildHeaderJson(parsed.header), null, 2).split("\n");
|
|
297
|
+
contentType = "json";
|
|
298
|
+
} else if (target === "entities") {
|
|
299
|
+
lines = ["| Entity Type | Count |", "| --- | ---: |"];
|
|
300
|
+
for (const [type, count] of sortedEntityCounts(parsed.entityCounts)) {
|
|
301
|
+
lines.push(`| ${escapeMarkdownCell(type)} | ${count} |`);
|
|
302
|
+
}
|
|
303
|
+
} else if (target === "elements") {
|
|
304
|
+
lines = ["| ID | Type | GlobalId | Name |", "| ---: | --- | --- | --- |"];
|
|
305
|
+
for (const el of parsed.namedElements) {
|
|
306
|
+
lines.push(
|
|
307
|
+
`| #${el.id} | ${escapeMarkdownCell(el.type)} | ${escapeMarkdownCell(el.globalId)} | ${escapeMarkdownCell(el.name)} |`
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
} else if (target.startsWith("type:")) {
|
|
311
|
+
const entityType = target.slice(5).trim().toUpperCase();
|
|
312
|
+
const instances = parsed.instancesByType.get(entityType);
|
|
313
|
+
if (!instances) {
|
|
314
|
+
throw new AgentError("target-not-found", `IFC entity type "${entityType}" not found.`, { pluginId: "ifc" });
|
|
315
|
+
}
|
|
316
|
+
lines = [...instances];
|
|
317
|
+
contentType = "text";
|
|
318
|
+
} else {
|
|
319
|
+
throw new AgentError("target-not-found", `IFC target not found: "${target}".`, { pluginId: "ifc" });
|
|
320
|
+
}
|
|
321
|
+
let filterApplied;
|
|
322
|
+
if (params.filter && params.filter.trim().length > 0) {
|
|
323
|
+
const needle = params.filter.toLowerCase();
|
|
324
|
+
lines = lines.filter((line) => line.toLowerCase().includes(needle));
|
|
325
|
+
filterApplied = true;
|
|
326
|
+
}
|
|
327
|
+
const page = paginateLines(lines, params.cursor, params.maxBytes, "ifc");
|
|
328
|
+
const resolvedType = contentType === "json" && (page.truncated || Boolean(params.cursor) || Boolean(filterApplied)) ? "text" : contentType;
|
|
329
|
+
return {
|
|
330
|
+
content: page.content,
|
|
331
|
+
contentType: resolvedType,
|
|
332
|
+
...page.nextCursor ? { nextCursor: page.nextCursor } : {},
|
|
333
|
+
truncated: page.truncated,
|
|
334
|
+
...filterApplied !== void 0 ? { filterApplied } : {}
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
var extract_default = ifcExtractor;
|
|
339
|
+
export {
|
|
340
|
+
extract_default as default
|
|
341
|
+
};
|