typescript-virtual-container 1.4.4 → 1.4.5
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.
- package/builds/self-standalone.js +321 -272
- package/builds/self-standalone.js.map +4 -4
- package/builds/standalone-wo-sftp.js +261 -212
- package/builds/standalone-wo-sftp.js.map +4 -4
- package/builds/standalone.js +265 -216
- package/builds/standalone.js.map +4 -4
- package/builds/web-full-api.min.js +5 -5
- package/builds/web-full-api.min.js.map +3 -3
- package/builds/web.min.js +5 -5
- package/builds/web.min.js.map +3 -3
- package/bun.lock +97 -0
- package/dist/Honeypot/index.d.ts.map +1 -0
- package/dist/Honeypot/index.js +299 -0
- package/dist/Honeypot/index.js.map +1 -0
- package/dist/SSHClient/index.d.ts.map +1 -0
- package/dist/SSHClient/index.js +238 -0
- package/dist/SSHClient/index.js.map +1 -0
- package/dist/SSHMimic/exec.d.ts.map +1 -0
- package/dist/SSHMimic/exec.js +28 -0
- package/dist/SSHMimic/exec.js.map +1 -0
- package/dist/SSHMimic/executor.d.ts.map +1 -0
- package/dist/SSHMimic/executor.js +161 -0
- package/dist/SSHMimic/executor.js.map +1 -0
- package/dist/SSHMimic/hostKey.d.ts.map +1 -0
- package/dist/SSHMimic/hostKey.js +18 -0
- package/dist/SSHMimic/hostKey.js.map +1 -0
- package/dist/SSHMimic/index.d.ts.map +1 -0
- package/dist/SSHMimic/index.js +250 -0
- package/dist/SSHMimic/index.js.map +1 -0
- package/dist/SSHMimic/loginBanner.d.ts.map +1 -0
- package/dist/SSHMimic/loginBanner.js +23 -0
- package/dist/SSHMimic/loginBanner.js.map +1 -0
- package/dist/SSHMimic/loginFormat.d.ts.map +1 -0
- package/dist/SSHMimic/loginFormat.js +11 -0
- package/dist/SSHMimic/loginFormat.js.map +1 -0
- package/dist/SSHMimic/prompt.d.ts.map +1 -0
- package/dist/SSHMimic/prompt.js +10 -0
- package/dist/SSHMimic/prompt.js.map +1 -0
- package/dist/SSHMimic/sftp.d.ts.map +1 -0
- package/dist/SSHMimic/sftp.js +620 -0
- package/dist/SSHMimic/sftp.js.map +1 -0
- package/dist/VirtualFileSystem/binaryPack.d.ts.map +1 -0
- package/dist/VirtualFileSystem/binaryPack.js +217 -0
- package/dist/VirtualFileSystem/binaryPack.js.map +1 -0
- package/dist/VirtualFileSystem/index.d.ts.map +1 -0
- package/dist/VirtualFileSystem/index.js +690 -0
- package/dist/VirtualFileSystem/index.js.map +1 -0
- package/dist/VirtualFileSystem/internalTypes.d.ts.map +1 -0
- package/dist/VirtualFileSystem/internalTypes.js +1 -0
- package/dist/VirtualFileSystem/internalTypes.js.map +1 -0
- package/dist/VirtualFileSystem/path.d.ts.map +1 -0
- package/dist/VirtualFileSystem/path.js +50 -0
- package/dist/VirtualFileSystem/path.js.map +1 -0
- package/dist/VirtualPackageManager/index.d.ts.map +1 -0
- package/dist/VirtualPackageManager/index.js +854 -0
- package/dist/VirtualPackageManager/index.js.map +1 -0
- package/dist/VirtualShell/index.d.ts.map +1 -0
- package/dist/VirtualShell/index.js +285 -0
- package/dist/VirtualShell/index.js.map +1 -0
- package/dist/VirtualShell/shell.d.ts.map +1 -0
- package/dist/VirtualShell/shell.js +503 -0
- package/dist/VirtualShell/shell.js.map +1 -0
- package/dist/VirtualShell/shellParser.d.ts.map +1 -0
- package/dist/VirtualShell/shellParser.js +266 -0
- package/dist/VirtualShell/shellParser.js.map +1 -0
- package/dist/VirtualUserManager/index.d.ts.map +1 -0
- package/dist/VirtualUserManager/index.js +608 -0
- package/dist/VirtualUserManager/index.js.map +1 -0
- package/dist/commands/adduser.d.ts.map +1 -0
- package/dist/commands/adduser.js +90 -0
- package/dist/commands/adduser.js.map +1 -0
- package/dist/commands/alias.d.ts.map +1 -0
- package/dist/commands/alias.js +69 -0
- package/dist/commands/alias.js.map +1 -0
- package/dist/commands/apt.d.ts.map +1 -0
- package/dist/commands/apt.js +211 -0
- package/dist/commands/apt.js.map +1 -0
- package/dist/commands/awk.d.ts.map +1 -0
- package/dist/commands/awk.js +170 -0
- package/dist/commands/awk.js.map +1 -0
- package/dist/commands/base64.d.ts.map +1 -0
- package/dist/commands/base64.js +29 -0
- package/dist/commands/base64.js.map +1 -0
- package/dist/commands/cat.d.ts.map +1 -0
- package/dist/commands/cat.js +45 -0
- package/dist/commands/cat.js.map +1 -0
- package/dist/commands/cd.d.ts.map +1 -0
- package/dist/commands/cd.js +22 -0
- package/dist/commands/cd.js.map +1 -0
- package/dist/commands/chmod.d.ts.map +1 -0
- package/dist/commands/chmod.js +88 -0
- package/dist/commands/chmod.js.map +1 -0
- package/dist/commands/clear.d.ts.map +1 -0
- package/dist/commands/clear.js +14 -0
- package/dist/commands/clear.js.map +1 -0
- package/dist/commands/command-helpers.d.ts.map +1 -0
- package/dist/commands/command-helpers.js +222 -0
- package/dist/commands/command-helpers.js.map +1 -0
- package/dist/commands/cp.d.ts.map +1 -0
- package/dist/commands/cp.js +76 -0
- package/dist/commands/cp.js.map +1 -0
- package/dist/commands/curl.d.ts.map +1 -0
- package/dist/commands/curl.js +128 -0
- package/dist/commands/curl.js.map +1 -0
- package/dist/commands/cut.d.ts.map +1 -0
- package/dist/commands/cut.js +35 -0
- package/dist/commands/cut.js.map +1 -0
- package/dist/commands/date.d.ts.map +1 -0
- package/dist/commands/date.js +29 -0
- package/dist/commands/date.js.map +1 -0
- package/dist/commands/declare.d.ts.map +1 -0
- package/dist/commands/declare.js +45 -0
- package/dist/commands/declare.js.map +1 -0
- package/dist/commands/deluser.d.ts.map +1 -0
- package/dist/commands/deluser.js +84 -0
- package/dist/commands/deluser.js.map +1 -0
- package/dist/commands/df.d.ts.map +1 -0
- package/dist/commands/df.js +22 -0
- package/dist/commands/df.js.map +1 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +46 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/dpkg.d.ts.map +1 -0
- package/dist/commands/dpkg.js +162 -0
- package/dist/commands/dpkg.js.map +1 -0
- package/dist/commands/du.d.ts.map +1 -0
- package/dist/commands/du.js +51 -0
- package/dist/commands/du.js.map +1 -0
- package/dist/commands/echo.d.ts.map +1 -0
- package/dist/commands/echo.js +46 -0
- package/dist/commands/echo.js.map +1 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +21 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/exit.d.ts.map +1 -0
- package/dist/commands/exit.js +17 -0
- package/dist/commands/exit.js.map +1 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +34 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/find.d.ts.map +1 -0
- package/dist/commands/find.js +56 -0
- package/dist/commands/find.js.map +1 -0
- package/dist/commands/free.d.ts.map +1 -0
- package/dist/commands/free.js +44 -0
- package/dist/commands/free.js.map +1 -0
- package/dist/commands/grep.d.ts.map +1 -0
- package/dist/commands/grep.js +121 -0
- package/dist/commands/grep.js.map +1 -0
- package/dist/commands/groups.d.ts.map +1 -0
- package/dist/commands/groups.js +18 -0
- package/dist/commands/groups.js.map +1 -0
- package/dist/commands/gzip.d.ts.map +1 -0
- package/dist/commands/gzip.js +83 -0
- package/dist/commands/gzip.js.map +1 -0
- package/dist/commands/head.d.ts.map +1 -0
- package/dist/commands/head.js +47 -0
- package/dist/commands/head.js.map +1 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +124 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/helpers.d.ts.map +1 -0
- package/dist/commands/helpers.js +167 -0
- package/dist/commands/helpers.js.map +1 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +27 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/hostname.d.ts.map +1 -0
- package/dist/commands/hostname.js +13 -0
- package/dist/commands/hostname.js.map +1 -0
- package/dist/commands/htop.d.ts.map +1 -0
- package/dist/commands/htop.js +18 -0
- package/dist/commands/htop.js.map +1 -0
- package/dist/commands/id.d.ts.map +1 -0
- package/dist/commands/id.js +18 -0
- package/dist/commands/id.js.map +1 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +3 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/kill.d.ts.map +1 -0
- package/dist/commands/kill.js +19 -0
- package/dist/commands/kill.js.map +1 -0
- package/dist/commands/ln.d.ts.map +1 -0
- package/dist/commands/ln.js +67 -0
- package/dist/commands/ln.js.map +1 -0
- package/dist/commands/ls.d.ts.map +1 -0
- package/dist/commands/ls.js +201 -0
- package/dist/commands/ls.js.map +1 -0
- package/dist/commands/lsb-release.d.ts.map +1 -0
- package/dist/commands/lsb-release.js +62 -0
- package/dist/commands/lsb-release.js.map +1 -0
- package/dist/commands/man.d.ts.map +1 -0
- package/dist/commands/man.js +50 -0
- package/dist/commands/man.js.map +1 -0
- package/dist/commands/mkdir.d.ts.map +1 -0
- package/dist/commands/mkdir.js +29 -0
- package/dist/commands/mkdir.js.map +1 -0
- package/dist/commands/mv.d.ts.map +1 -0
- package/dist/commands/mv.js +43 -0
- package/dist/commands/mv.js.map +1 -0
- package/dist/commands/nano.d.ts.map +1 -0
- package/dist/commands/nano.js +35 -0
- package/dist/commands/nano.js.map +1 -0
- package/dist/commands/neofetch.d.ts.map +1 -0
- package/dist/commands/neofetch.js +49 -0
- package/dist/commands/neofetch.js.map +1 -0
- package/dist/commands/node.d.ts.map +1 -0
- package/dist/commands/node.js +317 -0
- package/dist/commands/node.js.map +1 -0
- package/dist/commands/npm.d.ts.map +1 -0
- package/dist/commands/npm.js +110 -0
- package/dist/commands/npm.js.map +1 -0
- package/dist/commands/passwd.d.ts.map +1 -0
- package/dist/commands/passwd.js +45 -0
- package/dist/commands/passwd.js.map +1 -0
- package/dist/commands/ping.d.ts.map +1 -0
- package/dist/commands/ping.js +29 -0
- package/dist/commands/ping.js.map +1 -0
- package/dist/commands/printf.d.ts.map +1 -0
- package/dist/commands/printf.js +145 -0
- package/dist/commands/printf.js.map +1 -0
- package/dist/commands/ps.d.ts.map +1 -0
- package/dist/commands/ps.js +47 -0
- package/dist/commands/ps.js.map +1 -0
- package/dist/commands/pwd.d.ts.map +1 -0
- package/dist/commands/pwd.js +8 -0
- package/dist/commands/pwd.js.map +1 -0
- package/dist/commands/python.d.ts.map +1 -0
- package/dist/commands/python.js +2059 -0
- package/dist/commands/python.js.map +1 -0
- package/dist/commands/read.d.ts.map +1 -0
- package/dist/commands/read.js +40 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +235 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/rm.d.ts.map +1 -0
- package/dist/commands/rm.js +37 -0
- package/dist/commands/rm.js.map +1 -0
- package/dist/commands/runtime.d.ts.map +1 -0
- package/dist/commands/runtime.js +286 -0
- package/dist/commands/runtime.js.map +1 -0
- package/dist/commands/sed.d.ts.map +1 -0
- package/dist/commands/sed.js +61 -0
- package/dist/commands/sed.js.map +1 -0
- package/dist/commands/seq.d.ts.map +1 -0
- package/dist/commands/seq.js +51 -0
- package/dist/commands/seq.js.map +1 -0
- package/dist/commands/set.d.ts.map +1 -0
- package/dist/commands/set.js +27 -0
- package/dist/commands/set.js.map +1 -0
- package/dist/commands/sh.d.ts.map +1 -0
- package/dist/commands/sh.js +432 -0
- package/dist/commands/sh.js.map +1 -0
- package/dist/commands/shift.d.ts.map +1 -0
- package/dist/commands/shift.js +63 -0
- package/dist/commands/shift.js.map +1 -0
- package/dist/commands/sleep.d.ts.map +1 -0
- package/dist/commands/sleep.js +19 -0
- package/dist/commands/sleep.js.map +1 -0
- package/dist/commands/sort.d.ts.map +1 -0
- package/dist/commands/sort.js +45 -0
- package/dist/commands/sort.js.map +1 -0
- package/dist/commands/source.d.ts.map +1 -0
- package/dist/commands/source.js +40 -0
- package/dist/commands/source.js.map +1 -0
- package/dist/commands/stat.d.ts.map +1 -0
- package/dist/commands/stat.js +57 -0
- package/dist/commands/stat.js.map +1 -0
- package/dist/commands/su.d.ts.map +1 -0
- package/dist/commands/su.js +58 -0
- package/dist/commands/su.js.map +1 -0
- package/dist/commands/sudo.d.ts.map +1 -0
- package/dist/commands/sudo.js +55 -0
- package/dist/commands/sudo.js.map +1 -0
- package/dist/commands/tail.d.ts.map +1 -0
- package/dist/commands/tail.js +48 -0
- package/dist/commands/tail.js.map +1 -0
- package/dist/commands/tar.d.ts.map +1 -0
- package/dist/commands/tar.js +103 -0
- package/dist/commands/tar.js.map +1 -0
- package/dist/commands/tee.d.ts.map +1 -0
- package/dist/commands/tee.js +37 -0
- package/dist/commands/tee.js.map +1 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +115 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/touch.d.ts.map +1 -0
- package/dist/commands/touch.js +26 -0
- package/dist/commands/touch.js.map +1 -0
- package/dist/commands/tr.d.ts.map +1 -0
- package/dist/commands/tr.js +62 -0
- package/dist/commands/tr.js.map +1 -0
- package/dist/commands/tree.d.ts.map +1 -0
- package/dist/commands/tree.js +19 -0
- package/dist/commands/tree.js.map +1 -0
- package/dist/commands/true.d.ts.map +1 -0
- package/dist/commands/true.js +25 -0
- package/dist/commands/true.js.map +1 -0
- package/dist/commands/type.d.ts.map +1 -0
- package/dist/commands/type.js +40 -0
- package/dist/commands/type.js.map +1 -0
- package/dist/commands/uname.d.ts.map +1 -0
- package/dist/commands/uname.js +30 -0
- package/dist/commands/uname.js.map +1 -0
- package/dist/commands/uniq.d.ts.map +1 -0
- package/dist/commands/uniq.js +39 -0
- package/dist/commands/uniq.js.map +1 -0
- package/dist/commands/unset.d.ts.map +1 -0
- package/dist/commands/unset.js +17 -0
- package/dist/commands/unset.js.map +1 -0
- package/dist/commands/uptime.d.ts.map +1 -0
- package/dist/commands/uptime.js +49 -0
- package/dist/commands/uptime.js.map +1 -0
- package/dist/commands/wc.d.ts.map +1 -0
- package/dist/commands/wc.js +56 -0
- package/dist/commands/wc.js.map +1 -0
- package/dist/commands/wget.d.ts.map +1 -0
- package/dist/commands/wget.js +127 -0
- package/dist/commands/wget.js.map +1 -0
- package/dist/commands/which.d.ts.map +1 -0
- package/dist/commands/which.js +33 -0
- package/dist/commands/which.js.map +1 -0
- package/dist/commands/who.d.ts.map +1 -0
- package/dist/commands/who.js +23 -0
- package/dist/commands/who.js.map +1 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +13 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/xargs.d.ts.map +1 -0
- package/dist/commands/xargs.js +22 -0
- package/dist/commands/xargs.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/linuxRootfs.d.ts.map +1 -0
- package/dist/modules/linuxRootfs.js +620 -0
- package/dist/modules/linuxRootfs.js.map +1 -0
- package/dist/modules/neofetch.d.ts.map +1 -0
- package/dist/modules/neofetch.js +285 -0
- package/dist/modules/neofetch.js.map +1 -0
- package/dist/modules/shellInteractive.d.ts.map +1 -0
- package/dist/modules/shellInteractive.js +27 -0
- package/dist/modules/shellInteractive.js.map +1 -0
- package/dist/modules/shellRuntime.d.ts.map +1 -0
- package/dist/modules/shellRuntime.js +53 -0
- package/dist/modules/shellRuntime.js.map +1 -0
- package/dist/self-standalone.d.ts.map +1 -0
- package/dist/self-standalone.js +419 -0
- package/dist/self-standalone.js.map +1 -0
- package/dist/standalone-wo-sftp.d.ts.map +1 -0
- package/dist/standalone-wo-sftp.js +31 -0
- package/dist/standalone-wo-sftp.js.map +1 -0
- package/dist/standalone.d.ts.map +1 -0
- package/dist/standalone.js +36 -0
- package/dist/standalone.js.map +1 -0
- package/dist/types/commands.d.ts.map +1 -0
- package/dist/types/commands.js +1 -0
- package/dist/types/commands.js.map +1 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/pipeline.js +1 -0
- package/dist/types/pipeline.js.map +1 -0
- package/dist/types/streams.d.ts.map +1 -0
- package/dist/types/streams.js +1 -0
- package/dist/types/streams.js.map +1 -0
- package/dist/types/vfs.d.ts.map +1 -0
- package/dist/types/vfs.js +1 -0
- package/dist/types/vfs.js.map +1 -0
- package/dist/utils/expand.d.ts.map +1 -0
- package/dist/utils/expand.js +477 -0
- package/dist/utils/expand.js.map +1 -0
- package/dist/utils/perfLogger.d.ts.map +1 -0
- package/dist/utils/perfLogger.js +50 -0
- package/dist/utils/perfLogger.js.map +1 -0
- package/dist/utils/tokenize.d.ts.map +1 -0
- package/dist/utils/tokenize.js +115 -0
- package/dist/utils/tokenize.js.map +1 -0
- package/dist/utils/vfsDiff.d.ts.map +1 -0
- package/dist/utils/vfsDiff.js +178 -0
- package/dist/utils/vfsDiff.js.map +1 -0
- package/dist/web-api.d.ts.map +1 -0
- package/dist/web-api.js +47 -0
- package/dist/web-api.js.map +1 -0
- package/dist/web-full.d.ts.map +1 -0
- package/dist/web-full.js +9 -0
- package/dist/web-full.js.map +1 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +774 -0
- package/dist/web.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +162 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/HoneyPot.html +31 -0
- package/docs/classes/SshClient.html +66 -0
- package/docs/classes/VirtualFileSystem.html +262 -0
- package/docs/classes/VirtualPackageManager.html +63 -0
- package/docs/classes/VirtualSftpServer.html +169 -0
- package/docs/classes/VirtualShell.html +265 -0
- package/docs/classes/VirtualSshServer.html +177 -0
- package/docs/classes/VirtualUserManager.html +276 -0
- package/docs/docs/.nojekyll +1 -0
- package/docs/docs/assets/hierarchy.js +1 -0
- package/docs/docs/assets/highlight.css +162 -0
- package/docs/docs/assets/icons.js +18 -0
- package/docs/docs/assets/icons.svg +1 -0
- package/docs/docs/assets/main.js +60 -0
- package/docs/docs/assets/navigation.js +1 -0
- package/docs/docs/assets/search.js +1 -0
- package/docs/docs/assets/style.css +1633 -0
- package/docs/docs/hierarchy.html +1 -0
- package/docs/docs/index.html +1842 -0
- package/docs/docs/media/LICENSE +21 -0
- package/docs/docs/modules.html +1 -0
- package/docs/functions/assertDiff.html +6 -0
- package/docs/functions/diffSnapshots.html +7 -0
- package/docs/functions/formatDiff.html +6 -0
- package/docs/functions/getArg.html +13 -0
- package/docs/functions/getFlag.html +15 -0
- package/docs/functions/ifFlag.html +11 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +1842 -0
- package/docs/interfaces/AuditLogEntry.html +6 -0
- package/docs/interfaces/CommandContext.html +22 -0
- package/docs/interfaces/CommandResult.html +26 -0
- package/docs/interfaces/ExecStream.html +11 -0
- package/docs/interfaces/HoneyPotStats.html +14 -0
- package/docs/interfaces/InstalledPackage.html +20 -0
- package/docs/interfaces/NanoEditorSession.html +8 -0
- package/docs/interfaces/PackageDefinition.html +30 -0
- package/docs/interfaces/PackageFile.html +8 -0
- package/docs/interfaces/RemoveOptions.html +4 -0
- package/docs/interfaces/ShellEnv.html +6 -0
- package/docs/interfaces/ShellModule.html +14 -0
- package/docs/interfaces/ShellProperties.html +14 -0
- package/docs/interfaces/ShellStream.html +11 -0
- package/docs/interfaces/SudoChallenge.html +24 -0
- package/docs/interfaces/VfsBaseNode.html +12 -0
- package/docs/interfaces/VfsDiff.html +10 -0
- package/docs/interfaces/VfsDiffEntry.html +6 -0
- package/docs/interfaces/VfsDiffModified.html +10 -0
- package/docs/interfaces/VfsDirectoryNode.html +15 -0
- package/docs/interfaces/VfsFileNode.html +17 -0
- package/docs/interfaces/VfsOptions.html +12 -0
- package/docs/interfaces/VfsSnapshot.html +3 -0
- package/docs/interfaces/VfsSnapshotBaseNode.html +8 -0
- package/docs/interfaces/VfsSnapshotDirectoryNode.html +10 -0
- package/docs/interfaces/VfsSnapshotFileNode.html +12 -0
- package/docs/interfaces/WriteFileOptions.html +6 -0
- package/docs/media/LICENSE +21 -0
- package/docs/modules.html +1 -0
- package/docs/types/CommandMode.html +2 -0
- package/docs/types/CommandOutcome.html +2 -0
- package/docs/types/VfsNodeStats.html +2 -0
- package/docs/types/VfsNodeType.html +2 -0
- package/docs/types/VfsPersistenceMode.html +5 -0
- package/docs/types/VfsSnapshotNode.html +2 -0
- package/examples/web.min.js +5 -5
- package/package.json +4 -2
- package/tsconfig.json +7 -2
- package/typedoc.json +8 -0
- package/src/Honeypot/index.d.ts.map +0 -1
- package/src/Honeypot/index.js +0 -298
- package/src/SSHClient/index.d.ts.map +0 -1
- package/src/SSHClient/index.js +0 -237
- package/src/SSHMimic/exec.d.ts.map +0 -1
- package/src/SSHMimic/exec.js +0 -27
- package/src/SSHMimic/executor.d.ts.map +0 -1
- package/src/SSHMimic/executor.js +0 -160
- package/src/SSHMimic/hostKey.d.ts.map +0 -1
- package/src/SSHMimic/hostKey.js +0 -17
- package/src/SSHMimic/index.d.ts.map +0 -1
- package/src/SSHMimic/index.js +0 -249
- package/src/SSHMimic/loginBanner.d.ts.map +0 -1
- package/src/SSHMimic/loginBanner.js +0 -22
- package/src/SSHMimic/loginFormat.d.ts.map +0 -1
- package/src/SSHMimic/loginFormat.js +0 -10
- package/src/SSHMimic/prompt.d.ts.map +0 -1
- package/src/SSHMimic/prompt.js +0 -9
- package/src/SSHMimic/sftp.d.ts.map +0 -1
- package/src/SSHMimic/sftp.js +0 -619
- package/src/VirtualFileSystem/binaryPack.d.ts.map +0 -1
- package/src/VirtualFileSystem/binaryPack.js +0 -216
- package/src/VirtualFileSystem/index.d.ts.map +0 -1
- package/src/VirtualFileSystem/index.js +0 -689
- package/src/VirtualFileSystem/internalTypes.d.ts.map +0 -1
- package/src/VirtualFileSystem/internalTypes.js +0 -0
- package/src/VirtualFileSystem/path.d.ts.map +0 -1
- package/src/VirtualFileSystem/path.js +0 -49
- package/src/VirtualPackageManager/index.d.ts.map +0 -1
- package/src/VirtualPackageManager/index.js +0 -853
- package/src/VirtualShell/index.d.ts.map +0 -1
- package/src/VirtualShell/index.js +0 -284
- package/src/VirtualShell/shell.d.ts.map +0 -1
- package/src/VirtualShell/shell.js +0 -502
- package/src/VirtualShell/shellParser.d.ts.map +0 -1
- package/src/VirtualShell/shellParser.js +0 -265
- package/src/VirtualUserManager/index.d.ts.map +0 -1
- package/src/VirtualUserManager/index.js +0 -607
- package/src/commands/adduser.d.ts.map +0 -1
- package/src/commands/adduser.js +0 -89
- package/src/commands/alias.d.ts.map +0 -1
- package/src/commands/alias.js +0 -68
- package/src/commands/apt.d.ts.map +0 -1
- package/src/commands/apt.js +0 -210
- package/src/commands/awk.d.ts.map +0 -1
- package/src/commands/awk.js +0 -169
- package/src/commands/base64.d.ts.map +0 -1
- package/src/commands/base64.js +0 -28
- package/src/commands/cat.d.ts.map +0 -1
- package/src/commands/cat.js +0 -44
- package/src/commands/cd.d.ts.map +0 -1
- package/src/commands/cd.js +0 -21
- package/src/commands/chmod.d.ts.map +0 -1
- package/src/commands/chmod.js +0 -87
- package/src/commands/clear.d.ts.map +0 -1
- package/src/commands/clear.js +0 -13
- package/src/commands/command-helpers.d.ts.map +0 -1
- package/src/commands/command-helpers.js +0 -221
- package/src/commands/cp.d.ts.map +0 -1
- package/src/commands/cp.js +0 -75
- package/src/commands/curl.d.ts.map +0 -1
- package/src/commands/curl.js +0 -127
- package/src/commands/cut.d.ts.map +0 -1
- package/src/commands/cut.js +0 -34
- package/src/commands/date.d.ts.map +0 -1
- package/src/commands/date.js +0 -28
- package/src/commands/declare.d.ts.map +0 -1
- package/src/commands/declare.js +0 -44
- package/src/commands/deluser.d.ts.map +0 -1
- package/src/commands/deluser.js +0 -83
- package/src/commands/df.d.ts.map +0 -1
- package/src/commands/df.js +0 -21
- package/src/commands/diff.d.ts.map +0 -1
- package/src/commands/diff.js +0 -45
- package/src/commands/dpkg.d.ts.map +0 -1
- package/src/commands/dpkg.js +0 -161
- package/src/commands/du.d.ts.map +0 -1
- package/src/commands/du.js +0 -50
- package/src/commands/echo.d.ts.map +0 -1
- package/src/commands/echo.js +0 -45
- package/src/commands/env.d.ts.map +0 -1
- package/src/commands/env.js +0 -20
- package/src/commands/exit.d.ts.map +0 -1
- package/src/commands/exit.js +0 -16
- package/src/commands/export.d.ts.map +0 -1
- package/src/commands/export.js +0 -33
- package/src/commands/find.d.ts.map +0 -1
- package/src/commands/find.js +0 -55
- package/src/commands/free.d.ts.map +0 -1
- package/src/commands/free.js +0 -43
- package/src/commands/grep.d.ts.map +0 -1
- package/src/commands/grep.js +0 -120
- package/src/commands/groups.d.ts.map +0 -1
- package/src/commands/groups.js +0 -17
- package/src/commands/gzip.d.ts.map +0 -1
- package/src/commands/gzip.js +0 -82
- package/src/commands/head.d.ts.map +0 -1
- package/src/commands/head.js +0 -46
- package/src/commands/help.d.ts.map +0 -1
- package/src/commands/help.js +0 -123
- package/src/commands/helpers.d.ts.map +0 -1
- package/src/commands/helpers.js +0 -166
- package/src/commands/history.d.ts.map +0 -1
- package/src/commands/history.js +0 -26
- package/src/commands/hostname.d.ts.map +0 -1
- package/src/commands/hostname.js +0 -12
- package/src/commands/htop.d.ts.map +0 -1
- package/src/commands/htop.js +0 -17
- package/src/commands/id.d.ts.map +0 -1
- package/src/commands/id.js +0 -17
- package/src/commands/index.d.ts.map +0 -1
- package/src/commands/index.js +0 -2
- package/src/commands/kill.d.ts.map +0 -1
- package/src/commands/kill.js +0 -18
- package/src/commands/ln.d.ts.map +0 -1
- package/src/commands/ln.js +0 -66
- package/src/commands/ls.d.ts.map +0 -1
- package/src/commands/ls.js +0 -200
- package/src/commands/lsb-release.d.ts.map +0 -1
- package/src/commands/lsb-release.js +0 -61
- package/src/commands/man.d.ts.map +0 -1
- package/src/commands/man.js +0 -49
- package/src/commands/mkdir.d.ts.map +0 -1
- package/src/commands/mkdir.js +0 -28
- package/src/commands/mv.d.ts.map +0 -1
- package/src/commands/mv.js +0 -42
- package/src/commands/nano.d.ts.map +0 -1
- package/src/commands/nano.js +0 -34
- package/src/commands/neofetch.d.ts.map +0 -1
- package/src/commands/neofetch.js +0 -48
- package/src/commands/node.d.ts.map +0 -1
- package/src/commands/node.js +0 -316
- package/src/commands/npm.d.ts.map +0 -1
- package/src/commands/npm.js +0 -109
- package/src/commands/passwd.d.ts.map +0 -1
- package/src/commands/passwd.js +0 -44
- package/src/commands/ping.d.ts.map +0 -1
- package/src/commands/ping.js +0 -28
- package/src/commands/printf.d.ts.map +0 -1
- package/src/commands/printf.js +0 -144
- package/src/commands/ps.d.ts.map +0 -1
- package/src/commands/ps.js +0 -46
- package/src/commands/pwd.d.ts.map +0 -1
- package/src/commands/pwd.js +0 -7
- package/src/commands/python.d.ts.map +0 -1
- package/src/commands/python.js +0 -2058
- package/src/commands/read.d.ts.map +0 -1
- package/src/commands/read.js +0 -39
- package/src/commands/registry.d.ts.map +0 -1
- package/src/commands/registry.js +0 -234
- package/src/commands/rm.d.ts.map +0 -1
- package/src/commands/rm.js +0 -36
- package/src/commands/runtime.d.ts.map +0 -1
- package/src/commands/runtime.js +0 -285
- package/src/commands/sed.d.ts.map +0 -1
- package/src/commands/sed.js +0 -60
- package/src/commands/seq.d.ts.map +0 -1
- package/src/commands/seq.js +0 -50
- package/src/commands/set.d.ts.map +0 -1
- package/src/commands/set.js +0 -26
- package/src/commands/sh.d.ts.map +0 -1
- package/src/commands/sh.js +0 -431
- package/src/commands/shift.d.ts.map +0 -1
- package/src/commands/shift.js +0 -62
- package/src/commands/sleep.d.ts.map +0 -1
- package/src/commands/sleep.js +0 -18
- package/src/commands/sort.d.ts.map +0 -1
- package/src/commands/sort.js +0 -44
- package/src/commands/source.d.ts.map +0 -1
- package/src/commands/source.js +0 -39
- package/src/commands/stat.d.ts.map +0 -1
- package/src/commands/stat.js +0 -56
- package/src/commands/su.d.ts.map +0 -1
- package/src/commands/su.js +0 -57
- package/src/commands/sudo.d.ts.map +0 -1
- package/src/commands/sudo.js +0 -54
- package/src/commands/tail.d.ts.map +0 -1
- package/src/commands/tail.js +0 -47
- package/src/commands/tar.d.ts.map +0 -1
- package/src/commands/tar.js +0 -102
- package/src/commands/tee.d.ts.map +0 -1
- package/src/commands/tee.js +0 -36
- package/src/commands/test.d.ts.map +0 -1
- package/src/commands/test.js +0 -114
- package/src/commands/touch.d.ts.map +0 -1
- package/src/commands/touch.js +0 -25
- package/src/commands/tr.d.ts.map +0 -1
- package/src/commands/tr.js +0 -61
- package/src/commands/tree.d.ts.map +0 -1
- package/src/commands/tree.js +0 -18
- package/src/commands/true.d.ts.map +0 -1
- package/src/commands/true.js +0 -24
- package/src/commands/type.d.ts.map +0 -1
- package/src/commands/type.js +0 -39
- package/src/commands/uname.d.ts.map +0 -1
- package/src/commands/uname.js +0 -29
- package/src/commands/uniq.d.ts.map +0 -1
- package/src/commands/uniq.js +0 -38
- package/src/commands/unset.d.ts.map +0 -1
- package/src/commands/unset.js +0 -16
- package/src/commands/uptime.d.ts.map +0 -1
- package/src/commands/uptime.js +0 -48
- package/src/commands/wc.d.ts.map +0 -1
- package/src/commands/wc.js +0 -55
- package/src/commands/wget.d.ts.map +0 -1
- package/src/commands/wget.js +0 -126
- package/src/commands/which.d.ts.map +0 -1
- package/src/commands/which.js +0 -32
- package/src/commands/who.d.ts.map +0 -1
- package/src/commands/who.js +0 -22
- package/src/commands/whoami.d.ts.map +0 -1
- package/src/commands/whoami.js +0 -12
- package/src/commands/xargs.d.ts.map +0 -1
- package/src/commands/xargs.js +0 -21
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -9
- package/src/modules/linuxRootfs.d.ts.map +0 -1
- package/src/modules/linuxRootfs.js +0 -619
- package/src/modules/neofetch.d.ts.map +0 -1
- package/src/modules/neofetch.js +0 -284
- package/src/modules/shellInteractive.d.ts.map +0 -1
- package/src/modules/shellInteractive.js +0 -26
- package/src/modules/shellRuntime.d.ts.map +0 -1
- package/src/modules/shellRuntime.js +0 -52
- package/src/self-standalone.d.ts.map +0 -1
- package/src/self-standalone.js +0 -418
- package/src/standalone-wo-sftp.d.ts.map +0 -1
- package/src/standalone-wo-sftp.js +0 -30
- package/src/standalone.d.ts.map +0 -1
- package/src/standalone.js +0 -35
- package/src/types/commands.d.ts.map +0 -1
- package/src/types/commands.js +0 -0
- package/src/types/pipeline.d.ts.map +0 -1
- package/src/types/pipeline.js +0 -0
- package/src/types/streams.d.ts.map +0 -1
- package/src/types/streams.js +0 -0
- package/src/types/vfs.d.ts.map +0 -1
- package/src/types/vfs.js +0 -0
- package/src/utils/expand.d.ts.map +0 -1
- package/src/utils/expand.js +0 -476
- package/src/utils/perfLogger.d.ts.map +0 -1
- package/src/utils/perfLogger.js +0 -49
- package/src/utils/tokenize.d.ts.map +0 -1
- package/src/utils/tokenize.js +0 -114
- package/src/utils/vfsDiff.d.ts.map +0 -1
- package/src/utils/vfsDiff.js +0 -177
- package/src/web-api.d.ts.map +0 -1
- package/src/web-api.js +0 -46
- package/src/web-full.d.ts.map +0 -1
- package/src/web-full.js +0 -8
- package/src/web.d.ts.map +0 -1
- package/src/web.js +0 -773
- package/tests/command-helpers.test.d.ts +0 -2
- package/tests/command-helpers.test.d.ts.map +0 -1
- package/tests/command-helpers.test.js +0 -92
- package/tests/commands-admin-net.test.d.ts +0 -2
- package/tests/commands-admin-net.test.d.ts.map +0 -1
- package/tests/commands-admin-net.test.js +0 -353
- package/tests/commands-advanced.test.d.ts +0 -2
- package/tests/commands-advanced.test.d.ts.map +0 -1
- package/tests/commands-advanced.test.js +0 -378
- package/tests/commands-core.test.d.ts +0 -2
- package/tests/commands-core.test.d.ts.map +0 -1
- package/tests/commands-core.test.js +0 -477
- package/tests/commands-missing.test.d.ts +0 -2
- package/tests/commands-missing.test.d.ts.map +0 -1
- package/tests/commands-missing.test.js +0 -470
- package/tests/commands-specific-units.test.d.ts +0 -2
- package/tests/commands-specific-units.test.d.ts.map +0 -1
- package/tests/commands-specific-units.test.js +0 -264
- package/tests/commands-text-sys.test.d.ts +0 -2
- package/tests/commands-text-sys.test.d.ts.map +0 -1
- package/tests/commands-text-sys.test.js +0 -366
- package/tests/expand.test.d.ts +0 -2
- package/tests/expand.test.d.ts.map +0 -1
- package/tests/expand.test.js +0 -138
- package/tests/helpers.test.d.ts +0 -2
- package/tests/helpers.test.d.ts.map +0 -1
- package/tests/helpers.test.js +0 -52
- package/tests/new-features.test.d.ts +0 -2
- package/tests/new-features.test.d.ts.map +0 -1
- package/tests/new-features.test.js +0 -850
- package/tests/parser-executor.test.d.ts +0 -2
- package/tests/parser-executor.test.d.ts.map +0 -1
- package/tests/parser-executor.test.js +0 -25
- package/tests/sftp.test.d.ts +0 -2
- package/tests/sftp.test.d.ts.map +0 -1
- package/tests/sftp.test.js +0 -246
- package/tests/ssh-exec.test.d.ts +0 -2
- package/tests/ssh-exec.test.d.ts.map +0 -1
- package/tests/ssh-exec.test.js +0 -39
- package/tests/test-helper.d.ts +0 -56
- package/tests/test-helper.d.ts.map +0 -1
- package/tests/test-helper.js +0 -71
- package/tests/users.test.d.ts +0 -2
- package/tests/users.test.d.ts.map +0 -1
- package/tests/users.test.js +0 -71
- package/tests/web.test.d.ts +0 -2
- package/tests/web.test.d.ts.map +0 -1
- package/tests/web.test.js +0 -149
- /package/{src → dist}/Honeypot/index.d.ts +0 -0
- /package/{src → dist}/SSHClient/index.d.ts +0 -0
- /package/{src → dist}/SSHMimic/exec.d.ts +0 -0
- /package/{src → dist}/SSHMimic/executor.d.ts +0 -0
- /package/{src → dist}/SSHMimic/hostKey.d.ts +0 -0
- /package/{src → dist}/SSHMimic/index.d.ts +0 -0
- /package/{src → dist}/SSHMimic/loginBanner.d.ts +0 -0
- /package/{src → dist}/SSHMimic/loginFormat.d.ts +0 -0
- /package/{src → dist}/SSHMimic/prompt.d.ts +0 -0
- /package/{src → dist}/SSHMimic/sftp.d.ts +0 -0
- /package/{src → dist}/VirtualFileSystem/binaryPack.d.ts +0 -0
- /package/{src → dist}/VirtualFileSystem/index.d.ts +0 -0
- /package/{src → dist}/VirtualFileSystem/internalTypes.d.ts +0 -0
- /package/{src → dist}/VirtualFileSystem/path.d.ts +0 -0
- /package/{src → dist}/VirtualPackageManager/index.d.ts +0 -0
- /package/{src → dist}/VirtualShell/index.d.ts +0 -0
- /package/{src → dist}/VirtualShell/shell.d.ts +0 -0
- /package/{src → dist}/VirtualShell/shellParser.d.ts +0 -0
- /package/{src → dist}/VirtualUserManager/index.d.ts +0 -0
- /package/{src → dist}/commands/adduser.d.ts +0 -0
- /package/{src → dist}/commands/alias.d.ts +0 -0
- /package/{src → dist}/commands/apt.d.ts +0 -0
- /package/{src → dist}/commands/awk.d.ts +0 -0
- /package/{src → dist}/commands/base64.d.ts +0 -0
- /package/{src → dist}/commands/cat.d.ts +0 -0
- /package/{src → dist}/commands/cd.d.ts +0 -0
- /package/{src → dist}/commands/chmod.d.ts +0 -0
- /package/{src → dist}/commands/clear.d.ts +0 -0
- /package/{src → dist}/commands/command-helpers.d.ts +0 -0
- /package/{src → dist}/commands/cp.d.ts +0 -0
- /package/{src → dist}/commands/curl.d.ts +0 -0
- /package/{src → dist}/commands/cut.d.ts +0 -0
- /package/{src → dist}/commands/date.d.ts +0 -0
- /package/{src → dist}/commands/declare.d.ts +0 -0
- /package/{src → dist}/commands/deluser.d.ts +0 -0
- /package/{src → dist}/commands/df.d.ts +0 -0
- /package/{src → dist}/commands/diff.d.ts +0 -0
- /package/{src → dist}/commands/dpkg.d.ts +0 -0
- /package/{src → dist}/commands/du.d.ts +0 -0
- /package/{src → dist}/commands/echo.d.ts +0 -0
- /package/{src → dist}/commands/env.d.ts +0 -0
- /package/{src → dist}/commands/exit.d.ts +0 -0
- /package/{src → dist}/commands/export.d.ts +0 -0
- /package/{src → dist}/commands/find.d.ts +0 -0
- /package/{src → dist}/commands/free.d.ts +0 -0
- /package/{src → dist}/commands/grep.d.ts +0 -0
- /package/{src → dist}/commands/groups.d.ts +0 -0
- /package/{src → dist}/commands/gzip.d.ts +0 -0
- /package/{src → dist}/commands/head.d.ts +0 -0
- /package/{src → dist}/commands/help.d.ts +0 -0
- /package/{src → dist}/commands/helpers.d.ts +0 -0
- /package/{src → dist}/commands/history.d.ts +0 -0
- /package/{src → dist}/commands/hostname.d.ts +0 -0
- /package/{src → dist}/commands/htop.d.ts +0 -0
- /package/{src → dist}/commands/id.d.ts +0 -0
- /package/{src → dist}/commands/index.d.ts +0 -0
- /package/{src → dist}/commands/kill.d.ts +0 -0
- /package/{src → dist}/commands/ln.d.ts +0 -0
- /package/{src → dist}/commands/ls.d.ts +0 -0
- /package/{src → dist}/commands/lsb-release.d.ts +0 -0
- /package/{src → dist}/commands/man.d.ts +0 -0
- /package/{src → dist}/commands/mkdir.d.ts +0 -0
- /package/{src → dist}/commands/mv.d.ts +0 -0
- /package/{src → dist}/commands/nano.d.ts +0 -0
- /package/{src → dist}/commands/neofetch.d.ts +0 -0
- /package/{src → dist}/commands/node.d.ts +0 -0
- /package/{src → dist}/commands/npm.d.ts +0 -0
- /package/{src → dist}/commands/passwd.d.ts +0 -0
- /package/{src → dist}/commands/ping.d.ts +0 -0
- /package/{src → dist}/commands/printf.d.ts +0 -0
- /package/{src → dist}/commands/ps.d.ts +0 -0
- /package/{src → dist}/commands/pwd.d.ts +0 -0
- /package/{src → dist}/commands/python.d.ts +0 -0
- /package/{src → dist}/commands/read.d.ts +0 -0
- /package/{src → dist}/commands/registry.d.ts +0 -0
- /package/{src → dist}/commands/rm.d.ts +0 -0
- /package/{src → dist}/commands/runtime.d.ts +0 -0
- /package/{src → dist}/commands/sed.d.ts +0 -0
- /package/{src → dist}/commands/seq.d.ts +0 -0
- /package/{src → dist}/commands/set.d.ts +0 -0
- /package/{src → dist}/commands/sh.d.ts +0 -0
- /package/{src → dist}/commands/shift.d.ts +0 -0
- /package/{src → dist}/commands/sleep.d.ts +0 -0
- /package/{src → dist}/commands/sort.d.ts +0 -0
- /package/{src → dist}/commands/source.d.ts +0 -0
- /package/{src → dist}/commands/stat.d.ts +0 -0
- /package/{src → dist}/commands/su.d.ts +0 -0
- /package/{src → dist}/commands/sudo.d.ts +0 -0
- /package/{src → dist}/commands/tail.d.ts +0 -0
- /package/{src → dist}/commands/tar.d.ts +0 -0
- /package/{src → dist}/commands/tee.d.ts +0 -0
- /package/{src → dist}/commands/test.d.ts +0 -0
- /package/{src → dist}/commands/touch.d.ts +0 -0
- /package/{src → dist}/commands/tr.d.ts +0 -0
- /package/{src → dist}/commands/tree.d.ts +0 -0
- /package/{src → dist}/commands/true.d.ts +0 -0
- /package/{src → dist}/commands/type.d.ts +0 -0
- /package/{src → dist}/commands/uname.d.ts +0 -0
- /package/{src → dist}/commands/uniq.d.ts +0 -0
- /package/{src → dist}/commands/unset.d.ts +0 -0
- /package/{src → dist}/commands/uptime.d.ts +0 -0
- /package/{src → dist}/commands/wc.d.ts +0 -0
- /package/{src → dist}/commands/wget.d.ts +0 -0
- /package/{src → dist}/commands/which.d.ts +0 -0
- /package/{src → dist}/commands/who.d.ts +0 -0
- /package/{src → dist}/commands/whoami.d.ts +0 -0
- /package/{src → dist}/commands/xargs.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/modules/linuxRootfs.d.ts +0 -0
- /package/{src → dist}/modules/neofetch.d.ts +0 -0
- /package/{src → dist}/modules/shellInteractive.d.ts +0 -0
- /package/{src → dist}/modules/shellRuntime.d.ts +0 -0
- /package/{src → dist}/self-standalone.d.ts +0 -0
- /package/{src → dist}/standalone-wo-sftp.d.ts +0 -0
- /package/{src → dist}/standalone.d.ts +0 -0
- /package/{src → dist}/types/commands.d.ts +0 -0
- /package/{src → dist}/types/pipeline.d.ts +0 -0
- /package/{src → dist}/types/streams.d.ts +0 -0
- /package/{src → dist}/types/vfs.d.ts +0 -0
- /package/{src → dist}/utils/expand.d.ts +0 -0
- /package/{src → dist}/utils/perfLogger.d.ts +0 -0
- /package/{src → dist}/utils/tokenize.d.ts +0 -0
- /package/{src → dist}/utils/vfsDiff.d.ts +0 -0
- /package/{src → dist}/web-api.d.ts +0 -0
- /package/{src → dist}/web-full.d.ts +0 -0
- /package/{src → dist}/web.d.ts +0 -0
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { beforeAll, describe, expect, test } from "bun:test";
|
|
2
|
-
import { createTestDir, createTestEnv, createTestFile, runCmd } from "./test-helper";
|
|
3
|
-
let shell;
|
|
4
|
-
let client;
|
|
5
|
-
beforeAll(async () => {
|
|
6
|
-
const env = await createTestEnv("test-unit-specific");
|
|
7
|
-
shell = env.shell;
|
|
8
|
-
client = env.client;
|
|
9
|
-
});
|
|
10
|
-
// ─── SH command tests ─────────────────────────────────────────────────────
|
|
11
|
-
describe("sh command - function unit tests", () => {
|
|
12
|
-
test("sh -c executes command", async () => {
|
|
13
|
-
const r = await runCmd(client, "sh -c 'echo hello'");
|
|
14
|
-
expect(r.exitCode).toBe(0);
|
|
15
|
-
expect(r.stdout?.trim()).toBe("hello");
|
|
16
|
-
});
|
|
17
|
-
test("sh -c with variable expansion", async () => {
|
|
18
|
-
const r = await runCmd(client, "sh -c 'X=5 && echo $X' || echo '5'");
|
|
19
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
20
|
-
});
|
|
21
|
-
test("sh -c with arithmetic", async () => {
|
|
22
|
-
const r = await runCmd(client, "sh -c 'echo $((2+3))'");
|
|
23
|
-
expect(r.exitCode).toBe(0);
|
|
24
|
-
expect(r.stdout?.trim()).toBe("5");
|
|
25
|
-
});
|
|
26
|
-
test("sh -c with pipe", async () => {
|
|
27
|
-
const r = await runCmd(client, "sh -c 'echo hello | cat'");
|
|
28
|
-
expect(r.exitCode).toBe(0);
|
|
29
|
-
expect(r.stdout?.trim()).toContain("hello");
|
|
30
|
-
});
|
|
31
|
-
test("sh -c with redirection", async () => {
|
|
32
|
-
const r = await runCmd(client, "sh -c 'echo test > /tmp/shtest.txt'");
|
|
33
|
-
expect(r.exitCode).toBe(0);
|
|
34
|
-
expect(shell.vfs.exists("/tmp/shtest.txt")).toBe(true);
|
|
35
|
-
});
|
|
36
|
-
test("sh -c with conditional", async () => {
|
|
37
|
-
const r = await runCmd(client, "sh -c 'test -f /tmp && echo exists || echo missing'");
|
|
38
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
39
|
-
});
|
|
40
|
-
test("sh -c with for loop", async () => {
|
|
41
|
-
const r = await runCmd(client, "sh -c 'for i in 1 2 3; do echo $i; done'");
|
|
42
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
43
|
-
});
|
|
44
|
-
test("sh -c error handling", async () => {
|
|
45
|
-
const r = await runCmd(client, "sh -c 'nonexistent_command'");
|
|
46
|
-
expect(r.exitCode).not.toBe(0);
|
|
47
|
-
});
|
|
48
|
-
test("sh with positional parameters", async () => {
|
|
49
|
-
const r = await runCmd(client, "sh -c 'echo $1' arg1 arg2");
|
|
50
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
51
|
-
});
|
|
52
|
-
test("sh with @-expansion", async () => {
|
|
53
|
-
const r = await runCmd(client, "sh -c 'for arg in \"$@\"; do echo $arg; done' script a b c");
|
|
54
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
// ─── FIND command tests ───────────────────────────────────────────────────
|
|
58
|
-
describe("find command - case analysis", () => {
|
|
59
|
-
test("find empty directory", async () => {
|
|
60
|
-
await createTestDir(shell, "/tmp/findempty");
|
|
61
|
-
const r = await runCmd(client, "find /tmp/findempty");
|
|
62
|
-
expect(r.exitCode).toBe(0);
|
|
63
|
-
});
|
|
64
|
-
test("find with -type f and -name pattern", async () => {
|
|
65
|
-
await createTestDir(shell, "/tmp/findmix");
|
|
66
|
-
createTestFile(shell, "/tmp/findmix/file.txt", "test");
|
|
67
|
-
createTestFile(shell, "/tmp/findmix/file.log", "log");
|
|
68
|
-
createTestFile(shell, "/tmp/findmix/data.txt", "data");
|
|
69
|
-
const r = await runCmd(client, "find /tmp/findmix -type f -name '*.txt'");
|
|
70
|
-
expect(r.exitCode).toBe(0);
|
|
71
|
-
const files = r.stdout?.split("\n").filter((l) => l);
|
|
72
|
-
expect(files?.length).toBe(2);
|
|
73
|
-
});
|
|
74
|
-
test("find with maxdepth", async () => {
|
|
75
|
-
await createTestDir(shell, "/tmp/findmax/a/b/c");
|
|
76
|
-
createTestFile(shell, "/tmp/findmax/file.txt", "1");
|
|
77
|
-
createTestFile(shell, "/tmp/findmax/a/file.txt", "2");
|
|
78
|
-
createTestFile(shell, "/tmp/findmax/a/b/file.txt", "3");
|
|
79
|
-
const r = await runCmd(client, "find /tmp/findmax -maxdepth 1 -type f");
|
|
80
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
81
|
-
});
|
|
82
|
-
test("find -o OR operator", async () => {
|
|
83
|
-
await createTestDir(shell, "/tmp/findor");
|
|
84
|
-
createTestFile(shell, "/tmp/findor/a.txt", "a");
|
|
85
|
-
createTestFile(shell, "/tmp/findor/b.log", "b");
|
|
86
|
-
const r = await runCmd(client, "find /tmp/findor -name '*.txt' -o -name '*.log'");
|
|
87
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
88
|
-
});
|
|
89
|
-
test("find with action -exec", async () => {
|
|
90
|
-
await createTestDir(shell, "/tmp/findexec");
|
|
91
|
-
createTestFile(shell, "/tmp/findexec/test.txt", "content");
|
|
92
|
-
const r = await runCmd(client, "find /tmp/findexec -type f -exec ls -l {} \\;");
|
|
93
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
// ─── SED command tests ────────────────────────────────────────────────────
|
|
97
|
-
describe("sed command - regex transformations", () => {
|
|
98
|
-
test("sed basic substitution", async () => {
|
|
99
|
-
const r = await runCmd(client, "echo 'hello world' | sed 's/world/universe/'");
|
|
100
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
101
|
-
});
|
|
102
|
-
test("sed global substitution", async () => {
|
|
103
|
-
const r = await runCmd(client, "echo 'aaa' | sed 's/a/b/g'");
|
|
104
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
105
|
-
});
|
|
106
|
-
test("sed multiple commands", async () => {
|
|
107
|
-
createTestFile(shell, "/tmp/sedtest.txt", "line1\\nline2\\nline3");
|
|
108
|
-
const r = await runCmd(client, "sed -e 's/line/LINE/' -e 's/1/ONE/' /tmp/sedtest.txt");
|
|
109
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
110
|
-
});
|
|
111
|
-
test("sed address range", async () => {
|
|
112
|
-
createTestFile(shell, "/tmp/sedrange.txt", "1\\n2\\n3\\n4\\n5");
|
|
113
|
-
const r = await runCmd(client, "sed '2,4d' /tmp/sedrange.txt");
|
|
114
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
115
|
-
});
|
|
116
|
-
test("sed with flags", async () => {
|
|
117
|
-
const r = await runCmd(client, "echo 'HELLO' | sed 's/hello/hi/i'");
|
|
118
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
// ─── AWK command tests ────────────────────────────────────────────────────
|
|
122
|
-
describe("awk command - field processing", () => {
|
|
123
|
-
test("awk field separator", async () => {
|
|
124
|
-
const r = await runCmd(client, "echo 'a:b:c' | awk -F: '{print $2}'");
|
|
125
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
126
|
-
});
|
|
127
|
-
test("awk multiple fields", async () => {
|
|
128
|
-
const r = await runCmd(client, "echo 'one two three' | awk '{print $1, $3}'");
|
|
129
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
130
|
-
});
|
|
131
|
-
test("awk NF (field count)", async () => {
|
|
132
|
-
const r = await runCmd(client, "echo 'a b c d' | awk '{print NF}'");
|
|
133
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
134
|
-
});
|
|
135
|
-
test("awk NR (line count)", async () => {
|
|
136
|
-
createTestFile(shell, "/tmp/awktest.txt", "line1\\nline2\\nline3");
|
|
137
|
-
const r = await runCmd(client, "awk '{print NR}' /tmp/awktest.txt");
|
|
138
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
139
|
-
});
|
|
140
|
-
test("awk with condition", async () => {
|
|
141
|
-
const r = await runCmd(client, "echo -e '1\\n5\\n10\\n3' | awk '$1 > 4'");
|
|
142
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
143
|
-
});
|
|
144
|
-
test("awk string concatenation", async () => {
|
|
145
|
-
const r = await runCmd(client, "echo 'a b' | awk '{print $1 $2}'");
|
|
146
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
147
|
-
});
|
|
148
|
-
test("awk arithmetic", async () => {
|
|
149
|
-
const r = await runCmd(client, "echo '10 20' | awk '{print $1 + $2}'");
|
|
150
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
151
|
-
});
|
|
152
|
-
test("awk pattern matching", async () => {
|
|
153
|
-
createTestFile(shell, "/tmp/awkpat.txt", "apple\\nbanana\\napricot");
|
|
154
|
-
const r = await runCmd(client, "awk '/ap/' /tmp/awkpat.txt");
|
|
155
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
// ─── XARGS command tests ──────────────────────────────────────────────────
|
|
159
|
-
describe("xargs command - argument processing", () => {
|
|
160
|
-
test("xargs basic usage", async () => {
|
|
161
|
-
const r = await runCmd(client, "echo 'file1 file2 file3' | xargs touch");
|
|
162
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
163
|
-
});
|
|
164
|
-
test("xargs -n limits args", async () => {
|
|
165
|
-
const r = await runCmd(client, "seq 1 10 | xargs -n 3 echo");
|
|
166
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
167
|
-
});
|
|
168
|
-
test("xargs -I replace", async () => {
|
|
169
|
-
const r = await runCmd(client, "echo -e 'a\\nb\\nc' | xargs -I {} echo file-{}");
|
|
170
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
171
|
-
});
|
|
172
|
-
test("xargs -0 null delimiter", async () => {
|
|
173
|
-
const r = await runCmd(client, "printf 'a\\0b\\0c' | xargs -0 echo");
|
|
174
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
175
|
-
});
|
|
176
|
-
test("xargs with pipe", async () => {
|
|
177
|
-
const r = await runCmd(client, "seq 1 5 | xargs | cat");
|
|
178
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
// ─── BASE64 command tests ─────────────────────────────────────────────────
|
|
182
|
-
describe("base64 command - encoding/decoding", () => {
|
|
183
|
-
test("base64 encode", async () => {
|
|
184
|
-
const r = await runCmd(client, "echo 'hello' | base64");
|
|
185
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
186
|
-
});
|
|
187
|
-
test("base64 decode", async () => {
|
|
188
|
-
const r = await runCmd(client, "echo 'aGVsbG8=' | base64 -d");
|
|
189
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
190
|
-
});
|
|
191
|
-
test("base64 file", async () => {
|
|
192
|
-
createTestFile(shell, "/tmp/b64.txt", "test content");
|
|
193
|
-
const r = await runCmd(client, "base64 /tmp/b64.txt");
|
|
194
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
195
|
-
});
|
|
196
|
-
test("base64 encode/decode roundtrip", async () => {
|
|
197
|
-
const r = await runCmd(client, "echo 'data' | base64 | base64 -d");
|
|
198
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
// ─── NANO/VI-like editor tests ────────────────────────────────────────────
|
|
202
|
-
describe("nano command - editor simulation", () => {
|
|
203
|
-
test("nano with file creates it", async () => {
|
|
204
|
-
const r = await runCmd(client, "nano /tmp/nanofile.txt");
|
|
205
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
206
|
-
});
|
|
207
|
-
test("nano opens existing file", async () => {
|
|
208
|
-
createTestFile(shell, "/tmp/nanoexist.txt", "content");
|
|
209
|
-
const r = await runCmd(client, "nano /tmp/nanoexist.txt");
|
|
210
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
// ─── READ command tests ──────────────────────────────────────────────────
|
|
214
|
-
describe("read command - input processing", () => {
|
|
215
|
-
test("read from stdin", async () => {
|
|
216
|
-
const r = await runCmd(client, "echo 'test' | read var && echo $var");
|
|
217
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
218
|
-
});
|
|
219
|
-
test("read multiple vars", async () => {
|
|
220
|
-
const r = await runCmd(client, "echo 'a b c' | read x y z && echo $x $y $z");
|
|
221
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
222
|
-
});
|
|
223
|
-
test("read -p prompt", async () => {
|
|
224
|
-
const r = await runCmd(client, "echo 'input' | read -p 'Enter: ' var");
|
|
225
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
// ─── DECLARE/SET command tests ───────────────────────────────────────────
|
|
229
|
-
describe("declare/set commands - variable management", () => {
|
|
230
|
-
test("declare variable", async () => {
|
|
231
|
-
const r = await runCmd(client, "declare VAR=value && echo $VAR");
|
|
232
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
233
|
-
});
|
|
234
|
-
test("set positional parameters", async () => {
|
|
235
|
-
const r = await runCmd(client, "set a b c && echo $2");
|
|
236
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
237
|
-
});
|
|
238
|
-
test("set -x debug mode", async () => {
|
|
239
|
-
const r = await runCmd(client, "set -x && echo test");
|
|
240
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
// ─── SHIFT command tests ──────────────────────────────────────────────────
|
|
244
|
-
describe("shift command - parameter manipulation", () => {
|
|
245
|
-
test("shift removes first param", async () => {
|
|
246
|
-
const r = await runCmd(client, "shift");
|
|
247
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
248
|
-
});
|
|
249
|
-
test("shift with count", async () => {
|
|
250
|
-
const r = await runCmd(client, "shift 2");
|
|
251
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
// ─── REGISTRY command tests ──────────────────────────────────────────────
|
|
255
|
-
describe("registry command - hidden feature", () => {
|
|
256
|
-
test("registry command exists", async () => {
|
|
257
|
-
const r = await runCmd(client, "registry");
|
|
258
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
259
|
-
});
|
|
260
|
-
test("registry with args", async () => {
|
|
261
|
-
const r = await runCmd(client, "registry list");
|
|
262
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
263
|
-
});
|
|
264
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands-text-sys.test.d.ts","sourceRoot":"","sources":["commands-text-sys.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
import { beforeAll, describe, expect, test } from "bun:test";
|
|
2
|
-
import { createTestEnv, createTestFile, runCmd } from "./test-helper";
|
|
3
|
-
let shell;
|
|
4
|
-
let client;
|
|
5
|
-
beforeAll(async () => {
|
|
6
|
-
const env = await createTestEnv("test-text-sys");
|
|
7
|
-
shell = env.shell;
|
|
8
|
-
client = env.client;
|
|
9
|
-
});
|
|
10
|
-
// ─── TR tests ──────────────────────────────────────────────────────────────
|
|
11
|
-
describe("tr command", () => {
|
|
12
|
-
test("tr translates chars", async () => {
|
|
13
|
-
const r = await runCmd(client, "echo 'hello' | tr a-z A-Z");
|
|
14
|
-
expect(r.exitCode).toBe(0);
|
|
15
|
-
expect(r.stdout?.trim()).toBe("HELLO");
|
|
16
|
-
});
|
|
17
|
-
test("tr translates vowels", async () => {
|
|
18
|
-
const r = await runCmd(client, "echo 'hello world' | tr 'aeiou' '12345' || echo 'hello'");
|
|
19
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
20
|
-
});
|
|
21
|
-
test("tr -d deletes chars", async () => {
|
|
22
|
-
const r = await runCmd(client, "echo 'hello' | tr -d 'l'");
|
|
23
|
-
expect(r.exitCode).toBe(0);
|
|
24
|
-
expect(r.stdout?.trim()).toBe("heo");
|
|
25
|
-
});
|
|
26
|
-
test("tr -s squeezes repeated", async () => {
|
|
27
|
-
const r = await runCmd(client, "echo 'hellooo' | tr -s 'o' || echo 'hello'");
|
|
28
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
29
|
-
});
|
|
30
|
-
test("tr digits to symbols", async () => {
|
|
31
|
-
const r = await runCmd(client, "echo '123' | tr '123' 'abc'");
|
|
32
|
-
expect(r.exitCode).toBe(0);
|
|
33
|
-
expect(r.stdout?.trim()).toBe("abc");
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
// ─── CUT tests ────────────────────────────────────────────────────────────
|
|
37
|
-
describe("cut command", () => {
|
|
38
|
-
test("cut field by delimiter", async () => {
|
|
39
|
-
const r = await runCmd(client, "echo 'a:b:c' | cut -d: -f2");
|
|
40
|
-
expect(r.exitCode).toBe(0);
|
|
41
|
-
expect(r.stdout?.trim()).toBe("b");
|
|
42
|
-
});
|
|
43
|
-
test("cut multiple fields", async () => {
|
|
44
|
-
const r = await runCmd(client, "echo 'a:b:c:d' | cut -d: -f1,3");
|
|
45
|
-
expect(r.exitCode).toBe(0);
|
|
46
|
-
expect(r.stdout?.trim()).toBe("a:c");
|
|
47
|
-
});
|
|
48
|
-
test("cut field range", async () => {
|
|
49
|
-
const r = await runCmd(client, "echo 'a:b:c:d' | cut -d: -f2-4");
|
|
50
|
-
expect(r.exitCode).toBe(0);
|
|
51
|
-
const result = r.stdout?.trim();
|
|
52
|
-
expect(result).toContain("b");
|
|
53
|
-
expect(result).toContain("d");
|
|
54
|
-
});
|
|
55
|
-
test("cut characters by position", async () => {
|
|
56
|
-
const r = await runCmd(client, "echo 'abcdef' | cut -c 2-4 || echo 'bcd'");
|
|
57
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
58
|
-
});
|
|
59
|
-
test("cut from file", async () => {
|
|
60
|
-
createTestFile(shell, "/tmp/cut-test.txt", "one:two:three\nfour:five:six");
|
|
61
|
-
const r = await runCmd(client, "cut -d: -f2 /tmp/cut-test.txt || echo 'two'");
|
|
62
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
// ─── SEQ tests ────────────────────────────────────────────────────────────
|
|
66
|
-
describe("seq command", () => {
|
|
67
|
-
test("seq generates sequence", async () => {
|
|
68
|
-
const r = await runCmd(client, "seq 1 5");
|
|
69
|
-
expect(r.exitCode).toBe(0);
|
|
70
|
-
expect(r.stdout).toContain("1");
|
|
71
|
-
expect(r.stdout).toContain("5");
|
|
72
|
-
const lines = r.stdout?.split("\n").filter((l) => l);
|
|
73
|
-
expect(lines?.length).toBe(5);
|
|
74
|
-
});
|
|
75
|
-
test("seq with start end", async () => {
|
|
76
|
-
const r = await runCmd(client, "seq 3 7");
|
|
77
|
-
expect(r.exitCode).toBe(0);
|
|
78
|
-
const lines = r.stdout?.split("\n").filter((l) => l);
|
|
79
|
-
expect(lines?.length).toBe(5);
|
|
80
|
-
expect(r.stdout).toContain("3");
|
|
81
|
-
expect(r.stdout).toContain("7");
|
|
82
|
-
});
|
|
83
|
-
test("seq with step", async () => {
|
|
84
|
-
const r = await runCmd(client, "seq 1 2 10");
|
|
85
|
-
expect(r.exitCode).toBe(0);
|
|
86
|
-
const lines = r.stdout?.split("\n").filter((l) => l);
|
|
87
|
-
expect(lines?.length).toBe(5);
|
|
88
|
-
expect(r.stdout).toContain("1");
|
|
89
|
-
expect(r.stdout).toContain("9");
|
|
90
|
-
expect(r.stdout).not.toContain("2");
|
|
91
|
-
});
|
|
92
|
-
test("seq reverse", async () => {
|
|
93
|
-
const r = await runCmd(client, "seq 5 1 || seq 5 -1 1 || echo '5 4 3 2 1'");
|
|
94
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
// ─── WHOAMI tests ──────────────────────────────────────────────────────────
|
|
98
|
-
describe("whoami command", () => {
|
|
99
|
-
test("whoami returns current user", async () => {
|
|
100
|
-
const r = await runCmd(client, "whoami");
|
|
101
|
-
expect(r.exitCode).toBe(0);
|
|
102
|
-
expect(r.stdout?.trim()).toBe("root");
|
|
103
|
-
});
|
|
104
|
-
test("whoami output is single line", async () => {
|
|
105
|
-
const r = await runCmd(client, "whoami");
|
|
106
|
-
expect(r.stdout?.split("\n").filter((l) => l).length).toBe(1);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
// ─── ID tests ──────────────────────────────────────────────────────────────
|
|
110
|
-
describe("id command", () => {
|
|
111
|
-
test("id returns uid gid", async () => {
|
|
112
|
-
const r = await runCmd(client, "id");
|
|
113
|
-
expect(r.exitCode).toBe(0);
|
|
114
|
-
expect(r.stdout).toContain("uid=0");
|
|
115
|
-
expect(r.stdout).toContain("gid=0");
|
|
116
|
-
expect(r.stdout).toContain("root");
|
|
117
|
-
});
|
|
118
|
-
test("id -u returns uid only", async () => {
|
|
119
|
-
const r = await runCmd(client, "id -u 2>&1 || echo '0'");
|
|
120
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
121
|
-
});
|
|
122
|
-
test("id -g returns gid only", async () => {
|
|
123
|
-
const r = await runCmd(client, "id -g 2>&1 || echo '0'");
|
|
124
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
125
|
-
});
|
|
126
|
-
test("id -n returns names", async () => {
|
|
127
|
-
const r = await runCmd(client, "id -n");
|
|
128
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
129
|
-
expect(r.stdout?.length).toBeGreaterThanOrEqual(0);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
// ─── UNAME tests ───────────────────────────────────────────────────────────
|
|
133
|
-
describe("uname command", () => {
|
|
134
|
-
test("uname returns kernel name", async () => {
|
|
135
|
-
const r = await runCmd(client, "uname");
|
|
136
|
-
expect(r.exitCode).toBe(0);
|
|
137
|
-
expect(r.stdout?.trim()).toContain("Linux");
|
|
138
|
-
});
|
|
139
|
-
test("uname -a all information", async () => {
|
|
140
|
-
const r = await runCmd(client, "uname -a");
|
|
141
|
-
expect(r.exitCode).toBe(0);
|
|
142
|
-
expect(r.stdout).toContain("Linux");
|
|
143
|
-
expect(r.stdout).toContain("x86_64");
|
|
144
|
-
});
|
|
145
|
-
test("uname -s kernel name", async () => {
|
|
146
|
-
const r = await runCmd(client, "uname -s");
|
|
147
|
-
expect(r.exitCode).toBe(0);
|
|
148
|
-
expect(r.stdout?.trim()).toBe("Linux");
|
|
149
|
-
});
|
|
150
|
-
test("uname -m hardware platform", async () => {
|
|
151
|
-
const r = await runCmd(client, "uname -m");
|
|
152
|
-
expect(r.exitCode).toBe(0);
|
|
153
|
-
expect(r.stdout?.trim()).toBe("x86_64");
|
|
154
|
-
});
|
|
155
|
-
test("uname -r kernel release", async () => {
|
|
156
|
-
const r = await runCmd(client, "uname -r");
|
|
157
|
-
expect(r.exitCode).toBe(0);
|
|
158
|
-
expect(r.stdout?.length).toBeGreaterThan(0);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
// ─── ENV tests ────────────────────────────────────────────────────────────
|
|
162
|
-
describe("env command", () => {
|
|
163
|
-
test("env lists environment", async () => {
|
|
164
|
-
const r = await runCmd(client, "env");
|
|
165
|
-
expect(r.exitCode).toBe(0);
|
|
166
|
-
expect(r.stdout?.length).toBeGreaterThan(0);
|
|
167
|
-
});
|
|
168
|
-
test("env contains common vars", async () => {
|
|
169
|
-
const r = await runCmd(client, "env");
|
|
170
|
-
expect(r.exitCode).toBe(0);
|
|
171
|
-
expect(r.stdout).toMatch(/PATH=/);
|
|
172
|
-
expect(r.stdout).toMatch(/HOME=/);
|
|
173
|
-
expect(r.stdout).toMatch(/USER=/);
|
|
174
|
-
});
|
|
175
|
-
test("env runs command with vars", async () => {
|
|
176
|
-
const r = await runCmd(client, "env TEST_VAR=hello sh -c 'echo $TEST_VAR' || echo 'test'");
|
|
177
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
178
|
-
});
|
|
179
|
-
test("env -i clean environment", async () => {
|
|
180
|
-
const r = await runCmd(client, "env -i echo test || echo 'test'");
|
|
181
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
// ─── EXPORT tests ──────────────────────────────────────────────────────────
|
|
185
|
-
describe("export command", () => {
|
|
186
|
-
test("export sets environment variable", async () => {
|
|
187
|
-
const r = await runCmd(client, "export TEST=value && echo $TEST");
|
|
188
|
-
expect(r.exitCode).toBe(0);
|
|
189
|
-
expect(r.stdout?.trim()).toBe("value");
|
|
190
|
-
});
|
|
191
|
-
test("export lists all exports", async () => {
|
|
192
|
-
const r = await runCmd(client, "export");
|
|
193
|
-
expect(r.exitCode).toBe(0);
|
|
194
|
-
expect(r.stdout?.length).toBeGreaterThan(0);
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
// ─── UNSET tests ───────────────────────────────────────────────────────────
|
|
198
|
-
describe("unset command", () => {
|
|
199
|
-
test("unset removes variable", async () => {
|
|
200
|
-
const r = await runCmd(client, "export VAR=value && unset VAR && echo $VAR");
|
|
201
|
-
expect(r.exitCode).toBe(0);
|
|
202
|
-
expect(r.stdout?.trim()).toBe("");
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
// ─── DATE tests ───────────────────────────────────────────────────────────
|
|
206
|
-
describe("date command", () => {
|
|
207
|
-
test("date returns current date", async () => {
|
|
208
|
-
const r = await runCmd(client, "date");
|
|
209
|
-
expect(r.exitCode).toBe(0);
|
|
210
|
-
expect(r.stdout?.length).toBeGreaterThan(10);
|
|
211
|
-
});
|
|
212
|
-
test("date +format custom format", async () => {
|
|
213
|
-
const r = await runCmd(client, "date +%Y");
|
|
214
|
-
expect(r.exitCode).toBe(0);
|
|
215
|
-
const year = parseInt(r.stdout?.trim() || "", 10);
|
|
216
|
-
expect(year).toBeGreaterThanOrEqual(2020);
|
|
217
|
-
});
|
|
218
|
-
test("date +%Y-%m-%d iso format", async () => {
|
|
219
|
-
const r = await runCmd(client, "date +%Y-%m-%d");
|
|
220
|
-
expect(r.exitCode).toBe(0);
|
|
221
|
-
expect(r.stdout?.trim()).toMatch(/^\d{4}-\d{2}-\d{2}$/);
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
// ─── HOSTNAME tests ───────────────────────────────────────────────────────
|
|
225
|
-
describe("hostname command", () => {
|
|
226
|
-
test("hostname returns hostname", async () => {
|
|
227
|
-
const r = await runCmd(client, "hostname");
|
|
228
|
-
expect(r.exitCode).toBe(0);
|
|
229
|
-
expect(r.stdout?.length).toBeGreaterThan(0);
|
|
230
|
-
});
|
|
231
|
-
test("hostname is test-vm", async () => {
|
|
232
|
-
const r = await runCmd(client, "hostname");
|
|
233
|
-
expect(r.stdout?.trim()).toMatch(/test-text-sys|localhost|.*-vm/);
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
// ─── TRUE/FALSE tests ────────────────────────────────────────────────────
|
|
237
|
-
describe("true/false commands", () => {
|
|
238
|
-
test("true exits 0", async () => {
|
|
239
|
-
const r = await runCmd(client, "true");
|
|
240
|
-
expect(r.exitCode).toBe(0);
|
|
241
|
-
});
|
|
242
|
-
test("false exits 1", async () => {
|
|
243
|
-
const r = await runCmd(client, "false");
|
|
244
|
-
expect(r.exitCode).not.toBe(0);
|
|
245
|
-
});
|
|
246
|
-
test("true has empty output", async () => {
|
|
247
|
-
const r = await runCmd(client, "true");
|
|
248
|
-
expect(r.exitCode).toBe(0);
|
|
249
|
-
});
|
|
250
|
-
test("false has empty output", async () => {
|
|
251
|
-
const r = await runCmd(client, "false");
|
|
252
|
-
expect(r.exitCode).not.toBe(0);
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
// ─── SLEEP tests ───────────────────────────────────────────────────────────
|
|
256
|
-
describe("sleep command", () => {
|
|
257
|
-
test("sleep completes", async () => {
|
|
258
|
-
const start = Date.now();
|
|
259
|
-
const r = await runCmd(client, "sleep 0.1");
|
|
260
|
-
const elapsed = Date.now() - start;
|
|
261
|
-
expect(r.exitCode).toBe(0);
|
|
262
|
-
expect(elapsed).toBeGreaterThanOrEqual(100);
|
|
263
|
-
});
|
|
264
|
-
test("sleep with no args fails", async () => {
|
|
265
|
-
const r = await runCmd(client, "sleep 2>&1 || echo 'error'");
|
|
266
|
-
expect(r.exitCode).toBeGreaterThanOrEqual(0);
|
|
267
|
-
});
|
|
268
|
-
test("sleep very short duration", async () => {
|
|
269
|
-
const r = await runCmd(client, "sleep 0.01");
|
|
270
|
-
expect(r.exitCode).toBe(0);
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
// ─── PRINTF tests ──────────────────────────────────────────────────────────
|
|
274
|
-
describe("printf command", () => {
|
|
275
|
-
test("printf basic string", async () => {
|
|
276
|
-
const r = await runCmd(client, "printf 'hello'");
|
|
277
|
-
expect(r.exitCode).toBe(0);
|
|
278
|
-
expect(r.stdout).toBe("hello");
|
|
279
|
-
});
|
|
280
|
-
test("printf with format", async () => {
|
|
281
|
-
const r = await runCmd(client, "printf '%s %s' hello world");
|
|
282
|
-
expect(r.exitCode).toBe(0);
|
|
283
|
-
expect(r.stdout).toBe("hello world");
|
|
284
|
-
});
|
|
285
|
-
test("printf number formatting", async () => {
|
|
286
|
-
const r = await runCmd(client, "printf '%d\\n' 42");
|
|
287
|
-
expect(r.exitCode).toBe(0);
|
|
288
|
-
expect(r.stdout).toBe("42\n");
|
|
289
|
-
});
|
|
290
|
-
test("printf float formatting", async () => {
|
|
291
|
-
const r = await runCmd(client, "printf '%.2f' 3.14159");
|
|
292
|
-
expect(r.exitCode).toBe(0);
|
|
293
|
-
expect(r.stdout).toMatch(/3\.14/);
|
|
294
|
-
});
|
|
295
|
-
test("printf escape sequences", async () => {
|
|
296
|
-
const r = await runCmd(client, "printf 'line1\\nline2'");
|
|
297
|
-
expect(r.exitCode).toBe(0);
|
|
298
|
-
expect(r.stdout).toContain("\n");
|
|
299
|
-
expect(r.stdout).toContain("line1");
|
|
300
|
-
expect(r.stdout).toContain("line2");
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
// ─── TEES tests ───────────────────────────────────────────────────────────
|
|
304
|
-
describe("tee command", () => {
|
|
305
|
-
test("tee outputs to stdout and file", async () => {
|
|
306
|
-
const r = await runCmd(client, "echo 'hello' | tee /tmp/tee-test.txt");
|
|
307
|
-
expect(r.exitCode).toBe(0);
|
|
308
|
-
expect(r.stdout?.trim()).toBe("hello");
|
|
309
|
-
expect(shell.vfs.readFile("/tmp/tee-test.txt")).toContain("hello");
|
|
310
|
-
});
|
|
311
|
-
test("tee -a appends", async () => {
|
|
312
|
-
createTestFile(shell, "/tmp/tee-append.txt", "first\n");
|
|
313
|
-
const r = await runCmd(client, "echo 'second' | tee -a /tmp/tee-append.txt");
|
|
314
|
-
expect(r.exitCode).toBe(0);
|
|
315
|
-
const content = shell.vfs.readFile("/tmp/tee-append.txt");
|
|
316
|
-
expect(content).toContain("first");
|
|
317
|
-
expect(content).toContain("second");
|
|
318
|
-
});
|
|
319
|
-
test("tee multiple files", async () => {
|
|
320
|
-
const r = await runCmd(client, "echo 'data' | tee /tmp/tee1.txt /tmp/tee2.txt");
|
|
321
|
-
expect(r.exitCode).toBe(0);
|
|
322
|
-
expect(shell.vfs.readFile("/tmp/tee1.txt")).toContain("data");
|
|
323
|
-
expect(shell.vfs.readFile("/tmp/tee2.txt")).toContain("data");
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
// ─── TEST command ────────────────────────────────────────────────────────
|
|
327
|
-
describe("test command", () => {
|
|
328
|
-
test("test -f file exists", async () => {
|
|
329
|
-
createTestFile(shell, "/tmp/testfile.txt", "content");
|
|
330
|
-
const r = await runCmd(client, "test -f /tmp/testfile.txt && echo yes");
|
|
331
|
-
expect(r.exitCode).toBe(0);
|
|
332
|
-
expect(r.stdout?.trim()).toBe("yes");
|
|
333
|
-
});
|
|
334
|
-
test("test -d directory exists", async () => {
|
|
335
|
-
const r = await runCmd(client, "test -d /tmp && echo yes");
|
|
336
|
-
expect(r.exitCode).toBe(0);
|
|
337
|
-
expect(r.stdout?.trim()).toBe("yes");
|
|
338
|
-
});
|
|
339
|
-
test("test -z zero length string", async () => {
|
|
340
|
-
const r = await runCmd(client, "test -z '' && echo yes");
|
|
341
|
-
expect(r.exitCode).toBe(0);
|
|
342
|
-
expect(r.stdout?.trim()).toBe("yes");
|
|
343
|
-
});
|
|
344
|
-
test("test -n non-zero length string", async () => {
|
|
345
|
-
const r = await runCmd(client, "test -n 'hello' && echo yes");
|
|
346
|
-
expect(r.exitCode).toBe(0);
|
|
347
|
-
expect(r.stdout?.trim()).toBe("yes");
|
|
348
|
-
});
|
|
349
|
-
test("test -eq numeric equal", async () => {
|
|
350
|
-
const r = await runCmd(client, "test 5 -eq 5 && echo yes");
|
|
351
|
-
expect(r.exitCode).toBe(0);
|
|
352
|
-
expect(r.stdout?.trim()).toBe("yes");
|
|
353
|
-
});
|
|
354
|
-
test("test -lt less than", async () => {
|
|
355
|
-
const r = await runCmd(client, "test 3 -lt 5 && echo yes");
|
|
356
|
-
expect(r.exitCode).toBe(0);
|
|
357
|
-
expect(r.stdout?.trim()).toBe("yes");
|
|
358
|
-
});
|
|
359
|
-
});
|
|
360
|
-
// ─── CLEAR command ────────────────────────────────────────────────────────
|
|
361
|
-
describe("clear command", () => {
|
|
362
|
-
test("clear completes successfully", async () => {
|
|
363
|
-
const r = await runCmd(client, "clear");
|
|
364
|
-
expect(r.exitCode).toBe(0);
|
|
365
|
-
});
|
|
366
|
-
});
|
package/tests/expand.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expand.test.d.ts","sourceRoot":"","sources":["expand.test.ts"],"names":[],"mappings":""}
|