just-bash 3.4.1 → 3.6.0

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 (457) hide show
  1. package/CHANGELOG.md +248 -0
  2. package/README.md +22 -9
  3. package/dist/AGENTS.md +58 -2
  4. package/dist/Bash.d.ts +4 -2
  5. package/dist/abort-signals.d.ts +10 -0
  6. package/dist/bin/chunks/awk2-U22OR5B5.js +3 -0
  7. package/dist/bin/{shell/chunks/base64-FLJ4YPHB.js → chunks/base64-2KKH5BCT.js} +1 -1
  8. package/dist/bin/chunks/{cat-2J5MA5PY.js → cat-V45MVNBT.js} +1 -1
  9. package/dist/bin/{shell/chunks/chmod-ZM5WLMZI.js → chunks/chmod-A54R4UUQ.js} +1 -1
  10. package/dist/bin/chunks/chunk-2NJJXU4K.js +27 -0
  11. package/dist/bin/{shell/chunks/chunk-BJRT4VKD.js → chunks/chunk-3LKMI5IX.js} +1 -1
  12. package/dist/bin/{shell/chunks/chunk-4APSDE57.js → chunks/chunk-44SKMHU6.js} +1 -1
  13. package/dist/bin/chunks/{chunk-GRP7L2EL.js → chunk-6DAR25KN.js} +1 -1
  14. package/dist/bin/{shell/chunks/chunk-VGR3NA3H.js → chunks/chunk-723HNGID.js} +1 -1
  15. package/dist/bin/{shell/chunks/chunk-MRPJL3ZK.js → chunks/chunk-7X4QBCFW.js} +1 -1
  16. package/dist/bin/chunks/{chunk-42AMF6EE.js → chunk-ABM5WFEO.js} +1 -1
  17. package/dist/bin/chunks/{chunk-2HFDEZUY.js → chunk-AINNAQBQ.js} +1 -1
  18. package/dist/bin/{shell/chunks/chunk-BPWZ7ADB.js → chunks/chunk-AL7RVSF4.js} +1 -1
  19. package/dist/bin/{shell/chunks/chunk-MHAGHCSO.js → chunks/chunk-ARYCSNJJ.js} +7 -7
  20. package/dist/bin/{shell/chunks/chunk-2INNLNI5.js → chunks/chunk-BJF6B4YW.js} +1 -1
  21. package/dist/bin/{shell/chunks/chunk-BZWGVRFA.js → chunks/chunk-BOXG6XBN.js} +2 -2
  22. package/dist/bin/chunks/chunk-DA3RFNKK.js +17 -0
  23. package/dist/bin/chunks/chunk-DH7M46D3.js +20 -0
  24. package/dist/bin/chunks/{chunk-2ND6MMXN.js → chunk-DTGQQKI2.js} +1 -1
  25. package/dist/bin/chunks/{chunk-YOIFOOGX.js → chunk-ECZAFQ22.js} +1 -1
  26. package/dist/bin/chunks/{chunk-PPVF2N6C.js → chunk-EFS34UUR.js} +1 -1
  27. package/dist/bin/{shell/chunks/chunk-TW2IJRUF.js → chunks/chunk-ENEHPI32.js} +1 -1
  28. package/dist/bin/chunks/chunk-HFW2LXQV.js +13 -0
  29. package/dist/bin/{shell/chunks/chunk-UHNV55NF.js → chunks/chunk-HRKG3ZK2.js} +1 -1
  30. package/dist/bin/chunks/{chunk-74TZ7ZF7.js → chunk-IKUY74NG.js} +1 -1
  31. package/dist/bin/chunks/chunk-ILXMFIYG.js +7 -0
  32. package/dist/bin/chunks/chunk-IMVXTSPG.js +275 -0
  33. package/dist/bin/chunks/chunk-J5L5DJWL.js +3 -0
  34. package/dist/bin/{shell/chunks/chunk-MF3GVFLC.js → chunks/chunk-JKS7WXGR.js} +1 -1
  35. package/dist/bin/{shell/chunks/chunk-XBX7KFWK.js → chunks/chunk-LG6IN6SW.js} +11 -11
  36. package/dist/bin/chunks/chunk-LMFAALLO.js +21 -0
  37. package/dist/bin/{shell/chunks/chunk-DYIBFLS3.js → chunks/chunk-LOU52GPJ.js} +2 -2
  38. package/dist/bin/chunks/{chunk-FB44CW33.js → chunk-M5ZBECGM.js} +1 -1
  39. package/dist/bin/chunks/chunk-MA6BMA4M.js +3 -0
  40. package/dist/bin/chunks/{chunk-Z7QCL4IA.js → chunk-MPQMTLXN.js} +1 -1
  41. package/dist/bin/chunks/{chunk-TIHFGNPS.js → chunk-MUIYG2RB.js} +1 -1
  42. package/dist/bin/chunks/{chunk-PUZGSIMN.js → chunk-NGMFI3RH.js} +1 -1
  43. package/dist/bin/{shell/chunks/chunk-RYQB6GQ7.js → chunks/chunk-NLMTGTSG.js} +1 -1
  44. package/dist/bin/chunks/{chunk-QAYU7HPM.js → chunk-OBVTFHVP.js} +1 -1
  45. package/dist/bin/chunks/{chunk-MNSMZU47.js → chunk-OOKVPG5D.js} +1 -1
  46. package/dist/bin/{shell/chunks/chunk-O2BCKSMK.js → chunks/chunk-PEJXCXSY.js} +1 -1
  47. package/dist/bin/{shell/chunks/chunk-MYEPQX6Y.js → chunks/chunk-PL4EU7Y2.js} +1 -1
  48. package/dist/bin/chunks/{chunk-QFTZKD5O.js → chunk-QCGH2ZOW.js} +1 -1
  49. package/dist/bin/chunks/chunk-QKWMWSV3.js +3 -0
  50. package/dist/bin/{shell/chunks/chunk-ISOWCECJ.js → chunks/chunk-S5Z7DMIE.js} +10 -10
  51. package/dist/bin/{shell/chunks/chunk-OLEQNRKX.js → chunks/chunk-SQ7SZZMW.js} +1 -1
  52. package/dist/bin/{shell/chunks/chunk-44MQ5AXA.js → chunks/chunk-SQUH76NP.js} +1 -1
  53. package/dist/bin/{shell/chunks/chunk-BOYPCOSV.js → chunks/chunk-TGRZ42DS.js} +1 -1
  54. package/dist/bin/chunks/{chunk-LUHU7UUN.js → chunk-THTKNRO6.js} +1 -1
  55. package/dist/bin/chunks/{chunk-VKTV45AP.js → chunk-TQXLQEIT.js} +1 -1
  56. package/dist/bin/{shell/chunks/chunk-2OQ5HPZE.js → chunks/chunk-U6BXPMLD.js} +1 -1
  57. package/dist/bin/chunks/chunk-U6DBRMD5.js +5 -0
  58. package/dist/bin/{shell/chunks/chunk-CC2AQ6B7.js → chunks/chunk-U6JTVQU6.js} +1 -1
  59. package/dist/bin/chunks/chunk-UPUFWGHR.js +3 -0
  60. package/dist/bin/chunks/{chunk-E5VZGTZ6.js → chunk-URRH3GPG.js} +1 -1
  61. package/dist/bin/chunks/{chunk-EXGPMLIE.js → chunk-VBU3UEG5.js} +1 -1
  62. package/dist/bin/chunks/chunk-VGSRQOLD.js +7 -0
  63. package/dist/bin/chunks/{chunk-GTULZ3ZD.js → chunk-WBST7XJW.js} +1 -1
  64. package/dist/bin/chunks/{chunk-ROFYAVPF.js → chunk-WEQ5WM2M.js} +1 -1
  65. package/dist/bin/{shell/chunks/chunk-BCQSUELK.js → chunks/chunk-WZ7MIBLR.js} +1 -1
  66. package/dist/bin/chunks/{chunk-H4BRFPKY.js → chunk-X45GP3AQ.js} +1 -1
  67. package/dist/bin/chunks/chunk-YQEKKZTU.js +12 -0
  68. package/dist/bin/chunks/{chunk-UNKX6YM6.js → chunk-Z3KAV6YJ.js} +1 -1
  69. package/dist/bin/chunks/{chunk-3SCW7PD5.js → chunk-Z5KICK5X.js} +1 -1
  70. package/dist/bin/chunks/{column-7VBJL757.js → column-LHHS4D3K.js} +1 -1
  71. package/dist/bin/{shell/chunks/cp-MF5GADQN.js → chunks/cp-HPLQA35N.js} +1 -1
  72. package/dist/bin/chunks/curl-FIRG3RB6.js +31 -0
  73. package/dist/bin/chunks/{cut-QOTYBJJJ.js → cut-KP3S36XS.js} +1 -1
  74. package/dist/bin/{shell/chunks/diff-YXZZCUSQ.js → chunks/diff-JSJ56EOK.js} +1 -1
  75. package/dist/bin/chunks/dist-4NZ74CRE.js +141 -0
  76. package/dist/bin/chunks/{du-A3UGHIKJ.js → du-WEF5YWQK.js} +1 -1
  77. package/dist/bin/chunks/{expr-TDF3B6QJ.js → expr-FLWT4OCO.js} +1 -1
  78. package/dist/bin/chunks/{file-AJGG7RYT.js → file-JLUCGBCB.js} +1 -1
  79. package/dist/bin/chunks/{find-6DH6TRDN.js → find-XGVQ6N6L.js} +1 -1
  80. package/dist/bin/chunks/flag-coverage-4JYKIAVV.js +3 -0
  81. package/dist/bin/chunks/{grep-WUZMZDGY.js → grep-DCPCPQOS.js} +1 -1
  82. package/dist/bin/chunks/{gzip-JA7JQBUS.js → gzip-6DZIKNBW.js} +1 -1
  83. package/dist/bin/{shell/chunks/head-YGKW3HS4.js → chunks/head-TLFXMM2T.js} +1 -1
  84. package/dist/bin/{shell/chunks/help-HVIDHJ6M.js → chunks/help-EXVKU23F.js} +1 -1
  85. package/dist/bin/chunks/{html-to-markdown-ZWL7LZIP.js → html-to-markdown-E22RLT2U.js} +1 -1
  86. package/dist/bin/chunks/{jq-5MI4V3G5.js → jq-GDM3OBBK.js} +1 -1
  87. package/dist/bin/chunks/js-exec-VU6F6WLS.js +1578 -0
  88. package/dist/bin/chunks/{ln-XSDIE6SU.js → ln-B35EKC2Q.js} +1 -1
  89. package/dist/bin/chunks/{ls-R6DAGGBH.js → ls-67NUUIYT.js} +1 -1
  90. package/dist/bin/chunks/{mkdir-74BP5NTG.js → mkdir-AWDWRBKC.js} +1 -1
  91. package/dist/bin/chunks/mktemp-L6OGMDUO.js +3 -0
  92. package/dist/bin/chunks/{mv-YG75IRRE.js → mv-4BJSOT4Y.js} +1 -1
  93. package/dist/bin/{shell/chunks/od-YCY27MMO.js → chunks/od-SI75GLRE.js} +1 -1
  94. package/dist/bin/chunks/{paste-ACKOG3XS.js → paste-5TSIBDF7.js} +1 -1
  95. package/dist/bin/chunks/python3-GUWCSSDP.js +23 -0
  96. package/dist/bin/{shell/chunks/readlink-HMHVGSAM.js → chunks/readlink-URO5XTBB.js} +1 -1
  97. package/dist/bin/{shell/chunks/rg-A3E7YM2A.js → chunks/rg-RVULUPDH.js} +1 -1
  98. package/dist/bin/{shell/chunks/rm-3PLW4O4B.js → chunks/rm-UCUTHC3I.js} +1 -1
  99. package/dist/bin/chunks/{rmdir-DCJ3XJRR.js → rmdir-J3HM7GGM.js} +1 -1
  100. package/dist/bin/{shell/chunks/sed-KJWKB22J.js → chunks/sed-MCLGHZOI.js} +1 -1
  101. package/dist/bin/chunks/{seq-Q4LZ6EXV.js → seq-I54NZE75.js} +1 -1
  102. package/dist/bin/{shell/chunks/sleep-DVFE2GSF.js → chunks/sleep-CV6B4M6W.js} +1 -1
  103. package/dist/bin/chunks/{split-XMXBXL5Q.js → split-VZO7223N.js} +1 -1
  104. package/dist/bin/chunks/{sqlite3-DNH2VLVN.js → sqlite3-HXVFVP4Z.js} +1 -1
  105. package/dist/bin/chunks/sqlite3-worker.js +75 -11
  106. package/dist/bin/chunks/{stat-5PUSTPTK.js → stat-UJ37RBMM.js} +1 -1
  107. package/dist/bin/chunks/{tail-4MB7HHIZ.js → tail-5TSF5YM4.js} +1 -1
  108. package/dist/bin/{shell/chunks/tar-FRDUJZDN.js → chunks/tar-ZGZZDQXO.js} +1 -1
  109. package/dist/bin/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
  110. package/dist/bin/chunks/timeout-ATTDYXLX.js +3 -0
  111. package/dist/bin/chunks/{tr-Z6N34HZM.js → tr-6RPFASYV.js} +1 -1
  112. package/dist/bin/chunks/worker.js +88 -15
  113. package/dist/bin/chunks/{xan-VSF6ZQGZ.js → xan-CCS53B7D.js} +1 -1
  114. package/dist/bin/chunks/{xan-view-UEFBHYVN.js → xan-view-KOXASOEV.js} +1 -1
  115. package/dist/bin/chunks/yes-ELH3XQWY.js +3 -0
  116. package/dist/bin/chunks/yq-GSCDUHGM.js +3 -0
  117. package/dist/bin/just-bash.js +333 -328
  118. package/dist/bin/shell/chunks/awk2-U22OR5B5.js +3 -0
  119. package/dist/bin/{chunks/base64-FLJ4YPHB.js → shell/chunks/base64-2KKH5BCT.js} +1 -1
  120. package/dist/bin/shell/chunks/{cat-2J5MA5PY.js → cat-V45MVNBT.js} +1 -1
  121. package/dist/bin/{chunks/chmod-ZM5WLMZI.js → shell/chunks/chmod-A54R4UUQ.js} +1 -1
  122. package/dist/bin/shell/chunks/chunk-2NJJXU4K.js +27 -0
  123. package/dist/bin/{chunks/chunk-BJRT4VKD.js → shell/chunks/chunk-3LKMI5IX.js} +1 -1
  124. package/dist/bin/{chunks/chunk-4APSDE57.js → shell/chunks/chunk-44SKMHU6.js} +1 -1
  125. package/dist/bin/shell/chunks/{chunk-GRP7L2EL.js → chunk-6DAR25KN.js} +1 -1
  126. package/dist/bin/{chunks/chunk-VGR3NA3H.js → shell/chunks/chunk-723HNGID.js} +1 -1
  127. package/dist/bin/{chunks/chunk-MRPJL3ZK.js → shell/chunks/chunk-7X4QBCFW.js} +1 -1
  128. package/dist/bin/shell/chunks/{chunk-42AMF6EE.js → chunk-ABM5WFEO.js} +1 -1
  129. package/dist/bin/shell/chunks/{chunk-2HFDEZUY.js → chunk-AINNAQBQ.js} +1 -1
  130. package/dist/bin/{chunks/chunk-BPWZ7ADB.js → shell/chunks/chunk-AL7RVSF4.js} +1 -1
  131. package/dist/bin/{chunks/chunk-MHAGHCSO.js → shell/chunks/chunk-ARYCSNJJ.js} +7 -7
  132. package/dist/bin/{chunks/chunk-2INNLNI5.js → shell/chunks/chunk-BJF6B4YW.js} +1 -1
  133. package/dist/bin/{chunks/chunk-BZWGVRFA.js → shell/chunks/chunk-BOXG6XBN.js} +2 -2
  134. package/dist/bin/shell/chunks/chunk-DA3RFNKK.js +17 -0
  135. package/dist/bin/shell/chunks/chunk-DH7M46D3.js +20 -0
  136. package/dist/bin/shell/chunks/{chunk-2ND6MMXN.js → chunk-DTGQQKI2.js} +1 -1
  137. package/dist/bin/shell/chunks/{chunk-YOIFOOGX.js → chunk-ECZAFQ22.js} +1 -1
  138. package/dist/bin/shell/chunks/{chunk-PPVF2N6C.js → chunk-EFS34UUR.js} +1 -1
  139. package/dist/bin/{chunks/chunk-TW2IJRUF.js → shell/chunks/chunk-ENEHPI32.js} +1 -1
  140. package/dist/bin/shell/chunks/chunk-HFW2LXQV.js +13 -0
  141. package/dist/bin/{chunks/chunk-UHNV55NF.js → shell/chunks/chunk-HRKG3ZK2.js} +1 -1
  142. package/dist/bin/shell/chunks/{chunk-74TZ7ZF7.js → chunk-IKUY74NG.js} +1 -1
  143. package/dist/bin/shell/chunks/chunk-ILXMFIYG.js +7 -0
  144. package/dist/bin/shell/chunks/chunk-IMVXTSPG.js +275 -0
  145. package/dist/bin/shell/chunks/chunk-J5L5DJWL.js +3 -0
  146. package/dist/bin/{chunks/chunk-MF3GVFLC.js → shell/chunks/chunk-JKS7WXGR.js} +1 -1
  147. package/dist/bin/{chunks/chunk-XBX7KFWK.js → shell/chunks/chunk-LG6IN6SW.js} +11 -11
  148. package/dist/bin/shell/chunks/chunk-LMFAALLO.js +21 -0
  149. package/dist/bin/{chunks/chunk-DYIBFLS3.js → shell/chunks/chunk-LOU52GPJ.js} +2 -2
  150. package/dist/bin/shell/chunks/{chunk-FB44CW33.js → chunk-M5ZBECGM.js} +1 -1
  151. package/dist/bin/shell/chunks/chunk-MA6BMA4M.js +3 -0
  152. package/dist/bin/shell/chunks/{chunk-Z7QCL4IA.js → chunk-MPQMTLXN.js} +1 -1
  153. package/dist/bin/shell/chunks/{chunk-TIHFGNPS.js → chunk-MUIYG2RB.js} +1 -1
  154. package/dist/bin/shell/chunks/{chunk-PUZGSIMN.js → chunk-NGMFI3RH.js} +1 -1
  155. package/dist/bin/{chunks/chunk-RYQB6GQ7.js → shell/chunks/chunk-NLMTGTSG.js} +1 -1
  156. package/dist/bin/shell/chunks/{chunk-QAYU7HPM.js → chunk-OBVTFHVP.js} +1 -1
  157. package/dist/bin/shell/chunks/{chunk-MNSMZU47.js → chunk-OOKVPG5D.js} +1 -1
  158. package/dist/bin/{chunks/chunk-O2BCKSMK.js → shell/chunks/chunk-PEJXCXSY.js} +1 -1
  159. package/dist/bin/{chunks/chunk-MYEPQX6Y.js → shell/chunks/chunk-PL4EU7Y2.js} +1 -1
  160. package/dist/bin/shell/chunks/{chunk-QFTZKD5O.js → chunk-QCGH2ZOW.js} +1 -1
  161. package/dist/bin/shell/chunks/chunk-QKWMWSV3.js +3 -0
  162. package/dist/bin/{chunks/chunk-ISOWCECJ.js → shell/chunks/chunk-S5Z7DMIE.js} +10 -10
  163. package/dist/bin/{chunks/chunk-OLEQNRKX.js → shell/chunks/chunk-SQ7SZZMW.js} +1 -1
  164. package/dist/bin/{chunks/chunk-44MQ5AXA.js → shell/chunks/chunk-SQUH76NP.js} +1 -1
  165. package/dist/bin/{chunks/chunk-BOYPCOSV.js → shell/chunks/chunk-TGRZ42DS.js} +1 -1
  166. package/dist/bin/shell/chunks/{chunk-LUHU7UUN.js → chunk-THTKNRO6.js} +1 -1
  167. package/dist/bin/shell/chunks/{chunk-VKTV45AP.js → chunk-TQXLQEIT.js} +1 -1
  168. package/dist/bin/{chunks/chunk-2OQ5HPZE.js → shell/chunks/chunk-U6BXPMLD.js} +1 -1
  169. package/dist/bin/shell/chunks/chunk-U6DBRMD5.js +5 -0
  170. package/dist/bin/{chunks/chunk-CC2AQ6B7.js → shell/chunks/chunk-U6JTVQU6.js} +1 -1
  171. package/dist/bin/shell/chunks/chunk-UPUFWGHR.js +3 -0
  172. package/dist/bin/shell/chunks/{chunk-E5VZGTZ6.js → chunk-URRH3GPG.js} +1 -1
  173. package/dist/bin/shell/chunks/{chunk-EXGPMLIE.js → chunk-VBU3UEG5.js} +1 -1
  174. package/dist/bin/shell/chunks/chunk-VGSRQOLD.js +7 -0
  175. package/dist/bin/shell/chunks/{chunk-GTULZ3ZD.js → chunk-WBST7XJW.js} +1 -1
  176. package/dist/bin/shell/chunks/{chunk-ROFYAVPF.js → chunk-WEQ5WM2M.js} +1 -1
  177. package/dist/bin/{chunks/chunk-BCQSUELK.js → shell/chunks/chunk-WZ7MIBLR.js} +1 -1
  178. package/dist/bin/shell/chunks/{chunk-H4BRFPKY.js → chunk-X45GP3AQ.js} +1 -1
  179. package/dist/bin/shell/chunks/chunk-YQEKKZTU.js +12 -0
  180. package/dist/bin/shell/chunks/{chunk-UNKX6YM6.js → chunk-Z3KAV6YJ.js} +1 -1
  181. package/dist/bin/shell/chunks/{chunk-3SCW7PD5.js → chunk-Z5KICK5X.js} +1 -1
  182. package/dist/bin/shell/chunks/{column-7VBJL757.js → column-LHHS4D3K.js} +1 -1
  183. package/dist/bin/{chunks/cp-MF5GADQN.js → shell/chunks/cp-HPLQA35N.js} +1 -1
  184. package/dist/bin/shell/chunks/curl-FIRG3RB6.js +31 -0
  185. package/dist/bin/shell/chunks/{cut-QOTYBJJJ.js → cut-KP3S36XS.js} +1 -1
  186. package/dist/bin/{chunks/diff-YXZZCUSQ.js → shell/chunks/diff-JSJ56EOK.js} +1 -1
  187. package/dist/bin/shell/chunks/dist-4NZ74CRE.js +141 -0
  188. package/dist/bin/shell/chunks/{du-A3UGHIKJ.js → du-WEF5YWQK.js} +1 -1
  189. package/dist/bin/shell/chunks/{expr-TDF3B6QJ.js → expr-FLWT4OCO.js} +1 -1
  190. package/dist/bin/shell/chunks/{file-AJGG7RYT.js → file-JLUCGBCB.js} +1 -1
  191. package/dist/bin/shell/chunks/{find-6DH6TRDN.js → find-XGVQ6N6L.js} +1 -1
  192. package/dist/bin/shell/chunks/flag-coverage-4JYKIAVV.js +3 -0
  193. package/dist/bin/shell/chunks/{grep-WUZMZDGY.js → grep-DCPCPQOS.js} +1 -1
  194. package/dist/bin/shell/chunks/{gzip-JA7JQBUS.js → gzip-6DZIKNBW.js} +1 -1
  195. package/dist/bin/{chunks/head-YGKW3HS4.js → shell/chunks/head-TLFXMM2T.js} +1 -1
  196. package/dist/bin/{chunks/help-HVIDHJ6M.js → shell/chunks/help-EXVKU23F.js} +1 -1
  197. package/dist/bin/shell/chunks/{html-to-markdown-ZWL7LZIP.js → html-to-markdown-E22RLT2U.js} +1 -1
  198. package/dist/bin/shell/chunks/{jq-5MI4V3G5.js → jq-GDM3OBBK.js} +1 -1
  199. package/dist/bin/shell/chunks/js-exec-VU6F6WLS.js +1578 -0
  200. package/dist/bin/shell/chunks/{ln-XSDIE6SU.js → ln-B35EKC2Q.js} +1 -1
  201. package/dist/bin/shell/chunks/{ls-R6DAGGBH.js → ls-67NUUIYT.js} +1 -1
  202. package/dist/bin/shell/chunks/{mkdir-74BP5NTG.js → mkdir-AWDWRBKC.js} +1 -1
  203. package/dist/bin/shell/chunks/mktemp-L6OGMDUO.js +3 -0
  204. package/dist/bin/shell/chunks/{mv-YG75IRRE.js → mv-4BJSOT4Y.js} +1 -1
  205. package/dist/bin/{chunks/od-YCY27MMO.js → shell/chunks/od-SI75GLRE.js} +1 -1
  206. package/dist/bin/shell/chunks/{paste-ACKOG3XS.js → paste-5TSIBDF7.js} +1 -1
  207. package/dist/bin/shell/chunks/python3-GUWCSSDP.js +23 -0
  208. package/dist/bin/{chunks/readlink-HMHVGSAM.js → shell/chunks/readlink-URO5XTBB.js} +1 -1
  209. package/dist/bin/{chunks/rg-A3E7YM2A.js → shell/chunks/rg-RVULUPDH.js} +1 -1
  210. package/dist/bin/{chunks/rm-3PLW4O4B.js → shell/chunks/rm-UCUTHC3I.js} +1 -1
  211. package/dist/bin/shell/chunks/{rmdir-DCJ3XJRR.js → rmdir-J3HM7GGM.js} +1 -1
  212. package/dist/bin/{chunks/sed-KJWKB22J.js → shell/chunks/sed-MCLGHZOI.js} +1 -1
  213. package/dist/bin/shell/chunks/{seq-Q4LZ6EXV.js → seq-I54NZE75.js} +1 -1
  214. package/dist/bin/{chunks/sleep-DVFE2GSF.js → shell/chunks/sleep-CV6B4M6W.js} +1 -1
  215. package/dist/bin/shell/chunks/{split-XMXBXL5Q.js → split-VZO7223N.js} +1 -1
  216. package/dist/bin/shell/chunks/{sqlite3-DNH2VLVN.js → sqlite3-HXVFVP4Z.js} +1 -1
  217. package/dist/bin/shell/chunks/{stat-5PUSTPTK.js → stat-UJ37RBMM.js} +1 -1
  218. package/dist/bin/shell/chunks/{tail-4MB7HHIZ.js → tail-5TSF5YM4.js} +1 -1
  219. package/dist/bin/{chunks/tar-FRDUJZDN.js → shell/chunks/tar-ZGZZDQXO.js} +1 -1
  220. package/dist/bin/shell/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
  221. package/dist/bin/shell/chunks/timeout-ATTDYXLX.js +3 -0
  222. package/dist/bin/shell/chunks/{tr-Z6N34HZM.js → tr-6RPFASYV.js} +1 -1
  223. package/dist/bin/shell/chunks/{xan-VSF6ZQGZ.js → xan-CCS53B7D.js} +1 -1
  224. package/dist/bin/shell/chunks/{xan-view-UEFBHYVN.js → xan-view-KOXASOEV.js} +1 -1
  225. package/dist/bin/shell/chunks/yes-ELH3XQWY.js +3 -0
  226. package/dist/bin/shell/chunks/yq-GSCDUHGM.js +3 -0
  227. package/dist/bin/shell/shell.js +334 -329
  228. package/dist/browser.d.ts +1 -1
  229. package/dist/bundle/browser.js +866 -836
  230. package/dist/bundle/chunks/awk2-V7KYQWCD.js +2 -0
  231. package/dist/bundle/chunks/{base64-2BAITDZF.js → base64-QPSYZAAJ.js} +1 -1
  232. package/dist/bundle/chunks/{cat-33KGN4MZ.js → cat-54BXBS6X.js} +1 -1
  233. package/dist/bundle/chunks/{chmod-APOXUPXW.js → chmod-4OPV4QKK.js} +1 -1
  234. package/dist/bundle/chunks/{chunk-IBRT3OJS.js → chunk-2WBUTDF5.js} +1 -1
  235. package/dist/bundle/chunks/{chunk-WNH3HOQA.js → chunk-353VO5TF.js} +1 -1
  236. package/dist/bundle/chunks/chunk-3HDTNUL3.js +6 -0
  237. package/dist/bundle/chunks/{chunk-XV2V56NQ.js → chunk-3KWM4FFA.js} +1 -1
  238. package/dist/bundle/chunks/{chunk-WXPNKIIH.js → chunk-43OP7DFL.js} +1 -1
  239. package/dist/bundle/chunks/{chunk-DMWNBCXJ.js → chunk-4GEHRJMD.js} +1 -1
  240. package/dist/bundle/chunks/{chunk-3CBCABOZ.js → chunk-4IMUNIUJ.js} +1 -1
  241. package/dist/bundle/chunks/chunk-5BMPT6SF.js +19 -0
  242. package/dist/bundle/chunks/{chunk-XPDOK3XY.js → chunk-5QWGR2WA.js} +1 -1
  243. package/dist/bundle/chunks/{chunk-X3TZEFQG.js → chunk-5UTZMNI5.js} +1 -1
  244. package/dist/bundle/chunks/{chunk-QPZVR6ZN.js → chunk-65LVAUWW.js} +1 -1
  245. package/dist/bundle/chunks/{chunk-YDR2IWKO.js → chunk-72JHTO7E.js} +1 -1
  246. package/dist/bundle/chunks/{chunk-KVG5FR5F.js → chunk-7GA3QWJJ.js} +11 -11
  247. package/dist/bundle/chunks/{chunk-ICQYTW7W.js → chunk-7M672HB6.js} +1 -1
  248. package/dist/bundle/chunks/chunk-B6OSJB22.js +26 -0
  249. package/dist/bundle/chunks/{chunk-N3FZSEG7.js → chunk-BM3X75NC.js} +1 -1
  250. package/dist/bundle/chunks/chunk-CBM6J4AL.js +6 -0
  251. package/dist/bundle/chunks/{chunk-FNEG7DFQ.js → chunk-CGI6V2HW.js} +1 -1
  252. package/dist/bundle/chunks/{chunk-BKUWXPEM.js → chunk-CHWP6GRK.js} +1 -1
  253. package/dist/bundle/chunks/{chunk-UL6YJ7FT.js → chunk-D5ZJISRS.js} +1 -1
  254. package/dist/bundle/chunks/{chunk-TUNYNC46.js → chunk-DIRWTBKE.js} +1 -1
  255. package/dist/bundle/chunks/chunk-DIWMSSQY.js +2 -0
  256. package/dist/bundle/chunks/{chunk-273265WK.js → chunk-DPZVOEUP.js} +1 -1
  257. package/dist/bundle/chunks/chunk-EGTVQWAP.js +20 -0
  258. package/dist/bundle/chunks/{chunk-SI5VPVOA.js → chunk-EXXOLIVE.js} +1 -1
  259. package/dist/bundle/chunks/chunk-GLAFXDZC.js +4 -0
  260. package/dist/bundle/chunks/{chunk-PMYUC5JF.js → chunk-H42OAUJL.js} +1 -1
  261. package/dist/bundle/chunks/chunk-H53EPEGD.js +12 -0
  262. package/dist/bundle/chunks/{chunk-QE275OWT.js → chunk-HDOXCDVK.js} +1 -1
  263. package/dist/bundle/chunks/{chunk-USNDURQI.js → chunk-HIQEVPXM.js} +1 -1
  264. package/dist/bundle/chunks/{chunk-G4SEENI7.js → chunk-M4LDT7V7.js} +1 -1
  265. package/dist/bundle/chunks/{chunk-MHY57JTL.js → chunk-MDE25PQK.js} +1 -1
  266. package/dist/bundle/chunks/{chunk-Q6JV5CBB.js → chunk-MHDZERK4.js} +1 -1
  267. package/dist/bundle/chunks/{chunk-5ELNHAAJ.js → chunk-MHZF23KB.js} +1 -1
  268. package/dist/bundle/chunks/{chunk-LPJEKUCB.js → chunk-N6W6FM4N.js} +1 -1
  269. package/dist/bundle/chunks/{chunk-POIWRLUV.js → chunk-NRLE7KYI.js} +1 -1
  270. package/dist/bundle/chunks/{chunk-MQKGGNPS.js → chunk-NXBUT5V2.js} +2 -2
  271. package/dist/bundle/chunks/{chunk-4HMWZAP7.js → chunk-OB46N7Q7.js} +1 -1
  272. package/dist/bundle/chunks/{chunk-ALOFNPKY.js → chunk-PPHGMG47.js} +2 -2
  273. package/dist/bundle/chunks/{chunk-UXHSH7BM.js → chunk-R6ZGLVXI.js} +1 -1
  274. package/dist/bundle/chunks/chunk-RCRHDT54.js +274 -0
  275. package/dist/bundle/chunks/{chunk-N4TGZ6H7.js → chunk-RIIUVFUS.js} +1 -1
  276. package/dist/bundle/chunks/chunk-RK2WBVP4.js +2 -0
  277. package/dist/bundle/chunks/{chunk-MLIO3BK2.js → chunk-SQX6WQXB.js} +1 -1
  278. package/dist/bundle/chunks/chunk-SRB6FXRH.js +2 -0
  279. package/dist/bundle/chunks/{chunk-7IFSXTCJ.js → chunk-T4INBNHX.js} +1 -1
  280. package/dist/bundle/chunks/{chunk-TVJ6JVK4.js → chunk-TUQG2YRH.js} +1 -1
  281. package/dist/bundle/chunks/{chunk-JA6EY7US.js → chunk-U7UNEMLJ.js} +1 -1
  282. package/dist/bundle/chunks/{chunk-GVKYQN5J.js → chunk-UK2K3DHN.js} +1 -1
  283. package/dist/bundle/chunks/{chunk-HW6ZCMM5.js → chunk-VDJ53ESK.js} +1 -1
  284. package/dist/bundle/chunks/{chunk-WHHRIZS3.js → chunk-VGCXKMXN.js} +1 -1
  285. package/dist/bundle/chunks/chunk-VOQZ5TSL.js +2 -0
  286. package/dist/bundle/chunks/{chunk-R2FBRMDU.js → chunk-VWUMR4IC.js} +1 -1
  287. package/dist/bundle/chunks/chunk-W2Z6LYL6.js +11 -0
  288. package/dist/bundle/chunks/{chunk-CFBEDNHJ.js → chunk-W5J5ADJF.js} +7 -7
  289. package/dist/bundle/chunks/{chunk-V2SOLEQN.js → chunk-XHFP44Y4.js} +1 -1
  290. package/dist/bundle/chunks/{chunk-KIGPB52X.js → chunk-XZ34OGNM.js} +1 -1
  291. package/dist/bundle/chunks/{chunk-A3D7NRT6.js → chunk-Y32R7EZP.js} +10 -10
  292. package/dist/bundle/chunks/chunk-YUFU7O6I.js +16 -0
  293. package/dist/bundle/chunks/{chunk-MFGH46GH.js → chunk-YZH7FUSY.js} +1 -1
  294. package/dist/bundle/chunks/{column-LKMDIDCH.js → column-F5JDBRV6.js} +1 -1
  295. package/dist/bundle/chunks/{cp-FKTQRFYJ.js → cp-LTFB4EUA.js} +1 -1
  296. package/dist/bundle/chunks/curl-XCX2ZQEA.js +30 -0
  297. package/dist/bundle/chunks/{cut-RWPUW5FY.js → cut-IRSHL3BB.js} +1 -1
  298. package/dist/bundle/chunks/{diff-CSARC7WF.js → diff-VDB6RXHO.js} +1 -1
  299. package/dist/bundle/chunks/{du-PR3M44X6.js → du-DOWSRLXR.js} +1 -1
  300. package/dist/bundle/chunks/{expr-UMT2OHZ7.js → expr-GZ4DABKB.js} +1 -1
  301. package/dist/bundle/chunks/{file-VEGKTTSF.js → file-UI6QJAAU.js} +1 -1
  302. package/dist/bundle/chunks/{find-PM3TD7V4.js → find-JTXDH3MR.js} +1 -1
  303. package/dist/bundle/chunks/flag-coverage-EDO3VM43.js +2 -0
  304. package/dist/bundle/chunks/{grep-5UPEO42U.js → grep-OZCR76FT.js} +1 -1
  305. package/dist/bundle/chunks/{gzip-ZINVK3M6.js → gzip-GQC6CWVL.js} +1 -1
  306. package/dist/bundle/chunks/{head-CFENJILH.js → head-J6RVJFRS.js} +1 -1
  307. package/dist/bundle/chunks/{help-QDDMBDU7.js → help-62M75TSG.js} +1 -1
  308. package/dist/bundle/chunks/{html-to-markdown-GGVR4YGL.js → html-to-markdown-7OG5VWYG.js} +1 -1
  309. package/dist/bundle/chunks/{jq-X2P7Q64K.js → jq-FCG2IUBK.js} +1 -1
  310. package/dist/bundle/chunks/js-exec-NDLXDUBN.js +1577 -0
  311. package/dist/bundle/chunks/{ln-VYDFOFNO.js → ln-OPY2ZVGQ.js} +1 -1
  312. package/dist/bundle/chunks/{ls-R5CQLZQM.js → ls-MQTYWW4T.js} +1 -1
  313. package/dist/bundle/chunks/{mkdir-WDDKK2P3.js → mkdir-4A5W3RXH.js} +1 -1
  314. package/dist/bundle/chunks/mktemp-XKIE5N3X.js +2 -0
  315. package/dist/bundle/chunks/{mv-XSJA2FNL.js → mv-ZPIATQJL.js} +1 -1
  316. package/dist/bundle/chunks/{od-BI6XJPXY.js → od-LUHOH7CG.js} +1 -1
  317. package/dist/bundle/chunks/{paste-LLZ3ZQR2.js → paste-U57ZU47S.js} +1 -1
  318. package/dist/bundle/chunks/python3-SDFCGIU4.js +22 -0
  319. package/dist/bundle/chunks/{readlink-IY6QKK2P.js → readlink-YNNS6F7K.js} +1 -1
  320. package/dist/bundle/chunks/{rg-UQE6KUBP.js → rg-F4SX2PHI.js} +1 -1
  321. package/dist/bundle/chunks/{rm-JQ4GDKDD.js → rm-3XUUYAXQ.js} +1 -1
  322. package/dist/bundle/chunks/{rmdir-WZKAT6M5.js → rmdir-OGSEXEF4.js} +1 -1
  323. package/dist/bundle/chunks/{sed-JW2JDLSI.js → sed-MBB5SXGD.js} +1 -1
  324. package/dist/bundle/chunks/{seq-5R2GKXC6.js → seq-IN77HD3S.js} +1 -1
  325. package/dist/bundle/chunks/{sleep-PPRBTSVR.js → sleep-3QNP3BGR.js} +1 -1
  326. package/dist/bundle/chunks/{split-2SD6EP72.js → split-6R2TSQY6.js} +1 -1
  327. package/dist/bundle/chunks/{sqlite3-UVVRYDAL.js → sqlite3-7MBPFI6W.js} +1 -1
  328. package/dist/bundle/chunks/sqlite3-worker.js +75 -11
  329. package/dist/bundle/chunks/{stat-6KILP5AL.js → stat-YLVJ4L67.js} +1 -1
  330. package/dist/bundle/chunks/{tail-BDNMS4FR.js → tail-UGFWX3YY.js} +1 -1
  331. package/dist/bundle/chunks/{tar-6365WH6H.js → tar-BNHPWTOY.js} +1 -1
  332. package/dist/bundle/chunks/{time-NERE2JJ2.js → time-N6J6DC6C.js} +1 -1
  333. package/dist/bundle/chunks/timeout-ZHCL5KTP.js +2 -0
  334. package/dist/bundle/chunks/{tr-3I4MDKIF.js → tr-4NGL47UU.js} +1 -1
  335. package/dist/bundle/chunks/worker.js +88 -15
  336. package/dist/bundle/chunks/{xan-HUOXKUQA.js → xan-7R3I2DJO.js} +1 -1
  337. package/dist/bundle/chunks/xan-view-S4ZILLPU.js +2 -0
  338. package/dist/bundle/chunks/yes-I7SAR7XX.js +2 -0
  339. package/dist/bundle/chunks/yq-IOMBQYB2.js +2 -0
  340. package/dist/bundle/index.cjs +2862 -1489
  341. package/dist/bundle/index.js +349 -344
  342. package/dist/commands/curl/response-formatting.d.ts +2 -2
  343. package/dist/commands/curl/types.d.ts +5 -0
  344. package/dist/commands/diff/format.d.ts +46 -0
  345. package/dist/commands/js-exec/js-exec.d.ts +1 -10
  346. package/dist/commands/js-exec/run-runtime.d.ts +10 -0
  347. package/dist/commands/mktemp/mktemp.d.ts +4 -0
  348. package/dist/commands/registry.d.ts +1 -1
  349. package/dist/commands/sqlite3/worker.js +75 -11
  350. package/dist/commands/worker-request-controller.d.ts +3 -23
  351. package/dist/commands/yes/yes.d.ts +4 -0
  352. package/dist/custom-commands.d.ts +7 -0
  353. package/dist/fs/create-exclusive.d.ts +30 -0
  354. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +8 -1
  355. package/dist/fs/interface.d.ts +37 -0
  356. package/dist/fs/mountable-fs/mountable-fs.d.ts +20 -1
  357. package/dist/fs/overlay-fs/overlay-fs.d.ts +9 -1
  358. package/dist/fs/read-write-fs/read-write-fs.d.ts +27 -1
  359. package/dist/fs/traversal.d.ts +9 -0
  360. package/dist/index.d.cts +1 -1
  361. package/dist/index.d.ts +1 -1
  362. package/dist/interpreter/expansion/array-prefix-suffix.d.ts +2 -1
  363. package/dist/interpreter/expansion/parameter-ops.d.ts +1 -0
  364. package/dist/interpreter/expansion/pattern-removal.d.ts +3 -0
  365. package/dist/interpreter/expansion/variable.d.ts +1 -1
  366. package/dist/interpreter/helpers/loop.d.ts +32 -0
  367. package/dist/interpreter/helpers/substitution-status.d.ts +34 -0
  368. package/dist/interpreter/interpreter.d.ts +1 -1
  369. package/dist/interpreter/types.d.ts +8 -1
  370. package/dist/limits.d.ts +2 -0
  371. package/dist/network/allow-list/shared.d.ts +0 -8
  372. package/dist/network/dns-pin.d.ts +1 -35
  373. package/dist/network/fetch.d.ts +4 -6
  374. package/dist/network/types.d.ts +20 -2
  375. package/dist/security/blocked-globals.d.ts +60 -0
  376. package/dist/security/defense-context.d.ts +13 -0
  377. package/dist/security/defense-in-depth-box.d.ts +361 -0
  378. package/dist/security/index.d.ts +33 -0
  379. package/dist/security/safe-timestamp.d.ts +1 -0
  380. package/dist/security/security-violation-logger.d.ts +99 -0
  381. package/dist/security/trusted-globals.d.ts +25 -0
  382. package/dist/security/types.d.ts +151 -0
  383. package/dist/security/violation-error-message.d.ts +3 -0
  384. package/dist/security/wasm-callback.d.ts +6 -0
  385. package/dist/security/worker-defense-in-depth.d.ts +235 -0
  386. package/dist/transform/pipeline.d.ts +8 -0
  387. package/dist/transform/plugins/command-collector.d.ts +15 -0
  388. package/dist/transform/plugins/tee-plugin.d.ts +40 -0
  389. package/dist/transform/serialize.d.ts +4 -0
  390. package/dist/transform/types.d.ts +18 -0
  391. package/dist/types.d.ts +4 -3
  392. package/dist/worker-lifecycle.d.ts +27 -0
  393. package/package.json +15 -14
  394. package/dist/bin/chunks/awk2-C4A37H5N.js +0 -3
  395. package/dist/bin/chunks/chunk-23OI2XDJ.js +0 -20
  396. package/dist/bin/chunks/chunk-2ORJ5HTY.js +0 -276
  397. package/dist/bin/chunks/chunk-3PCPQIUD.js +0 -3
  398. package/dist/bin/chunks/chunk-7WBCA2BB.js +0 -3
  399. package/dist/bin/chunks/chunk-APV27ZZW.js +0 -21
  400. package/dist/bin/chunks/chunk-CPTQXTBJ.js +0 -3
  401. package/dist/bin/chunks/chunk-FE6GSISP.js +0 -22
  402. package/dist/bin/chunks/chunk-HL7NFZVQ.js +0 -13
  403. package/dist/bin/chunks/chunk-HWI42GQO.js +0 -7
  404. package/dist/bin/chunks/chunk-JQM3DKCH.js +0 -12
  405. package/dist/bin/chunks/chunk-TOTKK2XI.js +0 -16
  406. package/dist/bin/chunks/chunk-YTL6DXBO.js +0 -11
  407. package/dist/bin/chunks/curl-FS5LAEYI.js +0 -30
  408. package/dist/bin/chunks/flag-coverage-DOLZIUQ7.js +0 -3
  409. package/dist/bin/chunks/js-exec-DJQLXWCS.js +0 -99
  410. package/dist/bin/chunks/js-exec-worker.js +0 -4809
  411. package/dist/bin/chunks/python3-JCJHSX4Z.js +0 -14
  412. package/dist/bin/chunks/timeout-YGFHQJKX.js +0 -3
  413. package/dist/bin/chunks/undici-CKF2L2IP.js +0 -141
  414. package/dist/bin/chunks/yq-K5N5JD4N.js +0 -3
  415. package/dist/bin/shell/chunks/awk2-C4A37H5N.js +0 -3
  416. package/dist/bin/shell/chunks/chunk-23OI2XDJ.js +0 -20
  417. package/dist/bin/shell/chunks/chunk-2ORJ5HTY.js +0 -276
  418. package/dist/bin/shell/chunks/chunk-3PCPQIUD.js +0 -3
  419. package/dist/bin/shell/chunks/chunk-7WBCA2BB.js +0 -3
  420. package/dist/bin/shell/chunks/chunk-APV27ZZW.js +0 -21
  421. package/dist/bin/shell/chunks/chunk-CPTQXTBJ.js +0 -3
  422. package/dist/bin/shell/chunks/chunk-FE6GSISP.js +0 -22
  423. package/dist/bin/shell/chunks/chunk-HL7NFZVQ.js +0 -13
  424. package/dist/bin/shell/chunks/chunk-HWI42GQO.js +0 -7
  425. package/dist/bin/shell/chunks/chunk-JQM3DKCH.js +0 -12
  426. package/dist/bin/shell/chunks/chunk-TOTKK2XI.js +0 -16
  427. package/dist/bin/shell/chunks/chunk-YTL6DXBO.js +0 -11
  428. package/dist/bin/shell/chunks/curl-FS5LAEYI.js +0 -30
  429. package/dist/bin/shell/chunks/flag-coverage-DOLZIUQ7.js +0 -3
  430. package/dist/bin/shell/chunks/js-exec-DJQLXWCS.js +0 -99
  431. package/dist/bin/shell/chunks/python3-JCJHSX4Z.js +0 -14
  432. package/dist/bin/shell/chunks/timeout-YGFHQJKX.js +0 -3
  433. package/dist/bin/shell/chunks/undici-CKF2L2IP.js +0 -141
  434. package/dist/bin/shell/chunks/yq-K5N5JD4N.js +0 -3
  435. package/dist/bundle/chunks/awk2-NPLZQ3K7.js +0 -2
  436. package/dist/bundle/chunks/chunk-6DTD75TR.js +0 -275
  437. package/dist/bundle/chunks/chunk-6KK46B7Q.js +0 -12
  438. package/dist/bundle/chunks/chunk-AH7VTVWU.js +0 -2
  439. package/dist/bundle/chunks/chunk-BRJERIF4.js +0 -2
  440. package/dist/bundle/chunks/chunk-ELHOZMBD.js +0 -10
  441. package/dist/bundle/chunks/chunk-INDA53JL.js +0 -21
  442. package/dist/bundle/chunks/chunk-KBXRZGTY.js +0 -15
  443. package/dist/bundle/chunks/chunk-N3A4JVFJ.js +0 -2
  444. package/dist/bundle/chunks/chunk-UTKGYVUZ.js +0 -7
  445. package/dist/bundle/chunks/chunk-XMMV24SP.js +0 -20
  446. package/dist/bundle/chunks/chunk-YJKHREBZ.js +0 -11
  447. package/dist/bundle/chunks/chunk-ZBUZKIPX.js +0 -6
  448. package/dist/bundle/chunks/curl-DEHFBW27.js +0 -29
  449. package/dist/bundle/chunks/flag-coverage-I6UJUKQ4.js +0 -2
  450. package/dist/bundle/chunks/js-exec-XKF2B7C3.js +0 -98
  451. package/dist/bundle/chunks/js-exec-worker.js +0 -4809
  452. package/dist/bundle/chunks/python3-F5S5TYGS.js +0 -13
  453. package/dist/bundle/chunks/timeout-C6WDYPLV.js +0 -2
  454. package/dist/bundle/chunks/undici-PSPBDOYF.js +0 -140
  455. package/dist/bundle/chunks/xan-view-RT2WKDOQ.js +0 -2
  456. package/dist/bundle/chunks/yq-MI27NZ2U.js +0 -2
  457. package/dist/commands/js-exec/js-exec-worker.d.ts +0 -33
@@ -2,9 +2,9 @@
2
2
  * Utility functions for curl command
3
3
  */
4
4
  /**
5
- * Format response headers for output
5
+ * Status line + headers + trailing blank line, matching `-i` / `-D` layout.
6
6
  */
7
- export declare function formatHeaders(headers: Record<string, string>): string;
7
+ export declare function formatHeaderBlock(status: number, statusText: string, headers: Record<string, string>): string;
8
8
  /**
9
9
  * Extract filename from URL for -O option
10
10
  */
@@ -50,6 +50,11 @@ export interface CurlOptions {
50
50
  uploadFile?: string;
51
51
  cookieJar?: string;
52
52
  outputFile?: string;
53
+ /**
54
+ * `-D` / `--dump-header` destination. `"-"` writes headers to stdout;
55
+ * any other string is a VFS path. Undefined when the flag was not given.
56
+ */
57
+ dumpHeader?: string;
53
58
  useRemoteName: boolean;
54
59
  headOnly: boolean;
55
60
  includeHeaders: boolean;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Output formatters for diff.
3
+ *
4
+ * The three formats GNU diff can produce: POSIX normal format (the default),
5
+ * unified format (-u) and context format (-c). Layout was derived by running
6
+ * GNU diffutils 3.12 and matching the bytes it emits.
7
+ *
8
+ * Two intentional deviations from GNU:
9
+ *
10
+ * - The -u/-c file header carries no timestamp. GNU appends a tab and the
11
+ * file's mtime; inside a virtual filesystem that is often synthetic or
12
+ * absent, and it would make output non-reproducible. Patch consumers ignore
13
+ * the field.
14
+ * - When several minimal edit scripts exist for the same pair of files, which
15
+ * one comes out is arbitrary, and this picks a different one than GNU on
16
+ * some inputs. Hunks are still minimal and the formats are exact; only the
17
+ * grouping of ambiguous changes can differ.
18
+ */
19
+ /** Number of context lines GNU shows around a change for -u and -c. */
20
+ export declare const DEFAULT_CONTEXT = 3;
21
+ export interface FileLines {
22
+ /** Lines with their trailing newline stripped. */
23
+ lines: string[];
24
+ /** True when the last line is not newline-terminated. */
25
+ noEol: boolean;
26
+ }
27
+ /**
28
+ * A run of adjacent deleted and/or inserted lines. Starts are 0-based indices
29
+ * into the corresponding `FileLines.lines`.
30
+ */
31
+ export interface Change {
32
+ oldStart: number;
33
+ oldCount: number;
34
+ newStart: number;
35
+ newCount: number;
36
+ }
37
+ /** Splits file content into lines, remembering a missing final newline. */
38
+ export declare function splitLines(content: string): FileLines;
39
+ /** Computes the runs of deleted and/or inserted lines between two files. */
40
+ export declare function computeChanges(oldFile: FileLines, newFile: FileLines, ignoreCase: boolean): Change[];
41
+ /** POSIX normal format: `2c2` / `< old` / `---` / `> new`. */
42
+ export declare function formatNormal(oldFile: FileLines, newFile: FileLines, changes: Change[]): string;
43
+ /** Unified format (-u): `--- old`, `+++ new`, `@@` hunks. */
44
+ export declare function formatUnified(oldName: string, newName: string, oldFile: FileLines, newFile: FileLines, changes: Change[], context: number): string;
45
+ /** Context format (-c): `*** old`, `--- new`, `***************` hunks. */
46
+ export declare function formatContext(oldName: string, newName: string, oldFile: FileLines, newFile: FileLines, changes: Change[], context: number): string;
@@ -1,13 +1,4 @@
1
- /**
2
- * js-exec - Execute JavaScript code via QuickJS (WASM)
3
- *
4
- * Runs JavaScript code in an isolated worker thread with access to the
5
- * virtual filesystem, HTTP, and sub-shell execution via SharedArrayBuffer bridge.
6
- *
7
- * This command is Node.js only (uses worker_threads).
8
- */
1
+ /** js-exec - Execute JavaScript code via the run package. */
9
2
  import type { RuntimeCommand } from "../../types.js";
10
- /** @internal Reset singleton worker state — for focused protocol tests only. */
11
- export declare function _resetJsExecWorkerForTests(): void;
12
3
  export declare const jsExecCommand: RuntimeCommand;
13
4
  export declare const nodeStubCommand: RuntimeCommand;
@@ -0,0 +1,10 @@
1
+ import type { ExecResult, RuntimeCommandContext } from "../../types.js";
2
+ interface RunJsOptions {
3
+ source: string;
4
+ scriptPath: string;
5
+ scriptArgs: string[];
6
+ bootstrapCode?: string;
7
+ isModule: boolean;
8
+ }
9
+ export declare function executeWithRun(options: RunJsOptions, ctx: RuntimeCommandContext): Promise<ExecResult>;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { RuntimeCommand } from "../../types.js";
2
+ export declare const mktempCommand: RuntimeCommand;
3
+ import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
4
+ export declare const flagsForFuzzing: CommandFuzzInfo;
@@ -1,6 +1,6 @@
1
1
  import type { RuntimeCommand } from "../types.js";
2
2
  /** All available built-in command names (excludes network commands) */
3
- export type CommandName = "echo" | "cat" | "printf" | "ls" | "mkdir" | "rmdir" | "touch" | "rm" | "cp" | "mv" | "ln" | "chmod" | "pwd" | "readlink" | "head" | "tail" | "wc" | "stat" | "grep" | "fgrep" | "egrep" | "rg" | "sed" | "awk" | "sort" | "uniq" | "comm" | "cut" | "paste" | "tr" | "rev" | "nl" | "fold" | "expand" | "unexpand" | "strings" | "split" | "column" | "join" | "tee" | "find" | "basename" | "dirname" | "tree" | "du" | "env" | "printenv" | "alias" | "unalias" | "history" | "xargs" | "true" | "false" | "clear" | "bash" | "sh" | "jq" | "base64" | "diff" | "date" | "sleep" | "timeout" | "seq" | "expr" | "md5sum" | "sha1sum" | "sha256sum" | "file" | "html-to-markdown" | "help" | "which" | "tac" | "hostname" | "od" | "gzip" | "gunzip" | "zcat" | "tar" | "yq" | "xan" | "sqlite3" | "time" | "whoami";
3
+ export type CommandName = "echo" | "cat" | "printf" | "ls" | "mkdir" | "mktemp" | "rmdir" | "touch" | "rm" | "cp" | "mv" | "ln" | "chmod" | "pwd" | "readlink" | "head" | "tail" | "wc" | "stat" | "grep" | "fgrep" | "egrep" | "rg" | "sed" | "awk" | "sort" | "uniq" | "comm" | "cut" | "paste" | "tr" | "rev" | "nl" | "fold" | "expand" | "unexpand" | "strings" | "split" | "column" | "join" | "tee" | "find" | "basename" | "dirname" | "tree" | "du" | "env" | "printenv" | "alias" | "unalias" | "history" | "xargs" | "true" | "false" | "yes" | "clear" | "bash" | "sh" | "jq" | "base64" | "diff" | "date" | "sleep" | "timeout" | "seq" | "expr" | "md5sum" | "sha1sum" | "sha256sum" | "file" | "html-to-markdown" | "help" | "which" | "tac" | "hostname" | "od" | "gzip" | "gunzip" | "zcat" | "tar" | "yq" | "xan" | "sqlite3" | "time" | "whoami";
4
4
  /** Network command names (only available when network is configured) */
5
5
  export type NetworkCommandName = "curl";
6
6
  /** Python command names (only available when python is explicitly enabled) */
@@ -634,6 +634,13 @@ var WorkerDefenseInDepth = class {
634
634
  config;
635
635
  isActivated = false;
636
636
  originalDescriptors = [];
637
+ /**
638
+ * Restores the native accessor backing slot for module methods patched via
639
+ * their setter (see protectModuleMethod). Restoring the descriptor alone
640
+ * does not clear that slot, since the runtime's setter, not the descriptor
641
+ * shape, is what tracks the active override.
642
+ */
643
+ moduleAccessorResets = [];
637
644
  patchFailures = [];
638
645
  violations = [];
639
646
  executionId;
@@ -1548,9 +1555,9 @@ var WorkerDefenseInDepth = class {
1548
1555
  if (descriptor.configurable === false && descriptor.writable === false) {
1549
1556
  throw new Error("method is non-configurable and non-writable");
1550
1557
  }
1551
- const proxy = new this.originalProxy(
1552
- original,
1553
- {
1558
+ const wrap = (fn) => (
1559
+ // @banned-pattern-ignore: intentional Proxy usage for security blocking
1560
+ new self.originalProxy(fn, {
1554
1561
  apply(target, thisArg, args) {
1555
1562
  const message = `${path} is blocked in worker context`;
1556
1563
  const violation = self.recordViolation(
@@ -1563,20 +1570,70 @@ var WorkerDefenseInDepth = class {
1563
1570
  }
1564
1571
  return Reflect.apply(target, thisArg, args);
1565
1572
  }
1566
- }
1573
+ })
1567
1574
  );
1575
+ const proxy = wrap(original);
1568
1576
  this.originalDescriptors.push({
1569
1577
  target: ModuleClass,
1570
1578
  prop,
1571
1579
  descriptor
1572
1580
  });
1573
- Object.defineProperty(ModuleClass, prop, {
1574
- ...descriptor,
1575
- value: proxy
1576
- });
1577
- const installed = Object.getOwnPropertyDescriptor(ModuleClass, prop);
1578
- if (ModuleClass[prop] !== proxy || installed?.value !== proxy) {
1579
- throw new Error("installed patch failed verification");
1581
+ if ("value" in descriptor) {
1582
+ Object.defineProperty(ModuleClass, prop, {
1583
+ ...descriptor,
1584
+ value: proxy
1585
+ });
1586
+ const installed = Object.getOwnPropertyDescriptor(ModuleClass, prop);
1587
+ if (ModuleClass[prop] !== proxy || installed?.value !== proxy) {
1588
+ throw new Error("installed patch failed verification");
1589
+ }
1590
+ } else {
1591
+ const originalGet = descriptor.get;
1592
+ const originalSet = descriptor.set;
1593
+ if (typeof originalSet !== "function") {
1594
+ throw new Error(
1595
+ "accessor has no setter to install protection through"
1596
+ );
1597
+ }
1598
+ this.moduleAccessorResets.push(() => {
1599
+ originalSet.call(ModuleClass, original);
1600
+ });
1601
+ const guardedDescriptor = {
1602
+ configurable: descriptor.configurable,
1603
+ enumerable: descriptor.enumerable,
1604
+ get: originalGet,
1605
+ set: (next) => {
1606
+ const message = `${path} modification is blocked in worker context`;
1607
+ const violation = self.recordViolation(
1608
+ violationType,
1609
+ path,
1610
+ message
1611
+ );
1612
+ if (!auditMode) {
1613
+ throw new WorkerSecurityViolationError(message, violation);
1614
+ }
1615
+ const wrapped = typeof next === "function" ? wrap(next) : next;
1616
+ const previous = originalGet?.call(ModuleClass);
1617
+ try {
1618
+ install(wrapped);
1619
+ } catch (error) {
1620
+ install(previous);
1621
+ throw error;
1622
+ }
1623
+ }
1624
+ };
1625
+ const install = (value) => {
1626
+ try {
1627
+ originalSet.call(ModuleClass, value);
1628
+ } finally {
1629
+ Object.defineProperty(ModuleClass, prop, guardedDescriptor);
1630
+ }
1631
+ const installed = Object.getOwnPropertyDescriptor(ModuleClass, prop);
1632
+ if (installed?.get !== guardedDescriptor.get || installed?.set !== guardedDescriptor.set || originalGet?.call(ModuleClass) !== value || ModuleClass[prop] !== value) {
1633
+ throw new Error("installed patch failed accessor verification");
1634
+ }
1635
+ };
1636
+ install(proxy);
1580
1637
  }
1581
1638
  } catch {
1582
1639
  this.patchFailures.push(path);
@@ -1633,6 +1690,13 @@ var WorkerDefenseInDepth = class {
1633
1690
  * Restore all original values.
1634
1691
  */
1635
1692
  restorePatches() {
1693
+ for (let i = this.moduleAccessorResets.length - 1; i >= 0; i--) {
1694
+ try {
1695
+ this.moduleAccessorResets[i]();
1696
+ } catch {
1697
+ }
1698
+ }
1699
+ this.moduleAccessorResets = [];
1636
1700
  for (let i = this.originalDescriptors.length - 1; i >= 0; i--) {
1637
1701
  const { target, prop, descriptor } = this.originalDescriptors[i];
1638
1702
  try {
@@ -1,36 +1,16 @@
1
- import type { Worker } from "node:worker_threads";
2
- type CancelReason = "abort" | "timeout";
1
+ import { WorkerLifecycle } from "../worker-lifecycle.js";
3
2
  export interface WorkerRequestControllerOptions {
4
3
  commandName: string;
5
4
  timeoutMs: number;
6
5
  signal?: AbortSignal;
7
6
  maxMessageBytes: number;
8
7
  }
9
- /**
10
- * Execution-owned lifecycle for a single worker request. Queue implementations
11
- * remain command-specific, but cancellation is armed before enqueueing and all
12
- * request-owned listeners/timers are removed exactly once.
13
- */
14
- export declare class WorkerRequestController {
8
+ /** Node worker request lifecycle with protocol authentication and message limits. */
9
+ export declare class WorkerRequestController extends WorkerLifecycle {
15
10
  private readonly options;
16
11
  readonly protocolToken: string;
17
- readonly deadline: number;
18
- private readonly cleanups;
19
- private cancelHandler;
20
- private canceledReason;
21
- private closed;
22
12
  constructor(options: WorkerRequestControllerOptions);
23
- /** Arm cancellation before the caller makes the request visible in a queue. */
24
- arm(onCancel: (reason: CancelReason) => void): void;
25
- get isCanceled(): boolean;
26
- remainingTimeMs(): number;
27
- timeoutMessage(noun?: string): string;
28
- abortMessage(): string;
29
13
  assertMessageSize(value: unknown, direction: "request" | "response"): void;
30
- terminate(worker: Worker | null | undefined): Promise<boolean>;
31
- close(): void;
32
- private cancel;
33
14
  }
34
15
  /** Conservative, allocation-free estimate for structured-clone payloads. */
35
16
  export declare function estimateMessageBytes(value: unknown, stopAfter: number): number;
36
- export {};
@@ -0,0 +1,4 @@
1
+ import type { RuntimeCommand } from "../../types.js";
2
+ export declare const yesCommand: RuntimeCommand;
3
+ import type { CommandFuzzInfo } from "../fuzz-flags-types.js";
4
+ export declare const flagsForFuzzing: CommandFuzzInfo;
@@ -61,5 +61,12 @@ export declare function defineCommand(name: string, execute: (args: string[], ct
61
61
  /**
62
62
  * Create a lazy-loaded wrapper for a custom command.
63
63
  * The command is only loaded when first executed.
64
+ *
65
+ * The load is shared, and waiters can detach from it. Both properties matter
66
+ * once an invocation can be cancelled: a cancelled waiter must not start a
67
+ * competing load, and it must not stay attached to a load that may never
68
+ * settle. Keeping only the waiter's own promise lets a cancelled waiter be
69
+ * collected instead of being retained by the shared load, so repeated
70
+ * cancellations cannot accumulate.
64
71
  */
65
72
  export declare function createLazyCustomCommand(lazy: LazyCommand): Command;
@@ -0,0 +1,30 @@
1
+ import type { CreateExclusiveOptions, IFileSystem } from "./interface.js";
2
+ /**
3
+ * Thrown when the filesystem cannot create an entry atomically, either
4
+ * because it does not implement `createExclusive` or because a delegating
5
+ * filesystem routes to a backend that does not.
6
+ *
7
+ * This is a type rather than an error message because backend errors embed
8
+ * the caller-supplied path: matching text would let a template containing the
9
+ * literal "ENOSYS" turn a genuine EEXIST into a spurious "unsupported".
10
+ */
11
+ export declare class ExclusiveCreateUnsupportedError extends Error {
12
+ readonly code = "ENOSYS";
13
+ constructor(path: string, syscall: string);
14
+ }
15
+ /**
16
+ * Create a file or directory that must not already exist, with `mode` applied
17
+ * at creation time.
18
+ *
19
+ * There is deliberately no fallback for filesystems lacking
20
+ * `createExclusive`. Exclusivity and privacy cannot be synthesised from
21
+ * separate check, create and chmod calls: between them a concurrent actor can
22
+ * take the name and have its entry truncated, or install a symlink so the
23
+ * write lands on its target, and the entry is briefly readable at the
24
+ * backend's default mode either way. A caller asking for an exclusive private
25
+ * entry that silently received a racy one is worse off than a caller told the
26
+ * filesystem cannot provide it, so this fails loudly instead.
27
+ *
28
+ * @throws ExclusiveCreateUnsupportedError if the filesystem cannot do this
29
+ */
30
+ export declare function createExclusiveOn(fs: Pick<IFileSystem, "createExclusive">, path: string, options: CreateExclusiveOptions): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { type ByteString } from "../../encoding.js";
2
- import type { BufferEncoding, CpOptions, DirectoryEntry, DirentEntry, FileContent, FileEntry, FsEntry, FsStat, IFileSystem, InitialFiles, LazyFileEntry, MkdirOptions, ReadFileOptions, RmOptions, SymlinkEntry, WriteFileOptions } from "../interface.js";
2
+ import type { BufferEncoding, CpOptions, CreateExclusiveOptions, DirectoryEntry, DirentEntry, FileContent, FileEntry, FsEntry, FsStat, IFileSystem, InitialFiles, LazyFileEntry, MkdirOptions, ReadFileOptions, RmOptions, SymlinkEntry, WriteFileOptions } from "../interface.js";
3
3
  export type { BufferEncoding, FileContent, FileEntry, LazyFileEntry, DirectoryEntry, SymlinkEntry, FsEntry, FsStat, IFileSystem, };
4
4
  export interface FsData {
5
5
  [path: string]: FsEntry;
@@ -68,6 +68,13 @@ export declare class InMemoryFs implements IFileSystem {
68
68
  */
69
69
  private resolvePathWithSymlinks;
70
70
  mkdir(path: string, options?: MkdirOptions): Promise<void>;
71
+ /**
72
+ * Atomically create a private file or directory that must not already
73
+ * exist. Execution is single-threaded, so the existence check and the
74
+ * insert cannot be interleaved; `this.data` is keyed by normalized path, so
75
+ * a symlink occupying the name is seen as a collision rather than followed.
76
+ */
77
+ createExclusive(path: string, options: CreateExclusiveOptions): Promise<void>;
71
78
  /**
72
79
  * Synchronous version of mkdir
73
80
  */
@@ -77,6 +77,20 @@ export interface FsStat {
77
77
  export interface MkdirOptions {
78
78
  recursive?: boolean;
79
79
  }
80
+ /**
81
+ * Options for createExclusive operation
82
+ */
83
+ export interface CreateExclusiveOptions {
84
+ /**
85
+ * Permission bits applied at creation time, e.g. 0o600 for a private file
86
+ * or 0o700 for a private directory. Applied by the creating syscall itself
87
+ * (subject to umask) so the entry is never briefly visible with the
88
+ * backend's default mode.
89
+ */
90
+ mode: number;
91
+ /** Create a directory instead of an empty regular file. */
92
+ directory?: boolean;
93
+ }
80
94
  /**
81
95
  * Options for rm operation
82
96
  */
@@ -151,6 +165,29 @@ export interface IFileSystem {
151
165
  * @throws Error if parent doesn't exist (unless recursive) or path exists
152
166
  */
153
167
  mkdir(path: string, options?: MkdirOptions): Promise<void>;
168
+ /**
169
+ * Atomically create a file or directory that must not already exist, with
170
+ * `options.mode` applied by the creating operation itself.
171
+ *
172
+ * This is the primitive `mktemp`-style callers need: a plain
173
+ * `exists()`-then-`writeFile()` sequence is a TOCTOU race (a concurrent
174
+ * creator can win between the two calls and have its entry truncated), and
175
+ * a `writeFile()`-then-`chmod()` sequence exposes the entry with the
176
+ * backend's default mode (typically 0644/0755) until the chmod lands.
177
+ *
178
+ * The final path component is never followed: a symlink already occupying
179
+ * the name is a collision, not a target to write through.
180
+ *
181
+ * Optional for backwards compatibility with external `IFileSystem`
182
+ * implementations written before this method existed; all built-in
183
+ * filesystems implement it. Callers should route through
184
+ * `createExclusiveOn`, which reports a filesystem that cannot do this
185
+ * rather than substituting a non-atomic sequence.
186
+ *
187
+ * @throws Error with an `EEXIST:` message if the path already exists
188
+ * @throws Error with an `ENOENT:` message if the parent does not exist
189
+ */
190
+ createExclusive?(path: string, options: CreateExclusiveOptions): Promise<void>;
154
191
  /**
155
192
  * Read directory contents
156
193
  * @returns Array of entry names (not full paths)
@@ -1,5 +1,5 @@
1
1
  import { type ByteString } from "../../encoding.js";
2
- import type { BufferEncoding, CpOptions, FileContent, FsStat, IFileSystem, MkdirOptions, ReadFileOptions, RmOptions, WriteFileOptions } from "../interface.js";
2
+ import type { BufferEncoding, CpOptions, CreateExclusiveOptions, FileContent, FsStat, IFileSystem, MkdirOptions, ReadFileOptions, RmOptions, WriteFileOptions } from "../interface.js";
3
3
  /**
4
4
  * Configuration for a mount point
5
5
  */
@@ -89,6 +89,25 @@ export declare class MountableFs implements IFileSystem {
89
89
  stat(path: string): Promise<FsStat>;
90
90
  lstat(path: string): Promise<FsStat>;
91
91
  mkdir(path: string, options?: MkdirOptions): Promise<void>;
92
+ /**
93
+ * Atomically create a private file or directory on the owning filesystem.
94
+ * Mount points are existing directories, so a create targeting one is a
95
+ * collision. Delegated exclusivity is only as strong as the target
96
+ * filesystem provides; an external implementation predating
97
+ * `createExclusive` reports ENOSYS so callers can pick a fallback rather
98
+ * than silently getting non-exclusive creation.
99
+ */
100
+ createExclusive(path: string, options: CreateExclusiveOptions): Promise<void>;
101
+ /**
102
+ * Synchronous mkdir, routed to the filesystem that owns the path.
103
+ * @throws Error if that filesystem has no synchronous writes
104
+ */
105
+ mkdirSync(path: string, options?: MkdirOptions): void;
106
+ /**
107
+ * Synchronous writeFile, routed to the filesystem that owns the path.
108
+ * @throws Error if that filesystem has no synchronous writes
109
+ */
110
+ writeFileSync(path: string, content: string | Uint8Array): void;
92
111
  readdir(path: string): Promise<string[]>;
93
112
  rm(path: string, options?: RmOptions): Promise<void>;
94
113
  cp(src: string, dest: string, options?: CpOptions): Promise<void>;
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { type ByteString } from "../../encoding.js";
14
14
  import { type FileContent } from "../encoding.js";
15
- import type { CpOptions, DirentEntry, FsStat, IFileSystem, MkdirOptions, ReadFileOptions, RmOptions, WriteFileOptions } from "../interface.js";
15
+ import type { CpOptions, CreateExclusiveOptions, DirentEntry, FsStat, IFileSystem, MkdirOptions, ReadFileOptions, RmOptions, WriteFileOptions } from "../interface.js";
16
16
  export interface OverlayFsOptions {
17
17
  /**
18
18
  * The root directory on the real filesystem.
@@ -146,6 +146,14 @@ export declare class OverlayFs implements IFileSystem {
146
146
  * the resolved target doesn't exist (security - broken symlinks return []).
147
147
  */
148
148
  private resolveForReaddir;
149
+ /**
150
+ * Atomically create a private file or directory that must not already
151
+ * exist. Overlay writes land in the in-memory layer, and JS execution is
152
+ * single-threaded, so the existence check and the insert cannot interleave.
153
+ * The new entry shadows anything on the real filesystem underneath, so a
154
+ * symlink already occupying the name is never written through.
155
+ */
156
+ createExclusive(path: string, options: CreateExclusiveOptions): Promise<void>;
149
157
  readdir(path: string): Promise<string[]>;
150
158
  readdirWithFileTypes(path: string): Promise<DirentEntry[]>;
151
159
  rm(path: string, options?: RmOptions): Promise<void>;
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { type ByteString } from "../../encoding.js";
14
14
  import { type FileContent } from "../encoding.js";
15
- import type { CpOptions, DirentEntry, FsStat, IFileSystem, MkdirOptions, ReadFileOptions, RmOptions, WriteFileOptions } from "../interface.js";
15
+ import type { CpOptions, CreateExclusiveOptions, DirentEntry, FsStat, IFileSystem, MkdirOptions, ReadFileOptions, RmOptions, WriteFileOptions } from "../interface.js";
16
16
  export interface ReadWriteFsOptions {
17
17
  /**
18
18
  * The root directory on the real filesystem.
@@ -65,6 +65,8 @@ export declare class ReadWriteFs implements IFileSystem {
65
65
  * Validate the parent directory of a path (for operations like lstat/readlink
66
66
  * that should not follow the final component's symlink).
67
67
  * Returns the canonical parent joined with the original basename.
68
+ * The root's parent is outside the sandbox and always fails this check,
69
+ * so callers that accept the root validate it with resolveAndValidate().
68
70
  */
69
71
  private validateParent;
70
72
  /**
@@ -95,6 +97,30 @@ export declare class ReadWriteFs implements IFileSystem {
95
97
  stat(path: string): Promise<FsStat>;
96
98
  lstat(path: string): Promise<FsStat>;
97
99
  mkdir(path: string, options?: MkdirOptions): Promise<void>;
100
+ /**
101
+ * Atomically create a private file or directory that must not already
102
+ * exist. `O_CREAT|O_EXCL` (and `mkdir`) are exclusive in the kernel, so a
103
+ * concurrent host process cannot win a race between a check and the create,
104
+ * and the mode is applied by the creating syscall rather than a later
105
+ * chmod — the entry is never on disk with the default 0644/0755. POSIX
106
+ * requires `O_EXCL` to fail on a symlink at the final component, so a
107
+ * pre-planted link is a collision instead of a write-through target.
108
+ */
109
+ createExclusive(path: string, options: CreateExclusiveOptions): Promise<void>;
110
+ /**
111
+ * Confirm that what was just created is the entry the validated path still
112
+ * denotes, and that it is still inside the root.
113
+ *
114
+ * O_EXCL and O_NOFOLLOW only bind the final component. A concurrent host
115
+ * process can swap an *intermediate* directory for a symlink between the
116
+ * parent validation and the create, which would place the new entry outside
117
+ * the sandbox. Re-resolving afterwards detects that, and comparing
118
+ * device/inode detects a swap of the entry itself. On failure the entry is
119
+ * removed on a best-effort basis before the error surfaces, so a swap does
120
+ * not leave a stray file behind.
121
+ */
122
+ private assertCreatedInsideRoot;
123
+ private createExclusiveUnlocked;
98
124
  private mkdirUnlocked;
99
125
  readdir(path: string): Promise<string[]>;
100
126
  readdirWithFileTypes(path: string): Promise<DirentEntry[]>;
@@ -67,6 +67,15 @@ export declare class FileTraversalBudget {
67
67
  constructor(options: TraversalBudgetOptions);
68
68
  checkpoint(work?: number): void;
69
69
  visit(depth: number): void;
70
+ /**
71
+ * Reserve directory children against the entry ceiling without charging for
72
+ * work not yet done. A single readdir can return far more entries than the
73
+ * traversal is allowed to retain, so the collection has to be admitted
74
+ * before it is held, but reading a directory is one filesystem operation
75
+ * however many names come back. Callers that go on to touch each child
76
+ * should use `discover` instead, which also charges the work.
77
+ */
78
+ reserve(count: number): void;
70
79
  /**
71
80
  * Reserve directory children before retaining work items for them. A single
72
81
  * readdir can return far more entries than the traversal is allowed to
package/dist/index.d.cts CHANGED
@@ -8,7 +8,7 @@ export { createCommandContext, defineCommand, } from "./custom-commands.js";
8
8
  export type { ByteString, OutputKind } from "./encoding.js";
9
9
  export { bytesOutput, decodeBytesToUtf8, EMPTY_BYTES, encodeUtf8ToBytes, latin1FromBytes, stdoutAsBytes, stdoutKind, textOutput, unsafeBytesFromLatin1, } from "./encoding.js";
10
10
  export { InMemoryFs } from "./fs/in-memory-fs/index.js";
11
- export type { BufferEncoding, CpOptions, DirectoryEntry, FileContent, FileEntry, FileInit, FileSystemFactory, FsEntry, FsStat, InitialFiles, LazyFileEntry, LazyFileProvider, MkdirOptions, RmOptions, SymlinkEntry, } from "./fs/interface.js";
11
+ export type { BufferEncoding, CpOptions, CreateExclusiveOptions, DirectoryEntry, FileContent, FileEntry, FileInit, FileSystemFactory, FsEntry, FsStat, InitialFiles, LazyFileEntry, LazyFileProvider, MkdirOptions, RmOptions, SymlinkEntry, } from "./fs/interface.js";
12
12
  export { MountableFs, type MountableFsOptions, type MountConfig, } from "./fs/mountable-fs/index.js";
13
13
  export { OverlayFs, type OverlayFsOptions } from "./fs/overlay-fs/index.js";
14
14
  export { ReadWriteFs, type ReadWriteFsOptions, } from "./fs/read-write-fs/index.js";
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { createCommandContext, defineCommand, } from "./custom-commands.js";
8
8
  export type { ByteString, OutputKind } from "./encoding.js";
9
9
  export { bytesOutput, decodeBytesToUtf8, EMPTY_BYTES, encodeUtf8ToBytes, latin1FromBytes, stdoutAsBytes, stdoutKind, textOutput, unsafeBytesFromLatin1, } from "./encoding.js";
10
10
  export { InMemoryFs } from "./fs/in-memory-fs/index.js";
11
- export type { BufferEncoding, CpOptions, DirectoryEntry, FileContent, FileEntry, FileInit, FileSystemFactory, FsEntry, FsStat, InitialFiles, LazyFileEntry, LazyFileProvider, MkdirOptions, RmOptions, SymlinkEntry, } from "./fs/interface.js";
11
+ export type { BufferEncoding, CpOptions, CreateExclusiveOptions, DirectoryEntry, FileContent, FileEntry, FileInit, FileSystemFactory, FsEntry, FsStat, InitialFiles, LazyFileEntry, LazyFileProvider, MkdirOptions, RmOptions, SymlinkEntry, } from "./fs/interface.js";
12
12
  export { MountableFs, type MountableFsOptions, type MountConfig, } from "./fs/mountable-fs/index.js";
13
13
  export { OverlayFs, type OverlayFsOptions } from "./fs/overlay-fs/index.js";
14
14
  export { ReadWriteFs, type ReadWriteFsOptions, } from "./fs/read-write-fs/index.js";
@@ -26,8 +26,9 @@ export type ExpandPartFn = (ctx: InterpreterContext, part: WordPart) => Promise<
26
26
  */
27
27
  export type ExpandWordPartsAsyncFn = (ctx: InterpreterContext, parts: WordPart[]) => Promise<string>;
28
28
  /**
29
- * Handle "${arr[@]:-${default[@]}}", "${arr[@]:+${alt[@]}}", and "${arr[@]:=default}"
29
+ * Handle "${arr[@]:-${default[@]}}" and "${arr[@]:+${alt[@]}}".
30
30
  * Also handles "${var:-${default[@]}}" where var is a scalar variable.
31
+ * Assignment defaults preserve existing array elements when no assignment is needed.
31
32
  * When the default value contains an array expansion, each element should become a separate word.
32
33
  */
33
34
  export declare function handleArrayDefaultValue(ctx: InterpreterContext, wordParts: WordPart[]): Promise<ArrayExpansionResult>;
@@ -39,6 +39,7 @@ export declare function handleDefaultValue(ctx: InterpreterContext, operation: {
39
39
  word?: WordNode;
40
40
  checkEmpty?: boolean;
41
41
  }, opCtx: ParameterOpContext, expandWordPartsAsync: ExpandWordPartsAsyncFn): Promise<string>;
42
+ export declare function assertDefaultAssignmentTarget(parameter: string): void;
42
43
  /**
43
44
  * Handle AssignDefault operation: ${param:=word}
44
45
  */
@@ -3,7 +3,10 @@
3
3
  *
4
4
  * Functions for ${var#pattern}, ${var%pattern}, ${!prefix*} etc.
5
5
  */
6
+ import type { WordNode } from "../../ast/types.js";
6
7
  import type { InterpreterContext } from "../types.js";
8
+ import type { ExpandPartFn, ExpandWordPartsAsyncFn } from "./array-word-expansion.js";
9
+ export declare function buildPatternRemovalRegex(ctx: InterpreterContext, pattern: WordNode, greedy: boolean, expandWordPartsAsync: ExpandWordPartsAsyncFn, expandPart: ExpandPartFn): Promise<string>;
7
10
  /**
8
11
  * Apply pattern removal (prefix or suffix strip) to a single value.
9
12
  * Used by both scalar and vectorized array operations.
@@ -26,7 +26,7 @@ export declare function isArray(ctx: InterpreterContext, name: string): boolean;
26
26
  * @param name - The variable name
27
27
  * @param checkNounset - Whether to check for nounset (default true)
28
28
  */
29
- export declare function getVariable(ctx: InterpreterContext, name: string, checkNounset?: boolean, _insideDoubleQuotes?: boolean): Promise<string>;
29
+ export declare function getVariable(ctx: InterpreterContext, name: string, checkNounset?: boolean): Promise<string>;
30
30
  /**
31
31
  * Check if a variable is set (exists in the environment).
32
32
  * Properly handles array subscripts (e.g., arr[0] -> arr_0).
@@ -4,14 +4,46 @@
4
4
  * Consolidates the repeated error handling logic used in all loop constructs
5
5
  * (for, c-style for, while, until).
6
6
  */
7
+ import type { InterpreterContext } from "../types.js";
7
8
  export type LoopAction = "break" | "continue" | "rethrow" | "error";
8
9
  export interface LoopErrorResult {
9
10
  action: LoopAction;
10
11
  stdout: string;
11
12
  stderr: string;
13
+ /**
14
+ * Status the loop should adopt as "last command executed".
15
+ *
16
+ * For "break"/"continue" this is 0: bash's `break` and `continue` are
17
+ * builtins that return 0, and they are the last command the body ran, so
18
+ * the loop must not report the status of whatever failed before them.
19
+ * For "error" it is the failure status.
20
+ */
12
21
  exitCode?: number;
13
22
  error?: unknown;
14
23
  }
24
+ /**
25
+ * Exit status of the `break`/`continue` builtins themselves.
26
+ *
27
+ * A loop left via `break`/`continue` reports this, not the status of the
28
+ * last command that ran before it:
29
+ *
30
+ * while :; do false; break; done; echo $? # 0, not 1
31
+ */
32
+ export declare const BREAK_CONTINUE_STATUS = 0;
33
+ /**
34
+ * Adopt `status` as the loop's "last command executed" and publish it to `$?`.
35
+ *
36
+ * The loop tracks its own exit code for the value it finally returns, but `$?`
37
+ * has to move with it. A `for` loop runs nothing between the `continue` and
38
+ * the next iteration's first command, so leaving `$?` behind lets the failed
39
+ * command before the `continue` show up there:
40
+ *
41
+ * for i in 1 2; do echo "$?"; false; continue; done # 0 0, not 0 1
42
+ *
43
+ * `while`/`until` happen to hide this because their condition runs in between
44
+ * and resets `$?` - they are synchronised here all the same.
45
+ */
46
+ export declare function adoptLoopStatus(ctx: InterpreterContext, status: number): number;
15
47
  /**
16
48
  * Handle errors thrown during loop body execution.
17
49
  *