@voltro/plugin-rooms 0.0.0-stage → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24329 -0
- package/LICENSE +61 -0
- package/README.md +9204 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +11322 -0
- package/dist/actor.js +1474 -0
- package/dist/apiBinding.js +678 -0
- package/dist/apiRegistryBinding.js +399 -0
- package/dist/apiReservations.js +433 -0
- package/dist/baselines.js +73 -0
- package/dist/bots.d.ts +1485 -0
- package/dist/bots.js +563 -0
- package/dist/catalog.js +80 -0
- package/dist/checkpointJson.js +24 -0
- package/dist/checkpointStore.js +386 -0
- package/dist/client.js +56 -0
- package/dist/clockSync.js +51 -0
- package/dist/collision.js +156 -0
- package/dist/commandDelivery.js +101 -0
- package/dist/commandRecord.js +11 -0
- package/dist/commandWithdrawal.js +183 -0
- package/dist/connection.js +497 -0
- package/dist/controlCarrier.js +375 -0
- package/dist/controlRegistry.js +79 -0
- package/dist/controlTarget.js +45 -0
- package/dist/controlTransport.js +574 -0
- package/dist/developmentBinding.js +113 -0
- package/dist/directory.js +323 -0
- package/dist/directoryProjection.js +117 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +53 -0
- package/dist/fixed.d.ts +284 -0
- package/dist/fixed.js +10 -0
- package/dist/fixed32.js +134 -0
- package/dist/fixedCollision.js +60 -0
- package/dist/fixedCollision32.js +109 -0
- package/dist/fixedMath.js +56 -0
- package/dist/fixedRaw.js +11 -0
- package/dist/fixedSlabs.js +34 -0
- package/dist/fixedTrig.js +48 -0
- package/dist/fixedTrig32.js +38 -0
- package/dist/fixedVectors.js +113 -0
- package/dist/fixedVectors32.js +95 -0
- package/dist/fixedWide.js +50 -0
- package/dist/fixedWords.js +46 -0
- package/dist/gateway.js +57 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
- package/dist/geometry-worker/worker.d.mts +2 -0
- package/dist/geometry-worker/worker.mjs +50 -0
- package/dist/geometry.d.ts +2249 -0
- package/dist/geometry.js +40 -0
- package/dist/geometryActivation.js +82 -0
- package/dist/geometryActorInventory.js +108 -0
- package/dist/geometryAdminClient.js +87 -0
- package/dist/geometryAdminData.js +32 -0
- package/dist/geometryAdminFixtures.js +50 -0
- package/dist/geometryAdminPorts.js +5 -0
- package/dist/geometryAdminRpc.js +58 -0
- package/dist/geometryAdminRpcRoutes.js +49 -0
- package/dist/geometryAdminSchemas.js +39 -0
- package/dist/geometryAdministration.js +190 -0
- package/dist/geometryAdministrationPorts.js +5 -0
- package/dist/geometryApiBinding.js +165 -0
- package/dist/geometryAppStorage.js +58 -0
- package/dist/geometryArtifacts.js +198 -0
- package/dist/geometryAssetBundle.js +117 -0
- package/dist/geometryAssetClient.js +25 -0
- package/dist/geometryAssetData.js +106 -0
- package/dist/geometryAssetHttp.js +123 -0
- package/dist/geometryAssetPorts.js +5 -0
- package/dist/geometryAssetRpc.js +30 -0
- package/dist/geometryAssetRpcRoutes.js +40 -0
- package/dist/geometryAssetStorageGrant.js +103 -0
- package/dist/geometryBoxOverlap.js +110 -0
- package/dist/geometryCatalogueDigest.js +111 -0
- package/dist/geometryCellCoverage.js +85 -0
- package/dist/geometryCellLoader.js +28 -0
- package/dist/geometryChannel.js +134 -0
- package/dist/geometryChunkHttp.js +54 -0
- package/dist/geometryChunkLeases.js +22 -0
- package/dist/geometryClient.d.ts +1429 -0
- package/dist/geometryClient.js +149 -0
- package/dist/geometryClientChunks.js +330 -0
- package/dist/geometryClientDelta.js +25 -0
- package/dist/geometryClientHttp.js +37 -0
- package/dist/geometryClientInterest.js +109 -0
- package/dist/geometryClientStatic.js +34 -0
- package/dist/geometryCms.d.ts +763 -0
- package/dist/geometryCms.js +217 -0
- package/dist/geometryCommitCoordinator.js +241 -0
- package/dist/geometryCompactionFixture.js +84 -0
- package/dist/geometryCompactionStrategies.js +38 -0
- package/dist/geometryConnectionClient.js +23 -0
- package/dist/geometryDerivationFixtures.js +141 -0
- package/dist/geometryDerivationStrategies.js +27 -0
- package/dist/geometryDigest.js +13 -0
- package/dist/geometryEditChannel.js +70 -0
- package/dist/geometryEditIngress.js +263 -0
- package/dist/geometryEdits.js +366 -0
- package/dist/geometryEnvelope.js +41 -0
- package/dist/geometryGridRaycast.js +92 -0
- package/dist/geometryGridSweep.js +92 -0
- package/dist/geometryHeightfield.js +166 -0
- package/dist/geometryHeightfieldRaycast.js +74 -0
- package/dist/geometryHeightfieldSweep.js +85 -0
- package/dist/geometryHeightfieldVolume.js +45 -0
- package/dist/geometryHost.js +322 -0
- package/dist/geometryHostDirectory.js +207 -0
- package/dist/geometryHostMutations.js +137 -0
- package/dist/geometryHostStreams.js +124 -0
- package/dist/geometryHttpBody.js +76 -0
- package/dist/geometryHttpRoutes.js +112 -0
- package/dist/geometryImportGltf.js +300 -0
- package/dist/geometryImportLdtk.js +54 -0
- package/dist/geometryImportPng.js +144 -0
- package/dist/geometryImportPublication.js +67 -0
- package/dist/geometryImportTiled.js +39 -0
- package/dist/geometryImportTiles.js +136 -0
- package/dist/geometryImportVox.js +130 -0
- package/dist/geometryImportedSource.js +101 -0
- package/dist/geometryInspectEndpoint.js +248 -0
- package/dist/geometryInspection.js +92 -0
- package/dist/geometryInstall.js +121 -0
- package/dist/geometryJournalArchiveData.js +21 -0
- package/dist/geometryJournalArchiveIndex.js +330 -0
- package/dist/geometryJournalArchiveTable.js +21 -0
- package/dist/geometryJournalCompaction.js +100 -0
- package/dist/geometryJournalPatch.js +47 -0
- package/dist/geometryJournalRetention.js +112 -0
- package/dist/geometryJournalRetentionSchemas.js +36 -0
- package/dist/geometryJournalRetentionSweep.js +112 -0
- package/dist/geometryJournalRetentionWorkflow.js +28 -0
- package/dist/geometryJournalRetentionWorkflowData.js +31 -0
- package/dist/geometryJournalStorage.js +148 -0
- package/dist/geometryLoader.js +118 -0
- package/dist/geometryManifest.js +113 -0
- package/dist/geometryManifestChannel.js +93 -0
- package/dist/geometryManifestClient.js +122 -0
- package/dist/geometryManifestData.js +49 -0
- package/dist/geometryManifestPorts.js +5 -0
- package/dist/geometryManifestPublication.js +109 -0
- package/dist/geometryManifestSource.js +68 -0
- package/dist/geometryMigrationJournal.js +14 -0
- package/dist/geometryMigrationStrategies.js +7 -0
- package/dist/geometryMigrations.js +323 -0
- package/dist/geometryNativeMetadata.js +52 -0
- package/dist/geometryPatch.js +170 -0
- package/dist/geometryPersistence.js +449 -0
- package/dist/geometryPersistenceCapture.js +69 -0
- package/dist/geometryPersistenceData.js +140 -0
- package/dist/geometryPersistencePorts.js +5 -0
- package/dist/geometryPlayerAdmission.js +34 -0
- package/dist/geometryPlayerEditOwner.js +265 -0
- package/dist/geometryPlayerEdits.js +49 -0
- package/dist/geometryPrepared.js +188 -0
- package/dist/geometryPrivacyFence.js +24 -0
- package/dist/geometryProceduralPublication.js +91 -0
- package/dist/geometryProceduralWorker.js +164 -0
- package/dist/geometryPublication.js +110 -0
- package/dist/geometryRayAlgebra.js +116 -0
- package/dist/geometryReadClient.js +157 -0
- package/dist/geometryReadPorts.js +5 -0
- package/dist/geometryReadRpc.js +27 -0
- package/dist/geometryReadRpcRoutes.js +47 -0
- package/dist/geometryReliablePublication.js +82 -0
- package/dist/geometryReloadPorts.js +46 -0
- package/dist/geometryReloadSource.js +278 -0
- package/dist/geometryRenderCache.js +165 -0
- package/dist/geometryRenderLod.js +102 -0
- package/dist/geometryRollback.js +125 -0
- package/dist/geometryRollbackCoordinator.js +203 -0
- package/dist/geometryRollbackPorts.js +46 -0
- package/dist/geometryRollbackSource.js +209 -0
- package/dist/geometryRollbackStore.js +198 -0
- package/dist/geometrySchemas.js +27 -0
- package/dist/geometryServer.d.ts +2766 -0
- package/dist/geometryServer.js +62 -0
- package/dist/geometryShapeRaycast.js +111 -0
- package/dist/geometryShapeSegments.js +34 -0
- package/dist/geometryShapes.js +223 -0
- package/dist/geometrySnapshot.js +76 -0
- package/dist/geometrySnapshotChannel.js +160 -0
- package/dist/geometrySnapshotClient.js +159 -0
- package/dist/geometrySnapshotPreparation.js +76 -0
- package/dist/geometrySnapshotServer.js +191 -0
- package/dist/geometrySqlOwner.js +21 -0
- package/dist/geometryStorage.js +127 -0
- package/dist/geometryStorageGrant.js +69 -0
- package/dist/geometryStorageIdentity.js +9 -0
- package/dist/geometryTileArtifact.js +10 -0
- package/dist/geometryTileCodec.js +194 -0
- package/dist/geometryTileCollision.js +96 -0
- package/dist/geometryTileNavigation.js +128 -0
- package/dist/geometryTileView.js +35 -0
- package/dist/geometryVersionActivation.js +114 -0
- package/dist/geometryVersionClient.js +238 -0
- package/dist/geometryVersionCompare.js +40 -0
- package/dist/geometryVersionMigration.js +106 -0
- package/dist/geometryVoxel.js +253 -0
- package/dist/geometryWorldEntitySubject.js +32 -0
- package/dist/geometryWorldExtent.js +12 -0
- package/dist/geometryWorldMetadata.js +38 -0
- package/dist/geometryWorldStrategyFixtures.js +127 -0
- package/dist/geometryWorldView.js +307 -0
- package/dist/host.js +128 -0
- package/dist/hostBinding.js +277 -0
- package/dist/hostCellObservation.js +114 -0
- package/dist/hostClientCapacity.js +90 -0
- package/dist/hostCommandScope.js +64 -0
- package/dist/hostController.js +3094 -0
- package/dist/hostDeployment.js +65 -0
- package/dist/hostDrain.js +152 -0
- package/dist/hostDrainPorts.js +5 -0
- package/dist/hostDriver.js +179 -0
- package/dist/hostLane.js +288 -0
- package/dist/hostListener.js +79 -0
- package/dist/hostListenerBinding.js +19 -0
- package/dist/hostLoopObservation.js +90 -0
- package/dist/hostMetrics.js +56 -0
- package/dist/hostRegistryBinding.js +418 -0
- package/dist/hostSelection.js +16 -0
- package/dist/hostShutdown.js +47 -0
- package/dist/hostTurnObservation.js +53 -0
- package/dist/identities.js +4 -0
- package/dist/index.d.ts +8632 -0
- package/dist/index.js +232 -0
- package/dist/inputReceipts.js +63 -0
- package/dist/inputRedundancy.js +55 -0
- package/dist/inspect.js +238 -0
- package/dist/lockstep.d.ts +436 -0
- package/dist/lockstep.js +382 -0
- package/dist/lockstepAdmission.js +262 -0
- package/dist/lockstepAdmissionCodec.js +94 -0
- package/dist/lockstepAdmissionPorts.js +5 -0
- package/dist/lockstepClientSession.js +578 -0
- package/dist/lockstepDefinition.js +148 -0
- package/dist/lockstepHostLoop.js +243 -0
- package/dist/lockstepInitialAdmission.js +67 -0
- package/dist/lockstepInitialStrategyFixtures.js +45 -0
- package/dist/lockstepJournal.js +395 -0
- package/dist/lockstepJournalCodec.js +254 -0
- package/dist/lockstepJournalPorts.js +5 -0
- package/dist/lockstepJournalRebuild.js +208 -0
- package/dist/lockstepJournalRows.js +57 -0
- package/dist/lockstepMembers.js +131 -0
- package/dist/lockstepMessages.js +47 -0
- package/dist/lockstepOwnedRoom.js +764 -0
- package/dist/lockstepPolicies.js +84 -0
- package/dist/lockstepReact.js +47 -0
- package/dist/lockstepRecoveryTruth.js +121 -0
- package/dist/lockstepRosterConfig.js +32 -0
- package/dist/lockstepSeed.js +12 -0
- package/dist/lockstepSeedFixture.js +20 -0
- package/dist/lockstepServer.d.ts +3897 -0
- package/dist/lockstepServer.js +325 -0
- package/dist/lockstepServerConfig.js +101 -0
- package/dist/lockstepServerRoles.js +403 -0
- package/dist/lockstepServerStrategyFixtures.js +33 -0
- package/dist/lockstepStrategies.js +6 -0
- package/dist/lockstepStrategyFixtures.js +137 -0
- package/dist/lockstepTerminal.js +90 -0
- package/dist/lockstepTerminalPorts.js +5 -0
- package/dist/lockstepTransport.js +773 -0
- package/dist/lockstepTransportConfig.js +32 -0
- package/dist/lockstepWireRoster.js +34 -0
- package/dist/matchRoomProvider.js +32 -0
- package/dist/matchRooms.js +19 -0
- package/dist/membershipObserver.js +47 -0
- package/dist/moderation.js +98 -0
- package/dist/movementSpecials.js +104 -0
- package/dist/ownership.js +17 -0
- package/dist/ownershipWithdrawal.js +18 -0
- package/dist/pcg32.js +96 -0
- package/dist/ports.d.ts +1241 -0
- package/dist/ports.js +11 -0
- package/dist/quaternion.js +70 -0
- package/dist/react.d.ts +406 -0
- package/dist/react.js +109 -0
- package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
- package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
- package/dist/reaper.js +243 -0
- package/dist/reaperSchemas.js +42 -0
- package/dist/reaperWorkflow.js +70 -0
- package/dist/recovery.js +189 -0
- package/dist/recoverySeats.js +26 -0
- package/dist/replay.d.ts +273 -0
- package/dist/replay.js +485 -0
- package/dist/replayPorts.js +5 -0
- package/dist/replayRecording.js +67 -0
- package/dist/replaySchema.js +157 -0
- package/dist/replayStorage.d.ts +149 -0
- package/dist/replayStorage.js +485 -0
- package/dist/reservationBatch.js +422 -0
- package/dist/reservationSchemas.js +17 -0
- package/dist/reservations.js +259 -0
- package/dist/reservePort.js +69 -0
- package/dist/resolvedOptions.js +4 -0
- package/dist/room.d.ts +1006 -0
- package/dist/room.js +284 -0
- package/dist/roomAccessSweep.js +95 -0
- package/dist/roomAppCommandControl.js +59 -0
- package/dist/roomAuthoringStrategy.js +17 -0
- package/dist/roomErasure.js +198 -0
- package/dist/roomPoolRuntimeDefaults.js +24 -0
- package/dist/roomPoolSelection.js +19 -0
- package/dist/roomPoolTopology.js +212 -0
- package/dist/rpc.d.ts +551 -0
- package/dist/rpc.js +112 -0
- package/dist/rpcClient.js +152 -0
- package/dist/rpcRoutes.js +28 -0
- package/dist/runtime.js +1123 -0
- package/dist/schemaHistory.js +98 -0
- package/dist/seatStore.js +151 -0
- package/dist/seatStrategyFixtures.js +52 -0
- package/dist/seatSubject.js +32 -0
- package/dist/seats.js +130 -0
- package/dist/serverSession.js +811 -0
- package/dist/serverSessionConfig.js +43 -0
- package/dist/sessionAdmission.js +53 -0
- package/dist/sidecarAdmission.js +103 -0
- package/dist/sidecarConfig.js +116 -0
- package/dist/sidecarConfigPublication.js +64 -0
- package/dist/sidecarHostListener.js +208 -0
- package/dist/sidecarIpc.js +205 -0
- package/dist/sidecarPeer.js +310 -0
- package/dist/sidecarProcessPort.js +28 -0
- package/dist/sidecarRuntime.js +168 -0
- package/dist/sidecarSelection.js +142 -0
- package/dist/sidecarWire.js +178 -0
- package/dist/sidecarWrites.js +163 -0
- package/dist/simulation.d.ts +391 -0
- package/dist/simulation.js +282 -0
- package/dist/simulationAuthoring.js +29 -0
- package/dist/simulationBytes.js +27 -0
- package/dist/simulationConformance.js +305 -0
- package/dist/simulationInputHistoryCapture.js +35 -0
- package/dist/simulationInputHistoryWire.js +193 -0
- package/dist/simulationOptionsWire.js +78 -0
- package/dist/simulationRecoveryWire.js +134 -0
- package/dist/simulationReplay.js +127 -0
- package/dist/simulationSnapshotWire.js +112 -0
- package/dist/simulationState.js +178 -0
- package/dist/snapshotBlob.js +126 -0
- package/dist/snapshotBlobCleanup.js +93 -0
- package/dist/snapshotBlobIndex.js +38 -0
- package/dist/snapshotBudget.js +80 -0
- package/dist/snapshotChain.js +185 -0
- package/dist/snapshotErasure.js +172 -0
- package/dist/snapshotInspection.js +105 -0
- package/dist/snapshotSegmentBlobs.js +58 -0
- package/dist/snapshotUploads.js +166 -0
- package/dist/socketTransport.js +253 -0
- package/dist/spatial.js +104 -0
- package/dist/spectatorPolicy.js +26 -0
- package/dist/spectatorProducer.js +89 -0
- package/dist/startFailureCause.js +4 -0
- package/dist/stateCodec.js +658 -0
- package/dist/strategies.d.ts +210 -0
- package/dist/strategies.js +8 -0
- package/dist/strategiesServer.d.ts +286 -0
- package/dist/strategiesServer.js +11 -0
- package/dist/strategyFixtures.js +182 -0
- package/dist/streamFraming.js +122 -0
- package/dist/streamTransport.js +266 -0
- package/dist/subjectAdmission.js +50 -0
- package/dist/subjectPrivacy.js +281 -0
- package/dist/subjectPrivacyBinding.js +90 -0
- package/dist/systemManifest.js +182 -0
- package/dist/tables.js +159 -0
- package/dist/testHarness.js +89 -0
- package/dist/testing.d.ts +3684 -0
- package/dist/testing.js +221 -0
- package/dist/testingPorts.js +271 -0
- package/dist/testingServer.d.ts +4060 -0
- package/dist/testingServer.js +18 -0
- package/dist/transform.d.ts +692 -0
- package/dist/transform.js +217 -0
- package/dist/transform3d.js +118 -0
- package/dist/transformCollection.js +24 -0
- package/dist/transformCollection3d.js +24 -0
- package/dist/transformCollectionCore.js +156 -0
- package/dist/transformFrames.js +121 -0
- package/dist/transformPrediction3d.js +127 -0
- package/dist/transformRules.js +123 -0
- package/dist/transformSchemas.js +20 -0
- package/dist/transport.js +32 -0
- package/dist/transportAuthoring.js +29 -0
- package/dist/transportCleanup.js +22 -0
- package/dist/transportConformance.js +124 -0
- package/dist/transportConnector.js +82 -0
- package/dist/transportEndpoints.js +38 -0
- package/dist/transportsServer.d.ts +5515 -0
- package/dist/transportsServer.js +6 -0
- package/dist/viewProjection.js +16 -0
- package/dist/web.d.ts +2286 -0
- package/dist/web.js +518 -0
- package/dist/webTransportClient.js +173 -0
- package/dist/wire.d.ts +992 -0
- package/dist/wire.js +492 -0
- package/dist/withdrawalPort.js +28 -0
- package/dist/world.d.ts +1894 -0
- package/dist/world.js +333 -0
- package/dist/worldActorReceipts.js +48 -0
- package/dist/worldActorTransferSnapshot.js +14 -0
- package/dist/worldAdmissionPending.js +8 -0
- package/dist/worldBoundaryCoordinator.js +148 -0
- package/dist/worldCatalog.js +81 -0
- package/dist/worldCellAllocation.js +203 -0
- package/dist/worldCellDestination.js +68 -0
- package/dist/worldCells.js +489 -0
- package/dist/worldChange.js +32 -0
- package/dist/worldClient.js +664 -0
- package/dist/worldClientControl.js +141 -0
- package/dist/worldClientPendingInput.js +16 -0
- package/dist/worldClientRpc.js +133 -0
- package/dist/worldClientRpcRoutes.js +43 -0
- package/dist/worldClientSchemas.js +28 -0
- package/dist/worldCommands.js +140 -0
- package/dist/worldData.js +42 -0
- package/dist/worldDefaultBinding.js +377 -0
- package/dist/worldDefaultGroupAdmission.js +82 -0
- package/dist/worldDefaultGroupAppServices.js +31 -0
- package/dist/worldDefaultGroupCompensation.js +109 -0
- package/dist/worldDefaultGroupContinuation.js +96 -0
- package/dist/worldDefaultGroupControl.js +72 -0
- package/dist/worldDefaultGroupMembers.js +85 -0
- package/dist/worldDefaultGroups.js +21 -0
- package/dist/worldDefaultPending.js +79 -0
- package/dist/worldDefaultService.js +245 -0
- package/dist/worldEntities.js +2980 -0
- package/dist/worldEntityCodec.js +21 -0
- package/dist/worldEntityHandoffView.js +154 -0
- package/dist/worldGeometry.js +170 -0
- package/dist/worldGhostAdmission.js +65 -0
- package/dist/worldGhostDestination.js +118 -0
- package/dist/worldGhostGateway.js +132 -0
- package/dist/worldGhostHandshake.js +108 -0
- package/dist/worldGhostHost.js +42 -0
- package/dist/worldGhostIngress.js +132 -0
- package/dist/worldGhostNeighborhood.js +70 -0
- package/dist/worldGhostNeighbors.js +86 -0
- package/dist/worldGhostOutbound.js +110 -0
- package/dist/worldGhostPublisher.js +216 -0
- package/dist/worldGhostReceiver.js +213 -0
- package/dist/worldGhostSender.js +146 -0
- package/dist/worldGhostSocket.js +78 -0
- package/dist/worldGhostWire.js +172 -0
- package/dist/worldGroupCommand.js +49 -0
- package/dist/worldGroupDeadline.js +115 -0
- package/dist/worldGroupPreparation.js +115 -0
- package/dist/worldGroupReadyControl.js +128 -0
- package/dist/worldGroupSupervisor.js +120 -0
- package/dist/worldHandoffMetrics.js +59 -0
- package/dist/worldHandoffView.js +100 -0
- package/dist/worldHostSource.js +69 -0
- package/dist/worldInspectEndpoint.js +250 -0
- package/dist/worldInspection.js +109 -0
- package/dist/worldInstanceAdmission.js +31 -0
- package/dist/worldInstanceAllocation.js +116 -0
- package/dist/worldInstanceDestination.js +64 -0
- package/dist/worldInstanceExpiry.js +282 -0
- package/dist/worldInstanceExpirySupervisor.js +88 -0
- package/dist/worldInstanceLifecycle.js +103 -0
- package/dist/worldInstanceState.js +52 -0
- package/dist/worldInstances.js +478 -0
- package/dist/worldJoin.js +56 -0
- package/dist/worldLayers.js +151 -0
- package/dist/worldLeases.js +78 -0
- package/dist/worldManifest.js +25 -0
- package/dist/worldMovement.js +63 -0
- package/dist/worldPersistence.js +134 -0
- package/dist/worldProjection.js +221 -0
- package/dist/worldReact.js +110 -0
- package/dist/worldRecoveryActor.js +35 -0
- package/dist/worldReturnAnchor.js +49 -0
- package/dist/worldRoomHooks.js +57 -0
- package/dist/worldRoomPool.js +27 -0
- package/dist/worldRoomSteps.js +133 -0
- package/dist/worldSeatBinding.js +36 -0
- package/dist/worldServer.d.ts +6936 -0
- package/dist/worldServer.js +48 -0
- package/dist/worldSourceSeatPending.js +9 -0
- package/dist/worldStrategyFixtures.js +164 -0
- package/dist/worldTesting.js +27 -0
- package/dist/worldTransitionDefaults.js +198 -0
- package/dist/worldTransitionExecutor.js +519 -0
- package/dist/worldTransitionGroup.js +113 -0
- package/dist/worldTransitionPhysicalSteps.js +40 -0
- package/dist/worldTransitionResolver.js +228 -0
- package/dist/worldTransitionSeatGroup.js +64 -0
- package/dist/worldTransitionSeats.js +260 -0
- package/dist/worldTransitionState.js +95 -0
- package/dist/worldTransitions.js +101 -0
- package/package.json +189 -4
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t, WorldTransitionCooldown as n } from "./errors.js";
|
|
2
|
+
import { captureSimulationBytes as r } from "./simulationBytes.js";
|
|
3
|
+
import { geometryOwnData as i } from "./geometryTileCodec.js";
|
|
4
|
+
import { captureGeometryDense as a, captureGeometryPersistenceScope as o, captureGeometryPrivacyTarget as s, geometryPersistenceId as c } from "./geometryPersistenceData.js";
|
|
5
|
+
import { captureRoomGeometryReloadRequest as l, captureRoomGeometryRollbackRequest as u } from "./geometryAdminData.js";
|
|
6
|
+
import { captureGeometryPreparedScope as d } from "./geometryPrepared.js";
|
|
7
|
+
import { decodeGeometryPatch as f } from "./geometryPatch.js";
|
|
8
|
+
import { worldTransitionRequest as p } from "./worldCommands.js";
|
|
9
|
+
import { captureGeometryAssetReadGrant as m, captureGeometryAssetReadRequest as h } from "./geometryAssetData.js";
|
|
10
|
+
import { captureWorldClientPendingInput as g } from "./worldClientPendingInput.js";
|
|
11
|
+
import { RoomReservationSchema as _ } from "./reservationSchemas.js";
|
|
12
|
+
import { worldClientReceipt as v, worldClientTicket as y } from "./worldClient.js";
|
|
13
|
+
import { captureWorldCatalog as b } from "./world.js";
|
|
14
|
+
import { assertRoomSubjectAdmission as x } from "./subjectAdmission.js";
|
|
15
|
+
import { assertGeometryJournalPatchReceipt as S, captureGeometryJournalArchiveReference as C } from "./geometryJournalArchiveData.js";
|
|
16
|
+
import { RoomReaperPort as w, RoomReservePort as T, RoomSubjectPrivacyPort as ee, WorldClientControlPort as te } from "./ports.js";
|
|
17
|
+
import { geometryPersistenceDigest as E } from "./geometryPersistenceCapture.js";
|
|
18
|
+
import { GeometryPersistencePort as ne } from "./geometryPersistencePorts.js";
|
|
19
|
+
import { GeometryVersionMigrationPort as re, captureGeometryMigrationReceipt as D, captureGeometryMigrationRequest as ie } from "./geometryMigrations.js";
|
|
20
|
+
import { RoomCatalog as O } from "./catalog.js";
|
|
21
|
+
import { RoomGeometryAdministrationPort as ae } from "./geometryAdministrationPorts.js";
|
|
22
|
+
import { captureGeometryJournalRetentionPayload as oe, captureGeometryJournalRetentionResult as se } from "./geometryJournalRetentionWorkflowData.js";
|
|
23
|
+
import { GeometryJournalRetentionSweepPort as ce } from "./geometryJournalRetentionSweep.js";
|
|
24
|
+
import { GeometryJournalArchiveIndexPort as le } from "./geometryJournalArchiveIndex.js";
|
|
25
|
+
import { GeometryAssetReadGrantPort as ue } from "./geometryAssetPorts.js";
|
|
26
|
+
import { GeometryStaticReadGrantPort as de } from "./geometryReadPorts.js";
|
|
27
|
+
import { GeometryManifestPort as fe } from "./geometryManifestPorts.js";
|
|
28
|
+
import { captureGeometryStreamManifest as k } from "./geometryManifestData.js";
|
|
29
|
+
import { captureRoomsGeometryBinding as A, makeRoomsGeometryFacade as pe } from "./geometryApiBinding.js";
|
|
30
|
+
import { captureAdmittedRoomPoolTopology as j, captureRoomPoolCatalog as M } from "./roomPoolTopology.js";
|
|
31
|
+
import { captureRoomAccessRecheckInput as me, captureRoomCloseAllInput as he, captureRoomCloseInput as ge, captureRoomKickInput as _e } from "./moderation.js";
|
|
32
|
+
import { Subject as N } from "@voltro/protocol";
|
|
33
|
+
import { Cause as P, Effect as F, Layer as I, Option as L, Schema as R } from "effect";
|
|
34
|
+
//#region src/apiBinding.ts
|
|
35
|
+
var z = class extends Error {
|
|
36
|
+
retryCleanup;
|
|
37
|
+
name = "RoomsApiBindFailure";
|
|
38
|
+
constructor(e) {
|
|
39
|
+
super("Rooms API binding cleanup remains incomplete"), this.retryCleanup = e;
|
|
40
|
+
}
|
|
41
|
+
}, B = class {
|
|
42
|
+
name;
|
|
43
|
+
binder;
|
|
44
|
+
worlds;
|
|
45
|
+
worldState;
|
|
46
|
+
worldClientControls;
|
|
47
|
+
geometryReadUrls;
|
|
48
|
+
geometryMigrationsEnabled;
|
|
49
|
+
geometryAssetUrls;
|
|
50
|
+
geometryJournalArchives;
|
|
51
|
+
geometryJournalRetention;
|
|
52
|
+
geometryAdminControls;
|
|
53
|
+
catalog;
|
|
54
|
+
pools;
|
|
55
|
+
phase = "unbound";
|
|
56
|
+
binding = null;
|
|
57
|
+
releaseBinding = null;
|
|
58
|
+
controller = null;
|
|
59
|
+
bindingTask = null;
|
|
60
|
+
closeTask = null;
|
|
61
|
+
active = 0;
|
|
62
|
+
store = null;
|
|
63
|
+
idle = null;
|
|
64
|
+
reservation;
|
|
65
|
+
privacy;
|
|
66
|
+
reaper;
|
|
67
|
+
moderation;
|
|
68
|
+
worldClientControl;
|
|
69
|
+
geometry;
|
|
70
|
+
geometryManifest;
|
|
71
|
+
geometryReadGrants;
|
|
72
|
+
geometryAssetGrants;
|
|
73
|
+
geometryMigration;
|
|
74
|
+
geometryArchives;
|
|
75
|
+
geometryAdministration;
|
|
76
|
+
geometryRetention;
|
|
77
|
+
services;
|
|
78
|
+
constructor(n, _, v = Object.freeze([]), O = "none", A = !1, j = !1, M = !1, P = !1, L = !1, z = !1, B = !1) {
|
|
79
|
+
if (this.name = n, this.binder = _, this.worlds = v, this.worldState = O, this.worldClientControls = A, this.geometryReadUrls = j, this.geometryMigrationsEnabled = M, this.geometryAssetUrls = P, this.geometryJournalArchives = L, this.geometryJournalRetention = z, this.geometryAdminControls = B, this.worlds = b(v), ![
|
|
80
|
+
"none",
|
|
81
|
+
"entities",
|
|
82
|
+
"transitions"
|
|
83
|
+
].includes(O) || O !== "none" && !this.worlds.length) throw new t({ detail: "World state requires a configured World catalogue" });
|
|
84
|
+
if (typeof A != "boolean" || A && O !== "transitions") throw new t({ detail: "World client controls require transition state" });
|
|
85
|
+
if (typeof j != "boolean" || j && !this.worlds.some((e) => e.geometry)) throw new t({ detail: "Geometry read URL routes require an actual geometry World" });
|
|
86
|
+
if (typeof P != "boolean" || P && !this.worlds.some((e) => e.geometry)) throw new t({ detail: "Geometry assets require an actual geometry World" });
|
|
87
|
+
if (typeof M != "boolean" || M && !this.worlds.some((e) => e.geometry)) throw new t({ detail: "Geometry migrations require an actual geometry World" });
|
|
88
|
+
if (typeof L != "boolean" || L && !this.worlds.some((e) => e.geometry)) throw new t({ detail: "Geometry journal archives require an actual geometry World" });
|
|
89
|
+
if (typeof z != "boolean" || z && !L) throw new t({ detail: "Geometry retention requires its actual archive module" });
|
|
90
|
+
if (this.geometryRetention = Object.freeze({ run: (e) => this.capturedCall(() => oe(e), (e, n) => !this.geometryJournalRetention || !e.geometry?.retention ? F.fail(new t({ detail: "Actual geometry retention sweep is not installed" })) : F.uninterruptible(F.suspend(() => {
|
|
91
|
+
let r = e.geometry.retention.run(n);
|
|
92
|
+
return F.isEffect(r) ? r : F.fail(new t({ detail: "Geometry retention requires its actual sweep Effect" }));
|
|
93
|
+
})).pipe(F.flatMap((e) => F.try({
|
|
94
|
+
try: () => se(e),
|
|
95
|
+
catch: () => new t({ detail: "Geometry retention did not confirm its bounded result" })
|
|
96
|
+
})))) }), typeof B != "boolean" || B && !this.worlds.some((e) => e.geometry)) throw new t({ detail: "Geometry administration requires its actual geometry World" });
|
|
97
|
+
this.geometryAdministration = Object.freeze({
|
|
98
|
+
reload: (e, n, r) => this.capturedCall(() => ({
|
|
99
|
+
roomId: c(e),
|
|
100
|
+
request: l(n),
|
|
101
|
+
subject: R.decodeUnknownSync(N)(structuredClone(r))
|
|
102
|
+
}), (e, n) => !this.geometryAdminControls || !e.geometry?.administration ? F.fail(new t({ detail: "Actual geometry administration source is not installed" })) : F.uninterruptible(F.suspend(() => {
|
|
103
|
+
let r = e.geometry.administration.reload(n.roomId, n.request, n.subject);
|
|
104
|
+
return F.isEffect(r) ? r : F.fail(new t({ detail: "Geometry administration requires its actual Effect" }));
|
|
105
|
+
})).pipe(F.flatMap((e) => e === void 0 ? F.void : F.fail(new t({ detail: "Actual geometry reload remains incomplete" }))))),
|
|
106
|
+
rollback: (e, n, r) => this.capturedCall(() => ({
|
|
107
|
+
roomId: c(e),
|
|
108
|
+
request: u(n),
|
|
109
|
+
subject: R.decodeUnknownSync(N)(structuredClone(r))
|
|
110
|
+
}), (e, n) => !this.geometryAdminControls || !e.geometry?.administration ? F.fail(new t({ detail: "Actual geometry administration source is not installed" })) : F.uninterruptible(F.suspend(() => {
|
|
111
|
+
let r = e.geometry.administration.rollback(n.roomId, n.request, n.subject);
|
|
112
|
+
return F.isEffect(r) ? r : F.fail(new t({ detail: "Geometry administration requires its actual Effect" }));
|
|
113
|
+
})).pipe(F.flatMap((e) => e === void 0 ? F.void : F.fail(new t({ detail: "Actual geometry rollback remains incomplete" }))))),
|
|
114
|
+
chunks: (e, n) => this.capturedCall(() => ({
|
|
115
|
+
roomId: c(e),
|
|
116
|
+
subject: R.decodeUnknownSync(N)(structuredClone(n))
|
|
117
|
+
}), (e, n) => {
|
|
118
|
+
let r = e.geometry?.administration?.chunks;
|
|
119
|
+
return !this.geometryAdminControls || !r ? F.fail(new t({ detail: "The geometry chunk view is not installed" })) : F.suspend(() => {
|
|
120
|
+
let e = r(n.roomId, n.subject);
|
|
121
|
+
return F.isEffect(e) ? e : F.fail(new t({ detail: "Geometry administration requires its actual Effect" }));
|
|
122
|
+
});
|
|
123
|
+
})
|
|
124
|
+
}), this.reservation = Object.freeze({
|
|
125
|
+
reserve: (e, t) => this.capturedCall(() => ({
|
|
126
|
+
input: structuredClone(e),
|
|
127
|
+
subject: structuredClone(t)
|
|
128
|
+
}), (e, t) => e.reservation.reserve(t.input, t.subject)),
|
|
129
|
+
resume: (e, t) => this.capturedCall(() => structuredClone(t), (t, n) => t.reservation.resume(e, n)),
|
|
130
|
+
leave: (e, t, n) => this.capturedCall(() => {
|
|
131
|
+
if (!(t instanceof Uint8Array) || t.byteLength < 1 || t.byteLength > 8192) throw Error("Invalid withdrawal bytes");
|
|
132
|
+
return {
|
|
133
|
+
token: Uint8Array.from(t),
|
|
134
|
+
subject: structuredClone(n)
|
|
135
|
+
};
|
|
136
|
+
}, (t, n) => t.reservation.leave(e, n.token, n.subject)),
|
|
137
|
+
list: (e, t, n) => this.capturedCall(() => structuredClone(t), (t, r) => t.reservation.list(e, r, n)),
|
|
138
|
+
prepareMatch: (e, n) => this.capturedCall(() => ({
|
|
139
|
+
input: structuredClone(e),
|
|
140
|
+
subject: structuredClone(n)
|
|
141
|
+
}), (e, n) => e.reservation.prepareMatch ? e.reservation.prepareMatch(n.input, n.subject) : F.fail(new t({ detail: "This Rooms binding cannot prepare match Rooms" })))
|
|
142
|
+
}), this.privacy = Object.freeze({
|
|
143
|
+
erase: (e) => this.privacyCall(e, (e, n) => e.privacy.erase(n).pipe(F.flatMap(() => e.geometry?.migrations === void 0 ? F.void : e.geometry.migrations.eraseSubject({
|
|
144
|
+
tenantId: n.target.tenantId,
|
|
145
|
+
requestId: n.requestId,
|
|
146
|
+
subject: {
|
|
147
|
+
id: n.target.subjectId,
|
|
148
|
+
kind: n.target.kind
|
|
149
|
+
}
|
|
150
|
+
}).pipe(F.mapError(() => new t({ detail: "Geometry migration erasure remains incomplete" })))), F.flatMap(() => e.worldState === void 0 ? F.void : e.worldState.onErase(n.target.subjectId, {
|
|
151
|
+
tenantId: n.target.tenantId,
|
|
152
|
+
requestId: n.requestId,
|
|
153
|
+
kind: n.target.kind
|
|
154
|
+
}).pipe(F.mapError(() => new t({ detail: "World state erasure remains incomplete" })))), F.flatMap(() => e.geometry === void 0 ? F.void : e.geometry.service.eraseSubject({
|
|
155
|
+
tenantId: n.target.tenantId,
|
|
156
|
+
requestId: n.requestId,
|
|
157
|
+
subject: {
|
|
158
|
+
id: n.target.subjectId,
|
|
159
|
+
kind: n.target.kind
|
|
160
|
+
}
|
|
161
|
+
}).pipe(F.mapError(() => new t({ detail: "Geometry erasure remains incomplete" })))), F.flatMap(() => e.geometry?.archives === void 0 ? F.void : e.geometry.archives.eraseSubject({
|
|
162
|
+
tenantId: n.target.tenantId,
|
|
163
|
+
requestId: n.requestId,
|
|
164
|
+
subject: {
|
|
165
|
+
id: n.target.subjectId,
|
|
166
|
+
kind: n.target.kind
|
|
167
|
+
}
|
|
168
|
+
}).pipe(F.mapError(() => new t({ detail: "Geometry archive erasure remains incomplete" })))))),
|
|
169
|
+
export: (e) => this.privacyCall(e, (e, n) => F.gen(function* () {
|
|
170
|
+
let r = yield* e.privacy.export(n), i = e.worldState === void 0 ? null : yield* e.worldState.onExport(n.target.subjectId, {
|
|
171
|
+
tenantId: n.target.tenantId,
|
|
172
|
+
requestId: n.requestId,
|
|
173
|
+
kind: n.target.kind
|
|
174
|
+
}).pipe(F.mapError(() => new t({ detail: "World state export remains incomplete" })));
|
|
175
|
+
if (e.geometry === void 0) return i === null ? r : Object.freeze({
|
|
176
|
+
rooms: r,
|
|
177
|
+
world: i
|
|
178
|
+
});
|
|
179
|
+
let a = {
|
|
180
|
+
tenantId: n.target.tenantId,
|
|
181
|
+
requestId: n.requestId,
|
|
182
|
+
subject: {
|
|
183
|
+
id: n.target.subjectId,
|
|
184
|
+
kind: n.target.kind
|
|
185
|
+
}
|
|
186
|
+
}, o = yield* e.geometry.service.exportSubject(a).pipe(F.mapError(() => new t({ detail: "Geometry export remains incomplete" }))), s = e.geometry.archives === void 0 ? null : yield* e.geometry.archives.exportSubject(a).pipe(F.mapError(() => new t({ detail: "Geometry archive export remains incomplete" })));
|
|
187
|
+
if (e.geometry.migrations === void 0) return Object.freeze({
|
|
188
|
+
rooms: r,
|
|
189
|
+
...i === null ? {} : { world: i },
|
|
190
|
+
geometry: o,
|
|
191
|
+
...s === null ? {} : { geometryArchives: s }
|
|
192
|
+
});
|
|
193
|
+
let c = yield* e.geometry.migrations.exportSubject(a).pipe(F.mapError(() => new t({ detail: "Geometry migration export remains incomplete" })));
|
|
194
|
+
return Object.freeze({
|
|
195
|
+
rooms: r,
|
|
196
|
+
...i === null ? {} : { world: i },
|
|
197
|
+
geometry: o,
|
|
198
|
+
geometryMigrations: c,
|
|
199
|
+
...s === null ? {} : { geometryArchives: s }
|
|
200
|
+
});
|
|
201
|
+
}))
|
|
202
|
+
}), this.geometry = pe(this.worlds, (e) => this.call((n) => n.geometry === void 0 ? F.fail(new t({ detail: "World geometry is not installed in this Rooms API owner" })) : e(n.geometry.service))), this.geometryManifest = Object.freeze({ observe: (e) => this.capturedCall(() => {
|
|
203
|
+
let n = d(e), r = this.worlds.find((e) => e.name === n.worldId);
|
|
204
|
+
if (!r?.geometry || r.geometry.kind !== n.kind) throw new t({ detail: "Geometry manifest escaped the installed World kind" });
|
|
205
|
+
return n;
|
|
206
|
+
}, (e, n) => e.geometry?.manifest ? e.geometry.manifest.observe(n).pipe(F.flatMap((e) => F.try({
|
|
207
|
+
try: () => {
|
|
208
|
+
let t = k(e, 4096, 16777216);
|
|
209
|
+
if (JSON.stringify(t.scope) !== JSON.stringify(n)) throw Error("Changed geometry manifest root");
|
|
210
|
+
return t;
|
|
211
|
+
},
|
|
212
|
+
catch: () => new t({ detail: "Geometry manifest response does not match its admitted root" })
|
|
213
|
+
}))) : F.fail(new t({ detail: "Actual geometry manifest source is not installed" }))) }), this.geometryReadGrants = Object.freeze({ grant: (e, n) => this.capturedCall(() => {
|
|
214
|
+
let r = o(e), i = R.decodeUnknownSync(N)(structuredClone(n)), a = this.worlds.find((e) => e.name === r.worldId);
|
|
215
|
+
if (!a?.geometry || a.geometry.kind !== r.kind || i.type !== "user" || i.tenantId !== r.tenantId || !i.id.trim()) throw new t({ detail: "Geometry read grant escaped actual World/tenant player" });
|
|
216
|
+
return i.scopes && Object.freeze(i.scopes), {
|
|
217
|
+
scope: r,
|
|
218
|
+
subject: Object.freeze(i)
|
|
219
|
+
};
|
|
220
|
+
}, (e, n) => {
|
|
221
|
+
if (!e.geometry?.manifest || !e.geometry.readGrants || !this.store) return F.fail(new t({ detail: "Actual geometry manifest/Storage grant source is not installed" }));
|
|
222
|
+
let r = this.store, i = e.geometry.manifest, a = e.geometry.readGrants, o = {
|
|
223
|
+
tenantId: n.scope.tenantId,
|
|
224
|
+
kind: n.scope.kind,
|
|
225
|
+
worldId: n.scope.worldId,
|
|
226
|
+
layerSetId: n.scope.layerSetId,
|
|
227
|
+
version: n.scope.version
|
|
228
|
+
}, s = () => F.tryPromise({
|
|
229
|
+
try: () => x(r, {
|
|
230
|
+
tenantId: n.scope.tenantId,
|
|
231
|
+
subjectId: n.subject.id
|
|
232
|
+
}),
|
|
233
|
+
catch: () => new t({ detail: "Geometry Subject admission remains unavailable" })
|
|
234
|
+
});
|
|
235
|
+
return F.uninterruptible(s().pipe(F.flatMap(() => i.observe(o)), F.flatMap((e) => F.try({
|
|
236
|
+
try: () => {
|
|
237
|
+
let t = k(e, 4096, 16777216);
|
|
238
|
+
if (JSON.stringify(t.scope) !== JSON.stringify(o)) throw Error("Changed grant manifest root");
|
|
239
|
+
let r = t.chunks.find((e) => e.cx === n.scope.cx && e.cy === n.scope.cy && e.cz === n.scope.cz);
|
|
240
|
+
if (!r) throw Error("No actual immutable reference");
|
|
241
|
+
return r;
|
|
242
|
+
},
|
|
243
|
+
catch: () => new t({ detail: "Geometry immutable reference remains unavailable" })
|
|
244
|
+
})), F.flatMap((e) => a.grant(e, n.subject)), F.flatMap((e) => F.try({
|
|
245
|
+
try: () => {
|
|
246
|
+
if (typeof e != "string" || e.length > 16384) throw Error("Invalid read locator");
|
|
247
|
+
let t = new URL(e);
|
|
248
|
+
if (!["http:", "https:"].includes(t.protocol) || t.username || t.password || t.hash) throw Error("Forbidden read locator");
|
|
249
|
+
return t.href;
|
|
250
|
+
},
|
|
251
|
+
catch: () => new t({ detail: "Geometry read locator remains unavailable" })
|
|
252
|
+
})), F.flatMap((e) => s().pipe(F.as(e))), F.catchCause(() => F.fail(new t({ detail: "Actual scoped geometry read grant remains unavailable" })))));
|
|
253
|
+
}) }), this.geometryAssetGrants = Object.freeze({ grant: (e, n) => this.capturedCall(() => {
|
|
254
|
+
let r = h(e), i = R.decodeUnknownSync(N)(structuredClone(n)), a = this.worlds.find((e) => e.name === r.worldId);
|
|
255
|
+
if (!this.geometryAssetUrls || !a?.geometry || i.type !== "user" || i.tenantId !== r.tenantId || !i.id.trim()) throw new t({ detail: "Geometry asset grant escaped its installed World/current tenant Subject" });
|
|
256
|
+
return i.scopes && Object.freeze(i.scopes), {
|
|
257
|
+
request: r,
|
|
258
|
+
subject: Object.freeze(i)
|
|
259
|
+
};
|
|
260
|
+
}, (e, n) => {
|
|
261
|
+
if (!e.geometry?.assetGrants || !this.store) return F.fail(new t({ detail: "Actual geometry asset grant source is not installed" }));
|
|
262
|
+
let r = this.store, i = e.geometry.assetGrants, a = () => F.tryPromise({
|
|
263
|
+
try: () => x(r, {
|
|
264
|
+
tenantId: n.request.tenantId,
|
|
265
|
+
subjectId: n.subject.id
|
|
266
|
+
}),
|
|
267
|
+
catch: () => new t({ detail: "Geometry asset Subject admission remains unavailable" })
|
|
268
|
+
});
|
|
269
|
+
return F.uninterruptible(a().pipe(F.flatMap(() => {
|
|
270
|
+
let e = i.grant(n.request, n.subject);
|
|
271
|
+
return F.isEffect(e) ? e : F.fail(new t({ detail: "Actual geometry asset grant Effect required" }));
|
|
272
|
+
}), F.flatMap((e) => F.try({
|
|
273
|
+
try: () => m(e),
|
|
274
|
+
catch: () => new t({ detail: "Geometry asset grant response remains unavailable" })
|
|
275
|
+
})), F.flatMap((e) => a().pipe(F.as(e))), F.catchCause(() => F.fail(new t({ detail: "Actual scoped geometry asset read remains unavailable" })))));
|
|
276
|
+
}) });
|
|
277
|
+
let V = (e) => {
|
|
278
|
+
let n = o(e), r = this.worlds.find((e) => e.name === n.worldId);
|
|
279
|
+
if (!this.geometryJournalArchives || !r?.geometry || r.geometry.kind !== n.kind) throw new t({ detail: "Geometry archive escaped its installed World" });
|
|
280
|
+
return n;
|
|
281
|
+
}, H = (e) => this.call((n) => n.geometry?.archives === void 0 ? F.fail(new t({ detail: "Geometry archive index source is not installed" })) : F.uninterruptible(e(n.geometry.archives)));
|
|
282
|
+
this.geometryArchives = Object.freeze({
|
|
283
|
+
archive: (e, n) => this.capturedCall(() => ({
|
|
284
|
+
scope: V(e),
|
|
285
|
+
requestId: c(n)
|
|
286
|
+
}), (e, n) => e.geometry?.archives ? e.geometry.archives.archive(n.scope, n.requestId).pipe(F.flatMap((e) => F.try({
|
|
287
|
+
try: () => {
|
|
288
|
+
let t = C(e);
|
|
289
|
+
if (JSON.stringify(t.receipt.scope) !== JSON.stringify(n.scope) || t.receipt.requestId !== n.requestId) throw Error("Archive reference changed scope");
|
|
290
|
+
return t;
|
|
291
|
+
},
|
|
292
|
+
catch: () => new t({ detail: "Geometry archive reference escaped its captured request" })
|
|
293
|
+
}))) : F.fail(new t({ detail: "Actual geometry archive index is not installed" }))),
|
|
294
|
+
load: (e, n) => this.capturedCall(() => ({
|
|
295
|
+
scope: V(e),
|
|
296
|
+
requestId: c(n)
|
|
297
|
+
}), (e, n) => e.geometry?.archives ? e.geometry.archives.load(n.scope, n.requestId).pipe(F.flatMap((e) => F.try({
|
|
298
|
+
try: () => {
|
|
299
|
+
let t = r(e, 16777216, "geometryArchiveFacadeBytes"), i = f(t, { maxBytes: 16777216 }).metadata, a = n.scope;
|
|
300
|
+
if (i.kind !== a.kind || i.worldId !== a.worldId || i.version !== a.version || i.layerSetId !== a.layerSetId || i.cx !== a.cx || i.cy !== a.cy || i.cz !== a.cz) throw Error("Archive bytes changed scope");
|
|
301
|
+
return t;
|
|
302
|
+
},
|
|
303
|
+
catch: () => new t({ detail: "Geometry archive bytes escaped their captured scope" })
|
|
304
|
+
}))) : F.fail(new t({ detail: "Actual geometry archive index is not installed" }))),
|
|
305
|
+
exportSubject: (n) => {
|
|
306
|
+
try {
|
|
307
|
+
let o = s(n);
|
|
308
|
+
return H((n) => n.exportSubject(o).pipe(F.flatMap((n) => F.try({
|
|
309
|
+
try: () => {
|
|
310
|
+
let t = 0;
|
|
311
|
+
return a(n, 4096, (n) => {
|
|
312
|
+
let a = i(n, ["reference", "patch"]), s = C(a.reference), c = this.worlds.find((e) => e.name === s.receipt.scope.worldId), l = r(a.patch, 16777216, "geometryArchiveExportBytes");
|
|
313
|
+
if (!c?.geometry || c.geometry.kind !== s.receipt.scope.kind || s.receipt.scope.tenantId !== o.tenantId || l.length !== s.size) throw Error("Archive export changed scope");
|
|
314
|
+
if (S(s.receipt, f(l, { maxBytes: 16777216 }).metadata), t += l.length + new TextEncoder().encode(JSON.stringify(s)).length, t > 16777216) throw new e({
|
|
315
|
+
budget: "geometryArchiveExportBytes",
|
|
316
|
+
limit: 16777216
|
|
317
|
+
});
|
|
318
|
+
return Object.freeze({
|
|
319
|
+
reference: s,
|
|
320
|
+
patch: l
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
catch: () => new t({ detail: "Geometry archive export escaped its installed scope" })
|
|
325
|
+
}))));
|
|
326
|
+
} catch {
|
|
327
|
+
return F.fail(new t({ detail: "Geometry archive export target refused" }));
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
eraseSubject: (e) => {
|
|
331
|
+
try {
|
|
332
|
+
let n = s(e);
|
|
333
|
+
return H((e) => e.eraseSubject(n).pipe(F.flatMap((e) => e === void 0 ? F.void : F.fail(new t({ detail: "Geometry archive erase did not confirm void" })))));
|
|
334
|
+
} catch {
|
|
335
|
+
return F.fail(new t({ detail: "Geometry archive erase target refused" }));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
let U = (e) => this.call((n) => n.geometry?.migrations === void 0 ? F.fail(new t({ detail: "Geometry migration source is not installed" })) : F.uninterruptible(e(n.geometry.migrations)));
|
|
340
|
+
this.geometryMigration = Object.freeze({
|
|
341
|
+
migrate: (e) => {
|
|
342
|
+
try {
|
|
343
|
+
let n = ie(e), r = this.worlds.find((e) => e.name === n.from.worldId);
|
|
344
|
+
if (!r?.geometry || r.geometry.kind !== n.from.kind || n.to.worldId !== r.name || n.to.kind !== r.geometry.kind) throw new t({ detail: "Geometry migration escaped actual installed World" });
|
|
345
|
+
return U((e) => e.migrate(n).pipe(F.flatMap((e) => F.try({
|
|
346
|
+
try: () => {
|
|
347
|
+
let t = D(e);
|
|
348
|
+
if (JSON.stringify(t.from) !== JSON.stringify(n.from) || JSON.stringify(t.to) !== JSON.stringify(n.to) || t.fromRevision !== n.expectedRevision || t.requestKey !== E(JSON.stringify([n.from.tenantId, n.requestId])) || t.inputSha256 !== E(JSON.stringify(n))) throw Error("Changed migration receipt");
|
|
349
|
+
return t;
|
|
350
|
+
},
|
|
351
|
+
catch: () => new t({ detail: "Migration receipt does not match its captured request" })
|
|
352
|
+
}))));
|
|
353
|
+
} catch {
|
|
354
|
+
return F.fail(new t({ detail: "Geometry migration request could not be captured" }));
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
eraseSubject: (e) => {
|
|
358
|
+
try {
|
|
359
|
+
let n = s(e);
|
|
360
|
+
return U((e) => e.eraseSubject(n).pipe(F.flatMap((e) => e === void 0 ? F.void : F.fail(new t({ detail: "Migration erasure did not confirm void" })))));
|
|
361
|
+
} catch {
|
|
362
|
+
return F.fail(new t({ detail: "Geometry migration privacy target could not be captured" }));
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
exportSubject: (e) => {
|
|
366
|
+
try {
|
|
367
|
+
let n = s(e);
|
|
368
|
+
return U((e) => e.exportSubject(n).pipe(F.flatMap((e) => F.try({
|
|
369
|
+
try: () => {
|
|
370
|
+
let t = a(e, 4096, D);
|
|
371
|
+
if (t.some((e) => e.from.tenantId !== n.tenantId) || new Set(t.map((e) => e.requestKey)).size !== t.length || new TextEncoder().encode(JSON.stringify(t)).length > 16777216) throw Error("Changed migration export scope");
|
|
372
|
+
return t;
|
|
373
|
+
},
|
|
374
|
+
catch: () => new t({ detail: "Migration export escaped its captured scope or budget" })
|
|
375
|
+
}))));
|
|
376
|
+
} catch {
|
|
377
|
+
return F.fail(new t({ detail: "Geometry migration privacy target could not be captured" }));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}), this.reaper = Object.freeze({ run: (e) => this.capturedCall(() => Object.freeze({ ...e }), (e, t) => e.reaper.run(t)) });
|
|
381
|
+
let W = () => F.fail(new t({ detail: "Room moderation is not installed" }));
|
|
382
|
+
this.moderation = Object.freeze({
|
|
383
|
+
kick: (e) => this.capturedCall(() => _e(e), (e, t) => e.moderation === void 0 ? W() : e.moderation.kick(t)),
|
|
384
|
+
close: (e) => this.capturedCall(() => ge(e), (e, t) => e.moderation === void 0 ? W() : e.moderation.close(t)),
|
|
385
|
+
closeAll: (e) => this.capturedCall(() => he(e), (e, t) => e.moderation === void 0 ? W() : e.moderation.closeAll(t)),
|
|
386
|
+
rollbackGeometry: (e, t) => this.capturedCall(() => ({
|
|
387
|
+
input: structuredClone(e),
|
|
388
|
+
staff: structuredClone(t)
|
|
389
|
+
}), (e, t) => e.moderation?.rollbackGeometry === void 0 ? W() : e.moderation.rollbackGeometry(t.input, t.staff)),
|
|
390
|
+
recheckAccess: (e) => this.capturedCall(() => me(e), (e, t) => e.moderation?.recheckAccess === void 0 ? W() : e.moderation.recheckAccess(t))
|
|
391
|
+
});
|
|
392
|
+
let G = (e) => {
|
|
393
|
+
let n = R.decodeUnknownSync(N)(structuredClone(e));
|
|
394
|
+
if (n.type !== "user" || typeof n.tenantId != "string" || !n.tenantId.trim()) throw new t({ detail: "World client controls require an authenticated tenant player" });
|
|
395
|
+
return n.scopes && Object.freeze(n.scopes), Object.freeze(n);
|
|
396
|
+
}, K = (e) => this.call((n) => n.worldClientControl === void 0 ? F.fail(new t({ detail: "World client controls are not installed" })) : e(n.worldClientControl.service));
|
|
397
|
+
this.worldClientControl = Object.freeze({
|
|
398
|
+
pending: (e, n) => this.capturedCall(() => ({
|
|
399
|
+
input: g(e),
|
|
400
|
+
subject: G(n)
|
|
401
|
+
}), (e, n) => e.worldClientControl?.service.pending ? e.worldClientControl.service.pending(n.input, n.subject) : F.fail(new t({ detail: "World pending transition discovery is not installed" }))),
|
|
402
|
+
join: (e, n) => this.capturedCall(() => G(n), (n, r) => n.worldClientControl?.service.join ? n.worldClientControl.service.join(e, r) : F.fail(new t({ detail: "World join is not installed" }))),
|
|
403
|
+
reservation: (e, n) => this.capturedCall(() => G(n), (n, r) => n.worldClientControl?.service.reservation ? n.worldClientControl.service.reservation(e, r) : F.fail(new t({ detail: "World target Seat control is not installed" }))),
|
|
404
|
+
follow: (e, n) => this.capturedCall(() => G(n), (n, r) => n.worldClientControl?.service.follow ? n.worldClientControl.service.follow(e, r) : F.fail(new t({ detail: "World follower Seat control is not installed" }))),
|
|
405
|
+
prepare: (e, n, r) => {
|
|
406
|
+
try {
|
|
407
|
+
let t = p(n), i = G(r);
|
|
408
|
+
return K((n) => n.prepare(e, t, i));
|
|
409
|
+
} catch {
|
|
410
|
+
return F.fail(new t({ detail: "World client intention could not be captured" }));
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
observe: (e, n) => this.capturedCall(() => G(n), (n, r) => n.worldClientControl === void 0 ? F.fail(new t({ detail: "World client controls are not installed" })) : n.worldClientControl.service.observe(e, r)),
|
|
414
|
+
commit: (e, n) => {
|
|
415
|
+
try {
|
|
416
|
+
let t = y(e), r = G(n);
|
|
417
|
+
return K((e) => e.commit(t, r));
|
|
418
|
+
} catch {
|
|
419
|
+
return F.fail(new t({ detail: "World client ticket could not be captured" }));
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
cancel: (e, n) => this.capturedCall(() => G(n), (n, r) => n.worldClientControl === void 0 ? F.fail(new t({ detail: "World client controls are not installed" })) : n.worldClientControl.service.cancel(e, r))
|
|
423
|
+
});
|
|
424
|
+
let q = I.mergeAll(I.succeed(T, this.reservation), I.succeed(ee, this.privacy), I.succeed(w, this.reaper)), J = A ? I.merge(q, I.succeed(te, this.worldClientControl)) : q, Y = this.worlds.some((e) => e.geometry !== void 0) ? I.mergeAll(J, I.succeed(ne, this.geometry), I.succeed(fe, this.geometryManifest), I.succeed(de, this.geometryReadGrants)) : J, X = P ? I.merge(Y, I.succeed(ue, this.geometryAssetGrants)) : Y, Z = L ? I.merge(X, I.succeed(le, this.geometryArchives)) : X, Q = z ? I.merge(Z, I.succeed(ce, this.geometryRetention)) : Z, $ = B ? I.merge(Q, I.succeed(ae, this.geometryAdministration)) : Q;
|
|
425
|
+
this.services = M ? I.merge($, I.succeed(re, this.geometryMigration)) : $;
|
|
426
|
+
}
|
|
427
|
+
status() {
|
|
428
|
+
return Object.freeze({
|
|
429
|
+
phase: this.phase,
|
|
430
|
+
activeCalls: this.active
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
inspect(e) {
|
|
434
|
+
return this.call(() => F.uninterruptible(F.tryPromise({
|
|
435
|
+
try: () => {
|
|
436
|
+
if (!this.store) throw Error("Unbound inspection store");
|
|
437
|
+
return e(this.store);
|
|
438
|
+
},
|
|
439
|
+
catch: () => new t({ detail: "Rooms directory inspection could not be completed" })
|
|
440
|
+
})));
|
|
441
|
+
}
|
|
442
|
+
call(e) {
|
|
443
|
+
return F.acquireUseRelease(F.try({
|
|
444
|
+
try: () => {
|
|
445
|
+
if (this.phase !== "ready" || !this.binding) throw Error("Unbound owner");
|
|
446
|
+
return this.active++, this.binding;
|
|
447
|
+
},
|
|
448
|
+
catch: () => new t({ detail: "Rooms API control is unavailable or shutting down" })
|
|
449
|
+
}), (n) => F.suspend(() => {
|
|
450
|
+
let r = e(n);
|
|
451
|
+
return F.isEffect(r) ? r : F.fail(new t({ detail: "Rooms API ports must return an Effect" }));
|
|
452
|
+
}), () => F.sync(() => {
|
|
453
|
+
if (this.active--, this.active === 0) {
|
|
454
|
+
let e = this.idle;
|
|
455
|
+
this.idle = null, e?.();
|
|
456
|
+
}
|
|
457
|
+
}));
|
|
458
|
+
}
|
|
459
|
+
capturedCall(e, n) {
|
|
460
|
+
try {
|
|
461
|
+
let t = e();
|
|
462
|
+
return this.call((e) => n(e, t));
|
|
463
|
+
} catch {
|
|
464
|
+
return F.fail(new t({ detail: "Rooms API request could not be captured" }));
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
privacyCall(e, n) {
|
|
468
|
+
if (typeof e?.requestId != "string" || !e.requestId.trim() || typeof e.target?.subjectId != "string" || !e.target.subjectId.trim() || typeof e.target.tenantId != "string" || !e.target.tenantId.trim() || e.target.kind !== "guest" && e.target.kind !== "user") return F.fail(new t({ detail: "Rooms privacy requires an explicit trusted tenant and subject" }));
|
|
469
|
+
let r = Object.freeze({
|
|
470
|
+
requestId: e.requestId,
|
|
471
|
+
target: Object.freeze({
|
|
472
|
+
subjectId: e.target.subjectId,
|
|
473
|
+
tenantId: e.target.tenantId,
|
|
474
|
+
kind: e.target.kind
|
|
475
|
+
})
|
|
476
|
+
});
|
|
477
|
+
return this.call((e) => F.uninterruptible(n(e, r)));
|
|
478
|
+
}
|
|
479
|
+
configureCatalog(e) {
|
|
480
|
+
if (this.phase !== "unbound" || this.bindingTask || this.releaseBinding) throw new t({ detail: "Room catalog configuration must precede API binding" });
|
|
481
|
+
let n = new O(e.inventory(), { previousHistory: e.history });
|
|
482
|
+
this.pools !== void 0 && M(this.pools, n.inventory().map((e) => e.descriptor.name)), this.catalog = n;
|
|
483
|
+
}
|
|
484
|
+
configurePools(e, n) {
|
|
485
|
+
if (this.phase !== "unbound" || this.bindingTask || this.releaseBinding) throw new t({ detail: "Room pool configuration must precede API binding" });
|
|
486
|
+
let r = n === void 0 ? this.catalog : new O(n.inventory(), { previousHistory: n.history });
|
|
487
|
+
this.pools = r === void 0 ? j(e) : M(e, r.inventory().map((e) => e.descriptor.name)), this.catalog = r;
|
|
488
|
+
}
|
|
489
|
+
bind(e, r) {
|
|
490
|
+
if (this.phase !== "unbound" || this.bindingTask || this.releaseBinding) return Promise.reject(new t({ detail: "Rooms API owner is already binding or retained for cleanup" }));
|
|
491
|
+
if (!this.binder) return Promise.reject(new t({ detail: "Rooms requires an API-to-host control and coordinated privacy binding" }));
|
|
492
|
+
this.phase = "binding";
|
|
493
|
+
let i = new AbortController();
|
|
494
|
+
this.controller = i;
|
|
495
|
+
let a = (async () => {
|
|
496
|
+
try {
|
|
497
|
+
let a = await this.binder(e, Object.freeze({
|
|
498
|
+
pools: this.pools,
|
|
499
|
+
catalog: this.catalog,
|
|
500
|
+
pluginName: this.name,
|
|
501
|
+
host: r,
|
|
502
|
+
signal: i.signal,
|
|
503
|
+
worlds: this.worlds,
|
|
504
|
+
worldState: this.worldState,
|
|
505
|
+
worldClientControls: this.worldClientControls,
|
|
506
|
+
geometryMigrations: this.geometryMigrationsEnabled,
|
|
507
|
+
geometryAssetUrls: this.geometryAssetUrls,
|
|
508
|
+
geometryJournalArchives: this.geometryJournalArchives,
|
|
509
|
+
geometryJournalRetention: this.geometryJournalRetention,
|
|
510
|
+
geometryAdminControls: this.geometryAdminControls
|
|
511
|
+
}));
|
|
512
|
+
if (typeof a?.release != "function") throw new t({ detail: "Rooms binding must return its complete resource lifetime" });
|
|
513
|
+
this.releaseBinding = a.release.bind(a);
|
|
514
|
+
let o = Object.getOwnPropertyDescriptor(a, "pools");
|
|
515
|
+
if (o && (!o.enumerable || !("value" in o)) || !o && "pools" in a || this.pools !== void 0 && o?.value !== this.pools) throw new t({ detail: "Rooms API provider did not retain the app pool topology" });
|
|
516
|
+
let s = a.reservation, c = a.privacy, l = a.reaper, u = Object.getOwnPropertyDescriptor(a, "geometry");
|
|
517
|
+
if (u && (!u.enumerable || !("value" in u)) || !u && "geometry" in a) throw new t({ detail: "Rooms geometry binding refuses accessors or inherited providers" });
|
|
518
|
+
let d = this.worlds.some((e) => e.geometry !== void 0), f = u?.value;
|
|
519
|
+
if (d !== (f !== void 0)) throw new t({ detail: "Declared World geometry requires exactly its actual source binding" });
|
|
520
|
+
let p = d ? A(f, this.worlds) : void 0;
|
|
521
|
+
if (this.geometryReadUrls && (!p?.manifest || !p.readGrants)) throw new t({ detail: "Configured geometry read URLs require actual manifest and Storage grant sources" });
|
|
522
|
+
if (this.geometryJournalArchives !== (p?.archives !== void 0)) throw new t({ detail: "Geometry archive module requires exactly its actual index/privacy binding" });
|
|
523
|
+
if (this.geometryAdminControls !== (p?.administration !== void 0)) throw new t({ detail: "Geometry administration requires exactly its actual configured source" });
|
|
524
|
+
if (this.geometryJournalRetention !== (p?.retention !== void 0)) throw new t({ detail: "Geometry retention module requires exactly its actual sweep binding" });
|
|
525
|
+
if (this.geometryAssetUrls !== (p?.assetGrants !== void 0)) throw new t({ detail: "Geometry asset module requires exactly its actual source binding" });
|
|
526
|
+
if (this.geometryMigrationsEnabled !== (p?.migrations !== void 0)) throw new t({ detail: "Geometry migration module requires exactly its actual service and privacy binding" });
|
|
527
|
+
let m;
|
|
528
|
+
if (this.worldState === "none") {
|
|
529
|
+
if (a.worldState !== void 0) throw new t({ detail: "Unconfigured World state binding refuses admission" });
|
|
530
|
+
} else {
|
|
531
|
+
let e = a.worldState;
|
|
532
|
+
if (!e) throw new t({ detail: "Configured World state requires its actual privacy source" });
|
|
533
|
+
for (let n of [
|
|
534
|
+
"worlds",
|
|
535
|
+
"transitionsEnabled",
|
|
536
|
+
"onErase",
|
|
537
|
+
"onExport"
|
|
538
|
+
]) {
|
|
539
|
+
let r = Object.getOwnPropertyDescriptor(e, n);
|
|
540
|
+
if (!r || !("value" in r)) throw new t({ detail: "World state binding requires own data and methods" });
|
|
541
|
+
}
|
|
542
|
+
let n = b(e.worlds);
|
|
543
|
+
if (n.length !== this.worlds.length || n.some((e, t) => e !== this.worlds[t]) || e.transitionsEnabled !== (this.worldState === "transitions") || typeof e.onErase != "function" || typeof e.onExport != "function") throw new t({ detail: "World state source does not match declared catalogue/schema" });
|
|
544
|
+
let r = e.onErase.bind(e), i = e.onExport.bind(e), o = (e) => F.suspend(() => {
|
|
545
|
+
let n = e();
|
|
546
|
+
return F.isEffect(n) ? n : F.fail(new t({ detail: "World state privacy source requires an Effect" }));
|
|
547
|
+
});
|
|
548
|
+
m = Object.freeze({
|
|
549
|
+
worlds: n,
|
|
550
|
+
transitionsEnabled: e.transitionsEnabled,
|
|
551
|
+
onErase: (e, t) => o(() => r(e, t)),
|
|
552
|
+
onExport: (e, t) => o(() => i(e, t))
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
let h, x = Object.getOwnPropertyDescriptor(a, "worldClientControl");
|
|
556
|
+
if (x && !("value" in x)) throw new t({ detail: "World client binding refuses accessors" });
|
|
557
|
+
let S = x?.value;
|
|
558
|
+
if (this.worldClientControls) {
|
|
559
|
+
if (!S) throw new t({ detail: "Configured World client controls require their actual service" });
|
|
560
|
+
for (let e of ["worlds", "service"]) {
|
|
561
|
+
let n = Object.getOwnPropertyDescriptor(S, e);
|
|
562
|
+
if (!n || !("value" in n)) throw new t({ detail: "World client binding requires own data" });
|
|
563
|
+
}
|
|
564
|
+
let e = b(S.worlds), r = S.service;
|
|
565
|
+
if (e.length !== this.worlds.length || e.some((e, t) => e !== this.worlds[t])) throw new t({ detail: "World client catalogue does not match declared state" });
|
|
566
|
+
for (let e of [
|
|
567
|
+
"prepare",
|
|
568
|
+
"observe",
|
|
569
|
+
"commit",
|
|
570
|
+
"cancel"
|
|
571
|
+
]) {
|
|
572
|
+
let n = r && Object.getOwnPropertyDescriptor(r, e);
|
|
573
|
+
if (!n || !("value" in n) || typeof n.value != "function") throw new t({ detail: "World client control requires complete own methods" });
|
|
574
|
+
}
|
|
575
|
+
let i = Object.getOwnPropertyDescriptor(r, "reservation");
|
|
576
|
+
if (i && (!("value" in i) || typeof i.value != "function") || !i && "reservation" in r) throw new t({ detail: "World target Seat control requires an own method" });
|
|
577
|
+
let a = i ? r.reservation.bind(r) : void 0, o = Object.getOwnPropertyDescriptor(r, "follow");
|
|
578
|
+
if (o && (!("value" in o) || typeof o.value != "function") || !o && "follow" in r) throw new t({ detail: "World follower control requires an own method" });
|
|
579
|
+
let s = o ? r.follow.bind(r) : void 0, c = Object.getOwnPropertyDescriptor(r, "pending");
|
|
580
|
+
if (c && (!("value" in c) || typeof c.value != "function") || !c && "pending" in r) throw new t({ detail: "World pending transition discovery requires an own method" });
|
|
581
|
+
let l = c ? r.pending.bind(r) : void 0, u = Object.getOwnPropertyDescriptor(r, "join");
|
|
582
|
+
if (u && (!("value" in u) || typeof u.value != "function") || !u && "join" in r) throw new t({ detail: "World join control requires an own method" });
|
|
583
|
+
let d = u ? r.join.bind(r) : void 0, f = r.prepare.bind(r), p = r.observe.bind(r), m = r.commit.bind(r), x = r.cancel.bind(r), C = (e, r) => F.uninterruptible(F.suspend(() => {
|
|
584
|
+
let n = e();
|
|
585
|
+
return F.isEffect(n) ? n.pipe(F.map(r)) : F.fail(new t({ detail: "World client control requires an Effect" }));
|
|
586
|
+
})).pipe(F.catchCause((e) => {
|
|
587
|
+
let r = P.findErrorOption(e);
|
|
588
|
+
return F.fail(L.isSome(r) && r.value instanceof n ? r.value : new t({ detail: "World client control remains incomplete" }));
|
|
589
|
+
}));
|
|
590
|
+
h = Object.freeze({
|
|
591
|
+
worlds: e,
|
|
592
|
+
service: Object.freeze({
|
|
593
|
+
...l === void 0 ? {} : { pending: (e, t) => C(() => l(g(e), t), (e) => e === null ? null : v(e)) },
|
|
594
|
+
...d === void 0 ? {} : { join: (e, t) => C(() => d(e, t), (e) => Object.freeze({
|
|
595
|
+
entityId: e.entityId,
|
|
596
|
+
reservation: structuredClone(R.decodeUnknownSync(R.toType(_))(e.reservation))
|
|
597
|
+
})) },
|
|
598
|
+
...a === void 0 ? {} : { reservation: (e, t) => C(() => a(e, t), (e) => structuredClone(R.decodeUnknownSync(R.toType(_))(e))) },
|
|
599
|
+
...s === void 0 ? {} : { follow: (e, t) => C(() => s(e, t), (e) => structuredClone(R.decodeUnknownSync(R.toType(_))(e))) },
|
|
600
|
+
prepare: (e, t, n) => C(() => f(e, t, n), y),
|
|
601
|
+
observe: (e, t) => C(() => p(e, t), v),
|
|
602
|
+
commit: (e, t) => C(() => m(e, t), v),
|
|
603
|
+
cancel: (e, t) => C(() => x(e, t), v)
|
|
604
|
+
})
|
|
605
|
+
});
|
|
606
|
+
} else if (S !== void 0) throw new t({ detail: "Unconfigured World client control refuses admission" });
|
|
607
|
+
let C = Object.getOwnPropertyDescriptor(a, "moderation");
|
|
608
|
+
if (C && (!("value" in C) || C.value !== void 0 && [
|
|
609
|
+
"kick",
|
|
610
|
+
"close",
|
|
611
|
+
"closeAll"
|
|
612
|
+
].some((e) => typeof Reflect.get(C.value, e) != "function")) || !C && "moderation" in a) throw new t({ detail: "Rooms moderation binding requires own kick, close and closeAll methods" });
|
|
613
|
+
let w = C?.value, T = w === void 0 ? void 0 : Object.freeze({
|
|
614
|
+
kick: w.kick.bind(w),
|
|
615
|
+
close: w.close.bind(w),
|
|
616
|
+
closeAll: w.closeAll.bind(w),
|
|
617
|
+
...typeof w.rollbackGeometry == "function" ? { rollbackGeometry: w.rollbackGeometry.bind(w) } : {},
|
|
618
|
+
...typeof w.recheckAccess == "function" ? { recheckAccess: w.recheckAccess.bind(w) } : {}
|
|
619
|
+
});
|
|
620
|
+
if (!s || !c || !l || [
|
|
621
|
+
"reserve",
|
|
622
|
+
"resume",
|
|
623
|
+
"leave",
|
|
624
|
+
"list"
|
|
625
|
+
].some((e) => typeof Reflect.get(s, e) != "function") || typeof c.erase != "function" || typeof c.export != "function" || typeof l.run != "function") throw new t({ detail: "Rooms binding must provide complete reservation, coordinated privacy and reaper ports" });
|
|
626
|
+
if (this.binding = Object.freeze({
|
|
627
|
+
reservation: Object.freeze({
|
|
628
|
+
reserve: s.reserve.bind(s),
|
|
629
|
+
resume: s.resume.bind(s),
|
|
630
|
+
leave: s.leave.bind(s),
|
|
631
|
+
list: s.list.bind(s),
|
|
632
|
+
...typeof s.prepareMatch == "function" ? { prepareMatch: s.prepareMatch.bind(s) } : {}
|
|
633
|
+
}),
|
|
634
|
+
privacy: Object.freeze({
|
|
635
|
+
erase: c.erase.bind(c),
|
|
636
|
+
export: c.export.bind(c)
|
|
637
|
+
}),
|
|
638
|
+
reaper: Object.freeze({ run: l.run.bind(l) }),
|
|
639
|
+
...T === void 0 ? {} : { moderation: T },
|
|
640
|
+
worldState: m,
|
|
641
|
+
worldClientControl: h,
|
|
642
|
+
geometry: p,
|
|
643
|
+
release: this.releaseBinding
|
|
644
|
+
}), i.signal.aborted) throw new t({ detail: "Rooms API acquisition was cancelled" });
|
|
645
|
+
this.store = Object.freeze({ query: e.query.bind(e) }), this.phase = "ready";
|
|
646
|
+
} catch (e) {
|
|
647
|
+
if (i.abort(), e instanceof z && (this.releaseBinding = e.retryCleanup), this.releaseBinding) try {
|
|
648
|
+
await this.releaseBinding(), this.releaseBinding = null, this.binding = null;
|
|
649
|
+
} catch {}
|
|
650
|
+
throw this.phase === "binding" && (this.phase = this.releaseBinding ? "closing" : "unbound"), new t({ detail: "Rooms API binding did not complete" });
|
|
651
|
+
}
|
|
652
|
+
})();
|
|
653
|
+
return this.bindingTask = a, a.then(() => {
|
|
654
|
+
this.bindingTask = null;
|
|
655
|
+
}, () => {
|
|
656
|
+
this.bindingTask = null;
|
|
657
|
+
}), a;
|
|
658
|
+
}
|
|
659
|
+
close() {
|
|
660
|
+
if (this.closeTask) return this.closeTask;
|
|
661
|
+
this.phase = "closing", this.controller?.abort();
|
|
662
|
+
let e = (async () => {
|
|
663
|
+
try {
|
|
664
|
+
await this.bindingTask;
|
|
665
|
+
} catch {}
|
|
666
|
+
this.active > 0 && await new Promise((e) => {
|
|
667
|
+
this.idle = e;
|
|
668
|
+
}), this.releaseBinding && await this.releaseBinding(), this.binding = null, this.releaseBinding = null, this.controller = null, this.store = null, this.phase = "unbound";
|
|
669
|
+
})();
|
|
670
|
+
return this.closeTask = e, e.then(() => {
|
|
671
|
+
this.closeTask = null;
|
|
672
|
+
}, () => {
|
|
673
|
+
this.closeTask = null;
|
|
674
|
+
}), e;
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
//#endregion
|
|
678
|
+
export { z as RoomsApiBindFailure, B as RoomsApiOwner };
|