@zyno-io/ts-server-foundation 26.930.307 → 26.1003.2243

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ exports.isHttpResponseResult = isHttpResponseResult;
9
9
  const tslib_1 = require("tslib");
10
10
  const _a = tslib_1.__importStar(require("@zyno-io/ts-reflection/type-metadata-runtime"));
11
11
  const node_stream_1 = require("node:stream");
12
- const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":7},{\"kind\":2,\"typeName\":\"Map\",\"typeArguments\":[{\"kind\":6},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":14,\"type\":{\"kind\":6}}]}]},{\"kind\":6},{\"$tsfNode\":0},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":4}]},{\"$tsfNode\":1},{\"kind\":12,\"types\":[{\"kind\":6},{\"$tsfNode\":1}]},{\"kind\":3},{\"kind\":2},{\"kind\":2,\"typeName\":\"(error?: Error | null) =\\u003e void\"},{\"kind\":1},{\"kind\":8},{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"statusCode\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"contentType\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"headers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":{\"$tsfNode\":2},\"index\":{\"$tsfNode\":0},\"types\":[]},{\"kind\":4}]},\"optional\":true}]}],[{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":7},{\"kind\":14,\"type\":{\"kind\":6}}]},{\"kind\":12,\"types\":{\"$tsfNode\":3},\"typeName\":\"HttpWriteHeadHeaders\"},[{\"kind\":6},{\"$tsfNode\":0}],[{\"$tsfNode\":4},{\"$tsfNode\":5}],{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":{\"$tsfNode\":2},\"index\":{\"$tsfNode\":0},\"types\":[],\"typeName\":\"HttpHeaderOutput\"},{\"kind\":14,\"type\":{\"$tsfNode\":6}},{\"kind\":15,\"types\":{\"$tsfNode\":7}},[{\"type\":{\"kind\":6}},{\"$tsfNode\":8}],{\"type\":{\"$tsfNode\":0}}]]", []);
12
+ const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":7},{\"kind\":2,\"typeName\":\"Map\",\"typeArguments\":[{\"kind\":6},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":14,\"type\":{\"kind\":6}}]}]},{\"kind\":6},{\"$tsfNode\":0},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":4}]},{\"$tsfNode\":1},{\"kind\":12,\"types\":[{\"kind\":6},{\"$tsfNode\":1}]},{\"kind\":3},{\"kind\":2},{\"kind\":2,\"typeName\":\"(error?: Error | null) =\\u003e void\"},{\"kind\":1},{\"kind\":8},{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"statusCode\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"contentType\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"headers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":{\"$tsfNode\":2},\"index\":{\"$tsfNode\":0},\"types\":[]},{\"kind\":4}]},\"optional\":true}]}],[{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":7},{\"kind\":14,\"type\":{\"kind\":6}}]},{\"kind\":12,\"types\":{\"$tsfNode\":3},\"typeName\":\"HttpWriteHeadHeaders\"},[{\"kind\":6},{\"$tsfNode\":0}],[{\"$tsfNode\":4},{\"$tsfNode\":5}],{\"kind\":14,\"type\":{\"$tsfNode\":6}},{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":{\"$tsfNode\":2},\"index\":{\"$tsfNode\":0},\"types\":[],\"typeName\":\"HttpHeaderOutput\"},{\"kind\":15,\"typeName\":\"[string, string | number | readonly string[]]\",\"types\":{\"$tsfNode\":7}},[{\"type\":{\"kind\":6}},{\"$tsfNode\":8}],{\"type\":{\"$tsfNode\":0}}]]", []);
13
13
  let _HttpResponseMetadata_1;
14
14
  class HttpResponse extends node_stream_1.Writable {
15
15
  statusCodeValue = 200;
@@ -1732,7 +1732,7 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
1732
1732
  }
1733
1733
  return this.options.httpServer;
1734
1734
  }
1735
- static __tsfType = _MeshSrpcServerMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"MeshSrpcServer\",\"typeName\":\"MeshSrpcServer\",\"classType\":{\"$tsf\":0},\"properties\":[],\"methods\":[{\"name\":\"beforeClientAdmission\",\"parameters\":[],\"returnType\":{\"$tsfType\":0},\"description\":\"A mesh client is never admitted until this process can reserve its ownership in the shared registry. This centralizes the readiness gate rather than requiring each application authorizer to remember it.\"},{\"name\":\"postEstablishCheck\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":1},\"description\":\"Defers stream activation until mesh reservation succeeds. Installs meta proxy and reserves the client atomically in Redis using the protocol-version supersession rules, all serialized in the per-client registry chain. Protocol v1 retains its implicit replacement behavior; protocol v2+ requires the explicit supersede flag. Reserved clients remain hidden from lookup/invoke until onStreamActivated promotes them to active.\"},{\"name\":\"onStreamConnected\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":0}},{\"name\":\"onStreamWillActivate\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":0}},{\"name\":\"onStreamActivated\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":0}},{\"name\":\"onStreamDisconnected\",\"parameters\":[{\"$tsfNode\":1},{\"name\":\"cause\",\"type\":{\"$tsfType\":2},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"ready\",\"parameters\":[],\"returnType\":{\"$tsfType\":0}},{\"name\":\"getRegisteredClient\",\"parameters\":[{\"$tsfNode\":2}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":3},{\"kind\":4}]}},\"description\":\"Read a generation-fenced registry record without materializing a remote connection, link capability, or byte-stream sender pool. Use this for connection-state and metadata decisions; resolveClient() is for an imminent invoke, byte stream, metadata mutation, or disconnect.\"},{\"name\":\"listRegisteredClients\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"$tsfNode\":3}}},\"description\":\"Registry-only counterpart to listClients(); it never creates remote handles.\"},{\"name\":\"updateClientMetadata\",\"parameters\":[{\"$tsfNode\":4},{\"name\":\"metadata\",\"type\":{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"$tsfNode\":5}],\"utilityKeys\":[],\"types\":[]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1},\"description\":\"Update metadata for a client, regardless of which node owns it. Routes through the mesh to the owning node so that stream.meta reflects the change immediately and the proxy auto-syncs to Redis. For local streams, you can also mutate stream.meta directly.\"},{\"name\":\"onClientConnected\",\"parameters\":{\"$tsfNode\":6},\"returnType\":{\"$tsfType\":3}},{\"name\":\"onClientDisconnected\",\"parameters\":{\"$tsfNode\":6},\"returnType\":{\"$tsfType\":3}},{\"name\":\"onNodeClientsOrphaned\",\"parameters\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"registerBroadcastHandler\",\"parameters\":[{\"$tsfNode\":7},{\"name\":\"handler\",\"type\":{\"$tsfType\":8},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"broadcast\",\"parameters\":[{\"$tsfNode\":7},{\"name\":\"data\",\"type\":{\"$tsfType\":9},\"optional\":false,\"default\":false},{\"name\":\"options\",\"type\":{\"$tsfType\":10},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":0}},{\"name\":\"resolveClient\",\"parameters\":[{\"$tsfNode\":2},{\"name\":\"deadlineAt\",\"type\":{\"$tsfType\":11},\"optional\":true,\"default\":false}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":8},{\"kind\":4}]}}},{\"name\":\"listClients\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"$tsfNode\":8}}}},{\"name\":\"disconnectClient\",\"parameters\":[{\"$tsfNode\":4},{\"name\":\"reason\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"invoke\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":8},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"prefix\",\"type\":{\"$tsfType\":12},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":13},\"optional\":false,\"default\":false},{\"$tsfNode\":9}],\"returnType\":{\"$tsfType\":14},\"description\":\"Invoke a client method across any node in the mesh. Overloaded: when called with a stream, delegates to SrpcServer.invoke. When called with a clientId string, routes through the mesh.\"},{\"name\":\"invoke\",\"parameters\":[{\"$tsfNode\":4},{\"$tsfNode\":10},{\"$tsfNode\":11},{\"$tsfNode\":9}],\"returnType\":{\"$tsfType\":16}},{\"name\":\"invoke\",\"parameters\":[{\"$tsfNode\":4},{\"$tsfNode\":10},{\"$tsfNode\":11},{\"name\":\"timeoutMs\",\"type\":{\"$tsfType\":15},\"optional\":true,\"default\":true}],\"returnType\":{\"$tsfType\":16}},{\"name\":\"meshStart\",\"parameters\":[],\"returnType\":{\"$tsfType\":0}},{\"name\":\"meshStop\",\"parameters\":[],\"returnType\":{\"$tsfType\":0}},{\"name\":\"close\",\"parameters\":[],\"returnType\":{\"$tsfType\":3}},{\"name\":\"handleByteSubstreamOperation\",\"parameters\":[{\"$tsfNode\":1},{\"name\":\"operation\",\"type\":{\"$tsfType\":17},\"optional\":false,\"default\":false},{\"name\":\"requestId\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"hasExternalByteStreamSender\",\"parameters\":[{\"$tsfNode\":1},{\"name\":\"streamId\",\"type\":{\"$tsfType\":11},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":18}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"options\",\"type\":{\"kind\":13,\"types\":[{\"kind\":18,\"typeName\":\"ISrpcServerOptions\",\"types\":[{\"kind\":20,\"name\":\"logger\",\"type\":{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"clientMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"serverMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"wsPath\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"defaultUnspecifiedProtocolVersion\",\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":12},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logTraffic\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"SrpcTrafficLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"bodies\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}],\"typeName\":\"SrpcTrafficLogging\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Server\",\"classType\":{\"$tsfImport\":[1,\"node:http\",\"Server\"]}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingClientRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingClientRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightClientRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightClientRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":13},{\"$tsfNode\":14},{\"kind\":20,\"name\":\"maxPendingServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingHandshakes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxActiveStreams\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":15},{\"kind\":20,\"name\":\"maxClientMetadataBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":16},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},{\"kind\":18,\"typeName\":\"MeshSrpcServerOptions\",\"types\":[{\"kind\":20,\"name\":\"meshKey\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"meshOptions\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MeshServiceOptions\",\"types\":[{\"kind\":20,\"name\":\"heartbeatIntervalMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"nodeTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"leaderOptions\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"LeaderServiceOptions\",\"types\":[{\"kind\":20,\"name\":\"ttlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"renewalIntervalMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"retryDelayMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"redisConfigPrefix\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"nodeMetadata\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Omit\",\"utilityType\":\"Omit\",\"typeArguments\":[{\"kind\":18,\"typeName\":\"MeshNode\",\"types\":[{\"kind\":20,\"name\":\"instanceId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"hostname\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"self\",\"type\":{\"kind\":8},\"optional\":false},{\"$tsfNode\":17},{\"$tsfNode\":18},{\"$tsfNode\":19},{\"$tsfNode\":20},{\"$tsfNode\":21}]}],\"utilityKeys\":[\"instanceId\",\"hostname\",\"self\"],\"types\":[{\"$tsfNode\":17},{\"$tsfNode\":18},{\"$tsfNode\":19},{\"$tsfNode\":20},{\"$tsfNode\":21}]},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":14},{\"kind\":20,\"name\":\"maxActiveHandlers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxActiveHandlerBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":22}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"autoLifecycle\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"registryBackend\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MeshClientRegistryBackend\",\"types\":[]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"registryOptions\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MeshClientRedisRegistryOptions\",\"types\":[{\"$tsfNode\":15},{\"kind\":20,\"name\":\"maxMetadataBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientsPerNode\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"scanBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":22},{\"$tsfNode\":16},{\"kind\":20,\"name\":\"maxAuthNoncesPerPrincipal\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxOrphanItems\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxOrphanBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"extractRegistryMetadata\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"(stream: SrpcStream\\u003cTMeta\\u003e) =\\u003e TRegistryMeta\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"meshLink\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"advertiseUrl\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"path\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"secret\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"$tsfAlias\":[1,\"node:http\",\"Server\",\"Server\"]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"requestTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"idleTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxFrameBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":13},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]}]},\"optional\":false,\"default\":false}]},[[{\"$tsfNode\":1}],{\"name\":\"stream\",\"type\":{\"$tsfNode\":23},\"optional\":false,\"default\":false},{\"name\":\"clientId\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false},{\"kind\":18,\"typeName\":\"RegisteredClient\",\"types\":{\"$tsfNode\":24}},{\"name\":\"connectionOrClientId\",\"type\":{\"$tsfNode\":25},\"optional\":false,\"default\":false},{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":2}},[{\"$tsfNode\":26}],{\"name\":\"type\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"kind\":2,\"typeName\":\"MeshSrpcConnection\",\"typeArguments\":{\"$tsfNode\":27}},{\"name\":\"timeoutMs\",\"type\":{\"$tsfType\":11},\"optional\":true,\"default\":false},{\"name\":\"prefix\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":15},\"optional\":false,\"default\":false},{\"kind\":12,\"types\":{\"$tsfNode\":28}},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxAuthReplayPrincipals\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"processId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"linkEndpointId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"linkEndpointPublicKey\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"linkUrl\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"startedAt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":{\"$tsfNode\":29}},[{\"$tsfNode\":30},{\"$tsfNode\":31},{\"$tsfNode\":32},{\"$tsfNode\":17},{\"$tsfNode\":33},{\"$tsfNode\":34}],{\"kind\":12,\"types\":{\"$tsfNode\":35}},{\"name\":\"handler\",\"type\":{\"$tsfType\":5},\"optional\":false,\"default\":false},[{\"$tsfNode\":5},{\"$tsfNode\":36}],[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2},{\"kind\":10,\"literal\":3}],[{\"$tsfNode\":37},{\"$tsfNode\":38},{\"$tsfNode\":39},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"$tsfNode\":40},{\"$tsfNode\":41},{\"$tsfNode\":30},{\"$tsfNode\":42},{\"$tsfNode\":43},{\"$tsfNode\":44},{\"$tsfNode\":45},{\"$tsfNode\":46},{\"$tsfNode\":47},{\"$tsfNode\":33},{\"$tsfNode\":48},{\"$tsfNode\":49},{\"$tsfNode\":50}],{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"nodeId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"connectionId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"metadata\",\"type\":{\"$tsfNode\":36},\"optional\":false},[{\"$tsfNode\":51},{\"kind\":6}],{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":3}},{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"$tsfNode\":52},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"$tsfNode\":53},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"$tsfNode\":54},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"appVersion\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"configureTs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"protocolVersion\",\"type\":{\"$tsfNode\":12},\"optional\":false},{\"kind\":20,\"name\":\"capabilities\",\"type\":{\"$tsfNode\":55},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"$tsfNode\":5},\"optional\":false},{\"kind\":20,\"name\":\"isActivated\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"lastPingAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"connected\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":{\"$tsfNode\":56}},{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":{\"$tsfNode\":57}},{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":5},\"typeArguments\":{\"$tsfNode\":58}},{\"kind\":12,\"types\":{\"$tsfNode\":59}},[{\"$tsfNode\":37},{\"$tsfNode\":60},{\"$tsfNode\":61},{\"$tsfNode\":62},{\"$tsfNode\":63},{\"$tsfNode\":64}],[{\"$tsfNode\":65},{\"$tsfNode\":66}],[{\"kind\":6},{\"$tsfNode\":67}],[{\"$tsfNode\":68},{\"kind\":4}],{\"kind\":20,\"name\":\"readonly id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly meta\",\"type\":{\"$tsfNode\":69},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteSenderIdParity\",\"type\":{\"$tsfNode\":70},\"optional\":true},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":{\"$tsfNode\":71}},{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":6},\"typeArguments\":[{\"kind\":6}]},{\"kind\":12,\"types\":{\"$tsfNode\":27}},{\"kind\":12,\"types\":{\"$tsfNode\":72}},[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"$tsfNode\":73},{\"$tsfNode\":74}],[{\"$tsfNode\":75},{\"kind\":4}],{\"kind\":20,\"name\":\"resolve\",\"type\":{\"kind\":2,\"typeName\":\"(value: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":20,\"name\":\"reject\",\"type\":{\"kind\":2,\"typeName\":\"(err: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":0},{\"kind\":10,\"literal\":1}]}]]", [() => MeshSrpcServer, require, () => (typeof TMeta !== "undefined" ? TMeta : (typeof exports !== "undefined" ? exports.TMeta : undefined)), () => (typeof TRegistryMeta !== "undefined" ? TRegistryMeta : (typeof exports !== "undefined" ? exports.TRegistryMeta : undefined)), () => (typeof WebSocket !== "undefined" ? WebSocket : (typeof exports !== "undefined" ? exports.WebSocket : undefined)), () => (typeof Map !== "undefined" ? Map : (typeof exports !== "undefined" ? exports.Map : undefined)), () => (typeof ReadonlySet !== "undefined" ? ReadonlySet : (typeof exports !== "undefined" ? exports.ReadonlySet : undefined))], __tsf_metadata_type);
1735
+ static __tsfType = _MeshSrpcServerMetadata_1 = _a.decodeCompactMetadataV2("[2,{\"kind\":16,\"name\":\"MeshSrpcServer\",\"typeName\":\"MeshSrpcServer\",\"classType\":{\"$tsf\":0},\"properties\":[],\"methods\":[{\"name\":\"beforeClientAdmission\",\"parameters\":[],\"returnType\":{\"$tsfType\":0},\"description\":\"A mesh client is never admitted until this process can reserve its ownership in the shared registry. This centralizes the readiness gate rather than requiring each application authorizer to remember it.\"},{\"name\":\"postEstablishCheck\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":1},\"description\":\"Defers stream activation until mesh reservation succeeds. Installs meta proxy and reserves the client atomically in Redis using the protocol-version supersession rules, all serialized in the per-client registry chain. Protocol v1 retains its implicit replacement behavior; protocol v2+ requires the explicit supersede flag. Reserved clients remain hidden from lookup/invoke until onStreamActivated promotes them to active.\"},{\"name\":\"onStreamConnected\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":0}},{\"name\":\"onStreamWillActivate\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":0}},{\"name\":\"onStreamActivated\",\"parameters\":{\"$tsfNode\":0},\"returnType\":{\"$tsfType\":0}},{\"name\":\"onStreamDisconnected\",\"parameters\":[{\"$tsfNode\":1},{\"name\":\"cause\",\"type\":{\"$tsfType\":2},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"ready\",\"parameters\":[],\"returnType\":{\"$tsfType\":0}},{\"name\":\"getRegisteredClient\",\"parameters\":[{\"$tsfNode\":2}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":3},{\"kind\":4}]}},\"description\":\"Read a generation-fenced registry record without materializing a remote connection, link capability, or byte-stream sender pool. Use this for connection-state and metadata decisions; resolveClient() is for an imminent invoke, byte stream, metadata mutation, or disconnect.\"},{\"name\":\"listRegisteredClients\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"$tsfNode\":3}}},\"description\":\"Registry-only counterpart to listClients(); it never creates remote handles.\"},{\"name\":\"updateClientMetadata\",\"parameters\":[{\"$tsfNode\":4},{\"name\":\"metadata\",\"type\":{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"$tsfNode\":5}],\"utilityKeys\":[],\"types\":[]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1},\"description\":\"Update metadata for a client, regardless of which node owns it. Routes through the mesh to the owning node so that stream.meta reflects the change immediately and the proxy auto-syncs to Redis. For local streams, you can also mutate stream.meta directly.\"},{\"name\":\"onClientConnected\",\"parameters\":{\"$tsfNode\":6},\"returnType\":{\"$tsfType\":3}},{\"name\":\"onClientDisconnected\",\"parameters\":{\"$tsfNode\":6},\"returnType\":{\"$tsfType\":3}},{\"name\":\"onNodeClientsOrphaned\",\"parameters\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"registerBroadcastHandler\",\"parameters\":[{\"$tsfNode\":7},{\"name\":\"handler\",\"type\":{\"$tsfType\":8},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"broadcast\",\"parameters\":[{\"$tsfNode\":7},{\"name\":\"data\",\"type\":{\"$tsfType\":9},\"optional\":false,\"default\":false},{\"name\":\"options\",\"type\":{\"$tsfType\":10},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":0}},{\"name\":\"resolveClient\",\"parameters\":[{\"$tsfNode\":2},{\"name\":\"deadlineAt\",\"type\":{\"$tsfType\":11},\"optional\":true,\"default\":false}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":8},{\"kind\":4}]}}},{\"name\":\"listClients\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"$tsfNode\":8}}}},{\"name\":\"disconnectClient\",\"parameters\":[{\"$tsfNode\":4},{\"name\":\"reason\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"invoke\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"$tsfNode\":8},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"prefix\",\"type\":{\"$tsfType\":12},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":13},\"optional\":false,\"default\":false},{\"$tsfNode\":9}],\"returnType\":{\"$tsfType\":14},\"description\":\"Invoke a client method across any node in the mesh. Overloaded: when called with a stream, delegates to SrpcServer.invoke. When called with a clientId string, routes through the mesh.\"},{\"name\":\"invoke\",\"parameters\":[{\"$tsfNode\":4},{\"$tsfNode\":10},{\"$tsfNode\":11},{\"$tsfNode\":9}],\"returnType\":{\"$tsfType\":16}},{\"name\":\"invoke\",\"parameters\":[{\"$tsfNode\":4},{\"$tsfNode\":10},{\"$tsfNode\":11},{\"name\":\"timeoutMs\",\"type\":{\"$tsfType\":15},\"optional\":true,\"default\":true}],\"returnType\":{\"$tsfType\":16}},{\"name\":\"meshStart\",\"parameters\":[],\"returnType\":{\"$tsfType\":0}},{\"name\":\"meshStop\",\"parameters\":[],\"returnType\":{\"$tsfType\":0}},{\"name\":\"close\",\"parameters\":[],\"returnType\":{\"$tsfType\":3}},{\"name\":\"handleByteSubstreamOperation\",\"parameters\":[{\"$tsfNode\":1},{\"name\":\"operation\",\"type\":{\"$tsfType\":17},\"optional\":false,\"default\":false},{\"name\":\"requestId\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"hasExternalByteStreamSender\",\"parameters\":[{\"$tsfNode\":1},{\"name\":\"streamId\",\"type\":{\"$tsfType\":11},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":18}}],\"hasConstructor\":true,\"constructorParameters\":[{\"name\":\"options\",\"type\":{\"kind\":13,\"types\":[{\"kind\":18,\"typeName\":\"ISrpcServerOptions\",\"types\":[{\"kind\":20,\"name\":\"logger\",\"type\":{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"clientMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"serverMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"wsPath\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"defaultUnspecifiedProtocolVersion\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2},{\"kind\":10,\"literal\":3}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logTraffic\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"SrpcTrafficLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"bodies\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"pingPong\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}],\"typeName\":\"SrpcTrafficLogging\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Server\",\"classType\":{\"$tsfImport\":[1,\"node:http\",\"Server\"]}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"disconnectOnRequestTimeout\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingClientRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingClientRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightClientRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightClientRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":12},{\"$tsfNode\":13},{\"kind\":20,\"name\":\"maxPendingServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingHandshakes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxActiveStreams\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":14},{\"kind\":20,\"name\":\"maxClientMetadataBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":15},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},{\"kind\":18,\"typeName\":\"MeshSrpcServerOptions\",\"types\":[{\"kind\":20,\"name\":\"meshKey\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"meshOptions\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MeshServiceOptions\",\"types\":[{\"kind\":20,\"name\":\"heartbeatIntervalMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"nodeTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"leaderOptions\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"LeaderServiceOptions\",\"types\":[{\"kind\":20,\"name\":\"ttlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"renewalIntervalMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"retryDelayMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"redisConfigPrefix\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"nodeMetadata\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Omit\",\"utilityType\":\"Omit\",\"typeArguments\":[{\"kind\":18,\"typeName\":\"MeshNode\",\"types\":[{\"kind\":20,\"name\":\"instanceId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"hostname\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"self\",\"type\":{\"kind\":8},\"optional\":false},{\"$tsfNode\":16},{\"$tsfNode\":17},{\"$tsfNode\":18},{\"$tsfNode\":19},{\"$tsfNode\":20}]}],\"utilityKeys\":[\"instanceId\",\"hostname\",\"self\"],\"types\":[{\"$tsfNode\":16},{\"$tsfNode\":17},{\"$tsfNode\":18},{\"$tsfNode\":19},{\"$tsfNode\":20}]},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":13},{\"kind\":20,\"name\":\"maxActiveHandlers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxActiveHandlerBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":21}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"autoLifecycle\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"registryBackend\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MeshClientRegistryBackend\",\"types\":[]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"registryOptions\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"MeshClientRedisRegistryOptions\",\"types\":[{\"$tsfNode\":14},{\"kind\":20,\"name\":\"maxMetadataBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientsPerNode\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"scanBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":21},{\"$tsfNode\":15},{\"kind\":20,\"name\":\"maxAuthNoncesPerPrincipal\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxOrphanItems\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxOrphanBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"extractRegistryMetadata\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"(stream: SrpcStream\\u003cTMeta\\u003e) =\\u003e TRegistryMeta\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"meshLink\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"advertiseUrl\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"path\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"secret\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"$tsfAlias\":[1,\"node:http\",\"Server\",\"Server\"]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"requestTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"idleTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxFrameBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"$tsfNode\":12},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]}]},\"optional\":false,\"default\":false}]},[[{\"$tsfNode\":1}],{\"name\":\"stream\",\"type\":{\"$tsfNode\":22},\"optional\":false,\"default\":false},{\"name\":\"clientId\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false},{\"kind\":18,\"typeName\":\"RegisteredClient\",\"types\":{\"$tsfNode\":23}},{\"name\":\"connectionOrClientId\",\"type\":{\"$tsfNode\":24},\"optional\":false,\"default\":false},{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":2}},[{\"$tsfNode\":25}],{\"name\":\"type\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"kind\":2,\"typeName\":\"MeshSrpcConnection\",\"typeArguments\":{\"$tsfNode\":26}},{\"name\":\"timeoutMs\",\"type\":{\"$tsfType\":11},\"optional\":true,\"default\":false},{\"name\":\"prefix\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":15},\"optional\":false,\"default\":false},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxAuthReplayPrincipals\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"processId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"linkEndpointId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"linkEndpointPublicKey\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"linkUrl\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"startedAt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":{\"$tsfNode\":27}},[{\"$tsfNode\":28},{\"$tsfNode\":29},{\"$tsfNode\":30},{\"$tsfNode\":16},{\"$tsfNode\":31},{\"$tsfNode\":32}],{\"kind\":12,\"types\":{\"$tsfNode\":33}},{\"name\":\"handler\",\"type\":{\"$tsfType\":5},\"optional\":false,\"default\":false},[{\"$tsfNode\":5},{\"$tsfNode\":34}],[{\"$tsfNode\":35},{\"$tsfNode\":36},{\"$tsfNode\":37},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"$tsfNode\":38},{\"$tsfNode\":39},{\"$tsfNode\":28},{\"$tsfNode\":40},{\"$tsfNode\":41},{\"$tsfNode\":42},{\"$tsfNode\":43},{\"$tsfNode\":44},{\"$tsfNode\":45},{\"$tsfNode\":31},{\"$tsfNode\":46},{\"$tsfNode\":47},{\"$tsfNode\":48}],{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"nodeId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"connectionId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"metadata\",\"type\":{\"$tsfNode\":34},\"optional\":false},[{\"$tsfNode\":49},{\"kind\":6}],{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":3}},{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"$tsfNode\":50},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"$tsfNode\":51},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"$tsfNode\":52},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"appVersion\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"configureTs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"protocolVersion\",\"type\":{\"$tsfNode\":53},\"optional\":false},{\"kind\":20,\"name\":\"capabilities\",\"type\":{\"$tsfNode\":54},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"$tsfNode\":5},\"optional\":false},{\"kind\":20,\"name\":\"isActivated\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"lastPingAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"connected\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":{\"$tsfNode\":55}},{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":{\"$tsfNode\":56}},{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":5},\"typeArguments\":{\"$tsfNode\":57}},{\"kind\":12,\"types\":{\"$tsfNode\":58}},{\"kind\":12,\"types\":{\"$tsfNode\":59}},[{\"$tsfNode\":35},{\"$tsfNode\":60},{\"$tsfNode\":61},{\"$tsfNode\":62},{\"$tsfNode\":63},{\"$tsfNode\":64}],[{\"$tsfNode\":65},{\"$tsfNode\":66}],[{\"kind\":6},{\"$tsfNode\":67}],[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2},{\"kind\":10,\"literal\":3},{\"kind\":10,\"literal\":4}],[{\"$tsfNode\":68},{\"kind\":4}],{\"kind\":20,\"name\":\"readonly id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly meta\",\"type\":{\"$tsfNode\":69},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteSenderIdParity\",\"type\":{\"$tsfNode\":70},\"optional\":true},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":{\"$tsfNode\":71}},{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":6},\"typeArguments\":[{\"kind\":6}]},{\"kind\":12,\"types\":{\"$tsfNode\":26}},{\"kind\":12,\"types\":{\"$tsfNode\":72}},[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"$tsfNode\":73},{\"$tsfNode\":74},{\"$tsfNode\":75}],[{\"$tsfNode\":76},{\"kind\":4}],{\"kind\":20,\"name\":\"acknowledge\",\"type\":{\"$tsfNode\":77},\"optional\":true},{\"kind\":20,\"name\":\"resolve\",\"type\":{\"kind\":2,\"typeName\":\"(value: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":20,\"name\":\"reject\",\"type\":{\"kind\":2,\"typeName\":\"(err: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":0},{\"kind\":10,\"literal\":1}]},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"() =\\u003e void\"},{\"kind\":4}]}]]", [() => MeshSrpcServer, require, () => (typeof TMeta !== "undefined" ? TMeta : (typeof exports !== "undefined" ? exports.TMeta : undefined)), () => (typeof TRegistryMeta !== "undefined" ? TRegistryMeta : (typeof exports !== "undefined" ? exports.TRegistryMeta : undefined)), () => (typeof WebSocket !== "undefined" ? WebSocket : (typeof exports !== "undefined" ? exports.WebSocket : undefined)), () => (typeof Map !== "undefined" ? Map : (typeof exports !== "undefined" ? exports.Map : undefined)), () => (typeof ReadonlySet !== "undefined" ? ReadonlySet : (typeof exports !== "undefined" ? exports.ReadonlySet : undefined))], __tsf_metadata_type);
1736
1736
  }
1737
1737
  exports.MeshSrpcServer = MeshSrpcServer;
1738
1738
  _MeshSrpcServerMetadata_1.classType = MeshSrpcServer;
@@ -4,6 +4,8 @@ export declare class SrpcConflictError extends Error {
4
4
  constructor();
5
5
  }
6
6
  export interface SrpcClientOptions {
7
+ /** Defaults to v3 for existing codecs/servers. v4 requires requestAck in both envelope codecs. */
8
+ protocolVersion?: 3 | 4;
7
9
  enableReconnect?: boolean;
8
10
  logTraffic?: SrpcTrafficLogging;
9
11
  /** Audience signed into canonical credentials. Defaults to the WebSocket path. */
@@ -54,6 +56,7 @@ export declare class SrpcClient<TClientInput extends BaseMessage = BaseMessage,
54
56
  private senderAnnouncements;
55
57
  private generation;
56
58
  private readonly handlerPressureByGeneration;
59
+ private readonly requestAcknowledgmentsByGeneration;
57
60
  private readonly byteStreamsByGeneration;
58
61
  private readonly byteStreamPressureByGeneration;
59
62
  private readonly byteStreamDisconnectHandlersByGeneration;
@@ -77,6 +80,7 @@ export declare class SrpcClient<TClientInput extends BaseMessage = BaseMessage,
77
80
  private handleMessage;
78
81
  private handleByteStreamOperation;
79
82
  private handleReply;
83
+ private scheduleRequestAcknowledgment;
80
84
  private handleServerRequest;
81
85
  private handleServerNotification;
82
86
  private generateWsUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"SrpcClient.d.ts","sourceRoot":"","sources":["../../../src/srpc/SrpcClient.ts"],"names":[],"mappings":"AAQA,OAAO,EAA2B,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAExF,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,cAAc,EAEd,WAAW,EACX,gBAAgB,EAEhB,oBAAoB,EACpB,WAAW,EAEX,YAAY,EACZ,mBAAmB,EAInB,cAAc,EACd,QAAQ,EAER,kBAAkB,EAMrB,MAAM,SAAS,CAAC;AAEjB,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,cAGC;CACJ;AAED,MAAM,WAAW,iBAAiB;IAC9B,eAAe,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O,CAAC,uBAAuB;IAM/B,OAAO,CAAC,4BAA4B;IAMpC,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,wBAAwB;IAMhC,OAAO,KAAK,uBAAuB,GAElC;IAED,OAAO,KAAK,mBAAmB,GAI9B;IAED,OAAO,KAAK,kBAAkB,GAE7B;IACD,OAAO,KAAK,sBAAsB,GAEjC;IACD,OAAO,KAAK,yBAAyB,GAEpC;IACD,OAAO,KAAK,6BAA6B,GAExC;IACD,OAAO,KAAK,gBAAgB,GAE3B;IACD,OAAO,KAAK,eAAe,GAE1B;IACD,OAAO,KAAK,gBAAgB,GAM3B;IACD,OAAO,KAAK,gBAAgB,GAG3B;CACJ"}
@@ -13,7 +13,7 @@ const telemetry_1 = require("../telemetry");
13
13
  const SrpcByteStream_1 = require("./SrpcByteStream");
14
14
  const handshake_1 = require("./handshake");
15
15
  const types_1 = require("./types");
16
- const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":8},{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]},{\"kind\":22,\"type\":{\"kind\":3}},{\"kind\":3},{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":[{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteSenderIdParity\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":0},{\"kind\":10,\"literal\":1}]},{\"kind\":4}]},\"optional\":true}]},{\"kind\":2,\"typeName\":\"() =\\u003e void\"},{\"kind\":2,\"typeName\":\"P\"},{\"kind\":2,\"typeName\":\"(data: HandlerRequestData\\u003cTServerOutput, P\\u003e) =\\u003e Promise\\u003cResponseData\\u003cTClientInput, P\\u003e\\u003e | ResponseData\\u003cTClientInput, P\\u003e\"},{\"kind\":2,\"typeName\":\"(data: NotificationData\\u003cTServerOutput, P\\u003e) =\\u003e void | Promise\\u003cvoid\\u003e\"},{\"kind\":2,\"typeName\":\"(cause: SrpcDisconnectCause) =\\u003e void\"},{\"kind\":0},{\"kind\":2},{\"kind\":18,\"typeName\":\"ResponseData\\u003cTServerOutput, P\\u003e\",\"types\":[{\"kind\":20,\"name\":\"\u00FE@toStringTag@14\",\"type\":{\"kind\":6},\"optional\":false}]},{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},{\"kind\":6},{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},{\"kind\":17,\"typeName\":\"SrpcMeta\"},{\"kind\":18,\"typeName\":\"SrpcClientOptions\",\"types\":[{\"kind\":20,\"name\":\"enableReconnect\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logTraffic\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"SrpcTrafficLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"bodies\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}],\"typeName\":\"SrpcTrafficLogging\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"tlsServerName\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"senderAnnouncements\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]}],[]]", []);
16
+ const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":8},{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]},{\"kind\":22,\"type\":{\"kind\":3}},{\"kind\":3},{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":[{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteSenderIdParity\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":0},{\"kind\":10,\"literal\":1}]},{\"kind\":4}]},\"optional\":true}]},{\"kind\":2,\"typeName\":\"() =\\u003e void\"},{\"kind\":2,\"typeName\":\"P\"},{\"kind\":2,\"typeName\":\"(data: HandlerRequestData\\u003cTServerOutput, P\\u003e) =\\u003e Promise\\u003cResponseData\\u003cTClientInput, P\\u003e\\u003e | ResponseData\\u003cTClientInput, P\\u003e\"},{\"kind\":2,\"typeName\":\"(data: NotificationData\\u003cTServerOutput, P\\u003e) =\\u003e void | Promise\\u003cvoid\\u003e\"},{\"kind\":2,\"typeName\":\"(cause: SrpcDisconnectCause) =\\u003e void\"},{\"kind\":0},{\"kind\":2},{\"kind\":18,\"typeName\":\"ResponseData\\u003cTServerOutput, P\\u003e\",\"types\":[{\"kind\":20,\"name\":\"\u00FE@toStringTag@14\",\"type\":{\"kind\":6},\"optional\":false}]},{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},{\"kind\":6},{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},{\"kind\":17,\"typeName\":\"SrpcMeta\"},{\"kind\":18,\"typeName\":\"SrpcClientOptions\",\"types\":[{\"kind\":20,\"name\":\"protocolVersion\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":3},{\"kind\":10,\"literal\":4}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableReconnect\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logTraffic\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"SrpcTrafficLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"bodies\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"pingPong\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}],\"typeName\":\"SrpcTrafficLogging\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"tlsServerName\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"senderAnnouncements\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]}],[]]", []);
17
17
  let _SrpcConflictErrorMetadata_1;
18
18
  class SrpcConflictError extends Error {
19
19
  constructor() {
@@ -65,6 +65,7 @@ class SrpcClient {
65
65
  senderAnnouncements;
66
66
  generation = 0;
67
67
  handlerPressureByGeneration = new Map();
68
+ requestAcknowledgmentsByGeneration = new Map();
68
69
  byteStreamsByGeneration = new Map();
69
70
  byteStreamPressureByGeneration = new Map();
70
71
  byteStreamDisconnectHandlersByGeneration = new Map();
@@ -81,6 +82,10 @@ class SrpcClient {
81
82
  this.clientSecret = clientSecret;
82
83
  this.clientOptions = clientOptions;
83
84
  validateClientResourceOptions(clientOptions);
85
+ if (clientOptions?.protocolVersion === 4 &&
86
+ (!(0, types_1.supportsSrpcRequestAcknowledgments)(clientMessage) || !(0, types_1.supportsSrpcRequestAcknowledgments)(serverMessage))) {
87
+ throw new Error('Protocol v4 requires request acknowledgment codecs');
88
+ }
84
89
  this.enableReconnect = clientOptions?.enableReconnect !== false;
85
90
  this.senderAnnouncements = clientOptions?.senderAnnouncements !== false;
86
91
  }
@@ -274,6 +279,9 @@ class SrpcClient {
274
279
  this.awaitingActivation = undefined;
275
280
  this.ws = undefined;
276
281
  this.handlerPressureByGeneration?.delete(generation);
282
+ for (const timer of this.requestAcknowledgmentsByGeneration?.get(generation) ?? [])
283
+ clearTimeout(timer);
284
+ this.requestAcknowledgmentsByGeneration?.delete(generation);
277
285
  this.revokeByteStreamGeneration(generation);
278
286
  this.rejectAllRequests(new types_1.SrpcIndeterminateDeliveryError(this.clientId ?? '', new Error('Disconnected')));
279
287
  if (wasConnected) {
@@ -332,6 +340,16 @@ class SrpcClient {
332
340
  return;
333
341
  }
334
342
  this.logTraffic('inbound', message);
343
+ if (message.requestAck) {
344
+ if (this.clientOptions?.protocolVersion !== 4 || !(0, types_1.isSrpcRequestAcknowledgment)(message)) {
345
+ this.closeGenerationWithError(ws, generation, 'badArg', 'Invalid request acknowledgment');
346
+ return;
347
+ }
348
+ if (!this.requestQueue.has(message.requestId) && !this.isLateReply(message.requestId)) {
349
+ this.closeGenerationWithError(ws, generation, 'badArg', 'Unknown request ID');
350
+ }
351
+ return;
352
+ }
335
353
  if (message.pingPong) {
336
354
  this.lastPongMs = Date.now();
337
355
  const type = message.pingPong.type ?? types_1.SrpcPingPongType.UNSPECIFIED;
@@ -387,6 +405,9 @@ class SrpcClient {
387
405
  this.closeGenerationWithError(ws, generation, 'badArg', 'Too many in-flight server requests');
388
406
  return;
389
407
  }
408
+ const cancelAcknowledgment = !notification && this.clientOptions?.protocolVersion === 4
409
+ ? this.scheduleRequestAcknowledgment(generation, message.requestId)
410
+ : undefined;
390
411
  pressure.requests++;
391
412
  pressure.bytes += bytes;
392
413
  this.handlerPressureByGeneration.set(generation, pressure);
@@ -397,6 +418,7 @@ class SrpcClient {
397
418
  await this.handleServerRequest(generation, message.requestId, message);
398
419
  }
399
420
  finally {
421
+ cancelAcknowledgment?.();
400
422
  if (this.handlerPressureByGeneration.get(generation) === pressure) {
401
423
  pressure.requests = Math.max(0, pressure.requests - 1);
402
424
  pressure.bytes = Math.max(0, pressure.bytes - bytes);
@@ -473,6 +495,26 @@ class SrpcClient {
473
495
  else
474
496
  queueItem.resolve(message);
475
497
  }
498
+ scheduleRequestAcknowledgment(generation, requestId) {
499
+ const timers = this.requestAcknowledgmentsByGeneration.get(generation) ?? new Set();
500
+ const forget = () => {
501
+ timers.delete(timer);
502
+ if (!timers.size && this.requestAcknowledgmentsByGeneration.get(generation) === timers) {
503
+ this.requestAcknowledgmentsByGeneration.delete(generation);
504
+ }
505
+ };
506
+ const timer = setTimeout(() => {
507
+ forget();
508
+ this.writeMessage({ requestId, requestAck: true }, generation);
509
+ }, types_1.SrpcClientRequestAckDelayMs);
510
+ timer.unref?.();
511
+ timers.add(timer);
512
+ this.requestAcknowledgmentsByGeneration.set(generation, timers);
513
+ return () => {
514
+ clearTimeout(timer);
515
+ forget();
516
+ };
517
+ }
476
518
  async handleServerRequest(generation, requestId, message) {
477
519
  for (const [key, handlerMeta] of this.streamMessageHandlers) {
478
520
  const requestData = message[key];
@@ -540,6 +582,7 @@ class SrpcClient {
540
582
  const metadata = (0, handshake_1.srpcQueryMetadata)(normalizeMetadata(this.clientMeta));
541
583
  const supersede = this.supersede ? '1' : '0';
542
584
  const audience = this.clientOptions?.authAudience ?? url.pathname;
585
+ const protocol = String(this.clientOptions?.protocolVersion ?? 3);
543
586
  const signable = canonicalAuthV2({
544
587
  path: url.pathname,
545
588
  audience,
@@ -548,7 +591,7 @@ class SrpcClient {
548
591
  nonce,
549
592
  id: this.streamId,
550
593
  cid,
551
- protocol: '3',
594
+ protocol,
552
595
  supersede,
553
596
  capabilities,
554
597
  metadata
@@ -560,7 +603,7 @@ class SrpcClient {
560
603
  id: this.streamId,
561
604
  cid,
562
605
  signature,
563
- pv: '3',
606
+ pv: protocol,
564
607
  nonce,
565
608
  aud: audience,
566
609
  ...(capabilities ? { cap: capabilities } : {}),
@@ -658,6 +701,8 @@ class SrpcClient {
658
701
  const options = this.clientOptions?.logTraffic;
659
702
  if (!options)
660
703
  return;
704
+ if (!(typeof options === 'object' && options.pingPong === true) && (0, types_1.isSrpcPingPongOnly)(message))
705
+ return;
661
706
  const bodies = typeof options === 'object' && options.bodies === true;
662
707
  this.logger.info('SRPC traffic', {
663
708
  direction,
@@ -1004,6 +1049,9 @@ function configuredPositiveInteger(value, fallback) {
1004
1049
  function validateClientResourceOptions(options) {
1005
1050
  if (!options)
1006
1051
  return;
1052
+ if (options.protocolVersion !== undefined && options.protocolVersion !== 3 && options.protocolVersion !== 4) {
1053
+ throw new Error('sRPC client protocolVersion must be 3 or 4');
1054
+ }
1007
1055
  for (const [name, value] of [
1008
1056
  ['maxPendingRequests', options.maxPendingRequests],
1009
1057
  ['maxPendingRequestBytes', options.maxPendingRequestBytes],
@@ -1045,5 +1093,5 @@ function compareCodeUnits(a, b) {
1045
1093
  function isPlainObject(value) {
1046
1094
  return typeof value === 'object' && value !== null && !Array.isArray(value);
1047
1095
  }
1048
- exports.__tsfTypeAliases = _a.decodeCompactMetadataV2("[2,{\"SrpcClientOptions\":{\"kind\":18,\"typeName\":\"SrpcClientOptions\",\"types\":[{\"kind\":20,\"name\":\"enableReconnect\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logTraffic\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"SrpcTrafficLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"bodies\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}],\"typeName\":\"SrpcTrafficLogging\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"tlsServerName\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"senderAnnouncements\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]}},[]]", [], __tsf_metadata_type);
1096
+ exports.__tsfTypeAliases = _a.decodeCompactMetadataV2("[2,{\"SrpcClientOptions\":{\"kind\":18,\"typeName\":\"SrpcClientOptions\",\"types\":[{\"kind\":20,\"name\":\"protocolVersion\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":3},{\"kind\":10,\"literal\":4}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"enableReconnect\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logTraffic\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":18,\"typeName\":\"SrpcTrafficLoggingOptions\",\"types\":[{\"kind\":20,\"name\":\"bodies\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"pingPong\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true}]}],\"typeName\":\"SrpcTrafficLogging\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"tlsServerName\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"senderAnnouncements\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectTimeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]}},[]]", [], __tsf_metadata_type);
1049
1097
  //# sourceMappingURL=SrpcClient.js.map