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
package/src/commands/diff.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { resolvePath } from "./helpers";
|
|
2
|
-
/**
|
|
3
|
-
* Compare files line-by-line and print differing lines.
|
|
4
|
-
* @category text
|
|
5
|
-
* @params ["<file1> <file2>"]
|
|
6
|
-
*/
|
|
7
|
-
export const diffCommand = {
|
|
8
|
-
name: "diff",
|
|
9
|
-
description: "Compare files line by line",
|
|
10
|
-
category: "text",
|
|
11
|
-
params: ["<file1> <file2>"],
|
|
12
|
-
run: ({ shell, cwd, args }) => {
|
|
13
|
-
const [f1, f2] = args;
|
|
14
|
-
if (!f1 || !f2)
|
|
15
|
-
return { stderr: "diff: missing operand", exitCode: 1 };
|
|
16
|
-
const p1 = resolvePath(cwd, f1);
|
|
17
|
-
const p2 = resolvePath(cwd, f2);
|
|
18
|
-
let a, b;
|
|
19
|
-
try {
|
|
20
|
-
a = shell.vfs.readFile(p1).split("\n");
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return { stderr: `diff: ${f1}: No such file or directory`, exitCode: 2 };
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
b = shell.vfs.readFile(p2).split("\n");
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return { stderr: `diff: ${f2}: No such file or directory`, exitCode: 2 };
|
|
30
|
-
}
|
|
31
|
-
const out = [];
|
|
32
|
-
const max = Math.max(a.length, b.length);
|
|
33
|
-
for (let i = 0; i < max; i++) {
|
|
34
|
-
const la = a[i];
|
|
35
|
-
const lb = b[i];
|
|
36
|
-
if (la !== lb) {
|
|
37
|
-
if (la !== undefined)
|
|
38
|
-
out.push(`< ${la}`);
|
|
39
|
-
if (lb !== undefined)
|
|
40
|
-
out.push(`> ${lb}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return { stdout: out.join("\n"), exitCode: out.length > 0 ? 1 : 0 };
|
|
44
|
-
},
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dpkg.d.ts","sourceRoot":"","sources":["dpkg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WA0HzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WA8C9B,CAAC"}
|
package/src/commands/dpkg.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { ifFlag, parseArgs } from "./command-helpers";
|
|
2
|
-
import { getPackageManager } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* dpkg compatibility command (query/remove/list) backed by the virtual package manager.
|
|
5
|
-
* @category package
|
|
6
|
-
* @params ["[-l] [-s pkg] [-L pkg] [-i pkg] [--remove pkg]"]
|
|
7
|
-
*/
|
|
8
|
-
export const dpkgCommand = {
|
|
9
|
-
name: "dpkg",
|
|
10
|
-
description: "Debian package manager low-level tool",
|
|
11
|
-
category: "package",
|
|
12
|
-
params: ["[-l] [-s pkg] [-L pkg] [-i pkg] [--remove pkg]"],
|
|
13
|
-
run: ({ args, authUser, shell }) => {
|
|
14
|
-
const pm = getPackageManager(shell);
|
|
15
|
-
if (!pm)
|
|
16
|
-
return { stderr: "dpkg: package manager not initialised", exitCode: 1 };
|
|
17
|
-
const listFlag = ifFlag(args, ["-l", "--list"]);
|
|
18
|
-
const statusFlag = ifFlag(args, ["-s", "--status"]);
|
|
19
|
-
const listFilesFlag = ifFlag(args, ["-L", "--listfiles"]);
|
|
20
|
-
const removeFlag = ifFlag(args, ["-r", "--remove"]);
|
|
21
|
-
const purgeFlag = ifFlag(args, ["-P", "--purge"]);
|
|
22
|
-
const { positionals } = parseArgs(args, {
|
|
23
|
-
flags: [
|
|
24
|
-
"-l",
|
|
25
|
-
"--list",
|
|
26
|
-
"-s",
|
|
27
|
-
"--status",
|
|
28
|
-
"-L",
|
|
29
|
-
"--listfiles",
|
|
30
|
-
"-r",
|
|
31
|
-
"--remove",
|
|
32
|
-
"-P",
|
|
33
|
-
"--purge",
|
|
34
|
-
],
|
|
35
|
-
});
|
|
36
|
-
if (listFlag) {
|
|
37
|
-
const pkgList = pm.listInstalled();
|
|
38
|
-
if (pkgList.length === 0) {
|
|
39
|
-
return {
|
|
40
|
-
stdout: [
|
|
41
|
-
"Desired=Unknown/Install/Remove/Purge/Hold",
|
|
42
|
-
"|Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend",
|
|
43
|
-
"|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)",
|
|
44
|
-
"||/ Name Version Architecture Description",
|
|
45
|
-
"+++-==============-===============-============-========================================",
|
|
46
|
-
"(no packages installed)",
|
|
47
|
-
].join("\n"),
|
|
48
|
-
exitCode: 0,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const header = [
|
|
52
|
-
"Desired=Unknown/Install/Remove/Purge/Hold",
|
|
53
|
-
"|Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend",
|
|
54
|
-
"|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)",
|
|
55
|
-
"||/ Name Version Architecture Description",
|
|
56
|
-
"+++-==============-===============-============-========================================",
|
|
57
|
-
];
|
|
58
|
-
const rows = pkgList.map((p) => {
|
|
59
|
-
const name = p.name.padEnd(14).slice(0, 14);
|
|
60
|
-
const ver = p.version.padEnd(15).slice(0, 15);
|
|
61
|
-
const arch = p.architecture.padEnd(12).slice(0, 12);
|
|
62
|
-
const desc = (p.description || "").slice(0, 40);
|
|
63
|
-
return `ii ${name} ${ver} ${arch} ${desc}`;
|
|
64
|
-
});
|
|
65
|
-
return { stdout: [...header, ...rows].join("\n"), exitCode: 0 };
|
|
66
|
-
}
|
|
67
|
-
if (statusFlag) {
|
|
68
|
-
const pkgName = positionals[0];
|
|
69
|
-
if (!pkgName)
|
|
70
|
-
return { stderr: "dpkg: -s needs a package name", exitCode: 1 };
|
|
71
|
-
const info = pm.show(pkgName);
|
|
72
|
-
if (!info)
|
|
73
|
-
return {
|
|
74
|
-
stderr: `dpkg-query: package '${pkgName}' is not installed and no information is available`,
|
|
75
|
-
exitCode: 1,
|
|
76
|
-
};
|
|
77
|
-
return { stdout: info, exitCode: 0 };
|
|
78
|
-
}
|
|
79
|
-
if (listFilesFlag) {
|
|
80
|
-
const pkgName = positionals[0];
|
|
81
|
-
if (!pkgName)
|
|
82
|
-
return { stderr: "dpkg: -L needs a package name", exitCode: 1 };
|
|
83
|
-
const installed = pm.listInstalled().find((p) => p.name === pkgName);
|
|
84
|
-
if (!installed)
|
|
85
|
-
return {
|
|
86
|
-
stderr: `dpkg-query: package '${pkgName}' is not installed`,
|
|
87
|
-
exitCode: 1,
|
|
88
|
-
};
|
|
89
|
-
if (installed.files.length === 0)
|
|
90
|
-
return { stdout: "/.keep", exitCode: 0 };
|
|
91
|
-
return { stdout: installed.files.join("\n"), exitCode: 0 };
|
|
92
|
-
}
|
|
93
|
-
if (removeFlag || purgeFlag) {
|
|
94
|
-
if (authUser !== "root")
|
|
95
|
-
return {
|
|
96
|
-
stderr: "dpkg: error: requested operation requires superuser privilege",
|
|
97
|
-
exitCode: 2,
|
|
98
|
-
};
|
|
99
|
-
if (positionals.length === 0)
|
|
100
|
-
return { stderr: "dpkg: error: need an action option", exitCode: 2 };
|
|
101
|
-
const { output, exitCode } = pm.remove(positionals, { purge: purgeFlag });
|
|
102
|
-
return { stdout: output || undefined, exitCode };
|
|
103
|
-
}
|
|
104
|
-
// Default: show help
|
|
105
|
-
return {
|
|
106
|
-
stdout: [
|
|
107
|
-
"Usage: dpkg [<option>...] <command>",
|
|
108
|
-
"",
|
|
109
|
-
"Commands:",
|
|
110
|
-
" -l, --list List packages matching given pattern",
|
|
111
|
-
" -s, --status <pkg>... Report status of specified package",
|
|
112
|
-
" -L, --listfiles <pkg>... List files owned by package",
|
|
113
|
-
" -r, --remove <pkg>... Remove <pkg> but leave its configuration",
|
|
114
|
-
" -P, --purge <pkg>... Remove <pkg> and its configuration",
|
|
115
|
-
].join("\n"),
|
|
116
|
-
exitCode: 0,
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
export const dpkgQueryCommand = {
|
|
121
|
-
name: "dpkg-query",
|
|
122
|
-
description: "Show information about installed packages",
|
|
123
|
-
category: "package",
|
|
124
|
-
params: ["-W [pkg] | -l [pattern]"],
|
|
125
|
-
run: ({ args, shell }) => {
|
|
126
|
-
const pm = getPackageManager(shell);
|
|
127
|
-
if (!pm)
|
|
128
|
-
return {
|
|
129
|
-
stderr: "dpkg-query: package manager not initialised",
|
|
130
|
-
exitCode: 1,
|
|
131
|
-
};
|
|
132
|
-
const listFlag = ifFlag(args, ["-l"]);
|
|
133
|
-
const showFlag = ifFlag(args, ["-W", "--show"]);
|
|
134
|
-
const { positionals } = parseArgs(args, {
|
|
135
|
-
flags: ["-l", "-W", "--show"],
|
|
136
|
-
});
|
|
137
|
-
if (listFlag || showFlag) {
|
|
138
|
-
const pkgList = pm.listInstalled();
|
|
139
|
-
const pattern = positionals[0];
|
|
140
|
-
const filtered = pattern
|
|
141
|
-
? pkgList.filter((p) => p.name.includes(pattern))
|
|
142
|
-
: pkgList;
|
|
143
|
-
if (showFlag) {
|
|
144
|
-
return {
|
|
145
|
-
stdout: filtered.map((p) => `${p.name}\t${p.version}`).join("\n"),
|
|
146
|
-
exitCode: 0,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
const rows = filtered.map((p) => {
|
|
150
|
-
const name = p.name.padEnd(14).slice(0, 14);
|
|
151
|
-
const ver = p.version.padEnd(15).slice(0, 15);
|
|
152
|
-
return `ii ${name} ${ver} amd64 ${(p.description || "").slice(0, 40)}`;
|
|
153
|
-
});
|
|
154
|
-
return {
|
|
155
|
-
stdout: rows.join("\n") || "(no packages match)",
|
|
156
|
-
exitCode: 0,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
return { stderr: "dpkg-query: need a flag (-l, -W)", exitCode: 1 };
|
|
160
|
-
},
|
|
161
|
-
};
|
package/src/commands/du.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"du.d.ts","sourceRoot":"","sources":["du.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WA8CvB,CAAC"}
|
package/src/commands/du.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ifFlag } from "./command-helpers";
|
|
2
|
-
import { resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Estimate file and directory space usage.
|
|
5
|
-
* @category system
|
|
6
|
-
* @params ["[-h] [-s] [path]"]
|
|
7
|
-
*/
|
|
8
|
-
export const duCommand = {
|
|
9
|
-
name: "du",
|
|
10
|
-
description: "Estimate file space usage",
|
|
11
|
-
category: "system",
|
|
12
|
-
params: ["[-h] [-s] [path]"],
|
|
13
|
-
run: ({ shell, cwd, args }) => {
|
|
14
|
-
const human = ifFlag(args, ["-h"]);
|
|
15
|
-
const summary = ifFlag(args, ["-s"]);
|
|
16
|
-
const target = args.find((a) => !a.startsWith("-")) ?? ".";
|
|
17
|
-
const p = resolvePath(cwd, target);
|
|
18
|
-
const fmt = (b) => human ? `${(b / 1024).toFixed(1)}K` : String(Math.ceil(b / 1024));
|
|
19
|
-
if (!shell.vfs.exists(p))
|
|
20
|
-
return {
|
|
21
|
-
stderr: `du: ${target}: No such file or directory`,
|
|
22
|
-
exitCode: 1,
|
|
23
|
-
};
|
|
24
|
-
if (summary || shell.vfs.stat(p).type === "file") {
|
|
25
|
-
return {
|
|
26
|
-
stdout: `${fmt(shell.vfs.getUsageBytes(p))}\t${target}`,
|
|
27
|
-
exitCode: 0,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const lines = [];
|
|
31
|
-
const walk = (dir, rel) => {
|
|
32
|
-
let total = 0;
|
|
33
|
-
for (const e of shell.vfs.list(dir)) {
|
|
34
|
-
const full = `${dir}/${e}`, r = `${rel}/${e}`;
|
|
35
|
-
const st = shell.vfs.stat(full);
|
|
36
|
-
if (st.type === "directory")
|
|
37
|
-
total += walk(full, r);
|
|
38
|
-
else {
|
|
39
|
-
total += st.size;
|
|
40
|
-
if (!summary)
|
|
41
|
-
lines.push(`${fmt(st.size)}\t${r}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
lines.push(`${fmt(total)}\t${rel}`);
|
|
45
|
-
return total;
|
|
46
|
-
};
|
|
47
|
-
walk(p, target);
|
|
48
|
-
return { stdout: lines.join("\n"), exitCode: 0 };
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["echo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAuBrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WA6BzB,CAAC"}
|
package/src/commands/echo.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { parseArgs } from "./command-helpers";
|
|
2
|
-
import { expandSync } from "../utils/expand";
|
|
3
|
-
/**
|
|
4
|
-
* Expand escape sequences for `echo -e`.
|
|
5
|
-
* Handles \n \t \r \\ \a \b \f \v and \0NNN (octal).
|
|
6
|
-
*/
|
|
7
|
-
function expandEscapes(text) {
|
|
8
|
-
return text
|
|
9
|
-
.replace(/\\n/g, "\n")
|
|
10
|
-
.replace(/\\t/g, "\t")
|
|
11
|
-
.replace(/\\r/g, "\r")
|
|
12
|
-
.replace(/\\\\/g, "\\")
|
|
13
|
-
.replace(/\\a/g, "\x07")
|
|
14
|
-
.replace(/\\b/g, "\x08")
|
|
15
|
-
.replace(/\\f/g, "\x0C")
|
|
16
|
-
.replace(/\\v/g, "\x0B")
|
|
17
|
-
.replace(/\\0(\d{1,3})/g, (_, oct) => String.fromCharCode(parseInt(oct, 8)));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Echo text to stdout with shell-style expansion and escape support.
|
|
21
|
-
* @category shell
|
|
22
|
-
* @params ["[-n] [-e] [text...]"]
|
|
23
|
-
*/
|
|
24
|
-
export const echoCommand = {
|
|
25
|
-
name: "echo",
|
|
26
|
-
description: "Display text",
|
|
27
|
-
category: "shell",
|
|
28
|
-
params: ["[-n] [-e] [text...]"],
|
|
29
|
-
run: ({ args, stdin, env }) => {
|
|
30
|
-
const { flags, positionals } = parseArgs(args, {
|
|
31
|
-
flags: ["-n", "-e", "-E"],
|
|
32
|
-
});
|
|
33
|
-
const noNewline = flags.has("-n");
|
|
34
|
-
const escapes = flags.has("-e");
|
|
35
|
-
const rawText = positionals.length > 0 ? positionals.join(" ") : (stdin ?? "");
|
|
36
|
-
// Full expansion: $? ${#VAR} $((expr)) ~ ${VAR:-def} $VAR etc.
|
|
37
|
-
// $(cmd) is already resolved upstream by runCommand before echo.run is called.
|
|
38
|
-
const expanded = expandSync(rawText, env?.vars ?? {}, env?.lastExitCode ?? 0);
|
|
39
|
-
const text = escapes ? expandEscapes(expanded) : expanded;
|
|
40
|
-
return {
|
|
41
|
-
stdout: noNewline ? text : `${text}\n`,
|
|
42
|
-
exitCode: 0,
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["env.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WAcxB,CAAC"}
|
package/src/commands/env.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Print environment variables for the current session.
|
|
3
|
-
* @category shell
|
|
4
|
-
* @params []
|
|
5
|
-
*/
|
|
6
|
-
export const envCommand = {
|
|
7
|
-
name: "env",
|
|
8
|
-
description: "Print environment variables",
|
|
9
|
-
category: "shell",
|
|
10
|
-
params: [],
|
|
11
|
-
run: ({ env, authUser }) => {
|
|
12
|
-
const vars = { ...env.vars, USER: authUser, HOME: `/home/${authUser}` };
|
|
13
|
-
return {
|
|
14
|
-
stdout: Object.entries(vars)
|
|
15
|
-
.map(([k, v]) => `${k}=${v}`)
|
|
16
|
-
.join("\n"),
|
|
17
|
-
exitCode: 0,
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["exit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAUzB,CAAC"}
|
package/src/commands/exit.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exit the current shell session (closeSession flag).
|
|
3
|
-
* @category shell
|
|
4
|
-
* @params ["[code]"]
|
|
5
|
-
*/
|
|
6
|
-
export const exitCommand = {
|
|
7
|
-
name: "exit",
|
|
8
|
-
aliases: ["bye"],
|
|
9
|
-
description: "Exit the shell session",
|
|
10
|
-
category: "shell",
|
|
11
|
-
params: ["[code]"],
|
|
12
|
-
run: ({ args }) => ({
|
|
13
|
-
closeSession: true,
|
|
14
|
-
exitCode: parseInt(args[0] ?? "0", 10) || 0,
|
|
15
|
-
}),
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,WA0B3B,CAAC"}
|
package/src/commands/export.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Set or display shell environment variables for child processes.
|
|
3
|
-
* @category shell
|
|
4
|
-
* @params ["[VAR=value]"]
|
|
5
|
-
*/
|
|
6
|
-
export const exportCommand = {
|
|
7
|
-
name: "export",
|
|
8
|
-
description: "Set shell environment variable",
|
|
9
|
-
category: "shell",
|
|
10
|
-
params: ["[VAR=value]"],
|
|
11
|
-
run: ({ args, env }) => {
|
|
12
|
-
// export -p or export with no args — list all exported vars
|
|
13
|
-
if (args.length === 0 || (args.length === 1 && args[0] === "-p")) {
|
|
14
|
-
const out = Object.entries(env.vars)
|
|
15
|
-
.filter(([k]) => k && /^[A-Za-z_][A-Za-z0-9_]*$/.test(k))
|
|
16
|
-
.map(([k, v]) => `declare -x ${k}="${v}"`)
|
|
17
|
-
.join("\n");
|
|
18
|
-
return { stdout: out ? `${out}\n` : "", exitCode: 0 };
|
|
19
|
-
}
|
|
20
|
-
for (const arg of args.filter((a) => a !== "-p")) {
|
|
21
|
-
if (arg.includes("=")) {
|
|
22
|
-
const eq = arg.indexOf("=");
|
|
23
|
-
const name = arg.slice(0, eq);
|
|
24
|
-
const value = arg.slice(eq + 1);
|
|
25
|
-
env.vars[name] = value;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
// mark existing as exported (already is)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return { exitCode: 0 };
|
|
32
|
-
},
|
|
33
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WA0DzB,CAAC"}
|
package/src/commands/find.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { getFlag } from "./command-helpers";
|
|
2
|
-
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Find files and directories by name and type with minimal pattern support.
|
|
5
|
-
* @category files
|
|
6
|
-
* @params ["[path] [-name <pattern>] [-type f|d]"]
|
|
7
|
-
*/
|
|
8
|
-
export const findCommand = {
|
|
9
|
-
name: "find",
|
|
10
|
-
description: "Search for files",
|
|
11
|
-
category: "files",
|
|
12
|
-
params: ["[path] [-name <pattern>] [-type f|d]"],
|
|
13
|
-
run: ({ authUser, shell, cwd, args }) => {
|
|
14
|
-
const namePattern = getFlag(args, ["-name"]);
|
|
15
|
-
const typeFilter = getFlag(args, ["-type"]);
|
|
16
|
-
const positionals = args.filter((a) => !a.startsWith("-") && a !== namePattern && a !== typeFilter);
|
|
17
|
-
const rootArg = positionals[0] ?? ".";
|
|
18
|
-
const rootPath = resolvePath(cwd, rootArg);
|
|
19
|
-
try {
|
|
20
|
-
assertPathAccess(authUser, rootPath, "find");
|
|
21
|
-
if (!shell.vfs.exists(rootPath)) {
|
|
22
|
-
return {
|
|
23
|
-
stderr: `find: ${rootArg}: No such file or directory`,
|
|
24
|
-
exitCode: 1,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
30
|
-
return { stderr: `find: ${msg}`, exitCode: 1 };
|
|
31
|
-
}
|
|
32
|
-
const nameRegex = namePattern
|
|
33
|
-
? new RegExp(`^${namePattern.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".")}$`)
|
|
34
|
-
: null;
|
|
35
|
-
const results = [];
|
|
36
|
-
const walk = (currentPath, display) => {
|
|
37
|
-
const stat = shell.vfs.stat(currentPath);
|
|
38
|
-
const matchesType = !typeFilter ||
|
|
39
|
-
(typeFilter === "f" && stat.type === "file") ||
|
|
40
|
-
(typeFilter === "d" && stat.type === "directory");
|
|
41
|
-
const matchesName = !nameRegex || nameRegex.test(currentPath.split("/").pop() ?? "");
|
|
42
|
-
if (matchesType && matchesName)
|
|
43
|
-
results.push(display);
|
|
44
|
-
if (stat.type === "directory") {
|
|
45
|
-
for (const entry of shell.vfs.list(currentPath)) {
|
|
46
|
-
const full = `${currentPath}/${entry}`;
|
|
47
|
-
const disp = `${display}/${entry}`;
|
|
48
|
-
walk(full, disp);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
walk(rootPath, rootArg);
|
|
53
|
-
return { stdout: results.join("\n"), exitCode: 0 };
|
|
54
|
-
},
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"free.d.ts","sourceRoot":"","sources":["free.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAqCzB,CAAC"}
|
package/src/commands/free.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as os from "node:os";
|
|
2
|
-
import { ifFlag } from "./command-helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Display memory usage information (human / MB / GB options).
|
|
5
|
-
* @category system
|
|
6
|
-
* @params ["[-h] [-m] [-g]"]
|
|
7
|
-
*/
|
|
8
|
-
export const freeCommand = {
|
|
9
|
-
name: "free",
|
|
10
|
-
description: "Display amount of free and used memory",
|
|
11
|
-
category: "system",
|
|
12
|
-
params: ["[-h] [-m] [-g]"],
|
|
13
|
-
run: ({ args }) => {
|
|
14
|
-
const human = ifFlag(args, ["-h", "--human"]);
|
|
15
|
-
const mb = ifFlag(args, ["-m"]);
|
|
16
|
-
const gb = ifFlag(args, ["-g"]);
|
|
17
|
-
const osTotalB = os.totalmem();
|
|
18
|
-
const osFreeB = os.freemem();
|
|
19
|
-
const usedB = osTotalB - osFreeB;
|
|
20
|
-
const sharedB = Math.floor(osTotalB * 0.02);
|
|
21
|
-
const buffersB = Math.floor(osTotalB * 0.05);
|
|
22
|
-
const availableB = Math.floor(osFreeB * 0.95);
|
|
23
|
-
const swapB = Math.floor(osTotalB * 0.5);
|
|
24
|
-
const fmt = (bytes) => {
|
|
25
|
-
if (human) {
|
|
26
|
-
if (bytes >= 1024 * 1024 * 1024)
|
|
27
|
-
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)}G`;
|
|
28
|
-
if (bytes >= 1024 * 1024)
|
|
29
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)}M`;
|
|
30
|
-
return `${(bytes / 1024).toFixed(1)}K`;
|
|
31
|
-
}
|
|
32
|
-
if (gb)
|
|
33
|
-
return String(Math.floor(bytes / (1024 * 1024 * 1024)));
|
|
34
|
-
if (mb)
|
|
35
|
-
return String(Math.floor(bytes / (1024 * 1024)));
|
|
36
|
-
return String(Math.floor(bytes / 1024));
|
|
37
|
-
};
|
|
38
|
-
const header = ` total used free shared buff/cache available`;
|
|
39
|
-
const memRow = `Mem: ${fmt(osTotalB).padStart(12)} ${fmt(usedB).padStart(11)} ${fmt(osFreeB).padStart(11)} ${fmt(sharedB).padStart(11)} ${fmt(buffersB).padStart(11)} ${fmt(availableB).padStart(11)}`;
|
|
40
|
-
const swapRow = `Swap: ${fmt(swapB).padStart(12)} ${fmt(0).padStart(11)} ${fmt(swapB).padStart(11)}`;
|
|
41
|
-
return { stdout: [header, memRow, swapRow].join("\n"), exitCode: 0 };
|
|
42
|
-
},
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep.d.ts","sourceRoot":"","sources":["grep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WA0GzB,CAAC"}
|
package/src/commands/grep.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { parseArgs } from "./command-helpers";
|
|
2
|
-
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Search for a regex pattern in files or stdin with common flags.
|
|
5
|
-
* @category text
|
|
6
|
-
* @params ["[-i] [-v] [-n] [-r] <pattern> [file...]"]
|
|
7
|
-
*/
|
|
8
|
-
export const grepCommand = {
|
|
9
|
-
name: "grep",
|
|
10
|
-
description: "Search text patterns",
|
|
11
|
-
category: "text",
|
|
12
|
-
params: ["[-i] [-v] [-n] [-r] <pattern> [file...]"],
|
|
13
|
-
run: ({ authUser, shell, cwd, args, stdin }) => {
|
|
14
|
-
const { flags, positionals } = parseArgs(args, {
|
|
15
|
-
flags: ["-i", "-v", "-n", "-r", "-c", "-l", "-L", "-q", "--quiet", "--silent"],
|
|
16
|
-
});
|
|
17
|
-
const caseInsensitive = flags.has("-i");
|
|
18
|
-
const invertMatch = flags.has("-v");
|
|
19
|
-
const showLineNumbers = flags.has("-n");
|
|
20
|
-
const recursive = flags.has("-r");
|
|
21
|
-
const countOnly = flags.has("-c");
|
|
22
|
-
const filesWithMatches = flags.has("-l");
|
|
23
|
-
const quiet = flags.has("-q") || flags.has("--quiet") || flags.has("--silent");
|
|
24
|
-
const pattern = positionals[0];
|
|
25
|
-
const files = positionals.slice(1);
|
|
26
|
-
if (!pattern) {
|
|
27
|
-
return { stderr: "grep: no pattern specified", exitCode: 1 };
|
|
28
|
-
}
|
|
29
|
-
let regex;
|
|
30
|
-
try {
|
|
31
|
-
// No "g" flag — avoids the stateful lastIndex problem with regex.test()
|
|
32
|
-
const regexFlags = caseInsensitive ? "mi" : "m";
|
|
33
|
-
regex = new RegExp(pattern, regexFlags);
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return { stderr: `grep: invalid regex: ${pattern}`, exitCode: 1 };
|
|
37
|
-
}
|
|
38
|
-
const matchLines = (content, prefix = "") => {
|
|
39
|
-
const lines = content.split("\n");
|
|
40
|
-
const out = [];
|
|
41
|
-
for (let i = 0; i < lines.length; i++) {
|
|
42
|
-
const line = lines[i] ?? "";
|
|
43
|
-
const matches = regex.test(line);
|
|
44
|
-
const shouldInclude = invertMatch ? !matches : matches;
|
|
45
|
-
if (shouldInclude) {
|
|
46
|
-
const lineLabel = showLineNumbers ? `${i + 1}:` : "";
|
|
47
|
-
out.push(`${prefix}${lineLabel}${line}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return out;
|
|
51
|
-
};
|
|
52
|
-
const readPaths = (base) => {
|
|
53
|
-
if (!shell.vfs.exists(base))
|
|
54
|
-
return [];
|
|
55
|
-
const stat = shell.vfs.stat(base);
|
|
56
|
-
if (stat.type === "file")
|
|
57
|
-
return [base];
|
|
58
|
-
if (!recursive)
|
|
59
|
-
return [];
|
|
60
|
-
const paths = [];
|
|
61
|
-
const walk = (dir) => {
|
|
62
|
-
for (const entry of shell.vfs.list(dir)) {
|
|
63
|
-
const full = `${dir}/${entry}`;
|
|
64
|
-
const s = shell.vfs.stat(full);
|
|
65
|
-
if (s.type === "file")
|
|
66
|
-
paths.push(full);
|
|
67
|
-
else
|
|
68
|
-
walk(full);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
walk(base);
|
|
72
|
-
return paths;
|
|
73
|
-
};
|
|
74
|
-
const results = [];
|
|
75
|
-
if (files.length === 0) {
|
|
76
|
-
if (!stdin)
|
|
77
|
-
return { stdout: "", exitCode: 1 };
|
|
78
|
-
const matched = matchLines(stdin);
|
|
79
|
-
if (countOnly)
|
|
80
|
-
return { stdout: `${matched.length}\n`, exitCode: matched.length > 0 ? 0 : 1 };
|
|
81
|
-
if (quiet)
|
|
82
|
-
return { exitCode: matched.length > 0 ? 0 : 1 };
|
|
83
|
-
results.push(...matched);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
const resolvedPaths = files.flatMap((f) => {
|
|
87
|
-
const target = resolvePath(cwd, f);
|
|
88
|
-
return readPaths(target).map((p) => ({ file: f, path: p }));
|
|
89
|
-
});
|
|
90
|
-
for (const { file, path: filePath } of resolvedPaths) {
|
|
91
|
-
try {
|
|
92
|
-
assertPathAccess(authUser, filePath, "grep");
|
|
93
|
-
const content = shell.vfs.readFile(filePath);
|
|
94
|
-
const prefix = resolvedPaths.length > 1 ? `${file}:` : "";
|
|
95
|
-
const matched = matchLines(content, prefix);
|
|
96
|
-
if (countOnly) {
|
|
97
|
-
results.push(resolvedPaths.length > 1 ? `${file}:${matched.length}` : String(matched.length));
|
|
98
|
-
}
|
|
99
|
-
else if (filesWithMatches) {
|
|
100
|
-
if (matched.length > 0)
|
|
101
|
-
results.push(file);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
results.push(...matched);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return {
|
|
109
|
-
stderr: `grep: ${file}: No such file or directory`,
|
|
110
|
-
exitCode: 1,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
stdout: results.length > 0 ? `${results.join("\n")}\n` : "",
|
|
117
|
-
exitCode: results.length > 0 ? 0 : 1,
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["groups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,WAW3B,CAAC"}
|
package/src/commands/groups.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Print group memberships for a user.
|
|
3
|
-
* @category system
|
|
4
|
-
* @params ["[user]"]
|
|
5
|
-
*/
|
|
6
|
-
export const groupsCommand = {
|
|
7
|
-
name: "groups",
|
|
8
|
-
description: "Print group memberships",
|
|
9
|
-
category: "system",
|
|
10
|
-
params: ["[user]"],
|
|
11
|
-
run: ({ authUser, shell, args }) => {
|
|
12
|
-
const target = args[0] ?? authUser;
|
|
13
|
-
const isSudo = shell.users.isSudoer(target);
|
|
14
|
-
const grps = isSudo ? `${target} sudo root` : target;
|
|
15
|
-
return { stdout: grps, exitCode: 0 };
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gzip.d.ts","sourceRoot":"","sources":["gzip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,WAgDzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WA0B3B,CAAC"}
|