Skip to content

Commit bc413f8

Browse files
committed
feat: add binary type support for host functions
Adds Uint8Array/Buffer support for host function arguments and returns. Architecture: - New hyperlight-js-common crate: shared wire-format constants, binary sidecar encode/decode, FnReturn enum, DecodeError type - Guest extracts Uint8Array from QuickJS VM into binary sidecar - Host dispatches via register() (typed serde) or register_js() (JS bridge) - NAPI layer creates native Node.js Buffers via C API (no base64) - Tagged return format (0x00=JSON, 0x01=binary) for return path Key changes: - Single CallHostJsFunction entry point (removed legacy JSON-only path) - Native Buffer marshalling in NAPI (JsArg/JsReturn types) - Depth limits on all recursive JSON tree traversals (MAX_JSON_DEPTH=64) - Trailing data rejection in sidecar decoder - Typed register() rejects binary args with clear error message - Comprehensive test coverage (Rust unit + integration + JS vitest) - Updated README with Binary Data section and wire protocol docs - Updated CI publish order for new common crate Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent ee21e83 commit bc413f8

File tree

20 files changed

+2883
-483
lines changed

20 files changed

+2883
-483
lines changed

.github/workflows/CreateRelease.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
5757
- name: Publish hyperlight-js
5858
run: |
59+
cargo publish -p hyperlight-js-common
5960
cargo publish -p hyperlight-js-runtime
6061
cargo publish -p hyperlight-js
6162
env:

0 commit comments

Comments
 (0)