From 90a55efcaf0e3c5da9568f6f3128d52afd7ac6e9 Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 14:40:42 +0200 Subject: [PATCH 01/10] feat(fetch): enhance Node.js Readable stream handling for backpressure (ESFA-0) Improves the fetch function to manage backpressure when processing Node.js Readable streams. This change pauses the stream during data transmission to prevent overwhelming the system, ensuring smoother data flow and better resource management. Signed-off-by: Tobias Pressler --- packages/nodejs/src/bridge/network.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/nodejs/src/bridge/network.ts b/packages/nodejs/src/bridge/network.ts index 764a8bc3..a7276baa 100644 --- a/packages/nodejs/src/bridge/network.ts +++ b/packages/nodejs/src/bridge/network.ts @@ -504,16 +504,22 @@ export async function fetch(input: string | URL | Request, options: FetchOptions await sendBytes(bytes); } } else { - // Node.js Readable stream + // Node.js Readable stream — pause/resume for backpressure await new Promise((resolve, reject) => { const stream = rawBody as any; + let pending: Promise = Promise.resolve(); stream.on("data", (data: any) => { const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data); - sendBytes(bytes); + stream.pause(); + pending = pending.then(() => sendBytes(bytes)).then(() => { + stream.resume(); + }); + }); + stream.on("end", () => { + pending.then(() => resolve(), reject); }); - stream.on("end", () => resolve()); stream.on("error", (err: any) => reject(err)); }); } From 28c807d4f4be2caa328c692665f05bbfb7f78f7e Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 14:40:51 +0200 Subject: [PATCH 02/10] release: 0.2.3-rc.1 Signed-off-by: Tobias Pressler --- native/v8-runtime/npm/darwin-arm64/package.json | 2 +- native/v8-runtime/npm/darwin-x64/package.json | 2 +- native/v8-runtime/npm/linux-arm64-gnu/package.json | 2 +- native/v8-runtime/npm/linux-x64-gnu/package.json | 2 +- native/v8-runtime/npm/win32-x64/package.json | 2 +- package.json | 2 +- packages/core/package.json | 2 +- packages/nodejs/package.json | 2 +- packages/secure-exec/package.json | 2 +- packages/typescript/package.json | 2 +- packages/v8/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/native/v8-runtime/npm/darwin-arm64/package.json b/native/v8-runtime/npm/darwin-arm64/package.json index 09eff2f6..c5a9466f 100644 --- a/native/v8-runtime/npm/darwin-arm64/package.json +++ b/native/v8-runtime/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-arm64", - "version": "0.2.2", + "version": "0.2.3-rc.1", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/darwin-x64/package.json b/native/v8-runtime/npm/darwin-x64/package.json index 005e0b93..510af748 100644 --- a/native/v8-runtime/npm/darwin-x64/package.json +++ b/native/v8-runtime/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-x64", - "version": "0.2.2", + "version": "0.2.3-rc.1", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-arm64-gnu/package.json b/native/v8-runtime/npm/linux-arm64-gnu/package.json index b1373346..d6bd6c41 100644 --- a/native/v8-runtime/npm/linux-arm64-gnu/package.json +++ b/native/v8-runtime/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-arm64-gnu", - "version": "0.2.2", + "version": "0.2.3-rc.1", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-x64-gnu/package.json b/native/v8-runtime/npm/linux-x64-gnu/package.json index 9d777a2b..895dc33a 100644 --- a/native/v8-runtime/npm/linux-x64-gnu/package.json +++ b/native/v8-runtime/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-x64-gnu", - "version": "0.2.2", + "version": "0.2.3-rc.1", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/win32-x64/package.json b/native/v8-runtime/npm/win32-x64/package.json index 21c03749..bb0fa472 100644 --- a/native/v8-runtime/npm/win32-x64/package.json +++ b/native/v8-runtime/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-win32-x64", - "version": "0.2.2", + "version": "0.2.3-rc.1", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/package.json b/package.json index 0f21625b..496fb9a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firestart-secure-exec-monorepo", - "version": "0.2.2", + "version": "0.2.3-rc.1", "private": true, "license": "Apache-2.0", "type": "module", diff --git a/packages/core/package.json b/packages/core/package.json index 883403e6..b784da39 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-core", - "version": "0.2.2", + "version": "0.2.3-rc.1", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/nodejs/package.json b/packages/nodejs/package.json index 341985c9..45253001 100644 --- a/packages/nodejs/package.json +++ b/packages/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-nodejs", - "version": "0.2.2", + "version": "0.2.3-rc.1", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/secure-exec/package.json b/packages/secure-exec/package.json index 6668f886..398c9751 100644 --- a/packages/secure-exec/package.json +++ b/packages/secure-exec/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec", - "version": "0.2.2", + "version": "0.2.3-rc.1", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 71b33239..241cbede 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@secure-exec/typescript", - "version": "0.2.2", + "version": "0.2.3-rc.1", "private": true, "type": "module", "license": "Apache-2.0", diff --git a/packages/v8/package.json b/packages/v8/package.json index 9685c991..06ff0f68 100644 --- a/packages/v8/package.json +++ b/packages/v8/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8", - "version": "0.2.2", + "version": "0.2.3-rc.1", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", From 91a58fc0ff39523d230906508b826222bcc7ecd9 Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 15:10:54 +0200 Subject: [PATCH 03/10] fix(http): improve binary content type detection in body encoding logic Updated the shouldEncodeHttpBodyAsBinary function to enhance the detection of binary content types. The new logic explicitly checks for text-based content types and assumes text for empty content-type headers, ensuring backward compatibility. This change aims to prevent incorrect encoding of binary data, improving overall data handling in HTTP requests. Signed-off-by: Tobias Pressler --- packages/nodejs/src/bridge-handlers.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/nodejs/src/bridge-handlers.ts b/packages/nodejs/src/bridge-handlers.ts index 0a63b5c4..f86a987c 100644 --- a/packages/nodejs/src/bridge-handlers.ts +++ b/packages/nodejs/src/bridge-handlers.ts @@ -4150,11 +4150,24 @@ function shouldEncodeHttpBodyAsBinary( ): boolean { const contentType = headers["content-type"] || ""; const headerValue = Array.isArray(contentType) ? contentType.join(", ") : contentType; - return ( - headerValue.includes("octet-stream") || - headerValue.includes("gzip") || - urlString.endsWith(".tgz") - ); + // No content-type — assume text for backward compatibility + if (!headerValue) { + return false; + } + // Explicitly text-based content types — keep as UTF-8 string + if ( + headerValue.startsWith("text/") || + headerValue.includes("application/json") || + headerValue.includes("application/xml") || + headerValue.includes("application/javascript") || + headerValue.includes("application/x-www-form-urlencoded") || + headerValue.includes("+xml") || + headerValue.includes("+json") + ) { + return false; + } + // Everything else (binary content types like application/pdf, image/*, etc.) + return true; } /** From 4e6eb9942932f4afa5c211af6b82ae12e6389790 Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 15:11:26 +0200 Subject: [PATCH 04/10] release: 0.2.3-rc.2 Signed-off-by: Tobias Pressler --- native/v8-runtime/npm/darwin-arm64/package.json | 2 +- native/v8-runtime/npm/darwin-x64/package.json | 2 +- native/v8-runtime/npm/linux-arm64-gnu/package.json | 2 +- native/v8-runtime/npm/linux-x64-gnu/package.json | 2 +- native/v8-runtime/npm/win32-x64/package.json | 2 +- package.json | 2 +- packages/core/package.json | 2 +- packages/nodejs/package.json | 2 +- packages/secure-exec/package.json | 2 +- packages/typescript/package.json | 2 +- packages/v8/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/native/v8-runtime/npm/darwin-arm64/package.json b/native/v8-runtime/npm/darwin-arm64/package.json index c5a9466f..9ed46848 100644 --- a/native/v8-runtime/npm/darwin-arm64/package.json +++ b/native/v8-runtime/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-arm64", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/darwin-x64/package.json b/native/v8-runtime/npm/darwin-x64/package.json index 510af748..933783a8 100644 --- a/native/v8-runtime/npm/darwin-x64/package.json +++ b/native/v8-runtime/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-x64", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-arm64-gnu/package.json b/native/v8-runtime/npm/linux-arm64-gnu/package.json index d6bd6c41..becf08d0 100644 --- a/native/v8-runtime/npm/linux-arm64-gnu/package.json +++ b/native/v8-runtime/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-arm64-gnu", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-x64-gnu/package.json b/native/v8-runtime/npm/linux-x64-gnu/package.json index 895dc33a..9fc6a9bf 100644 --- a/native/v8-runtime/npm/linux-x64-gnu/package.json +++ b/native/v8-runtime/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-x64-gnu", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/win32-x64/package.json b/native/v8-runtime/npm/win32-x64/package.json index bb0fa472..522cddb4 100644 --- a/native/v8-runtime/npm/win32-x64/package.json +++ b/native/v8-runtime/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-win32-x64", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/package.json b/package.json index 496fb9a5..1ce48635 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firestart-secure-exec-monorepo", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "private": true, "license": "Apache-2.0", "type": "module", diff --git a/packages/core/package.json b/packages/core/package.json index b784da39..9585d147 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-core", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/nodejs/package.json b/packages/nodejs/package.json index 45253001..82b9211d 100644 --- a/packages/nodejs/package.json +++ b/packages/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-nodejs", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/secure-exec/package.json b/packages/secure-exec/package.json index 398c9751..90d14459 100644 --- a/packages/secure-exec/package.json +++ b/packages/secure-exec/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 241cbede..2f0775f9 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@secure-exec/typescript", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "private": true, "type": "module", "license": "Apache-2.0", diff --git a/packages/v8/package.json b/packages/v8/package.json index 06ff0f68..51ae74c5 100644 --- a/packages/v8/package.json +++ b/packages/v8/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8", - "version": "0.2.3-rc.1", + "version": "0.2.3-rc.2", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", From 5359049803825281cfae7310f4934757ac8c18dc Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 15:17:45 +0200 Subject: [PATCH 05/10] fix(http): improve binary content handling in fetch body encoding (ESFA-0) Updated the `shouldEncodeHttpBodyAsBinary` function to always encode response bodies as base64 across the bridge to prevent binary corruption. This change simplifies the logic by removing unnecessary content type checks, ensuring consistent handling of binary data. Additionally, enhanced the `encodeFetchBody` function to provide a fallback for base64 decoding using `atob` when Buffer is not available, improving compatibility across environments. Signed-off-by: Tobias Pressler --- packages/nodejs/src/bridge-handlers.ts | 25 ++++--------------------- packages/nodejs/src/bridge/network.ts | 13 +++++++++++-- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/packages/nodejs/src/bridge-handlers.ts b/packages/nodejs/src/bridge-handlers.ts index f86a987c..47d7baa5 100644 --- a/packages/nodejs/src/bridge-handlers.ts +++ b/packages/nodejs/src/bridge-handlers.ts @@ -4145,28 +4145,11 @@ async function maybeDecompressHttpBody( } function shouldEncodeHttpBodyAsBinary( - urlString: string, - headers: http.IncomingHttpHeaders, + _urlString: string, + _headers: http.IncomingHttpHeaders, ): boolean { - const contentType = headers["content-type"] || ""; - const headerValue = Array.isArray(contentType) ? contentType.join(", ") : contentType; - // No content-type — assume text for backward compatibility - if (!headerValue) { - return false; - } - // Explicitly text-based content types — keep as UTF-8 string - if ( - headerValue.startsWith("text/") || - headerValue.includes("application/json") || - headerValue.includes("application/xml") || - headerValue.includes("application/javascript") || - headerValue.includes("application/x-www-form-urlencoded") || - headerValue.includes("+xml") || - headerValue.includes("+json") - ) { - return false; - } - // Everything else (binary content types like application/pdf, image/*, etc.) + // Always encode response bodies as base64 across the bridge to prevent + // binary corruption. The isolate decodes via Buffer.from(body, "base64"). return true; } diff --git a/packages/nodejs/src/bridge/network.ts b/packages/nodejs/src/bridge/network.ts index a7276baa..bfdec3aa 100644 --- a/packages/nodejs/src/bridge/network.ts +++ b/packages/nodejs/src/bridge/network.ts @@ -328,8 +328,17 @@ function encodeFetchBody( body: string, bodyEncoding: string | null, ): Uint8Array { - if (bodyEncoding === "base64" && typeof Buffer !== "undefined") { - return new Uint8Array(Buffer.from(body, "base64")); + if (bodyEncoding === "base64") { + if (typeof Buffer !== "undefined") { + return new Uint8Array(Buffer.from(body, "base64")); + } + // Fallback base64 decode via atob + const binary = atob(body); + const bytes = new Uint8Array(binary.length); + for (let i = 0; i < binary.length; i++) { + bytes[i] = binary.charCodeAt(i); + } + return bytes; } if (typeof TextEncoder !== "undefined") { return new TextEncoder().encode(body); From 3736d96696a2f7a782ce0d7b800848d7b493fe40 Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 15:18:03 +0200 Subject: [PATCH 06/10] release: 0.2.3-rc.3 Signed-off-by: Tobias Pressler --- native/v8-runtime/npm/darwin-arm64/package.json | 2 +- native/v8-runtime/npm/darwin-x64/package.json | 2 +- native/v8-runtime/npm/linux-arm64-gnu/package.json | 2 +- native/v8-runtime/npm/linux-x64-gnu/package.json | 2 +- native/v8-runtime/npm/win32-x64/package.json | 2 +- package.json | 2 +- packages/core/package.json | 2 +- packages/nodejs/package.json | 2 +- packages/secure-exec/package.json | 2 +- packages/typescript/package.json | 2 +- packages/v8/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/native/v8-runtime/npm/darwin-arm64/package.json b/native/v8-runtime/npm/darwin-arm64/package.json index 9ed46848..e8da1a8e 100644 --- a/native/v8-runtime/npm/darwin-arm64/package.json +++ b/native/v8-runtime/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-arm64", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/darwin-x64/package.json b/native/v8-runtime/npm/darwin-x64/package.json index 933783a8..726abfbe 100644 --- a/native/v8-runtime/npm/darwin-x64/package.json +++ b/native/v8-runtime/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-x64", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-arm64-gnu/package.json b/native/v8-runtime/npm/linux-arm64-gnu/package.json index becf08d0..9b027adc 100644 --- a/native/v8-runtime/npm/linux-arm64-gnu/package.json +++ b/native/v8-runtime/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-arm64-gnu", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-x64-gnu/package.json b/native/v8-runtime/npm/linux-x64-gnu/package.json index 9fc6a9bf..065f3b15 100644 --- a/native/v8-runtime/npm/linux-x64-gnu/package.json +++ b/native/v8-runtime/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-x64-gnu", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/win32-x64/package.json b/native/v8-runtime/npm/win32-x64/package.json index 522cddb4..0706b244 100644 --- a/native/v8-runtime/npm/win32-x64/package.json +++ b/native/v8-runtime/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-win32-x64", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/package.json b/package.json index 1ce48635..8c282707 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firestart-secure-exec-monorepo", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "private": true, "license": "Apache-2.0", "type": "module", diff --git a/packages/core/package.json b/packages/core/package.json index 9585d147..29fb7ec3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-core", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/nodejs/package.json b/packages/nodejs/package.json index 82b9211d..72718b09 100644 --- a/packages/nodejs/package.json +++ b/packages/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-nodejs", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/secure-exec/package.json b/packages/secure-exec/package.json index 90d14459..c714bde7 100644 --- a/packages/secure-exec/package.json +++ b/packages/secure-exec/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 2f0775f9..36487dc3 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@secure-exec/typescript", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "private": true, "type": "module", "license": "Apache-2.0", diff --git a/packages/v8/package.json b/packages/v8/package.json index 51ae74c5..d4319515 100644 --- a/packages/v8/package.json +++ b/packages/v8/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8", - "version": "0.2.3-rc.2", + "version": "0.2.3-rc.3", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", From 7b088378a500b8818e0248835ce30bb7f8828074 Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 15:19:40 +0200 Subject: [PATCH 07/10] fix(http): enhance base64 response handling in fetch methods Updated the fetch response methods to improve handling of base64 encoded data. When the bodyEncoding is set to "base64", the code now checks for the availability of Buffer and falls back to using atob and TextDecoder if Buffer is not defined. This ensures compatibility across different environments and improves the robustness of the response processing. Signed-off-by: Tobias Pressler --- packages/nodejs/src/bridge/network.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/nodejs/src/bridge/network.ts b/packages/nodejs/src/bridge/network.ts index bfdec3aa..31eb40e3 100644 --- a/packages/nodejs/src/bridge/network.ts +++ b/packages/nodejs/src/bridge/network.ts @@ -650,16 +650,27 @@ export async function fetch(input: string | URL | Request, options: FetchOptions }, async text(): Promise { - if (bodyEncoding === "base64" && typeof Buffer !== "undefined") { - return Buffer.from(responseBody, "base64").toString("utf8"); + if (bodyEncoding === "base64") { + if (typeof Buffer !== "undefined") { + return Buffer.from(responseBody, "base64").toString("utf8"); + } + const binary = atob(responseBody); + return new TextDecoder().decode(Uint8Array.from(binary, c => c.charCodeAt(0))); } return responseBody; }, async json(): Promise { - const textBody = - bodyEncoding === "base64" && typeof Buffer !== "undefined" - ? Buffer.from(responseBody, "base64").toString("utf8") - : responseBody; + let textBody: string; + if (bodyEncoding === "base64") { + if (typeof Buffer !== "undefined") { + textBody = Buffer.from(responseBody, "base64").toString("utf8"); + } else { + const binary = atob(responseBody); + textBody = new TextDecoder().decode(Uint8Array.from(binary, c => c.charCodeAt(0))); + } + } else { + textBody = responseBody; + } return JSON.parse(textBody || "{}"); }, async arrayBuffer(): Promise { From a77e364801ea2311459e71eb6be3338c8084cbe9 Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 16:24:21 +0200 Subject: [PATCH 08/10] fix(response): enhance body handling to support Uint8Array and ArrayBuffer Updated the Response class to allow the body to be of type Uint8Array or ArrayBuffer, improving compatibility with binary data. The constructor now handles these types, and new methods for arrayBuffer and blob have been added to facilitate proper data handling. This change ensures that the response can correctly process and return various data formats, enhancing the overall functionality of the fetch API. Signed-off-by: Tobias Pressler --- packages/nodejs/src/bridge/network.ts | 66 ++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/packages/nodejs/src/bridge/network.ts b/packages/nodejs/src/bridge/network.ts index 31eb40e3..ff250b18 100644 --- a/packages/nodejs/src/bridge/network.ts +++ b/packages/nodejs/src/bridge/network.ts @@ -793,7 +793,7 @@ export class Request { // Response class export class Response { - private _body: string | null; + private _body: string | Uint8Array | null; status: number; statusText: string; headers: Headers; @@ -802,8 +802,19 @@ export class Response { url: string; redirected: boolean; - constructor(body?: string | null, init: { status?: number; statusText?: string; headers?: Record } = {}) { - this._body = body || null; + constructor(body?: string | ReadableStream | ArrayBuffer | Uint8Array | null, init: { status?: number; statusText?: string; headers?: Record } = {}) { + if (body === null || body === undefined) { + this._body = null; + } else if (typeof body === "string") { + this._body = body; + } else if (body instanceof Uint8Array) { + this._body = body; + } else if (body instanceof ArrayBuffer) { + this._body = new Uint8Array(body); + } else { + // ReadableStream — store reference, will be consumed lazily + this._body = body as any; + } this.status = init.status || 200; this.statusText = init.statusText || "OK"; this.headers = new Headers(init.headers); @@ -813,26 +824,59 @@ export class Response { this.redirected = false; } + private async _bytes(): Promise { + const body = this._body; + if (body === null) return new Uint8Array(0); + if (body instanceof Uint8Array) return body; + if (typeof body === "string") return new TextEncoder().encode(body); + // ReadableStream + const reader = (body as any).getReader(); + const chunks: Uint8Array[] = []; + while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value instanceof Uint8Array ? value : new Uint8Array(value)); + } + const total = chunks.reduce((s: number, c: Uint8Array) => s + c.length, 0); + const result = new Uint8Array(total); + let off = 0; + for (const c of chunks) { result.set(c, off); off += c.length; } + // Cache for subsequent calls + (this as any)._body = result; + return result; + } + async text(): Promise { - return String(this._body || ""); + const bytes = await this._bytes(); + return new TextDecoder().decode(bytes); } async json(): Promise { - return JSON.parse(this._body || "{}"); + return JSON.parse(await this.text()); + } + + async arrayBuffer(): Promise { + const bytes = await this._bytes(); + return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer; + } + + async blob(): Promise { + const bytes = await this._bytes(); + return new Blob([bytes as any], { type: this.headers.get("content-type") || "" }); } get body(): { getReader(): { read(): Promise<{ done: boolean; value?: Uint8Array }> } } | null { - const bodyStr = this._body; - if (bodyStr === null) return null; + const self = this; + if (this._body === null) return null; return { getReader() { let consumed = false; return { async read() { - if (consumed) return { done: true }; + if (consumed) return { done: true as const }; consumed = true; - const encoder = new TextEncoder(); - return { done: false, value: encoder.encode(bodyStr) }; + const bytes = await self._bytes(); + return { done: false as const, value: bytes }; }, }; }, @@ -840,7 +884,7 @@ export class Response { } clone(): Response { - return new Response(this._body, { status: this.status, statusText: this.statusText }); + return new Response(this._body as any, { status: this.status, statusText: this.statusText }); } static error(): Response { From 505e7459836bc980633552f9ee8b85f2a644c94b Mon Sep 17 00:00:00 2001 From: Tobias Pressler Date: Tue, 28 Apr 2026 16:24:40 +0200 Subject: [PATCH 09/10] release: 0.2.3-rc.4 Signed-off-by: Tobias Pressler --- native/v8-runtime/npm/darwin-arm64/package.json | 2 +- native/v8-runtime/npm/darwin-x64/package.json | 2 +- native/v8-runtime/npm/linux-arm64-gnu/package.json | 2 +- native/v8-runtime/npm/linux-x64-gnu/package.json | 2 +- native/v8-runtime/npm/win32-x64/package.json | 2 +- package.json | 2 +- packages/core/package.json | 2 +- packages/nodejs/package.json | 2 +- packages/secure-exec/package.json | 2 +- packages/typescript/package.json | 2 +- packages/v8/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/native/v8-runtime/npm/darwin-arm64/package.json b/native/v8-runtime/npm/darwin-arm64/package.json index e8da1a8e..0e75c7e7 100644 --- a/native/v8-runtime/npm/darwin-arm64/package.json +++ b/native/v8-runtime/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-arm64", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/darwin-x64/package.json b/native/v8-runtime/npm/darwin-x64/package.json index 726abfbe..6507d353 100644 --- a/native/v8-runtime/npm/darwin-x64/package.json +++ b/native/v8-runtime/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-darwin-x64", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-arm64-gnu/package.json b/native/v8-runtime/npm/linux-arm64-gnu/package.json index 9b027adc..640fe7ae 100644 --- a/native/v8-runtime/npm/linux-arm64-gnu/package.json +++ b/native/v8-runtime/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-arm64-gnu", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/linux-x64-gnu/package.json b/native/v8-runtime/npm/linux-x64-gnu/package.json index 065f3b15..4bdf7049 100644 --- a/native/v8-runtime/npm/linux-x64-gnu/package.json +++ b/native/v8-runtime/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-linux-x64-gnu", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/native/v8-runtime/npm/win32-x64/package.json b/native/v8-runtime/npm/win32-x64/package.json index 0706b244..9b5b2ad6 100644 --- a/native/v8-runtime/npm/win32-x64/package.json +++ b/native/v8-runtime/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8-win32-x64", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "license": "Apache-2.0", "publishConfig": { "registry": "https://npm.pkg.github.com" diff --git a/package.json b/package.json index 8c282707..2d4c7d64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firestart-secure-exec-monorepo", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "private": true, "license": "Apache-2.0", "type": "module", diff --git a/packages/core/package.json b/packages/core/package.json index 29fb7ec3..df746095 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-core", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/nodejs/package.json b/packages/nodejs/package.json index 72718b09..c9b7fc4e 100644 --- a/packages/nodejs/package.json +++ b/packages/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-nodejs", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/secure-exec/package.json b/packages/secure-exec/package.json index c714bde7..2b562f8f 100644 --- a/packages/secure-exec/package.json +++ b/packages/secure-exec/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 36487dc3..9b22878f 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@secure-exec/typescript", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "private": true, "type": "module", "license": "Apache-2.0", diff --git a/packages/v8/package.json b/packages/v8/package.json index d4319515..b52d73aa 100644 --- a/packages/v8/package.json +++ b/packages/v8/package.json @@ -1,6 +1,6 @@ { "name": "@firestartorg/secure-exec-v8", - "version": "0.2.3-rc.3", + "version": "0.2.3-rc.4", "type": "module", "license": "Apache-2.0", "main": "./dist/index.js", From 9bf7da0199d8b7dfb55687696bed0fa3e6febd2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 May 2026 01:16:24 +0000 Subject: [PATCH 10/10] chore(deps): bump hono Bumps [hono](https://github.com/honojs/hono) from 4.7.5 to 4.12.18. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](https://github.com/honojs/hono/compare/v4.7.5...v4.12.18) --- updated-dependencies: - dependency-name: hono dependency-version: 4.12.18 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- .../secure-exec/tests/projects/esm-import-pass/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/secure-exec/tests/projects/esm-import-pass/package.json b/packages/secure-exec/tests/projects/esm-import-pass/package.json index 275266d7..62b0db0d 100644 --- a/packages/secure-exec/tests/projects/esm-import-pass/package.json +++ b/packages/secure-exec/tests/projects/esm-import-pass/package.json @@ -3,6 +3,6 @@ "private": true, "type": "module", "dependencies": { - "hono": "4.7.5" + "hono": "4.12.18" } }