@voltro/plugin-rooms 0.0.0-stage → 0.87.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.
- package/CHANGELOG.md +24329 -0
- package/LICENSE +61 -0
- package/README.md +9204 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +11322 -0
- package/dist/actor.js +1474 -0
- package/dist/apiBinding.js +678 -0
- package/dist/apiRegistryBinding.js +399 -0
- package/dist/apiReservations.js +433 -0
- package/dist/baselines.js +73 -0
- package/dist/bots.d.ts +1485 -0
- package/dist/bots.js +563 -0
- package/dist/catalog.js +80 -0
- package/dist/checkpointJson.js +24 -0
- package/dist/checkpointStore.js +386 -0
- package/dist/client.js +56 -0
- package/dist/clockSync.js +51 -0
- package/dist/collision.js +156 -0
- package/dist/commandDelivery.js +101 -0
- package/dist/commandRecord.js +11 -0
- package/dist/commandWithdrawal.js +183 -0
- package/dist/connection.js +497 -0
- package/dist/controlCarrier.js +375 -0
- package/dist/controlRegistry.js +79 -0
- package/dist/controlTarget.js +45 -0
- package/dist/controlTransport.js +574 -0
- package/dist/developmentBinding.js +113 -0
- package/dist/directory.js +323 -0
- package/dist/directoryProjection.js +117 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +53 -0
- package/dist/fixed.d.ts +284 -0
- package/dist/fixed.js +10 -0
- package/dist/fixed32.js +134 -0
- package/dist/fixedCollision.js +60 -0
- package/dist/fixedCollision32.js +109 -0
- package/dist/fixedMath.js +56 -0
- package/dist/fixedRaw.js +11 -0
- package/dist/fixedSlabs.js +34 -0
- package/dist/fixedTrig.js +48 -0
- package/dist/fixedTrig32.js +38 -0
- package/dist/fixedVectors.js +113 -0
- package/dist/fixedVectors32.js +95 -0
- package/dist/fixedWide.js +50 -0
- package/dist/fixedWords.js +46 -0
- package/dist/gateway.js +57 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
- package/dist/geometry-worker/worker.d.mts +2 -0
- package/dist/geometry-worker/worker.mjs +50 -0
- package/dist/geometry.d.ts +2249 -0
- package/dist/geometry.js +40 -0
- package/dist/geometryActivation.js +82 -0
- package/dist/geometryActorInventory.js +108 -0
- package/dist/geometryAdminClient.js +87 -0
- package/dist/geometryAdminData.js +32 -0
- package/dist/geometryAdminFixtures.js +50 -0
- package/dist/geometryAdminPorts.js +5 -0
- package/dist/geometryAdminRpc.js +58 -0
- package/dist/geometryAdminRpcRoutes.js +49 -0
- package/dist/geometryAdminSchemas.js +39 -0
- package/dist/geometryAdministration.js +190 -0
- package/dist/geometryAdministrationPorts.js +5 -0
- package/dist/geometryApiBinding.js +165 -0
- package/dist/geometryAppStorage.js +58 -0
- package/dist/geometryArtifacts.js +198 -0
- package/dist/geometryAssetBundle.js +117 -0
- package/dist/geometryAssetClient.js +25 -0
- package/dist/geometryAssetData.js +106 -0
- package/dist/geometryAssetHttp.js +123 -0
- package/dist/geometryAssetPorts.js +5 -0
- package/dist/geometryAssetRpc.js +30 -0
- package/dist/geometryAssetRpcRoutes.js +40 -0
- package/dist/geometryAssetStorageGrant.js +103 -0
- package/dist/geometryBoxOverlap.js +110 -0
- package/dist/geometryCatalogueDigest.js +111 -0
- package/dist/geometryCellCoverage.js +85 -0
- package/dist/geometryCellLoader.js +28 -0
- package/dist/geometryChannel.js +134 -0
- package/dist/geometryChunkHttp.js +54 -0
- package/dist/geometryChunkLeases.js +22 -0
- package/dist/geometryClient.d.ts +1429 -0
- package/dist/geometryClient.js +149 -0
- package/dist/geometryClientChunks.js +330 -0
- package/dist/geometryClientDelta.js +25 -0
- package/dist/geometryClientHttp.js +37 -0
- package/dist/geometryClientInterest.js +109 -0
- package/dist/geometryClientStatic.js +34 -0
- package/dist/geometryCms.d.ts +763 -0
- package/dist/geometryCms.js +217 -0
- package/dist/geometryCommitCoordinator.js +241 -0
- package/dist/geometryCompactionFixture.js +84 -0
- package/dist/geometryCompactionStrategies.js +38 -0
- package/dist/geometryConnectionClient.js +23 -0
- package/dist/geometryDerivationFixtures.js +141 -0
- package/dist/geometryDerivationStrategies.js +27 -0
- package/dist/geometryDigest.js +13 -0
- package/dist/geometryEditChannel.js +70 -0
- package/dist/geometryEditIngress.js +263 -0
- package/dist/geometryEdits.js +366 -0
- package/dist/geometryEnvelope.js +41 -0
- package/dist/geometryGridRaycast.js +92 -0
- package/dist/geometryGridSweep.js +92 -0
- package/dist/geometryHeightfield.js +166 -0
- package/dist/geometryHeightfieldRaycast.js +74 -0
- package/dist/geometryHeightfieldSweep.js +85 -0
- package/dist/geometryHeightfieldVolume.js +45 -0
- package/dist/geometryHost.js +322 -0
- package/dist/geometryHostDirectory.js +207 -0
- package/dist/geometryHostMutations.js +137 -0
- package/dist/geometryHostStreams.js +124 -0
- package/dist/geometryHttpBody.js +76 -0
- package/dist/geometryHttpRoutes.js +112 -0
- package/dist/geometryImportGltf.js +300 -0
- package/dist/geometryImportLdtk.js +54 -0
- package/dist/geometryImportPng.js +144 -0
- package/dist/geometryImportPublication.js +67 -0
- package/dist/geometryImportTiled.js +39 -0
- package/dist/geometryImportTiles.js +136 -0
- package/dist/geometryImportVox.js +130 -0
- package/dist/geometryImportedSource.js +101 -0
- package/dist/geometryInspectEndpoint.js +248 -0
- package/dist/geometryInspection.js +92 -0
- package/dist/geometryInstall.js +121 -0
- package/dist/geometryJournalArchiveData.js +21 -0
- package/dist/geometryJournalArchiveIndex.js +330 -0
- package/dist/geometryJournalArchiveTable.js +21 -0
- package/dist/geometryJournalCompaction.js +100 -0
- package/dist/geometryJournalPatch.js +47 -0
- package/dist/geometryJournalRetention.js +112 -0
- package/dist/geometryJournalRetentionSchemas.js +36 -0
- package/dist/geometryJournalRetentionSweep.js +112 -0
- package/dist/geometryJournalRetentionWorkflow.js +28 -0
- package/dist/geometryJournalRetentionWorkflowData.js +31 -0
- package/dist/geometryJournalStorage.js +148 -0
- package/dist/geometryLoader.js +118 -0
- package/dist/geometryManifest.js +113 -0
- package/dist/geometryManifestChannel.js +93 -0
- package/dist/geometryManifestClient.js +122 -0
- package/dist/geometryManifestData.js +49 -0
- package/dist/geometryManifestPorts.js +5 -0
- package/dist/geometryManifestPublication.js +109 -0
- package/dist/geometryManifestSource.js +68 -0
- package/dist/geometryMigrationJournal.js +14 -0
- package/dist/geometryMigrationStrategies.js +7 -0
- package/dist/geometryMigrations.js +323 -0
- package/dist/geometryNativeMetadata.js +52 -0
- package/dist/geometryPatch.js +170 -0
- package/dist/geometryPersistence.js +449 -0
- package/dist/geometryPersistenceCapture.js +69 -0
- package/dist/geometryPersistenceData.js +140 -0
- package/dist/geometryPersistencePorts.js +5 -0
- package/dist/geometryPlayerAdmission.js +34 -0
- package/dist/geometryPlayerEditOwner.js +265 -0
- package/dist/geometryPlayerEdits.js +49 -0
- package/dist/geometryPrepared.js +188 -0
- package/dist/geometryPrivacyFence.js +24 -0
- package/dist/geometryProceduralPublication.js +91 -0
- package/dist/geometryProceduralWorker.js +164 -0
- package/dist/geometryPublication.js +110 -0
- package/dist/geometryRayAlgebra.js +116 -0
- package/dist/geometryReadClient.js +157 -0
- package/dist/geometryReadPorts.js +5 -0
- package/dist/geometryReadRpc.js +27 -0
- package/dist/geometryReadRpcRoutes.js +47 -0
- package/dist/geometryReliablePublication.js +82 -0
- package/dist/geometryReloadPorts.js +46 -0
- package/dist/geometryReloadSource.js +278 -0
- package/dist/geometryRenderCache.js +165 -0
- package/dist/geometryRenderLod.js +102 -0
- package/dist/geometryRollback.js +125 -0
- package/dist/geometryRollbackCoordinator.js +203 -0
- package/dist/geometryRollbackPorts.js +46 -0
- package/dist/geometryRollbackSource.js +209 -0
- package/dist/geometryRollbackStore.js +198 -0
- package/dist/geometrySchemas.js +27 -0
- package/dist/geometryServer.d.ts +2766 -0
- package/dist/geometryServer.js +62 -0
- package/dist/geometryShapeRaycast.js +111 -0
- package/dist/geometryShapeSegments.js +34 -0
- package/dist/geometryShapes.js +223 -0
- package/dist/geometrySnapshot.js +76 -0
- package/dist/geometrySnapshotChannel.js +160 -0
- package/dist/geometrySnapshotClient.js +159 -0
- package/dist/geometrySnapshotPreparation.js +76 -0
- package/dist/geometrySnapshotServer.js +191 -0
- package/dist/geometrySqlOwner.js +21 -0
- package/dist/geometryStorage.js +127 -0
- package/dist/geometryStorageGrant.js +69 -0
- package/dist/geometryStorageIdentity.js +9 -0
- package/dist/geometryTileArtifact.js +10 -0
- package/dist/geometryTileCodec.js +194 -0
- package/dist/geometryTileCollision.js +96 -0
- package/dist/geometryTileNavigation.js +128 -0
- package/dist/geometryTileView.js +35 -0
- package/dist/geometryVersionActivation.js +114 -0
- package/dist/geometryVersionClient.js +238 -0
- package/dist/geometryVersionCompare.js +40 -0
- package/dist/geometryVersionMigration.js +106 -0
- package/dist/geometryVoxel.js +253 -0
- package/dist/geometryWorldEntitySubject.js +32 -0
- package/dist/geometryWorldExtent.js +12 -0
- package/dist/geometryWorldMetadata.js +38 -0
- package/dist/geometryWorldStrategyFixtures.js +127 -0
- package/dist/geometryWorldView.js +307 -0
- package/dist/host.js +128 -0
- package/dist/hostBinding.js +277 -0
- package/dist/hostCellObservation.js +114 -0
- package/dist/hostClientCapacity.js +90 -0
- package/dist/hostCommandScope.js +64 -0
- package/dist/hostController.js +3094 -0
- package/dist/hostDeployment.js +65 -0
- package/dist/hostDrain.js +152 -0
- package/dist/hostDrainPorts.js +5 -0
- package/dist/hostDriver.js +179 -0
- package/dist/hostLane.js +288 -0
- package/dist/hostListener.js +79 -0
- package/dist/hostListenerBinding.js +19 -0
- package/dist/hostLoopObservation.js +90 -0
- package/dist/hostMetrics.js +56 -0
- package/dist/hostRegistryBinding.js +418 -0
- package/dist/hostSelection.js +16 -0
- package/dist/hostShutdown.js +47 -0
- package/dist/hostTurnObservation.js +53 -0
- package/dist/identities.js +4 -0
- package/dist/index.d.ts +8632 -0
- package/dist/index.js +232 -0
- package/dist/inputReceipts.js +63 -0
- package/dist/inputRedundancy.js +55 -0
- package/dist/inspect.js +238 -0
- package/dist/lockstep.d.ts +436 -0
- package/dist/lockstep.js +382 -0
- package/dist/lockstepAdmission.js +262 -0
- package/dist/lockstepAdmissionCodec.js +94 -0
- package/dist/lockstepAdmissionPorts.js +5 -0
- package/dist/lockstepClientSession.js +578 -0
- package/dist/lockstepDefinition.js +148 -0
- package/dist/lockstepHostLoop.js +243 -0
- package/dist/lockstepInitialAdmission.js +67 -0
- package/dist/lockstepInitialStrategyFixtures.js +45 -0
- package/dist/lockstepJournal.js +395 -0
- package/dist/lockstepJournalCodec.js +254 -0
- package/dist/lockstepJournalPorts.js +5 -0
- package/dist/lockstepJournalRebuild.js +208 -0
- package/dist/lockstepJournalRows.js +57 -0
- package/dist/lockstepMembers.js +131 -0
- package/dist/lockstepMessages.js +47 -0
- package/dist/lockstepOwnedRoom.js +764 -0
- package/dist/lockstepPolicies.js +84 -0
- package/dist/lockstepReact.js +47 -0
- package/dist/lockstepRecoveryTruth.js +121 -0
- package/dist/lockstepRosterConfig.js +32 -0
- package/dist/lockstepSeed.js +12 -0
- package/dist/lockstepSeedFixture.js +20 -0
- package/dist/lockstepServer.d.ts +3897 -0
- package/dist/lockstepServer.js +325 -0
- package/dist/lockstepServerConfig.js +101 -0
- package/dist/lockstepServerRoles.js +403 -0
- package/dist/lockstepServerStrategyFixtures.js +33 -0
- package/dist/lockstepStrategies.js +6 -0
- package/dist/lockstepStrategyFixtures.js +137 -0
- package/dist/lockstepTerminal.js +90 -0
- package/dist/lockstepTerminalPorts.js +5 -0
- package/dist/lockstepTransport.js +773 -0
- package/dist/lockstepTransportConfig.js +32 -0
- package/dist/lockstepWireRoster.js +34 -0
- package/dist/matchRoomProvider.js +32 -0
- package/dist/matchRooms.js +19 -0
- package/dist/membershipObserver.js +47 -0
- package/dist/moderation.js +98 -0
- package/dist/movementSpecials.js +104 -0
- package/dist/ownership.js +17 -0
- package/dist/ownershipWithdrawal.js +18 -0
- package/dist/pcg32.js +96 -0
- package/dist/ports.d.ts +1241 -0
- package/dist/ports.js +11 -0
- package/dist/quaternion.js +70 -0
- package/dist/react.d.ts +406 -0
- package/dist/react.js +109 -0
- package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
- package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
- package/dist/reaper.js +243 -0
- package/dist/reaperSchemas.js +42 -0
- package/dist/reaperWorkflow.js +70 -0
- package/dist/recovery.js +189 -0
- package/dist/recoverySeats.js +26 -0
- package/dist/replay.d.ts +273 -0
- package/dist/replay.js +485 -0
- package/dist/replayPorts.js +5 -0
- package/dist/replayRecording.js +67 -0
- package/dist/replaySchema.js +157 -0
- package/dist/replayStorage.d.ts +149 -0
- package/dist/replayStorage.js +485 -0
- package/dist/reservationBatch.js +422 -0
- package/dist/reservationSchemas.js +17 -0
- package/dist/reservations.js +259 -0
- package/dist/reservePort.js +69 -0
- package/dist/resolvedOptions.js +4 -0
- package/dist/room.d.ts +1006 -0
- package/dist/room.js +284 -0
- package/dist/roomAccessSweep.js +95 -0
- package/dist/roomAppCommandControl.js +59 -0
- package/dist/roomAuthoringStrategy.js +17 -0
- package/dist/roomErasure.js +198 -0
- package/dist/roomPoolRuntimeDefaults.js +24 -0
- package/dist/roomPoolSelection.js +19 -0
- package/dist/roomPoolTopology.js +212 -0
- package/dist/rpc.d.ts +551 -0
- package/dist/rpc.js +112 -0
- package/dist/rpcClient.js +152 -0
- package/dist/rpcRoutes.js +28 -0
- package/dist/runtime.js +1123 -0
- package/dist/schemaHistory.js +98 -0
- package/dist/seatStore.js +151 -0
- package/dist/seatStrategyFixtures.js +52 -0
- package/dist/seatSubject.js +32 -0
- package/dist/seats.js +130 -0
- package/dist/serverSession.js +811 -0
- package/dist/serverSessionConfig.js +43 -0
- package/dist/sessionAdmission.js +53 -0
- package/dist/sidecarAdmission.js +103 -0
- package/dist/sidecarConfig.js +116 -0
- package/dist/sidecarConfigPublication.js +64 -0
- package/dist/sidecarHostListener.js +208 -0
- package/dist/sidecarIpc.js +205 -0
- package/dist/sidecarPeer.js +310 -0
- package/dist/sidecarProcessPort.js +28 -0
- package/dist/sidecarRuntime.js +168 -0
- package/dist/sidecarSelection.js +142 -0
- package/dist/sidecarWire.js +178 -0
- package/dist/sidecarWrites.js +163 -0
- package/dist/simulation.d.ts +391 -0
- package/dist/simulation.js +282 -0
- package/dist/simulationAuthoring.js +29 -0
- package/dist/simulationBytes.js +27 -0
- package/dist/simulationConformance.js +305 -0
- package/dist/simulationInputHistoryCapture.js +35 -0
- package/dist/simulationInputHistoryWire.js +193 -0
- package/dist/simulationOptionsWire.js +78 -0
- package/dist/simulationRecoveryWire.js +134 -0
- package/dist/simulationReplay.js +127 -0
- package/dist/simulationSnapshotWire.js +112 -0
- package/dist/simulationState.js +178 -0
- package/dist/snapshotBlob.js +126 -0
- package/dist/snapshotBlobCleanup.js +93 -0
- package/dist/snapshotBlobIndex.js +38 -0
- package/dist/snapshotBudget.js +80 -0
- package/dist/snapshotChain.js +185 -0
- package/dist/snapshotErasure.js +172 -0
- package/dist/snapshotInspection.js +105 -0
- package/dist/snapshotSegmentBlobs.js +58 -0
- package/dist/snapshotUploads.js +166 -0
- package/dist/socketTransport.js +253 -0
- package/dist/spatial.js +104 -0
- package/dist/spectatorPolicy.js +26 -0
- package/dist/spectatorProducer.js +89 -0
- package/dist/startFailureCause.js +4 -0
- package/dist/stateCodec.js +658 -0
- package/dist/strategies.d.ts +210 -0
- package/dist/strategies.js +8 -0
- package/dist/strategiesServer.d.ts +286 -0
- package/dist/strategiesServer.js +11 -0
- package/dist/strategyFixtures.js +182 -0
- package/dist/streamFraming.js +122 -0
- package/dist/streamTransport.js +266 -0
- package/dist/subjectAdmission.js +50 -0
- package/dist/subjectPrivacy.js +281 -0
- package/dist/subjectPrivacyBinding.js +90 -0
- package/dist/systemManifest.js +182 -0
- package/dist/tables.js +159 -0
- package/dist/testHarness.js +89 -0
- package/dist/testing.d.ts +3684 -0
- package/dist/testing.js +221 -0
- package/dist/testingPorts.js +271 -0
- package/dist/testingServer.d.ts +4060 -0
- package/dist/testingServer.js +18 -0
- package/dist/transform.d.ts +692 -0
- package/dist/transform.js +217 -0
- package/dist/transform3d.js +118 -0
- package/dist/transformCollection.js +24 -0
- package/dist/transformCollection3d.js +24 -0
- package/dist/transformCollectionCore.js +156 -0
- package/dist/transformFrames.js +121 -0
- package/dist/transformPrediction3d.js +127 -0
- package/dist/transformRules.js +123 -0
- package/dist/transformSchemas.js +20 -0
- package/dist/transport.js +32 -0
- package/dist/transportAuthoring.js +29 -0
- package/dist/transportCleanup.js +22 -0
- package/dist/transportConformance.js +124 -0
- package/dist/transportConnector.js +82 -0
- package/dist/transportEndpoints.js +38 -0
- package/dist/transportsServer.d.ts +5515 -0
- package/dist/transportsServer.js +6 -0
- package/dist/viewProjection.js +16 -0
- package/dist/web.d.ts +2286 -0
- package/dist/web.js +518 -0
- package/dist/webTransportClient.js +173 -0
- package/dist/wire.d.ts +992 -0
- package/dist/wire.js +492 -0
- package/dist/withdrawalPort.js +28 -0
- package/dist/world.d.ts +1894 -0
- package/dist/world.js +333 -0
- package/dist/worldActorReceipts.js +48 -0
- package/dist/worldActorTransferSnapshot.js +14 -0
- package/dist/worldAdmissionPending.js +8 -0
- package/dist/worldBoundaryCoordinator.js +148 -0
- package/dist/worldCatalog.js +81 -0
- package/dist/worldCellAllocation.js +203 -0
- package/dist/worldCellDestination.js +68 -0
- package/dist/worldCells.js +489 -0
- package/dist/worldChange.js +32 -0
- package/dist/worldClient.js +664 -0
- package/dist/worldClientControl.js +141 -0
- package/dist/worldClientPendingInput.js +16 -0
- package/dist/worldClientRpc.js +133 -0
- package/dist/worldClientRpcRoutes.js +43 -0
- package/dist/worldClientSchemas.js +28 -0
- package/dist/worldCommands.js +140 -0
- package/dist/worldData.js +42 -0
- package/dist/worldDefaultBinding.js +377 -0
- package/dist/worldDefaultGroupAdmission.js +82 -0
- package/dist/worldDefaultGroupAppServices.js +31 -0
- package/dist/worldDefaultGroupCompensation.js +109 -0
- package/dist/worldDefaultGroupContinuation.js +96 -0
- package/dist/worldDefaultGroupControl.js +72 -0
- package/dist/worldDefaultGroupMembers.js +85 -0
- package/dist/worldDefaultGroups.js +21 -0
- package/dist/worldDefaultPending.js +79 -0
- package/dist/worldDefaultService.js +245 -0
- package/dist/worldEntities.js +2980 -0
- package/dist/worldEntityCodec.js +21 -0
- package/dist/worldEntityHandoffView.js +154 -0
- package/dist/worldGeometry.js +170 -0
- package/dist/worldGhostAdmission.js +65 -0
- package/dist/worldGhostDestination.js +118 -0
- package/dist/worldGhostGateway.js +132 -0
- package/dist/worldGhostHandshake.js +108 -0
- package/dist/worldGhostHost.js +42 -0
- package/dist/worldGhostIngress.js +132 -0
- package/dist/worldGhostNeighborhood.js +70 -0
- package/dist/worldGhostNeighbors.js +86 -0
- package/dist/worldGhostOutbound.js +110 -0
- package/dist/worldGhostPublisher.js +216 -0
- package/dist/worldGhostReceiver.js +213 -0
- package/dist/worldGhostSender.js +146 -0
- package/dist/worldGhostSocket.js +78 -0
- package/dist/worldGhostWire.js +172 -0
- package/dist/worldGroupCommand.js +49 -0
- package/dist/worldGroupDeadline.js +115 -0
- package/dist/worldGroupPreparation.js +115 -0
- package/dist/worldGroupReadyControl.js +128 -0
- package/dist/worldGroupSupervisor.js +120 -0
- package/dist/worldHandoffMetrics.js +59 -0
- package/dist/worldHandoffView.js +100 -0
- package/dist/worldHostSource.js +69 -0
- package/dist/worldInspectEndpoint.js +250 -0
- package/dist/worldInspection.js +109 -0
- package/dist/worldInstanceAdmission.js +31 -0
- package/dist/worldInstanceAllocation.js +116 -0
- package/dist/worldInstanceDestination.js +64 -0
- package/dist/worldInstanceExpiry.js +282 -0
- package/dist/worldInstanceExpirySupervisor.js +88 -0
- package/dist/worldInstanceLifecycle.js +103 -0
- package/dist/worldInstanceState.js +52 -0
- package/dist/worldInstances.js +478 -0
- package/dist/worldJoin.js +56 -0
- package/dist/worldLayers.js +151 -0
- package/dist/worldLeases.js +78 -0
- package/dist/worldManifest.js +25 -0
- package/dist/worldMovement.js +63 -0
- package/dist/worldPersistence.js +134 -0
- package/dist/worldProjection.js +221 -0
- package/dist/worldReact.js +110 -0
- package/dist/worldRecoveryActor.js +35 -0
- package/dist/worldReturnAnchor.js +49 -0
- package/dist/worldRoomHooks.js +57 -0
- package/dist/worldRoomPool.js +27 -0
- package/dist/worldRoomSteps.js +133 -0
- package/dist/worldSeatBinding.js +36 -0
- package/dist/worldServer.d.ts +6936 -0
- package/dist/worldServer.js +48 -0
- package/dist/worldSourceSeatPending.js +9 -0
- package/dist/worldStrategyFixtures.js +164 -0
- package/dist/worldTesting.js +27 -0
- package/dist/worldTransitionDefaults.js +198 -0
- package/dist/worldTransitionExecutor.js +519 -0
- package/dist/worldTransitionGroup.js +113 -0
- package/dist/worldTransitionPhysicalSteps.js +40 -0
- package/dist/worldTransitionResolver.js +228 -0
- package/dist/worldTransitionSeatGroup.js +64 -0
- package/dist/worldTransitionSeats.js +260 -0
- package/dist/worldTransitionState.js +95 -0
- package/dist/worldTransitions.js +101 -0
- package/package.json +189 -4
package/dist/hostLane.js
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { ProtocolError as e, RoomGone as t } from "./errors.js";
|
|
2
|
+
import { simulationOwnData as n } from "./simulationAuthoring.js";
|
|
3
|
+
import { captureRoomTransportDataMethod as r } from "./transportAuthoring.js";
|
|
4
|
+
import { RoomReservePort as i } from "./ports.js";
|
|
5
|
+
import { roomsGateway as a } from "./gateway.js";
|
|
6
|
+
import { captureRoomHostDrainPolicy as o } from "./hostDrain.js";
|
|
7
|
+
import { RoomHostController as s, RoomHostControllerStartFailure as c } from "./hostController.js";
|
|
8
|
+
import { RoomHostDriver as l, captureRoomHostDriverOptions as u } from "./hostDriver.js";
|
|
9
|
+
import { hostRoomReserveService as d } from "./reservePort.js";
|
|
10
|
+
import { frameworkStartCause as f } from "./startFailureCause.js";
|
|
11
|
+
import { Effect as p, Layer as m } from "effect";
|
|
12
|
+
//#region src/hostLane.ts
|
|
13
|
+
var h = class extends Error {
|
|
14
|
+
stage;
|
|
15
|
+
retryCleanup;
|
|
16
|
+
name = "RoomHostLaneStartFailure";
|
|
17
|
+
constructor(e, t, n) {
|
|
18
|
+
super(`Room host lane failed during ${e} acquisition`, f(n) === void 0 ? void 0 : { cause: n }), this.stage = e, this.retryCleanup = t;
|
|
19
|
+
}
|
|
20
|
+
}, g = class extends Error {
|
|
21
|
+
retryCleanup;
|
|
22
|
+
name = "RoomHostListenerBindFailure";
|
|
23
|
+
constructor(e) {
|
|
24
|
+
super("Room listener acquisition cleanup remains incomplete"), this.retryCleanup = e;
|
|
25
|
+
}
|
|
26
|
+
}, _ = class f {
|
|
27
|
+
controller;
|
|
28
|
+
ghostGateway = null;
|
|
29
|
+
ghostsStopped = !1;
|
|
30
|
+
phase = "binding";
|
|
31
|
+
listener = null;
|
|
32
|
+
admissionStopped = !1;
|
|
33
|
+
controllerStopped = !1;
|
|
34
|
+
listenerStopped = !1;
|
|
35
|
+
partialListenerCleanup = null;
|
|
36
|
+
closeTask = null;
|
|
37
|
+
activation = null;
|
|
38
|
+
plannedDrain = null;
|
|
39
|
+
gateway;
|
|
40
|
+
reservation;
|
|
41
|
+
services;
|
|
42
|
+
driver;
|
|
43
|
+
sessionHost;
|
|
44
|
+
constructor(e, n) {
|
|
45
|
+
this.controller = e, this.driver = new l(e, {
|
|
46
|
+
...n.driver,
|
|
47
|
+
maintainWorldGhosts: async () => {
|
|
48
|
+
let e = (await Promise.allSettled([Promise.resolve().then(() => this.ghostGateway?.runDue()), Promise.resolve().then(() => n.driver.maintainWorldGhosts?.())])).flatMap((e) => e.status === "rejected" ? [e.reason] : []);
|
|
49
|
+
if (e.length) throw AggregateError(e, "World ghost maintenance remains incomplete");
|
|
50
|
+
}
|
|
51
|
+
}, () => this.phase === "running"), this.sessionHost = Object.freeze({
|
|
52
|
+
verifySeat: async (t, n) => {
|
|
53
|
+
this.requireRunning();
|
|
54
|
+
let r = await e.verifySeat(t, n);
|
|
55
|
+
return this.requireRunning(), r;
|
|
56
|
+
},
|
|
57
|
+
connect: (t, n, r) => (this.requireRunning(), e.connect(t, n, r))
|
|
58
|
+
}), this.gateway = a(this.sessionHost, n.gateway);
|
|
59
|
+
let r = d(e), o = (e) => p.suspend(() => this.phase === "running" ? e : p.fail(new t({ roomId: "host" })));
|
|
60
|
+
this.reservation = Object.freeze({
|
|
61
|
+
reserve: (e, t) => o(r.reserve(e, t)),
|
|
62
|
+
resume: (e, t) => o(r.resume(e, t)),
|
|
63
|
+
leave: (e, t, n) => o(r.leave(e, t, n)),
|
|
64
|
+
list: (e, t, n) => o(r.list(e, t, n))
|
|
65
|
+
}), this.services = m.succeed(i, this.reservation);
|
|
66
|
+
}
|
|
67
|
+
static async start(t, i, a) {
|
|
68
|
+
if (a.processRole !== "rooms") throw new e({ detail: "A Room host requires its dedicated process role" });
|
|
69
|
+
if (a.startSuspended !== void 0 && typeof a.startSuspended != "boolean") throw new e({ detail: "Invalid Room lane activation policy" });
|
|
70
|
+
let o = Object.getOwnPropertyDescriptor(a, "worldGhostGateway");
|
|
71
|
+
if (o && (!("value" in o) || typeof o.value != "function") || !o && "worldGhostGateway" in a) throw new e({ detail: "World ghost gateway requires an own acquired factory" });
|
|
72
|
+
let l = Object.getOwnPropertyDescriptor(a, "worldGhostCells"), d = [];
|
|
73
|
+
if (l && (!("value" in l) || !Array.isArray(l.value) || l.value.length > 1024) || !l && "worldGhostCells" in a) throw new e({ detail: "World ghost cells require a bounded own policy inventory" });
|
|
74
|
+
if (l) for (let t = 0; t < l.value.length; t++) {
|
|
75
|
+
let r = Object.getOwnPropertyDescriptor(l.value, String(t));
|
|
76
|
+
if (!r || !("value" in r)) throw new e({ detail: "World ghost cell policy inventory must be dense own data" });
|
|
77
|
+
let i = n(r.value, ["worldId", "factory"], ["worldId", "factory"]);
|
|
78
|
+
if (typeof i.worldId != "string" || typeof i.factory != "function" || !a.host.worlds?.some((e) => e.name === i.worldId) || d.some((e) => e.worldId === i.worldId)) throw new e({ detail: "World ghost cells require unique declared World policies" });
|
|
79
|
+
d.push(Object.freeze({
|
|
80
|
+
worldId: i.worldId,
|
|
81
|
+
factory: i.factory.bind(r.value)
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
if (d.length && !o) throw new e({ detail: "World ghost cell policies require their acquired authenticated gateway" });
|
|
85
|
+
let p = Object.getOwnPropertyDescriptor(a, "worldBoundaryCells"), m = [];
|
|
86
|
+
if (p && (!("value" in p) || !Array.isArray(p.value) || Object.getPrototypeOf(p.value) !== Array.prototype || p.value.length > 1024 || Reflect.ownKeys(p.value).length !== p.value.length + 1) || !p && "worldBoundaryCells" in a) throw new e({ detail: "World boundary cells require bounded own policies" });
|
|
87
|
+
if (p) for (let t = 0; t < p.value.length; t++) {
|
|
88
|
+
let r = Object.getOwnPropertyDescriptor(p.value, String(t));
|
|
89
|
+
if (!r?.enumerable || !("value" in r)) throw new e({ detail: "World boundary policy inventory must be dense own data" });
|
|
90
|
+
let i = n(r.value, ["worldId", "factory"], ["worldId", "factory"]);
|
|
91
|
+
if (typeof i.worldId != "string" || typeof i.factory != "function" || !a.host.worlds?.some((e) => e.name === i.worldId) || m.some((e) => e.worldId === i.worldId)) throw new e({ detail: "World boundary cells require unique declared World policies" });
|
|
92
|
+
m.push(Object.freeze({
|
|
93
|
+
worldId: i.worldId,
|
|
94
|
+
factory: i.factory.bind(r.value)
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
let _ = u(a.driver);
|
|
98
|
+
if (typeof a.listener?.bind != "function") throw new e({ detail: "Room listener must provide its bind operation" });
|
|
99
|
+
let v = a.listener.bind.bind(a.listener), y = Object.freeze({
|
|
100
|
+
...a,
|
|
101
|
+
worldBoundaryCells: Object.freeze(m),
|
|
102
|
+
worldGhostCells: Object.freeze(d),
|
|
103
|
+
...o ? { worldGhostGateway: a.worldGhostGateway.bind(a) } : {},
|
|
104
|
+
host: Object.freeze({ ...a.host }),
|
|
105
|
+
driver: _,
|
|
106
|
+
gateway: a.gateway === void 0 ? void 0 : Object.freeze({ ...a.gateway }),
|
|
107
|
+
listener: Object.freeze({ bind: v })
|
|
108
|
+
}), b;
|
|
109
|
+
try {
|
|
110
|
+
b = await s.start(t, i, {
|
|
111
|
+
...y.host,
|
|
112
|
+
startSuspended: !0
|
|
113
|
+
});
|
|
114
|
+
} catch (e) {
|
|
115
|
+
throw e instanceof c ? new h("controller", e.retryCleanup, e) : e;
|
|
116
|
+
}
|
|
117
|
+
let x;
|
|
118
|
+
try {
|
|
119
|
+
x = new f(b, y);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
try {
|
|
122
|
+
await b.close();
|
|
123
|
+
} catch {}
|
|
124
|
+
throw new h("driver", () => b.close(), e);
|
|
125
|
+
}
|
|
126
|
+
let S = "listener";
|
|
127
|
+
try {
|
|
128
|
+
if (y.worldGhostGateway) {
|
|
129
|
+
let t = y.worldGhostGateway(b);
|
|
130
|
+
x.ghostGateway = t;
|
|
131
|
+
let n = r(t, "close", "World ghost gateway requires joined cleanup"), i = r(t, "runDue", "World ghost gateway requires bounded maintenance"), a = r(t, "snapshot", "World ghost gateway requires inventory observation");
|
|
132
|
+
if (!t.route || t.route.auth !== "token" || t.route.path === x.gateway.path) throw new e({ detail: "World ghost gateway requires a separate authenticated route" });
|
|
133
|
+
x.ghostGateway = Object.freeze({
|
|
134
|
+
route: t.route,
|
|
135
|
+
close: n,
|
|
136
|
+
runDue: i,
|
|
137
|
+
snapshot: a
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
for (let e of y.worldBoundaryCells) await b.configureWorldBoundaryCells(e.worldId, e.factory);
|
|
141
|
+
for (let e of y.worldGhostCells) await b.configureWorldGhostCells(e.worldId, e.factory);
|
|
142
|
+
let t = await v(x.gateway, Object.freeze({
|
|
143
|
+
ready: () => x.phase === "running",
|
|
144
|
+
...x.ghostGateway ? { worldGhostGateway: x.ghostGateway.route } : {},
|
|
145
|
+
onFailure: y.driver.onFailure,
|
|
146
|
+
live: () => x.phase !== "running" || x.driver.live(),
|
|
147
|
+
observeMetrics: () => {
|
|
148
|
+
let e = b.metrics();
|
|
149
|
+
return {
|
|
150
|
+
host: b.host.id,
|
|
151
|
+
region: b.host.region,
|
|
152
|
+
...b.host.pool === void 0 ? {} : { pool: b.host.pool },
|
|
153
|
+
loop: e.loop,
|
|
154
|
+
cells: e.cells,
|
|
155
|
+
worldBoundaryClamps: e.worldBoundaryClamps,
|
|
156
|
+
worldHandoffs: e.worldHandoffs,
|
|
157
|
+
rooms: e.ownedRooms,
|
|
158
|
+
clients: e.sessions,
|
|
159
|
+
turn: x.driver.metrics()
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}), x.sessionHost);
|
|
163
|
+
if (typeof t?.close != "function") throw new e({ detail: "Room listener must return its owned close operation" });
|
|
164
|
+
if (x.listener = Object.freeze({
|
|
165
|
+
close: t.close.bind(t),
|
|
166
|
+
activate: typeof t.activate == "function" ? t.activate.bind(t) : () => {
|
|
167
|
+
throw new e({ detail: "Room listener has no activation operation" });
|
|
168
|
+
},
|
|
169
|
+
stopAdmission: typeof t.stopAdmission == "function" ? t.stopAdmission.bind(t) : async () => {
|
|
170
|
+
throw new e({ detail: "Room listener has no admission fence" });
|
|
171
|
+
}
|
|
172
|
+
}), typeof t.activate != "function" || typeof t.stopAdmission != "function") throw new e({ detail: "Room listener must return its complete owned lifetime" });
|
|
173
|
+
return S = "driver", y.startSuspended || await x.activate(), x;
|
|
174
|
+
} catch (e) {
|
|
175
|
+
e instanceof g && (x.partialListenerCleanup = e.retryCleanup), x.phase = "stopping";
|
|
176
|
+
try {
|
|
177
|
+
await x.close();
|
|
178
|
+
} catch {}
|
|
179
|
+
throw e instanceof h ? e : new h(S, () => x.close(), e);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
requireRunning() {
|
|
183
|
+
if (this.phase !== "running") throw new t({ roomId: "host" });
|
|
184
|
+
}
|
|
185
|
+
get status() {
|
|
186
|
+
return this.phase;
|
|
187
|
+
}
|
|
188
|
+
activate() {
|
|
189
|
+
if (this.activation) return this.activation;
|
|
190
|
+
if (this.phase === "running") return Promise.resolve();
|
|
191
|
+
if (this.phase !== "binding" || !this.listener) return Promise.reject(new t({ roomId: "host" }));
|
|
192
|
+
let e = (async () => {
|
|
193
|
+
let e = "driver";
|
|
194
|
+
try {
|
|
195
|
+
if (this.driver.start(), e = "activation", await this.controller.activate(), this.phase !== "binding") throw new t({ roomId: "host" });
|
|
196
|
+
this.phase = "running", this.listener.activate();
|
|
197
|
+
} catch (t) {
|
|
198
|
+
throw this.phase = "stopping", new h(e, () => this.close(), t);
|
|
199
|
+
}
|
|
200
|
+
})();
|
|
201
|
+
return this.activation = e, e.then(() => {
|
|
202
|
+
this.activation = null;
|
|
203
|
+
}, () => {
|
|
204
|
+
this.activation = null;
|
|
205
|
+
}), e;
|
|
206
|
+
}
|
|
207
|
+
drain(t) {
|
|
208
|
+
if (this.phase === "closed") return Promise.resolve();
|
|
209
|
+
let n;
|
|
210
|
+
try {
|
|
211
|
+
if (n = o(t), this.plannedDrain) {
|
|
212
|
+
if (n.graceMs !== this.plannedDrain.graceMs || n.maxCheckpointBytes !== this.plannedDrain.maxCheckpointBytes) throw new e({ detail: "Lane drain retry cannot change its retained policy" });
|
|
213
|
+
} else if (this.phase !== "running" || this.closeTask) throw new e({ detail: "Planned lane drain requires its running owner before terminal shutdown" });
|
|
214
|
+
} catch (e) {
|
|
215
|
+
return Promise.reject(e);
|
|
216
|
+
}
|
|
217
|
+
if (this.plannedDrain ??= n, this.closeTask) return this.closeTask;
|
|
218
|
+
this.phase = "stopping";
|
|
219
|
+
let r = (async () => {
|
|
220
|
+
this.admissionStopped ||= (await this.listener.stopAdmission(), !0), await this.driver.quiesce(), this.ghostsStopped ||= (await this.ghostGateway?.close(), !0), this.controllerStopped ||= (await this.controller.drain(n), !0), await this.closeListeners(), this.listener = null, this.phase = "closed";
|
|
221
|
+
})();
|
|
222
|
+
return this.closeTask = r, r.then(() => {
|
|
223
|
+
this.closeTask = null;
|
|
224
|
+
}, () => {
|
|
225
|
+
this.closeTask = null;
|
|
226
|
+
}), r;
|
|
227
|
+
}
|
|
228
|
+
async closeListeners() {
|
|
229
|
+
let e = [];
|
|
230
|
+
if (!this.listenerStopped) try {
|
|
231
|
+
await this.listener?.close(), this.listenerStopped = !0, this.admissionStopped = !0;
|
|
232
|
+
} catch (t) {
|
|
233
|
+
e.push(t);
|
|
234
|
+
}
|
|
235
|
+
if (this.partialListenerCleanup) try {
|
|
236
|
+
await this.partialListenerCleanup(), this.partialListenerCleanup = null;
|
|
237
|
+
} catch (t) {
|
|
238
|
+
e.push(t);
|
|
239
|
+
}
|
|
240
|
+
if (e.length) throw AggregateError(e, "Room listener cleanup remains incomplete");
|
|
241
|
+
}
|
|
242
|
+
close() {
|
|
243
|
+
if (this.plannedDrain) return this.drain(this.plannedDrain);
|
|
244
|
+
if (this.phase === "closed") return Promise.resolve();
|
|
245
|
+
if (this.closeTask) return this.closeTask;
|
|
246
|
+
this.phase = "stopping";
|
|
247
|
+
let e = (async () => {
|
|
248
|
+
try {
|
|
249
|
+
await this.activation;
|
|
250
|
+
} catch {}
|
|
251
|
+
let e = [];
|
|
252
|
+
if (!this.admissionStopped) try {
|
|
253
|
+
await this.listener?.stopAdmission(), this.admissionStopped = !0;
|
|
254
|
+
} catch (t) {
|
|
255
|
+
e.push(t);
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
await this.driver.quiesce();
|
|
259
|
+
} catch (t) {
|
|
260
|
+
e.push(t);
|
|
261
|
+
}
|
|
262
|
+
if (!this.ghostsStopped) try {
|
|
263
|
+
await this.ghostGateway?.close(), this.ghostsStopped = !0;
|
|
264
|
+
} catch (t) {
|
|
265
|
+
e.push(t);
|
|
266
|
+
}
|
|
267
|
+
if (!this.controllerStopped) try {
|
|
268
|
+
await this.driver.stop(), this.controllerStopped = !0;
|
|
269
|
+
} catch (t) {
|
|
270
|
+
e.push(t);
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
await this.closeListeners();
|
|
274
|
+
} catch (t) {
|
|
275
|
+
e.push(t);
|
|
276
|
+
}
|
|
277
|
+
if (e.length) throw AggregateError(e, "Room host lane cleanup remains incomplete");
|
|
278
|
+
this.listener = null, this.phase = "closed";
|
|
279
|
+
})();
|
|
280
|
+
return this.closeTask = e, e.then(() => {
|
|
281
|
+
this.closeTask = null;
|
|
282
|
+
}, () => {
|
|
283
|
+
this.closeTask = null;
|
|
284
|
+
}), e;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
//#endregion
|
|
288
|
+
export { _ as RoomHostLane, h as RoomHostLaneStartFailure, g as RoomHostListenerBindFailure };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { RoomHostListenerBindFailure as t } from "./hostLane.js";
|
|
3
|
+
import { registerRoomHostListener as n } from "./hostListenerBinding.js";
|
|
4
|
+
import { roomHostMetricsRoute as r } from "./hostMetrics.js";
|
|
5
|
+
import { Layer as i } from "effect";
|
|
6
|
+
import { awaitServerListening as a, bindBootListener as o, startRpcServer as s } from "@voltro/runtime";
|
|
7
|
+
import { RpcGroup as c } from "effect/rpc";
|
|
8
|
+
//#region src/hostListener.ts
|
|
9
|
+
var l = (l) => {
|
|
10
|
+
let u = Object.freeze({ ...l }), d = u.startupTimeoutMs ?? 1e4;
|
|
11
|
+
if (u.listener !== void 0 && u.port !== void 0 || u.listener === void 0 && (u.port === void 0 || !Number.isSafeInteger(u.port) || u.port < 0 || u.port > 65535) || !Number.isSafeInteger(d) || d < 1 || d > 2147483647 || typeof u.readiness != "function") throw new e({ detail: "Invalid Room listener configuration" });
|
|
12
|
+
let f, p = u.metricsToken === void 0 ? void 0 : r(u.metricsToken, () => {
|
|
13
|
+
if (!f) throw Error("Room metrics owner is unavailable");
|
|
14
|
+
return f();
|
|
15
|
+
}, u.metricsPreviousToken), m = !1, h = Object.freeze({ bind: async (n, r) => {
|
|
16
|
+
if (m) throw new e({ detail: "A Room listener port owns exactly one bind" });
|
|
17
|
+
m = !0, f = r.observeMetrics;
|
|
18
|
+
let l = null, h = null, g = !1, _ = null, v = [], y = () => {
|
|
19
|
+
if (g) return Promise.resolve();
|
|
20
|
+
if (_) return _;
|
|
21
|
+
let e = (async () => {
|
|
22
|
+
h ? await h.shutdown() : await l?.close();
|
|
23
|
+
for (let e of v) e();
|
|
24
|
+
v.length = 0, g = !0, h = null, l = null, f = void 0;
|
|
25
|
+
})();
|
|
26
|
+
return _ = e, e.then(() => {
|
|
27
|
+
_ = null;
|
|
28
|
+
}, () => {
|
|
29
|
+
_ = null;
|
|
30
|
+
}), e;
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
if (l = u.listener ?? await o({
|
|
34
|
+
port: u.port,
|
|
35
|
+
...u.host === void 0 ? {} : { host: u.host },
|
|
36
|
+
...u.health === void 0 ? {} : { health: u.health }
|
|
37
|
+
}), p && !f) throw new e({ detail: "Room metrics require the actual host observation owner" });
|
|
38
|
+
if (typeof r.live != "function") throw new e({ detail: "Room listener requires the actual host progress watchdog" });
|
|
39
|
+
let t = r.live.bind(r);
|
|
40
|
+
v.push(l.addLivenessGate("rooms-host", t)), v.push(l.addReadinessGate("rooms-host", () => r.ready() && t())), l.setDependencyPing(async () => r.ready() && await u.readiness()), u.onBound?.(l.port);
|
|
41
|
+
let m = c.make();
|
|
42
|
+
return h = s({
|
|
43
|
+
group: m,
|
|
44
|
+
handlersLayer: i.empty,
|
|
45
|
+
listener: l,
|
|
46
|
+
webSocketGateways: [n, ...r.worldGhostGateway ? [r.worldGhostGateway] : []],
|
|
47
|
+
...p === void 0 ? {} : { httpRoutes: [p] },
|
|
48
|
+
...u.security === void 0 ? {} : { security: u.security }
|
|
49
|
+
}), await a(h.server, d), Object.freeze({
|
|
50
|
+
activate: () => {
|
|
51
|
+
if (g || _ || !l || !r.ready()) throw new e({ detail: "Room listener activation was fenced" });
|
|
52
|
+
l.set({ phase: "ready" });
|
|
53
|
+
},
|
|
54
|
+
stopAdmission: async () => {
|
|
55
|
+
l?.set({
|
|
56
|
+
phase: "error",
|
|
57
|
+
error: "Room host is stopping"
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
close: y
|
|
61
|
+
});
|
|
62
|
+
} catch {
|
|
63
|
+
try {
|
|
64
|
+
await y();
|
|
65
|
+
} catch {
|
|
66
|
+
throw new t(y);
|
|
67
|
+
}
|
|
68
|
+
throw new e({ detail: "Room listener could not bind its native gateway" });
|
|
69
|
+
}
|
|
70
|
+
} });
|
|
71
|
+
return n(h, {
|
|
72
|
+
port: u.listener?.port ?? u.port,
|
|
73
|
+
host: u.host,
|
|
74
|
+
metricsToken: u.metricsToken,
|
|
75
|
+
metricsPreviousToken: u.metricsPreviousToken
|
|
76
|
+
}), h;
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { l as runtimeRoomHostListener };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { createHash as t } from "node:crypto";
|
|
3
|
+
//#region src/hostListenerBinding.ts
|
|
4
|
+
var n = /* @__PURE__ */ new WeakMap(), r = (e) => t("sha256").update(e).digest("hex"), i = (e, t) => {
|
|
5
|
+
n.set(e, Object.freeze({
|
|
6
|
+
port: t.port,
|
|
7
|
+
host: t.host,
|
|
8
|
+
...t.metricsToken === void 0 ? {} : { metricsDigest: r(t.metricsToken) },
|
|
9
|
+
...t.metricsPreviousToken === void 0 ? {} : { metricsPreviousDigest: r(t.metricsPreviousToken) }
|
|
10
|
+
}));
|
|
11
|
+
}, a = (e, t) => {
|
|
12
|
+
let r = n.get(t);
|
|
13
|
+
r && n.set(e, r);
|
|
14
|
+
}, o = (t, i) => {
|
|
15
|
+
let a = n.get(t);
|
|
16
|
+
if (!a || a.port !== i.port || a.host !== i.host || i.metricsToken !== void 0 && a.metricsDigest !== r(i.metricsToken) || a.metricsPreviousDigest !== (i.metricsPreviousToken === void 0 ? void 0 : r(i.metricsPreviousToken))) throw new e({ detail: "Room host provider did not apply its deployment to an owned runtime listener" });
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { o as assertRoomHostListenerDeployment, a as inheritRoomHostListener, i as registerRoomHostListener };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//#region src/hostLoopObservation.ts
|
|
2
|
+
var e = () => {
|
|
3
|
+
let e = performance.eventLoopUtilization;
|
|
4
|
+
if (typeof e != "function") throw Error("Event-loop utilization is unavailable");
|
|
5
|
+
return e.call(performance);
|
|
6
|
+
}, t = class {
|
|
7
|
+
now;
|
|
8
|
+
eventLoop;
|
|
9
|
+
buckets = /* @__PURE__ */ new Map();
|
|
10
|
+
last = 0;
|
|
11
|
+
started;
|
|
12
|
+
errors = 0;
|
|
13
|
+
active = !1;
|
|
14
|
+
loopReadings = /* @__PURE__ */ new Map();
|
|
15
|
+
constructor(t = () => performance.now(), n = e) {
|
|
16
|
+
this.now = t, this.eventLoop = n, this.started = this.read() ?? 0, this.sampleEventLoop(this.started);
|
|
17
|
+
}
|
|
18
|
+
sampleEventLoop(e) {
|
|
19
|
+
let t = Math.floor(e / 1e3);
|
|
20
|
+
if (!this.loopReadings.has(t)) {
|
|
21
|
+
try {
|
|
22
|
+
let { idle: e, active: n } = this.eventLoop();
|
|
23
|
+
Number.isFinite(e) && Number.isFinite(n) && e >= 0 && n >= 0 && this.loopReadings.set(t, {
|
|
24
|
+
idle: e,
|
|
25
|
+
active: n
|
|
26
|
+
});
|
|
27
|
+
} catch {}
|
|
28
|
+
for (let e of this.loopReadings.keys()) e < t - 61 && this.loopReadings.delete(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
eventLoopShare(e) {
|
|
32
|
+
let t = Math.floor(e / 1e3), n, r;
|
|
33
|
+
for (let e of this.loopReadings.keys()) e <= t && (n === void 0 || e > n) && (n = e), (r === void 0 || e > r) && (r = e);
|
|
34
|
+
if (n === void 0 || r === void 0 || r <= n) return null;
|
|
35
|
+
let i = this.loopReadings.get(n), a = this.loopReadings.get(r), o = a.active - i.active, s = o + a.idle - i.idle;
|
|
36
|
+
return s > 0 && o >= 0 ? Math.min(1, o / s) : null;
|
|
37
|
+
}
|
|
38
|
+
read() {
|
|
39
|
+
try {
|
|
40
|
+
let e = this.now();
|
|
41
|
+
if (!Number.isFinite(e) || e < this.last || e < 0) {
|
|
42
|
+
this.errors++;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return this.last = e, e;
|
|
46
|
+
} catch {
|
|
47
|
+
this.errors++;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
prune(e) {
|
|
52
|
+
let t = Math.floor(e / 1e3) - 60;
|
|
53
|
+
for (let e of this.buckets.keys()) e < t && this.buckets.delete(e);
|
|
54
|
+
}
|
|
55
|
+
measure(e) {
|
|
56
|
+
if (this.active) return e();
|
|
57
|
+
this.active = !0;
|
|
58
|
+
let t = this.read();
|
|
59
|
+
try {
|
|
60
|
+
return e();
|
|
61
|
+
} finally {
|
|
62
|
+
let e = this.read();
|
|
63
|
+
if (this.active = !1, e !== void 0 && (this.prune(e), this.sampleEventLoop(e), t !== void 0 && e > t)) {
|
|
64
|
+
let n = Math.max(t, (Math.floor(e / 1e3) - 60) * 1e3);
|
|
65
|
+
for (; n < e;) {
|
|
66
|
+
let t = Math.floor(n / 1e3), r = Math.min(e, (t + 1) * 1e3);
|
|
67
|
+
this.buckets.set(t, (this.buckets.get(t) ?? 0) + r - n), n = r;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
snapshot() {
|
|
73
|
+
let e = this.read() ?? this.last;
|
|
74
|
+
this.prune(e), this.sampleEventLoop(e);
|
|
75
|
+
let t = Math.floor(e / 1e3) * 1e3, n = Math.max(0, t - 6e4), r = 0;
|
|
76
|
+
for (let [e, i] of this.buckets) e * 1e3 >= n && e * 1e3 < t && (r += i);
|
|
77
|
+
let i = this.errors === 0 && t - this.started >= 6e4 && !this.active;
|
|
78
|
+
return {
|
|
79
|
+
from: n,
|
|
80
|
+
until: t,
|
|
81
|
+
coverage: this.errors > 0 ? "invalid" : i ? "complete" : "warming-up",
|
|
82
|
+
tickSeconds: r / 1e3,
|
|
83
|
+
loopUtilization: i ? r / 6e4 : null,
|
|
84
|
+
eventLoopUtilization: i ? this.eventLoopShare(n) : null,
|
|
85
|
+
clockErrors: this.errors
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { t as RoomHostLoopObservation };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldHandoffMetrics as t, worldHandoffDurationBuckets as n } from "./worldHandoffMetrics.js";
|
|
3
|
+
import { bearerMatches as r } from "@voltro/protocol/session";
|
|
4
|
+
//#region src/hostMetrics.ts
|
|
5
|
+
var i = (e) => e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n", "\\n"), a = (t) => {
|
|
6
|
+
if (typeof t != "string" || t.length < 32 || t.length > 512 || /[^A-Za-z0-9_-]/.test(t)) throw new e({ detail: "Room host metrics require a project-owned base64url credential of 32–512 characters" });
|
|
7
|
+
}, o = (e, o, s) => (a(e), s !== void 0 && a(s), Object.freeze({
|
|
8
|
+
method: "GET",
|
|
9
|
+
path: "/_voltro/rooms/metrics",
|
|
10
|
+
match: "exact",
|
|
11
|
+
handle: async (a) => {
|
|
12
|
+
let c = a.headers.authorization, l = { "Cache-Control": "no-store" };
|
|
13
|
+
if (typeof c != "string" || c.length > 519 || !c.startsWith("Bearer ") || !r("rooms-metrics", c.slice(7), e, s)) return {
|
|
14
|
+
status: 401,
|
|
15
|
+
headers: {
|
|
16
|
+
...l,
|
|
17
|
+
"WWW-Authenticate": "Bearer"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
let e = o(), r = `host="${i(e.host)}",region="${i(e.region)}"${e.pool === void 0 ? "" : `,pool="${i(e.pool)}"`}`, a = e.loop.coverage === "complete" && e.loop.loopUtilization !== null && Number.isFinite(e.loop.loopUtilization) && e.loop.loopUtilization >= 0 && e.loop.loopUtilization <= 1, s = [
|
|
22
|
+
"# HELP rooms_host_loop_observation_complete Whether a complete rolling 60 second tick window is available.",
|
|
23
|
+
"# TYPE rooms_host_loop_observation_complete gauge",
|
|
24
|
+
`rooms_host_loop_observation_complete{${r}} ${+!!a}`
|
|
25
|
+
];
|
|
26
|
+
a && s.push("# HELP rooms_host_loop_utilization Fraction of the rolling 60 second window spent in synchronous host ticks.", "# TYPE rooms_host_loop_utilization gauge", `rooms_host_loop_utilization{${r}} ${e.loop.loopUtilization}`);
|
|
27
|
+
let c = e.loop.eventLoopUtilization;
|
|
28
|
+
a && typeof c == "number" && Number.isFinite(c) && c >= 0 && c <= 1 && s.push("# HELP rooms_host_event_loop_utilization Fraction of the rolling 60 second window the event loop was busy: ticks, networking, encoding and storage callbacks.", "# TYPE rooms_host_event_loop_utilization gauge", `rooms_host_event_loop_utilization{${r}} ${c}`), typeof e.turn?.saturated == "boolean" && s.push("# HELP rooms_host_saturated Host driver exceeded its configured turn cadence within the last 60 seconds, including awaited work.", "# TYPE rooms_host_saturated gauge", `rooms_host_saturated{${r}} ${+!!e.turn.saturated}`);
|
|
29
|
+
let u = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
|
|
30
|
+
u(e.rooms) && s.push("# HELP rooms_host_rooms Rooms owned by this host, as its directory heartbeat reports them.", "# TYPE rooms_host_rooms gauge", `rooms_host_rooms{${r}} ${e.rooms}`), u(e.clients) && s.push("# HELP rooms_host_clients Client sessions served by this host, as its directory heartbeat reports them.", "# TYPE rooms_host_clients gauge", `rooms_host_clients{${r}} ${e.clients}`), typeof e.cells == "number" && Number.isSafeInteger(e.cells) && e.cells >= 0 && s.push("# HELP rooms_host_cells Confirmed live SQL World cells held by the local host and epoch, observed less than five seconds ago.", "# TYPE rooms_host_cells gauge", `rooms_host_cells{${r}} ${e.cells}`), typeof e.worldBoundaryClamps == "number" && Number.isSafeInteger(e.worldBoundaryClamps) && e.worldBoundaryClamps >= 0 && s.push("# HELP world_boundary_clamps_total Published source-cell movement corrections observed during this Host process lifetime.", "# TYPE world_boundary_clamps_total counter", `world_boundary_clamps_total{${r}} ${e.worldBoundaryClamps}`);
|
|
31
|
+
let d = t(e.worldHandoffs);
|
|
32
|
+
if (d) {
|
|
33
|
+
s.push("# HELP world_handoffs_total New seamless SQL terminal changes acknowledged during this source lifetime; excludes replay and unacknowledged outcomes.", "# TYPE world_handoffs_total counter", "# HELP world_handoff_duration_ms Time from transition creation to acknowledged seamless terminal SQL change.", "# TYPE world_handoff_duration_ms histogram");
|
|
34
|
+
for (let e of d.results) {
|
|
35
|
+
let t = `${r},result="${e.result}"`;
|
|
36
|
+
s.push(`world_handoffs_total{${t}} ${e.count}`);
|
|
37
|
+
for (let r = 0; r < n.length; r++) s.push(`world_handoff_duration_ms_bucket{${t},le="${n[r]}"} ${e.buckets[r]}`);
|
|
38
|
+
s.push(`world_handoff_duration_ms_bucket{${t},le="+Inf"} ${e.count}`, `world_handoff_duration_ms_sum{${t}} ${e.durationMs}`, `world_handoff_duration_ms_count{${t}} ${e.count}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
status: 200,
|
|
43
|
+
headers: l,
|
|
44
|
+
contentType: "text/plain; version=0.0.4; charset=utf-8",
|
|
45
|
+
body: `${s.join("\n")}\n`
|
|
46
|
+
};
|
|
47
|
+
} catch {
|
|
48
|
+
return {
|
|
49
|
+
status: 503,
|
|
50
|
+
headers: l
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
//#endregion
|
|
56
|
+
export { o as roomHostMetricsRoute };
|