The socket protocol
@chia1104/motoko-wire/socket holds the frames of the socket transport, the one module its server
(@chia1104/motoko-cloudflare's MotokoCapability) and its client (@chia1104/motoko-client's
webSocketTransport) both import. Each frame is a JSON text frame whose type starts with motoko:,
so it rides one socket beside the frames of the Agents SDK and of the app:
callFrameSchema: the client'smotoko:call, with anid, amethodand itsparams;serverFrameSchema: the server'smotoko:resultandmotoko:errorfor a call'sid, andmotoko:eventandmotoko:ended(followedEventSchemaandfollowEndedSchema, with theirtype) for a session the connection follows;motokoCalls:callSchemasand the socket's own two calls,subscribe(sessionId,from?) andunsubscribe(sessionId), which exist because one socket follows several sessions;motokoErrorCodeSchema: the call error codes and the socket's own,too_many_subscriptions;motokoFrame(message): a text frame of Motoko's as JSON, orundefinedfor the SDK's or the app's.
MotokoMethod, MotokoParams<M>, MotokoResult<M>, MotokoCall and MotokoErrorCode are their
types. The Cloudflare package's README describes how a follow runs over them.