@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,238 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { geometryOwnData as n } from "./geometryTileCodec.js";
|
|
3
|
+
import { captureGeometryCodecProfiles as r, captureGeometryKind as i, geometryPersistenceId as a, geometryPersistenceInteger as o } from "./geometryPersistenceData.js";
|
|
4
|
+
import { planGeometryClientInterest as s } from "./geometryClientInterest.js";
|
|
5
|
+
import { captureRoomConnectionGeometrySession as c } from "./connection.js";
|
|
6
|
+
import { makeRoomGeometryChunkCache as l } from "./geometryClientChunks.js";
|
|
7
|
+
import { captureGeometryRenderLodCacheOptions as u, makeGeometryRenderLodCache as d } from "./geometryRenderCache.js";
|
|
8
|
+
import { captureWorldCatalog as f } from "./world.js";
|
|
9
|
+
import { makeRoomGeometrySnapshotSource as p } from "./geometrySnapshotClient.js";
|
|
10
|
+
import { makeRoomGeometryManifestClient as m } from "./geometryManifestClient.js";
|
|
11
|
+
//#region src/geometryVersionClient.ts
|
|
12
|
+
var h = () => new t({ detail: "Geometry version handoff requires its current native manifest, admission and fully verified downloads" }), g = (t, c, g, _) => {
|
|
13
|
+
let v = f([c])[0], y = n(g, [
|
|
14
|
+
"tenantId",
|
|
15
|
+
"kind",
|
|
16
|
+
"worldId",
|
|
17
|
+
"layerSetId"
|
|
18
|
+
]), b = Object.freeze({
|
|
19
|
+
tenantId: a(y.tenantId),
|
|
20
|
+
kind: i(y.kind),
|
|
21
|
+
worldId: a(y.worldId, 96),
|
|
22
|
+
layerSetId: a(y.layerSetId, 96)
|
|
23
|
+
}), x = n(_, [
|
|
24
|
+
"staticSource",
|
|
25
|
+
"manifest",
|
|
26
|
+
"snapshot",
|
|
27
|
+
"cache",
|
|
28
|
+
"render"
|
|
29
|
+
], ["staticSource"]), S = n(x.staticSource, ["load"]);
|
|
30
|
+
if (!v.geometry || b.worldId !== v.name || b.kind !== v.geometry.kind || typeof S.load != "function") throw h();
|
|
31
|
+
let C = Object.freeze({ load: S.load.bind(x.staticSource) }), w = (e, t) => {
|
|
32
|
+
let i = { ...Object.hasOwn(x, e) ? n(x[e], t, []) : {} };
|
|
33
|
+
if (Object.hasOwn(i, "codecLimits") && (i.codecLimits = Object.freeze(Object.fromEntries(r(i.codecLimits)))), Object.hasOwn(i, "requestId")) {
|
|
34
|
+
if (typeof i.requestId != "function") throw h();
|
|
35
|
+
i.requestId = i.requestId.bind(x[e]);
|
|
36
|
+
}
|
|
37
|
+
return Object.freeze(i);
|
|
38
|
+
}, T = w("manifest", [
|
|
39
|
+
"channel",
|
|
40
|
+
"maxManifestChunks",
|
|
41
|
+
"maxManifestBytes",
|
|
42
|
+
"maxPending",
|
|
43
|
+
"maxPendingBytes",
|
|
44
|
+
"maxQueued",
|
|
45
|
+
"maxQueuedBytes"
|
|
46
|
+
]), E = w("snapshot", [
|
|
47
|
+
"requestChannel",
|
|
48
|
+
"responseChannel",
|
|
49
|
+
"requestId",
|
|
50
|
+
"maxPending",
|
|
51
|
+
"maxPatchBytes",
|
|
52
|
+
"maxPendingBytes",
|
|
53
|
+
"maxWaitMs",
|
|
54
|
+
"maxManifestChunks",
|
|
55
|
+
"maxManifestBytes",
|
|
56
|
+
"codecLimits"
|
|
57
|
+
]), D = w("cache", [
|
|
58
|
+
"channel",
|
|
59
|
+
"maxCachedChunks",
|
|
60
|
+
"maxConcurrent",
|
|
61
|
+
"maxCacheBytes",
|
|
62
|
+
"maxStagedBytes",
|
|
63
|
+
"maxChunkBytes",
|
|
64
|
+
"maxPendingDeltas",
|
|
65
|
+
"maxQueuedDeltaBytes",
|
|
66
|
+
"codecLimits"
|
|
67
|
+
]), O = u(Object.hasOwn(x, "render") ? x.render : {}), k = m(t, {
|
|
68
|
+
tenantId: b.tenantId,
|
|
69
|
+
kind: b.kind,
|
|
70
|
+
worldId: b.worldId,
|
|
71
|
+
layerSetId: b.layerSetId
|
|
72
|
+
}, T), A = /* @__PURE__ */ new Set(), j = null, M = null, N = !1, P = null, F = (e) => {
|
|
73
|
+
if (!e.retiring) {
|
|
74
|
+
let t = Promise.resolve().then(async () => {
|
|
75
|
+
if ((await Promise.allSettled([
|
|
76
|
+
(async () => {
|
|
77
|
+
if (!e.cacheClosed) {
|
|
78
|
+
if (e.cache) {
|
|
79
|
+
let t = e.cache.close();
|
|
80
|
+
if (!(t instanceof Promise) || await t !== void 0) throw h();
|
|
81
|
+
}
|
|
82
|
+
e.cacheClosed = !0;
|
|
83
|
+
}
|
|
84
|
+
})(),
|
|
85
|
+
(async () => {
|
|
86
|
+
if (e.sourceClosed) return;
|
|
87
|
+
let t = e.source.close();
|
|
88
|
+
if (!(t instanceof Promise) || await t !== void 0) throw h();
|
|
89
|
+
e.sourceClosed = !0;
|
|
90
|
+
})(),
|
|
91
|
+
(async () => {
|
|
92
|
+
if (!e.renderClosed) {
|
|
93
|
+
if (e.render) {
|
|
94
|
+
let t = e.render.close();
|
|
95
|
+
if (!(t instanceof Promise) || await t !== void 0) throw h();
|
|
96
|
+
}
|
|
97
|
+
e.renderClosed = !0;
|
|
98
|
+
}
|
|
99
|
+
})()
|
|
100
|
+
])).some((e) => e.status === "rejected")) throw h();
|
|
101
|
+
A.delete(e);
|
|
102
|
+
});
|
|
103
|
+
e.retiring = t, t.then(() => {
|
|
104
|
+
e.retiring = null;
|
|
105
|
+
}, () => {
|
|
106
|
+
e.retiring = null;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return e.retiring;
|
|
110
|
+
}, I = () => {
|
|
111
|
+
if (N || M || !j?.cache) throw h();
|
|
112
|
+
return k.current(), j.cache;
|
|
113
|
+
};
|
|
114
|
+
return Object.freeze({
|
|
115
|
+
at: (e) => I().at(e),
|
|
116
|
+
contains: (e) => I().contains(e),
|
|
117
|
+
render: (t, n) => {
|
|
118
|
+
try {
|
|
119
|
+
let e = I(), r = j;
|
|
120
|
+
if (!r.render) {
|
|
121
|
+
let t = b.kind === "2d-heightfield" ? D.codecLimits?.["2d-heightfield"] : void 0, n = t && !O.lod?.codecLimits ? {
|
|
122
|
+
...O,
|
|
123
|
+
lod: {
|
|
124
|
+
...O.lod,
|
|
125
|
+
codecLimits: t
|
|
126
|
+
}
|
|
127
|
+
} : O;
|
|
128
|
+
r.render = d(e, v, n);
|
|
129
|
+
}
|
|
130
|
+
return r.render.prepare(t, n);
|
|
131
|
+
} catch (t) {
|
|
132
|
+
return Promise.reject(t instanceof e ? t : h());
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
observation: () => {
|
|
136
|
+
let e = j?.cache;
|
|
137
|
+
return Object.freeze({
|
|
138
|
+
scope: j?.scope ?? null,
|
|
139
|
+
ready: !N && M === null && e != null && !e.observation().withdrawn && !k.observation().withdrawn,
|
|
140
|
+
active: M !== null,
|
|
141
|
+
withdrawn: N || k.observation().withdrawn,
|
|
142
|
+
retiring: [...A].filter((e) => e !== j).length,
|
|
143
|
+
renderEntries: j?.render?.observation().entries ?? 0,
|
|
144
|
+
renderEncodedBytes: j?.render?.observation().encodedBytes ?? 0,
|
|
145
|
+
renderJobs: j?.render?.observation().jobs ?? 0
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
stream: (r, i = {}) => {
|
|
149
|
+
try {
|
|
150
|
+
if (N || M) throw h();
|
|
151
|
+
let a = b.kind === "3d-voxel" || b.kind === "3d-shapes", c = n(r, a ? [
|
|
152
|
+
"xRaw",
|
|
153
|
+
"yRaw",
|
|
154
|
+
"zRaw"
|
|
155
|
+
] : ["xRaw", "yRaw"]), u = Object.freeze(Object.fromEntries(Object.entries(c).map(([e, t]) => [e, o(t, -2147483648, 2147483647)]))), d = { ...n(i, [
|
|
156
|
+
"maxChunks",
|
|
157
|
+
"maxVisitedCoordinates",
|
|
158
|
+
"velocity"
|
|
159
|
+
], []) };
|
|
160
|
+
if (Object.hasOwn(d, "velocity")) {
|
|
161
|
+
let e = n(d.velocity, a ? [
|
|
162
|
+
"xRaw",
|
|
163
|
+
"yRaw",
|
|
164
|
+
"zRaw"
|
|
165
|
+
] : ["xRaw", "yRaw"]);
|
|
166
|
+
d.velocity = Object.freeze(Object.fromEntries(Object.entries(e).map(([e, t]) => [e, o(t, -2147483648, 2147483647)])));
|
|
167
|
+
}
|
|
168
|
+
let f = Promise.resolve().then(async () => {
|
|
169
|
+
let n = null;
|
|
170
|
+
try {
|
|
171
|
+
for (let e of A) e !== j && await F(e);
|
|
172
|
+
if (await k.pump(), N) throw h();
|
|
173
|
+
let e = k.current().scope, r = D.maxCachedChunks ?? v.geometry.streaming.client.maxCachedChunks;
|
|
174
|
+
if (s(v, e, u, {
|
|
175
|
+
...d,
|
|
176
|
+
maxChunks: Object.hasOwn(d, "maxChunks") ? o(d.maxChunks, 1, r) : r
|
|
177
|
+
}), j && JSON.stringify(j.scope) !== JSON.stringify(e)) {
|
|
178
|
+
let e = j;
|
|
179
|
+
j = null, await F(e);
|
|
180
|
+
}
|
|
181
|
+
if (!j) {
|
|
182
|
+
let r = p(t, e, {
|
|
183
|
+
...E,
|
|
184
|
+
manifest: () => k.current(),
|
|
185
|
+
staticSource: C
|
|
186
|
+
});
|
|
187
|
+
n = {
|
|
188
|
+
scope: e,
|
|
189
|
+
source: r,
|
|
190
|
+
cache: null,
|
|
191
|
+
render: null,
|
|
192
|
+
renderClosed: !1,
|
|
193
|
+
sourceClosed: !1,
|
|
194
|
+
cacheClosed: !1,
|
|
195
|
+
retiring: null
|
|
196
|
+
}, A.add(n), n.cache = l(t, v, e, { load: (e, t) => r.load(e, t) }, D);
|
|
197
|
+
}
|
|
198
|
+
let i = j ?? n;
|
|
199
|
+
if (!i?.cache || N) throw h();
|
|
200
|
+
let a = await i.cache.stream(u, d);
|
|
201
|
+
if (N || JSON.stringify(k.current().scope) !== JSON.stringify(e)) throw h();
|
|
202
|
+
return j = i, n = null, a;
|
|
203
|
+
} catch (t) {
|
|
204
|
+
throw n && await F(n), t instanceof e ? t : h();
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return M = f, f.then(() => {
|
|
208
|
+
M = null;
|
|
209
|
+
}, () => {
|
|
210
|
+
M = null;
|
|
211
|
+
}), f;
|
|
212
|
+
} catch (t) {
|
|
213
|
+
return Promise.reject(t instanceof e ? t : h());
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
close: () => {
|
|
217
|
+
if (N = !0, j = null, !P) {
|
|
218
|
+
let e = M, t = Promise.resolve().then(async () => {
|
|
219
|
+
let t = [...A].map(F);
|
|
220
|
+
if ((await Promise.allSettled([
|
|
221
|
+
k.close(),
|
|
222
|
+
...t,
|
|
223
|
+
...e ? [e.then(() => void 0, () => void 0)] : []
|
|
224
|
+
])).some((e) => e.status === "rejected")) throw h();
|
|
225
|
+
for (let e of A) await F(e);
|
|
226
|
+
});
|
|
227
|
+
P = t, t.then(() => {
|
|
228
|
+
P = null;
|
|
229
|
+
}, () => {
|
|
230
|
+
P = null;
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return P;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}, _ = (e, t, n, r) => g(c(e), t, n, r);
|
|
237
|
+
//#endregion
|
|
238
|
+
export { _ as makeRoomConnectionGeometryVersionClient, g as makeRoomGeometryVersionClient };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
//#region src/geometryVersionCompare.ts
|
|
3
|
+
function t() {
|
|
4
|
+
throw new e({ detail: "Geometry version comparison requires two manifests of the same tenant, World and kind with unique chunk addresses" });
|
|
5
|
+
}
|
|
6
|
+
var n = (e) => JSON.stringify([
|
|
7
|
+
e.layerSetId,
|
|
8
|
+
e.cx,
|
|
9
|
+
e.cy,
|
|
10
|
+
e.cz ?? null
|
|
11
|
+
]), r = (e) => Object.freeze({
|
|
12
|
+
layerSetId: e.layerSetId,
|
|
13
|
+
cx: e.cx,
|
|
14
|
+
cy: e.cy,
|
|
15
|
+
...e.cz === void 0 ? {} : { cz: e.cz }
|
|
16
|
+
}), i = (e, t) => e.layerSetId < t.layerSetId ? -1 : e.layerSetId > t.layerSetId ? 1 : e.cx - t.cx || e.cy - t.cy || (e.cz ?? 0) - (t.cz ?? 0), a = (e, a) => {
|
|
17
|
+
if (!e || !a || e.tenantId !== a.tenantId || e.worldId !== a.worldId || e.kind !== a.kind || !Array.isArray(e.chunks) || !Array.isArray(a.chunks)) return t();
|
|
18
|
+
let o = (e) => {
|
|
19
|
+
let r = /* @__PURE__ */ new Map();
|
|
20
|
+
for (let i of e) {
|
|
21
|
+
let e = n(i);
|
|
22
|
+
if (r.has(e)) return t();
|
|
23
|
+
r.set(e, i);
|
|
24
|
+
}
|
|
25
|
+
return r;
|
|
26
|
+
}, s = o(e.chunks), c = o(a.chunks), l = [], u = [], d = [], f = 0;
|
|
27
|
+
for (let [e, t] of c) {
|
|
28
|
+
let n = s.get(e);
|
|
29
|
+
n ? n.contentSha256 === t.contentSha256 ? f++ : d.push(r(t)) : l.push(r(t));
|
|
30
|
+
}
|
|
31
|
+
for (let [e, t] of s) c.has(e) || u.push(r(t));
|
|
32
|
+
return Object.freeze({
|
|
33
|
+
added: Object.freeze(l.sort(i)),
|
|
34
|
+
removed: Object.freeze(u.sort(i)),
|
|
35
|
+
changed: Object.freeze(d.sort(i)),
|
|
36
|
+
unchanged: f
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { a as compareGeometryVersions };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { geometryOwnData as n } from "./geometryTileCodec.js";
|
|
3
|
+
import { admitGeometryChunkForKind as r, captureGeometryArtifact as i, createGeometryArtifact as a } from "./geometryArtifacts.js";
|
|
4
|
+
import { assertGeometryArtifactScope as o, captureGeometryCodecProfiles as s, captureGeometryPersistenceScope as c, captureGeometryStaticReference as l, geometryPersistenceInteger as u } from "./geometryPersistenceData.js";
|
|
5
|
+
import { defaultGeometryMigrateDelta as d } from "./geometryMigrationStrategies.js";
|
|
6
|
+
import { captureGeometryCompactionStrategies as f, prepareGeometryCompaction as p } from "./geometryCompactionStrategies.js";
|
|
7
|
+
import { geometryChunkHasWorldExtent as m } from "./geometryWorldExtent.js";
|
|
8
|
+
import { captureWorldCatalog as h } from "./world.js";
|
|
9
|
+
import { Effect as g } from "effect";
|
|
10
|
+
//#region src/geometryVersionMigration.ts
|
|
11
|
+
function _() {
|
|
12
|
+
throw new t({ detail: "Geometry version migration requires exact genuine same-chunk artifacts and a bounded pure rule" });
|
|
13
|
+
}
|
|
14
|
+
var v = (v, y, b = {}) => {
|
|
15
|
+
try {
|
|
16
|
+
let x = h([v])[0], S = x.geometry;
|
|
17
|
+
if (!S) return _();
|
|
18
|
+
let C = n(y, ["from", "to"]), w = n(C.from, [
|
|
19
|
+
"reference",
|
|
20
|
+
"static",
|
|
21
|
+
"current"
|
|
22
|
+
]), T = n(C.to, ["reference", "static"]), E = n(w.current, [
|
|
23
|
+
"scope",
|
|
24
|
+
"revision",
|
|
25
|
+
"artifact"
|
|
26
|
+
]), D = l(w.reference), O = l(T.reference), k = i(w.static), A = i(T.static), j = i(E.artifact), M = c(E.scope), N = c({
|
|
27
|
+
tenantId: O.tenantId,
|
|
28
|
+
kind: O.kind,
|
|
29
|
+
worldId: O.worldId,
|
|
30
|
+
layerSetId: O.layerSetId,
|
|
31
|
+
version: O.version,
|
|
32
|
+
cx: O.cx,
|
|
33
|
+
cy: O.cy,
|
|
34
|
+
...O.cz === void 0 ? {} : { cz: O.cz }
|
|
35
|
+
}), P = u(E.revision), F = n(b, [
|
|
36
|
+
"strategies",
|
|
37
|
+
"maxAccountedBytes",
|
|
38
|
+
"maxPatchBytes",
|
|
39
|
+
"codecLimits"
|
|
40
|
+
], []), I = Object.hasOwn(F, "maxAccountedBytes") ? u(F.maxAccountedBytes, 512, S.budgets.maxPreparedBytes) : S.budgets.maxPreparedBytes, L = Object.hasOwn(F, "maxPatchBytes") ? u(F.maxPatchBytes, 512, S.dynamic.maxDeltaBytesPerChunk) : S.dynamic.maxDeltaBytesPerChunk, R = (Object.hasOwn(F, "codecLimits") ? s(F.codecLimits) : /* @__PURE__ */ new Map()).get(N.kind) ?? {}, z = Object.hasOwn(F, "strategies") ? n(F.strategies, ["migrateDelta", "compaction"], []) : {}, B = Object.hasOwn(z, "migrateDelta"), V = f({ compaction: Object.hasOwn(z, "compaction") ? z.compaction : S.strategies.compaction }), H = B ? z.migrateDelta : S.strategies.migrateDelta, U = H !== d;
|
|
41
|
+
if (D.version === O.version || !S.dynamic.enabled && P !== 0 || D.kind !== S.kind || O.kind !== S.kind || D.worldId !== x.name || O.worldId !== x.name || D.tenantId !== O.tenantId || D.layerSetId !== O.layerSetId || D.cx !== O.cx || D.cy !== O.cy || D.cz !== O.cz || JSON.stringify(M) !== JSON.stringify(c({
|
|
42
|
+
tenantId: D.tenantId,
|
|
43
|
+
kind: D.kind,
|
|
44
|
+
worldId: D.worldId,
|
|
45
|
+
layerSetId: D.layerSetId,
|
|
46
|
+
version: D.version,
|
|
47
|
+
cx: D.cx,
|
|
48
|
+
cy: D.cy,
|
|
49
|
+
...D.cz === void 0 ? {} : { cz: D.cz }
|
|
50
|
+
})) || typeof H != "function") return _();
|
|
51
|
+
for (let [e, t] of [[k, D], [A, O]]) if (o(e, t), e.blobSha256 !== t.blobSha256 || e.contentSha256 !== t.contentSha256) return _();
|
|
52
|
+
o(j, M);
|
|
53
|
+
let W = 0;
|
|
54
|
+
for (let t of [
|
|
55
|
+
k,
|
|
56
|
+
A,
|
|
57
|
+
j
|
|
58
|
+
]) {
|
|
59
|
+
if (r(N.kind, t.chunk, R), !m(t, S.chunkSizeRaw)) return _();
|
|
60
|
+
if (W += t.bytes().length, W > I) throw new e({
|
|
61
|
+
budget: "geometryMigrationAccountedBytes",
|
|
62
|
+
limit: I
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
let G = B ? H.bind(F.strategies) : H, K = Object.freeze({
|
|
66
|
+
static: k,
|
|
67
|
+
current: j,
|
|
68
|
+
revision: P
|
|
69
|
+
}), q = Object.freeze({ static: A }), J = k.contentSha256 !== A.contentSha256;
|
|
70
|
+
return g.uninterruptible(g.tryPromise({
|
|
71
|
+
try: async () => {
|
|
72
|
+
let t = G(K, q);
|
|
73
|
+
if (t instanceof Promise) return t.catch(() => void 0), _();
|
|
74
|
+
let n = t === null ? A : await a(r(N.kind, t, R), R);
|
|
75
|
+
if (o(n, N), !m(n, S.chunkSizeRaw)) return _();
|
|
76
|
+
let i = await p({
|
|
77
|
+
static: A,
|
|
78
|
+
current: n,
|
|
79
|
+
limits: {
|
|
80
|
+
maxBytes: L,
|
|
81
|
+
maxMetadataBytes: Math.min(4096, L - 16)
|
|
82
|
+
},
|
|
83
|
+
codecLimits: R
|
|
84
|
+
}, V);
|
|
85
|
+
if (W + n.bytes().length + i.bytes().length > I) throw new e({
|
|
86
|
+
budget: "geometryMigrationAccountedBytes",
|
|
87
|
+
limit: I
|
|
88
|
+
});
|
|
89
|
+
return Object.freeze({
|
|
90
|
+
fromScope: M,
|
|
91
|
+
scope: N,
|
|
92
|
+
fromRevision: P,
|
|
93
|
+
staticChanged: J,
|
|
94
|
+
decision: U ? "custom" : J ? "discarded" : "kept",
|
|
95
|
+
artifact: n,
|
|
96
|
+
patch: i
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
catch: (n) => n instanceof e ? n : new t({ detail: "Actual native geometry migration preparation remains unavailable" })
|
|
100
|
+
}));
|
|
101
|
+
} catch (n) {
|
|
102
|
+
return g.fail(n instanceof e ? n : new t({ detail: "Geometry version migration input could not be captured" }));
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { d as defaultGeometryMigrateDelta, v as prepareGeometryVersionMigration };
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { BudgetExceeded as e } from "./errors.js";
|
|
2
|
+
import { geometryEnvelopeMagic as t } from "./geometryEnvelope.js";
|
|
3
|
+
import { createFixed as n } from "./fixedMath.js";
|
|
4
|
+
import { captureSimulationBytes as r } from "./simulationBytes.js";
|
|
5
|
+
import { fieldId as i } from "./room.js";
|
|
6
|
+
import { RoomStateCodec as a } from "./stateCodec.js";
|
|
7
|
+
import { GeometryTileMaterialSchema as o, GeometryTileRunSchema as s } from "./geometrySchemas.js";
|
|
8
|
+
import { geometryOwnData as c, geometryTileRefusal as l } from "./geometryTileCodec.js";
|
|
9
|
+
import { GeometryChunkAddress3DSchema as u } from "./geometryShapes.js";
|
|
10
|
+
import { Result as d, Schema as f } from "effect";
|
|
11
|
+
//#region src/geometryVoxel.ts
|
|
12
|
+
var p = n(), m = f.Struct({
|
|
13
|
+
sx: f.Int.pipe(i(1)),
|
|
14
|
+
sy: f.Int.pipe(i(2)),
|
|
15
|
+
sz: f.Int.pipe(i(3)),
|
|
16
|
+
runs: f.Array(s).pipe(i(4))
|
|
17
|
+
}), h = f.Struct({
|
|
18
|
+
kind: f.Literal("3d-voxel").pipe(i(1)),
|
|
19
|
+
formatVersion: f.Literal(1).pipe(i(2)),
|
|
20
|
+
address: u.pipe(i(3)),
|
|
21
|
+
version: f.String.pipe(i(4)),
|
|
22
|
+
side: f.Int.pipe(i(5)),
|
|
23
|
+
voxelSizeRaw: f.Int.pipe(i(6)),
|
|
24
|
+
palette: f.Array(o).pipe(i(7)),
|
|
25
|
+
sections: f.Array(m).pipe(i(8))
|
|
26
|
+
}), g = Object.freeze({
|
|
27
|
+
maxSide: 64,
|
|
28
|
+
maxVoxels: 262144,
|
|
29
|
+
maxPalette: 256,
|
|
30
|
+
maxSections: 64,
|
|
31
|
+
maxRunsPerSection: 4096,
|
|
32
|
+
maxBytes: 1048576
|
|
33
|
+
}), _ = Object.freeze({
|
|
34
|
+
maxSide: 128,
|
|
35
|
+
maxVoxels: 2097152,
|
|
36
|
+
maxPalette: 4096,
|
|
37
|
+
maxSections: 512,
|
|
38
|
+
maxRunsPerSection: 4096,
|
|
39
|
+
maxBytes: 16777216
|
|
40
|
+
}), v = (e, t, n) => typeof e == "number" && Number.isSafeInteger(e) && e >= t && e <= n ? e === 0 ? 0 : e : l(), y = (e) => typeof e == "string" && /^[A-Za-z0-9][A-Za-z0-9._:-]{0,95}$/.test(e) ? e : l(), b = (e) => {
|
|
41
|
+
let t = c(e, [
|
|
42
|
+
"worldId",
|
|
43
|
+
"layerSetId",
|
|
44
|
+
"cx",
|
|
45
|
+
"cy",
|
|
46
|
+
"cz"
|
|
47
|
+
]);
|
|
48
|
+
return Object.freeze({
|
|
49
|
+
worldId: y(t.worldId),
|
|
50
|
+
layerSetId: y(t.layerSetId),
|
|
51
|
+
cx: v(t.cx, -2147483648, 2147483647),
|
|
52
|
+
cy: v(t.cy, -2147483648, 2147483647),
|
|
53
|
+
cz: v(t.cz, -2147483648, 2147483647)
|
|
54
|
+
});
|
|
55
|
+
}, x = (e) => {
|
|
56
|
+
let t = c(e, ["key", "solid"]);
|
|
57
|
+
return typeof t.key != "string" || !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/.test(t.key) || typeof t.solid != "boolean" ? l() : Object.freeze({
|
|
58
|
+
key: t.key,
|
|
59
|
+
solid: t.solid
|
|
60
|
+
});
|
|
61
|
+
}, S = (e, t, n) => {
|
|
62
|
+
if (!Array.isArray(e) || e.length > t || Reflect.ownKeys(e).length !== e.length + 1) return l();
|
|
63
|
+
let r = [];
|
|
64
|
+
for (let t = 0; t < e.length; t++) {
|
|
65
|
+
let i = Object.getOwnPropertyDescriptor(e, String(t));
|
|
66
|
+
if (!i?.enumerable || !("value" in i)) return l();
|
|
67
|
+
r.push(n(i.value, t));
|
|
68
|
+
}
|
|
69
|
+
return Object.freeze(r);
|
|
70
|
+
}, C = [
|
|
71
|
+
"address",
|
|
72
|
+
"version",
|
|
73
|
+
"side",
|
|
74
|
+
"voxelSizeRaw"
|
|
75
|
+
], w = (e, t) => ({
|
|
76
|
+
sx: e % t,
|
|
77
|
+
sy: Math.floor(e / t) % t,
|
|
78
|
+
sz: Math.floor(e / (t * t))
|
|
79
|
+
}), T = (n = {}) => {
|
|
80
|
+
let i = Object.keys(g), o = c(n, i, []), s = { ...g };
|
|
81
|
+
for (let e of i) Object.hasOwn(o, e) && (s[e] = v(o[e], e === "maxBytes" ? 64 : e === "maxSide" ? 16 : 1, _[e]));
|
|
82
|
+
let u = Object.freeze(s), f = new a(h, {
|
|
83
|
+
maxBytes: u.maxBytes - 12,
|
|
84
|
+
maxCollectionLength: Math.max(u.maxPalette, u.maxSections, u.maxRunsPerSection),
|
|
85
|
+
maxFieldId: 16
|
|
86
|
+
}), p = (t) => {
|
|
87
|
+
let n = v(t.side, 16, u.maxSide), r = v(t.voxelSizeRaw, 1, 2147483647);
|
|
88
|
+
if (n % 16 != 0 || n * r > 2147483647) return l();
|
|
89
|
+
let i = n / 16, a = i * i * i, o = n * n * n;
|
|
90
|
+
if (a > u.maxSections) throw new e({
|
|
91
|
+
budget: "geometryVoxelSections",
|
|
92
|
+
limit: u.maxSections
|
|
93
|
+
});
|
|
94
|
+
if (o > u.maxVoxels) throw new e({
|
|
95
|
+
budget: "geometryVoxels",
|
|
96
|
+
limit: u.maxVoxels
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
side: n,
|
|
100
|
+
voxelSizeRaw: r,
|
|
101
|
+
edge: i,
|
|
102
|
+
sections: a,
|
|
103
|
+
voxels: o
|
|
104
|
+
};
|
|
105
|
+
}, m = (e) => {
|
|
106
|
+
let t = c(e, [
|
|
107
|
+
"kind",
|
|
108
|
+
"formatVersion",
|
|
109
|
+
...C,
|
|
110
|
+
"palette",
|
|
111
|
+
"sections"
|
|
112
|
+
]);
|
|
113
|
+
if (t.kind !== "3d-voxel" || t.formatVersion !== 1) return l();
|
|
114
|
+
let n = p(t), r = S(t.palette, u.maxPalette, x);
|
|
115
|
+
if (!r.length) return l();
|
|
116
|
+
for (let e = 1; e < r.length; e++) if (r[e - 1].key >= r[e].key) return l();
|
|
117
|
+
let i = new Uint8Array(r.length), a = S(t.sections, n.sections, (e, t) => {
|
|
118
|
+
let a = c(e, [
|
|
119
|
+
"sx",
|
|
120
|
+
"sy",
|
|
121
|
+
"sz",
|
|
122
|
+
"runs"
|
|
123
|
+
]), o = w(t, n.edge);
|
|
124
|
+
if (a.sx !== o.sx || a.sy !== o.sy || a.sz !== o.sz) return l();
|
|
125
|
+
let s = 0, d = -1, f = S(a.runs, u.maxRunsPerSection, (e) => {
|
|
126
|
+
let t = c(e, ["paletteIndex", "length"]), n = v(t.paletteIndex, 0, r.length - 1), a = v(t.length, 1, 4096);
|
|
127
|
+
return n === d || a > 4096 - s ? l() : (s += a, d = n, i[n] = 1, Object.freeze({
|
|
128
|
+
paletteIndex: n,
|
|
129
|
+
length: a
|
|
130
|
+
}));
|
|
131
|
+
});
|
|
132
|
+
return s === 4096 ? Object.freeze({
|
|
133
|
+
...o,
|
|
134
|
+
runs: f
|
|
135
|
+
}) : l();
|
|
136
|
+
});
|
|
137
|
+
return a.length !== n.sections || i.some((e) => e === 0) ? l() : Object.freeze({
|
|
138
|
+
kind: "3d-voxel",
|
|
139
|
+
formatVersion: 1,
|
|
140
|
+
address: b(t.address),
|
|
141
|
+
version: y(t.version),
|
|
142
|
+
side: n.side,
|
|
143
|
+
voxelSizeRaw: n.voxelSizeRaw,
|
|
144
|
+
palette: r,
|
|
145
|
+
sections: a
|
|
146
|
+
});
|
|
147
|
+
}, T = (t) => {
|
|
148
|
+
let n = c(t, [...C, "voxels"]), r = p(n), i = S(n.voxels, r.voxels, x);
|
|
149
|
+
if (i.length !== r.voxels) return l();
|
|
150
|
+
let a = /* @__PURE__ */ new Map();
|
|
151
|
+
for (let t of i) {
|
|
152
|
+
let n = a.get(t.key);
|
|
153
|
+
if (n && n.solid !== t.solid) return l();
|
|
154
|
+
if (a.set(t.key, t), a.size > u.maxPalette) throw new e({
|
|
155
|
+
budget: "geometryVoxelPalette",
|
|
156
|
+
limit: u.maxPalette
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
let o = [...a.values()].sort((e, t) => e.key < t.key ? -1 : +(e.key > t.key)), s = new Map(o.map((e, t) => [e.key, t])), d = [];
|
|
160
|
+
for (let t = 0; t < r.sections; t++) {
|
|
161
|
+
let n = w(t, r.edge), a = [];
|
|
162
|
+
for (let t = 0; t < 4096; t++) {
|
|
163
|
+
let o = n.sx * 16 + (t & 15), c = n.sy * 16 + (t >>> 4 & 15), l = n.sz * 16 + (t >>> 8), d = s.get(i[(l * r.side + c) * r.side + o].key), f = a.at(-1);
|
|
164
|
+
if (f?.paletteIndex === d ? a[a.length - 1] = {
|
|
165
|
+
paletteIndex: d,
|
|
166
|
+
length: f.length + 1
|
|
167
|
+
} : a.push({
|
|
168
|
+
paletteIndex: d,
|
|
169
|
+
length: 1
|
|
170
|
+
}), a.length > u.maxRunsPerSection) throw new e({
|
|
171
|
+
budget: "geometryVoxelRuns",
|
|
172
|
+
limit: u.maxRunsPerSection
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
d.push({
|
|
176
|
+
...n,
|
|
177
|
+
runs: a
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return m({
|
|
181
|
+
kind: "3d-voxel",
|
|
182
|
+
formatVersion: 1,
|
|
183
|
+
address: n.address,
|
|
184
|
+
version: n.version,
|
|
185
|
+
side: r.side,
|
|
186
|
+
voxelSizeRaw: r.voxelSizeRaw,
|
|
187
|
+
palette: o,
|
|
188
|
+
sections: d
|
|
189
|
+
});
|
|
190
|
+
}, E = (e) => {
|
|
191
|
+
let n = f.full(m(e));
|
|
192
|
+
if (d.isFailure(n)) return l();
|
|
193
|
+
let r = new Uint8Array(12 + n.success.byteLength), i = new DataView(r.buffer);
|
|
194
|
+
return r.set(t["3d-voxel"]), i.setUint32(4, f.schemaHash, !0), i.setUint32(8, n.success.byteLength, !0), r.set(n.success, 12), r;
|
|
195
|
+
};
|
|
196
|
+
return Object.freeze({
|
|
197
|
+
limits: u,
|
|
198
|
+
schemaHash: f.schemaHash,
|
|
199
|
+
capture: m,
|
|
200
|
+
create: T,
|
|
201
|
+
encode: E,
|
|
202
|
+
decode: (n) => {
|
|
203
|
+
let i;
|
|
204
|
+
try {
|
|
205
|
+
i = r(n, u.maxBytes, "geometryVoxelBytes");
|
|
206
|
+
} catch (t) {
|
|
207
|
+
if (t instanceof e) throw t;
|
|
208
|
+
return l();
|
|
209
|
+
}
|
|
210
|
+
if (i.length < 12 || t["3d-voxel"].some((e, t) => i[t] !== e)) return l();
|
|
211
|
+
let a = new DataView(i.buffer, i.byteOffset, 12);
|
|
212
|
+
if (a.getUint32(4, !0) !== f.schemaHash || a.getUint32(8, !0) !== i.length - 12) return l();
|
|
213
|
+
let o = f.decodeFull(i.subarray(12));
|
|
214
|
+
if (d.isFailure(o)) return l();
|
|
215
|
+
let s = m(o.success), c = E(s);
|
|
216
|
+
return c.length !== i.length || c.some((e, t) => e !== i[t]) ? l() : s;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}, E = (e, t = {}) => {
|
|
220
|
+
let n = T(t).capture(e), r = n.side / 16, i = n.sections.map((e) => {
|
|
221
|
+
let t = new Uint16Array(e.runs.length), n = new Uint16Array(e.runs.length), r = 0;
|
|
222
|
+
return e.runs.forEach((e, i) => {
|
|
223
|
+
r += e.length, t[i] = r, n[i] = e.paletteIndex;
|
|
224
|
+
}), {
|
|
225
|
+
ends: t,
|
|
226
|
+
palette: n
|
|
227
|
+
};
|
|
228
|
+
}), a = (e, t, a) => {
|
|
229
|
+
v(e, 0, n.side - 1), v(t, 0, n.side - 1), v(a, 0, n.side - 1);
|
|
230
|
+
let o = i[((a >>> 4) * r + (t >>> 4)) * r + (e >>> 4)], s = ((a & 15) * 16 + (t & 15)) * 16 + (e & 15), c = 0, l = o.ends.length;
|
|
231
|
+
for (; c < l;) {
|
|
232
|
+
let e = c + l >>> 1;
|
|
233
|
+
o.ends[e] > s ? l = e : c = e + 1;
|
|
234
|
+
}
|
|
235
|
+
return n.palette[o.palette[c]];
|
|
236
|
+
};
|
|
237
|
+
return Object.freeze({
|
|
238
|
+
chunk: n,
|
|
239
|
+
materialAt: a,
|
|
240
|
+
solidAt: (e, t, n) => a(e, t, n).solid,
|
|
241
|
+
materialAtRaw: (e, t, r) => {
|
|
242
|
+
let i = n.side * n.voxelSizeRaw;
|
|
243
|
+
return v(e, 0, i - 1), v(t, 0, i - 1), v(r, 0, i - 1), a(p.div(p.raw(e), p.raw(n.voxelSizeRaw)) >>> 16, p.div(p.raw(t), p.raw(n.voxelSizeRaw)) >>> 16, p.div(p.raw(r), p.raw(n.voxelSizeRaw)) >>> 16);
|
|
244
|
+
},
|
|
245
|
+
occupancy: () => {
|
|
246
|
+
let e = n.side * n.side * n.side, t = new Uint8Array(Math.ceil(e / 8));
|
|
247
|
+
for (let r = 0; r < e; r++) a(r % n.side, Math.floor(r / n.side) % n.side, Math.floor(r / (n.side * n.side))).solid && (t[r >>> 3] = t[r >>> 3] | 1 << (r & 7));
|
|
248
|
+
return t;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
//#endregion
|
|
253
|
+
export { h as GeometryVoxelChunkSchema, m as GeometryVoxelSectionSchema, T as createGeometryVoxelCodec, E as createGeometryVoxelView, g as defaultGeometryVoxelLimits };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { WORLD_ENTITIES_TABLE as t } from "./worldEntities.js";
|
|
3
|
+
import { and as n, eq as r } from "@voltro/database";
|
|
4
|
+
import { Effect as i } from "effect";
|
|
5
|
+
//#region src/geometryWorldEntitySubject.ts
|
|
6
|
+
var a = (a) => (o) => i.tryPromise({
|
|
7
|
+
try: async () => {
|
|
8
|
+
let e = await a.query({
|
|
9
|
+
table: t,
|
|
10
|
+
predicate: n(r("tenantId", o.tenantId), r("subjectId", o.subjectId), r("roomId", o.roomId)),
|
|
11
|
+
order: [],
|
|
12
|
+
take: 16,
|
|
13
|
+
skip: void 0,
|
|
14
|
+
projection: [
|
|
15
|
+
"tenantId",
|
|
16
|
+
"subjectId",
|
|
17
|
+
"subjectKind",
|
|
18
|
+
"roomId"
|
|
19
|
+
]
|
|
20
|
+
}), i = new Set(e.map((e) => e.subjectKind));
|
|
21
|
+
if (!e.length || i.size !== 1 || e.some((e) => e.tenantId !== o.tenantId || e.subjectId !== o.subjectId || e.roomId !== o.roomId)) throw Error("no entity");
|
|
22
|
+
let s = [...i][0];
|
|
23
|
+
if (s !== "user" && s !== "guest") throw Error("no kind");
|
|
24
|
+
return Object.freeze({
|
|
25
|
+
id: o.subjectId,
|
|
26
|
+
kind: s
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
catch: () => new e({ detail: "Geometry recipient has no World entity in this Room" })
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { a as worldEntityGeometrySubject };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/geometryWorldExtent.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
let n = e.chunk;
|
|
4
|
+
switch (n.kind) {
|
|
5
|
+
case "2d-tiles": return n.width * n.tileSizeRaw === t && n.height * n.tileSizeRaw === t;
|
|
6
|
+
case "2d-heightfield": return (n.width - 1) * n.sampleSpacingRaw === t && (n.height - 1) * n.sampleSpacingRaw === t;
|
|
7
|
+
case "3d-shapes": return n.extentXRaw === t && n.extentYRaw === t && n.extentZRaw === t;
|
|
8
|
+
case "3d-voxel": return n.side * n.voxelSizeRaw === t;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { e as geometryChunkHasWorldExtent };
|