@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,227 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldData as t } from "./worldData.js";
|
|
3
|
+
import { resolveWorldOnWorldChange as n } from "./worldChange.js";
|
|
4
|
+
import { resolveWorldTransitionPolicy as r } from "./worldTransitions.js";
|
|
5
|
+
import { worldTransitionRequest as i } from "./worldCommands.js";
|
|
6
|
+
import { captureWorldCatalog as a, worldCellAt as o } from "./world.js";
|
|
7
|
+
import { captureWorldEntityReturnAnchor as s } from "./worldReturnAnchor.js";
|
|
8
|
+
import { Effect as c } from "effect";
|
|
9
|
+
// src/worldTransitionResolver.ts
|
|
10
|
+
function l() {
|
|
11
|
+
throw new e({ detail: "World transition resolution refused" });
|
|
12
|
+
}
|
|
13
|
+
var u = (e, t = 191) => typeof e == "string" && e.length <= t && /^[A-Za-z0-9][A-Za-z0-9_.:-]*$/.test(e) ? e : l(), d = (e) => typeof e == "number" && Number.isSafeInteger(e) && e > 0 && e <= 2147483647 ? e : l(), f = (e, t) => {
|
|
14
|
+
e && typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype && Reflect.ownKeys(e).length === t.length || l();
|
|
15
|
+
for (let n of t) {
|
|
16
|
+
let t = Object.getOwnPropertyDescriptor(e, n);
|
|
17
|
+
t?.enumerable && "value" in t || l();
|
|
18
|
+
}
|
|
19
|
+
}, p = (e, t) => {
|
|
20
|
+
let n = e && typeof e == "object" ? Object.getOwnPropertyDescriptor(e, t) : void 0;
|
|
21
|
+
return n && "value" in n && typeof n.value == "function" || l(), n.value.bind(e);
|
|
22
|
+
}, m = (t) => c.suspend(() => {
|
|
23
|
+
let n = t();
|
|
24
|
+
return c.isEffect(n) ? n : c.fail(new e({ detail: "World resolution requires actual Effects" }));
|
|
25
|
+
}).pipe(c.catchCause(() => c.fail(new e({ detail: "World transition resolution remains incomplete" })))), h = (h) => {
|
|
26
|
+
f(h, [
|
|
27
|
+
"tenantId",
|
|
28
|
+
"worlds",
|
|
29
|
+
"maxDataBytes",
|
|
30
|
+
"placementClass",
|
|
31
|
+
"entities",
|
|
32
|
+
"authorize",
|
|
33
|
+
"captureCurrent",
|
|
34
|
+
"resolveDestination",
|
|
35
|
+
"admit"
|
|
36
|
+
]);
|
|
37
|
+
let g = u(h.tenantId), _ = d(h.maxDataBytes), v = u(h.placementClass, 120), y = a(h.worlds);
|
|
38
|
+
/^[A-Za-z0-9][A-Za-z0-9_-]{0,119}$/.test(v) || l();
|
|
39
|
+
let b = Object.getOwnPropertyDescriptor(h.entities, "worlds");
|
|
40
|
+
b && "value" in b || l();
|
|
41
|
+
let x = a(b.value);
|
|
42
|
+
(!y.length || x.length !== y.length || x.some((e, t) => e !== y[t])) && l();
|
|
43
|
+
let S = p(h.entities, "capturePersistence"), C = p(h.entities, "observe"), w = p(h, "authorize"), T = p(h, "captureCurrent"), E = p(h, "resolveDestination"), D = p(h, "admit"), O = (e) => y.find((t) => t.name === e) ?? l(), k = (e) => {
|
|
44
|
+
f(e, [
|
|
45
|
+
"worldId",
|
|
46
|
+
"zoneId",
|
|
47
|
+
"at",
|
|
48
|
+
"layer",
|
|
49
|
+
"roomId",
|
|
50
|
+
"epoch"
|
|
51
|
+
]), Array.isArray(e.at) && Object.getPrototypeOf(e.at) === Array.prototype && Reflect.ownKeys(e.at).length === 3 || l();
|
|
52
|
+
for (let t of ["0", "1"]) {
|
|
53
|
+
let n = Object.getOwnPropertyDescriptor(e.at, t);
|
|
54
|
+
n?.enumerable && "value" in n || l();
|
|
55
|
+
}
|
|
56
|
+
let t = O(u(e.worldId)), n = u(e.zoneId), r = d(e.layer);
|
|
57
|
+
t.characters !== "shared" && l();
|
|
58
|
+
let i = Object.freeze({
|
|
59
|
+
worldId: t.name,
|
|
60
|
+
zoneId: n,
|
|
61
|
+
at: Object.freeze([e.at[0], e.at[1]]),
|
|
62
|
+
layer: r,
|
|
63
|
+
roomId: u(e.roomId),
|
|
64
|
+
epoch: d(e.epoch)
|
|
65
|
+
});
|
|
66
|
+
return o(t, {
|
|
67
|
+
zone: i.zoneId,
|
|
68
|
+
at: i.at
|
|
69
|
+
}), !t.zones.find((e) => e.id === n).layering && r !== 1 && l(), i;
|
|
70
|
+
}, A = (e) => (f(e, ["location", "data"]), Object.freeze({
|
|
71
|
+
location: k(e.location),
|
|
72
|
+
data: t(e.data, _)
|
|
73
|
+
}));
|
|
74
|
+
return (a, p) => {
|
|
75
|
+
let h, b;
|
|
76
|
+
try {
|
|
77
|
+
h = i(a), f(p, [
|
|
78
|
+
"tenantId",
|
|
79
|
+
"roomId",
|
|
80
|
+
"requestId"
|
|
81
|
+
]), b = Object.freeze({
|
|
82
|
+
tenantId: u(p.tenantId),
|
|
83
|
+
roomId: u(p.roomId),
|
|
84
|
+
requestId: u(p.requestId, 384)
|
|
85
|
+
}), (b.tenantId !== g || ![
|
|
86
|
+
"cell",
|
|
87
|
+
"zone",
|
|
88
|
+
"layer",
|
|
89
|
+
"world",
|
|
90
|
+
"instance",
|
|
91
|
+
"return"
|
|
92
|
+
].includes(h.target.kind) || (h.target.kind === "instance" ? h.options.returnTo !== "here" : h.options.returnTo !== void 0)) && l();
|
|
93
|
+
let e = (t) => {
|
|
94
|
+
if (t && typeof t == "object") {
|
|
95
|
+
for (let n of Object.values(t)) e(n);
|
|
96
|
+
Object.freeze(t);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
e(h);
|
|
100
|
+
} catch {
|
|
101
|
+
return c.fail(new e({ detail: "Invalid World resolution intention or origin" }));
|
|
102
|
+
}
|
|
103
|
+
return m(() => c.gen(function* () {
|
|
104
|
+
yield* m(() => w(h, b));
|
|
105
|
+
let e = yield* m(() => C({
|
|
106
|
+
tenantId: g,
|
|
107
|
+
entityId: h.entityId
|
|
108
|
+
}));
|
|
109
|
+
e || l(), f(e, [
|
|
110
|
+
"tenantId",
|
|
111
|
+
"entityId",
|
|
112
|
+
"subject",
|
|
113
|
+
"kind",
|
|
114
|
+
"worldId",
|
|
115
|
+
"zoneId",
|
|
116
|
+
"cellId",
|
|
117
|
+
"layer",
|
|
118
|
+
"roomId",
|
|
119
|
+
"epoch",
|
|
120
|
+
"revision",
|
|
121
|
+
"data",
|
|
122
|
+
"updatedAt",
|
|
123
|
+
...Object.hasOwn(e, "returnAnchor") ? ["returnAnchor"] : []
|
|
124
|
+
]), (e.tenantId !== g || e.entityId !== h.entityId || e.roomId !== b.roomId) && l(), e.subject !== null && f(e.subject, ["id", "kind"]);
|
|
125
|
+
let i;
|
|
126
|
+
if (Object.hasOwn(e, "returnAnchor")) {
|
|
127
|
+
let t = s(e.returnAnchor, y);
|
|
128
|
+
(t.source.worldId !== e.worldId || t.instanceRoomId !== e.roomId || t.enteredRevision > e.revision || !O(e.worldId).instances.some((e) => e.id === t.instance)) && l(), i = t;
|
|
129
|
+
}
|
|
130
|
+
(h.target.kind === "return" ? !i : i !== void 0) && l();
|
|
131
|
+
let a = Object.freeze({
|
|
132
|
+
tenantId: g,
|
|
133
|
+
entityId: h.entityId,
|
|
134
|
+
...i ? { returnAnchor: i } : {},
|
|
135
|
+
subject: e.subject === null ? null : Object.freeze({
|
|
136
|
+
id: u(e.subject.id),
|
|
137
|
+
kind: e.subject.kind
|
|
138
|
+
}),
|
|
139
|
+
kind: u(e.kind, 120),
|
|
140
|
+
worldId: u(e.worldId, 120),
|
|
141
|
+
zoneId: u(e.zoneId, 120),
|
|
142
|
+
cellId: u(e.cellId),
|
|
143
|
+
layer: d(e.layer),
|
|
144
|
+
roomId: u(e.roomId),
|
|
145
|
+
epoch: d(e.epoch),
|
|
146
|
+
revision: d(e.revision),
|
|
147
|
+
data: t(e.data, _),
|
|
148
|
+
updatedAt: e.updatedAt
|
|
149
|
+
});
|
|
150
|
+
(!Number.isSafeInteger(a.updatedAt) || a.updatedAt < 0 || a.subject && a.subject.kind !== "user" && a.subject.kind !== "guest") && l();
|
|
151
|
+
let c = A(yield* m(() => T(a, b))), p = O(c.location.worldId), x = o(p, {
|
|
152
|
+
zone: c.location.zoneId,
|
|
153
|
+
at: c.location.at
|
|
154
|
+
});
|
|
155
|
+
(a.worldId !== c.location.worldId || a.zoneId !== c.location.zoneId || a.cellId !== x.id || a.layer !== c.location.layer || a.roomId !== c.location.roomId || a.epoch !== c.location.epoch) && l(), S({
|
|
156
|
+
tenantId: g,
|
|
157
|
+
entityId: a.entityId,
|
|
158
|
+
expectedRevision: a.revision,
|
|
159
|
+
source: c.location,
|
|
160
|
+
data: c.data
|
|
161
|
+
});
|
|
162
|
+
let k = Object.freeze({
|
|
163
|
+
origin: b,
|
|
164
|
+
intent: h,
|
|
165
|
+
entity: a,
|
|
166
|
+
current: c
|
|
167
|
+
}), j = A(yield* m(() => E(k))), M = h.target, N = j.location;
|
|
168
|
+
(N.roomId === c.location.roomId || M.kind !== "world" && N.worldId !== c.location.worldId) && l(), M.kind !== "cell" && M.kind !== "zone" || N.zoneId === M.zone && N.at[0] === M.at[0] && N.at[1] === M.at[1] && N.layer === c.location.layer || l(), M.kind === "layer" && (N.layer !== M.layer || N.zoneId !== c.location.zoneId) && l(), M.kind === "world" && N.worldId !== M.world && l(), M.kind === "instance" && !p.instances.some((e) => e.id === M.instance) && l(), M.kind !== "return" || i && N.worldId === i.source.worldId && N.zoneId === i.source.zoneId && N.layer === i.source.layer && N.at[0] === i.source.at[0] && N.at[1] === i.source.at[1] || l();
|
|
169
|
+
let P = O(N.worldId), F = r({
|
|
170
|
+
kind: M.kind,
|
|
171
|
+
sourceWorld: p,
|
|
172
|
+
targetWorld: P,
|
|
173
|
+
source: {
|
|
174
|
+
world: p.name,
|
|
175
|
+
pool: p.hosts?.pool ?? v,
|
|
176
|
+
zone: c.location.zoneId,
|
|
177
|
+
at: c.location.at,
|
|
178
|
+
layer: c.location.layer,
|
|
179
|
+
instance: i?.instance ?? null
|
|
180
|
+
},
|
|
181
|
+
target: {
|
|
182
|
+
world: P.name,
|
|
183
|
+
pool: P.hosts?.pool ?? v,
|
|
184
|
+
zone: N.zoneId,
|
|
185
|
+
at: N.at,
|
|
186
|
+
layer: N.layer,
|
|
187
|
+
instance: M.kind === "instance" ? M.instance : null
|
|
188
|
+
},
|
|
189
|
+
mode: h.options.mode,
|
|
190
|
+
crossPool: h.options.crossPool,
|
|
191
|
+
recovery: !1
|
|
192
|
+
}, p.strategies.transitionPolicy), I = p === P ? j.data : n({
|
|
193
|
+
sourceWorldId: p.name,
|
|
194
|
+
targetWorldId: P.name,
|
|
195
|
+
sourceData: c.data,
|
|
196
|
+
targetData: j.data
|
|
197
|
+
}, _, p.strategies.onWorldChange);
|
|
198
|
+
S({
|
|
199
|
+
tenantId: g,
|
|
200
|
+
entityId: a.entityId,
|
|
201
|
+
expectedRevision: a.revision,
|
|
202
|
+
source: N,
|
|
203
|
+
data: I
|
|
204
|
+
});
|
|
205
|
+
let L = Object.freeze({
|
|
206
|
+
location: N,
|
|
207
|
+
data: I
|
|
208
|
+
});
|
|
209
|
+
yield* m(() => D(k, L, F)), F.mode === "recover" && l();
|
|
210
|
+
let R = {
|
|
211
|
+
tenantId: g,
|
|
212
|
+
entityId: a.entityId,
|
|
213
|
+
expectedRevision: a.revision,
|
|
214
|
+
source: c.location,
|
|
215
|
+
target: N,
|
|
216
|
+
sourceData: c.data,
|
|
217
|
+
data: I,
|
|
218
|
+
mode: F.mode,
|
|
219
|
+
origin: b,
|
|
220
|
+
intent: h,
|
|
221
|
+
...a.subject === null ? {} : { expectedSubject: a.subject }
|
|
222
|
+
};
|
|
223
|
+
return Object.freeze(R);
|
|
224
|
+
}));
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
export { h as makeWorldTransitionResolver };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { WORLD_TRANSITIONS_TABLE as t } from "./identities.js";
|
|
3
|
+
import { captureRoomReservationBatch as n } from "./reservationBatch.js";
|
|
4
|
+
import { worldTransitionGroupFromRecords as r } from "./worldTransitionGroup.js";
|
|
5
|
+
import { and as i, eq as a } from "@voltro/database";
|
|
6
|
+
import { Effect as o } from "effect";
|
|
7
|
+
// src/worldTransitionSeatGroup.ts
|
|
8
|
+
function s() {
|
|
9
|
+
throw new e({ detail: "World Seat group requires complete original membership" });
|
|
10
|
+
}
|
|
11
|
+
var c = (e) => e.group ? `world-group:${e.group.key}` : `world:${e.id}`, l = (e, t) => !e.length || e.length > 1024 || !r(e) && e.length !== 1 ? s() : n({
|
|
12
|
+
tenantId: e[0].origin.tenantId,
|
|
13
|
+
requestId: c(e[0]),
|
|
14
|
+
seats: e.map((e) => e.subject ? {
|
|
15
|
+
roomId: e.target.roomId,
|
|
16
|
+
subjectId: e.subject.id,
|
|
17
|
+
sourceRoomId: e.origin.roomId,
|
|
18
|
+
...e.subject.kind === "guest" ? { subjectKind: "guest" } : {},
|
|
19
|
+
...t ? { worldTarget: {
|
|
20
|
+
transitionId: e.id,
|
|
21
|
+
sourceRoomId: e.origin.roomId,
|
|
22
|
+
requestId: e.origin.requestId,
|
|
23
|
+
entityId: e.entityId
|
|
24
|
+
} } : {}
|
|
25
|
+
} : s())
|
|
26
|
+
}, 1024), u = (n, c, l, u) => o.tryPromise({
|
|
27
|
+
try: async () => {
|
|
28
|
+
if (!l.group) return Object.freeze([l]);
|
|
29
|
+
if (!Number.isSafeInteger(u) || u < 1 || u > 1024 || l.group.size > u) return s();
|
|
30
|
+
let e = await n.query({
|
|
31
|
+
table: t,
|
|
32
|
+
predicate: i(a("tenantId", l.origin.tenantId), a("groupKey", l.group.key)),
|
|
33
|
+
order: [{
|
|
34
|
+
column: "id",
|
|
35
|
+
direction: "asc"
|
|
36
|
+
}],
|
|
37
|
+
take: u + 1,
|
|
38
|
+
skip: void 0,
|
|
39
|
+
projection: [
|
|
40
|
+
"tenantId",
|
|
41
|
+
"sourceRoomId",
|
|
42
|
+
"requestId"
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
if (e.length !== l.group.size || e.length > u) return s();
|
|
46
|
+
let d = [];
|
|
47
|
+
for (let t of e) {
|
|
48
|
+
if (t.tenantId !== l.origin.tenantId || typeof t.sourceRoomId != "string" || typeof t.requestId != "string") return s();
|
|
49
|
+
let e = c({
|
|
50
|
+
tenantId: l.origin.tenantId,
|
|
51
|
+
roomId: t.sourceRoomId,
|
|
52
|
+
requestId: t.requestId
|
|
53
|
+
});
|
|
54
|
+
if (!o.isEffect(e)) return s();
|
|
55
|
+
let n = await o.runPromise(e);
|
|
56
|
+
if (!n || n.origin.tenantId !== l.origin.tenantId || n.origin.roomId !== t.sourceRoomId || n.origin.requestId !== t.requestId) return s();
|
|
57
|
+
d.push(n);
|
|
58
|
+
}
|
|
59
|
+
return !r(d) || !d.some((e) => e.id === l.id && e.revision === l.revision) ? s() : Object.freeze(d);
|
|
60
|
+
},
|
|
61
|
+
catch: () => new e({ detail: "World Seat group observation is incomplete or changed" })
|
|
62
|
+
});
|
|
63
|
+
export { u as readWorldTransitionSeatGroup, l as worldTransitionSeatBatch, c as worldTransitionSeatRequestId };
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldData as t } from "./worldData.js";
|
|
3
|
+
import { ROOMS_TABLE as n } from "./identities.js";
|
|
4
|
+
import { captureWorldCatalog as r, worldCellAt as i } from "./world.js";
|
|
5
|
+
import { assertWorldRoomPool as a } from "./worldRoomPool.js";
|
|
6
|
+
import { WORLD_CELLS_TABLE as o } from "./worldCells.js";
|
|
7
|
+
import { roomReservationBatchSessionId as s } from "./reservationBatch.js";
|
|
8
|
+
import { readWorldTransitionSeatGroup as c, worldTransitionSeatBatch as l } from "./worldTransitionSeatGroup.js";
|
|
9
|
+
import { dataStoreWorldInstances as u } from "./worldInstances.js";
|
|
10
|
+
import { assertWorldTransitionExecution as d, withWorldTransitionGroupMember as ee, worldTransitionExecutionGroup as f } from "./worldTransitionExecutor.js";
|
|
11
|
+
import { assertWorldInstanceSeatAdmission as p } from "./worldInstanceAdmission.js";
|
|
12
|
+
import { and as m, eq as h } from "@voltro/database";
|
|
13
|
+
import { Subject as g } from "@voltro/protocol";
|
|
14
|
+
import { Effect as _, Schema as v } from "effect";
|
|
15
|
+
// src/worldTransitionSeats.ts
|
|
16
|
+
function y() {
|
|
17
|
+
throw new e({ detail: "World target Seat authority is incomplete or changed" });
|
|
18
|
+
}
|
|
19
|
+
var b = (e, t) => {
|
|
20
|
+
let n = e && typeof e == "object" ? Object.getOwnPropertyDescriptor(e, t) : void 0;
|
|
21
|
+
return !n || !("value" in n) || typeof n.value != "function" ? y() : n.value.bind(e);
|
|
22
|
+
}, x = (t) => _.suspend(() => {
|
|
23
|
+
let n = t();
|
|
24
|
+
return _.isEffect(n) ? n : _.fail(new e({ detail: "World target Seat operation requires an Effect" }));
|
|
25
|
+
}).pipe(_.catchCause(() => _.fail(new e({ detail: "World target Seat operation remains incomplete" })))), S = (S, C) => {
|
|
26
|
+
for (let e of [
|
|
27
|
+
"tenantId",
|
|
28
|
+
"worlds",
|
|
29
|
+
"states",
|
|
30
|
+
"reservations",
|
|
31
|
+
"authorize"
|
|
32
|
+
]) {
|
|
33
|
+
let t = Object.getOwnPropertyDescriptor(C, e);
|
|
34
|
+
t && "value" in t || y();
|
|
35
|
+
}
|
|
36
|
+
let w = Object.getOwnPropertyDescriptor(C, "pendingAdmission");
|
|
37
|
+
(w && (!("value" in w) || w.value !== !0) || !w && "pendingAdmission" in C) && y();
|
|
38
|
+
let T = Object.getOwnPropertyDescriptor(C, "maxGroupRows");
|
|
39
|
+
(T && (!("value" in T) || !Number.isSafeInteger(T.value) || T.value < 1 || T.value > 1024) || !T && "maxGroupRows" in C) && y();
|
|
40
|
+
let E = T?.value, D = w?.value === !0, O = C.tenantId, k = r(C.worlds);
|
|
41
|
+
(typeof O != "string" || !O || O.length > 191 || !k.length) && y();
|
|
42
|
+
let A = Object.getOwnPropertyDescriptor(C, "epochNow");
|
|
43
|
+
(A && (!("value" in A) || typeof A.value != "function") || !A && ("epochNow" in C || k.some((e) => e.instances.length > 0))) && y();
|
|
44
|
+
let j = A ? b(C, "epochNow") : void 0, M = b(C.states, "observe"), N = Object.getOwnPropertyDescriptor(C.states, "withActorFollower");
|
|
45
|
+
(N && (!("value" in N) || typeof N.value != "function") || !N && "withActorFollower" in C.states) && y();
|
|
46
|
+
let P = N ? b(C.states, "withActorFollower") : void 0, F = Object.getOwnPropertyDescriptor(C.reservations, "reissueBatchMember");
|
|
47
|
+
(F && (!("value" in F) || typeof F.value != "function") || !F && "reissueBatchMember" in C.reservations) && y();
|
|
48
|
+
let I = F ? b(C.reservations, "reissueBatchMember") : void 0, L = b(C.reservations, "reserveBatch"), R = b(C.reservations, "replayBatch"), z = Object.getOwnPropertyDescriptor(C.reservations, "replayBatchMember");
|
|
49
|
+
(z && (!("value" in z) || typeof z.value != "function") || !z && "replayBatchMember" in C.reservations) && y();
|
|
50
|
+
let B = z ? b(C.reservations, "replayBatchMember") : void 0, V = b(C.reservations, "releaseBatch"), H = Object.getOwnPropertyDescriptor(C, "withdraw");
|
|
51
|
+
(H && (!("value" in H) || typeof H.value != "function") || !H && "withdraw" in C) && y();
|
|
52
|
+
let U = H ? b(C, "withdraw") : void 0, W = b(C, "authorize"), G = (e) => x(() => M(e)).pipe(_.map((t) => !t || t.group && E === void 0 || t.origin.tenantId !== O || e.tenantId !== O || t.origin.roomId !== e.roomId || t.origin.requestId !== e.requestId ? y() : t)), K = (e) => c(S, M, e, E ?? 1), q = (e, t, n) => _.gen(function* () {
|
|
53
|
+
yield* d(t, e, n);
|
|
54
|
+
let r = yield* K(e);
|
|
55
|
+
if (e.group) {
|
|
56
|
+
let i = yield* f(t, e, n);
|
|
57
|
+
if (i.length !== r.length || r.some((e) => !i.some((t) => t.id === e.id && t.entityId === e.entityId && t.revision === e.revision && t.phase === e.phase))) return y();
|
|
58
|
+
}
|
|
59
|
+
return r;
|
|
60
|
+
}), J = (e, t, n) => e.requestId !== l(t, D).requestId || e.seats.length !== t.length || t.some((t) => e.seats.filter((e) => e.subjectId === t.subject?.id && e.roomId === t.target.roomId).length !== 1) ? y() : e.seats.find((e) => e.subjectId === n.subject?.id && e.roomId === n.target.roomId) ?? y(), Y = (e, t) => {
|
|
61
|
+
if (e.intent.target.kind === "instance") return j ? {
|
|
62
|
+
identity: {
|
|
63
|
+
tenantId: O,
|
|
64
|
+
worldId: e.target.worldId,
|
|
65
|
+
instance: e.intent.target.instance,
|
|
66
|
+
groupId: e.intent.target.group
|
|
67
|
+
},
|
|
68
|
+
source: u(S, {
|
|
69
|
+
worlds: k,
|
|
70
|
+
epochNow: j,
|
|
71
|
+
maxManagedGroups: 65536,
|
|
72
|
+
authorize: () => x(() => W(t, e))
|
|
73
|
+
})
|
|
74
|
+
} : y();
|
|
75
|
+
}, X = async (e, t) => {
|
|
76
|
+
if (t.intent.target.kind !== "instance") return;
|
|
77
|
+
if (!j) return y();
|
|
78
|
+
let r = await e.query({
|
|
79
|
+
table: n,
|
|
80
|
+
predicate: m(h("id", t.target.roomId), h("tenantId", O)),
|
|
81
|
+
order: [],
|
|
82
|
+
take: 2,
|
|
83
|
+
skip: void 0,
|
|
84
|
+
projection: void 0
|
|
85
|
+
});
|
|
86
|
+
if (r.length !== 1) return y();
|
|
87
|
+
await p(e, r[0], k, j);
|
|
88
|
+
}, Z = (t, r = "prepare") => _.tryPromise({
|
|
89
|
+
try: async () => {
|
|
90
|
+
let e = k.find((e) => e.name === t.target.worldId);
|
|
91
|
+
if (!e) return y();
|
|
92
|
+
let s = i(e, {
|
|
93
|
+
zone: t.target.zoneId,
|
|
94
|
+
at: t.target.at
|
|
95
|
+
}).id, c = await S.query({
|
|
96
|
+
table: n,
|
|
97
|
+
predicate: m(h("id", t.target.roomId), h("tenantId", O)),
|
|
98
|
+
order: [],
|
|
99
|
+
take: 2,
|
|
100
|
+
skip: void 0,
|
|
101
|
+
projection: void 0
|
|
102
|
+
}), l = c[0];
|
|
103
|
+
if (c.length !== 1 || l.epoch !== t.target.epoch || l.state !== "live" || l.erasure != null || l.snapshotErasure != null) return y();
|
|
104
|
+
await a(S, e, l);
|
|
105
|
+
let u = Y(t, r);
|
|
106
|
+
if (u) {
|
|
107
|
+
let e = await _.runPromise(u.source.observe(u.identity));
|
|
108
|
+
return !e || e.state !== "live" || e.expired || e.roomId !== t.target.roomId || e.epoch !== t.target.epoch || e.hostId !== l.hostId ? y() : void 0;
|
|
109
|
+
}
|
|
110
|
+
let d = await S.query({
|
|
111
|
+
table: o,
|
|
112
|
+
predicate: m(h("tenantId", O), h("worldId", e.name), h("zoneId", t.target.zoneId), h("cellId", s), h("layer", t.target.layer)),
|
|
113
|
+
order: [],
|
|
114
|
+
take: 2,
|
|
115
|
+
skip: void 0,
|
|
116
|
+
projection: void 0
|
|
117
|
+
});
|
|
118
|
+
if (d.length !== 1 || d[0].roomId !== t.target.roomId || d[0].epoch !== t.target.epoch || d[0].hostId !== l.hostId || d[0].state !== "live") return y();
|
|
119
|
+
},
|
|
120
|
+
catch: () => new e({ detail: "World target Seat lost its actual placement" })
|
|
121
|
+
}), Q = (e) => G(e.origin).pipe(_.map((t) => {
|
|
122
|
+
(t.id !== e.id || t.revision !== e.revision || t.phase !== e.phase) && y();
|
|
123
|
+
})), $ = (n, r) => {
|
|
124
|
+
try {
|
|
125
|
+
let e = t(n, 4096);
|
|
126
|
+
return x(() => r(e));
|
|
127
|
+
} catch {
|
|
128
|
+
return _.fail(new e({ detail: "Invalid World target Seat origin" }));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
return Object.freeze({
|
|
132
|
+
follow: (t, r) => {
|
|
133
|
+
let i;
|
|
134
|
+
try {
|
|
135
|
+
i = v.decodeUnknownSync(g)(structuredClone(r)), "scopes" in i && i.scopes && Object.freeze(i.scopes), Object.freeze(i);
|
|
136
|
+
} catch {
|
|
137
|
+
return _.fail(new e({ detail: "World follow requires an authenticated Subject" }));
|
|
138
|
+
}
|
|
139
|
+
return $(t, (t) => _.gen(function* () {
|
|
140
|
+
if (!D || !P || !I || i.type !== "user" || i.tenantId !== O) return y();
|
|
141
|
+
let r = yield* G(t), a = i.kind === "guest" ? "guest" : "user";
|
|
142
|
+
if (r.phase !== "settled" || !r.groupProceed || !r.groupCommand || r.subject?.id !== i.id || r.subject.kind !== a) return y();
|
|
143
|
+
yield* x(() => W("follow", r, i));
|
|
144
|
+
let o = yield* K(r), c = l(o, !0), u = yield* _.tryPromise({
|
|
145
|
+
try: async () => {
|
|
146
|
+
let e = await S.query({
|
|
147
|
+
table: n,
|
|
148
|
+
predicate: m(h("id", r.target.roomId), h("tenantId", O)),
|
|
149
|
+
order: [],
|
|
150
|
+
take: 2,
|
|
151
|
+
skip: void 0,
|
|
152
|
+
projection: ["hostId", "epoch"]
|
|
153
|
+
}), t = e[0];
|
|
154
|
+
return e.length !== 1 || typeof t.hostId != "string" || typeof t.epoch != "number" || !Number.isSafeInteger(t.epoch) || t.epoch < r.target.epoch ? y() : {
|
|
155
|
+
hostId: t.hostId,
|
|
156
|
+
epoch: t.epoch
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
catch: () => new e({ detail: "World follower current owner is unavailable" })
|
|
160
|
+
});
|
|
161
|
+
yield* Z({
|
|
162
|
+
...r,
|
|
163
|
+
target: {
|
|
164
|
+
...r.target,
|
|
165
|
+
epoch: u.epoch
|
|
166
|
+
}
|
|
167
|
+
}, "follow");
|
|
168
|
+
let d = yield* x(() => I(c, i.id, (e) => x(() => P({
|
|
169
|
+
origin: r.origin,
|
|
170
|
+
roomId: r.target.roomId,
|
|
171
|
+
hostId: u.hostId,
|
|
172
|
+
epoch: u.epoch,
|
|
173
|
+
subjectId: i.id,
|
|
174
|
+
subjectKind: a
|
|
175
|
+
}, async (t, n) => {
|
|
176
|
+
if (n.id !== r.id || n.revision !== r.revision || n.entityId !== r.entityId) return y();
|
|
177
|
+
await X(t, n);
|
|
178
|
+
let i = await e(t);
|
|
179
|
+
return await X(t, n), i;
|
|
180
|
+
}))));
|
|
181
|
+
return d.roomId !== r.target.roomId || d.sessionId !== s(c, c.seats.findIndex((e) => e.subjectId === i.id)) ? y() : (yield* Q(r), d);
|
|
182
|
+
}));
|
|
183
|
+
},
|
|
184
|
+
prepare: (e, t) => $(e, (e) => _.gen(function* () {
|
|
185
|
+
let n = yield* G(e);
|
|
186
|
+
if (n.phase !== "reserving") return y();
|
|
187
|
+
let r = yield* q(n, t, "prepare");
|
|
188
|
+
for (let e of r) {
|
|
189
|
+
if ([
|
|
190
|
+
"requested",
|
|
191
|
+
"failed",
|
|
192
|
+
"rolledBack",
|
|
193
|
+
"committed",
|
|
194
|
+
"settled"
|
|
195
|
+
].includes(e.phase)) return y();
|
|
196
|
+
yield* x(() => W("prepare", e)), e.subject && (yield* Z(e));
|
|
197
|
+
}
|
|
198
|
+
if (!n.subject) return null;
|
|
199
|
+
let i = Y(n, "prepare");
|
|
200
|
+
if (i && r.some((e) => e.intent.target.kind !== "instance" || e.intent.target.instance !== i.identity.instance || e.intent.target.group !== i.identity.groupId || e.target.worldId !== i.identity.worldId || e.target.roomId !== n.target.roomId || e.target.epoch !== n.target.epoch)) return y();
|
|
201
|
+
let a = yield* x(() => L(l(r, D), i ? (e) => i.source.withAdmission(i.identity, async (t, r) => r.roomId !== n.target.roomId || r.epoch !== n.target.epoch ? y() : e(t)) : void 0));
|
|
202
|
+
for (let e of r) yield* Q(e), yield* Z(e);
|
|
203
|
+
return yield* q(n, t, "prepare"), J(a, r, n);
|
|
204
|
+
})),
|
|
205
|
+
reservation: (t, n) => {
|
|
206
|
+
let r;
|
|
207
|
+
try {
|
|
208
|
+
r = v.decodeUnknownSync(g)(structuredClone(n)), "scopes" in r && r.scopes && Object.freeze(r.scopes), Object.freeze(r);
|
|
209
|
+
} catch {
|
|
210
|
+
return _.fail(new e({ detail: "World target reservation requires an authenticated Subject" }));
|
|
211
|
+
}
|
|
212
|
+
return $(t, (e) => _.gen(function* () {
|
|
213
|
+
let t = yield* G(e);
|
|
214
|
+
if (r.type !== "user" || r.tenantId !== O || t.subject?.id !== r.id || t.subject.kind !== (r.kind === "guest" ? "guest" : "user") || [
|
|
215
|
+
"requested",
|
|
216
|
+
"reserving",
|
|
217
|
+
"failed",
|
|
218
|
+
"rolledBack"
|
|
219
|
+
].includes(t.phase)) return y();
|
|
220
|
+
let n = yield* K(t);
|
|
221
|
+
for (let e of n) {
|
|
222
|
+
if ([
|
|
223
|
+
"requested",
|
|
224
|
+
"reserving",
|
|
225
|
+
"failed",
|
|
226
|
+
"rolledBack"
|
|
227
|
+
].includes(e.phase)) return y();
|
|
228
|
+
yield* Z(e, "reservation");
|
|
229
|
+
}
|
|
230
|
+
yield* x(() => W("reservation", t, r));
|
|
231
|
+
let i = l(n, D);
|
|
232
|
+
if (t.group) {
|
|
233
|
+
if (!B) return y();
|
|
234
|
+
let e = yield* x(() => B(i, r.id));
|
|
235
|
+
for (let e of n) yield* Q(e), yield* Z(e, "reservation");
|
|
236
|
+
return e.roomId !== t.target.roomId || e.sessionId !== s(i, i.seats.findIndex((e) => e.subjectId === r.id)) ? y() : e;
|
|
237
|
+
}
|
|
238
|
+
let a = yield* x(() => R(i));
|
|
239
|
+
for (let e of n) yield* Q(e), yield* Z(e, "reservation");
|
|
240
|
+
return J(a, n, t);
|
|
241
|
+
}));
|
|
242
|
+
},
|
|
243
|
+
rollback: (e, t) => $(e, (e) => _.gen(function* () {
|
|
244
|
+
let n = yield* G(e);
|
|
245
|
+
if (n.phase !== "failed") return y();
|
|
246
|
+
let r = yield* q(n, t, "rollback");
|
|
247
|
+
for (let e of r) {
|
|
248
|
+
if (e.phase !== "failed") return y();
|
|
249
|
+
yield* x(() => W("rollback", e));
|
|
250
|
+
}
|
|
251
|
+
if (U) for (let e of r) n.group ? yield* ee(t, n, e, "rollback", (t) => x(() => U(e, t))) : yield* x(() => U(e, t)), yield* Q(e), yield* q(n, t, "rollback");
|
|
252
|
+
if (!n.subject) return null;
|
|
253
|
+
let i = yield* x(() => V(l(r, D)));
|
|
254
|
+
for (let e of r) yield* Q(e);
|
|
255
|
+
return yield* q(n, t, "rollback"), i;
|
|
256
|
+
}))
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
export { S as dataStoreWorldTransitionSeats };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { worldTransitionPhases as e } from "./worldCommands.js";
|
|
2
|
+
import { WORLD_TRANSITIONS_TABLE as t } from "./identities.js";
|
|
3
|
+
import { id as n, integer as r, json as i, table as a, text as o, timestamp as s } from "@voltro/database";
|
|
4
|
+
// src/worldTransitionState.ts
|
|
5
|
+
var c = a(t, {
|
|
6
|
+
id: n({ prefix: "wtran" }),
|
|
7
|
+
tenantId: o().maxLength(191),
|
|
8
|
+
entityId: o().maxLength(191),
|
|
9
|
+
subjectId: o().maxLength(191).nullable(),
|
|
10
|
+
subjectKind: o().maxLength(8).nullable(),
|
|
11
|
+
sourceRoomId: o().maxLength(191),
|
|
12
|
+
sourceWorldId: o().maxLength(120),
|
|
13
|
+
targetWorldId: o().maxLength(120),
|
|
14
|
+
requestId: o().maxLength(384),
|
|
15
|
+
requestKey: o().maxLength(64),
|
|
16
|
+
requestDigest: o().maxLength(64),
|
|
17
|
+
groupKey: o().maxLength(64).nullable(),
|
|
18
|
+
groupReceipt: i().nullable(),
|
|
19
|
+
groupCommandKey: o().maxLength(64).nullable(),
|
|
20
|
+
groupCommandReceipt: i().nullable(),
|
|
21
|
+
groupProceedReceipt: i().nullable(),
|
|
22
|
+
groupDriveAcknowledgedAt: s().nullable(),
|
|
23
|
+
readySession: i().nullable(),
|
|
24
|
+
readyAt: s().nullable(),
|
|
25
|
+
actorSnapshot: i().nullable(),
|
|
26
|
+
actorSnapshotRevision: r().nullable(),
|
|
27
|
+
actorFinalSnapshot: i().nullable(),
|
|
28
|
+
actorDepartureRevision: r().nullable(),
|
|
29
|
+
mode: o().maxLength(8),
|
|
30
|
+
phase: o().maxLength(16),
|
|
31
|
+
revision: r(),
|
|
32
|
+
requestedRevision: r(),
|
|
33
|
+
entityRevision: r(),
|
|
34
|
+
intent: i(),
|
|
35
|
+
source: i(),
|
|
36
|
+
target: i(),
|
|
37
|
+
sourceData: i(),
|
|
38
|
+
data: i(),
|
|
39
|
+
result: i().nullable(),
|
|
40
|
+
failure: o().maxLength(120).nullable(),
|
|
41
|
+
createdAt: s(),
|
|
42
|
+
updatedAt: s(),
|
|
43
|
+
committedAt: s().nullable()
|
|
44
|
+
}).unique("byWorldTransitionRequest", ["requestKey"]).index([
|
|
45
|
+
"tenantId",
|
|
46
|
+
"entityId",
|
|
47
|
+
"createdAt"
|
|
48
|
+
]).index([
|
|
49
|
+
"tenantId",
|
|
50
|
+
"subjectId",
|
|
51
|
+
"subjectKind"
|
|
52
|
+
]).index([
|
|
53
|
+
"tenantId",
|
|
54
|
+
"sourceWorldId",
|
|
55
|
+
"id"
|
|
56
|
+
]).index([
|
|
57
|
+
"tenantId",
|
|
58
|
+
"targetWorldId",
|
|
59
|
+
"id"
|
|
60
|
+
]).index("_voltro_world_transitions_source_idx", [
|
|
61
|
+
"tenantId",
|
|
62
|
+
"sourceRoomId",
|
|
63
|
+
"sourceWorldId",
|
|
64
|
+
"phase",
|
|
65
|
+
"id"
|
|
66
|
+
]).index(["tenantId", "groupKey"]).index(["tenantId", "groupCommandKey"]).index("_voltro_world_transitions_group_drive_idx", [
|
|
67
|
+
"tenantId",
|
|
68
|
+
"groupDriveAcknowledgedAt",
|
|
69
|
+
"groupCommandKey"
|
|
70
|
+
]).index("_voltro_world_transitions_pending_groups_idx", [
|
|
71
|
+
"groupDriveAcknowledgedAt",
|
|
72
|
+
"groupCommandKey",
|
|
73
|
+
"id"
|
|
74
|
+
]), l = (e, t) => {
|
|
75
|
+
switch (t) {
|
|
76
|
+
case "requested": return "reserving";
|
|
77
|
+
case "reserving": return "prepared";
|
|
78
|
+
case "prepared": return e === "seamless" ? "ghosting" : "persisting";
|
|
79
|
+
case "ghosting": return "switching";
|
|
80
|
+
case "persisting": return "detaching";
|
|
81
|
+
case "detaching": return "switching";
|
|
82
|
+
case "switching": return "committed";
|
|
83
|
+
case "committed": return "settled";
|
|
84
|
+
case "failed": return "rolledBack";
|
|
85
|
+
case "settled":
|
|
86
|
+
case "rolledBack": return null;
|
|
87
|
+
}
|
|
88
|
+
}, u = (e, t, n) => l(e, t) === n || n === "failed" && ![
|
|
89
|
+
"committed",
|
|
90
|
+
"settled",
|
|
91
|
+
"failed",
|
|
92
|
+
"rolledBack"
|
|
93
|
+
].includes(t);
|
|
94
|
+
export { t as WORLD_TRANSITIONS_TABLE, u as canAdvanceWorldTransition, l as nextWorldTransitionPhase, e as worldTransitionPhases, c as worldTransitionsTable };
|