@zyno-io/ts-server-foundation 26.801.23 → 26.802.804
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.
- package/dist/src/database/query.js +1 -1
- package/dist/src/di/module.js +1 -1
- package/dist/src/http/response.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/services/index.js +1 -1
- package/dist/src/services/mesh-client/index.js +1 -1
- package/dist/src/services/mesh-client/mesh-client-service.d.ts +21 -0
- package/dist/src/services/mesh-client/mesh-client-service.d.ts.map +1 -1
- package/dist/src/services/mesh-client/mesh-client-service.js +130 -6
- package/dist/src/services/mesh-client/mesh-client-service.js.map +1 -1
- package/dist/src/services/mesh-client/mesh-srpc-server.d.ts +50 -0
- package/dist/src/services/mesh-client/mesh-srpc-server.d.ts.map +1 -1
- package/dist/src/services/mesh-client/mesh-srpc-server.js +644 -71
- package/dist/src/services/mesh-client/mesh-srpc-server.js.map +1 -1
- package/dist/src/srpc/SrpcServer.js +10 -5
- package/dist/src/srpc/SrpcServer.js.map +1 -1
- package/dist/src/srpc/index.js +1 -1
- package/dist/src/srpc/observer.js +1 -1
- package/dist/src/srpc/types.d.ts +7 -3
- package/dist/src/srpc/types.d.ts.map +1 -1
- package/dist/src/srpc/types.js +1 -1
- package/dist/src/srpc/types.js.map +1 -1
- package/docs/content/database.md +30 -1
- package/docs/content/mesh-client.md +30 -24
- package/docs/content/migrations.md +2 -1
- package/docs/content/overview.md +8 -8
- package/docs/content/srpc.md +4 -2
- package/package.json +1 -1
|
@@ -28,6 +28,22 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
28
28
|
unregisterMeshLinkRoute;
|
|
29
29
|
meshStartPromise;
|
|
30
30
|
meshStopPromise;
|
|
31
|
+
meshFatalCleanupPromise;
|
|
32
|
+
meshLeaseCleanupPromise;
|
|
33
|
+
meshLeaseCleanupRequired = false;
|
|
34
|
+
meshLeaseCleanupRetryTimer;
|
|
35
|
+
meshLeaseCleanupRetryMs = 1000;
|
|
36
|
+
/**
|
|
37
|
+
* A start that shutdown abandoned. New starts wait for its eventual
|
|
38
|
+
* rollback so a late mesh start cannot overlap a replacement lifecycle.
|
|
39
|
+
*/
|
|
40
|
+
meshPendingStartCleanup;
|
|
41
|
+
/** A detached controller close from a cancelled, not-yet-ready start. */
|
|
42
|
+
meshPendingLinkClose;
|
|
43
|
+
meshCleanupFailure;
|
|
44
|
+
meshStartGeneration = 0;
|
|
45
|
+
meshStartCancelled = false;
|
|
46
|
+
meshStartRollbackFailure;
|
|
31
47
|
meshRunning = false;
|
|
32
48
|
meshLeaseFailure;
|
|
33
49
|
meshStopping = false;
|
|
@@ -44,6 +60,18 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
44
60
|
// Track metadata for connect/disconnect callbacks.
|
|
45
61
|
clientMetadata = new Map();
|
|
46
62
|
lifecycleConnectedStreams = new WeakSet();
|
|
63
|
+
/**
|
|
64
|
+
* Lifecycle disconnects captured before a cancelled startup fully fences
|
|
65
|
+
* mesh membership. Their callbacks cannot run until rollback has released
|
|
66
|
+
* the abandoned membership, otherwise consumers can observe a false
|
|
67
|
+
* offline transition while ownership is still indeterminate.
|
|
68
|
+
*/
|
|
69
|
+
pendingStartDisconnects = new Map();
|
|
70
|
+
pendingStartDisconnectFenceDeadlines = new Map();
|
|
71
|
+
pendingStartDisconnectCallbackQueued = new WeakSet();
|
|
72
|
+
rollbackGatedDisconnects = new WeakSet();
|
|
73
|
+
meshSupersedeReconcileMs = 30000;
|
|
74
|
+
meshSupersedeReconcileRetryMs = 10;
|
|
47
75
|
// Serialize registry mutations per client to prevent race conditions
|
|
48
76
|
// without letting slow user callbacks block reconnects.
|
|
49
77
|
clientRegistryChains = new Map();
|
|
@@ -104,7 +132,7 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
104
132
|
// A lost mesh lease is a split-brain boundary. Do not wait for the
|
|
105
133
|
// normal shutdown path: synchronously fence every local stream so a
|
|
106
134
|
// stale link cannot keep serving after another node takes ownership.
|
|
107
|
-
this.meshClientService.onLeaseLost(reason => this.
|
|
135
|
+
this.meshClientService.onLeaseLost(reason => this.beginMeshLeaseCleanup(reason));
|
|
108
136
|
// Wire up mesh node cleanup callback
|
|
109
137
|
this.meshClientService.onNodeClientsOrphaned(async (nodeId, orphaned) => {
|
|
110
138
|
const failures = [];
|
|
@@ -121,19 +149,24 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
121
149
|
throw new AggregateError(failures, `Failed to deliver orphaned clients for mesh node ${nodeId}`);
|
|
122
150
|
}
|
|
123
151
|
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
152
|
+
if (options.autoLifecycle !== false) {
|
|
153
|
+
try {
|
|
154
|
+
const app = (0, app_1.getCurrentApp)();
|
|
155
|
+
this.unregisterLifecycleHandlers.push(app.on(app_1.onServerBootstrap, () => this.meshStart()), app.on(app_1.onServerShutdownRequested, () => this.meshStop()));
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
// Standalone servers using an explicit mesh-link listener retain the
|
|
159
|
+
// idempotent meshStart()/meshStop() lifecycle.
|
|
160
|
+
}
|
|
131
161
|
}
|
|
132
162
|
}
|
|
133
163
|
////////////////////////////////////////
|
|
134
164
|
// Post-establish check - reserve mesh ownership before activation
|
|
135
165
|
/** Fence the exact local generation when a newer owner claims the client. */
|
|
136
166
|
async handleClientSuperseded(clientId, connectionId, reason) {
|
|
167
|
+
const isTakeoverFence = connectionId !== undefined && reason === 'supersede';
|
|
168
|
+
if (isTakeoverFence)
|
|
169
|
+
this.markPendingStartDisconnectFence(clientId, connectionId);
|
|
137
170
|
const stream = connectionId === undefined ? this.getCurrentStreamByClientId(clientId) : this.streamsById.get(connectionId);
|
|
138
171
|
// Exact-generation absence is already a completed fence. This is
|
|
139
172
|
// important for same-node supersession: core closes the old stream
|
|
@@ -143,23 +176,84 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
143
176
|
if (stream.clientId !== clientId || (connectionId !== undefined && stream.id !== connectionId))
|
|
144
177
|
return false;
|
|
145
178
|
if (connectionId !== undefined) {
|
|
179
|
+
if (isTakeoverFence) {
|
|
180
|
+
this.captureDeferredDisconnect(stream);
|
|
181
|
+
this.markPendingStartDisconnectFence(clientId, connectionId);
|
|
182
|
+
}
|
|
183
|
+
const snapshot = this.pendingStartDisconnects.get(stream);
|
|
184
|
+
const deadline = this.pendingStartDisconnectFenceDeadlines.get(stream);
|
|
185
|
+
// Reserve this client's lifecycle ordering before cleanup lets a
|
|
186
|
+
// same-node replacement enqueue its connected callback. Startup
|
|
187
|
+
// shutdown snapshots instead wait for rollback to dispatch.
|
|
188
|
+
if (isTakeoverFence && !this.rollbackGatedDisconnects?.has(stream) && snapshot && deadline !== undefined)
|
|
189
|
+
this.queuePendingStartDisconnectCallback(stream, snapshot, deadline);
|
|
146
190
|
this.meshLogger.info('Disconnecting client through exact mesh transport', { clientId, connectionId, reason });
|
|
147
191
|
// This is a replacement ownership generation, not an ordinary
|
|
148
192
|
// client disconnect. Preserve the supersede cause so local
|
|
149
193
|
// lifecycle consumers do not emit disconnect side effects for
|
|
150
194
|
// a client that remains connected on another mesh node.
|
|
151
|
-
this.cleanupStream(stream, 'supersede');
|
|
195
|
+
this.cleanupStream(stream, isTakeoverFence ? 'supersede' : 'disconnect');
|
|
152
196
|
return true;
|
|
153
197
|
}
|
|
154
198
|
this.meshLogger.info('Disconnecting superseded client', { clientId, reason });
|
|
155
|
-
this.cleanupStream(stream, 'supersede');
|
|
199
|
+
this.cleanupStream(stream, reason === 'supersede' ? 'supersede' : 'disconnect');
|
|
156
200
|
return true;
|
|
157
201
|
}
|
|
158
202
|
/** Fence streams and release the link route after the mesh lease is lost. */
|
|
203
|
+
beginMeshLeaseCleanup(reason) {
|
|
204
|
+
if (this.meshLeaseCleanupPromise)
|
|
205
|
+
return this.meshLeaseCleanupPromise;
|
|
206
|
+
this.meshLeaseCleanupRequired = true;
|
|
207
|
+
this.clearMeshLeaseCleanupRetry();
|
|
208
|
+
// Install the join barrier before synchronous stream teardown begins.
|
|
209
|
+
// A disconnect handler may re-enter meshStop() from cleanupStream().
|
|
210
|
+
let resolveCleanup;
|
|
211
|
+
let rejectCleanup;
|
|
212
|
+
const tracked = new Promise((resolve, reject) => {
|
|
213
|
+
resolveCleanup = resolve;
|
|
214
|
+
rejectCleanup = reject;
|
|
215
|
+
});
|
|
216
|
+
this.meshLeaseCleanupPromise = tracked;
|
|
217
|
+
let cleanup;
|
|
218
|
+
try {
|
|
219
|
+
cleanup = this.handleMeshLeaseLost(reason);
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
cleanup = Promise.reject(error);
|
|
223
|
+
}
|
|
224
|
+
void cleanup.then(resolveCleanup, rejectCleanup);
|
|
225
|
+
void tracked.then(() => {
|
|
226
|
+
this.meshLeaseCleanupRequired = false;
|
|
227
|
+
if (this.meshLeaseCleanupPromise === tracked)
|
|
228
|
+
this.meshLeaseCleanupPromise = undefined;
|
|
229
|
+
}, error => {
|
|
230
|
+
if (this.meshLeaseCleanupPromise === tracked)
|
|
231
|
+
this.meshLeaseCleanupPromise = undefined;
|
|
232
|
+
this.meshLogger.warn('mesh lease-loss cleanup failed; retained for retry', { error });
|
|
233
|
+
this.scheduleMeshLeaseCleanupRetry();
|
|
234
|
+
});
|
|
235
|
+
return tracked;
|
|
236
|
+
}
|
|
237
|
+
scheduleMeshLeaseCleanupRetry() {
|
|
238
|
+
if (!this.meshLeaseCleanupRequired || this.meshLeaseCleanupRetryTimer || this.meshClosed)
|
|
239
|
+
return;
|
|
240
|
+
this.meshLeaseCleanupRetryTimer = setTimeout(() => {
|
|
241
|
+
this.meshLeaseCleanupRetryTimer = undefined;
|
|
242
|
+
void this.beginMeshLeaseCleanup().catch(() => { });
|
|
243
|
+
}, this.meshLeaseCleanupRetryMs);
|
|
244
|
+
this.meshLeaseCleanupRetryTimer.unref?.();
|
|
245
|
+
}
|
|
246
|
+
clearMeshLeaseCleanupRetry() {
|
|
247
|
+
if (!this.meshLeaseCleanupRetryTimer)
|
|
248
|
+
return;
|
|
249
|
+
clearTimeout(this.meshLeaseCleanupRetryTimer);
|
|
250
|
+
this.meshLeaseCleanupRetryTimer = undefined;
|
|
251
|
+
}
|
|
159
252
|
async handleMeshLeaseLost(reason) {
|
|
160
253
|
this.meshLogger.warn('Fencing local sRPC streams after mesh lease loss', { reason });
|
|
161
254
|
this.meshRunning = false;
|
|
162
|
-
this.meshLeaseFailure
|
|
255
|
+
this.meshLeaseFailure ??= reason ?? new Error('sRPC mesh lease was lost');
|
|
256
|
+
this.capturePendingStartDisconnects();
|
|
163
257
|
const streams = new Set([...(this.streamsByClientId?.values() ?? []), ...(this.pendingStreamsByClientId?.values() ?? [])]);
|
|
164
258
|
for (const stream of streams) {
|
|
165
259
|
if (this.isCurrentStream(stream))
|
|
@@ -168,18 +262,13 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
168
262
|
// meshStop() deliberately returns once meshRunning is false, so lease
|
|
169
263
|
// loss must release the route here. Otherwise the shared runtime keeps
|
|
170
264
|
// dispatching this mesh key to a closed controller forever.
|
|
171
|
-
const controller = this.meshLinkController;
|
|
172
265
|
try {
|
|
173
|
-
await
|
|
266
|
+
await Promise.allSettled([...(this.clientRegistryChains?.values() ?? [])]);
|
|
267
|
+
await this.meshClientService.cleanupRegistryOwnership();
|
|
268
|
+
await this.dispatchPendingStartDisconnects();
|
|
174
269
|
}
|
|
175
270
|
finally {
|
|
176
|
-
this.
|
|
177
|
-
this.unregisterMeshLinkRoute?.();
|
|
178
|
-
this.unregisterMeshLinkRoute = undefined;
|
|
179
|
-
if (this.meshLinkController === controller) {
|
|
180
|
-
this.meshLinkController = undefined;
|
|
181
|
-
this.meshLinkRuntime = undefined;
|
|
182
|
-
}
|
|
271
|
+
await this.releaseMeshLinkResources(false);
|
|
183
272
|
}
|
|
184
273
|
}
|
|
185
274
|
/**
|
|
@@ -289,7 +378,9 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
289
378
|
}
|
|
290
379
|
async onStreamWillActivate(stream) {
|
|
291
380
|
const metadata = snapshotMetadata(this.extractMeta(stream));
|
|
292
|
-
if (this.
|
|
381
|
+
if (this.meshClientService.isRunning && this.meshStartPromise)
|
|
382
|
+
await this.meshStartPromise;
|
|
383
|
+
if (this.meshClientService.isRunning) {
|
|
293
384
|
const activated = await this.enqueueClientRegistry(stream.clientId, async () => {
|
|
294
385
|
if (stream.lastPingAt < 0 || !this.isCurrentStream(stream)) {
|
|
295
386
|
return false;
|
|
@@ -310,7 +401,12 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
310
401
|
this.clientMetadata.set(stream.clientId, metadata);
|
|
311
402
|
}
|
|
312
403
|
async onStreamActivated(stream) {
|
|
313
|
-
|
|
404
|
+
// A partially-started mesh can already have an instance ID while its
|
|
405
|
+
// client registry is still unavailable. Backfill will publish this
|
|
406
|
+
// stream once startup completes; avoid treating that transient state
|
|
407
|
+
// as a stale metadata write and scheduling retry churn.
|
|
408
|
+
if (this.meshClientService.isRunning)
|
|
409
|
+
this.syncStreamMeta(stream);
|
|
314
410
|
await this.enqueueClientCallback(stream.clientId, async () => {
|
|
315
411
|
// Skip stale connection callbacks for streams that disconnected
|
|
316
412
|
// or were replaced before activation finished.
|
|
@@ -342,6 +438,7 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
342
438
|
onStreamDisconnected(stream, cause) {
|
|
343
439
|
super.onStreamDisconnected(stream, cause);
|
|
344
440
|
const publishedLifecycle = this.lifecycleConnectedStreams.has(stream);
|
|
441
|
+
const deferredDisconnect = this.pendingStartDisconnects?.get(stream);
|
|
345
442
|
this.lifecycleConnectedStreams.delete(stream);
|
|
346
443
|
void this.enqueueClientRegistry(stream.clientId, async () => {
|
|
347
444
|
// Sender routes belong to this fenced connection, even when a
|
|
@@ -359,13 +456,51 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
359
456
|
// flight. Re-read before touching shared metadata or callbacks.
|
|
360
457
|
const currentStream = this.getCurrentStreamByClientId(stream.clientId);
|
|
361
458
|
const replacementExists = currentStream !== undefined && currentStream !== stream;
|
|
362
|
-
if (replacementExists)
|
|
459
|
+
if (replacementExists) {
|
|
460
|
+
// A cancelled-start snapshot survives a merely local,
|
|
461
|
+
// tentative replacement. That replacement can still be
|
|
462
|
+
// rejected, in which case the original offline lifecycle
|
|
463
|
+
// transition must not be lost. A committed remote handoff is
|
|
464
|
+
// reconciled from the exact registry record before dispatch.
|
|
465
|
+
if (deferredDisconnect && !this.rollbackGatedDisconnects.has(stream) && this.pendingStartDisconnectFenceDeadlines.has(stream)) {
|
|
466
|
+
void this.dispatchPendingStartDisconnects(stream).catch(error => {
|
|
467
|
+
this.meshCleanupFailure = (0, helpers_1.toError)(error);
|
|
468
|
+
this.meshLogger.warn('failed to reconcile deferred supersede disconnect', {
|
|
469
|
+
error: this.meshCleanupFailure,
|
|
470
|
+
clientId: stream.clientId
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
else if (!deferredDisconnect) {
|
|
475
|
+
this.pendingStartDisconnects?.delete(stream);
|
|
476
|
+
}
|
|
363
477
|
return;
|
|
478
|
+
}
|
|
364
479
|
// A mesh ownership fence intentionally closes only this local
|
|
365
480
|
// generation. The client remains present on the replacement node,
|
|
366
481
|
// so release our stale metadata without publishing an offline
|
|
367
482
|
// lifecycle event.
|
|
368
483
|
if (cause === 'supersede') {
|
|
484
|
+
if (deferredDisconnect && !this.rollbackGatedDisconnects.has(stream) && this.pendingStartDisconnectFenceDeadlines.has(stream)) {
|
|
485
|
+
this.clientMetadata.delete(stream.clientId);
|
|
486
|
+
void this.dispatchPendingStartDisconnects(stream).catch(error => {
|
|
487
|
+
this.meshCleanupFailure = (0, helpers_1.toError)(error);
|
|
488
|
+
this.meshLogger.warn('failed to reconcile deferred supersede disconnect', {
|
|
489
|
+
error: this.meshCleanupFailure,
|
|
490
|
+
clientId: stream.clientId
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
this.pendingStartDisconnects?.delete(stream);
|
|
496
|
+
this.clientMetadata.delete(stream.clientId);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
// A full shutdown fence can make the exact unregister return
|
|
500
|
+
// false even though this stream was already published as
|
|
501
|
+
// connected. Preserve the callback snapshot and emit it only
|
|
502
|
+
// after the cancelled start's ownership cleanup succeeds.
|
|
503
|
+
if (deferredDisconnect) {
|
|
369
504
|
this.clientMetadata.delete(stream.clientId);
|
|
370
505
|
return;
|
|
371
506
|
}
|
|
@@ -415,6 +550,14 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
415
550
|
const existing = this.clientMetadata.get(stream.clientId);
|
|
416
551
|
if (existing && !shallowChanged(existing, metadata))
|
|
417
552
|
return;
|
|
553
|
+
// Pre-start clients are intentionally served locally. Keep the latest
|
|
554
|
+
// snapshot for startup backfill instead of writing through the
|
|
555
|
+
// placeholder registry, which would otherwise retry as stale.
|
|
556
|
+
if (!this.meshClientService.isRunning) {
|
|
557
|
+
if (this.isCurrentStream(stream))
|
|
558
|
+
this.clientMetadata.set(stream.clientId, metadata);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
418
561
|
// Write directly to the registry (always local/owning node).
|
|
419
562
|
// Do NOT route through meshClientService.updateClientMetadata here -
|
|
420
563
|
// that would loop back into clientUpdateMetaFn -> stream.meta -> proxy.
|
|
@@ -479,12 +622,14 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
479
622
|
return this.meshClientService.clientRegistry;
|
|
480
623
|
}
|
|
481
624
|
get startupState() {
|
|
482
|
-
if (this.
|
|
625
|
+
if (this.meshLeaseFailure)
|
|
626
|
+
return 'failed';
|
|
627
|
+
if (this.meshCleanupFailure)
|
|
628
|
+
return 'failed';
|
|
629
|
+
if (this.meshStopping || this.meshStopPromise || this.meshPendingStartCleanup || this.meshPendingLinkClose)
|
|
483
630
|
return 'draining';
|
|
484
631
|
if (this.meshStartPromise)
|
|
485
632
|
return 'starting';
|
|
486
|
-
if (this.meshLeaseFailure)
|
|
487
|
-
return 'failed';
|
|
488
633
|
return this.meshRunning ? 'ready' : 'stopped';
|
|
489
634
|
}
|
|
490
635
|
ready() {
|
|
@@ -650,22 +795,58 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
650
795
|
async meshStart() {
|
|
651
796
|
if (this.meshLeaseFailure)
|
|
652
797
|
throw this.meshLeaseFailure;
|
|
798
|
+
if (this.meshCleanupFailure)
|
|
799
|
+
throw this.meshCleanupFailure;
|
|
653
800
|
if (this.meshClosed)
|
|
654
801
|
throw new Error('sRPC mesh server is closed');
|
|
655
802
|
if (this.meshStopPromise) {
|
|
656
803
|
await this.meshStopPromise;
|
|
657
804
|
return this.meshStart();
|
|
658
805
|
}
|
|
806
|
+
// A shutdown is allowed to return before an uncooperative underlying
|
|
807
|
+
// mesh start settles. Do not let a new start overlap that deferred
|
|
808
|
+
// rollback or inherit its partially-created membership.
|
|
809
|
+
if (this.meshPendingStartCleanup) {
|
|
810
|
+
await this.meshPendingStartCleanup;
|
|
811
|
+
return this.meshStart();
|
|
812
|
+
}
|
|
813
|
+
if (this.meshPendingLinkClose) {
|
|
814
|
+
await this.meshPendingLinkClose;
|
|
815
|
+
return this.meshStart();
|
|
816
|
+
}
|
|
659
817
|
if (this.meshRunning)
|
|
660
818
|
return;
|
|
661
|
-
if (this.meshStartPromise)
|
|
662
|
-
|
|
819
|
+
if (this.meshStartPromise) {
|
|
820
|
+
if (!this.meshStartCancelled)
|
|
821
|
+
return this.meshStartPromise;
|
|
822
|
+
// A caller arriving after shutdown requested cancellation must not
|
|
823
|
+
// inherit the cancelled start's rejection. Wait for its rollback,
|
|
824
|
+
// then begin a fresh lifecycle.
|
|
825
|
+
await this.meshStartPromise.catch(() => { });
|
|
826
|
+
return this.meshStart();
|
|
827
|
+
}
|
|
828
|
+
const generation = (this.meshStartGeneration ?? 0) + 1;
|
|
829
|
+
this.meshStartGeneration = generation;
|
|
830
|
+
this.meshStartCancelled = false;
|
|
831
|
+
this.meshStartRollbackFailure = undefined;
|
|
832
|
+
this.meshClientService.prepareStart?.();
|
|
663
833
|
const start = (async () => {
|
|
664
834
|
try {
|
|
665
|
-
await this.startMesh();
|
|
835
|
+
await this.startMesh(generation);
|
|
666
836
|
}
|
|
667
837
|
catch (error) {
|
|
668
|
-
|
|
838
|
+
try {
|
|
839
|
+
await this.rollbackMeshStart();
|
|
840
|
+
}
|
|
841
|
+
catch (rollbackError) {
|
|
842
|
+
this.meshStartRollbackFailure = (0, helpers_1.toError)(rollbackError);
|
|
843
|
+
// A cancelled start gets one deferred rollback retry after
|
|
844
|
+
// its original startup settles. Do not permanently fail
|
|
845
|
+
// future starts until that recovery barrier also fails.
|
|
846
|
+
if (!this.meshStartCancelled)
|
|
847
|
+
this.meshCleanupFailure = this.meshStartRollbackFailure;
|
|
848
|
+
throw this.meshStartRollbackFailure;
|
|
849
|
+
}
|
|
669
850
|
throw error;
|
|
670
851
|
}
|
|
671
852
|
})();
|
|
@@ -678,7 +859,12 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
678
859
|
this.meshStartPromise = undefined;
|
|
679
860
|
}
|
|
680
861
|
}
|
|
681
|
-
|
|
862
|
+
assertMeshStartCurrent(generation) {
|
|
863
|
+
if (this.meshStartGeneration !== generation || this.meshStopping || this.meshClosed) {
|
|
864
|
+
throw new Error('sRPC mesh startup was cancelled');
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
async startMesh(generation) {
|
|
682
868
|
const linkConfig = this.resolveMeshLinkConfig();
|
|
683
869
|
if (linkConfig) {
|
|
684
870
|
this.meshLinkRequestTimeoutMs = linkConfig.requestTimeoutMs;
|
|
@@ -701,8 +887,10 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
701
887
|
linkUrl: advertiseUrl,
|
|
702
888
|
startedAt: Date.now()
|
|
703
889
|
});
|
|
890
|
+
this.assertMeshStartCurrent(generation);
|
|
704
891
|
}
|
|
705
892
|
await this.meshClientService.start();
|
|
893
|
+
this.assertMeshStartCurrent(generation);
|
|
706
894
|
this.meshRunning = true;
|
|
707
895
|
// Backfill clients that connected before mesh tracking was running.
|
|
708
896
|
// Route through enqueueClientRegistry so backfill registrations are
|
|
@@ -718,15 +906,16 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
718
906
|
}
|
|
719
907
|
const backfillPromises = [];
|
|
720
908
|
for (const [clientId, stream] of backfillStreams) {
|
|
909
|
+
this.assertMeshStartCurrent(generation);
|
|
721
910
|
// Install proxy if not already proxied (streams that connected before meshStart)
|
|
722
911
|
this.installMetaProxy(stream);
|
|
723
|
-
if
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
const metadata = this.clientMetadata.get(clientId);
|
|
912
|
+
// Resnapshot even if a local pre-start mutation previously
|
|
913
|
+
// populated the cache. The live stream is authoritative.
|
|
914
|
+
const metadata = snapshotMetadata(this.extractMeta(stream));
|
|
915
|
+
this.clientMetadata.set(clientId, metadata);
|
|
728
916
|
const allowSupersede = stream.supersede;
|
|
729
917
|
const backfill = this.enqueueClientRegistry(clientId, async () => {
|
|
918
|
+
this.assertMeshStartCurrent(generation);
|
|
730
919
|
// Only backfill the current stream (active or pending).
|
|
731
920
|
const currentStream = this.getCurrentStreamByClientId(clientId);
|
|
732
921
|
if (currentStream !== stream)
|
|
@@ -743,8 +932,15 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
743
932
|
backfillPromises.push(backfill.then(() => undefined));
|
|
744
933
|
}
|
|
745
934
|
await Promise.all(backfillPromises);
|
|
935
|
+
this.assertMeshStartCurrent(generation);
|
|
746
936
|
}
|
|
747
937
|
async meshStop() {
|
|
938
|
+
if (this.meshFatalCleanupPromise)
|
|
939
|
+
return this.meshFatalCleanupPromise;
|
|
940
|
+
if (this.meshLeaseCleanupPromise)
|
|
941
|
+
return this.meshLeaseCleanupPromise;
|
|
942
|
+
if (this.meshLeaseCleanupRequired)
|
|
943
|
+
return this.beginMeshLeaseCleanup();
|
|
748
944
|
if (this.meshStopPromise)
|
|
749
945
|
return this.meshStopPromise;
|
|
750
946
|
const stop = this.stopMesh();
|
|
@@ -758,55 +954,435 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
758
954
|
}
|
|
759
955
|
}
|
|
760
956
|
async stopMesh() {
|
|
761
|
-
|
|
957
|
+
const start = this.meshStartPromise;
|
|
958
|
+
if (start) {
|
|
959
|
+
// Do not await a start that is blocked on an unavailable
|
|
960
|
+
// dependency. Detach the directly-owned mesh transport now, then
|
|
961
|
+
// arrange a best-effort rollback when the dependency eventually
|
|
962
|
+
// returns. This keeps shutdown bounded and prevents a late start
|
|
963
|
+
// from resurrecting delivery resources.
|
|
964
|
+
this.meshStartGeneration++;
|
|
965
|
+
this.meshStartCancelled = true;
|
|
966
|
+
this.meshRunning = false;
|
|
967
|
+
this.meshStopping = true;
|
|
968
|
+
let setupFailure;
|
|
762
969
|
try {
|
|
763
|
-
|
|
970
|
+
const failures = [];
|
|
971
|
+
// Fence membership first. It does not clear lifecycle metadata,
|
|
972
|
+
// and makes every subsequent best-effort local cleanup safe.
|
|
973
|
+
try {
|
|
974
|
+
this.meshClientService.fenceForShutdown?.();
|
|
975
|
+
}
|
|
976
|
+
catch (error) {
|
|
977
|
+
failures.push((0, helpers_1.toError)(error));
|
|
978
|
+
}
|
|
979
|
+
try {
|
|
980
|
+
this.capturePendingStartDisconnects();
|
|
981
|
+
}
|
|
982
|
+
catch (error) {
|
|
983
|
+
failures.push((0, helpers_1.toError)(error));
|
|
984
|
+
}
|
|
985
|
+
try {
|
|
986
|
+
this.disconnectAllMeshStreams();
|
|
987
|
+
}
|
|
988
|
+
catch (error) {
|
|
989
|
+
failures.push((0, helpers_1.toError)(error));
|
|
990
|
+
}
|
|
991
|
+
try {
|
|
992
|
+
await this.releaseMeshLinkResources(false);
|
|
993
|
+
}
|
|
994
|
+
catch (error) {
|
|
995
|
+
failures.push((0, helpers_1.toError)(error));
|
|
996
|
+
}
|
|
997
|
+
if (failures.length === 1)
|
|
998
|
+
setupFailure = failures[0];
|
|
999
|
+
else if (failures.length > 1)
|
|
1000
|
+
setupFailure = new AggregateError(failures, 'sRPC mesh pending-start shutdown setup failed');
|
|
1001
|
+
if (setupFailure)
|
|
1002
|
+
throw setupFailure;
|
|
764
1003
|
}
|
|
765
|
-
|
|
766
|
-
|
|
1004
|
+
finally {
|
|
1005
|
+
this.meshStopping = false;
|
|
1006
|
+
// A setup failure must not strand a late start without its
|
|
1007
|
+
// rollback barrier. The deferred retry also retains captured
|
|
1008
|
+
// offline callbacks until ownership is conclusively cleaned.
|
|
1009
|
+
this.deferPendingMeshStartRollback(start, setupFailure);
|
|
767
1010
|
}
|
|
1011
|
+
return;
|
|
768
1012
|
}
|
|
769
1013
|
if (!this.meshRunning)
|
|
770
1014
|
return;
|
|
771
1015
|
this.meshRunning = false;
|
|
772
1016
|
this.meshStopping = true;
|
|
1017
|
+
const failures = [];
|
|
773
1018
|
try {
|
|
1019
|
+
// Fence admission before taking the stream snapshot below. Cleanup
|
|
1020
|
+
// can await registry/controller work, so delaying this until the
|
|
1021
|
+
// final MeshClientService.stop() would allow a late connection to
|
|
1022
|
+
// reserve and activate outside that snapshot.
|
|
1023
|
+
this.meshClientService.fenceAdmission?.();
|
|
774
1024
|
// Fence local delivery first. This queues exact unregister work
|
|
775
1025
|
// while the mesh service is still available to persist it.
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
1026
|
+
this.disconnectAllMeshStreams();
|
|
1027
|
+
await Promise.allSettled([...(this.clientRegistryChains?.values() ?? [])]);
|
|
1028
|
+
}
|
|
1029
|
+
catch (error) {
|
|
1030
|
+
failures.push((0, helpers_1.toError)(error));
|
|
1031
|
+
}
|
|
1032
|
+
try {
|
|
1033
|
+
await this.releaseMeshLinkResources(false);
|
|
1034
|
+
}
|
|
1035
|
+
catch (error) {
|
|
1036
|
+
failures.push((0, helpers_1.toError)(error));
|
|
1037
|
+
}
|
|
1038
|
+
try {
|
|
1039
|
+
await this.meshClientService.stop();
|
|
1040
|
+
}
|
|
1041
|
+
catch (error) {
|
|
1042
|
+
failures.push((0, helpers_1.toError)(error));
|
|
1043
|
+
}
|
|
1044
|
+
try {
|
|
1045
|
+
if (failures.length === 1)
|
|
1046
|
+
throw failures[0];
|
|
1047
|
+
if (failures.length > 1)
|
|
1048
|
+
throw new AggregateError(failures, 'sRPC mesh shutdown failed');
|
|
1049
|
+
}
|
|
1050
|
+
catch (error) {
|
|
1051
|
+
// Once normal shutdown has fenced delivery, a failed registry or
|
|
1052
|
+
// membership cleanup cannot safely be followed by a fresh start.
|
|
1053
|
+
// Preserve the failure as a durable lifecycle barrier.
|
|
1054
|
+
this.meshCleanupFailure = (0, helpers_1.toError)(error);
|
|
1055
|
+
throw this.meshCleanupFailure;
|
|
1056
|
+
}
|
|
1057
|
+
finally {
|
|
1058
|
+
this.meshStopping = false;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
disconnectAllMeshStreams() {
|
|
1062
|
+
const streams = new Set([...(this.streamsByClientId?.values() ?? []), ...(this.pendingStreamsByClientId?.values() ?? [])]);
|
|
1063
|
+
for (const stream of streams) {
|
|
1064
|
+
if (this.isCurrentStream(stream))
|
|
1065
|
+
this.cleanupStream(stream, 'disconnect');
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
capturePendingStartDisconnects() {
|
|
1069
|
+
this.pendingStartDisconnects ??= new Map();
|
|
1070
|
+
this.rollbackGatedDisconnects ??= new WeakSet();
|
|
1071
|
+
const streams = new Set([...(this.streamsByClientId?.values() ?? []), ...(this.pendingStreamsByClientId?.values() ?? [])]);
|
|
1072
|
+
for (const stream of streams) {
|
|
1073
|
+
if (!this.isCurrentStream(stream) || !this.lifecycleConnectedStreams?.has(stream) || !this.clientMetadata.has(stream.clientId))
|
|
1074
|
+
continue;
|
|
1075
|
+
this.captureDeferredDisconnect(stream);
|
|
1076
|
+
this.rollbackGatedDisconnects.add(stream);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
captureDeferredDisconnect(stream) {
|
|
1080
|
+
this.pendingStartDisconnects ??= new Map();
|
|
1081
|
+
if (this.pendingStartDisconnects.has(stream) || !this.lifecycleConnectedStreams?.has(stream) || !this.clientMetadata.has(stream.clientId))
|
|
1082
|
+
return;
|
|
1083
|
+
this.pendingStartDisconnects.set(stream, {
|
|
1084
|
+
clientId: stream.clientId,
|
|
1085
|
+
connectionId: stream.id,
|
|
1086
|
+
nodeId: this.meshClientService.instanceId,
|
|
1087
|
+
metadata: snapshotMetadata(this.clientMetadata.get(stream.clientId))
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
async dispatchPendingStartDisconnects(targetStream) {
|
|
1091
|
+
if (!this.pendingStartDisconnects)
|
|
1092
|
+
return;
|
|
1093
|
+
const pending = targetStream
|
|
1094
|
+
? (() => {
|
|
1095
|
+
const snapshot = this.pendingStartDisconnects.get(targetStream);
|
|
1096
|
+
return snapshot ? [[targetStream, snapshot]] : [];
|
|
1097
|
+
})()
|
|
1098
|
+
: [...this.pendingStartDisconnects.entries()];
|
|
1099
|
+
await Promise.all(pending.map(async ([stream, snapshot]) => {
|
|
1100
|
+
const { clientId, metadata } = snapshot;
|
|
1101
|
+
let fenceDeadline = this.pendingStartDisconnectFenceDeadlines?.get(stream);
|
|
1102
|
+
if (this.rollbackGatedDisconnects?.has(stream)) {
|
|
1103
|
+
// A fence can arrive after shutdown detached the old
|
|
1104
|
+
// stream. Verify the post-rollback registry first, then
|
|
1105
|
+
// retain this exact generation through one full claim
|
|
1106
|
+
// window so a late private claim may publish safely.
|
|
1107
|
+
const detectionDeadline = fenceDeadline ?? Date.now() + this.meshSupersedeReconcileMs;
|
|
1108
|
+
if (!(await this.shouldDispatchPendingStartDisconnect(snapshot, undefined, detectionDeadline))) {
|
|
1109
|
+
this.pendingStartDisconnects?.delete(stream);
|
|
1110
|
+
this.pendingStartDisconnectFenceDeadlines?.delete(stream);
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
if (fenceDeadline === undefined) {
|
|
1114
|
+
fenceDeadline = detectionDeadline;
|
|
1115
|
+
this.pendingStartDisconnectFenceDeadlines.set(stream, fenceDeadline);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
if (fenceDeadline !== undefined) {
|
|
1119
|
+
this.queuePendingStartDisconnectCallback(stream, snapshot, fenceDeadline, !this.rollbackGatedDisconnects?.has(stream));
|
|
1120
|
+
}
|
|
1121
|
+
else if (await this.shouldDispatchPendingStartDisconnect(snapshot)) {
|
|
1122
|
+
// An in-flight remote exact fence can consume this
|
|
1123
|
+
// snapshot while registry reconciliation awaits.
|
|
1124
|
+
if (!this.pendingStartDisconnects?.has(stream))
|
|
1125
|
+
return;
|
|
1126
|
+
// Queue application work behind the per-client callback
|
|
1127
|
+
// chain, but do not make global restart safety depend on
|
|
1128
|
+
// user code settling. Ownership reconciliation above is
|
|
1129
|
+
// the lifecycle barrier.
|
|
1130
|
+
void this.enqueueClientCallback(clientId, async () => {
|
|
1131
|
+
for (const cb of this.disconnectedCallbacks) {
|
|
1132
|
+
try {
|
|
1133
|
+
await cb(clientId, metadata);
|
|
1134
|
+
}
|
|
1135
|
+
catch (err) {
|
|
1136
|
+
this.meshLogger.warn('client disconnected callback error', { err, clientId });
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}).catch(error => this.meshLogger.warn('deferred client disconnected callback error', { error, clientId }));
|
|
1140
|
+
}
|
|
1141
|
+
this.pendingStartDisconnects?.delete(stream);
|
|
1142
|
+
}));
|
|
1143
|
+
}
|
|
1144
|
+
async shouldDispatchPendingStartDisconnect(snapshot, fenceDeadline, lookupRetryDeadline = fenceDeadline, retryDelayMs = this.meshSupersedeReconcileRetryMs) {
|
|
1145
|
+
const registry = this.meshClientService.clientRegistry;
|
|
1146
|
+
retryDelayMs = Math.max(1, retryDelayMs ?? 10);
|
|
1147
|
+
let current;
|
|
1148
|
+
try {
|
|
1149
|
+
current = await registry.getClient(snapshot.clientId);
|
|
1150
|
+
}
|
|
1151
|
+
catch (error) {
|
|
1152
|
+
if (lookupRetryDeadline !== undefined && Date.now() < lookupRetryDeadline) {
|
|
1153
|
+
await new Promise(resolve => {
|
|
1154
|
+
const timer = setTimeout(resolve, Math.min(retryDelayMs, lookupRetryDeadline - Date.now()));
|
|
1155
|
+
timer.unref?.();
|
|
1156
|
+
});
|
|
1157
|
+
return this.shouldDispatchPendingStartDisconnect(snapshot, fenceDeadline, lookupRetryDeadline, Math.min(Math.max(retryDelayMs * 2, 1), 1000));
|
|
1158
|
+
}
|
|
1159
|
+
throw (0, helpers_1.toError)(error);
|
|
1160
|
+
}
|
|
1161
|
+
if ((!current || (current.nodeId === snapshot.nodeId && current.connectionId === snapshot.connectionId)) &&
|
|
1162
|
+
fenceDeadline !== undefined &&
|
|
1163
|
+
Date.now() < fenceDeadline) {
|
|
1164
|
+
await new Promise(resolve => {
|
|
1165
|
+
const timer = setTimeout(resolve, Math.min(retryDelayMs, fenceDeadline - Date.now()));
|
|
1166
|
+
timer.unref?.();
|
|
1167
|
+
});
|
|
1168
|
+
return this.shouldDispatchPendingStartDisconnect(snapshot, fenceDeadline, lookupRetryDeadline, Math.min(Math.max(retryDelayMs * 2, 1), 1000));
|
|
1169
|
+
}
|
|
1170
|
+
if (!current)
|
|
1171
|
+
return true;
|
|
1172
|
+
if (current.nodeId !== snapshot.nodeId || current.connectionId !== snapshot.connectionId)
|
|
1173
|
+
return false;
|
|
1174
|
+
throw new Error(`Cannot reconcile deferred mesh disconnect for ${snapshot.clientId}: exact old generation is still registered`);
|
|
1175
|
+
}
|
|
1176
|
+
queuePendingStartDisconnectCallback(stream, snapshot, fenceDeadline, pollForReplacement = true) {
|
|
1177
|
+
if (this.pendingStartDisconnectCallbackQueued.has(stream))
|
|
1178
|
+
return;
|
|
1179
|
+
this.pendingStartDisconnectCallbackQueued.add(stream);
|
|
1180
|
+
if (!this.rollbackGatedDisconnects.has(stream))
|
|
1181
|
+
this.pendingStartDisconnects?.delete(stream);
|
|
1182
|
+
const { clientId, metadata } = snapshot;
|
|
1183
|
+
void this.enqueueClientCallback(clientId, async () => {
|
|
1184
|
+
if (!pollForReplacement && Date.now() < fenceDeadline) {
|
|
1185
|
+
await new Promise(resolve => {
|
|
1186
|
+
const timer = setTimeout(resolve, fenceDeadline - Date.now());
|
|
1187
|
+
timer.unref?.();
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
// Lease-loss/rollback snapshots perform one deadline lookup rather
|
|
1191
|
+
// than polling Redis per client throughout the claim window. Only
|
|
1192
|
+
// actual takeover fences poll early, using exponential backoff.
|
|
1193
|
+
const lookupRetryDeadline = pollForReplacement ? fenceDeadline : Date.now() + Math.min(this.meshSupersedeReconcileMs ?? 30000, 5000);
|
|
1194
|
+
const shouldDispatch = await this.shouldDispatchPendingStartDisconnect(snapshot, pollForReplacement ? fenceDeadline : undefined, lookupRetryDeadline);
|
|
1195
|
+
// Reconciliation state must not retain the stream for the lifetime
|
|
1196
|
+
// of arbitrary application callback work.
|
|
1197
|
+
this.pendingStartDisconnectFenceDeadlines.delete(stream);
|
|
1198
|
+
if (!shouldDispatch)
|
|
1199
|
+
return;
|
|
1200
|
+
for (const cb of this.disconnectedCallbacks) {
|
|
1201
|
+
try {
|
|
1202
|
+
await cb(clientId, metadata);
|
|
1203
|
+
}
|
|
1204
|
+
catch (err) {
|
|
1205
|
+
this.meshLogger.warn('client disconnected callback error', { err, clientId });
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
})
|
|
1209
|
+
.catch(error => {
|
|
1210
|
+
this.failDeferredDisconnectReconciliation((0, helpers_1.toError)(error), clientId);
|
|
1211
|
+
})
|
|
1212
|
+
.finally(() => {
|
|
1213
|
+
this.pendingStartDisconnectFenceDeadlines.delete(stream);
|
|
1214
|
+
this.pendingStartDisconnectCallbackQueued.delete(stream);
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
markPendingStartDisconnectFence(clientId, connectionId) {
|
|
1218
|
+
for (const [stream, snapshot] of this.pendingStartDisconnects ?? []) {
|
|
1219
|
+
if (snapshot.clientId === clientId && snapshot.connectionId === connectionId) {
|
|
1220
|
+
this.pendingStartDisconnectFenceDeadlines.set(stream, Date.now() + this.meshSupersedeReconcileMs);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
failDeferredDisconnectReconciliation(error, clientId) {
|
|
1225
|
+
if (this.meshFatalCleanupPromise) {
|
|
1226
|
+
this.meshCleanupFailure = new AggregateError([this.meshCleanupFailure ?? error, error], 'Multiple deferred mesh disconnect reconciliation failures');
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
this.meshCleanupFailure = error;
|
|
1230
|
+
this.meshRunning = false;
|
|
1231
|
+
const failures = [error];
|
|
1232
|
+
try {
|
|
1233
|
+
// Preserve immutable lifecycle snapshots before fencing membership;
|
|
1234
|
+
// unregisters after the fence can no longer prove exact removal.
|
|
1235
|
+
this.capturePendingStartDisconnects();
|
|
1236
|
+
}
|
|
1237
|
+
catch (captureError) {
|
|
1238
|
+
failures.push((0, helpers_1.toError)(captureError));
|
|
1239
|
+
}
|
|
1240
|
+
try {
|
|
1241
|
+
this.meshClientService.fenceForShutdown?.();
|
|
1242
|
+
}
|
|
1243
|
+
catch (fenceError) {
|
|
1244
|
+
failures.push((0, helpers_1.toError)(fenceError));
|
|
1245
|
+
}
|
|
1246
|
+
const cleanup = (async () => {
|
|
1247
|
+
try {
|
|
1248
|
+
this.disconnectAllMeshStreams();
|
|
1249
|
+
}
|
|
1250
|
+
catch (cleanupError) {
|
|
1251
|
+
failures.push((0, helpers_1.toError)(cleanupError));
|
|
783
1252
|
}
|
|
1253
|
+
// Let exact unregister work snapshot lifecycle metadata and queue
|
|
1254
|
+
// its callbacks before link release clears the shared cache.
|
|
784
1255
|
await Promise.allSettled([...(this.clientRegistryChains?.values() ?? [])]);
|
|
785
|
-
|
|
786
|
-
|
|
1256
|
+
try {
|
|
1257
|
+
await this.releaseMeshLinkResources(false);
|
|
1258
|
+
}
|
|
1259
|
+
catch (cleanupError) {
|
|
1260
|
+
failures.push((0, helpers_1.toError)(cleanupError));
|
|
1261
|
+
}
|
|
1262
|
+
try {
|
|
1263
|
+
await this.meshClientService.stop();
|
|
1264
|
+
try {
|
|
1265
|
+
await this.dispatchPendingStartDisconnects();
|
|
1266
|
+
}
|
|
1267
|
+
catch (dispatchError) {
|
|
1268
|
+
failures.push((0, helpers_1.toError)(dispatchError));
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
catch (cleanupError) {
|
|
1272
|
+
failures.push((0, helpers_1.toError)(cleanupError));
|
|
1273
|
+
}
|
|
1274
|
+
this.meshCleanupFailure =
|
|
1275
|
+
failures.length === 1 ? failures[0] : new AggregateError(failures, 'Deferred mesh disconnect reconciliation cleanup failed');
|
|
1276
|
+
this.meshLogger.warn('deferred client disconnect reconciliation failed; mesh ownership fenced', {
|
|
1277
|
+
error: this.meshCleanupFailure,
|
|
1278
|
+
clientId
|
|
1279
|
+
});
|
|
1280
|
+
})();
|
|
1281
|
+
this.meshFatalCleanupPromise = cleanup.catch(cleanupError => {
|
|
1282
|
+
this.meshCleanupFailure = new AggregateError([this.meshCleanupFailure, (0, helpers_1.toError)(cleanupError)], 'Deferred mesh disconnect reconciliation cleanup failed');
|
|
1283
|
+
this.meshLogger.warn('deferred mesh disconnect cleanup failed unexpectedly', { cleanupError });
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
/** Release mesh-link resources without waiting for mesh membership I/O. */
|
|
1287
|
+
async releaseMeshLinkResources(waitForClose = true) {
|
|
1288
|
+
const controller = this.meshLinkController;
|
|
1289
|
+
const failures = [];
|
|
1290
|
+
try {
|
|
787
1291
|
this.meshClientService.setRemoteTransport(undefined);
|
|
1292
|
+
}
|
|
1293
|
+
catch (error) {
|
|
1294
|
+
failures.push((0, helpers_1.toError)(error));
|
|
1295
|
+
}
|
|
1296
|
+
try {
|
|
788
1297
|
this.unregisterMeshLinkRoute?.();
|
|
1298
|
+
}
|
|
1299
|
+
catch (error) {
|
|
1300
|
+
failures.push((0, helpers_1.toError)(error));
|
|
1301
|
+
}
|
|
1302
|
+
finally {
|
|
789
1303
|
this.unregisterMeshLinkRoute = undefined;
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
1304
|
+
}
|
|
1305
|
+
let close;
|
|
1306
|
+
try {
|
|
1307
|
+
close = controller?.close();
|
|
1308
|
+
}
|
|
1309
|
+
catch (error) {
|
|
1310
|
+
failures.push((0, helpers_1.toError)(error));
|
|
794
1311
|
}
|
|
795
1312
|
finally {
|
|
796
|
-
this.
|
|
1313
|
+
if (this.meshLinkController === controller) {
|
|
1314
|
+
this.meshLinkController = undefined;
|
|
1315
|
+
this.meshLinkRuntime = undefined;
|
|
1316
|
+
}
|
|
1317
|
+
this.clientMetadata.clear();
|
|
1318
|
+
}
|
|
1319
|
+
if (!waitForClose && close) {
|
|
1320
|
+
this.trackDetachedLinkClose(close);
|
|
1321
|
+
}
|
|
1322
|
+
else if (close) {
|
|
1323
|
+
try {
|
|
1324
|
+
await close;
|
|
1325
|
+
}
|
|
1326
|
+
catch (error) {
|
|
1327
|
+
failures.push((0, helpers_1.toError)(error));
|
|
1328
|
+
}
|
|
797
1329
|
}
|
|
1330
|
+
if (failures.length === 1)
|
|
1331
|
+
throw failures[0];
|
|
1332
|
+
if (failures.length > 1)
|
|
1333
|
+
throw new AggregateError(failures, 'Failed to release sRPC mesh-link resources');
|
|
1334
|
+
}
|
|
1335
|
+
trackDetachedLinkClose(close) {
|
|
1336
|
+
this.meshPendingLinkClose = close;
|
|
1337
|
+
void close.then(() => {
|
|
1338
|
+
if (this.meshPendingLinkClose === close)
|
|
1339
|
+
this.meshPendingLinkClose = undefined;
|
|
1340
|
+
}, error => {
|
|
1341
|
+
if (this.meshPendingLinkClose === close) {
|
|
1342
|
+
this.meshCleanupFailure = (0, helpers_1.toError)(error);
|
|
1343
|
+
this.meshLogger.warn('failed to close detached sRPC mesh link', { error: this.meshCleanupFailure });
|
|
1344
|
+
}
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
deferPendingMeshStartRollback(start, setupFailure) {
|
|
1348
|
+
if (this.meshPendingStartCleanup)
|
|
1349
|
+
return;
|
|
1350
|
+
// `start` already rolls itself back on cancellation. The fulfilled
|
|
1351
|
+
// branch is defensive: it covers a future start path that fails to
|
|
1352
|
+
// observe the generation fence. Consume every failure here because
|
|
1353
|
+
// shutdown intentionally does not await the original start promise.
|
|
1354
|
+
const cleanup = start.then(() => this.rollbackMeshStart(),
|
|
1355
|
+
// meshStart already attempted rollback before rejecting. Retry
|
|
1356
|
+
// only a failed rollback so its error remains a cleanup barrier.
|
|
1357
|
+
async () => {
|
|
1358
|
+
if (this.meshStartRollbackFailure === undefined && setupFailure === undefined)
|
|
1359
|
+
return;
|
|
1360
|
+
await this.rollbackMeshStart();
|
|
1361
|
+
this.meshStartRollbackFailure = undefined;
|
|
1362
|
+
});
|
|
1363
|
+
const pendingLinkClose = this.meshPendingLinkClose;
|
|
1364
|
+
// Registry/membership cleanup is the offline safety boundary. A
|
|
1365
|
+
// controller close may be stuck behind its own request timeout, but
|
|
1366
|
+
// must not indefinitely suppress an already-confirmed lifecycle
|
|
1367
|
+
// disconnect callback. It remains a restart barrier below.
|
|
1368
|
+
const cleanupAndCallbacks = cleanup.then(() => this.dispatchPendingStartDisconnects());
|
|
1369
|
+
const barrier = pendingLinkClose ? Promise.all([cleanupAndCallbacks, pendingLinkClose]).then(() => undefined) : cleanupAndCallbacks;
|
|
1370
|
+
this.meshPendingStartCleanup = barrier;
|
|
1371
|
+
void barrier.then(() => {
|
|
1372
|
+
if (this.meshPendingStartCleanup === barrier) {
|
|
1373
|
+
this.meshPendingStartCleanup = undefined;
|
|
1374
|
+
if (this.meshPendingLinkClose === pendingLinkClose)
|
|
1375
|
+
this.meshPendingLinkClose = undefined;
|
|
1376
|
+
}
|
|
1377
|
+
}, error => {
|
|
1378
|
+
this.meshCleanupFailure = (0, helpers_1.toError)(error);
|
|
1379
|
+
this.meshLogger.warn('failed to roll back cancelled sRPC mesh startup', { error: this.meshCleanupFailure });
|
|
1380
|
+
});
|
|
798
1381
|
}
|
|
799
1382
|
async rollbackMeshStart() {
|
|
800
1383
|
this.meshRunning = false;
|
|
801
|
-
await this.
|
|
802
|
-
this.meshClientService.
|
|
803
|
-
this.unregisterMeshLinkRoute?.();
|
|
804
|
-
this.unregisterMeshLinkRoute = undefined;
|
|
805
|
-
this.meshLinkController = undefined;
|
|
806
|
-
if (this.meshClientService.instanceId !== 0)
|
|
807
|
-
await this.meshClientService.stop();
|
|
808
|
-
this.meshLinkRuntime = undefined;
|
|
809
|
-
this.clientMetadata.clear();
|
|
1384
|
+
await this.releaseMeshLinkResources(false);
|
|
1385
|
+
await this.meshClientService.stop();
|
|
810
1386
|
}
|
|
811
1387
|
close() {
|
|
812
1388
|
this.meshClosed = true;
|
|
@@ -896,7 +1472,8 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
896
1472
|
getLocalConnection: clientId => this.streamsByClientId.get(clientId),
|
|
897
1473
|
hasLocalFenceConnection: (clientId, connectionId) => {
|
|
898
1474
|
const stream = this.streamsById.get(connectionId);
|
|
899
|
-
return stream?.clientId === clientId
|
|
1475
|
+
return (stream?.clientId === clientId ||
|
|
1476
|
+
[...this.pendingStartDisconnects.values()].some(snapshot => snapshot.clientId === clientId && snapshot.connectionId === connectionId));
|
|
900
1477
|
},
|
|
901
1478
|
invokeLocal: async (clientId, connectionId, prefix, encoded, timeoutMs) => {
|
|
902
1479
|
const stream = getLocal(clientId, connectionId);
|
|
@@ -943,11 +1520,7 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
943
1520
|
await super.disconnectClient(stream, reason);
|
|
944
1521
|
return true;
|
|
945
1522
|
},
|
|
946
|
-
fenceLocal: async (clientId, connectionId) =>
|
|
947
|
-
const stream = getFenceLocal(clientId, connectionId);
|
|
948
|
-
this.cleanupStream(stream, 'supersede');
|
|
949
|
-
return true;
|
|
950
|
-
},
|
|
1523
|
+
fenceLocal: async (clientId, connectionId, reason) => this.handleClientSuperseded(clientId, connectionId, reason),
|
|
951
1524
|
updateLocalMetadata: async (clientId, connectionId, metadata) => {
|
|
952
1525
|
const stream = getLocal(clientId, connectionId);
|
|
953
1526
|
const projected = this.projectMetadataWithoutMutation(stream, metadata);
|
|
@@ -1044,7 +1617,7 @@ class MeshSrpcServer extends SrpcServer_1.SrpcServer {
|
|
|
1044
1617
|
}
|
|
1045
1618
|
return this.options.httpServer;
|
|
1046
1619
|
}
|
|
1047
|
-
static __tsfType = _MeshSrpcServerMetadata_1 = _a.decodeCompactMetadataV1("[1,{\"kind\":16,\"name\":\"MeshSrpcServer\",\"typeName\":\"MeshSrpcServer\",\"classType\":{\"$tsf\":0},\"properties\":[],\"methods\":[{\"name\":\"postEstablishCheck\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":0},\"description\":\"Defers stream activation until mesh reservation succeeds. Installs meta proxy and reserves the client atomically in Redis (respecting allowSupersede for v2), all serialized in the per-client registry chain. Reserved clients remain hidden from lookup/invoke until onStreamActivated promotes them to active.\"},{\"name\":\"onStreamConnected\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"onStreamWillActivate\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"onStreamActivated\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"onStreamDisconnected\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false},{\"name\":\"cause\",\"type\":{\"$tsfType\":2},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"ready\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"getClientPresence\",\"parameters\":[{\"name\":\"clientId\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"RegisteredClient\",\"types\":[{\"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\":\"processId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"metadata\",\"type\":{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}},\"optional\":false}]},{\"kind\":4}]}},\"description\":\"Read a generation-fenced registry record without materializing a remote connection, link capability, or byte-stream sender pool. Use this for presence and metadata decisions; resolveClient() is for an imminent invoke, byte stream, metadata mutation, or disconnect.\"},{\"name\":\"listClientPresences\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":18,\"typeName\":\"RegisteredClient\",\"types\":[{\"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\":\"processId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"metadata\",\"type\":{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}},\"optional\":false}]}}},\"description\":\"Registry-only counterpart to listClients(); it never creates remote handles.\"},{\"name\":\"updateClientMetadata\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"metadata\",\"type\":{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}}],\"utilityKeys\":[],\"types\":[]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":0},\"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\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":5},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"onClientDisconnected\",\"parameters\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":5},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"onNodeClientsOrphaned\",\"parameters\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"registerBroadcastHandler\",\"parameters\":[{\"name\":\"type\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"name\":\"handler\",\"type\":{\"$tsfType\":8},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"broadcast\",\"parameters\":[{\"name\":\"type\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":9},\"optional\":false,\"default\":false},{\"name\":\"options\",\"type\":{\"$tsfType\":10},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"resolveClient\",\"parameters\":[{\"name\":\"clientId\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false},{\"name\":\"deadlineAt\",\"type\":{\"$tsfType\":11},\"optional\":true,\"default\":false}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":4}]}}},{\"name\":\"listClients\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]}}}},{\"name\":\"disconnectClient\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"reason\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":0}},{\"name\":\"invoke\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"prefix\",\"type\":{\"$tsfType\":12},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":12},\"optional\":false,\"default\":false},{\"name\":\"timeoutMs\",\"type\":{\"$tsfType\":13},\"optional\":true,\"default\":true}],\"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\":\"meshStart\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"meshStop\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"close\",\"parameters\":[],\"returnType\":{\"$tsfType\":3}},{\"name\":\"handleByteSubstreamOperation\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false},{\"name\":\"operation\",\"type\":{\"$tsfType\":15},\"optional\":false,\"default\":false},{\"name\":\"requestId\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"hasExternalByteStreamSender\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false},{\"name\":\"streamId\",\"type\":{\"$tsfType\":11},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":16}}],\"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\":\"allowMissingProtocolVersion\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"debug\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logLevel\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"info\"},{\"kind\":10,\"literal\":\"debug\"},{\"kind\":10,\"literal\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Server\",\"classType\":{\"$tsfImport\":[6,\"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},{\"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\":\"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},{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientMetadataBytes\",\"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\":\"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\":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},{\"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}]}],\"utilityKeys\":[\"instanceId\",\"hostname\",\"self\"],\"types\":[{\"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\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"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\":[{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"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\":\"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\":\"extractMetadata\",\"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\":[6,\"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},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]}]},\"optional\":false,\"default\":false}]}]", [() => MeshSrpcServer, () => (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)), () => (typeof TMeta !== "undefined" ? TMeta : (typeof exports !== "undefined" ? exports.TMeta : undefined)), () => (typeof TRegistryMeta !== "undefined" ? TRegistryMeta : (typeof exports !== "undefined" ? exports.TRegistryMeta : undefined)), require], __tsf_metadata_type);
|
|
1620
|
+
static __tsfType = _MeshSrpcServerMetadata_1 = _a.decodeCompactMetadataV1("[1,{\"kind\":16,\"name\":\"MeshSrpcServer\",\"typeName\":\"MeshSrpcServer\",\"classType\":{\"$tsf\":0},\"properties\":[],\"methods\":[{\"name\":\"postEstablishCheck\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":0},\"description\":\"Defers stream activation until mesh reservation succeeds. Installs meta proxy and reserves the client atomically in Redis (respecting allowSupersede for v2), all serialized in the per-client registry chain. Reserved clients remain hidden from lookup/invoke until onStreamActivated promotes them to active.\"},{\"name\":\"onStreamConnected\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"onStreamWillActivate\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"onStreamActivated\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"onStreamDisconnected\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false},{\"name\":\"cause\",\"type\":{\"$tsfType\":2},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"ready\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"getClientPresence\",\"parameters\":[{\"name\":\"clientId\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"RegisteredClient\",\"types\":[{\"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\":\"processId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"metadata\",\"type\":{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}},\"optional\":false}]},{\"kind\":4}]}},\"description\":\"Read a generation-fenced registry record without materializing a remote connection, link capability, or byte-stream sender pool. Use this for presence and metadata decisions; resolveClient() is for an imminent invoke, byte stream, metadata mutation, or disconnect.\"},{\"name\":\"listClientPresences\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":18,\"typeName\":\"RegisteredClient\",\"types\":[{\"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\":\"processId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"metadata\",\"type\":{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}},\"optional\":false}]}}},\"description\":\"Registry-only counterpart to listClients(); it never creates remote handles.\"},{\"name\":\"updateClientMetadata\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"metadata\",\"type\":{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}}],\"utilityKeys\":[],\"types\":[]},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":0},\"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\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":5},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"onClientDisconnected\",\"parameters\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":5},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"onNodeClientsOrphaned\",\"parameters\":[{\"name\":\"handler\",\"type\":{\"$tsfType\":6},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"registerBroadcastHandler\",\"parameters\":[{\"name\":\"type\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"name\":\"handler\",\"type\":{\"$tsfType\":8},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"broadcast\",\"parameters\":[{\"name\":\"type\",\"type\":{\"$tsfType\":7},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":9},\"optional\":false,\"default\":false},{\"name\":\"options\",\"type\":{\"$tsfType\":10},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":1}},{\"name\":\"resolveClient\",\"parameters\":[{\"name\":\"clientId\",\"type\":{\"$tsfType\":4},\"optional\":false,\"default\":false},{\"name\":\"deadlineAt\",\"type\":{\"$tsfType\":11},\"optional\":true,\"default\":false}],\"returnType\":{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":4}]}}},{\"name\":\"listClients\",\"parameters\":[],\"returnType\":{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]}}}},{\"name\":\"disconnectClient\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"reason\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":0}},{\"name\":\"invoke\",\"parameters\":[{\"name\":\"connectionOrClientId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"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\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},{\"kind\":16,\"typeName\":\"TRegistryMeta\",\"classType\":{\"$tsf\":5}}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}]},{\"kind\":6}]},\"optional\":false,\"default\":false},{\"name\":\"prefix\",\"type\":{\"$tsfType\":12},\"optional\":false,\"default\":false},{\"name\":\"data\",\"type\":{\"$tsfType\":12},\"optional\":false,\"default\":false},{\"name\":\"timeoutMs\",\"type\":{\"$tsfType\":13},\"optional\":true,\"default\":true}],\"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\":\"meshStart\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"meshStop\",\"parameters\":[],\"returnType\":{\"$tsfType\":1}},{\"name\":\"close\",\"parameters\":[],\"returnType\":{\"$tsfType\":3}},{\"name\":\"handleByteSubstreamOperation\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false},{\"name\":\"operation\",\"type\":{\"$tsfType\":15},\"optional\":false,\"default\":false},{\"name\":\"requestId\",\"type\":{\"$tsfType\":4},\"optional\":true,\"default\":false}],\"returnType\":{\"$tsfType\":3}},{\"name\":\"hasExternalByteStreamSender\",\"parameters\":[{\"name\":\"stream\",\"type\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"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}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":1}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":2},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"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}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"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\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":2}]},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":16,\"typeName\":\"TMeta\",\"classType\":{\"$tsf\":4}},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"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}]},\"optional\":false,\"default\":false},{\"name\":\"streamId\",\"type\":{\"$tsfType\":11},\"optional\":false,\"default\":false}],\"returnType\":{\"$tsfType\":16}}],\"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\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"debug\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logLevel\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"info\"},{\"kind\":10,\"literal\":\"debug\"},{\"kind\":10,\"literal\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Server\",\"classType\":{\"$tsfImport\":[6,\"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},{\"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\":\"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},{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientMetadataBytes\",\"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\":\"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\":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},{\"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}]}],\"utilityKeys\":[\"instanceId\",\"hostname\",\"self\"],\"types\":[{\"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\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"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\":[{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"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\":\"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\":\"extractMetadata\",\"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\":[6,\"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},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]}]},\"optional\":false,\"default\":false}]}]", [() => MeshSrpcServer, () => (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)), () => (typeof TMeta !== "undefined" ? TMeta : (typeof exports !== "undefined" ? exports.TMeta : undefined)), () => (typeof TRegistryMeta !== "undefined" ? TRegistryMeta : (typeof exports !== "undefined" ? exports.TRegistryMeta : undefined)), require], __tsf_metadata_type);
|
|
1048
1621
|
}
|
|
1049
1622
|
exports.MeshSrpcServer = MeshSrpcServer;
|
|
1050
1623
|
_MeshSrpcServerMetadata_1.classType = MeshSrpcServer;
|
|
@@ -1084,5 +1657,5 @@ function shallowChanged(a, b) {
|
|
|
1084
1657
|
}
|
|
1085
1658
|
return false;
|
|
1086
1659
|
}
|
|
1087
|
-
exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"MeshSrpcServerOptions\":{\"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\":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},{\"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}]}],\"utilityKeys\":[\"instanceId\",\"hostname\",\"self\"],\"types\":[{\"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\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"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\":[{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"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\":\"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\":\"extractMetadata\",\"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\":[0,\"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},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}],\"typeParameters\":[\"TMeta\",\"TRegistryMeta\"]}}]", [require], __tsf_metadata_type);
|
|
1660
|
+
exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"MeshSrpcServerOptions\":{\"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\":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},{\"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}]}],\"utilityKeys\":[\"instanceId\",\"hostname\",\"self\"],\"types\":[{\"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\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"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\":[{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"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},{\"kind\":20,\"name\":\"cleanupBatchSize\",\"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\":\"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\":\"extractMetadata\",\"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\":[0,\"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},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxEndpointPins\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}],\"typeParameters\":[\"TMeta\",\"TRegistryMeta\"]}}]", [require], __tsf_metadata_type);
|
|
1088
1661
|
//# sourceMappingURL=mesh-srpc-server.js.map
|