protocol/network
packages/protocol/src/network
Purpose
Public barrel for connect and presence protocol descriptors.Public surface
agentCallableNetworkRpcMethods
Variable
AgentConnect
Variable
- Principal: none — the unauthenticated handshake. No principal exists
pre-auth, so
requiresis empty and no gate runs before it. - Params:
agentKey,minProtocol,maxProtocol. - Result: an empty HelloOk; success is the signal (the client holds its own id).
AgentPresenceSubscribe
Variable
appCallableNetworkRpcMethods
Variable
AppConnect
Variable
- Principal: none — the unauthenticated handshake. No principal exists
pre-auth, so
requiresis empty and no gate runs before it. - Params:
appKey,minProtocol,maxProtocol. - Result: an empty HelloOk; success is the signal (the client holds its own id).
AppPresenceSubscribe
Variable
checkProtocolRange
Function
compareProtocolVersion
Function
HelloOk
TypeAlias
InvalidProtocolVersionError
Class
networkNotifications
Variable
networkRpcMethods
Variable
PROTOCOL_VERSION
Variable
ProtocolMismatchError
Class
[minProtocol, maxProtocol]
range does not bracket the server’s PROTOCOL_VERSION. The server’s connect
handlers raise it BEFORE auth resolution
so old clients are rejected at the version gate. data carries the
diagnostic { reason, serverVersion, clientMinProtocol, clientMaxProtocol },
concretely typed so error.data.reason narrows at every reader.
ProtocolMismatchReason
TypeAlias
ProtocolMismatchError.data.reason:
server-above-client-max — the server is newer than the client’s
maxProtocol; the client must update. server-below-client-min — the
client is newer than the server supports.
Files
connect.tsindex.tspresence.ts