frameassembly-wasm 3.0.0 → 3.1.1

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 CHANGED
@@ -1,4 +1,4 @@
1
- # FrameAssembly WebAssembly Compiler (`frameassembly-wasm` v3.0.0)
1
+ # FrameAssembly WebAssembly Compiler (`frameassembly-wasm` v3.1.1)
2
2
 
3
3
  [![Website & Playground](https://img.shields.io/badge/web%20app-frameassembly.ai.studio-0ea5e9.svg)](https://frameassembly.ai.studio/)
4
4
  [![NPM](https://img.shields.io/npm/v/frameassembly-wasm.svg)](https://www.npmjs.com/package/frameassembly-wasm)
@@ -6,13 +6,13 @@
6
6
 
7
7
  [**Try in Browser (`frameassembly.ai.studio`)**](https://frameassembly.ai.studio/) • [**Installation**](#installation) • [**Vite, React & Next.js**](#initialization-vite-react-nextjs--google-ai-studio) • [**API Reference**](#api-reference)
8
8
 
9
- WebAssembly compiler, `.pcap`/`.pcapng`-to-`.frasm` decompiler, packet ladder inspector, and UTF-16 IDE diagnostics for **FrameAssembly (`.frasm` v3.0.0)** — compiling `.frasm` code into `.pcapng` packet captures and decompiling existing captures back into `.frasm` code across 81 L2–L7 protocols in browser applications, VS Code Desktop & Web extensions, web cyber ranges, and Node.js test suites. Powers the official FrameAssembly interactive browser playground at [**frameassembly.ai.studio**](https://frameassembly.ai.studio/) and the official VS Code extension (`SteveWinschel.frameassembly-vscode`). *(Note: FrameAssembly is a network packet specification compiler, not x86 Flat Assembler).*
9
+ WebAssembly compiler, `.pcap`/`.pcapng`-to-`.frasm` decompiler, packet ladder inspector, and UTF-16 IDE diagnostics for **FrameAssembly (`.frasm` v3.1.1)** — compiling `.frasm` code into classic `.pcap` and `.pcapng` packet captures and decompiling existing captures back into `.frasm` code across 81 L2–L7 protocols in browser applications, VS Code Desktop & Web extensions, web cyber ranges, and Node.js test suites. Powers the official FrameAssembly interactive browser playground at [**frameassembly.ai.studio**](https://frameassembly.ai.studio/) and the official VS Code extension (`SteveWinschel.frameassembly-vscode`). *(Note: FrameAssembly is a network packet specification compiler, not x86 Flat Assembler).*
10
10
 
11
11
  ---
12
12
 
13
13
  ## Client-Side `.frasm` to `.pcapng` Compilation & PCAP Decompilation in the Browser & Node.js
14
14
 
15
- `frameassembly-wasm` compiles the FrameAssembly Rust engine to WebAssembly, turning `.frasm` code into `.pcapng` byte streams, decompiling binary `.pcap` and `.pcapng` captures into strict-lowercase `.frasm` code via `reverse_pcap(pcapBytes)` / `reversePcap(pcapBytes)`, and emitting real-time Monaco, CodeMirror, and VS Code diagnostics directly in the browser or Node.js without a backend server:
15
+ `frameassembly-wasm` compiles the FrameAssembly Rust engine to WebAssembly, turning `.frasm` code into classic `.pcap` (`compileFrasmToPcap` / `compile_frasm_to_pcap`) or `.pcapng` (`compile_fasm_to_pcapng` / `compileFrasm`) byte streams, decompiling binary `.pcap` and `.pcapng` captures into strict-lowercase `.frasm` code via `reverse_pcap(pcapBytes)` / `reversePcap(pcapBytes)`, and emitting real-time Monaco, CodeMirror, and VS Code diagnostics directly in the browser or Node.js without a backend server:
16
16
 
17
17
  ```frameassembly
18
18
  host client { ip 192.168.1.10 mac 00:11:22:33:44:55 }
@@ -90,10 +90,10 @@ npm install frameassembly-wasm
90
90
  inspect_fasm,
91
91
  compile_fasm_to_pcapng,
92
92
  reversePcap,
93
- } from "https://cdn.jsdelivr.net/npm/frameassembly-wasm@3.0.0/frameassembly_wasm.js";
93
+ } from "https://cdn.jsdelivr.net/npm/frameassembly-wasm@3.1.1/frameassembly_wasm.js";
94
94
 
95
95
  await init();
96
- console.log("FrameAssembly WebAssembly engine v3.0.0 loaded successfully.");
96
+ console.log("FrameAssembly WebAssembly engine v3.1.1 loaded successfully.");
97
97
  </script>
98
98
  ```
99
99
 
@@ -154,6 +154,9 @@ interface PacketPreview {
154
154
  }
155
155
  ```
156
156
 
157
+ ### `compileFrasmToPcap(source: string): Uint8Array` / `compile_frasm_to_pcap(source: string): Uint8Array`
158
+ Compiles `.frasm` source code into a binary `Uint8Array` containing a valid classic libpcap (`.pcap`) byte stream (`LINKTYPE_ETHERNET`, `snaplen = 65535`, automatic microsecond or nanosecond timestamp header selection). Throws a JavaScript `Error` with diagnostic context if compilation fails.
159
+
157
160
  ### `compile_fasm_to_pcapng(source: string): Uint8Array` / `compileFasm(source: string): Uint8Array` (alias: `compile_frasm_to_pcapng` / `compileFrasm`)
158
161
  Compiles `.frasm` source code into a binary `Uint8Array` containing a valid, standards-compliant PCAPNG byte stream with nanosecond timestamp precision (`IfTsResol = 9`). Throws a JavaScript `Error` with diagnostic context if compilation fails.
159
162
 
@@ -223,4 +226,4 @@ export async function importCaptureFile(file: File): Promise<string> {
223
226
 
224
227
  **FrameAssembly** (`.frasm`, media type `text/vnd.frameassembly`) is a network packet specification compiler for generating and decompiling `.pcap` and `.pcapng` packet captures. It is completely unrelated to x86 Flat Assembler (`fasm.net`, which uses `.asm`/`.fasm` files) and SymbiFlow / F4PGA FPGA bitstream FASM tools.
225
228
 
226
- Full documentation, interactive browser playground ([https://frameassembly.ai.studio/](https://frameassembly.ai.studio/)), grammar specifications, and 2,611 verified examples: https://github.com/SteveWinschel/FrameAssembly
229
+ Interactive browser playground: [https://frameassembly.ai.studio/](https://frameassembly.ai.studio/) • Documentation: [https://frameassembly.ai.studio/docs](https://frameassembly.ai.studio/docs) • Use cases and examples: [https://frameassembly.ai.studio/use-cases](https://frameassembly.ai.studio/use-cases) • Source code and formal grammars: https://github.com/SteveWinschel/FrameAssembly
@@ -48,11 +48,27 @@ export function compileFasm(source: string): Uint8Array;
48
48
  */
49
49
  export function compileFrasm(source: string): Uint8Array;
50
50
 
51
+ /**
52
+ * Compiles `.frasm` source into a classic libpcap (`.pcap`) byte array (`compileFrasmToPcap` JS `Uint8Array`).
53
+ *
54
+ * # Errors
55
+ * Returns a JavaScript `JsValue` error if parsing, validation, or serialization fails.
56
+ */
57
+ export function compileFrasmToPcap(source: string): Uint8Array;
58
+
51
59
  /**
52
60
  * Compiles `.frasm` source into a standards-compliant PCAPNG byte array (JS `Uint8Array`).
53
61
  */
54
62
  export function compile_fasm_to_pcapng(source: string): Uint8Array;
55
63
 
64
+ /**
65
+ * Compiles `.frasm` source into a classic libpcap (`.pcap`) byte array (`compile_frasm_to_pcap` JS alias).
66
+ *
67
+ * # Errors
68
+ * Returns a JavaScript `JsValue` error if parsing, validation, or serialization fails.
69
+ */
70
+ export function compile_frasm_to_pcap(source: string): Uint8Array;
71
+
56
72
  /**
57
73
  * Compiles `.frasm` source into a standards-compliant PCAPNG byte array (JS `Uint8Array`).
58
74
  */
@@ -118,7 +134,9 @@ export interface InitOutput {
118
134
  readonly memory: WebAssembly.Memory;
119
135
  readonly compileFasm: (a: number, b: number) => [number, number, number, number];
120
136
  readonly compileFrasm: (a: number, b: number) => [number, number, number, number];
137
+ readonly compileFrasmToPcap: (a: number, b: number) => [number, number, number, number];
121
138
  readonly compile_fasm_to_pcapng: (a: number, b: number) => [number, number, number, number];
139
+ readonly compile_frasm_to_pcap: (a: number, b: number) => [number, number, number, number];
122
140
  readonly compile_frasm_to_pcapng: (a: number, b: number) => [number, number, number, number];
123
141
  readonly inspectFrasm: (a: number, b: number) => [number, number, number];
124
142
  readonly inspect_fasm: (a: number, b: number) => [number, number, number];
@@ -34,6 +34,26 @@ export function compileFrasm(source) {
34
34
  return v2;
35
35
  }
36
36
 
37
+ /**
38
+ * Compiles `.frasm` source into a classic libpcap (`.pcap`) byte array (`compileFrasmToPcap` JS `Uint8Array`).
39
+ *
40
+ * # Errors
41
+ * Returns a JavaScript `JsValue` error if parsing, validation, or serialization fails.
42
+ * @param {string} source
43
+ * @returns {Uint8Array}
44
+ */
45
+ export function compileFrasmToPcap(source) {
46
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ const ret = wasm.compileFrasmToPcap(ptr0, len0);
49
+ if (ret[3]) {
50
+ throw takeFromExternrefTable0(ret[2]);
51
+ }
52
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
53
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
54
+ return v2;
55
+ }
56
+
37
57
  /**
38
58
  * Compiles `.frasm` source into a standards-compliant PCAPNG byte array (JS `Uint8Array`).
39
59
  * @param {string} source
@@ -51,6 +71,26 @@ export function compile_fasm_to_pcapng(source) {
51
71
  return v2;
52
72
  }
53
73
 
74
+ /**
75
+ * Compiles `.frasm` source into a classic libpcap (`.pcap`) byte array (`compile_frasm_to_pcap` JS alias).
76
+ *
77
+ * # Errors
78
+ * Returns a JavaScript `JsValue` error if parsing, validation, or serialization fails.
79
+ * @param {string} source
80
+ * @returns {Uint8Array}
81
+ */
82
+ export function compile_frasm_to_pcap(source) {
83
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
84
+ const len0 = WASM_VECTOR_LEN;
85
+ const ret = wasm.compile_frasm_to_pcap(ptr0, len0);
86
+ if (ret[3]) {
87
+ throw takeFromExternrefTable0(ret[2]);
88
+ }
89
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
90
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
91
+ return v2;
92
+ }
93
+
54
94
  /**
55
95
  * Compiles `.frasm` source into a standards-compliant PCAPNG byte array (JS `Uint8Array`).
56
96
  * @param {string} source
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.0.0",
8
+ "version": "3.1.1",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",