@poe-platform/safe-bash 0.1.799 → 0.1.801

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1076) hide show
  1. package/README.md +48 -22
  2. package/dist/image-ast/index.browser.js +1503 -98
  3. package/dist/image-ast/index.js +1503 -98
  4. package/dist/mp4-ast/types.d.ts +1 -0
  5. package/dist/office-package/zip.d.ts +2 -0
  6. package/dist/office-package/zip.js +1 -1
  7. package/dist/pdf-ast/index.js +5 -4
  8. package/dist/safe-bash/chunks/{chunk-LUOFIVNI.js → chunk-3NDIFSNM.js} +3 -3
  9. package/dist/safe-bash/chunks/chunk-3R3AANOR.js +26 -0
  10. package/dist/safe-bash/chunks/{chunk-TRVGCN3U.js → chunk-45PK3NWI.js} +4 -4
  11. package/dist/safe-bash/chunks/{chunk-KHMGTPD6.js → chunk-46Z5E5EV.js} +2 -2
  12. package/dist/safe-bash/chunks/{chunk-XB3B7KMM.js → chunk-6O77NL2S.js} +1 -1
  13. package/dist/safe-bash/chunks/{chunk-T3JTVIEP.js → chunk-6PAVEFT3.js} +1 -1
  14. package/dist/safe-bash/chunks/{chunk-PYVEAFJM.js → chunk-74GHTNJA.js} +3 -2
  15. package/dist/safe-bash/chunks/{chunk-LQHGH25W.js → chunk-7R5BDCG7.js} +1 -1
  16. package/dist/safe-bash/chunks/{chunk-WUNK5NXJ.js → chunk-7VNF5BFF.js} +1140 -1660
  17. package/dist/safe-bash/chunks/{chunk-NHOXKQNE.js → chunk-A7XEHALN.js} +6 -6
  18. package/dist/safe-bash/chunks/{chunk-MHZ24KEI.js → chunk-AM5ESLPH.js} +1 -1
  19. package/dist/safe-bash/chunks/{chunk-3L3T6LYV.js → chunk-AUSNDQTJ.js} +1 -1
  20. package/dist/safe-bash/chunks/{chunk-YG5WAHK7.js → chunk-B7TAL7S5.js} +1 -3
  21. package/dist/safe-bash/chunks/{chunk-K7IQZE7D.js → chunk-C5OWC2TL.js} +1 -1
  22. package/dist/safe-bash/chunks/{chunk-F3RV2F72.js → chunk-CHYGPFVM.js} +1 -1
  23. package/dist/safe-bash/chunks/{chunk-M4CFCXHN.js → chunk-CS4MNM6I.js} +1 -1
  24. package/dist/safe-bash/chunks/{chunk-H6JW3E4F.js → chunk-CTVWDACF.js} +1 -1
  25. package/dist/safe-bash/chunks/{chunk-KTGR4U57.js → chunk-D3ANYGMC.js} +2 -3
  26. package/dist/safe-bash/chunks/{chunk-ENR3HB2B.js → chunk-E7OYNDGL.js} +1 -2
  27. package/dist/safe-bash/chunks/{chunk-SOZK5JVX.js → chunk-FBUCWVTE.js} +1 -1
  28. package/dist/safe-bash/chunks/{chunk-NX2SQVON.js → chunk-FNDNHAGE.js} +46 -27
  29. package/dist/safe-bash/chunks/{chunk-KCVSVD65.js → chunk-I5HZ4FGE.js} +1 -1
  30. package/dist/safe-bash/chunks/{chunk-KMH2DF3I.js → chunk-ICFDYV64.js} +7 -2
  31. package/dist/safe-bash/chunks/{chunk-T5KKDMYB.js → chunk-IVRQ4BXL.js} +7 -1
  32. package/dist/safe-bash/chunks/{chunk-KV7PKOHV.js → chunk-IWDICZVK.js} +1 -1
  33. package/dist/safe-bash/chunks/{chunk-I4OAEOP6.js → chunk-J42RIHHJ.js} +1 -1
  34. package/dist/safe-bash/chunks/chunk-K6VCD7IY.js +106 -0
  35. package/dist/safe-bash/chunks/{chunk-63FXVDGF.js → chunk-LVOBFF4D.js} +1 -1
  36. package/dist/safe-bash/chunks/{chunk-U5NUZPCC.js → chunk-MHMMRCYC.js} +1 -1
  37. package/dist/safe-bash/chunks/{chunk-6HZYFL3H.js → chunk-NR3EM4LS.js} +1 -1
  38. package/dist/safe-bash/chunks/{chunk-VYZTG3GV.js → chunk-NZQXYWA3.js} +1 -1
  39. package/dist/safe-bash/chunks/{chunk-JSVX4VIA.js → chunk-OQRVVGR6.js} +3 -2
  40. package/dist/safe-bash/chunks/{chunk-B3DDEDH2.js → chunk-OV6IHKO6.js} +2 -2
  41. package/dist/safe-bash/chunks/{chunk-SPYL72GN.js → chunk-PQRAK7HU.js} +1196 -5781
  42. package/dist/safe-bash/chunks/chunk-SZH7EJLD.js +9221 -0
  43. package/dist/safe-bash/chunks/{chunk-AKC46AF6.js → chunk-TFIBK2GI.js} +8 -41
  44. package/dist/safe-bash/chunks/{chunk-ZNAFMYIA.js → chunk-UE5KZDEK.js} +2 -2
  45. package/dist/safe-bash/chunks/{chunk-QU3BVQ53.js → chunk-UTBUUFDM.js} +1 -1
  46. package/dist/safe-bash/chunks/{chunk-6IBTC4YL.js → chunk-VQDD3G76.js} +93 -39
  47. package/dist/safe-bash/chunks/{chunk-IUTD5FH5.js → chunk-VTH3MLDU.js} +2 -7
  48. package/dist/safe-bash/chunks/{chunk-LLZCZ24K.js → chunk-XVOSKJE2.js} +1 -1
  49. package/dist/safe-bash/chunks/{csvkit-W2UEKH6P.js → csvkit-TACDU7FC.js} +3 -3
  50. package/dist/safe-bash/chunks/{ffmpeg-42CGASMV.js → ffmpeg-WTC3TEFI.js} +2 -2
  51. package/dist/safe-bash/chunks/{gh-26GYLH6D.js → gh-6WU6PXL4.js} +2 -2
  52. package/dist/safe-bash/chunks/{git-YREKMUVD.js → git-EFZIGJW4.js} +2 -2
  53. package/dist/safe-bash/chunks/{imagemagick-3YIX4XO2.js → imagemagick-EIEYGWPF.js} +2 -2
  54. package/dist/safe-bash/chunks/{implementation-E3YMKU3Z.js → implementation-MLFHUQ5M.js} +2 -2
  55. package/dist/safe-bash/chunks/mmdc-ROQJT5HQ.js +118 -0
  56. package/dist/safe-bash/chunks/{pdfimages-UE2UISP2.js → pdfimages-DW7LWXFI.js} +2 -2
  57. package/dist/safe-bash/chunks/{pdfinfo-RGARKLI5.js → pdfinfo-TIP6XLUQ.js} +4 -12
  58. package/dist/safe-bash/chunks/{pdftk-JY3WVCCC.js → pdftk-DMG22ITZ.js} +2 -2
  59. package/dist/safe-bash/chunks/{pdftoppm-GPD3BMPY.js → pdftoppm-WNDYR72T.js} +2 -2
  60. package/dist/safe-bash/chunks/{pdftotext-K7GQ2QJZ.js → pdftotext-5IPZ4NI7.js} +2 -2
  61. package/dist/safe-bash/chunks/{qpdf-F4U7WUSU.js → qpdf-TTX2DIUA.js} +2 -2
  62. package/dist/safe-bash/chunks/{sips-RWENS7X5.js → sips-XYS46JPJ.js} +2 -2
  63. package/dist/safe-bash/chunks/{soffice-IT6W2C5F.js → soffice-TU73E5KL.js} +2 -2
  64. package/dist/safe-bash/chunks/{wkhtmltopdf-JYNDAHIZ.js → wkhtmltopdf-FSZ2CHGE.js} +2 -2
  65. package/dist/safe-bash/command-chunks/{chunk-QBGA56UH.js → chunk-2ELYGJDD.js} +7 -7
  66. package/dist/safe-bash/command-chunks/chunk-2FGJYFWZ.js +44 -0
  67. package/dist/safe-bash/command-chunks/chunk-2H4JTFIL.js +53 -0
  68. package/dist/safe-bash/command-chunks/{chunk-52PCQXD2.js → chunk-2NHI5F5S.js} +2 -1
  69. package/dist/safe-bash/command-chunks/{chunk-HDKVO47G.js → chunk-2SQEIUGJ.js} +3 -3
  70. package/dist/safe-bash/command-chunks/chunk-364TMWBT.js +946 -0
  71. package/dist/safe-bash/command-chunks/chunk-3E2OIS2J.js +7037 -0
  72. package/dist/safe-bash/command-chunks/chunk-3HHCU5YU.js +380 -0
  73. package/dist/safe-bash/command-chunks/{chunk-TF6OA2GK.js → chunk-3NV3HYT2.js} +1 -1
  74. package/dist/safe-bash/command-chunks/chunk-4B7Y7S6E.js +61 -0
  75. package/dist/safe-bash/command-chunks/{chunk-LLCXZKZ6.js → chunk-4BB2SWJ5.js} +2 -2
  76. package/dist/safe-bash/command-chunks/{chunk-IEXHHNOF.js → chunk-4J5CZ2DP.js} +2 -7
  77. package/dist/safe-bash/command-chunks/{chunk-WDHI3S6Y.js → chunk-4OOUQTQO.js} +1 -1
  78. package/dist/safe-bash/command-chunks/chunk-4ZHMW6F5.js +104 -0
  79. package/dist/safe-bash/command-chunks/{chunk-YMONDXET.js → chunk-4ZQWGOZB.js} +2 -2
  80. package/dist/safe-bash/command-chunks/chunk-5BSTFCXG.js +553 -0
  81. package/dist/safe-bash/command-chunks/{chunk-MKQVQMXO.js → chunk-5LU4UCBR.js} +1 -1
  82. package/dist/safe-bash/command-chunks/chunk-5PWJG2UK.js +174 -0
  83. package/dist/safe-bash/command-chunks/chunk-5TBUOBDE.js +346 -0
  84. package/dist/safe-bash/command-chunks/{chunk-JMPP4TCW.js → chunk-5UBXNSFZ.js} +3 -2
  85. package/dist/safe-bash/command-chunks/chunk-5XY4DTNG.js +34 -0
  86. package/dist/safe-bash/command-chunks/chunk-5ZMZ573Q.js +140 -0
  87. package/dist/safe-bash/command-chunks/{chunk-3NG75MOB.js → chunk-67GQA75T.js} +1 -1
  88. package/dist/safe-bash/command-chunks/chunk-67QKREJK.js +347 -0
  89. package/dist/safe-bash/command-chunks/{chunk-L6SU4S26.js → chunk-6B7WQIKB.js} +0 -7
  90. package/dist/safe-bash/command-chunks/chunk-6BNTBWIK.js +327 -0
  91. package/dist/safe-bash/command-chunks/chunk-6EPHJGGF.js +23 -0
  92. package/dist/safe-bash/command-chunks/chunk-6F4XCVON.js +266 -0
  93. package/dist/safe-bash/command-chunks/chunk-6KJ3LPI2.js +94 -0
  94. package/dist/safe-bash/command-chunks/{chunk-HLDTOR7M.js → chunk-6ZVI7LUY.js} +1 -1
  95. package/dist/safe-bash/command-chunks/{chunk-X6NJC3IC.js → chunk-75OFBY5R.js} +1 -1
  96. package/dist/safe-bash/command-chunks/chunk-7K6JYKPJ.js +422 -0
  97. package/dist/safe-bash/command-chunks/chunk-7N2LI2KO.js +206 -0
  98. package/dist/safe-bash/command-chunks/{chunk-MRW5HD2D.js → chunk-7O3E4LPT.js} +4 -22
  99. package/dist/safe-bash/command-chunks/chunk-7U7EXOXX.js +1392 -0
  100. package/dist/safe-bash/command-chunks/{chunk-6CYTRQ24.js → chunk-7VTKQUA5.js} +20 -17
  101. package/dist/safe-bash/command-chunks/{chunk-BZPAWTUL.js → chunk-AEF5BA3D.js} +1 -1
  102. package/dist/safe-bash/command-chunks/{pptx-GBPNWNEP-7EQEVXV5.js → chunk-AI5JAXQF.js} +34820 -18029
  103. package/dist/safe-bash/command-chunks/{chunk-63R3FEZJ.js → chunk-AIV5BF5W.js} +1 -1
  104. package/dist/safe-bash/command-chunks/{chunk-AYUTO323.js → chunk-AKJG2XD3.js} +2 -18
  105. package/dist/safe-bash/command-chunks/{chunk-J34TZVMW.js → chunk-ALDC4XP4.js} +0 -5
  106. package/dist/safe-bash/command-chunks/chunk-AMO3THU4.js +105 -0
  107. package/dist/safe-bash/command-chunks/chunk-ARBYOQUZ.js +65 -0
  108. package/dist/safe-bash/command-chunks/chunk-BAGCY35S.js +231 -0
  109. package/dist/safe-bash/command-chunks/chunk-BAXU7B5Z.js +101 -0
  110. package/dist/safe-bash/command-chunks/{chunk-44AHAB5O.js → chunk-BDSMROQZ.js} +1 -4
  111. package/dist/safe-bash/command-chunks/chunk-BNOU5YQS.js +182 -0
  112. package/dist/safe-bash/command-chunks/{chunk-4ZALPDBV.js → chunk-BPE5INLI.js} +2 -2
  113. package/dist/safe-bash/command-chunks/{chunk-OT4LZMLB.js → chunk-BR73BIOW.js} +1 -1
  114. package/dist/safe-bash/command-chunks/chunk-C5YYCQHW.js +1444 -0
  115. package/dist/safe-bash/command-chunks/chunk-C7I25AAL.js +25 -0
  116. package/dist/safe-bash/command-chunks/{chunk-4ONEXMD3.js → chunk-CAP7ZJSY.js} +8 -8
  117. package/dist/safe-bash/command-chunks/{chunk-DWFLVJC6.js → chunk-CCRHMAU5.js} +2 -1
  118. package/dist/safe-bash/command-chunks/chunk-CQ5YGOGB.js +150 -0
  119. package/dist/safe-bash/command-chunks/{chunk-JCNNOMBV.js → chunk-CQTRW45K.js} +3 -2
  120. package/dist/safe-bash/command-chunks/{chunk-N2F74VRO.js → chunk-CZ7EN3JG.js} +1 -1
  121. package/dist/safe-bash/command-chunks/chunk-DB453IE6.js +122 -0
  122. package/dist/safe-bash/command-chunks/{chunk-KKG4BAFZ.js → chunk-DIEPXUM4.js} +6 -0
  123. package/dist/safe-bash/command-chunks/chunk-DOKKNRRM.js +87 -0
  124. package/dist/safe-bash/command-chunks/{chunk-2PX5B7T5.js → chunk-DQAVUDDX.js} +2 -2
  125. package/dist/safe-bash/command-chunks/chunk-DT7BCTWY.js +249 -0
  126. package/dist/safe-bash/command-chunks/{chunk-6BETHLXZ.js → chunk-DZCY63VJ.js} +13 -11
  127. package/dist/safe-bash/command-chunks/{chunk-QUENU6GM.js → chunk-E55UKBIE.js} +3 -3
  128. package/dist/safe-bash/command-chunks/chunk-EK6YNAXT.js +343 -0
  129. package/dist/safe-bash/command-chunks/chunk-EQ4HV54N.js +22 -0
  130. package/dist/safe-bash/command-chunks/{chunk-HLGKIZ25.js → chunk-F6OYH562.js} +2 -0
  131. package/dist/safe-bash/command-chunks/{chunk-MC3VWLIZ.js → chunk-FDBUV4HJ.js} +28 -19
  132. package/dist/safe-bash/command-chunks/{chunk-7FKUC34S.js → chunk-FPVUD6TH.js} +6 -3
  133. package/dist/safe-bash/command-chunks/chunk-FXELCPFX.js +195 -0
  134. package/dist/safe-bash/command-chunks/chunk-FXOA7RBK.js +42 -0
  135. package/dist/safe-bash/command-chunks/{chunk-LPORMIZS.js → chunk-FZTK4MFI.js} +9 -9
  136. package/dist/safe-bash/command-chunks/{chunk-K543PB3I.js → chunk-G66QUHIZ.js} +6 -35
  137. package/dist/safe-bash/command-chunks/chunk-GFQZCKO6.js +272 -0
  138. package/dist/safe-bash/command-chunks/{chunk-CU5RLO62.js → chunk-GLOZX57Y.js} +92 -18
  139. package/dist/safe-bash/command-chunks/chunk-GMIHJYDG.js +331 -0
  140. package/dist/safe-bash/command-chunks/chunk-GOB777HR.js +97 -0
  141. package/dist/safe-bash/command-chunks/chunk-GRBWW4SG.js +48 -0
  142. package/dist/safe-bash/command-chunks/{chunk-PPNBNFAU.js → chunk-GYQ2HAKQ.js} +8 -8
  143. package/dist/safe-bash/command-chunks/chunk-H622NS6Z.js +11 -0
  144. package/dist/safe-bash/command-chunks/{chunk-UI32HWGS.js → chunk-HMOZ6XVJ.js} +1 -1
  145. package/dist/safe-bash/command-chunks/{chunk-AVSPNLWV.js → chunk-I237SNW5.js} +1 -1
  146. package/dist/safe-bash/command-chunks/{chunk-43GSSUAY.js → chunk-II77KPZN.js} +5 -5
  147. package/dist/safe-bash/command-chunks/{chunk-ZS3QPNUL.js → chunk-IR2BY7EL.js} +21 -6
  148. package/dist/safe-bash/command-chunks/{chunk-SG424QWS.js → chunk-JDYXY44P.js} +2 -2
  149. package/dist/safe-bash/command-chunks/chunk-JNZ3CVAE.js +147 -0
  150. package/dist/safe-bash/command-chunks/{chunk-4QJOYXVB.js → chunk-JV7LBUTP.js} +1 -1
  151. package/dist/safe-bash/command-chunks/{chunk-IKS2YXZQ.js → chunk-K67MWWWH.js} +3 -3
  152. package/dist/safe-bash/command-chunks/chunk-KFVV7ZJO.js +216 -0
  153. package/dist/safe-bash/command-chunks/{chunk-G4PNVO6Z.js → chunk-KP7AO66M.js} +1 -1
  154. package/dist/safe-bash/command-chunks/{chunk-KMCZ6P4O.js → chunk-KQLD3AED.js} +68 -7
  155. package/dist/safe-bash/command-chunks/chunk-KWESKQHR.js +25 -0
  156. package/dist/safe-bash/command-chunks/{chunk-YZ5SVZFD.js → chunk-KXU3IRUO.js} +3 -3
  157. package/dist/safe-bash/command-chunks/{chunk-C7IHMJEW.js → chunk-KZC5UWFF.js} +2 -2
  158. package/dist/safe-bash/command-chunks/{chunk-2WRTLCGK.js → chunk-LAOM65EE.js} +5 -5
  159. package/dist/safe-bash/command-chunks/chunk-LE5LZNHE.js +204 -0
  160. package/dist/safe-bash/command-chunks/{chunk-HFII3QYO.js → chunk-LWS62ISU.js} +46 -32
  161. package/dist/safe-bash/command-chunks/{chunk-BZDDAPSV.js → chunk-LWSBAWLT.js} +1 -1
  162. package/dist/safe-bash/command-chunks/chunk-MDH5T4OS.js +41 -0
  163. package/dist/safe-bash/command-chunks/{chunk-X7TM3AKW.js → chunk-MIXBO6U7.js} +20 -7
  164. package/dist/safe-bash/command-chunks/chunk-MM6HU6CX.js +20 -0
  165. package/dist/safe-bash/command-chunks/{chunk-MYJAZ3U2.js → chunk-MPL2466A.js} +2 -2
  166. package/dist/safe-bash/command-chunks/{chunk-HLBX5IRS.js → chunk-MQFIPHIQ.js} +46 -81
  167. package/dist/safe-bash/command-chunks/{chunk-ZJBR5Q5I.js → chunk-MSFXC3OC.js} +4 -4
  168. package/dist/safe-bash/command-chunks/{chunk-NI7MKJPN.js → chunk-MTQH74CF.js} +3 -55
  169. package/dist/safe-bash/command-chunks/chunk-MWUZZWXK.js +354 -0
  170. package/dist/safe-bash/command-chunks/chunk-N4PFUSRM.js +35 -0
  171. package/dist/safe-bash/command-chunks/chunk-NCD7PEWH.js +298 -0
  172. package/dist/safe-bash/command-chunks/chunk-NFGI5IGF.js +266 -0
  173. package/dist/safe-bash/command-chunks/{chunk-I3K5RYU4.js → chunk-NKFYQSES.js} +73 -26
  174. package/dist/safe-bash/command-chunks/{chunk-KVFCSLKK.js → chunk-NXEQ3ESQ.js} +6 -0
  175. package/dist/safe-bash/command-chunks/{chunk-NGWB2YBL.js → chunk-O4JQSB7O.js} +1 -1
  176. package/dist/safe-bash/command-chunks/{chunk-7L24L4UO.js → chunk-OQU6UT6X.js} +2 -20
  177. package/dist/safe-bash/command-chunks/{chunk-3VGGYEDH.js → chunk-ORYGZYKW.js} +4 -3
  178. package/dist/safe-bash/command-chunks/{chunk-ZXKW7SJ2.js → chunk-OYYV7ZAF.js} +2 -2
  179. package/dist/safe-bash/command-chunks/chunk-P2N33UMN.js +270 -0
  180. package/dist/safe-bash/command-chunks/{chunk-Q7Q5GM5S.js → chunk-P5APDEFB.js} +2 -2
  181. package/dist/safe-bash/command-chunks/{chunk-X2YQLGKS.js → chunk-PCEFOYA3.js} +240 -148
  182. package/dist/safe-bash/command-chunks/{chunk-OLQG7ZCN.js → chunk-PEF7K3UQ.js} +136 -75
  183. package/dist/safe-bash/command-chunks/chunk-PII4YEZW.js +123 -0
  184. package/dist/safe-bash/command-chunks/{chunk-AIRGA2SU.js → chunk-PMBFZXTK.js} +1 -1
  185. package/dist/safe-bash/command-chunks/{chunk-ZT4KSS2V.js → chunk-PTT3I223.js} +1 -1
  186. package/dist/safe-bash/command-chunks/{chunk-4Y3WVMK4.js → chunk-PV66YWHB.js} +1 -0
  187. package/dist/safe-bash/command-chunks/chunk-Q3EWDEUQ.js +185 -0
  188. package/dist/safe-bash/command-chunks/{chunk-AXK3H4PX.js → chunk-QJ33BHI4.js} +1 -1
  189. package/dist/safe-bash/command-chunks/chunk-QKFSRZGQ.js +1091 -0
  190. package/dist/safe-bash/command-chunks/{chunk-JZSNU2MY.js → chunk-QKJLP53H.js} +2 -2
  191. package/dist/safe-bash/command-chunks/{chunk-VVI4Z73I.js → chunk-QP4R6GLA.js} +5 -1
  192. package/dist/safe-bash/command-chunks/chunk-RMWQAAO5.js +2488 -0
  193. package/dist/safe-bash/command-chunks/{chunk-QDTBMSBE.js → chunk-RO62EWX6.js} +2 -2
  194. package/dist/safe-bash/command-chunks/{chunk-HRLIAMXC.js → chunk-RZZI24ZE.js} +7 -6
  195. package/dist/safe-bash/command-chunks/{chunk-PFAADCB5.js → chunk-SDNBCQ3X.js} +10 -24
  196. package/dist/safe-bash/command-chunks/chunk-SEM36PG5.js +11 -0
  197. package/dist/safe-bash/command-chunks/{chunk-36O5OT7E.js → chunk-T35Y7YQD.js} +1 -1
  198. package/dist/safe-bash/command-chunks/{chunk-ESMCX3YV.js → chunk-TGSNCQSR.js} +710 -143
  199. package/dist/safe-bash/command-chunks/chunk-TIOCQVUQ.js +557 -0
  200. package/dist/safe-bash/command-chunks/{chunk-T5H5UJQ3.js → chunk-TNOA7FCQ.js} +1 -1
  201. package/dist/safe-bash/command-chunks/{chunk-GN2TKLE7.js → chunk-TS65BJHG.js} +5 -5
  202. package/dist/safe-bash/command-chunks/chunk-TSCGT46G.js +363 -0
  203. package/dist/safe-bash/command-chunks/chunk-UG7SMZFF.js +178 -0
  204. package/dist/safe-bash/command-chunks/{chunk-KBEURXFF.js → chunk-UN6WS55J.js} +3 -3
  205. package/dist/safe-bash/command-chunks/chunk-UXSR5BZH.js +136 -0
  206. package/dist/safe-bash/command-chunks/{chunk-SX2X3IH4.js → chunk-V2V5OCL3.js} +1 -1
  207. package/dist/safe-bash/command-chunks/chunk-V6BEDRMQ.js +112 -0
  208. package/dist/safe-bash/command-chunks/chunk-V7A7DRTU.js +293 -0
  209. package/dist/safe-bash/command-chunks/{chunk-5SHGJ7NO.js → chunk-VA5ZHYYA.js} +73 -33
  210. package/dist/safe-bash/command-chunks/{chunk-J4PEQWSF.js → chunk-VGG2DL5Q.js} +0 -1
  211. package/dist/safe-bash/command-chunks/chunk-VPR5LQYX.js +1228 -0
  212. package/dist/safe-bash/command-chunks/{chunk-EIVW3X3N.js → chunk-VSRGNQCP.js} +11 -6
  213. package/dist/safe-bash/command-chunks/{chunk-TYVCKQDH.js → chunk-VXSLJH7G.js} +56 -6
  214. package/dist/safe-bash/command-chunks/{chunk-PXYOWWMV.js → chunk-W7RAD4EW.js} +4 -3
  215. package/dist/safe-bash/command-chunks/{src-UJOWAS2S.js → chunk-WD3ERGRY.js} +77 -277
  216. package/dist/safe-bash/command-chunks/{chunk-5ZSM4UFN.js → chunk-WECIOOQB.js} +8 -64
  217. package/dist/safe-bash/command-chunks/{chunk-YFSDDFGV.js → chunk-WH627NJL.js} +446 -53
  218. package/dist/safe-bash/command-chunks/chunk-WNE7FPVR.js +236 -0
  219. package/dist/safe-bash/command-chunks/{chunk-UKS2XJZI.js → chunk-WPYIOKE3.js} +4 -4
  220. package/dist/safe-bash/command-chunks/{chunk-HHP343KT.js → chunk-WTECBRU4.js} +1 -1
  221. package/dist/safe-bash/command-chunks/{chunk-AO6Z5EQ7.js → chunk-WVE64WM2.js} +6 -5
  222. package/dist/safe-bash/command-chunks/chunk-WVHONVZ4.js +594 -0
  223. package/dist/safe-bash/command-chunks/chunk-XIIBTGC5.js +580 -0
  224. package/dist/safe-bash/command-chunks/chunk-XJXU3VVH.js +737 -0
  225. package/dist/safe-bash/command-chunks/chunk-XNLFHHOC.js +63 -0
  226. package/dist/safe-bash/command-chunks/{chunk-XAFSZDY2.js → chunk-XS72HTMA.js} +11 -0
  227. package/dist/safe-bash/command-chunks/chunk-Y5INTD6S.js +220 -0
  228. package/dist/safe-bash/command-chunks/chunk-YIQACGEW.js +43 -0
  229. package/dist/safe-bash/command-chunks/chunk-YOF7R4OY.js +80 -0
  230. package/dist/safe-bash/command-chunks/{chunk-VZHRZMS7.js → chunk-YOFC45RK.js} +1 -1
  231. package/dist/safe-bash/command-chunks/{chunk-2FUAW6GO.js → chunk-Z45N42QC.js} +75 -11
  232. package/dist/safe-bash/command-chunks/chunk-ZHUWOUWB.js +618 -0
  233. package/dist/safe-bash/command-chunks/{chunk-OPUJSTHS.js → chunk-ZYHTWNAE.js} +215 -67
  234. package/dist/safe-bash/command-chunks/chunk-ZYXH3B66.js +636 -0
  235. package/dist/safe-bash/command-chunks/{model-store-L35QTZMJ.js → model-store-WPKMRPV4.js} +2 -2
  236. package/dist/safe-bash/command-chunks/pptx-7G52EJ6L-4JACH5FB.js +625 -0
  237. package/dist/safe-bash/command-chunks/python-worker-source-TYOFJMCW.js +4 -0
  238. package/dist/safe-bash/command-chunks/src-ICMQISAA.js +501 -0
  239. package/dist/safe-bash/commands/archive/create.d.ts +1 -17
  240. package/dist/safe-bash/commands/archive/create.js +1 -252
  241. package/dist/safe-bash/commands/archive/extract.d.ts +1 -11
  242. package/dist/safe-bash/commands/archive/extract.js +1 -640
  243. package/dist/safe-bash/commands/archive/format.d.ts +1 -32
  244. package/dist/safe-bash/commands/archive/format.js +1 -225
  245. package/dist/safe-bash/commands/archive/index.d.ts +5 -10
  246. package/dist/safe-bash/commands/archive/index.js +6 -931
  247. package/dist/safe-bash/commands/archive/listing.d.ts +1 -2
  248. package/dist/safe-bash/commands/archive/listing.js +1 -21
  249. package/dist/safe-bash/commands/archive/modes.d.ts +1 -5
  250. package/dist/safe-bash/commands/archive/modes.js +1 -182
  251. package/dist/safe-bash/commands/archive/options.d.ts +1 -53
  252. package/dist/safe-bash/commands/archive/options.js +1 -462
  253. package/dist/safe-bash/commands/archive/stream.d.ts +1 -22
  254. package/dist/safe-bash/commands/archive/stream.js +1 -188
  255. package/dist/safe-bash/commands/archive/transform.d.ts +1 -16
  256. package/dist/safe-bash/commands/archive/transform.js +1 -85
  257. package/dist/safe-bash/commands/archive/unzip/arguments.d.ts +1 -53
  258. package/dist/safe-bash/commands/archive/unzip/arguments.js +1 -322
  259. package/dist/safe-bash/commands/archive/unzip/safety.d.ts +1 -32
  260. package/dist/safe-bash/commands/archive/unzip/safety.js +1 -295
  261. package/dist/safe-bash/commands/archive/unzip.d.ts +1 -3
  262. package/dist/safe-bash/commands/archive/unzip.js +1 -398
  263. package/dist/safe-bash/commands/archive/zip/aes.d.ts +1 -17
  264. package/dist/safe-bash/commands/archive/zip/aes.js +1 -156
  265. package/dist/safe-bash/commands/archive/zip/comments.d.ts +1 -17
  266. package/dist/safe-bash/commands/archive/zip/comments.js +1 -83
  267. package/dist/safe-bash/commands/archive/zip/crc.d.ts +1 -1
  268. package/dist/safe-bash/commands/archive/zip/crc.js +1 -1
  269. package/dist/safe-bash/commands/archive/zip/crypto.d.ts +1 -19
  270. package/dist/safe-bash/commands/archive/zip/crypto.js +1 -118
  271. package/dist/safe-bash/commands/archive/zip/dates.d.ts +1 -4
  272. package/dist/safe-bash/commands/archive/zip/dates.js +1 -66
  273. package/dist/safe-bash/commands/archive/zip/environment.d.ts +1 -2
  274. package/dist/safe-bash/commands/archive/zip/environment.js +1 -62
  275. package/dist/safe-bash/commands/archive/zip/grow.d.ts +1 -3
  276. package/dist/safe-bash/commands/archive/zip/grow.js +1 -2
  277. package/dist/safe-bash/commands/archive/zip/help.d.ts +1 -4
  278. package/dist/safe-bash/commands/archive/zip/help.js +1 -182
  279. package/dist/safe-bash/commands/archive/zip/line-endings.d.ts +1 -2
  280. package/dist/safe-bash/commands/archive/zip/line-endings.js +1 -194
  281. package/dist/safe-bash/commands/archive/zip/log.d.ts +1 -22
  282. package/dist/safe-bash/commands/archive/zip/log.js +1 -159
  283. package/dist/safe-bash/commands/archive/zip/lzma.d.ts +1 -9
  284. package/dist/safe-bash/commands/archive/zip/lzma.js +1 -40
  285. package/dist/safe-bash/commands/archive/zip/move.d.ts +1 -11
  286. package/dist/safe-bash/commands/archive/zip/move.js +1 -59
  287. package/dist/safe-bash/commands/archive/zip/names.d.ts +1 -2
  288. package/dist/safe-bash/commands/archive/zip/names.js +1 -33
  289. package/dist/safe-bash/commands/archive/zip/options.d.ts +1 -13
  290. package/dist/safe-bash/commands/archive/zip/options.js +1 -124
  291. package/dist/safe-bash/commands/archive/zip/repair.d.ts +1 -10
  292. package/dist/safe-bash/commands/archive/zip/repair.js +1 -392
  293. package/dist/safe-bash/commands/archive/zip/safety.d.ts +1 -54
  294. package/dist/safe-bash/commands/archive/zip/safety.js +1 -360
  295. package/dist/safe-bash/commands/archive/zip/sfx.d.ts +1 -4
  296. package/dist/safe-bash/commands/archive/zip/sfx.js +1 -52
  297. package/dist/safe-bash/commands/archive/zip/test-command.d.ts +1 -5
  298. package/dist/safe-bash/commands/archive/zip/test-command.js +1 -101
  299. package/dist/safe-bash/commands/archive/zip/volumes.d.ts +1 -21
  300. package/dist/safe-bash/commands/archive/zip/volumes.js +1 -281
  301. package/dist/safe-bash/commands/archive/zip/zip64.d.ts +1 -30
  302. package/dist/safe-bash/commands/archive/zip/zip64.js +1 -227
  303. package/dist/safe-bash/commands/archive/zip-format.d.ts +1 -68
  304. package/dist/safe-bash/commands/archive/zip-format.js +1 -1075
  305. package/dist/safe-bash/commands/archive/zip.d.ts +1 -3
  306. package/dist/safe-bash/commands/archive/zip.js +1 -1523
  307. package/dist/safe-bash/commands/awk/index.d.ts +2 -0
  308. package/dist/safe-bash/commands/awk/index.js +2 -0
  309. package/dist/safe-bash/commands/bytes/compression/index.js +4 -2
  310. package/dist/safe-bash/commands/copy-preserve.d.ts +1 -0
  311. package/dist/safe-bash/commands/csplit/index.browser.js +2 -2
  312. package/dist/safe-bash/commands/curl/index.d.ts +2 -0
  313. package/dist/safe-bash/commands/curl/index.js +2 -0
  314. package/dist/safe-bash/commands/diff/index.d.ts +2 -0
  315. package/dist/safe-bash/commands/diff/index.js +2 -0
  316. package/dist/safe-bash/commands/diff-patch/diff-format.d.ts +1 -10
  317. package/dist/safe-bash/commands/diff-patch/diff-format.js +1 -237
  318. package/dist/safe-bash/commands/diff-patch/diff-options.d.ts +1 -38
  319. package/dist/safe-bash/commands/diff-patch/diff-options.js +1 -261
  320. package/dist/safe-bash/commands/diff-patch/diff-output.d.ts +1 -20
  321. package/dist/safe-bash/commands/diff-patch/diff-output.js +1 -290
  322. package/dist/safe-bash/commands/diff-patch/diff.d.ts +1 -2
  323. package/dist/safe-bash/commands/diff-patch/diff.js +1 -656
  324. package/dist/safe-bash/commands/diff-patch/index.d.ts +4 -5
  325. package/dist/safe-bash/commands/diff-patch/index.js +8 -333
  326. package/dist/safe-bash/commands/diff-patch/patch-envelope.d.ts +1 -2
  327. package/dist/safe-bash/commands/diff-patch/patch-envelope.js +1 -63
  328. package/dist/safe-bash/commands/diff-patch/patch-formats.d.ts +1 -7
  329. package/dist/safe-bash/commands/diff-patch/patch-formats.js +1 -264
  330. package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.d.ts +1 -41
  331. package/dist/safe-bash/commands/diff-patch/patch-gnu-paths.js +1 -263
  332. package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.d.ts +1 -3
  333. package/dist/safe-bash/commands/diff-patch/patch-gnu-reject.js +1 -100
  334. package/dist/safe-bash/commands/diff-patch/patch-path.d.ts +1 -3
  335. package/dist/safe-bash/commands/diff-patch/patch-path.js +1 -91
  336. package/dist/safe-bash/commands/diff-patch/patch-publication.d.ts +1 -13
  337. package/dist/safe-bash/commands/diff-patch/patch-publication.js +1 -107
  338. package/dist/safe-bash/commands/diff-patch/patch.d.ts +1 -2
  339. package/dist/safe-bash/commands/diff-patch/patch.js +1 -653
  340. package/dist/safe-bash/commands/diff-patch/shared.d.ts +1 -53
  341. package/dist/safe-bash/commands/diff-patch/shared.js +1 -267
  342. package/dist/safe-bash/commands/diff-patch/unified.d.ts +1 -52
  343. package/dist/safe-bash/commands/diff-patch/unified.js +1 -385
  344. package/dist/safe-bash/commands/directory-admission.d.ts +1 -3
  345. package/dist/safe-bash/commands/directory-admission.js +1 -26
  346. package/dist/safe-bash/commands/docx/index.browser.js +1 -1
  347. package/dist/safe-bash/commands/execution.js +19 -13
  348. package/dist/safe-bash/commands/factor/index.browser.js +2 -2
  349. package/dist/safe-bash/commands/filesystem.d.ts +1 -1
  350. package/dist/safe-bash/commands/filesystem.js +17 -13
  351. package/dist/safe-bash/commands/find/index.d.ts +2 -0
  352. package/dist/safe-bash/commands/find/index.js +2 -0
  353. package/dist/safe-bash/commands/find-format.d.ts +1 -20
  354. package/dist/safe-bash/commands/find-format.js +1 -161
  355. package/dist/safe-bash/commands/find.d.ts +2 -18
  356. package/dist/safe-bash/commands/find.js +2 -1236
  357. package/dist/safe-bash/commands/getopt/index.browser.js +2 -2
  358. package/dist/safe-bash/commands/gzip/index.d.ts +2 -0
  359. package/dist/safe-bash/commands/gzip/index.js +2 -0
  360. package/dist/safe-bash/commands/hexdump/index.browser.js +2 -2
  361. package/dist/safe-bash/commands/htmlq/index.d.ts +1 -1
  362. package/dist/safe-bash/commands/iconv/index.browser.js +2 -2
  363. package/dist/safe-bash/commands/line-endings/index.browser.js +2 -2
  364. package/dist/safe-bash/commands/line-endings/index.d.ts +1 -1
  365. package/dist/safe-bash/commands/line-endings/index.js +1 -262
  366. package/dist/safe-bash/commands/llm/index.browser.js +4 -2
  367. package/dist/safe-bash/commands/llm/providers/index.browser.js +1 -1
  368. package/dist/safe-bash/commands/mdq/index.browser.js +3 -3
  369. package/dist/safe-bash/commands/media/index.browser.js +1 -1
  370. package/dist/safe-bash/commands/metadata/chmod.d.ts +1 -4
  371. package/dist/safe-bash/commands/metadata/chmod.js +2 -63
  372. package/dist/safe-bash/commands/network/aggregate.d.ts +1 -4
  373. package/dist/safe-bash/commands/network/aggregate.js +1 -23
  374. package/dist/safe-bash/commands/network/args.d.ts +1 -68
  375. package/dist/safe-bash/commands/network/args.js +1 -321
  376. package/dist/safe-bash/commands/network/authorizer.d.ts +1 -6
  377. package/dist/safe-bash/commands/network/authorizer.js +1 -33
  378. package/dist/safe-bash/commands/network/body.d.ts +1 -9
  379. package/dist/safe-bash/commands/network/body.js +1 -393
  380. package/dist/safe-bash/commands/network/curl.d.ts +3 -13
  381. package/dist/safe-bash/commands/network/curl.js +6 -695
  382. package/dist/safe-bash/commands/network/deadline.d.ts +1 -2
  383. package/dist/safe-bash/commands/network/deadline.js +1 -14
  384. package/dist/safe-bash/commands/network/decode.d.ts +1 -2
  385. package/dist/safe-bash/commands/network/decode.js +1 -79
  386. package/dist/safe-bash/commands/network/fetch-transport.d.ts +1 -7
  387. package/dist/safe-bash/commands/network/fetch-transport.js +1 -94
  388. package/dist/safe-bash/commands/network/form-content-type.d.ts +1 -5
  389. package/dist/safe-bash/commands/network/form-content-type.js +1 -63
  390. package/dist/safe-bash/commands/network/form-headers.d.ts +1 -2
  391. package/dist/safe-bash/commands/network/form-headers.js +1 -35
  392. package/dist/safe-bash/commands/network/glob.d.ts +1 -7
  393. package/dist/safe-bash/commands/network/glob.js +1 -134
  394. package/dist/safe-bash/commands/network/index.browser.js +4 -12
  395. package/dist/safe-bash/commands/network/input.d.ts +1 -5
  396. package/dist/safe-bash/commands/network/input.js +1 -276
  397. package/dist/safe-bash/commands/network/output.d.ts +1 -6
  398. package/dist/safe-bash/commands/network/output.js +1 -131
  399. package/dist/safe-bash/commands/network/platform-portable.d.ts +1 -5
  400. package/dist/safe-bash/commands/network/platform-portable.js +1 -26
  401. package/dist/safe-bash/commands/network/private-address.d.ts +1 -1
  402. package/dist/safe-bash/commands/network/private-address.js +1 -44
  403. package/dist/safe-bash/commands/network/public.d.ts +2 -2
  404. package/dist/safe-bash/commands/network/public.js +2 -2
  405. package/dist/safe-bash/commands/network/shared.d.ts +1 -14
  406. package/dist/safe-bash/commands/network/shared.js +1 -71
  407. package/dist/safe-bash/commands/network/transport.js +2 -2
  408. package/dist/safe-bash/commands/network/types.d.ts +1 -37
  409. package/dist/safe-bash/commands/network/types.js +1 -31
  410. package/dist/safe-bash/commands/network/url.d.ts +1 -2
  411. package/dist/safe-bash/commands/network/url.js +1 -30
  412. package/dist/safe-bash/commands/network/wget.d.ts +3 -3
  413. package/dist/safe-bash/commands/network/wget.js +9 -332
  414. package/dist/safe-bash/commands/node/filesystem.js +3 -2
  415. package/dist/safe-bash/commands/node/index.browser.js +8 -9
  416. package/dist/safe-bash/commands/node/index.d.ts +3 -3
  417. package/dist/safe-bash/commands/node/index.js +5 -0
  418. package/dist/safe-bash/commands/node/safejs.d.ts +3 -3
  419. package/dist/safe-bash/commands/node/safejs.js +6 -1
  420. package/dist/safe-bash/commands/node/types.d.ts +1 -1
  421. package/dist/safe-bash/commands/node/types.js +1 -1
  422. package/dist/safe-bash/commands/node/unconfigured.d.ts +3 -0
  423. package/dist/safe-bash/commands/node/unconfigured.js +10 -0
  424. package/dist/safe-bash/commands/op/index.browser.js +3 -3
  425. package/dist/safe-bash/commands/patch/index.d.ts +2 -0
  426. package/dist/safe-bash/commands/patch/index.js +2 -0
  427. package/dist/safe-bash/commands/pdfinfo/index.js +2 -1
  428. package/dist/safe-bash/commands/pr/index.browser.js +2 -2
  429. package/dist/safe-bash/commands/predicates.js +3 -4
  430. package/dist/safe-bash/commands/python/host-capabilities.js +31 -14
  431. package/dist/safe-bash/commands/python/index.browser.js +11 -11
  432. package/dist/safe-bash/commands/python/llm-capability.d.ts +1 -0
  433. package/dist/safe-bash/commands/python/llm-capability.js +27 -7
  434. package/dist/safe-bash/commands/python/llm-module.js +11 -0
  435. package/dist/safe-bash/commands/python/manifest.d.ts +2 -0
  436. package/dist/safe-bash/commands/python/manifest.js +13 -6
  437. package/dist/safe-bash/commands/python/provisioning.js +1 -1
  438. package/dist/safe-bash/commands/python/shell-capability.d.ts +1 -0
  439. package/dist/safe-bash/commands/python/shell-capability.js +3 -2
  440. package/dist/safe-bash/commands/python/worker.browser.js +3 -3
  441. package/dist/safe-bash/commands/regex-execution/matching.js +1 -2
  442. package/dist/safe-bash/commands/regex-execution/public.browser.js +8 -8
  443. package/dist/safe-bash/commands/safejs/runtime.js +16 -7
  444. package/dist/safe-bash/commands/search/index.d.ts +1 -1
  445. package/dist/safe-bash/commands/search/index.js +1 -347
  446. package/dist/safe-bash/commands/search/portable.d.ts +2 -2
  447. package/dist/safe-bash/commands/search/portable.js +3 -2
  448. package/dist/safe-bash/commands/sed/index.d.ts +2 -0
  449. package/dist/safe-bash/commands/sed/index.js +2 -0
  450. package/dist/safe-bash/commands/standard.d.ts +1 -0
  451. package/dist/safe-bash/commands/standard.js +2 -1
  452. package/dist/safe-bash/commands/streams.js +6 -24
  453. package/dist/safe-bash/commands/tar/index.d.ts +2 -0
  454. package/dist/safe-bash/commands/tar/index.js +2 -0
  455. package/dist/safe-bash/commands/text-programs/awk-inspection.d.ts +1 -19
  456. package/dist/safe-bash/commands/text-programs/awk-inspection.js +1 -50
  457. package/dist/safe-bash/commands/text-programs/awk-pipes.d.ts +2 -0
  458. package/dist/safe-bash/commands/text-programs/awk-pipes.js +2 -0
  459. package/dist/safe-bash/commands/text-programs/awk-pretty.d.ts +1 -3
  460. package/dist/safe-bash/commands/text-programs/awk-pretty.js +1 -197
  461. package/dist/safe-bash/commands/text-programs/awk-quote.d.ts +1 -2
  462. package/dist/safe-bash/commands/text-programs/awk-quote.js +1 -15
  463. package/dist/safe-bash/commands/text-programs/awk-reader.d.ts +1 -42
  464. package/dist/safe-bash/commands/text-programs/awk-reader.js +1 -449
  465. package/dist/safe-bash/commands/text-programs/awk-retention.d.ts +1 -13
  466. package/dist/safe-bash/commands/text-programs/awk-retention.js +1 -51
  467. package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts +1 -150
  468. package/dist/safe-bash/commands/text-programs/awk-runtime.js +1 -2627
  469. package/dist/safe-bash/commands/text-programs/awk-syntax.d.ts +1 -142
  470. package/dist/safe-bash/commands/text-programs/awk-syntax.js +1 -509
  471. package/dist/safe-bash/commands/text-programs/awk-values.d.ts +1 -32
  472. package/dist/safe-bash/commands/text-programs/awk-values.js +1 -386
  473. package/dist/safe-bash/commands/text-programs/awk.d.ts +1 -3
  474. package/dist/safe-bash/commands/text-programs/awk.js +1 -361
  475. package/dist/safe-bash/commands/text-programs/inplace.d.ts +1 -16
  476. package/dist/safe-bash/commands/text-programs/inplace.js +1 -155
  477. package/dist/safe-bash/commands/text-programs/sed.d.ts +1 -3
  478. package/dist/safe-bash/commands/text-programs/sed.js +1 -1647
  479. package/dist/safe-bash/commands/text.js +268 -364
  480. package/dist/safe-bash/commands/tsort/index.browser.js +2 -2
  481. package/dist/safe-bash/commands/unzip/index.d.ts +2 -0
  482. package/dist/safe-bash/commands/unzip/index.js +2 -0
  483. package/dist/safe-bash/commands/wget/index.d.ts +2 -0
  484. package/dist/safe-bash/commands/wget/index.js +2 -0
  485. package/dist/safe-bash/commands/xml/index.browser.js +2 -2
  486. package/dist/safe-bash/commands/yq/index.browser.js +8 -3
  487. package/dist/safe-bash/commands/yq/index.d.ts +1 -6
  488. package/dist/safe-bash/commands/yq/index.js +1 -36
  489. package/dist/safe-bash/commands/zip/index.d.ts +2 -0
  490. package/dist/safe-bash/commands/zip/index.js +2 -0
  491. package/dist/safe-bash/core.browser.js +2 -2
  492. package/dist/safe-bash/core.d.ts +14 -2
  493. package/dist/safe-bash/core.js +8 -2
  494. package/dist/safe-bash/fs/s3/index.d.ts +2 -2
  495. package/dist/safe-bash/fs/s3/index.js +1 -1
  496. package/dist/safe-bash/full-core.browser.js +321 -286
  497. package/dist/safe-bash/jobs.browser.js +5 -5
  498. package/dist/safe-bash/lazy-mmdc.d.ts +6 -0
  499. package/dist/safe-bash/lazy-mmdc.js +23 -0
  500. package/dist/safe-bash/opt-in/commands/dd/index.js +2 -0
  501. package/dist/safe-bash/opt-in/commands/yq/mike.js +6 -13
  502. package/dist/safe-bash/opt-in/commands/yq/native-work.d.ts +1 -0
  503. package/dist/safe-bash/opt-in/commands/yq/native-work.js +17 -0
  504. package/dist/safe-bash/opt-in/optional/commands/shuf/options.d.ts +1 -0
  505. package/dist/safe-bash/opt-in/optional/commands/shuf/options.js +2 -4
  506. package/dist/safe-bash/opt-in/optional/commands/shuf/shuf.js +2 -1
  507. package/dist/safe-bash/optional-host.browser.js +15 -11
  508. package/dist/safe-bash/optional-host.d.ts +1 -1
  509. package/dist/safe-bash/optional-host.js +1 -1
  510. package/dist/safe-bash/playwright/ability-execution.js +3 -2
  511. package/dist/safe-bash/playwright/adapter.js +1 -1
  512. package/dist/safe-bash/playwright/controller.js +9 -8
  513. package/dist/safe-bash/playwright/modal-capabilities.js +2 -1
  514. package/dist/safe-bash/playwright/native-json-snapshot.js +4 -3
  515. package/dist/safe-bash/playwright/native-snapshot.js +5 -4
  516. package/dist/safe-bash/playwright/open-options.js +3 -3
  517. package/dist/safe-bash/playwright/resource-limit.d.ts +2 -0
  518. package/dist/safe-bash/playwright/resource-limit.js +4 -0
  519. package/dist/safe-bash/playwright/session-configuration.js +8 -3
  520. package/dist/safe-bash/playwright/snapshot.js +8 -7
  521. package/dist/safe-bash/playwright/standard-capabilities.js +5 -4
  522. package/dist/safe-bash/plugins/composition.d.ts +1 -0
  523. package/dist/safe-bash/plugins/composition.js +3 -8
  524. package/dist/safe-bash/plugins/index.browser.js +27 -29
  525. package/dist/safe-bash/registry-entry.browser.js +28 -30
  526. package/dist/safe-bash/shell/arrays/bindings.d.ts +3 -5
  527. package/dist/safe-bash/shell/arrays/bindings.js +7 -3
  528. package/dist/safe-bash/shell/arrays/state.js +4 -0
  529. package/dist/safe-bash/shell/brace-expansion.js +1 -1
  530. package/dist/safe-bash/shell/dynamic-variables.d.ts +10 -0
  531. package/dist/safe-bash/shell/dynamic-variables.js +25 -0
  532. package/dist/safe-bash/shell/input.js +16 -14
  533. package/dist/safe-bash/shell/parser.js +8 -1
  534. package/dist/safe-bash/shell/runtime.d.ts +7 -4
  535. package/dist/safe-bash/shell/runtime.js +604 -802
  536. package/dist/safe-bash/shell/shell.js +2 -31
  537. package/dist/safe-bash/shell/types.d.ts +2 -0
  538. package/dist/safe-bash/shell/value-state.js +17 -2
  539. package/dist/safe-bash/shell/worker-limits.js +1 -0
  540. package/dist/safe-bash/shell-entry.browser.js +25 -27
  541. package/dist/safe-bash/trap.browser.d.ts +3 -0
  542. package/dist/safe-bash/trap.browser.js +14 -0
  543. package/dist/safe-bash/worker/host.js +1 -1
  544. package/dist/safe-bash/yq-browser/index.js +1 -1
  545. package/dist/safe-bash-base-encoding-engine/base.js +2 -2
  546. package/dist/safe-bash-base-encoding-engine/shared.js +1 -1
  547. package/dist/safe-bash-byte-input-engine/index.d.ts +3 -2
  548. package/dist/safe-bash-byte-input-engine/index.js +4 -1
  549. package/dist/safe-bash-checksum-engine/index.js +13 -6
  550. package/dist/safe-bash-command-apply-patch/apply.d.ts +1 -1
  551. package/dist/safe-bash-command-apply-patch/apply.js +4 -3
  552. package/dist/safe-bash-command-apply-patch/index.js +4 -4
  553. package/dist/safe-bash-command-apply-patch/matcher.js +1 -1
  554. package/dist/safe-bash-command-apply-patch/parser.js +1 -1
  555. package/dist/safe-bash-command-awk/LICENSE +21 -0
  556. package/dist/safe-bash-command-awk/awk-inspection.d.ts +19 -0
  557. package/dist/safe-bash-command-awk/awk-inspection.js +9 -0
  558. package/dist/safe-bash-command-awk/awk-pipes.d.ts +19 -0
  559. package/dist/safe-bash-command-awk/awk-pipes.js +8 -0
  560. package/dist/safe-bash-command-awk/awk-pretty.d.ts +3 -0
  561. package/dist/safe-bash-command-awk/awk-pretty.js +8 -0
  562. package/dist/safe-bash-command-awk/awk-quote.d.ts +2 -0
  563. package/dist/safe-bash-command-awk/awk-quote.js +7 -0
  564. package/dist/safe-bash-command-awk/awk-reader.d.ts +42 -0
  565. package/dist/safe-bash-command-awk/awk-reader.js +9 -0
  566. package/dist/safe-bash-command-awk/awk-retention.d.ts +13 -0
  567. package/dist/safe-bash-command-awk/awk-retention.js +7 -0
  568. package/dist/safe-bash-command-awk/awk-runtime.d.ts +151 -0
  569. package/dist/safe-bash-command-awk/awk-runtime.js +11 -0
  570. package/dist/safe-bash-command-awk/awk-syntax.d.ts +144 -0
  571. package/dist/safe-bash-command-awk/awk-syntax.js +14 -0
  572. package/dist/safe-bash-command-awk/awk-values.d.ts +32 -0
  573. package/dist/safe-bash-command-awk/awk-values.js +35 -0
  574. package/dist/safe-bash-command-awk/awk.d.ts +3 -0
  575. package/dist/safe-bash-command-awk/awk.js +16 -0
  576. package/dist/safe-bash-command-awk/index.d.ts +7 -0
  577. package/dist/safe-bash-command-awk/index.js +36 -0
  578. package/dist/safe-bash-command-bc/index.d.ts +6 -0
  579. package/dist/safe-bash-command-bc/index.js +136 -266
  580. package/dist/safe-bash-command-column/column.js +5 -5
  581. package/dist/safe-bash-command-column/display.d.ts +1 -1
  582. package/dist/safe-bash-command-column/display.js +1 -1
  583. package/dist/safe-bash-command-column/index.js +5 -5
  584. package/dist/safe-bash-command-column/internal.d.ts +0 -2
  585. package/dist/safe-bash-command-column/internal.js +1 -1
  586. package/dist/safe-bash-command-column/layout.js +4 -4
  587. package/dist/safe-bash-command-column/table.js +2 -2
  588. package/dist/safe-bash-command-comm/comm.js +1 -1
  589. package/dist/safe-bash-command-comm/index.js +1 -1
  590. package/dist/safe-bash-command-csplit/command.js +2 -2
  591. package/dist/safe-bash-command-csplit/index.js +2 -2
  592. package/dist/safe-bash-command-csvcut/index.d.ts +1 -0
  593. package/dist/safe-bash-command-csvcut/index.js +1 -0
  594. package/dist/safe-bash-command-csvgrep/index.d.ts +1 -0
  595. package/dist/safe-bash-command-csvgrep/index.js +2 -2
  596. package/dist/safe-bash-command-csvkit/contracts.d.ts +1 -0
  597. package/dist/safe-bash-command-csvkit/csvpy-interpreter.d.ts +2 -1
  598. package/dist/safe-bash-command-csvkit/default-csvpy.d.ts +11 -0
  599. package/dist/safe-bash-command-csvkit/errors.js +22 -0
  600. package/dist/safe-bash-command-csvkit/index.d.ts +1 -0
  601. package/dist/safe-bash-command-csvkit/index.js +180 -12
  602. package/dist/safe-bash-command-csvkit/python-worker-browser.d.ts +3 -0
  603. package/dist/safe-bash-command-csvkit/python-worker-browser.js +16 -0
  604. package/dist/safe-bash-command-csvkit/python-worker-contract.d.ts +20 -0
  605. package/dist/safe-bash-command-csvkit/python-worker-node.d.ts +3 -0
  606. package/dist/safe-bash-command-csvkit/python-worker-node.js +9 -0
  607. package/dist/safe-bash-command-csvkit/runtime.d.ts +1 -0
  608. package/dist/safe-bash-command-csvkit/sync-support.js +1 -1
  609. package/dist/safe-bash-command-curl/LICENSE +21 -0
  610. package/dist/safe-bash-command-curl/curl.d.ts +13 -0
  611. package/dist/safe-bash-command-curl/curl.js +9 -0
  612. package/dist/safe-bash-command-curl/index.d.ts +6 -0
  613. package/dist/safe-bash-command-curl/index.js +26 -0
  614. package/dist/safe-bash-command-dd/index.js +2 -0
  615. package/dist/safe-bash-command-diff/LICENSE +21 -0
  616. package/dist/safe-bash-command-diff/diff-format.d.ts +10 -0
  617. package/dist/safe-bash-command-diff/diff-format.js +10 -0
  618. package/dist/safe-bash-command-diff/diff-options.d.ts +38 -0
  619. package/dist/safe-bash-command-diff/diff-options.js +7 -0
  620. package/dist/safe-bash-command-diff/diff-output.d.ts +20 -0
  621. package/dist/safe-bash-command-diff/diff-output.js +19 -0
  622. package/dist/safe-bash-command-diff/diff.d.ts +2 -0
  623. package/dist/safe-bash-command-diff/diff.js +10 -0
  624. package/dist/safe-bash-command-diff/index.d.ts +8 -0
  625. package/dist/safe-bash-command-diff/index.js +34 -0
  626. package/dist/safe-bash-command-diff/sync.d.ts +2 -0
  627. package/dist/safe-bash-command-diff/sync.js +9 -0
  628. package/dist/safe-bash-command-diff3/index.js +5 -5
  629. package/dist/safe-bash-command-docx/index.d.ts +4 -4
  630. package/dist/safe-bash-command-docx/index.js +12 -5
  631. package/dist/safe-bash-command-dos2unix/index.d.ts +1 -0
  632. package/dist/safe-bash-command-dos2unix/index.js +225 -1
  633. package/dist/safe-bash-command-dos2unix/sync.d.ts +1 -0
  634. package/dist/safe-bash-command-exiftool/index.d.ts +1 -0
  635. package/dist/safe-bash-command-exiftool/index.js +2 -2
  636. package/dist/safe-bash-command-factor/command.js +2 -2
  637. package/dist/safe-bash-command-factor/index.js +2 -2
  638. package/dist/safe-bash-command-fd/index.js +9 -9
  639. package/dist/safe-bash-command-ffmpeg/index.js +117 -102
  640. package/dist/safe-bash-command-file/index.js +4 -4
  641. package/dist/safe-bash-command-file/shared.js +1 -1
  642. package/dist/safe-bash-command-find/LICENSE +21 -0
  643. package/dist/safe-bash-command-find/find-format.d.ts +20 -0
  644. package/dist/safe-bash-command-find/find-format.js +9 -0
  645. package/dist/safe-bash-command-find/find.d.ts +18 -0
  646. package/dist/safe-bash-command-find/find.js +10 -0
  647. package/dist/safe-bash-command-find/index.d.ts +13 -0
  648. package/dist/safe-bash-command-find/index.js +45 -0
  649. package/dist/safe-bash-command-fmt/index.js +7 -4
  650. package/dist/safe-bash-command-git/git_rust.wasm +0 -0
  651. package/dist/safe-bash-command-git/index.js +5 -7
  652. package/dist/safe-bash-command-git/wasm.generated.js +1 -1
  653. package/dist/safe-bash-command-gzip/LICENSE +21 -0
  654. package/dist/safe-bash-command-gzip/index.d.ts +11 -0
  655. package/dist/safe-bash-command-gzip/index.js +95 -0
  656. package/dist/safe-bash-command-hexdump/command.js +4 -4
  657. package/dist/safe-bash-command-hexdump/custom.d.ts +24 -0
  658. package/dist/safe-bash-command-hexdump/index.js +4 -4
  659. package/dist/safe-bash-command-hexdump/internal.d.ts +2 -0
  660. package/dist/safe-bash-command-hexdump/internal.js +1 -1
  661. package/dist/safe-bash-command-hexdump/io.js +2 -2
  662. package/dist/safe-bash-command-hexdump/options.d.ts +3 -0
  663. package/dist/safe-bash-command-hexdump/options.js +2 -2
  664. package/dist/safe-bash-command-hostname/index.js +1 -1
  665. package/dist/safe-bash-command-html-to-markdown/budget.js +1 -1
  666. package/dist/safe-bash-command-html-to-markdown/entities.js +3 -3
  667. package/dist/safe-bash-command-html-to-markdown/index.js +11 -11
  668. package/dist/safe-bash-command-html-to-markdown/input.js +5 -5
  669. package/dist/safe-bash-command-html-to-markdown/parser.d.ts +1 -0
  670. package/dist/safe-bash-command-html-to-markdown/parser.js +4 -4
  671. package/dist/safe-bash-command-html-to-markdown/render.js +5 -5
  672. package/dist/safe-bash-command-html-to-markdown/text.js +2 -2
  673. package/dist/safe-bash-command-htmlq/index.d.ts +1 -0
  674. package/dist/safe-bash-command-htmlq/index.js +39 -17
  675. package/dist/safe-bash-command-iconv/codec.js +1 -1
  676. package/dist/safe-bash-command-iconv/command.js +2 -2
  677. package/dist/safe-bash-command-iconv/index.js +2 -2
  678. package/dist/safe-bash-command-imagemagick/index.js +45 -35
  679. package/dist/safe-bash-command-join/index.js +1 -1
  680. package/dist/safe-bash-command-join/join.js +1 -1
  681. package/dist/safe-bash-command-jq/index.js +1 -1
  682. package/dist/safe-bash-command-jq/jq.js +1 -1
  683. package/dist/safe-bash-command-less/index.js +43 -28
  684. package/dist/safe-bash-command-llm/command.js +1 -1
  685. package/dist/safe-bash-command-llm/index.d.ts +1 -0
  686. package/dist/safe-bash-command-llm/index.js +16 -14
  687. package/dist/safe-bash-command-llm/openai.js +3 -3
  688. package/dist/safe-bash-command-llm/providers/index.js +3 -3
  689. package/dist/safe-bash-command-llm/providers/openai.js +3 -3
  690. package/dist/safe-bash-command-llm/stored-schema.d.ts +10 -0
  691. package/dist/safe-bash-command-mmdc/index.d.ts +1 -0
  692. package/dist/safe-bash-command-mmdc/index.js +13 -604
  693. package/dist/safe-bash-command-mmdc/settings.d.ts +2 -0
  694. package/dist/safe-bash-command-mmdc/settings.js +7 -0
  695. package/dist/safe-bash-command-numfmt/index.js +0 -11
  696. package/dist/safe-bash-command-od/index.js +101 -68
  697. package/dist/safe-bash-command-pandoc/command.js +4 -3
  698. package/dist/safe-bash-command-pandoc/defaults.d.ts +1 -0
  699. package/dist/safe-bash-command-pandoc/index.js +4 -3
  700. package/dist/safe-bash-command-pandoc/lua-filters.js +1 -1
  701. package/dist/safe-bash-command-pandoc/types.d.ts +3 -1
  702. package/dist/safe-bash-command-paste/index.js +1 -1
  703. package/dist/safe-bash-command-paste/paste.js +1 -1
  704. package/dist/safe-bash-command-patch/LICENSE +21 -0
  705. package/dist/safe-bash-command-patch/index.d.ts +8 -0
  706. package/dist/safe-bash-command-patch/index.js +38 -0
  707. package/dist/safe-bash-command-patch/patch-envelope.d.ts +2 -0
  708. package/dist/safe-bash-command-patch/patch-envelope.js +7 -0
  709. package/dist/safe-bash-command-patch/patch-formats.d.ts +7 -0
  710. package/dist/safe-bash-command-patch/patch-formats.js +9 -0
  711. package/dist/safe-bash-command-patch/patch-gnu-paths.d.ts +41 -0
  712. package/dist/safe-bash-command-patch/patch-gnu-paths.js +26 -0
  713. package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +3 -0
  714. package/dist/safe-bash-command-patch/patch-gnu-reject.js +7 -0
  715. package/dist/safe-bash-command-patch/patch-path.d.ts +3 -0
  716. package/dist/safe-bash-command-patch/patch-path.js +11 -0
  717. package/dist/safe-bash-command-patch/patch-publication.d.ts +13 -0
  718. package/dist/safe-bash-command-patch/patch-publication.js +7 -0
  719. package/dist/safe-bash-command-patch/patch.d.ts +2 -0
  720. package/dist/safe-bash-command-patch/patch.js +14 -0
  721. package/dist/safe-bash-command-patch/sync.d.ts +2 -0
  722. package/dist/safe-bash-command-patch/sync.js +7 -0
  723. package/dist/safe-bash-command-patch/unified.d.ts +52 -0
  724. package/dist/safe-bash-command-patch/unified.js +16 -0
  725. package/dist/safe-bash-command-pathchk/index.js +3 -13
  726. package/dist/safe-bash-command-pdfimages/index.js +62 -25
  727. package/dist/safe-bash-command-pdfinfo/index.d.ts +0 -23
  728. package/dist/safe-bash-command-pdfinfo/index.js +39 -782
  729. package/dist/safe-bash-command-pdftk/index.js +40 -12
  730. package/dist/safe-bash-command-pdftoppm/index.js +76 -30
  731. package/dist/safe-bash-command-pdftotext/index.js +37 -15
  732. package/dist/safe-bash-command-pptx/index.d.ts +4 -4
  733. package/dist/safe-bash-command-pptx/index.js +11 -5
  734. package/dist/safe-bash-command-pr/command.js +2 -2
  735. package/dist/safe-bash-command-pr/index.js +4 -4
  736. package/dist/safe-bash-command-qpdf/index.js +31 -18
  737. package/dist/safe-bash-command-rg/index.d.ts +1 -0
  738. package/dist/safe-bash-command-rg/index.js +222 -1
  739. package/dist/safe-bash-command-rg/rg-command.js +1 -1
  740. package/dist/safe-bash-command-rg/sync.d.ts +1 -0
  741. package/dist/safe-bash-command-sed/LICENSE +21 -0
  742. package/dist/safe-bash-command-sed/index.d.ts +7 -0
  743. package/dist/safe-bash-command-sed/index.js +28 -0
  744. package/dist/safe-bash-command-sed/inplace.d.ts +16 -0
  745. package/dist/safe-bash-command-sed/inplace.js +9 -0
  746. package/dist/safe-bash-command-sed/sed.d.ts +3 -0
  747. package/dist/safe-bash-command-sed/sed.js +8 -0
  748. package/dist/safe-bash-command-shuf/options.d.ts +1 -0
  749. package/dist/safe-bash-command-shuf/options.js +2 -4
  750. package/dist/safe-bash-command-shuf/shuf.js +2 -1
  751. package/dist/safe-bash-command-sips/index.js +111 -35
  752. package/dist/safe-bash-command-soffice/index.js +21 -17
  753. package/dist/safe-bash-command-split/index.js +3 -3
  754. package/dist/safe-bash-command-split/io.js +1 -1
  755. package/dist/safe-bash-command-split/outputs.js +2 -2
  756. package/dist/safe-bash-command-split/split.js +3 -3
  757. package/dist/safe-bash-command-sqlite3/btree.d.ts +1 -0
  758. package/dist/safe-bash-command-sqlite3/engine.d.ts +7 -2
  759. package/dist/safe-bash-command-sqlite3/index.js +436 -537
  760. package/dist/safe-bash-command-ssconvert/commands.js +9 -9
  761. package/dist/safe-bash-command-ssconvert/core.js +8 -8
  762. package/dist/safe-bash-command-ssconvert/formats/csv.js +9 -9
  763. package/dist/safe-bash-command-ssconvert/formats/ods.js +9 -9
  764. package/dist/safe-bash-command-ssconvert/formats/spreadsheetml.js +2 -2
  765. package/dist/safe-bash-command-ssconvert/formats/xls.js +9 -9
  766. package/dist/safe-bash-command-ssconvert/formats/xlsx.js +9 -9
  767. package/dist/safe-bash-command-ssconvert/index.js +21 -21
  768. package/dist/safe-bash-command-tar/LICENSE +21 -0
  769. package/dist/safe-bash-command-tar/create.d.ts +17 -0
  770. package/dist/safe-bash-command-tar/create.js +14 -0
  771. package/dist/safe-bash-command-tar/extract.d.ts +11 -0
  772. package/dist/safe-bash-command-tar/extract.js +14 -0
  773. package/dist/safe-bash-command-tar/format.d.ts +32 -0
  774. package/dist/safe-bash-command-tar/format.js +19 -0
  775. package/dist/safe-bash-command-tar/index.d.ts +8 -0
  776. package/dist/safe-bash-command-tar/index.js +551 -0
  777. package/dist/safe-bash-command-tar/listing.d.ts +2 -0
  778. package/dist/safe-bash-command-tar/listing.js +7 -0
  779. package/dist/safe-bash-command-tar/modes.d.ts +5 -0
  780. package/dist/safe-bash-command-tar/modes.js +16 -0
  781. package/dist/safe-bash-command-tar/options.d.ts +53 -0
  782. package/dist/safe-bash-command-tar/options.js +10 -0
  783. package/dist/safe-bash-command-tar/stream.d.ts +22 -0
  784. package/dist/safe-bash-command-tar/stream.js +15 -0
  785. package/dist/safe-bash-command-tar/transform.d.ts +16 -0
  786. package/dist/safe-bash-command-tar/transform.js +9 -0
  787. package/dist/safe-bash-command-tree/arguments.js +3 -3
  788. package/dist/safe-bash-command-tree/charset.js +1 -1
  789. package/dist/safe-bash-command-tree/index.js +4 -4
  790. package/dist/safe-bash-command-tree/io.js +1 -1
  791. package/dist/safe-bash-command-tree/pattern.js +2 -2
  792. package/dist/safe-bash-command-tree/tree.js +4 -4
  793. package/dist/safe-bash-command-unrtf/index.js +14 -7
  794. package/dist/safe-bash-command-unzip/LICENSE +21 -0
  795. package/dist/safe-bash-command-unzip/index.d.ts +7 -0
  796. package/dist/safe-bash-command-unzip/index.js +39 -0
  797. package/dist/safe-bash-command-unzip/sync.d.ts +3 -0
  798. package/dist/safe-bash-command-unzip/sync.js +9 -0
  799. package/dist/safe-bash-command-unzip/unzip/safety.d.ts +32 -0
  800. package/dist/safe-bash-command-unzip/unzip/safety.js +7 -0
  801. package/dist/safe-bash-command-unzip/unzip.d.ts +3 -0
  802. package/dist/safe-bash-command-unzip/unzip.js +8 -0
  803. package/dist/safe-bash-command-wget/LICENSE +21 -0
  804. package/dist/safe-bash-command-wget/index.d.ts +6 -0
  805. package/dist/safe-bash-command-wget/index.js +26 -0
  806. package/dist/safe-bash-command-wget/wget.d.ts +3 -0
  807. package/dist/safe-bash-command-wget/wget.js +7 -0
  808. package/dist/safe-bash-command-xan/argv.d.ts +4 -1
  809. package/dist/safe-bash-command-xan/argv.js +1 -1
  810. package/dist/safe-bash-command-xan/commands.js +6 -3
  811. package/dist/safe-bash-command-xan/csv.d.ts +1 -1
  812. package/dist/safe-bash-command-xan/csv.js +1 -1
  813. package/dist/safe-bash-command-xan/index.js +18 -17
  814. package/dist/safe-bash-command-xan/io.js +3 -3
  815. package/dist/safe-bash-command-xmllint/index.js +190 -50
  816. package/dist/safe-bash-command-xxd/index.js +105 -91
  817. package/dist/safe-bash-command-xz/command.d.ts +2 -0
  818. package/dist/safe-bash-command-xz/index.d.ts +1 -1
  819. package/dist/safe-bash-command-xz/index.js +11 -2
  820. package/dist/safe-bash-command-xz/options.d.ts +9 -1
  821. package/dist/safe-bash-command-xz/options.js +3 -1
  822. package/dist/safe-bash-command-yq/index.d.ts +4 -11
  823. package/dist/safe-bash-command-yq/index.js +3367 -670
  824. package/dist/safe-bash-command-yq/mike.js +6 -13
  825. package/dist/safe-bash-command-yq/native-work.d.ts +1 -0
  826. package/dist/safe-bash-command-yq/native-work.js +17 -0
  827. package/dist/safe-bash-command-yq/query.d.ts +11 -0
  828. package/dist/safe-bash-command-yq/query.js +735 -0
  829. package/dist/safe-bash-command-zip/LICENSE +21 -0
  830. package/dist/safe-bash-command-zip/index.d.ts +7 -0
  831. package/dist/safe-bash-command-zip/index.js +38 -0
  832. package/dist/safe-bash-command-zip/sync.d.ts +3 -0
  833. package/dist/safe-bash-command-zip/sync.js +9 -0
  834. package/dist/safe-bash-command-zip/zip.d.ts +3 -0
  835. package/dist/safe-bash-command-zip/zip.js +7 -0
  836. package/dist/safe-bash-compression-engine/files.js +4 -4
  837. package/dist/safe-bash-compression-engine/index.js +2 -2
  838. package/dist/safe-bash-compression-engine/operand.js +6 -6
  839. package/dist/safe-bash-compression-engine/stream.js +2 -2
  840. package/dist/safe-bash-compression-engine/zstd-decode.js +1 -1
  841. package/dist/safe-bash-contracts/command.js +1 -1
  842. package/dist/safe-bash-contracts/diagnostics.js +4 -4
  843. package/dist/safe-bash-contracts/escaping.js +12 -12
  844. package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
  845. package/dist/safe-bash-contracts/filesystem-output.js +8 -8
  846. package/dist/safe-bash-contracts/index.d.ts +1 -0
  847. package/dist/safe-bash-contracts/index.js +39 -35
  848. package/dist/safe-bash-contracts/io.d.ts +4 -1
  849. package/dist/safe-bash-contracts/io.js +4 -2
  850. package/dist/safe-bash-contracts/managed-abort.d.ts +10 -0
  851. package/dist/safe-bash-contracts/output.js +3 -3
  852. package/dist/safe-bash-diff-engine/LICENSE +21 -0
  853. package/dist/safe-bash-diff-engine/index.d.ts +1 -0
  854. package/dist/safe-bash-diff-engine/index.js +24 -0
  855. package/dist/safe-bash-diff-engine/shared.d.ts +54 -0
  856. package/dist/safe-bash-diff-engine/shared.js +19 -0
  857. package/dist/safe-bash-io-engine/commands/archive/internal.js +5 -23
  858. package/dist/safe-bash-io-engine/commands/directory-admission.d.ts +3 -0
  859. package/dist/safe-bash-io-engine/commands/directory-admission.js +34 -0
  860. package/dist/safe-bash-io-engine/commands/mode-change.d.ts +4 -0
  861. package/dist/safe-bash-io-engine/commands/mode-change.js +60 -0
  862. package/dist/safe-bash-io-engine/commands/search/requirements.js +2 -2
  863. package/dist/safe-bash-io-engine/commands/text-programs/shared.js +44 -66
  864. package/dist/safe-bash-io-engine/internal.js +1 -1
  865. package/dist/safe-bash-io-engine/shell/pattern.js +8 -13
  866. package/dist/safe-bash-io-engine/shell/string-operations.js +1 -1
  867. package/dist/safe-bash-markdown-engine/commonmark-blocks.js +4 -4
  868. package/dist/safe-bash-markdown-engine/commonmark-inlines.js +4 -4
  869. package/dist/safe-bash-markdown-engine/commonmark-syntax.js +2 -2
  870. package/dist/safe-bash-markdown-engine/gfm-syntax.js +3 -3
  871. package/dist/safe-bash-markdown-engine/index.js +7 -7
  872. package/dist/safe-bash-mcp/index.browser.d.ts +161 -35
  873. package/dist/safe-bash-mcp/index.browser.js +417 -0
  874. package/dist/safe-bash-mcp/index.d.ts +66 -2
  875. package/dist/safe-bash-mcp/index.js +1838 -122
  876. package/dist/safe-bash-network-engine/LICENSE +21 -0
  877. package/dist/safe-bash-network-engine/aggregate.d.ts +4 -0
  878. package/dist/safe-bash-network-engine/aggregate.js +37 -0
  879. package/dist/safe-bash-network-engine/args.d.ts +68 -0
  880. package/dist/safe-bash-network-engine/args.js +19 -0
  881. package/dist/safe-bash-network-engine/authorizer.d.ts +6 -0
  882. package/dist/safe-bash-network-engine/authorizer.js +8 -0
  883. package/dist/safe-bash-network-engine/body.d.ts +9 -0
  884. package/dist/safe-bash-network-engine/body.js +374 -0
  885. package/dist/safe-bash-network-engine/deadline.d.ts +2 -0
  886. package/dist/safe-bash-network-engine/deadline.js +7 -0
  887. package/dist/safe-bash-network-engine/decode.d.ts +2 -0
  888. package/dist/safe-bash-network-engine/decode.js +80 -0
  889. package/dist/safe-bash-network-engine/fetch-transport.d.ts +7 -0
  890. package/dist/safe-bash-network-engine/fetch-transport.js +9 -0
  891. package/dist/safe-bash-network-engine/form-content-type.d.ts +5 -0
  892. package/dist/safe-bash-network-engine/form-content-type.js +8 -0
  893. package/dist/safe-bash-network-engine/form-headers.d.ts +2 -0
  894. package/dist/safe-bash-network-engine/form-headers.js +10 -0
  895. package/dist/safe-bash-network-engine/glob.d.ts +7 -0
  896. package/dist/safe-bash-network-engine/glob.js +124 -0
  897. package/dist/safe-bash-network-engine/index.d.ts +3 -0
  898. package/dist/safe-bash-network-engine/index.js +26 -0
  899. package/dist/safe-bash-network-engine/input.d.ts +5 -0
  900. package/dist/safe-bash-network-engine/input.js +255 -0
  901. package/dist/safe-bash-network-engine/output.d.ts +6 -0
  902. package/dist/safe-bash-network-engine/output.js +132 -0
  903. package/dist/safe-bash-network-engine/platform-portable.d.ts +5 -0
  904. package/dist/safe-bash-network-engine/platform-portable.js +19 -0
  905. package/dist/safe-bash-network-engine/private-address.d.ts +1 -0
  906. package/dist/safe-bash-network-engine/private-address.js +7 -0
  907. package/dist/safe-bash-network-engine/shared.d.ts +14 -0
  908. package/dist/safe-bash-network-engine/shared.js +23 -0
  909. package/dist/safe-bash-network-engine/types.d.ts +42 -0
  910. package/dist/safe-bash-network-engine/types.js +11 -0
  911. package/dist/safe-bash-network-engine/url.d.ts +2 -0
  912. package/dist/safe-bash-network-engine/url.js +8 -0
  913. package/dist/safe-bash-query-engine/capture.d.ts +1 -0
  914. package/dist/safe-bash-query-engine/capture.js +9 -7
  915. package/dist/safe-bash-query-engine/dates.d.ts +5 -1
  916. package/dist/safe-bash-query-engine/dates.js +10 -2
  917. package/dist/safe-bash-query-engine/delpaths.js +5 -5
  918. package/dist/safe-bash-query-engine/formats.js +3 -3
  919. package/dist/safe-bash-query-engine/index.js +15 -15
  920. package/dist/safe-bash-query-engine/indices.js +5 -5
  921. package/dist/safe-bash-query-engine/input.d.ts +1 -2
  922. package/dist/safe-bash-query-engine/input.js +2 -4
  923. package/dist/safe-bash-query-engine/interpreter.d.ts +5 -0
  924. package/dist/safe-bash-query-engine/interpreter.js +13 -13
  925. package/dist/safe-bash-query-engine/limits.js +1 -1
  926. package/dist/safe-bash-query-engine/parser.d.ts +8 -1
  927. package/dist/safe-bash-query-engine/parser.js +2 -2
  928. package/dist/safe-bash-query-engine/query-core.js +15 -15
  929. package/dist/safe-bash-query-engine/recurse.js +2 -2
  930. package/dist/safe-bash-query-engine/regex.d.ts +4 -2
  931. package/dist/safe-bash-query-engine/regex.js +10 -5
  932. package/dist/safe-bash-query-engine/split.js +2 -2
  933. package/dist/safe-bash-query-engine/splits.d.ts +1 -1
  934. package/dist/safe-bash-query-engine/splits.js +7 -6
  935. package/dist/safe-bash-query-engine/values.js +4 -4
  936. package/dist/safe-bash-regex-engine/ere/matcher.js +106 -34
  937. package/dist/safe-bash-regex-engine/execution/bounded-provider.js +55 -67
  938. package/dist/safe-bash-regex-engine/execution/portable.d.ts +0 -1
  939. package/dist/safe-bash-regex-engine/execution/portable.js +6 -10
  940. package/dist/safe-bash-regex-engine/execution/protocol.d.ts +0 -5
  941. package/dist/safe-bash-regex-engine/execution/protocol.js +1 -3
  942. package/dist/safe-bash-regex-engine/index.js +6 -4
  943. package/dist/safe-bash-regex-engine/text/budget.d.ts +1 -0
  944. package/dist/safe-bash-regex-engine/text/budget.js +1 -1
  945. package/dist/safe-bash-regex-engine/text/regex.d.ts +15 -0
  946. package/dist/safe-bash-regex-engine/text/regex.js +6 -4
  947. package/dist/safe-bash-regex-engine/text/replacement-buffer.js +2 -2
  948. package/dist/safe-bash-regex-engine/text/rust-syntax.js +2 -2
  949. package/dist/safe-bash-search-engine/ergonomic-regex.d.ts +12 -2
  950. package/dist/safe-bash-search-engine/ergonomic-regex.js +2 -2
  951. package/dist/safe-bash-search-engine/glob.js +2 -2
  952. package/dist/safe-bash-search-engine/grep.js +191 -229
  953. package/dist/safe-bash-search-engine/matcher.d.ts +6 -2
  954. package/dist/safe-bash-search-engine/matcher.js +30 -8
  955. package/dist/safe-bash-search-engine/options.js +1 -1
  956. package/dist/safe-bash-search-engine/output.d.ts +3 -2
  957. package/dist/safe-bash-search-engine/output.js +111 -30
  958. package/dist/safe-bash-search-engine/shared.d.ts +2 -0
  959. package/dist/safe-bash-search-engine/shared.js +2 -2
  960. package/dist/safe-bash-search-engine/walk.js +11 -10
  961. package/dist/safe-bash-table-text-engine/table-text/internal.d.ts +7 -5
  962. package/dist/safe-bash-table-text-engine/table-text/internal.js +39 -21
  963. package/dist/safe-bash-xml-engine/document.d.ts +1 -1
  964. package/dist/safe-bash-xml-engine/document.js +3 -3
  965. package/dist/safe-bash-xml-engine/evaluate.d.ts +1 -0
  966. package/dist/safe-bash-xml-engine/evaluate.js +4 -1
  967. package/dist/safe-bash-xml-engine/index.js +8 -6
  968. package/dist/safe-bash-xml-engine/io.js +1 -1
  969. package/dist/safe-bash-xml-engine/limits.d.ts +2 -0
  970. package/dist/safe-bash-xml-engine/limits.js +1 -1
  971. package/dist/safe-bash-xml-engine/predicate.d.ts +57 -0
  972. package/dist/safe-bash-xml-engine/query.d.ts +3 -15
  973. package/dist/safe-bash-xml-engine/query.js +3 -2
  974. package/dist/safe-bash-zip-engine/LICENSE +21 -0
  975. package/dist/safe-bash-zip-engine/index.d.ts +1 -0
  976. package/dist/safe-bash-zip-engine/index.js +32 -0
  977. package/dist/safe-bash-zip-engine/unzip/arguments.d.ts +53 -0
  978. package/dist/safe-bash-zip-engine/unzip/arguments.js +270 -0
  979. package/dist/safe-bash-zip-engine/zip/aes.d.ts +17 -0
  980. package/dist/safe-bash-zip-engine/zip/aes.js +15 -0
  981. package/dist/safe-bash-zip-engine/zip/comments.d.ts +17 -0
  982. package/dist/safe-bash-zip-engine/zip/comments.js +77 -0
  983. package/dist/safe-bash-zip-engine/zip/crc.d.ts +1 -0
  984. package/dist/safe-bash-zip-engine/zip/crc.js +7 -0
  985. package/dist/safe-bash-zip-engine/zip/crypto.d.ts +19 -0
  986. package/dist/safe-bash-zip-engine/zip/crypto.js +16 -0
  987. package/dist/safe-bash-zip-engine/zip/dates.d.ts +4 -0
  988. package/dist/safe-bash-zip-engine/zip/dates.js +68 -0
  989. package/dist/safe-bash-zip-engine/zip/environment.d.ts +2 -0
  990. package/dist/safe-bash-zip-engine/zip/environment.js +60 -0
  991. package/dist/safe-bash-zip-engine/zip/grow.d.ts +3 -0
  992. package/dist/safe-bash-zip-engine/zip/grow.js +7 -0
  993. package/dist/safe-bash-zip-engine/zip/help.d.ts +4 -0
  994. package/dist/safe-bash-zip-engine/zip/help.js +194 -0
  995. package/dist/safe-bash-zip-engine/zip/line-endings.d.ts +2 -0
  996. package/dist/safe-bash-zip-engine/zip/line-endings.js +165 -0
  997. package/dist/safe-bash-zip-engine/zip/log.d.ts +22 -0
  998. package/dist/safe-bash-zip-engine/zip/log.js +153 -0
  999. package/dist/safe-bash-zip-engine/zip/lzma.d.ts +9 -0
  1000. package/dist/safe-bash-zip-engine/zip/lzma.js +7 -0
  1001. package/dist/safe-bash-zip-engine/zip/move.d.ts +11 -0
  1002. package/dist/safe-bash-zip-engine/zip/move.js +57 -0
  1003. package/dist/safe-bash-zip-engine/zip/names.d.ts +2 -0
  1004. package/dist/safe-bash-zip-engine/zip/names.js +37 -0
  1005. package/dist/safe-bash-zip-engine/zip/options.d.ts +13 -0
  1006. package/dist/safe-bash-zip-engine/zip/options.js +23 -0
  1007. package/dist/safe-bash-zip-engine/zip/repair.d.ts +10 -0
  1008. package/dist/safe-bash-zip-engine/zip/repair.js +348 -0
  1009. package/dist/safe-bash-zip-engine/zip/safety.d.ts +54 -0
  1010. package/dist/safe-bash-zip-engine/zip/safety.js +19 -0
  1011. package/dist/safe-bash-zip-engine/zip/sfx.d.ts +4 -0
  1012. package/dist/safe-bash-zip-engine/zip/sfx.js +58 -0
  1013. package/dist/safe-bash-zip-engine/zip/test-command.d.ts +5 -0
  1014. package/dist/safe-bash-zip-engine/zip/test-command.js +98 -0
  1015. package/dist/safe-bash-zip-engine/zip/volumes.d.ts +21 -0
  1016. package/dist/safe-bash-zip-engine/zip/volumes.js +255 -0
  1017. package/dist/safe-bash-zip-engine/zip/zip64.d.ts +30 -0
  1018. package/dist/safe-bash-zip-engine/zip/zip64.js +25 -0
  1019. package/dist/safe-bash-zip-engine/zip-format.d.ts +68 -0
  1020. package/dist/safe-bash-zip-engine/zip-format.js +27 -0
  1021. package/dist/safe-playwright-cloudflare/browser-codegen.generated.d.ts +7 -7
  1022. package/dist/safe-playwright-cloudflare/browser-codegen.generated.js +866 -8069
  1023. package/dist/safe-playwright-cloudflare/browser-run-code-budget.d.ts +0 -1
  1024. package/dist/safe-playwright-cloudflare/browser-run-code-budget.js +0 -2
  1025. package/dist/safe-playwright-cloudflare/browser-trace-archive.d.ts +5 -1
  1026. package/dist/safe-playwright-cloudflare/browser-trace-archive.js +2 -1
  1027. package/dist/safe-playwright-cloudflare/browser-trace-budget.js +8 -4
  1028. package/dist/safe-playwright-cloudflare/shell-browser-resource.d.ts +2 -0
  1029. package/dist/safe-playwright-cloudflare/shell-browser-resource.js +3 -11
  1030. package/dist/safe-playwright-cloudflare/shell-playwright.d.ts +2 -0
  1031. package/dist/safe-playwright-cloudflare/shell-playwright.js +1 -1
  1032. package/dist/spreadsheet-engine/codecs/odf-hyperlinks.js +8 -2
  1033. package/dist/spreadsheet-engine/formulas/functions/captured-bessel-phase.js +2 -2
  1034. package/dist/spreadsheet-engine/formulas/label-references.js +54 -33
  1035. package/dist/spreadsheet-engine/formulas/parser.js +3 -1
  1036. package/dist/spreadsheet-engine/formulas/rewriting.js +13 -3
  1037. package/dist/spreadsheet-engine/io/publication.d.ts +1 -0
  1038. package/dist/spreadsheet-format-xls/biff-data-tables.js +4 -6
  1039. package/dist/spreadsheet-format-xls/biff-formulas.js +3 -0
  1040. package/dist/spreadsheet-format-xls/biff-label-ranges.js +9 -6
  1041. package/dist/spreadsheet-format-xls/biff.js +1 -1
  1042. package/dist/xlsx-ast/xlsx.js +8 -5
  1043. package/package.json +165 -15
  1044. package/dist/safe-bash/chunks/chunk-AZAJJVFX.js +0 -23017
  1045. package/dist/safe-bash/chunks/chunk-O4ZUCRGN.js +0 -13
  1046. package/dist/safe-bash/chunks/chunk-S264DZO2.js +0 -243
  1047. package/dist/safe-bash/chunks/chunk-WVG5SHHQ.js +0 -12
  1048. package/dist/safe-bash/chunks/chunk-ZW6K2J7P.js +0 -2652
  1049. package/dist/safe-bash/command-chunks/chunk-5MPOQ6V3.js +0 -181
  1050. package/dist/safe-bash/command-chunks/chunk-BIXLZ3OG.js +0 -14342
  1051. package/dist/safe-bash/command-chunks/chunk-DUYJE2HY.js +0 -14
  1052. package/dist/safe-bash/command-chunks/chunk-KAGBORIC.js +0 -88
  1053. package/dist/safe-bash/command-chunks/chunk-NETECMOF.js +0 -40
  1054. package/dist/safe-bash/command-chunks/chunk-XS3PGJU2.js +0 -343
  1055. package/dist/safe-bash/command-chunks/chunk-XTZALMLR.js +0 -488
  1056. package/dist/safe-bash/commands/archive/zip/aes-primitives-unavailable.d.ts +0 -2
  1057. package/dist/safe-bash/commands/archive/zip/aes-primitives-unavailable.js +0 -3
  1058. package/dist/safe-bash/commands/archive/zip/aes-primitives.d.ts +0 -2
  1059. package/dist/safe-bash/commands/archive/zip/aes-primitives.js +0 -3
  1060. package/dist/safe-bash/commands/xml/document.d.ts +0 -2
  1061. package/dist/safe-bash/commands/xml/document.js +0 -2
  1062. package/dist/safe-bash/commands/xml/evaluate.d.ts +0 -2
  1063. package/dist/safe-bash/commands/xml/evaluate.js +0 -2
  1064. package/dist/safe-bash/commands/xml/json.d.ts +0 -2
  1065. package/dist/safe-bash/commands/xml/json.js +0 -2
  1066. package/dist/safe-bash/commands/xml/limits.d.ts +0 -2
  1067. package/dist/safe-bash/commands/xml/limits.js +0 -2
  1068. package/dist/safe-bash/commands/xml/query.d.ts +0 -2
  1069. package/dist/safe-bash/commands/xml/query.js +0 -2
  1070. package/dist/safe-bash/command-chunks/{chunk-FIUFIDAO.js → chunk-2JRBIDAD.js} +3 -3
  1071. package/dist/safe-bash/command-chunks/{chunk-BWNXWI33.js → chunk-2LMZVE3I.js} +0 -0
  1072. package/dist/safe-bash/command-chunks/{chunk-B5BKA5WH.js → chunk-B5TAOCKD.js} +3 -3
  1073. package/dist/safe-bash/command-chunks/{chunk-2ENZ6JGA.js → chunk-KEV7C3KH.js} +3 -3
  1074. package/dist/safe-bash/command-chunks/{chunk-S62HELHU.js → chunk-PL6O4K6W.js} +3 -3
  1075. package/dist/safe-bash/command-chunks/{chunk-DDLQ5YDB.js → chunk-YHFXOX6U.js} +9 -9
  1076. package/dist/safe-bash/command-chunks/{chunk-DQMOM72Z.js → chunk-ZRRBXU3M.js} +4 -4
@@ -1,1524 +1,2 @@
1
- import { byteLength, encodeBytes } from "../../byte-encoding.js";
2
- import { zipDosName } from "./zip/names.js";
3
- import { readZipSfx } from "./zip/sfx.js";
4
- import { adjustZipSfx, repairZip } from "./zip/repair.js";
5
- import { zipGrowRecords } from "./zip/grow.js";
6
- import { ZipLog } from "./zip/log.js";
7
- import { parseZipTestCommand, testZipCommand } from "./zip/test-command.js";
8
- import { inspectZipMoveSource, removeZipSources } from "./zip/move.js";
9
- import { readZipPassword, ZipHostFailure } from "./zip/crypto.js";
10
- import { zipEncryptionProfile } from "./zip/aes.js";
11
- import { zipToCrlf, zipFromCrlf } from "./zip/line-endings.js";
12
- import { parseZipDate, zipDateMatches, zipLatestTime } from "./zip/dates.js";
13
- import { zipEnvironmentArguments } from "./zip/environment.js";
14
- import { readZipComment, ZipCommentInput } from "./zip/comments.js";
15
- import { collectBytes, dirname, getCommandArguments, writeBytes } from "../../contracts/index.js";
16
- import { shellValueByteLength, shellValueBytes } from "../../contracts/value.js";
17
- import { writeFileOutput } from "../../contracts/filesystem-output.js";
18
- import { createOutputOperation } from "../../contracts/output.js";
19
- import { yieldTurn } from "../../contracts/yield.js";
20
- import { publicDiagnosticMessage } from "../../diagnostics.js";
21
- import { escapeText } from "../../escaping.js";
22
- import { Budget, checkPath, display, fail, invocationLimits, settings, text, vfsPath } from "./internal.js";
23
- import { decodeZipEntry, makeZipEntry, readZipArchive, writeZipArchive, streamZipArchive, updateZipExtras, setZipEntryComment } from "./zip-format.js";
24
- import { zipHelp, zipExtendedHelp, zipVersion, zipLicense } from "./zip/help.js";
25
- import { publishZip, stageZip, ZipScope, hasZipIdentity as hasIdentity, sameZipIdentity as sameIdentity, unchangedZipSource as unchanged, safeZipFile } from "./zip/safety.js";
26
- import { splitSize, splitZipVolumes, resolveZipVolumes, publishZipVolumes, volumeName } from "./zip/volumes.js";
27
- import { Selection } from "./unzip/arguments.js";
28
- import { normalizeZipOption, reservedZipShortOptions, ZipFailure, parseZipDotSize, zipLongOptions, zipNegatableOptions, zipDisplaySize, zipPublicText, zipPasswordArgument } from "./zip/options.js";
29
- const defaultStoreSuffixes = [".Z", ".zip", ".zoo", ".arc", ".lzh", ".arj"];
30
- async function parse(scope, limits, defaults) {
31
- const context = scope.context;
32
- const args = zipEnvironmentArguments(context.env, context.args, limits);
33
- const rawArguments = context.argumentValues ? getCommandArguments(context) : undefined;
34
- const passwordArguments = new Set();
35
- const defaultsCount = args.length - context.args.length;
36
- const validateArgumentText = () => {
37
- if (rawArguments)
38
- for (const [index, value] of rawArguments.values.entries()) {
39
- if (!passwordArguments.has(index))
40
- text(shellValueBytes(value));
41
- }
42
- };
43
- if (args.length > limits.maxArgumentBytes)
44
- fail("argument count limit exceeded");
45
- let bytes = 0;
46
- for (const argument of args) {
47
- const size = byteLength(argument);
48
- if (size > limits.maxArgumentBytes - bytes)
49
- fail("argument byte limit exceeded");
50
- bytes += size;
51
- }
52
- if (context.argumentValues) {
53
- const argumentsValue = getCommandArguments(context);
54
- let rawBytes = 0;
55
- for (const value of argumentsValue.values) {
56
- const size = shellValueByteLength(value);
57
- if (size > limits.maxArgumentBytes - rawBytes)
58
- fail("argument byte limit exceeded");
59
- rawBytes += size;
60
- }
61
- }
62
- let archive;
63
- let password;
64
- let encrypt = defaults?.encryption !== undefined;
65
- let aes = zipEncryptionProfile(defaults?.encryption ?? "zipcrypto");
66
- let output;
67
- let action = "add";
68
- let recursive = false;
69
- let recursivePatterns = false;
70
- let noWild = false;
71
- let stopAtDirectories = false;
72
- let quiet = false;
73
- let verbose = false;
74
- let showFiles;
75
- let showCommand = false;
76
- let showOptions = false;
77
- let debug = false;
78
- let displayBytes = false;
79
- let displayCounts = false;
80
- let displayUsize = false;
81
- let displayVolume = false;
82
- let dotSize = 0;
83
- let dotsSet = false;
84
- let globalDots = false;
85
- const commandOptions = [];
86
- const commandPaths = [];
87
- let junkPaths = false;
88
- let dosNames = false;
89
- let fifo = false;
90
- let omitDirectories = false;
91
- let storeLinks = false;
92
- let test = false;
93
- let testCommand;
94
- let difference = false;
95
- let grow = false;
96
- let tempPath;
97
- let junkSfx = false;
98
- let repair;
99
- let adjust = false;
100
- let logPath;
101
- let logAppend = false;
102
- let logInfo = false;
103
- let mustMatch = false;
104
- let filesync = false;
105
- let archiveComment = false;
106
- let entryComments = false;
107
- let latestTime = false;
108
- let toCrlf = false;
109
- let fromCrlf = false;
110
- let move = false;
111
- let fromDate;
112
- let beforeDate;
113
- let descriptors = false;
114
- let split;
115
- let splitPause = false, splitVerbose = false, splitBell = false;
116
- let zip64;
117
- let metadata = "default";
118
- let level = 6;
119
- let method = defaults?.compression ?? "deflate";
120
- if (method !== "store" && method !== "deflate" && method !== "bzip2" && method !== "lzma")
121
- fail("ZIP unsupported compression method");
122
- let suffixes = defaultStoreSuffixes;
123
- let stdinNames = false;
124
- let literal = false;
125
- let firstOperand = -1;
126
- const operands = [];
127
- const includes = [];
128
- const excludes = [];
129
- for (let index = 0; index < args.length; index++) {
130
- const startIndex = index;
131
- let listOption = false;
132
- const original = args[index];
133
- checkPath(original, limits);
134
- if (!literal && (original === "--encryption" || original.startsWith("--encryption="))) {
135
- const value = original === "--encryption" ? args[++index] : original.slice(13);
136
- if (value === undefined)
137
- fail("ZIP encryption option requires a profile");
138
- aes = zipEncryptionProfile(value);
139
- encrypt = true;
140
- commandOptions.push(...args.slice(startIndex, index + 1));
141
- continue;
142
- }
143
- const argument = literal ? original : normalizeZipOption(original);
144
- if (!literal && argument === "--") {
145
- if (archive === undefined)
146
- throw new ZipFailure(16, "Invalid command arguments", "can't use -- before archive name");
147
- literal = true;
148
- commandPaths.push(original);
149
- }
150
- else if (!literal && argument.startsWith("-") && argument !== "-") {
151
- commandOptions.push(original);
152
- if (argument === "--version") {
153
- validateArgumentText();
154
- return { information: "version" };
155
- }
156
- for (let offset = 1; offset < argument.length; offset++) {
157
- if (reservedZipShortOptions.has(argument.slice(offset, offset + 2))) {
158
- throw new ZipFailure(16, "Invalid command arguments", `unsupported option: -${argument.slice(offset, offset + 2)}`);
159
- }
160
- const flag = argument[offset];
161
- const pair = argument.slice(offset, offset + 2);
162
- if (pair === "sp" || pair === "sv" || pair === "sb") {
163
- if (pair === "sp") {
164
- splitPause = true;
165
- descriptors = true;
166
- }
167
- if (pair === "sv")
168
- splitVerbose = true;
169
- if (pair === "sb")
170
- splitBell = true;
171
- offset++;
172
- }
173
- else if (flag === "s" && !["sc", "sd", "sf", "so"].includes(pair)) {
174
- let value = argument.slice(offset + 1) || args[++index];
175
- if (value?.startsWith("="))
176
- value = value.slice(1);
177
- if (!value)
178
- throw new ZipFailure(16, "Invalid command arguments", "split size requires a value");
179
- split = splitSize(value);
180
- break;
181
- }
182
- else if (pair === "FI") {
183
- fifo = argument[offset + 2] !== "-";
184
- offset += fifo ? 1 : 2;
185
- }
186
- else if (pair === "RE") {
187
- // Unix bracket lists are already enabled in the bounded glob matcher.
188
- if (argument[offset + 2] === "-")
189
- throw new ZipFailure(16, "Invalid command arguments", "option RE is not negatable");
190
- offset++;
191
- }
192
- else if (flag === "k") {
193
- if (argument[offset + 1] === "-")
194
- throw new ZipFailure(16, "Invalid command arguments", "option k is not negatable");
195
- dosNames = true;
196
- }
197
- else if (pair === "DF") {
198
- difference = true;
199
- offset++;
200
- }
201
- else if (pair === "la" || pair === "li") {
202
- if (pair === "la")
203
- logAppend = true;
204
- else
205
- logInfo = true;
206
- offset++;
207
- }
208
- else if (pair === "TT" || pair === "lf" || flag === "b") {
209
- const option = flag === "b" ? "b" : pair;
210
- if (option !== "b")
211
- offset++;
212
- let value = argument.slice(offset + 1) || args[++index];
213
- if (value?.startsWith("="))
214
- value = value.slice(1);
215
- if (!value)
216
- throw new ZipFailure(16, "Invalid command arguments", `option ${option} requires a value`);
217
- if (option === "b")
218
- tempPath = value;
219
- else if (option === "lf")
220
- logPath = value;
221
- else
222
- testCommand = parseZipTestCommand(value);
223
- break;
224
- }
225
- else if (flag === "g")
226
- grow = true;
227
- else if (flag === "J")
228
- junkSfx = true;
229
- else if (flag === "A")
230
- adjust = true;
231
- else if (flag === "F" && pair !== "FS" && pair !== "FI") {
232
- repair = pair === "FF" ? "FF" : "F";
233
- if (pair === "FF")
234
- offset++;
235
- }
236
- else if (flag === "P") {
237
- let value = argument.slice(offset + 1);
238
- const attached = value.length > 0;
239
- if (!value) {
240
- value = args[++index];
241
- if (value === undefined)
242
- throw new ZipFailure(16, "Invalid command arguments", "password option requires a value");
243
- }
244
- else if (value.startsWith("="))
245
- value = value.slice(1);
246
- const rawIndex = index - defaultsCount;
247
- passwordArguments.add(rawIndex);
248
- const raw = rawArguments?.bytes(rawIndex);
249
- const prefix = attached ? original.startsWith("--") ? original.indexOf("=") + 1 : offset + 1 + (original[offset + 1] === "=" ? 1 : 0) : 0;
250
- password = raw ? new Uint8Array(raw.subarray(prefix)) : encodeBytes(value);
251
- if (password.includes(0))
252
- fail("ZIP invalid password bytes");
253
- if (!password.length)
254
- throw new ZipFailure(16, "Invalid command arguments", "zero length password not allowed");
255
- encrypt = true;
256
- break;
257
- }
258
- else if (flag === "e")
259
- encrypt = true;
260
- else if (["db", "dc", "dd", "dg", "du", "dv", "ds", "sc", "sd", "sf", "so"].includes(pair)) {
261
- offset++;
262
- const negated = argument[offset + 1] === "-";
263
- if (negated && !zipNegatableOptions.has(pair))
264
- throw new ZipFailure(16, "Invalid command arguments", `option ${pair} is not negatable`);
265
- if (negated)
266
- offset++;
267
- if (pair === "ds") {
268
- let value = argument.slice(offset + 1) || args[++index];
269
- if (value === undefined)
270
- throw new ZipFailure(16, "Invalid command arguments", "option ds requires a value");
271
- if (value.startsWith("="))
272
- value = value.slice(1);
273
- dotSize = parseZipDotSize(value);
274
- dotsSet = true;
275
- break;
276
- }
277
- if (pair === "db")
278
- displayBytes = !negated;
279
- else if (pair === "dc")
280
- displayCounts = !negated;
281
- else if (pair === "du")
282
- displayUsize = !negated;
283
- else if (pair === "dv")
284
- displayVolume = !negated;
285
- else if (pair === "sf")
286
- showFiles = !negated;
287
- else if (pair === "sc")
288
- showCommand = true;
289
- else if (pair === "sd")
290
- debug = true;
291
- else if (pair === "so")
292
- showOptions = true;
293
- else if (pair === "dd") {
294
- globalDots = false;
295
- if (negated)
296
- dotsSet = false;
297
- else {
298
- if (!dotsSet)
299
- dotSize = 10 * 1024 ** 2;
300
- dotsSet = true;
301
- }
302
- }
303
- else if (pair === "dg") {
304
- globalDots = !negated;
305
- if (!negated) {
306
- if (!dotsSet)
307
- dotSize = 10 * 1024 ** 2;
308
- dotsSet = true;
309
- }
310
- }
311
- }
312
- else if (flag === "L" || flag === "v") {
313
- if (argument[offset + 1] === "-")
314
- throw new ZipFailure(16, "Invalid command arguments", `option ${flag} is not negatable`);
315
- if (flag === "L") {
316
- validateArgumentText();
317
- return { information: "license" };
318
- }
319
- if (args.length === 1 && original === "-v") {
320
- validateArgumentText();
321
- return { information: "version" };
322
- }
323
- verbose = true;
324
- quiet = false;
325
- }
326
- else if (flag === "h") {
327
- if (argument[offset + 1] === "-")
328
- throw new ZipFailure(16, "Invalid command arguments", "option h is not negatable");
329
- if (argument[offset + 1] === "2") {
330
- if (argument[offset + 2] === "-")
331
- throw new ZipFailure(16, "Invalid command arguments", "option h2 is not negatable");
332
- validateArgumentText();
333
- return { information: "more-help" };
334
- }
335
- validateArgumentText();
336
- return { information: "help" };
337
- }
338
- else if (flag === "r" || flag === "R") {
339
- if (flag === "r")
340
- recursive = true;
341
- else
342
- recursivePatterns = true;
343
- if (recursive && recursivePatterns)
344
- throw new ZipFailure(16, "Invalid command arguments", "do not specify both -r and -R");
345
- }
346
- else if (flag === "f" && argument[offset + 1] === "d") {
347
- if (argument[offset + 2] === "-")
348
- throw new ZipFailure(16, "Invalid command arguments", "option fd is not negatable");
349
- descriptors = true;
350
- offset++;
351
- }
352
- else if (flag === "f" && argument[offset + 1] === "z") {
353
- zip64 = argument[offset + 2] !== "-";
354
- offset += zip64 ? 1 : 2;
355
- }
356
- else if (flag === "d" || flag === "u" || flag === "f" || flag === "U") {
357
- const next = flag === "d" ? "delete" : flag === "u" ? "update" : flag === "U" ? "copy" : "freshen";
358
- if (action !== "add" && action !== next)
359
- throw new ZipFailure(16, "Invalid command arguments", "specify just one action");
360
- action = next;
361
- }
362
- else if (flag === "n" && argument[offset + 1] === "w" || flag === "w" && argument[offset + 1] === "s") {
363
- if (argument[offset + 2] === "-")
364
- throw new ZipFailure(16, "Invalid command arguments", "wildcard control is not negatable");
365
- if (flag === "n")
366
- noWild = true;
367
- else
368
- stopAtDirectories = true;
369
- offset++;
370
- }
371
- else if (flag === "M" && argument[offset + 1] === "M") {
372
- if (argument[offset + 2] === "-")
373
- throw new ZipFailure(16, "Invalid command arguments", "option MM is not negatable");
374
- mustMatch = true;
375
- offset++;
376
- }
377
- else if (flag === "F" && argument[offset + 1] === "S") {
378
- if (argument[offset + 2] === "-")
379
- throw new ZipFailure(16, "Invalid command arguments", "option FS is not negatable");
380
- filesync = true;
381
- offset++;
382
- }
383
- else if (flag === "q")
384
- quiet = true;
385
- else if (flag === "z")
386
- archiveComment = true;
387
- else if (flag === "c")
388
- entryComments = true;
389
- else if (flag === "o")
390
- latestTime = true;
391
- else if (flag === "l") {
392
- fromCrlf = argument[offset + 1] === "l";
393
- toCrlf = !fromCrlf;
394
- if (fromCrlf)
395
- offset++;
396
- }
397
- else if (flag === "m")
398
- move = true;
399
- else if (flag === "p") {
400
- if (argument[offset + 1] === "-")
401
- throw new ZipFailure(16, "Invalid command arguments", "option p is not negatable");
402
- // Native Unix procname accepts -p for compatibility without undoing -j.
403
- }
404
- else if (flag === "j")
405
- junkPaths = true;
406
- else if (flag === "X") {
407
- metadata = argument[offset + 1] === "-" ? "all" : "strip";
408
- if (metadata === "all")
409
- offset++;
410
- }
411
- else if (flag === "D")
412
- omitDirectories = true;
413
- else if (flag === "y")
414
- storeLinks = true;
415
- else if (flag === "T")
416
- test = true;
417
- else if (flag === "@")
418
- stdinNames = true;
419
- else if (flag !== undefined && flag >= "0" && flag <= "9") {
420
- level = Number(flag);
421
- if (level === 0)
422
- method = "store";
423
- }
424
- else if (flag === "O") {
425
- let value = argument.slice(offset + 1) || args[++index];
426
- if (value?.startsWith("="))
427
- value = value.slice(1);
428
- if (value === undefined)
429
- throw new ZipFailure(16, "Invalid command arguments", "option O requires a value");
430
- output = value;
431
- break;
432
- }
433
- else if (flag === "t") {
434
- const option = argument[offset + 1] === "t" ? "tt" : "t";
435
- if (option === "tt")
436
- offset++;
437
- let value = argument.slice(offset + 1);
438
- if (!value)
439
- value = args[++index] ?? "";
440
- if (value.startsWith("="))
441
- value = value.slice(1);
442
- const date = parseZipDate(value, option);
443
- if (option === "t")
444
- fromDate = date;
445
- else
446
- beforeDate = date;
447
- break;
448
- }
449
- else if (flag === "n" || flag === "Z") {
450
- let value = argument.slice(offset + 1);
451
- if (!value) {
452
- const next = args[index + 1];
453
- if (next === undefined || next.startsWith("-") && next !== "-")
454
- throw new ZipFailure(16, "Invalid command arguments", `option '${flag}' requires a value`);
455
- value = next;
456
- index++;
457
- }
458
- if (value.startsWith("="))
459
- value = value.slice(1);
460
- if (flag === "n") {
461
- suffixes = value ? value.split(":").filter(suffix => suffix.length > 0) : defaultStoreSuffixes;
462
- if (value && suffixes.length > limits.maxMembers)
463
- fail("suffix count limit exceeded");
464
- }
465
- else {
466
- const matches = ["store", "deflate", "bzip2", "lzma"].filter(name => name.startsWith(value.toLowerCase()));
467
- const selected = matches.length === 1 ? matches[0] : undefined;
468
- if (!selected)
469
- throw new ZipFailure(16, "Invalid command arguments", "Option -Z (--compression-method): unknown method");
470
- method = selected;
471
- }
472
- break;
473
- }
474
- else if (flag === "i" || flag === "x") {
475
- listOption = offset + 1 === argument.length;
476
- const patterns = flag === "i" ? includes : excludes;
477
- const before = patterns.length;
478
- const append = (pattern) => {
479
- if (pattern)
480
- checkPath(pattern, limits);
481
- if (includes.length + excludes.length >= limits.maxMembers)
482
- fail("pattern count limit exceeded");
483
- patterns.push(dosNames ? zipDosName(pattern) : pattern);
484
- };
485
- const attached = offset + 1 < argument.length;
486
- if (attached) {
487
- const value = argument.slice(offset + 1);
488
- append(value.startsWith("=") ? value.slice(1) : value);
489
- }
490
- while (!attached && index + 1 < args.length) {
491
- const next = args[index + 1];
492
- if (next === "@") {
493
- index++;
494
- break;
495
- }
496
- if (next.startsWith("-") && next !== "-")
497
- break;
498
- append(next);
499
- index++;
500
- }
501
- if (patterns.length === before)
502
- throw new ZipFailure(16, "Invalid command arguments", `option '${flag}' requires a value`);
503
- break;
504
- }
505
- else
506
- throw new ZipFailure(16, "Invalid command arguments", `unsupported option: -${flag}`);
507
- }
508
- commandOptions.push(...args.slice(startIndex + 1, index + 1));
509
- if (listOption && args[index] !== "@")
510
- commandOptions.push("@");
511
- }
512
- else if (archive === undefined) {
513
- archive = argument;
514
- commandPaths.push(original);
515
- }
516
- else {
517
- if (operands.length >= limits.maxMembers)
518
- fail("operand limit exceeded");
519
- if (firstOperand < 0)
520
- firstOperand = index;
521
- operands.push(argument);
522
- commandPaths.push(original);
523
- }
524
- }
525
- validateArgumentText();
526
- if (repair || adjust) {
527
- if (repair && adjust || junkSfx || grow || move || split !== undefined || operands.length || stdinNames || includes.length || excludes.length || action !== "add" || archiveComment || entryComments || latestTime || filesync || encrypt || showFiles !== undefined || difference || toCrlf || fromCrlf || recursive || recursivePatterns)
528
- throw new ZipFailure(16, "Invalid command arguments", "repair/adjust cannot be combined with archive modification or selection");
529
- if (!archive || archive === "-" || repair && (!output || output === "-"))
530
- throw new ZipFailure(16, "Invalid command arguments", "recovery requires a named source and a separate --out file");
531
- }
532
- if (showCommand)
533
- return { information: "command", command: [context.command, ...commandOptions, ...commandPaths], debug };
534
- if (showOptions)
535
- return { information: "options", debug };
536
- if (verbose && !dotsSet && !dotSize)
537
- dotSize = 10 * 1024 ** 2;
538
- if (archive === undefined) {
539
- if (includes.length || excludes.length)
540
- throw new ZipFailure(16, "Invalid command arguments", "nothing to select from");
541
- if (action !== "add")
542
- throw new ZipFailure(16, "Invalid command arguments", "expected archive name");
543
- archive = "-";
544
- if (!stdinNames)
545
- operands.push("-");
546
- }
547
- if (archive !== "-" && !archive.slice(archive.lastIndexOf("/") + 1).includes("."))
548
- archive += ".zip";
549
- checkPath(archive, limits);
550
- if (output !== undefined) {
551
- if (!output.slice(output.lastIndexOf("/") + 1).includes("."))
552
- output += ".zip";
553
- checkPath(output, limits);
554
- if (action === "add" && archive !== "-" && !operands.length && !stdinNames)
555
- action = "copy";
556
- }
557
- if (showFiles !== undefined && !operands.length && !stdinNames && (includes.length || excludes.length))
558
- throw new ZipFailure(16, "Invalid command arguments", "nothing to select from");
559
- if (action === "copy" && output === undefined && showFiles === undefined)
560
- throw new ZipFailure(16, "Invalid command arguments", "-U (--copy) requires -O (--out)");
561
- const names = [];
562
- if (stdinNames) {
563
- const input = await collectBytes(scope.stdin, { ...(Number.isFinite(limits.maxFilesFromBytes) ? { maxBytes: limits.maxFilesFromBytes } : {}), signal: context.signal });
564
- let start = 0;
565
- let lines = 0;
566
- for (let end = 0; end <= input.length; end++) {
567
- if (end !== input.length && input[end] !== 10)
568
- continue;
569
- if (++lines > limits.maxPatternSteps)
570
- fail("stdin filename work limit exceeded");
571
- if (lines % 128 === 0)
572
- await yieldTurn(context.signal);
573
- let last = end;
574
- while (last > start && input[last - 1] === 13)
575
- last--;
576
- if (last > start) {
577
- if (names.length + operands.length >= limits.maxMembers)
578
- fail("operand limit exceeded");
579
- if (last - start > limits.maxPathBytes)
580
- fail("path byte limit exceeded");
581
- const name = text(input.subarray(start, last));
582
- checkPath(name, limits);
583
- names.push(name);
584
- }
585
- start = end + 1;
586
- }
587
- }
588
- if (recursivePatterns && !names.length && !operands.length)
589
- throw new ZipFailure(16, "Invalid command arguments", "nothing to select from");
590
- if (difference && (archive === "-" || output === undefined || action === "copy" || action === "delete"))
591
- throw new ZipFailure(16, "Invalid command arguments", "difference archive requires separate output and cannot use delete or copy");
592
- if (logPath !== undefined && !logPath.slice(logPath.lastIndexOf("/") + 1).includes("."))
593
- logPath += ".log";
594
- if (filesync && (action !== "add" || grow))
595
- throw new ZipFailure(16, "Invalid command arguments", "can't use -d, -f, -u, -U, or -g with filesync -FS\n");
596
- const diagnosticArgs = args.map((value, index) => passwordArguments.has(index - defaultsCount) ? "[redacted]" : zipPublicText(value));
597
- if (split && (archive === "-" || grow))
598
- throw new ZipFailure(16, "Invalid command arguments", "split output requires a file and cannot grow");
599
- return { repair, adjust, split, splitPause, splitVerbose, splitBell, password, encrypt, ...(aes ? { aes } : {}), args: diagnosticArgs, action, archive, output, recursive, recursivePatterns, noWild, stopAtDirectories, quiet, verbose, showFiles, debug, displayBytes, displayCounts, displayUsize, displayVolume, dotSize, globalDots, junkPaths, dosNames, fifo, omitDirectories, storeLinks: storeLinks && !dosNames, test, testCommand, difference, grow, tempPath, junkSfx, logPath, logAppend, logInfo, mustMatch, filesync, archiveComment, entryComments, latestTime, toCrlf, fromCrlf, move, fromDate, beforeDate, descriptors, zip64, metadata, includes, excludes, level, method, suffixes, operands: [...names, ...operands], firstOperand };
600
- }
601
- function memberName(path, limits) {
602
- if (path.startsWith("//") && !path.startsWith("///"))
603
- fail("UNC source paths are unsupported");
604
- let start = 0;
605
- while (path[start] === "/")
606
- start++;
607
- while (path.slice(start, start + 2) === "./")
608
- start += 2;
609
- const name = path.slice(start);
610
- if (name.split("/").includes(".."))
611
- fail("parent-component archive names are unsupported");
612
- if (name && name !== ".")
613
- checkPath(name, limits);
614
- return name === "." ? "" : name;
615
- }
616
- async function inspectSource(scope, path, storeLinks) {
617
- const { fs, signal } = scope.context;
618
- if (storeLinks) {
619
- const stat = await scope.operation(() => fs.lstat(path, { signal }));
620
- if (stat.type === "symlink") {
621
- const parent = await scope.operation(() => fs.realpath(dirname(path), { signal }));
622
- const canonical = `${parent === "/" ? "" : parent}/${path.slice(path.lastIndexOf("/") + 1)}`;
623
- return { canonical, stat };
624
- }
625
- }
626
- const canonical = await scope.operation(() => fs.realpath(path, { signal }));
627
- const stat = await scope.operation(() => fs.stat(path, { signal }));
628
- return { canonical, stat };
629
- }
630
- async function filterName(name, selection, includeCount) {
631
- selection.matched.clear();
632
- await selection.matches(name);
633
- let included = includeCount === 0;
634
- for (const pattern of selection.matched) {
635
- if (pattern >= includeCount)
636
- return false;
637
- included = true;
638
- }
639
- return included;
640
- }
641
- async function prepare(scope, parsed, budget, log, host) {
642
- const context = scope.context;
643
- const limits = budget.limits;
644
- if (parsed.archive === "-" && parsed.action !== "add")
645
- throw new ZipFailure(16, "Invalid command arguments", "can't use -d, -f, -u, -U, or -g on stdout\n");
646
- let temporary;
647
- if (parsed.tempPath !== undefined && parsed.showFiles === undefined) {
648
- const name = vfsPath(context.cwd, parsed.tempPath);
649
- checkPath(name, limits);
650
- const parent = await scope.operation(() => context.fs.realpath(name, { signal: context.signal }));
651
- const parentStat = await scope.operation(() => context.fs.lstat(parent, { signal: context.signal }));
652
- if (parentStat.type !== "directory" || !hasIdentity(parentStat))
653
- fail("ZIP temporary path requires a directory with known backing identity");
654
- temporary = { name, parent, parentStat };
655
- }
656
- let publication;
657
- if (parsed.archive !== "-" && parsed.showFiles === undefined) {
658
- const outputName = vfsPath(context.cwd, parsed.output ?? parsed.archive);
659
- const parentName = dirname(outputName);
660
- const parent = await scope.operation(() => context.fs.realpath(parentName, { signal: context.signal }));
661
- const parentStat = await scope.operation(() => context.fs.lstat(parent, { signal: context.signal }));
662
- const output = `${parent === "/" ? "" : parent}/${outputName.slice(outputName.lastIndexOf("/") + 1)}`;
663
- checkPath(output, limits);
664
- const existing = await scope.stat(output);
665
- publication = { output, parentName, parent, parentStat, existing };
666
- if (temporary)
667
- publication = { ...publication, stagingName: temporary.name, stagingParent: temporary.parent, stagingParentStat: temporary.parentStat };
668
- }
669
- const output = publication?.output ?? (parsed.output === undefined ? undefined : vfsPath(context.cwd, parsed.output));
670
- let input = publication?.output;
671
- let existing = publication?.existing;
672
- if (parsed.showFiles !== undefined && parsed.archive !== "-") {
673
- input = vfsPath(context.cwd, parsed.archive);
674
- existing = await scope.stat(input);
675
- }
676
- if (parsed.output !== undefined && parsed.showFiles === undefined) {
677
- if (parsed.archive === "-") {
678
- input = undefined;
679
- existing = undefined;
680
- }
681
- else {
682
- const name = vfsPath(context.cwd, parsed.archive);
683
- try {
684
- const parent = await scope.operation(() => context.fs.realpath(dirname(name), { signal: context.signal }));
685
- input = `${parent === "/" ? "" : parent}/${name.slice(name.lastIndexOf("/") + 1)}`;
686
- existing = await scope.stat(input);
687
- }
688
- catch (error) {
689
- context.signal.throwIfAborted();
690
- if (typeof error === "object" && error !== null && "code" in error && (error.code === "ENOENT" || error.code === "EACCES"))
691
- throw new ZipFailure(18, "File not found or no read permission", parsed.archive);
692
- throw error;
693
- }
694
- if (input === output || existing && publication?.existing && sameIdentity(existing, publication.existing))
695
- throw new ZipFailure(16, "Invalid command arguments", `--out path must be different than in path: ${parsed.archive}`);
696
- }
697
- }
698
- if ((parsed.action === "copy" || parsed.showFiles !== undefined && !parsed.operands.length || parsed.output !== undefined && parsed.archive !== "-") && !existing)
699
- throw new ZipFailure(18, "File not found or no read permission", parsed.archive);
700
- const allowHardlinkedUpdate = !parsed.split && parsed.output === undefined;
701
- if (publication?.existing && !await safeZipFile(scope, publication.output, publication.existing, allowHardlinkedUpdate))
702
- fail("output archive requires a regular, single-link file with known backing identity");
703
- if (parsed.archive === "-" && parsed.test && !parsed.quiet)
704
- await budget.output("\tzip warning: can't use -T on stdout, -T ignored\n");
705
- if (existing && !await safeZipFile(scope, input, existing, allowHardlinkedUpdate))
706
- fail("updating archive requires a regular, single-link file with known backing identity; archive aliases are unsupported");
707
- let archive = { entries: [], comment: new Uint8Array() };
708
- let originalBytes;
709
- let inputPaths = [];
710
- let inputSplit;
711
- if (existing && input) {
712
- if (!Number.isSafeInteger(existing.size) || existing.size < 0 || existing.size > limits.maxArchiveBytes)
713
- fail("archive byte limit exceeded");
714
- const bytes = await collectBytes(scope.input(input), { ...(Number.isFinite(limits.maxArchiveBytes) ? { maxBytes: limits.maxArchiveBytes } : {}), ...(Number.isFinite(limits.maxInputMemoryBytes) ? { maxMemoryBytes: limits.maxInputMemoryBytes } : {}), signal: context.signal });
715
- if (bytes.length !== existing.size)
716
- fail("archive changed while reading");
717
- const resolved = parsed.repair || parsed.adjust ? { bytes, paths: [input] } : await resolveZipVolumes(scope, input, bytes, host);
718
- inputPaths = resolved.paths;
719
- await log?.protect(inputPaths);
720
- if (resolved.disks && resolved.disks.starts.length > 1)
721
- inputSplit = Math.max(65536, ...resolved.disks.lengths.slice(0, -1));
722
- if (publication && parsed.output !== undefined)
723
- for (const path of inputPaths) {
724
- const stat = await scope.stat(path);
725
- if (publication.output === path || stat && publication.existing && sameIdentity(stat, publication.existing))
726
- fail("ZIP output aliases an input volume");
727
- }
728
- if ((parsed.split || resolved.disks) && parsed.output === undefined && parsed.showFiles === undefined)
729
- throw new ZipFailure(16, "Invalid command arguments", "split archives require a separate --out destination");
730
- if (parsed.repair || parsed.adjust) {
731
- if (!publication)
732
- fail("ZIP repair requires a file destination");
733
- let outputBytes, partial = false;
734
- if (parsed.repair) {
735
- const recovered = await repairZip(bytes, parsed.repair, limits, context.signal, parsed.password);
736
- partial = recovered.partial;
737
- outputBytes = await writeZipArchive(recovered.archive, limits, context.signal);
738
- const verified = await readZipArchive(outputBytes, limits, context.signal);
739
- for (const entry of verified.entries)
740
- for await (const chunk of decodeZipEntry(entry, limits, context.signal, parsed.password)) {
741
- void chunk;
742
- }
743
- }
744
- else {
745
- archive = await readZipArchive(bytes, limits, context.signal, { prefix: true });
746
- outputBytes = await adjustZipSfx(bytes, archive, limits, context.signal, parsed.password);
747
- }
748
- const current = await scope.stat(input);
749
- if (!current || !unchanged(existing, current))
750
- fail("archive changed while reading");
751
- const progress = [];
752
- if (!parsed.quiet)
753
- progress.push(parsed.repair ? `Fix archive (-${parsed.repair}) - verified recovered members\n` : "Zip entry offsets adjusted\n");
754
- if (partial)
755
- progress.push("\tzip warning: partial recovery; some entries were not recovered\n");
756
- return { kind: "file", inputSplit, inputPaths, testRequired: parsed.test, publication, bytes: outputBytes, progress, exitCode: 0, moves: [] };
757
- }
758
- archive = parsed.junkSfx ? await readZipSfx(bytes, limits, context.signal, parsed.password) : await readZipArchive(resolved.bytes, limits, context.signal, { grow: parsed.grow, ...(resolved.disks ? { disks: resolved.disks } : {}) });
759
- if (!resolved.disks && (parsed.latestTime || parsed.test))
760
- originalBytes = bytes;
761
- const current = await scope.stat(input);
762
- if (!current || !unchanged(existing, current))
763
- fail("archive changed while reading");
764
- }
765
- const logStat = parsed.logPath === undefined ? undefined : await scope.stat(vfsPath(context.cwd, parsed.logPath));
766
- const old = new Map(archive.entries.map(entry => [entry.name, entry]));
767
- const liveProfile = !parsed.split && !existing && !parsed.toCrlf && !parsed.fromCrlf && !parsed.archiveComment && !parsed.entryComments
768
- && !parsed.test && !parsed.latestTime && parsed.tempPath === undefined;
769
- if (!archive.entries.length && !parsed.quiet && (parsed.action === "update" || parsed.action === "freshen"))
770
- await budget.output(`\tzip warning: ${zipPublicText(parsed.archive)} not found or empty\n`);
771
- const dosConvertedNames = new Set();
772
- const selected = new Map();
773
- const conversionWarnings = new Map();
774
- const listed = new Map();
775
- const moves = new Map();
776
- const deleted = new Set();
777
- const synchronized = new Map();
778
- const commentNames = new Set();
779
- const selection = new Selection([...parsed.includes, ...parsed.excludes], limits, context.signal, { noWild: parsed.noWild, stopAtDirectories: parsed.stopAtDirectories });
780
- const recursiveSelection = parsed.recursivePatterns ? new Selection(parsed.dosNames ? parsed.operands.map(zipDosName) : parsed.operands, limits, context.signal, { noWild: parsed.noWild, stopAtDirectories: parsed.stopAtDirectories, trailingComponents: true }) : undefined;
781
- const ancestors = [];
782
- let visits = 0;
783
- let work = 0;
784
- let compressedBytes = 0;
785
- const encodeSelected = async (source, name, input, attributes, expectedSize) => {
786
- const live = !(input instanceof Uint8Array);
787
- let bytes = live ? new Uint8Array() : input;
788
- const sourceSize = live ? expectedSize ?? 0 : bytes.length;
789
- const originalBytes = bytes;
790
- const store = parsed.method === "store" || parsed.level !== 9 && parsed.suffixes.some(suffix => name.endsWith(suffix));
791
- if (!store && parsed.level === 0 && bytes.length && !attributes.directory && !attributes.symlink)
792
- throw new ZipFailure(5, "Internal logic error", "bad pack level");
793
- if ((parsed.toCrlf || parsed.fromCrlf) && !attributes.directory && !attributes.symlink) {
794
- if (parsed.fromCrlf && parsed.method === "bzip2" && !store)
795
- fail("from-crlf BZIP2 native read profile unsupported");
796
- const originalSize = bytes.length;
797
- bytes = parsed.fromCrlf ? await zipFromCrlf(bytes, store, context.signal, parsed.level) : await zipToCrlf(bytes, store, Math.min(limits.maxEntryBytes, limits.maxTotalBytes - budget.totalBytes + originalSize), context.signal);
798
- budget.totalBytes += bytes.length - originalSize;
799
- }
800
- const level = store ? 0 : parsed.level;
801
- let entry = await makeZipEntry(name, bytes, attributes, limits, context.signal, level, !store && (parsed.archive === "-" && parsed.tempPath === undefined || parsed.descriptors && bytes.length > 0), parsed.method === "store" ? "deflate" : parsed.method);
802
- if (live) {
803
- entry = { ...entry, data: new Uint8Array(), size: expectedSize ?? 0, source: input, level,
804
- method: store || expectedSize === 0 && parsed.archive !== "-" ? 0 : parsed.method === "lzma" ? 14 : parsed.method === "bzip2" ? 12 : 8, ...(parsed.method === "lzma" && !store && !(expectedSize === 0 && parsed.archive !== "-") ? { flags: 0x802 } : {}), ...(expectedSize === undefined ? {} : { expectedSize }) };
805
- }
806
- if (parsed.fromCrlf && sourceSize > 0 && !store && entry.internalAttributes === 0 && !attributes.directory && !attributes.symlink && !parsed.quiet) {
807
- conversionWarnings.set(name, `\tzip warning: ${bytes === originalBytes ? "has binary so -ll ignored" : "-ll used on binary file - corrupted?"}\n`);
808
- }
809
- if (parsed.descriptors)
810
- entry.descriptors = true;
811
- if (parsed.zip64 === false)
812
- entry.zip64 = false;
813
- if (parsed.zip64 === true || parsed.zip64 === undefined && source === "-")
814
- entry.zip64 = true;
815
- const prior = old.get(name);
816
- if (prior?.comment)
817
- entry = { ...entry, comment: prior.comment };
818
- if (parsed.metadata !== "default")
819
- entry = updateZipExtras(entry, prior, parsed.metadata, limits);
820
- if (entry.data.length > limits.maxArchiveBytes - compressedBytes)
821
- fail("archive byte limit exceeded");
822
- compressedBytes += entry.data.length;
823
- if (dosConvertedNames.has(name)) {
824
- entry = { ...entry, mode: attributes.directory ? 0o040755 : 0o100644, versionMadeBy: 30, externalAttributes: attributes.directory ? 16 : 0, flags: (entry.flags ?? 0) & ~0x800 | (prior?.comment?.some(byte => byte >= 128) ? (prior.flags ?? 0) & 0x800 : 0) };
825
- }
826
- if (parsed.encryption && !entry.directory)
827
- entry.encryption = parsed.encryption;
828
- selected.set(name, { entry, source, sourceSize });
829
- if (parsed.entryComments)
830
- commentNames.add(name);
831
- };
832
- const visit = async (source, name, depth, storedName = false) => {
833
- context.signal.throwIfAborted();
834
- if (++visits > limits.maxMembers)
835
- fail("traversal member limit exceeded");
836
- if (++work > limits.maxPatternSteps)
837
- fail("archive work limit exceeded");
838
- if (visits % 128 === 0)
839
- await yieldTurn(context.signal);
840
- if (depth > limits.maxDepth)
841
- fail("archive recursion depth limit exceeded");
842
- if (source === "-") {
843
- const previous = selected.get(name) ?? listed.get(name);
844
- if (previous && previous.source !== source)
845
- throw new ZipFailure(16, "Invalid command arguments", "cannot repeat names in zip file");
846
- if (previous || !await filterName(name, selection, parsed.includes.length))
847
- return;
848
- const prior = old.get(name);
849
- const modified = new Date();
850
- if (parsed.entryComments && prior)
851
- commentNames.add(name);
852
- if (!zipDateMatches(modified, parsed.fromDate, parsed.beforeDate))
853
- return;
854
- if (parsed.filesync) {
855
- if (synchronized.has(name) && synchronized.get(name) !== source)
856
- throw new ZipFailure(16, "Invalid command arguments", "cannot repeat names in zip file");
857
- synchronized.set(name, source);
858
- }
859
- if (parsed.action === "freshen" && !prior || prior && (parsed.action === "update" || parsed.action === "freshen") && Math.floor(modified.getTime() / 1000) <= Math.floor(prior.modified.getTime() / 1000))
860
- return;
861
- if (parsed.showFiles !== undefined) {
862
- await budget.member(0);
863
- listed.set(name, { name, size: 0, source });
864
- return;
865
- }
866
- const live = liveProfile;
867
- const bytes = live ? scope.stdin : await collectBytes(scope.stdin, { ...(Number.isFinite(Math.min(limits.maxEntryBytes, limits.maxTotalBytes - budget.totalBytes)) ? { maxBytes: Math.min(limits.maxEntryBytes, limits.maxTotalBytes - budget.totalBytes) } : {}), signal: context.signal });
868
- await budget.member(bytes instanceof Uint8Array ? bytes.length : 0);
869
- await encodeSelected(source, name, bytes, { modified, mode: 0o010660, directory: false, symlink: false });
870
- return;
871
- }
872
- const path = vfsPath(context.cwd, source);
873
- checkPath(path, limits);
874
- let canonical;
875
- let stat;
876
- try {
877
- ({ canonical, stat } = await inspectSource(scope, path, parsed.storeLinks));
878
- }
879
- catch (error) {
880
- context.signal.throwIfAborted();
881
- if (typeof error !== "object" || error === null || !("code" in error))
882
- throw error;
883
- if (parsed.mustMatch && error.code === "EACCES")
884
- throw new ZipFailure(18, "File not found or no read permission", source);
885
- if (error.code !== "ENOENT")
886
- throw error;
887
- if (!storedName) {
888
- const operandName = memberName(source, limits);
889
- const pattern = new Selection([parsed.junkPaths ? operandName.slice(operandName.lastIndexOf("/") + 1) : operandName], limits, context.signal, { noWild: parsed.noWild, stopAtDirectories: parsed.stopAtDirectories });
890
- let matched = false;
891
- for (const entry of archive.entries) {
892
- if (await pattern.matches(entry.name, true)) {
893
- matched = true;
894
- await visit(entry.name, entry.name, depth, true);
895
- }
896
- }
897
- if (matched)
898
- return;
899
- }
900
- if (parsed.entryComments && old.has(name) && await filterName(name, selection, parsed.includes.length))
901
- commentNames.add(name);
902
- if (parsed.mustMatch && !storedName) {
903
- if (!parsed.quiet)
904
- await budget.output(`\tzip warning: name not matched: ${zipPublicText(source)}\n`);
905
- throw new ZipFailure(18, "File not found or no read permission", source);
906
- }
907
- if (!parsed.quiet && !storedName)
908
- await budget.output(`\tzip warning: name not matched: ${zipPublicText(source)}\n`);
909
- return;
910
- }
911
- checkPath(canonical, limits);
912
- if (canonical === output || canonical === input || (existing && sameIdentity(existing, stat)) || (publication?.existing && sameIdentity(publication.existing, stat)))
913
- return;
914
- const symlink = parsed.storeLinks && stat.type === "symlink";
915
- const fifoSource = (stat.mode & 0o170000) === 0o010000;
916
- if (fifoSource && !parsed.fifo || stat.type !== "file" && stat.type !== "directory" && !symlink && !fifoSource) {
917
- if (!parsed.quiet)
918
- await budget.output(`\tzip warning: ignoring special file: ${zipPublicText(source)}\n`);
919
- return;
920
- }
921
- const directory = stat.type === "directory";
922
- if ((existing || publication?.existing) && !directory && !hasIdentity(stat))
923
- fail("cannot exclude archive aliases when source backing identity is unknown");
924
- if (directory && name && !name.endsWith("/"))
925
- name += "/";
926
- const dateIncluded = zipDateMatches(new Date(stat.mtimeMs), parsed.fromDate, parsed.beforeDate);
927
- const nameIncluded = (dateIncluded || parsed.entryComments) && await filterName(name, selection, parsed.includes.length) && (!recursiveSelection || await recursiveSelection.matches(name, true));
928
- const included = dateIncluded && nameIncluded;
929
- if (logStat && included && (!hasIdentity(stat) || sameIdentity(logStat, stat))) {
930
- if (log)
931
- log.failed = true;
932
- throw new ZipFailure(16, "Invalid command arguments", "ZIP log may not alias a selected source");
933
- }
934
- const sourceName = name;
935
- if (parsed.junkPaths && !storedName)
936
- name = directory ? "" : name.slice(name.lastIndexOf("/") + 1);
937
- if (parsed.dosNames && !storedName && name && included) {
938
- name = zipDosName(name);
939
- if (!name || (directory ? name.slice(0, -1) : name).split("/").some(component => !component))
940
- throw new ZipFailure(16, "Invalid command arguments", "DOS conversion produces an empty component");
941
- dosConvertedNames.add(name);
942
- }
943
- const prior = old.get(name);
944
- if (parsed.entryComments && prior && nameIncluded)
945
- commentNames.add(name);
946
- if ((parsed.filesync || parsed.difference) && name && included && !(directory && parsed.omitDirectories)) {
947
- if (synchronized.has(name) && synchronized.get(name) !== source)
948
- throw new ZipFailure(16, "Invalid command arguments", "cannot repeat names in zip file");
949
- synchronized.set(name, source);
950
- }
951
- const current = !fifoSource && (parsed.filesync || parsed.difference) && prior && prior.size === (directory ? 0 : stat.size)
952
- && Math.ceil(Math.floor(stat.mtimeMs / 1000) / 2) === Math.ceil(Math.floor(prior.modified.getTime() / 1000) / 2);
953
- const eligible = parsed.action !== "update" && parsed.action !== "freshen"
954
- || (prior ? Math.floor(stat.mtimeMs / 1000) > Math.floor(prior.modified.getTime() / 1000) : parsed.action === "update");
955
- if (parsed.showFiles === undefined && parsed.move && (!parsed.difference || !current && eligible) && name && included && !(directory && parsed.omitDirectories) && (prior || parsed.action !== "freshen")) {
956
- if (!moves.has(path))
957
- moves.set(path, await inspectZipMoveSource(scope, path, source));
958
- }
959
- if (name && included && eligible && (!current || parsed.showFiles !== undefined) && !(directory && parsed.omitDirectories)) {
960
- checkPath(name, limits);
961
- const previous = selected.get(name) ?? listed.get(name);
962
- if (previous && previous.source !== source) {
963
- if (!parsed.quiet)
964
- await budget.output(`\tzip warning: first full name: ${zipPublicText(previous.source)}\n second full name: ${zipPublicText(source)}\n name in zip file repeated: ${zipPublicText(name)}\n`);
965
- throw new ZipFailure(16, "Invalid command arguments", "cannot repeat names in zip file");
966
- }
967
- if (!previous) {
968
- if (fifoSource && parsed.move)
969
- fail("FIFO move is unsupported: producer streams have no removable file snapshot");
970
- await budget.member(directory || fifoSource ? 0 : stat.size);
971
- if (parsed.showFiles !== undefined) {
972
- listed.set(name, { name, size: directory ? 0 : stat.size, source });
973
- }
974
- else {
975
- const store = parsed.method === "store" || parsed.level !== 9 && parsed.suffixes.some(suffix => name.endsWith(suffix));
976
- if (fifoSource) {
977
- const bytes = await collectBytes(scope.input(path, true), { ...(Number.isFinite(Math.min(limits.maxEntryBytes, limits.maxTotalBytes - budget.totalBytes)) ? { maxBytes: Math.min(limits.maxEntryBytes, limits.maxTotalBytes - budget.totalBytes) } : {}), signal: context.signal });
978
- const current = await inspectSource(scope, path, parsed.storeLinks);
979
- if (current.canonical !== canonical || !unchanged(stat, current.stat))
980
- fail(`source changed while reading: ${source}`);
981
- budget.totalBytes += bytes.length;
982
- await encodeSelected(source, name, bytes, { modified: new Date(stat.mtimeMs), mode: 0o100644, directory: false, symlink: false });
983
- return;
984
- }
985
- if (liveProfile && !directory && !symlink && (parsed.archive === "-" || store || parsed.descriptors)) {
986
- const input = (async function* () {
987
- yield* scope.input(path, false, stat);
988
- const current = await inspectSource(scope, path, parsed.storeLinks);
989
- if (current.canonical !== canonical || !unchanged(stat, current.stat))
990
- fail(`source changed while reading: ${source}`);
991
- })();
992
- await encodeSelected(source, name, input, { modified: new Date(stat.mtimeMs), mode: stat.mode, directory, symlink }, stat.size);
993
- return;
994
- }
995
- let bytes;
996
- if (directory)
997
- bytes = new Uint8Array();
998
- else if (symlink) {
999
- if (!context.fs.readlink)
1000
- fail("filesystem does not support reading symbolic links");
1001
- const target = await scope.operation(() => context.fs.readlink(path, { signal: context.signal }));
1002
- if (byteLength(target) > stat.size)
1003
- fail(`source changed while reading: ${source}`);
1004
- bytes = encodeBytes(target);
1005
- }
1006
- else {
1007
- try {
1008
- bytes = await collectBytes(scope.input(path, false, stat), { maxBytes: stat.size, signal: context.signal });
1009
- }
1010
- catch (error) {
1011
- context.signal.throwIfAborted();
1012
- if (parsed.mustMatch && typeof error === "object" && error !== null && "code" in error && (error.code === "ENOENT" || error.code === "EACCES"))
1013
- throw new ZipFailure(18, "File not found or no read permission", `was zipping ${source}`);
1014
- throw error;
1015
- }
1016
- }
1017
- if (!directory && bytes.length !== stat.size)
1018
- fail(`source changed while reading: ${source}`);
1019
- const current = await inspectSource(scope, path, parsed.storeLinks);
1020
- if (current.canonical !== canonical || !unchanged(stat, current.stat))
1021
- fail(`source changed while reading: ${source}`);
1022
- await encodeSelected(source, name, bytes, { modified: new Date(stat.mtimeMs), mode: stat.mode, directory, symlink });
1023
- }
1024
- }
1025
- }
1026
- if (directory && !storedName && (parsed.recursive || parsed.recursivePatterns)) {
1027
- if (ancestors.some(ancestor => ancestor.path === canonical || sameIdentity(ancestor.stat, stat)))
1028
- fail(`directory cycle while archiving: ${source}`);
1029
- ancestors.push({ path: canonical, stat });
1030
- try {
1031
- const children = await scope.operation(() => context.fs.readdir(path, { signal: context.signal, ...(Number.isFinite(limits.maxMembers) ? { maxEntries: limits.maxMembers - visits } : {}) }));
1032
- if (children.length > limits.maxMembers - visits)
1033
- fail("traversal member limit exceeded");
1034
- for (const child of children) {
1035
- if (!child.name || child.name === "." || child.name === ".." || child.name.includes("/") || child.name.includes("\0"))
1036
- fail("invalid filesystem directory entry");
1037
- const prefix = source === "." ? "" : source.endsWith("/") ? source : `${source}/`;
1038
- await visit(`${prefix}${child.name}`, `${sourceName}${child.name}`, depth + 1);
1039
- }
1040
- }
1041
- finally {
1042
- ancestors.pop();
1043
- }
1044
- }
1045
- };
1046
- const editComment = parsed.archiveComment && parsed.action !== "delete" && parsed.action !== "copy";
1047
- const editEntries = parsed.entryComments && parsed.action !== "delete" && parsed.action !== "copy";
1048
- if ((parsed.archiveComment || parsed.entryComments || parsed.move) && parsed.action === "copy" && !parsed.quiet)
1049
- await budget.output("\tzip warning: can't set method, move, recurse, or comments with copy mode.\n");
1050
- if (parsed.action === "copy") {
1051
- const operands = new Selection(parsed.operands, limits, context.signal, { noWild: parsed.noWild, stopAtDirectories: parsed.stopAtDirectories });
1052
- for (const entry of archive.entries) {
1053
- if (await operands.matches(entry.name) && await filterName(entry.name, selection, parsed.includes.length) && zipDateMatches(entry.modified, parsed.fromDate, parsed.beforeDate)) {
1054
- await budget.member(entry.size);
1055
- selected.set(entry.name, { entry, source: entry.name, sourceSize: entry.size });
1056
- }
1057
- }
1058
- }
1059
- else if (parsed.action === "delete") {
1060
- if (!parsed.quiet && (parsed.recursive || parsed.archiveComment || parsed.entryComments || parsed.move))
1061
- await budget.output("\tzip warning: invalid option(s) used with -d; ignored.\n");
1062
- if (!parsed.quiet && !archive.entries.length)
1063
- await budget.output(`\tzip warning: ${zipPublicText(parsed.archive)} not found or empty\n`);
1064
- const operands = new Selection(parsed.recursivePatterns ? [] : parsed.operands, limits, context.signal, { noWild: parsed.noWild, stopAtDirectories: parsed.stopAtDirectories });
1065
- if (parsed.operands.length && !parsed.recursivePatterns) {
1066
- for (const entry of archive.entries) {
1067
- if (await operands.matches(entry.name) && await filterName(entry.name, selection, parsed.includes.length) && zipDateMatches(entry.modified, parsed.fromDate, parsed.beforeDate))
1068
- deleted.add(entry.name);
1069
- }
1070
- }
1071
- if (parsed.mustMatch && !parsed.recursivePatterns) {
1072
- for (const [index, operand] of parsed.operands.entries()) {
1073
- if (!operands.matched.has(index))
1074
- throw new ZipFailure(18, "File not found or no read permission", operand);
1075
- }
1076
- }
1077
- if (!parsed.quiet) {
1078
- for (const [index, operand] of parsed.operands.entries()) {
1079
- if (!operands.matched.has(index))
1080
- await budget.output(`\tzip warning: name not matched: ${zipPublicText(operand)}\n`);
1081
- }
1082
- }
1083
- }
1084
- else {
1085
- const operands = parsed.showFiles !== undefined && !parsed.operands.length ? [] : parsed.operands.length || parsed.action === "add" ? parsed.operands : archive.entries.map(entry => entry.name);
1086
- if (parsed.recursivePatterns)
1087
- await visit(".", "", 0);
1088
- else
1089
- for (const operand of operands)
1090
- await visit(operand, memberName(operand, limits), 0);
1091
- }
1092
- if (!publication || !(parsed.split ?? inputSplit))
1093
- await log?.start();
1094
- if (parsed.showFiles !== undefined) {
1095
- const contains = !parsed.operands.length && !parsed.includes.length && !parsed.excludes.length;
1096
- const listing = contains ? archive.entries : parsed.action === "delete" ? archive.entries.filter(entry => deleted.has(entry.name)) : parsed.action === "copy" ? [...selected.values()].map(item => item.entry) : [...listed.values()];
1097
- const title = contains ? "Archive contains" : parsed.action === "delete" ? "Would Delete" : parsed.action === "freshen" ? "Would Freshen" : parsed.action === "copy" ? "Would Copy" : "Would Add/Update";
1098
- if (!parsed.quiet && parsed.showFiles) {
1099
- await budget.output(`${title}:\n`);
1100
- for (const entry of listing)
1101
- await budget.output(` ${escapeText(zipPublicText(entry.name), "display")}\n`);
1102
- }
1103
- await budget.output(`Total ${listing.length} entries (${listing.reduce((total, entry) => total + entry.size, 0)} bytes)\n`);
1104
- return { kind: "current", exitCode: 0, moves: [] };
1105
- }
1106
- if (parsed.filesync) {
1107
- if (!synchronized.size)
1108
- throw new ZipFailure(12, "Nothing to do!", parsed.archive);
1109
- for (const entry of archive.entries)
1110
- if (!synchronized.has(entry.name))
1111
- deleted.add(entry.name);
1112
- if (!selected.size && !deleted.size) {
1113
- if (!parsed.quiet)
1114
- await budget.output("Archive is current\n");
1115
- if (!parsed.latestTime)
1116
- return { kind: "current", exitCode: 0, moves: [...moves.values()] };
1117
- }
1118
- }
1119
- const changed = selected.size > 0 || deleted.size > 0;
1120
- const testRequired = parsed.test && !(parsed.filesync && !changed);
1121
- let exitCode = 0;
1122
- if (!parsed.difference && !selected.size && !((editComment || editEntries || parsed.junkSfx || parsed.test) && archive.entries.length) && (parsed.action === "freshen" || parsed.action === "update" && (existing || !parsed.includes.length))) {
1123
- if (!parsed.latestTime || !archive.entries.length)
1124
- return moves.size ? { kind: "current", exitCode: 12, moves: [...moves.values()] } : undefined;
1125
- exitCode = 12;
1126
- }
1127
- if (parsed.latestTime && !changed && !archive.entries.length && parsed.archive !== "-")
1128
- throw new ZipFailure(13, "Missing or empty zip file", parsed.archive);
1129
- if (!parsed.difference && !selected.size && !deleted.size && !((editComment || editEntries || parsed.junkSfx || parsed.latestTime || parsed.test) && archive.entries.length) && (parsed.action === "delete" || parsed.action === "copy" || parsed.recursivePatterns || parsed.fromDate !== undefined || parsed.beforeDate !== undefined || !parsed.includes.length)) {
1130
- const detail = parsed.action !== "delete" && parsed.recursive && parsed.firstOperand >= 0
1131
- ? `try: zip ${parsed.args.slice(0, parsed.firstOperand).join(" ")} . -i ${parsed.args.slice(parsed.firstOperand).join(" ")}`
1132
- : parsed.archive;
1133
- throw new ZipFailure(12, "Nothing to do!", detail);
1134
- }
1135
- const entries = [];
1136
- const progress = [];
1137
- let progressBytes = 0;
1138
- const queue = (message) => {
1139
- if (parsed.quiet)
1140
- return;
1141
- const size = byteLength(message);
1142
- if (size > limits.maxTextBytes - budget.textBytes - progressBytes)
1143
- fail("text output limit exceeded");
1144
- progressBytes += size;
1145
- progress.push(message);
1146
- };
1147
- const counted = parsed.action === "delete" ? archive.entries.filter(entry => deleted.has(entry.name)) : [...selected.values()].map(item => item.entry);
1148
- let remainingBytes = counted.reduce((total, entry) => total + (parsed.action === "delete" || parsed.action === "copy" ? entry.data.length : selected.get(entry.name)?.sourceSize ?? entry.size), 0);
1149
- let doneBytes = 0;
1150
- let done = 0;
1151
- const stats = (entry) => {
1152
- let prefix = parsed.displayVolume ? "1>1: " : "";
1153
- if (parsed.displayCounts)
1154
- prefix += `${String(done).padStart(3)}/${String(counted.length - done).padStart(3)} `;
1155
- if (parsed.displayBytes)
1156
- prefix += `[${zipDisplaySize(doneBytes).padStart(4)}/${zipDisplaySize(remainingBytes).padStart(4)}] `;
1157
- const size = parsed.action === "delete" || parsed.action === "copy" ? entry.data.length : selected.get(entry.name)?.sourceSize ?? entry.size;
1158
- done++;
1159
- doneBytes += size;
1160
- remainingBytes -= size;
1161
- return prefix;
1162
- };
1163
- const append = (entry, update) => {
1164
- if (parsed.quiet)
1165
- return;
1166
- const compressedSize = entry.compressedSize ?? entry.data.length;
1167
- const percentage = entry.size ? Math.trunc((Math.trunc(200 * (entry.size - compressedSize) / entry.size) + 1) / 2) : 0;
1168
- const prefix = stats(entry);
1169
- const usize = parsed.displayUsize ? ` (${zipDisplaySize(selected.get(entry.name)?.sourceSize ?? entry.size)})` : "";
1170
- const verbose = parsed.verbose ? `${entry.method === 0 ? "" : " "}\t(in=${entry.size}) (out=${compressedSize})` : "";
1171
- const dotCount = !parsed.globalDots && parsed.dotSize ? Math.floor(entry.size / parsed.dotSize) : 0;
1172
- if (dotCount > limits.maxTextBytes - budget.textBytes - progressBytes)
1173
- fail("text output limit exceeded");
1174
- const dots = ".".repeat(dotCount);
1175
- const warning = conversionWarnings.get(entry.name);
1176
- queue(`${prefix}${update ? parsed.action === "freshen" ? "freshening:" : "updating:" : " adding:"} ${escapeText(zipPublicText(entry.name), "display")}${usize}${verbose}${warning ? `\n${warning}` : ""} ${dots ? `${dots} ` : ""}(${entry.method === 14 ? `lzma ${percentage}%` : entry.method === 12 ? `bzipped ${percentage}%` : entry.method === 8 ? `deflated ${percentage}%` : "stored 0%"})\n`);
1177
- };
1178
- for (const entry of archive.entries) {
1179
- if (++work > limits.maxPatternSteps)
1180
- fail("archive work limit exceeded");
1181
- if (deleted.has(entry.name)) {
1182
- queue(`${stats(entry)}deleting: ${escapeText(zipPublicText(entry.name), "display")}\n`);
1183
- continue;
1184
- }
1185
- const replacement = selected.get(entry.name);
1186
- if (parsed.action === "copy") {
1187
- if (replacement) {
1188
- entries.push(replacement.entry);
1189
- queue(`${stats(entry)} copying: ${escapeText(zipPublicText(entry.name), "display")}\n`);
1190
- selected.delete(entry.name);
1191
- }
1192
- continue;
1193
- }
1194
- if (replacement) {
1195
- entries.push(replacement.entry);
1196
- append(replacement.entry, true);
1197
- selected.delete(entry.name);
1198
- }
1199
- else if (!parsed.difference) {
1200
- await budget.member(entry.size);
1201
- entries.push(entry);
1202
- }
1203
- }
1204
- if (parsed.grow && (parsed.zip64 !== undefined || deleted.size || archive.entries.some(entry => !entries.includes(entry)))) {
1205
- for (const entry of archive.entries) {
1206
- zipGrowRecords.delete(entry);
1207
- if (parsed.zip64 === false)
1208
- entry.zip64 = false;
1209
- }
1210
- }
1211
- const pendingProgress = [];
1212
- for (const { entry } of selected.values()) {
1213
- entries.push(entry);
1214
- if (entry.source)
1215
- pendingProgress.push(entry);
1216
- else
1217
- append(entry, false);
1218
- }
1219
- const summary = () => {
1220
- if (!parsed.verbose || parsed.quiet)
1221
- return;
1222
- const size = entries.reduce((total, entry) => total + entry.size, 0);
1223
- const compressed = entries.reduce((total, entry) => total + (entry.compressedSize ?? entry.data.length), 0);
1224
- queue(`total bytes=${size}, compressed=${compressed} -> ${size ? Math.round(100 * (size - compressed) / size) : 0}% savings\n`);
1225
- };
1226
- const finishProgress = () => {
1227
- if (!pendingProgress.length)
1228
- return;
1229
- for (const entry of pendingProgress.splice(0))
1230
- append(entry, false);
1231
- summary();
1232
- };
1233
- if (!pendingProgress.length)
1234
- summary();
1235
- if (!entries.length)
1236
- queue("\tzip warning: zip file empty\n");
1237
- let comment = archive.comment;
1238
- if (editComment || editEntries && commentNames.size) {
1239
- for (const message of progress)
1240
- await budget.output(message);
1241
- progress.length = 0;
1242
- progressBytes = 0;
1243
- const commentInput = new ZipCommentInput(scope.stdin, limits, context.signal);
1244
- if (editEntries) {
1245
- for (let index = 0; index < entries.length; index++) {
1246
- const entry = entries[index];
1247
- if (!commentNames.has(entry.name))
1248
- continue;
1249
- if (!parsed.quiet)
1250
- await budget.output(`Enter comment for ${zipPublicText(entry.name)}:\n`);
1251
- const line = await commentInput.readLine();
1252
- if (line !== undefined)
1253
- entries[index] = setZipEntryComment(entry, line.at(-1) === 10 ? line.subarray(0, -1) : line, limits);
1254
- }
1255
- }
1256
- if (editComment && !parsed.quiet) {
1257
- if (comment.length) {
1258
- await budget.output("current zip file comment is:\n");
1259
- await budget.output(comment);
1260
- if (comment.at(-1) !== 10)
1261
- await budget.output("\n");
1262
- }
1263
- await budget.output("enter new zip file comment (end with .):\n");
1264
- }
1265
- if (editComment)
1266
- comment = await readZipComment(commentInput, limits, context.signal);
1267
- }
1268
- if (!publication)
1269
- return { kind: "stream", temporary, archive: { entries, comment }, progress, finishProgress, moves: [...moves.values()] };
1270
- if (entries.some(entry => entry.source))
1271
- return { kind: "staged-stream", publication, archive: { entries, comment }, progress, finishProgress, exitCode, moves: [...moves.values()] };
1272
- let latestWarning;
1273
- if (parsed.latestTime) {
1274
- const mtimeMs = await zipLatestTime(entries, context.signal);
1275
- if (mtimeMs === undefined)
1276
- latestWarning = entries.length
1277
- ? "\tzip warning: zip file has only directories, can't make it as old as latest entry\n"
1278
- : "\tzip warning: zip file is empty, can't make it as old as latest entry\n";
1279
- else
1280
- publication = { ...publication, mtimeMs };
1281
- }
1282
- const bytes = originalBytes && !changed && !editComment && !editEntries && !parsed.junkSfx && !parsed.difference ? originalBytes
1283
- : await writeZipArchive({ entries, comment }, limits, context.signal, false, parsed.zip64 === true, parsed.zip64 !== false);
1284
- if (testRequired && parsed.archive !== "-") {
1285
- for (const message of progress)
1286
- await budget.output(message);
1287
- progress.length = 0;
1288
- progressBytes = 0;
1289
- }
1290
- if (latestWarning !== undefined)
1291
- queue(latestWarning);
1292
- if (!changed && originalBytes && !editComment && !editEntries && !parsed.junkSfx && !parsed.difference && (parsed.output === undefined || parsed.action === "copy" && parsed.test) && (latestWarning !== undefined || parsed.test && !parsed.latestTime)) {
1293
- if (testRequired && input)
1294
- await testZipCommand(scope, parsed.testCommand, input, budget, parsed.archive, parsed.quiet, parsed.password);
1295
- for (const message of progress)
1296
- await budget.output(message);
1297
- return { kind: "current", exitCode, moves: [...moves.values()] };
1298
- }
1299
- const sourcePaths = [];
1300
- if ((parsed.split ?? inputSplit) && parsed.action !== "copy" && parsed.action !== "delete")
1301
- for (const value of selected.values()) {
1302
- if (value.source === "-")
1303
- continue;
1304
- const path = vfsPath(context.cwd, value.source);
1305
- if (value.entry.symlink) {
1306
- const parent = await scope.operation(() => context.fs.realpath(dirname(path), { signal: context.signal }));
1307
- sourcePaths.push(`${parent === "/" ? "" : parent}/${path.slice(path.lastIndexOf("/") + 1)}`);
1308
- }
1309
- else
1310
- sourcePaths.push(await scope.operation(() => context.fs.realpath(path, { signal: context.signal })));
1311
- }
1312
- return { kind: "file", inputSplit, inputPaths: [...inputPaths, ...sourcePaths], testRequired, publication, bytes, progress, exitCode, moves: [...moves.values()] };
1313
- }
1314
- export function createZipCommand(options = {}) {
1315
- const configured = settings(options);
1316
- return { name: "zip", description: "Create or update bounded ZIP archives in the virtual filesystem", async execute(original) {
1317
- const limits = invocationLimits(configured, original);
1318
- original.signal.throwIfAborted();
1319
- const scope = new ZipScope(original, limits);
1320
- const context = scope.context;
1321
- let budget = new Budget(context, limits);
1322
- let log;
1323
- try {
1324
- let parsed = await parse(scope, limits, options.zip);
1325
- if ("information" in parsed) {
1326
- if (parsed.debug)
1327
- await budget.output("sd: Command line read\n");
1328
- if (parsed.information === "command") {
1329
- await budget.output("command line:\n");
1330
- let redactNext = false;
1331
- for (const argument of parsed.command ?? []) {
1332
- const value = zipPublicText(redactNext ? "[redacted]" : argument);
1333
- redactNext = zipPasswordArgument(argument) === "separate";
1334
- const escaped = escapeText(value, "display", size => { if (size > limits.maxTextBytes - budget.textBytes)
1335
- fail("text output limit exceeded"); }).split("'").join("'\\''");
1336
- await budget.output(`'${escaped}' `);
1337
- }
1338
- await budget.output("\n\nzip error: Interrupted (show command line)\n");
1339
- return { exitCode: 9 };
1340
- }
1341
- if (parsed.information === "options") {
1342
- await budget.output("available options:\nVirtual implementation; unsupported native options are omitted.\n sh long val neg\n");
1343
- for (const [name, short] of Object.entries(zipLongOptions)) {
1344
- const value = ["i", "x"].includes(short) ? "list" : ["s", "P", "n", "Z", "t", "tt", "O", "ds", "b", "lf", "TT"].includes(short) ? "req" : "";
1345
- await budget.output(` ${(short === "version" ? "" : short).padEnd(3)} ${name.padEnd(20)} ${value.padEnd(4)} ${zipNegatableOptions.has(short) ? "neg" : ""}\n`);
1346
- }
1347
- }
1348
- else
1349
- await budget.output(parsed.information === "more-help" ? zipExtendedHelp : parsed.information === "version" ? zipVersion : parsed.information === "license" ? zipLicense : zipHelp);
1350
- return { exitCode: 0 };
1351
- }
1352
- if (parsed.logPath !== undefined) {
1353
- log = new ZipLog(scope, parsed.logInfo);
1354
- await log.open(parsed.logPath, parsed.logAppend, [parsed.archive, parsed.output, ...(parsed.action === "copy" || parsed.action === "delete" ? [] : parsed.operands)].filter((path) => path !== undefined));
1355
- }
1356
- const quietDisplay = parsed.quiet;
1357
- if (log && quietDisplay)
1358
- parsed = { ...parsed, quiet: false };
1359
- const progressContext = log ? { ...context, stdout: log.sink(context.stdout, quietDisplay), stderr: log.sink(context.stderr, quietDisplay) } : context;
1360
- budget = new Budget(parsed.archive === "-" ? { ...progressContext, stdout: log ? log.sink(context.stderr, quietDisplay) : context.stderr } : progressContext, limits);
1361
- if (parsed.encrypt) {
1362
- if (parsed.password === undefined)
1363
- parsed.password = await scope.operation(() => readZipPassword(options.zipHost, limits.maxArgumentBytes, context.signal, true));
1364
- if (log)
1365
- log.password = parsed.password;
1366
- parsed.encryption = { ...(parsed.aes ? { aes: parsed.aes } : {}), password: parsed.password, entropy: (length, signal) => scope.operation(() => {
1367
- if (!options.zipHost?.entropy)
1368
- throw new ZipHostFailure("entropy");
1369
- return options.zipHost.entropy(length, signal);
1370
- }) };
1371
- }
1372
- if (parsed.debug)
1373
- await budget.output("sd: Command line read\nsd: Reading virtual archive and selecting files\n");
1374
- if (parsed.split && parsed.splitPause && !options.zipHost?.volumePrompt)
1375
- throw new ZipFailure(16, "Invalid command arguments", "split pause requires an explicit volume prompt capability");
1376
- const prepared = await prepare(scope, parsed, budget, log, options.zipHost);
1377
- if (!prepared)
1378
- return { exitCode: 12 };
1379
- if (prepared.kind === "current") {
1380
- await removeZipSources(scope, prepared.moves, budget, parsed.quiet);
1381
- return { exitCode: prepared.exitCode };
1382
- }
1383
- if (parsed.debug)
1384
- await budget.output("sd: Writing virtual archive\n");
1385
- let globalBytes = 0;
1386
- const dots = async (size) => {
1387
- if (!parsed.globalDots || !parsed.dotSize)
1388
- return;
1389
- if (!globalBytes)
1390
- await budget.output(" ");
1391
- const count = Math.floor((globalBytes + size) / parsed.dotSize) - Math.floor(globalBytes / parsed.dotSize);
1392
- globalBytes += size;
1393
- for (let index = 0; index < count; index++)
1394
- await budget.output(".");
1395
- };
1396
- if (prepared.kind === "file") {
1397
- const publication = prepared.publication;
1398
- if (!publication)
1399
- fail("ZIP missing file publication");
1400
- await dots(prepared.bytes.length);
1401
- const split = parsed.split ?? prepared.inputSplit;
1402
- if (split) {
1403
- if (parsed.splitPause && !options.zipHost?.volumePrompt)
1404
- throw new ZipFailure(16, "Invalid command arguments", "split pause requires an explicit volume prompt capability");
1405
- const parts = await splitZipVolumes(prepared.bytes, split, limits, context.signal);
1406
- await log?.protect(parts.map((_, disk) => volumeName(publication.output, disk, parts.length)));
1407
- await log?.start();
1408
- if (prepared.testRequired) {
1409
- await scope.operation(() => stageZip(scope, { ...publication, bytes: prepared.bytes, reservedPath: publication.output }, staging => testZipCommand(scope, parsed.testCommand, staging.file.path, budget, parsed.archive, parsed.quiet, parsed.password)));
1410
- }
1411
- await scope.operation(() => publishZipVolumes(scope, publication, parts, prepared.inputPaths, async (path, disk) => {
1412
- if (parsed.splitVerbose)
1413
- await budget.output(`split ${disk + 1}/${parts.length}: ${zipPublicText(path)} (${parts[disk].length} bytes)\n`);
1414
- if (disk && parsed.splitPause) {
1415
- if (parsed.splitBell)
1416
- await budget.output("\u0007");
1417
- if (!await scope.operation(() => options.zipHost.volumePrompt({ path, disk, disks: parts.length, signal: context.signal })))
1418
- fail("ZIP split volume prompt cancelled");
1419
- }
1420
- }));
1421
- }
1422
- else
1423
- await writeFileOutput(context, prepared.bytes, () => scope.operation(() => publishZip(scope, { ...publication, bytes: prepared.bytes, ...(prepared.testRequired ? { validate: (path) => testZipCommand(scope, parsed.testCommand, path, budget, parsed.archive, parsed.quiet, parsed.password) } : {}) })));
1424
- for (const message of prepared.progress)
1425
- await budget.output(message);
1426
- }
1427
- else if (prepared.kind === "staged-stream") {
1428
- const source = (async function* () {
1429
- for await (const chunk of streamZipArchive(prepared.archive, limits, context.signal, true, parsed.zip64 === true, parsed.zip64 !== false)) {
1430
- yield chunk;
1431
- try {
1432
- await dots(chunk.length);
1433
- }
1434
- catch (error) {
1435
- void scope.closeInputs().catch(() => { });
1436
- throw error;
1437
- }
1438
- }
1439
- prepared.finishProgress();
1440
- })();
1441
- await scope.operation(() => publishZip(scope, { ...prepared.publication, source }));
1442
- prepared.finishProgress();
1443
- for (const message of prepared.progress)
1444
- await budget.output(message);
1445
- }
1446
- else {
1447
- const output = createOutputOperation(context, context.stdout);
1448
- try {
1449
- const source = streamZipArchive(prepared.archive, limits, output.signal, !prepared.temporary || parsed.descriptors, parsed.zip64 === true, parsed.zip64 !== false);
1450
- const emit = async (input) => {
1451
- for await (const chunk of input) {
1452
- try {
1453
- await writeBytes(output.output, chunk, output.signal);
1454
- await dots(chunk.length);
1455
- }
1456
- catch (error) {
1457
- void scope.closeInputs().catch(() => { });
1458
- throw error;
1459
- }
1460
- }
1461
- };
1462
- if (prepared.temporary) {
1463
- const temporary = prepared.temporary;
1464
- await scope.operation(() => stageZip(scope, { ...temporary, source }, async (staging) => {
1465
- const current = await scope.operation(() => context.fs.realpath(temporary.name, { signal: context.signal }));
1466
- if (current !== temporary.parent)
1467
- fail("ZIP temporary path changed before output");
1468
- await emit(scope.input(staging.file.path));
1469
- }));
1470
- }
1471
- else
1472
- await emit(source);
1473
- }
1474
- finally {
1475
- await output.close();
1476
- }
1477
- prepared.finishProgress();
1478
- for (const message of prepared.progress)
1479
- await budget.output(message);
1480
- }
1481
- if (parsed.globalDots)
1482
- await budget.output("\n");
1483
- if (parsed.debug)
1484
- await budget.output("sd: Virtual archive complete\n");
1485
- await removeZipSources(scope, prepared.moves, budget, parsed.quiet);
1486
- return { exitCode: prepared.kind === "file" || prepared.kind === "staged-stream" ? prepared.exitCode : 0 };
1487
- }
1488
- catch (error) {
1489
- original.signal.throwIfAborted();
1490
- context.signal.throwIfAborted();
1491
- // Incomplete selection has not proved the log is disjoint from sources.
1492
- // Report to the screen rather than mutating an unvisited source file.
1493
- if (log && !log.started)
1494
- log.failed = true;
1495
- if (error instanceof ZipHostFailure && (error.code === "password-empty" || error.code === "password-confirm")) {
1496
- await budget.output(`\nzip error: Invalid command arguments (${error.message})\n`);
1497
- return { exitCode: 16 };
1498
- }
1499
- if (error instanceof ZipFailure) {
1500
- const diagnostic = `\nzip error: ${error.label} (${zipPublicText(error.message)})\n`;
1501
- if (log?.failed)
1502
- await writeBytes(context.stderr, encodeBytes(diagnostic).subarray(0, limits.maxDiagnosticBytes), context.signal);
1503
- else
1504
- await budget.output(diagnostic);
1505
- return { exitCode: error.status };
1506
- }
1507
- if (log?.failed)
1508
- budget = new Budget(context, limits);
1509
- const detail = display(publicDiagnosticMessage(error, context.onInternalError).slice(0, 1024));
1510
- const message = escapeText(error instanceof ZipHostFailure ? detail : zipPublicText(detail), "diagnostic");
1511
- await writeBytes(log && !log.failed ? log.sink(context.stderr) : context.stderr, encodeBytes(`zip: ${message}\n`).subarray(0, limits.maxDiagnosticBytes), context.signal);
1512
- return { exitCode: 2 };
1513
- }
1514
- finally {
1515
- try {
1516
- await scope.close();
1517
- }
1518
- finally {
1519
- original.signal.throwIfAborted();
1520
- }
1521
- }
1522
- } };
1523
- }
1
+ export * from "../../../safe-bash-command-zip/zip.js";
1524
2
  //# sourceMappingURL=zip.js.map