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,221 +0,0 @@
|
|
|
1
|
-
function toFlagList(flags) {
|
|
2
|
-
return Array.isArray(flags) ? flags : [flags];
|
|
3
|
-
}
|
|
4
|
-
function matchFlagToken(token, flag) {
|
|
5
|
-
if (token === flag) {
|
|
6
|
-
return { matched: true, inlineValue: null };
|
|
7
|
-
}
|
|
8
|
-
// --flag=value style
|
|
9
|
-
const prefix = `${flag}=`;
|
|
10
|
-
if (token.startsWith(prefix)) {
|
|
11
|
-
return { matched: true, inlineValue: token.slice(prefix.length) };
|
|
12
|
-
}
|
|
13
|
-
// Short flag inline value: -f2, -d: (single char flag like -f, -d, -n)
|
|
14
|
-
// Only applies to single-char flags (-X), not long flags (--flag)
|
|
15
|
-
if (flag.length === 2 && flag.startsWith("-") && !flag.startsWith("--")) {
|
|
16
|
-
if (token.startsWith(flag) && token.length > flag.length) {
|
|
17
|
-
return { matched: true, inlineValue: token.slice(flag.length) };
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return { matched: false, inlineValue: null };
|
|
21
|
-
}
|
|
22
|
-
function collectPositionals(args, options = {}) {
|
|
23
|
-
const boolFlags = new Set(options.flags ?? []);
|
|
24
|
-
const valueFlags = new Set(options.flagsWithValue ?? []);
|
|
25
|
-
const positionals = [];
|
|
26
|
-
let passthrough = false;
|
|
27
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
28
|
-
const arg = args[index];
|
|
29
|
-
if (passthrough) {
|
|
30
|
-
positionals.push(arg);
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
if (arg === "--") {
|
|
34
|
-
passthrough = true;
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
let consumed = false;
|
|
38
|
-
for (const flag of boolFlags) {
|
|
39
|
-
const { matched } = matchFlagToken(arg, flag);
|
|
40
|
-
if (matched) {
|
|
41
|
-
consumed = true;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (consumed) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
for (const flag of valueFlags) {
|
|
49
|
-
const match = matchFlagToken(arg, flag);
|
|
50
|
-
if (!match.matched) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
consumed = true;
|
|
54
|
-
if (match.inlineValue === null && index + 1 < args.length) {
|
|
55
|
-
index += 1;
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
if (!consumed) {
|
|
60
|
-
positionals.push(arg);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return positionals;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Returns `true` when any of the given flags appear in `args`.
|
|
67
|
-
*
|
|
68
|
-
* Matches both standalone tokens (`-s`, `--silent`) and inline forms
|
|
69
|
-
* (`--output=file`). Useful for simple boolean flag checks inside command
|
|
70
|
-
* `run` handlers.
|
|
71
|
-
*
|
|
72
|
-
* @param args Tokenized argument array from `CommandContext.args`.
|
|
73
|
-
* @param flags Single flag string or array of equivalent flag strings.
|
|
74
|
-
* @returns `true` if at least one flag is present, otherwise `false`.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```ts
|
|
78
|
-
* ifFlag(args, "-r") // single flag
|
|
79
|
-
* ifFlag(args, ["-r", "--recursive"]) // aliases
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export function ifFlag(args, flags) {
|
|
83
|
-
const allFlags = toFlagList(flags);
|
|
84
|
-
for (const arg of args) {
|
|
85
|
-
for (const flag of allFlags) {
|
|
86
|
-
if (matchFlagToken(arg, flag).matched) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Returns the value associated with a flag, or `true` if the flag is present
|
|
95
|
-
* but has no associated value, or `undefined` if the flag is absent.
|
|
96
|
-
*
|
|
97
|
-
* Handles three forms:
|
|
98
|
-
* - `--output file` → returns `"file"` (next token)
|
|
99
|
-
* - `--output=file` → returns `"file"` (inline `=` form)
|
|
100
|
-
* - `--verbose` → returns `true` (flag with no value)
|
|
101
|
-
*
|
|
102
|
-
* @param args Tokenized argument array from `CommandContext.args`.
|
|
103
|
-
* @param flags Single flag string or array of equivalent flag strings.
|
|
104
|
-
* @returns The flag value string, `true` when valueless, or `undefined`.
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```ts
|
|
108
|
-
* const output = getFlag(args, ["-o", "--output"]);
|
|
109
|
-
* if (typeof output === "string") { /* use path *\/ }
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
export function getFlag(args, flags) {
|
|
113
|
-
const allFlags = toFlagList(flags);
|
|
114
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
115
|
-
const arg = args[index];
|
|
116
|
-
for (const flag of allFlags) {
|
|
117
|
-
const match = matchFlagToken(arg, flag);
|
|
118
|
-
if (!match.matched) {
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
if (match.inlineValue !== null) {
|
|
122
|
-
return match.inlineValue;
|
|
123
|
-
}
|
|
124
|
-
const next = args[index + 1];
|
|
125
|
-
if (next !== undefined && next !== "--") {
|
|
126
|
-
return next;
|
|
127
|
-
}
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return undefined;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Returns the positional argument at the given zero-based index, skipping
|
|
135
|
-
* known flags and their values.
|
|
136
|
-
*
|
|
137
|
-
* Flags declared in `options.flags` are treated as boolean and skipped.
|
|
138
|
-
* Flags declared in `options.flagsWithValue` consume the next token too.
|
|
139
|
-
* Tokens after `--` are always treated as positionals.
|
|
140
|
-
*
|
|
141
|
-
* @param args Tokenized argument array from `CommandContext.args`.
|
|
142
|
-
* @param index Zero-based positional index to retrieve.
|
|
143
|
-
* @param options Optional flag declarations to skip during positional collection.
|
|
144
|
-
* @returns The positional value, or `undefined` if the index is out of range.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* // args = ["-r", "src", "dest"]
|
|
149
|
-
* getArg(args, 0, { flags: ["-r"] }) // "src"
|
|
150
|
-
* getArg(args, 1, { flags: ["-r"] }) // "dest"
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
export function getArg(args, index, options = {}) {
|
|
154
|
-
const positionals = collectPositionals(args, options);
|
|
155
|
-
return positionals[index];
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Parses an argument array into structured flags, flag values, and positionals.
|
|
159
|
-
*
|
|
160
|
-
* - `options.flags` — boolean flags (e.g. `["-r", "--recursive"]`); collected
|
|
161
|
-
* into a `Set<string>` and not treated as positionals.
|
|
162
|
-
* - `options.flagsWithValue` — flags that consume the next token or an inline
|
|
163
|
-
* `=value`; collected into a `Map<string, string>`.
|
|
164
|
-
* - All remaining tokens are positionals.
|
|
165
|
-
* - Tokens after `--` are always positionals, regardless of `-` prefix.
|
|
166
|
-
*
|
|
167
|
-
* @param args Tokenized argument array from `CommandContext.args`.
|
|
168
|
-
* @param options Flag declaration lists.
|
|
169
|
-
* @returns `{ flags, flagsWithValues, positionals }`.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```ts
|
|
173
|
-
* const { flags, flagsWithValues, positionals } = parseArgs(args, {
|
|
174
|
-
* flags: ["-r", "--recursive"],
|
|
175
|
-
* flagsWithValue: ["-o", "--output"],
|
|
176
|
-
* });
|
|
177
|
-
* const recursive = flags.has("-r");
|
|
178
|
-
* const output = flagsWithValues.get("-o");
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
export function parseArgs(args, options = {}) {
|
|
182
|
-
const flags = new Set();
|
|
183
|
-
const flagsWithValues = new Map();
|
|
184
|
-
const positionals = [];
|
|
185
|
-
const boolFlags = new Set(options.flags ?? []);
|
|
186
|
-
const valueFlags = new Set(options.flagsWithValue ?? []);
|
|
187
|
-
let passthrough = false;
|
|
188
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
189
|
-
const arg = args[index];
|
|
190
|
-
if (passthrough) {
|
|
191
|
-
positionals.push(arg);
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
if (arg === "--") {
|
|
195
|
-
passthrough = true;
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
if (boolFlags.has(arg)) {
|
|
199
|
-
flags.add(arg);
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
if (valueFlags.has(arg)) {
|
|
203
|
-
const next = args[index + 1];
|
|
204
|
-
if (next && !next.startsWith("-")) {
|
|
205
|
-
flagsWithValues.set(arg, next);
|
|
206
|
-
index += 1;
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
flagsWithValues.set(arg, "");
|
|
210
|
-
}
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
const inlineFlag = Array.from(valueFlags).find((flag) => arg.startsWith(`${flag}=`));
|
|
214
|
-
if (inlineFlag) {
|
|
215
|
-
flagsWithValues.set(inlineFlag, arg.slice(inlineFlag.length + 1));
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
positionals.push(arg);
|
|
219
|
-
}
|
|
220
|
-
return { flags, flagsWithValues, positionals };
|
|
221
|
-
}
|
package/src/commands/cp.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cp.d.ts","sourceRoot":"","sources":["cp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WAyEvB,CAAC"}
|
package/src/commands/cp.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ifFlag } from "./command-helpers";
|
|
2
|
-
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* Copy files or directories inside the virtual filesystem.
|
|
5
|
-
* @category files
|
|
6
|
-
* @params ["[-r] <source> <dest>"]
|
|
7
|
-
*/
|
|
8
|
-
export const cpCommand = {
|
|
9
|
-
name: "cp",
|
|
10
|
-
description: "Copy files or directories",
|
|
11
|
-
category: "files",
|
|
12
|
-
params: ["[-r] <source> <dest>"],
|
|
13
|
-
run: ({ authUser, shell, cwd, args }) => {
|
|
14
|
-
const recursive = ifFlag(args, ["-r", "-R", "--recursive"]);
|
|
15
|
-
const positionals = args.filter((a) => !a.startsWith("-"));
|
|
16
|
-
const [srcArg, destArg] = positionals;
|
|
17
|
-
if (!srcArg || !destArg) {
|
|
18
|
-
return { stderr: "cp: missing operand", exitCode: 1 };
|
|
19
|
-
}
|
|
20
|
-
const srcPath = resolvePath(cwd, srcArg);
|
|
21
|
-
const destPath = resolvePath(cwd, destArg);
|
|
22
|
-
try {
|
|
23
|
-
assertPathAccess(authUser, srcPath, "cp");
|
|
24
|
-
assertPathAccess(authUser, destPath, "cp");
|
|
25
|
-
if (!shell.vfs.exists(srcPath)) {
|
|
26
|
-
return {
|
|
27
|
-
stderr: `cp: ${srcArg}: No such file or directory`,
|
|
28
|
-
exitCode: 1,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const srcStat = shell.vfs.stat(srcPath);
|
|
32
|
-
if (srcStat.type === "directory") {
|
|
33
|
-
if (!recursive) {
|
|
34
|
-
return {
|
|
35
|
-
stderr: `cp: ${srcArg}: is a directory (use -r)`,
|
|
36
|
-
exitCode: 1,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const copyDir = (from, to) => {
|
|
40
|
-
shell.vfs.mkdir(to, 0o755);
|
|
41
|
-
for (const entry of shell.vfs.list(from)) {
|
|
42
|
-
const fromEntry = `${from}/${entry}`;
|
|
43
|
-
const toEntry = `${to}/${entry}`;
|
|
44
|
-
const stat = shell.vfs.stat(fromEntry);
|
|
45
|
-
if (stat.type === "directory") {
|
|
46
|
-
copyDir(fromEntry, toEntry);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const content = shell.vfs.readFileRaw(fromEntry);
|
|
50
|
-
shell.writeFileAsUser(authUser, toEntry, content);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const finalDest = shell.vfs.exists(destPath) &&
|
|
55
|
-
shell.vfs.stat(destPath).type === "directory"
|
|
56
|
-
? `${destPath}/${srcArg.split("/").pop()}`
|
|
57
|
-
: destPath;
|
|
58
|
-
copyDir(srcPath, finalDest);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
const finalDest = shell.vfs.exists(destPath) &&
|
|
62
|
-
shell.vfs.stat(destPath).type === "directory"
|
|
63
|
-
? `${destPath}/${srcArg.split("/").pop()}`
|
|
64
|
-
: destPath;
|
|
65
|
-
const content = shell.vfs.readFileRaw(srcPath);
|
|
66
|
-
shell.writeFileAsUser(authUser, finalDest, content);
|
|
67
|
-
}
|
|
68
|
-
return { exitCode: 0 };
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
72
|
-
return { stderr: `cp: ${msg}`, exitCode: 1 };
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["curl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAyIzB,CAAC"}
|
package/src/commands/curl.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { ifFlag, parseArgs } from "./command-helpers";
|
|
2
|
-
import { assertPathAccess, resolvePath } from "./helpers";
|
|
3
|
-
/**
|
|
4
|
-
* HTTP client wrapper using `fetch()` semantics (virtual curl).
|
|
5
|
-
* @category network
|
|
6
|
-
* @params ["[options] <url>"]
|
|
7
|
-
*/
|
|
8
|
-
export const curlCommand = {
|
|
9
|
-
name: "curl",
|
|
10
|
-
description: "Transfer data from or to a server (pure fetch)",
|
|
11
|
-
category: "network",
|
|
12
|
-
params: ["[options] <url>"],
|
|
13
|
-
run: async ({ authUser, cwd, args, shell }) => {
|
|
14
|
-
const { flagsWithValues, positionals } = parseArgs(args, {
|
|
15
|
-
flagsWithValue: [
|
|
16
|
-
"-o",
|
|
17
|
-
"--output",
|
|
18
|
-
"-X",
|
|
19
|
-
"--request",
|
|
20
|
-
"-d",
|
|
21
|
-
"--data",
|
|
22
|
-
"-H",
|
|
23
|
-
"--header",
|
|
24
|
-
"-u",
|
|
25
|
-
"--user",
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
if (ifFlag(args, ["--help", "-h"])) {
|
|
29
|
-
return {
|
|
30
|
-
stdout: [
|
|
31
|
-
"Usage: curl [options] <url>",
|
|
32
|
-
" -o, --output <file> Write to file",
|
|
33
|
-
" -X, --request <method> HTTP method",
|
|
34
|
-
" -d, --data <data> POST data",
|
|
35
|
-
" -H, --header <hdr> Extra header",
|
|
36
|
-
" -s, --silent Silent mode",
|
|
37
|
-
" -I, --head Fetch headers only",
|
|
38
|
-
" -L, --location Follow redirects",
|
|
39
|
-
" -v, --verbose Verbose",
|
|
40
|
-
].join("\n"),
|
|
41
|
-
exitCode: 0,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const url = positionals[0];
|
|
45
|
-
if (!url)
|
|
46
|
-
return { stderr: "curl: no URL specified", exitCode: 1 };
|
|
47
|
-
const outputPath = flagsWithValues.get("-o") ?? flagsWithValues.get("--output") ?? null;
|
|
48
|
-
const method = (flagsWithValues.get("-X") ??
|
|
49
|
-
flagsWithValues.get("--request") ??
|
|
50
|
-
"GET").toUpperCase();
|
|
51
|
-
const postData = flagsWithValues.get("-d") ?? flagsWithValues.get("--data") ?? null;
|
|
52
|
-
const headerRaw = flagsWithValues.get("-H") ?? flagsWithValues.get("--header") ?? null;
|
|
53
|
-
const silent = ifFlag(args, ["-s", "--silent"]);
|
|
54
|
-
const headOnly = ifFlag(args, ["-I", "--head"]);
|
|
55
|
-
const followRedirects = ifFlag(args, ["-L", "--location"]);
|
|
56
|
-
const verbose = ifFlag(args, ["-v", "--verbose"]);
|
|
57
|
-
const extraHeaders = {
|
|
58
|
-
"User-Agent": "curl/7.88.1",
|
|
59
|
-
};
|
|
60
|
-
if (headerRaw) {
|
|
61
|
-
const idx = headerRaw.indexOf(":");
|
|
62
|
-
if (idx !== -1)
|
|
63
|
-
extraHeaders[headerRaw.slice(0, idx).trim()] = headerRaw
|
|
64
|
-
.slice(idx + 1)
|
|
65
|
-
.trim();
|
|
66
|
-
}
|
|
67
|
-
const finalMethod = postData && method === "GET" ? "POST" : method;
|
|
68
|
-
const fetchOpts = {
|
|
69
|
-
method: finalMethod,
|
|
70
|
-
headers: extraHeaders,
|
|
71
|
-
redirect: followRedirects ? "follow" : "manual",
|
|
72
|
-
};
|
|
73
|
-
if (postData) {
|
|
74
|
-
extraHeaders["Content-Type"] ??= "application/x-www-form-urlencoded";
|
|
75
|
-
fetchOpts.body = postData;
|
|
76
|
-
}
|
|
77
|
-
const stderrLines = [];
|
|
78
|
-
if (verbose) {
|
|
79
|
-
stderrLines.push(`* Trying ${url}...`, `* Connected`);
|
|
80
|
-
stderrLines.push(`> ${finalMethod} / HTTP/1.1`, `> Host: ${new URL(url).host}`);
|
|
81
|
-
}
|
|
82
|
-
let response;
|
|
83
|
-
try {
|
|
84
|
-
const urlWithHttp = url.startsWith("http://") || url.startsWith("https://") ? url : `http://${url}`;
|
|
85
|
-
response = await fetch(urlWithHttp, fetchOpts);
|
|
86
|
-
}
|
|
87
|
-
catch (err) {
|
|
88
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
89
|
-
return {
|
|
90
|
-
stderr: `curl: (6) Could not resolve host: ${msg}`,
|
|
91
|
-
exitCode: 6,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
if (verbose) {
|
|
95
|
-
stderrLines.push(`< HTTP/1.1 ${response.status} ${response.statusText}`);
|
|
96
|
-
}
|
|
97
|
-
if (headOnly) {
|
|
98
|
-
const lines = [`HTTP/1.1 ${response.status} ${response.statusText}`];
|
|
99
|
-
for (const [k, v] of response.headers.entries())
|
|
100
|
-
lines.push(`${k}: ${v}`);
|
|
101
|
-
return { stdout: `${lines.join("\r\n")}\r\n`, exitCode: 0 };
|
|
102
|
-
}
|
|
103
|
-
let body;
|
|
104
|
-
try {
|
|
105
|
-
body = await response.text();
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return { stderr: "curl: failed to read response body", exitCode: 1 };
|
|
109
|
-
}
|
|
110
|
-
if (outputPath) {
|
|
111
|
-
const target = resolvePath(cwd, outputPath);
|
|
112
|
-
assertPathAccess(authUser, target, "curl");
|
|
113
|
-
shell.writeFileAsUser(authUser, target, body);
|
|
114
|
-
if (!silent)
|
|
115
|
-
stderrLines.push(` % Total % Received\n100 ${body.length} 100 ${body.length}`);
|
|
116
|
-
return {
|
|
117
|
-
stderr: stderrLines.join("\n") || undefined,
|
|
118
|
-
exitCode: response.ok ? 0 : 22,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
stdout: body,
|
|
123
|
-
stderr: stderrLines.length > 0 ? stderrLines.join("\n") : undefined,
|
|
124
|
-
exitCode: response.ok ? 0 : 22,
|
|
125
|
-
};
|
|
126
|
-
},
|
|
127
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cut.d.ts","sourceRoot":"","sources":["cut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WA2BxB,CAAC"}
|
package/src/commands/cut.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getFlag } from "./command-helpers";
|
|
2
|
-
/**
|
|
3
|
-
* Extract selected fields from each line of input.
|
|
4
|
-
* @category text
|
|
5
|
-
* @params ["-d <delim> -f <fields> [file]"]
|
|
6
|
-
*/
|
|
7
|
-
export const cutCommand = {
|
|
8
|
-
name: "cut",
|
|
9
|
-
description: "Remove sections from lines",
|
|
10
|
-
category: "text",
|
|
11
|
-
params: ["-d <delim> -f <fields> [file]"],
|
|
12
|
-
run: ({ args, stdin }) => {
|
|
13
|
-
const delim = getFlag(args, ["-d"]) ?? "\t";
|
|
14
|
-
const fields = getFlag(args, ["-f"]) ?? "1";
|
|
15
|
-
const cols = fields.split(",").map((f) => {
|
|
16
|
-
const [a, b] = f.split("-").map(Number);
|
|
17
|
-
return b !== undefined
|
|
18
|
-
? { from: (a ?? 1) - 1, to: b - 1 }
|
|
19
|
-
: { from: (a ?? 1) - 1, to: (a ?? 1) - 1 };
|
|
20
|
-
});
|
|
21
|
-
const lines = (stdin ?? "").split("\n");
|
|
22
|
-
const out = lines.map((line) => {
|
|
23
|
-
const parts = line.split(delim);
|
|
24
|
-
const selected = [];
|
|
25
|
-
for (const col of cols) {
|
|
26
|
-
for (let i = col.from; i <= Math.min(col.to, parts.length - 1); i++) {
|
|
27
|
-
selected.push(parts[i] ?? "");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return selected.join(delim);
|
|
31
|
-
});
|
|
32
|
-
return { stdout: out.join("\n"), exitCode: 0 };
|
|
33
|
-
},
|
|
34
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAsBzB,CAAC"}
|
package/src/commands/date.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Print the current date/time or a formatted representation.
|
|
3
|
-
* @category system
|
|
4
|
-
* @params ["[+format]"]
|
|
5
|
-
*/
|
|
6
|
-
export const dateCommand = {
|
|
7
|
-
name: "date",
|
|
8
|
-
description: "Print current date and time",
|
|
9
|
-
category: "system",
|
|
10
|
-
params: ["[+format]"],
|
|
11
|
-
run: ({ args }) => {
|
|
12
|
-
const now = new Date();
|
|
13
|
-
const fmt = args[0];
|
|
14
|
-
if (fmt?.startsWith("+")) {
|
|
15
|
-
const f = fmt
|
|
16
|
-
.slice(1)
|
|
17
|
-
.replace("%Y", String(now.getFullYear()))
|
|
18
|
-
.replace("%m", String(now.getMonth() + 1).padStart(2, "0"))
|
|
19
|
-
.replace("%d", String(now.getDate()).padStart(2, "0"))
|
|
20
|
-
.replace("%H", String(now.getHours()).padStart(2, "0"))
|
|
21
|
-
.replace("%M", String(now.getMinutes()).padStart(2, "0"))
|
|
22
|
-
.replace("%S", String(now.getSeconds()).padStart(2, "0"))
|
|
23
|
-
.replace("%s", String(Math.floor(now.getTime() / 1000)));
|
|
24
|
-
return { stdout: f, exitCode: 0 };
|
|
25
|
-
}
|
|
26
|
-
return { stdout: now.toString(), exitCode: 0 };
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"declare.d.ts","sourceRoot":"","sources":["declare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,WAwC5B,CAAC"}
|
package/src/commands/declare.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ifFlag } from "./command-helpers";
|
|
2
|
-
/**
|
|
3
|
-
* Declare variables and give them attributes (integer, readonly, export, array).
|
|
4
|
-
* @category shell
|
|
5
|
-
* @params ["[-i] [-r] [-x] [-a] [name[=value]...]"]
|
|
6
|
-
*/
|
|
7
|
-
export const declareCommand = {
|
|
8
|
-
name: "declare",
|
|
9
|
-
aliases: ["local", "typeset"],
|
|
10
|
-
description: "Declare variables and give them attributes",
|
|
11
|
-
category: "shell",
|
|
12
|
-
params: ["[-i] [-r] [-x] [-a] [name[=value]...]"],
|
|
13
|
-
run: ({ args, env }) => {
|
|
14
|
-
if (!env)
|
|
15
|
-
return { exitCode: 0 };
|
|
16
|
-
const integer = ifFlag(args, ["-i"]);
|
|
17
|
-
const _readonly = ifFlag(args, ["-r"]);
|
|
18
|
-
const _export_ = ifFlag(args, ["-x"]);
|
|
19
|
-
const printAll = args.filter((a) => !a.startsWith("-")).length === 0;
|
|
20
|
-
if (printAll) {
|
|
21
|
-
const lines = Object.entries(env.vars).map(([k, v]) => `declare -- ${k}="${v}"`);
|
|
22
|
-
return { stdout: lines.join("\n"), exitCode: 0 };
|
|
23
|
-
}
|
|
24
|
-
const assignments = args.filter((a) => !a.startsWith("-"));
|
|
25
|
-
for (const token of assignments) {
|
|
26
|
-
const eq = token.indexOf("=");
|
|
27
|
-
if (eq === -1) {
|
|
28
|
-
// Just declare (no value)
|
|
29
|
-
if (!(token in env.vars))
|
|
30
|
-
env.vars[token] = "";
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const name = token.slice(0, eq);
|
|
34
|
-
let val = token.slice(eq + 1);
|
|
35
|
-
if (integer) {
|
|
36
|
-
const n = parseInt(val, 10);
|
|
37
|
-
val = Number.isNaN(n) ? "0" : String(n);
|
|
38
|
-
}
|
|
39
|
-
env.vars[name] = val;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return { exitCode: 0 };
|
|
43
|
-
},
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deluser.d.ts","sourceRoot":"","sources":["deluser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGpE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,EAAE,WAkF5B,CAAC"}
|
package/src/commands/deluser.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Delete a user. Root-only.
|
|
3
|
-
*
|
|
4
|
-
* Without `-f`: prompts for confirmation — the user must type the exact
|
|
5
|
-
* username to proceed.
|
|
6
|
-
*
|
|
7
|
-
* With `-f` / `--force`: deletes without confirmation.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* deluser <username>
|
|
11
|
-
* deluser -f <username>
|
|
12
|
-
*/
|
|
13
|
-
export const deluserCommand = {
|
|
14
|
-
name: "deluser",
|
|
15
|
-
description: "Delete a user",
|
|
16
|
-
category: "users",
|
|
17
|
-
params: ["[-f] <username>"],
|
|
18
|
-
run: async ({ authUser, args, shell }) => {
|
|
19
|
-
if (authUser !== "root") {
|
|
20
|
-
return { stderr: "deluser: permission denied\n", exitCode: 1 };
|
|
21
|
-
}
|
|
22
|
-
const force = args.includes("-f") ||
|
|
23
|
-
args.includes("--force") ||
|
|
24
|
-
args.includes("-y");
|
|
25
|
-
const username = args.find((a) => !a.startsWith("-"));
|
|
26
|
-
if (!username) {
|
|
27
|
-
return {
|
|
28
|
-
stderr: "Usage: deluser [-f] <username>\n",
|
|
29
|
-
exitCode: 1,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
if (!shell.users.listUsers().includes(username)) {
|
|
33
|
-
return {
|
|
34
|
-
stderr: `deluser: user '${username}' does not exist\n`,
|
|
35
|
-
exitCode: 1,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
if (username === "root") {
|
|
39
|
-
return {
|
|
40
|
-
stderr: "deluser: cannot remove the root account\n",
|
|
41
|
-
exitCode: 1,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// Force mode — delete without confirmation
|
|
45
|
-
if (force) {
|
|
46
|
-
await shell.users.deleteUser(username);
|
|
47
|
-
return {
|
|
48
|
-
stdout: `Removing user '${username}' ...\ndeluser: done.\n`,
|
|
49
|
-
exitCode: 0,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
// Interactive confirmation
|
|
53
|
-
const onPassword = async (input, sh) => {
|
|
54
|
-
if (input.trim() !== username) {
|
|
55
|
-
return {
|
|
56
|
-
result: {
|
|
57
|
-
stderr: "deluser: confirmation did not match — user not deleted\n",
|
|
58
|
-
exitCode: 1,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
await sh.users.deleteUser(username);
|
|
63
|
-
return {
|
|
64
|
-
result: {
|
|
65
|
-
stdout: `Removing user '${username}' ...\ndeluser: done.\n`,
|
|
66
|
-
exitCode: 0,
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
return {
|
|
71
|
-
sudoChallenge: {
|
|
72
|
-
username,
|
|
73
|
-
targetUser: username,
|
|
74
|
-
commandLine: null,
|
|
75
|
-
loginShell: false,
|
|
76
|
-
prompt: `Warning: deleting user '${username}'.\nType the username to confirm: `,
|
|
77
|
-
mode: "confirm",
|
|
78
|
-
onPassword,
|
|
79
|
-
},
|
|
80
|
-
exitCode: 0,
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
};
|
package/src/commands/df.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"df.d.ts","sourceRoot":"","sources":["df.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WAevB,CAAC"}
|
package/src/commands/df.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Report filesystem disk space usage.
|
|
3
|
-
* @category system
|
|
4
|
-
* @params ["[-h]"]
|
|
5
|
-
*/
|
|
6
|
-
export const dfCommand = {
|
|
7
|
-
name: "df",
|
|
8
|
-
description: "Report filesystem disk space usage",
|
|
9
|
-
category: "system",
|
|
10
|
-
params: ["[-h]"],
|
|
11
|
-
run: ({ shell }) => {
|
|
12
|
-
const bytes = shell.vfs.getUsageBytes();
|
|
13
|
-
const used = (bytes / 1024).toFixed(0);
|
|
14
|
-
const total = "1048576"; // 1GB virtual
|
|
15
|
-
const avail = String(Number(total) - Number(used));
|
|
16
|
-
const pct = Math.round((Number(used) / Number(total)) * 100);
|
|
17
|
-
const hdr = "Filesystem 1K-blocks Used Available Use% Mounted on";
|
|
18
|
-
const row = `virtual-fs ${total.padStart(9)} ${used.padStart(7)} ${avail.padStart(9)} ${pct}% /`;
|
|
19
|
-
return { stdout: `${hdr}\n${row}`, exitCode: 0 };
|
|
20
|
-
},
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WAkCzB,CAAC"}
|