typescript-virtual-container 1.5.6 → 1.5.8
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/README.md +28 -20
- package/dist/.tsbuildinfo +1 -1
- package/dist/SSHMimic/index.d.ts +5 -1
- package/dist/SSHMimic/index.js +27 -3
- package/dist/SSHMimic/prompt.d.ts +2 -1
- package/dist/SSHMimic/prompt.js +27 -5
- package/dist/SSHMimic/scp.d.ts +34 -0
- package/dist/SSHMimic/scp.js +285 -0
- package/dist/SSHMimic/sftp.d.ts +53 -3
- package/dist/SSHMimic/sftp.js +9 -3
- package/dist/VirtualFileSystem/binaryPack.d.ts +7 -0
- package/dist/VirtualFileSystem/binaryPack.js +37 -1
- package/dist/VirtualFileSystem/index.d.ts +7 -0
- package/dist/VirtualFileSystem/index.js +67 -27
- package/dist/VirtualFileSystem/internalTypes.d.ts +2 -0
- package/dist/VirtualFileSystem/path.d.ts +5 -0
- package/dist/VirtualFileSystem/path.js +24 -11
- package/dist/VirtualPackageManager/index.d.ts +4 -2
- package/dist/VirtualPackageManager/index.js +24 -4
- package/dist/VirtualShell/index.d.ts +6 -3
- package/dist/VirtualShell/index.js +3 -10
- package/dist/VirtualShell/shell.js +114 -140
- package/dist/VirtualShell/shellParser.js +1 -22
- package/dist/commands/exit.js +1 -1
- package/dist/commands/find.js +1 -4
- package/dist/commands/helpers.d.ts +0 -20
- package/dist/commands/helpers.js +0 -97
- package/dist/commands/id.js +8 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/manuals-bundle.js +10 -1
- package/dist/commands/perl.js +1 -1
- package/dist/commands/python.js +5 -2
- package/dist/commands/registry.js +6 -1
- package/dist/commands/rm.d.ts +1 -1
- package/dist/commands/rm.js +48 -11
- package/dist/commands/runtime.d.ts +5 -0
- package/dist/commands/runtime.js +90 -88
- package/dist/commands/strace.js +1 -1
- package/dist/commands/tar.js +2 -2
- package/dist/commands/test.js +2 -2
- package/dist/modules/linuxRootfs.js +7 -6
- package/dist/modules/nanoEditor.d.ts +92 -0
- package/dist/modules/nanoEditor.js +956 -0
- package/dist/modules/neofetch.js +2 -2
- package/dist/modules/webTermRenderer.d.ts +42 -0
- package/dist/modules/webTermRenderer.js +291 -0
- package/dist/types/commands.d.ts +4 -0
- package/dist/utils/argv.d.ts +6 -0
- package/dist/utils/argv.js +32 -0
- package/dist/utils/expand.d.ts +5 -2
- package/dist/utils/expand.js +70 -67
- package/dist/utils/glob.d.ts +6 -0
- package/dist/utils/glob.js +34 -0
- package/dist/utils/shellSession.d.ts +10 -0
- package/dist/utils/shellSession.js +56 -0
- package/dist/utils/tokenize.js +13 -13
- 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.
|
|
48
|
-
| **Standalone CLI** | `builds/fortune-nyx-v1.5.
|
|
47
|
+
| **Web shell** | `builds/fortune-nyx-v1.5.8-web.min.js` (ESM) | Embedded terminals, interactive tutorials, browser demos |
|
|
48
|
+
| **Standalone CLI** | `builds/fortune-nyx-v1.5.8-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
|
-
####
|
|
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.
|
|
69
|
+
curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.8-directbash-k6.1.0.mjs -o fortune-nyx-v1.5.8-directbash-k6.1.0.mjs && node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
#### SSH server
|
|
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.
|
|
74
|
+
curl -s https://raw.githubusercontent.com/itsrealfortune/typescript-virtual-container/refs/heads/main/builds/fortune-nyx-v1.5.8-ssh.cjs -o fortune-nyx-v1.5.8-ssh.cjs && node fortune-nyx-v1.5.8-ssh.cjs
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
#### SSH
|
|
77
|
+
#### Custom SSH port
|
|
78
78
|
```bash
|
|
79
|
-
|
|
79
|
+
node fortune-nyx-v1.5.8-ssh.cjs --ssh-port=2022
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### SSH disabled (handler only, no server started)
|
|
83
|
+
```bash
|
|
84
|
+
node fortune-nyx-v1.5.8-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.
|
|
92
|
+
**`fortune-nyx-v1.5.8-directbash-k6.1.0.mjs` options:**
|
|
88
93
|
|
|
89
94
|
```bash
|
|
90
|
-
node fortune-nyx-v1.5.
|
|
91
|
-
node fortune-nyx-v1.5.
|
|
92
|
-
node fortune-nyx-v1.5.
|
|
93
|
-
|
|
95
|
+
node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs # boot as root
|
|
96
|
+
node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs --user alice # boot as alice (prompts for password if set)
|
|
97
|
+
node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs --user=alice # same, inline form
|
|
98
|
+
node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs --hostname=my-box # custom hostname
|
|
99
|
+
node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs --snapshot=/data/.vfs # custom VFS snapshot path
|
|
100
|
+
node fortune-nyx-v1.5.8-directbash-k6.1.0.mjs --help # show all options
|
|
101
|
+
node fortune-nyx-v1.5.8-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.
|
|
128
|
+
| `builds/fortune-nyx-v1.5.8-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.
|
|
140
|
+
**`fortune-nyx-v1.5.8-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.
|
|
144
|
+
import { createWebShell } from "./builds/fortune-nyx-v1.5.8-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.
|
|
156
|
+
**`fortune-nyx-v1.5.8-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.
|
|
160
|
+
import { createVirtualShellShim } from "./builds/fortune-nyx-v1.5.8-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.
|
|
1240
|
-
- [x] Self-standalone CLI (`fortune-nyx-v1.5.
|
|
1247
|
+
- [x] Web shell bundles (`fortune-nyx-v1.5.8-web.min.js`) — fully browser-native with IndexedDB VFS
|
|
1248
|
+
- [x] Self-standalone CLI (`fortune-nyx-v1.5.8-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)
|