@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/ports.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { roomsSystemContractManifest as e } from "./systemManifest.js";
|
|
2
|
+
import { RoomReplayPort as t } from "./replayPorts.js";
|
|
3
|
+
import { RoomHostDrainPort as n } from "./hostDrainPorts.js";
|
|
4
|
+
import { RoomLockstepJournalPort as r } from "./lockstepJournalPorts.js";
|
|
5
|
+
import { RoomLockstepAdmissionPort as i } from "./lockstepAdmissionPorts.js";
|
|
6
|
+
import { RoomLockstepTerminalPort as a } from "./lockstepTerminalPorts.js";
|
|
7
|
+
import { Context as o } from "effect";
|
|
8
|
+
// src/ports.ts
|
|
9
|
+
var s = class extends o.Service()("@voltro/WorldClientControlPort") {}, c = class extends o.Service()("@voltro/RoomReservePort") {}, l = class extends o.Service()("@voltro/RoomSubjectPrivacyPort") {}, u = class extends o.Service()("@voltro/RoomCheckpointPort") {}, d = class extends o.Service()("@voltro/RoomSnapshotBlobPort") {}, f = class extends o.Service()("@voltro/RoomDirectoryPort") {}, p = class extends o.Service()("@voltro/RoomAppCommandPort") {}, m = class extends o.Service()("@voltro/RoomRecoveryPort") {}, h = class extends o.Service()("@voltro/RoomHostAdoptionPort") {}, g = class extends o.Service()("@voltro/RoomHostControlPort") {}, _ = class extends o.Service()("@voltro/RoomHostWithdrawalPort") {}, v = class extends o.Service()("@voltro/RoomHostKickPort") {}, y = class extends o.Service()("@voltro/RoomExternalWorkWithdrawalPort") {}, b = class extends o.Service()("@voltro/RoomErasurePort") {}, x = class extends o.Service()("@voltro/RoomReaperPort") {};
|
|
10
|
+
export { p as RoomAppCommandPort, u as RoomCheckpointPort, f as RoomDirectoryPort, b as RoomErasurePort, y as RoomExternalWorkWithdrawalPort, h as RoomHostAdoptionPort, g as RoomHostControlPort, n as RoomHostDrainPort, v as RoomHostKickPort, _ as RoomHostWithdrawalPort, i as RoomLockstepAdmissionPort, r as RoomLockstepJournalPort, a as RoomLockstepTerminalPort, x as RoomReaperPort, m as RoomRecoveryPort, t as RoomReplayPort, c as RoomReservePort, d as RoomSnapshotBlobPort, l as RoomSubjectPrivacyPort, s as WorldClientControlPort, e as roomsSystemContractManifest };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ProtocolError as e, RoomAuthoringError as t } from "./errors.js";
|
|
2
|
+
import { Result as n } from "effect";
|
|
3
|
+
// src/quaternion.ts
|
|
4
|
+
var r = [
|
|
5
|
+
"qx",
|
|
6
|
+
"qy",
|
|
7
|
+
"qz",
|
|
8
|
+
"qw"
|
|
9
|
+
], i = (e) => {
|
|
10
|
+
if (!Number.isSafeInteger(e) || e < 4 || e > 20) throw new t({
|
|
11
|
+
room: "quaternion",
|
|
12
|
+
detail: "Smallest-three bits must be between four and twenty"
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, a = (e = 10) => Math.ceil((2 + 3 * i(e)) / 8);
|
|
16
|
+
function o(t) {
|
|
17
|
+
throw new e({ detail: t });
|
|
18
|
+
}
|
|
19
|
+
var s = (t) => {
|
|
20
|
+
try {
|
|
21
|
+
return n.succeed(t());
|
|
22
|
+
} catch (t) {
|
|
23
|
+
return n.fail(t instanceof e ? t : new e({ detail: "Invalid quaternion representation" }));
|
|
24
|
+
}
|
|
25
|
+
}, c = (e, t = 10) => (i(t), s(() => {
|
|
26
|
+
let n = r.map((t) => e[t]);
|
|
27
|
+
n.some((e) => typeof e != "number" || !Number.isFinite(e)) && o("Quaternion components must be finite");
|
|
28
|
+
let i = Math.max(...n.map(Math.abs));
|
|
29
|
+
i === 0 && o("Zero quaternion has no rotation");
|
|
30
|
+
let s = Math.hypot(...n.map((e) => e / i)), c = n.map((e) => e / i / s), l = 0;
|
|
31
|
+
for (let e = 1; e < c.length; e++) Math.abs(c[e]) > Math.abs(c[l]) && (l = e);
|
|
32
|
+
let u = c[l] < 0 ? -1 : 1, d = Math.SQRT1_2, f = 2 ** t - 1, p = BigInt(l), m = 2n;
|
|
33
|
+
for (let e = 0; e < c.length; e++) {
|
|
34
|
+
if (e === l) continue;
|
|
35
|
+
let n = Math.max(0, Math.min(f, Math.round((c[e] * u + d) / (2 * d) * f)));
|
|
36
|
+
p |= BigInt(n) << m, m += BigInt(t);
|
|
37
|
+
}
|
|
38
|
+
let h = new Uint8Array(a(t));
|
|
39
|
+
for (let e = 0; e < h.length; e++) h[e] = Number(p & 255n), p >>= 8n;
|
|
40
|
+
return h;
|
|
41
|
+
})), l = (e, t = 10) => (i(t), s(() => {
|
|
42
|
+
e instanceof Uint8Array && e.length === a(t) || o("Invalid quaternion byte length");
|
|
43
|
+
let n = 0n;
|
|
44
|
+
for (let t = e.length - 1; t >= 0; t--) n = n << 8n | BigInt(e[t]);
|
|
45
|
+
let r = 2 + 3 * t;
|
|
46
|
+
n >> BigInt(r) !== 0n && o("Nonzero quaternion padding");
|
|
47
|
+
let i = Number(n & 3n), s = 2 ** t - 1, c = BigInt(s), l = Math.SQRT1_2;
|
|
48
|
+
n >>= 2n;
|
|
49
|
+
let u = [
|
|
50
|
+
0,
|
|
51
|
+
0,
|
|
52
|
+
0,
|
|
53
|
+
0
|
|
54
|
+
], d = 0;
|
|
55
|
+
for (let e = 0; e < u.length; e++) {
|
|
56
|
+
if (e === i) continue;
|
|
57
|
+
let r = Number(n & c) / s * 2 * l - l;
|
|
58
|
+
n >>= BigInt(t), u[e] = r, d += r * r;
|
|
59
|
+
}
|
|
60
|
+
(!Number.isFinite(d) || d > 1) && o("Quaternion residual is not real");
|
|
61
|
+
let f = Math.sqrt(1 - d), p = 2 * l / s * 2;
|
|
62
|
+
return u.some((e) => Math.abs(e) > f + p) && o("Quaternion omitted component is not dominant"), u[i] = f, {
|
|
63
|
+
qx: u[0],
|
|
64
|
+
qy: u[1],
|
|
65
|
+
qz: u[2],
|
|
66
|
+
qw: u[3]
|
|
67
|
+
};
|
|
68
|
+
}));
|
|
69
|
+
export { l as decodeQuaternionSmallestThree, c as encodeQuaternionSmallestThree, a as quaternionByteLength };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { FunctionComponentElement } from 'react';
|
|
2
|
+
import { ProviderProps } from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { RefObject } from 'react';
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
import { YieldableError } from 'effect/Cause';
|
|
7
|
+
|
|
8
|
+
declare type LockstepAdvance<S> = {
|
|
9
|
+
readonly _tag: 'advanced';
|
|
10
|
+
readonly snapshot: SimulationSnapshot<S>;
|
|
11
|
+
readonly predictedPlayers: ReadonlyArray<number>;
|
|
12
|
+
} | {
|
|
13
|
+
readonly _tag: 'stalled';
|
|
14
|
+
readonly tick: number;
|
|
15
|
+
readonly reason: 'inputs' | 'horizon';
|
|
16
|
+
readonly missingTick: number;
|
|
17
|
+
readonly waitingFor: ReadonlyArray<number>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare interface LockstepClientOptions<I> {
|
|
21
|
+
readonly localPlayerId: number;
|
|
22
|
+
/** Optional actual complete starting matrix; absent waits for server tick1. */
|
|
23
|
+
readonly initialInputs?: ReadonlyArray<SimulationPlayerInput<I>>;
|
|
24
|
+
/** Complete admitted roster when no starting intention matrix is supplied. */
|
|
25
|
+
readonly playerIds?: ReadonlyArray<number>;
|
|
26
|
+
readonly inputDelayTicks?: number;
|
|
27
|
+
readonly rollbackHorizonTicks?: number;
|
|
28
|
+
readonly maxFutureTicks?: number;
|
|
29
|
+
readonly maxPlayers?: number;
|
|
30
|
+
readonly maxRejectionAttempts?: number;
|
|
31
|
+
readonly inputPrediction?: LockstepInputPrediction<I>;
|
|
32
|
+
/** The local player joins a running match: it is not in `playerIds` yet and enters the
|
|
33
|
+
* roster through `join` at the tick the server announces. */
|
|
34
|
+
readonly lateJoin?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare type LockstepInputPrediction<I> = 'repeat-last' | 'none' | ((last: I, context: {
|
|
38
|
+
readonly playerId: number;
|
|
39
|
+
readonly tick: number;
|
|
40
|
+
}) => I);
|
|
41
|
+
|
|
42
|
+
/** PCG-XSH-RR 64/32. Numeric seeds are unsigned 32-bit; word seeds retain 64 bits.
|
|
43
|
+
* Algorithm reference: https://www.pcg-random.org/using-pcg-c-basic.html
|
|
44
|
+
* No global generator, BigInt, native dependency or implicit time/entropy seed. */
|
|
45
|
+
declare class Pcg32 {
|
|
46
|
+
#private;
|
|
47
|
+
constructor(seed: Pcg32Seed, stream?: Pcg32Seed, maxRejectionAttempts?: number);
|
|
48
|
+
get maxRejectionAttempts(): number;
|
|
49
|
+
nextU32(): number;
|
|
50
|
+
/** Rejection removes modulo bias. Exhaustion consumes exactly the bounded
|
|
51
|
+
* draws and fails; it never returns a biased fallback or substitutes entropy. */
|
|
52
|
+
bounded(bound: number): number;
|
|
53
|
+
snapshot(): Pcg32Snapshot;
|
|
54
|
+
restore(offered: Pcg32Snapshot): void;
|
|
55
|
+
clone(): Pcg32;
|
|
56
|
+
/** Exact skip-ahead modulo 2^64; at most 32 iterations for this delta API. */
|
|
57
|
+
advance(delta: number): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare type Pcg32Seed = number | Uint64Words;
|
|
61
|
+
|
|
62
|
+
declare interface Pcg32Snapshot {
|
|
63
|
+
readonly stateHi: number;
|
|
64
|
+
readonly stateLo: number;
|
|
65
|
+
readonly incrementHi: number;
|
|
66
|
+
readonly incrementLo: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare class ProtocolError extends ProtocolError_base {
|
|
70
|
+
get message(): string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare const ProtocolError_base: Schema.Class<ProtocolError, Schema.TaggedStruct<"ProtocolError", {
|
|
74
|
+
readonly detail: Schema.String;
|
|
75
|
+
}>, YieldableError>;
|
|
76
|
+
|
|
77
|
+
declare interface RoomAnimationFramePort {
|
|
78
|
+
request(callback: (localTimeMs: number) => void): number;
|
|
79
|
+
cancel(id: number): void;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare interface RoomChannel {
|
|
83
|
+
readonly schema: Schema.Codec<unknown, unknown>;
|
|
84
|
+
readonly direction: 'both' | 'server' | 'client';
|
|
85
|
+
readonly reliable: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare interface RoomCodecLimits {
|
|
89
|
+
readonly maxBytes: number;
|
|
90
|
+
readonly maxCollectionLength: number;
|
|
91
|
+
readonly maxFieldId: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare interface RoomDatagramLane {
|
|
95
|
+
readonly maxDatagramBytes: number;
|
|
96
|
+
send(frame: Uint8Array): void;
|
|
97
|
+
onFrame(listener: (frame: Uint8Array, receivedAt: number) => void): () => void;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare interface RoomLockstepClientObservation<S> {
|
|
101
|
+
readonly status: RoomLockstepClientSessionStatus;
|
|
102
|
+
readonly sessionId: string | null;
|
|
103
|
+
readonly epoch: number | null;
|
|
104
|
+
readonly localPlayerId: number | null;
|
|
105
|
+
readonly roster: ReadonlyArray<RoomLockstepClientRosterPlayer> | null;
|
|
106
|
+
readonly snapshot: SimulationSnapshot<S> | null;
|
|
107
|
+
readonly metrics: ReturnType<RoomLockstepClientSession<Schema.Codec<unknown, unknown>, Schema.Codec<unknown, unknown>, Schema.Codec<unknown, unknown>>['metrics']>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare type RoomLockstepClientRosterPlayer = RoomLockstepWirePlayer;
|
|
111
|
+
|
|
112
|
+
/** Browser-safe network owner over the current Room codec/transport and actual
|
|
113
|
+
* pure rollback consumer. Reliable host mapping precedes all author initialization.
|
|
114
|
+
* No SQL/Store/secret/timer or client state-submit capability is acquired. */
|
|
115
|
+
declare class RoomLockstepClientSession<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, O extends Schema.Codec<unknown, unknown>> {
|
|
116
|
+
#private;
|
|
117
|
+
constructor(transport: RoomTransport, simulation: Simulation<S, I, O>, manifest: RoomWireManifest<S, I>, offered: RoomLockstepClientSessionOptions<(I)["Type"]>);
|
|
118
|
+
private work;
|
|
119
|
+
private live;
|
|
120
|
+
private current;
|
|
121
|
+
private notify;
|
|
122
|
+
subscribe(listener: () => void): () => void;
|
|
123
|
+
onMessage(channelName: string, listener: (payload: unknown) => void): () => void;
|
|
124
|
+
get status(): RoomLockstepClientSessionStatus;
|
|
125
|
+
get failure(): ProtocolError | null;
|
|
126
|
+
get id(): string | null;
|
|
127
|
+
get epoch(): number | null;
|
|
128
|
+
roster(): ReadonlyArray<RoomLockstepClientRosterPlayer> | null;
|
|
129
|
+
/** Start roster plus joins effective by `tick`, in slot order (the wire matrix order). */
|
|
130
|
+
private rosterAt;
|
|
131
|
+
get localPlayerId(): number | null;
|
|
132
|
+
snapshot(): SimulationSnapshot<S["Type"]> | null;
|
|
133
|
+
/** Stable read identity between actual notifications, suitable for React's
|
|
134
|
+
* external-store contract. Owns no timer or native connection. */
|
|
135
|
+
observation(): RoomLockstepClientObservation<(S)["Type"]>;
|
|
136
|
+
metrics(): Readonly<{
|
|
137
|
+
status: RoomLockstepClientSessionStatus;
|
|
138
|
+
tick: number | null;
|
|
139
|
+
confirmedThroughTick: number | null;
|
|
140
|
+
catchUpTicks: number;
|
|
141
|
+
pendingWrites: number;
|
|
142
|
+
pendingIntent: boolean;
|
|
143
|
+
retainedLocalInputs: number;
|
|
144
|
+
retainedHashClaims: number;
|
|
145
|
+
stalls: number;
|
|
146
|
+
resyncs: number;
|
|
147
|
+
hashFlags: number;
|
|
148
|
+
waitingFor: Uint64Words | null;
|
|
149
|
+
observerErrors: number;
|
|
150
|
+
rollbackReplays: number;
|
|
151
|
+
rollbackSteps: number;
|
|
152
|
+
}>;
|
|
153
|
+
private encode;
|
|
154
|
+
private write;
|
|
155
|
+
start(token: Uint8Array): Promise<void>;
|
|
156
|
+
/** The existing Room message wire is separate from authoritative intentions. */
|
|
157
|
+
message(channelName: string, payload: unknown): Promise<void>;
|
|
158
|
+
private receive;
|
|
159
|
+
private prune;
|
|
160
|
+
advance(): LockstepAdvance<(S)["Type"]>;
|
|
161
|
+
sendIntent(input: (I)["Type"]): Promise<void>;
|
|
162
|
+
private deliverIntent;
|
|
163
|
+
/** A reliable write handed to the transport now, in order; `accepted` when the transport took it. */
|
|
164
|
+
private handOff;
|
|
165
|
+
sendInitialIntents(input?: (I)["Type"]): Promise<void>;
|
|
166
|
+
resendRetainedIntent(): Promise<void>;
|
|
167
|
+
retryIntent(): Promise<void>;
|
|
168
|
+
sendHash(tick: number): Promise<void>;
|
|
169
|
+
private release;
|
|
170
|
+
close(): void;
|
|
171
|
+
closeAsync(): Promise<void>;
|
|
172
|
+
settled(): Promise<void>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare interface RoomLockstepClientSessionOptions<I> extends Omit<LockstepClientOptions<I>, 'playerIds' | 'localPlayerId'> {
|
|
176
|
+
/** Optional expected identity; actual admission always comes from reliable LsStart. */
|
|
177
|
+
readonly localPlayerId?: number;
|
|
178
|
+
readonly roster?: ReadonlyArray<RoomLockstepClientRosterPlayer>;
|
|
179
|
+
readonly redundantInputs?: number;
|
|
180
|
+
readonly hashEvery?: number;
|
|
181
|
+
/** Retains actual immutable claim provenance independently of rollback state. */
|
|
182
|
+
readonly hashHistoryTicks?: number;
|
|
183
|
+
readonly maxPendingWrites?: number | undefined;
|
|
184
|
+
readonly maxFrameBytes?: number;
|
|
185
|
+
/** Work budget for reliable actual input-history bootstrap, not a load claim. */
|
|
186
|
+
readonly maxBootstrapTicks?: number;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare type RoomLockstepClientSessionStatus = 'connecting' | 'waitingStart' | 'joined' | 'stalled' | 'left' | 'kicked' | 'faulted';
|
|
190
|
+
|
|
191
|
+
/** Public opaque simulation identities, never Subjects or Session credentials. */
|
|
192
|
+
declare interface RoomLockstepWirePlayer {
|
|
193
|
+
readonly slot: number;
|
|
194
|
+
readonly playerId: number;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare interface RoomOwnTransformView2D {
|
|
198
|
+
render(): Transform2D;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
declare interface RoomReliableLane {
|
|
202
|
+
send(frame: Uint8Array): Promise<void>;
|
|
203
|
+
onFrame(listener: (frame: Uint8Array, receivedAt: number) => void): () => void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** Plain mutable state; the author receives no store or database capability. */
|
|
207
|
+
declare type RoomState<A> = A extends ReadonlyArray<infer V> ? Array<RoomState<V>> : A extends object ? {
|
|
208
|
+
-readonly [K in keyof A]: RoomState<A[K]>;
|
|
209
|
+
} : A;
|
|
210
|
+
|
|
211
|
+
declare interface RoomTransformFrame2D {
|
|
212
|
+
readonly localTimeMs: number;
|
|
213
|
+
readonly serverTimeMs: number | null;
|
|
214
|
+
readonly entities: ReadonlyArray<{
|
|
215
|
+
readonly id: string;
|
|
216
|
+
readonly sample: RoomTransformSample2D;
|
|
217
|
+
}>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export declare interface RoomTransformFrameHookOptions extends RoomTransformHookOptions {
|
|
221
|
+
readonly view?: RoomTransformView2D;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare interface RoomTransformHookHandle {
|
|
225
|
+
readonly error: unknown;
|
|
226
|
+
/** Drain cleanup work; does not close a borrowed source or hide render errors. */
|
|
227
|
+
settled(): Promise<void>;
|
|
228
|
+
retryCleanup(): Promise<void>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare interface RoomTransformHookOptions {
|
|
232
|
+
readonly frames?: RoomAnimationFramePort;
|
|
233
|
+
readonly maxRetainedLoops?: number;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Supplies a borrowed view; owns neither its subscription nor its connection. */
|
|
237
|
+
export declare const RoomTransformProvider: ({ view, children }: RoomTransformProviderProps) => FunctionComponentElement<ProviderProps<RoomTransformView2D | null>>;
|
|
238
|
+
|
|
239
|
+
export declare interface RoomTransformProviderProps {
|
|
240
|
+
readonly view: RoomTransformView2D;
|
|
241
|
+
readonly children?: ReactNode;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export declare interface RoomTransformRef<T> extends RefObject<T | null> {
|
|
245
|
+
readonly lifecycle: RoomTransformHookHandle;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
declare interface RoomTransformSample2D {
|
|
249
|
+
readonly epoch: number;
|
|
250
|
+
readonly tick: number;
|
|
251
|
+
readonly transform: Transform2D;
|
|
252
|
+
readonly stale: boolean;
|
|
253
|
+
readonly data?: unknown;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
declare interface RoomTransformView2D {
|
|
257
|
+
ids(): ReadonlyArray<string>;
|
|
258
|
+
renderTime(): number | null;
|
|
259
|
+
at(id: string, renderTimeMs: number): RoomTransformSample2D | null;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare interface RoomTransport {
|
|
263
|
+
readonly name: 'ws' | 'wt';
|
|
264
|
+
readonly reliable: RoomReliableLane;
|
|
265
|
+
readonly unreliable?: RoomDatagramLane | undefined;
|
|
266
|
+
readonly signal: AbortSignal;
|
|
267
|
+
stats(): {
|
|
268
|
+
readonly rttMs: number | null;
|
|
269
|
+
readonly queuedBytes: number;
|
|
270
|
+
readonly droppedDatagrams: number;
|
|
271
|
+
};
|
|
272
|
+
close(code: number, reason: string): void;
|
|
273
|
+
/** When provided, joins actual parent/stream withdrawal and permits retry.
|
|
274
|
+
* Synchronous close alone does not establish native terminal evidence. */
|
|
275
|
+
closeAsync?(code: number, reason: string): Promise<void>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare interface RoomWireManifest<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> {
|
|
279
|
+
readonly state: S;
|
|
280
|
+
readonly input: I;
|
|
281
|
+
readonly messages?: Readonly<Record<string, RoomChannel>>;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare interface Simulation<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, O extends Schema.Codec<unknown, unknown>> {
|
|
285
|
+
readonly definition: SimulationDefinition<S, I, O>;
|
|
286
|
+
readonly stateCodec: SimulationStateCodec<S>;
|
|
287
|
+
readonly inputCodec: SimulationStateCodec<I>;
|
|
288
|
+
readonly optionsCodec: SimulationStateCodec<O>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare interface SimulationDefinition<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, O extends Schema.Codec<unknown, unknown>> {
|
|
292
|
+
readonly state: S;
|
|
293
|
+
readonly input: I;
|
|
294
|
+
readonly options: O;
|
|
295
|
+
readonly init: (seed: number, options: (O)["Type"]) => (S)["Type"];
|
|
296
|
+
readonly step: (state: RoomState<(S)["Type"]>, inputs: ReadonlyArray<SimulationPlayerInput<(I)["Type"]>>, tick: number, rng: Pcg32) => (S)["Type"];
|
|
297
|
+
readonly hash?: (state: (S)["Type"]) => Uint64Words;
|
|
298
|
+
/** Late join: runs before `step` at the tick a player's input first appears (it was absent
|
|
299
|
+
* from the previous tick's inputs), in player-ID order, e.g. to spawn the player. Pure and
|
|
300
|
+
* deterministic like `step`. Start players are `init`'s job: tick 1 runs no join. */
|
|
301
|
+
readonly join?: (state: RoomState<(S)["Type"]>, playerId: number, tick: number, rng: Pcg32) => (S)["Type"];
|
|
302
|
+
readonly limits?: Partial<SimulationValueLimits>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
declare interface SimulationPlayerInput<I> {
|
|
306
|
+
readonly playerId: number;
|
|
307
|
+
readonly input: I;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
declare interface SimulationSnapshot<S> {
|
|
311
|
+
readonly tick: number;
|
|
312
|
+
readonly state: S;
|
|
313
|
+
readonly rng: Pcg32Snapshot;
|
|
314
|
+
readonly hash: Uint64Words;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare interface SimulationStateCodec<S extends Schema.Codec<unknown, unknown>> {
|
|
318
|
+
readonly limits: SimulationValueLimits;
|
|
319
|
+
/** Admitted capture/hash plan, not a binary Room wire schema. */
|
|
320
|
+
schemaDescription?(): string;
|
|
321
|
+
capture(value: unknown): (S)["Type"];
|
|
322
|
+
hash(value: (S)["Type"]): Uint64Words;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
declare interface SimulationValueLimits extends RoomCodecLimits {
|
|
326
|
+
readonly maxNodes: number;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare const Transform2D: Schema.Struct<{
|
|
330
|
+
readonly x: Schema.Number;
|
|
331
|
+
readonly y: Schema.Number;
|
|
332
|
+
readonly rot: Schema.Number;
|
|
333
|
+
readonly vx: Schema.optional<Schema.Number>;
|
|
334
|
+
readonly vy: Schema.optional<Schema.Number>;
|
|
335
|
+
}>;
|
|
336
|
+
|
|
337
|
+
declare type Transform2D = (typeof Transform2D)["Type"];
|
|
338
|
+
|
|
339
|
+
/** Semantic, non-modal in-game surface. It shows actual orchestration steps,
|
|
340
|
+
* never fabricated percentage, asset completion or successful rollback. */
|
|
341
|
+
export declare const TransitionScreen: ({ client, locale, showSeamless, tip, className }: TransitionScreenProps) => ReactNode;
|
|
342
|
+
|
|
343
|
+
export declare interface TransitionScreenProps {
|
|
344
|
+
readonly client: WorldTransitionView;
|
|
345
|
+
readonly locale: 'en' | 'de';
|
|
346
|
+
/** Seamless operations remain invisible during ordinary gameplay. */
|
|
347
|
+
readonly showSeamless?: boolean;
|
|
348
|
+
readonly tip?: ReactNode;
|
|
349
|
+
readonly className?: string;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** Exact unsigned 64-bit integer as independent 32-bit words. */
|
|
353
|
+
declare interface Uint64Words {
|
|
354
|
+
readonly hi: number;
|
|
355
|
+
readonly lo: number;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/** Stable bound intention methods; no polling, implicit sample or state upload. */
|
|
359
|
+
export declare const useLocalInput: <S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, O extends Schema.Codec<unknown, unknown>>(session: RoomLockstepClientSession<S, I, O>) => Readonly<{
|
|
360
|
+
sendIntent: (input: I["Type"]) => Promise<void>;
|
|
361
|
+
sendInitialIntents: (input?: I["Type"] | undefined) => Promise<void>;
|
|
362
|
+
retryIntent: () => Promise<void>;
|
|
363
|
+
resendRetainedIntent: () => Promise<void>;
|
|
364
|
+
}>;
|
|
365
|
+
|
|
366
|
+
/** Observe a borrowed current network owner. Creation/start/advance/native
|
|
367
|
+
* shutdown belong to its caller; mounting and unmounting own only subscription. */
|
|
368
|
+
export declare const useLockstepRoom: <S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, O extends Schema.Codec<unknown, unknown>>(session: RoomLockstepClientSession<S, I, O>) => RoomLockstepClientObservation<S["Type"]>;
|
|
369
|
+
|
|
370
|
+
/** Render the already-authorized prediction; this hook sends no intentions. */
|
|
371
|
+
export declare const useOwnTransform: (prediction: RoomOwnTransformView2D, options?: RoomTransformHookOptions) => RoomTransformRef<Transform2D>;
|
|
372
|
+
|
|
373
|
+
/** Projection equality retains the prior result across unrelated notifications.
|
|
374
|
+
* Null is the actual absence of initialized state, never an invented initial state. */
|
|
375
|
+
export declare const useSimState: <S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, O extends Schema.Codec<unknown, unknown>, T>(session: RoomLockstepClientSession<S, I, O>, selector: (state: S["Type"] | null) => T, equals?: (previous: T, next: T) => boolean) => T;
|
|
376
|
+
|
|
377
|
+
/** Detached sample ref for a visible entity; animation and pose share a tick. */
|
|
378
|
+
export declare const useTransform: (entityId: string, options?: RoomTransformFrameHookOptions) => RoomTransformRef<RoomTransformSample2D>;
|
|
379
|
+
|
|
380
|
+
/** One ref/callback frame lifetime; no React state update on animation ticks. */
|
|
381
|
+
export declare const useTransformFrame: (callback: (frame: RoomTransformFrame2D) => void | Promise<void>, options?: RoomTransformFrameHookOptions) => RoomTransformHookHandle;
|
|
382
|
+
|
|
383
|
+
export declare const useWorldTransition: (client: WorldTransitionView) => WorldClientObservation;
|
|
384
|
+
|
|
385
|
+
declare interface WorldClientObservation {
|
|
386
|
+
readonly status: WorldClientStatus;
|
|
387
|
+
readonly step: WorldClientStep;
|
|
388
|
+
readonly mode: 'seamless' | 'portal' | null;
|
|
389
|
+
readonly bufferedInputs: number;
|
|
390
|
+
readonly bufferedBytes: number;
|
|
391
|
+
readonly committed: boolean;
|
|
392
|
+
readonly error: 'incomplete' | null;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare type WorldClientStatus = 'idle' | 'preparing' | 'loading' | 'switching' | 'settled' | 'failed' | 'closed';
|
|
396
|
+
|
|
397
|
+
declare type WorldClientStep = 'reserve' | 'connect' | 'welcome' | 'geometry' | 'assets' | 'commit' | 'cleanup' | null;
|
|
398
|
+
|
|
399
|
+
export declare interface WorldTransitionView {
|
|
400
|
+
readonly observation: WorldClientObservation;
|
|
401
|
+
subscribe(listener: () => void): () => void;
|
|
402
|
+
resume(): Promise<void>;
|
|
403
|
+
cancel(): Promise<void>;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export { }
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { BudgetExceeded as e, RoomAuthoringError as t } from "./errors.js";
|
|
2
|
+
import { RoomAnimationFrameLoop as n, RoomTransformFrameLoop2D as r } from "./transformFrames.js";
|
|
3
|
+
import { TransitionScreen as i, useWorldTransition as a } from "./worldReact.js";
|
|
4
|
+
import { useLocalInput as o, useLockstepRoom as s, useSimState as c } from "./lockstepReact.js";
|
|
5
|
+
import { createContext as l, createElement as u, useCallback as d, useContext as f, useEffect as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
6
|
+
// src/react.ts
|
|
7
|
+
var v = class {
|
|
8
|
+
capacity;
|
|
9
|
+
retained = /* @__PURE__ */ new Map();
|
|
10
|
+
active = null;
|
|
11
|
+
observedError = null;
|
|
12
|
+
constructor(e) {
|
|
13
|
+
if (this.capacity = e, !Number.isSafeInteger(e) || e < 1 || e > 128) throw new t({
|
|
14
|
+
room: "transform-react",
|
|
15
|
+
detail: "Hook lifetime budget must be positive and bounded"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
get error() {
|
|
19
|
+
return this.active?.error ?? this.observedError;
|
|
20
|
+
}
|
|
21
|
+
fail(e) {
|
|
22
|
+
this.observedError ??= e;
|
|
23
|
+
}
|
|
24
|
+
start(t) {
|
|
25
|
+
if (this.retained.size >= this.capacity) throw new e({
|
|
26
|
+
budget: "transformHookLifetimes",
|
|
27
|
+
limit: this.capacity
|
|
28
|
+
});
|
|
29
|
+
this.active = t;
|
|
30
|
+
try {
|
|
31
|
+
t.start();
|
|
32
|
+
} catch (e) {
|
|
33
|
+
throw this.fail(e), this.retire(t), e;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
track(e) {
|
|
37
|
+
let t = {
|
|
38
|
+
task: e.close(),
|
|
39
|
+
error: null
|
|
40
|
+
};
|
|
41
|
+
this.retained.set(e, t), t.task.then(() => {
|
|
42
|
+
e.error !== null && this.fail(e.error), this.retained.get(e) === t && this.retained.delete(e);
|
|
43
|
+
}, (e) => {
|
|
44
|
+
t.error = e, this.fail(e);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
retire(e) {
|
|
48
|
+
this.active === e && (this.active = null), this.retained.has(e) || this.track(e);
|
|
49
|
+
}
|
|
50
|
+
async settled() {
|
|
51
|
+
let e = (await Promise.allSettled([...this.retained.values()].map((e) => e.task))).flatMap((e) => e.status === "rejected" ? [e.reason] : []);
|
|
52
|
+
if (e.length) throw AggregateError(e, "Transform hook cleanup remains incomplete");
|
|
53
|
+
}
|
|
54
|
+
async retryCleanup() {
|
|
55
|
+
for (let [e, t] of this.retained) t.error !== null && this.track(e);
|
|
56
|
+
await this.settled();
|
|
57
|
+
}
|
|
58
|
+
}, y = l(null), b = ({ view: e, children: t }) => u(y.Provider, { value: e }, t), x = (e, t) => {
|
|
59
|
+
let [n] = _(() => new v(t));
|
|
60
|
+
return p(() => {
|
|
61
|
+
let t;
|
|
62
|
+
try {
|
|
63
|
+
t = e(), n.start(t);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
n.fail(e);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
return () => {
|
|
69
|
+
n.retire(t);
|
|
70
|
+
};
|
|
71
|
+
}, [e, n]), n;
|
|
72
|
+
}, S = (e, n = {}) => {
|
|
73
|
+
let i = f(y), a = n.view ?? i;
|
|
74
|
+
if (a === null) throw new t({
|
|
75
|
+
room: "transform-react",
|
|
76
|
+
detail: "A transform provider or explicit view is required"
|
|
77
|
+
});
|
|
78
|
+
let o = g(e), s = n.frames;
|
|
79
|
+
return m(() => {
|
|
80
|
+
o.current = e;
|
|
81
|
+
}, [e]), x(d(() => new r(a, (e) => o.current(e), s), [a, s]), n.maxRetainedLoops ?? 16);
|
|
82
|
+
}, C = (e, n = {}) => {
|
|
83
|
+
if (typeof e != "string" || !e.trim() || e.length > 191) throw new t({
|
|
84
|
+
room: "transform-react",
|
|
85
|
+
detail: "Transform entity identity must be nonempty and bounded"
|
|
86
|
+
});
|
|
87
|
+
let r = g(null), i = f(y), a = n.view ?? i;
|
|
88
|
+
m(() => {
|
|
89
|
+
r.current = null;
|
|
90
|
+
}, [e, a]);
|
|
91
|
+
let o = S((t) => {
|
|
92
|
+
r.current = t.entities.find((t) => t.id === e)?.sample ?? null;
|
|
93
|
+
}, n);
|
|
94
|
+
return h(() => Object.assign(r, { lifecycle: o }), [r, o]);
|
|
95
|
+
}, w = (e, t = {}) => {
|
|
96
|
+
let r = g(null), i = t.frames;
|
|
97
|
+
m(() => {
|
|
98
|
+
r.current = null;
|
|
99
|
+
}, [e]);
|
|
100
|
+
let a = x(d(() => {
|
|
101
|
+
let t = e.render.bind(e);
|
|
102
|
+
return new n(() => {
|
|
103
|
+
r.current = structuredClone(t());
|
|
104
|
+
}, i);
|
|
105
|
+
}, [e, i]), t.maxRetainedLoops ?? 16);
|
|
106
|
+
return h(() => Object.assign(r, { lifecycle: a }), [r, a]);
|
|
107
|
+
};
|
|
108
|
+
export { b as RoomTransformProvider, i as TransitionScreen, o as useLocalInput, s as useLockstepRoom, w as useOwnTransform, c as useSimState, C as useTransform, S as useTransformFrame, a as useWorldTransition };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AppContext } from '@voltro/runtime'
|
|
2
|
+
import { roomReaperWorkflowExecutor } from '@voltro/plugin-rooms'
|
|
3
|
+
|
|
4
|
+
/** Services come from the normal app handler/workflow runtime, not globals. */
|
|
5
|
+
export default (_context: AppContext): typeof roomReaperWorkflowExecutor => roomReaperWorkflowExecutor
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { workflow } from '@voltro/workflow/define'
|
|
2
|
+
import { Schema } from 'effect'
|
|
3
|
+
import { RoomReaperWorkflowPayload, RoomReaperWorkflowResult, BudgetExceeded, ProtocolError } from '@voltro/plugin-rooms/rpc'
|
|
4
|
+
|
|
5
|
+
/** Internal API-lane workflow. The ordinary scheduler owns firing and overlap. */
|
|
6
|
+
export const RoomsReaper = workflow({ name: 'rooms.reaper', payload: RoomReaperWorkflowPayload,
|
|
7
|
+
success: RoomReaperWorkflowResult, error: Schema.Union([ProtocolError, BudgetExceeded]),
|
|
8
|
+
internal: true, controls: { guards: [{ scope: 'rooms:operate' }] },
|
|
9
|
+
idempotencyKey: ({ runKey }) => `rooms.reaper:${runKey}`,
|
|
10
|
+
singleton: { key: () => 'rooms.reaper', mode: 'skip' },
|
|
11
|
+
schedule: { cron: '*/5 * * * * *', timezone: 'UTC', onOverlap: 'skip', backfill: 'skip',
|
|
12
|
+
payload: ({ scheduledAt }) => ({ runKey: scheduledAt.toISOString(), maxPages: 128 }) },
|
|
13
|
+
})
|