@poe-platform/safe-bash 0.1.816 → 0.1.818
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/pdf-ast/ast.d.ts +2 -0
- package/dist/pdf-ast/content/evaluator.d.ts +11 -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/value-parser.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/resolve.d.ts +5 -1
- 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 +3 -0
- package/dist/pdf-ast/index.js +264 -66845
- 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 +16 -95
- package/dist/pdf-ast/retained-reader.d.ts +109 -0
- package/dist/safe-bash/command-chunks/biff-AYJZR2YV-JPESBEOO.js +5741 -0
- package/dist/safe-bash/command-chunks/{chunk-SL4LD25A.js → chunk-232N24HE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ALD53QFL.js → chunk-2C4QMQQD.js} +42 -12
- package/dist/safe-bash/command-chunks/{chunk-3PM46VWH.js → chunk-2FEMMALH.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-2J4OQT3F.js +153 -0
- package/dist/safe-bash/command-chunks/{chunk-QDV2NIFR.js → chunk-2TMTGVJR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ARE267HR.js → chunk-2WTDP3TP.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-GEDO5V32.js → chunk-2XR7B6DY.js} +602 -211
- package/dist/safe-bash/command-chunks/{chunk-EY3UE26F.js → chunk-2YC6MWQB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UPWLHHZ2.js → chunk-37KBCKDF.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-DOVWHVHI.js → chunk-3B6554G6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-FB2WPI3M.js → chunk-3ZGO24WG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GR4ONCQ5.js → chunk-424NYO35.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MQE77MEQ.js → chunk-45GTHPL5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-AF2IO57Q.js → chunk-4OHTYYNU.js} +8 -136
- package/dist/safe-bash/command-chunks/{chunk-ICJH6A73.js → chunk-4PMMJ45F.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-57PK2QFX.js → chunk-4SFX6YGC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-G3LUT475.js → chunk-4WHTTCKY.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-DBZCTL7C.js → chunk-4Z7PBIMP.js} +20 -18
- package/dist/safe-bash/command-chunks/{chunk-A4P37F3P.js → chunk-57SKL76U.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-J6FNSVHT.js → chunk-5GP4A3TD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-OFONWWEZ.js → chunk-5IHJWBDR.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-A2L3U7DW.js → chunk-5OS4Q3AX.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-FUYZUETI.js → chunk-5PMLTSQ5.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-TXU7MMHN.js → chunk-5RDS6CNQ.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-FR63MJSO.js → chunk-5UGQGB5Y.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-UKAGRRLZ.js → chunk-5VY5O37W.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-5WS6DXYE.js +68444 -0
- 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-EZDWPTYB.js → chunk-6LOAJOWK.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-WMBELKPP.js → chunk-6PE2L522.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-ZAYTFXUX.js → chunk-73KY3MZ3.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-BOVDUJ3A.js → chunk-77WBFVZQ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-3DWFXESW.js → chunk-7GJJDM2F.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WIW3KDBS.js → chunk-7NFICYRU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-35DU6I2M.js → chunk-7ZEGARPB.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-A5SPMSKD.js → chunk-A32PUWYE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KYIGYYEY.js → chunk-A32ZROH5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-IOXMGD2H.js → chunk-ADVQZLLE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CGJ7GMHO.js → chunk-AEZU6NZE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KDDXLHN7.js → chunk-ATHU53C2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-R7LF4XQV.js → chunk-B6T2526I.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PPN53PX3.js → chunk-BB7HBO56.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ZM7HMBAJ.js → chunk-BDGNKRY4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-VMZIAFVJ.js → chunk-BFRSYJUC.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-X42MJT2J.js → chunk-BJL7AGA5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VZTVR3JI.js → chunk-C2QUG7IP.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-IVKAFEPO.js → chunk-C34RLMAC.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-5O45KGW5.js → chunk-C5VUJOUQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LQDANF2B.js → chunk-CCNOZKAK.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-FEBTT5NH.js → chunk-CEHICGP6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SICTBSLW.js → chunk-CODJMTSA.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LJ3UYESS.js → chunk-CP5EO5TT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-45DKGZYO.js → chunk-CSS5KXQC.js} +329 -152
- package/dist/safe-bash/command-chunks/{chunk-6RLWPB44.js → chunk-CZSLXQU2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3ZWFE4CK.js → chunk-D2ZT2UUT.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WH624PKJ.js → chunk-D5XSGHXN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NDALIHKK.js → chunk-D7UFAIBS.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-ISFGPCED.js → chunk-DCKAY6HV.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LNAZ3E4Q.js → chunk-DGCJVZW6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LFSWLJPR.js → chunk-DJB5RB6U.js} +288 -32
- package/dist/safe-bash/command-chunks/{chunk-FGHSE3RZ.js → chunk-DZ4ELL34.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LQX7RAF7.js → chunk-EBKKYRQJ.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-QNETPOMH.js → chunk-EDBNI7WE.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-5GDF5FAS.js → chunk-EEJ3YXVO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RTHYAGKI.js → chunk-ETN25WCR.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ET6LMDEX.js → chunk-EV3DPRWE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-3MUFXGA2.js → chunk-F2JUB7JI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-345YBIHP.js → chunk-F42WV2YO.js} +19 -19
- package/dist/safe-bash/command-chunks/{chunk-FTZFCMVI.js → chunk-FAVWWMFW.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-XBWD6SI3.js → chunk-FDRE535F.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-WMV5224N.js → chunk-FILE5PBI.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XPQUUFQD.js → chunk-FPOM47UA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-QMBMZSJF.js → chunk-FQ2WRT4Q.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-H56BSMFQ.js → chunk-FVAFISPY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2QZUAZTH.js → chunk-GIQUIF6E.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2TWXRJPB.js → chunk-GNORF6RY.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-K7VDCBXW.js → chunk-GPLN6JV2.js} +24 -24
- package/dist/safe-bash/command-chunks/{chunk-DZOKH5BL.js → chunk-GQ7BD75U.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-N4HWOLGZ.js → chunk-GY2C555A.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-N32AP43V.js → chunk-GZNX5SS4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-YPG55QTP.js → chunk-HCJWEB6P.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4ABR3KGK.js → chunk-HNY7LZ5P.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-P462JTNT.js → chunk-HOBXZX23.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-5KZMR6AJ.js → chunk-HW3IOXT6.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3VGQTLO6.js → chunk-HX7QQNWS.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-TXWDR2P4.js → chunk-IBT3OWXB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OHEZQ4QA.js → chunk-IFBLXBBM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-HOJ7WDTS.js → chunk-IJZUUXLL.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-BZRWZ6GO.js → chunk-IKU7ZBF3.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CKIXC7AO.js → chunk-IPKYPADE.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-IWVANZWH.js → chunk-JLPBGKVC.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6M3JTPKE.js → chunk-JNRX5EFF.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-5YL453ZF.js → chunk-JSX5CFZY.js} +36 -36
- package/dist/safe-bash/command-chunks/{chunk-V6JPIZUW.js → chunk-JT656DKZ.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-62RG3GHF.js → chunk-K6E56LND.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-FLSXHLJG.js → chunk-KADQKXZE.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-URQSUMMJ.js → chunk-KFFV7HBL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ONQP4FNV.js → chunk-KZICRCQ7.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-N35IJXBK.js → chunk-L6X4EEN6.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-SHLT5R64.js → chunk-LF7YJ5VQ.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-GMBUOYTN.js → chunk-LNHTLWIL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-A6OTPNNI.js → chunk-LPKMNCC5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MUTARE5I.js → chunk-LSKA4IR4.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-N3ZH4YYH.js → chunk-LTWX23FS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JA36YOZI.js → chunk-LUJUYUOG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4X2MPZXW.js → chunk-M42GCI5F.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-AYQPJQJR.js → chunk-M5BFAMXD.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-OFDJJRAD.js → chunk-M7DZ7COK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-RINR7XPR.js → chunk-MMSKDYK6.js} +234 -8
- package/dist/safe-bash/command-chunks/{chunk-NKK76B4V.js → chunk-MN7EEK6Y.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-OBIXFO25.js → chunk-MOJQT6RW.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-HOKPYTHQ.js → chunk-MPRUGL4W.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CORUUCS2.js → chunk-MRBX4KEP.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-MTWFSBNG.js +137 -0
- package/dist/safe-bash/command-chunks/{chunk-RRAQII52.js → chunk-MURNTGDL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-KDBU5Q2N.js → chunk-MWVELMXZ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-PRO7JOIH.js → chunk-N3MAYM6Y.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-E22EAYJN.js → chunk-NFWLZDMY.js} +177 -34
- 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-ENMJHB2C.js → chunk-NTXRKJPZ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3K5CVXUV.js → chunk-NZF56C25.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-5MNQTHED.js → chunk-OA4MEWTN.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-SWIF6BBY.js → chunk-OL75SBZL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LT2YCGC5.js → chunk-OVQSILY3.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-WDVPHDBH.js → chunk-P57V45F2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-OWCBX5M2.js → chunk-PAY4ULWY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CHZE6FNT.js → chunk-PFUZPAXQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NLCUQD7Y.js → chunk-PX6E5MHY.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-POGVOCOB.js → chunk-QCN7MRRU.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-ZZERSKAR.js → chunk-QLE6JUR7.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LZY46GYY.js → chunk-QMWBKR4C.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-BIJW6QWB.js → chunk-QNLX3CZH.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-MDFNUNK5.js → chunk-QWX5IERU.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-WOL3LBXE.js → chunk-R2N3E267.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZNCPIZCN.js → chunk-R6X63VAO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-FGARVKAX.js → chunk-RNIFPFGC.js} +13 -11
- package/dist/safe-bash/command-chunks/{chunk-OIHQXURE.js → chunk-ROE6KD4C.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-BKK4MS3V.js → chunk-RR6XG2I6.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-RYOHOS2I.js +398 -0
- package/dist/safe-bash/command-chunks/{chunk-4QEJPP3K.js → chunk-S5X7PBO4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IHLZ6HNQ.js → chunk-TSKJNCKD.js} +3 -2
- package/dist/safe-bash/command-chunks/{chunk-U42WHQRH.js → chunk-TTTNFKT6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-EWC56JNI.js → chunk-TTVJJZOM.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-TY7JXEWI.js → chunk-UBX5I5HY.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-QOKFSYD5.js → chunk-UE34SQET.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-DXOXUKQB.js → chunk-UH4CQIU3.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-VNNNVT4C.js → chunk-UZZ2WJQV.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-QNX5LZBK.js → chunk-V6NZVM7C.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-KLAC2MIZ.js → chunk-VEZULAIA.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-OCV5ZU35.js → chunk-VSTAHYCV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UFLMOU3B.js → chunk-VUJCVXD4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5V7WIQ2D.js → chunk-VW67MA53.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-B2C3UPJS.js → chunk-W42SUPD6.js} +13 -1
- package/dist/safe-bash/command-chunks/{chunk-2IMIKROX.js → chunk-WI5NEHPD.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SBXS4S6Y.js → chunk-WJSU2UVG.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VVWHFNHD.js → chunk-WPEIOUJN.js} +415 -25
- package/dist/safe-bash/command-chunks/{chunk-YKODRSGT.js → chunk-WRCYZJNO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TID5TSQW.js → chunk-WRJV7OVO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T4SEQU66.js → chunk-X4TWJNW7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-CKA7ZROU.js → chunk-X6KFCAWZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-ROQ3VNVX.js → chunk-X6KO7D6R.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-S5ER73EA.js → chunk-XB5ZZHFD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FHQOFEQK.js → chunk-XLFOLLUZ.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-UJYXSLM6.js → chunk-XLPEPCQC.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UT5X6QRU.js → chunk-XQFEP43Y.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-Y7XL6CWB.js +771 -0
- package/dist/safe-bash/command-chunks/{chunk-RVWIEXR7.js → chunk-YKEMSPJZ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ERWIJYCS.js → chunk-YN3OEJAZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-6YF2QADH.js → chunk-YOYK2I4N.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-26JE5JEB.js → chunk-YS5ZKMRJ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LMLBQSAM.js → chunk-YW7WU7W2.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-YXR4JE4U.js → chunk-Z33YS3DW.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-T2FRXSQT.js → chunk-ZBXUAM34.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VVV45NLY.js → chunk-ZJUU5IAS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-7OCTMVYJ.js → chunk-ZNABMTV3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6JGICYHP.js → chunk-ZSF2T5D4.js} +1 -1
- package/dist/safe-bash/command-chunks/{command-engine-GHE6QUHU.js → command-engine-PFYHL7GS.js} +14 -4
- package/dist/safe-bash/command-chunks/{engine-RG6HQCCB-FXYZS264.js → engine-5AVSKFBI-D7Q5VPUN.js} +1 -1
- package/dist/safe-bash/command-chunks/model-store-IIWQHSEZ.js +54 -0
- package/dist/safe-bash/command-chunks/odf-SL5TG4B3-XI3FNOTN.js +3041 -0
- package/dist/safe-bash/command-chunks/{xlsx-RE54MFCS-IQ6OXXKK.js → xlsx-RE54MFCS-4UZ5W3U7.js} +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +1 -1
- package/dist/safe-bash-command-apply-patch/index.js +1 -1
- package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
- package/dist/safe-bash-command-awk/awk.js +5 -5
- package/dist/safe-bash-command-awk/index.js +5 -5
- package/dist/safe-bash-command-cp/index.js +4 -4
- package/dist/safe-bash-command-csvkit/index.js +1 -1
- 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-ffmpeg/index.js +1 -1
- 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-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/safejs.js +6 -6
- package/dist/safe-bash-command-node/commands/node/timers.js +2 -2
- package/dist/safe-bash-command-patch/index.js +3 -3
- package/dist/safe-bash-command-patch/patch-formats.js +2 -2
- package/dist/safe-bash-command-patch/patch.js +3 -3
- package/dist/safe-bash-command-patch/unified.js +1 -1
- 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 +538 -379
- package/dist/safe-bash-command-playwright-cli/index.js +19 -19
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +6 -6
- package/dist/safe-bash-command-playwright-cli/playwright/adapter.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +13 -13
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +19 -19
- 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.js +5 -5
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +4 -4
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +3 -3
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-python/executor.js +10 -10
- package/dist/safe-bash-command-python/index.js +10 -10
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-safejs/index.js +2 -2
- package/dist/safe-bash-command-safejs/runtime.js +2 -2
- package/dist/safe-bash-command-ssconvert/index.js +16 -16
- package/dist/safe-bash-command-unzip/index.js +4 -4
- package/dist/safe-bash-docx-engine/ancillary-resources.js +10 -10
- package/dist/safe-bash-docx-engine/batch-operations.js +67 -67
- package/dist/safe-bash-docx-engine/batch-result-schema.js +79 -79
- package/dist/safe-bash-docx-engine/batch.js +78 -78
- 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 +6 -6
- package/dist/safe-bash-docx-engine/command-properties.js +3 -3
- package/dist/safe-bash-docx-engine/comments.js +26 -26
- package/dist/safe-bash-docx-engine/control-bindings.js +21 -21
- 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 +11 -11
- 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 +16 -16
- package/dist/safe-bash-docx-engine/equations.js +17 -17
- 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 +6 -6
- package/dist/safe-bash-docx-engine/image-batch-operations.js +14 -14
- package/dist/safe-bash-docx-engine/image-insertion.js +21 -21
- package/dist/safe-bash-docx-engine/image-layout.js +19 -19
- package/dist/safe-bash-docx-engine/image-replacement.js +22 -22
- package/dist/safe-bash-docx-engine/images.js +19 -19
- package/dist/safe-bash-docx-engine/index.js +111 -111
- package/dist/safe-bash-docx-engine/inspection.js +20 -20
- package/dist/safe-bash-docx-engine/invocation.js +9 -9
- package/dist/safe-bash-docx-engine/io.js +9 -9
- 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 +19 -19
- 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 +22 -22
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +29 -29
- package/dist/safe-bash-docx-engine/paragraph-edit.js +25 -25
- 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 +9 -9
- package/dist/safe-bash-docx-engine/removal.js +21 -21
- package/dist/safe-bash-docx-engine/revision-decisions.js +22 -22
- 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 +34 -34
- package/dist/safe-bash-docx-engine/sections.js +19 -19
- package/dist/safe-bash-docx-engine/settings.js +11 -11
- package/dist/safe-bash-docx-engine/shape-edit.js +21 -21
- package/dist/safe-bash-docx-engine/signatures.js +15 -15
- 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 +27 -27
- 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 +27 -27
- 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 +7 -7
- package/dist/safe-bash-docx-engine/xml-parts.js +22 -22
- package/dist/safe-bash-network-engine/index.js +4 -4
- package/dist/safe-bash-network-engine/transfer.js +12 -12
- package/dist/safe-bash-presentation-engine/accessibility.js +15 -15
- package/dist/safe-bash-presentation-engine/animation-editing.js +5 -5
- package/dist/safe-bash-presentation-engine/animations.js +5 -5
- package/dist/safe-bash-presentation-engine/backgrounds.js +6 -6
- package/dist/safe-bash-presentation-engine/chart-editing.js +18 -18
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +12 -12
- package/dist/safe-bash-presentation-engine/charts.js +15 -15
- package/dist/safe-bash-presentation-engine/command-placeholder.js +39 -38
- package/dist/safe-bash-presentation-engine/comments.js +6 -6
- package/dist/safe-bash-presentation-engine/connector-operations.js +16 -16
- package/dist/safe-bash-presentation-engine/connectors.js +13 -13
- package/dist/safe-bash-presentation-engine/diff.js +21 -20
- package/dist/safe-bash-presentation-engine/drawing-format.js +7 -7
- package/dist/safe-bash-presentation-engine/drawing-operations.js +15 -15
- package/dist/safe-bash-presentation-engine/drawing-schema.js +8 -8
- package/dist/safe-bash-presentation-engine/equations.js +6 -6
- package/dist/safe-bash-presentation-engine/fields.js +6 -6
- package/dist/safe-bash-presentation-engine/image-extraction.js +7 -7
- package/dist/safe-bash-presentation-engine/image-formatting.js +16 -16
- package/dist/safe-bash-presentation-engine/image-insertion.js +6 -6
- package/dist/safe-bash-presentation-engine/image-replacement.js +7 -7
- package/dist/safe-bash-presentation-engine/images.js +6 -6
- package/dist/safe-bash-presentation-engine/index.js +96 -95
- package/dist/safe-bash-presentation-engine/layouts.js +5 -5
- package/dist/safe-bash-presentation-engine/links.js +5 -5
- package/dist/safe-bash-presentation-engine/masters.js +4 -4
- package/dist/safe-bash-presentation-engine/media-editing.js +10 -10
- package/dist/safe-bash-presentation-engine/media-extraction.js +6 -6
- package/dist/safe-bash-presentation-engine/media.js +5 -5
- package/dist/safe-bash-presentation-engine/memberships.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/memberships.js +12 -6
- package/dist/safe-bash-presentation-engine/notes.js +6 -6
- package/dist/safe-bash-presentation-engine/ole-insertion.js +6 -6
- package/dist/safe-bash-presentation-engine/opaque-objects.js +2 -2
- package/dist/safe-bash-presentation-engine/package-tools.js +6 -6
- package/dist/safe-bash-presentation-engine/presentation-model.js +38 -37
- package/dist/safe-bash-presentation-engine/presentation-settings.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/presentation-settings.js +12 -5
- package/dist/safe-bash-presentation-engine/properties.js +7 -6
- package/dist/safe-bash-presentation-engine/retained-inspection.js +3 -3
- package/dist/safe-bash-presentation-engine/retained-memberships.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-presentation-settings.d.ts +25 -0
- package/dist/safe-bash-presentation-engine/retained-tags.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 +17 -15
- package/dist/safe-bash-presentation-engine/sanitize.js +8 -7
- package/dist/safe-bash-presentation-engine/selectors.js +2 -2
- package/dist/safe-bash-presentation-engine/shape-groups.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-operations.js +14 -14
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +16 -16
- package/dist/safe-bash-presentation-engine/shape-paths.js +5 -5
- package/dist/safe-bash-presentation-engine/shape-selection.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-transforms.js +5 -5
- package/dist/safe-bash-presentation-engine/shapes.js +11 -11
- package/dist/safe-bash-presentation-engine/slide-copy.js +7 -5
- package/dist/safe-bash-presentation-engine/slide-import.js +6 -6
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +8 -8
- package/dist/safe-bash-presentation-engine/slide-model.js +24 -24
- package/dist/safe-bash-presentation-engine/slide-removal.js +7 -7
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +2 -2
- package/dist/safe-bash-presentation-engine/slides.js +5 -5
- package/dist/safe-bash-presentation-engine/table-operations.js +17 -17
- package/dist/safe-bash-presentation-engine/table-spans.js +16 -16
- package/dist/safe-bash-presentation-engine/tables.js +15 -15
- package/dist/safe-bash-presentation-engine/tags.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/tags.js +15 -7
- package/dist/safe-bash-presentation-engine/template-bindings.js +16 -16
- package/dist/safe-bash-presentation-engine/template-repeat.js +24 -22
- package/dist/safe-bash-presentation-engine/text-fitting.js +11 -11
- package/dist/safe-bash-presentation-engine/text-frames.js +11 -11
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +11 -11
- package/dist/safe-bash-presentation-engine/text-reading.js +3 -3
- package/dist/safe-bash-presentation-engine/text-replacement.js +6 -6
- package/dist/safe-bash-presentation-engine/text-runs.js +8 -8
- package/dist/safe-bash-presentation-engine/themes.js +5 -5
- package/dist/safe-bash-presentation-engine/transitions.js +5 -5
- package/dist/safe-bash-presentation-engine/validation.js +2 -2
- package/dist/safe-bash-presentation-engine/xml-parts.js +5 -5
- package/dist/safe-bash-xml-engine/document.js +2 -2
- package/dist/safe-bash-xml-engine/index.js +2 -2
- package/dist/safe-bash-xml-engine/recovery.d.ts +6 -2
- package/dist/safe-bash-xml-engine/stored-document.d.ts +3 -0
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +2 -2
- package/dist/safe-bash-xml-engine/stored-map.d.ts +21 -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/safety.js +1 -1
- package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
- package/dist/safe-bash-zip-engine/zip/volumes.js +1 -1
- package/dist/safe-bash-zip-engine/zip-format.js +3 -3
- 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 +9 -7
- 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 +36 -30
- package/dist/spreadsheet-format-xls/biff-properties-write.js +16 -7
- package/dist/spreadsheet-format-xls/biff-properties.d.ts +4 -2
- package/dist/spreadsheet-format-xls/biff-properties.js +141 -122
- package/dist/spreadsheet-format-xls/biff-property-names.d.ts +27 -0
- package/dist/spreadsheet-format-xls/biff-property-names.js +210 -0
- package/dist/spreadsheet-format-xls/biff-property-observations.d.ts +33 -0
- package/dist/spreadsheet-format-xls/biff-property-observations.js +160 -0
- package/dist/xlsx-ast/comment-geometry.js +1 -1
- package/package.json +7 -4
- 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/command-chunks/biff-UBP2BZLK-JPODPKS3.js +0 -5448
- package/dist/safe-bash/command-chunks/chunk-6EZWG56T.js +0 -455
- package/dist/safe-bash/command-chunks/chunk-O2HNOQQG.js +0 -161
- package/dist/safe-bash/command-chunks/chunk-ZUP5TBRG.js +0 -99
- package/dist/safe-bash/command-chunks/model-store-I7YAWL5V.js +0 -54
- package/dist/safe-bash/command-chunks/odf-3EA3EVSD-7B5GVNTC.js +0 -3097
- package/dist/safe-bash/command-chunks/{chunk-SRXARACJ.js → chunk-3TP4SSPS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-NCNHJRIY.js → chunk-3W3HLPCX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-P4OWVKMD.js → chunk-BQXKO3X7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OCOJMKDP.js → chunk-CVMHDJ7J.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-WVD5WZXD.js → chunk-FPNUGKCX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6W4RMBFH.js → chunk-N6VNHC3B.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-M3OXQXCU.js → chunk-NBRXQUK7.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-LECGQSQW.js → chunk-SF56V6QK.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2ANW3FXH.js → chunk-U33GIOUY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5QXRIZSS.js → chunk-V3NKL42J.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/{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,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
flags
|
|
3
|
-
} from "./chunk-QFFJN22S.js";
|
|
4
1
|
import {
|
|
5
2
|
contextual,
|
|
6
3
|
normal
|
|
7
4
|
} from "./chunk-AHZ7UGNB.js";
|
|
5
|
+
import {
|
|
6
|
+
flags
|
|
7
|
+
} from "./chunk-QFFJN22S.js";
|
|
8
8
|
import {
|
|
9
9
|
colorText,
|
|
10
10
|
expandTabs,
|
|
@@ -15,19 +15,547 @@ import {
|
|
|
15
15
|
sideBySide
|
|
16
16
|
} from "./chunk-VXIC7SS3.js";
|
|
17
17
|
|
|
18
|
+
// packages/safe-bash-command-diff/src/stored-exclusions.ts
|
|
19
|
+
import { PagedStorage as PagedStorage2, PagedStorageCache } from "@poe-platform/safe-fs/storage";
|
|
20
|
+
import { IndexedDocument, closeDocumentResources } from "../../safe-bash-diff-engine/document.js";
|
|
21
|
+
import { inspect, ToolError as ToolError2 } from "../../safe-bash-diff-engine/shared.js";
|
|
22
|
+
import { pathOf } from "../../safe-bash-io-engine/internal.js";
|
|
23
|
+
|
|
24
|
+
// packages/safe-bash-command-diff/src/stored-glob.ts
|
|
25
|
+
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
26
|
+
import { ToolError } from "../../safe-bash-diff-engine/shared.js";
|
|
27
|
+
var GlobText = class {
|
|
28
|
+
constructor(storage, offset, length, budget) {
|
|
29
|
+
this.storage = storage;
|
|
30
|
+
this.offset = offset;
|
|
31
|
+
this.length = length;
|
|
32
|
+
this.budget = budget;
|
|
33
|
+
}
|
|
34
|
+
storage;
|
|
35
|
+
offset;
|
|
36
|
+
length;
|
|
37
|
+
budget;
|
|
38
|
+
start = -1;
|
|
39
|
+
bytes = new Uint8Array();
|
|
40
|
+
async at(index) {
|
|
41
|
+
if (index < 0 || index >= this.length) return "";
|
|
42
|
+
this.budget.step();
|
|
43
|
+
const pause = this.budget.checkpoint();
|
|
44
|
+
if (pause) await pause;
|
|
45
|
+
if (index < this.start || index >= this.start + this.bytes.length) {
|
|
46
|
+
this.start = Math.floor(index / 16384) * 16384;
|
|
47
|
+
this.bytes = await this.storage.read(this.offset + this.start, Math.min(16384, this.length - this.start));
|
|
48
|
+
}
|
|
49
|
+
return String.fromCharCode(this.bytes[index - this.start]);
|
|
50
|
+
}
|
|
51
|
+
async find(text, start) {
|
|
52
|
+
for (let index = start; index + text.length <= this.length; index++) {
|
|
53
|
+
let same = true;
|
|
54
|
+
for (let part = 0; part < text.length; part++) if (await this.at(index + part) !== text[part]) {
|
|
55
|
+
same = false;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
if (same) return index;
|
|
59
|
+
}
|
|
60
|
+
return -1;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var RegexWriter = class {
|
|
64
|
+
constructor(storage) {
|
|
65
|
+
this.storage = storage;
|
|
66
|
+
}
|
|
67
|
+
storage;
|
|
68
|
+
bytes = new Uint8Array(4096);
|
|
69
|
+
used = 0;
|
|
70
|
+
length = 0;
|
|
71
|
+
async add(text) {
|
|
72
|
+
for (let index = 0; index < text.length; index++) {
|
|
73
|
+
this.bytes[this.used++] = text.charCodeAt(index);
|
|
74
|
+
this.length++;
|
|
75
|
+
if (this.used === this.bytes.length) await this.flush();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async flush() {
|
|
79
|
+
if (this.used) {
|
|
80
|
+
await this.storage.append(this.bytes.subarray(0, this.used));
|
|
81
|
+
this.used = 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
async function translate(source, ignoreCase, output) {
|
|
86
|
+
const opposite = (ch) => !ignoreCase ? "" : ch >= "A" && ch <= "Z" ? ch.toLowerCase() : ch >= "a" && ch <= "z" ? ch.toUpperCase() : "";
|
|
87
|
+
await output.add("^");
|
|
88
|
+
for (let index = 0; index < source.length; index++) {
|
|
89
|
+
const ch = await source.at(index);
|
|
90
|
+
if (ch === "\\" && index + 1 < source.length) {
|
|
91
|
+
const literal = await source.at(++index);
|
|
92
|
+
await output.add(opposite(literal) ? `[${literal}${opposite(literal)}]` : `\\${literal}`);
|
|
93
|
+
} else if (ch === "[") {
|
|
94
|
+
let end = index + 1;
|
|
95
|
+
const negated = "!^".includes(await source.at(end)) && end < source.length;
|
|
96
|
+
if (negated) end++;
|
|
97
|
+
if (await source.at(end) === "]") end++;
|
|
98
|
+
while (end < source.length && await source.at(end) !== "]") {
|
|
99
|
+
if (await source.at(end) === "\\" && end + 1 < source.length) end += 2;
|
|
100
|
+
else if (await source.at(end) === "[" && await source.at(end + 1) === ":") {
|
|
101
|
+
const closing = await source.find(":]", end + 2);
|
|
102
|
+
if (closing < 0) break;
|
|
103
|
+
end = closing + 2;
|
|
104
|
+
} else end++;
|
|
105
|
+
}
|
|
106
|
+
if (await source.at(end) !== "]") {
|
|
107
|
+
await output.add("\\[");
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const literal = (value) => "\\]^-".includes(value) ? `\\${value}` : value;
|
|
111
|
+
const render = async (emit) => {
|
|
112
|
+
for (let scan = index + 1 + Number(negated); scan < end; scan++) {
|
|
113
|
+
if (await source.at(scan) === "[" && await source.at(scan + 1) === ":") {
|
|
114
|
+
const closing = await source.find(":]", scan + 2) + 1;
|
|
115
|
+
for (; scan <= closing; scan++) await emit(await source.at(scan));
|
|
116
|
+
scan--;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (await source.at(scan) === "\\" && scan + 1 < end) scan++;
|
|
120
|
+
let first = await source.at(scan);
|
|
121
|
+
if (ignoreCase && first >= "A" && first <= "Z") first = first.toLowerCase();
|
|
122
|
+
if (await source.at(scan + 1) === "-" && scan + 2 < end) {
|
|
123
|
+
let last = await source.at(scan + 2);
|
|
124
|
+
if (ignoreCase && last >= "A" && last <= "Z") last = last.toLowerCase();
|
|
125
|
+
for (let code = first.charCodeAt(0); code <= last.charCodeAt(0); code++) {
|
|
126
|
+
const value = String.fromCharCode(code);
|
|
127
|
+
await emit(literal(value) + opposite(value));
|
|
128
|
+
}
|
|
129
|
+
scan += 2;
|
|
130
|
+
} else await emit(literal(first) + opposite(first));
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
let size = 0;
|
|
134
|
+
await render(async (text) => {
|
|
135
|
+
size += text.length;
|
|
136
|
+
});
|
|
137
|
+
if (size) {
|
|
138
|
+
await output.add(negated ? "[^" : "[");
|
|
139
|
+
await render((text) => output.add(text));
|
|
140
|
+
await output.add("]");
|
|
141
|
+
} else await output.add(negated ? "[\0-\xFF]" : "[^\0-\xFF]");
|
|
142
|
+
index = end;
|
|
143
|
+
} else if (ch === "*") await output.add(".*");
|
|
144
|
+
else if (ch === "?") await output.add(".");
|
|
145
|
+
else await output.add(opposite(ch) ? `[${ch}${opposite(ch)}]` : ".^$+(){}|]".includes(ch) ? `\\${ch}` : ch);
|
|
146
|
+
}
|
|
147
|
+
await output.add("$");
|
|
148
|
+
await output.flush();
|
|
149
|
+
}
|
|
150
|
+
var word = (byte) => byte !== void 0 && (byte >= 48 && byte <= 57 || byte >= 65 && byte <= 90 || byte >= 97 && byte <= 122 || byte === 95);
|
|
151
|
+
var classes = {
|
|
152
|
+
alpha: (byte) => byte >= 65 && byte <= 90 || byte >= 97 && byte <= 122,
|
|
153
|
+
alnum: (byte) => byte >= 48 && byte <= 57 || byte >= 65 && byte <= 90 || byte >= 97 && byte <= 122,
|
|
154
|
+
digit: (byte) => byte >= 48 && byte <= 57,
|
|
155
|
+
lower: (byte) => byte >= 97 && byte <= 122,
|
|
156
|
+
upper: (byte) => byte >= 65 && byte <= 90,
|
|
157
|
+
xdigit: (byte) => byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102,
|
|
158
|
+
space: (byte) => " \n\r\v\f".includes(String.fromCharCode(byte)),
|
|
159
|
+
blank: (byte) => byte === 32 || byte === 9,
|
|
160
|
+
cntrl: (byte) => byte < 32 || byte === 127,
|
|
161
|
+
graph: (byte) => byte >= 33 && byte <= 126,
|
|
162
|
+
print: (byte) => byte >= 32 && byte <= 126,
|
|
163
|
+
punct: (byte) => byte >= 33 && byte <= 47 || byte >= 58 && byte <= 64 || byte >= 91 && byte <= 96 || byte >= 123 && byte <= 126
|
|
164
|
+
};
|
|
165
|
+
var shorthand = (reference, byte) => {
|
|
166
|
+
const lower = reference.toLowerCase(), accepted = lower === "d" ? classes.digit(byte) : lower === "s" ? classes.space(byte) : word(byte);
|
|
167
|
+
return reference === lower ? accepted : !accepted;
|
|
168
|
+
};
|
|
169
|
+
async function compileGlob(source, ignoreCase, tokens, budget, cache) {
|
|
170
|
+
const translated = new PagedStorage(budget.context, 16, cache), writer = new RegexWriter(translated);
|
|
171
|
+
try {
|
|
172
|
+
await translate(source, ignoreCase, writer);
|
|
173
|
+
const text = new GlobText(translated, 8, writer.length, budget);
|
|
174
|
+
let position = 0, count = 0;
|
|
175
|
+
const escaped = async () => {
|
|
176
|
+
const ch = await text.at(position++);
|
|
177
|
+
if (!ch) throw new ToolError("trailing backslash in regular expression");
|
|
178
|
+
const octal = "01234567".includes(ch);
|
|
179
|
+
if (octal || ch === "x") {
|
|
180
|
+
let digits = octal ? ch : "";
|
|
181
|
+
const alphabet = octal ? "01234567" : "0123456789abcdefABCDEF";
|
|
182
|
+
while (digits.length < (octal ? 3 : 2) && position < text.length && alphabet.includes(await text.at(position))) digits += await text.at(position++);
|
|
183
|
+
return digits ? parseInt(digits, octal ? 8 : 16) & 255 : ch.charCodeAt(0);
|
|
184
|
+
}
|
|
185
|
+
return { n: 10, t: 9, r: 13, f: 12, v: 11, a: 7, b: 8 }[ch] ?? ch.charCodeAt(0);
|
|
186
|
+
};
|
|
187
|
+
while (position < text.length) {
|
|
188
|
+
const cell = new Uint8Array(40), set = (byte) => {
|
|
189
|
+
cell[8 + (byte >>> 3)] |= 1 << (byte & 7);
|
|
190
|
+
};
|
|
191
|
+
const ch = await text.at(position++);
|
|
192
|
+
if (ch === "^") cell[0] = 2;
|
|
193
|
+
else if (ch === "$") cell[0] = 3;
|
|
194
|
+
else if (ch === ".") {
|
|
195
|
+
for (let byte = 0; byte < 256; byte++) if (byte !== 10) set(byte);
|
|
196
|
+
if (await text.at(position) === "*") {
|
|
197
|
+
cell[0] = 1;
|
|
198
|
+
position++;
|
|
199
|
+
}
|
|
200
|
+
} else if (ch === "[") {
|
|
201
|
+
const negate = await text.at(position) === "^";
|
|
202
|
+
if (negate) position++;
|
|
203
|
+
let first = true;
|
|
204
|
+
while (position < text.length && (await text.at(position) !== "]" || first)) {
|
|
205
|
+
first = false;
|
|
206
|
+
if (await text.at(position) === "[" && await text.at(position + 1) === ":") {
|
|
207
|
+
position += 2;
|
|
208
|
+
let name = "";
|
|
209
|
+
while (position < text.length && !(await text.at(position) === ":" && await text.at(position + 1) === "]")) {
|
|
210
|
+
const ch2 = await text.at(position++);
|
|
211
|
+
if (name.length < 1001) name += ch2;
|
|
212
|
+
}
|
|
213
|
+
if (!classes[name]) throw new ToolError(`unsupported character class '${name}'`);
|
|
214
|
+
for (let byte = 0; byte < 256; byte++) if (classes[name](byte)) set(byte);
|
|
215
|
+
position += 2;
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
if (await text.at(position) === "[" && [".", "="].includes(await text.at(position + 1))) throw new ToolError("collating and equivalence classes are not supported");
|
|
219
|
+
if (await text.at(position) === "\\" && "dDsSwW".includes(await text.at(position + 1)) && position + 1 < text.length) {
|
|
220
|
+
const reference = await text.at(position + 1);
|
|
221
|
+
position += 2;
|
|
222
|
+
for (let byte = 0; byte < 256; byte++) if (shorthand(reference, byte)) set(byte);
|
|
223
|
+
if (await text.at(position) === "-" && await text.at(position + 1) !== "]") throw new ToolError("character class cannot be a range endpoint");
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const readChar = async () => await text.at(position++) === "\\" ? escaped() : (await text.at(position - 1)).charCodeAt(0);
|
|
227
|
+
const start = await readChar();
|
|
228
|
+
if (await text.at(position) === "-" && position + 1 < text.length && await text.at(position + 1) !== "]") {
|
|
229
|
+
position++;
|
|
230
|
+
const end = await readChar();
|
|
231
|
+
if (start > end) throw new ToolError("reversed character range");
|
|
232
|
+
for (let byte = start; byte <= end; byte++) set(byte);
|
|
233
|
+
} else set(start);
|
|
234
|
+
}
|
|
235
|
+
if (await text.at(position++) !== "]") throw new ToolError("unterminated bracket expression");
|
|
236
|
+
if (negate) for (let index = 8; index < 40; index++) cell[index] ^= 255;
|
|
237
|
+
} else if (ch === "\\") {
|
|
238
|
+
const reference = await text.at(position);
|
|
239
|
+
if (["B", "y", "Y", "<", ">"].includes(reference)) {
|
|
240
|
+
cell[0] = reference === "y" ? 4 : reference === "B" || reference === "Y" ? 5 : reference === "<" ? 6 : 7;
|
|
241
|
+
position++;
|
|
242
|
+
} else if ("dDsSwW".includes(reference) && reference) {
|
|
243
|
+
position++;
|
|
244
|
+
for (let byte = 0; byte < 256; byte++) if (shorthand(reference, byte)) set(byte);
|
|
245
|
+
} else set(await escaped());
|
|
246
|
+
} else set(ch.charCodeAt(0));
|
|
247
|
+
await tokens.append(cell);
|
|
248
|
+
count++;
|
|
249
|
+
}
|
|
250
|
+
return count;
|
|
251
|
+
} finally {
|
|
252
|
+
await translated.close();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async function matchesGlob(tokens, start, count, name, budget) {
|
|
256
|
+
let token = 0, position = 0, star = -1, retry = 0;
|
|
257
|
+
while (token < count) {
|
|
258
|
+
budget.step();
|
|
259
|
+
const pause = budget.checkpoint();
|
|
260
|
+
if (pause) await pause;
|
|
261
|
+
const cell = await tokens.read(start + token * 40, 40), kind = cell[0];
|
|
262
|
+
if (kind === 1) {
|
|
263
|
+
star = token++;
|
|
264
|
+
retry = position;
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
const before = word(name[position - 1]), after = word(name[position]);
|
|
268
|
+
const accepted = kind === 2 ? position === 0 : kind === 3 ? position === name.length : kind === 4 ? before !== after : kind === 5 ? before === after : kind === 6 ? !before && after : kind === 7 ? before && !after : position < name.length && !!(cell[8 + (name[position] >>> 3)] & 1 << (name[position] & 7));
|
|
269
|
+
if (accepted) {
|
|
270
|
+
if (kind === 0) position++;
|
|
271
|
+
token++;
|
|
272
|
+
} else if (star >= 0 && retry < name.length && name[retry] !== 10) {
|
|
273
|
+
position = ++retry;
|
|
274
|
+
token = star + 1;
|
|
275
|
+
} else return false;
|
|
276
|
+
}
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// packages/safe-bash-command-diff/src/stored-exclusions.ts
|
|
281
|
+
var StoredExclusions = class {
|
|
282
|
+
constructor(budget) {
|
|
283
|
+
this.budget = budget;
|
|
284
|
+
this.tokens = new PagedStorage2(budget.context, 16, this.cache);
|
|
285
|
+
this.patterns = new PagedStorage2(budget.context, 16, this.cache);
|
|
286
|
+
}
|
|
287
|
+
budget;
|
|
288
|
+
cache = new PagedStorageCache(16);
|
|
289
|
+
tokens;
|
|
290
|
+
patterns;
|
|
291
|
+
count = 0;
|
|
292
|
+
bytes = 0;
|
|
293
|
+
document() {
|
|
294
|
+
return new IndexedDocument({
|
|
295
|
+
context: this.budget.context,
|
|
296
|
+
documentCache: this.cache,
|
|
297
|
+
step: this.budget.step.bind(this.budget),
|
|
298
|
+
checkpoint: this.budget.checkpoint.bind(this.budget)
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
async append(document, start, end, ignoreCase) {
|
|
302
|
+
if (this.count >= this.budget.limits.maxExcludePatterns) throw new ToolError2("exclusion pattern count limit exceeded");
|
|
303
|
+
if (end - start > this.budget.limits.maxExcludePatternBytes - this.bytes) throw new ToolError2("exclusion pattern byte limit exceeded");
|
|
304
|
+
this.bytes += end - start;
|
|
305
|
+
const position = this.tokens.allocate(0);
|
|
306
|
+
const count = await compileGlob(new GlobText(document.data, 8 + start, end - start, this.budget), ignoreCase, this.tokens, this.budget, this.cache);
|
|
307
|
+
const cell = new Uint8Array(16), view = new DataView(cell.buffer);
|
|
308
|
+
view.setFloat64(0, position, true);
|
|
309
|
+
view.setFloat64(8, count, true);
|
|
310
|
+
await this.patterns.append(cell);
|
|
311
|
+
this.count++;
|
|
312
|
+
}
|
|
313
|
+
async load(options) {
|
|
314
|
+
for (const { pattern, ignoreCase } of options.excludes) {
|
|
315
|
+
const document = this.document();
|
|
316
|
+
try {
|
|
317
|
+
await document.load({ async *[Symbol.asyncIterator]() {
|
|
318
|
+
for (let start = 0; start < pattern.length; ) {
|
|
319
|
+
let end = Math.min(start + 4096, pattern.length);
|
|
320
|
+
const last = pattern.charCodeAt(end - 1);
|
|
321
|
+
if (end < pattern.length && last >= 55296 && last <= 56319) end--;
|
|
322
|
+
yield new TextEncoder().encode(pattern.slice(start, end));
|
|
323
|
+
start = end;
|
|
324
|
+
}
|
|
325
|
+
} });
|
|
326
|
+
await this.append(document, 0, document.size, ignoreCase);
|
|
327
|
+
} finally {
|
|
328
|
+
await document.close();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
for (const { path, ignoreCase } of options.excludeFiles) {
|
|
332
|
+
this.budget.inspected.clear();
|
|
333
|
+
if (path !== "-") await inspect(this.budget, path, "follow");
|
|
334
|
+
const document = this.document();
|
|
335
|
+
try {
|
|
336
|
+
await document.load(path === "-" ? this.budget.stdinSource() : this.budget.diffSource(pathOf(this.budget.context, path)));
|
|
337
|
+
if (document.binary) throw new ToolError2("binary input is unsupported (NUL byte)");
|
|
338
|
+
if (!document.validUtf8) throw new ToolError2("binary input is unsupported (invalid UTF-8)");
|
|
339
|
+
for (let index = 0; index < document.length; index++) {
|
|
340
|
+
const line2 = await document.line(index);
|
|
341
|
+
const end = (await document.data.read(8 + line2.end - 1, 1))[0] === 10 ? line2.end - 1 : line2.end;
|
|
342
|
+
if (end > line2.start) await this.append(document, line2.start, end, ignoreCase);
|
|
343
|
+
else {
|
|
344
|
+
this.budget.step();
|
|
345
|
+
const pause = this.budget.checkpoint();
|
|
346
|
+
if (pause) await pause;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
} finally {
|
|
350
|
+
await document.close();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
async matches(name) {
|
|
355
|
+
if (!this.count) return false;
|
|
356
|
+
const bytes = new TextEncoder().encode(name);
|
|
357
|
+
for (let index = 0; index < this.count; index++) {
|
|
358
|
+
const cell = await this.patterns.read(8 + index * 16, 16), view = new DataView(cell.buffer, cell.byteOffset, cell.byteLength);
|
|
359
|
+
if (await matchesGlob(this.tokens, view.getFloat64(0, true), view.getFloat64(8, true), bytes, this.budget)) return true;
|
|
360
|
+
}
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
close() {
|
|
364
|
+
return closeDocumentResources([this.tokens, this.patterns]);
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
// packages/safe-bash-command-diff/src/stored-directory.ts
|
|
369
|
+
import { PagedStorage as PagedStorage3, PagedStorageCache as PagedStorageCache2 } from "@poe-platform/safe-fs/storage";
|
|
370
|
+
import { closeDocumentResources as closeDocumentResources2 } from "../../safe-bash-diff-engine/document.js";
|
|
371
|
+
import { host, ToolError as ToolError3 } from "../../safe-bash-diff-engine/shared.js";
|
|
372
|
+
import { pathOf as pathOf2 } from "../../safe-bash-io-engine/internal.js";
|
|
373
|
+
import { FsError } from "../../safe-bash-contracts/index.js";
|
|
374
|
+
var Rows = class {
|
|
375
|
+
constructor(budget, cache) {
|
|
376
|
+
this.budget = budget;
|
|
377
|
+
this.data = new PagedStorage3(budget.context, 16, cache);
|
|
378
|
+
this.index = new PagedStorage3(budget.context, 16, cache);
|
|
379
|
+
}
|
|
380
|
+
budget;
|
|
381
|
+
data;
|
|
382
|
+
index;
|
|
383
|
+
length = 0;
|
|
384
|
+
base = 8;
|
|
385
|
+
async append(row) {
|
|
386
|
+
const text = JSON.stringify(row), start = this.data.allocate(0);
|
|
387
|
+
for (let offset = 0; offset < text.length; ) {
|
|
388
|
+
let end = Math.min(text.length, offset + 4096);
|
|
389
|
+
const last = text.charCodeAt(end - 1);
|
|
390
|
+
if (last >= 55296 && last <= 56319 && end < text.length) end--;
|
|
391
|
+
await this.data.append(new TextEncoder().encode(text.slice(offset, end)));
|
|
392
|
+
offset = end;
|
|
393
|
+
}
|
|
394
|
+
const cell = new Uint8Array(24), view = new DataView(cell.buffer);
|
|
395
|
+
view.setFloat64(0, start, true);
|
|
396
|
+
view.setFloat64(8, this.data.allocate(0) - start, true);
|
|
397
|
+
await this.index.append(cell);
|
|
398
|
+
this.length++;
|
|
399
|
+
}
|
|
400
|
+
async read(position) {
|
|
401
|
+
this.budget.step();
|
|
402
|
+
const pause = this.budget.checkpoint();
|
|
403
|
+
if (pause) await pause;
|
|
404
|
+
const cell = await this.index.read(this.base + position * 24, 16), view = new DataView(cell.buffer, cell.byteOffset, cell.byteLength);
|
|
405
|
+
const start = view.getFloat64(0, true), end = start + view.getFloat64(8, true), decoder = new TextDecoder();
|
|
406
|
+
let text = "";
|
|
407
|
+
for (let offset = start; offset < end; offset += 16384) text += decoder.decode(await this.data.read(offset, Math.min(16384, end - offset)), { stream: true });
|
|
408
|
+
return JSON.parse(text + decoder.decode());
|
|
409
|
+
}
|
|
410
|
+
async mark(position) {
|
|
411
|
+
await this.index.write(this.base + position * 24 + 16, new Uint8Array([1]));
|
|
412
|
+
}
|
|
413
|
+
async marked(position) {
|
|
414
|
+
return (await this.index.read(this.base + position * 24 + 16, 1))[0] === 1;
|
|
415
|
+
}
|
|
416
|
+
async sort(compare) {
|
|
417
|
+
let target = this.index.allocate(this.length * 24);
|
|
418
|
+
for (let width = 1; width < this.length; width *= 2) {
|
|
419
|
+
for (let start = 0; start < this.length; start += width * 2) {
|
|
420
|
+
const middle = Math.min(start + width, this.length), end = Math.min(start + width * 2, this.length);
|
|
421
|
+
let left = start, right = middle, a = left < middle ? await this.read(left) : void 0, b = right < end ? await this.read(right) : void 0;
|
|
422
|
+
for (let position = start; position < end; position++) {
|
|
423
|
+
this.budget.step();
|
|
424
|
+
const pause = this.budget.checkpoint();
|
|
425
|
+
if (pause) await pause;
|
|
426
|
+
const takeLeft = b === void 0 || a !== void 0 && compare(a, b) <= 0;
|
|
427
|
+
const source = takeLeft ? left : right;
|
|
428
|
+
await this.index.write(target + position * 24, await this.index.read(this.base + source * 24, 24));
|
|
429
|
+
if (takeLeft) a = ++left < middle ? await this.read(left) : void 0;
|
|
430
|
+
else b = ++right < end ? await this.read(right) : void 0;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
const previous = this.base;
|
|
434
|
+
this.base = target;
|
|
435
|
+
target = previous;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
close() {
|
|
439
|
+
return closeDocumentResources2([this.data, this.index]);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
var compareText = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
443
|
+
async function* directoryMatches(left, right, budget, ignoreCase, maxEntries, excluded, startingFile) {
|
|
444
|
+
const cache = new PagedStorageCache2(16), matches = new Rows(budget, cache);
|
|
445
|
+
let entries = new Rows(budget, cache);
|
|
446
|
+
const context = budget.context, key = (name) => ignoreCase ? name.replace(/[A-Z]/gu, (letter) => letter.toLowerCase()) : name;
|
|
447
|
+
try {
|
|
448
|
+
const restart = /* @__PURE__ */ Symbol("prepare directory backing storage");
|
|
449
|
+
for (let prepared = false; ; prepared = true) {
|
|
450
|
+
let admittedBytes = 0;
|
|
451
|
+
try {
|
|
452
|
+
for (const [side, path] of [["left", left], ["right", right]]) {
|
|
453
|
+
if (path === void 0) continue;
|
|
454
|
+
const absolute = pathOf2(context, path);
|
|
455
|
+
if (Number.isFinite(maxEntries) && (!Number.isSafeInteger(maxEntries) || maxEntries < 0))
|
|
456
|
+
throw new FsError("EINVAL", { syscall: "readdir", path: absolute, message: "directory entry limit must be a nonnegative safe integer or Infinity" });
|
|
457
|
+
const source = context.fs.iterateDirectory ? context.fs.iterateDirectory(absolute, { signal: context.signal }) : await host(context, () => context.fs.readdir(absolute, { signal: context.signal, ...Number.isFinite(maxEntries) ? { maxEntries } : {} }));
|
|
458
|
+
let count2 = 0;
|
|
459
|
+
const iterator = Array.isArray(source) ? source[Symbol.iterator]() : source[Symbol.asyncIterator]();
|
|
460
|
+
try {
|
|
461
|
+
for (; ; ) {
|
|
462
|
+
const item = await host(context, async () => iterator.next());
|
|
463
|
+
if (item.done) break;
|
|
464
|
+
const entry = item.value;
|
|
465
|
+
if (++count2 > maxEntries) throw new FsError("EFBIG", { syscall: "readdir", path: absolute, message: "directory entry limit exceeded" });
|
|
466
|
+
budget.step();
|
|
467
|
+
const pause = budget.checkpoint();
|
|
468
|
+
if (pause) await pause;
|
|
469
|
+
if (!entry.name || entry.name === "." || entry.name === ".." || /[/\\\0\r\n\t]/u.test(entry.name)) throw new ToolError3("unsafe directory entry name");
|
|
470
|
+
if (!await excluded(entry.name)) {
|
|
471
|
+
admittedBytes += entry.name.length * 6 + 128;
|
|
472
|
+
if (!prepared && admittedBytes > 128 * 1024) throw restart;
|
|
473
|
+
await entries.append({ name: entry.name, side });
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
} finally {
|
|
477
|
+
await iterator.return?.();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
break;
|
|
481
|
+
} catch (error) {
|
|
482
|
+
if (error !== restart) throw error;
|
|
483
|
+
await entries.close();
|
|
484
|
+
entries = new Rows(budget, cache);
|
|
485
|
+
await entries.data.prepare();
|
|
486
|
+
await entries.index.prepare();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
await entries.sort((a, b) => compareText(key(a.name), key(b.name)) || compareText(a.name, b.name) || compareText(a.side, b.side));
|
|
490
|
+
let count = 0;
|
|
491
|
+
for (let begin = 0; begin < entries.length; ) {
|
|
492
|
+
const group = key((await entries.read(begin)).name);
|
|
493
|
+
let end = begin, leftCount = 0, rightCount = 0;
|
|
494
|
+
while (end < entries.length) {
|
|
495
|
+
const entry = await entries.read(end);
|
|
496
|
+
if (key(entry.name) !== group) break;
|
|
497
|
+
if (entry.side === "left") leftCount++;
|
|
498
|
+
else rightCount++;
|
|
499
|
+
end++;
|
|
500
|
+
}
|
|
501
|
+
count += Math.max(leftCount, rightCount);
|
|
502
|
+
if (count > maxEntries) throw new ToolError3("file/entry limit exceeded");
|
|
503
|
+
if (startingFile === void 0 || group >= key(startingFile)) {
|
|
504
|
+
const next = async (position, side, unmatched = false) => {
|
|
505
|
+
while (position < end) {
|
|
506
|
+
const entry = await entries.read(position);
|
|
507
|
+
if (entry.side === side && (!unmatched || !await entries.marked(position))) return { position, name: entry.name };
|
|
508
|
+
position++;
|
|
509
|
+
}
|
|
510
|
+
return void 0;
|
|
511
|
+
};
|
|
512
|
+
let a = await next(begin, "left"), b = await next(begin, "right");
|
|
513
|
+
while (a && b) {
|
|
514
|
+
budget.step();
|
|
515
|
+
const pause = budget.checkpoint();
|
|
516
|
+
if (pause) await pause;
|
|
517
|
+
const order = compareText(a.name, b.name);
|
|
518
|
+
if (order === 0) {
|
|
519
|
+
await matches.append({ left: a.name, right: b.name });
|
|
520
|
+
await entries.mark(a.position);
|
|
521
|
+
await entries.mark(b.position);
|
|
522
|
+
}
|
|
523
|
+
if (order <= 0) a = await next(a.position + 1, "left");
|
|
524
|
+
if (order >= 0) b = await next(b.position + 1, "right");
|
|
525
|
+
}
|
|
526
|
+
a = await next(begin, "left", true);
|
|
527
|
+
b = await next(begin, "right", true);
|
|
528
|
+
while (a || b) {
|
|
529
|
+
await matches.append({ ...a ? { left: a.name } : {}, ...b ? { right: b.name } : {} });
|
|
530
|
+
if (a) a = await next(a.position + 1, "left", true);
|
|
531
|
+
if (b) b = await next(b.position + 1, "right", true);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
begin = end;
|
|
535
|
+
}
|
|
536
|
+
await matches.sort((a, b) => {
|
|
537
|
+
const first = a.left ?? a.right, second = b.left ?? b.right;
|
|
538
|
+
return compareText(key(first), key(second)) || Number(a.left === void 0 || a.right === void 0) - Number(b.left === void 0 || b.right === void 0) || compareText(first, second);
|
|
539
|
+
});
|
|
540
|
+
for (let index = matches.length - 1; index >= 0; index--) yield await matches.read(index);
|
|
541
|
+
} finally {
|
|
542
|
+
await closeDocumentResources2([entries, matches]);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
18
546
|
// packages/safe-bash-command-diff/src/diff.ts
|
|
19
|
-
import { closeDocumentResources as
|
|
20
|
-
import { PagedStorage as
|
|
547
|
+
import { closeDocumentResources as closeDocumentResources5 } from "../../safe-bash-diff-engine/document.js";
|
|
548
|
+
import { PagedStorage as PagedStorage7 } from "@poe-platform/safe-fs/storage";
|
|
21
549
|
|
|
22
550
|
// packages/safe-bash-command-diff/src/indexed.ts
|
|
23
551
|
import { writeDiagnostic } from "../../safe-bash-contracts/escaping.js";
|
|
24
552
|
|
|
25
553
|
// packages/safe-bash-command-diff/src/indexed-output.ts
|
|
26
|
-
import { ToolError } from "../../safe-bash-diff-engine/shared.js";
|
|
554
|
+
import { ToolError as ToolError4 } from "../../safe-bash-diff-engine/shared.js";
|
|
27
555
|
import { encodeBytes as encodeBytes2 } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
28
556
|
|
|
29
557
|
// packages/safe-bash-command-diff/src/indexed-normalization.ts
|
|
30
|
-
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
558
|
+
import { PagedStorage as PagedStorage4 } from "@poe-platform/safe-fs/storage";
|
|
31
559
|
import { readBytes } from "../../safe-bash-contracts/index.js";
|
|
32
560
|
import { decodeBytes, encodeBytes } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
33
561
|
async function* stripTrailingCr(source, signal) {
|
|
@@ -88,7 +616,7 @@ async function* expandedSource(document, start, end, utf8) {
|
|
|
88
616
|
if (pending) yield encodeBytes(pending, utf8 ? "utf8" : "latin1");
|
|
89
617
|
}
|
|
90
618
|
async function* comparisonSource(document, options, utf8) {
|
|
91
|
-
const storage = new
|
|
619
|
+
const storage = new PagedStorage4(document.budget.context, 16);
|
|
92
620
|
document.budget.context.registerCleanup?.(() => storage.close());
|
|
93
621
|
const encoder2 = new TextEncoder();
|
|
94
622
|
let position = 0;
|
|
@@ -221,7 +749,7 @@ async function renderSideBySide(old, next, count, group, options, budget, append
|
|
|
221
749
|
};
|
|
222
750
|
const row = async (left, right, common) => {
|
|
223
751
|
if (common && left !== void 0 && right !== void 0 && options.suppressCommon) return;
|
|
224
|
-
if (options.width > budget.limits.maxOutputBytes) throw new
|
|
752
|
+
if (options.width > budget.limits.maxOutputBytes) throw new ToolError4("output byte limit exceeded");
|
|
225
753
|
const leftLf = await terminated(old, left), rightLf = await terminated(next, right);
|
|
226
754
|
const marker = common ? left === void 0 ? ")" : right === void 0 ? "(" : " " : left === void 0 ? ">" : right === void 0 ? "<" : !leftLf && rightLf ? "\\" : leftLf && !rightLf ? "/" : "|";
|
|
227
755
|
const colored = options.color && (marker === "<" || marker === ">");
|
|
@@ -278,14 +806,14 @@ async function renderSideBySide(old, next, count, group, options, budget, append
|
|
|
278
806
|
import { encodeBytes as encodeBytes3 } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
279
807
|
|
|
280
808
|
// packages/safe-bash-command-diff/src/indexed-pattern.ts
|
|
281
|
-
import { IntegerTable, PagedStorage as
|
|
282
|
-
import { closeDocumentResources } from "../../safe-bash-diff-engine/document.js";
|
|
809
|
+
import { IntegerTable, PagedStorage as PagedStorage5, PagedStorageCache as PagedStorageCache3 } from "@poe-platform/safe-fs/storage";
|
|
810
|
+
import { closeDocumentResources as closeDocumentResources3 } from "../../safe-bash-diff-engine/document.js";
|
|
283
811
|
async function matchesPattern(pattern, document, start, end, utf8, budget) {
|
|
284
812
|
if (await pattern.supportsStreamTest(budget)) return pattern.testStream(documentText(document, start, end, utf8), budget);
|
|
285
|
-
const cache = new
|
|
286
|
-
const text = new
|
|
287
|
-
const records = new
|
|
288
|
-
const index = new
|
|
813
|
+
const cache = new PagedStorageCache3(16);
|
|
814
|
+
const text = new PagedStorage5(budget.context, 16, cache);
|
|
815
|
+
const records = new PagedStorage5(budget.context, 16, cache);
|
|
816
|
+
const index = new PagedStorage5(budget.context, 16, cache);
|
|
289
817
|
const hashes = new IntegerTable(index, 256);
|
|
290
818
|
let length = 0, cursor = 8, tail = 8;
|
|
291
819
|
const record = async (offset) => {
|
|
@@ -344,14 +872,14 @@ async function matchesPattern(pattern, document, start, end, utf8, budget) {
|
|
|
344
872
|
}
|
|
345
873
|
}, budget);
|
|
346
874
|
} finally {
|
|
347
|
-
await
|
|
875
|
+
await closeDocumentResources3([text, records, index]);
|
|
348
876
|
}
|
|
349
877
|
}
|
|
350
878
|
|
|
351
879
|
// packages/safe-bash-command-diff/src/indexed.ts
|
|
352
|
-
import { PagedStorage as
|
|
353
|
-
import { IndexedDocument, closeDocumentResources as
|
|
354
|
-
import { ToolError as
|
|
880
|
+
import { PagedStorage as PagedStorage6 } from "@poe-platform/safe-fs/storage";
|
|
881
|
+
import { IndexedDocument as IndexedDocument2, closeDocumentResources as closeDocumentResources4 } from "../../safe-bash-diff-engine/document.js";
|
|
882
|
+
import { ToolError as ToolError5 } from "../../safe-bash-diff-engine/shared.js";
|
|
355
883
|
var encoder = new TextEncoder();
|
|
356
884
|
async function buildGroups(old, next, matrix, groups, budget, admitLines = true) {
|
|
357
885
|
let prefix = 0, suffix = 0, count = 0;
|
|
@@ -361,7 +889,7 @@ async function buildGroups(old, next, matrix, groups, budget, admitLines = true)
|
|
|
361
889
|
while (suffix < Math.min(old.length, next.length) - prefix && await old.equal(old.length - suffix - 1, next, next.length - suffix - 1)) suffix++;
|
|
362
890
|
const oldCount = old.length - prefix - suffix, newCount = next.length - prefix - suffix;
|
|
363
891
|
const width = newCount + 1, cells = (oldCount + 1) * width;
|
|
364
|
-
if (oldCount && newCount && (cells > budget.limits.maxMatrixCells || !Number.isSafeInteger(cells * 4))) throw new
|
|
892
|
+
if (oldCount && newCount && (cells > budget.limits.maxMatrixCells || !Number.isSafeInteger(cells * 4))) throw new ToolError5("diff matrix cell limit exceeded");
|
|
365
893
|
const base = oldCount && newCount ? matrix.allocate(cells * 4) : 0;
|
|
366
894
|
const get = async (row2, column2) => {
|
|
367
895
|
const bytes = await matrix.read(base + (row2 * width + column2) * 4, 4);
|
|
@@ -449,7 +977,7 @@ async function line(document, position, prefix, output, color) {
|
|
|
449
977
|
}
|
|
450
978
|
async function indexedDiff(budget, options, left, right, nested, append, sources, stdin) {
|
|
451
979
|
let trouble = false;
|
|
452
|
-
const acquire = (source) => source === "-" ? stdin.document ??= new
|
|
980
|
+
const acquire = (source) => source === "-" ? stdin.document ??= new IndexedDocument2(budget) : new IndexedDocument2(budget);
|
|
453
981
|
const rawOld = acquire(sources.left), rawNext = acquire(sources.right);
|
|
454
982
|
let old = rawOld, next = rawNext;
|
|
455
983
|
const load = async (document, source) => {
|
|
@@ -459,7 +987,7 @@ async function indexedDiff(budget, options, left, right, nested, append, sources
|
|
|
459
987
|
else await document.load(input);
|
|
460
988
|
};
|
|
461
989
|
const keys = [];
|
|
462
|
-
const matrix = new
|
|
990
|
+
const matrix = new PagedStorage6(budget.context, 8), groups = new PagedStorage6(budget.context, 16);
|
|
463
991
|
budget.context.registerCleanup?.(() => matrix.close());
|
|
464
992
|
budget.context.registerCleanup?.(() => groups.close());
|
|
465
993
|
const text = async (value, color) => {
|
|
@@ -492,16 +1020,16 @@ async function indexedDiff(budget, options, left, right, nested, append, sources
|
|
|
492
1020
|
}
|
|
493
1021
|
}
|
|
494
1022
|
if (options.stripTrailingCr) {
|
|
495
|
-
old = new
|
|
496
|
-
next = new
|
|
1023
|
+
old = new IndexedDocument2(budget);
|
|
1024
|
+
next = new IndexedDocument2(budget);
|
|
497
1025
|
keys.push(old, next);
|
|
498
1026
|
await old.load(stripTrailingCr(rawOld.range(0, rawOld.size), budget.context.signal));
|
|
499
1027
|
await next.load(stripTrailingCr(rawNext.range(0, rawNext.size), budget.context.signal));
|
|
500
1028
|
}
|
|
501
1029
|
if (options.format === "ed" && !options.brief && trouble) {
|
|
502
1030
|
const before = old, after = next;
|
|
503
|
-
old = new
|
|
504
|
-
next = new
|
|
1031
|
+
old = new IndexedDocument2(budget);
|
|
1032
|
+
next = new IndexedDocument2(budget);
|
|
505
1033
|
keys.push(old, next);
|
|
506
1034
|
await old.load(terminatedSource(before));
|
|
507
1035
|
await next.load(terminatedSource(after));
|
|
@@ -516,8 +1044,8 @@ async function indexedDiff(budget, options, left, right, nested, append, sources
|
|
|
516
1044
|
const counted = options.format === "ifdef" || options.format === "side" || normalize && !sameRaw;
|
|
517
1045
|
if (counted) budget.countLines(old.length + next.length);
|
|
518
1046
|
if (normalize && !sameRaw) {
|
|
519
|
-
oldKeys = new
|
|
520
|
-
nextKeys = new
|
|
1047
|
+
oldKeys = new IndexedDocument2(budget);
|
|
1048
|
+
nextKeys = new IndexedDocument2(budget);
|
|
521
1049
|
keys.push(oldKeys, nextKeys);
|
|
522
1050
|
const utf8 = old.validUtf8 && next.validUtf8;
|
|
523
1051
|
await oldKeys.load(comparisonSource(old, options, utf8));
|
|
@@ -733,7 +1261,7 @@ async function indexedDiff(budget, options, left, right, nested, append, sources
|
|
|
733
1261
|
}
|
|
734
1262
|
return { different: true, trouble };
|
|
735
1263
|
} finally {
|
|
736
|
-
await
|
|
1264
|
+
await closeDocumentResources4([
|
|
737
1265
|
...rawOld === stdin.document ? [] : [rawOld],
|
|
738
1266
|
...rawNext === stdin.document ? [] : [rawNext],
|
|
739
1267
|
...keys,
|
|
@@ -806,10 +1334,9 @@ import { createPrCommand } from "../../safe-bash-command-pr/index.js";
|
|
|
806
1334
|
import { basename, createCommandArguments, isFsError, writeBytes } from "../../safe-bash-contracts/index.js";
|
|
807
1335
|
import { publicDiagnosticMessage } from "../../safe-bash-contracts/diagnostics.js";
|
|
808
1336
|
import { writeDiagnostic as writeDiagnostic2 } from "../../safe-bash-contracts/escaping.js";
|
|
809
|
-
import { ToolError as
|
|
810
|
-
import {
|
|
811
|
-
import { pathOf } from "../../safe-bash-io-engine/internal.js";
|
|
812
|
-
import { Pattern } from "../../safe-bash-regex-engine/text/regex.js";
|
|
1337
|
+
import { ToolError as ToolError6, definition, host as host2, inspect as inspect2, sameIdentity } from "../../safe-bash-diff-engine/shared.js";
|
|
1338
|
+
import { decodeBytes as decodeBytes2, encodeBytes as encodeBytes4 } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
1339
|
+
import { pathOf as pathOf3 } from "../../safe-bash-io-engine/internal.js";
|
|
813
1340
|
async function comparisonLines(lines, options, budget) {
|
|
814
1341
|
const whitespace = options.whitespace;
|
|
815
1342
|
if (whitespace === "exact" && !options.ignoreCase && !options.ignoreTabs && !options.ignoreTrailing) return lines;
|
|
@@ -860,7 +1387,7 @@ async function edits(oldLines, newLines, oldKeys, newKeys, budget) {
|
|
|
860
1387
|
const oldCount = oldLines.length - prefix - suffix;
|
|
861
1388
|
const newCount = newLines.length - prefix - suffix;
|
|
862
1389
|
const cells = (oldCount + 1) * (newCount + 1);
|
|
863
|
-
if (oldCount && newCount && cells > budget.limits.maxMatrixCells) throw new
|
|
1390
|
+
if (oldCount && newCount && cells > budget.limits.maxMatrixCells) throw new ToolError6("diff matrix cell limit exceeded");
|
|
864
1391
|
const width = newCount + 1;
|
|
865
1392
|
const matrix = oldCount && newCount ? new Uint32Array(cells) : void 0;
|
|
866
1393
|
const ids = /* @__PURE__ */ new Map();
|
|
@@ -928,63 +1455,25 @@ async function edits(oldLines, newLines, oldKeys, newKeys, budget) {
|
|
|
928
1455
|
}
|
|
929
1456
|
return result;
|
|
930
1457
|
}
|
|
931
|
-
async function exclusionPatterns(options, budget) {
|
|
932
|
-
const exclusions = [];
|
|
933
|
-
let patternBytes = 0;
|
|
934
|
-
const append = async (source, ignoreCase, start = 0, end = source.length) => {
|
|
935
|
-
budget.step(1 + end - start);
|
|
936
|
-
{
|
|
937
|
-
const c = budget.checkpoint();
|
|
938
|
-
if (c) await c;
|
|
939
|
-
}
|
|
940
|
-
if (exclusions.length >= budget.limits.maxExcludePatterns) throw new ToolError3("exclusion pattern count limit exceeded");
|
|
941
|
-
const remaining = budget.limits.maxExcludePatternBytes - patternBytes;
|
|
942
|
-
if (end - start > remaining) throw new ToolError3("exclusion pattern byte limit exceeded");
|
|
943
|
-
const sourcePattern = source.slice(start, end);
|
|
944
|
-
const bytes = byteLength(sourcePattern);
|
|
945
|
-
if (bytes > remaining) throw new ToolError3("exclusion pattern byte limit exceeded");
|
|
946
|
-
patternBytes += bytes;
|
|
947
|
-
exclusions.push(globPattern(sourcePattern, ignoreCase));
|
|
948
|
-
};
|
|
949
|
-
for (const { pattern, ignoreCase } of options.excludes) await append(pattern, ignoreCase);
|
|
950
|
-
for (const { path, ignoreCase } of options.excludeFiles) {
|
|
951
|
-
if (path !== "-") await inspect(budget, path, "follow");
|
|
952
|
-
const contents = await (path === "-" ? budget.read("-") : budget.readDiff(pathOf(budget.context, path)));
|
|
953
|
-
let start = 0;
|
|
954
|
-
while (start < contents.length) {
|
|
955
|
-
const newline = contents.indexOf("\n", start);
|
|
956
|
-
const end = newline < 0 ? contents.length : newline;
|
|
957
|
-
if (end > start) await append(contents, ignoreCase, start, end);
|
|
958
|
-
else {
|
|
959
|
-
budget.step();
|
|
960
|
-
{
|
|
961
|
-
const c = budget.checkpoint();
|
|
962
|
-
if (c) await c;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
start = end + 1;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
return exclusions;
|
|
969
|
-
}
|
|
970
1458
|
function childPath(directory, name) {
|
|
971
1459
|
let end = directory.length;
|
|
972
1460
|
while (end > 0 && directory[end - 1] === "/") end--;
|
|
973
1461
|
return `${directory.slice(0, end)}/${name}`;
|
|
974
1462
|
}
|
|
975
1463
|
async function run(context, budget) {
|
|
976
|
-
const storage = new
|
|
1464
|
+
const storage = new PagedStorage7(context, 32);
|
|
977
1465
|
const stdin = {};
|
|
978
|
-
|
|
1466
|
+
const exclusions = new StoredExclusions(budget);
|
|
1467
|
+
context.registerCleanup?.(() => closeDocumentResources5([storage, exclusions]));
|
|
979
1468
|
try {
|
|
980
|
-
return await runStored(context, budget, storage, stdin);
|
|
1469
|
+
return await runStored(context, budget, storage, stdin, exclusions);
|
|
981
1470
|
} finally {
|
|
982
|
-
await
|
|
1471
|
+
await closeDocumentResources5([storage, exclusions, ...stdin.document ? [stdin.document] : []]);
|
|
983
1472
|
}
|
|
984
1473
|
}
|
|
985
|
-
async function runStored(context, budget, storage, stdinDocument) {
|
|
1474
|
+
async function runStored(context, budget, storage, stdinDocument, exclusions) {
|
|
986
1475
|
const options = flags(context.args);
|
|
987
|
-
|
|
1476
|
+
await exclusions.load(options);
|
|
988
1477
|
let outputSize = 0;
|
|
989
1478
|
let encoding = "utf8";
|
|
990
1479
|
const appendBytes = async (bytes) => {
|
|
@@ -1002,7 +1491,7 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1002
1491
|
let inspectionFailed = false;
|
|
1003
1492
|
const inspectOperand = async (path) => {
|
|
1004
1493
|
try {
|
|
1005
|
-
return await
|
|
1494
|
+
return await inspect2(budget, path, symlinks);
|
|
1006
1495
|
} catch (error) {
|
|
1007
1496
|
if (isFsError(error, "ENOENT")) return void 0;
|
|
1008
1497
|
if (!isFsError(error)) throw error;
|
|
@@ -1015,6 +1504,7 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1015
1504
|
const pairs = options.fromFile !== void 0 ? options.files.map((right) => ({ left: options.fromFile, right })) : options.toFile !== void 0 ? options.files.map((left) => ({ left, right: options.toFile })) : [{ left: options.files[0], right: options.files[1] }];
|
|
1016
1505
|
const pending = pairs.reverse().map((pair) => ({ ...pair, nested: false, leftParents: [], rightParents: [] }));
|
|
1017
1506
|
while (pending.length) {
|
|
1507
|
+
budget.inspected.clear();
|
|
1018
1508
|
encoding = "utf8";
|
|
1019
1509
|
inspectionFailed = false;
|
|
1020
1510
|
budget.file();
|
|
@@ -1025,15 +1515,15 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1025
1515
|
const pair = pending.pop();
|
|
1026
1516
|
let left = pair.left;
|
|
1027
1517
|
let right = pair.right;
|
|
1028
|
-
const isStdin = (path) => path === "-" || !options.noDereference && (
|
|
1518
|
+
const isStdin = (path) => path === "-" || !options.noDereference && (pathOf3(context, path) === "/dev/stdin" || pathOf3(context, path) === "/dev/fd/0");
|
|
1029
1519
|
let leftStat = pair.leftEntry === false ? void 0 : isStdin(left) ? { type: "file" } : await inspectOperand(left);
|
|
1030
1520
|
let rightStat = pair.rightEntry === false ? void 0 : isStdin(right) ? { type: "file" } : await inspectOperand(right);
|
|
1031
1521
|
if (inspectionFailed) continue;
|
|
1032
1522
|
if (options.format === "ifdef" && (leftStat?.type === "directory" || rightStat?.type === "directory")) {
|
|
1033
|
-
throw new
|
|
1523
|
+
throw new ToolError6("-D option not supported with directories");
|
|
1034
1524
|
}
|
|
1035
1525
|
if (!pair.nested && leftStat && rightStat && leftStat.type === "directory" !== (rightStat.type === "directory")) {
|
|
1036
|
-
if (isStdin(left) || isStdin(right)) throw new
|
|
1526
|
+
if (isStdin(left) || isStdin(right)) throw new ToolError6("cannot compare stdin with a directory");
|
|
1037
1527
|
if (leftStat.type === "directory") {
|
|
1038
1528
|
left = childPath(left, basename(right));
|
|
1039
1529
|
leftStat = await inspectOperand(left);
|
|
@@ -1070,10 +1560,10 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1070
1560
|
continue;
|
|
1071
1561
|
}
|
|
1072
1562
|
if (leftStat?.type === "symlink" || rightStat?.type === "symlink") {
|
|
1073
|
-
if (!context.fs.readlink) throw new
|
|
1563
|
+
if (!context.fs.readlink) throw new ToolError6("filesystem cannot read symbolic links");
|
|
1074
1564
|
const readlink = context.fs.readlink.bind(context.fs);
|
|
1075
|
-
const oldTarget = await
|
|
1076
|
-
const newTarget = await
|
|
1565
|
+
const oldTarget = await host2(context, () => readlink(pathOf3(context, left), { signal: context.signal }));
|
|
1566
|
+
const newTarget = await host2(context, () => readlink(pathOf3(context, right), { signal: context.signal }));
|
|
1077
1567
|
if (!budget.equal(oldTarget, newTarget)) {
|
|
1078
1568
|
await append(`Symbolic links ${left} and ${right} differ
|
|
1079
1569
|
`);
|
|
@@ -1088,8 +1578,8 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1088
1578
|
`);
|
|
1089
1579
|
continue;
|
|
1090
1580
|
}
|
|
1091
|
-
const leftIdentity = leftStat?.type !== "directory" ? void 0 : sameIdentity(leftStat, leftStat) ? leftStat : await
|
|
1092
|
-
const rightIdentity = rightStat?.type !== "directory" ? void 0 : sameIdentity(rightStat, rightStat) ? rightStat : await
|
|
1581
|
+
const leftIdentity = leftStat?.type !== "directory" ? void 0 : sameIdentity(leftStat, leftStat) ? leftStat : await host2(context, () => context.fs.realpath(pathOf3(context, left), { signal: context.signal }));
|
|
1582
|
+
const rightIdentity = rightStat?.type !== "directory" ? void 0 : sameIdentity(rightStat, rightStat) ? rightStat : await host2(context, () => context.fs.realpath(pathOf3(context, right), { signal: context.signal }));
|
|
1093
1583
|
const isLoop = (identity, parents) => identity !== void 0 && parents.some((parent) => typeof identity === "string" ? parent === identity : typeof parent !== "string" && sameIdentity(identity, parent));
|
|
1094
1584
|
const cycle = isLoop(leftIdentity, pair.leftParents) ? left : isLoop(rightIdentity, pair.rightParents) ? right : void 0;
|
|
1095
1585
|
if (cycle !== void 0) {
|
|
@@ -1100,74 +1590,29 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1100
1590
|
}
|
|
1101
1591
|
const leftParents = leftIdentity === void 0 ? pair.leftParents : [...pair.leftParents, leftIdentity];
|
|
1102
1592
|
const rightParents = rightIdentity === void 0 ? pair.rightParents : [...pair.rightParents, rightIdentity];
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
if (excluded) continue;
|
|
1121
|
-
const folded = key(entry.name);
|
|
1122
|
-
let group = names.get(folded);
|
|
1123
|
-
if (!group) {
|
|
1124
|
-
group = { left: [], right: [] };
|
|
1125
|
-
names.set(folded, group);
|
|
1126
|
-
}
|
|
1127
|
-
const before = Math.max(group.left.length, group.right.length);
|
|
1128
|
-
group[side].push(entry.name);
|
|
1129
|
-
count += Math.max(group.left.length, group.right.length) - before;
|
|
1130
|
-
if (count > maxEntries) throw new ToolError3("file/entry limit exceeded");
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
for (const name of [...names.keys()].sort().reverse()) {
|
|
1134
|
-
if (!pair.nested && options.startingFile !== void 0 && name < key(options.startingFile)) continue;
|
|
1135
|
-
const group = names.get(name);
|
|
1136
|
-
group.left.sort();
|
|
1137
|
-
group.right.sort();
|
|
1138
|
-
const rightNames = new Set(group.right);
|
|
1139
|
-
const matches = [];
|
|
1140
|
-
const unmatchedLeft = [];
|
|
1141
|
-
for (const leftName of group.left) {
|
|
1142
|
-
if (rightNames.delete(leftName)) matches.push({ left: leftName, right: leftName });
|
|
1143
|
-
else unmatchedLeft.push(leftName);
|
|
1144
|
-
}
|
|
1145
|
-
const unmatchedRight = [...rightNames];
|
|
1146
|
-
for (let index = 0; index < Math.max(unmatchedLeft.length, unmatchedRight.length); index++) {
|
|
1147
|
-
const leftName = unmatchedLeft[index], rightName = unmatchedRight[index];
|
|
1148
|
-
matches.push({ ...leftName === void 0 ? {} : { left: leftName }, ...rightName === void 0 ? {} : { right: rightName } });
|
|
1149
|
-
}
|
|
1150
|
-
matches.sort((first, second) => {
|
|
1151
|
-
const unmatched = Number(first.left === void 0 || first.right === void 0) - Number(second.left === void 0 || second.right === void 0);
|
|
1152
|
-
const firstName = first.left ?? first.right, secondName = second.left ?? second.right;
|
|
1153
|
-
return unmatched || (firstName < secondName ? -1 : firstName > secondName ? 1 : 0);
|
|
1593
|
+
for await (const match of directoryMatches(
|
|
1594
|
+
leftStat ? left : void 0,
|
|
1595
|
+
rightStat ? right : void 0,
|
|
1596
|
+
budget,
|
|
1597
|
+
options.ignoreFileNameCase,
|
|
1598
|
+
budget.remainingFiles - pending.length,
|
|
1599
|
+
(name) => exclusions.matches(name),
|
|
1600
|
+
pair.nested ? void 0 : options.startingFile
|
|
1601
|
+
)) {
|
|
1602
|
+
pending.push({
|
|
1603
|
+
left: childPath(left, match.left ?? match.right),
|
|
1604
|
+
right: childPath(right, match.right ?? match.left),
|
|
1605
|
+
nested: true,
|
|
1606
|
+
leftParents,
|
|
1607
|
+
rightParents,
|
|
1608
|
+
leftEntry: match.left !== void 0,
|
|
1609
|
+
rightEntry: match.right !== void 0
|
|
1154
1610
|
});
|
|
1155
|
-
for (const match of matches.reverse()) {
|
|
1156
|
-
pending.push({
|
|
1157
|
-
left: childPath(left, match.left ?? match.right),
|
|
1158
|
-
right: childPath(right, match.right ?? match.left),
|
|
1159
|
-
nested: true,
|
|
1160
|
-
leftParents,
|
|
1161
|
-
rightParents,
|
|
1162
|
-
leftEntry: match.left !== void 0,
|
|
1163
|
-
rightEntry: match.right !== void 0
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
1611
|
}
|
|
1167
1612
|
continue;
|
|
1168
1613
|
}
|
|
1169
1614
|
if (options.brief && options.whitespace === "exact" && !options.ignoreCase && !options.ignoreTabs && !options.ignoreTrailing && !options.stripTrailingCr && !options.ignoreBlank && options.ignorePatterns.length === 0 && leftStat?.type === "file" && rightStat?.type === "file" && !isStdin(left) && !isStdin(right)) {
|
|
1170
|
-
const same2 = await compareBrief(budget,
|
|
1615
|
+
const same2 = await compareBrief(budget, pathOf3(context, left), pathOf3(context, right), options.text, options.format === "side" || options.format === "ifdef");
|
|
1171
1616
|
if (!same2) {
|
|
1172
1617
|
different = true;
|
|
1173
1618
|
await append(`Files ${options.labels[0] ?? left} and ${options.labels[1] ?? right} differ
|
|
@@ -1179,7 +1624,7 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1179
1624
|
const canIndex = async (path, stat) => {
|
|
1180
1625
|
if (!stat || stat.type === "file") return true;
|
|
1181
1626
|
if (pair.nested || !streamType(stat.type) || !context.fs.readStream) return false;
|
|
1182
|
-
const capabilities = await
|
|
1627
|
+
const capabilities = await host2(context, async () => await context.fs.capabilitiesFor?.(pathOf3(context, path), { signal: context.signal }) ?? context.fs.capabilities);
|
|
1183
1628
|
return capabilities.streamingRead !== false;
|
|
1184
1629
|
};
|
|
1185
1630
|
let storedPatterns = true;
|
|
@@ -1191,8 +1636,8 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1191
1636
|
}
|
|
1192
1637
|
if (storedPatterns && await canIndex(left, leftStat) && await canIndex(right, rightStat)) {
|
|
1193
1638
|
const result = await indexedDiff(budget, options, left, right, pair.nested, appendBytes, {
|
|
1194
|
-
left: !leftStat ? void 0 : isStdin(left) ? "-" : streamType(leftStat.type) ? { stream:
|
|
1195
|
-
right: !rightStat ? void 0 : isStdin(right) ? "-" : streamType(rightStat.type) ? { stream:
|
|
1639
|
+
left: !leftStat ? void 0 : isStdin(left) ? "-" : streamType(leftStat.type) ? { stream: pathOf3(context, left) } : pathOf3(context, left),
|
|
1640
|
+
right: !rightStat ? void 0 : isStdin(right) ? "-" : streamType(rightStat.type) ? { stream: pathOf3(context, right) } : pathOf3(context, right)
|
|
1196
1641
|
}, stdinDocument);
|
|
1197
1642
|
different ||= result.different;
|
|
1198
1643
|
trouble ||= result.trouble;
|
|
@@ -1201,8 +1646,8 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1201
1646
|
const read = async (path, stat) => {
|
|
1202
1647
|
if (!stat) return "";
|
|
1203
1648
|
if (isStdin(path)) return stdin ??= await budget.read("-", "latin1");
|
|
1204
|
-
if (!pair.nested && streamType(stat.type)) return budget.read(
|
|
1205
|
-
return budget.readDiff(
|
|
1649
|
+
if (!pair.nested && streamType(stat.type)) return budget.read(pathOf3(context, path), "latin1");
|
|
1650
|
+
return budget.readDiff(pathOf3(context, path), "latin1");
|
|
1206
1651
|
};
|
|
1207
1652
|
const oldBytes = await read(left, leftStat);
|
|
1208
1653
|
const newBytes = await read(right, rightStat);
|
|
@@ -1317,7 +1762,7 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1317
1762
|
if (options.paginate && outputSize) {
|
|
1318
1763
|
const title = ["diff", ...context.args].join(" ");
|
|
1319
1764
|
const argumentValues = createCommandArguments(["-f", "-h", title]);
|
|
1320
|
-
const pages = new
|
|
1765
|
+
const pages = new PagedStorage7(context, 16);
|
|
1321
1766
|
context.registerCleanup?.(() => pages.close());
|
|
1322
1767
|
let pageBytes = 0;
|
|
1323
1768
|
try {
|
|
@@ -1346,60 +1791,6 @@ async function runStored(context, budget, storage, stdinDocument) {
|
|
|
1346
1791
|
} else for await (const bytes of output) await writeBytes(context.stdout, bytes, context.signal);
|
|
1347
1792
|
return trouble ? 2 : different ? 1 : 0;
|
|
1348
1793
|
}
|
|
1349
|
-
function globPattern(source, ignoreCase) {
|
|
1350
|
-
source = decodeBytes2(encodeBytes4(source), "latin1");
|
|
1351
|
-
let result = "^";
|
|
1352
|
-
const oppositeCase = (character) => !ignoreCase ? "" : character >= "A" && character <= "Z" ? character.toLowerCase() : character >= "a" && character <= "z" ? character.toUpperCase() : "";
|
|
1353
|
-
for (let index = 0; index < source.length; index++) {
|
|
1354
|
-
const character = source[index];
|
|
1355
|
-
if (character === "\\" && index + 1 < source.length) {
|
|
1356
|
-
const literal = source[++index];
|
|
1357
|
-
result += oppositeCase(literal) ? `[${literal}${oppositeCase(literal)}]` : `\\${literal}`;
|
|
1358
|
-
} else if (character === "[") {
|
|
1359
|
-
let end = index + 1;
|
|
1360
|
-
const negated = source[end] === "!" || source[end] === "^";
|
|
1361
|
-
if (negated) end++;
|
|
1362
|
-
if (source[end] === "]") end++;
|
|
1363
|
-
while (end < source.length && source[end] !== "]") {
|
|
1364
|
-
if (source[end] === "\\" && end + 1 < source.length) end += 2;
|
|
1365
|
-
else if (source[end] === "[" && source[end + 1] === ":") {
|
|
1366
|
-
const classEnd = source.indexOf(":]", end + 2);
|
|
1367
|
-
if (classEnd < 0) break;
|
|
1368
|
-
end = classEnd + 2;
|
|
1369
|
-
} else end++;
|
|
1370
|
-
}
|
|
1371
|
-
if (source[end] === "]") {
|
|
1372
|
-
let body = "";
|
|
1373
|
-
const literal = (value) => "\\]^-".includes(value) ? `\\${value}` : value;
|
|
1374
|
-
for (let scan = index + 1 + Number(negated); scan < end; scan++) {
|
|
1375
|
-
if (source[scan] === "[" && source[scan + 1] === ":") {
|
|
1376
|
-
const closing = source.indexOf(":]", scan + 2) + 1;
|
|
1377
|
-
body += source.slice(scan, closing + 1);
|
|
1378
|
-
scan = closing;
|
|
1379
|
-
continue;
|
|
1380
|
-
}
|
|
1381
|
-
if (source[scan] === "\\" && scan + 1 < end) scan++;
|
|
1382
|
-
let first = source[scan];
|
|
1383
|
-
if (ignoreCase && first >= "A" && first <= "Z") first = first.toLowerCase();
|
|
1384
|
-
if (source[scan + 1] === "-" && scan + 2 < end) {
|
|
1385
|
-
let last = source[scan + 2];
|
|
1386
|
-
if (ignoreCase && last >= "A" && last <= "Z") last = last.toLowerCase();
|
|
1387
|
-
for (let code = first.charCodeAt(0); code <= last.charCodeAt(0); code++) {
|
|
1388
|
-
const value = String.fromCharCode(code);
|
|
1389
|
-
body += literal(value) + oppositeCase(value);
|
|
1390
|
-
}
|
|
1391
|
-
scan += 2;
|
|
1392
|
-
} else body += literal(first) + oppositeCase(first);
|
|
1393
|
-
}
|
|
1394
|
-
result += body ? "[" + (negated ? "^" : "") + body + "]" : negated ? "[\0-\xFF]" : "[^\0-\xFF]";
|
|
1395
|
-
index = end;
|
|
1396
|
-
} else result += "\\[";
|
|
1397
|
-
} else if (character === "*") result += ".*";
|
|
1398
|
-
else if (character === "?") result += ".";
|
|
1399
|
-
else result += oppositeCase(character) ? `[${character}${oppositeCase(character)}]` : ".^$+(){}|]".includes(character) ? `\\${character}` : character;
|
|
1400
|
-
}
|
|
1401
|
-
return new Pattern(result + "$", true, false, "awk");
|
|
1402
|
-
}
|
|
1403
1794
|
async function ignoreChanges(changes, options, budget) {
|
|
1404
1795
|
if (!options.ignoreBlank && !options.ignorePatterns.length) return;
|
|
1405
1796
|
let scan = 0;
|