@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/world.d.ts
ADDED
|
@@ -0,0 +1,1894 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import { Duration } from 'effect';
|
|
3
|
+
import { Effect } from 'effect';
|
|
4
|
+
import { Schema } from 'effect';
|
|
5
|
+
import { YieldableError } from 'effect/Cause';
|
|
6
|
+
|
|
7
|
+
/** Configuration consumers never invoke a player callback. Its player type
|
|
8
|
+
* stays author-owned; this inventory type does not erase it into an input. */
|
|
9
|
+
export declare type AnyWorldDescriptor = WorldDescriptor<never>;
|
|
10
|
+
|
|
11
|
+
export declare const captureWorldCatalog: (offered: ReadonlyArray<AnyWorldDescriptor>, maximum?: number) => ReadonlyArray<AnyWorldDescriptor>;
|
|
12
|
+
|
|
13
|
+
/** Pure source selection only. Actual CMS publication/channel admission is a server capability. */
|
|
14
|
+
export declare const cmsGeometry: (key: string, offered?: {
|
|
15
|
+
readonly channel?: string | undefined;
|
|
16
|
+
}) => GeometrySource;
|
|
17
|
+
|
|
18
|
+
export declare const decodeWorldInspection: (value: unknown) => WorldInspection;
|
|
19
|
+
|
|
20
|
+
/** Observations only. SQL reservation and the real worker must still admit capacity. */
|
|
21
|
+
export declare const defaultWorldLayerPolicy: WorldLayerPolicy;
|
|
22
|
+
|
|
23
|
+
export declare const defaultWorldOnWorldChange: WorldOnWorldChange;
|
|
24
|
+
|
|
25
|
+
/** Classification only, never a player guard, seat reservation or commit authority. */
|
|
26
|
+
export declare const defaultWorldTransitionPolicy: WorldTransitionPolicy;
|
|
27
|
+
|
|
28
|
+
/** Pure immutable authoring; no room creation, discovery, table, connection or timer. */
|
|
29
|
+
export declare const defineWorld: <Player>(definition: WorldDefinition<Player>) => WorldDescriptor<Player>;
|
|
30
|
+
|
|
31
|
+
declare interface GeometryArtifact<C extends GeometryChunk = GeometryChunk> {
|
|
32
|
+
readonly chunk: C;
|
|
33
|
+
readonly blobSha256: string;
|
|
34
|
+
/** Canonical declared content/layout, excluding actual address/version only. */
|
|
35
|
+
readonly contentSha256: string;
|
|
36
|
+
bytes(): Uint8Array;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare type GeometryArtifactLimits<K extends GeometryKind> = K extends '2d-tiles' ? Partial<GeometryTileLimits> : K extends '2d-heightfield' ? Partial<GeometryHeightfieldLimits> : K extends '3d-shapes' ? Partial<GeometryShapesLimits> : Partial<GeometryVoxelLimits>;
|
|
40
|
+
|
|
41
|
+
declare interface GeometryAssetBundle {
|
|
42
|
+
readonly root: GeometryAssetRoot;
|
|
43
|
+
preload(signal: AbortSignal): Promise<void>;
|
|
44
|
+
at(key: string): GeometryVerifiedAsset;
|
|
45
|
+
observation(): {
|
|
46
|
+
readonly totalAssets: number;
|
|
47
|
+
readonly totalBytes: number;
|
|
48
|
+
readonly loadedAssets: number;
|
|
49
|
+
readonly loadedBytes: number;
|
|
50
|
+
readonly active: boolean;
|
|
51
|
+
readonly ready: boolean;
|
|
52
|
+
readonly closed: boolean;
|
|
53
|
+
};
|
|
54
|
+
/** Abort/join this bundle's actual accepted work only. Shared byte-cache and
|
|
55
|
+
* earlier detached aliases remain owned by their actual external lifetimes. */
|
|
56
|
+
close(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare interface GeometryAssetRoot {
|
|
60
|
+
readonly tenantId: string;
|
|
61
|
+
readonly worldId: string;
|
|
62
|
+
readonly layerSetId: string;
|
|
63
|
+
readonly version: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare type GeometryChunk = GeometryTileChunk | GeometryHeightfieldChunk | GeometryShapesChunk | GeometryVoxelChunk;
|
|
67
|
+
|
|
68
|
+
declare interface GeometryClientInterest {
|
|
69
|
+
readonly scope: GeometryPreparedScope;
|
|
70
|
+
readonly center: GeometryPreparedCoordinate;
|
|
71
|
+
readonly radiusChunks: number;
|
|
72
|
+
readonly prefetchChunks: number;
|
|
73
|
+
readonly visitedCoordinates: number;
|
|
74
|
+
readonly omittedPrefetch: number;
|
|
75
|
+
readonly chunks: ReadonlyArray<GeometryClientInterestEntry>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface GeometryClientInterestEntry {
|
|
79
|
+
readonly coordinate: GeometryPreparedCoordinate;
|
|
80
|
+
readonly distanceChunks: number;
|
|
81
|
+
readonly role: 'visible' | 'prefetch';
|
|
82
|
+
/** Declared render-field selection only. Native collision snapshots remain
|
|
83
|
+
* whole; this does not invent a coarse encoder/download/asset format. */
|
|
84
|
+
readonly fields: ReadonlyArray<string>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare interface GeometryClientInterestOptions {
|
|
88
|
+
readonly maxChunks?: number | undefined;
|
|
89
|
+
readonly maxVisitedCoordinates?: number;
|
|
90
|
+
/** Actual render Transform velocity in raw units/second, never server authority. */
|
|
91
|
+
readonly velocity?: GeometryWorldPointRaw | undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare type GeometryCollisionDerive = (context: GeometryDerivationContext) => GeometryChunk;
|
|
95
|
+
|
|
96
|
+
declare type GeometryCompaction = (context: GeometryCompactionContext) => GeometryPatch;
|
|
97
|
+
|
|
98
|
+
/** Genuine immutable native artifacts only. Compaction preserves the current
|
|
99
|
+
* truth; it cannot authorize a different edit, owner, revision or SQL write. */
|
|
100
|
+
declare interface GeometryCompactionContext {
|
|
101
|
+
readonly static: GeometryArtifact;
|
|
102
|
+
readonly current: GeometryArtifact;
|
|
103
|
+
readonly limits: GeometryPatchLimits;
|
|
104
|
+
readonly codecLimits: GeometryArtifactLimits<GeometryKind>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare interface GeometryCompactionStrategies {
|
|
108
|
+
readonly compaction: GeometryCompaction;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare interface GeometryDeltaMigrationFrom {
|
|
112
|
+
readonly static: GeometryArtifact;
|
|
113
|
+
readonly current: GeometryArtifact;
|
|
114
|
+
readonly revision: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare interface GeometryDeltaMigrationTo {
|
|
118
|
+
readonly static: GeometryArtifact;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Outside-Tick native data only. No query callback, provider, actor, Store or
|
|
122
|
+
* authority capability is accepted as a derivation result. */
|
|
123
|
+
declare interface GeometryDerivationContext {
|
|
124
|
+
readonly chunk: GeometryChunk;
|
|
125
|
+
readonly codecLimits: GeometryArtifactLimits<GeometryKind>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare interface GeometryDerivationStrategies {
|
|
129
|
+
readonly collisionDerive: GeometryCollisionDerive;
|
|
130
|
+
readonly navDerive: GeometryNavDerive;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Trusted server snapshot. Never derive these rights, positions, budgets or
|
|
134
|
+
* catalogs from the intent body. App policy must recheck authority at commit. */
|
|
135
|
+
declare interface GeometryEditAuthority {
|
|
136
|
+
readonly dynamicEnabled: boolean;
|
|
137
|
+
readonly ownsChunk: boolean;
|
|
138
|
+
readonly canBuild: boolean;
|
|
139
|
+
readonly cooldownReady: boolean;
|
|
140
|
+
readonly remainingOps: number;
|
|
141
|
+
readonly maxReachRaw: number;
|
|
142
|
+
readonly maxHeightUnits: number;
|
|
143
|
+
readonly position: {
|
|
144
|
+
readonly xRaw: number;
|
|
145
|
+
readonly yRaw: number;
|
|
146
|
+
readonly zRaw: number;
|
|
147
|
+
};
|
|
148
|
+
readonly materials: ReadonlyArray<GeometryTileMaterial>;
|
|
149
|
+
readonly shapes: ReadonlyArray<GeometryShapeTemplate>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare interface GeometryEditContext {
|
|
153
|
+
readonly chunk: GeometryChunk;
|
|
154
|
+
readonly intent: GeometryEditIntent;
|
|
155
|
+
readonly authority: GeometryEditAuthority;
|
|
156
|
+
readonly placementId: string;
|
|
157
|
+
readonly codecLimits?: GeometryArtifactLimits<GeometryKind> | undefined;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Player requests an action and its target, never solidity, shape dimensions,
|
|
161
|
+
* an authoritative player position, revision, owner, full chunk or Delta bytes. */
|
|
162
|
+
declare type GeometryEditIntent = {
|
|
163
|
+
readonly op: 'setTile';
|
|
164
|
+
readonly x: number;
|
|
165
|
+
readonly y: number;
|
|
166
|
+
readonly material: string;
|
|
167
|
+
} | {
|
|
168
|
+
readonly op: 'raiseHeight';
|
|
169
|
+
readonly x: number;
|
|
170
|
+
readonly y: number;
|
|
171
|
+
readonly units: number;
|
|
172
|
+
} | {
|
|
173
|
+
readonly op: 'setVoxel';
|
|
174
|
+
readonly x: number;
|
|
175
|
+
readonly y: number;
|
|
176
|
+
readonly z: number;
|
|
177
|
+
readonly material: string;
|
|
178
|
+
} | {
|
|
179
|
+
readonly op: 'placeShape';
|
|
180
|
+
readonly template: string;
|
|
181
|
+
readonly xRaw: number;
|
|
182
|
+
readonly yRaw: number;
|
|
183
|
+
readonly zRaw: number;
|
|
184
|
+
} | {
|
|
185
|
+
readonly op: 'removeShape';
|
|
186
|
+
readonly id: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
declare interface GeometryEditStrategies {
|
|
190
|
+
/** Pure policy slot. Current native Session/SQL ownership and codec integrity cannot be overridden by this slot. */
|
|
191
|
+
readonly opValidator: (context: GeometryEditContext) => void;
|
|
192
|
+
/** Pure rule slot; returned chunk is admitted under the original identity/layout/profile. */
|
|
193
|
+
readonly applyOp: (context: GeometryEditContext) => GeometryChunk;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare type GeometryGenerator = (context: GeometryProceduralContext) => GeometryChunk;
|
|
197
|
+
|
|
198
|
+
declare type GeometryHeightfieldChunk = (typeof GeometryHeightfieldChunkSchema)["Type"];
|
|
199
|
+
|
|
200
|
+
declare const GeometryHeightfieldChunkSchema: Schema.Struct<{
|
|
201
|
+
readonly kind: Schema.Literal<"2d-heightfield">;
|
|
202
|
+
readonly formatVersion: Schema.Literal<1>;
|
|
203
|
+
readonly address: Schema.Struct<{
|
|
204
|
+
readonly worldId: Schema.String;
|
|
205
|
+
readonly layerSetId: Schema.String;
|
|
206
|
+
readonly cx: Schema.Int;
|
|
207
|
+
readonly cy: Schema.Int;
|
|
208
|
+
}>;
|
|
209
|
+
readonly version: Schema.String;
|
|
210
|
+
readonly width: Schema.Int;
|
|
211
|
+
readonly height: Schema.Int;
|
|
212
|
+
readonly sampleSpacingRaw: Schema.Int;
|
|
213
|
+
readonly baseHeightRaw: Schema.Int;
|
|
214
|
+
readonly heightQuantumRaw: Schema.Int;
|
|
215
|
+
readonly heights: Schema.$Array<Schema.Int>;
|
|
216
|
+
}>;
|
|
217
|
+
|
|
218
|
+
declare interface GeometryHeightfieldLimits {
|
|
219
|
+
readonly maxSide: number;
|
|
220
|
+
readonly maxSamples: number;
|
|
221
|
+
readonly maxBytes: number;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare interface GeometryHeightfieldLodOptions {
|
|
225
|
+
readonly maxStride?: number;
|
|
226
|
+
readonly maxSamples?: number | undefined;
|
|
227
|
+
readonly codecLimits?: Partial<GeometryHeightfieldLimits> | undefined;
|
|
228
|
+
readonly strategies?: {
|
|
229
|
+
readonly sampleStride?: GeometryHeightfieldLodStride;
|
|
230
|
+
} | undefined;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare type GeometryHeightfieldLodStride = (chunk: GeometryHeightfieldChunk, maxStride: number) => number;
|
|
234
|
+
|
|
235
|
+
declare interface GeometryHeightfieldView {
|
|
236
|
+
readonly chunk: GeometryHeightfieldChunk;
|
|
237
|
+
heightAtSample(x: number, y: number): number;
|
|
238
|
+
heightAtRaw(xRaw: number, yRaw: number): number;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare type GeometryKind = GeometryChunk['kind'];
|
|
242
|
+
|
|
243
|
+
/** Pure native data rule only; no SQL, actor, journal, permission or Subject. */
|
|
244
|
+
declare type GeometryMigrateDelta = (from: GeometryDeltaMigrationFrom, to: GeometryDeltaMigrationTo) => GeometryChunk | null;
|
|
245
|
+
|
|
246
|
+
declare type GeometryNavDerive = (context: GeometryDerivationContext) => GeometryTileChunk | null;
|
|
247
|
+
|
|
248
|
+
declare interface GeometryPatch {
|
|
249
|
+
readonly metadata: GeometryPatchMetadata;
|
|
250
|
+
bytes(): Uint8Array;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare interface GeometryPatchLimits {
|
|
254
|
+
readonly maxBytes: number;
|
|
255
|
+
readonly maxMetadataBytes: number;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
declare type GeometryPatchMetadata = (typeof GeometryPatchMetadataSchema)["Type"];
|
|
259
|
+
|
|
260
|
+
declare const GeometryPatchMetadataSchema: Schema.Struct<{
|
|
261
|
+
readonly kind: Schema.Literals<readonly ["2d-tiles", "2d-heightfield", "3d-shapes", "3d-voxel"]>;
|
|
262
|
+
readonly formatVersion: Schema.Literal<1>;
|
|
263
|
+
readonly worldId: Schema.String;
|
|
264
|
+
readonly layerSetId: Schema.String;
|
|
265
|
+
readonly cx: Schema.Int;
|
|
266
|
+
readonly cy: Schema.Int;
|
|
267
|
+
readonly cz: Schema.optional<Schema.Int>;
|
|
268
|
+
readonly version: Schema.String;
|
|
269
|
+
readonly baseRevision: Schema.Int;
|
|
270
|
+
readonly revision: Schema.Int;
|
|
271
|
+
readonly baseBlobSha256: Schema.String;
|
|
272
|
+
readonly blobSha256: Schema.String;
|
|
273
|
+
readonly baseContentSha256: Schema.String;
|
|
274
|
+
readonly contentSha256: Schema.String;
|
|
275
|
+
readonly changed: Schema.Boolean;
|
|
276
|
+
readonly stateSchemaHash: Schema.Int;
|
|
277
|
+
}>;
|
|
278
|
+
|
|
279
|
+
declare interface GeometryPersistenceScope {
|
|
280
|
+
readonly tenantId: string;
|
|
281
|
+
readonly kind: GeometryKind;
|
|
282
|
+
readonly worldId: string;
|
|
283
|
+
readonly version: string;
|
|
284
|
+
readonly layerSetId: string;
|
|
285
|
+
readonly cx: number;
|
|
286
|
+
readonly cy: number;
|
|
287
|
+
readonly cz?: number | undefined;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
declare interface GeometryPointRaw3D {
|
|
291
|
+
readonly xRaw: number;
|
|
292
|
+
readonly yRaw: number;
|
|
293
|
+
readonly zRaw: number;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
declare interface GeometryPreparedCoordinate {
|
|
297
|
+
readonly cx: number;
|
|
298
|
+
readonly cy: number;
|
|
299
|
+
readonly cz?: number | undefined;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare type GeometryPreparedEntry = PreparedCommon & GeometryPreparedView & {
|
|
303
|
+
/** Independently prepared native collision data. Original view/artifact remains the edit/rebuild baseline. */
|
|
304
|
+
readonly collision: GeometryPreparedView;
|
|
305
|
+
readonly navigation: GeometryTileView | null;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
declare interface GeometryPreparedScope {
|
|
309
|
+
readonly tenantId: string;
|
|
310
|
+
readonly kind: GeometryKind;
|
|
311
|
+
readonly worldId: string;
|
|
312
|
+
readonly layerSetId: string;
|
|
313
|
+
readonly version: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare type GeometryPreparedView = ({
|
|
317
|
+
readonly kind: '2d-tiles';
|
|
318
|
+
readonly view: GeometryTileView;
|
|
319
|
+
} | {
|
|
320
|
+
readonly kind: '2d-heightfield';
|
|
321
|
+
readonly view: GeometryHeightfieldView;
|
|
322
|
+
} | {
|
|
323
|
+
readonly kind: '3d-shapes';
|
|
324
|
+
readonly view: GeometryShapesView;
|
|
325
|
+
} | {
|
|
326
|
+
readonly kind: '3d-voxel';
|
|
327
|
+
readonly view: GeometryVoxelView;
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
export declare interface GeometryProceduralContext {
|
|
331
|
+
readonly seed: number;
|
|
332
|
+
readonly kind: GeometryKind;
|
|
333
|
+
readonly address: GeometryChunk['address'];
|
|
334
|
+
readonly version: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare interface GeometryRenderLod {
|
|
338
|
+
readonly fields: ReadonlyArray<string>;
|
|
339
|
+
readonly sampleStride: number;
|
|
340
|
+
readonly sourceBlobSha256: string;
|
|
341
|
+
readonly sourceContentSha256: string;
|
|
342
|
+
readonly artifact: GeometryArtifact;
|
|
343
|
+
/** Present when both full heights and heightsCoarse are selected. */
|
|
344
|
+
readonly coarseArtifact?: GeometryArtifact;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
declare interface GeometryRenderLodCache {
|
|
348
|
+
prepare(coordinate: GeometryPreparedCoordinate, distanceChunks: number): Promise<GeometryRenderLod>;
|
|
349
|
+
at(coordinate: GeometryPreparedCoordinate, distanceChunks: number): GeometryRenderLod;
|
|
350
|
+
observation(): {
|
|
351
|
+
readonly entries: number;
|
|
352
|
+
readonly encodedBytes: number;
|
|
353
|
+
readonly jobs: number;
|
|
354
|
+
readonly closed: boolean;
|
|
355
|
+
readonly withdrawn: boolean;
|
|
356
|
+
};
|
|
357
|
+
/** Clears owned references and joins all accepted preparation/hash work. It
|
|
358
|
+
* never closes the borrowed native cache/Session or erases earlier aliases. */
|
|
359
|
+
close(): Promise<void>;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
declare interface GeometryRenderLodCacheOptions {
|
|
363
|
+
readonly maxEntries?: number;
|
|
364
|
+
readonly maxEncodedBytes?: number;
|
|
365
|
+
readonly maxConcurrent?: number | undefined;
|
|
366
|
+
readonly lod?: GeometryHeightfieldLodOptions;
|
|
367
|
+
readonly strategies?: {
|
|
368
|
+
readonly prepare?: GeometryRenderLodPreparer;
|
|
369
|
+
} | undefined;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
declare type GeometryRenderLodPreparer = (world: AnyWorldDescriptor, artifact: GeometryArtifact, distanceChunks: number, options: GeometryHeightfieldLodOptions) => Promise<GeometryRenderLod>;
|
|
373
|
+
|
|
374
|
+
declare type GeometryShape = (typeof GeometryShapeSchema)["Type"];
|
|
375
|
+
|
|
376
|
+
declare const GeometryShapeSchema: Schema.Union<readonly [Schema.Struct<{
|
|
377
|
+
readonly halfXRaw: Schema.Int;
|
|
378
|
+
readonly halfYRaw: Schema.Int;
|
|
379
|
+
readonly halfZRaw: Schema.Int;
|
|
380
|
+
readonly id: Schema.String;
|
|
381
|
+
readonly xRaw: Schema.Int;
|
|
382
|
+
readonly yRaw: Schema.Int;
|
|
383
|
+
readonly zRaw: Schema.Int;
|
|
384
|
+
readonly kind: Schema.Literal<"aabb">;
|
|
385
|
+
}>, Schema.Struct<{
|
|
386
|
+
readonly radiusRaw: Schema.Int;
|
|
387
|
+
readonly id: Schema.String;
|
|
388
|
+
readonly xRaw: Schema.Int;
|
|
389
|
+
readonly yRaw: Schema.Int;
|
|
390
|
+
readonly zRaw: Schema.Int;
|
|
391
|
+
readonly kind: Schema.Literal<"sphere">;
|
|
392
|
+
}>]>;
|
|
393
|
+
|
|
394
|
+
declare type GeometryShapesChunk = (typeof GeometryShapesChunkSchema)["Type"];
|
|
395
|
+
|
|
396
|
+
declare const GeometryShapesChunkSchema: Schema.Struct<{
|
|
397
|
+
readonly kind: Schema.Literal<"3d-shapes">;
|
|
398
|
+
readonly formatVersion: Schema.Literal<1>;
|
|
399
|
+
readonly address: Schema.Struct<{
|
|
400
|
+
readonly worldId: Schema.String;
|
|
401
|
+
readonly layerSetId: Schema.String;
|
|
402
|
+
readonly cx: Schema.Int;
|
|
403
|
+
readonly cy: Schema.Int;
|
|
404
|
+
readonly cz: Schema.Int;
|
|
405
|
+
}>;
|
|
406
|
+
readonly version: Schema.String;
|
|
407
|
+
readonly extentXRaw: Schema.Int;
|
|
408
|
+
readonly extentYRaw: Schema.Int;
|
|
409
|
+
readonly extentZRaw: Schema.Int;
|
|
410
|
+
readonly shapes: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
411
|
+
readonly halfXRaw: Schema.Int;
|
|
412
|
+
readonly halfYRaw: Schema.Int;
|
|
413
|
+
readonly halfZRaw: Schema.Int;
|
|
414
|
+
readonly id: Schema.String;
|
|
415
|
+
readonly xRaw: Schema.Int;
|
|
416
|
+
readonly yRaw: Schema.Int;
|
|
417
|
+
readonly zRaw: Schema.Int;
|
|
418
|
+
readonly kind: Schema.Literal<"aabb">;
|
|
419
|
+
}>, Schema.Struct<{
|
|
420
|
+
readonly radiusRaw: Schema.Int;
|
|
421
|
+
readonly id: Schema.String;
|
|
422
|
+
readonly xRaw: Schema.Int;
|
|
423
|
+
readonly yRaw: Schema.Int;
|
|
424
|
+
readonly zRaw: Schema.Int;
|
|
425
|
+
readonly kind: Schema.Literal<"sphere">;
|
|
426
|
+
}>]>>;
|
|
427
|
+
}>;
|
|
428
|
+
|
|
429
|
+
declare interface GeometryShapesLimits {
|
|
430
|
+
readonly maxShapes: number;
|
|
431
|
+
readonly maxBytes: number;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
declare interface GeometryShapesView {
|
|
435
|
+
readonly chunk: GeometryShapesChunk;
|
|
436
|
+
containingRaw(point: GeometryPointRaw3D, maximumShapes?: number): ReadonlyArray<GeometryShape>;
|
|
437
|
+
/** Closed LOCAL segment and native volumes. Canonical ID order, not distance
|
|
438
|
+
* order; no first-hit fraction or cross-chunk ownership is implied. */
|
|
439
|
+
intersectingSegmentRaw(from: GeometryPointRaw3D, to: GeometryPointRaw3D, maximumShapes?: number): ReadonlyArray<GeometryShape>;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare type GeometryShapeTemplate = {
|
|
443
|
+
readonly key: string;
|
|
444
|
+
readonly kind: 'aabb';
|
|
445
|
+
readonly halfXRaw: number;
|
|
446
|
+
readonly halfYRaw: number;
|
|
447
|
+
readonly halfZRaw: number;
|
|
448
|
+
} | {
|
|
449
|
+
readonly key: string;
|
|
450
|
+
readonly kind: 'sphere';
|
|
451
|
+
readonly radiusRaw: number;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
export declare type GeometrySource = {
|
|
455
|
+
readonly _tag: 'GeometrySource';
|
|
456
|
+
readonly kind: 'cms';
|
|
457
|
+
readonly key: string;
|
|
458
|
+
readonly channel: string;
|
|
459
|
+
} | {
|
|
460
|
+
readonly _tag: 'GeometrySource';
|
|
461
|
+
readonly kind: 'imported';
|
|
462
|
+
readonly directory: string;
|
|
463
|
+
} | {
|
|
464
|
+
readonly _tag: 'GeometrySource';
|
|
465
|
+
readonly kind: 'procedural';
|
|
466
|
+
readonly seed: number;
|
|
467
|
+
readonly generator: GeometryGenerator;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
declare interface GeometryTileCellBounds {
|
|
471
|
+
readonly minXRaw: number;
|
|
472
|
+
readonly minYRaw: number;
|
|
473
|
+
readonly maxXRaw: number;
|
|
474
|
+
readonly maxYRaw: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare type GeometryTileChunk = (typeof GeometryTileChunkSchema)["Type"];
|
|
478
|
+
|
|
479
|
+
declare const GeometryTileChunkSchema: Schema.Struct<{
|
|
480
|
+
readonly kind: Schema.Literal<"2d-tiles">;
|
|
481
|
+
readonly formatVersion: Schema.Literal<1>;
|
|
482
|
+
readonly address: Schema.Struct<{
|
|
483
|
+
readonly worldId: Schema.String;
|
|
484
|
+
readonly layerSetId: Schema.String;
|
|
485
|
+
readonly cx: Schema.Int;
|
|
486
|
+
readonly cy: Schema.Int;
|
|
487
|
+
}>;
|
|
488
|
+
readonly version: Schema.String;
|
|
489
|
+
readonly width: Schema.Int;
|
|
490
|
+
readonly height: Schema.Int;
|
|
491
|
+
readonly tileSizeRaw: Schema.Int;
|
|
492
|
+
readonly palette: Schema.$Array<Schema.Struct<{
|
|
493
|
+
readonly key: Schema.String;
|
|
494
|
+
readonly solid: Schema.Boolean;
|
|
495
|
+
}>>;
|
|
496
|
+
readonly runs: Schema.$Array<Schema.Struct<{
|
|
497
|
+
readonly paletteIndex: Schema.Int;
|
|
498
|
+
readonly length: Schema.Int;
|
|
499
|
+
}>>;
|
|
500
|
+
}>;
|
|
501
|
+
|
|
502
|
+
declare interface GeometryTileLimits {
|
|
503
|
+
readonly maxSide: number;
|
|
504
|
+
readonly maxCells: number;
|
|
505
|
+
readonly maxPalette: number;
|
|
506
|
+
readonly maxRuns: number;
|
|
507
|
+
readonly maxBytes: number;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
declare type GeometryTileMaterial = (typeof GeometryTileMaterialSchema)["Type"];
|
|
511
|
+
|
|
512
|
+
declare const GeometryTileMaterialSchema: Schema.Struct<{
|
|
513
|
+
readonly key: Schema.String;
|
|
514
|
+
readonly solid: Schema.Boolean;
|
|
515
|
+
}>;
|
|
516
|
+
|
|
517
|
+
declare interface GeometryTileView {
|
|
518
|
+
readonly chunk: GeometryTileChunk;
|
|
519
|
+
/** Local integer cell queries. Outside cells refuse; no missing-neighbor air. */
|
|
520
|
+
materialAt(x: number, y: number): GeometryTileMaterial;
|
|
521
|
+
solidAt(x: number, y: number): boolean;
|
|
522
|
+
materialAtRaw(xRaw: number, yRaw: number): GeometryTileMaterial;
|
|
523
|
+
cellBounds(x: number, y: number): GeometryTileCellBounds;
|
|
524
|
+
/** Detached row-major little-bit occupancy, never the retained mutable grid. */
|
|
525
|
+
occupancy(): Uint8Array;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
declare interface GeometryVerifiedAsset {
|
|
529
|
+
readonly root: GeometryAssetRoot;
|
|
530
|
+
readonly key: string;
|
|
531
|
+
readonly checksum: string;
|
|
532
|
+
readonly size: number;
|
|
533
|
+
readonly contentType: string;
|
|
534
|
+
/** Detached owned bytes; no URL/token/permission retained. */
|
|
535
|
+
bytes(): Uint8Array;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare interface GeometryVersionMigrationStrategies {
|
|
539
|
+
readonly migrateDelta?: GeometryMigrateDelta;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
declare type GeometryVoxelChunk = (typeof GeometryVoxelChunkSchema)["Type"];
|
|
543
|
+
|
|
544
|
+
declare const GeometryVoxelChunkSchema: Schema.Struct<{
|
|
545
|
+
readonly kind: Schema.Literal<"3d-voxel">;
|
|
546
|
+
readonly formatVersion: Schema.Literal<1>;
|
|
547
|
+
readonly address: Schema.Struct<{
|
|
548
|
+
readonly worldId: Schema.String;
|
|
549
|
+
readonly layerSetId: Schema.String;
|
|
550
|
+
readonly cx: Schema.Int;
|
|
551
|
+
readonly cy: Schema.Int;
|
|
552
|
+
readonly cz: Schema.Int;
|
|
553
|
+
}>;
|
|
554
|
+
readonly version: Schema.String;
|
|
555
|
+
readonly side: Schema.Int;
|
|
556
|
+
readonly voxelSizeRaw: Schema.Int;
|
|
557
|
+
readonly palette: Schema.$Array<Schema.Struct<{
|
|
558
|
+
readonly key: Schema.String;
|
|
559
|
+
readonly solid: Schema.Boolean;
|
|
560
|
+
}>>;
|
|
561
|
+
readonly sections: Schema.$Array<Schema.Struct<{
|
|
562
|
+
readonly sx: Schema.Int;
|
|
563
|
+
readonly sy: Schema.Int;
|
|
564
|
+
readonly sz: Schema.Int;
|
|
565
|
+
readonly runs: Schema.$Array<Schema.Struct<{
|
|
566
|
+
readonly paletteIndex: Schema.Int;
|
|
567
|
+
readonly length: Schema.Int;
|
|
568
|
+
}>>;
|
|
569
|
+
}>>;
|
|
570
|
+
}>;
|
|
571
|
+
|
|
572
|
+
declare interface GeometryVoxelLimits {
|
|
573
|
+
readonly maxSide: number;
|
|
574
|
+
readonly maxVoxels: number;
|
|
575
|
+
readonly maxPalette: number;
|
|
576
|
+
readonly maxSections: number;
|
|
577
|
+
readonly maxRunsPerSection: number;
|
|
578
|
+
readonly maxBytes: number;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
declare interface GeometryVoxelView {
|
|
582
|
+
readonly chunk: GeometryVoxelChunk;
|
|
583
|
+
materialAt(x: number, y: number, z: number): GeometryTileMaterial;
|
|
584
|
+
solidAt(x: number, y: number, z: number): boolean;
|
|
585
|
+
materialAtRaw(xRaw: number, yRaw: number, zRaw: number): GeometryTileMaterial;
|
|
586
|
+
occupancy(): Uint8Array;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
declare interface GeometryWorldPointRaw {
|
|
590
|
+
readonly xRaw: number;
|
|
591
|
+
readonly yRaw: number;
|
|
592
|
+
readonly zRaw?: number;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/** App-root relative declaration; it neither opens a path nor proves filesystem custody. */
|
|
596
|
+
export declare const importedGeometry: (directory: string) => GeometrySource;
|
|
597
|
+
|
|
598
|
+
/** Pure synchronous constraint, not a Room ownership or crossing capability.
|
|
599
|
+
* The Host supplies actual cell bounds; ownership transfer installs a different
|
|
600
|
+
* actor/bounds. There is no caller-controlled allowCrossing boolean. */
|
|
601
|
+
export declare const makeWorldCellMovement: (offered: WorldBounds) => Readonly<{
|
|
602
|
+
bounds: WorldBounds & any[];
|
|
603
|
+
/** Directional margin observation only. Target point crosses exactly one
|
|
604
|
+
* source edge; the actual catalogue/SQL resolver must admit its neighbor. */
|
|
605
|
+
approach: (offeredFrom: WorldPoint, offeredTo: WorldPoint, marginUnits: number) => Omit<WorldMovementIntent, "entityId"> | null;
|
|
606
|
+
constrain: (offeredFrom: WorldPoint, offeredTo: WorldPoint) => WorldCellMovement;
|
|
607
|
+
}>;
|
|
608
|
+
|
|
609
|
+
/** Independent immutable projections for rendering. Never merged into the
|
|
610
|
+
* authoritative Room snapshot, input history, collision state or SQL state. */
|
|
611
|
+
export declare const makeWorldEntityHandoffView: <S, E>(options: WorldEntityHandoffViewOptions<S, E>) => Readonly<{
|
|
612
|
+
notice: (roomId: string, frame: RoomWorldHandoffFrame, snapshot: RoomDeliveredState<S> | null) => void;
|
|
613
|
+
observe: (roomId: string, snapshot: RoomDeliveredState<S> | null) => void;
|
|
614
|
+
read: (roomId: string, snapshot: RoomDeliveredState<S> | null) => ReadonlyArray<WorldEntityHandoffProjection<E>>;
|
|
615
|
+
attach: (roomId: string, connection: WorldHandoffConnection<S>) => (() => void);
|
|
616
|
+
stats: () => Readonly<{
|
|
617
|
+
entities: number;
|
|
618
|
+
bytes: number;
|
|
619
|
+
connections: number;
|
|
620
|
+
}>;
|
|
621
|
+
close: () => void;
|
|
622
|
+
}>;
|
|
623
|
+
|
|
624
|
+
/** Pure geometric selection, not ownership/Host/mesh admission. Candidate
|
|
625
|
+
* bounds are checked before enumeration; no partial neighborhood is returned. */
|
|
626
|
+
export declare const makeWorldGhostNeighborhood: (offered: WorldGhostNeighborhoodOptions) => (raw: WorldPosition & {
|
|
627
|
+
readonly layer: number;
|
|
628
|
+
}) => ReadonlyArray<WorldGhostNeighbor>;
|
|
629
|
+
|
|
630
|
+
/** Presentation only. Retained state never becomes an authoritative delivered
|
|
631
|
+
* snapshot, input receipt, physics baseline or SQL ownership assertion. */
|
|
632
|
+
export declare const makeWorldHandoffView: <S>(offered: WorldHandoffViewOptions<S>) => Readonly<{
|
|
633
|
+
begin: (requestId: string, entityId: string, source: RoomDeliveredState<S>) => void;
|
|
634
|
+
prepare: (mode: "portal" | "seamless", target: {
|
|
635
|
+
readonly roomId: string;
|
|
636
|
+
readonly epoch: number;
|
|
637
|
+
}) => void;
|
|
638
|
+
source: (raw: RoomDeliveredState<S> | null) => void;
|
|
639
|
+
commit: () => void;
|
|
640
|
+
rollback: () => void;
|
|
641
|
+
read: (roomId: string | null, raw: RoomDeliveredState<S> | null) => WorldHandoffPresentation<S> | null;
|
|
642
|
+
observation: () => Readonly<{
|
|
643
|
+
retained: boolean;
|
|
644
|
+
enabled: boolean;
|
|
645
|
+
committed: boolean;
|
|
646
|
+
expiresAt: number | null;
|
|
647
|
+
}>;
|
|
648
|
+
close: () => void;
|
|
649
|
+
}>;
|
|
650
|
+
|
|
651
|
+
declare interface PreparedCommon {
|
|
652
|
+
readonly scope: GeometryPersistenceScope;
|
|
653
|
+
readonly revision: number;
|
|
654
|
+
readonly blobSha256: string;
|
|
655
|
+
readonly contentSha256: string;
|
|
656
|
+
readonly accountedBytes: number;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/** Captured author callback only, never invoked during World declaration/catalogue admission. */
|
|
660
|
+
export declare const procedural: (offered: {
|
|
661
|
+
readonly seed: number;
|
|
662
|
+
readonly generator: GeometryGenerator;
|
|
663
|
+
}) => GeometrySource;
|
|
664
|
+
|
|
665
|
+
declare class ProtocolError extends ProtocolError_base {
|
|
666
|
+
get message(): string;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
declare const ProtocolError_base: Schema.Class<ProtocolError, Schema.TaggedStruct<"ProtocolError", {
|
|
670
|
+
readonly detail: Schema.String;
|
|
671
|
+
}>, YieldableError>;
|
|
672
|
+
|
|
673
|
+
export declare const rect: (minX: number, minY: number, maxX: number, maxY: number) => WorldBounds;
|
|
674
|
+
|
|
675
|
+
/** Validate replacement output against captured observations and party affinity. */
|
|
676
|
+
export declare const resolveWorldLayerPolicy: (raw: WorldLayerInput, strategy?: WorldLayerPolicy) => WorldLayerDecision;
|
|
677
|
+
|
|
678
|
+
/** Data policy only. No identity, placement, auth, I/O or ownership authority. */
|
|
679
|
+
export declare const resolveWorldOnWorldChange: (input: WorldOnWorldChangeInput, maxBytes: number, strategy?: WorldOnWorldChange) => unknown;
|
|
680
|
+
|
|
681
|
+
/** A replacement can select a safer portal, never remove required persistence. */
|
|
682
|
+
export declare const resolveWorldTransitionPolicy: (raw: WorldTransitionPolicyInput, strategy?: WorldTransitionPolicy) => WorldTransitionPlan;
|
|
683
|
+
|
|
684
|
+
/** Commands are staged in memory and drained outside the tick. */
|
|
685
|
+
declare interface RoomAppBridge {
|
|
686
|
+
publish(event: string, payload: unknown, options: {
|
|
687
|
+
readonly key: string;
|
|
688
|
+
}): string;
|
|
689
|
+
run(descriptor: string, input: unknown): string;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
declare interface RoomAppCommand {
|
|
693
|
+
readonly roomId: string;
|
|
694
|
+
readonly tenantId: string;
|
|
695
|
+
readonly requestId: string;
|
|
696
|
+
readonly command: RoomOutboxCommand;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/** The normal app dispatcher must use requestId for durable idempotency. SQL
|
|
700
|
+
* acknowledgement follows delivery, so a lost acknowledgement may retry that
|
|
701
|
+
* same operation. This port never promises exactly-once external effects. */
|
|
702
|
+
declare interface RoomAppCommandBindings {
|
|
703
|
+
readonly run: Readonly<Record<string, (input: unknown, context: Omit<RoomAppCommand, 'command'>) => Effect.Effect<void, unknown>>>;
|
|
704
|
+
readonly publish: Readonly<Record<string, (payload: unknown, context: Omit<RoomAppCommand, 'command'> & {
|
|
705
|
+
readonly key: string;
|
|
706
|
+
}) => Effect.Effect<void, unknown>>>;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
declare interface RoomChannel {
|
|
710
|
+
readonly schema: Schema.Codec<unknown, unknown>;
|
|
711
|
+
readonly direction: 'both' | 'server' | 'client';
|
|
712
|
+
readonly reliable: boolean;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/** API-facing reservation result. Credentials are retained only for Hello. */
|
|
716
|
+
declare interface RoomClientReservation {
|
|
717
|
+
readonly roomId: string;
|
|
718
|
+
readonly sessionId: string;
|
|
719
|
+
readonly token: Uint8Array;
|
|
720
|
+
readonly address: string;
|
|
721
|
+
readonly expiresAt: number;
|
|
722
|
+
readonly endpoints?: RoomTransportEndpoints | undefined;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
declare interface RoomClock {
|
|
726
|
+
now(): number;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
declare type RoomClockPingCadence = (joinedForMs: number) => number;
|
|
730
|
+
|
|
731
|
+
declare interface RoomClockSamplingOptions {
|
|
732
|
+
readonly maxPendingPings: number;
|
|
733
|
+
readonly pingTimeoutMs: number;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/** Framework-free reserve -> transport -> Hello orchestration. It preserves
|
|
737
|
+
* the last authoritative state during reconnect and never writes a token to
|
|
738
|
+
* persistent storage. RPC facade/platform/render-hook integration is pending. */
|
|
739
|
+
declare class RoomConnection<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>, JoinInput> {
|
|
740
|
+
readonly manifest: RoomWireManifest<S, I>;
|
|
741
|
+
readonly clock: RoomClock;
|
|
742
|
+
readonly reservations: RoomReservationClient<JoinInput>;
|
|
743
|
+
readonly connect: (address: string, signal: AbortSignal, endpoints?: RoomTransportEndpoints) => Promise<RoomTransport>;
|
|
744
|
+
private readonly controller;
|
|
745
|
+
private readonly listeners;
|
|
746
|
+
private readonly buffered;
|
|
747
|
+
private readonly pendingInputs;
|
|
748
|
+
private readonly options;
|
|
749
|
+
private session;
|
|
750
|
+
private handoffDetach;
|
|
751
|
+
private readonly handoffListeners;
|
|
752
|
+
private sessionDetach;
|
|
753
|
+
private currentState;
|
|
754
|
+
private currentStatus;
|
|
755
|
+
private currentError;
|
|
756
|
+
private reconnectTask;
|
|
757
|
+
private startTask;
|
|
758
|
+
private started;
|
|
759
|
+
private leaving;
|
|
760
|
+
private lastSessionId;
|
|
761
|
+
private lastTick;
|
|
762
|
+
private nextSeq;
|
|
763
|
+
private appliedSeq;
|
|
764
|
+
private clockTimer;
|
|
765
|
+
private readonly messageListeners;
|
|
766
|
+
private readonly messageDetach;
|
|
767
|
+
private reservation;
|
|
768
|
+
private readonly cleanupTasks;
|
|
769
|
+
private readonly cleanupFailures;
|
|
770
|
+
private pendingReservationCalls;
|
|
771
|
+
private pendingTransportCalls;
|
|
772
|
+
private readonly transportOwners;
|
|
773
|
+
private readonly transportLifetimes;
|
|
774
|
+
private withdrawalAttempted;
|
|
775
|
+
private leaveTask;
|
|
776
|
+
private left;
|
|
777
|
+
constructor(manifest: RoomWireManifest<S, I>, clock: RoomClock, reservations: RoomReservationClient<JoinInput>, connect: (address: string, signal: AbortSignal, endpoints?: RoomTransportEndpoints) => Promise<RoomTransport>, options: RoomConnectionOptions);
|
|
778
|
+
/* Excluded from this release type: captureGeometrySession */
|
|
779
|
+
/** `waking`: the pool scaled to zero and is starting a host; entry continues on its own. */
|
|
780
|
+
get status(): RoomSessionStatus | 'reserving' | 'waking';
|
|
781
|
+
get error(): unknown;
|
|
782
|
+
get state(): (S)["Type"] | null;
|
|
783
|
+
get id(): string | null;
|
|
784
|
+
/** Reserved Room identity, without exposing its seat credential. */
|
|
785
|
+
get roomId(): string | null;
|
|
786
|
+
get lastAppliedTick(): number;
|
|
787
|
+
get lastAppliedInputSeq(): number;
|
|
788
|
+
/** Exact current-session pairing; epoch changes need prediction reset. */
|
|
789
|
+
get reconciliationSnapshot(): RoomReconciliationSnapshot<(S)["Type"]> | null;
|
|
790
|
+
deliveredSnapshot(): RoomDeliveredState<(S)["Type"]> | null;
|
|
791
|
+
clockStats(): {
|
|
792
|
+
readonly rttMs: number | null;
|
|
793
|
+
readonly offsetMs: number | null;
|
|
794
|
+
};
|
|
795
|
+
serverNow(): number | null;
|
|
796
|
+
/** The current session's estimated datagram loss (0–1), null until measured. */
|
|
797
|
+
get lossRate(): number | null;
|
|
798
|
+
subscribe(listener: () => void): () => void;
|
|
799
|
+
private notify;
|
|
800
|
+
private active;
|
|
801
|
+
start(input: JoinInput): Promise<void>;
|
|
802
|
+
private attempt;
|
|
803
|
+
private install;
|
|
804
|
+
private waitForJoin;
|
|
805
|
+
private beginReconnect;
|
|
806
|
+
send(input: (I)["Type"]): Promise<number>;
|
|
807
|
+
private submit;
|
|
808
|
+
message(channel: string, payload: unknown): Promise<void>;
|
|
809
|
+
onWorldHandoff(listener: (frame: RoomWorldHandoffFrame) => void): () => void;
|
|
810
|
+
onMessage(channel: string, listener: (payload: unknown) => void): () => void;
|
|
811
|
+
private attachMessages;
|
|
812
|
+
private requestReservation;
|
|
813
|
+
private releaseReservation;
|
|
814
|
+
private stopClockSampling;
|
|
815
|
+
private releaseTransport;
|
|
816
|
+
private retainTransport;
|
|
817
|
+
private runTransportCleanup;
|
|
818
|
+
private startClockSampling;
|
|
819
|
+
private terminal;
|
|
820
|
+
leave(): Promise<void>;
|
|
821
|
+
private withdraw;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
declare interface RoomConnectionOptions {
|
|
825
|
+
readonly graceMs: number;
|
|
826
|
+
readonly maxBufferedInputs?: number;
|
|
827
|
+
readonly maxPendingInputs?: number;
|
|
828
|
+
readonly initialBackoffMs?: number;
|
|
829
|
+
readonly maxBackoffMs?: number;
|
|
830
|
+
readonly connectTimeoutMs?: number;
|
|
831
|
+
readonly random?: () => number;
|
|
832
|
+
readonly sleep?: (milliseconds: number, signal: AbortSignal) => Promise<void>;
|
|
833
|
+
readonly reconnectPolicy?: RoomReconnectPolicy;
|
|
834
|
+
readonly clockSampling?: RoomClockSamplingOptions;
|
|
835
|
+
readonly inputRedundancy?: RoomInputRedundancyOptions;
|
|
836
|
+
readonly clockPingCadence?: RoomClockPingCadence;
|
|
837
|
+
readonly maxPendingReservationCalls?: number;
|
|
838
|
+
readonly maxCleanupFailures?: number;
|
|
839
|
+
readonly maxPendingTransportCalls?: number;
|
|
840
|
+
/** How long entry keeps waiting while a scaled-to-zero pool starts a host (`RoomPoolWaking`). Default 180000. */
|
|
841
|
+
readonly wakeTimeoutMs?: number;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
declare interface RoomDatagramLane {
|
|
845
|
+
readonly maxDatagramBytes: number;
|
|
846
|
+
send(frame: Uint8Array): void;
|
|
847
|
+
onFrame(listener: (frame: Uint8Array, receivedAt: number) => void): () => void;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
declare interface RoomDeliveredState<S> {
|
|
851
|
+
readonly epoch: number;
|
|
852
|
+
readonly tick: number;
|
|
853
|
+
/** Local transport observation, not an authoritative server timestamp. */
|
|
854
|
+
readonly receivedAt: number;
|
|
855
|
+
readonly state: S;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
declare interface RoomGeometryChunkCache {
|
|
859
|
+
/** Last downloaded native query snapshot, never implied empty terrain. */
|
|
860
|
+
at(coordinate: GeometryPreparedCoordinate): GeometryPreparedEntry;
|
|
861
|
+
contains(coordinate: GeometryPreparedCoordinate): boolean;
|
|
862
|
+
/** Full requested set commits to bounded LRU only after all loads/hash/views
|
|
863
|
+
* complete. Failed batches preserve earlier same-admission snapshots. */
|
|
864
|
+
request(coordinates: ReadonlyArray<GeometryPreparedCoordinate>): Promise<void>;
|
|
865
|
+
/** Explicit render-frame work: native Deltas/recovery, visible-first load,
|
|
866
|
+
* directional prefetch and old-cache hysteresis. Caller awaits each frame. */
|
|
867
|
+
stream(focus: GeometryWorldPointRaw, options?: GeometryClientInterestOptions): Promise<GeometryClientInterest>;
|
|
868
|
+
/** Explicit current source reconciliation, including already cached chunks. */
|
|
869
|
+
/** Explicit serial native Delta application; gaps require actual source recovery. */
|
|
870
|
+
pump(): Promise<{
|
|
871
|
+
readonly applied: number;
|
|
872
|
+
readonly duplicates: number;
|
|
873
|
+
readonly obsolete: number;
|
|
874
|
+
readonly recovery: ReadonlyArray<GeometryPreparedCoordinate>;
|
|
875
|
+
}>;
|
|
876
|
+
refresh(coordinates: ReadonlyArray<GeometryPreparedCoordinate>): Promise<void>;
|
|
877
|
+
close(): Promise<void>;
|
|
878
|
+
observation(): RoomGeometryChunkCacheObservation;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
declare interface RoomGeometryChunkCacheObservation {
|
|
882
|
+
readonly cached: number;
|
|
883
|
+
readonly accountedBytes: number;
|
|
884
|
+
readonly staged: number;
|
|
885
|
+
readonly stagedBytes: number;
|
|
886
|
+
readonly active: boolean;
|
|
887
|
+
readonly withdrawn: boolean;
|
|
888
|
+
readonly stale: number;
|
|
889
|
+
readonly queuedDeltas: number;
|
|
890
|
+
readonly queuedDeltaBytes: number;
|
|
891
|
+
readonly receiving: number;
|
|
892
|
+
readonly receivingBytes: number;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
declare interface RoomInputRedundancyOptions {
|
|
896
|
+
/** Input count is a redundancy budget, never a delivery guarantee. */
|
|
897
|
+
readonly inputRedundancy: number;
|
|
898
|
+
readonly maxInputHistoryBytes: number;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
declare interface RoomOutboxCommand {
|
|
902
|
+
readonly requestId: string;
|
|
903
|
+
readonly kind: 'publish' | 'run';
|
|
904
|
+
readonly name: string;
|
|
905
|
+
readonly payload: unknown;
|
|
906
|
+
readonly key?: string;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/** Framework-free binary session core. Reservation, reconnect orchestration and
|
|
910
|
+
* render hooks are separate; this core never persists a seat token. */
|
|
911
|
+
declare interface RoomReconciliationSnapshot<S> {
|
|
912
|
+
readonly epoch: number;
|
|
913
|
+
readonly tick: number;
|
|
914
|
+
readonly lastAppliedSeq: number;
|
|
915
|
+
readonly state: S;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
declare type RoomReconnectPolicy = (input: RoomReconnectPolicyInput) => number;
|
|
919
|
+
|
|
920
|
+
declare interface RoomReconnectPolicyInput {
|
|
921
|
+
readonly attempt: number;
|
|
922
|
+
readonly initialBackoffMs: number;
|
|
923
|
+
readonly maxBackoffMs: number;
|
|
924
|
+
readonly remainingMs: number;
|
|
925
|
+
readonly random: number;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
declare interface RoomReliableLane {
|
|
929
|
+
send(frame: Uint8Array): Promise<void>;
|
|
930
|
+
onFrame(listener: (frame: Uint8Array, receivedAt: number) => void): () => void;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
declare interface RoomReservationClient<JoinInput> {
|
|
934
|
+
reserve(input: JoinInput, signal: AbortSignal): Promise<RoomClientReservation>;
|
|
935
|
+
resume(sessionId: string, signal: AbortSignal): Promise<RoomClientReservation>;
|
|
936
|
+
release?(sessionId: string, token: Uint8Array, signal: AbortSignal): Promise<void>;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
declare interface RoomRpcCaller {
|
|
940
|
+
call(tag: string, input: unknown, options: {
|
|
941
|
+
readonly signal: AbortSignal;
|
|
942
|
+
}): Promise<unknown>;
|
|
943
|
+
/** Normal framework live-query callback boundary. No polling adapter. */
|
|
944
|
+
readonly subscribe?: (tag: string, input: unknown, handlers: {
|
|
945
|
+
readonly onValue: (value: unknown) => void;
|
|
946
|
+
readonly onError?: (error: unknown) => void;
|
|
947
|
+
}) => WorldClientReceiptSubscription;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
declare type RoomSessionStatus = 'connecting' | 'joined' | 'reconnecting' | 'left' | 'kicked' | 'gone';
|
|
951
|
+
|
|
952
|
+
declare interface RoomTransport {
|
|
953
|
+
readonly name: 'ws' | 'wt';
|
|
954
|
+
readonly reliable: RoomReliableLane;
|
|
955
|
+
readonly unreliable?: RoomDatagramLane | undefined;
|
|
956
|
+
readonly signal: AbortSignal;
|
|
957
|
+
stats(): {
|
|
958
|
+
readonly rttMs: number | null;
|
|
959
|
+
readonly queuedBytes: number;
|
|
960
|
+
readonly droppedDatagrams: number;
|
|
961
|
+
};
|
|
962
|
+
close(code: number, reason: string): void;
|
|
963
|
+
/** When provided, joins actual parent/stream withdrawal and permits retry.
|
|
964
|
+
* Synchronous close alone does not establish native terminal evidence. */
|
|
965
|
+
closeAsync?(code: number, reason: string): Promise<void>;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
/** Public routing metadata only. Neither endpoint conveys seat authority. */
|
|
969
|
+
declare interface RoomTransportEndpoints {
|
|
970
|
+
readonly ws: string;
|
|
971
|
+
readonly wt?: string | undefined;
|
|
972
|
+
/** Base64 SHA-256 of a short-lived development certificate the browser pins
|
|
973
|
+
* through `serverCertificateHashes`. Absent for a publicly trusted certificate. */
|
|
974
|
+
readonly wtCertificateHash?: string | undefined;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
declare interface RoomWireManifest<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> {
|
|
978
|
+
readonly state: S;
|
|
979
|
+
readonly input: I;
|
|
980
|
+
readonly messages?: Readonly<Record<string, RoomChannel>>;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/** Render/connection coordination only: no token and no ownership assertion. */
|
|
984
|
+
declare interface RoomWorldHandoffFrame {
|
|
985
|
+
readonly kind: 'WorldHandoff';
|
|
986
|
+
readonly phase: 'departed' | 'cancelled';
|
|
987
|
+
readonly transitionId: string;
|
|
988
|
+
readonly entityId: string;
|
|
989
|
+
readonly tick: number;
|
|
990
|
+
readonly sourceEpoch: number;
|
|
991
|
+
readonly targetRoomId: string;
|
|
992
|
+
readonly targetEpoch: number;
|
|
993
|
+
readonly holdMs: number;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/** The server-owned entity an ordinary World player Session controls, as last persisted.
|
|
997
|
+
* The Room's `onJoin` receives it as `world` and builds the state entity when absent. */
|
|
998
|
+
export declare interface RoomWorldMember {
|
|
999
|
+
readonly entityId: string;
|
|
1000
|
+
readonly worldId: string;
|
|
1001
|
+
readonly zoneId: string;
|
|
1002
|
+
readonly cellId: string;
|
|
1003
|
+
readonly layer: number;
|
|
1004
|
+
readonly revision: number;
|
|
1005
|
+
/** The Room's `persistEntity` projection from the entity's last write. */
|
|
1006
|
+
readonly data: unknown;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
export declare const stageWorldGroupTransition: (app: RoomAppBridge, names: WorldTransitionCommandNames, input: WorldGroupTransitionRequest) => string;
|
|
1010
|
+
|
|
1011
|
+
/** Uses the actual synchronous memory outbox; no Effect/port/store is run here. */
|
|
1012
|
+
export declare const stageWorldTransition: (app: RoomAppBridge, names: WorldTransitionCommandNames, input: WorldTransitionRequest) => string;
|
|
1013
|
+
|
|
1014
|
+
export declare type WorldBounds = readonly [minimum: WorldPoint, maximum: WorldPoint];
|
|
1015
|
+
|
|
1016
|
+
export declare interface WorldCell {
|
|
1017
|
+
readonly id: string;
|
|
1018
|
+
readonly zone: string;
|
|
1019
|
+
readonly column: number;
|
|
1020
|
+
readonly row: number;
|
|
1021
|
+
readonly bounds: WorldBounds;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
export declare const worldCellAt: <Player>(world: WorldDescriptor<Player>, position: WorldPosition) => WorldCell;
|
|
1025
|
+
|
|
1026
|
+
/** The cell a recorded `zone:column:row` id names, with its half-open bounds. Refuses an id outside the zone grid. */
|
|
1027
|
+
export declare const worldCellById: <Player>(world: WorldDescriptor<Player>, zoneId: string, cellId: string) => WorldCell;
|
|
1028
|
+
|
|
1029
|
+
export declare interface WorldCellMovement {
|
|
1030
|
+
readonly at: WorldPoint;
|
|
1031
|
+
readonly clamped: boolean;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/** Client connection ownership only. SQL commit is confirmed by an explicit
|
|
1035
|
+
* authenticated provider; Welcome/assets/local status never prove that commit. */
|
|
1036
|
+
export declare class WorldClient<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> {
|
|
1037
|
+
private readonly options;
|
|
1038
|
+
private readonly input;
|
|
1039
|
+
private readonly handoffView;
|
|
1040
|
+
private handoffError;
|
|
1041
|
+
private readonly controller;
|
|
1042
|
+
private readonly commitWaitMs;
|
|
1043
|
+
private readonly listeners;
|
|
1044
|
+
private readonly queue;
|
|
1045
|
+
private readonly sends;
|
|
1046
|
+
private readonly receiptSubscriptions;
|
|
1047
|
+
private draining;
|
|
1048
|
+
private bytes;
|
|
1049
|
+
private active;
|
|
1050
|
+
private source;
|
|
1051
|
+
private target;
|
|
1052
|
+
private sourceGeometry;
|
|
1053
|
+
private targetGeometry;
|
|
1054
|
+
private recoveryGeometry;
|
|
1055
|
+
private preparingAssets;
|
|
1056
|
+
private earlyAssets;
|
|
1057
|
+
private earlyAssetController;
|
|
1058
|
+
private earlyAssetFailed;
|
|
1059
|
+
private readonly pendingAssetBundles;
|
|
1060
|
+
private readonly geometryAssets;
|
|
1061
|
+
private readonly geometryRenders;
|
|
1062
|
+
private detachSource;
|
|
1063
|
+
private detachTarget;
|
|
1064
|
+
private request;
|
|
1065
|
+
private prepared;
|
|
1066
|
+
private committed;
|
|
1067
|
+
private assetsReady;
|
|
1068
|
+
private operation;
|
|
1069
|
+
private closeTask;
|
|
1070
|
+
private closing;
|
|
1071
|
+
private currentError;
|
|
1072
|
+
private snapshot;
|
|
1073
|
+
constructor(offered: WorldClientOptions<S, I>);
|
|
1074
|
+
get observation(): WorldClientObservation;
|
|
1075
|
+
/** Actual selected connection identity; unknown while committed target ownership is reconciling. */
|
|
1076
|
+
get roomId(): string | null;
|
|
1077
|
+
get geometry(): RoomGeometryChunkCache | null;
|
|
1078
|
+
/** Actual selected source/target cache only, after confirmed transition
|
|
1079
|
+
* choice. Own render work separately from server transition/intent state. */
|
|
1080
|
+
renderGeometry(coordinate: GeometryPreparedCoordinate, distanceChunks: number): Promise<GeometryRenderLod>;
|
|
1081
|
+
get geometryRenderObservation(): ReturnType<GeometryRenderLodCache['observation']> | null;
|
|
1082
|
+
asset(key: string): GeometryVerifiedAsset;
|
|
1083
|
+
get assetObservation(): ReturnType<GeometryAssetBundle['observation']> | null;
|
|
1084
|
+
private admitGeometryAssets;
|
|
1085
|
+
private closeGeometry;
|
|
1086
|
+
get error(): ProtocolError | null;
|
|
1087
|
+
get state(): (S)["Type"] | null;
|
|
1088
|
+
deliveredSnapshot(): ReturnType<WorldClientRoom<S, I>['deliveredSnapshot']>;
|
|
1089
|
+
/** Render-only view. A retained source snapshot carries handoff=true and
|
|
1090
|
+
* must never feed prediction, input acknowledgements or authority decisions. */
|
|
1091
|
+
presentationSnapshot(): WorldHandoffPresentation<(S)["Type"]> | null;
|
|
1092
|
+
private presentationWork;
|
|
1093
|
+
subscribe(listener: () => void): () => void;
|
|
1094
|
+
private notify;
|
|
1095
|
+
private update;
|
|
1096
|
+
private admitRoom;
|
|
1097
|
+
private run;
|
|
1098
|
+
private stopReceipts;
|
|
1099
|
+
transition(requestId: string, intention: WorldTransitionRequest): Promise<void>;
|
|
1100
|
+
private beginRequest;
|
|
1101
|
+
/** Adopt an existing server request through its authenticated receipt. The
|
|
1102
|
+
* entity ID is presentation context, never authority. No preparation is sent. */
|
|
1103
|
+
adopt(requestId: string, entityId: string): Promise<void>;
|
|
1104
|
+
private beginAssetPrefetch;
|
|
1105
|
+
private closePendingAssetBundles;
|
|
1106
|
+
private acceptTicket;
|
|
1107
|
+
private acceptReceipt;
|
|
1108
|
+
private connectTarget;
|
|
1109
|
+
private connectAndCommit;
|
|
1110
|
+
private waitReceipt;
|
|
1111
|
+
private flush;
|
|
1112
|
+
private finishCommit;
|
|
1113
|
+
/** Unknown preparation/commit outcomes are reconciled through the same
|
|
1114
|
+
* authenticated request receipt. Never re-resolve or invent rollback. */
|
|
1115
|
+
resume(): Promise<void>;
|
|
1116
|
+
private reconcileRequest;
|
|
1117
|
+
/** Explicit native Session/root recovery, separate from SQL transition
|
|
1118
|
+
* reconciliation. No timer, default version, authorization or retry is guessed. */
|
|
1119
|
+
recoverGeometry(): Promise<void>;
|
|
1120
|
+
cancel(): Promise<void>;
|
|
1121
|
+
private finishRollback;
|
|
1122
|
+
send(input: (I)["Type"]): Promise<WorldClientInputReceipt>;
|
|
1123
|
+
private trackSend;
|
|
1124
|
+
/** Await owned client work/withdrawal only. Closing sockets never implies
|
|
1125
|
+
* server rollback, SQL deletion or removal of the retained transition. */
|
|
1126
|
+
close(): Promise<void>;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
export declare interface WorldClientGeometryAssets<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> {
|
|
1130
|
+
readonly source?: GeometryAssetBundle;
|
|
1131
|
+
/** Authenticated catalogue/grants can start before target Welcome. Return
|
|
1132
|
+
* a complete owned bundle; final native geometry root is checked later. */
|
|
1133
|
+
readonly preload?: (ticket: WorldClientTicket, signal: AbortSignal) => Promise<GeometryAssetBundle>;
|
|
1134
|
+
/** Own a fully preloaded bundle for this genuine selected target cache. */
|
|
1135
|
+
readonly prepare: (target: WorldClientTargetRoom<S, I>, geometry: RoomGeometryChunkCache, ticket: WorldClientTicket, signal: AbortSignal) => Promise<GeometryAssetBundle>;
|
|
1136
|
+
readonly recover?: (source: WorldClientRoom<S, I>, geometry: RoomGeometryChunkCache, signal: AbortSignal) => Promise<GeometryAssetBundle>;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export declare interface WorldClientGeometryBinding<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> {
|
|
1140
|
+
/** Actual immutable World catalogue for owned local render preparation. */
|
|
1141
|
+
readonly worlds?: ReadonlyArray<AnyWorldDescriptor> | undefined;
|
|
1142
|
+
readonly assets?: WorldClientGeometryAssets<S, I>;
|
|
1143
|
+
readonly render?: GeometryRenderLodCacheOptions;
|
|
1144
|
+
/** Explicit ownership transfers to this WorldClient, Session stays separate. */
|
|
1145
|
+
readonly source: RoomGeometryChunkCache;
|
|
1146
|
+
/** Actual current source manifest/authorization after reconnect/version change. */
|
|
1147
|
+
readonly recover?: (source: WorldClientRoom<S, I>, signal: AbortSignal) => Promise<RoomGeometryChunkCache>;
|
|
1148
|
+
/** Return a fully prefetched owned cache on the actual joined target. Must
|
|
1149
|
+
* join all acquisition/source work before settling, including abort. */
|
|
1150
|
+
readonly prepare: (target: WorldClientTargetRoom<S, I>, ticket: WorldClientTicket, signal: AbortSignal) => Promise<RoomGeometryChunkCache>;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
export declare interface WorldClientInputReceipt {
|
|
1154
|
+
readonly sourceSeq: number | null;
|
|
1155
|
+
readonly targetSeq: number | null;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
export declare interface WorldClientLocation {
|
|
1159
|
+
readonly worldId: string;
|
|
1160
|
+
readonly cellId: string;
|
|
1161
|
+
readonly layer: number;
|
|
1162
|
+
readonly roomId: string;
|
|
1163
|
+
readonly epoch: number;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export declare interface WorldClientObservation {
|
|
1167
|
+
readonly status: WorldClientStatus;
|
|
1168
|
+
readonly step: WorldClientStep;
|
|
1169
|
+
readonly mode: 'seamless' | 'portal' | null;
|
|
1170
|
+
readonly bufferedInputs: number;
|
|
1171
|
+
readonly bufferedBytes: number;
|
|
1172
|
+
readonly committed: boolean;
|
|
1173
|
+
readonly error: 'incomplete' | null;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
export declare interface WorldClientOptions<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> {
|
|
1177
|
+
/** One bounded live-query wait outside the Room tick; default is a budget. */
|
|
1178
|
+
readonly commitWaitMs?: number;
|
|
1179
|
+
readonly subscribeReceipt?: (requestId: string, handlers: WorldClientReceiptHandlers, signal: AbortSignal) => WorldClientReceiptSubscription;
|
|
1180
|
+
readonly source: WorldClientRoom<S, I>;
|
|
1181
|
+
readonly geometry?: WorldClientGeometryBinding<S, I> | undefined;
|
|
1182
|
+
/** Bounded presentation continuity; never changes authoritative state/input. */
|
|
1183
|
+
readonly handoffView?: WorldHandoffViewOptions<(S)["Type"]>;
|
|
1184
|
+
readonly input: I;
|
|
1185
|
+
readonly maxBufferedInputs: number;
|
|
1186
|
+
readonly maxBufferedBytes: number;
|
|
1187
|
+
readonly maxInFlightInputs: number;
|
|
1188
|
+
/** All server calls must be authenticated, bounded and request-idempotent. */
|
|
1189
|
+
readonly prepare: (requestId: string, intention: WorldTransitionRequest, signal: AbortSignal) => Promise<WorldClientTicket>;
|
|
1190
|
+
readonly observe: (requestId: string, signal: AbortSignal) => Promise<WorldClientReceipt>;
|
|
1191
|
+
readonly commit: (ticket: WorldClientTicket, signal: AbortSignal) => Promise<WorldClientReceipt>;
|
|
1192
|
+
readonly cancel: (requestId: string, signal: AbortSignal) => Promise<WorldClientReceipt>;
|
|
1193
|
+
/** Returns an unopened owned connection. start must wait for its real Welcome. */
|
|
1194
|
+
readonly createTarget: (ticket: WorldClientTicket) => WorldClientTargetRoom<S, I>;
|
|
1195
|
+
readonly prefetchAssets: (ticket: WorldClientTicket, signal: AbortSignal) => Promise<void>;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
export declare interface WorldClientReceipt {
|
|
1199
|
+
readonly ticket: WorldClientTicket;
|
|
1200
|
+
readonly phase: 'prepared' | 'committed' | 'settled' | 'rolledBack';
|
|
1201
|
+
readonly entityRevision: number | null;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
export declare const worldClientReceipt: (input: unknown) => WorldClientReceipt;
|
|
1205
|
+
|
|
1206
|
+
declare interface WorldClientReceiptHandlers {
|
|
1207
|
+
readonly onValue: (receipt: WorldClientReceipt) => void;
|
|
1208
|
+
readonly onError: (error: unknown) => void;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
export declare const WorldClientReceiptSchema: Schema.Struct<{
|
|
1212
|
+
readonly ticket: Schema.Struct<{
|
|
1213
|
+
readonly requestId: Schema.String;
|
|
1214
|
+
readonly transitionId: Schema.String;
|
|
1215
|
+
readonly mode: Schema.Literals<readonly ["seamless", "portal"]>;
|
|
1216
|
+
readonly target: Schema.Struct<{
|
|
1217
|
+
readonly worldId: Schema.String;
|
|
1218
|
+
readonly cellId: Schema.String;
|
|
1219
|
+
readonly layer: Schema.Int;
|
|
1220
|
+
readonly roomId: Schema.String;
|
|
1221
|
+
readonly epoch: Schema.Int;
|
|
1222
|
+
}>;
|
|
1223
|
+
}>;
|
|
1224
|
+
readonly phase: Schema.Literals<readonly ["prepared", "committed", "settled", "rolledBack"]>;
|
|
1225
|
+
readonly entityRevision: Schema.NullOr<Schema.Int>;
|
|
1226
|
+
}>;
|
|
1227
|
+
|
|
1228
|
+
declare interface WorldClientReceiptSubscription {
|
|
1229
|
+
unsubscribe(): void;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/** SQL origin IDs include the group command hash and full entity identity. */
|
|
1233
|
+
export declare const WorldClientRequestIdSchema: Schema.String;
|
|
1234
|
+
|
|
1235
|
+
export declare type WorldClientRoom<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> = Pick<RoomConnection<S, I, unknown>, 'status' | 'state' | 'roomId' | 'send' | 'subscribe' | 'leave' | 'deliveredSnapshot'>;
|
|
1236
|
+
|
|
1237
|
+
export declare type WorldClientStatus = 'idle' | 'preparing' | 'loading' | 'switching' | 'settled' | 'failed' | 'closed';
|
|
1238
|
+
|
|
1239
|
+
export declare type WorldClientStep = 'reserve' | 'connect' | 'welcome' | 'geometry' | 'assets' | 'commit' | 'cleanup' | null;
|
|
1240
|
+
|
|
1241
|
+
export declare interface WorldClientTargetRoom<S extends Schema.Codec<unknown, unknown>, I extends Schema.Codec<unknown, unknown>> extends WorldClientRoom<S, I> {
|
|
1242
|
+
start(ticket: WorldClientTicket): Promise<void>;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
/** Authenticated server preparation, never player-supplied authority or state. */
|
|
1246
|
+
export declare interface WorldClientTicket {
|
|
1247
|
+
readonly requestId: string;
|
|
1248
|
+
readonly transitionId: string;
|
|
1249
|
+
readonly mode: 'seamless' | 'portal';
|
|
1250
|
+
readonly target: WorldClientLocation;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
export declare const worldClientTicket: (input: unknown) => WorldClientTicket;
|
|
1254
|
+
|
|
1255
|
+
export declare const WorldClientTicketSchema: Schema.Struct<{
|
|
1256
|
+
readonly requestId: Schema.String;
|
|
1257
|
+
readonly transitionId: Schema.String;
|
|
1258
|
+
readonly mode: Schema.Literals<readonly ["seamless", "portal"]>;
|
|
1259
|
+
readonly target: Schema.Struct<{
|
|
1260
|
+
readonly worldId: Schema.String;
|
|
1261
|
+
readonly cellId: Schema.String;
|
|
1262
|
+
readonly layer: Schema.Int;
|
|
1263
|
+
readonly roomId: Schema.String;
|
|
1264
|
+
readonly epoch: Schema.Int;
|
|
1265
|
+
}>;
|
|
1266
|
+
}>;
|
|
1267
|
+
|
|
1268
|
+
/** The player a World's `spawn` receives under the default World binding (`rooms.world.join`
|
|
1269
|
+
* and `world` transitions). `spawn` is the named spawn of a `world` transition target. */
|
|
1270
|
+
export declare interface WorldDefaultPlayer {
|
|
1271
|
+
readonly id: string;
|
|
1272
|
+
readonly kind: 'user' | 'guest';
|
|
1273
|
+
readonly spawn?: string;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
export declare interface WorldDefinition<Player> {
|
|
1277
|
+
readonly name: string;
|
|
1278
|
+
readonly map: {
|
|
1279
|
+
readonly bounds: WorldBounds;
|
|
1280
|
+
};
|
|
1281
|
+
readonly zones: ReadonlyArray<WorldZone>;
|
|
1282
|
+
readonly instances?: ReadonlyArray<WorldInstance>;
|
|
1283
|
+
readonly persistence: {
|
|
1284
|
+
readonly entities: 'world';
|
|
1285
|
+
readonly snapshotEveryMs: number;
|
|
1286
|
+
readonly journal: boolean;
|
|
1287
|
+
};
|
|
1288
|
+
readonly handoff: {
|
|
1289
|
+
readonly marginUnits: number;
|
|
1290
|
+
readonly ghostUnits: number;
|
|
1291
|
+
};
|
|
1292
|
+
readonly spawn: (context: {
|
|
1293
|
+
readonly player: Player;
|
|
1294
|
+
}) => WorldPosition;
|
|
1295
|
+
readonly geometry?: WorldGeometryDefinition | undefined;
|
|
1296
|
+
readonly hosts?: {
|
|
1297
|
+
readonly pool: string;
|
|
1298
|
+
};
|
|
1299
|
+
readonly characters?: 'shared' | 'per-world';
|
|
1300
|
+
readonly transitionCooldownMs?: number;
|
|
1301
|
+
/** Authoring inventory bounds, not measured runtime capacity. */
|
|
1302
|
+
readonly budgets?: {
|
|
1303
|
+
readonly maxZones?: number;
|
|
1304
|
+
readonly maxCells?: number | undefined;
|
|
1305
|
+
readonly maxInstances?: number;
|
|
1306
|
+
};
|
|
1307
|
+
readonly strategies?: {
|
|
1308
|
+
readonly layerPolicy?: WorldLayerPolicy | undefined;
|
|
1309
|
+
readonly transitionPolicy?: WorldTransitionPolicy;
|
|
1310
|
+
readonly onWorldChange?: WorldOnWorldChange;
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
export declare interface WorldDescriptor<Player> extends Omit<WorldDefinition<Player>, 'instances' | 'budgets' | 'characters' | 'transitionCooldownMs' | 'strategies' | 'geometry'> {
|
|
1315
|
+
readonly geometry?: WorldGeometryDescriptor | undefined;
|
|
1316
|
+
readonly _tag: 'WorldDescriptor';
|
|
1317
|
+
readonly instances: ReadonlyArray<Omit<WorldInstance, 'ttl'> & {
|
|
1318
|
+
readonly ttlMs: number;
|
|
1319
|
+
}>;
|
|
1320
|
+
readonly budgets: {
|
|
1321
|
+
readonly maxZones: number;
|
|
1322
|
+
readonly maxCells: number;
|
|
1323
|
+
readonly maxInstances: number;
|
|
1324
|
+
};
|
|
1325
|
+
readonly characters: 'shared' | 'per-world';
|
|
1326
|
+
readonly transitionCooldownMs: number;
|
|
1327
|
+
readonly cellCount: number;
|
|
1328
|
+
readonly strategies: {
|
|
1329
|
+
readonly layerPolicy: WorldLayerPolicy;
|
|
1330
|
+
readonly transitionPolicy: WorldTransitionPolicy;
|
|
1331
|
+
readonly onWorldChange: WorldOnWorldChange;
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
export declare interface WorldEntityHandoffProjection<E> {
|
|
1336
|
+
readonly transitionId: string;
|
|
1337
|
+
readonly entityId: string;
|
|
1338
|
+
readonly sourceRoomId: string;
|
|
1339
|
+
readonly sourceEpoch: number;
|
|
1340
|
+
readonly sourceTick: number;
|
|
1341
|
+
readonly receivedAt: number;
|
|
1342
|
+
readonly targetRoomId: string;
|
|
1343
|
+
readonly targetEpoch: number;
|
|
1344
|
+
readonly expiresAt: number;
|
|
1345
|
+
readonly entity: E;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
export declare type WorldEntityHandoffView<S, E> = ReturnType<typeof makeWorldEntityHandoffView<S, E>>;
|
|
1349
|
+
|
|
1350
|
+
export declare interface WorldEntityHandoffViewOptions<S, E> {
|
|
1351
|
+
readonly maxEntities: number;
|
|
1352
|
+
readonly maxBytes: number;
|
|
1353
|
+
readonly maxHoldMs: number;
|
|
1354
|
+
readonly maxConnections: number;
|
|
1355
|
+
readonly now: () => number;
|
|
1356
|
+
/** Authoritative entity only. Never return a pending preview or neighbor ghost. */
|
|
1357
|
+
readonly entity: (state: S, entityId: string) => E | undefined;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
export declare interface WorldGeometryDefinition {
|
|
1361
|
+
readonly strategies?: WorldGeometryStrategies | undefined;
|
|
1362
|
+
readonly kind: GeometryKind;
|
|
1363
|
+
readonly static: GeometrySource;
|
|
1364
|
+
readonly chunkSize?: number;
|
|
1365
|
+
readonly dynamic?: {
|
|
1366
|
+
readonly enabled?: boolean | undefined;
|
|
1367
|
+
readonly maxDeltaBytesPerChunk?: number;
|
|
1368
|
+
readonly persist?: {
|
|
1369
|
+
readonly everyMs?: number;
|
|
1370
|
+
readonly onUnload?: boolean;
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
readonly collision?: {
|
|
1374
|
+
readonly derive?: 'bitgrid' | 'heightfield' | 'shapes';
|
|
1375
|
+
readonly resolution?: number;
|
|
1376
|
+
};
|
|
1377
|
+
readonly nav?: {
|
|
1378
|
+
readonly derive?: 'grid' | 'none';
|
|
1379
|
+
readonly navBudgetMs?: number;
|
|
1380
|
+
readonly maxAdvanceSteps?: number;
|
|
1381
|
+
};
|
|
1382
|
+
readonly streaming?: {
|
|
1383
|
+
readonly client?: {
|
|
1384
|
+
readonly radiusChunks?: number;
|
|
1385
|
+
readonly prefetchChunks?: number;
|
|
1386
|
+
readonly maxConcurrent?: number | undefined;
|
|
1387
|
+
readonly maxCachedChunks?: number;
|
|
1388
|
+
};
|
|
1389
|
+
readonly cell?: {
|
|
1390
|
+
readonly marginChunks?: number;
|
|
1391
|
+
};
|
|
1392
|
+
};
|
|
1393
|
+
readonly lod?: ReadonlyArray<{
|
|
1394
|
+
readonly beyondChunks: number;
|
|
1395
|
+
readonly fields: ReadonlyArray<string>;
|
|
1396
|
+
}>;
|
|
1397
|
+
readonly budgets?: {
|
|
1398
|
+
readonly maxPreparedChunks?: number;
|
|
1399
|
+
readonly maxPreparedBytes?: number;
|
|
1400
|
+
readonly maxLodLevels?: number;
|
|
1401
|
+
readonly maxRayCells?: number | undefined;
|
|
1402
|
+
readonly maxOverlapTests?: number | undefined;
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
export declare interface WorldGeometryDescriptor {
|
|
1407
|
+
readonly strategies: GeometryEditStrategies & GeometryDerivationStrategies & GeometryCompactionStrategies & {
|
|
1408
|
+
readonly migrateDelta: GeometryMigrateDelta;
|
|
1409
|
+
};
|
|
1410
|
+
readonly _tag: 'WorldGeometry';
|
|
1411
|
+
readonly kind: GeometryKind;
|
|
1412
|
+
readonly static: GeometrySource;
|
|
1413
|
+
readonly chunkSize: number;
|
|
1414
|
+
readonly chunkSizeRaw: number;
|
|
1415
|
+
readonly dynamic: {
|
|
1416
|
+
readonly enabled: boolean;
|
|
1417
|
+
readonly maxDeltaBytesPerChunk: number;
|
|
1418
|
+
readonly persist: {
|
|
1419
|
+
readonly everyMs: number;
|
|
1420
|
+
readonly onUnload: boolean;
|
|
1421
|
+
};
|
|
1422
|
+
};
|
|
1423
|
+
readonly collision: {
|
|
1424
|
+
readonly derive: 'bitgrid' | 'heightfield' | 'shapes';
|
|
1425
|
+
readonly resolution: number;
|
|
1426
|
+
readonly resolutionRaw: number;
|
|
1427
|
+
};
|
|
1428
|
+
readonly nav: {
|
|
1429
|
+
readonly derive: 'grid' | 'none';
|
|
1430
|
+
readonly navBudgetMs: number;
|
|
1431
|
+
readonly maxAdvanceSteps: number;
|
|
1432
|
+
};
|
|
1433
|
+
readonly streaming: {
|
|
1434
|
+
readonly client: {
|
|
1435
|
+
readonly radiusChunks: number;
|
|
1436
|
+
readonly prefetchChunks: number;
|
|
1437
|
+
readonly maxConcurrent: number;
|
|
1438
|
+
readonly maxCachedChunks: number;
|
|
1439
|
+
};
|
|
1440
|
+
readonly cell: {
|
|
1441
|
+
readonly marginChunks: number;
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
readonly lod: ReadonlyArray<{
|
|
1445
|
+
readonly beyondChunks: number;
|
|
1446
|
+
readonly fields: ReadonlyArray<string>;
|
|
1447
|
+
}>;
|
|
1448
|
+
readonly budgets: {
|
|
1449
|
+
readonly maxPreparedChunks: number;
|
|
1450
|
+
readonly maxPreparedBytes: number;
|
|
1451
|
+
readonly maxLodLevels: number;
|
|
1452
|
+
readonly maxRayCells: number;
|
|
1453
|
+
readonly maxOverlapTests: number;
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
export declare interface WorldGeometryStrategies extends GeometryVersionMigrationStrategies, Partial<GeometryEditStrategies>, Partial<GeometryDerivationStrategies>, Partial<GeometryCompactionStrategies> {
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
export declare interface WorldGhostNeighbor {
|
|
1461
|
+
readonly cell: WorldCell;
|
|
1462
|
+
readonly layer: number;
|
|
1463
|
+
readonly distance: number;
|
|
1464
|
+
/** Near enough for explicit Seat/snapshot preparation; not a reservation. */
|
|
1465
|
+
readonly prepare: boolean;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
export declare interface WorldGhostNeighborhoodOptions {
|
|
1469
|
+
readonly world: AnyWorldDescriptor;
|
|
1470
|
+
readonly maxZoneChecks: number;
|
|
1471
|
+
readonly maxCandidateCells: number;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
export declare type WorldGroupTransitionRequest = typeof WorldGroupTransitionRequestSchema.Type;
|
|
1475
|
+
|
|
1476
|
+
export declare const worldGroupTransitionRequest: (input: unknown) => WorldGroupTransitionRequest;
|
|
1477
|
+
|
|
1478
|
+
export declare const WorldGroupTransitionRequestSchema: Schema.Struct<{
|
|
1479
|
+
readonly partyId: Schema.String;
|
|
1480
|
+
readonly target: Schema.Union<readonly [Schema.Struct<{
|
|
1481
|
+
readonly kind: Schema.Literal<"cell">;
|
|
1482
|
+
readonly zone: Schema.String;
|
|
1483
|
+
readonly at: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1484
|
+
}>, Schema.Struct<{
|
|
1485
|
+
readonly kind: Schema.Literal<"zone">;
|
|
1486
|
+
readonly zone: Schema.String;
|
|
1487
|
+
readonly at: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1488
|
+
}>, Schema.Struct<{
|
|
1489
|
+
readonly kind: Schema.Literal<"layer">;
|
|
1490
|
+
readonly layer: Schema.Number;
|
|
1491
|
+
}>, Schema.Struct<{
|
|
1492
|
+
readonly kind: Schema.Literal<"world">;
|
|
1493
|
+
readonly world: Schema.String;
|
|
1494
|
+
readonly spawn: Schema.String;
|
|
1495
|
+
}>, Schema.Struct<{
|
|
1496
|
+
readonly kind: Schema.Literal<"instance">;
|
|
1497
|
+
readonly instance: Schema.String;
|
|
1498
|
+
readonly group: Schema.String;
|
|
1499
|
+
}>, Schema.Struct<{
|
|
1500
|
+
readonly kind: Schema.Literal<"return">;
|
|
1501
|
+
}>]>;
|
|
1502
|
+
readonly options: Schema.Struct<{
|
|
1503
|
+
readonly mode: Schema.Literals<readonly ["auto", "seamless", "portal"]>;
|
|
1504
|
+
readonly reason: Schema.String;
|
|
1505
|
+
readonly crossPool: Schema.Boolean;
|
|
1506
|
+
readonly returnTo: Schema.optional<Schema.Literal<"here">>;
|
|
1507
|
+
}>;
|
|
1508
|
+
readonly waitForAllMs: Schema.Number;
|
|
1509
|
+
readonly onTimeout: Schema.Literals<readonly ["proceed", "cancel"]>;
|
|
1510
|
+
}>;
|
|
1511
|
+
|
|
1512
|
+
export declare interface WorldHandoffConnection<S> {
|
|
1513
|
+
deliveredSnapshot(): RoomDeliveredState<S> | null;
|
|
1514
|
+
onWorldHandoff(listener: (frame: RoomWorldHandoffFrame) => void): () => void;
|
|
1515
|
+
subscribe(listener: () => void): () => void;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
export declare interface WorldHandoffPresentation<S> {
|
|
1519
|
+
readonly snapshot: RoomDeliveredState<S>;
|
|
1520
|
+
readonly handoff: boolean;
|
|
1521
|
+
readonly requestId?: string | undefined;
|
|
1522
|
+
readonly entityId?: string;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
export declare type WorldHandoffView<S> = ReturnType<typeof makeWorldHandoffView<S>>;
|
|
1526
|
+
|
|
1527
|
+
export declare interface WorldHandoffViewOptions<S> {
|
|
1528
|
+
readonly maxBytes: number;
|
|
1529
|
+
readonly maxHoldMs: number;
|
|
1530
|
+
readonly now: () => number;
|
|
1531
|
+
/** Synchronous author projection: true only for an authoritative entity in
|
|
1532
|
+
* this delivered view, never a pending preview or neighbor ghost. */
|
|
1533
|
+
readonly contains: (state: S, entityId: string) => boolean;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
export declare type WorldInspection = typeof WorldInspectionSchema.Type;
|
|
1537
|
+
|
|
1538
|
+
export declare interface WorldInspectionQuery {
|
|
1539
|
+
readonly tenantId: string;
|
|
1540
|
+
readonly worldId?: string | null;
|
|
1541
|
+
readonly after?: string | null;
|
|
1542
|
+
readonly transitionsAfter?: string | null;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
export declare const WorldInspectionSchema: Schema.Struct<{
|
|
1546
|
+
readonly worldState: Schema.Literals<readonly ["none", "entities", "transitions"]>;
|
|
1547
|
+
readonly worldClientControls: Schema.Boolean;
|
|
1548
|
+
readonly catalog: Schema.$Array<Schema.String>;
|
|
1549
|
+
readonly page: Schema.Struct<{
|
|
1550
|
+
readonly tenantId: Schema.String;
|
|
1551
|
+
readonly worldId: Schema.NullOr<Schema.String>;
|
|
1552
|
+
readonly after: Schema.NullOr<Schema.String>;
|
|
1553
|
+
readonly nextAfter: Schema.NullOr<Schema.String>;
|
|
1554
|
+
}>;
|
|
1555
|
+
readonly world: Schema.NullOr<Schema.Struct<{
|
|
1556
|
+
readonly id: Schema.String;
|
|
1557
|
+
readonly bounds: Schema.Tuple<readonly [Schema.Tuple<readonly [Schema.Number, Schema.Number]>, Schema.Tuple<readonly [Schema.Number, Schema.Number]>]>;
|
|
1558
|
+
readonly zones: Schema.$Array<Schema.Struct<{
|
|
1559
|
+
readonly id: Schema.String;
|
|
1560
|
+
readonly bounds: Schema.Tuple<readonly [Schema.Tuple<readonly [Schema.Number, Schema.Number]>, Schema.Tuple<readonly [Schema.Number, Schema.Number]>]>;
|
|
1561
|
+
readonly cellSize: Schema.NullOr<Schema.Number>;
|
|
1562
|
+
readonly maxPlayers: Schema.NullOr<Schema.Number>;
|
|
1563
|
+
}>>;
|
|
1564
|
+
readonly layerPolicy: Schema.Literals<readonly ["default", "custom"]>;
|
|
1565
|
+
readonly transitionPolicy: Schema.Literals<readonly ["default", "custom"]>;
|
|
1566
|
+
readonly worldChangePolicy: Schema.Literals<readonly ["default", "custom"]>;
|
|
1567
|
+
}>>;
|
|
1568
|
+
readonly cells: Schema.$Array<Schema.Struct<{
|
|
1569
|
+
readonly id: Schema.String;
|
|
1570
|
+
readonly zoneId: Schema.String;
|
|
1571
|
+
readonly cellId: Schema.String;
|
|
1572
|
+
readonly layer: Schema.Number;
|
|
1573
|
+
readonly bounds: Schema.Tuple<readonly [Schema.Tuple<readonly [Schema.Number, Schema.Number]>, Schema.Tuple<readonly [Schema.Number, Schema.Number]>]>;
|
|
1574
|
+
readonly players: Schema.Number;
|
|
1575
|
+
readonly epoch: Schema.Number;
|
|
1576
|
+
readonly revision: Schema.Number;
|
|
1577
|
+
readonly state: Schema.Literals<readonly ["creating", "live", "hibernated"]>;
|
|
1578
|
+
readonly roomObservation: Schema.Literals<readonly ["matching", "stale", "missing"]>;
|
|
1579
|
+
readonly updatedAt: Schema.String;
|
|
1580
|
+
}>>;
|
|
1581
|
+
readonly transitions: Schema.NullOr<Schema.Struct<{
|
|
1582
|
+
readonly after: Schema.NullOr<Schema.String>;
|
|
1583
|
+
readonly nextAfter: Schema.NullOr<Schema.String>;
|
|
1584
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
1585
|
+
readonly id: Schema.String;
|
|
1586
|
+
readonly mode: Schema.Literals<readonly ["seamless", "portal"]>;
|
|
1587
|
+
readonly phase: Schema.Literals<readonly ["requested", "reserving", "prepared", "ghosting", "persisting", "detaching", "switching", "committed", "settled", "failed", "rolledBack"]>;
|
|
1588
|
+
readonly revision: Schema.Number;
|
|
1589
|
+
readonly entityRevision: Schema.Number;
|
|
1590
|
+
readonly source: Schema.Struct<{
|
|
1591
|
+
readonly worldId: Schema.String;
|
|
1592
|
+
readonly zoneId: Schema.String;
|
|
1593
|
+
readonly cellId: Schema.String;
|
|
1594
|
+
readonly layer: Schema.Number;
|
|
1595
|
+
}>;
|
|
1596
|
+
readonly target: Schema.Struct<{
|
|
1597
|
+
readonly worldId: Schema.String;
|
|
1598
|
+
readonly zoneId: Schema.String;
|
|
1599
|
+
readonly cellId: Schema.String;
|
|
1600
|
+
readonly layer: Schema.Number;
|
|
1601
|
+
}>;
|
|
1602
|
+
readonly createdAt: Schema.String;
|
|
1603
|
+
readonly updatedAt: Schema.String;
|
|
1604
|
+
readonly committedAt: Schema.NullOr<Schema.String>;
|
|
1605
|
+
}>>;
|
|
1606
|
+
}>>;
|
|
1607
|
+
}>;
|
|
1608
|
+
|
|
1609
|
+
export declare interface WorldInstance {
|
|
1610
|
+
readonly id: string;
|
|
1611
|
+
readonly room: string;
|
|
1612
|
+
readonly maxGroups: number;
|
|
1613
|
+
readonly ttl: Duration.Input;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
export declare type WorldLayerDecision = {
|
|
1617
|
+
readonly kind: 'use';
|
|
1618
|
+
readonly layer: number;
|
|
1619
|
+
readonly wake: boolean;
|
|
1620
|
+
} | {
|
|
1621
|
+
readonly kind: 'create';
|
|
1622
|
+
readonly layer: number;
|
|
1623
|
+
} | {
|
|
1624
|
+
readonly kind: 'blocked';
|
|
1625
|
+
readonly reason: 'affinity-unavailable' | 'capacity' | 'layer-budget';
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
export declare interface WorldLayering {
|
|
1629
|
+
readonly maxPlayers: number;
|
|
1630
|
+
readonly splitAt: number;
|
|
1631
|
+
readonly mergeBelow: number;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
export declare interface WorldLayerInput {
|
|
1635
|
+
readonly policy: WorldLayering;
|
|
1636
|
+
readonly layers: ReadonlyArray<WorldLayerObservation>;
|
|
1637
|
+
readonly groupSize: number;
|
|
1638
|
+
/** Actual server-owned party affinity; never silently choose a different layer. */
|
|
1639
|
+
readonly affinity: number | null;
|
|
1640
|
+
readonly maxLayers: number;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
/** Pure maintenance proposals. Draining never moves or deletes existing players. */
|
|
1644
|
+
export declare const worldLayerMaintenance: (raw: WorldLayerMaintenanceInput) => ReadonlyArray<WorldLayerMaintenanceProposal>;
|
|
1645
|
+
|
|
1646
|
+
export declare type WorldLayerMaintenanceInput = Pick<WorldLayerInput, 'policy' | 'layers' | 'maxLayers'>;
|
|
1647
|
+
|
|
1648
|
+
export declare type WorldLayerMaintenanceProposal = {
|
|
1649
|
+
readonly kind: 'create';
|
|
1650
|
+
readonly layer: number;
|
|
1651
|
+
} | {
|
|
1652
|
+
readonly kind: 'drain' | 'hibernate' | 'dispose';
|
|
1653
|
+
readonly layer: number;
|
|
1654
|
+
};
|
|
1655
|
+
|
|
1656
|
+
export declare interface WorldLayerObservation {
|
|
1657
|
+
readonly layer: number;
|
|
1658
|
+
readonly players: number;
|
|
1659
|
+
readonly state: 'live' | 'hibernated' | 'splitting' | 'merging';
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
export declare type WorldLayerPolicy = (input: WorldLayerInput) => WorldLayerDecision;
|
|
1663
|
+
|
|
1664
|
+
export declare interface WorldMovementIntent {
|
|
1665
|
+
readonly entityId: string;
|
|
1666
|
+
readonly sourceAt: WorldPoint;
|
|
1667
|
+
readonly targetAt: WorldPoint;
|
|
1668
|
+
readonly crossing: boolean;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
export declare interface WorldMovementObservation {
|
|
1672
|
+
readonly epoch: number;
|
|
1673
|
+
readonly tick: number;
|
|
1674
|
+
readonly intents: ReadonlyArray<WorldMovementIntent>;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
export declare type WorldOnWorldChange = (input: WorldOnWorldChangeInput) => unknown;
|
|
1678
|
+
|
|
1679
|
+
export declare interface WorldOnWorldChangeInput {
|
|
1680
|
+
readonly sourceWorldId: string;
|
|
1681
|
+
readonly targetWorldId: string;
|
|
1682
|
+
/** Current server-captured character data, never a player's wire state. */
|
|
1683
|
+
readonly sourceData: unknown;
|
|
1684
|
+
/** Actual server-selected target data before this policy. */
|
|
1685
|
+
readonly targetData: unknown;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
export declare type WorldPoint = readonly [x: number, y: number];
|
|
1689
|
+
|
|
1690
|
+
export declare interface WorldPosition {
|
|
1691
|
+
readonly zone: string;
|
|
1692
|
+
readonly at: WorldPoint;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
/** The ordinary Promise client's call boundary. An Effect RPC runtime can
|
|
1696
|
+
* supply the same boundary by running its real generated client method. */
|
|
1697
|
+
export declare interface WorldRpcControls {
|
|
1698
|
+
readonly subscribeReceipt?: (requestId: string, handlers: WorldClientReceiptHandlers, signal: AbortSignal) => WorldClientReceiptSubscription;
|
|
1699
|
+
prepare(requestId: string, intention: WorldTransitionRequest, signal: AbortSignal): Promise<WorldClientTicket>;
|
|
1700
|
+
observe(requestId: string, signal: AbortSignal): Promise<WorldClientReceipt>;
|
|
1701
|
+
commit(ticket: WorldClientTicket, signal: AbortSignal): Promise<WorldClientReceipt>;
|
|
1702
|
+
cancel(requestId: string, signal: AbortSignal): Promise<WorldClientReceipt>;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/** Transition providers for WorldClient's normal authenticated RPC calls. */
|
|
1706
|
+
export declare const worldRpcControls: (client: RoomRpcCaller) => WorldRpcControls;
|
|
1707
|
+
|
|
1708
|
+
export declare interface WorldRpcPending {
|
|
1709
|
+
pending(input: {
|
|
1710
|
+
readonly entityId: string;
|
|
1711
|
+
readonly roomId: string;
|
|
1712
|
+
}, signal: AbortSignal): Promise<WorldClientReceipt | null>;
|
|
1713
|
+
readonly subscribePending?: (input: {
|
|
1714
|
+
readonly entityId: string;
|
|
1715
|
+
readonly roomId: string;
|
|
1716
|
+
}, handlers: {
|
|
1717
|
+
readonly onValue: (receipt: WorldClientReceipt | null) => void;
|
|
1718
|
+
readonly onError: (error: unknown) => void;
|
|
1719
|
+
}, signal: AbortSignal) => WorldClientReceiptSubscription;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/** Own active server-request discovery; separate from transition providers. */
|
|
1723
|
+
export declare const worldRpcPending: (client: RoomRpcCaller) => WorldRpcPending;
|
|
1724
|
+
|
|
1725
|
+
export declare const worldSpawn: <Player>(world: WorldDescriptor<Player>, player: Player) => WorldPosition;
|
|
1726
|
+
|
|
1727
|
+
/** Implemented source export inventory only. Required runtime slots/events,
|
|
1728
|
+
* installed table privacy/inspect/stages and actual whole-world conformance remain open. */
|
|
1729
|
+
export declare const worldSystemContractManifest: Readonly<{
|
|
1730
|
+
slots: Readonly<{
|
|
1731
|
+
onWorldChange: Readonly<{
|
|
1732
|
+
defaultExport: "defaultWorldOnWorldChange";
|
|
1733
|
+
fixtureExport: "worldOnWorldChangeSlotFixture";
|
|
1734
|
+
}>;
|
|
1735
|
+
layerPolicy: Readonly<{
|
|
1736
|
+
defaultExport: "defaultWorldLayerPolicy";
|
|
1737
|
+
fixtureExport: "worldLayerPolicySlotFixture";
|
|
1738
|
+
}>;
|
|
1739
|
+
transitionPolicy: Readonly<{
|
|
1740
|
+
defaultExport: "defaultWorldTransitionPolicy";
|
|
1741
|
+
fixtureExport: "worldTransitionPolicySlotFixture";
|
|
1742
|
+
}>;
|
|
1743
|
+
}>;
|
|
1744
|
+
ports: Readonly<{
|
|
1745
|
+
transition: Readonly<{
|
|
1746
|
+
tagExport: "WorldTransitionPort";
|
|
1747
|
+
fakeLayerExport: "worldTransitionFakeLayer";
|
|
1748
|
+
fixtureExport: "worldTransitionPortFixture";
|
|
1749
|
+
}>;
|
|
1750
|
+
}>;
|
|
1751
|
+
events: readonly string[];
|
|
1752
|
+
}>;
|
|
1753
|
+
|
|
1754
|
+
/** Explicit ordinary command binding, never a player RPC or automatic installer. */
|
|
1755
|
+
export declare const worldTransitionCommandBindings: (raw: WorldTransitionCommandNames, service: Context.Service.Shape<typeof WorldTransitionPort>) => RoomAppCommandBindings;
|
|
1756
|
+
|
|
1757
|
+
export declare interface WorldTransitionCommandNames {
|
|
1758
|
+
readonly transition: string;
|
|
1759
|
+
readonly transitionGroup: string;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
export declare type WorldTransitionKind = 'cell' | 'layer' | 'zone' | 'world' | 'instance' | 'return' | 'recover';
|
|
1763
|
+
|
|
1764
|
+
export declare interface WorldTransitionLocation extends WorldPosition {
|
|
1765
|
+
readonly world: string;
|
|
1766
|
+
readonly pool: string;
|
|
1767
|
+
readonly layer: number;
|
|
1768
|
+
readonly instance: string | null;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
export declare type WorldTransitionMode = 'seamless' | 'portal' | 'recover';
|
|
1772
|
+
|
|
1773
|
+
export declare interface WorldTransitionObservation {
|
|
1774
|
+
readonly phase: typeof WorldTransitionPhaseSchema.Type;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
export declare type WorldTransitionOrigin = Omit<RoomAppCommand, 'command'>;
|
|
1778
|
+
|
|
1779
|
+
export declare const worldTransitionPhases: readonly ["requested", "reserving", "prepared", "ghosting", "persisting", "detaching", "switching", "committed", "settled", "failed", "rolledBack"];
|
|
1780
|
+
|
|
1781
|
+
export declare const WorldTransitionPhaseSchema: Schema.Literals<readonly ["requested", "reserving", "prepared", "ghosting", "persisting", "detaching", "switching", "committed", "settled", "failed", "rolledBack"]>;
|
|
1782
|
+
|
|
1783
|
+
export declare interface WorldTransitionPlan {
|
|
1784
|
+
readonly kind: WorldTransitionKind;
|
|
1785
|
+
readonly mode: WorldTransitionMode;
|
|
1786
|
+
readonly crossPool: boolean;
|
|
1787
|
+
readonly persistBeforeRelease: boolean;
|
|
1788
|
+
readonly sourceCell: string;
|
|
1789
|
+
readonly targetCell: string;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
export declare type WorldTransitionPolicy = (input: WorldTransitionPolicyInput) => WorldTransitionPlan;
|
|
1793
|
+
|
|
1794
|
+
export declare interface WorldTransitionPolicyInput {
|
|
1795
|
+
readonly kind: WorldTransitionKind;
|
|
1796
|
+
readonly sourceWorld: AnyWorldDescriptor;
|
|
1797
|
+
readonly targetWorld: AnyWorldDescriptor;
|
|
1798
|
+
readonly source: WorldTransitionLocation;
|
|
1799
|
+
readonly target: WorldTransitionLocation;
|
|
1800
|
+
readonly mode: WorldTransitionMode | 'auto';
|
|
1801
|
+
readonly crossPool: boolean;
|
|
1802
|
+
/** Trusted server recovery classification, not a player intention field. */
|
|
1803
|
+
readonly recovery: boolean;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
/** Actual provider owns SQL idempotency, current source authority, lease and commit. */
|
|
1807
|
+
export declare class WorldTransitionPort extends WorldTransitionPort_base {
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
declare const WorldTransitionPort_base: Context.ServiceClass<WorldTransitionPort, "@voltro/WorldTransitionPort", {
|
|
1811
|
+
transition(input: WorldTransitionRequest, origin: WorldTransitionOrigin): Effect.Effect<void, ProtocolError>;
|
|
1812
|
+
transitionGroup(input: WorldGroupTransitionRequest, origin: WorldTransitionOrigin): Effect.Effect<void, ProtocolError>;
|
|
1813
|
+
recover(input: {
|
|
1814
|
+
readonly entityId: string;
|
|
1815
|
+
}, origin: WorldTransitionOrigin): Effect.Effect<void, ProtocolError>;
|
|
1816
|
+
status(origin: WorldTransitionOrigin): Effect.Effect<WorldTransitionObservation, ProtocolError>;
|
|
1817
|
+
}>;
|
|
1818
|
+
|
|
1819
|
+
export declare type WorldTransitionRequest = typeof WorldTransitionRequestSchema.Type;
|
|
1820
|
+
|
|
1821
|
+
export declare const worldTransitionRequest: (input: unknown) => WorldTransitionRequest;
|
|
1822
|
+
|
|
1823
|
+
export declare const WorldTransitionRequestSchema: Schema.Struct<{
|
|
1824
|
+
readonly entityId: Schema.String;
|
|
1825
|
+
readonly target: Schema.Union<readonly [Schema.Struct<{
|
|
1826
|
+
readonly kind: Schema.Literal<"cell">;
|
|
1827
|
+
readonly zone: Schema.String;
|
|
1828
|
+
readonly at: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1829
|
+
}>, Schema.Struct<{
|
|
1830
|
+
readonly kind: Schema.Literal<"zone">;
|
|
1831
|
+
readonly zone: Schema.String;
|
|
1832
|
+
readonly at: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1833
|
+
}>, Schema.Struct<{
|
|
1834
|
+
readonly kind: Schema.Literal<"layer">;
|
|
1835
|
+
readonly layer: Schema.Number;
|
|
1836
|
+
}>, Schema.Struct<{
|
|
1837
|
+
readonly kind: Schema.Literal<"world">;
|
|
1838
|
+
readonly world: Schema.String;
|
|
1839
|
+
readonly spawn: Schema.String;
|
|
1840
|
+
}>, Schema.Struct<{
|
|
1841
|
+
readonly kind: Schema.Literal<"instance">;
|
|
1842
|
+
readonly instance: Schema.String;
|
|
1843
|
+
readonly group: Schema.String;
|
|
1844
|
+
}>, Schema.Struct<{
|
|
1845
|
+
readonly kind: Schema.Literal<"return">;
|
|
1846
|
+
}>]>;
|
|
1847
|
+
readonly options: Schema.Struct<{
|
|
1848
|
+
readonly mode: Schema.Literals<readonly ["auto", "seamless", "portal"]>;
|
|
1849
|
+
readonly reason: Schema.String;
|
|
1850
|
+
readonly crossPool: Schema.Boolean;
|
|
1851
|
+
readonly returnTo: Schema.optional<Schema.Literal<"here">>;
|
|
1852
|
+
}>;
|
|
1853
|
+
}>;
|
|
1854
|
+
|
|
1855
|
+
export declare type WorldTransitionTarget = typeof WorldTransitionTargetSchema.Type;
|
|
1856
|
+
|
|
1857
|
+
export declare const WorldTransitionTargetSchema: Schema.Union<readonly [Schema.Struct<{
|
|
1858
|
+
readonly kind: Schema.Literal<"cell">;
|
|
1859
|
+
readonly zone: Schema.String;
|
|
1860
|
+
readonly at: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1861
|
+
}>, Schema.Struct<{
|
|
1862
|
+
readonly kind: Schema.Literal<"zone">;
|
|
1863
|
+
readonly zone: Schema.String;
|
|
1864
|
+
readonly at: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
1865
|
+
}>, Schema.Struct<{
|
|
1866
|
+
readonly kind: Schema.Literal<"layer">;
|
|
1867
|
+
readonly layer: Schema.Number;
|
|
1868
|
+
}>, Schema.Struct<{
|
|
1869
|
+
readonly kind: Schema.Literal<"world">;
|
|
1870
|
+
readonly world: Schema.String;
|
|
1871
|
+
readonly spawn: Schema.String;
|
|
1872
|
+
}>, Schema.Struct<{
|
|
1873
|
+
readonly kind: Schema.Literal<"instance">;
|
|
1874
|
+
readonly instance: Schema.String;
|
|
1875
|
+
readonly group: Schema.String;
|
|
1876
|
+
}>, Schema.Struct<{
|
|
1877
|
+
readonly kind: Schema.Literal<"return">;
|
|
1878
|
+
}>]>;
|
|
1879
|
+
|
|
1880
|
+
export declare interface WorldZone {
|
|
1881
|
+
readonly id: string;
|
|
1882
|
+
readonly bounds: WorldBounds;
|
|
1883
|
+
readonly room: string;
|
|
1884
|
+
readonly neighbors: ReadonlyArray<string>;
|
|
1885
|
+
readonly cells?: {
|
|
1886
|
+
readonly size: number;
|
|
1887
|
+
} | undefined;
|
|
1888
|
+
readonly layering?: WorldLayering;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
/** Half-open bounds give every shared edge one deterministic owner. */
|
|
1892
|
+
export declare const worldZoneAt: <Player>(world: WorldDescriptor<Player>, position: WorldPoint) => WorldZone;
|
|
1893
|
+
|
|
1894
|
+
export { }
|