@poe-platform/safe-bash 0.1.817 → 0.1.819
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/dist/image-ast/index.js +2 -2
- package/dist/mp4-ast/index.d.ts +2 -1
- package/dist/mp4-ast/mp4-metadata-source.d.ts +10 -0
- package/dist/mp4-ast/mp4-packets-source.d.ts +8 -1
- package/dist/mp4-ast/types.d.ts +21 -3
- package/dist/office-xml/retained-xml-document.d.ts +2 -2
- package/dist/pdf-ast/ast.d.ts +2 -0
- package/dist/pdf-ast/content/evaluator.d.ts +7 -0
- package/dist/pdf-ast/content/retained-evaluator.d.ts +2 -2
- package/dist/pdf-ast/content/retained-page.d.ts +2 -2
- package/dist/pdf-ast/cos/compact-number.d.ts +19 -0
- package/dist/pdf-ast/cos/mutable-object-store.d.ts +2 -1
- package/dist/pdf-ast/cos/retained-node-writer.d.ts +9 -0
- package/dist/pdf-ast/cos/text-store.d.ts +27 -0
- package/dist/pdf-ast/edit/retained-bookmarks.d.ts +2 -2
- package/dist/pdf-ast/edit/retained-info-updates.d.ts +3 -3
- package/dist/pdf-ast/edit/retained-merge-outlines.d.ts +43 -0
- package/dist/pdf-ast/edit/retained-page-copy.d.ts +2 -0
- package/dist/pdf-ast/extract/html-text-stream.d.ts +14 -0
- package/dist/pdf-ast/extract/logical-text-stream.d.ts +14 -0
- package/dist/pdf-ast/extract/raw-text-index.d.ts +18 -4
- package/dist/pdf-ast/extract/retained-color.d.ts +6 -6
- package/dist/pdf-ast/extract/retained-decoded-image.d.ts +2 -2
- package/dist/pdf-ast/extract/stored-text-glyphs.d.ts +8 -0
- package/dist/pdf-ast/fonts/retained.d.ts +2 -2
- package/dist/pdf-ast/image.d.ts +2 -0
- package/dist/pdf-ast/image.js +19 -0
- package/dist/pdf-ast/index.d.ts +6 -0
- package/dist/pdf-ast/index.js +270 -66852
- package/dist/pdf-ast/render/postscript.d.ts +6 -0
- package/dist/pdf-ast/render/raster.d.ts +21 -1
- package/dist/pdf-ast/retained-document.d.ts +23 -95
- package/dist/pdf-ast/retained-reader.d.ts +113 -0
- package/dist/safe-bash/ast-grep.js +1 -1
- package/dist/safe-bash/audio-ast.js +1 -1
- package/dist/safe-bash/byte-encoding.js +1 -1
- package/dist/safe-bash/chunks/{chunk-HD6DWOAC.js → chunk-67QE3JLU.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-HPQE675Q.js → chunk-ESH5MDQR.js} +1 -1
- package/dist/safe-bash/chunks/chunk-HNT2MR4W.js +45 -0
- package/dist/safe-bash/chunks/{chunk-SXSEF5E2.js → chunk-IRJS54AA.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-AXGI5JVL.js → chunk-NAETSXBW.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-WW7QPLH2.js → chunk-PSD2RSOS.js} +2 -1
- package/dist/safe-bash/chunks/{chunk-FQRI5AS5.js → chunk-VF3Q2V3E.js} +1 -1
- package/dist/safe-bash/chunks/{pdfinfo-KQIQEDOF.js → pdfinfo-G7BGZXBN.js} +2 -12
- package/dist/safe-bash/command-chunks/biff-AYJZR2YV-YFF3BK43.js +5741 -0
- package/dist/safe-bash/command-chunks/{chunk-FEBTT5NH.js → chunk-22D6Q6SW.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ALD53QFL.js → chunk-2C4QMQQD.js} +42 -12
- package/dist/safe-bash/command-chunks/{chunk-ZHHALBM7.js → chunk-2E53ZL5D.js} +11 -9
- package/dist/safe-bash/command-chunks/{chunk-EJ4UP7DA.js → chunk-2ESK2YIE.js} +27 -5
- package/dist/safe-bash/command-chunks/{chunk-CKA7ZROU.js → chunk-2GU2UU2Z.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-L2VLASZ4.js → chunk-2GUI3ZKE.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-2H6RJPCQ.js +721 -0
- package/dist/safe-bash/command-chunks/{chunk-DRHONH2C.js → chunk-2IGH6JIP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QDV2NIFR.js → chunk-2TMTGVJR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-MQE77MEQ.js → chunk-2V6EUWE3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BIJW6QWB.js → chunk-2VSNIHIW.js} +21 -21
- package/dist/safe-bash/command-chunks/{chunk-FSG6UC2N.js → chunk-2XR7B6DY.js} +420 -167
- package/dist/safe-bash/command-chunks/{chunk-EY3UE26F.js → chunk-2YC6MWQB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NLCUQD7Y.js → chunk-3DID6MQY.js} +21 -11
- package/dist/safe-bash/command-chunks/{chunk-5VO534FR.js → chunk-3K5FCRUG.js} +1 -0
- package/dist/safe-bash/command-chunks/{chunk-BSTABZIK.js → chunk-3LMUKOP2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XBWD6SI3.js → chunk-3MFYCMQU.js} +37 -37
- package/dist/safe-bash/command-chunks/chunk-3PO534WJ.js +37 -0
- package/dist/safe-bash/command-chunks/{chunk-UFLMOU3B.js → chunk-3RDEX4AF.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DOVWHVHI.js → chunk-3TXPZLFI.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-TID5TSQW.js → chunk-42OQIFPW.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-UJYXSLM6.js → chunk-45QE6QRR.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LMLBQSAM.js → chunk-4HJEZGYN.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-5QXRIZSS.js → chunk-4Q3HP33O.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-EBX5RKKT.js → chunk-4XYGJB24.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-NDALIHKK.js → chunk-4ZQYBCB2.js} +22 -22
- package/dist/safe-bash/command-chunks/{chunk-OFONWWEZ.js → chunk-5IHJWBDR.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TG2RVQLP.js → chunk-5KWEZV5H.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UYZ6EFZE.js → chunk-5P5SF75H.js} +83 -34
- package/dist/safe-bash/command-chunks/{chunk-P462JTNT.js → chunk-5PJ6VT2O.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-SICTBSLW.js → chunk-5QR4LTAK.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-ARE267HR.js → chunk-5XIJYTQU.js} +7 -7
- package/dist/safe-bash/command-chunks/chunk-63WEASJ7.js +137 -0
- package/dist/safe-bash/command-chunks/{chunk-3K5CVXUV.js → chunk-64L57DEI.js} +19 -19
- package/dist/safe-bash/command-chunks/{chunk-2ALHVXEM.js → chunk-6EK76ERE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4772DJKS.js → chunk-6GCK2KSL.js} +61 -26
- package/dist/safe-bash/command-chunks/{chunk-T5OQ53XS.js → chunk-6IID5HTY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ABL2DPJI.js → chunk-6PDXNY3T.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-X42MJT2J.js → chunk-6RE4MZYM.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-AF2IO57Q.js → chunk-6REH56FL.js} +14 -140
- package/dist/safe-bash/command-chunks/{chunk-XFIDOCYH.js → chunk-6ZHNKHQQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6JGICYHP.js → chunk-75OUKYCM.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-POGVOCOB.js → chunk-772WNCU6.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-3DWFXESW.js → chunk-7GJJDM2F.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-XVEI4HZL.js → chunk-7JTJQKIV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WIW3KDBS.js → chunk-7NFICYRU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-3ZVK2OAY.js → chunk-A4GYNM2E.js} +6 -5
- package/dist/safe-bash/command-chunks/chunk-AC4FFCRL.js +3820 -0
- package/dist/safe-bash/command-chunks/{chunk-SQBWAFUI.js → chunk-ADN7BU5X.js} +58 -26
- package/dist/safe-bash/command-chunks/{chunk-FHQOFEQK.js → chunk-AEHEOKI2.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-BZRWZ6GO.js → chunk-AH3ZEPAN.js} +12 -9
- package/dist/safe-bash/command-chunks/{chunk-3MUFXGA2.js → chunk-AR65HNNX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-VNNNVT4C.js → chunk-ARA57PMC.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-3VGQTLO6.js → chunk-AXUHORS3.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-B6NAEWHC.js +53 -0
- package/dist/safe-bash/command-chunks/{chunk-2ZWRW6UQ.js → chunk-B74LVFAN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-E4TF5W6O.js → chunk-BBOYR6LV.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ZM7HMBAJ.js → chunk-BDGNKRY4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-KDBU5Q2N.js → chunk-BFOVQUTF.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-GNT3SCF3.js → chunk-BOMCPF7N.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZNCPIZCN.js → chunk-BSLXS4PE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-N6TG44VG.js → chunk-BTDSUATE.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VZJRFHMZ.js → chunk-BXDNFBKZ.js} +26 -2
- package/dist/safe-bash/command-chunks/chunk-BZLLQWRK.js +296 -0
- package/dist/safe-bash/command-chunks/{chunk-YXR4JE4U.js → chunk-C3FERGHU.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-C5SLY3RB.js +279 -0
- package/dist/safe-bash/command-chunks/{chunk-5O45KGW5.js → chunk-C5VUJOUQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T4SEQU66.js → chunk-CI6KHUFK.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-CJIFJ45R.js +203 -0
- package/dist/safe-bash/command-chunks/{chunk-OTEHQQU7.js → chunk-CKQ5SXOO.js} +8 -59
- package/dist/safe-bash/command-chunks/{chunk-LJ3UYESS.js → chunk-CP5EO5TT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TY7JXEWI.js → chunk-CPCXE2TM.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-VVWHFNHD.js → chunk-CXOAMPOV.js} +420 -28
- package/dist/safe-bash/command-chunks/{chunk-57PK2QFX.js → chunk-D3WMD32B.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-LECGQSQW.js → chunk-D54L2IOZ.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-FGARVKAX.js → chunk-DBYY7IDI.js} +24 -20
- package/dist/safe-bash/command-chunks/{chunk-LNAZ3E4Q.js → chunk-DGFMOT4O.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-N5J3IZZK.js → chunk-DQVOBGI2.js} +12414 -8140
- package/dist/safe-bash/command-chunks/{chunk-OHEZQ4QA.js → chunk-DTLIBRCQ.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-FGHSE3RZ.js → chunk-DZ4ELL34.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ICJH6A73.js → chunk-DZTT5SLG.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-77NXQZGK.js → chunk-DZY7V74W.js} +3 -1
- package/dist/safe-bash/command-chunks/chunk-E47FFS5M.js +52 -0
- package/dist/safe-bash/command-chunks/{chunk-LNKZVU5V.js → chunk-E76WK7OQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EWC56JNI.js → chunk-EBMKGNKF.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-5GDF5FAS.js → chunk-EEJ3YXVO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GMBUOYTN.js → chunk-EG7VVDV3.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-N32AP43V.js → chunk-EIZFAUUD.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-FR63MJSO.js → chunk-ESIEU4E4.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-QJZJWL2X.js → chunk-ET3CPTJT.js} +38 -25
- package/dist/safe-bash/command-chunks/{chunk-UT5X6QRU.js → chunk-ETS4BINB.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-SBXS4S6Y.js → chunk-EU5SR3LS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FTZFCMVI.js → chunk-FAVWWMFW.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-YKODRSGT.js → chunk-FCGMSOF6.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-S5ER73EA.js → chunk-FGK6HLSY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WMV5224N.js → chunk-FILE5PBI.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-7ADQE64C.js → chunk-FMGNXOMV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XPQUUFQD.js → chunk-FPOM47UA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ZZERSKAR.js → chunk-FX54I4AC.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-CORUUCS2.js → chunk-GAYTDZPP.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-GCSKS22X.js +15 -0
- package/dist/safe-bash/command-chunks/{chunk-2QZUAZTH.js → chunk-GIQUIF6E.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UVZJAV2S.js → chunk-GNPPPYDF.js} +1 -78
- package/dist/safe-bash/command-chunks/{chunk-B6XTAKKQ.js → chunk-GNVAW6NL.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-GQV5RWMN.js +27 -0
- package/dist/safe-bash/command-chunks/{chunk-PWHIVWQT.js → chunk-GVDVRC7J.js} +15 -19
- package/dist/safe-bash/command-chunks/{chunk-N4HWOLGZ.js → chunk-GY2C555A.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KXM3HTAF.js → chunk-GYKQ3IOV.js} +27 -14
- package/dist/safe-bash/command-chunks/{chunk-VMZIAFVJ.js → chunk-HBR5PWX4.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-YPG55QTP.js → chunk-HCJWEB6P.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZOEKSH3R.js → chunk-HCPEYQKT.js} +5 -4
- package/dist/safe-bash/command-chunks/{chunk-U42WHQRH.js → chunk-HCZITM4C.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-4SISSPIH.js → chunk-HLRLMFMS.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-HNEWGADJ.js +43 -0
- package/dist/safe-bash/command-chunks/{chunk-DZOKH5BL.js → chunk-HQFX5XKV.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-QNX5LZBK.js → chunk-HSB55ED5.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-G3FK5VVG.js → chunk-HTBUIRTH.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QCIAX6HZ.js → chunk-HUAQZFON.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6M3JTPKE.js → chunk-HVLF3Y4B.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-AYQPJQJR.js → chunk-I6CQDCIP.js} +8 -8
- package/dist/safe-bash/command-chunks/chunk-I7MEH76L.js +276 -0
- package/dist/safe-bash/command-chunks/{chunk-E3BL7W5C.js → chunk-IAHYG67O.js} +152 -80
- package/dist/safe-bash/command-chunks/{chunk-TXWDR2P4.js → chunk-IBT3OWXB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EAGIJ4VW.js → chunk-IC5XC4TO.js} +118 -118
- package/dist/safe-bash/command-chunks/{chunk-ERWIJYCS.js → chunk-IGZOQT2L.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-CKIXC7AO.js → chunk-IPKYPADE.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FJLSYX5P.js → chunk-ITJDLFPW.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MUTARE5I.js → chunk-IYEAS7TU.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WDVPHDBH.js → chunk-J3ISXTYB.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-J3VS55K4.js +69097 -0
- package/dist/safe-bash/command-chunks/chunk-J4I7KCQQ.js +495 -0
- package/dist/safe-bash/command-chunks/{chunk-IWVANZWH.js → chunk-JLPBGKVC.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HQEYSSZV.js → chunk-JLS6XKAR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IJE65P52.js → chunk-JMUB5A26.js} +27 -8
- package/dist/safe-bash/command-chunks/{chunk-HOJ7WDTS.js → chunk-JQPDVCBU.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LQX7RAF7.js → chunk-JSW6YH6T.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DM5WURQL.js → chunk-JY2T3KV2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-IZ3SD5S2.js → chunk-K2NV6H7E.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-YJ5IA5YQ.js → chunk-K576GZED.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-VZTVR3JI.js → chunk-K6J3KFQ2.js} +17 -122
- package/dist/safe-bash/command-chunks/{chunk-RTHYAGKI.js → chunk-KD4JUF6R.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-FUYZUETI.js → chunk-KQE2D7PX.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-Q65GWGQR.js → chunk-KVTZJBLM.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ONQP4FNV.js → chunk-KZICRCQ7.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-L365UGC7.js +250 -0
- package/dist/safe-bash/command-chunks/{chunk-UKAGRRLZ.js → chunk-LBBJ5S3W.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WHZ6XK7Y.js → chunk-LBILRPVR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ENMJHB2C.js → chunk-LDR3PPM3.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-LJLB7TBN.js +775 -0
- package/dist/safe-bash/command-chunks/{chunk-A6OTPNNI.js → chunk-LPKMNCC5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JA36YOZI.js → chunk-LUJUYUOG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-FB2WPI3M.js → chunk-LZHFVNEV.js} +17 -107
- package/dist/safe-bash/command-chunks/{chunk-4X2MPZXW.js → chunk-M42GCI5F.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-URQSUMMJ.js → chunk-M7MQTU77.js} +6 -6
- package/dist/safe-bash/command-chunks/chunk-MCUDSE4H.js +77 -0
- package/dist/safe-bash/command-chunks/{chunk-V6JPIZUW.js → chunk-MD5ZSARP.js} +9 -9
- package/dist/safe-bash/command-chunks/chunk-MEST2HID.js +112 -0
- package/dist/safe-bash/command-chunks/{chunk-26JE5JEB.js → chunk-MLMFFBOU.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-HOKPYTHQ.js → chunk-MPRUGL4W.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-E22EAYJN.js → chunk-MQCLG2CT.js} +177 -34
- package/dist/safe-bash/command-chunks/{chunk-G3LUT475.js → chunk-N5Y7WWO6.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-MZYQKH26.js → chunk-NA6YAGAH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-PPN53PX3.js → chunk-NDJPULBE.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2IMIKROX.js → chunk-NN6OWOJG.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SWIF6BBY.js → chunk-NNYOPI7K.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-GAROGIVU.js → chunk-NP2QXF2X.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SNA2LVBX.js → chunk-NPVOYY2A.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T2FRXSQT.js → chunk-NR7POLKP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-A4P37F3P.js → chunk-NWA7ZJDV.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-45DKGZYO.js → chunk-O3FTKLWR.js} +423 -213
- package/dist/safe-bash/command-chunks/{chunk-6KJDTKE4.js → chunk-O4H7HPMP.js} +35 -393
- package/dist/safe-bash/command-chunks/{chunk-J6FNSVHT.js → chunk-OLNV5MI6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-BBEAO5N7.js → chunk-OLXMWQJ5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-MDFNUNK5.js → chunk-OMD45J52.js} +25 -21
- package/dist/safe-bash/command-chunks/{chunk-AXI7VMLG.js → chunk-OOYVZAWL.js} +3 -41
- package/dist/safe-bash/command-chunks/{chunk-2TWXRJPB.js → chunk-OPKLIF5P.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-E3DF7RTE.js → chunk-OT75C5YS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ROQ3VNVX.js → chunk-OVCSXD7N.js} +10 -10
- package/dist/safe-bash/command-chunks/chunk-P3LHQOX7.js +371 -0
- package/dist/safe-bash/command-chunks/{chunk-OFDJJRAD.js → chunk-P3TV5GIG.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-LQDANF2B.js → chunk-P5UFNPRE.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-5V7WIQ2D.js → chunk-PAEAEFK3.js} +122 -12
- package/dist/safe-bash/command-chunks/{chunk-OWCBX5M2.js → chunk-PAY4ULWY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TXU7MMHN.js → chunk-PH722HK2.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-OU4VE5CR.js → chunk-PKH57OIC.js} +8 -6
- package/dist/safe-bash/command-chunks/{chunk-GTOMW4VV.js → chunk-PNOXBL2B.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-L4XSOULP.js → chunk-PPNPXNM6.js} +38 -2
- package/dist/safe-bash/command-chunks/{chunk-DXOXUKQB.js → chunk-PVKSBXHB.js} +11 -9
- package/dist/safe-bash/command-chunks/{chunk-EZDWPTYB.js → chunk-PYYAX5FB.js} +23 -23
- package/dist/safe-bash/command-chunks/{chunk-MOUCMZZP.js → chunk-PZVFNPRC.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UPWLHHZ2.js → chunk-QCCRQU44.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-IVKAFEPO.js → chunk-QEVSG6HQ.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-6YF2QADH.js → chunk-QGSY4ZAU.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-LZY46GYY.js → chunk-QMWBKR4C.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-4YFTJS5U.js → chunk-QMXOKYMJ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CHZE6FNT.js → chunk-QPHI7Y7Z.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-N3ZH4YYH.js → chunk-QQ7ORF2D.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-4ABR3KGK.js → chunk-QWQHLMDX.js} +7 -7
- package/dist/safe-bash/command-chunks/chunk-QX3WKBLI.js +58 -0
- package/dist/safe-bash/command-chunks/{chunk-V6OWCRHN.js → chunk-QZPSGPN5.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-R36PDP3L.js +106 -0
- package/dist/safe-bash/command-chunks/{chunk-N35IJXBK.js → chunk-R43WEA4C.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-5YL453ZF.js → chunk-R6VXFTYL.js} +47 -47
- package/dist/safe-bash/command-chunks/{chunk-OVUY46QF.js → chunk-RC4TNFNF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-PU5DMQGG.js → chunk-RESJSUHH.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OCOJMKDP.js → chunk-RHXV2KG5.js} +522 -8
- package/dist/safe-bash/command-chunks/{chunk-7B2MHKIW.js → chunk-RKON2TGI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OIHQXURE.js → chunk-ROE6KD4C.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ITXSHOLP.js → chunk-RQTFK7AV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-BKK4MS3V.js → chunk-RR6XG2I6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CFMJXJS5.js → chunk-RTUDDAAY.js} +9 -4
- package/dist/safe-bash/command-chunks/{chunk-FAU2KL6I.js → chunk-S5MBHFLB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-R7LF4XQV.js → chunk-S6223MIG.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6W4RMBFH.js → chunk-SKDJCMGI.js} +12 -10
- package/dist/safe-bash/command-chunks/{chunk-NCNHJRIY.js → chunk-SKF6PGA5.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-3PM46VWH.js → chunk-SLD5A7IL.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-KYIGYYEY.js → chunk-SMCRKN3O.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-H56BSMFQ.js → chunk-T2LZWXWF.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-KDDXLHN7.js → chunk-TMJG745A.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QMBMZSJF.js → chunk-TP5MZHCB.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-ET6LMDEX.js → chunk-TPSRY72Q.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ZAYTFXUX.js → chunk-TTPT3OME.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-GR4ONCQ5.js → chunk-U6VSRO6E.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-5VF2EA7Z.js → chunk-U7J3R7HX.js} +6 -1
- package/dist/safe-bash/command-chunks/{chunk-A5SPMSKD.js → chunk-UDRJKA3P.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-3B444A5G.js → chunk-UI5AS3FS.js} +10 -2
- package/dist/safe-bash/command-chunks/{chunk-RVWIEXR7.js → chunk-UMOQHHSV.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-WH624PKJ.js → chunk-UNI6QG45.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-BOVDUJ3A.js → chunk-UTSN7AKE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-F5QYUK2E.js → chunk-UWIDPTOB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-345YBIHP.js → chunk-V2J6AC6S.js} +19 -19
- package/dist/safe-bash/command-chunks/{chunk-ZZ27QNBY.js → chunk-V2PJO6JL.js} +29 -60
- package/dist/safe-bash/command-chunks/{chunk-QNETPOMH.js → chunk-VAMBWXDV.js} +72 -21
- package/dist/safe-bash/command-chunks/{chunk-KM2SMMXZ.js → chunk-VJQ5OWS5.js} +80 -2
- package/dist/safe-bash/command-chunks/{chunk-OCV5ZU35.js → chunk-VSTAHYCV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MI2WY75O.js → chunk-VWBNUCUP.js} +28 -11
- package/dist/safe-bash/command-chunks/{chunk-SL4LD25A.js → chunk-W4BC2YGQ.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-Y3ZRIZL7.js → chunk-W5LH7D23.js} +26 -13
- package/dist/safe-bash/command-chunks/{chunk-62RG3GHF.js → chunk-W6L4Z2VX.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-RRAQII52.js → chunk-WEXEZRMH.js} +7 -7
- package/dist/safe-bash/command-chunks/chunk-WIUEM7HP.js +58 -0
- package/dist/safe-bash/command-chunks/{chunk-AQ3XOOPQ.js → chunk-WKS2PAZL.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-WOECEZAC.js +921 -0
- package/dist/safe-bash/command-chunks/{chunk-A2L3U7DW.js → chunk-WOO3YO2X.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-7YDJ7LDO.js → chunk-WOT2YXBT.js} +8 -223
- package/dist/safe-bash/command-chunks/{chunk-LT2YCGC5.js → chunk-WV3C6BRD.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-PRO7JOIH.js → chunk-X3EDCCXU.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-WMBELKPP.js → chunk-XE75H5ZZ.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-SHLT5R64.js → chunk-XMNPE6RN.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-ISFGPCED.js → chunk-XNVL6AOV.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-OBIXFO25.js → chunk-XPUYA7YU.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-5KZMR6AJ.js → chunk-XXUMECE4.js} +22 -20
- package/dist/safe-bash/command-chunks/{chunk-OAM2SUUI.js → chunk-YB5TNDY6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KLAC2MIZ.js → chunk-YJMS5Q4Y.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-FLSXHLJG.js → chunk-YJTP4ROI.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-7ITPO2V6.js → chunk-YNFQ5AXM.js} +80 -45
- package/dist/safe-bash/command-chunks/{chunk-7PYDVQPB.js → chunk-YWP62BAZ.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-YXIJOYT6.js +416 -0
- package/dist/safe-bash/command-chunks/{chunk-NQL3WNFI.js → chunk-YYRVGXJH.js} +44 -5
- package/dist/safe-bash/command-chunks/{chunk-35DU6I2M.js → chunk-Z7UPCDTU.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-O2XP6HQN.js → chunk-ZBGP6XEG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VWRHPDCD.js → chunk-ZIDESNHW.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-VVV45NLY.js → chunk-ZJUU5IAS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3ZWFE4CK.js → chunk-ZLMCWAAU.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-7OCTMVYJ.js → chunk-ZNABMTV3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QOKFSYD5.js → chunk-ZODGWV3Y.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-DIRK47GT.js → chunk-ZPBL7TYJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5MNQTHED.js → chunk-ZQ4NQ24M.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-4IDV763L.js → chunk-ZS4J5B6Y.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-ZTW2E5OT.js +1016 -0
- package/dist/safe-bash/command-chunks/{chunk-NKK76B4V.js → chunk-ZUOID3FA.js} +14 -14
- package/dist/safe-bash/command-chunks/chunk-ZWGERYLT.js +192 -0
- package/dist/safe-bash/command-chunks/{chunk-F2NF6FHV.js → chunk-ZXIOTUXC.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-LFSWLJPR.js → chunk-ZZ6EIACJ.js} +250 -41
- package/dist/safe-bash/command-chunks/{chunk-XMRQ6UP2.js → chunk-ZZO3GYEZ.js} +1 -11
- package/dist/safe-bash/command-chunks/{command-engine-2QXVRRH3.js → command-engine-B6X6WAMX.js} +381 -114
- package/dist/safe-bash/command-chunks/{engine-T4GP6QOK-ECFKMR5V.js → engine-UPLVIV72-IGXUDNO5.js} +1 -1
- package/dist/safe-bash/command-chunks/model-store-RGLCVIML.js +54 -0
- package/dist/safe-bash/command-chunks/paradox-BHPRIGXX-RQN37FHB.js +370 -0
- package/dist/safe-bash/command-chunks/prompt-tool-debug-ERJKK3XZ.js +171 -0
- package/dist/safe-bash/commands/alias/index.js +1 -1
- package/dist/safe-bash/commands/apply-patch/index.js +1 -1
- package/dist/safe-bash/commands/archive/create.js +1 -1
- package/dist/safe-bash/commands/archive/extract.js +1 -1
- package/dist/safe-bash/commands/archive/format.js +1 -1
- package/dist/safe-bash/commands/archive/index.js +1 -1
- package/dist/safe-bash/commands/archive/internal.js +1 -1
- package/dist/safe-bash/commands/archive/listing.js +1 -1
- package/dist/safe-bash/commands/archive/modes.js +1 -1
- package/dist/safe-bash/commands/archive/options.js +1 -1
- package/dist/safe-bash/commands/archive/stream.js +1 -1
- package/dist/safe-bash/commands/archive/transform.js +1 -1
- package/dist/safe-bash/commands/archive/unzip/safety.js +1 -1
- package/dist/safe-bash/commands/archive/unzip.js +1 -1
- package/dist/safe-bash/commands/archive/zip/aes.js +1 -1
- package/dist/safe-bash/commands/archive/zip/comments.js +1 -1
- package/dist/safe-bash/commands/archive/zip/crc.js +1 -1
- package/dist/safe-bash/commands/archive/zip/crypto.js +1 -1
- package/dist/safe-bash/commands/archive/zip/dates.js +1 -1
- package/dist/safe-bash/commands/archive/zip/environment.js +1 -1
- package/dist/safe-bash/commands/archive/zip/grow.js +1 -1
- package/dist/safe-bash/commands/archive/zip/help.js +1 -1
- package/dist/safe-bash/commands/archive/zip/line-endings.js +1 -1
- package/dist/safe-bash/commands/archive/zip/log.js +1 -1
- package/dist/safe-bash/commands/archive/zip/lzma.js +1 -1
- package/dist/safe-bash/commands/archive/zip/move.js +1 -1
- package/dist/safe-bash/commands/archive/zip/names.js +1 -1
- package/dist/safe-bash/commands/archive/zip/options.js +1 -1
- package/dist/safe-bash/commands/archive/zip/repair.js +1 -1
- package/dist/safe-bash/commands/archive/zip/safety.js +1 -1
- package/dist/safe-bash/commands/archive/zip/sfx.js +1 -1
- package/dist/safe-bash/commands/archive/zip/test-command.js +1 -1
- package/dist/safe-bash/commands/archive/zip/volumes.js +1 -1
- package/dist/safe-bash/commands/archive/zip/zip64.js +1 -1
- package/dist/safe-bash/commands/archive/zip-format.js +1 -1
- package/dist/safe-bash/commands/archive/zip.js +1 -1
- package/dist/safe-bash/commands/ast-grep/index.js +1 -1
- package/dist/safe-bash/commands/audio/index.browser.js +2 -8
- package/dist/safe-bash/commands/audio/index.js +1 -1
- package/dist/safe-bash/commands/awk/index.js +1 -1
- package/dist/safe-bash/commands/base32/index.js +1 -1
- package/dist/safe-bash/commands/base64/index.js +1 -1
- package/dist/safe-bash/commands/bc/index.browser.js +1 -1
- package/dist/safe-bash/commands/bc/index.js +1 -1
- package/dist/safe-bash/commands/bytes/checksums/sm3.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/bounded-codec.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/codec-loader.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/codec.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/errors.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/file-operation.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/files.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/gunzip.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/stream.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/xz-list.js +1 -1
- package/dist/safe-bash/commands/bytes/compression/zstd-decode.js +1 -1
- package/dist/safe-bash/commands/bytes/encoding/base.js +1 -1
- package/dist/safe-bash/commands/bytes/encoding/shared.js +1 -1
- package/dist/safe-bash/commands/bytes/input-budget.js +1 -1
- package/dist/safe-bash/commands/bzip2/index.js +1 -1
- package/dist/safe-bash/commands/cal/index.js +1 -1
- package/dist/safe-bash/commands/caller/index.js +1 -1
- package/dist/safe-bash/commands/canonicalize-existing-parent.js +1 -1
- package/dist/safe-bash/commands/chmod/index.js +1 -1
- package/dist/safe-bash/commands/column/index.js +1 -1
- package/dist/safe-bash/commands/comm/index.js +1 -1
- package/dist/safe-bash/commands/copy-backup.js +1 -1
- package/dist/safe-bash/commands/copy-preserve.js +1 -1
- package/dist/safe-bash/commands/copy-source.js +1 -1
- package/dist/safe-bash/commands/cp/index.js +1 -1
- package/dist/safe-bash/commands/csplit/index.js +1 -1
- package/dist/safe-bash/commands/csvcut/index.js +1 -1
- package/dist/safe-bash/commands/csvgrep/index.js +1 -1
- package/dist/safe-bash/commands/csvkit/index.js +1 -1
- package/dist/safe-bash/commands/curl/index.js +1 -1
- package/dist/safe-bash/commands/date/index.js +1 -1
- package/dist/safe-bash/commands/df/index.js +1 -1
- package/dist/safe-bash/commands/diff/index.js +1 -1
- package/dist/safe-bash/commands/diff-patch/diff-format.js +1 -1
- package/dist/safe-bash/commands/diff-patch/diff-options.js +1 -1
- package/dist/safe-bash/commands/diff-patch/diff-output.js +1 -1
- package/dist/safe-bash/commands/diff-patch/diff.js +1 -1
- package/dist/safe-bash/commands/diff-patch/index.js +2 -2
- package/dist/safe-bash/commands/diff-patch/patch-envelope.js +1 -1
- package/dist/safe-bash/commands/diff-patch/patch-formats.js +1 -1
- package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.js +1 -1
- package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.js +1 -1
- package/dist/safe-bash/commands/diff-patch/patch-path.js +1 -1
- package/dist/safe-bash/commands/diff-patch/patch-publication.js +1 -1
- package/dist/safe-bash/commands/diff-patch/patch.js +1 -1
- package/dist/safe-bash/commands/diff-patch/shared.js +1 -1
- package/dist/safe-bash/commands/diff-patch/unified.js +1 -1
- package/dist/safe-bash/commands/diff3/index.js +1 -1
- package/dist/safe-bash/commands/diffpdf/index.js +1 -1
- package/dist/safe-bash/commands/directory-admission.js +1 -1
- package/dist/safe-bash/commands/docx/index.js +1 -1
- package/dist/safe-bash/commands/docx/io.js +1 -1
- package/dist/safe-bash/commands/dos2unix/index.js +1 -1
- package/dist/safe-bash/commands/dot/index.js +1 -1
- package/dist/safe-bash/commands/du/index.js +1 -1
- package/dist/safe-bash/commands/egrep/index.js +1 -1
- package/dist/safe-bash/commands/env/index.js +1 -1
- package/dist/safe-bash/commands/env-split.js +1 -1
- package/dist/safe-bash/commands/exiftool/index.js +1 -1
- package/dist/safe-bash/commands/expand/index.js +1 -1
- package/dist/safe-bash/commands/expr/index.js +1 -1
- package/dist/safe-bash/commands/factor/index.js +1 -1
- package/dist/safe-bash/commands/fd/index.js +1 -1
- package/dist/safe-bash/commands/ffmpeg/index.js +1 -1
- package/dist/safe-bash/commands/ffprobe/index.js +1 -1
- package/dist/safe-bash/commands/fgrep/index.js +1 -1
- package/dist/safe-bash/commands/file/index.js +1 -1
- package/dist/safe-bash/commands/filesystem-requirements.js +1 -1
- package/dist/safe-bash/commands/find/index.js +1 -1
- package/dist/safe-bash/commands/find-format.js +1 -1
- package/dist/safe-bash/commands/find.js +1 -1
- package/dist/safe-bash/commands/fmt/index.js +1 -1
- package/dist/safe-bash/commands/fold/index.js +1 -1
- package/dist/safe-bash/commands/getconf/index.js +1 -1
- package/dist/safe-bash/commands/getopt/index.js +1 -1
- package/dist/safe-bash/commands/gnu-information.js +1 -1
- package/dist/safe-bash/commands/gpg/index.js +1 -1
- package/dist/safe-bash/commands/graphviz/index.js +3 -3
- package/dist/safe-bash/commands/grep/index.js +1 -1
- package/dist/safe-bash/commands/grep-aliases/aliases.js +1 -1
- package/dist/safe-bash/commands/grep.js +1 -1
- package/dist/safe-bash/commands/gzip/index.js +1 -1
- package/dist/safe-bash/commands/hexdump/index.js +1 -1
- package/dist/safe-bash/commands/hostname/index.js +1 -1
- package/dist/safe-bash/commands/html-to-markdown/index.js +1 -1
- package/dist/safe-bash/commands/htmlq/index.js +1 -1
- package/dist/safe-bash/commands/iconv/index.js +1 -1
- package/dist/safe-bash/commands/id/index.js +1 -1
- package/dist/safe-bash/commands/imagemagick/index.js +1 -1
- package/dist/safe-bash/commands/internal.js +1 -1
- package/dist/safe-bash/commands/join/index.js +1 -1
- package/dist/safe-bash/commands/jq/index.js +1 -1
- package/dist/safe-bash/commands/less/index.js +1 -1
- package/dist/safe-bash/commands/line-endings/index.js +1 -1
- package/dist/safe-bash/commands/llm/collections.js +1 -1
- package/dist/safe-bash/commands/llm/command.js +1 -1
- package/dist/safe-bash/commands/llm/elevenlabs-stream.js +1 -1
- package/dist/safe-bash/commands/llm/elevenlabs.js +1 -1
- package/dist/safe-bash/commands/llm/index.browser.js +21 -1
- package/dist/safe-bash/commands/llm/index.js +1 -1
- package/dist/safe-bash/commands/llm/mime.js +1 -1
- package/dist/safe-bash/commands/llm/openai-http.js +1 -1
- package/dist/safe-bash/commands/llm/openai-sse.js +1 -1
- package/dist/safe-bash/commands/llm/openai.js +1 -1
- package/dist/safe-bash/commands/llm/providers/elevenlabs.js +1 -1
- package/dist/safe-bash/commands/llm/providers/index.js +1 -1
- package/dist/safe-bash/commands/llm/providers/openai.js +1 -1
- package/dist/safe-bash/commands/llm/providers/shared.js +1 -1
- package/dist/safe-bash/commands/llm/service.js +1 -1
- package/dist/safe-bash/commands/locale/index.js +1 -1
- package/dist/safe-bash/commands/md5sum/index.js +1 -1
- package/dist/safe-bash/commands/mdq/index.js +1 -1
- package/dist/safe-bash/commands/media/index.js +1 -1
- package/dist/safe-bash/commands/media/plugin.js +1 -1
- package/dist/safe-bash/commands/media/remote.js +1 -1
- package/dist/safe-bash/commands/media/settings.js +1 -1
- package/dist/safe-bash/commands/metadata/chmod.js +1 -1
- package/dist/safe-bash/commands/metadata/internal.js +1 -1
- package/dist/safe-bash/commands/metadata/mktemp.js +1 -1
- package/dist/safe-bash/commands/metadata/stat.js +1 -1
- package/dist/safe-bash/commands/mktemp/index.js +1 -1
- package/dist/safe-bash/commands/mmdc/index.js +1 -1
- package/dist/safe-bash/commands/more/index.js +1 -1
- package/dist/safe-bash/commands/neato/index.js +1 -1
- package/dist/safe-bash/commands/network/aggregate.js +1 -1
- package/dist/safe-bash/commands/network/args.js +1 -1
- package/dist/safe-bash/commands/network/authorizer.js +1 -1
- package/dist/safe-bash/commands/network/body.js +1 -1
- package/dist/safe-bash/commands/network/curl.js +1 -1
- package/dist/safe-bash/commands/network/deadline.js +1 -1
- package/dist/safe-bash/commands/network/decode.js +1 -1
- package/dist/safe-bash/commands/network/fetch-transport.js +1 -1
- package/dist/safe-bash/commands/network/form-content-type.js +1 -1
- package/dist/safe-bash/commands/network/form-headers.js +1 -1
- package/dist/safe-bash/commands/network/glob.js +1 -1
- package/dist/safe-bash/commands/network/input.js +1 -1
- package/dist/safe-bash/commands/network/output.js +1 -1
- package/dist/safe-bash/commands/network/platform-portable.js +1 -1
- package/dist/safe-bash/commands/network/platform.js +1 -1
- package/dist/safe-bash/commands/network/private-address.js +1 -1
- package/dist/safe-bash/commands/network/shared.js +1 -1
- package/dist/safe-bash/commands/network/types.js +1 -1
- package/dist/safe-bash/commands/network/url.js +1 -1
- package/dist/safe-bash/commands/network/wget.js +1 -1
- package/dist/safe-bash/commands/nl/index.js +1 -1
- package/dist/safe-bash/commands/node/browser.js +1 -1
- package/dist/safe-bash/commands/node/buffer.js +1 -1
- package/dist/safe-bash/commands/node/default-runtime.js +1 -1
- package/dist/safe-bash/commands/node/filesystem.js +1 -1
- package/dist/safe-bash/commands/node/path.js +1 -1
- package/dist/safe-bash/commands/node/safejs.js +1 -1
- package/dist/safe-bash/commands/node/source-maps.js +1 -1
- package/dist/safe-bash/commands/node/timers.js +1 -1
- package/dist/safe-bash/commands/node/types.js +1 -1
- package/dist/safe-bash/commands/node/worker-types.js +1 -1
- package/dist/safe-bash/commands/nproc/index.js +1 -1
- package/dist/safe-bash/commands/numfmt/index.js +1 -1
- package/dist/safe-bash/commands/od/index.js +1 -1
- package/dist/safe-bash/commands/op/index.js +23 -1
- package/dist/safe-bash/commands/openssl/index.js +1 -1
- package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
- package/dist/safe-bash/commands/pandoc/index.js +1 -1
- package/dist/safe-bash/commands/paste/index.js +1 -1
- package/dist/safe-bash/commands/patch/index.js +1 -1
- package/dist/safe-bash/commands/pathchk/index.js +1 -1
- package/dist/safe-bash/commands/pdfimages/index.js +1 -1
- package/dist/safe-bash/commands/pdfinfo/index.js +1 -1
- package/dist/safe-bash/commands/pdfseparate/index.js +1 -1
- package/dist/safe-bash/commands/pdftk/index.js +1 -1
- package/dist/safe-bash/commands/pdftoppm/index.js +1 -1
- package/dist/safe-bash/commands/pdftotext/index.js +1 -1
- package/dist/safe-bash/commands/pdfunite/index.js +1 -1
- package/dist/safe-bash/commands/playwright/index.js +1 -1
- package/dist/safe-bash/commands/portable-random.js +1 -1
- package/dist/safe-bash/commands/portable-requirements.js +1 -1
- package/dist/safe-bash/commands/pptx/index.js +1 -1
- package/dist/safe-bash/commands/pr/index.js +1 -1
- package/dist/safe-bash/commands/printenv/index.js +1 -1
- package/dist/safe-bash/commands/python/executor-pool.js +1 -1
- package/dist/safe-bash/commands/python/executor.browser.js +2 -1
- package/dist/safe-bash/commands/python/executor.js +1 -1
- package/dist/safe-bash/commands/python/host-capabilities.js +1 -1
- package/dist/safe-bash/commands/python/index.browser.js +3 -1
- package/dist/safe-bash/commands/python/index.js +1 -1
- package/dist/safe-bash/commands/python/jspi-assets.js +1 -1
- package/dist/safe-bash/commands/python/jspi-trampoline.js +1 -1
- package/dist/safe-bash/commands/python/jspi.js +1 -1
- package/dist/safe-bash/commands/python/llm-capability.js +1 -1
- package/dist/safe-bash/commands/python/llm-dependencies.js +1 -1
- package/dist/safe-bash/commands/python/llm-module.js +1 -1
- package/dist/safe-bash/commands/python/llm-provider.js +1 -1
- package/dist/safe-bash/commands/python/llm-reference-module.js +1 -1
- package/dist/safe-bash/commands/python/provisioning.js +1 -1
- package/dist/safe-bash/commands/python/shell-capability.js +1 -1
- package/dist/safe-bash/commands/python/shell-module.js +1 -1
- package/dist/safe-bash/commands/python/worker.js +1 -1
- package/dist/safe-bash/commands/qpdf/index.js +1 -1
- package/dist/safe-bash/commands/qrencode/index.js +1 -1
- package/dist/safe-bash/commands/readlink/index.js +1 -1
- package/dist/safe-bash/commands/readlink-missing.js +1 -1
- package/dist/safe-bash/commands/realpath/index.js +1 -1
- package/dist/safe-bash/commands/record-buffer.js +1 -1
- package/dist/safe-bash/commands/regex-execution/ascii.js +1 -1
- package/dist/safe-bash/commands/regex-execution/bounded-glob.js +1 -1
- package/dist/safe-bash/commands/regex-execution/bounded-provider.js +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/errors.js +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/limits.js +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/matcher.js +1 -1
- package/dist/safe-bash/commands/regex-execution/ere/syntax.js +1 -1
- package/dist/safe-bash/commands/regex-execution/portable.js +1 -1
- package/dist/safe-bash/commands/regex-execution/protocol.js +1 -1
- package/dist/safe-bash/commands/regex-execution/utf8.js +1 -1
- package/dist/safe-bash/commands/rev/index.js +1 -1
- package/dist/safe-bash/commands/rg/index.js +1 -1
- package/dist/safe-bash/commands/rgrep/index.js +1 -1
- package/dist/safe-bash/commands/rsvg-convert/index.js +1 -1
- package/dist/safe-bash/commands/safejs/io.js +1 -1
- package/dist/safe-bash/commands/safejs/options.js +1 -1
- package/dist/safe-bash/commands/safejs/render.js +1 -1
- package/dist/safe-bash/commands/safejs/runtime.js +1 -1
- package/dist/safe-bash/commands/safejs/types.js +1 -1
- package/dist/safe-bash/commands/search/ergonomic-regex.js +1 -1
- package/dist/safe-bash/commands/search/file-types.js +1 -1
- package/dist/safe-bash/commands/search/glob.js +1 -1
- package/dist/safe-bash/commands/search/grep-files.js +1 -1
- package/dist/safe-bash/commands/search/grep.js +1 -1
- package/dist/safe-bash/commands/search/matcher.js +1 -1
- package/dist/safe-bash/commands/search/options.js +1 -1
- package/dist/safe-bash/commands/search/output.js +1 -1
- package/dist/safe-bash/commands/search/requirements.js +1 -1
- package/dist/safe-bash/commands/search/rg-command.js +1 -1
- package/dist/safe-bash/commands/search/shared.js +1 -1
- package/dist/safe-bash/commands/search/walk.js +1 -1
- package/dist/safe-bash/commands/sed/index.js +1 -1
- package/dist/safe-bash/commands/seq/index.js +1 -1
- package/dist/safe-bash/commands/sha1sum/index.js +1 -1
- package/dist/safe-bash/commands/sha256sum/index.js +1 -1
- package/dist/safe-bash/commands/sha512sum/index.js +1 -1
- package/dist/safe-bash/commands/sips/index.js +1 -1
- package/dist/safe-bash/commands/sleep/index.js +1 -1
- package/dist/safe-bash/commands/soffice/index.js +1 -1
- package/dist/safe-bash/commands/sort/index.js +1 -1
- package/dist/safe-bash/commands/sort-admission.js +1 -1
- package/dist/safe-bash/commands/sox/index.js +1 -1
- package/dist/safe-bash/commands/soxi/index.js +1 -1
- package/dist/safe-bash/commands/split/index.js +1 -1
- package/dist/safe-bash/commands/sponge/index.js +1 -1
- package/dist/safe-bash/commands/sqlite3/index.js +1 -1
- package/dist/safe-bash/commands/ssh/index.js +1 -1
- package/dist/safe-bash/commands/stat/index.js +1 -1
- package/dist/safe-bash/commands/stream-format/shared.js +1 -1
- package/dist/safe-bash/commands/stream-inspection/numeric-options.js +1 -1
- package/dist/safe-bash/commands/stream-inspection/shared.js +1 -1
- package/dist/safe-bash/commands/stream-inspection/strings-object.js +1 -1
- package/dist/safe-bash/commands/strings/index.js +1 -1
- package/dist/safe-bash/commands/structured/bytes.js +1 -1
- package/dist/safe-bash/commands/structured/capture.js +1 -1
- package/dist/safe-bash/commands/structured/dates.js +1 -1
- package/dist/safe-bash/commands/structured/delpaths.js +1 -1
- package/dist/safe-bash/commands/structured/formats.js +1 -1
- package/dist/safe-bash/commands/structured/indices.js +1 -1
- package/dist/safe-bash/commands/structured/input.js +1 -1
- package/dist/safe-bash/commands/structured/interpreter.js +1 -1
- package/dist/safe-bash/commands/structured/jq.js +1 -1
- package/dist/safe-bash/commands/structured/limits.js +1 -1
- package/dist/safe-bash/commands/structured/numbers.js +1 -1
- package/dist/safe-bash/commands/structured/parser.js +1 -1
- package/dist/safe-bash/commands/structured/query-core.js +1 -1
- package/dist/safe-bash/commands/structured/recurse.js +1 -1
- package/dist/safe-bash/commands/structured/regex.js +1 -1
- package/dist/safe-bash/commands/structured/split.js +1 -1
- package/dist/safe-bash/commands/structured/splits.js +1 -1
- package/dist/safe-bash/commands/structured/values.js +1 -1
- package/dist/safe-bash/commands/svgo/index.js +1 -1
- package/dist/safe-bash/commands/table-text/internal.js +1 -1
- package/dist/safe-bash/commands/tac/index.js +1 -1
- package/dist/safe-bash/commands/tar/index.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-inspection.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-pipes.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-pretty.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-quote.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-reader.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-retention.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-runtime.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-syntax.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk-values.js +1 -1
- package/dist/safe-bash/commands/text-programs/awk.js +1 -1
- package/dist/safe-bash/commands/text-programs/inplace.js +1 -1
- package/dist/safe-bash/commands/text-programs/regex.js +1 -1
- package/dist/safe-bash/commands/text-programs/replacement-buffer.js +1 -1
- package/dist/safe-bash/commands/text-programs/sed.js +1 -1
- package/dist/safe-bash/commands/text-programs/shared.js +1 -1
- package/dist/safe-bash/commands/time-env/calendar.js +1 -1
- package/dist/safe-bash/commands/time-env/format.js +1 -1
- package/dist/safe-bash/commands/time-env/shared.js +1 -1
- package/dist/safe-bash/commands/timeout/index.js +1 -1
- package/dist/safe-bash/commands/touch/index.js +1 -1
- package/dist/safe-bash/commands/touch-target.js +1 -1
- package/dist/safe-bash/commands/touch-times.js +1 -1
- package/dist/safe-bash/commands/tree/index.js +1 -1
- package/dist/safe-bash/commands/tsort/index.js +1 -1
- package/dist/safe-bash/commands/unalias/index.js +1 -1
- package/dist/safe-bash/commands/uname/index.js +1 -1
- package/dist/safe-bash/commands/unexpand/index.js +1 -1
- package/dist/safe-bash/commands/unix2dos/index.js +1 -1
- package/dist/safe-bash/commands/unrtf/index.js +1 -1
- package/dist/safe-bash/commands/unzip/index.js +1 -1
- package/dist/safe-bash/commands/wdiff/index.js +1 -1
- package/dist/safe-bash/commands/wget/index.js +1 -1
- package/dist/safe-bash/commands/which/index.js +1 -1
- package/dist/safe-bash/commands/whoami/index.js +1 -1
- package/dist/safe-bash/commands/wkhtmltopdf/index.js +1 -1
- package/dist/safe-bash/commands/xan/index.js +1 -1
- package/dist/safe-bash/commands/xml/index.js +1 -1
- package/dist/safe-bash/commands/xmllint/index.js +1 -1
- package/dist/safe-bash/commands/xq/index.js +1 -1
- package/dist/safe-bash/commands/xxd/index.js +1 -1
- package/dist/safe-bash/commands/xz/index.js +1 -1
- package/dist/safe-bash/commands/yq/index.js +1 -1
- package/dist/safe-bash/commands/zip/index.js +1 -1
- package/dist/safe-bash/commands/zstd/index.js +1 -1
- package/dist/safe-bash/core.browser.js +2 -2
- package/dist/safe-bash/full-core.browser.js +29 -7
- package/dist/safe-bash/integrations/safejs/filesystem.js +1 -1
- package/dist/safe-bash/integrations/safejs/shell.js +1 -1
- package/dist/safe-bash/integrations/safejs/values.js +1 -1
- package/dist/safe-bash/playwright/abilities.js +1 -1
- package/dist/safe-bash/playwright/ability-execution.js +1 -1
- package/dist/safe-bash/playwright/adapter.js +1 -1
- package/dist/safe-bash/playwright/builtins.js +1 -1
- package/dist/safe-bash/playwright/canonical-locator-parser.js +1 -1
- package/dist/safe-bash/playwright/capability-events.js +1 -1
- package/dist/safe-bash/playwright/capability-result.js +1 -1
- package/dist/safe-bash/playwright/catalog.js +1 -1
- package/dist/safe-bash/playwright/checkpoint.js +1 -1
- package/dist/safe-bash/playwright/command-budget.js +1 -1
- package/dist/safe-bash/playwright/command-reference.js +1 -1
- package/dist/safe-bash/playwright/config-ini.js +1 -1
- package/dist/safe-bash/playwright/config-json.js +1 -1
- package/dist/safe-bash/playwright/controller.js +1 -1
- package/dist/safe-bash/playwright/devices.js +1 -1
- package/dist/safe-bash/playwright/download-capabilities.js +1 -1
- package/dist/safe-bash/playwright/drop-capability.js +1 -1
- package/dist/safe-bash/playwright/find.js +1 -1
- package/dist/safe-bash/playwright/frame-snapshot.js +1 -1
- package/dist/safe-bash/playwright/generated-locator.js +1 -1
- package/dist/safe-bash/playwright/help-reference.js +1 -1
- package/dist/safe-bash/playwright/help.js +1 -1
- package/dist/safe-bash/playwright/highlight.js +1 -1
- package/dist/safe-bash/playwright/index.js +1 -1
- package/dist/safe-bash/playwright/invocation.js +1 -1
- package/dist/safe-bash/playwright/locator-selector.js +1 -1
- package/dist/safe-bash/playwright/modal-capabilities.js +1 -1
- package/dist/safe-bash/playwright/native-evaluation.js +1 -1
- package/dist/safe-bash/playwright/native-json-snapshot.js +1 -1
- package/dist/safe-bash/playwright/native-snapshot.js +1 -1
- package/dist/safe-bash/playwright/native-storage-realm.js +1 -1
- package/dist/safe-bash/playwright/native-storage-replacement.js +1 -1
- package/dist/safe-bash/playwright/native-storage-sources.generated.js +1 -1
- package/dist/safe-bash/playwright/native-storage-targets.js +1 -1
- package/dist/safe-bash/playwright/network-policy.js +1 -1
- package/dist/safe-bash/playwright/open-options.js +1 -1
- package/dist/safe-bash/playwright/private-target-transport.js +1 -1
- package/dist/safe-bash/playwright/profile.js +1 -1
- package/dist/safe-bash/playwright/recording-capabilities.js +1 -1
- package/dist/safe-bash/playwright/recovery.js +1 -1
- package/dist/safe-bash/playwright/resource-limit.js +1 -1
- package/dist/safe-bash/playwright/response.js +1 -1
- package/dist/safe-bash/playwright/route-capabilities.js +1 -1
- package/dist/safe-bash/playwright/route-policy.js +1 -1
- package/dist/safe-bash/playwright/screenshot.js +1 -1
- package/dist/safe-bash/playwright/session-configuration.js +1 -1
- package/dist/safe-bash/playwright/session-runtime.js +1 -1
- package/dist/safe-bash/playwright/session-selection.js +1 -1
- package/dist/safe-bash/playwright/snapshot-reference-error.js +1 -1
- package/dist/safe-bash/playwright/snapshot.js +1 -1
- package/dist/safe-bash/playwright/standard-capabilities.js +1 -1
- package/dist/safe-bash/playwright/storage-capabilities.js +1 -1
- package/dist/safe-bash/playwright/storage-state.js +1 -1
- package/dist/safe-bash/playwright/target-screenshot.js +1 -1
- package/dist/safe-bash/playwright/targets.js +1 -1
- package/dist/safe-bash/playwright/tracing-capabilities.js +1 -1
- package/dist/safe-bash/playwright/webmcp-capabilities.js +1 -1
- package/dist/safe-bash/playwright/webmcp-params.js +1 -1
- package/dist/safe-bash/playwright/workspace-assets.js +1 -1
- package/dist/safe-bash/playwright/workspace.js +1 -1
- package/dist/safe-bash/plugins/index.browser.js +4 -4
- package/dist/safe-bash/registry-entry.browser.js +2 -2
- package/dist/safe-bash/search.browser.js +1 -1
- package/dist/safe-bash/shell/parser.js +2 -1
- package/dist/safe-bash/shell/pattern.js +1 -1
- package/dist/safe-bash/shell/string-operations.js +1 -1
- package/dist/safe-bash/shell-entry.browser.js +2 -2
- package/dist/safe-bash/ts-ast.js +1 -1
- package/dist/safe-bash-checksum-engine/index.js +1 -1
- package/dist/safe-bash-command-audio/index.js +2 -2
- package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
- package/dist/safe-bash-command-awk/awk-runtime.js +2 -2
- package/dist/safe-bash-command-awk/awk-syntax.js +1 -1
- package/dist/safe-bash-command-awk/awk.js +6 -6
- package/dist/safe-bash-command-awk/index.js +6 -6
- package/dist/safe-bash-command-bc/index.js +13 -14
- package/dist/safe-bash-command-cal/index.js +25 -31
- package/dist/safe-bash-command-cp/index.js +3 -3
- package/dist/safe-bash-command-csvgrep/command.d.ts +1 -0
- package/dist/safe-bash-command-csvgrep/index.js +7 -0
- package/dist/safe-bash-command-diff/diff.js +2 -2
- package/dist/safe-bash-command-diff/index.js +2 -2
- package/dist/safe-bash-command-docx/sdk.js +1 -1
- package/dist/safe-bash-command-expr/bre-engine.js +1 -1
- package/dist/safe-bash-command-factor/command.js +2 -2
- package/dist/safe-bash-command-factor/index.js +2 -2
- package/dist/safe-bash-command-fd/index.js +4 -3
- package/dist/safe-bash-command-ffmpeg/index.js +13 -2
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-getconf/index.js +11 -4
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-git/index.js +96 -14
- package/dist/safe-bash-command-html-to-markdown/index.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/stored-text.d.ts +2 -0
- package/dist/safe-bash-command-html-to-markdown/stored-text.js +1 -1
- package/dist/safe-bash-command-imagemagick/index.js +18 -4
- 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-llm/collections.js +48 -192
- package/dist/safe-bash-command-llm/command.js +14 -6
- package/dist/safe-bash-command-llm/elevenlabs.js +2 -2
- package/dist/safe-bash-command-llm/fragment-loaders.d.ts +29 -0
- package/dist/safe-bash-command-llm/fragments.d.ts +24 -0
- package/dist/safe-bash-command-llm/import-json-document.d.ts +5 -2
- package/dist/safe-bash-command-llm/index.d.ts +7 -0
- package/dist/safe-bash-command-llm/index.js +47 -17
- package/dist/safe-bash-command-llm/input-budget.d.ts +2 -0
- package/dist/safe-bash-command-llm/openai-sse.d.ts +1 -1
- package/dist/safe-bash-command-llm/openai-sse.js +4 -1
- package/dist/safe-bash-command-llm/openai.js +11 -7
- package/dist/safe-bash-command-llm/providers/elevenlabs.js +2 -2
- package/dist/safe-bash-command-llm/providers/index.js +16 -10
- package/dist/safe-bash-command-llm/providers/openai.js +11 -7
- package/dist/safe-bash-command-llm/providers/shared.d.ts +2 -0
- package/dist/safe-bash-command-llm/providers/shared.js +1 -1
- package/dist/safe-bash-command-llm/retained-spool.d.ts +4 -0
- package/dist/safe-bash-command-llm/service.d.ts +3 -1
- package/dist/safe-bash-command-llm/service.js +5 -2
- package/dist/safe-bash-command-llm/tool-chain.d.ts +22 -0
- package/dist/safe-bash-command-llm/tool-execution.d.ts +55 -0
- package/dist/safe-bash-command-llm/tool-registry.d.ts +43 -0
- package/dist/safe-bash-command-llm/types.d.ts +39 -11
- package/dist/safe-bash-command-llm/url-fragment-source.d.ts +6 -0
- package/dist/safe-bash-command-llm/url-source.d.ts +3 -1
- package/dist/safe-bash-command-mcp/index.browser.d.ts +1 -0
- package/dist/safe-bash-command-mcp/index.browser.js +4 -4
- package/dist/safe-bash-command-mcp/index.d.ts +1 -0
- package/dist/safe-bash-command-mcp/index.js +28 -7
- package/dist/safe-bash-command-mdq/index.js +10 -3
- package/dist/safe-bash-command-node/commands/node/browser.js +6 -6
- package/dist/safe-bash-command-node/commands/node/default-runtime.js +6 -6
- package/dist/safe-bash-command-node/commands/node/filesystem.js +2 -2
- package/dist/safe-bash-command-node/commands/node/quickjs.js +1 -1
- package/dist/safe-bash-command-node/commands/node/safejs.js +6 -6
- package/dist/safe-bash-command-node/commands/node/timers.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +9 -9
- package/dist/safe-bash-command-pandoc/index.js +57 -57
- package/dist/safe-bash-command-pandoc/lua-filters.js +1 -1
- package/dist/safe-bash-command-patch/index.js +6 -6
- package/dist/safe-bash-command-patch/patch-formats.js +2 -2
- package/dist/safe-bash-command-patch/patch-publication.js +1 -1
- package/dist/safe-bash-command-patch/patch.js +5 -5
- package/dist/safe-bash-command-patch/unified.js +1 -1
- package/dist/safe-bash-command-pdfinfo/index.js +2 -2
- package/dist/safe-bash-command-pdftk/index.js +550 -137
- package/dist/safe-bash-command-pdftoppm/index.js +89 -124
- package/dist/safe-bash-command-pdftotext/index.d.ts +1 -1
- package/dist/safe-bash-command-pdftotext/index.js +554 -381
- package/dist/safe-bash-command-playwright-cli/index.js +26 -25
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +7 -7
- package/dist/safe-bash-command-playwright-cli/playwright/adapter.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +16 -15
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +26 -25
- package/dist/safe-bash-command-playwright-cli/playwright/native-storage-replacement.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/open-options.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/profile.d.ts +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/profile.js +6 -5
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +5 -5
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +3 -3
- package/dist/safe-bash-command-pptx/engine.js +2 -2
- package/dist/safe-bash-command-python/executor.d.ts +1 -0
- package/dist/safe-bash-command-python/executor.js +24 -22
- package/dist/safe-bash-command-python/index.js +24 -22
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-python/llm-capability.js +1 -1
- package/dist/safe-bash-command-python/llm-functions-loader.d.ts +5 -0
- package/dist/safe-bash-command-python/llm-packages.js +51 -2
- package/dist/safe-bash-command-python/llm-provider.js +1 -1
- package/dist/safe-bash-command-rg/glob.d.ts +6 -0
- package/dist/safe-bash-command-rg/glob.js +2 -2
- package/dist/safe-bash-command-rg/index.js +8 -8
- package/dist/safe-bash-command-rg/matcher.d.ts +2 -0
- package/dist/safe-bash-command-rg/matcher.js +2 -2
- package/dist/safe-bash-command-rg/options.d.ts +2 -0
- package/dist/safe-bash-command-rg/options.js +1 -1
- package/dist/safe-bash-command-rg/output.js +3 -3
- package/dist/safe-bash-command-rg/replacement.js +2 -2
- package/dist/safe-bash-command-rg/rg-command.js +8 -8
- package/dist/safe-bash-command-rg/shared.d.ts +0 -2
- package/dist/safe-bash-command-rg/shared.js +2 -4
- package/dist/safe-bash-command-rg/walk.js +4 -4
- package/dist/safe-bash-command-safejs/index.js +5 -5
- package/dist/safe-bash-command-safejs/runtime.js +3 -3
- package/dist/safe-bash-command-soffice/index.js +2 -2
- package/dist/safe-bash-command-sqlite3/engine.d.ts +15 -0
- package/dist/safe-bash-command-sqlite3/index.js +310 -15
- package/dist/safe-bash-command-ssconvert/index.js +13 -13
- package/dist/safe-bash-command-tar/create.js +2 -2
- package/dist/safe-bash-command-tar/extract.js +2 -2
- package/dist/safe-bash-command-tar/index.js +6 -6
- package/dist/safe-bash-command-tar/modes.js +4 -4
- package/dist/safe-bash-command-unzip/index.js +5 -5
- package/dist/safe-bash-command-unzip/unzip.js +2 -2
- package/dist/safe-bash-command-yq/parser.js +1 -1
- package/dist/safe-bash-command-yq/query.js +1 -1
- package/dist/safe-bash-contracts/escaping.js +2 -2
- package/dist/safe-bash-contracts/index.js +15 -15
- package/dist/safe-bash-csv-engine/index.js +5 -3
- package/dist/safe-bash-csv-engine/python-codepages.js +2 -1
- package/dist/safe-bash-csv-engine/python-file-codepages.d.ts +1 -0
- package/dist/safe-bash-csv-engine/python-file-codepages.js +8 -0
- package/dist/safe-bash-csv-engine/python-utf16.js +3 -2
- package/dist/safe-bash-csv-engine/text-decoder.js +5 -3
- package/dist/safe-bash-docx-engine/ancillary-resources.js +10 -10
- package/dist/safe-bash-docx-engine/batch-operations.js +68 -68
- package/dist/safe-bash-docx-engine/batch-result-schema.js +80 -80
- package/dist/safe-bash-docx-engine/batch.js +79 -79
- package/dist/safe-bash-docx-engine/bookmarks.js +18 -18
- package/dist/safe-bash-docx-engine/charts.js +11 -11
- package/dist/safe-bash-docx-engine/command-option-rules.js +5 -5
- package/dist/safe-bash-docx-engine/command-properties.js +3 -3
- package/dist/safe-bash-docx-engine/comments.js +27 -27
- package/dist/safe-bash-docx-engine/control-bindings.js +22 -22
- package/dist/safe-bash-docx-engine/control-repeat.js +21 -21
- package/dist/safe-bash-docx-engine/controls.js +19 -19
- package/dist/safe-bash-docx-engine/create.js +10 -10
- package/dist/safe-bash-docx-engine/diagrams.js +11 -11
- package/dist/safe-bash-docx-engine/diff.js +13 -13
- package/dist/safe-bash-docx-engine/document-properties.js +17 -17
- package/dist/safe-bash-docx-engine/equations.js +18 -18
- package/dist/safe-bash-docx-engine/extract.js +14 -14
- package/dist/safe-bash-docx-engine/fields.js +23 -23
- package/dist/safe-bash-docx-engine/font-inventory.js +18 -18
- package/dist/safe-bash-docx-engine/font-resources.js +5 -5
- package/dist/safe-bash-docx-engine/image-batch-operations.js +13 -13
- package/dist/safe-bash-docx-engine/image-insertion.js +22 -22
- package/dist/safe-bash-docx-engine/image-layout.js +20 -20
- package/dist/safe-bash-docx-engine/image-replacement.js +23 -23
- package/dist/safe-bash-docx-engine/images.js +20 -20
- package/dist/safe-bash-docx-engine/index.js +138 -138
- package/dist/safe-bash-docx-engine/inspection.js +21 -21
- package/dist/safe-bash-docx-engine/invocation.js +8 -8
- package/dist/safe-bash-docx-engine/io.js +8 -8
- package/dist/safe-bash-docx-engine/links.js +21 -21
- package/dist/safe-bash-docx-engine/lists.js +20 -20
- package/dist/safe-bash-docx-engine/locations.js +15 -15
- package/dist/safe-bash-docx-engine/notes.js +22 -22
- package/dist/safe-bash-docx-engine/objects.js +20 -20
- package/dist/safe-bash-docx-engine/operation-json-schema.js +3 -3
- package/dist/safe-bash-docx-engine/operation-schema.js +2 -2
- package/dist/safe-bash-docx-engine/pack.js +14 -14
- package/dist/safe-bash-docx-engine/package-view-batch-operations.js +21 -21
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +29 -29
- package/dist/safe-bash-docx-engine/paragraph-edit.js +26 -26
- package/dist/safe-bash-docx-engine/part-provider.js +3 -3
- package/dist/safe-bash-docx-engine/property-values.js +3 -3
- package/dist/safe-bash-docx-engine/publication.js +8 -8
- package/dist/safe-bash-docx-engine/removal.js +21 -21
- package/dist/safe-bash-docx-engine/revision-decisions.js +23 -23
- package/dist/safe-bash-docx-engine/revision-edit.js +20 -20
- package/dist/safe-bash-docx-engine/revisions.js +18 -18
- package/dist/safe-bash-docx-engine/run-format.js +20 -20
- package/dist/safe-bash-docx-engine/sanitize.js +35 -35
- package/dist/safe-bash-docx-engine/sections.js +19 -19
- package/dist/safe-bash-docx-engine/settings.js +12 -12
- package/dist/safe-bash-docx-engine/shape-edit.js +22 -22
- package/dist/safe-bash-docx-engine/signatures.js +16 -16
- package/dist/safe-bash-docx-engine/stories.js +22 -22
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +38 -38
- package/dist/safe-bash-docx-engine/style-model-batch-operations.js +26 -26
- package/dist/safe-bash-docx-engine/style-model-result-schema.js +44 -44
- package/dist/safe-bash-docx-engine/styles.js +18 -18
- package/dist/safe-bash-docx-engine/table-edit.js +28 -28
- package/dist/safe-bash-docx-engine/table-read.js +16 -16
- package/dist/safe-bash-docx-engine/template.js +22 -22
- package/dist/safe-bash-docx-engine/text-replace.js +20 -20
- package/dist/safe-bash-docx-engine/text-resource-read.js +16 -16
- package/dist/safe-bash-docx-engine/text.js +16 -16
- package/dist/safe-bash-docx-engine/validation.js +6 -6
- package/dist/safe-bash-docx-engine/xml-parts.js +23 -23
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +4 -4
- package/dist/safe-bash-line-ending-engine/command.js +4 -4
- package/dist/safe-bash-line-ending-engine/index.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-blocks.js +1 -1
- package/dist/safe-bash-markdown-engine/index.js +3 -3
- package/dist/safe-bash-network-engine/transfer.js +12 -12
- package/dist/safe-bash-pptx-engine/bytes.js +1 -1
- package/dist/safe-bash-pptx-engine/index.js +1 -1
- package/dist/safe-bash-presentation-engine/accessibility.js +33 -31
- package/dist/safe-bash-presentation-engine/animation-editing.js +17 -16
- package/dist/safe-bash-presentation-engine/animations.js +17 -16
- package/dist/safe-bash-presentation-engine/backgrounds.js +18 -17
- package/dist/safe-bash-presentation-engine/bytes.js +4 -4
- package/dist/safe-bash-presentation-engine/chart-editing.js +36 -34
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +26 -25
- package/dist/safe-bash-presentation-engine/charts.js +33 -31
- package/dist/safe-bash-presentation-engine/command-placeholder.js +63 -60
- package/dist/safe-bash-presentation-engine/comments.js +18 -17
- package/dist/safe-bash-presentation-engine/connector-operations.js +34 -32
- package/dist/safe-bash-presentation-engine/connectors.js +31 -29
- package/dist/safe-bash-presentation-engine/content-types.js +5 -5
- package/dist/safe-bash-presentation-engine/creation.js +7 -7
- package/dist/safe-bash-presentation-engine/diff.js +40 -37
- package/dist/safe-bash-presentation-engine/drawing-format.js +21 -20
- package/dist/safe-bash-presentation-engine/drawing-operations.js +33 -31
- package/dist/safe-bash-presentation-engine/drawing-schema.js +22 -21
- package/dist/safe-bash-presentation-engine/equations.js +18 -17
- package/dist/safe-bash-presentation-engine/errors.js +3 -3
- package/dist/safe-bash-presentation-engine/fields.js +18 -17
- package/dist/safe-bash-presentation-engine/font-metrics.js +4 -4
- package/dist/safe-bash-presentation-engine/image-extraction.js +23 -21
- package/dist/safe-bash-presentation-engine/image-formatting.js +35 -33
- package/dist/safe-bash-presentation-engine/image-insertion.js +20 -19
- package/dist/safe-bash-presentation-engine/image-metadata.d.ts +7 -1
- package/dist/safe-bash-presentation-engine/image-metadata.js +5 -3
- package/dist/safe-bash-presentation-engine/image-replacement.js +24 -22
- package/dist/safe-bash-presentation-engine/image-value.js +6 -6
- package/dist/safe-bash-presentation-engine/images.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/images.js +24 -20
- package/dist/safe-bash-presentation-engine/index.js +151 -146
- package/dist/safe-bash-presentation-engine/layouts.js +17 -16
- package/dist/safe-bash-presentation-engine/length.js +4 -4
- package/dist/safe-bash-presentation-engine/links.js +17 -16
- package/dist/safe-bash-presentation-engine/masters.js +16 -15
- package/dist/safe-bash-presentation-engine/media-editing.js +30 -25
- package/dist/safe-bash-presentation-engine/media-extraction.d.ts +4 -0
- package/dist/safe-bash-presentation-engine/media-extraction.js +33 -19
- package/dist/safe-bash-presentation-engine/media.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/media.js +32 -18
- package/dist/safe-bash-presentation-engine/memberships.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/memberships.js +25 -17
- package/dist/safe-bash-presentation-engine/notes.js +20 -18
- package/dist/safe-bash-presentation-engine/ole-enum.js +5 -5
- package/dist/safe-bash-presentation-engine/ole-insertion.js +22 -21
- package/dist/safe-bash-presentation-engine/opaque-objects.d.ts +4 -0
- package/dist/safe-bash-presentation-engine/opaque-objects.js +30 -12
- package/dist/safe-bash-presentation-engine/package-reader.js +6 -6
- package/dist/safe-bash-presentation-engine/package-tools.js +24 -20
- package/dist/safe-bash-presentation-engine/package-uri.js +4 -4
- package/dist/safe-bash-presentation-engine/package-writer.js +5 -5
- package/dist/safe-bash-presentation-engine/presentation-model.js +62 -59
- package/dist/safe-bash-presentation-engine/presentation-settings.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/presentation-settings.js +25 -16
- package/dist/safe-bash-presentation-engine/properties.js +21 -18
- package/dist/safe-bash-presentation-engine/relationships.js +5 -5
- package/dist/safe-bash-presentation-engine/resource-limits.js +2 -2
- package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +8 -4
- package/dist/safe-bash-presentation-engine/retained-fonts.d.ts +26 -0
- package/dist/safe-bash-presentation-engine/retained-image-metadata.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/retained-inspection.js +16 -14
- package/dist/safe-bash-presentation-engine/retained-media-extraction.d.ts +21 -0
- package/dist/safe-bash-presentation-engine/retained-media.d.ts +54 -0
- package/dist/safe-bash-presentation-engine/retained-memberships.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-object-extraction.d.ts +22 -0
- package/dist/safe-bash-presentation-engine/retained-objects.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-package.js +6 -6
- package/dist/safe-bash-presentation-engine/retained-presentation-settings.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-shape-geometry.d.ts +20 -0
- package/dist/safe-bash-presentation-engine/retained-text.d.ts +24 -4
- package/dist/safe-bash-presentation-engine/retained-text.js +35 -31
- package/dist/safe-bash-presentation-engine/retained-transitions.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +22 -19
- package/dist/safe-bash-presentation-engine/selectors.js +11 -11
- package/dist/safe-bash-presentation-engine/shape-groups.js +33 -31
- package/dist/safe-bash-presentation-engine/shape-operations.js +32 -30
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +34 -32
- package/dist/safe-bash-presentation-engine/shape-paths.js +17 -16
- package/dist/safe-bash-presentation-engine/shape-presets.js +4 -4
- package/dist/safe-bash-presentation-engine/shape-selection.js +33 -31
- package/dist/safe-bash-presentation-engine/shape-transforms.d.ts +6 -0
- package/dist/safe-bash-presentation-engine/shape-transforms.js +26 -20
- package/dist/safe-bash-presentation-engine/shapes.js +28 -27
- package/dist/safe-bash-presentation-engine/slide-copy.js +21 -17
- package/dist/safe-bash-presentation-engine/slide-import.js +19 -18
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +21 -20
- package/dist/safe-bash-presentation-engine/slide-model.js +46 -44
- package/dist/safe-bash-presentation-engine/slide-removal.js +19 -18
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +10 -10
- package/dist/safe-bash-presentation-engine/slides.js +21 -19
- package/dist/safe-bash-presentation-engine/table-operations.js +35 -33
- package/dist/safe-bash-presentation-engine/table-spans.js +34 -32
- package/dist/safe-bash-presentation-engine/tables.js +33 -31
- package/dist/safe-bash-presentation-engine/tags.js +20 -18
- package/dist/safe-bash-presentation-engine/template-bindings.js +36 -34
- package/dist/safe-bash-presentation-engine/template-repeat.js +46 -41
- package/dist/safe-bash-presentation-engine/text-fitting.js +28 -27
- package/dist/safe-bash-presentation-engine/text-frames.js +28 -27
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +28 -27
- package/dist/safe-bash-presentation-engine/text-reading.js +12 -12
- package/dist/safe-bash-presentation-engine/text-replacement.js +18 -17
- package/dist/safe-bash-presentation-engine/text-runs.js +21 -20
- package/dist/safe-bash-presentation-engine/themes.js +17 -16
- package/dist/safe-bash-presentation-engine/transitions.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/transitions.js +24 -16
- package/dist/safe-bash-presentation-engine/validation.js +11 -10
- package/dist/safe-bash-presentation-engine/xml-parts.js +21 -19
- package/dist/safe-bash-presentation-engine/xml-view.js +4 -4
- package/dist/safe-bash-presentation-engine/xml.js +4 -4
- package/dist/safe-bash-query-engine/capture.js +5 -5
- package/dist/safe-bash-query-engine/dates.js +2 -2
- package/dist/safe-bash-query-engine/delpaths.js +5 -5
- package/dist/safe-bash-query-engine/formats.js +3 -3
- package/dist/safe-bash-query-engine/index.js +15 -15
- package/dist/safe-bash-query-engine/indices.js +5 -5
- package/dist/safe-bash-query-engine/input.js +2 -2
- package/dist/safe-bash-query-engine/interpreter.d.ts +2 -1
- package/dist/safe-bash-query-engine/interpreter.js +13 -13
- package/dist/safe-bash-query-engine/limits.d.ts +1 -0
- package/dist/safe-bash-query-engine/limits.js +1 -1
- package/dist/safe-bash-query-engine/parser.js +2 -2
- package/dist/safe-bash-query-engine/query-core.js +15 -15
- package/dist/safe-bash-query-engine/recurse.js +2 -2
- package/dist/safe-bash-query-engine/regex.js +6 -6
- package/dist/safe-bash-query-engine/split.js +2 -2
- package/dist/safe-bash-query-engine/splits.js +7 -7
- package/dist/safe-bash-query-engine/values.js +4 -4
- package/dist/safe-bash-regex-engine/ere/matcher.d.ts +1 -1
- package/dist/safe-bash-regex-engine/ere/matcher.js +18 -10
- package/dist/safe-bash-regex-engine/ere/syntax.d.ts +1 -1
- package/dist/safe-bash-regex-engine/ere/syntax.js +1 -1
- package/dist/safe-bash-regex-engine/ere/types.d.ts +1 -0
- package/dist/safe-bash-regex-engine/execution/bounded-provider.js +5 -6
- package/dist/safe-bash-search-engine/ergonomic-regex.d.ts +1 -0
- package/dist/safe-bash-search-engine/ergonomic-regex.js +2 -2
- package/dist/safe-bash-sqlite-engine/sqlite-read-session.d.ts +17 -0
- package/dist/safe-bash-sqlite-engine/storage.d.ts +1 -0
- package/dist/safe-bash-sqlite-engine/storage.js +159 -89
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.js +1 -1
- package/dist/safe-bash-xml-engine/index.js +4 -4
- package/dist/safe-bash-xml-engine/json.js +14 -7
- package/dist/safe-bash-xml-engine/query.js +2 -2
- package/dist/safe-bash-xml-engine/recovery.d.ts +13 -3
- package/dist/safe-bash-xml-engine/stored-document.d.ts +18 -3
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +5 -5
- package/dist/safe-bash-xml-engine/stored-map.d.ts +35 -0
- package/dist/safe-bash-zip-engine/index.js +3 -3
- package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
- package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
- package/dist/safe-bash-zip-engine/zip-format.js +3 -3
- package/dist/safe-playwright-cloudflare/browser-provider.generated.js +11819 -11773
- package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.js +1 -1
- package/dist/spreadsheet-engine/formatting/cell-text.js +1 -1
- package/dist/spreadsheet-engine/{rendering/print → formatting}/general-number.js +3 -3
- package/dist/spreadsheet-engine/formulas/functions/python-printf.js +16 -10
- package/dist/spreadsheet-engine/solver/program.js +3 -2
- package/dist/spreadsheet-engine/solver/run.js +8 -2
- package/dist/spreadsheet-engine/solver/sensitivity.d.ts +4 -2
- package/dist/spreadsheet-engine/solver/sensitivity.js +80 -42
- package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +2 -1
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +35 -29
- package/dist/spreadsheet-format-xls/biff-properties-write.js +16 -7
- package/dist/spreadsheet-format-xls/biff-property-names.d.ts +3 -0
- package/dist/spreadsheet-format-xls/biff-property-names.js +44 -1
- package/dist/spreadsheet-format-xls/biff-property-observations.d.ts +33 -0
- package/dist/spreadsheet-format-xls/biff-property-observations.js +160 -0
- package/package.json +8 -5
- package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +15 -0
- package/third-party/pdf-ast/licenses/PYTHON-PSF.txt +254 -0
- package/third-party/pdf-ast/licenses/V8-BSD.txt +61 -0
- package/dist/safe-bash/chunks/chunk-FL6XE3W4.js +0 -35
- package/dist/safe-bash/command-chunks/biff-KLS4T7FP-UO3CXFFF.js +0 -5581
- package/dist/safe-bash/command-chunks/chunk-6EZWG56T.js +0 -455
- package/dist/safe-bash/command-chunks/chunk-6RLWPB44.js +0 -107
- package/dist/safe-bash/command-chunks/chunk-CGJ7GMHO.js +0 -297
- package/dist/safe-bash/command-chunks/chunk-E64ZI2YB.js +0 -550
- package/dist/safe-bash/command-chunks/chunk-IOXMGD2H.js +0 -260
- package/dist/safe-bash/command-chunks/chunk-KSM5CCHT.js +0 -1850
- package/dist/safe-bash/command-chunks/chunk-P4OWVKMD.js +0 -228
- package/dist/safe-bash/command-chunks/chunk-UPXFSGQG.js +0 -134
- package/dist/safe-bash/command-chunks/chunk-WKUV62RJ.js +0 -92
- package/dist/safe-bash/command-chunks/chunk-WOL3LBXE.js +0 -144
- package/dist/safe-bash/command-chunks/chunk-Z3PGWMSQ.js +0 -63
- package/dist/safe-bash/command-chunks/model-store-I7YAWL5V.js +0 -54
- package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +0 -365
- package/dist/safe-bash-xml-engine/stored-namespaces.d.ts +0 -21
- package/dist/safe-bash/command-chunks/{chunk-WKU65Z3Q.js → chunk-3NJETNC2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SRXARACJ.js → chunk-3TP4SSPS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-AV6N7DDA.js → chunk-DDYPQAXN.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FEKECRJP.js → chunk-EBTKM7KX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-M3OXQXCU.js → chunk-NBRXQUK7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WVD5WZXD.js → chunk-QWHBQBPB.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-5MFRN3CB.js → chunk-R64BI5MT.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2ANW3FXH.js → chunk-U33GIOUY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OEKLEUUW.js → chunk-YZE7BKHC.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WXW665TV.js → chunk-ZSHXZ3XG.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-RXXNLH7A.js → chunk-ZSQCROFE.js} +3 -3
- package/dist/safe-bash/command-chunks/{dif-BXKPQOCO-4KB3RC6G.js → dif-BXKPQOCO-FVJYYGYB.js} +4 -4
- package/dist/safe-bash/command-chunks/{pln-DFS7VLVS-OVOBS4QX.js → pln-DFS7VLVS-JATX6FS7.js} +3 -3
- package/dist/safe-bash/command-chunks/{psion-YBI6JEQI-GY4S6ZLC.js → psion-YBI6JEQI-6OMC2PGC.js} +3 -3
- package/dist/safe-bash/command-chunks/{sylk-25D7TL2Y-RU6ANKGT.js → sylk-25D7TL2Y-NJKBZZTF.js} +4 -4
- /package/dist/spreadsheet-engine/{rendering/print → formatting}/general-number.d.ts +0 -0
|
@@ -1,43 +1,20 @@
|
|
|
1
1
|
import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
|
|
2
2
|
|
|
3
|
-
// packages/safe-bash-command-pdftotext/src/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
yield encoder.encode('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n');
|
|
19
|
-
yield encoder.encode("<title>");
|
|
20
|
-
yield* escaped(metadata.Title ?? "");
|
|
21
|
-
yield encoder.encode("</title>\n");
|
|
22
|
-
for (const name of ["Author", "Subject", "Creator", "Producer"]) {
|
|
23
|
-
const value = metadata[name];
|
|
24
|
-
if (!value) continue;
|
|
25
|
-
yield encoder.encode(`<meta name="${name}" content="`);
|
|
26
|
-
yield* escaped(value);
|
|
27
|
-
yield encoder.encode('"/>\n');
|
|
28
|
-
}
|
|
29
|
-
yield encoder.encode(`</head>
|
|
30
|
-
<body>
|
|
31
|
-
<${element}>
|
|
32
|
-
`);
|
|
33
|
-
}
|
|
34
|
-
async function* streamTextHtml(input, metadata) {
|
|
35
|
-
const decoder = new TextDecoder();
|
|
36
|
-
yield* streamTextHtmlStart(metadata, "pre");
|
|
37
|
-
for await (const bytes of input) yield* escaped(decoder.decode(bytes, { stream: true }));
|
|
38
|
-
yield* escaped(decoder.decode());
|
|
39
|
-
yield new TextEncoder().encode("</pre>\n</body>\n</html>\n");
|
|
40
|
-
}
|
|
3
|
+
// packages/safe-bash-command-pdftotext/src/retained-html.ts
|
|
4
|
+
import {
|
|
5
|
+
PdfFileSource,
|
|
6
|
+
PdfRetainedDocument,
|
|
7
|
+
PdfRetainedDecodedImage,
|
|
8
|
+
PdfStagingStorage,
|
|
9
|
+
PdfStagedOutputs,
|
|
10
|
+
PdfError,
|
|
11
|
+
encodeRetainedPng,
|
|
12
|
+
encodeJpegChunks,
|
|
13
|
+
streamHtmlPageText
|
|
14
|
+
} from "../pdf-ast/index.js";
|
|
15
|
+
import { InputByteBudget, readBytes, writeBytes } from "../safe-bash-contracts/io.js";
|
|
16
|
+
import { resolvePath as resolvePath2 } from "../safe-bash-contracts/path.js";
|
|
17
|
+
import { yieldTurn } from "../safe-bash-contracts/yield.js";
|
|
41
18
|
|
|
42
19
|
// packages/safe-bash-command-pdftotext/src/output-encoding.ts
|
|
43
20
|
var ASCII7_COMPAT_MAP = {
|
|
@@ -112,9 +89,450 @@ async function* encodePopplerChunks(input, encoding, eol) {
|
|
|
112
89
|
if (final.length) yield final;
|
|
113
90
|
}
|
|
114
91
|
|
|
92
|
+
// packages/safe-bash-command-pdftotext/src/retained-output.ts
|
|
93
|
+
import { FsError } from "../safe-bash-contracts/errors.js";
|
|
94
|
+
import { resolvePath } from "../safe-bash-contracts/path.js";
|
|
95
|
+
import { writeFileOutput } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
96
|
+
async function publishPdfOutput(context, path, source, signal) {
|
|
97
|
+
const fs = context.fs;
|
|
98
|
+
const capabilities = await fs.capabilitiesFor?.(path, { signal, create: true, stagingAncestry: true }) ?? fs.capabilities;
|
|
99
|
+
if (!capabilities.atomicFileStaging || !capabilities.retainedStagingWrite || !capabilities.retainedStagingCleanup || !capabilities.atomicStagingAncestry || !fs.prepareStagingResolution || !fs.createStagedFile || !fs.publishStagedFile) {
|
|
100
|
+
throw new FsError("ENOTSUP", { path, message: "PDF text output requires retained atomic staging" });
|
|
101
|
+
}
|
|
102
|
+
const resolution = await fs.prepareStagingResolution(path, { signal });
|
|
103
|
+
const directory = resolvePath(resolution.path, "..");
|
|
104
|
+
const staging = await fs.createStagedFile(
|
|
105
|
+
`${directory}/.pdf-text-${crypto.randomUUID()}`,
|
|
106
|
+
"output",
|
|
107
|
+
{ type: "file", data: new Uint8Array() },
|
|
108
|
+
{ parent: resolution.parent, retainCleanup: true, signal }
|
|
109
|
+
);
|
|
110
|
+
let failed = false;
|
|
111
|
+
try {
|
|
112
|
+
if (!staging.writer || !staging.cleanup) throw new FsError("ENOTSUP", { path, message: "PDF backend omitted retained staging handles" });
|
|
113
|
+
for await (const bytes of source) {
|
|
114
|
+
await writeFileOutput({ ...context, signal }, bytes, (data) => staging.writer.write(data, { signal }));
|
|
115
|
+
}
|
|
116
|
+
const stat = await staging.writer.finish({ signal });
|
|
117
|
+
await fs.publishStagedFile(
|
|
118
|
+
{ ...staging, file: { ...staging.file, stat } },
|
|
119
|
+
resolution.path,
|
|
120
|
+
{ parent: resolution.parent, destination: resolution.destination, ancestors: resolution.ancestors, commitGuard: resolution.validate, signal }
|
|
121
|
+
);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
failed = true;
|
|
124
|
+
throw error;
|
|
125
|
+
} finally {
|
|
126
|
+
const cleanup = async () => {
|
|
127
|
+
try {
|
|
128
|
+
await staging.cleanup?.remove();
|
|
129
|
+
} finally {
|
|
130
|
+
await staging.cleanup?.close();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
await cleanup().catch((error) => {
|
|
134
|
+
if (!failed) throw error;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// packages/safe-bash-command-pdftotext/src/retained-html.ts
|
|
140
|
+
var escape = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
141
|
+
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
142
|
+
async function* base64(input, signal) {
|
|
143
|
+
let value = 0, count = 0, text = "";
|
|
144
|
+
for await (const bytes of input) {
|
|
145
|
+
signal.throwIfAborted();
|
|
146
|
+
for (const byte of bytes) {
|
|
147
|
+
value = value << 8 | byte;
|
|
148
|
+
if (++count !== 3) continue;
|
|
149
|
+
text += alphabet[value >>> 18 & 63] + alphabet[value >>> 12 & 63] + alphabet[value >>> 6 & 63] + alphabet[value & 63];
|
|
150
|
+
count = 0;
|
|
151
|
+
value = 0;
|
|
152
|
+
if (text.length >= 4096) {
|
|
153
|
+
yield text;
|
|
154
|
+
text = "";
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (count) {
|
|
159
|
+
value <<= (3 - count) * 8;
|
|
160
|
+
text += alphabet[value >>> 18 & 63] + alphabet[value >>> 12 & 63] + (count === 2 ? alphabet[value >>> 6 & 63] : "=") + "=";
|
|
161
|
+
}
|
|
162
|
+
if (text) yield text;
|
|
163
|
+
}
|
|
164
|
+
async function executeRetainedHtml(context, plan, stdout, signal, maxInputBytes = Infinity) {
|
|
165
|
+
const encoder = new TextEncoder(), directory = resolvePath2(context.cwd, context.env.TMPDIR || "/tmp");
|
|
166
|
+
const budget = new InputByteBudget(maxInputBytes, context.inputBudget);
|
|
167
|
+
const maximum = Math.min(maxInputBytes, context.inputBudget?.maxBytes ?? Infinity);
|
|
168
|
+
const storage = new PdfStagingStorage({ fs: context.fs, directory });
|
|
169
|
+
let source, document, outputs, failed = false;
|
|
170
|
+
const error = async (message, exitCode) => {
|
|
171
|
+
await writeBytes(context.stderr, encoder.encode(message), signal);
|
|
172
|
+
return { exitCode };
|
|
173
|
+
};
|
|
174
|
+
try {
|
|
175
|
+
await context.fs.mkdir(directory, { recursive: true, signal });
|
|
176
|
+
try {
|
|
177
|
+
if (plan.inputPath === "-") {
|
|
178
|
+
async function* input() {
|
|
179
|
+
for await (const bytes of readBytes(context.stdin, signal)) {
|
|
180
|
+
budget.charge(bytes.length);
|
|
181
|
+
yield bytes;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
source = await PdfFileSource.fromStream(storage.fs, directory, input(), { signal, maxInputBytes: maximum });
|
|
185
|
+
if (!source.size) return await error("I/O Error: Couldn't open file '-'\n", 1);
|
|
186
|
+
} else {
|
|
187
|
+
const path = resolvePath2(context.cwd, plan.inputPath);
|
|
188
|
+
const size = (await context.fs.stat(path, { signal })).size;
|
|
189
|
+
budget.charge(size);
|
|
190
|
+
source = await PdfFileSource.open(context.fs, path, { signal, maxInputBytes: maximum });
|
|
191
|
+
if (source.size > size) budget.charge(source.size - size);
|
|
192
|
+
}
|
|
193
|
+
} catch (failure) {
|
|
194
|
+
signal.throwIfAborted();
|
|
195
|
+
budget.assertOpen();
|
|
196
|
+
if (failure instanceof PdfError && failure.code === "E_LIMIT") throw failure;
|
|
197
|
+
return await error(`I/O Error: Couldn't open file '${plan.inputPath}'
|
|
198
|
+
`, 1);
|
|
199
|
+
}
|
|
200
|
+
let pageCount = 0;
|
|
201
|
+
try {
|
|
202
|
+
document = await PdfRetainedDocument.open(source, storage, { signal, recovery: "repair", ...plan.password ? { password: plan.password } : {} });
|
|
203
|
+
for await (const ignored of document.pages()) {
|
|
204
|
+
void ignored;
|
|
205
|
+
pageCount++;
|
|
206
|
+
}
|
|
207
|
+
} catch (failure) {
|
|
208
|
+
signal.throwIfAborted();
|
|
209
|
+
return await error(`PDF Error: ${failure.message}
|
|
210
|
+
`, 1);
|
|
211
|
+
}
|
|
212
|
+
const totalPages = Math.max(1, pageCount), endPage = plan.lastPage > 0 ? Math.min(totalPages, plan.lastPage) : totalPages;
|
|
213
|
+
if (plan.firstPage > totalPages || plan.lastPage > 0 && plan.firstPage > endPage) {
|
|
214
|
+
return await error(`Command Line Error: Wrong page range given: the first page (${plan.firstPage}) can not be after the last page (${endPage}).
|
|
215
|
+
`, 99);
|
|
216
|
+
}
|
|
217
|
+
if (!pageCount) throw new PdfError("E_CAPABILITY", "Page index out of bounds: 0");
|
|
218
|
+
const doc = document;
|
|
219
|
+
async function* images(firstPage, lastPage) {
|
|
220
|
+
let pageNumber = 0, number = 0;
|
|
221
|
+
for await (const occurrence of doc.images({ firstPage, lastPage })) {
|
|
222
|
+
await yieldTurn(signal);
|
|
223
|
+
if (pageNumber !== occurrence.pageNumber) {
|
|
224
|
+
pageNumber = occurrence.pageNumber;
|
|
225
|
+
number = 0;
|
|
226
|
+
}
|
|
227
|
+
const name = `page${pageNumber}_${++number}.${plan.imageFmt}`;
|
|
228
|
+
const decoded = await PdfRetainedDecodedImage.open(doc, occurrence, storage, { signal });
|
|
229
|
+
let imageFailed = false;
|
|
230
|
+
try {
|
|
231
|
+
const chunks = () => plan.imageFmt === "jpg" ? encodeJpegChunks(decoded.width, decoded.height, decoded.rows(), { signal }) : encodeRetainedPng(decoded.width, decoded.height, decoded.rows(), storage, { signal });
|
|
232
|
+
yield { name, width: decoded.width, height: decoded.height, chunks };
|
|
233
|
+
} catch (failure) {
|
|
234
|
+
imageFailed = true;
|
|
235
|
+
throw failure;
|
|
236
|
+
} finally {
|
|
237
|
+
await decoded.close().catch((failure) => {
|
|
238
|
+
if (!imageFailed) throw failure;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
async function* imageMarkup(page) {
|
|
244
|
+
if (plan.ignoreImages) return;
|
|
245
|
+
for await (const image of images(page, page)) {
|
|
246
|
+
if (plan.xmlMode) yield ` <image top="0" left="0" width="${image.width}" height="${image.height}" src="`;
|
|
247
|
+
else yield ' <img src="';
|
|
248
|
+
if (plan.dataUrls) {
|
|
249
|
+
yield `data:image/${plan.imageFmt === "jpg" ? "jpeg" : "png"};base64,`;
|
|
250
|
+
yield* base64(image.chunks(), signal);
|
|
251
|
+
} else {
|
|
252
|
+
if (plan.stdoutOutput) for await (const ignored of image.chunks()) void ignored;
|
|
253
|
+
yield image.name;
|
|
254
|
+
}
|
|
255
|
+
yield plan.xmlMode ? '"/>\n' : `" width="${image.width}" height="${image.height}"/>
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async function* indent(level) {
|
|
260
|
+
for (let left = level * 2; left > 0; left -= 2048) {
|
|
261
|
+
signal.throwIfAborted();
|
|
262
|
+
yield " ".repeat(Math.min(left, 2048));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
async function* outlines() {
|
|
266
|
+
let depth = 0, skipLevel;
|
|
267
|
+
for await (const item of doc.streamOutlineDetails({ includeUntitled: true, includeNameTitles: false })) {
|
|
268
|
+
if (skipLevel !== void 0) {
|
|
269
|
+
if (item.level > skipLevel) continue;
|
|
270
|
+
skipLevel = void 0;
|
|
271
|
+
}
|
|
272
|
+
let hasTitle = false;
|
|
273
|
+
for await (const part of item.title()) if (part) {
|
|
274
|
+
hasTitle = true;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
if (!hasTitle) {
|
|
278
|
+
skipLevel = item.level;
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
await yieldTurn(signal);
|
|
282
|
+
if (!depth) yield plan.xmlMode ? " <outline>\n" : '<hr/>\n<a name="outline"></a><h1>Document Outline</h1>\n<ul>\n';
|
|
283
|
+
const level = Math.max(1, item.level);
|
|
284
|
+
if (depth) {
|
|
285
|
+
if (level > depth) {
|
|
286
|
+
for (let at = depth; at < level; at++) {
|
|
287
|
+
if (plan.xmlMode) yield* indent(at + 1);
|
|
288
|
+
yield plan.xmlMode ? "<outline>\n" : "<ul>\n";
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
if (!plan.xmlMode) yield "</li>\n";
|
|
292
|
+
for (let at = depth; at > level; at--) {
|
|
293
|
+
if (plan.xmlMode) yield* indent(at);
|
|
294
|
+
yield plan.xmlMode ? "</outline>\n" : "</ul>\n</li>\n";
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
depth = level;
|
|
299
|
+
if (plan.xmlMode) yield* indent(depth + 1);
|
|
300
|
+
yield plan.xmlMode ? `<item page="${item.pageIndex + 1}">` : `<li><a href="#page${item.pageIndex + 1}">`;
|
|
301
|
+
for await (const part of item.title()) yield escape(part);
|
|
302
|
+
yield plan.xmlMode ? "</item>\n" : "</a>\n";
|
|
303
|
+
}
|
|
304
|
+
if (depth && !plan.xmlMode) yield "</li>\n";
|
|
305
|
+
for (let at = depth; at > 0; at--) {
|
|
306
|
+
if (plan.xmlMode) yield* indent(at);
|
|
307
|
+
yield plan.xmlMode ? "</outline>\n" : at > 1 ? "</ul>\n</li>\n" : "</ul>\n";
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
async function* markup() {
|
|
311
|
+
if (plan.xmlMode) yield '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE pdf2xml SYSTEM "pdf2xml.dtd">\n<pdf2xml producer="@poe-code/pdf-ast" version="24.08.0">\n';
|
|
312
|
+
else {
|
|
313
|
+
yield '<!DOCTYPE html>\n<html>\n<head><meta charset="utf-8"/><title>';
|
|
314
|
+
let hasTitle = false;
|
|
315
|
+
for await (const part of doc.streamInfoValue("Title")) {
|
|
316
|
+
hasTitle = true;
|
|
317
|
+
yield escape(part);
|
|
318
|
+
}
|
|
319
|
+
if (!hasTitle) for (let at = 0; at < plan.inputPath.length; at += 2048) yield escape(plan.inputPath.slice(at, at + 2048));
|
|
320
|
+
yield "</title></head>\n<body>\n";
|
|
321
|
+
}
|
|
322
|
+
for await (const page of doc.pages()) {
|
|
323
|
+
await yieldTurn(signal);
|
|
324
|
+
const number = page.index + 1;
|
|
325
|
+
if (number < plan.firstPage) continue;
|
|
326
|
+
if (number > endPage) break;
|
|
327
|
+
const { mediaBox } = await page.attributes(), width = Math.abs(mediaBox[2] - mediaBox[0]), height = Math.abs(mediaBox[3] - mediaBox[1]);
|
|
328
|
+
yield plan.xmlMode ? ` <page number="${number}" position="absolute" top="0" left="0" height="${Math.round(height * plan.zoom)}" width="${Math.round(width * plan.zoom)}">
|
|
329
|
+
` : `<div class="page" id="page${number}" style="position:relative;width:${Math.round(width * plan.zoom)}pt;height:${Math.round(height * plan.zoom)}pt;">
|
|
330
|
+
`;
|
|
331
|
+
const index = await page.indexText(storage, { mode: "layout", retainFontNames: true, signal });
|
|
332
|
+
let pageFailed = false;
|
|
333
|
+
try {
|
|
334
|
+
yield* streamHtmlPageText(doc, page, index, storage, { xml: plan.xmlMode, zoom: plan.zoom, height, signal, images: () => imageMarkup(number) });
|
|
335
|
+
} catch (failure) {
|
|
336
|
+
pageFailed = true;
|
|
337
|
+
throw failure;
|
|
338
|
+
} finally {
|
|
339
|
+
await index.close().catch((failure) => {
|
|
340
|
+
if (!pageFailed) throw failure;
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
yield plan.xmlMode ? " </page>\n" : "</div>\n";
|
|
344
|
+
}
|
|
345
|
+
yield* outlines();
|
|
346
|
+
yield plan.xmlMode ? "</pdf2xml>\n" : "</body>\n</html>\n";
|
|
347
|
+
}
|
|
348
|
+
async function* encoded() {
|
|
349
|
+
let high = "";
|
|
350
|
+
for await (const part of markup()) {
|
|
351
|
+
let text = high + part;
|
|
352
|
+
high = "";
|
|
353
|
+
const last = text.charCodeAt(text.length - 1);
|
|
354
|
+
if (last >= 55296 && last <= 56319) {
|
|
355
|
+
high = text.slice(-1);
|
|
356
|
+
text = text.slice(0, -1);
|
|
357
|
+
}
|
|
358
|
+
if (text) yield encoder.encode(applyPopplerOutputEncoding(text, plan.encoding));
|
|
359
|
+
}
|
|
360
|
+
if (high) yield encoder.encode(applyPopplerOutputEncoding(high, plan.encoding));
|
|
361
|
+
}
|
|
362
|
+
let inputReplaced = plan.outPath === plan.inputPath;
|
|
363
|
+
async function* entries() {
|
|
364
|
+
if (!plan.stdoutOutput) yield { name: plan.inputPath, chunks: [] };
|
|
365
|
+
if (!plan.ignoreImages && !plan.dataUrls && !plan.stdoutOutput) {
|
|
366
|
+
for await (const image of images(plan.firstPage, endPage)) {
|
|
367
|
+
const name = plan.imageDirectory + image.name;
|
|
368
|
+
if (name === plan.inputPath) inputReplaced = true;
|
|
369
|
+
yield { name, chunks: image.chunks() };
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
yield { name: plan.outPath, chunks: encoded() };
|
|
373
|
+
}
|
|
374
|
+
outputs = await PdfStagedOutputs.create(storage, entries(), { signal });
|
|
375
|
+
for await (const output of outputs.entries()) {
|
|
376
|
+
if (!plan.stdoutOutput && output.name === plan.inputPath && !inputReplaced) continue;
|
|
377
|
+
if (plan.stdoutOutput) for await (const bytes of output.contents()) await writeBytes(stdout, bytes, signal);
|
|
378
|
+
else try {
|
|
379
|
+
await publishPdfOutput(context, resolvePath2(context.cwd, output.name), output.contents(), signal);
|
|
380
|
+
} catch (failure) {
|
|
381
|
+
signal.throwIfAborted();
|
|
382
|
+
if (!(failure instanceof Error) || !("code" in failure)) throw failure;
|
|
383
|
+
return await error(`I/O Error: Couldn't open html file '${output.name}'
|
|
384
|
+
`, 0);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return { exitCode: 0 };
|
|
388
|
+
} catch (failure) {
|
|
389
|
+
failed = true;
|
|
390
|
+
throw failure;
|
|
391
|
+
} finally {
|
|
392
|
+
const closed = await Promise.allSettled([outputs?.close(), document?.close(), source?.close()]);
|
|
393
|
+
if (!failed) {
|
|
394
|
+
for (const result of closed) if (result.status === "rejected") await Promise.reject(result.reason);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// packages/safe-bash-command-pdftotext/src/html-arguments.ts
|
|
400
|
+
var SUPPORTED_ENCODINGS = /* @__PURE__ */ new Set([
|
|
401
|
+
"ASCII7",
|
|
402
|
+
"Latin1",
|
|
403
|
+
"UTF-8",
|
|
404
|
+
"UCS-2",
|
|
405
|
+
"Symbol",
|
|
406
|
+
"ZapfDingbats"
|
|
407
|
+
]);
|
|
408
|
+
function parseHtmlArguments(argv, hasStdin = false) {
|
|
409
|
+
let xmlMode = false;
|
|
410
|
+
let toStdout = false;
|
|
411
|
+
let ignoreImages = false;
|
|
412
|
+
let dataUrls = false;
|
|
413
|
+
let firstPage = 1;
|
|
414
|
+
let lastPage = 0;
|
|
415
|
+
let zoom = 1;
|
|
416
|
+
let imageFmt = "png";
|
|
417
|
+
let encoding = "UTF-8";
|
|
418
|
+
let password = "";
|
|
419
|
+
const positionals = [];
|
|
420
|
+
for (let i = 0; i < argv.length; i++) {
|
|
421
|
+
const arg = argv[i];
|
|
422
|
+
if (arg === "--") {
|
|
423
|
+
positionals.push(...argv.slice(i + 1));
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
if (arg === "-v" || arg === "--version") {
|
|
427
|
+
return { exitCode: 0, stdout: "pdftohtml version 24.08.0\n", stderr: "" };
|
|
428
|
+
}
|
|
429
|
+
if (arg === "-h" || arg === "-help" || arg === "--help" || arg === "-?") {
|
|
430
|
+
return {
|
|
431
|
+
exitCode: 0,
|
|
432
|
+
stdout: "Usage: pdftohtml [options] <PDF-file> [<html-file>|<xml-file>]\n -xml / -stdout / -s / -i / -noframes / -c / -f <int> / -l <int>\n",
|
|
433
|
+
stderr: ""
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
if (arg === "-xml")
|
|
437
|
+
xmlMode = true;
|
|
438
|
+
else if (arg === "-stdout")
|
|
439
|
+
toStdout = true;
|
|
440
|
+
else if (arg === "-i")
|
|
441
|
+
ignoreImages = true;
|
|
442
|
+
else if (arg === "-dataurls")
|
|
443
|
+
dataUrls = true;
|
|
444
|
+
else if (arg === "-f")
|
|
445
|
+
firstPage = Math.max(1, Number(argv[++i] ?? "1") || 1);
|
|
446
|
+
else if (arg === "-l")
|
|
447
|
+
lastPage = Math.max(0, Number(argv[++i] ?? "0") || 0);
|
|
448
|
+
else if (arg === "-zoom") {
|
|
449
|
+
const z = Number.parseFloat(argv[++i] ?? "1");
|
|
450
|
+
if (Number.isFinite(z) && z > 0)
|
|
451
|
+
zoom = z;
|
|
452
|
+
} else if (arg === "-fmt") {
|
|
453
|
+
const fmtVal = (argv[++i] ?? "").toLowerCase();
|
|
454
|
+
if (fmtVal === "png")
|
|
455
|
+
imageFmt = "png";
|
|
456
|
+
else if (fmtVal === "jpg" || fmtVal === "jpeg")
|
|
457
|
+
imageFmt = "jpg";
|
|
458
|
+
else {
|
|
459
|
+
return { exitCode: 99, stdout: "", stderr: `Command Line Error: Invalid image format '${fmtVal}'
|
|
460
|
+
` };
|
|
461
|
+
}
|
|
462
|
+
} else if (arg === "-enc") {
|
|
463
|
+
const nextEnc = argv[++i] ?? "";
|
|
464
|
+
if (!SUPPORTED_ENCODINGS.has(nextEnc)) {
|
|
465
|
+
return { exitCode: 99, stdout: "", stderr: `Command Line Error: Unknown encoding '${nextEnc}'
|
|
466
|
+
` };
|
|
467
|
+
}
|
|
468
|
+
encoding = nextEnc;
|
|
469
|
+
} else if (arg === "-upw" || arg === "-opw")
|
|
470
|
+
password = argv[++i] ?? "";
|
|
471
|
+
else if (arg === "-s" || arg === "-noframes" || arg === "-c" || arg === "-p" || arg === "-q" || arg === "-hidden" || arg === "-nomerge" || arg === "-nodrm") {
|
|
472
|
+
} else if (!arg.startsWith("-") || arg === "-") {
|
|
473
|
+
positionals.push(arg);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
const inputPath = positionals[0] ?? (hasStdin ? "-" : void 0);
|
|
477
|
+
if (!inputPath) {
|
|
478
|
+
return { exitCode: 99, stdout: "", stderr: "Usage: pdftohtml [options] <PDF-file> [<html-file>]\n" };
|
|
479
|
+
}
|
|
480
|
+
const explicitOut = positionals[1];
|
|
481
|
+
const stdoutOutput = toStdout || explicitOut === "-" || inputPath === "-" && !explicitOut;
|
|
482
|
+
const defaultExt = xmlMode ? ".xml" : ".html";
|
|
483
|
+
const inputStem = inputPath.toLowerCase().endsWith(".pdf") ? inputPath.slice(0, -4) : inputPath;
|
|
484
|
+
const outPath = explicitOut ? explicitOut.endsWith(".html") || explicitOut.endsWith(".xml") ? explicitOut : `${explicitOut}${defaultExt}` : inputStem + defaultExt;
|
|
485
|
+
const imageDirectory = outPath.slice(0, outPath.lastIndexOf("/") + 1);
|
|
486
|
+
return { inputPath, outPath, imageDirectory, xmlMode, stdoutOutput, ignoreImages, dataUrls, firstPage, lastPage, zoom, imageFmt, encoding, password };
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// packages/safe-bash-command-pdftotext/src/text-markup.ts
|
|
490
|
+
function escapeXml(text) {
|
|
491
|
+
return text.replaceAll("&", "&").replaceAll("'", "'").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">");
|
|
492
|
+
}
|
|
493
|
+
function* escaped(value) {
|
|
494
|
+
const encoder = new TextEncoder();
|
|
495
|
+
for (let offset = 0; offset < value.length; ) {
|
|
496
|
+
let end = Math.min(value.length, offset + 4096);
|
|
497
|
+
if (end < value.length && value.charCodeAt(end - 1) >= 55296 && value.charCodeAt(end - 1) <= 56319) end--;
|
|
498
|
+
yield encoder.encode(escapeXml(value.slice(offset, end)));
|
|
499
|
+
offset = end;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
async function* streamTextHtmlStart(metadata, element) {
|
|
503
|
+
const encoder = new TextEncoder();
|
|
504
|
+
yield encoder.encode('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n');
|
|
505
|
+
yield encoder.encode("<title>");
|
|
506
|
+
for await (const part of metadata("Title")) yield* escaped(part);
|
|
507
|
+
yield encoder.encode("</title>\n");
|
|
508
|
+
for (const name of ["Author", "Subject", "Creator", "Producer"]) {
|
|
509
|
+
let opened = false;
|
|
510
|
+
for await (const part of metadata(name)) {
|
|
511
|
+
if (!part) continue;
|
|
512
|
+
if (!opened) {
|
|
513
|
+
yield encoder.encode(`<meta name="${name}" content="`);
|
|
514
|
+
opened = true;
|
|
515
|
+
}
|
|
516
|
+
yield* escaped(part);
|
|
517
|
+
}
|
|
518
|
+
if (opened) yield encoder.encode('"/>\n');
|
|
519
|
+
}
|
|
520
|
+
yield encoder.encode(`</head>
|
|
521
|
+
<body>
|
|
522
|
+
<${element}>
|
|
523
|
+
`);
|
|
524
|
+
}
|
|
525
|
+
async function* streamTextHtml(input, metadata) {
|
|
526
|
+
const decoder = new TextDecoder();
|
|
527
|
+
yield* streamTextHtmlStart(metadata, "pre");
|
|
528
|
+
for await (const bytes of input) yield* escaped(decoder.decode(bytes, { stream: true }));
|
|
529
|
+
yield* escaped(decoder.decode());
|
|
530
|
+
yield new TextEncoder().encode("</pre>\n</body>\n</html>\n");
|
|
531
|
+
}
|
|
532
|
+
|
|
115
533
|
// packages/safe-bash-command-pdftotext/src/retained-bbox.ts
|
|
116
|
-
async function*
|
|
117
|
-
const index = await page.
|
|
534
|
+
async function* streamTextGeometryPage(page, storage, geometry, options) {
|
|
535
|
+
const index = await page.indexText(storage, { mode: options.raw ? "raw" : options.layout ? "layout" : "logical", colSpacing: options.colspacing, discardDiagonal: options.nodiag, clipText: options.clip, signal: options.signal });
|
|
118
536
|
const encoder = new TextEncoder(), scale = options.resolution / 72;
|
|
119
537
|
let failed = false, hasWords = false;
|
|
120
538
|
function selected(box) {
|
|
@@ -136,8 +554,15 @@ async function* streamRawBboxPage(page, storage, geometry, options) {
|
|
|
136
554
|
function coordinates(box) {
|
|
137
555
|
return `xMin="${(box[0] * scale).toFixed(6)}" yMin="${((geometry.height - box[3]) * scale).toFixed(6)}" xMax="${(box[2] * scale).toFixed(6)}" yMax="${((geometry.height - box[1]) * scale).toFixed(6)}"`;
|
|
138
556
|
}
|
|
557
|
+
function tsvCoordinates(box, precision) {
|
|
558
|
+
return [box[0] * scale, (geometry.height - box[3]) * scale, (box[2] - box[0]) * scale, (box[3] - box[1]) * scale].map((value) => value.toFixed(precision)).join(" ");
|
|
559
|
+
}
|
|
560
|
+
const tsv = options.tsv === true;
|
|
561
|
+
let blockIndex = 0;
|
|
139
562
|
try {
|
|
140
|
-
yield encoder.encode(`
|
|
563
|
+
if (tsv) yield encoder.encode(`1 ${page.index + 1} 0 0 0 0 0.000000 0.000000 ${geometry.width.toFixed(6)} ${geometry.height.toFixed(6)} -1 ###PAGE###
|
|
564
|
+
`);
|
|
565
|
+
else yield encoder.encode(` <page width="${geometry.width.toFixed(6)}" height="${geometry.height.toFixed(6)}">
|
|
141
566
|
`);
|
|
142
567
|
for await (const block of index.blocks()) {
|
|
143
568
|
let blockBox;
|
|
@@ -146,27 +571,37 @@ async function* streamRawBboxPage(page, storage, geometry, options) {
|
|
|
146
571
|
if (box) blockBox = union(blockBox, box);
|
|
147
572
|
}
|
|
148
573
|
if (!blockBox) continue;
|
|
149
|
-
if (
|
|
574
|
+
if (tsv) yield encoder.encode(`3 ${page.index + 1} ${blockIndex} ${blockIndex} 0 0 ${tsvCoordinates(blockBox, 6)} -1 ###FLOW###
|
|
575
|
+
`);
|
|
576
|
+
else if (options.bboxLayout) yield encoder.encode(` <flow>
|
|
150
577
|
<block ${coordinates(blockBox)}>
|
|
151
578
|
`);
|
|
579
|
+
let lineIndex = 0;
|
|
152
580
|
for await (const line of block.lines()) {
|
|
153
581
|
const box = await lineBounds(line);
|
|
154
582
|
if (!box) continue;
|
|
155
|
-
if (
|
|
583
|
+
if (tsv) yield encoder.encode(`4 ${page.index + 1} ${blockIndex} ${blockIndex} ${lineIndex} 0 ${tsvCoordinates(box, 6)} -1 ###LINE###
|
|
156
584
|
`);
|
|
585
|
+
else if (options.bboxLayout) yield encoder.encode(` <line ${coordinates(box)}>
|
|
586
|
+
`);
|
|
587
|
+
let wordIndex = 0;
|
|
157
588
|
for await (const word of line.words()) {
|
|
158
589
|
const wordBox = selected(word.bbox);
|
|
159
590
|
if (!wordBox) continue;
|
|
160
591
|
hasWords = true;
|
|
161
|
-
yield encoder.encode(`
|
|
162
|
-
|
|
163
|
-
yield encoder.encode(
|
|
592
|
+
if (tsv) yield encoder.encode(`5 ${page.index + 1} ${blockIndex} ${blockIndex} ${lineIndex} ${wordIndex} ${tsvCoordinates(wordBox, 2)} 100 `);
|
|
593
|
+
else yield encoder.encode(` <word ${coordinates(wordBox)}>`);
|
|
594
|
+
for await (const text of word.text()) yield encoder.encode(tsv ? text : escapeXml(text));
|
|
595
|
+
yield encoder.encode(tsv ? "\n" : "</word>\n");
|
|
596
|
+
wordIndex++;
|
|
164
597
|
}
|
|
165
|
-
if (options.bboxLayout) yield encoder.encode(" </line>\n");
|
|
598
|
+
if (!tsv && options.bboxLayout) yield encoder.encode(" </line>\n");
|
|
599
|
+
lineIndex++;
|
|
166
600
|
}
|
|
167
|
-
if (options.bboxLayout) yield encoder.encode(" </block>\n </flow>\n");
|
|
601
|
+
if (!tsv && options.bboxLayout) yield encoder.encode(" </block>\n </flow>\n");
|
|
602
|
+
blockIndex++;
|
|
168
603
|
}
|
|
169
|
-
yield encoder.encode(" </page>\n");
|
|
604
|
+
if (!tsv) yield encoder.encode(" </page>\n");
|
|
170
605
|
return hasWords;
|
|
171
606
|
} catch (error) {
|
|
172
607
|
failed = true;
|
|
@@ -179,63 +614,19 @@ async function* streamRawBboxPage(page, storage, geometry, options) {
|
|
|
179
614
|
}
|
|
180
615
|
|
|
181
616
|
// packages/safe-bash-command-pdftotext/src/retained-raw.ts
|
|
182
|
-
import { PdfError, PdfNameIndex, PdfFileSource, PdfRetainedDocument, PdfStagingStorage, dictGet } from "../pdf-ast/index.js";
|
|
183
|
-
import {
|
|
184
|
-
import {
|
|
185
|
-
import {
|
|
186
|
-
|
|
187
|
-
import { yieldTurn } from "../safe-bash-contracts/yield.js";
|
|
188
|
-
async function publish(context, path, source, signal) {
|
|
189
|
-
const fs = context.fs;
|
|
190
|
-
const capabilities = await fs.capabilitiesFor?.(path, { signal, create: true, stagingAncestry: true }) ?? fs.capabilities;
|
|
191
|
-
if (!capabilities.atomicFileStaging || !capabilities.retainedStagingWrite || !capabilities.retainedStagingCleanup || !capabilities.atomicStagingAncestry || !fs.prepareStagingResolution || !fs.createStagedFile || !fs.publishStagedFile) {
|
|
192
|
-
throw new FsError("ENOTSUP", { path, message: "PDF text output requires retained atomic staging" });
|
|
193
|
-
}
|
|
194
|
-
const resolution = await fs.prepareStagingResolution(path, { signal });
|
|
195
|
-
const directory = resolvePath(resolution.path, "..");
|
|
196
|
-
const staging = await fs.createStagedFile(
|
|
197
|
-
`${directory}/.pdf-text-${crypto.randomUUID()}`,
|
|
198
|
-
"output",
|
|
199
|
-
{ type: "file", data: new Uint8Array() },
|
|
200
|
-
{ parent: resolution.parent, retainCleanup: true, signal }
|
|
201
|
-
);
|
|
202
|
-
let failed = false;
|
|
203
|
-
try {
|
|
204
|
-
if (!staging.writer || !staging.cleanup) throw new FsError("ENOTSUP", { path, message: "PDF backend omitted retained staging handles" });
|
|
205
|
-
for await (const bytes of source.stream(0, source.size, signal)) {
|
|
206
|
-
await writeFileOutput({ ...context, signal }, bytes, (data) => staging.writer.write(data, { signal }));
|
|
207
|
-
}
|
|
208
|
-
const stat = await staging.writer.finish({ signal });
|
|
209
|
-
await fs.publishStagedFile(
|
|
210
|
-
{ ...staging, file: { ...staging.file, stat } },
|
|
211
|
-
resolution.path,
|
|
212
|
-
{ parent: resolution.parent, destination: resolution.destination, ancestors: resolution.ancestors, commitGuard: resolution.validate, signal }
|
|
213
|
-
);
|
|
214
|
-
} catch (error) {
|
|
215
|
-
failed = true;
|
|
216
|
-
throw error;
|
|
217
|
-
} finally {
|
|
218
|
-
const cleanup = async () => {
|
|
219
|
-
try {
|
|
220
|
-
await staging.cleanup?.remove();
|
|
221
|
-
} finally {
|
|
222
|
-
await staging.cleanup?.close();
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
await cleanup().catch((error) => {
|
|
226
|
-
if (!failed) throw error;
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
async function executeRetainedRawText(context, plan, stdout, signal, maxInputBytes = Infinity) {
|
|
617
|
+
import { PdfError as PdfError2, PdfNameIndex, PdfFileSource as PdfFileSource2, PdfRetainedDocument as PdfRetainedDocument2, PdfStagingStorage as PdfStagingStorage2, dictGet } from "../pdf-ast/index.js";
|
|
618
|
+
import { readBytes as readBytes2, writeBytes as writeBytes2 } from "../safe-bash-contracts/io.js";
|
|
619
|
+
import { resolvePath as resolvePath3 } from "../safe-bash-contracts/path.js";
|
|
620
|
+
import { yieldTurn as yieldTurn2 } from "../safe-bash-contracts/yield.js";
|
|
621
|
+
async function executeRetainedText(context, plan, stdout, signal, maxInputBytes = Infinity) {
|
|
231
622
|
const encoder = new TextEncoder(), inputPath = plan.inputFile ?? "-", outputPath = plan.outputFile ?? "-";
|
|
232
623
|
const warning = plan.invalidEolWarning ? "Bad '-eol' value on command line\n" : "";
|
|
233
624
|
async function error(message, exitCode, includeWarning = true) {
|
|
234
|
-
if (!plan.quiet) await
|
|
625
|
+
if (!plan.quiet) await writeBytes2(context.stderr, encoder.encode((includeWarning ? warning : "") + message), signal);
|
|
235
626
|
return { exitCode };
|
|
236
627
|
}
|
|
237
|
-
const directory =
|
|
238
|
-
const storage = new
|
|
628
|
+
const directory = resolvePath3(context.cwd, context.env.TMPDIR || "/tmp");
|
|
629
|
+
const storage = new PdfStagingStorage2({ fs: context.fs, directory });
|
|
239
630
|
let source, document, result, failed = false;
|
|
240
631
|
try {
|
|
241
632
|
await context.fs.mkdir(directory, { recursive: true, signal });
|
|
@@ -244,18 +635,18 @@ async function executeRetainedRawText(context, plan, stdout, signal, maxInputByt
|
|
|
244
635
|
if (inputPath === "-") {
|
|
245
636
|
async function* input() {
|
|
246
637
|
let total = 0, turns = 0;
|
|
247
|
-
for await (const bytes of
|
|
248
|
-
if (++turns % 64 === 0) await
|
|
638
|
+
for await (const bytes of readBytes2(context.stdin, signal)) {
|
|
639
|
+
if (++turns % 64 === 0) await yieldTurn2(signal);
|
|
249
640
|
total += bytes.length;
|
|
250
641
|
context.inputBudget?.check(total);
|
|
251
642
|
yield bytes;
|
|
252
643
|
}
|
|
253
644
|
}
|
|
254
|
-
source = await
|
|
645
|
+
source = await PdfFileSource2.fromStream(storage.fs, directory, input(), { maxInputBytes: maximum, signal });
|
|
255
646
|
} else {
|
|
256
|
-
const path =
|
|
647
|
+
const path = resolvePath3(context.cwd, inputPath);
|
|
257
648
|
context.inputBudget?.check((await context.fs.stat(path, { signal })).size);
|
|
258
|
-
source = await
|
|
649
|
+
source = await PdfFileSource2.open(context.fs, path, { maxInputBytes: maximum, signal });
|
|
259
650
|
context.inputBudget?.check(source.size);
|
|
260
651
|
}
|
|
261
652
|
} catch (failure) {
|
|
@@ -270,15 +661,15 @@ async function executeRetainedRawText(context, plan, stdout, signal, maxInputByt
|
|
|
270
661
|
let pageCount = 0;
|
|
271
662
|
try {
|
|
272
663
|
const password = plan.opw ?? plan.upw;
|
|
273
|
-
document = await
|
|
664
|
+
document = await PdfRetainedDocument2.open(source, storage, { recovery: "repair", signal, ...password !== void 0 ? { password } : {} });
|
|
274
665
|
for await (const ignored of document.pages()) {
|
|
275
666
|
void ignored;
|
|
276
667
|
pageCount++;
|
|
277
|
-
await
|
|
668
|
+
await yieldTurn2(signal);
|
|
278
669
|
}
|
|
279
670
|
} catch (failure) {
|
|
280
671
|
signal.throwIfAborted();
|
|
281
|
-
if (!(failure instanceof
|
|
672
|
+
if (!(failure instanceof PdfError2)) throw failure;
|
|
282
673
|
if (failure.code === "E_PASSWORD" || failure.code === "E_CAPABILITY" && failure.message === "Invalid PDF password") return await error("Command Line Error: Incorrect password\n", 1);
|
|
283
674
|
if (failure.code !== "E_PARSE") throw failure;
|
|
284
675
|
return await error(`Syntax Error: ${failure.message}
|
|
@@ -291,16 +682,16 @@ async function executeRetainedRawText(context, plan, stdout, signal, maxInputByt
|
|
|
291
682
|
const retained = document;
|
|
292
683
|
let emptyPageWarning = false;
|
|
293
684
|
async function* text() {
|
|
294
|
-
if (plan.bbox) yield* streamTextHtmlStart(
|
|
685
|
+
if (plan.bbox) yield* streamTextHtmlStart((key) => retained.streamInfoValue(key), "doc");
|
|
295
686
|
else if (plan.tsv) yield encoder.encode("level page_num par_num block_num line_num word_num left top width height conf text\n");
|
|
296
687
|
for await (const page of retained.pages()) {
|
|
297
|
-
await
|
|
688
|
+
await yieldTurn2(signal);
|
|
298
689
|
if (page.index + 1 < first) continue;
|
|
299
690
|
if (page.index + 1 > last) break;
|
|
300
691
|
const geometry = await rawGeometry(retained, page, plan);
|
|
301
|
-
if (plan.bbox) {
|
|
302
|
-
const hasWords = yield*
|
|
303
|
-
if (!hasWords && !plan.bboxLayout && !plan.quiet) emptyPageWarning = true;
|
|
692
|
+
if (plan.bbox || plan.tsv && !plan.raw) {
|
|
693
|
+
const hasWords = yield* streamTextGeometryPage(page, storage, geometry, { ...plan, tsv: plan.tsv && !plan.bbox, signal });
|
|
694
|
+
if (plan.bbox && !hasWords && !plan.bboxLayout && !plan.quiet) emptyPageWarning = true;
|
|
304
695
|
continue;
|
|
305
696
|
}
|
|
306
697
|
if (plan.tsv) {
|
|
@@ -312,14 +703,19 @@ async function executeRetainedRawText(context, plan, stdout, signal, maxInputByt
|
|
|
312
703
|
continue;
|
|
313
704
|
}
|
|
314
705
|
const crop = geometry?.crop;
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
706
|
+
const textOptions = { ...crop ? { crop } : {}, rejoinHyphens: !plan.raw && plan.removeHyphens, discardDiagonal: plan.nodiag, clipText: plan.clip, colSpacing: plan.colspacing, fixedPitch: plan.fixed, lineSpacing: plan.linespacing, signal };
|
|
707
|
+
const raw = plan.raw ? page.streamRawText(storage, textOptions) : plan.layout ? page.streamLayoutText(storage, textOptions) : page.streamLogicalText(storage, textOptions);
|
|
708
|
+
let lastByte;
|
|
709
|
+
if (!plan.urls) {
|
|
710
|
+
for await (const bytes of raw) {
|
|
711
|
+
lastByte = bytes.at(-1) ?? lastByte;
|
|
712
|
+
yield bytes;
|
|
713
|
+
}
|
|
714
|
+
} else {
|
|
318
715
|
const names = new PdfNameIndex(storage, Infinity, signal);
|
|
319
716
|
let body, pageFailed = false;
|
|
320
717
|
try {
|
|
321
|
-
body = await
|
|
322
|
-
let lastByte;
|
|
718
|
+
body = await PdfFileSource2.fromStream(storage.fs, directory, raw, { signal });
|
|
323
719
|
for await (const bytes of body.stream(0, body.size, signal)) {
|
|
324
720
|
lastByte = bytes.at(-1) ?? lastByte;
|
|
325
721
|
yield bytes;
|
|
@@ -342,18 +738,22 @@ async function executeRetainedRawText(context, plan, stdout, signal, maxInputByt
|
|
|
342
738
|
}
|
|
343
739
|
}
|
|
344
740
|
}
|
|
741
|
+
if (!plan.raw && lastByte !== void 0) {
|
|
742
|
+
if (lastByte !== 10) yield new Uint8Array([10]);
|
|
743
|
+
if (!plan.layout) yield new Uint8Array([10]);
|
|
744
|
+
}
|
|
345
745
|
if (!plan.nopgbrk) yield new Uint8Array([12]);
|
|
346
746
|
}
|
|
347
747
|
if (plan.bbox) yield encoder.encode("</doc>\n</body>\n</html>\n");
|
|
348
748
|
}
|
|
349
|
-
const formatted = plan.htmlmeta && !plan.bbox ? streamTextHtml(encodePopplerChunks(text(), "UTF-8", plan.tsv ? "unix" : plan.eol),
|
|
350
|
-
result = await
|
|
351
|
-
if (warning || emptyPageWarning) await
|
|
749
|
+
const formatted = plan.htmlmeta && !plan.bbox ? streamTextHtml(encodePopplerChunks(text(), "UTF-8", plan.tsv ? "unix" : plan.eol), (key) => retained.streamInfoValue(key)) : text();
|
|
750
|
+
result = await PdfFileSource2.fromStream(storage.fs, directory, encodePopplerChunks(formatted, plan.encoding, plan.htmlmeta || plan.tsv || plan.bbox ? "unix" : plan.eol), { signal });
|
|
751
|
+
if (warning || emptyPageWarning) await writeBytes2(context.stderr, encoder.encode(warning + (emptyPageWarning ? "no word list\n" : "")), signal);
|
|
352
752
|
if (outputPath === "-") {
|
|
353
|
-
for await (const bytes of result.stream(0, result.size, signal)) await
|
|
753
|
+
for await (const bytes of result.stream(0, result.size, signal)) await writeBytes2(stdout, bytes, signal);
|
|
354
754
|
} else {
|
|
355
755
|
try {
|
|
356
|
-
await
|
|
756
|
+
await publishPdfOutput(context, resolvePath3(context.cwd, outputPath), result.stream(0, result.size, signal), signal);
|
|
357
757
|
} catch (failure) {
|
|
358
758
|
signal.throwIfAborted();
|
|
359
759
|
if (!(failure instanceof Error) || !("code" in failure)) throw failure;
|
|
@@ -376,7 +776,7 @@ async function containsText(source, needle, signal) {
|
|
|
376
776
|
const decoder = new TextDecoder();
|
|
377
777
|
let overlap = "";
|
|
378
778
|
for await (const bytes of source.stream(0, source.size, signal)) {
|
|
379
|
-
await
|
|
779
|
+
await yieldTurn2(signal);
|
|
380
780
|
const text = overlap + decoder.decode(bytes, { stream: true });
|
|
381
781
|
if (text.includes(needle)) return true;
|
|
382
782
|
overlap = needle.length > 1 ? text.slice(-(needle.length - 1)) : "";
|
|
@@ -389,7 +789,7 @@ async function rawGeometry(document, page, plan) {
|
|
|
389
789
|
let current = page.dict, depth = 0;
|
|
390
790
|
const visited = /* @__PURE__ */ new Set();
|
|
391
791
|
while (current) {
|
|
392
|
-
if (++depth > document.depthLimit) throw new
|
|
792
|
+
if (++depth > document.depthLimit) throw new PdfError2("E_LIMIT", "PDF inherited crop depth limit exceeded");
|
|
393
793
|
const candidate = (await document.lookup(dictGet(current, "CropBox")))?.value;
|
|
394
794
|
if (candidate?.kind === "array" && candidate.items.length >= 4) {
|
|
395
795
|
box = [];
|
|
@@ -426,25 +826,15 @@ async function rawGeometry(document, page, plan) {
|
|
|
426
826
|
}
|
|
427
827
|
|
|
428
828
|
// packages/safe-bash-command-pdftotext/src/index.ts
|
|
429
|
-
import {
|
|
430
|
-
import {
|
|
431
|
-
import { InputByteBudget } from "../safe-bash-contracts/io.js";
|
|
432
|
-
import { writeFileOutput as writeFileOutput2 } from "../safe-bash-contracts/filesystem-output-budget.js";
|
|
829
|
+
import { drainCooperativeSteps as drainSteps } from "../safe-bash-contracts/yield.js";
|
|
830
|
+
import { InputByteBudget as InputByteBudget2 } from "../safe-bash-contracts/io.js";
|
|
433
831
|
import {
|
|
434
832
|
commandRuntimeIdentity,
|
|
435
833
|
getCommandArguments
|
|
436
834
|
} from "../safe-bash-contracts/command.js";
|
|
437
|
-
import {
|
|
835
|
+
import { writeBytes as writeBytes3 } from "../safe-bash-contracts/io.js";
|
|
438
836
|
import { createOutputOperation } from "../safe-bash-contracts/output.js";
|
|
439
837
|
import { PdfDocument, decodePdfString, dictGet as dictGet2, extractPageAnnotations, formatExtractedPageText, resolveDestinationPageIndex, encodeJpegSteps, encodePngSteps, extractDocumentImagesSteps } from "../pdf-ast/index.js";
|
|
440
|
-
var SUPPORTED_ENCODINGS = /* @__PURE__ */ new Set([
|
|
441
|
-
"ASCII7",
|
|
442
|
-
"Latin1",
|
|
443
|
-
"UTF-8",
|
|
444
|
-
"UCS-2",
|
|
445
|
-
"Symbol",
|
|
446
|
-
"ZapfDingbats"
|
|
447
|
-
]);
|
|
448
838
|
function parseStrictIntArg(raw) {
|
|
449
839
|
if (!raw || raw.length === 0) return void 0;
|
|
450
840
|
let start = 0;
|
|
@@ -1145,11 +1535,10 @@ function* runPdftotextCliSteps(argv, files, stdinBytes = new Uint8Array(0), sign
|
|
|
1145
1535
|
async function runPdftotextCli(argv, files, stdinBytes = new Uint8Array(0), signal) {
|
|
1146
1536
|
return drainSteps(runPdftotextCliSteps(argv, files, stdinBytes, signal), signal);
|
|
1147
1537
|
}
|
|
1148
|
-
function
|
|
1149
|
-
return !parsed.error && !parsed.listenc && !parsed.version && !parsed.help
|
|
1538
|
+
function usesRetainedText(parsed) {
|
|
1539
|
+
return !parsed.error && !parsed.listenc && !parsed.version && !parsed.help;
|
|
1150
1540
|
}
|
|
1151
1541
|
async function pdftotext(context) {
|
|
1152
|
-
let cooperativeWork = 63;
|
|
1153
1542
|
const invocation = createOutputOperation(context, { write: async () => {
|
|
1154
1543
|
} });
|
|
1155
1544
|
try {
|
|
@@ -1157,105 +1546,39 @@ async function pdftotext(context) {
|
|
|
1157
1546
|
const argv = [...carrier.args];
|
|
1158
1547
|
const parsed = parseArgs(argv);
|
|
1159
1548
|
if (parsed.error || parsed.listenc || parsed.version || parsed.help) {
|
|
1160
|
-
const
|
|
1161
|
-
if (
|
|
1162
|
-
await
|
|
1549
|
+
const res = await drainSteps(extractPdfToTextBytesCooperativelySteps(new Uint8Array(0), argv, invocation.signal), invocation.signal);
|
|
1550
|
+
if (res.stderr) {
|
|
1551
|
+
await writeBytes3(context.stderr, new TextEncoder().encode(res.stderr), invocation.signal);
|
|
1163
1552
|
}
|
|
1164
|
-
if (
|
|
1553
|
+
if (res.output) {
|
|
1165
1554
|
const stdout = invocation.child(context.stdout);
|
|
1166
|
-
await
|
|
1555
|
+
await writeBytes3(stdout.output, new TextEncoder().encode(res.output), invocation.signal);
|
|
1167
1556
|
}
|
|
1168
|
-
return { exitCode: res2.exitCode };
|
|
1169
|
-
}
|
|
1170
|
-
if (usesRetainedRaw(parsed)) {
|
|
1171
|
-
return await executeRetainedRawText(context, parsed, invocation.child(context.stdout).output, invocation.signal);
|
|
1172
|
-
}
|
|
1173
|
-
const inputTarget = parsed.inputFile ?? "-";
|
|
1174
|
-
let pdfBytes;
|
|
1175
|
-
let accountedBytes = 0;
|
|
1176
|
-
const chargeBytes = (delta) => {
|
|
1177
|
-
if (delta > 0) {
|
|
1178
|
-
accountedBytes += delta;
|
|
1179
|
-
context.inputBudget?.check(accountedBytes);
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
if (inputTarget === "-") {
|
|
1183
|
-
const chunks = [];
|
|
1184
|
-
let total = 0;
|
|
1185
|
-
for await (const chunk of readBytes2(context.stdin, invocation.signal)) {
|
|
1186
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1187
|
-
chunks.push(chunk);
|
|
1188
|
-
total += chunk.byteLength;
|
|
1189
|
-
chargeBytes(chunk.byteLength);
|
|
1190
|
-
}
|
|
1191
|
-
pdfBytes = new Uint8Array(total);
|
|
1192
|
-
let offset = 0;
|
|
1193
|
-
for (const c of chunks) {
|
|
1194
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1195
|
-
pdfBytes.set(c, offset);
|
|
1196
|
-
offset += c.byteLength;
|
|
1197
|
-
}
|
|
1198
|
-
} else {
|
|
1199
|
-
const resolvedPath = resolvePath2(context.cwd, inputTarget);
|
|
1200
|
-
try {
|
|
1201
|
-
pdfBytes = await context.fs.readFile(resolvedPath, { signal: invocation.signal });
|
|
1202
|
-
chargeBytes(pdfBytes.byteLength);
|
|
1203
|
-
} catch {
|
|
1204
|
-
if (!parsed.quiet) {
|
|
1205
|
-
const msg = `I/O Error: Couldn't open file '${inputTarget}': No such file or directory.
|
|
1206
|
-
`;
|
|
1207
|
-
await writeBytes2(context.stderr, new TextEncoder().encode(msg), invocation.signal);
|
|
1208
|
-
}
|
|
1209
|
-
return { exitCode: 1 };
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
const res = await drainSteps(extractPdfToTextBytesCooperativelySteps(pdfBytes, argv, invocation.signal), invocation.signal);
|
|
1213
|
-
if (res.stderr) {
|
|
1214
|
-
await writeBytes2(context.stderr, new TextEncoder().encode(res.stderr), invocation.signal);
|
|
1215
|
-
}
|
|
1216
|
-
if (res.exitCode !== 0) {
|
|
1217
1557
|
return { exitCode: res.exitCode };
|
|
1218
1558
|
}
|
|
1219
|
-
|
|
1220
|
-
if (res.outputPath === "-") {
|
|
1221
|
-
const stdout = invocation.child(context.stdout);
|
|
1222
|
-
await writeBytes2(stdout.output, outBytes, invocation.signal);
|
|
1223
|
-
} else {
|
|
1224
|
-
const outResolved = resolvePath2(context.cwd, res.outputPath);
|
|
1225
|
-
try {
|
|
1226
|
-
await writeFileOutput2(context, outBytes, (data) => context.fs.writeFile(outResolved, data, { signal: invocation.signal }));
|
|
1227
|
-
} catch {
|
|
1228
|
-
if (!parsed.quiet) {
|
|
1229
|
-
const msg = `I/O Error: Couldn't open text file '${res.outputPath}'
|
|
1230
|
-
`;
|
|
1231
|
-
await writeBytes2(context.stderr, new TextEncoder().encode(msg), invocation.signal);
|
|
1232
|
-
}
|
|
1233
|
-
return { exitCode: 2 };
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
return { exitCode: 0 };
|
|
1559
|
+
return await executeRetainedText(context, parsed, invocation.child(context.stdout).output, invocation.signal);
|
|
1237
1560
|
} finally {
|
|
1238
1561
|
await invocation.close();
|
|
1239
1562
|
}
|
|
1240
1563
|
}
|
|
1241
1564
|
function createPdftotextCommand(options = {}) {
|
|
1242
|
-
const maxInputBytes =
|
|
1565
|
+
const maxInputBytes = InputByteBudget2.limit(options.limits?.maxInputBytes);
|
|
1243
1566
|
return Object.freeze({
|
|
1244
1567
|
name: "pdftotext",
|
|
1245
1568
|
runtimeIdentity: commandRuntimeIdentity,
|
|
1246
1569
|
description: "Extract PDF text, layout, XHTML bounding boxes, and TSV via @poe-code/pdf-ast",
|
|
1247
1570
|
async execute(context) {
|
|
1248
1571
|
const parsed = parseArgs(getCommandArguments(context).args);
|
|
1249
|
-
if (
|
|
1572
|
+
if (usesRetainedText(parsed)) {
|
|
1250
1573
|
const invocation = createOutputOperation(context, { write: async () => {
|
|
1251
1574
|
} });
|
|
1252
1575
|
try {
|
|
1253
|
-
return await
|
|
1576
|
+
return await executeRetainedText(context, parsed, invocation.child(context.stdout).output, invocation.signal, maxInputBytes);
|
|
1254
1577
|
} finally {
|
|
1255
1578
|
await invocation.close();
|
|
1256
1579
|
}
|
|
1257
1580
|
}
|
|
1258
|
-
return new
|
|
1581
|
+
return new InputByteBudget2(maxInputBytes).run(context, pdftotext);
|
|
1259
1582
|
}
|
|
1260
1583
|
});
|
|
1261
1584
|
}
|
|
@@ -1280,85 +1603,9 @@ function bytesToBase64(bytes) {
|
|
|
1280
1603
|
}
|
|
1281
1604
|
function* runPdftohtmlCliSteps(argv, files, signal) {
|
|
1282
1605
|
let cooperativeWork = 63;
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
let dataUrls = false;
|
|
1287
|
-
let firstPage = 1;
|
|
1288
|
-
let lastPage = 0;
|
|
1289
|
-
let zoom = 1;
|
|
1290
|
-
let imageFmt = "png";
|
|
1291
|
-
let encoding = "UTF-8";
|
|
1292
|
-
let password = "";
|
|
1293
|
-
const positionals = [];
|
|
1294
|
-
for (let i = 0; i < argv.length; i++) {
|
|
1295
|
-
if (++cooperativeWork % 64 === 0)
|
|
1296
|
-
yield;
|
|
1297
|
-
const arg = argv[i];
|
|
1298
|
-
if (arg === "--") {
|
|
1299
|
-
positionals.push(...argv.slice(i + 1));
|
|
1300
|
-
break;
|
|
1301
|
-
}
|
|
1302
|
-
if (arg === "-v" || arg === "--version") {
|
|
1303
|
-
return { exitCode: 0, stdout: "pdftohtml version 24.08.0\n", stderr: "" };
|
|
1304
|
-
}
|
|
1305
|
-
if (arg === "-h" || arg === "-help" || arg === "--help" || arg === "-?") {
|
|
1306
|
-
return {
|
|
1307
|
-
exitCode: 0,
|
|
1308
|
-
stdout: "Usage: pdftohtml [options] <PDF-file> [<html-file>|<xml-file>]\n -xml / -stdout / -s / -i / -noframes / -c / -f <int> / -l <int>\n",
|
|
1309
|
-
stderr: ""
|
|
1310
|
-
};
|
|
1311
|
-
}
|
|
1312
|
-
if (arg === "-xml")
|
|
1313
|
-
xmlMode = true;
|
|
1314
|
-
else if (arg === "-stdout")
|
|
1315
|
-
toStdout = true;
|
|
1316
|
-
else if (arg === "-i")
|
|
1317
|
-
ignoreImages = true;
|
|
1318
|
-
else if (arg === "-dataurls")
|
|
1319
|
-
dataUrls = true;
|
|
1320
|
-
else if (arg === "-f")
|
|
1321
|
-
firstPage = Math.max(1, Number(argv[++i] ?? "1") || 1);
|
|
1322
|
-
else if (arg === "-l")
|
|
1323
|
-
lastPage = Math.max(0, Number(argv[++i] ?? "0") || 0);
|
|
1324
|
-
else if (arg === "-zoom") {
|
|
1325
|
-
const z = Number.parseFloat(argv[++i] ?? "1");
|
|
1326
|
-
if (Number.isFinite(z) && z > 0)
|
|
1327
|
-
zoom = z;
|
|
1328
|
-
} else if (arg === "-fmt") {
|
|
1329
|
-
const fmtVal = (argv[++i] ?? "").toLowerCase();
|
|
1330
|
-
if (fmtVal === "png")
|
|
1331
|
-
imageFmt = "png";
|
|
1332
|
-
else if (fmtVal === "jpg" || fmtVal === "jpeg")
|
|
1333
|
-
imageFmt = "jpg";
|
|
1334
|
-
else {
|
|
1335
|
-
return { exitCode: 99, stdout: "", stderr: `Command Line Error: Invalid image format '${fmtVal}'
|
|
1336
|
-
` };
|
|
1337
|
-
}
|
|
1338
|
-
} else if (arg === "-enc") {
|
|
1339
|
-
const nextEnc = argv[++i] ?? "";
|
|
1340
|
-
if (!SUPPORTED_ENCODINGS.has(nextEnc)) {
|
|
1341
|
-
return { exitCode: 99, stdout: "", stderr: `Command Line Error: Unknown encoding '${nextEnc}'
|
|
1342
|
-
` };
|
|
1343
|
-
}
|
|
1344
|
-
encoding = nextEnc;
|
|
1345
|
-
} else if (arg === "-upw" || arg === "-opw")
|
|
1346
|
-
password = argv[++i] ?? "";
|
|
1347
|
-
else if (arg === "-s" || arg === "-noframes" || arg === "-c" || arg === "-p" || arg === "-q" || arg === "-hidden" || arg === "-nomerge" || arg === "-nodrm") {
|
|
1348
|
-
} else if (!arg.startsWith("-") || arg === "-") {
|
|
1349
|
-
positionals.push(arg);
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
const inputPath = positionals[0] ?? (files.has("-") ? "-" : void 0);
|
|
1353
|
-
if (!inputPath) {
|
|
1354
|
-
return { exitCode: 99, stdout: "", stderr: "Usage: pdftohtml [options] <PDF-file> [<html-file>]\n" };
|
|
1355
|
-
}
|
|
1356
|
-
const explicitOut = positionals[1];
|
|
1357
|
-
const stdoutOutput = toStdout || explicitOut === "-" || inputPath === "-" && !explicitOut;
|
|
1358
|
-
const defaultExt = xmlMode ? ".xml" : ".html";
|
|
1359
|
-
const inputStem = inputPath.toLowerCase().endsWith(".pdf") ? inputPath.slice(0, -4) : inputPath;
|
|
1360
|
-
const outPath = explicitOut ? explicitOut.endsWith(".html") || explicitOut.endsWith(".xml") ? explicitOut : `${explicitOut}${defaultExt}` : inputStem + defaultExt;
|
|
1361
|
-
const imageDirectory = outPath.slice(0, outPath.lastIndexOf("/") + 1);
|
|
1606
|
+
const parsed = parseHtmlArguments(argv, files.has("-"));
|
|
1607
|
+
if ("exitCode" in parsed) return parsed;
|
|
1608
|
+
const { inputPath, outPath, imageDirectory, xmlMode, stdoutOutput, ignoreImages, dataUrls, firstPage, lastPage, zoom, imageFmt, encoding, password } = parsed;
|
|
1362
1609
|
const pdfBytes = files.get(inputPath);
|
|
1363
1610
|
if (!pdfBytes) {
|
|
1364
1611
|
return { exitCode: 1, stdout: "", stderr: `I/O Error: Couldn't open file '${inputPath}'
|
|
@@ -1615,104 +1862,30 @@ function runPdftohtmlCliSync(argv, files, signal) {
|
|
|
1615
1862
|
}
|
|
1616
1863
|
return next.value;
|
|
1617
1864
|
}
|
|
1618
|
-
async function pdftohtml(context) {
|
|
1619
|
-
let cooperativeWork = 63;
|
|
1865
|
+
async function pdftohtml(context, maxInputBytes = Infinity) {
|
|
1620
1866
|
const invocation = createOutputOperation(context, { write: async () => {
|
|
1621
1867
|
} });
|
|
1622
1868
|
try {
|
|
1623
|
-
const
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
accountedBytes += delta;
|
|
1630
|
-
context.inputBudget?.check(accountedBytes);
|
|
1631
|
-
}
|
|
1632
|
-
};
|
|
1633
|
-
let inputOperand;
|
|
1634
|
-
for (let i = 0; i < argv.length; i++) {
|
|
1635
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1636
|
-
const arg = argv[i];
|
|
1637
|
-
if (arg === "--") {
|
|
1638
|
-
inputOperand = argv[i + 1];
|
|
1639
|
-
break;
|
|
1640
|
-
}
|
|
1641
|
-
if (["-f", "-l", "-zoom", "-fmt", "-enc", "-upw", "-opw"].includes(arg)) {
|
|
1642
|
-
i++;
|
|
1643
|
-
} else if (arg === "-" || !arg.startsWith("-")) {
|
|
1644
|
-
inputOperand = arg;
|
|
1645
|
-
break;
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
if (inputOperand === "-") {
|
|
1649
|
-
const chunks = [];
|
|
1650
|
-
let total = 0;
|
|
1651
|
-
for await (const chunk of readBytes2(context.stdin, invocation.signal)) {
|
|
1652
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1653
|
-
chunks.push(chunk);
|
|
1654
|
-
total += chunk.byteLength;
|
|
1655
|
-
chargeBytes(chunk.byteLength);
|
|
1656
|
-
}
|
|
1657
|
-
if (total > 0) {
|
|
1658
|
-
const buf = new Uint8Array(total);
|
|
1659
|
-
let off = 0;
|
|
1660
|
-
for (const c of chunks) {
|
|
1661
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1662
|
-
buf.set(c, off);
|
|
1663
|
-
off += c.byteLength;
|
|
1664
|
-
}
|
|
1665
|
-
vfsFiles.set("-", buf);
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
for (const token of inputOperand && inputOperand !== "-" ? [inputOperand] : []) {
|
|
1669
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1670
|
-
try {
|
|
1671
|
-
const bytes = await context.fs.readFile(resolvePath2(context.cwd, token), { signal: invocation.signal });
|
|
1672
|
-
chargeBytes(bytes.byteLength);
|
|
1673
|
-
vfsFiles.set(token, bytes);
|
|
1674
|
-
} catch {
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
context.inputBudget?.check(0);
|
|
1678
|
-
const existingSnap = new Map(vfsFiles);
|
|
1679
|
-
const res = await runPdftohtmlCli(argv, vfsFiles, invocation.signal);
|
|
1680
|
-
if (res.stderr) {
|
|
1681
|
-
await writeBytes2(context.stderr, new TextEncoder().encode(res.stderr), invocation.signal);
|
|
1682
|
-
}
|
|
1683
|
-
if (res.stdout) {
|
|
1684
|
-
const outBytes = new TextEncoder().encode(res.stdout);
|
|
1685
|
-
const stdout = invocation.child(context.stdout);
|
|
1686
|
-
await writeBytes2(stdout.output, outBytes, invocation.signal);
|
|
1687
|
-
}
|
|
1688
|
-
for (const [key, val] of vfsFiles.entries()) {
|
|
1689
|
-
if (++cooperativeWork % 64 === 0) await yieldTurn2(context.signal);
|
|
1690
|
-
if (existingSnap.get(key) !== val) {
|
|
1691
|
-
const abs = resolvePath2(context.cwd, key);
|
|
1692
|
-
try {
|
|
1693
|
-
await writeFileOutput2(context, val, (data) => context.fs.writeFile(abs, data, { signal: invocation.signal }));
|
|
1694
|
-
} catch (error) {
|
|
1695
|
-
invocation.signal.throwIfAborted();
|
|
1696
|
-
if (!(error instanceof Error) || !("code" in error)) throw error;
|
|
1697
|
-
await writeBytes2(context.stderr, new TextEncoder().encode(`I/O Error: Couldn't open html file '${key}'
|
|
1698
|
-
`), invocation.signal);
|
|
1699
|
-
return { exitCode: 0 };
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1869
|
+
const plan = parseHtmlArguments(getCommandArguments(context).args, true);
|
|
1870
|
+
const stdout = invocation.child(context.stdout);
|
|
1871
|
+
if ("exitCode" in plan) {
|
|
1872
|
+
if (plan.stdout) await writeBytes3(stdout.output, new TextEncoder().encode(plan.stdout), invocation.signal);
|
|
1873
|
+
if (plan.stderr) await writeBytes3(context.stderr, new TextEncoder().encode(plan.stderr), invocation.signal);
|
|
1874
|
+
return { exitCode: plan.exitCode };
|
|
1702
1875
|
}
|
|
1703
|
-
return
|
|
1876
|
+
return await executeRetainedHtml(context, plan, stdout.output, invocation.signal, maxInputBytes);
|
|
1704
1877
|
} finally {
|
|
1705
1878
|
await invocation.close();
|
|
1706
1879
|
}
|
|
1707
1880
|
}
|
|
1708
1881
|
function createPdftohtmlCommand(options = {}) {
|
|
1709
|
-
const maxInputBytes =
|
|
1882
|
+
const maxInputBytes = InputByteBudget2.limit(options.limits?.maxInputBytes);
|
|
1710
1883
|
return Object.freeze({
|
|
1711
1884
|
name: "pdftohtml",
|
|
1712
1885
|
runtimeIdentity: commandRuntimeIdentity,
|
|
1713
1886
|
description: "Convert PDF pages into HTML or XML layout documents via @poe-code/pdf-ast",
|
|
1714
1887
|
execute(context) {
|
|
1715
|
-
return
|
|
1888
|
+
return pdftohtml(context, maxInputBytes);
|
|
1716
1889
|
}
|
|
1717
1890
|
});
|
|
1718
1891
|
}
|