@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,62 @@
|
|
|
1
|
+
import { RoomGeometryReloadRequestSchema as e, RoomGeometryRollbackRequestSchema as t } from "./geometryAdminSchemas.js";
|
|
2
|
+
import { captureRoomGeometryReloadRequest as n, captureRoomGeometryRollbackRequest as r } from "./geometryAdminData.js";
|
|
3
|
+
import { RoomGeometryReloadPort as i, captureRoomGeometryReloadPort as a, roomGeometryReloadLayer as o } from "./geometryReloadPorts.js";
|
|
4
|
+
import { RoomGeometryRollbackPort as s, captureRoomGeometryRollbackPort as c, roomGeometryRollbackLayer as l } from "./geometryRollbackPorts.js";
|
|
5
|
+
import { GEO_JOURNAL_ARCHIVES_TABLE as u, geometryJournalArchivesTable as d } from "./geometryJournalArchiveTable.js";
|
|
6
|
+
import { defaultGeometryMigrateDelta as f } from "./geometryMigrationStrategies.js";
|
|
7
|
+
import { GeometryJournalRetentionWorkflowPayload as p, GeometryJournalRetentionWorkflowResult as m } from "./geometryJournalRetentionSchemas.js";
|
|
8
|
+
import { geometryChunkHttpHeaders as h, geometryChunkHttpQuery as g, geometryChunkHttpResponse as _ } from "./geometryChunkHttp.js";
|
|
9
|
+
import { GEO_MIGRATIONS_TABLE as v, geometryMigrationsTable as y } from "./geometryMigrationJournal.js";
|
|
10
|
+
import { roomsGeometryHttpRoute as b } from "./geometryHttpRoutes.js";
|
|
11
|
+
import { prepareGeometryVersionMigration as x } from "./geometryVersionMigration.js";
|
|
12
|
+
import { makeGeometryJournalPatchReader as S } from "./geometryJournalPatch.js";
|
|
13
|
+
import { GeometryPersistencePort as C, GeometryStaticSourcePort as w, geometryPersistenceLayer as T, geometryStaticSourceLayer as E } from "./geometryPersistencePorts.js";
|
|
14
|
+
import { GEO_CHUNK_DELTAS_TABLE as D, GEO_JOURNAL_TABLE as O, GEO_VERSIONS_TABLE as k, dataStoreGeometryPersistence as A, geometryChunkDeltasTable as j, geometryJournalTable as M, geometryPersistencePrivacyHooks as N, geometryPersistenceTables as P, geometryVersionsTable as F } from "./geometryPersistence.js";
|
|
15
|
+
import { GeometryVersionMigrationPort as I, captureGeometryMigrationReceipt as L, captureGeometryMigrationRequest as R, dataStoreGeometryMigrations as z, geometryMigrationContribution as B, geometryVersionMigrationLayer as V } from "./geometryMigrations.js";
|
|
16
|
+
import { RoomGeometryAdministrationPort as H } from "./geometryAdministrationPorts.js";
|
|
17
|
+
import { GeometryJournalRetentionSweepPort as U, dataStoreGeometryJournalRetentionSweep as W, geometryJournalRetentionSweepLayer as G } from "./geometryJournalRetentionSweep.js";
|
|
18
|
+
import { GeometryJournalArchiveIndexPort as K, dataStoreGeometryJournalArchiveIndex as q, geometryJournalArchiveIndexLayer as J, geometryJournalArchiveIndexPrivacyHooks as Y } from "./geometryJournalArchiveIndex.js";
|
|
19
|
+
import { GeometryAssetManifestPort as X, GeometryAssetReadGrantPort as Z, geometryAssetManifestLayer as Q } from "./geometryAssetPorts.js";
|
|
20
|
+
import { GeometryStaticReadGrantPort as $ } from "./geometryReadPorts.js";
|
|
21
|
+
import { GeometryManifestPort as ee, geometryManifestLayer as te } from "./geometryManifestPorts.js";
|
|
22
|
+
import { captureGeometryStreamManifest as ne } from "./geometryManifestData.js";
|
|
23
|
+
import { makeRoomGeometryResource as re } from "./geometryHost.js";
|
|
24
|
+
import { loadPreparedWorldGeometry as ie } from "./geometryLoader.js";
|
|
25
|
+
import { loadPreparedWorldCellGeometry as ae } from "./geometryCellLoader.js";
|
|
26
|
+
import { dataStoreRoomHostGeometry as oe, recordedGeometryPlacement as se } from "./geometryHostDirectory.js";
|
|
27
|
+
import { dataStoreGeometryManifest as ce } from "./geometryManifest.js";
|
|
28
|
+
import { dataStoreGeometryAdministration as le, roomGeometryAdministrationLayer as ue } from "./geometryAdministration.js";
|
|
29
|
+
import { prepareGeometryChunkSnapshot as de } from "./geometrySnapshotPreparation.js";
|
|
30
|
+
import { makeRoomGeometrySnapshotServer as fe } from "./geometrySnapshotServer.js";
|
|
31
|
+
import { makeGeometryManifestPublication as pe } from "./geometryManifestPublication.js";
|
|
32
|
+
import { makeRoomGeometryStreams as me } from "./geometryHostStreams.js";
|
|
33
|
+
import { makeGeometryCommitCoordinator as he } from "./geometryCommitCoordinator.js";
|
|
34
|
+
import { prepareGeometryPlayerCommit as ge } from "./geometryPlayerEdits.js";
|
|
35
|
+
import { prepareGeometryActivation as _e } from "./geometryActivation.js";
|
|
36
|
+
import { makeGeometryPlayerEditOwner as ve } from "./geometryPlayerEditOwner.js";
|
|
37
|
+
import { makeGeometryReliablePublication as ye } from "./geometryReliablePublication.js";
|
|
38
|
+
import { makeGeometryEditIngress as be } from "./geometryEditIngress.js";
|
|
39
|
+
import { makeRoomGeometryMutations as xe } from "./geometryHostMutations.js";
|
|
40
|
+
import { bindGeometryChunkLeases as Se, makeGeometryChunkLeases as Ce } from "./geometryChunkLeases.js";
|
|
41
|
+
import { makeGeometryRollbackCoordinator as we } from "./geometryRollbackCoordinator.js";
|
|
42
|
+
import { bindRoomGeometryRollbackSource as Te, makeRoomGeometryRollbackSource as Ee } from "./geometryRollbackSource.js";
|
|
43
|
+
import { GeometryRollbackPreparationPort as De, dataStoreGeometryRollbackPreparation as Oe, geometryRollbackPreparationLayer as ke } from "./geometryRollbackStore.js";
|
|
44
|
+
import { worldEntityGeometrySubject as Ae } from "./geometryWorldEntitySubject.js";
|
|
45
|
+
import { RoomGeometryControlPort as je } from "./geometryAdminPorts.js";
|
|
46
|
+
import { storageGeometry as Me } from "./geometryStorage.js";
|
|
47
|
+
import { storageGeometryReadGrants as Ne } from "./geometryStorageGrant.js";
|
|
48
|
+
import { appStorageGeometry as Pe } from "./geometryAppStorage.js";
|
|
49
|
+
import { publishGeometryArtifacts as Fe } from "./geometryPublication.js";
|
|
50
|
+
import { importPngGeometry as Ie } from "./geometryImportPng.js";
|
|
51
|
+
import { prepareGeometryImportPublication as Le } from "./geometryImportPublication.js";
|
|
52
|
+
import { loadImportedGeometryPublication as Re } from "./geometryImportedSource.js";
|
|
53
|
+
import { openGeometryProceduralWorker as ze } from "./geometryProceduralWorker.js";
|
|
54
|
+
import { prepareProceduralGeometryPublication as Be } from "./geometryProceduralPublication.js";
|
|
55
|
+
import { prepareGeometryVersionActivation as Ve } from "./geometryVersionActivation.js";
|
|
56
|
+
import { bindRoomGeometryReloadSource as He, makeRoomGeometryReloadSource as Ue } from "./geometryReloadSource.js";
|
|
57
|
+
import { storageGeometryAssetReadGrants as We } from "./geometryAssetStorageGrant.js";
|
|
58
|
+
import { GeometryJournalArchivePort as Ge, geometryJournalArchiveLayer as Ke, storageGeometryJournal as qe } from "./geometryJournalStorage.js";
|
|
59
|
+
import { GeometryJournalCompactionPort as Je, dataStoreGeometryJournalCompaction as Ye, geometryJournalCompactionLayer as Xe } from "./geometryJournalCompaction.js";
|
|
60
|
+
import { GeometryJournalRetentionPort as Ze, dataStoreGeometryJournalRetention as Qe, defaultGeometryJournalRetentionStrategies as $e, geometryJournalRetentionLayer as et } from "./geometryJournalRetention.js";
|
|
61
|
+
import { geometryJournalRetentionWorkflowExecutor as tt } from "./geometryJournalRetentionWorkflow.js";
|
|
62
|
+
export { D as GEO_CHUNK_DELTAS_TABLE, u as GEO_JOURNAL_ARCHIVES_TABLE, O as GEO_JOURNAL_TABLE, v as GEO_MIGRATIONS_TABLE, k as GEO_VERSIONS_TABLE, X as GeometryAssetManifestPort, Z as GeometryAssetReadGrantPort, K as GeometryJournalArchiveIndexPort, Ge as GeometryJournalArchivePort, Je as GeometryJournalCompactionPort, Ze as GeometryJournalRetentionPort, U as GeometryJournalRetentionSweepPort, p as GeometryJournalRetentionWorkflowPayload, m as GeometryJournalRetentionWorkflowResult, ee as GeometryManifestPort, C as GeometryPersistencePort, De as GeometryRollbackPreparationPort, $ as GeometryStaticReadGrantPort, w as GeometryStaticSourcePort, I as GeometryVersionMigrationPort, H as RoomGeometryAdministrationPort, je as RoomGeometryControlPort, i as RoomGeometryReloadPort, e as RoomGeometryReloadRequestSchema, s as RoomGeometryRollbackPort, t as RoomGeometryRollbackRequestSchema, Pe as appStorageGeometry, Se as bindGeometryChunkLeases, He as bindRoomGeometryReloadSource, Te as bindRoomGeometryRollbackSource, L as captureGeometryMigrationReceipt, R as captureGeometryMigrationRequest, ne as captureGeometryStreamManifest, a as captureRoomGeometryReloadPort, n as captureRoomGeometryReloadRequest, c as captureRoomGeometryRollbackPort, r as captureRoomGeometryRollbackRequest, le as dataStoreGeometryAdministration, q as dataStoreGeometryJournalArchiveIndex, Ye as dataStoreGeometryJournalCompaction, Qe as dataStoreGeometryJournalRetention, W as dataStoreGeometryJournalRetentionSweep, ce as dataStoreGeometryManifest, z as dataStoreGeometryMigrations, A as dataStoreGeometryPersistence, Oe as dataStoreGeometryRollbackPreparation, oe as dataStoreRoomHostGeometry, $e as defaultGeometryJournalRetentionStrategies, f as defaultGeometryMigrateDelta, Q as geometryAssetManifestLayer, j as geometryChunkDeltasTable, h as geometryChunkHttpHeaders, g as geometryChunkHttpQuery, _ as geometryChunkHttpResponse, J as geometryJournalArchiveIndexLayer, Y as geometryJournalArchiveIndexPrivacyHooks, Ke as geometryJournalArchiveLayer, d as geometryJournalArchivesTable, Xe as geometryJournalCompactionLayer, et as geometryJournalRetentionLayer, G as geometryJournalRetentionSweepLayer, tt as geometryJournalRetentionWorkflowExecutor, M as geometryJournalTable, te as geometryManifestLayer, B as geometryMigrationContribution, y as geometryMigrationsTable, T as geometryPersistenceLayer, N as geometryPersistencePrivacyHooks, P as geometryPersistenceTables, ke as geometryRollbackPreparationLayer, E as geometryStaticSourceLayer, V as geometryVersionMigrationLayer, F as geometryVersionsTable, Ie as importPngGeometry, Re as loadImportedGeometryPublication, ae as loadPreparedWorldCellGeometry, ie as loadPreparedWorldGeometry, Ce as makeGeometryChunkLeases, he as makeGeometryCommitCoordinator, be as makeGeometryEditIngress, S as makeGeometryJournalPatchReader, pe as makeGeometryManifestPublication, ve as makeGeometryPlayerEditOwner, ye as makeGeometryReliablePublication, we as makeGeometryRollbackCoordinator, xe as makeRoomGeometryMutations, Ue as makeRoomGeometryReloadSource, re as makeRoomGeometryResource, Ee as makeRoomGeometryRollbackSource, fe as makeRoomGeometrySnapshotServer, me as makeRoomGeometryStreams, ze as openGeometryProceduralWorker, _e as prepareGeometryActivation, de as prepareGeometryChunkSnapshot, Le as prepareGeometryImportPublication, ge as prepareGeometryPlayerCommit, Ve as prepareGeometryVersionActivation, x as prepareGeometryVersionMigration, Be as prepareProceduralGeometryPublication, Fe as publishGeometryArtifacts, se as recordedGeometryPlacement, ue as roomGeometryAdministrationLayer, o as roomGeometryReloadLayer, l as roomGeometryRollbackLayer, b as roomsGeometryHttpRoute, Me as storageGeometry, We as storageGeometryAssetReadGrants, qe as storageGeometryJournal, Ne as storageGeometryReadGrants, Ae as worldEntityGeometrySubject };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { geometryOwnData as n } from "./geometryTileCodec.js";
|
|
3
|
+
import { captureGeometryPreparedInventory as r } from "./geometryPrepared.js";
|
|
4
|
+
import { clipGeometryRayInterval as i, compareGeometryRayTime as a, geometryRayRational as o, geometryRaySphereInterval as s, geometryRayTimeBounds as c } from "./geometryRayAlgebra.js";
|
|
5
|
+
//#region src/geometryShapeRaycast.ts
|
|
6
|
+
function l() {
|
|
7
|
+
throw new t({ detail: "Shape ray requires signed raw endpoints and complete matching prepared collision coverage" });
|
|
8
|
+
}
|
|
9
|
+
var u = (e) => typeof e == "number" && Number.isSafeInteger(e) && e >= -2147483648 && e <= 2147483647 ? e : l(), d = (e, t, n, r, i, s) => {
|
|
10
|
+
let { entry: c, exit: l, entryOpen: u, exitOpen: d } = e;
|
|
11
|
+
for (let e = 0; e < 3; e++) {
|
|
12
|
+
let f = t[e], p = n[e];
|
|
13
|
+
if (!p) {
|
|
14
|
+
if (f < r[e] || f > i[e] || s && f === i[e]) return null;
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
let m = Math.abs(p), h = o(p > 0 ? r[e] - f : f - i[e], m), g = o(p > 0 ? i[e] - f : f - r[e], m), _ = s && p < 0, v = s && p > 0, y = a(h, c), b = a(g, l);
|
|
18
|
+
y > 0 ? (c = h, u = _) : y || (u ||= _), b < 0 ? (l = g, d = v) : b || (d ||= v);
|
|
19
|
+
let x = a(c, l);
|
|
20
|
+
if (x > 0 || !x && (u || d)) return null;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
entry: c,
|
|
24
|
+
exit: l,
|
|
25
|
+
entryOpen: u,
|
|
26
|
+
exitOpen: d
|
|
27
|
+
};
|
|
28
|
+
}, f = (t, f, p, m, h, g) => {
|
|
29
|
+
let _ = r(t), v = [
|
|
30
|
+
"xRaw",
|
|
31
|
+
"yRaw",
|
|
32
|
+
"zRaw"
|
|
33
|
+
], y = n(p, v), b = n(m, v), x = v.map((e) => u(y[e])), S = v.map((e) => u(b[e]));
|
|
34
|
+
if (_.scope.kind !== "3d-shapes" || !Number.isSafeInteger(f) || f < 1 || f > 2147483647 || !Number.isSafeInteger(h) || h < 1 || h > 1048576 || !Number.isSafeInteger(g) || g < 1 || g > 1048576) return l();
|
|
35
|
+
let C = x.map((e, t) => ({
|
|
36
|
+
low: Math.floor(Math.min(e, S[t]) / f),
|
|
37
|
+
high: Math.floor(Math.max(e, S[t]) / f)
|
|
38
|
+
})), w = S.map((e, t) => e - x[t]), T = {
|
|
39
|
+
entry: o(0),
|
|
40
|
+
exit: o(1),
|
|
41
|
+
entryOpen: !1,
|
|
42
|
+
exitOpen: !1
|
|
43
|
+
}, E = 1;
|
|
44
|
+
for (let t of C) {
|
|
45
|
+
let n = t.high - t.low + 1;
|
|
46
|
+
if (n > h || E * n > h) throw new e({
|
|
47
|
+
budget: "geometryRayVisitedCells",
|
|
48
|
+
limit: h
|
|
49
|
+
});
|
|
50
|
+
E *= n;
|
|
51
|
+
}
|
|
52
|
+
let D = 0, O = null;
|
|
53
|
+
for (let t = C[2].low; t <= C[2].high; t++) for (let n = C[1].low; n <= C[1].high; n++) for (let r = C[0].low; r <= C[0].high; r++) {
|
|
54
|
+
let o = _.at({
|
|
55
|
+
cx: r,
|
|
56
|
+
cy: n,
|
|
57
|
+
cz: t
|
|
58
|
+
}), c = o.collision;
|
|
59
|
+
if (c.kind !== "3d-shapes" || c.view.chunk.extentXRaw !== f || c.view.chunk.extentYRaw !== f || c.view.chunk.extentZRaw !== f) return l();
|
|
60
|
+
let u = c.view.chunk.shapes;
|
|
61
|
+
if (u.length > g - D) throw new e({
|
|
62
|
+
budget: "geometryRayShapeTests",
|
|
63
|
+
limit: g
|
|
64
|
+
});
|
|
65
|
+
D += u.length;
|
|
66
|
+
let p = [
|
|
67
|
+
r * f,
|
|
68
|
+
n * f,
|
|
69
|
+
t * f
|
|
70
|
+
], m = p.map((e) => e + f);
|
|
71
|
+
for (let e of u) {
|
|
72
|
+
let t = [
|
|
73
|
+
e.xRaw,
|
|
74
|
+
e.yRaw,
|
|
75
|
+
e.zRaw
|
|
76
|
+
].map((e, t) => e + p[t]), n;
|
|
77
|
+
if (e.kind === "aabb") {
|
|
78
|
+
let r = [
|
|
79
|
+
e.halfXRaw,
|
|
80
|
+
e.halfYRaw,
|
|
81
|
+
e.halfZRaw
|
|
82
|
+
];
|
|
83
|
+
n = d(T, x, w, t.map((e, t) => e - r[t]), t.map((e, t) => e + r[t]), !1);
|
|
84
|
+
} else {
|
|
85
|
+
let r = i(s(x, S, t, e.radiusRaw));
|
|
86
|
+
n = r ? {
|
|
87
|
+
...r,
|
|
88
|
+
entryOpen: !1,
|
|
89
|
+
exitOpen: !1
|
|
90
|
+
} : null;
|
|
91
|
+
}
|
|
92
|
+
n &&= d(n, x, w, p, m, !0), n && (!O || a(n.entry, O.time) < 0) && (O = {
|
|
93
|
+
time: n.entry,
|
|
94
|
+
scope: o.scope,
|
|
95
|
+
revision: o.revision,
|
|
96
|
+
shape: e
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return O ? Object.freeze({
|
|
101
|
+
kind: "3d-shapes",
|
|
102
|
+
scope: O.scope,
|
|
103
|
+
revision: O.revision,
|
|
104
|
+
shape: O.shape,
|
|
105
|
+
fractionBounds: c(O.time),
|
|
106
|
+
visitedChunks: E,
|
|
107
|
+
testedShapes: D
|
|
108
|
+
}) : null;
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
111
|
+
export { f as raycastPreparedGeometryShapes };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { addUint64 as e, compareUint64 as t, multiplyWords as n } from "./fixedWords.js";
|
|
2
|
+
import { clipFixedBoxSlabs as r } from "./fixedSlabs.js";
|
|
3
|
+
import { compareWide as i, product as a, subtract as o } from "./fixedWide.js";
|
|
4
|
+
//#region src/geometryShapeSegments.ts
|
|
5
|
+
var s = {
|
|
6
|
+
hi: 0,
|
|
7
|
+
lo: 0
|
|
8
|
+
}, c = (t) => t.reduce((t, r) => e(t, n(Math.abs(r), Math.abs(r))), s), l = (l, u, d) => {
|
|
9
|
+
let f = [
|
|
10
|
+
l.xRaw,
|
|
11
|
+
l.yRaw,
|
|
12
|
+
l.zRaw
|
|
13
|
+
], p = d.map((e, t) => e - u[t]);
|
|
14
|
+
if (l.kind === "aabb") {
|
|
15
|
+
let e = [
|
|
16
|
+
l.halfXRaw,
|
|
17
|
+
l.halfYRaw,
|
|
18
|
+
l.halfZRaw
|
|
19
|
+
];
|
|
20
|
+
return r(u, u, p, f.map((t, n) => t - e[n]), f.map((t, n) => t + e[n]), !1) !== null;
|
|
21
|
+
}
|
|
22
|
+
let m = u.map((e, t) => e - f[t]), h = n(l.radiusRaw, l.radiusRaw), g = c(m);
|
|
23
|
+
if (t(g, h) <= 0) return !0;
|
|
24
|
+
let _ = s, v = s;
|
|
25
|
+
for (let t = 0; t < 3; t++) {
|
|
26
|
+
let r = m[t], i = p[t], a = n(Math.abs(r), Math.abs(i));
|
|
27
|
+
r < 0 == i < 0 ? _ = e(_, a) : v = e(v, a);
|
|
28
|
+
}
|
|
29
|
+
if (t(v, _) <= 0) return !1;
|
|
30
|
+
let y = o(v, _), b = c(p);
|
|
31
|
+
return t(y, b) >= 0 ? t(c(d.map((e, t) => e - f[t])), h) <= 0 : i(a(b, o(g, h)), a(y, y)) <= 0;
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { l as geometryShapeIntersectsSegment };
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { BudgetExceeded as e } from "./errors.js";
|
|
2
|
+
import { geometryEnvelopeMagic as t } from "./geometryEnvelope.js";
|
|
3
|
+
import { addUint64 as n, compareUint64 as r, multiplyWords as i } from "./fixedWords.js";
|
|
4
|
+
import { captureSimulationBytes as a } from "./simulationBytes.js";
|
|
5
|
+
import { fieldId as o } from "./room.js";
|
|
6
|
+
import { RoomInputCodec as s } from "./stateCodec.js";
|
|
7
|
+
import { geometryOwnData as c, geometryTileRefusal as l } from "./geometryTileCodec.js";
|
|
8
|
+
import { geometryShapeIntersectsSegment as u } from "./geometryShapeSegments.js";
|
|
9
|
+
import { Result as d, Schema as f } from "effect";
|
|
10
|
+
//#region src/geometryShapes.ts
|
|
11
|
+
var p = f.Struct({
|
|
12
|
+
worldId: f.String.pipe(o(1)),
|
|
13
|
+
layerSetId: f.String.pipe(o(2)),
|
|
14
|
+
cx: f.Int.pipe(o(3)),
|
|
15
|
+
cy: f.Int.pipe(o(4)),
|
|
16
|
+
cz: f.Int.pipe(o(5))
|
|
17
|
+
}), m = {
|
|
18
|
+
id: f.String.pipe(o(2)),
|
|
19
|
+
xRaw: f.Int.pipe(o(3)),
|
|
20
|
+
yRaw: f.Int.pipe(o(4)),
|
|
21
|
+
zRaw: f.Int.pipe(o(5))
|
|
22
|
+
}, h = f.Struct({
|
|
23
|
+
kind: f.Literal("aabb").pipe(o(1)),
|
|
24
|
+
...m,
|
|
25
|
+
halfXRaw: f.Int.pipe(o(6)),
|
|
26
|
+
halfYRaw: f.Int.pipe(o(7)),
|
|
27
|
+
halfZRaw: f.Int.pipe(o(8))
|
|
28
|
+
}), g = f.Struct({
|
|
29
|
+
kind: f.Literal("sphere").pipe(o(1)),
|
|
30
|
+
...m,
|
|
31
|
+
radiusRaw: f.Int.pipe(o(6))
|
|
32
|
+
}), _ = f.Union([h, g]), v = f.Struct({
|
|
33
|
+
kind: f.Literal("3d-shapes").pipe(o(1)),
|
|
34
|
+
formatVersion: f.Literal(1).pipe(o(2)),
|
|
35
|
+
address: p.pipe(o(3)),
|
|
36
|
+
version: f.String.pipe(o(4)),
|
|
37
|
+
extentXRaw: f.Int.pipe(o(5)),
|
|
38
|
+
extentYRaw: f.Int.pipe(o(6)),
|
|
39
|
+
extentZRaw: f.Int.pipe(o(7)),
|
|
40
|
+
shapes: f.Array(_).pipe(o(8))
|
|
41
|
+
}), y = Object.freeze({
|
|
42
|
+
maxShapes: 4096,
|
|
43
|
+
maxBytes: 1048576
|
|
44
|
+
}), b = (e, t, n) => typeof e == "number" && Number.isSafeInteger(e) && e >= t && e <= n ? e === 0 ? 0 : e : l(), x = (e) => typeof e == "string" && /^[A-Za-z0-9][A-Za-z0-9._:-]{0,95}$/.test(e) ? e : l(), S = (e) => {
|
|
45
|
+
let t = c(e, [
|
|
46
|
+
"worldId",
|
|
47
|
+
"layerSetId",
|
|
48
|
+
"cx",
|
|
49
|
+
"cy",
|
|
50
|
+
"cz"
|
|
51
|
+
]);
|
|
52
|
+
return Object.freeze({
|
|
53
|
+
worldId: x(t.worldId),
|
|
54
|
+
layerSetId: x(t.layerSetId),
|
|
55
|
+
cx: b(t.cx, -2147483648, 2147483647),
|
|
56
|
+
cy: b(t.cy, -2147483648, 2147483647),
|
|
57
|
+
cz: b(t.cz, -2147483648, 2147483647)
|
|
58
|
+
});
|
|
59
|
+
}, C = [
|
|
60
|
+
"address",
|
|
61
|
+
"version",
|
|
62
|
+
"extentXRaw",
|
|
63
|
+
"extentYRaw",
|
|
64
|
+
"extentZRaw",
|
|
65
|
+
"shapes"
|
|
66
|
+
], w = (n = {}) => {
|
|
67
|
+
let r = c(n, ["maxShapes", "maxBytes"], []), i = Object.freeze({
|
|
68
|
+
maxShapes: Object.hasOwn(r, "maxShapes") ? b(r.maxShapes, 1, 65536) : y.maxShapes,
|
|
69
|
+
maxBytes: Object.hasOwn(r, "maxBytes") ? b(r.maxBytes, 64, 16777216) : y.maxBytes
|
|
70
|
+
}), o = new s(v, {
|
|
71
|
+
maxBytes: i.maxBytes - 12,
|
|
72
|
+
maxCollectionLength: i.maxShapes,
|
|
73
|
+
maxFieldId: 16
|
|
74
|
+
}, "f64"), u = (e, t = !1) => {
|
|
75
|
+
let n = c(e, t ? C : [
|
|
76
|
+
"kind",
|
|
77
|
+
"formatVersion",
|
|
78
|
+
...C
|
|
79
|
+
]);
|
|
80
|
+
if (!t && (n.kind !== "3d-shapes" || n.formatVersion !== 1)) return l();
|
|
81
|
+
let r = b(n.extentXRaw, 1, 2147483647), a = b(n.extentYRaw, 1, 2147483647), o = b(n.extentZRaw, 1, 2147483647), s = n.shapes;
|
|
82
|
+
if (!Array.isArray(s) || s.length > i.maxShapes || Reflect.ownKeys(s).length !== s.length + 1) return l();
|
|
83
|
+
let u = [];
|
|
84
|
+
for (let e = 0; e < s.length; e++) {
|
|
85
|
+
let t = Object.getOwnPropertyDescriptor(s, String(e));
|
|
86
|
+
if (!t?.enumerable || !("value" in t)) return l();
|
|
87
|
+
let n = c(t.value, [
|
|
88
|
+
"kind",
|
|
89
|
+
"id",
|
|
90
|
+
"xRaw",
|
|
91
|
+
"yRaw",
|
|
92
|
+
"zRaw",
|
|
93
|
+
"halfXRaw",
|
|
94
|
+
"halfYRaw",
|
|
95
|
+
"halfZRaw",
|
|
96
|
+
"radiusRaw"
|
|
97
|
+
], [
|
|
98
|
+
"kind",
|
|
99
|
+
"id",
|
|
100
|
+
"xRaw",
|
|
101
|
+
"yRaw",
|
|
102
|
+
"zRaw"
|
|
103
|
+
]), i = n.kind, d = b(n.xRaw, 0, r), f = b(n.yRaw, 0, a), p = b(n.zRaw, 0, o), m = x(n.id);
|
|
104
|
+
if (i === "aabb") {
|
|
105
|
+
if (Reflect.ownKeys(n).length !== 8) return l();
|
|
106
|
+
let e = b(n.halfXRaw, 1, 2147483647), t = b(n.halfYRaw, 1, 2147483647), s = b(n.halfZRaw, 1, 2147483647);
|
|
107
|
+
if (d < e || f < t || p < s || d + e > r || f + t > a || p + s > o) return l();
|
|
108
|
+
u.push(Object.freeze({
|
|
109
|
+
kind: i,
|
|
110
|
+
id: m,
|
|
111
|
+
xRaw: d,
|
|
112
|
+
yRaw: f,
|
|
113
|
+
zRaw: p,
|
|
114
|
+
halfXRaw: e,
|
|
115
|
+
halfYRaw: t,
|
|
116
|
+
halfZRaw: s
|
|
117
|
+
}));
|
|
118
|
+
} else if (i === "sphere") {
|
|
119
|
+
if (Reflect.ownKeys(n).length !== 6) return l();
|
|
120
|
+
let e = b(n.radiusRaw, 1, 2147483647);
|
|
121
|
+
if (d < e || f < e || p < e || d + e > r || f + e > a || p + e > o) return l();
|
|
122
|
+
u.push(Object.freeze({
|
|
123
|
+
kind: i,
|
|
124
|
+
id: m,
|
|
125
|
+
xRaw: d,
|
|
126
|
+
yRaw: f,
|
|
127
|
+
zRaw: p,
|
|
128
|
+
radiusRaw: e
|
|
129
|
+
}));
|
|
130
|
+
} else return l();
|
|
131
|
+
}
|
|
132
|
+
t && u.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id));
|
|
133
|
+
for (let e = 1; e < u.length; e++) if (u[e - 1].id >= u[e].id) return l();
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
kind: "3d-shapes",
|
|
136
|
+
formatVersion: 1,
|
|
137
|
+
address: S(n.address),
|
|
138
|
+
version: x(n.version),
|
|
139
|
+
extentXRaw: r,
|
|
140
|
+
extentYRaw: a,
|
|
141
|
+
extentZRaw: o,
|
|
142
|
+
shapes: Object.freeze(u)
|
|
143
|
+
});
|
|
144
|
+
}, f = (e) => {
|
|
145
|
+
let n = o.full(u(e));
|
|
146
|
+
if (d.isFailure(n)) return l();
|
|
147
|
+
let r = new Uint8Array(12 + n.success.byteLength), i = new DataView(r.buffer);
|
|
148
|
+
return r.set(t["3d-shapes"]), i.setUint32(4, o.schemaHash, !0), i.setUint32(8, n.success.byteLength, !0), r.set(n.success, 12), r;
|
|
149
|
+
};
|
|
150
|
+
return Object.freeze({
|
|
151
|
+
limits: i,
|
|
152
|
+
schemaHash: o.schemaHash,
|
|
153
|
+
capture: (e) => u(e),
|
|
154
|
+
create: (e) => u(e, !0),
|
|
155
|
+
encode: f,
|
|
156
|
+
decode: (n) => {
|
|
157
|
+
let r;
|
|
158
|
+
try {
|
|
159
|
+
r = a(n, i.maxBytes, "geometryShapeBytes");
|
|
160
|
+
} catch (t) {
|
|
161
|
+
if (t instanceof e) throw t;
|
|
162
|
+
return l();
|
|
163
|
+
}
|
|
164
|
+
if (r.length < 12 || t["3d-shapes"].some((e, t) => r[t] !== e)) return l();
|
|
165
|
+
let s = new DataView(r.buffer, r.byteOffset, 12);
|
|
166
|
+
if (s.getUint32(4, !0) !== o.schemaHash || s.getUint32(8, !0) !== r.length - 12) return l();
|
|
167
|
+
let c = o.decodeFull(r.subarray(12));
|
|
168
|
+
if (d.isFailure(c)) return l();
|
|
169
|
+
let p = u(c.success), m = f(p);
|
|
170
|
+
return m.length !== r.length || m.some((e, t) => e !== r[t]) ? l() : p;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}, T = (t, a = {}) => {
|
|
174
|
+
let o = w(a), s = o.capture(t);
|
|
175
|
+
return Object.freeze({
|
|
176
|
+
chunk: s,
|
|
177
|
+
intersectingSegmentRaw: (t, n, r = o.limits.maxShapes) => {
|
|
178
|
+
if (b(r, 1, o.limits.maxShapes), r < s.shapes.length) throw new e({
|
|
179
|
+
budget: "geometryShapeQuery",
|
|
180
|
+
limit: r
|
|
181
|
+
});
|
|
182
|
+
let i = (e) => {
|
|
183
|
+
let t = c(e, [
|
|
184
|
+
"xRaw",
|
|
185
|
+
"yRaw",
|
|
186
|
+
"zRaw"
|
|
187
|
+
]);
|
|
188
|
+
return [
|
|
189
|
+
b(t.xRaw, 0, s.extentXRaw),
|
|
190
|
+
b(t.yRaw, 0, s.extentYRaw),
|
|
191
|
+
b(t.zRaw, 0, s.extentZRaw)
|
|
192
|
+
];
|
|
193
|
+
}, a = i(t), l = i(n);
|
|
194
|
+
return Object.freeze(s.shapes.filter((e) => u(e, a, l)));
|
|
195
|
+
},
|
|
196
|
+
containingRaw: (t, a = o.limits.maxShapes) => {
|
|
197
|
+
if (b(a, 1, o.limits.maxShapes), a < s.shapes.length) throw new e({
|
|
198
|
+
budget: "geometryShapeQuery",
|
|
199
|
+
limit: a
|
|
200
|
+
});
|
|
201
|
+
let l = c(t, [
|
|
202
|
+
"xRaw",
|
|
203
|
+
"yRaw",
|
|
204
|
+
"zRaw"
|
|
205
|
+
]), u = {
|
|
206
|
+
xRaw: b(l.xRaw, 0, s.extentXRaw),
|
|
207
|
+
yRaw: b(l.yRaw, 0, s.extentYRaw),
|
|
208
|
+
zRaw: b(l.zRaw, 0, s.extentZRaw)
|
|
209
|
+
}, d = [];
|
|
210
|
+
for (let e of s.shapes) {
|
|
211
|
+
let t = Math.abs(u.xRaw - e.xRaw), a = Math.abs(u.yRaw - e.yRaw), o = Math.abs(u.zRaw - e.zRaw);
|
|
212
|
+
if (e.kind === "aabb") t <= e.halfXRaw && a <= e.halfYRaw && o <= e.halfZRaw && d.push(e);
|
|
213
|
+
else if (t <= e.radiusRaw && a <= e.radiusRaw && o <= e.radiusRaw) {
|
|
214
|
+
let s = n(n(i(t, t), i(a, a)), i(o, o));
|
|
215
|
+
r(s, i(e.radiusRaw, e.radiusRaw)) <= 0 && d.push(e);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return Object.freeze(d);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
//#endregion
|
|
223
|
+
export { h as GeometryBoxSchema, p as GeometryChunkAddress3DSchema, _ as GeometryShapeSchema, v as GeometryShapesChunkSchema, g as GeometrySphereSchema, w as createGeometryShapesCodec, T as createGeometryShapesView, y as defaultGeometryShapesLimits };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureSimulationBytes as t } from "./simulationBytes.js";
|
|
3
|
+
import { geometryOwnData as n } from "./geometryTileCodec.js";
|
|
4
|
+
import { geometrySha256 as r } from "./geometryDigest.js";
|
|
5
|
+
import { captureGeometryArtifact as i } from "./geometryArtifacts.js";
|
|
6
|
+
import { assertGeometryArtifactScope as a, captureGeometryPersistenceScope as o, geometryPersistenceId as s, geometryPersistenceInteger as c, geometryPersistenceSha as l } from "./geometryPersistenceData.js";
|
|
7
|
+
import { applyGeometryPatch as u, createGeometryPatch as d, decodeGeometryPatch as f } from "./geometryPatch.js";
|
|
8
|
+
//#region src/geometrySnapshot.ts
|
|
9
|
+
var p = () => new e({ detail: "Native geometry recovery snapshot does not match its exact static base and scoped revision" }), m = async (e, t, l, u = 262144, f = {}) => {
|
|
10
|
+
let p = i(t), m = n(l, [
|
|
11
|
+
"scope",
|
|
12
|
+
"revision",
|
|
13
|
+
"artifact"
|
|
14
|
+
]), g = o(m.scope), _ = c(m.revision), v = i(m.artifact), y = c(u, 512, 16777216);
|
|
15
|
+
a(p, g), a(v, g);
|
|
16
|
+
let b = d(p, v, 0, {
|
|
17
|
+
limits: {
|
|
18
|
+
maxBytes: y,
|
|
19
|
+
maxMetadataBytes: Math.min(4096, y - 16)
|
|
20
|
+
},
|
|
21
|
+
codecLimits: f
|
|
22
|
+
}).bytes();
|
|
23
|
+
return h({
|
|
24
|
+
scope: g,
|
|
25
|
+
requestId: s(e),
|
|
26
|
+
revision: _,
|
|
27
|
+
staticBlobSha256: p.blobSha256,
|
|
28
|
+
staticContentSha256: p.contentSha256,
|
|
29
|
+
blobSha256: v.blobSha256,
|
|
30
|
+
contentSha256: v.contentSha256,
|
|
31
|
+
patchSha256: await r(b),
|
|
32
|
+
patch: b
|
|
33
|
+
}, y);
|
|
34
|
+
}, h = (e, r = 262144) => {
|
|
35
|
+
let i = n(e, [
|
|
36
|
+
"scope",
|
|
37
|
+
"requestId",
|
|
38
|
+
"revision",
|
|
39
|
+
"staticBlobSha256",
|
|
40
|
+
"staticContentSha256",
|
|
41
|
+
"blobSha256",
|
|
42
|
+
"contentSha256",
|
|
43
|
+
"patchSha256",
|
|
44
|
+
"patch"
|
|
45
|
+
]), a = c(r, 512, 16777216), u = o(i.scope), d = c(i.revision), m = t(i.patch, a, "geometrySnapshotPatchBytes"), h = f(m, {
|
|
46
|
+
maxBytes: a,
|
|
47
|
+
maxMetadataBytes: Math.min(4096, a - 16)
|
|
48
|
+
}).metadata, g = l(i.staticBlobSha256), _ = l(i.staticContentSha256), v = l(i.blobSha256), y = l(i.contentSha256);
|
|
49
|
+
if (h.kind !== u.kind || h.worldId !== u.worldId || h.layerSetId !== u.layerSetId || h.version !== u.version || h.cx !== u.cx || h.cy !== u.cy || h.cz !== u.cz || h.baseRevision !== 0 || h.revision !== +!!h.changed || h.changed && d === 0 || h.baseBlobSha256 !== g || h.baseContentSha256 !== _ || h.blobSha256 !== v || h.contentSha256 !== y) throw p();
|
|
50
|
+
return Object.freeze({
|
|
51
|
+
scope: u,
|
|
52
|
+
requestId: s(i.requestId),
|
|
53
|
+
revision: d,
|
|
54
|
+
staticBlobSha256: g,
|
|
55
|
+
staticContentSha256: _,
|
|
56
|
+
blobSha256: v,
|
|
57
|
+
contentSha256: y,
|
|
58
|
+
patchSha256: l(i.patchSha256),
|
|
59
|
+
patch: m
|
|
60
|
+
});
|
|
61
|
+
}, g = async (e, t, n = 262144, o = {}) => {
|
|
62
|
+
let s = i(e), c = h(t, n);
|
|
63
|
+
if (a(s, c.scope), s.blobSha256 !== c.staticBlobSha256 || s.contentSha256 !== c.staticContentSha256 || await r(c.patch) !== c.patchSha256) throw p();
|
|
64
|
+
let l = f(c.patch, {
|
|
65
|
+
maxBytes: n,
|
|
66
|
+
maxMetadataBytes: Math.min(4096, n - 16)
|
|
67
|
+
}), d = await u(s, l, 0, o);
|
|
68
|
+
if (d.artifact.blobSha256 !== c.blobSha256 || d.artifact.contentSha256 !== c.contentSha256) throw p();
|
|
69
|
+
return Object.freeze({
|
|
70
|
+
scope: c.scope,
|
|
71
|
+
revision: c.revision,
|
|
72
|
+
artifact: d.artifact
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { g as applyGeometryChunkSnapshot, h as captureGeometryChunkSnapshot, m as createGeometryChunkSnapshot };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { geometryOwnData as n } from "./geometryTileCodec.js";
|
|
3
|
+
import { captureGeometryDense as r, captureGeometryPersistenceScope as i, geometryPersistenceId as a, geometryPersistenceInteger as o, geometryPersistenceSha as s } from "./geometryPersistenceData.js";
|
|
4
|
+
import { captureGeometryPreparedCoordinate as c } from "./geometryPrepared.js";
|
|
5
|
+
import { makeGeometryManifestReceiver as l } from "./geometryManifestChannel.js";
|
|
6
|
+
import { captureGeometryChunkSnapshot as u } from "./geometrySnapshot.js";
|
|
7
|
+
import { Schema as d } from "effect";
|
|
8
|
+
//#region src/geometrySnapshotChannel.ts
|
|
9
|
+
var f = d.Struct({
|
|
10
|
+
cx: d.Int,
|
|
11
|
+
cy: d.Int,
|
|
12
|
+
cz: d.optional(d.Int)
|
|
13
|
+
}), p = d.Struct({
|
|
14
|
+
tenantId: d.String,
|
|
15
|
+
kind: d.Literals([
|
|
16
|
+
"2d-tiles",
|
|
17
|
+
"2d-heightfield",
|
|
18
|
+
"3d-shapes",
|
|
19
|
+
"3d-voxel"
|
|
20
|
+
]),
|
|
21
|
+
worldId: d.String,
|
|
22
|
+
layerSetId: d.String,
|
|
23
|
+
version: d.String,
|
|
24
|
+
cx: d.Int,
|
|
25
|
+
cy: d.Int,
|
|
26
|
+
cz: d.optional(d.Int)
|
|
27
|
+
}), m = d.Struct({
|
|
28
|
+
requestId: d.String,
|
|
29
|
+
coordinate: f
|
|
30
|
+
}), h = Object.freeze({
|
|
31
|
+
schema: m,
|
|
32
|
+
direction: "client",
|
|
33
|
+
reliable: !0
|
|
34
|
+
}), g = d.Struct({
|
|
35
|
+
type: d.Literal("GeoChunkSnapshotFragment"),
|
|
36
|
+
scope: p,
|
|
37
|
+
requestId: d.String,
|
|
38
|
+
revision: d.Int,
|
|
39
|
+
staticBlobSha256: d.String,
|
|
40
|
+
staticContentSha256: d.String,
|
|
41
|
+
blobSha256: d.String,
|
|
42
|
+
contentSha256: d.String,
|
|
43
|
+
patchSha256: d.String,
|
|
44
|
+
totalBytes: d.Int,
|
|
45
|
+
offset: d.Int,
|
|
46
|
+
bytes: d.Array(d.Int)
|
|
47
|
+
}), _ = Object.freeze({
|
|
48
|
+
schema: g,
|
|
49
|
+
direction: "server",
|
|
50
|
+
reliable: !0
|
|
51
|
+
}), v = () => new t({ detail: "Geometry recovery request or fragment escaped its exact native bounded operation" }), y = (e, t) => {
|
|
52
|
+
let r = n(t, ["requestId", "coordinate"]), i = c(e, r.coordinate);
|
|
53
|
+
return Object.freeze({
|
|
54
|
+
requestId: a(r.requestId),
|
|
55
|
+
coordinate: Object.freeze({
|
|
56
|
+
cx: i.cx,
|
|
57
|
+
cy: i.cy,
|
|
58
|
+
...i.cz === void 0 ? {} : { cz: i.cz }
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}, b = (e, t = 262144) => {
|
|
62
|
+
let c = n(e, [
|
|
63
|
+
"type",
|
|
64
|
+
"scope",
|
|
65
|
+
"requestId",
|
|
66
|
+
"revision",
|
|
67
|
+
"staticBlobSha256",
|
|
68
|
+
"staticContentSha256",
|
|
69
|
+
"blobSha256",
|
|
70
|
+
"contentSha256",
|
|
71
|
+
"patchSha256",
|
|
72
|
+
"totalBytes",
|
|
73
|
+
"offset",
|
|
74
|
+
"bytes"
|
|
75
|
+
]), l = o(c.totalBytes, 16, o(t, 512, 16777216)), u = o(c.offset, 0, l - 1), d = r(c.bytes, 8192, (e) => o(e, 0, 255));
|
|
76
|
+
if (c.type !== "GeoChunkSnapshotFragment" || u % 8192 || d.length !== Math.min(8192, l - u)) throw v();
|
|
77
|
+
return Object.freeze({
|
|
78
|
+
type: "GeoChunkSnapshotFragment",
|
|
79
|
+
scope: i(c.scope),
|
|
80
|
+
requestId: a(c.requestId),
|
|
81
|
+
revision: o(c.revision),
|
|
82
|
+
staticBlobSha256: s(c.staticBlobSha256),
|
|
83
|
+
staticContentSha256: s(c.staticContentSha256),
|
|
84
|
+
blobSha256: s(c.blobSha256),
|
|
85
|
+
contentSha256: s(c.contentSha256),
|
|
86
|
+
patchSha256: s(c.patchSha256),
|
|
87
|
+
totalBytes: l,
|
|
88
|
+
offset: u,
|
|
89
|
+
bytes: d
|
|
90
|
+
});
|
|
91
|
+
}, x = (e, t = 262144) => {
|
|
92
|
+
let { patch: n, ...r } = u(e, t), i = [];
|
|
93
|
+
for (let e = 0; e < n.length; e += 8192) i.push(Object.freeze({
|
|
94
|
+
type: "GeoChunkSnapshotFragment",
|
|
95
|
+
...r,
|
|
96
|
+
totalBytes: n.length,
|
|
97
|
+
offset: e,
|
|
98
|
+
bytes: Object.freeze(Array.from(n.subarray(e, e + 8192)))
|
|
99
|
+
}));
|
|
100
|
+
return Object.freeze(i);
|
|
101
|
+
}, S = (t = {}) => {
|
|
102
|
+
let r = n(t, [
|
|
103
|
+
"maxPatchBytes",
|
|
104
|
+
"maxPending",
|
|
105
|
+
"maxPendingBytes"
|
|
106
|
+
], []), s = Object.hasOwn(r, "maxPatchBytes") ? o(r.maxPatchBytes, 512, 16777216) : 262144, c = Object.hasOwn(r, "maxPending") ? o(r.maxPending, 1, 256) : 4, d = Object.hasOwn(r, "maxPendingBytes") ? o(r.maxPendingBytes, 1024, 67108864) : 1048576, f = /* @__PURE__ */ new Map(), p = () => [...f.values()].reduce((e, t) => e + t.receiver.observation().accountedBytes, 0);
|
|
107
|
+
return Object.freeze({
|
|
108
|
+
receive: (t) => {
|
|
109
|
+
let { type: n, totalBytes: r, offset: i, bytes: a, ...o } = b(t, s), m = JSON.stringify([o.scope, o.requestId]), h = JSON.stringify([o, r]), g = f.get(m);
|
|
110
|
+
if (g && g.fingerprint !== h) throw v();
|
|
111
|
+
if (!g) {
|
|
112
|
+
if (f.size >= c) throw new e({
|
|
113
|
+
budget: "geometrySnapshotPendingTransfers",
|
|
114
|
+
limit: c
|
|
115
|
+
});
|
|
116
|
+
if (p() + r + Math.ceil(r / 8192) > d) throw new e({
|
|
117
|
+
budget: "geometrySnapshotPendingBytes",
|
|
118
|
+
limit: d
|
|
119
|
+
});
|
|
120
|
+
g = {
|
|
121
|
+
fingerprint: h,
|
|
122
|
+
header: o,
|
|
123
|
+
receiver: l({
|
|
124
|
+
maxManifestBytes: Math.max(1024, s),
|
|
125
|
+
maxPending: 1,
|
|
126
|
+
maxPendingBytes: d
|
|
127
|
+
})
|
|
128
|
+
}, f.set(m, g);
|
|
129
|
+
}
|
|
130
|
+
let _ = o.scope, y = g.receiver.receive({
|
|
131
|
+
type: "GeoManifestFragment",
|
|
132
|
+
scope: {
|
|
133
|
+
tenantId: _.tenantId,
|
|
134
|
+
kind: _.kind,
|
|
135
|
+
worldId: _.worldId,
|
|
136
|
+
layerSetId: _.layerSetId,
|
|
137
|
+
version: _.version
|
|
138
|
+
},
|
|
139
|
+
payloadSha256: o.patchSha256,
|
|
140
|
+
totalBytes: r,
|
|
141
|
+
offset: i,
|
|
142
|
+
bytes: a
|
|
143
|
+
});
|
|
144
|
+
return y ? (f.delete(m), u({
|
|
145
|
+
...g.header,
|
|
146
|
+
patch: y.bytes
|
|
147
|
+
}, s)) : null;
|
|
148
|
+
},
|
|
149
|
+
drop: (e, t) => f.delete(JSON.stringify([i(e), a(t)])),
|
|
150
|
+
reset: () => {
|
|
151
|
+
f.clear();
|
|
152
|
+
},
|
|
153
|
+
observation: () => Object.freeze({
|
|
154
|
+
pending: f.size,
|
|
155
|
+
accountedBytes: p()
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
//#endregion
|
|
160
|
+
export { m as GeometryChunkRequestSchema, g as GeometryChunkSnapshotFragmentSchema, y as captureGeometryChunkRequest, b as captureGeometryChunkSnapshotFragment, x as createGeometryChunkSnapshotFragments, h as geometryChunkRequestChannel, _ as geometryChunkSnapshotChannel, S as makeGeometrySnapshotReceiver };
|