just-bash 3.4.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bin/chunks/{awk2-DZN2ZRSE.js → awk2-C4A37H5N.js} +1 -1
  3. package/dist/bin/{shell/chunks/base64-TP4NUOEB.js → chunks/base64-FLJ4YPHB.js} +1 -1
  4. package/dist/bin/chunks/{cat-A3REFE6L.js → cat-2J5MA5PY.js} +1 -1
  5. package/dist/bin/{shell/chunks/chmod-PHPDPTZD.js → chunks/chmod-ZM5WLMZI.js} +1 -1
  6. package/dist/bin/chunks/{chunk-ODPB5AH7.js → chunk-2HFDEZUY.js} +1 -1
  7. package/dist/bin/chunks/{chunk-DX5LO7JF.js → chunk-2INNLNI5.js} +1 -1
  8. package/dist/bin/chunks/{chunk-57BWX3A3.js → chunk-2ND6MMXN.js} +1 -1
  9. package/dist/bin/chunks/{chunk-QUWWWM4E.js → chunk-2ORJ5HTY.js} +1 -1
  10. package/dist/bin/chunks/{chunk-SOKKZSUV.js → chunk-3SCW7PD5.js} +1 -1
  11. package/dist/bin/chunks/{chunk-TKBTWIXO.js → chunk-42AMF6EE.js} +1 -1
  12. package/dist/bin/{shell/chunks/chunk-NFYXRUSI.js → chunks/chunk-44MQ5AXA.js} +1 -1
  13. package/dist/bin/chunks/{chunk-GE5ERIO2.js → chunk-4APSDE57.js} +1 -1
  14. package/dist/bin/chunks/{chunk-ODCVIRIN.js → chunk-74TZ7ZF7.js} +1 -1
  15. package/dist/bin/chunks/{chunk-OD2SHTFL.js → chunk-7WBCA2BB.js} +1 -1
  16. package/dist/bin/{shell/chunks/chunk-MOCKUJD6.js → chunks/chunk-APV27ZZW.js} +1 -1
  17. package/dist/bin/{shell/chunks/chunk-YB3A42T5.js → chunks/chunk-BCQSUELK.js} +1 -1
  18. package/dist/bin/chunks/{chunk-FC5CC5UP.js → chunk-BJRT4VKD.js} +1 -1
  19. package/dist/bin/chunks/{chunk-6WNZWDBA.js → chunk-BOYPCOSV.js} +1 -1
  20. package/dist/bin/chunks/{chunk-KHS7PCAP.js → chunk-BZWGVRFA.js} +2 -2
  21. package/dist/bin/chunks/{chunk-BPMGKB5E.js → chunk-EXGPMLIE.js} +1 -1
  22. package/dist/bin/{shell/chunks/chunk-MLJZPRDV.js → chunks/chunk-FB44CW33.js} +1 -1
  23. package/dist/bin/chunks/{chunk-35BSNGJK.js → chunk-GRP7L2EL.js} +1 -1
  24. package/dist/bin/{shell/chunks/chunk-3DCUOX7D.js → chunks/chunk-GTULZ3ZD.js} +1 -1
  25. package/dist/bin/{shell/chunks/chunk-O5R7J45W.js → chunks/chunk-HL7NFZVQ.js} +1 -1
  26. package/dist/bin/chunks/chunk-HWI42GQO.js +7 -0
  27. package/dist/bin/{shell/chunks/chunk-TY77F4UM.js → chunks/chunk-ISOWCECJ.js} +1 -1
  28. package/dist/bin/chunks/{chunk-TIYIKCEZ.js → chunk-JQM3DKCH.js} +1 -1
  29. package/dist/bin/{shell/chunks/chunk-NWBQ75GZ.js → chunks/chunk-MF3GVFLC.js} +1 -1
  30. package/dist/bin/chunks/{chunk-6KTOOQK6.js → chunk-MHAGHCSO.js} +1 -1
  31. package/dist/bin/{shell/chunks/chunk-62NF3462.js → chunks/chunk-MNSMZU47.js} +1 -1
  32. package/dist/bin/chunks/{chunk-GGPUS2B4.js → chunk-MRPJL3ZK.js} +1 -1
  33. package/dist/bin/{shell/chunks/chunk-IHS3YLRI.js → chunks/chunk-MYEPQX6Y.js} +1 -1
  34. package/dist/bin/chunks/{chunk-EJIZDPMG.js → chunk-PPVF2N6C.js} +1 -1
  35. package/dist/bin/{shell/chunks/chunk-7NMBLWZ5.js → chunks/chunk-QFTZKD5O.js} +1 -1
  36. package/dist/bin/chunks/{chunk-YABXNPH6.js → chunk-TIHFGNPS.js} +1 -1
  37. package/dist/bin/chunks/{chunk-YBTJPT3R.js → chunk-UHNV55NF.js} +1 -1
  38. package/dist/bin/{shell/chunks/chunk-XG7YUZ3R.js → chunks/chunk-UNKX6YM6.js} +1 -1
  39. package/dist/bin/{shell/chunks/chunk-BXDEO6VY.js → chunks/chunk-VKTV45AP.js} +1 -1
  40. package/dist/bin/{shell/chunks/expr-FAB3XEIB.js → chunks/expr-TDF3B6QJ.js} +1 -1
  41. package/dist/bin/{shell/chunks/file-ZHL2YACR.js → chunks/file-AJGG7RYT.js} +1 -1
  42. package/dist/bin/chunks/{flag-coverage-SPPGTKG3.js → flag-coverage-DOLZIUQ7.js} +1 -1
  43. package/dist/bin/{shell/chunks/grep-FBVRTH4M.js → chunks/grep-WUZMZDGY.js} +1 -1
  44. package/dist/bin/chunks/{gzip-AWQGRTSF.js → gzip-JA7JQBUS.js} +1 -1
  45. package/dist/bin/chunks/{head-A7CPWX7R.js → head-YGKW3HS4.js} +1 -1
  46. package/dist/bin/{shell/chunks/html-to-markdown-EMODJ24M.js → chunks/html-to-markdown-ZWL7LZIP.js} +1 -1
  47. package/dist/bin/chunks/{jq-DXL4NMI5.js → jq-5MI4V3G5.js} +1 -1
  48. package/dist/bin/chunks/{js-exec-BFLXGNPQ.js → js-exec-DJQLXWCS.js} +1 -1
  49. package/dist/bin/chunks/js-exec-worker.js +60 -4
  50. package/dist/bin/{shell/chunks/od-ZPR6FUOW.js → chunks/od-YCY27MMO.js} +1 -1
  51. package/dist/bin/{shell/chunks/paste-RQKXCKQO.js → chunks/paste-ACKOG3XS.js} +1 -1
  52. package/dist/bin/{shell/chunks/python3-WKVKCO33.js → chunks/python3-JCJHSX4Z.js} +1 -1
  53. package/dist/bin/chunks/{rg-34TWIR7N.js → rg-A3E7YM2A.js} +1 -1
  54. package/dist/bin/{shell/chunks/sed-SW74NKGU.js → chunks/sed-KJWKB22J.js} +1 -1
  55. package/dist/bin/chunks/{sleep-J2AVORMB.js → sleep-DVFE2GSF.js} +1 -1
  56. package/dist/bin/chunks/{split-EDDYGW4A.js → split-XMXBXL5Q.js} +1 -1
  57. package/dist/bin/chunks/{sqlite3-AZ27WWV7.js → sqlite3-DNH2VLVN.js} +1 -1
  58. package/dist/bin/chunks/sqlite3-worker.js +60 -4
  59. package/dist/bin/{shell/chunks/stat-XNGV2W6W.js → chunks/stat-5PUSTPTK.js} +1 -1
  60. package/dist/bin/chunks/{tail-H2WOZSEI.js → tail-4MB7HHIZ.js} +1 -1
  61. package/dist/bin/chunks/{tar-MZP7QXR4.js → tar-FRDUJZDN.js} +1 -1
  62. package/dist/bin/{shell/chunks/timeout-GH6S72QX.js → chunks/timeout-YGFHQJKX.js} +1 -1
  63. package/dist/bin/chunks/{tr-RVCBERJ4.js → tr-Z6N34HZM.js} +1 -1
  64. package/dist/bin/chunks/worker.js +60 -4
  65. package/dist/bin/chunks/{xan-BSNJF6SH.js → xan-VSF6ZQGZ.js} +1 -1
  66. package/dist/bin/chunks/{xan-view-H3LNQ72O.js → xan-view-UEFBHYVN.js} +1 -1
  67. package/dist/bin/chunks/{yq-GNMXK6OP.js → yq-K5N5JD4N.js} +1 -1
  68. package/dist/bin/just-bash.js +1 -1
  69. package/dist/bin/shell/chunks/{awk2-DZN2ZRSE.js → awk2-C4A37H5N.js} +1 -1
  70. package/dist/bin/{chunks/base64-TP4NUOEB.js → shell/chunks/base64-FLJ4YPHB.js} +1 -1
  71. package/dist/bin/shell/chunks/{cat-A3REFE6L.js → cat-2J5MA5PY.js} +1 -1
  72. package/dist/bin/{chunks/chmod-PHPDPTZD.js → shell/chunks/chmod-ZM5WLMZI.js} +1 -1
  73. package/dist/bin/shell/chunks/{chunk-ODPB5AH7.js → chunk-2HFDEZUY.js} +1 -1
  74. package/dist/bin/shell/chunks/{chunk-DX5LO7JF.js → chunk-2INNLNI5.js} +1 -1
  75. package/dist/bin/shell/chunks/{chunk-57BWX3A3.js → chunk-2ND6MMXN.js} +1 -1
  76. package/dist/bin/shell/chunks/{chunk-QUWWWM4E.js → chunk-2ORJ5HTY.js} +1 -1
  77. package/dist/bin/shell/chunks/{chunk-SOKKZSUV.js → chunk-3SCW7PD5.js} +1 -1
  78. package/dist/bin/shell/chunks/{chunk-TKBTWIXO.js → chunk-42AMF6EE.js} +1 -1
  79. package/dist/bin/{chunks/chunk-NFYXRUSI.js → shell/chunks/chunk-44MQ5AXA.js} +1 -1
  80. package/dist/bin/shell/chunks/{chunk-GE5ERIO2.js → chunk-4APSDE57.js} +1 -1
  81. package/dist/bin/shell/chunks/{chunk-ODCVIRIN.js → chunk-74TZ7ZF7.js} +1 -1
  82. package/dist/bin/shell/chunks/{chunk-OD2SHTFL.js → chunk-7WBCA2BB.js} +1 -1
  83. package/dist/bin/{chunks/chunk-MOCKUJD6.js → shell/chunks/chunk-APV27ZZW.js} +1 -1
  84. package/dist/bin/{chunks/chunk-YB3A42T5.js → shell/chunks/chunk-BCQSUELK.js} +1 -1
  85. package/dist/bin/shell/chunks/{chunk-FC5CC5UP.js → chunk-BJRT4VKD.js} +1 -1
  86. package/dist/bin/shell/chunks/{chunk-6WNZWDBA.js → chunk-BOYPCOSV.js} +1 -1
  87. package/dist/bin/shell/chunks/{chunk-KHS7PCAP.js → chunk-BZWGVRFA.js} +2 -2
  88. package/dist/bin/shell/chunks/{chunk-BPMGKB5E.js → chunk-EXGPMLIE.js} +1 -1
  89. package/dist/bin/{chunks/chunk-MLJZPRDV.js → shell/chunks/chunk-FB44CW33.js} +1 -1
  90. package/dist/bin/shell/chunks/{chunk-35BSNGJK.js → chunk-GRP7L2EL.js} +1 -1
  91. package/dist/bin/{chunks/chunk-3DCUOX7D.js → shell/chunks/chunk-GTULZ3ZD.js} +1 -1
  92. package/dist/bin/{chunks/chunk-O5R7J45W.js → shell/chunks/chunk-HL7NFZVQ.js} +1 -1
  93. package/dist/bin/shell/chunks/chunk-HWI42GQO.js +7 -0
  94. package/dist/bin/{chunks/chunk-TY77F4UM.js → shell/chunks/chunk-ISOWCECJ.js} +1 -1
  95. package/dist/bin/shell/chunks/{chunk-TIYIKCEZ.js → chunk-JQM3DKCH.js} +1 -1
  96. package/dist/bin/{chunks/chunk-NWBQ75GZ.js → shell/chunks/chunk-MF3GVFLC.js} +1 -1
  97. package/dist/bin/shell/chunks/{chunk-6KTOOQK6.js → chunk-MHAGHCSO.js} +1 -1
  98. package/dist/bin/{chunks/chunk-62NF3462.js → shell/chunks/chunk-MNSMZU47.js} +1 -1
  99. package/dist/bin/shell/chunks/{chunk-GGPUS2B4.js → chunk-MRPJL3ZK.js} +1 -1
  100. package/dist/bin/{chunks/chunk-IHS3YLRI.js → shell/chunks/chunk-MYEPQX6Y.js} +1 -1
  101. package/dist/bin/shell/chunks/{chunk-EJIZDPMG.js → chunk-PPVF2N6C.js} +1 -1
  102. package/dist/bin/{chunks/chunk-7NMBLWZ5.js → shell/chunks/chunk-QFTZKD5O.js} +1 -1
  103. package/dist/bin/shell/chunks/{chunk-YABXNPH6.js → chunk-TIHFGNPS.js} +1 -1
  104. package/dist/bin/shell/chunks/{chunk-YBTJPT3R.js → chunk-UHNV55NF.js} +1 -1
  105. package/dist/bin/{chunks/chunk-XG7YUZ3R.js → shell/chunks/chunk-UNKX6YM6.js} +1 -1
  106. package/dist/bin/{chunks/chunk-BXDEO6VY.js → shell/chunks/chunk-VKTV45AP.js} +1 -1
  107. package/dist/bin/{chunks/expr-FAB3XEIB.js → shell/chunks/expr-TDF3B6QJ.js} +1 -1
  108. package/dist/bin/{chunks/file-ZHL2YACR.js → shell/chunks/file-AJGG7RYT.js} +1 -1
  109. package/dist/bin/shell/chunks/{flag-coverage-SPPGTKG3.js → flag-coverage-DOLZIUQ7.js} +1 -1
  110. package/dist/bin/{chunks/grep-FBVRTH4M.js → shell/chunks/grep-WUZMZDGY.js} +1 -1
  111. package/dist/bin/shell/chunks/{gzip-AWQGRTSF.js → gzip-JA7JQBUS.js} +1 -1
  112. package/dist/bin/shell/chunks/{head-A7CPWX7R.js → head-YGKW3HS4.js} +1 -1
  113. package/dist/bin/{chunks/html-to-markdown-EMODJ24M.js → shell/chunks/html-to-markdown-ZWL7LZIP.js} +1 -1
  114. package/dist/bin/shell/chunks/{jq-DXL4NMI5.js → jq-5MI4V3G5.js} +1 -1
  115. package/dist/bin/shell/chunks/{js-exec-BFLXGNPQ.js → js-exec-DJQLXWCS.js} +1 -1
  116. package/dist/bin/{chunks/od-ZPR6FUOW.js → shell/chunks/od-YCY27MMO.js} +1 -1
  117. package/dist/bin/{chunks/paste-RQKXCKQO.js → shell/chunks/paste-ACKOG3XS.js} +1 -1
  118. package/dist/bin/{chunks/python3-WKVKCO33.js → shell/chunks/python3-JCJHSX4Z.js} +1 -1
  119. package/dist/bin/shell/chunks/{rg-34TWIR7N.js → rg-A3E7YM2A.js} +1 -1
  120. package/dist/bin/{chunks/sed-SW74NKGU.js → shell/chunks/sed-KJWKB22J.js} +1 -1
  121. package/dist/bin/shell/chunks/{sleep-J2AVORMB.js → sleep-DVFE2GSF.js} +1 -1
  122. package/dist/bin/shell/chunks/{split-EDDYGW4A.js → split-XMXBXL5Q.js} +1 -1
  123. package/dist/bin/shell/chunks/{sqlite3-AZ27WWV7.js → sqlite3-DNH2VLVN.js} +1 -1
  124. package/dist/bin/{chunks/stat-XNGV2W6W.js → shell/chunks/stat-5PUSTPTK.js} +1 -1
  125. package/dist/bin/shell/chunks/{tail-H2WOZSEI.js → tail-4MB7HHIZ.js} +1 -1
  126. package/dist/bin/shell/chunks/{tar-MZP7QXR4.js → tar-FRDUJZDN.js} +1 -1
  127. package/dist/bin/{chunks/timeout-GH6S72QX.js → shell/chunks/timeout-YGFHQJKX.js} +1 -1
  128. package/dist/bin/shell/chunks/{tr-RVCBERJ4.js → tr-Z6N34HZM.js} +1 -1
  129. package/dist/bin/shell/chunks/{xan-BSNJF6SH.js → xan-VSF6ZQGZ.js} +1 -1
  130. package/dist/bin/shell/chunks/{xan-view-H3LNQ72O.js → xan-view-UEFBHYVN.js} +1 -1
  131. package/dist/bin/shell/chunks/{yq-GNMXK6OP.js → yq-K5N5JD4N.js} +1 -1
  132. package/dist/bin/shell/shell.js +1 -1
  133. package/dist/bundle/browser.js +446 -444
  134. package/dist/bundle/chunks/{awk2-IDCJYLV2.js → awk2-NPLZQ3K7.js} +1 -1
  135. package/dist/bundle/chunks/{base64-3XQZ3ADB.js → base64-2BAITDZF.js} +1 -1
  136. package/dist/bundle/chunks/{cat-XWS72C47.js → cat-33KGN4MZ.js} +1 -1
  137. package/dist/bundle/chunks/{chmod-6FVWFWKL.js → chmod-APOXUPXW.js} +1 -1
  138. package/dist/bundle/chunks/{chunk-JQL34RLH.js → chunk-3CBCABOZ.js} +1 -1
  139. package/dist/bundle/chunks/{chunk-EZFSCUSP.js → chunk-5ELNHAAJ.js} +1 -1
  140. package/dist/bundle/chunks/{chunk-M7DIEMEN.js → chunk-6DTD75TR.js} +1 -1
  141. package/dist/bundle/chunks/{chunk-5GI2HJYO.js → chunk-6KK46B7Q.js} +1 -1
  142. package/dist/bundle/chunks/{chunk-264HW33U.js → chunk-7IFSXTCJ.js} +1 -1
  143. package/dist/bundle/chunks/{chunk-4MPKG4PJ.js → chunk-A3D7NRT6.js} +1 -1
  144. package/dist/bundle/chunks/{chunk-EVJMYTCY.js → chunk-ALOFNPKY.js} +2 -2
  145. package/dist/bundle/chunks/{chunk-QKQP2SCP.js → chunk-BKUWXPEM.js} +1 -1
  146. package/dist/bundle/chunks/{chunk-W4IV5QW4.js → chunk-CFBEDNHJ.js} +1 -1
  147. package/dist/bundle/chunks/{chunk-CVMQI27W.js → chunk-DMWNBCXJ.js} +1 -1
  148. package/dist/bundle/chunks/{chunk-VQCA62JK.js → chunk-FNEG7DFQ.js} +1 -1
  149. package/dist/bundle/chunks/{chunk-ENMIHC6G.js → chunk-GVKYQN5J.js} +1 -1
  150. package/dist/bundle/chunks/{chunk-QNXJ5FEA.js → chunk-ICQYTW7W.js} +1 -1
  151. package/dist/bundle/chunks/{chunk-4X2R47I5.js → chunk-JA6EY7US.js} +1 -1
  152. package/dist/bundle/chunks/{chunk-XJWBSZIU.js → chunk-MHY57JTL.js} +1 -1
  153. package/dist/bundle/chunks/{chunk-XZZSXYTK.js → chunk-N3A4JVFJ.js} +1 -1
  154. package/dist/bundle/chunks/{chunk-HZYCWAEC.js → chunk-N3FZSEG7.js} +1 -1
  155. package/dist/bundle/chunks/{chunk-MP3NNO6W.js → chunk-Q6JV5CBB.js} +1 -1
  156. package/dist/bundle/chunks/{chunk-2TLWENMK.js → chunk-QE275OWT.js} +1 -1
  157. package/dist/bundle/chunks/{chunk-GP3D65AC.js → chunk-QPZVR6ZN.js} +1 -1
  158. package/dist/bundle/chunks/{chunk-CA7HMEGG.js → chunk-SI5VPVOA.js} +1 -1
  159. package/dist/bundle/chunks/{chunk-LDCENVG4.js → chunk-TVJ6JVK4.js} +1 -1
  160. package/dist/bundle/chunks/{chunk-UGU4ZDZA.js → chunk-UL6YJ7FT.js} +1 -1
  161. package/dist/bundle/chunks/{chunk-CYCUGNN7.js → chunk-USNDURQI.js} +1 -1
  162. package/dist/bundle/chunks/{chunk-VPJHPG6G.js → chunk-UXHSH7BM.js} +1 -1
  163. package/dist/bundle/chunks/{chunk-6D2ZCRTO.js → chunk-V2SOLEQN.js} +1 -1
  164. package/dist/bundle/chunks/{chunk-QXYDKHGI.js → chunk-WXPNKIIH.js} +1 -1
  165. package/dist/bundle/chunks/{chunk-XW6UBSKO.js → chunk-X3TZEFQG.js} +1 -1
  166. package/dist/bundle/chunks/{chunk-73DVPW3C.js → chunk-XMMV24SP.js} +1 -1
  167. package/dist/bundle/chunks/{chunk-FFNWVPYL.js → chunk-XPDOK3XY.js} +1 -1
  168. package/dist/bundle/chunks/{chunk-MMSRUX6V.js → chunk-XV2V56NQ.js} +1 -1
  169. package/dist/bundle/chunks/{chunk-XOBSBDA5.js → chunk-YDR2IWKO.js} +1 -1
  170. package/dist/bundle/chunks/{chunk-KESUKNUF.js → chunk-YJKHREBZ.js} +1 -1
  171. package/dist/bundle/chunks/chunk-ZBUZKIPX.js +6 -0
  172. package/dist/bundle/chunks/{expr-VKQHAJNO.js → expr-UMT2OHZ7.js} +1 -1
  173. package/dist/bundle/chunks/{file-WGI2QYXG.js → file-VEGKTTSF.js} +1 -1
  174. package/dist/bundle/chunks/{flag-coverage-6LWPOTGE.js → flag-coverage-I6UJUKQ4.js} +1 -1
  175. package/dist/bundle/chunks/{grep-SAEHL7UZ.js → grep-5UPEO42U.js} +1 -1
  176. package/dist/bundle/chunks/{gzip-2SHFSHNB.js → gzip-ZINVK3M6.js} +1 -1
  177. package/dist/bundle/chunks/{head-RMKV5HCV.js → head-CFENJILH.js} +1 -1
  178. package/dist/bundle/chunks/{html-to-markdown-GEKF6U7Z.js → html-to-markdown-GGVR4YGL.js} +1 -1
  179. package/dist/bundle/chunks/{jq-MW2VEOCW.js → jq-X2P7Q64K.js} +1 -1
  180. package/dist/bundle/chunks/{js-exec-J4DLDAWY.js → js-exec-XKF2B7C3.js} +1 -1
  181. package/dist/bundle/chunks/js-exec-worker.js +60 -4
  182. package/dist/bundle/chunks/{od-26HTHXXM.js → od-BI6XJPXY.js} +1 -1
  183. package/dist/bundle/chunks/{paste-WIDT5N6N.js → paste-LLZ3ZQR2.js} +1 -1
  184. package/dist/bundle/chunks/{python3-4Q7M5CDT.js → python3-F5S5TYGS.js} +1 -1
  185. package/dist/bundle/chunks/{rg-IA4UE2UF.js → rg-UQE6KUBP.js} +1 -1
  186. package/dist/bundle/chunks/{sed-LSWWSQ6J.js → sed-JW2JDLSI.js} +1 -1
  187. package/dist/bundle/chunks/{sleep-YMKR4HFQ.js → sleep-PPRBTSVR.js} +1 -1
  188. package/dist/bundle/chunks/{split-EATPU6Q7.js → split-2SD6EP72.js} +1 -1
  189. package/dist/bundle/chunks/{sqlite3-XXXHFJGP.js → sqlite3-UVVRYDAL.js} +1 -1
  190. package/dist/bundle/chunks/sqlite3-worker.js +60 -4
  191. package/dist/bundle/chunks/{stat-AKB6X3TV.js → stat-6KILP5AL.js} +1 -1
  192. package/dist/bundle/chunks/{tail-OEM7DTYC.js → tail-BDNMS4FR.js} +1 -1
  193. package/dist/bundle/chunks/{tar-26DH77YN.js → tar-6365WH6H.js} +1 -1
  194. package/dist/bundle/chunks/{timeout-FOKHN3GQ.js → timeout-C6WDYPLV.js} +1 -1
  195. package/dist/bundle/chunks/{tr-VUNRKFC3.js → tr-3I4MDKIF.js} +1 -1
  196. package/dist/bundle/chunks/worker.js +60 -4
  197. package/dist/bundle/chunks/{xan-LUEGYXLV.js → xan-HUOXKUQA.js} +1 -1
  198. package/dist/bundle/chunks/{xan-view-MDMZTFFI.js → xan-view-RT2WKDOQ.js} +1 -1
  199. package/dist/bundle/chunks/{yq-B7E6UX7Y.js → yq-MI27NZ2U.js} +1 -1
  200. package/dist/bundle/index.cjs +874 -872
  201. package/dist/bundle/index.js +1 -1
  202. package/dist/commands/sqlite3/worker.js +60 -4
  203. package/dist/security/blocked-globals.d.ts +60 -0
  204. package/dist/security/defense-context.d.ts +13 -0
  205. package/dist/security/defense-in-depth-box.d.ts +354 -0
  206. package/dist/security/index.d.ts +33 -0
  207. package/dist/security/safe-timestamp.d.ts +1 -0
  208. package/dist/security/security-violation-logger.d.ts +99 -0
  209. package/dist/security/trusted-globals.d.ts +17 -0
  210. package/dist/security/types.d.ts +151 -0
  211. package/dist/security/violation-error-message.d.ts +3 -0
  212. package/dist/security/wasm-callback.d.ts +6 -0
  213. package/dist/security/worker-defense-in-depth.d.ts +228 -0
  214. package/dist/transform/pipeline.d.ts +8 -0
  215. package/dist/transform/plugins/command-collector.d.ts +15 -0
  216. package/dist/transform/plugins/tee-plugin.d.ts +40 -0
  217. package/dist/transform/serialize.d.ts +4 -0
  218. package/dist/transform/types.d.ts +18 -0
  219. package/package.json +4 -2
  220. package/dist/bin/chunks/chunk-SHAOH2UJ.js +0 -5
  221. package/dist/bin/shell/chunks/chunk-SHAOH2UJ.js +0 -5
  222. package/dist/bundle/chunks/chunk-RT7ROXPF.js +0 -4
@@ -1,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 Ie}from"./chunk-MROECM42.js";import{a as B,b as U}from"./chunk-TKBTWIXO.js";import{a as O,b as X}from"./chunk-XBX7KFWK.js";import{a as z}from"./chunk-ODCVIRIN.js";import{a as $}from"./chunk-SHAOH2UJ.js";import{d as ve}from"./chunk-CPTQXTBJ.js";import{l as w}from"./chunk-LCP3IKI7.js";import{a as V,b as ee}from"./chunk-CPKBPQ2C.js";import{a as Re,b as Ae,c as pe}from"./chunk-MUFNRCMY.js";var Qe=1e4,Ze=100,Ye=new X(/\s+/);function fe(e={}){let{fieldSep:t=Ye,maxIterations:n=Qe,maxRecursionDepth:r=Ze,maxOutputSize:s=0,maxArrayElements:a=1e5,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}=e;return{FS:" ",OFS:" ",ORS:`
3
+ import{a as Ie}from"./chunk-MROECM42.js";import{a as B,b as U}from"./chunk-42AMF6EE.js";import{a as O,b as X}from"./chunk-XBX7KFWK.js";import{a as z}from"./chunk-74TZ7ZF7.js";import{a as $}from"./chunk-HWI42GQO.js";import{d as ve}from"./chunk-CPTQXTBJ.js";import{l as w}from"./chunk-LCP3IKI7.js";import{a as V,b as ee}from"./chunk-CPKBPQ2C.js";import{a as Re,b as Ae,c as pe}from"./chunk-MUFNRCMY.js";var Qe=1e4,Ze=100,Ye=new X(/\s+/);function fe(e={}){let{fieldSep:t=Ye,maxIterations:n=Qe,maxRecursionDepth:r=Ze,maxOutputSize:s=0,maxArrayElements:a=1e5,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}=e;return{FS:" ",OFS:" ",ORS:`
4
4
  `,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,getlineCommandStreams:new Map,getlineFileStreams:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:r,maxOutputSize:s,maxArrayElements:a,arrayElementCount:0,recordsProcessed:0,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}}function ke(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function F(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function L(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}var be=10*1024*1024;function Ee(e){return new ve(e,"awk string",()=>new w(`string size limit exceeded (${e} bytes)`,"string_length"))}function _(e){return e.maxOutputSize>0?e.maxOutputSize:be}function te(e,t,n,r,s){let a=Ee(s),o=0,l=0,c=0;for(let u of t.matchAll(e)){let f=u.index??0;l++,a.append(e.slice(o,f)),n(l)?(a.append(r(u)),c++):a.append(u[0]),o=f+u[0].length}return a.append(e.slice(o)),{value:a.build(),replacements:c}}async function ne(e,t){if(e.type==="regex")return e.pattern;let n=L(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function Oe(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(F(await t.evalExpr(e.index)))}`:"$0":"$0"}function Le(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return L(t.vars[e]??"")}function Te(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let r=parseInt(e.slice(1),10)-1;for(;n.fields.length<=r;)n.fields.push("");n.fields[r]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function Je(e,t,n){return e.length===0?t.line.length:L(await n.evalExpr(e[0])).length}async function et(e,t,n){if(e.length<2)return"";let r=L(await n.evalExpr(e[0])),s=Math.floor(F(await n.evalExpr(e[1])))-1;if(e.length>=3){let a=Math.floor(F(await n.evalExpr(e[2])));return r.substr(Math.max(0,s),a)}return r.substr(Math.max(0,s))}async function tt(e,t,n){if(e.length<2)return 0;let r=L(await n.evalExpr(e[0])),s=L(await n.evalExpr(e[1])),a=r.indexOf(s);return a===-1?0:a+1}async function nt(e,t,n){if(e.length<2)return 0;let r=L(await n.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let a=s.name,o=t.FS;if(e.length>=3){let f=e[2];if(f.type==="regex")o=O(f.pattern);else{let k=L(await n.evalExpr(f));o=k===" "?O("\\s+"):k}}else t.FS===" "&&(o=O("\\s+"));let l=Object.keys(t.arrays[a]??{}).length,c=t.maxArrayElements-t.arrayElementCount+l,u=typeof o=="string"?r.split(o,c+1):o.split(r,c+1);if(u.length>c)throw new w(`array element limit exceeded (${t.maxArrayElements})`,"array_elements");t.arrays[a]=Object.create(null);for(let f=0;f<u.length;f++)t.arrays[a][String(f+1)]=u[f];return t.arrayElementCount+=u.length-l,u.length}async function it(e,t,n){if(e.length<2)return 0;let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=await Oe(e[2],n),o=Le(a,t);try{let l=O(r,"g"),c=te(o,l,u=>u===1,u=>Pe(s,u[0],_(t)),_(t));return Te(a,c.value,t),c.replacements}catch(l){return z(l),0}}async function rt(e,t,n){if(e.length<2)return 0;let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=await Oe(e[2],n),o=Le(a,t);try{let l=O(r,"g"),c=te(o,l,()=>!0,u=>Pe(s,u[0],_(t)),_(t));return Te(a,c.value,t),c.replacements}catch(l){return z(l),0}}function Pe(e,t,n){let r=Ee(n),s=0;for(;s<e.length;)if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];a==="&"?(r.append("&"),s+=2):a==="\\"?(r.append("\\"),s+=2):(r.append(e[s+1]),s+=2)}else e[s]==="&"?(r.append(t),s++):(r.append(e[s]),s++);return r.build()}async function st(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let r=L(await n.evalExpr(e[0])),s=await ne(e[1],n);try{let o=O(s).exec(r);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function at(e,t,n){if(e.length<3)return"";let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=L(await n.evalExpr(e[2])),o=e.length>=4?L(await n.evalExpr(e[3])):t.line;try{let l=a.toLowerCase()==="g",c=l?0:parseInt(a,10)||1;if(l){let u=O(r,"g");return te(o,u,()=>!0,f=>Ce(s,f[0],f.slice(1),_(t)),_(t)).value}else{let u=O(r,"g");return te(o,u,f=>f===c,f=>Ce(s,f[0],f.slice(1),_(t)),_(t)).value}}catch(l){return z(l),o}}function Ce(e,t,n,r){let s=Ee(r),a=0;for(;a<e.length;)if(e[a]==="\\"&&a+1<e.length){let o=e[a+1];if(o==="&")s.append("&"),a+=2;else if(o==="0")s.append(t),a+=2;else if(o>="1"&&o<="9"){let l=parseInt(o,10)-1;s.append(n[l]||""),a+=2}else o==="n"?(s.append(`
5
5
  `),a+=2):o==="t"?(s.append(" "),a+=2):(s.append(o),a+=2)}else e[a]==="&"?(s.append(t),a++):(s.append(e[a]),a++);return s.build()}async function ot(e,t,n){return e.length===0?"":L(await n.evalExpr(e[0])).toLowerCase()}async function lt(e,t,n){return e.length===0?"":L(await n.evalExpr(e[0])).toUpperCase()}async function ut(e,t,n){if(e.length===0)return"";let r=L(await n.evalExpr(e[0])),s=[];for(let a=1;a<e.length;a++)s.push(await n.evalExpr(e[a]));return ie(r,s,_(t))}async function ct(e,t,n){return e.length===0?0:Math.floor(F(await n.evalExpr(e[0])))}async function ht(e,t,n){return e.length===0?0:Math.sqrt(F(await n.evalExpr(e[0])))}async function pt(e,t,n){return e.length===0?0:Math.sin(F(await n.evalExpr(e[0])))}async function ft(e,t,n){return e.length===0?0:Math.cos(F(await n.evalExpr(e[0])))}async function dt(e,t,n){let r=e.length>0?F(await n.evalExpr(e[0])):0,s=e.length>1?F(await n.evalExpr(e[1])):0;return Math.atan2(r,s)}async function Et(e,t,n){return e.length===0?0:Math.log(F(await n.evalExpr(e[0])))}async function mt(e,t,n){return e.length===0?1:Math.exp(F(await n.evalExpr(e[0])))}function Nt(e,t,n){return t.random?t.random():Math.random()}async function yt(e,t,n){let r=e.length>0?F(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=r,r}function wt(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function de(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var gt=1e4;function ie(e,t,n=be){let r=0,s="",a=0,o=0,l=Math.min(gt,n),c=u=>{let f=V(u);if(f>n-a)throw new w(`formatted string size limit exceeded (${n} bytes)`,"string_length");s+=u,a+=f};for(;o<e.length;)if(e[o]==="%"&&o+1<e.length){let u=o+1,f="",k="",C="",A,T=u;for(;u<e.length&&/\d/.test(e[u]);)u++;u>T&&e[u]==="$"?(A=parseInt(e.substring(T,u),10)-1,u++):u=T;let he=()=>{if(u<e.length){if(u+1<e.length&&(e[u]==="h"&&e[u+1]==="h"||e[u]==="l"&&e[u+1]==="l")){u+=2;return}/[lzjh]/.test(e[u])&&u++}};for(;u<e.length&&/[-+ #0]/.test(e[u]);)f+=e[u++];if(e[u]==="*"){let p=t[r++],N=p!==void 0?Math.floor(Number(p)):0;if(!Number.isFinite(N)||!Number.isSafeInteger(N))throw new w(`printf width limit exceeded (${l} bytes)`,"string_length");N<0?(f+="-",k=String(-N)):k=String(N),u++}else for(;u<e.length&&/\d/.test(e[u]);)k+=e[u++];if(k&&parseInt(k,10)>l)throw new w(`printf width limit exceeded (${l} bytes)`,"string_length");if(e[u]==="."){if(u++,e[u]==="*"){let p=t[r++],N=p!==void 0?Math.floor(Number(p)):0;if(!Number.isFinite(N)||!Number.isSafeInteger(N))throw new w(`printf precision limit exceeded (${l} bytes)`,"string_length");C=N<0?"":String(N),u++}else for(;u<e.length&&/\d/.test(e[u]);)C+=e[u++];if(C&&parseInt(C,10)>l)throw new w(`printf precision limit exceeded (${l} bytes)`,"string_length")}he();let W=e[u],y=t[A!==void 0?A:r];switch(W){case"s":{let p=y!==void 0?String(y):"";if(C&&(p=p.substring(0,parseInt(C,10))),k){let N=parseInt(k,10);f.includes("-")?p=p.padEnd(N):p=p.padStart(N)}c(p),A===void 0&&r++;break}case"d":case"i":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=p<0,g=Math.abs(p).toString();if(C){let x=parseInt(C,10);g=g.padStart(x,"0")}let d="";N?d="-":f.includes("+")?d="+":f.includes(" ")&&(d=" ");let I=d+g;if(k){let x=parseInt(k,10);f.includes("-")?I=I.padEnd(x):f.includes("0")&&!C?I=d+g.padStart(x-d.length,"0"):I=I.padStart(x)}c(I),A===void 0&&r++;break}case"f":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p.toFixed(N);if(k){let d=parseInt(k,10);f.includes("-")?g=g.padEnd(d):g=g.padStart(d)}c(g),A===void 0&&r++;break}case"e":case"E":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p.toExponential(N);if(W==="E"&&(g=g.toUpperCase()),k){let d=parseInt(k,10);f.includes("-")?g=g.padEnd(d):g=g.padStart(d)}c(g),A===void 0&&r++;break}case"g":case"G":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p!==0?Math.floor(Math.log10(Math.abs(p))):0,d;if(p===0?d="0":g<-4||g>=N?(d=p.toExponential(N-1),W==="G"&&(d=d.toUpperCase())):d=p.toPrecision(N),d.includes(".")&&(d=d.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),d.includes("e")&&(d=d.replace(/\.?0+e/,"e")),k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"x":case"X":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=Math.abs(p).toString(16);if(W==="X"&&(N=N.toUpperCase()),C){let I=parseInt(C,10);N=N.padStart(I,"0")}let g=p<0?"-":"",d=g+N;if(k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):f.includes("0")&&!C?d=g+N.padStart(I-g.length,"0"):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"o":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=Math.abs(p).toString(8);if(C){let I=parseInt(C,10);N=N.padStart(I,"0")}let g=p<0?"-":"",d=g+N;if(k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):f.includes("0")&&!C?d=g+N.padStart(I-g.length,"0"):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"c":{c(typeof y=="number"?String.fromCharCode(y):String(y??"").charAt(0)||""),A===void 0&&r++;break}case"%":c("%");break;default:c(e.substring(o,u+1))}o=u+1}else if(e[o]==="\\"&&o+1<e.length){let u=e[o+1];switch(u){case"n":c(`
6
6
  `);break;case"t":c(" ");break;case"r":c("\r");break;case"\\":c("\\");break;default:c(u)}o+=2}else c(e[o++]);return s}var Me=new Map([["length",Je],["substr",et],["index",tt],["split",nt],["sub",it],["gsub",rt],["match",st],["gensub",at],["tolower",ot],["toupper",lt],["sprintf",ut],["int",ct],["sqrt",ht],["sin",pt],["cos",ft],["atan2",dt],["log",Et],["exp",mt],["rand",Nt],["srand",yt],["system",wt("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",de("systime")],["mktime",de("mktime")],["strftime",de("strftime")]]);function P(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function b(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function v(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function me(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function Z(e,t){try{return O(e).test(t)}catch{return!1}}function Fe(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function re(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function Ne(e,t,n){if(t===0)e.line=v(n),e.fields=Fe(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=v(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function K(e,t){e.line=t,e.fields=Fe(e,t),e.NF=e.fields.length}function De(e,t){if(e.FS=t,t===" ")e.fieldSep=new X(/\s+/);else try{e.fieldSep=O(t)}catch{e.fieldSep=O(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function se(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function j(e,t,n){switch(t){case"FS":De(e,v(n));return;case"OFS":e.OFS=v(n);return;case"ORS":e.ORS=v(n);return;case"OFMT":e.OFMT=v(n);return;case"NR":e.NR=Math.floor(b(n));return;case"NF":{let r=Math.floor(b(n));if(r<e.NF)e.fields=e.fields.slice(0,r),e.line=e.fields.join(e.OFS);else if(r>e.NF){for(;e.fields.length<r;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=r;return}case"FNR":e.FNR=Math.floor(b(n));return;case"FILENAME":e.FILENAME=v(n);return;case"RSTART":e.RSTART=Math.floor(b(n));return;case"RLENGTH":e.RLENGTH=Math.floor(b(n));return;case"SUBSEP":e.SUBSEP=v(n);return}e.vars[t]=n}function Y(e,t){let n=t,r=new Set,s=e.arrayAliases.get(n);for(;s!==void 0&&!r.has(n);)r.add(n),n=s,s=e.arrayAliases.get(n);return n}function ae(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let r=Y(e,t);return e.arrays[r]?.[n]??""}function ye(e,t,n,r){let s=Y(e,t);if(e.arrays[s]||(e.arrays[s]=Object.create(null)),!(n in e.arrays[s])){if(e.arrayElementCount>=e.maxArrayElements)throw new w(`array element limit exceeded (${e.maxArrayElements})`,"array_elements");e.arrayElementCount++}e.arrays[s][n]=r}function xe(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let r=Y(e,t);return e.arrays[r]?.[n]!==void 0}function _e(e,t,n){let r=Y(e,t);e.arrays[r]&&(n in e.arrays[r]&&e.arrayElementCount--,delete e.arrays[r][n])}function Ge(e,t){let n=Y(e,t);e.arrayElementCount-=Object.keys(e.arrays[n]??{}).length,delete e.arrays[n]}var Be=null;function Ue(e){Be=e}function M(e,t){B(e.requireDefenseContext,"awk",t)}function R(e,t,n){return U(e.requireDefenseContext,"awk",t,n)}async function E(e,t){switch(M(e,"expression evaluation"),e.coverage?.hit(`awk:expr:${t.type}`),t.type){case"number":return t.value;case"string":return t.value;case"regex":return Z(t.pattern,e.line)?1:0;case"field":return St(e,t);case"variable":return se(e,t.name);case"array_access":return Rt(e,t);case"binary":return At(e,t);case"unary":return kt(e,t);case"ternary":return P(await R(e,"ternary condition evaluation",()=>E(e,t.condition)))?await R(e,"ternary consequent evaluation",()=>E(e,t.consequent)):await R(e,"ternary alternate evaluation",()=>E(e,t.alternate));case"call":return Ct(e,t.name,t.args);case"assignment":return Ot(e,t);case"pre_increment":return Lt(e,t.operand);case"pre_decrement":return Tt(e,t.operand);case"post_increment":return Pt(e,t.operand);case"post_decrement":return Mt(e,t.operand);case"in":return Ft(e,t.key,t.array);case"getline":return Dt(e,t.variable,t.file,t.command);case"tuple":return Gt(e,t.elements);default:return""}}async function St(e,t){M(e,"field reference evaluation");let n=Math.floor(b(await R(e,"field index evaluation",()=>E(e,t.index))));return re(e,n)}async function Rt(e,t){M(e,"array access evaluation");let n=v(await R(e,"array key evaluation",()=>E(e,t.key)));return ae(e,t.array,n)}async function At(e,t){M(e,"binary expression evaluation");let n=t.operator;if(n==="||")return P(await R(e,"logical-or left evaluation",()=>E(e,t.left)))||P(await R(e,"logical-or right evaluation",()=>E(e,t.right)))?1:0;if(n==="&&")return P(await R(e,"logical-and left evaluation",()=>E(e,t.left)))&&P(await R(e,"logical-and right evaluation",()=>E(e,t.right)))?1:0;if(n==="~"){let l=await R(e,"regex left evaluation",()=>E(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let c=t.right.type==="regex"?t.right.pattern:v(await R(e,"regex right evaluation",()=>E(e,t.right)));try{return O(c).test(v(l))?1:0}catch{return 0}}if(n==="!~"){let l=await R(e,"negated-regex left evaluation",()=>E(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let c=t.right.type==="regex"?t.right.pattern:v(await R(e,"negated-regex right evaluation",()=>E(e,t.right)));try{return O(c).test(v(l))?0:1}catch{return 1}}let r=await R(e,"binary left evaluation",()=>E(e,t.left)),s=await R(e,"binary right evaluation",()=>E(e,t.right));if(n===" "){let l=v(r)+v(s);if(e.maxOutputSize>0&&l.length>e.maxOutputSize)throw new w(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return l}if(vt(n))return It(r,s,n);let a=b(r),o=b(s);return ke(a,o,n)}function vt(e){return["<","<=",">",">=","==","!="].includes(e)}function It(e,t,n){let r=me(e),s=me(t);if(r&&s){let l=b(e),c=b(t);switch(n){case"<":return l<c?1:0;case"<=":return l<=c?1:0;case">":return l>c?1:0;case">=":return l>=c?1:0;case"==":return l===c?1:0;case"!=":return l!==c?1:0}}let a=v(e),o=v(t);switch(n){case"<":return a<o?1:0;case"<=":return a<=o?1:0;case">":return a>o?1:0;case">=":return a>=o?1:0;case"==":return a===o?1:0;case"!=":return a!==o?1:0}return 0}async function kt(e,t){M(e,"unary expression evaluation");let n=await R(e,"unary operand evaluation",()=>E(e,t.operand));switch(t.operator){case"!":return P(n)?0:1;case"-":return-b(n);case"+":return+b(n);default:return n}}async function Ct(e,t,n){M(e,"function call evaluation");let r=Me.get(t);if(r)return r(n,e,{evalExpr:a=>E(e,a)});let s=e.functions.get(t);return s?bt(e,s,n):""}async function bt(e,t,n){if(M(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new w(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let r=Object.create(null);for(let l of t.params)r[l]=e.vars[l];let s=[];for(let l=0;l<t.params.length;l++){let c=t.params[l];if(l<n.length){let u=n[l];u.type==="variable"&&(e.arrayAliases.set(c,u.name),s.push(c));let f=await R(e,"user function argument evaluation",()=>E(e,u));e.vars[c]=f}else e.vars[c]=""}e.hasReturn=!1,e.returnValue=void 0;let a=Be;a&&await R(e,"user function body execution",()=>a(e,t.body.statements));let o=e.returnValue??"";for(let l of t.params)r[l]!==void 0?e.vars[l]=r[l]:delete e.vars[l];for(let l of s)e.arrayAliases.delete(l);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,o}async function Ot(e,t){M(e,"assignment evaluation");let n=await R(e,"assignment value evaluation",()=>E(e,t.value)),r=t.target,s=t.operator,a;if(s==="=")a=n;else{let o;if(r.type==="field"){let u=Math.floor(b(await R(e,"assignment field index",()=>E(e,r.index))));o=re(e,u)}else if(r.type==="variable")o=se(e,r.name);else{let u=v(await R(e,"assignment array key",()=>E(e,r.key)));o=ae(e,r.array,u)}let l=b(o),c=b(n);switch(s){case"+=":a=l+c;break;case"-=":a=l-c;break;case"*=":a=l*c;break;case"/=":a=c!==0?l/c:0;break;case"%=":a=c!==0?l%c:0;break;case"^=":a=l**c;break;default:a=n}}if(r.type==="field"){let o=Math.floor(b(await R(e,"assignment target field index",()=>E(e,r.index))));Ne(e,o,a)}else if(r.type==="variable")j(e,r.name,a);else{let o=v(await R(e,"assignment target array key",()=>E(e,r.key)));ye(e,r.array,o,a)}return a}async function oe(e,t,n,r){M(e,"inc/dec evaluation");let s;if(t.type==="field"){let a=Math.floor(b(await R(e,"inc/dec field index",()=>E(e,t.index))));s=b(re(e,a)),Ne(e,a,s+n)}else if(t.type==="variable")s=b(se(e,t.name)),j(e,t.name,s+n);else{let a=v(await R(e,"inc/dec array key",()=>E(e,t.key)));s=b(ae(e,t.array,a)),ye(e,t.array,a,s+n)}return r?s+n:s}async function Lt(e,t){return oe(e,t,1,!0)}async function Tt(e,t){return oe(e,t,-1,!0)}async function Pt(e,t){return oe(e,t,1,!1)}async function Mt(e,t){return oe(e,t,-1,!1)}async function Ft(e,t,n){M(e,"in-expression evaluation");let r;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let a of t.elements)s.push(v(await R(e,"tuple key element evaluation",()=>E(e,a))));r=s.join(e.SUBSEP)}else r=v(await R(e,"in-expression key evaluation",()=>E(e,t)));return xe(e,n,r)?1:0}async function Dt(e,t,n,r){if(M(e,"getline evaluation"),r)return xt(e,t,r);if(n)return _t(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let a=e.lines[s];return t?j(e,t,a):K(e,a),e.NR++,e.lineIndex=s,1}async function xt(e,t,n){let r=e.exec;if(!r)return-1;M(e,"getline command source");let s=v(await R(e,"getline command expression",()=>E(e,n))),a=e.getlineCommandStreams.get(s);if(!a)try{let c=await R(e,"getline command exec",()=>r(s)),f=ee(c.stdout).split(`
@@ -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 as s,b as i}from"./chunk-SHAOH2UJ.js";function a(t,e,n){if(!t||i.isInSandboxedContext())return;let r=`${e} ${n} attempted outside defense context`;throw new s(r,{timestamp:Date.now(),type:"missing_defense_context",message:r,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:i.getCurrentExecutionId()})}async function x(t,e,n,r){a(t,e,`${n} (pre-await)`);let o=await r();return a(t,e,`${n} (post-await)`),o}function d(t,e,n,r){let o=((...c)=>(a(t,e,n),r(...c)));return t?i.bindCurrentContext(o):o}export{a,x as b,d as c};
3
+ import{a as s,b as i}from"./chunk-HWI42GQO.js";function a(t,e,n){if(!t||i.isInSandboxedContext())return;let r=`${e} ${n} attempted outside defense context`;throw new s(r,{timestamp:Date.now(),type:"missing_defense_context",message:r,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:i.getCurrentExecutionId()})}async function x(t,e,n,r){a(t,e,`${n} (pre-await)`);let o=await r();return a(t,e,`${n} (post-await)`),o}function d(t,e,n,r){let o=((...c)=>(a(t,e,n),r(...c)));return t?i.bindCurrentContext(o):o}export{a,x as b,d as c};
@@ -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 as n,b as i,c as r}from"./chunk-35BSNGJK.js";import{a,b as s}from"./chunk-MUFNRCMY.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
3
+ import{a as n,b as i,c as r}from"./chunk-GRP7L2EL.js";import{a,b as s}from"./chunk-MUFNRCMY.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
@@ -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 k}from"./chunk-KP2UH5CJ.js";import{a as v}from"./chunk-ODCVIRIN.js";import{a as y,b,d as S}from"./chunk-CPTQXTBJ.js";import{l as h}from"./chunk-LCP3IKI7.js";import{a as w,b as $}from"./chunk-CPKBPQ2C.js";import{c as L}from"./chunk-DN2YCFOR.js";var g=class extends S{constructor(t){super(t,"xan")}};var C=L(k(),1);var V=class{ctx;site;rows=0;cells=0;constructor(t,i){this.ctx=t,this.site=i}consumeWork(t=1){this.ctx.executionScope?.consumeWork(t,this.site)}addRow(t){this.addRows(1,t)}addRows(t,i){let r=b(t,i,this.site);if(!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(i)||i<0||i>this.ctx.limits.maxArrayElements||t>Math.min(this.ctx.limits.maxCsvRows,this.ctx.limits.maxArrayElements)-this.rows||r>this.ctx.limits.maxCsvCells-this.cells)throw new h(`${this.site}: derived CSV result limit exceeded`,"array_elements");this.consumeWork(b(t,y(1,i,this.site),this.site)),this.rows+=t,this.cells+=r}};function I(){return Object.create(null)}function j(n,t,i){n[t]=i}function W(n){let t=I();for(let i of Object.keys(n)){let r=n[i];(typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)&&(t[i]=r)}return t}function z(n,t={}){let i=t.maxStringLength??10485760,r=t.maxArrayElements??1e5,a=t.maxRows??r,f=t.maxCells??1e7;if(w(n)>i)throw new h(`xan: CSV input size limit exceeded (${i} bytes)`,"string_length");let d=[],m=n.trim(),o=C.default.parse(m,{preview:1,skipEmptyLines:!0}).data[0]??[];if(o.length>r)throw new h(`xan: CSV column limit exceeded (${r})`,"array_elements");let p=0,s;if(C.default.parse(m,{header:!0,dynamicTyping:!0,skipEmptyLines:!0,step:(e,l)=>{let u=Object.keys(e.data);if(d.length===0&&e.meta.fields){if(e.meta.fields.length>r){s=new h(`xan: CSV column limit exceeded (${r})`,"array_elements"),l.abort();return}o=[...e.meta.fields]}if(d.length>=a||u.length>f-p){s=new h(d.length>=a?`xan: CSV row limit exceeded (${a})`:`xan: CSV cell limit exceeded (${f})`,"array_elements"),l.abort();return}p+=u.length,d.push(W(e.data))}}),s)throw s;return{headers:o,data:d}}function H(n,t={}){let i=t.maxStringLength??10485760,r=t.maxArrayElements??1e5,a=t.maxRows??r,f=t.maxCells??1e7;if(w(n)>i)throw new h(`xan: CSV input size limit exceeded (${i} bytes)`,"string_length");let d=[],m=0,c;if(C.default.parse(n.trim(),{header:!1,dynamicTyping:!1,skipEmptyLines:!0,step:(o,p)=>{let s=o.data;if(d.length>=a||s.length>r||s.length>f-m){c=new h(d.length>=a?`xan: CSV row limit exceeded (${a})`:s.length>r?`xan: CSV column limit exceeded (${r})`:`xan: CSV cell limit exceeded (${f})`,"array_elements"),p.abort();return}m+=s.length,d.push(s)}}),c)throw c;return d}function P(n,t,i){return E(t.length,n.length,(r,a)=>t[r][n[a]],i,n)}function q(n,t,i){return E(t.length,n.length,(r,a)=>t[r][n[a]],i)}function G(n,t,i){return E(n.length,void 0,(r,a)=>n[r][a],t,i,r=>n[r].length)}function E(n,t,i,r,a,f=()=>t??0){let d=r?.limits.maxOutputSize??Number.MAX_SAFE_INTEGER,m=new S(d,"xan CSV output",r?()=>new h(`xan: output size limit exceeded (${d} bytes)`,"output_size"):void 0),c=p=>{let s=p==null?"":String(p),e=0;for(let x=0;x<s.length;x++)s.charCodeAt(x)===34&&e++;let l=e>0||s.includes("\r")||s.includes(`
3
+ import{a as k}from"./chunk-KP2UH5CJ.js";import{a as v}from"./chunk-74TZ7ZF7.js";import{a as y,b,d as S}from"./chunk-CPTQXTBJ.js";import{l as h}from"./chunk-LCP3IKI7.js";import{a as w,b as $}from"./chunk-CPKBPQ2C.js";import{c as L}from"./chunk-DN2YCFOR.js";var g=class extends S{constructor(t){super(t,"xan")}};var C=L(k(),1);var V=class{ctx;site;rows=0;cells=0;constructor(t,i){this.ctx=t,this.site=i}consumeWork(t=1){this.ctx.executionScope?.consumeWork(t,this.site)}addRow(t){this.addRows(1,t)}addRows(t,i){let r=b(t,i,this.site);if(!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(i)||i<0||i>this.ctx.limits.maxArrayElements||t>Math.min(this.ctx.limits.maxCsvRows,this.ctx.limits.maxArrayElements)-this.rows||r>this.ctx.limits.maxCsvCells-this.cells)throw new h(`${this.site}: derived CSV result limit exceeded`,"array_elements");this.consumeWork(b(t,y(1,i,this.site),this.site)),this.rows+=t,this.cells+=r}};function I(){return Object.create(null)}function j(n,t,i){n[t]=i}function W(n){let t=I();for(let i of Object.keys(n)){let r=n[i];(typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)&&(t[i]=r)}return t}function z(n,t={}){let i=t.maxStringLength??10485760,r=t.maxArrayElements??1e5,a=t.maxRows??r,f=t.maxCells??1e7;if(w(n)>i)throw new h(`xan: CSV input size limit exceeded (${i} bytes)`,"string_length");let d=[],m=n.trim(),o=C.default.parse(m,{preview:1,skipEmptyLines:!0}).data[0]??[];if(o.length>r)throw new h(`xan: CSV column limit exceeded (${r})`,"array_elements");let p=0,s;if(C.default.parse(m,{header:!0,dynamicTyping:!0,skipEmptyLines:!0,step:(e,l)=>{let u=Object.keys(e.data);if(d.length===0&&e.meta.fields){if(e.meta.fields.length>r){s=new h(`xan: CSV column limit exceeded (${r})`,"array_elements"),l.abort();return}o=[...e.meta.fields]}if(d.length>=a||u.length>f-p){s=new h(d.length>=a?`xan: CSV row limit exceeded (${a})`:`xan: CSV cell limit exceeded (${f})`,"array_elements"),l.abort();return}p+=u.length,d.push(W(e.data))}}),s)throw s;return{headers:o,data:d}}function H(n,t={}){let i=t.maxStringLength??10485760,r=t.maxArrayElements??1e5,a=t.maxRows??r,f=t.maxCells??1e7;if(w(n)>i)throw new h(`xan: CSV input size limit exceeded (${i} bytes)`,"string_length");let d=[],m=0,c;if(C.default.parse(n.trim(),{header:!1,dynamicTyping:!1,skipEmptyLines:!0,step:(o,p)=>{let s=o.data;if(d.length>=a||s.length>r||s.length>f-m){c=new h(d.length>=a?`xan: CSV row limit exceeded (${a})`:s.length>r?`xan: CSV column limit exceeded (${r})`:`xan: CSV cell limit exceeded (${f})`,"array_elements"),p.abort();return}m+=s.length,d.push(s)}}),c)throw c;return d}function P(n,t,i){return E(t.length,n.length,(r,a)=>t[r][n[a]],i,n)}function q(n,t,i){return E(t.length,n.length,(r,a)=>t[r][n[a]],i)}function G(n,t,i){return E(n.length,void 0,(r,a)=>n[r][a],t,i,r=>n[r].length)}function E(n,t,i,r,a,f=()=>t??0){let d=r?.limits.maxOutputSize??Number.MAX_SAFE_INTEGER,m=new S(d,"xan CSV output",r?()=>new h(`xan: output size limit exceeded (${d} bytes)`,"output_size"):void 0),c=p=>{let s=p==null?"":String(p),e=0;for(let x=0;x<s.length;x++)s.charCodeAt(x)===34&&e++;let l=e>0||s.includes("\r")||s.includes(`
4
4
  `)||s.includes(",")||s.includes("\uFEFF")||s.startsWith(" ")||s.endsWith(" ");m.reserve(y(w(s),y(e,l?2:0,"xan CSV output"),"xan CSV output"));let u=e>0?s.replace(/"/g,'""'):s;m.append(l?`"${u}"`:u)},o=(p,s)=>{for(let e=0;e<s;e++)e>0&&m.append(","),c(i(p,e));m.append(`
5
5
  `)};if(a){for(let p=0;p<a.length;p++)p>0&&m.append(","),c(a[p]);m.append(`
6
6
  `)}for(let p=0;p<n;p++)r?.executionScope?.throwIfAborted("xan CSV output"),o(p,t??f(p));return m.build()}async function R(n,t){let i=n.find(d=>!d.startsWith("-")),r;if(!i||i==="-")r=$(t.stdin);else try{let d=t.fs.resolvePath(t.cwd,i);r=await t.fs.readFile(d)}catch(d){return v(d),{headers:[],data:[],error:{stdout:"",stderr:`xan: ${i}: No such file or directory
@@ -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 as t}from"./chunk-SHAOH2UJ.js";import{l as i,m as r}from"./chunk-LCP3IKI7.js";function e(o){if(o instanceof i||o instanceof r||o instanceof t)throw o}export{e as a};
3
+ import{a as t}from"./chunk-HWI42GQO.js";import{l as i,m as r}from"./chunk-LCP3IKI7.js";function e(o){if(o instanceof i||o instanceof r||o instanceof t)throw o}export{e as a};
@@ -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{c as l,d as u}from"./chunk-EJIZDPMG.js";import{randomBytes as h}from"node:crypto";var d=class{options;protocolToken=h(16).toString("hex");deadline;cleanups=[];cancelHandler;canceledReason;closed=!1;constructor(t){this.options=t,this.deadline=Date.now()+t.timeoutMs}arm(t){if(this.cancelHandler)throw new Error("worker request is already armed");this.cancelHandler=t;let a=this.options.signal;if(a){let i=()=>this.cancel("abort");a.addEventListener("abort",i,{once:!0}),this.cleanups.push(()=>a.removeEventListener("abort",i)),a.aborted&&this.cancel("abort")}if(!this.canceledReason){let i=l(()=>this.cancel("timeout"),Math.max(0,this.options.timeoutMs));i!==void 0&&this.cleanups.push(()=>u(i))}}get isCanceled(){return this.canceledReason!==void 0}remainingTimeMs(){return Math.max(0,this.deadline-Date.now())}timeoutMessage(t="Execution"){return`${t} timeout: exceeded ${this.options.timeoutMs}ms limit`}abortMessage(){return"Execution aborted"}assertMessageSize(t,a){if(f(t,this.options.maxMessageBytes)>this.options.maxMessageBytes)throw new Error(`${this.options.commandName}: worker ${a} exceeds ${this.options.maxMessageBytes} byte limit`)}async terminate(t){if(!t)return!0;try{return await t.terminate(),!0}catch{return!1}}close(){if(!this.closed){this.closed=!0;for(let t=this.cleanups.length-1;t>=0;t--)this.cleanups[t]();this.cleanups.length=0,this.cancelHandler=void 0}}cancel(t){this.closed||this.canceledReason||(this.canceledReason=t,this.cancelHandler?.(t))}};function f(o,t){let a=function*(n){for(let e in n)Object.hasOwn(n,e)&&(yield[e,n[e]])},i=[{kind:"value",value:o}],c=new WeakSet,s=0;for(;i.length>0&&s<=t;){let n=i.pop();if(!n)break;if(n.kind==="array"){n.index<n.value.length&&(i.push({...n,index:n.index+1}),i.push({kind:"value",value:n.value[n.index]}));continue}if(n.kind==="object"){let r=n.iterator.next();r.done||(s+=8+Buffer.byteLength(r.value[0],"utf8"),i.push(n),i.push({kind:"value",value:r.value[1]}));continue}let e=n.value;if(e==null)s+=4;else if(typeof e=="string")s+=Buffer.byteLength(e,"utf8");else if(typeof e=="number"||typeof e=="bigint")s+=8;else if(typeof e=="boolean")s+=1;else if(typeof e=="object"){if(c.has(e))continue;if(c.add(e),ArrayBuffer.isView(e))s+=e.byteLength;else if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)s+=e.byteLength;else if(Array.isArray(e)){if(e.length>Math.floor((t-s)/8))return t+1;s+=e.length*8,i.push({kind:"array",value:e,index:0})}else i.push({kind:"object",iterator:a(e)})}}return s}export{d as a};
3
+ import{c as l,d as u}from"./chunk-PPVF2N6C.js";import{randomBytes as h}from"node:crypto";var d=class{options;protocolToken=h(16).toString("hex");deadline;cleanups=[];cancelHandler;canceledReason;closed=!1;constructor(t){this.options=t,this.deadline=Date.now()+t.timeoutMs}arm(t){if(this.cancelHandler)throw new Error("worker request is already armed");this.cancelHandler=t;let a=this.options.signal;if(a){let i=()=>this.cancel("abort");a.addEventListener("abort",i,{once:!0}),this.cleanups.push(()=>a.removeEventListener("abort",i)),a.aborted&&this.cancel("abort")}if(!this.canceledReason){let i=l(()=>this.cancel("timeout"),Math.max(0,this.options.timeoutMs));i!==void 0&&this.cleanups.push(()=>u(i))}}get isCanceled(){return this.canceledReason!==void 0}remainingTimeMs(){return Math.max(0,this.deadline-Date.now())}timeoutMessage(t="Execution"){return`${t} timeout: exceeded ${this.options.timeoutMs}ms limit`}abortMessage(){return"Execution aborted"}assertMessageSize(t,a){if(f(t,this.options.maxMessageBytes)>this.options.maxMessageBytes)throw new Error(`${this.options.commandName}: worker ${a} exceeds ${this.options.maxMessageBytes} byte limit`)}async terminate(t){if(!t)return!0;try{return await t.terminate(),!0}catch{return!1}}close(){if(!this.closed){this.closed=!0;for(let t=this.cleanups.length-1;t>=0;t--)this.cleanups[t]();this.cleanups.length=0,this.cancelHandler=void 0}}cancel(t){this.closed||this.canceledReason||(this.canceledReason=t,this.cancelHandler?.(t))}};function f(o,t){let a=function*(n){for(let e in n)Object.hasOwn(n,e)&&(yield[e,n[e]])},i=[{kind:"value",value:o}],c=new WeakSet,s=0;for(;i.length>0&&s<=t;){let n=i.pop();if(!n)break;if(n.kind==="array"){n.index<n.value.length&&(i.push({...n,index:n.index+1}),i.push({kind:"value",value:n.value[n.index]}));continue}if(n.kind==="object"){let r=n.iterator.next();r.done||(s+=8+Buffer.byteLength(r.value[0],"utf8"),i.push(n),i.push({kind:"value",value:r.value[1]}));continue}let e=n.value;if(e==null)s+=4;else if(typeof e=="string")s+=Buffer.byteLength(e,"utf8");else if(typeof e=="number"||typeof e=="bigint")s+=8;else if(typeof e=="boolean")s+=1;else if(typeof e=="object"){if(c.has(e))continue;if(c.add(e),ArrayBuffer.isView(e))s+=e.byteLength;else if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)s+=e.byteLength;else if(Array.isArray(e)){if(e.length>Math.floor((t-s)/8))return t+1;s+=e.length*8,i.push({kind:"array",value:e,index:0})}else i.push({kind:"object",iterator:a(e)})}}return s}export{d as a};
@@ -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 C}from"./chunk-Z7QCL4IA.js";import{a as se,b as re}from"./chunk-ROFYAVPF.js";import{a as O}from"./chunk-ODCVIRIN.js";import{l as A}from"./chunk-LCP3IKI7.js";import{b as j}from"./chunk-CPKBPQ2C.js";import{a as me,c as ne}from"./chunk-MUFNRCMY.js";var xe="(standard input)";function he(t){let e=t.limits.maxLoopIterations,i=t.limits.maxArrayElements;return Math.max(e,Math.min(i,e*10))}function w(t){if(++t.operations>t.maxOperations)throw new A(`grep: glob operation limit exceeded (${t.maxOperations})`,"glob_operations")}function _(t){if(t.results>=t.maxResults)throw new A(`grep: array element limit exceeded (${t.maxResults})`,"array_elements");t.results++}var we="[^\\s\\S]";function Fe(t){return t.split(`
3
+ import{a as C}from"./chunk-Z7QCL4IA.js";import{a as se,b as re}from"./chunk-ROFYAVPF.js";import{a as O}from"./chunk-74TZ7ZF7.js";import{l as A}from"./chunk-LCP3IKI7.js";import{b as j}from"./chunk-CPKBPQ2C.js";import{a as me,c as ne}from"./chunk-MUFNRCMY.js";var xe="(standard input)";function he(t){let e=t.limits.maxLoopIterations,i=t.limits.maxArrayElements;return Math.max(e,Math.min(i,e*10))}function w(t){if(++t.operations>t.maxOperations)throw new A(`grep: glob operation limit exceeded (${t.maxOperations})`,"glob_operations")}function _(t){if(t.results>=t.maxResults)throw new A(`grep: array element limit exceeded (${t.maxResults})`,"array_elements");t.results++}var we="[^\\s\\S]";function Fe(t){return t.split(`
4
4
  `)}function ve(t){if(t==="")return[];let e=t.split(`
5
5
  `);return e[e.length-1]===""&&e.pop(),e}function Ce(t,e){return t.length===1?{pattern:t[0],mode:e}:e==="fixed"?{pattern:t.map(i=>`(?:${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`).join("|"),mode:"extended"}:e==="basic"?{pattern:t.join("\\|"),mode:e}:{pattern:t.map(i=>`(?:${i})`).join("|"),mode:e}}var Ee={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",description:["Search for PATTERN in each FILE.","With no FILE, or when FILE is -, read standard input."],options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching","-f FILE, --file=FILE obtain patterns from FILE, one per line"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},de={name:"grep",async execute(t,e){let i=!1,g=!1,f=!1,h=!1,c=!1,u=!1,a=!1,l=!1,m=!1,F=!1,$=!1,y=!1,x=!1,M=!1,G=!1,S=0,N=0,W=0,B=[],b=[],X=[],L=null,H=[],Z=[],Q=!0;for(let s=0;s<t.length;s++){let r=t[s];if(Q&&r==="--"){Q=!1;continue}if(Q&&r==="--help")return me(Ee);if(Q&&r.startsWith("-")&&r!=="-"){if(r==="-e"&&s+1<t.length){L=t[++s];continue}if(r.startsWith("--file=")){H.push(r.slice(7));continue}if(r.startsWith("--include=")){B.push(r.slice(10));continue}if(r.startsWith("--exclude=")){b.push(r.slice(10));continue}if(r.startsWith("--exclude-dir=")){X.push(r.slice(14));continue}if(r.startsWith("--max-count=")){S=parseInt(r.slice(12),10);continue}let v=r.match(/^-m(\d+)$/);if(v){S=parseInt(v[1],10);continue}if(r==="-m"&&s+1<t.length){S=parseInt(t[++s],10);continue}let o=r.match(/^-([ABC])(\d+)$/);if(o){let p=parseInt(o[2],10);o[1]==="A"?W=p:o[1]==="B"?N=p:o[1]==="C"&&(N=p,W=p);continue}if((r==="-A"||r==="-B"||r==="-C")&&s+1<t.length){let p=parseInt(t[++s],10);r==="-A"?W=p:r==="-B"?N=p:(N=p,W=p);continue}let d=r.startsWith("--")?[r]:r.slice(1).split("");for(let p=0;p<d.length;p++){let n=d[p];if(n==="f"||n==="--file"){let z=n==="f"?d.slice(p+1).join(""):"";if(z.length>0)H.push(z);else if(s+1<t.length)H.push(t[++s]);else return{stdout:"",stderr:n==="f"?`grep: option requires an argument -- 'f'
6
6
  `:`grep: option '--file' requires an argument
@@ -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 W}from"./chunk-OD2SHTFL.js";import{c as $}from"./chunk-TKBTWIXO.js";import{b as C}from"./chunk-SHAOH2UJ.js";import{a as V}from"./chunk-H4BRFPKY.js";import{b as I}from"./chunk-CPKBPQ2C.js";import{a as B,b}from"./chunk-PBOVSFTJ.js";import{a as x}from"./chunk-I4IRHQDW.js";import{a as N,b as R}from"./chunk-MUFNRCMY.js";import{existsSync as ce}from"node:fs";import{dirname as de,join as T,sep as Q}from"node:path";import{fileURLToPath as me}from"node:url";import{Worker as he}from"node:worker_threads";import pe from"sql.js";function K(e,t){return e==null?Buffer.byteLength(t,"utf8"):e instanceof Uint8Array||Buffer.isBuffer(e)?e.byteLength:Buffer.byteLength(String(e),"utf8")}function X(e,t,r){let n=r.maxOutputSize??Number.MAX_SAFE_INTEGER,s=Buffer.byteLength(r.separator,"utf8");s+=Buffer.byteLength(r.newline,"utf8");for(let a of e)s+=Buffer.byteLength(a,"utf8");for(let a of t){s+=a.length*16;for(let i of a)s+=K(i,r.nullValue);if(s>n)break}let o=s*8+(t.length+3)*(e.length+3)*16;if(!Number.isSafeInteger(o)||o>n)throw new Error(`formatted output exceeds ${n} byte limit`);return n}function _(e,t,r){let n=X(e,t,r),s;switch(r.mode){case"list":s=Y(e,t,r);break;case"csv":s=Z(e,t,r);break;case"json":s=te(e,t);break;case"line":s=re(e,t,r);break;case"column":s=ne(e,t,r);break;case"table":s=se(e,t,r);break;case"markdown":s=oe(e,t,r);break;case"tabs":s=ie(e,t,r);break;case"box":s=ae(e,t,r);break;case"quote":s=le(e,t,r);break;case"html":s=fe(e,t,r);break;case"ascii":s=ue(e,t,r);break}if(Buffer.byteLength(s,"utf8")>n)throw new Error(`formatted output exceeds ${n} byte limit`);return s}function m(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function Y(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let s of t)n.push(s.map(o=>m(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function Z(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(v).join(","));for(let s of t)n.push(s.map(o=>v(m(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
3
+ import{a as W}from"./chunk-7WBCA2BB.js";import{c as $}from"./chunk-42AMF6EE.js";import{b as C}from"./chunk-HWI42GQO.js";import{a as V}from"./chunk-H4BRFPKY.js";import{b as I}from"./chunk-CPKBPQ2C.js";import{a as B,b}from"./chunk-PBOVSFTJ.js";import{a as x}from"./chunk-I4IRHQDW.js";import{a as N,b as R}from"./chunk-MUFNRCMY.js";import{existsSync as ce}from"node:fs";import{dirname as de,join as T,sep as Q}from"node:path";import{fileURLToPath as me}from"node:url";import{Worker as he}from"node:worker_threads";import pe from"sql.js";function K(e,t){return e==null?Buffer.byteLength(t,"utf8"):e instanceof Uint8Array||Buffer.isBuffer(e)?e.byteLength:Buffer.byteLength(String(e),"utf8")}function X(e,t,r){let n=r.maxOutputSize??Number.MAX_SAFE_INTEGER,s=Buffer.byteLength(r.separator,"utf8");s+=Buffer.byteLength(r.newline,"utf8");for(let a of e)s+=Buffer.byteLength(a,"utf8");for(let a of t){s+=a.length*16;for(let i of a)s+=K(i,r.nullValue);if(s>n)break}let o=s*8+(t.length+3)*(e.length+3)*16;if(!Number.isSafeInteger(o)||o>n)throw new Error(`formatted output exceeds ${n} byte limit`);return n}function _(e,t,r){let n=X(e,t,r),s;switch(r.mode){case"list":s=Y(e,t,r);break;case"csv":s=Z(e,t,r);break;case"json":s=te(e,t);break;case"line":s=re(e,t,r);break;case"column":s=ne(e,t,r);break;case"table":s=se(e,t,r);break;case"markdown":s=oe(e,t,r);break;case"tabs":s=ie(e,t,r);break;case"box":s=ae(e,t,r);break;case"quote":s=le(e,t,r);break;case"html":s=fe(e,t,r);break;case"ascii":s=ue(e,t,r);break}if(Buffer.byteLength(s,"utf8")>n)throw new Error(`formatted output exceeds ${n} byte limit`);return s}function m(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function Y(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let s of t)n.push(s.map(o=>m(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function Z(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(v).join(","));for(let s of t)n.push(s.map(o=>v(m(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
4
4
  `)}
5
5
  `:""}function v(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
6
6
  `)?`"${e.replace(/"/g,'""')}"`:e}function F(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function ee(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):F(e):JSON.stringify(e)}function te(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,a)=>`${JSON.stringify(o)}:${ee(n[a])}`).join(",")}}`).join(`,
@@ -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 w}from"./chunk-QES5OSUC.js";import{a as m}from"./chunk-ODCVIRIN.js";import{d as v}from"./chunk-CPTQXTBJ.js";import{e as B}from"./chunk-H4BRFPKY.js";import{l as z}from"./chunk-LCP3IKI7.js";import{a as L}from"./chunk-NE4R2FVV.js";import{a as F,b as E}from"./chunk-MUFNRCMY.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
3
+ import{a as w}from"./chunk-QES5OSUC.js";import{a as m}from"./chunk-74TZ7ZF7.js";import{d as v}from"./chunk-CPTQXTBJ.js";import{e as B}from"./chunk-H4BRFPKY.js";import{l as z}from"./chunk-LCP3IKI7.js";import{a as L}from"./chunk-NE4R2FVV.js";import{a as F,b as E}from"./chunk-MUFNRCMY.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
4
4
 
5
5
  When no FILE is given, or when FILE is -, read from standard input.
6
6
 
@@ -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 Y,b as C,c as Z,d as ee}from"./chunk-O5R7J45W.js";import{d as M}from"./chunk-WDV2ECOC.js";import{a as K,b as X}from"./chunk-TKBTWIXO.js";import{b as F}from"./chunk-O74FSWB4.js";import{a as H}from"./chunk-SHAOH2UJ.js";import{l as j}from"./chunk-LCP3IKI7.js";import{a as P,b as L}from"./chunk-CPKBPQ2C.js";import{a as B}from"./chunk-PBOVSFTJ.js";import{a as W,b as G,c as T}from"./chunk-MUFNRCMY.js";function se(i){switch(i){case"\b":return"\\b";case"\f":return"\\f";case`
3
+ import{a as Y,b as C,c as Z,d as ee}from"./chunk-HL7NFZVQ.js";import{d as M}from"./chunk-WDV2ECOC.js";import{a as K,b as X}from"./chunk-42AMF6EE.js";import{b as F}from"./chunk-O74FSWB4.js";import{a as H}from"./chunk-HWI42GQO.js";import{l as j}from"./chunk-LCP3IKI7.js";import{a as P,b as L}from"./chunk-CPKBPQ2C.js";import{a as B}from"./chunk-PBOVSFTJ.js";import{a as W,b as G,c as T}from"./chunk-MUFNRCMY.js";function se(i){switch(i){case"\b":return"\\b";case"\f":return"\\f";case`
4
4
  `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${i.charCodeAt(0).toString(16).padStart(4,"0")}`}}function ne(i){let t="",d=!1,m=!1;for(let s=0;s<i.length;s++){let a=i[s];if(m){t+=a,m=!1;continue}if(a==="\\"){t+=a,m=!0;continue}if(a==='"'){t+=a,d=!d;continue}if(d&&a.charCodeAt(0)<=31){t+=se(a);continue}t+=a}return t}function R(i,t,d){return JSON.parse(ne(i.slice(t,d)))}function J(i,t){let d=[],m=x=>{if(d.length>=t.maxElements)throw new j(`query result element limit exceeded (${t.maxElements})`,"array_elements");d.push(x)},s=0,a=i.length;for(;s<a;){for(;s<a&&/\s/.test(i[s]);)s++;if(s>=a)break;let x=s,p=i[s];if(p==="{"||p==="["){let u=[p==="{"?"}":"]"],h=!1,E=!1;for(s++;s<a&&u.length>0;){let g=i[s];if(E)E=!1;else if(g==="\\")E=!0;else if(g==='"')h=!h;else if(!h){if(g==="{"||g==="["){if(u.push(g==="{"?"}":"]"),u.length>t.maxDepth)throw new j(`query depth limit exceeded (${t.maxDepth})`,"recursion")}else if((g==="}"||g==="]")&&u.pop()!==g)throw new Error(`Mismatched JSON delimiter at position ${s}`)}s++}if(u.length!==0)throw new Error(`Unexpected end of JSON input at position ${s} (unclosed ${p})`);m(M(R(i,x,s),{maxDepth:t.maxDepth,maxElements:t.maxElements}))}else if(p==='"'){let u=!1;for(s++;s<a;){let h=i[s];if(u)u=!1;else if(h==="\\")u=!0;else if(h==='"'){s++;break}s++}m(M(R(i,x,s),t))}else if(p==="-"||p>="0"&&p<="9"){for(;s<a&&/[\d.eE+-]/.test(i[s]);)s++;m(M(R(i,x,s),t))}else if(i.slice(s,s+4)==="true")m(!0),s+=4;else if(i.slice(s,s+5)==="false")m(!1),s+=5;else if(i.slice(s,s+4)==="null")m(null),s+=4;else{let u=i.slice(s,s+10);throw new Error(`Invalid JSON at position ${x}: unexpected '${u.split(/\s/)[0]}'`)}}return d}function S(i){return{stdout:"",stderr:`jq: ${i}
5
5
  `,exitCode:2}}var re={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE...]",options:["-R, --raw-input read each line as string instead of JSON","-r, --raw-output output strings without quotes","-c, --compact-output compact instead of pretty-printed output","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --arg NAME VALUE bind $NAME to the string VALUE"," --argjson NAME JSON bind $NAME to the JSON-decoded value JSON"," --rawfile NAME FILE bind $NAME to the raw contents of FILE"," --slurpfile NAME FILE bind $NAME to the array of JSON values in FILE"," --args remaining arguments are string positional args ($ARGS.positional)"," --jsonargs remaining arguments are JSON positional args ($ARGS.positional)"," --help display this help and exit"]},we={name:"jq",async execute(i,t){K(t.requireDefenseContext,"jq","execution entry");let d=(r,e)=>X(t.requireDefenseContext,"jq",r,e);if(G(i))return W(re);let m=!1,s=!1,a=!1,x=!1,p=!1,u=!1,h=!1,E=!1,g=!1,V=".",_=!1,A="none",N=[],$=new Map,k=[],q=[],v={maxDepth:t.limits.maxQueryDepth,maxElements:t.limits.maxQueryElements};for(let r=0;r<i.length;r++){let e=i[r];if(e==="-R"||e==="--raw-input")s=!0;else if(e==="-r"||e==="--raw-output")m=!0;else if(e==="-c"||e==="--compact-output")a=!0;else if(e==="-e"||e==="--exit-status")x=!0;else if(e==="-s"||e==="--slurp")p=!0;else if(e==="-n"||e==="--null-input")u=!0;else if(e==="-j"||e==="--join-output")h=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")E=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")g=!0;else if(e==="--arg"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--arg takes two parameters (e.g. --arg varname value)");$.set(n,l),r+=2}else if(e==="--argjson"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--argjson takes two parameters (e.g. --argjson varname text)");let y;try{y=J(l.trim(),v)}catch{return S("invalid JSON text passed to --argjson")}if(y.length!==1)return S("invalid JSON text passed to --argjson");$.set(n,y[0]),r+=2}else if(e==="--rawfile"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--rawfile takes two parameters (e.g. --rawfile varname filename)");q.push({name:n,file:l,mode:"raw"}),r+=2}else if(e==="--slurpfile"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--slurpfile takes two parameters (e.g. --slurpfile varname filename)");q.push({name:n,file:l,mode:"slurp"}),r+=2}else if(e==="--args")A="args";else if(e==="--jsonargs")A="jsonargs";else if(e==="-")N.push("-");else{if(e.startsWith("--"))return T("jq",e);if(e.startsWith("-")){for(let n of e.slice(1))if(n==="R")s=!0;else if(n==="r")m=!0;else if(n==="c")a=!0;else if(n==="e")x=!0;else if(n==="s")p=!0;else if(n==="n")u=!0;else if(n==="j")h=!0;else if(n!=="a"){if(n==="S")E=!0;else if(n!=="C"){if(n!=="M")return T("jq",`-${n}`)}}}else if(!_)V=e,_=!0;else if(A==="args")k.push(e);else if(A==="jsonargs"){let n;try{n=J(e.trim(),v)}catch{return S("invalid JSON text passed to --jsonargs")}if(n.length!==1)return S("invalid JSON text passed to --jsonargs");k.push(n[0])}else N.push(e)}}}}if(q.length>0){let r=await d("arg file read",()=>F(t,q.map(e=>e.file),{cmdName:"jq",stopOnError:!0}));if(r.exitCode!==0)return{stdout:"",stderr:r.stderr,exitCode:2};for(let e=0;e<q.length;e++){let{name:n,mode:l}=q[e],y=L(r.files[e].content);if(l==="raw")$.set(n,y);else{let b=y.trim();try{$.set(n,b?J(b,v):[])}catch{return S("invalid JSON text passed to --slurpfile")}}}}let D=[];if(!u)if(N.length===0||N.length===1&&N[0]==="-")D.push({source:"stdin",content:L(t.stdin)});else{let r=await d("file read",()=>F(t,N,{cmdName:"jq",stopOnError:!0}));if(r.exitCode!==0)return{stdout:"",stderr:r.stderr,exitCode:2};D=r.files.map(e=>({source:e.filename||"stdin",content:L(e.content)}))}try{let r=Z(V,{maxDepth:t.limits.maxQueryDepth,maxTokens:t.limits.maxQueryTokens,maxSourceLength:t.limits.maxStringLength}),e=[],n={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength,maxOutputSize:t.limits.maxOutputSize,maxArrayElements:t.limits.maxQueryElements,maxDepth:t.limits.maxQueryDepth}:void 0,env:t.env,namedArgs:$,positionalArgs:k,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext,budget:{operations:0,callDepth:0}},l=(o,f)=>{if(f.length>t.limits.maxQueryElements-o.length)throw new j(`query result element limit exceeded (${t.limits.maxQueryElements})`,"array_elements");for(let c of f)o.push(c)};if(u)e=C(null,r,n);else if(s&&p){let o=D.map(({content:f})=>f).join("");e=C(o,r,n)}else if(s){let o="";for(let{content:f}of D){let c=o+f,w=0,O=c.indexOf(`
6
6
  `,w);for(;O!==-1;)l(e,C(c.slice(w,O),r,n)),w=O+1,O=c.indexOf(`
@@ -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 $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-GE5ERIO2.js";import{b as V,d as Qe}from"./chunk-O5R7J45W.js";import{d as Ge,f as Xe,g as oe}from"./chunk-WDV2ECOC.js";import{a as Z}from"./chunk-XBX7KFWK.js";import{b as Ye}from"./chunk-O74FSWB4.js";import{a as q}from"./chunk-ODCVIRIN.js";import{a as W,c as se,d as re}from"./chunk-CPTQXTBJ.js";import{l as E}from"./chunk-LCP3IKI7.js";import{a as K,b as Y}from"./chunk-CPKBPQ2C.js";import{a as J,b as ne}from"./chunk-MUFNRCMY.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
3
+ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-4APSDE57.js";import{b as V,d as Qe}from"./chunk-HL7NFZVQ.js";import{d as Ge,f as Xe,g as oe}from"./chunk-WDV2ECOC.js";import{a as Z}from"./chunk-XBX7KFWK.js";import{b as Ye}from"./chunk-O74FSWB4.js";import{a as q}from"./chunk-74TZ7ZF7.js";import{a as W,c as se,d as re}from"./chunk-CPTQXTBJ.js";import{l as E}from"./chunk-LCP3IKI7.js";import{a as K,b as Y}from"./chunk-CPKBPQ2C.js";import{a as J,b as ne}from"./chunk-MUFNRCMY.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
4
4
  `||t==="\r")this.pos++;else if(t==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
5
5
  `;)this.pos++;else break}}nextToken(){let t=this.pos,n=this.input[this.pos];if(n>="0"&&n<="9")return this.readNumber();if(n==='"'||n==="'"||n==="`")return this.readString(n);if(n==="b"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==='"'||o==="'"||o==="`")return this.pos++,this.readString(o)}if(n==="/"){let o=this.tokens[this.tokens.length-1];return o&&(o.type==="int"||o.type==="float"||o.type==="string"||o.type==="ident"||o.type===")"||o.type==="]")?this.input[this.pos+1]==="/"?(this.pos+=2,{type:"//",value:"//",pos:t}):(this.pos++,{type:"/",value:"/",pos:t}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:t};if(this.match("=>"))return{type:"=>",value:"=>",pos:t};if(this.match("**"))return{type:"**",value:"**",pos:t};if(this.match("++"))return{type:"++",value:"++",pos:t};if(this.match("//"))return{type:"//",value:"//",pos:t};if(this.match("=="))return{type:"==",value:"==",pos:t};if(this.match("!="))return{type:"!=",value:"!=",pos:t};if(this.match("<="))return{type:"<=",value:"<=",pos:t};if(this.match(">="))return{type:">=",value:">=",pos:t};if(this.match("&&"))return{type:"&&",value:"&&",pos:t};if(this.match("||"))return{type:"||",value:"||",pos:t};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(n);if(r!==void 0)return this.pos++,{type:r,value:n,pos:t};if(this.isIdentStart(n))return this.readIdentifier();throw new Error(`Unexpected character '${n}' at position ${this.pos}`)}match(t){if(this.input.slice(this.pos,this.pos+t.length)===t){if(/^[a-zA-Z]/.test(t)){let n=this.input[this.pos+t.length];if(n&&this.isIdentChar(n))return!1}return this.pos+=t.length,!0}return!1}isIdentStart(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"}isIdentChar(t){return this.isIdentStart(t)||t>="0"&&t<="9"}readNumber(){let t=this.pos,n=!1,s=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(o>="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!n&&!s)n=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,n=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]==="+"||this.input[this.pos]==="-")&&this.pos++;else break}let r=this.input.slice(t,this.pos).replace(/_/g,"");return{type:n?"float":"int",value:r,pos:t}}readString(t){let n=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===t)return this.pos++,{type:"string",value:s,pos:n};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
6
6
  `;break;case"r":s+="\r";break;case"t":s+=" ";break;case"\\":s+="\\";break;case'"':s+='"';break;case"'":s+="'";break;case"`":s+="`";break;case"0":s+="\0";break;default:s+=o}this.pos++}}else s+=r,this.pos++}throw new Error(`Unterminated string starting at position ${n}`)}readRegex(){let t=this.pos;this.pos++;let n="",s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r==="/"){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]==="i";)s+=this.input[this.pos],this.pos++;return{type:"regex",value:n+(s?`/${s}`:""),pos:t}}r==="\\"?(n+=r,this.pos++,this.pos<this.input.length&&(n+=this.input[this.pos],this.pos++)):(n+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${t}`)}readIdentifier(){let t=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let n=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(n=!0,this.pos++);let s=this.input.slice(t,n?this.pos-1:this.pos);n&&(s+="?");let r=new Map([["true","true"],["false","false"],["null","null"],["and","and"],["or","or"],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["in","in"],["as","as"],["_","_"]]),o=s.replace(/\?$/,""),i=r.get(o);return i!==void 0&&!n?{type:i,value:o,pos:t}:{type:"ident",value:s,pos:t}}};function z(e){return{maxSourceLength:e.limits.maxStringLength,maxTokens:e.limits.maxQueryTokens,maxAstNodes:e.limits.maxQueryElements,maxOperations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth}}var D={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},ee=class{pos=0;tokens;depth=0;operations=0;astNodes=0;limits;constructor(t,n={}){this.tokens=t,this.limits={maxSourceLength:n.maxSourceLength??1024*1024,maxTokens:n.maxTokens??1e5,maxDepth:n.maxDepth??100,maxOperations:n.maxOperations??1e5,maxAstNodes:n.maxAstNodes??1e5};let s=0;for(let r of t)this.useOperation(),r.type==="("||r.type==="["||r.type==="{"?(s++,s>this.limits.maxDepth&&this.throwDepthLimit()):(r.type===")"||r.type==="]"||r.type==="}")&&(s=Math.max(0,s-1))}parse(){let t=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return t}parseExpr(t){return this.withDepth(()=>this.parseExprInner(t))}parseExprInner(t){let n=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<t)break;n=this.parseInfix(n,r)}return n}useOperation(t=1){if(t>this.limits.maxOperations-this.operations)throw new E(`xan: expression parser operation limit exceeded (${this.limits.maxOperations})`,"iterations");this.operations+=t}withDepth(t){this.depth>=this.limits.maxDepth&&this.throwDepthLimit(),this.depth++;try{return t()}finally{this.depth--}}throwDepthLimit(){throw new E(`xan: expression parser depth limit exceeded (${this.limits.maxDepth})`,"recursion")}addAstNode(){if(this.astNodes>=this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements");this.astNodes++}parsePrefix(){let t=this.peek();switch(t.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(t.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(t.value)};case"string":return this.advance(),{type:"string",value:t.value};case"regex":{this.advance();let n=t.value.split("/"),s=n.length>1?n[n.length-1]:"";return{type:"regex",pattern:n.slice(0,-1).join("/")||t.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let n=t.value,s=n.endsWith("?"),r=s?n.slice(0,-1):n;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let n=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let i=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:i},r)}this.pos=n}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let n=this.parseExpr(D.UNARY);return n.type==="int"?{type:"int",value:-n.value}:n.type==="float"?{type:"float",value:-n.value}:{type:"func",name:"neg",args:[{expr:n}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(D.UNARY)}]};default:throw new Error(`Unexpected token: ${t.type} (${t.value})`)}}parseFunctionCall(t){this.expect("(");let n=[];if(this.peek().type!==")")do{n.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,i=this.pos+1;i<this.tokens.length&&this.tokens[i].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);n.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:t.toLowerCase(),args:n}}parseList(){this.expect("[");let t=[];if(this.peek().type!=="]")do t.length>0&&this.peek().type===","&&this.advance(),t.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:t}}parseMap(){this.expect("{");let t=[];if(this.peek().type!=="}")do{t.length>0&&this.peek().type===","&&this.advance();let n;if(this.peek().type==="ident")n=this.peek().value,this.advance();else if(this.peek().type==="string")n=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);t.push({key:n,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:t}}parseInfix(t,n){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let i=this.parseExpr(n+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:t},{expr:i}]}}if(s.type==="|"){this.advance();let i=this.parseExpr(n);return this.handlePipe(t,i)}if(s.type===".")return this.advance(),this.handleDot(t);if(s.type==="[")return this.advance(),this.handleIndexing(t);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(t,n){if(n.type==="identifier")return{type:"func",name:n.name,args:[{expr:t}]};if(n.type==="func"){let s=this.countUnderscores(n);return s===0?n:s===1?this.fillUnderscore(n,t):{type:"pipeline",exprs:[t,n]}}return this.countUnderscores(n)===1?this.fillUnderscore(n,t):n}handleDot(t){let n=this.peek();if(n.type==="ident"){let s=n.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:t}),r}return{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}if(n.type==="int"){let s=Number.parseInt(n.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"int",value:s}}]}}if(n.type==="string"){let s=n.value;return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${n.type}`)}handleIndexing(t){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:{type:"int",value:0}},{expr:s}]}}let n=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t},{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:n},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:t},{expr:n}]}}countUnderscores(t){let n=[t],s=0;for(;n.length>0;){this.useOperation();let r=n.pop();if(!r)break;if(r.type==="underscore")s++;else if(r.type==="func")for(let o of r.args)n.push(o.expr);else if(r.type==="list")n.push(...r.elements);else if(r.type==="map")for(let o of r.entries)n.push(o.value);if(n.length>this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements")}return s}fillUnderscore(t,n){return this.withDepth(()=>this.fillUnderscoreInner(t,n))}fillUnderscoreInner(t,n){return this.useOperation(),t.type==="underscore"?n:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.fillUnderscore(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.fillUnderscore(s.value,n)}))}:t}bindLambdaArgs(t,n){return{...t,body:this.bindLambdaArgsInExpr(t.body,n)}}bindLambdaArgsInExpr(t,n){return this.withDepth(()=>this.bindLambdaArgsInExprInner(t,n))}bindLambdaArgsInExprInner(t,n){return this.useOperation(),t.type==="identifier"&&n.includes(t.name)?{type:"lambdaBinding",name:t.name}:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.bindLambdaArgsInExpr(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,n)}))}:t}getInfixPrec(t){switch(t){case"|":return D.PIPE;case"||":case"or":return D.OR;case"&&":case"and":return D.AND;case"==":case"!=":case"eq":case"ne":return D.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return D.COMPARISON;case"+":case"-":case"++":return D.ADDITIVE;case"*":case"/":case"//":case"%":return D.MULTIPLICATIVE;case"**":return D.POWER;case".":case"[":return D.POSTFIX;default:return-1}}isRightAssoc(t){return t==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(t){return this.tokens[this.pos+t]||{type:"eof",value:"",pos:0}}advance(){return this.useOperation(),this.addAstNode(),this.tokens[this.pos++]}expect(t){let n=this.peek();if(n.type!==t)throw new Error(`Expected ${t}, got ${n.type}`);return this.advance()}};function X(e,t={}){let n=[],r=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize(),o=0,i=()=>r[o]||{type:"eof",value:"",pos:0},p=()=>r[o++];for(;i().type!=="eof";){if(i().type===","&&n.length>0){p();continue}let h=[],m=0,c=o;for(;i().type!=="eof";){let l=i();if((l.type===","||l.type==="as")&&m===0)break;(l.type==="("||l.type==="["||l.type==="{")&&m++,(l.type===")"||l.type==="]"||l.type==="}")&&m--,h.push(p())}h.push({type:"eof",value:"",pos:0});let d=new ee(h,t).parse(),u;if(i().type==="as")if(p(),i().type==="("){p();let l=[];for(;i().type!==")"&&i().type!=="eof";)if((i().type==="ident"||i().type==="string")&&(l.push(i().value),p()),i().type===",")p();else if(i().type!==")"&&i().type!=="eof")throw new Error(`Expected tuple alias, got ${i().type}`);if(i().type!==")")throw new Error("Expected ')' after tuple alias");p(),u=l}else if(i().type==="ident"||i().type==="string")u=i().value,p();else throw new Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(r[c].pos,r[o-1]?.pos||e.length).trim(),d.type==="identifier"&&(u=d.name);n.push({expr:d,name:u})}return n}function B(e,t={}){let s=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize();return new ee(s,t).parse()}function R(e,t){return t.length===0?O(e,[]):t.length===1?{type:"Pipe",left:t[0],right:O(e,[])}:{type:"Pipe",left:t[0],right:O(e,t.slice(1))}}var le={add:e=>L("+",e[0],e[1]),sub:e=>L("-",e[0],e[1]),mul:e=>L("*",e[0],e[1]),div:e=>L("/",e[0],e[1]),mod:e=>L("%",e[0],e[1]),idiv:e=>O("floor",[L("/",e[0],e[1])]),pow:e=>R("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>L("==",e[0],e[1]),"!=":e=>L("!=",e[0],e[1]),"<":e=>L("<",e[0],e[1]),"<=":e=>L("<=",e[0],e[1]),">":e=>L(">",e[0],e[1]),">=":e=>L(">=",e[0],e[1]),eq:e=>L("==",M(e[0]),M(e[1])),ne:e=>L("!=",M(e[0]),M(e[1])),lt:e=>L("<",M(e[0]),M(e[1])),le:e=>L("<=",M(e[0]),M(e[1])),gt:e=>L(">",M(e[0]),M(e[1])),ge:e=>L(">=",M(e[0]),M(e[1])),and:e=>L("and",e[0],e[1]),or:e=>L("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>R("length",e),length:e=>R("length",e),upper:e=>R("ascii_upcase",e),lower:e=>R("ascii_downcase",e),trim:e=>R("trim",e),ltrim:e=>e.length===0?O("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?O("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("rtrimstr",[{type:"Literal",value:" "}])},split:e=>R("split",e),join:e=>e.length===1?O("join",[{type:"Literal",value:""}]):R("join",e),concat:e=>L("+",e[0],e[1]),startswith:e=>R("startswith",e),endswith:e=>R("endswith",e),contains:e=>R("contains",e),replace:e=>R("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:L("+",e[1],e[2])},abs:e=>R("fabs",e),floor:e=>R("floor",e),ceil:e=>R("ceil",e),round:e=>R("round",e),sqrt:e=>R("sqrt",e),log:e=>R("log",e),log10:e=>R("log10",e),log2:e=>R("log2",e),exp:e=>R("exp",e),sin:e=>R("sin",e),cos:e=>R("cos",e),tan:e=>R("tan",e),asin:e=>R("asin",e),acos:e=>R("acos",e),atan:e=>R("atan",e),min:e=>R("min",e),max:e=>R("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>O("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>O("select",e),empty:()=>O("empty",[]),count:()=>O("length",[]),sum:e=>e.length===0?O("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:O("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},type:"type",isnull:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:null}):L("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:""}):L("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?O("tonumber",[]):O("tonumber",e),tostring:e=>e.length===0?O("tostring",[]):O("tostring",e),if:e=>st(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let t=e[e.length-1];for(let n=e.length-2;n>=0;n--){let s=e[n],r=L("and",L("!=",s,{type:"Literal",value:null}),L("!=",s,{type:"Literal",value:""}));t=st(r,s,t)}return t},index:()=>({type:"Field",name:"_row_index"}),now:()=>O("now",[]),fmt:e=>O("tostring",e),format:e=>O("tostring",e)};Object.setPrototypeOf(le,null);function L(e,t,n){return{type:"BinaryOp",op:e,left:t,right:n}}function O(e,t){return{type:"Call",name:e,args:t}}var mt="then";function st(e,t,n){let s=Xe({type:"Cond",cond:e,elifs:[],else:n||{type:"Literal",value:null}});return s[mt]=t,s}function M(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function U(e,t=!0,n={}){let s={nodes:0,operations:0,maxNodes:n.maxAstNodes??1e5,maxOperations:n.maxOperations??1e5,maxDepth:n.maxDepth??100};return rt(e,t,s,0)}function rt(e,t,n,s){if(s>=n.maxDepth)throw new E(`xan: expression conversion depth limit exceeded (${n.maxDepth})`,"recursion");if(++n.nodes>n.maxNodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(++n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations");let r=o=>rt(o,t,n,s+1);switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return t?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{if(e.args.length>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");let o=e.args.map(p=>r(p.expr));if(e.name==="coalesce"){let p=Math.max(0,o.length-1)*7;if(p>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(n.nodes+=p,n.operations+=o.length,n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations")}let i=Object.hasOwn(le,e.name)?le[e.name]:void 0;return typeof i=="function"?i(o):O(typeof i=="string"?i:e.name,o)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((o,i,p)=>{let h=r(i);return p===0?h:{type:"Comma",left:o,right:h}},null)};case"map":return{type:"Object",entries:e.entries.map(o=>({key:o.key,value:r(o.value)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?r(e.start):void 0,end:e.end?r(e.end):void 0};case"lambda":return r(e.body);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function Q(e){return e<2?0:Math.ceil(e*Math.log2(e))}function ue(e,t={}){let n=t.maxArrayElements??1e5,s=t.maxStringLength??10*1024*1024,r=t.maxIterations??1e5,o=t.maxDepth??100;if(K(e)>s)throw new E(`xan: aggregation expression length limit exceeded (${s} bytes)`,"string_length");let i=[],p=0,h=0,m=()=>{if(t.consumeWork?.(),++h>r)throw new E(`xan: aggregation parser operation limit exceeded (${r})`,"iterations")};for(;p<e.length;){for(m();p<e.length&&(e[p]===" "||e[p]===",");)p++;if(p>=e.length)break;let c=p;for(;p<e.length&&/\w/.test(e[p]);)p++;let a=e.slice(c,p);for(;p<e.length&&e[p]===" ";)p++;if(e[p]!=="(")break;p++;let d=1,u=p;for(;p<e.length&&d>0;){if(m(),e[p]==="("?d++:e[p]===")"&&d--,d>o)throw new E(`xan: aggregation parser depth limit exceeded (${o})`,"recursion");d>0&&p++}let l=e.slice(u,p).trim();for(p++;p<e.length&&e[p]===" ";)p++;let f="";if(e.slice(p,p+3).toLowerCase()==="as "){for(p+=3;p<e.length&&e[p]===" ";)p++;let x=p;for(;p<e.length&&/\w/.test(e[p]);)p++;f=e.slice(x,p)}if(f||(f=l?`${a}(${l})`:`${a}()`),i.length>=n)throw new E(`xan: aggregation specification limit exceeded (${n})`,"array_elements");i.push({func:a,expr:l,alias:f})}return i}function ft(e){return/^\w+$/.test(e)}function ht(e,t,n){let s=V(e,t,n);return s.length>0?s[0]:null}function ce(e,t,n={},s={}){let{func:r,expr:o}=t,i=s.maxArrayElements??1e5,p=s.maxStringLength??10*1024*1024,h=s.maxIterations??1e5,m={maxSourceLength:p,maxTokens:i,maxAstNodes:i,maxOperations:h,maxDepth:s.maxDepth??100};if(e.length>i)throw new E(`xan: aggregation input limit exceeded (${i})`,"array_elements");if(r==="count"&&!o)return e.length;let c=ft(o),a=c?null:U(B(o,m),!0,m),d;if(c)d=f=>f[o];else{if(a===null)throw new Error("xan: missing compiled aggregation expression");d=f=>ht(f,a,n)}if(r==="all"||r==="any"){let f=0;for(let x of e){if(s.consumeWork?.(),++f>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let g=!!d(x);if(r==="all"&&!g)return!1;if(r==="any"&&g)return!0}return r==="all"}let u=[],l=0;for(let f of e){if(s.consumeWork?.(),++l>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let x=d(f);if(x!=null){if(u.length>=i)throw new E(`xan: aggregation value limit exceeded (${i})`,"array_elements");u.push(x)}}switch(r){case"count":{if(c)return u.length;let f=0;for(let x of u)s.consumeWork?.(),x&&f++;return f}case"sum":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return f}case"mean":case"avg":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return u.length>0?f/u.length:0}case"min":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.min(f,g)}return f}case"max":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.max(f,g)}return f}case"first":return u.length>0?u[0]:null;case"last":return u.length>0?u[u.length-1]:null;case"median":{let f=[];for(let g of u){s.consumeWork?.();let y=typeof g=="number"?g:Number.parseFloat(String(g));Number.isNaN(y)||f.push(y)}if(s.consumeWork?.(Q(f.length)),f.sort((g,y)=>g-y),f.length===0)return null;let x=Math.floor(f.length/2);return f.length%2===0?(f[x-1]+f[x])/2:f[x]}case"mode":{let f=new Map;for(let y of u){s.consumeWork?.();let w=String(y);f.set(w,(f.get(w)||0)+1)}let x=0,g=null;for(let[y,w]of f)s.consumeWork?.(),w>x&&(x=w,g=y);return g}case"cardinality":{let f=new Set;for(let x of u)s.consumeWork?.(),f.add(String(x));return f.size}case"values":return ot(u,!1,p,s);case"distinct_values":return ot(u,!0,p,s);default:return null}}function it(e,t,n={},s={}){let r=F();for(let o of t)b(r,o.alias,ce(e,o,n,s));return r}function ot(e,t,n,s){let r=[],o=t?new Set:null,i=0;for(let p of e){s.consumeWork?.();let h=String(p);if(o?.has(h))continue;o?.add(h);let m=K(h)+(r.length>0?1:0);if(m>n-i)throw new E(`xan: aggregation string limit exceeded (${n} bytes)`,"string_length");r.push(h),i+=m}return t&&(s.consumeWork?.(Q(r.length)),r.sort()),r.join("|")}function lt(e,t){return{maxArrayElements:e.limits.maxArrayElements,maxStringLength:e.limits.maxStringLength,maxIterations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth,consumeWork:(n=1)=>t.consumeWork(n)}}function at(e,t,n){let s=e.size-(t&&e.has("")?1:0);return n>0?Math.min(s,n):s}async function pe(e,t){let n="",s=[];for(let d of e)d.startsWith("-")||(n?s.push(d):n=d);if(!n)return{stdout:"",stderr:`xan agg: no aggregation expression
@@ -62,7 +62,7 @@ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k
62
62
  `,exitCode:1};i=o[0].headers}let m=[];for(let{headers:c,data:a}of o)for(let d of a){let u=F();for(let l of i)b(u,l,c.includes(l)?d[l]:"");m.push(u)}return{stdout:C(i,m,t),stderr:"",exitCode:0}}async function Be(e,t){let n="",s=[],r=!1,o=!1,i=[];for(let u=0;u<e.length;u++){let l=e[u];(l==="-s"||l==="--select")&&u+1<e.length?s=e[++u].split(","):l==="-v"||l==="--invert"?r=!0:l==="-i"||l==="--ignore-case"?o=!0:l==="-r"||l==="--regex"||l.startsWith("-")||(n?i.push(l):n=l)}if(!n)return{stdout:"",stderr:`xan search: no pattern specified
63
63
  `,exitCode:1};let{headers:p,data:h,error:m}=await k(i,t);if(m)return m;let c=s.length>0?s:p,a;try{a=Z(n,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${n}'
64
64
  `,exitCode:1}}let d=h.filter(u=>{let l=c.some(f=>{let x=u[f];return x!=null&&a.test(String(x))});return r?!l:l});return{stdout:C(p,d,t),stderr:"",exitCode:0}}async function He(e,t){let n="",s=[];for(let l of e)l.startsWith("-")||(n?s.push(l):n=l);if(!n)return{stdout:"",stderr:`xan flatmap: no expression specified
65
- `,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-H3LNQ72O.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...dt]),pt={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
65
+ `,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-UEFBHYVN.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...dt]),pt={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
66
66
  It provides a simple, ergonomic interface for common data operations.
67
67
 
68
68
  COMMANDS:
@@ -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 L}from"./chunk-O74FSWB4.js";import{a as $}from"./chunk-ODCVIRIN.js";import{l as p}from"./chunk-LCP3IKI7.js";import{e as k}from"./chunk-CPKBPQ2C.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as F,b as q}from"./chunk-MUFNRCMY.js";var B={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-A, --show-all equivalent to -vET","-b, --number-nonblank number nonempty output lines, overrides -n","-e equivalent to -vE","-E, --show-ends display $ at end of each line","-n, --number number all output lines","-s, --squeeze-blank suppress repeated empty output lines","-t equivalent to -vT","-T, --show-tabs display TAB characters as ^I","-u (ignored)","-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB"," --help display this help and exit"]},I={number:{short:"n",long:"number",type:"boolean"},numberNonblank:{short:"b",long:"number-nonblank",type:"boolean"},showEnds:{short:"E",long:"show-ends",type:"boolean"},showTabs:{short:"T",long:"show-tabs",type:"boolean"},showNonprinting:{short:"v",long:"show-nonprinting",type:"boolean"},showAll:{short:"A",long:"show-all",type:"boolean"},squeeze:{short:"s",long:"squeeze-blank",type:"boolean"},vE:{short:"e",type:"boolean"},vT:{short:"t",type:"boolean"},ignored:{short:"u",type:"boolean"}},K={name:"cat",async execute(n,t){if(q(n))return F(B);let r=x("cat",n,I);if(!r.ok)return r.error;let e=r.result.flags,a=e.showEnds||e.showAll||e.vE,o=e.showTabs||e.showAll||e.vT,i=e.showNonprinting||e.showAll||e.vE||e.vT,c=e.squeeze,l=e.numberNonblank,f=e.number&&!l,s={numberAll:f,numberNonblank:l,showEnds:a,showTabs:o,showNonprinting:i,squeeze:c},m=r.result.positional,b=t.limits.maxStringLength,u=Math.min(b,t.limits.maxOutputSize),g=m.length===0?["-"]:m,h="",d=0,C=0,E,w=a||o||i||c||f||l,v="";for(let y of g)try{let T=y==="-"?t.stdin:await k(t.fs,t.fs.resolvePath(t.cwd,y)),A=T,z=A.length,N=Math.min(w?b:u,t.limits.maxInputBytes);if(z>N-C)throw new p(`cat: ${w?"input":"output"} size limit exceeded (${N} bytes)`,w?"string_length":"output_size");y!=="-"&&L(t,z,"cat"),C+=z,v+=A}catch(T){$(T),h+=`cat: ${y}: No such file or directory
3
+ import{a as L}from"./chunk-O74FSWB4.js";import{a as $}from"./chunk-74TZ7ZF7.js";import{l as p}from"./chunk-LCP3IKI7.js";import{e as k}from"./chunk-CPKBPQ2C.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as F,b as q}from"./chunk-MUFNRCMY.js";var B={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-A, --show-all equivalent to -vET","-b, --number-nonblank number nonempty output lines, overrides -n","-e equivalent to -vE","-E, --show-ends display $ at end of each line","-n, --number number all output lines","-s, --squeeze-blank suppress repeated empty output lines","-t equivalent to -vT","-T, --show-tabs display TAB characters as ^I","-u (ignored)","-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB"," --help display this help and exit"]},I={number:{short:"n",long:"number",type:"boolean"},numberNonblank:{short:"b",long:"number-nonblank",type:"boolean"},showEnds:{short:"E",long:"show-ends",type:"boolean"},showTabs:{short:"T",long:"show-tabs",type:"boolean"},showNonprinting:{short:"v",long:"show-nonprinting",type:"boolean"},showAll:{short:"A",long:"show-all",type:"boolean"},squeeze:{short:"s",long:"squeeze-blank",type:"boolean"},vE:{short:"e",type:"boolean"},vT:{short:"t",type:"boolean"},ignored:{short:"u",type:"boolean"}},K={name:"cat",async execute(n,t){if(q(n))return F(B);let r=x("cat",n,I);if(!r.ok)return r.error;let e=r.result.flags,a=e.showEnds||e.showAll||e.vE,o=e.showTabs||e.showAll||e.vT,i=e.showNonprinting||e.showAll||e.vE||e.vT,c=e.squeeze,l=e.numberNonblank,f=e.number&&!l,s={numberAll:f,numberNonblank:l,showEnds:a,showTabs:o,showNonprinting:i,squeeze:c},m=r.result.positional,b=t.limits.maxStringLength,u=Math.min(b,t.limits.maxOutputSize),g=m.length===0?["-"]:m,h="",d=0,C=0,E,w=a||o||i||c||f||l,v="";for(let y of g)try{let T=y==="-"?t.stdin:await k(t.fs,t.fs.resolvePath(t.cwd,y)),A=T,z=A.length,N=Math.min(w?b:u,t.limits.maxInputBytes);if(z>N-C)throw new p(`cat: ${w?"input":"output"} size limit exceeded (${N} bytes)`,w?"string_length":"output_size");y!=="-"&&L(t,z,"cat"),C+=z,v+=A}catch(T){$(T),h+=`cat: ${y}: No such file or directory
4
4
  `,d=1}return w?E=_(v,s,u,t.limits.maxArrayElements):E=v,{stdout:E,stderr:h,exitCode:d,stdoutEncoding:"binary"}}};function S(n){if(n>=32){if(n<127)return String.fromCharCode(n);if(n===127)return"^?";let t=n-128;return t>=32?t===127?"M-^?":`M-${String.fromCharCode(t)}`:`M-^${String.fromCharCode(t+64)}`}return`^${String.fromCharCode(n+64)}`}function M(n,t,r){if(!t.showNonprinting&&!t.showTabs)return n;let e="",a=o=>{if(o.length>r-e.length)throw new p("cat: output size limit exceeded","output_size");e+=o};for(let o=0;o<n.length;o++){let i=n.charCodeAt(o);i===9?a(t.showTabs?"^I":" "):t.showNonprinting?a(S(i)):a(n[o])}return e}function _(n,t,r,e){let a=1;for(let s=0;s<n.length;s++)if(n.charCodeAt(s)===10&&a++,a>e)throw new p(`cat: array element limit exceeded (${e})`,"array_elements");let o=n.split(`
5
5
  `),i="",c=1,l=!1,f=s=>{if(s.length>r-i.length)throw new p(`cat: output size limit exceeded (${r} bytes)`,"output_size");i+=s};for(let s=0;s<o.length;s++){let m=s===o.length-1,b=!m,u=o[s];if(m&&u==="")break;let g=u==="";if(t.squeeze&&g&&l)continue;l=g;let h="";(t.numberAll||t.numberNonblank&&!g)&&(h=`${String(c).padStart(6," ")} `,c++);let d=r-i.length-h.length;if(d<0)throw new p(`cat: output size limit exceeded (${r} bytes)`,"output_size");f(h+M(u,t,d)),b&&f(t.showEnds?`$
6
6
  `:`
@@ -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 E}from"./chunk-ODCVIRIN.js";import{a as h}from"./chunk-H4BRFPKY.js";import{l as $}from"./chunk-LCP3IKI7.js";import{a as k}from"./chunk-CPKBPQ2C.js";import{a as C,b as L,c as F}from"./chunk-MUFNRCMY.js";var A={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},S=1e5,_=0;function U(e){return Uint8Array.from(e,t=>t.charCodeAt(0))}function N(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let i=Number(t[1]);if(!Number.isSafeInteger(i)||i<1)return null;let u=(t[2]||"").toUpperCase(),a=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return a===void 0||i>Math.floor(Number.MAX_SAFE_INTEGER/a)?null:i*a}function x(e){if(!/^[0-9]+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)&&t>=1?t:null}function H(e,t,i){if(t)return e.toString().padStart(i,"0");let u="abcdefghijklmnopqrstuvwxyz",n=new Array(i),a=e;for(let o=i-1;o>=0;o--)n[o]=u[a%26],a=Math.floor(a/26);return n.join("")}function B(e,t){let i=[],u=0,n=0;for(let a=0;a<e.length;a++)e[a]===10&&(n++,n===t&&(i.push(e.subarray(u,a+1)),u=a+1,n=0));return u<e.length&&i.push(e.subarray(u)),i}function T(e,t){let i=[];for(let u=0;u<e.length;u+=t)i.push(e.subarray(u,u+t));return i}function X(e,t){let i=[],u=Math.ceil(e.length/t);for(let n=0;n<t;n++){let a=n*u,o=Math.min(a+u,e.length);a<o&&i.push(e.subarray(a,o))}return i}function z(e,t){let i=e?10**t:26**t;return Number.isSafeInteger(i)?i:Number.MAX_SAFE_INTEGER}function G(e){if(e.existence!=="unknown")return e.existence==="existing"?e.stableIdentity:e.canonicalPath===void 0?void 0:`missing:${e.canonicalPath}`}function I(e,t){return e.existence!==t.existence||e.existence==="unknown"||t.existence==="unknown"?!1:e.existence==="missing"&&t.existence==="missing"?e.canonicalPath===t.canonicalPath:e.existence==="existing"&&t.existence==="existing"?e.stableIdentity!==void 0&&e.stableIdentity===t.stableIdentity:!1}async function M(e,t,i){let u=t.lastIndexOf("/"),n=u<=0?"/":t.slice(0,u),a=t.slice(u+1);for(let o=0;o<100;o++){let d=_++,c=e.fs.resolvePath(n,`.${a}.just-bash-split-${i}-${d}`),p=await h(e.fs,c);if(p.existence==="missing")return c;if(p.existence==="unknown")break}throw new Error("unable to allocate transaction path")}var Z={name:"split",execute:async(e,t)=>{if(L(e))return C(A);let i={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],n=0;for(;n<e.length;){let s=e[n];if(s==="-l"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[n+1]}'
3
+ import{a as E}from"./chunk-74TZ7ZF7.js";import{a as h}from"./chunk-H4BRFPKY.js";import{l as $}from"./chunk-LCP3IKI7.js";import{a as k}from"./chunk-CPKBPQ2C.js";import{a as C,b as L,c as F}from"./chunk-MUFNRCMY.js";var A={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},S=1e5,_=0;function U(e){return Uint8Array.from(e,t=>t.charCodeAt(0))}function N(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let i=Number(t[1]);if(!Number.isSafeInteger(i)||i<1)return null;let u=(t[2]||"").toUpperCase(),a=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return a===void 0||i>Math.floor(Number.MAX_SAFE_INTEGER/a)?null:i*a}function x(e){if(!/^[0-9]+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)&&t>=1?t:null}function H(e,t,i){if(t)return e.toString().padStart(i,"0");let u="abcdefghijklmnopqrstuvwxyz",n=new Array(i),a=e;for(let o=i-1;o>=0;o--)n[o]=u[a%26],a=Math.floor(a/26);return n.join("")}function B(e,t){let i=[],u=0,n=0;for(let a=0;a<e.length;a++)e[a]===10&&(n++,n===t&&(i.push(e.subarray(u,a+1)),u=a+1,n=0));return u<e.length&&i.push(e.subarray(u)),i}function T(e,t){let i=[];for(let u=0;u<e.length;u+=t)i.push(e.subarray(u,u+t));return i}function X(e,t){let i=[],u=Math.ceil(e.length/t);for(let n=0;n<t;n++){let a=n*u,o=Math.min(a+u,e.length);a<o&&i.push(e.subarray(a,o))}return i}function z(e,t){let i=e?10**t:26**t;return Number.isSafeInteger(i)?i:Number.MAX_SAFE_INTEGER}function G(e){if(e.existence!=="unknown")return e.existence==="existing"?e.stableIdentity:e.canonicalPath===void 0?void 0:`missing:${e.canonicalPath}`}function I(e,t){return e.existence!==t.existence||e.existence==="unknown"||t.existence==="unknown"?!1:e.existence==="missing"&&t.existence==="missing"?e.canonicalPath===t.canonicalPath:e.existence==="existing"&&t.existence==="existing"?e.stableIdentity!==void 0&&e.stableIdentity===t.stableIdentity:!1}async function M(e,t,i){let u=t.lastIndexOf("/"),n=u<=0?"/":t.slice(0,u),a=t.slice(u+1);for(let o=0;o<100;o++){let d=_++,c=e.fs.resolvePath(n,`.${a}.just-bash-split-${i}-${d}`),p=await h(e.fs,c);if(p.existence==="missing")return c;if(p.existence==="unknown")break}throw new Error("unable to allocate transaction path")}var Z={name:"split",execute:async(e,t)=>{if(L(e))return C(A);let i={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],n=0;for(;n<e.length;){let s=e[n];if(s==="-l"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[n+1]}'
4
4
  `};i.mode="lines",i.lines=l,n+=2}else if(s.match(/^-l\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s.slice(2)}'
5
5
  `};i.mode="lines",i.lines=l,n++}else if(s==="-b"&&n+1<e.length){let l=N(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${e[n+1]}'
6
6
  `};i.mode="bytes",i.bytes=l,n+=2}else if(s.match(/^-b.+$/)){let l=N(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s.slice(2)}'
@@ -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 $}from"./chunk-ODCVIRIN.js";import{d as y}from"./chunk-CPTQXTBJ.js";import{l as h}from"./chunk-LCP3IKI7.js";import{c as I,e as b}from"./chunk-CPKBPQ2C.js";import{c as w}from"./chunk-MUFNRCMY.js";function A(e,s){let i=10,r=null,u=!1,n=!1,l=!1,f=[];for(let o=0;o<e.length;o++){let t=e[o];if(t==="-n"&&o+1<e.length){let a=e[++o];s==="tail"&&a.startsWith("+")?(l=!0,i=parseInt(a.slice(1),10)):i=parseInt(a,10)}else if(s==="tail"&&t.startsWith("-n+"))l=!0,i=parseInt(t.slice(3),10);else if(t.startsWith("-n"))i=parseInt(t.slice(2),10);else if(t==="-c"&&o+1<e.length)r=parseInt(e[++o],10);else if(t.startsWith("-c"))r=parseInt(t.slice(2),10);else if(t.startsWith("--bytes="))r=parseInt(t.slice(8),10);else if(t.startsWith("--lines="))i=parseInt(t.slice(8),10);else if(t==="-q"||t==="--quiet"||t==="--silent")u=!0;else if(t==="-v"||t==="--verbose")n=!0;else if(t.match(/^-\d+$/))i=parseInt(t.slice(1),10);else{if(t.startsWith("--"))return{ok:!1,error:w(s,t)};if(t.startsWith("-")&&t!=="-")return{ok:!1,error:w(s,t)};f.push(t)}}return r!==null&&(Number.isNaN(r)||r<0)?{ok:!1,error:{stdout:"",stderr:`${s}: invalid number of bytes
3
+ import{a as $}from"./chunk-74TZ7ZF7.js";import{d as y}from"./chunk-CPTQXTBJ.js";import{l as h}from"./chunk-LCP3IKI7.js";import{c as I,e as b}from"./chunk-CPKBPQ2C.js";import{c as w}from"./chunk-MUFNRCMY.js";function A(e,s){let i=10,r=null,u=!1,n=!1,l=!1,f=[];for(let o=0;o<e.length;o++){let t=e[o];if(t==="-n"&&o+1<e.length){let a=e[++o];s==="tail"&&a.startsWith("+")?(l=!0,i=parseInt(a.slice(1),10)):i=parseInt(a,10)}else if(s==="tail"&&t.startsWith("-n+"))l=!0,i=parseInt(t.slice(3),10);else if(t.startsWith("-n"))i=parseInt(t.slice(2),10);else if(t==="-c"&&o+1<e.length)r=parseInt(e[++o],10);else if(t.startsWith("-c"))r=parseInt(t.slice(2),10);else if(t.startsWith("--bytes="))r=parseInt(t.slice(8),10);else if(t.startsWith("--lines="))i=parseInt(t.slice(8),10);else if(t==="-q"||t==="--quiet"||t==="--silent")u=!0;else if(t==="-v"||t==="--verbose")n=!0;else if(t.match(/^-\d+$/))i=parseInt(t.slice(1),10);else{if(t.startsWith("--"))return{ok:!1,error:w(s,t)};if(t.startsWith("-")&&t!=="-")return{ok:!1,error:w(s,t)};f.push(t)}}return r!==null&&(Number.isNaN(r)||r<0)?{ok:!1,error:{stdout:"",stderr:`${s}: invalid number of bytes
4
4
  `,exitCode:1}}:Number.isNaN(i)||i<0?{ok:!1,error:{stdout:"",stderr:`${s}: invalid number of lines
5
5
  `,exitCode:1}}:{ok:!0,options:{lines:i,bytes:r,quiet:u,verbose:n,files:f,fromLine:l}}}async function F(e,s,i,r){let{quiet:u,verbose:n,files:l}=s;if(l.length>e.limits.maxArrayElements)throw new h(`${i}: file operand limit exceeded (${e.limits.maxArrayElements})`,"array_elements");if(l.length===0)return{stdout:r(e.stdin),stderr:"",exitCode:0,stdoutEncoding:"binary"};let f=Math.min(e.limits.maxOutputSize,e.limits.maxStringLength),o=new y(f,i),t=new y(f,i),a=0,g=0,B=n||!u&&l.length>1,x=0;for(let m=0;m<l.length;m++){let c=l[m];try{let p=e.fs.resolvePath(e.cwd,c);if((await e.fs.stat(p)).size>e.limits.maxInputBytes-g)throw new h(`${i}: aggregate input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");let d=await b(e.fs,p);if(d.length>e.limits.maxInputBytes-g)throw new h(`${i}: aggregate input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");g+=d.length,e.executionScope?.consumeInput(d.length,i),B&&(x>0&&o.append(`
6
6
  `),o.append(I(`==> ${c} <==
@@ -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 E}from"./chunk-ODCVIRIN.js";import{d as T}from"./chunk-CPTQXTBJ.js";import{l as m}from"./chunk-LCP3IKI7.js";import{a as u,b as I}from"./chunk-CPKBPQ2C.js";import{a as S}from"./chunk-NE4R2FVV.js";import{a as B,b as F}from"./chunk-MUFNRCMY.js";var $={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},C={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},M={name:"paste",async execute(n,e){if(F(n))return B($);let l=S("paste",n,C);if(!l.ok)return l.error;let r=l.result.flags.delimiter,h=l.result.flags.serial,p=l.result.positional;if(p.length>e.limits.maxArrayElements)throw new m(`paste: file operand limit exceeded (${e.limits.maxArrayElements})`,"array_elements");if(u(r)>e.limits.maxStringLength)throw new m(`paste: delimiter size limit exceeded (${e.limits.maxStringLength} bytes)`,"string_length");if(p.length===0)return{stdout:"",stderr:`usage: paste [-s] [-d delimiters] file ...
3
+ import{a as E}from"./chunk-74TZ7ZF7.js";import{d as T}from"./chunk-CPTQXTBJ.js";import{l as m}from"./chunk-LCP3IKI7.js";import{a as u,b as I}from"./chunk-CPKBPQ2C.js";import{a as S}from"./chunk-NE4R2FVV.js";import{a as B,b as F}from"./chunk-MUFNRCMY.js";var $={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},C={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},M={name:"paste",async execute(n,e){if(F(n))return B($);let l=S("paste",n,C);if(!l.ok)return l.error;let r=l.result.flags.delimiter,h=l.result.flags.serial,p=l.result.positional;if(p.length>e.limits.maxArrayElements)throw new m(`paste: file operand limit exceeded (${e.limits.maxArrayElements})`,"array_elements");if(u(r)>e.limits.maxStringLength)throw new m(`paste: delimiter size limit exceeded (${e.limits.maxStringLength} bytes)`,"string_length");if(p.length===0)return{stdout:"",stderr:`usage: paste [-s] [-d delimiters] file ...
4
4
  `,exitCode:1};let g=I(e.stdin),o=g?g.split(`
5
5
  `):[""];o.length>0&&o[o.length-1]===""&&o.pop();let A=p.filter(t=>t==="-").length,f=[],y=0,x=u(g),L=t=>{if(t.length>e.limits.maxArrayElements-y)throw new m(`paste: line limit exceeded (${e.limits.maxArrayElements})`,"array_elements");y+=t.length,e.executionScope?.consumeWork(t.length,"paste lines")},w=0;for(let t of p)if(t==="-"){let i=[];for(let s=w;s<o.length;s+=A)i.push(o[s]);L(i),f.push(i),w++}else{let i=e.fs.resolvePath(e.cwd,t);try{let s=await e.fs.readFile(i),d=u(s);if(d>e.limits.maxInputBytes-x)throw new m(`paste: aggregate input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");x+=d,e.executionScope?.consumeInput(d,"paste");let a=s.split(`
6
6
  `);a.length>0&&a[a.length-1]===""&&a.pop(),L(a),f.push(a)}catch(s){return E(s),{stdout:"",stderr:`paste: ${t}: No such file or directory