@zlink-systems/framework 0.24.0 → 0.26.0

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.
Files changed (215) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contracts/Channels/IZLinkFanoutClient.d.ts +0 -6
  3. package/dist/contracts/RouteMesh/RuntimeTopology.d.ts +8 -0
  4. package/dist/internal.d.ts +1 -0
  5. package/dist/internal.js +1 -0
  6. package/dist/runtime/activation-admission.d.ts +29 -0
  7. package/dist/runtime/activation-admission.js +61 -0
  8. package/dist/runtime/actors/actor-context.js +6 -6
  9. package/dist/runtime/actors/actor-handoff.d.ts +9 -3
  10. package/dist/runtime/actors/actor-handoff.js +28 -17
  11. package/dist/runtime/actors/actor-local-native-join.js +2 -18
  12. package/dist/runtime/actors/actor-remote-joiner.d.ts +2 -2
  13. package/dist/runtime/actors/actor-remote-joiner.js +6 -8
  14. package/dist/runtime/actors/actor-runtime-contracts.d.ts +4 -2
  15. package/dist/runtime/actors/actor-source-transfer.d.ts +5 -5
  16. package/dist/runtime/actors/deferred-join-completion.d.ts +14 -0
  17. package/dist/runtime/actors/deferred-join-completion.js +20 -0
  18. package/dist/runtime/actors/index.d.ts +1 -1
  19. package/dist/runtime/actors/index.js +15 -5
  20. package/dist/runtime/admission.d.ts +5 -1
  21. package/dist/runtime/admission.js +4 -0
  22. package/dist/runtime/backend/contracts/index.d.ts +2 -10
  23. package/dist/runtime/backend/mesh-actor-session-node-adapter.js +2 -9
  24. package/dist/runtime/backend/node/node-backend-adapter-factory.d.ts +1 -2
  25. package/dist/runtime/backend/node/node-backend-adapter-factory.js +4 -18
  26. package/dist/runtime/backend/node/node-backend-adapter-support.d.ts +6 -3
  27. package/dist/runtime/backend/node/node-backend-adapter-support.js +12 -28
  28. package/dist/runtime/backend/node/node-event-loop-poller.d.ts +1 -1
  29. package/dist/runtime/backend/node/node-event-loop-poller.js +8 -2
  30. package/dist/runtime/backend/node/node-raw-binding-port.d.ts +1 -1
  31. package/dist/runtime/backend/node/node-raw-binding-port.js +11 -3
  32. package/dist/runtime/backend/node/node-raw-mesh-backend.d.ts +12 -9
  33. package/dist/runtime/backend/node/node-raw-mesh-backend.js +61 -29
  34. package/dist/runtime/backend/node/node-socket-backend-adapter.js +1 -1
  35. package/dist/runtime/backend/raw-binding-port.d.ts +12 -0
  36. package/dist/runtime/channels/channel-clients.d.ts +0 -1
  37. package/dist/runtime/channels/channel-clients.js +0 -8
  38. package/dist/runtime/channels/channel-outbound-operations.js +2 -10
  39. package/dist/runtime/channels/channel-runtime-manager.d.ts +2 -5
  40. package/dist/runtime/channels/channel-runtime-manager.js +1 -12
  41. package/dist/runtime/channels/channel-socket-registry.d.ts +17 -4
  42. package/dist/runtime/channels/channel-socket-registry.js +49 -62
  43. package/dist/runtime/channels/channel-transports.d.ts +0 -3
  44. package/dist/runtime/channels/fanout-location-runtime.js +3 -9
  45. package/dist/runtime/execution/index.d.ts +18 -8
  46. package/dist/runtime/execution/index.js +55 -29
  47. package/dist/runtime/execution/serial-execution-queue.d.ts +5 -6
  48. package/dist/runtime/execution/serial-execution-queue.js +49 -15
  49. package/dist/runtime/foundation/listener-records.d.ts +11 -0
  50. package/dist/runtime/foundation/listener-records.js +20 -0
  51. package/dist/runtime/foundation/raw-service-mesh-runtime.d.ts +10 -21
  52. package/dist/runtime/foundation/raw-service-mesh-runtime.js +66 -392
  53. package/dist/runtime/foundation/service-authority-payload-codec.d.ts +1 -0
  54. package/dist/runtime/foundation/service-authority-payload-codec.js +8 -0
  55. package/dist/runtime/foundation/service-maintenance-runtime.js +23 -2
  56. package/dist/runtime/foundation/service-relocation-coordinator.d.ts +9 -0
  57. package/dist/runtime/foundation/service-relocation-coordinator.js +14 -1
  58. package/dist/runtime/foundation/service-relocation-object-owner.d.ts +8 -0
  59. package/dist/runtime/foundation/service-relocation-object-owner.js +16 -4
  60. package/dist/runtime/foundation/service-session-binding-ingress-port.d.ts +6 -13
  61. package/dist/runtime/foundation/service-stateful-runtime.d.ts +10 -7
  62. package/dist/runtime/foundation/service-stateful-runtime.js +100 -60
  63. package/dist/runtime/foundation/service-stateful-wire-codec.d.ts +9 -4
  64. package/dist/runtime/foundation/service-stateful-wire-codec.js +153 -90
  65. package/dist/runtime/foundation/service-topology-registry.d.ts +1 -2
  66. package/dist/runtime/foundation/service-topology-registry.js +6 -30
  67. package/dist/runtime/host/actor-transfer-runtime.d.ts +17 -15
  68. package/dist/runtime/host/actor-transfer-runtime.js +73 -86
  69. package/dist/runtime/host/index.d.ts +6 -2
  70. package/dist/runtime/host/index.js +63 -37
  71. package/dist/runtime/host/remote-bound-session-relay.js +4 -3
  72. package/dist/runtime/host/route-mesh-runtime.d.ts +2 -0
  73. package/dist/runtime/host/route-mesh-runtime.js +7 -5
  74. package/dist/runtime/host/service-relocation-host-runtime.d.ts +50 -8
  75. package/dist/runtime/host/service-relocation-host-runtime.js +343 -270
  76. package/dist/runtime/host/spot-runtime-options-factory.d.ts +7 -4
  77. package/dist/runtime/host/spot-runtime-options-factory.js +4 -8
  78. package/dist/runtime/host/stateful-authority-route-runtime.js +6 -2
  79. package/dist/runtime/host/user-spot-creation-coordinator.d.ts +11 -3
  80. package/dist/runtime/host/user-spot-creation-coordinator.js +85 -87
  81. package/dist/runtime/locations/in-memory-provider-location-store.js +8 -6
  82. package/dist/runtime/locations/lifecycle.d.ts +1 -1
  83. package/dist/runtime/locations/lifecycle.js +2 -2
  84. package/dist/runtime/locations/resolvers.js +7 -2
  85. package/dist/runtime/locations/spot-location-claims.d.ts +2 -2
  86. package/dist/runtime/locations/spot-location-claims.js +3 -27
  87. package/dist/runtime/protocol/service_wire_codec.generated.d.ts +1 -0
  88. package/dist/runtime/protocol/service_wire_codec.generated.js +5 -1
  89. package/dist/runtime/protocol/service_wire_pilot_codec.generated.d.ts +1 -0
  90. package/dist/runtime/protocol/service_wire_pilot_codec.generated.js +3 -2
  91. package/dist/runtime/spots/formal-remote-actor-admission-registry.d.ts +3 -3
  92. package/dist/runtime/spots/formal-remote-actor-admission-registry.js +4 -4
  93. package/dist/runtime/spots/formal-remote-actor-transfer-registry.d.ts +3 -3
  94. package/dist/runtime/spots/index.d.ts +25 -19
  95. package/dist/runtime/spots/index.js +207 -205
  96. package/dist/runtime/spots/spot-activation-registry.d.ts +4 -2
  97. package/dist/runtime/spots/spot-activation-registry.js +34 -31
  98. package/dist/runtime/spots/spot-activation-state.d.ts +2 -11
  99. package/dist/runtime/spots/spot-activation-state.js +4 -17
  100. package/dist/runtime/spots/spot-activation.d.ts +8 -6
  101. package/dist/runtime/spots/spot-activation.js +54 -49
  102. package/dist/runtime/spots/spot-actor-admission-coordinator.d.ts +1 -1
  103. package/dist/runtime/spots/spot-actor-admission-coordinator.js +1 -1
  104. package/dist/runtime/spots/spot-actor-join-dispatch.d.ts +2 -2
  105. package/dist/runtime/spots/spot-actor-join-dispatch.js +3 -5
  106. package/dist/runtime/spots/spot-actor-lifecycle-drain.js +2 -2
  107. package/dist/runtime/spots/spot-actor-membership.d.ts +4 -0
  108. package/dist/runtime/spots/spot-actor-membership.js +26 -12
  109. package/dist/runtime/spots/spot-entry-activation.d.ts +1 -2
  110. package/dist/runtime/spots/spot-entry-activation.js +0 -1
  111. package/dist/runtime/spots/spot-manager-public.js +1 -1
  112. package/dist/runtime/spots/spot-native-actor-join-admission.d.ts +1 -1
  113. package/dist/runtime/spots/spot-native-actor-join-admission.js +2 -2
  114. package/dist/runtime/spots/spot-node-runtime-manager.d.ts +5 -5
  115. package/dist/runtime/spots/spot-node-runtime-manager.js +7 -11
  116. package/dist/runtime/spots/spot-outbound.js +1 -29
  117. package/dist/runtime/spots/spot-routed-actor-admission.d.ts +1 -0
  118. package/dist/runtime/spots/spot-routed-actor-admission.js +10 -0
  119. package/dist/runtime/spots/spot-routed-frame-dispatch.d.ts +2 -6
  120. package/dist/runtime/spots/spot-routed-frame-dispatch.js +2 -70
  121. package/dist/runtime/spots/spot-runtime-ports.d.ts +3 -5
  122. package/dist/runtime/spots/spot-serial-executor.d.ts +5 -0
  123. package/dist/runtime/spots/spot-serial-executor.js +8 -1
  124. package/dist/runtime/spots/spot-serial-turn-executor.d.ts +3 -0
  125. package/dist/runtime/spots/spot-serial-turn-executor.js +8 -4
  126. package/dist/runtime/streams/actor-session-binding-registry.d.ts +13 -15
  127. package/dist/runtime/streams/actor-session-binding-registry.js +19 -171
  128. package/dist/runtime/streams/actor-session-binding-runtime-owner.d.ts +3 -4
  129. package/dist/runtime/streams/bound-session-service.js +1 -18
  130. package/dist/runtime/streams/index.d.ts +2 -0
  131. package/dist/runtime/streams/index.js +19 -19
  132. package/dist/runtime/streams/session-serial-executor.js +2 -2
  133. package/package.json +3 -3
  134. package/src/contracts/Channels/IZLinkFanoutClient.ts +0 -7
  135. package/src/contracts/RouteMesh/RuntimeTopology.ts +10 -0
  136. package/src/internal.ts +1 -0
  137. package/src/runtime/activation-admission.ts +78 -0
  138. package/src/runtime/actors/actor-context.ts +6 -6
  139. package/src/runtime/actors/actor-handoff.ts +31 -23
  140. package/src/runtime/actors/actor-local-native-join.ts +3 -42
  141. package/src/runtime/actors/actor-remote-joiner.ts +6 -25
  142. package/src/runtime/actors/actor-runtime-contracts.ts +4 -10
  143. package/src/runtime/actors/actor-source-transfer.ts +5 -18
  144. package/src/runtime/actors/deferred-join-completion.ts +40 -0
  145. package/src/runtime/actors/index.ts +22 -9
  146. package/src/runtime/admission.ts +5 -1
  147. package/src/runtime/backend/contracts/index.ts +2 -13
  148. package/src/runtime/backend/mesh-actor-session-node-adapter.ts +2 -10
  149. package/src/runtime/backend/node/node-backend-adapter-factory.ts +5 -25
  150. package/src/runtime/backend/node/node-backend-adapter-support.ts +9 -29
  151. package/src/runtime/backend/node/node-event-loop-poller.ts +14 -2
  152. package/src/runtime/backend/node/node-raw-binding-port.ts +17 -3
  153. package/src/runtime/backend/node/node-raw-mesh-backend.ts +65 -32
  154. package/src/runtime/backend/node/node-socket-backend-adapter.ts +2 -2
  155. package/src/runtime/backend/raw-binding-port.ts +13 -0
  156. package/src/runtime/channels/channel-clients.ts +0 -11
  157. package/src/runtime/channels/channel-outbound-operations.ts +3 -11
  158. package/src/runtime/channels/channel-runtime-manager.ts +4 -15
  159. package/src/runtime/channels/channel-socket-registry.ts +69 -71
  160. package/src/runtime/channels/channel-transports.ts +0 -3
  161. package/src/runtime/channels/fanout-location-runtime.ts +4 -16
  162. package/src/runtime/execution/index.ts +68 -30
  163. package/src/runtime/execution/serial-execution-queue.ts +52 -20
  164. package/src/runtime/foundation/listener-records.ts +21 -0
  165. package/src/runtime/foundation/raw-service-mesh-runtime.ts +66 -466
  166. package/src/runtime/foundation/service-authority-payload-codec.ts +10 -0
  167. package/src/runtime/foundation/service-maintenance-runtime.ts +30 -9
  168. package/src/runtime/foundation/service-relocation-coordinator.ts +13 -0
  169. package/src/runtime/foundation/service-relocation-object-owner.ts +18 -5
  170. package/src/runtime/foundation/service-session-binding-ingress-port.ts +6 -14
  171. package/src/runtime/foundation/service-stateful-runtime.ts +151 -89
  172. package/src/runtime/foundation/service-stateful-wire-codec.ts +203 -121
  173. package/src/runtime/foundation/service-topology-registry.ts +8 -48
  174. package/src/runtime/host/actor-transfer-runtime.ts +94 -166
  175. package/src/runtime/host/index.ts +119 -54
  176. package/src/runtime/host/remote-bound-session-relay.ts +4 -3
  177. package/src/runtime/host/route-mesh-runtime.ts +9 -5
  178. package/src/runtime/host/service-relocation-host-runtime.ts +495 -376
  179. package/src/runtime/host/spot-runtime-options-factory.ts +24 -13
  180. package/src/runtime/host/stateful-authority-route-runtime.ts +8 -4
  181. package/src/runtime/host/user-spot-creation-coordinator.ts +147 -142
  182. package/src/runtime/locations/in-memory-provider-location-store.ts +11 -7
  183. package/src/runtime/locations/lifecycle.ts +3 -2
  184. package/src/runtime/locations/resolvers.ts +19 -13
  185. package/src/runtime/locations/spot-location-claims.ts +5 -34
  186. package/src/runtime/protocol/service_wire_codec.generated.ts +9 -2
  187. package/src/runtime/protocol/service_wire_pilot_codec.generated.ts +4 -4
  188. package/src/runtime/spots/formal-remote-actor-admission-registry.ts +6 -6
  189. package/src/runtime/spots/formal-remote-actor-transfer-registry.ts +3 -3
  190. package/src/runtime/spots/index.ts +341 -295
  191. package/src/runtime/spots/spot-activation-registry.ts +41 -31
  192. package/src/runtime/spots/spot-activation-state.ts +4 -16
  193. package/src/runtime/spots/spot-activation.ts +102 -80
  194. package/src/runtime/spots/spot-actor-admission-coordinator.ts +2 -2
  195. package/src/runtime/spots/spot-actor-join-dispatch.ts +6 -7
  196. package/src/runtime/spots/spot-actor-lifecycle-drain.ts +20 -18
  197. package/src/runtime/spots/spot-actor-membership.ts +81 -17
  198. package/src/runtime/spots/spot-entry-activation.ts +0 -3
  199. package/src/runtime/spots/spot-manager-public.ts +8 -4
  200. package/src/runtime/spots/spot-native-actor-join-admission.ts +2 -2
  201. package/src/runtime/spots/spot-node-runtime-manager.ts +12 -18
  202. package/src/runtime/spots/spot-outbound.ts +4 -47
  203. package/src/runtime/spots/spot-routed-actor-admission.ts +20 -0
  204. package/src/runtime/spots/spot-routed-frame-dispatch.ts +6 -76
  205. package/src/runtime/spots/spot-runtime-ports.ts +6 -17
  206. package/src/runtime/spots/spot-serial-executor.ts +9 -1
  207. package/src/runtime/spots/spot-serial-turn-executor.ts +10 -4
  208. package/src/runtime/streams/actor-session-binding-registry.ts +20 -308
  209. package/src/runtime/streams/actor-session-binding-runtime-owner.ts +2 -12
  210. package/src/runtime/streams/bound-session-service.ts +2 -36
  211. package/src/runtime/streams/index.ts +29 -27
  212. package/src/runtime/streams/session-serial-executor.ts +2 -2
  213. package/dist/runtime/actors/deferred-join-accepted-journal.d.ts +0 -47
  214. package/dist/runtime/actors/deferred-join-accepted-journal.js +0 -992
  215. package/src/runtime/actors/deferred-join-accepted-journal.ts +0 -1346
@@ -1,12 +1,12 @@
1
1
  import type { RoutingId, ZLinkActor } from '../../contracts';
2
- import type { ZLinkDeferredJoinAcceptedRoot } from '../actors';
2
+ import type { ZLinkDeferredJoinCompletion } from '../actors';
3
3
  import type { ZLinkActorHandoffPacket } from '../actors/actor-handoff';
4
4
  export interface ZLinkFormalRemoteActorTransfer {
5
5
  readonly actor: ZLinkActor;
6
6
  readonly spotId: RoutingId;
7
7
  readonly transferId: string;
8
8
  readonly handoffBacklog: readonly ZLinkActorHandoffPacket[];
9
- readonly deferredJoinRoot?: ZLinkDeferredJoinAcceptedRoot;
9
+ readonly deferredJoinCompletion?: ZLinkDeferredJoinCompletion;
10
10
  readonly targetLifecycleCompleted: Promise<void>;
11
11
  readonly sourceLeaveSubmitted: Promise<boolean>;
12
12
  }
@@ -23,7 +23,7 @@ export declare class ZLinkFormalRemoteActorTransferRegistry {
23
23
  readonly spotId: RoutingId;
24
24
  readonly transferId: string;
25
25
  readonly handoffBacklog: readonly ZLinkActorHandoffPacket[];
26
- readonly deferredJoinRoot?: ZLinkDeferredJoinAcceptedRoot;
26
+ readonly deferredJoinCompletion?: ZLinkDeferredJoinCompletion;
27
27
  }): ZLinkFormalRemoteActorTransfer;
28
28
  delete(actorId: string): void;
29
29
  completeTargetLifecycle(actorId: string, transferId: string): boolean;
@@ -14,7 +14,7 @@ import { type ReadyRecord, type ReceiveRecord } from '../foundation/service-runt
14
14
  import type { ZLinkBackendSpot, ZLinkBackendSpotNode } from '../backend/contracts';
15
15
  import { ZLinkDispatchErrorReporter } from '../channels';
16
16
  import { ZLinkWorkerRuntime } from '../workers';
17
- import { type ZLinkDeferredJoinAcceptedRoot, type ZLinkRemoteBoundSessionTarget } from '../actors';
17
+ import { type ZLinkRemoteBoundSessionTarget } from '../actors';
18
18
  import type { ZLinkLocationLifecycle } from '../locations';
19
19
  import { type ZLinkActorHandoffPacket } from '../actors/actor-handoff';
20
20
  import type { CanonicalActorJoinRecovery } from '../foundation/actor-join-recovery-codec';
@@ -25,11 +25,12 @@ export { DefaultZLinkSpotOutbound, type ZLinkSpotAddressCallOptions, type ZLinkS
25
25
  import { type ZLinkSpotRoutedTransport } from './spot-outbound';
26
26
  export { DefaultZLinkSpotHandlerRegistry, type ZLinkSpotHandlerRegistration } from './spot-handler-registry';
27
27
  export { ZLinkRuntimeSpotPublisherTransport } from './spot-publisher-transport';
28
- import { type ZLinkSpotActivation } from './spot-activation-state';
28
+ import type { ZLinkSpotActivation } from './spot-activation-state';
29
29
  import { type ZLinkNativeSpotAuthority } from './spot-activation';
30
30
  import { type ZLinkActorJoinRollback } from './spot-actor-membership';
31
31
  import type { ZLinkSpotActorHandoffRuntime, ZLinkSpotActorTransferRuntime, ZLinkSpotBoundSessionRuntime } from './spot-runtime-ports';
32
32
  import type { ZLinkRuntimeAdmissionGate } from '../admission';
33
+ import type { ZLinkActivationAdmission } from '../activation-admission';
33
34
  import type { ZLinkDetachedTaskRunner } from './spot-actor-join-dispatch';
34
35
  import type { ZLinkLocalSpotCreateResult } from './spot-manager-internal-contracts';
35
36
  export type { ZLinkLocalSpotCreateResult } from './spot-manager-internal-contracts';
@@ -79,16 +80,21 @@ export interface ZLinkSpotManagerOptions {
79
80
  readonly channelMeshNameForChannel?: (channelName: string) => string | undefined;
80
81
  readonly providerResolver?: ZLinkProviderResolver;
81
82
  readonly dispatchErrors?: ZLinkDispatchErrorReporter;
83
+ readonly closeErrorSink?: import('../diagnostics/dispatch-error-port').ZLinkDispatchErrorSink;
82
84
  readonly runtimeEventPublisher?: ZLinkRuntimeEventPublisher;
83
85
  readonly workerRuntime?: ZLinkWorkerRuntime;
84
86
  readonly messageSerializers?: ReadonlyMap<string, ZLinkMessageSerializer>;
85
87
  readonly locationLifecycle?: ZLinkLocationLifecycle;
86
88
  readonly releaseInstanceAuthority?: (meshName: string, spotId: RoutingId, objectGeneration: bigint) => Promise<void>;
87
- readonly beginInstanceIdleClosingAuthority?: (meshName: string, spotId: RoutingId) => Promise<{
88
- restoreReady(): Promise<void>;
89
+ readonly beginInstanceIdleClosingAuthority?: (meshName: string, spotId: RoutingId, onCommitted: () => void) => Promise<{
90
+ release(): Promise<void>;
89
91
  } | undefined>;
90
- readonly beginInstanceClosingAuthority?: (meshName: string, spotId: RoutingId) => Promise<{
91
- restoreReady(): Promise<void>;
92
+ readonly beginInstanceClosingAuthority?: (meshName: string, spotId: RoutingId, onCommitted: () => void) => Promise<{
93
+ release(): Promise<void>;
94
+ } | undefined>;
95
+ /** Moves a local User Spot incarnation's authority to Closing for a context Close. */
96
+ readonly beginUserClosingAuthority?: (meshName: string, spotId: RoutingId, objectGeneration: bigint, onCommitted: () => void) => Promise<{
97
+ release(): Promise<void>;
92
98
  } | undefined>;
93
99
  readonly instanceSpotApplicationTargetProvider?: (meshName: string, spotId: RoutingId) => {
94
100
  readonly stableType: string;
@@ -96,7 +102,6 @@ export interface ZLinkSpotManagerOptions {
96
102
  } | undefined;
97
103
  readonly instanceSpotApplicationQuiescenceProvider?: (meshName: string, spotId: RoutingId, signal?: AbortSignal) => Promise<void>;
98
104
  readonly createNativeSpot?: (meshName: string, spotId: RoutingId, authority?: ZLinkNativeSpotAuthority) => ZLinkBackendSpot | undefined;
99
- readonly createReceived?: () => import('../backend').ZLinkBackendReceived;
100
105
  readonly createTopicMessage?: () => import('../backend').ZLinkBackendTopicMessage;
101
106
  readonly nativeSpotNodeProvider?: (meshName: string) => ZLinkBackendSpotNode | undefined;
102
107
  readonly actorResolver?: (actorId: string) => ZLinkActor | undefined;
@@ -118,8 +123,7 @@ export interface ZLinkSpotManagerOptions {
118
123
  readonly metrics?: import('../diagnostics').ZLinkRuntimeMetrics;
119
124
  readonly admission?: ZLinkRuntimeAdmissionGate;
120
125
  readonly statefulExecutionAllowed?: () => boolean;
121
- readonly activationConcurrencyLimitProvider?: (meshName: string) => number;
122
- readonly onInstanceActivationConcurrencyChanged?: (meshName: string) => void;
126
+ readonly activationAdmission?: ZLinkActivationAdmission;
123
127
  }
124
128
  export declare class DefaultZLinkSpotManager {
125
129
  private readonly options;
@@ -134,8 +138,7 @@ export declare class DefaultZLinkSpotManager {
134
138
  private readonly formalRemoteActorAdmissions;
135
139
  private readonly pendingInstanceMaterializations;
136
140
  private readonly pendingInstanceMaterializationsByPrefix;
137
- private readonly instanceActivationGates;
138
- private readonly pendingInstanceCloses;
141
+ private readonly closeOperations;
139
142
  private readonly pendingInstanceTerminals;
140
143
  private readonly pendingInstanceTerminalGenerations;
141
144
  private readonly deferredInstanceAuthorityReleases;
@@ -145,10 +148,6 @@ export declare class DefaultZLinkSpotManager {
145
148
  entrySpotIdForMesh(meshName: string): string | undefined;
146
149
  relocationActivations(meshName: string): readonly ZLinkSpotActivation[];
147
150
  activeSpotCount(meshName: string): number;
148
- instanceActivationConcurrency(meshName: string): {
149
- readonly active: number;
150
- readonly limit: number;
151
- };
152
151
  resolveRelocationActivation(meshName: string, spotId: RoutingId): ZLinkSpotActivation | undefined;
153
152
  prepareRelocationSpot(meshName: string, objectKind: 'user_spot' | 'instance_spot', stableType: string, implementation: Type<ZLinkSpot | ZLinkInstanceSpot>, spotId: RoutingId, objectGeneration: bigint, authorityOwnerGeneration: bigint, signal?: AbortSignal): Promise<ZLinkSpotActivation>;
154
153
  publishRelocationSpot(activation: ZLinkSpotActivation, beforeAdmission?: () => Promise<void>): Promise<void>;
@@ -156,10 +155,10 @@ export declare class DefaultZLinkSpotManager {
156
155
  completeRelocationSource(activation: ZLinkSpotActivation): Promise<void>;
157
156
  materializeInstance(meshName: string, instanceType: string, spotId: RoutingId, objectGeneration: bigint, signal?: AbortSignal): Promise<void>;
158
157
  private materializeInstanceCore;
159
- private acquireInstanceActivation;
160
- private releaseInstanceActivation;
161
158
  isInstanceMaterialized(meshName: string, instanceType: string, spotId: RoutingId): boolean;
162
159
  isInstanceMaterializing(meshName: string, spotId: RoutingId): boolean;
160
+ isSpotClosing(meshName: string, spotId: RoutingId): boolean;
161
+ pendingSpotCloseDecision(meshName: string, spotId: RoutingId): Promise<void> | undefined;
163
162
  isInstanceClosing(meshName: string, spotId: RoutingId): boolean;
164
163
  discardInstance(meshName: string, spotId: RoutingId): Promise<void>;
165
164
  isInstanceSpotIdleEvicting(meshName: string, spotId: RoutingId): boolean;
@@ -185,10 +184,15 @@ export declare class DefaultZLinkSpotManager {
185
184
  list(meshName: string): Promise<readonly ZLinkSpotInfo[]>;
186
185
  drainForShutdown(meshName: string, signal?: AbortSignal, deadline?: Date): Promise<void>;
187
186
  close(meshName: string, spotId: RoutingId, signal?: AbortSignal): Promise<boolean>;
187
+ closeUserWithAuthority(meshName: string, spotId: RoutingId, beginAuthority: (onCommitted: () => void) => Promise<{
188
+ release(): Promise<void>;
189
+ }>, signal?: AbortSignal): Promise<boolean>;
190
+ private closeFromContext;
188
191
  private closeWithReason;
192
+ private runCloseOperation;
193
+ private beginCloseAuthority;
189
194
  executeOnSpot<TSpot extends ZLinkSpot, TResult>(spotType: Type<TSpot>, spotId: RoutingId, operation: (spot: TSpot) => Promise<TResult> | TResult, signal?: AbortSignal): Promise<TResult>;
190
195
  hasActiveSpot(spotId: RoutingId): boolean;
191
- canCloseUserSpot(meshName: string, spotId: RoutingId): boolean;
192
196
  beginUserSpotPublication(meshName: string, spotId: RoutingId): void;
193
197
  publishUserSpot(meshName: string, spotId: RoutingId): void;
194
198
  abortUserSpotPublication(meshName: string, spotId: RoutingId): void;
@@ -224,10 +228,12 @@ export declare class DefaultZLinkSpotManager {
224
228
  private traceInstanceMessage;
225
229
  dispatchMeshActor(meshName: string, owner: ReadyRecord, record: ReceiveRecord): Promise<void>;
226
230
  dispatchMeshActorJoin(meshName: string, owner: ReadyRecord, record: ReceiveRecord): Promise<void>;
231
+ private dispatchMeshActorJoinCore;
227
232
  dispatchMeshSpotControl(meshName: string, owner: ReadyRecord, record: ReceiveRecord): Promise<void>;
233
+ private dispatchMeshSpotControlCore;
228
234
  completeFormalSourceLeaveTerminal(actorId: string, transferId: string, succeeded: boolean): Promise<boolean>;
229
235
  finalizeActorJoinRelocation(meshName: string, relocationId: string, actor: ZLinkActor, actorRef: ActorRef, submitSourceLeave: (sourceNodeRid: RoutingId) => Promise<void>, signal?: AbortSignal): Promise<boolean>;
230
- restoreCanonicalActorJoinRecovery(recovery: CanonicalActorJoinRecovery, signal?: AbortSignal, canonicalInventoryDigest?: string): Promise<ZLinkDeferredJoinAcceptedRoot | undefined>;
236
+ restoreCanonicalActorJoinRecovery(recovery: CanonicalActorJoinRecovery, signal?: AbortSignal): Promise<void>;
231
237
  private encodeMeshActorReply;
232
238
  private createActivation;
233
239
  private requireRegisteredFactory;