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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAqCzB,CAAC"}
|
package/src/commands/read.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ifFlag } from "./command-helpers";
|
|
2
|
-
/**
|
|
3
|
-
* Read a line from stdin into one or more variables.
|
|
4
|
-
* @category shell
|
|
5
|
-
* @params ["[-r] [-p prompt] <var...>"]
|
|
6
|
-
*/
|
|
7
|
-
export const readCommand = {
|
|
8
|
-
name: "read",
|
|
9
|
-
description: "Read a line from stdin into variables",
|
|
10
|
-
category: "shell",
|
|
11
|
-
params: ["[-r] [-p prompt] <var...>"],
|
|
12
|
-
run: ({ args, stdin, env }) => {
|
|
13
|
-
const _promptIdx = args.indexOf("-p");
|
|
14
|
-
const varNames = args.filter((a, i) => a !== "-r" && a !== "-p" && args[i - 1] !== "-p");
|
|
15
|
-
// In non-interactive context, read from stdin pipe
|
|
16
|
-
const input = (stdin ?? "").split("\n")[0] ?? "";
|
|
17
|
-
const line = ifFlag(args, ["-r"])
|
|
18
|
-
? input
|
|
19
|
-
: input.replace(/\\(?:\r?\n|.)/g, (m) => m[1] === "\n" || m[1] === "\r" ? "" : m[1]);
|
|
20
|
-
if (!env)
|
|
21
|
-
return { exitCode: 0 };
|
|
22
|
-
if (varNames.length === 0) {
|
|
23
|
-
// No var names: store into REPLY
|
|
24
|
-
env.vars.REPLY = line;
|
|
25
|
-
}
|
|
26
|
-
else if (varNames.length === 1) {
|
|
27
|
-
env.vars[varNames[0]] = line;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
// Split on whitespace, last var gets remainder
|
|
31
|
-
const parts = line.split(/\s+/);
|
|
32
|
-
for (let i = 0; i < varNames.length; i++) {
|
|
33
|
-
env.vars[varNames[i]] =
|
|
34
|
-
i < varNames.length - 1 ? (parts[i] ?? "") : parts.slice(i).join(" ");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return { exitCode: 0 };
|
|
38
|
-
},
|
|
39
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["registry.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqNpF,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAYzD;AAED,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,EAChB,GAAG,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,GAClE,WAAW,CAEb;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAG1C;AAED,wBAAgB,uBAAuB,IAAI,WAAW,EAAE,CAEvD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAGnE"}
|
package/src/commands/registry.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { adduserCommand } from "./adduser";
|
|
2
|
-
import { aliasCommand, unaliasCommand } from "./alias";
|
|
3
|
-
import { aptCacheCommand, aptCommand } from "./apt";
|
|
4
|
-
import { awkCommand } from "./awk";
|
|
5
|
-
import { base64Command } from "./base64";
|
|
6
|
-
import { catCommand } from "./cat";
|
|
7
|
-
import { cdCommand } from "./cd";
|
|
8
|
-
import { chmodCommand } from "./chmod";
|
|
9
|
-
import { clearCommand } from "./clear";
|
|
10
|
-
import { cpCommand } from "./cp";
|
|
11
|
-
import { curlCommand } from "./curl";
|
|
12
|
-
import { cutCommand } from "./cut";
|
|
13
|
-
import { dateCommand } from "./date";
|
|
14
|
-
import { declareCommand } from "./declare";
|
|
15
|
-
import { deluserCommand } from "./deluser";
|
|
16
|
-
import { dfCommand } from "./df";
|
|
17
|
-
import { diffCommand } from "./diff";
|
|
18
|
-
import { dpkgCommand, dpkgQueryCommand } from "./dpkg";
|
|
19
|
-
import { duCommand } from "./du";
|
|
20
|
-
import { echoCommand } from "./echo";
|
|
21
|
-
import { envCommand } from "./env";
|
|
22
|
-
import { exitCommand } from "./exit";
|
|
23
|
-
import { exportCommand } from "./export";
|
|
24
|
-
import { findCommand } from "./find";
|
|
25
|
-
import { freeCommand } from "./free";
|
|
26
|
-
import { grepCommand } from "./grep";
|
|
27
|
-
import { groupsCommand } from "./groups";
|
|
28
|
-
import { gunzipCommand, gzipCommand } from "./gzip";
|
|
29
|
-
import { headCommand } from "./head";
|
|
30
|
-
import { createHelpCommand } from "./help";
|
|
31
|
-
import { historyCommand } from "./history";
|
|
32
|
-
import { hostnameCommand } from "./hostname";
|
|
33
|
-
import { htopCommand } from "./htop";
|
|
34
|
-
import { idCommand } from "./id";
|
|
35
|
-
import { killCommand } from "./kill";
|
|
36
|
-
import { lnCommand, readlinkCommand } from "./ln";
|
|
37
|
-
import { seqCommand } from "./seq";
|
|
38
|
-
import { statCommand } from "./stat";
|
|
39
|
-
import { lsCommand } from "./ls";
|
|
40
|
-
import { lsbReleaseCommand } from "./lsb-release";
|
|
41
|
-
import { manCommand } from "./man";
|
|
42
|
-
import { mkdirCommand } from "./mkdir";
|
|
43
|
-
import { mvCommand } from "./mv";
|
|
44
|
-
import { nanoCommand } from "./nano";
|
|
45
|
-
import { neofetchCommand } from "./neofetch";
|
|
46
|
-
import { nodeCommand } from "./node";
|
|
47
|
-
import { npmCommand, npxCommand } from "./npm";
|
|
48
|
-
import { passwdCommand } from "./passwd";
|
|
49
|
-
import { pingCommand } from "./ping";
|
|
50
|
-
import { printfCommand } from "./printf";
|
|
51
|
-
import { psCommand } from "./ps";
|
|
52
|
-
import { pwdCommand } from "./pwd";
|
|
53
|
-
import { python3Command } from "./python";
|
|
54
|
-
import { readCommand } from "./read";
|
|
55
|
-
import { rmCommand } from "./rm";
|
|
56
|
-
import { sedCommand } from "./sed";
|
|
57
|
-
import { setCommand } from "./set";
|
|
58
|
-
import { shCommand } from "./sh";
|
|
59
|
-
import { returnCommand, shiftCommand, trapCommand } from "./shift";
|
|
60
|
-
import { sleepCommand } from "./sleep";
|
|
61
|
-
import { sortCommand } from "./sort";
|
|
62
|
-
import { sourceCommand } from "./source";
|
|
63
|
-
import { suCommand } from "./su";
|
|
64
|
-
import { sudoCommand } from "./sudo";
|
|
65
|
-
import { tailCommand } from "./tail";
|
|
66
|
-
import { tarCommand } from "./tar";
|
|
67
|
-
import { teeCommand } from "./tee";
|
|
68
|
-
import { testCommand } from "./test";
|
|
69
|
-
import { touchCommand } from "./touch";
|
|
70
|
-
import { trCommand } from "./tr";
|
|
71
|
-
import { treeCommand } from "./tree";
|
|
72
|
-
import { falseCommand, trueCommand } from "./true";
|
|
73
|
-
import { typeCommand } from "./type";
|
|
74
|
-
import { unameCommand } from "./uname";
|
|
75
|
-
import { uniqCommand } from "./uniq";
|
|
76
|
-
import { unsetCommand } from "./unset";
|
|
77
|
-
import { uptimeCommand } from "./uptime";
|
|
78
|
-
import { wcCommand } from "./wc";
|
|
79
|
-
import { wgetCommand } from "./wget";
|
|
80
|
-
import { whichCommand } from "./which";
|
|
81
|
-
import { whoCommand } from "./who";
|
|
82
|
-
import { whoamiCommand } from "./whoami";
|
|
83
|
-
import { xargsCommand } from "./xargs";
|
|
84
|
-
const BASE_COMMANDS = [
|
|
85
|
-
// Navigation
|
|
86
|
-
pwdCommand,
|
|
87
|
-
cdCommand,
|
|
88
|
-
lsCommand,
|
|
89
|
-
treeCommand,
|
|
90
|
-
// Files
|
|
91
|
-
catCommand,
|
|
92
|
-
touchCommand,
|
|
93
|
-
rmCommand,
|
|
94
|
-
mkdirCommand,
|
|
95
|
-
cpCommand,
|
|
96
|
-
mvCommand,
|
|
97
|
-
lnCommand,
|
|
98
|
-
readlinkCommand,
|
|
99
|
-
chmodCommand,
|
|
100
|
-
seqCommand,
|
|
101
|
-
statCommand,
|
|
102
|
-
findCommand,
|
|
103
|
-
// Text processing
|
|
104
|
-
grepCommand,
|
|
105
|
-
sedCommand,
|
|
106
|
-
awkCommand,
|
|
107
|
-
sortCommand,
|
|
108
|
-
uniqCommand,
|
|
109
|
-
wcCommand,
|
|
110
|
-
headCommand,
|
|
111
|
-
tailCommand,
|
|
112
|
-
cutCommand,
|
|
113
|
-
trCommand,
|
|
114
|
-
teeCommand,
|
|
115
|
-
xargsCommand,
|
|
116
|
-
diffCommand,
|
|
117
|
-
// Archives
|
|
118
|
-
tarCommand,
|
|
119
|
-
gzipCommand,
|
|
120
|
-
gunzipCommand,
|
|
121
|
-
base64Command,
|
|
122
|
-
// System info
|
|
123
|
-
whoamiCommand,
|
|
124
|
-
whoCommand,
|
|
125
|
-
hostnameCommand,
|
|
126
|
-
idCommand,
|
|
127
|
-
groupsCommand,
|
|
128
|
-
unameCommand,
|
|
129
|
-
psCommand,
|
|
130
|
-
killCommand,
|
|
131
|
-
dfCommand,
|
|
132
|
-
duCommand,
|
|
133
|
-
dateCommand,
|
|
134
|
-
sleepCommand,
|
|
135
|
-
pingCommand,
|
|
136
|
-
// Shell
|
|
137
|
-
echoCommand,
|
|
138
|
-
envCommand,
|
|
139
|
-
exportCommand,
|
|
140
|
-
setCommand,
|
|
141
|
-
unsetCommand,
|
|
142
|
-
shCommand,
|
|
143
|
-
clearCommand,
|
|
144
|
-
exitCommand,
|
|
145
|
-
// Editors
|
|
146
|
-
nanoCommand,
|
|
147
|
-
htopCommand,
|
|
148
|
-
// Network
|
|
149
|
-
curlCommand,
|
|
150
|
-
wgetCommand,
|
|
151
|
-
// Users
|
|
152
|
-
adduserCommand,
|
|
153
|
-
passwdCommand,
|
|
154
|
-
deluserCommand,
|
|
155
|
-
sudoCommand,
|
|
156
|
-
suCommand,
|
|
157
|
-
// Misc
|
|
158
|
-
neofetchCommand,
|
|
159
|
-
// Package management
|
|
160
|
-
aptCommand,
|
|
161
|
-
aptCacheCommand,
|
|
162
|
-
dpkgCommand,
|
|
163
|
-
dpkgQueryCommand,
|
|
164
|
-
// Shell (extended)
|
|
165
|
-
whichCommand,
|
|
166
|
-
typeCommand,
|
|
167
|
-
manCommand,
|
|
168
|
-
aliasCommand,
|
|
169
|
-
unaliasCommand,
|
|
170
|
-
testCommand,
|
|
171
|
-
sourceCommand,
|
|
172
|
-
historyCommand,
|
|
173
|
-
printfCommand,
|
|
174
|
-
readCommand,
|
|
175
|
-
declareCommand,
|
|
176
|
-
shiftCommand,
|
|
177
|
-
trapCommand,
|
|
178
|
-
returnCommand,
|
|
179
|
-
trueCommand,
|
|
180
|
-
falseCommand,
|
|
181
|
-
npmCommand,
|
|
182
|
-
npxCommand,
|
|
183
|
-
nodeCommand,
|
|
184
|
-
python3Command,
|
|
185
|
-
// System (extended)
|
|
186
|
-
uptimeCommand,
|
|
187
|
-
freeCommand,
|
|
188
|
-
lsbReleaseCommand,
|
|
189
|
-
];
|
|
190
|
-
const customCommands = [];
|
|
191
|
-
const commandRegistry = new Map();
|
|
192
|
-
let cachedCommandNames = null;
|
|
193
|
-
const helpCommand = createHelpCommand(() => getCommandModules().map((cmd) => cmd.name));
|
|
194
|
-
function buildCache() {
|
|
195
|
-
commandRegistry.clear();
|
|
196
|
-
for (const mod of getCommandModules()) {
|
|
197
|
-
commandRegistry.set(mod.name, mod);
|
|
198
|
-
for (const alias of mod.aliases ?? [])
|
|
199
|
-
commandRegistry.set(alias, mod);
|
|
200
|
-
}
|
|
201
|
-
cachedCommandNames = Array.from(commandRegistry.keys()).sort();
|
|
202
|
-
}
|
|
203
|
-
function getCommandModules() {
|
|
204
|
-
return [...BASE_COMMANDS, ...customCommands, helpCommand];
|
|
205
|
-
}
|
|
206
|
-
export function registerCommand(module) {
|
|
207
|
-
const normalized = {
|
|
208
|
-
...module,
|
|
209
|
-
name: module.name.trim().toLowerCase(),
|
|
210
|
-
aliases: module.aliases?.map((a) => a.trim().toLowerCase()),
|
|
211
|
-
};
|
|
212
|
-
const names = [normalized.name, ...(normalized.aliases ?? [])];
|
|
213
|
-
if (names.some((n) => n.length === 0 || /\s/.test(n))) {
|
|
214
|
-
throw new Error("Command names must be non-empty and contain no spaces");
|
|
215
|
-
}
|
|
216
|
-
customCommands.push(normalized);
|
|
217
|
-
buildCache();
|
|
218
|
-
}
|
|
219
|
-
export function createCustomCommand(name, params, run) {
|
|
220
|
-
return { name, params, run };
|
|
221
|
-
}
|
|
222
|
-
export function getCommandNames() {
|
|
223
|
-
if (!cachedCommandNames)
|
|
224
|
-
buildCache();
|
|
225
|
-
return cachedCommandNames;
|
|
226
|
-
}
|
|
227
|
-
export function getCommandModulesPublic() {
|
|
228
|
-
return getCommandModules();
|
|
229
|
-
}
|
|
230
|
-
export function resolveModule(name) {
|
|
231
|
-
if (!cachedCommandNames)
|
|
232
|
-
buildCache();
|
|
233
|
-
return commandRegistry.get(name.toLowerCase());
|
|
234
|
-
}
|
package/src/commands/rm.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["rm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WAgCvB,CAAC"}
|
package/src/commands/rm.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getArg, ifFlag } from "./command-helpers";
|
|
2
|
-
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Remove files or directories from the filesystem.
|
|
5
|
-
* @category files
|
|
6
|
-
* @params ["[-r|-rf] <path>"]
|
|
7
|
-
*/
|
|
8
|
-
export const rmCommand = {
|
|
9
|
-
name: "rm",
|
|
10
|
-
description: "Remove files or directories",
|
|
11
|
-
category: "files",
|
|
12
|
-
params: ["[-r|-rf] <path>"],
|
|
13
|
-
run: ({ authUser, shell, cwd, args }) => {
|
|
14
|
-
if (args.length === 0) {
|
|
15
|
-
return { stderr: "rm: missing operand", exitCode: 1 };
|
|
16
|
-
}
|
|
17
|
-
const recursive = ifFlag(args, ["-r", "-rf", "-fr"]);
|
|
18
|
-
const targets = [];
|
|
19
|
-
for (let index = 0;; index += 1) {
|
|
20
|
-
const target = getArg(args, index, { flags: ["-r", "-rf", "-fr"] });
|
|
21
|
-
if (!target) {
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
targets.push(target);
|
|
25
|
-
}
|
|
26
|
-
if (targets.length === 0) {
|
|
27
|
-
return { stderr: "rm: missing operand", exitCode: 1 };
|
|
28
|
-
}
|
|
29
|
-
for (const target of targets) {
|
|
30
|
-
const resolvedTarget = resolvePath(cwd, target);
|
|
31
|
-
assertPathAccess(authUser, resolvedTarget, "rm");
|
|
32
|
-
shell.vfs.remove(resolvedTarget, { recursive });
|
|
33
|
-
}
|
|
34
|
-
return { exitCode: 0 };
|
|
35
|
-
},
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EACX,WAAW,EACX,aAAa,EACb,QAAQ,EACR,MAAM,mBAAmB,CAAC;AAK3B,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAc3E;AAyCD,wBAAsB,gBAAgB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,EAAE,QAAQ,GACX,OAAO,CAAC,aAAa,CAAC,CAkHxB;AAED,wBAAsB,UAAU,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,QAAQ,GACZ,OAAO,CAAC,aAAa,CAAC,CAyKxB"}
|
package/src/commands/runtime.js
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
/** biome-ignore-all lint/style/useNamingConvention: ENV VARIABLES */
|
|
2
|
-
import { executeStatements } from "../SSHMimic/executor";
|
|
3
|
-
import { parseScript } from "../VirtualShell/shellParser";
|
|
4
|
-
import { expandAsync, expandBraces } from "../utils/expand";
|
|
5
|
-
import { tokenizeCommand } from "../utils/tokenize";
|
|
6
|
-
import { resolveModule } from "./registry";
|
|
7
|
-
export function makeDefaultEnv(authUser, hostname) {
|
|
8
|
-
return {
|
|
9
|
-
vars: {
|
|
10
|
-
PATH: "/usr/local/bin:/usr/bin:/bin",
|
|
11
|
-
HOME: `/home/${authUser}`,
|
|
12
|
-
USER: authUser,
|
|
13
|
-
LOGNAME: authUser,
|
|
14
|
-
SHELL: "/bin/sh",
|
|
15
|
-
TERM: "xterm-256color",
|
|
16
|
-
HOSTNAME: hostname,
|
|
17
|
-
PS1: "\\u@\\h:\\w\\$ ",
|
|
18
|
-
},
|
|
19
|
-
lastExitCode: 0,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function resolveVfsBinary(name, env, shell, authUser) {
|
|
23
|
-
if (name.startsWith("/")) {
|
|
24
|
-
if (!shell.vfs.exists(name))
|
|
25
|
-
return null;
|
|
26
|
-
try {
|
|
27
|
-
const st = shell.vfs.stat(name);
|
|
28
|
-
if (st.type !== "file")
|
|
29
|
-
return null;
|
|
30
|
-
if (!(st.mode & 0o111))
|
|
31
|
-
return null;
|
|
32
|
-
if ((name.startsWith("/sbin/") || name.startsWith("/usr/sbin/")) &&
|
|
33
|
-
authUser !== "root")
|
|
34
|
-
return null;
|
|
35
|
-
return name;
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const pathDirs = (env.vars.PATH ?? "/usr/local/bin:/usr/bin:/bin").split(":");
|
|
42
|
-
for (const dir of pathDirs) {
|
|
43
|
-
if ((dir === "/sbin" || dir === "/usr/sbin") && authUser !== "root")
|
|
44
|
-
continue;
|
|
45
|
-
const full = `${dir}/${name}`;
|
|
46
|
-
if (!shell.vfs.exists(full))
|
|
47
|
-
continue;
|
|
48
|
-
try {
|
|
49
|
-
const st = shell.vfs.stat(full);
|
|
50
|
-
if (st.type !== "file")
|
|
51
|
-
continue;
|
|
52
|
-
if (!(st.mode & 0o111))
|
|
53
|
-
continue;
|
|
54
|
-
return full;
|
|
55
|
-
}
|
|
56
|
-
catch { }
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
export async function runCommandDirect(name, args, authUser, hostname, mode, cwd, shell, stdin, env) {
|
|
61
|
-
const assignRe = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/;
|
|
62
|
-
const invocation = [name, ...args];
|
|
63
|
-
let assignCount = 0;
|
|
64
|
-
while (assignCount < invocation.length && assignRe.test(invocation[assignCount])) {
|
|
65
|
-
assignCount += 1;
|
|
66
|
-
}
|
|
67
|
-
if (assignCount > 0) {
|
|
68
|
-
const assignments = invocation.slice(0, assignCount).map((token) => token.match(assignRe));
|
|
69
|
-
const remaining = invocation.slice(assignCount);
|
|
70
|
-
const restored = [];
|
|
71
|
-
for (const [, key, value] of assignments) {
|
|
72
|
-
restored.push([key, env.vars[key]]);
|
|
73
|
-
env.vars[key] = value;
|
|
74
|
-
}
|
|
75
|
-
if (remaining.length === 0) {
|
|
76
|
-
return { exitCode: 0 };
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
const result = await runCommandDirect(remaining[0], remaining.slice(1), authUser, hostname, mode, cwd, shell, stdin, env);
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
for (const [key, value] of restored) {
|
|
84
|
-
if (value === undefined)
|
|
85
|
-
delete env.vars[key];
|
|
86
|
-
else
|
|
87
|
-
env.vars[key] = value;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const aliasVal = env.vars[`__alias_${name}`];
|
|
92
|
-
if (aliasVal) {
|
|
93
|
-
return runCommand(`${aliasVal} ${args.join(" ")}`, authUser, hostname, mode, cwd, shell, stdin, env);
|
|
94
|
-
}
|
|
95
|
-
const mod = resolveModule(name);
|
|
96
|
-
if (!mod) {
|
|
97
|
-
const vfsBinary = resolveVfsBinary(name, env, shell, authUser);
|
|
98
|
-
if (vfsBinary) {
|
|
99
|
-
const stubContent = shell.vfs.readFile(vfsBinary);
|
|
100
|
-
const builtinMatch = stubContent.match(/exec\s+builtin\s+(\S+)/);
|
|
101
|
-
if (builtinMatch) {
|
|
102
|
-
const builtinMod = resolveModule(builtinMatch[1]);
|
|
103
|
-
if (builtinMod) {
|
|
104
|
-
return await builtinMod.run({
|
|
105
|
-
authUser,
|
|
106
|
-
hostname,
|
|
107
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
108
|
-
rawInput: [name, ...args].join(" "),
|
|
109
|
-
mode,
|
|
110
|
-
args,
|
|
111
|
-
stdin,
|
|
112
|
-
cwd,
|
|
113
|
-
shell,
|
|
114
|
-
env,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const shMod = resolveModule("sh");
|
|
119
|
-
if (shMod) {
|
|
120
|
-
return await shMod.run({
|
|
121
|
-
authUser,
|
|
122
|
-
hostname,
|
|
123
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
124
|
-
rawInput: `sh -c ${JSON.stringify(stubContent)}`,
|
|
125
|
-
mode,
|
|
126
|
-
args: ["-c", stubContent, "--", ...args],
|
|
127
|
-
stdin,
|
|
128
|
-
cwd,
|
|
129
|
-
shell,
|
|
130
|
-
env,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return { stderr: `${name}: command not found`, exitCode: 127 };
|
|
135
|
-
}
|
|
136
|
-
try {
|
|
137
|
-
return await mod.run({
|
|
138
|
-
authUser,
|
|
139
|
-
hostname,
|
|
140
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
141
|
-
rawInput: [name, ...args].join(" "),
|
|
142
|
-
mode,
|
|
143
|
-
args,
|
|
144
|
-
stdin,
|
|
145
|
-
cwd,
|
|
146
|
-
shell,
|
|
147
|
-
env,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
return {
|
|
152
|
-
stderr: error instanceof Error ? error.message : "Command failed",
|
|
153
|
-
exitCode: 1,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
export async function runCommand(rawInput, authUser, hostname, mode, cwd, shell, stdin, env) {
|
|
158
|
-
const trimmed = rawInput.trim();
|
|
159
|
-
if (trimmed.length === 0)
|
|
160
|
-
return { exitCode: 0 };
|
|
161
|
-
const shellEnv = env ?? makeDefaultEnv(authUser, hostname);
|
|
162
|
-
const rawTokens = tokenizeCommand(trimmed);
|
|
163
|
-
const rawFirstWord = rawTokens[0]?.toLowerCase() ?? "";
|
|
164
|
-
const aliasVal = shellEnv.vars[`__alias_${rawFirstWord}`];
|
|
165
|
-
const aliasExpanded = aliasVal
|
|
166
|
-
? trimmed.replace(rawFirstWord, aliasVal)
|
|
167
|
-
: trimmed;
|
|
168
|
-
// Detect sh-syntax constructs that must be handled by the sh interpreter
|
|
169
|
-
const isShScript = /\bfor\s+\w+\s+in\b/.test(aliasExpanded) ||
|
|
170
|
-
/\bwhile\s+/.test(aliasExpanded) ||
|
|
171
|
-
/\bif\s+/.test(aliasExpanded) ||
|
|
172
|
-
/\w+\s*\(\s*\)\s*\{/.test(aliasExpanded) ||
|
|
173
|
-
/\bfunction\s+\w+/.test(aliasExpanded) ||
|
|
174
|
-
/\(\(\s*.+\s*\)\)/.test(aliasExpanded);
|
|
175
|
-
const hasOperators = /(?<![|&])[|](?![|])/.test(aliasExpanded) ||
|
|
176
|
-
aliasExpanded.includes(">") ||
|
|
177
|
-
aliasExpanded.includes("<") ||
|
|
178
|
-
aliasExpanded.includes("&&") ||
|
|
179
|
-
aliasExpanded.includes("||") ||
|
|
180
|
-
aliasExpanded.includes(";");
|
|
181
|
-
if ((isShScript && rawFirstWord !== "sh" && rawFirstWord !== "bash") || hasOperators) {
|
|
182
|
-
// sh-syntax: route through sh interpreter to handle for/while/functions
|
|
183
|
-
if (isShScript && rawFirstWord !== "sh" && rawFirstWord !== "bash") {
|
|
184
|
-
const shMod = resolveModule("sh");
|
|
185
|
-
if (shMod) {
|
|
186
|
-
return await shMod.run({
|
|
187
|
-
authUser, hostname,
|
|
188
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
189
|
-
rawInput: aliasExpanded,
|
|
190
|
-
mode,
|
|
191
|
-
args: ["-c", aliasExpanded],
|
|
192
|
-
stdin: undefined,
|
|
193
|
-
cwd,
|
|
194
|
-
shell,
|
|
195
|
-
env: shellEnv,
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
const script = parseScript(aliasExpanded);
|
|
200
|
-
if (!script.isValid)
|
|
201
|
-
return { stderr: script.error || "Syntax error", exitCode: 1 };
|
|
202
|
-
try {
|
|
203
|
-
return await executeStatements(script.statements, authUser, hostname, mode, cwd, shell, shellEnv);
|
|
204
|
-
}
|
|
205
|
-
catch (error) {
|
|
206
|
-
return {
|
|
207
|
-
stderr: error instanceof Error ? error.message : "Execution failed",
|
|
208
|
-
exitCode: 1,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
const expanded = await expandAsync(aliasExpanded, shellEnv.vars, shellEnv.lastExitCode, (sub) => runCommand(sub, authUser, hostname, mode, cwd, shell, undefined, shellEnv).then((r) => r.stdout ?? ""));
|
|
213
|
-
const parts = tokenizeCommand(expanded.trim());
|
|
214
|
-
if (parts.length === 0)
|
|
215
|
-
return { exitCode: 0 };
|
|
216
|
-
const assignRe = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/;
|
|
217
|
-
if (assignRe.test(parts[0])) {
|
|
218
|
-
return runCommandDirect(parts[0], parts.slice(1), authUser, hostname, mode, cwd, shell, stdin, shellEnv);
|
|
219
|
-
}
|
|
220
|
-
const commandName = parts[0]?.toLowerCase() ?? "";
|
|
221
|
-
// Apply brace expansion to each arg token
|
|
222
|
-
const args = parts.slice(1).flatMap(expandBraces);
|
|
223
|
-
const mod = resolveModule(commandName);
|
|
224
|
-
if (!mod) {
|
|
225
|
-
const vfsBinary = resolveVfsBinary(commandName, shellEnv, shell, authUser);
|
|
226
|
-
if (vfsBinary) {
|
|
227
|
-
const stubContent = shell.vfs.readFile(vfsBinary);
|
|
228
|
-
const builtinMatch = stubContent.match(/exec\s+builtin\s+(\S+)/);
|
|
229
|
-
if (builtinMatch) {
|
|
230
|
-
const builtinName = builtinMatch[1];
|
|
231
|
-
const builtinMod = resolveModule(builtinName);
|
|
232
|
-
if (builtinMod) {
|
|
233
|
-
return await builtinMod.run({
|
|
234
|
-
authUser,
|
|
235
|
-
hostname,
|
|
236
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
237
|
-
rawInput: [commandName, ...args].join(" "),
|
|
238
|
-
mode,
|
|
239
|
-
args,
|
|
240
|
-
stdin,
|
|
241
|
-
cwd,
|
|
242
|
-
shell,
|
|
243
|
-
env: shellEnv,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
const shMod = resolveModule("sh");
|
|
248
|
-
if (shMod) {
|
|
249
|
-
return await shMod.run({
|
|
250
|
-
authUser,
|
|
251
|
-
hostname,
|
|
252
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
253
|
-
rawInput: `sh -c ${JSON.stringify(stubContent)}`,
|
|
254
|
-
mode,
|
|
255
|
-
args: ["-c", stubContent, "--", ...args],
|
|
256
|
-
stdin,
|
|
257
|
-
cwd,
|
|
258
|
-
shell,
|
|
259
|
-
env: shellEnv,
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return { stderr: `${commandName}: command not found`, exitCode: 127 };
|
|
264
|
-
}
|
|
265
|
-
try {
|
|
266
|
-
return await mod.run({
|
|
267
|
-
authUser,
|
|
268
|
-
hostname,
|
|
269
|
-
activeSessions: shell.users.listActiveSessions(),
|
|
270
|
-
rawInput: expanded,
|
|
271
|
-
mode,
|
|
272
|
-
args,
|
|
273
|
-
stdin,
|
|
274
|
-
cwd,
|
|
275
|
-
shell,
|
|
276
|
-
env: shellEnv,
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
catch (error) {
|
|
280
|
-
return {
|
|
281
|
-
stderr: error instanceof Error ? error.message : "Command failed",
|
|
282
|
-
exitCode: 1,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sed.d.ts","sourceRoot":"","sources":["sed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WA0DxB,CAAC"}
|
package/src/commands/sed.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { getFlag, ifFlag } from "./command-helpers";
|
|
2
|
-
import { resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Stream editor for filtering and transforming text lines.
|
|
5
|
-
* @category text
|
|
6
|
-
* @params ["-e <expr> [file]", "s/pattern/replace/[g]"]
|
|
7
|
-
*/
|
|
8
|
-
export const sedCommand = {
|
|
9
|
-
name: "sed",
|
|
10
|
-
description: "Stream editor for filtering and transforming text",
|
|
11
|
-
category: "text",
|
|
12
|
-
params: ["-e <expr> [file]", "s/pattern/replace/[g]"],
|
|
13
|
-
run: ({ authUser, shell, cwd, args, stdin }) => {
|
|
14
|
-
const inPlace = ifFlag(args, ["-i"]);
|
|
15
|
-
const expr = getFlag(args, ["-e"]) ??
|
|
16
|
-
args.find((a) => !a.startsWith("-"));
|
|
17
|
-
const fileArg = args.filter((a) => !a.startsWith("-") && a !== expr).pop();
|
|
18
|
-
if (!expr)
|
|
19
|
-
return { stderr: "sed: no expression", exitCode: 1 };
|
|
20
|
-
let content = stdin ?? "";
|
|
21
|
-
if (fileArg) {
|
|
22
|
-
const p = resolvePath(cwd, fileArg);
|
|
23
|
-
try {
|
|
24
|
-
content = shell.vfs.readFile(p);
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return {
|
|
28
|
-
stderr: `sed: ${fileArg}: No such file or directory`,
|
|
29
|
-
exitCode: 1,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// Parse s/from/to/[g]
|
|
34
|
-
const sMatch = expr.match(/^s([^a-zA-Z0-9])(.+?)\1(.*?)\1([gi]*)$/);
|
|
35
|
-
if (!sMatch)
|
|
36
|
-
return { stderr: `sed: unrecognized command: ${expr}`, exitCode: 1 };
|
|
37
|
-
const [, , from, to, flags] = sMatch;
|
|
38
|
-
const regexFlags = (flags ?? "").includes("i")
|
|
39
|
-
? "gi"
|
|
40
|
-
: (flags ?? "").includes("g")
|
|
41
|
-
? "g"
|
|
42
|
-
: "";
|
|
43
|
-
let regex;
|
|
44
|
-
try {
|
|
45
|
-
regex = new RegExp(from, regexFlags || "");
|
|
46
|
-
}
|
|
47
|
-
catch (_e) {
|
|
48
|
-
return { stderr: `sed: invalid regex: ${from}`, exitCode: 1 };
|
|
49
|
-
}
|
|
50
|
-
const result = (flags ?? "").includes("g") || regexFlags.includes("g")
|
|
51
|
-
? content.replace(regex, to ?? "")
|
|
52
|
-
: content.replace(regex, to ?? "");
|
|
53
|
-
if (inPlace && fileArg) {
|
|
54
|
-
const p = resolvePath(cwd, fileArg);
|
|
55
|
-
shell.writeFileAsUser(authUser, p, result);
|
|
56
|
-
return { exitCode: 0 };
|
|
57
|
-
}
|
|
58
|
-
return { stdout: result, exitCode: 0 };
|
|
59
|
-
},
|
|
60
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seq.d.ts","sourceRoot":"","sources":["seq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,0FAA0F;AAC1F,eAAO,MAAM,UAAU,EAAE,WAuCxB,CAAC"}
|