typescript-virtual-container 1.4.2 → 1.4.4
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/.vscode/settings.json +2 -1
- package/README.md +209 -54
- package/benchmark-results.txt +21 -21
- package/builds/self-standalone.js +196 -189
- package/builds/self-standalone.js.map +4 -4
- package/builds/standalone-wo-sftp.js +167 -160
- package/builds/standalone-wo-sftp.js.map +4 -4
- package/builds/standalone.js +169 -162
- 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 +4 -6
- package/examples/web.min.js +5 -5
- package/package.json +4 -3
- package/src/Honeypot/index.d.ts.map +1 -0
- package/src/SSHClient/index.d.ts.map +1 -0
- package/src/SSHMimic/exec.d.ts.map +1 -0
- package/src/SSHMimic/executor.d.ts.map +1 -0
- package/src/SSHMimic/hostKey.d.ts.map +1 -0
- package/src/SSHMimic/index.d.ts.map +1 -0
- package/src/SSHMimic/loginBanner.d.ts.map +1 -0
- package/src/SSHMimic/loginFormat.d.ts.map +1 -0
- package/src/SSHMimic/prompt.d.ts.map +1 -0
- package/src/SSHMimic/sftp.d.ts.map +1 -0
- package/src/VirtualFileSystem/binaryPack.d.ts.map +1 -0
- package/{dist → src}/VirtualFileSystem/index.d.ts +47 -0
- package/src/VirtualFileSystem/index.d.ts.map +1 -0
- package/{dist → src}/VirtualFileSystem/index.js +159 -0
- package/src/VirtualFileSystem/index.ts +173 -8
- package/src/VirtualFileSystem/internalTypes.d.ts.map +1 -0
- package/src/VirtualFileSystem/path.d.ts.map +1 -0
- package/src/VirtualPackageManager/index.d.ts.map +1 -0
- package/{dist → src}/VirtualShell/index.d.ts +29 -0
- package/src/VirtualShell/index.d.ts.map +1 -0
- package/{dist → src}/VirtualShell/index.js +29 -0
- package/src/VirtualShell/index.ts +36 -0
- package/src/VirtualShell/shell.d.ts.map +1 -0
- package/src/VirtualShell/shellParser.d.ts.map +1 -0
- package/{dist → src}/VirtualShell/shellParser.js +30 -2
- package/src/VirtualShell/shellParser.ts +29 -3
- package/src/VirtualUserManager/index.d.ts.map +1 -0
- package/src/bun.d.ts +1 -0
- package/src/commands/adduser.d.ts.map +1 -0
- package/src/commands/alias.d.ts.map +1 -0
- package/src/commands/apt.d.ts.map +1 -0
- package/src/commands/awk.d.ts.map +1 -0
- package/{dist → src}/commands/awk.js +1 -2
- package/src/commands/awk.ts +1 -2
- package/src/commands/base64.d.ts.map +1 -0
- package/src/commands/cat.d.ts.map +1 -0
- package/src/commands/cd.d.ts.map +1 -0
- package/{dist → src}/commands/cd.js +2 -2
- package/src/commands/cd.ts +2 -2
- package/src/commands/chmod.d.ts.map +1 -0
- package/src/commands/clear.d.ts.map +1 -0
- package/src/commands/command-helpers.d.ts.map +1 -0
- package/src/commands/cp.d.ts.map +1 -0
- package/src/commands/curl.d.ts.map +1 -0
- package/src/commands/cut.d.ts.map +1 -0
- package/src/commands/date.d.ts.map +1 -0
- package/src/commands/declare.d.ts.map +1 -0
- package/src/commands/deluser.d.ts.map +1 -0
- package/src/commands/df.d.ts.map +1 -0
- package/src/commands/diff.d.ts.map +1 -0
- package/src/commands/dpkg.d.ts.map +1 -0
- package/src/commands/du.d.ts.map +1 -0
- package/src/commands/echo.d.ts.map +1 -0
- package/src/commands/env.d.ts.map +1 -0
- package/src/commands/exit.d.ts.map +1 -0
- package/src/commands/export.d.ts.map +1 -0
- package/{dist → src}/commands/export.js +5 -3
- package/src/commands/export.ts +5 -3
- package/src/commands/find.d.ts.map +1 -0
- package/src/commands/free.d.ts.map +1 -0
- package/src/commands/grep.d.ts.map +1 -0
- package/src/commands/groups.d.ts.map +1 -0
- package/src/commands/gzip.d.ts.map +1 -0
- package/src/commands/head.d.ts.map +1 -0
- package/src/commands/help.d.ts.map +1 -0
- package/src/commands/helpers.d.ts.map +1 -0
- package/{dist → src}/commands/helpers.js +3 -0
- package/src/commands/helpers.ts +3 -0
- package/src/commands/history.d.ts.map +1 -0
- package/src/commands/hostname.d.ts.map +1 -0
- package/src/commands/htop.d.ts.map +1 -0
- package/src/commands/id.d.ts.map +1 -0
- package/src/commands/index.d.ts.map +1 -0
- package/src/commands/kill.d.ts.map +1 -0
- package/src/commands/ln.d.ts.map +1 -0
- package/src/commands/ls.d.ts.map +1 -0
- package/src/commands/ls.js +200 -0
- package/src/commands/ls.ts +210 -41
- package/src/commands/lsb-release.d.ts.map +1 -0
- package/src/commands/man.d.ts.map +1 -0
- package/src/commands/mkdir.d.ts.map +1 -0
- package/src/commands/mv.d.ts.map +1 -0
- package/src/commands/nano.d.ts.map +1 -0
- package/src/commands/neofetch.d.ts.map +1 -0
- package/src/commands/node.d.ts.map +1 -0
- package/src/commands/npm.d.ts.map +1 -0
- package/src/commands/passwd.d.ts.map +1 -0
- package/src/commands/ping.d.ts.map +1 -0
- package/src/commands/printf.d.ts.map +1 -0
- package/src/commands/ps.d.ts.map +1 -0
- package/src/commands/pwd.d.ts.map +1 -0
- package/src/commands/python.d.ts.map +1 -0
- package/src/commands/read.d.ts.map +1 -0
- package/src/commands/registry.d.ts.map +1 -0
- package/{dist → src}/commands/registry.js +2 -0
- package/src/commands/registry.ts +2 -0
- package/src/commands/rm.d.ts.map +1 -0
- package/src/commands/runtime.d.ts.map +1 -0
- package/{dist → src}/commands/runtime.js +64 -3
- package/src/commands/runtime.ts +86 -6
- package/src/commands/sed.d.ts.map +1 -0
- package/src/commands/seq.d.ts +4 -0
- package/src/commands/seq.d.ts.map +1 -0
- package/src/commands/seq.js +50 -0
- package/src/commands/seq.ts +43 -0
- package/src/commands/set.d.ts.map +1 -0
- package/src/commands/sh.d.ts +3 -0
- package/src/commands/sh.d.ts.map +1 -0
- package/{dist → src}/commands/sh.js +158 -11
- package/src/commands/sh.ts +148 -20
- package/src/commands/shift.d.ts.map +1 -0
- package/src/commands/sleep.d.ts.map +1 -0
- package/src/commands/sort.d.ts.map +1 -0
- package/src/commands/source.d.ts.map +1 -0
- package/src/commands/stat.d.ts.map +1 -0
- package/src/commands/su.d.ts.map +1 -0
- package/src/commands/sudo.d.ts.map +1 -0
- package/src/commands/tail.d.ts.map +1 -0
- package/src/commands/tar.d.ts.map +1 -0
- package/src/commands/tee.d.ts.map +1 -0
- package/src/commands/test.d.ts.map +1 -0
- package/src/commands/test.ts +4 -2
- package/src/commands/touch.d.ts.map +1 -0
- package/src/commands/tr.d.ts.map +1 -0
- package/src/commands/tree.d.ts.map +1 -0
- package/src/commands/true.d.ts.map +1 -0
- package/src/commands/type.d.ts.map +1 -0
- package/src/commands/uname.d.ts.map +1 -0
- package/src/commands/uniq.d.ts.map +1 -0
- package/src/commands/unset.d.ts.map +1 -0
- package/src/commands/uptime.d.ts.map +1 -0
- package/src/commands/wc.d.ts.map +1 -0
- package/{dist → src}/commands/wc.js +1 -1
- package/src/commands/wc.ts +1 -1
- package/src/commands/wget.d.ts.map +1 -0
- package/src/commands/which.d.ts.map +1 -0
- package/src/commands/who.d.ts.map +1 -0
- package/src/commands/whoami.d.ts.map +1 -0
- package/src/commands/xargs.d.ts.map +1 -0
- package/src/index.d.ts.map +1 -0
- package/src/modules/linuxRootfs.d.ts +59 -0
- package/src/modules/linuxRootfs.d.ts.map +1 -0
- package/src/modules/linuxRootfs.js +619 -0
- package/src/modules/linuxRootfs.ts +420 -231
- package/src/modules/neofetch.d.ts.map +1 -0
- package/src/modules/shellInteractive.d.ts.map +1 -0
- package/src/modules/shellRuntime.d.ts.map +1 -0
- package/{dist → src}/self-standalone.d.ts.map +1 -1
- package/src/standalone-wo-sftp.d.ts.map +1 -0
- package/{dist → src}/standalone.d.ts.map +1 -1
- package/{dist → src}/types/commands.d.ts +1 -1
- package/src/types/commands.d.ts.map +1 -0
- package/src/types/commands.ts +1 -1
- package/{dist → src}/types/pipeline.d.ts +6 -0
- package/src/types/pipeline.d.ts.map +1 -0
- package/src/types/pipeline.ts +6 -0
- package/src/types/streams.d.ts.map +1 -0
- package/{dist → src}/types/vfs.d.ts +15 -0
- package/src/types/vfs.d.ts.map +1 -0
- package/src/types/vfs.ts +17 -0
- package/{dist → src}/utils/expand.d.ts +11 -2
- package/src/utils/expand.d.ts.map +1 -0
- package/src/utils/expand.js +476 -0
- package/src/utils/expand.ts +281 -28
- package/src/utils/perfLogger.d.ts.map +1 -0
- package/src/utils/tokenize.d.ts.map +1 -0
- package/{dist → src}/utils/tokenize.js +40 -0
- package/src/utils/tokenize.ts +20 -0
- package/src/utils/vfsDiff.d.ts.map +1 -0
- package/src/web-api.d.ts.map +1 -0
- package/src/web-full.d.ts.map +1 -0
- package/src/web.d.ts.map +1 -0
- package/tests/command-helpers.test.d.ts +2 -0
- package/tests/command-helpers.test.d.ts.map +1 -0
- package/tests/command-helpers.test.js +92 -0
- package/tests/command-helpers.test.ts +80 -0
- package/tests/commands-admin-net.test.d.ts +2 -0
- package/tests/commands-admin-net.test.d.ts.map +1 -0
- package/tests/commands-admin-net.test.js +353 -0
- package/tests/commands-admin-net.test.ts +441 -0
- package/tests/commands-advanced.test.d.ts +2 -0
- package/tests/commands-advanced.test.d.ts.map +1 -0
- package/tests/commands-advanced.test.js +378 -0
- package/tests/commands-advanced.test.ts +456 -0
- package/tests/commands-core.test.d.ts +2 -0
- package/tests/commands-core.test.d.ts.map +1 -0
- package/tests/commands-core.test.js +477 -0
- package/tests/commands-core.test.ts +562 -0
- package/tests/commands-missing.test.d.ts +2 -0
- package/tests/commands-missing.test.d.ts.map +1 -0
- package/tests/commands-missing.test.js +470 -0
- package/tests/commands-missing.test.ts +570 -0
- package/tests/commands-specific-units.test.d.ts +2 -0
- package/tests/commands-specific-units.test.d.ts.map +1 -0
- package/tests/commands-specific-units.test.js +264 -0
- package/tests/commands-specific-units.test.ts +327 -0
- package/tests/commands-text-sys.test.d.ts +2 -0
- package/tests/commands-text-sys.test.d.ts.map +1 -0
- package/tests/commands-text-sys.test.js +366 -0
- package/tests/commands-text-sys.test.ts +445 -0
- package/tests/expand.test.d.ts +2 -0
- package/tests/expand.test.d.ts.map +1 -0
- package/tests/expand.test.js +138 -0
- package/tests/expand.test.ts +170 -0
- package/tests/helpers.test.d.ts +2 -0
- package/tests/helpers.test.d.ts.map +1 -0
- package/tests/helpers.test.js +52 -0
- package/tests/helpers.test.ts +75 -0
- package/tests/new-features.test.d.ts +2 -0
- package/tests/new-features.test.d.ts.map +1 -0
- package/tests/new-features.test.js +850 -0
- package/tests/parser-executor.test.d.ts +2 -0
- package/tests/parser-executor.test.d.ts.map +1 -0
- package/tests/parser-executor.test.js +25 -0
- package/tests/sftp.test.d.ts +2 -0
- package/tests/sftp.test.d.ts.map +1 -0
- package/tests/sftp.test.js +246 -0
- package/tests/ssh-exec.test.d.ts +2 -0
- package/tests/ssh-exec.test.d.ts.map +1 -0
- package/tests/ssh-exec.test.js +39 -0
- package/tests/test-helper.d.ts +56 -0
- package/tests/test-helper.d.ts.map +1 -0
- package/tests/test-helper.js +71 -0
- package/tests/test-helper.ts +79 -0
- package/tests/users.test.d.ts +2 -0
- package/tests/users.test.d.ts.map +1 -0
- package/tests/users.test.js +71 -0
- package/tests/web.test.d.ts +2 -0
- package/tests/web.test.d.ts.map +1 -0
- package/tests/web.test.js +149 -0
- package/tsconfig.json +2 -4
- package/dist/Honeypot/index.d.ts.map +0 -1
- package/dist/SSHClient/index.d.ts.map +0 -1
- package/dist/SSHMimic/exec.d.ts.map +0 -1
- package/dist/SSHMimic/executor.d.ts.map +0 -1
- package/dist/SSHMimic/hostKey.d.ts.map +0 -1
- package/dist/SSHMimic/index.d.ts.map +0 -1
- package/dist/SSHMimic/loginBanner.d.ts.map +0 -1
- package/dist/SSHMimic/loginFormat.d.ts.map +0 -1
- package/dist/SSHMimic/prompt.d.ts.map +0 -1
- package/dist/SSHMimic/sftp.d.ts.map +0 -1
- package/dist/VirtualFileSystem/binaryPack.d.ts.map +0 -1
- package/dist/VirtualFileSystem/index.d.ts.map +0 -1
- package/dist/VirtualFileSystem/internalTypes.d.ts.map +0 -1
- package/dist/VirtualFileSystem/path.d.ts.map +0 -1
- package/dist/VirtualPackageManager/index.d.ts.map +0 -1
- package/dist/VirtualShell/index.d.ts.map +0 -1
- package/dist/VirtualShell/shell.d.ts.map +0 -1
- package/dist/VirtualShell/shellParser.d.ts.map +0 -1
- package/dist/VirtualUserManager/index.d.ts.map +0 -1
- package/dist/commands/adduser.d.ts.map +0 -1
- package/dist/commands/alias.d.ts.map +0 -1
- package/dist/commands/apt.d.ts.map +0 -1
- package/dist/commands/awk.d.ts.map +0 -1
- package/dist/commands/base64.d.ts.map +0 -1
- package/dist/commands/cat.d.ts.map +0 -1
- package/dist/commands/cd.d.ts.map +0 -1
- package/dist/commands/chmod.d.ts.map +0 -1
- package/dist/commands/clear.d.ts.map +0 -1
- package/dist/commands/command-helpers.d.ts.map +0 -1
- package/dist/commands/cp.d.ts.map +0 -1
- package/dist/commands/curl.d.ts.map +0 -1
- package/dist/commands/cut.d.ts.map +0 -1
- package/dist/commands/date.d.ts.map +0 -1
- package/dist/commands/declare.d.ts.map +0 -1
- package/dist/commands/deluser.d.ts.map +0 -1
- package/dist/commands/df.d.ts.map +0 -1
- package/dist/commands/diff.d.ts.map +0 -1
- package/dist/commands/dpkg.d.ts.map +0 -1
- package/dist/commands/du.d.ts.map +0 -1
- package/dist/commands/echo.d.ts.map +0 -1
- package/dist/commands/env.d.ts.map +0 -1
- package/dist/commands/exit.d.ts.map +0 -1
- package/dist/commands/export.d.ts.map +0 -1
- package/dist/commands/find.d.ts.map +0 -1
- package/dist/commands/free.d.ts.map +0 -1
- package/dist/commands/grep.d.ts.map +0 -1
- package/dist/commands/groups.d.ts.map +0 -1
- package/dist/commands/gzip.d.ts.map +0 -1
- package/dist/commands/head.d.ts.map +0 -1
- package/dist/commands/help.d.ts.map +0 -1
- package/dist/commands/helpers.d.ts.map +0 -1
- package/dist/commands/history.d.ts.map +0 -1
- package/dist/commands/hostname.d.ts.map +0 -1
- package/dist/commands/htop.d.ts.map +0 -1
- package/dist/commands/id.d.ts.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/kill.d.ts.map +0 -1
- package/dist/commands/ln.d.ts.map +0 -1
- package/dist/commands/ls.d.ts.map +0 -1
- package/dist/commands/ls.js +0 -67
- package/dist/commands/lsb-release.d.ts.map +0 -1
- package/dist/commands/man.d.ts.map +0 -1
- package/dist/commands/mkdir.d.ts.map +0 -1
- package/dist/commands/mv.d.ts.map +0 -1
- package/dist/commands/nano.d.ts.map +0 -1
- package/dist/commands/neofetch.d.ts.map +0 -1
- package/dist/commands/node.d.ts.map +0 -1
- package/dist/commands/npm.d.ts.map +0 -1
- package/dist/commands/passwd.d.ts.map +0 -1
- package/dist/commands/ping.d.ts.map +0 -1
- package/dist/commands/printf.d.ts.map +0 -1
- package/dist/commands/ps.d.ts.map +0 -1
- package/dist/commands/pwd.d.ts.map +0 -1
- package/dist/commands/python.d.ts.map +0 -1
- package/dist/commands/read.d.ts.map +0 -1
- package/dist/commands/registry.d.ts.map +0 -1
- package/dist/commands/rm.d.ts.map +0 -1
- package/dist/commands/runtime.d.ts.map +0 -1
- package/dist/commands/sed.d.ts.map +0 -1
- package/dist/commands/set.d.ts.map +0 -1
- package/dist/commands/sh.d.ts +0 -9
- package/dist/commands/sh.d.ts.map +0 -1
- package/dist/commands/shift.d.ts.map +0 -1
- package/dist/commands/sleep.d.ts.map +0 -1
- package/dist/commands/sort.d.ts.map +0 -1
- package/dist/commands/source.d.ts.map +0 -1
- package/dist/commands/stat.d.ts.map +0 -1
- package/dist/commands/su.d.ts.map +0 -1
- package/dist/commands/sudo.d.ts.map +0 -1
- package/dist/commands/tail.d.ts.map +0 -1
- package/dist/commands/tar.d.ts.map +0 -1
- package/dist/commands/tee.d.ts.map +0 -1
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/touch.d.ts.map +0 -1
- package/dist/commands/tr.d.ts.map +0 -1
- package/dist/commands/tree.d.ts.map +0 -1
- package/dist/commands/true.d.ts.map +0 -1
- package/dist/commands/type.d.ts.map +0 -1
- package/dist/commands/uname.d.ts.map +0 -1
- package/dist/commands/uniq.d.ts.map +0 -1
- package/dist/commands/unset.d.ts.map +0 -1
- package/dist/commands/uptime.d.ts.map +0 -1
- package/dist/commands/wc.d.ts.map +0 -1
- package/dist/commands/wget.d.ts.map +0 -1
- package/dist/commands/which.d.ts.map +0 -1
- package/dist/commands/who.d.ts.map +0 -1
- package/dist/commands/whoami.d.ts.map +0 -1
- package/dist/commands/xargs.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/modules/linuxRootfs.d.ts +0 -41
- package/dist/modules/linuxRootfs.d.ts.map +0 -1
- package/dist/modules/linuxRootfs.js +0 -440
- package/dist/modules/neofetch.d.ts.map +0 -1
- package/dist/modules/shellInteractive.d.ts.map +0 -1
- package/dist/modules/shellRuntime.d.ts.map +0 -1
- package/dist/standalone-wo-sftp.d.ts.map +0 -1
- package/dist/types/commands.d.ts.map +0 -1
- package/dist/types/pipeline.d.ts.map +0 -1
- package/dist/types/streams.d.ts.map +0 -1
- package/dist/types/vfs.d.ts.map +0 -1
- package/dist/utils/expand.d.ts.map +0 -1
- package/dist/utils/expand.js +0 -183
- package/dist/utils/perfLogger.d.ts.map +0 -1
- package/dist/utils/tokenize.d.ts.map +0 -1
- package/dist/utils/vfsDiff.d.ts.map +0 -1
- package/dist/web-api.d.ts.map +0 -1
- package/dist/web-full.d.ts.map +0 -1
- package/dist/web.d.ts.map +0 -1
- package/tests/bun-test-shim.ts +0 -9
- /package/{dist → src}/Honeypot/index.d.ts +0 -0
- /package/{dist → src}/Honeypot/index.js +0 -0
- /package/{dist → src}/SSHClient/index.d.ts +0 -0
- /package/{dist → src}/SSHClient/index.js +0 -0
- /package/{dist → src}/SSHMimic/exec.d.ts +0 -0
- /package/{dist → src}/SSHMimic/exec.js +0 -0
- /package/{dist → src}/SSHMimic/executor.d.ts +0 -0
- /package/{dist → src}/SSHMimic/executor.js +0 -0
- /package/{dist → src}/SSHMimic/hostKey.d.ts +0 -0
- /package/{dist → src}/SSHMimic/hostKey.js +0 -0
- /package/{dist → src}/SSHMimic/index.d.ts +0 -0
- /package/{dist → src}/SSHMimic/index.js +0 -0
- /package/{dist → src}/SSHMimic/loginBanner.d.ts +0 -0
- /package/{dist → src}/SSHMimic/loginBanner.js +0 -0
- /package/{dist → src}/SSHMimic/loginFormat.d.ts +0 -0
- /package/{dist → src}/SSHMimic/loginFormat.js +0 -0
- /package/{dist → src}/SSHMimic/prompt.d.ts +0 -0
- /package/{dist → src}/SSHMimic/prompt.js +0 -0
- /package/{dist → src}/SSHMimic/sftp.d.ts +0 -0
- /package/{dist → src}/SSHMimic/sftp.js +0 -0
- /package/{dist → src}/VirtualFileSystem/binaryPack.d.ts +0 -0
- /package/{dist → src}/VirtualFileSystem/binaryPack.js +0 -0
- /package/{dist → src}/VirtualFileSystem/internalTypes.d.ts +0 -0
- /package/{dist → src}/VirtualFileSystem/internalTypes.js +0 -0
- /package/{dist → src}/VirtualFileSystem/path.d.ts +0 -0
- /package/{dist → src}/VirtualFileSystem/path.js +0 -0
- /package/{dist → src}/VirtualPackageManager/index.d.ts +0 -0
- /package/{dist → src}/VirtualPackageManager/index.js +0 -0
- /package/{dist → src}/VirtualShell/shell.d.ts +0 -0
- /package/{dist → src}/VirtualShell/shell.js +0 -0
- /package/{dist → src}/VirtualShell/shellParser.d.ts +0 -0
- /package/{dist → src}/VirtualUserManager/index.d.ts +0 -0
- /package/{dist → src}/VirtualUserManager/index.js +0 -0
- /package/{dist → src}/commands/adduser.d.ts +0 -0
- /package/{dist → src}/commands/adduser.js +0 -0
- /package/{dist → src}/commands/alias.d.ts +0 -0
- /package/{dist → src}/commands/alias.js +0 -0
- /package/{dist → src}/commands/apt.d.ts +0 -0
- /package/{dist → src}/commands/apt.js +0 -0
- /package/{dist → src}/commands/awk.d.ts +0 -0
- /package/{dist → src}/commands/base64.d.ts +0 -0
- /package/{dist → src}/commands/base64.js +0 -0
- /package/{dist → src}/commands/cat.d.ts +0 -0
- /package/{dist → src}/commands/cat.js +0 -0
- /package/{dist → src}/commands/cd.d.ts +0 -0
- /package/{dist → src}/commands/chmod.d.ts +0 -0
- /package/{dist → src}/commands/chmod.js +0 -0
- /package/{dist → src}/commands/clear.d.ts +0 -0
- /package/{dist → src}/commands/clear.js +0 -0
- /package/{dist → src}/commands/command-helpers.d.ts +0 -0
- /package/{dist → src}/commands/command-helpers.js +0 -0
- /package/{dist → src}/commands/cp.d.ts +0 -0
- /package/{dist → src}/commands/cp.js +0 -0
- /package/{dist → src}/commands/curl.d.ts +0 -0
- /package/{dist → src}/commands/curl.js +0 -0
- /package/{dist → src}/commands/cut.d.ts +0 -0
- /package/{dist → src}/commands/cut.js +0 -0
- /package/{dist → src}/commands/date.d.ts +0 -0
- /package/{dist → src}/commands/date.js +0 -0
- /package/{dist → src}/commands/declare.d.ts +0 -0
- /package/{dist → src}/commands/declare.js +0 -0
- /package/{dist → src}/commands/deluser.d.ts +0 -0
- /package/{dist → src}/commands/deluser.js +0 -0
- /package/{dist → src}/commands/df.d.ts +0 -0
- /package/{dist → src}/commands/df.js +0 -0
- /package/{dist → src}/commands/diff.d.ts +0 -0
- /package/{dist → src}/commands/diff.js +0 -0
- /package/{dist → src}/commands/dpkg.d.ts +0 -0
- /package/{dist → src}/commands/dpkg.js +0 -0
- /package/{dist → src}/commands/du.d.ts +0 -0
- /package/{dist → src}/commands/du.js +0 -0
- /package/{dist → src}/commands/echo.d.ts +0 -0
- /package/{dist → src}/commands/echo.js +0 -0
- /package/{dist → src}/commands/env.d.ts +0 -0
- /package/{dist → src}/commands/env.js +0 -0
- /package/{dist → src}/commands/exit.d.ts +0 -0
- /package/{dist → src}/commands/exit.js +0 -0
- /package/{dist → src}/commands/export.d.ts +0 -0
- /package/{dist → src}/commands/find.d.ts +0 -0
- /package/{dist → src}/commands/find.js +0 -0
- /package/{dist → src}/commands/free.d.ts +0 -0
- /package/{dist → src}/commands/free.js +0 -0
- /package/{dist → src}/commands/grep.d.ts +0 -0
- /package/{dist → src}/commands/grep.js +0 -0
- /package/{dist → src}/commands/groups.d.ts +0 -0
- /package/{dist → src}/commands/groups.js +0 -0
- /package/{dist → src}/commands/gzip.d.ts +0 -0
- /package/{dist → src}/commands/gzip.js +0 -0
- /package/{dist → src}/commands/head.d.ts +0 -0
- /package/{dist → src}/commands/head.js +0 -0
- /package/{dist → src}/commands/help.d.ts +0 -0
- /package/{dist → src}/commands/help.js +0 -0
- /package/{dist → src}/commands/helpers.d.ts +0 -0
- /package/{dist → src}/commands/history.d.ts +0 -0
- /package/{dist → src}/commands/history.js +0 -0
- /package/{dist → src}/commands/hostname.d.ts +0 -0
- /package/{dist → src}/commands/hostname.js +0 -0
- /package/{dist → src}/commands/htop.d.ts +0 -0
- /package/{dist → src}/commands/htop.js +0 -0
- /package/{dist → src}/commands/id.d.ts +0 -0
- /package/{dist → src}/commands/id.js +0 -0
- /package/{dist → src}/commands/index.d.ts +0 -0
- /package/{dist → src}/commands/index.js +0 -0
- /package/{dist → src}/commands/kill.d.ts +0 -0
- /package/{dist → src}/commands/kill.js +0 -0
- /package/{dist → src}/commands/ln.d.ts +0 -0
- /package/{dist → src}/commands/ln.js +0 -0
- /package/{dist → src}/commands/ls.d.ts +0 -0
- /package/{dist → src}/commands/lsb-release.d.ts +0 -0
- /package/{dist → src}/commands/lsb-release.js +0 -0
- /package/{dist → src}/commands/man.d.ts +0 -0
- /package/{dist → src}/commands/man.js +0 -0
- /package/{dist → src}/commands/mkdir.d.ts +0 -0
- /package/{dist → src}/commands/mkdir.js +0 -0
- /package/{dist → src}/commands/mv.d.ts +0 -0
- /package/{dist → src}/commands/mv.js +0 -0
- /package/{dist → src}/commands/nano.d.ts +0 -0
- /package/{dist → src}/commands/nano.js +0 -0
- /package/{dist → src}/commands/neofetch.d.ts +0 -0
- /package/{dist → src}/commands/neofetch.js +0 -0
- /package/{dist → src}/commands/node.d.ts +0 -0
- /package/{dist → src}/commands/node.js +0 -0
- /package/{dist → src}/commands/npm.d.ts +0 -0
- /package/{dist → src}/commands/npm.js +0 -0
- /package/{dist → src}/commands/passwd.d.ts +0 -0
- /package/{dist → src}/commands/passwd.js +0 -0
- /package/{dist → src}/commands/ping.d.ts +0 -0
- /package/{dist → src}/commands/ping.js +0 -0
- /package/{dist → src}/commands/printf.d.ts +0 -0
- /package/{dist → src}/commands/printf.js +0 -0
- /package/{dist → src}/commands/ps.d.ts +0 -0
- /package/{dist → src}/commands/ps.js +0 -0
- /package/{dist → src}/commands/pwd.d.ts +0 -0
- /package/{dist → src}/commands/pwd.js +0 -0
- /package/{dist → src}/commands/python.d.ts +0 -0
- /package/{dist → src}/commands/python.js +0 -0
- /package/{dist → src}/commands/read.d.ts +0 -0
- /package/{dist → src}/commands/read.js +0 -0
- /package/{dist → src}/commands/registry.d.ts +0 -0
- /package/{dist → src}/commands/rm.d.ts +0 -0
- /package/{dist → src}/commands/rm.js +0 -0
- /package/{dist → src}/commands/runtime.d.ts +0 -0
- /package/{dist → src}/commands/sed.d.ts +0 -0
- /package/{dist → src}/commands/sed.js +0 -0
- /package/{dist → src}/commands/set.d.ts +0 -0
- /package/{dist → src}/commands/set.js +0 -0
- /package/{dist → src}/commands/shift.d.ts +0 -0
- /package/{dist → src}/commands/shift.js +0 -0
- /package/{dist → src}/commands/sleep.d.ts +0 -0
- /package/{dist → src}/commands/sleep.js +0 -0
- /package/{dist → src}/commands/sort.d.ts +0 -0
- /package/{dist → src}/commands/sort.js +0 -0
- /package/{dist → src}/commands/source.d.ts +0 -0
- /package/{dist → src}/commands/source.js +0 -0
- /package/{dist → src}/commands/stat.d.ts +0 -0
- /package/{dist → src}/commands/stat.js +0 -0
- /package/{dist → src}/commands/su.d.ts +0 -0
- /package/{dist → src}/commands/su.js +0 -0
- /package/{dist → src}/commands/sudo.d.ts +0 -0
- /package/{dist → src}/commands/sudo.js +0 -0
- /package/{dist → src}/commands/tail.d.ts +0 -0
- /package/{dist → src}/commands/tail.js +0 -0
- /package/{dist → src}/commands/tar.d.ts +0 -0
- /package/{dist → src}/commands/tar.js +0 -0
- /package/{dist → src}/commands/tee.d.ts +0 -0
- /package/{dist → src}/commands/tee.js +0 -0
- /package/{dist → src}/commands/test.d.ts +0 -0
- /package/{dist → src}/commands/test.js +0 -0
- /package/{dist → src}/commands/touch.d.ts +0 -0
- /package/{dist → src}/commands/touch.js +0 -0
- /package/{dist → src}/commands/tr.d.ts +0 -0
- /package/{dist → src}/commands/tr.js +0 -0
- /package/{dist → src}/commands/tree.d.ts +0 -0
- /package/{dist → src}/commands/tree.js +0 -0
- /package/{dist → src}/commands/true.d.ts +0 -0
- /package/{dist → src}/commands/true.js +0 -0
- /package/{dist → src}/commands/type.d.ts +0 -0
- /package/{dist → src}/commands/type.js +0 -0
- /package/{dist → src}/commands/uname.d.ts +0 -0
- /package/{dist → src}/commands/uname.js +0 -0
- /package/{dist → src}/commands/uniq.d.ts +0 -0
- /package/{dist → src}/commands/uniq.js +0 -0
- /package/{dist → src}/commands/unset.d.ts +0 -0
- /package/{dist → src}/commands/unset.js +0 -0
- /package/{dist → src}/commands/uptime.d.ts +0 -0
- /package/{dist → src}/commands/uptime.js +0 -0
- /package/{dist → src}/commands/wc.d.ts +0 -0
- /package/{dist → src}/commands/wget.d.ts +0 -0
- /package/{dist → src}/commands/wget.js +0 -0
- /package/{dist → src}/commands/which.d.ts +0 -0
- /package/{dist → src}/commands/which.js +0 -0
- /package/{dist → src}/commands/who.d.ts +0 -0
- /package/{dist → src}/commands/who.js +0 -0
- /package/{dist → src}/commands/whoami.d.ts +0 -0
- /package/{dist → src}/commands/whoami.js +0 -0
- /package/{dist → src}/commands/xargs.d.ts +0 -0
- /package/{dist → src}/commands/xargs.js +0 -0
- /package/{dist → src}/index.d.ts +0 -0
- /package/{dist → src}/index.js +0 -0
- /package/{dist → src}/modules/neofetch.d.ts +0 -0
- /package/{dist → src}/modules/neofetch.js +0 -0
- /package/{dist → src}/modules/shellInteractive.d.ts +0 -0
- /package/{dist → src}/modules/shellInteractive.js +0 -0
- /package/{dist → src}/modules/shellRuntime.d.ts +0 -0
- /package/{dist → src}/modules/shellRuntime.js +0 -0
- /package/{dist → src}/self-standalone.d.ts +0 -0
- /package/{dist → src}/self-standalone.js +0 -0
- /package/{dist → src}/standalone-wo-sftp.d.ts +0 -0
- /package/{dist → src}/standalone-wo-sftp.js +0 -0
- /package/{dist → src}/standalone.d.ts +0 -0
- /package/{dist → src}/standalone.js +0 -0
- /package/{dist → src}/types/commands.js +0 -0
- /package/{dist → src}/types/pipeline.js +0 -0
- /package/{dist → src}/types/streams.d.ts +0 -0
- /package/{dist → src}/types/streams.js +0 -0
- /package/{dist → src}/types/vfs.js +0 -0
- /package/{dist → src}/utils/perfLogger.d.ts +0 -0
- /package/{dist → src}/utils/perfLogger.js +0 -0
- /package/{dist → src}/utils/tokenize.d.ts +0 -0
- /package/{dist → src}/utils/vfsDiff.d.ts +0 -0
- /package/{dist → src}/utils/vfsDiff.js +0 -0
- /package/{dist → src}/web-api.d.ts +0 -0
- /package/{dist → src}/web-api.js +0 -0
- /package/{dist → src}/web-full.d.ts +0 -0
- /package/{dist → src}/web-full.js +0 -0
- /package/{dist → src}/web.d.ts +0 -0
- /package/{dist → src}/web.js +0 -0
package/.vscode/settings.json
CHANGED
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
- [`VirtualSftpServer`](#virtualsftpserver)
|
|
25
25
|
- [`VirtualShell`](#virtualshell)
|
|
26
26
|
- [`VirtualFileSystem`](#virtualfilesystem)
|
|
27
|
+
- [Mount API](#mount-api)
|
|
27
28
|
- [`VirtualUserManager`](#virtualusermanager)
|
|
28
29
|
- [`VirtualPackageManager`](#virtualpackagemanager)
|
|
29
30
|
- [Snapshot Diff Tooling](#snapshot-diff-tooling)
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
| Mode | Entry point | Use case |
|
|
54
55
|
|------|-------------|----------|
|
|
55
56
|
| **SSH/SFTP server** | `VirtualSshServer` / `VirtualSftpServer` | Honeypots, remote testing, training environments |
|
|
56
|
-
| **Web shell** | `builds/web.min.js` (
|
|
57
|
+
| **Web shell** | `builds/web.min.js` / `builds/web-full-api.min.js` (ESM) | Embedded terminals, interactive tutorials, browser demos |
|
|
57
58
|
| **Standalone CLI** | `builds/self-standalone.js` (single file) | Local shell, one-liner demos, no install required |
|
|
58
59
|
|
|
59
60
|
All three modes share the same core: a pure in-memory VFS, a real shell interpreter, a virtual package manager, and a typed programmatic API.
|
|
@@ -111,24 +112,22 @@ await ssh.start();
|
|
|
111
112
|
|
|
112
113
|
### Web shell (browser)
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
Two browser bundles are available:
|
|
115
116
|
|
|
116
|
-
| Bundle | Format | Entry | Use case |
|
|
117
|
-
|
|
118
|
-
| `builds/web.min.js` | ESM | `createWebShell()` |
|
|
119
|
-
| `builds/web-
|
|
120
|
-
| `builds/web-full-api.min.js` | ESM | `createVirtualShellShim()` | API surface close to `VirtualShell` |
|
|
117
|
+
| Bundle | Format | Entry point | Use case |
|
|
118
|
+
|--------|--------|-------------|----------|
|
|
119
|
+
| `builds/web.min.js` | ESM | `createWebShell()` | Embedded terminals, modern bundlers |
|
|
120
|
+
| `builds/web-full-api.min.js` | ESM | `createVirtualShellShim()` | Full `VirtualShell`-like API in the browser |
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
Both bundles persist the VFS in **IndexedDB** — state survives page reloads.
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
bun run web-build
|
|
126
|
-
bun run web-build
|
|
127
|
-
bun run
|
|
128
|
-
bun run build-all # rebuild everything
|
|
125
|
+
bun run web-build # → builds/web.min.js + examples/web.min.js
|
|
126
|
+
bun run web-full-build # → builds/web-full-api.min.js
|
|
127
|
+
bun run build-all # rebuild everything
|
|
129
128
|
```
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
**`web.min.js`** — lightweight shell with IndexedDB VFS:
|
|
132
131
|
|
|
133
132
|
```html
|
|
134
133
|
<script type="module">
|
|
@@ -144,19 +143,7 @@ bun run build-all # rebuild everything
|
|
|
144
143
|
</script>
|
|
145
144
|
```
|
|
146
145
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```html
|
|
150
|
-
<script src="./builds/web-iife.min.js"></script>
|
|
151
|
-
<script>
|
|
152
|
-
const shell = WebShellLib.createWebShell("web-vm");
|
|
153
|
-
shell.ensureInitialized().then(() =>
|
|
154
|
-
shell.executeCommandLine("whoami").then(r => console.log(r.stdout))
|
|
155
|
-
);
|
|
156
|
-
</script>
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
**Full API shim (`web-full-api.min.js`)** — mirrors the `VirtualShell` programmatic API:
|
|
146
|
+
**`web-full-api.min.js`** — mirrors the `VirtualShell` programmatic API:
|
|
160
147
|
|
|
161
148
|
```html
|
|
162
149
|
<script type="module">
|
|
@@ -165,8 +152,7 @@ bun run build-all # rebuild everything
|
|
|
165
152
|
const shell = createVirtualShellShim("web-vm");
|
|
166
153
|
await shell.ensureInitialized();
|
|
167
154
|
await shell.executeCommandLine("mkdir -p /app && echo hello > /app/file.txt");
|
|
168
|
-
|
|
169
|
-
console.log(vfs.readFile("/app/file.txt")); // hello
|
|
155
|
+
console.log(shell.getVfs().readFile("/app/file.txt")); // hello
|
|
170
156
|
</script>
|
|
171
157
|
```
|
|
172
158
|
|
|
@@ -174,8 +160,7 @@ bun run build-all # rebuild everything
|
|
|
174
160
|
|
|
175
161
|
```bash
|
|
176
162
|
bun run example-serve
|
|
177
|
-
# Open http://localhost:8787/index.html
|
|
178
|
-
# or http://localhost:8787/index-cf.html (IIFE, Cloudflare-compatible)
|
|
163
|
+
# Open http://localhost:8787/index.html
|
|
179
164
|
```
|
|
180
165
|
|
|
181
166
|
### Programmatic API
|
|
@@ -327,6 +312,9 @@ interface ShellProperties {
|
|
|
327
312
|
| `writeFileAsUser(authUser, path, content)` | Write with quota enforcement. |
|
|
328
313
|
| `refreshProcFs(): void` | Refresh all `/proc/*` files (uptime, meminfo, cpuinfo, per-pid). |
|
|
329
314
|
| `refreshProcSessions(): void` | Lightweight refresh of `/proc/<pid>` and `/proc/self` only. |
|
|
315
|
+
| `mount(vPath, hostPath, options?): void` | Mount a host directory into the VFS. See [Mount API](#mount-api). |
|
|
316
|
+
| `unmount(vPath): void` | Remove a host directory mount. |
|
|
317
|
+
| `getMounts()` | List all active mounts as `{ vPath, hostPath, readOnly }[]`. |
|
|
330
318
|
| `syncPasswd(): void` | Sync `/etc/passwd`, `/etc/group`, `/etc/shadow` from user manager. |
|
|
331
319
|
| `getVfs(): VirtualFileSystem \| null` | Access VFS instance. |
|
|
332
320
|
| `getUsers(): VirtualUserManager \| null` | Access user manager. |
|
|
@@ -398,6 +386,40 @@ await vfs.flushMirror(); // save to disk
|
|
|
398
386
|
|
|
399
387
|
**Events:** `file:write { path, size }`, `file:read { path, size }`, `dir:create { path, mode }`, `node:remove { path }`, `symlink:create { link, target }`, `snapshot:import`, `snapshot:restore { path }`, `mirror:flush { path? }`
|
|
400
388
|
|
|
389
|
+
|
|
390
|
+
#### Mount API
|
|
391
|
+
|
|
392
|
+
Mount a host directory inside the VM — all standard VFS operations (`readFile`, `writeFile`, `exists`, `stat`, `list`) are transparently delegated to the host filesystem.
|
|
393
|
+
|
|
394
|
+
> **Node.js only.** In browser environments `mount()` is a silent no-op — the `vPath` remains an empty in-memory directory.
|
|
395
|
+
|
|
396
|
+
```typescript
|
|
397
|
+
// Read-only mount (default) — shell commands can read host files
|
|
398
|
+
shell.mount("/workspace", "./my-project");
|
|
399
|
+
|
|
400
|
+
// Read-write mount — shell commands can also write back to the host
|
|
401
|
+
shell.mount("/data", "./data", { readOnly: false });
|
|
402
|
+
|
|
403
|
+
// Unmount — delegation removed, vPath stays as an empty VFS directory
|
|
404
|
+
shell.unmount("/workspace");
|
|
405
|
+
|
|
406
|
+
// Introspect
|
|
407
|
+
shell.getMounts();
|
|
408
|
+
// → [{ vPath: "/workspace", hostPath: "/abs/path/my-project", readOnly: true }]
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
Direct VFS usage:
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
shell.vfs.mount("/workspace", "./my-project");
|
|
415
|
+
shell.vfs.unmount("/workspace");
|
|
416
|
+
shell.vfs.getMounts();
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Events:** `mount { vPath, hostPath, readOnly }`, `unmount { vPath }`
|
|
420
|
+
|
|
421
|
+
**Snapshot behaviour:** mounted files are **not** included in `toSnapshot()` — only the in-memory VFS tree is serialised. The mount configuration itself is also not persisted; restore it after each `fromSnapshot()` or `restoreMirror()`.
|
|
422
|
+
|
|
401
423
|
#### VFSB Binary Format
|
|
402
424
|
|
|
403
425
|
In `"fs"` mode, state is persisted as a compact binary file (`vfs-snapshot.vfsb`).
|
|
@@ -654,6 +676,17 @@ interface VirtualActiveSession {
|
|
|
654
676
|
remoteAddress: string;
|
|
655
677
|
startedAt: string; // ISO-8601
|
|
656
678
|
}
|
|
679
|
+
|
|
680
|
+
/** Returned by adduser, passwd, deluser — triggers interactive password prompt in the terminal. */
|
|
681
|
+
interface PasswordChallenge {
|
|
682
|
+
preamble?: string; // Lines printed before the first prompt
|
|
683
|
+
prompt: string; // e.g. "New password: "
|
|
684
|
+
confirmPrompt?: string; // Second prompt for confirmation
|
|
685
|
+
confirmText?: string; // Destructive confirmation prompt (y/N)
|
|
686
|
+
action: "adduser" | "passwd" | "deluser" | "su";
|
|
687
|
+
targetUsername: string;
|
|
688
|
+
newUsername?: string; // adduser only
|
|
689
|
+
}
|
|
657
690
|
```
|
|
658
691
|
|
|
659
692
|
---
|
|
@@ -932,7 +965,7 @@ echo "Welcome back, root!"
|
|
|
932
965
|
<details>
|
|
933
966
|
<summary><strong>Built-in Commands (91)</strong></summary>
|
|
934
967
|
|
|
935
|
-
Type `help` in the shell for a grouped, colorized listing. Type `help <command>` for detailed usage.
|
|
968
|
+
Type `help` in the shell for a grouped, colorized listing. Type `help <command>` for detailed usage. Type `man <command>` for full manual pages — all 91 commands are documented.
|
|
936
969
|
|
|
937
970
|
### Navigation
|
|
938
971
|
|
|
@@ -1198,27 +1231,145 @@ On every `VirtualShell` init, a realistic Linux hierarchy is bootstrapped idempo
|
|
|
1198
1231
|
|
|
1199
1232
|
```
|
|
1200
1233
|
/
|
|
1201
|
-
├── bin ->
|
|
1202
|
-
├──
|
|
1234
|
+
├── bin -> usr/bin (symlink, Debian-style)
|
|
1235
|
+
├── sbin -> usr/sbin (symlink, Debian-style)
|
|
1236
|
+
├── lib/ (ELF stub)
|
|
1237
|
+
├── lib/modules/
|
|
1238
|
+
├── lib/x86_64-linux-gnu/
|
|
1239
|
+
├── lib64 -> usr/lib64 (symlink, Debian-style)
|
|
1240
|
+
├── initrd.img -> boot/initrd.img-<kernel>
|
|
1241
|
+
├── initrd.img.old -> boot/initrd.img-<prev>
|
|
1242
|
+
├── vmlinuz -> boot/vmlinuz-<kernel>
|
|
1243
|
+
├── vmlinuz.old -> boot/vmlinuz-<prev>
|
|
1244
|
+
├── lost+found/ (mode 0o700, ext4 fsck dir)
|
|
1245
|
+
│
|
|
1246
|
+
├── boot/
|
|
1247
|
+
│ ├── grub/
|
|
1248
|
+
│ │ └── grub.cfg virtual bootloader config
|
|
1249
|
+
│ ├── vmlinuz-<kernel> kernel stub
|
|
1250
|
+
│ ├── initrd.img-<kernel> initrd stub
|
|
1251
|
+
│ ├── System.map-<kernel>
|
|
1252
|
+
│ └── config-<kernel>
|
|
1253
|
+
│
|
|
1254
|
+
├── dev/
|
|
1255
|
+
│ ├── null / zero / full (0o666)
|
|
1256
|
+
│ ├── random / urandom (0o444)
|
|
1257
|
+
│ ├── mem (0o640)
|
|
1258
|
+
│ ├── console / tty / tty0 / tty1 / ttyS0
|
|
1259
|
+
│ ├── sda / sda1 / sda2 block device stubs
|
|
1260
|
+
│ ├── loop0-loop7 + loop-control
|
|
1261
|
+
│ ├── stdin / stdout / stderr
|
|
1262
|
+
│ ├── pts/
|
|
1263
|
+
│ └── shm/
|
|
1264
|
+
│
|
|
1203
1265
|
├── etc/
|
|
1204
|
-
│ ├──
|
|
1266
|
+
│ ├── apt/sources.list + sources.list.d/
|
|
1267
|
+
│ ├── cron.d/
|
|
1268
|
+
│ ├── init.d/
|
|
1269
|
+
│ ├── ld.so.conf + ld.so.conf.d/x86_64-linux-gnu.conf
|
|
1270
|
+
│ ├── network/interfaces lo + eth0 (DHCP)
|
|
1271
|
+
│ ├── pam.d/ common-auth|account|password|session + sshd
|
|
1272
|
+
│ ├── security/limits.conf + access.conf
|
|
1273
|
+
│ ├── sudoers (0o440) + sudoers.d/
|
|
1274
|
+
│ ├── systemd/system/
|
|
1275
|
+
│ ├── debian_version 12.0
|
|
1276
|
+
│ ├── fstab UUID stubs + tmpfs entries
|
|
1277
|
+
│ ├── group synced from VirtualUserManager
|
|
1278
|
+
│ ├── hostname
|
|
1279
|
+
│ ├── hosts 127.0.0.1 + ::1 + VM hostname
|
|
1280
|
+
│ ├── issue login banner
|
|
1281
|
+
│ ├── locale.conf LANG=en_US.UTF-8
|
|
1282
|
+
│ ├── localtime / timezone UTC
|
|
1283
|
+
│ ├── login.defs UID_MIN=1000 SHA512
|
|
1284
|
+
│ ├── motd uses ShellProperties
|
|
1285
|
+
│ ├── os-release NAME="Fortune GNU/Linux" + ShellProperties
|
|
1286
|
+
│ ├── passwd synced from VirtualUserManager
|
|
1287
|
+
│ ├── profile PATH + PS1 defaults
|
|
1288
|
+
│ ├── resolv.conf 1.1.1.1 + 8.8.8.8
|
|
1289
|
+
│ ├── shadow (mode 0o640, fake hashes)
|
|
1290
|
+
│ └── shells /bin/sh /bin/bash /usr/bin/bash
|
|
1291
|
+
│
|
|
1292
|
+
├── home/
|
|
1293
|
+
├── media/
|
|
1294
|
+
├── mnt/
|
|
1295
|
+
├── opt/
|
|
1296
|
+
├── snap/bin/
|
|
1297
|
+
├── srv/
|
|
1298
|
+
│
|
|
1299
|
+
├── proc/ kernel simulation engine (refreshed on demand)
|
|
1300
|
+
│ ├── boot/log + version kernel boot sequence
|
|
1301
|
+
│ ├── net/dev + if_inet6 + tcp + tcp6
|
|
1302
|
+
│ ├── sys/kernel/ hostname, ostype, osrelease, pid_max,
|
|
1303
|
+
│ │ threads-max, randomize_va_space, dmesg_restrict
|
|
1304
|
+
│ ├── sys/net/ipv4/ip_forward
|
|
1305
|
+
│ ├── sys/vm/swappiness + overcommit_memory
|
|
1306
|
+
│ ├── self/mounts mirrors most recent session's /proc/<pid>/
|
|
1307
|
+
│ ├── 1/ init (cmdline, comm, stat, status, environ, fd/, fdinfo/)
|
|
1308
|
+
│ ├── <pid>/ one subtree per active session (TTY-derived PID)
|
|
1309
|
+
│ ├── cmdline kernel boot args
|
|
1310
|
+
│ ├── cpuinfo real host CPU passthrough
|
|
1311
|
+
│ ├── filesystems
|
|
1205
1312
|
│ ├── hostname
|
|
1206
|
-
│ ├──
|
|
1207
|
-
│ ├──
|
|
1208
|
-
│ ├──
|
|
1209
|
-
│ ├──
|
|
1210
|
-
│
|
|
1211
|
-
├──
|
|
1212
|
-
│
|
|
1213
|
-
│
|
|
1214
|
-
|
|
1215
|
-
│ ├──
|
|
1216
|
-
│
|
|
1217
|
-
│
|
|
1218
|
-
├──
|
|
1219
|
-
├──
|
|
1220
|
-
├──
|
|
1221
|
-
|
|
1313
|
+
│ ├── loadavg computed dynamically
|
|
1314
|
+
│ ├── meminfo real host memory (Total/Free/Available/Buffers/Cached/Swap)
|
|
1315
|
+
│ ├── mounts
|
|
1316
|
+
│ ├── partitions
|
|
1317
|
+
│ ├── swaps
|
|
1318
|
+
│ ├── uptime computed from shellStartTime
|
|
1319
|
+
│ └── version Linux <kernel> (fortune@build)
|
|
1320
|
+
│
|
|
1321
|
+
├── root/ (mode 0o700)
|
|
1322
|
+
│ ├── .bashrc colored PS1, PATH, ll/la aliases
|
|
1323
|
+
│ └── .profile
|
|
1324
|
+
│
|
|
1325
|
+
├── run/ (systemd tmpfs runtime)
|
|
1326
|
+
│ ├── lock/
|
|
1327
|
+
│ ├── systemd/
|
|
1328
|
+
│ ├── user/
|
|
1329
|
+
│ └── utmp
|
|
1330
|
+
│
|
|
1331
|
+
├── sys/ sysfs graph — deterministic, seeded from hostname (fnv1a)
|
|
1332
|
+
│ ├── class/net/
|
|
1333
|
+
│ ├── devices/virtual/dmi/id/
|
|
1334
|
+
│ │ ├── bios_vendor / bios_version / bios_date
|
|
1335
|
+
│ │ ├── sys_vendor / product_name / product_family / product_version
|
|
1336
|
+
│ │ ├── product_uuid / product_serial
|
|
1337
|
+
│ │ ├── chassis_type / chassis_vendor / chassis_version
|
|
1338
|
+
│ │ ├── board_name
|
|
1339
|
+
│ │ └── modalias
|
|
1340
|
+
│ └── kernel/
|
|
1341
|
+
│ ├── hostname
|
|
1342
|
+
│ ├── osrelease
|
|
1343
|
+
│ └── ostype
|
|
1344
|
+
│
|
|
1345
|
+
├── tmp/ (mode 0o1777, sticky)
|
|
1346
|
+
│
|
|
1347
|
+
├── usr/
|
|
1348
|
+
│ ├── bin/ stubs for all built-in commands (exec builtin <name>)
|
|
1349
|
+
│ ├── sbin/
|
|
1350
|
+
│ ├── lib/ + lib64/
|
|
1351
|
+
│ ├── local/bin|lib|share/
|
|
1352
|
+
│ └── share/doc|man/man1/
|
|
1353
|
+
│
|
|
1354
|
+
└── var/
|
|
1355
|
+
├── cache/apt/archives/
|
|
1356
|
+
├── lib/
|
|
1357
|
+
│ ├── apt/lists/
|
|
1358
|
+
│ ├── misc/
|
|
1359
|
+
│ └── dpkg/
|
|
1360
|
+
│ ├── available
|
|
1361
|
+
│ ├── info/
|
|
1362
|
+
│ └── status managed by VirtualPackageManager
|
|
1363
|
+
├── log/
|
|
1364
|
+
│ ├── apt/history.log + term.log
|
|
1365
|
+
│ ├── auth.log
|
|
1366
|
+
│ ├── dpkg.log
|
|
1367
|
+
│ ├── kern.log
|
|
1368
|
+
│ └── syslog
|
|
1369
|
+
├── mail/
|
|
1370
|
+
├── run -> /run (legacy symlink)
|
|
1371
|
+
├── spool/cron/
|
|
1372
|
+
└── tmp/
|
|
1222
1373
|
```
|
|
1223
1374
|
|
|
1224
1375
|
```typescript
|
|
@@ -1440,13 +1591,17 @@ Open:
|
|
|
1440
1591
|
- [x] Pure in-memory VFS · symlinks · binary snapshot format (VFSB, ~27% smaller than JSON+base64)
|
|
1441
1592
|
- [x] Linux rootfs on boot — `/etc`, `/proc`, `/sys`, `/dev`, `/usr`, `/var`
|
|
1442
1593
|
- [x] Virtual package manager — `apt`/`dpkg`, 25 packages, VFS file writes
|
|
1443
|
-
- [x]
|
|
1444
|
-
- [x] Real shell interpreter — `if`/`for`/`while`/`case`/functions, `$(cmd)`, `$((expr))`, `${#VAR}`,
|
|
1594
|
+
- [x] 92 built-in commands across 9 categories (`seq` added)
|
|
1595
|
+
- [x] Real shell interpreter — `if`/`for`/`while`/`case`/functions, `$(cmd)`, `$((expr))`, `${#VAR}`, `{a,b,c}` brace expansion, `{1..N}` ranges, `2>/dev/null` stderr redirect, `2>&1`, `(( x++ ))`
|
|
1445
1596
|
- [x] `curl`/`wget` as pure `fetch()` · VFS PATH resolution · `/sbin` root-only
|
|
1446
1597
|
- [x] `/proc/self` and `/proc/<pid>` per-session entries
|
|
1447
1598
|
- [x] Snapshot diff tooling — `diffSnapshots`, `formatDiff`, `assertDiff`
|
|
1448
1599
|
- [x] `node`/`python3`/`npm`/`npx` — package-gated virtual REPL stubs
|
|
1449
|
-
- [x] Web shell
|
|
1450
|
-
- [x] Self-standalone CLI (`self-standalone.js`) — single-file interactive shell,
|
|
1600
|
+
- [x] Web shell bundles (`web.min.js`, `web-full-api.min.js`) — fully browser-native with IndexedDB VFS
|
|
1601
|
+
- [x] Self-standalone CLI (`self-standalone.js`) — single-file interactive shell, per-user history, tab completion
|
|
1602
|
+
- [x] 120+ `man` pages — all built-in commands documented via `man <cmd>`
|
|
1603
|
+
- [x] Shared `tokenize.ts` — unified tokenizer for shell parser and runtime (eliminates duplication)
|
|
1604
|
+
- [x] `PasswordChallenge` type — generic interactive password flow for `adduser`, `passwd`, `deluser`
|
|
1605
|
+
- [x] `VirtualFileSystem.mount(vPath, hostPath, { readOnly })` — bind-mount host directories into the VM; read-only by default; browser-safe (silent no-op)
|
|
1451
1606
|
|
|
1452
1607
|
</details>
|
package/benchmark-results.txt
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
Benchmarking VirtualShell concurrency:
|
|
2
2
|
|
|
3
3
|
Running 1 shells...
|
|
4
|
-
Initialized 1 shells in
|
|
5
|
-
Executed shell commands in
|
|
4
|
+
Initialized 1 shells in 55ms, RSS 96 MB
|
|
5
|
+
Executed shell commands in 5ms, RSS now 97 MB (+0 MB)
|
|
6
6
|
|
|
7
7
|
Running 2 shells...
|
|
8
|
-
Initialized 2 shells in
|
|
9
|
-
Executed shell commands in 1ms, RSS now
|
|
8
|
+
Initialized 2 shells in 7ms, RSS 99 MB
|
|
9
|
+
Executed shell commands in 1ms, RSS now 99 MB (+0 MB)
|
|
10
10
|
|
|
11
11
|
Running 5 shells...
|
|
12
|
-
Initialized 5 shells in
|
|
13
|
-
Executed shell commands in 1ms, RSS now
|
|
12
|
+
Initialized 5 shells in 18ms, RSS 108 MB
|
|
13
|
+
Executed shell commands in 1ms, RSS now 109 MB (+1 MB)
|
|
14
14
|
|
|
15
15
|
Running 10 shells...
|
|
16
|
-
Initialized 10 shells in
|
|
17
|
-
Executed shell commands in
|
|
16
|
+
Initialized 10 shells in 33ms, RSS 122 MB
|
|
17
|
+
Executed shell commands in 2ms, RSS now 122 MB (+0 MB)
|
|
18
18
|
|
|
19
19
|
Running 20 shells...
|
|
20
|
-
Initialized 20 shells in
|
|
21
|
-
Executed shell commands in 4ms, RSS now
|
|
20
|
+
Initialized 20 shells in 64ms, RSS 147 MB
|
|
21
|
+
Executed shell commands in 4ms, RSS now 148 MB (+1 MB)
|
|
22
22
|
|
|
23
23
|
Running 50 shells...
|
|
24
|
-
Initialized 50 shells in
|
|
25
|
-
Executed shell commands in
|
|
24
|
+
Initialized 50 shells in 127ms, RSS 157 MB
|
|
25
|
+
Executed shell commands in 5ms, RSS now 158 MB (+0 MB)
|
|
26
26
|
|
|
27
27
|
Running 100 shells...
|
|
28
|
-
Initialized 100 shells in
|
|
29
|
-
Executed shell commands in
|
|
28
|
+
Initialized 100 shells in 256ms, RSS 185 MB
|
|
29
|
+
Executed shell commands in 9ms, RSS now 186 MB (+0 MB)
|
|
30
30
|
|
|
31
31
|
Summary:
|
|
32
32
|
|
|
33
33
|
count init_ms cmd_ms init_rss final_rss delta_rss
|
|
34
|
-
1
|
|
35
|
-
2
|
|
36
|
-
5
|
|
37
|
-
10
|
|
38
|
-
20
|
|
39
|
-
50
|
|
40
|
-
100
|
|
34
|
+
1 55 5 96 MB 97 MB 0 MB
|
|
35
|
+
2 7 1 99 MB 99 MB 0 MB
|
|
36
|
+
5 18 1 108 MB 109 MB 1 MB
|
|
37
|
+
10 33 2 122 MB 122 MB 0 MB
|
|
38
|
+
20 64 4 147 MB 148 MB 1 MB
|
|
39
|
+
50 127 5 157 MB 158 MB 0 MB
|
|
40
|
+
100 256 9 185 MB 186 MB 0 MB
|