typescript-virtual-container 1.5.6 → 1.5.7

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.
Files changed (43) hide show
  1. package/README.md +28 -20
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/SSHMimic/index.d.ts +5 -1
  4. package/dist/SSHMimic/index.js +27 -3
  5. package/dist/SSHMimic/scp.d.ts +34 -0
  6. package/dist/SSHMimic/scp.js +285 -0
  7. package/dist/SSHMimic/sftp.d.ts +53 -3
  8. package/dist/SSHMimic/sftp.js +9 -3
  9. package/dist/VirtualFileSystem/binaryPack.d.ts +7 -0
  10. package/dist/VirtualFileSystem/binaryPack.js +37 -1
  11. package/dist/VirtualFileSystem/index.d.ts +7 -0
  12. package/dist/VirtualFileSystem/index.js +67 -27
  13. package/dist/VirtualFileSystem/internalTypes.d.ts +2 -0
  14. package/dist/VirtualFileSystem/path.d.ts +5 -0
  15. package/dist/VirtualFileSystem/path.js +24 -11
  16. package/dist/VirtualPackageManager/index.d.ts +4 -2
  17. package/dist/VirtualPackageManager/index.js +24 -4
  18. package/dist/VirtualShell/index.d.ts +4 -0
  19. package/dist/VirtualShell/index.js +1 -7
  20. package/dist/VirtualShell/shell.js +40 -10
  21. package/dist/VirtualShell/shellParser.js +1 -22
  22. package/dist/commands/exit.js +1 -1
  23. package/dist/commands/find.js +1 -4
  24. package/dist/commands/helpers.d.ts +0 -20
  25. package/dist/commands/helpers.js +0 -97
  26. package/dist/commands/perl.js +1 -1
  27. package/dist/commands/python.js +5 -2
  28. package/dist/commands/registry.js +6 -1
  29. package/dist/commands/runtime.js +65 -87
  30. package/dist/commands/strace.js +1 -1
  31. package/dist/commands/tar.js +2 -2
  32. package/dist/commands/test.js +2 -2
  33. package/dist/modules/linuxRootfs.js +1 -4
  34. package/dist/modules/neofetch.js +2 -2
  35. package/dist/types/commands.d.ts +4 -0
  36. package/dist/utils/argv.d.ts +6 -0
  37. package/dist/utils/argv.js +32 -0
  38. package/dist/utils/expand.d.ts +5 -2
  39. package/dist/utils/expand.js +70 -67
  40. package/dist/utils/glob.d.ts +6 -0
  41. package/dist/utils/glob.js +34 -0
  42. package/dist/utils/tokenize.js +13 -13
  43. package/package.json +7 -6
package/README.md CHANGED
@@ -44,8 +44,8 @@
44
44
  | Mode | Entry point | Use case |
45
45
  |------|-------------|----------|
46
46
  | **SSH/SFTP server** | `VirtualSshServer` / `VirtualSftpServer` | Honeypots, remote testing, training environments |
47
- | **Web shell** | `builds/fortune-nyx-v1.5.6-web.min.js` (ESM) | Embedded terminals, interactive tutorials, browser demos |
48
- | **Standalone CLI** | `builds/fortune-nyx-v1.5.6-directbash-k6.1.0.mjs` (single file) | Local shell, one-liner demos, no install required |
47
+ | **Web shell** | `builds/fortune-nyx-v1.5.7-web.min.js` (ESM) | Embedded terminals, interactive tutorials, browser demos |
48
+ | **Standalone CLI** | `builds/fortune-nyx-v1.5.7-directbash-k6.1.0.mjs` (single file) | Local shell, one-liner demos, no install required |
49
49
  <!-- /BUILD:mode-table -->
50
50
 
51
51
  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.
@@ -64,19 +64,24 @@ npm install typescript-virtual-container
64
64
  ### Try instantly (zero install)
65
65
 
66
66
  <!-- BUILD:curl-start -->
67
- #### Interactivea local shell — persists VFS in .vfs/ in the current directory
67
+ #### Interactive local shell — persists VFS in .vfs/ in the current directory
68
68
  ```bash
69
- curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.6-directbash-k6.1.0.mjs -o fortune-nyx-v1.5.6-directbash-k6.1.0.mjs && node fortune-nyx-v1.5.6-directbash-k6.1.0.mjs
69
+ curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.7-directbash-k6.1.0.mjs -o fortune-nyx-v1.5.7-directbash-k6.1.0.mjs && node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs
70
70
  ```
71
71
 
72
- #### SSH server (connect with any SSH client on port 2222)
72
+ #### SSH server with built-in SFTP subsystem (scp / sftp on port 2222)
73
73
  ```bash
74
- curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.6-ssh.cjs -o fortune-nyx-v1.5.6-ssh.cjs && node fortune-nyx-v1.5.6-ssh.cjs
74
+ curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.7-ssh.cjs -o fortune-nyx-v1.5.7-ssh.cjs && node fortune-nyx-v1.5.7-ssh.cjs
75
75
  ```
76
76
 
77
- #### SSH server without SFTP (lighter build)
77
+ #### Custom SSH port
78
78
  ```bash
79
- curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.6-ssh-nosftp.js -o fortune-nyx-v1.5.6-ssh-nosftp.js && node fortune-nyx-v1.5.6-ssh-nosftp.js
79
+ node fortune-nyx-v1.5.7-ssh.cjs --ssh-port=2022
80
+ ```
81
+
82
+ #### SSH disabled (handler only, no server started)
83
+ ```bash
84
+ node fortune-nyx-v1.5.7-ssh.cjs --no-ssh
80
85
  ```
81
86
  <!-- /BUILD:curl-start -->
82
87
 
@@ -84,13 +89,16 @@ curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-cont
84
89
  > The standalone builds are intended for quick demos and testing. For production use, it's recommended to install the package and import the relevant classes directly in your codebase for better performance, stability, and security.
85
90
 
86
91
  <!-- BUILD:selfStandalone-options -->
87
- **`fortune-nyx-v1.5.6-directbash-k6.1.0.mjs` options:**
92
+ **`fortune-nyx-v1.5.7-directbash-k6.1.0.mjs` options:**
88
93
 
89
94
  ```bash
90
- node fortune-nyx-v1.5.6-directbash-k6.1.0.mjs # boot as root
91
- node fortune-nyx-v1.5.6-directbash-k6.1.0.mjs --user alice # boot as alice (prompts for password if set)
92
- node fortune-nyx-v1.5.6-directbash-k6.1.0.mjs --user=alice # same, inline form
93
- SSH_MIMIC_HOSTNAME=my-box node fortune-nyx-v1.5.6-directbash-k6.1.0.mjs # custom hostname
95
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs # boot as root
96
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs --user alice # boot as alice (prompts for password if set)
97
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs --user=alice # same, inline form
98
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs --hostname=my-box # custom hostname
99
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs --snapshot=/data/.vfs # custom VFS snapshot path
100
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs --help # show all options
101
+ node fortune-nyx-v1.5.7-directbash-k6.1.0.mjs --version # print version
94
102
  ```
95
103
  <!-- /BUILD:selfStandalone-options -->
96
104
 
@@ -117,7 +125,7 @@ Two browser bundles are available:
117
125
  <!-- BUILD:web-table -->
118
126
  | Bundle | Format | Entry point | Use case |
119
127
  |--------|--------|-------------|----------|
120
- | `builds/fortune-nyx-v1.5.6-web.min.js` | ESM | `createWebShell()` | Embedded terminals, modern bundlers |
128
+ | `builds/fortune-nyx-v1.5.7-web.min.js` | ESM | `createWebShell()` | Embedded terminals, modern bundlers |
121
129
  <!-- /BUILD:web-table -->
122
130
 
123
131
  Both bundles persist the VFS in **IndexedDB** — state survives page reloads.
@@ -129,11 +137,11 @@ bun run build-all # rebuild everything
129
137
  ```
130
138
 
131
139
  <!-- BUILD:web-options -->
132
- **`fortune-nyx-v1.5.6-web.min.js`** — lightweight shell with IndexedDB VFS:
140
+ **`fortune-nyx-v1.5.7-web.min.js`** — lightweight shell with IndexedDB VFS:
133
141
 
134
142
  ```html
135
143
  <script type="module">
136
- import { createWebShell } from "./builds/fortune-nyx-v1.5.6-web.min.js";
144
+ import { createWebShell } from "./builds/fortune-nyx-v1.5.7-web.min.js";
137
145
 
138
146
  const shell = createWebShell("web-vm", {
139
147
  vfs: { databaseName: "virtual-env-js", storeName: "vfs" },
@@ -145,11 +153,11 @@ bun run build-all # rebuild everything
145
153
  </script>
146
154
  ```
147
155
 
148
- **`fortune-nyx-v1.5.6-web.min.js`** — mirrors the `VirtualShell` programmatic API:
156
+ **`fortune-nyx-v1.5.7-web.min.js`** — mirrors the `VirtualShell` programmatic API:
149
157
 
150
158
  ```html
151
159
  <script type="module">
152
- import { createVirtualShellShim } from "./builds/fortune-nyx-v1.5.6-web.min.js";
160
+ import { createVirtualShellShim } from "./builds/fortune-nyx-v1.5.7-web.min.js";
153
161
 
154
162
  const shell = createVirtualShellShim("web-vm");
155
163
  await shell.ensureInitialized();
@@ -1236,8 +1244,8 @@ Open:
1236
1244
  - [x] Snapshot diff tooling — `diffSnapshots`, `formatDiff`, `assertDiff`
1237
1245
  - [x] `node`/`python3`/`npm`/`npx` — package-gated virtual REPL stubs
1238
1246
  <!-- BUILD:changelog -->
1239
- - [x] Web shell bundles (`fortune-nyx-v1.5.6-web.min.js`) — fully browser-native with IndexedDB VFS
1240
- - [x] Self-standalone CLI (`fortune-nyx-v1.5.6-directbash-k6.1.0.mjs`) — single-file interactive shell, per-user history, tab completion
1247
+ - [x] Web shell bundles (`fortune-nyx-v1.5.7-web.min.js`) — fully browser-native with IndexedDB VFS
1248
+ - [x] Self-standalone CLI (`fortune-nyx-v1.5.7-directbash-k6.1.0.mjs`) — single-file interactive shell, per-user history, tab completion
1241
1249
  <!-- /BUILD:changelog -->
1242
1250
  - [x] 120+ `man` pages — all built-in commands documented via `man <cmd>`
1243
1251
  - [x] Shared `tokenize.ts` — unified tokenizer for shell parser and runtime (eliminates duplication)