feat: add binary type support for host functions#40
Open
simongdavies wants to merge 1 commit intomainfrom
Open
feat: add binary type support for host functions#40simongdavies wants to merge 1 commit intomainfrom
simongdavies wants to merge 1 commit intomainfrom
Conversation
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>
b7570d0 to
e63255b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Uint8Array/Buffer support for host function arguments and returns.
Architecture:
Key changes:
Closes #38