typescript-virtual-container 1.4.4 → 1.4.6

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 (884) hide show
  1. package/README.md +1 -1
  2. package/builds/self-standalone.js +321 -272
  3. package/builds/self-standalone.js.map +4 -4
  4. package/builds/standalone-wo-sftp.js +262 -212
  5. package/builds/standalone-wo-sftp.js.map +4 -4
  6. package/builds/standalone.cjs +491 -0
  7. package/builds/standalone.cjs.map +7 -0
  8. package/builds/standalone.js +266 -216
  9. package/builds/standalone.js.map +4 -4
  10. package/builds/web-full-api.min.js +5 -5
  11. package/builds/web-full-api.min.js.map +3 -3
  12. package/builds/web.min.js +5 -5
  13. package/builds/web.min.js.map +3 -3
  14. package/bun.lock +97 -0
  15. package/dist/Honeypot/index.d.ts.map +1 -0
  16. package/dist/Honeypot/index.js +299 -0
  17. package/dist/Honeypot/index.js.map +1 -0
  18. package/dist/SSHClient/index.d.ts.map +1 -0
  19. package/dist/SSHClient/index.js +238 -0
  20. package/dist/SSHClient/index.js.map +1 -0
  21. package/dist/SSHMimic/exec.d.ts.map +1 -0
  22. package/dist/SSHMimic/exec.js +28 -0
  23. package/dist/SSHMimic/exec.js.map +1 -0
  24. package/dist/SSHMimic/executor.d.ts.map +1 -0
  25. package/dist/SSHMimic/executor.js +161 -0
  26. package/dist/SSHMimic/executor.js.map +1 -0
  27. package/dist/SSHMimic/hostKey.d.ts.map +1 -0
  28. package/dist/SSHMimic/hostKey.js +18 -0
  29. package/dist/SSHMimic/hostKey.js.map +1 -0
  30. package/dist/SSHMimic/index.d.ts.map +1 -0
  31. package/dist/SSHMimic/index.js +250 -0
  32. package/dist/SSHMimic/index.js.map +1 -0
  33. package/dist/SSHMimic/loginBanner.d.ts.map +1 -0
  34. package/dist/SSHMimic/loginBanner.js +23 -0
  35. package/dist/SSHMimic/loginBanner.js.map +1 -0
  36. package/dist/SSHMimic/loginFormat.d.ts.map +1 -0
  37. package/dist/SSHMimic/loginFormat.js +11 -0
  38. package/dist/SSHMimic/loginFormat.js.map +1 -0
  39. package/dist/SSHMimic/prompt.d.ts.map +1 -0
  40. package/dist/SSHMimic/prompt.js +10 -0
  41. package/dist/SSHMimic/prompt.js.map +1 -0
  42. package/dist/SSHMimic/sftp.d.ts.map +1 -0
  43. package/dist/SSHMimic/sftp.js +620 -0
  44. package/dist/SSHMimic/sftp.js.map +1 -0
  45. package/dist/VirtualFileSystem/binaryPack.d.ts.map +1 -0
  46. package/dist/VirtualFileSystem/binaryPack.js +217 -0
  47. package/dist/VirtualFileSystem/binaryPack.js.map +1 -0
  48. package/dist/VirtualFileSystem/index.d.ts.map +1 -0
  49. package/dist/VirtualFileSystem/index.js +690 -0
  50. package/dist/VirtualFileSystem/index.js.map +1 -0
  51. package/dist/VirtualFileSystem/internalTypes.d.ts.map +1 -0
  52. package/dist/VirtualFileSystem/internalTypes.js +1 -0
  53. package/dist/VirtualFileSystem/internalTypes.js.map +1 -0
  54. package/dist/VirtualFileSystem/path.d.ts.map +1 -0
  55. package/dist/VirtualFileSystem/path.js +50 -0
  56. package/dist/VirtualFileSystem/path.js.map +1 -0
  57. package/dist/VirtualPackageManager/index.d.ts.map +1 -0
  58. package/dist/VirtualPackageManager/index.js +854 -0
  59. package/dist/VirtualPackageManager/index.js.map +1 -0
  60. package/dist/VirtualShell/index.d.ts.map +1 -0
  61. package/dist/VirtualShell/index.js +285 -0
  62. package/dist/VirtualShell/index.js.map +1 -0
  63. package/dist/VirtualShell/shell.d.ts.map +1 -0
  64. package/dist/VirtualShell/shell.js +503 -0
  65. package/dist/VirtualShell/shell.js.map +1 -0
  66. package/dist/VirtualShell/shellParser.d.ts.map +1 -0
  67. package/dist/VirtualShell/shellParser.js +266 -0
  68. package/dist/VirtualShell/shellParser.js.map +1 -0
  69. package/dist/VirtualUserManager/index.d.ts.map +1 -0
  70. package/dist/VirtualUserManager/index.js +608 -0
  71. package/dist/VirtualUserManager/index.js.map +1 -0
  72. package/dist/commands/adduser.d.ts.map +1 -0
  73. package/dist/commands/adduser.js +90 -0
  74. package/dist/commands/adduser.js.map +1 -0
  75. package/dist/commands/alias.d.ts.map +1 -0
  76. package/dist/commands/alias.js +69 -0
  77. package/dist/commands/alias.js.map +1 -0
  78. package/dist/commands/apt.d.ts.map +1 -0
  79. package/dist/commands/apt.js +211 -0
  80. package/dist/commands/apt.js.map +1 -0
  81. package/dist/commands/awk.d.ts.map +1 -0
  82. package/dist/commands/awk.js +170 -0
  83. package/dist/commands/awk.js.map +1 -0
  84. package/dist/commands/base64.d.ts.map +1 -0
  85. package/dist/commands/base64.js +29 -0
  86. package/dist/commands/base64.js.map +1 -0
  87. package/dist/commands/cat.d.ts.map +1 -0
  88. package/dist/commands/cat.js +45 -0
  89. package/dist/commands/cat.js.map +1 -0
  90. package/dist/commands/cd.d.ts.map +1 -0
  91. package/dist/commands/cd.js +22 -0
  92. package/dist/commands/cd.js.map +1 -0
  93. package/dist/commands/chmod.d.ts.map +1 -0
  94. package/dist/commands/chmod.js +88 -0
  95. package/dist/commands/chmod.js.map +1 -0
  96. package/dist/commands/clear.d.ts.map +1 -0
  97. package/dist/commands/clear.js +14 -0
  98. package/dist/commands/clear.js.map +1 -0
  99. package/dist/commands/command-helpers.d.ts.map +1 -0
  100. package/dist/commands/command-helpers.js +222 -0
  101. package/dist/commands/command-helpers.js.map +1 -0
  102. package/dist/commands/cp.d.ts.map +1 -0
  103. package/dist/commands/cp.js +76 -0
  104. package/dist/commands/cp.js.map +1 -0
  105. package/dist/commands/curl.d.ts.map +1 -0
  106. package/dist/commands/curl.js +128 -0
  107. package/dist/commands/curl.js.map +1 -0
  108. package/dist/commands/cut.d.ts.map +1 -0
  109. package/dist/commands/cut.js +35 -0
  110. package/dist/commands/cut.js.map +1 -0
  111. package/dist/commands/date.d.ts.map +1 -0
  112. package/dist/commands/date.js +29 -0
  113. package/dist/commands/date.js.map +1 -0
  114. package/dist/commands/declare.d.ts.map +1 -0
  115. package/dist/commands/declare.js +45 -0
  116. package/dist/commands/declare.js.map +1 -0
  117. package/dist/commands/deluser.d.ts.map +1 -0
  118. package/dist/commands/deluser.js +84 -0
  119. package/dist/commands/deluser.js.map +1 -0
  120. package/dist/commands/df.d.ts.map +1 -0
  121. package/dist/commands/df.js +22 -0
  122. package/dist/commands/df.js.map +1 -0
  123. package/dist/commands/diff.d.ts.map +1 -0
  124. package/dist/commands/diff.js +46 -0
  125. package/dist/commands/diff.js.map +1 -0
  126. package/dist/commands/dpkg.d.ts.map +1 -0
  127. package/dist/commands/dpkg.js +162 -0
  128. package/dist/commands/dpkg.js.map +1 -0
  129. package/dist/commands/du.d.ts.map +1 -0
  130. package/dist/commands/du.js +51 -0
  131. package/dist/commands/du.js.map +1 -0
  132. package/dist/commands/echo.d.ts.map +1 -0
  133. package/dist/commands/echo.js +46 -0
  134. package/dist/commands/echo.js.map +1 -0
  135. package/dist/commands/env.d.ts.map +1 -0
  136. package/dist/commands/env.js +21 -0
  137. package/dist/commands/env.js.map +1 -0
  138. package/dist/commands/exit.d.ts.map +1 -0
  139. package/dist/commands/exit.js +17 -0
  140. package/dist/commands/exit.js.map +1 -0
  141. package/dist/commands/export.d.ts.map +1 -0
  142. package/dist/commands/export.js +34 -0
  143. package/dist/commands/export.js.map +1 -0
  144. package/dist/commands/find.d.ts.map +1 -0
  145. package/dist/commands/find.js +56 -0
  146. package/dist/commands/find.js.map +1 -0
  147. package/dist/commands/free.d.ts.map +1 -0
  148. package/dist/commands/free.js +44 -0
  149. package/dist/commands/free.js.map +1 -0
  150. package/dist/commands/grep.d.ts.map +1 -0
  151. package/dist/commands/grep.js +121 -0
  152. package/dist/commands/grep.js.map +1 -0
  153. package/dist/commands/groups.d.ts.map +1 -0
  154. package/dist/commands/groups.js +18 -0
  155. package/dist/commands/groups.js.map +1 -0
  156. package/dist/commands/gzip.d.ts.map +1 -0
  157. package/dist/commands/gzip.js +83 -0
  158. package/dist/commands/gzip.js.map +1 -0
  159. package/dist/commands/head.d.ts.map +1 -0
  160. package/dist/commands/head.js +47 -0
  161. package/dist/commands/head.js.map +1 -0
  162. package/dist/commands/help.d.ts.map +1 -0
  163. package/dist/commands/help.js +124 -0
  164. package/dist/commands/help.js.map +1 -0
  165. package/dist/commands/helpers.d.ts.map +1 -0
  166. package/dist/commands/helpers.js +167 -0
  167. package/dist/commands/helpers.js.map +1 -0
  168. package/dist/commands/history.d.ts.map +1 -0
  169. package/dist/commands/history.js +27 -0
  170. package/dist/commands/history.js.map +1 -0
  171. package/dist/commands/hostname.d.ts.map +1 -0
  172. package/dist/commands/hostname.js +13 -0
  173. package/dist/commands/hostname.js.map +1 -0
  174. package/dist/commands/htop.d.ts.map +1 -0
  175. package/dist/commands/htop.js +18 -0
  176. package/dist/commands/htop.js.map +1 -0
  177. package/dist/commands/id.d.ts.map +1 -0
  178. package/dist/commands/id.js +18 -0
  179. package/dist/commands/id.js.map +1 -0
  180. package/dist/commands/index.d.ts.map +1 -0
  181. package/dist/commands/index.js +3 -0
  182. package/dist/commands/index.js.map +1 -0
  183. package/dist/commands/kill.d.ts.map +1 -0
  184. package/dist/commands/kill.js +19 -0
  185. package/dist/commands/kill.js.map +1 -0
  186. package/dist/commands/ln.d.ts.map +1 -0
  187. package/dist/commands/ln.js +67 -0
  188. package/dist/commands/ln.js.map +1 -0
  189. package/dist/commands/ls.d.ts.map +1 -0
  190. package/dist/commands/ls.js +201 -0
  191. package/dist/commands/ls.js.map +1 -0
  192. package/dist/commands/lsb-release.d.ts.map +1 -0
  193. package/dist/commands/lsb-release.js +62 -0
  194. package/dist/commands/lsb-release.js.map +1 -0
  195. package/dist/commands/man.d.ts.map +1 -0
  196. package/dist/commands/man.js +50 -0
  197. package/dist/commands/man.js.map +1 -0
  198. package/dist/commands/mkdir.d.ts.map +1 -0
  199. package/dist/commands/mkdir.js +29 -0
  200. package/dist/commands/mkdir.js.map +1 -0
  201. package/dist/commands/mv.d.ts.map +1 -0
  202. package/dist/commands/mv.js +43 -0
  203. package/dist/commands/mv.js.map +1 -0
  204. package/dist/commands/nano.d.ts.map +1 -0
  205. package/dist/commands/nano.js +35 -0
  206. package/dist/commands/nano.js.map +1 -0
  207. package/dist/commands/neofetch.d.ts.map +1 -0
  208. package/dist/commands/neofetch.js +49 -0
  209. package/dist/commands/neofetch.js.map +1 -0
  210. package/dist/commands/node.d.ts.map +1 -0
  211. package/dist/commands/node.js +317 -0
  212. package/dist/commands/node.js.map +1 -0
  213. package/dist/commands/npm.d.ts.map +1 -0
  214. package/dist/commands/npm.js +110 -0
  215. package/dist/commands/npm.js.map +1 -0
  216. package/dist/commands/passwd.d.ts.map +1 -0
  217. package/dist/commands/passwd.js +45 -0
  218. package/dist/commands/passwd.js.map +1 -0
  219. package/dist/commands/ping.d.ts.map +1 -0
  220. package/dist/commands/ping.js +29 -0
  221. package/dist/commands/ping.js.map +1 -0
  222. package/dist/commands/printf.d.ts.map +1 -0
  223. package/dist/commands/printf.js +145 -0
  224. package/dist/commands/printf.js.map +1 -0
  225. package/dist/commands/ps.d.ts.map +1 -0
  226. package/dist/commands/ps.js +47 -0
  227. package/dist/commands/ps.js.map +1 -0
  228. package/dist/commands/pwd.d.ts.map +1 -0
  229. package/dist/commands/pwd.js +8 -0
  230. package/dist/commands/pwd.js.map +1 -0
  231. package/dist/commands/python.d.ts.map +1 -0
  232. package/dist/commands/python.js +2059 -0
  233. package/dist/commands/python.js.map +1 -0
  234. package/dist/commands/read.d.ts.map +1 -0
  235. package/dist/commands/read.js +40 -0
  236. package/dist/commands/read.js.map +1 -0
  237. package/dist/commands/registry.d.ts.map +1 -0
  238. package/dist/commands/registry.js +235 -0
  239. package/dist/commands/registry.js.map +1 -0
  240. package/dist/commands/rm.d.ts.map +1 -0
  241. package/dist/commands/rm.js +37 -0
  242. package/dist/commands/rm.js.map +1 -0
  243. package/dist/commands/runtime.d.ts.map +1 -0
  244. package/dist/commands/runtime.js +286 -0
  245. package/dist/commands/runtime.js.map +1 -0
  246. package/dist/commands/sed.d.ts.map +1 -0
  247. package/dist/commands/sed.js +61 -0
  248. package/dist/commands/sed.js.map +1 -0
  249. package/dist/commands/seq.d.ts.map +1 -0
  250. package/dist/commands/seq.js +51 -0
  251. package/dist/commands/seq.js.map +1 -0
  252. package/dist/commands/set.d.ts.map +1 -0
  253. package/dist/commands/set.js +27 -0
  254. package/dist/commands/set.js.map +1 -0
  255. package/dist/commands/sh.d.ts.map +1 -0
  256. package/dist/commands/sh.js +432 -0
  257. package/dist/commands/sh.js.map +1 -0
  258. package/dist/commands/shift.d.ts.map +1 -0
  259. package/dist/commands/shift.js +63 -0
  260. package/dist/commands/shift.js.map +1 -0
  261. package/dist/commands/sleep.d.ts.map +1 -0
  262. package/dist/commands/sleep.js +19 -0
  263. package/dist/commands/sleep.js.map +1 -0
  264. package/dist/commands/sort.d.ts.map +1 -0
  265. package/dist/commands/sort.js +45 -0
  266. package/dist/commands/sort.js.map +1 -0
  267. package/dist/commands/source.d.ts.map +1 -0
  268. package/dist/commands/source.js +40 -0
  269. package/dist/commands/source.js.map +1 -0
  270. package/dist/commands/stat.d.ts.map +1 -0
  271. package/dist/commands/stat.js +57 -0
  272. package/dist/commands/stat.js.map +1 -0
  273. package/dist/commands/su.d.ts.map +1 -0
  274. package/dist/commands/su.js +58 -0
  275. package/dist/commands/su.js.map +1 -0
  276. package/dist/commands/sudo.d.ts.map +1 -0
  277. package/dist/commands/sudo.js +55 -0
  278. package/dist/commands/sudo.js.map +1 -0
  279. package/dist/commands/tail.d.ts.map +1 -0
  280. package/dist/commands/tail.js +48 -0
  281. package/dist/commands/tail.js.map +1 -0
  282. package/dist/commands/tar.d.ts.map +1 -0
  283. package/dist/commands/tar.js +103 -0
  284. package/dist/commands/tar.js.map +1 -0
  285. package/dist/commands/tee.d.ts.map +1 -0
  286. package/dist/commands/tee.js +37 -0
  287. package/dist/commands/tee.js.map +1 -0
  288. package/dist/commands/test.d.ts.map +1 -0
  289. package/dist/commands/test.js +115 -0
  290. package/dist/commands/test.js.map +1 -0
  291. package/dist/commands/touch.d.ts.map +1 -0
  292. package/dist/commands/touch.js +26 -0
  293. package/dist/commands/touch.js.map +1 -0
  294. package/dist/commands/tr.d.ts.map +1 -0
  295. package/dist/commands/tr.js +62 -0
  296. package/dist/commands/tr.js.map +1 -0
  297. package/dist/commands/tree.d.ts.map +1 -0
  298. package/dist/commands/tree.js +19 -0
  299. package/dist/commands/tree.js.map +1 -0
  300. package/dist/commands/true.d.ts.map +1 -0
  301. package/dist/commands/true.js +25 -0
  302. package/dist/commands/true.js.map +1 -0
  303. package/dist/commands/type.d.ts.map +1 -0
  304. package/dist/commands/type.js +40 -0
  305. package/dist/commands/type.js.map +1 -0
  306. package/dist/commands/uname.d.ts.map +1 -0
  307. package/dist/commands/uname.js +30 -0
  308. package/dist/commands/uname.js.map +1 -0
  309. package/dist/commands/uniq.d.ts.map +1 -0
  310. package/dist/commands/uniq.js +39 -0
  311. package/dist/commands/uniq.js.map +1 -0
  312. package/dist/commands/unset.d.ts.map +1 -0
  313. package/dist/commands/unset.js +17 -0
  314. package/dist/commands/unset.js.map +1 -0
  315. package/dist/commands/uptime.d.ts.map +1 -0
  316. package/dist/commands/uptime.js +49 -0
  317. package/dist/commands/uptime.js.map +1 -0
  318. package/dist/commands/wc.d.ts.map +1 -0
  319. package/dist/commands/wc.js +56 -0
  320. package/dist/commands/wc.js.map +1 -0
  321. package/dist/commands/wget.d.ts.map +1 -0
  322. package/dist/commands/wget.js +127 -0
  323. package/dist/commands/wget.js.map +1 -0
  324. package/dist/commands/which.d.ts.map +1 -0
  325. package/dist/commands/which.js +33 -0
  326. package/dist/commands/which.js.map +1 -0
  327. package/dist/commands/who.d.ts.map +1 -0
  328. package/dist/commands/who.js +23 -0
  329. package/dist/commands/who.js.map +1 -0
  330. package/dist/commands/whoami.d.ts.map +1 -0
  331. package/dist/commands/whoami.js +13 -0
  332. package/dist/commands/whoami.js.map +1 -0
  333. package/dist/commands/xargs.d.ts.map +1 -0
  334. package/dist/commands/xargs.js +22 -0
  335. package/dist/commands/xargs.js.map +1 -0
  336. package/dist/index.d.ts.map +1 -0
  337. package/dist/index.js +10 -0
  338. package/dist/index.js.map +1 -0
  339. package/dist/modules/linuxRootfs.d.ts.map +1 -0
  340. package/dist/modules/linuxRootfs.js +620 -0
  341. package/dist/modules/linuxRootfs.js.map +1 -0
  342. package/dist/modules/neofetch.d.ts.map +1 -0
  343. package/dist/modules/neofetch.js +285 -0
  344. package/dist/modules/neofetch.js.map +1 -0
  345. package/dist/modules/shellInteractive.d.ts.map +1 -0
  346. package/dist/modules/shellInteractive.js +27 -0
  347. package/dist/modules/shellInteractive.js.map +1 -0
  348. package/dist/modules/shellRuntime.d.ts.map +1 -0
  349. package/dist/modules/shellRuntime.js +53 -0
  350. package/dist/modules/shellRuntime.js.map +1 -0
  351. package/dist/self-standalone.d.ts.map +1 -0
  352. package/dist/self-standalone.js +420 -0
  353. package/dist/self-standalone.js.map +1 -0
  354. package/dist/standalone-wo-sftp.d.ts.map +1 -0
  355. package/dist/standalone-wo-sftp.js +31 -0
  356. package/dist/standalone-wo-sftp.js.map +1 -0
  357. package/dist/standalone.d.ts.map +1 -0
  358. package/dist/standalone.js +40 -0
  359. package/dist/standalone.js.map +1 -0
  360. package/dist/types/commands.d.ts.map +1 -0
  361. package/dist/types/commands.js +1 -0
  362. package/dist/types/commands.js.map +1 -0
  363. package/dist/types/pipeline.d.ts.map +1 -0
  364. package/dist/types/pipeline.js +1 -0
  365. package/dist/types/pipeline.js.map +1 -0
  366. package/dist/types/streams.d.ts.map +1 -0
  367. package/dist/types/streams.js +1 -0
  368. package/dist/types/streams.js.map +1 -0
  369. package/dist/types/vfs.d.ts.map +1 -0
  370. package/dist/types/vfs.js +1 -0
  371. package/dist/types/vfs.js.map +1 -0
  372. package/dist/utils/expand.d.ts.map +1 -0
  373. package/dist/utils/expand.js +477 -0
  374. package/dist/utils/expand.js.map +1 -0
  375. package/dist/utils/perfLogger.d.ts.map +1 -0
  376. package/dist/utils/perfLogger.js +50 -0
  377. package/dist/utils/perfLogger.js.map +1 -0
  378. package/dist/utils/tokenize.d.ts.map +1 -0
  379. package/dist/utils/tokenize.js +115 -0
  380. package/dist/utils/tokenize.js.map +1 -0
  381. package/dist/utils/vfsDiff.d.ts.map +1 -0
  382. package/dist/utils/vfsDiff.js +178 -0
  383. package/dist/utils/vfsDiff.js.map +1 -0
  384. package/dist/web-api.d.ts.map +1 -0
  385. package/dist/web-api.js +47 -0
  386. package/dist/web-api.js.map +1 -0
  387. package/dist/web-full.d.ts.map +1 -0
  388. package/dist/web-full.js +9 -0
  389. package/dist/web-full.js.map +1 -0
  390. package/dist/web.d.ts.map +1 -0
  391. package/dist/web.js +774 -0
  392. package/dist/web.js.map +1 -0
  393. package/docs/.nojekyll +1 -0
  394. package/docs/assets/hierarchy.js +1 -0
  395. package/docs/assets/highlight.css +162 -0
  396. package/docs/assets/icons.js +18 -0
  397. package/docs/assets/icons.svg +1 -0
  398. package/docs/assets/main.js +60 -0
  399. package/docs/assets/navigation.js +1 -0
  400. package/docs/assets/search.js +1 -0
  401. package/docs/assets/style.css +1633 -0
  402. package/docs/classes/HoneyPot.html +31 -0
  403. package/docs/classes/SshClient.html +66 -0
  404. package/docs/classes/VirtualFileSystem.html +262 -0
  405. package/docs/classes/VirtualPackageManager.html +63 -0
  406. package/docs/classes/VirtualSftpServer.html +169 -0
  407. package/docs/classes/VirtualShell.html +265 -0
  408. package/docs/classes/VirtualSshServer.html +177 -0
  409. package/docs/classes/VirtualUserManager.html +276 -0
  410. package/docs/functions/assertDiff.html +6 -0
  411. package/docs/functions/diffSnapshots.html +7 -0
  412. package/docs/functions/formatDiff.html +6 -0
  413. package/docs/functions/getArg.html +13 -0
  414. package/docs/functions/getFlag.html +15 -0
  415. package/docs/functions/ifFlag.html +11 -0
  416. package/docs/hierarchy.html +1 -0
  417. package/docs/index.html +1842 -0
  418. package/docs/interfaces/AuditLogEntry.html +6 -0
  419. package/docs/interfaces/CommandContext.html +22 -0
  420. package/docs/interfaces/CommandResult.html +26 -0
  421. package/docs/interfaces/ExecStream.html +11 -0
  422. package/docs/interfaces/HoneyPotStats.html +14 -0
  423. package/docs/interfaces/InstalledPackage.html +20 -0
  424. package/docs/interfaces/NanoEditorSession.html +8 -0
  425. package/docs/interfaces/PackageDefinition.html +30 -0
  426. package/docs/interfaces/PackageFile.html +8 -0
  427. package/docs/interfaces/RemoveOptions.html +4 -0
  428. package/docs/interfaces/ShellEnv.html +6 -0
  429. package/docs/interfaces/ShellModule.html +14 -0
  430. package/docs/interfaces/ShellProperties.html +14 -0
  431. package/docs/interfaces/ShellStream.html +11 -0
  432. package/docs/interfaces/SudoChallenge.html +24 -0
  433. package/docs/interfaces/VfsBaseNode.html +12 -0
  434. package/docs/interfaces/VfsDiff.html +10 -0
  435. package/docs/interfaces/VfsDiffEntry.html +6 -0
  436. package/docs/interfaces/VfsDiffModified.html +10 -0
  437. package/docs/interfaces/VfsDirectoryNode.html +15 -0
  438. package/docs/interfaces/VfsFileNode.html +17 -0
  439. package/docs/interfaces/VfsOptions.html +12 -0
  440. package/docs/interfaces/VfsSnapshot.html +3 -0
  441. package/docs/interfaces/VfsSnapshotBaseNode.html +8 -0
  442. package/docs/interfaces/VfsSnapshotDirectoryNode.html +10 -0
  443. package/docs/interfaces/VfsSnapshotFileNode.html +12 -0
  444. package/docs/interfaces/WriteFileOptions.html +6 -0
  445. package/docs/media/LICENSE +21 -0
  446. package/docs/modules.html +1 -0
  447. package/docs/types/CommandMode.html +2 -0
  448. package/docs/types/CommandOutcome.html +2 -0
  449. package/docs/types/VfsNodeStats.html +2 -0
  450. package/docs/types/VfsNodeType.html +2 -0
  451. package/docs/types/VfsPersistenceMode.html +5 -0
  452. package/docs/types/VfsSnapshotNode.html +2 -0
  453. package/examples/web.min.js +5 -5
  454. package/package.json +6 -4
  455. package/src/commands/man.ts +1 -1
  456. package/src/self-standalone.ts +1 -1
  457. package/src/standalone.ts +8 -3
  458. package/tsconfig.json +7 -2
  459. package/src/Honeypot/index.d.ts.map +0 -1
  460. package/src/Honeypot/index.js +0 -298
  461. package/src/SSHClient/index.d.ts.map +0 -1
  462. package/src/SSHClient/index.js +0 -237
  463. package/src/SSHMimic/exec.d.ts.map +0 -1
  464. package/src/SSHMimic/exec.js +0 -27
  465. package/src/SSHMimic/executor.d.ts.map +0 -1
  466. package/src/SSHMimic/executor.js +0 -160
  467. package/src/SSHMimic/hostKey.d.ts.map +0 -1
  468. package/src/SSHMimic/hostKey.js +0 -17
  469. package/src/SSHMimic/index.d.ts.map +0 -1
  470. package/src/SSHMimic/index.js +0 -249
  471. package/src/SSHMimic/loginBanner.d.ts.map +0 -1
  472. package/src/SSHMimic/loginBanner.js +0 -22
  473. package/src/SSHMimic/loginFormat.d.ts.map +0 -1
  474. package/src/SSHMimic/loginFormat.js +0 -10
  475. package/src/SSHMimic/prompt.d.ts.map +0 -1
  476. package/src/SSHMimic/prompt.js +0 -9
  477. package/src/SSHMimic/sftp.d.ts.map +0 -1
  478. package/src/SSHMimic/sftp.js +0 -619
  479. package/src/VirtualFileSystem/binaryPack.d.ts.map +0 -1
  480. package/src/VirtualFileSystem/binaryPack.js +0 -216
  481. package/src/VirtualFileSystem/index.d.ts.map +0 -1
  482. package/src/VirtualFileSystem/index.js +0 -689
  483. package/src/VirtualFileSystem/internalTypes.d.ts.map +0 -1
  484. package/src/VirtualFileSystem/internalTypes.js +0 -0
  485. package/src/VirtualFileSystem/path.d.ts.map +0 -1
  486. package/src/VirtualFileSystem/path.js +0 -49
  487. package/src/VirtualPackageManager/index.d.ts.map +0 -1
  488. package/src/VirtualPackageManager/index.js +0 -853
  489. package/src/VirtualShell/index.d.ts.map +0 -1
  490. package/src/VirtualShell/index.js +0 -284
  491. package/src/VirtualShell/shell.d.ts.map +0 -1
  492. package/src/VirtualShell/shell.js +0 -502
  493. package/src/VirtualShell/shellParser.d.ts.map +0 -1
  494. package/src/VirtualShell/shellParser.js +0 -265
  495. package/src/VirtualUserManager/index.d.ts.map +0 -1
  496. package/src/VirtualUserManager/index.js +0 -607
  497. package/src/commands/adduser.d.ts.map +0 -1
  498. package/src/commands/adduser.js +0 -89
  499. package/src/commands/alias.d.ts.map +0 -1
  500. package/src/commands/alias.js +0 -68
  501. package/src/commands/apt.d.ts.map +0 -1
  502. package/src/commands/apt.js +0 -210
  503. package/src/commands/awk.d.ts.map +0 -1
  504. package/src/commands/awk.js +0 -169
  505. package/src/commands/base64.d.ts.map +0 -1
  506. package/src/commands/base64.js +0 -28
  507. package/src/commands/cat.d.ts.map +0 -1
  508. package/src/commands/cat.js +0 -44
  509. package/src/commands/cd.d.ts.map +0 -1
  510. package/src/commands/cd.js +0 -21
  511. package/src/commands/chmod.d.ts.map +0 -1
  512. package/src/commands/chmod.js +0 -87
  513. package/src/commands/clear.d.ts.map +0 -1
  514. package/src/commands/clear.js +0 -13
  515. package/src/commands/command-helpers.d.ts.map +0 -1
  516. package/src/commands/command-helpers.js +0 -221
  517. package/src/commands/cp.d.ts.map +0 -1
  518. package/src/commands/cp.js +0 -75
  519. package/src/commands/curl.d.ts.map +0 -1
  520. package/src/commands/curl.js +0 -127
  521. package/src/commands/cut.d.ts.map +0 -1
  522. package/src/commands/cut.js +0 -34
  523. package/src/commands/date.d.ts.map +0 -1
  524. package/src/commands/date.js +0 -28
  525. package/src/commands/declare.d.ts.map +0 -1
  526. package/src/commands/declare.js +0 -44
  527. package/src/commands/deluser.d.ts.map +0 -1
  528. package/src/commands/deluser.js +0 -83
  529. package/src/commands/df.d.ts.map +0 -1
  530. package/src/commands/df.js +0 -21
  531. package/src/commands/diff.d.ts.map +0 -1
  532. package/src/commands/diff.js +0 -45
  533. package/src/commands/dpkg.d.ts.map +0 -1
  534. package/src/commands/dpkg.js +0 -161
  535. package/src/commands/du.d.ts.map +0 -1
  536. package/src/commands/du.js +0 -50
  537. package/src/commands/echo.d.ts.map +0 -1
  538. package/src/commands/echo.js +0 -45
  539. package/src/commands/env.d.ts.map +0 -1
  540. package/src/commands/env.js +0 -20
  541. package/src/commands/exit.d.ts.map +0 -1
  542. package/src/commands/exit.js +0 -16
  543. package/src/commands/export.d.ts.map +0 -1
  544. package/src/commands/export.js +0 -33
  545. package/src/commands/find.d.ts.map +0 -1
  546. package/src/commands/find.js +0 -55
  547. package/src/commands/free.d.ts.map +0 -1
  548. package/src/commands/free.js +0 -43
  549. package/src/commands/grep.d.ts.map +0 -1
  550. package/src/commands/grep.js +0 -120
  551. package/src/commands/groups.d.ts.map +0 -1
  552. package/src/commands/groups.js +0 -17
  553. package/src/commands/gzip.d.ts.map +0 -1
  554. package/src/commands/gzip.js +0 -82
  555. package/src/commands/head.d.ts.map +0 -1
  556. package/src/commands/head.js +0 -46
  557. package/src/commands/help.d.ts.map +0 -1
  558. package/src/commands/help.js +0 -123
  559. package/src/commands/helpers.d.ts.map +0 -1
  560. package/src/commands/helpers.js +0 -166
  561. package/src/commands/history.d.ts.map +0 -1
  562. package/src/commands/history.js +0 -26
  563. package/src/commands/hostname.d.ts.map +0 -1
  564. package/src/commands/hostname.js +0 -12
  565. package/src/commands/htop.d.ts.map +0 -1
  566. package/src/commands/htop.js +0 -17
  567. package/src/commands/id.d.ts.map +0 -1
  568. package/src/commands/id.js +0 -17
  569. package/src/commands/index.d.ts.map +0 -1
  570. package/src/commands/index.js +0 -2
  571. package/src/commands/kill.d.ts.map +0 -1
  572. package/src/commands/kill.js +0 -18
  573. package/src/commands/ln.d.ts.map +0 -1
  574. package/src/commands/ln.js +0 -66
  575. package/src/commands/ls.d.ts.map +0 -1
  576. package/src/commands/ls.js +0 -200
  577. package/src/commands/lsb-release.d.ts.map +0 -1
  578. package/src/commands/lsb-release.js +0 -61
  579. package/src/commands/man.d.ts.map +0 -1
  580. package/src/commands/man.js +0 -49
  581. package/src/commands/mkdir.d.ts.map +0 -1
  582. package/src/commands/mkdir.js +0 -28
  583. package/src/commands/mv.d.ts.map +0 -1
  584. package/src/commands/mv.js +0 -42
  585. package/src/commands/nano.d.ts.map +0 -1
  586. package/src/commands/nano.js +0 -34
  587. package/src/commands/neofetch.d.ts.map +0 -1
  588. package/src/commands/neofetch.js +0 -48
  589. package/src/commands/node.d.ts.map +0 -1
  590. package/src/commands/node.js +0 -316
  591. package/src/commands/npm.d.ts.map +0 -1
  592. package/src/commands/npm.js +0 -109
  593. package/src/commands/passwd.d.ts.map +0 -1
  594. package/src/commands/passwd.js +0 -44
  595. package/src/commands/ping.d.ts.map +0 -1
  596. package/src/commands/ping.js +0 -28
  597. package/src/commands/printf.d.ts.map +0 -1
  598. package/src/commands/printf.js +0 -144
  599. package/src/commands/ps.d.ts.map +0 -1
  600. package/src/commands/ps.js +0 -46
  601. package/src/commands/pwd.d.ts.map +0 -1
  602. package/src/commands/pwd.js +0 -7
  603. package/src/commands/python.d.ts.map +0 -1
  604. package/src/commands/python.js +0 -2058
  605. package/src/commands/read.d.ts.map +0 -1
  606. package/src/commands/read.js +0 -39
  607. package/src/commands/registry.d.ts.map +0 -1
  608. package/src/commands/registry.js +0 -234
  609. package/src/commands/rm.d.ts.map +0 -1
  610. package/src/commands/rm.js +0 -36
  611. package/src/commands/runtime.d.ts.map +0 -1
  612. package/src/commands/runtime.js +0 -285
  613. package/src/commands/sed.d.ts.map +0 -1
  614. package/src/commands/sed.js +0 -60
  615. package/src/commands/seq.d.ts.map +0 -1
  616. package/src/commands/seq.js +0 -50
  617. package/src/commands/set.d.ts.map +0 -1
  618. package/src/commands/set.js +0 -26
  619. package/src/commands/sh.d.ts.map +0 -1
  620. package/src/commands/sh.js +0 -431
  621. package/src/commands/shift.d.ts.map +0 -1
  622. package/src/commands/shift.js +0 -62
  623. package/src/commands/sleep.d.ts.map +0 -1
  624. package/src/commands/sleep.js +0 -18
  625. package/src/commands/sort.d.ts.map +0 -1
  626. package/src/commands/sort.js +0 -44
  627. package/src/commands/source.d.ts.map +0 -1
  628. package/src/commands/source.js +0 -39
  629. package/src/commands/stat.d.ts.map +0 -1
  630. package/src/commands/stat.js +0 -56
  631. package/src/commands/su.d.ts.map +0 -1
  632. package/src/commands/su.js +0 -57
  633. package/src/commands/sudo.d.ts.map +0 -1
  634. package/src/commands/sudo.js +0 -54
  635. package/src/commands/tail.d.ts.map +0 -1
  636. package/src/commands/tail.js +0 -47
  637. package/src/commands/tar.d.ts.map +0 -1
  638. package/src/commands/tar.js +0 -102
  639. package/src/commands/tee.d.ts.map +0 -1
  640. package/src/commands/tee.js +0 -36
  641. package/src/commands/test.d.ts.map +0 -1
  642. package/src/commands/test.js +0 -114
  643. package/src/commands/touch.d.ts.map +0 -1
  644. package/src/commands/touch.js +0 -25
  645. package/src/commands/tr.d.ts.map +0 -1
  646. package/src/commands/tr.js +0 -61
  647. package/src/commands/tree.d.ts.map +0 -1
  648. package/src/commands/tree.js +0 -18
  649. package/src/commands/true.d.ts.map +0 -1
  650. package/src/commands/true.js +0 -24
  651. package/src/commands/type.d.ts.map +0 -1
  652. package/src/commands/type.js +0 -39
  653. package/src/commands/uname.d.ts.map +0 -1
  654. package/src/commands/uname.js +0 -29
  655. package/src/commands/uniq.d.ts.map +0 -1
  656. package/src/commands/uniq.js +0 -38
  657. package/src/commands/unset.d.ts.map +0 -1
  658. package/src/commands/unset.js +0 -16
  659. package/src/commands/uptime.d.ts.map +0 -1
  660. package/src/commands/uptime.js +0 -48
  661. package/src/commands/wc.d.ts.map +0 -1
  662. package/src/commands/wc.js +0 -55
  663. package/src/commands/wget.d.ts.map +0 -1
  664. package/src/commands/wget.js +0 -126
  665. package/src/commands/which.d.ts.map +0 -1
  666. package/src/commands/which.js +0 -32
  667. package/src/commands/who.d.ts.map +0 -1
  668. package/src/commands/who.js +0 -22
  669. package/src/commands/whoami.d.ts.map +0 -1
  670. package/src/commands/whoami.js +0 -12
  671. package/src/commands/xargs.d.ts.map +0 -1
  672. package/src/commands/xargs.js +0 -21
  673. package/src/index.d.ts.map +0 -1
  674. package/src/index.js +0 -9
  675. package/src/modules/linuxRootfs.d.ts.map +0 -1
  676. package/src/modules/linuxRootfs.js +0 -619
  677. package/src/modules/neofetch.d.ts.map +0 -1
  678. package/src/modules/neofetch.js +0 -284
  679. package/src/modules/shellInteractive.d.ts.map +0 -1
  680. package/src/modules/shellInteractive.js +0 -26
  681. package/src/modules/shellRuntime.d.ts.map +0 -1
  682. package/src/modules/shellRuntime.js +0 -52
  683. package/src/self-standalone.d.ts.map +0 -1
  684. package/src/self-standalone.js +0 -418
  685. package/src/standalone-wo-sftp.d.ts.map +0 -1
  686. package/src/standalone-wo-sftp.js +0 -30
  687. package/src/standalone.d.ts.map +0 -1
  688. package/src/standalone.js +0 -35
  689. package/src/types/commands.d.ts.map +0 -1
  690. package/src/types/commands.js +0 -0
  691. package/src/types/pipeline.d.ts.map +0 -1
  692. package/src/types/pipeline.js +0 -0
  693. package/src/types/streams.d.ts.map +0 -1
  694. package/src/types/streams.js +0 -0
  695. package/src/types/vfs.d.ts.map +0 -1
  696. package/src/types/vfs.js +0 -0
  697. package/src/utils/expand.d.ts.map +0 -1
  698. package/src/utils/expand.js +0 -476
  699. package/src/utils/perfLogger.d.ts.map +0 -1
  700. package/src/utils/perfLogger.js +0 -49
  701. package/src/utils/tokenize.d.ts.map +0 -1
  702. package/src/utils/tokenize.js +0 -114
  703. package/src/utils/vfsDiff.d.ts.map +0 -1
  704. package/src/utils/vfsDiff.js +0 -177
  705. package/src/web-api.d.ts.map +0 -1
  706. package/src/web-api.js +0 -46
  707. package/src/web-full.d.ts.map +0 -1
  708. package/src/web-full.js +0 -8
  709. package/src/web.d.ts.map +0 -1
  710. package/src/web.js +0 -773
  711. package/tests/command-helpers.test.d.ts +0 -2
  712. package/tests/command-helpers.test.d.ts.map +0 -1
  713. package/tests/command-helpers.test.js +0 -92
  714. package/tests/commands-admin-net.test.d.ts +0 -2
  715. package/tests/commands-admin-net.test.d.ts.map +0 -1
  716. package/tests/commands-admin-net.test.js +0 -353
  717. package/tests/commands-advanced.test.d.ts +0 -2
  718. package/tests/commands-advanced.test.d.ts.map +0 -1
  719. package/tests/commands-advanced.test.js +0 -378
  720. package/tests/commands-core.test.d.ts +0 -2
  721. package/tests/commands-core.test.d.ts.map +0 -1
  722. package/tests/commands-core.test.js +0 -477
  723. package/tests/commands-missing.test.d.ts +0 -2
  724. package/tests/commands-missing.test.d.ts.map +0 -1
  725. package/tests/commands-missing.test.js +0 -470
  726. package/tests/commands-specific-units.test.d.ts +0 -2
  727. package/tests/commands-specific-units.test.d.ts.map +0 -1
  728. package/tests/commands-specific-units.test.js +0 -264
  729. package/tests/commands-text-sys.test.d.ts +0 -2
  730. package/tests/commands-text-sys.test.d.ts.map +0 -1
  731. package/tests/commands-text-sys.test.js +0 -366
  732. package/tests/expand.test.d.ts +0 -2
  733. package/tests/expand.test.d.ts.map +0 -1
  734. package/tests/expand.test.js +0 -138
  735. package/tests/helpers.test.d.ts +0 -2
  736. package/tests/helpers.test.d.ts.map +0 -1
  737. package/tests/helpers.test.js +0 -52
  738. package/tests/new-features.test.d.ts +0 -2
  739. package/tests/new-features.test.d.ts.map +0 -1
  740. package/tests/new-features.test.js +0 -850
  741. package/tests/parser-executor.test.d.ts +0 -2
  742. package/tests/parser-executor.test.d.ts.map +0 -1
  743. package/tests/parser-executor.test.js +0 -25
  744. package/tests/sftp.test.d.ts +0 -2
  745. package/tests/sftp.test.d.ts.map +0 -1
  746. package/tests/sftp.test.js +0 -246
  747. package/tests/ssh-exec.test.d.ts +0 -2
  748. package/tests/ssh-exec.test.d.ts.map +0 -1
  749. package/tests/ssh-exec.test.js +0 -39
  750. package/tests/test-helper.d.ts +0 -56
  751. package/tests/test-helper.d.ts.map +0 -1
  752. package/tests/test-helper.js +0 -71
  753. package/tests/users.test.d.ts +0 -2
  754. package/tests/users.test.d.ts.map +0 -1
  755. package/tests/users.test.js +0 -71
  756. package/tests/web.test.d.ts +0 -2
  757. package/tests/web.test.d.ts.map +0 -1
  758. package/tests/web.test.js +0 -149
  759. /package/{src → dist}/Honeypot/index.d.ts +0 -0
  760. /package/{src → dist}/SSHClient/index.d.ts +0 -0
  761. /package/{src → dist}/SSHMimic/exec.d.ts +0 -0
  762. /package/{src → dist}/SSHMimic/executor.d.ts +0 -0
  763. /package/{src → dist}/SSHMimic/hostKey.d.ts +0 -0
  764. /package/{src → dist}/SSHMimic/index.d.ts +0 -0
  765. /package/{src → dist}/SSHMimic/loginBanner.d.ts +0 -0
  766. /package/{src → dist}/SSHMimic/loginFormat.d.ts +0 -0
  767. /package/{src → dist}/SSHMimic/prompt.d.ts +0 -0
  768. /package/{src → dist}/SSHMimic/sftp.d.ts +0 -0
  769. /package/{src → dist}/VirtualFileSystem/binaryPack.d.ts +0 -0
  770. /package/{src → dist}/VirtualFileSystem/index.d.ts +0 -0
  771. /package/{src → dist}/VirtualFileSystem/internalTypes.d.ts +0 -0
  772. /package/{src → dist}/VirtualFileSystem/path.d.ts +0 -0
  773. /package/{src → dist}/VirtualPackageManager/index.d.ts +0 -0
  774. /package/{src → dist}/VirtualShell/index.d.ts +0 -0
  775. /package/{src → dist}/VirtualShell/shell.d.ts +0 -0
  776. /package/{src → dist}/VirtualShell/shellParser.d.ts +0 -0
  777. /package/{src → dist}/VirtualUserManager/index.d.ts +0 -0
  778. /package/{src → dist}/commands/adduser.d.ts +0 -0
  779. /package/{src → dist}/commands/alias.d.ts +0 -0
  780. /package/{src → dist}/commands/apt.d.ts +0 -0
  781. /package/{src → dist}/commands/awk.d.ts +0 -0
  782. /package/{src → dist}/commands/base64.d.ts +0 -0
  783. /package/{src → dist}/commands/cat.d.ts +0 -0
  784. /package/{src → dist}/commands/cd.d.ts +0 -0
  785. /package/{src → dist}/commands/chmod.d.ts +0 -0
  786. /package/{src → dist}/commands/clear.d.ts +0 -0
  787. /package/{src → dist}/commands/command-helpers.d.ts +0 -0
  788. /package/{src → dist}/commands/cp.d.ts +0 -0
  789. /package/{src → dist}/commands/curl.d.ts +0 -0
  790. /package/{src → dist}/commands/cut.d.ts +0 -0
  791. /package/{src → dist}/commands/date.d.ts +0 -0
  792. /package/{src → dist}/commands/declare.d.ts +0 -0
  793. /package/{src → dist}/commands/deluser.d.ts +0 -0
  794. /package/{src → dist}/commands/df.d.ts +0 -0
  795. /package/{src → dist}/commands/diff.d.ts +0 -0
  796. /package/{src → dist}/commands/dpkg.d.ts +0 -0
  797. /package/{src → dist}/commands/du.d.ts +0 -0
  798. /package/{src → dist}/commands/echo.d.ts +0 -0
  799. /package/{src → dist}/commands/env.d.ts +0 -0
  800. /package/{src → dist}/commands/exit.d.ts +0 -0
  801. /package/{src → dist}/commands/export.d.ts +0 -0
  802. /package/{src → dist}/commands/find.d.ts +0 -0
  803. /package/{src → dist}/commands/free.d.ts +0 -0
  804. /package/{src → dist}/commands/grep.d.ts +0 -0
  805. /package/{src → dist}/commands/groups.d.ts +0 -0
  806. /package/{src → dist}/commands/gzip.d.ts +0 -0
  807. /package/{src → dist}/commands/head.d.ts +0 -0
  808. /package/{src → dist}/commands/help.d.ts +0 -0
  809. /package/{src → dist}/commands/helpers.d.ts +0 -0
  810. /package/{src → dist}/commands/history.d.ts +0 -0
  811. /package/{src → dist}/commands/hostname.d.ts +0 -0
  812. /package/{src → dist}/commands/htop.d.ts +0 -0
  813. /package/{src → dist}/commands/id.d.ts +0 -0
  814. /package/{src → dist}/commands/index.d.ts +0 -0
  815. /package/{src → dist}/commands/kill.d.ts +0 -0
  816. /package/{src → dist}/commands/ln.d.ts +0 -0
  817. /package/{src → dist}/commands/ls.d.ts +0 -0
  818. /package/{src → dist}/commands/lsb-release.d.ts +0 -0
  819. /package/{src → dist}/commands/man.d.ts +0 -0
  820. /package/{src → dist}/commands/mkdir.d.ts +0 -0
  821. /package/{src → dist}/commands/mv.d.ts +0 -0
  822. /package/{src → dist}/commands/nano.d.ts +0 -0
  823. /package/{src → dist}/commands/neofetch.d.ts +0 -0
  824. /package/{src → dist}/commands/node.d.ts +0 -0
  825. /package/{src → dist}/commands/npm.d.ts +0 -0
  826. /package/{src → dist}/commands/passwd.d.ts +0 -0
  827. /package/{src → dist}/commands/ping.d.ts +0 -0
  828. /package/{src → dist}/commands/printf.d.ts +0 -0
  829. /package/{src → dist}/commands/ps.d.ts +0 -0
  830. /package/{src → dist}/commands/pwd.d.ts +0 -0
  831. /package/{src → dist}/commands/python.d.ts +0 -0
  832. /package/{src → dist}/commands/read.d.ts +0 -0
  833. /package/{src → dist}/commands/registry.d.ts +0 -0
  834. /package/{src → dist}/commands/rm.d.ts +0 -0
  835. /package/{src → dist}/commands/runtime.d.ts +0 -0
  836. /package/{src → dist}/commands/sed.d.ts +0 -0
  837. /package/{src → dist}/commands/seq.d.ts +0 -0
  838. /package/{src → dist}/commands/set.d.ts +0 -0
  839. /package/{src → dist}/commands/sh.d.ts +0 -0
  840. /package/{src → dist}/commands/shift.d.ts +0 -0
  841. /package/{src → dist}/commands/sleep.d.ts +0 -0
  842. /package/{src → dist}/commands/sort.d.ts +0 -0
  843. /package/{src → dist}/commands/source.d.ts +0 -0
  844. /package/{src → dist}/commands/stat.d.ts +0 -0
  845. /package/{src → dist}/commands/su.d.ts +0 -0
  846. /package/{src → dist}/commands/sudo.d.ts +0 -0
  847. /package/{src → dist}/commands/tail.d.ts +0 -0
  848. /package/{src → dist}/commands/tar.d.ts +0 -0
  849. /package/{src → dist}/commands/tee.d.ts +0 -0
  850. /package/{src → dist}/commands/test.d.ts +0 -0
  851. /package/{src → dist}/commands/touch.d.ts +0 -0
  852. /package/{src → dist}/commands/tr.d.ts +0 -0
  853. /package/{src → dist}/commands/tree.d.ts +0 -0
  854. /package/{src → dist}/commands/true.d.ts +0 -0
  855. /package/{src → dist}/commands/type.d.ts +0 -0
  856. /package/{src → dist}/commands/uname.d.ts +0 -0
  857. /package/{src → dist}/commands/uniq.d.ts +0 -0
  858. /package/{src → dist}/commands/unset.d.ts +0 -0
  859. /package/{src → dist}/commands/uptime.d.ts +0 -0
  860. /package/{src → dist}/commands/wc.d.ts +0 -0
  861. /package/{src → dist}/commands/wget.d.ts +0 -0
  862. /package/{src → dist}/commands/which.d.ts +0 -0
  863. /package/{src → dist}/commands/who.d.ts +0 -0
  864. /package/{src → dist}/commands/whoami.d.ts +0 -0
  865. /package/{src → dist}/commands/xargs.d.ts +0 -0
  866. /package/{src → dist}/index.d.ts +0 -0
  867. /package/{src → dist}/modules/linuxRootfs.d.ts +0 -0
  868. /package/{src → dist}/modules/neofetch.d.ts +0 -0
  869. /package/{src → dist}/modules/shellInteractive.d.ts +0 -0
  870. /package/{src → dist}/modules/shellRuntime.d.ts +0 -0
  871. /package/{src → dist}/self-standalone.d.ts +0 -0
  872. /package/{src → dist}/standalone-wo-sftp.d.ts +0 -0
  873. /package/{src → dist}/standalone.d.ts +0 -0
  874. /package/{src → dist}/types/commands.d.ts +0 -0
  875. /package/{src → dist}/types/pipeline.d.ts +0 -0
  876. /package/{src → dist}/types/streams.d.ts +0 -0
  877. /package/{src → dist}/types/vfs.d.ts +0 -0
  878. /package/{src → dist}/utils/expand.d.ts +0 -0
  879. /package/{src → dist}/utils/perfLogger.d.ts +0 -0
  880. /package/{src → dist}/utils/tokenize.d.ts +0 -0
  881. /package/{src → dist}/utils/vfsDiff.d.ts +0 -0
  882. /package/{src → dist}/web-api.d.ts +0 -0
  883. /package/{src → dist}/web-full.d.ts +0 -0
  884. /package/{src → dist}/web.d.ts +0 -0
@@ -1,50 +0,0 @@
1
- /** Generate sequences of numbers. seq LAST / seq FIRST LAST / seq FIRST INCREMENT LAST */
2
- export const seqCommand = {
3
- name: "seq",
4
- description: "Print a sequence of numbers",
5
- category: "text",
6
- params: ["[FIRST [INCREMENT]] LAST"],
7
- run: ({ args }) => {
8
- const nums = args.filter((a) => !a.startsWith("-") || /^-[\d.]/.test(a)).map(Number);
9
- const sep = (() => { const i = args.indexOf("-s"); return i !== -1 ? (args[i + 1] ?? "\n") : "\n"; })();
10
- const fmt = (() => { const i = args.indexOf("-f"); return i !== -1 ? (args[i + 1] ?? "%g") : null; })();
11
- const width = args.includes("-w");
12
- let first = 1, inc = 1, last;
13
- if (nums.length === 1) {
14
- last = nums[0];
15
- }
16
- else if (nums.length === 2) {
17
- first = nums[0];
18
- last = nums[1];
19
- }
20
- else {
21
- first = nums[0];
22
- inc = nums[1];
23
- last = nums[2];
24
- }
25
- if (inc === 0)
26
- return { stderr: "seq: zero increment\n", exitCode: 1 };
27
- if ((inc > 0 && first > last) || (inc < 0 && first < last))
28
- return { stdout: "", exitCode: 0 };
29
- const results = [];
30
- const maxSteps = 100000;
31
- let steps = 0;
32
- for (let n = first; inc > 0 ? n <= last : n >= last; n = Math.round((n + inc) * 1e10) / 1e10) {
33
- if (++steps > maxSteps)
34
- break;
35
- let s;
36
- if (fmt) {
37
- s = fmt.replace("%g", String(n)).replace("%f", n.toFixed(6)).replace("%d", String(Math.trunc(n)));
38
- }
39
- else {
40
- s = Number.isInteger(n) ? String(n) : n.toPrecision(12).replace(/\.?0+$/, "");
41
- }
42
- if (width) {
43
- const maxLen = String(Math.trunc(last)).length;
44
- s = s.padStart(maxLen, "0");
45
- }
46
- results.push(s);
47
- }
48
- return { stdout: `${results.join(sep)}\n`, exitCode: 0 };
49
- },
50
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["set.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WAoBxB,CAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Display or set shell variables and options.
3
- * @category shell
4
- * @params ["[VAR=value]"]
5
- */
6
- export const setCommand = {
7
- name: "set",
8
- description: "Display or set shell variables",
9
- category: "shell",
10
- params: ["[VAR=value]"],
11
- run: ({ args, env }) => {
12
- if (args.length === 0) {
13
- const out = Object.entries(env.vars)
14
- .map(([k, v]) => `${k}=${v}`)
15
- .join("\n");
16
- return { stdout: out, exitCode: 0 };
17
- }
18
- for (const arg of args) {
19
- if (arg.includes("=")) {
20
- const eq = arg.indexOf("=");
21
- env.vars[arg.slice(0, eq)] = arg.slice(eq + 1);
22
- }
23
- }
24
- return { exitCode: 0 };
25
- },
26
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"sh.d.ts","sourceRoot":"","sources":["sh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGX,WAAW,EACX,MAAM,mBAAmB,CAAC;AAwa3B,eAAO,MAAM,SAAS,EAAE,WAsCvB,CAAC"}
@@ -1,431 +0,0 @@
1
- import { evalArith, expandAsync, expandBraces } from "../utils/expand";
2
- import { ifFlag } from "./command-helpers";
3
- import { resolvePath } from "./helpers";
4
- import { runCommand } from "./runtime";
5
- /**
6
- * Expand all shell forms including $(cmd) substitution.
7
- * Delegates to centralised expandAsync (single-quote-aware, depth-tracked).
8
- */
9
- async function expandVars(line, env, lastExit, ctx) {
10
- return expandAsync(line, env, lastExit, (sub) => runCommand(sub, ctx.authUser, ctx.hostname, ctx.mode, ctx.cwd, ctx.shell, undefined, ctx.env).then((r) => r.stdout ?? ""));
11
- }
12
- /** Very small shell interpreter: supports if/elif/else/fi, for/do/done, while/do/done */
13
- function parseBlocks(lines) {
14
- const blocks = [];
15
- let i = 0;
16
- while (i < lines.length) {
17
- const line = lines[i].trim();
18
- if (!line || line.startsWith("#")) {
19
- i++;
20
- continue;
21
- }
22
- // Function definition: name() { or function name { or name() { body }
23
- const funcMatchInline = line.match(/^(?:function\s+)?(\w+)\s*\(\s*\)\s*\{(.+)\}\s*$/);
24
- const funcMatch = funcMatchInline ?? (line.match(/^(?:function\s+)?(\w+)\s*\(\s*\)\s*\{?\s*$/) ||
25
- line.match(/^function\s+(\w+)\s*\{?\s*$/));
26
- if (funcMatch) {
27
- const funcName = funcMatch[1];
28
- const body = [];
29
- // Inline: name() { cmd; } — single-line form
30
- if (funcMatchInline) {
31
- body.push(...funcMatchInline[2].split(";").map((s) => s.trim()).filter(Boolean));
32
- blocks.push({ type: "func", name: funcName, body });
33
- i++;
34
- continue;
35
- }
36
- i++;
37
- while (i < lines.length && lines[i]?.trim() !== "}" && i < lines.length + 1) {
38
- const l = lines[i].trim().replace(/^do\s+/, "");
39
- if (l && l !== "{")
40
- body.push(l);
41
- i++;
42
- }
43
- i++; // skip closing }
44
- blocks.push({ type: "func", name: funcName, body });
45
- continue;
46
- }
47
- // (( expr )) arithmetic statement
48
- const arithMatch = line.match(/^\(\(\s*(.+?)\s*\)\)$/);
49
- if (arithMatch) {
50
- blocks.push({ type: "arith", expr: arithMatch[1] });
51
- i++;
52
- continue;
53
- }
54
- if (line.startsWith("if ") || line === "if") {
55
- const cond = line
56
- .replace(/^if\s+/, "")
57
- .replace(/;\s*then\s*$/, "")
58
- .trim();
59
- const thenLines = [];
60
- const elifBlocks = [];
61
- const elseLines = [];
62
- let section = "then";
63
- let elifCond = "";
64
- i++;
65
- while (i < lines.length && lines[i]?.trim() !== "fi") {
66
- const l = lines[i].trim();
67
- if (l.startsWith("elif ")) {
68
- section = "elif";
69
- elifCond = l
70
- .replace(/^elif\s+/, "")
71
- .replace(/;\s*then\s*$/, "")
72
- .trim();
73
- elifBlocks.push({ cond: elifCond, body: [] });
74
- }
75
- else if (l === "else") {
76
- section = "else";
77
- }
78
- else if (l !== "then") {
79
- if (section === "then")
80
- thenLines.push(l);
81
- else if (section === "elif" && elifBlocks.length > 0)
82
- elifBlocks[elifBlocks.length - 1].body.push(l);
83
- else
84
- elseLines.push(l);
85
- }
86
- i++;
87
- }
88
- blocks.push({
89
- type: "if",
90
- cond,
91
- then_: thenLines,
92
- elif: elifBlocks,
93
- else_: elseLines,
94
- });
95
- }
96
- else if (line.startsWith("for ")) {
97
- const m = line.match(/^for\s+(\w+)\s+in\s+(.+?)(?:\s*;\s*do)?$/);
98
- if (m) {
99
- const body = [];
100
- i++;
101
- while (i < lines.length && lines[i]?.trim() !== "done") {
102
- const l = lines[i].trim().replace(/^do\s+/, "");
103
- if (l && l !== "do")
104
- body.push(l);
105
- i++;
106
- }
107
- blocks.push({ type: "for", var: m[1], list: m[2], body });
108
- }
109
- else {
110
- blocks.push({ type: "cmd", line });
111
- }
112
- }
113
- else if (line.startsWith("while ")) {
114
- const cond = line
115
- .replace(/^while\s+/, "")
116
- .replace(/;\s*do\s*$/, "")
117
- .trim();
118
- const body = [];
119
- i++;
120
- while (i < lines.length && lines[i]?.trim() !== "done") {
121
- const l = lines[i].trim().replace(/^do\s+/, "");
122
- if (l && l !== "do")
123
- body.push(l);
124
- i++;
125
- }
126
- blocks.push({ type: "while", cond, body });
127
- }
128
- else {
129
- blocks.push({ type: "cmd", line });
130
- }
131
- i++;
132
- }
133
- return blocks;
134
- }
135
- async function evalCondition(cond, ctx) {
136
- const expanded = await expandVars(cond, ctx.env.vars, ctx.env.lastExitCode, ctx);
137
- // test -f / test -d / [ ... ]
138
- const testMatch = expanded.match(/^\[?\s*(.+?)\s*\]?$/);
139
- if (testMatch) {
140
- const expr = testMatch[1];
141
- // -f file
142
- const fTest = expr.match(/^-([fdeznr])\s+(.+)$/);
143
- if (fTest) {
144
- const [, flag, arg] = fTest;
145
- const p = resolvePath(ctx.cwd, arg);
146
- if (flag === "f")
147
- return ctx.shell.vfs.exists(p) && ctx.shell.vfs.stat(p).type === "file";
148
- if (flag === "d")
149
- return (ctx.shell.vfs.exists(p) && ctx.shell.vfs.stat(p).type === "directory");
150
- if (flag === "e")
151
- return ctx.shell.vfs.exists(p);
152
- if (flag === "z")
153
- return (arg ?? "").length === 0;
154
- if (flag === "n")
155
- return (arg ?? "").length > 0;
156
- }
157
- // string comparison
158
- const cmpMatch = expr.match(/^"?([^"]*)"?\s*(==|!=|=|<|>)\s*"?([^"]*)"?$/);
159
- if (cmpMatch) {
160
- const [, a, op, b] = cmpMatch;
161
- if (op === "==" || op === "=")
162
- return a === b;
163
- if (op === "!=")
164
- return a !== b;
165
- }
166
- // numeric
167
- const numMatch = expr.match(/^(\S+)\s+(-eq|-ne|-lt|-le|-gt|-ge)\s+(\S+)$/);
168
- if (numMatch) {
169
- const [, a, op, b] = numMatch;
170
- const na = Number(a), nb = Number(b);
171
- if (op === "-eq")
172
- return na === nb;
173
- if (op === "-ne")
174
- return na !== nb;
175
- if (op === "-lt")
176
- return na < nb;
177
- if (op === "-le")
178
- return na <= nb;
179
- if (op === "-gt")
180
- return na > nb;
181
- if (op === "-ge")
182
- return na >= nb;
183
- }
184
- }
185
- // fallback: run command and check exit code
186
- const r = await runCommand(expanded, ctx.authUser, ctx.hostname, ctx.mode, ctx.cwd, ctx.shell, undefined, ctx.env);
187
- return (r.exitCode ?? 0) === 0;
188
- }
189
- async function runBlocks(blocks, ctx) {
190
- let lastResult = { exitCode: 0 };
191
- let output = "";
192
- for (const block of blocks) {
193
- if (block.type === "cmd") {
194
- const expanded = await expandVars(block.line, ctx.env.vars, ctx.env.lastExitCode, ctx);
195
- // Bare VAR=val assignment(s) — handle before dispatching to runCommand
196
- const assignRe = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)/;
197
- const tokens = expanded.trim().split(/\s+/);
198
- if (tokens.length > 0 && assignRe.test(tokens[0])) {
199
- const allAssign = tokens.every((t) => assignRe.test(t));
200
- if (allAssign) {
201
- for (const tok of tokens) {
202
- const m = tok.match(assignRe);
203
- ctx.env.vars[m[1]] = m[2];
204
- }
205
- ctx.env.lastExitCode = 0;
206
- continue;
207
- }
208
- }
209
- const r = await (async () => {
210
- // Check if expanded matches a registered function
211
- const cmdName = expanded.trim().split(/\s+/)[0] ?? "";
212
- const funcBody = ctx.env.vars[`__func_${cmdName}`];
213
- if (funcBody) {
214
- // Set positional params $1 $2 ... from remaining args
215
- const funcArgs = expanded.trim().split(/\s+/).slice(1);
216
- const savedVars = { ...ctx.env.vars };
217
- funcArgs.forEach((a, i) => { ctx.env.vars[String(i + 1)] = a; });
218
- ctx.env.vars["0"] = cmdName;
219
- const funcLines = funcBody.split("\n");
220
- const funcResult = await runBlocks(parseBlocks(funcLines), ctx);
221
- // Restore positional params
222
- for (let pi = 1; pi <= funcArgs.length; pi++)
223
- delete ctx.env.vars[String(pi)];
224
- Object.assign(ctx.env.vars, { ...savedVars, ...ctx.env.vars });
225
- return funcResult;
226
- }
227
- return runCommand(expanded, ctx.authUser, ctx.hostname, ctx.mode, ctx.cwd, ctx.shell, undefined, ctx.env);
228
- })();
229
- ctx.env.lastExitCode = r.exitCode ?? 0;
230
- if (r.stdout)
231
- output += `${r.stdout}\n`;
232
- if (r.stderr)
233
- return { ...r, stdout: output.trim() };
234
- lastResult = r;
235
- }
236
- else if (block.type === "if") {
237
- let ran = false;
238
- if (await evalCondition(block.cond, ctx)) {
239
- const sub = await runBlocks(parseBlocks(block.then_), ctx);
240
- if (sub.stdout)
241
- output += `${sub.stdout}\n`;
242
- ran = true;
243
- }
244
- else {
245
- for (const elif of block.elif) {
246
- if (await evalCondition(elif.cond, ctx)) {
247
- const sub = await runBlocks(parseBlocks(elif.body), ctx);
248
- if (sub.stdout)
249
- output += `${sub.stdout}\n`;
250
- ran = true;
251
- break;
252
- }
253
- }
254
- if (!ran && block.else_.length > 0) {
255
- const sub = await runBlocks(parseBlocks(block.else_), ctx);
256
- if (sub.stdout)
257
- output += `${sub.stdout}\n`;
258
- }
259
- }
260
- }
261
- else if (block.type === "func") {
262
- // Register function in env vars as __func_<name>=<body>
263
- ctx.env.vars[`__func_${block.name}`] = block.body.join("\n");
264
- }
265
- else if (block.type === "arith") {
266
- // (( expr )) — evaluate arithmetic, update vars
267
- const expr = block.expr.trim();
268
- // Handle i++ / i-- / i+=N / i-=N
269
- const incMatch = expr.match(/^(\w+)\s*(\+\+|--)$/);
270
- if (incMatch) {
271
- const val = parseInt(ctx.env.vars[incMatch[1]] ?? "0", 10);
272
- ctx.env.vars[incMatch[1]] = String(incMatch[2] === "++" ? val + 1 : val - 1);
273
- }
274
- else {
275
- const assignMatch = expr.match(/^(\w+)\s*([+\-*/])=\s*(.+)$/);
276
- if (assignMatch) {
277
- const lhs = parseInt(ctx.env.vars[assignMatch[1]] ?? "0", 10);
278
- const rhs = parseInt(assignMatch[3], 10);
279
- const ops = { "+": lhs + rhs, "-": lhs - rhs, "*": lhs * rhs, "/": Math.floor(lhs / rhs) };
280
- ctx.env.vars[assignMatch[1]] = String(ops[assignMatch[2]] ?? lhs);
281
- }
282
- else {
283
- const value = evalArith(expr, ctx.env.vars);
284
- if (!Number.isNaN(value)) {
285
- ctx.env.lastExitCode = value === 0 ? 1 : 0;
286
- }
287
- }
288
- }
289
- }
290
- else if (block.type === "for") {
291
- const listExpanded = await expandVars(block.list, ctx.env.vars, ctx.env.lastExitCode, ctx);
292
- // Apply brace expansion to each token in the list
293
- const items = listExpanded.trim().split(/\s+/).flatMap(expandBraces);
294
- for (const item of items) {
295
- ctx.env.vars[block.var] = item;
296
- const sub = await runBlocks(parseBlocks(block.body), ctx);
297
- if (sub.stdout)
298
- output += `${sub.stdout}\n`;
299
- if (sub.closeSession)
300
- return sub;
301
- }
302
- }
303
- else if (block.type === "while") {
304
- let iterations = 0;
305
- while (iterations < 1000 && (await evalCondition(block.cond, ctx))) {
306
- const sub = await runBlocks(parseBlocks(block.body), ctx);
307
- if (sub.stdout)
308
- output += `${sub.stdout}\n`;
309
- if (sub.closeSession)
310
- return sub;
311
- iterations++;
312
- }
313
- }
314
- }
315
- return { ...lastResult, stdout: output.trim() || lastResult.stdout };
316
- }
317
- /**
318
- * Execute shell scripts or commands with a minimal shell interpreter.
319
- * Supports if/elif/else, for loops, while loops, and variable expansion.
320
- * @category shell
321
- * @params ["-c <script>", "[<file>]"]
322
- */
323
- /**
324
- * Split a sh script into logical lines, respecting:
325
- * - `{...}` braces (function bodies)
326
- * - Newlines and semicolons at depth 0 only
327
- */
328
- function splitShScript(script) {
329
- const lines = [];
330
- let current = "";
331
- let depth = 0;
332
- let inSingleQ = false;
333
- let inDoubleQ = false;
334
- let i = 0;
335
- while (i < script.length) {
336
- const ch = script[i];
337
- if (!inSingleQ && !inDoubleQ) {
338
- if (ch === "'") {
339
- inSingleQ = true;
340
- current += ch;
341
- i++;
342
- continue;
343
- }
344
- if (ch === '"') {
345
- inDoubleQ = true;
346
- current += ch;
347
- i++;
348
- continue;
349
- }
350
- if (ch === "{") {
351
- depth++;
352
- current += ch;
353
- i++;
354
- continue;
355
- }
356
- if (ch === "}") {
357
- depth--;
358
- current += ch;
359
- i++;
360
- // At depth 0, closing } ends the function body line
361
- if (depth === 0) {
362
- const t = current.trim();
363
- if (t)
364
- lines.push(t);
365
- current = "";
366
- // Skip trailing ; or whitespace
367
- while (i < script.length && (script[i] === ";" || script[i] === " "))
368
- i++;
369
- }
370
- continue;
371
- }
372
- if (depth === 0 && (ch === ";" || ch === "\n")) {
373
- const t = current.trim();
374
- if (t && !t.startsWith("#"))
375
- lines.push(t);
376
- current = "";
377
- i++;
378
- continue;
379
- }
380
- }
381
- else if (inSingleQ && ch === "'") {
382
- inSingleQ = false;
383
- }
384
- else if (inDoubleQ && ch === '"') {
385
- inDoubleQ = false;
386
- }
387
- current += ch;
388
- i++;
389
- }
390
- const t = current.trim();
391
- if (t && !t.startsWith("#"))
392
- lines.push(t);
393
- return lines;
394
- }
395
- export const shCommand = {
396
- name: "sh",
397
- aliases: ["bash"],
398
- description: "Execute shell script or command",
399
- category: "shell",
400
- params: ["-c <script>", "[<file>]"],
401
- run: async (ctx) => {
402
- const { args, shell, cwd } = ctx;
403
- // sh -c "inline script"
404
- if (ifFlag(args, "-c")) {
405
- const script = args[args.indexOf("-c") + 1] ?? "";
406
- if (!script)
407
- return { stderr: "sh: -c requires a script", exitCode: 1 };
408
- const lines = splitShScript(script);
409
- const blocks = parseBlocks(lines);
410
- return runBlocks(blocks, ctx);
411
- }
412
- // sh <file>
413
- const fileArg = args[0];
414
- if (fileArg) {
415
- const p = resolvePath(cwd, fileArg);
416
- if (!shell.vfs.exists(p))
417
- return {
418
- stderr: `sh: ${fileArg}: No such file or directory`,
419
- exitCode: 1,
420
- };
421
- const content = shell.vfs.readFile(p);
422
- const lines = splitShScript(content);
423
- const blocks = parseBlocks(lines);
424
- return runBlocks(blocks, ctx);
425
- }
426
- return {
427
- stderr: "sh: invalid usage. Use: sh -c 'cmd' or sh <file>",
428
- exitCode: 1,
429
- };
430
- },
431
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"shift.d.ts","sourceRoot":"","sources":["shift.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAoB1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAezB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAW3B,CAAC"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Shift positional parameters (remove first N arguments).
3
- * @category shell
4
- * @params ["[n]"]
5
- */
6
- export const shiftCommand = {
7
- name: "shift",
8
- description: "Shift positional parameters",
9
- category: "shell",
10
- params: ["[n]"],
11
- // shift is meaningful only inside sh scripts where positional params exist.
12
- // In the current impl, positional params ($1 $2 …) aren't tracked in env by default.
13
- // We store them under env.vars.__argv and shift there if present.
14
- run: ({ args, env }) => {
15
- if (!env)
16
- return { exitCode: 0 };
17
- const n = parseInt(args[0] ?? "1", 10) || 1;
18
- const argv = env.vars.__argv?.split("\x00").filter(Boolean) ?? [];
19
- env.vars.__argv = argv.slice(n).join("\x00");
20
- // Update $1 $2 … in env
21
- const shifted = argv.slice(n);
22
- for (let i = 1; i <= 9; i++) {
23
- env.vars[String(i)] = shifted[i - 1] ?? "";
24
- }
25
- return { exitCode: 0 };
26
- },
27
- };
28
- /**
29
- * Trap signals and execute actions on signal receipt or shell exit.
30
- * @category shell
31
- * @params ["[action] [signal...]"]
32
- */
33
- export const trapCommand = {
34
- name: "trap",
35
- description: "Trap signals and events",
36
- category: "shell",
37
- params: ["[action] [signal...]"],
38
- // Store trap handlers in env for EXIT signal support
39
- run: ({ args, env }) => {
40
- if (!env || args.length === 0)
41
- return { exitCode: 0 };
42
- const action = args[0] ?? "";
43
- const signals = args.slice(1);
44
- for (const sig of signals) {
45
- env.vars[`__trap_${sig.toUpperCase()}`] = action;
46
- }
47
- return { exitCode: 0 };
48
- },
49
- };
50
- export const returnCommand = {
51
- name: "return",
52
- description: "Return from a shell function",
53
- category: "shell",
54
- params: ["[n]"],
55
- run: ({ args, env }) => {
56
- const code = parseInt(args[0] ?? "0", 10);
57
- if (env)
58
- env.lastExitCode = code;
59
- // Signal the caller via exitCode; function return is handled by runBlocks
60
- return { exitCode: code };
61
- },
62
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["sleep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAY1B,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Delay execution for a specified number of seconds.
3
- * @category system
4
- * @params ["<seconds>"]
5
- */
6
- export const sleepCommand = {
7
- name: "sleep",
8
- description: "Delay execution",
9
- category: "system",
10
- params: ["<seconds>"],
11
- run: async ({ args }) => {
12
- const secs = parseFloat(args[0] ?? "1");
13
- if (Number.isNaN(secs) || secs < 0)
14
- return { stderr: "sleep: invalid time", exitCode: 1 };
15
- await new Promise((r) => setTimeout(r, secs * 1000));
16
- return { exitCode: 0 };
17
- },
18
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAoCzB,CAAC"}
@@ -1,44 +0,0 @@
1
- import { ifFlag } from "./command-helpers";
2
- import { assertPathAccess, resolvePath } from "./helpers";
3
- /**
4
- * Sort lines of text with various options (reverse, numeric, unique).
5
- * @category text
6
- * @params ["[-r] [-n] [-u] [-k <col>] [file...]"]
7
- */
8
- export const sortCommand = {
9
- name: "sort",
10
- description: "Sort lines of text",
11
- category: "text",
12
- params: ["[-r] [-n] [-u] [-k <col>] [file...]"],
13
- run: ({ authUser, shell, cwd, args, stdin }) => {
14
- const reverse = ifFlag(args, ["-r"]);
15
- const numeric = ifFlag(args, ["-n"]);
16
- const unique = ifFlag(args, ["-u"]);
17
- const files = args.filter((a) => !a.startsWith("-"));
18
- const getContent = () => {
19
- if (files.length > 0) {
20
- return files
21
- .map((f) => {
22
- try {
23
- assertPathAccess(authUser, resolvePath(cwd, f), "sort");
24
- return shell.vfs.readFile(resolvePath(cwd, f));
25
- }
26
- catch {
27
- return "";
28
- }
29
- })
30
- .join("\n");
31
- }
32
- return stdin ?? "";
33
- };
34
- const lines = getContent().split("\n").filter(Boolean);
35
- const sorted = [...lines].sort((a, b) => {
36
- if (numeric)
37
- return Number(a) - Number(b);
38
- return a.localeCompare(b);
39
- });
40
- const result = reverse ? sorted.reverse() : sorted;
41
- const out = unique ? [...new Set(result)] : result;
42
- return { stdout: out.join("\n"), exitCode: 0 };
43
- },
44
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,WA0C3B,CAAC"}