@poe-platform/safe-bash 0.1.812 → 0.1.814
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/audio-ast/id3-source.d.ts +27 -0
- package/dist/audio-ast/index.d.ts +4 -0
- package/dist/audio-ast/index.js +996 -596
- package/dist/audio-ast/mp3-source.d.ts +18 -0
- package/dist/audio-ast/ogg-source.d.ts +25 -0
- package/dist/audio-ast/ogg-stream-source.d.ts +22 -0
- package/dist/image-ast/index.js +139 -9
- package/dist/mp4-ast/containers/adapters.d.ts +7 -0
- package/dist/mp4-ast/index.d.ts +2 -0
- package/dist/mp4-ast/mp4-sample-source.d.ts +52 -0
- package/dist/mp4-ast/mp4-source.d.ts +32 -0
- package/dist/office-xml/retained-xml-document.d.ts +14 -0
- package/dist/pdf-ast/ast.d.ts +2 -0
- package/dist/pdf-ast/content/dictionary-cursor.d.ts +15 -0
- package/dist/pdf-ast/content/evaluator.d.ts +4 -0
- package/dist/pdf-ast/content/range-operator-parser.d.ts +4 -0
- package/dist/pdf-ast/content/stored-dictionary.d.ts +10 -0
- package/dist/pdf-ast/cos/lexer.d.ts +8 -5
- package/dist/pdf-ast/cos/object-reader.d.ts +11 -3
- package/dist/pdf-ast/cos/range-parser.d.ts +4 -0
- package/dist/pdf-ast/cos/retained-objects.d.ts +1 -0
- package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
- package/dist/pdf-ast/cos/value-parser.d.ts +10 -0
- package/dist/pdf-ast/edit/retained-append-attachments.d.ts +13 -0
- package/dist/pdf-ast/edit/retained-bookmarks.d.ts +13 -0
- package/dist/pdf-ast/edit/retained-form-appearances.d.ts +10 -0
- package/dist/pdf-ast/edit/retained-graph.d.ts +12 -0
- package/dist/pdf-ast/edit/retained-info-updates.d.ts +33 -0
- package/dist/pdf-ast/edit/retained-save.d.ts +2 -0
- package/dist/pdf-ast/edit/retained-stamps.d.ts +9 -0
- package/dist/pdf-ast/fonts/resolve.d.ts +3 -1
- package/dist/pdf-ast/index.d.ts +3 -1
- package/dist/pdf-ast/index.js +1966 -844
- package/dist/pdf-ast/retained-document.d.ts +5 -0
- package/dist/safe-bash/audio-ast.browser.js +6 -1
- package/dist/safe-bash/chunks/{chunk-HHSOUC3Z.js → chunk-HPQE675Q.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-BUYRKFW2.js → chunk-I6ECNJMR.js} +1 -1
- package/dist/safe-bash/chunks/{pdftk-WRYEP3CA.js → pdftk-Y2TX74LY.js} +2 -1
- package/dist/safe-bash/command-chunks/biff-KRHJ63K3-VQPJCVIL.js +5309 -0
- package/dist/safe-bash/command-chunks/{chunk-34G2SQX2.js → chunk-2BLTUQNK.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-LLU2IQEJ.js → chunk-2BNGPR6Z.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HWQ2UHMT.js → chunk-2ETEJOYX.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-NQDIT667.js → chunk-2PKBXGXD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-MMBZTYXO.js → chunk-2PQRZDNR.js} +221 -0
- package/dist/safe-bash/command-chunks/{chunk-6QBMND4A.js → chunk-2VVJRVYM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-G5QVZQCO.js → chunk-3EASXF5D.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-U3SBHEKH.js → chunk-3EB2FSAN.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-VB2TUPO2.js → chunk-3EW7GYHM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-RNSKXOG3.js → chunk-3GRMU7TM.js} +6 -6
- package/dist/safe-bash/command-chunks/chunk-3JM7E42I.js +197 -0
- package/dist/safe-bash/command-chunks/{chunk-6L4IYQAT.js → chunk-3MG5EAMX.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-RASQPOSV.js → chunk-3SPLP2DB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K5COUQAQ.js → chunk-3VGQTLO6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K7CV55K5.js → chunk-3YEQI5B7.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-ZXR6LXV5.js → chunk-3ZRCL756.js} +48 -4
- package/dist/safe-bash/command-chunks/{chunk-SOFM3GPG.js → chunk-42MEXZBJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GQ2ZSPZ3.js → chunk-46AMTJPE.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-MTWZEPAR.js → chunk-47IAU25U.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6GI3NTCW.js → chunk-4B2ZUGLT.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-L5MCW6CM.js → chunk-4EHY6J2Z.js} +9 -155
- package/dist/safe-bash/command-chunks/{chunk-QQVACHZA.js → chunk-4EZJV4FZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SSKMPDN4.js → chunk-4GQKCUS5.js} +15 -15
- package/dist/safe-bash/command-chunks/{chunk-UOBW5K3M.js → chunk-4RRYWHED.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-PINR7QET.js → chunk-4UPKVQWH.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-M7QE2MN7.js → chunk-4YLACJHE.js} +6 -6
- package/dist/safe-bash/command-chunks/chunk-5BIQWWLB.js +175 -0
- package/dist/safe-bash/command-chunks/{chunk-P3WU3PSL.js → chunk-5L4YGRQU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HKATEVAP.js → chunk-5LFGXN3D.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SPLOIABU.js → chunk-5OM3UIK3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-TVH4JORU.js → chunk-6LPSKLLD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-CV7M2QJU.js → chunk-6QYSF7I2.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-XVP6V5K3.js → chunk-6VBDJC6V.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6N5GHM72.js → chunk-6WNVGCXD.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-6CCQI6XZ.js → chunk-6XES7Z4G.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-AFROLW6S.js → chunk-6XGDWFNQ.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-WTE23QXN.js → chunk-6ZGCKUAM.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-6ZHQB453.js +35 -0
- package/dist/safe-bash/command-chunks/{chunk-RIV6XN7K.js → chunk-7DOLY7IV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-QD7ZRDUN.js → chunk-7KZ5LWV2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NGR5KOPQ.js → chunk-A347DLRB.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZM2Y4Z3C.js → chunk-A45UG4KT.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-56NYSX65.js → chunk-ADHFF2IM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ATI464W3.js → chunk-AG2SNMP5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-FDCIPJBQ.js → chunk-AM5LANIE.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-3Q247UDJ.js → chunk-AVGXFWEB.js} +278 -135
- package/dist/safe-bash/command-chunks/{chunk-RBTC7OFT.js → chunk-AVOGFREX.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-QC5RMGSA.js → chunk-AWPI4DZR.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FYMNHG7R.js → chunk-AXXZNB7U.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-Q6S57NOQ.js → chunk-AY3KQ4EN.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-456PHA3L.js → chunk-BLGGAHQW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CU4DLVME.js → chunk-BLIFGBIO.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NARD63DY.js → chunk-BS3ZEQGT.js} +22 -66
- package/dist/safe-bash/command-chunks/{chunk-WFVSUXJL.js → chunk-BS5JEUEW.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-UYWSIIUX.js → chunk-BZMNC7Q5.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-RHYJVTJO.js → chunk-CCMAHM3I.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-N4R2SHSS.js → chunk-CCZZVCHX.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WGG6G2KG.js → chunk-CIRDVCAZ.js} +7 -7
- package/dist/safe-bash/command-chunks/chunk-CK2WFJZN.js +178 -0
- package/dist/safe-bash/command-chunks/{chunk-UZL7G57V.js → chunk-CKEMZUE3.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-B5LDP7AA.js → chunk-CQBACD2V.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JYUJAF4L.js → chunk-CSE4VQKG.js} +16 -1
- package/dist/safe-bash/command-chunks/{chunk-Q73EMLLZ.js → chunk-CXME4YHU.js} +107 -5
- package/dist/safe-bash/command-chunks/{chunk-FTLDRH47.js → chunk-CZ5K2YPU.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-554Z6IKP.js → chunk-DBLQUZGN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6M6TM5Z5.js → chunk-DBNJEXHK.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SPW4GW4Z.js → chunk-DFI7QF3M.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ZO5WBWLL.js → chunk-DN6MSXY7.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-GXLXWZWH.js → chunk-DZH54L3F.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XRVKWGVQ.js → chunk-EBHOZIBS.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3Y5EME26.js → chunk-ENEIE44W.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ATTWQVR2.js → chunk-EQWFKNHJ.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-YV72XQKL.js → chunk-ETXPMVR6.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-JFYWVQ4V.js → chunk-EV5G535P.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-PZMU3Z4L.js → chunk-EVYKV3QI.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-D6UMSC45.js → chunk-F4YFTO2K.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-MPUHH2KR.js → chunk-F762XDNG.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-D2ASPM7R.js → chunk-FF7UGJWS.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-OA75SGN2.js → chunk-FOONI6BD.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DYLNU57U.js → chunk-FSVJ67G5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CLKOGAR3.js → chunk-FSYMSWJU.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-22MOB45U.js → chunk-FUQMEUAT.js} +6 -6
- package/dist/safe-bash/command-chunks/chunk-FWKLBDMK.js +0 -0
- package/dist/safe-bash/command-chunks/{chunk-KXPCSVAT.js → chunk-FXCSPPYE.js} +20 -20
- package/dist/safe-bash/command-chunks/{chunk-XZ2FWFNV.js → chunk-FYYFV6PW.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3OETVNJA.js → chunk-G2COZLXX.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ZEX53S5I.js → chunk-G3TAX3CV.js} +7369 -7221
- package/dist/safe-bash/command-chunks/{chunk-LXLLA4PM.js → chunk-GCHB7VNX.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-4Y6O2K35.js → chunk-GLAF45M7.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-OEJM666F.js → chunk-GQGMQMIM.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-RRL3Y562.js → chunk-GXMPXMDP.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-GEM47B2P.js → chunk-GYM5ICK4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-A5FZBR7X.js → chunk-H33D4R26.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-AGLK7OJR.js → chunk-HDSIIQBS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3ZDANXIC.js → chunk-HELAVGZH.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-S4QH5BXZ.js → chunk-HGIMFVI2.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-35IPOBWL.js → chunk-HI6ZYH3W.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-KB7DUBVL.js → chunk-HK6MSB7Z.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-7ZE3VIAN.js → chunk-IB5QP4LF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UCR5YDV3.js → chunk-IBYMPAUW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LABOWPFB.js → chunk-IHXZMAMY.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-XPD636C4.js → chunk-IWHNRYER.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-PPO7YUZF.js → chunk-JGKSWDGP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KCOJA7EM.js → chunk-JR3Q6QNL.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-S6R3IB36.js → chunk-JUHOL5KB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3O2YEI47.js → chunk-JVKE7YZN.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6NATRKUJ.js → chunk-JW6WVNTM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IK6K2HCG.js → chunk-JWORWL72.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JOCFI7TG.js → chunk-K2WOMJOQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XVLWZTPY.js → chunk-K4XNUJVJ.js} +543 -144
- package/dist/safe-bash/command-chunks/{chunk-DM2CPMB4.js → chunk-KBAQHE5Y.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-KCLJGRU7.js +737 -0
- package/dist/safe-bash/command-chunks/{chunk-TUDFMNPP.js → chunk-KINIV2SV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-43TRBJ2N.js → chunk-KPHLESD4.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-47NEG4UO.js → chunk-KRRG4MGH.js} +222 -46
- package/dist/safe-bash/command-chunks/{chunk-33YCKZZX.js → chunk-KSBNZTAZ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-4Y34ZG4T.js → chunk-KUOCGGEU.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-ML5R5JML.js → chunk-KY4LCHUF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2JSDKQ4J.js → chunk-LAPOMHGY.js} +251 -239
- package/dist/safe-bash/command-chunks/{chunk-ENT3IV2G.js → chunk-LDW3RF7Y.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-U27XPNLP.js → chunk-LEO4VRIN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-GZ3VIWNN.js → chunk-LKGTH2Q7.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-ZMHEGDU2.js → chunk-LNTEV56A.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-DVGXLBUW.js → chunk-LZ2JFMKT.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-6D2BMAF4.js → chunk-MEM2ZPMI.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HTVIYLVB.js → chunk-MGMTRGKM.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-B3NLITWP.js → chunk-MKK6FM5H.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-Z2JW6M2D.js → chunk-MKOIPOXX.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-MLOYUXUV.js +244 -0
- package/dist/safe-bash/command-chunks/{chunk-CBNKHBLD.js → chunk-MNK3DDH6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JVGUVHWI.js → chunk-MPXMRTMY.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-TW73OXPR.js → chunk-MVLVIMJ6.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-TY4WDAHM.js → chunk-MYZ46FQL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TBAIMDGL.js → chunk-N4MUBJCT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NPLVFAD6.js → chunk-N6G3345Q.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-ZIIO6GRY.js → chunk-NEMUPUUB.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-K5GB2YMN.js → chunk-NEVQWOU6.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-FIIAYCWS.js → chunk-NFGCBQN3.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PNGDJA6M.js → chunk-NFII726L.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-JQPNA77Y.js → chunk-NHNZYWPW.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-NQINS4XY.js +156 -0
- package/dist/safe-bash/command-chunks/{chunk-APEWTWCC.js → chunk-NRFTYZ2R.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-THMZLJQD.js → chunk-NYFYTL5G.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-SMSGLRIH.js → chunk-OTF2AJ5M.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QZZ73J2O.js → chunk-OVQP6KH5.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-HDJVJTCK.js → chunk-P2LT6TGR.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-YS25EI54.js → chunk-PCCFLPUQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-26VCZHLJ.js → chunk-PIOQBOEK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-D2KZ66W4.js → chunk-PIVH35EQ.js} +190 -42
- package/dist/safe-bash/command-chunks/{chunk-QYMEASQ6.js → chunk-PLMF35XK.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-JQVHUSDD.js → chunk-PLR5IULU.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-2CORNDGF.js → chunk-PS5GDFIP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-R6EGGK5M.js → chunk-Q5PWYPQV.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-COKYZUBW.js → chunk-Q7TVCBU2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EHTOHOTR.js → chunk-QB72X7FF.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-F3GP3EXE.js → chunk-RGDOYWOD.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-RQIQ75W5.js → chunk-RHDERFMR.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-3KMOXEGH.js → chunk-RHU44OMN.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-7PVHO47B.js → chunk-RIVKF77R.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-UOR6PXZZ.js → chunk-ROL5AEX6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AHA6IWAJ.js → chunk-RQYPFLZJ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YSMNXMAO.js → chunk-RTNI47C5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-W5LLKV5H.js → chunk-RV5AGXOV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PMAM4N33.js → chunk-RXQ2G2YK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-EVU7FLDA.js → chunk-S2QNBAN6.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-YE6OAKK7.js → chunk-S43QRKDC.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-774GLJAO.js → chunk-S7HIOT7Z.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-SEPUP6TZ.js +63 -0
- package/dist/safe-bash/command-chunks/{chunk-JPMYPOYZ.js → chunk-SUTHGUD3.js} +28 -28
- package/dist/safe-bash/command-chunks/chunk-SW37YCBW.js +286 -0
- package/dist/safe-bash/command-chunks/{chunk-Y4EYCZFT.js → chunk-SWAKALDJ.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-QUM3SYAJ.js → chunk-SYSX46IV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WGH3RLJY.js → chunk-T5S4SJGO.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-7JEIWA3A.js → chunk-TID5TSQW.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-CRV2Q3PB.js → chunk-TJLXSENN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IT7TAC3F.js → chunk-TKCUGMRZ.js} +24 -20
- package/dist/safe-bash/command-chunks/{chunk-7GKKMNL6.js → chunk-TXPDKEGY.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-A2CLZMQZ.js → chunk-UJERQEJB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6VPQ3CDZ.js → chunk-USGZN2KE.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LCZDBW55.js → chunk-UYGQEQIP.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-MPORWUTU.js → chunk-V5XC43BX.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-AIMSZBWP.js → chunk-V7E3PZOK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-CNHRVUHA.js → chunk-VDTFVRYX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KJ4XXZIL.js → chunk-VT2PHQ63.js} +582 -59
- package/dist/safe-bash/command-chunks/{chunk-MOZD7RUY.js → chunk-VT7UBPAE.js} +38 -15
- package/dist/safe-bash/command-chunks/{chunk-QDVI2YB6.js → chunk-VUWXLH3E.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-X7FA7ZD5.js → chunk-W3ZSWK76.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-JPA2PUYI.js → chunk-WBKB7HBZ.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-MIRL7HTF.js → chunk-WJ2ERUCQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-36XGIPOG.js → chunk-WTVJLHMG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SLQWQKXP.js → chunk-WWHMI4S3.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-2UBZALAK.js → chunk-WYZG3DRR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-YORJDX4V.js → chunk-WZRFS5OY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-EHSM5ZQS.js → chunk-X6OHFKBL.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-S6ZTBXYO.js → chunk-XKAUKLF7.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-EUT24Y5Z.js → chunk-XM5QJCPD.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WXRYDALR.js → chunk-XMTR7QGL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-4CKFNXRN.js → chunk-XNGM3W5R.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2ZFLMWOX.js → chunk-XTEIT5CI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4DLIUTQV.js → chunk-XU6S3XUZ.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-CJQSAATC.js → chunk-XUJAQA3S.js} +30 -30
- package/dist/safe-bash/command-chunks/{chunk-W5YSINXC.js → chunk-Y42KSX63.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-UAXSE3XE.js → chunk-Y54L4P4J.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-6WQD7LRA.js → chunk-YAD7EV4N.js} +14 -14
- package/dist/safe-bash/command-chunks/{chunk-WVMHRNXZ.js → chunk-YRPXBGRX.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5HPU7D36.js → chunk-Z2WNYEPD.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-SDTPO2VV.js → chunk-Z7QOSXQC.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-WJCN2IXI.js → chunk-ZQM37BGE.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-W3HV45CI.js → chunk-ZSQZHFWS.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-IDJQP3A6.js → chunk-ZTMZO4IT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RID6VYS3.js → chunk-ZU2KJMXO.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-YXKNJ6EM.js → chunk-ZXELXF2H.js} +5 -5
- package/dist/safe-bash/command-chunks/{clipboard-BBDK33GP-VB22F7GI.js → clipboard-BBDK33GP-QZ4ERNQX.js} +2 -2
- package/dist/safe-bash/command-chunks/{command-engine-BCUQGJJ4.js → command-engine-7V6PZR7G.js} +1012 -678
- package/dist/safe-bash/command-chunks/{engine-LAUEWYSQ-DQCEI5HE.js → engine-UYJENSWK-VSCGKSQV.js} +1 -1
- package/dist/safe-bash/command-chunks/{gnumeric-UJPXWBVR-YPXTNEDZ.js → gnumeric-UJPXWBVR-7VOHQAPM.js} +2 -2
- package/dist/safe-bash/command-chunks/{model-store-E7BHBFJC.js → model-store-UB5DWMAP.js} +24 -24
- package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +365 -0
- package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
- package/dist/safe-bash/full-core.browser.js +2 -2
- package/dist/safe-bash/plugins/index.browser.js +2 -2
- package/dist/safe-bash-command-awk/awk-runtime.js +3 -3
- package/dist/safe-bash-command-awk/awk.js +4 -4
- package/dist/safe-bash-command-awk/index.js +4 -4
- package/dist/safe-bash-command-diff/diff.js +2 -2
- package/dist/safe-bash-command-diff/index.js +3 -3
- package/dist/safe-bash-command-diff/sync.js +2 -2
- package/dist/safe-bash-command-du/du.js +2 -2
- package/dist/safe-bash-command-du/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.d.ts +3 -1
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/budget.js +2 -1
- package/dist/safe-bash-command-html-to-markdown/entities.js +4 -3
- package/dist/safe-bash-command-html-to-markdown/index.js +533 -310
- package/dist/safe-bash-command-html-to-markdown/input.js +6 -5
- package/dist/safe-bash-command-html-to-markdown/options.js +2 -1
- package/dist/safe-bash-command-html-to-markdown/parser.js +5 -4
- package/dist/safe-bash-command-html-to-markdown/render.js +6 -5
- package/dist/safe-bash-command-html-to-markdown/stored-text.d.ts +50 -0
- package/dist/safe-bash-command-html-to-markdown/stored-text.js +12 -0
- package/dist/safe-bash-command-html-to-markdown/text.js +3 -2
- package/dist/safe-bash-command-htmlq/contracts.d.ts +5 -0
- package/dist/safe-bash-command-htmlq/index.js +2006 -259
- package/dist/safe-bash-command-htmlq/selectors.d.ts +38 -1
- package/dist/safe-bash-command-htmlq/serializer.d.ts +1 -0
- package/dist/safe-bash-command-htmlq/tree.d.ts +4 -2
- package/dist/safe-bash-command-iconv/command.js +2 -2
- package/dist/safe-bash-command-iconv/index.js +2 -2
- package/dist/safe-bash-command-llm/command.js +3 -3
- package/dist/safe-bash-command-llm/index.js +9 -9
- package/dist/safe-bash-command-llm/openai.js +2 -2
- package/dist/safe-bash-command-llm/providers/index.js +2 -2
- package/dist/safe-bash-command-llm/providers/openai.js +2 -2
- package/dist/safe-bash-command-node/commands/node/browser.js +2 -2
- package/dist/safe-bash-command-node/commands/node/default-runtime.js +2 -2
- package/dist/safe-bash-command-node/commands/node/safejs.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +7 -7
- package/dist/safe-bash-command-pandoc/index.js +46 -46
- package/dist/safe-bash-command-patch/index.js +6 -6
- package/dist/safe-bash-command-patch/patch-envelope.js +53 -3
- package/dist/safe-bash-command-patch/patch-formats.d.ts +7 -2
- package/dist/safe-bash-command-patch/patch-formats.js +6 -4
- package/dist/safe-bash-command-patch/patch-gnu-paths.d.ts +7 -7
- package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +3 -2
- package/dist/safe-bash-command-patch/patch-gnu-reject.js +4 -3
- package/dist/safe-bash-command-patch/patch-publication.js +2 -1
- package/dist/safe-bash-command-patch/patch.js +6 -6
- package/dist/safe-bash-command-patch/stored-patch.d.ts +26 -0
- package/dist/safe-bash-command-patch/stored-target.d.ts +40 -0
- package/dist/safe-bash-command-patch/unified.d.ts +23 -10
- package/dist/safe-bash-command-patch/unified.js +3 -1
- package/dist/safe-bash-command-pdftk/index.d.ts +6 -2
- package/dist/safe-bash-command-pdftk/index.js +1247 -373
- package/dist/safe-bash-command-playwright-cli/index.js +26 -26
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +10 -10
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +14 -14
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +23 -23
- package/dist/safe-bash-command-playwright-cli/playwright/snapshot.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +6 -6
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +4 -4
- package/dist/safe-bash-command-pptx/command-engine.d.ts +5 -1
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-pptx/index.d.ts +1 -1
- package/dist/safe-bash-command-pptx/index.js +172 -19
- package/dist/safe-bash-command-pptx/streaming-inputs.d.ts +7 -2
- package/dist/safe-bash-command-python/executor.js +5 -5
- package/dist/safe-bash-command-python/index.js +5 -5
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-sort/index.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- package/dist/safe-bash-command-tar/create.js +2 -2
- package/dist/safe-bash-command-tar/extract.js +2 -2
- package/dist/safe-bash-command-tar/index.js +8 -8
- package/dist/safe-bash-command-tar/modes.js +4 -4
- package/dist/safe-bash-command-timeout/index.js +3 -3
- package/dist/safe-bash-command-tree/index.js +2 -2
- package/dist/safe-bash-command-tree/tree.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +22 -31
- package/dist/safe-bash-command-xz/index.js +5 -5
- package/dist/safe-bash-compression-engine/files.js +2 -2
- package/dist/safe-bash-compression-engine/operand.js +4 -4
- package/dist/safe-bash-contracts/diagnostics.js +3 -3
- package/dist/safe-bash-contracts/escaping.js +10 -10
- package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
- package/dist/safe-bash-contracts/filesystem-output.js +6 -6
- package/dist/safe-bash-contracts/index.js +33 -33
- package/dist/safe-bash-contracts/io.js +2 -2
- package/dist/safe-bash-contracts/output.js +3 -3
- package/dist/safe-bash-docx-engine/ancillary-resources.js +5 -5
- package/dist/safe-bash-docx-engine/batch-operations.js +63 -63
- package/dist/safe-bash-docx-engine/batch-result-schema.js +74 -74
- package/dist/safe-bash-docx-engine/batch.js +74 -74
- package/dist/safe-bash-docx-engine/bookmarks.js +13 -13
- package/dist/safe-bash-docx-engine/charts.js +6 -6
- package/dist/safe-bash-docx-engine/command-option-rules.js +3 -3
- package/dist/safe-bash-docx-engine/comments.js +21 -21
- package/dist/safe-bash-docx-engine/control-bindings.js +16 -16
- package/dist/safe-bash-docx-engine/control-repeat.js +16 -16
- package/dist/safe-bash-docx-engine/controls.js +14 -14
- package/dist/safe-bash-docx-engine/create.js +8 -8
- package/dist/safe-bash-docx-engine/diagrams.js +6 -6
- package/dist/safe-bash-docx-engine/diff.js +8 -8
- package/dist/safe-bash-docx-engine/document-properties.js +12 -12
- package/dist/safe-bash-docx-engine/equations.js +12 -12
- package/dist/safe-bash-docx-engine/extract.js +9 -9
- package/dist/safe-bash-docx-engine/fields.js +18 -18
- package/dist/safe-bash-docx-engine/font-inventory.js +13 -13
- package/dist/safe-bash-docx-engine/font-resources.js +3 -3
- package/dist/safe-bash-docx-engine/image-batch-operations.js +11 -11
- package/dist/safe-bash-docx-engine/image-insertion.js +17 -17
- package/dist/safe-bash-docx-engine/image-layout.js +14 -14
- package/dist/safe-bash-docx-engine/image-replacement.js +19 -19
- package/dist/safe-bash-docx-engine/images.js +14 -14
- package/dist/safe-bash-docx-engine/index.js +102 -102
- package/dist/safe-bash-docx-engine/inspection.js +15 -15
- package/dist/safe-bash-docx-engine/invocation.js +4 -4
- package/dist/safe-bash-docx-engine/io.js +6 -6
- package/dist/safe-bash-docx-engine/links.js +17 -17
- package/dist/safe-bash-docx-engine/lists.js +16 -16
- package/dist/safe-bash-docx-engine/locations.js +10 -10
- package/dist/safe-bash-docx-engine/notes.js +18 -18
- package/dist/safe-bash-docx-engine/objects.js +14 -14
- package/dist/safe-bash-docx-engine/pack.js +9 -9
- package/dist/safe-bash-docx-engine/package-view-batch-operations.js +19 -19
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +25 -25
- package/dist/safe-bash-docx-engine/paragraph-edit.js +21 -21
- package/dist/safe-bash-docx-engine/publication.js +6 -6
- package/dist/safe-bash-docx-engine/removal.js +16 -16
- package/dist/safe-bash-docx-engine/revision-decisions.js +16 -16
- package/dist/safe-bash-docx-engine/revision-edit.js +15 -15
- package/dist/safe-bash-docx-engine/revisions.js +12 -12
- package/dist/safe-bash-docx-engine/run-format.js +15 -15
- package/dist/safe-bash-docx-engine/sanitize.js +29 -29
- package/dist/safe-bash-docx-engine/sections.js +15 -15
- package/dist/safe-bash-docx-engine/settings.js +6 -6
- package/dist/safe-bash-docx-engine/shape-edit.js +16 -16
- package/dist/safe-bash-docx-engine/signatures.js +11 -11
- package/dist/safe-bash-docx-engine/stories.js +18 -18
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +34 -34
- package/dist/safe-bash-docx-engine/style-model-batch-operations.js +24 -24
- package/dist/safe-bash-docx-engine/style-model-result-schema.js +39 -39
- package/dist/safe-bash-docx-engine/styles.js +14 -14
- package/dist/safe-bash-docx-engine/table-edit.js +23 -23
- package/dist/safe-bash-docx-engine/table-read.js +11 -11
- package/dist/safe-bash-docx-engine/template.js +17 -17
- package/dist/safe-bash-docx-engine/text-replace.js +15 -15
- package/dist/safe-bash-docx-engine/text-resource-read.js +11 -11
- package/dist/safe-bash-docx-engine/text.js +11 -11
- package/dist/safe-bash-docx-engine/validation.js +4 -4
- package/dist/safe-bash-docx-engine/xml-parts.js +17 -17
- package/dist/safe-bash-io-engine/commands/text-programs/shared.js +4 -4
- package/dist/safe-bash-line-ending-engine/command.js +3 -3
- package/dist/safe-bash-line-ending-engine/convert.js +2 -2
- package/dist/safe-bash-line-ending-engine/index.js +6 -6
- package/dist/safe-bash-line-ending-engine/info.js +2 -2
- package/dist/safe-bash-markdown-engine/commonmark-blocks.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-inlines.js +4 -4
- package/dist/safe-bash-markdown-engine/commonmark-syntax.js +2 -2
- package/dist/safe-bash-markdown-engine/gfm-syntax.js +3 -3
- package/dist/safe-bash-markdown-engine/index.js +5 -5
- package/dist/safe-bash-network-engine/transfer.js +3 -3
- package/dist/safe-bash-presentation-engine/accessibility.js +31 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +16 -15
- package/dist/safe-bash-presentation-engine/animations.js +16 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +17 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +34 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +25 -24
- package/dist/safe-bash-presentation-engine/charts.js +31 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +59 -56
- package/dist/safe-bash-presentation-engine/comments.js +17 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +32 -31
- package/dist/safe-bash-presentation-engine/connectors.js +29 -28
- package/dist/safe-bash-presentation-engine/content-types.js +4 -4
- package/dist/safe-bash-presentation-engine/creation.js +6 -6
- package/dist/safe-bash-presentation-engine/diff.js +32 -31
- package/dist/safe-bash-presentation-engine/drawing-enums.d.ts +10 -10
- package/dist/safe-bash-presentation-engine/drawing-format.js +20 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +31 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +21 -20
- package/dist/safe-bash-presentation-engine/equations.js +17 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +17 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +20 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +32 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +18 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +21 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +19 -18
- package/dist/safe-bash-presentation-engine/index.d.ts +5 -1
- package/dist/safe-bash-presentation-engine/index.js +121 -108
- package/dist/safe-bash-presentation-engine/layouts.js +16 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +16 -15
- package/dist/safe-bash-presentation-engine/masters.js +15 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +24 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +17 -16
- package/dist/safe-bash-presentation-engine/media.js +16 -15
- package/dist/safe-bash-presentation-engine/memberships.js +15 -14
- package/dist/safe-bash-presentation-engine/notes.js +16 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
- package/dist/safe-bash-presentation-engine/package-tools.d.ts +3 -0
- package/dist/safe-bash-presentation-engine/package-tools.js +27 -17
- package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +58 -55
- package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
- package/dist/safe-bash-presentation-engine/properties.js +16 -15
- package/dist/safe-bash-presentation-engine/relationships.js +4 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
- package/dist/safe-bash-presentation-engine/retained-archive-staging.d.ts +19 -0
- package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/retained-frame-formatting.d.ts +14 -0
- package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -12
- package/dist/safe-bash-presentation-engine/retained-package-extraction.d.ts +22 -0
- package/dist/safe-bash-presentation-engine/retained-package-packing.d.ts +19 -0
- package/dist/safe-bash-presentation-engine/retained-package.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/retained-package.js +6 -4
- package/dist/safe-bash-presentation-engine/retained-text.d.ts +9 -2
- package/dist/safe-bash-presentation-engine/retained-text.js +131 -30
- package/dist/safe-bash-presentation-engine/retained-xml-document.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +5 -1
- package/dist/safe-bash-presentation-engine/retained-xml-publication.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/retained-xml-replacement.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +17 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +31 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +30 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +32 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +16 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +31 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +18 -17
- package/dist/safe-bash-presentation-engine/shapes.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/shapes.js +27 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +17 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +18 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +20 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +43 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +18 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.js +19 -16
- package/dist/safe-bash-presentation-engine/table-operations.js +33 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +32 -31
- package/dist/safe-bash-presentation-engine/tables.js +31 -30
- package/dist/safe-bash-presentation-engine/tags.js +16 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +33 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +40 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +27 -26
- package/dist/safe-bash-presentation-engine/text-frames.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/text-frames.js +29 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +27 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +17 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +20 -19
- package/dist/safe-bash-presentation-engine/themes.js +16 -15
- package/dist/safe-bash-presentation-engine/transitions.js +16 -15
- package/dist/safe-bash-presentation-engine/validation.js +10 -9
- package/dist/safe-bash-presentation-engine/xml-parts.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +23 -15
- package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
- package/dist/safe-bash-presentation-engine/xml.js +3 -3
- package/dist/safe-bash-query-engine/index.js +4 -4
- package/dist/safe-bash-query-engine/interpreter.js +2 -2
- package/dist/safe-bash-query-engine/query-core.js +4 -4
- package/dist/safe-bash-regex-engine/index.js +1 -1
- package/dist/safe-bash-regex-engine/python-glob.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.d.ts +19 -0
- package/dist/safe-bash-regex-engine/text/regex.js +1 -1
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.js +1 -1
- package/dist/safe-bash-xml-engine/index.d.ts +1 -0
- package/dist/safe-bash-xml-engine/index.js +9 -5
- package/dist/safe-bash-xml-engine/query.js +2 -2
- package/dist/safe-bash-xml-engine/recovery.d.ts +10 -0
- package/dist/safe-bash-xml-engine/stored-document.d.ts +3 -3
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
- package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
- package/dist/safe-bash-zip-engine/zip/volumes.js +3 -3
- package/dist/spreadsheet-engine/datasource.js +16 -2
- package/dist/spreadsheet-engine/formulas/diagnostics.d.ts +2 -1
- package/dist/spreadsheet-engine/formulas/diagnostics.js +2 -2
- package/dist/spreadsheet-engine/formulas/evaluator.d.ts +1 -1
- package/dist/spreadsheet-engine/formulas/evaluator.js +2 -1
- package/dist/spreadsheet-engine/formulas/functions/python-printf.js +56 -33
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +54 -24
- package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +6 -2
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +413 -296
- package/dist/spreadsheet-format-xls/biff-properties-write.js +40 -23
- package/dist/spreadsheet-format-xls/biff-properties.js +95 -175
- package/dist/spreadsheet-format-xls/biff-property-dictionary.d.ts +5 -0
- package/dist/spreadsheet-format-xls/biff-property-dictionary.js +75 -0
- package/dist/spreadsheet-format-xls/biff-property-index.d.ts +23 -0
- package/dist/spreadsheet-format-xls/biff-property-index.js +93 -0
- package/dist/spreadsheet-format-xls/biff-property-name.d.ts +4 -0
- package/dist/spreadsheet-format-xls/biff-property-name.js +114 -0
- package/dist/spreadsheet-format-xls/biff-property-range.d.ts +17 -3
- package/dist/spreadsheet-format-xls/biff-property-range.js +178 -37
- package/dist/spreadsheet-format-xls/biff-property-text.d.ts +6 -0
- package/dist/spreadsheet-format-xls/biff-property-text.js +68 -0
- package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +5 -0
- package/dist/spreadsheet-format-xls/biff-property-transcode.js +45 -0
- package/package.json +8 -3
- package/dist/safe-bash/command-chunks/biff-YKPDH35C-MVQIWNKV.js +0 -4974
- package/dist/safe-bash/command-chunks/chunk-2VLAXKTS.js +0 -245
- package/dist/safe-bash/command-chunks/chunk-5Q22ZLNC.js +0 -127
- package/dist/safe-bash/command-chunks/chunk-JKLOBSMP.js +0 -56
- package/dist/safe-bash/command-chunks/chunk-JYTESTBS.js +0 -99
- package/dist/safe-bash/command-chunks/chunk-ZEGNRZV2.js +0 -333
- package/dist/safe-bash/command-chunks/paradox-ZWWXYY4J-JYOSWSBL.js +0 -362
- package/dist/spreadsheet-format-xls/biff-properties-layout.js +0 -56
- package/dist/safe-bash/command-chunks/{chunk-X2HVVMTW.js → chunk-AW4Q3GZW.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-JC2EV66U.js → chunk-BJXADHRT.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XI2LETBJ.js → chunk-BXU5Y7I5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-PVLPWVRH.js → chunk-D3HW7R2N.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OLK3DCJD.js → chunk-DYERIXPU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WYBCSJFG.js → chunk-FWCUEZ3K.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FF2SQ2GP.js → chunk-GGH376XQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-D66Q7QJ3.js → chunk-JRSZ5IGD.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-Z3YB4EVE.js → chunk-KSM5CCHT.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-NJ4NTTCR.js → chunk-LNLACEAN.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-NBTG6NF6.js → chunk-LTJRUMK6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-XCYTG7CR.js → chunk-NJGL5JQ6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SZ66JC25.js → chunk-Q7J2NTH2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MDV7W5AS.js → chunk-SKNI2XQA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-7ZWACKCG.js → chunk-T6OXG7QQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ECDEPKKW.js → chunk-W25EIKDJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-4YSBUQPV.js → chunk-W2FKFEVY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2CIDPOUV.js → chunk-WSNHJZQ5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-4H3TYOVC.js → chunk-Y7AXMCFV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-U6IEK2CI.js → chunk-YPG55QTP.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-252L5YC5.js → chunk-Z37OM247.js} +6 -6
- package/dist/safe-bash/command-chunks/{pln-DFS7VLVS-JATX6FS7.js → pln-DFS7VLVS-OVOBS4QX.js} +3 -3
- package/dist/safe-bash/command-chunks/{psion-YBI6JEQI-6OMC2PGC.js → psion-YBI6JEQI-GY4S6ZLC.js} +3 -3
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
PatchBodyStore,
|
|
3
|
+
patchLine,
|
|
4
|
+
rejectBytes,
|
|
5
|
+
reverseStoredPatch
|
|
6
|
+
} from "./chunk-3JM7E42I.js";
|
|
7
|
+
import {
|
|
8
|
+
PatchPublication
|
|
9
|
+
} from "./chunk-5BIQWWLB.js";
|
|
10
|
+
import {
|
|
3
11
|
TargetDocuments,
|
|
4
12
|
TargetOutput,
|
|
5
13
|
equalTargetLines,
|
|
6
14
|
targetBytes
|
|
7
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CK2WFJZN.js";
|
|
8
16
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
17
|
+
parsePatchWith
|
|
18
|
+
} from "./chunk-SW37YCBW.js";
|
|
11
19
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-2VLAXKTS.js";
|
|
14
|
-
import {
|
|
15
|
-
reversePatch,
|
|
20
|
+
parseUnifiedReader,
|
|
16
21
|
startIndex
|
|
17
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VT7UBPAE.js";
|
|
18
23
|
import {
|
|
19
24
|
authorizeOutputs,
|
|
20
25
|
authorizePaths,
|
|
@@ -30,11 +35,14 @@ import {
|
|
|
30
35
|
import {
|
|
31
36
|
safeTarget
|
|
32
37
|
} from "./chunk-AJEQUVDN.js";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} from "
|
|
38
|
+
|
|
39
|
+
// packages/safe-bash-command-patch/src/patch.ts
|
|
40
|
+
import { closeDocumentResources as closeDocumentResources2 } from "../../safe-bash-diff-engine/document.js";
|
|
41
|
+
import { PagedStorage as PagedStorage2 } from "@poe-platform/safe-fs/storage";
|
|
36
42
|
|
|
37
43
|
// packages/safe-bash-command-patch/src/stored-hunks.ts
|
|
44
|
+
import { closeDocumentResources } from "../../safe-bash-diff-engine/document.js";
|
|
45
|
+
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
38
46
|
import { ToolError } from "../../safe-bash-diff-engine/shared.js";
|
|
39
47
|
async function applyStoredHunks(original, patch, fuzz, budget, ignoreWhitespace = false, application, documents) {
|
|
40
48
|
const source = { length: original.length, at(index) {
|
|
@@ -42,17 +50,39 @@ async function applyStoredHunks(original, patch, fuzz, budget, ignoreWhitespace
|
|
|
42
50
|
} };
|
|
43
51
|
budget.countLines(source.length);
|
|
44
52
|
const result = new TargetOutput(documents);
|
|
53
|
+
const indices = new PagedStorage(budget.context, 16, documents.cache);
|
|
45
54
|
try {
|
|
46
55
|
let cursor = 0;
|
|
47
56
|
let offset = 0;
|
|
48
57
|
let outputOffset = 0;
|
|
49
58
|
for (const [hunkIndex, hunk] of patch.hunks.entries()) {
|
|
50
59
|
budget.step();
|
|
51
|
-
const
|
|
60
|
+
const oldIndex = indices.allocate((hunk.oldCount + hunk.newCount) * 8), newIndex = oldIndex + hunk.oldCount * 8;
|
|
61
|
+
let oldPosition = oldIndex, newPosition = newIndex;
|
|
62
|
+
const cell = new Uint8Array(8), view = new DataView(cell.buffer);
|
|
63
|
+
for (let index = 0; index < hunk.lines.length; index++) {
|
|
64
|
+
view.setFloat64(0, index, true);
|
|
65
|
+
const line = await patchLine(hunk, index);
|
|
66
|
+
if (line.kind !== "+") {
|
|
67
|
+
await indices.write(oldPosition, cell);
|
|
68
|
+
oldPosition += 8;
|
|
69
|
+
}
|
|
70
|
+
if (line.kind !== "-") {
|
|
71
|
+
await indices.write(newPosition, cell);
|
|
72
|
+
newPosition += 8;
|
|
73
|
+
}
|
|
74
|
+
budget.step();
|
|
75
|
+
const pause = budget.checkpoint();
|
|
76
|
+
if (pause) await pause;
|
|
77
|
+
}
|
|
78
|
+
const indexedLine = async (base, index) => {
|
|
79
|
+
const bytes = await indices.read(base + index * 8, 8);
|
|
80
|
+
return (await patchLine(hunk, new DataView(bytes.buffer).getFloat64(0, true))).text;
|
|
81
|
+
};
|
|
52
82
|
let leading = 0;
|
|
53
83
|
let trailing = 0;
|
|
54
|
-
while (leading < hunk.lines.length && hunk
|
|
55
|
-
while (trailing < hunk.lines.length - leading && hunk
|
|
84
|
+
while (leading < hunk.lines.length && (await patchLine(hunk, leading)).kind === " ") leading++;
|
|
85
|
+
while (trailing < hunk.lines.length - leading && (await patchLine(hunk, hunk.lines.length - trailing - 1)).kind === " ") trailing++;
|
|
56
86
|
const expected = startIndex(hunk.oldStart, hunk.oldCount) + offset;
|
|
57
87
|
let found = -1;
|
|
58
88
|
let misordered = false;
|
|
@@ -65,11 +95,11 @@ async function applyStoredHunks(original, patch, fuzz, budget, ignoreWhitespace
|
|
|
65
95
|
if (c) await c;
|
|
66
96
|
}
|
|
67
97
|
if (position < 0 || position > source.length - hunk.oldCount + suffixFuzz) return false;
|
|
68
|
-
for (let lineIndex = 0; lineIndex <
|
|
69
|
-
if (lineIndex < prefixFuzz || lineIndex >=
|
|
98
|
+
for (let lineIndex = 0; lineIndex < hunk.oldCount; lineIndex++) {
|
|
99
|
+
if (lineIndex < prefixFuzz || lineIndex >= hunk.oldCount - suffixFuzz) continue;
|
|
70
100
|
const actual = source.at(position + lineIndex);
|
|
71
101
|
if (actual === void 0) return false;
|
|
72
|
-
const expectedLine =
|
|
102
|
+
const expectedLine = await indexedLine(oldIndex, lineIndex);
|
|
73
103
|
if (!await equalTargetLines(actual, expectedLine, budget, ignoreWhitespace)) return false;
|
|
74
104
|
{
|
|
75
105
|
const c = budget.checkpoint();
|
|
@@ -105,7 +135,7 @@ async function applyStoredHunks(original, patch, fuzz, budget, ignoreWhitespace
|
|
|
105
135
|
if (found >= 0) break;
|
|
106
136
|
continue;
|
|
107
137
|
}
|
|
108
|
-
const retained =
|
|
138
|
+
const retained = hunk.oldCount - Math.max(0, prefixFuzz) - suffixFuzz;
|
|
109
139
|
if (retained === 0) {
|
|
110
140
|
if (await matches(expected, Math.max(0, prefixFuzz), suffixFuzz)) {
|
|
111
141
|
found = expected;
|
|
@@ -152,48 +182,46 @@ async function applyStoredHunks(original, patch, fuzz, budget, ignoreWhitespace
|
|
|
152
182
|
if (found < 0 && application.merge && !misordered) {
|
|
153
183
|
const position = Math.max(cursor, Math.min(source.length, expected));
|
|
154
184
|
while (cursor < position) await result.append(source.at(cursor++));
|
|
155
|
-
let
|
|
185
|
+
let localLength = Math.min(hunk.oldCount, source.length - cursor);
|
|
156
186
|
let anchored = false;
|
|
157
|
-
for (let index = 0; index <
|
|
158
|
-
if (await equalTargetLines(
|
|
187
|
+
for (let index = 0; index < hunk.oldCount; index++) {
|
|
188
|
+
if (await equalTargetLines(await indexedLine(oldIndex, index), index < localLength ? source.at(cursor + index) : "", budget)) {
|
|
159
189
|
anchored = true;
|
|
160
190
|
break;
|
|
161
191
|
}
|
|
162
192
|
}
|
|
163
|
-
if (!anchored)
|
|
164
|
-
const incoming = hunk.lines.filter((line) => line.kind !== "-").map((line) => line.text);
|
|
165
|
-
const base = oldLines.map((line) => line.text);
|
|
193
|
+
if (!anchored) localLength = 0;
|
|
166
194
|
let prefix = 0;
|
|
167
195
|
let suffix = 0;
|
|
168
|
-
while (prefix < Math.min(
|
|
169
|
-
while (suffix < Math.min(
|
|
196
|
+
while (prefix < Math.min(localLength, hunk.newCount, hunk.oldCount) && await equalTargetLines(source.at(cursor + prefix), await indexedLine(newIndex, prefix), budget) && await equalTargetLines(source.at(cursor + prefix), await indexedLine(oldIndex, prefix), budget)) prefix++;
|
|
197
|
+
while (suffix < Math.min(localLength, hunk.newCount, hunk.oldCount) - prefix && await equalTargetLines(source.at(cursor + localLength - suffix - 1), await indexedLine(newIndex, hunk.newCount - suffix - 1), budget) && await equalTargetLines(source.at(cursor + localLength - suffix - 1), await indexedLine(oldIndex, hunk.oldCount - suffix - 1), budget)) suffix++;
|
|
170
198
|
{
|
|
171
199
|
const c = budget.checkpoint();
|
|
172
200
|
if (c) await c;
|
|
173
201
|
}
|
|
174
|
-
for (
|
|
202
|
+
for (let index = 0; index < prefix; index++) await result.append(source.at(cursor + index));
|
|
175
203
|
const mergeStart = result.length + 1;
|
|
176
|
-
let identical =
|
|
177
|
-
for (let index = 0; identical && index <
|
|
204
|
+
let identical = localLength === hunk.newCount;
|
|
205
|
+
for (let index = 0; identical && index < localLength; index++) identical = await equalTargetLines(source.at(cursor + index), await indexedLine(newIndex, index), budget);
|
|
178
206
|
if (identical) {
|
|
179
207
|
const last = application.outcomes?.pop();
|
|
180
208
|
if (last) application.outcomes.push({ ...last, failed: false, fuzz: 0, offset: position - startIndex(hunk.oldStart, hunk.oldCount) });
|
|
181
|
-
for (
|
|
209
|
+
for (let index = prefix; index < localLength - suffix; index++) await result.append(source.at(cursor + index));
|
|
182
210
|
} else {
|
|
183
211
|
await result.append("<<<<<<<\n");
|
|
184
|
-
for (
|
|
212
|
+
for (let index = prefix; index < localLength - suffix; index++) await result.append(source.at(cursor + index));
|
|
185
213
|
if (application.merge === "diff3") {
|
|
186
214
|
await result.append("|||||||\n");
|
|
187
|
-
for (
|
|
215
|
+
for (let index = prefix; index < hunk.oldCount - suffix; index++) await result.append(await indexedLine(oldIndex, index));
|
|
188
216
|
}
|
|
189
217
|
await result.append("=======\n");
|
|
190
|
-
for (
|
|
218
|
+
for (let index = prefix; index < hunk.newCount - suffix; index++) await result.append(await indexedLine(newIndex, index));
|
|
191
219
|
await result.append(">>>>>>>\n");
|
|
192
220
|
const last = application.outcomes?.pop();
|
|
193
221
|
if (last) application.outcomes.push({ ...last, mergeRange: [mergeStart, result.length] });
|
|
194
222
|
}
|
|
195
|
-
for (
|
|
196
|
-
cursor +=
|
|
223
|
+
for (let index = localLength - suffix; index < localLength; index++) await result.append(source.at(cursor + index));
|
|
224
|
+
cursor += localLength;
|
|
197
225
|
outputOffset = result.length - cursor;
|
|
198
226
|
continue;
|
|
199
227
|
}
|
|
@@ -202,46 +230,130 @@ async function applyStoredHunks(original, patch, fuzz, budget, ignoreWhitespace
|
|
|
202
230
|
throw new ToolError(`hunk ${hunkIndex + 1} does not match ${patch.oldPath}`, 1);
|
|
203
231
|
}
|
|
204
232
|
while (cursor < found + matchedPrefixFuzz) await result.append(source.at(cursor++));
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
233
|
+
let changeStart = matchedPrefixFuzz, changeCursor = cursor;
|
|
234
|
+
const flush = async (end) => {
|
|
235
|
+
let removed = 0, added = 0;
|
|
236
|
+
for (let index = changeStart; index < end; index++) {
|
|
237
|
+
if ((await patchLine(hunk, index)).kind === "+") added++;
|
|
238
|
+
else removed++;
|
|
239
|
+
budget.step();
|
|
240
|
+
const pause = budget.checkpoint();
|
|
241
|
+
if (pause) await pause;
|
|
242
|
+
}
|
|
243
|
+
if (!removed && !added) return;
|
|
209
244
|
if (application.ifdef) {
|
|
210
|
-
await result.append(`#${removed
|
|
245
|
+
await result.append(`#${removed ? "ifndef" : "ifdef"} ${application.ifdef}
|
|
211
246
|
`);
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
added = [];
|
|
247
|
+
let position = changeCursor;
|
|
248
|
+
for (let index = changeStart; index < end; index++) if ((await patchLine(hunk, index)).kind === "-") await result.append(source.at(position++) ?? (await patchLine(hunk, index)).text);
|
|
249
|
+
if (removed && added) await result.append("#else\n");
|
|
250
|
+
}
|
|
251
|
+
for (let index = changeStart; index < end; index++) if ((await patchLine(hunk, index)).kind === "+") await result.append((await patchLine(hunk, index)).text);
|
|
252
|
+
if (application.ifdef) await result.append("#endif\n");
|
|
219
253
|
};
|
|
220
|
-
for (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
await flush();
|
|
254
|
+
for (let index = matchedPrefixFuzz; index < hunk.lines.length - matchedSuffixFuzz; index++) {
|
|
255
|
+
const line = await patchLine(hunk, index);
|
|
256
|
+
if (line.kind === " ") {
|
|
257
|
+
await flush(index);
|
|
224
258
|
if (cursor < source.length) await result.append(source.at(cursor++));
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
259
|
+
changeStart = index + 1;
|
|
260
|
+
changeCursor = cursor;
|
|
261
|
+
} else if (line.kind === "-") cursor++;
|
|
229
262
|
}
|
|
230
|
-
await flush();
|
|
263
|
+
await flush(hunk.lines.length - matchedSuffixFuzz);
|
|
231
264
|
outputOffset = result.length - cursor;
|
|
232
265
|
}
|
|
233
266
|
while (cursor < source.length) await result.append(source.at(cursor++));
|
|
234
267
|
return await result.finish();
|
|
235
268
|
} finally {
|
|
236
|
-
await result
|
|
269
|
+
await closeDocumentResources([result, indices]);
|
|
237
270
|
}
|
|
238
271
|
}
|
|
239
272
|
|
|
273
|
+
// packages/safe-bash-command-patch/src/stored-input.ts
|
|
274
|
+
import { ToolError as ToolError2 } from "../../safe-bash-diff-engine/shared.js";
|
|
275
|
+
var StoredPatchInput = class {
|
|
276
|
+
constructor(document, crlf = false, start = 0, length = document.length - start) {
|
|
277
|
+
this.document = document;
|
|
278
|
+
this.crlf = crlf;
|
|
279
|
+
this.start = start;
|
|
280
|
+
this.length = length;
|
|
281
|
+
}
|
|
282
|
+
document;
|
|
283
|
+
crlf;
|
|
284
|
+
start;
|
|
285
|
+
length;
|
|
286
|
+
cachedIndex = -1;
|
|
287
|
+
cachedLine = "";
|
|
288
|
+
async read(index) {
|
|
289
|
+
if (index < 0 || index >= this.length) return void 0;
|
|
290
|
+
if (index === this.cachedIndex) return this.cachedLine;
|
|
291
|
+
const line = await this.document.line(this.start + index);
|
|
292
|
+
const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
|
|
293
|
+
let text = "";
|
|
294
|
+
for await (const block of this.document.range(line.start, line.end - (this.crlf ? 2 : 1))) text += decoder.decode(block, { stream: true });
|
|
295
|
+
text += decoder.decode();
|
|
296
|
+
this.cachedIndex = index;
|
|
297
|
+
this.cachedLine = text;
|
|
298
|
+
return text;
|
|
299
|
+
}
|
|
300
|
+
async signature(index) {
|
|
301
|
+
const line = await this.document.line(this.start + index);
|
|
302
|
+
if (line.end - line.start !== (this.crlf ? 5 : 4)) return false;
|
|
303
|
+
const bytes = await this.document.data.read(8 + line.start, 3);
|
|
304
|
+
return bytes[0] === 45 && bytes[1] === 45 && bytes[2] === 32;
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
async function unwrapStoredPatch(document, budget) {
|
|
308
|
+
if (document.size && (await document.data.read(8 + document.size - 1, 1))[0] !== 10) throw new ToolError2("patch is truncated: missing final LF");
|
|
309
|
+
let crlf = true;
|
|
310
|
+
for (let index = 0; index < document.length; index++) {
|
|
311
|
+
const line = await document.line(index);
|
|
312
|
+
budget.step(line.end - line.start);
|
|
313
|
+
const pause = budget.checkpoint();
|
|
314
|
+
if (pause) await pause;
|
|
315
|
+
if (line.end - line.start < 2 || (await document.data.read(8 + line.end - 2, 1))[0] !== 13) {
|
|
316
|
+
crlf = false;
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
if (index + 1 > budget.limits.maxLines) throw new ToolError2("transport line limit exceeded");
|
|
320
|
+
}
|
|
321
|
+
const input = new StoredPatchInput(document, crlf);
|
|
322
|
+
let start = 0;
|
|
323
|
+
if (/^(?:From [0-9a-f]{40,64} |(?:From|Date|Subject|To|Cc|MIME-Version|Content-Type):)/u.test(await input.read(0) ?? "")) {
|
|
324
|
+
while (start < input.length) {
|
|
325
|
+
budget.step();
|
|
326
|
+
const pause = budget.checkpoint();
|
|
327
|
+
if (pause) await pause;
|
|
328
|
+
const line = await input.read(start);
|
|
329
|
+
if (/^(?:--- |\*\*\* |diff |\d+(?:,\d+)?[acd]\d)/u.test(line)) break;
|
|
330
|
+
if (/^(?:old mode |new mode |new file mode |deleted file mode |rename |copy |similarity index |dissimilarity index |GIT binary patch|Binary files |index |@@|[+\\])/u.test(line)) throw new ToolError2("unsupported or malformed mail patch metadata");
|
|
331
|
+
if (++start > budget.limits.maxLines) throw new ToolError2("mail preamble limit exceeded");
|
|
332
|
+
}
|
|
333
|
+
if (start === input.length) throw new ToolError2("mail preamble without patch");
|
|
334
|
+
}
|
|
335
|
+
let end = input.length;
|
|
336
|
+
for (let index = start + 1; index < input.length; index++) {
|
|
337
|
+
budget.step();
|
|
338
|
+
const pause = budget.checkpoint();
|
|
339
|
+
if (pause) await pause;
|
|
340
|
+
if (!await input.signature(index)) continue;
|
|
341
|
+
end = index;
|
|
342
|
+
if (input.length - index > budget.limits.maxLines) throw new ToolError2("mail signature limit exceeded");
|
|
343
|
+
for (index++; index < input.length; index++) {
|
|
344
|
+
budget.step();
|
|
345
|
+
const pause2 = budget.checkpoint();
|
|
346
|
+
if (pause2) await pause2;
|
|
347
|
+
if (/^(?:diff |---|\+\+\+|\*\*\*|@@|index |old mode |new mode |new file mode |deleted file mode |rename |copy |similarity index |dissimilarity index |GIT binary patch|Binary files |[+\\]|\d+(?:,\d+)?[acd]\d)/u.test(await input.read(index))) throw new ToolError2("patch data after mail signature");
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return new StoredPatchInput(document, crlf, start, end - start);
|
|
351
|
+
}
|
|
352
|
+
|
|
240
353
|
// packages/safe-bash-command-patch/src/patch.ts
|
|
241
|
-
import { FsError, dirname, pipeBytes, resolvePath, writeBytes } from "../../safe-bash-contracts/index.js";
|
|
354
|
+
import { FsError, dirname, pathOf, pipeBytes, resolvePath, writeBytes } from "../../safe-bash-contracts/index.js";
|
|
242
355
|
import { publicDiagnosticMessage } from "../../safe-bash-contracts/diagnostics.js";
|
|
243
|
-
import { Budget as
|
|
244
|
-
import { encodeBytes } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
356
|
+
import { Budget as Budget3, ToolError as ToolError3, definition, host, inspect, integer } from "../../safe-bash-diff-engine/shared.js";
|
|
245
357
|
function flags(args) {
|
|
246
358
|
const result = { input: "-", reverse: false, dryRun: false, atomic: false, quiet: false, force: false, backup: true, fuzz: 2, ignoreWhitespace: false, removeEmpty: false };
|
|
247
359
|
const operands = [];
|
|
@@ -252,7 +364,7 @@ function flags(args) {
|
|
|
252
364
|
if (["simple", "never"].includes(parameter)) result.versionControl = "simple";
|
|
253
365
|
else if (["numbered", "t"].includes(parameter)) result.versionControl = "numbered";
|
|
254
366
|
else if (["existing", "nil"].includes(parameter)) result.versionControl = "existing";
|
|
255
|
-
else throw new
|
|
367
|
+
else throw new ToolError3(`invalid version control: ${parameter}`);
|
|
256
368
|
};
|
|
257
369
|
let literal = false;
|
|
258
370
|
let backupSelected = false;
|
|
@@ -260,7 +372,7 @@ function flags(args) {
|
|
|
260
372
|
const arg = args[index];
|
|
261
373
|
const value = (attached, name) => {
|
|
262
374
|
const next = attached ?? args[++index];
|
|
263
|
-
if (next === void 0) throw new
|
|
375
|
+
if (next === void 0) throw new ToolError3(`${name} requires an argument`);
|
|
264
376
|
return next;
|
|
265
377
|
};
|
|
266
378
|
if (literal || arg === "-" || !arg.startsWith("-")) operands.push(arg);
|
|
@@ -281,7 +393,7 @@ function flags(args) {
|
|
|
281
393
|
else if (arg === "--set-utc") result.setTime = "utc";
|
|
282
394
|
else if (arg === "--merge" || arg.startsWith("--merge=")) {
|
|
283
395
|
const style = arg.includes("=") ? arg.slice(arg.indexOf("=") + 1) : "merge";
|
|
284
|
-
if (style !== "merge" && style !== "diff3") throw new
|
|
396
|
+
if (style !== "merge" && style !== "diff3") throw new ToolError3(`invalid merge style: ${style}`);
|
|
285
397
|
result.merge = style;
|
|
286
398
|
} else if (arg === "--backup") result.alwaysBackup = true;
|
|
287
399
|
else if (arg === "--forward") result.forward = true;
|
|
@@ -302,13 +414,13 @@ function flags(args) {
|
|
|
302
414
|
const parameter = value(arg.includes("=") ? arg.slice(arg.indexOf("=") + 1) : void 0, name);
|
|
303
415
|
if (name === "--ifdef") result.ifdef = parameter;
|
|
304
416
|
else if (name === "--quoting-style") {
|
|
305
|
-
if (!["literal", "shell", "shell-always", "shell-escape", "shell-escape-always", "c", "escape", "locale", "clocale"].includes(parameter)) throw new
|
|
417
|
+
if (!["literal", "shell", "shell-always", "shell-escape", "shell-escape-always", "c", "escape", "locale", "clocale"].includes(parameter)) throw new ToolError3(`invalid quoting style: ${parameter}`);
|
|
306
418
|
result.quotingStyle = parameter;
|
|
307
419
|
} else if (name === "--reject-format") {
|
|
308
|
-
if (parameter !== "unified" && parameter !== "context") throw new
|
|
420
|
+
if (parameter !== "unified" && parameter !== "context") throw new ToolError3(`invalid reject format: ${parameter}`);
|
|
309
421
|
result.rejectFormat = parameter;
|
|
310
422
|
} else if (name === "--read-only") {
|
|
311
|
-
if (!["ignore", "warn", "fail"].includes(parameter)) throw new
|
|
423
|
+
if (!["ignore", "warn", "fail"].includes(parameter)) throw new ToolError3(`invalid read-only behavior: ${parameter}`);
|
|
312
424
|
result.readOnly = parameter;
|
|
313
425
|
} else if (name === "--strip") result.strip = integer(parameter, "strip count");
|
|
314
426
|
else if (name === "--fuzz") result.fuzz = integer(parameter, "fuzz");
|
|
@@ -320,9 +432,9 @@ function flags(args) {
|
|
|
320
432
|
else if (name === "--basename-prefix") result.basenamePrefix = parameter;
|
|
321
433
|
else if (name === "--version-control") versionControl(parameter);
|
|
322
434
|
else if (name === "--get") {
|
|
323
|
-
if (parameter !== "0") throw new
|
|
435
|
+
if (parameter !== "0") throw new ToolError3("version-control acquisition is unsupported; use --get=0");
|
|
324
436
|
} else result.input = parameter;
|
|
325
|
-
} else if (arg.startsWith("--")) throw new
|
|
437
|
+
} else if (arg.startsWith("--")) throw new ToolError3(`unsupported option: ${arg}`);
|
|
326
438
|
else for (let offset = 1; offset < arg.length; offset++) {
|
|
327
439
|
const flag = arg[offset];
|
|
328
440
|
if (flag === "R") result.reverse = true;
|
|
@@ -353,25 +465,25 @@ function flags(args) {
|
|
|
353
465
|
else if (flag === "Y") result.basenamePrefix = parameter;
|
|
354
466
|
else if (flag === "V") versionControl(parameter);
|
|
355
467
|
else if (flag === "g") {
|
|
356
|
-
if (parameter !== "0") throw new
|
|
468
|
+
if (parameter !== "0") throw new ToolError3("version-control acquisition is unsupported; use -g0");
|
|
357
469
|
} else result.input = parameter;
|
|
358
470
|
break;
|
|
359
|
-
} else throw new
|
|
471
|
+
} else throw new ToolError3(`unsupported option: -${flag}`);
|
|
360
472
|
}
|
|
361
473
|
}
|
|
362
|
-
if (operands.length > 2) throw new
|
|
474
|
+
if (operands.length > 2) throw new ToolError3("expected at most a target file and a patch input file");
|
|
363
475
|
if (operands.length) result.target = operands[0];
|
|
364
476
|
if (operands.length === 2) result.input = operands[1];
|
|
365
|
-
if (!result.input || result.input.includes("\0")) throw new
|
|
366
|
-
for (const path of [result.output, result.directory]) if (path !== void 0 && (!path || path.includes("\0"))) throw new
|
|
367
|
-
if (result.ifdef !== void 0 && (!result.ifdef || [...result.ifdef].some((c) => !"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_".includes(c)))) throw new
|
|
477
|
+
if (!result.input || result.input.includes("\0")) throw new ToolError3("invalid patch input path");
|
|
478
|
+
for (const path of [result.output, result.directory]) if (path !== void 0 && (!path || path.includes("\0"))) throw new ToolError3("invalid patch option path");
|
|
479
|
+
if (result.ifdef !== void 0 && (!result.ifdef || [...result.ifdef].some((c) => !"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_".includes(c)))) throw new ToolError3("invalid ifdef symbol");
|
|
368
480
|
if (result.merge) result.fuzz = 0;
|
|
369
481
|
if (result.posix && !backupSelected) result.backup = false;
|
|
370
482
|
return result;
|
|
371
483
|
}
|
|
372
484
|
async function applyContent(sourcePatch, current, exists, options, budget, documents) {
|
|
373
485
|
let reversed = options.reverse;
|
|
374
|
-
let patch = reversed ?
|
|
486
|
+
let patch = reversed ? reverseStoredPatch(sourcePatch) : sourcePatch;
|
|
375
487
|
const emptyOld = () => patch.hunks.every((hunk) => hunk.oldCount === 0 && hunk.oldStart === 0);
|
|
376
488
|
const creation = () => patch.oldPath === "/dev/null" || emptyOld() && (patch.oldEpoch || !exists);
|
|
377
489
|
let autoReversed = false;
|
|
@@ -379,7 +491,7 @@ async function applyContent(sourcePatch, current, exists, options, budget, docum
|
|
|
379
491
|
const declaredCreation = patch.oldPath === "/dev/null" || patch.oldEpoch && emptyOld();
|
|
380
492
|
const declaredDeletion = patch.newPath === "/dev/null" || patch.newEpoch && patch.hunks.every((hunk) => hunk.newCount === 0);
|
|
381
493
|
if (!options.force && (declaredCreation && current.size !== 0 || declaredDeletion && !exists)) {
|
|
382
|
-
patch =
|
|
494
|
+
patch = reverseStoredPatch(patch);
|
|
383
495
|
reversed = !reversed;
|
|
384
496
|
autoReversed = true;
|
|
385
497
|
}
|
|
@@ -393,7 +505,7 @@ async function applyContent(sourcePatch, current, exists, options, budget, docum
|
|
|
393
505
|
rejectAll: creation() && current.size !== 0
|
|
394
506
|
}, documents);
|
|
395
507
|
if (!options.merge && !options.force && !autoReversed && (outcomes[0]?.failed || outcomes[0]?.fuzz)) {
|
|
396
|
-
const opposite =
|
|
508
|
+
const opposite = reverseStoredPatch(patch);
|
|
397
509
|
const probe = [];
|
|
398
510
|
const reverseFuzz = outcomes[0].failed ? options.fuzz : outcomes[0].fuzz - 1;
|
|
399
511
|
const probeResult = await applyStoredHunks(current, { ...opposite, hunks: opposite.hunks.slice(0, 1) }, reverseFuzz, budget, options.ignoreWhitespace, { partial: true, outcomes: probe }, documents);
|
|
@@ -425,12 +537,12 @@ async function unchanged(item, budget, documents) {
|
|
|
425
537
|
if (item.sourcePath !== void 0) {
|
|
426
538
|
const source = await inspect(budget, item.sourcePath);
|
|
427
539
|
regular(source, item.sourcePath);
|
|
428
|
-
if (source === void 0 !== (item.sourceOriginal === void 0) || source && !await sameTarget(item.sourcePath, item.sourceOriginal, documents)) throw new
|
|
540
|
+
if (source === void 0 !== (item.sourceOriginal === void 0) || source && !await sameTarget(item.sourcePath, item.sourceOriginal, documents)) throw new ToolError3(`target changed during preflight: ${item.sourcePath}`, 1);
|
|
429
541
|
}
|
|
430
542
|
const stat = await inspect(budget, item.path);
|
|
431
543
|
regular(stat, item.path);
|
|
432
544
|
if (stat === void 0 !== (item.original === void 0) || item.original !== void 0 && !await sameTarget(item.path, item.original, documents)) {
|
|
433
|
-
throw new
|
|
545
|
+
throw new ToolError3(`target changed during preflight: ${item.path}`, 1);
|
|
434
546
|
}
|
|
435
547
|
for (const path of [item.backupPath, item.rejectPath]) {
|
|
436
548
|
if (path !== void 0) regular(await inspect(budget, path), path);
|
|
@@ -442,13 +554,12 @@ async function publish(item, budget, rejects, publication, documents) {
|
|
|
442
554
|
await unchanged(item, budget, documents);
|
|
443
555
|
const write = async (path, text, append = false, createParents = true, mode, mtimeMs) => {
|
|
444
556
|
if (createParents) await ensureParents(path, budget);
|
|
445
|
-
else if ((await inspect(budget, dirname(path)))?.type !== "directory") throw new
|
|
557
|
+
else if ((await inspect(budget, dirname(path)))?.type !== "directory") throw new ToolError3(`reject parent does not exist: ${dirname(path)}`);
|
|
446
558
|
const stat = await inspect(budget, path);
|
|
447
559
|
regular(stat, path);
|
|
448
560
|
const capabilities = await host(context, async () => await context.fs.capabilitiesFor?.(path, { signal: context.signal, create: true }) ?? context.fs.capabilities);
|
|
449
|
-
if (capabilities?.atomicStagingAncestry !== true && !(publication.trusted && capabilities?.trustedOwnedStaging === true)) throw new
|
|
561
|
+
if (capabilities?.atomicStagingAncestry !== true && !(publication.trusted && capabilities?.trustedOwnedStaging === true)) throw new ToolError3("filesystem does not support race-safe patch publication");
|
|
450
562
|
const publicationMode = capabilities?.permissions === false ? void 0 : mode ?? (stat ? stat.mode & 4095 : void 0);
|
|
451
|
-
if (typeof text === "string") text = await documents.load(targetBytes(text));
|
|
452
563
|
if (append && stat) text = await documents.concat(await documents.read(path), text);
|
|
453
564
|
await publication.write(path, text.range(0, text.size), stat, publicationMode, mtimeMs);
|
|
454
565
|
};
|
|
@@ -457,7 +568,7 @@ async function publish(item, budget, rejects, publication, documents) {
|
|
|
457
568
|
if (item.original !== void 0) {
|
|
458
569
|
const expected = await inspect(budget, item.path);
|
|
459
570
|
regular(expected, item.path);
|
|
460
|
-
if (!expected) throw new
|
|
571
|
+
if (!expected) throw new ToolError3(`target changed during publication: ${item.path}`, 1);
|
|
461
572
|
await publication.remove(item.path, expected);
|
|
462
573
|
}
|
|
463
574
|
} else if (!item.skipWrite) {
|
|
@@ -473,9 +584,9 @@ async function run(context, budget) {
|
|
|
473
584
|
const outputToStdout = options.output === "-";
|
|
474
585
|
if (options.directory !== void 0) {
|
|
475
586
|
const cwd = resolvePath(context.cwd, options.directory);
|
|
476
|
-
if ((await inspect(budget, cwd))?.type !== "directory") throw new
|
|
587
|
+
if ((await inspect(budget, cwd))?.type !== "directory") throw new ToolError3(`not a directory: ${options.directory}`);
|
|
477
588
|
context = { ...context, cwd };
|
|
478
|
-
budget = new
|
|
589
|
+
budget = new Budget3(context, Object.fromEntries(Object.entries(budget.limits).filter(([, value]) => Number.isFinite(value))));
|
|
479
590
|
}
|
|
480
591
|
let publication = new PatchPublication(context);
|
|
481
592
|
if (!options.dryRun) {
|
|
@@ -483,8 +594,8 @@ async function run(context, budget) {
|
|
|
483
594
|
const capabilities = await host(context, async () => await fs.capabilitiesFor?.(context.cwd, { signal: context.signal }) ?? fs.capabilities);
|
|
484
595
|
if (capabilities.readOnly === true) throw new FsError("EROFS", { syscall: "patch", path: context.cwd });
|
|
485
596
|
const trusted = capabilities.atomicStagingAncestry !== true && capabilities.trustedOwnedStaging === true;
|
|
486
|
-
if ((trusted ? !fs.prepareDirectory || !fs.removeFileConditional : !fs.confineExtraction || capabilities.atomicStagingAncestry !== true) || !fs.createStagedFile || !fs.publishStagedFile || !fs.removeStagedFile) {
|
|
487
|
-
throw new
|
|
597
|
+
if ((trusted ? !fs.prepareDirectory || !fs.removeFileConditional || !fs.writeFileConditional : !fs.confineExtraction || capabilities.atomicStagingAncestry !== true) || !fs.createStagedFile || !fs.publishStagedFile || !fs.removeStagedFile) {
|
|
598
|
+
throw new ToolError3("filesystem does not support race-safe patch publication");
|
|
488
599
|
}
|
|
489
600
|
publication = new PatchPublication(context, trusted);
|
|
490
601
|
await publication.capture(`${context.cwd === "/" ? "" : context.cwd}/.patch-admission`);
|
|
@@ -498,28 +609,46 @@ async function run(context, budget) {
|
|
|
498
609
|
return typeof value === "function" ? value.bind(selected) : value;
|
|
499
610
|
}
|
|
500
611
|
}) };
|
|
501
|
-
budget = new
|
|
612
|
+
budget = new Budget3(context, Object.fromEntries(Object.entries(budget.limits).filter(([, value]) => Number.isFinite(value))));
|
|
502
613
|
}
|
|
503
614
|
const documents = new TargetDocuments(budget);
|
|
615
|
+
const bodies = new PatchBodyStore(documents);
|
|
616
|
+
const messages = new PagedStorage2(budget.context, 16, documents.cache);
|
|
504
617
|
try {
|
|
505
618
|
const empty = await documents.load({ async *[Symbol.asyncIterator]() {
|
|
506
619
|
} });
|
|
507
620
|
const output = options.output === void 0 ? void 0 : safeTarget(options.output, 0, true);
|
|
508
|
-
if (options.output !== void 0 && output === void 0) throw new
|
|
621
|
+
if (options.output !== void 0 && output === void 0) throw new ToolError3("/dev/null is not an output file");
|
|
509
622
|
const outputPath = output === void 0 || outputToStdout ? void 0 : resolvePath(context.cwd, output);
|
|
510
623
|
const explicit = options.target === void 0 ? void 0 : safeTarget(options.target, 0, true);
|
|
511
|
-
if (options.target !== void 0 && explicit === void 0) throw new
|
|
624
|
+
if (options.target !== void 0 && explicit === void 0) throw new ToolError3("/dev/null is not an explicit target");
|
|
512
625
|
if (options.input !== "-") {
|
|
513
626
|
const stat = await inspect(budget, options.input);
|
|
514
|
-
if (stat?.type !== "file") throw new
|
|
627
|
+
if (stat?.type !== "file") throw new ToolError3("patch input must be a regular file");
|
|
515
628
|
}
|
|
516
|
-
const
|
|
629
|
+
const inputPath = pathOf(context, options.input);
|
|
630
|
+
const inputCapabilities = options.input === "-" ? void 0 : await host(context, async () => await context.fs.capabilitiesFor?.(inputPath, { signal: context.signal }) ?? context.fs.capabilities);
|
|
631
|
+
const input = options.input === "-" ? await documents.load(budget.stdinSource()) : inputCapabilities?.retainedRead && context.fs.openReadFile ? await documents.read(inputPath) : context.fs.readStream && inputCapabilities?.streamingRead !== false ? await documents.load(budget.streamSource(inputPath)) : await documents.load(targetBytes(await budget.read(inputPath)));
|
|
517
632
|
const progress = options.atomic ? void 0 : {};
|
|
518
|
-
const sections = await
|
|
633
|
+
const sections = await parsePatchWith(await unwrapStoredPatch(input, budget), budget, options.format, explicit, {
|
|
634
|
+
unified: (cursor) => parseUnifiedReader(cursor, budget, true, () => bodies.begin()),
|
|
635
|
+
converted: async (chunks) => {
|
|
636
|
+
const converted = await documents.load({ async *[Symbol.asyncIterator]() {
|
|
637
|
+
for await (const chunk of chunks) yield* targetBytes(chunk);
|
|
638
|
+
} });
|
|
639
|
+
try {
|
|
640
|
+
budget.countLines(converted.length);
|
|
641
|
+
return await parseUnifiedReader({ input: new StoredPatchInput(converted), index: 0 }, budget, false, () => bodies.begin());
|
|
642
|
+
} finally {
|
|
643
|
+
await documents.release(converted);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}, progress);
|
|
647
|
+
await documents.release(input);
|
|
519
648
|
const parsed = options.format === "normal" ? sections : sections.filter((patch) => !patch.unlocated);
|
|
520
|
-
if (sections.length && !parsed.length) throw new
|
|
649
|
+
if (sections.length && !parsed.length) throw new ToolError3("no identifiable patch; normal input requires a target, Index header, or -n");
|
|
521
650
|
const reject = options.reject === void 0 || options.reject === "-" ? options.reject : safeTarget(options.reject, 0, true);
|
|
522
|
-
if (options.reject !== void 0 && reject === void 0) throw new
|
|
651
|
+
if (options.reject !== void 0 && reject === void 0) throw new ToolError3("/dev/null is not a reject file; use -r -");
|
|
523
652
|
const paths = {
|
|
524
653
|
strip: options.strip,
|
|
525
654
|
explicit,
|
|
@@ -556,23 +685,37 @@ async function run(context, budget) {
|
|
|
556
685
|
const backupPaths = /* @__PURE__ */ new Set();
|
|
557
686
|
const rejectPaths = /* @__PURE__ */ new Set();
|
|
558
687
|
const parents = /* @__PURE__ */ new Set();
|
|
559
|
-
|
|
688
|
+
let messageSize = 0, messagePosition = 0;
|
|
560
689
|
let exitCode = 0;
|
|
561
690
|
let committed = 0;
|
|
562
691
|
let publishing = false;
|
|
563
692
|
let activePath;
|
|
564
693
|
let outputContents = empty;
|
|
565
694
|
const statusSink = outputToStdout ? context.stderr : context.stdout;
|
|
566
|
-
const
|
|
695
|
+
const appendStatus = async (text) => {
|
|
567
696
|
if (!text) return;
|
|
568
697
|
budget.output(text);
|
|
569
|
-
|
|
570
|
-
|
|
698
|
+
for await (const bytes of targetBytes(text)) {
|
|
699
|
+
await messages.append(bytes);
|
|
700
|
+
messageSize += bytes.length;
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
const flushStatus = async (final = false) => {
|
|
704
|
+
if (options.atomic && !final) return;
|
|
705
|
+
while (messagePosition < messageSize) {
|
|
706
|
+
const bytes = await messages.read(8 + messagePosition, Math.min(16384, messageSize - messagePosition));
|
|
707
|
+
await writeBytes(statusSink, bytes, context.signal);
|
|
708
|
+
messagePosition += bytes.length;
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
const status = async (text) => {
|
|
712
|
+
await appendStatus(text);
|
|
713
|
+
await flushStatus();
|
|
571
714
|
};
|
|
572
715
|
const applySection = async (authorizedPatch) => {
|
|
573
716
|
const sourcePatch = authorizedPatch.patch;
|
|
574
717
|
if (sourcePatch.unlocated) {
|
|
575
|
-
if (options.atomic) throw new
|
|
718
|
+
if (options.atomic) throw new ToolError3("no file to patch; provide a target or Index header", 1);
|
|
576
719
|
await status(`No file to patch. Skipping patch.
|
|
577
720
|
${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
578
721
|
`);
|
|
@@ -584,7 +727,7 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
584
727
|
activePath = path;
|
|
585
728
|
const pruning = pruneParents(name, context.cwd).filter((parent) => parent !== context.cwd);
|
|
586
729
|
if (!options.dryRun) await publication.capture(path, pruning);
|
|
587
|
-
if (path === paths.input || backupPaths.has(path) || rejectPaths.has(path)) throw new
|
|
730
|
+
if (path === paths.input || backupPaths.has(path) || rejectPaths.has(path)) throw new ToolError3(`patch target aliases input or an earlier output: ${path}`);
|
|
588
731
|
targets.add(path);
|
|
589
732
|
const prior = options.atomic ? staged.get(path) : void 0;
|
|
590
733
|
const stat = await inspect(budget, path);
|
|
@@ -596,13 +739,13 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
596
739
|
await status(`File ${name} is read-only; ${refuse ? "refusing to patch" : "trying to patch anyway"}
|
|
597
740
|
`);
|
|
598
741
|
if (refuse) {
|
|
599
|
-
if (options.atomic) throw new
|
|
742
|
+
if (options.atomic) throw new ToolError3(`read-only target: ${name}`, 1);
|
|
600
743
|
const destination = rejectName(outputToStdout ? "-" : name, paths);
|
|
601
744
|
const rejectPath2 = options.dryRun || destination === void 0 ? void 0 : resolvePath(context.cwd, destination);
|
|
602
745
|
if (rejectPath2 !== void 0) {
|
|
603
746
|
await authorizeOutputs([rejectPath2], targets, paths.input, budget);
|
|
604
|
-
if (backupPaths.has(rejectPath2)) throw new
|
|
605
|
-
const patch = options.reverse ?
|
|
747
|
+
if (backupPaths.has(rejectPath2)) throw new ToolError3("reject path aliases another section's backup");
|
|
748
|
+
const patch = options.reverse ? reverseStoredPatch(sourcePatch) : sourcePatch;
|
|
606
749
|
const outcomes2 = patch.hunks.map((hunk, index) => ({
|
|
607
750
|
hunk,
|
|
608
751
|
index: index + 1,
|
|
@@ -613,7 +756,7 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
613
756
|
offset: 0,
|
|
614
757
|
fuzz: 0
|
|
615
758
|
}));
|
|
616
|
-
const reject2 = await
|
|
759
|
+
const reject2 = await documents.load(rejectBytes(sourcePatch, outcomes2, authorizedPatch.oldName, authorizedPatch.newName, authorizedPatch.indexName, options.reverse, budget, options.rejectFormat));
|
|
617
760
|
const original2 = await documents.read(path);
|
|
618
761
|
publishing = true;
|
|
619
762
|
await publish({ path, original: original2, result: original2, remove: false, skipWrite: true, rejectPath: rejectPath2, reject: reject2, parents: [] }, budget, rejects, publication, documents);
|
|
@@ -640,7 +783,7 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
640
783
|
}
|
|
641
784
|
const applied = await applyContent(sourcePatch, current, exists, options, budget, documents);
|
|
642
785
|
if (!applied) {
|
|
643
|
-
if (options.atomic) throw new
|
|
786
|
+
if (options.atomic) throw new ToolError3(`patch target does not exist: ${path}`, 1);
|
|
644
787
|
await status(`No file to patch. Skipping patch ${name}.
|
|
645
788
|
${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
646
789
|
`);
|
|
@@ -657,17 +800,17 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
657
800
|
}
|
|
658
801
|
const failed = outcomes.filter((outcome) => outcome.failed);
|
|
659
802
|
const conflict = failed.length > 0 || deletion && result.size !== 0;
|
|
660
|
-
if (options.atomic && conflict) throw new
|
|
803
|
+
if (options.atomic && conflict) throw new ToolError3(failed.length ? `hunk ${failed[0].index} does not match ${name}` : `deletion patch leaves content: ${name}`, 1);
|
|
661
804
|
if (conflict) exitCode = 1;
|
|
662
805
|
const mismatch = reverseMismatch || outcomes.some((outcome) => outcome.failed || outcome.offset !== 0 || outcome.fuzz !== 0);
|
|
663
806
|
const backup = !options.dryRun && !outputToStdout && (options.alwaysBackup || options.backup && mismatch) && !touched.has(path) ? original ?? empty : void 0;
|
|
664
807
|
const backupPath = backup === void 0 ? prior?.backupPath : await backupName(path, budget, options);
|
|
665
808
|
const rejectDestination = rejectName(outputToStdout ? "-" : name, paths);
|
|
666
809
|
const rejectPath = !options.dryRun && !options.merge && failed.length && rejectDestination !== void 0 ? resolvePath(context.cwd, rejectDestination) : void 0;
|
|
667
|
-
const rejected = rejectPath === void 0 ? void 0 : await
|
|
810
|
+
const rejected = rejectPath === void 0 ? void 0 : await documents.load(rejectBytes(sourcePatch, outcomes, authorizedPatch.oldName, authorizedPatch.newName, authorizedPatch.indexName, reversed, budget, options.rejectFormat));
|
|
668
811
|
await authorizeOutputs([outputPath, backupPath, rejectPath], targets, paths.input, budget);
|
|
669
812
|
if (backupPath !== void 0 && rejectPaths.has(backupPath) || rejectPath !== void 0 && backupPaths.has(rejectPath)) {
|
|
670
|
-
throw new
|
|
813
|
+
throw new ToolError3("reject path aliases another section's backup");
|
|
671
814
|
}
|
|
672
815
|
if (backupPath !== void 0) backupPaths.add(backupPath);
|
|
673
816
|
if (rejectPath !== void 0) rejectPaths.add(rejectPath);
|
|
@@ -686,7 +829,7 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
686
829
|
else if (!options.force && mismatch) timeMessage = `Not setting time of file ${name} (contents mismatch)
|
|
687
830
|
`;
|
|
688
831
|
else {
|
|
689
|
-
if (!options.dryRun && !context.fs.utimes) throw new
|
|
832
|
+
if (!options.dryRun && !context.fs.utimes) throw new ToolError3("filesystem does not support setting timestamps");
|
|
690
833
|
mtimeMs = newTime;
|
|
691
834
|
}
|
|
692
835
|
}
|
|
@@ -706,38 +849,38 @@ ${sourcePatch.hunks.length} out of ${sourcePatch.hunks.length} hunks ignored
|
|
|
706
849
|
parents: remove ? pruning : []
|
|
707
850
|
};
|
|
708
851
|
const displayName = quotePatchName(name, options.quotingStyle);
|
|
709
|
-
|
|
710
|
-
|
|
852
|
+
budget.outputLength(result.size);
|
|
853
|
+
if (backup !== void 0) budget.outputLength(backup.size);
|
|
711
854
|
if (options.verbose) {
|
|
712
855
|
const format = sourcePatch.format ?? "unified";
|
|
713
856
|
const headers = sourcePatch.oldHeader === void 0 ? "" : `|${format === "context" ? "***" : "---"} ${sourcePatch.oldHeader}
|
|
714
857
|
|${format === "context" ? "---" : "+++"} ${sourcePatch.newHeader}
|
|
715
858
|
`;
|
|
716
|
-
|
|
859
|
+
await appendStatus(`Hmm... Looks like a ${format} diff to me...
|
|
717
860
|
The text leading up to this was:
|
|
718
861
|
--------------------------
|
|
719
862
|
${headers}--------------------------
|
|
720
|
-
`
|
|
863
|
+
`);
|
|
721
864
|
}
|
|
722
|
-
if (
|
|
865
|
+
if (!options.quiet) await appendStatus(`${options.dryRun ? "checking" : "patching"} file ${output === void 0 ? displayName : `${quotePatchName(output, options.quotingStyle)} (read from ${displayName})`}
|
|
866
|
+
`);
|
|
867
|
+
if (autoReversed) await appendStatus("Reversed (or previously applied) patch detected! Assuming -R.\n");
|
|
723
868
|
for (const outcome of outcomes) {
|
|
724
|
-
if (outcome.misordered)
|
|
869
|
+
if (outcome.misordered) await appendStatus("misordered hunks! output would be garbled\n");
|
|
725
870
|
if (options.quiet) continue;
|
|
726
|
-
if (outcome.failed && options.merge)
|
|
727
|
-
|
|
728
|
-
else if (outcome.failed)
|
|
729
|
-
|
|
730
|
-
else if (options.verbose || outcome.offset || outcome.fuzz)
|
|
731
|
-
|
|
871
|
+
if (outcome.failed && options.merge) await appendStatus(`Hunk #${outcome.index} NOT MERGED at ${outcome.mergeRange?.[0] ?? outcome.line}-${outcome.mergeRange?.[1] ?? outcome.line}.
|
|
872
|
+
`);
|
|
873
|
+
else if (outcome.failed) await appendStatus(`Hunk #${outcome.index} FAILED at ${outcome.line}.
|
|
874
|
+
`);
|
|
875
|
+
else if (options.verbose || outcome.offset || outcome.fuzz) await appendStatus(`Hunk #${outcome.index} succeeded at ${outcome.line}${outcome.fuzz ? ` with fuzz ${outcome.fuzz}` : ""}${outcome.offset ? ` (offset ${outcome.offset} ${outcome.offset === 1 ? "line" : "lines"})` : ""}.
|
|
876
|
+
`);
|
|
732
877
|
}
|
|
733
|
-
if (failed.length && !options.merge)
|
|
734
|
-
|
|
735
|
-
if (deletion && result.size !== 0)
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
if (backup !== void 0) budget.outputLength(backup.size);
|
|
740
|
-
await status(message);
|
|
878
|
+
if (failed.length && !options.merge) await appendStatus(`${failed.length} out of ${outcomes.length} ${outcomes.length === 1 ? "hunk" : "hunks"} FAILED${options.dryRun || rejectPath === void 0 ? "" : ` -- saving rejects to file ${rejectDestination}`}
|
|
879
|
+
`);
|
|
880
|
+
if (deletion && result.size !== 0) await appendStatus(`Not deleting file ${name} as content differs from patch
|
|
881
|
+
`);
|
|
882
|
+
await appendStatus(timeMessage);
|
|
883
|
+
await flushStatus();
|
|
741
884
|
touched.add(path);
|
|
742
885
|
if (options.atomic) {
|
|
743
886
|
if (outputToStdout) stdoutItems.push(item);
|
|
@@ -761,7 +904,7 @@ ${headers}--------------------------
|
|
|
761
904
|
} catch (error) {
|
|
762
905
|
context.signal.throwIfAborted();
|
|
763
906
|
if (committed === 0 && !publishing) throw error;
|
|
764
|
-
throw new
|
|
907
|
+
throw new ToolError3(`commit stopped; ${committed}/${authorized.length} files committed; failing operation may have side effects; path ${activePath}: ${publicDiagnosticMessage(error, budget.context.onInternalError)}`);
|
|
765
908
|
}
|
|
766
909
|
}
|
|
767
910
|
if (options.atomic && (!options.dryRun || outputToStdout)) {
|
|
@@ -774,18 +917,18 @@ ${headers}--------------------------
|
|
|
774
917
|
committed++;
|
|
775
918
|
} catch (error) {
|
|
776
919
|
context.signal.throwIfAborted();
|
|
777
|
-
throw new
|
|
920
|
+
throw new ToolError3(`commit stopped; ${committed}/${prepared.length} files committed; failing operation may have side effects; path ${item.path}: ${publicDiagnosticMessage(error, budget.context.onInternalError)}`);
|
|
778
921
|
}
|
|
779
922
|
for (const parent of item.parents) parents.add(parent);
|
|
780
923
|
}
|
|
781
924
|
}
|
|
782
925
|
if (!options.dryRun) await pruneDirectories(parents, budget);
|
|
783
926
|
if (options.verbose) await status("done\n");
|
|
784
|
-
|
|
927
|
+
await flushStatus(true);
|
|
785
928
|
if (progress?.error) throw progress.error;
|
|
786
929
|
return exitCode;
|
|
787
930
|
} finally {
|
|
788
|
-
await documents
|
|
931
|
+
await closeDocumentResources2([messages, documents, bodies]);
|
|
789
932
|
}
|
|
790
933
|
}
|
|
791
934
|
function patchCommand(options = {}) {
|