@xyo-network/dapp-kit-port
v2.1.4
Published
Runtime-neutral application-port peers for headless XL1 dApps
Readme
@xyo-network/dapp-kit-port
Shared application-port client and host peers for browser and Node transports.
The package owns protocol state for unary requests, acknowledged cancellation, bounded-credit streams, exact redelivery checks, and durable resume cursors. Every frame is validated against its attachment grant, plan, system incarnation, host session, request, port, operation, and deadline before domain delivery.
The peers depend only on a small message-endpoint interface. Platform packages
adapt MessagePort, WebSocket, or future native transports to that interface;
they do not duplicate the protocol state machine. Actor and provider locators
never cross the endpoint.
The package also owns the transport-neutral WebSocket wire mapping. Frames are
strict I-JSON text messages with canonical serialization, a negotiated byte
limit, and an attachment hello that carries the existing grant. The shared
connectWebSocketApplicationPort() client works with browser WebSocket and
compatible Node implementations. It verifies the expected dApp, plan, protocol
version, and grant lifetime before publishing an ApplicationPortClient.
Transport loss rejects pending unary and streaming work; reconnecting creates a
new attachment and resumes only through the existing cursor protocol.
