@voltro/plugin-rooms 0.0.0-stage → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24329 -0
- package/LICENSE +61 -0
- package/README.md +9204 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +11322 -0
- package/dist/actor.js +1474 -0
- package/dist/apiBinding.js +678 -0
- package/dist/apiRegistryBinding.js +399 -0
- package/dist/apiReservations.js +433 -0
- package/dist/baselines.js +73 -0
- package/dist/bots.d.ts +1485 -0
- package/dist/bots.js +563 -0
- package/dist/catalog.js +80 -0
- package/dist/checkpointJson.js +24 -0
- package/dist/checkpointStore.js +386 -0
- package/dist/client.js +56 -0
- package/dist/clockSync.js +51 -0
- package/dist/collision.js +156 -0
- package/dist/commandDelivery.js +101 -0
- package/dist/commandRecord.js +11 -0
- package/dist/commandWithdrawal.js +183 -0
- package/dist/connection.js +497 -0
- package/dist/controlCarrier.js +375 -0
- package/dist/controlRegistry.js +79 -0
- package/dist/controlTarget.js +45 -0
- package/dist/controlTransport.js +574 -0
- package/dist/developmentBinding.js +113 -0
- package/dist/directory.js +323 -0
- package/dist/directoryProjection.js +117 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +53 -0
- package/dist/fixed.d.ts +284 -0
- package/dist/fixed.js +10 -0
- package/dist/fixed32.js +134 -0
- package/dist/fixedCollision.js +60 -0
- package/dist/fixedCollision32.js +109 -0
- package/dist/fixedMath.js +56 -0
- package/dist/fixedRaw.js +11 -0
- package/dist/fixedSlabs.js +34 -0
- package/dist/fixedTrig.js +48 -0
- package/dist/fixedTrig32.js +38 -0
- package/dist/fixedVectors.js +113 -0
- package/dist/fixedVectors32.js +95 -0
- package/dist/fixedWide.js +50 -0
- package/dist/fixedWords.js +46 -0
- package/dist/gateway.js +57 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
- package/dist/geometry-worker/worker.d.mts +2 -0
- package/dist/geometry-worker/worker.mjs +50 -0
- package/dist/geometry.d.ts +2249 -0
- package/dist/geometry.js +40 -0
- package/dist/geometryActivation.js +82 -0
- package/dist/geometryActorInventory.js +108 -0
- package/dist/geometryAdminClient.js +87 -0
- package/dist/geometryAdminData.js +32 -0
- package/dist/geometryAdminFixtures.js +50 -0
- package/dist/geometryAdminPorts.js +5 -0
- package/dist/geometryAdminRpc.js +58 -0
- package/dist/geometryAdminRpcRoutes.js +49 -0
- package/dist/geometryAdminSchemas.js +39 -0
- package/dist/geometryAdministration.js +190 -0
- package/dist/geometryAdministrationPorts.js +5 -0
- package/dist/geometryApiBinding.js +165 -0
- package/dist/geometryAppStorage.js +58 -0
- package/dist/geometryArtifacts.js +198 -0
- package/dist/geometryAssetBundle.js +117 -0
- package/dist/geometryAssetClient.js +25 -0
- package/dist/geometryAssetData.js +106 -0
- package/dist/geometryAssetHttp.js +123 -0
- package/dist/geometryAssetPorts.js +5 -0
- package/dist/geometryAssetRpc.js +30 -0
- package/dist/geometryAssetRpcRoutes.js +40 -0
- package/dist/geometryAssetStorageGrant.js +103 -0
- package/dist/geometryBoxOverlap.js +110 -0
- package/dist/geometryCatalogueDigest.js +111 -0
- package/dist/geometryCellCoverage.js +85 -0
- package/dist/geometryCellLoader.js +28 -0
- package/dist/geometryChannel.js +134 -0
- package/dist/geometryChunkHttp.js +54 -0
- package/dist/geometryChunkLeases.js +22 -0
- package/dist/geometryClient.d.ts +1429 -0
- package/dist/geometryClient.js +149 -0
- package/dist/geometryClientChunks.js +330 -0
- package/dist/geometryClientDelta.js +25 -0
- package/dist/geometryClientHttp.js +37 -0
- package/dist/geometryClientInterest.js +109 -0
- package/dist/geometryClientStatic.js +34 -0
- package/dist/geometryCms.d.ts +763 -0
- package/dist/geometryCms.js +217 -0
- package/dist/geometryCommitCoordinator.js +241 -0
- package/dist/geometryCompactionFixture.js +84 -0
- package/dist/geometryCompactionStrategies.js +38 -0
- package/dist/geometryConnectionClient.js +23 -0
- package/dist/geometryDerivationFixtures.js +141 -0
- package/dist/geometryDerivationStrategies.js +27 -0
- package/dist/geometryDigest.js +13 -0
- package/dist/geometryEditChannel.js +70 -0
- package/dist/geometryEditIngress.js +263 -0
- package/dist/geometryEdits.js +366 -0
- package/dist/geometryEnvelope.js +41 -0
- package/dist/geometryGridRaycast.js +92 -0
- package/dist/geometryGridSweep.js +92 -0
- package/dist/geometryHeightfield.js +166 -0
- package/dist/geometryHeightfieldRaycast.js +74 -0
- package/dist/geometryHeightfieldSweep.js +85 -0
- package/dist/geometryHeightfieldVolume.js +45 -0
- package/dist/geometryHost.js +322 -0
- package/dist/geometryHostDirectory.js +207 -0
- package/dist/geometryHostMutations.js +137 -0
- package/dist/geometryHostStreams.js +124 -0
- package/dist/geometryHttpBody.js +76 -0
- package/dist/geometryHttpRoutes.js +112 -0
- package/dist/geometryImportGltf.js +300 -0
- package/dist/geometryImportLdtk.js +54 -0
- package/dist/geometryImportPng.js +144 -0
- package/dist/geometryImportPublication.js +67 -0
- package/dist/geometryImportTiled.js +39 -0
- package/dist/geometryImportTiles.js +136 -0
- package/dist/geometryImportVox.js +130 -0
- package/dist/geometryImportedSource.js +101 -0
- package/dist/geometryInspectEndpoint.js +248 -0
- package/dist/geometryInspection.js +92 -0
- package/dist/geometryInstall.js +121 -0
- package/dist/geometryJournalArchiveData.js +21 -0
- package/dist/geometryJournalArchiveIndex.js +330 -0
- package/dist/geometryJournalArchiveTable.js +21 -0
- package/dist/geometryJournalCompaction.js +100 -0
- package/dist/geometryJournalPatch.js +47 -0
- package/dist/geometryJournalRetention.js +112 -0
- package/dist/geometryJournalRetentionSchemas.js +36 -0
- package/dist/geometryJournalRetentionSweep.js +112 -0
- package/dist/geometryJournalRetentionWorkflow.js +28 -0
- package/dist/geometryJournalRetentionWorkflowData.js +31 -0
- package/dist/geometryJournalStorage.js +148 -0
- package/dist/geometryLoader.js +118 -0
- package/dist/geometryManifest.js +113 -0
- package/dist/geometryManifestChannel.js +93 -0
- package/dist/geometryManifestClient.js +122 -0
- package/dist/geometryManifestData.js +49 -0
- package/dist/geometryManifestPorts.js +5 -0
- package/dist/geometryManifestPublication.js +109 -0
- package/dist/geometryManifestSource.js +68 -0
- package/dist/geometryMigrationJournal.js +14 -0
- package/dist/geometryMigrationStrategies.js +7 -0
- package/dist/geometryMigrations.js +323 -0
- package/dist/geometryNativeMetadata.js +52 -0
- package/dist/geometryPatch.js +170 -0
- package/dist/geometryPersistence.js +449 -0
- package/dist/geometryPersistenceCapture.js +69 -0
- package/dist/geometryPersistenceData.js +140 -0
- package/dist/geometryPersistencePorts.js +5 -0
- package/dist/geometryPlayerAdmission.js +34 -0
- package/dist/geometryPlayerEditOwner.js +265 -0
- package/dist/geometryPlayerEdits.js +49 -0
- package/dist/geometryPrepared.js +188 -0
- package/dist/geometryPrivacyFence.js +24 -0
- package/dist/geometryProceduralPublication.js +91 -0
- package/dist/geometryProceduralWorker.js +164 -0
- package/dist/geometryPublication.js +110 -0
- package/dist/geometryRayAlgebra.js +116 -0
- package/dist/geometryReadClient.js +157 -0
- package/dist/geometryReadPorts.js +5 -0
- package/dist/geometryReadRpc.js +27 -0
- package/dist/geometryReadRpcRoutes.js +47 -0
- package/dist/geometryReliablePublication.js +82 -0
- package/dist/geometryReloadPorts.js +46 -0
- package/dist/geometryReloadSource.js +278 -0
- package/dist/geometryRenderCache.js +165 -0
- package/dist/geometryRenderLod.js +102 -0
- package/dist/geometryRollback.js +125 -0
- package/dist/geometryRollbackCoordinator.js +203 -0
- package/dist/geometryRollbackPorts.js +46 -0
- package/dist/geometryRollbackSource.js +209 -0
- package/dist/geometryRollbackStore.js +198 -0
- package/dist/geometrySchemas.js +27 -0
- package/dist/geometryServer.d.ts +2766 -0
- package/dist/geometryServer.js +62 -0
- package/dist/geometryShapeRaycast.js +111 -0
- package/dist/geometryShapeSegments.js +34 -0
- package/dist/geometryShapes.js +223 -0
- package/dist/geometrySnapshot.js +76 -0
- package/dist/geometrySnapshotChannel.js +160 -0
- package/dist/geometrySnapshotClient.js +159 -0
- package/dist/geometrySnapshotPreparation.js +76 -0
- package/dist/geometrySnapshotServer.js +191 -0
- package/dist/geometrySqlOwner.js +21 -0
- package/dist/geometryStorage.js +127 -0
- package/dist/geometryStorageGrant.js +69 -0
- package/dist/geometryStorageIdentity.js +9 -0
- package/dist/geometryTileArtifact.js +10 -0
- package/dist/geometryTileCodec.js +194 -0
- package/dist/geometryTileCollision.js +96 -0
- package/dist/geometryTileNavigation.js +128 -0
- package/dist/geometryTileView.js +35 -0
- package/dist/geometryVersionActivation.js +114 -0
- package/dist/geometryVersionClient.js +238 -0
- package/dist/geometryVersionCompare.js +40 -0
- package/dist/geometryVersionMigration.js +106 -0
- package/dist/geometryVoxel.js +253 -0
- package/dist/geometryWorldEntitySubject.js +32 -0
- package/dist/geometryWorldExtent.js +12 -0
- package/dist/geometryWorldMetadata.js +38 -0
- package/dist/geometryWorldStrategyFixtures.js +127 -0
- package/dist/geometryWorldView.js +307 -0
- package/dist/host.js +128 -0
- package/dist/hostBinding.js +277 -0
- package/dist/hostCellObservation.js +114 -0
- package/dist/hostClientCapacity.js +90 -0
- package/dist/hostCommandScope.js +64 -0
- package/dist/hostController.js +3094 -0
- package/dist/hostDeployment.js +65 -0
- package/dist/hostDrain.js +152 -0
- package/dist/hostDrainPorts.js +5 -0
- package/dist/hostDriver.js +179 -0
- package/dist/hostLane.js +288 -0
- package/dist/hostListener.js +79 -0
- package/dist/hostListenerBinding.js +19 -0
- package/dist/hostLoopObservation.js +90 -0
- package/dist/hostMetrics.js +56 -0
- package/dist/hostRegistryBinding.js +418 -0
- package/dist/hostSelection.js +16 -0
- package/dist/hostShutdown.js +47 -0
- package/dist/hostTurnObservation.js +53 -0
- package/dist/identities.js +4 -0
- package/dist/index.d.ts +8632 -0
- package/dist/index.js +232 -0
- package/dist/inputReceipts.js +63 -0
- package/dist/inputRedundancy.js +55 -0
- package/dist/inspect.js +238 -0
- package/dist/lockstep.d.ts +436 -0
- package/dist/lockstep.js +382 -0
- package/dist/lockstepAdmission.js +262 -0
- package/dist/lockstepAdmissionCodec.js +94 -0
- package/dist/lockstepAdmissionPorts.js +5 -0
- package/dist/lockstepClientSession.js +578 -0
- package/dist/lockstepDefinition.js +148 -0
- package/dist/lockstepHostLoop.js +243 -0
- package/dist/lockstepInitialAdmission.js +67 -0
- package/dist/lockstepInitialStrategyFixtures.js +45 -0
- package/dist/lockstepJournal.js +395 -0
- package/dist/lockstepJournalCodec.js +254 -0
- package/dist/lockstepJournalPorts.js +5 -0
- package/dist/lockstepJournalRebuild.js +208 -0
- package/dist/lockstepJournalRows.js +57 -0
- package/dist/lockstepMembers.js +131 -0
- package/dist/lockstepMessages.js +47 -0
- package/dist/lockstepOwnedRoom.js +764 -0
- package/dist/lockstepPolicies.js +84 -0
- package/dist/lockstepReact.js +47 -0
- package/dist/lockstepRecoveryTruth.js +121 -0
- package/dist/lockstepRosterConfig.js +32 -0
- package/dist/lockstepSeed.js +12 -0
- package/dist/lockstepSeedFixture.js +20 -0
- package/dist/lockstepServer.d.ts +3897 -0
- package/dist/lockstepServer.js +325 -0
- package/dist/lockstepServerConfig.js +101 -0
- package/dist/lockstepServerRoles.js +403 -0
- package/dist/lockstepServerStrategyFixtures.js +33 -0
- package/dist/lockstepStrategies.js +6 -0
- package/dist/lockstepStrategyFixtures.js +137 -0
- package/dist/lockstepTerminal.js +90 -0
- package/dist/lockstepTerminalPorts.js +5 -0
- package/dist/lockstepTransport.js +773 -0
- package/dist/lockstepTransportConfig.js +32 -0
- package/dist/lockstepWireRoster.js +34 -0
- package/dist/matchRoomProvider.js +32 -0
- package/dist/matchRooms.js +19 -0
- package/dist/membershipObserver.js +47 -0
- package/dist/moderation.js +98 -0
- package/dist/movementSpecials.js +104 -0
- package/dist/ownership.js +17 -0
- package/dist/ownershipWithdrawal.js +18 -0
- package/dist/pcg32.js +96 -0
- package/dist/ports.d.ts +1241 -0
- package/dist/ports.js +11 -0
- package/dist/quaternion.js +70 -0
- package/dist/react.d.ts +406 -0
- package/dist/react.js +109 -0
- package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
- package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
- package/dist/reaper.js +243 -0
- package/dist/reaperSchemas.js +42 -0
- package/dist/reaperWorkflow.js +70 -0
- package/dist/recovery.js +189 -0
- package/dist/recoverySeats.js +26 -0
- package/dist/replay.d.ts +273 -0
- package/dist/replay.js +485 -0
- package/dist/replayPorts.js +5 -0
- package/dist/replayRecording.js +67 -0
- package/dist/replaySchema.js +157 -0
- package/dist/replayStorage.d.ts +149 -0
- package/dist/replayStorage.js +485 -0
- package/dist/reservationBatch.js +422 -0
- package/dist/reservationSchemas.js +17 -0
- package/dist/reservations.js +259 -0
- package/dist/reservePort.js +69 -0
- package/dist/resolvedOptions.js +4 -0
- package/dist/room.d.ts +1006 -0
- package/dist/room.js +284 -0
- package/dist/roomAccessSweep.js +95 -0
- package/dist/roomAppCommandControl.js +59 -0
- package/dist/roomAuthoringStrategy.js +17 -0
- package/dist/roomErasure.js +198 -0
- package/dist/roomPoolRuntimeDefaults.js +24 -0
- package/dist/roomPoolSelection.js +19 -0
- package/dist/roomPoolTopology.js +212 -0
- package/dist/rpc.d.ts +551 -0
- package/dist/rpc.js +112 -0
- package/dist/rpcClient.js +152 -0
- package/dist/rpcRoutes.js +28 -0
- package/dist/runtime.js +1123 -0
- package/dist/schemaHistory.js +98 -0
- package/dist/seatStore.js +151 -0
- package/dist/seatStrategyFixtures.js +52 -0
- package/dist/seatSubject.js +32 -0
- package/dist/seats.js +130 -0
- package/dist/serverSession.js +811 -0
- package/dist/serverSessionConfig.js +43 -0
- package/dist/sessionAdmission.js +53 -0
- package/dist/sidecarAdmission.js +103 -0
- package/dist/sidecarConfig.js +116 -0
- package/dist/sidecarConfigPublication.js +64 -0
- package/dist/sidecarHostListener.js +208 -0
- package/dist/sidecarIpc.js +205 -0
- package/dist/sidecarPeer.js +310 -0
- package/dist/sidecarProcessPort.js +28 -0
- package/dist/sidecarRuntime.js +168 -0
- package/dist/sidecarSelection.js +142 -0
- package/dist/sidecarWire.js +178 -0
- package/dist/sidecarWrites.js +163 -0
- package/dist/simulation.d.ts +391 -0
- package/dist/simulation.js +282 -0
- package/dist/simulationAuthoring.js +29 -0
- package/dist/simulationBytes.js +27 -0
- package/dist/simulationConformance.js +305 -0
- package/dist/simulationInputHistoryCapture.js +35 -0
- package/dist/simulationInputHistoryWire.js +193 -0
- package/dist/simulationOptionsWire.js +78 -0
- package/dist/simulationRecoveryWire.js +134 -0
- package/dist/simulationReplay.js +127 -0
- package/dist/simulationSnapshotWire.js +112 -0
- package/dist/simulationState.js +178 -0
- package/dist/snapshotBlob.js +126 -0
- package/dist/snapshotBlobCleanup.js +93 -0
- package/dist/snapshotBlobIndex.js +38 -0
- package/dist/snapshotBudget.js +80 -0
- package/dist/snapshotChain.js +185 -0
- package/dist/snapshotErasure.js +172 -0
- package/dist/snapshotInspection.js +105 -0
- package/dist/snapshotSegmentBlobs.js +58 -0
- package/dist/snapshotUploads.js +166 -0
- package/dist/socketTransport.js +253 -0
- package/dist/spatial.js +104 -0
- package/dist/spectatorPolicy.js +26 -0
- package/dist/spectatorProducer.js +89 -0
- package/dist/startFailureCause.js +4 -0
- package/dist/stateCodec.js +658 -0
- package/dist/strategies.d.ts +210 -0
- package/dist/strategies.js +8 -0
- package/dist/strategiesServer.d.ts +286 -0
- package/dist/strategiesServer.js +11 -0
- package/dist/strategyFixtures.js +182 -0
- package/dist/streamFraming.js +122 -0
- package/dist/streamTransport.js +266 -0
- package/dist/subjectAdmission.js +50 -0
- package/dist/subjectPrivacy.js +281 -0
- package/dist/subjectPrivacyBinding.js +90 -0
- package/dist/systemManifest.js +182 -0
- package/dist/tables.js +159 -0
- package/dist/testHarness.js +89 -0
- package/dist/testing.d.ts +3684 -0
- package/dist/testing.js +221 -0
- package/dist/testingPorts.js +271 -0
- package/dist/testingServer.d.ts +4060 -0
- package/dist/testingServer.js +18 -0
- package/dist/transform.d.ts +692 -0
- package/dist/transform.js +217 -0
- package/dist/transform3d.js +118 -0
- package/dist/transformCollection.js +24 -0
- package/dist/transformCollection3d.js +24 -0
- package/dist/transformCollectionCore.js +156 -0
- package/dist/transformFrames.js +121 -0
- package/dist/transformPrediction3d.js +127 -0
- package/dist/transformRules.js +123 -0
- package/dist/transformSchemas.js +20 -0
- package/dist/transport.js +32 -0
- package/dist/transportAuthoring.js +29 -0
- package/dist/transportCleanup.js +22 -0
- package/dist/transportConformance.js +124 -0
- package/dist/transportConnector.js +82 -0
- package/dist/transportEndpoints.js +38 -0
- package/dist/transportsServer.d.ts +5515 -0
- package/dist/transportsServer.js +6 -0
- package/dist/viewProjection.js +16 -0
- package/dist/web.d.ts +2286 -0
- package/dist/web.js +518 -0
- package/dist/webTransportClient.js +173 -0
- package/dist/wire.d.ts +992 -0
- package/dist/wire.js +492 -0
- package/dist/withdrawalPort.js +28 -0
- package/dist/world.d.ts +1894 -0
- package/dist/world.js +333 -0
- package/dist/worldActorReceipts.js +48 -0
- package/dist/worldActorTransferSnapshot.js +14 -0
- package/dist/worldAdmissionPending.js +8 -0
- package/dist/worldBoundaryCoordinator.js +148 -0
- package/dist/worldCatalog.js +81 -0
- package/dist/worldCellAllocation.js +203 -0
- package/dist/worldCellDestination.js +68 -0
- package/dist/worldCells.js +489 -0
- package/dist/worldChange.js +32 -0
- package/dist/worldClient.js +664 -0
- package/dist/worldClientControl.js +141 -0
- package/dist/worldClientPendingInput.js +16 -0
- package/dist/worldClientRpc.js +133 -0
- package/dist/worldClientRpcRoutes.js +43 -0
- package/dist/worldClientSchemas.js +28 -0
- package/dist/worldCommands.js +140 -0
- package/dist/worldData.js +42 -0
- package/dist/worldDefaultBinding.js +377 -0
- package/dist/worldDefaultGroupAdmission.js +82 -0
- package/dist/worldDefaultGroupAppServices.js +31 -0
- package/dist/worldDefaultGroupCompensation.js +109 -0
- package/dist/worldDefaultGroupContinuation.js +96 -0
- package/dist/worldDefaultGroupControl.js +72 -0
- package/dist/worldDefaultGroupMembers.js +85 -0
- package/dist/worldDefaultGroups.js +21 -0
- package/dist/worldDefaultPending.js +79 -0
- package/dist/worldDefaultService.js +245 -0
- package/dist/worldEntities.js +2980 -0
- package/dist/worldEntityCodec.js +21 -0
- package/dist/worldEntityHandoffView.js +154 -0
- package/dist/worldGeometry.js +170 -0
- package/dist/worldGhostAdmission.js +65 -0
- package/dist/worldGhostDestination.js +118 -0
- package/dist/worldGhostGateway.js +132 -0
- package/dist/worldGhostHandshake.js +108 -0
- package/dist/worldGhostHost.js +42 -0
- package/dist/worldGhostIngress.js +132 -0
- package/dist/worldGhostNeighborhood.js +70 -0
- package/dist/worldGhostNeighbors.js +86 -0
- package/dist/worldGhostOutbound.js +110 -0
- package/dist/worldGhostPublisher.js +216 -0
- package/dist/worldGhostReceiver.js +213 -0
- package/dist/worldGhostSender.js +146 -0
- package/dist/worldGhostSocket.js +78 -0
- package/dist/worldGhostWire.js +172 -0
- package/dist/worldGroupCommand.js +49 -0
- package/dist/worldGroupDeadline.js +115 -0
- package/dist/worldGroupPreparation.js +115 -0
- package/dist/worldGroupReadyControl.js +128 -0
- package/dist/worldGroupSupervisor.js +120 -0
- package/dist/worldHandoffMetrics.js +59 -0
- package/dist/worldHandoffView.js +100 -0
- package/dist/worldHostSource.js +69 -0
- package/dist/worldInspectEndpoint.js +250 -0
- package/dist/worldInspection.js +109 -0
- package/dist/worldInstanceAdmission.js +31 -0
- package/dist/worldInstanceAllocation.js +116 -0
- package/dist/worldInstanceDestination.js +64 -0
- package/dist/worldInstanceExpiry.js +282 -0
- package/dist/worldInstanceExpirySupervisor.js +88 -0
- package/dist/worldInstanceLifecycle.js +103 -0
- package/dist/worldInstanceState.js +52 -0
- package/dist/worldInstances.js +478 -0
- package/dist/worldJoin.js +56 -0
- package/dist/worldLayers.js +151 -0
- package/dist/worldLeases.js +78 -0
- package/dist/worldManifest.js +25 -0
- package/dist/worldMovement.js +63 -0
- package/dist/worldPersistence.js +134 -0
- package/dist/worldProjection.js +221 -0
- package/dist/worldReact.js +110 -0
- package/dist/worldRecoveryActor.js +35 -0
- package/dist/worldReturnAnchor.js +49 -0
- package/dist/worldRoomHooks.js +57 -0
- package/dist/worldRoomPool.js +27 -0
- package/dist/worldRoomSteps.js +133 -0
- package/dist/worldSeatBinding.js +36 -0
- package/dist/worldServer.d.ts +6936 -0
- package/dist/worldServer.js +48 -0
- package/dist/worldSourceSeatPending.js +9 -0
- package/dist/worldStrategyFixtures.js +164 -0
- package/dist/worldTesting.js +27 -0
- package/dist/worldTransitionDefaults.js +198 -0
- package/dist/worldTransitionExecutor.js +519 -0
- package/dist/worldTransitionGroup.js +113 -0
- package/dist/worldTransitionPhysicalSteps.js +40 -0
- package/dist/worldTransitionResolver.js +228 -0
- package/dist/worldTransitionSeatGroup.js +64 -0
- package/dist/worldTransitionSeats.js +260 -0
- package/dist/worldTransitionState.js +95 -0
- package/dist/worldTransitions.js +101 -0
- package/package.json +189 -4
package/dist/world.js
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { RoomAuthoringError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldGeometry as t, cmsGeometry as n, importedGeometry as r, procedural as i } from "./worldGeometry.js";
|
|
3
|
+
import { defaultWorldLayerPolicy as a, resolveWorldLayerPolicy as o, worldLayerMaintenance as s } from "./worldLayers.js";
|
|
4
|
+
import { defaultWorldOnWorldChange as c, resolveWorldOnWorldChange as l } from "./worldChange.js";
|
|
5
|
+
import { defaultWorldTransitionPolicy as u, resolveWorldTransitionPolicy as d } from "./worldTransitions.js";
|
|
6
|
+
import { worldSystemContractManifest as f } from "./worldManifest.js";
|
|
7
|
+
import { WorldGroupTransitionRequestSchema as p, WorldTransitionPhaseSchema as m, WorldTransitionPort as h, WorldTransitionRequestSchema as g, WorldTransitionTargetSchema as _, stageWorldGroupTransition as v, stageWorldTransition as y, worldGroupTransitionRequest as b, worldTransitionCommandBindings as x, worldTransitionPhases as S, worldTransitionRequest as C } from "./worldCommands.js";
|
|
8
|
+
import { WorldInspectionSchema as w, decodeWorldInspection as T } from "./worldInspection.js";
|
|
9
|
+
import { WorldClientReceiptSchema as E, WorldClientRequestIdSchema as D, WorldClientTicketSchema as O } from "./worldClientSchemas.js";
|
|
10
|
+
import { makeWorldHandoffView as k } from "./worldHandoffView.js";
|
|
11
|
+
import { worldRpcControls as A, worldRpcPending as ee } from "./rpcClient.js";
|
|
12
|
+
import { makeWorldEntityHandoffView as j } from "./worldEntityHandoffView.js";
|
|
13
|
+
import { WorldClient as M, worldClientReceipt as N, worldClientTicket as P } from "./worldClient.js";
|
|
14
|
+
import { makeWorldGhostNeighborhood as F } from "./worldGhostNeighborhood.js";
|
|
15
|
+
import { makeWorldCellMovement as I } from "./worldMovement.js";
|
|
16
|
+
import { Duration as L } from "effect";
|
|
17
|
+
//#region src/world.ts
|
|
18
|
+
function R(t) {
|
|
19
|
+
throw new e({
|
|
20
|
+
room: "world",
|
|
21
|
+
detail: t
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
var z = (e) => typeof e == "string" && /^[A-Za-z0-9][A-Za-z0-9_-]{0,119}$/.test(e) ? e : R("World names must be nonempty bounded identifiers"), B = (e) => Number.isFinite(e) ? e : R("World coordinates must be finite"), V = (e) => Number.isFinite(e) && e > 0 ? e : R("World dimensions must be positive and finite"), H = (e, t = !1) => Number.isSafeInteger(e) && e >= +!t ? e : R("World counts and durations must be safe whole numbers"), U = (e, t) => {
|
|
25
|
+
(typeof e != "object" || !e || Object.getPrototypeOf(e) !== Object.prototype) && R("World configuration must use plain own data");
|
|
26
|
+
for (let n of Reflect.ownKeys(e)) {
|
|
27
|
+
let r = Object.getOwnPropertyDescriptor(e, n);
|
|
28
|
+
(typeof n != "string" || !t.includes(n) || !r?.enumerable || !("value" in r)) && R("Unknown or accessor World configuration field");
|
|
29
|
+
}
|
|
30
|
+
}, W = (e, t) => {
|
|
31
|
+
(!Array.isArray(e) || e.length > t || Reflect.ownKeys(e).length !== e.length + 1) && R("Invalid or over-budget World list");
|
|
32
|
+
for (let t = 0; t < e.length; t++) {
|
|
33
|
+
let n = Object.getOwnPropertyDescriptor(e, String(t));
|
|
34
|
+
(!n?.enumerable || !("value" in n)) && R("World lists must contain own data entries");
|
|
35
|
+
}
|
|
36
|
+
}, G = (e) => (W(e, 2), e.length !== 2 && R("World points require two coordinates"), Object.freeze([B(e[0]), B(e[1])])), K = (e, t, n, r) => (B(e), B(t), B(n), B(r), V(n - e), V(r - t), Object.freeze([Object.freeze([e, t]), Object.freeze([n, r])])), q = (e) => {
|
|
37
|
+
W(e, 2), e.length !== 2 && R("World bounds require minimum and maximum");
|
|
38
|
+
let t = G(e[0]), n = G(e[1]);
|
|
39
|
+
return K(t[0], t[1], n[0], n[1]);
|
|
40
|
+
}, J = (e, t) => t[0] >= e[0][0] && t[0] < e[1][0] && t[1] >= e[0][1] && t[1] < e[1][1], Y = (e) => {
|
|
41
|
+
let t = e.cells?.size;
|
|
42
|
+
return t === void 0 ? {
|
|
43
|
+
columns: 1,
|
|
44
|
+
rows: 1,
|
|
45
|
+
size: Math.max(e.bounds[1][0] - e.bounds[0][0], e.bounds[1][1] - e.bounds[0][1])
|
|
46
|
+
} : {
|
|
47
|
+
columns: Math.ceil((e.bounds[1][0] - e.bounds[0][0]) / t),
|
|
48
|
+
rows: Math.ceil((e.bounds[1][1] - e.bounds[0][1]) / t),
|
|
49
|
+
size: t
|
|
50
|
+
};
|
|
51
|
+
}, X = (e) => {
|
|
52
|
+
U(e, [
|
|
53
|
+
"name",
|
|
54
|
+
"map",
|
|
55
|
+
"zones",
|
|
56
|
+
"instances",
|
|
57
|
+
"persistence",
|
|
58
|
+
"handoff",
|
|
59
|
+
"spawn",
|
|
60
|
+
"hosts",
|
|
61
|
+
"characters",
|
|
62
|
+
"transitionCooldownMs",
|
|
63
|
+
"budgets",
|
|
64
|
+
"strategies",
|
|
65
|
+
"geometry"
|
|
66
|
+
]);
|
|
67
|
+
let n = z(e.name), r = Object.hasOwn(e, "geometry") ? t(e.geometry, n) : void 0;
|
|
68
|
+
U(e.map, ["bounds"]);
|
|
69
|
+
let i = Object.freeze({ bounds: q(e.map.bounds) });
|
|
70
|
+
e.budgets !== void 0 && U(e.budgets, [
|
|
71
|
+
"maxZones",
|
|
72
|
+
"maxCells",
|
|
73
|
+
"maxInstances"
|
|
74
|
+
]);
|
|
75
|
+
let o = Object.freeze({
|
|
76
|
+
maxZones: H(e.budgets?.maxZones ?? 256),
|
|
77
|
+
maxCells: H(e.budgets?.maxCells ?? 65536),
|
|
78
|
+
maxInstances: H(e.budgets?.maxInstances ?? 256)
|
|
79
|
+
});
|
|
80
|
+
W(e.zones, o.maxZones), e.zones.length || R("A World requires at least one Zone");
|
|
81
|
+
let s = /* @__PURE__ */ new Set(), l = 0, d = e.zones.map((e) => {
|
|
82
|
+
U(e, [
|
|
83
|
+
"id",
|
|
84
|
+
"bounds",
|
|
85
|
+
"room",
|
|
86
|
+
"neighbors",
|
|
87
|
+
"cells",
|
|
88
|
+
"layering"
|
|
89
|
+
]);
|
|
90
|
+
let t = z(e.id), n = z(e.room), r = q(e.bounds);
|
|
91
|
+
s.has(t) && R("Duplicate World Zone"), s.add(t), (r[0][0] < i.bounds[0][0] || r[0][1] < i.bounds[0][1] || r[1][0] > i.bounds[1][0] || r[1][1] > i.bounds[1][1]) && R("Zone bounds must stay inside the World map"), W(e.neighbors, o.maxZones);
|
|
92
|
+
let a = Object.freeze(e.neighbors.map(z));
|
|
93
|
+
(new Set(a).size !== a.length || a.includes(t)) && R("Zone neighbors must be unique and exclude itself"), e.cells !== void 0 && U(e.cells, ["size"]);
|
|
94
|
+
let c = e.cells === void 0 ? void 0 : Object.freeze({ size: V(e.cells.size) });
|
|
95
|
+
e.layering !== void 0 && U(e.layering, [
|
|
96
|
+
"maxPlayers",
|
|
97
|
+
"splitAt",
|
|
98
|
+
"mergeBelow"
|
|
99
|
+
]);
|
|
100
|
+
let u = e.layering === void 0 ? void 0 : Object.freeze({
|
|
101
|
+
maxPlayers: H(e.layering.maxPlayers),
|
|
102
|
+
splitAt: H(e.layering.splitAt),
|
|
103
|
+
mergeBelow: H(e.layering.mergeBelow, !0)
|
|
104
|
+
});
|
|
105
|
+
u !== void 0 && (u.mergeBelow >= u.splitAt || u.splitAt >= u.maxPlayers) && R("Layering requires mergeBelow < splitAt < maxPlayers");
|
|
106
|
+
let d = Object.freeze({
|
|
107
|
+
id: t,
|
|
108
|
+
room: n,
|
|
109
|
+
bounds: r,
|
|
110
|
+
neighbors: a,
|
|
111
|
+
...c === void 0 ? {} : { cells: c },
|
|
112
|
+
...u === void 0 ? {} : { layering: u }
|
|
113
|
+
}), f = Y(d), p = f.columns * f.rows;
|
|
114
|
+
return (!Number.isSafeInteger(p) || p < 1 || p > o.maxCells - l) && R("World cell inventory exceeds its authoring budget"), l += p, d;
|
|
115
|
+
});
|
|
116
|
+
for (let e of d) for (let t of e.neighbors) {
|
|
117
|
+
let n = d.find((e) => e.id === t);
|
|
118
|
+
(!n || !n.neighbors.includes(e.id)) && R("World neighbors must exist and be reciprocal");
|
|
119
|
+
}
|
|
120
|
+
for (let e = 0; e < d.length; e++) for (let t = e + 1; t < d.length; t++) {
|
|
121
|
+
let n = d[e].bounds, r = d[t].bounds;
|
|
122
|
+
Math.max(n[0][0], r[0][0]) < Math.min(n[1][0], r[1][0]) && Math.max(n[0][1], r[0][1]) < Math.min(n[1][1], r[1][1]) && R("World Zone interiors must not overlap");
|
|
123
|
+
}
|
|
124
|
+
W(e.instances ?? [], o.maxInstances);
|
|
125
|
+
let f = /* @__PURE__ */ new Set(), p = (e.instances ?? []).map((e) => {
|
|
126
|
+
U(e, [
|
|
127
|
+
"id",
|
|
128
|
+
"room",
|
|
129
|
+
"maxGroups",
|
|
130
|
+
"ttl"
|
|
131
|
+
]);
|
|
132
|
+
let t = z(e.id), n = z(e.room);
|
|
133
|
+
(f.has(t) || s.has(t)) && R("World Instance identifiers must be unique"), f.add(t);
|
|
134
|
+
let r;
|
|
135
|
+
try {
|
|
136
|
+
r = L.toMillis(e.ttl);
|
|
137
|
+
} catch {
|
|
138
|
+
return R("Invalid World Instance duration");
|
|
139
|
+
}
|
|
140
|
+
return Object.freeze({
|
|
141
|
+
id: t,
|
|
142
|
+
room: n,
|
|
143
|
+
maxGroups: H(e.maxGroups),
|
|
144
|
+
ttlMs: H(r)
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
U(e.persistence, [
|
|
148
|
+
"entities",
|
|
149
|
+
"snapshotEveryMs",
|
|
150
|
+
"journal"
|
|
151
|
+
]), (e.persistence.entities !== "world" || typeof e.persistence.journal != "boolean") && R("Invalid World persistence policy");
|
|
152
|
+
let m = Object.freeze({
|
|
153
|
+
entities: "world",
|
|
154
|
+
snapshotEveryMs: H(e.persistence.snapshotEveryMs),
|
|
155
|
+
journal: e.persistence.journal
|
|
156
|
+
});
|
|
157
|
+
U(e.handoff, ["marginUnits", "ghostUnits"]);
|
|
158
|
+
let h = Object.freeze({
|
|
159
|
+
marginUnits: V(e.handoff.marginUnits),
|
|
160
|
+
ghostUnits: V(e.handoff.ghostUnits)
|
|
161
|
+
});
|
|
162
|
+
h.marginUnits > h.ghostUnits && R("Handoff margin cannot exceed the ghost range"), typeof e.spawn != "function" && R("World spawn requires an author-owned function"), e.hosts !== void 0 && U(e.hosts, ["pool"]);
|
|
163
|
+
let g = e.hosts === void 0 ? void 0 : Object.freeze({ pool: z(e.hosts.pool) }), _ = e.characters ?? "shared";
|
|
164
|
+
_ !== "shared" && _ !== "per-world" && R("Invalid World character policy"), e.strategies !== void 0 && U(e.strategies, [
|
|
165
|
+
"layerPolicy",
|
|
166
|
+
"transitionPolicy",
|
|
167
|
+
"onWorldChange"
|
|
168
|
+
]);
|
|
169
|
+
let v = e.strategies?.layerPolicy ?? a, y = e.strategies?.transitionPolicy ?? u, b = e.strategies?.onWorldChange ?? c;
|
|
170
|
+
return typeof b != "function" && R("World change requires a synchronous strategy"), (typeof v != "function" || typeof y != "function") && R("World policies require synchronous strategies"), Object.freeze({
|
|
171
|
+
_tag: "WorldDescriptor",
|
|
172
|
+
name: n,
|
|
173
|
+
map: i,
|
|
174
|
+
zones: Object.freeze(d),
|
|
175
|
+
instances: Object.freeze(p),
|
|
176
|
+
persistence: m,
|
|
177
|
+
handoff: h,
|
|
178
|
+
spawn: e.spawn,
|
|
179
|
+
...r === void 0 ? {} : { geometry: r },
|
|
180
|
+
...g === void 0 ? {} : { hosts: g },
|
|
181
|
+
characters: _,
|
|
182
|
+
transitionCooldownMs: H(e.transitionCooldownMs ?? 2e3, !0),
|
|
183
|
+
budgets: o,
|
|
184
|
+
cellCount: l,
|
|
185
|
+
strategies: Object.freeze({
|
|
186
|
+
layerPolicy: v,
|
|
187
|
+
transitionPolicy: y,
|
|
188
|
+
onWorldChange: b
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}, Z = /* @__PURE__ */ new WeakSet(), Q = (e) => {
|
|
192
|
+
if (Z.has(e)) return;
|
|
193
|
+
let n = [e], r = /* @__PURE__ */ new Set();
|
|
194
|
+
for (; n.length > 0;) {
|
|
195
|
+
let e = n.pop();
|
|
196
|
+
if (typeof e != "object" || !e || r.has(e)) continue;
|
|
197
|
+
r.add(e), Object.isFrozen(e) || R("World catalogue definitions must be deeply immutable");
|
|
198
|
+
let t = Reflect.ownKeys(e);
|
|
199
|
+
Array.isArray(e) ? W(e, e.length) : U(e, t.filter((e) => typeof e == "string"));
|
|
200
|
+
for (let r of t) {
|
|
201
|
+
if (Array.isArray(e) && r === "length") continue;
|
|
202
|
+
let t = Object.getOwnPropertyDescriptor(e, r);
|
|
203
|
+
(!t?.enumerable || !("value" in t)) && R("World catalogue definitions require own data"), n.push(t.value);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
for (let t of [
|
|
208
|
+
"name",
|
|
209
|
+
"map",
|
|
210
|
+
"zones",
|
|
211
|
+
"instances",
|
|
212
|
+
"persistence",
|
|
213
|
+
"handoff",
|
|
214
|
+
"spawn",
|
|
215
|
+
"characters",
|
|
216
|
+
"transitionCooldownMs",
|
|
217
|
+
"budgets",
|
|
218
|
+
"cellCount",
|
|
219
|
+
"strategies"
|
|
220
|
+
]) Object.hasOwn(e, t) || R("Incomplete immutable World descriptor");
|
|
221
|
+
U(e.strategies, [
|
|
222
|
+
"layerPolicy",
|
|
223
|
+
"transitionPolicy",
|
|
224
|
+
"onWorldChange"
|
|
225
|
+
]);
|
|
226
|
+
for (let t of [
|
|
227
|
+
"layerPolicy",
|
|
228
|
+
"transitionPolicy",
|
|
229
|
+
"onWorldChange"
|
|
230
|
+
]) {
|
|
231
|
+
let n = Object.getOwnPropertyDescriptor(e.strategies, t);
|
|
232
|
+
(!n || !("value" in n) || typeof n.value != "function") && R("World descriptor requires complete policy slots");
|
|
233
|
+
}
|
|
234
|
+
U(e.budgets, [
|
|
235
|
+
"maxZones",
|
|
236
|
+
"maxCells",
|
|
237
|
+
"maxInstances"
|
|
238
|
+
]), H(e.budgets.maxZones), H(e.budgets.maxCells), H(e.budgets.maxInstances), W(e.instances, e.budgets.maxInstances);
|
|
239
|
+
let n = e.instances.map((e) => (U(e, [
|
|
240
|
+
"id",
|
|
241
|
+
"room",
|
|
242
|
+
"maxGroups",
|
|
243
|
+
"ttlMs"
|
|
244
|
+
]), {
|
|
245
|
+
id: e.id,
|
|
246
|
+
room: e.room,
|
|
247
|
+
maxGroups: e.maxGroups,
|
|
248
|
+
ttl: H(e.ttlMs)
|
|
249
|
+
})), r = X({
|
|
250
|
+
name: e.name,
|
|
251
|
+
map: e.map,
|
|
252
|
+
zones: e.zones,
|
|
253
|
+
instances: n,
|
|
254
|
+
persistence: e.persistence,
|
|
255
|
+
handoff: e.handoff,
|
|
256
|
+
spawn: e.spawn,
|
|
257
|
+
...e.hosts === void 0 ? {} : { hosts: e.hosts },
|
|
258
|
+
characters: e.characters,
|
|
259
|
+
transitionCooldownMs: e.transitionCooldownMs,
|
|
260
|
+
budgets: e.budgets,
|
|
261
|
+
strategies: e.strategies,
|
|
262
|
+
...Object.hasOwn(e, "geometry") ? { geometry: t(e.geometry, e.name) } : {}
|
|
263
|
+
});
|
|
264
|
+
(r.cellCount !== H(e.cellCount) || r.characters !== e.characters || r.transitionCooldownMs !== H(e.transitionCooldownMs, !0)) && R("World descriptor contradicts its captured topology");
|
|
265
|
+
} catch {
|
|
266
|
+
R("World catalogue descriptor failed topology admission");
|
|
267
|
+
}
|
|
268
|
+
Z.add(e);
|
|
269
|
+
}, te = (e, t = 256) => {
|
|
270
|
+
H(t), W(e, t);
|
|
271
|
+
let n = /* @__PURE__ */ new Set(), r = e.map((e) => {
|
|
272
|
+
U(e, [
|
|
273
|
+
"_tag",
|
|
274
|
+
"name",
|
|
275
|
+
"map",
|
|
276
|
+
"zones",
|
|
277
|
+
"instances",
|
|
278
|
+
"persistence",
|
|
279
|
+
"handoff",
|
|
280
|
+
"spawn",
|
|
281
|
+
"hosts",
|
|
282
|
+
"characters",
|
|
283
|
+
"transitionCooldownMs",
|
|
284
|
+
"budgets",
|
|
285
|
+
"cellCount",
|
|
286
|
+
"strategies",
|
|
287
|
+
"geometry"
|
|
288
|
+
]), (e._tag !== "WorldDescriptor" || !Object.isFrozen(e)) && R("World catalogue requires immutable definitions"), Q(e);
|
|
289
|
+
let t = z(e.name);
|
|
290
|
+
return n.has(t) && R("Duplicate configured World"), n.add(t), e;
|
|
291
|
+
});
|
|
292
|
+
return Object.freeze(r);
|
|
293
|
+
}, ne = (e, t) => {
|
|
294
|
+
let n = G(t);
|
|
295
|
+
return e.zones.find((e) => J(e.bounds, n)) ?? R("Position has no World Zone");
|
|
296
|
+
}, $ = (e, t) => {
|
|
297
|
+
U(t, ["zone", "at"]);
|
|
298
|
+
let n = G(t.at), r = e.zones.find((e) => e.id === t.zone);
|
|
299
|
+
if (!r || !J(r.bounds, n)) return R("Position is outside its declared World Zone");
|
|
300
|
+
let i = Y(r), a = (e, t, n) => {
|
|
301
|
+
let r = 0, a = n;
|
|
302
|
+
for (; r + 1 < a;) {
|
|
303
|
+
let n = r + Math.floor((a - r) / 2);
|
|
304
|
+
e < t + n * i.size ? a = n : r = n;
|
|
305
|
+
}
|
|
306
|
+
return r;
|
|
307
|
+
}, o = a(n[0], r.bounds[0][0], i.columns), s = a(n[1], r.bounds[0][1], i.rows), c = r.bounds[0][0] + o * i.size, l = r.bounds[0][1] + s * i.size;
|
|
308
|
+
return Object.freeze({
|
|
309
|
+
id: `${r.id}:${o}:${s}`,
|
|
310
|
+
zone: r.id,
|
|
311
|
+
column: o,
|
|
312
|
+
row: s,
|
|
313
|
+
bounds: K(c, l, Math.min(r.bounds[0][0] + (o + 1) * i.size, r.bounds[1][0]), Math.min(r.bounds[0][1] + (s + 1) * i.size, r.bounds[1][1]))
|
|
314
|
+
});
|
|
315
|
+
}, re = (e, t, n) => {
|
|
316
|
+
let r = e.zones.find((e) => e.id === t), i = typeof n == "string" ? n.split(":") : [];
|
|
317
|
+
if (!r || i.length < 3 || i.slice(0, -2).join(":") !== r.id) return R("Cell is not in its declared World Zone");
|
|
318
|
+
let a = Y(r), o = Number(i[i.length - 2]), s = Number(i[i.length - 1]);
|
|
319
|
+
if (!/^(0|[1-9][0-9]*)$/.test(i[i.length - 2]) || !/^(0|[1-9][0-9]*)$/.test(i[i.length - 1]) || o >= a.columns || s >= a.rows) return R("Cell is not in its declared World Zone");
|
|
320
|
+
let c = $(e, {
|
|
321
|
+
zone: r.id,
|
|
322
|
+
at: [r.bounds[0][0] + o * a.size, r.bounds[0][1] + s * a.size]
|
|
323
|
+
});
|
|
324
|
+
return c.id === n ? c : R("Cell is not in its declared World Zone");
|
|
325
|
+
}, ie = (e, t) => {
|
|
326
|
+
let n = e.spawn({ player: t });
|
|
327
|
+
return U(n, ["zone", "at"]), $(e, n), Object.freeze({
|
|
328
|
+
zone: n.zone,
|
|
329
|
+
at: G(n.at)
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
//#endregion
|
|
333
|
+
export { M as WorldClient, E as WorldClientReceiptSchema, D as WorldClientRequestIdSchema, O as WorldClientTicketSchema, p as WorldGroupTransitionRequestSchema, w as WorldInspectionSchema, m as WorldTransitionPhaseSchema, h as WorldTransitionPort, g as WorldTransitionRequestSchema, _ as WorldTransitionTargetSchema, te as captureWorldCatalog, n as cmsGeometry, T as decodeWorldInspection, a as defaultWorldLayerPolicy, c as defaultWorldOnWorldChange, u as defaultWorldTransitionPolicy, X as defineWorld, r as importedGeometry, I as makeWorldCellMovement, j as makeWorldEntityHandoffView, F as makeWorldGhostNeighborhood, k as makeWorldHandoffView, i as procedural, K as rect, o as resolveWorldLayerPolicy, l as resolveWorldOnWorldChange, d as resolveWorldTransitionPolicy, v as stageWorldGroupTransition, y as stageWorldTransition, $ as worldCellAt, re as worldCellById, N as worldClientReceipt, P as worldClientTicket, b as worldGroupTransitionRequest, s as worldLayerMaintenance, A as worldRpcControls, ee as worldRpcPending, ie as worldSpawn, f as worldSystemContractManifest, x as worldTransitionCommandBindings, S as worldTransitionPhases, C as worldTransitionRequest, ne as worldZoneAt };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { captureWorldData as n } from "./worldData.js";
|
|
3
|
+
//#region src/worldActorReceipts.ts
|
|
4
|
+
var r = (r, i = 4096) => {
|
|
5
|
+
if (!Number.isSafeInteger(i) || i < 1 || i > 4096 || !Array.isArray(r)) throw new t({ detail: "Invalid World actor receipt budget or inventory" });
|
|
6
|
+
if (r.length > i) throw new e({
|
|
7
|
+
budget: "worldActorReceipts",
|
|
8
|
+
limit: i
|
|
9
|
+
});
|
|
10
|
+
let a = n(r, 1048576), o = /* @__PURE__ */ new Set();
|
|
11
|
+
for (let e of a) {
|
|
12
|
+
if (!e || Object.keys(e).some((e) => ![
|
|
13
|
+
"requestId",
|
|
14
|
+
"operation",
|
|
15
|
+
"fingerprint",
|
|
16
|
+
"projection"
|
|
17
|
+
].includes(e)) || typeof e.requestId != "string" || !e.requestId || e.requestId.length > 191 || o.has(e.requestId) || ![
|
|
18
|
+
"enter",
|
|
19
|
+
"exit",
|
|
20
|
+
"ghost"
|
|
21
|
+
].includes(e.operation) || typeof e.fingerprint != "string" || !/^[0-9a-f]{64}$/.test(e.fingerprint)) throw new t({ detail: "Invalid World actor receipt" });
|
|
22
|
+
if (e.projection !== void 0) {
|
|
23
|
+
let n = e.projection;
|
|
24
|
+
if (!n || typeof n != "object" || Array.isArray(n)) throw new t({ detail: "Invalid retained World ghost projection" });
|
|
25
|
+
let r = n.location, i = n.entity;
|
|
26
|
+
if (e.operation !== "ghost" || !/^wghost-[0-9a-f]{64}:ghost$/.test(e.requestId) || Object.keys(n).some((e) => ![
|
|
27
|
+
"entity",
|
|
28
|
+
"location",
|
|
29
|
+
"expiresAt"
|
|
30
|
+
].includes(e)) || n.expiresAt !== void 0 && (!Number.isSafeInteger(n.expiresAt) || n.expiresAt < 0) || !i || typeof i != "object" || Array.isArray(i) || typeof i.id != "string" || !i.id || i.id.length > 191 || !r || Object.keys(r).length !== 6 || ![
|
|
31
|
+
r.worldId,
|
|
32
|
+
r.zoneId,
|
|
33
|
+
r.roomId
|
|
34
|
+
].every((e) => typeof e == "string" && e.length > 0 && e.length <= 191) || ![r.epoch, r.layer].every((e) => Number.isSafeInteger(e) && e > 0) || !Array.isArray(r.at) || r.at.length !== 2 || !r.at.every((e) => typeof e == "number" && Number.isFinite(e))) throw new t({ detail: "Invalid retained World ghost projection" });
|
|
35
|
+
}
|
|
36
|
+
o.add(e.requestId);
|
|
37
|
+
}
|
|
38
|
+
return a;
|
|
39
|
+
}, i = (e) => {
|
|
40
|
+
let n = (e) => Array.isArray(e) ? e.map(n) : e && typeof e == "object" ? Object.fromEntries(Object.keys(e).sort().map((t) => [t, n(e[t])])) : e, r = JSON.stringify(n(e));
|
|
41
|
+
if (typeof r != "string") throw new t({ detail: "World actor identity requires captured JSON data" });
|
|
42
|
+
return r;
|
|
43
|
+
}, a = async (e) => {
|
|
44
|
+
let t = new TextEncoder().encode(i(e)), n = await globalThis.crypto.subtle.digest("SHA-256", t);
|
|
45
|
+
return Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("");
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { r as captureWorldActorReceipts, i as worldActorCanonicalJson, a as worldActorFingerprint };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldData as t } from "./worldData.js";
|
|
3
|
+
import { worldActorCanonicalJson as n } from "./worldActorReceipts.js";
|
|
4
|
+
//#region src/worldActorTransferSnapshot.ts
|
|
5
|
+
var r = (n, r) => {
|
|
6
|
+
let i = t(n, r);
|
|
7
|
+
if (!i || typeof i != "object" || Object.keys(i).length !== 3 || !Number.isSafeInteger(i.schemaHash) || i.schemaHash < 0 || i.schemaHash > 4294967295 || !Array.isArray(i.bytes) || !i.bytes.length || !i.bytes.every((e) => Number.isInteger(e) && e >= 0 && e <= 255) || !i.entity || typeof i.entity != "object" || Array.isArray(i.entity) || typeof i.entity.id != "string" || !i.entity.id || i.entity.id.length > 191) throw new e({ detail: "World actor transfer requires bounded actual codec bytes and source entity" });
|
|
8
|
+
return i;
|
|
9
|
+
}, i = (i, a, o) => {
|
|
10
|
+
let s = t(i, o), c = r(a, o);
|
|
11
|
+
if (n(s) !== n(c.entity)) throw new e({ detail: "World source requires final snapshot reconciliation before rollback" });
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as assertWorldActorSnapshotSource, r as captureWorldActorTransferSnapshot };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
|
|
2
|
+
import { simulationOwnData as n } from "./simulationAuthoring.js";
|
|
3
|
+
import { captureWorldData as r } from "./worldData.js";
|
|
4
|
+
import { captureWorldCatalog as i, worldCellAt as a } from "./world.js";
|
|
5
|
+
import { Effect as o } from "effect";
|
|
6
|
+
import { randomUUID as s } from "node:crypto";
|
|
7
|
+
//#region src/worldBoundaryCoordinator.ts
|
|
8
|
+
var c = () => new t({ detail: "World boundary coordination requires its bounded actual source and exact durable requests" }), l = (t, l, u) => {
|
|
9
|
+
let d = [
|
|
10
|
+
"tenantId",
|
|
11
|
+
"roomId",
|
|
12
|
+
"epoch",
|
|
13
|
+
"world",
|
|
14
|
+
"maxPending",
|
|
15
|
+
"maxEntriesPerTurn",
|
|
16
|
+
"maxBytes",
|
|
17
|
+
"prepareTtlMs",
|
|
18
|
+
"epochNow"
|
|
19
|
+
];
|
|
20
|
+
n(u, d, d);
|
|
21
|
+
let { tenantId: f, roomId: p, epoch: m, maxPending: h, maxEntriesPerTurn: g, maxBytes: _, prepareTtlMs: v } = u, y = i([u.world])[0], b = u.epochNow.bind(u);
|
|
22
|
+
if (![f, p].every((e) => typeof e == "string" && /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,190}$/.test(e)) || !Number.isSafeInteger(m) || m < 1 || !Number.isSafeInteger(h) || h < 1 || h > 4095 || !Number.isSafeInteger(g) || g < 1 || g > h || !Number.isSafeInteger(_) || _ < 1 || _ > 16777216 || !Number.isSafeInteger(v) || v < 1 || v > 3e5) throw c();
|
|
23
|
+
let x = t.scanWorldSourceTransitions.bind(t), S = t.captureWorldBoundaryIntents.bind(t), C = l.prepare.bind(l), w = l.commit.bind(l), T = l.cancel.bind(l), E = l.resume.bind(l), D = l.status.bind(l), O = /* @__PURE__ */ new Map(), k = `boundary-${s()}`, A = 0, j = -1, M = 0, N = !1, P, F = () => {
|
|
24
|
+
let e = b();
|
|
25
|
+
if (!Number.isSafeInteger(e) || e < 0 || e < j || e > 2 ** 53 - 1 - v) throw c();
|
|
26
|
+
return j = e, e;
|
|
27
|
+
}, I = (e, t) => JSON.stringify(e) === JSON.stringify(t), L = (e, t) => {
|
|
28
|
+
let n = r(e, _);
|
|
29
|
+
if (n.origin.tenantId !== f || n.origin.roomId !== p || n.source.epoch !== m || n.source.worldId !== y.name || n.source.roomId !== p || n.mode !== "seamless" || n.group || n.intent.entityId !== n.entityId || n.intent.options.reason !== "boundary" || n.intent.target.kind !== "cell" || t && (!I(n.origin, t.origin) || !I(n.intent, t.intent))) throw c();
|
|
30
|
+
return n;
|
|
31
|
+
}, R = (t, n) => {
|
|
32
|
+
if (!O.has(t) && O.size >= h) throw new e({
|
|
33
|
+
budget: "worldBoundaryPending",
|
|
34
|
+
limit: h
|
|
35
|
+
});
|
|
36
|
+
r([...O.entries()].filter(([e]) => e !== t).map(([, e]) => e).concat(n), _), O.set(t, n);
|
|
37
|
+
}, z = (e, t, n) => {
|
|
38
|
+
let r = L(n, t);
|
|
39
|
+
return R(e, {
|
|
40
|
+
...t,
|
|
41
|
+
record: r,
|
|
42
|
+
commitStarted: t.commitStarted || r.actorFinalSnapshot !== void 0 || ["committed", "settled"].includes(r.phase)
|
|
43
|
+
}), O.get(e);
|
|
44
|
+
}, B = (e) => o.isEffect(e) ? o.runPromise(e) : Promise.reject(c()), V = (e, t) => e.entityId !== t.entityId || e.target.kind !== "cell" || t.intent.target.kind !== "cell" || e.target.zone !== t.target.zoneId || t.target.worldId !== y.name ? !1 : a(y, {
|
|
45
|
+
zone: e.target.zone,
|
|
46
|
+
at: e.target.at
|
|
47
|
+
}).id === a(y, {
|
|
48
|
+
zone: t.target.zoneId,
|
|
49
|
+
at: t.target.at
|
|
50
|
+
}).id, H = async () => {
|
|
51
|
+
let e = [], t = /* @__PURE__ */ new Set(), n = await x(p, f, m, y.name, h, _);
|
|
52
|
+
if (N) return;
|
|
53
|
+
for (let e of n) {
|
|
54
|
+
if (t.add(e.entityId), e.mode !== "seamless" || e.group || e.intent.options.reason !== "boundary") continue;
|
|
55
|
+
let n = L(e), r = O.get(n.entityId);
|
|
56
|
+
if (r && !I(r.origin, n.origin)) throw c();
|
|
57
|
+
let i = r ?? {
|
|
58
|
+
origin: n.origin,
|
|
59
|
+
intent: n.intent,
|
|
60
|
+
createdAt: n.createdAt,
|
|
61
|
+
commitStarted: !1
|
|
62
|
+
};
|
|
63
|
+
z(n.entityId, i, n);
|
|
64
|
+
}
|
|
65
|
+
let i;
|
|
66
|
+
try {
|
|
67
|
+
if ([...O.values()].some((e) => e.commitStarted || e.record?.phase === "failed") || (i = await S(p, f, m, y.name)), i) {
|
|
68
|
+
if (i.epoch !== m || i.intents.length > h) throw c();
|
|
69
|
+
r(i, _);
|
|
70
|
+
}
|
|
71
|
+
} catch (t) {
|
|
72
|
+
e.push(t);
|
|
73
|
+
}
|
|
74
|
+
if (N) return;
|
|
75
|
+
if (i) for (let e of i.intents) {
|
|
76
|
+
if (O.has(e.intention.entityId) || t.has(e.intention.entityId)) continue;
|
|
77
|
+
if (O.size >= h) break;
|
|
78
|
+
if (A >= 2 ** 53 - 1) throw c();
|
|
79
|
+
let n = r(e.intention, _);
|
|
80
|
+
R(n.entityId, {
|
|
81
|
+
origin: Object.freeze({
|
|
82
|
+
tenantId: f,
|
|
83
|
+
roomId: p,
|
|
84
|
+
requestId: `${k}-${++A}`
|
|
85
|
+
}),
|
|
86
|
+
intent: n,
|
|
87
|
+
createdAt: F(),
|
|
88
|
+
commitStarted: !1
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
let a = [...O.keys()], o = a.slice(M % Math.max(1, a.length)).concat(a.slice(0, M % Math.max(1, a.length))).slice(0, g);
|
|
92
|
+
M = a.length ? (M + o.length) % a.length : 0;
|
|
93
|
+
for (let t of o) {
|
|
94
|
+
if (N) break;
|
|
95
|
+
let n = O.get(t);
|
|
96
|
+
try {
|
|
97
|
+
n = n.record ? z(t, n, await B(D(n.origin))) : z(t, n, await B(C(n.intent, n.origin)));
|
|
98
|
+
let e = n.record;
|
|
99
|
+
if (N) break;
|
|
100
|
+
if (["settled", "rolledBack"].includes(e.phase)) {
|
|
101
|
+
await B(E(n.origin)), O.delete(t);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (e.phase === "failed") n = z(t, n, await B(T(n.origin, e.failure ?? "boundary_expired")));
|
|
105
|
+
else if (n.commitStarted || e.phase === "committed") n = z(t, n, await B(w(n.origin)));
|
|
106
|
+
else if (F() - n.createdAt >= v) n = z(t, n, await B(T(n.origin, "boundary_expired")));
|
|
107
|
+
else {
|
|
108
|
+
e.phase !== "switching" && (n = z(t, n, await B(C(n.intent, n.origin)))), e = n.record;
|
|
109
|
+
let i = await S(p, f, m, y.name);
|
|
110
|
+
if (i.epoch !== m || i.intents.length > h) throw c();
|
|
111
|
+
r(i, _);
|
|
112
|
+
let a = i.intents.find((e) => e.intention.entityId === t);
|
|
113
|
+
if (N) break;
|
|
114
|
+
!a || a.revision !== e.entityRevision || !V(a.intention, e) ? n = z(t, n, await B(T(n.origin, "boundary_withdrawn"))) : a.crossing && (n = {
|
|
115
|
+
...n,
|
|
116
|
+
commitStarted: !0
|
|
117
|
+
}, R(t, n), n = z(t, n, await B(w(n.origin))));
|
|
118
|
+
}
|
|
119
|
+
["settled", "rolledBack"].includes(n.record.phase) && O.delete(t);
|
|
120
|
+
} catch (t) {
|
|
121
|
+
e.push(t);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (e.length) throw AggregateError(e, "World boundary operations remain retained");
|
|
125
|
+
};
|
|
126
|
+
return Object.freeze({
|
|
127
|
+
runDue: () => {
|
|
128
|
+
if (N) return Promise.resolve();
|
|
129
|
+
if (P) return P;
|
|
130
|
+
let e = Promise.resolve().then(H);
|
|
131
|
+
return P = e, e.then(() => {
|
|
132
|
+
P === e && (P = void 0);
|
|
133
|
+
}, () => {
|
|
134
|
+
P === e && (P = void 0);
|
|
135
|
+
}), e;
|
|
136
|
+
},
|
|
137
|
+
observation: () => Object.freeze({
|
|
138
|
+
closed: N,
|
|
139
|
+
busy: P !== void 0,
|
|
140
|
+
pending: O.size
|
|
141
|
+
}),
|
|
142
|
+
close: async () => {
|
|
143
|
+
N = !0, P && await P.catch(() => void 0);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
export { l as makeWorldBoundaryCoordinator };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { RoomAuthoringError as e } from "./errors.js";
|
|
2
|
+
import { captureWorldCatalog as t } from "./world.js";
|
|
3
|
+
//#region src/worldCatalog.ts
|
|
4
|
+
function n(t) {
|
|
5
|
+
throw new e({
|
|
6
|
+
room: "world-catalog",
|
|
7
|
+
detail: t
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
var r = (e, r, i = 256) => {
|
|
11
|
+
let a = [];
|
|
12
|
+
for (let o of t(e, i)) {
|
|
13
|
+
for (let e of o.zones) {
|
|
14
|
+
let t = r.get(e.room);
|
|
15
|
+
e.layering !== void 0 && e.layering.maxPlayers !== t.maxClients && n("World layering capacity differs from its admitted Room"), a.push(Object.freeze({
|
|
16
|
+
worldId: o.name,
|
|
17
|
+
areaId: e.id,
|
|
18
|
+
kind: "zone",
|
|
19
|
+
room: t.name,
|
|
20
|
+
maxClients: t.maxClients
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
for (let e of o.instances) {
|
|
24
|
+
let t = r.get(e.room);
|
|
25
|
+
a.push(Object.freeze({
|
|
26
|
+
worldId: o.name,
|
|
27
|
+
areaId: e.id,
|
|
28
|
+
kind: "instance",
|
|
29
|
+
room: t.name,
|
|
30
|
+
maxClients: t.maxClients
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return Object.freeze(a);
|
|
35
|
+
}, i = async (e, r, i, o = {}) => {
|
|
36
|
+
let s = o.maxWorlds ?? 256;
|
|
37
|
+
(!Number.isSafeInteger(s) || s < 1 || !Array.isArray(e) || e.length > s || Reflect.ownKeys(e).length !== e.length + 1) && n("Invalid or over-budget World source inventory");
|
|
38
|
+
let c = [];
|
|
39
|
+
for (let t = 0; t < e.length; t++) {
|
|
40
|
+
let r = Object.getOwnPropertyDescriptor(e, String(t));
|
|
41
|
+
(!r?.enumerable || !("value" in r) || typeof r.value != "string" || r.value.length === 0 || r.value.length > 4096) && n("World source inventory requires bounded own data"), c.push(r.value);
|
|
42
|
+
}
|
|
43
|
+
let l = [];
|
|
44
|
+
for (let e of [...new Set(c)].sort()) {
|
|
45
|
+
let i = await r(e), a = Object.getOwnPropertyDescriptor(i, "default");
|
|
46
|
+
(!a || !("value" in a)) && n("World modules must default-export their immutable definition as data");
|
|
47
|
+
let o = t([a.value], s)[0];
|
|
48
|
+
l.push(Object.freeze({
|
|
49
|
+
source: e,
|
|
50
|
+
descriptor: o
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
return new a(l, i, o);
|
|
54
|
+
}, a = class {
|
|
55
|
+
entries;
|
|
56
|
+
roomReferences;
|
|
57
|
+
constructor(e, i, a = {}) {
|
|
58
|
+
let o = a.maxWorlds ?? 256;
|
|
59
|
+
(!Number.isSafeInteger(o) || o < 1 || !Array.isArray(e) || e.length > o || Reflect.ownKeys(e).length !== e.length + 1) && n("Invalid or over-budget World catalogue");
|
|
60
|
+
let s = [];
|
|
61
|
+
for (let t = 0; t < e.length; t++) {
|
|
62
|
+
let r = Object.getOwnPropertyDescriptor(e, String(t));
|
|
63
|
+
(!r || !("value" in r)) && n("World catalogue requires own entries");
|
|
64
|
+
let i = Object.getOwnPropertyDescriptor(r.value, "source"), a = Object.getOwnPropertyDescriptor(r.value, "descriptor");
|
|
65
|
+
(!i || !("value" in i) || typeof i.value != "string" || i.value.length === 0 || i.value.length > 4096 || !a || !("value" in a)) && n("Invalid World catalogue source"), s.push(Object.freeze({
|
|
66
|
+
source: i.value,
|
|
67
|
+
descriptor: a.value
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
let c = t(s.map((e) => e.descriptor), o);
|
|
71
|
+
new Set(s.map((e) => e.source)).size !== s.length && n("Duplicate World source identity"), this.roomReferences = r(c, i, o), this.entries = Object.freeze(s.sort((e, t) => e.descriptor.name < t.descriptor.name ? -1 : +(e.descriptor.name > t.descriptor.name)));
|
|
72
|
+
}
|
|
73
|
+
get(e) {
|
|
74
|
+
return this.entries.find((t) => t.descriptor.name === e)?.descriptor ?? n("Unknown admitted World");
|
|
75
|
+
}
|
|
76
|
+
inventory() {
|
|
77
|
+
return this.entries;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { a as WorldCatalog, i as loadWorldCatalog, r as validateWorldRooms };
|