@jerryan/just-bash 3.6.1 → 3.7.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 (215) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/bin/chunks/chmod-G2BCCQGF.js +3 -0
  3. package/dist/bin/chunks/{chunk-B2GCIQI2.js → chunk-2UKTHDUM.js} +1 -1
  4. package/dist/bin/chunks/chunk-66UHJFN6.js +11 -0
  5. package/dist/bin/{shell/chunks/chunk-67XYNGRV.js → chunks/chunk-6O4Z6BQT.js} +1 -1
  6. package/dist/bin/{shell/chunks/chunk-M7SIPZZZ.js → chunks/chunk-7KMOGI3N.js} +1 -1
  7. package/dist/bin/{shell/chunks/chunk-6ESRNSO7.js → chunks/chunk-ADI36B7X.js} +1 -1
  8. package/dist/bin/chunks/chunk-CN4JKMTR.js +8 -0
  9. package/dist/bin/{shell/chunks/chunk-DZAFUADN.js → chunks/chunk-E26NQEH2.js} +1 -1
  10. package/dist/bin/chunks/chunk-E54Z6VIE.js +12 -0
  11. package/dist/bin/chunks/chunk-F2PYTUMR.js +9 -0
  12. package/dist/bin/chunks/chunk-FO7XJH3J.js +13 -0
  13. package/dist/bin/chunks/chunk-HWK7KFGB.js +3 -0
  14. package/dist/bin/chunks/{chunk-LE2XKKGQ.js → chunk-HYLF56CC.js} +1 -1
  15. package/dist/bin/chunks/chunk-KNTDFP7X.js +12 -0
  16. package/dist/bin/chunks/chunk-NBTZL3VS.js +3 -0
  17. package/dist/bin/chunks/chunk-OHFB3M3X.js +3 -0
  18. package/dist/bin/{shell/chunks/chunk-HQ63MFHG.js → chunks/chunk-PEUGMGJJ.js} +1 -1
  19. package/dist/bin/{shell/chunks/chunk-JELR4642.js → chunks/chunk-R76AK3KD.js} +12 -12
  20. package/dist/bin/chunks/{chunk-YCOJCFGU.js → chunk-RRECHBUS.js} +1 -1
  21. package/dist/bin/chunks/{chunk-ZMGLTHSU.js → chunk-THFQI5LV.js} +1 -1
  22. package/dist/bin/chunks/{chunk-CL7IYCGG.js → chunk-U7YR5CDD.js} +1 -1
  23. package/dist/bin/chunks/cp-TMDR6USI.js +3 -0
  24. package/dist/bin/chunks/du-UKFUX7KM.js +3 -0
  25. package/dist/bin/chunks/find-W2RZWTOF.js +3 -0
  26. package/dist/bin/chunks/{flag-coverage-FYJ2V7J4.js → flag-coverage-QJ5ZQKCF.js} +1 -1
  27. package/dist/bin/{shell/chunks/grep-CVU5V66H.js → chunks/grep-IHDO3L72.js} +1 -1
  28. package/dist/bin/chunks/gzip-WUK63QLL.js +3 -0
  29. package/dist/bin/{shell/chunks/js-exec-5QZZCOR7.js → chunks/js-exec-BE37X4L2.js} +1 -1
  30. package/dist/bin/chunks/js-exec-worker.js +157 -99
  31. package/dist/bin/chunks/ln-XVC53673.js +3 -0
  32. package/dist/bin/chunks/ls-EROTXGTC.js +3 -0
  33. package/dist/bin/chunks/mkdir-YJ3SOVRP.js +3 -0
  34. package/dist/bin/chunks/mv-HDNKXPO6.js +3 -0
  35. package/dist/bin/{shell/chunks/python3-TMFYDQAP.js → chunks/python3-TJ6DCPIA.js} +1 -1
  36. package/dist/bin/chunks/readlink-ZUIECKQC.js +3 -0
  37. package/dist/bin/chunks/rg-ODJAYIKX.js +3 -0
  38. package/dist/bin/chunks/rm-B4LVIG7A.js +3 -0
  39. package/dist/bin/chunks/rmdir-W5NBOJ7E.js +3 -0
  40. package/dist/bin/chunks/split-TVJYLTIJ.js +3 -0
  41. package/dist/bin/chunks/sqlite3-5BGAK7VX.js +3 -0
  42. package/dist/bin/chunks/worker.js +120 -109
  43. package/dist/bin/just-bash.js +333 -328
  44. package/dist/bin/shell/chunks/chmod-G2BCCQGF.js +3 -0
  45. package/dist/bin/shell/chunks/{chunk-B2GCIQI2.js → chunk-2UKTHDUM.js} +1 -1
  46. package/dist/bin/shell/chunks/chunk-66UHJFN6.js +11 -0
  47. package/dist/bin/{chunks/chunk-67XYNGRV.js → shell/chunks/chunk-6O4Z6BQT.js} +1 -1
  48. package/dist/bin/{chunks/chunk-M7SIPZZZ.js → shell/chunks/chunk-7KMOGI3N.js} +1 -1
  49. package/dist/bin/{chunks/chunk-6ESRNSO7.js → shell/chunks/chunk-ADI36B7X.js} +1 -1
  50. package/dist/bin/shell/chunks/chunk-CN4JKMTR.js +8 -0
  51. package/dist/bin/{chunks/chunk-DZAFUADN.js → shell/chunks/chunk-E26NQEH2.js} +1 -1
  52. package/dist/bin/shell/chunks/chunk-E54Z6VIE.js +12 -0
  53. package/dist/bin/shell/chunks/chunk-F2PYTUMR.js +9 -0
  54. package/dist/bin/shell/chunks/chunk-FO7XJH3J.js +13 -0
  55. package/dist/bin/shell/chunks/chunk-HWK7KFGB.js +3 -0
  56. package/dist/bin/shell/chunks/{chunk-LE2XKKGQ.js → chunk-HYLF56CC.js} +1 -1
  57. package/dist/bin/shell/chunks/chunk-KNTDFP7X.js +12 -0
  58. package/dist/bin/shell/chunks/chunk-NBTZL3VS.js +3 -0
  59. package/dist/bin/shell/chunks/chunk-OHFB3M3X.js +3 -0
  60. package/dist/bin/{chunks/chunk-HQ63MFHG.js → shell/chunks/chunk-PEUGMGJJ.js} +1 -1
  61. package/dist/bin/{chunks/chunk-JELR4642.js → shell/chunks/chunk-R76AK3KD.js} +12 -12
  62. package/dist/bin/shell/chunks/{chunk-YCOJCFGU.js → chunk-RRECHBUS.js} +1 -1
  63. package/dist/bin/shell/chunks/{chunk-ZMGLTHSU.js → chunk-THFQI5LV.js} +1 -1
  64. package/dist/bin/shell/chunks/{chunk-CL7IYCGG.js → chunk-U7YR5CDD.js} +1 -1
  65. package/dist/bin/shell/chunks/cp-TMDR6USI.js +3 -0
  66. package/dist/bin/shell/chunks/du-UKFUX7KM.js +3 -0
  67. package/dist/bin/shell/chunks/find-W2RZWTOF.js +3 -0
  68. package/dist/bin/shell/chunks/{flag-coverage-FYJ2V7J4.js → flag-coverage-QJ5ZQKCF.js} +1 -1
  69. package/dist/bin/{chunks/grep-CVU5V66H.js → shell/chunks/grep-IHDO3L72.js} +1 -1
  70. package/dist/bin/shell/chunks/gzip-WUK63QLL.js +3 -0
  71. package/dist/bin/{chunks/js-exec-5QZZCOR7.js → shell/chunks/js-exec-BE37X4L2.js} +1 -1
  72. package/dist/bin/shell/chunks/ln-XVC53673.js +3 -0
  73. package/dist/bin/shell/chunks/ls-EROTXGTC.js +3 -0
  74. package/dist/bin/shell/chunks/mkdir-YJ3SOVRP.js +3 -0
  75. package/dist/bin/shell/chunks/mv-HDNKXPO6.js +3 -0
  76. package/dist/bin/{chunks/python3-TMFYDQAP.js → shell/chunks/python3-TJ6DCPIA.js} +1 -1
  77. package/dist/bin/shell/chunks/readlink-ZUIECKQC.js +3 -0
  78. package/dist/bin/shell/chunks/rg-ODJAYIKX.js +3 -0
  79. package/dist/bin/shell/chunks/rm-B4LVIG7A.js +3 -0
  80. package/dist/bin/shell/chunks/rmdir-W5NBOJ7E.js +3 -0
  81. package/dist/bin/shell/chunks/split-TVJYLTIJ.js +3 -0
  82. package/dist/bin/shell/chunks/sqlite3-5BGAK7VX.js +3 -0
  83. package/dist/bin/shell/shell.js +385 -380
  84. package/dist/bundle/browser.js +643 -638
  85. package/dist/bundle/chunks/chmod-XZNKTJHL.js +2 -0
  86. package/dist/bundle/chunks/{chunk-XVSR5HHH.js → chunk-2T7PBFL4.js} +1 -1
  87. package/dist/bundle/chunks/chunk-3BMWRGU2.js +10 -0
  88. package/dist/bundle/chunks/chunk-3CIDHL5V.js +11 -0
  89. package/dist/bundle/chunks/chunk-4CC3OZPU.js +2 -0
  90. package/dist/bundle/chunks/{chunk-FIMF2TLE.js → chunk-5DMO6LFU.js} +12 -12
  91. package/dist/bundle/chunks/chunk-A257L6QO.js +7 -0
  92. package/dist/bundle/chunks/{chunk-6DDRR56B.js → chunk-ACVD6PQF.js} +1 -1
  93. package/dist/bundle/chunks/chunk-BS6EJR2R.js +11 -0
  94. package/dist/bundle/chunks/chunk-D5FHVW27.js +2 -0
  95. package/dist/bundle/chunks/{chunk-KEMO3CBM.js → chunk-E3ABCXE4.js} +1 -1
  96. package/dist/bundle/chunks/{chunk-FSJ6TTCC.js → chunk-HMM3NGUJ.js} +1 -1
  97. package/dist/bundle/chunks/chunk-IYJLVOVE.js +12 -0
  98. package/dist/bundle/chunks/chunk-LRFR25IP.js +8 -0
  99. package/dist/bundle/chunks/{chunk-NBNI7G66.js → chunk-OPYVVD5P.js} +1 -1
  100. package/dist/bundle/chunks/{chunk-F6XU52K3.js → chunk-OR544SGH.js} +1 -1
  101. package/dist/bundle/chunks/{chunk-RPKJJFGZ.js → chunk-PMBXJ3OQ.js} +1 -1
  102. package/dist/bundle/chunks/{chunk-UC76ZOWM.js → chunk-SBOTR4JQ.js} +1 -1
  103. package/dist/bundle/chunks/chunk-T5ZEIOJ3.js +2 -0
  104. package/dist/bundle/chunks/{chunk-DAKEIWT3.js → chunk-YNYC232D.js} +1 -1
  105. package/dist/bundle/chunks/{chunk-ZXFELXJH.js → chunk-YUOBBH7P.js} +1 -1
  106. package/dist/bundle/chunks/cp-NWITRTH3.js +2 -0
  107. package/dist/bundle/chunks/du-IFLWEM6M.js +2 -0
  108. package/dist/bundle/chunks/find-EW6OHRPJ.js +2 -0
  109. package/dist/bundle/chunks/{flag-coverage-XSPWRCVG.js → flag-coverage-PIF5QRO7.js} +1 -1
  110. package/dist/bundle/chunks/{grep-4AYF3A5J.js → grep-QDFNKAUW.js} +1 -1
  111. package/dist/bundle/chunks/gzip-HBDKZBIP.js +2 -0
  112. package/dist/bundle/chunks/{js-exec-57QMXJG5.js → js-exec-IREGAOMH.js} +1 -1
  113. package/dist/bundle/chunks/js-exec-worker.js +157 -99
  114. package/dist/bundle/chunks/ln-CEM7GDB5.js +2 -0
  115. package/dist/bundle/chunks/ls-WJ7EIFVM.js +2 -0
  116. package/dist/bundle/chunks/mkdir-Z6MMWH3D.js +2 -0
  117. package/dist/bundle/chunks/mv-E2NFLGRQ.js +2 -0
  118. package/dist/bundle/chunks/{python3-NNONJINM.js → python3-W4UMQJAQ.js} +1 -1
  119. package/dist/bundle/chunks/readlink-XCFO7YD2.js +2 -0
  120. package/dist/bundle/chunks/rg-J7XDRV3B.js +2 -0
  121. package/dist/bundle/chunks/rm-IGPLE632.js +2 -0
  122. package/dist/bundle/chunks/rmdir-UMUDM2L2.js +2 -0
  123. package/dist/bundle/chunks/split-D4HPO4G5.js +2 -0
  124. package/dist/bundle/chunks/sqlite3-3HL2ECCQ.js +2 -0
  125. package/dist/bundle/chunks/worker.js +120 -109
  126. package/dist/bundle/index.cjs +975 -970
  127. package/dist/bundle/index.js +346 -341
  128. package/dist/commands/worker-bridge/bridge-handler.d.ts +0 -3
  129. package/dist/commands/worker-bridge/protocol.d.ts +57 -23
  130. package/dist/fs/fs-error.d.ts +43 -0
  131. package/dist/fs/interface.d.ts +13 -0
  132. package/dist/fs/mountable-fs/mountable-fs.d.ts +20 -0
  133. package/dist/fs/overlay-fs/apply.d.ts +2 -1
  134. package/dist/fs/overlay-fs/index.d.ts +0 -1
  135. package/dist/fs/overlay-fs/overlay-fs.d.ts +14 -0
  136. package/dist/fs/path-utils.d.ts +5 -0
  137. package/dist/fs/vfs-template.d.ts +38 -15
  138. package/dist/index.d.cts +2 -1
  139. package/dist/index.d.ts +2 -1
  140. package/dist/interpreter/builtin-dispatch.d.ts +10 -0
  141. package/dist/interpreter/builtin-manifest.d.ts +273 -0
  142. package/dist/interpreter/builtins/help.d.ts +6 -0
  143. package/dist/interpreter/builtins/shopt.d.ts +3 -0
  144. package/dist/interpreter/helpers/shell-constants.d.ts +0 -20
  145. package/package.json +1 -1
  146. package/dist/bin/chunks/chmod-WYYTXGVB.js +0 -3
  147. package/dist/bin/chunks/chunk-43E7AR6A.js +0 -3
  148. package/dist/bin/chunks/chunk-AI7JUA46.js +0 -13
  149. package/dist/bin/chunks/chunk-GQKQEK5N.js +0 -11
  150. package/dist/bin/chunks/chunk-JHEAT7AR.js +0 -12
  151. package/dist/bin/chunks/chunk-OLEQNRKX.js +0 -8
  152. package/dist/bin/chunks/chunk-SE7JHGP3.js +0 -9
  153. package/dist/bin/chunks/chunk-WEHA3JFD.js +0 -3
  154. package/dist/bin/chunks/chunk-YQEKKZTU.js +0 -12
  155. package/dist/bin/chunks/cp-OMVKM35F.js +0 -3
  156. package/dist/bin/chunks/du-LUFPVLNW.js +0 -3
  157. package/dist/bin/chunks/find-AWH2KOY7.js +0 -3
  158. package/dist/bin/chunks/gzip-FDPA6EKG.js +0 -3
  159. package/dist/bin/chunks/ln-B35EKC2Q.js +0 -3
  160. package/dist/bin/chunks/ls-Q6ZZ6SQ2.js +0 -3
  161. package/dist/bin/chunks/mkdir-74BP5NTG.js +0 -3
  162. package/dist/bin/chunks/mv-76LAHXFR.js +0 -3
  163. package/dist/bin/chunks/readlink-EHXJNW62.js +0 -3
  164. package/dist/bin/chunks/rg-PXNKNIMY.js +0 -3
  165. package/dist/bin/chunks/rm-NLG5344W.js +0 -3
  166. package/dist/bin/chunks/rmdir-7ZIVFZJX.js +0 -3
  167. package/dist/bin/chunks/split-ZNNNHKSP.js +0 -3
  168. package/dist/bin/chunks/sqlite3-3EUPHVEZ.js +0 -3
  169. package/dist/bin/shell/chunks/chmod-WYYTXGVB.js +0 -3
  170. package/dist/bin/shell/chunks/chunk-43E7AR6A.js +0 -3
  171. package/dist/bin/shell/chunks/chunk-AI7JUA46.js +0 -13
  172. package/dist/bin/shell/chunks/chunk-GQKQEK5N.js +0 -11
  173. package/dist/bin/shell/chunks/chunk-JHEAT7AR.js +0 -12
  174. package/dist/bin/shell/chunks/chunk-OLEQNRKX.js +0 -8
  175. package/dist/bin/shell/chunks/chunk-SE7JHGP3.js +0 -9
  176. package/dist/bin/shell/chunks/chunk-WEHA3JFD.js +0 -3
  177. package/dist/bin/shell/chunks/chunk-YQEKKZTU.js +0 -12
  178. package/dist/bin/shell/chunks/cp-OMVKM35F.js +0 -3
  179. package/dist/bin/shell/chunks/du-LUFPVLNW.js +0 -3
  180. package/dist/bin/shell/chunks/find-AWH2KOY7.js +0 -3
  181. package/dist/bin/shell/chunks/gzip-FDPA6EKG.js +0 -3
  182. package/dist/bin/shell/chunks/ln-B35EKC2Q.js +0 -3
  183. package/dist/bin/shell/chunks/ls-Q6ZZ6SQ2.js +0 -3
  184. package/dist/bin/shell/chunks/mkdir-74BP5NTG.js +0 -3
  185. package/dist/bin/shell/chunks/mv-76LAHXFR.js +0 -3
  186. package/dist/bin/shell/chunks/readlink-EHXJNW62.js +0 -3
  187. package/dist/bin/shell/chunks/rg-PXNKNIMY.js +0 -3
  188. package/dist/bin/shell/chunks/rm-NLG5344W.js +0 -3
  189. package/dist/bin/shell/chunks/rmdir-7ZIVFZJX.js +0 -3
  190. package/dist/bin/shell/chunks/split-ZNNNHKSP.js +0 -3
  191. package/dist/bin/shell/chunks/sqlite3-3EUPHVEZ.js +0 -3
  192. package/dist/bundle/chunks/chmod-WM2JFFQC.js +0 -2
  193. package/dist/bundle/chunks/chunk-7IJWBG4I.js +0 -2
  194. package/dist/bundle/chunks/chunk-G3IRZ4FN.js +0 -8
  195. package/dist/bundle/chunks/chunk-MLIO3BK2.js +0 -7
  196. package/dist/bundle/chunks/chunk-TBVD66LC.js +0 -10
  197. package/dist/bundle/chunks/chunk-ULXGGWAD.js +0 -11
  198. package/dist/bundle/chunks/chunk-W2Z6LYL6.js +0 -11
  199. package/dist/bundle/chunks/chunk-WN54B5NQ.js +0 -12
  200. package/dist/bundle/chunks/chunk-YUSFCOM7.js +0 -2
  201. package/dist/bundle/chunks/cp-2KZIPZJS.js +0 -2
  202. package/dist/bundle/chunks/du-7AZCLKR6.js +0 -2
  203. package/dist/bundle/chunks/find-END3EAHV.js +0 -2
  204. package/dist/bundle/chunks/gzip-RQOBR22H.js +0 -2
  205. package/dist/bundle/chunks/ln-OPY2ZVGQ.js +0 -2
  206. package/dist/bundle/chunks/ls-ZPXGZX63.js +0 -2
  207. package/dist/bundle/chunks/mkdir-WDDKK2P3.js +0 -2
  208. package/dist/bundle/chunks/mv-ZF6UBVRB.js +0 -2
  209. package/dist/bundle/chunks/readlink-U5OM5A3M.js +0 -2
  210. package/dist/bundle/chunks/rg-NAMXBYKS.js +0 -2
  211. package/dist/bundle/chunks/rm-R2ZENNSN.js +0 -2
  212. package/dist/bundle/chunks/rmdir-YJKPQVCK.js +0 -2
  213. package/dist/bundle/chunks/split-JICLAMP6.js +0 -2
  214. package/dist/bundle/chunks/sqlite3-M4UZPXDO.js +0 -2
  215. package/dist/fs/overlay-fs/merge.d.ts +0 -24
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b,c,d,e,f}from"./chunk-JELR4642.js";import"./chunk-QYZN33JA.js";import"./chunk-R2J5MJOM.js";import"./chunk-GA5TPRMF.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import"./chunk-I57EACSL.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{c as egrepCommand,f as egrepFlagsForFuzzing,b as fgrepCommand,e as fgrepFlagsForFuzzing,d as flagsForFuzzing,a as grepCommand};
3
+ import{a,b,c,d,e,f}from"./chunk-R76AK3KD.js";import"./chunk-QYZN33JA.js";import"./chunk-R2J5MJOM.js";import"./chunk-GA5TPRMF.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import"./chunk-I57EACSL.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{c as egrepCommand,f as egrepFlagsForFuzzing,b as fgrepCommand,e as fgrepFlagsForFuzzing,d as flagsForFuzzing,a as grepCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b,c,d,e,f}from"./chunk-PEUGMGJJ.js";import"./chunk-QES5OSUC.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import"./chunk-I57EACSL.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{d as flagsForFuzzing,b as gunzipCommand,e as gunzipFlagsForFuzzing,a as gzipCommand,c as zcatCommand,f as zcatFlagsForFuzzing};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as A,b as B}from"./chunk-JHEAT7AR.js";import{a as q}from"./chunk-3DWQCLNP.js";import"./chunk-3MRB66F4.js";import"./chunk-O2BCKSMK.js";import"./chunk-TW2IJRUF.js";import{b as v,c as j}from"./chunk-QKJAAJ7J.js";import{a as F}from"./chunk-MROECM42.js";import{b as C}from"./chunk-HWI42GQO.js";import{b as E}from"./chunk-CPKBPQ2C.js";import{a as W,b as h}from"./chunk-PBOVSFTJ.js";import{a as S}from"./chunk-I4IRHQDW.js";import{b as M}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";import{AsyncLocalStorage as H}from"node:async_hooks";import{fileURLToPath as J}from"node:url";import{Worker as L}from"node:worker_threads";var O=new H,P=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
3
+ import{a as A,b as B}from"./chunk-E54Z6VIE.js";import{a as q}from"./chunk-3DWQCLNP.js";import"./chunk-3MRB66F4.js";import"./chunk-O2BCKSMK.js";import"./chunk-TW2IJRUF.js";import{b as v,c as j}from"./chunk-QKJAAJ7J.js";import{a as F}from"./chunk-MROECM42.js";import{b as C}from"./chunk-HWI42GQO.js";import{b as E}from"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import{a as W,b as h}from"./chunk-PBOVSFTJ.js";import{a as S}from"./chunk-I4IRHQDW.js";import{b as M}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";import{AsyncLocalStorage as H}from"node:async_hooks";import{fileURLToPath as J}from"node:url";import{Worker as L}from"node:worker_threads";var O=new H,P=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
4
4
 
5
5
  Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...]
6
6
 
@@ -1673,11 +1673,18 @@ var OpCode = {
1673
1673
  // Tool invocation (executor mode)
1674
1674
  INVOKE_TOOL: 400
1675
1675
  };
1676
- var Status = {
1677
- PENDING: 0,
1678
- READY: 1,
1679
- SUCCESS: 2,
1680
- ERROR: 3
1676
+ var RequestState = {
1677
+ IDLE: 0,
1678
+ /** Worker has published an op. */
1679
+ REQUEST: 1,
1680
+ /** stop() cancellation wake. The host treats any non-REQUEST wake as
1681
+ * loop-abort (stop() also flips its `running` flag). */
1682
+ CANCELLED: 2
1683
+ };
1684
+ var ResultState = {
1685
+ NONE: 0,
1686
+ SUCCESS: 1,
1687
+ ERROR: 2
1681
1688
  };
1682
1689
  var ErrorCode = {
1683
1690
  NONE: 0,
@@ -1688,34 +1695,65 @@ var ErrorCode = {
1688
1695
  PERMISSION_DENIED: 5,
1689
1696
  INVALID_PATH: 6,
1690
1697
  IO_ERROR: 7,
1691
- TIMEOUT: 8,
1692
1698
  NETWORK_ERROR: 9,
1693
1699
  NETWORK_NOT_CONFIGURED: 10,
1694
- NOT_EMPTY: 11
1700
+ NOT_EMPTY: 11,
1701
+ LOOP: 12,
1702
+ FILE_TOO_LARGE: 13,
1703
+ NO_SPACE: 14,
1704
+ BUSY: 15,
1705
+ READ_ONLY: 16,
1706
+ CROSS_DEVICE: 17
1695
1707
  };
1708
+ var ERRNO_TO_WIRE = Object.assign(
1709
+ /* @__PURE__ */ Object.create(null),
1710
+ {
1711
+ ENOENT: ErrorCode.NOT_FOUND,
1712
+ EISDIR: ErrorCode.IS_DIRECTORY,
1713
+ ENOTDIR: ErrorCode.NOT_DIRECTORY,
1714
+ ENOTEMPTY: ErrorCode.NOT_EMPTY,
1715
+ EEXIST: ErrorCode.EXISTS,
1716
+ EPERM: ErrorCode.PERMISSION_DENIED,
1717
+ EACCES: ErrorCode.PERMISSION_DENIED,
1718
+ EINVAL: ErrorCode.INVALID_PATH,
1719
+ ELOOP: ErrorCode.LOOP,
1720
+ EFBIG: ErrorCode.FILE_TOO_LARGE,
1721
+ ENOSPC: ErrorCode.NO_SPACE,
1722
+ EBUSY: ErrorCode.BUSY,
1723
+ EROFS: ErrorCode.READ_ONLY,
1724
+ EXDEV: ErrorCode.CROSS_DEVICE
1725
+ }
1726
+ );
1727
+ var WIRE_TO_ERRNO = /* @__PURE__ */ Object.create(null);
1728
+ for (const [name, code] of Object.entries(ERRNO_TO_WIRE)) {
1729
+ WIRE_TO_ERRNO[code] = name;
1730
+ }
1731
+ function wireToErrnoName(code) {
1732
+ return Object.hasOwn(WIRE_TO_ERRNO, code) ? WIRE_TO_ERRNO[code] : void 0;
1733
+ }
1696
1734
  var Offset = {
1697
1735
  OP_CODE: 0,
1698
- STATUS: 4,
1736
+ REQUEST: 4,
1699
1737
  PATH_LENGTH: 8,
1700
1738
  DATA_LENGTH: 12,
1701
1739
  RESULT_LENGTH: 16,
1702
1740
  ERROR_CODE: 20,
1703
1741
  FLAGS: 24,
1704
1742
  MODE: 28,
1705
- PATH_BUFFER: 32,
1706
- DATA_BUFFER: 4128
1707
- // 32 + 4096
1743
+ RESULT_STATE: 32,
1744
+ PATH_BUFFER: 36,
1745
+ DATA_BUFFER: 4132
1746
+ // 36 + 4096
1708
1747
  };
1709
1748
  var Size = {
1710
- CONTROL_REGION: 32,
1711
1749
  PATH_BUFFER: 4096,
1712
1750
  // 8MB transfer CHUNK size — not a semantic cap. Results larger than
1713
1751
  // this are assembled transparently (READ_RESULT_RANGE), and large
1714
1752
  // writes stream as WRITE_FILE_RANGE chunks. Sized to keep ordinary
1715
1753
  // ops single-transfer while bounding per-transfer copies.
1716
1754
  DATA_BUFFER: 8388608,
1717
- TOTAL: 8392736
1718
- // 32 + 4096 + 8MB
1755
+ TOTAL: 8392740
1756
+ // 36 + 4096 + 8MB
1719
1757
  };
1720
1758
  var Flags = {
1721
1759
  NONE: 0,
@@ -1747,11 +1785,23 @@ var ProtocolBuffer = class {
1747
1785
  setOpCode(code) {
1748
1786
  _Atomics.store(this.int32View, Offset.OP_CODE / 4, code);
1749
1787
  }
1750
- getStatus() {
1751
- return _Atomics.load(this.int32View, Offset.STATUS / 4);
1788
+ getRequest() {
1789
+ return _Atomics.load(
1790
+ this.int32View,
1791
+ Offset.REQUEST / 4
1792
+ );
1793
+ }
1794
+ setRequest(request) {
1795
+ _Atomics.store(this.int32View, Offset.REQUEST / 4, request);
1796
+ }
1797
+ getResultState() {
1798
+ return _Atomics.load(
1799
+ this.int32View,
1800
+ Offset.RESULT_STATE / 4
1801
+ );
1752
1802
  }
1753
- setStatus(status) {
1754
- _Atomics.store(this.int32View, Offset.STATUS / 4, status);
1803
+ setResultState(state) {
1804
+ _Atomics.store(this.int32View, Offset.RESULT_STATE / 4, state);
1755
1805
  }
1756
1806
  getPathLength() {
1757
1807
  return _Atomics.load(this.int32View, Offset.PATH_LENGTH / 4);
@@ -1899,33 +1949,21 @@ var ProtocolBuffer = class {
1899
1949
  )
1900
1950
  };
1901
1951
  }
1902
- waitForReady(timeout) {
1903
- return _Atomics.wait(
1904
- this.int32View,
1905
- Offset.STATUS / 4,
1906
- Status.PENDING,
1907
- timeout
1908
- );
1909
- }
1910
- waitForReadyAsync(timeout) {
1911
- return _Atomics.waitAsync(
1912
- this.int32View,
1913
- Offset.STATUS / 4,
1914
- Status.PENDING,
1915
- timeout
1916
- );
1917
- }
1918
1952
  /**
1919
- * Wait for status to become READY.
1920
- * Returns immediately if status is already READY, or waits until it changes.
1953
+ * Wait for the request word to become REQUEST.
1954
+ * Returns immediately if already REQUEST; CANCELLED or any unexpected
1955
+ * state returns false (the caller's running-flag check aborts the loop).
1921
1956
  */
1922
1957
  async waitUntilReady(timeout) {
1923
1958
  const startTime = Date.now();
1924
1959
  while (true) {
1925
- const status = this.getStatus();
1926
- if (status === Status.READY) {
1960
+ const request = this.getRequest();
1961
+ if (request === RequestState.REQUEST) {
1927
1962
  return true;
1928
1963
  }
1964
+ if (request !== RequestState.IDLE) {
1965
+ return false;
1966
+ }
1929
1967
  const elapsed = Date.now() - startTime;
1930
1968
  if (elapsed >= timeout) {
1931
1969
  return false;
@@ -1933,8 +1971,8 @@ var ProtocolBuffer = class {
1933
1971
  const remainingMs = timeout - elapsed;
1934
1972
  const result = _Atomics.waitAsync(
1935
1973
  this.int32View,
1936
- Offset.STATUS / 4,
1937
- status,
1974
+ Offset.REQUEST / 4,
1975
+ RequestState.IDLE,
1938
1976
  remainingMs
1939
1977
  );
1940
1978
  if (result.async) {
@@ -1945,20 +1983,25 @@ var ProtocolBuffer = class {
1945
1983
  }
1946
1984
  }
1947
1985
  }
1986
+ /** Worker-side blocking wait on the RESULT word (host writes). */
1948
1987
  waitForResult(timeout) {
1949
1988
  return _Atomics.wait(
1950
1989
  this.int32View,
1951
- Offset.STATUS / 4,
1952
- Status.READY,
1990
+ Offset.RESULT_STATE / 4,
1991
+ ResultState.NONE,
1953
1992
  timeout
1954
1993
  );
1955
1994
  }
1956
- notify() {
1957
- return _Atomics.notify(this.int32View, Offset.STATUS / 4);
1995
+ notifyRequest() {
1996
+ return _Atomics.notify(this.int32View, Offset.REQUEST / 4);
1997
+ }
1998
+ notifyResult() {
1999
+ return _Atomics.notify(this.int32View, Offset.RESULT_STATE / 4);
1958
2000
  }
1959
2001
  reset() {
1960
2002
  this.setOpCode(OpCode.NOOP);
1961
- this.setStatus(Status.PENDING);
2003
+ this.setRequest(RequestState.IDLE);
2004
+ this.setResultState(ResultState.NONE);
1962
2005
  this.setPathLength(0);
1963
2006
  this.setDataLength(0);
1964
2007
  this.setResultLength(0);
@@ -1985,23 +2028,14 @@ var SyncBackend = class {
1985
2028
  if (data) {
1986
2029
  this.protocol.setData(data);
1987
2030
  }
1988
- this.protocol.setStatus(Status.READY);
1989
- this.protocol.notify();
1990
- const deadline = Date.now() + this.operationTimeoutMs;
1991
- let waitResult = this.protocol.waitForResult(this.operationTimeoutMs);
1992
- while (waitResult !== "timed-out" && this.protocol.getStatus() === Status.READY) {
1993
- const remaining = deadline - Date.now();
1994
- if (remaining <= 0) {
1995
- waitResult = "timed-out";
1996
- break;
1997
- }
1998
- waitResult = this.protocol.waitForResult(remaining);
1999
- }
2031
+ this.protocol.setRequest(RequestState.REQUEST);
2032
+ this.protocol.notifyRequest();
2033
+ const waitResult = this.protocol.waitForResult(this.operationTimeoutMs);
2000
2034
  if (waitResult === "timed-out") {
2001
2035
  return { success: false, error: "Operation timed out" };
2002
2036
  }
2003
- const status = this.protocol.getStatus();
2004
- if (status === Status.SUCCESS) {
2037
+ const resultState = this.protocol.getResultState();
2038
+ if (resultState === ResultState.SUCCESS) {
2005
2039
  const totalLength = this.protocol.getResultLength();
2006
2040
  if (totalLength <= Size.DATA_BUFFER) {
2007
2041
  return { success: true, result: this.protocol.getResult() };
@@ -2030,12 +2064,19 @@ var SyncBackend = class {
2030
2064
  }
2031
2065
  return { success: true, result: content };
2032
2066
  }
2067
+ if (resultState === ResultState.ERROR) {
2068
+ return {
2069
+ success: false,
2070
+ error: this.protocol.getResultAsString() || // Impossible by construction: every host error path publishes a
2071
+ // code and message. If this ever fires, the diagnostic payload
2072
+ // must identify the exact protocol state.
2073
+ `bridge protocol violation: op ${opCode} ERROR with empty message (wait=${waitResult}, errorCode=${this.protocol.getErrorCode()})`,
2074
+ errorCode: this.protocol.getErrorCode()
2075
+ };
2076
+ }
2033
2077
  return {
2034
2078
  success: false,
2035
- error: this.protocol.getResultAsString() || // Impossible by construction: every host error path publishes a
2036
- // code and message. If this ever fires, the diagnostic payload
2037
- // must identify the exact protocol state.
2038
- `bridge protocol violation: op ${opCode} woke with status ${status} (wait=${waitResult}, errorCode=${this.protocol.getErrorCode()})`,
2079
+ error: `bridge protocol violation: op ${opCode} woke with resultState ${resultState} (wait=${waitResult}, errorCode=${this.protocol.getErrorCode()})`,
2039
2080
  errorCode: this.protocol.getErrorCode()
2040
2081
  };
2041
2082
  }
@@ -2044,6 +2085,10 @@ var SyncBackend = class {
2044
2085
  opError_(fallback, result) {
2045
2086
  const err = new Error(result.error || fallback);
2046
2087
  err.bridgeErrorCode = result.errorCode;
2088
+ if (result.errorCode !== void 0) {
2089
+ const name = wireToErrnoName(result.errorCode);
2090
+ if (name !== void 0) err.code = name;
2091
+ }
2047
2092
  return err;
2048
2093
  }
2049
2094
  readFile(path) {
@@ -3660,8 +3705,18 @@ function formatError(errorVal) {
3660
3705
  }
3661
3706
  return String(errorVal);
3662
3707
  }
3663
- function throwError(context, message) {
3664
- return { error: context.newError(message) };
3708
+ function throwError(context, message, code) {
3709
+ const err = context.newError(message);
3710
+ if (code !== void 0) {
3711
+ const codeHandle = context.newString(code);
3712
+ context.setProp(err, "code", codeHandle);
3713
+ codeHandle.dispose();
3714
+ }
3715
+ return { error: err };
3716
+ }
3717
+ function throwGuestError_(context, e, fallback) {
3718
+ const err = e;
3719
+ return throwError(context, err?.message || fallback, err?.code);
3665
3720
  }
3666
3721
  function isProcessExit(context, error, processExitMarker) {
3667
3722
  const marker = context.getProp(error, PROCESS_EXIT_MARKER);
@@ -3905,7 +3960,7 @@ function setupContext(context, backend, input, processExitMarker) {
3905
3960
  backend.writeStdout(`${parts.join(" ")}
3906
3961
  `);
3907
3962
  } catch (e) {
3908
- return throwError(context, e.message || "write failed");
3963
+ return throwGuestError_(context, e, "write failed");
3909
3964
  }
3910
3965
  return context.undefined;
3911
3966
  });
@@ -3920,7 +3975,7 @@ function setupContext(context, backend, input, processExitMarker) {
3920
3975
  backend.writeStderr(`${parts.join(" ")}
3921
3976
  `);
3922
3977
  } catch (e) {
3923
- return throwError(context, e.message || "write failed");
3978
+ return throwGuestError_(context, e, "write failed");
3924
3979
  }
3925
3980
  return context.undefined;
3926
3981
  });
@@ -3935,7 +3990,7 @@ function setupContext(context, backend, input, processExitMarker) {
3935
3990
  backend.writeStderr(`${parts.join(" ")}
3936
3991
  `);
3937
3992
  } catch (e) {
3938
- return throwError(context, e.message || "write failed");
3993
+ return throwGuestError_(context, e, "write failed");
3939
3994
  }
3940
3995
  return context.undefined;
3941
3996
  });
@@ -3952,7 +4007,7 @@ function setupContext(context, backend, input, processExitMarker) {
3952
4007
  const data = backend.readFile(path);
3953
4008
  return context.newString(new TextDecoder().decode(data));
3954
4009
  } catch (e) {
3955
- return throwError(context, e.message || "readFile failed");
4010
+ return throwGuestError_(context, e, "readFile failed");
3956
4011
  }
3957
4012
  }
3958
4013
  );
@@ -3968,10 +4023,7 @@ function setupContext(context, backend, input, processExitMarker) {
3968
4023
  data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)
3969
4024
  );
3970
4025
  } catch (e) {
3971
- return throwError(
3972
- context,
3973
- e.message || "readFileBuffer failed"
3974
- );
4026
+ return throwGuestError_(context, e, "readFileBuffer failed");
3975
4027
  }
3976
4028
  }
3977
4029
  );
@@ -4020,7 +4072,7 @@ function setupContext(context, backend, input, processExitMarker) {
4020
4072
  backend.writeFile(path, marshalWriteData(dataHandle));
4021
4073
  return context.undefined;
4022
4074
  } catch (e) {
4023
- return throwError(context, e.message || "writeFile failed");
4075
+ return throwGuestError_(context, e, "writeFile failed");
4024
4076
  }
4025
4077
  }
4026
4078
  );
@@ -4039,7 +4091,7 @@ function setupContext(context, backend, input, processExitMarker) {
4039
4091
  mtime: stat.mtime.toISOString()
4040
4092
  });
4041
4093
  } catch (e) {
4042
- return throwError(context, e.message || "stat failed");
4094
+ return throwGuestError_(context, e, "stat failed");
4043
4095
  }
4044
4096
  });
4045
4097
  context.setProp(fsObj, "stat", statFn);
@@ -4052,7 +4104,7 @@ function setupContext(context, backend, input, processExitMarker) {
4052
4104
  const entries = backend.readdir(path);
4053
4105
  return jsToHandle(context, entries);
4054
4106
  } catch (e) {
4055
- return throwError(context, e.message || "readdir failed");
4107
+ return throwGuestError_(context, e, "readdir failed");
4056
4108
  }
4057
4109
  }
4058
4110
  );
@@ -4073,7 +4125,7 @@ function setupContext(context, backend, input, processExitMarker) {
4073
4125
  backend.mkdir(path, recursive);
4074
4126
  return context.undefined;
4075
4127
  } catch (e) {
4076
- return throwError(context, e.message || "mkdir failed");
4128
+ return throwGuestError_(context, e, "mkdir failed");
4077
4129
  }
4078
4130
  }
4079
4131
  );
@@ -4096,7 +4148,7 @@ function setupContext(context, backend, input, processExitMarker) {
4096
4148
  backend.rm(path, recursive, force);
4097
4149
  return context.undefined;
4098
4150
  } catch (e) {
4099
- return throwError(context, e.message || "rm failed");
4151
+ return throwGuestError_(context, e, "rm failed");
4100
4152
  }
4101
4153
  }
4102
4154
  );
@@ -4119,7 +4171,7 @@ function setupContext(context, backend, input, processExitMarker) {
4119
4171
  backend.appendFile(path, marshalWriteData(dataHandle));
4120
4172
  return context.undefined;
4121
4173
  } catch (e) {
4122
- return throwError(context, e.message || "appendFile failed");
4174
+ return throwGuestError_(context, e, "appendFile failed");
4123
4175
  }
4124
4176
  }
4125
4177
  );
@@ -4138,7 +4190,7 @@ function setupContext(context, backend, input, processExitMarker) {
4138
4190
  mtime: s.mtime.toISOString()
4139
4191
  });
4140
4192
  } catch (e) {
4141
- return throwError(context, e.message || "lstat failed");
4193
+ return throwGuestError_(context, e, "lstat failed");
4142
4194
  }
4143
4195
  });
4144
4196
  context.setProp(fsObj, "lstat", lstatFn);
@@ -4152,7 +4204,7 @@ function setupContext(context, backend, input, processExitMarker) {
4152
4204
  backend.symlink(target, linkPath);
4153
4205
  return context.undefined;
4154
4206
  } catch (e) {
4155
- return throwError(context, e.message || "symlink failed");
4207
+ return throwGuestError_(context, e, "symlink failed");
4156
4208
  }
4157
4209
  }
4158
4210
  );
@@ -4166,7 +4218,7 @@ function setupContext(context, backend, input, processExitMarker) {
4166
4218
  const target = backend.readlink(path);
4167
4219
  return context.newString(target);
4168
4220
  } catch (e) {
4169
- return throwError(context, e.message || "readlink failed");
4221
+ return throwGuestError_(context, e, "readlink failed");
4170
4222
  }
4171
4223
  }
4172
4224
  );
@@ -4181,7 +4233,7 @@ function setupContext(context, backend, input, processExitMarker) {
4181
4233
  backend.chmod(path, typeof mode === "number" ? mode : 0);
4182
4234
  return context.undefined;
4183
4235
  } catch (e) {
4184
- return throwError(context, e.message || "chmod failed");
4236
+ return throwGuestError_(context, e, "chmod failed");
4185
4237
  }
4186
4238
  }
4187
4239
  );
@@ -4195,7 +4247,7 @@ function setupContext(context, backend, input, processExitMarker) {
4195
4247
  const resolved = backend.realpath(path);
4196
4248
  return context.newString(resolved);
4197
4249
  } catch (e) {
4198
- return throwError(context, e.message || "realpath failed");
4250
+ return throwGuestError_(context, e, "realpath failed");
4199
4251
  }
4200
4252
  }
4201
4253
  );
@@ -4210,7 +4262,7 @@ function setupContext(context, backend, input, processExitMarker) {
4210
4262
  backend.rename(oldPath, newPath);
4211
4263
  return context.undefined;
4212
4264
  } catch (e) {
4213
- return throwError(context, e.message || "rename failed");
4265
+ return throwGuestError_(context, e, "rename failed");
4214
4266
  }
4215
4267
  }
4216
4268
  );
@@ -4225,7 +4277,7 @@ function setupContext(context, backend, input, processExitMarker) {
4225
4277
  backend.copyFile(src, dest);
4226
4278
  return context.undefined;
4227
4279
  } catch (e) {
4228
- return throwError(context, e.message || "copyFile failed");
4280
+ return throwGuestError_(context, e, "copyFile failed");
4229
4281
  }
4230
4282
  }
4231
4283
  );
@@ -4249,7 +4301,7 @@ function setupContext(context, backend, input, processExitMarker) {
4249
4301
  });
4250
4302
  return jsToHandle(context, result);
4251
4303
  } catch (e) {
4252
- return throwError(context, e.message || "fetch failed");
4304
+ return throwGuestError_(context, e, "fetch failed");
4253
4305
  }
4254
4306
  }
4255
4307
  );
@@ -4270,7 +4322,7 @@ function setupContext(context, backend, input, processExitMarker) {
4270
4322
  const result = backend.execCommand(command, stdin);
4271
4323
  return jsToHandle(context, result);
4272
4324
  } catch (e) {
4273
- return throwError(context, e.message || "exec failed");
4325
+ return throwGuestError_(context, e, "exec failed");
4274
4326
  }
4275
4327
  }
4276
4328
  );
@@ -4285,7 +4337,7 @@ function setupContext(context, backend, input, processExitMarker) {
4285
4337
  const result = backend.execCommandArgs(command, args);
4286
4338
  return jsToHandle(context, result);
4287
4339
  } catch (e) {
4288
- return throwError(context, e.message || "exec failed");
4340
+ return throwGuestError_(context, e, "exec failed");
4289
4341
  }
4290
4342
  }
4291
4343
  );
@@ -4301,10 +4353,7 @@ function setupContext(context, backend, input, processExitMarker) {
4301
4353
  const resultJson = backend.invokeTool(path, argsJson);
4302
4354
  return context.newString(resultJson);
4303
4355
  } catch (e) {
4304
- return throwError(
4305
- context,
4306
- e.message || "tool invocation failed"
4307
- );
4356
+ return throwGuestError_(context, e, "tool invocation failed");
4308
4357
  }
4309
4358
  }
4310
4359
  );
@@ -4432,7 +4481,13 @@ function setupContext(context, backend, input, processExitMarker) {
4432
4481
  _fs.promises.unlink = _fs.promises.rm;
4433
4482
  _fs.promises.rmdir = _fs.promises.rm;
4434
4483
  _fs.promises.access = function(p) {
4435
- return orig.exists(p) ? Promise.resolve() : Promise.reject(new Error('ENOENT: no such file or directory: ' + p));
4484
+ if (orig.exists(p)) return Promise.resolve();
4485
+ // Node-style error: prefixed message AND structured .code (the
4486
+ // sanctioned pattern \u2014 no errno literal at the Error call site).
4487
+ var msg = 'ENOENT: no such file or directory: ' + p;
4488
+ var e = new Error(msg);
4489
+ e.code = 'ENOENT';
4490
+ return Promise.reject(e);
4436
4491
  };
4437
4492
 
4438
4493
  // process enhancements
@@ -4762,11 +4817,14 @@ async function executeCode(input) {
4762
4817
  }
4763
4818
  return source;
4764
4819
  } catch (e) {
4765
- return {
4766
- error: new Error(
4767
- `Cannot find module '${moduleName}': ${e.message}`
4768
- )
4769
- };
4820
+ const err = new Error(
4821
+ `Cannot find module '${moduleName}': ${e.message}`
4822
+ );
4823
+ const code = e.code;
4824
+ if (code !== void 0) {
4825
+ err.code = code;
4826
+ }
4827
+ return { error: err };
4770
4828
  }
4771
4829
  },
4772
4830
  (baseModuleName, requestedName) => {
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-KNTDFP7X.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as lnCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-U7YR5CDD.js";import"./chunk-I57EACSL.js";import"./chunk-7JZKVC3F.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as lsCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-CN4JKMTR.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as mkdirCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-66UHJFN6.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as mvCommand};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as Q,b as W}from"./chunk-JHEAT7AR.js";import{a as I}from"./chunk-3DWQCLNP.js";import"./chunk-3MRB66F4.js";import"./chunk-O2BCKSMK.js";import"./chunk-TW2IJRUF.js";import"./chunk-QKJAAJ7J.js";import{a as F}from"./chunk-MROECM42.js";import{c as w}from"./chunk-42AMF6EE.js";import{b as M}from"./chunk-HWI42GQO.js";import{b as C}from"./chunk-CPKBPQ2C.js";import{a as A,b as d}from"./chunk-PBOVSFTJ.js";import{a as E}from"./chunk-I4IRHQDW.js";import{a as P,b as D}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";import{fileURLToPath as B}from"node:url";import{Worker as L}from"node:worker_threads";var z={name:"python3",summary:"Execute Python code via CPython Emscripten",usage:"python3 [OPTIONS] [-c CODE | -m MODULE | FILE] [ARGS...]",description:["Execute Python code using CPython compiled to WebAssembly via Emscripten.","","This command runs Python in an isolated environment with access to","the virtual filesystem. Standard library modules are available."],options:["-c CODE Execute CODE as Python script","-m MODULE Run library module as a script","--version Show Python version","--help Show this help"],examples:['python3 -c "print(1 + 2)"','python3 -c "import sys; print(sys.version)"',"python3 script.py","python3 script.py arg1 arg2",`echo 'print("hello")' | python3`],notes:["CPython runs in WebAssembly, so execution may be slower than native Python.","Standard library modules are available (no pip install).","Maximum execution time is 30 seconds by default."]};function _(t){let e={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(t.length===0)return e;let r=t.findIndex(n=>!n.startsWith("-")||n==="-"||n==="--");for(let n=0;n<(r===-1?t.length:r);n++){let i=t[n];if(i==="-c")return n+1>=t.length?{stdout:"",stderr:`python3: option requires an argument -- 'c'
3
+ import{a as Q,b as W}from"./chunk-E54Z6VIE.js";import{a as I}from"./chunk-3DWQCLNP.js";import"./chunk-3MRB66F4.js";import"./chunk-O2BCKSMK.js";import"./chunk-TW2IJRUF.js";import"./chunk-QKJAAJ7J.js";import{a as F}from"./chunk-MROECM42.js";import{c as w}from"./chunk-42AMF6EE.js";import{b as M}from"./chunk-HWI42GQO.js";import{b as C}from"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import{a as A,b as d}from"./chunk-PBOVSFTJ.js";import{a as E}from"./chunk-I4IRHQDW.js";import{a as P,b as D}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";import{fileURLToPath as B}from"node:url";import{Worker as L}from"node:worker_threads";var z={name:"python3",summary:"Execute Python code via CPython Emscripten",usage:"python3 [OPTIONS] [-c CODE | -m MODULE | FILE] [ARGS...]",description:["Execute Python code using CPython compiled to WebAssembly via Emscripten.","","This command runs Python in an isolated environment with access to","the virtual filesystem. Standard library modules are available."],options:["-c CODE Execute CODE as Python script","-m MODULE Run library module as a script","--version Show Python version","--help Show this help"],examples:['python3 -c "print(1 + 2)"','python3 -c "import sys; print(sys.version)"',"python3 script.py","python3 script.py arg1 arg2",`echo 'print("hello")' | python3`],notes:["CPython runs in WebAssembly, so execution may be slower than native Python.","Standard library modules are available (no pip install).","Maximum execution time is 30 seconds by default."]};function _(t){let e={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(t.length===0)return e;let r=t.findIndex(n=>!n.startsWith("-")||n==="-"||n==="--");for(let n=0;n<(r===-1?t.length:r);n++){let i=t[n];if(i==="-c")return n+1>=t.length?{stdout:"",stderr:`python3: option requires an argument -- 'c'
4
4
  `,exitCode:2}:(e.code=t[n+1],e.scriptArgs=t.slice(n+2),e);if(i==="-m")return n+1>=t.length?{stdout:"",stderr:`python3: option requires an argument -- 'm'
5
5
  `,exitCode:2}:(e.module=t[n+1],e.scriptArgs=t.slice(n+2),e);if(i==="--version"||i==="-V")return e.showVersion=!0,e;if(i.startsWith("-")&&i!=="-")return{stdout:"",stderr:`python3: unrecognized option '${i}'
6
6
  `,exitCode:2}}if(r!==-1){let n=t[r];n==="--"?r+1<t.length&&(e.scriptFile=t[r+1],e.scriptArgs=t.slice(r+2)):(e.scriptFile=n,e.scriptArgs=t.slice(r+1))}return e}var b=new WeakMap;function R(t){let e=b.get(t);return e||(e={executionQueue:[],activeExecution:null,poisonedError:null},b.set(t,e)),e}function ne(){b=new WeakMap}var H=B(new URL("./worker.js",import.meta.url));function U(t,e){if(!t||typeof t!="object")return{success:!1,error:"Malformed worker response"};let r=t;return typeof r.protocolToken!="string"||r.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:r.type==="security-violation"?{success:!1,error:`Security violation: ${typeof r.violation?.type=="string"?r.violation.type:"unknown"}`}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?{success:!0}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}function k(t){if(t.poisonedError!==null){for(let o of t.executionQueue.splice(0))o.state==="queued"&&(o.state="settled",o.stopBridge(),o.settle({success:!1,error:t.poisonedError}));return}if(t.activeExecution!==null||t.executionQueue.length===0)return;for(;t.executionQueue.length>0&&t.executionQueue[0]?.state!=="queued";)t.executionQueue.shift();if(t.executionQueue.length===0)return;let e=t.executionQueue.shift();if(!e)return;e.state="running",t.activeExecution=e;let r;try{r=M.runTrusted(()=>new L(H,{workerData:e.input}))}catch(o){let s=o instanceof Error?o.message:String(o);e.state="settled",e.settle({success:!1,error:d(s)}),t.activeExecution===e&&(t.activeExecution=null,k(t));return}e.worker=r;let n=!0,i=()=>{n&&(n=!1,r.removeListener("message",u),r.removeListener("error",g),r.removeListener("exit",v))},c=async(o,s)=>{if(!(t.activeExecution?.executionId!==e.executionId||e.state!=="running")){if(e.state="terminating",i(),e.settle(o),s&&!await e.controller.terminate(r)){let f="Worker termination was not acknowledged";e.worker=null,e.state="settled",t.poisonedError=f,t.activeExecution?.executionId===e.executionId&&(t.activeExecution=null),k(t);return}e.worker=null,e.state="settled",t.activeExecution?.executionId===e.executionId&&(t.activeExecution=null,k(t))}};e.cancel=o=>{c(o,!0)};let p=w(e.requireDefenseContext,"python3","worker message callback",o=>{try{e.controller.assertMessageSize(o,"response")}catch(s){c({success:!1,error:d(E(s))},!0);return}c(U(o,e.input.protocolToken),!0)}),h=w(e.requireDefenseContext,"python3","worker error callback",o=>{let s=d(E(o));c({success:!1,error:s},!0)}),a=w(e.requireDefenseContext,"python3","worker exit callback",()=>{c({success:!1,error:"Worker exited unexpectedly"},!1)}),u=o=>{try{p(o)}catch(s){let l=s instanceof Error?s.message:String(s);c({success:!1,error:d(l)},!0)}},g=o=>{try{h(o)}catch(s){let l=s instanceof Error?s.message:String(s);c({success:!1,error:d(l)},!0)}},v=()=>{try{a()}catch(o){let s=o instanceof Error?o.message:String(o);c({success:!1,error:d(s)},!0)}};r.on("message",u),r.on("error",g),r.on("exit",v)}async function N(t,e,r,n,i=[]){let c=Q(),p=new W(c,r.fs,r.cwd,"python3",r.fetch,r.limits.maxOutputSize),h=r.limits.maxPythonTimeoutMs,a=R(r.fs);if(a.poisonedError!==null)return{stdout:"",stderr:`python3: ${a.poisonedError}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-HYLF56CC.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as readlinkCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-E26NQEH2.js";import"./chunk-47IFMQYS.js";import"./chunk-3MRB66F4.js";import"./chunk-R2J5MJOM.js";import"./chunk-GA5TPRMF.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import"./chunk-I57EACSL.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as rgCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-F2PYTUMR.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as rmCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-THFQI5LV.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as rmdirCommand};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b}from"./chunk-7KMOGI3N.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{b as flagsForFuzzing,a as split};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a,b,c}from"./chunk-RRECHBUS.js";import"./chunk-3DWQCLNP.js";import"./chunk-QKJAAJ7J.js";import"./chunk-42AMF6EE.js";import"./chunk-HWI42GQO.js";import"./chunk-NBTZL3VS.js";import"./chunk-HWK7KFGB.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as _internals,c as flagsForFuzzing,b as sqlite3Command};