@voltro/plugin-rooms 0.0.0-stage → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24492 -0
- package/LICENSE +61 -0
- package/README.md +9204 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +12496 -0
- package/dist/actor.js +1473 -0
- package/dist/apiBinding.js +677 -0
- package/dist/apiRegistryBinding.js +398 -0
- package/dist/apiReservations.js +432 -0
- package/dist/baselines.js +72 -0
- package/dist/bots.d.ts +1485 -0
- package/dist/bots.js +562 -0
- package/dist/catalog.js +79 -0
- package/dist/checkpointJson.js +23 -0
- package/dist/checkpointStore.js +385 -0
- package/dist/client.js +55 -0
- package/dist/clockSync.js +50 -0
- package/dist/collision.js +155 -0
- package/dist/commandDelivery.js +100 -0
- package/dist/commandRecord.js +10 -0
- package/dist/commandWithdrawal.js +182 -0
- package/dist/connection.js +496 -0
- package/dist/controlCarrier.js +374 -0
- package/dist/controlRegistry.js +78 -0
- package/dist/controlTarget.js +44 -0
- package/dist/controlTransport.js +573 -0
- package/dist/developmentBinding.js +112 -0
- package/dist/directory.js +322 -0
- package/dist/directoryProjection.js +116 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +52 -0
- package/dist/fixed.d.ts +284 -0
- package/dist/fixed.js +10 -0
- package/dist/fixed32.js +133 -0
- package/dist/fixedCollision.js +59 -0
- package/dist/fixedCollision32.js +108 -0
- package/dist/fixedMath.js +55 -0
- package/dist/fixedRaw.js +10 -0
- package/dist/fixedSlabs.js +33 -0
- package/dist/fixedTrig.js +47 -0
- package/dist/fixedTrig32.js +37 -0
- package/dist/fixedVectors.js +112 -0
- package/dist/fixedVectors32.js +94 -0
- package/dist/fixedWide.js +49 -0
- package/dist/fixedWords.js +45 -0
- package/dist/gateway.js +56 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
- package/dist/geometry-worker/worker.d.mts +2 -0
- package/dist/geometry-worker/worker.mjs +50 -0
- package/dist/geometry.d.ts +2249 -0
- package/dist/geometry.js +40 -0
- package/dist/geometryActivation.js +81 -0
- package/dist/geometryActorInventory.js +107 -0
- package/dist/geometryAdminClient.js +86 -0
- package/dist/geometryAdminData.js +31 -0
- package/dist/geometryAdminFixtures.js +49 -0
- package/dist/geometryAdminPorts.js +4 -0
- package/dist/geometryAdminRpc.js +57 -0
- package/dist/geometryAdminRpcRoutes.js +48 -0
- package/dist/geometryAdminSchemas.js +38 -0
- package/dist/geometryAdministration.js +189 -0
- package/dist/geometryAdministrationPorts.js +4 -0
- package/dist/geometryApiBinding.js +164 -0
- package/dist/geometryAppStorage.js +57 -0
- package/dist/geometryArtifacts.js +197 -0
- package/dist/geometryAssetBundle.js +116 -0
- package/dist/geometryAssetClient.js +24 -0
- package/dist/geometryAssetData.js +105 -0
- package/dist/geometryAssetHttp.js +122 -0
- package/dist/geometryAssetPorts.js +4 -0
- package/dist/geometryAssetRpc.js +29 -0
- package/dist/geometryAssetRpcRoutes.js +39 -0
- package/dist/geometryAssetStorageGrant.js +102 -0
- package/dist/geometryBoxOverlap.js +109 -0
- package/dist/geometryCatalogueDigest.js +110 -0
- package/dist/geometryCellCoverage.js +84 -0
- package/dist/geometryCellLoader.js +27 -0
- package/dist/geometryChannel.js +133 -0
- package/dist/geometryChunkHttp.js +53 -0
- package/dist/geometryChunkLeases.js +21 -0
- package/dist/geometryClient.d.ts +1429 -0
- package/dist/geometryClient.js +148 -0
- package/dist/geometryClientChunks.js +329 -0
- package/dist/geometryClientDelta.js +24 -0
- package/dist/geometryClientHttp.js +36 -0
- package/dist/geometryClientInterest.js +108 -0
- package/dist/geometryClientStatic.js +33 -0
- package/dist/geometryCms.d.ts +763 -0
- package/dist/geometryCms.js +216 -0
- package/dist/geometryCommitCoordinator.js +240 -0
- package/dist/geometryCompactionFixture.js +83 -0
- package/dist/geometryCompactionStrategies.js +37 -0
- package/dist/geometryConnectionClient.js +22 -0
- package/dist/geometryDerivationFixtures.js +140 -0
- package/dist/geometryDerivationStrategies.js +26 -0
- package/dist/geometryDigest.js +12 -0
- package/dist/geometryEditChannel.js +69 -0
- package/dist/geometryEditIngress.js +262 -0
- package/dist/geometryEdits.js +365 -0
- package/dist/geometryEnvelope.js +40 -0
- package/dist/geometryGridRaycast.js +91 -0
- package/dist/geometryGridSweep.js +91 -0
- package/dist/geometryHeightfield.js +165 -0
- package/dist/geometryHeightfieldRaycast.js +73 -0
- package/dist/geometryHeightfieldSweep.js +84 -0
- package/dist/geometryHeightfieldVolume.js +44 -0
- package/dist/geometryHost.js +321 -0
- package/dist/geometryHostDirectory.js +206 -0
- package/dist/geometryHostMutations.js +136 -0
- package/dist/geometryHostStreams.js +123 -0
- package/dist/geometryHttpBody.js +75 -0
- package/dist/geometryHttpRoutes.js +111 -0
- package/dist/geometryImportGltf.js +299 -0
- package/dist/geometryImportLdtk.js +53 -0
- package/dist/geometryImportPng.js +143 -0
- package/dist/geometryImportPublication.js +66 -0
- package/dist/geometryImportTiled.js +38 -0
- package/dist/geometryImportTiles.js +135 -0
- package/dist/geometryImportVox.js +129 -0
- package/dist/geometryImportedSource.js +100 -0
- package/dist/geometryInspectEndpoint.js +247 -0
- package/dist/geometryInspection.js +91 -0
- package/dist/geometryInstall.js +120 -0
- package/dist/geometryJournalArchiveData.js +20 -0
- package/dist/geometryJournalArchiveIndex.js +329 -0
- package/dist/geometryJournalArchiveTable.js +20 -0
- package/dist/geometryJournalCompaction.js +99 -0
- package/dist/geometryJournalPatch.js +46 -0
- package/dist/geometryJournalRetention.js +111 -0
- package/dist/geometryJournalRetentionSchemas.js +35 -0
- package/dist/geometryJournalRetentionSweep.js +111 -0
- package/dist/geometryJournalRetentionWorkflow.js +27 -0
- package/dist/geometryJournalRetentionWorkflowData.js +30 -0
- package/dist/geometryJournalStorage.js +147 -0
- package/dist/geometryLoader.js +117 -0
- package/dist/geometryManifest.js +112 -0
- package/dist/geometryManifestChannel.js +92 -0
- package/dist/geometryManifestClient.js +121 -0
- package/dist/geometryManifestData.js +48 -0
- package/dist/geometryManifestPorts.js +4 -0
- package/dist/geometryManifestPublication.js +108 -0
- package/dist/geometryManifestSource.js +67 -0
- package/dist/geometryMigrationJournal.js +13 -0
- package/dist/geometryMigrationStrategies.js +6 -0
- package/dist/geometryMigrations.js +322 -0
- package/dist/geometryNativeMetadata.js +51 -0
- package/dist/geometryPatch.js +169 -0
- package/dist/geometryPersistence.js +448 -0
- package/dist/geometryPersistenceCapture.js +68 -0
- package/dist/geometryPersistenceData.js +139 -0
- package/dist/geometryPersistencePorts.js +4 -0
- package/dist/geometryPlayerAdmission.js +33 -0
- package/dist/geometryPlayerEditOwner.js +264 -0
- package/dist/geometryPlayerEdits.js +48 -0
- package/dist/geometryPrepared.js +187 -0
- package/dist/geometryPrivacyFence.js +23 -0
- package/dist/geometryProceduralPublication.js +90 -0
- package/dist/geometryProceduralWorker.js +163 -0
- package/dist/geometryPublication.js +109 -0
- package/dist/geometryRayAlgebra.js +115 -0
- package/dist/geometryReadClient.js +156 -0
- package/dist/geometryReadPorts.js +4 -0
- package/dist/geometryReadRpc.js +26 -0
- package/dist/geometryReadRpcRoutes.js +46 -0
- package/dist/geometryReliablePublication.js +81 -0
- package/dist/geometryReloadPorts.js +45 -0
- package/dist/geometryReloadSource.js +277 -0
- package/dist/geometryRenderCache.js +164 -0
- package/dist/geometryRenderLod.js +101 -0
- package/dist/geometryRollback.js +124 -0
- package/dist/geometryRollbackCoordinator.js +202 -0
- package/dist/geometryRollbackPorts.js +45 -0
- package/dist/geometryRollbackSource.js +208 -0
- package/dist/geometryRollbackStore.js +197 -0
- package/dist/geometrySchemas.js +26 -0
- package/dist/geometryServer.d.ts +2766 -0
- package/dist/geometryServer.js +62 -0
- package/dist/geometryShapeRaycast.js +110 -0
- package/dist/geometryShapeSegments.js +33 -0
- package/dist/geometryShapes.js +222 -0
- package/dist/geometrySnapshot.js +75 -0
- package/dist/geometrySnapshotChannel.js +159 -0
- package/dist/geometrySnapshotClient.js +158 -0
- package/dist/geometrySnapshotPreparation.js +75 -0
- package/dist/geometrySnapshotServer.js +190 -0
- package/dist/geometrySqlOwner.js +20 -0
- package/dist/geometryStorage.js +126 -0
- package/dist/geometryStorageGrant.js +68 -0
- package/dist/geometryStorageIdentity.js +8 -0
- package/dist/geometryTileArtifact.js +9 -0
- package/dist/geometryTileCodec.js +193 -0
- package/dist/geometryTileCollision.js +95 -0
- package/dist/geometryTileNavigation.js +127 -0
- package/dist/geometryTileView.js +34 -0
- package/dist/geometryVersionActivation.js +113 -0
- package/dist/geometryVersionClient.js +237 -0
- package/dist/geometryVersionCompare.js +39 -0
- package/dist/geometryVersionMigration.js +105 -0
- package/dist/geometryVoxel.js +252 -0
- package/dist/geometryWorldEntitySubject.js +31 -0
- package/dist/geometryWorldExtent.js +11 -0
- package/dist/geometryWorldMetadata.js +37 -0
- package/dist/geometryWorldStrategyFixtures.js +126 -0
- package/dist/geometryWorldView.js +306 -0
- package/dist/host.js +127 -0
- package/dist/hostBinding.js +276 -0
- package/dist/hostCellObservation.js +113 -0
- package/dist/hostClientCapacity.js +89 -0
- package/dist/hostCommandScope.js +63 -0
- package/dist/hostController.js +3093 -0
- package/dist/hostDeployment.js +64 -0
- package/dist/hostDrain.js +151 -0
- package/dist/hostDrainPorts.js +4 -0
- package/dist/hostDriver.js +178 -0
- package/dist/hostLane.js +287 -0
- package/dist/hostListener.js +78 -0
- package/dist/hostListenerBinding.js +18 -0
- package/dist/hostLoopObservation.js +89 -0
- package/dist/hostMetrics.js +55 -0
- package/dist/hostRegistryBinding.js +417 -0
- package/dist/hostSelection.js +15 -0
- package/dist/hostShutdown.js +46 -0
- package/dist/hostTurnObservation.js +52 -0
- package/dist/identities.js +3 -0
- package/dist/index.d.ts +8632 -0
- package/dist/index.js +231 -0
- package/dist/inputReceipts.js +62 -0
- package/dist/inputRedundancy.js +54 -0
- package/dist/inspect.js +237 -0
- package/dist/lockstep.d.ts +436 -0
- package/dist/lockstep.js +381 -0
- package/dist/lockstepAdmission.js +261 -0
- package/dist/lockstepAdmissionCodec.js +93 -0
- package/dist/lockstepAdmissionPorts.js +4 -0
- package/dist/lockstepClientSession.js +577 -0
- package/dist/lockstepDefinition.js +147 -0
- package/dist/lockstepHostLoop.js +242 -0
- package/dist/lockstepInitialAdmission.js +66 -0
- package/dist/lockstepInitialStrategyFixtures.js +44 -0
- package/dist/lockstepJournal.js +394 -0
- package/dist/lockstepJournalCodec.js +253 -0
- package/dist/lockstepJournalPorts.js +4 -0
- package/dist/lockstepJournalRebuild.js +207 -0
- package/dist/lockstepJournalRows.js +56 -0
- package/dist/lockstepMembers.js +130 -0
- package/dist/lockstepMessages.js +46 -0
- package/dist/lockstepOwnedRoom.js +763 -0
- package/dist/lockstepPolicies.js +83 -0
- package/dist/lockstepReact.js +46 -0
- package/dist/lockstepRecoveryTruth.js +120 -0
- package/dist/lockstepRosterConfig.js +31 -0
- package/dist/lockstepSeed.js +11 -0
- package/dist/lockstepSeedFixture.js +19 -0
- package/dist/lockstepServer.d.ts +3897 -0
- package/dist/lockstepServer.js +324 -0
- package/dist/lockstepServerConfig.js +100 -0
- package/dist/lockstepServerRoles.js +402 -0
- package/dist/lockstepServerStrategyFixtures.js +32 -0
- package/dist/lockstepStrategies.js +5 -0
- package/dist/lockstepStrategyFixtures.js +136 -0
- package/dist/lockstepTerminal.js +89 -0
- package/dist/lockstepTerminalPorts.js +4 -0
- package/dist/lockstepTransport.js +772 -0
- package/dist/lockstepTransportConfig.js +31 -0
- package/dist/lockstepWireRoster.js +33 -0
- package/dist/matchRoomProvider.js +31 -0
- package/dist/matchRooms.js +18 -0
- package/dist/membershipObserver.js +46 -0
- package/dist/moderation.js +97 -0
- package/dist/movementSpecials.js +103 -0
- package/dist/ownership.js +16 -0
- package/dist/ownershipWithdrawal.js +17 -0
- package/dist/pcg32.js +95 -0
- package/dist/ports.d.ts +1241 -0
- package/dist/ports.js +10 -0
- package/dist/quaternion.js +69 -0
- package/dist/react.d.ts +406 -0
- package/dist/react.js +108 -0
- package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
- package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
- package/dist/reaper.js +242 -0
- package/dist/reaperSchemas.js +41 -0
- package/dist/reaperWorkflow.js +69 -0
- package/dist/recovery.js +188 -0
- package/dist/recoverySeats.js +25 -0
- package/dist/replay.d.ts +273 -0
- package/dist/replay.js +484 -0
- package/dist/replayPorts.js +4 -0
- package/dist/replayRecording.js +66 -0
- package/dist/replaySchema.js +156 -0
- package/dist/replayStorage.d.ts +149 -0
- package/dist/replayStorage.js +484 -0
- package/dist/reservationBatch.js +421 -0
- package/dist/reservationSchemas.js +16 -0
- package/dist/reservations.js +258 -0
- package/dist/reservePort.js +68 -0
- package/dist/resolvedOptions.js +3 -0
- package/dist/room.d.ts +1006 -0
- package/dist/room.js +283 -0
- package/dist/roomAccessSweep.js +94 -0
- package/dist/roomAppCommandControl.js +58 -0
- package/dist/roomAuthoringStrategy.js +16 -0
- package/dist/roomErasure.js +197 -0
- package/dist/roomPoolRuntimeDefaults.js +23 -0
- package/dist/roomPoolSelection.js +18 -0
- package/dist/roomPoolTopology.js +211 -0
- package/dist/rpc.d.ts +551 -0
- package/dist/rpc.js +111 -0
- package/dist/rpcClient.js +151 -0
- package/dist/rpcRoutes.js +27 -0
- package/dist/runtime.js +1122 -0
- package/dist/schemaHistory.js +97 -0
- package/dist/seatStore.js +150 -0
- package/dist/seatStrategyFixtures.js +51 -0
- package/dist/seatSubject.js +31 -0
- package/dist/seats.js +129 -0
- package/dist/serverSession.js +810 -0
- package/dist/serverSessionConfig.js +42 -0
- package/dist/sessionAdmission.js +52 -0
- package/dist/sidecarAdmission.js +102 -0
- package/dist/sidecarConfig.js +115 -0
- package/dist/sidecarConfigPublication.js +63 -0
- package/dist/sidecarHostListener.js +207 -0
- package/dist/sidecarIpc.js +204 -0
- package/dist/sidecarPeer.js +309 -0
- package/dist/sidecarProcessPort.js +27 -0
- package/dist/sidecarRuntime.js +167 -0
- package/dist/sidecarSelection.js +141 -0
- package/dist/sidecarWire.js +177 -0
- package/dist/sidecarWrites.js +162 -0
- package/dist/simulation.d.ts +391 -0
- package/dist/simulation.js +281 -0
- package/dist/simulationAuthoring.js +28 -0
- package/dist/simulationBytes.js +26 -0
- package/dist/simulationConformance.js +304 -0
- package/dist/simulationInputHistoryCapture.js +34 -0
- package/dist/simulationInputHistoryWire.js +192 -0
- package/dist/simulationOptionsWire.js +77 -0
- package/dist/simulationRecoveryWire.js +133 -0
- package/dist/simulationReplay.js +126 -0
- package/dist/simulationSnapshotWire.js +111 -0
- package/dist/simulationState.js +177 -0
- package/dist/snapshotBlob.js +125 -0
- package/dist/snapshotBlobCleanup.js +92 -0
- package/dist/snapshotBlobIndex.js +37 -0
- package/dist/snapshotBudget.js +79 -0
- package/dist/snapshotChain.js +184 -0
- package/dist/snapshotErasure.js +171 -0
- package/dist/snapshotInspection.js +104 -0
- package/dist/snapshotSegmentBlobs.js +57 -0
- package/dist/snapshotUploads.js +165 -0
- package/dist/socketTransport.js +252 -0
- package/dist/spatial.js +103 -0
- package/dist/spectatorPolicy.js +25 -0
- package/dist/spectatorProducer.js +88 -0
- package/dist/startFailureCause.js +3 -0
- package/dist/stateCodec.js +657 -0
- package/dist/strategies.d.ts +210 -0
- package/dist/strategies.js +8 -0
- package/dist/strategiesServer.d.ts +286 -0
- package/dist/strategiesServer.js +11 -0
- package/dist/strategyFixtures.js +181 -0
- package/dist/streamFraming.js +121 -0
- package/dist/streamTransport.js +265 -0
- package/dist/subjectAdmission.js +49 -0
- package/dist/subjectPrivacy.js +280 -0
- package/dist/subjectPrivacyBinding.js +89 -0
- package/dist/systemManifest.js +181 -0
- package/dist/tables.js +158 -0
- package/dist/testHarness.js +88 -0
- package/dist/testing.d.ts +3684 -0
- package/dist/testing.js +220 -0
- package/dist/testingPorts.js +270 -0
- package/dist/testingServer.d.ts +4060 -0
- package/dist/testingServer.js +18 -0
- package/dist/transform.d.ts +692 -0
- package/dist/transform.js +216 -0
- package/dist/transform3d.js +117 -0
- package/dist/transformCollection.js +23 -0
- package/dist/transformCollection3d.js +23 -0
- package/dist/transformCollectionCore.js +155 -0
- package/dist/transformFrames.js +120 -0
- package/dist/transformPrediction3d.js +126 -0
- package/dist/transformRules.js +122 -0
- package/dist/transformSchemas.js +19 -0
- package/dist/transport.js +31 -0
- package/dist/transportAuthoring.js +28 -0
- package/dist/transportCleanup.js +21 -0
- package/dist/transportConformance.js +123 -0
- package/dist/transportConnector.js +81 -0
- package/dist/transportEndpoints.js +37 -0
- package/dist/transportsServer.d.ts +5515 -0
- package/dist/transportsServer.js +6 -0
- package/dist/viewProjection.js +15 -0
- package/dist/web.d.ts +2286 -0
- package/dist/web.js +517 -0
- package/dist/webTransportClient.js +172 -0
- package/dist/wire.d.ts +992 -0
- package/dist/wire.js +491 -0
- package/dist/withdrawalPort.js +27 -0
- package/dist/world.d.ts +1894 -0
- package/dist/world.js +332 -0
- package/dist/worldActorReceipts.js +47 -0
- package/dist/worldActorTransferSnapshot.js +13 -0
- package/dist/worldAdmissionPending.js +7 -0
- package/dist/worldBoundaryCoordinator.js +147 -0
- package/dist/worldCatalog.js +80 -0
- package/dist/worldCellAllocation.js +202 -0
- package/dist/worldCellDestination.js +67 -0
- package/dist/worldCells.js +488 -0
- package/dist/worldChange.js +31 -0
- package/dist/worldClient.js +663 -0
- package/dist/worldClientControl.js +140 -0
- package/dist/worldClientPendingInput.js +15 -0
- package/dist/worldClientRpc.js +132 -0
- package/dist/worldClientRpcRoutes.js +42 -0
- package/dist/worldClientSchemas.js +27 -0
- package/dist/worldCommands.js +139 -0
- package/dist/worldData.js +41 -0
- package/dist/worldDefaultBinding.js +376 -0
- package/dist/worldDefaultGroupAdmission.js +81 -0
- package/dist/worldDefaultGroupAppServices.js +30 -0
- package/dist/worldDefaultGroupCompensation.js +108 -0
- package/dist/worldDefaultGroupContinuation.js +95 -0
- package/dist/worldDefaultGroupControl.js +71 -0
- package/dist/worldDefaultGroupMembers.js +84 -0
- package/dist/worldDefaultGroups.js +20 -0
- package/dist/worldDefaultPending.js +78 -0
- package/dist/worldDefaultService.js +244 -0
- package/dist/worldEntities.js +2979 -0
- package/dist/worldEntityCodec.js +20 -0
- package/dist/worldEntityHandoffView.js +153 -0
- package/dist/worldGeometry.js +169 -0
- package/dist/worldGhostAdmission.js +64 -0
- package/dist/worldGhostDestination.js +117 -0
- package/dist/worldGhostGateway.js +131 -0
- package/dist/worldGhostHandshake.js +107 -0
- package/dist/worldGhostHost.js +41 -0
- package/dist/worldGhostIngress.js +131 -0
- package/dist/worldGhostNeighborhood.js +69 -0
- package/dist/worldGhostNeighbors.js +85 -0
- package/dist/worldGhostOutbound.js +109 -0
- package/dist/worldGhostPublisher.js +215 -0
- package/dist/worldGhostReceiver.js +212 -0
- package/dist/worldGhostSender.js +145 -0
- package/dist/worldGhostSocket.js +77 -0
- package/dist/worldGhostWire.js +171 -0
- package/dist/worldGroupCommand.js +48 -0
- package/dist/worldGroupDeadline.js +114 -0
- package/dist/worldGroupPreparation.js +114 -0
- package/dist/worldGroupReadyControl.js +127 -0
- package/dist/worldGroupSupervisor.js +119 -0
- package/dist/worldHandoffMetrics.js +58 -0
- package/dist/worldHandoffView.js +99 -0
- package/dist/worldHostSource.js +68 -0
- package/dist/worldInspectEndpoint.js +249 -0
- package/dist/worldInspection.js +108 -0
- package/dist/worldInstanceAdmission.js +30 -0
- package/dist/worldInstanceAllocation.js +115 -0
- package/dist/worldInstanceDestination.js +63 -0
- package/dist/worldInstanceExpiry.js +281 -0
- package/dist/worldInstanceExpirySupervisor.js +87 -0
- package/dist/worldInstanceLifecycle.js +102 -0
- package/dist/worldInstanceState.js +51 -0
- package/dist/worldInstances.js +477 -0
- package/dist/worldJoin.js +55 -0
- package/dist/worldLayers.js +150 -0
- package/dist/worldLeases.js +77 -0
- package/dist/worldManifest.js +24 -0
- package/dist/worldMovement.js +62 -0
- package/dist/worldPersistence.js +133 -0
- package/dist/worldProjection.js +220 -0
- package/dist/worldReact.js +109 -0
- package/dist/worldRecoveryActor.js +34 -0
- package/dist/worldReturnAnchor.js +48 -0
- package/dist/worldRoomHooks.js +56 -0
- package/dist/worldRoomPool.js +26 -0
- package/dist/worldRoomSteps.js +132 -0
- package/dist/worldSeatBinding.js +35 -0
- package/dist/worldServer.d.ts +6936 -0
- package/dist/worldServer.js +48 -0
- package/dist/worldSourceSeatPending.js +8 -0
- package/dist/worldStrategyFixtures.js +163 -0
- package/dist/worldTesting.js +26 -0
- package/dist/worldTransitionDefaults.js +197 -0
- package/dist/worldTransitionExecutor.js +518 -0
- package/dist/worldTransitionGroup.js +112 -0
- package/dist/worldTransitionPhysicalSteps.js +39 -0
- package/dist/worldTransitionResolver.js +227 -0
- package/dist/worldTransitionSeatGroup.js +63 -0
- package/dist/worldTransitionSeats.js +259 -0
- package/dist/worldTransitionState.js +94 -0
- package/dist/worldTransitions.js +100 -0
- package/package.json +189 -4
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { captureSimulationBytes as n } from "./simulationBytes.js";
|
|
3
|
+
import { geometryOwnData as r } from "./geometryTileCodec.js";
|
|
4
|
+
import { captureGeometryArtifact as i, verifyGeometryArtifact as a } from "./geometryArtifacts.js";
|
|
5
|
+
import { assertGeometryArtifactScope as o, captureGeometryDense as s, captureGeometryOwner as c, captureGeometryPersistenceScope as l, captureGeometryPrivacyTarget as u, geometryPersistenceId as d, geometryPersistenceInteger as f, geometryPersistenceSha as p } from "./geometryPersistenceData.js";
|
|
6
|
+
import { createGeometryPatch as m } from "./geometryPatch.js";
|
|
7
|
+
import { captureWorldCatalog as h } from "./world.js";
|
|
8
|
+
import { GEO_MIGRATIONS_TABLE as g, geometryMigrationsTable as _ } from "./geometryMigrationJournal.js";
|
|
9
|
+
import { captureRoomSnapshotEffectRunner as v } from "./snapshotBlobIndex.js";
|
|
10
|
+
import { assertGeometryPrivacyFence as y } from "./geometryPrivacyFence.js";
|
|
11
|
+
import { captureGeometryStoredVersion as b, geometryPersistenceDigest as x, geometryPersistenceScopeKey as S, geometryPersistenceVersionKey as C } from "./geometryPersistenceCapture.js";
|
|
12
|
+
import { prepareGeometryVersionMigration as ee } from "./geometryVersionMigration.js";
|
|
13
|
+
import { assertGeometrySqlOwner as w } from "./geometrySqlOwner.js";
|
|
14
|
+
import { GEO_CHUNK_DELTAS_TABLE as T, GEO_VERSIONS_TABLE as E } from "./geometryPersistence.js";
|
|
15
|
+
import { and as D, eq as O, generateId as k } from "@voltro/database";
|
|
16
|
+
import { Context as A, Effect as j, Layer as M } from "effect";
|
|
17
|
+
// src/geometryMigrations.ts
|
|
18
|
+
var N = (e) => {
|
|
19
|
+
let n = r(e, [
|
|
20
|
+
"from",
|
|
21
|
+
"to",
|
|
22
|
+
"expectedRevision",
|
|
23
|
+
"owner",
|
|
24
|
+
"requestId"
|
|
25
|
+
]), i = l(n.from), a = l(n.to);
|
|
26
|
+
if (i.version === a.version || i.tenantId !== a.tenantId || i.kind !== a.kind || i.worldId !== a.worldId || i.layerSetId !== a.layerSetId || i.cx !== a.cx || i.cy !== a.cy || i.cz !== a.cz) throw new t({ detail: "Migration request must change only the actual immutable version" });
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
from: i,
|
|
29
|
+
to: a,
|
|
30
|
+
expectedRevision: f(n.expectedRevision),
|
|
31
|
+
owner: c(n.owner),
|
|
32
|
+
requestId: d(n.requestId)
|
|
33
|
+
});
|
|
34
|
+
}, P = class extends A.Service()("@voltro/GeometryVersionMigrationPort") {}, F = (e) => M.succeed(P, e);
|
|
35
|
+
function I() {
|
|
36
|
+
throw new t({ detail: "Geometry SQL migration requires actual published versions, current owner and unchanged source revision" });
|
|
37
|
+
}
|
|
38
|
+
var L = (e, t) => JSON.stringify(e) === JSON.stringify(t), R = (e) => {
|
|
39
|
+
let t = r(e, [
|
|
40
|
+
"requestKey",
|
|
41
|
+
"inputSha256",
|
|
42
|
+
"from",
|
|
43
|
+
"to",
|
|
44
|
+
"fromRevision",
|
|
45
|
+
"revision",
|
|
46
|
+
"decision",
|
|
47
|
+
"staticChanged",
|
|
48
|
+
"fromManifestSha256",
|
|
49
|
+
"toManifestSha256",
|
|
50
|
+
"blobSha256",
|
|
51
|
+
"contentSha256"
|
|
52
|
+
]), n = l(t.from), i = l(t.to), a = t.decision, o = t.staticChanged;
|
|
53
|
+
return n.version === i.version || n.tenantId !== i.tenantId || n.kind !== i.kind || n.worldId !== i.worldId || n.layerSetId !== i.layerSetId || n.cx !== i.cx || n.cy !== i.cy || n.cz !== i.cz || ![
|
|
54
|
+
"kept",
|
|
55
|
+
"discarded",
|
|
56
|
+
"custom"
|
|
57
|
+
].includes(a) || typeof o != "boolean" || a === "kept" && o || a === "discarded" && !o ? I() : Object.freeze({
|
|
58
|
+
requestKey: p(t.requestKey),
|
|
59
|
+
inputSha256: p(t.inputSha256),
|
|
60
|
+
from: n,
|
|
61
|
+
to: i,
|
|
62
|
+
fromRevision: f(t.fromRevision),
|
|
63
|
+
revision: f(t.revision, 0, 1),
|
|
64
|
+
decision: a,
|
|
65
|
+
staticChanged: o,
|
|
66
|
+
fromManifestSha256: p(t.fromManifestSha256),
|
|
67
|
+
toManifestSha256: p(t.toManifestSha256),
|
|
68
|
+
blobSha256: p(t.blobSha256),
|
|
69
|
+
contentSha256: p(t.contentSha256)
|
|
70
|
+
});
|
|
71
|
+
}, z = (c, d, _) => {
|
|
72
|
+
let A = h(d), M = r(_, [
|
|
73
|
+
"persistence",
|
|
74
|
+
"staticSource",
|
|
75
|
+
"authorize",
|
|
76
|
+
"epochNow",
|
|
77
|
+
"maxManifestChunks",
|
|
78
|
+
"maxManifestBytes",
|
|
79
|
+
"maxPatchBytes",
|
|
80
|
+
"maxAccountedBytes",
|
|
81
|
+
"privacy",
|
|
82
|
+
"maxPrivacyRows",
|
|
83
|
+
"maxPrivacyBytes",
|
|
84
|
+
"strategies"
|
|
85
|
+
], [
|
|
86
|
+
"persistence",
|
|
87
|
+
"staticSource",
|
|
88
|
+
"authorize",
|
|
89
|
+
"epochNow",
|
|
90
|
+
"privacy"
|
|
91
|
+
]), P = r(M.persistence, [
|
|
92
|
+
"publish",
|
|
93
|
+
"observe",
|
|
94
|
+
"commit",
|
|
95
|
+
"exportSubject",
|
|
96
|
+
"eraseSubject"
|
|
97
|
+
]), F = r(M.staticSource, ["load"]), z = M.persistence, B = M.staticSource, V = r(M.privacy, ["exportSubject", "eraseSubject"]), H = M.privacy;
|
|
98
|
+
if (Object.values(V).some((e) => typeof e != "function") || Object.values(P).some((e) => typeof e != "function") || typeof F.load != "function" || typeof M.authorize != "function" || typeof M.epochNow != "function") return I();
|
|
99
|
+
let U = r(Object.hasOwn(M, "strategies") ? M.strategies : {}, ["migrateDelta", "compaction"], []);
|
|
100
|
+
if (Object.values(U).some((e) => typeof e != "function")) return I();
|
|
101
|
+
let te = Object.freeze({
|
|
102
|
+
...Object.hasOwn(U, "migrateDelta") ? { migrateDelta: U.migrateDelta } : {},
|
|
103
|
+
...Object.hasOwn(U, "compaction") ? { compaction: U.compaction } : {}
|
|
104
|
+
}), ne = P.observe.bind(z), W = F.load.bind(B), re = M.authorize.bind(_), ie = M.epochNow.bind(_), ae = V.exportSubject.bind(H), oe = V.eraseSubject.bind(H), G = (e, t, n, r) => Object.hasOwn(M, e) ? f(M[e], n, r) : t, K = G("maxManifestChunks", 256, 1, 4096), se = G("maxManifestBytes", 262144, 1024, 16777216), q = G("maxPatchBytes", 262144, 512, 16777216), ce = G("maxAccountedBytes", 52428800, 512, 268435456), le = G("maxPrivacyRows", 256, 1, 65536), J = G("maxPrivacyBytes", 1048576, 512, 67108864), Y = (e, t, n, r = !1) => e.query({
|
|
105
|
+
table: t,
|
|
106
|
+
predicate: n,
|
|
107
|
+
order: [{
|
|
108
|
+
column: "id",
|
|
109
|
+
direction: "asc"
|
|
110
|
+
}],
|
|
111
|
+
take: 2,
|
|
112
|
+
skip: void 0,
|
|
113
|
+
projection: void 0,
|
|
114
|
+
...r ? { lock: "update" } : {}
|
|
115
|
+
}), X = (e) => D(O("tenantId", e.tenantId), O("versionKey", C(e))), ue = (e) => D(O("tenantId", e.tenantId), O("scopeKey", S(e))), Z = async (e, t) => j.isEffect(t) ? e(t) : I(), Q = async (e, t) => {
|
|
116
|
+
if (await Z(e, re(t)) !== void 0) return I();
|
|
117
|
+
}, $ = (n) => j.flatMap(j.context(), (r) => j.uninterruptible(j.tryPromise({
|
|
118
|
+
try: () => n(v(r)),
|
|
119
|
+
catch: (n) => n instanceof e ? n : new t({ detail: "Actual migration privacy remains incomplete" })
|
|
120
|
+
})));
|
|
121
|
+
return Object.freeze({
|
|
122
|
+
exportSubject: (n) => {
|
|
123
|
+
try {
|
|
124
|
+
let t = u(n);
|
|
125
|
+
return $(async (n) => {
|
|
126
|
+
let r = s(await Z(n, ae(t)), le, R);
|
|
127
|
+
if (r.some((e) => e.from.tenantId !== t.tenantId) || new Set(r.map((e) => e.requestKey)).size !== r.length) return I();
|
|
128
|
+
if (new TextEncoder().encode(JSON.stringify(r)).length > J) throw new e({
|
|
129
|
+
budget: "geometryMigrationPrivacyBytes",
|
|
130
|
+
limit: J
|
|
131
|
+
});
|
|
132
|
+
return r;
|
|
133
|
+
});
|
|
134
|
+
} catch {
|
|
135
|
+
return j.fail(new t({ detail: "Actual migration privacy target could not be captured" }));
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
eraseSubject: (e) => {
|
|
139
|
+
try {
|
|
140
|
+
let t = u(e);
|
|
141
|
+
return $(async (e) => {
|
|
142
|
+
if (await y(c, t), await Z(e, oe(t)) !== void 0) return I();
|
|
143
|
+
await y(c, t);
|
|
144
|
+
});
|
|
145
|
+
} catch {
|
|
146
|
+
return j.fail(new t({ detail: "Actual migration privacy target could not be captured" }));
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
migrate: (s) => {
|
|
150
|
+
try {
|
|
151
|
+
let u = N(s), d = u.from, h = u.to, _ = A.find((e) => e.name === d.worldId), y = x(JSON.stringify([d.tenantId, u.requestId])), M = x(JSON.stringify(u)), P = D(O("tenantId", d.tenantId), O("requestKey", y));
|
|
152
|
+
if (!_?.geometry || _.geometry.kind !== d.kind || d.version === h.version || d.tenantId !== h.tenantId || d.kind !== h.kind || d.worldId !== h.worldId || d.layerSetId !== h.layerSetId || d.cx !== h.cx || d.cy !== h.cy || d.cz !== h.cz) return I();
|
|
153
|
+
let F = (e) => {
|
|
154
|
+
let t = R(e.receipt);
|
|
155
|
+
return e.tenantId !== d.tenantId || e.requestKey !== y || e.inputSha256 !== M || e.fromScopeKey !== S(d) || e.toScopeKey !== S(h) || t.requestKey !== y || t.inputSha256 !== M || !L(t.from, d) || !L(t.to, h) || t.fromRevision !== u.expectedRevision ? I() : t;
|
|
156
|
+
}, z = async (e, t, n) => {
|
|
157
|
+
let r = await Y(e, E, X(t), n);
|
|
158
|
+
return r.length === 1 ? b(r[0], t, K, se) : I();
|
|
159
|
+
}, B = async (e) => {
|
|
160
|
+
let t = [d, h].sort((e, t) => C(e).localeCompare(C(t))), n = /* @__PURE__ */ new Map();
|
|
161
|
+
for (let r of t) n.set(C(r), await z(e, r, !0));
|
|
162
|
+
return await w(e, d, u.owner), {
|
|
163
|
+
before: n.get(C(d)),
|
|
164
|
+
after: n.get(C(h))
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
return j.flatMap(j.context(), (s) => j.uninterruptible(j.tryPromise({
|
|
168
|
+
try: async () => {
|
|
169
|
+
let e = v(s);
|
|
170
|
+
await Q(e, u);
|
|
171
|
+
let t = await Y(c, g, P);
|
|
172
|
+
if (t.length > 1) return I();
|
|
173
|
+
if (t.length) return c.transactional(async (e) => {
|
|
174
|
+
await B(e);
|
|
175
|
+
let t = await Y(e, g, P, !0);
|
|
176
|
+
return t.length === 1 ? F(t[0]) : I();
|
|
177
|
+
});
|
|
178
|
+
let b = await z(c, d, !1), x = await z(c, h, !1), C = b.chunks.find((e) => S(e) === S(d)), w = x.chunks.find((e) => S(e) === S(h));
|
|
179
|
+
if (!C || !w) return I();
|
|
180
|
+
let E = r(await Z(e, ne(d)), [
|
|
181
|
+
"scope",
|
|
182
|
+
"revision",
|
|
183
|
+
"artifact"
|
|
184
|
+
]), D = Object.freeze({
|
|
185
|
+
scope: l(E.scope),
|
|
186
|
+
revision: f(E.revision),
|
|
187
|
+
artifact: i(E.artifact)
|
|
188
|
+
});
|
|
189
|
+
if (!L(D.scope, d) || D.revision !== u.expectedRevision) return I();
|
|
190
|
+
let O = await a(d.kind, await Z(e, W(C)), C.blobSha256), A = await a(h.kind, await Z(e, W(w)), w.blobSha256);
|
|
191
|
+
o(O, d), o(A, h);
|
|
192
|
+
let j = m(O, D.artifact, 0, { limits: {
|
|
193
|
+
maxBytes: q,
|
|
194
|
+
maxMetadataBytes: Math.min(4096, q - 16)
|
|
195
|
+
} }).bytes(), N = await Z(e, ee(_, {
|
|
196
|
+
from: {
|
|
197
|
+
reference: C,
|
|
198
|
+
static: O,
|
|
199
|
+
current: D
|
|
200
|
+
},
|
|
201
|
+
to: {
|
|
202
|
+
reference: w,
|
|
203
|
+
static: A
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
strategies: te,
|
|
207
|
+
maxPatchBytes: Math.min(q, _.geometry.dynamic.maxDeltaBytesPerChunk),
|
|
208
|
+
maxAccountedBytes: Math.min(ce, _.geometry.budgets.maxPreparedBytes)
|
|
209
|
+
})), V = R({
|
|
210
|
+
requestKey: y,
|
|
211
|
+
inputSha256: M,
|
|
212
|
+
from: d,
|
|
213
|
+
to: h,
|
|
214
|
+
fromRevision: D.revision,
|
|
215
|
+
revision: N.patch.metadata.revision,
|
|
216
|
+
decision: N.decision,
|
|
217
|
+
staticChanged: N.staticChanged,
|
|
218
|
+
fromManifestSha256: b.manifestSha256,
|
|
219
|
+
toManifestSha256: x.manifestSha256,
|
|
220
|
+
blobSha256: N.artifact.blobSha256,
|
|
221
|
+
contentSha256: N.artifact.contentSha256
|
|
222
|
+
}), H = N.patch.bytes(), U = new Date(f(ie(), 0, 864e13));
|
|
223
|
+
return await Q(e, u), c.transactional(async (e) => {
|
|
224
|
+
let t = await B(e);
|
|
225
|
+
if (t.before.manifestSha256 !== b.manifestSha256 || t.after.manifestSha256 !== x.manifestSha256) return I();
|
|
226
|
+
let r = await Y(e, g, P, !0);
|
|
227
|
+
if (r.length > 1) return I();
|
|
228
|
+
if (r.length) return F(r[0]);
|
|
229
|
+
let i = /* @__PURE__ */ new Map();
|
|
230
|
+
for (let t of [d, h].sort((e, t) => S(e).localeCompare(S(t)))) i.set(S(t), await Y(e, T, ue(t), !0));
|
|
231
|
+
let a = i.get(S(d)), o = i.get(S(h));
|
|
232
|
+
if (a.length > 1 || o.length !== 0) return I();
|
|
233
|
+
let s = a[0], c = s ? f(s.revision, 1) : 0, u = s ? p(s.blobSha256) : C.blobSha256, m = s ? p(s.contentSha256) : C.contentSha256;
|
|
234
|
+
if (s && (!L(l(s.scope), d) || s.tenantId !== d.tenantId || s.scopeKey !== S(d)) || c !== D.revision || u !== D.artifact.blobSha256 || m !== D.artifact.contentSha256) return I();
|
|
235
|
+
if (s) {
|
|
236
|
+
let e = n(s.delta, q, "geometryMigrationSourceDeltaBytes");
|
|
237
|
+
if (e.length !== j.length || e.some((e, t) => e !== j[t])) return I();
|
|
238
|
+
}
|
|
239
|
+
return V.revision > 0 && await e.insert(T, {
|
|
240
|
+
id: k({
|
|
241
|
+
kind: "typeid",
|
|
242
|
+
prefix: "gdelta"
|
|
243
|
+
}, T),
|
|
244
|
+
tenantId: h.tenantId,
|
|
245
|
+
scopeKey: S(h),
|
|
246
|
+
scope: h,
|
|
247
|
+
revision: V.revision,
|
|
248
|
+
blobSha256: V.blobSha256,
|
|
249
|
+
contentSha256: V.contentSha256,
|
|
250
|
+
delta: H,
|
|
251
|
+
updatedAt: U
|
|
252
|
+
}), await e.insert(g, {
|
|
253
|
+
id: k({
|
|
254
|
+
kind: "typeid",
|
|
255
|
+
prefix: "gmigrate"
|
|
256
|
+
}, g),
|
|
257
|
+
tenantId: d.tenantId,
|
|
258
|
+
requestKey: y,
|
|
259
|
+
inputSha256: M,
|
|
260
|
+
fromScopeKey: S(d),
|
|
261
|
+
toScopeKey: S(h),
|
|
262
|
+
receipt: V,
|
|
263
|
+
createdAt: U
|
|
264
|
+
}), V;
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
catch: (n) => n instanceof e ? n : new t({ detail: "Actual atomic geometry SQL migration remains unconfirmed" })
|
|
268
|
+
})));
|
|
269
|
+
} catch {
|
|
270
|
+
return j.fail(new t({ detail: "Geometry SQL migration request could not be captured" }));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}, B = (e) => {
|
|
275
|
+
let n = r(e, [
|
|
276
|
+
"migrate",
|
|
277
|
+
"exportSubject",
|
|
278
|
+
"eraseSubject"
|
|
279
|
+
]);
|
|
280
|
+
if (Object.values(n).some((e) => typeof e != "function")) return I();
|
|
281
|
+
let i = n.eraseSubject.bind(e), a = n.exportSubject.bind(e), o = (e, t) => u({
|
|
282
|
+
tenantId: t.tenantId,
|
|
283
|
+
requestId: t.requestId,
|
|
284
|
+
subject: {
|
|
285
|
+
id: e,
|
|
286
|
+
kind: t.kind
|
|
287
|
+
}
|
|
288
|
+
}), c = (e) => j.uninterruptible(j.suspend(() => {
|
|
289
|
+
let n = e();
|
|
290
|
+
return j.isEffect(n) ? n : j.fail(new t({ detail: "Migration privacy contribution requires its actual Effect" }));
|
|
291
|
+
})).pipe(j.catchCause(() => j.fail(new t({ detail: "Actual migration privacy contribution remains incomplete" }))));
|
|
292
|
+
return Object.freeze({
|
|
293
|
+
extendSchema: Object.freeze({ tables: Object.freeze([_]) }),
|
|
294
|
+
subjectPrivacy: Object.freeze({
|
|
295
|
+
tables: Object.freeze([g]),
|
|
296
|
+
kinds: Object.freeze(["user", "guest"])
|
|
297
|
+
}),
|
|
298
|
+
onErase: (e, n) => {
|
|
299
|
+
try {
|
|
300
|
+
let r = o(e, n);
|
|
301
|
+
return c(() => i(r).pipe(j.flatMap((e) => e === void 0 ? j.void : j.fail(new t({ detail: "Migration privacy withdrawal did not confirm void" })))));
|
|
302
|
+
} catch {
|
|
303
|
+
return j.fail(new t({ detail: "Actual migration privacy target could not be captured" }));
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
onExport: (e, n) => {
|
|
307
|
+
try {
|
|
308
|
+
let r = o(e, n);
|
|
309
|
+
return c(() => a(r).pipe(j.flatMap((e) => j.try({
|
|
310
|
+
try: () => {
|
|
311
|
+
let t = s(e, 4096, R);
|
|
312
|
+
return t.some((e) => e.from.tenantId !== r.tenantId) || new Set(t.map((e) => e.requestKey)).size !== t.length || new TextEncoder().encode(JSON.stringify(t)).length > 16777216 ? I() : t;
|
|
313
|
+
},
|
|
314
|
+
catch: () => new t({ detail: "Actual migration export escaped its admitted scope or budget" })
|
|
315
|
+
}))));
|
|
316
|
+
} catch {
|
|
317
|
+
return j.fail(new t({ detail: "Actual migration privacy target could not be captured" }));
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
export { P as GeometryVersionMigrationPort, R as captureGeometryMigrationReceipt, N as captureGeometryMigrationRequest, z as dataStoreGeometryMigrations, B as geometryMigrationContribution, F as geometryVersionMigrationLayer };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { geometryEnvelopeMagic as e } from "./geometryEnvelope.js";
|
|
2
|
+
import { RoomInputCodec as t } from "./stateCodec.js";
|
|
3
|
+
import { geometryArtifactContentCodec as n, geometryArtifactProfileLimits as r, geometryArtifactStateCodec as i } from "./geometryArtifacts.js";
|
|
4
|
+
import { defaultGeometryPatchLimits as a, geometryPatchMetadataCodec as o } from "./geometryPatch.js";
|
|
5
|
+
import { defaultGeometryTileNavigationLimits as s } from "./geometryTileNavigation.js";
|
|
6
|
+
import { geometryChunkHttpHeaders as c } from "./geometryChunkHttp.js";
|
|
7
|
+
import { GeometryManifestFragmentSchema as l, geometryManifestFragmentBytes as u } from "./geometryManifestChannel.js";
|
|
8
|
+
import { GeometryDeltaFragmentSchema as d, geometryDeltaFragmentBytes as f } from "./geometryChannel.js";
|
|
9
|
+
import { GeometryEditMessageSchema as p } from "./geometryEditChannel.js";
|
|
10
|
+
// src/geometryNativeMetadata.ts
|
|
11
|
+
var m = () => {
|
|
12
|
+
let m = (e) => Object.freeze({
|
|
13
|
+
schemaHash: e.schemaHash,
|
|
14
|
+
description: e.schemaDescription(),
|
|
15
|
+
limits: Object.freeze({ ...e.limits })
|
|
16
|
+
});
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
profile: "default",
|
|
19
|
+
httpHeaders: c,
|
|
20
|
+
navigation: s,
|
|
21
|
+
navigationReaderLimit: 64,
|
|
22
|
+
envelopes: e,
|
|
23
|
+
channels: Object.freeze({
|
|
24
|
+
manifest: Object.freeze({
|
|
25
|
+
codec: m(new t(l)),
|
|
26
|
+
fragmentBytes: u
|
|
27
|
+
}),
|
|
28
|
+
delta: Object.freeze({
|
|
29
|
+
codec: m(new t(d)),
|
|
30
|
+
fragmentBytes: f
|
|
31
|
+
}),
|
|
32
|
+
edit: Object.freeze({ codec: m(new t(p)) })
|
|
33
|
+
}),
|
|
34
|
+
chunks: Object.freeze([
|
|
35
|
+
"2d-tiles",
|
|
36
|
+
"2d-heightfield",
|
|
37
|
+
"3d-shapes",
|
|
38
|
+
"3d-voxel"
|
|
39
|
+
].map((e) => Object.freeze({
|
|
40
|
+
kind: e,
|
|
41
|
+
profileLimits: r(e),
|
|
42
|
+
state: m(i(e)),
|
|
43
|
+
content: m(n(e))
|
|
44
|
+
}))),
|
|
45
|
+
patch: Object.freeze({
|
|
46
|
+
limits: Object.freeze({ ...a }),
|
|
47
|
+
metadata: m(o(a))
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export { m as geometryNativeCodecMetadata };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { BudgetExceeded as e } from "./errors.js";
|
|
2
|
+
import { geometryEnvelopeMagic as t } from "./geometryEnvelope.js";
|
|
3
|
+
import { captureSimulationBytes as n } from "./simulationBytes.js";
|
|
4
|
+
import { fieldId as r } from "./room.js";
|
|
5
|
+
import { RoomStateCodec as i } from "./stateCodec.js";
|
|
6
|
+
import { geometryOwnData as a, geometryTileRefusal as o } from "./geometryTileCodec.js";
|
|
7
|
+
import { admitGeometryChunkForKind as s, captureGeometryArtifact as c, createGeometryArtifact as l, geometryArtifactStateCodec as u } from "./geometryArtifacts.js";
|
|
8
|
+
import { Result as d, Schema as f } from "effect";
|
|
9
|
+
// src/geometryPatch.ts
|
|
10
|
+
var p = f.Struct({
|
|
11
|
+
kind: f.Literals([
|
|
12
|
+
"2d-tiles",
|
|
13
|
+
"2d-heightfield",
|
|
14
|
+
"3d-shapes",
|
|
15
|
+
"3d-voxel"
|
|
16
|
+
]).pipe(r(1)),
|
|
17
|
+
formatVersion: f.Literal(1).pipe(r(2)),
|
|
18
|
+
worldId: f.String.pipe(r(3)),
|
|
19
|
+
layerSetId: f.String.pipe(r(4)),
|
|
20
|
+
cx: f.Int.pipe(r(5)),
|
|
21
|
+
cy: f.Int.pipe(r(6)),
|
|
22
|
+
cz: f.optional(f.Int.pipe(r(7))),
|
|
23
|
+
version: f.String.pipe(r(8)),
|
|
24
|
+
baseRevision: f.Int.pipe(r(9)),
|
|
25
|
+
revision: f.Int.pipe(r(10)),
|
|
26
|
+
baseBlobSha256: f.String.pipe(r(11)),
|
|
27
|
+
blobSha256: f.String.pipe(r(12)),
|
|
28
|
+
baseContentSha256: f.String.pipe(r(13)),
|
|
29
|
+
contentSha256: f.String.pipe(r(14)),
|
|
30
|
+
changed: f.Boolean.pipe(r(15)),
|
|
31
|
+
stateSchemaHash: f.Int.pipe(r(16))
|
|
32
|
+
}), m = Object.freeze({
|
|
33
|
+
maxBytes: 262144,
|
|
34
|
+
maxMetadataBytes: 4096
|
|
35
|
+
}), h = /* @__PURE__ */ new WeakMap(), g = (e) => !e || typeof e != "object" || !h.has(e) ? o() : e, _ = (e, t, n) => typeof e == "number" && Number.isSafeInteger(e) && e >= t && e <= n ? e === 0 ? 0 : e : o(), v = (e) => typeof e == "string" && /^[A-Za-z0-9][A-Za-z0-9._:-]{0,95}$/.test(e) ? e : o(), y = (e) => typeof e == "string" && /^[a-f0-9]{64}$/.test(e) ? e : o(), b = (e, t) => e.kind === t.kind && e.version === t.version && e.address.worldId === t.address.worldId && e.address.layerSetId === t.address.layerSetId && e.address.cx === t.address.cx && e.address.cy === t.address.cy && ("cz" in e.address ? e.address.cz : void 0) === ("cz" in t.address ? t.address.cz : void 0), x = (e) => {
|
|
36
|
+
let t = a(e, ["maxBytes", "maxMetadataBytes"], []), n = Object.freeze({
|
|
37
|
+
maxBytes: Object.hasOwn(t, "maxBytes") ? _(t.maxBytes, 80, 16777216) : m.maxBytes,
|
|
38
|
+
maxMetadataBytes: Object.hasOwn(t, "maxMetadataBytes") ? _(t.maxMetadataBytes, 64, 65536) : m.maxMetadataBytes
|
|
39
|
+
});
|
|
40
|
+
return n.maxMetadataBytes > n.maxBytes - 16 ? o() : n;
|
|
41
|
+
}, S = (e) => new i(p, {
|
|
42
|
+
maxBytes: e.maxMetadataBytes,
|
|
43
|
+
maxCollectionLength: 16,
|
|
44
|
+
maxFieldId: 16
|
|
45
|
+
}), C = (e, t) => {
|
|
46
|
+
let n = [
|
|
47
|
+
"kind",
|
|
48
|
+
"formatVersion",
|
|
49
|
+
"worldId",
|
|
50
|
+
"layerSetId",
|
|
51
|
+
"cx",
|
|
52
|
+
"cy",
|
|
53
|
+
"cz",
|
|
54
|
+
"version",
|
|
55
|
+
"baseRevision",
|
|
56
|
+
"revision",
|
|
57
|
+
"baseBlobSha256",
|
|
58
|
+
"blobSha256",
|
|
59
|
+
"baseContentSha256",
|
|
60
|
+
"contentSha256",
|
|
61
|
+
"changed",
|
|
62
|
+
"stateSchemaHash"
|
|
63
|
+
], r = a(e, n, n.filter((e) => e !== "cz")), i = r.kind;
|
|
64
|
+
if (![
|
|
65
|
+
"2d-tiles",
|
|
66
|
+
"2d-heightfield",
|
|
67
|
+
"3d-shapes",
|
|
68
|
+
"3d-voxel"
|
|
69
|
+
].includes(i) || r.formatVersion !== 1 || typeof r.changed != "boolean") return o();
|
|
70
|
+
let s = _(r.baseRevision, 0, 2147483647), c = _(r.revision, 0, 2147483647), l = r.changed, u = y(r.baseBlobSha256), d = y(r.blobSha256), f = y(r.baseContentSha256), p = y(r.contentSha256);
|
|
71
|
+
if (l ? t < 1 || s === 2147483647 || c !== s + 1 : t !== 0 || c !== s || u !== d || f !== p) return o();
|
|
72
|
+
let m = i === "3d-shapes" || i === "3d-voxel";
|
|
73
|
+
return m === Object.hasOwn(r, "cz") ? Object.freeze({
|
|
74
|
+
kind: i,
|
|
75
|
+
formatVersion: 1,
|
|
76
|
+
worldId: v(r.worldId),
|
|
77
|
+
layerSetId: v(r.layerSetId),
|
|
78
|
+
cx: _(r.cx, -2147483648, 2147483647),
|
|
79
|
+
cy: _(r.cy, -2147483648, 2147483647),
|
|
80
|
+
...m ? { cz: _(r.cz, -2147483648, 2147483647) } : {},
|
|
81
|
+
version: v(r.version),
|
|
82
|
+
baseRevision: s,
|
|
83
|
+
revision: c,
|
|
84
|
+
baseBlobSha256: u,
|
|
85
|
+
blobSha256: d,
|
|
86
|
+
baseContentSha256: f,
|
|
87
|
+
contentSha256: p,
|
|
88
|
+
changed: l,
|
|
89
|
+
stateSchemaHash: _(r.stateSchemaHash, 0, 4294967295)
|
|
90
|
+
}) : o();
|
|
91
|
+
}, w = (e, t, n) => {
|
|
92
|
+
let r = Object.freeze({
|
|
93
|
+
metadata: e,
|
|
94
|
+
bytes: () => new Uint8Array(n)
|
|
95
|
+
});
|
|
96
|
+
return h.set(r, {
|
|
97
|
+
metadata: e,
|
|
98
|
+
delta: t,
|
|
99
|
+
bytes: n
|
|
100
|
+
}), r;
|
|
101
|
+
}, T = (n, r, i) => {
|
|
102
|
+
let a = S(i), s = a.full(n);
|
|
103
|
+
if (d.isFailure(s)) return o();
|
|
104
|
+
if (16 + s.success.length + r.length > i.maxBytes) throw new e({
|
|
105
|
+
budget: "geometryPatchBytes",
|
|
106
|
+
limit: i.maxBytes
|
|
107
|
+
});
|
|
108
|
+
let c = new Uint8Array(16 + s.success.length + r.length), l = new DataView(c.buffer);
|
|
109
|
+
return c.set(t.patch), l.setUint32(4, a.schemaHash, !0), l.setUint32(8, s.success.length, !0), l.setUint32(12, r.length, !0), c.set(s.success, 16), c.set(r, 16 + s.success.length), c;
|
|
110
|
+
}, E = (e, t, n, r = {}) => {
|
|
111
|
+
let i = a(r, ["limits", "codecLimits"], []), l = x(i.limits === void 0 ? {} : i.limits), f = c(e), p = c(t);
|
|
112
|
+
if (_(n, 0, 2147483647), !b(f.chunk, p.chunk)) return o();
|
|
113
|
+
let m = i.codecLimits === void 0 ? {} : i.codecLimits, h = s(f.chunk.kind, f.chunk, m), g = s(f.chunk.kind, p.chunk, m), v = u(f.chunk.kind, m), y = v.delta(g, h);
|
|
114
|
+
if (d.isFailure(y)) return o();
|
|
115
|
+
let S = y.success !== null, E = y.success ?? /* @__PURE__ */ new Uint8Array(), D = C({
|
|
116
|
+
kind: f.chunk.kind,
|
|
117
|
+
formatVersion: 1,
|
|
118
|
+
worldId: f.chunk.address.worldId,
|
|
119
|
+
layerSetId: f.chunk.address.layerSetId,
|
|
120
|
+
cx: f.chunk.address.cx,
|
|
121
|
+
cy: f.chunk.address.cy,
|
|
122
|
+
..."cz" in f.chunk.address ? { cz: f.chunk.address.cz } : {},
|
|
123
|
+
version: f.chunk.version,
|
|
124
|
+
baseRevision: n,
|
|
125
|
+
revision: S ? n + 1 : n,
|
|
126
|
+
baseBlobSha256: f.blobSha256,
|
|
127
|
+
blobSha256: p.blobSha256,
|
|
128
|
+
baseContentSha256: f.contentSha256,
|
|
129
|
+
contentSha256: p.contentSha256,
|
|
130
|
+
changed: S,
|
|
131
|
+
stateSchemaHash: v.schemaHash
|
|
132
|
+
}, E.length);
|
|
133
|
+
return w(D, E, T(D, E, l));
|
|
134
|
+
}, D = (r, i = {}) => {
|
|
135
|
+
let a = x(i), s;
|
|
136
|
+
try {
|
|
137
|
+
s = n(r, a.maxBytes, "geometryPatchBytes");
|
|
138
|
+
} catch (t) {
|
|
139
|
+
if (t instanceof e) throw t;
|
|
140
|
+
return o();
|
|
141
|
+
}
|
|
142
|
+
if (s.length < 16 || t.patch.some((e, t) => s[t] !== e)) return o();
|
|
143
|
+
let c = S(a), l = new DataView(s.buffer, s.byteOffset, 16), u = l.getUint32(8, !0), f = l.getUint32(12, !0);
|
|
144
|
+
if (l.getUint32(4, !0) !== c.schemaHash || u < 1 || u > a.maxMetadataBytes || 16 + u + f !== s.length) return o();
|
|
145
|
+
let p = c.decodeFull(s.subarray(16, 16 + u));
|
|
146
|
+
if (d.isFailure(p)) return o();
|
|
147
|
+
let m = C(p.success, f), h = s.slice(16 + u), g = T(m, h, a);
|
|
148
|
+
return g.length !== s.length || g.some((e, t) => e !== s[t]) ? o() : w(m, h, s);
|
|
149
|
+
}, O = async (e, t, n, r = {}) => {
|
|
150
|
+
let i = c(e), a = h.get(t);
|
|
151
|
+
if (!a) return o();
|
|
152
|
+
_(n, 0, 2147483647);
|
|
153
|
+
let f = a.metadata, p = i.chunk.address;
|
|
154
|
+
if (f.kind !== i.chunk.kind || f.version !== i.chunk.version || f.worldId !== p.worldId || f.layerSetId !== p.layerSetId || f.cx !== p.cx || f.cy !== p.cy || f.cz !== ("cz" in p ? p.cz : void 0) || f.baseRevision !== n || f.baseBlobSha256 !== i.blobSha256 || f.baseContentSha256 !== i.contentSha256) return o();
|
|
155
|
+
let m = s(f.kind, i.chunk, r), g = u(f.kind, r);
|
|
156
|
+
if (g.schemaHash !== f.stateSchemaHash) return o();
|
|
157
|
+
if (!f.changed) return Object.freeze({
|
|
158
|
+
artifact: e,
|
|
159
|
+
revision: n
|
|
160
|
+
});
|
|
161
|
+
let v = g.decodeDelta(a.delta, m);
|
|
162
|
+
if (d.isFailure(v)) return o();
|
|
163
|
+
let y = await l(v.success, r), x = g.delta(y.chunk, m);
|
|
164
|
+
return d.isFailure(x) || x.success === null || x.success.length !== a.delta.length || x.success.some((e, t) => e !== a.delta[t]) || !b(i.chunk, y.chunk) || y.blobSha256 !== f.blobSha256 || y.contentSha256 !== f.contentSha256 ? o() : Object.freeze({
|
|
165
|
+
artifact: y,
|
|
166
|
+
revision: f.revision
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
export { p as GeometryPatchMetadataSchema, O as applyGeometryPatch, g as captureGeometryPatch, x as captureGeometryPatchLimits, E as createGeometryPatch, D as decodeGeometryPatch, m as defaultGeometryPatchLimits, S as geometryPatchMetadataCodec };
|