@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,126 @@
|
|
|
1
|
+
import { RoomAuthoringError as e } from "./errors.js";
|
|
2
|
+
import { interpolateTransform3D as t, normalizeTransform3D as n } from "./transform3d.js";
|
|
3
|
+
// src/transformPrediction3d.ts
|
|
4
|
+
function r(t) {
|
|
5
|
+
throw new e({
|
|
6
|
+
room: "transform-prediction3d",
|
|
7
|
+
detail: t
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
var i = (e) => Number.isFinite(e) ? e : r("Prediction values and clock must be finite"), a = {
|
|
11
|
+
x: 0,
|
|
12
|
+
y: 0,
|
|
13
|
+
z: 0,
|
|
14
|
+
qx: 0,
|
|
15
|
+
qy: 0,
|
|
16
|
+
qz: 0,
|
|
17
|
+
qw: 1
|
|
18
|
+
}, o = (e, t) => n({
|
|
19
|
+
...a,
|
|
20
|
+
qx: e.qw * t.qx + e.qx * t.qw + e.qy * t.qz - e.qz * t.qy,
|
|
21
|
+
qy: e.qw * t.qy - e.qx * t.qz + e.qy * t.qw + e.qz * t.qx,
|
|
22
|
+
qz: e.qw * t.qz + e.qx * t.qy - e.qy * t.qx + e.qz * t.qw,
|
|
23
|
+
qw: e.qw * t.qw - e.qx * t.qx - e.qy * t.qy - e.qz * t.qz
|
|
24
|
+
}), s = class {
|
|
25
|
+
pending = [];
|
|
26
|
+
predicted;
|
|
27
|
+
rules;
|
|
28
|
+
step;
|
|
29
|
+
now;
|
|
30
|
+
capacity;
|
|
31
|
+
threshold;
|
|
32
|
+
blendMs;
|
|
33
|
+
lastTime;
|
|
34
|
+
lastSeq = -1;
|
|
35
|
+
lastAck = -1;
|
|
36
|
+
correctionAt = 0;
|
|
37
|
+
offset = {
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0,
|
|
40
|
+
z: 0
|
|
41
|
+
};
|
|
42
|
+
rotationOffset = a;
|
|
43
|
+
operation = !1;
|
|
44
|
+
constructor(e, t, a, o) {
|
|
45
|
+
this.predicted = n(e), typeof a == "function" && o.clock && typeof o.clock.now == "function" || r("Pure step and render clock are required"), (!Number.isSafeInteger(o.capacity) || o.capacity < 1 || o.capacity > 16384) && r("Prediction capacity must be positive and bounded"), this.capacity = o.capacity, this.threshold = i(o.teleportThreshold), this.blendMs = i(o.correctionBlendMs ?? 80), (this.threshold <= 0 || this.blendMs < 0) && r("Prediction correction budgets must be positive/nonnegative");
|
|
46
|
+
try {
|
|
47
|
+
this.rules = structuredClone(t);
|
|
48
|
+
} catch {
|
|
49
|
+
r("Prediction rules must be detached data");
|
|
50
|
+
}
|
|
51
|
+
this.step = a, this.now = o.clock.now.bind(o.clock), this.lastTime = i(this.now()), this.lastTime < 0 && r("Prediction clock must be nonnegative");
|
|
52
|
+
}
|
|
53
|
+
enter() {
|
|
54
|
+
this.operation && r("Reentrant prediction mutation is refused"), this.operation = !0;
|
|
55
|
+
}
|
|
56
|
+
time() {
|
|
57
|
+
let e = i(this.now());
|
|
58
|
+
return e < this.lastTime && r("Prediction clock must not move backwards"), this.lastTime = e, e;
|
|
59
|
+
}
|
|
60
|
+
at(e) {
|
|
61
|
+
let r = this.blendMs === 0 ? 0 : Math.max(0, 1 - (e - this.correctionAt) / this.blendMs), i = o(t(a, this.rotationOffset, r, 1, "linear"), this.predicted);
|
|
62
|
+
return n({
|
|
63
|
+
...i,
|
|
64
|
+
x: this.predicted.x + this.offset.x * r,
|
|
65
|
+
y: this.predicted.y + this.offset.y * r,
|
|
66
|
+
z: this.predicted.z + this.offset.z * r
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
send(e, t, a) {
|
|
70
|
+
this.enter();
|
|
71
|
+
try {
|
|
72
|
+
this.time(), (!Number.isSafeInteger(e) || e <= this.lastSeq || i(a) <= 0) && r("Prediction sequence must increase and dt must be positive"), this.pending.length === this.capacity && r("Prediction input history is full");
|
|
73
|
+
let o = structuredClone(t), s = n(this.step({ ...this.predicted }, structuredClone(o), a, structuredClone(this.rules)));
|
|
74
|
+
return this.pending = [...this.pending, {
|
|
75
|
+
seq: e,
|
|
76
|
+
input: o,
|
|
77
|
+
dt: a
|
|
78
|
+
}], this.lastSeq = e, this.predicted = s, this.state();
|
|
79
|
+
} finally {
|
|
80
|
+
this.operation = !1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
reconcile(e, t, i = !1) {
|
|
84
|
+
this.enter();
|
|
85
|
+
try {
|
|
86
|
+
let s = this.time(), c = this.at(s), l = this.predicted;
|
|
87
|
+
if ((!Number.isSafeInteger(e) || e < 0 || e > this.lastSeq || typeof i != "boolean") && r("Invalid applied receipt or teleport"), e < this.lastAck) return this.state();
|
|
88
|
+
let u = this.pending.filter((t) => t.seq > e), d = n(t);
|
|
89
|
+
for (let e of u) d = n(this.step({ ...d }, structuredClone(e.input), e.dt, structuredClone(this.rules)));
|
|
90
|
+
let f = Math.abs(l.qx * d.qx + l.qy * d.qy + l.qz * d.qz + l.qw * d.qw), p = l.x === d.x && l.y === d.y && l.z === d.z && Math.abs(1 - f) <= 1e-12;
|
|
91
|
+
if (this.pending = u, this.lastAck = e, this.predicted = d, p && !i) return this.state();
|
|
92
|
+
let m = {
|
|
93
|
+
x: c.x - d.x,
|
|
94
|
+
y: c.y - d.y,
|
|
95
|
+
z: c.z - d.z
|
|
96
|
+
}, h = Math.hypot(l.x - d.x, l.y - d.y, l.z - d.z), g = i || h > this.threshold || this.blendMs === 0 || Object.values(m).some((e) => !Number.isFinite(e));
|
|
97
|
+
return this.offset = g ? {
|
|
98
|
+
x: 0,
|
|
99
|
+
y: 0,
|
|
100
|
+
z: 0
|
|
101
|
+
} : m, this.rotationOffset = g ? a : o(c, {
|
|
102
|
+
...d,
|
|
103
|
+
qx: -d.qx,
|
|
104
|
+
qy: -d.qy,
|
|
105
|
+
qz: -d.qz
|
|
106
|
+
}), this.correctionAt = s, this.state();
|
|
107
|
+
} finally {
|
|
108
|
+
this.operation = !1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
state() {
|
|
112
|
+
return { ...this.predicted };
|
|
113
|
+
}
|
|
114
|
+
render() {
|
|
115
|
+
this.enter();
|
|
116
|
+
try {
|
|
117
|
+
return this.at(this.time());
|
|
118
|
+
} finally {
|
|
119
|
+
this.operation = !1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
queued() {
|
|
123
|
+
return this.pending.length;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
export { s as TransformRenderPrediction3D };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { RoomAuthoringError as e } from "./errors.js";
|
|
2
|
+
import { quantizationStep as t } from "./room.js";
|
|
3
|
+
// src/transformRules.ts
|
|
4
|
+
function n() {
|
|
5
|
+
throw new e({
|
|
6
|
+
room: "transform",
|
|
7
|
+
detail: "Invalid bounded 2D transform rules"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
var r = (e) => typeof e == "object" && !!e && !Array.isArray(e), i = (e) => {
|
|
11
|
+
if (!r(e) || Object.keys(e).some((e) => ![
|
|
12
|
+
"bounds",
|
|
13
|
+
"maxSpeed",
|
|
14
|
+
"maxAccel",
|
|
15
|
+
"precision",
|
|
16
|
+
"rotation",
|
|
17
|
+
"velocity",
|
|
18
|
+
"interpolation",
|
|
19
|
+
"extrapolateMs",
|
|
20
|
+
"teleportThreshold"
|
|
21
|
+
].includes(e)) || !r(e.bounds) || Object.keys(e.bounds).some((e) => !["min", "max"].includes(e)) || !Array.isArray(e.bounds.min) || !Array.isArray(e.bounds.max) || e.bounds.min.length !== 2 || e.bounds.max.length !== 2 || ![
|
|
22
|
+
"linear",
|
|
23
|
+
"hermite",
|
|
24
|
+
"none"
|
|
25
|
+
].includes(e.interpolation)) return n();
|
|
26
|
+
for (let t of [
|
|
27
|
+
e.maxSpeed,
|
|
28
|
+
e.maxAccel,
|
|
29
|
+
e.precision,
|
|
30
|
+
e.teleportThreshold
|
|
31
|
+
]) if (typeof t != "number" || !Number.isFinite(t) || t <= 0) return n();
|
|
32
|
+
if (!Number.isFinite(e.extrapolateMs) || e.extrapolateMs < 0 || e.velocity !== void 0 && ![
|
|
33
|
+
"send",
|
|
34
|
+
"derive",
|
|
35
|
+
"none"
|
|
36
|
+
].includes(e.velocity)) return n();
|
|
37
|
+
e.velocity === "send" && t({
|
|
38
|
+
min: -e.maxSpeed,
|
|
39
|
+
max: e.maxSpeed,
|
|
40
|
+
step: e.maxSpeed * 2 / 255
|
|
41
|
+
});
|
|
42
|
+
for (let r of [0, 1]) {
|
|
43
|
+
let i = e.bounds.min[r], a = e.bounds.max[r];
|
|
44
|
+
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(a - i) || a <= i) return n();
|
|
45
|
+
t({
|
|
46
|
+
min: i,
|
|
47
|
+
max: a,
|
|
48
|
+
step: e.precision
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (e.rotation !== void 0 && (!r(e.rotation) || Object.keys(e.rotation).some((e) => e !== "bits") || !Number.isSafeInteger(e.rotation.bits) || e.rotation.bits < 1 || e.rotation.bits > 32)) return n();
|
|
52
|
+
}, a = (e) => (i(e), Object.freeze({
|
|
53
|
+
bounds: Object.freeze({
|
|
54
|
+
min: Object.freeze([e.bounds.min[0], e.bounds.min[1]]),
|
|
55
|
+
max: Object.freeze([e.bounds.max[0], e.bounds.max[1]])
|
|
56
|
+
}),
|
|
57
|
+
maxSpeed: e.maxSpeed,
|
|
58
|
+
maxAccel: e.maxAccel,
|
|
59
|
+
precision: e.precision,
|
|
60
|
+
rotation: Object.freeze({ bits: e.rotation?.bits ?? 9 }),
|
|
61
|
+
...e.velocity === void 0 ? {} : { velocity: e.velocity },
|
|
62
|
+
interpolation: e.interpolation,
|
|
63
|
+
extrapolateMs: e.extrapolateMs,
|
|
64
|
+
teleportThreshold: e.teleportThreshold
|
|
65
|
+
})), o = (e) => {
|
|
66
|
+
if (!r(e) || Object.keys(e).some((e) => ![
|
|
67
|
+
"bounds",
|
|
68
|
+
"maxSpeed",
|
|
69
|
+
"maxAccel",
|
|
70
|
+
"precision",
|
|
71
|
+
"rotation",
|
|
72
|
+
"interpolation",
|
|
73
|
+
"extrapolateMs",
|
|
74
|
+
"teleportThreshold"
|
|
75
|
+
].includes(e)) || !r(e.bounds) || Object.keys(e.bounds).some((e) => !["min", "max"].includes(e)) || !Array.isArray(e.bounds.min) || !Array.isArray(e.bounds.max) || e.bounds.min.length !== 3 || e.bounds.max.length !== 3 || ![
|
|
76
|
+
"linear",
|
|
77
|
+
"hermite",
|
|
78
|
+
"none"
|
|
79
|
+
].includes(e.interpolation)) return n();
|
|
80
|
+
for (let t of [
|
|
81
|
+
e.maxSpeed,
|
|
82
|
+
e.maxAccel,
|
|
83
|
+
e.precision,
|
|
84
|
+
e.teleportThreshold
|
|
85
|
+
]) if (typeof t != "number" || !Number.isFinite(t) || t <= 0) return n();
|
|
86
|
+
if (!Number.isFinite(e.extrapolateMs) || e.extrapolateMs < 0) return n();
|
|
87
|
+
for (let r of [
|
|
88
|
+
0,
|
|
89
|
+
1,
|
|
90
|
+
2
|
|
91
|
+
]) {
|
|
92
|
+
let i = e.bounds.min[r], a = e.bounds.max[r];
|
|
93
|
+
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(a - i) || a <= i) return n();
|
|
94
|
+
t({
|
|
95
|
+
min: i,
|
|
96
|
+
max: a,
|
|
97
|
+
step: e.precision
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return e.rotation !== void 0 && (!r(e.rotation) || Object.keys(e.rotation).some((e) => e !== "bits") || !Number.isSafeInteger(e.rotation.bits) || e.rotation.bits < 4 || e.rotation.bits > 20) ? n() : Object.freeze({
|
|
101
|
+
bounds: Object.freeze({
|
|
102
|
+
min: Object.freeze([
|
|
103
|
+
e.bounds.min[0],
|
|
104
|
+
e.bounds.min[1],
|
|
105
|
+
e.bounds.min[2]
|
|
106
|
+
]),
|
|
107
|
+
max: Object.freeze([
|
|
108
|
+
e.bounds.max[0],
|
|
109
|
+
e.bounds.max[1],
|
|
110
|
+
e.bounds.max[2]
|
|
111
|
+
])
|
|
112
|
+
}),
|
|
113
|
+
maxSpeed: e.maxSpeed,
|
|
114
|
+
maxAccel: e.maxAccel,
|
|
115
|
+
precision: e.precision,
|
|
116
|
+
rotation: Object.freeze({ bits: e.rotation?.bits ?? 10 }),
|
|
117
|
+
interpolation: e.interpolation,
|
|
118
|
+
extrapolateMs: e.extrapolateMs,
|
|
119
|
+
teleportThreshold: e.teleportThreshold
|
|
120
|
+
});
|
|
121
|
+
}, s = (e) => !r(e) || !r(e.bounds) || !Array.isArray(e.bounds.min) ? n() : e.bounds.min.length === 3 ? o(e) : a(e);
|
|
122
|
+
export { s as captureTransformRules, a as captureTransformRules2D, o as captureTransformRules3D, i as validateTransformRules2D };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { fieldId as e, interpolate as t } from "./room.js";
|
|
2
|
+
import { Schema as n } from "effect";
|
|
3
|
+
// src/transformSchemas.ts
|
|
4
|
+
var r = n.Struct({
|
|
5
|
+
x: n.Number.pipe(e(1)),
|
|
6
|
+
y: n.Number.pipe(e(2)),
|
|
7
|
+
rot: n.Number.pipe(e(3), t("angle")),
|
|
8
|
+
vx: n.optional(n.Number.pipe(e(4))),
|
|
9
|
+
vy: n.optional(n.Number.pipe(e(5)))
|
|
10
|
+
}), i = n.Struct({
|
|
11
|
+
x: n.Number.pipe(e(1)),
|
|
12
|
+
y: n.Number.pipe(e(2)),
|
|
13
|
+
z: n.Number.pipe(e(3)),
|
|
14
|
+
qx: n.Number.pipe(e(4)),
|
|
15
|
+
qy: n.Number.pipe(e(5)),
|
|
16
|
+
qz: n.Number.pipe(e(6)),
|
|
17
|
+
qw: n.Number.pipe(e(7))
|
|
18
|
+
});
|
|
19
|
+
export { r as Transform2D, i as Transform3D };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "./streamFraming.js";
|
|
2
|
+
import "./streamTransport.js";
|
|
3
|
+
// src/transport.ts
|
|
4
|
+
var e = (e) => {
|
|
5
|
+
let t = /* @__PURE__ */ new Set();
|
|
6
|
+
return e.onMessage((n, r) => {
|
|
7
|
+
if (!e.signal.aborted) for (let e of t) e(n, r);
|
|
8
|
+
}), e.signal.addEventListener("abort", () => {
|
|
9
|
+
t.clear();
|
|
10
|
+
}, { once: !0 }), Object.freeze({
|
|
11
|
+
name: "ws",
|
|
12
|
+
signal: e.signal,
|
|
13
|
+
reliable: Object.freeze({
|
|
14
|
+
send: async (t) => {
|
|
15
|
+
await e.sendAsync(t);
|
|
16
|
+
},
|
|
17
|
+
onFrame: (n) => (e.signal.aborted || t.add(n), () => {
|
|
18
|
+
t.delete(n);
|
|
19
|
+
})
|
|
20
|
+
}),
|
|
21
|
+
stats: () => ({
|
|
22
|
+
rttMs: null,
|
|
23
|
+
queuedBytes: e.queuedBytes,
|
|
24
|
+
droppedDatagrams: 0
|
|
25
|
+
}),
|
|
26
|
+
close: (t, n) => {
|
|
27
|
+
e.close(t, n);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export { e as gatewayRoomTransport };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RoomAuthoringError as e } from "./errors.js";
|
|
2
|
+
// src/transportAuthoring.ts
|
|
3
|
+
var t = (t, r, i) => {
|
|
4
|
+
let a = n(t, r, i);
|
|
5
|
+
if (a) return a;
|
|
6
|
+
throw new e({
|
|
7
|
+
room: "transport",
|
|
8
|
+
detail: i
|
|
9
|
+
});
|
|
10
|
+
}, n = (t, n, r) => {
|
|
11
|
+
let i = t, a = 0;
|
|
12
|
+
for (; i !== null && (typeof i == "object" || typeof i == "function") && a++ < 16;) {
|
|
13
|
+
let a = Object.getOwnPropertyDescriptor(i, n);
|
|
14
|
+
if (a) {
|
|
15
|
+
if ("value" in a && typeof a.value == "function") return a.value.bind(t);
|
|
16
|
+
throw new e({
|
|
17
|
+
room: "transport",
|
|
18
|
+
detail: r
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
i = Object.getPrototypeOf(i);
|
|
22
|
+
}
|
|
23
|
+
if (i !== null) throw new e({
|
|
24
|
+
room: "transport",
|
|
25
|
+
detail: r
|
|
26
|
+
});
|
|
27
|
+
}, r = (e) => Object.freeze({ now: t(e, "now", "Room transport clock requires an actual captured data method") });
|
|
28
|
+
export { n as captureOptionalRoomTransportDataMethod, r as captureRoomTransportClock, t as captureRoomTransportDataMethod };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/transportCleanup.ts
|
|
2
|
+
var e = class extends Error {
|
|
3
|
+
cleanup;
|
|
4
|
+
_tag = "RoomTransportCleanupFailure";
|
|
5
|
+
pending;
|
|
6
|
+
complete = !1;
|
|
7
|
+
constructor(e) {
|
|
8
|
+
super("Room transport cleanup remains incomplete"), this.cleanup = e, this.name = "RoomTransportCleanupFailure";
|
|
9
|
+
}
|
|
10
|
+
cleanupAsync() {
|
|
11
|
+
if (this.complete) return Promise.resolve();
|
|
12
|
+
if (this.pending) return this.pending;
|
|
13
|
+
let e = Promise.resolve().then(this.cleanup).then(() => {
|
|
14
|
+
this.complete = !0;
|
|
15
|
+
});
|
|
16
|
+
return this.pending = e, e.catch(() => {
|
|
17
|
+
this.pending === e && (this.pending = void 0);
|
|
18
|
+
}), e;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export { e as RoomTransportCleanupFailure };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { decodeRoomFrame as t, encodeRoomFrame as n } from "./wire.js";
|
|
3
|
+
import { Result as r } from "effect";
|
|
4
|
+
// src/transportConformance.ts
|
|
5
|
+
var i = (t, n) => {
|
|
6
|
+
if (!t) throw new e({ detail: n });
|
|
7
|
+
}, a = (e, t) => e.byteLength === t.byteLength && e.every((e, n) => e === t[n]), o = async (o) => {
|
|
8
|
+
let s = await o(), c = [], l = [], u, d = [];
|
|
9
|
+
try {
|
|
10
|
+
i(Number.isSafeInteger(s.maxQueuedBytes) && s.maxQueuedBytes >= 64 && s.maxQueuedBytes <= 4096 && Number.isSafeInteger(s.maxFrameBytes) && s.maxFrameBytes >= 64, "Transport conformance requires bounded real fixture budgets"), i(s.client.unreliable === void 0 == (s.server.unreliable === void 0), "Transport conformance requires matching actual lane capabilities");
|
|
11
|
+
let e = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)), o = n({
|
|
12
|
+
kind: "Hello",
|
|
13
|
+
protocolVersion: 1,
|
|
14
|
+
token: e,
|
|
15
|
+
schemaHash: 1,
|
|
16
|
+
transportCaps: s.client.unreliable ? 3 : 1
|
|
17
|
+
});
|
|
18
|
+
if (r.isFailure(o)) throw o.failure;
|
|
19
|
+
let f = !1, p = !1;
|
|
20
|
+
c.push(s.server.reliable.onFrame((o) => {
|
|
21
|
+
let c = t(o);
|
|
22
|
+
if (r.isFailure(c) || c.success.kind !== "Hello") return;
|
|
23
|
+
i(a(c.success.token, e), "Transport changed the binary control payload"), f = !0;
|
|
24
|
+
let u = n({
|
|
25
|
+
kind: "Welcome",
|
|
26
|
+
sessionId: "conformance",
|
|
27
|
+
tick: 0,
|
|
28
|
+
epoch: 0,
|
|
29
|
+
serverTimeMs: 0,
|
|
30
|
+
baseline: new Uint8Array([1]),
|
|
31
|
+
transformRules: /* @__PURE__ */ new Uint8Array()
|
|
32
|
+
});
|
|
33
|
+
if (r.isFailure(u)) throw u.failure;
|
|
34
|
+
l.push(s.server.reliable.send(u.success));
|
|
35
|
+
})), c.push(s.client.reliable.onFrame((e) => {
|
|
36
|
+
let n = t(e);
|
|
37
|
+
r.isSuccess(n) && n.success.kind === "Welcome" && (p = !0);
|
|
38
|
+
})), l.push(s.client.reliable.send(o.success)), await s.drive(), await Promise.all(l.splice(0)), await s.drive(), i(f && p, "Transport did not exchange actual binary Hello/Welcome controls"), d.push("binary-control");
|
|
39
|
+
for (let e of c.splice(0)) e();
|
|
40
|
+
let m = [], h = [
|
|
41
|
+
new Uint8Array([1, 2]),
|
|
42
|
+
new Uint8Array([3, 4]),
|
|
43
|
+
new Uint8Array([5, 6])
|
|
44
|
+
];
|
|
45
|
+
c.push(s.server.reliable.onFrame((e) => {
|
|
46
|
+
m.push(e.slice());
|
|
47
|
+
}));
|
|
48
|
+
for (let e of h) l.push(s.client.reliable.send(e));
|
|
49
|
+
await s.drive(), await Promise.all(l.splice(0)), await s.drive(), i(m.length === h.length && m.every((e, t) => a(e, h[t])), "Transport reliable lane lost/reordered/changed actual frames"), d.push("reliable-order");
|
|
50
|
+
for (let e of c.splice(0)) e();
|
|
51
|
+
if (s.client.unreliable && s.server.unreliable) {
|
|
52
|
+
let e = s.client.unreliable, t = [], n = new Uint8Array([7]);
|
|
53
|
+
i(Number.isSafeInteger(e.maxDatagramBytes) && e.maxDatagramBytes >= 1 && e.maxDatagramBytes <= 65535, "Transport returned an invalid datagram budget"), c.push(s.server.unreliable.onFrame((e) => {
|
|
54
|
+
t.push(e.slice());
|
|
55
|
+
})), e.send(n), n[0] = 99, await s.drive(), i(t.some((e) => a(e, new Uint8Array([7]))), "Transport changed the admitted actual datagram");
|
|
56
|
+
let r = !1;
|
|
57
|
+
try {
|
|
58
|
+
e.send(new Uint8Array(e.maxDatagramBytes + 1));
|
|
59
|
+
} catch {
|
|
60
|
+
r = !0;
|
|
61
|
+
}
|
|
62
|
+
i(r, "Transport accepted an oversized datagram"), d.push("datagram-bound");
|
|
63
|
+
for (let e of c.splice(0)) e();
|
|
64
|
+
i(typeof s.pauseDatagrams == "function", "Datagram conformance requires actual held-write pressure"), u = s.pauseDatagrams();
|
|
65
|
+
let o = [], l = s.client.stats().droppedDatagrams;
|
|
66
|
+
c.push(s.server.unreliable.onFrame((e) => {
|
|
67
|
+
o.push(e.slice());
|
|
68
|
+
})), e.send(new Uint8Array([1])), await u.blocked;
|
|
69
|
+
for (let t of [
|
|
70
|
+
2,
|
|
71
|
+
3,
|
|
72
|
+
4
|
|
73
|
+
]) e.send(new Uint8Array([t]));
|
|
74
|
+
await s.drive(), i(s.client.stats().droppedDatagrams - l >= 2, "Datagram pressure did not replace older unsent payloads"), u.resume(), u = void 0, await s.drive(), i(o.some((e) => a(e, new Uint8Array([4]))) && !o.some((e) => a(e, new Uint8Array([2])) || a(e, new Uint8Array([3]))), "Datagram pressure did not preserve latest pending payload"), d.push("datagram-latest");
|
|
75
|
+
for (let e of c.splice(0)) e();
|
|
76
|
+
}
|
|
77
|
+
u = s.pauseReliable();
|
|
78
|
+
let g = new Uint8Array(Math.min(64, s.maxFrameBytes)), _ = [], v = !1, y = s.client.reliable.send(g).then(() => {
|
|
79
|
+
v = !0, _.push("accepted");
|
|
80
|
+
}, () => {
|
|
81
|
+
v = !0, _.push("withdrawn");
|
|
82
|
+
});
|
|
83
|
+
l.push(y), await u.blocked, await s.drive(), i(!v && s.client.stats().queuedBytes >= g.byteLength, "Transport did not expose actual held native pressure"), d.push("native-pressure");
|
|
84
|
+
for (let e = 0; e < 128 && !s.client.signal.aborted; e++) l.push(s.client.reliable.send(g).then(() => {
|
|
85
|
+
_.push("accepted");
|
|
86
|
+
}, () => {
|
|
87
|
+
_.push("withdrawn");
|
|
88
|
+
}));
|
|
89
|
+
await s.drive(), i(s.client.signal.aborted, "Transport did not fence actual reliable queue overflow"), u.resume(), u = void 0, await s.drive(), await Promise.all(l.splice(0)), i(_.includes("withdrawn"), "Transport reported every overflowing/withdrawn write as accepted"), d.push("queue-overflow");
|
|
90
|
+
let b = !1;
|
|
91
|
+
try {
|
|
92
|
+
await s.client.reliable.send(g);
|
|
93
|
+
} catch {
|
|
94
|
+
b = !0;
|
|
95
|
+
}
|
|
96
|
+
return i(b, "Transport accepted a reliable frame after withdrawal"), s.client.close(1e3, "Transport conformance complete"), await s.drive(), i(s.client.signal.aborted, "Transport lost its terminal withdrawal signal"), d.push("withdrawal"), Object.freeze({
|
|
97
|
+
scope: "transport-only",
|
|
98
|
+
datagrams: s.client.unreliable !== void 0,
|
|
99
|
+
checks: Object.freeze(d)
|
|
100
|
+
});
|
|
101
|
+
} finally {
|
|
102
|
+
let t = [];
|
|
103
|
+
try {
|
|
104
|
+
u?.resume();
|
|
105
|
+
} catch (e) {
|
|
106
|
+
t.push(e);
|
|
107
|
+
}
|
|
108
|
+
for (let e of c) try {
|
|
109
|
+
e();
|
|
110
|
+
} catch (e) {
|
|
111
|
+
t.push(e);
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
await s.close();
|
|
115
|
+
} catch (e) {
|
|
116
|
+
t.push(e);
|
|
117
|
+
}
|
|
118
|
+
let n = await Promise.allSettled(l);
|
|
119
|
+
for (let e of n) e.status === "rejected" && t.push(e.reason);
|
|
120
|
+
if (t.length) throw new e({ detail: "Transport conformance owned cleanup remains incomplete" });
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
export { o as roomTransportConformance };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ProtocolError as e, RoomAuthoringError as t } from "./errors.js";
|
|
2
|
+
import { captureRoomTransportClock as n } from "./transportAuthoring.js";
|
|
3
|
+
import { RoomTransportCleanupFailure as r } from "./transportCleanup.js";
|
|
4
|
+
import { captureRoomTransportEndpoints as i } from "./transportEndpoints.js";
|
|
5
|
+
import { openRoomSocketTransport as a } from "./socketTransport.js";
|
|
6
|
+
import { openRoomWebTransport as o } from "./webTransportClient.js";
|
|
7
|
+
// src/transportConnector.ts
|
|
8
|
+
var s = Object.freeze({
|
|
9
|
+
connectTimeoutMs: 5e3,
|
|
10
|
+
maxFrameBytes: 65536,
|
|
11
|
+
maxChunkBytes: 262144,
|
|
12
|
+
maxFramesPerChunk: 64,
|
|
13
|
+
maxQueuedBytes: 1048576,
|
|
14
|
+
maxListeners: 128,
|
|
15
|
+
maxDatagramBytes: 65535
|
|
16
|
+
}), c = (e, n) => {
|
|
17
|
+
if (!e || Object.getPrototypeOf(e) !== Object.prototype || Reflect.ownKeys(e).some((t) => {
|
|
18
|
+
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
19
|
+
return typeof t != "string" || !n.includes(t) || !r?.enumerable || !("value" in r);
|
|
20
|
+
})) throw new t({
|
|
21
|
+
room: "client",
|
|
22
|
+
detail: "Room transport selection requires exact own data options"
|
|
23
|
+
});
|
|
24
|
+
return Object.freeze({ ...e });
|
|
25
|
+
}, l = (l) => {
|
|
26
|
+
let u = c(l, [
|
|
27
|
+
"clock",
|
|
28
|
+
"preference",
|
|
29
|
+
"socket",
|
|
30
|
+
"webTransport"
|
|
31
|
+
]), d = n(u.clock), f = u.preference ?? "auto";
|
|
32
|
+
if (![
|
|
33
|
+
"auto",
|
|
34
|
+
"ws",
|
|
35
|
+
"wt"
|
|
36
|
+
].includes(f)) throw new t({
|
|
37
|
+
room: "client",
|
|
38
|
+
detail: "Room transport preference is invalid"
|
|
39
|
+
});
|
|
40
|
+
let p = u.socket === void 0 ? {} : c(u.socket, [
|
|
41
|
+
"factory",
|
|
42
|
+
"clock",
|
|
43
|
+
"connectTimeoutMs",
|
|
44
|
+
"drainPollMs",
|
|
45
|
+
"maxFrameBytes",
|
|
46
|
+
"maxPendingBytes",
|
|
47
|
+
"maxPendingFrames",
|
|
48
|
+
"highWaterBytes",
|
|
49
|
+
"maxListeners"
|
|
50
|
+
]), m = u.webTransport === void 0 ? {} : c(u.webTransport, [
|
|
51
|
+
"factory",
|
|
52
|
+
"connectTimeoutMs",
|
|
53
|
+
"maxFrameBytes",
|
|
54
|
+
"maxChunkBytes",
|
|
55
|
+
"maxFramesPerChunk",
|
|
56
|
+
"maxQueuedBytes",
|
|
57
|
+
"maxListeners",
|
|
58
|
+
"maxDatagramBytes"
|
|
59
|
+
]), h = Object.freeze({
|
|
60
|
+
...p,
|
|
61
|
+
clock: d
|
|
62
|
+
}), g = Object.freeze({
|
|
63
|
+
...s,
|
|
64
|
+
...m,
|
|
65
|
+
clock: d
|
|
66
|
+
});
|
|
67
|
+
return async (t, n, s) => {
|
|
68
|
+
let c = i(s ?? { ws: t });
|
|
69
|
+
if (c.ws !== i({ ws: t }).ws) throw new e({ detail: "Room reservation and endpoint socket address differ" });
|
|
70
|
+
if (n.aborted) throw new e({ detail: "Room transport selection was cancelled" });
|
|
71
|
+
if (f !== "ws" && c.wt !== void 0) try {
|
|
72
|
+
return await o(c.wt, n, g, c.wtCertificateHash);
|
|
73
|
+
} catch (t) {
|
|
74
|
+
if (f === "wt" || n.aborted || t instanceof r || !(t instanceof e)) throw t;
|
|
75
|
+
}
|
|
76
|
+
else if (f === "wt") throw new e({ detail: "Room reservation did not advertise WebTransport" });
|
|
77
|
+
if (n.aborted) throw new e({ detail: "Room transport selection was cancelled" });
|
|
78
|
+
return a(c.ws, n, h);
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export { l as roomTransportConnector };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
// src/transportEndpoints.ts
|
|
3
|
+
var t = (t, n, i) => {
|
|
4
|
+
if (typeof t != "string" || n != null && typeof n != "string" || i != null && typeof i != "string") throw new e({ detail: "Room host routing data is malformed" });
|
|
5
|
+
return r({
|
|
6
|
+
ws: t,
|
|
7
|
+
...n == null ? {} : { wt: n },
|
|
8
|
+
...i == null ? {} : { wtCertificateHash: i }
|
|
9
|
+
});
|
|
10
|
+
}, n = /^[A-Za-z0-9+/]{43}=$/, r = (t) => {
|
|
11
|
+
if (!t || Object.getPrototypeOf(t) !== Object.prototype || Reflect.ownKeys(t).some((e) => {
|
|
12
|
+
let n = Object.getOwnPropertyDescriptor(t, e);
|
|
13
|
+
return typeof e != "string" || ![
|
|
14
|
+
"ws",
|
|
15
|
+
"wt",
|
|
16
|
+
"wtCertificateHash"
|
|
17
|
+
].includes(e) || !n?.enumerable || !("value" in n);
|
|
18
|
+
})) throw new e({ detail: "Room endpoints require exact own routing data" });
|
|
19
|
+
let r = (t, n) => {
|
|
20
|
+
if (typeof t != "string") throw new e({ detail: "Room endpoint address is missing" });
|
|
21
|
+
let r;
|
|
22
|
+
try {
|
|
23
|
+
r = new URL(t);
|
|
24
|
+
} catch {
|
|
25
|
+
throw new e({ detail: "Room endpoint address is malformed" });
|
|
26
|
+
}
|
|
27
|
+
if (!n.includes(r.protocol) || r.username || r.password || r.search || r.hash) throw new e({ detail: "Room endpoint address requires its declared protocol without credentials, query or fragment" });
|
|
28
|
+
return r.toString();
|
|
29
|
+
}, i = t.wtCertificateHash;
|
|
30
|
+
if (i !== void 0 && (t.wt === void 0 || typeof i != "string" || !n.test(i))) throw new e({ detail: "Room endpoint certificate hash requires a WebTransport address and one base64 SHA-256 digest" });
|
|
31
|
+
return Object.freeze({
|
|
32
|
+
ws: r(t.ws, ["ws:", "wss:"]),
|
|
33
|
+
...t.wt === void 0 ? {} : { wt: r(t.wt, ["https:"]) },
|
|
34
|
+
...i === void 0 ? {} : { wtCertificateHash: i }
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export { r as captureRoomTransportEndpoints, t as roomHostTransportEndpoints };
|