Skip to main content

Module bridge

Module bridge 

Source

Structs§

AsyncBridgeFnStore
Opaque store that keeps async bridge function data alive. Must be held for the lifetime of the V8 context.
BridgeFnStore
Opaque store that keeps bridge function data alive. Must be held for the lifetime of the V8 context.
PendingPromises
Stores pending promise resolvers keyed by call_id. Single-threaded: only accessed from the session thread.
VmContextRegistryGuard
RAII owner of the thread-local node:vm context registry for one session.

Constants§

EMULATED_OPENSSL_VERSION

Functions§

acquire_embedded_cbor_codec
deserialize_cbor_value
Deserialize CBOR bytes to a V8 value.
deserialize_v8_value
Deserialize bytes back to a V8 value using V8’s built-in ValueDeserializer. The bytes must have been produced by serialize_v8_value() or node:v8.serialize().
deserialize_v8_wire_value
Deserialize bytes from V8’s native wire format regardless of the process-wide codec toggle.
enable_cbor_codec
external_refs
External references for V8 snapshot serialization. Maps function pointer indices in the snapshot to current addresses. Must be identical at snapshot creation and restore time.
init_codec
Initialize the codec from the AGENTOS_V8_CODEC environment variable. Call once at process startup before any sessions are created.
is_cbor_codec
Returns true if the CBOR codec is active.
register_async_bridge_fns
Register async promise-returning bridge functions on the V8 global object.
register_stub_bridge_fns
Register stub bridge functions on the V8 global for snapshot creation.
register_sync_bridge_fns
Register sync-blocking bridge functions on the V8 global object.
release_embedded_cbor_codec
replace_bridge_fns
Replace stub bridge functions on a snapshot-restored context with real session-local bridge functions. Overwrites the 38 stub globals with functions backed by session-local BridgeCallContext.
resolve_pending_promise
Resolve or reject a pending async bridge promise by call_id.
serialize_cbor_value
Serialize a V8 value to CBOR bytes.
serialize_v8_value
Serialize a V8 value to bytes using V8’s built-in ValueSerializer. Handles all V8 types natively: primitives, strings, arrays, objects, Uint8Array, Date, Map, Set, RegExp, Error, and circular references. When CBOR codec is active, uses ciborium instead.
serialize_v8_wire_value
Serialize a V8 value to bytes using V8’s native wire format regardless of the process-wide codec toggle.