@poe-platform/safe-bash 0.1.800 → 0.1.802
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/README.md +16 -5
- package/dist/image-ast/index.browser.js +122 -76
- package/dist/image-ast/index.js +122 -76
- package/dist/pdf-ast/index.js +4 -3
- package/dist/safe-bash/chunks/chunk-3HQU4OJO.js +13 -0
- package/dist/safe-bash/chunks/{chunk-LUOFIVNI.js → chunk-3NDIFSNM.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-4SEW2Q6H.js → chunk-3R3AANOR.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-K4YMYFRJ.js → chunk-44ALJ4QG.js} +5809 -7424
- package/dist/safe-bash/chunks/{chunk-KHMGTPD6.js → chunk-46Z5E5EV.js} +2 -2
- package/dist/safe-bash/chunks/chunk-4BSJLKNM.js +14 -0
- package/dist/safe-bash/chunks/chunk-4D4N7IU2.js +47 -0
- package/dist/safe-bash/chunks/chunk-55YJASTN.js +14 -0
- package/dist/safe-bash/chunks/{chunk-XB3B7KMM.js → chunk-6O77NL2S.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-T3JTVIEP.js → chunk-6PAVEFT3.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-PYVEAFJM.js → chunk-74GHTNJA.js} +3 -2
- package/dist/safe-bash/chunks/{chunk-LQHGH25W.js → chunk-7R5BDCG7.js} +1 -1
- package/dist/safe-bash/chunks/chunk-7ZBU7KYV.js +14 -0
- package/dist/safe-bash/chunks/{chunk-MHZ24KEI.js → chunk-AM5ESLPH.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-3L3T6LYV.js → chunk-AUSNDQTJ.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-YG5WAHK7.js → chunk-B7TAL7S5.js} +1 -3
- package/dist/safe-bash/chunks/{chunk-QVSRRNZT.js → chunk-BJA5XNP6.js} +6 -6
- package/dist/safe-bash/chunks/{chunk-K7IQZE7D.js → chunk-C5OWC2TL.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-F3RV2F72.js → chunk-CHYGPFVM.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-M4CFCXHN.js → chunk-CS4MNM6I.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-H6JW3E4F.js → chunk-CTVWDACF.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-BHJE5LPZ.js → chunk-D3ANYGMC.js} +1 -1
- package/dist/safe-bash/chunks/chunk-DQP3VHSB.js +15 -0
- package/dist/safe-bash/chunks/{chunk-NLAW7KDI.js → chunk-E7OYNDGL.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-SOZK5JVX.js → chunk-FBUCWVTE.js} +1 -1
- package/dist/safe-bash/chunks/chunk-FZE4HW6G.js +11 -0
- package/dist/safe-bash/chunks/chunk-GEG3BWGE.js +14 -0
- package/dist/safe-bash/chunks/{chunk-HHW7MGS2.js → chunk-GETUOD5D.js} +4 -4
- package/dist/safe-bash/chunks/chunk-HBCN24ZA.js +50 -0
- package/dist/safe-bash/chunks/chunk-HZ7BWKQ3.js +13 -0
- package/dist/safe-bash/chunks/{chunk-JJSTTIEZ.js → chunk-HZAMGT5I.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-KCVSVD65.js → chunk-I5HZ4FGE.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-KV7PKOHV.js → chunk-IWDICZVK.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-I4OAEOP6.js → chunk-J42RIHHJ.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-K2VCOJ2B.js → chunk-K6VCD7IY.js} +7 -12
- package/dist/safe-bash/chunks/chunk-KDNSPLII.js +83 -0
- package/dist/safe-bash/chunks/{chunk-63FXVDGF.js → chunk-LVOBFF4D.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-U5NUZPCC.js → chunk-MHMMRCYC.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-KW24TAIU.js → chunk-NQCM3TYR.js} +922 -658
- package/dist/safe-bash/chunks/{chunk-VYZTG3GV.js → chunk-NZQXYWA3.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-TFGRKY43.js → chunk-OQRVVGR6.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-PPYM75Z3.js → chunk-OV6IHKO6.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-TYD7EVUJ.js → chunk-PH63PLPZ.js} +8 -8
- package/dist/safe-bash/chunks/chunk-QGUV42T5.js +44 -0
- package/dist/safe-bash/chunks/chunk-R3NAKOED.js +51 -0
- package/dist/safe-bash/chunks/chunk-RRR7AQ24.js +38 -0
- package/dist/safe-bash/chunks/{chunk-RKKRJ54E.js → chunk-RSTHLAF3.js} +30 -23
- package/dist/safe-bash/chunks/{chunk-RMWLWH7Q.js → chunk-SHEMU2Z7.js} +378 -1148
- package/dist/safe-bash/chunks/{chunk-7YSRXFEG.js → chunk-TFIBK2GI.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-I7L3G3NX.js → chunk-UE5KZDEK.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-QU3BVQ53.js → chunk-UTBUUFDM.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-6HZYFL3H.js → chunk-VKNVHEX3.js} +2 -7
- package/dist/safe-bash/chunks/chunk-VSAJ4OTM.js +962 -0
- package/dist/safe-bash/chunks/{chunk-46UISJCK.js → chunk-VTH3MLDU.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-JTLSUJ7V.js → chunk-WDLGKIHD.js} +56 -39
- package/dist/safe-bash/chunks/chunk-XAQMU6OY.js +14 -0
- package/dist/safe-bash/chunks/{chunk-LLZCZ24K.js → chunk-XVOSKJE2.js} +1 -1
- package/dist/safe-bash/chunks/chunk-ZVD5IS4V.js +49 -0
- package/dist/safe-bash/chunks/{csvkit-QGP3GAOB.js → csvkit-TACDU7FC.js} +3 -3
- package/dist/safe-bash/chunks/{ffmpeg-JTVH26MK.js → ffmpeg-WTC3TEFI.js} +2 -2
- package/dist/safe-bash/chunks/{gh-I7QX7N5C.js → gh-6WU6PXL4.js} +2 -2
- package/dist/safe-bash/chunks/{git-MA7NKYVP.js → git-EFZIGJW4.js} +2 -2
- package/dist/safe-bash/chunks/{imagemagick-Y4NPWX2Q.js → imagemagick-EIEYGWPF.js} +2 -2
- package/dist/safe-bash/chunks/{implementation-BWDKOVQJ.js → implementation-MLFHUQ5M.js} +2 -2
- package/dist/safe-bash/chunks/{mmdc-44PELHDG.js → mmdc-ROQJT5HQ.js} +2 -2
- package/dist/safe-bash/chunks/{pdfimages-635TRW4Q.js → pdfimages-DW7LWXFI.js} +2 -2
- package/dist/safe-bash/chunks/{pdfinfo-FSDAA2KY.js → pdfinfo-TIP6XLUQ.js} +2 -2
- package/dist/safe-bash/chunks/{pdftk-GQ5UH3VG.js → pdftk-DMG22ITZ.js} +2 -2
- package/dist/safe-bash/chunks/{pdftoppm-YTXQCAYT.js → pdftoppm-WNDYR72T.js} +2 -2
- package/dist/safe-bash/chunks/{pdftotext-CVA2G7FY.js → pdftotext-5IPZ4NI7.js} +2 -2
- package/dist/safe-bash/chunks/{qpdf-HZMIFG4A.js → qpdf-TTX2DIUA.js} +2 -2
- package/dist/safe-bash/chunks/{sips-E7UBDP33.js → sips-XYS46JPJ.js} +2 -2
- package/dist/safe-bash/chunks/{soffice-ELASUWUK.js → soffice-TU73E5KL.js} +2 -2
- package/dist/safe-bash/chunks/{wkhtmltopdf-EPO6YCMG.js → wkhtmltopdf-FSZ2CHGE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-QBGA56UH.js → chunk-2ELYGJDD.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-52PCQXD2.js → chunk-2NHI5F5S.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-HDKVO47G.js → chunk-2SQEIUGJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5LSGEIZY.js → chunk-3HHCU5YU.js} +4 -3
- package/dist/safe-bash/command-chunks/{chunk-TF6OA2GK.js → chunk-3NV3HYT2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2QHG43WJ.js → chunk-4BB2SWJ5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IEXHHNOF.js → chunk-4J5CZ2DP.js} +2 -7
- package/dist/safe-bash/command-chunks/{chunk-WDHI3S6Y.js → chunk-4OOUQTQO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-YMONDXET.js → chunk-4ZQWGOZB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-L6DVEBW3.js → chunk-5BSTFCXG.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-Q3DII3Q7.js → chunk-5PWJG2UK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JMPP4TCW.js → chunk-5UBXNSFZ.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-3NG75MOB.js → chunk-67GQA75T.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-L6SU4S26.js → chunk-6B7WQIKB.js} +0 -7
- package/dist/safe-bash/command-chunks/{chunk-V6MSPQLA.js → chunk-6BNTBWIK.js} +4 -39
- package/dist/safe-bash/command-chunks/{chunk-SAMH7SQE.js → chunk-6GWJUQAV.js} +237 -145
- package/dist/safe-bash/command-chunks/{chunk-JN7WIP6S.js → chunk-6KJ3LPI2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HLDTOR7M.js → chunk-6ZVI7LUY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-X6NJC3IC.js → chunk-75OFBY5R.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-MRW5HD2D.js → chunk-7O3E4LPT.js} +4 -22
- package/dist/safe-bash/command-chunks/{chunk-TEVJJPTC.js → chunk-7U7EXOXX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6CYTRQ24.js → chunk-7VTKQUA5.js} +20 -17
- package/dist/safe-bash/command-chunks/{chunk-BZPAWTUL.js → chunk-AEF5BA3D.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-63R3FEZJ.js → chunk-AIV5BF5W.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AYUTO323.js → chunk-AKJG2XD3.js} +2 -18
- package/dist/safe-bash/command-chunks/{chunk-J34TZVMW.js → chunk-ALDC4XP4.js} +0 -5
- package/dist/safe-bash/command-chunks/{chunk-CKXV2CLD.js → chunk-ARBYOQUZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-44AHAB5O.js → chunk-BDSMROQZ.js} +1 -4
- package/dist/safe-bash/command-chunks/{chunk-53P53XFM.js → chunk-BPE5INLI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OT4LZMLB.js → chunk-BR73BIOW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WB5SVIG7.js → chunk-C5YYCQHW.js} +498 -88
- package/dist/safe-bash/command-chunks/{chunk-EUSPTFAX.js → chunk-CAP7ZJSY.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DWFLVJC6.js → chunk-CCRHMAU5.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-GI4CJED2.js → chunk-CQTRW45K.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KKG4BAFZ.js → chunk-DIEPXUM4.js} +6 -0
- package/dist/safe-bash/command-chunks/{chunk-QJAFJP2G.js → chunk-DZCY63VJ.js} +12 -10
- package/dist/safe-bash/command-chunks/{chunk-QUENU6GM.js → chunk-E55UKBIE.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MC3VWLIZ.js → chunk-FDBUV4HJ.js} +28 -19
- package/dist/safe-bash/command-chunks/{chunk-7FKUC34S.js → chunk-FPVUD6TH.js} +6 -3
- package/dist/safe-bash/command-chunks/{chunk-E2LB7FRT.js → chunk-FXOA7RBK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QWIDNAAK.js → chunk-FZTK4MFI.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-K543PB3I.js → chunk-G66QUHIZ.js} +6 -35
- package/dist/safe-bash/command-chunks/{chunk-YJDV76GL.js → chunk-GFQZCKO6.js} +29 -19
- package/dist/safe-bash/command-chunks/{chunk-FKKB5X5V.js → chunk-GOB777HR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IYPAQ7PH.js → chunk-GRBWW4SG.js} +6 -0
- package/dist/safe-bash/command-chunks/{chunk-EFANWIHL.js → chunk-GY3BWK7K.js} +1 -0
- package/dist/safe-bash/command-chunks/{chunk-PPNBNFAU.js → chunk-GYQ2HAKQ.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-PJJUYO3R.js → chunk-II77KPZN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VL67NWNS.js → chunk-JDYXY44P.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4QJOYXVB.js → chunk-JV7LBUTP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IKS2YXZQ.js → chunk-K67MWWWH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BKCNF5U3.js → chunk-KQLD3AED.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UMDIOL3O.js → chunk-KXU3IRUO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QZF3SINC.js → chunk-LAOM65EE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HFII3QYO.js → chunk-LWS62ISU.js} +46 -32
- package/dist/safe-bash/command-chunks/{chunk-BZDDAPSV.js → chunk-LWSBAWLT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-U6G67N23.js → chunk-MIXBO6U7.js} +18 -5
- package/dist/safe-bash/command-chunks/{chunk-JQ74HC37.js → chunk-MQFIPHIQ.js} +23 -50
- package/dist/safe-bash/command-chunks/{chunk-ZJBR5Q5I.js → chunk-MSFXC3OC.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-NI7MKJPN.js → chunk-MTQH74CF.js} +3 -55
- package/dist/safe-bash/command-chunks/chunk-MWUZZWXK.js +354 -0
- package/dist/safe-bash/command-chunks/{chunk-RVLO4DYT.js → chunk-N4PFUSRM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WBNZ4PRE.js → chunk-NGG2XL56.js} +7 -4
- package/dist/safe-bash/command-chunks/{chunk-D4OP2BR3.js → chunk-NKFYQSES.js} +1 -2
- package/dist/safe-bash/command-chunks/{chunk-NGWB2YBL.js → chunk-O4JQSB7O.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GLOZX57Y.js → chunk-OQKC5ZU2.js} +23 -114
- package/dist/safe-bash/command-chunks/{chunk-7L24L4UO.js → chunk-OQU6UT6X.js} +2 -20
- package/dist/safe-bash/command-chunks/{chunk-TYCGMRLM.js → chunk-OYYV7ZAF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SVULUDOP.js → chunk-P2N33UMN.js} +20 -81
- package/dist/safe-bash/command-chunks/{chunk-Q7Q5GM5S.js → chunk-P5APDEFB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-3HXDA5PT.js → chunk-PMBFZXTK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4Y3WVMK4.js → chunk-PV66YWHB.js} +1 -0
- package/dist/safe-bash/command-chunks/{chunk-AXK3H4PX.js → chunk-QJ33BHI4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3LSOYLNV.js → chunk-QKFSRZGQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JZSNU2MY.js → chunk-QKJLP53H.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-LC2MFKT4.js → chunk-RMWQAAO5.js} +24 -25
- package/dist/safe-bash/command-chunks/{chunk-QDTBMSBE.js → chunk-RO62EWX6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4C6QI5BQ.js → chunk-RZZI24ZE.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-PFAADCB5.js → chunk-SDNBCQ3X.js} +10 -24
- package/dist/safe-bash/command-chunks/{chunk-36O5OT7E.js → chunk-T35Y7YQD.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6HMX4CQS.js → chunk-TGSNCQSR.js} +44 -16
- package/dist/safe-bash/command-chunks/{chunk-5T7CRJHW.js → chunk-TIOCQVUQ.js} +4 -7
- package/dist/safe-bash/command-chunks/{chunk-GN2TKLE7.js → chunk-TS65BJHG.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-7RGB363W.js → chunk-TSCGT46G.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-KBEURXFF.js → chunk-UN6WS55J.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SX2X3IH4.js → chunk-V2V5OCL3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ERYJLO6G.js → chunk-V7A7DRTU.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5SHGJ7NO.js → chunk-VA5ZHYYA.js} +73 -33
- package/dist/safe-bash/command-chunks/{chunk-XETLEHZP.js → chunk-VPR5LQYX.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-3DT2YOGW.js → chunk-VSRGNQCP.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-N2F74VRO.js → chunk-VT6MJBEI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-J5SN3PZ3.js → chunk-VXSLJH7G.js} +53 -3
- package/dist/safe-bash/command-chunks/{chunk-PXYOWWMV.js → chunk-W7RAD4EW.js} +4 -3
- package/dist/safe-bash/command-chunks/{chunk-YGC6OS5O.js → chunk-WECIOOQB.js} +5 -8
- package/dist/safe-bash/command-chunks/{chunk-HHP343KT.js → chunk-WTECBRU4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AO6Z5EQ7.js → chunk-WVE64WM2.js} +6 -5
- package/dist/safe-bash/command-chunks/{chunk-Z7RVSD5K.js → chunk-WVHONVZ4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HLGKIZ25.js → chunk-X54L3DBL.js} +6 -9
- package/dist/safe-bash/command-chunks/{chunk-QNIMV57G.js → chunk-XNLFHHOC.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XAFSZDY2.js → chunk-XS72HTMA.js} +11 -0
- package/dist/safe-bash/command-chunks/{chunk-KYSPGS33.js → chunk-YIQACGEW.js} +2 -0
- package/dist/safe-bash/command-chunks/{chunk-NAY27PXB.js → chunk-YOFC45RK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T5H5UJQ3.js → chunk-YVNGTIJO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QI7LGHJJ.js → chunk-Z45N42QC.js} +21 -6
- package/dist/safe-bash/command-chunks/{chunk-67IQF5GC.js → chunk-ZYHTWNAE.js} +23 -9
- package/dist/safe-bash/command-chunks/{chunk-STC3LEWJ.js → chunk-ZYXH3B66.js} +5 -3
- package/dist/safe-bash/commands/apply-patch/index.browser.js +14 -0
- package/dist/safe-bash/commands/archive/index.browser.js +36 -0
- package/dist/safe-bash/commands/bytes/compression/index.js +3 -2
- package/dist/safe-bash/commands/column/index.browser.js +12 -0
- package/dist/safe-bash/commands/copy-preserve.d.ts +1 -0
- package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
- package/dist/safe-bash/commands/docx/index.browser.js +1 -1
- package/dist/safe-bash/commands/du/index.browser.js +14 -0
- package/dist/safe-bash/commands/execution.js +19 -13
- package/dist/safe-bash/commands/expr/index.browser.js +12 -0
- package/dist/safe-bash/commands/factor/index.browser.js +2 -2
- package/dist/safe-bash/commands/file/index.browser.js +14 -0
- package/dist/safe-bash/commands/filesystem.d.ts +1 -1
- package/dist/safe-bash/commands/filesystem.js +26 -15
- package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
- package/dist/safe-bash/commands/grep-aliases/index.browser.js +14 -0
- package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
- package/dist/safe-bash/commands/html-to-markdown/index.browser.js +16 -0
- package/dist/safe-bash/commands/htmlq/index.d.ts +1 -1
- package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
- package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
- package/dist/safe-bash/commands/llm/index.browser.js +2 -2
- package/dist/safe-bash/commands/llm/providers/index.browser.js +1 -1
- package/dist/safe-bash/commands/mdq/index.browser.js +3 -3
- package/dist/safe-bash/commands/media/index.browser.js +1 -1
- package/dist/safe-bash/commands/metadata/index.browser.js +21 -0
- package/dist/safe-bash/commands/network/curl.d.ts +1 -1
- package/dist/safe-bash/commands/network/curl.js +1 -3
- package/dist/safe-bash/commands/network/index.browser.js +4 -4
- package/dist/safe-bash/commands/network/platform-portable.d.ts +1 -5
- package/dist/safe-bash/commands/network/platform-portable.js +1 -26
- package/dist/safe-bash/commands/network/public.d.ts +2 -2
- package/dist/safe-bash/commands/network/public.js +2 -2
- package/dist/safe-bash/commands/network/transport.js +2 -2
- package/dist/safe-bash/commands/network/wget.d.ts +1 -1
- package/dist/safe-bash/commands/network/wget.js +1 -3
- package/dist/safe-bash/commands/node/filesystem.js +3 -2
- package/dist/safe-bash/commands/node/index.browser.js +8 -8
- package/dist/safe-bash/commands/node/types.js +1 -1
- package/dist/safe-bash/commands/op/index.browser.js +3 -3
- package/dist/safe-bash/commands/pr/index.browser.js +2 -2
- package/dist/safe-bash/commands/python/host-capabilities.js +31 -14
- package/dist/safe-bash/commands/python/index.browser.js +11 -11
- package/dist/safe-bash/commands/python/manifest.d.ts +1 -0
- package/dist/safe-bash/commands/python/manifest.js +6 -3
- package/dist/safe-bash/commands/python/shell-capability.d.ts +1 -0
- package/dist/safe-bash/commands/python/shell-capability.js +3 -2
- package/dist/safe-bash/commands/python/worker.browser.js +3 -3
- package/dist/safe-bash/commands/regex-execution/public.browser.js +8 -6
- package/dist/safe-bash/commands/safejs/runtime.js +16 -7
- package/dist/safe-bash/commands/split/index.browser.js +14 -0
- package/dist/safe-bash/commands/standard.d.ts +1 -0
- package/dist/safe-bash/commands/standard.js +2 -1
- package/dist/safe-bash/commands/stream-format/index.browser.js +11 -0
- package/dist/safe-bash/commands/stream-inspection/index.browser.js +11 -0
- package/dist/safe-bash/commands/streams.js +11 -29
- package/dist/safe-bash/commands/table-text/index.browser.js +11 -0
- package/dist/safe-bash/commands/text.js +269 -496
- package/dist/safe-bash/commands/time-env/index.browser.js +15 -0
- package/dist/safe-bash/commands/tree/index.browser.js +14 -0
- package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
- package/dist/safe-bash/commands/xml/index.browser.js +2 -2
- package/dist/safe-bash/commands/yq/index.browser.js +2 -2
- package/dist/safe-bash/core.browser.js +1 -1
- package/dist/safe-bash/core.d.ts +6 -1
- package/dist/safe-bash/core.js +1 -1
- package/dist/safe-bash/full-core.browser.js +308 -295
- package/dist/safe-bash/jobs.browser.js +5 -5
- package/dist/safe-bash/opt-in/commands/dd/index.js +2 -0
- package/dist/safe-bash/opt-in/optional/commands/shuf/options.d.ts +1 -0
- package/dist/safe-bash/opt-in/optional/commands/shuf/options.js +2 -4
- package/dist/safe-bash/opt-in/optional/commands/shuf/shuf.js +2 -1
- package/dist/safe-bash/optional-host.browser.js +15 -15
- package/dist/safe-bash/plugins/composition.d.ts +1 -0
- package/dist/safe-bash/plugins/composition.js +3 -8
- package/dist/safe-bash/plugins/index.browser.js +41 -27
- package/dist/safe-bash/registry-entry.browser.js +42 -28
- package/dist/safe-bash/search.browser.js +48 -0
- package/dist/safe-bash/shell/arrays/bindings.js +1 -1
- package/dist/safe-bash/shell/arrays/state.js +4 -0
- package/dist/safe-bash/shell/brace-expansion.js +1 -1
- package/dist/safe-bash/shell/dynamic-variables.d.ts +10 -0
- package/dist/safe-bash/shell/dynamic-variables.js +25 -0
- package/dist/safe-bash/shell/parser.js +8 -1
- package/dist/safe-bash/shell/runtime.d.ts +4 -13
- package/dist/safe-bash/shell/runtime.js +334 -1049
- package/dist/safe-bash/shell/shell.js +2 -54
- package/dist/safe-bash/shell-entry.browser.js +35 -26
- package/dist/safe-bash/trap.browser.js +4 -4
- package/dist/safe-bash/yq-browser/index.js +1 -1
- package/dist/safe-bash-base-encoding-engine/base.js +2 -2
- package/dist/safe-bash-base-encoding-engine/shared.js +1 -1
- package/dist/safe-bash-byte-input-engine/index.d.ts +3 -2
- package/dist/safe-bash-byte-input-engine/index.js +4 -1
- package/dist/safe-bash-checksum-engine/index.js +13 -6
- package/dist/safe-bash-command-apply-patch/apply.d.ts +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +4 -3
- package/dist/safe-bash-command-apply-patch/index.js +3 -3
- package/dist/safe-bash-command-apply-patch/matcher.js +1 -1
- package/dist/safe-bash-command-apply-patch/parser.js +1 -1
- package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
- package/dist/safe-bash-command-awk/awk-runtime.js +3 -3
- package/dist/safe-bash-command-awk/awk-syntax.d.ts +1 -1
- package/dist/safe-bash-command-awk/awk-syntax.js +2 -2
- package/dist/safe-bash-command-awk/awk-values.js +1 -1
- package/dist/safe-bash-command-awk/awk.js +5 -5
- package/dist/safe-bash-command-awk/index.js +5 -5
- package/dist/safe-bash-command-bc/index.d.ts +2 -0
- package/dist/safe-bash-command-bc/index.js +123 -92
- package/dist/safe-bash-command-column/column.js +5 -5
- package/dist/safe-bash-command-column/display.d.ts +1 -1
- package/dist/safe-bash-command-column/display.js +1 -1
- package/dist/safe-bash-command-column/index.js +5 -5
- package/dist/safe-bash-command-column/internal.d.ts +0 -2
- package/dist/safe-bash-command-column/internal.js +1 -1
- package/dist/safe-bash-command-column/layout.js +4 -4
- package/dist/safe-bash-command-column/table.js +2 -2
- package/dist/safe-bash-command-comm/comm.js +1 -1
- package/dist/safe-bash-command-comm/index.js +1 -1
- package/dist/safe-bash-command-csvcut/index.d.ts +1 -0
- package/dist/safe-bash-command-csvcut/index.js +1 -0
- package/dist/safe-bash-command-csvgrep/index.d.ts +1 -0
- package/dist/safe-bash-command-csvgrep/index.js +2 -2
- package/dist/safe-bash-command-csvkit/index.js +9 -9
- package/dist/safe-bash-command-csvkit/sync-support.js +1 -1
- package/dist/safe-bash-command-curl/curl.js +1 -1
- package/dist/safe-bash-command-curl/index.js +1 -1
- package/dist/safe-bash-command-dd/index.js +2 -0
- package/dist/safe-bash-command-diff/diff.js +1 -1
- package/dist/safe-bash-command-diff/index.js +1 -1
- package/dist/safe-bash-command-exiftool/index.d.ts +1 -0
- package/dist/safe-bash-command-fd/index.js +9 -9
- package/dist/safe-bash-command-ffmpeg/index.js +31 -8
- package/dist/safe-bash-command-file/index.js +1 -1
- package/dist/safe-bash-command-file/shared.js +1 -1
- package/dist/safe-bash-command-find/find.js +1 -1
- package/dist/safe-bash-command-find/index.js +1 -1
- package/dist/safe-bash-command-gzip/index.js +3 -2
- package/dist/safe-bash-command-hexdump/command.js +4 -4
- package/dist/safe-bash-command-hexdump/custom.d.ts +24 -0
- package/dist/safe-bash-command-hexdump/index.js +4 -4
- package/dist/safe-bash-command-hexdump/internal.d.ts +2 -0
- package/dist/safe-bash-command-hexdump/internal.js +1 -1
- package/dist/safe-bash-command-hexdump/io.js +2 -2
- package/dist/safe-bash-command-hexdump/options.d.ts +3 -0
- package/dist/safe-bash-command-hexdump/options.js +2 -2
- package/dist/safe-bash-command-hostname/index.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/budget.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/entities.js +3 -3
- package/dist/safe-bash-command-html-to-markdown/index.js +6 -6
- package/dist/safe-bash-command-html-to-markdown/input.js +5 -5
- package/dist/safe-bash-command-html-to-markdown/parser.d.ts +1 -0
- package/dist/safe-bash-command-html-to-markdown/parser.js +4 -4
- package/dist/safe-bash-command-html-to-markdown/render.js +5 -5
- package/dist/safe-bash-command-html-to-markdown/text.js +2 -2
- package/dist/safe-bash-command-htmlq/index.d.ts +1 -0
- package/dist/safe-bash-command-htmlq/index.js +27 -9
- package/dist/safe-bash-command-iconv/codec.js +1 -1
- package/dist/safe-bash-command-iconv/command.js +2 -2
- package/dist/safe-bash-command-iconv/index.js +2 -2
- package/dist/safe-bash-command-imagemagick/index.js +24 -6
- package/dist/safe-bash-command-join/index.js +1 -1
- package/dist/safe-bash-command-join/join.js +1 -1
- package/dist/safe-bash-command-jq/index.js +1 -1
- package/dist/safe-bash-command-jq/jq.js +1 -1
- package/dist/safe-bash-command-less/index.js +43 -28
- package/dist/safe-bash-command-mmdc/index.d.ts +1 -0
- package/dist/safe-bash-command-nl/index.js +1 -1
- package/dist/safe-bash-command-nl/nl.js +1 -1
- package/dist/safe-bash-command-numfmt/index.js +0 -11
- package/dist/safe-bash-command-od/index.js +101 -68
- package/dist/safe-bash-command-pandoc/command.js +1 -1
- package/dist/safe-bash-command-pandoc/index.js +1 -1
- package/dist/safe-bash-command-paste/index.js +1 -1
- package/dist/safe-bash-command-paste/paste.js +1 -1
- package/dist/safe-bash-command-pathchk/index.js +3 -13
- package/dist/safe-bash-command-pdfimages/index.js +27 -11
- package/dist/safe-bash-command-pdfinfo/index.js +19 -10
- package/dist/safe-bash-command-pdftk/index.js +3 -3
- package/dist/safe-bash-command-pdftoppm/index.js +26 -10
- package/dist/safe-bash-command-pdftotext/index.js +27 -13
- package/dist/safe-bash-command-qpdf/index.js +5 -5
- package/dist/safe-bash-command-rg/index.js +1 -1
- package/dist/safe-bash-command-rg/rg-command.d.ts +0 -1
- package/dist/safe-bash-command-rg/rg-command.js +3 -5
- package/dist/safe-bash-command-sed/index.js +1 -1
- package/dist/safe-bash-command-sed/sed.js +1 -1
- package/dist/safe-bash-command-shuf/options.d.ts +1 -0
- package/dist/safe-bash-command-shuf/options.js +2 -4
- package/dist/safe-bash-command-shuf/shuf.js +2 -1
- package/dist/safe-bash-command-soffice/index.js +20 -16
- package/dist/safe-bash-command-split/index.js +3 -3
- package/dist/safe-bash-command-split/io.js +1 -1
- package/dist/safe-bash-command-split/outputs.js +2 -2
- package/dist/safe-bash-command-split/split.js +3 -3
- package/dist/safe-bash-command-sqlite3/btree.d.ts +1 -0
- package/dist/safe-bash-command-sqlite3/engine.d.ts +6 -0
- package/dist/safe-bash-command-sqlite3/index.js +284 -85
- package/dist/safe-bash-command-ssconvert/commands.js +9 -9
- package/dist/safe-bash-command-ssconvert/core.js +8 -8
- package/dist/safe-bash-command-ssconvert/formats/csv.js +9 -9
- package/dist/safe-bash-command-ssconvert/formats/ods.js +8 -8
- package/dist/safe-bash-command-ssconvert/formats/spreadsheetml.js +2 -2
- package/dist/safe-bash-command-ssconvert/formats/xls.js +9 -9
- package/dist/safe-bash-command-ssconvert/formats/xlsx.js +8 -8
- package/dist/safe-bash-command-ssconvert/index.js +20 -20
- package/dist/safe-bash-command-tar/extract.js +1 -1
- package/dist/safe-bash-command-tar/index.js +5 -4
- package/dist/safe-bash-command-tar/modes.js +2 -2
- package/dist/safe-bash-command-tree/arguments.js +3 -3
- package/dist/safe-bash-command-tree/charset.js +1 -1
- package/dist/safe-bash-command-tree/index.js +4 -4
- package/dist/safe-bash-command-tree/io.js +1 -1
- package/dist/safe-bash-command-tree/pattern.js +2 -2
- package/dist/safe-bash-command-tree/tree.js +4 -4
- package/dist/safe-bash-command-unexpand/index.js +1 -1
- package/dist/safe-bash-command-unexpand/unexpand.js +1 -1
- package/dist/safe-bash-command-unrtf/index.js +14 -7
- package/dist/safe-bash-command-unzip/index.js +1 -1
- package/dist/safe-bash-command-unzip/unzip.js +1 -1
- package/dist/safe-bash-command-wget/index.js +1 -1
- package/dist/safe-bash-command-wget/wget.js +1 -1
- package/dist/safe-bash-command-xan/argv.d.ts +1 -1
- package/dist/safe-bash-command-xan/argv.js +1 -1
- package/dist/safe-bash-command-xan/commands.js +5 -3
- package/dist/safe-bash-command-xan/csv.d.ts +1 -1
- package/dist/safe-bash-command-xan/csv.js +1 -1
- package/dist/safe-bash-command-xan/index.js +7 -7
- package/dist/safe-bash-command-xan/io.js +3 -3
- package/dist/safe-bash-command-xmllint/index.js +1 -1
- package/dist/safe-bash-command-xxd/index.js +105 -91
- package/dist/safe-bash-command-xz/command.d.ts +2 -0
- package/dist/safe-bash-command-xz/index.d.ts +1 -1
- package/dist/safe-bash-command-xz/index.js +8 -0
- package/dist/safe-bash-command-yq/query.js +1 -1
- package/dist/safe-bash-command-zip/index.js +1 -1
- package/dist/safe-bash-command-zip/zip.js +1 -1
- package/dist/safe-bash-contracts/escaping.js +3 -3
- package/dist/safe-bash-contracts/filesystem-output.js +2 -2
- package/dist/safe-bash-contracts/index.d.ts +1 -0
- package/dist/safe-bash-contracts/index.js +7 -3
- package/dist/safe-bash-contracts/io.d.ts +4 -1
- package/dist/safe-bash-contracts/io.js +3 -1
- package/dist/safe-bash-contracts/managed-abort.d.ts +10 -0
- package/dist/safe-bash-contracts/output.js +2 -2
- package/dist/safe-bash-diff-engine/index.js +1 -1
- package/dist/safe-bash-diff-engine/shared.d.ts +3 -2
- package/dist/safe-bash-diff-engine/shared.js +1 -1
- package/dist/safe-bash-io-engine/commands/archive/internal.js +5 -23
- package/dist/safe-bash-io-engine/commands/search/requirements.js +2 -2
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +33 -44
- package/dist/safe-bash-io-engine/internal.js +1 -1
- package/dist/safe-bash-io-engine/shell/pattern.js +1 -1
- package/dist/safe-bash-io-engine/shell/string-operations.js +1 -1
- package/dist/safe-bash-mcp/index.browser.d.ts +155 -35
- package/dist/safe-bash-mcp/index.browser.js +416 -0
- package/dist/safe-bash-mcp/index.d.ts +54 -2
- package/dist/safe-bash-mcp/index.js +286 -90
- package/dist/safe-bash-network-engine/aggregate.js +2 -2
- package/dist/safe-bash-network-engine/args.js +4 -4
- package/dist/safe-bash-network-engine/authorizer.js +1 -1
- package/dist/safe-bash-network-engine/body.js +6 -6
- package/dist/safe-bash-network-engine/decode.d.ts +1 -1
- package/dist/safe-bash-network-engine/decode.js +3 -4
- package/dist/safe-bash-network-engine/fetch-transport.js +3 -3
- package/dist/safe-bash-network-engine/form-content-type.js +2 -2
- package/dist/safe-bash-network-engine/form-headers.js +2 -2
- package/dist/safe-bash-network-engine/glob.js +1 -1
- package/dist/safe-bash-network-engine/index.js +4 -4
- package/dist/safe-bash-network-engine/input.js +6 -6
- package/dist/safe-bash-network-engine/output.js +2 -2
- package/dist/safe-bash-network-engine/platform-portable.js +3 -3
- package/dist/safe-bash-network-engine/shared.js +2 -2
- package/dist/safe-bash-network-engine/types.d.ts +7 -2
- package/dist/safe-bash-network-engine/types.js +1 -1
- package/dist/safe-bash-network-engine/url.js +2 -2
- package/dist/safe-bash-query-engine/capture.js +3 -3
- package/dist/safe-bash-query-engine/delpaths.js +3 -3
- package/dist/safe-bash-query-engine/formats.js +2 -2
- package/dist/safe-bash-query-engine/index.js +11 -11
- package/dist/safe-bash-query-engine/indices.js +3 -3
- package/dist/safe-bash-query-engine/input.js +1 -1
- package/dist/safe-bash-query-engine/interpreter.js +9 -9
- package/dist/safe-bash-query-engine/parser.js +1 -1
- package/dist/safe-bash-query-engine/query-core.js +11 -11
- package/dist/safe-bash-query-engine/regex.js +4 -4
- package/dist/safe-bash-query-engine/splits.js +5 -5
- package/dist/safe-bash-query-engine/values.js +2 -2
- package/dist/safe-bash-regex-engine/ere/matcher.js +102 -30
- package/dist/safe-bash-regex-engine/execution/bounded-provider.js +55 -67
- package/dist/safe-bash-regex-engine/execution/portable.d.ts +0 -1
- package/dist/safe-bash-regex-engine/execution/portable.js +6 -10
- package/dist/safe-bash-regex-engine/execution/protocol.d.ts +0 -5
- package/dist/safe-bash-regex-engine/execution/protocol.js +1 -3
- package/dist/safe-bash-regex-engine/index.js +6 -4
- package/dist/safe-bash-regex-engine/text/budget.d.ts +1 -1
- package/dist/safe-bash-regex-engine/text/budget.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.d.ts +14 -0
- package/dist/safe-bash-regex-engine/text/regex.js +6 -4
- package/dist/safe-bash-regex-engine/text/replacement-buffer.js +2 -2
- package/dist/safe-bash-regex-engine/text/rust-syntax.js +2 -2
- package/dist/safe-bash-search-engine/grep.js +189 -227
- package/dist/safe-bash-table-text-engine/table-text/internal.d.ts +7 -5
- package/dist/safe-bash-table-text-engine/table-text/internal.js +39 -21
- package/dist/safe-playwright-cloudflare/browser-trace-budget.js +6 -2
- package/dist/spreadsheet-engine/codecs/odf-hyperlinks.js +8 -2
- package/dist/spreadsheet-engine/formulas/functions/captured-bessel-phase.js +2 -2
- package/dist/spreadsheet-engine/formulas/label-references.js +54 -33
- package/dist/spreadsheet-engine/formulas/parser.js +3 -1
- package/dist/spreadsheet-engine/formulas/rewriting.js +13 -3
- package/dist/spreadsheet-format-xls/biff-data-tables.js +4 -6
- package/dist/spreadsheet-format-xls/biff-formulas.js +3 -0
- package/dist/spreadsheet-format-xls/biff-label-ranges.js +9 -6
- package/dist/spreadsheet-format-xls/biff.js +1 -1
- package/dist/xlsx-ast/xlsx.js +8 -5
- package/package.json +68 -12
- package/dist/safe-bash/command-chunks/chunk-KAGBORIC.js +0 -88
- /package/dist/safe-bash/command-chunks/{chunk-BWNXWI33.js → chunk-2LMZVE3I.js} +0 -0
|
@@ -35,17 +35,6 @@ Diagnose invalid or unportable file names.
|
|
|
35
35
|
var VERSION_TEXT = `pathchk (Sandbox VFS-ish/GNU coreutils) 9.7
|
|
36
36
|
`;
|
|
37
37
|
var PORTABLE_CHAR_RE = /^[A-Za-z0-9._-]+$/;
|
|
38
|
-
function resolveVfsPath(cwd, target) {
|
|
39
|
-
const raw = target.startsWith("/") ? target : cwd.endsWith("/") ? cwd + target : `${cwd}/${target}`;
|
|
40
|
-
const parts = raw.split("/");
|
|
41
|
-
const stack = [];
|
|
42
|
-
for (const part of parts) {
|
|
43
|
-
if (!part || part === ".") continue;
|
|
44
|
-
if (part === "..") stack.pop();
|
|
45
|
-
else stack.push(part);
|
|
46
|
-
}
|
|
47
|
-
return "/" + stack.join("/");
|
|
48
|
-
}
|
|
49
38
|
function createPathchkCommand(options = {}) {
|
|
50
39
|
const limits = settings(options);
|
|
51
40
|
return {
|
|
@@ -182,12 +171,13 @@ function createPathchkCommand(options = {}) {
|
|
|
182
171
|
continue;
|
|
183
172
|
}
|
|
184
173
|
if (!checkBasicPosix) {
|
|
185
|
-
const full =
|
|
186
|
-
const parts = full.split("/")
|
|
174
|
+
const full = name.startsWith("/") ? name : `${context.cwd}/${name}`;
|
|
175
|
+
const parts = full.split("/");
|
|
187
176
|
let current = "";
|
|
188
177
|
for (let k = 0; k < parts.length - 1; k++) {
|
|
189
178
|
context.signal.throwIfAborted();
|
|
190
179
|
if ((k & 127) === 0) await yieldTurn(context.signal);
|
|
180
|
+
if (!parts[k]) continue;
|
|
191
181
|
current += "/" + parts[k];
|
|
192
182
|
try {
|
|
193
183
|
const st = await context.fs.stat(current, { signal: context.signal });
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-pdfimages/src/index.ts
|
|
6
6
|
init_buffer();
|
|
7
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
7
8
|
import { yieldTurn, drainCooperativeSteps as drainSteps } from "../safe-bash-contracts/yield.js";
|
|
8
9
|
import { InputByteBudget } from "../safe-bash-contracts/io.js";
|
|
9
10
|
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
@@ -29,11 +30,15 @@ function formatPopplerRatio(byteLength, width, height, components, bpc) {
|
|
|
29
30
|
const pct = Math.min(999, Math.max(0.1, byteLength / uncompressedBytes * 100));
|
|
30
31
|
return `${pct.toFixed(1)}%`;
|
|
31
32
|
}
|
|
32
|
-
var PDFIMAGES_VALUE_FLAGS = /* @__PURE__ */ new Set(["-f", "-l", "-upw", "-opw"]);
|
|
33
|
+
var PDFIMAGES_VALUE_FLAGS = /* @__PURE__ */ new Set(["-f", "-l", "-upw", "-opw", "-min-width", "-min-height"]);
|
|
33
34
|
function extractPdfimagesPositionals(argv) {
|
|
34
35
|
const pos = [];
|
|
35
36
|
for (let i = 0; i < argv.length; i++) {
|
|
36
37
|
const arg = argv[i];
|
|
38
|
+
if (arg === "--") {
|
|
39
|
+
pos.push(...argv.slice(i + 1));
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
37
42
|
if (PDFIMAGES_VALUE_FLAGS.has(arg)) {
|
|
38
43
|
i++;
|
|
39
44
|
continue;
|
|
@@ -55,6 +60,8 @@ function* runPdfimagesCliSteps(argv, files, options = {}) {
|
|
|
55
60
|
let useCcitt = false;
|
|
56
61
|
let firstPage = 1;
|
|
57
62
|
let lastPage = 0;
|
|
63
|
+
let minWidth = 0;
|
|
64
|
+
let minHeight = 0;
|
|
58
65
|
let includePage = false;
|
|
59
66
|
let uniqueOnly = false;
|
|
60
67
|
let printFilenames = false;
|
|
@@ -65,15 +72,19 @@ function* runPdfimagesCliSteps(argv, files, options = {}) {
|
|
|
65
72
|
if (++cooperativeWork % 64 === 0)
|
|
66
73
|
yield;
|
|
67
74
|
const arg = argv[i];
|
|
75
|
+
if (arg === "--") {
|
|
76
|
+
positionals.push(...argv.slice(i + 1));
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
68
79
|
if (PDFIMAGES_VALUE_FLAGS.has(arg)) {
|
|
69
80
|
const value = argv[i + 1];
|
|
70
81
|
if (value === void 0) {
|
|
71
82
|
return { exitCode: 99, stdout: "", stderr: `Missing value for '${arg}'
|
|
72
83
|
` };
|
|
73
84
|
}
|
|
74
|
-
if (arg === "-f" || arg === "-l") {
|
|
85
|
+
if (arg === "-f" || arg === "-l" || arg === "-min-width" || arg === "-min-height") {
|
|
75
86
|
const unsigned = value.startsWith("+") || value.startsWith("-") ? value.slice(1) : value;
|
|
76
|
-
if (![...unsigned].every((char) => char >= "0" && char <= "9")) {
|
|
87
|
+
if (unsigned.length === 0 || !Number.isSafeInteger(Number(value)) || ![...unsigned].every((char) => char >= "0" && char <= "9")) {
|
|
77
88
|
return { exitCode: 99, stdout: "", stderr: `Bad '${arg}' value on command line
|
|
78
89
|
` };
|
|
79
90
|
}
|
|
@@ -85,7 +96,7 @@ function* runPdfimagesCliSteps(argv, files, options = {}) {
|
|
|
85
96
|
if (arg === "-h" || arg === "-help" || arg === "--help" || arg === "-?") {
|
|
86
97
|
return {
|
|
87
98
|
exitCode: 0,
|
|
88
|
-
stdout: "Usage: pdfimages [options] <PDF-file> [<image-root>]\n -list / -png / -j / -all / -f <int> / -l <int> / -p\n",
|
|
99
|
+
stdout: "Usage: pdfimages [options] <PDF-file> [<image-root>]\n -list / -png / -j / -all / -f <int> / -l <int> / -p\n -min-width <int> / -min-height <int> : ignore smaller images\n",
|
|
89
100
|
stderr: ""
|
|
90
101
|
};
|
|
91
102
|
}
|
|
@@ -121,6 +132,10 @@ function* runPdfimagesCliSteps(argv, files, options = {}) {
|
|
|
121
132
|
firstPage = Math.max(1, Number.parseInt(argv[++i] ?? "1", 10) || 1);
|
|
122
133
|
} else if (arg === "-l") {
|
|
123
134
|
lastPage = Math.max(0, Number.parseInt(argv[++i] ?? "0", 10) || 0);
|
|
135
|
+
} else if (arg === "-min-width") {
|
|
136
|
+
minWidth = Number(argv[++i]);
|
|
137
|
+
} else if (arg === "-min-height") {
|
|
138
|
+
minHeight = Number(argv[++i]);
|
|
124
139
|
} else if (arg === "-upw" || arg === "-opw") {
|
|
125
140
|
password = argv[++i] ?? "";
|
|
126
141
|
} else if (!arg.startsWith("-") || arg === "-") {
|
|
@@ -165,7 +180,8 @@ function* runPdfimagesCliSteps(argv, files, options = {}) {
|
|
|
165
180
|
signal: options.signal
|
|
166
181
|
});
|
|
167
182
|
const seenObjectIds = /* @__PURE__ */ new Set();
|
|
168
|
-
const
|
|
183
|
+
const sizedImages = allExtracted.filter((img) => img.width >= minWidth && img.height >= minHeight);
|
|
184
|
+
const extracted = uniqueOnly ? sizedImages.filter((img) => {
|
|
169
185
|
if (img.inline || !img.objectId)
|
|
170
186
|
return true;
|
|
171
187
|
const key = `${img.objectId.objNum}:${img.objectId.genNum}`;
|
|
@@ -173,7 +189,7 @@ function* runPdfimagesCliSteps(argv, files, options = {}) {
|
|
|
173
189
|
return false;
|
|
174
190
|
seenObjectIds.add(key);
|
|
175
191
|
return true;
|
|
176
|
-
}) :
|
|
192
|
+
}) : sizedImages;
|
|
177
193
|
const listLines = [
|
|
178
194
|
"page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio",
|
|
179
195
|
"--------------------------------------------------------------------------------------------"
|
|
@@ -275,7 +291,6 @@ async function executePdfimages(context) {
|
|
|
275
291
|
const carrier = getCommandArguments(context);
|
|
276
292
|
const argv = [...carrier.args];
|
|
277
293
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
278
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context.cwd === "/" ? "" : context.cwd}/${p}`;
|
|
279
294
|
let accountedBytes = 0;
|
|
280
295
|
const chargeBytes = (delta) => {
|
|
281
296
|
if (delta > 0) {
|
|
@@ -283,8 +298,9 @@ async function executePdfimages(context) {
|
|
|
283
298
|
context.inputBudget?.check(accountedBytes);
|
|
284
299
|
}
|
|
285
300
|
};
|
|
286
|
-
const
|
|
287
|
-
|
|
301
|
+
const needsInput = (await runPdfimagesCli(argv, /* @__PURE__ */ new Map(), { signal: invocation.signal })).exitCode === 1;
|
|
302
|
+
const positionals = needsInput ? extractPdfimagesPositionals(argv) : [];
|
|
303
|
+
if (needsInput && (positionals.length === 0 || positionals[0] === "-")) {
|
|
288
304
|
const chunks = [];
|
|
289
305
|
let total = 0;
|
|
290
306
|
for await (const chunk of readBytes(context.stdin, invocation.signal)) {
|
|
@@ -306,7 +322,7 @@ async function executePdfimages(context) {
|
|
|
306
322
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
307
323
|
if (token === "-") continue;
|
|
308
324
|
try {
|
|
309
|
-
const bytes = await context.fs.readFile(
|
|
325
|
+
const bytes = await context.fs.readFile(resolvePath(context.cwd, token), { signal: invocation.signal });
|
|
310
326
|
chargeBytes(bytes.byteLength);
|
|
311
327
|
vfsFiles.set(token, bytes);
|
|
312
328
|
} catch {
|
|
@@ -325,7 +341,7 @@ async function executePdfimages(context) {
|
|
|
325
341
|
for (const [key, val] of vfsFiles.entries()) {
|
|
326
342
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
327
343
|
if (key !== "-" && existingSnap.get(key) !== val) {
|
|
328
|
-
const abs =
|
|
344
|
+
const abs = resolvePath(context.cwd, key);
|
|
329
345
|
try {
|
|
330
346
|
await writeFileOutput(context, val, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
331
347
|
} catch (error) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-pdfinfo/src/index.ts
|
|
6
6
|
init_buffer();
|
|
7
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
7
8
|
import { yieldTurn, drainCooperativeSteps as drainSteps } from "../safe-bash-contracts/yield.js";
|
|
8
9
|
import { InputByteBudget } from "../safe-bash-contracts/io.js";
|
|
9
10
|
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
@@ -56,6 +57,10 @@ function parseArgs(argv) {
|
|
|
56
57
|
const positional = [];
|
|
57
58
|
for (let i = 0; i < argv.length; i++) {
|
|
58
59
|
const arg = argv[i];
|
|
60
|
+
if (arg === "--") {
|
|
61
|
+
positional.push(...argv.slice(i + 1));
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
59
64
|
if (arg === "-f") {
|
|
60
65
|
const next = argv[++i];
|
|
61
66
|
const val = Number.parseInt(next ?? "", 10);
|
|
@@ -150,7 +155,7 @@ function sanitizeControls(value, preserveLf = false) {
|
|
|
150
155
|
}
|
|
151
156
|
function formatField(label, value) {
|
|
152
157
|
const prefix = `${label}:`;
|
|
153
|
-
const pad = Math.max(1,
|
|
158
|
+
const pad = Math.max(1, 17 - [...prefix].length);
|
|
154
159
|
return `${prefix}${" ".repeat(pad)}${sanitizeControls(value)}
|
|
155
160
|
`;
|
|
156
161
|
}
|
|
@@ -890,11 +895,12 @@ ${act.js}
|
|
|
890
895
|
);
|
|
891
896
|
out += formatField(`${pagePrefix}rot`, String(rot));
|
|
892
897
|
if (args.box) {
|
|
893
|
-
|
|
894
|
-
out += formatField(`${
|
|
895
|
-
out += formatField(`${
|
|
896
|
-
out += formatField(`${
|
|
897
|
-
out += formatField(`${
|
|
898
|
+
const boxPrefix = multiPage ? pagePrefix : "";
|
|
899
|
+
out += formatField(`${boxPrefix}MediaBox`, formatBox8(mediaBox));
|
|
900
|
+
out += formatField(`${boxPrefix}CropBox`, formatBox8(cropBox));
|
|
901
|
+
out += formatField(`${boxPrefix}BleedBox`, formatBox8(bleedBox));
|
|
902
|
+
out += formatField(`${boxPrefix}TrimBox`, formatBox8(trimBox));
|
|
903
|
+
out += formatField(`${boxPrefix}ArtBox`, formatBox8(artBox));
|
|
898
904
|
}
|
|
899
905
|
}
|
|
900
906
|
const fileSize = options.isStdin ? 0 : options.fileSize ?? bytes.byteLength;
|
|
@@ -1001,7 +1007,7 @@ async function pdfinfo(context) {
|
|
|
1001
1007
|
offset += c.byteLength;
|
|
1002
1008
|
}
|
|
1003
1009
|
} else {
|
|
1004
|
-
const resolvedPath =
|
|
1010
|
+
const resolvedPath = resolvePath(context.cwd, inputTarget);
|
|
1005
1011
|
try {
|
|
1006
1012
|
pdfBytes = await context.fs.readFile(resolvedPath, { signal: invocation.signal });
|
|
1007
1013
|
chargeBytes(pdfBytes.byteLength);
|
|
@@ -1883,6 +1889,10 @@ function extractPopplerFileToolPositionals(argv) {
|
|
|
1883
1889
|
const pos = [];
|
|
1884
1890
|
for (let i = 0; i < argv.length; i++) {
|
|
1885
1891
|
const arg = argv[i];
|
|
1892
|
+
if (arg === "--") {
|
|
1893
|
+
pos.push(...argv.slice(i + 1));
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1886
1896
|
if (POPPLER_FILE_TOOL_VALUE_FLAGS.has(arg)) {
|
|
1887
1897
|
i++;
|
|
1888
1898
|
continue;
|
|
@@ -1901,7 +1911,6 @@ async function executePopplerFileTool(context, runner) {
|
|
|
1901
1911
|
const carrier = getCommandArguments(context);
|
|
1902
1912
|
const argv = [...carrier.args];
|
|
1903
1913
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
1904
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context.cwd === "/" ? "" : context.cwd}/${p}`;
|
|
1905
1914
|
let accountedBytes = 0;
|
|
1906
1915
|
const chargeBytes = (delta) => {
|
|
1907
1916
|
if (delta > 0) {
|
|
@@ -1934,7 +1943,7 @@ async function executePopplerFileTool(context, runner) {
|
|
|
1934
1943
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1935
1944
|
if (token === "-") continue;
|
|
1936
1945
|
try {
|
|
1937
|
-
const bytes = await context.fs.readFile(
|
|
1946
|
+
const bytes = await context.fs.readFile(resolvePath(context.cwd, token), { signal: invocation.signal });
|
|
1938
1947
|
chargeBytes(bytes.byteLength);
|
|
1939
1948
|
vfsFiles.set(token, bytes);
|
|
1940
1949
|
} catch {
|
|
@@ -1960,7 +1969,7 @@ async function executePopplerFileTool(context, runner) {
|
|
|
1960
1969
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1961
1970
|
if (key !== "-" && existingSnap.get(key) !== val) {
|
|
1962
1971
|
chargeBytes(val.byteLength);
|
|
1963
|
-
const abs =
|
|
1972
|
+
const abs = resolvePath(context.cwd, key);
|
|
1964
1973
|
try {
|
|
1965
1974
|
await writeFileOutput(context, val, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
1966
1975
|
} catch (error) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-pdftk/src/index.ts
|
|
6
6
|
init_buffer();
|
|
7
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
7
8
|
import { yieldTurn, drainCooperativeSteps as drainSteps } from "../safe-bash-contracts/yield.js";
|
|
8
9
|
import { InputByteBudget } from "../safe-bash-contracts/io.js";
|
|
9
10
|
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
@@ -1810,7 +1811,6 @@ async function executePdftk(context) {
|
|
|
1810
1811
|
const carrier = getCommandArguments(context);
|
|
1811
1812
|
const argv = [...carrier.args];
|
|
1812
1813
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
1813
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context.cwd === "/" ? "" : context.cwd}/${p}`;
|
|
1814
1814
|
let accountedBytes = 0;
|
|
1815
1815
|
const chargeBytes = (delta) => {
|
|
1816
1816
|
if (delta > 0) {
|
|
@@ -1861,7 +1861,7 @@ async function executePdftk(context) {
|
|
|
1861
1861
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1862
1862
|
if (filePath === "-") continue;
|
|
1863
1863
|
try {
|
|
1864
|
-
const bytes = await context.fs.readFile(
|
|
1864
|
+
const bytes = await context.fs.readFile(resolvePath(context.cwd, filePath), { signal: invocation.signal });
|
|
1865
1865
|
chargeBytes(bytes.byteLength);
|
|
1866
1866
|
vfsFiles.set(filePath, bytes);
|
|
1867
1867
|
} catch {
|
|
@@ -1887,7 +1887,7 @@ async function executePdftk(context) {
|
|
|
1887
1887
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1888
1888
|
if (key !== "-" && existingSnap.get(key) !== val) {
|
|
1889
1889
|
chargeBytes(val.byteLength);
|
|
1890
|
-
const abs =
|
|
1890
|
+
const abs = resolvePath(context.cwd, key);
|
|
1891
1891
|
try {
|
|
1892
1892
|
await writeFileOutput(context, val, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
1893
1893
|
} catch (error) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-pdftoppm/src/index.ts
|
|
6
6
|
init_buffer();
|
|
7
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
7
8
|
import { yieldTurn, drainCooperativeSteps as drainSteps } from "../safe-bash-contracts/yield.js";
|
|
8
9
|
import { InputByteBudget } from "../safe-bash-contracts/io.js";
|
|
9
10
|
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
@@ -48,6 +49,10 @@ function extractPdftoppmPositionals(argv) {
|
|
|
48
49
|
const pos = [];
|
|
49
50
|
for (let i = 0; i < argv.length; i++) {
|
|
50
51
|
const arg = argv[i];
|
|
52
|
+
if (arg === "--") {
|
|
53
|
+
pos.push(...argv.slice(i + 1));
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
51
56
|
if (VALUE_FLAGS.has(arg)) {
|
|
52
57
|
i++;
|
|
53
58
|
continue;
|
|
@@ -98,6 +103,10 @@ function* runPdftoppmCliSteps(argv, files, options = {}) {
|
|
|
98
103
|
if (++cooperativeWork % 64 === 0)
|
|
99
104
|
yield;
|
|
100
105
|
const arg = argv[i];
|
|
106
|
+
if (arg === "--") {
|
|
107
|
+
positionals.push(...argv.slice(i + 1));
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
101
110
|
if (VALUE_FLAGS.has(arg)) {
|
|
102
111
|
const value = argv[i + 1];
|
|
103
112
|
if (value === void 0) {
|
|
@@ -439,7 +448,6 @@ async function executePdftoppm(context) {
|
|
|
439
448
|
const carrier = getCommandArguments(context);
|
|
440
449
|
const argv = [...carrier.args];
|
|
441
450
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
442
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context.cwd === "/" ? "" : context.cwd}/${p}`;
|
|
443
451
|
let accountedBytes = 0;
|
|
444
452
|
const chargeBytes = (delta) => {
|
|
445
453
|
if (delta > 0) {
|
|
@@ -447,8 +455,9 @@ async function executePdftoppm(context) {
|
|
|
447
455
|
context.inputBudget?.check(accountedBytes);
|
|
448
456
|
}
|
|
449
457
|
};
|
|
450
|
-
const
|
|
451
|
-
const
|
|
458
|
+
const needsInput = (await runPdftoppmCli(argv, /* @__PURE__ */ new Map([["-", new Uint8Array()]]), { signal: invocation.signal })).exitCode === 1;
|
|
459
|
+
const positionals = needsInput ? extractPdftoppmPositionals(argv) : [];
|
|
460
|
+
const readStdin = needsInput && (positionals.length === 0 || positionals[0] === "-");
|
|
452
461
|
if (readStdin) {
|
|
453
462
|
const chunks = [];
|
|
454
463
|
let total = 0;
|
|
@@ -471,7 +480,7 @@ async function executePdftoppm(context) {
|
|
|
471
480
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
472
481
|
if (token === "-") continue;
|
|
473
482
|
try {
|
|
474
|
-
const bytes = await context.fs.readFile(
|
|
483
|
+
const bytes = await context.fs.readFile(resolvePath(context.cwd, token), { signal: invocation.signal });
|
|
475
484
|
chargeBytes(bytes.byteLength);
|
|
476
485
|
vfsFiles.set(token, bytes);
|
|
477
486
|
} catch {
|
|
@@ -493,7 +502,7 @@ async function executePdftoppm(context) {
|
|
|
493
502
|
for (const [key, val] of vfsFiles.entries()) {
|
|
494
503
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
495
504
|
if (key !== "-" && existingSnap.get(key) !== val) {
|
|
496
|
-
const abs =
|
|
505
|
+
const abs = resolvePath(context.cwd, key);
|
|
497
506
|
try {
|
|
498
507
|
await writeFileOutput(context, val, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
499
508
|
} catch (error) {
|
|
@@ -543,6 +552,10 @@ function extractPdftocairoPositionals(argv) {
|
|
|
543
552
|
const pos = [];
|
|
544
553
|
for (let i = 0; i < argv.length; i++) {
|
|
545
554
|
const arg = argv[i];
|
|
555
|
+
if (arg === "--") {
|
|
556
|
+
pos.push(...argv.slice(i + 1));
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
546
559
|
if (CAIRO_VALUE_FLAGS.has(arg)) {
|
|
547
560
|
i++;
|
|
548
561
|
continue;
|
|
@@ -578,6 +591,10 @@ function* runPdftocairoCliSteps(argv, files, options = {}) {
|
|
|
578
591
|
if (++cooperativeWork % 64 === 0)
|
|
579
592
|
yield;
|
|
580
593
|
const arg = argv[i];
|
|
594
|
+
if (arg === "--") {
|
|
595
|
+
positionals.push(...argv.slice(i + 1));
|
|
596
|
+
break;
|
|
597
|
+
}
|
|
581
598
|
if (arg === "-v" || arg === "--version") {
|
|
582
599
|
return { exitCode: 0, stdout: "pdftocairo version 24.08.0\n", stderr: "" };
|
|
583
600
|
}
|
|
@@ -699,7 +716,7 @@ function* runPdftocairoCliSteps(argv, files, options = {}) {
|
|
|
699
716
|
if (format === "svg") {
|
|
700
717
|
const rawOut = positionals[1] ?? (inputPath === "-" ? "-" : `${inputStem}.svg`);
|
|
701
718
|
const rootForSvg = rawOut.toLowerCase().endsWith(".svg") ? rawOut.slice(0, -4) : rawOut;
|
|
702
|
-
return yield* runPdftoppmCliSteps(["-svg", "-singlefile", ...forwardedArgs, inputPath, rootForSvg], files, options);
|
|
719
|
+
return yield* runPdftoppmCliSteps(["-svg", "-singlefile", ...forwardedArgs, "--", inputPath, rootForSvg], files, options);
|
|
703
720
|
}
|
|
704
721
|
if (format === "pdf" || format === "ps" || format === "eps") {
|
|
705
722
|
const pdfBytes = files.get(inputPath);
|
|
@@ -810,7 +827,7 @@ function* runPdftocairoCliSteps(argv, files, options = {}) {
|
|
|
810
827
|
}
|
|
811
828
|
const snapBefore = new Map(files);
|
|
812
829
|
const rasterPositionals = positionals.length === 1 && inputPath !== "-" ? [inputPath, inputStem] : positionals;
|
|
813
|
-
const res = yield* runPdftoppmCliSteps([...forwardedArgs, ...rasterPositionals], files, options);
|
|
830
|
+
const res = yield* runPdftoppmCliSteps([...forwardedArgs, "--", ...rasterPositionals], files, options);
|
|
814
831
|
if (res.exitCode !== 0 || !grayMode && !monoMode) {
|
|
815
832
|
return res;
|
|
816
833
|
}
|
|
@@ -860,7 +877,6 @@ function createPdftocairoCommand(options = {}) {
|
|
|
860
877
|
const carrier = getCommandArguments(context2);
|
|
861
878
|
const argv = [...carrier.args];
|
|
862
879
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
863
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context2.cwd === "/" ? "" : context2.cwd}/${p}`;
|
|
864
880
|
let accountedBytes = 0;
|
|
865
881
|
const chargeBytes = (delta) => {
|
|
866
882
|
if (delta > 0) {
|
|
@@ -893,7 +909,7 @@ function createPdftocairoCommand(options = {}) {
|
|
|
893
909
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context2.signal);
|
|
894
910
|
if (token === "-") continue;
|
|
895
911
|
try {
|
|
896
|
-
const bytes = await context2.fs.readFile(
|
|
912
|
+
const bytes = await context2.fs.readFile(resolvePath(context2.cwd, token), { signal: invocation.signal });
|
|
897
913
|
chargeBytes(bytes.byteLength);
|
|
898
914
|
vfsFiles.set(token, bytes);
|
|
899
915
|
} catch {
|
|
@@ -915,7 +931,7 @@ function createPdftocairoCommand(options = {}) {
|
|
|
915
931
|
for (const [key, val] of vfsFiles.entries()) {
|
|
916
932
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context2.signal);
|
|
917
933
|
if (key !== "-" && existingSnap.get(key) !== val) {
|
|
918
|
-
const abs =
|
|
934
|
+
const abs = resolvePath(context2.cwd, key);
|
|
919
935
|
try {
|
|
920
936
|
await writeFileOutput(context2, val, (data) => context2.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
921
937
|
} catch (error) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-pdftotext/src/index.ts
|
|
6
6
|
init_buffer();
|
|
7
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
7
8
|
import { yieldTurn, drainCooperativeSteps as drainSteps } from "../safe-bash-contracts/yield.js";
|
|
8
9
|
import { InputByteBudget } from "../safe-bash-contracts/io.js";
|
|
9
10
|
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
@@ -285,6 +286,13 @@ var ASCII7_COMPAT_MAP = {
|
|
|
285
286
|
"\u2026": "...",
|
|
286
287
|
"\xA0": " "
|
|
287
288
|
};
|
|
289
|
+
function encodeUcs2(text) {
|
|
290
|
+
const bytes = new Uint8Array(2 + text.length * 2);
|
|
291
|
+
const view = new DataView(bytes.buffer);
|
|
292
|
+
view.setUint16(0, 65279);
|
|
293
|
+
for (let i = 0; i < text.length; i++) view.setUint16(2 + i * 2, text.charCodeAt(i));
|
|
294
|
+
return bytes;
|
|
295
|
+
}
|
|
288
296
|
function applyPopplerOutputEncoding(text, encoding) {
|
|
289
297
|
if (!encoding || encoding === "UTF-8" || encoding === "UCS-2") return text;
|
|
290
298
|
if (encoding === "ASCII7") {
|
|
@@ -431,14 +439,14 @@ function renderBboxHtml(doc, pages, args) {
|
|
|
431
439
|
const bxMax = (block.bbox[2] * scale).toFixed(6);
|
|
432
440
|
const byMax = ((extracted.height - block.bbox[1]) * scale).toFixed(6);
|
|
433
441
|
if (args.bboxLayout) html += " <flow>\n";
|
|
434
|
-
html += ` <block xMin="${bxMin}" yMin="${byMin}" xMax="${bxMax}" yMax="${byMax}">
|
|
442
|
+
if (args.bboxLayout) html += ` <block xMin="${bxMin}" yMin="${byMin}" xMax="${bxMax}" yMax="${byMax}">
|
|
435
443
|
`;
|
|
436
444
|
for (const line of block.lines) {
|
|
437
445
|
const lxMin = (line.bbox[0] * scale).toFixed(6);
|
|
438
446
|
const lyMin = ((extracted.height - line.bbox[3]) * scale).toFixed(6);
|
|
439
447
|
const lxMax = (line.bbox[2] * scale).toFixed(6);
|
|
440
448
|
const lyMax = ((extracted.height - line.bbox[1]) * scale).toFixed(6);
|
|
441
|
-
html += ` <line xMin="${lxMin}" yMin="${lyMin}" xMax="${lxMax}" yMax="${lyMax}">
|
|
449
|
+
if (args.bboxLayout) html += ` <line xMin="${lxMin}" yMin="${lyMin}" xMax="${lxMax}" yMax="${lyMax}">
|
|
442
450
|
`;
|
|
443
451
|
for (const word of line.words) {
|
|
444
452
|
const wxMin = (word.bbox[0] * scale).toFixed(6);
|
|
@@ -448,9 +456,9 @@ function renderBboxHtml(doc, pages, args) {
|
|
|
448
456
|
html += ` <word xMin="${wxMin}" yMin="${wyMin}" xMax="${wxMax}" yMax="${wyMax}">${escapeXml(word.text)}</word>
|
|
449
457
|
`;
|
|
450
458
|
}
|
|
451
|
-
html += " </line>\n";
|
|
459
|
+
if (args.bboxLayout) html += " </line>\n";
|
|
452
460
|
}
|
|
453
|
-
html += " </block>\n";
|
|
461
|
+
if (args.bboxLayout) html += " </block>\n";
|
|
454
462
|
if (args.bboxLayout) html += " </flow>\n";
|
|
455
463
|
}
|
|
456
464
|
html += " </page>\n";
|
|
@@ -474,7 +482,7 @@ function renderTsv(pages, args) {
|
|
|
474
482
|
const bWidth = ((block.bbox[2] - block.bbox[0]) * scale).toFixed(6);
|
|
475
483
|
const bHeight = ((block.bbox[3] - block.bbox[1]) * scale).toFixed(6);
|
|
476
484
|
rows.push(
|
|
477
|
-
`
|
|
485
|
+
`3 ${pageNumber} ${blockIdx} ${blockIdx} 0 0 ${bLeft} ${bTop} ${bWidth} ${bHeight} -1 ###FLOW###`
|
|
478
486
|
);
|
|
479
487
|
block.lines.forEach((line, lineIdx) => {
|
|
480
488
|
const lLeft = (line.bbox[0] * scale).toFixed(6);
|
|
@@ -690,7 +698,7 @@ ${escapeXml(tsvText)}</pre>
|
|
|
690
698
|
if (eolChar !== "\n") {
|
|
691
699
|
pageText = pageText.replaceAll("\n", eolChar);
|
|
692
700
|
}
|
|
693
|
-
if (pageText.length > 0 && !pageText.endsWith(eolChar)) {
|
|
701
|
+
if (mode !== "raw" && pageText.length > 0 && !pageText.endsWith(eolChar)) {
|
|
694
702
|
pageText += eolChar;
|
|
695
703
|
}
|
|
696
704
|
if (mode === "logical" && pageText.length > 0) {
|
|
@@ -819,7 +827,7 @@ async function pdftotext(context) {
|
|
|
819
827
|
offset += c.byteLength;
|
|
820
828
|
}
|
|
821
829
|
} else {
|
|
822
|
-
const resolvedPath =
|
|
830
|
+
const resolvedPath = resolvePath(context.cwd, inputTarget);
|
|
823
831
|
try {
|
|
824
832
|
pdfBytes = await context.fs.readFile(resolvedPath, { signal: invocation.signal });
|
|
825
833
|
chargeBytes(pdfBytes.byteLength);
|
|
@@ -839,13 +847,13 @@ async function pdftotext(context) {
|
|
|
839
847
|
if (res.exitCode !== 0) {
|
|
840
848
|
return { exitCode: res.exitCode };
|
|
841
849
|
}
|
|
842
|
-
const outBytes = new TextEncoder().encode(res.output);
|
|
850
|
+
const outBytes = parsed.encoding === "Latin1" ? Uint8Array.from(res.output, (char) => char.charCodeAt(0)) : parsed.encoding === "UCS-2" ? encodeUcs2(res.output) : new TextEncoder().encode(res.output);
|
|
843
851
|
chargeBytes(outBytes.byteLength);
|
|
844
852
|
if (res.outputPath === "-") {
|
|
845
853
|
const stdout = invocation.child(context.stdout);
|
|
846
854
|
await writeBytes(stdout.output, outBytes, invocation.signal);
|
|
847
855
|
} else {
|
|
848
|
-
const outResolved =
|
|
856
|
+
const outResolved = resolvePath(context.cwd, res.outputPath);
|
|
849
857
|
try {
|
|
850
858
|
await writeFileOutput(context, outBytes, (data) => context.fs.writeFile(outResolved, data, { signal: invocation.signal }));
|
|
851
859
|
} catch {
|
|
@@ -909,6 +917,10 @@ function* runPdftohtmlCliSteps(argv, files, signal) {
|
|
|
909
917
|
if (++cooperativeWork % 64 === 0)
|
|
910
918
|
yield;
|
|
911
919
|
const arg = argv[i];
|
|
920
|
+
if (arg === "--") {
|
|
921
|
+
positionals.push(...argv.slice(i + 1));
|
|
922
|
+
break;
|
|
923
|
+
}
|
|
912
924
|
if (arg === "-v" || arg === "--version") {
|
|
913
925
|
return { exitCode: 0, stdout: "pdftohtml version 24.08.0\n", stderr: "" };
|
|
914
926
|
}
|
|
@@ -1233,7 +1245,6 @@ async function pdftohtml(context) {
|
|
|
1233
1245
|
const carrier = getCommandArguments(context);
|
|
1234
1246
|
const argv = [...carrier.args];
|
|
1235
1247
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
1236
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context.cwd === "/" ? "" : context.cwd}/${p}`;
|
|
1237
1248
|
let accountedBytes = 0;
|
|
1238
1249
|
const chargeBytes = (delta) => {
|
|
1239
1250
|
if (delta > 0) {
|
|
@@ -1245,6 +1256,10 @@ async function pdftohtml(context) {
|
|
|
1245
1256
|
for (let i = 0; i < argv.length; i++) {
|
|
1246
1257
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1247
1258
|
const arg = argv[i];
|
|
1259
|
+
if (arg === "--") {
|
|
1260
|
+
inputOperand = argv[i + 1];
|
|
1261
|
+
break;
|
|
1262
|
+
}
|
|
1248
1263
|
if (["-f", "-l", "-zoom", "-fmt", "-enc", "-upw", "-opw"].includes(arg)) {
|
|
1249
1264
|
i++;
|
|
1250
1265
|
} else if (arg === "-" || !arg.startsWith("-")) {
|
|
@@ -1274,9 +1289,8 @@ async function pdftohtml(context) {
|
|
|
1274
1289
|
}
|
|
1275
1290
|
for (const token of inputOperand && inputOperand !== "-" ? [inputOperand] : []) {
|
|
1276
1291
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1277
|
-
if (token.startsWith("-") && token !== "-") continue;
|
|
1278
1292
|
try {
|
|
1279
|
-
const bytes = await context.fs.readFile(
|
|
1293
|
+
const bytes = await context.fs.readFile(resolvePath(context.cwd, token), { signal: invocation.signal });
|
|
1280
1294
|
chargeBytes(bytes.byteLength);
|
|
1281
1295
|
vfsFiles.set(token, bytes);
|
|
1282
1296
|
} catch {
|
|
@@ -1298,7 +1312,7 @@ async function pdftohtml(context) {
|
|
|
1298
1312
|
if (++cooperativeWork % 64 === 0) await yieldTurn(context.signal);
|
|
1299
1313
|
if (existingSnap.get(key) !== val) {
|
|
1300
1314
|
chargeBytes(val.byteLength);
|
|
1301
|
-
const abs =
|
|
1315
|
+
const abs = resolvePath(context.cwd, key);
|
|
1302
1316
|
try {
|
|
1303
1317
|
await writeFileOutput(context, val, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
1304
1318
|
} catch (error) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-qpdf/src/index.ts
|
|
6
6
|
init_buffer();
|
|
7
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
7
8
|
import { yieldTurn } from "../safe-bash-contracts/yield.js";
|
|
8
9
|
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
9
10
|
import {
|
|
@@ -2365,7 +2366,6 @@ async function qpdf(context, options = {}) {
|
|
|
2365
2366
|
const argumentBytes = argv.reduce((total, arg) => total + new TextEncoder().encode(arg).byteLength + 1, 0);
|
|
2366
2367
|
if (argumentBytes > limits.maxArgumentBytes) throw new RangeError("Argument byte limit exceeded");
|
|
2367
2368
|
const vfsFiles = /* @__PURE__ */ new Map();
|
|
2368
|
-
const resolveVfsPath = (p) => p.startsWith("/") ? p : `${context.cwd === "/" ? "" : context.cwd}/${p}`;
|
|
2369
2369
|
let accountedBytes = 0;
|
|
2370
2370
|
const chargeBytes = (delta) => {
|
|
2371
2371
|
if (delta > 0) {
|
|
@@ -2380,7 +2380,7 @@ async function qpdf(context, options = {}) {
|
|
|
2380
2380
|
const path = token.slice(1);
|
|
2381
2381
|
let bytes;
|
|
2382
2382
|
try {
|
|
2383
|
-
bytes = await context.fs.readFile(
|
|
2383
|
+
bytes = await context.fs.readFile(resolvePath(context.cwd, path), { signal: invocation.signal });
|
|
2384
2384
|
} catch {
|
|
2385
2385
|
await writeBytes(context.stderr, new TextEncoder().encode(`qpdf: cannot open ${path}
|
|
2386
2386
|
`), invocation.signal);
|
|
@@ -2405,7 +2405,7 @@ async function qpdf(context, options = {}) {
|
|
|
2405
2405
|
for (const candidate of new Set(inputs)) {
|
|
2406
2406
|
await yieldTurn(invocation.signal);
|
|
2407
2407
|
if (!candidate || candidate === "-" || candidate === ".") continue;
|
|
2408
|
-
const abs =
|
|
2408
|
+
const abs = resolvePath(context.cwd, candidate);
|
|
2409
2409
|
let bytes;
|
|
2410
2410
|
try {
|
|
2411
2411
|
bytes = await context.fs.readFile(abs, { signal: invocation.signal });
|
|
@@ -2433,7 +2433,7 @@ async function qpdf(context, options = {}) {
|
|
|
2433
2433
|
if (!stream || typeof stream.datafile !== "string" || vfsFiles.has(stream.datafile)) continue;
|
|
2434
2434
|
let bytes;
|
|
2435
2435
|
try {
|
|
2436
|
-
bytes = await context.fs.readFile(
|
|
2436
|
+
bytes = await context.fs.readFile(resolvePath(context.cwd, stream.datafile), { signal: invocation.signal });
|
|
2437
2437
|
} catch {
|
|
2438
2438
|
invocation.signal.throwIfAborted();
|
|
2439
2439
|
continue;
|
|
@@ -2477,7 +2477,7 @@ async function qpdf(context, options = {}) {
|
|
|
2477
2477
|
const stdout = invocation.child(context.stdout);
|
|
2478
2478
|
await writeBytes(stdout.output, fileBytes, invocation.signal);
|
|
2479
2479
|
} else {
|
|
2480
|
-
const abs =
|
|
2480
|
+
const abs = resolvePath(context.cwd, fileKey);
|
|
2481
2481
|
try {
|
|
2482
2482
|
await writeFileOutput(context, fileBytes, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
2483
2483
|
} catch (error) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type CommandDefinition } from "../safe-bash-contracts/index.js";
|
|
2
2
|
import { type SearchOptions } from "../safe-bash-search-engine/options.js";
|
|
3
3
|
import { RegexExecutor } from "../safe-bash-regex-engine/execution/portable.js";
|
|
4
|
-
export declare function preverifyMemoryRgTree(fastMem: unknown): void;
|
|
5
4
|
export declare function clearRgFastRunnerPool(): void;
|
|
6
5
|
export declare function createRgCommand(executor: RegexExecutor, options?: SearchOptions): CommandDefinition;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearRgFastRunnerPool,
|
|
3
|
-
createRgCommand
|
|
4
|
-
|
|
5
|
-
} from "../safe-bash/command-chunks/chunk-GLOZX57Y.js";
|
|
3
|
+
createRgCommand
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-OQKC5ZU2.js";
|
|
6
5
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
7
6
|
export {
|
|
8
7
|
clearRgFastRunnerPool,
|
|
9
|
-
createRgCommand
|
|
10
|
-
preverifyMemoryRgTree
|
|
8
|
+
createRgCommand
|
|
11
9
|
};
|