@voltro/plugin-rooms 0.0.0-stage → 0.88.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 (495) hide show
  1. package/CHANGELOG.md +24492 -0
  2. package/LICENSE +61 -0
  3. package/README.md +9204 -2
  4. package/SECURITY.md +56 -0
  5. package/THIRD-PARTY-NOTICES.md +12496 -0
  6. package/dist/actor.js +1473 -0
  7. package/dist/apiBinding.js +677 -0
  8. package/dist/apiRegistryBinding.js +398 -0
  9. package/dist/apiReservations.js +432 -0
  10. package/dist/baselines.js +72 -0
  11. package/dist/bots.d.ts +1485 -0
  12. package/dist/bots.js +562 -0
  13. package/dist/catalog.js +79 -0
  14. package/dist/checkpointJson.js +23 -0
  15. package/dist/checkpointStore.js +385 -0
  16. package/dist/client.js +55 -0
  17. package/dist/clockSync.js +50 -0
  18. package/dist/collision.js +155 -0
  19. package/dist/commandDelivery.js +100 -0
  20. package/dist/commandRecord.js +10 -0
  21. package/dist/commandWithdrawal.js +182 -0
  22. package/dist/connection.js +496 -0
  23. package/dist/controlCarrier.js +374 -0
  24. package/dist/controlRegistry.js +78 -0
  25. package/dist/controlTarget.js +44 -0
  26. package/dist/controlTransport.js +573 -0
  27. package/dist/developmentBinding.js +112 -0
  28. package/dist/directory.js +322 -0
  29. package/dist/directoryProjection.js +116 -0
  30. package/dist/errors.d.ts +125 -0
  31. package/dist/errors.js +52 -0
  32. package/dist/fixed.d.ts +284 -0
  33. package/dist/fixed.js +10 -0
  34. package/dist/fixed32.js +133 -0
  35. package/dist/fixedCollision.js +59 -0
  36. package/dist/fixedCollision32.js +108 -0
  37. package/dist/fixedMath.js +55 -0
  38. package/dist/fixedRaw.js +10 -0
  39. package/dist/fixedSlabs.js +33 -0
  40. package/dist/fixedTrig.js +47 -0
  41. package/dist/fixedTrig32.js +37 -0
  42. package/dist/fixedVectors.js +112 -0
  43. package/dist/fixedVectors32.js +94 -0
  44. package/dist/fixedWide.js +49 -0
  45. package/dist/fixedWords.js +45 -0
  46. package/dist/gateway.js +56 -0
  47. package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
  48. package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
  49. package/dist/geometry-worker/worker.d.mts +2 -0
  50. package/dist/geometry-worker/worker.mjs +50 -0
  51. package/dist/geometry.d.ts +2249 -0
  52. package/dist/geometry.js +40 -0
  53. package/dist/geometryActivation.js +81 -0
  54. package/dist/geometryActorInventory.js +107 -0
  55. package/dist/geometryAdminClient.js +86 -0
  56. package/dist/geometryAdminData.js +31 -0
  57. package/dist/geometryAdminFixtures.js +49 -0
  58. package/dist/geometryAdminPorts.js +4 -0
  59. package/dist/geometryAdminRpc.js +57 -0
  60. package/dist/geometryAdminRpcRoutes.js +48 -0
  61. package/dist/geometryAdminSchemas.js +38 -0
  62. package/dist/geometryAdministration.js +189 -0
  63. package/dist/geometryAdministrationPorts.js +4 -0
  64. package/dist/geometryApiBinding.js +164 -0
  65. package/dist/geometryAppStorage.js +57 -0
  66. package/dist/geometryArtifacts.js +197 -0
  67. package/dist/geometryAssetBundle.js +116 -0
  68. package/dist/geometryAssetClient.js +24 -0
  69. package/dist/geometryAssetData.js +105 -0
  70. package/dist/geometryAssetHttp.js +122 -0
  71. package/dist/geometryAssetPorts.js +4 -0
  72. package/dist/geometryAssetRpc.js +29 -0
  73. package/dist/geometryAssetRpcRoutes.js +39 -0
  74. package/dist/geometryAssetStorageGrant.js +102 -0
  75. package/dist/geometryBoxOverlap.js +109 -0
  76. package/dist/geometryCatalogueDigest.js +110 -0
  77. package/dist/geometryCellCoverage.js +84 -0
  78. package/dist/geometryCellLoader.js +27 -0
  79. package/dist/geometryChannel.js +133 -0
  80. package/dist/geometryChunkHttp.js +53 -0
  81. package/dist/geometryChunkLeases.js +21 -0
  82. package/dist/geometryClient.d.ts +1429 -0
  83. package/dist/geometryClient.js +148 -0
  84. package/dist/geometryClientChunks.js +329 -0
  85. package/dist/geometryClientDelta.js +24 -0
  86. package/dist/geometryClientHttp.js +36 -0
  87. package/dist/geometryClientInterest.js +108 -0
  88. package/dist/geometryClientStatic.js +33 -0
  89. package/dist/geometryCms.d.ts +763 -0
  90. package/dist/geometryCms.js +216 -0
  91. package/dist/geometryCommitCoordinator.js +240 -0
  92. package/dist/geometryCompactionFixture.js +83 -0
  93. package/dist/geometryCompactionStrategies.js +37 -0
  94. package/dist/geometryConnectionClient.js +22 -0
  95. package/dist/geometryDerivationFixtures.js +140 -0
  96. package/dist/geometryDerivationStrategies.js +26 -0
  97. package/dist/geometryDigest.js +12 -0
  98. package/dist/geometryEditChannel.js +69 -0
  99. package/dist/geometryEditIngress.js +262 -0
  100. package/dist/geometryEdits.js +365 -0
  101. package/dist/geometryEnvelope.js +40 -0
  102. package/dist/geometryGridRaycast.js +91 -0
  103. package/dist/geometryGridSweep.js +91 -0
  104. package/dist/geometryHeightfield.js +165 -0
  105. package/dist/geometryHeightfieldRaycast.js +73 -0
  106. package/dist/geometryHeightfieldSweep.js +84 -0
  107. package/dist/geometryHeightfieldVolume.js +44 -0
  108. package/dist/geometryHost.js +321 -0
  109. package/dist/geometryHostDirectory.js +206 -0
  110. package/dist/geometryHostMutations.js +136 -0
  111. package/dist/geometryHostStreams.js +123 -0
  112. package/dist/geometryHttpBody.js +75 -0
  113. package/dist/geometryHttpRoutes.js +111 -0
  114. package/dist/geometryImportGltf.js +299 -0
  115. package/dist/geometryImportLdtk.js +53 -0
  116. package/dist/geometryImportPng.js +143 -0
  117. package/dist/geometryImportPublication.js +66 -0
  118. package/dist/geometryImportTiled.js +38 -0
  119. package/dist/geometryImportTiles.js +135 -0
  120. package/dist/geometryImportVox.js +129 -0
  121. package/dist/geometryImportedSource.js +100 -0
  122. package/dist/geometryInspectEndpoint.js +247 -0
  123. package/dist/geometryInspection.js +91 -0
  124. package/dist/geometryInstall.js +120 -0
  125. package/dist/geometryJournalArchiveData.js +20 -0
  126. package/dist/geometryJournalArchiveIndex.js +329 -0
  127. package/dist/geometryJournalArchiveTable.js +20 -0
  128. package/dist/geometryJournalCompaction.js +99 -0
  129. package/dist/geometryJournalPatch.js +46 -0
  130. package/dist/geometryJournalRetention.js +111 -0
  131. package/dist/geometryJournalRetentionSchemas.js +35 -0
  132. package/dist/geometryJournalRetentionSweep.js +111 -0
  133. package/dist/geometryJournalRetentionWorkflow.js +27 -0
  134. package/dist/geometryJournalRetentionWorkflowData.js +30 -0
  135. package/dist/geometryJournalStorage.js +147 -0
  136. package/dist/geometryLoader.js +117 -0
  137. package/dist/geometryManifest.js +112 -0
  138. package/dist/geometryManifestChannel.js +92 -0
  139. package/dist/geometryManifestClient.js +121 -0
  140. package/dist/geometryManifestData.js +48 -0
  141. package/dist/geometryManifestPorts.js +4 -0
  142. package/dist/geometryManifestPublication.js +108 -0
  143. package/dist/geometryManifestSource.js +67 -0
  144. package/dist/geometryMigrationJournal.js +13 -0
  145. package/dist/geometryMigrationStrategies.js +6 -0
  146. package/dist/geometryMigrations.js +322 -0
  147. package/dist/geometryNativeMetadata.js +51 -0
  148. package/dist/geometryPatch.js +169 -0
  149. package/dist/geometryPersistence.js +448 -0
  150. package/dist/geometryPersistenceCapture.js +68 -0
  151. package/dist/geometryPersistenceData.js +139 -0
  152. package/dist/geometryPersistencePorts.js +4 -0
  153. package/dist/geometryPlayerAdmission.js +33 -0
  154. package/dist/geometryPlayerEditOwner.js +264 -0
  155. package/dist/geometryPlayerEdits.js +48 -0
  156. package/dist/geometryPrepared.js +187 -0
  157. package/dist/geometryPrivacyFence.js +23 -0
  158. package/dist/geometryProceduralPublication.js +90 -0
  159. package/dist/geometryProceduralWorker.js +163 -0
  160. package/dist/geometryPublication.js +109 -0
  161. package/dist/geometryRayAlgebra.js +115 -0
  162. package/dist/geometryReadClient.js +156 -0
  163. package/dist/geometryReadPorts.js +4 -0
  164. package/dist/geometryReadRpc.js +26 -0
  165. package/dist/geometryReadRpcRoutes.js +46 -0
  166. package/dist/geometryReliablePublication.js +81 -0
  167. package/dist/geometryReloadPorts.js +45 -0
  168. package/dist/geometryReloadSource.js +277 -0
  169. package/dist/geometryRenderCache.js +164 -0
  170. package/dist/geometryRenderLod.js +101 -0
  171. package/dist/geometryRollback.js +124 -0
  172. package/dist/geometryRollbackCoordinator.js +202 -0
  173. package/dist/geometryRollbackPorts.js +45 -0
  174. package/dist/geometryRollbackSource.js +208 -0
  175. package/dist/geometryRollbackStore.js +197 -0
  176. package/dist/geometrySchemas.js +26 -0
  177. package/dist/geometryServer.d.ts +2766 -0
  178. package/dist/geometryServer.js +62 -0
  179. package/dist/geometryShapeRaycast.js +110 -0
  180. package/dist/geometryShapeSegments.js +33 -0
  181. package/dist/geometryShapes.js +222 -0
  182. package/dist/geometrySnapshot.js +75 -0
  183. package/dist/geometrySnapshotChannel.js +159 -0
  184. package/dist/geometrySnapshotClient.js +158 -0
  185. package/dist/geometrySnapshotPreparation.js +75 -0
  186. package/dist/geometrySnapshotServer.js +190 -0
  187. package/dist/geometrySqlOwner.js +20 -0
  188. package/dist/geometryStorage.js +126 -0
  189. package/dist/geometryStorageGrant.js +68 -0
  190. package/dist/geometryStorageIdentity.js +8 -0
  191. package/dist/geometryTileArtifact.js +9 -0
  192. package/dist/geometryTileCodec.js +193 -0
  193. package/dist/geometryTileCollision.js +95 -0
  194. package/dist/geometryTileNavigation.js +127 -0
  195. package/dist/geometryTileView.js +34 -0
  196. package/dist/geometryVersionActivation.js +113 -0
  197. package/dist/geometryVersionClient.js +237 -0
  198. package/dist/geometryVersionCompare.js +39 -0
  199. package/dist/geometryVersionMigration.js +105 -0
  200. package/dist/geometryVoxel.js +252 -0
  201. package/dist/geometryWorldEntitySubject.js +31 -0
  202. package/dist/geometryWorldExtent.js +11 -0
  203. package/dist/geometryWorldMetadata.js +37 -0
  204. package/dist/geometryWorldStrategyFixtures.js +126 -0
  205. package/dist/geometryWorldView.js +306 -0
  206. package/dist/host.js +127 -0
  207. package/dist/hostBinding.js +276 -0
  208. package/dist/hostCellObservation.js +113 -0
  209. package/dist/hostClientCapacity.js +89 -0
  210. package/dist/hostCommandScope.js +63 -0
  211. package/dist/hostController.js +3093 -0
  212. package/dist/hostDeployment.js +64 -0
  213. package/dist/hostDrain.js +151 -0
  214. package/dist/hostDrainPorts.js +4 -0
  215. package/dist/hostDriver.js +178 -0
  216. package/dist/hostLane.js +287 -0
  217. package/dist/hostListener.js +78 -0
  218. package/dist/hostListenerBinding.js +18 -0
  219. package/dist/hostLoopObservation.js +89 -0
  220. package/dist/hostMetrics.js +55 -0
  221. package/dist/hostRegistryBinding.js +417 -0
  222. package/dist/hostSelection.js +15 -0
  223. package/dist/hostShutdown.js +46 -0
  224. package/dist/hostTurnObservation.js +52 -0
  225. package/dist/identities.js +3 -0
  226. package/dist/index.d.ts +8632 -0
  227. package/dist/index.js +231 -0
  228. package/dist/inputReceipts.js +62 -0
  229. package/dist/inputRedundancy.js +54 -0
  230. package/dist/inspect.js +237 -0
  231. package/dist/lockstep.d.ts +436 -0
  232. package/dist/lockstep.js +381 -0
  233. package/dist/lockstepAdmission.js +261 -0
  234. package/dist/lockstepAdmissionCodec.js +93 -0
  235. package/dist/lockstepAdmissionPorts.js +4 -0
  236. package/dist/lockstepClientSession.js +577 -0
  237. package/dist/lockstepDefinition.js +147 -0
  238. package/dist/lockstepHostLoop.js +242 -0
  239. package/dist/lockstepInitialAdmission.js +66 -0
  240. package/dist/lockstepInitialStrategyFixtures.js +44 -0
  241. package/dist/lockstepJournal.js +394 -0
  242. package/dist/lockstepJournalCodec.js +253 -0
  243. package/dist/lockstepJournalPorts.js +4 -0
  244. package/dist/lockstepJournalRebuild.js +207 -0
  245. package/dist/lockstepJournalRows.js +56 -0
  246. package/dist/lockstepMembers.js +130 -0
  247. package/dist/lockstepMessages.js +46 -0
  248. package/dist/lockstepOwnedRoom.js +763 -0
  249. package/dist/lockstepPolicies.js +83 -0
  250. package/dist/lockstepReact.js +46 -0
  251. package/dist/lockstepRecoveryTruth.js +120 -0
  252. package/dist/lockstepRosterConfig.js +31 -0
  253. package/dist/lockstepSeed.js +11 -0
  254. package/dist/lockstepSeedFixture.js +19 -0
  255. package/dist/lockstepServer.d.ts +3897 -0
  256. package/dist/lockstepServer.js +324 -0
  257. package/dist/lockstepServerConfig.js +100 -0
  258. package/dist/lockstepServerRoles.js +402 -0
  259. package/dist/lockstepServerStrategyFixtures.js +32 -0
  260. package/dist/lockstepStrategies.js +5 -0
  261. package/dist/lockstepStrategyFixtures.js +136 -0
  262. package/dist/lockstepTerminal.js +89 -0
  263. package/dist/lockstepTerminalPorts.js +4 -0
  264. package/dist/lockstepTransport.js +772 -0
  265. package/dist/lockstepTransportConfig.js +31 -0
  266. package/dist/lockstepWireRoster.js +33 -0
  267. package/dist/matchRoomProvider.js +31 -0
  268. package/dist/matchRooms.js +18 -0
  269. package/dist/membershipObserver.js +46 -0
  270. package/dist/moderation.js +97 -0
  271. package/dist/movementSpecials.js +103 -0
  272. package/dist/ownership.js +16 -0
  273. package/dist/ownershipWithdrawal.js +17 -0
  274. package/dist/pcg32.js +95 -0
  275. package/dist/ports.d.ts +1241 -0
  276. package/dist/ports.js +10 -0
  277. package/dist/quaternion.js +69 -0
  278. package/dist/react.d.ts +406 -0
  279. package/dist/react.js +108 -0
  280. package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
  281. package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
  282. package/dist/reaper.js +242 -0
  283. package/dist/reaperSchemas.js +41 -0
  284. package/dist/reaperWorkflow.js +69 -0
  285. package/dist/recovery.js +188 -0
  286. package/dist/recoverySeats.js +25 -0
  287. package/dist/replay.d.ts +273 -0
  288. package/dist/replay.js +484 -0
  289. package/dist/replayPorts.js +4 -0
  290. package/dist/replayRecording.js +66 -0
  291. package/dist/replaySchema.js +156 -0
  292. package/dist/replayStorage.d.ts +149 -0
  293. package/dist/replayStorage.js +484 -0
  294. package/dist/reservationBatch.js +421 -0
  295. package/dist/reservationSchemas.js +16 -0
  296. package/dist/reservations.js +258 -0
  297. package/dist/reservePort.js +68 -0
  298. package/dist/resolvedOptions.js +3 -0
  299. package/dist/room.d.ts +1006 -0
  300. package/dist/room.js +283 -0
  301. package/dist/roomAccessSweep.js +94 -0
  302. package/dist/roomAppCommandControl.js +58 -0
  303. package/dist/roomAuthoringStrategy.js +16 -0
  304. package/dist/roomErasure.js +197 -0
  305. package/dist/roomPoolRuntimeDefaults.js +23 -0
  306. package/dist/roomPoolSelection.js +18 -0
  307. package/dist/roomPoolTopology.js +211 -0
  308. package/dist/rpc.d.ts +551 -0
  309. package/dist/rpc.js +111 -0
  310. package/dist/rpcClient.js +151 -0
  311. package/dist/rpcRoutes.js +27 -0
  312. package/dist/runtime.js +1122 -0
  313. package/dist/schemaHistory.js +97 -0
  314. package/dist/seatStore.js +150 -0
  315. package/dist/seatStrategyFixtures.js +51 -0
  316. package/dist/seatSubject.js +31 -0
  317. package/dist/seats.js +129 -0
  318. package/dist/serverSession.js +810 -0
  319. package/dist/serverSessionConfig.js +42 -0
  320. package/dist/sessionAdmission.js +52 -0
  321. package/dist/sidecarAdmission.js +102 -0
  322. package/dist/sidecarConfig.js +115 -0
  323. package/dist/sidecarConfigPublication.js +63 -0
  324. package/dist/sidecarHostListener.js +207 -0
  325. package/dist/sidecarIpc.js +204 -0
  326. package/dist/sidecarPeer.js +309 -0
  327. package/dist/sidecarProcessPort.js +27 -0
  328. package/dist/sidecarRuntime.js +167 -0
  329. package/dist/sidecarSelection.js +141 -0
  330. package/dist/sidecarWire.js +177 -0
  331. package/dist/sidecarWrites.js +162 -0
  332. package/dist/simulation.d.ts +391 -0
  333. package/dist/simulation.js +281 -0
  334. package/dist/simulationAuthoring.js +28 -0
  335. package/dist/simulationBytes.js +26 -0
  336. package/dist/simulationConformance.js +304 -0
  337. package/dist/simulationInputHistoryCapture.js +34 -0
  338. package/dist/simulationInputHistoryWire.js +192 -0
  339. package/dist/simulationOptionsWire.js +77 -0
  340. package/dist/simulationRecoveryWire.js +133 -0
  341. package/dist/simulationReplay.js +126 -0
  342. package/dist/simulationSnapshotWire.js +111 -0
  343. package/dist/simulationState.js +177 -0
  344. package/dist/snapshotBlob.js +125 -0
  345. package/dist/snapshotBlobCleanup.js +92 -0
  346. package/dist/snapshotBlobIndex.js +37 -0
  347. package/dist/snapshotBudget.js +79 -0
  348. package/dist/snapshotChain.js +184 -0
  349. package/dist/snapshotErasure.js +171 -0
  350. package/dist/snapshotInspection.js +104 -0
  351. package/dist/snapshotSegmentBlobs.js +57 -0
  352. package/dist/snapshotUploads.js +165 -0
  353. package/dist/socketTransport.js +252 -0
  354. package/dist/spatial.js +103 -0
  355. package/dist/spectatorPolicy.js +25 -0
  356. package/dist/spectatorProducer.js +88 -0
  357. package/dist/startFailureCause.js +3 -0
  358. package/dist/stateCodec.js +657 -0
  359. package/dist/strategies.d.ts +210 -0
  360. package/dist/strategies.js +8 -0
  361. package/dist/strategiesServer.d.ts +286 -0
  362. package/dist/strategiesServer.js +11 -0
  363. package/dist/strategyFixtures.js +181 -0
  364. package/dist/streamFraming.js +121 -0
  365. package/dist/streamTransport.js +265 -0
  366. package/dist/subjectAdmission.js +49 -0
  367. package/dist/subjectPrivacy.js +280 -0
  368. package/dist/subjectPrivacyBinding.js +89 -0
  369. package/dist/systemManifest.js +181 -0
  370. package/dist/tables.js +158 -0
  371. package/dist/testHarness.js +88 -0
  372. package/dist/testing.d.ts +3684 -0
  373. package/dist/testing.js +220 -0
  374. package/dist/testingPorts.js +270 -0
  375. package/dist/testingServer.d.ts +4060 -0
  376. package/dist/testingServer.js +18 -0
  377. package/dist/transform.d.ts +692 -0
  378. package/dist/transform.js +216 -0
  379. package/dist/transform3d.js +117 -0
  380. package/dist/transformCollection.js +23 -0
  381. package/dist/transformCollection3d.js +23 -0
  382. package/dist/transformCollectionCore.js +155 -0
  383. package/dist/transformFrames.js +120 -0
  384. package/dist/transformPrediction3d.js +126 -0
  385. package/dist/transformRules.js +122 -0
  386. package/dist/transformSchemas.js +19 -0
  387. package/dist/transport.js +31 -0
  388. package/dist/transportAuthoring.js +28 -0
  389. package/dist/transportCleanup.js +21 -0
  390. package/dist/transportConformance.js +123 -0
  391. package/dist/transportConnector.js +81 -0
  392. package/dist/transportEndpoints.js +37 -0
  393. package/dist/transportsServer.d.ts +5515 -0
  394. package/dist/transportsServer.js +6 -0
  395. package/dist/viewProjection.js +15 -0
  396. package/dist/web.d.ts +2286 -0
  397. package/dist/web.js +517 -0
  398. package/dist/webTransportClient.js +172 -0
  399. package/dist/wire.d.ts +992 -0
  400. package/dist/wire.js +491 -0
  401. package/dist/withdrawalPort.js +27 -0
  402. package/dist/world.d.ts +1894 -0
  403. package/dist/world.js +332 -0
  404. package/dist/worldActorReceipts.js +47 -0
  405. package/dist/worldActorTransferSnapshot.js +13 -0
  406. package/dist/worldAdmissionPending.js +7 -0
  407. package/dist/worldBoundaryCoordinator.js +147 -0
  408. package/dist/worldCatalog.js +80 -0
  409. package/dist/worldCellAllocation.js +202 -0
  410. package/dist/worldCellDestination.js +67 -0
  411. package/dist/worldCells.js +488 -0
  412. package/dist/worldChange.js +31 -0
  413. package/dist/worldClient.js +663 -0
  414. package/dist/worldClientControl.js +140 -0
  415. package/dist/worldClientPendingInput.js +15 -0
  416. package/dist/worldClientRpc.js +132 -0
  417. package/dist/worldClientRpcRoutes.js +42 -0
  418. package/dist/worldClientSchemas.js +27 -0
  419. package/dist/worldCommands.js +139 -0
  420. package/dist/worldData.js +41 -0
  421. package/dist/worldDefaultBinding.js +376 -0
  422. package/dist/worldDefaultGroupAdmission.js +81 -0
  423. package/dist/worldDefaultGroupAppServices.js +30 -0
  424. package/dist/worldDefaultGroupCompensation.js +108 -0
  425. package/dist/worldDefaultGroupContinuation.js +95 -0
  426. package/dist/worldDefaultGroupControl.js +71 -0
  427. package/dist/worldDefaultGroupMembers.js +84 -0
  428. package/dist/worldDefaultGroups.js +20 -0
  429. package/dist/worldDefaultPending.js +78 -0
  430. package/dist/worldDefaultService.js +244 -0
  431. package/dist/worldEntities.js +2979 -0
  432. package/dist/worldEntityCodec.js +20 -0
  433. package/dist/worldEntityHandoffView.js +153 -0
  434. package/dist/worldGeometry.js +169 -0
  435. package/dist/worldGhostAdmission.js +64 -0
  436. package/dist/worldGhostDestination.js +117 -0
  437. package/dist/worldGhostGateway.js +131 -0
  438. package/dist/worldGhostHandshake.js +107 -0
  439. package/dist/worldGhostHost.js +41 -0
  440. package/dist/worldGhostIngress.js +131 -0
  441. package/dist/worldGhostNeighborhood.js +69 -0
  442. package/dist/worldGhostNeighbors.js +85 -0
  443. package/dist/worldGhostOutbound.js +109 -0
  444. package/dist/worldGhostPublisher.js +215 -0
  445. package/dist/worldGhostReceiver.js +212 -0
  446. package/dist/worldGhostSender.js +145 -0
  447. package/dist/worldGhostSocket.js +77 -0
  448. package/dist/worldGhostWire.js +171 -0
  449. package/dist/worldGroupCommand.js +48 -0
  450. package/dist/worldGroupDeadline.js +114 -0
  451. package/dist/worldGroupPreparation.js +114 -0
  452. package/dist/worldGroupReadyControl.js +127 -0
  453. package/dist/worldGroupSupervisor.js +119 -0
  454. package/dist/worldHandoffMetrics.js +58 -0
  455. package/dist/worldHandoffView.js +99 -0
  456. package/dist/worldHostSource.js +68 -0
  457. package/dist/worldInspectEndpoint.js +249 -0
  458. package/dist/worldInspection.js +108 -0
  459. package/dist/worldInstanceAdmission.js +30 -0
  460. package/dist/worldInstanceAllocation.js +115 -0
  461. package/dist/worldInstanceDestination.js +63 -0
  462. package/dist/worldInstanceExpiry.js +281 -0
  463. package/dist/worldInstanceExpirySupervisor.js +87 -0
  464. package/dist/worldInstanceLifecycle.js +102 -0
  465. package/dist/worldInstanceState.js +51 -0
  466. package/dist/worldInstances.js +477 -0
  467. package/dist/worldJoin.js +55 -0
  468. package/dist/worldLayers.js +150 -0
  469. package/dist/worldLeases.js +77 -0
  470. package/dist/worldManifest.js +24 -0
  471. package/dist/worldMovement.js +62 -0
  472. package/dist/worldPersistence.js +133 -0
  473. package/dist/worldProjection.js +220 -0
  474. package/dist/worldReact.js +109 -0
  475. package/dist/worldRecoveryActor.js +34 -0
  476. package/dist/worldReturnAnchor.js +48 -0
  477. package/dist/worldRoomHooks.js +56 -0
  478. package/dist/worldRoomPool.js +26 -0
  479. package/dist/worldRoomSteps.js +132 -0
  480. package/dist/worldSeatBinding.js +35 -0
  481. package/dist/worldServer.d.ts +6936 -0
  482. package/dist/worldServer.js +48 -0
  483. package/dist/worldSourceSeatPending.js +8 -0
  484. package/dist/worldStrategyFixtures.js +163 -0
  485. package/dist/worldTesting.js +26 -0
  486. package/dist/worldTransitionDefaults.js +197 -0
  487. package/dist/worldTransitionExecutor.js +518 -0
  488. package/dist/worldTransitionGroup.js +112 -0
  489. package/dist/worldTransitionPhysicalSteps.js +39 -0
  490. package/dist/worldTransitionResolver.js +227 -0
  491. package/dist/worldTransitionSeatGroup.js +63 -0
  492. package/dist/worldTransitionSeats.js +259 -0
  493. package/dist/worldTransitionState.js +94 -0
  494. package/dist/worldTransitions.js +100 -0
  495. package/package.json +189 -4
@@ -0,0 +1,810 @@
1
+ import { BudgetExceeded as e, ProtocolError as t, RoomAuthoringError as n, RoomForbidden as r } from "./errors.js";
2
+ import { decodeRoomFrame as i, encodeRoomFrame as a } from "./wire.js";
3
+ import { roomCodecs as o } from "./web.js";
4
+ import { captureRoomConsumedSeat as s } from "./inputReceipts.js";
5
+ import { WorldSourceSeatPending as c } from "./worldSourceSeatPending.js";
6
+ import { WorldAdmissionPending as l } from "./worldAdmissionPending.js";
7
+ import { RoomLockstepMemberOwner as u, isRoomLockstepMemberOwner as d } from "./lockstepMembers.js";
8
+ import { RoomBaselineRing as f } from "./baselines.js";
9
+ import { captureRoomServerSessionLimits as p } from "./serverSessionConfig.js";
10
+ import { resolveRoomSeatTokenStrategies as m, roomSeatTokenDigest as h, verifyRoomSeat as g } from "./seats.js";
11
+ import { projectRoomView as _ } from "./viewProjection.js";
12
+ import { definedOnly as v } from "./resolvedOptions.js";
13
+ import { SpectatorDelayBuffer as y } from "./replay.js";
14
+ import { captureRoomSessionAdmissionEvidence as b } from "./sessionAdmission.js";
15
+ import { Effect as x, Result as S } from "effect";
16
+ // src/serverSession.ts
17
+ var C = 250, w = /* @__PURE__ */ new WeakSet(), T = class extends AggregateError {
18
+ releaseListeners;
19
+ constructor(e, t) {
20
+ super(e, "Room Session listener acquisition failed"), this.releaseListeners = t;
21
+ }
22
+ }, E = class E {
23
+ owner;
24
+ transport;
25
+ clock;
26
+ seats;
27
+ options;
28
+ codecs;
29
+ baselines;
30
+ detach = [];
31
+ writes = /* @__PURE__ */ new Set();
32
+ maxPendingWrites;
33
+ maxFramesPerSecond;
34
+ phase = "awaitingHello";
35
+ claims = null;
36
+ credentialDigest = null;
37
+ memberJoined = !1;
38
+ welcomeDelivered = !1;
39
+ datagramsAdmitted = !1;
40
+ resync = !1;
41
+ worldNotices = /* @__PURE__ */ new Map();
42
+ worldNoticeStateFence = null;
43
+ lastSentTick = -1;
44
+ lastSentAt = -1;
45
+ repairedTick = -1;
46
+ lastAckSeq = -1;
47
+ lastAckTick = -1;
48
+ sendLevel = 0;
49
+ sendSkip = 0;
50
+ sendThrottles = 0;
51
+ deltaDatagramsSent = 0;
52
+ reportedLossPermille = null;
53
+ staleInputsDropped = 0;
54
+ closeTask = null;
55
+ closeFailure = null;
56
+ localCleanupFailures = [];
57
+ ownershipLost = !1;
58
+ drainRequested = !1;
59
+ drainTask = null;
60
+ drainSettled = !1;
61
+ deferredClose = null;
62
+ authTask = null;
63
+ terminalError = null;
64
+ frameTokens;
65
+ byteTokens;
66
+ replenishedAt;
67
+ viewDurationMs = 0;
68
+ viewOverruns = 0;
69
+ lifecycleAbort = new AbortController();
70
+ helloTimeoutMs;
71
+ authTimeoutMs;
72
+ idleTimeoutMs;
73
+ connectedAt;
74
+ lastReceivedAt;
75
+ authenticatingAt = null;
76
+ authSettled = !0;
77
+ closeSettled = !1;
78
+ seatToken;
79
+ spectatorHistory;
80
+ delayedCursor;
81
+ delayedTask = null;
82
+ authorizeWorldPlayer;
83
+ authorizeWorldTarget;
84
+ revalidateSeat;
85
+ onClientMessage;
86
+ lockstepBinding = null;
87
+ lockstepActivated = !1;
88
+ constructor(e, r, i, a, s) {
89
+ this.owner = e, this.transport = r, this.clock = i, this.seats = a, this.options = s;
90
+ let c = e;
91
+ if (e instanceof u && !d(e)) throw new t({ detail: "Lockstep membership requires the genuine constructed owner" });
92
+ if (d(e) && s.epoch !== e.epoch) throw new t({ detail: "Lockstep Session epoch must match its member owner" });
93
+ if (d(e) && s.spectatorHistory) throw new t({ detail: "Lockstep membership cannot use state spectator history" });
94
+ let l = Object.getOwnPropertyDescriptor(s, "authorizeWorldPlayer");
95
+ if (l && (!("value" in l) || typeof l.value != "function") || !l && "authorizeWorldPlayer" in s) throw new t({ detail: "World player admission requires an own callback" });
96
+ this.authorizeWorldPlayer = l?.value.bind(s);
97
+ let h = Object.getOwnPropertyDescriptor(s, "authorizeWorldTarget");
98
+ if (h && (!("value" in h) || typeof h.value != "function") || !h && "authorizeWorldTarget" in s) throw new t({ detail: "World target admission requires an own callback" });
99
+ this.authorizeWorldTarget = h?.value.bind(s);
100
+ let g = Object.getOwnPropertyDescriptor(a, "revalidate");
101
+ if (g && (!("value" in g) || typeof g.value != "function") || !g && "revalidate" in a) throw new t({ detail: "Seat revalidation requires an own actual callback" });
102
+ if (this.revalidateSeat = g?.value.bind(a), this.seatToken = m(s.seatToken), s.onClientMessage !== void 0 && typeof s.onClientMessage != "function") throw new t({ detail: "Invalid client message hook" });
103
+ if (this.onClientMessage = s.onClientMessage?.bind(s), !Number.isSafeInteger(s.epoch) || s.epoch < 0) throw new n({
104
+ room: c.id,
105
+ detail: "Room epoch must be a nonnegative safe integer"
106
+ });
107
+ let _ = p(v({
108
+ maxPendingWrites: s.maxPendingWrites,
109
+ maxFramesPerSecond: s.maxFramesPerSecond,
110
+ baselineCapacity: s.baselineCapacity,
111
+ maxBaselineAgeMs: s.maxBaselineAgeMs,
112
+ helloTimeoutMs: s.helloTimeoutMs,
113
+ authTimeoutMs: s.authTimeoutMs,
114
+ idleTimeoutMs: s.idleTimeoutMs
115
+ }), c.id);
116
+ if (this.maxPendingWrites = _.maxPendingWrites, this.maxFramesPerSecond = _.maxFramesPerSecond, this.helloTimeoutMs = _.helloTimeoutMs, this.authTimeoutMs = _.authTimeoutMs, this.idleTimeoutMs = _.idleTimeoutMs, this.connectedAt = i.now(), this.lastReceivedAt = this.connectedAt, !Number.isFinite(this.connectedAt) || this.connectedAt < 0) throw new t({ detail: "Session clock must be monotonic" });
117
+ this.codecs = o(c.descriptor);
118
+ let b = s.spectatorHistory;
119
+ if (b !== void 0) {
120
+ if (b.roomId !== c.id || b.tenantId !== c.tenantId || !(b.history instanceof y) || typeof b.authorize != "function" || b.history.schemaDescription() !== this.codecs.state.schemaDescription()) throw new t({ detail: "Delayed spectator history requires the exact room, tenant, layout and group admission" });
121
+ this.spectatorHistory = Object.freeze({
122
+ delivery: b.history.delivery.bind(b.history),
123
+ authorize: b.authorize.bind(b),
124
+ delayMs: b.history.limits.delayMs
125
+ });
126
+ }
127
+ this.frameTokens = c.descriptor.budgets.burst, this.byteTokens = c.descriptor.budgets.bytesPerSecond, this.replenishedAt = i.now(), this.baselines = new f(_.baselineCapacity, _.maxBaselineAgeMs);
128
+ let x = !1, S = (e, n = !1) => {
129
+ if (!x) throw new t({ detail: "Native listeners cannot deliver before Session acquisition completes" });
130
+ this.receive(e, n);
131
+ };
132
+ try {
133
+ this.detach.push(r.reliable.onFrame((e) => S(e))), r.unreliable && this.detach.push(r.unreliable.onFrame((e) => S(e, !0)));
134
+ let e = () => {
135
+ this.backgroundClose("reconnecting");
136
+ };
137
+ r.signal.addEventListener("abort", e, { once: !0 }), this.detach.push(() => r.signal.removeEventListener("abort", e)), x = !0, r.signal.aborted && e();
138
+ } catch (e) {
139
+ this.phase = "closed", this.lifecycleAbort.abort();
140
+ let t = [e], n = /* @__PURE__ */ new Set();
141
+ for (let e of this.detach.splice(0)) try {
142
+ e();
143
+ } catch (r) {
144
+ t.push(r), n.add(e);
145
+ }
146
+ throw this.worldNotices.clear(), this.worldNoticeStateFence = null, this.baselines.release(), new T(t, () => {
147
+ let e = [];
148
+ for (let t of n) try {
149
+ t(), n.delete(t);
150
+ } catch (t) {
151
+ e.push(t);
152
+ }
153
+ if (e.length) throw AggregateError(e, "Room Session listener release remains incomplete");
154
+ });
155
+ }
156
+ w.add(this);
157
+ }
158
+ get actor() {
159
+ if (d(this.owner)) throw new t({ detail: "Lockstep membership owns no state actor" });
160
+ return this.owner;
161
+ }
162
+ get membershipMode() {
163
+ return d(this.owner) ? "lockstep" : "state-sync";
164
+ }
165
+ get status() {
166
+ return this.phase;
167
+ }
168
+ get failure() {
169
+ return this.terminalError;
170
+ }
171
+ teardownReady() {
172
+ return this.phase === "closed" && this.authSettled && this.closeSettled && this.writes.size === 0 && this.delayedTask === null;
173
+ }
174
+ admitFirstFrame(e) {
175
+ if (this.phase !== "awaitingHello") throw new t({ detail: "Room first frame has already been admitted" });
176
+ this.receive(Uint8Array.from(e));
177
+ }
178
+ maintenance() {
179
+ if (this.phase === "closed" || this.drainRequested) return;
180
+ let e = this.clock.now();
181
+ !Number.isFinite(e) || e < this.lastReceivedAt || e < this.connectedAt ? (this.terminalError = new t({ detail: "Session clock must be monotonic" }), this.backgroundClose("kicked")) : (this.phase === "awaitingHello" ? e - this.connectedAt >= this.helloTimeoutMs : this.phase === "authenticating" ? this.authenticatingAt !== null && e - this.authenticatingAt >= this.authTimeoutMs : e - this.lastReceivedAt >= this.idleTimeoutMs) && (this.terminalError = new t({ detail: "Room session deadline expired" }), this.backgroundClose("timeout"));
182
+ }
183
+ metrics() {
184
+ return {
185
+ viewDurationMs: this.viewDurationMs,
186
+ viewOverruns: this.viewOverruns,
187
+ pendingWrites: this.writes.size
188
+ };
189
+ }
190
+ snapshot() {
191
+ let e = this.actor.lastGoodSnapshot(), n = this.actor.descriptor.view;
192
+ if (!this.claims) return e;
193
+ let r = this.clock.now(), i = _(this.actor.descriptor.state, n, {
194
+ state: e.state,
195
+ tick: e.tick,
196
+ role: this.claims.role,
197
+ client: Object.freeze({
198
+ sessionId: this.claims.sessionId,
199
+ subjectId: this.claims.subjectId,
200
+ tenantId: this.claims.tenantId
201
+ })
202
+ }), a = this.clock.now() - r;
203
+ if (!Number.isFinite(a) || a < 0) throw new t({ detail: "Room view clock must be monotonic" });
204
+ return this.viewDurationMs += a, a > this.actor.descriptor.viewBudgetMs && this.viewOverruns++, {
205
+ tick: e.tick,
206
+ state: i
207
+ };
208
+ }
209
+ async write(e) {
210
+ let t = a(e);
211
+ if (S.isFailure(t)) throw t.failure;
212
+ return this.writeEncoded(t.success);
213
+ }
214
+ async writeEncoded(n) {
215
+ if (this.phase === "closed" || this.transport.signal.aborted) throw new t({ detail: "Room transport is closed" });
216
+ if (this.writes.size >= this.maxPendingWrites) throw new e({
217
+ budget: "pendingRoomWrites",
218
+ limit: this.maxPendingWrites
219
+ });
220
+ let r = this.transport.reliable.send(n);
221
+ this.writes.add(r);
222
+ try {
223
+ await r;
224
+ } finally {
225
+ this.writes.delete(r);
226
+ }
227
+ }
228
+ send(e) {
229
+ if (this.datagramsAdmitted && this.transport.unreliable && (e.kind === "Delta" || e.kind === "InputAck" || e.kind === "Pong" || e.kind === "ServerMessage" && this.codecs.channels[e.channelId]?.reliable === !1)) try {
230
+ let t = a(e);
231
+ if (S.isFailure(t)) throw t.failure;
232
+ if (t.success.byteLength <= this.transport.unreliable.maxDatagramBytes) {
233
+ this.transport.unreliable.send(t.success), e.kind === "Delta" && this.deltaDatagramsSent++;
234
+ return;
235
+ }
236
+ } catch (e) {
237
+ this.terminalError = e, this.backgroundClose("kicked");
238
+ return;
239
+ }
240
+ this.write(e).catch((e) => {
241
+ this.terminalError = e, this.backgroundClose("kicked");
242
+ });
243
+ }
244
+ backgroundClose(e) {
245
+ this.close(e).catch((e) => {
246
+ this.terminalError = e;
247
+ });
248
+ }
249
+ async authenticate(e) {
250
+ try {
251
+ if (e.protocolVersion !== 1 || e.schemaHash !== this.codecs.schemaHash || !(e.transportCaps & 1) || e.transportCaps & -4) throw new t({ detail: "Room protocol or schema manifest mismatch" });
252
+ this.datagramsAdmitted = !!(e.transportCaps & 2) && this.transport.unreliable !== void 0;
253
+ let n = g(e.token, this.options.secrets, this.options.epochNow(), {
254
+ roomId: this.owner.id,
255
+ tenantId: this.owner.tenantId,
256
+ epoch: this.options.epoch
257
+ }, this.seatToken.verify);
258
+ if (n.subjectId === null && this.owner.descriptor.auth !== "public") throw new r({ roomId: this.owner.id });
259
+ if (this.membershipMode === "lockstep" && (n.role !== "player" || n.subjectId === null || e.resumeFromTick !== void 0)) throw new t({ detail: "Lockstep membership requires a current Subject player and explicit initial admission" });
260
+ let a = h(e.token), o = await x.runPromise(this.seats.consume(n, a));
261
+ this.claims = n, this.credentialDigest = a;
262
+ let c = s(o);
263
+ if (c.worldTarget && (!this.authorizeWorldTarget || this.membershipMode !== "state-sync" || n.role !== "player")) throw new t({ detail: "World target Seat requires transition-aware player Host admission" });
264
+ if (this.status === "closed" || this.transport.signal.aborted) {
265
+ this.ownershipLost || await x.runPromise(this.seats.disconnect(n, "reconnecting", a));
266
+ return;
267
+ }
268
+ let l = n.role === "spectator" ? this.spectatorHistory : void 0, f;
269
+ if (l) {
270
+ let e = l.authorize(Object.freeze({ ...n }));
271
+ if (!x.isEffect(e)) throw new t({ detail: "Spectator group admission must return an Effect" });
272
+ if (await x.runPromise(e, { signal: this.lifecycleAbort.signal }), this.status === "closed" || this.transport.signal.aborted) return;
273
+ let r = l.delivery(Math.floor(this.clock.now()));
274
+ if (S.isFailure(r)) throw r.failure;
275
+ if (r.success.kind !== "full") throw new t({ detail: "Delayed spectator history is not yet available" });
276
+ let a = i(r.success.bytes);
277
+ if (S.isFailure(a)) throw a.failure;
278
+ if (a.success.kind !== "Full" || a.success.tick !== r.success.cursor.tick || a.success.epoch !== r.success.cursor.epoch || a.success.epoch > this.options.epoch) throw new t({ detail: "Delayed Welcome has invalid state authority" });
279
+ f = a.success, this.delayedCursor = r.success.cursor;
280
+ }
281
+ let p = {
282
+ sessionId: n.sessionId,
283
+ subjectId: n.subjectId,
284
+ tenantId: n.tenantId,
285
+ ...n.attributes === void 0 ? {} : { attributes: n.attributes },
286
+ send: (e, n) => {
287
+ let r = this.codecs.channels.findIndex((t) => t.name === e), i = this.codecs.channels[r];
288
+ if (!i || i.direction === "client") throw new t({ detail: "Channel is not server-sendable" });
289
+ let a = i.codec.full(n);
290
+ if (S.isFailure(a)) throw a.failure;
291
+ this.send({
292
+ kind: "ServerMessage",
293
+ channelId: r,
294
+ payload: a.success
295
+ });
296
+ },
297
+ kick: (e) => {
298
+ this.write({
299
+ kind: "Kick",
300
+ code: 1,
301
+ reason: e
302
+ }).then(() => this.close("kicked")).catch((e) => {
303
+ this.terminalError = e, this.backgroundClose("kicked");
304
+ });
305
+ }
306
+ }, m = this.revalidateSeat ? async () => {
307
+ let e = this.revalidateSeat(n, a);
308
+ if (!x.isEffect(e)) throw new t({ detail: "Seat revalidation requires actual Effect" });
309
+ let r = await x.runPromise(x.result(e), { signal: this.lifecycleAbort.signal });
310
+ if (S.isFailure(r)) throw r.failure;
311
+ } : void 0;
312
+ if (c.worldTarget) {
313
+ let e = c.worldTarget;
314
+ await this.actor.joinWorldReservedAsync(p, c, async () => {
315
+ m && await m();
316
+ let r = this.authorizeWorldTarget(n, e, a);
317
+ if (!x.isEffect(r)) throw new t({ detail: "World target admission requires an actual Effect" });
318
+ let i = await x.runPromise(r, { signal: this.lifecycleAbort.signal });
319
+ if (i !== "pending" && i !== "committed" && i !== "settled") throw new t({ detail: "World admission returned an invalid activation phase" });
320
+ return i;
321
+ }, this.lifecycleAbort.signal);
322
+ } else this.membershipMode === "state-sync" ? await this.actor.joinReservedAsync(p, c, this.lifecycleAbort.signal, async () => {
323
+ if (m && await m(), this.authorizeWorldPlayer && n.role === "player") {
324
+ let e = this.authorizeWorldPlayer(n);
325
+ if (!x.isEffect(e)) throw new t({ detail: "World player admission requires an actual Effect" });
326
+ return await x.runPromise(e, { signal: this.lifecycleAbort.signal });
327
+ }
328
+ }) : await this.owner.joinReservedAsync(p, c, this.lifecycleAbort.signal);
329
+ if (this.memberJoined = !0, this.status === "closed" || this.transport.signal.aborted) {
330
+ try {
331
+ await this.owner.leaveAsync(n.sessionId, "reconnecting"), this.memberJoined = !1;
332
+ } catch (e) {
333
+ throw this.localCleanupFailures.push(e), e;
334
+ }
335
+ return;
336
+ }
337
+ if (d(this.owner) && !u.prototype.isCurrent.call(this.owner, n.sessionId, n.subjectId)) throw new t({ detail: "Lockstep member was withdrawn before Welcome publication" });
338
+ let _, v, y;
339
+ if (this.membershipMode === "lockstep") _ = 0, v = this.options.epoch, y = /* @__PURE__ */ new Uint8Array();
340
+ else if (f) _ = f.tick, v = f.epoch, y = f.baseline;
341
+ else {
342
+ let e = this.snapshot(), t = this.codecs.state.full(e.state);
343
+ if (S.isFailure(t)) throw t.failure;
344
+ this.baselines.record({
345
+ tick: e.tick,
346
+ epoch: this.options.epoch,
347
+ state: e.state
348
+ }), _ = e.tick, v = this.options.epoch, y = t.success;
349
+ }
350
+ this.lastSentTick = _, this.phase = "joined", await this.write({
351
+ kind: "Welcome",
352
+ sessionId: n.sessionId,
353
+ tick: _,
354
+ epoch: v,
355
+ serverTimeMs: this.observerNow(),
356
+ baseline: y,
357
+ transformRules: this.codecs.transformRules
358
+ }), this.welcomeDelivered = !0;
359
+ let b = this.membershipMode === "lockstep" ? -1 : this.actor.lastAppliedInputSeq(n.sessionId);
360
+ n.role === "player" && e.resumeFromTick !== void 0 && b >= 0 && (this.lastAckSeq = b, this.lastAckTick = _, await this.write({
361
+ kind: "InputAck",
362
+ lastAppliedSeq: b,
363
+ tick: _,
364
+ flags: 0
365
+ }));
366
+ } catch (e) {
367
+ this.terminalError = e, this.drainRequested || await this.close(e instanceof l || e instanceof c ? "reconnecting" : "kicked");
368
+ }
369
+ }
370
+ receive(a, o = !1) {
371
+ if (!(this.phase === "closed" || this.drainRequested)) try {
372
+ let s = this.clock.now(), c = this.owner.descriptor.budgets;
373
+ if (!Number.isFinite(s) || s < this.replenishedAt) throw new t({ detail: "Room transport clock must be monotonic" });
374
+ let l = (s - this.replenishedAt) / 1e3;
375
+ if (this.frameTokens = Math.min(c.burst, this.frameTokens + l * this.maxFramesPerSecond), this.byteTokens = Math.min(c.bytesPerSecond, this.byteTokens + l * c.bytesPerSecond), this.replenishedAt = s, this.frameTokens < 1 || this.byteTokens < a.byteLength) throw new e({
376
+ budget: "roomIncomingFrames",
377
+ limit: this.maxFramesPerSecond
378
+ });
379
+ this.frameTokens--, this.byteTokens -= a.byteLength;
380
+ let u = i(a);
381
+ if (S.isFailure(u)) throw u.failure;
382
+ let d = u.success;
383
+ if (this.lastReceivedAt = s, o && (!this.datagramsAdmitted || d.kind !== "Input" && d.kind !== "Ack" && !(this.lockstepActivated && d.kind === "LsInput") && (d.kind !== "ClientMessage" || this.codecs.channels[d.channelId]?.reliable !== !1))) throw new t({ detail: "Room control and reliable message frames require the admitted reliable lane" });
384
+ if (this.phase === "awaitingHello") {
385
+ if (d.kind !== "Hello") throw new t({ detail: "Hello must be the first room frame" });
386
+ this.phase = "authenticating", this.authenticatingAt = s, this.authSettled = !1, this.authTask = this.authenticate(d).finally(() => {
387
+ this.authSettled = !0;
388
+ }), this.authTask.catch((e) => {
389
+ this.terminalError = e;
390
+ });
391
+ return;
392
+ }
393
+ if (this.phase !== "joined" || !this.claims) throw new t({ detail: "Room admission is not complete" });
394
+ if (this.membershipMode === "lockstep" && !this.lockstepActivated && d.kind !== "Ping" && d.kind !== "Leave") throw new t({ detail: "Lockstep member cannot receive game frames before actual roster activation" });
395
+ if (this.lockstepActivated) {
396
+ if (!this.lockstepBinding || E.prototype.admittedIdentity.call(this) === null) throw new t({ detail: "Lockstep session ownership has been withdrawn" });
397
+ if (d.kind === "LsInput" || d.kind === "LsHash") {
398
+ if (this.lockstepBinding.receive(d) !== void 0) throw new t({ detail: "Lockstep intent delivery must be synchronous" });
399
+ return;
400
+ }
401
+ if (d.kind === "Input" || d.kind === "Ack") throw new t({ detail: "State-sync input and baseline acknowledgements cannot enter an activated lockstep session" });
402
+ }
403
+ switch (d.kind) {
404
+ case "Input":
405
+ if (this.claims.role !== "player") throw new r({ roomId: this.owner.id });
406
+ d.ackTick !== void 0 && this.acknowledgeBaseline(d.ackTick);
407
+ for (let e = 0; e < d.inputs.length; e++) {
408
+ let n = d.inputs[e];
409
+ if (!n) throw new t({ detail: "Missing batched input" });
410
+ let r = this.codecs.input.decodeFull(n.payload);
411
+ if (S.isFailure(r)) throw r.failure;
412
+ this.staleInput(n.tickHint) ? this.staleInputsDropped++ : this.actor.input(this.claims.sessionId, d.firstSeq + e, n.tickHint, r.success, n.payload.byteLength);
413
+ }
414
+ return;
415
+ case "Ack":
416
+ this.acknowledgeBaseline(d.tick), d.lossPermille !== void 0 && this.datagramsAdmitted && (this.reportedLossPermille = d.lossPermille);
417
+ return;
418
+ case "Ping":
419
+ this.send({
420
+ kind: "Pong",
421
+ clientTimeMs: d.clientTimeMs,
422
+ serverTimeMs: this.observerNow(),
423
+ tick: this.lockstepBinding ? this.lockstepBinding.tick() : this.claims.role === "spectator" && this.spectatorHistory ? this.lastSentTick : this.membershipMode === "lockstep" ? 0 : this.actor.lastGoodSnapshot().tick,
424
+ ...this.datagramsAdmitted ? { deltaDatagramsSent: this.deltaDatagramsSent } : {}
425
+ });
426
+ return;
427
+ case "Leave":
428
+ this.backgroundClose("left");
429
+ return;
430
+ case "ClientMessage": {
431
+ let e = this.codecs.channels[d.channelId];
432
+ if (!e || e.direction === "server" || !this.onClientMessage) throw new t({ detail: "Channel is not client-receivable" });
433
+ if (this.claims.role === "spectator" && e.name !== "spectators") throw new r({ roomId: this.owner.id });
434
+ let i = e.codec.decodeFull(d.payload);
435
+ if (S.isFailure(i)) throw i.failure;
436
+ if (this.membershipMode === "state-sync" && (this.actor.isWorldPending(this.claims.sessionId) || this.actor.isWorldFinalizationHeld())) return;
437
+ if (this.onClientMessage(e.name, i.success, this.claims) !== void 0) throw new n({
438
+ room: this.owner.id,
439
+ detail: "Client message hooks must be synchronous"
440
+ });
441
+ return;
442
+ }
443
+ default: throw new t({ detail: "Client sent a server-only or duplicate admission frame" });
444
+ }
445
+ } catch (e) {
446
+ this.terminalError = e, this.backgroundClose("kicked");
447
+ }
448
+ }
449
+ acknowledgeBaseline(e) {
450
+ this.claims?.role === "spectator" && this.spectatorHistory ? e !== this.lastSentTick && (this.resync = !0) : this.baselines.acknowledge(e, this.clock.now()) ? (e < this.lastSentTick && (this.resync = !0), this.worldNoticeStateFence !== null && e > this.worldNoticeStateFence && (this.worldNoticeStateFence = null)) : this.resync = !0;
451
+ }
452
+ repairUnacknowledgedState(e, t) {
453
+ if (!this.datagramsAdmitted || !this.transport.unreliable || this.repairedTick === e.tick || this.lastSentAt < 0) return;
454
+ let n = this.clock.now();
455
+ if (n - this.lastSentAt < C) return;
456
+ let r = this.baselines.current(n);
457
+ if (r === null || r.tick >= e.tick) return;
458
+ let i = this.codecs.state.delta(e.state, r.state, t >= 0);
459
+ if (S.isFailure(i)) {
460
+ this.terminalError = i.failure, this.backgroundClose("kicked");
461
+ return;
462
+ }
463
+ if (this.repairedTick = e.tick, i.success === null) return;
464
+ let a = {
465
+ kind: "Delta",
466
+ tick: e.tick,
467
+ baseTick: r.tick,
468
+ patch: i.success,
469
+ ...t >= 0 ? { inputAck: {
470
+ lastAppliedSeq: t,
471
+ flags: 1
472
+ } } : {}
473
+ };
474
+ this.write(a).catch((e) => {
475
+ this.terminalError = e, this.backgroundClose("kicked");
476
+ });
477
+ }
478
+ publishState() {
479
+ if (this.lockstepActivated || this.membershipMode === "lockstep" || this.drainRequested || this.actor.isWorldFinalizationHeld() || this.phase !== "joined" || !this.claims) return;
480
+ if (this.claims.role === "spectator" && this.spectatorHistory) {
481
+ this.publishDelayedState();
482
+ return;
483
+ }
484
+ if (this.backpressured()) return;
485
+ let e;
486
+ try {
487
+ e = this.snapshot();
488
+ } catch (e) {
489
+ this.terminalError = e, this.backgroundClose("kicked");
490
+ return;
491
+ }
492
+ let t = this.actor.lastAppliedInputSeq(this.claims.sessionId), n = t > this.lastAckSeq;
493
+ if (e.tick === this.lastSentTick && !this.resync) {
494
+ n && (this.lastAckSeq = t, this.lastAckTick = e.tick, this.send({
495
+ kind: "InputAck",
496
+ lastAppliedSeq: t,
497
+ tick: e.tick,
498
+ flags: 0
499
+ })), this.repairUnacknowledgedState(e, t);
500
+ return;
501
+ }
502
+ let r = this.resync || this.worldNoticeStateFence !== null ? null : this.baselines.current(this.clock.now()), i = this.lastAckTick >= 0 && (r === null || r.tick < this.lastAckTick), a = t >= 0 && (n || i || this.resync), o;
503
+ if (r && r.tick < e.tick) {
504
+ let t = this.codecs.state.delta(e.state, r.state, a);
505
+ if (S.isFailure(t)) {
506
+ this.terminalError = t.failure, this.backgroundClose("kicked");
507
+ return;
508
+ }
509
+ if (t.success !== null) o = {
510
+ kind: "Delta",
511
+ tick: e.tick,
512
+ baseTick: r.tick,
513
+ patch: t.success
514
+ };
515
+ else return;
516
+ } else {
517
+ let t = this.codecs.state.full(e.state);
518
+ if (S.isFailure(t)) {
519
+ this.terminalError = t.failure, this.backgroundClose("kicked");
520
+ return;
521
+ }
522
+ o = {
523
+ kind: "Full",
524
+ tick: e.tick,
525
+ epoch: this.options.epoch,
526
+ baseline: t.success
527
+ };
528
+ }
529
+ n && (this.lastAckSeq = t, this.lastAckTick = e.tick), a && (o = {
530
+ ...o,
531
+ inputAck: {
532
+ lastAppliedSeq: t,
533
+ flags: +(o.kind === "Delta")
534
+ }
535
+ }), a && o.kind === "Delta" && this.send({
536
+ kind: "InputAck",
537
+ lastAppliedSeq: t,
538
+ tick: e.tick,
539
+ flags: 1
540
+ }), this.send(o), a && o.kind === "Full" && this.send({
541
+ kind: "InputAck",
542
+ lastAppliedSeq: t,
543
+ tick: e.tick,
544
+ flags: 0
545
+ }), e.tick > this.lastSentTick && this.baselines.record({
546
+ tick: e.tick,
547
+ epoch: this.options.epoch,
548
+ state: e.state
549
+ }), this.lastSentTick = e.tick, this.lastSentAt = this.clock.now(), this.resync = !1;
550
+ }
551
+ backpressured() {
552
+ if (this.sendSkip > 0) return this.sendSkip--, !0;
553
+ let { budgets: e, sendRate: t } = this.actor.descriptor, n = e.bytesPerSecond / t * 4, r = this.transport.stats().queuedBytes, i = this.reportedLossPermille ?? 0, a = i >= 100;
554
+ return r > n && this.sendLevel < 3 || a && this.sendLevel < 2 ? (this.sendLevel++, this.sendThrottles++) : r <= n / 2 && i < 50 && this.sendLevel > 0 && this.sendLevel--, this.sendSkip = (1 << this.sendLevel) - 1, !1;
555
+ }
556
+ staleInput(e) {
557
+ let { budgets: t, tickRate: n } = this.actor.descriptor, r = this.datagramsAdmitted && this.transport.unreliable ? this.baselines.acknowledgedTick() ?? -1 : this.lastSentTick;
558
+ return r >= 0 && e < r && (r - e) * 1e3 / n > t.inputLatencyBudgetMs;
559
+ }
560
+ staleInputs() {
561
+ return this.staleInputsDropped;
562
+ }
563
+ sendThrottle() {
564
+ return {
565
+ level: this.sendLevel,
566
+ throttles: this.sendThrottles
567
+ };
568
+ }
569
+ reportedLoss() {
570
+ return this.reportedLossPermille;
571
+ }
572
+ get id() {
573
+ return this.claims?.sessionId ?? null;
574
+ }
575
+ canSendLockstepMessages() {
576
+ return this.membershipMode === "lockstep" && this.lockstepActivated && this.lockstepBinding !== null && E.prototype.admittedIdentity.call(this) !== null;
577
+ }
578
+ async sendLockstepMessage(e) {
579
+ if (e.kind !== "ServerMessage" || !E.prototype.canSendLockstepMessages.call(this)) throw new t({ detail: "Lockstep messages need the same current activated native Session" });
580
+ let n = this.codecs.channels[e.channelId];
581
+ if (!n || n.direction === "client") throw new t({ detail: "Channel is not server-sendable" });
582
+ let r = n.codec.decodeFull(e.payload);
583
+ if (S.isFailure(r)) throw r.failure;
584
+ let i = a(e);
585
+ if (S.isFailure(i)) throw i.failure;
586
+ !n.reliable && this.datagramsAdmitted && this.transport.unreliable && i.success.byteLength <= this.transport.unreliable.maxDatagramBytes ? this.transport.unreliable.send(i.success) : n.reliable ? await E.prototype.writeReliableChannel.call(this, n.name, r.success, n.codec.schemaHash) : await this.writeEncoded(i.success);
587
+ }
588
+ async writeReliableChannel(e, n, r) {
589
+ let i = E.prototype.admittedIdentity.call(this), o = this.codecs.channels.find((t) => t.name === e);
590
+ if (!i || !o || !o.reliable || o.direction === "client" || o.codec.schemaHash !== r) throw new t({ detail: "Reliable channel delivery requires its exact current native player Session and layout" });
591
+ let s = o.codec.full(n);
592
+ if (S.isFailure(s)) throw s.failure;
593
+ let c = a({
594
+ kind: "ServerMessage",
595
+ channelId: this.codecs.channels.indexOf(o),
596
+ payload: s.success
597
+ });
598
+ if (S.isFailure(c)) throw c.failure;
599
+ if (await this.writeEncoded(c.success), JSON.stringify(E.prototype.admittedIdentity.call(this)) !== JSON.stringify(i)) throw new t({ detail: "Reliable native Session changed before delivery confirmation" });
600
+ }
601
+ async kick(e) {
602
+ if (this.phase === "closed") return this.close("kicked");
603
+ try {
604
+ await this.write({
605
+ kind: "Kick",
606
+ code: 1,
607
+ reason: e
608
+ });
609
+ } catch (e) {
610
+ this.terminalError = e;
611
+ }
612
+ await this.close("kicked");
613
+ }
614
+ admittedIdentity() {
615
+ return d(this.owner) && !u.prototype.isCurrent.call(this.owner, this.claims?.sessionId ?? "", this.claims?.subjectId ?? null) || this.phase !== "joined" || !this.authSettled || !this.memberJoined || !this.welcomeDelivered || this.closeTask !== null || this.ownershipLost || this.terminalError !== null || this.lifecycleAbort.signal.aborted || !this.claims || this.claims.role !== "player" || this.claims.subjectId === null || this.credentialDigest === null || this.claims.roomId !== this.owner.id || this.claims.tenantId !== this.owner.tenantId || this.claims.epoch !== this.owner.epoch ? null : b({
616
+ tenantId: this.claims.tenantId,
617
+ subjectId: this.claims.subjectId,
618
+ roomId: this.owner.id,
619
+ sessionId: this.claims.sessionId,
620
+ epoch: this.claims.epoch,
621
+ role: "player",
622
+ nonce: this.claims.nonce,
623
+ credentialDigest: this.credentialDigest
624
+ });
625
+ }
626
+ admittedInputSchemaHash() {
627
+ return E.prototype.admittedIdentity.call(this) === null ? null : this.codecs.input.schemaHash;
628
+ }
629
+ installLockstep(e) {
630
+ if (!this.canInstallLockstep() || this.spectatorHistory || typeof e.receive != "function" || typeof e.tick != "function") throw new t({ detail: "Lockstep binding needs the current welcomed player exactly once" });
631
+ return d(this.owner) && u.prototype.seal.call(this.owner), this.lockstepBinding = Object.freeze({
632
+ receive: e.receive,
633
+ tick: e.tick
634
+ }), this.lockstepActivated = !0, this.worldNotices.clear(), this.worldNoticeStateFence = null, this.baselines.release(), this.lockstepBinding;
635
+ }
636
+ canInstallLockstep() {
637
+ return !this.lockstepActivated && !this.spectatorHistory && E.prototype.admittedIdentity.call(this) !== null;
638
+ }
639
+ async writeLockstep(e, n) {
640
+ if (!this.lockstepBinding || this.lockstepBinding !== n || E.prototype.admittedIdentity.call(this) === null) throw new t({ detail: "Lockstep delivery requires the same live welcomed player" });
641
+ if (e.kind !== "LsStart" && e.kind !== "LsInputs" && e.kind !== "LsStall" && e.kind !== "LsDesync" && e.kind !== "LsJoin") throw new t({ detail: "Invalid server lockstep delivery" });
642
+ await this.write(e);
643
+ }
644
+ withdrawLockstep(e) {
645
+ this.lockstepBinding === e && (this.lockstepBinding = null);
646
+ }
647
+ observerNow() {
648
+ let e = Math.floor(this.clock.now());
649
+ if (!Number.isSafeInteger(e) || e < 0) throw new t({ detail: "Invalid observer clock" });
650
+ return this.claims?.role === "spectator" && this.spectatorHistory ? Math.max(0, e - this.spectatorHistory.delayMs) : e;
651
+ }
652
+ publishDelayedState() {
653
+ if (!this.spectatorHistory || this.delayedTask) return;
654
+ let e, n;
655
+ try {
656
+ let r = this.spectatorHistory.delivery(Math.floor(this.clock.now()), this.resync ? void 0 : this.delayedCursor);
657
+ if (S.isFailure(r)) throw r.failure;
658
+ if (r.success.kind === "unavailable" || r.success.kind === "unchanged") return;
659
+ if (n = r.success.cursor, n.epoch > this.options.epoch) throw new t({ detail: "Delayed state exceeds the admitted SQL epoch" });
660
+ e = r.success.kind === "full" ? [r.success.bytes] : r.success.frames.map((e) => e.bytes), this.resync = !1;
661
+ } catch (e) {
662
+ this.terminalError = e, this.backgroundClose("kicked");
663
+ return;
664
+ }
665
+ let r = (async () => {
666
+ for (let n of e) {
667
+ let e = i(n);
668
+ if (S.isFailure(e)) throw e.failure;
669
+ if (e.success.kind !== "Full" && e.success.kind !== "Delta") throw new t({ detail: "Delayed history returned a non-state frame" });
670
+ this.lastSentTick = e.success.tick, await this.writeEncoded(n);
671
+ }
672
+ this.delayedCursor = n, this.lastSentTick = n.tick;
673
+ })();
674
+ this.delayedTask = r, r.then(() => {
675
+ this.delayedTask = null;
676
+ }, (e) => {
677
+ this.delayedTask = null, this.terminalError = e, this.backgroundClose("kicked");
678
+ });
679
+ }
680
+ close(e = "left") {
681
+ if (this.closeTask) return this.closeTask;
682
+ if (this.drainRequested && !this.ownershipLost && e !== "disposed") return this.deferredClose ??= Promise.withResolvers(), this.deferredClose.promise;
683
+ this.phase = "closed", this.lockstepBinding = null, this.lifecycleAbort.abort();
684
+ for (let e of this.detach.splice(0)) try {
685
+ e();
686
+ } catch (e) {
687
+ this.localCleanupFailures.push(e);
688
+ }
689
+ let t = this.claims;
690
+ return this.closeTask = (async () => {
691
+ let n = [];
692
+ if (t && this.memberJoined && (this.memberJoined = !1, !this.owner.isDisposed() && !this.owner.isFaulted() && !this.owner.isRetiring())) try {
693
+ await this.owner.leaveAsync(t.sessionId, e);
694
+ } catch (e) {
695
+ this.localCleanupFailures.push(e);
696
+ }
697
+ if (!this.ownershipLost && t && this.credentialDigest) try {
698
+ await x.runPromise(this.seats.disconnect(t, e, this.credentialDigest));
699
+ } catch (e) {
700
+ n.push(e);
701
+ }
702
+ try {
703
+ this.transport.close(e === "kicked" ? 1008 : 1e3, "Room session closed");
704
+ } catch (e) {
705
+ this.localCleanupFailures.push(e);
706
+ }
707
+ if (n.push(...this.localCleanupFailures), n.length) throw this.closeFailure = AggregateError(n, "Room session teardown failed"), this.closeFailure;
708
+ })().finally(() => {
709
+ this.closeSettled = !0;
710
+ }), this.closeTask.then(() => this.deferredClose?.resolve(), (e) => this.deferredClose?.reject(e)), this.closeTask;
711
+ }
712
+ quiesceForDrain() {
713
+ if (this.drainRequested = !0, this.drainTask) return this.drainTask;
714
+ let e = (async () => {
715
+ if (await this.settled(), this.terminalError !== null) throw this.terminalError;
716
+ this.drainSettled = !0;
717
+ })();
718
+ return this.drainTask = e, e.catch(() => {
719
+ this.drainTask = null;
720
+ }), e;
721
+ }
722
+ notifyWorldHandoff(n) {
723
+ if (this.phase !== "joined" || !this.claims || this.drainRequested || this.membershipMode !== "state-sync" || this.claims.role === "spectator") return;
724
+ if (n.sourceEpoch !== this.claims.epoch) throw new t({ detail: "World notice differs from the admitted Session epoch" });
725
+ let r = this.clock.now();
726
+ for (let [e, t] of this.worldNotices) t.expiresAt <= r && this.worldNotices.delete(e);
727
+ let i = this.worldNotices.get(n.transitionId);
728
+ if (n.phase === "departed") {
729
+ if (i) return;
730
+ let t = this.baselines.current(r)?.state, a = t && Object.getOwnPropertyDescriptor(t, "entities"), o = a && "value" in a ? a.value : void 0;
731
+ if (!o || typeof o != "object" || !Object.hasOwn(o, n.entityId)) return;
732
+ if (this.worldNotices.size >= 128) {
733
+ this.terminalError = new e({
734
+ budget: "worldHandoffNotices",
735
+ limit: 128
736
+ }), this.backgroundClose("kicked");
737
+ return;
738
+ }
739
+ this.worldNotices.set(n.transitionId, {
740
+ entityId: n.entityId,
741
+ expiresAt: r + n.holdMs
742
+ });
743
+ } else {
744
+ if (!i || i.entityId !== n.entityId) return;
745
+ this.worldNotices.delete(n.transitionId);
746
+ }
747
+ this.worldNoticeStateFence = Math.max(this.worldNoticeStateFence ?? -1, n.tick), this.send(n);
748
+ }
749
+ async notifyMigration(e, n) {
750
+ if (!this.drainSettled || !Number.isSafeInteger(e) || e < 1 || e > 4294967295) throw new t({ detail: "Migration notification requires a quiesced Session and bounded grace" });
751
+ this.phase === "closed" || this.transport.signal.aborted || await this.write({
752
+ kind: "Migrate",
753
+ graceMs: e,
754
+ ...n === void 0 ? {} : { address: n }
755
+ });
756
+ }
757
+ async settled() {
758
+ let e = (await Promise.allSettled([
759
+ ...this.authTask ? [this.authTask] : [],
760
+ ...this.closeTask ? [this.closeTask] : [],
761
+ ...this.delayedTask ? [this.delayedTask] : [],
762
+ ...this.writes
763
+ ])).flatMap((e) => e.status === "rejected" ? [e.reason] : []);
764
+ if (e.length) throw AggregateError(e, "Room session work did not settle successfully");
765
+ }
766
+ async closeFenced() {
767
+ this.ownershipLost = !0;
768
+ let e = this.close("reconnecting"), t = await Promise.allSettled([
769
+ e,
770
+ ...this.authTask ? [this.authTask] : [],
771
+ ...this.delayedTask ? [this.delayedTask] : [],
772
+ ...this.writes
773
+ ]), n = [...this.localCleanupFailures];
774
+ for (let e of t) e.status === "rejected" && e.reason !== this.closeFailure && n.push(e.reason);
775
+ if (n.length) throw AggregateError(n, "Revoked Room session cleanup failed");
776
+ }
777
+ }, D = E.prototype.admittedIdentity, O = E.prototype.admittedInputSchemaHash, k = E.prototype.canInstallLockstep, A = E.prototype.installLockstep, j = E.prototype.writeLockstep, M = E.prototype.withdrawLockstep, N = (e) => {
778
+ P(e);
779
+ let n = e, r = null;
780
+ return Object.freeze({
781
+ identity: () => D.call(n),
782
+ inputSchemaHash: () => O.call(n),
783
+ canActivate: () => k.call(n),
784
+ activate: (e, i) => {
785
+ if (r) throw new t({ detail: "Captured lockstep Session port is already activated" });
786
+ r = A.call(n, {
787
+ receive: e,
788
+ tick: i
789
+ });
790
+ },
791
+ send: (e) => r ? j.call(n, e, r) : Promise.reject(new t({ detail: "Captured lockstep Session port is not activated" })),
792
+ withdraw: () => {
793
+ r && M.call(n, r), r = null;
794
+ }
795
+ });
796
+ }, P = (e) => {
797
+ if (!e || typeof e != "object" || !w.has(e)) throw new t({ detail: "Actual constructed Room server session is required" });
798
+ let n = e;
799
+ return Object.freeze({
800
+ identity: () => D.call(n),
801
+ inputSchemaHash: () => O.call(n)
802
+ });
803
+ }, F = E.prototype.writeReliableChannel, I = (e) => {
804
+ let t = P(e), n = e;
805
+ return Object.freeze({
806
+ identity: t.identity,
807
+ write: (e, t, r) => F.call(n, e, t, r)
808
+ });
809
+ };
810
+ export { E as RoomServerSession, T as RoomServerSessionAcquisitionFailure, P as captureRoomAdmittedSessionReader, N as captureRoomLockstepSessionPort, I as captureRoomReliableChannelWriter };