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.
Files changed (354) hide show
  1. package/LICENSE +177 -0
  2. package/README.md +55 -2
  3. package/SKILL.md +101 -0
  4. package/chunks/browser-probe-5STDX455.mjs +17 -0
  5. package/chunks/browser-probe-F5RX44T3.mjs +24 -0
  6. package/chunks/chunk-2C34VMNV.mjs +108 -0
  7. package/chunks/chunk-3OZ56PUH.mjs +97 -0
  8. package/chunks/chunk-3YRWCQGV.mjs +38 -0
  9. package/chunks/chunk-53MJMIN4.mjs +23 -0
  10. package/chunks/chunk-5LOC7IST.mjs +372 -0
  11. package/chunks/chunk-5XTYLZF3.mjs +559 -0
  12. package/chunks/chunk-5ZHDYRGV.mjs +64 -0
  13. package/chunks/chunk-6CQL4K2K.mjs +21 -0
  14. package/chunks/chunk-6EVJJFOH.mjs +243 -0
  15. package/chunks/chunk-6NWSQGYE.mjs +68 -0
  16. package/chunks/chunk-7O5JLQE7.mjs +1 -0
  17. package/chunks/chunk-A6AQI6DF.mjs +321 -0
  18. package/chunks/chunk-AYF63UBE.mjs +79 -0
  19. package/chunks/chunk-B27PR6Q4.mjs +17 -0
  20. package/chunks/chunk-BP7LORL4.mjs +13 -0
  21. package/chunks/chunk-BVCRJLCD.mjs +109 -0
  22. package/chunks/chunk-CLSEE3VA.mjs +28 -0
  23. package/chunks/chunk-CO2ZAQIK.mjs +52 -0
  24. package/chunks/chunk-CQWM5GMU.mjs +167 -0
  25. package/chunks/chunk-CZFFYCMJ.mjs +136 -0
  26. package/chunks/chunk-D3CS6TIK.mjs +419 -0
  27. package/chunks/chunk-DJLFVMDJ.mjs +807 -0
  28. package/chunks/chunk-DJXVCKIO.mjs +30 -0
  29. package/chunks/chunk-EMXODK3K.mjs +94 -0
  30. package/chunks/chunk-EOJ7ZCDK.mjs +227 -0
  31. package/chunks/chunk-H4TBN22D.mjs +100 -0
  32. package/chunks/chunk-HI7TURZM.mjs +2256 -0
  33. package/chunks/chunk-HUSX3ZU3.mjs +58 -0
  34. package/chunks/chunk-IC3G2XE2.mjs +436 -0
  35. package/chunks/chunk-IGEGIF35.mjs +2034 -0
  36. package/chunks/chunk-IZGTVZHE.mjs +90 -0
  37. package/chunks/chunk-J4G7LUPA.mjs +117 -0
  38. package/chunks/chunk-JBAJW66L.mjs +4220 -0
  39. package/chunks/chunk-JKQUF2MM.mjs +438 -0
  40. package/chunks/chunk-KAMPC5TK.mjs +131 -0
  41. package/chunks/chunk-KSKEMJVC.mjs +145 -0
  42. package/chunks/chunk-LRHHRZLE.mjs +29 -0
  43. package/chunks/chunk-M37ZOAUG.mjs +93 -0
  44. package/chunks/chunk-MG7LUDXO.mjs +187 -0
  45. package/chunks/chunk-NGVHHTQD.mjs +125 -0
  46. package/chunks/chunk-NQ7J2NH6.mjs +50 -0
  47. package/chunks/chunk-NUMNHVSI.mjs +60 -0
  48. package/chunks/chunk-ORJ3DN65.mjs +58 -0
  49. package/chunks/chunk-QOUEBPPL.mjs +15 -0
  50. package/chunks/chunk-QR3Y3UKM.mjs +194 -0
  51. package/chunks/chunk-RFKYE7SE.mjs +50 -0
  52. package/chunks/chunk-SH57XOAV.mjs +33 -0
  53. package/chunks/chunk-TB5ISPA4.mjs +1 -0
  54. package/chunks/chunk-UGAU3V4V.mjs +206 -0
  55. package/chunks/chunk-WDN6NMVU.mjs +36 -0
  56. package/chunks/chunk-WWTLSPEG.mjs +3999 -0
  57. package/chunks/chunk-XDW56XVX.mjs +69 -0
  58. package/chunks/chunk-XRT7TAAY.mjs +27 -0
  59. package/chunks/chunk-XTW4HNIJ.mjs +418 -0
  60. package/chunks/chunk-YPLWNGCC.mjs +17 -0
  61. package/chunks/chunk-ZBR7RQQE.mjs +64 -0
  62. package/chunks/chunk-ZUHJIGHP.mjs +300 -0
  63. package/chunks/deflate-IINN6MRE.mjs +19 -0
  64. package/chunks/jpeg-N3DSYEAQ.mjs +964 -0
  65. package/chunks/jxl_oxide_wasm-3UN6G3YN.mjs +589 -0
  66. package/chunks/lerc-5LP7Q554.mjs +2086 -0
  67. package/chunks/lzw-Z2ZZBEWD.mjs +137 -0
  68. package/chunks/packbits-3S2JASDB.mjs +34 -0
  69. package/chunks/pdf.worker-PUGU2NS2.mjs +67416 -0
  70. package/chunks/probe-22WNVZ3I.mjs +17 -0
  71. package/chunks/probe-2P4CTFCY.mjs +14 -0
  72. package/chunks/probe-2QBNDPYK.mjs +18 -0
  73. package/chunks/probe-34TOVXUI.mjs +11 -0
  74. package/chunks/probe-3W2HOWBM.mjs +20 -0
  75. package/chunks/probe-42OBMD35.mjs +23 -0
  76. package/chunks/probe-43RVHUBG.mjs +17 -0
  77. package/chunks/probe-4O362IEX.mjs +18 -0
  78. package/chunks/probe-4WF34ZXS.mjs +11 -0
  79. package/chunks/probe-5ZITS3T5.mjs +40 -0
  80. package/chunks/probe-5ZS5DHFP.mjs +21 -0
  81. package/chunks/probe-62RFYKCP.mjs +14 -0
  82. package/chunks/probe-64JTFRH4.mjs +41 -0
  83. package/chunks/probe-6YJQJJ3R.mjs +518 -0
  84. package/chunks/probe-6YMOOV53.mjs +39 -0
  85. package/chunks/probe-BYBD2WAK.mjs +239 -0
  86. package/chunks/probe-CZZNJOHV.mjs +20 -0
  87. package/chunks/probe-DJMPK6HU.mjs +11 -0
  88. package/chunks/probe-FMWIF4LX.mjs +33 -0
  89. package/chunks/probe-FYPH6CYY.mjs +206 -0
  90. package/chunks/probe-G6PPXKBE.mjs +15 -0
  91. package/chunks/probe-GJ5OUOQ3.mjs +32 -0
  92. package/chunks/probe-H6J7TUY2.mjs +95 -0
  93. package/chunks/probe-IGZ47OE3.mjs +68 -0
  94. package/chunks/probe-IL5HO3OK.mjs +46 -0
  95. package/chunks/probe-INYCDZHO.mjs +27 -0
  96. package/chunks/probe-JFH545GO.mjs +11 -0
  97. package/chunks/probe-JZYDRITV.mjs +18 -0
  98. package/chunks/probe-K3WW5O5K.mjs +26 -0
  99. package/chunks/probe-KB4T466L.mjs +70 -0
  100. package/chunks/probe-KY7SIIXD.mjs +13 -0
  101. package/chunks/probe-L2P263WT.mjs +16 -0
  102. package/chunks/probe-LEP3RQPD.mjs +11 -0
  103. package/chunks/probe-M2QWULOI.mjs +119 -0
  104. package/chunks/probe-M7AYZBD3.mjs +35 -0
  105. package/chunks/probe-MEN3BMBB.mjs +22 -0
  106. package/chunks/probe-MNIGKDWT.mjs +163 -0
  107. package/chunks/probe-NFVFWB4M.mjs +56 -0
  108. package/chunks/probe-NJGSTL6R.mjs +161 -0
  109. package/chunks/probe-O73EHWT3.mjs +14 -0
  110. package/chunks/probe-OG2XYCG2.mjs +25 -0
  111. package/chunks/probe-OTKJKTNS.mjs +10 -0
  112. package/chunks/probe-OZKO3C2V.mjs +27 -0
  113. package/chunks/probe-PBL4KITG.mjs +12 -0
  114. package/chunks/probe-PEFZNH2T.mjs +21 -0
  115. package/chunks/probe-R4SSEXES.mjs +27 -0
  116. package/chunks/probe-RCAUVV27.mjs +29 -0
  117. package/chunks/probe-RPGBKGPI.mjs +20 -0
  118. package/chunks/probe-S2I46SEO.mjs +10 -0
  119. package/chunks/probe-SGDD4U4Q.mjs +165 -0
  120. package/chunks/probe-SPQO5LHI.mjs +9 -0
  121. package/chunks/probe-TBR6UGRZ.mjs +19 -0
  122. package/chunks/probe-TNKNILAW.mjs +21 -0
  123. package/chunks/probe-TVRJBPXH.mjs +48 -0
  124. package/chunks/probe-UESMTUQ5.mjs +33 -0
  125. package/chunks/probe-VDXFEZ5Q.mjs +16 -0
  126. package/chunks/probe-VX7JCDW6.mjs +39 -0
  127. package/chunks/probe-W7M55OPE.mjs +64 -0
  128. package/chunks/probe-XUBTIWGE.mjs +13 -0
  129. package/chunks/probe-ZF7KIRHO.mjs +36 -0
  130. package/chunks/raw-JJRPYAXO.mjs +16 -0
  131. package/chunks/tiff-metadata-7MWLNVW2.mjs +2990 -0
  132. package/chunks/webimage-D6XSCCTJ.mjs +56 -0
  133. package/chunks/zip-reader-YUGANW4Z.mjs +92 -0
  134. package/chunks/zstd-AH2S24PU.mjs +121 -0
  135. package/cli-main.mjs +297 -0
  136. package/cli.mjs +3 -0
  137. package/extractors/apple-plist.mjs +145 -0
  138. package/extractors/archive-metadata-viewer.mjs +1401 -0
  139. package/extractors/bittorrent-metadata.mjs +369 -0
  140. package/extractors/calendar-contacts.mjs +328 -0
  141. package/extractors/camera-raw.mjs +201 -0
  142. package/extractors/chm-reader.mjs +1842 -0
  143. package/extractors/comic-book-reader.mjs +307 -0
  144. package/extractors/design-source.mjs +1801 -0
  145. package/extractors/dev-array-viewer.mjs +825 -0
  146. package/extractors/dev-native-binary-viewer.mjs +1661 -0
  147. package/extractors/dev-source-map-viewer.mjs +416 -0
  148. package/extractors/dev-wasm-viewer.mjs +506 -0
  149. package/extractors/dicom.mjs +383 -0
  150. package/extractors/djvu-reader.mjs +337 -0
  151. package/extractors/duckdb-data.mjs +49174 -0
  152. package/extractors/epub-reader.mjs +222 -0
  153. package/extractors/excel-workbook.mjs +27057 -0
  154. package/extractors/fictionbook-reader.mjs +362 -0
  155. package/extractors/font-viewer.mjs +441 -0
  156. package/extractors/general-raster.mjs +444 -0
  157. package/extractors/hdr-image.mjs +1685 -0
  158. package/extractors/http-archive.mjs +306 -0
  159. package/extractors/ifc.mjs +341 -0
  160. package/extractors/iwork.mjs +640 -0
  161. package/extractors/microsoft-project.mjs +174 -0
  162. package/extractors/mind-map.mjs +607 -0
  163. package/extractors/ml-weights.mjs +649 -0
  164. package/extractors/modern-raster.mjs +620 -0
  165. package/extractors/ofd-reader.mjs +973 -0
  166. package/extractors/outlook-pst.mjs +997 -0
  167. package/extractors/pdfjs-pdf.mjs +32056 -0
  168. package/extractors/photoshop-document.mjs +17448 -0
  169. package/extractors/safe-svg.mjs +163 -0
  170. package/extractors/scientific-data.mjs +2041 -0
  171. package/extractors/sqlite-database.mjs +333 -0
  172. package/extractors/statistical-data.mjs +297 -0
  173. package/extractors/visio.mjs +141 -0
  174. package/extractors/x509-certificate.mjs +588 -0
  175. package/extractors/xps-reader.mjs +896 -0
  176. package/index.mjs +83 -0
  177. package/licenses/dicom-parser/1.8.21/LICENSE +21 -0
  178. package/licenses/libraw-wasm/1.6.0/COPYRIGHT.LibRaw +27 -0
  179. package/licenses/libraw-wasm/1.6.0/LICENSE.Emscripten +102 -0
  180. package/licenses/libraw-wasm/1.6.0/LICENSE.LibRaw-CDDL-1.0 +340 -0
  181. package/licenses/libraw-wasm/1.6.0/LICENSE.Little-CMS-MIT +22 -0
  182. package/licenses/libraw-wasm/1.6.0/LICENSE.libpng +134 -0
  183. package/licenses/libraw-wasm/1.6.0/LICENSE.libraw-wasm-ISC +15 -0
  184. package/licenses/libraw-wasm/1.6.0/LICENSE.zlib +22 -0
  185. package/licenses/libraw-wasm/1.6.0/NOTICE.IJG-libjpeg +49 -0
  186. package/licenses/libraw-wasm/1.6.0/SOURCE.md +25 -0
  187. package/licenses/libraw-wasm/1.6.0/THIRD_PARTY_NOTICES.md +14 -0
  188. package/licenses/mediabunny/1.55.3/MPL-2.0.txt +373 -0
  189. package/licenses/mediabunny/1.55.3/SOURCE.md +16 -0
  190. package/licenses/openskp/1.3.0/LICENSE +21 -0
  191. package/package.json +34 -4
  192. package/renderer-host/assets/ColladaComposer-TCm9fgZa.js +1 -0
  193. package/renderer-host/assets/ColladaParser-BHTzbhBz.js +3 -0
  194. package/renderer-host/assets/FBXLoader-D1vDnL3o.js +8 -0
  195. package/renderer-host/assets/agent-CKvDbj87.js +1 -0
  196. package/renderer-host/assets/amf-BkE--DNX.js +1 -0
  197. package/renderer-host/assets/animation-Dt0WW2cB.js +1 -0
  198. package/renderer-host/assets/archive-client-CL5yOgwH.js +1 -0
  199. package/renderer-host/assets/archive.worker-CcLnJ9FC.js +1 -0
  200. package/renderer-host/assets/audio-visualizer-CiyGNhY2.js +1 -0
  201. package/renderer-host/assets/basedecoder-BuG7fe0q.js +1 -0
  202. package/renderer-host/assets/book-source-28BQcBKR.js +1 -0
  203. package/renderer-host/assets/book-worker-DUt14LJO.js +1 -0
  204. package/renderer-host/assets/browser-C0pGRq_c.js +1 -0
  205. package/renderer-host/assets/client-CU2ERPtk.js +1 -0
  206. package/renderer-host/assets/container-inspection-ekEPWWcy.js +1 -0
  207. package/renderer-host/assets/data-table-OJQe3aN5.js +1 -0
  208. package/renderer-host/assets/decode-hBroL8C1.js +1 -0
  209. package/renderer-host/assets/decode-tiff-CP1xdrF_.js +5 -0
  210. package/renderer-host/assets/decoder-worker-B0sdTVlF.js +1 -0
  211. package/renderer-host/assets/decoder-worker-CBiHE971.js +3 -0
  212. package/renderer-host/assets/decoder-worker-Cr5oP97p.js +5 -0
  213. package/renderer-host/assets/decoder-worker-DIdLFebY.js +11 -0
  214. package/renderer-host/assets/decoder-worker-DLeuEYxq.js +1 -0
  215. package/renderer-host/assets/decoder.worker-BXAaF0Qj.js +1 -0
  216. package/renderer-host/assets/decoder.worker-yaM6uups.js +1 -0
  217. package/renderer-host/assets/deflate-DPjr4M2G.js +1 -0
  218. package/renderer-host/assets/deflate-S3QmZI-f.js +1 -0
  219. package/renderer-host/assets/dual-track-playback-CxjGms-W.js +1 -0
  220. package/renderer-host/assets/ext-searchbox-BIdon51Z.js +164 -0
  221. package/renderer-host/assets/ffmpeg-playback-DzCJz9Ny.js +1 -0
  222. package/renderer-host/assets/gltf-PozNLKNg.js +1 -0
  223. package/renderer-host/assets/hdf5.worker-BO3TrRup.js +1 -0
  224. package/renderer-host/assets/heif-worker-CC9DI3ZR.js +1 -0
  225. package/renderer-host/assets/id3-uzaDmDwy.js +1 -0
  226. package/renderer-host/assets/ifc.worker-KIbgAIsy.js +1 -0
  227. package/renderer-host/assets/image-load-SK3ULGWm.js +1 -0
  228. package/renderer-host/assets/index-DtiyOy_J.js +2 -0
  229. package/renderer-host/assets/jpeg-AGQ46WDa.js +1 -0
  230. package/renderer-host/assets/jpeg-Dm0yBuYB.js +1 -0
  231. package/renderer-host/assets/jszip.min-DCdQ6XWv.js +2 -0
  232. package/renderer-host/assets/jxl_oxide_wasm-BJKDqoXP.js +1 -0
  233. package/renderer-host/assets/jxl_oxide_wasm_bg-C5JqlrFv.wasm +0 -0
  234. package/renderer-host/assets/kernel.worker-B58X9XWu.js +1 -0
  235. package/renderer-host/assets/kernel.worker-BcQYKb39.js +8 -0
  236. package/renderer-host/assets/kernel.worker-BdWmPdqg.js +1 -0
  237. package/renderer-host/assets/kernel.worker-C7qxomuK.js +1 -0
  238. package/renderer-host/assets/kernel.worker-D88TbQnz.js +1 -0
  239. package/renderer-host/assets/laz-Lt10LsWd.js +1 -0
  240. package/renderer-host/assets/lerc-BxVqCKaH.js +3 -0
  241. package/renderer-host/assets/lerc-Cuor-Zm2.js +1 -0
  242. package/renderer-host/assets/lzw-D2FslT4L.js +1 -0
  243. package/renderer-host/assets/lzw-DODNa9l5.js +1 -0
  244. package/renderer-host/assets/mediabunny-viewer-BniHVEWJ.js +16 -0
  245. package/renderer-host/assets/model-Drd3vqcF.js +1 -0
  246. package/renderer-host/assets/obj-B3p81LL2.js +9 -0
  247. package/renderer-host/assets/off-QQbiKPTX.js +1 -0
  248. package/renderer-host/assets/ogg-probe-C2TT74FL.js +1 -0
  249. package/renderer-host/assets/ogg-viewer-Dc8K-tas.js +9 -0
  250. package/renderer-host/assets/packbits-DCimUQ1T.js +1 -0
  251. package/renderer-host/assets/paged-C8AQD7sX.js +319 -0
  252. package/renderer-host/assets/pako.esm-0UYEm1Jg.js +2 -0
  253. package/renderer-host/assets/pako.esm-CtVA0R7W.js +1 -0
  254. package/renderer-host/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
  255. package/renderer-host/assets/ply-C3_RRA7n.js +2 -0
  256. package/renderer-host/assets/points.worker-CA8v75dl.js +2 -0
  257. package/renderer-host/assets/probe-asf-C_UpCBly.js +14 -0
  258. package/renderer-host/assets/range-reader-BMfLhWcp.js +1 -0
  259. package/renderer-host/assets/raw-A-vJRPpa.js +1 -0
  260. package/renderer-host/assets/resource-cache-CHocY8K3.js +1 -0
  261. package/renderer-host/assets/resources-6AmS6O5e.js +1 -0
  262. package/renderer-host/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
  263. package/renderer-host/assets/safe-content-CWHf8jex.js +1 -0
  264. package/renderer-host/assets/sanitize-D56ODnaM.js +1 -0
  265. package/renderer-host/assets/scene-adapter-CaCLr1am.js +1 -0
  266. package/renderer-host/assets/scene.worker-CJViWLYo.js +24 -0
  267. package/renderer-host/assets/scene.worker-D7koFZY8.js +2 -0
  268. package/renderer-host/assets/skp-adapter-jl6q24fW.js +1 -0
  269. package/renderer-host/assets/skp.worker-D9ujTXFV.js +1 -0
  270. package/renderer-host/assets/src-1Won7FxU.js +88 -0
  271. package/renderer-host/assets/src-3RoHqOkA.js +7 -0
  272. package/renderer-host/assets/src-4zBOL6Jt.js +1 -0
  273. package/renderer-host/assets/src-6v8-hoR3.js +24 -0
  274. package/renderer-host/assets/src-8Jx9gbII.js +1 -0
  275. package/renderer-host/assets/src-B1WA0dRu.js +64 -0
  276. package/renderer-host/assets/src-B5ijbemo.js +9 -0
  277. package/renderer-host/assets/src-B8DH2GJe.js +17 -0
  278. package/renderer-host/assets/src-B9t_iEO3.js +58 -0
  279. package/renderer-host/assets/src-BCC58C0X.js +1 -0
  280. package/renderer-host/assets/src-BCwENs26.js +1 -0
  281. package/renderer-host/assets/src-BEirBh4c.js +27 -0
  282. package/renderer-host/assets/src-BHR6n7Fj.js +1 -0
  283. package/renderer-host/assets/src-BIlLq0QT.js +169 -0
  284. package/renderer-host/assets/src-BKlK1jcN.js +1 -0
  285. package/renderer-host/assets/src-BN0FUJhs.js +8 -0
  286. package/renderer-host/assets/src-BWElAdlq.js +52 -0
  287. package/renderer-host/assets/src-BXg11IjY.js +4 -0
  288. package/renderer-host/assets/src-BbBdnTjJ.js +2 -0
  289. package/renderer-host/assets/src-BbFZbZsL.js +2 -0
  290. package/renderer-host/assets/src-BdPbFRd-.js +24 -0
  291. package/renderer-host/assets/src-BpbGaBrT.js +182 -0
  292. package/renderer-host/assets/src-BwIl76_H.js +7 -0
  293. package/renderer-host/assets/src-C2e6QJIj.js +10 -0
  294. package/renderer-host/assets/src-C2gNidHF.js +989 -0
  295. package/renderer-host/assets/src-C9Uz3C-q.js +432 -0
  296. package/renderer-host/assets/src-CBUhG6W5.js +7 -0
  297. package/renderer-host/assets/src-CQDGi3Qa.js +10 -0
  298. package/renderer-host/assets/src-CRLCRg0N.js +21 -0
  299. package/renderer-host/assets/src-CS5rqxBy.js +10 -0
  300. package/renderer-host/assets/src-CWZdSJQw.js +7 -0
  301. package/renderer-host/assets/src-CXnpsVpU.js +27 -0
  302. package/renderer-host/assets/src-CnhXvqQY.js +8 -0
  303. package/renderer-host/assets/src-CpExg0ZA.js +9 -0
  304. package/renderer-host/assets/src-CrLmL3wU.js +5 -0
  305. package/renderer-host/assets/src-CrYEJ5uz.js +2 -0
  306. package/renderer-host/assets/src-D-iIkSqZ.js +222 -0
  307. package/renderer-host/assets/src-D6sH9uTT.js +23 -0
  308. package/renderer-host/assets/src-D8zHDJh_.js +10 -0
  309. package/renderer-host/assets/src-D9OFaPNV.js +1 -0
  310. package/renderer-host/assets/src-DCI_ff7c.js +1 -0
  311. package/renderer-host/assets/src-DCrbiTpH.js +18 -0
  312. package/renderer-host/assets/src-DK8DvtMd.js +115 -0
  313. package/renderer-host/assets/src-DWGlOVjt.js +17 -0
  314. package/renderer-host/assets/src-DbvEX_Ct.js +6 -0
  315. package/renderer-host/assets/src-Dezc2dj1.js +1 -0
  316. package/renderer-host/assets/src-Dh5VD1lL.js +11 -0
  317. package/renderer-host/assets/src-DlwABqw5.js +1 -0
  318. package/renderer-host/assets/src-DlxETlTh.js +44 -0
  319. package/renderer-host/assets/src-Dmd6BvBh.js +387 -0
  320. package/renderer-host/assets/src-DpgvaJNJ.js +24 -0
  321. package/renderer-host/assets/src-DpjRB2sv.js +1 -0
  322. package/renderer-host/assets/src-Dvn41FR7.js +90 -0
  323. package/renderer-host/assets/src-DwcPYp7X.js +1 -0
  324. package/renderer-host/assets/src-HUxhcDlO.js +2 -0
  325. package/renderer-host/assets/src-Jhqg3J8L.js +2 -0
  326. package/renderer-host/assets/src-MO5bLsLj.js +4126 -0
  327. package/renderer-host/assets/src-N8XBQaK4.js +20 -0
  328. package/renderer-host/assets/src-XZ_0U972.js +1 -0
  329. package/renderer-host/assets/src-Y6mXl4vh.js +29 -0
  330. package/renderer-host/assets/src-b9aXVJde.js +100 -0
  331. package/renderer-host/assets/src-d2U6neq8.js +37 -0
  332. package/renderer-host/assets/src-hCrza_Lf.js +1 -0
  333. package/renderer-host/assets/src-jUGjKzOV.js +1 -0
  334. package/renderer-host/assets/src-rJN_jaC5.js +1 -0
  335. package/renderer-host/assets/src-vOBd-1zk.js +5 -0
  336. package/renderer-host/assets/src-wrrVkfrK.js +1 -0
  337. package/renderer-host/assets/src-yCrAObB-.js +1 -0
  338. package/renderer-host/assets/src-zrBiCtay.js +7 -0
  339. package/renderer-host/assets/stl-adapter-CLkWHoOn.js +1 -0
  340. package/renderer-host/assets/stl.worker-C-anHijM.js +1 -0
  341. package/renderer-host/assets/three-mf-BSrcsdQD.js +2 -0
  342. package/renderer-host/assets/webimage-zQMH-_zR.js +1 -0
  343. package/renderer-host/assets/webm-14HHwfWy.js +1 -0
  344. package/renderer-host/assets/worker-QK2gViTu.js +1 -0
  345. package/renderer-host/assets/x6-dng-worker-CNf3zUP-.js +1 -0
  346. package/renderer-host/assets/xml.browser-CC8-XAyN.js +1 -0
  347. package/renderer-host/assets/zip-core-base-DD8akpjq.js +1 -0
  348. package/renderer-host/assets/zip-core-custom-CfPFs1lw.js +1 -0
  349. package/renderer-host/assets/zip-source-CLF3Hfcg.js +1 -0
  350. package/renderer-host/assets/zstd-CmwSLjHB.js +1 -0
  351. package/renderer-host/assets/zstd-i4Jwubnx.js +1 -0
  352. package/renderer-host/index.html +65 -0
  353. package/vendor-manifest.json +1433 -0
  354. package/worker.mjs +262 -0
package/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -1,3 +1,56 @@
1
- # Temporary Holding Version
1
+ # anyfile-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Let AI agents read local files that plain text tools cannot: PDF, Office, SQLite/DuckDB, Outlook PST, Apple plist, HDF5, SPSS, EPUB, archives, PSD/EXR/HEIC/RAW, DWG/DXF/IFC/STEP, 3D models, and many more. Everything runs locally and read-only; file contents are never uploaded.
4
+
5
+ `anyfile` is the agent edition of [Anyfile Viewer](https://www.anyfile.top) and uses the same format engine. Guide: [English](https://www.anyfile.top/en/agent) · [简体中文](https://www.anyfile.top/zh-CN/agent)
6
+
7
+ Requires **Node.js 24+**. Rendering documents, CAD, and 3D also needs a local Chrome, Edge, Brave, or Chromium.
8
+
9
+ ## Choose how to connect
10
+
11
+ | Path | For | Install |
12
+ |---|---|---|
13
+ | **Skill + CLI** | Agents with a shell (Claude Code, Codex, Cursor, Gemini CLI, …) | `npx skills add tianzhipeng-git/anyfile-skills` (Claude Code: `/plugin marketplace add tianzhipeng-git/anyfile-skills`, then `/plugin install anyfile@anyfile-skills`) |
14
+ | **MCP** | Clients without a shell (Claude Desktop, chat apps) | Add the stdio server below to the client config |
15
+
16
+ ### Skill + CLI
17
+
18
+ The skill tells the agent when to use `anyfile` and how to follow the inspect → read / query / render workflow. The agent runs the CLI through `npx -y anyfile-cli`, or you can install it globally with `npm i -g anyfile-cli`.
19
+
20
+ ```bash
21
+ anyfile inspect ./archive.pst # format, capabilities, metadata, target ids
22
+ anyfile read ./archive.pst --target <target-id> # structured Markdown / JSON, paginated
23
+ anyfile query ./data.duckdb --sql "SELECT * FROM items LIMIT 20"
24
+ anyfile render ./drawing.dwg --out preview.png # bounded PNG preview
25
+ ```
26
+
27
+ ### MCP
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "anyfile": {
33
+ "command": "npx",
34
+ "args": ["-y", "anyfile-cli", "mcp", "--allow-dir", "/abs/path/to/files"]
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ Tools: `inspect_file`, `read_file`, `query_file`, `render_file`. Only the startup directory and the `--allow-dir` roots are readable.
41
+
42
+ ## Offline use
43
+
44
+ Some formats download a WASM decoder on first use into `~/.cache/anyfile/vendor/` (override with `ANYFILE_CACHE_DIR`), verified against a bundled SHA-256 manifest. To pre-fetch them, run `anyfile cache add all`. Use `ANYFILE_BROWSER_PATH` / `ANYFILE_BROWSER_ARGS` to choose the browser used for rendering.
45
+
46
+ ## Develop and release
47
+
48
+ This directory is the private workspace package `@anyfile/agent`. Its build output `dist/` is the published npm package `anyfile-cli`, generated by `scripts/build.mjs`. For versioning rules, release criteria, and automated publishing via `agent-v*` tags, see [`docs/release.md`](../../docs/release.md).
49
+
50
+ ```bash
51
+ pnpm prepare:assets # once: generates public/vendor/manifest.json
52
+ pnpm --filter @anyfile/agent build # -> viewer/agent/dist
53
+ pnpm test viewer/agent # includes the dist smoke test
54
+ ```
55
+
56
+ The skill source is [`skills/anyfile/SKILL.md`](https://github.com/tianzhipeng-git/anyfile-viewer/blob/main/skills/anyfile/SKILL.md). After changing it, run `pnpm sync:skills` (which defaults to `../anyfile-skills`), then commit and push in [anyfile-skills](https://github.com/tianzhipeng-git/anyfile-skills), the install source for `npx skills add` and the Claude Code marketplace.
package/SKILL.md ADDED
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: anyfile
3
+ description: Read local files that plain text tools cannot — binary, proprietary, archive, and database formats such as PDF, Office/iWork/Visio/Project, SQLite/DuckDB, Outlook PST, Apple plist, HDF5/NetCDF, SPSS/Stata/SAS, EPUB/DjVu/CHM, ZIP/7z/RAR, PSD/EXR/HEIC/JXL/camera RAW/DICOM, CAD and BIM (DWG/DXF/IFC/STEP), 3D models, fonts, ML weights, WASM/ELF/PE binaries, and extensionless blobs. Use when the user asks what is inside such a file, or when Read/cat returns binary garbage. Runs the `anyfile` CLI locally and read-only to inspect the format, extract structured text, run read-only SQL, or render a bounded PNG preview.
4
+ license: Apache-2.0
5
+ compatibility: Requires Node.js 24+ (the CLI runs via npx). Rendering documents, CAD, and 3D needs a local Chrome, Edge, Brave, or Chromium.
6
+ ---
7
+
8
+ # anyfile
9
+
10
+ `anyfile` identifies and reads a wide range of file formats entirely on this machine. Nothing is uploaded, and it never modifies files.
11
+
12
+ Do not use it for plain text, source code, or images your own file-reading tool can already view (PNG, JPEG, GIF, WebP). Read those directly.
13
+
14
+ ## Setup
15
+
16
+ Run `anyfile --version`. If the command is not found, use `npx -y anyfile-cli` instead of `anyfile` in every command below (Node.js 24+ required). The user can install it permanently with `npm i -g anyfile-cli`.
17
+
18
+ ## Workflow
19
+
20
+ ### 1. Inspect first
21
+
22
+ ```bash
23
+ anyfile inspect ./data.sqlite
24
+ ```
25
+
26
+ This prints JSON: the detected format, `capabilities`, format `metadata`, and readable `targets`.
27
+
28
+ ```json
29
+ {
30
+ "pluginId": "sqlite-database",
31
+ "formatName": "SQLite viewer",
32
+ "matchedBy": "extension",
33
+ "capabilities": ["read", "query"],
34
+ "metadata": { "sizeBytes": 12288, "tableCount": 2, "tables": [{ "name": "users", "rows": 5, "columns": ["id:INTEGER", "name:TEXT"] }] },
35
+ "targets": [
36
+ { "id": "schema", "title": "Database Schema", "kind": "entry" },
37
+ { "id": "table:users", "title": "users", "kind": "table", "size": 5 }
38
+ ]
39
+ }
40
+ ```
41
+
42
+ `metadata` often answers the question on its own (page count, table schemas, author, dimensions). Stop there if it does.
43
+
44
+ ### 2. Choose the next command from `capabilities`
45
+
46
+ | Goal | Command | When |
47
+ |---|---|---|
48
+ | Text, tables, or JSON | `anyfile read <path> [--target <id>]` | `capabilities` contains `read` |
49
+ | Filter or aggregate data | `anyfile query <path> --sql "<SELECT ...>"` | `capabilities` contains `query` |
50
+ | See what it looks like | `anyfile render <path> [--target <id>] --out preview.png` | Images, pages, drawings, models, slides |
51
+
52
+ ### 3. Read
53
+
54
+ ```bash
55
+ anyfile read ./mail.pst --target folder:8042
56
+ anyfile read ./mail.pst --target folder:8042 --filter invoice
57
+ ```
58
+
59
+ - Copy target ids exactly from `targets`. They are opaque; never build them yourself.
60
+ - Without `--target`, the first or default target is read.
61
+ - Output is capped at 48 KiB by default (`--max-bytes`, up to 262144). When more remains, `nextCursor: <cursor>` is printed on stderr. Continue with `--cursor <cursor>`, using the same `--target`.
62
+ - For large output, add `--out chunk.md`. Content goes to the file, and stdout prints a JSON summary that includes `nextCursor`.
63
+
64
+ ### 4. Query (databases)
65
+
66
+ ```bash
67
+ anyfile query ./data.sqlite --sql "SELECT role, count(*) FROM users GROUP BY role"
68
+ ```
69
+
70
+ Only read-only SQL is allowed (`SELECT`, `WITH`, `EXPLAIN`, read-only `PRAGMA`). Take table and column names from `metadata` or the `schema` target, and add `LIMIT` to wide scans.
71
+
72
+ ### 5. Render
73
+
74
+ ```bash
75
+ anyfile render ./drawing.dwg --out /tmp/drawing.png
76
+ anyfile render ./report.pdf --target page:3 --max-dim 1200 --out /tmp/page3.png
77
+ anyfile render ./part.step --target iso --out /tmp/part.png
78
+ ```
79
+
80
+ - Always pass `--out`; without it, raw PNG bytes go to stdout. Open the PNG with your image-viewing tool afterwards.
81
+ - The longest side defaults to 1600 px (`--max-dim`, up to 4096).
82
+ - Raster formats (PSD, EXR, HDR, HEIC, JXL, DICOM, camera RAW) render without a browser. Documents, CAD, Office, and 3D render through a local Chromium-based browser even when `capabilities` does not list `render`.
83
+ - 3D models accept `--target top|front|right|iso`.
84
+
85
+ ## Errors
86
+
87
+ Failures print one JSON object on stderr, `{"code": "...", "message": "..."}`, and the command exits with status 1.
88
+
89
+ | `code` | What to do |
90
+ |---|---|
91
+ | `invalid-argument` | Fix the command (missing path or `--sql`, bad flag value, SQL syntax). |
92
+ | `access-denied` | The path does not exist or cannot be read. Check it. |
93
+ | `target-not-found` | Re-run `inspect` and copy an `id` from `targets`. |
94
+ | `unsupported-capability` | The format cannot do that operation. Try another one from `capabilities`, or `render`. |
95
+ | `invalid-file` / `encrypted-file` | The file is corrupt, unrecognized, or password-protected. Tell the user. |
96
+ | `runtime-unavailable` | No local browser or WebGL, or a decoder download failed. Set `ANYFILE_BROWSER_PATH` to a Chromium-based browser (add `ANYFILE_BROWSER_ARGS=--no-sandbox` in containers), or check network access. |
97
+ | `timeout` / `resource-limit` | Narrow the scope: pick a smaller target, lower `--max-bytes` or `--max-dim`, or add `LIMIT`. |
98
+
99
+ ## Offline use
100
+
101
+ Some formats download a WASM decoder on first use into `~/.cache/anyfile` (SHA-256 verified; file contents are never sent). For machines without network access, pre-fetch them with `anyfile cache add all`.
@@ -0,0 +1,17 @@
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
+ probeNonNativeAudio
4
+ } from "./chunk-2C34VMNV.mjs";
5
+ import "./chunk-7O5JLQE7.mjs";
6
+ import "./chunk-EOJ7ZCDK.mjs";
7
+ import "./chunk-IC3G2XE2.mjs";
8
+ import "./chunk-ORJ3DN65.mjs";
9
+
10
+ // ../plugins/non-native-audio/src/browser-probe.ts
11
+ async function probeNonNativeAudioInBrowser(context) {
12
+ if (typeof AudioContext === "undefined" || typeof AudioDecoder === "undefined") return 0;
13
+ return probeNonNativeAudio(context);
14
+ }
15
+ export {
16
+ probeNonNativeAudioInBrowser
17
+ };
@@ -0,0 +1,24 @@
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
+ inspectNonNativeVideo
4
+ } from "./chunk-ZUHJIGHP.mjs";
5
+ import "./chunk-EOJ7ZCDK.mjs";
6
+ import "./chunk-IC3G2XE2.mjs";
7
+ import "./chunk-ORJ3DN65.mjs";
8
+
9
+ // ../plugins/non-native-video/src/browser-probe.ts
10
+ async function probeNonNativeVideoInBrowser({ file, signal }) {
11
+ const inspection = await inspectNonNativeVideo(file, signal);
12
+ if (!inspection) return 0;
13
+ const { softwareDecoded, hasAudio } = inspection;
14
+ if (softwareDecoded ? typeof WebAssembly === "undefined" || typeof Worker === "undefined" : typeof VideoDecoder === "undefined") {
15
+ return 0;
16
+ }
17
+ if (hasAudio && (typeof AudioContext === "undefined" || !softwareDecoded && typeof AudioDecoder === "undefined")) {
18
+ return 0;
19
+ }
20
+ return 3;
21
+ }
22
+ export {
23
+ probeNonNativeVideoInBrowser
24
+ };
@@ -0,0 +1,108 @@
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
+ inspectMatroskaTracks
4
+ } from "./chunk-EOJ7ZCDK.mjs";
5
+ import {
6
+ readBlob
7
+ } from "./chunk-IC3G2XE2.mjs";
8
+
9
+ // ../plugins/non-native-audio/src/limits.ts
10
+ var PROBE_HEAD_BYTES = 256 * 1024;
11
+ var PROBE_TAIL_BYTES = 64 * 1024;
12
+ var BLOB_CACHE_BYTES = 8 * 1024 * 1024;
13
+ var MAX_DURATION_SECONDS = 24 * 60 * 60;
14
+ var MAX_BUFFER_BYTES = 8 * 1024 * 1024;
15
+ var MATROSKA_CODECS = /* @__PURE__ */ new Set(["aac", "opus", "vorbis", "flac"]);
16
+
17
+ // ../plugins/non-native-audio/src/read-blob.ts
18
+ async function readProbeSlices(file, signal) {
19
+ const headEnd = Math.min(file.size, PROBE_HEAD_BYTES);
20
+ const head = await readBlob(file.slice(0, headEnd), signal);
21
+ if (file.size <= headEnd) return { head, tail: void 0 };
22
+ const tail = await readBlob(file.slice(Math.max(headEnd, file.size - PROBE_TAIL_BYTES)), signal);
23
+ if (head.byteLength + tail.byteLength > PROBE_HEAD_BYTES + PROBE_TAIL_BYTES) {
24
+ throw new Error("Non-native audio probe read budget exceeded");
25
+ }
26
+ return { head, tail };
27
+ }
28
+
29
+ // ../plugins/non-native-audio/src/wave-probe.ts
30
+ var MAX_CHUNKS = 128;
31
+ var WAVE_ALAW = 6;
32
+ var WAVE_MULAW = 7;
33
+ function ascii(bytes, offset, length) {
34
+ return String.fromCharCode(...bytes.subarray(offset, offset + length));
35
+ }
36
+ function u16le(bytes, offset) {
37
+ return bytes[offset] | bytes[offset + 1] << 8;
38
+ }
39
+ function u32le(bytes, offset) {
40
+ return (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24) >>> 0;
41
+ }
42
+ function inspectWaveLaw(bytes) {
43
+ if (ascii(bytes, 0, 4) !== "RIFF" || ascii(bytes, 8, 4) !== "WAVE") return void 0;
44
+ const declaredSize = u32le(bytes, 4) + 8;
45
+ if (declaredSize < 44) return void 0;
46
+ let format;
47
+ let channels;
48
+ let sampleRate;
49
+ let hasData = false;
50
+ let offset = 12;
51
+ for (let count = 0; count < MAX_CHUNKS && offset + 8 <= bytes.length; count += 1) {
52
+ const type = ascii(bytes, offset, 4);
53
+ const size = u32le(bytes, offset + 4);
54
+ const end = offset + 8 + size;
55
+ if (!Number.isSafeInteger(end) || end > declaredSize) return void 0;
56
+ if (type === "fmt " && size >= 16 && offset + 24 <= bytes.length) {
57
+ format = u16le(bytes, offset + 8);
58
+ channels = u16le(bytes, offset + 10);
59
+ sampleRate = u32le(bytes, offset + 12);
60
+ if (format === 65534 && size >= 40 && offset + 48 <= bytes.length) {
61
+ const guidTail = [0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113];
62
+ if (!guidTail.every((value, index) => bytes[offset + 36 + index] === value)) return void 0;
63
+ format = u16le(bytes, offset + 32);
64
+ }
65
+ }
66
+ if (type === "data") {
67
+ hasData = size > 0;
68
+ break;
69
+ }
70
+ if (end > bytes.length) return void 0;
71
+ offset = end + (size & 1);
72
+ }
73
+ if (!hasData || !channels || channels > 2 || !sampleRate || sampleRate < 8e3 || sampleRate > 192e3) {
74
+ return void 0;
75
+ }
76
+ if (format === WAVE_ALAW) return { codec: "alaw", channels, sampleRate };
77
+ if (format === WAVE_MULAW) return { codec: "ulaw", channels, sampleRate };
78
+ return void 0;
79
+ }
80
+
81
+ // ../plugins/non-native-audio/src/probe.ts
82
+ function extensionOf(name) {
83
+ const index = name.lastIndexOf(".");
84
+ return index < 0 ? "" : name.slice(index).toLowerCase();
85
+ }
86
+ async function probeMatroska(file, signal) {
87
+ const { head, tail } = await readProbeSlices(file, signal);
88
+ const inspection = inspectMatroskaTracks(head, tail, file.size);
89
+ if (!inspection?.hasSeekIndex || inspection.tracks.some(({ type }) => type === "video")) return 0;
90
+ const audio = inspection.tracks.filter(({ type }) => type === "audio");
91
+ if (audio.length !== 1 || !MATROSKA_CODECS.has(audio[0].codec)) return 0;
92
+ return 3;
93
+ }
94
+ async function probeWave(file, signal) {
95
+ const { head } = await readProbeSlices(file, signal);
96
+ return inspectWaveLaw(head) ? 3 : 0;
97
+ }
98
+ async function probeNonNativeAudio({ file, signal }) {
99
+ if (!file.size) return 0;
100
+ const extension = extensionOf(file.name);
101
+ if (extension === ".mka") return probeMatroska(file, signal);
102
+ if (extension === ".wav" || extension === ".wave") return probeWave(file, signal);
103
+ return 0;
104
+ }
105
+
106
+ export {
107
+ probeNonNativeAudio
108
+ };
@@ -0,0 +1,97 @@
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
+ parseXmlDocument
4
+ } from "./chunk-53MJMIN4.mjs";
5
+
6
+ // ../plugins/svg/src/sanitize.ts
7
+ var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
8
+ var BLOCKED_ELEMENTS = /* @__PURE__ */ new Set([
9
+ "script",
10
+ "foreignobject",
11
+ "iframe",
12
+ "object",
13
+ "embed",
14
+ "audio",
15
+ "video",
16
+ "style",
17
+ "animate",
18
+ "animatemotion",
19
+ "animatetransform",
20
+ "set",
21
+ "discard"
22
+ ]);
23
+ var SAFE_DATA_IMAGE = /^data:image\/(?:png|jpeg|gif|webp|avif);/i;
24
+ var URL_REFERENCE = /url\(\s*(['"]?)(.*?)\1\s*\)/gi;
25
+ function decodeXml(bytes) {
26
+ if (bytes[0] === 255 && bytes[1] === 254) {
27
+ return new TextDecoder("utf-16le", { fatal: true }).decode(bytes.subarray(2));
28
+ }
29
+ if (bytes[0] === 254 && bytes[1] === 255) {
30
+ const swapped = bytes.subarray(2).slice();
31
+ for (let index = 0; index + 1 < swapped.length; index += 2) {
32
+ [swapped[index], swapped[index + 1]] = [swapped[index + 1], swapped[index]];
33
+ }
34
+ return new TextDecoder("utf-16le", { fatal: true }).decode(swapped);
35
+ }
36
+ return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
37
+ }
38
+ function safeReference(value) {
39
+ const trimmed = value.trim();
40
+ return trimmed.startsWith("#") || SAFE_DATA_IMAGE.test(trimmed);
41
+ }
42
+ function containsUnsafeUrl(value) {
43
+ URL_REFERENCE.lastIndex = 0;
44
+ let match;
45
+ while (match = URL_REFERENCE.exec(value)) {
46
+ if (!safeReference(match[2])) return true;
47
+ }
48
+ return false;
49
+ }
50
+ function looksLikeSvg(bytes) {
51
+ try {
52
+ const source = decodeXml(bytes).replace(/^\uFEFF?\s*/, "");
53
+ if (/<!doctype/i.test(source)) return false;
54
+ const withoutPreamble = source.replace(/^<\?xml[\s\S]*?\?>\s*/i, "").replace(/^(?:<!--[\s\S]*?-->\s*)+/, "");
55
+ return /^<(?:[A-Za-z_][\w.-]*:)?svg(?:\s|>)/.test(withoutPreamble);
56
+ } catch {
57
+ return false;
58
+ }
59
+ }
60
+ function sanitizeSvg(bytes) {
61
+ let source;
62
+ try {
63
+ source = decodeXml(bytes);
64
+ } catch {
65
+ return void 0;
66
+ }
67
+ if (/<!doctype/i.test(source)) return void 0;
68
+ const document = parseXmlDocument(source, "image/svg+xml");
69
+ const root = document.documentElement;
70
+ if (root.localName.toLowerCase() !== "svg" || root.namespaceURI !== SVG_NAMESPACE || document.getElementsByTagName("parsererror").length > 0) return void 0;
71
+ const elements = [root, ...Array.from(root.querySelectorAll("*"))];
72
+ if (elements.length > 1e5) return void 0;
73
+ let removedItems = 0;
74
+ for (const element of elements) {
75
+ if (element !== root && BLOCKED_ELEMENTS.has(element.localName.toLowerCase())) {
76
+ element.remove();
77
+ removedItems += 1;
78
+ continue;
79
+ }
80
+ for (const attribute of Array.from(element.attributes)) {
81
+ const name = attribute.localName.toLowerCase();
82
+ const value = attribute.value;
83
+ const unsafe = name.startsWith("on") || name === "style" || name === "base" || (name === "href" || name === "src") && !safeReference(value) || containsUnsafeUrl(value);
84
+ if (unsafe) {
85
+ element.removeAttributeNode(attribute);
86
+ removedItems += 1;
87
+ }
88
+ }
89
+ }
90
+ return { source: new XMLSerializer().serializeToString(document), removedItems };
91
+ }
92
+
93
+ export {
94
+ decodeXml,
95
+ looksLikeSvg,
96
+ sanitizeSvg
97
+ };
@@ -0,0 +1,38 @@
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
+
3
+ // ../plugins/iwork/src/layout.ts
4
+ var PREVIEWS = ["preview.jpg", "QuickLook/Thumbnail.jpg", "preview-web.jpg", "QuickLook/Thumbnail.png"];
5
+ function iworkAppFromName(name) {
6
+ const lower = name.toLowerCase();
7
+ if (lower.endsWith(".pages")) return "pages";
8
+ if (lower.endsWith(".key")) return "keynote";
9
+ return void 0;
10
+ }
11
+ function prefixOf(name, marker) {
12
+ if (!name.endsWith(marker)) return void 0;
13
+ const prefix = name.slice(0, name.length - marker.length);
14
+ return prefix === "" || /^[^/]+\/$/.test(prefix) ? prefix : void 0;
15
+ }
16
+ function detectIworkLayout(names, app) {
17
+ const legacyIndex = app === "pages" ? "index.xml" : "index.apxl";
18
+ let found;
19
+ for (const name of names) {
20
+ if (name.endsWith(".iwpv2")) return { kind: "encrypted" };
21
+ if (found) continue;
22
+ let prefix = prefixOf(name, "Index/Document.iwa");
23
+ if (prefix !== void 0) found = { kind: "iwa", prefix };
24
+ else if ((prefix = prefixOf(name, "Index.zip")) !== void 0) found = { kind: "iwa-zip", prefix };
25
+ else if ((prefix = prefixOf(name, legacyIndex)) !== void 0) found = { kind: "xml", prefix, index: name };
26
+ else if ((prefix = prefixOf(name, `${legacyIndex}.gz`)) !== void 0) found = { kind: "xml", prefix, index: name };
27
+ }
28
+ return found;
29
+ }
30
+ function previewPath(names, prefix) {
31
+ return PREVIEWS.map((name) => prefix + name).find((name) => names.has(name));
32
+ }
33
+
34
+ export {
35
+ iworkAppFromName,
36
+ detectIworkLayout,
37
+ previewPath
38
+ };
@@ -0,0 +1,23 @@
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
+
3
+ // ../runtime-assets/src/xml.node.ts
4
+ import { Window } from "happy-dom";
5
+ var parser;
6
+ function parseXmlDocument(source, mimeType = "application/xml") {
7
+ if (typeof globalThis.DOMParser === "function") {
8
+ return new globalThis.DOMParser().parseFromString(source, mimeType);
9
+ }
10
+ parser ??= new new Window({
11
+ settings: {
12
+ disableJavaScriptEvaluation: true,
13
+ disableJavaScriptFileLoading: true,
14
+ disableCSSFileLoading: true,
15
+ disableIframePageLoading: true
16
+ }
17
+ }).DOMParser();
18
+ return parser.parseFromString(source, mimeType);
19
+ }
20
+
21
+ export {
22
+ parseXmlDocument
23
+ };