frameassembly-wasm 3.1.2 → 3.2.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/README.md +14 -31
- package/frameassembly_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
# FrameAssembly WebAssembly Compiler (`frameassembly-wasm` v3.
|
|
1
|
+
# FrameAssembly WebAssembly Compiler (`frameassembly-wasm` v3.2.0)
|
|
2
2
|
|
|
3
3
|
[](https://frameassembly-lang.dev/)
|
|
4
|
-
[](https://www.npmjs.com/package/frameassembly-wasm)
|
|
5
4
|
[](https://github.com/SteveWinschel/FrameAssembly/blob/main/LICENSE)
|
|
6
5
|
|
|
7
|
-
[**Try in Browser (`frameassembly-lang.dev`)**](https://frameassembly-lang.dev/) • [**
|
|
6
|
+
[**Try in Browser (`frameassembly-lang.dev`)**](https://frameassembly-lang.dev/) • [**Building Locally**](#building-locally) • [**Vite, React & Next.js**](#initialization-vite-react-nextjs--browser-apps) • [**API Reference**](#api-reference)
|
|
8
7
|
|
|
9
|
-
WebAssembly compiler, `.pcap`/`.pcapng`-to-`.frasm` decompiler, packet ladder inspector, and UTF-16
|
|
8
|
+
`frameassembly-wasm` (`v3.2.0`) is the **internal WebAssembly compiler, `.pcap`/`.pcapng`-to-`.frasm` decompiler, packet ladder inspector, and UTF-16 diagnostic engine** powering [**`frameassembly-lang.dev`**](https://frameassembly-lang.dev/) and the official VS Code extension (`SteveWinschel.frameassembly-vscode`). It compiles `.frasm` code into classic `.pcap` and `.pcapng` packet captures and decompiles existing captures back into `.frasm` code across 81 L2–L7 protocols directly inside browser applications and VS Code Desktop/Web Extension Hosts. *(CLI users should install the native binary via `cargo install frameassembly` and update with `frameassembly update`. FrameAssembly is a network packet specification compiler, not x86 Flat Assembler.)*
|
|
10
9
|
|
|
11
10
|
---
|
|
12
11
|
|
|
@@ -34,7 +33,7 @@ import init, {
|
|
|
34
33
|
validate_fasm,
|
|
35
34
|
inspect_fasm,
|
|
36
35
|
reversePcap,
|
|
37
|
-
} from "
|
|
36
|
+
} from "./pkg/frameassembly_wasm.js";
|
|
38
37
|
|
|
39
38
|
// Initialize WASM module once at startup
|
|
40
39
|
await init();
|
|
@@ -69,39 +68,23 @@ if (diagnostics.length === 0) {
|
|
|
69
68
|
}
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
```bash
|
|
73
|
-
npm install frameassembly-wasm
|
|
74
|
-
```
|
|
75
|
-
|
|
76
71
|
---
|
|
77
72
|
|
|
78
|
-
##
|
|
73
|
+
## Building Locally
|
|
74
|
+
|
|
75
|
+
`frameassembly-wasm` is an internal workspace crate powering [`frameassembly-lang.dev`](https://frameassembly-lang.dev/) and `frameassembly-vscode` rather than a standalone user CLI package. Build the WebAssembly bundle directly from the repository root using `wasm-pack`:
|
|
79
76
|
|
|
80
77
|
```bash
|
|
81
|
-
|
|
78
|
+
wasm-pack build frameassembly-wasm --release --target web
|
|
82
79
|
```
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```html
|
|
87
|
-
<script type="module">
|
|
88
|
-
import init, {
|
|
89
|
-
validate_fasm,
|
|
90
|
-
inspect_fasm,
|
|
91
|
-
compile_fasm_to_pcapng,
|
|
92
|
-
reversePcap,
|
|
93
|
-
} from "https://cdn.jsdelivr.net/npm/frameassembly-wasm@3.1.2/frameassembly_wasm.js";
|
|
94
|
-
|
|
95
|
-
await init();
|
|
96
|
-
console.log("FrameAssembly WebAssembly engine v3.1.2 loaded successfully.");
|
|
97
|
-
</script>
|
|
98
|
-
```
|
|
81
|
+
This generates `frameassembly-wasm/pkg/{frameassembly_wasm.js,frameassembly_wasm_bg.wasm,frameassembly_wasm.d.ts,package.json}` for bundling into [`frameassembly-lang.dev`](https://frameassembly-lang.dev/) or `frameassembly-vscode/wasm/`. For command-line `.frasm` compilation and `.pcap` decompilation, install `cargo install frameassembly` and update with `frameassembly update`.
|
|
99
82
|
|
|
100
83
|
---
|
|
101
84
|
|
|
102
|
-
## Initialization (Vite, React, Next.js &
|
|
85
|
+
## Initialization (Vite, React, Next.js & Browser Apps)
|
|
103
86
|
|
|
104
|
-
Import the WebAssembly binary URL explicitly with `?url` so Vite, Webpack 5, and Next.js serve the `.wasm` asset cleanly in both development and production builds:
|
|
87
|
+
Import the generated WebAssembly binary URL explicitly with `?url` so Vite, Webpack 5, and Next.js serve the `.wasm` asset cleanly in both development and production builds:
|
|
105
88
|
|
|
106
89
|
```ts
|
|
107
90
|
import init, {
|
|
@@ -112,8 +95,8 @@ import init, {
|
|
|
112
95
|
type IdeDiagnostic,
|
|
113
96
|
type PacketPreview,
|
|
114
97
|
type ReversePcapResult,
|
|
115
|
-
} from "
|
|
116
|
-
import wasmUrl from "
|
|
98
|
+
} from "./pkg/frameassembly_wasm.js";
|
|
99
|
+
import wasmUrl from "./pkg/frameassembly_wasm_bg.wasm?url";
|
|
117
100
|
|
|
118
101
|
// Call once at application startup (idempotent)
|
|
119
102
|
await init({ module_or_path: wasmUrl });
|
|
@@ -180,7 +163,7 @@ type ReverseJsResult = ReversePcapResult;
|
|
|
180
163
|
## Complete Browser Playground & Download Example
|
|
181
164
|
|
|
182
165
|
```ts
|
|
183
|
-
import init, { compile_fasm_to_pcapng, reversePcap, validate_fasm } from "
|
|
166
|
+
import init, { compile_fasm_to_pcapng, reversePcap, validate_fasm } from "./pkg/frameassembly_wasm.js";
|
|
184
167
|
|
|
185
168
|
export async function downloadCapture(frasmCode: string, filename = "capture.pcapng") {
|
|
186
169
|
await init();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Steve Winschel"
|
|
6
6
|
],
|
|
7
7
|
"description": "Compile .frasm network traffic code to .pcapng and decompile .pcap/.pcapng packet captures in WebAssembly across 81 L2-L7 protocols with live IDE diagnostics and frame inspection.",
|
|
8
|
-
"version": "3.
|
|
8
|
+
"version": "3.2.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|