just-bash 3.4.0 → 3.4.2

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 (222) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bin/chunks/{awk2-DZN2ZRSE.js → awk2-C4A37H5N.js} +1 -1
  3. package/dist/bin/{shell/chunks/base64-TP4NUOEB.js → chunks/base64-FLJ4YPHB.js} +1 -1
  4. package/dist/bin/chunks/{cat-A3REFE6L.js → cat-2J5MA5PY.js} +1 -1
  5. package/dist/bin/{shell/chunks/chmod-PHPDPTZD.js → chunks/chmod-ZM5WLMZI.js} +1 -1
  6. package/dist/bin/chunks/{chunk-ODPB5AH7.js → chunk-2HFDEZUY.js} +1 -1
  7. package/dist/bin/chunks/{chunk-DX5LO7JF.js → chunk-2INNLNI5.js} +1 -1
  8. package/dist/bin/chunks/{chunk-57BWX3A3.js → chunk-2ND6MMXN.js} +1 -1
  9. package/dist/bin/chunks/{chunk-QUWWWM4E.js → chunk-2ORJ5HTY.js} +1 -1
  10. package/dist/bin/chunks/{chunk-SOKKZSUV.js → chunk-3SCW7PD5.js} +1 -1
  11. package/dist/bin/chunks/{chunk-TKBTWIXO.js → chunk-42AMF6EE.js} +1 -1
  12. package/dist/bin/{shell/chunks/chunk-NFYXRUSI.js → chunks/chunk-44MQ5AXA.js} +1 -1
  13. package/dist/bin/chunks/{chunk-GE5ERIO2.js → chunk-4APSDE57.js} +1 -1
  14. package/dist/bin/chunks/{chunk-ODCVIRIN.js → chunk-74TZ7ZF7.js} +1 -1
  15. package/dist/bin/chunks/{chunk-OD2SHTFL.js → chunk-7WBCA2BB.js} +1 -1
  16. package/dist/bin/{shell/chunks/chunk-MOCKUJD6.js → chunks/chunk-APV27ZZW.js} +1 -1
  17. package/dist/bin/{shell/chunks/chunk-YB3A42T5.js → chunks/chunk-BCQSUELK.js} +1 -1
  18. package/dist/bin/chunks/{chunk-FC5CC5UP.js → chunk-BJRT4VKD.js} +1 -1
  19. package/dist/bin/chunks/{chunk-6WNZWDBA.js → chunk-BOYPCOSV.js} +1 -1
  20. package/dist/bin/chunks/{chunk-KHS7PCAP.js → chunk-BZWGVRFA.js} +2 -2
  21. package/dist/bin/chunks/{chunk-BPMGKB5E.js → chunk-EXGPMLIE.js} +1 -1
  22. package/dist/bin/{shell/chunks/chunk-MLJZPRDV.js → chunks/chunk-FB44CW33.js} +1 -1
  23. package/dist/bin/chunks/{chunk-35BSNGJK.js → chunk-GRP7L2EL.js} +1 -1
  24. package/dist/bin/{shell/chunks/chunk-3DCUOX7D.js → chunks/chunk-GTULZ3ZD.js} +1 -1
  25. package/dist/bin/{shell/chunks/chunk-O5R7J45W.js → chunks/chunk-HL7NFZVQ.js} +1 -1
  26. package/dist/bin/chunks/chunk-HWI42GQO.js +7 -0
  27. package/dist/bin/{shell/chunks/chunk-TY77F4UM.js → chunks/chunk-ISOWCECJ.js} +1 -1
  28. package/dist/bin/chunks/{chunk-TIYIKCEZ.js → chunk-JQM3DKCH.js} +1 -1
  29. package/dist/bin/{shell/chunks/chunk-NWBQ75GZ.js → chunks/chunk-MF3GVFLC.js} +1 -1
  30. package/dist/bin/chunks/{chunk-6KTOOQK6.js → chunk-MHAGHCSO.js} +1 -1
  31. package/dist/bin/{shell/chunks/chunk-62NF3462.js → chunks/chunk-MNSMZU47.js} +1 -1
  32. package/dist/bin/chunks/{chunk-GGPUS2B4.js → chunk-MRPJL3ZK.js} +1 -1
  33. package/dist/bin/{shell/chunks/chunk-IHS3YLRI.js → chunks/chunk-MYEPQX6Y.js} +1 -1
  34. package/dist/bin/chunks/{chunk-EJIZDPMG.js → chunk-PPVF2N6C.js} +1 -1
  35. package/dist/bin/{shell/chunks/chunk-7NMBLWZ5.js → chunks/chunk-QFTZKD5O.js} +1 -1
  36. package/dist/bin/chunks/{chunk-YABXNPH6.js → chunk-TIHFGNPS.js} +1 -1
  37. package/dist/bin/chunks/{chunk-YBTJPT3R.js → chunk-UHNV55NF.js} +1 -1
  38. package/dist/bin/{shell/chunks/chunk-XG7YUZ3R.js → chunks/chunk-UNKX6YM6.js} +1 -1
  39. package/dist/bin/{shell/chunks/chunk-BXDEO6VY.js → chunks/chunk-VKTV45AP.js} +1 -1
  40. package/dist/bin/{shell/chunks/expr-FAB3XEIB.js → chunks/expr-TDF3B6QJ.js} +1 -1
  41. package/dist/bin/{shell/chunks/file-ZHL2YACR.js → chunks/file-AJGG7RYT.js} +1 -1
  42. package/dist/bin/chunks/{flag-coverage-SPPGTKG3.js → flag-coverage-DOLZIUQ7.js} +1 -1
  43. package/dist/bin/{shell/chunks/grep-FBVRTH4M.js → chunks/grep-WUZMZDGY.js} +1 -1
  44. package/dist/bin/chunks/{gzip-AWQGRTSF.js → gzip-JA7JQBUS.js} +1 -1
  45. package/dist/bin/chunks/{head-A7CPWX7R.js → head-YGKW3HS4.js} +1 -1
  46. package/dist/bin/{shell/chunks/html-to-markdown-EMODJ24M.js → chunks/html-to-markdown-ZWL7LZIP.js} +1 -1
  47. package/dist/bin/chunks/{jq-DXL4NMI5.js → jq-5MI4V3G5.js} +1 -1
  48. package/dist/bin/chunks/{js-exec-BFLXGNPQ.js → js-exec-DJQLXWCS.js} +1 -1
  49. package/dist/bin/chunks/js-exec-worker.js +60 -4
  50. package/dist/bin/{shell/chunks/od-ZPR6FUOW.js → chunks/od-YCY27MMO.js} +1 -1
  51. package/dist/bin/{shell/chunks/paste-RQKXCKQO.js → chunks/paste-ACKOG3XS.js} +1 -1
  52. package/dist/bin/{shell/chunks/python3-WKVKCO33.js → chunks/python3-JCJHSX4Z.js} +1 -1
  53. package/dist/bin/chunks/{rg-34TWIR7N.js → rg-A3E7YM2A.js} +1 -1
  54. package/dist/bin/{shell/chunks/sed-SW74NKGU.js → chunks/sed-KJWKB22J.js} +1 -1
  55. package/dist/bin/chunks/{sleep-J2AVORMB.js → sleep-DVFE2GSF.js} +1 -1
  56. package/dist/bin/chunks/{split-EDDYGW4A.js → split-XMXBXL5Q.js} +1 -1
  57. package/dist/bin/chunks/{sqlite3-AZ27WWV7.js → sqlite3-DNH2VLVN.js} +1 -1
  58. package/dist/bin/chunks/sqlite3-worker.js +60 -4
  59. package/dist/bin/{shell/chunks/stat-XNGV2W6W.js → chunks/stat-5PUSTPTK.js} +1 -1
  60. package/dist/bin/chunks/{tail-H2WOZSEI.js → tail-4MB7HHIZ.js} +1 -1
  61. package/dist/bin/chunks/{tar-MZP7QXR4.js → tar-FRDUJZDN.js} +1 -1
  62. package/dist/bin/{shell/chunks/timeout-GH6S72QX.js → chunks/timeout-YGFHQJKX.js} +1 -1
  63. package/dist/bin/chunks/{tr-RVCBERJ4.js → tr-Z6N34HZM.js} +1 -1
  64. package/dist/bin/chunks/worker.js +60 -4
  65. package/dist/bin/chunks/{xan-BSNJF6SH.js → xan-VSF6ZQGZ.js} +1 -1
  66. package/dist/bin/chunks/{xan-view-H3LNQ72O.js → xan-view-UEFBHYVN.js} +1 -1
  67. package/dist/bin/chunks/{yq-GNMXK6OP.js → yq-K5N5JD4N.js} +1 -1
  68. package/dist/bin/just-bash.js +1 -1
  69. package/dist/bin/shell/chunks/{awk2-DZN2ZRSE.js → awk2-C4A37H5N.js} +1 -1
  70. package/dist/bin/{chunks/base64-TP4NUOEB.js → shell/chunks/base64-FLJ4YPHB.js} +1 -1
  71. package/dist/bin/shell/chunks/{cat-A3REFE6L.js → cat-2J5MA5PY.js} +1 -1
  72. package/dist/bin/{chunks/chmod-PHPDPTZD.js → shell/chunks/chmod-ZM5WLMZI.js} +1 -1
  73. package/dist/bin/shell/chunks/{chunk-ODPB5AH7.js → chunk-2HFDEZUY.js} +1 -1
  74. package/dist/bin/shell/chunks/{chunk-DX5LO7JF.js → chunk-2INNLNI5.js} +1 -1
  75. package/dist/bin/shell/chunks/{chunk-57BWX3A3.js → chunk-2ND6MMXN.js} +1 -1
  76. package/dist/bin/shell/chunks/{chunk-QUWWWM4E.js → chunk-2ORJ5HTY.js} +1 -1
  77. package/dist/bin/shell/chunks/{chunk-SOKKZSUV.js → chunk-3SCW7PD5.js} +1 -1
  78. package/dist/bin/shell/chunks/{chunk-TKBTWIXO.js → chunk-42AMF6EE.js} +1 -1
  79. package/dist/bin/{chunks/chunk-NFYXRUSI.js → shell/chunks/chunk-44MQ5AXA.js} +1 -1
  80. package/dist/bin/shell/chunks/{chunk-GE5ERIO2.js → chunk-4APSDE57.js} +1 -1
  81. package/dist/bin/shell/chunks/{chunk-ODCVIRIN.js → chunk-74TZ7ZF7.js} +1 -1
  82. package/dist/bin/shell/chunks/{chunk-OD2SHTFL.js → chunk-7WBCA2BB.js} +1 -1
  83. package/dist/bin/{chunks/chunk-MOCKUJD6.js → shell/chunks/chunk-APV27ZZW.js} +1 -1
  84. package/dist/bin/{chunks/chunk-YB3A42T5.js → shell/chunks/chunk-BCQSUELK.js} +1 -1
  85. package/dist/bin/shell/chunks/{chunk-FC5CC5UP.js → chunk-BJRT4VKD.js} +1 -1
  86. package/dist/bin/shell/chunks/{chunk-6WNZWDBA.js → chunk-BOYPCOSV.js} +1 -1
  87. package/dist/bin/shell/chunks/{chunk-KHS7PCAP.js → chunk-BZWGVRFA.js} +2 -2
  88. package/dist/bin/shell/chunks/{chunk-BPMGKB5E.js → chunk-EXGPMLIE.js} +1 -1
  89. package/dist/bin/{chunks/chunk-MLJZPRDV.js → shell/chunks/chunk-FB44CW33.js} +1 -1
  90. package/dist/bin/shell/chunks/{chunk-35BSNGJK.js → chunk-GRP7L2EL.js} +1 -1
  91. package/dist/bin/{chunks/chunk-3DCUOX7D.js → shell/chunks/chunk-GTULZ3ZD.js} +1 -1
  92. package/dist/bin/{chunks/chunk-O5R7J45W.js → shell/chunks/chunk-HL7NFZVQ.js} +1 -1
  93. package/dist/bin/shell/chunks/chunk-HWI42GQO.js +7 -0
  94. package/dist/bin/{chunks/chunk-TY77F4UM.js → shell/chunks/chunk-ISOWCECJ.js} +1 -1
  95. package/dist/bin/shell/chunks/{chunk-TIYIKCEZ.js → chunk-JQM3DKCH.js} +1 -1
  96. package/dist/bin/{chunks/chunk-NWBQ75GZ.js → shell/chunks/chunk-MF3GVFLC.js} +1 -1
  97. package/dist/bin/shell/chunks/{chunk-6KTOOQK6.js → chunk-MHAGHCSO.js} +1 -1
  98. package/dist/bin/{chunks/chunk-62NF3462.js → shell/chunks/chunk-MNSMZU47.js} +1 -1
  99. package/dist/bin/shell/chunks/{chunk-GGPUS2B4.js → chunk-MRPJL3ZK.js} +1 -1
  100. package/dist/bin/{chunks/chunk-IHS3YLRI.js → shell/chunks/chunk-MYEPQX6Y.js} +1 -1
  101. package/dist/bin/shell/chunks/{chunk-EJIZDPMG.js → chunk-PPVF2N6C.js} +1 -1
  102. package/dist/bin/{chunks/chunk-7NMBLWZ5.js → shell/chunks/chunk-QFTZKD5O.js} +1 -1
  103. package/dist/bin/shell/chunks/{chunk-YABXNPH6.js → chunk-TIHFGNPS.js} +1 -1
  104. package/dist/bin/shell/chunks/{chunk-YBTJPT3R.js → chunk-UHNV55NF.js} +1 -1
  105. package/dist/bin/{chunks/chunk-XG7YUZ3R.js → shell/chunks/chunk-UNKX6YM6.js} +1 -1
  106. package/dist/bin/{chunks/chunk-BXDEO6VY.js → shell/chunks/chunk-VKTV45AP.js} +1 -1
  107. package/dist/bin/{chunks/expr-FAB3XEIB.js → shell/chunks/expr-TDF3B6QJ.js} +1 -1
  108. package/dist/bin/{chunks/file-ZHL2YACR.js → shell/chunks/file-AJGG7RYT.js} +1 -1
  109. package/dist/bin/shell/chunks/{flag-coverage-SPPGTKG3.js → flag-coverage-DOLZIUQ7.js} +1 -1
  110. package/dist/bin/{chunks/grep-FBVRTH4M.js → shell/chunks/grep-WUZMZDGY.js} +1 -1
  111. package/dist/bin/shell/chunks/{gzip-AWQGRTSF.js → gzip-JA7JQBUS.js} +1 -1
  112. package/dist/bin/shell/chunks/{head-A7CPWX7R.js → head-YGKW3HS4.js} +1 -1
  113. package/dist/bin/{chunks/html-to-markdown-EMODJ24M.js → shell/chunks/html-to-markdown-ZWL7LZIP.js} +1 -1
  114. package/dist/bin/shell/chunks/{jq-DXL4NMI5.js → jq-5MI4V3G5.js} +1 -1
  115. package/dist/bin/shell/chunks/{js-exec-BFLXGNPQ.js → js-exec-DJQLXWCS.js} +1 -1
  116. package/dist/bin/{chunks/od-ZPR6FUOW.js → shell/chunks/od-YCY27MMO.js} +1 -1
  117. package/dist/bin/{chunks/paste-RQKXCKQO.js → shell/chunks/paste-ACKOG3XS.js} +1 -1
  118. package/dist/bin/{chunks/python3-WKVKCO33.js → shell/chunks/python3-JCJHSX4Z.js} +1 -1
  119. package/dist/bin/shell/chunks/{rg-34TWIR7N.js → rg-A3E7YM2A.js} +1 -1
  120. package/dist/bin/{chunks/sed-SW74NKGU.js → shell/chunks/sed-KJWKB22J.js} +1 -1
  121. package/dist/bin/shell/chunks/{sleep-J2AVORMB.js → sleep-DVFE2GSF.js} +1 -1
  122. package/dist/bin/shell/chunks/{split-EDDYGW4A.js → split-XMXBXL5Q.js} +1 -1
  123. package/dist/bin/shell/chunks/{sqlite3-AZ27WWV7.js → sqlite3-DNH2VLVN.js} +1 -1
  124. package/dist/bin/{chunks/stat-XNGV2W6W.js → shell/chunks/stat-5PUSTPTK.js} +1 -1
  125. package/dist/bin/shell/chunks/{tail-H2WOZSEI.js → tail-4MB7HHIZ.js} +1 -1
  126. package/dist/bin/shell/chunks/{tar-MZP7QXR4.js → tar-FRDUJZDN.js} +1 -1
  127. package/dist/bin/{chunks/timeout-GH6S72QX.js → shell/chunks/timeout-YGFHQJKX.js} +1 -1
  128. package/dist/bin/shell/chunks/{tr-RVCBERJ4.js → tr-Z6N34HZM.js} +1 -1
  129. package/dist/bin/shell/chunks/{xan-BSNJF6SH.js → xan-VSF6ZQGZ.js} +1 -1
  130. package/dist/bin/shell/chunks/{xan-view-H3LNQ72O.js → xan-view-UEFBHYVN.js} +1 -1
  131. package/dist/bin/shell/chunks/{yq-GNMXK6OP.js → yq-K5N5JD4N.js} +1 -1
  132. package/dist/bin/shell/shell.js +1 -1
  133. package/dist/bundle/browser.js +446 -444
  134. package/dist/bundle/chunks/{awk2-IDCJYLV2.js → awk2-NPLZQ3K7.js} +1 -1
  135. package/dist/bundle/chunks/{base64-3XQZ3ADB.js → base64-2BAITDZF.js} +1 -1
  136. package/dist/bundle/chunks/{cat-XWS72C47.js → cat-33KGN4MZ.js} +1 -1
  137. package/dist/bundle/chunks/{chmod-6FVWFWKL.js → chmod-APOXUPXW.js} +1 -1
  138. package/dist/bundle/chunks/{chunk-JQL34RLH.js → chunk-3CBCABOZ.js} +1 -1
  139. package/dist/bundle/chunks/{chunk-EZFSCUSP.js → chunk-5ELNHAAJ.js} +1 -1
  140. package/dist/bundle/chunks/{chunk-M7DIEMEN.js → chunk-6DTD75TR.js} +1 -1
  141. package/dist/bundle/chunks/{chunk-5GI2HJYO.js → chunk-6KK46B7Q.js} +1 -1
  142. package/dist/bundle/chunks/{chunk-264HW33U.js → chunk-7IFSXTCJ.js} +1 -1
  143. package/dist/bundle/chunks/{chunk-4MPKG4PJ.js → chunk-A3D7NRT6.js} +1 -1
  144. package/dist/bundle/chunks/{chunk-EVJMYTCY.js → chunk-ALOFNPKY.js} +2 -2
  145. package/dist/bundle/chunks/{chunk-QKQP2SCP.js → chunk-BKUWXPEM.js} +1 -1
  146. package/dist/bundle/chunks/{chunk-W4IV5QW4.js → chunk-CFBEDNHJ.js} +1 -1
  147. package/dist/bundle/chunks/{chunk-CVMQI27W.js → chunk-DMWNBCXJ.js} +1 -1
  148. package/dist/bundle/chunks/{chunk-VQCA62JK.js → chunk-FNEG7DFQ.js} +1 -1
  149. package/dist/bundle/chunks/{chunk-ENMIHC6G.js → chunk-GVKYQN5J.js} +1 -1
  150. package/dist/bundle/chunks/{chunk-QNXJ5FEA.js → chunk-ICQYTW7W.js} +1 -1
  151. package/dist/bundle/chunks/{chunk-4X2R47I5.js → chunk-JA6EY7US.js} +1 -1
  152. package/dist/bundle/chunks/{chunk-XJWBSZIU.js → chunk-MHY57JTL.js} +1 -1
  153. package/dist/bundle/chunks/{chunk-XZZSXYTK.js → chunk-N3A4JVFJ.js} +1 -1
  154. package/dist/bundle/chunks/{chunk-HZYCWAEC.js → chunk-N3FZSEG7.js} +1 -1
  155. package/dist/bundle/chunks/{chunk-MP3NNO6W.js → chunk-Q6JV5CBB.js} +1 -1
  156. package/dist/bundle/chunks/{chunk-2TLWENMK.js → chunk-QE275OWT.js} +1 -1
  157. package/dist/bundle/chunks/{chunk-GP3D65AC.js → chunk-QPZVR6ZN.js} +1 -1
  158. package/dist/bundle/chunks/{chunk-CA7HMEGG.js → chunk-SI5VPVOA.js} +1 -1
  159. package/dist/bundle/chunks/{chunk-LDCENVG4.js → chunk-TVJ6JVK4.js} +1 -1
  160. package/dist/bundle/chunks/{chunk-UGU4ZDZA.js → chunk-UL6YJ7FT.js} +1 -1
  161. package/dist/bundle/chunks/{chunk-CYCUGNN7.js → chunk-USNDURQI.js} +1 -1
  162. package/dist/bundle/chunks/{chunk-VPJHPG6G.js → chunk-UXHSH7BM.js} +1 -1
  163. package/dist/bundle/chunks/{chunk-6D2ZCRTO.js → chunk-V2SOLEQN.js} +1 -1
  164. package/dist/bundle/chunks/{chunk-QXYDKHGI.js → chunk-WXPNKIIH.js} +1 -1
  165. package/dist/bundle/chunks/{chunk-XW6UBSKO.js → chunk-X3TZEFQG.js} +1 -1
  166. package/dist/bundle/chunks/{chunk-73DVPW3C.js → chunk-XMMV24SP.js} +1 -1
  167. package/dist/bundle/chunks/{chunk-FFNWVPYL.js → chunk-XPDOK3XY.js} +1 -1
  168. package/dist/bundle/chunks/{chunk-MMSRUX6V.js → chunk-XV2V56NQ.js} +1 -1
  169. package/dist/bundle/chunks/{chunk-XOBSBDA5.js → chunk-YDR2IWKO.js} +1 -1
  170. package/dist/bundle/chunks/{chunk-KESUKNUF.js → chunk-YJKHREBZ.js} +1 -1
  171. package/dist/bundle/chunks/chunk-ZBUZKIPX.js +6 -0
  172. package/dist/bundle/chunks/{expr-VKQHAJNO.js → expr-UMT2OHZ7.js} +1 -1
  173. package/dist/bundle/chunks/{file-WGI2QYXG.js → file-VEGKTTSF.js} +1 -1
  174. package/dist/bundle/chunks/{flag-coverage-6LWPOTGE.js → flag-coverage-I6UJUKQ4.js} +1 -1
  175. package/dist/bundle/chunks/{grep-SAEHL7UZ.js → grep-5UPEO42U.js} +1 -1
  176. package/dist/bundle/chunks/{gzip-2SHFSHNB.js → gzip-ZINVK3M6.js} +1 -1
  177. package/dist/bundle/chunks/{head-RMKV5HCV.js → head-CFENJILH.js} +1 -1
  178. package/dist/bundle/chunks/{html-to-markdown-GEKF6U7Z.js → html-to-markdown-GGVR4YGL.js} +1 -1
  179. package/dist/bundle/chunks/{jq-MW2VEOCW.js → jq-X2P7Q64K.js} +1 -1
  180. package/dist/bundle/chunks/{js-exec-J4DLDAWY.js → js-exec-XKF2B7C3.js} +1 -1
  181. package/dist/bundle/chunks/js-exec-worker.js +60 -4
  182. package/dist/bundle/chunks/{od-26HTHXXM.js → od-BI6XJPXY.js} +1 -1
  183. package/dist/bundle/chunks/{paste-WIDT5N6N.js → paste-LLZ3ZQR2.js} +1 -1
  184. package/dist/bundle/chunks/{python3-4Q7M5CDT.js → python3-F5S5TYGS.js} +1 -1
  185. package/dist/bundle/chunks/{rg-IA4UE2UF.js → rg-UQE6KUBP.js} +1 -1
  186. package/dist/bundle/chunks/{sed-LSWWSQ6J.js → sed-JW2JDLSI.js} +1 -1
  187. package/dist/bundle/chunks/{sleep-YMKR4HFQ.js → sleep-PPRBTSVR.js} +1 -1
  188. package/dist/bundle/chunks/{split-EATPU6Q7.js → split-2SD6EP72.js} +1 -1
  189. package/dist/bundle/chunks/{sqlite3-XXXHFJGP.js → sqlite3-UVVRYDAL.js} +1 -1
  190. package/dist/bundle/chunks/sqlite3-worker.js +60 -4
  191. package/dist/bundle/chunks/{stat-AKB6X3TV.js → stat-6KILP5AL.js} +1 -1
  192. package/dist/bundle/chunks/{tail-OEM7DTYC.js → tail-BDNMS4FR.js} +1 -1
  193. package/dist/bundle/chunks/{tar-26DH77YN.js → tar-6365WH6H.js} +1 -1
  194. package/dist/bundle/chunks/{timeout-FOKHN3GQ.js → timeout-C6WDYPLV.js} +1 -1
  195. package/dist/bundle/chunks/{tr-VUNRKFC3.js → tr-3I4MDKIF.js} +1 -1
  196. package/dist/bundle/chunks/worker.js +60 -4
  197. package/dist/bundle/chunks/{xan-LUEGYXLV.js → xan-HUOXKUQA.js} +1 -1
  198. package/dist/bundle/chunks/{xan-view-MDMZTFFI.js → xan-view-RT2WKDOQ.js} +1 -1
  199. package/dist/bundle/chunks/{yq-B7E6UX7Y.js → yq-MI27NZ2U.js} +1 -1
  200. package/dist/bundle/index.cjs +874 -872
  201. package/dist/bundle/index.js +1 -1
  202. package/dist/commands/sqlite3/worker.js +60 -4
  203. package/dist/security/blocked-globals.d.ts +60 -0
  204. package/dist/security/defense-context.d.ts +13 -0
  205. package/dist/security/defense-in-depth-box.d.ts +354 -0
  206. package/dist/security/index.d.ts +33 -0
  207. package/dist/security/safe-timestamp.d.ts +1 -0
  208. package/dist/security/security-violation-logger.d.ts +99 -0
  209. package/dist/security/trusted-globals.d.ts +17 -0
  210. package/dist/security/types.d.ts +151 -0
  211. package/dist/security/violation-error-message.d.ts +3 -0
  212. package/dist/security/wasm-callback.d.ts +6 -0
  213. package/dist/security/worker-defense-in-depth.d.ts +228 -0
  214. package/dist/transform/pipeline.d.ts +8 -0
  215. package/dist/transform/plugins/command-collector.d.ts +15 -0
  216. package/dist/transform/plugins/tee-plugin.d.ts +40 -0
  217. package/dist/transform/serialize.d.ts +4 -0
  218. package/dist/transform/types.d.ts +18 -0
  219. package/package.json +4 -2
  220. package/dist/bin/chunks/chunk-SHAOH2UJ.js +0 -5
  221. package/dist/bin/shell/chunks/chunk-SHAOH2UJ.js +0 -5
  222. package/dist/bundle/chunks/chunk-RT7ROXPF.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as Rt,b as Ot,c as it}from"./chunks/chunk-WNH3HOQA.js";import{a as Nr}from"./chunks/chunk-BRJERIF4.js";import{c as ei,e as ya}from"./chunks/chunk-KIGPB52X.js";import{a as $r,b as Cr,c as Yn,d as Jn}from"./chunks/chunk-QXYDKHGI.js";import{a as Vt}from"./chunks/chunk-J2OBOJ64.js";import{a as Js}from"./chunks/chunk-L2UW7DWF.js";import{a as Wt,b as Xe,c as nr}from"./chunks/chunk-DLL7UR66.js";import{a as tr,b as ma}from"./chunks/chunk-QKQP2SCP.js";import{a as ge}from"./chunks/chunk-KVG5FR5F.js";import{a as _t,b as Ce}from"./chunks/chunk-RT7ROXPF.js";import"./chunks/chunk-6D3WD6YU.js";import{c as Ft,d as Pn}from"./chunks/chunk-AH7VTVWU.js";import"./chunks/chunk-STHBFACM.js";import{a as W,b as Ct,c as z,d as xn,e as Bt,f as Nt,g as $n}from"./chunks/chunk-YUSFCOM7.js";import{a as kn,b as He,c as Qe,d as Te,e as We,f as Ve,g as G,h as ce,i as Ke,j as Lt,k as Rr,l as x,m as ze,n as Mt,o as Or,p as st}from"./chunks/chunk-EFORKKSH.js";import{a as B,b as er,c as cn,d as Vf,e as Tt,f as Xs,g as vn,h as zf,i as xt,j as Ys,k as Uf,l as jf}from"./chunks/chunk-GN6CQ3J4.js";import{a as wt}from"./chunks/chunk-FOCWZZDE.js";import{a as $t}from"./chunks/chunk-W5DWRFSU.js";import{a as Ks}from"./chunks/chunk-NCUTH6QL.js";var un=[{name:"echo",load:async()=>(await import("./chunks/echo-PLLZYM2L.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-XWS72C47.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-V42QCPHL.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-R5CQLZQM.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-WDDKK2P3.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-WZKAT6M5.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-W4DF6Z4T.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-JQ4GDKDD.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-FKTQRFYJ.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-XSJA2FNL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-VYDFOFNO.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-6FVWFWKL.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-76BPYV5F.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-IY6QKK2P.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-RMKV5HCV.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-OEM7DTYC.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-RUR7HE5O.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-AKB6X3TV.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-SAEHL7UZ.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-SAEHL7UZ.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-SAEHL7UZ.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-IA4UE2UF.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-LSWWSQ6J.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-IDCJYLV2.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-PV2NEQHF.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-OVOW532K.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-DTWKU2MC.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-RWPUW5FY.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-WIDT5N6N.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-VUNRKFC3.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-EPOS3MFH.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-RFXH2GNX.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-QJBPHRFJ.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-2BPPGGSM.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-YD5BWFH4.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-WTD7Q2EF.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-EATPU6Q7.js")).split},{name:"column",load:async()=>(await import("./chunks/column-LKMDIDCH.js")).column},{name:"join",load:async()=>(await import("./chunks/join-KQ4Z5OD4.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-OOWSWHRQ.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-PM3TD7V4.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-SJZQ5W65.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-Z2ZMOOW2.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-7OOL2MH6.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-PR3M44X6.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-VUUMB47B.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-VUUMB47B.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-T5TO5GWK.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-T5TO5GWK.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-3N762S3K.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-L7TJHOJT.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-QUBPEGGU.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-QUBPEGGU.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-KPIUNI6K.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-HIEWVHJ2.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-HIEWVHJ2.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-MW2VEOCW.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-3XQZ3ADB.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-CSARC7WF.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-FN2DXAEE.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-YMKR4HFQ.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-FOKHN3GQ.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-NERE2JJ2.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-5R2GKXC6.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-VKQHAJNO.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-JEDX55KS.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-BLPZJ6MP.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-VJZ4PHQ4.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-WGI2QYXG.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-GEKF6U7Z.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-QDDMBDU7.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-UWVKETYW.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-YXC4HBTR.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-CESD3CQR.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-KR6E7UIR.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-26HTHXXM.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-2SHFSHNB.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-2SHFSHNB.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-2SHFSHNB.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(un.push({name:"tar",load:async()=>(await import("./chunks/tar-26DH77YN.js")).tarCommand}),un.push({name:"yq",load:async()=>(await import("./chunks/yq-B7E6UX7Y.js")).yqCommand}),un.push({name:"xan",load:async()=>(await import("./chunks/xan-LUEGYXLV.js")).xanCommand}),un.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-XXXHFJGP.js")).sqlite3Command}));var Dr=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Dr.push({name:"python3",load:async()=>(await import("./chunks/python3-4Q7M5CDT.js")).python3Command}),Dr.push({name:"python",load:async()=>(await import("./chunks/python3-4Q7M5CDT.js")).pythonCommand}));var Ir=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ir.push({name:"js-exec",load:async()=>(await import("./chunks/js-exec-J4DLDAWY.js")).jsExecCommand}),Ir.push({name:"node",load:async()=>(await import("./chunks/js-exec-J4DLDAWY.js")).nodeStubCommand}));var wa=[{name:"curl",load:async()=>(await import("./chunks/curl-DEHFBW27.js")).curlCommand}],ga=new Map;function _r(e){return{name:e.name,async execute(t,n){let r=ga.get(e.name);if(r||(r=await Ce.runTrustedAsync(()=>e.load()),ga.set(e.name,r)),n.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:s}=await import("./chunks/flag-coverage-6LWPOTGE.js");s(n.coverage,e.name,t)}return r.execute(t,n)}}}function qf(){return un.map(e=>e.name)}function Gf(){return wa.map(e=>e.name)}function Ea(e){return(e?un.filter(n=>e.includes(n.name)):un).map(_r)}function ba(){return wa.map(_r)}function Zf(){return Dr.map(e=>e.name)}function Sa(){return Dr.map(_r)}function Hf(){return Ir.map(e=>e.name)}function Aa(){return Ir.map(_r)}var va=new WeakMap,ka=new WeakSet;function Tr(e){let t=va.get(e);return t===void 0&&(t=Object.freeze(Object.create(null)),va.set(e,t),ka.add(t)),t}function Pa(e){return ka.has(e)}var xa={maxSourceBytes:67108864,maxExecDepth:64,maxCallDepth:100,maxCommandCount:1e5,maxLoopIterations:1e5,maxAwkIterations:1e5,maxSedIterations:1e5,maxJqIterations:1e7,maxQueryTokens:1e5,maxQueryDepth:1e3,maxQueryElements:1e6,maxAwkParserTokens:1e5,maxAwkParserDepth:256,maxAwkParserOperations:1e6,maxCsvRows:1e6,maxCsvCells:1e7,maxWorkUnits:1e8,maxTraversalEntries:1e6,maxTraversalDepth:1e3,maxTraversalWork:1e6,maxLiveBytes:536870912,maxInputBytes:536870912,maxFileSystemBytes:1073741824,maxDatabaseBytes:1073741824,maxDatabaseResultBytes:268435456,maxArchiveBytes:1073741824,maxArchiveCompressedBytes:536870912,maxArchiveEntryBytes:536870912,maxArchiveEntries:1e6,maxWorkerMessageBytes:67108864,maxExecutionTimeMs:36e5,maxExtensionCleanupTimeMs:100,maxSqliteTimeoutMs:3e4,maxPythonTimeoutMs:3e4,maxJsTimeoutMs:3e4,maxGlobOperations:1e6,maxStringLength:67108864,maxArrayElements:1e6,maxHeredocSize:67108864,maxSubstitutionDepth:50,maxBraceExpansionResults:1e5,maxOutputSize:268435456,maxFileDescriptors:4096,maxSourceDepth:100},Qf={...xa,maxSourceBytes:8*1024*1024,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxExtensionCleanupTimeMs:25,maxGlobOperations:1e5,maxStringLength:10*1024*1024,maxArrayElements:1e5,maxHeredocSize:10*1024*1024,maxBraceExpansionResults:1e4,maxOutputSize:10*1024*1024,maxFileDescriptors:1024,maxQueryTokens:25e3,maxQueryDepth:256,maxQueryElements:1e5,maxAwkParserTokens:25e3,maxAwkParserDepth:128,maxAwkParserOperations:1e5,maxCsvRows:1e5,maxCsvCells:1e6,maxWorkUnits:1e5,maxTraversalEntries:1e5,maxTraversalDepth:256,maxTraversalWork:1e5,maxLiveBytes:64*1024*1024,maxInputBytes:32*1024*1024,maxFileSystemBytes:128*1024*1024,maxDatabaseBytes:64*1024*1024,maxDatabaseResultBytes:16*1024*1024,maxArchiveBytes:128*1024*1024,maxArchiveCompressedBytes:64*1024*1024,maxArchiveEntryBytes:64*1024*1024,maxArchiveEntries:1e5,maxWorkerMessageBytes:16*1024*1024,maxExecutionTimeMs:3e4};function Lr(e,t="normal"){if(t!=="normal"&&t!=="hardened")throw new RangeError('executionLimitProfile must be "normal" or "hardened"');let n=t==="hardened"?Qf:xa;if(!e)return{...n};let r={maxSourceBytes:e.maxSourceBytes??n.maxSourceBytes,maxExecDepth:e.maxExecDepth??n.maxExecDepth,maxCallDepth:e.maxCallDepth??n.maxCallDepth,maxCommandCount:e.maxCommandCount??n.maxCommandCount,maxLoopIterations:e.maxLoopIterations??n.maxLoopIterations,maxAwkIterations:e.maxAwkIterations??n.maxAwkIterations,maxSedIterations:e.maxSedIterations??n.maxSedIterations,maxJqIterations:e.maxJqIterations??n.maxJqIterations,maxQueryTokens:e.maxQueryTokens??n.maxQueryTokens,maxQueryDepth:e.maxQueryDepth??n.maxQueryDepth,maxQueryElements:e.maxQueryElements??n.maxQueryElements,maxAwkParserTokens:e.maxAwkParserTokens??n.maxAwkParserTokens,maxAwkParserDepth:e.maxAwkParserDepth??n.maxAwkParserDepth,maxAwkParserOperations:e.maxAwkParserOperations??n.maxAwkParserOperations,maxCsvRows:e.maxCsvRows??n.maxCsvRows,maxCsvCells:e.maxCsvCells??n.maxCsvCells,maxWorkUnits:e.maxWorkUnits??n.maxWorkUnits,maxTraversalEntries:e.maxTraversalEntries??n.maxTraversalEntries,maxTraversalDepth:e.maxTraversalDepth??n.maxTraversalDepth,maxTraversalWork:e.maxTraversalWork??n.maxTraversalWork,maxLiveBytes:e.maxLiveBytes??n.maxLiveBytes,maxInputBytes:e.maxInputBytes??n.maxInputBytes,maxFileSystemBytes:e.maxFileSystemBytes??n.maxFileSystemBytes,maxDatabaseBytes:e.maxDatabaseBytes??n.maxDatabaseBytes,maxDatabaseResultBytes:e.maxDatabaseResultBytes??n.maxDatabaseResultBytes,maxArchiveBytes:e.maxArchiveBytes??n.maxArchiveBytes,maxArchiveCompressedBytes:e.maxArchiveCompressedBytes??n.maxArchiveCompressedBytes,maxArchiveEntryBytes:e.maxArchiveEntryBytes??n.maxArchiveEntryBytes,maxArchiveEntries:e.maxArchiveEntries??n.maxArchiveEntries,maxWorkerMessageBytes:e.maxWorkerMessageBytes??n.maxWorkerMessageBytes,maxExecutionTimeMs:e.maxExecutionTimeMs??n.maxExecutionTimeMs,maxExtensionCleanupTimeMs:e.maxExtensionCleanupTimeMs??n.maxExtensionCleanupTimeMs,maxSqliteTimeoutMs:e.maxSqliteTimeoutMs??n.maxSqliteTimeoutMs,maxPythonTimeoutMs:e.maxPythonTimeoutMs??n.maxPythonTimeoutMs,maxJsTimeoutMs:e.maxJsTimeoutMs??n.maxJsTimeoutMs,maxGlobOperations:e.maxGlobOperations??n.maxGlobOperations,maxStringLength:e.maxStringLength??n.maxStringLength,maxArrayElements:e.maxArrayElements??n.maxArrayElements,maxHeredocSize:e.maxHeredocSize??n.maxHeredocSize,maxSubstitutionDepth:e.maxSubstitutionDepth??n.maxSubstitutionDepth,maxBraceExpansionResults:e.maxBraceExpansionResults??n.maxBraceExpansionResults,maxOutputSize:e.maxOutputSize??n.maxOutputSize,maxFileDescriptors:e.maxFileDescriptors??n.maxFileDescriptors,maxSourceDepth:e.maxSourceDepth??n.maxSourceDepth};for(let s of Object.keys(r)){let i=r[s];if(i!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(i)||i<0))throw new RangeError(`${s} must be a non-negative safe integer or positive Infinity`)}return r}function Kf(e){let{executionLimits:t,executionLimitProfile:n,fs:r,stdin:s=Xs,...i}=e;return{fs:r,fsIdentity:i.fsIdentity??Tr(r),cwd:"/",env:new Map,stdin:s,limits:Lr(t,n),...i}}function $a(e){return"load"in e&&typeof e.load=="function"}function Xf(e,t,n={}){return{name:e,trusted:n.trusted!==!1,execute:t}}function Ca(e){let t=null,n=null;return{name:e.name,trusted:e.trusted!==!1,async execute(r,s){if(!t){let o=n;o||(o=e.load().then(a=>(t=a,a)),n=o);try{t=await o}catch(a){throw n===o&&(n=null),a}}let i=t;if(!i)throw new Error(`Failed to load command: ${e.name}`);return i.execute(r,s)}}}var Na=Object.freeze(Object.create(null)),Mr=class{limits;signal;commandCount=0;workUnits=0;liveBytes=0;inputBytes=0;outputBytes=0;countersByKind=new Map;bytesByKind=new Map;depthByKind=new Map;cleanupCallbacks=[];poisoned;closed=!1;startedAt=Date.now();get remainingLiveBytes(){return Math.max(0,this.limits.maxLiveBytes-this.liveBytes)}get outputBytesUsed(){return this.outputBytes}constructor(t,n=void 0){this.limits=t,this.signal=n}fail(t){throw this.poisoned??=t,this.poisoned}poisonAfterAbort(t){this.poisoned??=t}assertUsable(){if(this.poisoned)throw this.poisoned;if(this.closed)throw new Error("execution budget is already closed");this.throwIfAborted()}chargeCommand(){return this.consume("commands",1,"execution")}consumeWork(t=1,n="execution"){return this.consume("work",t,n)}consumeLimited(t,n,r,s=t){this.assertUsable();let i=this.countersByKind.get(t)??0;return(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(r)||r<0||n>r-i)&&this.fail(new x(`${s}: ${t} work limit exceeded (${r})`,"iterations")),n>this.limits.maxWorkUnits-this.workUnits&&this.fail(new x(`${s}: aggregate work limit exceeded (${this.limits.maxWorkUnits})`,"iterations")),this.countersByKind.set(t,i+n),this.workUnits+=n,i+n}consumeInput(t,n="execution"){return this.assertUsable(),(!Number.isSafeInteger(t)||t<0||t>this.limits.maxInputBytes-this.inputBytes)&&this.fail(new x(`${n}: aggregate input size limit exceeded (${this.limits.maxInputBytes} bytes)`,"string_length")),this.inputBytes+=t,this.inputBytes}consume(t,n=1,r=t){this.assertUsable();let s=this.countersByKind.get(t)??0,i=t==="commands"?this.commandCount:this.workUnits,o=t==="commands"?this.limits.maxCommandCount:this.limits.maxWorkUnits;(!Number.isSafeInteger(n)||n<0||n>o-i)&&this.fail(new x(t==="commands"?`too many commands executed (>${o}), increase executionLimits.maxCommandCount`:`${r}: ${t} work limit exceeded (${o})`,t==="commands"?"commands":"iterations"));let a=i+n;return t==="commands"?this.commandCount=a:this.workUnits=a,this.countersByKind.set(t,s+n),a}reserveBytes(t,n,r){this.assertUsable();let s=typeof t=="string"?t:"live",i=typeof t=="string"?n:t,o=typeof t=="string"?r??s:n??"execution";(!Number.isSafeInteger(i)||i<0||i>this.limits.maxLiveBytes-this.liveBytes)&&this.fail(new x(`${o}: live byte limit exceeded (${this.limits.maxLiveBytes} bytes)`,"string_length")),this.liveBytes+=i,this.bytesByKind.set(s,(this.bytesByKind.get(s)??0)+i);let a=!1;return{release:()=>{if(a)return;a=!0,this.liveBytes-=i;let l=(this.bytesByKind.get(s)??i)-i;l<=0?this.bytesByKind.delete(s):this.bytesByKind.set(s,l)}}}appendOutput(t,n,r="execution",s=0,i="text"){this.assertUsable();let o=i==="bytes"?n.length:B(n);(!Number.isSafeInteger(s)||s<0||s>o)&&this.fail(new x(`${r}: invalid ${t} accounting`,"output_size"));let a=o-s;return a>this.limits.maxOutputSize-this.outputBytes&&this.fail(new x(`${r}: total output size exceeded (>${this.limits.maxOutputSize} bytes), increase executionLimits.maxOutputSize`,"output_size")),this.outputBytes+=a,o}accountResult(t,n="execution",r=Number.POSITIVE_INFINITY){let s=t.internalOutputAccounting,i=Math.min(s?.stdout??0,r),o=Math.min(s?.stderr??0,Math.max(0,r-i)),a=this.appendOutput("stdout",t.stdout,n,i,t.stdoutKind==="bytes"||t.stdoutEncoding==="binary"?"bytes":"text"),l=this.appendOutput("stderr",t.stderr,n,o);return Object.isExtensible(t)?(t.internalOutputAccounting={stdout:a,stderr:l},t):a===0&&l===0?t:{...t,internalOutputAccounting:{stdout:a,stderr:l}}}relinquishOutput(t,n,r){this.assertUsable(),r!==Na&&this.fail(new x(`${n}: unauthorized output accounting release`,"output_size")),(!Number.isSafeInteger(t)||t<0||t>this.outputBytes)&&this.fail(new x(`${n}: invalid output accounting release`,"output_size")),this.outputBytes-=t}enterDepth(t,n=this.limits.maxCallDepth,r){this.assertUsable();let s=typeof n=="number"?n:this.limits.maxCallDepth,i=typeof n=="string"?n:r??t,o=this.depthByKind.get(t)??0;o>=s&&this.fail(new x(`${i}: maximum depth (${s}) exceeded`,"recursion")),this.depthByKind.set(t,o+1);let a=!1;return{release:()=>{if(a)return;a=!0;let l=(this.depthByKind.get(t)??1)-1;l<=0?this.depthByKind.delete(t):this.depthByKind.set(t,l)}}}throwIfAborted(t="execution"){this.signal?.aborted&&this.fail(new ze("",`bash: ${t} aborted
2
+ import{a as Rt,b as Ot,c as it}from"./chunks/chunk-WNH3HOQA.js";import{a as Nr}from"./chunks/chunk-BRJERIF4.js";import{c as ei,e as ya}from"./chunks/chunk-KIGPB52X.js";import{a as $r,b as Cr,c as Yn,d as Jn}from"./chunks/chunk-WXPNKIIH.js";import{a as Vt}from"./chunks/chunk-J2OBOJ64.js";import{a as Js}from"./chunks/chunk-L2UW7DWF.js";import{a as Wt,b as Xe,c as nr}from"./chunks/chunk-DLL7UR66.js";import{a as tr,b as ma}from"./chunks/chunk-BKUWXPEM.js";import{a as ge}from"./chunks/chunk-KVG5FR5F.js";import{a as _t,b as Ce}from"./chunks/chunk-ZBUZKIPX.js";import"./chunks/chunk-6D3WD6YU.js";import{c as Ft,d as Pn}from"./chunks/chunk-AH7VTVWU.js";import"./chunks/chunk-STHBFACM.js";import{a as W,b as Ct,c as z,d as xn,e as Bt,f as Nt,g as $n}from"./chunks/chunk-YUSFCOM7.js";import{a as kn,b as He,c as Qe,d as Te,e as We,f as Ve,g as G,h as ce,i as Ke,j as Lt,k as Rr,l as x,m as ze,n as Mt,o as Or,p as st}from"./chunks/chunk-EFORKKSH.js";import{a as B,b as er,c as cn,d as Vf,e as Tt,f as Xs,g as vn,h as zf,i as xt,j as Ys,k as Uf,l as jf}from"./chunks/chunk-GN6CQ3J4.js";import{a as wt}from"./chunks/chunk-FOCWZZDE.js";import{a as $t}from"./chunks/chunk-W5DWRFSU.js";import{a as Ks}from"./chunks/chunk-NCUTH6QL.js";var un=[{name:"echo",load:async()=>(await import("./chunks/echo-PLLZYM2L.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-33KGN4MZ.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-V42QCPHL.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-R5CQLZQM.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-WDDKK2P3.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-WZKAT6M5.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-W4DF6Z4T.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-JQ4GDKDD.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-FKTQRFYJ.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-XSJA2FNL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-VYDFOFNO.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-APOXUPXW.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-76BPYV5F.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-IY6QKK2P.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-CFENJILH.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-BDNMS4FR.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-RUR7HE5O.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-6KILP5AL.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-5UPEO42U.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-5UPEO42U.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-5UPEO42U.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-UQE6KUBP.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-JW2JDLSI.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-NPLZQ3K7.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-PV2NEQHF.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-OVOW532K.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-DTWKU2MC.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-RWPUW5FY.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-LLZ3ZQR2.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-3I4MDKIF.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-EPOS3MFH.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-RFXH2GNX.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-QJBPHRFJ.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-2BPPGGSM.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-YD5BWFH4.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-WTD7Q2EF.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-2SD6EP72.js")).split},{name:"column",load:async()=>(await import("./chunks/column-LKMDIDCH.js")).column},{name:"join",load:async()=>(await import("./chunks/join-KQ4Z5OD4.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-OOWSWHRQ.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-PM3TD7V4.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-SJZQ5W65.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-Z2ZMOOW2.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-7OOL2MH6.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-PR3M44X6.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-VUUMB47B.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-VUUMB47B.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-T5TO5GWK.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-T5TO5GWK.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-3N762S3K.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-L7TJHOJT.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-QUBPEGGU.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-QUBPEGGU.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-KPIUNI6K.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-HIEWVHJ2.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-HIEWVHJ2.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-X2P7Q64K.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-2BAITDZF.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-CSARC7WF.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-FN2DXAEE.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-PPRBTSVR.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-C6WDYPLV.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-NERE2JJ2.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-5R2GKXC6.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-UMT2OHZ7.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-JEDX55KS.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-BLPZJ6MP.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-VJZ4PHQ4.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-VEGKTTSF.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-GGVR4YGL.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-QDDMBDU7.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-UWVKETYW.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-YXC4HBTR.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-CESD3CQR.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-KR6E7UIR.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-BI6XJPXY.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-ZINVK3M6.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-ZINVK3M6.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-ZINVK3M6.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(un.push({name:"tar",load:async()=>(await import("./chunks/tar-6365WH6H.js")).tarCommand}),un.push({name:"yq",load:async()=>(await import("./chunks/yq-MI27NZ2U.js")).yqCommand}),un.push({name:"xan",load:async()=>(await import("./chunks/xan-HUOXKUQA.js")).xanCommand}),un.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-UVVRYDAL.js")).sqlite3Command}));var Dr=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Dr.push({name:"python3",load:async()=>(await import("./chunks/python3-F5S5TYGS.js")).python3Command}),Dr.push({name:"python",load:async()=>(await import("./chunks/python3-F5S5TYGS.js")).pythonCommand}));var Ir=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ir.push({name:"js-exec",load:async()=>(await import("./chunks/js-exec-XKF2B7C3.js")).jsExecCommand}),Ir.push({name:"node",load:async()=>(await import("./chunks/js-exec-XKF2B7C3.js")).nodeStubCommand}));var wa=[{name:"curl",load:async()=>(await import("./chunks/curl-DEHFBW27.js")).curlCommand}],ga=new Map;function _r(e){return{name:e.name,async execute(t,n){let r=ga.get(e.name);if(r||(r=await Ce.runTrustedAsync(()=>e.load()),ga.set(e.name,r)),n.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:s}=await import("./chunks/flag-coverage-I6UJUKQ4.js");s(n.coverage,e.name,t)}return r.execute(t,n)}}}function qf(){return un.map(e=>e.name)}function Gf(){return wa.map(e=>e.name)}function Ea(e){return(e?un.filter(n=>e.includes(n.name)):un).map(_r)}function ba(){return wa.map(_r)}function Zf(){return Dr.map(e=>e.name)}function Sa(){return Dr.map(_r)}function Hf(){return Ir.map(e=>e.name)}function Aa(){return Ir.map(_r)}var va=new WeakMap,ka=new WeakSet;function Tr(e){let t=va.get(e);return t===void 0&&(t=Object.freeze(Object.create(null)),va.set(e,t),ka.add(t)),t}function Pa(e){return ka.has(e)}var xa={maxSourceBytes:67108864,maxExecDepth:64,maxCallDepth:100,maxCommandCount:1e5,maxLoopIterations:1e5,maxAwkIterations:1e5,maxSedIterations:1e5,maxJqIterations:1e7,maxQueryTokens:1e5,maxQueryDepth:1e3,maxQueryElements:1e6,maxAwkParserTokens:1e5,maxAwkParserDepth:256,maxAwkParserOperations:1e6,maxCsvRows:1e6,maxCsvCells:1e7,maxWorkUnits:1e8,maxTraversalEntries:1e6,maxTraversalDepth:1e3,maxTraversalWork:1e6,maxLiveBytes:536870912,maxInputBytes:536870912,maxFileSystemBytes:1073741824,maxDatabaseBytes:1073741824,maxDatabaseResultBytes:268435456,maxArchiveBytes:1073741824,maxArchiveCompressedBytes:536870912,maxArchiveEntryBytes:536870912,maxArchiveEntries:1e6,maxWorkerMessageBytes:67108864,maxExecutionTimeMs:36e5,maxExtensionCleanupTimeMs:100,maxSqliteTimeoutMs:3e4,maxPythonTimeoutMs:3e4,maxJsTimeoutMs:3e4,maxGlobOperations:1e6,maxStringLength:67108864,maxArrayElements:1e6,maxHeredocSize:67108864,maxSubstitutionDepth:50,maxBraceExpansionResults:1e5,maxOutputSize:268435456,maxFileDescriptors:4096,maxSourceDepth:100},Qf={...xa,maxSourceBytes:8*1024*1024,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxExtensionCleanupTimeMs:25,maxGlobOperations:1e5,maxStringLength:10*1024*1024,maxArrayElements:1e5,maxHeredocSize:10*1024*1024,maxBraceExpansionResults:1e4,maxOutputSize:10*1024*1024,maxFileDescriptors:1024,maxQueryTokens:25e3,maxQueryDepth:256,maxQueryElements:1e5,maxAwkParserTokens:25e3,maxAwkParserDepth:128,maxAwkParserOperations:1e5,maxCsvRows:1e5,maxCsvCells:1e6,maxWorkUnits:1e5,maxTraversalEntries:1e5,maxTraversalDepth:256,maxTraversalWork:1e5,maxLiveBytes:64*1024*1024,maxInputBytes:32*1024*1024,maxFileSystemBytes:128*1024*1024,maxDatabaseBytes:64*1024*1024,maxDatabaseResultBytes:16*1024*1024,maxArchiveBytes:128*1024*1024,maxArchiveCompressedBytes:64*1024*1024,maxArchiveEntryBytes:64*1024*1024,maxArchiveEntries:1e5,maxWorkerMessageBytes:16*1024*1024,maxExecutionTimeMs:3e4};function Lr(e,t="normal"){if(t!=="normal"&&t!=="hardened")throw new RangeError('executionLimitProfile must be "normal" or "hardened"');let n=t==="hardened"?Qf:xa;if(!e)return{...n};let r={maxSourceBytes:e.maxSourceBytes??n.maxSourceBytes,maxExecDepth:e.maxExecDepth??n.maxExecDepth,maxCallDepth:e.maxCallDepth??n.maxCallDepth,maxCommandCount:e.maxCommandCount??n.maxCommandCount,maxLoopIterations:e.maxLoopIterations??n.maxLoopIterations,maxAwkIterations:e.maxAwkIterations??n.maxAwkIterations,maxSedIterations:e.maxSedIterations??n.maxSedIterations,maxJqIterations:e.maxJqIterations??n.maxJqIterations,maxQueryTokens:e.maxQueryTokens??n.maxQueryTokens,maxQueryDepth:e.maxQueryDepth??n.maxQueryDepth,maxQueryElements:e.maxQueryElements??n.maxQueryElements,maxAwkParserTokens:e.maxAwkParserTokens??n.maxAwkParserTokens,maxAwkParserDepth:e.maxAwkParserDepth??n.maxAwkParserDepth,maxAwkParserOperations:e.maxAwkParserOperations??n.maxAwkParserOperations,maxCsvRows:e.maxCsvRows??n.maxCsvRows,maxCsvCells:e.maxCsvCells??n.maxCsvCells,maxWorkUnits:e.maxWorkUnits??n.maxWorkUnits,maxTraversalEntries:e.maxTraversalEntries??n.maxTraversalEntries,maxTraversalDepth:e.maxTraversalDepth??n.maxTraversalDepth,maxTraversalWork:e.maxTraversalWork??n.maxTraversalWork,maxLiveBytes:e.maxLiveBytes??n.maxLiveBytes,maxInputBytes:e.maxInputBytes??n.maxInputBytes,maxFileSystemBytes:e.maxFileSystemBytes??n.maxFileSystemBytes,maxDatabaseBytes:e.maxDatabaseBytes??n.maxDatabaseBytes,maxDatabaseResultBytes:e.maxDatabaseResultBytes??n.maxDatabaseResultBytes,maxArchiveBytes:e.maxArchiveBytes??n.maxArchiveBytes,maxArchiveCompressedBytes:e.maxArchiveCompressedBytes??n.maxArchiveCompressedBytes,maxArchiveEntryBytes:e.maxArchiveEntryBytes??n.maxArchiveEntryBytes,maxArchiveEntries:e.maxArchiveEntries??n.maxArchiveEntries,maxWorkerMessageBytes:e.maxWorkerMessageBytes??n.maxWorkerMessageBytes,maxExecutionTimeMs:e.maxExecutionTimeMs??n.maxExecutionTimeMs,maxExtensionCleanupTimeMs:e.maxExtensionCleanupTimeMs??n.maxExtensionCleanupTimeMs,maxSqliteTimeoutMs:e.maxSqliteTimeoutMs??n.maxSqliteTimeoutMs,maxPythonTimeoutMs:e.maxPythonTimeoutMs??n.maxPythonTimeoutMs,maxJsTimeoutMs:e.maxJsTimeoutMs??n.maxJsTimeoutMs,maxGlobOperations:e.maxGlobOperations??n.maxGlobOperations,maxStringLength:e.maxStringLength??n.maxStringLength,maxArrayElements:e.maxArrayElements??n.maxArrayElements,maxHeredocSize:e.maxHeredocSize??n.maxHeredocSize,maxSubstitutionDepth:e.maxSubstitutionDepth??n.maxSubstitutionDepth,maxBraceExpansionResults:e.maxBraceExpansionResults??n.maxBraceExpansionResults,maxOutputSize:e.maxOutputSize??n.maxOutputSize,maxFileDescriptors:e.maxFileDescriptors??n.maxFileDescriptors,maxSourceDepth:e.maxSourceDepth??n.maxSourceDepth};for(let s of Object.keys(r)){let i=r[s];if(i!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(i)||i<0))throw new RangeError(`${s} must be a non-negative safe integer or positive Infinity`)}return r}function Kf(e){let{executionLimits:t,executionLimitProfile:n,fs:r,stdin:s=Xs,...i}=e;return{fs:r,fsIdentity:i.fsIdentity??Tr(r),cwd:"/",env:new Map,stdin:s,limits:Lr(t,n),...i}}function $a(e){return"load"in e&&typeof e.load=="function"}function Xf(e,t,n={}){return{name:e,trusted:n.trusted!==!1,execute:t}}function Ca(e){let t=null,n=null;return{name:e.name,trusted:e.trusted!==!1,async execute(r,s){if(!t){let o=n;o||(o=e.load().then(a=>(t=a,a)),n=o);try{t=await o}catch(a){throw n===o&&(n=null),a}}let i=t;if(!i)throw new Error(`Failed to load command: ${e.name}`);return i.execute(r,s)}}}var Na=Object.freeze(Object.create(null)),Mr=class{limits;signal;commandCount=0;workUnits=0;liveBytes=0;inputBytes=0;outputBytes=0;countersByKind=new Map;bytesByKind=new Map;depthByKind=new Map;cleanupCallbacks=[];poisoned;closed=!1;startedAt=Date.now();get remainingLiveBytes(){return Math.max(0,this.limits.maxLiveBytes-this.liveBytes)}get outputBytesUsed(){return this.outputBytes}constructor(t,n=void 0){this.limits=t,this.signal=n}fail(t){throw this.poisoned??=t,this.poisoned}poisonAfterAbort(t){this.poisoned??=t}assertUsable(){if(this.poisoned)throw this.poisoned;if(this.closed)throw new Error("execution budget is already closed");this.throwIfAborted()}chargeCommand(){return this.consume("commands",1,"execution")}consumeWork(t=1,n="execution"){return this.consume("work",t,n)}consumeLimited(t,n,r,s=t){this.assertUsable();let i=this.countersByKind.get(t)??0;return(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(r)||r<0||n>r-i)&&this.fail(new x(`${s}: ${t} work limit exceeded (${r})`,"iterations")),n>this.limits.maxWorkUnits-this.workUnits&&this.fail(new x(`${s}: aggregate work limit exceeded (${this.limits.maxWorkUnits})`,"iterations")),this.countersByKind.set(t,i+n),this.workUnits+=n,i+n}consumeInput(t,n="execution"){return this.assertUsable(),(!Number.isSafeInteger(t)||t<0||t>this.limits.maxInputBytes-this.inputBytes)&&this.fail(new x(`${n}: aggregate input size limit exceeded (${this.limits.maxInputBytes} bytes)`,"string_length")),this.inputBytes+=t,this.inputBytes}consume(t,n=1,r=t){this.assertUsable();let s=this.countersByKind.get(t)??0,i=t==="commands"?this.commandCount:this.workUnits,o=t==="commands"?this.limits.maxCommandCount:this.limits.maxWorkUnits;(!Number.isSafeInteger(n)||n<0||n>o-i)&&this.fail(new x(t==="commands"?`too many commands executed (>${o}), increase executionLimits.maxCommandCount`:`${r}: ${t} work limit exceeded (${o})`,t==="commands"?"commands":"iterations"));let a=i+n;return t==="commands"?this.commandCount=a:this.workUnits=a,this.countersByKind.set(t,s+n),a}reserveBytes(t,n,r){this.assertUsable();let s=typeof t=="string"?t:"live",i=typeof t=="string"?n:t,o=typeof t=="string"?r??s:n??"execution";(!Number.isSafeInteger(i)||i<0||i>this.limits.maxLiveBytes-this.liveBytes)&&this.fail(new x(`${o}: live byte limit exceeded (${this.limits.maxLiveBytes} bytes)`,"string_length")),this.liveBytes+=i,this.bytesByKind.set(s,(this.bytesByKind.get(s)??0)+i);let a=!1;return{release:()=>{if(a)return;a=!0,this.liveBytes-=i;let l=(this.bytesByKind.get(s)??i)-i;l<=0?this.bytesByKind.delete(s):this.bytesByKind.set(s,l)}}}appendOutput(t,n,r="execution",s=0,i="text"){this.assertUsable();let o=i==="bytes"?n.length:B(n);(!Number.isSafeInteger(s)||s<0||s>o)&&this.fail(new x(`${r}: invalid ${t} accounting`,"output_size"));let a=o-s;return a>this.limits.maxOutputSize-this.outputBytes&&this.fail(new x(`${r}: total output size exceeded (>${this.limits.maxOutputSize} bytes), increase executionLimits.maxOutputSize`,"output_size")),this.outputBytes+=a,o}accountResult(t,n="execution",r=Number.POSITIVE_INFINITY){let s=t.internalOutputAccounting,i=Math.min(s?.stdout??0,r),o=Math.min(s?.stderr??0,Math.max(0,r-i)),a=this.appendOutput("stdout",t.stdout,n,i,t.stdoutKind==="bytes"||t.stdoutEncoding==="binary"?"bytes":"text"),l=this.appendOutput("stderr",t.stderr,n,o);return Object.isExtensible(t)?(t.internalOutputAccounting={stdout:a,stderr:l},t):a===0&&l===0?t:{...t,internalOutputAccounting:{stdout:a,stderr:l}}}relinquishOutput(t,n,r){this.assertUsable(),r!==Na&&this.fail(new x(`${n}: unauthorized output accounting release`,"output_size")),(!Number.isSafeInteger(t)||t<0||t>this.outputBytes)&&this.fail(new x(`${n}: invalid output accounting release`,"output_size")),this.outputBytes-=t}enterDepth(t,n=this.limits.maxCallDepth,r){this.assertUsable();let s=typeof n=="number"?n:this.limits.maxCallDepth,i=typeof n=="string"?n:r??t,o=this.depthByKind.get(t)??0;o>=s&&this.fail(new x(`${i}: maximum depth (${s}) exceeded`,"recursion")),this.depthByKind.set(t,o+1);let a=!1;return{release:()=>{if(a)return;a=!0;let l=(this.depthByKind.get(t)??1)-1;l<=0?this.depthByKind.delete(t):this.depthByKind.set(t,l)}}}throwIfAborted(t="execution"){this.signal?.aborted&&this.fail(new ze("",`bash: ${t} aborted
3
3
  `)),Date.now()-this.startedAt>this.limits.maxExecutionTimeMs&&this.fail(new ze("",`bash: ${t} exceeded execution deadline (${this.limits.maxExecutionTimeMs}ms)
4
4
  `))}remainingTimeMs(){return Math.max(0,this.limits.maxExecutionTimeMs-(Date.now()-this.startedAt))}registerCleanup(t){this.assertUsable(),this.cleanupCallbacks.push(t);let n=!0;return()=>{if(!n)return;n=!1;let r=this.cleanupCallbacks.indexOf(t);r>=0&&this.cleanupCallbacks.splice(r,1)}}async close(){if(this.closed)return;this.closed=!0;let t=[],n=Date.now()+this.limits.maxExtensionCleanupTimeMs;for(let r=this.cleanupCallbacks.length-1;r>=0;r--)try{let s=n-Date.now();if(s<=0){t.push(new Error("execution cleanup grace period exceeded"));break}let i,o=await Promise.race([Promise.resolve().then(this.cleanupCallbacks[r]).then(()=>({ok:!0}),a=>({ok:!1,error:a})),new Promise(a=>{i=Yn(()=>a({ok:!1,error:new Error("execution cleanup grace period exceeded")}),s)})]);if(Jn(i),!o.ok&&(t.push(o.error),Date.now()>=n))break}catch(s){t.push(s)}if(this.cleanupCallbacks.length=0,this.depthByKind.clear(),this.bytesByKind.clear(),this.liveBytes=0,t.length>0)throw new AggregateError(t,"execution cleanup failed")}assertExecDepth(t){this.assertUsable(),t>this.limits.maxExecDepth&&this.fail(new x(`maximum nested execution depth (${this.limits.maxExecDepth}) exceeded`,"recursion"))}};function Ra(e){let t=Object.create(null);return Object.defineProperties(t,{remainingLiveBytes:{enumerable:!0,get:()=>e.remainingLiveBytes},consumeWork:{enumerable:!0,value:e.consumeWork.bind(e)},consumeLimited:{enumerable:!0,value:e.consumeLimited.bind(e)},consumeInput:{enumerable:!0,value:e.consumeInput.bind(e)},reserveBytes:{enumerable:!0,value:e.reserveBytes.bind(e)},enterDepth:{enumerable:!0,value:e.enterDepth.bind(e)},throwIfAborted:{enumerable:!0,value:e.throwIfAborted.bind(e)},remainingTimeMs:{enumerable:!0,value:e.remainingTimeMs.bind(e)},registerCleanup:{enumerable:!0,value:e.registerCleanup.bind(e)}}),Object.freeze(t)}function Oa(e,t,n="pipeline"){e.relinquishOutput(t,n,Na)}var fn=new TextEncoder;function Yf(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}var ft=class{data=new Map;entryIdentities=new WeakMap;nextEntryIdentity=1;maxTotalBytes;retainedBytes=0;contentReferences=new WeakMap;materializedContent(t){return t?.type==="file"&&"content"in t?t.content:null}storedByteLength(t){return t===null?0:t instanceof Uint8Array?t.byteLength:B(t)}wouldReleaseBytes(t){let n=this.materializedContent(t);return n===null?0:n instanceof Uint8Array?this.contentReferences.get(n)===1?n.byteLength:0:this.storedByteLength(n)}assertCanAllocate(t,n){let r=this.wouldReleaseBytes(this.data.get(t));if(!Number.isSafeInteger(n)||n<0||n>this.maxTotalBytes-this.retainedBytes+r)throw new Error(`ENOSPC: in-memory filesystem byte limit exceeded (${this.maxTotalBytes} bytes)`)}setEntry(t,n){let r=this.data.get(t),s=this.materializedContent(r),i=this.materializedContent(n);if(s===i){this.data.set(t,n);return}let o=this.wouldReleaseBytes(r),a=i instanceof Uint8Array?this.contentReferences.has(i)?0:i.byteLength:this.storedByteLength(i);if(a>this.maxTotalBytes-this.retainedBytes+o)throw new Error(`ENOSPC: in-memory filesystem byte limit exceeded (${this.maxTotalBytes} bytes)`);if(s instanceof Uint8Array){let l=this.contentReferences.get(s)??0;l<=1?this.contentReferences.delete(s):this.contentReferences.set(s,l-1)}i instanceof Uint8Array&&this.contentReferences.set(i,(this.contentReferences.get(i)??0)+1),this.retainedBytes+=a-o,this.data.set(t,n)}deleteEntry(t){let n=this.data.get(t);if(!n)return!1;let r=this.materializedContent(n),s=this.wouldReleaseBytes(n);if(r instanceof Uint8Array){let i=this.contentReferences.get(r)??0;i<=1?this.contentReferences.delete(r):this.contentReferences.set(r,i-1)}return this.retainedBytes-=s,this.data.delete(t)}contentByteLength(t,n){if(t instanceof Uint8Array)return t.byteLength;if(n==="hex")return Math.floor(t.length/2);if(n==="base64"){let r=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.max(0,Math.floor(t.length*3/4)-r)}return n==="binary"||n==="latin1"?t.length:B(t)}identityFor(t){let n=this.entryIdentities.get(t);return n||(n=`memfs:${this.nextEntryIdentity++}`,this.entryIdentities.set(t,n)),n}constructor(t,n={}){if(this.maxTotalBytes=n.maxTotalBytes??1024*1024*1024,!Number.isSafeInteger(this.maxTotalBytes)||this.maxTotalBytes<0)throw new Error("InMemoryFs: invalid maxTotalBytes");if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[r,s]of Object.entries(t))typeof s=="function"?this.writeFileLazy(r,s):Yf(s)?this.writeFileSync(r,s.content,void 0,{mode:s.mode,mtime:s.mtime}):this.writeFileSync(r,s)}ensureParentDirs(t){let n=xn(t);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,n,r,s){z(t,"write");let i=W(t);this.ensureParentDirs(i);let o=it(r);this.assertCanAllocate(i,this.contentByteLength(n,o));let a=Rt(n,o);this.setEntry(i,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}writeFileLazy(t,n,r){z(t,"write");let s=W(t);this.ensureParentDirs(s),this.setEntry(s,{type:"file",lazy:n,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,n){let r=await n.lazy(),s=typeof r=="string"?fn.encode(r):r,i={type:"file",content:s,mode:n.mode,mtime:n.mtime};return this.assertCanAllocate(t,s.byteLength),this.setEntry(t,i),i}async readFile(t,n){let r=await this.readFileBuffer(t),s=it(n);return Ot(r,s)}async readFileBytes(t){let n=await this.readFileBuffer(t);return Ot(n,"binary")}async readFileBuffer(t){z(t,"open");let n=this.resolvePathWithSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);if("lazy"in r){let s=await this.materializeLazy(n,r);return s.content instanceof Uint8Array?s.content:fn.encode(s.content)}return r.content instanceof Uint8Array?r.content:fn.encode(r.content)}async writeFile(t,n,r){this.writeFileSync(t,n,r)}async appendFile(t,n,r){z(t,"append");let s=W(t),i=this.data.get(s);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let o=it(r),a=this.contentByteLength(n,o);if(i?.type==="file"){let l=i;"lazy"in l&&(l=await this.materializeLazy(s,l));let c="content"in l&&l.content instanceof Uint8Array?l.content:fn.encode("content"in l?l.content:"");this.assertCanAllocate(s,c.byteLength+a);let u=Rt(n,o),f=new Uint8Array(c.length+u.length);f.set(c),f.set(u,c.length),this.setEntry(s,{type:"file",content:f,mode:l.mode,mtime:new Date})}else this.writeFileSync(t,n,r)}async exists(t){if(t.includes("\0"))return!1;try{let n=this.resolvePathWithSymlinks(t);return this.data.has(n)}catch{return!1}}async stat(t){z(t,"stat");let n=this.resolvePathWithSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(n,r));let s=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=fn.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date,identity:this.identityFor(r)}}async lstat(t){z(t,"lstat");let n=this.resolveIntermediateSymlinks(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(n,r));let s=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=fn.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date,identity:this.identityFor(r)}}resolveIntermediateSymlinks(t){let n=W(t);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",i=new Set;for(let o=0;o<r.length-1;o++){let a=r[o];s=`${s}/${a}`;let l=this.data.get(s),c=0,u=40;for(;l&&l.type==="symlink"&&c<u;){if(i.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`);i.add(s),s=$n(s,l.target),l=this.data.get(s),c++}if(c>=u)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(t){let n=W(t);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",i=new Set;for(let o of r){s=`${s}/${o}`;let a=this.data.get(s),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){if(i.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);i.add(s),s=$n(s,a.target),a=this.data.get(s),l++}if(l>=c)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return s}async mkdir(t,n){this.mkdirSync(t,n)}mkdirSync(t,n){z(t,"mkdir");let r=W(t);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let s=xn(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(r=>r.name)}async readdirWithFileTypes(t){z(t,"scandir");let n=W(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);s.add(n),n=$n(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=n==="/"?"/":`${n}/`,o=new Map;for(let[a,l]of this.data.entries())if(a!==n&&a.startsWith(i)){let c=a.slice(i.length),u=c.split("/")[0];u&&!c.includes("/",u.length)&&!o.has(u)&&o.set(u,{name:u,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(o.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(t,n){z(t,"rm");let r=W(t),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(s.type==="directory"){let i=await this.readdir(r);if(i.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let o of i){let a=Nt(r,o);await this.rm(a,n)}}}this.deleteEntry(r)}async cp(t,n,r){z(t,"cp"),z(n,"cp");let s=W(t),i=W(n),o=this.data.get(s);if(!o)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(o.type==="file")if(this.ensureParentDirs(i),"content"in o){let a=o.content instanceof Uint8Array?o.content.byteLength:fn.encode(o.content).byteLength;this.assertCanAllocate(i,a);let l=o.content instanceof Uint8Array?new Uint8Array(o.content):o.content;this.setEntry(i,{...o,content:l})}else this.setEntry(i,{...o});else if(o.type==="symlink")this.ensureParentDirs(i),this.data.set(i,{...o});else if(o.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);if(Ct(s,i))throw new Error(`EINVAL: cannot copy '${t}' into itself, '${n}'`);await this.mkdir(i,{recursive:!0});let a=await this.readdir(s);for(let l of a){let c=Nt(s,l),u=Nt(i,l);await this.cp(c,u,r)}}}async mv(t,n){z(t,"mv"),z(n,"mv");let r=W(t),s=W(n);if(r===s)return;let i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, mv '${t}'`);if(i.type==="directory"&&Ct(r,s))throw new Error(`EINVAL: cannot move '${t}' into itself, '${n}'`);if(i.type==="directory"){await this.mkdir(s,{recursive:!0});let o=await this.readdir(r);for(let a of o)await this.mv(Nt(r,a),Nt(s,a));this.deleteEntry(r);return}this.ensureParentDirs(s),this.setEntry(s,i),this.deleteEntry(r)}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,n){return Bt(t,n)}async chmod(t,n){z(t,"chmod");let r=W(t),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);s.mode=n}async symlink(t,n){z(n,"symlink");let r=W(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,n){z(t,"link"),z(n,"link");let r=W(t),s=W(n),i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);let o=i;"lazy"in o&&(o=await this.materializeLazy(r,o)),this.ensureParentDirs(s);let a={type:"file",content:o.content,mode:o.mode,mtime:o.mtime};this.entryIdentities.set(a,this.identityFor(o)),this.setEntry(s,a)}async readlink(t){z(t,"readlink");let n=W(t),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return r.target}async realpath(t){z(t,"realpath");let n=this.resolvePathWithSymlinks(t);if(!this.data.has(n))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return n}async utimes(t,n,r){z(t,"utimes");let s=W(t),i=this.resolvePathWithSymlinks(s),o=this.data.get(i);if(!o)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);o.mtime=r}};var Da="5.1.0(1)-release",Ia="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT";function ni(e){let{pid:t,ppid:n,uid:r,gid:s}=e;return`Name: bash
5
5
  State: R (running)
@@ -39,6 +39,11 @@ import * as nodeAsyncHooks from "node:async_hooks";
39
39
  import * as nodeModule from "node:module";
40
40
 
41
41
  // src/security/blocked-globals.ts
42
+ var blockedGlobalViolationTypes;
43
+ function getBlockedGlobalViolationTypes() {
44
+ if (!blockedGlobalViolationTypes) getBlockedGlobals();
45
+ return blockedGlobalViolationTypes;
46
+ }
42
47
  function getBlockedGlobals() {
43
48
  const globals = [
44
49
  // Direct code execution vectors
@@ -98,6 +103,7 @@ function getBlockedGlobals() {
98
103
  "NODE_DEBUG",
99
104
  "NODE_DEBUG_NATIVE",
100
105
  "NODE_COMPILE_CACHE",
106
+ "NODE_ENV",
101
107
  "WATCH_REPORT_DEPENDENCIES",
102
108
  // Dependencies
103
109
  "FORCE_COLOR",
@@ -511,13 +517,49 @@ function getBlockedGlobals() {
511
517
  }
512
518
  } catch {
513
519
  }
514
- return globals.filter((g) => {
520
+ const availableGlobals = globals.filter((g) => {
515
521
  try {
516
522
  return g.target[g.prop] !== void 0;
517
523
  } catch {
518
524
  return false;
519
525
  }
520
526
  });
527
+ blockedGlobalViolationTypes ??= new Set(
528
+ availableGlobals.map(({ violationType }) => violationType)
529
+ );
530
+ return availableGlobals;
531
+ }
532
+
533
+ // src/security/safe-timestamp.ts
534
+ var performanceTimeOrigin = performance.timeOrigin;
535
+ var performanceNow = performance.now.bind(performance);
536
+ function getSafeTimestamp() {
537
+ return Math.floor(performanceTimeOrigin + performanceNow());
538
+ }
539
+
540
+ // src/security/violation-error-message.ts
541
+ var NON_EXCLUDABLE_VIOLATION_TYPES = /* @__PURE__ */ new Set([
542
+ "function_constructor",
543
+ "async_function_constructor",
544
+ "generator_function_constructor",
545
+ "async_generator_function_constructor"
546
+ ]);
547
+ function assertExcludableViolationTypes(violationTypes) {
548
+ const nonExcludable = violationTypes?.find(
549
+ (type) => NON_EXCLUDABLE_VIOLATION_TYPES.has(type)
550
+ );
551
+ if (nonExcludable) {
552
+ throw new RangeError(
553
+ `defenseInDepth.excludeViolationTypes cannot disable the non-excludable "${nonExcludable}" protection`
554
+ );
555
+ }
556
+ }
557
+ var DEFENSE_IN_DEPTH_NOTICE = "\n\nThis is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com";
558
+ function formatViolationErrorMessage(message, violationType, canExclude) {
559
+ const exclusionHint = canExclude && !NON_EXCLUDABLE_VIOLATION_TYPES.has(violationType) ? `
560
+
561
+ If this access is required by trusted host-runtime code, add "${violationType}" to defenseInDepth.excludeViolationTypes.` : "";
562
+ return message + DEFENSE_IN_DEPTH_NOTICE + exclusionHint;
521
563
  }
522
564
 
523
565
  // src/security/defense-in-depth-box.ts
@@ -536,10 +578,23 @@ if (!IS_BROWSER) {
536
578
  var executionContext = !IS_BROWSER && AsyncLocalStorageClass ? new AsyncLocalStorageClass() : null;
537
579
 
538
580
  // src/security/worker-defense-in-depth.ts
539
- var DEFENSE_IN_DEPTH_NOTICE = "\n\nThis is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com";
581
+ var WORKER_SPECIAL_EXCLUDABLE_VIOLATION_TYPES = /* @__PURE__ */ new Set([
582
+ "error_prepare_stack_trace",
583
+ "module_load",
584
+ "module_resolve_filename",
585
+ "process_main_module",
586
+ "process_exec_path",
587
+ "process_connected"
588
+ ]);
540
589
  var WorkerSecurityViolationError = class extends Error {
541
590
  constructor(message, violation) {
542
- super(message + DEFENSE_IN_DEPTH_NOTICE);
591
+ super(
592
+ formatViolationErrorMessage(
593
+ message,
594
+ violation.type,
595
+ WORKER_SPECIAL_EXCLUDABLE_VIOLATION_TYPES.has(violation.type) || getBlockedGlobalViolationTypes().has(violation.type)
596
+ )
597
+ );
543
598
  this.violation = violation;
544
599
  this.name = "WorkerSecurityViolationError";
545
600
  }
@@ -598,6 +653,7 @@ var WorkerDefenseInDepth = class {
598
653
  * @param config - Configuration for the defense layer
599
654
  */
600
655
  constructor(config) {
656
+ assertExcludableViolationTypes(config.excludeViolationTypes);
601
657
  this.originalProxy = Proxy;
602
658
  this.config = config;
603
659
  this.executionId = generateExecutionId();
@@ -681,7 +737,7 @@ var WorkerDefenseInDepth = class {
681
737
  */
682
738
  recordViolation(type, path, message) {
683
739
  const violation = {
684
- timestamp: Date.now(),
740
+ timestamp: getSafeTimestamp(),
685
741
  type,
686
742
  message,
687
743
  path,
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Blocked Globals for Defense-in-Depth Box
3
+ *
4
+ * This module defines which JavaScript globals should be blocked during
5
+ * bash script execution to prevent code execution escape vectors.
6
+ *
7
+ * IMPORTANT: This is a SECONDARY defense layer. The primary security comes
8
+ * from proper sandboxing and architectural constraints.
9
+ *
10
+ * NOTE: Dynamic import() is handled separately in defense-in-depth-box.ts via
11
+ * ESM loader hooks. This module only defines global/property patching.
12
+ */
13
+ import type { SecurityViolationType } from "./types.js";
14
+ /**
15
+ * Strategy for handling a blocked global.
16
+ * - "throw": Replace with a proxy that throws on access/call
17
+ * - "freeze": Freeze the object to prevent modification
18
+ */
19
+ export type BlockStrategy = "throw" | "freeze";
20
+ /**
21
+ * Configuration for a blocked global.
22
+ */
23
+ export interface BlockedGlobal {
24
+ /**
25
+ * The property name on the target object (e.g., "Function", "eval").
26
+ */
27
+ prop: string;
28
+ /**
29
+ * The target object containing the property.
30
+ * Usually globalThis, but can be other objects like Object.prototype.
31
+ */
32
+ target: object;
33
+ /**
34
+ * Type of violation to record when this global is accessed.
35
+ */
36
+ violationType: SecurityViolationType;
37
+ /**
38
+ * Strategy for blocking this global.
39
+ */
40
+ strategy: BlockStrategy;
41
+ /**
42
+ * Human-readable description of why this is blocked.
43
+ */
44
+ reason: string;
45
+ /**
46
+ * For object proxies (strategy: "throw" on objects): allow reads of these
47
+ * specific property names even inside the sandbox context. Node.js internals
48
+ * read certain properties (e.g., process.env keys) during module loading
49
+ * within the AsyncLocalStorage context, so they must be allowed through.
50
+ */
51
+ allowedKeys?: Set<string>;
52
+ }
53
+ export declare function getBlockedGlobalViolationTypes(): ReadonlySet<SecurityViolationType>;
54
+ /**
55
+ * Get the list of globals to block during script execution.
56
+ *
57
+ * Note: This function must be called at runtime (not module load time)
58
+ * because some globals may not exist in all environments.
59
+ */
60
+ export declare function getBlockedGlobals(): BlockedGlobal[];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Fail closed when execution is expected to run inside defense async context.
3
+ */
4
+ export declare function assertDefenseContext(requireDefenseContext: boolean | undefined, component: string, phase: string): void;
5
+ /**
6
+ * Guard an async boundary by checking context both before and after await.
7
+ */
8
+ export declare function awaitWithDefenseContext<T>(requireDefenseContext: boolean | undefined, component: string, phase: string, op: () => Promise<T>): Promise<T>;
9
+ /**
10
+ * Bind a callback to the current defense async context and assert defense
11
+ * invariants on callback entry.
12
+ */
13
+ export declare function bindDefenseContextCallback<TArgs extends unknown[], TResult>(requireDefenseContext: boolean | undefined, component: string, phase: string, callback: (...args: TArgs) => TResult): (...args: TArgs) => TResult;