@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.
Files changed (495) hide show
  1. package/CHANGELOG.md +24329 -0
  2. package/LICENSE +61 -0
  3. package/README.md +9204 -2
  4. package/SECURITY.md +56 -0
  5. package/THIRD-PARTY-NOTICES.md +11322 -0
  6. package/dist/actor.js +1474 -0
  7. package/dist/apiBinding.js +678 -0
  8. package/dist/apiRegistryBinding.js +399 -0
  9. package/dist/apiReservations.js +433 -0
  10. package/dist/baselines.js +73 -0
  11. package/dist/bots.d.ts +1485 -0
  12. package/dist/bots.js +563 -0
  13. package/dist/catalog.js +80 -0
  14. package/dist/checkpointJson.js +24 -0
  15. package/dist/checkpointStore.js +386 -0
  16. package/dist/client.js +56 -0
  17. package/dist/clockSync.js +51 -0
  18. package/dist/collision.js +156 -0
  19. package/dist/commandDelivery.js +101 -0
  20. package/dist/commandRecord.js +11 -0
  21. package/dist/commandWithdrawal.js +183 -0
  22. package/dist/connection.js +497 -0
  23. package/dist/controlCarrier.js +375 -0
  24. package/dist/controlRegistry.js +79 -0
  25. package/dist/controlTarget.js +45 -0
  26. package/dist/controlTransport.js +574 -0
  27. package/dist/developmentBinding.js +113 -0
  28. package/dist/directory.js +323 -0
  29. package/dist/directoryProjection.js +117 -0
  30. package/dist/errors.d.ts +125 -0
  31. package/dist/errors.js +53 -0
  32. package/dist/fixed.d.ts +284 -0
  33. package/dist/fixed.js +10 -0
  34. package/dist/fixed32.js +134 -0
  35. package/dist/fixedCollision.js +60 -0
  36. package/dist/fixedCollision32.js +109 -0
  37. package/dist/fixedMath.js +56 -0
  38. package/dist/fixedRaw.js +11 -0
  39. package/dist/fixedSlabs.js +34 -0
  40. package/dist/fixedTrig.js +48 -0
  41. package/dist/fixedTrig32.js +38 -0
  42. package/dist/fixedVectors.js +113 -0
  43. package/dist/fixedVectors32.js +95 -0
  44. package/dist/fixedWide.js +50 -0
  45. package/dist/fixedWords.js +46 -0
  46. package/dist/gateway.js +57 -0
  47. package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
  48. package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
  49. package/dist/geometry-worker/worker.d.mts +2 -0
  50. package/dist/geometry-worker/worker.mjs +50 -0
  51. package/dist/geometry.d.ts +2249 -0
  52. package/dist/geometry.js +40 -0
  53. package/dist/geometryActivation.js +82 -0
  54. package/dist/geometryActorInventory.js +108 -0
  55. package/dist/geometryAdminClient.js +87 -0
  56. package/dist/geometryAdminData.js +32 -0
  57. package/dist/geometryAdminFixtures.js +50 -0
  58. package/dist/geometryAdminPorts.js +5 -0
  59. package/dist/geometryAdminRpc.js +58 -0
  60. package/dist/geometryAdminRpcRoutes.js +49 -0
  61. package/dist/geometryAdminSchemas.js +39 -0
  62. package/dist/geometryAdministration.js +190 -0
  63. package/dist/geometryAdministrationPorts.js +5 -0
  64. package/dist/geometryApiBinding.js +165 -0
  65. package/dist/geometryAppStorage.js +58 -0
  66. package/dist/geometryArtifacts.js +198 -0
  67. package/dist/geometryAssetBundle.js +117 -0
  68. package/dist/geometryAssetClient.js +25 -0
  69. package/dist/geometryAssetData.js +106 -0
  70. package/dist/geometryAssetHttp.js +123 -0
  71. package/dist/geometryAssetPorts.js +5 -0
  72. package/dist/geometryAssetRpc.js +30 -0
  73. package/dist/geometryAssetRpcRoutes.js +40 -0
  74. package/dist/geometryAssetStorageGrant.js +103 -0
  75. package/dist/geometryBoxOverlap.js +110 -0
  76. package/dist/geometryCatalogueDigest.js +111 -0
  77. package/dist/geometryCellCoverage.js +85 -0
  78. package/dist/geometryCellLoader.js +28 -0
  79. package/dist/geometryChannel.js +134 -0
  80. package/dist/geometryChunkHttp.js +54 -0
  81. package/dist/geometryChunkLeases.js +22 -0
  82. package/dist/geometryClient.d.ts +1429 -0
  83. package/dist/geometryClient.js +149 -0
  84. package/dist/geometryClientChunks.js +330 -0
  85. package/dist/geometryClientDelta.js +25 -0
  86. package/dist/geometryClientHttp.js +37 -0
  87. package/dist/geometryClientInterest.js +109 -0
  88. package/dist/geometryClientStatic.js +34 -0
  89. package/dist/geometryCms.d.ts +763 -0
  90. package/dist/geometryCms.js +217 -0
  91. package/dist/geometryCommitCoordinator.js +241 -0
  92. package/dist/geometryCompactionFixture.js +84 -0
  93. package/dist/geometryCompactionStrategies.js +38 -0
  94. package/dist/geometryConnectionClient.js +23 -0
  95. package/dist/geometryDerivationFixtures.js +141 -0
  96. package/dist/geometryDerivationStrategies.js +27 -0
  97. package/dist/geometryDigest.js +13 -0
  98. package/dist/geometryEditChannel.js +70 -0
  99. package/dist/geometryEditIngress.js +263 -0
  100. package/dist/geometryEdits.js +366 -0
  101. package/dist/geometryEnvelope.js +41 -0
  102. package/dist/geometryGridRaycast.js +92 -0
  103. package/dist/geometryGridSweep.js +92 -0
  104. package/dist/geometryHeightfield.js +166 -0
  105. package/dist/geometryHeightfieldRaycast.js +74 -0
  106. package/dist/geometryHeightfieldSweep.js +85 -0
  107. package/dist/geometryHeightfieldVolume.js +45 -0
  108. package/dist/geometryHost.js +322 -0
  109. package/dist/geometryHostDirectory.js +207 -0
  110. package/dist/geometryHostMutations.js +137 -0
  111. package/dist/geometryHostStreams.js +124 -0
  112. package/dist/geometryHttpBody.js +76 -0
  113. package/dist/geometryHttpRoutes.js +112 -0
  114. package/dist/geometryImportGltf.js +300 -0
  115. package/dist/geometryImportLdtk.js +54 -0
  116. package/dist/geometryImportPng.js +144 -0
  117. package/dist/geometryImportPublication.js +67 -0
  118. package/dist/geometryImportTiled.js +39 -0
  119. package/dist/geometryImportTiles.js +136 -0
  120. package/dist/geometryImportVox.js +130 -0
  121. package/dist/geometryImportedSource.js +101 -0
  122. package/dist/geometryInspectEndpoint.js +248 -0
  123. package/dist/geometryInspection.js +92 -0
  124. package/dist/geometryInstall.js +121 -0
  125. package/dist/geometryJournalArchiveData.js +21 -0
  126. package/dist/geometryJournalArchiveIndex.js +330 -0
  127. package/dist/geometryJournalArchiveTable.js +21 -0
  128. package/dist/geometryJournalCompaction.js +100 -0
  129. package/dist/geometryJournalPatch.js +47 -0
  130. package/dist/geometryJournalRetention.js +112 -0
  131. package/dist/geometryJournalRetentionSchemas.js +36 -0
  132. package/dist/geometryJournalRetentionSweep.js +112 -0
  133. package/dist/geometryJournalRetentionWorkflow.js +28 -0
  134. package/dist/geometryJournalRetentionWorkflowData.js +31 -0
  135. package/dist/geometryJournalStorage.js +148 -0
  136. package/dist/geometryLoader.js +118 -0
  137. package/dist/geometryManifest.js +113 -0
  138. package/dist/geometryManifestChannel.js +93 -0
  139. package/dist/geometryManifestClient.js +122 -0
  140. package/dist/geometryManifestData.js +49 -0
  141. package/dist/geometryManifestPorts.js +5 -0
  142. package/dist/geometryManifestPublication.js +109 -0
  143. package/dist/geometryManifestSource.js +68 -0
  144. package/dist/geometryMigrationJournal.js +14 -0
  145. package/dist/geometryMigrationStrategies.js +7 -0
  146. package/dist/geometryMigrations.js +323 -0
  147. package/dist/geometryNativeMetadata.js +52 -0
  148. package/dist/geometryPatch.js +170 -0
  149. package/dist/geometryPersistence.js +449 -0
  150. package/dist/geometryPersistenceCapture.js +69 -0
  151. package/dist/geometryPersistenceData.js +140 -0
  152. package/dist/geometryPersistencePorts.js +5 -0
  153. package/dist/geometryPlayerAdmission.js +34 -0
  154. package/dist/geometryPlayerEditOwner.js +265 -0
  155. package/dist/geometryPlayerEdits.js +49 -0
  156. package/dist/geometryPrepared.js +188 -0
  157. package/dist/geometryPrivacyFence.js +24 -0
  158. package/dist/geometryProceduralPublication.js +91 -0
  159. package/dist/geometryProceduralWorker.js +164 -0
  160. package/dist/geometryPublication.js +110 -0
  161. package/dist/geometryRayAlgebra.js +116 -0
  162. package/dist/geometryReadClient.js +157 -0
  163. package/dist/geometryReadPorts.js +5 -0
  164. package/dist/geometryReadRpc.js +27 -0
  165. package/dist/geometryReadRpcRoutes.js +47 -0
  166. package/dist/geometryReliablePublication.js +82 -0
  167. package/dist/geometryReloadPorts.js +46 -0
  168. package/dist/geometryReloadSource.js +278 -0
  169. package/dist/geometryRenderCache.js +165 -0
  170. package/dist/geometryRenderLod.js +102 -0
  171. package/dist/geometryRollback.js +125 -0
  172. package/dist/geometryRollbackCoordinator.js +203 -0
  173. package/dist/geometryRollbackPorts.js +46 -0
  174. package/dist/geometryRollbackSource.js +209 -0
  175. package/dist/geometryRollbackStore.js +198 -0
  176. package/dist/geometrySchemas.js +27 -0
  177. package/dist/geometryServer.d.ts +2766 -0
  178. package/dist/geometryServer.js +62 -0
  179. package/dist/geometryShapeRaycast.js +111 -0
  180. package/dist/geometryShapeSegments.js +34 -0
  181. package/dist/geometryShapes.js +223 -0
  182. package/dist/geometrySnapshot.js +76 -0
  183. package/dist/geometrySnapshotChannel.js +160 -0
  184. package/dist/geometrySnapshotClient.js +159 -0
  185. package/dist/geometrySnapshotPreparation.js +76 -0
  186. package/dist/geometrySnapshotServer.js +191 -0
  187. package/dist/geometrySqlOwner.js +21 -0
  188. package/dist/geometryStorage.js +127 -0
  189. package/dist/geometryStorageGrant.js +69 -0
  190. package/dist/geometryStorageIdentity.js +9 -0
  191. package/dist/geometryTileArtifact.js +10 -0
  192. package/dist/geometryTileCodec.js +194 -0
  193. package/dist/geometryTileCollision.js +96 -0
  194. package/dist/geometryTileNavigation.js +128 -0
  195. package/dist/geometryTileView.js +35 -0
  196. package/dist/geometryVersionActivation.js +114 -0
  197. package/dist/geometryVersionClient.js +238 -0
  198. package/dist/geometryVersionCompare.js +40 -0
  199. package/dist/geometryVersionMigration.js +106 -0
  200. package/dist/geometryVoxel.js +253 -0
  201. package/dist/geometryWorldEntitySubject.js +32 -0
  202. package/dist/geometryWorldExtent.js +12 -0
  203. package/dist/geometryWorldMetadata.js +38 -0
  204. package/dist/geometryWorldStrategyFixtures.js +127 -0
  205. package/dist/geometryWorldView.js +307 -0
  206. package/dist/host.js +128 -0
  207. package/dist/hostBinding.js +277 -0
  208. package/dist/hostCellObservation.js +114 -0
  209. package/dist/hostClientCapacity.js +90 -0
  210. package/dist/hostCommandScope.js +64 -0
  211. package/dist/hostController.js +3094 -0
  212. package/dist/hostDeployment.js +65 -0
  213. package/dist/hostDrain.js +152 -0
  214. package/dist/hostDrainPorts.js +5 -0
  215. package/dist/hostDriver.js +179 -0
  216. package/dist/hostLane.js +288 -0
  217. package/dist/hostListener.js +79 -0
  218. package/dist/hostListenerBinding.js +19 -0
  219. package/dist/hostLoopObservation.js +90 -0
  220. package/dist/hostMetrics.js +56 -0
  221. package/dist/hostRegistryBinding.js +418 -0
  222. package/dist/hostSelection.js +16 -0
  223. package/dist/hostShutdown.js +47 -0
  224. package/dist/hostTurnObservation.js +53 -0
  225. package/dist/identities.js +4 -0
  226. package/dist/index.d.ts +8632 -0
  227. package/dist/index.js +232 -0
  228. package/dist/inputReceipts.js +63 -0
  229. package/dist/inputRedundancy.js +55 -0
  230. package/dist/inspect.js +238 -0
  231. package/dist/lockstep.d.ts +436 -0
  232. package/dist/lockstep.js +382 -0
  233. package/dist/lockstepAdmission.js +262 -0
  234. package/dist/lockstepAdmissionCodec.js +94 -0
  235. package/dist/lockstepAdmissionPorts.js +5 -0
  236. package/dist/lockstepClientSession.js +578 -0
  237. package/dist/lockstepDefinition.js +148 -0
  238. package/dist/lockstepHostLoop.js +243 -0
  239. package/dist/lockstepInitialAdmission.js +67 -0
  240. package/dist/lockstepInitialStrategyFixtures.js +45 -0
  241. package/dist/lockstepJournal.js +395 -0
  242. package/dist/lockstepJournalCodec.js +254 -0
  243. package/dist/lockstepJournalPorts.js +5 -0
  244. package/dist/lockstepJournalRebuild.js +208 -0
  245. package/dist/lockstepJournalRows.js +57 -0
  246. package/dist/lockstepMembers.js +131 -0
  247. package/dist/lockstepMessages.js +47 -0
  248. package/dist/lockstepOwnedRoom.js +764 -0
  249. package/dist/lockstepPolicies.js +84 -0
  250. package/dist/lockstepReact.js +47 -0
  251. package/dist/lockstepRecoveryTruth.js +121 -0
  252. package/dist/lockstepRosterConfig.js +32 -0
  253. package/dist/lockstepSeed.js +12 -0
  254. package/dist/lockstepSeedFixture.js +20 -0
  255. package/dist/lockstepServer.d.ts +3897 -0
  256. package/dist/lockstepServer.js +325 -0
  257. package/dist/lockstepServerConfig.js +101 -0
  258. package/dist/lockstepServerRoles.js +403 -0
  259. package/dist/lockstepServerStrategyFixtures.js +33 -0
  260. package/dist/lockstepStrategies.js +6 -0
  261. package/dist/lockstepStrategyFixtures.js +137 -0
  262. package/dist/lockstepTerminal.js +90 -0
  263. package/dist/lockstepTerminalPorts.js +5 -0
  264. package/dist/lockstepTransport.js +773 -0
  265. package/dist/lockstepTransportConfig.js +32 -0
  266. package/dist/lockstepWireRoster.js +34 -0
  267. package/dist/matchRoomProvider.js +32 -0
  268. package/dist/matchRooms.js +19 -0
  269. package/dist/membershipObserver.js +47 -0
  270. package/dist/moderation.js +98 -0
  271. package/dist/movementSpecials.js +104 -0
  272. package/dist/ownership.js +17 -0
  273. package/dist/ownershipWithdrawal.js +18 -0
  274. package/dist/pcg32.js +96 -0
  275. package/dist/ports.d.ts +1241 -0
  276. package/dist/ports.js +11 -0
  277. package/dist/quaternion.js +70 -0
  278. package/dist/react.d.ts +406 -0
  279. package/dist/react.js +109 -0
  280. package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
  281. package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
  282. package/dist/reaper.js +243 -0
  283. package/dist/reaperSchemas.js +42 -0
  284. package/dist/reaperWorkflow.js +70 -0
  285. package/dist/recovery.js +189 -0
  286. package/dist/recoverySeats.js +26 -0
  287. package/dist/replay.d.ts +273 -0
  288. package/dist/replay.js +485 -0
  289. package/dist/replayPorts.js +5 -0
  290. package/dist/replayRecording.js +67 -0
  291. package/dist/replaySchema.js +157 -0
  292. package/dist/replayStorage.d.ts +149 -0
  293. package/dist/replayStorage.js +485 -0
  294. package/dist/reservationBatch.js +422 -0
  295. package/dist/reservationSchemas.js +17 -0
  296. package/dist/reservations.js +259 -0
  297. package/dist/reservePort.js +69 -0
  298. package/dist/resolvedOptions.js +4 -0
  299. package/dist/room.d.ts +1006 -0
  300. package/dist/room.js +284 -0
  301. package/dist/roomAccessSweep.js +95 -0
  302. package/dist/roomAppCommandControl.js +59 -0
  303. package/dist/roomAuthoringStrategy.js +17 -0
  304. package/dist/roomErasure.js +198 -0
  305. package/dist/roomPoolRuntimeDefaults.js +24 -0
  306. package/dist/roomPoolSelection.js +19 -0
  307. package/dist/roomPoolTopology.js +212 -0
  308. package/dist/rpc.d.ts +551 -0
  309. package/dist/rpc.js +112 -0
  310. package/dist/rpcClient.js +152 -0
  311. package/dist/rpcRoutes.js +28 -0
  312. package/dist/runtime.js +1123 -0
  313. package/dist/schemaHistory.js +98 -0
  314. package/dist/seatStore.js +151 -0
  315. package/dist/seatStrategyFixtures.js +52 -0
  316. package/dist/seatSubject.js +32 -0
  317. package/dist/seats.js +130 -0
  318. package/dist/serverSession.js +811 -0
  319. package/dist/serverSessionConfig.js +43 -0
  320. package/dist/sessionAdmission.js +53 -0
  321. package/dist/sidecarAdmission.js +103 -0
  322. package/dist/sidecarConfig.js +116 -0
  323. package/dist/sidecarConfigPublication.js +64 -0
  324. package/dist/sidecarHostListener.js +208 -0
  325. package/dist/sidecarIpc.js +205 -0
  326. package/dist/sidecarPeer.js +310 -0
  327. package/dist/sidecarProcessPort.js +28 -0
  328. package/dist/sidecarRuntime.js +168 -0
  329. package/dist/sidecarSelection.js +142 -0
  330. package/dist/sidecarWire.js +178 -0
  331. package/dist/sidecarWrites.js +163 -0
  332. package/dist/simulation.d.ts +391 -0
  333. package/dist/simulation.js +282 -0
  334. package/dist/simulationAuthoring.js +29 -0
  335. package/dist/simulationBytes.js +27 -0
  336. package/dist/simulationConformance.js +305 -0
  337. package/dist/simulationInputHistoryCapture.js +35 -0
  338. package/dist/simulationInputHistoryWire.js +193 -0
  339. package/dist/simulationOptionsWire.js +78 -0
  340. package/dist/simulationRecoveryWire.js +134 -0
  341. package/dist/simulationReplay.js +127 -0
  342. package/dist/simulationSnapshotWire.js +112 -0
  343. package/dist/simulationState.js +178 -0
  344. package/dist/snapshotBlob.js +126 -0
  345. package/dist/snapshotBlobCleanup.js +93 -0
  346. package/dist/snapshotBlobIndex.js +38 -0
  347. package/dist/snapshotBudget.js +80 -0
  348. package/dist/snapshotChain.js +185 -0
  349. package/dist/snapshotErasure.js +172 -0
  350. package/dist/snapshotInspection.js +105 -0
  351. package/dist/snapshotSegmentBlobs.js +58 -0
  352. package/dist/snapshotUploads.js +166 -0
  353. package/dist/socketTransport.js +253 -0
  354. package/dist/spatial.js +104 -0
  355. package/dist/spectatorPolicy.js +26 -0
  356. package/dist/spectatorProducer.js +89 -0
  357. package/dist/startFailureCause.js +4 -0
  358. package/dist/stateCodec.js +658 -0
  359. package/dist/strategies.d.ts +210 -0
  360. package/dist/strategies.js +8 -0
  361. package/dist/strategiesServer.d.ts +286 -0
  362. package/dist/strategiesServer.js +11 -0
  363. package/dist/strategyFixtures.js +182 -0
  364. package/dist/streamFraming.js +122 -0
  365. package/dist/streamTransport.js +266 -0
  366. package/dist/subjectAdmission.js +50 -0
  367. package/dist/subjectPrivacy.js +281 -0
  368. package/dist/subjectPrivacyBinding.js +90 -0
  369. package/dist/systemManifest.js +182 -0
  370. package/dist/tables.js +159 -0
  371. package/dist/testHarness.js +89 -0
  372. package/dist/testing.d.ts +3684 -0
  373. package/dist/testing.js +221 -0
  374. package/dist/testingPorts.js +271 -0
  375. package/dist/testingServer.d.ts +4060 -0
  376. package/dist/testingServer.js +18 -0
  377. package/dist/transform.d.ts +692 -0
  378. package/dist/transform.js +217 -0
  379. package/dist/transform3d.js +118 -0
  380. package/dist/transformCollection.js +24 -0
  381. package/dist/transformCollection3d.js +24 -0
  382. package/dist/transformCollectionCore.js +156 -0
  383. package/dist/transformFrames.js +121 -0
  384. package/dist/transformPrediction3d.js +127 -0
  385. package/dist/transformRules.js +123 -0
  386. package/dist/transformSchemas.js +20 -0
  387. package/dist/transport.js +32 -0
  388. package/dist/transportAuthoring.js +29 -0
  389. package/dist/transportCleanup.js +22 -0
  390. package/dist/transportConformance.js +124 -0
  391. package/dist/transportConnector.js +82 -0
  392. package/dist/transportEndpoints.js +38 -0
  393. package/dist/transportsServer.d.ts +5515 -0
  394. package/dist/transportsServer.js +6 -0
  395. package/dist/viewProjection.js +16 -0
  396. package/dist/web.d.ts +2286 -0
  397. package/dist/web.js +518 -0
  398. package/dist/webTransportClient.js +173 -0
  399. package/dist/wire.d.ts +992 -0
  400. package/dist/wire.js +492 -0
  401. package/dist/withdrawalPort.js +28 -0
  402. package/dist/world.d.ts +1894 -0
  403. package/dist/world.js +333 -0
  404. package/dist/worldActorReceipts.js +48 -0
  405. package/dist/worldActorTransferSnapshot.js +14 -0
  406. package/dist/worldAdmissionPending.js +8 -0
  407. package/dist/worldBoundaryCoordinator.js +148 -0
  408. package/dist/worldCatalog.js +81 -0
  409. package/dist/worldCellAllocation.js +203 -0
  410. package/dist/worldCellDestination.js +68 -0
  411. package/dist/worldCells.js +489 -0
  412. package/dist/worldChange.js +32 -0
  413. package/dist/worldClient.js +664 -0
  414. package/dist/worldClientControl.js +141 -0
  415. package/dist/worldClientPendingInput.js +16 -0
  416. package/dist/worldClientRpc.js +133 -0
  417. package/dist/worldClientRpcRoutes.js +43 -0
  418. package/dist/worldClientSchemas.js +28 -0
  419. package/dist/worldCommands.js +140 -0
  420. package/dist/worldData.js +42 -0
  421. package/dist/worldDefaultBinding.js +377 -0
  422. package/dist/worldDefaultGroupAdmission.js +82 -0
  423. package/dist/worldDefaultGroupAppServices.js +31 -0
  424. package/dist/worldDefaultGroupCompensation.js +109 -0
  425. package/dist/worldDefaultGroupContinuation.js +96 -0
  426. package/dist/worldDefaultGroupControl.js +72 -0
  427. package/dist/worldDefaultGroupMembers.js +85 -0
  428. package/dist/worldDefaultGroups.js +21 -0
  429. package/dist/worldDefaultPending.js +79 -0
  430. package/dist/worldDefaultService.js +245 -0
  431. package/dist/worldEntities.js +2980 -0
  432. package/dist/worldEntityCodec.js +21 -0
  433. package/dist/worldEntityHandoffView.js +154 -0
  434. package/dist/worldGeometry.js +170 -0
  435. package/dist/worldGhostAdmission.js +65 -0
  436. package/dist/worldGhostDestination.js +118 -0
  437. package/dist/worldGhostGateway.js +132 -0
  438. package/dist/worldGhostHandshake.js +108 -0
  439. package/dist/worldGhostHost.js +42 -0
  440. package/dist/worldGhostIngress.js +132 -0
  441. package/dist/worldGhostNeighborhood.js +70 -0
  442. package/dist/worldGhostNeighbors.js +86 -0
  443. package/dist/worldGhostOutbound.js +110 -0
  444. package/dist/worldGhostPublisher.js +216 -0
  445. package/dist/worldGhostReceiver.js +213 -0
  446. package/dist/worldGhostSender.js +146 -0
  447. package/dist/worldGhostSocket.js +78 -0
  448. package/dist/worldGhostWire.js +172 -0
  449. package/dist/worldGroupCommand.js +49 -0
  450. package/dist/worldGroupDeadline.js +115 -0
  451. package/dist/worldGroupPreparation.js +115 -0
  452. package/dist/worldGroupReadyControl.js +128 -0
  453. package/dist/worldGroupSupervisor.js +120 -0
  454. package/dist/worldHandoffMetrics.js +59 -0
  455. package/dist/worldHandoffView.js +100 -0
  456. package/dist/worldHostSource.js +69 -0
  457. package/dist/worldInspectEndpoint.js +250 -0
  458. package/dist/worldInspection.js +109 -0
  459. package/dist/worldInstanceAdmission.js +31 -0
  460. package/dist/worldInstanceAllocation.js +116 -0
  461. package/dist/worldInstanceDestination.js +64 -0
  462. package/dist/worldInstanceExpiry.js +282 -0
  463. package/dist/worldInstanceExpirySupervisor.js +88 -0
  464. package/dist/worldInstanceLifecycle.js +103 -0
  465. package/dist/worldInstanceState.js +52 -0
  466. package/dist/worldInstances.js +478 -0
  467. package/dist/worldJoin.js +56 -0
  468. package/dist/worldLayers.js +151 -0
  469. package/dist/worldLeases.js +78 -0
  470. package/dist/worldManifest.js +25 -0
  471. package/dist/worldMovement.js +63 -0
  472. package/dist/worldPersistence.js +134 -0
  473. package/dist/worldProjection.js +221 -0
  474. package/dist/worldReact.js +110 -0
  475. package/dist/worldRecoveryActor.js +35 -0
  476. package/dist/worldReturnAnchor.js +49 -0
  477. package/dist/worldRoomHooks.js +57 -0
  478. package/dist/worldRoomPool.js +27 -0
  479. package/dist/worldRoomSteps.js +133 -0
  480. package/dist/worldSeatBinding.js +36 -0
  481. package/dist/worldServer.d.ts +6936 -0
  482. package/dist/worldServer.js +48 -0
  483. package/dist/worldSourceSeatPending.js +9 -0
  484. package/dist/worldStrategyFixtures.js +164 -0
  485. package/dist/worldTesting.js +27 -0
  486. package/dist/worldTransitionDefaults.js +198 -0
  487. package/dist/worldTransitionExecutor.js +519 -0
  488. package/dist/worldTransitionGroup.js +113 -0
  489. package/dist/worldTransitionPhysicalSteps.js +40 -0
  490. package/dist/worldTransitionResolver.js +228 -0
  491. package/dist/worldTransitionSeatGroup.js +64 -0
  492. package/dist/worldTransitionSeats.js +260 -0
  493. package/dist/worldTransitionState.js +95 -0
  494. package/dist/worldTransitions.js +101 -0
  495. package/package.json +189 -4
@@ -0,0 +1,159 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { RoomInputCodec as n } from "./stateCodec.js";
3
+ import { geometryOwnData as r } from "./geometryTileCodec.js";
4
+ import { captureGeometryArtifact as i } from "./geometryArtifacts.js";
5
+ import { assertGeometryArtifactScope as a, captureGeometryCodecProfiles as o, captureGeometryPersistenceScope as s, geometryPersistenceId as c, geometryPersistenceInteger as l } from "./geometryPersistenceData.js";
6
+ import { captureGeometryPreparedScope as u } from "./geometryPrepared.js";
7
+ import { captureRoomClientReliableChannel as d, captureRoomClientReliableIntention as f } from "./web.js";
8
+ import { captureGeometryStreamManifest as p } from "./geometryManifestData.js";
9
+ import { applyGeometryChunkSnapshot as m } from "./geometrySnapshot.js";
10
+ import { GeometryChunkRequestSchema as h, GeometryChunkSnapshotFragmentSchema as g, captureGeometryChunkSnapshotFragment as _, makeGeometrySnapshotReceiver as v } from "./geometrySnapshotChannel.js";
11
+ //#region src/geometrySnapshotClient.ts
12
+ var y = () => new t({ detail: "Native geometry snapshot read requires its current admission and complete authorized recovery" }), b = (t, b, x) => {
13
+ let S = u(b), C = r(x, [
14
+ "manifest",
15
+ "staticSource",
16
+ "requestChannel",
17
+ "responseChannel",
18
+ "requestId",
19
+ "maxPending",
20
+ "maxPatchBytes",
21
+ "maxPendingBytes",
22
+ "maxWaitMs",
23
+ "maxManifestChunks",
24
+ "maxManifestBytes",
25
+ "codecLimits"
26
+ ], ["manifest", "staticSource"]), w = (e, t, n, r) => Object.hasOwn(C, e) ? l(C[e], n, r) : t, T = w("maxPending", 4, 1, 256), E = w("maxPatchBytes", 262144, 512, 16777216), D = w("maxPendingBytes", 1048576, 1024, 67108864), O = w("maxWaitMs", 2e4, 1, 3e5), k = w("maxManifestChunks", 256, 1, 4096), A = w("maxManifestBytes", 262144, 1024, 16777216), j = Object.hasOwn(C, "requestChannel") ? c(C.requestChannel, 96) : "geometryRequests", M = Object.hasOwn(C, "responseChannel") ? c(C.responseChannel, 96) : "geometrySnapshots", N = v({
27
+ maxPending: T,
28
+ maxPatchBytes: E,
29
+ maxPendingBytes: D
30
+ }), P = r(C.staticSource, ["load"]), F = Object.hasOwn(C, "codecLimits") ? o(C.codecLimits) : /* @__PURE__ */ new Map();
31
+ if (j === M || typeof C.manifest != "function" || typeof P.load != "function" || Object.hasOwn(C, "requestId") && typeof C.requestId != "function") throw y();
32
+ let I = C.manifest.bind(x), L = P.load.bind(C.staticSource), R = Object.hasOwn(C, "requestId") ? C.requestId.bind(x) : () => crypto.randomUUID(), z = d(t, M, new n(g).schemaHash), B = f(t, j, new n(h).schemaHash), V = z.identity(), H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Set(), G = [];
33
+ if (!V || JSON.stringify(B.identity()) !== JSON.stringify(V)) throw y();
34
+ let K = !1, q = () => !K && JSON.stringify(z.identity()) === JSON.stringify(V) && JSON.stringify(B.identity()) === JSON.stringify(V), J = () => {
35
+ K = !0;
36
+ for (let e of U) e.abort();
37
+ for (let e of H.values()) e.reject(y());
38
+ H.clear(), N.reset();
39
+ for (let e of G.splice(0)) e();
40
+ }, Y = () => {
41
+ if (!q()) throw J(), y();
42
+ }, X = (e) => {
43
+ let t = p(I(), k, A);
44
+ if (JSON.stringify(t.scope) !== JSON.stringify(S)) throw y();
45
+ let n = t.chunks.find((t) => t.cx === e.cx && t.cy === e.cy && t.cz === e.cz);
46
+ if (!n) throw y();
47
+ return {
48
+ reference: n,
49
+ dirty: t.dirtyChunks.find((t) => t.scope.cx === e.cx && t.scope.cy === e.cy && t.scope.cz === e.cz)
50
+ };
51
+ }, Z = (e) => {
52
+ try {
53
+ Y();
54
+ let t = _(e, E), n = H.get(t.requestId);
55
+ if (!n) return;
56
+ if (JSON.stringify(t.scope) !== JSON.stringify(n.scope)) throw y();
57
+ let r = N.receive(t);
58
+ r && n.resolve(r);
59
+ } catch {
60
+ J();
61
+ }
62
+ };
63
+ try {
64
+ G.push(z.onMessage(Z)), G.push(z.subscribe(() => {
65
+ q() || J();
66
+ })), Y();
67
+ } catch (e) {
68
+ throw J(), e;
69
+ }
70
+ return Object.freeze({
71
+ load: (t, n) => {
72
+ if (W.size >= T) return Promise.reject(new e({
73
+ budget: "geometrySnapshotSourceJobs",
74
+ limit: T
75
+ }));
76
+ let r;
77
+ try {
78
+ if (Y(), !(n instanceof AbortSignal) || n.aborted) throw y();
79
+ r = s(t);
80
+ let e = {
81
+ tenantId: r.tenantId,
82
+ kind: r.kind,
83
+ worldId: r.worldId,
84
+ layerSetId: r.layerSetId,
85
+ version: r.version
86
+ };
87
+ if (JSON.stringify(e) !== JSON.stringify(S)) throw y();
88
+ } catch (e) {
89
+ return Promise.reject(e);
90
+ }
91
+ let o = Promise.resolve().then(async () => {
92
+ if (Y(), n.aborted) throw y();
93
+ let t = X(r), o = new AbortController(), s = () => {
94
+ o.abort();
95
+ };
96
+ U.add(o), n.addEventListener("abort", s, { once: !0 });
97
+ let l, u, d, f;
98
+ try {
99
+ n.aborted && o.abort();
100
+ let s = L(t.reference, o.signal);
101
+ if (!(s instanceof Promise)) throw y();
102
+ let p = i(await s);
103
+ if (Y(), a(p, r), o.signal.aborted || p.blobSha256 !== t.reference.blobSha256 || p.contentSha256 !== t.reference.contentSha256) throw y();
104
+ if (H.size >= T) throw new e({
105
+ budget: "geometrySnapshotPendingRequests",
106
+ limit: T
107
+ });
108
+ if (l = c(R()), H.has(l)) throw y();
109
+ let h = Promise.withResolvers(), g = l;
110
+ h.promise.catch(() => void 0), H.set(g, {
111
+ scope: r,
112
+ resolve: h.resolve,
113
+ reject: h.reject
114
+ });
115
+ let _ = () => {
116
+ h.reject(y());
117
+ };
118
+ if (o.signal.addEventListener("abort", _, { once: !0 }), f = () => o.signal.removeEventListener("abort", _), u = setTimeout(() => h.reject(y()), O), d = B.write({
119
+ requestId: g,
120
+ coordinate: {
121
+ cx: r.cx,
122
+ cy: r.cy,
123
+ ...r.cz === void 0 ? {} : { cz: r.cz }
124
+ }
125
+ }), !(d instanceof Promise)) throw y();
126
+ let v = await Promise.allSettled([d, h.promise]);
127
+ if (v[0].status === "rejected" || v[1].status === "rejected" || (Y(), o.signal.aborted)) throw y();
128
+ let b = await m(p, v[1].value, E, F.get(r.kind) ?? {}), x = X(r);
129
+ if (o.signal.aborted || b.revision < (x.dirty?.revision ?? 0) || x.reference.blobSha256 !== t.reference.blobSha256 || x.reference.contentSha256 !== t.reference.contentSha256 || !x.dirty && (b.revision !== 0 || b.artifact.blobSha256 !== x.reference.blobSha256 || b.artifact.contentSha256 !== x.reference.contentSha256) || x.dirty && b.revision === x.dirty.revision && (b.artifact.blobSha256 !== x.dirty.blobSha256 || b.artifact.contentSha256 !== x.dirty.contentSha256)) throw y();
130
+ return Y(), Object.freeze({
131
+ scope: r,
132
+ revision: b.revision,
133
+ bytes: b.artifact.bytes(),
134
+ blobSha256: b.artifact.blobSha256,
135
+ contentSha256: b.artifact.contentSha256
136
+ });
137
+ } finally {
138
+ u && clearTimeout(u), f?.(), n.removeEventListener("abort", s), U.delete(o), l && (H.delete(l), N.drop(r, l)), d && await d.catch(() => void 0);
139
+ }
140
+ });
141
+ return W.add(o), o.then(() => W.delete(o), () => W.delete(o)), o;
142
+ },
143
+ close: async () => {
144
+ J(), await Promise.allSettled([...W]);
145
+ },
146
+ observation: () => {
147
+ let e = N.observation();
148
+ return Object.freeze({
149
+ pending: H.size,
150
+ jobs: W.size,
151
+ receiving: e.pending,
152
+ receivingBytes: e.accountedBytes,
153
+ withdrawn: K
154
+ });
155
+ }
156
+ });
157
+ };
158
+ //#endregion
159
+ export { b as makeRoomGeometrySnapshotSource };
@@ -0,0 +1,76 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { geometryOwnData as n } from "./geometryTileCodec.js";
3
+ import { captureGeometryArtifact as r, verifyGeometryArtifact as i } from "./geometryArtifacts.js";
4
+ import { assertGeometryArtifactScope as a, captureGeometryCodecProfiles as o, captureGeometryPersistenceScope as s, geometryPersistenceId as c, geometryPersistenceInteger as l } from "./geometryPersistenceData.js";
5
+ import { captureRoomSnapshotEffectRunner as u } from "./snapshotBlobIndex.js";
6
+ import { captureGeometryStreamManifest as d } from "./geometryManifestData.js";
7
+ import { createGeometryChunkSnapshot as f } from "./geometrySnapshot.js";
8
+ import { Effect as p } from "effect";
9
+ //#region src/geometrySnapshotPreparation.ts
10
+ var m = (m, h, g) => {
11
+ try {
12
+ let _ = s(m), v = c(h), y = n(g, [
13
+ "manifest",
14
+ "persistence",
15
+ "staticSource",
16
+ "authorize",
17
+ "maxManifestChunks",
18
+ "maxManifestBytes",
19
+ "maxPatchBytes",
20
+ "codecLimits"
21
+ ], [
22
+ "manifest",
23
+ "persistence",
24
+ "staticSource",
25
+ "authorize"
26
+ ]), b = n(y.manifest, ["observe"]), x = n(y.persistence, [
27
+ "publish",
28
+ "observe",
29
+ "commit",
30
+ "exportSubject",
31
+ "eraseSubject"
32
+ ]), S = n(y.staticSource, ["load"]), C = (e, t, n, r) => Object.hasOwn(y, e) ? l(y[e], n, r) : t, w = C("maxManifestChunks", 256, 1, 4096), T = C("maxManifestBytes", 262144, 1024, 16777216), E = C("maxPatchBytes", 262144, 512, 16777216), D = Object.hasOwn(y, "codecLimits") ? o(y.codecLimits) : /* @__PURE__ */ new Map();
33
+ if (typeof b.observe != "function" || typeof x.observe != "function" || typeof S.load != "function" || typeof y.authorize != "function") throw new t({ detail: "Actual geometry snapshot source and admission capabilities required" });
34
+ let O = y.authorize.bind(g), k = b.observe.bind(y.manifest), A = x.observe.bind(y.persistence), j = S.load.bind(y.staticSource);
35
+ return p.flatMap(p.context(), (o) => p.uninterruptible(p.tryPromise({
36
+ try: async () => {
37
+ let e = u(o), c = O(_);
38
+ if (!p.isEffect(c) || await e(c) !== void 0) throw new t({ detail: "Geometry snapshot admission did not confirm void" });
39
+ let m = {
40
+ tenantId: _.tenantId,
41
+ kind: _.kind,
42
+ worldId: _.worldId,
43
+ layerSetId: _.layerSetId,
44
+ version: _.version
45
+ }, h = k(m);
46
+ if (!p.isEffect(h)) throw new t({ detail: "Actual manifest Effect required" });
47
+ let g = d(await e(h), w, T);
48
+ if (JSON.stringify(g.scope) !== JSON.stringify(m)) throw new t({ detail: "Snapshot source changed admitted root" });
49
+ let y = g.chunks.find((e) => e.cx === _.cx && e.cy === _.cy && e.cz === _.cz);
50
+ if (!y) throw new t({ detail: "Snapshot has no actual immutable source reference" });
51
+ let b = j(y);
52
+ if (!p.isEffect(b)) throw new t({ detail: "Actual static source Effect required" });
53
+ let x = await i(_.kind, await e(b), y.blobSha256, D.get(_.kind) ?? {});
54
+ if (a(x, _), x.contentSha256 !== y.contentSha256) throw new t({ detail: "Snapshot static reference content did not verify" });
55
+ let S = A(_);
56
+ if (!p.isEffect(S)) throw new t({ detail: "Actual current source Effect required" });
57
+ let C = n(await e(S), [
58
+ "scope",
59
+ "revision",
60
+ "artifact"
61
+ ]), M = {
62
+ scope: s(C.scope),
63
+ revision: l(C.revision),
64
+ artifact: r(C.artifact)
65
+ }, N = g.dirtyChunks.find((e) => e.scope.cx === _.cx && e.scope.cy === _.cy && e.scope.cz === _.cz);
66
+ if (JSON.stringify(s(M.scope)) !== JSON.stringify(_) || M.revision < (N?.revision ?? 0) || N && M.revision === N.revision && (M.artifact.blobSha256 !== N.blobSha256 || M.artifact.contentSha256 !== N.contentSha256)) throw new t({ detail: "Snapshot current source regressed its admitted metadata" });
67
+ return f(v, x, M, E, D.get(_.kind) ?? {});
68
+ },
69
+ catch: (n) => n instanceof e || n instanceof t ? n : new t({ detail: "Actual native geometry snapshot preparation remains unavailable" })
70
+ })));
71
+ } catch {
72
+ return p.fail(new t({ detail: "Geometry snapshot source request could not be captured" }));
73
+ }
74
+ };
75
+ //#endregion
76
+ export { m as prepareGeometryChunkSnapshot };
@@ -0,0 +1,191 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { RoomInputCodec as n } from "./stateCodec.js";
3
+ import { geometryOwnData as r } from "./geometryTileCodec.js";
4
+ import { captureGeometryPrivacyTarget as i, captureGeometrySubject as a, geometryPersistenceId as o, geometryPersistenceInteger as s } from "./geometryPersistenceData.js";
5
+ import { captureGeometryPreparedCoordinate as c } from "./geometryPrepared.js";
6
+ import { captureGeometryActorFrame as l } from "./geometryActorInventory.js";
7
+ import { captureRoomAdmittedSessionReader as u, captureRoomReliableChannelWriter as d } from "./serverSession.js";
8
+ import { GeometryChunkSnapshotFragmentSchema as f, captureGeometryChunkRequest as p, createGeometryChunkSnapshotFragments as m } from "./geometrySnapshotChannel.js";
9
+ import { captureRoomGeometryResourceState as h } from "./geometryHost.js";
10
+ import { prepareGeometryChunkSnapshot as g } from "./geometrySnapshotPreparation.js";
11
+ import { Effect as _ } from "effect";
12
+ //#region src/geometrySnapshotServer.ts
13
+ var v = (v, y, b) => {
14
+ let x = h(v), S = l(x.inventory).scope, C = r(b, [
15
+ "manifest",
16
+ "persistence",
17
+ "staticSource",
18
+ "resolveSubject",
19
+ "authorize",
20
+ "requestChannel",
21
+ "responseChannel",
22
+ "maxPending",
23
+ "maxPerPump",
24
+ "maxFragmentDeliveries",
25
+ "maxSubjectFences",
26
+ "maxPendingSnapshotBytes",
27
+ "maxManifestChunks",
28
+ "maxManifestBytes",
29
+ "maxPatchBytes",
30
+ "codecLimits"
31
+ ], [
32
+ "manifest",
33
+ "persistence",
34
+ "staticSource",
35
+ "resolveSubject",
36
+ "authorize"
37
+ ]), w = (e, t, n, r) => Object.hasOwn(C, e) ? s(C[e], n, r) : t, T = w("maxPending", 64, 1, 4096), E = w("maxPerPump", Math.min(16, T), 1, T), D = w("maxFragmentDeliveries", 8192, 1, 65536), O = w("maxSubjectFences", 4096, 1, 65536), k = w("maxPendingSnapshotBytes", 16777216, 512, 67108864), A = Object.hasOwn(C, "requestChannel") ? o(C.requestChannel, 96) : "geometryRequests", j = Object.hasOwn(C, "responseChannel") ? o(C.responseChannel, 96) : "geometrySnapshots", M = C.resolveSubject, N = C.authorize, P = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Set(), I = new n(f).schemaHash;
38
+ if (typeof y != "function" || typeof M != "function" || typeof N != "function" || A === j) throw new t({ detail: "Actual readonly Host geometry recovery capabilities required" });
39
+ let L = r(C.manifest, ["observe"]), R = r(C.persistence, [
40
+ "publish",
41
+ "observe",
42
+ "commit",
43
+ "exportSubject",
44
+ "eraseSubject"
45
+ ]), z = r(C.staticSource, ["load"]);
46
+ if (typeof L.observe != "function" || Object.values(R).some((e) => typeof e != "function") || typeof z.load != "function") throw new t({ detail: "Readonly geometry recovery needs complete actual own source methods before Actor hooks" });
47
+ let B = C.manifest, V = C.persistence, H = C.staticSource, U = {
48
+ ...Object.fromEntries(Object.entries(C).filter(([e]) => [
49
+ "maxManifestChunks",
50
+ "maxManifestBytes",
51
+ "maxPatchBytes",
52
+ "codecLimits"
53
+ ].includes(e))),
54
+ manifest: Object.freeze({ observe: L.observe.bind(B) }),
55
+ persistence: Object.freeze({
56
+ publish: R.publish.bind(V),
57
+ observe: R.observe.bind(V),
58
+ commit: R.commit.bind(V),
59
+ exportSubject: R.exportSubject.bind(V),
60
+ eraseSubject: R.eraseSubject.bind(V)
61
+ }),
62
+ staticSource: Object.freeze({ load: z.load.bind(H) })
63
+ }, W = (e) => JSON.stringify([e.id, e.kind]), G = (e) => !J && !Y && y().includes(e.session) && JSON.stringify(u(e.session).identity()) === JSON.stringify(e.identity), K = (e) => ({
64
+ tenantId: e.identity.tenantId,
65
+ roomId: e.identity.roomId,
66
+ sessionId: e.identity.sessionId,
67
+ subjectId: e.identity.subjectId,
68
+ epoch: e.identity.epoch
69
+ }), q = async (e) => {
70
+ let n = M.call(b, K(e));
71
+ if (!_.isEffect(n)) throw new t({ detail: "Readonly geometry Subject lookup needs an actual Effect" });
72
+ let r = a(await _.runPromise(n));
73
+ if (r.id !== e.identity.subjectId || e.subject !== null && W(e.subject) !== W(r) || !G(e)) throw new t({ detail: "Readonly geometry Subject changed native admission" });
74
+ return e.subject = r, r;
75
+ }, J = !1, Y = !1, X = null;
76
+ return Object.freeze({
77
+ requestChannel: A,
78
+ responseChannel: j,
79
+ stage: (n, r) => {
80
+ if (J || Y || !y().includes(n)) throw new t({ detail: "Readonly geometry request has no owned current Session" });
81
+ let i = u(n).identity(), a = p(S, r);
82
+ if (!i || i.tenantId !== x.scope.tenantId || i.roomId !== x.scope.roomId || i.epoch !== x.scope.epoch) throw new t({ detail: "Readonly geometry request escaped actual Room owner" });
83
+ let o = JSON.stringify([
84
+ i.sessionId,
85
+ i.epoch,
86
+ a.requestId
87
+ ]), s = c(S, a.coordinate), l = P.get(o);
88
+ if (l) {
89
+ if (l.session !== n || JSON.stringify(l.request) !== JSON.stringify(a)) throw new t({ detail: "Readonly geometry request identity changed intention" });
90
+ } else {
91
+ if (P.size >= T) throw new e({
92
+ budget: "geometryHostPendingReads",
93
+ limit: T
94
+ });
95
+ P.set(o, {
96
+ session: n,
97
+ identity: i,
98
+ request: a,
99
+ scope: s,
100
+ subject: null,
101
+ snapshot: null
102
+ });
103
+ }
104
+ },
105
+ withdrawSubject: async (n) => {
106
+ let r = i(n);
107
+ if (r.tenantId !== x.scope.tenantId || Y) throw new t({ detail: "Readonly geometry withdrawal requires its actual tenant" });
108
+ let a = W(r.subject);
109
+ if (!F.has(a) && F.size >= O) throw new e({
110
+ budget: "geometryHostReadSubjectFences",
111
+ limit: O
112
+ });
113
+ F.add(a);
114
+ let o = X;
115
+ o && await o.catch(() => void 0);
116
+ for (let [e, t] of P) {
117
+ if (!G(t)) {
118
+ P.delete(e);
119
+ continue;
120
+ }
121
+ let n = t.subject ?? await q(t);
122
+ W(n) === a && P.delete(e);
123
+ }
124
+ },
125
+ fence: () => {
126
+ J = !0;
127
+ },
128
+ pump: async () => {
129
+ if (J || Y) return;
130
+ if (X) throw new t({ detail: "Readonly geometry Host pump already active" });
131
+ let n = Promise.resolve().then(async () => {
132
+ let n = 0, r = 0;
133
+ for (let [i, a] of P) {
134
+ if (n >= E) break;
135
+ if (!G(a)) P.delete(i);
136
+ else {
137
+ try {
138
+ let n = await q(a);
139
+ if (F.has(W(n))) {
140
+ P.delete(i);
141
+ continue;
142
+ }
143
+ let o = N.call(b, K(a), a.scope);
144
+ if (!_.isEffect(o) || await _.runPromise(o) !== void 0 || !G(a) || F.has(W(n))) throw new t({ detail: "Readonly geometry current rights did not confirm" });
145
+ if (!a.snapshot) {
146
+ let t = await _.runPromise(g(a.scope, a.request.requestId, {
147
+ ...U,
148
+ authorize: (e) => N.call(b, K(a), e)
149
+ }));
150
+ if ([...P.values()].reduce((e, t) => e + (t.snapshot?.patch.length ?? 0), 0) + t.patch.length > k) throw new e({
151
+ budget: "geometryHostPendingSnapshotBytes",
152
+ limit: k
153
+ });
154
+ a.snapshot = t;
155
+ }
156
+ let s = m(a.snapshot, U.maxPatchBytes ?? 262144);
157
+ if (r + s.length > D) throw new e({
158
+ budget: "geometryHostReadFragmentDeliveries",
159
+ limit: D
160
+ });
161
+ let c = d(a.session);
162
+ for (let e of s) {
163
+ let n = await q(a), i = N.call(b, K(a), a.scope);
164
+ if (!_.isEffect(i) || await _.runPromise(i) !== void 0 || !G(a) || F.has(W(n))) throw new t({ detail: "Readonly geometry current recipient rights were withdrawn" });
165
+ await c.write(j, e, I), r++;
166
+ }
167
+ } catch (t) {
168
+ if (t instanceof e && t.budget === "geometryHostReadFragmentDeliveries") break;
169
+ a.failures = (a.failures ?? 0) + 1, a.failures >= 8 && P.delete(i);
170
+ continue;
171
+ }
172
+ P.delete(i), n++;
173
+ }
174
+ }
175
+ });
176
+ X = n;
177
+ try {
178
+ await n;
179
+ } finally {
180
+ X = null;
181
+ }
182
+ },
183
+ close: async () => {
184
+ J = !0;
185
+ let e = X;
186
+ e && await e.catch(() => void 0), P.clear(), F.clear(), Y = !0;
187
+ }
188
+ });
189
+ };
190
+ //#endregion
191
+ export { v as makeRoomGeometrySnapshotServer };
@@ -0,0 +1,21 @@
1
+ import { ProtocolError as e } from "./errors.js";
2
+ import { ROOMS_TABLE as t } from "./identities.js";
3
+ import { and as n, eq as r } from "@voltro/database";
4
+ //#region src/geometrySqlOwner.ts
5
+ var i = async (i, a, o) => {
6
+ let s = await i.query({
7
+ table: t,
8
+ predicate: n(r("tenantId", a.tenantId), r("id", o.roomId)),
9
+ order: [{
10
+ column: "id",
11
+ direction: "asc"
12
+ }],
13
+ take: 2,
14
+ skip: void 0,
15
+ projection: void 0,
16
+ lock: "update"
17
+ }), c = s[0];
18
+ if (s.length !== 1 || c?.tenantId !== a.tenantId || c.id !== o.roomId || c.hostId !== o.hostId || c.epoch !== o.epoch || c.state !== "live" || c.erasure != null || c.snapshotErasure != null) throw new e({ detail: "Geometry SQL owner remains unavailable" });
19
+ };
20
+ //#endregion
21
+ export { i as assertGeometrySqlOwner };
@@ -0,0 +1,127 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { geometryOwnData as n } from "./geometryTileCodec.js";
3
+ import { admitGeometryChunkForKind as r, captureGeometryArtifact as i, verifyGeometryArtifact as a } from "./geometryArtifacts.js";
4
+ import { assertGeometryArtifactScope as o, captureGeometryCodecProfiles as s, captureGeometryStaticReference as c, geometryPersistenceId as l, geometryPersistenceInteger as u } from "./geometryPersistenceData.js";
5
+ import { captureRoomSnapshotEffectRunner as d } from "./snapshotBlobIndex.js";
6
+ import { geometryPersistenceScopeKey as f } from "./geometryPersistenceCapture.js";
7
+ import { geometryStorageClaim as p, geometryStorageOperation as m } from "./geometryStorageIdentity.js";
8
+ import { Effect as h, Stream as g } from "effect";
9
+ //#region src/geometryStorage.ts
10
+ function _() {
11
+ throw new t({ detail: "Geometry immutable Storage custody or exact claim remains unconfirmed" });
12
+ }
13
+ var v = (e, t) => {
14
+ if (!e || typeof e != "object") return _();
15
+ let n = Object.getOwnPropertyDescriptor(e, t);
16
+ return !n?.enumerable || !("value" in n) || typeof n.value != "function" ? _() : n.value.bind(e);
17
+ }, y = (y, b) => {
18
+ let x = n(b, [
19
+ "bucket",
20
+ "metadata",
21
+ "destination",
22
+ "visibility",
23
+ "maxBytes",
24
+ "codecLimits",
25
+ "authorize"
26
+ ], [
27
+ "bucket",
28
+ "metadata",
29
+ "authorize"
30
+ ]), S = l(x.bucket), C = Object.hasOwn(x, "destination") ? l(x.destination) : void 0, w = Object.hasOwn(x, "visibility") ? x.visibility : "private", T = Object.hasOwn(x, "maxBytes") ? u(x.maxBytes, 512, 16777216) : 16777216, E = s(Object.hasOwn(x, "codecLimits") ? x.codecLimits : {}), D = v(y, "put"), O = v(y, "head"), k = v(y, "getStream"), A = v(y, "delete"), j = v(x.metadata, "lookup"), M = x.authorize;
31
+ if (w !== "private" && w !== "public" || typeof M != "function") return _();
32
+ let N = M, P = (e) => E.get(e) ?? {}, F = (e) => ({
33
+ tenantId: e.tenantId,
34
+ bucket: S,
35
+ operationId: m(e)
36
+ }), I = (e, t, n) => !e || n !== void 0 && e.id !== n || e.tenantId !== t.tenantId || e.bucket !== S || e.checksum !== t.blobSha256 || e.visibility !== w || e.contentType !== "application/octet-stream" ? _() : (l(e.id), u(e.size, 12, T), e), L = async (e, t) => h.isEffect(t) ? e(t) : _(), R = async (e, t, n) => {
37
+ if (await L(e, N(t, n)) !== void 0) return _();
38
+ }, z = (n) => h.flatMap(h.context(), (r) => h.uninterruptible(h.tryPromise({
39
+ try: () => n(d(r)),
40
+ catch: (n) => n instanceof e ? n : new t({ detail: "Geometry immutable Storage operation remains unconfirmed" })
41
+ }))), B = () => h.fail(new t({ detail: "Geometry immutable Storage reference could not be captured" }));
42
+ return Object.freeze({
43
+ source: Object.freeze({ load: (e) => {
44
+ try {
45
+ let t = c(e);
46
+ return z(async (e) => {
47
+ await R(e, "load", t);
48
+ let n = await j(F(t), p(t));
49
+ if (!n || n.state !== "ready" || n.held !== !0) return _();
50
+ let r = I(n.ref, t);
51
+ if (I(await L(e, O(r.id, { tenantId: t.tenantId })), t, r.id).size !== r.size) return _();
52
+ let i = await L(e, k(r.id, { tenantId: t.tenantId }));
53
+ if (I(i.ref, t, r.id), i.ref.size !== r.size) return _();
54
+ let s = new Uint8Array(r.size), c = 0;
55
+ if (await L(e, g.runForEach(i.stream, (e) => h.sync(() => {
56
+ if (!(e instanceof Uint8Array) || e.buffer instanceof SharedArrayBuffer || e.length > s.length - c) return _();
57
+ s.set(e, c), c += e.length;
58
+ }))), c !== s.length) return _();
59
+ let l = await a(t.kind, s, t.blobSha256, P(t.kind));
60
+ if (o(l, t), l.contentSha256 !== t.contentSha256) return _();
61
+ let u = await j(F(t), p(t));
62
+ return !u || u.state !== "ready" || !u.held || I(u.ref, t, r.id).size !== r.size ? _() : (await R(e, "load", t), l.bytes());
63
+ });
64
+ } catch {
65
+ return B();
66
+ }
67
+ } }),
68
+ store: (n, a) => {
69
+ try {
70
+ let t = l(n), o = i(a), s = o.chunk, u = c({
71
+ tenantId: t,
72
+ kind: s.kind,
73
+ worldId: s.address.worldId,
74
+ layerSetId: s.address.layerSetId,
75
+ version: s.version,
76
+ cx: s.address.cx,
77
+ cy: s.address.cy,
78
+ ..."cz" in s.address ? { cz: s.address.cz } : {},
79
+ blobSha256: o.blobSha256,
80
+ contentSha256: o.contentSha256
81
+ }), d = o.bytes();
82
+ if (d.length > T) throw new e({
83
+ budget: "geometryStaticStoreBytes",
84
+ limit: T
85
+ });
86
+ return r(u.kind, s, P(u.kind)), z(async (e) => {
87
+ await R(e, "store", u);
88
+ let n = await L(e, D({
89
+ tenantId: t,
90
+ bytes: new Uint8Array(d),
91
+ contentType: "application/octet-stream",
92
+ visibility: w,
93
+ operationId: m(u),
94
+ claim: p(u),
95
+ key: "geometry/" + f(u) + "/" + u.blobSha256,
96
+ ...C === void 0 ? {} : { destination: C }
97
+ })), r = await j(F(u), p(u)), i = I(n, u);
98
+ return i.size !== d.length || !r || r.state !== "ready" || !r.held || I(r.ref, u).id !== i.id ? _() : (await R(e, "store", u), u);
99
+ });
100
+ } catch (n) {
101
+ return h.fail(n instanceof e ? n : new t({ detail: "Geometry actual artifact or Storage profile could not be captured" }));
102
+ }
103
+ },
104
+ release: (e) => {
105
+ try {
106
+ let t = c(e);
107
+ return z(async (e) => {
108
+ await R(e, "release", t);
109
+ let n = await j(F(t), p(t));
110
+ if (!n || n.state === "reserved") return _();
111
+ let r = I(n.ref, t);
112
+ if (n.state === "deleted" || n.state === "ready" && !n.held) return;
113
+ if (await L(e, A(r.id, {
114
+ tenantId: t.tenantId,
115
+ claim: p(t)
116
+ })) !== void 0) return _();
117
+ let i = await j(F(t), p(t));
118
+ if (!i || i.state !== "deleted" && i.state !== "ready" || i.held || I(i.ref, t).id !== r.id) return _();
119
+ });
120
+ } catch {
121
+ return B();
122
+ }
123
+ }
124
+ });
125
+ };
126
+ //#endregion
127
+ export { y as storageGeometry };
@@ -0,0 +1,69 @@
1
+ import { ProtocolError as e } from "./errors.js";
2
+ import { geometryOwnData as t } from "./geometryTileCodec.js";
3
+ import { captureGeometryStaticReference as n, geometryPersistenceId as r, geometryPersistenceInteger as i } from "./geometryPersistenceData.js";
4
+ import { captureRoomSnapshotEffectRunner as a } from "./snapshotBlobIndex.js";
5
+ import { geometryStorageClaim as o, geometryStorageOperation as s } from "./geometryStorageIdentity.js";
6
+ import { Subject as c } from "@voltro/protocol";
7
+ import { Effect as l, Schema as u } from "effect";
8
+ //#region src/geometryStorageGrant.ts
9
+ var d = (d, f) => {
10
+ let p = t(f, [
11
+ "bucket",
12
+ "metadata",
13
+ "origin",
14
+ "visibility",
15
+ "expiresInSec",
16
+ "maxBytes",
17
+ "authorize"
18
+ ], [
19
+ "bucket",
20
+ "metadata",
21
+ "origin",
22
+ "authorize"
23
+ ]), m = t(d, ["head", "mintUrl"]), h = r(p.bucket), g = p.metadata && typeof p.metadata == "object" ? Object.getOwnPropertyDescriptor(p.metadata, "lookup") : void 0, _ = { lookup: g?.enumerable && "value" in g ? g.value : void 0 }, v = Object.hasOwn(p, "visibility") ? p.visibility : "private", y = Object.hasOwn(p, "expiresInSec") ? i(p.expiresInSec, 1, 3600) : 300, b = Object.hasOwn(p, "maxBytes") ? i(p.maxBytes, 512, 16777216) : 16777216;
24
+ if (typeof p.origin != "string" || typeof p.authorize != "function" || typeof m.head != "function" || typeof m.mintUrl != "function" || typeof _.lookup != "function" || !["private", "public"].includes(v)) throw new e({ detail: "Actual scoped geometry Storage read grant capabilities required" });
25
+ let x = new URL(p.origin);
26
+ if (!["http:", "https:"].includes(x.protocol) || x.username || x.password || x.search || x.hash || x.pathname !== "/") throw new e({ detail: "Actual geometry Storage API origin required" });
27
+ let S = m.head.bind(d), C = m.mintUrl.bind(d), w = _.lookup.bind(p.metadata), T = p.authorize.bind(f), E = (t, n, a) => {
28
+ if (!t || t.tenantId !== n.tenantId || t.bucket !== h || t.checksum !== n.blobSha256 || t.visibility !== v || t.contentType !== "application/octet-stream" || a !== void 0 && t.id !== a) throw new e({ detail: "Geometry Storage URL has no exact held source reference" });
29
+ return r(t.id), i(t.size, 12, b), t;
30
+ };
31
+ return Object.freeze({ grant: (t, r) => {
32
+ try {
33
+ let i = n(t), d = u.decodeUnknownSync(c)(structuredClone(r));
34
+ if (d.type !== "user" || d.tenantId !== i.tenantId || !d.id.trim()) throw new e({ detail: "Geometry read URL requires actual authenticated tenant player" });
35
+ return d.scopes && Object.freeze(d.scopes), Object.freeze(d), l.flatMap(l.context(), (t) => l.uninterruptible(l.tryPromise({
36
+ try: async () => {
37
+ let n = a(t), r = async () => {
38
+ let t = T(i, d);
39
+ if (!l.isEffect(t) || await n(t) !== void 0) throw new e({ detail: "Geometry URL current read rights did not confirm void" });
40
+ }, c = {
41
+ tenantId: i.tenantId,
42
+ bucket: h,
43
+ operationId: s(i)
44
+ }, u = o(i);
45
+ await r();
46
+ let f = await w(c, u);
47
+ if (!f || f.state !== "ready" || !f.held) throw new e({ detail: "Geometry URL requires actual ready held Storage operation" });
48
+ let p = E(f.ref, i), m = S(p.id, { tenantId: i.tenantId });
49
+ if (!l.isEffect(m)) throw new e({ detail: "Geometry URL requires actual Storage head Effect" });
50
+ if (E(await n(m), i, p.id).size !== p.size) throw new e({ detail: "Geometry URL source size changed" });
51
+ let g = C(p.id, d, { expiresInSec: y });
52
+ if (!l.isEffect(g)) throw new e({ detail: "Geometry URL requires actual Storage access mint Effect" });
53
+ let _ = await n(g);
54
+ if (typeof _ != "string" || _.length > 16384) throw new e({ detail: "Geometry URL issuer returned invalid locator" });
55
+ let v = new URL(_, x);
56
+ if (!["http:", "https:"].includes(v.protocol) || v.username || v.password || v.hash) throw new e({ detail: "Geometry URL issuer returned forbidden locator authority" });
57
+ let b = await w(c, u);
58
+ if (!b || b.state !== "ready" || !b.held || E(b.ref, i, p.id).size !== p.size) throw new e({ detail: "Geometry URL claim changed while access minted" });
59
+ return await r(), v.href;
60
+ },
61
+ catch: () => new e({ detail: "Actual scoped geometry Storage URL remains unavailable" })
62
+ })));
63
+ } catch {
64
+ return l.fail(new e({ detail: "Geometry read grant scope/Subject could not be captured" }));
65
+ }
66
+ } });
67
+ };
68
+ //#endregion
69
+ export { d as storageGeometryReadGrants };
@@ -0,0 +1,9 @@
1
+ import { geometryPersistenceDigest as e, geometryPersistenceScopeKey as t } from "./geometryPersistenceCapture.js";
2
+ //#region src/geometryStorageIdentity.ts
3
+ var n = (n) => "geometry:static:" + e(JSON.stringify([
4
+ t(n),
5
+ n.blobSha256,
6
+ n.contentSha256
7
+ ])), r = (e) => "geometry:static:" + t(e);
8
+ //#endregion
9
+ export { r as geometryStorageClaim, n as geometryStorageOperation };
@@ -0,0 +1,10 @@
1
+ import { createGeometryArtifact as e, verifyGeometryArtifact as t } from "./geometryArtifacts.js";
2
+ //#region src/geometryTileArtifact.ts
3
+ var n = (e) => Object.freeze({
4
+ chunk: e.chunk,
5
+ blobSha256: e.blobSha256,
6
+ tileDataSha256: e.contentSha256,
7
+ bytes: e.bytes
8
+ }), r = async (t, r = {}) => n(await e(t, r)), i = async (e, r, i = {}) => n(await t("2d-tiles", e, r, i));
9
+ //#endregion
10
+ export { r as createGeometryTileArtifact, i as verifyGeometryTileArtifact };