@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.
- package/CHANGELOG.md +24492 -0
- package/LICENSE +61 -0
- package/README.md +9204 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +12496 -0
- package/dist/actor.js +1473 -0
- package/dist/apiBinding.js +677 -0
- package/dist/apiRegistryBinding.js +398 -0
- package/dist/apiReservations.js +432 -0
- package/dist/baselines.js +72 -0
- package/dist/bots.d.ts +1485 -0
- package/dist/bots.js +562 -0
- package/dist/catalog.js +79 -0
- package/dist/checkpointJson.js +23 -0
- package/dist/checkpointStore.js +385 -0
- package/dist/client.js +55 -0
- package/dist/clockSync.js +50 -0
- package/dist/collision.js +155 -0
- package/dist/commandDelivery.js +100 -0
- package/dist/commandRecord.js +10 -0
- package/dist/commandWithdrawal.js +182 -0
- package/dist/connection.js +496 -0
- package/dist/controlCarrier.js +374 -0
- package/dist/controlRegistry.js +78 -0
- package/dist/controlTarget.js +44 -0
- package/dist/controlTransport.js +573 -0
- package/dist/developmentBinding.js +112 -0
- package/dist/directory.js +322 -0
- package/dist/directoryProjection.js +116 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +52 -0
- package/dist/fixed.d.ts +284 -0
- package/dist/fixed.js +10 -0
- package/dist/fixed32.js +133 -0
- package/dist/fixedCollision.js +59 -0
- package/dist/fixedCollision32.js +108 -0
- package/dist/fixedMath.js +55 -0
- package/dist/fixedRaw.js +10 -0
- package/dist/fixedSlabs.js +33 -0
- package/dist/fixedTrig.js +47 -0
- package/dist/fixedTrig32.js +37 -0
- package/dist/fixedVectors.js +112 -0
- package/dist/fixedVectors32.js +94 -0
- package/dist/fixedWide.js +49 -0
- package/dist/fixedWords.js +45 -0
- package/dist/gateway.js +56 -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 +81 -0
- package/dist/geometryActorInventory.js +107 -0
- package/dist/geometryAdminClient.js +86 -0
- package/dist/geometryAdminData.js +31 -0
- package/dist/geometryAdminFixtures.js +49 -0
- package/dist/geometryAdminPorts.js +4 -0
- package/dist/geometryAdminRpc.js +57 -0
- package/dist/geometryAdminRpcRoutes.js +48 -0
- package/dist/geometryAdminSchemas.js +38 -0
- package/dist/geometryAdministration.js +189 -0
- package/dist/geometryAdministrationPorts.js +4 -0
- package/dist/geometryApiBinding.js +164 -0
- package/dist/geometryAppStorage.js +57 -0
- package/dist/geometryArtifacts.js +197 -0
- package/dist/geometryAssetBundle.js +116 -0
- package/dist/geometryAssetClient.js +24 -0
- package/dist/geometryAssetData.js +105 -0
- package/dist/geometryAssetHttp.js +122 -0
- package/dist/geometryAssetPorts.js +4 -0
- package/dist/geometryAssetRpc.js +29 -0
- package/dist/geometryAssetRpcRoutes.js +39 -0
- package/dist/geometryAssetStorageGrant.js +102 -0
- package/dist/geometryBoxOverlap.js +109 -0
- package/dist/geometryCatalogueDigest.js +110 -0
- package/dist/geometryCellCoverage.js +84 -0
- package/dist/geometryCellLoader.js +27 -0
- package/dist/geometryChannel.js +133 -0
- package/dist/geometryChunkHttp.js +53 -0
- package/dist/geometryChunkLeases.js +21 -0
- package/dist/geometryClient.d.ts +1429 -0
- package/dist/geometryClient.js +148 -0
- package/dist/geometryClientChunks.js +329 -0
- package/dist/geometryClientDelta.js +24 -0
- package/dist/geometryClientHttp.js +36 -0
- package/dist/geometryClientInterest.js +108 -0
- package/dist/geometryClientStatic.js +33 -0
- package/dist/geometryCms.d.ts +763 -0
- package/dist/geometryCms.js +216 -0
- package/dist/geometryCommitCoordinator.js +240 -0
- package/dist/geometryCompactionFixture.js +83 -0
- package/dist/geometryCompactionStrategies.js +37 -0
- package/dist/geometryConnectionClient.js +22 -0
- package/dist/geometryDerivationFixtures.js +140 -0
- package/dist/geometryDerivationStrategies.js +26 -0
- package/dist/geometryDigest.js +12 -0
- package/dist/geometryEditChannel.js +69 -0
- package/dist/geometryEditIngress.js +262 -0
- package/dist/geometryEdits.js +365 -0
- package/dist/geometryEnvelope.js +40 -0
- package/dist/geometryGridRaycast.js +91 -0
- package/dist/geometryGridSweep.js +91 -0
- package/dist/geometryHeightfield.js +165 -0
- package/dist/geometryHeightfieldRaycast.js +73 -0
- package/dist/geometryHeightfieldSweep.js +84 -0
- package/dist/geometryHeightfieldVolume.js +44 -0
- package/dist/geometryHost.js +321 -0
- package/dist/geometryHostDirectory.js +206 -0
- package/dist/geometryHostMutations.js +136 -0
- package/dist/geometryHostStreams.js +123 -0
- package/dist/geometryHttpBody.js +75 -0
- package/dist/geometryHttpRoutes.js +111 -0
- package/dist/geometryImportGltf.js +299 -0
- package/dist/geometryImportLdtk.js +53 -0
- package/dist/geometryImportPng.js +143 -0
- package/dist/geometryImportPublication.js +66 -0
- package/dist/geometryImportTiled.js +38 -0
- package/dist/geometryImportTiles.js +135 -0
- package/dist/geometryImportVox.js +129 -0
- package/dist/geometryImportedSource.js +100 -0
- package/dist/geometryInspectEndpoint.js +247 -0
- package/dist/geometryInspection.js +91 -0
- package/dist/geometryInstall.js +120 -0
- package/dist/geometryJournalArchiveData.js +20 -0
- package/dist/geometryJournalArchiveIndex.js +329 -0
- package/dist/geometryJournalArchiveTable.js +20 -0
- package/dist/geometryJournalCompaction.js +99 -0
- package/dist/geometryJournalPatch.js +46 -0
- package/dist/geometryJournalRetention.js +111 -0
- package/dist/geometryJournalRetentionSchemas.js +35 -0
- package/dist/geometryJournalRetentionSweep.js +111 -0
- package/dist/geometryJournalRetentionWorkflow.js +27 -0
- package/dist/geometryJournalRetentionWorkflowData.js +30 -0
- package/dist/geometryJournalStorage.js +147 -0
- package/dist/geometryLoader.js +117 -0
- package/dist/geometryManifest.js +112 -0
- package/dist/geometryManifestChannel.js +92 -0
- package/dist/geometryManifestClient.js +121 -0
- package/dist/geometryManifestData.js +48 -0
- package/dist/geometryManifestPorts.js +4 -0
- package/dist/geometryManifestPublication.js +108 -0
- package/dist/geometryManifestSource.js +67 -0
- package/dist/geometryMigrationJournal.js +13 -0
- package/dist/geometryMigrationStrategies.js +6 -0
- package/dist/geometryMigrations.js +322 -0
- package/dist/geometryNativeMetadata.js +51 -0
- package/dist/geometryPatch.js +169 -0
- package/dist/geometryPersistence.js +448 -0
- package/dist/geometryPersistenceCapture.js +68 -0
- package/dist/geometryPersistenceData.js +139 -0
- package/dist/geometryPersistencePorts.js +4 -0
- package/dist/geometryPlayerAdmission.js +33 -0
- package/dist/geometryPlayerEditOwner.js +264 -0
- package/dist/geometryPlayerEdits.js +48 -0
- package/dist/geometryPrepared.js +187 -0
- package/dist/geometryPrivacyFence.js +23 -0
- package/dist/geometryProceduralPublication.js +90 -0
- package/dist/geometryProceduralWorker.js +163 -0
- package/dist/geometryPublication.js +109 -0
- package/dist/geometryRayAlgebra.js +115 -0
- package/dist/geometryReadClient.js +156 -0
- package/dist/geometryReadPorts.js +4 -0
- package/dist/geometryReadRpc.js +26 -0
- package/dist/geometryReadRpcRoutes.js +46 -0
- package/dist/geometryReliablePublication.js +81 -0
- package/dist/geometryReloadPorts.js +45 -0
- package/dist/geometryReloadSource.js +277 -0
- package/dist/geometryRenderCache.js +164 -0
- package/dist/geometryRenderLod.js +101 -0
- package/dist/geometryRollback.js +124 -0
- package/dist/geometryRollbackCoordinator.js +202 -0
- package/dist/geometryRollbackPorts.js +45 -0
- package/dist/geometryRollbackSource.js +208 -0
- package/dist/geometryRollbackStore.js +197 -0
- package/dist/geometrySchemas.js +26 -0
- package/dist/geometryServer.d.ts +2766 -0
- package/dist/geometryServer.js +62 -0
- package/dist/geometryShapeRaycast.js +110 -0
- package/dist/geometryShapeSegments.js +33 -0
- package/dist/geometryShapes.js +222 -0
- package/dist/geometrySnapshot.js +75 -0
- package/dist/geometrySnapshotChannel.js +159 -0
- package/dist/geometrySnapshotClient.js +158 -0
- package/dist/geometrySnapshotPreparation.js +75 -0
- package/dist/geometrySnapshotServer.js +190 -0
- package/dist/geometrySqlOwner.js +20 -0
- package/dist/geometryStorage.js +126 -0
- package/dist/geometryStorageGrant.js +68 -0
- package/dist/geometryStorageIdentity.js +8 -0
- package/dist/geometryTileArtifact.js +9 -0
- package/dist/geometryTileCodec.js +193 -0
- package/dist/geometryTileCollision.js +95 -0
- package/dist/geometryTileNavigation.js +127 -0
- package/dist/geometryTileView.js +34 -0
- package/dist/geometryVersionActivation.js +113 -0
- package/dist/geometryVersionClient.js +237 -0
- package/dist/geometryVersionCompare.js +39 -0
- package/dist/geometryVersionMigration.js +105 -0
- package/dist/geometryVoxel.js +252 -0
- package/dist/geometryWorldEntitySubject.js +31 -0
- package/dist/geometryWorldExtent.js +11 -0
- package/dist/geometryWorldMetadata.js +37 -0
- package/dist/geometryWorldStrategyFixtures.js +126 -0
- package/dist/geometryWorldView.js +306 -0
- package/dist/host.js +127 -0
- package/dist/hostBinding.js +276 -0
- package/dist/hostCellObservation.js +113 -0
- package/dist/hostClientCapacity.js +89 -0
- package/dist/hostCommandScope.js +63 -0
- package/dist/hostController.js +3093 -0
- package/dist/hostDeployment.js +64 -0
- package/dist/hostDrain.js +151 -0
- package/dist/hostDrainPorts.js +4 -0
- package/dist/hostDriver.js +178 -0
- package/dist/hostLane.js +287 -0
- package/dist/hostListener.js +78 -0
- package/dist/hostListenerBinding.js +18 -0
- package/dist/hostLoopObservation.js +89 -0
- package/dist/hostMetrics.js +55 -0
- package/dist/hostRegistryBinding.js +417 -0
- package/dist/hostSelection.js +15 -0
- package/dist/hostShutdown.js +46 -0
- package/dist/hostTurnObservation.js +52 -0
- package/dist/identities.js +3 -0
- package/dist/index.d.ts +8632 -0
- package/dist/index.js +231 -0
- package/dist/inputReceipts.js +62 -0
- package/dist/inputRedundancy.js +54 -0
- package/dist/inspect.js +237 -0
- package/dist/lockstep.d.ts +436 -0
- package/dist/lockstep.js +381 -0
- package/dist/lockstepAdmission.js +261 -0
- package/dist/lockstepAdmissionCodec.js +93 -0
- package/dist/lockstepAdmissionPorts.js +4 -0
- package/dist/lockstepClientSession.js +577 -0
- package/dist/lockstepDefinition.js +147 -0
- package/dist/lockstepHostLoop.js +242 -0
- package/dist/lockstepInitialAdmission.js +66 -0
- package/dist/lockstepInitialStrategyFixtures.js +44 -0
- package/dist/lockstepJournal.js +394 -0
- package/dist/lockstepJournalCodec.js +253 -0
- package/dist/lockstepJournalPorts.js +4 -0
- package/dist/lockstepJournalRebuild.js +207 -0
- package/dist/lockstepJournalRows.js +56 -0
- package/dist/lockstepMembers.js +130 -0
- package/dist/lockstepMessages.js +46 -0
- package/dist/lockstepOwnedRoom.js +763 -0
- package/dist/lockstepPolicies.js +83 -0
- package/dist/lockstepReact.js +46 -0
- package/dist/lockstepRecoveryTruth.js +120 -0
- package/dist/lockstepRosterConfig.js +31 -0
- package/dist/lockstepSeed.js +11 -0
- package/dist/lockstepSeedFixture.js +19 -0
- package/dist/lockstepServer.d.ts +3897 -0
- package/dist/lockstepServer.js +324 -0
- package/dist/lockstepServerConfig.js +100 -0
- package/dist/lockstepServerRoles.js +402 -0
- package/dist/lockstepServerStrategyFixtures.js +32 -0
- package/dist/lockstepStrategies.js +5 -0
- package/dist/lockstepStrategyFixtures.js +136 -0
- package/dist/lockstepTerminal.js +89 -0
- package/dist/lockstepTerminalPorts.js +4 -0
- package/dist/lockstepTransport.js +772 -0
- package/dist/lockstepTransportConfig.js +31 -0
- package/dist/lockstepWireRoster.js +33 -0
- package/dist/matchRoomProvider.js +31 -0
- package/dist/matchRooms.js +18 -0
- package/dist/membershipObserver.js +46 -0
- package/dist/moderation.js +97 -0
- package/dist/movementSpecials.js +103 -0
- package/dist/ownership.js +16 -0
- package/dist/ownershipWithdrawal.js +17 -0
- package/dist/pcg32.js +95 -0
- package/dist/ports.d.ts +1241 -0
- package/dist/ports.js +10 -0
- package/dist/quaternion.js +69 -0
- package/dist/react.d.ts +406 -0
- package/dist/react.js +108 -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 +242 -0
- package/dist/reaperSchemas.js +41 -0
- package/dist/reaperWorkflow.js +69 -0
- package/dist/recovery.js +188 -0
- package/dist/recoverySeats.js +25 -0
- package/dist/replay.d.ts +273 -0
- package/dist/replay.js +484 -0
- package/dist/replayPorts.js +4 -0
- package/dist/replayRecording.js +66 -0
- package/dist/replaySchema.js +156 -0
- package/dist/replayStorage.d.ts +149 -0
- package/dist/replayStorage.js +484 -0
- package/dist/reservationBatch.js +421 -0
- package/dist/reservationSchemas.js +16 -0
- package/dist/reservations.js +258 -0
- package/dist/reservePort.js +68 -0
- package/dist/resolvedOptions.js +3 -0
- package/dist/room.d.ts +1006 -0
- package/dist/room.js +283 -0
- package/dist/roomAccessSweep.js +94 -0
- package/dist/roomAppCommandControl.js +58 -0
- package/dist/roomAuthoringStrategy.js +16 -0
- package/dist/roomErasure.js +197 -0
- package/dist/roomPoolRuntimeDefaults.js +23 -0
- package/dist/roomPoolSelection.js +18 -0
- package/dist/roomPoolTopology.js +211 -0
- package/dist/rpc.d.ts +551 -0
- package/dist/rpc.js +111 -0
- package/dist/rpcClient.js +151 -0
- package/dist/rpcRoutes.js +27 -0
- package/dist/runtime.js +1122 -0
- package/dist/schemaHistory.js +97 -0
- package/dist/seatStore.js +150 -0
- package/dist/seatStrategyFixtures.js +51 -0
- package/dist/seatSubject.js +31 -0
- package/dist/seats.js +129 -0
- package/dist/serverSession.js +810 -0
- package/dist/serverSessionConfig.js +42 -0
- package/dist/sessionAdmission.js +52 -0
- package/dist/sidecarAdmission.js +102 -0
- package/dist/sidecarConfig.js +115 -0
- package/dist/sidecarConfigPublication.js +63 -0
- package/dist/sidecarHostListener.js +207 -0
- package/dist/sidecarIpc.js +204 -0
- package/dist/sidecarPeer.js +309 -0
- package/dist/sidecarProcessPort.js +27 -0
- package/dist/sidecarRuntime.js +167 -0
- package/dist/sidecarSelection.js +141 -0
- package/dist/sidecarWire.js +177 -0
- package/dist/sidecarWrites.js +162 -0
- package/dist/simulation.d.ts +391 -0
- package/dist/simulation.js +281 -0
- package/dist/simulationAuthoring.js +28 -0
- package/dist/simulationBytes.js +26 -0
- package/dist/simulationConformance.js +304 -0
- package/dist/simulationInputHistoryCapture.js +34 -0
- package/dist/simulationInputHistoryWire.js +192 -0
- package/dist/simulationOptionsWire.js +77 -0
- package/dist/simulationRecoveryWire.js +133 -0
- package/dist/simulationReplay.js +126 -0
- package/dist/simulationSnapshotWire.js +111 -0
- package/dist/simulationState.js +177 -0
- package/dist/snapshotBlob.js +125 -0
- package/dist/snapshotBlobCleanup.js +92 -0
- package/dist/snapshotBlobIndex.js +37 -0
- package/dist/snapshotBudget.js +79 -0
- package/dist/snapshotChain.js +184 -0
- package/dist/snapshotErasure.js +171 -0
- package/dist/snapshotInspection.js +104 -0
- package/dist/snapshotSegmentBlobs.js +57 -0
- package/dist/snapshotUploads.js +165 -0
- package/dist/socketTransport.js +252 -0
- package/dist/spatial.js +103 -0
- package/dist/spectatorPolicy.js +25 -0
- package/dist/spectatorProducer.js +88 -0
- package/dist/startFailureCause.js +3 -0
- package/dist/stateCodec.js +657 -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 +181 -0
- package/dist/streamFraming.js +121 -0
- package/dist/streamTransport.js +265 -0
- package/dist/subjectAdmission.js +49 -0
- package/dist/subjectPrivacy.js +280 -0
- package/dist/subjectPrivacyBinding.js +89 -0
- package/dist/systemManifest.js +181 -0
- package/dist/tables.js +158 -0
- package/dist/testHarness.js +88 -0
- package/dist/testing.d.ts +3684 -0
- package/dist/testing.js +220 -0
- package/dist/testingPorts.js +270 -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 +216 -0
- package/dist/transform3d.js +117 -0
- package/dist/transformCollection.js +23 -0
- package/dist/transformCollection3d.js +23 -0
- package/dist/transformCollectionCore.js +155 -0
- package/dist/transformFrames.js +120 -0
- package/dist/transformPrediction3d.js +126 -0
- package/dist/transformRules.js +122 -0
- package/dist/transformSchemas.js +19 -0
- package/dist/transport.js +31 -0
- package/dist/transportAuthoring.js +28 -0
- package/dist/transportCleanup.js +21 -0
- package/dist/transportConformance.js +123 -0
- package/dist/transportConnector.js +81 -0
- package/dist/transportEndpoints.js +37 -0
- package/dist/transportsServer.d.ts +5515 -0
- package/dist/transportsServer.js +6 -0
- package/dist/viewProjection.js +15 -0
- package/dist/web.d.ts +2286 -0
- package/dist/web.js +517 -0
- package/dist/webTransportClient.js +172 -0
- package/dist/wire.d.ts +992 -0
- package/dist/wire.js +491 -0
- package/dist/withdrawalPort.js +27 -0
- package/dist/world.d.ts +1894 -0
- package/dist/world.js +332 -0
- package/dist/worldActorReceipts.js +47 -0
- package/dist/worldActorTransferSnapshot.js +13 -0
- package/dist/worldAdmissionPending.js +7 -0
- package/dist/worldBoundaryCoordinator.js +147 -0
- package/dist/worldCatalog.js +80 -0
- package/dist/worldCellAllocation.js +202 -0
- package/dist/worldCellDestination.js +67 -0
- package/dist/worldCells.js +488 -0
- package/dist/worldChange.js +31 -0
- package/dist/worldClient.js +663 -0
- package/dist/worldClientControl.js +140 -0
- package/dist/worldClientPendingInput.js +15 -0
- package/dist/worldClientRpc.js +132 -0
- package/dist/worldClientRpcRoutes.js +42 -0
- package/dist/worldClientSchemas.js +27 -0
- package/dist/worldCommands.js +139 -0
- package/dist/worldData.js +41 -0
- package/dist/worldDefaultBinding.js +376 -0
- package/dist/worldDefaultGroupAdmission.js +81 -0
- package/dist/worldDefaultGroupAppServices.js +30 -0
- package/dist/worldDefaultGroupCompensation.js +108 -0
- package/dist/worldDefaultGroupContinuation.js +95 -0
- package/dist/worldDefaultGroupControl.js +71 -0
- package/dist/worldDefaultGroupMembers.js +84 -0
- package/dist/worldDefaultGroups.js +20 -0
- package/dist/worldDefaultPending.js +78 -0
- package/dist/worldDefaultService.js +244 -0
- package/dist/worldEntities.js +2979 -0
- package/dist/worldEntityCodec.js +20 -0
- package/dist/worldEntityHandoffView.js +153 -0
- package/dist/worldGeometry.js +169 -0
- package/dist/worldGhostAdmission.js +64 -0
- package/dist/worldGhostDestination.js +117 -0
- package/dist/worldGhostGateway.js +131 -0
- package/dist/worldGhostHandshake.js +107 -0
- package/dist/worldGhostHost.js +41 -0
- package/dist/worldGhostIngress.js +131 -0
- package/dist/worldGhostNeighborhood.js +69 -0
- package/dist/worldGhostNeighbors.js +85 -0
- package/dist/worldGhostOutbound.js +109 -0
- package/dist/worldGhostPublisher.js +215 -0
- package/dist/worldGhostReceiver.js +212 -0
- package/dist/worldGhostSender.js +145 -0
- package/dist/worldGhostSocket.js +77 -0
- package/dist/worldGhostWire.js +171 -0
- package/dist/worldGroupCommand.js +48 -0
- package/dist/worldGroupDeadline.js +114 -0
- package/dist/worldGroupPreparation.js +114 -0
- package/dist/worldGroupReadyControl.js +127 -0
- package/dist/worldGroupSupervisor.js +119 -0
- package/dist/worldHandoffMetrics.js +58 -0
- package/dist/worldHandoffView.js +99 -0
- package/dist/worldHostSource.js +68 -0
- package/dist/worldInspectEndpoint.js +249 -0
- package/dist/worldInspection.js +108 -0
- package/dist/worldInstanceAdmission.js +30 -0
- package/dist/worldInstanceAllocation.js +115 -0
- package/dist/worldInstanceDestination.js +63 -0
- package/dist/worldInstanceExpiry.js +281 -0
- package/dist/worldInstanceExpirySupervisor.js +87 -0
- package/dist/worldInstanceLifecycle.js +102 -0
- package/dist/worldInstanceState.js +51 -0
- package/dist/worldInstances.js +477 -0
- package/dist/worldJoin.js +55 -0
- package/dist/worldLayers.js +150 -0
- package/dist/worldLeases.js +77 -0
- package/dist/worldManifest.js +24 -0
- package/dist/worldMovement.js +62 -0
- package/dist/worldPersistence.js +133 -0
- package/dist/worldProjection.js +220 -0
- package/dist/worldReact.js +109 -0
- package/dist/worldRecoveryActor.js +34 -0
- package/dist/worldReturnAnchor.js +48 -0
- package/dist/worldRoomHooks.js +56 -0
- package/dist/worldRoomPool.js +26 -0
- package/dist/worldRoomSteps.js +132 -0
- package/dist/worldSeatBinding.js +35 -0
- package/dist/worldServer.d.ts +6936 -0
- package/dist/worldServer.js +48 -0
- package/dist/worldSourceSeatPending.js +8 -0
- package/dist/worldStrategyFixtures.js +163 -0
- package/dist/worldTesting.js +26 -0
- package/dist/worldTransitionDefaults.js +197 -0
- package/dist/worldTransitionExecutor.js +518 -0
- package/dist/worldTransitionGroup.js +112 -0
- package/dist/worldTransitionPhysicalSteps.js +39 -0
- package/dist/worldTransitionResolver.js +227 -0
- package/dist/worldTransitionSeatGroup.js +63 -0
- package/dist/worldTransitionSeats.js +259 -0
- package/dist/worldTransitionState.js +94 -0
- package/dist/worldTransitions.js +100 -0
- package/package.json +189 -4
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { bindWorldTransitionCommandHandlers as t } from "./worldCommands.js";
|
|
3
|
+
import { captureWorldCatalog as n, worldCellAt as r } from "./world.js";
|
|
4
|
+
import { dataStoreWorldCells as i } from "./worldCells.js";
|
|
5
|
+
import { WORLD_ENTITIES_TABLE as a, dataStoreWorldEntities as o } from "./worldEntities.js";
|
|
6
|
+
import { dataStoreWorldCellAllocation as s, nextWorldCellGeneration as c } from "./worldCellAllocation.js";
|
|
7
|
+
import { makeWorldTransitionLeases as l } from "./worldLeases.js";
|
|
8
|
+
import { remoteWorldRoomSteps as u, routedWorldRoomSteps as d } from "./worldRoomSteps.js";
|
|
9
|
+
import { defaultWorldClientAuthority as f } from "./worldTransitionDefaults.js";
|
|
10
|
+
import { defaultWorldComponents as p, defaultWorldGroupService as m, defaultWorldService as h, forwardedWorldTransitionExecutor as g } from "./worldDefaultService.js";
|
|
11
|
+
import { defaultWorldPending as _ } from "./worldDefaultPending.js";
|
|
12
|
+
import { makeWorldClientControl as v } from "./worldClientControl.js";
|
|
13
|
+
import { dataStoreWorldInstanceAllocation as y } from "./worldInstanceAllocation.js";
|
|
14
|
+
import { makeWorldJoin as b } from "./worldJoin.js";
|
|
15
|
+
import { makeDefaultWorldGroups as x } from "./worldDefaultGroups.js";
|
|
16
|
+
import { defaultWorldGroupControl as S } from "./worldDefaultGroupControl.js";
|
|
17
|
+
import { defaultWorldGroupContinuation as C } from "./worldDefaultGroupContinuation.js";
|
|
18
|
+
import { and as w, eq as T } from "@voltro/database";
|
|
19
|
+
import { Subject as E } from "@voltro/protocol";
|
|
20
|
+
import { Effect as D, Schema as O } from "effect";
|
|
21
|
+
// src/worldDefaultBinding.ts
|
|
22
|
+
var k = "rooms-world", A = 16384, j = 1024, M = (t) => new e({ detail: t }), N = (e) => {
|
|
23
|
+
let t = /* @__PURE__ */ new Map();
|
|
24
|
+
return (n) => {
|
|
25
|
+
let r = t.get(n);
|
|
26
|
+
return r === void 0 && (t.size >= j && t.delete(t.keys().next().value), r = e(n), t.set(n, r)), r;
|
|
27
|
+
};
|
|
28
|
+
}, P = (e, t, n, r, i = A, s) => o(e, {
|
|
29
|
+
worlds: t,
|
|
30
|
+
epochNow: n,
|
|
31
|
+
maxDataBytes: i,
|
|
32
|
+
maxJournalBytes: i * 2,
|
|
33
|
+
maxPrivacyEntities: 256,
|
|
34
|
+
maxPrivacyJournal: 4096,
|
|
35
|
+
maxBatchRows: 64,
|
|
36
|
+
authorize: () => D.void,
|
|
37
|
+
quiesceSubject: (t) => D.tryPromise({
|
|
38
|
+
try: () => e.query({
|
|
39
|
+
table: a,
|
|
40
|
+
predicate: w(T("tenantId", t.tenantId), T("subjectId", t.subject.id), T("subjectKind", t.subject.kind)),
|
|
41
|
+
order: [],
|
|
42
|
+
take: 257,
|
|
43
|
+
skip: void 0,
|
|
44
|
+
projection: ["activeTransitionId"]
|
|
45
|
+
}),
|
|
46
|
+
catch: () => M("World Subject quiescence is unavailable")
|
|
47
|
+
}).pipe(D.flatMap((e) => e.some((e) => e.activeTransitionId != null) ? D.fail(M("World Subject still has an active transition")) : D.void)),
|
|
48
|
+
...r ? { transitions: {
|
|
49
|
+
maxPrivacyRows: 1024,
|
|
50
|
+
authorize: () => D.void,
|
|
51
|
+
...s === void 0 ? {} : { groups: s }
|
|
52
|
+
} } : {}
|
|
53
|
+
}), F = (e, t, n, r, i = A) => P(e, t, n, r, i), I = (e, t) => {
|
|
54
|
+
if (!t) throw M("Only a player allocates World Rooms");
|
|
55
|
+
return O.decodeUnknownSync(E)({
|
|
56
|
+
type: "user",
|
|
57
|
+
id: t.id,
|
|
58
|
+
tenantId: e,
|
|
59
|
+
...t.kind === "guest" ? { kind: "guest" } : {}
|
|
60
|
+
});
|
|
61
|
+
}, L = (e) => Object.freeze({
|
|
62
|
+
roomId: e.roomId,
|
|
63
|
+
hostId: e.hostId,
|
|
64
|
+
epoch: e.epoch
|
|
65
|
+
}), R = (e, t, n, r, i) => ({
|
|
66
|
+
cell: (a, o) => D.suspend(() => {
|
|
67
|
+
let l = I(t, o), u = n.find((e) => e.name === a.worldId), d = {
|
|
68
|
+
worldId: a.worldId,
|
|
69
|
+
zoneId: a.zoneId,
|
|
70
|
+
at: a.at,
|
|
71
|
+
layer: a.layer
|
|
72
|
+
};
|
|
73
|
+
return u ? D.tryPromise({
|
|
74
|
+
try: () => c(e, t, u, d),
|
|
75
|
+
catch: () => M("World Room preparation did not complete")
|
|
76
|
+
}).pipe(D.flatMap((a) => s(e, {
|
|
77
|
+
tenantId: t,
|
|
78
|
+
worlds: n,
|
|
79
|
+
epochNow: r,
|
|
80
|
+
authorize: () => D.void,
|
|
81
|
+
authorizeRecreation: () => D.void,
|
|
82
|
+
prepare: (e) => i({
|
|
83
|
+
room: e.roomName,
|
|
84
|
+
creationKey: e.creationKey,
|
|
85
|
+
generation: e.generation,
|
|
86
|
+
hostId: e.existing?.hostId ?? void 0,
|
|
87
|
+
worldCell: {
|
|
88
|
+
worldId: e.placement.worldId,
|
|
89
|
+
zoneId: e.placement.zoneId,
|
|
90
|
+
at: [e.placement.at[0], e.placement.at[1]],
|
|
91
|
+
layer: e.placement.layer
|
|
92
|
+
}
|
|
93
|
+
}, l).pipe(D.map(L))
|
|
94
|
+
}).ensure(d, a))).pipe(D.asVoid) : D.fail(M("World Room preparation did not complete"));
|
|
95
|
+
}),
|
|
96
|
+
instance: (a, o) => D.suspend(() => {
|
|
97
|
+
let s = I(t, o);
|
|
98
|
+
return y(e, {
|
|
99
|
+
tenantId: t,
|
|
100
|
+
worlds: n,
|
|
101
|
+
epochNow: r,
|
|
102
|
+
maxManagedGroups: 1024,
|
|
103
|
+
authorize: () => D.void,
|
|
104
|
+
prepare: (e) => i({
|
|
105
|
+
room: e.roomName,
|
|
106
|
+
creationKey: e.creationKey,
|
|
107
|
+
generation: e.generation,
|
|
108
|
+
hostId: e.existing?.hostId ?? void 0,
|
|
109
|
+
worldInstance: {
|
|
110
|
+
tenantId: e.identity.tenantId,
|
|
111
|
+
worldId: e.identity.worldId,
|
|
112
|
+
instance: e.identity.instance,
|
|
113
|
+
groupId: e.identity.groupId
|
|
114
|
+
}
|
|
115
|
+
}, s).pipe(D.map(L))
|
|
116
|
+
}).ensure(a).pipe(D.asVoid);
|
|
117
|
+
})
|
|
118
|
+
}), z = Object.freeze({
|
|
119
|
+
transition: "world.transition",
|
|
120
|
+
transitionGroup: "world.transitionGroup"
|
|
121
|
+
}), B = (e, r) => {
|
|
122
|
+
let { store: i, catalog: a, world: o, ownership: s, epochNow: c } = e, d = n(e.worlds), y = e.maxBytes ?? 16384;
|
|
123
|
+
if (e.authority === "api" && !e.hot) throw M("World authority \"api\" needs the HotStore the Hosts verify leases against");
|
|
124
|
+
if (r && (!e.transitionsEnabled || !e.clientControls || typeof r.runWithAppServices != "function")) throw M("Default World groups need transition state, player controls and application services");
|
|
125
|
+
let w = r ? x((e) => P(i, d, c, !0, y, e)) : void 0, T = w?.entities ?? F(i, d, c, e.transitionsEnabled, y), E = !1, O = (e, t, n) => D.gen(function* () {
|
|
126
|
+
let r = o.bindAdmission;
|
|
127
|
+
if (!r) return yield* D.fail(M("World group target admission is unavailable"));
|
|
128
|
+
let i = yield* s(e.target.roomId, e.origin.tenantId).pipe(D.mapError(() => M("World group target admission is unavailable")));
|
|
129
|
+
return !i?.hostId || i.state !== "live" || i.epoch !== e.target.epoch ? yield* D.fail(M("World group target admission is unavailable")) : yield* r(i.hostId, {
|
|
130
|
+
roomId: e.target.roomId,
|
|
131
|
+
sessionId: t,
|
|
132
|
+
epoch: e.target.epoch
|
|
133
|
+
}, n).pipe(D.mapError(() => M("World group target admission is unavailable")));
|
|
134
|
+
}), A = u({
|
|
135
|
+
world: o,
|
|
136
|
+
ownership: s
|
|
137
|
+
}), j = (t) => R(i, t, d, c, (n, r) => {
|
|
138
|
+
let { hostId: i, ...a } = n;
|
|
139
|
+
return (i === void 0 ? e.selectHost(n.room, t) : D.succeed(i)).pipe(D.mapError(() => M("No Rooms Host is ready for a new World Room")), D.flatMap((e) => o.prepareRoom(e, a, r).pipe(D.mapError(() => M("World Room preparation did not complete")))));
|
|
140
|
+
}), L = N((t) => {
|
|
141
|
+
let n = j(t), u = {
|
|
142
|
+
store: i,
|
|
143
|
+
tenantId: t,
|
|
144
|
+
worlds: d,
|
|
145
|
+
catalog: a,
|
|
146
|
+
entities: T,
|
|
147
|
+
rooms: A,
|
|
148
|
+
epochNow: c,
|
|
149
|
+
maxBytes: y,
|
|
150
|
+
allocation: n,
|
|
151
|
+
seats: e.signing
|
|
152
|
+
}, x = p(u, w ? 64 : 1), C = e.authority === "host" ? g({
|
|
153
|
+
world: o,
|
|
154
|
+
ownership: s,
|
|
155
|
+
states: T.transitions
|
|
156
|
+
}) : w ? m({
|
|
157
|
+
...u,
|
|
158
|
+
leases: l(e.hot, {
|
|
159
|
+
namespace: k,
|
|
160
|
+
tenantId: t,
|
|
161
|
+
ttlMs: 3e4
|
|
162
|
+
})
|
|
163
|
+
}, w, (e) => e.ready ? O(e, e.ready.sessionId, I(t, e.subject)) : D.fail(M("World group target admission is unavailable"))).executor : h({
|
|
164
|
+
...u,
|
|
165
|
+
leases: l(e.hot, {
|
|
166
|
+
namespace: k,
|
|
167
|
+
tenantId: t,
|
|
168
|
+
ttlMs: 3e4
|
|
169
|
+
})
|
|
170
|
+
}).executor, E = x.seats, N = w && r ? S({
|
|
171
|
+
store: i,
|
|
172
|
+
tenantId: t,
|
|
173
|
+
groups: w,
|
|
174
|
+
executor: C,
|
|
175
|
+
resolve: x.resolve,
|
|
176
|
+
parties: r.parties,
|
|
177
|
+
runWithAppServices: r.runWithAppServices,
|
|
178
|
+
epochNow: c,
|
|
179
|
+
bindAdmission: O
|
|
180
|
+
}) : void 0, P = b({
|
|
181
|
+
tenantId: t,
|
|
182
|
+
worlds: d,
|
|
183
|
+
entities: T,
|
|
184
|
+
reserve: e.reserve,
|
|
185
|
+
allocateCell: (e, r) => n.cell({
|
|
186
|
+
tenantId: t,
|
|
187
|
+
...e
|
|
188
|
+
}, {
|
|
189
|
+
id: r.id,
|
|
190
|
+
kind: r.type === "user" && r.kind === "guest" ? "guest" : "user"
|
|
191
|
+
}).pipe(D.flatMap(() => H(i, d, c, t, e)))
|
|
192
|
+
}), F = v({
|
|
193
|
+
tenantId: t,
|
|
194
|
+
worlds: d,
|
|
195
|
+
executor: C,
|
|
196
|
+
seats: E,
|
|
197
|
+
join: P,
|
|
198
|
+
...N === void 0 ? {} : {
|
|
199
|
+
groupReady: N.ready,
|
|
200
|
+
groupCancel: { cancel: N.cancel }
|
|
201
|
+
},
|
|
202
|
+
...f({
|
|
203
|
+
store: i,
|
|
204
|
+
tenantId: t,
|
|
205
|
+
worlds: d,
|
|
206
|
+
epochNow: c
|
|
207
|
+
})
|
|
208
|
+
}), L = _({
|
|
209
|
+
store: i,
|
|
210
|
+
tenantId: t,
|
|
211
|
+
worlds: d,
|
|
212
|
+
observe: F.observe.bind(F)
|
|
213
|
+
});
|
|
214
|
+
return Object.freeze({
|
|
215
|
+
service: Object.freeze({
|
|
216
|
+
...F,
|
|
217
|
+
pending: L
|
|
218
|
+
}),
|
|
219
|
+
executor: C,
|
|
220
|
+
groupControl: N
|
|
221
|
+
});
|
|
222
|
+
}), B = (e) => e.type === "user" ? e.tenantId : null, V = (e, t) => {
|
|
223
|
+
let n = B(e);
|
|
224
|
+
if (!n || E) return D.fail(M("World control requires an active signed-in player binding"));
|
|
225
|
+
let r = t(L(n).service) ?? D.fail(M("World control operation is not installed"));
|
|
226
|
+
return D.suspend(() => E ? D.fail(M("World control binding is closed")) : r);
|
|
227
|
+
}, U = Object.freeze({
|
|
228
|
+
pending: (e, t) => V(t, (n) => n.pending?.(e, t)),
|
|
229
|
+
join: (e, t) => V(t, (n) => n.join?.(e, t)),
|
|
230
|
+
reservation: (e, t) => V(t, (n) => n.reservation?.(e, t)),
|
|
231
|
+
follow: (e, t) => V(t, (n) => n.follow?.(e, t)),
|
|
232
|
+
prepare: (e, t, n) => V(n, (r) => r.prepare(e, t, n)),
|
|
233
|
+
observe: (e, t) => V(t, (n) => n.observe(e, t)),
|
|
234
|
+
commit: (e, t) => V(t, (n) => n.commit(e, t)),
|
|
235
|
+
cancel: (e, t) => V(t, (n) => n.cancel(e, t))
|
|
236
|
+
}), W = r ? t(z, {
|
|
237
|
+
transition: (e, t) => D.suspend(() => E ? D.fail(M("World command binding is closed")) : L(t.tenantId).executor.prepare(e, t).pipe(D.asVoid)),
|
|
238
|
+
transitionGroup: (e, t) => D.suspend(() => {
|
|
239
|
+
let n = !E && L(t.tenantId).groupControl;
|
|
240
|
+
return n ? n.preparation.transitionGroup(e, t) : D.fail(M("World group command binding is unavailable"));
|
|
241
|
+
})
|
|
242
|
+
}) : void 0, G = w ? C({
|
|
243
|
+
store: i,
|
|
244
|
+
states: T.transitions,
|
|
245
|
+
epochNow: c,
|
|
246
|
+
control: (e) => {
|
|
247
|
+
let t = L(e).groupControl;
|
|
248
|
+
if (!t) throw M("Default World group continuation is unavailable");
|
|
249
|
+
return t;
|
|
250
|
+
}
|
|
251
|
+
}) : void 0;
|
|
252
|
+
return Object.freeze({
|
|
253
|
+
source: Object.freeze({
|
|
254
|
+
worlds: d,
|
|
255
|
+
transitionsEnabled: e.transitionsEnabled,
|
|
256
|
+
onErase: T.onErase.bind(T),
|
|
257
|
+
onExport: T.onExport.bind(T)
|
|
258
|
+
}),
|
|
259
|
+
...e.clientControls ? { clientControl: Object.freeze({
|
|
260
|
+
worlds: d,
|
|
261
|
+
service: U
|
|
262
|
+
}) } : {},
|
|
263
|
+
...W === void 0 ? {} : { commands: W },
|
|
264
|
+
...G === void 0 ? {} : { runGroupsDue: () => D.suspend(() => E ? D.fail(M("World group binding is closed")) : G.runDue()) },
|
|
265
|
+
release: () => (E = !0, Promise.resolve())
|
|
266
|
+
});
|
|
267
|
+
}, V = (e) => B(e), H = (e, t, n, a, o) => D.suspend(() => {
|
|
268
|
+
let s = t.find((e) => e.name === o.worldId);
|
|
269
|
+
return s ? i(e, {
|
|
270
|
+
worlds: t,
|
|
271
|
+
epochNow: n,
|
|
272
|
+
maxListedCells: 1,
|
|
273
|
+
authorize: () => D.void
|
|
274
|
+
}).observe({
|
|
275
|
+
tenantId: a,
|
|
276
|
+
worldId: s.name,
|
|
277
|
+
zoneId: o.zoneId,
|
|
278
|
+
cellId: r(s, {
|
|
279
|
+
zone: o.zoneId,
|
|
280
|
+
at: o.at
|
|
281
|
+
}).id,
|
|
282
|
+
layer: o.layer
|
|
283
|
+
}).pipe(D.flatMap((e) => e && e.state === "live" ? D.succeed(e) : D.fail(M("World cell Room is not live")))) : D.fail(M("World is not declared"));
|
|
284
|
+
}), U = (e) => {
|
|
285
|
+
let { store: t, catalog: r, epochNow: i } = e, o = n(e.worlds), s = e.maxBytes ?? 16384, c = x((e) => P(t, o, i, !0, s, e)), { entities: f } = c, p = N((t) => l(e.hot, {
|
|
286
|
+
namespace: k,
|
|
287
|
+
tenantId: t,
|
|
288
|
+
ttlMs: 3e4
|
|
289
|
+
})), h = {
|
|
290
|
+
step: () => D.fail(M("World Room is on another Host and this Host has no peer control")),
|
|
291
|
+
capture: () => D.fail(M("World Room is on another Host and this Host has no peer control"))
|
|
292
|
+
}, g = d({
|
|
293
|
+
local: e.controller,
|
|
294
|
+
ownership: e.ownership,
|
|
295
|
+
remote: {
|
|
296
|
+
step: (t, n) => D.suspend(() => {
|
|
297
|
+
let r = e.peers();
|
|
298
|
+
return r ? u({
|
|
299
|
+
world: r,
|
|
300
|
+
ownership: e.ownership
|
|
301
|
+
}).step(t, n) : h.step(t, n);
|
|
302
|
+
}),
|
|
303
|
+
capture: (t) => D.suspend(() => {
|
|
304
|
+
let n = e.peers();
|
|
305
|
+
return n ? u({
|
|
306
|
+
world: n,
|
|
307
|
+
ownership: e.ownership
|
|
308
|
+
}).capture(t) : h.capture(t);
|
|
309
|
+
})
|
|
310
|
+
}
|
|
311
|
+
}), _ = (n) => R(t, n, o, i, (t, n) => D.gen(function* () {
|
|
312
|
+
let r = e.controller();
|
|
313
|
+
if (!r) return yield* D.fail(M("World Host is not started"));
|
|
314
|
+
if (t.hostId !== void 0 && t.hostId !== r.host.id) return yield* D.fail(M("World Room preparation belongs to another Host"));
|
|
315
|
+
let i = yield* e.resolveSubject(W(n)).pipe(D.mapError(() => M("World player is not authorized"))), a = yield* D.tryPromise({
|
|
316
|
+
try: () => r.prepareWorldRoom(t.room, {}, i, t.creationKey, t.worldCell, t.generation, t.worldInstance),
|
|
317
|
+
catch: () => M("World Room preparation did not complete")
|
|
318
|
+
});
|
|
319
|
+
return {
|
|
320
|
+
roomId: a.id,
|
|
321
|
+
hostId: a.hostId,
|
|
322
|
+
epoch: a.epoch
|
|
323
|
+
};
|
|
324
|
+
})), v = (t) => D.gen(function* () {
|
|
325
|
+
let n = e.peers(), r = t.ready;
|
|
326
|
+
if (!n?.bindAdmission || !r || !t.subject) return yield* D.fail(M("World group admission is unavailable"));
|
|
327
|
+
let i = yield* e.ownership(t.target.roomId, t.origin.tenantId).pipe(D.mapError(() => M("World group admission is unavailable")));
|
|
328
|
+
return !i?.hostId || i.state !== "live" || i.epoch !== t.target.epoch || r.roomId !== t.target.roomId || r.epoch !== t.target.epoch ? yield* D.fail(M("World group admission is unavailable")) : yield* n.bindAdmission(i.hostId, {
|
|
329
|
+
roomId: r.roomId,
|
|
330
|
+
sessionId: r.sessionId,
|
|
331
|
+
epoch: r.epoch
|
|
332
|
+
}, I(t.origin.tenantId, t.subject)).pipe(D.mapError(() => M("World group admission is unavailable")));
|
|
333
|
+
}), y = N((n) => m({
|
|
334
|
+
store: t,
|
|
335
|
+
tenantId: n,
|
|
336
|
+
worlds: o,
|
|
337
|
+
catalog: r,
|
|
338
|
+
entities: f,
|
|
339
|
+
rooms: g,
|
|
340
|
+
epochNow: i,
|
|
341
|
+
maxBytes: s,
|
|
342
|
+
allocation: _(n),
|
|
343
|
+
seats: e.signing,
|
|
344
|
+
leases: p(n)
|
|
345
|
+
}, c, v).executor), b = Object.freeze({
|
|
346
|
+
...f,
|
|
347
|
+
admitActorPlayer: (e) => D.tryPromise({
|
|
348
|
+
try: () => t.query({
|
|
349
|
+
table: a,
|
|
350
|
+
predicate: w(T("tenantId", e.tenantId), T("entityId", e.entityId)),
|
|
351
|
+
order: [],
|
|
352
|
+
take: 1,
|
|
353
|
+
skip: void 0,
|
|
354
|
+
projection: ["entityId"]
|
|
355
|
+
}),
|
|
356
|
+
catch: () => M("World player entity is unavailable")
|
|
357
|
+
}).pipe(D.flatMap((t) => t.length ? f.admitActorPlayer(e) : D.succeed(null)))
|
|
358
|
+
});
|
|
359
|
+
return Object.freeze({
|
|
360
|
+
worldEntities: b,
|
|
361
|
+
resolveWorldPlayer: (e) => e.subjectId ? D.succeed(e.subjectId) : D.fail(M("World player has no Subject")),
|
|
362
|
+
worldSteps: Object.freeze({
|
|
363
|
+
leases: p,
|
|
364
|
+
executor: y
|
|
365
|
+
})
|
|
366
|
+
});
|
|
367
|
+
}, W = (e) => {
|
|
368
|
+
if (e.type !== "user") throw M("Only a player allocates World Rooms");
|
|
369
|
+
return {
|
|
370
|
+
type: "user",
|
|
371
|
+
id: e.id,
|
|
372
|
+
tenantId: e.tenantId,
|
|
373
|
+
...e.kind === "guest" ? { kind: "guest" } : {}
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
export { z as DEFAULT_WORLD_COMMAND_NAMES, A as WORLD_DEFAULT_MAX_BYTES, k as WORLD_LEASE_NAMESPACE, B as buildDefaultApiWorldState, V as defaultApiWorldState, U as defaultHostWorld, F as defaultWorldEntities };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureRoomSessionAdmissionEvidence as t } from "./sessionAdmission.js";
|
|
3
|
+
import { Effect as n } from "effect";
|
|
4
|
+
// src/worldDefaultGroupAdmission.ts
|
|
5
|
+
var r = () => new e({ detail: "Current World group target admission is unavailable" }), i = (e, t) => {
|
|
6
|
+
if (!e || typeof e != "object" || Object.getPrototypeOf(e) !== Object.prototype) throw r();
|
|
7
|
+
let n = Object.getOwnPropertyDescriptor(e, t);
|
|
8
|
+
if (!n || !("value" in n)) throw r();
|
|
9
|
+
return n.value;
|
|
10
|
+
}, a = (e) => {
|
|
11
|
+
if (typeof e != "string" || !/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,190}$/.test(e)) throw r();
|
|
12
|
+
return e;
|
|
13
|
+
}, o = (e) => {
|
|
14
|
+
let t = a(i(i(e, "origin"), "tenantId")), n = i(e, "subject"), o = i(e, "target"), s = i(n, "kind"), c = i(o, "epoch");
|
|
15
|
+
if (s !== "guest" && s !== "user" || typeof c != "number" || !Number.isSafeInteger(c) || c < 0 || c > 2147483647) throw r();
|
|
16
|
+
return Object.freeze({
|
|
17
|
+
key: JSON.stringify([t, a(i(e, "id"))]),
|
|
18
|
+
tenantId: t,
|
|
19
|
+
subjectId: a(i(n, "id")),
|
|
20
|
+
subjectKind: s,
|
|
21
|
+
roomId: a(i(o, "roomId")),
|
|
22
|
+
epoch: c
|
|
23
|
+
});
|
|
24
|
+
}, s = (e, t) => e.tenantId === t.tenantId && e.subjectId === t.subjectId && e.roomId === t.roomId && e.epoch === t.epoch, c = (e, t) => Object.keys(e).every((n) => e[n] === t[n]), l = (e) => n.suspend(() => {
|
|
25
|
+
let i = e();
|
|
26
|
+
return n.isEffect(i) ? i.pipe(n.map(t)) : n.fail(r());
|
|
27
|
+
}).pipe(n.catchCause(() => n.fail(r()))), u = (e = 1024, a = 8) => {
|
|
28
|
+
if (![e, a].every((e) => Number.isSafeInteger(e) && e > 0 && e <= 16384)) throw r();
|
|
29
|
+
let u = /* @__PURE__ */ new Map(), d = 0;
|
|
30
|
+
return {
|
|
31
|
+
withScope: (t) => n.acquireUseRelease(n.sync(() => ({
|
|
32
|
+
active: !0,
|
|
33
|
+
owned: /* @__PURE__ */ new Set()
|
|
34
|
+
})), (c) => t({ read: (t, f) => {
|
|
35
|
+
let p, m;
|
|
36
|
+
try {
|
|
37
|
+
p = o(t);
|
|
38
|
+
let e = i(f, "read");
|
|
39
|
+
if (typeof e != "function") throw r();
|
|
40
|
+
m = e.bind(f);
|
|
41
|
+
} catch {
|
|
42
|
+
return n.fail(r());
|
|
43
|
+
}
|
|
44
|
+
return n.uninterruptibleMask((t) => n.gen(function* () {
|
|
45
|
+
if (!c.active || d >= e || (u.get(p.key)?.size ?? 0) >= a) return yield* n.fail(r());
|
|
46
|
+
let i = yield* t(l(m));
|
|
47
|
+
if (!c.active || !s(p, i) || d >= e || (u.get(p.key)?.size ?? 0) >= a) return yield* n.fail(r());
|
|
48
|
+
let o = Object.freeze({
|
|
49
|
+
target: p,
|
|
50
|
+
evidence: i,
|
|
51
|
+
read: m
|
|
52
|
+
}), f = u.get(p.key) ?? /* @__PURE__ */ new Set();
|
|
53
|
+
return f.add(o), u.set(p.key, f), d += 1, c.owned.add(o), i;
|
|
54
|
+
}));
|
|
55
|
+
} }), (e) => n.sync(() => {
|
|
56
|
+
e.active = !1;
|
|
57
|
+
for (let t of e.owned) {
|
|
58
|
+
let e = u.get(t.target.key);
|
|
59
|
+
e?.delete(t) && --d, e?.size === 0 && u.delete(t.target.key);
|
|
60
|
+
}
|
|
61
|
+
e.owned.clear();
|
|
62
|
+
})),
|
|
63
|
+
confirm: (e, i) => {
|
|
64
|
+
let a, d;
|
|
65
|
+
try {
|
|
66
|
+
a = o(e), d = t(i);
|
|
67
|
+
} catch {
|
|
68
|
+
return n.fail(r());
|
|
69
|
+
}
|
|
70
|
+
return n.suspend(() => {
|
|
71
|
+
if (!s(a, d)) return n.fail(r());
|
|
72
|
+
let e = [...u.get(a.key) ?? []].filter((e) => e.target.subjectKind === a.subjectKind && c(e.evidence, d)), t = (i) => {
|
|
73
|
+
let o = e[i];
|
|
74
|
+
return o ? l(o.read).pipe(n.flatMap((e) => u.get(a.key)?.has(o) && c(e, d) ? n.void : n.fail(r())), n.catchCause(() => t(i + 1))) : n.fail(r());
|
|
75
|
+
};
|
|
76
|
+
return t(0);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export { u as makeWorldGroupAdmissionScopes };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { Effect as t, Result as n } from "effect";
|
|
3
|
+
// src/worldDefaultGroupAppServices.ts
|
|
4
|
+
var r = () => new e({ detail: "World group application services are unavailable" }), i = (e, i) => {
|
|
5
|
+
let a = Object.getOwnPropertyDescriptor(i, "read");
|
|
6
|
+
if (typeof e != "function" || !a || !("value" in a) || typeof a.value != "function") throw r();
|
|
7
|
+
let o = a.value.bind(i);
|
|
8
|
+
return (i) => t.tryPromise({
|
|
9
|
+
try: () => e(t.gen(function* () {
|
|
10
|
+
let e = yield* t.context();
|
|
11
|
+
return yield* t.result(t.acquireUseRelease(t.sync(() => ({ active: !0 })), (n) => {
|
|
12
|
+
let a = Object.freeze({ read: (i, a) => {
|
|
13
|
+
if (!n.active) return t.fail(r());
|
|
14
|
+
let s;
|
|
15
|
+
try {
|
|
16
|
+
s = o(i, a);
|
|
17
|
+
} catch {
|
|
18
|
+
return t.fail(r());
|
|
19
|
+
}
|
|
20
|
+
return t.suspend(() => n.active && t.isEffect(s) ? s.pipe(t.provideContext(e), t.flatMap((e) => n.active ? t.succeed(e) : t.fail(r()))) : t.fail(r()));
|
|
21
|
+
} });
|
|
22
|
+
return t.suspend(() => i(a));
|
|
23
|
+
}, (e) => t.sync(() => {
|
|
24
|
+
e.active = !1;
|
|
25
|
+
})));
|
|
26
|
+
})),
|
|
27
|
+
catch: r
|
|
28
|
+
}).pipe(t.flatMap((e) => n.isSuccess(e) ? t.succeed(e.success) : t.fail(e.failure)));
|
|
29
|
+
};
|
|
30
|
+
export { i as worldGroupAppServices };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldData as t } from "./worldData.js";
|
|
3
|
+
import { captureWorldTransitionGroup as n, worldTransitionGroupFromRecords as r } from "./worldTransitionGroup.js";
|
|
4
|
+
import { assertWorldTransitionExecution as i, worldTransitionExecutionGroup as a } from "./worldTransitionExecutor.js";
|
|
5
|
+
import { Effect as o } from "effect";
|
|
6
|
+
// src/worldDefaultGroupCompensation.ts
|
|
7
|
+
var s = () => new e({ detail: "Complete current World group compensation is unavailable" }), c = (e) => [
|
|
8
|
+
e.worldId,
|
|
9
|
+
e.zoneId,
|
|
10
|
+
e.at[0],
|
|
11
|
+
e.at[1],
|
|
12
|
+
e.layer,
|
|
13
|
+
e.roomId,
|
|
14
|
+
e.epoch
|
|
15
|
+
], l = (e) => {
|
|
16
|
+
if (e.phase !== "failed" || !e.subject || !e.group || !e.failure) throw s();
|
|
17
|
+
return JSON.stringify(t([
|
|
18
|
+
e.id,
|
|
19
|
+
e.entityId,
|
|
20
|
+
e.revision,
|
|
21
|
+
e.entityRevision,
|
|
22
|
+
e.requestedRevision,
|
|
23
|
+
e.origin.tenantId,
|
|
24
|
+
e.origin.roomId,
|
|
25
|
+
e.origin.requestId,
|
|
26
|
+
e.subject.id,
|
|
27
|
+
e.subject.kind,
|
|
28
|
+
e.mode,
|
|
29
|
+
c(e.source),
|
|
30
|
+
c(e.target),
|
|
31
|
+
e.group.key,
|
|
32
|
+
e.group.digest,
|
|
33
|
+
e.group.ordinal,
|
|
34
|
+
e.group.boundRevision,
|
|
35
|
+
e.failure
|
|
36
|
+
], 16384));
|
|
37
|
+
}, u = (e, t = 64, c = 128) => {
|
|
38
|
+
if (![t, c].every((e) => Number.isSafeInteger(e) && e > 0 && e <= 1024)) throw s();
|
|
39
|
+
let u = Object.getOwnPropertyDescriptor(e, "observe");
|
|
40
|
+
if (!u || !("value" in u) || typeof u.value != "function") throw s();
|
|
41
|
+
let d = u.value.bind(e), f = /* @__PURE__ */ new Set();
|
|
42
|
+
return {
|
|
43
|
+
withScope: (e) => o.acquireUseRelease(o.try({
|
|
44
|
+
try: () => {
|
|
45
|
+
if (f.size >= c) throw s();
|
|
46
|
+
let e = {
|
|
47
|
+
active: !0,
|
|
48
|
+
group: null,
|
|
49
|
+
frames: /* @__PURE__ */ new Map(),
|
|
50
|
+
completed: /* @__PURE__ */ new Set()
|
|
51
|
+
};
|
|
52
|
+
return f.add(e), e;
|
|
53
|
+
},
|
|
54
|
+
catch: s
|
|
55
|
+
}), (n) => e({ rollback: (e) => (c, u) => {
|
|
56
|
+
let d;
|
|
57
|
+
try {
|
|
58
|
+
d = l(c);
|
|
59
|
+
} catch {
|
|
60
|
+
return o.fail(s());
|
|
61
|
+
}
|
|
62
|
+
return o.gen(function* () {
|
|
63
|
+
if (!n.active || typeof e != "function") return yield* o.fail(s());
|
|
64
|
+
let f = yield* a(u, c, "rollback"), p, m;
|
|
65
|
+
try {
|
|
66
|
+
if (f.length > t || new Set(f.map((e) => e.id)).size !== f.length || new Set(f.map((e) => e.entityId)).size !== f.length) throw s();
|
|
67
|
+
let e = r(f);
|
|
68
|
+
if (!e || (p = JSON.stringify(e), m = new Map(f.map((e) => [e.id, l(e)])), m.get(c.id) !== d || n.group !== null && (n.group !== p || n.frames.size !== m.size || [...m].some(([e, t]) => n.frames.get(e) !== t)))) throw s();
|
|
69
|
+
} catch {
|
|
70
|
+
return yield* o.fail(s());
|
|
71
|
+
}
|
|
72
|
+
if (!n.active) return yield* o.fail(s());
|
|
73
|
+
if (n.group === null) {
|
|
74
|
+
n.group = p;
|
|
75
|
+
for (let [e, t] of m) n.frames.set(e, t);
|
|
76
|
+
}
|
|
77
|
+
let h = e(c, u);
|
|
78
|
+
if (!o.isEffect(h) || (yield* h, yield* i(u, c, "rollback"), !n.active || l(c) !== d)) return yield* o.fail(s());
|
|
79
|
+
n.completed.add(c.id);
|
|
80
|
+
}).pipe(o.catchCause(() => o.fail(s())));
|
|
81
|
+
} }), (e) => o.sync(() => {
|
|
82
|
+
e.active = !1, f.delete(e), e.frames.clear(), e.completed.clear();
|
|
83
|
+
})),
|
|
84
|
+
confirm: (e) => {
|
|
85
|
+
let i;
|
|
86
|
+
try {
|
|
87
|
+
i = n(e, t);
|
|
88
|
+
} catch {
|
|
89
|
+
return o.fail(s());
|
|
90
|
+
}
|
|
91
|
+
return o.gen(function* () {
|
|
92
|
+
let e = [];
|
|
93
|
+
for (let t of i.members) {
|
|
94
|
+
let n = yield* d(t.origin);
|
|
95
|
+
if (!n) return yield* o.fail(s());
|
|
96
|
+
e.push(n);
|
|
97
|
+
}
|
|
98
|
+
if (JSON.stringify(r(e)) !== JSON.stringify(i) || !e[0]?.failure || e.some((t) => t.failure !== e[0].failure)) return yield* o.fail(s());
|
|
99
|
+
if (e.every((e) => e.phase === "rolledBack")) return;
|
|
100
|
+
let t = new Map(e.map((e) => [e.id, l(e)]));
|
|
101
|
+
if (t.size !== e.length) return yield* o.fail(s());
|
|
102
|
+
let n = JSON.stringify(i);
|
|
103
|
+
if (![...f].some((e) => e.active && e.group === n && e.frames.size === t.size && e.completed.size === t.size && [...t].every(([t, n]) => e.completed.has(t) && e.frames.get(t) === n))) return yield* o.fail(s());
|
|
104
|
+
}).pipe(o.catchCause(() => o.fail(s())));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
export { u as makeWorldGroupCompensationScopes };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldData as t } from "./worldData.js";
|
|
3
|
+
import { WORLD_TRANSITIONS_TABLE as n } from "./identities.js";
|
|
4
|
+
import { captureWorldGroupCommandReceipt as r, worldGroupCommandKey as i } from "./worldGroupCommand.js";
|
|
5
|
+
import { worldTransitionGroupFromRecords as a } from "./worldTransitionGroup.js";
|
|
6
|
+
import { makeWorldGroupSupervisor as o } from "./worldGroupSupervisor.js";
|
|
7
|
+
import { and as s, eq as c, gt as l, neq as u, or as d } from "@voltro/database";
|
|
8
|
+
import { Effect as f, Result as p } from "effect";
|
|
9
|
+
// src/worldDefaultGroupContinuation.ts
|
|
10
|
+
var m = () => new e({ detail: "Default World group continuation retains incomplete work" }), h = (e) => {
|
|
11
|
+
let h = null, g = !1;
|
|
12
|
+
return { runDue: () => f.suspend(() => g ? f.fail(m()) : (g = !0, f.gen(function* () {
|
|
13
|
+
let g = yield* f.tryPromise({
|
|
14
|
+
try: () => e.store.query({
|
|
15
|
+
table: n,
|
|
16
|
+
predicate: s(u("groupCommandKey", null), c("groupDriveAcknowledgedAt", null), ...h === null ? [] : [d(l("groupCommandKey", h.key), s(c("groupCommandKey", h.key), l("id", h.id)))]),
|
|
17
|
+
order: [{
|
|
18
|
+
column: "groupCommandKey",
|
|
19
|
+
direction: "asc"
|
|
20
|
+
}, {
|
|
21
|
+
column: "id",
|
|
22
|
+
direction: "asc"
|
|
23
|
+
}],
|
|
24
|
+
take: 257,
|
|
25
|
+
skip: void 0,
|
|
26
|
+
projection: [
|
|
27
|
+
"id",
|
|
28
|
+
"tenantId",
|
|
29
|
+
"groupCommandKey",
|
|
30
|
+
"groupCommandReceipt"
|
|
31
|
+
]
|
|
32
|
+
}),
|
|
33
|
+
catch: m
|
|
34
|
+
}), _ = /* @__PURE__ */ new Set(), v = 0, y = 0, b = 0, x = 0, S = 0, C = !0;
|
|
35
|
+
for (let n of g.slice(0, 256)) {
|
|
36
|
+
let s = n.id, c = n.groupCommandKey;
|
|
37
|
+
if (typeof s != "string" || !s.length || s.length > 191 || typeof c != "string" || !c.length || c.length > 64) return yield* f.fail(m());
|
|
38
|
+
if (_.has(c)) {
|
|
39
|
+
h = {
|
|
40
|
+
key: c,
|
|
41
|
+
id: s
|
|
42
|
+
}, v++;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (y >= 32) {
|
|
46
|
+
C = !1;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
h = {
|
|
50
|
+
key: c,
|
|
51
|
+
id: s
|
|
52
|
+
}, v++, y++;
|
|
53
|
+
let l = yield* f.result(f.gen(function* () {
|
|
54
|
+
let s = r(t(n.groupCommandReceipt, 4096));
|
|
55
|
+
if (n.tenantId !== s.origin.tenantId || c !== i(s)) return yield* f.fail(m());
|
|
56
|
+
_.add(c);
|
|
57
|
+
let l = yield* e.states.observeGroupCommand(s.origin).pipe(f.mapError(m));
|
|
58
|
+
if (!l || !l.records.length || l.records.length > 64 || !a(l.records) || JSON.stringify(l.command) !== JSON.stringify(s)) return yield* f.fail(m());
|
|
59
|
+
if (l.records.every((e) => e.groupDriveAcknowledgedAt !== void 0)) return {
|
|
60
|
+
completed: 0,
|
|
61
|
+
waiting: 0
|
|
62
|
+
};
|
|
63
|
+
if (l.records.some((e) => e.groupDriveAcknowledgedAt !== void 0)) return yield* f.fail(m());
|
|
64
|
+
let u = e.control(s.origin.tenantId);
|
|
65
|
+
return yield* o({
|
|
66
|
+
tenantId: s.origin.tenantId,
|
|
67
|
+
maxCommands: 1,
|
|
68
|
+
maxMembers: 64,
|
|
69
|
+
maxPageBytes: 524288,
|
|
70
|
+
epochNow: e.epochNow,
|
|
71
|
+
states: {
|
|
72
|
+
scanGroupCommands: () => f.succeed({
|
|
73
|
+
groups: [l],
|
|
74
|
+
nextCursor: null
|
|
75
|
+
}),
|
|
76
|
+
acknowledgeGroupCommand: e.states.acknowledgeGroupCommand.bind(e.states)
|
|
77
|
+
},
|
|
78
|
+
preparation: u.preparation,
|
|
79
|
+
deadline: u.deadline,
|
|
80
|
+
authorize: () => f.void
|
|
81
|
+
}).runDue();
|
|
82
|
+
}).pipe(f.catchCause(() => f.fail(m()))));
|
|
83
|
+
p.isFailure(l) ? S++ : (b += l.success.completed, x += l.success.waiting);
|
|
84
|
+
}
|
|
85
|
+
return C && g.length <= 256 && (h = null), S ? yield* f.fail(m()) : Object.freeze({
|
|
86
|
+
examined: v,
|
|
87
|
+
visited: y,
|
|
88
|
+
completed: b,
|
|
89
|
+
waiting: x
|
|
90
|
+
});
|
|
91
|
+
}).pipe(f.ensuring(f.sync(() => {
|
|
92
|
+
g = !1;
|
|
93
|
+
}))))) };
|
|
94
|
+
};
|
|
95
|
+
export { h as defaultWorldGroupContinuation };
|