@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
package/dist/testing.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t, RoomAuthoringError as n } from "./errors.js";
|
|
2
|
+
import { compareSimulationConformanceTraces as r, createSimulationConformanceCase as i, decodeSimulationConformanceCase as a, encodeSimulationConformanceCase as o, runSimulationConformanceTrace as s, simulationConformance as ee } from "./simulationConformance.js";
|
|
3
|
+
import { decodeRoomFrame as te, encodeRoomFrame as ne } from "./wire.js";
|
|
4
|
+
import { RoomActor as re } from "./actor.js";
|
|
5
|
+
import { roomTransportConformance as c } from "./transportConformance.js";
|
|
6
|
+
import { fakeWorldTransitionLayer as l, fakeWorldTransitionService as u, worldTransitionFakeLayer as d, worldTransitionPortFixture as f } from "./worldTesting.js";
|
|
7
|
+
import { worldLayerPolicySlotFixture as p, worldOnWorldChangeSlotFixture as m, worldTransitionPolicySlotFixture as h } from "./worldStrategyFixtures.js";
|
|
8
|
+
import { geometryWorldApplyOpSlotFixture as g, geometryWorldOpValidatorSlotFixture as _ } from "./geometryWorldStrategyFixtures.js";
|
|
9
|
+
import { geometryCollisionDeriveSlotFixture as v, geometryNavDeriveSlotFixture as y } from "./geometryDerivationFixtures.js";
|
|
10
|
+
import { geometryCompactionSlotFixture as b } from "./geometryCompactionFixture.js";
|
|
11
|
+
import { fakeRoomAppCommandLayer as x, fakeRoomAppCommandService as S, fakeRoomCheckpointLayer as C, fakeRoomCheckpointService as w, fakeRoomDirectoryLayer as T, fakeRoomDirectoryService as E, fakeRoomErasureLayer as D, fakeRoomErasureService as O, fakeRoomExternalWorkWithdrawalLayer as k, fakeRoomExternalWorkWithdrawalService as A, fakeRoomHostAdoptionLayer as j, fakeRoomHostAdoptionService as M, fakeRoomHostControlLayer as N, fakeRoomHostControlService as P, fakeRoomHostDrainLayer as F, fakeRoomHostDrainService as I, fakeRoomHostKickLayer as L, fakeRoomHostKickService as R, fakeRoomHostWithdrawalLayer as z, fakeRoomHostWithdrawalService as B, fakeRoomLockstepAdmissionLayer as V, fakeRoomLockstepAdmissionService as H, fakeRoomLockstepJournalLayer as U, fakeRoomLockstepJournalService as W, fakeRoomLockstepTerminalLayer as G, fakeRoomLockstepTerminalService as K, fakeRoomReaperLayer as q, fakeRoomReaperService as J, fakeRoomRecoveryLayer as Y, fakeRoomRecoveryService as X, fakeRoomReplayLayer as ie, fakeRoomReplayService as ae, fakeRoomReserveLayer as oe, fakeRoomReserveService as se, fakeRoomSnapshotBlobLayer as ce, fakeRoomSnapshotBlobService as le, fakeRoomSubjectPrivacyLayer as ue, fakeRoomSubjectPrivacyService as de, fakeWorldClientControlLayer as fe, fakeWorldClientControlService as pe, roomAppCommandFakeLayer as me, roomAppCommandPortFixture as he, roomCheckpointFakeLayer as ge, roomCheckpointPortFixture as _e, roomDirectoryFakeLayer as ve, roomDirectoryPortFixture as ye, roomErasureFakeLayer as be, roomErasurePortFixture as xe, roomExternalWorkWithdrawalFakeLayer as Se, roomExternalWorkWithdrawalPortFixture as Ce, roomHostAdoptionFakeLayer as we, roomHostAdoptionPortFixture as Te, roomHostControlFakeLayer as Ee, roomHostControlPortFixture as De, roomHostDrainFakeLayer as Oe, roomHostDrainPortFixture as ke, roomHostKickFakeLayer as Ae, roomHostKickPortFixture as je, roomHostWithdrawalFakeLayer as Me, roomHostWithdrawalPortFixture as Ne, roomLockstepAdmissionFakeLayer as Pe, roomLockstepAdmissionPortFixture as Fe, roomLockstepJournalFakeLayer as Ie, roomLockstepJournalPortFixture as Le, roomLockstepTerminalFakeLayer as Re, roomLockstepTerminalPortFixture as ze, roomReaperFakeLayer as Be, roomReaperPortFixture as Ve, roomRecoveryFakeLayer as He, roomRecoveryPortFixture as Ue, roomReplayFakeLayer as We, roomReplayPortFixture as Ge, roomReserveFakeLayer as Ke, roomReservePortFixture as qe, roomSnapshotBlobFakeLayer as Je, roomSnapshotBlobPortFixture as Ye, roomSubjectPrivacyFakeLayer as Xe, roomSubjectPrivacyPortFixture as Ze, worldClientControlFakeLayer as Qe, worldClientControlPortFixture as $e } from "./testingPorts.js";
|
|
12
|
+
import { roomBudgetsSlotFixture as et, roomReconnectSlotFixture as tt, roomSelectHostSlotFixture as nt, roomSnapshotBudgetSlotFixture as rt, roomSnapshotSlotFixture as Z, roomSpectatorSlotFixture as it, roomViewSlotFixture as at } from "./strategyFixtures.js";
|
|
13
|
+
import { lockstepDesyncSlotFixture as ot, lockstepHashSlotFixture as st, lockstepInputPredictionSlotFixture as ct, lockstepReconnectSlotFixture as lt, lockstepStallPolicySlotFixture as ut } from "./lockstepStrategyFixtures.js";
|
|
14
|
+
import { Result as Q } from "effect";
|
|
15
|
+
// src/testing.ts
|
|
16
|
+
var $ = (e = 0) => {
|
|
17
|
+
if (!Number.isFinite(e) || e < 0) throw new n({
|
|
18
|
+
room: "clock",
|
|
19
|
+
detail: "Initial time must be finite and nonnegative"
|
|
20
|
+
});
|
|
21
|
+
let t = e;
|
|
22
|
+
return Object.freeze({
|
|
23
|
+
now: () => t,
|
|
24
|
+
advance: (e) => {
|
|
25
|
+
if (!Number.isFinite(e) || e < 0 || !Number.isFinite(t + e)) throw new n({
|
|
26
|
+
room: "clock",
|
|
27
|
+
detail: "Clock advance must be finite and nonnegative"
|
|
28
|
+
});
|
|
29
|
+
t += e;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}, dt = (e, t, n, r) => {
|
|
33
|
+
let i = r.clock ?? $(), a = new re(r.id ?? "test-room", e, t, n, i, r.tenantId);
|
|
34
|
+
return {
|
|
35
|
+
actor: a,
|
|
36
|
+
clock: i,
|
|
37
|
+
step: (e) => (i.advance(e), a.advance())
|
|
38
|
+
};
|
|
39
|
+
}, ft = class {
|
|
40
|
+
options;
|
|
41
|
+
clock = $();
|
|
42
|
+
client;
|
|
43
|
+
server;
|
|
44
|
+
signals = [new AbortController(), new AbortController()];
|
|
45
|
+
listeners = [{
|
|
46
|
+
reliable: /* @__PURE__ */ new Set(),
|
|
47
|
+
unreliable: /* @__PURE__ */ new Set()
|
|
48
|
+
}, {
|
|
49
|
+
reliable: /* @__PURE__ */ new Set(),
|
|
50
|
+
unreliable: /* @__PURE__ */ new Set()
|
|
51
|
+
}];
|
|
52
|
+
deliveries = [];
|
|
53
|
+
queued = [0, 0];
|
|
54
|
+
lastReliableAt = [0, 0];
|
|
55
|
+
dropped = [0, 0];
|
|
56
|
+
maxQueuedBytes;
|
|
57
|
+
maxDatagramBytes;
|
|
58
|
+
maxInFlightDatagrams;
|
|
59
|
+
seed;
|
|
60
|
+
seq = 0;
|
|
61
|
+
constructor(e) {
|
|
62
|
+
this.options = e, this.options = Object.freeze({ ...e });
|
|
63
|
+
for (let [t, r] of Object.entries({
|
|
64
|
+
latencyMs: e.latencyMs,
|
|
65
|
+
jitterMs: e.jitterMs
|
|
66
|
+
})) if (!Number.isFinite(r) || r < 0) throw new n({
|
|
67
|
+
room: "NetSim",
|
|
68
|
+
detail: `${t} must be finite and nonnegative`
|
|
69
|
+
});
|
|
70
|
+
if (!Number.isFinite(e.lossRate) || e.lossRate < 0 || e.lossRate > 1 || !Number.isSafeInteger(e.seed)) throw new n({
|
|
71
|
+
room: "NetSim",
|
|
72
|
+
detail: "lossRate must be between zero and one, seed must be an integer"
|
|
73
|
+
});
|
|
74
|
+
this.seed = e.seed >>> 0, this.maxQueuedBytes = e.maxQueuedBytes ?? 1048576, this.maxDatagramBytes = e.maxDatagramBytes ?? 1200, this.maxInFlightDatagrams = e.maxInFlightDatagrams ?? 64;
|
|
75
|
+
for (let e of [
|
|
76
|
+
this.maxQueuedBytes,
|
|
77
|
+
this.maxDatagramBytes,
|
|
78
|
+
this.maxInFlightDatagrams
|
|
79
|
+
]) if (!Number.isSafeInteger(e) || e < 1) throw new n({
|
|
80
|
+
room: "NetSim",
|
|
81
|
+
detail: "Queue and datagram bounds must be positive integers"
|
|
82
|
+
});
|
|
83
|
+
this.client = this.transport(0), this.server = this.transport(1);
|
|
84
|
+
}
|
|
85
|
+
random() {
|
|
86
|
+
return this.seed = Math.imul(this.seed, 1664525) + 1013904223 >>> 0, this.seed / 4294967296;
|
|
87
|
+
}
|
|
88
|
+
latency() {
|
|
89
|
+
return Math.max(0, this.options.latencyMs + (this.random() * 2 - 1) * this.options.jitterMs);
|
|
90
|
+
}
|
|
91
|
+
transport(n) {
|
|
92
|
+
let r = (e, t) => (this.signals[n].signal.aborted || this.listeners[n][e].add(t), () => {
|
|
93
|
+
this.listeners[n][e].delete(t);
|
|
94
|
+
});
|
|
95
|
+
return Object.freeze({
|
|
96
|
+
name: this.options.datagrams ? "wt" : "ws",
|
|
97
|
+
signal: this.signals[n].signal,
|
|
98
|
+
reliable: Object.freeze({
|
|
99
|
+
send: (r) => new Promise((i, a) => {
|
|
100
|
+
if (this.signals[n].signal.aborted) {
|
|
101
|
+
a(new t({ detail: "Transport is closed" }));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if ((this.queued[n] ?? 0) + r.byteLength > this.maxQueuedBytes) {
|
|
105
|
+
let t = new e({
|
|
106
|
+
budget: "maxQueuedBytes",
|
|
107
|
+
limit: this.maxQueuedBytes
|
|
108
|
+
});
|
|
109
|
+
this.close(t), a(t);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
let o = this.random() < this.options.lossRate ? Math.max(1, this.options.latencyMs * 2) : 0, s = Math.max(this.lastReliableAt[n] ?? 0, this.clock.now() + this.latency() + o);
|
|
113
|
+
this.lastReliableAt[n] = s, this.queued[n] = (this.queued[n] ?? 0) + r.byteLength, this.deliveries.push({
|
|
114
|
+
seq: this.seq++,
|
|
115
|
+
lane: "reliable",
|
|
116
|
+
side: n,
|
|
117
|
+
bytes: r.slice(),
|
|
118
|
+
at: s,
|
|
119
|
+
resolve: i,
|
|
120
|
+
reject: a
|
|
121
|
+
});
|
|
122
|
+
}),
|
|
123
|
+
onFrame: (e) => r("reliable", e)
|
|
124
|
+
}),
|
|
125
|
+
...this.options.datagrams ? { unreliable: Object.freeze({
|
|
126
|
+
maxDatagramBytes: this.maxDatagramBytes,
|
|
127
|
+
send: (r) => {
|
|
128
|
+
if (this.signals[n].signal.aborted) throw new t({ detail: "Transport is closed" });
|
|
129
|
+
if (r.byteLength > this.maxDatagramBytes) throw new e({
|
|
130
|
+
budget: "maxDatagramBytes",
|
|
131
|
+
limit: this.maxDatagramBytes
|
|
132
|
+
});
|
|
133
|
+
if (this.random() < this.options.lossRate) {
|
|
134
|
+
this.dropped[n] = (this.dropped[n] ?? 0) + 1;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
let i = this.deliveries.filter((e) => e.side === n && e.lane === "unreliable");
|
|
138
|
+
if (i.length >= this.maxInFlightDatagrams) {
|
|
139
|
+
let e = i.reduce((e, t) => e.seq < t.seq ? e : t);
|
|
140
|
+
this.deliveries.splice(this.deliveries.indexOf(e), 1), this.dropped[n] = (this.dropped[n] ?? 0) + 1;
|
|
141
|
+
}
|
|
142
|
+
this.deliveries.push({
|
|
143
|
+
seq: this.seq++,
|
|
144
|
+
lane: "unreliable",
|
|
145
|
+
side: n,
|
|
146
|
+
bytes: r.slice(),
|
|
147
|
+
at: this.clock.now() + this.latency()
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
onFrame: (e) => r("unreliable", e)
|
|
151
|
+
}) } : {},
|
|
152
|
+
stats: () => ({
|
|
153
|
+
rttMs: this.options.latencyMs * 2,
|
|
154
|
+
queuedBytes: this.queued[n] ?? 0,
|
|
155
|
+
droppedDatagrams: this.dropped[n] ?? 0
|
|
156
|
+
}),
|
|
157
|
+
close: (e, n) => {
|
|
158
|
+
this.close(new t({ detail: `Transport closed ${e}: ${n}` }));
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
advance(t) {
|
|
163
|
+
if (!Number.isFinite(t) || t < 0 || !Number.isFinite(this.clock.now() + t)) throw new n({
|
|
164
|
+
room: "NetSim",
|
|
165
|
+
detail: "Clock advance must be finite and nonnegative"
|
|
166
|
+
});
|
|
167
|
+
let r = this.clock.now() + t, i = 0;
|
|
168
|
+
for (;;) {
|
|
169
|
+
this.deliveries.sort((e, t) => e.at - t.at || e.seq - t.seq);
|
|
170
|
+
let t = this.deliveries[0];
|
|
171
|
+
if (!t || t.at > r) break;
|
|
172
|
+
if (++i > 1e5) throw new e({
|
|
173
|
+
budget: "deliveriesPerAdvance",
|
|
174
|
+
limit: 1e5
|
|
175
|
+
});
|
|
176
|
+
this.deliveries.shift(), this.clock.advance(t.at - this.clock.now()), t.lane === "reliable" && (this.queued[t.side] = (this.queued[t.side] ?? 0) - t.bytes.byteLength);
|
|
177
|
+
let n = +(t.side === 0);
|
|
178
|
+
try {
|
|
179
|
+
if (!this.signals[n].signal.aborted) for (let e of this.listeners[n][t.lane]) e(t.bytes.slice(), t.at);
|
|
180
|
+
t.resolve?.();
|
|
181
|
+
} catch (e) {
|
|
182
|
+
throw t.reject?.(e), this.close(e), e;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
this.clock.advance(r - this.clock.now());
|
|
186
|
+
}
|
|
187
|
+
close(e) {
|
|
188
|
+
for (let t of this.signals) t.abort(e);
|
|
189
|
+
for (let t of this.deliveries.splice(0)) t.reject?.(e);
|
|
190
|
+
this.queued[0] = 0, this.queued[1] = 0;
|
|
191
|
+
for (let e of this.listeners) e.reliable.clear(), e.unreliable.clear();
|
|
192
|
+
}
|
|
193
|
+
}, pt = class {
|
|
194
|
+
transport;
|
|
195
|
+
maxRetainedFrames;
|
|
196
|
+
received = [];
|
|
197
|
+
unsubscribe;
|
|
198
|
+
constructor(e, t = 256) {
|
|
199
|
+
if (this.transport = e, this.maxRetainedFrames = t, !Number.isSafeInteger(t) || t < 1) throw new n({
|
|
200
|
+
room: "BotClient",
|
|
201
|
+
detail: "Frame history must be bounded"
|
|
202
|
+
});
|
|
203
|
+
this.unsubscribe = e.reliable.onFrame((n) => {
|
|
204
|
+
let r = te(n);
|
|
205
|
+
Q.isFailure(r) ? e.close(1002, "Invalid server frame") : (this.received.length >= t && this.received.shift(), this.received.push(r.success));
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
async send(e) {
|
|
209
|
+
let t = ne(e);
|
|
210
|
+
if (Q.isFailure(t)) throw t.failure;
|
|
211
|
+
await this.transport.reliable.send(t.success);
|
|
212
|
+
}
|
|
213
|
+
frames() {
|
|
214
|
+
return this.received.splice(0);
|
|
215
|
+
}
|
|
216
|
+
close() {
|
|
217
|
+
this.unsubscribe(), this.transport.close(1e3, "Bot left");
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
export { pt as BotClient, ft as NetSim, r as compareSimulationConformanceTraces, i as createSimulationConformanceCase, dt as createTestRoom, a as decodeSimulationConformanceCase, o as encodeSimulationConformanceCase, x as fakeRoomAppCommandLayer, S as fakeRoomAppCommandService, C as fakeRoomCheckpointLayer, w as fakeRoomCheckpointService, T as fakeRoomDirectoryLayer, E as fakeRoomDirectoryService, D as fakeRoomErasureLayer, O as fakeRoomErasureService, k as fakeRoomExternalWorkWithdrawalLayer, A as fakeRoomExternalWorkWithdrawalService, j as fakeRoomHostAdoptionLayer, M as fakeRoomHostAdoptionService, N as fakeRoomHostControlLayer, P as fakeRoomHostControlService, F as fakeRoomHostDrainLayer, I as fakeRoomHostDrainService, L as fakeRoomHostKickLayer, R as fakeRoomHostKickService, z as fakeRoomHostWithdrawalLayer, B as fakeRoomHostWithdrawalService, V as fakeRoomLockstepAdmissionLayer, H as fakeRoomLockstepAdmissionService, U as fakeRoomLockstepJournalLayer, W as fakeRoomLockstepJournalService, G as fakeRoomLockstepTerminalLayer, K as fakeRoomLockstepTerminalService, q as fakeRoomReaperLayer, J as fakeRoomReaperService, Y as fakeRoomRecoveryLayer, X as fakeRoomRecoveryService, ie as fakeRoomReplayLayer, ae as fakeRoomReplayService, oe as fakeRoomReserveLayer, se as fakeRoomReserveService, ce as fakeRoomSnapshotBlobLayer, le as fakeRoomSnapshotBlobService, ue as fakeRoomSubjectPrivacyLayer, de as fakeRoomSubjectPrivacyService, fe as fakeWorldClientControlLayer, pe as fakeWorldClientControlService, l as fakeWorldTransitionLayer, u as fakeWorldTransitionService, v as geometryCollisionDeriveSlotFixture, b as geometryCompactionSlotFixture, y as geometryNavDeriveSlotFixture, g as geometryWorldApplyOpSlotFixture, _ as geometryWorldOpValidatorSlotFixture, ot as lockstepDesyncSlotFixture, st as lockstepHashSlotFixture, ct as lockstepInputPredictionSlotFixture, lt as lockstepReconnectSlotFixture, ut as lockstepStallPolicySlotFixture, me as roomAppCommandFakeLayer, he as roomAppCommandPortFixture, et as roomBudgetsSlotFixture, ge as roomCheckpointFakeLayer, _e as roomCheckpointPortFixture, ve as roomDirectoryFakeLayer, ye as roomDirectoryPortFixture, be as roomErasureFakeLayer, xe as roomErasurePortFixture, Se as roomExternalWorkWithdrawalFakeLayer, Ce as roomExternalWorkWithdrawalPortFixture, we as roomHostAdoptionFakeLayer, Te as roomHostAdoptionPortFixture, Ee as roomHostControlFakeLayer, De as roomHostControlPortFixture, Oe as roomHostDrainFakeLayer, ke as roomHostDrainPortFixture, Ae as roomHostKickFakeLayer, je as roomHostKickPortFixture, Me as roomHostWithdrawalFakeLayer, Ne as roomHostWithdrawalPortFixture, Pe as roomLockstepAdmissionFakeLayer, Fe as roomLockstepAdmissionPortFixture, Ie as roomLockstepJournalFakeLayer, Le as roomLockstepJournalPortFixture, Re as roomLockstepTerminalFakeLayer, ze as roomLockstepTerminalPortFixture, Be as roomReaperFakeLayer, Ve as roomReaperPortFixture, tt as roomReconnectSlotFixture, He as roomRecoveryFakeLayer, Ue as roomRecoveryPortFixture, We as roomReplayFakeLayer, Ge as roomReplayPortFixture, Ke as roomReserveFakeLayer, qe as roomReservePortFixture, nt as roomSelectHostSlotFixture, Je as roomSnapshotBlobFakeLayer, Ye as roomSnapshotBlobPortFixture, rt as roomSnapshotBudgetSlotFixture, Z as roomSnapshotSlotFixture, it as roomSpectatorSlotFixture, Xe as roomSubjectPrivacyFakeLayer, Ze as roomSubjectPrivacyPortFixture, c as roomTransportConformance, at as roomViewSlotFixture, s as runSimulationConformanceTrace, ee as simulationConformance, $ as virtualClock, Qe as worldClientControlFakeLayer, $e as worldClientControlPortFixture, p as worldLayerPolicySlotFixture, m as worldOnWorldChangeSlotFixture, d as worldTransitionFakeLayer, h as worldTransitionPolicySlotFixture, f as worldTransitionPortFixture };
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { ProtocolError as e, RoomGone as t } from "./errors.js";
|
|
2
|
+
import { RoomReplayPort as n } from "./replayPorts.js";
|
|
3
|
+
import { RoomHostDrainPort as r } from "./hostDrainPorts.js";
|
|
4
|
+
import { RoomLockstepJournalPort as i } from "./lockstepJournalPorts.js";
|
|
5
|
+
import { RoomLockstepAdmissionPort as a } from "./lockstepAdmissionPorts.js";
|
|
6
|
+
import { RoomLockstepTerminalPort as o } from "./lockstepTerminalPorts.js";
|
|
7
|
+
import { RoomAppCommandPort as s, RoomCheckpointPort as c, RoomDirectoryPort as l, RoomErasurePort as u, RoomExternalWorkWithdrawalPort as d, RoomHostAdoptionPort as f, RoomHostControlPort as p, RoomHostKickPort as m, RoomHostWithdrawalPort as h, RoomReaperPort as ee, RoomRecoveryPort as te, RoomReservePort as g, RoomSnapshotBlobPort as ne, RoomSubjectPrivacyPort as _, WorldClientControlPort as v } from "./ports.js";
|
|
8
|
+
import { Effect as y, Layer as b, Result as x } from "effect";
|
|
9
|
+
// src/testingPorts.ts
|
|
10
|
+
var re = (t = {}) => ({
|
|
11
|
+
begin: t.begin ?? (() => y.fail(new e({ detail: "Room planned drain fixture is unconfigured" }))),
|
|
12
|
+
handoff: t.handoff ?? (() => y.fail(new e({ detail: "Room planned drain fixture is unconfigured" })))
|
|
13
|
+
}), ie = (e = {}) => b.sync(r, () => re(e)), S = ie(), ae = {
|
|
14
|
+
kind: "port",
|
|
15
|
+
tag: r,
|
|
16
|
+
fakeLayer: S,
|
|
17
|
+
probe: {
|
|
18
|
+
run: () => r.pipe(y.flatMap((e) => y.all([y.result(e.begin()), y.result(e.handoff({
|
|
19
|
+
mode: "state-sync",
|
|
20
|
+
roomId: "room",
|
|
21
|
+
tenantId: "tenant",
|
|
22
|
+
epoch: 1,
|
|
23
|
+
tick: 1,
|
|
24
|
+
revision: 1
|
|
25
|
+
}))])), y.map((e) => e.map((e) => e._tag === "Failure" ? e.failure._tag : "unexpected-success")), y.provide(S)),
|
|
26
|
+
expected: ["ProtocolError", "ProtocolError"]
|
|
27
|
+
}
|
|
28
|
+
}, oe = (t = {}) => ({ terminate: t.terminate ?? (() => y.fail(new e({ detail: "Room lockstep terminal fixture is unconfigured" }))) }), C = (e = {}) => b.sync(o, () => oe(e)), w = C(), se = {
|
|
29
|
+
kind: "port",
|
|
30
|
+
tag: o,
|
|
31
|
+
fakeLayer: w,
|
|
32
|
+
probe: {
|
|
33
|
+
run: () => o.pipe(y.flatMap((e) => e.terminate({
|
|
34
|
+
roomId: "room",
|
|
35
|
+
tenantId: "tenant",
|
|
36
|
+
epoch: 1,
|
|
37
|
+
disposition: "disposed"
|
|
38
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(w)),
|
|
39
|
+
expected: "ProtocolError"
|
|
40
|
+
}
|
|
41
|
+
}, T = (t = {}) => {
|
|
42
|
+
let n = () => y.fail(new e({ detail: "Room lockstep admission fixture is unconfigured" }));
|
|
43
|
+
return {
|
|
44
|
+
prepare: t.prepare ?? n,
|
|
45
|
+
publish: t.publish ?? n,
|
|
46
|
+
load: t.load ?? n,
|
|
47
|
+
adopt: t.adopt ?? n,
|
|
48
|
+
exportSubject: t.exportSubject ?? n,
|
|
49
|
+
erase: t.erase ?? n
|
|
50
|
+
};
|
|
51
|
+
}, E = (e = {}) => b.sync(a, () => T(e)), D = E(), ce = {
|
|
52
|
+
kind: "port",
|
|
53
|
+
tag: a,
|
|
54
|
+
fakeLayer: D,
|
|
55
|
+
probe: {
|
|
56
|
+
run: () => a.pipe(y.flatMap((e) => e.load({
|
|
57
|
+
roomId: "room",
|
|
58
|
+
tenantId: "tenant",
|
|
59
|
+
epoch: 1
|
|
60
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(D)),
|
|
61
|
+
expected: "ProtocolError"
|
|
62
|
+
}
|
|
63
|
+
}, O = (t = {}) => {
|
|
64
|
+
let n = () => y.fail(new e({ detail: "Room lockstep journal fixture is unconfigured" }));
|
|
65
|
+
return {
|
|
66
|
+
initialize: t.initialize ?? n,
|
|
67
|
+
append: t.append ?? n,
|
|
68
|
+
load: t.load ?? n,
|
|
69
|
+
adopt: t.adopt ?? n,
|
|
70
|
+
exportSubject: t.exportSubject ?? n,
|
|
71
|
+
erase: t.erase ?? n
|
|
72
|
+
};
|
|
73
|
+
}, k = (e = {}) => b.sync(i, () => O(e)), A = k(), le = {
|
|
74
|
+
kind: "port",
|
|
75
|
+
tag: i,
|
|
76
|
+
fakeLayer: A,
|
|
77
|
+
probe: {
|
|
78
|
+
run: () => i.pipe(y.flatMap((e) => e.load({
|
|
79
|
+
roomId: "room",
|
|
80
|
+
tenantId: "tenant",
|
|
81
|
+
epoch: 1
|
|
82
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(A)),
|
|
83
|
+
expected: "ProtocolError"
|
|
84
|
+
}
|
|
85
|
+
}, j = (e = {}) => ({
|
|
86
|
+
reserve: e.reserve ?? (() => y.fail(new t({ roomId: "fixture-unconfigured" }))),
|
|
87
|
+
resume: e.resume ?? (() => y.fail(new t({ roomId: "fixture-unconfigured" }))),
|
|
88
|
+
leave: e.leave ?? (() => y.fail(new t({ roomId: "fixture-unconfigured" }))),
|
|
89
|
+
list: e.list ?? (() => y.fail(new t({ roomId: "fixture-unconfigured" }))),
|
|
90
|
+
...e.prepareMatch === void 0 ? {} : { prepareMatch: e.prepareMatch }
|
|
91
|
+
}), M = (e = {}) => b.sync(g, () => j(e)), N = (t = {}) => ({
|
|
92
|
+
erase: t.erase ?? (() => y.fail(new e({ detail: "Room Subject privacy fixture is unconfigured" }))),
|
|
93
|
+
export: t.export ?? (() => y.fail(new e({ detail: "Room Subject privacy fixture is unconfigured" })))
|
|
94
|
+
}), P = (e = {}) => b.sync(_, () => N(e)), F = P(), ue = {
|
|
95
|
+
kind: "port",
|
|
96
|
+
tag: _,
|
|
97
|
+
fakeLayer: F,
|
|
98
|
+
probe: {
|
|
99
|
+
run: () => _.pipe(y.flatMap((e) => e.erase({
|
|
100
|
+
requestId: "fixture-erasure",
|
|
101
|
+
target: {
|
|
102
|
+
tenantId: "tenant",
|
|
103
|
+
subjectId: "player",
|
|
104
|
+
kind: "guest"
|
|
105
|
+
}
|
|
106
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(F)),
|
|
107
|
+
expected: "ProtocolError"
|
|
108
|
+
}
|
|
109
|
+
}, I = M(), de = {
|
|
110
|
+
kind: "port",
|
|
111
|
+
tag: g,
|
|
112
|
+
fakeLayer: I,
|
|
113
|
+
probe: {
|
|
114
|
+
run: () => y.scoped(g.pipe(y.flatMap((e) => e.list("absent", {
|
|
115
|
+
type: "anonymous",
|
|
116
|
+
id: null,
|
|
117
|
+
tenantId: "fixture"
|
|
118
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(I))),
|
|
119
|
+
expected: "RoomGone"
|
|
120
|
+
}
|
|
121
|
+
}, L = (t = {}) => ({
|
|
122
|
+
observe: t.observe ?? (() => y.fail(new e({ detail: "Room recovery fixture is unconfigured" }))),
|
|
123
|
+
orphan: t.orphan ?? (() => y.fail(new e({ detail: "Room recovery fixture is unconfigured" }))),
|
|
124
|
+
claim: t.claim ?? (() => y.fail(new e({ detail: "Room recovery fixture is unconfigured" })))
|
|
125
|
+
}), R = (e = {}) => b.sync(te, () => L(e)), z = (t = {}) => ({ adopt: t.adopt ?? (() => y.fail(new e({ detail: "Room adoption fixture is unconfigured" }))) }), B = (e = {}) => b.sync(f, () => z(e)), V = (t = {}) => ({
|
|
126
|
+
reserve: t.reserve ?? (() => y.fail(new e({ detail: "Room host control fixture is unconfigured" }))),
|
|
127
|
+
resume: t.resume ?? (() => y.fail(new e({ detail: "Room host control fixture is unconfigured" }))),
|
|
128
|
+
leave: t.leave ?? (() => y.fail(new e({ detail: "Room host control fixture is unconfigured" })))
|
|
129
|
+
}), H = (e = {}) => b.sync(p, () => V(e)), U = (t = {}) => ({ withdraw: t.withdraw ?? (() => y.fail(new e({ detail: "Room withdrawal fixture is unconfigured" }))) }), W = (e = {}) => b.sync(h, () => U(e)), G = W(), K = (t = {}) => ({
|
|
130
|
+
kick: t.kick ?? (() => y.fail(new e({ detail: "Room kick fixture is unconfigured" }))),
|
|
131
|
+
close: t.close ?? (() => y.fail(new e({ detail: "Room close fixture is unconfigured" })))
|
|
132
|
+
}), fe = (e = {}) => b.sync(m, () => K(e)), q = fe(), pe = {
|
|
133
|
+
kind: "port",
|
|
134
|
+
tag: m,
|
|
135
|
+
fakeLayer: q,
|
|
136
|
+
probe: {
|
|
137
|
+
run: () => m.pipe(y.flatMap((e) => e.kick("host", {
|
|
138
|
+
tenantId: "tenant",
|
|
139
|
+
roomId: "room",
|
|
140
|
+
subjectId: "player",
|
|
141
|
+
reason: ""
|
|
142
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(q)),
|
|
143
|
+
expected: "ProtocolError"
|
|
144
|
+
}
|
|
145
|
+
}, me = {
|
|
146
|
+
kind: "port",
|
|
147
|
+
tag: h,
|
|
148
|
+
fakeLayer: G,
|
|
149
|
+
probe: {
|
|
150
|
+
run: () => h.pipe(y.flatMap((e) => e.withdraw("host", {
|
|
151
|
+
roomId: "room",
|
|
152
|
+
tenantId: "tenant",
|
|
153
|
+
priorEpoch: 1,
|
|
154
|
+
withdrawnEpoch: 2
|
|
155
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(G)),
|
|
156
|
+
expected: "ProtocolError"
|
|
157
|
+
}
|
|
158
|
+
}, he = (t = {}) => ({ run: t.run ?? (() => y.fail(new e({ detail: "Room reaper fixture is unconfigured" }))) }), ge = (e = {}) => b.sync(ee, () => he(e)), _e = (t = {}) => ({ erase: t.erase ?? (() => y.fail(new e({ detail: "Room erasure fixture is unconfigured" }))) }), ve = (e = {}) => b.sync(u, () => _e(e)), J = ve(), ye = {
|
|
159
|
+
kind: "port",
|
|
160
|
+
tag: u,
|
|
161
|
+
fakeLayer: J,
|
|
162
|
+
probe: {
|
|
163
|
+
run: () => u.pipe(y.flatMap((e) => e.erase({
|
|
164
|
+
roomId: "room",
|
|
165
|
+
tenantId: "tenant",
|
|
166
|
+
requestId: "fixture-erasure"
|
|
167
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(J)),
|
|
168
|
+
expected: "ProtocolError"
|
|
169
|
+
}
|
|
170
|
+
}, be = (t = {}) => ({ withdraw: t.withdraw ?? (() => y.fail(new e({ detail: "Room external work withdrawal fixture is unconfigured" }))) }), xe = (e = {}) => b.sync(d, () => be(e)), Y = xe(), Se = {
|
|
171
|
+
kind: "port",
|
|
172
|
+
tag: d,
|
|
173
|
+
fakeLayer: Y,
|
|
174
|
+
probe: {
|
|
175
|
+
run: () => d.pipe(y.flatMap((e) => e.withdraw({
|
|
176
|
+
roomId: "room",
|
|
177
|
+
tenantId: "tenant",
|
|
178
|
+
priorEpoch: 1,
|
|
179
|
+
withdrawnEpoch: 2,
|
|
180
|
+
requestId: "fixture-erasure"
|
|
181
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(Y)),
|
|
182
|
+
expected: "ProtocolError"
|
|
183
|
+
}
|
|
184
|
+
}, X = (e, t, n, r = "ProtocolError") => ({
|
|
185
|
+
kind: "port",
|
|
186
|
+
tag: e,
|
|
187
|
+
fakeLayer: t,
|
|
188
|
+
probe: {
|
|
189
|
+
run: () => y.scoped(e.pipe(y.flatMap(n), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide(t))),
|
|
190
|
+
expected: r
|
|
191
|
+
}
|
|
192
|
+
}), Z = () => y.fail(new e({ detail: "Room port fixture is unconfigured" })), Ce = (e = {}) => ({
|
|
193
|
+
publish: e.publish ?? Z,
|
|
194
|
+
load: e.load ?? Z,
|
|
195
|
+
erase: e.erase ?? Z,
|
|
196
|
+
expire: e.expire ?? Z,
|
|
197
|
+
subjectRooms: e.subjectRooms ?? Z,
|
|
198
|
+
eraseSubject: e.eraseSubject ?? Z,
|
|
199
|
+
exportSubject: e.exportSubject ?? Z
|
|
200
|
+
}), we = (e = {}) => b.sync(n, () => Ce(e)), Te = we(), Ee = X(n, Te, (e) => e.load({
|
|
201
|
+
tenantId: "tenant",
|
|
202
|
+
replayId: "replay"
|
|
203
|
+
})), De = (e = {}) => ({
|
|
204
|
+
commit: e.commit ?? Z,
|
|
205
|
+
load: e.load ?? Z,
|
|
206
|
+
pending: e.pending ?? Z,
|
|
207
|
+
acknowledge: e.acknowledge ?? Z
|
|
208
|
+
}), Oe = (e = {}) => b.sync(c, () => De(e)), ke = Oe(), Ae = X(c, ke, (e) => e.load("room", "tenant")), je = (e = {}) => ({
|
|
209
|
+
register: e.register ?? Z,
|
|
210
|
+
heartbeat: e.heartbeat ?? Z,
|
|
211
|
+
setReady: e.setReady ?? Z,
|
|
212
|
+
hosts: e.hosts ?? Z,
|
|
213
|
+
observeOwnership: e.observeOwnership ?? Z,
|
|
214
|
+
selectHost: e.selectHost ?? Z,
|
|
215
|
+
createOwnedRoom: e.createOwnedRoom ?? Z,
|
|
216
|
+
abandonCreation: e.abandonCreation ?? Z,
|
|
217
|
+
unregister: e.unregister ?? Z,
|
|
218
|
+
list: e.list ?? Z,
|
|
219
|
+
setListing: e.setListing ?? Z
|
|
220
|
+
}), Me = (e = {}) => b.sync(l, () => je(e)), Ne = Me(), Pe = X(l, Ne, (e) => e.list("tenant", "room", 1)), Fe = (e = {}) => ({ deliver: e.deliver ?? Z }), Ie = (e = {}) => b.sync(s, () => Fe(e)), Le = Ie(), Re = X(s, Le, (e) => e.deliver({
|
|
221
|
+
roomId: "room",
|
|
222
|
+
tenantId: "tenant",
|
|
223
|
+
requestId: "command",
|
|
224
|
+
command: {
|
|
225
|
+
kind: "run",
|
|
226
|
+
name: "fixture",
|
|
227
|
+
payload: {},
|
|
228
|
+
requestId: "command"
|
|
229
|
+
}
|
|
230
|
+
})), Q = (e = {}) => ({
|
|
231
|
+
recover: e.recover ?? Z,
|
|
232
|
+
write: e.write ?? Z,
|
|
233
|
+
read: e.read ?? Z,
|
|
234
|
+
release: e.release ?? Z
|
|
235
|
+
}), ze = (e = {}) => b.sync(ne, () => Q(e)), Be = ze(), Ve = X(ne, Be, (e) => e.write({
|
|
236
|
+
roomId: "room",
|
|
237
|
+
tenantId: "tenant",
|
|
238
|
+
epoch: 1,
|
|
239
|
+
revision: 1,
|
|
240
|
+
claimId: "snapshot",
|
|
241
|
+
bytes: new Uint8Array([7])
|
|
242
|
+
})), He = R(), Ue = X(te, He, (e) => e.observe("host")), We = B(), Ge = X(f, We, (e) => e.adopt("host", "room", "tenant", 1)), Ke = H(), qe = X(p, Ke, (e) => e.reserve("host", {
|
|
243
|
+
mode: "joinById",
|
|
244
|
+
roomId: "room"
|
|
245
|
+
}, {
|
|
246
|
+
type: "user",
|
|
247
|
+
id: "player",
|
|
248
|
+
tenantId: "tenant"
|
|
249
|
+
})), Je = ge(), Ye = X(ee, Je, (e) => e.run({ hostId: "host" })), Xe = (t = {}) => ({
|
|
250
|
+
pending: t.pending ?? (() => y.fail(new e({ detail: "World pending transition fixture is unconfigured" }))),
|
|
251
|
+
follow: t.follow ?? (() => y.fail(new e({ detail: "World follower Seat fixture is unconfigured" }))),
|
|
252
|
+
reservation: t.reservation ?? (() => y.fail(new e({ detail: "World target Seat fixture is unconfigured" }))),
|
|
253
|
+
prepare: t.prepare ?? (() => y.fail(new e({ detail: "World client control fixture is unconfigured" }))),
|
|
254
|
+
observe: t.observe ?? (() => y.fail(new e({ detail: "World client control fixture is unconfigured" }))),
|
|
255
|
+
commit: t.commit ?? (() => y.fail(new e({ detail: "World client control fixture is unconfigured" }))),
|
|
256
|
+
cancel: t.cancel ?? (() => y.fail(new e({ detail: "World client control fixture is unconfigured" })))
|
|
257
|
+
}), Ze = (e = {}) => b.sync(v, () => Xe(e)), $ = Ze(), Qe = {
|
|
258
|
+
kind: "port",
|
|
259
|
+
tag: v,
|
|
260
|
+
fakeLayer: $,
|
|
261
|
+
probe: {
|
|
262
|
+
run: () => v.pipe(y.flatMap((e) => e.observe("fixture", {
|
|
263
|
+
type: "anonymous",
|
|
264
|
+
id: null,
|
|
265
|
+
tenantId: "fixture"
|
|
266
|
+
})), y.result, y.map((e) => x.isFailure(e) ? e.failure._tag : "unexpected-success"), y.provide($)),
|
|
267
|
+
expected: "ProtocolError"
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
export { Ie as fakeRoomAppCommandLayer, Fe as fakeRoomAppCommandService, Oe as fakeRoomCheckpointLayer, De as fakeRoomCheckpointService, Me as fakeRoomDirectoryLayer, je as fakeRoomDirectoryService, ve as fakeRoomErasureLayer, _e as fakeRoomErasureService, xe as fakeRoomExternalWorkWithdrawalLayer, be as fakeRoomExternalWorkWithdrawalService, B as fakeRoomHostAdoptionLayer, z as fakeRoomHostAdoptionService, H as fakeRoomHostControlLayer, V as fakeRoomHostControlService, ie as fakeRoomHostDrainLayer, re as fakeRoomHostDrainService, fe as fakeRoomHostKickLayer, K as fakeRoomHostKickService, W as fakeRoomHostWithdrawalLayer, U as fakeRoomHostWithdrawalService, E as fakeRoomLockstepAdmissionLayer, T as fakeRoomLockstepAdmissionService, k as fakeRoomLockstepJournalLayer, O as fakeRoomLockstepJournalService, C as fakeRoomLockstepTerminalLayer, oe as fakeRoomLockstepTerminalService, ge as fakeRoomReaperLayer, he as fakeRoomReaperService, R as fakeRoomRecoveryLayer, L as fakeRoomRecoveryService, we as fakeRoomReplayLayer, Ce as fakeRoomReplayService, M as fakeRoomReserveLayer, j as fakeRoomReserveService, ze as fakeRoomSnapshotBlobLayer, Q as fakeRoomSnapshotBlobService, P as fakeRoomSubjectPrivacyLayer, N as fakeRoomSubjectPrivacyService, Ze as fakeWorldClientControlLayer, Xe as fakeWorldClientControlService, Le as roomAppCommandFakeLayer, Re as roomAppCommandPortFixture, ke as roomCheckpointFakeLayer, Ae as roomCheckpointPortFixture, Ne as roomDirectoryFakeLayer, Pe as roomDirectoryPortFixture, J as roomErasureFakeLayer, ye as roomErasurePortFixture, Y as roomExternalWorkWithdrawalFakeLayer, Se as roomExternalWorkWithdrawalPortFixture, We as roomHostAdoptionFakeLayer, Ge as roomHostAdoptionPortFixture, Ke as roomHostControlFakeLayer, qe as roomHostControlPortFixture, S as roomHostDrainFakeLayer, ae as roomHostDrainPortFixture, q as roomHostKickFakeLayer, pe as roomHostKickPortFixture, G as roomHostWithdrawalFakeLayer, me as roomHostWithdrawalPortFixture, D as roomLockstepAdmissionFakeLayer, ce as roomLockstepAdmissionPortFixture, A as roomLockstepJournalFakeLayer, le as roomLockstepJournalPortFixture, w as roomLockstepTerminalFakeLayer, se as roomLockstepTerminalPortFixture, Je as roomReaperFakeLayer, Ye as roomReaperPortFixture, He as roomRecoveryFakeLayer, Ue as roomRecoveryPortFixture, Te as roomReplayFakeLayer, Ee as roomReplayPortFixture, I as roomReserveFakeLayer, de as roomReservePortFixture, Be as roomSnapshotBlobFakeLayer, Ve as roomSnapshotBlobPortFixture, F as roomSubjectPrivacyFakeLayer, ue as roomSubjectPrivacyPortFixture, $ as worldClientControlFakeLayer, Qe as worldClientControlPortFixture };
|