just-bash 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +326 -0
  3. package/dist/Bash.d.ts +90 -0
  4. package/dist/ai/index.d.ts +56 -0
  5. package/dist/ast/types.d.ts +518 -0
  6. package/dist/bin/chunks/alias-74DFXE2E.js +7 -0
  7. package/dist/bin/chunks/awk-S63F6IYK.js +15 -0
  8. package/dist/bin/chunks/base64-NC7HTKLZ.js +5 -0
  9. package/dist/bin/chunks/basename-Y7JDBYHN.js +6 -0
  10. package/dist/bin/chunks/bash-TQGTNXAE.js +7 -0
  11. package/dist/bin/chunks/cat-YZXBF5YF.js +6 -0
  12. package/dist/bin/chunks/chmod-3G4LK462.js +9 -0
  13. package/dist/bin/chunks/chunk-26Q3PZQ6.js +2 -0
  14. package/dist/bin/chunks/chunk-4VDEBYW7.js +2 -0
  15. package/dist/bin/chunks/chunk-5KNEBKYN.js +2 -0
  16. package/dist/bin/chunks/chunk-GTNBSMZR.js +23 -0
  17. package/dist/bin/chunks/chunk-J7BCMQDI.js +16 -0
  18. package/dist/bin/chunks/chunk-J7MJV6WO.js +3 -0
  19. package/dist/bin/chunks/chunk-LV662IGP.js +6 -0
  20. package/dist/bin/chunks/chunk-TA7RUHGQ.js +4 -0
  21. package/dist/bin/chunks/clear-GTCFHSB2.js +2 -0
  22. package/dist/bin/chunks/cp-77UY7PGN.js +8 -0
  23. package/dist/bin/chunks/curl-NE7XEWMN.js +26 -0
  24. package/dist/bin/chunks/cut-UYV3FM7R.js +6 -0
  25. package/dist/bin/chunks/date-7NBRXV2Z.js +5 -0
  26. package/dist/bin/chunks/diff-TG2NXCX2.js +19 -0
  27. package/dist/bin/chunks/dirname-VLHP44TU.js +5 -0
  28. package/dist/bin/chunks/du-4FZ7WF2P.js +8 -0
  29. package/dist/bin/chunks/echo-DEUIS5JO.js +4 -0
  30. package/dist/bin/chunks/env-FVITWNHG.js +9 -0
  31. package/dist/bin/chunks/expr-HA2ZNL6S.js +5 -0
  32. package/dist/bin/chunks/find-4B67H4RP.js +11 -0
  33. package/dist/bin/chunks/grep-OVWU4WCZ.js +15 -0
  34. package/dist/bin/chunks/head-VGXR3WWL.js +2 -0
  35. package/dist/bin/chunks/help-5V3MPCYQ.js +16 -0
  36. package/dist/bin/chunks/history-PRQ4B6N2.js +3 -0
  37. package/dist/bin/chunks/html-to-markdown-L4UWMK4S.js +84 -0
  38. package/dist/bin/chunks/jq-EYSXBSCP.js +14 -0
  39. package/dist/bin/chunks/ln-DB7J2W5X.js +10 -0
  40. package/dist/bin/chunks/ls-C4MPAF3H.js +26 -0
  41. package/dist/bin/chunks/mkdir-LWULWDHP.js +7 -0
  42. package/dist/bin/chunks/mv-TDYCNSIQ.js +7 -0
  43. package/dist/bin/chunks/paste-R36J3G4K.js +8 -0
  44. package/dist/bin/chunks/printf-BOFQVMMK.js +15 -0
  45. package/dist/bin/chunks/pwd-X4MWD4JP.js +3 -0
  46. package/dist/bin/chunks/readlink-DPNOQY67.js +7 -0
  47. package/dist/bin/chunks/rm-W6CCBEMG.js +8 -0
  48. package/dist/bin/chunks/sed-7IS44XON.js +48 -0
  49. package/dist/bin/chunks/seq-DGJILX2Q.js +7 -0
  50. package/dist/bin/chunks/sleep-E4DIYGTT.js +10 -0
  51. package/dist/bin/chunks/sort-UJP353TM.js +15 -0
  52. package/dist/bin/chunks/stat-3PHITCPO.js +9 -0
  53. package/dist/bin/chunks/tail-YSVKBQ77.js +2 -0
  54. package/dist/bin/chunks/tee-UU2VS3OM.js +3 -0
  55. package/dist/bin/chunks/timeout-OZVAGW2H.js +12 -0
  56. package/dist/bin/chunks/touch-XCIAYF5I.js +4 -0
  57. package/dist/bin/chunks/tr-2EEKHHO6.js +20 -0
  58. package/dist/bin/chunks/tree-4247W67O.js +12 -0
  59. package/dist/bin/chunks/true-JCX733LK.js +2 -0
  60. package/dist/bin/chunks/uniq-W4HF6YSB.js +5 -0
  61. package/dist/bin/chunks/wc-CNJ3QDRA.js +6 -0
  62. package/dist/bin/chunks/which-HX2NMOP3.js +3 -0
  63. package/dist/bin/chunks/xargs-YNLVLPOF.js +4 -0
  64. package/dist/bin/just-bash.js +188 -0
  65. package/dist/bin/shell/chunks/alias-74DFXE2E.js +7 -0
  66. package/dist/bin/shell/chunks/awk-S63F6IYK.js +15 -0
  67. package/dist/bin/shell/chunks/base64-NC7HTKLZ.js +5 -0
  68. package/dist/bin/shell/chunks/basename-Y7JDBYHN.js +6 -0
  69. package/dist/bin/shell/chunks/bash-TQGTNXAE.js +7 -0
  70. package/dist/bin/shell/chunks/cat-YZXBF5YF.js +6 -0
  71. package/dist/bin/shell/chunks/chmod-3G4LK462.js +9 -0
  72. package/dist/bin/shell/chunks/chunk-26Q3PZQ6.js +2 -0
  73. package/dist/bin/shell/chunks/chunk-4VDEBYW7.js +2 -0
  74. package/dist/bin/shell/chunks/chunk-5KNEBKYN.js +2 -0
  75. package/dist/bin/shell/chunks/chunk-GTNBSMZR.js +23 -0
  76. package/dist/bin/shell/chunks/chunk-J7BCMQDI.js +16 -0
  77. package/dist/bin/shell/chunks/chunk-J7MJV6WO.js +3 -0
  78. package/dist/bin/shell/chunks/chunk-LV662IGP.js +6 -0
  79. package/dist/bin/shell/chunks/chunk-TA7RUHGQ.js +4 -0
  80. package/dist/bin/shell/chunks/clear-GTCFHSB2.js +2 -0
  81. package/dist/bin/shell/chunks/cp-77UY7PGN.js +8 -0
  82. package/dist/bin/shell/chunks/curl-NE7XEWMN.js +26 -0
  83. package/dist/bin/shell/chunks/cut-UYV3FM7R.js +6 -0
  84. package/dist/bin/shell/chunks/date-7NBRXV2Z.js +5 -0
  85. package/dist/bin/shell/chunks/diff-TG2NXCX2.js +19 -0
  86. package/dist/bin/shell/chunks/dirname-VLHP44TU.js +5 -0
  87. package/dist/bin/shell/chunks/du-4FZ7WF2P.js +8 -0
  88. package/dist/bin/shell/chunks/echo-DEUIS5JO.js +4 -0
  89. package/dist/bin/shell/chunks/env-FVITWNHG.js +9 -0
  90. package/dist/bin/shell/chunks/expr-HA2ZNL6S.js +5 -0
  91. package/dist/bin/shell/chunks/find-4B67H4RP.js +11 -0
  92. package/dist/bin/shell/chunks/grep-OVWU4WCZ.js +15 -0
  93. package/dist/bin/shell/chunks/head-VGXR3WWL.js +2 -0
  94. package/dist/bin/shell/chunks/help-5V3MPCYQ.js +16 -0
  95. package/dist/bin/shell/chunks/history-PRQ4B6N2.js +3 -0
  96. package/dist/bin/shell/chunks/html-to-markdown-L4UWMK4S.js +84 -0
  97. package/dist/bin/shell/chunks/jq-EYSXBSCP.js +14 -0
  98. package/dist/bin/shell/chunks/ln-DB7J2W5X.js +10 -0
  99. package/dist/bin/shell/chunks/ls-C4MPAF3H.js +26 -0
  100. package/dist/bin/shell/chunks/mkdir-LWULWDHP.js +7 -0
  101. package/dist/bin/shell/chunks/mv-TDYCNSIQ.js +7 -0
  102. package/dist/bin/shell/chunks/paste-R36J3G4K.js +8 -0
  103. package/dist/bin/shell/chunks/printf-BOFQVMMK.js +15 -0
  104. package/dist/bin/shell/chunks/pwd-X4MWD4JP.js +3 -0
  105. package/dist/bin/shell/chunks/readlink-DPNOQY67.js +7 -0
  106. package/dist/bin/shell/chunks/rm-W6CCBEMG.js +8 -0
  107. package/dist/bin/shell/chunks/sed-7IS44XON.js +48 -0
  108. package/dist/bin/shell/chunks/seq-DGJILX2Q.js +7 -0
  109. package/dist/bin/shell/chunks/sleep-E4DIYGTT.js +10 -0
  110. package/dist/bin/shell/chunks/sort-UJP353TM.js +15 -0
  111. package/dist/bin/shell/chunks/stat-3PHITCPO.js +9 -0
  112. package/dist/bin/shell/chunks/tail-YSVKBQ77.js +2 -0
  113. package/dist/bin/shell/chunks/tee-UU2VS3OM.js +3 -0
  114. package/dist/bin/shell/chunks/timeout-OZVAGW2H.js +12 -0
  115. package/dist/bin/shell/chunks/touch-XCIAYF5I.js +4 -0
  116. package/dist/bin/shell/chunks/tr-2EEKHHO6.js +20 -0
  117. package/dist/bin/shell/chunks/tree-4247W67O.js +12 -0
  118. package/dist/bin/shell/chunks/true-JCX733LK.js +2 -0
  119. package/dist/bin/shell/chunks/uniq-W4HF6YSB.js +5 -0
  120. package/dist/bin/shell/chunks/wc-CNJ3QDRA.js +6 -0
  121. package/dist/bin/shell/chunks/which-HX2NMOP3.js +3 -0
  122. package/dist/bin/shell/chunks/xargs-YNLVLPOF.js +4 -0
  123. package/dist/bin/shell/shell.js +172 -0
  124. package/dist/bundle/ai/index.js +541 -0
  125. package/dist/bundle/chunks/alias-7ZSTROM7.js +6 -0
  126. package/dist/bundle/chunks/awk-V4C3GTJI.js +14 -0
  127. package/dist/bundle/chunks/base64-WATI5PWI.js +4 -0
  128. package/dist/bundle/chunks/basename-SB5JXIY3.js +5 -0
  129. package/dist/bundle/chunks/bash-T4PXVRYX.js +6 -0
  130. package/dist/bundle/chunks/cat-5KESXK2M.js +5 -0
  131. package/dist/bundle/chunks/chmod-VLKWIL3N.js +8 -0
  132. package/dist/bundle/chunks/chunk-3YNHMZ5M.js +2 -0
  133. package/dist/bundle/chunks/chunk-44UOCSGV.js +1 -0
  134. package/dist/bundle/chunks/chunk-74CEPOFO.js +22 -0
  135. package/dist/bundle/chunks/chunk-JYYFSUWP.js +5 -0
  136. package/dist/bundle/chunks/chunk-UJMN5NLH.js +1 -0
  137. package/dist/bundle/chunks/chunk-W2EKKAIL.js +15 -0
  138. package/dist/bundle/chunks/chunk-ZVV5VXYZ.js +3 -0
  139. package/dist/bundle/chunks/clear-ZBD2DMXN.js +1 -0
  140. package/dist/bundle/chunks/cp-BLHAPLQZ.js +7 -0
  141. package/dist/bundle/chunks/curl-PA2MWGKN.js +25 -0
  142. package/dist/bundle/chunks/cut-7RHEYJ7Y.js +5 -0
  143. package/dist/bundle/chunks/date-YOOSNZVA.js +4 -0
  144. package/dist/bundle/chunks/diff-IVJFQANX.js +6 -0
  145. package/dist/bundle/chunks/dirname-Q5HDZLH2.js +4 -0
  146. package/dist/bundle/chunks/du-I5HYAKTQ.js +7 -0
  147. package/dist/bundle/chunks/echo-W2TA2N7Y.js +3 -0
  148. package/dist/bundle/chunks/env-OORA5GFS.js +8 -0
  149. package/dist/bundle/chunks/expr-A4LJAGVP.js +4 -0
  150. package/dist/bundle/chunks/find-K3NO35MZ.js +10 -0
  151. package/dist/bundle/chunks/grep-3D2INI4S.js +14 -0
  152. package/dist/bundle/chunks/head-7H5R4WKO.js +1 -0
  153. package/dist/bundle/chunks/help-SDCRRU2F.js +15 -0
  154. package/dist/bundle/chunks/history-7Z2STZ6Y.js +2 -0
  155. package/dist/bundle/chunks/html-to-markdown-XMBYO6FD.js +4 -0
  156. package/dist/bundle/chunks/jq-7R2XGLLH.js +13 -0
  157. package/dist/bundle/chunks/ln-UTUVIAFP.js +9 -0
  158. package/dist/bundle/chunks/ls-B7C35UDO.js +23 -0
  159. package/dist/bundle/chunks/mkdir-WYI2LJ6H.js +6 -0
  160. package/dist/bundle/chunks/mv-GN23UIZU.js +6 -0
  161. package/dist/bundle/chunks/paste-L4TYPVSP.js +7 -0
  162. package/dist/bundle/chunks/printf-3ZT5XOIZ.js +14 -0
  163. package/dist/bundle/chunks/pwd-ZVX5RTL4.js +2 -0
  164. package/dist/bundle/chunks/readlink-HHC33N5C.js +6 -0
  165. package/dist/bundle/chunks/rm-5X2XSQQ6.js +7 -0
  166. package/dist/bundle/chunks/sed-UZJSXYQZ.js +47 -0
  167. package/dist/bundle/chunks/seq-TFPZQZPJ.js +6 -0
  168. package/dist/bundle/chunks/sleep-QJBQD6VS.js +9 -0
  169. package/dist/bundle/chunks/sort-LHMQWYH2.js +14 -0
  170. package/dist/bundle/chunks/stat-TM5F5YO4.js +8 -0
  171. package/dist/bundle/chunks/tail-BLGGG2VX.js +1 -0
  172. package/dist/bundle/chunks/tee-VCNOG5VI.js +2 -0
  173. package/dist/bundle/chunks/timeout-THAT7IOO.js +11 -0
  174. package/dist/bundle/chunks/touch-Z5XRYFYY.js +3 -0
  175. package/dist/bundle/chunks/tr-UV4V27RJ.js +19 -0
  176. package/dist/bundle/chunks/tree-75UXQ4XJ.js +11 -0
  177. package/dist/bundle/chunks/true-OD7ZXH3O.js +1 -0
  178. package/dist/bundle/chunks/uniq-IIOQKNTS.js +4 -0
  179. package/dist/bundle/chunks/wc-OXLYBRUE.js +5 -0
  180. package/dist/bundle/chunks/which-ONWH3TNF.js +2 -0
  181. package/dist/bundle/chunks/xargs-E5JPQL24.js +3 -0
  182. package/dist/bundle/index.js +141 -0
  183. package/dist/commands/alias/alias.d.ts +3 -0
  184. package/dist/commands/awk/awk.d.ts +2 -0
  185. package/dist/commands/awk/executor.d.ts +3 -0
  186. package/dist/commands/awk/expressions.d.ts +3 -0
  187. package/dist/commands/awk/functions.d.ts +12 -0
  188. package/dist/commands/awk/parser.d.ts +3 -0
  189. package/dist/commands/awk/types.d.ts +44 -0
  190. package/dist/commands/base64/base64.d.ts +5 -0
  191. package/dist/commands/basename/basename.d.ts +2 -0
  192. package/dist/commands/bash/bash.d.ts +3 -0
  193. package/dist/commands/cat/cat.d.ts +2 -0
  194. package/dist/commands/chmod/chmod.d.ts +2 -0
  195. package/dist/commands/clear/clear.d.ts +2 -0
  196. package/dist/commands/cp/cp.d.ts +2 -0
  197. package/dist/commands/curl/curl.d.ts +8 -0
  198. package/dist/commands/curl/form.d.ts +21 -0
  199. package/dist/commands/curl/help.d.ts +9 -0
  200. package/dist/commands/curl/parse.d.ts +9 -0
  201. package/dist/commands/curl/types.d.ts +31 -0
  202. package/dist/commands/curl/utils.d.ts +20 -0
  203. package/dist/commands/cut/cut.d.ts +2 -0
  204. package/dist/commands/date/date.d.ts +5 -0
  205. package/dist/commands/diff/diff.d.ts +5 -0
  206. package/dist/commands/dirname/dirname.d.ts +2 -0
  207. package/dist/commands/du/du.d.ts +2 -0
  208. package/dist/commands/echo/echo.d.ts +2 -0
  209. package/dist/commands/env/env.d.ts +3 -0
  210. package/dist/commands/expr/expr.d.ts +7 -0
  211. package/dist/commands/find/find.d.ts +2 -0
  212. package/dist/commands/find/matcher.d.ts +3 -0
  213. package/dist/commands/find/parser.d.ts +2 -0
  214. package/dist/commands/find/types.d.ts +70 -0
  215. package/dist/commands/grep/grep.d.ts +4 -0
  216. package/dist/commands/head/head-tail-shared.d.ts +38 -0
  217. package/dist/commands/head/head.d.ts +2 -0
  218. package/dist/commands/help/help.d.ts +2 -0
  219. package/dist/commands/help.d.ts +16 -0
  220. package/dist/commands/history/history.d.ts +2 -0
  221. package/dist/commands/html-to-markdown/html-to-markdown.d.ts +7 -0
  222. package/dist/commands/jq/jq.d.ts +14 -0
  223. package/dist/commands/ln/ln.d.ts +2 -0
  224. package/dist/commands/ls/ls.d.ts +2 -0
  225. package/dist/commands/mkdir/mkdir.d.ts +2 -0
  226. package/dist/commands/mv/mv.d.ts +2 -0
  227. package/dist/commands/paste/paste.d.ts +2 -0
  228. package/dist/commands/printf/printf.d.ts +2 -0
  229. package/dist/commands/pwd/pwd.d.ts +2 -0
  230. package/dist/commands/readlink/readlink.d.ts +2 -0
  231. package/dist/commands/registry.d.ts +33 -0
  232. package/dist/commands/rm/rm.d.ts +2 -0
  233. package/dist/commands/sed/executor.d.ts +7 -0
  234. package/dist/commands/sed/parser.d.ts +5 -0
  235. package/dist/commands/sed/sed.d.ts +2 -0
  236. package/dist/commands/sed/types.d.ts +141 -0
  237. package/dist/commands/seq/seq.d.ts +14 -0
  238. package/dist/commands/sleep/sleep.d.ts +2 -0
  239. package/dist/commands/sort/comparator.d.ts +9 -0
  240. package/dist/commands/sort/parser.d.ts +11 -0
  241. package/dist/commands/sort/sort.d.ts +2 -0
  242. package/dist/commands/sort/types.d.ts +18 -0
  243. package/dist/commands/stat/stat.d.ts +2 -0
  244. package/dist/commands/tail/tail.d.ts +2 -0
  245. package/dist/commands/tee/tee.d.ts +2 -0
  246. package/dist/commands/timeout/timeout.d.ts +2 -0
  247. package/dist/commands/touch/touch.d.ts +2 -0
  248. package/dist/commands/tr/tr.d.ts +2 -0
  249. package/dist/commands/tree/tree.d.ts +2 -0
  250. package/dist/commands/true/true.d.ts +3 -0
  251. package/dist/commands/uniq/uniq.d.ts +2 -0
  252. package/dist/commands/wc/wc.d.ts +2 -0
  253. package/dist/commands/which/which.d.ts +2 -0
  254. package/dist/commands/xargs/xargs.d.ts +2 -0
  255. package/dist/fs-interface.d.ts +186 -0
  256. package/dist/fs.d.ts +39 -0
  257. package/dist/index.d.ts +12 -0
  258. package/dist/interpreter/arithmetic.d.ts +29 -0
  259. package/dist/interpreter/builtins/break.d.ts +6 -0
  260. package/dist/interpreter/builtins/cd.d.ts +6 -0
  261. package/dist/interpreter/builtins/continue.d.ts +6 -0
  262. package/dist/interpreter/builtins/declare.d.ts +29 -0
  263. package/dist/interpreter/builtins/eval.d.ts +9 -0
  264. package/dist/interpreter/builtins/exit.d.ts +5 -0
  265. package/dist/interpreter/builtins/export.d.ts +13 -0
  266. package/dist/interpreter/builtins/index.d.ts +36 -0
  267. package/dist/interpreter/builtins/let.d.ts +18 -0
  268. package/dist/interpreter/builtins/local.d.ts +6 -0
  269. package/dist/interpreter/builtins/read.d.ts +6 -0
  270. package/dist/interpreter/builtins/return.d.ts +6 -0
  271. package/dist/interpreter/builtins/set.d.ts +6 -0
  272. package/dist/interpreter/builtins/shift.d.ts +12 -0
  273. package/dist/interpreter/builtins/source.d.ts +6 -0
  274. package/dist/interpreter/builtins/unset.d.ts +12 -0
  275. package/dist/interpreter/builtins/variable-helpers.d.ts +30 -0
  276. package/dist/interpreter/conditionals.d.ts +17 -0
  277. package/dist/interpreter/control-flow.d.ts +21 -0
  278. package/dist/interpreter/errors.d.ts +107 -0
  279. package/dist/interpreter/expansion/analysis.d.ts +39 -0
  280. package/dist/interpreter/expansion/brace-range.d.ts +20 -0
  281. package/dist/interpreter/expansion/pattern.d.ts +22 -0
  282. package/dist/interpreter/expansion/variable.d.ts +27 -0
  283. package/dist/interpreter/expansion/word-split.d.ts +24 -0
  284. package/dist/interpreter/expansion.d.ts +27 -0
  285. package/dist/interpreter/functions.d.ts +12 -0
  286. package/dist/interpreter/helpers/array.d.ts +23 -0
  287. package/dist/interpreter/helpers/condition.d.ts +22 -0
  288. package/dist/interpreter/helpers/errors.d.ts +8 -0
  289. package/dist/interpreter/helpers/file-tests.d.ts +33 -0
  290. package/dist/interpreter/helpers/ifs.d.ts +43 -0
  291. package/dist/interpreter/helpers/loop.d.ts +24 -0
  292. package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
  293. package/dist/interpreter/helpers/readonly.d.ts +21 -0
  294. package/dist/interpreter/helpers/regex.d.ts +8 -0
  295. package/dist/interpreter/helpers/result.d.ts +54 -0
  296. package/dist/interpreter/helpers/statements.d.ts +20 -0
  297. package/dist/interpreter/helpers/string-compare.d.ts +22 -0
  298. package/dist/interpreter/helpers/string-tests.d.ts +13 -0
  299. package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
  300. package/dist/interpreter/helpers/word-parts.d.ts +22 -0
  301. package/dist/interpreter/index.d.ts +3 -0
  302. package/dist/interpreter/interpreter.d.ts +61 -0
  303. package/dist/interpreter/redirections.d.ts +14 -0
  304. package/dist/interpreter/types.d.ts +68 -0
  305. package/dist/limits.d.ts +26 -0
  306. package/dist/network/allow-list/shared.d.ts +45 -0
  307. package/dist/network/allow-list.d.ts +51 -0
  308. package/dist/network/fetch.d.ts +25 -0
  309. package/dist/network/index.d.ts +7 -0
  310. package/dist/network/types.d.ts +85 -0
  311. package/dist/overlay-fs/OverlayFs.d.ts +87 -0
  312. package/dist/overlay-fs/index.d.ts +1 -0
  313. package/dist/parser/arithmetic-parser.d.ts +25 -0
  314. package/dist/parser/command-parser.d.ts +10 -0
  315. package/dist/parser/compound-parser.d.ts +14 -0
  316. package/dist/parser/conditional-parser.d.ts +8 -0
  317. package/dist/parser/expansion-parser.d.ts +10 -0
  318. package/dist/parser/lexer.d.ts +135 -0
  319. package/dist/parser/parser.d.ts +92 -0
  320. package/dist/parser/types.d.ts +23 -0
  321. package/dist/parser/word-parser.d.ts +33 -0
  322. package/dist/sandbox/Command.d.ts +28 -0
  323. package/dist/sandbox/Sandbox.d.ts +60 -0
  324. package/dist/sandbox/index.d.ts +2 -0
  325. package/dist/types.d.ts +80 -0
  326. package/dist/utils/args.d.ts +55 -0
  327. package/dist/utils/file-reader.d.ts +64 -0
  328. package/dist/utils/glob.d.ts +25 -0
  329. package/package.json +103 -0
@@ -0,0 +1,44 @@
1
+ export interface AwkContext {
2
+ FS: string;
3
+ OFS: string;
4
+ NR: number;
5
+ NF: number;
6
+ FNR: number;
7
+ FILENAME: string;
8
+ RSTART: number;
9
+ RLENGTH: number;
10
+ fields: string[];
11
+ line: string;
12
+ vars: Record<string, string | number>;
13
+ arrays: Record<string, Record<string, string | number>>;
14
+ functions: Record<string, AwkFunction>;
15
+ random?: () => number;
16
+ lines?: string[];
17
+ lineIndex?: number;
18
+ fieldSep?: RegExp;
19
+ maxIterations?: number;
20
+ exitCode?: number;
21
+ shouldExit?: boolean;
22
+ shouldNext?: boolean;
23
+ loopBreak?: boolean;
24
+ loopContinue?: boolean;
25
+ }
26
+ export interface AwkFunction {
27
+ params: string[];
28
+ body: string;
29
+ }
30
+ export interface PatternRange {
31
+ start: string;
32
+ end: string;
33
+ }
34
+ export interface AwkRule {
35
+ pattern: string | null;
36
+ range?: PatternRange;
37
+ action: string;
38
+ }
39
+ export interface ParsedProgram {
40
+ begin: string | null;
41
+ main: AwkRule[];
42
+ end: string | null;
43
+ functions: Record<string, AwkFunction>;
44
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * base64 - Encode or decode base64
3
+ */
4
+ import type { Command } from "../../types.js";
5
+ export declare const base64Command: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const basenameCommand: Command;
@@ -0,0 +1,3 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const bashCommand: Command;
3
+ export declare const shCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const catCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const chmodCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const clearCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const cpCommand: Command;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * curl - Transfer data from or to a server
3
+ *
4
+ * This is a simplified implementation of curl that uses the secure fetch wrapper.
5
+ * Network access must be explicitly configured via BashEnvOptions.network.
6
+ */
7
+ import type { Command } from "../../types.js";
8
+ export declare const curlCommand: Command;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Form data handling for curl command
3
+ */
4
+ import type { FormField } from "./types.js";
5
+ /**
6
+ * URL-encode form data in curl's --data-urlencode format
7
+ * Supports: name=content, =content, name@file, @file
8
+ */
9
+ export declare function encodeFormData(input: string): string;
10
+ /**
11
+ * Parse -F/--form field specification
12
+ * Supports: name=value, name=@file, name=<file, name=value;type=mime
13
+ */
14
+ export declare function parseFormField(spec: string): FormField | null;
15
+ /**
16
+ * Generate multipart form data body and boundary
17
+ */
18
+ export declare function generateMultipartBody(fields: FormField[], fileContents: Map<string, string>): {
19
+ body: string;
20
+ boundary: string;
21
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Help text for curl command
3
+ */
4
+ export declare const curlHelp: {
5
+ name: string;
6
+ summary: string;
7
+ usage: string;
8
+ options: string[];
9
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Option parsing for curl command
3
+ */
4
+ import type { ExecResult } from "../../types.js";
5
+ import type { CurlOptions } from "./types.js";
6
+ /**
7
+ * Parse curl command line arguments
8
+ */
9
+ export declare function parseOptions(args: string[]): CurlOptions | ExecResult;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Types for curl command
3
+ */
4
+ export interface FormField {
5
+ name: string;
6
+ value: string;
7
+ filename?: string;
8
+ contentType?: string;
9
+ }
10
+ export interface CurlOptions {
11
+ method: string;
12
+ headers: Record<string, string>;
13
+ data?: string;
14
+ dataBinary: boolean;
15
+ formFields: FormField[];
16
+ user?: string;
17
+ uploadFile?: string;
18
+ cookieJar?: string;
19
+ outputFile?: string;
20
+ useRemoteName: boolean;
21
+ headOnly: boolean;
22
+ includeHeaders: boolean;
23
+ silent: boolean;
24
+ showError: boolean;
25
+ failSilently: boolean;
26
+ followRedirects: boolean;
27
+ writeOut?: string;
28
+ verbose: boolean;
29
+ timeoutMs?: number;
30
+ url?: string;
31
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Utility functions for curl command
3
+ */
4
+ /**
5
+ * Format response headers for output
6
+ */
7
+ export declare function formatHeaders(headers: Record<string, string>): string;
8
+ /**
9
+ * Extract filename from URL for -O option
10
+ */
11
+ export declare function extractFilename(url: string): string;
12
+ /**
13
+ * Apply write-out format string replacements
14
+ */
15
+ export declare function applyWriteOut(format: string, result: {
16
+ status: number;
17
+ headers: Record<string, string>;
18
+ url: string;
19
+ bodyLength: number;
20
+ }): string;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const cutCommand: Command;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * date - Display the current date and time
3
+ */
4
+ import type { Command } from "../../types.js";
5
+ export declare const dateCommand: Command;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * diff - Compare files line by line
3
+ */
4
+ import type { Command } from "../../types.js";
5
+ export declare const diffCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const dirnameCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const duCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const echoCommand: Command;
@@ -0,0 +1,3 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const envCommand: Command;
3
+ export declare const printenvCommand: Command;
@@ -0,0 +1,7 @@
1
+ import type { Command } from "../../types.js";
2
+ /**
3
+ * expr - evaluate expressions
4
+ *
5
+ * Basic implementation supporting arithmetic operations and string operations.
6
+ */
7
+ export declare const exprCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const findCommand: Command;
@@ -0,0 +1,3 @@
1
+ import type { EvalContext, Expression } from "./types.js";
2
+ export declare function evaluateExpression(expr: Expression, ctx: EvalContext): boolean;
3
+ export declare function collectNewerRefs(expr: Expression | null): string[];
@@ -0,0 +1,2 @@
1
+ import type { ParseResult } from "./types.js";
2
+ export declare function parseExpressions(args: string[], startIndex: number): ParseResult;
@@ -0,0 +1,70 @@
1
+ export type Expression = {
2
+ type: "name";
3
+ pattern: string;
4
+ ignoreCase?: boolean;
5
+ } | {
6
+ type: "path";
7
+ pattern: string;
8
+ ignoreCase?: boolean;
9
+ } | {
10
+ type: "type";
11
+ fileType: "f" | "d";
12
+ } | {
13
+ type: "empty";
14
+ } | {
15
+ type: "mtime";
16
+ days: number;
17
+ comparison: "exact" | "more" | "less";
18
+ } | {
19
+ type: "newer";
20
+ refPath: string;
21
+ } | {
22
+ type: "size";
23
+ value: number;
24
+ unit: SizeUnit;
25
+ comparison: "exact" | "more" | "less";
26
+ } | {
27
+ type: "perm";
28
+ mode: number;
29
+ matchType: "exact" | "all" | "any";
30
+ } | {
31
+ type: "not";
32
+ expr: Expression;
33
+ } | {
34
+ type: "and";
35
+ left: Expression;
36
+ right: Expression;
37
+ } | {
38
+ type: "or";
39
+ left: Expression;
40
+ right: Expression;
41
+ };
42
+ export type SizeUnit = "c" | "k" | "M" | "G" | "b";
43
+ export type FindAction = {
44
+ type: "exec";
45
+ command: string[];
46
+ batchMode: boolean;
47
+ } | {
48
+ type: "print";
49
+ } | {
50
+ type: "print0";
51
+ } | {
52
+ type: "delete";
53
+ };
54
+ export interface EvalContext {
55
+ name: string;
56
+ relativePath: string;
57
+ isFile: boolean;
58
+ isDirectory: boolean;
59
+ isEmpty: boolean;
60
+ mtime: number;
61
+ size: number;
62
+ mode: number;
63
+ newerRefTimes: Map<string, number>;
64
+ }
65
+ export interface ParseResult {
66
+ expr: Expression | null;
67
+ pathIndex: number;
68
+ error?: string;
69
+ actions: FindAction[];
70
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const grepCommand: Command;
3
+ export declare const fgrepCommand: Command;
4
+ export declare const egrepCommand: Command;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Shared utilities for head and tail commands.
3
+ */
4
+ import type { CommandContext, ExecResult } from "../../types.js";
5
+ export interface HeadTailOptions {
6
+ lines: number;
7
+ bytes: number | null;
8
+ quiet: boolean;
9
+ verbose: boolean;
10
+ files: string[];
11
+ /** tail-specific: start from line N instead of last N lines */
12
+ fromLine?: boolean;
13
+ }
14
+ export type HeadTailParseResult = {
15
+ ok: true;
16
+ options: HeadTailOptions;
17
+ } | {
18
+ ok: false;
19
+ error: ExecResult;
20
+ };
21
+ /**
22
+ * Parse head/tail command arguments.
23
+ * Both commands share most options, with tail having additional +N syntax.
24
+ */
25
+ export declare function parseHeadTailArgs(args: string[], cmdName: "head" | "tail"): HeadTailParseResult;
26
+ /**
27
+ * Process files for head/tail commands.
28
+ * Handles stdin, multiple files, headers, and error handling.
29
+ */
30
+ export declare function processHeadTailFiles(ctx: CommandContext, options: HeadTailOptions, cmdName: "head" | "tail", contentProcessor: (content: string) => string): Promise<ExecResult>;
31
+ /**
32
+ * Get the first N lines or bytes from content.
33
+ */
34
+ export declare function getHead(content: string, lines: number, bytes: number | null): string;
35
+ /**
36
+ * Get the last N lines or bytes from content.
37
+ */
38
+ export declare function getTail(content: string, lines: number, bytes: number | null, fromLine: boolean): string;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const headCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const helpCommand: Command;
@@ -0,0 +1,16 @@
1
+ import type { ExecResult } from "../types.js";
2
+ export interface HelpInfo {
3
+ name: string;
4
+ summary: string;
5
+ usage: string;
6
+ description?: string | string[];
7
+ options?: string[];
8
+ examples?: string[];
9
+ notes?: string[];
10
+ }
11
+ export declare function showHelp(info: HelpInfo): ExecResult;
12
+ export declare function hasHelpFlag(args: string[]): boolean;
13
+ /**
14
+ * Returns an error result for an unknown option
15
+ */
16
+ export declare function unknownOption(cmdName: string, option: string): ExecResult;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const historyCommand: Command;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * html-to-markdown - Convert HTML to Markdown using TurndownService
3
+ *
4
+ * This is a non-standard command that converts HTML from stdin to Markdown.
5
+ */
6
+ import type { Command } from "../../types.js";
7
+ export declare const htmlToMarkdownCommand: Command;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * jq - Command-line JSON processor
3
+ *
4
+ * Supports a subset of jq syntax:
5
+ * - . (identity)
6
+ * - .key, .key.nested (object access)
7
+ * - .[0], .[-1] (array indexing)
8
+ * - .[] (array/object iteration)
9
+ * - .key[] (access then iterate)
10
+ * - keys, values, length, type
11
+ * - Pipes: .foo | .bar
12
+ */
13
+ import type { Command } from "../../types.js";
14
+ export declare const jqCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const lnCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const lsCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const mkdirCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const mvCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const pasteCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const printfCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const pwdCommand: Command;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const readlinkCommand: Command;
@@ -0,0 +1,33 @@
1
+ import type { Command } from "../types.js";
2
+ /** All available built-in command names (excludes network commands like curl) */
3
+ export type CommandName = "echo" | "cat" | "printf" | "ls" | "mkdir" | "touch" | "rm" | "cp" | "mv" | "ln" | "chmod" | "pwd" | "readlink" | "head" | "tail" | "wc" | "stat" | "grep" | "fgrep" | "egrep" | "sed" | "awk" | "sort" | "uniq" | "cut" | "paste" | "tr" | "tee" | "find" | "basename" | "dirname" | "tree" | "du" | "env" | "printenv" | "alias" | "unalias" | "history" | "xargs" | "true" | "false" | "clear" | "bash" | "sh" | "jq" | "base64" | "diff" | "date" | "sleep" | "timeout" | "seq" | "expr" | "html-to-markdown" | "help" | "which";
4
+ /** Network command names (only available when network is configured) */
5
+ export type NetworkCommandName = "curl";
6
+ /** All command names including network commands */
7
+ export type AllCommandName = CommandName | NetworkCommandName;
8
+ /**
9
+ * Gets all available command names (excludes network commands)
10
+ */
11
+ export declare function getCommandNames(): string[];
12
+ /**
13
+ * Gets all network command names
14
+ */
15
+ export declare function getNetworkCommandNames(): string[];
16
+ /**
17
+ * Creates all lazy commands for registration (excludes network commands)
18
+ * @param filter Optional array of command names to include. If not provided, all commands are created.
19
+ */
20
+ export declare function createLazyCommands(filter?: CommandName[]): Command[];
21
+ /**
22
+ * Creates network commands for registration (curl, etc.)
23
+ * These are only registered when network is explicitly configured.
24
+ */
25
+ export declare function createNetworkCommands(): Command[];
26
+ /**
27
+ * Clears the command cache (for testing)
28
+ */
29
+ export declare function clearCommandCache(): void;
30
+ /**
31
+ * Gets the number of loaded commands (for testing)
32
+ */
33
+ export declare function getLoadedCommandCount(): number;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const rmCommand: Command;
@@ -0,0 +1,7 @@
1
+ import type { SedCommand, SedExecutionLimits, SedState } from "./types.js";
2
+ export declare function createInitialState(totalLines: number): SedState;
3
+ export interface ExecuteContext {
4
+ lines: string[];
5
+ currentLineIndex: number;
6
+ }
7
+ export declare function executeCommands(commands: SedCommand[], state: SedState, ctx?: ExecuteContext, limits?: SedExecutionLimits): number;
@@ -0,0 +1,5 @@
1
+ import type { SedCommand } from "./types.js";
2
+ export declare function parseMultipleScripts(scripts: string[], extendedRegex?: boolean): {
3
+ commands: SedCommand[];
4
+ error?: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ import type { Command } from "../../types.js";
2
+ export declare const sedCommand: Command;
@@ -0,0 +1,141 @@
1
+ export interface StepAddress {
2
+ first: number;
3
+ step: number;
4
+ }
5
+ export type SedAddress = number | "$" | {
6
+ pattern: string;
7
+ } | StepAddress;
8
+ export interface AddressRange {
9
+ start?: SedAddress;
10
+ end?: SedAddress;
11
+ }
12
+ export type SedCommandType = "substitute" | "print" | "printFirstLine" | "delete" | "deleteFirstLine" | "append" | "insert" | "change" | "hold" | "holdAppend" | "get" | "getAppend" | "exchange" | "next" | "nextAppend" | "quit" | "transliterate" | "lineNumber" | "branch" | "branchOnSubst" | "branchOnNoSubst" | "label" | "zap" | "group";
13
+ export interface SubstituteCommand {
14
+ type: "substitute";
15
+ address?: AddressRange;
16
+ pattern: string;
17
+ replacement: string;
18
+ global: boolean;
19
+ ignoreCase: boolean;
20
+ printOnMatch: boolean;
21
+ nthOccurrence?: number;
22
+ extendedRegex?: boolean;
23
+ }
24
+ export interface PrintCommand {
25
+ type: "print";
26
+ address?: AddressRange;
27
+ }
28
+ export interface DeleteCommand {
29
+ type: "delete";
30
+ address?: AddressRange;
31
+ }
32
+ export interface AppendCommand {
33
+ type: "append";
34
+ address?: AddressRange;
35
+ text: string;
36
+ }
37
+ export interface InsertCommand {
38
+ type: "insert";
39
+ address?: AddressRange;
40
+ text: string;
41
+ }
42
+ export interface ChangeCommand {
43
+ type: "change";
44
+ address?: AddressRange;
45
+ text: string;
46
+ }
47
+ export interface HoldCommand {
48
+ type: "hold";
49
+ address?: AddressRange;
50
+ }
51
+ export interface HoldAppendCommand {
52
+ type: "holdAppend";
53
+ address?: AddressRange;
54
+ }
55
+ export interface GetCommand {
56
+ type: "get";
57
+ address?: AddressRange;
58
+ }
59
+ export interface GetAppendCommand {
60
+ type: "getAppend";
61
+ address?: AddressRange;
62
+ }
63
+ export interface ExchangeCommand {
64
+ type: "exchange";
65
+ address?: AddressRange;
66
+ }
67
+ export interface NextCommand {
68
+ type: "next";
69
+ address?: AddressRange;
70
+ }
71
+ export interface QuitCommand {
72
+ type: "quit";
73
+ address?: AddressRange;
74
+ }
75
+ export interface NextAppendCommand {
76
+ type: "nextAppend";
77
+ address?: AddressRange;
78
+ }
79
+ export interface TransliterateCommand {
80
+ type: "transliterate";
81
+ address?: AddressRange;
82
+ source: string;
83
+ dest: string;
84
+ }
85
+ export interface LineNumberCommand {
86
+ type: "lineNumber";
87
+ address?: AddressRange;
88
+ }
89
+ export interface BranchCommand {
90
+ type: "branch";
91
+ address?: AddressRange;
92
+ label?: string;
93
+ }
94
+ export interface BranchOnSubstCommand {
95
+ type: "branchOnSubst";
96
+ address?: AddressRange;
97
+ label?: string;
98
+ }
99
+ export interface LabelCommand {
100
+ type: "label";
101
+ name: string;
102
+ }
103
+ export interface BranchOnNoSubstCommand {
104
+ type: "branchOnNoSubst";
105
+ address?: AddressRange;
106
+ label?: string;
107
+ }
108
+ export interface PrintFirstLineCommand {
109
+ type: "printFirstLine";
110
+ address?: AddressRange;
111
+ }
112
+ export interface DeleteFirstLineCommand {
113
+ type: "deleteFirstLine";
114
+ address?: AddressRange;
115
+ }
116
+ export interface ZapCommand {
117
+ type: "zap";
118
+ address?: AddressRange;
119
+ }
120
+ export interface GroupCommand {
121
+ type: "group";
122
+ address?: AddressRange;
123
+ commands: SedCommand[];
124
+ }
125
+ export type SedCommand = SubstituteCommand | PrintCommand | PrintFirstLineCommand | DeleteCommand | DeleteFirstLineCommand | AppendCommand | InsertCommand | ChangeCommand | HoldCommand | HoldAppendCommand | GetCommand | GetAppendCommand | ExchangeCommand | NextCommand | QuitCommand | NextAppendCommand | TransliterateCommand | LineNumberCommand | BranchCommand | BranchOnSubstCommand | BranchOnNoSubstCommand | LabelCommand | ZapCommand | GroupCommand;
126
+ export interface SedState {
127
+ patternSpace: string;
128
+ holdSpace: string;
129
+ lineNumber: number;
130
+ totalLines: number;
131
+ deleted: boolean;
132
+ printed: boolean;
133
+ quit: boolean;
134
+ appendBuffer: string[];
135
+ substitutionMade: boolean;
136
+ lineNumberOutput: string[];
137
+ restartCycle: boolean;
138
+ }
139
+ export interface SedExecutionLimits {
140
+ maxIterations: number;
141
+ }