brsh 2.8.0 → 3.0.0
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/.github/workflows/release.yml +3 -1
- package/CHANGELOG.md +32 -0
- package/bin/brsh-shell.js +16 -131
- package/bin/exportFileSystem.js +4 -0
- package/bin/zsh-server.js +261 -0
- package/dist/brsh.css +1 -1
- package/dist/shell.es.js +943 -499
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +31 -16
- package/dist/shell.min.js.map +1 -1
- package/dist/terminal.cjs.js +77 -100
- package/dist/terminal.cjs.js.map +1 -1
- package/dist/terminal.es.js +1382 -603
- package/dist/terminal.es.js.map +1 -1
- package/dist/terminal.min.js +77 -100
- package/dist/terminal.min.js.map +1 -1
- package/dist/wbt.es.js +1863 -752
- package/dist/wbt.es.js.map +1 -1
- package/dist/wbt.min.js +8 -6
- package/dist/wbt.min.js.map +1 -1
- package/index.js +472 -0
- package/lib/BaseFileSystem.js +40 -0
- package/lib/BinaryContainer.js +1 -1
- package/lib/Command.js +30 -0
- package/lib/FileSystem.js +1 -38
- package/lib/InteractiveCommand.js +28 -0
- package/lib/NodeFileSystem.js +4 -2
- package/lib/ReplCommand.js +15 -0
- package/lib/Terminal.js +769 -510
- package/lib/TtyStream.js +181 -0
- package/lib/WasmCommand.js +168 -18
- package/lib/builtins/cat.js +2 -2
- package/lib/builtins/grep.js +2 -2
- package/lib/local/clear.js +3 -0
- package/lib/terminal/DomRenderer.js +325 -0
- package/lib/terminal/PtyBridge.js +169 -0
- package/lib/terminal/ScreenBuffer.js +594 -0
- package/lib/terminal/VtParser.js +728 -0
- package/lib/wbt/index.js +270 -14
- package/lib/wbt/packages/wllama.js +12 -2
- package/lib/wbt/registry.js +11 -2
- package/package.json +4 -2
- package/styles/terminal.css +33 -4
- package/test/terminal.test.js +762 -40
- package/test/wbt.test.js +24 -5
package/test/wbt.test.js
CHANGED
|
@@ -508,7 +508,7 @@ function createTestWbt() {
|
|
|
508
508
|
return null;
|
|
509
509
|
},
|
|
510
510
|
fetch: async (url) => {
|
|
511
|
-
if (url === 'https://example.com/hello.wasm') {
|
|
511
|
+
if (url === 'https://example.com/hello.wasm' || /\.wasm(\?.*)?$/i.test(url)) {
|
|
512
512
|
return {
|
|
513
513
|
ok: true,
|
|
514
514
|
status: 200,
|
|
@@ -624,6 +624,29 @@ describe('WBT CLI subcommands (list, search, show, install, remove, update)', ()
|
|
|
624
624
|
expect(errors.join(' ')).toContain('Unable to locate package nonexistent-wasm-pkg');
|
|
625
625
|
});
|
|
626
626
|
|
|
627
|
+
it('pulls and persists the .wasm binary to /var/lib/wbt/wasm/<pkg>.wasm on `wbt install` and removes it on `wbt remove`', async () => {
|
|
628
|
+
const fetchedUrls = [];
|
|
629
|
+
const BaseWbt = createTestWbt();
|
|
630
|
+
const TrackingWbt = BaseWbt.configure({
|
|
631
|
+
fetch: async (url) => {
|
|
632
|
+
fetchedUrls.push(url);
|
|
633
|
+
return BaseWbt._config.fetch(url);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
shell.context.setCommand(TrackingWbt);
|
|
637
|
+
|
|
638
|
+
const installRes = await run(shell, 'wbt install sqlite3');
|
|
639
|
+
expect(installRes.exitCode).toBe(0);
|
|
640
|
+
expect(fetchedUrls.some(u => u.includes('sql-wasm.wasm'))).toBe(true);
|
|
641
|
+
expect(shell.context.fs.exists('/var/lib/wbt/wasm/sqlite3.wasm')).toBe(true);
|
|
642
|
+
|
|
643
|
+
const showRes = await run(shell, 'wbt show sqlite3');
|
|
644
|
+
expect(showRes.output.join('\n')).toContain('WASM-File: /var/lib/wbt/wasm/sqlite3.wasm');
|
|
645
|
+
|
|
646
|
+
await run(shell, 'wbt remove sqlite3');
|
|
647
|
+
expect(shell.context.fs.exists('/var/lib/wbt/wasm/sqlite3.wasm')).toBe(false);
|
|
648
|
+
});
|
|
649
|
+
|
|
627
650
|
it('removes an installed package and unregisters its binary from /bin', async () => {
|
|
628
651
|
await run(shell, 'wbt install sqlite3');
|
|
629
652
|
const check1 = await run(shell, 'which sqlite3');
|
|
@@ -1169,7 +1192,3 @@ describe('WBT Wllama v3 WASM & WebGPU package (`wllama`, `llama`, `llama-cli`)',
|
|
|
1169
1192
|
expect(modelsRes.output.join('\n')).toContain('persisted (fs)');
|
|
1170
1193
|
});
|
|
1171
1194
|
});
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|